@flock/wirespec 0.10.23 → 0.10.24
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/package.json
CHANGED
|
@@ -837,14 +837,14 @@
|
|
|
837
837
|
function emitDeserialized(_this__u8e3s4, $this) {
|
|
838
838
|
return Spacer_instance.e24(4) + 'case ' + _this__u8e3s4.a24_1 + ' -> new Response' + Companion_getInstance_3().m24(_this__u8e3s4.a24_1) + '(' + emitDeserializedParams_0(_this__u8e3s4, $this) + ');';
|
|
839
839
|
}
|
|
840
|
-
function
|
|
841
|
-
return 'java.util.Map.entry("' + _this__u8e3s4.n24_1.b1() + '", serialization.
|
|
840
|
+
function emitSerializedParams(_this__u8e3s4, $this, fields) {
|
|
841
|
+
return 'java.util.Map.entry("' + _this__u8e3s4.n24_1.b1() + '", serialization.serializeParam(request.' + fields + '.' + $this.q24(_this__u8e3s4.n24_1) + ', Wirespec.getType(' + emitType$default(_this__u8e3s4.o24_1, $this) + '.class, ' + _this__u8e3s4.o24_1.j24() + ')))';
|
|
842
842
|
}
|
|
843
843
|
function emitDeserialized_0(_this__u8e3s4, $this) {
|
|
844
844
|
return Spacer_instance.e24(4) + 'serialization.<' + $this.t24(_this__u8e3s4.pd_1.s24_1) + '>deserialize(request.path().get(' + _this__u8e3s4.od_1 + '), Wirespec.getType(' + emitType$default(_this__u8e3s4.pd_1.s24_1, $this) + '.class, ' + _this__u8e3s4.pd_1.s24_1.j24() + '))';
|
|
845
845
|
}
|
|
846
|
-
function
|
|
847
|
-
return Spacer_instance.e24(4) + 'java.util.Optional.ofNullable(request.' + fields + '().get("' + _this__u8e3s4.n24_1.b1() + '")).map(it -> serialization.<' + $this.t24(_this__u8e3s4.o24_1) + '>
|
|
846
|
+
function emitDeserializedParams_1(_this__u8e3s4, $this, fields) {
|
|
847
|
+
return Spacer_instance.e24(4) + 'java.util.Optional.ofNullable(request.' + fields + '().get("' + _this__u8e3s4.n24_1.b1() + '")).map(it -> serialization.<' + $this.t24(_this__u8e3s4.o24_1) + '>deserializeParam(it, Wirespec.getType(' + emitType$default(_this__u8e3s4.o24_1, $this) + '.class, ' + _this__u8e3s4.o24_1.j24() + ')))' + (!_this__u8e3s4.p24_1 ? '.get()' : '');
|
|
848
848
|
}
|
|
849
849
|
function emitSerializedHeader(_this__u8e3s4, $this) {
|
|
850
850
|
return 'java.util.Map.entry("' + _this__u8e3s4.n24_1.b1() + '", serialization.serialize(r.getHeaders().' + $this.q24(_this__u8e3s4.n24_1) + '(), Wirespec.getType(' + emitType$default(_this__u8e3s4.o24_1, $this) + '.class, ' + _this__u8e3s4.o24_1.j24() + ')))';
|
|
@@ -1015,12 +1015,12 @@
|
|
|
1015
1015
|
}
|
|
1016
1016
|
function JavaEmitter$emitRequestFunctions$lambda_0(this$0) {
|
|
1017
1017
|
return function (it) {
|
|
1018
|
-
return
|
|
1018
|
+
return emitSerializedParams(it, this$0, 'queries');
|
|
1019
1019
|
};
|
|
1020
1020
|
}
|
|
1021
1021
|
function JavaEmitter$emitRequestFunctions$lambda_1(this$0) {
|
|
1022
1022
|
return function (it) {
|
|
1023
|
-
return
|
|
1023
|
+
return emitSerializedParams(it, this$0, 'headers');
|
|
1024
1024
|
};
|
|
1025
1025
|
}
|
|
1026
1026
|
function JavaEmitter$emit$lambda_10(this$0) {
|
|
@@ -1075,12 +1075,12 @@
|
|
|
1075
1075
|
}
|
|
1076
1076
|
function JavaEmitter$emitDeserializedParams$lambda_0(this$0) {
|
|
1077
1077
|
return function (it) {
|
|
1078
|
-
return
|
|
1078
|
+
return emitDeserializedParams_1(it, this$0, 'queries');
|
|
1079
1079
|
};
|
|
1080
1080
|
}
|
|
1081
1081
|
function JavaEmitter$emitDeserializedParams$lambda_1(this$0) {
|
|
1082
1082
|
return function (it) {
|
|
1083
|
-
return
|
|
1083
|
+
return emitDeserializedParams_1(it, this$0, 'headers');
|
|
1084
1084
|
};
|
|
1085
1085
|
}
|
|
1086
1086
|
function JavaEmitter$emitDeserializedParams$lambda_2(this$0) {
|
|
@@ -1403,7 +1403,7 @@
|
|
|
1403
1403
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
1404
1404
|
return isBlank(it) ? 'object Request : Wirespec.Request<' + emit_3(_this__u8e3s4.f24_1, $this) + '> {' : 'class Request(\n' + it + '\n' + Spacer_instance.toString() + ') : Wirespec.Request<' + emit_3(_this__u8e3s4.f24_1, $this) + '> {';
|
|
1405
1405
|
}
|
|
1406
|
-
function
|
|
1406
|
+
function emitDeserializedParams_2(_this__u8e3s4, $this, endpoint) {
|
|
1407
1407
|
// Inline function 'kotlin.let' call
|
|
1408
1408
|
var tmp = $this.l24(endpoint);
|
|
1409
1409
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, KotlinEmitter$emitDeserializedParams$lambda($this)));
|
|
@@ -1424,20 +1424,20 @@
|
|
|
1424
1424
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
1425
1425
|
return isBlank(it) ? '' : '(\n' + it + '\n' + Spacer_instance.e24(2) + ')';
|
|
1426
1426
|
}
|
|
1427
|
-
function
|
|
1427
|
+
function emitSerialized_0(_this__u8e3s4, $this) {
|
|
1428
1428
|
return trimMargin('\n |' + Spacer_instance.e24(3) + 'is Response' + _this__u8e3s4.a24_1 + ' -> Wirespec.RawResponse(\n |' + Spacer_instance.e24(4) + 'statusCode = response.status,\n |' + Spacer_instance.e24(4) + 'headers = mapOf(),\n |' + Spacer_instance.e24(4) + 'body = ' + (!(_this__u8e3s4.c24_1 == null) ? 'serialization.serialize(response.body, typeOf<' + emit_3(_this__u8e3s4.c24_1, $this) + '>())' : 'null') + ',\n |' + Spacer_instance.e24(3) + ')\n ');
|
|
1429
1429
|
}
|
|
1430
|
-
function
|
|
1430
|
+
function emitDeserialized_1(_this__u8e3s4, $this) {
|
|
1431
1431
|
return trimMargin('\n |' + Spacer_instance.e24(3) + _this__u8e3s4.a24_1 + ' -> Response' + _this__u8e3s4.a24_1 + '(\n |' + Spacer_instance.e24(4) + 'body = serialization.deserialize(requireNotNull(response.body) { "body is null" }, typeOf<' + emit_3(_this__u8e3s4.c24_1, $this) + '>()),\n |' + Spacer_instance.e24(3) + ')\n ');
|
|
1432
1432
|
}
|
|
1433
|
-
function
|
|
1434
|
-
return 'request.' + fields + '.' + $this.q24(_this__u8e3s4.n24_1) + '?.let{
|
|
1433
|
+
function emitSerializedParams_0(_this__u8e3s4, $this, fields) {
|
|
1434
|
+
return 'mapOf("' + $this.q24(_this__u8e3s4.n24_1) + '" to (request.' + fields + '.' + $this.q24(_this__u8e3s4.n24_1) + '?.let{ serialization.serializeParam(it, typeOf<' + $this.t24(_this__u8e3s4.o24_1) + '>()) } ?: emptyList()))';
|
|
1435
1435
|
}
|
|
1436
|
-
function
|
|
1436
|
+
function emitDeserialized_2(_this__u8e3s4, $this) {
|
|
1437
1437
|
return Spacer_instance.e24(3) + $this.q24(_this__u8e3s4.pd_1.r24_1) + ' = serialization.deserialize(request.path[' + _this__u8e3s4.od_1 + '], typeOf<' + $this.t24(_this__u8e3s4.pd_1.s24_1) + '>())';
|
|
1438
1438
|
}
|
|
1439
|
-
function
|
|
1440
|
-
return _this__u8e3s4.p24_1 ? Spacer_instance.e24(3) + $this.q24(_this__u8e3s4.n24_1) + ' = request.' + fields + '["' + _this__u8e3s4.n24_1.b1() + '"]?.let{ serialization.
|
|
1439
|
+
function emitDeserializedParams_3(_this__u8e3s4, $this, fields) {
|
|
1440
|
+
return _this__u8e3s4.p24_1 ? Spacer_instance.e24(3) + $this.q24(_this__u8e3s4.n24_1) + ' = request.' + fields + '["' + _this__u8e3s4.n24_1.b1() + '"]?.let{ serialization.deserializeParam(it, typeOf<' + $this.t24(_this__u8e3s4.o24_1) + '>()) }' : Spacer_instance.e24(3) + $this.q24(_this__u8e3s4.n24_1) + ' = serialization.deserializeParam(requireNotNull(request.' + fields + '["' + _this__u8e3s4.n24_1.b1() + '"]) { "' + $this.q24(_this__u8e3s4.n24_1) + ' is null" }, typeOf<' + $this.t24(_this__u8e3s4.o24_1) + '>())';
|
|
1441
1441
|
}
|
|
1442
1442
|
function emitIdentifier_0(_this__u8e3s4, $this) {
|
|
1443
1443
|
return 'request.path.' + $this.q24(_this__u8e3s4.r24_1) + '.let{serialization.serialize(it, typeOf<' + $this.t24(_this__u8e3s4.s24_1) + '>())}';
|
|
@@ -1569,12 +1569,12 @@
|
|
|
1569
1569
|
}
|
|
1570
1570
|
function KotlinEmitter$emit$lambda_6(this$0) {
|
|
1571
1571
|
return function (it) {
|
|
1572
|
-
return
|
|
1572
|
+
return emitSerialized_0(it, this$0);
|
|
1573
1573
|
};
|
|
1574
1574
|
}
|
|
1575
1575
|
function KotlinEmitter$emit$lambda_7(this$0) {
|
|
1576
1576
|
return function (it) {
|
|
1577
|
-
return
|
|
1577
|
+
return emitDeserialized_1(it, this$0);
|
|
1578
1578
|
};
|
|
1579
1579
|
}
|
|
1580
1580
|
function KotlinEmitter$emit$lambda_8(this$0) {
|
|
@@ -1625,12 +1625,12 @@
|
|
|
1625
1625
|
}
|
|
1626
1626
|
function KotlinEmitter$emit$lambda_13(this$0) {
|
|
1627
1627
|
return function (it) {
|
|
1628
|
-
return
|
|
1628
|
+
return '(' + emitSerializedParams_0(it, this$0, 'queries') + ')';
|
|
1629
1629
|
};
|
|
1630
1630
|
}
|
|
1631
1631
|
function KotlinEmitter$emit$lambda_14(this$0) {
|
|
1632
1632
|
return function (it) {
|
|
1633
|
-
return
|
|
1633
|
+
return '(' + emitSerializedParams_0(it, this$0, 'headers') + ')';
|
|
1634
1634
|
};
|
|
1635
1635
|
}
|
|
1636
1636
|
function KotlinEmitter$emitConstructor$lambda(this$0) {
|
|
@@ -1650,17 +1650,17 @@
|
|
|
1650
1650
|
}
|
|
1651
1651
|
function KotlinEmitter$emitDeserializedParams$lambda(this$0) {
|
|
1652
1652
|
return function (it) {
|
|
1653
|
-
return
|
|
1653
|
+
return emitDeserialized_2(it, this$0);
|
|
1654
1654
|
};
|
|
1655
1655
|
}
|
|
1656
1656
|
function KotlinEmitter$emitDeserializedParams$lambda_0(this$0) {
|
|
1657
1657
|
return function (it) {
|
|
1658
|
-
return
|
|
1658
|
+
return emitDeserializedParams_3(it, this$0, 'queries');
|
|
1659
1659
|
};
|
|
1660
1660
|
}
|
|
1661
1661
|
function KotlinEmitter$emitDeserializedParams$lambda_1(this$0) {
|
|
1662
1662
|
return function (it) {
|
|
1663
|
-
return
|
|
1663
|
+
return emitDeserializedParams_3(it, this$0, 'headers');
|
|
1664
1664
|
};
|
|
1665
1665
|
}
|
|
1666
1666
|
function KotlinEmitter$sanitizeSymbol$lambda(it) {
|
|
@@ -1968,7 +1968,7 @@
|
|
|
1968
1968
|
var tmp_17;
|
|
1969
1969
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1970
1970
|
if (!endpoint.v23_1.l()) {
|
|
1971
|
-
tmp_17 =
|
|
1971
|
+
tmp_17 = joinToString(endpoint.v23_1, ' + ', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_13(this));
|
|
1972
1972
|
} else {
|
|
1973
1973
|
tmp_17 = 'emptyMap()';
|
|
1974
1974
|
}
|
|
@@ -1977,11 +1977,11 @@
|
|
|
1977
1977
|
var tmp_20;
|
|
1978
1978
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1979
1979
|
if (!endpoint.w23_1.l()) {
|
|
1980
|
-
tmp_20 =
|
|
1980
|
+
tmp_20 = joinToString(endpoint.w23_1, ' + ', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_14(this));
|
|
1981
1981
|
} else {
|
|
1982
1982
|
tmp_20 = 'emptyMap()';
|
|
1983
1983
|
}
|
|
1984
|
-
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.t23_1.p2_1 + '\n |' + tmp_5 + 'override val queries = Queries' + tmp_6 + '\n |' + tmp_7 + 'override val headers = Headers' + tmp_8 + tmp_9 + '\n |' + tmp_10 + '}\n |\n |' + tmp_11 + 'fun toRequest(serialization: Wirespec.Serializer<String>, request: Request): Wirespec.RawRequest =\n |' + tmp_12 + 'Wirespec.RawRequest(\n |' + tmp_13 + 'path = listOf(' + tmp_14 + '),\n |' + tmp_15 + 'method = request.method.name,\n |' + tmp_16 + 'queries = ' + tmp_18 + ',\n |' + tmp_19 + 'headers = ' + tmp_20 + ',\n |' + Spacer_instance.e24(3) + 'body = serialization.serialize(request.body, typeOf<' + emit_3(_this__u8e3s4.f24_1, this) + '>()),\n |' + Spacer_instance.e24(2) + ')\n |\n |' + Spacer_instance.toString() + 'fun fromRequest(serialization: Wirespec.Deserializer<String>, request: Wirespec.RawRequest): Request =\n |' + Spacer_instance.e24(2) + 'Request' +
|
|
1984
|
+
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.t23_1.p2_1 + '\n |' + tmp_5 + 'override val queries = Queries' + tmp_6 + '\n |' + tmp_7 + 'override val headers = Headers' + tmp_8 + tmp_9 + '\n |' + tmp_10 + '}\n |\n |' + tmp_11 + 'fun toRequest(serialization: Wirespec.Serializer<String>, request: Request): Wirespec.RawRequest =\n |' + tmp_12 + 'Wirespec.RawRequest(\n |' + tmp_13 + 'path = listOf(' + tmp_14 + '),\n |' + tmp_15 + 'method = request.method.name,\n |' + tmp_16 + 'queries = ' + tmp_18 + ',\n |' + tmp_19 + 'headers = ' + tmp_20 + ',\n |' + Spacer_instance.e24(3) + 'body = serialization.serialize(request.body, typeOf<' + emit_3(_this__u8e3s4.f24_1, this) + '>()),\n |' + Spacer_instance.e24(2) + ')\n |\n |' + Spacer_instance.toString() + 'fun fromRequest(serialization: Wirespec.Deserializer<String>, request: Wirespec.RawRequest): Request =\n |' + Spacer_instance.e24(2) + 'Request' + emitDeserializedParams_2(_this__u8e3s4, this, endpoint) + '\n ');
|
|
1985
1985
|
};
|
|
1986
1986
|
protoOf(KotlinEmitter).y24 = function (_this__u8e3s4) {
|
|
1987
1987
|
return trimMargin('\n |' + Spacer_instance.toString() + 'data class Response' + _this__u8e3s4.a24_1 + '(override val body: ' + emit_3(_this__u8e3s4.c24_1, this) + ') : Response' + toString_0(charSequenceGet(_this__u8e3s4.a24_1, 0)) + 'XX<' + emit_3(_this__u8e3s4.c24_1, this) + '>, Response' + concatGenerics(emit_3(_this__u8e3s4.c24_1, this)) + ' {\n |' + Spacer_instance.e24(2) + 'override val status = ' + fixStatus_0(_this__u8e3s4.a24_1, this) + '\n |' + Spacer_instance.e24(2) + 'override val headers = Headers\n |' + Spacer_instance.e24(2) + 'data object Headers : Wirespec.Response.Headers\n |' + Spacer_instance.toString() + '}\n ');
|