@flock/wirespec 0.19.2 → 0.19.3
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 +39 -39
- 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 +9765 -9765
- package/kotlin-rgxgen.mjs +1756 -1756
- package/kotlinx-io-kotlinx-io-core.mjs +403 -403
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1759 -1759
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1468 -1468
- package/mordant-mordant.mjs +1181 -1181
- package/package.json +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +238 -236
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +139 -137
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +176 -174
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +305 -303
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +112 -110
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +179 -177
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +24 -24
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +2626 -2578
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +479 -479
- package/wirespec-src-converter-openapi.mjs +338 -338
- package/wirespec-src-ide-lsp.mjs +1351 -1351
- package/wirespec-src-plugin-arguments.mjs +134 -134
- package/wirespec-src-plugin-cli.mjs +84 -84
- package/wirespec-src-plugin-npm.mjs +18 -18
- package/wirespec-src-tools-generator.mjs +2 -2
|
@@ -168,6 +168,7 @@ import {
|
|
|
168
168
|
convert1cn4bolzoed8c as convert_4,
|
|
169
169
|
emitEndpointClient1meajc90wf3el as emitEndpointClient,
|
|
170
170
|
emitClient32kfwzg2hm5vj as emitClient,
|
|
171
|
+
get_extensions31c4or738wbxz as get_extensions,
|
|
171
172
|
emit1oxjujel6f3jb as emit_1,
|
|
172
173
|
beforeGenerate3o8idb3hey1b0 as beforeGenerate,
|
|
173
174
|
IrEmitterh2m93ojzvkep as IrEmitter,
|
|
@@ -206,10 +207,10 @@ initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, V
|
|
|
206
207
|
function emit_3(identifier) {
|
|
207
208
|
var tmp;
|
|
208
209
|
if (identifier instanceof DefinitionIdentifier) {
|
|
209
|
-
tmp = this.
|
|
210
|
+
tmp = this.u1x(identifier);
|
|
210
211
|
} else {
|
|
211
212
|
if (identifier instanceof FieldIdentifier) {
|
|
212
|
-
tmp = this.
|
|
213
|
+
tmp = this.k1x(this.u1x(identifier));
|
|
213
214
|
} else {
|
|
214
215
|
noWhenBranchMatchedException();
|
|
215
216
|
}
|
|
@@ -265,7 +266,7 @@ function sanitize(_this__u8e3s4) {
|
|
|
265
266
|
return tmp;
|
|
266
267
|
}
|
|
267
268
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
268
|
-
return Companion_getInstance_0().
|
|
269
|
+
return Companion_getInstance_0().e1z_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
269
270
|
}
|
|
270
271
|
initMetadataForInterface(PythonIdentifierEmitter, 'PythonIdentifierEmitter');
|
|
271
272
|
function emit_4(type, module_0) {
|
|
@@ -291,7 +292,7 @@ function emit_6(_this__u8e3s4) {
|
|
|
291
292
|
}
|
|
292
293
|
function emit_7(_this__u8e3s4) {
|
|
293
294
|
// Inline function 'kotlin.let' call
|
|
294
|
-
var it = this.
|
|
295
|
+
var it = this.c1z(_this__u8e3s4);
|
|
295
296
|
return _this__u8e3s4.tu() ? 'Optional[' + it + ']' : it;
|
|
296
297
|
}
|
|
297
298
|
function emitType(_this__u8e3s4) {
|
|
@@ -312,7 +313,7 @@ function emitType(_this__u8e3s4) {
|
|
|
312
313
|
tmp = _this__u8e3s4.bv_1;
|
|
313
314
|
} else {
|
|
314
315
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
315
|
-
tmp = this.
|
|
316
|
+
tmp = this.a1z(_this__u8e3s4.fv_1);
|
|
316
317
|
} else {
|
|
317
318
|
noWhenBranchMatchedException();
|
|
318
319
|
}
|
|
@@ -396,7 +397,7 @@ function emit_10(endpoint) {
|
|
|
396
397
|
var tmp = importReferences(endpoint);
|
|
397
398
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda(this));
|
|
398
399
|
var tmp_1 = this.nr(endpoint.up_1);
|
|
399
|
-
var tmp_2 = spacer(this.
|
|
400
|
+
var tmp_2 = spacer(this.h1x(first(endpoint.zp_1), endpoint), 1);
|
|
400
401
|
var tmp_3 = distinctByStatus(endpoint.aq_1);
|
|
401
402
|
return trimMargin('\n |' + tmp_0 + '\n |\n |class ' + tmp_1 + ' (Wirespec.Endpoint):\n |' + tmp_2 + '\n |' + spacer(joinToString(tmp_3, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda_0(this, endpoint)), 1) + '\n |' + spacer(emitResponseUnion(this, endpoint), 1) + '\n |' + spacer(emitHandleClass(this, endpoint), 1) + '\n |' + spacer(emitConvertClass(this, endpoint), 1) + '\n |\n ');
|
|
402
403
|
}
|
|
@@ -454,17 +455,12 @@ function emit_12(_this__u8e3s4, endpoint) {
|
|
|
454
455
|
return trimMargin('\n |@dataclass\n |class Response' + _this__u8e3s4.gq_1 + '(Wirespec.Response[' + tmp + ']):\n |' + tmp_0 + '\n |\n |' + tmp_1 + '@property\n |' + tmp_2 + 'def headers(self) -> Headers:\n |' + tmp_3 + tmp_4 + 'return self._headers\n |\n |' + tmp_5 + '@property\n |' + tmp_6 + 'def body(self) -> ' + tmp_7 + ':\n |' + tmp_8 + tmp_9 + 'return self._body\n |\n |' + tmp_10 + '_body: ' + tmp_11 + '\n |' + tmp_12 + '_headers: Headers\n |' + tmp_13 + 'status: int = ' + _this__u8e3s4.gq_1 + '\n |\n |' + tmp_14 + 'def __init__(self, ' + joinToString(tmp_15, ', ', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda_6(this)) + '):\n |' + spacer(emitAssignSelf_1(this, _this__u8e3s4, endpoint), 2) + '\n |\n ');
|
|
455
456
|
}
|
|
456
457
|
initMetadataForInterface(PythonEndpointDefinitionEmitter, 'PythonEndpointDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter]);
|
|
457
|
-
function emit_13(
|
|
458
|
-
var tmp = this.r1x(enum_0.xr_1);
|
|
459
|
-
return trimMargin('\n |class ' + tmp + '(str, Enum):\n |' + joinToString(enum_0.yr_1, '\n', VOID, VOID, VOID, VOID, PythonEnumDefinitionEmitter$emit$lambda(this)) + '\n |\n |' + Spacer_instance.toString() + '@property\n |' + Spacer_instance.toString() + 'def label(self) -> str:\n |' + Spacer_instance.hs(2) + 'return self.value\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.hs(2) + 'return self.value\n ');
|
|
460
|
-
}
|
|
461
|
-
initMetadataForInterface(PythonEnumDefinitionEmitter, 'PythonEnumDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
462
|
-
function emit_14(union) {
|
|
458
|
+
function emit_13(union) {
|
|
463
459
|
return trimMargin('\n |class ' + this.nr(union.gp_1) + '(ABC):\n |' + Spacer_instance.toString() + 'pass\n ');
|
|
464
460
|
}
|
|
465
461
|
initMetadataForInterface(PythonUnionDefinitionEmitter, 'PythonUnionDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
466
|
-
function
|
|
467
|
-
return trimMargin('\n |@dataclass\n |class ' + this.
|
|
462
|
+
function emit_14(refined) {
|
|
463
|
+
return trimMargin('\n |@dataclass\n |class ' + this.u1x(refined.sr_1) + '(Wirespec.Refined):\n |' + Spacer_instance.toString() + 'value: ' + this.c1z(refined.tr_1) + '\n |\n |' + Spacer_instance.toString() + 'def validate(self) -> bool:\n |' + Spacer_instance.hs(2) + 'return ' + this.bs(refined) + '\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.hs(2) + 'return str(self.value)\n |\n ');
|
|
468
464
|
}
|
|
469
465
|
function emitValidator(_this__u8e3s4) {
|
|
470
466
|
var defaultReturn = 'True';
|
|
@@ -507,7 +503,12 @@ function emitValidator(_this__u8e3s4) {
|
|
|
507
503
|
return tmp;
|
|
508
504
|
}
|
|
509
505
|
initMetadataForInterface(PythonRefinedTypeDefinitionEmitter, 'PythonRefinedTypeDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
510
|
-
|
|
506
|
+
function emit_15(enum_0, module_0) {
|
|
507
|
+
var tmp = this.u1x(enum_0.xr_1);
|
|
508
|
+
return trimMargin('\n |class ' + tmp + '(str, Enum):\n |' + joinToString(enum_0.yr_1, '\n', VOID, VOID, VOID, VOID, PythonEnumDefinitionEmitter$emit$lambda(this)) + '\n |\n |' + Spacer_instance.toString() + '@property\n |' + Spacer_instance.toString() + 'def label(self) -> str:\n |' + Spacer_instance.hs(2) + 'return self.value\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.hs(2) + 'return self.value\n ');
|
|
509
|
+
}
|
|
510
|
+
initMetadataForInterface(PythonEnumDefinitionEmitter, 'PythonEnumDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
511
|
+
initMetadataForClass(PythonEmitter, 'PythonEmitter', PythonEmitter, LanguageEmitter, [LanguageEmitter, PythonEndpointDefinitionEmitter, PythonUnionDefinitionEmitter, PythonRefinedTypeDefinitionEmitter, PythonTypeDefinitionEmitter, PythonEnumDefinitionEmitter, PythonIdentifierEmitter, PythonChannelDefinitionEmitter]);
|
|
511
512
|
initMetadataForCompanion(Companion);
|
|
512
513
|
initMetadataForCompanion(Companion_0);
|
|
513
514
|
initMetadataForClass(sam$kotlin_Comparator$0_0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
|
|
@@ -517,16 +518,16 @@ initMetadataForObject(PythonShared, 'PythonShared');
|
|
|
517
518
|
function PythonChannelDefinitionEmitter() {
|
|
518
519
|
}
|
|
519
520
|
function sam$kotlin_Comparator$0(function_0) {
|
|
520
|
-
this.
|
|
521
|
+
this.q1y_1 = function_0;
|
|
521
522
|
}
|
|
522
523
|
protoOf(sam$kotlin_Comparator$0).td = function (a, b) {
|
|
523
|
-
return this.
|
|
524
|
+
return this.q1y_1(a, b);
|
|
524
525
|
};
|
|
525
526
|
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
526
527
|
return this.td(a, b);
|
|
527
528
|
};
|
|
528
529
|
protoOf(sam$kotlin_Comparator$0).l3 = function () {
|
|
529
|
-
return this.
|
|
530
|
+
return this.q1y_1;
|
|
530
531
|
};
|
|
531
532
|
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
532
533
|
var tmp;
|
|
@@ -549,8 +550,8 @@ protoOf(sam$kotlin_Comparator$0).hashCode = function () {
|
|
|
549
550
|
function PythonEmitter$emit$lambda(this$0) {
|
|
550
551
|
return function (a, b) {
|
|
551
552
|
// Inline function 'kotlin.comparisons.compareValuesBy' call
|
|
552
|
-
var tmp = this$0.
|
|
553
|
-
var tmp$ret$1 = this$0.
|
|
553
|
+
var tmp = this$0.x1y(a);
|
|
554
|
+
var tmp$ret$1 = this$0.x1y(b);
|
|
554
555
|
return compareValues(tmp, tmp$ret$1);
|
|
555
556
|
};
|
|
556
557
|
}
|
|
@@ -561,23 +562,23 @@ function PythonEmitter(packageName, emitShared) {
|
|
|
561
562
|
packageName = packageName === VOID ? Companion_instance.cs('community.flock.wirespec.generated') : packageName;
|
|
562
563
|
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
563
564
|
LanguageEmitter.call(this);
|
|
564
|
-
this.
|
|
565
|
-
this.
|
|
566
|
-
this.
|
|
567
|
-
this.
|
|
568
|
-
this.
|
|
569
|
-
this.
|
|
565
|
+
this.r1y_1 = packageName;
|
|
566
|
+
this.s1y_1 = emitShared;
|
|
567
|
+
this.t1y_1 = 'import re\n\nfrom abc import abstractmethod\nfrom dataclasses import dataclass\nfrom typing import List, Optional\nfrom enum import Enum\n\nfrom ..wirespec import T, Wirespec\n';
|
|
568
|
+
this.u1y_1 = FileExtension_Python_getInstance();
|
|
569
|
+
this.v1y_1 = PythonShared_instance;
|
|
570
|
+
this.w1y_1 = '#';
|
|
570
571
|
}
|
|
571
572
|
protoOf(PythonEmitter).uq = function () {
|
|
572
|
-
return this.
|
|
573
|
+
return this.u1y_1;
|
|
573
574
|
};
|
|
574
|
-
protoOf(PythonEmitter).
|
|
575
|
-
return this.
|
|
575
|
+
protoOf(PythonEmitter).d1x = function () {
|
|
576
|
+
return this.v1y_1;
|
|
576
577
|
};
|
|
577
578
|
protoOf(PythonEmitter).vq = function () {
|
|
578
|
-
return this.
|
|
579
|
+
return this.w1y_1;
|
|
579
580
|
};
|
|
580
|
-
protoOf(PythonEmitter).
|
|
581
|
+
protoOf(PythonEmitter).x1y = function (definition) {
|
|
581
582
|
var tmp;
|
|
582
583
|
if (definition instanceof Enum) {
|
|
583
584
|
tmp = 1;
|
|
@@ -617,8 +618,8 @@ protoOf(PythonEmitter).kr = function (module_0, logger) {
|
|
|
617
618
|
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).om_1;
|
|
618
619
|
// Inline function 'kotlin.let' call
|
|
619
620
|
var it = protoOf(LanguageEmitter).kr.call(this, module_0.mv(VOID, statements), logger);
|
|
620
|
-
var init = new Emitted(this.
|
|
621
|
-
var tmp_1 = this.
|
|
621
|
+
var init = new Emitted(this.r1y_1.fs() + '__init__', 'from . import model\nfrom . import endpoint\nfrom . import wirespec\n');
|
|
622
|
+
var tmp_1 = this.r1y_1.fs() + 'endpoint/' + '__init__';
|
|
622
623
|
// Inline function 'kotlin.collections.filter' call
|
|
623
624
|
var tmp0 = new NonEmptyList(module_0.tq_1);
|
|
624
625
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -640,7 +641,7 @@ protoOf(PythonEmitter).kr = function (module_0, logger) {
|
|
|
640
641
|
destination_0.x(tmp$ret$5);
|
|
641
642
|
}
|
|
642
643
|
var initEndpoint = new Emitted(tmp_1, joinToString(destination_0, '\n'));
|
|
643
|
-
var tmp_2 = this.
|
|
644
|
+
var tmp_2 = this.r1y_1.fs() + 'model/' + '__init__';
|
|
644
645
|
// Inline function 'kotlin.collections.filter' call
|
|
645
646
|
var tmp0_0 = new NonEmptyList(module_0.tq_1);
|
|
646
647
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -662,16 +663,16 @@ protoOf(PythonEmitter).kr = function (module_0, logger) {
|
|
|
662
663
|
destination_2.x(tmp$ret$11);
|
|
663
664
|
}
|
|
664
665
|
var initModel = new Emitted(tmp_2, joinToString(destination_2, '\n'));
|
|
665
|
-
var shared = new Emitted(this.
|
|
666
|
-
return this.
|
|
666
|
+
var shared = new Emitted(this.r1y_1.fs() + 'wirespec', this.d1x().z1y_1);
|
|
667
|
+
return this.s1y_1.xo_1 ? NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(it, init), initEndpoint), initModel), shared) : NonEmptyList__plus_impl_xqmb9(it, init);
|
|
667
668
|
};
|
|
668
669
|
protoOf(PythonEmitter).lr = function (definition, module_0, logger) {
|
|
669
|
-
var subPackageName = plus_1(this.
|
|
670
|
+
var subPackageName = plus_1(this.r1y_1, definition);
|
|
670
671
|
// Inline function 'kotlin.let' call
|
|
671
672
|
var it = protoOf(LanguageEmitter).lr.call(this, definition, module_0, logger);
|
|
672
673
|
var tmp = subPackageName.fs() + it.yo_1;
|
|
673
674
|
// Inline function 'kotlin.text.trimStart' call
|
|
674
|
-
var this_0 = trimMargin('\n |' + this.
|
|
675
|
+
var this_0 = trimMargin('\n |' + this.t1y_1 + '\n |' + it.zo_1 + '\n ');
|
|
675
676
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
676
677
|
return new Emitted(tmp, tmp$ret$0);
|
|
677
678
|
};
|
|
@@ -711,7 +712,7 @@ function emitToRawRequest($this, _this__u8e3s4, endpoint) {
|
|
|
711
712
|
var tmp_19 = Spacer_instance.toString();
|
|
712
713
|
var tmp0_safe_receiver = _this__u8e3s4.dq_1;
|
|
713
714
|
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.fq_1;
|
|
714
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
715
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.c1z(tmp1_safe_receiver);
|
|
715
716
|
return trimMargin("\n |@staticmethod\n |def to_raw_request(serialization: Wirespec.Serializer, request: '" + tmp + ".Request') -> Wirespec.RawRequest:\n |" + tmp_0 + 'return Wirespec.RawRequest(\n |' + tmp_1 + tmp_2 + 'path = [' + tmp_3 + '],\n |' + tmp_4 + tmp_5 + 'method = request.method.value,\n |' + tmp_6 + tmp_7 + 'queries = {\n |' + tmp_9 + '\n |' + tmp_10 + tmp_11 + '},\n |' + tmp_12 + tmp_13 + 'headers = {\n |' + tmp_15 + '\n |' + tmp_16 + tmp_17 + '},\n |' + tmp_18 + tmp_19 + 'body = serialization.serialize(request.body, ' + (tmp2_elvis_lhs == null ? 'type(None)' : tmp2_elvis_lhs) + '),\n |' + Spacer_instance.toString() + ')\n |\n ');
|
|
716
717
|
}
|
|
717
718
|
function emitFromRawRequest($this, _this__u8e3s4, endpoint) {
|
|
@@ -728,7 +729,7 @@ function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
|
728
729
|
tmp_3 = null;
|
|
729
730
|
} else {
|
|
730
731
|
// Inline function 'kotlin.let' call
|
|
731
|
-
tmp_3 = Spacer_instance.hs(3) + 'body = serialization.deserialize(request.body, ' + $this.
|
|
732
|
+
tmp_3 = Spacer_instance.hs(3) + 'body = serialization.deserialize(request.body, ' + $this.c1z(tmp0_safe_receiver.fq_1) + '),';
|
|
732
733
|
}
|
|
733
734
|
// Inline function 'kotlin.let' call
|
|
734
735
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
@@ -828,18 +829,18 @@ function emitAssignSelf_1($this, _this__u8e3s4, endpoint) {
|
|
|
828
829
|
return trimMargin('\n |self._headers = ' + tmp + '.Response' + _this__u8e3s4.gq_1 + '.Headers(' + tmp_1 + ')\n |self._body = ' + (tmp1_elvis_lhs == null ? 'None' : tmp1_elvis_lhs) + '\n ');
|
|
829
830
|
}
|
|
830
831
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
831
|
-
return Spacer_instance.hs(3) + $this.nr(_this__u8e3s4.ue_1.bq_1) + ' = serialization.deserialize(request.path[' + _this__u8e3s4.te_1 + '], ' + $this.
|
|
832
|
+
return Spacer_instance.hs(3) + $this.nr(_this__u8e3s4.ue_1.bq_1) + ' = serialization.deserialize(request.path[' + _this__u8e3s4.te_1 + '], ' + $this.c1z(_this__u8e3s4.ue_1.cq_1) + ')';
|
|
832
833
|
}
|
|
833
834
|
function emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive) {
|
|
834
835
|
var tmp;
|
|
835
836
|
if (caseSensitive) {
|
|
836
|
-
tmp = Spacer_instance.hs(spaces) + $this.nr(_this__u8e3s4.qp_1) + ' = serialization.deserialize_param(' + type + '.' + fields + '.get("' + _this__u8e3s4.qp_1.l1() + '"), ' + $this.
|
|
837
|
+
tmp = Spacer_instance.hs(spaces) + $this.nr(_this__u8e3s4.qp_1) + ' = serialization.deserialize_param(' + type + '.' + fields + '.get("' + _this__u8e3s4.qp_1.l1() + '"), ' + $this.c1z(_this__u8e3s4.rp_1) + ')';
|
|
837
838
|
} else {
|
|
838
839
|
var tmp_0 = Spacer_instance.hs(spaces);
|
|
839
840
|
var tmp_1 = $this.nr(_this__u8e3s4.qp_1);
|
|
840
841
|
// Inline function 'kotlin.text.lowercase' call
|
|
841
842
|
// Inline function 'kotlin.js.asDynamic' call
|
|
842
|
-
tmp = tmp_0 + tmp_1 + ' = serialization.deserialize_param(next((v for k, v in ' + type + '.' + fields + '.items() if k.lower() == "' + _this__u8e3s4.qp_1.l1().toLowerCase() + '"), None), ' + $this.
|
|
843
|
+
tmp = tmp_0 + tmp_1 + ' = serialization.deserialize_param(next((v for k, v in ' + type + '.' + fields + '.items() if k.lower() == "' + _this__u8e3s4.qp_1.l1().toLowerCase() + '"), None), ' + $this.c1z(_this__u8e3s4.rp_1) + ')';
|
|
843
844
|
}
|
|
844
845
|
return tmp;
|
|
845
846
|
}
|
|
@@ -877,7 +878,7 @@ function emitDeserialized_0($this, _this__u8e3s4, endpoint) {
|
|
|
877
878
|
var tmp_1 = Spacer_instance.hs(2);
|
|
878
879
|
var tmp0_safe_receiver = _this__u8e3s4.iq_1;
|
|
879
880
|
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.fq_1;
|
|
880
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
881
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.c1z(tmp1_safe_receiver);
|
|
881
882
|
var tmp_2 = tmp_1 + 'body = serialization.deserialize(response.body, ' + (tmp2_elvis_lhs == null ? 'type(None)' : tmp2_elvis_lhs) + '),';
|
|
882
883
|
return joinToString(listOfNotNull([tmp, tmp_0, tmp_2, orNull(joinToString(_this__u8e3s4.hq_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserialized$lambda($this))), Spacer_instance.toString() + ')']), '\n');
|
|
883
884
|
}
|
|
@@ -901,13 +902,13 @@ function emitSerialized($this, _this__u8e3s4, endpoint) {
|
|
|
901
902
|
tmp_6 = null;
|
|
902
903
|
} else {
|
|
903
904
|
// Inline function 'kotlin.let' call
|
|
904
|
-
tmp_6 = 'serialization.serialize(response.body, ' + $this.
|
|
905
|
+
tmp_6 = 'serialization.serialize(response.body, ' + $this.c1z(tmp0_safe_receiver.fq_1) + ')';
|
|
905
906
|
}
|
|
906
907
|
var tmp1_elvis_lhs = tmp_6;
|
|
907
908
|
return trimMargin('\n |case ' + tmp + '.Response' + _this__u8e3s4.gq_1 + '():\n |' + tmp_0 + 'return Wirespec.RawResponse(\n |' + tmp_1 + 'status_code = response.status,\n |' + tmp_2 + 'headers = ' + tmp_4 + ',\n |' + tmp_5 + 'body = ' + (tmp1_elvis_lhs == null ? 'type(None)' : tmp1_elvis_lhs) + ',\n |' + Spacer_instance.hs(1) + ')\n ');
|
|
908
909
|
}
|
|
909
910
|
function emitSerializedParams($this, _this__u8e3s4, type, fields) {
|
|
910
|
-
return '"' + _this__u8e3s4.qp_1.l1() + '": serialization.serialize_param(' + type + '.' + fields + '.' + $this.nr(_this__u8e3s4.qp_1) + ', ' + $this.
|
|
911
|
+
return '"' + _this__u8e3s4.qp_1.l1() + '": serialization.serialize_param(' + type + '.' + fields + '.' + $this.nr(_this__u8e3s4.qp_1) + ', ' + $this.c1z(_this__u8e3s4.rp_1) + ')';
|
|
911
912
|
}
|
|
912
913
|
function emitObject($this, _this__u8e3s4, name, extends_0, spaces, block) {
|
|
913
914
|
var tmp;
|
|
@@ -934,12 +935,12 @@ function emit_18($this, _this__u8e3s4) {
|
|
|
934
935
|
}
|
|
935
936
|
function PythonEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
936
937
|
return function (it) {
|
|
937
|
-
return this$0.
|
|
938
|
+
return this$0.d1z(it);
|
|
938
939
|
};
|
|
939
940
|
}
|
|
940
941
|
function PythonEndpointDefinitionEmitter$emit$lambda_0(this$0, $endpoint) {
|
|
941
942
|
return function (it) {
|
|
942
|
-
return this$0.
|
|
943
|
+
return this$0.b1z(it, $endpoint);
|
|
943
944
|
};
|
|
944
945
|
}
|
|
945
946
|
function PythonEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
@@ -1086,14 +1087,14 @@ function sanitizeEnum($this, _this__u8e3s4) {
|
|
|
1086
1087
|
}
|
|
1087
1088
|
function PythonEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
1088
1089
|
return function (it) {
|
|
1089
|
-
return Spacer_instance.toString() + this$0.
|
|
1090
|
+
return Spacer_instance.toString() + this$0.k1x(sanitizeEnum(this$0, it)) + ' = "' + it + '"';
|
|
1090
1091
|
};
|
|
1091
1092
|
}
|
|
1092
1093
|
function PythonEnumDefinitionEmitter() {
|
|
1093
1094
|
}
|
|
1094
1095
|
function Companion() {
|
|
1095
1096
|
Companion_instance_2 = this;
|
|
1096
|
-
this.
|
|
1097
|
+
this.e1z_1 = setOf(['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']);
|
|
1097
1098
|
}
|
|
1098
1099
|
var Companion_instance_2;
|
|
1099
1100
|
function Companion_getInstance_0() {
|
|
@@ -1104,7 +1105,7 @@ function Companion_getInstance_0() {
|
|
|
1104
1105
|
function PythonIdentifierEmitter() {
|
|
1105
1106
|
}
|
|
1106
1107
|
function _get_sanitizationConfig__sns434($this) {
|
|
1107
|
-
var tmp0 = $this.
|
|
1108
|
+
var tmp0 = $this.j1z_1;
|
|
1108
1109
|
var tmp = KProperty1;
|
|
1109
1110
|
// Inline function 'kotlin.getValue' call
|
|
1110
1111
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, PythonIrEmitter$_get_sanitizationConfig_$ref_1q5eai(), null);
|
|
@@ -1167,7 +1168,7 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
1167
1168
|
return tmp_2;
|
|
1168
1169
|
}
|
|
1169
1170
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1170
|
-
return Companion_getInstance_1().
|
|
1171
|
+
return Companion_getInstance_1().l1z_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1171
1172
|
}
|
|
1172
1173
|
function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
1173
1174
|
// Inline function 'kotlin.let' call
|
|
@@ -1193,7 +1194,7 @@ function buildImports($this, wirespecPath) {
|
|
|
1193
1194
|
}
|
|
1194
1195
|
function Companion_0() {
|
|
1195
1196
|
Companion_instance_3 = this;
|
|
1196
|
-
this.
|
|
1197
|
+
this.l1z_1 = setOf(['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']);
|
|
1197
1198
|
}
|
|
1198
1199
|
var Companion_instance_3;
|
|
1199
1200
|
function Companion_getInstance_1() {
|
|
@@ -1202,16 +1203,16 @@ function Companion_getInstance_1() {
|
|
|
1202
1203
|
return Companion_instance_3;
|
|
1203
1204
|
}
|
|
1204
1205
|
function sam$kotlin_Comparator$0_0(function_0) {
|
|
1205
|
-
this.
|
|
1206
|
+
this.m1z_1 = function_0;
|
|
1206
1207
|
}
|
|
1207
1208
|
protoOf(sam$kotlin_Comparator$0_0).td = function (a, b) {
|
|
1208
|
-
return this.
|
|
1209
|
+
return this.m1z_1(a, b);
|
|
1209
1210
|
};
|
|
1210
1211
|
protoOf(sam$kotlin_Comparator$0_0).compare = function (a, b) {
|
|
1211
1212
|
return this.td(a, b);
|
|
1212
1213
|
};
|
|
1213
1214
|
protoOf(sam$kotlin_Comparator$0_0).l3 = function () {
|
|
1214
|
-
return this.
|
|
1215
|
+
return this.m1z_1;
|
|
1215
1216
|
};
|
|
1216
1217
|
protoOf(sam$kotlin_Comparator$0_0).equals = function (other) {
|
|
1217
1218
|
var tmp;
|
|
@@ -1248,9 +1249,9 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1248
1249
|
return function (stmt, tr) {
|
|
1249
1250
|
var tmp;
|
|
1250
1251
|
if (stmt instanceof ConstructorStatement) {
|
|
1251
|
-
var tmp_0 = tr.
|
|
1252
|
+
var tmp_0 = tr.y1u(stmt.s1n_1);
|
|
1252
1253
|
// Inline function 'kotlin.collections.map' call
|
|
1253
|
-
var this_0 = stmt.
|
|
1254
|
+
var this_0 = stmt.t1n_1;
|
|
1254
1255
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1255
1256
|
var destination = ArrayList_init_$Create$_0(this_0.a1());
|
|
1256
1257
|
// Inline function 'kotlin.collections.iterator' call
|
|
@@ -1261,7 +1262,7 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1261
1262
|
var k = item.k1();
|
|
1262
1263
|
// Inline function 'kotlin.collections.component2' call
|
|
1263
1264
|
var v = item.l1();
|
|
1264
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.
|
|
1265
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.b1v(v));
|
|
1265
1266
|
destination.x(tmp$ret$3);
|
|
1266
1267
|
}
|
|
1267
1268
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
@@ -1273,7 +1274,7 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1273
1274
|
}
|
|
1274
1275
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1275
1276
|
return function () {
|
|
1276
|
-
var tmp = Companion_getInstance_1().
|
|
1277
|
+
var tmp = Companion_getInstance_1().l1z_1;
|
|
1277
1278
|
var tmp_0 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1278
1279
|
var tmp_1 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0;
|
|
1279
1280
|
var tmp_2 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1;
|
|
@@ -1312,17 +1313,17 @@ function PythonIrEmitter$emitGenerator$lambda_2($generatorOwnName, $generatorRef
|
|
|
1312
1313
|
var tmp_0;
|
|
1313
1314
|
var tmp_1;
|
|
1314
1315
|
if (expr instanceof RawExpression) {
|
|
1315
|
-
tmp_1 = endsWith(expr.
|
|
1316
|
+
tmp_1 = endsWith(expr.m1p_1, 'Generator');
|
|
1316
1317
|
} else {
|
|
1317
1318
|
tmp_1 = false;
|
|
1318
1319
|
}
|
|
1319
1320
|
if (tmp_1) {
|
|
1320
|
-
tmp_0 = !(expr.
|
|
1321
|
+
tmp_0 = !(expr.m1p_1 === $generatorOwnName);
|
|
1321
1322
|
} else {
|
|
1322
1323
|
tmp_0 = false;
|
|
1323
1324
|
}
|
|
1324
1325
|
if (tmp_0) {
|
|
1325
|
-
$generatorRefs.x(expr.
|
|
1326
|
+
$generatorRefs.x(expr.m1p_1);
|
|
1326
1327
|
tmp = Unit_instance;
|
|
1327
1328
|
}
|
|
1328
1329
|
return transformChildren_0(expr, t);
|
|
@@ -1337,31 +1338,31 @@ function PythonIrEmitter(packageName, emitShared) {
|
|
|
1337
1338
|
Companion_getInstance_1();
|
|
1338
1339
|
packageName = packageName === VOID ? Companion_instance.cs('community.flock.wirespec.generated') : packageName;
|
|
1339
1340
|
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
1340
|
-
this.
|
|
1341
|
-
this.
|
|
1342
|
-
this.
|
|
1343
|
-
this.
|
|
1341
|
+
this.f1z_1 = packageName;
|
|
1342
|
+
this.g1z_1 = emitShared;
|
|
1343
|
+
this.h1z_1 = PythonGenerator_instance;
|
|
1344
|
+
this.i1z_1 = FileExtension_Python_getInstance();
|
|
1344
1345
|
var tmp = this;
|
|
1345
|
-
tmp.
|
|
1346
|
-
this.
|
|
1346
|
+
tmp.j1z_1 = lazy(PythonIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1347
|
+
this.k1z_1 = "from __future__ import annotations\n\nimport enum\nfrom abc import ABC, abstractmethod\nfrom dataclasses import dataclass\nfrom typing import Any, Callable, Generic, Optional, Type, TypeVar\n\nT = TypeVar('T')\nV = TypeVar('V')\n\n\ndef _raise(msg: str) -> Any:\n raise Exception(msg)\n\n";
|
|
1347
1348
|
}
|
|
1348
|
-
protoOf(PythonIrEmitter).
|
|
1349
|
-
return this.
|
|
1349
|
+
protoOf(PythonIrEmitter).t1v = function () {
|
|
1350
|
+
return this.h1z_1;
|
|
1350
1351
|
};
|
|
1351
1352
|
protoOf(PythonIrEmitter).uq = function () {
|
|
1352
|
-
return this.
|
|
1353
|
+
return this.i1z_1;
|
|
1353
1354
|
};
|
|
1354
|
-
protoOf(PythonIrEmitter).
|
|
1355
|
+
protoOf(PythonIrEmitter).x1v = function () {
|
|
1355
1356
|
var source = replaceReflectInNonGenericStructFields(convert(Companion_instance.cs('shared')));
|
|
1356
1357
|
var tmp;
|
|
1357
|
-
if (this.
|
|
1358
|
-
tmp = new File(Companion_getInstance().n1h(this.
|
|
1358
|
+
if (this.g1z_1.xo_1) {
|
|
1359
|
+
tmp = new File(Companion_getInstance().n1h(this.f1z_1.fs() + 'wirespec'), listOf_0(raw(this.k1z_1 + PythonGenerator_instance.u1v(source))));
|
|
1359
1360
|
} else {
|
|
1360
1361
|
tmp = null;
|
|
1361
1362
|
}
|
|
1362
1363
|
return tmp;
|
|
1363
1364
|
};
|
|
1364
|
-
protoOf(PythonIrEmitter).
|
|
1365
|
+
protoOf(PythonIrEmitter).w1v = function (module_0, logger) {
|
|
1365
1366
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
1366
1367
|
var this_0 = new NonEmptyList(module_0.tq_1);
|
|
1367
1368
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
@@ -1396,7 +1397,7 @@ protoOf(PythonIrEmitter).u1v = function (module_0, logger) {
|
|
|
1396
1397
|
tmp$ret$2 = false;
|
|
1397
1398
|
}
|
|
1398
1399
|
var hasEndpoints = tmp$ret$2;
|
|
1399
|
-
var tmp_2 = Companion_getInstance().n1h(this.
|
|
1400
|
+
var tmp_2 = Companion_getInstance().n1h(this.f1z_1.fs() + '__init__');
|
|
1400
1401
|
// Inline function 'kotlin.collections.buildList' call
|
|
1401
1402
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1402
1403
|
// Inline function 'kotlin.apply' call
|
|
@@ -1409,7 +1410,7 @@ protoOf(PythonIrEmitter).u1v = function (module_0, logger) {
|
|
|
1409
1410
|
this_1.x(import_0('.', 'wirespec'));
|
|
1410
1411
|
var tmp$ret$7 = this_1.o5();
|
|
1411
1412
|
var init = new File(tmp_2, tmp$ret$7);
|
|
1412
|
-
var tmp_3 = Companion_getInstance().n1h(this.
|
|
1413
|
+
var tmp_3 = Companion_getInstance().n1h(this.f1z_1.fs() + 'endpoint/' + '__init__');
|
|
1413
1414
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1414
1415
|
var tmp0_0 = new NonEmptyList(module_0.tq_1);
|
|
1415
1416
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
@@ -1431,7 +1432,7 @@ protoOf(PythonIrEmitter).u1v = function (module_0, logger) {
|
|
|
1431
1432
|
destination_0.x(tmp$ret$10);
|
|
1432
1433
|
}
|
|
1433
1434
|
var initEndpoint = new File(tmp_3, destination_0);
|
|
1434
|
-
var tmp_4 = Companion_getInstance().n1h(this.
|
|
1435
|
+
var tmp_4 = Companion_getInstance().n1h(this.f1z_1.fs() + 'model/' + '__init__');
|
|
1435
1436
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1436
1437
|
var tmp0_1 = new NonEmptyList(module_0.tq_1);
|
|
1437
1438
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
@@ -1453,8 +1454,8 @@ protoOf(PythonIrEmitter).u1v = function (module_0, logger) {
|
|
|
1453
1454
|
destination_2.x(tmp$ret$15);
|
|
1454
1455
|
}
|
|
1455
1456
|
var initModel = new File(tmp_4, destination_2);
|
|
1456
|
-
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().n1h(this.
|
|
1457
|
-
var tmp0_2 = dropLast(split(this.
|
|
1457
|
+
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().n1h(this.f1z_1.fs() + 'client/' + '__init__'), emptyList())) : emptyList();
|
|
1458
|
+
var tmp0_2 = dropLast(split(this.f1z_1.ds_1, ['.']), 1);
|
|
1458
1459
|
var tmp$ret$18;
|
|
1459
1460
|
$l$block_1: {
|
|
1460
1461
|
// Inline function 'kotlin.collections.runningFold' call
|
|
@@ -1495,13 +1496,13 @@ protoOf(PythonIrEmitter).u1v = function (module_0, logger) {
|
|
|
1495
1496
|
destination_3.x(tmp$ret$23);
|
|
1496
1497
|
}
|
|
1497
1498
|
var parentInits = destination_3;
|
|
1498
|
-
return this.
|
|
1499
|
+
return this.g1z_1.xo_1 ? NonEmptyList__plus_impl_xqmb9_0(NonEmptyList__plus_impl_xqmb9_0(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(emitted, init), initEndpoint), initModel), initClient), parentInits) : NonEmptyList__plus_impl_xqmb9_0(NonEmptyList__plus_impl_xqmb9(emitted, init), parentInits);
|
|
1499
1500
|
};
|
|
1500
1501
|
protoOf(PythonIrEmitter).lr = function (definition, module_0, logger) {
|
|
1501
1502
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1502
|
-
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.
|
|
1503
|
+
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.f1z_1, definition);
|
|
1503
1504
|
};
|
|
1504
|
-
protoOf(PythonIrEmitter).
|
|
1505
|
+
protoOf(PythonIrEmitter).c1w = function (definition, module_0) {
|
|
1505
1506
|
var tmp;
|
|
1506
1507
|
if (definition instanceof Type) {
|
|
1507
1508
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1531,8 +1532,8 @@ protoOf(PythonIrEmitter).z1v = function (definition, module_0) {
|
|
|
1531
1532
|
var generatorRefs = LinkedHashSet_init_$Create$();
|
|
1532
1533
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1533
1534
|
var scope = new TransformScope(sanitized);
|
|
1534
|
-
scope.
|
|
1535
|
-
var tmp_3 = scope.
|
|
1535
|
+
scope.o1v(PythonIrEmitter$emitGenerator$lambda_2(generatorOwnName, generatorRefs));
|
|
1536
|
+
var tmp_3 = scope.g1v_1;
|
|
1536
1537
|
isInterface(tmp_3, Element) || THROW_CCE();
|
|
1537
1538
|
// Inline function 'kotlin.collections.filter' call
|
|
1538
1539
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -1575,7 +1576,7 @@ protoOf(PythonIrEmitter).z1v = function (definition, module_0) {
|
|
|
1575
1576
|
destination_2.x(tmp$ret$12);
|
|
1576
1577
|
}
|
|
1577
1578
|
var modelImports = destination_2;
|
|
1578
|
-
return placeInModule_0(prependImports(sanitized, plus(plus(buildImports(this, '..wirespec'), modelImports), generatorImports)), this.
|
|
1579
|
+
return placeInModule_0(prependImports(sanitized, plus(plus(buildImports(this, '..wirespec'), modelImports), generatorImports)), this.f1z_1, 'generator');
|
|
1579
1580
|
};
|
|
1580
1581
|
protoOf(PythonIrEmitter).kq = function (type, module_0) {
|
|
1581
1582
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
@@ -1658,13 +1659,13 @@ protoOf(PythonIrEmitter).as = function (endpoint) {
|
|
|
1658
1659
|
var endpointImports = destination;
|
|
1659
1660
|
// Inline function 'kotlin.let' call
|
|
1660
1661
|
var it = splitEndpointStructsToModuleLevel(convert_3(endpoint));
|
|
1661
|
-
var tmp$ret$6 = it.
|
|
1662
|
+
var tmp$ret$6 = it.z1n(VOID, plus(endpointImports, it.w1n_1));
|
|
1662
1663
|
return sanitizeNames(snakeCaseHandlerAndCallMethods(tmp$ret$6), _get_sanitizationConfig__sns434(this));
|
|
1663
1664
|
};
|
|
1664
1665
|
protoOf(PythonIrEmitter).or = function (channel) {
|
|
1665
1666
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1666
1667
|
};
|
|
1667
|
-
protoOf(PythonIrEmitter).
|
|
1668
|
+
protoOf(PythonIrEmitter).b1w = function (endpoint) {
|
|
1668
1669
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1669
1670
|
var this_0 = importReferences(endpoint);
|
|
1670
1671
|
var set = HashSet_init_$Create$();
|
|
@@ -1690,10 +1691,10 @@ protoOf(PythonIrEmitter).y1v = function (endpoint) {
|
|
|
1690
1691
|
var endpointImport = import_0('..endpoint.' + endpoint.up_1.l1(), '*');
|
|
1691
1692
|
var endpointName = endpoint.up_1.l1();
|
|
1692
1693
|
var file = flattenEndpointTypeRefs(snakeCaseClientFunctions(addSelfReceiverToClientFields(sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this)))), endpointName);
|
|
1693
|
-
var subPackageName = plus_2(this.
|
|
1694
|
-
return new File(Companion_getInstance().n1h(subPackageName.fs() + file.
|
|
1694
|
+
var subPackageName = plus_2(this.f1z_1, 'client');
|
|
1695
|
+
return new File(Companion_getInstance().n1h(subPackageName.fs() + file.v1n_1.o1h()), plus(plus(plus(buildImports(this, '..wirespec'), modelImports), listOf_0(endpointImport)), file.w1n_1));
|
|
1695
1696
|
};
|
|
1696
|
-
protoOf(PythonIrEmitter).
|
|
1697
|
+
protoOf(PythonIrEmitter).y1v = function (endpoints, logger) {
|
|
1697
1698
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1698
1699
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1699
1700
|
var destination = ArrayList_init_$Create$();
|
|
@@ -1765,7 +1766,7 @@ protoOf(PythonIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1765
1766
|
accumulator = flattenEndpointTypeRefs(acc, element_0);
|
|
1766
1767
|
}
|
|
1767
1768
|
var file = accumulator;
|
|
1768
|
-
return new File(Companion_getInstance().n1h(this.
|
|
1769
|
+
return new File(Companion_getInstance().n1h(this.f1z_1.fs() + file.v1n_1.o1h()), plus(plus(buildImports(this, '.wirespec'), allImports), file.w1n_1));
|
|
1769
1770
|
};
|
|
1770
1771
|
function replaceReflectInNonGenericStructFields(_this__u8e3s4) {
|
|
1771
1772
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -1773,14 +1774,14 @@ function replaceReflectInNonGenericStructFields(_this__u8e3s4) {
|
|
|
1773
1774
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1774
1775
|
var tmp = scope;
|
|
1775
1776
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1776
|
-
var this_0 = scope.
|
|
1777
|
+
var this_0 = scope.g1v_1;
|
|
1777
1778
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1778
1779
|
// Inline function 'kotlin.apply' call
|
|
1779
1780
|
var this_1 = new TransformerBuilder();
|
|
1780
|
-
this_1.
|
|
1781
|
-
var tmp$ret$2 = this_1.
|
|
1782
|
-
tmp.
|
|
1783
|
-
var tmp_0 = scope.
|
|
1781
|
+
this_1.x1i(replaceReflectInNonGenericStructFields$lambda);
|
|
1782
|
+
var tmp$ret$2 = this_1.y1i();
|
|
1783
|
+
tmp.g1v_1 = transform(this_0, tmp$ret$2);
|
|
1784
|
+
var tmp_0 = scope.g1v_1;
|
|
1784
1785
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1785
1786
|
}
|
|
1786
1787
|
function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
@@ -1789,14 +1790,14 @@ function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
|
1789
1790
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1790
1791
|
var tmp = scope;
|
|
1791
1792
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1792
|
-
var this_0 = scope.
|
|
1793
|
+
var this_0 = scope.g1v_1;
|
|
1793
1794
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1794
1795
|
// Inline function 'kotlin.apply' call
|
|
1795
1796
|
var this_1 = new TransformerBuilder();
|
|
1796
|
-
this_1.
|
|
1797
|
-
var tmp$ret$2 = this_1.
|
|
1798
|
-
tmp.
|
|
1799
|
-
var tmp_0 = scope.
|
|
1797
|
+
this_1.x1i(replaceRefinedFunctions$lambda(refined));
|
|
1798
|
+
var tmp$ret$2 = this_1.y1i();
|
|
1799
|
+
tmp.g1v_1 = transform(this_0, tmp$ret$2);
|
|
1800
|
+
var tmp_0 = scope.g1v_1;
|
|
1800
1801
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1801
1802
|
}
|
|
1802
1803
|
function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
@@ -1805,20 +1806,20 @@ function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
|
1805
1806
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1806
1807
|
var tmp = scope;
|
|
1807
1808
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1808
|
-
var this_0 = scope.
|
|
1809
|
+
var this_0 = scope.g1v_1;
|
|
1809
1810
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1810
1811
|
// Inline function 'kotlin.apply' call
|
|
1811
1812
|
var this_1 = new TransformerBuilder();
|
|
1812
|
-
this_1.
|
|
1813
|
-
var tmp$ret$2 = this_1.
|
|
1814
|
-
tmp.
|
|
1815
|
-
var tmp_0 = scope.
|
|
1813
|
+
this_1.x1i(snakeCaseHandlerAndCallMethods$lambda);
|
|
1814
|
+
var tmp$ret$2 = this_1.y1i();
|
|
1815
|
+
tmp.g1v_1 = transform(this_0, tmp$ret$2);
|
|
1816
|
+
var tmp_0 = scope.g1v_1;
|
|
1816
1817
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1817
1818
|
}
|
|
1818
1819
|
function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
1819
1820
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1820
1821
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1821
|
-
var tmp0 = _this__u8e3s4.
|
|
1822
|
+
var tmp0 = _this__u8e3s4.x1n();
|
|
1822
1823
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1823
1824
|
var destination = ArrayList_init_$Create$();
|
|
1824
1825
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1831,7 +1832,7 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1831
1832
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1832
1833
|
var namespace = ensureNotNull(tmp$ret$2);
|
|
1833
1834
|
// Inline function 'kotlin.collections.partition' call
|
|
1834
|
-
var this_0 = namespace.
|
|
1835
|
+
var this_0 = namespace.c1o_1;
|
|
1835
1836
|
var first = ArrayList_init_$Create$();
|
|
1836
1837
|
var second = ArrayList_init_$Create$();
|
|
1837
1838
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
@@ -1852,14 +1853,14 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1852
1853
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1853
1854
|
var moduleElements = _destruct__k2r9zo.ve();
|
|
1854
1855
|
var classElements = _destruct__k2r9zo.we();
|
|
1855
|
-
var endpointClass = new Namespace(namespace.
|
|
1856
|
-
return new File(namespace.
|
|
1856
|
+
var endpointClass = new Namespace(namespace.b1o_1, classElements, namespace.d1o_1);
|
|
1857
|
+
return new File(namespace.b1o_1, plus_0(moduleElements, endpointClass));
|
|
1857
1858
|
}
|
|
1858
1859
|
function flattenEndpointTypeRefs(_this__u8e3s4, endpointName) {
|
|
1859
1860
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1860
1861
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1861
|
-
scope.
|
|
1862
|
-
var tmp = scope.
|
|
1862
|
+
scope.m1v(flattenEndpointTypeRefs$lambda(endpointName));
|
|
1863
|
+
var tmp = scope.g1v_1;
|
|
1863
1864
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1864
1865
|
}
|
|
1865
1866
|
function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
@@ -1868,15 +1869,15 @@ function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
|
1868
1869
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1869
1870
|
var tmp = scope;
|
|
1870
1871
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1871
|
-
var this_0 = scope.
|
|
1872
|
+
var this_0 = scope.g1v_1;
|
|
1872
1873
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1873
1874
|
// Inline function 'kotlin.apply' call
|
|
1874
1875
|
var this_1 = new TransformerBuilder();
|
|
1875
|
-
this_1.
|
|
1876
|
-
var tmp$ret$2 = this_1.
|
|
1877
|
-
tmp.
|
|
1878
|
-
scope.
|
|
1879
|
-
var tmp_0 = scope.
|
|
1876
|
+
this_1.x1i(snakeCaseClientFunctions$lambda);
|
|
1877
|
+
var tmp$ret$2 = this_1.y1i();
|
|
1878
|
+
tmp.g1v_1 = transform(this_0, tmp$ret$2);
|
|
1879
|
+
scope.p1v(snakeCaseClientFunctions$lambda_0);
|
|
1880
|
+
var tmp_0 = scope.g1v_1;
|
|
1880
1881
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1881
1882
|
}
|
|
1882
1883
|
function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
@@ -1887,7 +1888,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1887
1888
|
} else {
|
|
1888
1889
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1889
1890
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1890
|
-
var tmp0 = tmp0_safe_receiver.
|
|
1891
|
+
var tmp0 = tmp0_safe_receiver.x1n();
|
|
1891
1892
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1892
1893
|
var destination = ArrayList_init_$Create$();
|
|
1893
1894
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1900,7 +1901,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1900
1901
|
tmp = firstOrNull_0(destination);
|
|
1901
1902
|
}
|
|
1902
1903
|
var struct = tmp;
|
|
1903
|
-
var tmp2_safe_receiver = struct == null ? null : struct.
|
|
1904
|
+
var tmp2_safe_receiver = struct == null ? null : struct.h1o_1;
|
|
1904
1905
|
var tmp_0;
|
|
1905
1906
|
if (tmp2_safe_receiver == null) {
|
|
1906
1907
|
tmp_0 = null;
|
|
@@ -1911,7 +1912,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1911
1912
|
var _iterator__ex2g4s_0 = tmp2_safe_receiver.t();
|
|
1912
1913
|
while (_iterator__ex2g4s_0.u()) {
|
|
1913
1914
|
var item = _iterator__ex2g4s_0.v();
|
|
1914
|
-
var tmp$ret$3 = item.
|
|
1915
|
+
var tmp$ret$3 = item.c1q_1.j1j();
|
|
1915
1916
|
destination_0.x(tmp$ret$3);
|
|
1916
1917
|
}
|
|
1917
1918
|
tmp_0 = destination_0;
|
|
@@ -1923,8 +1924,8 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1923
1924
|
return _this__u8e3s4;
|
|
1924
1925
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1925
1926
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1926
|
-
scope.
|
|
1927
|
-
var tmp_1 = scope.
|
|
1927
|
+
scope.p1v(addSelfReceiverToClientFields$lambda(fieldNames));
|
|
1928
|
+
var tmp_1 = scope.g1v_1;
|
|
1928
1929
|
return isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1929
1930
|
}
|
|
1930
1931
|
function replaceReflectAsTypeAny(_this__u8e3s4) {
|
|
@@ -1933,13 +1934,13 @@ function replaceReflectAsTypeAny(_this__u8e3s4) {
|
|
|
1933
1934
|
tmp = Custom_init_$Create$('type', listOf_0(Any_instance));
|
|
1934
1935
|
} else {
|
|
1935
1936
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
1936
|
-
tmp = _this__u8e3s4.
|
|
1937
|
+
tmp = _this__u8e3s4.h1n(replaceReflectAsTypeAny(_this__u8e3s4.f1j_1));
|
|
1937
1938
|
} else {
|
|
1938
1939
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
1939
|
-
tmp = _this__u8e3s4.
|
|
1940
|
+
tmp = _this__u8e3s4.h1n(replaceReflectAsTypeAny(_this__u8e3s4.g1j_1));
|
|
1940
1941
|
} else {
|
|
1941
1942
|
if (_this__u8e3s4 instanceof Dict_0) {
|
|
1942
|
-
tmp = _this__u8e3s4.
|
|
1943
|
+
tmp = _this__u8e3s4.k1n(replaceReflectAsTypeAny(_this__u8e3s4.i1n_1), replaceReflectAsTypeAny(_this__u8e3s4.j1n_1));
|
|
1943
1944
|
} else {
|
|
1944
1945
|
tmp = _this__u8e3s4;
|
|
1945
1946
|
}
|
|
@@ -1954,21 +1955,21 @@ function replaceReflectInNonGenericStructFields$lambda(element, transformer) {
|
|
|
1954
1955
|
var tmp$ret$1;
|
|
1955
1956
|
$l$block: {
|
|
1956
1957
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1957
|
-
if (!element.
|
|
1958
|
+
if (!element.l1o_1.r()) {
|
|
1958
1959
|
tmp$ret$1 = element;
|
|
1959
1960
|
break $l$block;
|
|
1960
1961
|
}
|
|
1961
1962
|
// Inline function 'kotlin.collections.map' call
|
|
1962
|
-
var this_0 = element.
|
|
1963
|
+
var this_0 = element.h1o_1;
|
|
1963
1964
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1964
1965
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1965
1966
|
var _iterator__ex2g4s = this_0.t();
|
|
1966
1967
|
while (_iterator__ex2g4s.u()) {
|
|
1967
1968
|
var item = _iterator__ex2g4s.v();
|
|
1968
|
-
var tmp$ret$2 = item.
|
|
1969
|
+
var tmp$ret$2 = item.g1q(VOID, replaceReflectAsTypeAny(item.d1q_1));
|
|
1969
1970
|
destination.x(tmp$ret$2);
|
|
1970
1971
|
}
|
|
1971
|
-
tmp$ret$1 = element.
|
|
1972
|
+
tmp$ret$1 = element.n1o(VOID, destination);
|
|
1972
1973
|
}
|
|
1973
1974
|
tmp = tmp$ret$1;
|
|
1974
1975
|
} else {
|
|
@@ -1979,17 +1980,17 @@ function replaceReflectInNonGenericStructFields$lambda(element, transformer) {
|
|
|
1979
1980
|
}
|
|
1980
1981
|
function replaceRefinedFunctions$lambda$lambda($constraintExpr) {
|
|
1981
1982
|
return function ($this$function) {
|
|
1982
|
-
$this$function.
|
|
1983
|
-
$this$function.
|
|
1984
|
-
$this$function.
|
|
1983
|
+
$this$function.y1h('self', Custom_init_$Create$(''));
|
|
1984
|
+
$this$function.b1i(Boolean_instance_0);
|
|
1985
|
+
$this$function.c1i($constraintExpr);
|
|
1985
1986
|
return Unit_instance;
|
|
1986
1987
|
};
|
|
1987
1988
|
}
|
|
1988
1989
|
function replaceRefinedFunctions$lambda$lambda_0($toStringExpr) {
|
|
1989
1990
|
return function ($this$function) {
|
|
1990
|
-
$this$function.
|
|
1991
|
-
$this$function.
|
|
1992
|
-
$this$function.
|
|
1991
|
+
$this$function.y1h('self', Custom_init_$Create$(''));
|
|
1992
|
+
$this$function.b1i(String_instance);
|
|
1993
|
+
$this$function.c1i(new RawExpression($toStringExpr));
|
|
1993
1994
|
return Unit_instance;
|
|
1994
1995
|
};
|
|
1995
1996
|
}
|
|
@@ -1998,7 +1999,7 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
1998
1999
|
var tmp;
|
|
1999
2000
|
if (element instanceof Struct) {
|
|
2000
2001
|
// Inline function 'kotlin.collections.mapNotNull' call
|
|
2001
|
-
var tmp0 = element.
|
|
2002
|
+
var tmp0 = element.k1o_1;
|
|
2002
2003
|
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
2003
2004
|
var destination = ArrayList_init_$Create$();
|
|
2004
2005
|
// Inline function 'kotlin.collections.forEach' call
|
|
@@ -2043,7 +2044,7 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
2043
2044
|
destination.x(tmp0_safe_receiver);
|
|
2044
2045
|
}
|
|
2045
2046
|
}
|
|
2046
|
-
tmp = element.
|
|
2047
|
+
tmp = element.n1o(VOID, VOID, VOID, VOID, destination);
|
|
2047
2048
|
} else {
|
|
2048
2049
|
tmp = element;
|
|
2049
2050
|
}
|
|
@@ -2056,12 +2057,12 @@ function snakeCaseHandlerAndCallMethods$lambda(element, transformer) {
|
|
|
2056
2057
|
if (element instanceof Interface) {
|
|
2057
2058
|
var tmp$ret$0;
|
|
2058
2059
|
$l$block: {
|
|
2059
|
-
if (!element.
|
|
2060
|
+
if (!element.p1o_1.equals(Companion_getInstance().n1h('Handler')) && !element.p1o_1.equals(Companion_getInstance().n1h('Call'))) {
|
|
2060
2061
|
tmp$ret$0 = element;
|
|
2061
2062
|
break $l$block;
|
|
2062
2063
|
}
|
|
2063
2064
|
// Inline function 'kotlin.collections.map' call
|
|
2064
|
-
var this_0 = element.
|
|
2065
|
+
var this_0 = element.q1o_1;
|
|
2065
2066
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2066
2067
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2067
2068
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -2072,7 +2073,7 @@ function snakeCaseHandlerAndCallMethods$lambda(element, transformer) {
|
|
|
2072
2073
|
var tmp$ret$1 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
2073
2074
|
destination.x(tmp$ret$1);
|
|
2074
2075
|
}
|
|
2075
|
-
tmp$ret$0 = element.
|
|
2076
|
+
tmp$ret$0 = element.w1o(VOID, destination);
|
|
2076
2077
|
}
|
|
2077
2078
|
tmp = tmp$ret$0;
|
|
2078
2079
|
} else {
|
|
@@ -2087,17 +2088,17 @@ function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
|
2087
2088
|
if (!(type instanceof Custom_0)) {
|
|
2088
2089
|
tmp = type;
|
|
2089
2090
|
} else {
|
|
2090
|
-
if (!startsWith(type.h1j_1.
|
|
2091
|
+
if (!startsWith(type.h1j_1.o1h(), $endpointName + '.')) {
|
|
2091
2092
|
tmp = type;
|
|
2092
2093
|
} else {
|
|
2093
|
-
var suffix = removePrefix(type.h1j_1.
|
|
2094
|
+
var suffix = removePrefix(type.h1j_1.o1h(), $endpointName + '.');
|
|
2094
2095
|
switch (suffix) {
|
|
2095
2096
|
case 'Call':
|
|
2096
2097
|
case 'Handler':
|
|
2097
2098
|
tmp = type;
|
|
2098
2099
|
break;
|
|
2099
2100
|
default:
|
|
2100
|
-
tmp = type.
|
|
2101
|
+
tmp = type.m1n(Companion_getInstance().n1h(suffix));
|
|
2101
2102
|
break;
|
|
2102
2103
|
}
|
|
2103
2104
|
}
|
|
@@ -2118,19 +2119,19 @@ function snakeCaseClientFunctions$lambda(element, transformer) {
|
|
|
2118
2119
|
function snakeCaseClientFunctions$lambda_0(stmt, tr) {
|
|
2119
2120
|
var tmp;
|
|
2120
2121
|
if (stmt instanceof FunctionCall) {
|
|
2121
|
-
var nameStr = stmt.
|
|
2122
|
-
var newName = contains(nameStr, '.') ? stmt.
|
|
2123
|
-
var tmp1_safe_receiver = stmt.
|
|
2122
|
+
var nameStr = stmt.a1n_1.j1j();
|
|
2123
|
+
var newName = contains(nameStr, '.') ? stmt.a1n_1 : Companion_getInstance().n1h(Companion_getInstance().n1h(nameStr).w1m());
|
|
2124
|
+
var tmp1_safe_receiver = stmt.y1m_1;
|
|
2124
2125
|
var tmp_0;
|
|
2125
2126
|
if (tmp1_safe_receiver == null) {
|
|
2126
2127
|
tmp_0 = null;
|
|
2127
2128
|
} else {
|
|
2128
2129
|
// Inline function 'kotlin.let' call
|
|
2129
|
-
tmp_0 = tr.
|
|
2130
|
+
tmp_0 = tr.b1v(tmp1_safe_receiver);
|
|
2130
2131
|
}
|
|
2131
2132
|
var tmp2_receiver = tmp_0;
|
|
2132
2133
|
// Inline function 'kotlin.collections.mapValues' call
|
|
2133
|
-
var this_0 = stmt.
|
|
2134
|
+
var this_0 = stmt.b1n_1;
|
|
2134
2135
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
2135
2136
|
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.a1()));
|
|
2136
2137
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
@@ -2140,10 +2141,10 @@ function snakeCaseClientFunctions$lambda_0(stmt, tr) {
|
|
|
2140
2141
|
var tmp_1 = element.k1();
|
|
2141
2142
|
// Inline function 'kotlin.collections.component2' call
|
|
2142
2143
|
var v = element.l1();
|
|
2143
|
-
var tmp$ret$4 = tr.
|
|
2144
|
+
var tmp$ret$4 = tr.b1v(v);
|
|
2144
2145
|
destination.s2(tmp_1, tmp$ret$4);
|
|
2145
2146
|
}
|
|
2146
|
-
var tmp4_isAwait = !(stmt.
|
|
2147
|
+
var tmp4_isAwait = !(stmt.y1m_1 == null);
|
|
2147
2148
|
tmp = new FunctionCall(tmp2_receiver, VOID, newName, destination, tmp4_isAwait);
|
|
2148
2149
|
} else {
|
|
2149
2150
|
tmp = transformChildren(stmt, tr);
|
|
@@ -2156,28 +2157,28 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
2156
2157
|
var tmp_0;
|
|
2157
2158
|
var tmp_1;
|
|
2158
2159
|
if (stmt instanceof FieldCall) {
|
|
2159
|
-
tmp_1 = stmt.
|
|
2160
|
+
tmp_1 = stmt.s1q_1 == null;
|
|
2160
2161
|
} else {
|
|
2161
2162
|
tmp_1 = false;
|
|
2162
2163
|
}
|
|
2163
2164
|
if (tmp_1) {
|
|
2164
|
-
tmp_0 = $fieldNames.u1(stmt.
|
|
2165
|
+
tmp_0 = $fieldNames.u1(stmt.t1q_1.j1j());
|
|
2165
2166
|
} else {
|
|
2166
2167
|
tmp_0 = false;
|
|
2167
2168
|
}
|
|
2168
2169
|
if (tmp_0) {
|
|
2169
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().n1h('self')), stmt.
|
|
2170
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().n1h('self')), stmt.t1q_1);
|
|
2170
2171
|
} else {
|
|
2171
2172
|
if (stmt instanceof FieldCall) {
|
|
2172
|
-
var tmp0_safe_receiver = stmt.
|
|
2173
|
+
var tmp0_safe_receiver = stmt.s1q_1;
|
|
2173
2174
|
var tmp_2;
|
|
2174
2175
|
if (tmp0_safe_receiver == null) {
|
|
2175
2176
|
tmp_2 = null;
|
|
2176
2177
|
} else {
|
|
2177
2178
|
// Inline function 'kotlin.let' call
|
|
2178
|
-
tmp_2 = tr.
|
|
2179
|
+
tmp_2 = tr.b1v(tmp0_safe_receiver);
|
|
2179
2180
|
}
|
|
2180
|
-
tmp = new FieldCall(tmp_2, stmt.
|
|
2181
|
+
tmp = new FieldCall(tmp_2, stmt.t1q_1);
|
|
2181
2182
|
} else {
|
|
2182
2183
|
tmp = transformChildren(stmt, tr);
|
|
2183
2184
|
}
|
|
@@ -2188,8 +2189,8 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
2188
2189
|
function PythonRefinedTypeDefinitionEmitter() {
|
|
2189
2190
|
}
|
|
2190
2191
|
function PythonShared() {
|
|
2191
|
-
this.
|
|
2192
|
-
this.
|
|
2192
|
+
this.y1y_1 = 'shared';
|
|
2193
|
+
this.z1y_1 = "from abc import ABC, abstractmethod\nfrom dataclasses import dataclass\nfrom enum import Enum\nfrom typing import Generic, List, Dict, Optional, TypeVar\n\nT = TypeVar('T')\nREQ = TypeVar('REQ')\nRES = TypeVar('RES')\n\nclass Wirespec:\n\n class Refined(ABC, Generic[T]):\n @property\n @abstractmethod\n def value(self) -> T: pass\n\n class Endpoint(ABC):\n\n class Handler(ABC):\n pass\n\n class Convert(ABC, Generic[REQ, RES]):\n @staticmethod\n @abstractmethod\n def to_raw_request(serializer: 'Wirespec.Serializer', req: REQ) -> 'Wirespec.RawRequest': pass\n\n @staticmethod\n @abstractmethod\n def from_raw_response(serializer: 'Wirespec.Deserializer', res: 'Wirespec.RawResponse') -> RES: pass\n\n @staticmethod\n @abstractmethod\n def to_raw_response(serializer: 'Wirespec.Serializer', res: RES) -> 'Wirespec.RawResponse': pass\n\n @staticmethod\n @abstractmethod\n def from_raw_request(serializer: 'Wirespec.Deserializer[T]', req: 'Wirespec.RawRequest') -> REQ: pass\n\n class Method(Enum):\n GET = \"GET\"\n PUT = \"PUT\"\n POST = \"POST\"\n DELETE = \"DELETE\"\n OPTIONS = \"OPTIONS\"\n HEAD = \"HEAD\"\n PATCH = \"PATCH\"\n TRACE = \"TRACE\"\n\n class Request(Generic[T], ABC):\n\n class Path(ABC): pass\n\n class Queries(ABC): pass\n\n class Headers(ABC): pass\n\n @property\n @abstractmethod\n def path(self) -> Path: pass\n\n @property\n @abstractmethod\n def method(self) -> 'Wirespec.Method': pass\n\n @property\n @abstractmethod\n def queries(self) -> Queries: pass\n\n @property\n @abstractmethod\n def headers(self) -> Headers: pass\n\n @property\n @abstractmethod\n def body(self) -> T: pass\n\n class Response(Generic[T], ABC):\n\n class Headers(ABC): pass\n\n @property\n @abstractmethod\n def status(self) -> int: pass\n\n @property\n @abstractmethod\n def headers(self) -> Headers: pass\n\n @property\n @abstractmethod\n def body(self) -> T: pass\n\n class Serializer(Generic[T], ABC):\n @abstractmethod\n def serialize(self, value: T, t: type[T]) -> str: pass\n @abstractmethod\n def serialize_param(self, value: T, t: type[T]) -> List[str]: pass\n\n class Deserializer(Generic[T], ABC):\n @abstractmethod\n def deserialize(self, value: str | None, t: type[T]) -> T: pass\n @abstractmethod\n def deserialize_param(self, value: List[str] | None, t: type[T]) -> T: pass\n\n class Serialization(Serializer, Deserializer):\n @abstractmethod\n def serialize(self, value: T, t: type[T]) -> str: pass\n @abstractmethod\n def serialize_param(self, value: T, t: type[T]) -> List[str]: pass\n @abstractmethod\n def deserialize(self, value: str | None, t: type[T]) -> T: pass\n @abstractmethod\n def deserialize_param(self, value: List[str] | None, t: type[T]) -> T: pass\n\n @dataclass\n class RawRequest:\n method: str\n path: List[str]\n queries: Dict[str, List[str]]\n headers: Dict[str, List[str]]\n body: Optional[str]\n\n\n @dataclass\n class RawResponse:\n status_code: int\n headers: Dict[str, List[str]]\n body: Optional[str]\n";
|
|
2193
2194
|
}
|
|
2194
2195
|
protoOf(PythonShared).toString = function () {
|
|
2195
2196
|
return 'PythonShared';
|
|
@@ -2210,12 +2211,12 @@ function PythonShared_getInstance() {
|
|
|
2210
2211
|
}
|
|
2211
2212
|
function PythonTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
2212
2213
|
return function (it) {
|
|
2213
|
-
return this$0.
|
|
2214
|
+
return this$0.d1z(it);
|
|
2214
2215
|
};
|
|
2215
2216
|
}
|
|
2216
2217
|
function PythonTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2217
2218
|
return function (it) {
|
|
2218
|
-
return this$0.
|
|
2219
|
+
return this$0.d1z(it);
|
|
2219
2220
|
};
|
|
2220
2221
|
}
|
|
2221
2222
|
function PythonTypeDefinitionEmitter$emit$lambda_1(this$0) {
|
|
@@ -2233,22 +2234,23 @@ protoOf(PythonEmitter).lq = emit_5;
|
|
|
2233
2234
|
protoOf(PythonEmitter).mq = emit_6;
|
|
2234
2235
|
protoOf(PythonEmitter).nq = emit_7;
|
|
2235
2236
|
protoOf(PythonEmitter).oq = emit_9;
|
|
2236
|
-
protoOf(PythonEmitter).zr =
|
|
2237
|
-
protoOf(PythonEmitter).ur =
|
|
2237
|
+
protoOf(PythonEmitter).zr = emit_15;
|
|
2238
|
+
protoOf(PythonEmitter).ur = emit_14;
|
|
2238
2239
|
protoOf(PythonEmitter).as = emit_10;
|
|
2239
|
-
protoOf(PythonEmitter).pr =
|
|
2240
|
+
protoOf(PythonEmitter).pr = emit_13;
|
|
2240
2241
|
protoOf(PythonEmitter).nr = emit_3;
|
|
2241
2242
|
protoOf(PythonEmitter).or = emit_2;
|
|
2242
|
-
protoOf(PythonEmitter).
|
|
2243
|
-
protoOf(PythonEmitter).
|
|
2244
|
-
protoOf(PythonEmitter).
|
|
2243
|
+
protoOf(PythonEmitter).a1z = emit_8;
|
|
2244
|
+
protoOf(PythonEmitter).h1x = emit_11;
|
|
2245
|
+
protoOf(PythonEmitter).b1z = emit_12;
|
|
2245
2246
|
protoOf(PythonEmitter).bs = emitValidator;
|
|
2246
|
-
protoOf(PythonEmitter).
|
|
2247
|
-
protoOf(PythonEmitter).
|
|
2248
|
-
protoOf(PythonEmitter).
|
|
2249
|
-
protoOf(PythonEmitter).
|
|
2247
|
+
protoOf(PythonEmitter).u1x = sanitize;
|
|
2248
|
+
protoOf(PythonEmitter).k1x = sanitizeKeywords;
|
|
2249
|
+
protoOf(PythonEmitter).c1z = emitType;
|
|
2250
|
+
protoOf(PythonEmitter).d1z = emitReferenceCustomImports;
|
|
2251
|
+
protoOf(PythonIrEmitter).v1v = get_extensions;
|
|
2250
2252
|
protoOf(PythonIrEmitter).eo = emit_1;
|
|
2251
|
-
protoOf(PythonIrEmitter).
|
|
2253
|
+
protoOf(PythonIrEmitter).a1w = beforeGenerate;
|
|
2252
2254
|
//endregion
|
|
2253
2255
|
//region block: init
|
|
2254
2256
|
PythonShared_instance = new PythonShared();
|