@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
|
@@ -207,10 +207,10 @@ initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, V
|
|
|
207
207
|
function emit_3(identifier) {
|
|
208
208
|
var tmp;
|
|
209
209
|
if (identifier instanceof DefinitionIdentifier) {
|
|
210
|
-
tmp = this.
|
|
210
|
+
tmp = this.y1x(identifier);
|
|
211
211
|
} else {
|
|
212
212
|
if (identifier instanceof FieldIdentifier) {
|
|
213
|
-
tmp = this.
|
|
213
|
+
tmp = this.o1x(this.y1x(identifier));
|
|
214
214
|
} else {
|
|
215
215
|
noWhenBranchMatchedException();
|
|
216
216
|
}
|
|
@@ -266,14 +266,13 @@ function sanitize(_this__u8e3s4) {
|
|
|
266
266
|
return tmp;
|
|
267
267
|
}
|
|
268
268
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
269
|
-
return Companion_getInstance_0().
|
|
269
|
+
return Companion_getInstance_0().i1z_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
270
270
|
}
|
|
271
271
|
initMetadataForInterface(PythonIdentifierEmitter, 'PythonIdentifierEmitter');
|
|
272
|
-
function emit_4(
|
|
273
|
-
|
|
274
|
-
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 ');
|
|
272
|
+
function emit_4(union) {
|
|
273
|
+
return trimMargin('\n |class ' + this.nr(union.gp_1) + '(ABC):\n |' + Spacer_instance.toString() + 'pass\n ');
|
|
275
274
|
}
|
|
276
|
-
initMetadataForInterface(
|
|
275
|
+
initMetadataForInterface(PythonUnionDefinitionEmitter, 'PythonUnionDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
277
276
|
function emit_5(type, module_0) {
|
|
278
277
|
var tmp;
|
|
279
278
|
if (type.mp_1.ip_1.r()) {
|
|
@@ -297,7 +296,7 @@ function emit_7(_this__u8e3s4) {
|
|
|
297
296
|
}
|
|
298
297
|
function emit_8(_this__u8e3s4) {
|
|
299
298
|
// Inline function 'kotlin.let' call
|
|
300
|
-
var it = this.
|
|
299
|
+
var it = this.g1z(_this__u8e3s4);
|
|
301
300
|
return _this__u8e3s4.tu() ? 'Optional[' + it + ']' : it;
|
|
302
301
|
}
|
|
303
302
|
function emitType(_this__u8e3s4) {
|
|
@@ -318,7 +317,7 @@ function emitType(_this__u8e3s4) {
|
|
|
318
317
|
tmp = _this__u8e3s4.bv_1;
|
|
319
318
|
} else {
|
|
320
319
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
321
|
-
tmp = this.
|
|
320
|
+
tmp = this.e1z(_this__u8e3s4.fv_1);
|
|
322
321
|
} else {
|
|
323
322
|
noWhenBranchMatchedException();
|
|
324
323
|
}
|
|
@@ -399,7 +398,7 @@ function emitReferenceCustomImports(_this__u8e3s4) {
|
|
|
399
398
|
}
|
|
400
399
|
initMetadataForInterface(PythonTypeDefinitionEmitter, 'PythonTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
401
400
|
function emit_11(refined) {
|
|
402
|
-
return trimMargin('\n |@dataclass\n |class ' + this.
|
|
401
|
+
return trimMargin('\n |@dataclass\n |class ' + this.y1x(refined.sr_1) + '(Wirespec.Refined):\n |' + Spacer_instance.toString() + 'value: ' + this.g1z(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 ');
|
|
403
402
|
}
|
|
404
403
|
function emitValidator(_this__u8e3s4) {
|
|
405
404
|
var defaultReturn = 'True';
|
|
@@ -442,15 +441,20 @@ function emitValidator(_this__u8e3s4) {
|
|
|
442
441
|
return tmp;
|
|
443
442
|
}
|
|
444
443
|
initMetadataForInterface(PythonRefinedTypeDefinitionEmitter, 'PythonRefinedTypeDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
445
|
-
function emit_12(
|
|
444
|
+
function emit_12(enum_0, module_0) {
|
|
445
|
+
var tmp = this.y1x(enum_0.xr_1);
|
|
446
|
+
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 ');
|
|
447
|
+
}
|
|
448
|
+
initMetadataForInterface(PythonEnumDefinitionEmitter, 'PythonEnumDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
449
|
+
function emit_13(endpoint) {
|
|
446
450
|
var tmp = importReferences(endpoint);
|
|
447
451
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda(this));
|
|
448
452
|
var tmp_1 = this.nr(endpoint.up_1);
|
|
449
|
-
var tmp_2 = spacer(this.
|
|
453
|
+
var tmp_2 = spacer(this.l1x(first(endpoint.zp_1), endpoint), 1);
|
|
450
454
|
var tmp_3 = distinctByStatus(endpoint.aq_1);
|
|
451
455
|
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 ');
|
|
452
456
|
}
|
|
453
|
-
function
|
|
457
|
+
function emit_14(_this__u8e3s4, endpoint) {
|
|
454
458
|
var tmp = emit_18(this, _this__u8e3s4.dq_1);
|
|
455
459
|
var tmp_0 = get_pathParams(endpoint);
|
|
456
460
|
var tmp_1 = emitObject$default(this, tmp_0, 'Path', 'Wirespec.Request.Path', VOID, PythonEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
@@ -483,7 +487,7 @@ function emit_13(_this__u8e3s4, endpoint) {
|
|
|
483
487
|
var tmp_28 = paramList(_this__u8e3s4, endpoint);
|
|
484
488
|
return trimMargin('\n |@dataclass\n |class Request(Wirespec.Request[' + tmp + ']):\n |' + tmp_1 + '\n |' + tmp_2 + '\n |' + tmp_3 + '\n |\n |' + tmp_4 + '@property\n |' + tmp_5 + 'def body(self) -> ' + tmp_6 + ':\n |' + tmp_7 + tmp_8 + 'return self._body\n |\n |' + tmp_9 + '@property\n |' + tmp_10 + 'def path(self) -> Path:\n |' + tmp_11 + tmp_12 + 'return self._path\n |\n |' + tmp_13 + '@property\n |' + tmp_14 + 'def queries(self) -> Queries:\n |' + tmp_15 + tmp_16 + 'return self._queries\n |\n |' + tmp_17 + '@property\n |' + tmp_18 + 'def headers(self) -> Headers:\n |' + tmp_19 + tmp_20 + 'return self._headers\n |\n |' + tmp_21 + '_body: ' + tmp_22 + '\n |' + tmp_23 + '_headers: Headers\n |' + tmp_24 + '_queries: Queries\n |' + tmp_25 + '_path: Path\n |' + tmp_26 + 'method: Wirespec.Method = Wirespec.Method.' + endpoint.vp_1.a3_1 + '\n |\n |' + tmp_27 + 'def __init__(self, ' + joinToString(tmp_28, ', ', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda_4(this)) + '):\n |' + spacer(emitAssignSelf_0(this, _this__u8e3s4, endpoint), 2) + '\n |\n ');
|
|
485
489
|
}
|
|
486
|
-
function
|
|
490
|
+
function emit_15(_this__u8e3s4, endpoint) {
|
|
487
491
|
var tmp = emit_18(this, _this__u8e3s4.iq_1);
|
|
488
492
|
var tmp_0 = emitObject$default(this, _this__u8e3s4.hq_1, 'Headers', 'Wirespec.Response.Headers', VOID, PythonEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
489
493
|
var tmp_1 = Spacer_instance.toString();
|
|
@@ -504,11 +508,7 @@ function emit_14(_this__u8e3s4, endpoint) {
|
|
|
504
508
|
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 ');
|
|
505
509
|
}
|
|
506
510
|
initMetadataForInterface(PythonEndpointDefinitionEmitter, 'PythonEndpointDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter]);
|
|
507
|
-
|
|
508
|
-
return trimMargin('\n |class ' + this.nr(union.gp_1) + '(ABC):\n |' + Spacer_instance.toString() + 'pass\n ');
|
|
509
|
-
}
|
|
510
|
-
initMetadataForInterface(PythonUnionDefinitionEmitter, 'PythonUnionDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
511
|
-
initMetadataForClass(PythonEmitter, 'PythonEmitter', PythonEmitter, LanguageEmitter, [LanguageEmitter, PythonChannelDefinitionEmitter, PythonEnumDefinitionEmitter, PythonRefinedTypeDefinitionEmitter, PythonTypeDefinitionEmitter, PythonIdentifierEmitter, PythonEndpointDefinitionEmitter, PythonUnionDefinitionEmitter]);
|
|
511
|
+
initMetadataForClass(PythonEmitter, 'PythonEmitter', PythonEmitter, LanguageEmitter, [LanguageEmitter, PythonChannelDefinitionEmitter, PythonUnionDefinitionEmitter, PythonIdentifierEmitter, PythonTypeDefinitionEmitter, PythonRefinedTypeDefinitionEmitter, PythonEnumDefinitionEmitter, PythonEndpointDefinitionEmitter]);
|
|
512
512
|
initMetadataForCompanion(Companion);
|
|
513
513
|
initMetadataForCompanion(Companion_0);
|
|
514
514
|
initMetadataForClass(sam$kotlin_Comparator$0_0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
|
|
@@ -518,16 +518,16 @@ initMetadataForObject(PythonShared, 'PythonShared');
|
|
|
518
518
|
function PythonChannelDefinitionEmitter() {
|
|
519
519
|
}
|
|
520
520
|
function sam$kotlin_Comparator$0(function_0) {
|
|
521
|
-
this.
|
|
521
|
+
this.u1y_1 = function_0;
|
|
522
522
|
}
|
|
523
523
|
protoOf(sam$kotlin_Comparator$0).td = function (a, b) {
|
|
524
|
-
return this.
|
|
524
|
+
return this.u1y_1(a, b);
|
|
525
525
|
};
|
|
526
526
|
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
527
527
|
return this.td(a, b);
|
|
528
528
|
};
|
|
529
529
|
protoOf(sam$kotlin_Comparator$0).l3 = function () {
|
|
530
|
-
return this.
|
|
530
|
+
return this.u1y_1;
|
|
531
531
|
};
|
|
532
532
|
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
533
533
|
var tmp;
|
|
@@ -550,8 +550,8 @@ protoOf(sam$kotlin_Comparator$0).hashCode = function () {
|
|
|
550
550
|
function PythonEmitter$emit$lambda(this$0) {
|
|
551
551
|
return function (a, b) {
|
|
552
552
|
// Inline function 'kotlin.comparisons.compareValuesBy' call
|
|
553
|
-
var tmp = this$0.
|
|
554
|
-
var tmp$ret$1 = this$0.
|
|
553
|
+
var tmp = this$0.b1z(a);
|
|
554
|
+
var tmp$ret$1 = this$0.b1z(b);
|
|
555
555
|
return compareValues(tmp, tmp$ret$1);
|
|
556
556
|
};
|
|
557
557
|
}
|
|
@@ -562,23 +562,23 @@ function PythonEmitter(packageName, emitShared) {
|
|
|
562
562
|
packageName = packageName === VOID ? Companion_instance.cs('community.flock.wirespec.generated') : packageName;
|
|
563
563
|
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
564
564
|
LanguageEmitter.call(this);
|
|
565
|
-
this.
|
|
566
|
-
this.
|
|
567
|
-
this.
|
|
568
|
-
this.
|
|
569
|
-
this.
|
|
570
|
-
this.
|
|
565
|
+
this.v1y_1 = packageName;
|
|
566
|
+
this.w1y_1 = emitShared;
|
|
567
|
+
this.x1y_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.y1y_1 = FileExtension_Python_getInstance();
|
|
569
|
+
this.z1y_1 = PythonShared_instance;
|
|
570
|
+
this.a1z_1 = '#';
|
|
571
571
|
}
|
|
572
572
|
protoOf(PythonEmitter).uq = function () {
|
|
573
|
-
return this.
|
|
573
|
+
return this.y1y_1;
|
|
574
574
|
};
|
|
575
|
-
protoOf(PythonEmitter).
|
|
576
|
-
return this.
|
|
575
|
+
protoOf(PythonEmitter).h1x = function () {
|
|
576
|
+
return this.z1y_1;
|
|
577
577
|
};
|
|
578
578
|
protoOf(PythonEmitter).vq = function () {
|
|
579
|
-
return this.
|
|
579
|
+
return this.a1z_1;
|
|
580
580
|
};
|
|
581
|
-
protoOf(PythonEmitter).
|
|
581
|
+
protoOf(PythonEmitter).b1z = function (definition) {
|
|
582
582
|
var tmp;
|
|
583
583
|
if (definition instanceof Enum) {
|
|
584
584
|
tmp = 1;
|
|
@@ -618,8 +618,8 @@ protoOf(PythonEmitter).kr = function (module_0, logger) {
|
|
|
618
618
|
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).om_1;
|
|
619
619
|
// Inline function 'kotlin.let' call
|
|
620
620
|
var it = protoOf(LanguageEmitter).kr.call(this, module_0.mv(VOID, statements), logger);
|
|
621
|
-
var init = new Emitted(this.
|
|
622
|
-
var tmp_1 = this.
|
|
621
|
+
var init = new Emitted(this.v1y_1.fs() + '__init__', 'from . import model\nfrom . import endpoint\nfrom . import wirespec\n');
|
|
622
|
+
var tmp_1 = this.v1y_1.fs() + 'endpoint/' + '__init__';
|
|
623
623
|
// Inline function 'kotlin.collections.filter' call
|
|
624
624
|
var tmp0 = new NonEmptyList(module_0.tq_1);
|
|
625
625
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -641,7 +641,7 @@ protoOf(PythonEmitter).kr = function (module_0, logger) {
|
|
|
641
641
|
destination_0.x(tmp$ret$5);
|
|
642
642
|
}
|
|
643
643
|
var initEndpoint = new Emitted(tmp_1, joinToString(destination_0, '\n'));
|
|
644
|
-
var tmp_2 = this.
|
|
644
|
+
var tmp_2 = this.v1y_1.fs() + 'model/' + '__init__';
|
|
645
645
|
// Inline function 'kotlin.collections.filter' call
|
|
646
646
|
var tmp0_0 = new NonEmptyList(module_0.tq_1);
|
|
647
647
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -663,16 +663,16 @@ protoOf(PythonEmitter).kr = function (module_0, logger) {
|
|
|
663
663
|
destination_2.x(tmp$ret$11);
|
|
664
664
|
}
|
|
665
665
|
var initModel = new Emitted(tmp_2, joinToString(destination_2, '\n'));
|
|
666
|
-
var shared = new Emitted(this.
|
|
667
|
-
return this.
|
|
666
|
+
var shared = new Emitted(this.v1y_1.fs() + 'wirespec', this.h1x().d1z_1);
|
|
667
|
+
return this.w1y_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);
|
|
668
668
|
};
|
|
669
669
|
protoOf(PythonEmitter).lr = function (definition, module_0, logger) {
|
|
670
|
-
var subPackageName = plus_1(this.
|
|
670
|
+
var subPackageName = plus_1(this.v1y_1, definition);
|
|
671
671
|
// Inline function 'kotlin.let' call
|
|
672
672
|
var it = protoOf(LanguageEmitter).lr.call(this, definition, module_0, logger);
|
|
673
673
|
var tmp = subPackageName.fs() + it.yo_1;
|
|
674
674
|
// Inline function 'kotlin.text.trimStart' call
|
|
675
|
-
var this_0 = trimMargin('\n |' + this.
|
|
675
|
+
var this_0 = trimMargin('\n |' + this.x1y_1 + '\n |' + it.zo_1 + '\n ');
|
|
676
676
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
677
677
|
return new Emitted(tmp, tmp$ret$0);
|
|
678
678
|
};
|
|
@@ -712,7 +712,7 @@ function emitToRawRequest($this, _this__u8e3s4, endpoint) {
|
|
|
712
712
|
var tmp_19 = Spacer_instance.toString();
|
|
713
713
|
var tmp0_safe_receiver = _this__u8e3s4.dq_1;
|
|
714
714
|
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.fq_1;
|
|
715
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
715
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.g1z(tmp1_safe_receiver);
|
|
716
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 ');
|
|
717
717
|
}
|
|
718
718
|
function emitFromRawRequest($this, _this__u8e3s4, endpoint) {
|
|
@@ -729,7 +729,7 @@ function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
|
729
729
|
tmp_3 = null;
|
|
730
730
|
} else {
|
|
731
731
|
// Inline function 'kotlin.let' call
|
|
732
|
-
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.g1z(tmp0_safe_receiver.fq_1) + '),';
|
|
733
733
|
}
|
|
734
734
|
// Inline function 'kotlin.let' call
|
|
735
735
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
@@ -829,18 +829,18 @@ function emitAssignSelf_1($this, _this__u8e3s4, endpoint) {
|
|
|
829
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 ');
|
|
830
830
|
}
|
|
831
831
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
832
|
-
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.g1z(_this__u8e3s4.ue_1.cq_1) + ')';
|
|
833
833
|
}
|
|
834
834
|
function emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive) {
|
|
835
835
|
var tmp;
|
|
836
836
|
if (caseSensitive) {
|
|
837
|
-
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.g1z(_this__u8e3s4.rp_1) + ')';
|
|
838
838
|
} else {
|
|
839
839
|
var tmp_0 = Spacer_instance.hs(spaces);
|
|
840
840
|
var tmp_1 = $this.nr(_this__u8e3s4.qp_1);
|
|
841
841
|
// Inline function 'kotlin.text.lowercase' call
|
|
842
842
|
// Inline function 'kotlin.js.asDynamic' call
|
|
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.
|
|
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.g1z(_this__u8e3s4.rp_1) + ')';
|
|
844
844
|
}
|
|
845
845
|
return tmp;
|
|
846
846
|
}
|
|
@@ -878,7 +878,7 @@ function emitDeserialized_0($this, _this__u8e3s4, endpoint) {
|
|
|
878
878
|
var tmp_1 = Spacer_instance.hs(2);
|
|
879
879
|
var tmp0_safe_receiver = _this__u8e3s4.iq_1;
|
|
880
880
|
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.fq_1;
|
|
881
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
881
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.g1z(tmp1_safe_receiver);
|
|
882
882
|
var tmp_2 = tmp_1 + 'body = serialization.deserialize(response.body, ' + (tmp2_elvis_lhs == null ? 'type(None)' : tmp2_elvis_lhs) + '),';
|
|
883
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');
|
|
884
884
|
}
|
|
@@ -902,13 +902,13 @@ function emitSerialized($this, _this__u8e3s4, endpoint) {
|
|
|
902
902
|
tmp_6 = null;
|
|
903
903
|
} else {
|
|
904
904
|
// Inline function 'kotlin.let' call
|
|
905
|
-
tmp_6 = 'serialization.serialize(response.body, ' + $this.
|
|
905
|
+
tmp_6 = 'serialization.serialize(response.body, ' + $this.g1z(tmp0_safe_receiver.fq_1) + ')';
|
|
906
906
|
}
|
|
907
907
|
var tmp1_elvis_lhs = tmp_6;
|
|
908
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 ');
|
|
909
909
|
}
|
|
910
910
|
function emitSerializedParams($this, _this__u8e3s4, type, fields) {
|
|
911
|
-
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.g1z(_this__u8e3s4.rp_1) + ')';
|
|
912
912
|
}
|
|
913
913
|
function emitObject($this, _this__u8e3s4, name, extends_0, spaces, block) {
|
|
914
914
|
var tmp;
|
|
@@ -935,12 +935,12 @@ function emit_18($this, _this__u8e3s4) {
|
|
|
935
935
|
}
|
|
936
936
|
function PythonEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
937
937
|
return function (it) {
|
|
938
|
-
return this$0.
|
|
938
|
+
return this$0.h1z(it);
|
|
939
939
|
};
|
|
940
940
|
}
|
|
941
941
|
function PythonEndpointDefinitionEmitter$emit$lambda_0(this$0, $endpoint) {
|
|
942
942
|
return function (it) {
|
|
943
|
-
return this$0.
|
|
943
|
+
return this$0.f1z(it, $endpoint);
|
|
944
944
|
};
|
|
945
945
|
}
|
|
946
946
|
function PythonEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
@@ -1087,14 +1087,14 @@ function sanitizeEnum($this, _this__u8e3s4) {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
function PythonEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
1089
1089
|
return function (it) {
|
|
1090
|
-
return Spacer_instance.toString() + this$0.
|
|
1090
|
+
return Spacer_instance.toString() + this$0.o1x(sanitizeEnum(this$0, it)) + ' = "' + it + '"';
|
|
1091
1091
|
};
|
|
1092
1092
|
}
|
|
1093
1093
|
function PythonEnumDefinitionEmitter() {
|
|
1094
1094
|
}
|
|
1095
1095
|
function Companion() {
|
|
1096
1096
|
Companion_instance_2 = this;
|
|
1097
|
-
this.
|
|
1097
|
+
this.i1z_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']);
|
|
1098
1098
|
}
|
|
1099
1099
|
var Companion_instance_2;
|
|
1100
1100
|
function Companion_getInstance_0() {
|
|
@@ -1105,7 +1105,7 @@ function Companion_getInstance_0() {
|
|
|
1105
1105
|
function PythonIdentifierEmitter() {
|
|
1106
1106
|
}
|
|
1107
1107
|
function _get_sanitizationConfig__sns434($this) {
|
|
1108
|
-
var tmp0 = $this.
|
|
1108
|
+
var tmp0 = $this.n1z_1;
|
|
1109
1109
|
var tmp = KProperty1;
|
|
1110
1110
|
// Inline function 'kotlin.getValue' call
|
|
1111
1111
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, PythonIrEmitter$_get_sanitizationConfig_$ref_1q5eai(), null);
|
|
@@ -1168,7 +1168,7 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
1168
1168
|
return tmp_2;
|
|
1169
1169
|
}
|
|
1170
1170
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1171
|
-
return Companion_getInstance_1().
|
|
1171
|
+
return Companion_getInstance_1().p1z_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1172
1172
|
}
|
|
1173
1173
|
function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
1174
1174
|
// Inline function 'kotlin.let' call
|
|
@@ -1194,7 +1194,7 @@ function buildImports($this, wirespecPath) {
|
|
|
1194
1194
|
}
|
|
1195
1195
|
function Companion_0() {
|
|
1196
1196
|
Companion_instance_3 = this;
|
|
1197
|
-
this.
|
|
1197
|
+
this.p1z_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']);
|
|
1198
1198
|
}
|
|
1199
1199
|
var Companion_instance_3;
|
|
1200
1200
|
function Companion_getInstance_1() {
|
|
@@ -1203,16 +1203,16 @@ function Companion_getInstance_1() {
|
|
|
1203
1203
|
return Companion_instance_3;
|
|
1204
1204
|
}
|
|
1205
1205
|
function sam$kotlin_Comparator$0_0(function_0) {
|
|
1206
|
-
this.
|
|
1206
|
+
this.q1z_1 = function_0;
|
|
1207
1207
|
}
|
|
1208
1208
|
protoOf(sam$kotlin_Comparator$0_0).td = function (a, b) {
|
|
1209
|
-
return this.
|
|
1209
|
+
return this.q1z_1(a, b);
|
|
1210
1210
|
};
|
|
1211
1211
|
protoOf(sam$kotlin_Comparator$0_0).compare = function (a, b) {
|
|
1212
1212
|
return this.td(a, b);
|
|
1213
1213
|
};
|
|
1214
1214
|
protoOf(sam$kotlin_Comparator$0_0).l3 = function () {
|
|
1215
|
-
return this.
|
|
1215
|
+
return this.q1z_1;
|
|
1216
1216
|
};
|
|
1217
1217
|
protoOf(sam$kotlin_Comparator$0_0).equals = function (other) {
|
|
1218
1218
|
var tmp;
|
|
@@ -1236,11 +1236,11 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
1236
1236
|
return '_' + it;
|
|
1237
1237
|
}
|
|
1238
1238
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(name) {
|
|
1239
|
-
var sanitized = name.
|
|
1239
|
+
var sanitized = name.p1h_1.a1() > 1 ? name.u1m() : name.n1j();
|
|
1240
1240
|
return new Name(listOf_0(sanitized));
|
|
1241
1241
|
}
|
|
1242
1242
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(name) {
|
|
1243
|
-
return new Name(listOf_0(name.
|
|
1243
|
+
return new Name(listOf_0(name.u1m()));
|
|
1244
1244
|
}
|
|
1245
1245
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(it) {
|
|
1246
1246
|
return it;
|
|
@@ -1249,9 +1249,9 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1249
1249
|
return function (stmt, tr) {
|
|
1250
1250
|
var tmp;
|
|
1251
1251
|
if (stmt instanceof ConstructorStatement) {
|
|
1252
|
-
var tmp_0 = tr.
|
|
1252
|
+
var tmp_0 = tr.c1v(stmt.w1n_1);
|
|
1253
1253
|
// Inline function 'kotlin.collections.map' call
|
|
1254
|
-
var this_0 = stmt.
|
|
1254
|
+
var this_0 = stmt.x1n_1;
|
|
1255
1255
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1256
1256
|
var destination = ArrayList_init_$Create$_0(this_0.a1());
|
|
1257
1257
|
// Inline function 'kotlin.collections.iterator' call
|
|
@@ -1262,7 +1262,7 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1262
1262
|
var k = item.k1();
|
|
1263
1263
|
// Inline function 'kotlin.collections.component2' call
|
|
1264
1264
|
var v = item.l1();
|
|
1265
|
-
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.f1v(v));
|
|
1266
1266
|
destination.x(tmp$ret$3);
|
|
1267
1267
|
}
|
|
1268
1268
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
@@ -1274,7 +1274,7 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1274
1274
|
}
|
|
1275
1275
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1276
1276
|
return function () {
|
|
1277
|
-
var tmp = Companion_getInstance_1().
|
|
1277
|
+
var tmp = Companion_getInstance_1().p1z_1;
|
|
1278
1278
|
var tmp_0 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1279
1279
|
var tmp_1 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0;
|
|
1280
1280
|
var tmp_2 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1;
|
|
@@ -1313,17 +1313,17 @@ function PythonIrEmitter$emitGenerator$lambda_2($generatorOwnName, $generatorRef
|
|
|
1313
1313
|
var tmp_0;
|
|
1314
1314
|
var tmp_1;
|
|
1315
1315
|
if (expr instanceof RawExpression) {
|
|
1316
|
-
tmp_1 = endsWith(expr.
|
|
1316
|
+
tmp_1 = endsWith(expr.q1p_1, 'Generator');
|
|
1317
1317
|
} else {
|
|
1318
1318
|
tmp_1 = false;
|
|
1319
1319
|
}
|
|
1320
1320
|
if (tmp_1) {
|
|
1321
|
-
tmp_0 = !(expr.
|
|
1321
|
+
tmp_0 = !(expr.q1p_1 === $generatorOwnName);
|
|
1322
1322
|
} else {
|
|
1323
1323
|
tmp_0 = false;
|
|
1324
1324
|
}
|
|
1325
1325
|
if (tmp_0) {
|
|
1326
|
-
$generatorRefs.x(expr.
|
|
1326
|
+
$generatorRefs.x(expr.q1p_1);
|
|
1327
1327
|
tmp = Unit_instance;
|
|
1328
1328
|
}
|
|
1329
1329
|
return transformChildren_0(expr, t);
|
|
@@ -1338,31 +1338,31 @@ function PythonIrEmitter(packageName, emitShared) {
|
|
|
1338
1338
|
Companion_getInstance_1();
|
|
1339
1339
|
packageName = packageName === VOID ? Companion_instance.cs('community.flock.wirespec.generated') : packageName;
|
|
1340
1340
|
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
1341
|
-
this.
|
|
1342
|
-
this.
|
|
1343
|
-
this.
|
|
1344
|
-
this.
|
|
1341
|
+
this.j1z_1 = packageName;
|
|
1342
|
+
this.k1z_1 = emitShared;
|
|
1343
|
+
this.l1z_1 = PythonGenerator_instance;
|
|
1344
|
+
this.m1z_1 = FileExtension_Python_getInstance();
|
|
1345
1345
|
var tmp = this;
|
|
1346
|
-
tmp.
|
|
1347
|
-
this.
|
|
1346
|
+
tmp.n1z_1 = lazy(PythonIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1347
|
+
this.o1z_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";
|
|
1348
1348
|
}
|
|
1349
|
-
protoOf(PythonIrEmitter).
|
|
1350
|
-
return this.
|
|
1349
|
+
protoOf(PythonIrEmitter).x1v = function () {
|
|
1350
|
+
return this.l1z_1;
|
|
1351
1351
|
};
|
|
1352
1352
|
protoOf(PythonIrEmitter).uq = function () {
|
|
1353
|
-
return this.
|
|
1353
|
+
return this.m1z_1;
|
|
1354
1354
|
};
|
|
1355
|
-
protoOf(PythonIrEmitter).
|
|
1355
|
+
protoOf(PythonIrEmitter).b1w = function () {
|
|
1356
1356
|
var source = replaceReflectInNonGenericStructFields(convert(Companion_instance.cs('shared')));
|
|
1357
1357
|
var tmp;
|
|
1358
|
-
if (this.
|
|
1359
|
-
tmp = new File(Companion_getInstance().
|
|
1358
|
+
if (this.k1z_1.xo_1) {
|
|
1359
|
+
tmp = new File(Companion_getInstance().r1h(this.j1z_1.fs() + 'wirespec'), listOf_0(raw(this.o1z_1 + PythonGenerator_instance.y1v(source))));
|
|
1360
1360
|
} else {
|
|
1361
1361
|
tmp = null;
|
|
1362
1362
|
}
|
|
1363
1363
|
return tmp;
|
|
1364
1364
|
};
|
|
1365
|
-
protoOf(PythonIrEmitter).
|
|
1365
|
+
protoOf(PythonIrEmitter).a1w = function (module_0, logger) {
|
|
1366
1366
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
1367
1367
|
var this_0 = new NonEmptyList(module_0.tq_1);
|
|
1368
1368
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
@@ -1397,7 +1397,7 @@ protoOf(PythonIrEmitter).w1v = function (module_0, logger) {
|
|
|
1397
1397
|
tmp$ret$2 = false;
|
|
1398
1398
|
}
|
|
1399
1399
|
var hasEndpoints = tmp$ret$2;
|
|
1400
|
-
var tmp_2 = Companion_getInstance().
|
|
1400
|
+
var tmp_2 = Companion_getInstance().r1h(this.j1z_1.fs() + '__init__');
|
|
1401
1401
|
// Inline function 'kotlin.collections.buildList' call
|
|
1402
1402
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1403
1403
|
// Inline function 'kotlin.apply' call
|
|
@@ -1410,7 +1410,7 @@ protoOf(PythonIrEmitter).w1v = function (module_0, logger) {
|
|
|
1410
1410
|
this_1.x(import_0('.', 'wirespec'));
|
|
1411
1411
|
var tmp$ret$7 = this_1.o5();
|
|
1412
1412
|
var init = new File(tmp_2, tmp$ret$7);
|
|
1413
|
-
var tmp_3 = Companion_getInstance().
|
|
1413
|
+
var tmp_3 = Companion_getInstance().r1h(this.j1z_1.fs() + 'endpoint/' + '__init__');
|
|
1414
1414
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1415
1415
|
var tmp0_0 = new NonEmptyList(module_0.tq_1);
|
|
1416
1416
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
@@ -1432,7 +1432,7 @@ protoOf(PythonIrEmitter).w1v = function (module_0, logger) {
|
|
|
1432
1432
|
destination_0.x(tmp$ret$10);
|
|
1433
1433
|
}
|
|
1434
1434
|
var initEndpoint = new File(tmp_3, destination_0);
|
|
1435
|
-
var tmp_4 = Companion_getInstance().
|
|
1435
|
+
var tmp_4 = Companion_getInstance().r1h(this.j1z_1.fs() + 'model/' + '__init__');
|
|
1436
1436
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1437
1437
|
var tmp0_1 = new NonEmptyList(module_0.tq_1);
|
|
1438
1438
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
@@ -1454,8 +1454,8 @@ protoOf(PythonIrEmitter).w1v = function (module_0, logger) {
|
|
|
1454
1454
|
destination_2.x(tmp$ret$15);
|
|
1455
1455
|
}
|
|
1456
1456
|
var initModel = new File(tmp_4, destination_2);
|
|
1457
|
-
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().
|
|
1458
|
-
var tmp0_2 = dropLast(split(this.
|
|
1457
|
+
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().r1h(this.j1z_1.fs() + 'client/' + '__init__'), emptyList())) : emptyList();
|
|
1458
|
+
var tmp0_2 = dropLast(split(this.j1z_1.ds_1, ['.']), 1);
|
|
1459
1459
|
var tmp$ret$18;
|
|
1460
1460
|
$l$block_1: {
|
|
1461
1461
|
// Inline function 'kotlin.collections.runningFold' call
|
|
@@ -1492,17 +1492,17 @@ protoOf(PythonIrEmitter).w1v = function (module_0, logger) {
|
|
|
1492
1492
|
var _iterator__ex2g4s_5 = this_3.t();
|
|
1493
1493
|
while (_iterator__ex2g4s_5.u()) {
|
|
1494
1494
|
var item_1 = _iterator__ex2g4s_5.v();
|
|
1495
|
-
var tmp$ret$23 = new File(Companion_getInstance().
|
|
1495
|
+
var tmp$ret$23 = new File(Companion_getInstance().r1h(item_1 + '/__init__'), emptyList());
|
|
1496
1496
|
destination_3.x(tmp$ret$23);
|
|
1497
1497
|
}
|
|
1498
1498
|
var parentInits = destination_3;
|
|
1499
|
-
return this.
|
|
1499
|
+
return this.k1z_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);
|
|
1500
1500
|
};
|
|
1501
1501
|
protoOf(PythonIrEmitter).lr = function (definition, module_0, logger) {
|
|
1502
1502
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1503
|
-
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.
|
|
1503
|
+
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.j1z_1, definition);
|
|
1504
1504
|
};
|
|
1505
|
-
protoOf(PythonIrEmitter).
|
|
1505
|
+
protoOf(PythonIrEmitter).g1w = function (definition, module_0) {
|
|
1506
1506
|
var tmp;
|
|
1507
1507
|
if (definition instanceof Type) {
|
|
1508
1508
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1532,8 +1532,8 @@ protoOf(PythonIrEmitter).c1w = function (definition, module_0) {
|
|
|
1532
1532
|
var generatorRefs = LinkedHashSet_init_$Create$();
|
|
1533
1533
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1534
1534
|
var scope = new TransformScope(sanitized);
|
|
1535
|
-
scope.
|
|
1536
|
-
var tmp_3 = scope.
|
|
1535
|
+
scope.s1v(PythonIrEmitter$emitGenerator$lambda_2(generatorOwnName, generatorRefs));
|
|
1536
|
+
var tmp_3 = scope.k1v_1;
|
|
1537
1537
|
isInterface(tmp_3, Element) || THROW_CCE();
|
|
1538
1538
|
// Inline function 'kotlin.collections.filter' call
|
|
1539
1539
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -1576,7 +1576,7 @@ protoOf(PythonIrEmitter).c1w = function (definition, module_0) {
|
|
|
1576
1576
|
destination_2.x(tmp$ret$12);
|
|
1577
1577
|
}
|
|
1578
1578
|
var modelImports = destination_2;
|
|
1579
|
-
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.j1z_1, 'generator');
|
|
1580
1580
|
};
|
|
1581
1581
|
protoOf(PythonIrEmitter).kq = function (type, module_0) {
|
|
1582
1582
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
@@ -1659,13 +1659,13 @@ protoOf(PythonIrEmitter).as = function (endpoint) {
|
|
|
1659
1659
|
var endpointImports = destination;
|
|
1660
1660
|
// Inline function 'kotlin.let' call
|
|
1661
1661
|
var it = splitEndpointStructsToModuleLevel(convert_3(endpoint));
|
|
1662
|
-
var tmp$ret$6 = it.
|
|
1662
|
+
var tmp$ret$6 = it.d1o(VOID, plus(endpointImports, it.a1o_1));
|
|
1663
1663
|
return sanitizeNames(snakeCaseHandlerAndCallMethods(tmp$ret$6), _get_sanitizationConfig__sns434(this));
|
|
1664
1664
|
};
|
|
1665
1665
|
protoOf(PythonIrEmitter).or = function (channel) {
|
|
1666
1666
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1667
1667
|
};
|
|
1668
|
-
protoOf(PythonIrEmitter).
|
|
1668
|
+
protoOf(PythonIrEmitter).f1w = function (endpoint) {
|
|
1669
1669
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1670
1670
|
var this_0 = importReferences(endpoint);
|
|
1671
1671
|
var set = HashSet_init_$Create$();
|
|
@@ -1691,10 +1691,10 @@ protoOf(PythonIrEmitter).b1w = function (endpoint) {
|
|
|
1691
1691
|
var endpointImport = import_0('..endpoint.' + endpoint.up_1.l1(), '*');
|
|
1692
1692
|
var endpointName = endpoint.up_1.l1();
|
|
1693
1693
|
var file = flattenEndpointTypeRefs(snakeCaseClientFunctions(addSelfReceiverToClientFields(sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this)))), endpointName);
|
|
1694
|
-
var subPackageName = plus_2(this.
|
|
1695
|
-
return new File(Companion_getInstance().
|
|
1694
|
+
var subPackageName = plus_2(this.j1z_1, 'client');
|
|
1695
|
+
return new File(Companion_getInstance().r1h(subPackageName.fs() + file.z1n_1.s1h()), plus(plus(plus(buildImports(this, '..wirespec'), modelImports), listOf_0(endpointImport)), file.a1o_1));
|
|
1696
1696
|
};
|
|
1697
|
-
protoOf(PythonIrEmitter).
|
|
1697
|
+
protoOf(PythonIrEmitter).c1w = function (endpoints, logger) {
|
|
1698
1698
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1699
1699
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1700
1700
|
var destination = ArrayList_init_$Create$();
|
|
@@ -1766,7 +1766,7 @@ protoOf(PythonIrEmitter).y1v = function (endpoints, logger) {
|
|
|
1766
1766
|
accumulator = flattenEndpointTypeRefs(acc, element_0);
|
|
1767
1767
|
}
|
|
1768
1768
|
var file = accumulator;
|
|
1769
|
-
return new File(Companion_getInstance().
|
|
1769
|
+
return new File(Companion_getInstance().r1h(this.j1z_1.fs() + file.z1n_1.s1h()), plus(plus(buildImports(this, '.wirespec'), allImports), file.a1o_1));
|
|
1770
1770
|
};
|
|
1771
1771
|
function replaceReflectInNonGenericStructFields(_this__u8e3s4) {
|
|
1772
1772
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -1774,14 +1774,14 @@ function replaceReflectInNonGenericStructFields(_this__u8e3s4) {
|
|
|
1774
1774
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1775
1775
|
var tmp = scope;
|
|
1776
1776
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1777
|
-
var this_0 = scope.
|
|
1777
|
+
var this_0 = scope.k1v_1;
|
|
1778
1778
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1779
1779
|
// Inline function 'kotlin.apply' call
|
|
1780
1780
|
var this_1 = new TransformerBuilder();
|
|
1781
|
-
this_1.
|
|
1782
|
-
var tmp$ret$2 = this_1.
|
|
1783
|
-
tmp.
|
|
1784
|
-
var tmp_0 = scope.
|
|
1781
|
+
this_1.b1j(replaceReflectInNonGenericStructFields$lambda);
|
|
1782
|
+
var tmp$ret$2 = this_1.c1j();
|
|
1783
|
+
tmp.k1v_1 = transform(this_0, tmp$ret$2);
|
|
1784
|
+
var tmp_0 = scope.k1v_1;
|
|
1785
1785
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1786
1786
|
}
|
|
1787
1787
|
function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
@@ -1790,14 +1790,14 @@ function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
|
1790
1790
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1791
1791
|
var tmp = scope;
|
|
1792
1792
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1793
|
-
var this_0 = scope.
|
|
1793
|
+
var this_0 = scope.k1v_1;
|
|
1794
1794
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1795
1795
|
// Inline function 'kotlin.apply' call
|
|
1796
1796
|
var this_1 = new TransformerBuilder();
|
|
1797
|
-
this_1.
|
|
1798
|
-
var tmp$ret$2 = this_1.
|
|
1799
|
-
tmp.
|
|
1800
|
-
var tmp_0 = scope.
|
|
1797
|
+
this_1.b1j(replaceRefinedFunctions$lambda(refined));
|
|
1798
|
+
var tmp$ret$2 = this_1.c1j();
|
|
1799
|
+
tmp.k1v_1 = transform(this_0, tmp$ret$2);
|
|
1800
|
+
var tmp_0 = scope.k1v_1;
|
|
1801
1801
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1802
1802
|
}
|
|
1803
1803
|
function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
@@ -1806,20 +1806,20 @@ function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
|
1806
1806
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1807
1807
|
var tmp = scope;
|
|
1808
1808
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1809
|
-
var this_0 = scope.
|
|
1809
|
+
var this_0 = scope.k1v_1;
|
|
1810
1810
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1811
1811
|
// Inline function 'kotlin.apply' call
|
|
1812
1812
|
var this_1 = new TransformerBuilder();
|
|
1813
|
-
this_1.
|
|
1814
|
-
var tmp$ret$2 = this_1.
|
|
1815
|
-
tmp.
|
|
1816
|
-
var tmp_0 = scope.
|
|
1813
|
+
this_1.b1j(snakeCaseHandlerAndCallMethods$lambda);
|
|
1814
|
+
var tmp$ret$2 = this_1.c1j();
|
|
1815
|
+
tmp.k1v_1 = transform(this_0, tmp$ret$2);
|
|
1816
|
+
var tmp_0 = scope.k1v_1;
|
|
1817
1817
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1818
1818
|
}
|
|
1819
1819
|
function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
1820
1820
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1821
1821
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1822
|
-
var tmp0 = _this__u8e3s4.
|
|
1822
|
+
var tmp0 = _this__u8e3s4.b1o();
|
|
1823
1823
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1824
1824
|
var destination = ArrayList_init_$Create$();
|
|
1825
1825
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1832,7 +1832,7 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1832
1832
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1833
1833
|
var namespace = ensureNotNull(tmp$ret$2);
|
|
1834
1834
|
// Inline function 'kotlin.collections.partition' call
|
|
1835
|
-
var this_0 = namespace.
|
|
1835
|
+
var this_0 = namespace.g1o_1;
|
|
1836
1836
|
var first = ArrayList_init_$Create$();
|
|
1837
1837
|
var second = ArrayList_init_$Create$();
|
|
1838
1838
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
@@ -1853,14 +1853,14 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1853
1853
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1854
1854
|
var moduleElements = _destruct__k2r9zo.ve();
|
|
1855
1855
|
var classElements = _destruct__k2r9zo.we();
|
|
1856
|
-
var endpointClass = new Namespace(namespace.
|
|
1857
|
-
return new File(namespace.
|
|
1856
|
+
var endpointClass = new Namespace(namespace.f1o_1, classElements, namespace.h1o_1);
|
|
1857
|
+
return new File(namespace.f1o_1, plus_0(moduleElements, endpointClass));
|
|
1858
1858
|
}
|
|
1859
1859
|
function flattenEndpointTypeRefs(_this__u8e3s4, endpointName) {
|
|
1860
1860
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1861
1861
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1862
|
-
scope.
|
|
1863
|
-
var tmp = scope.
|
|
1862
|
+
scope.q1v(flattenEndpointTypeRefs$lambda(endpointName));
|
|
1863
|
+
var tmp = scope.k1v_1;
|
|
1864
1864
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1865
1865
|
}
|
|
1866
1866
|
function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
@@ -1869,15 +1869,15 @@ function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
|
1869
1869
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1870
1870
|
var tmp = scope;
|
|
1871
1871
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1872
|
-
var this_0 = scope.
|
|
1872
|
+
var this_0 = scope.k1v_1;
|
|
1873
1873
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1874
1874
|
// Inline function 'kotlin.apply' call
|
|
1875
1875
|
var this_1 = new TransformerBuilder();
|
|
1876
|
-
this_1.
|
|
1877
|
-
var tmp$ret$2 = this_1.
|
|
1878
|
-
tmp.
|
|
1879
|
-
scope.
|
|
1880
|
-
var tmp_0 = scope.
|
|
1876
|
+
this_1.b1j(snakeCaseClientFunctions$lambda);
|
|
1877
|
+
var tmp$ret$2 = this_1.c1j();
|
|
1878
|
+
tmp.k1v_1 = transform(this_0, tmp$ret$2);
|
|
1879
|
+
scope.t1v(snakeCaseClientFunctions$lambda_0);
|
|
1880
|
+
var tmp_0 = scope.k1v_1;
|
|
1881
1881
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1882
1882
|
}
|
|
1883
1883
|
function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
@@ -1888,7 +1888,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1888
1888
|
} else {
|
|
1889
1889
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1890
1890
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1891
|
-
var tmp0 = tmp0_safe_receiver.
|
|
1891
|
+
var tmp0 = tmp0_safe_receiver.b1o();
|
|
1892
1892
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1893
1893
|
var destination = ArrayList_init_$Create$();
|
|
1894
1894
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1901,7 +1901,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1901
1901
|
tmp = firstOrNull_0(destination);
|
|
1902
1902
|
}
|
|
1903
1903
|
var struct = tmp;
|
|
1904
|
-
var tmp2_safe_receiver = struct == null ? null : struct.
|
|
1904
|
+
var tmp2_safe_receiver = struct == null ? null : struct.l1o_1;
|
|
1905
1905
|
var tmp_0;
|
|
1906
1906
|
if (tmp2_safe_receiver == null) {
|
|
1907
1907
|
tmp_0 = null;
|
|
@@ -1912,7 +1912,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1912
1912
|
var _iterator__ex2g4s_0 = tmp2_safe_receiver.t();
|
|
1913
1913
|
while (_iterator__ex2g4s_0.u()) {
|
|
1914
1914
|
var item = _iterator__ex2g4s_0.v();
|
|
1915
|
-
var tmp$ret$3 = item.
|
|
1915
|
+
var tmp$ret$3 = item.g1q_1.n1j();
|
|
1916
1916
|
destination_0.x(tmp$ret$3);
|
|
1917
1917
|
}
|
|
1918
1918
|
tmp_0 = destination_0;
|
|
@@ -1924,8 +1924,8 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1924
1924
|
return _this__u8e3s4;
|
|
1925
1925
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1926
1926
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1927
|
-
scope.
|
|
1928
|
-
var tmp_1 = scope.
|
|
1927
|
+
scope.t1v(addSelfReceiverToClientFields$lambda(fieldNames));
|
|
1928
|
+
var tmp_1 = scope.k1v_1;
|
|
1929
1929
|
return isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1930
1930
|
}
|
|
1931
1931
|
function replaceReflectAsTypeAny(_this__u8e3s4) {
|
|
@@ -1934,13 +1934,13 @@ function replaceReflectAsTypeAny(_this__u8e3s4) {
|
|
|
1934
1934
|
tmp = Custom_init_$Create$('type', listOf_0(Any_instance));
|
|
1935
1935
|
} else {
|
|
1936
1936
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
1937
|
-
tmp = _this__u8e3s4.
|
|
1937
|
+
tmp = _this__u8e3s4.l1n(replaceReflectAsTypeAny(_this__u8e3s4.j1j_1));
|
|
1938
1938
|
} else {
|
|
1939
1939
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
1940
|
-
tmp = _this__u8e3s4.
|
|
1940
|
+
tmp = _this__u8e3s4.l1n(replaceReflectAsTypeAny(_this__u8e3s4.k1j_1));
|
|
1941
1941
|
} else {
|
|
1942
1942
|
if (_this__u8e3s4 instanceof Dict_0) {
|
|
1943
|
-
tmp = _this__u8e3s4.
|
|
1943
|
+
tmp = _this__u8e3s4.o1n(replaceReflectAsTypeAny(_this__u8e3s4.m1n_1), replaceReflectAsTypeAny(_this__u8e3s4.n1n_1));
|
|
1944
1944
|
} else {
|
|
1945
1945
|
tmp = _this__u8e3s4;
|
|
1946
1946
|
}
|
|
@@ -1955,21 +1955,21 @@ function replaceReflectInNonGenericStructFields$lambda(element, transformer) {
|
|
|
1955
1955
|
var tmp$ret$1;
|
|
1956
1956
|
$l$block: {
|
|
1957
1957
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1958
|
-
if (!element.
|
|
1958
|
+
if (!element.p1o_1.r()) {
|
|
1959
1959
|
tmp$ret$1 = element;
|
|
1960
1960
|
break $l$block;
|
|
1961
1961
|
}
|
|
1962
1962
|
// Inline function 'kotlin.collections.map' call
|
|
1963
|
-
var this_0 = element.
|
|
1963
|
+
var this_0 = element.l1o_1;
|
|
1964
1964
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1965
1965
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1966
1966
|
var _iterator__ex2g4s = this_0.t();
|
|
1967
1967
|
while (_iterator__ex2g4s.u()) {
|
|
1968
1968
|
var item = _iterator__ex2g4s.v();
|
|
1969
|
-
var tmp$ret$2 = item.
|
|
1969
|
+
var tmp$ret$2 = item.k1q(VOID, replaceReflectAsTypeAny(item.h1q_1));
|
|
1970
1970
|
destination.x(tmp$ret$2);
|
|
1971
1971
|
}
|
|
1972
|
-
tmp$ret$1 = element.
|
|
1972
|
+
tmp$ret$1 = element.r1o(VOID, destination);
|
|
1973
1973
|
}
|
|
1974
1974
|
tmp = tmp$ret$1;
|
|
1975
1975
|
} else {
|
|
@@ -1980,17 +1980,17 @@ function replaceReflectInNonGenericStructFields$lambda(element, transformer) {
|
|
|
1980
1980
|
}
|
|
1981
1981
|
function replaceRefinedFunctions$lambda$lambda($constraintExpr) {
|
|
1982
1982
|
return function ($this$function) {
|
|
1983
|
-
$this$function.
|
|
1984
|
-
$this$function.
|
|
1985
|
-
$this$function.
|
|
1983
|
+
$this$function.c1i('self', Custom_init_$Create$(''));
|
|
1984
|
+
$this$function.f1i(Boolean_instance_0);
|
|
1985
|
+
$this$function.g1i($constraintExpr);
|
|
1986
1986
|
return Unit_instance;
|
|
1987
1987
|
};
|
|
1988
1988
|
}
|
|
1989
1989
|
function replaceRefinedFunctions$lambda$lambda_0($toStringExpr) {
|
|
1990
1990
|
return function ($this$function) {
|
|
1991
|
-
$this$function.
|
|
1992
|
-
$this$function.
|
|
1993
|
-
$this$function.
|
|
1991
|
+
$this$function.c1i('self', Custom_init_$Create$(''));
|
|
1992
|
+
$this$function.f1i(String_instance);
|
|
1993
|
+
$this$function.g1i(new RawExpression($toStringExpr));
|
|
1994
1994
|
return Unit_instance;
|
|
1995
1995
|
};
|
|
1996
1996
|
}
|
|
@@ -1999,7 +1999,7 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
1999
1999
|
var tmp;
|
|
2000
2000
|
if (element instanceof Struct) {
|
|
2001
2001
|
// Inline function 'kotlin.collections.mapNotNull' call
|
|
2002
|
-
var tmp0 = element.
|
|
2002
|
+
var tmp0 = element.o1o_1;
|
|
2003
2003
|
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
2004
2004
|
var destination = ArrayList_init_$Create$();
|
|
2005
2005
|
// Inline function 'kotlin.collections.forEach' call
|
|
@@ -2009,17 +2009,17 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
2009
2009
|
var tmp_0;
|
|
2010
2010
|
var tmp_1;
|
|
2011
2011
|
if (element_0 instanceof Function) {
|
|
2012
|
-
tmp_1 = element_0.
|
|
2012
|
+
tmp_1 = element_0.h1l_1.equals(Companion_getInstance().r1h('validate'));
|
|
2013
2013
|
} else {
|
|
2014
2014
|
tmp_1 = false;
|
|
2015
2015
|
}
|
|
2016
2016
|
if (tmp_1) {
|
|
2017
|
-
var constraintExpr = convertConstraint($refined.tr_1, new FieldCall(new VariableReference(Companion_getInstance().
|
|
2017
|
+
var constraintExpr = convertConstraint($refined.tr_1, new FieldCall(new VariableReference(Companion_getInstance().r1h('self')), Companion_getInstance().r1h('value')));
|
|
2018
2018
|
tmp_0 = function_0('validate', VOID, VOID, replaceRefinedFunctions$lambda$lambda(constraintExpr));
|
|
2019
2019
|
} else {
|
|
2020
2020
|
var tmp_2;
|
|
2021
2021
|
if (element_0 instanceof Function) {
|
|
2022
|
-
tmp_2 = element_0.
|
|
2022
|
+
tmp_2 = element_0.h1l_1.equals(Companion_getInstance().r1h('toString'));
|
|
2023
2023
|
} else {
|
|
2024
2024
|
tmp_2 = false;
|
|
2025
2025
|
}
|
|
@@ -2044,7 +2044,7 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
2044
2044
|
destination.x(tmp0_safe_receiver);
|
|
2045
2045
|
}
|
|
2046
2046
|
}
|
|
2047
|
-
tmp = element.
|
|
2047
|
+
tmp = element.r1o(VOID, VOID, VOID, VOID, destination);
|
|
2048
2048
|
} else {
|
|
2049
2049
|
tmp = element;
|
|
2050
2050
|
}
|
|
@@ -2057,23 +2057,23 @@ function snakeCaseHandlerAndCallMethods$lambda(element, transformer) {
|
|
|
2057
2057
|
if (element instanceof Interface) {
|
|
2058
2058
|
var tmp$ret$0;
|
|
2059
2059
|
$l$block: {
|
|
2060
|
-
if (!element.
|
|
2060
|
+
if (!element.t1o_1.equals(Companion_getInstance().r1h('Handler')) && !element.t1o_1.equals(Companion_getInstance().r1h('Call'))) {
|
|
2061
2061
|
tmp$ret$0 = element;
|
|
2062
2062
|
break $l$block;
|
|
2063
2063
|
}
|
|
2064
2064
|
// Inline function 'kotlin.collections.map' call
|
|
2065
|
-
var this_0 = element.
|
|
2065
|
+
var this_0 = element.u1o_1;
|
|
2066
2066
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2067
2067
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2068
2068
|
var _iterator__ex2g4s = this_0.t();
|
|
2069
2069
|
while (_iterator__ex2g4s.u()) {
|
|
2070
2070
|
var item = _iterator__ex2g4s.v();
|
|
2071
2071
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
2072
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
2072
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.p1l(Companion_getInstance().r1h(item.h1l_1.a1n()));
|
|
2073
2073
|
var tmp$ret$1 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
2074
2074
|
destination.x(tmp$ret$1);
|
|
2075
2075
|
}
|
|
2076
|
-
tmp$ret$0 = element.
|
|
2076
|
+
tmp$ret$0 = element.a1p(VOID, destination);
|
|
2077
2077
|
}
|
|
2078
2078
|
tmp = tmp$ret$0;
|
|
2079
2079
|
} else {
|
|
@@ -2088,17 +2088,17 @@ function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
|
2088
2088
|
if (!(type instanceof Custom_0)) {
|
|
2089
2089
|
tmp = type;
|
|
2090
2090
|
} else {
|
|
2091
|
-
if (!startsWith(type.
|
|
2091
|
+
if (!startsWith(type.l1j_1.s1h(), $endpointName + '.')) {
|
|
2092
2092
|
tmp = type;
|
|
2093
2093
|
} else {
|
|
2094
|
-
var suffix = removePrefix(type.
|
|
2094
|
+
var suffix = removePrefix(type.l1j_1.s1h(), $endpointName + '.');
|
|
2095
2095
|
switch (suffix) {
|
|
2096
2096
|
case 'Call':
|
|
2097
2097
|
case 'Handler':
|
|
2098
2098
|
tmp = type;
|
|
2099
2099
|
break;
|
|
2100
2100
|
default:
|
|
2101
|
-
tmp = type.
|
|
2101
|
+
tmp = type.q1n(Companion_getInstance().r1h(suffix));
|
|
2102
2102
|
break;
|
|
2103
2103
|
}
|
|
2104
2104
|
}
|
|
@@ -2109,7 +2109,7 @@ function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
|
2109
2109
|
function snakeCaseClientFunctions$lambda(element, transformer) {
|
|
2110
2110
|
var tmp;
|
|
2111
2111
|
if (element instanceof Function) {
|
|
2112
|
-
tmp = element.
|
|
2112
|
+
tmp = element.p1l(Companion_getInstance().r1h(element.h1l_1.a1n()), VOID, plus(listOf_0(new Parameter(Companion_getInstance().r1h('self'), Custom_init_$Create$(''))), element.j1l_1));
|
|
2113
2113
|
} else {
|
|
2114
2114
|
tmp = element;
|
|
2115
2115
|
}
|
|
@@ -2119,19 +2119,19 @@ function snakeCaseClientFunctions$lambda(element, transformer) {
|
|
|
2119
2119
|
function snakeCaseClientFunctions$lambda_0(stmt, tr) {
|
|
2120
2120
|
var tmp;
|
|
2121
2121
|
if (stmt instanceof FunctionCall) {
|
|
2122
|
-
var nameStr = stmt.
|
|
2123
|
-
var newName = contains(nameStr, '.') ? stmt.
|
|
2124
|
-
var tmp1_safe_receiver = stmt.
|
|
2122
|
+
var nameStr = stmt.e1n_1.n1j();
|
|
2123
|
+
var newName = contains(nameStr, '.') ? stmt.e1n_1 : Companion_getInstance().r1h(Companion_getInstance().r1h(nameStr).a1n());
|
|
2124
|
+
var tmp1_safe_receiver = stmt.c1n_1;
|
|
2125
2125
|
var tmp_0;
|
|
2126
2126
|
if (tmp1_safe_receiver == null) {
|
|
2127
2127
|
tmp_0 = null;
|
|
2128
2128
|
} else {
|
|
2129
2129
|
// Inline function 'kotlin.let' call
|
|
2130
|
-
tmp_0 = tr.
|
|
2130
|
+
tmp_0 = tr.f1v(tmp1_safe_receiver);
|
|
2131
2131
|
}
|
|
2132
2132
|
var tmp2_receiver = tmp_0;
|
|
2133
2133
|
// Inline function 'kotlin.collections.mapValues' call
|
|
2134
|
-
var this_0 = stmt.
|
|
2134
|
+
var this_0 = stmt.f1n_1;
|
|
2135
2135
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
2136
2136
|
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.a1()));
|
|
2137
2137
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
@@ -2141,10 +2141,10 @@ function snakeCaseClientFunctions$lambda_0(stmt, tr) {
|
|
|
2141
2141
|
var tmp_1 = element.k1();
|
|
2142
2142
|
// Inline function 'kotlin.collections.component2' call
|
|
2143
2143
|
var v = element.l1();
|
|
2144
|
-
var tmp$ret$4 = tr.
|
|
2144
|
+
var tmp$ret$4 = tr.f1v(v);
|
|
2145
2145
|
destination.s2(tmp_1, tmp$ret$4);
|
|
2146
2146
|
}
|
|
2147
|
-
var tmp4_isAwait = !(stmt.
|
|
2147
|
+
var tmp4_isAwait = !(stmt.c1n_1 == null);
|
|
2148
2148
|
tmp = new FunctionCall(tmp2_receiver, VOID, newName, destination, tmp4_isAwait);
|
|
2149
2149
|
} else {
|
|
2150
2150
|
tmp = transformChildren(stmt, tr);
|
|
@@ -2157,28 +2157,28 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
2157
2157
|
var tmp_0;
|
|
2158
2158
|
var tmp_1;
|
|
2159
2159
|
if (stmt instanceof FieldCall) {
|
|
2160
|
-
tmp_1 = stmt.
|
|
2160
|
+
tmp_1 = stmt.w1q_1 == null;
|
|
2161
2161
|
} else {
|
|
2162
2162
|
tmp_1 = false;
|
|
2163
2163
|
}
|
|
2164
2164
|
if (tmp_1) {
|
|
2165
|
-
tmp_0 = $fieldNames.u1(stmt.
|
|
2165
|
+
tmp_0 = $fieldNames.u1(stmt.x1q_1.n1j());
|
|
2166
2166
|
} else {
|
|
2167
2167
|
tmp_0 = false;
|
|
2168
2168
|
}
|
|
2169
2169
|
if (tmp_0) {
|
|
2170
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().
|
|
2170
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().r1h('self')), stmt.x1q_1);
|
|
2171
2171
|
} else {
|
|
2172
2172
|
if (stmt instanceof FieldCall) {
|
|
2173
|
-
var tmp0_safe_receiver = stmt.
|
|
2173
|
+
var tmp0_safe_receiver = stmt.w1q_1;
|
|
2174
2174
|
var tmp_2;
|
|
2175
2175
|
if (tmp0_safe_receiver == null) {
|
|
2176
2176
|
tmp_2 = null;
|
|
2177
2177
|
} else {
|
|
2178
2178
|
// Inline function 'kotlin.let' call
|
|
2179
|
-
tmp_2 = tr.
|
|
2179
|
+
tmp_2 = tr.f1v(tmp0_safe_receiver);
|
|
2180
2180
|
}
|
|
2181
|
-
tmp = new FieldCall(tmp_2, stmt.
|
|
2181
|
+
tmp = new FieldCall(tmp_2, stmt.x1q_1);
|
|
2182
2182
|
} else {
|
|
2183
2183
|
tmp = transformChildren(stmt, tr);
|
|
2184
2184
|
}
|
|
@@ -2189,8 +2189,8 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
2189
2189
|
function PythonRefinedTypeDefinitionEmitter() {
|
|
2190
2190
|
}
|
|
2191
2191
|
function PythonShared() {
|
|
2192
|
-
this.
|
|
2193
|
-
this.
|
|
2192
|
+
this.c1z_1 = 'shared';
|
|
2193
|
+
this.d1z_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";
|
|
2194
2194
|
}
|
|
2195
2195
|
protoOf(PythonShared).toString = function () {
|
|
2196
2196
|
return 'PythonShared';
|
|
@@ -2211,12 +2211,12 @@ function PythonShared_getInstance() {
|
|
|
2211
2211
|
}
|
|
2212
2212
|
function PythonTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
2213
2213
|
return function (it) {
|
|
2214
|
-
return this$0.
|
|
2214
|
+
return this$0.h1z(it);
|
|
2215
2215
|
};
|
|
2216
2216
|
}
|
|
2217
2217
|
function PythonTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2218
2218
|
return function (it) {
|
|
2219
|
-
return this$0.
|
|
2219
|
+
return this$0.h1z(it);
|
|
2220
2220
|
};
|
|
2221
2221
|
}
|
|
2222
2222
|
function PythonTypeDefinitionEmitter$emit$lambda_1(this$0) {
|
|
@@ -2234,23 +2234,23 @@ protoOf(PythonEmitter).lq = emit_6;
|
|
|
2234
2234
|
protoOf(PythonEmitter).mq = emit_7;
|
|
2235
2235
|
protoOf(PythonEmitter).nq = emit_8;
|
|
2236
2236
|
protoOf(PythonEmitter).oq = emit_10;
|
|
2237
|
-
protoOf(PythonEmitter).zr =
|
|
2237
|
+
protoOf(PythonEmitter).zr = emit_12;
|
|
2238
2238
|
protoOf(PythonEmitter).ur = emit_11;
|
|
2239
|
-
protoOf(PythonEmitter).as =
|
|
2240
|
-
protoOf(PythonEmitter).pr =
|
|
2239
|
+
protoOf(PythonEmitter).as = emit_13;
|
|
2240
|
+
protoOf(PythonEmitter).pr = emit_4;
|
|
2241
2241
|
protoOf(PythonEmitter).nr = emit_3;
|
|
2242
2242
|
protoOf(PythonEmitter).or = emit_2;
|
|
2243
|
-
protoOf(PythonEmitter).
|
|
2244
|
-
protoOf(PythonEmitter).
|
|
2245
|
-
protoOf(PythonEmitter).
|
|
2243
|
+
protoOf(PythonEmitter).e1z = emit_9;
|
|
2244
|
+
protoOf(PythonEmitter).l1x = emit_14;
|
|
2245
|
+
protoOf(PythonEmitter).f1z = emit_15;
|
|
2246
2246
|
protoOf(PythonEmitter).bs = emitValidator;
|
|
2247
|
-
protoOf(PythonEmitter).
|
|
2248
|
-
protoOf(PythonEmitter).
|
|
2249
|
-
protoOf(PythonEmitter).
|
|
2250
|
-
protoOf(PythonEmitter).
|
|
2251
|
-
protoOf(PythonIrEmitter).
|
|
2247
|
+
protoOf(PythonEmitter).y1x = sanitize;
|
|
2248
|
+
protoOf(PythonEmitter).o1x = sanitizeKeywords;
|
|
2249
|
+
protoOf(PythonEmitter).g1z = emitType;
|
|
2250
|
+
protoOf(PythonEmitter).h1z = emitReferenceCustomImports;
|
|
2251
|
+
protoOf(PythonIrEmitter).z1v = get_extensions;
|
|
2252
2252
|
protoOf(PythonIrEmitter).eo = emit_1;
|
|
2253
|
-
protoOf(PythonIrEmitter).
|
|
2253
|
+
protoOf(PythonIrEmitter).e1w = beforeGenerate;
|
|
2254
2254
|
//endregion
|
|
2255
2255
|
//region block: init
|
|
2256
2256
|
PythonShared_instance = new PythonShared();
|