@kizunajs/kotlin 2.0.0-beta.34 → 2.0.0-beta.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs
CHANGED
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as generateKotlinClient } from "./generator-
|
|
2
|
+
import { t as generateKotlinClient } from "./generator-DRWVjcfl.mjs";
|
|
3
3
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { dirname, resolve } from "node:path";
|
|
5
5
|
import { parseArgs } from "node:util";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isBinarySchema, isDiscriminatedUnionSchema, isFileSchema, isHintPrefix, isIntegerSchema, isJsonMediaType, isNamedStream, isObjectSchema, isStreamResponse, isSuccessStatus, localTypeName, mergeHeaderFields, parsePath, readDef, readDefType, readDeprecation, readDiscriminatedUnion, readDiscriminatorStringLiteral, readMetaBrand, readMetaDescription, readMetaId, readModelSchema, readObjectShape, resolveResponseBody, resolveResponseContentType, resolveResponseHeaders, routeStreams, sanitizeFieldName, sanitizeIdentifier, shortTypeName, soleStreamResponse, statusToCamelCase, streamMode, toCamelCase, toPascalCase, unwrapOptionalWrappers, walkApi } from "kizunajs/generator";
|
|
1
|
+
import { isBinarySchema, isDiscriminatedUnionSchema, isFileSchema, isHintPrefix, isIntegerSchema, isJsonMediaType, isJsonQueryField, isNamedStream, isObjectSchema, isStreamResponse, isSuccessStatus, localTypeName, mergeHeaderFields, parsePath, readDef, readDefType, readDeprecation, readDiscriminatedUnion, readDiscriminatorStringLiteral, readMetaBrand, readMetaDescription, readMetaId, readModelSchema, readObjectShape, resolveResponseBody, resolveResponseContentType, resolveResponseHeaders, routeStreams, sanitizeFieldName, sanitizeIdentifier, shortTypeName, soleStreamResponse, statusToCamelCase, streamMode, toCamelCase, toPascalCase, uniqueNames, unwrapOptionalWrappers, validatesRequest, walkApi } from "kizunajs/generator";
|
|
2
2
|
//#region src/emit.ts
|
|
3
3
|
var KotlinWriter = class {
|
|
4
4
|
lines = [];
|
|
@@ -477,7 +477,11 @@ const buildRouteMethod = (routeKey, route, registry, deprecated, deprecationMess
|
|
|
477
477
|
const baseHint = toPascalCase(fullJoinedName);
|
|
478
478
|
const pathParams = parsePath(route.path).paramNames;
|
|
479
479
|
const declaredPathParams = route.pathParams ? collectObjectFields(route.pathParams, registry, `${baseHint}Params`) : [];
|
|
480
|
-
const
|
|
480
|
+
const queryShape = route.query ? readObjectShape(route.query) ?? {} : {};
|
|
481
|
+
const queryFields = route.query ? collectObjectFields(route.query, registry, `${baseHint}Query`).map((field) => ({
|
|
482
|
+
...field,
|
|
483
|
+
json: isJsonQueryField(queryShape[field.wireName])
|
|
484
|
+
})) : [];
|
|
481
485
|
const headerFields = route.headers ? collectObjectFields(route.headers, registry, `${baseHint}Headers`) : [];
|
|
482
486
|
const bodyDefType = route.body?._def?.type ?? route.body?.def?.type;
|
|
483
487
|
let bodyDescriptor;
|
|
@@ -577,7 +581,7 @@ const buildRouteMethod = (routeKey, route, registry, deprecated, deprecationMess
|
|
|
577
581
|
type: typeExpression
|
|
578
582
|
});
|
|
579
583
|
}
|
|
580
|
-
if (route
|
|
584
|
+
if (validatesRequest(route)) {
|
|
581
585
|
const has400 = errorCases.some((candidate) => candidate.status === 400);
|
|
582
586
|
errorCases.push({
|
|
583
587
|
caseName: has400 ? "validationError" : statusToCamelCase(400),
|
|
@@ -797,28 +801,28 @@ const enumConstantName = (value) => {
|
|
|
797
801
|
const emitEnumClass = (writer, name, cases, unknownCase, description) => {
|
|
798
802
|
writer.blank();
|
|
799
803
|
writer.docComment(description);
|
|
804
|
+
const constants = uniqueNames(cases.map(enumConstantName));
|
|
800
805
|
if (!unknownCase) {
|
|
801
806
|
writer.line("@Serializable");
|
|
802
807
|
writer.block(`enum class ${name}(override val wireValue: String) : KizunaQueryValue`, () => {
|
|
803
808
|
for (let index = 0; index < cases.length; index += 1) {
|
|
804
809
|
const caseName = cases[index];
|
|
805
|
-
const enumConstant = enumConstantName(caseName);
|
|
806
810
|
const separator = index < cases.length - 1 ? "," : "";
|
|
807
|
-
writer.line(`@SerialName(${stringLiteral(caseName)}) ${
|
|
811
|
+
writer.line(`@SerialName(${stringLiteral(caseName)}) ${constants[index]}(${stringLiteral(caseName)})${separator}`);
|
|
808
812
|
}
|
|
809
813
|
});
|
|
810
814
|
return;
|
|
811
815
|
}
|
|
812
816
|
writer.line(`@Serializable(with = ${name}.Serializer::class)`);
|
|
813
817
|
writer.block(`sealed interface ${name} : KizunaQueryValue`, () => {
|
|
814
|
-
for (
|
|
815
|
-
writer.line(`override val wireValue: String = ${stringLiteral(
|
|
818
|
+
for (let index = 0; index < cases.length; index += 1) writer.block(`data object ${constants[index]} : ${name}`, () => {
|
|
819
|
+
writer.line(`override val wireValue: String = ${stringLiteral(cases[index])}`);
|
|
816
820
|
});
|
|
817
821
|
writer.line(`data class Unknown(override val wireValue: String) : ${name}`);
|
|
818
822
|
writer.blank();
|
|
819
823
|
writer.block("companion object", () => {
|
|
820
824
|
writer.block(`fun fromWireValue(wireValue: String): ${name} = when (wireValue)`, () => {
|
|
821
|
-
for (
|
|
825
|
+
for (let index = 0; index < cases.length; index += 1) writer.line(`${stringLiteral(cases[index])} -> ${constants[index]}`);
|
|
822
826
|
writer.line("else -> Unknown(wireValue)");
|
|
823
827
|
});
|
|
824
828
|
});
|
|
@@ -832,7 +836,7 @@ const emitEnumClass = (writer, name, cases, unknownCase, description) => {
|
|
|
832
836
|
});
|
|
833
837
|
});
|
|
834
838
|
};
|
|
835
|
-
const emitDataClass = (writer, type, ownedTypeMap, ownedTypeLookup, registryName) => {
|
|
839
|
+
const emitDataClass = (writer, type, ownedTypeMap, ownedTypeLookup, registryName, registry, withBuilders = false) => {
|
|
836
840
|
const lookupName = registryName ?? type.name;
|
|
837
841
|
const baseFields = type.discriminatorWireName ? type.fields.filter((field) => field.wireName !== type.discriminatorWireName) : type.fields;
|
|
838
842
|
const hasFile = baseFields.some((field) => field.isFile);
|
|
@@ -873,15 +877,86 @@ const emitDataClass = (writer, type, ownedTypeMap, ownedTypeLookup, registryName
|
|
|
873
877
|
writer.line(")");
|
|
874
878
|
}
|
|
875
879
|
if (type.sealedParent !== void 0) writer.appendToLastLine(` : ${type.sealedParent}`);
|
|
876
|
-
|
|
880
|
+
const builds = withBuilders && !hasFile && isBuilderModel(type);
|
|
881
|
+
if (hasOwnedTypes || builds) {
|
|
877
882
|
writer.appendToLastLine(" {");
|
|
878
883
|
writer.indent(() => {
|
|
879
|
-
emitOwnedTypes(writer, lookupName, ownedTypeMap, ownedTypeLookup);
|
|
884
|
+
if (hasOwnedTypes) emitOwnedTypes(writer, lookupName, ownedTypeMap, ownedTypeLookup, registry, withBuilders);
|
|
885
|
+
if (builds) {
|
|
886
|
+
const lookup = (name) => registry?.get(name) ?? ownedTypeLookup.get(name);
|
|
887
|
+
emitBuilders(writer, type.name, adjustedFields, baseFields, lookup);
|
|
888
|
+
}
|
|
880
889
|
});
|
|
881
890
|
writer.line("}");
|
|
882
891
|
}
|
|
883
892
|
};
|
|
884
|
-
|
|
893
|
+
/**
|
|
894
|
+
* A data class whose fields are all optional, so it can be written one field at a time.
|
|
895
|
+
*/
|
|
896
|
+
const isBuilderModel = (type) => type?.kind === "data-class" && type.sealedParent === void 0 && type.discriminatorWireName === void 0 && type.fields.length > 0 && type.fields.every((field) => field.optional && field.requiredNullable !== true && field.isFile !== true);
|
|
897
|
+
/**
|
|
898
|
+
* What a field holds: one value or a list of them, and the type named inside.
|
|
899
|
+
*/
|
|
900
|
+
const fieldTarget = (fieldType) => {
|
|
901
|
+
const stripped = fieldType.endsWith("?") ? fieldType.slice(0, -1) : fieldType;
|
|
902
|
+
const list = stripped.startsWith("List<") && stripped.endsWith(">");
|
|
903
|
+
return {
|
|
904
|
+
list,
|
|
905
|
+
inner: list ? stripped.slice(5, -1) : stripped
|
|
906
|
+
};
|
|
907
|
+
};
|
|
908
|
+
/**
|
|
909
|
+
* `Builder` writes one of these field by field and `ListBuilder` a list of them, one block per item:
|
|
910
|
+
* `where { or { name { contains = "ada" } } }`.
|
|
911
|
+
*/
|
|
912
|
+
const emitBuilders = (writer, className, fields, rawFields, lookup) => {
|
|
913
|
+
const targets = fields.map((field, index) => {
|
|
914
|
+
const { list, inner } = fieldTarget(field.type);
|
|
915
|
+
return {
|
|
916
|
+
name: escapeKeyword(field.name),
|
|
917
|
+
type: field.type,
|
|
918
|
+
list,
|
|
919
|
+
inner,
|
|
920
|
+
buildable: isBuilderModel(lookup(fieldTarget(rawFields[index].type).inner))
|
|
921
|
+
};
|
|
922
|
+
});
|
|
923
|
+
const blockOf = (target) => `${target.inner}.${target.list ? "ListBuilder" : "Builder"}`;
|
|
924
|
+
writer.blank();
|
|
925
|
+
writer.line("@KizunaDsl");
|
|
926
|
+
writer.block("class Builder", () => {
|
|
927
|
+
for (const target of targets) writer.line(`var ${target.name}: ${optionalize(target.type, true)} = null`);
|
|
928
|
+
for (const target of targets) {
|
|
929
|
+
if (!target.buildable) continue;
|
|
930
|
+
writer.blank();
|
|
931
|
+
writer.block(`fun ${target.name}(build: ${blockOf(target)}.() -> Unit)`, () => {
|
|
932
|
+
writer.line(`${target.name} = ${blockOf(target)}().apply(build).build()`);
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
writer.blank();
|
|
936
|
+
writer.line(`fun build(): ${className} = ${className}(${targets.map((target) => `${target.name} = ${target.name}`).join(", ")})`);
|
|
937
|
+
});
|
|
938
|
+
writer.blank();
|
|
939
|
+
writer.line("@KizunaDsl");
|
|
940
|
+
writer.block("class ListBuilder", () => {
|
|
941
|
+
writer.line(`private val items = mutableListOf<${className}>()`);
|
|
942
|
+
writer.blank();
|
|
943
|
+
writer.block(`fun add(item: ${className})`, () => {
|
|
944
|
+
writer.line("items += item");
|
|
945
|
+
});
|
|
946
|
+
for (const target of targets) {
|
|
947
|
+
writer.blank();
|
|
948
|
+
if (target.buildable) writer.block(`fun ${target.name}(build: ${blockOf(target)}.() -> Unit)`, () => {
|
|
949
|
+
writer.line(`items += ${className}(${target.name} = ${blockOf(target)}().apply(build).build())`);
|
|
950
|
+
});
|
|
951
|
+
else writer.block(`fun ${target.name}(value: ${optionalize(target.type, false)})`, () => {
|
|
952
|
+
writer.line(`items += ${className}(${target.name} = value)`);
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
writer.blank();
|
|
956
|
+
writer.line(`fun build(): List<${className}> = items.toList()`);
|
|
957
|
+
});
|
|
958
|
+
};
|
|
959
|
+
const emitOwnedTypes = (writer, ownerName, ownedTypeMap, ownedTypeLookup, registry, withBuilders = false) => {
|
|
885
960
|
for (const [ownedName, owningType] of ownedTypeMap) {
|
|
886
961
|
if (owningType !== ownerName) continue;
|
|
887
962
|
const ownedType = ownedTypeLookup.get(ownedName);
|
|
@@ -890,7 +965,7 @@ const emitOwnedTypes = (writer, ownerName, ownedTypeMap, ownedTypeLookup, regist
|
|
|
890
965
|
emitType(writer, {
|
|
891
966
|
...ownedType,
|
|
892
967
|
name: shortName
|
|
893
|
-
}, ownedTypeMap, ownedTypeLookup, ownedName, registry);
|
|
968
|
+
}, ownedTypeMap, ownedTypeLookup, ownedName, registry, withBuilders);
|
|
894
969
|
}
|
|
895
970
|
};
|
|
896
971
|
const relativeOwnedPath = (typeName, ownedTypeMap, enclosingPath, registry) => {
|
|
@@ -978,10 +1053,10 @@ const emitSealedClass = (writer, type, registry, ownedTypeMap, ownedTypeLookup)
|
|
|
978
1053
|
}
|
|
979
1054
|
});
|
|
980
1055
|
};
|
|
981
|
-
const emitType = (writer, type, ownedTypeMap = /* @__PURE__ */ new Map(), ownedTypeLookup = /* @__PURE__ */ new Map(), registryName, registry) => {
|
|
1056
|
+
const emitType = (writer, type, ownedTypeMap = /* @__PURE__ */ new Map(), ownedTypeLookup = /* @__PURE__ */ new Map(), registryName, registry, withBuilders = false) => {
|
|
982
1057
|
writer.blank();
|
|
983
1058
|
writer.docComment(type.description);
|
|
984
|
-
if (type.kind === "data-class") emitDataClass(writer, type, ownedTypeMap, ownedTypeLookup, registryName);
|
|
1059
|
+
if (type.kind === "data-class") emitDataClass(writer, type, ownedTypeMap, ownedTypeLookup, registryName, registry, withBuilders);
|
|
985
1060
|
else if (type.kind === "enum-class") emitEnumClass(writer, type.name, type.cases, type.unknownCase, type.description);
|
|
986
1061
|
else if (registry) emitSealedClass(writer, type, registry, ownedTypeMap, ownedTypeLookup);
|
|
987
1062
|
};
|
|
@@ -995,8 +1070,8 @@ const emitBrand = (writer, brand) => {
|
|
|
995
1070
|
writer.line(`override fun toString(): String = ${brand.rawType === "String" ? "value" : "value.toString()"}`);
|
|
996
1071
|
});
|
|
997
1072
|
};
|
|
998
|
-
const emitTypes = (writer, types, ownedTypeMap = /* @__PURE__ */ new Map(), ownedTypeLookup = /* @__PURE__ */ new Map(), registry) => {
|
|
999
|
-
for (const type of types) emitType(writer, type, ownedTypeMap, ownedTypeLookup, void 0, registry);
|
|
1073
|
+
const emitTypes = (writer, types, ownedTypeMap = /* @__PURE__ */ new Map(), ownedTypeLookup = /* @__PURE__ */ new Map(), registry, withBuilders = false) => {
|
|
1074
|
+
for (const type of types) emitType(writer, type, ownedTypeMap, ownedTypeLookup, void 0, registry, withBuilders);
|
|
1000
1075
|
};
|
|
1001
1076
|
const emitConstructorClass = (writer, declaration, params) => {
|
|
1002
1077
|
if (params.length === 1) writer.line(`${declaration}(${params[0]})`);
|
|
@@ -1282,9 +1357,20 @@ const emitArgsScaffolding = (writer, method, context) => {
|
|
|
1282
1357
|
writer.block("sealed interface Args", () => {
|
|
1283
1358
|
for (const channel of channels) writer.line(`val ${channel.varName}: ${channel.className}${channel.required ? "" : "?"}`);
|
|
1284
1359
|
});
|
|
1360
|
+
const namespacePrefix = `${context.namespaceName}.`;
|
|
1361
|
+
const buildableQueryFields = (channels.find((channel) => channel.varName === "query")?.fields ?? []).flatMap((field) => {
|
|
1362
|
+
const { list, inner } = fieldTarget(field.type);
|
|
1363
|
+
const name = inner.startsWith(namespacePrefix) ? inner.slice(namespacePrefix.length) : inner;
|
|
1364
|
+
return context.builderModelNames.has(name) ? [{
|
|
1365
|
+
field,
|
|
1366
|
+
block: `${inner}.${list ? "ListBuilder" : "Builder"}`,
|
|
1367
|
+
result: list ? `List<${inner}>` : inner
|
|
1368
|
+
}] : [];
|
|
1369
|
+
});
|
|
1285
1370
|
writer.blank();
|
|
1286
1371
|
writer.block("object Scope", () => {
|
|
1287
1372
|
for (const target of transitionsFrom(-1)) emitTransition(-1, target);
|
|
1373
|
+
for (const { field, block, result } of buildableQueryFields) writer.line(`fun ${escapeKeyword(field.name)}(build: ${block}.() -> Unit): ${result} = ${block}().apply(build).build()`);
|
|
1288
1374
|
});
|
|
1289
1375
|
for (let stateIndex = 0; stateIndex < channels.length; stateIndex += 1) {
|
|
1290
1376
|
const stateChannel = channels[stateIndex];
|
|
@@ -1372,6 +1458,10 @@ const emitMethodBody = (writer, method, context) => {
|
|
|
1372
1458
|
if (method.query.length > 0) for (const field of method.query) {
|
|
1373
1459
|
const accessor = groupMemberAccessor("query", field);
|
|
1374
1460
|
const appendBlock = (sourceExpression) => {
|
|
1461
|
+
if (field.json) {
|
|
1462
|
+
writer.line(`urlBuilder.addQueryParameter(${stringLiteral(field.wireName)}, Kizuna.encodeQueryJson(json, ${sourceExpression}))`);
|
|
1463
|
+
return;
|
|
1464
|
+
}
|
|
1375
1465
|
writer.block(`for (stringValue in Kizuna.stringifyQueryValue(${sourceExpression}))`, () => {
|
|
1376
1466
|
writer.line(`urlBuilder.addQueryParameter(${stringLiteral(field.wireName)}, stringValue)`);
|
|
1377
1467
|
});
|
|
@@ -1719,12 +1809,29 @@ const emitKizunaObject = (writer, options) => {
|
|
|
1719
1809
|
writer.line("return java.net.URLEncoder.encode(text, \"UTF-8\").replace(\"+\", \"%20\")");
|
|
1720
1810
|
});
|
|
1721
1811
|
writer.blank();
|
|
1812
|
+
if (options.jsonQuery) {
|
|
1813
|
+
writer.line("// One JSON text with every object's keys in order so one value always gives one URL.");
|
|
1814
|
+
writer.block("inline fun <reified Value> encodeQueryJson(json: Json, value: Value): String", () => {
|
|
1815
|
+
writer.line("return sortJsonKeys(json.encodeToJsonElement(value)).toString()");
|
|
1816
|
+
});
|
|
1817
|
+
writer.blank();
|
|
1818
|
+
writer.block("fun sortJsonKeys(element: JsonElement): JsonElement", () => {
|
|
1819
|
+
writer.line("return when (element) {");
|
|
1820
|
+
writer.indent(() => {
|
|
1821
|
+
writer.line("is JsonObject -> JsonObject(element.toSortedMap().mapValues { sortJsonKeys(it.value) })");
|
|
1822
|
+
writer.line("is JsonArray -> JsonArray(element.map { sortJsonKeys(it) })");
|
|
1823
|
+
writer.line("else -> element");
|
|
1824
|
+
});
|
|
1825
|
+
writer.line("}");
|
|
1826
|
+
});
|
|
1827
|
+
writer.blank();
|
|
1828
|
+
}
|
|
1722
1829
|
writer.block("fun stringifyQueryValue(value: Any): List<String>", () => {
|
|
1723
1830
|
writer.line("return when (value) {");
|
|
1724
1831
|
writer.indent(() => {
|
|
1725
1832
|
writer.line("is Instant -> listOf(value.toString())");
|
|
1726
1833
|
writer.line("is List<*> -> value.filterNotNull().flatMap { stringifyQueryValue(it) }");
|
|
1727
|
-
writer.line("is KizunaQueryValue -> listOf(value.wireValue)");
|
|
1834
|
+
if (options.queryValues) writer.line("is KizunaQueryValue -> listOf(value.wireValue)");
|
|
1728
1835
|
writer.line("is Enum<*> -> listOf(value.name)");
|
|
1729
1836
|
writer.line("else -> listOf(value.toString())");
|
|
1730
1837
|
});
|
|
@@ -1937,6 +2044,7 @@ const renderKotlinClient = (api, partition, registry, config) => {
|
|
|
1937
2044
|
}
|
|
1938
2045
|
writer.line("import kotlinx.datetime.Instant");
|
|
1939
2046
|
const usesStreaming = allMethods.some((method) => method.stream !== void 0);
|
|
2047
|
+
const sendsJsonQuery = allMethods.some((method) => method.query.some((field) => field.json));
|
|
1940
2048
|
if (usesStreaming) writer.line("import kotlinx.coroutines.flow.*");
|
|
1941
2049
|
writer.line("import okhttp3.*");
|
|
1942
2050
|
writer.line("import okhttp3.MediaType.Companion.toMediaType");
|
|
@@ -1945,7 +2053,8 @@ const renderKotlinClient = (api, partition, registry, config) => {
|
|
|
1945
2053
|
writer.line("import kotlin.time.Duration.Companion.seconds");
|
|
1946
2054
|
writer.line("import okhttp3.HttpUrl.Companion.toHttpUrl");
|
|
1947
2055
|
writer.blank();
|
|
1948
|
-
|
|
2056
|
+
const hasEnums = registry.all().some((type) => type.kind === "enum-class");
|
|
2057
|
+
if (hasEnums) {
|
|
1949
2058
|
writer.block("interface KizunaQueryValue", () => {
|
|
1950
2059
|
writer.line("val wireValue: String");
|
|
1951
2060
|
});
|
|
@@ -1982,16 +2091,22 @@ const renderKotlinClient = (api, partition, registry, config) => {
|
|
|
1982
2091
|
if (!headersSchema) continue;
|
|
1983
2092
|
requestContextFields.push(...collectObjectFields(headersSchema, registry, "RequestContext"));
|
|
1984
2093
|
}
|
|
2094
|
+
const builderModelNames = new Set(sharedTypes.filter(isBuilderModel).map((type) => type.name));
|
|
1985
2095
|
const context = {
|
|
1986
2096
|
namespaceName,
|
|
1987
2097
|
clientName,
|
|
1988
2098
|
operationTypeMap,
|
|
1989
2099
|
fileLevelTypeNames,
|
|
1990
2100
|
ownedTypeMap,
|
|
1991
|
-
requestContextFields
|
|
2101
|
+
requestContextFields,
|
|
2102
|
+
builderModelNames
|
|
1992
2103
|
};
|
|
1993
2104
|
writer.block(`object ${namespaceName}`, () => {
|
|
1994
|
-
|
|
2105
|
+
if (builderModelNames.size > 0) {
|
|
2106
|
+
writer.line("@DslMarker");
|
|
2107
|
+
writer.line("annotation class KizunaDsl");
|
|
2108
|
+
}
|
|
2109
|
+
emitTypes(writer, topLevelSharedTypes, ownedTypeMap, ownedTypeLookup, registry, builderModelNames.size > 0);
|
|
1995
2110
|
for (const brand of registry.allBrands()) {
|
|
1996
2111
|
writer.blank();
|
|
1997
2112
|
emitBrand(writer, brand);
|
|
@@ -2001,6 +2116,8 @@ const renderKotlinClient = (api, partition, registry, config) => {
|
|
|
2001
2116
|
for (const group of partition.groups) emitSubClientClass(writer, group, clientName, context);
|
|
2002
2117
|
emitKizunaObject(writer, {
|
|
2003
2118
|
streaming: usesStreaming,
|
|
2119
|
+
queryValues: hasEnums,
|
|
2120
|
+
jsonQuery: sendsJsonQuery,
|
|
2004
2121
|
clientName
|
|
2005
2122
|
});
|
|
2006
2123
|
for (const warning of registry.warnings()) process.stderr.write(`[kizuna/kotlin] JsonElement fallback at ${warning}\n`);
|
|
@@ -477,7 +477,11 @@ const buildRouteMethod = (routeKey, route, registry, deprecated, deprecationMess
|
|
|
477
477
|
const baseHint = (0, kizunajs_generator.toPascalCase)(fullJoinedName);
|
|
478
478
|
const pathParams = (0, kizunajs_generator.parsePath)(route.path).paramNames;
|
|
479
479
|
const declaredPathParams = route.pathParams ? collectObjectFields(route.pathParams, registry, `${baseHint}Params`) : [];
|
|
480
|
-
const
|
|
480
|
+
const queryShape = route.query ? (0, kizunajs_generator.readObjectShape)(route.query) ?? {} : {};
|
|
481
|
+
const queryFields = route.query ? collectObjectFields(route.query, registry, `${baseHint}Query`).map((field) => ({
|
|
482
|
+
...field,
|
|
483
|
+
json: (0, kizunajs_generator.isJsonQueryField)(queryShape[field.wireName])
|
|
484
|
+
})) : [];
|
|
481
485
|
const headerFields = route.headers ? collectObjectFields(route.headers, registry, `${baseHint}Headers`) : [];
|
|
482
486
|
const bodyDefType = route.body?._def?.type ?? route.body?.def?.type;
|
|
483
487
|
let bodyDescriptor;
|
|
@@ -577,7 +581,7 @@ const buildRouteMethod = (routeKey, route, registry, deprecated, deprecationMess
|
|
|
577
581
|
type: typeExpression
|
|
578
582
|
});
|
|
579
583
|
}
|
|
580
|
-
if (
|
|
584
|
+
if ((0, kizunajs_generator.validatesRequest)(route)) {
|
|
581
585
|
const has400 = errorCases.some((candidate) => candidate.status === 400);
|
|
582
586
|
errorCases.push({
|
|
583
587
|
caseName: has400 ? "validationError" : (0, kizunajs_generator.statusToCamelCase)(400),
|
|
@@ -797,28 +801,28 @@ const enumConstantName = (value) => {
|
|
|
797
801
|
const emitEnumClass = (writer, name, cases, unknownCase, description) => {
|
|
798
802
|
writer.blank();
|
|
799
803
|
writer.docComment(description);
|
|
804
|
+
const constants = (0, kizunajs_generator.uniqueNames)(cases.map(enumConstantName));
|
|
800
805
|
if (!unknownCase) {
|
|
801
806
|
writer.line("@Serializable");
|
|
802
807
|
writer.block(`enum class ${name}(override val wireValue: String) : KizunaQueryValue`, () => {
|
|
803
808
|
for (let index = 0; index < cases.length; index += 1) {
|
|
804
809
|
const caseName = cases[index];
|
|
805
|
-
const enumConstant = enumConstantName(caseName);
|
|
806
810
|
const separator = index < cases.length - 1 ? "," : "";
|
|
807
|
-
writer.line(`@SerialName(${stringLiteral(caseName)}) ${
|
|
811
|
+
writer.line(`@SerialName(${stringLiteral(caseName)}) ${constants[index]}(${stringLiteral(caseName)})${separator}`);
|
|
808
812
|
}
|
|
809
813
|
});
|
|
810
814
|
return;
|
|
811
815
|
}
|
|
812
816
|
writer.line(`@Serializable(with = ${name}.Serializer::class)`);
|
|
813
817
|
writer.block(`sealed interface ${name} : KizunaQueryValue`, () => {
|
|
814
|
-
for (
|
|
815
|
-
writer.line(`override val wireValue: String = ${stringLiteral(
|
|
818
|
+
for (let index = 0; index < cases.length; index += 1) writer.block(`data object ${constants[index]} : ${name}`, () => {
|
|
819
|
+
writer.line(`override val wireValue: String = ${stringLiteral(cases[index])}`);
|
|
816
820
|
});
|
|
817
821
|
writer.line(`data class Unknown(override val wireValue: String) : ${name}`);
|
|
818
822
|
writer.blank();
|
|
819
823
|
writer.block("companion object", () => {
|
|
820
824
|
writer.block(`fun fromWireValue(wireValue: String): ${name} = when (wireValue)`, () => {
|
|
821
|
-
for (
|
|
825
|
+
for (let index = 0; index < cases.length; index += 1) writer.line(`${stringLiteral(cases[index])} -> ${constants[index]}`);
|
|
822
826
|
writer.line("else -> Unknown(wireValue)");
|
|
823
827
|
});
|
|
824
828
|
});
|
|
@@ -832,7 +836,7 @@ const emitEnumClass = (writer, name, cases, unknownCase, description) => {
|
|
|
832
836
|
});
|
|
833
837
|
});
|
|
834
838
|
};
|
|
835
|
-
const emitDataClass = (writer, type, ownedTypeMap, ownedTypeLookup, registryName) => {
|
|
839
|
+
const emitDataClass = (writer, type, ownedTypeMap, ownedTypeLookup, registryName, registry, withBuilders = false) => {
|
|
836
840
|
const lookupName = registryName ?? type.name;
|
|
837
841
|
const baseFields = type.discriminatorWireName ? type.fields.filter((field) => field.wireName !== type.discriminatorWireName) : type.fields;
|
|
838
842
|
const hasFile = baseFields.some((field) => field.isFile);
|
|
@@ -873,15 +877,86 @@ const emitDataClass = (writer, type, ownedTypeMap, ownedTypeLookup, registryName
|
|
|
873
877
|
writer.line(")");
|
|
874
878
|
}
|
|
875
879
|
if (type.sealedParent !== void 0) writer.appendToLastLine(` : ${type.sealedParent}`);
|
|
876
|
-
|
|
880
|
+
const builds = withBuilders && !hasFile && isBuilderModel(type);
|
|
881
|
+
if (hasOwnedTypes || builds) {
|
|
877
882
|
writer.appendToLastLine(" {");
|
|
878
883
|
writer.indent(() => {
|
|
879
|
-
emitOwnedTypes(writer, lookupName, ownedTypeMap, ownedTypeLookup);
|
|
884
|
+
if (hasOwnedTypes) emitOwnedTypes(writer, lookupName, ownedTypeMap, ownedTypeLookup, registry, withBuilders);
|
|
885
|
+
if (builds) {
|
|
886
|
+
const lookup = (name) => registry?.get(name) ?? ownedTypeLookup.get(name);
|
|
887
|
+
emitBuilders(writer, type.name, adjustedFields, baseFields, lookup);
|
|
888
|
+
}
|
|
880
889
|
});
|
|
881
890
|
writer.line("}");
|
|
882
891
|
}
|
|
883
892
|
};
|
|
884
|
-
|
|
893
|
+
/**
|
|
894
|
+
* A data class whose fields are all optional, so it can be written one field at a time.
|
|
895
|
+
*/
|
|
896
|
+
const isBuilderModel = (type) => type?.kind === "data-class" && type.sealedParent === void 0 && type.discriminatorWireName === void 0 && type.fields.length > 0 && type.fields.every((field) => field.optional && field.requiredNullable !== true && field.isFile !== true);
|
|
897
|
+
/**
|
|
898
|
+
* What a field holds: one value or a list of them, and the type named inside.
|
|
899
|
+
*/
|
|
900
|
+
const fieldTarget = (fieldType) => {
|
|
901
|
+
const stripped = fieldType.endsWith("?") ? fieldType.slice(0, -1) : fieldType;
|
|
902
|
+
const list = stripped.startsWith("List<") && stripped.endsWith(">");
|
|
903
|
+
return {
|
|
904
|
+
list,
|
|
905
|
+
inner: list ? stripped.slice(5, -1) : stripped
|
|
906
|
+
};
|
|
907
|
+
};
|
|
908
|
+
/**
|
|
909
|
+
* `Builder` writes one of these field by field and `ListBuilder` a list of them, one block per item:
|
|
910
|
+
* `where { or { name { contains = "ada" } } }`.
|
|
911
|
+
*/
|
|
912
|
+
const emitBuilders = (writer, className, fields, rawFields, lookup) => {
|
|
913
|
+
const targets = fields.map((field, index) => {
|
|
914
|
+
const { list, inner } = fieldTarget(field.type);
|
|
915
|
+
return {
|
|
916
|
+
name: escapeKeyword(field.name),
|
|
917
|
+
type: field.type,
|
|
918
|
+
list,
|
|
919
|
+
inner,
|
|
920
|
+
buildable: isBuilderModel(lookup(fieldTarget(rawFields[index].type).inner))
|
|
921
|
+
};
|
|
922
|
+
});
|
|
923
|
+
const blockOf = (target) => `${target.inner}.${target.list ? "ListBuilder" : "Builder"}`;
|
|
924
|
+
writer.blank();
|
|
925
|
+
writer.line("@KizunaDsl");
|
|
926
|
+
writer.block("class Builder", () => {
|
|
927
|
+
for (const target of targets) writer.line(`var ${target.name}: ${optionalize(target.type, true)} = null`);
|
|
928
|
+
for (const target of targets) {
|
|
929
|
+
if (!target.buildable) continue;
|
|
930
|
+
writer.blank();
|
|
931
|
+
writer.block(`fun ${target.name}(build: ${blockOf(target)}.() -> Unit)`, () => {
|
|
932
|
+
writer.line(`${target.name} = ${blockOf(target)}().apply(build).build()`);
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
writer.blank();
|
|
936
|
+
writer.line(`fun build(): ${className} = ${className}(${targets.map((target) => `${target.name} = ${target.name}`).join(", ")})`);
|
|
937
|
+
});
|
|
938
|
+
writer.blank();
|
|
939
|
+
writer.line("@KizunaDsl");
|
|
940
|
+
writer.block("class ListBuilder", () => {
|
|
941
|
+
writer.line(`private val items = mutableListOf<${className}>()`);
|
|
942
|
+
writer.blank();
|
|
943
|
+
writer.block(`fun add(item: ${className})`, () => {
|
|
944
|
+
writer.line("items += item");
|
|
945
|
+
});
|
|
946
|
+
for (const target of targets) {
|
|
947
|
+
writer.blank();
|
|
948
|
+
if (target.buildable) writer.block(`fun ${target.name}(build: ${blockOf(target)}.() -> Unit)`, () => {
|
|
949
|
+
writer.line(`items += ${className}(${target.name} = ${blockOf(target)}().apply(build).build())`);
|
|
950
|
+
});
|
|
951
|
+
else writer.block(`fun ${target.name}(value: ${optionalize(target.type, false)})`, () => {
|
|
952
|
+
writer.line(`items += ${className}(${target.name} = value)`);
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
writer.blank();
|
|
956
|
+
writer.line(`fun build(): List<${className}> = items.toList()`);
|
|
957
|
+
});
|
|
958
|
+
};
|
|
959
|
+
const emitOwnedTypes = (writer, ownerName, ownedTypeMap, ownedTypeLookup, registry, withBuilders = false) => {
|
|
885
960
|
for (const [ownedName, owningType] of ownedTypeMap) {
|
|
886
961
|
if (owningType !== ownerName) continue;
|
|
887
962
|
const ownedType = ownedTypeLookup.get(ownedName);
|
|
@@ -890,7 +965,7 @@ const emitOwnedTypes = (writer, ownerName, ownedTypeMap, ownedTypeLookup, regist
|
|
|
890
965
|
emitType(writer, {
|
|
891
966
|
...ownedType,
|
|
892
967
|
name: shortName
|
|
893
|
-
}, ownedTypeMap, ownedTypeLookup, ownedName, registry);
|
|
968
|
+
}, ownedTypeMap, ownedTypeLookup, ownedName, registry, withBuilders);
|
|
894
969
|
}
|
|
895
970
|
};
|
|
896
971
|
const relativeOwnedPath = (typeName, ownedTypeMap, enclosingPath, registry) => {
|
|
@@ -978,10 +1053,10 @@ const emitSealedClass = (writer, type, registry, ownedTypeMap, ownedTypeLookup)
|
|
|
978
1053
|
}
|
|
979
1054
|
});
|
|
980
1055
|
};
|
|
981
|
-
const emitType = (writer, type, ownedTypeMap = /* @__PURE__ */ new Map(), ownedTypeLookup = /* @__PURE__ */ new Map(), registryName, registry) => {
|
|
1056
|
+
const emitType = (writer, type, ownedTypeMap = /* @__PURE__ */ new Map(), ownedTypeLookup = /* @__PURE__ */ new Map(), registryName, registry, withBuilders = false) => {
|
|
982
1057
|
writer.blank();
|
|
983
1058
|
writer.docComment(type.description);
|
|
984
|
-
if (type.kind === "data-class") emitDataClass(writer, type, ownedTypeMap, ownedTypeLookup, registryName);
|
|
1059
|
+
if (type.kind === "data-class") emitDataClass(writer, type, ownedTypeMap, ownedTypeLookup, registryName, registry, withBuilders);
|
|
985
1060
|
else if (type.kind === "enum-class") emitEnumClass(writer, type.name, type.cases, type.unknownCase, type.description);
|
|
986
1061
|
else if (registry) emitSealedClass(writer, type, registry, ownedTypeMap, ownedTypeLookup);
|
|
987
1062
|
};
|
|
@@ -995,8 +1070,8 @@ const emitBrand = (writer, brand) => {
|
|
|
995
1070
|
writer.line(`override fun toString(): String = ${brand.rawType === "String" ? "value" : "value.toString()"}`);
|
|
996
1071
|
});
|
|
997
1072
|
};
|
|
998
|
-
const emitTypes = (writer, types, ownedTypeMap = /* @__PURE__ */ new Map(), ownedTypeLookup = /* @__PURE__ */ new Map(), registry) => {
|
|
999
|
-
for (const type of types) emitType(writer, type, ownedTypeMap, ownedTypeLookup, void 0, registry);
|
|
1073
|
+
const emitTypes = (writer, types, ownedTypeMap = /* @__PURE__ */ new Map(), ownedTypeLookup = /* @__PURE__ */ new Map(), registry, withBuilders = false) => {
|
|
1074
|
+
for (const type of types) emitType(writer, type, ownedTypeMap, ownedTypeLookup, void 0, registry, withBuilders);
|
|
1000
1075
|
};
|
|
1001
1076
|
const emitConstructorClass = (writer, declaration, params) => {
|
|
1002
1077
|
if (params.length === 1) writer.line(`${declaration}(${params[0]})`);
|
|
@@ -1282,9 +1357,20 @@ const emitArgsScaffolding = (writer, method, context) => {
|
|
|
1282
1357
|
writer.block("sealed interface Args", () => {
|
|
1283
1358
|
for (const channel of channels) writer.line(`val ${channel.varName}: ${channel.className}${channel.required ? "" : "?"}`);
|
|
1284
1359
|
});
|
|
1360
|
+
const namespacePrefix = `${context.namespaceName}.`;
|
|
1361
|
+
const buildableQueryFields = (channels.find((channel) => channel.varName === "query")?.fields ?? []).flatMap((field) => {
|
|
1362
|
+
const { list, inner } = fieldTarget(field.type);
|
|
1363
|
+
const name = inner.startsWith(namespacePrefix) ? inner.slice(namespacePrefix.length) : inner;
|
|
1364
|
+
return context.builderModelNames.has(name) ? [{
|
|
1365
|
+
field,
|
|
1366
|
+
block: `${inner}.${list ? "ListBuilder" : "Builder"}`,
|
|
1367
|
+
result: list ? `List<${inner}>` : inner
|
|
1368
|
+
}] : [];
|
|
1369
|
+
});
|
|
1285
1370
|
writer.blank();
|
|
1286
1371
|
writer.block("object Scope", () => {
|
|
1287
1372
|
for (const target of transitionsFrom(-1)) emitTransition(-1, target);
|
|
1373
|
+
for (const { field, block, result } of buildableQueryFields) writer.line(`fun ${escapeKeyword(field.name)}(build: ${block}.() -> Unit): ${result} = ${block}().apply(build).build()`);
|
|
1288
1374
|
});
|
|
1289
1375
|
for (let stateIndex = 0; stateIndex < channels.length; stateIndex += 1) {
|
|
1290
1376
|
const stateChannel = channels[stateIndex];
|
|
@@ -1372,6 +1458,10 @@ const emitMethodBody = (writer, method, context) => {
|
|
|
1372
1458
|
if (method.query.length > 0) for (const field of method.query) {
|
|
1373
1459
|
const accessor = groupMemberAccessor("query", field);
|
|
1374
1460
|
const appendBlock = (sourceExpression) => {
|
|
1461
|
+
if (field.json) {
|
|
1462
|
+
writer.line(`urlBuilder.addQueryParameter(${stringLiteral(field.wireName)}, Kizuna.encodeQueryJson(json, ${sourceExpression}))`);
|
|
1463
|
+
return;
|
|
1464
|
+
}
|
|
1375
1465
|
writer.block(`for (stringValue in Kizuna.stringifyQueryValue(${sourceExpression}))`, () => {
|
|
1376
1466
|
writer.line(`urlBuilder.addQueryParameter(${stringLiteral(field.wireName)}, stringValue)`);
|
|
1377
1467
|
});
|
|
@@ -1719,12 +1809,29 @@ const emitKizunaObject = (writer, options) => {
|
|
|
1719
1809
|
writer.line("return java.net.URLEncoder.encode(text, \"UTF-8\").replace(\"+\", \"%20\")");
|
|
1720
1810
|
});
|
|
1721
1811
|
writer.blank();
|
|
1812
|
+
if (options.jsonQuery) {
|
|
1813
|
+
writer.line("// One JSON text with every object's keys in order so one value always gives one URL.");
|
|
1814
|
+
writer.block("inline fun <reified Value> encodeQueryJson(json: Json, value: Value): String", () => {
|
|
1815
|
+
writer.line("return sortJsonKeys(json.encodeToJsonElement(value)).toString()");
|
|
1816
|
+
});
|
|
1817
|
+
writer.blank();
|
|
1818
|
+
writer.block("fun sortJsonKeys(element: JsonElement): JsonElement", () => {
|
|
1819
|
+
writer.line("return when (element) {");
|
|
1820
|
+
writer.indent(() => {
|
|
1821
|
+
writer.line("is JsonObject -> JsonObject(element.toSortedMap().mapValues { sortJsonKeys(it.value) })");
|
|
1822
|
+
writer.line("is JsonArray -> JsonArray(element.map { sortJsonKeys(it) })");
|
|
1823
|
+
writer.line("else -> element");
|
|
1824
|
+
});
|
|
1825
|
+
writer.line("}");
|
|
1826
|
+
});
|
|
1827
|
+
writer.blank();
|
|
1828
|
+
}
|
|
1722
1829
|
writer.block("fun stringifyQueryValue(value: Any): List<String>", () => {
|
|
1723
1830
|
writer.line("return when (value) {");
|
|
1724
1831
|
writer.indent(() => {
|
|
1725
1832
|
writer.line("is Instant -> listOf(value.toString())");
|
|
1726
1833
|
writer.line("is List<*> -> value.filterNotNull().flatMap { stringifyQueryValue(it) }");
|
|
1727
|
-
writer.line("is KizunaQueryValue -> listOf(value.wireValue)");
|
|
1834
|
+
if (options.queryValues) writer.line("is KizunaQueryValue -> listOf(value.wireValue)");
|
|
1728
1835
|
writer.line("is Enum<*> -> listOf(value.name)");
|
|
1729
1836
|
writer.line("else -> listOf(value.toString())");
|
|
1730
1837
|
});
|
|
@@ -1937,6 +2044,7 @@ const renderKotlinClient = (api, partition, registry, config) => {
|
|
|
1937
2044
|
}
|
|
1938
2045
|
writer.line("import kotlinx.datetime.Instant");
|
|
1939
2046
|
const usesStreaming = allMethods.some((method) => method.stream !== void 0);
|
|
2047
|
+
const sendsJsonQuery = allMethods.some((method) => method.query.some((field) => field.json));
|
|
1940
2048
|
if (usesStreaming) writer.line("import kotlinx.coroutines.flow.*");
|
|
1941
2049
|
writer.line("import okhttp3.*");
|
|
1942
2050
|
writer.line("import okhttp3.MediaType.Companion.toMediaType");
|
|
@@ -1945,7 +2053,8 @@ const renderKotlinClient = (api, partition, registry, config) => {
|
|
|
1945
2053
|
writer.line("import kotlin.time.Duration.Companion.seconds");
|
|
1946
2054
|
writer.line("import okhttp3.HttpUrl.Companion.toHttpUrl");
|
|
1947
2055
|
writer.blank();
|
|
1948
|
-
|
|
2056
|
+
const hasEnums = registry.all().some((type) => type.kind === "enum-class");
|
|
2057
|
+
if (hasEnums) {
|
|
1949
2058
|
writer.block("interface KizunaQueryValue", () => {
|
|
1950
2059
|
writer.line("val wireValue: String");
|
|
1951
2060
|
});
|
|
@@ -1982,16 +2091,22 @@ const renderKotlinClient = (api, partition, registry, config) => {
|
|
|
1982
2091
|
if (!headersSchema) continue;
|
|
1983
2092
|
requestContextFields.push(...collectObjectFields(headersSchema, registry, "RequestContext"));
|
|
1984
2093
|
}
|
|
2094
|
+
const builderModelNames = new Set(sharedTypes.filter(isBuilderModel).map((type) => type.name));
|
|
1985
2095
|
const context = {
|
|
1986
2096
|
namespaceName,
|
|
1987
2097
|
clientName,
|
|
1988
2098
|
operationTypeMap,
|
|
1989
2099
|
fileLevelTypeNames,
|
|
1990
2100
|
ownedTypeMap,
|
|
1991
|
-
requestContextFields
|
|
2101
|
+
requestContextFields,
|
|
2102
|
+
builderModelNames
|
|
1992
2103
|
};
|
|
1993
2104
|
writer.block(`object ${namespaceName}`, () => {
|
|
1994
|
-
|
|
2105
|
+
if (builderModelNames.size > 0) {
|
|
2106
|
+
writer.line("@DslMarker");
|
|
2107
|
+
writer.line("annotation class KizunaDsl");
|
|
2108
|
+
}
|
|
2109
|
+
emitTypes(writer, topLevelSharedTypes, ownedTypeMap, ownedTypeLookup, registry, builderModelNames.size > 0);
|
|
1995
2110
|
for (const brand of registry.allBrands()) {
|
|
1996
2111
|
writer.blank();
|
|
1997
2112
|
emitBrand(writer, brand);
|
|
@@ -2001,6 +2116,8 @@ const renderKotlinClient = (api, partition, registry, config) => {
|
|
|
2001
2116
|
for (const group of partition.groups) emitSubClientClass(writer, group, clientName, context);
|
|
2002
2117
|
emitKizunaObject(writer, {
|
|
2003
2118
|
streaming: usesStreaming,
|
|
2119
|
+
queryValues: hasEnums,
|
|
2120
|
+
jsonQuery: sendsJsonQuery,
|
|
2004
2121
|
clientName
|
|
2005
2122
|
});
|
|
2006
2123
|
for (const warning of registry.warnings()) process.stderr.write(`[kizuna/kotlin] JsonElement fallback at ${warning}\n`);
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_generator = require("./generator-DdoAAOSj.cjs");
|
|
3
3
|
let kizunajs_generator = require("kizunajs/generator");
|
|
4
4
|
let zod = require("zod");
|
|
5
5
|
//#region src/client-target.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as kotlinClientWalk, t as generateKotlinClient } from "./generator-
|
|
1
|
+
import { n as kotlinClientWalk, t as generateKotlinClient } from "./generator-DRWVjcfl.mjs";
|
|
2
2
|
import { defineClient } from "kizunajs/generator";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kizunajs/kotlin",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.36",
|
|
4
4
|
"description": "Kotlin client generation for Kizuna.js APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kizunajs",
|
|
@@ -60,15 +60,15 @@
|
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@kizunajs/cli": "2.0.0-beta.
|
|
63
|
+
"@kizunajs/cli": "2.0.0-beta.36"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"kizunajs": "2.0.0-beta.
|
|
66
|
+
"kizunajs": "2.0.0-beta.36",
|
|
67
67
|
"zod": "^4.0.0"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/node": "^24.19.2",
|
|
71
|
-
"kizunajs": "2.0.0-beta.
|
|
71
|
+
"kizunajs": "2.0.0-beta.36",
|
|
72
72
|
"tsdown": "^0.21.10",
|
|
73
73
|
"typescript": "^6.0.3",
|
|
74
74
|
"zod": "^4.6.7"
|