@flock/wirespec 0.19.4 → 0.19.5
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/clikt-clikt-mordant.mjs +79 -79
- package/clikt-clikt.mjs +1312 -1312
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +432 -432
- package/kotlin-kotlin-stdlib.mjs +6 -6
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +9859 -9859
- package/kotlin-rgxgen.mjs +1760 -1760
- package/kotlinx-io-kotlinx-io-core.mjs +404 -404
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1775 -1775
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1479 -1479
- package/mordant-mordant.mjs +1192 -1192
- package/package.json +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +255 -255
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +140 -140
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +187 -187
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +342 -342
- package/wirespec-src-compiler-emitters-scala.mjs +123 -123
- package/wirespec-src-compiler-emitters-typescript.mjs +196 -196
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +22 -22
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3322 -3322
- package/wirespec-src-compiler-lib.mjs +227 -58
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +480 -480
- package/wirespec-src-converter-openapi.mjs +344 -344
- package/wirespec-src-ide-lsp.mjs +1348 -1348
- package/wirespec-src-plugin-arguments.mjs +139 -139
- package/wirespec-src-plugin-cli.mjs +87 -87
- package/wirespec-src-plugin-npm.d.mts +39 -2
- package/wirespec-src-plugin-npm.mjs +21 -21
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +2 -2
|
@@ -173,10 +173,10 @@ import {
|
|
|
173
173
|
function emit_3(identifier) {
|
|
174
174
|
var tmp;
|
|
175
175
|
if (identifier instanceof DefinitionIdentifier) {
|
|
176
|
-
tmp = this.
|
|
176
|
+
tmp = this.y1x(identifier);
|
|
177
177
|
} else {
|
|
178
178
|
if (identifier instanceof FieldIdentifier) {
|
|
179
|
-
tmp = this.
|
|
179
|
+
tmp = this.o1x(this.y1x(identifier));
|
|
180
180
|
} else {
|
|
181
181
|
noWhenBranchMatchedException();
|
|
182
182
|
}
|
|
@@ -198,7 +198,7 @@ function sanitize(_this__u8e3s4) {
|
|
|
198
198
|
destination.x(tmp$ret$0);
|
|
199
199
|
}
|
|
200
200
|
var tmp = asSequence(joinToString(destination, ''));
|
|
201
|
-
return this.
|
|
201
|
+
return this.n1x(joinToString_0(filter(tmp, KotlinIdentifierEmitter$sanitize$lambda), ''));
|
|
202
202
|
}
|
|
203
203
|
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
204
204
|
var tmp;
|
|
@@ -218,7 +218,7 @@ function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
|
218
218
|
return tmp;
|
|
219
219
|
}
|
|
220
220
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
221
|
-
return Companion_getInstance_0().
|
|
221
|
+
return Companion_getInstance_0().l1y_1.u1(_this__u8e3s4) ? addBackticks(_this__u8e3s4) : _this__u8e3s4;
|
|
222
222
|
}
|
|
223
223
|
initMetadataForInterface(KotlinIdentifierEmitter, 'KotlinIdentifierEmitter');
|
|
224
224
|
function emit_4(type, module_0) {
|
|
@@ -379,7 +379,7 @@ function emit_10(endpoint) {
|
|
|
379
379
|
var _iterator__ex2g4s = this_0.t();
|
|
380
380
|
while (_iterator__ex2g4s.u()) {
|
|
381
381
|
var item = _iterator__ex2g4s.v();
|
|
382
|
-
var tmp$ret$0 = 'import ' + this.
|
|
382
|
+
var tmp$ret$0 = 'import ' + this.y1w().ds_1 + '.model.' + item.bv_1;
|
|
383
383
|
destination.x(tmp$ret$0);
|
|
384
384
|
}
|
|
385
385
|
var tmp = destination;
|
|
@@ -389,7 +389,7 @@ function emit_10(endpoint) {
|
|
|
389
389
|
var tmp_3 = emitObject$default(this, tmp_2, 'Path', 'Wirespec.Path', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
390
390
|
var tmp_4 = emitObject$default(this, endpoint.xp_1, 'Queries', 'Wirespec.Queries', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
391
391
|
var tmp_5 = emitObject$default(this, endpoint.yp_1, 'Headers', 'Wirespec.Request.Headers', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
392
|
-
var tmp_6 = this.
|
|
392
|
+
var tmp_6 = this.l1x(first(endpoint.zp_1), endpoint);
|
|
393
393
|
var tmp_7 = Spacer_instance.toString();
|
|
394
394
|
var tmp_8 = emitStatusInterfaces(this, endpoint);
|
|
395
395
|
var tmp_9 = emitResponseInterfaces(this, endpoint);
|
|
@@ -419,7 +419,7 @@ function emit_10(endpoint) {
|
|
|
419
419
|
var tmp_22 = Spacer_instance.hs(2);
|
|
420
420
|
var tmp_23 = Spacer_instance.toString();
|
|
421
421
|
var tmp_24 = Spacer_instance.hs(2);
|
|
422
|
-
var tmp_25 = this.
|
|
422
|
+
var tmp_25 = this.p1x(endpoint);
|
|
423
423
|
var tmp_26 = Spacer_instance.hs(2);
|
|
424
424
|
var tmp_27 = Spacer_instance.hs(3);
|
|
425
425
|
return trimMargin('\n |' + tmp_0 + '\n |\n |object ' + tmp_1 + ' : Wirespec.Endpoint {\n |' + tmp_3 + '\n |\n |' + tmp_4 + '\n |\n |' + tmp_5 + '\n |\n |' + tmp_6 + '\n |\n |' + tmp_7 + 'sealed interface Response<T: Any> : Wirespec.Response<T>\n |\n |' + tmp_8 + '\n |\n |' + tmp_9 + '\n |\n |' + tmp_11 + '\n |\n |' + tmp_12 + 'fun toResponse(serialization: Wirespec.Serializer, response: Response<*>): Wirespec.RawResponse =\n |' + tmp_13 + 'when(response) {\n |' + tmp_15 + '\n |' + tmp_16 + '}\n |\n |' + tmp_17 + 'fun fromResponse(serialization: Wirespec.Deserializer, response: Wirespec.RawResponse): Response<*> =\n |' + tmp_18 + 'when (response.statusCode) {\n |' + tmp_20 + '\n |' + tmp_21 + 'else -> error("Cannot match response with status: ${response.statusCode}")\n |' + tmp_22 + '}\n |\n |' + tmp_23 + 'interface Handler: Wirespec.Handler {\n |' + tmp_24 + tmp_25 + '\n |' + tmp_26 + 'companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n |' + tmp_27 + 'override val pathTemplate = "/' + joinToString(endpoint.wp_1, '/', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_6) + '"\n |' + Spacer_instance.hs(3) + 'override val method = "' + endpoint.vp_1.toString() + '"\n |' + Spacer_instance.hs(3) + 'override fun server(serialization: Wirespec.Serialization) = object : Wirespec.ServerEdge<Request, Response<*>> {\n |' + Spacer_instance.hs(4) + 'override fun from(request: Wirespec.RawRequest) = fromRequest(serialization, request)\n |' + Spacer_instance.hs(4) + 'override fun to(response: Response<*>) = toResponse(serialization, response)\n |' + Spacer_instance.hs(3) + '}\n |' + Spacer_instance.hs(3) + 'override fun client(serialization: Wirespec.Serialization) = object : Wirespec.ClientEdge<Request, Response<*>> {\n |' + Spacer_instance.hs(4) + 'override fun to(request: Request) = toRequest(serialization, request)\n |' + Spacer_instance.hs(4) + 'override fun from(response: Wirespec.RawResponse) = fromResponse(serialization, response)\n |' + Spacer_instance.hs(3) + '}\n |' + Spacer_instance.hs(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
@@ -442,7 +442,7 @@ function emit_11(_this__u8e3s4, endpoint) {
|
|
|
442
442
|
var tmp_10 = Spacer_instance.toString();
|
|
443
443
|
var tmp_11 = Spacer_instance.hs(2);
|
|
444
444
|
var tmp_12 = Spacer_instance.hs(3);
|
|
445
|
-
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.vp_1.a3_1 + '\n |' + tmp_5 + 'override val queries = Queries' + tmp_6 + '\n |' + tmp_7 + 'override val headers = Headers' + tmp_8 + '\n |' + tmp_9 + '\n |\n |' + tmp_10 + 'fun toRequest(serialization: Wirespec.Serializer, request: Request): Wirespec.RawRequest =\n |' + tmp_11 + 'Wirespec.RawRequest(\n |' + tmp_12 + 'path = listOf(' + joinToString(endpoint.wp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_10(this)) + '),\n |' + Spacer_instance.hs(3) + 'method = request.method.name,\n |' + Spacer_instance.hs(3) + 'queries = ' + this.
|
|
445
|
+
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.vp_1.a3_1 + '\n |' + tmp_5 + 'override val queries = Queries' + tmp_6 + '\n |' + tmp_7 + 'override val headers = Headers' + tmp_8 + '\n |' + tmp_9 + '\n |\n |' + tmp_10 + 'fun toRequest(serialization: Wirespec.Serializer, request: Request): Wirespec.RawRequest =\n |' + tmp_11 + 'Wirespec.RawRequest(\n |' + tmp_12 + 'path = listOf(' + joinToString(endpoint.wp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_10(this)) + '),\n |' + Spacer_instance.hs(3) + 'method = request.method.name,\n |' + Spacer_instance.hs(3) + 'queries = ' + this.i1y(endpoint) + ',\n |' + Spacer_instance.hs(3) + 'headers = ' + this.h1y(endpoint) + ',\n |' + Spacer_instance.hs(3) + 'body = ' + (!(_this__u8e3s4.dq_1 == null) ? 'serialization.serializeBody(request.body, typeOf<' + emit_16(this, _this__u8e3s4.dq_1) + '>())' : 'null') + ',\n |' + Spacer_instance.hs(2) + ')\n |\n |' + Spacer_instance.toString() + 'fun fromRequest(serialization: Wirespec.Deserializer, request: Wirespec.RawRequest): Request =\n |' + Spacer_instance.hs(2) + 'Request' + emitDeserializedParams(this, _this__u8e3s4, endpoint) + '\n ');
|
|
446
446
|
}
|
|
447
447
|
function emitRequestHeaders(_this__u8e3s4) {
|
|
448
448
|
var tmp;
|
|
@@ -497,17 +497,8 @@ function emitHeaders(_this__u8e3s4) {
|
|
|
497
497
|
return tmp;
|
|
498
498
|
}
|
|
499
499
|
initMetadataForInterface(KotlinEndpointDefinitionEmitter, 'KotlinEndpointDefinitionEmitter', VOID, VOID, [KotlinTypeDefinitionEmitter]);
|
|
500
|
-
function emit_13(
|
|
501
|
-
|
|
502
|
-
return trimMargin('\n |enum class ' + tmp + ' (override val label: String): Wirespec.Enum {\n |' + spacer(joinToString(enum_0.yr_1, ',\n', VOID, VOID, VOID, VOID, KotlinEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'override fun toString(): String {\n |' + Spacer_instance.hs(2) + 'return label\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
503
|
-
}
|
|
504
|
-
initMetadataForInterface(KotlinEnumDefinitionEmitter, 'KotlinEnumDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
505
|
-
function emit_14(union) {
|
|
506
|
-
return trimMargin('\n |sealed interface ' + this.nr(union.gp_1) + '\n |\n ');
|
|
507
|
-
}
|
|
508
|
-
initMetadataForInterface(KotlinUnionDefinitionEmitter, 'KotlinUnionDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
509
|
-
function emit_15(refined) {
|
|
510
|
-
return trimMargin('\n |data class ' + this.u1x(refined.sr_1) + '(override val value: ' + this.nq(refined.tr_1) + '): Wirespec.Refined<' + this.nq(refined.tr_1) + '> {\n |' + Spacer_instance.toString() + 'override fun toString() = value.toString()\n |' + Spacer_instance.toString() + 'override fun validate() = ' + this.bs(refined) + '\n |}\n |\n ');
|
|
500
|
+
function emit_13(refined) {
|
|
501
|
+
return trimMargin('\n |data class ' + this.y1x(refined.sr_1) + '(override val value: ' + this.nq(refined.tr_1) + '): Wirespec.Refined<' + this.nq(refined.tr_1) + '> {\n |' + Spacer_instance.toString() + 'override fun toString() = value.toString()\n |' + Spacer_instance.toString() + 'override fun validate() = ' + this.bs(refined) + '\n |}\n |\n ');
|
|
511
502
|
}
|
|
512
503
|
function emitValidator(_this__u8e3s4) {
|
|
513
504
|
var defaultReturn = 'true';
|
|
@@ -550,7 +541,16 @@ function emitValidator(_this__u8e3s4) {
|
|
|
550
541
|
return tmp;
|
|
551
542
|
}
|
|
552
543
|
initMetadataForInterface(KotlinRefinedTypeDefinitionEmitter, 'KotlinRefinedTypeDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter, KotlinTypeDefinitionEmitter]);
|
|
553
|
-
|
|
544
|
+
function emit_14(union) {
|
|
545
|
+
return trimMargin('\n |sealed interface ' + this.nr(union.gp_1) + '\n |\n ');
|
|
546
|
+
}
|
|
547
|
+
initMetadataForInterface(KotlinUnionDefinitionEmitter, 'KotlinUnionDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
548
|
+
function emit_15(enum_0, module_0) {
|
|
549
|
+
var tmp = this.y1x(enum_0.xr_1);
|
|
550
|
+
return trimMargin('\n |enum class ' + tmp + ' (override val label: String): Wirespec.Enum {\n |' + spacer(joinToString(enum_0.yr_1, ',\n', VOID, VOID, VOID, VOID, KotlinEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'override fun toString(): String {\n |' + Spacer_instance.hs(2) + 'return label\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
551
|
+
}
|
|
552
|
+
initMetadataForInterface(KotlinEnumDefinitionEmitter, 'KotlinEnumDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
553
|
+
initMetadataForClass(KotlinEmitter, 'KotlinEmitter', KotlinEmitter, LanguageEmitter, [LanguageEmitter, KotlinEndpointDefinitionEmitter, KotlinChannelDefinitionEmitter, KotlinRefinedTypeDefinitionEmitter, KotlinUnionDefinitionEmitter, KotlinTypeDefinitionEmitter, KotlinIdentifierEmitter, KotlinEnumDefinitionEmitter]);
|
|
554
554
|
initMetadataForCompanion(Companion);
|
|
555
555
|
initMetadataForCompanion(Companion_0);
|
|
556
556
|
initMetadataForClass(KotlinIrEmitter, 'KotlinIrEmitter', KotlinIrEmitter, VOID, [IrEmitter]);
|
|
@@ -564,7 +564,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
564
564
|
var _iterator__ex2g4s = this_0.t();
|
|
565
565
|
while (_iterator__ex2g4s.u()) {
|
|
566
566
|
var item = _iterator__ex2g4s.v();
|
|
567
|
-
var tmp$ret$0 = 'import ' + $this.
|
|
567
|
+
var tmp$ret$0 = 'import ' + $this.y1w().ds_1 + '.model.' + item.bv_1 + ';';
|
|
568
568
|
destination.x(tmp$ret$0);
|
|
569
569
|
}
|
|
570
570
|
var tmp = destination;
|
|
@@ -580,37 +580,37 @@ function KotlinEmitter(packageName, emitShared) {
|
|
|
580
580
|
packageName = packageName === VOID ? Companion_instance.cs('community.flock.wirespec.generated') : packageName;
|
|
581
581
|
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
582
582
|
LanguageEmitter.call(this);
|
|
583
|
-
this.
|
|
584
|
-
this.
|
|
585
|
-
this.
|
|
586
|
-
this.
|
|
587
|
-
this.
|
|
588
|
-
this.
|
|
589
|
-
}
|
|
590
|
-
protoOf(KotlinEmitter).
|
|
591
|
-
return this.
|
|
583
|
+
this.z1x_1 = packageName;
|
|
584
|
+
this.a1y_1 = emitShared;
|
|
585
|
+
this.b1y_1 = '\nimport community.flock.wirespec.kotlin.Wirespec\nimport kotlin.reflect.typeOf\n';
|
|
586
|
+
this.c1y_1 = FileExtension_Kotlin_getInstance();
|
|
587
|
+
this.d1y_1 = KotlinShared_getInstance();
|
|
588
|
+
this.e1y_1 = '//';
|
|
589
|
+
}
|
|
590
|
+
protoOf(KotlinEmitter).y1w = function () {
|
|
591
|
+
return this.z1x_1;
|
|
592
592
|
};
|
|
593
593
|
protoOf(KotlinEmitter).uq = function () {
|
|
594
|
-
return this.
|
|
594
|
+
return this.c1y_1;
|
|
595
595
|
};
|
|
596
|
-
protoOf(KotlinEmitter).
|
|
597
|
-
return this.
|
|
596
|
+
protoOf(KotlinEmitter).h1x = function () {
|
|
597
|
+
return this.d1y_1;
|
|
598
598
|
};
|
|
599
599
|
protoOf(KotlinEmitter).vq = function () {
|
|
600
|
-
return this.
|
|
600
|
+
return this.e1y_1;
|
|
601
601
|
};
|
|
602
602
|
protoOf(KotlinEmitter).kr = function (module_0, logger) {
|
|
603
603
|
// Inline function 'kotlin.let' call
|
|
604
604
|
var it = protoOf(LanguageEmitter).kr.call(this, module_0, logger);
|
|
605
|
-
return this.
|
|
605
|
+
return this.a1y_1.xo_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.cs('community.flock.wirespec.kotlin').fs() + 'Wirespec', this.h1x().g1y_1)) : it;
|
|
606
606
|
};
|
|
607
607
|
protoOf(KotlinEmitter).lr = function (definition, module_0, logger) {
|
|
608
608
|
// Inline function 'kotlin.let' call
|
|
609
609
|
var it = protoOf(LanguageEmitter).lr.call(this, definition, module_0, logger);
|
|
610
|
-
var subPackageName = plus(this.
|
|
610
|
+
var subPackageName = plus(this.y1w(), definition);
|
|
611
611
|
var tmp = subPackageName.fs() + it.yo_1;
|
|
612
612
|
// Inline function 'kotlin.text.trimStart' call
|
|
613
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + '\n |' + (Companion_instance_1.gr(module_0) ? this.
|
|
613
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + '\n |' + (Companion_instance_1.gr(module_0) ? this.b1y_1 : '') + '\n |' + it.zo_1 + '\n ');
|
|
614
614
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
615
615
|
return new Emitted(tmp, tmp$ret$0);
|
|
616
616
|
};
|
|
@@ -677,7 +677,7 @@ function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
|
677
677
|
return isBlank(it) ? '' : '(\n' + it + '\n' + Spacer_instance.hs(2) + ')';
|
|
678
678
|
}
|
|
679
679
|
function emitSerialized($this, _this__u8e3s4) {
|
|
680
|
-
return trimMargin('\n |' + Spacer_instance.hs(3) + 'is Response' + _this__u8e3s4.gq_1 + ' -> Wirespec.RawResponse(\n |' + Spacer_instance.hs(4) + 'statusCode = response.status,\n |' + Spacer_instance.hs(4) + 'headers = ' + $this.
|
|
680
|
+
return trimMargin('\n |' + Spacer_instance.hs(3) + 'is Response' + _this__u8e3s4.gq_1 + ' -> Wirespec.RawResponse(\n |' + Spacer_instance.hs(4) + 'statusCode = response.status,\n |' + Spacer_instance.hs(4) + 'headers = ' + $this.k1y(_this__u8e3s4) + ',\n |' + Spacer_instance.hs(4) + 'body = ' + (!(_this__u8e3s4.iq_1 == null) ? $this.j1y($this, _this__u8e3s4.iq_1) : 'null') + ',\n |' + Spacer_instance.hs(3) + ')\n ');
|
|
681
681
|
}
|
|
682
682
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
683
683
|
var tmp = Spacer_instance.hs(3) + _this__u8e3s4.gq_1 + ' -> Response' + _this__u8e3s4.gq_1 + '(';
|
|
@@ -771,7 +771,7 @@ function KotlinEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
|
771
771
|
}
|
|
772
772
|
function KotlinEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
773
773
|
return function (it) {
|
|
774
|
-
return this$0.
|
|
774
|
+
return this$0.m1x(it);
|
|
775
775
|
};
|
|
776
776
|
}
|
|
777
777
|
function KotlinEndpointDefinitionEmitter$emit$lambda_4(this$0) {
|
|
@@ -899,18 +899,18 @@ function sanitizeNegative($this, _this__u8e3s4) {
|
|
|
899
899
|
return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
|
|
900
900
|
}
|
|
901
901
|
function sanitizeEnum($this, _this__u8e3s4) {
|
|
902
|
-
return $this.
|
|
902
|
+
return $this.n1x(joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_'));
|
|
903
903
|
}
|
|
904
904
|
function KotlinEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
905
905
|
return function (it) {
|
|
906
|
-
return this$0.
|
|
906
|
+
return this$0.o1x(sanitizeEnum(this$0, it)) + '("' + it + '")';
|
|
907
907
|
};
|
|
908
908
|
}
|
|
909
909
|
function KotlinEnumDefinitionEmitter() {
|
|
910
910
|
}
|
|
911
911
|
function Companion() {
|
|
912
912
|
Companion_instance_2 = this;
|
|
913
|
-
this.
|
|
913
|
+
this.l1y_1 = setOf(['as', 'break', 'class', 'continue', 'do', 'else', 'false', 'for', 'fun', 'if', 'in', 'interface', 'internal', 'is', 'null', 'object', 'open', 'package', 'return', 'super', 'this', 'throw', 'true', 'try', 'typealias', 'typeof', 'val', 'var', 'when', 'while', 'private', 'public']);
|
|
914
914
|
}
|
|
915
915
|
var Companion_instance_2;
|
|
916
916
|
function Companion_getInstance_0() {
|
|
@@ -924,14 +924,14 @@ function KotlinIdentifierEmitter$sanitize$lambda(it) {
|
|
|
924
924
|
function KotlinIdentifierEmitter() {
|
|
925
925
|
}
|
|
926
926
|
function _get_sanitizationConfig__sns434($this) {
|
|
927
|
-
var tmp0 = $this.
|
|
927
|
+
var tmp0 = $this.r1y_1;
|
|
928
928
|
var tmp = KProperty1;
|
|
929
929
|
// Inline function 'kotlin.getValue' call
|
|
930
930
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, KotlinIrEmitter$_get_sanitizationConfig_$ref_tnafwf(), null);
|
|
931
931
|
return tmp0.l1();
|
|
932
932
|
}
|
|
933
933
|
function _get_modelSanitizationConfig__vgg831($this) {
|
|
934
|
-
var tmp0 = $this.
|
|
934
|
+
var tmp0 = $this.s1y_1;
|
|
935
935
|
var tmp = KProperty1;
|
|
936
936
|
// Inline function 'kotlin.getValue' call
|
|
937
937
|
getPropertyCallableRef('modelSanitizationConfig', 1, tmp, KotlinIrEmitter$_get_modelSanitizationConfig_$ref_iulb4s(), null);
|
|
@@ -996,7 +996,7 @@ function sanitizeFirstIsDigit_0($this, _this__u8e3s4) {
|
|
|
996
996
|
return tmp;
|
|
997
997
|
}
|
|
998
998
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
999
|
-
return Companion_getInstance_1().
|
|
999
|
+
return Companion_getInstance_1().t1y_1.u1(_this__u8e3s4) ? addBackticks(_this__u8e3s4) : _this__u8e3s4;
|
|
1000
1000
|
}
|
|
1001
1001
|
function sanitizeSymbol($this, _this__u8e3s4) {
|
|
1002
1002
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
@@ -1069,7 +1069,7 @@ function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
function Companion_0() {
|
|
1071
1071
|
Companion_instance_3 = this;
|
|
1072
|
-
this.
|
|
1072
|
+
this.t1y_1 = setOf(['as', 'break', 'class', 'continue', 'do', 'else', 'false', 'for', 'fun', 'if', 'in', 'interface', 'internal', 'is', 'null', 'object', 'open', 'package', 'return', 'super', 'this', 'throw', 'true', 'try', 'typealias', 'typeof', 'val', 'var', 'when', 'while', 'private', 'public']);
|
|
1073
1073
|
}
|
|
1074
1074
|
var Companion_instance_3;
|
|
1075
1075
|
function Companion_getInstance_1() {
|
|
@@ -1082,13 +1082,13 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
1082
1082
|
}
|
|
1083
1083
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1084
1084
|
return function (name) {
|
|
1085
|
-
var sanitized = name.
|
|
1085
|
+
var sanitized = name.p1h_1.a1() > 1 ? name.u1m() : sanitizeSymbol(this$0, name.n1j());
|
|
1086
1086
|
return new Name(listOf(sanitized));
|
|
1087
1087
|
};
|
|
1088
1088
|
}
|
|
1089
1089
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0) {
|
|
1090
1090
|
return function (name) {
|
|
1091
|
-
return new Name(listOf(sanitizeSymbol(this$0, name.
|
|
1091
|
+
return new Name(listOf(sanitizeSymbol(this$0, name.u1m())));
|
|
1092
1092
|
};
|
|
1093
1093
|
}
|
|
1094
1094
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(this$0) {
|
|
@@ -1101,17 +1101,17 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1101
1101
|
var tmp;
|
|
1102
1102
|
var tmp_0;
|
|
1103
1103
|
if (stmt instanceof FunctionCall) {
|
|
1104
|
-
tmp_0 = stmt.
|
|
1104
|
+
tmp_0 = stmt.e1n_1.n1j() === 'validate';
|
|
1105
1105
|
} else {
|
|
1106
1106
|
tmp_0 = false;
|
|
1107
1107
|
}
|
|
1108
1108
|
if (tmp_0) {
|
|
1109
|
-
tmp = transformChildren(stmt.
|
|
1109
|
+
tmp = transformChildren(stmt.i1n(VOID, emptyList()), tr);
|
|
1110
1110
|
} else {
|
|
1111
1111
|
if (stmt instanceof ConstructorStatement) {
|
|
1112
|
-
var tmp_1 = tr.
|
|
1112
|
+
var tmp_1 = tr.c1v(stmt.w1n_1);
|
|
1113
1113
|
// Inline function 'kotlin.collections.map' call
|
|
1114
|
-
var this_0 = stmt.
|
|
1114
|
+
var this_0 = stmt.x1n_1;
|
|
1115
1115
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1116
1116
|
var destination = ArrayList_init_$Create$(this_0.a1());
|
|
1117
1117
|
// Inline function 'kotlin.collections.iterator' call
|
|
@@ -1122,7 +1122,7 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1122
1122
|
var name = item.k1();
|
|
1123
1123
|
// Inline function 'kotlin.collections.component2' call
|
|
1124
1124
|
var expr = item.l1();
|
|
1125
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), name), tr.
|
|
1125
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), name), tr.f1v(expr));
|
|
1126
1126
|
destination.x(tmp$ret$3);
|
|
1127
1127
|
}
|
|
1128
1128
|
tmp = new ConstructorStatement(tmp_1, toMap(destination));
|
|
@@ -1135,7 +1135,7 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1135
1135
|
}
|
|
1136
1136
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1137
1137
|
return function () {
|
|
1138
|
-
var tmp = Companion_getInstance_1().
|
|
1138
|
+
var tmp = Companion_getInstance_1().t1y_1;
|
|
1139
1139
|
var tmp_0 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1140
1140
|
var tmp_1 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
|
|
1141
1141
|
var tmp_2 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
|
|
@@ -1149,7 +1149,7 @@ function KotlinIrEmitter$_get_sanitizationConfig_$ref_tnafwf() {
|
|
|
1149
1149
|
};
|
|
1150
1150
|
}
|
|
1151
1151
|
function KotlinIrEmitter$modelSanitizationConfig$delegate$lambda$lambda(name) {
|
|
1152
|
-
return new Name(listOf(name.
|
|
1152
|
+
return new Name(listOf(name.n1j()));
|
|
1153
1153
|
}
|
|
1154
1154
|
function KotlinIrEmitter$modelSanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1155
1155
|
return function (it) {
|
|
@@ -1160,7 +1160,7 @@ function KotlinIrEmitter$modelSanitizationConfig$delegate$lambda(this$0) {
|
|
|
1160
1160
|
return function () {
|
|
1161
1161
|
var tmp = _get_sanitizationConfig__sns434(this$0);
|
|
1162
1162
|
var tmp_0 = KotlinIrEmitter$modelSanitizationConfig$delegate$lambda$lambda;
|
|
1163
|
-
return tmp.
|
|
1163
|
+
return tmp.x1w(VOID, VOID, tmp_0, VOID, KotlinIrEmitter$modelSanitizationConfig$delegate$lambda$lambda_0(this$0));
|
|
1164
1164
|
};
|
|
1165
1165
|
}
|
|
1166
1166
|
function KotlinIrEmitter$_get_modelSanitizationConfig_$ref_iulb4s() {
|
|
@@ -1172,7 +1172,7 @@ function KotlinIrEmitter$emitShared$lambda(element, transformer) {
|
|
|
1172
1172
|
var tmp;
|
|
1173
1173
|
if (element instanceof File) {
|
|
1174
1174
|
// Inline function 'kotlin.collections.partition' call
|
|
1175
|
-
var this_0 = element.
|
|
1175
|
+
var this_0 = element.a1o_1;
|
|
1176
1176
|
var first = ArrayList_init_$Create$_0();
|
|
1177
1177
|
var second = ArrayList_init_$Create$_0();
|
|
1178
1178
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -1187,7 +1187,7 @@ function KotlinIrEmitter$emitShared$lambda(element, transformer) {
|
|
|
1187
1187
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1188
1188
|
var packageElements = _destruct__k2r9zo.ve();
|
|
1189
1189
|
var rest = _destruct__k2r9zo.we();
|
|
1190
|
-
tmp = element.
|
|
1190
|
+
tmp = element.d1o(VOID, plus_2(plus_1(packageElements, import_0('kotlin.reflect', 'KType')), rest));
|
|
1191
1191
|
} else {
|
|
1192
1192
|
tmp = element;
|
|
1193
1193
|
}
|
|
@@ -1198,11 +1198,11 @@ function KotlinIrEmitter$emitShared$lambda_0($clientServer) {
|
|
|
1198
1198
|
return function (element, transformer) {
|
|
1199
1199
|
var tmp;
|
|
1200
1200
|
if (element instanceof Namespace) {
|
|
1201
|
-
var injected = element.
|
|
1201
|
+
var injected = element.f1o_1.equals(Companion_getInstance().r1h('Wirespec')) ? $clientServer : emptyList();
|
|
1202
1202
|
var tmp_0;
|
|
1203
1203
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1204
1204
|
if (!injected.r()) {
|
|
1205
|
-
tmp_0 = withElements(element, plus_2(element.
|
|
1205
|
+
tmp_0 = withElements(element, plus_2(element.b1o(), injected));
|
|
1206
1206
|
} else {
|
|
1207
1207
|
tmp_0 = element;
|
|
1208
1208
|
}
|
|
@@ -1227,7 +1227,7 @@ function KotlinIrEmitter$emitGenerator$lambda_1(it) {
|
|
|
1227
1227
|
}
|
|
1228
1228
|
function KotlinIrEmitter$emitGenerator$lambda_2(this$0) {
|
|
1229
1229
|
return function (it) {
|
|
1230
|
-
return import_0(this$0.
|
|
1230
|
+
return import_0(this$0.y1w().ds_1 + '.model', it);
|
|
1231
1231
|
};
|
|
1232
1232
|
}
|
|
1233
1233
|
function KotlinIrEmitter$emit$lambda(this$0) {
|
|
@@ -1239,26 +1239,26 @@ function KotlinIrEmitter(packageName, emitShared) {
|
|
|
1239
1239
|
Companion_getInstance_1();
|
|
1240
1240
|
packageName = packageName === VOID ? Companion_instance.cs('community.flock.wirespec.generated') : packageName;
|
|
1241
1241
|
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
1242
|
-
this.
|
|
1243
|
-
this.
|
|
1244
|
-
this.
|
|
1245
|
-
this.
|
|
1246
|
-
this.
|
|
1242
|
+
this.m1y_1 = packageName;
|
|
1243
|
+
this.n1y_1 = emitShared;
|
|
1244
|
+
this.o1y_1 = KotlinGenerator_instance;
|
|
1245
|
+
this.p1y_1 = FileExtension_Kotlin_getInstance();
|
|
1246
|
+
this.q1y_1 = listOf_0([import_0('community.flock.wirespec.kotlin', 'Wirespec'), import_0('kotlin.reflect', 'typeOf')]);
|
|
1247
1247
|
var tmp = this;
|
|
1248
|
-
tmp.
|
|
1248
|
+
tmp.r1y_1 = lazy(KotlinIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1249
1249
|
var tmp_0 = this;
|
|
1250
|
-
tmp_0.
|
|
1250
|
+
tmp_0.s1y_1 = lazy(KotlinIrEmitter$modelSanitizationConfig$delegate$lambda(this));
|
|
1251
1251
|
}
|
|
1252
|
-
protoOf(KotlinIrEmitter).
|
|
1253
|
-
return this.
|
|
1252
|
+
protoOf(KotlinIrEmitter).y1w = function () {
|
|
1253
|
+
return this.m1y_1;
|
|
1254
1254
|
};
|
|
1255
|
-
protoOf(KotlinIrEmitter).
|
|
1256
|
-
return this.
|
|
1255
|
+
protoOf(KotlinIrEmitter).x1v = function () {
|
|
1256
|
+
return this.o1y_1;
|
|
1257
1257
|
};
|
|
1258
1258
|
protoOf(KotlinIrEmitter).uq = function () {
|
|
1259
|
-
return this.
|
|
1259
|
+
return this.p1y_1;
|
|
1260
1260
|
};
|
|
1261
|
-
protoOf(KotlinIrEmitter).
|
|
1261
|
+
protoOf(KotlinIrEmitter).b1w = function () {
|
|
1262
1262
|
var packageName = Companion_instance.cs('community.flock.wirespec.kotlin');
|
|
1263
1263
|
var clientServer = convertClientServer(packageName);
|
|
1264
1264
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -1267,28 +1267,28 @@ protoOf(KotlinIrEmitter).x1v = function () {
|
|
|
1267
1267
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1268
1268
|
var tmp = scope;
|
|
1269
1269
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1270
|
-
var this_1 = scope.
|
|
1270
|
+
var this_1 = scope.k1v_1;
|
|
1271
1271
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1272
1272
|
// Inline function 'kotlin.apply' call
|
|
1273
1273
|
var this_2 = new TransformerBuilder();
|
|
1274
|
-
this_2.
|
|
1275
|
-
var tmp$ret$2 = this_2.
|
|
1276
|
-
tmp.
|
|
1274
|
+
this_2.b1j(KotlinIrEmitter$emitShared$lambda);
|
|
1275
|
+
var tmp$ret$2 = this_2.c1j();
|
|
1276
|
+
tmp.k1v_1 = transform(this_1, tmp$ret$2);
|
|
1277
1277
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1278
1278
|
var tmp_0 = scope;
|
|
1279
1279
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1280
1280
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1281
|
-
var this_3 = scope.
|
|
1281
|
+
var this_3 = scope.k1v_1;
|
|
1282
1282
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1283
1283
|
// Inline function 'kotlin.apply' call
|
|
1284
1284
|
var this_4 = new TransformerBuilder();
|
|
1285
|
-
this_4.
|
|
1286
|
-
var tmp$ret$7 = this_4.
|
|
1287
|
-
tmp_0.
|
|
1288
|
-
var tmp_1 = scope.
|
|
1285
|
+
this_4.b1j(KotlinIrEmitter$emitShared$lambda_0(clientServer));
|
|
1286
|
+
var tmp$ret$7 = this_4.c1j();
|
|
1287
|
+
tmp_0.k1v_1 = transform(this_3, tmp$ret$7);
|
|
1288
|
+
var tmp_1 = scope.k1v_1;
|
|
1289
1289
|
var wirespecShared = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1290
1290
|
var tmp_2;
|
|
1291
|
-
if (this.
|
|
1291
|
+
if (this.n1y_1.xo_1) {
|
|
1292
1292
|
tmp_2 = wirespecShared;
|
|
1293
1293
|
} else {
|
|
1294
1294
|
tmp_2 = null;
|
|
@@ -1298,7 +1298,7 @@ protoOf(KotlinIrEmitter).x1v = function () {
|
|
|
1298
1298
|
protoOf(KotlinIrEmitter).lr = function (definition, module_0, logger) {
|
|
1299
1299
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1300
1300
|
// Inline function 'kotlin.takeIf' call
|
|
1301
|
-
var this_0 = this.
|
|
1301
|
+
var this_0 = this.q1y_1;
|
|
1302
1302
|
var tmp;
|
|
1303
1303
|
if (Companion_instance_1.hr(module_0)) {
|
|
1304
1304
|
tmp = this_0;
|
|
@@ -1306,9 +1306,9 @@ protoOf(KotlinIrEmitter).lr = function (definition, module_0, logger) {
|
|
|
1306
1306
|
tmp = null;
|
|
1307
1307
|
}
|
|
1308
1308
|
var tmp$ret$1 = tmp;
|
|
1309
|
-
return placeInPackage(prependImports(file, tmp$ret$1), this.
|
|
1309
|
+
return placeInPackage(prependImports(file, tmp$ret$1), this.y1w(), definition);
|
|
1310
1310
|
};
|
|
1311
|
-
protoOf(KotlinIrEmitter).
|
|
1311
|
+
protoOf(KotlinIrEmitter).g1w = function (definition, module_0) {
|
|
1312
1312
|
var tmp;
|
|
1313
1313
|
if (definition instanceof Type) {
|
|
1314
1314
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1335,7 +1335,7 @@ protoOf(KotlinIrEmitter).c1w = function (definition, module_0) {
|
|
|
1335
1335
|
var tmp_2 = filterNot(tmp_1, KotlinIrEmitter$emitGenerator$lambda_0(generatorOwnName));
|
|
1336
1336
|
var tmp_3 = distinct_0(map(tmp_2, KotlinIrEmitter$emitGenerator$lambda_1));
|
|
1337
1337
|
var modelImports = toList(map(tmp_3, KotlinIrEmitter$emitGenerator$lambda_2(this)));
|
|
1338
|
-
return placeInPackage_0(prependImports(sanitized, plus_2(this.
|
|
1338
|
+
return placeInPackage_0(prependImports(sanitized, plus_2(this.q1y_1, modelImports)), this.y1w(), 'generator');
|
|
1339
1339
|
};
|
|
1340
1340
|
protoOf(KotlinIrEmitter).kq = function (type, module_0) {
|
|
1341
1341
|
return ensureEmptyStructHasConstructor(sanitizeNames(convertWithValidation(type, module_0), _get_modelSanitizationConfig__vgg831(this)));
|
|
@@ -1351,7 +1351,7 @@ protoOf(KotlinIrEmitter).ur = function (refined) {
|
|
|
1351
1351
|
var file = sanitizeNames(convert_2(refined), _get_sanitizationConfig__sns434(this));
|
|
1352
1352
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1353
1353
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1354
|
-
var tmp0 = file.
|
|
1354
|
+
var tmp0 = file.b1o();
|
|
1355
1355
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1356
1356
|
var destination = ArrayList_init_$Create$_0();
|
|
1357
1357
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1363,13 +1363,13 @@ protoOf(KotlinIrEmitter).ur = function (refined) {
|
|
|
1363
1363
|
}
|
|
1364
1364
|
var tmp0_safe_receiver = firstOrNull_0(destination);
|
|
1365
1365
|
var updatedStruct = tmp0_safe_receiver == null ? null : markMembersAsOverride(tmp0_safe_receiver);
|
|
1366
|
-
return new File(Companion_getInstance().
|
|
1366
|
+
return new File(Companion_getInstance().r1h(sanitize_0(this, refined.sr_1)), listOfNotNull_0(updatedStruct));
|
|
1367
1367
|
};
|
|
1368
1368
|
protoOf(KotlinIrEmitter).as = function (endpoint) {
|
|
1369
|
-
var imports = buildModelImports(endpoint, this.
|
|
1369
|
+
var imports = buildModelImports(endpoint, this.y1w());
|
|
1370
1370
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1371
1371
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1372
|
-
var tmp0 = convert_3(endpoint).
|
|
1372
|
+
var tmp0 = convert_3(endpoint).b1o();
|
|
1373
1373
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1374
1374
|
var destination = ArrayList_init_$Create$_0();
|
|
1375
1375
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1382,7 +1382,7 @@ protoOf(KotlinIrEmitter).as = function (endpoint) {
|
|
|
1382
1382
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1383
1383
|
var endpointNamespace = ensureNotNull(tmp$ret$2);
|
|
1384
1384
|
var body = injectApiAlias(injectCompanionObject(endpointNamespace, endpoint));
|
|
1385
|
-
var tmp = sanitizeNames(new File(Companion_getInstance().
|
|
1385
|
+
var tmp = sanitizeNames(new File(Companion_getInstance().r1h(sanitize_0(this, endpoint.up_1)), listOf(body)), _get_sanitizationConfig__sns434(this));
|
|
1386
1386
|
// Inline function 'kotlin.takeIf' call
|
|
1387
1387
|
var tmp_0;
|
|
1388
1388
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
@@ -1397,7 +1397,7 @@ protoOf(KotlinIrEmitter).as = function (endpoint) {
|
|
|
1397
1397
|
protoOf(KotlinIrEmitter).or = function (channel) {
|
|
1398
1398
|
var tmp = sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1399
1399
|
// Inline function 'kotlin.takeIf' call
|
|
1400
|
-
var this_0 = buildModelImports(channel, this.
|
|
1400
|
+
var this_0 = buildModelImports(channel, this.y1w());
|
|
1401
1401
|
var tmp_0;
|
|
1402
1402
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1403
1403
|
if (!this_0.r()) {
|
|
@@ -1408,25 +1408,25 @@ protoOf(KotlinIrEmitter).or = function (channel) {
|
|
|
1408
1408
|
var tmp$ret$2 = tmp_0;
|
|
1409
1409
|
return prependImports(tmp, tmp$ret$2);
|
|
1410
1410
|
};
|
|
1411
|
-
protoOf(KotlinIrEmitter).
|
|
1412
|
-
var imports = buildModelImports(endpoint, this.
|
|
1413
|
-
var endpointImport = import_0(this.
|
|
1411
|
+
protoOf(KotlinIrEmitter).f1w = function (endpoint) {
|
|
1412
|
+
var imports = buildModelImports(endpoint, this.y1w());
|
|
1413
|
+
var endpointImport = import_0(this.y1w().ds_1 + '.endpoint', endpoint.up_1.l1());
|
|
1414
1414
|
var file = sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this));
|
|
1415
|
-
var subPackageName = plus_0(this.
|
|
1416
|
-
var tmp = Companion_getInstance().
|
|
1415
|
+
var subPackageName = plus_0(this.y1w(), 'client');
|
|
1416
|
+
var tmp = Companion_getInstance().r1h(subPackageName.fs() + file.z1n_1.s1h());
|
|
1417
1417
|
// Inline function 'kotlin.collections.buildList' call
|
|
1418
1418
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1419
1419
|
// Inline function 'kotlin.apply' call
|
|
1420
1420
|
var this_0 = ArrayList_init_$Create$_0();
|
|
1421
1421
|
this_0.x(new Package(subPackageName.ds_1));
|
|
1422
|
-
this_0.f1(this.
|
|
1422
|
+
this_0.f1(this.q1y_1);
|
|
1423
1423
|
this_0.f1(imports);
|
|
1424
1424
|
this_0.x(endpointImport);
|
|
1425
|
-
this_0.f1(file.
|
|
1425
|
+
this_0.f1(file.a1o_1);
|
|
1426
1426
|
var tmp$ret$3 = this_0.o5();
|
|
1427
1427
|
return new File(tmp, tmp$ret$3);
|
|
1428
1428
|
};
|
|
1429
|
-
protoOf(KotlinIrEmitter).
|
|
1429
|
+
protoOf(KotlinIrEmitter).c1w = function (endpoints, logger) {
|
|
1430
1430
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1431
1431
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1432
1432
|
var destination = ArrayList_init_$Create$_0();
|
|
@@ -1453,7 +1453,7 @@ protoOf(KotlinIrEmitter).y1v = function (endpoints, logger) {
|
|
|
1453
1453
|
var _iterator__ex2g4s_1 = list_0.t();
|
|
1454
1454
|
while (_iterator__ex2g4s_1.u()) {
|
|
1455
1455
|
var item = _iterator__ex2g4s_1.v();
|
|
1456
|
-
var tmp$ret$5 = import_0(this.
|
|
1456
|
+
var tmp$ret$5 = import_0(this.y1w().ds_1 + '.model', item.bv_1);
|
|
1457
1457
|
destination_0.x(tmp$ret$5);
|
|
1458
1458
|
}
|
|
1459
1459
|
var imports = destination_0;
|
|
@@ -1463,7 +1463,7 @@ protoOf(KotlinIrEmitter).y1v = function (endpoints, logger) {
|
|
|
1463
1463
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1464
1464
|
while (_iterator__ex2g4s_2.u()) {
|
|
1465
1465
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
1466
|
-
var tmp$ret$8 = import_0(this.
|
|
1466
|
+
var tmp$ret$8 = import_0(this.y1w().ds_1 + '.endpoint', item_0.up_1.l1());
|
|
1467
1467
|
destination_1.x(tmp$ret$8);
|
|
1468
1468
|
}
|
|
1469
1469
|
var endpointImports = destination_1;
|
|
@@ -1473,21 +1473,21 @@ protoOf(KotlinIrEmitter).y1v = function (endpoints, logger) {
|
|
|
1473
1473
|
var _iterator__ex2g4s_3 = endpoints.t();
|
|
1474
1474
|
while (_iterator__ex2g4s_3.u()) {
|
|
1475
1475
|
var item_1 = _iterator__ex2g4s_3.v();
|
|
1476
|
-
var tmp$ret$11 = import_0(this.
|
|
1476
|
+
var tmp$ret$11 = import_0(this.y1w().ds_1 + '.client', item_1.up_1.l1() + 'Client');
|
|
1477
1477
|
destination_2.x(tmp$ret$11);
|
|
1478
1478
|
}
|
|
1479
1479
|
var clientImports = destination_2;
|
|
1480
1480
|
var allImports = plus_2(plus_2(imports, endpointImports), clientImports);
|
|
1481
1481
|
var file = sanitizeNames(emitClient.call(this, endpoints, logger), _get_sanitizationConfig__sns434(this));
|
|
1482
|
-
var tmp = Companion_getInstance().
|
|
1482
|
+
var tmp = Companion_getInstance().r1h(this.y1w().fs() + file.z1n_1.s1h());
|
|
1483
1483
|
// Inline function 'kotlin.collections.buildList' call
|
|
1484
1484
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1485
1485
|
// Inline function 'kotlin.apply' call
|
|
1486
1486
|
var this_0 = ArrayList_init_$Create$_0();
|
|
1487
|
-
this_0.x(new Package(this.
|
|
1488
|
-
this_0.f1(this.
|
|
1487
|
+
this_0.x(new Package(this.y1w().ds_1));
|
|
1488
|
+
this_0.f1(this.q1y_1);
|
|
1489
1489
|
this_0.f1(allImports);
|
|
1490
|
-
this_0.f1(file.
|
|
1490
|
+
this_0.f1(file.a1o_1);
|
|
1491
1491
|
var tmp$ret$17 = this_0.o5();
|
|
1492
1492
|
return new File(tmp, tmp$ret$17);
|
|
1493
1493
|
};
|
|
@@ -1510,7 +1510,7 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1510
1510
|
var _iterator__ex2g4s_0 = list.t();
|
|
1511
1511
|
while (_iterator__ex2g4s_0.u()) {
|
|
1512
1512
|
var item = _iterator__ex2g4s_0.v();
|
|
1513
|
-
var tmp$ret$2 = import_0(packageName.ds_1 + '.model', Companion_getInstance().
|
|
1513
|
+
var tmp$ret$2 = import_0(packageName.ds_1 + '.model', Companion_getInstance().r1h(item.bv_1).s1h());
|
|
1514
1514
|
destination.x(tmp$ret$2);
|
|
1515
1515
|
}
|
|
1516
1516
|
return destination;
|
|
@@ -1522,14 +1522,14 @@ function injectApiAlias(_this__u8e3s4) {
|
|
|
1522
1522
|
var tmp = scope;
|
|
1523
1523
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1524
1524
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1525
|
-
var this_0 = scope.
|
|
1525
|
+
var this_0 = scope.k1v_1;
|
|
1526
1526
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1527
1527
|
// Inline function 'kotlin.apply' call
|
|
1528
1528
|
var this_1 = new TransformerBuilder();
|
|
1529
|
-
this_1.
|
|
1530
|
-
var tmp$ret$2 = this_1.
|
|
1531
|
-
tmp.
|
|
1532
|
-
var tmp_0 = scope.
|
|
1529
|
+
this_1.b1j(injectApiAlias$lambda);
|
|
1530
|
+
var tmp$ret$2 = this_1.c1j();
|
|
1531
|
+
tmp.k1v_1 = transform(this_0, tmp$ret$2);
|
|
1532
|
+
var tmp_0 = scope.k1v_1;
|
|
1533
1533
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1534
1534
|
}
|
|
1535
1535
|
function injectCompanionObject(_this__u8e3s4, endpoint) {
|
|
@@ -1539,14 +1539,14 @@ function injectCompanionObject(_this__u8e3s4, endpoint) {
|
|
|
1539
1539
|
var tmp = scope;
|
|
1540
1540
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1541
1541
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1542
|
-
var this_0 = scope.
|
|
1542
|
+
var this_0 = scope.k1v_1;
|
|
1543
1543
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1544
1544
|
// Inline function 'kotlin.apply' call
|
|
1545
1545
|
var this_1 = new TransformerBuilder();
|
|
1546
|
-
this_1.
|
|
1547
|
-
var tmp$ret$2 = this_1.
|
|
1548
|
-
tmp.
|
|
1549
|
-
var tmp_0 = scope.
|
|
1546
|
+
this_1.b1j(injectCompanionObject$lambda(endpoint));
|
|
1547
|
+
var tmp$ret$2 = this_1.c1j();
|
|
1548
|
+
tmp.k1v_1 = transform(this_0, tmp$ret$2);
|
|
1549
|
+
var tmp_0 = scope.k1v_1;
|
|
1550
1550
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1551
1551
|
}
|
|
1552
1552
|
function buildCompanionObject(endpoint) {
|
|
@@ -1562,7 +1562,7 @@ function injectApiAlias$lambda(element, transformer) {
|
|
|
1562
1562
|
var tmp_0;
|
|
1563
1563
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1564
1564
|
if (!injected.r()) {
|
|
1565
|
-
tmp_0 = withElements(element, plus_2(element.
|
|
1565
|
+
tmp_0 = withElements(element, plus_2(element.b1o(), injected));
|
|
1566
1566
|
} else {
|
|
1567
1567
|
tmp_0 = element;
|
|
1568
1568
|
}
|
|
@@ -1577,11 +1577,11 @@ function injectCompanionObject$lambda($endpoint) {
|
|
|
1577
1577
|
return function (element, transformer) {
|
|
1578
1578
|
var tmp;
|
|
1579
1579
|
if (element instanceof Interface) {
|
|
1580
|
-
var injected = element.
|
|
1580
|
+
var injected = element.t1o_1.equals(Companion_getInstance().r1h('Handler')) ? listOf(buildCompanionObject($endpoint)) : emptyList();
|
|
1581
1581
|
var tmp_0;
|
|
1582
1582
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1583
1583
|
if (!injected.r()) {
|
|
1584
|
-
tmp_0 = withElements(element, plus_2(element.
|
|
1584
|
+
tmp_0 = withElements(element, plus_2(element.b1o(), injected));
|
|
1585
1585
|
} else {
|
|
1586
1586
|
tmp_0 = element;
|
|
1587
1587
|
}
|
|
@@ -1610,8 +1610,8 @@ function KotlinRefinedTypeDefinitionEmitter() {
|
|
|
1610
1610
|
}
|
|
1611
1611
|
function KotlinShared() {
|
|
1612
1612
|
KotlinShared_instance = this;
|
|
1613
|
-
this.
|
|
1614
|
-
this.
|
|
1613
|
+
this.f1y_1 = 'community.flock.wirespec.kotlin';
|
|
1614
|
+
this.g1y_1 = trimMargin('\n |package ' + this.f1y_1 + '\n |\n |import kotlin.reflect.KType\n |\n |object Wirespec {\n |' + Spacer_instance.toString() + 'interface Enum { val label: String }\n |' + Spacer_instance.toString() + 'interface Endpoint\n |' + Spacer_instance.toString() + 'interface Refined<T> {\n |' + Spacer_instance.hs(2) + 'val value: T\n |' + Spacer_instance.hs(2) + 'fun validate(): Boolean\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Path\n |' + Spacer_instance.toString() + 'interface Queries\n |' + Spacer_instance.toString() + 'interface Headers\n |' + Spacer_instance.toString() + 'interface Handler\n |' + Spacer_instance.toString() + 'interface ServerEdge<Req: Request<*>, Res: Response<*>> { \n |' + Spacer_instance.toString() + 'fun from(request: RawRequest): Req \n |' + Spacer_instance.toString() + 'fun to(response: Res): RawResponse\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface ClientEdge<Req: Request<*>, Res: Response<*>> { \n |' + Spacer_instance.hs(2) + 'fun to(request: Req): RawRequest\n |' + Spacer_instance.hs(2) + 'fun from(response: RawResponse): Res\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req : Request<*>, Res : Response<*>> {\n |' + Spacer_instance.hs(2) + 'val pathTemplate: String\n |' + Spacer_instance.hs(2) + 'val method: String\n |' + Spacer_instance.hs(2) + 'fun client(serialization: Serialization): ClientEdge<Req, Res>\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Server<Req : Request<*>, Res : Response<*>> {\n |' + Spacer_instance.hs(2) + 'val pathTemplate: String\n |' + Spacer_instance.hs(2) + 'val method: String\n |' + Spacer_instance.hs(2) + 'fun server(serialization: Serialization): ServerEdge<Req, Res>\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'enum class Method { GET, PUT, POST, DELETE, OPTIONS, HEAD, PATCH, TRACE }\n |' + Spacer_instance.toString() + 'interface Request<T : Any> { val path: Path; val method: Method; val queries: Queries; val headers: Headers; val body: T; interface Headers : Wirespec.Headers }\n |' + Spacer_instance.toString() + 'interface Response<T : Any> { val status: Int; val headers: Headers; val body: T; interface Headers : Wirespec.Headers }\n |' + Spacer_instance.toString() + 'interface Serialization : Serializer, Deserializer\n |' + Spacer_instance.toString() + 'interface Serializer : BodySerializer, PathSerializer, ParamSerializer\n |' + Spacer_instance.toString() + 'interface Deserializer : BodyDeserializer, PathDeserializer, ParamDeserializer\n |' + Spacer_instance.toString() + 'interface BodySerialization : BodySerializer, BodyDeserializer\n |' + Spacer_instance.toString() + 'interface BodySerializer { fun <T : Any> serializeBody(t: T, kType: KType): ByteArray }\n |' + Spacer_instance.toString() + 'interface BodyDeserializer { fun <T : Any> deserializeBody(raw: ByteArray, kType: KType): T }\n |' + Spacer_instance.toString() + 'interface PathSerialization : PathSerializer, PathDeserializer\n |' + Spacer_instance.toString() + 'interface PathSerializer { fun <T : Any> serializePath(t: T, kType: KType): String }\n |' + Spacer_instance.toString() + 'interface PathDeserializer { fun <T : Any> deserializePath(raw: String, kType: KType): T }\n |' + Spacer_instance.toString() + 'interface ParamSerialization : ParamSerializer, ParamDeserializer\n |' + Spacer_instance.toString() + 'interface ParamSerializer { fun <T : Any> serializeParam(value: T, kType: KType): List<String> }\n |' + Spacer_instance.toString() + 'interface ParamDeserializer { fun <T : Any> deserializeParam(values: List<String>, kType: KType): T }\n |' + Spacer_instance.toString() + 'data class RawRequest(val method: String, val path: List<String>, val queries: Map<String, List<String>>, val headers: Map<String, List<String>>, val body: ByteArray?) \n |' + Spacer_instance.toString() + 'data class RawResponse(val statusCode: Int, val headers: Map<String, List<String>>, val body: ByteArray?)\n |}\n ');
|
|
1615
1615
|
}
|
|
1616
1616
|
protoOf(KotlinShared).toString = function () {
|
|
1617
1617
|
return 'KotlinShared';
|
|
@@ -1652,27 +1652,27 @@ protoOf(KotlinEmitter).lq = emit_5;
|
|
|
1652
1652
|
protoOf(KotlinEmitter).mq = emit_6;
|
|
1653
1653
|
protoOf(KotlinEmitter).nq = emit_7;
|
|
1654
1654
|
protoOf(KotlinEmitter).oq = emit_8;
|
|
1655
|
-
protoOf(KotlinEmitter).zr =
|
|
1656
|
-
protoOf(KotlinEmitter).ur =
|
|
1655
|
+
protoOf(KotlinEmitter).zr = emit_15;
|
|
1656
|
+
protoOf(KotlinEmitter).ur = emit_13;
|
|
1657
1657
|
protoOf(KotlinEmitter).as = emit_10;
|
|
1658
1658
|
protoOf(KotlinEmitter).pr = emit_14;
|
|
1659
1659
|
protoOf(KotlinEmitter).nr = emit_3;
|
|
1660
1660
|
protoOf(KotlinEmitter).or = emit_9;
|
|
1661
|
-
protoOf(KotlinEmitter).
|
|
1662
|
-
protoOf(KotlinEmitter).
|
|
1661
|
+
protoOf(KotlinEmitter).l1x = emit_11;
|
|
1662
|
+
protoOf(KotlinEmitter).m1x = emit_12;
|
|
1663
1663
|
protoOf(KotlinEmitter).bs = emitValidator;
|
|
1664
|
-
protoOf(KotlinEmitter).
|
|
1665
|
-
protoOf(KotlinEmitter).
|
|
1666
|
-
protoOf(KotlinEmitter).
|
|
1667
|
-
protoOf(KotlinEmitter).
|
|
1668
|
-
protoOf(KotlinEmitter).
|
|
1669
|
-
protoOf(KotlinEmitter).
|
|
1670
|
-
protoOf(KotlinEmitter).
|
|
1671
|
-
protoOf(KotlinEmitter).
|
|
1672
|
-
protoOf(KotlinIrEmitter).
|
|
1664
|
+
protoOf(KotlinEmitter).y1x = sanitize;
|
|
1665
|
+
protoOf(KotlinEmitter).n1x = sanitizeFirstIsDigit;
|
|
1666
|
+
protoOf(KotlinEmitter).o1x = sanitizeKeywords;
|
|
1667
|
+
protoOf(KotlinEmitter).p1x = emitHandleFunction;
|
|
1668
|
+
protoOf(KotlinEmitter).h1y = emitRequestHeaders;
|
|
1669
|
+
protoOf(KotlinEmitter).i1y = emitQueries;
|
|
1670
|
+
protoOf(KotlinEmitter).j1y = emitBody;
|
|
1671
|
+
protoOf(KotlinEmitter).k1y = emitHeaders;
|
|
1672
|
+
protoOf(KotlinIrEmitter).z1v = get_extensions;
|
|
1673
1673
|
protoOf(KotlinIrEmitter).eo = emit_1;
|
|
1674
|
-
protoOf(KotlinIrEmitter).
|
|
1675
|
-
protoOf(KotlinIrEmitter).
|
|
1674
|
+
protoOf(KotlinIrEmitter).a1w = emit_2;
|
|
1675
|
+
protoOf(KotlinIrEmitter).e1w = beforeGenerate;
|
|
1676
1676
|
//endregion
|
|
1677
1677
|
//region block: exports
|
|
1678
1678
|
export {
|