@flock/wirespec 0.19.7 → 0.20.0-RC.10
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 +433 -433
- package/kotlin-kotlin-stdlib.mjs +5 -5
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10106 -10106
- package/kotlin-rgxgen.mjs +1760 -1760
- package/kotlinx-io-kotlinx-io-core.mjs +404 -404
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1802 -1802
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1469 -1469
- package/mordant-mordant.mjs +1198 -1198
- package/package.json +1 -1
- package/wirespec-src-compiler-core.mjs +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +244 -244
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +135 -135
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +193 -193
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +331 -331
- package/wirespec-src-compiler-emitters-scala.mjs +119 -119
- package/wirespec-src-compiler-emitters-typescript.mjs +230 -230
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +22 -32
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3533 -3195
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +479 -479
- package/wirespec-src-converter-openapi.mjs +340 -340
- package/wirespec-src-ide-lsp.mjs +1352 -1352
- package/wirespec-src-plugin-arguments.mjs +136 -136
- package/wirespec-src-plugin-cli.mjs +84 -84
- package/wirespec-src-plugin-npm.mjs +18 -18
- package/wirespec-src-tools-generator.mjs +2 -2
|
@@ -209,10 +209,10 @@ initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, V
|
|
|
209
209
|
function emit_3(identifier) {
|
|
210
210
|
var tmp;
|
|
211
211
|
if (identifier instanceof DefinitionIdentifier) {
|
|
212
|
-
tmp = this.
|
|
212
|
+
tmp = this.v1y(identifier);
|
|
213
213
|
} else {
|
|
214
214
|
if (identifier instanceof FieldIdentifier) {
|
|
215
|
-
tmp = this.
|
|
215
|
+
tmp = this.l1y(this.v1y(identifier));
|
|
216
216
|
} else {
|
|
217
217
|
noWhenBranchMatchedException();
|
|
218
218
|
}
|
|
@@ -268,19 +268,14 @@ function sanitize(_this__u8e3s4) {
|
|
|
268
268
|
return tmp;
|
|
269
269
|
}
|
|
270
270
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
271
|
-
return Companion_getInstance_0().
|
|
271
|
+
return Companion_getInstance_0().f20_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
272
272
|
}
|
|
273
273
|
initMetadataForInterface(PythonIdentifierEmitter, 'PythonIdentifierEmitter');
|
|
274
|
-
function emit_4(
|
|
275
|
-
var tmp = this.x1x(enum_0.yr_1);
|
|
276
|
-
return trimMargin('\n |class ' + tmp + '(str, Enum):\n |' + joinToString(enum_0.zr_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.is(2) + 'return self.value\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.is(2) + 'return self.value\n ');
|
|
277
|
-
}
|
|
278
|
-
initMetadataForInterface(PythonEnumDefinitionEmitter, 'PythonEnumDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
279
|
-
function emit_5(union) {
|
|
274
|
+
function emit_4(union) {
|
|
280
275
|
return trimMargin('\n |class ' + this.or(union.hp_1) + '(ABC):\n |' + Spacer_instance.toString() + 'pass\n ');
|
|
281
276
|
}
|
|
282
277
|
initMetadataForInterface(PythonUnionDefinitionEmitter, 'PythonUnionDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
283
|
-
function
|
|
278
|
+
function emit_5(type, module_0) {
|
|
284
279
|
var tmp;
|
|
285
280
|
if (type.np_1.jp_1.r()) {
|
|
286
281
|
var tmp_0 = this.or(type.mp_1);
|
|
@@ -295,15 +290,15 @@ function emit_6(type, module_0) {
|
|
|
295
290
|
}
|
|
296
291
|
return tmp;
|
|
297
292
|
}
|
|
298
|
-
function
|
|
293
|
+
function emit_6(_this__u8e3s4) {
|
|
299
294
|
return joinToString(_this__u8e3s4.jp_1, '\n', VOID, VOID, VOID, VOID, PythonTypeDefinitionEmitter$emit$lambda_1(this));
|
|
300
295
|
}
|
|
301
|
-
function
|
|
296
|
+
function emit_7(_this__u8e3s4) {
|
|
302
297
|
return this.or(_this__u8e3s4.rp_1) + ": '" + this.oq(_this__u8e3s4.sp_1) + "'";
|
|
303
298
|
}
|
|
304
|
-
function
|
|
299
|
+
function emit_8(_this__u8e3s4) {
|
|
305
300
|
// Inline function 'kotlin.let' call
|
|
306
|
-
var it = this.
|
|
301
|
+
var it = this.d20(_this__u8e3s4);
|
|
307
302
|
return _this__u8e3s4.uu() ? 'Optional[' + it + ']' : it;
|
|
308
303
|
}
|
|
309
304
|
function emitType(_this__u8e3s4) {
|
|
@@ -324,7 +319,7 @@ function emitType(_this__u8e3s4) {
|
|
|
324
319
|
tmp = _this__u8e3s4.cv_1;
|
|
325
320
|
} else {
|
|
326
321
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
327
|
-
tmp = this.
|
|
322
|
+
tmp = this.b20(_this__u8e3s4.gv_1);
|
|
328
323
|
} else {
|
|
329
324
|
noWhenBranchMatchedException();
|
|
330
325
|
}
|
|
@@ -335,7 +330,7 @@ function emitType(_this__u8e3s4) {
|
|
|
335
330
|
}
|
|
336
331
|
return tmp;
|
|
337
332
|
}
|
|
338
|
-
function
|
|
333
|
+
function emit_9(_this__u8e3s4) {
|
|
339
334
|
var tmp;
|
|
340
335
|
if (_this__u8e3s4 instanceof String_0) {
|
|
341
336
|
tmp = 'str';
|
|
@@ -360,7 +355,7 @@ function emit_10(_this__u8e3s4) {
|
|
|
360
355
|
}
|
|
361
356
|
return tmp;
|
|
362
357
|
}
|
|
363
|
-
function
|
|
358
|
+
function emit_10(_this__u8e3s4) {
|
|
364
359
|
var tmp;
|
|
365
360
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
366
361
|
tmp = 'bool(re.match(r"' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.qt_1) + '", self.value))';
|
|
@@ -404,15 +399,15 @@ function emitReferenceCustomImports(_this__u8e3s4) {
|
|
|
404
399
|
return 'from ..model.' + _this__u8e3s4.cv_1 + ' import ' + _this__u8e3s4.cv_1;
|
|
405
400
|
}
|
|
406
401
|
initMetadataForInterface(PythonTypeDefinitionEmitter, 'PythonTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
407
|
-
function
|
|
402
|
+
function emit_11(endpoint) {
|
|
408
403
|
var tmp = importReferences(endpoint);
|
|
409
404
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda(this));
|
|
410
405
|
var tmp_1 = this.or(endpoint.vp_1);
|
|
411
|
-
var tmp_2 = spacer(this.
|
|
406
|
+
var tmp_2 = spacer(this.i1y(first(endpoint.aq_1), endpoint), 1);
|
|
412
407
|
var tmp_3 = distinctByStatus(endpoint.bq_1);
|
|
413
408
|
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 ');
|
|
414
409
|
}
|
|
415
|
-
function
|
|
410
|
+
function emit_12(_this__u8e3s4, endpoint) {
|
|
416
411
|
var tmp = emit_18(this, _this__u8e3s4.eq_1);
|
|
417
412
|
var tmp_0 = get_pathParams(endpoint);
|
|
418
413
|
var tmp_1 = emitObject$default(this, tmp_0, 'Path', 'Wirespec.Request.Path', VOID, PythonEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
@@ -445,7 +440,7 @@ function emit_13(_this__u8e3s4, endpoint) {
|
|
|
445
440
|
var tmp_28 = paramList(_this__u8e3s4, endpoint);
|
|
446
441
|
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.wp_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 ');
|
|
447
442
|
}
|
|
448
|
-
function
|
|
443
|
+
function emit_13(_this__u8e3s4, endpoint) {
|
|
449
444
|
var tmp = emit_18(this, _this__u8e3s4.jq_1);
|
|
450
445
|
var tmp_0 = emitObject$default(this, _this__u8e3s4.iq_1, 'Headers', 'Wirespec.Response.Headers', VOID, PythonEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
451
446
|
var tmp_1 = Spacer_instance.toString();
|
|
@@ -466,8 +461,13 @@ function emit_14(_this__u8e3s4, endpoint) {
|
|
|
466
461
|
return trimMargin('\n |@dataclass\n |class Response' + _this__u8e3s4.hq_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.hq_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 ');
|
|
467
462
|
}
|
|
468
463
|
initMetadataForInterface(PythonEndpointDefinitionEmitter, 'PythonEndpointDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter]);
|
|
464
|
+
function emit_14(enum_0, module_0) {
|
|
465
|
+
var tmp = this.v1y(enum_0.yr_1);
|
|
466
|
+
return trimMargin('\n |class ' + tmp + '(str, Enum):\n |' + joinToString(enum_0.zr_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.is(2) + 'return self.value\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.is(2) + 'return self.value\n ');
|
|
467
|
+
}
|
|
468
|
+
initMetadataForInterface(PythonEnumDefinitionEmitter, 'PythonEnumDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
469
469
|
function emit_15(refined) {
|
|
470
|
-
return trimMargin('\n |@dataclass\n |class ' + this.
|
|
470
|
+
return trimMargin('\n |@dataclass\n |class ' + this.v1y(refined.tr_1) + '(Wirespec.Refined):\n |' + Spacer_instance.toString() + 'value: ' + this.d20(refined.ur_1) + '\n |\n |' + Spacer_instance.toString() + 'def validate(self) -> bool:\n |' + Spacer_instance.is(2) + 'return ' + this.cs(refined) + '\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.is(2) + 'return str(self.value)\n |\n ');
|
|
471
471
|
}
|
|
472
472
|
function emitValidator(_this__u8e3s4) {
|
|
473
473
|
var defaultReturn = 'True';
|
|
@@ -510,7 +510,7 @@ function emitValidator(_this__u8e3s4) {
|
|
|
510
510
|
return tmp;
|
|
511
511
|
}
|
|
512
512
|
initMetadataForInterface(PythonRefinedTypeDefinitionEmitter, 'PythonRefinedTypeDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
513
|
-
initMetadataForClass(PythonEmitter, 'PythonEmitter', PythonEmitter, LanguageEmitter, [LanguageEmitter, PythonEnumDefinitionEmitter, PythonChannelDefinitionEmitter,
|
|
513
|
+
initMetadataForClass(PythonEmitter, 'PythonEmitter', PythonEmitter, LanguageEmitter, [LanguageEmitter, PythonUnionDefinitionEmitter, PythonEndpointDefinitionEmitter, PythonEnumDefinitionEmitter, PythonChannelDefinitionEmitter, PythonIdentifierEmitter, PythonRefinedTypeDefinitionEmitter, PythonTypeDefinitionEmitter]);
|
|
514
514
|
initMetadataForCompanion(Companion);
|
|
515
515
|
initMetadataForCompanion(Companion_0);
|
|
516
516
|
initMetadataForClass(sam$kotlin_Comparator$0_0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
|
|
@@ -520,16 +520,16 @@ initMetadataForObject(PythonShared, 'PythonShared');
|
|
|
520
520
|
function PythonChannelDefinitionEmitter() {
|
|
521
521
|
}
|
|
522
522
|
function sam$kotlin_Comparator$0(function_0) {
|
|
523
|
-
this.
|
|
523
|
+
this.r1z_1 = function_0;
|
|
524
524
|
}
|
|
525
525
|
protoOf(sam$kotlin_Comparator$0).td = function (a, b) {
|
|
526
|
-
return this.
|
|
526
|
+
return this.r1z_1(a, b);
|
|
527
527
|
};
|
|
528
528
|
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
529
529
|
return this.td(a, b);
|
|
530
530
|
};
|
|
531
531
|
protoOf(sam$kotlin_Comparator$0).l3 = function () {
|
|
532
|
-
return this.
|
|
532
|
+
return this.r1z_1;
|
|
533
533
|
};
|
|
534
534
|
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
535
535
|
var tmp;
|
|
@@ -552,8 +552,8 @@ protoOf(sam$kotlin_Comparator$0).hashCode = function () {
|
|
|
552
552
|
function PythonEmitter$emit$lambda(this$0) {
|
|
553
553
|
return function (a, b) {
|
|
554
554
|
// Inline function 'kotlin.comparisons.compareValuesBy' call
|
|
555
|
-
var tmp = this$0.
|
|
556
|
-
var tmp$ret$1 = this$0.
|
|
555
|
+
var tmp = this$0.y1z(a);
|
|
556
|
+
var tmp$ret$1 = this$0.y1z(b);
|
|
557
557
|
return compareValues(tmp, tmp$ret$1);
|
|
558
558
|
};
|
|
559
559
|
}
|
|
@@ -564,23 +564,23 @@ function PythonEmitter(packageName, emitShared) {
|
|
|
564
564
|
packageName = packageName === VOID ? Companion_instance.ds('community.flock.wirespec.generated') : packageName;
|
|
565
565
|
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
566
566
|
LanguageEmitter.call(this);
|
|
567
|
-
this.
|
|
568
|
-
this.
|
|
569
|
-
this.
|
|
570
|
-
this.
|
|
571
|
-
this.
|
|
572
|
-
this.
|
|
567
|
+
this.s1z_1 = packageName;
|
|
568
|
+
this.t1z_1 = emitShared;
|
|
569
|
+
this.u1z_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';
|
|
570
|
+
this.v1z_1 = FileExtension_Python_getInstance();
|
|
571
|
+
this.w1z_1 = PythonShared_instance;
|
|
572
|
+
this.x1z_1 = '#';
|
|
573
573
|
}
|
|
574
574
|
protoOf(PythonEmitter).vq = function () {
|
|
575
|
-
return this.
|
|
575
|
+
return this.v1z_1;
|
|
576
576
|
};
|
|
577
|
-
protoOf(PythonEmitter).
|
|
578
|
-
return this.
|
|
577
|
+
protoOf(PythonEmitter).e1y = function () {
|
|
578
|
+
return this.w1z_1;
|
|
579
579
|
};
|
|
580
580
|
protoOf(PythonEmitter).wq = function () {
|
|
581
|
-
return this.
|
|
581
|
+
return this.x1z_1;
|
|
582
582
|
};
|
|
583
|
-
protoOf(PythonEmitter).
|
|
583
|
+
protoOf(PythonEmitter).y1z = function (definition) {
|
|
584
584
|
var tmp;
|
|
585
585
|
if (definition instanceof Enum) {
|
|
586
586
|
tmp = 1;
|
|
@@ -620,8 +620,8 @@ protoOf(PythonEmitter).lr = function (module_0, logger) {
|
|
|
620
620
|
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).om_1;
|
|
621
621
|
// Inline function 'kotlin.let' call
|
|
622
622
|
var it = protoOf(LanguageEmitter).lr.call(this, module_0.nv(VOID, statements), logger);
|
|
623
|
-
var init = new Emitted(this.
|
|
624
|
-
var tmp_1 = this.
|
|
623
|
+
var init = new Emitted(this.s1z_1.gs() + '__init__', 'from . import model\nfrom . import endpoint\nfrom . import wirespec\n');
|
|
624
|
+
var tmp_1 = this.s1z_1.gs() + 'endpoint/' + '__init__';
|
|
625
625
|
// Inline function 'kotlin.collections.filter' call
|
|
626
626
|
var tmp0 = new NonEmptyList(module_0.uq_1);
|
|
627
627
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -643,7 +643,7 @@ protoOf(PythonEmitter).lr = function (module_0, logger) {
|
|
|
643
643
|
destination_0.x(tmp$ret$5);
|
|
644
644
|
}
|
|
645
645
|
var initEndpoint = new Emitted(tmp_1, joinToString(destination_0, '\n'));
|
|
646
|
-
var tmp_2 = this.
|
|
646
|
+
var tmp_2 = this.s1z_1.gs() + 'model/' + '__init__';
|
|
647
647
|
// Inline function 'kotlin.collections.filter' call
|
|
648
648
|
var tmp0_0 = new NonEmptyList(module_0.uq_1);
|
|
649
649
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -665,16 +665,16 @@ protoOf(PythonEmitter).lr = function (module_0, logger) {
|
|
|
665
665
|
destination_2.x(tmp$ret$11);
|
|
666
666
|
}
|
|
667
667
|
var initModel = new Emitted(tmp_2, joinToString(destination_2, '\n'));
|
|
668
|
-
var shared = new Emitted(this.
|
|
669
|
-
return this.
|
|
668
|
+
var shared = new Emitted(this.s1z_1.gs() + 'wirespec', this.e1y().a20_1);
|
|
669
|
+
return this.t1z_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);
|
|
670
670
|
};
|
|
671
671
|
protoOf(PythonEmitter).mr = function (definition, module_0, logger) {
|
|
672
|
-
var subPackageName = plus_1(this.
|
|
672
|
+
var subPackageName = plus_1(this.s1z_1, definition);
|
|
673
673
|
// Inline function 'kotlin.let' call
|
|
674
674
|
var it = protoOf(LanguageEmitter).mr.call(this, definition, module_0, logger);
|
|
675
675
|
var tmp = subPackageName.gs() + it.yo_1;
|
|
676
676
|
// Inline function 'kotlin.text.trimStart' call
|
|
677
|
-
var this_0 = trimMargin('\n |' + this.
|
|
677
|
+
var this_0 = trimMargin('\n |' + this.u1z_1 + '\n |' + it.zo_1 + '\n ');
|
|
678
678
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
679
679
|
return new Emitted(tmp, tmp$ret$0);
|
|
680
680
|
};
|
|
@@ -714,7 +714,7 @@ function emitToRawRequest($this, _this__u8e3s4, endpoint) {
|
|
|
714
714
|
var tmp_19 = Spacer_instance.toString();
|
|
715
715
|
var tmp0_safe_receiver = _this__u8e3s4.eq_1;
|
|
716
716
|
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.gq_1;
|
|
717
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
717
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.d20(tmp1_safe_receiver);
|
|
718
718
|
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 ');
|
|
719
719
|
}
|
|
720
720
|
function emitFromRawRequest($this, _this__u8e3s4, endpoint) {
|
|
@@ -731,7 +731,7 @@ function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
|
731
731
|
tmp_3 = null;
|
|
732
732
|
} else {
|
|
733
733
|
// Inline function 'kotlin.let' call
|
|
734
|
-
tmp_3 = Spacer_instance.is(3) + 'body = serialization.deserialize(request.body, ' + $this.
|
|
734
|
+
tmp_3 = Spacer_instance.is(3) + 'body = serialization.deserialize(request.body, ' + $this.d20(tmp0_safe_receiver.gq_1) + '),';
|
|
735
735
|
}
|
|
736
736
|
// Inline function 'kotlin.let' call
|
|
737
737
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
@@ -831,18 +831,18 @@ function emitAssignSelf_1($this, _this__u8e3s4, endpoint) {
|
|
|
831
831
|
return trimMargin('\n |self._headers = ' + tmp + '.Response' + _this__u8e3s4.hq_1 + '.Headers(' + tmp_1 + ')\n |self._body = ' + (tmp1_elvis_lhs == null ? 'None' : tmp1_elvis_lhs) + '\n ');
|
|
832
832
|
}
|
|
833
833
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
834
|
-
return Spacer_instance.is(3) + $this.or(_this__u8e3s4.ue_1.cq_1) + ' = serialization.deserialize(request.path[' + _this__u8e3s4.te_1 + '], ' + $this.
|
|
834
|
+
return Spacer_instance.is(3) + $this.or(_this__u8e3s4.ue_1.cq_1) + ' = serialization.deserialize(request.path[' + _this__u8e3s4.te_1 + '], ' + $this.d20(_this__u8e3s4.ue_1.dq_1) + ')';
|
|
835
835
|
}
|
|
836
836
|
function emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive) {
|
|
837
837
|
var tmp;
|
|
838
838
|
if (caseSensitive) {
|
|
839
|
-
tmp = Spacer_instance.is(spaces) + $this.or(_this__u8e3s4.rp_1) + ' = serialization.deserialize_param(' + type + '.' + fields + '.get("' + _this__u8e3s4.rp_1.l1() + '"), ' + $this.
|
|
839
|
+
tmp = Spacer_instance.is(spaces) + $this.or(_this__u8e3s4.rp_1) + ' = serialization.deserialize_param(' + type + '.' + fields + '.get("' + _this__u8e3s4.rp_1.l1() + '"), ' + $this.d20(_this__u8e3s4.sp_1) + ')';
|
|
840
840
|
} else {
|
|
841
841
|
var tmp_0 = Spacer_instance.is(spaces);
|
|
842
842
|
var tmp_1 = $this.or(_this__u8e3s4.rp_1);
|
|
843
843
|
// Inline function 'kotlin.text.lowercase' call
|
|
844
844
|
// Inline function 'kotlin.js.asDynamic' call
|
|
845
|
-
tmp = tmp_0 + tmp_1 + ' = serialization.deserialize_param(next((v for k, v in ' + type + '.' + fields + '.items() if k.lower() == "' + _this__u8e3s4.rp_1.l1().toLowerCase() + '"), None), ' + $this.
|
|
845
|
+
tmp = tmp_0 + tmp_1 + ' = serialization.deserialize_param(next((v for k, v in ' + type + '.' + fields + '.items() if k.lower() == "' + _this__u8e3s4.rp_1.l1().toLowerCase() + '"), None), ' + $this.d20(_this__u8e3s4.sp_1) + ')';
|
|
846
846
|
}
|
|
847
847
|
return tmp;
|
|
848
848
|
}
|
|
@@ -880,7 +880,7 @@ function emitDeserialized_0($this, _this__u8e3s4, endpoint) {
|
|
|
880
880
|
var tmp_1 = Spacer_instance.is(2);
|
|
881
881
|
var tmp0_safe_receiver = _this__u8e3s4.jq_1;
|
|
882
882
|
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.gq_1;
|
|
883
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
883
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.d20(tmp1_safe_receiver);
|
|
884
884
|
var tmp_2 = tmp_1 + 'body = serialization.deserialize(response.body, ' + (tmp2_elvis_lhs == null ? 'type(None)' : tmp2_elvis_lhs) + '),';
|
|
885
885
|
return joinToString(listOfNotNull([tmp, tmp_0, tmp_2, orNull(joinToString(_this__u8e3s4.iq_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserialized$lambda($this))), Spacer_instance.toString() + ')']), '\n');
|
|
886
886
|
}
|
|
@@ -904,13 +904,13 @@ function emitSerialized($this, _this__u8e3s4, endpoint) {
|
|
|
904
904
|
tmp_6 = null;
|
|
905
905
|
} else {
|
|
906
906
|
// Inline function 'kotlin.let' call
|
|
907
|
-
tmp_6 = 'serialization.serialize(response.body, ' + $this.
|
|
907
|
+
tmp_6 = 'serialization.serialize(response.body, ' + $this.d20(tmp0_safe_receiver.gq_1) + ')';
|
|
908
908
|
}
|
|
909
909
|
var tmp1_elvis_lhs = tmp_6;
|
|
910
910
|
return trimMargin('\n |case ' + tmp + '.Response' + _this__u8e3s4.hq_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.is(1) + ')\n ');
|
|
911
911
|
}
|
|
912
912
|
function emitSerializedParams($this, _this__u8e3s4, type, fields) {
|
|
913
|
-
return '"' + _this__u8e3s4.rp_1.l1() + '": serialization.serialize_param(' + type + '.' + fields + '.' + $this.or(_this__u8e3s4.rp_1) + ', ' + $this.
|
|
913
|
+
return '"' + _this__u8e3s4.rp_1.l1() + '": serialization.serialize_param(' + type + '.' + fields + '.' + $this.or(_this__u8e3s4.rp_1) + ', ' + $this.d20(_this__u8e3s4.sp_1) + ')';
|
|
914
914
|
}
|
|
915
915
|
function emitObject($this, _this__u8e3s4, name, extends_0, spaces, block) {
|
|
916
916
|
var tmp;
|
|
@@ -937,12 +937,12 @@ function emit_18($this, _this__u8e3s4) {
|
|
|
937
937
|
}
|
|
938
938
|
function PythonEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
939
939
|
return function (it) {
|
|
940
|
-
return this$0.
|
|
940
|
+
return this$0.e20(it);
|
|
941
941
|
};
|
|
942
942
|
}
|
|
943
943
|
function PythonEndpointDefinitionEmitter$emit$lambda_0(this$0, $endpoint) {
|
|
944
944
|
return function (it) {
|
|
945
|
-
return this$0.
|
|
945
|
+
return this$0.c20(it, $endpoint);
|
|
946
946
|
};
|
|
947
947
|
}
|
|
948
948
|
function PythonEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
@@ -1089,14 +1089,14 @@ function sanitizeEnum($this, _this__u8e3s4) {
|
|
|
1089
1089
|
}
|
|
1090
1090
|
function PythonEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
1091
1091
|
return function (it) {
|
|
1092
|
-
return Spacer_instance.toString() + this$0.
|
|
1092
|
+
return Spacer_instance.toString() + this$0.l1y(sanitizeEnum(this$0, it)) + ' = "' + it + '"';
|
|
1093
1093
|
};
|
|
1094
1094
|
}
|
|
1095
1095
|
function PythonEnumDefinitionEmitter() {
|
|
1096
1096
|
}
|
|
1097
1097
|
function Companion() {
|
|
1098
1098
|
Companion_instance_2 = this;
|
|
1099
|
-
this.
|
|
1099
|
+
this.f20_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']);
|
|
1100
1100
|
}
|
|
1101
1101
|
var Companion_instance_2;
|
|
1102
1102
|
function Companion_getInstance_0() {
|
|
@@ -1107,7 +1107,7 @@ function Companion_getInstance_0() {
|
|
|
1107
1107
|
function PythonIdentifierEmitter() {
|
|
1108
1108
|
}
|
|
1109
1109
|
function _get_sanitizationConfig__sns434($this) {
|
|
1110
|
-
var tmp0 = $this.
|
|
1110
|
+
var tmp0 = $this.k20_1;
|
|
1111
1111
|
var tmp = KProperty1;
|
|
1112
1112
|
// Inline function 'kotlin.getValue' call
|
|
1113
1113
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, PythonIrEmitter$_get_sanitizationConfig_$ref_1q5eai(), null);
|
|
@@ -1170,7 +1170,7 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
1170
1170
|
return tmp_2;
|
|
1171
1171
|
}
|
|
1172
1172
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1173
|
-
return Companion_getInstance_1().
|
|
1173
|
+
return Companion_getInstance_1().m20_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1174
1174
|
}
|
|
1175
1175
|
function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
1176
1176
|
// Inline function 'kotlin.let' call
|
|
@@ -1196,7 +1196,7 @@ function buildImports($this, wirespecPath) {
|
|
|
1196
1196
|
}
|
|
1197
1197
|
function Companion_0() {
|
|
1198
1198
|
Companion_instance_3 = this;
|
|
1199
|
-
this.
|
|
1199
|
+
this.m20_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']);
|
|
1200
1200
|
}
|
|
1201
1201
|
var Companion_instance_3;
|
|
1202
1202
|
function Companion_getInstance_1() {
|
|
@@ -1205,16 +1205,16 @@ function Companion_getInstance_1() {
|
|
|
1205
1205
|
return Companion_instance_3;
|
|
1206
1206
|
}
|
|
1207
1207
|
function sam$kotlin_Comparator$0_0(function_0) {
|
|
1208
|
-
this.
|
|
1208
|
+
this.n20_1 = function_0;
|
|
1209
1209
|
}
|
|
1210
1210
|
protoOf(sam$kotlin_Comparator$0_0).td = function (a, b) {
|
|
1211
|
-
return this.
|
|
1211
|
+
return this.n20_1(a, b);
|
|
1212
1212
|
};
|
|
1213
1213
|
protoOf(sam$kotlin_Comparator$0_0).compare = function (a, b) {
|
|
1214
1214
|
return this.td(a, b);
|
|
1215
1215
|
};
|
|
1216
1216
|
protoOf(sam$kotlin_Comparator$0_0).l3 = function () {
|
|
1217
|
-
return this.
|
|
1217
|
+
return this.n20_1;
|
|
1218
1218
|
};
|
|
1219
1219
|
protoOf(sam$kotlin_Comparator$0_0).equals = function (other) {
|
|
1220
1220
|
var tmp;
|
|
@@ -1238,11 +1238,11 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
1238
1238
|
return '_' + it;
|
|
1239
1239
|
}
|
|
1240
1240
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(name) {
|
|
1241
|
-
var sanitized = name.q1h_1.a1() > 1 ? name.
|
|
1241
|
+
var sanitized = name.q1h_1.a1() > 1 ? name.e1n() : name.r1j();
|
|
1242
1242
|
return new Name(listOf_0(sanitized));
|
|
1243
1243
|
}
|
|
1244
1244
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(name) {
|
|
1245
|
-
return new Name(listOf_0(name.
|
|
1245
|
+
return new Name(listOf_0(name.e1n()));
|
|
1246
1246
|
}
|
|
1247
1247
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(it) {
|
|
1248
1248
|
return it;
|
|
@@ -1251,9 +1251,9 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1251
1251
|
return function (stmt, tr) {
|
|
1252
1252
|
var tmp;
|
|
1253
1253
|
if (stmt instanceof ConstructorStatement) {
|
|
1254
|
-
var tmp_0 = tr.
|
|
1254
|
+
var tmp_0 = tr.z1v(stmt.j1o_1);
|
|
1255
1255
|
// Inline function 'kotlin.collections.map' call
|
|
1256
|
-
var this_0 = stmt.
|
|
1256
|
+
var this_0 = stmt.k1o_1;
|
|
1257
1257
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1258
1258
|
var destination = ArrayList_init_$Create$_0(this_0.a1());
|
|
1259
1259
|
// Inline function 'kotlin.collections.iterator' call
|
|
@@ -1264,7 +1264,7 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1264
1264
|
var k = item.k1();
|
|
1265
1265
|
// Inline function 'kotlin.collections.component2' call
|
|
1266
1266
|
var v = item.l1();
|
|
1267
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.
|
|
1267
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.c1w(v));
|
|
1268
1268
|
destination.x(tmp$ret$3);
|
|
1269
1269
|
}
|
|
1270
1270
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
@@ -1276,7 +1276,7 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1276
1276
|
}
|
|
1277
1277
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1278
1278
|
return function () {
|
|
1279
|
-
var tmp = Companion_getInstance_1().
|
|
1279
|
+
var tmp = Companion_getInstance_1().m20_1;
|
|
1280
1280
|
var tmp_0 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1281
1281
|
var tmp_1 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0;
|
|
1282
1282
|
var tmp_2 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1;
|
|
@@ -1315,17 +1315,17 @@ function PythonIrEmitter$emitGenerator$lambda_2($generatorOwnName, $generatorRef
|
|
|
1315
1315
|
var tmp_0;
|
|
1316
1316
|
var tmp_1;
|
|
1317
1317
|
if (expr instanceof RawExpression) {
|
|
1318
|
-
tmp_1 = endsWith(expr.
|
|
1318
|
+
tmp_1 = endsWith(expr.h1q_1, 'Generator');
|
|
1319
1319
|
} else {
|
|
1320
1320
|
tmp_1 = false;
|
|
1321
1321
|
}
|
|
1322
1322
|
if (tmp_1) {
|
|
1323
|
-
tmp_0 = !(expr.
|
|
1323
|
+
tmp_0 = !(expr.h1q_1 === $generatorOwnName);
|
|
1324
1324
|
} else {
|
|
1325
1325
|
tmp_0 = false;
|
|
1326
1326
|
}
|
|
1327
1327
|
if (tmp_0) {
|
|
1328
|
-
$generatorRefs.x(expr.
|
|
1328
|
+
$generatorRefs.x(expr.h1q_1);
|
|
1329
1329
|
tmp = Unit_instance;
|
|
1330
1330
|
}
|
|
1331
1331
|
return transformChildren_0(expr, t);
|
|
@@ -1340,31 +1340,31 @@ function PythonIrEmitter(packageName, emitShared) {
|
|
|
1340
1340
|
Companion_getInstance_1();
|
|
1341
1341
|
packageName = packageName === VOID ? Companion_instance.ds('community.flock.wirespec.generated') : packageName;
|
|
1342
1342
|
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
1343
|
-
this.
|
|
1344
|
-
this.
|
|
1345
|
-
this.
|
|
1346
|
-
this.
|
|
1343
|
+
this.g20_1 = packageName;
|
|
1344
|
+
this.h20_1 = emitShared;
|
|
1345
|
+
this.i20_1 = PythonGenerator_instance;
|
|
1346
|
+
this.j20_1 = FileExtension_Python_getInstance();
|
|
1347
1347
|
var tmp = this;
|
|
1348
|
-
tmp.
|
|
1349
|
-
this.
|
|
1348
|
+
tmp.k20_1 = lazy(PythonIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1349
|
+
this.l20_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";
|
|
1350
1350
|
}
|
|
1351
|
-
protoOf(PythonIrEmitter).
|
|
1352
|
-
return this.
|
|
1351
|
+
protoOf(PythonIrEmitter).u1w = function () {
|
|
1352
|
+
return this.i20_1;
|
|
1353
1353
|
};
|
|
1354
1354
|
protoOf(PythonIrEmitter).vq = function () {
|
|
1355
|
-
return this.
|
|
1355
|
+
return this.j20_1;
|
|
1356
1356
|
};
|
|
1357
|
-
protoOf(PythonIrEmitter).
|
|
1357
|
+
protoOf(PythonIrEmitter).y1w = function () {
|
|
1358
1358
|
var source = replaceReflectInNonGenericStructFields(convert(Companion_instance.ds('shared')));
|
|
1359
1359
|
var tmp;
|
|
1360
|
-
if (this.
|
|
1361
|
-
tmp = new File(Companion_getInstance().s1h(this.
|
|
1360
|
+
if (this.h20_1.xo_1) {
|
|
1361
|
+
tmp = new File(Companion_getInstance().s1h(this.g20_1.gs() + 'wirespec'), listOf_0(raw(this.l20_1 + PythonGenerator_instance.v1w(source))));
|
|
1362
1362
|
} else {
|
|
1363
1363
|
tmp = null;
|
|
1364
1364
|
}
|
|
1365
1365
|
return tmp;
|
|
1366
1366
|
};
|
|
1367
|
-
protoOf(PythonIrEmitter).
|
|
1367
|
+
protoOf(PythonIrEmitter).x1w = function (module_0, logger) {
|
|
1368
1368
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
1369
1369
|
var this_0 = new NonEmptyList(module_0.uq_1);
|
|
1370
1370
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
@@ -1399,7 +1399,7 @@ protoOf(PythonIrEmitter).z1v = function (module_0, logger) {
|
|
|
1399
1399
|
tmp$ret$2 = false;
|
|
1400
1400
|
}
|
|
1401
1401
|
var hasEndpoints = tmp$ret$2;
|
|
1402
|
-
var tmp_2 = Companion_getInstance().s1h(this.
|
|
1402
|
+
var tmp_2 = Companion_getInstance().s1h(this.g20_1.gs() + '__init__');
|
|
1403
1403
|
// Inline function 'kotlin.collections.buildList' call
|
|
1404
1404
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1405
1405
|
// Inline function 'kotlin.apply' call
|
|
@@ -1412,7 +1412,7 @@ protoOf(PythonIrEmitter).z1v = function (module_0, logger) {
|
|
|
1412
1412
|
this_1.x(import_0('.', 'wirespec'));
|
|
1413
1413
|
var tmp$ret$7 = this_1.o5();
|
|
1414
1414
|
var init = new File(tmp_2, tmp$ret$7);
|
|
1415
|
-
var tmp_3 = Companion_getInstance().s1h(this.
|
|
1415
|
+
var tmp_3 = Companion_getInstance().s1h(this.g20_1.gs() + 'endpoint/' + '__init__');
|
|
1416
1416
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1417
1417
|
var tmp0_0 = new NonEmptyList(module_0.uq_1);
|
|
1418
1418
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
@@ -1434,7 +1434,7 @@ protoOf(PythonIrEmitter).z1v = function (module_0, logger) {
|
|
|
1434
1434
|
destination_0.x(tmp$ret$10);
|
|
1435
1435
|
}
|
|
1436
1436
|
var initEndpoint = new File(tmp_3, destination_0);
|
|
1437
|
-
var tmp_4 = Companion_getInstance().s1h(this.
|
|
1437
|
+
var tmp_4 = Companion_getInstance().s1h(this.g20_1.gs() + 'model/' + '__init__');
|
|
1438
1438
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1439
1439
|
var tmp0_1 = new NonEmptyList(module_0.uq_1);
|
|
1440
1440
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
@@ -1456,8 +1456,8 @@ protoOf(PythonIrEmitter).z1v = function (module_0, logger) {
|
|
|
1456
1456
|
destination_2.x(tmp$ret$15);
|
|
1457
1457
|
}
|
|
1458
1458
|
var initModel = new File(tmp_4, destination_2);
|
|
1459
|
-
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().s1h(this.
|
|
1460
|
-
var tmp0_2 = dropLast(split(this.
|
|
1459
|
+
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().s1h(this.g20_1.gs() + 'client/' + '__init__'), emptyList())) : emptyList();
|
|
1460
|
+
var tmp0_2 = dropLast(split(this.g20_1.es_1, ['.']), 1);
|
|
1461
1461
|
var tmp$ret$18;
|
|
1462
1462
|
$l$block_1: {
|
|
1463
1463
|
// Inline function 'kotlin.collections.runningFold' call
|
|
@@ -1498,13 +1498,13 @@ protoOf(PythonIrEmitter).z1v = function (module_0, logger) {
|
|
|
1498
1498
|
destination_3.x(tmp$ret$23);
|
|
1499
1499
|
}
|
|
1500
1500
|
var parentInits = destination_3;
|
|
1501
|
-
return this.
|
|
1501
|
+
return this.h20_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);
|
|
1502
1502
|
};
|
|
1503
1503
|
protoOf(PythonIrEmitter).mr = function (definition, module_0, logger) {
|
|
1504
1504
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1505
|
-
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.
|
|
1505
|
+
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.g20_1, definition);
|
|
1506
1506
|
};
|
|
1507
|
-
protoOf(PythonIrEmitter).
|
|
1507
|
+
protoOf(PythonIrEmitter).d1x = function (definition, module_0) {
|
|
1508
1508
|
var tmp;
|
|
1509
1509
|
if (definition instanceof Type) {
|
|
1510
1510
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1534,8 +1534,8 @@ protoOf(PythonIrEmitter).f1w = function (definition, module_0) {
|
|
|
1534
1534
|
var generatorRefs = LinkedHashSet_init_$Create$();
|
|
1535
1535
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1536
1536
|
var scope = new TransformScope(sanitized);
|
|
1537
|
-
scope.
|
|
1538
|
-
var tmp_3 = scope.
|
|
1537
|
+
scope.p1w(PythonIrEmitter$emitGenerator$lambda_2(generatorOwnName, generatorRefs));
|
|
1538
|
+
var tmp_3 = scope.h1w_1;
|
|
1539
1539
|
isInterface(tmp_3, Element) || THROW_CCE();
|
|
1540
1540
|
// Inline function 'kotlin.collections.filter' call
|
|
1541
1541
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -1578,7 +1578,7 @@ protoOf(PythonIrEmitter).f1w = function (definition, module_0) {
|
|
|
1578
1578
|
destination_2.x(tmp$ret$12);
|
|
1579
1579
|
}
|
|
1580
1580
|
var modelImports = destination_2;
|
|
1581
|
-
return placeInModule_0(prependImports(sanitized, plus(plus(buildImports(this, '..wirespec'), modelImports), generatorImports)), this.
|
|
1581
|
+
return placeInModule_0(prependImports(sanitized, plus(plus(buildImports(this, '..wirespec'), modelImports), generatorImports)), this.g20_1, 'generator');
|
|
1582
1582
|
};
|
|
1583
1583
|
protoOf(PythonIrEmitter).lq = function (type, module_0) {
|
|
1584
1584
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
@@ -1661,13 +1661,13 @@ protoOf(PythonIrEmitter).bs = function (endpoint) {
|
|
|
1661
1661
|
var endpointImports = destination;
|
|
1662
1662
|
// Inline function 'kotlin.let' call
|
|
1663
1663
|
var it = splitEndpointStructsToModuleLevel(convert_3(endpoint));
|
|
1664
|
-
var tmp$ret$6 = it.
|
|
1664
|
+
var tmp$ret$6 = it.q1o(VOID, plus(endpointImports, it.n1o_1));
|
|
1665
1665
|
return sanitizeNames(snakeCaseHandlerAndCallMethods(tmp$ret$6), _get_sanitizationConfig__sns434(this));
|
|
1666
1666
|
};
|
|
1667
1667
|
protoOf(PythonIrEmitter).pr = function (channel) {
|
|
1668
1668
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1669
1669
|
};
|
|
1670
|
-
protoOf(PythonIrEmitter).
|
|
1670
|
+
protoOf(PythonIrEmitter).c1x = function (endpoint) {
|
|
1671
1671
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1672
1672
|
var this_0 = importReferences(endpoint);
|
|
1673
1673
|
var set = HashSet_init_$Create$();
|
|
@@ -1693,10 +1693,10 @@ protoOf(PythonIrEmitter).e1w = function (endpoint) {
|
|
|
1693
1693
|
var endpointImport = import_0('..endpoint.' + endpoint.vp_1.l1(), '*');
|
|
1694
1694
|
var endpointName = endpoint.vp_1.l1();
|
|
1695
1695
|
var file = flattenEndpointTypeRefs(snakeCaseClientFunctions(addSelfReceiverToClientFields(sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this)))), endpointName);
|
|
1696
|
-
var subPackageName = plus_2(this.
|
|
1697
|
-
return new File(Companion_getInstance().s1h(subPackageName.gs() + file.
|
|
1696
|
+
var subPackageName = plus_2(this.g20_1, 'client');
|
|
1697
|
+
return new File(Companion_getInstance().s1h(subPackageName.gs() + file.m1o_1.t1h()), plus(plus(plus(buildImports(this, '..wirespec'), modelImports), listOf_0(endpointImport)), file.n1o_1));
|
|
1698
1698
|
};
|
|
1699
|
-
protoOf(PythonIrEmitter).
|
|
1699
|
+
protoOf(PythonIrEmitter).z1w = function (endpoints, logger) {
|
|
1700
1700
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1701
1701
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1702
1702
|
var destination = ArrayList_init_$Create$();
|
|
@@ -1768,7 +1768,7 @@ protoOf(PythonIrEmitter).b1w = function (endpoints, logger) {
|
|
|
1768
1768
|
accumulator = flattenEndpointTypeRefs(acc, element_0);
|
|
1769
1769
|
}
|
|
1770
1770
|
var file = accumulator;
|
|
1771
|
-
return new File(Companion_getInstance().s1h(this.
|
|
1771
|
+
return new File(Companion_getInstance().s1h(this.g20_1.gs() + file.m1o_1.t1h()), plus(plus(buildImports(this, '.wirespec'), allImports), file.n1o_1));
|
|
1772
1772
|
};
|
|
1773
1773
|
function replaceReflectInNonGenericStructFields(_this__u8e3s4) {
|
|
1774
1774
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -1776,14 +1776,14 @@ function replaceReflectInNonGenericStructFields(_this__u8e3s4) {
|
|
|
1776
1776
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1777
1777
|
var tmp = scope;
|
|
1778
1778
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1779
|
-
var this_0 = scope.
|
|
1779
|
+
var this_0 = scope.h1w_1;
|
|
1780
1780
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1781
1781
|
// Inline function 'kotlin.apply' call
|
|
1782
1782
|
var this_1 = new TransformerBuilder();
|
|
1783
|
-
this_1.
|
|
1784
|
-
var tmp$ret$2 = this_1.
|
|
1785
|
-
tmp.
|
|
1786
|
-
var tmp_0 = scope.
|
|
1783
|
+
this_1.f1j(replaceReflectInNonGenericStructFields$lambda);
|
|
1784
|
+
var tmp$ret$2 = this_1.g1j();
|
|
1785
|
+
tmp.h1w_1 = transform(this_0, tmp$ret$2);
|
|
1786
|
+
var tmp_0 = scope.h1w_1;
|
|
1787
1787
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1788
1788
|
}
|
|
1789
1789
|
function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
@@ -1792,14 +1792,14 @@ function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
|
1792
1792
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1793
1793
|
var tmp = scope;
|
|
1794
1794
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1795
|
-
var this_0 = scope.
|
|
1795
|
+
var this_0 = scope.h1w_1;
|
|
1796
1796
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1797
1797
|
// Inline function 'kotlin.apply' call
|
|
1798
1798
|
var this_1 = new TransformerBuilder();
|
|
1799
|
-
this_1.
|
|
1800
|
-
var tmp$ret$2 = this_1.
|
|
1801
|
-
tmp.
|
|
1802
|
-
var tmp_0 = scope.
|
|
1799
|
+
this_1.f1j(replaceRefinedFunctions$lambda(refined));
|
|
1800
|
+
var tmp$ret$2 = this_1.g1j();
|
|
1801
|
+
tmp.h1w_1 = transform(this_0, tmp$ret$2);
|
|
1802
|
+
var tmp_0 = scope.h1w_1;
|
|
1803
1803
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1804
1804
|
}
|
|
1805
1805
|
function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
@@ -1808,20 +1808,20 @@ function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
|
1808
1808
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1809
1809
|
var tmp = scope;
|
|
1810
1810
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1811
|
-
var this_0 = scope.
|
|
1811
|
+
var this_0 = scope.h1w_1;
|
|
1812
1812
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1813
1813
|
// Inline function 'kotlin.apply' call
|
|
1814
1814
|
var this_1 = new TransformerBuilder();
|
|
1815
|
-
this_1.
|
|
1816
|
-
var tmp$ret$2 = this_1.
|
|
1817
|
-
tmp.
|
|
1818
|
-
var tmp_0 = scope.
|
|
1815
|
+
this_1.f1j(snakeCaseHandlerAndCallMethods$lambda);
|
|
1816
|
+
var tmp$ret$2 = this_1.g1j();
|
|
1817
|
+
tmp.h1w_1 = transform(this_0, tmp$ret$2);
|
|
1818
|
+
var tmp_0 = scope.h1w_1;
|
|
1819
1819
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1820
1820
|
}
|
|
1821
1821
|
function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
1822
1822
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1823
1823
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1824
|
-
var tmp0 = _this__u8e3s4.
|
|
1824
|
+
var tmp0 = _this__u8e3s4.o1o();
|
|
1825
1825
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1826
1826
|
var destination = ArrayList_init_$Create$();
|
|
1827
1827
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1834,7 +1834,7 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1834
1834
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1835
1835
|
var namespace = ensureNotNull(tmp$ret$2);
|
|
1836
1836
|
// Inline function 'kotlin.collections.partition' call
|
|
1837
|
-
var this_0 = namespace.
|
|
1837
|
+
var this_0 = namespace.t1o_1;
|
|
1838
1838
|
var first = ArrayList_init_$Create$();
|
|
1839
1839
|
var second = ArrayList_init_$Create$();
|
|
1840
1840
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
@@ -1855,14 +1855,14 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1855
1855
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1856
1856
|
var moduleElements = _destruct__k2r9zo.ve();
|
|
1857
1857
|
var classElements = _destruct__k2r9zo.we();
|
|
1858
|
-
var endpointClass = new Namespace(namespace.
|
|
1859
|
-
return new File(namespace.
|
|
1858
|
+
var endpointClass = new Namespace(namespace.s1o_1, classElements, namespace.u1o_1);
|
|
1859
|
+
return new File(namespace.s1o_1, plus_0(moduleElements, endpointClass));
|
|
1860
1860
|
}
|
|
1861
1861
|
function flattenEndpointTypeRefs(_this__u8e3s4, endpointName) {
|
|
1862
1862
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1863
1863
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1864
|
-
scope.
|
|
1865
|
-
var tmp = scope.
|
|
1864
|
+
scope.n1w(flattenEndpointTypeRefs$lambda(endpointName));
|
|
1865
|
+
var tmp = scope.h1w_1;
|
|
1866
1866
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1867
1867
|
}
|
|
1868
1868
|
function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
@@ -1871,15 +1871,15 @@ function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
|
1871
1871
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1872
1872
|
var tmp = scope;
|
|
1873
1873
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1874
|
-
var this_0 = scope.
|
|
1874
|
+
var this_0 = scope.h1w_1;
|
|
1875
1875
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1876
1876
|
// Inline function 'kotlin.apply' call
|
|
1877
1877
|
var this_1 = new TransformerBuilder();
|
|
1878
|
-
this_1.
|
|
1879
|
-
var tmp$ret$2 = this_1.
|
|
1880
|
-
tmp.
|
|
1881
|
-
scope.
|
|
1882
|
-
var tmp_0 = scope.
|
|
1878
|
+
this_1.f1j(snakeCaseClientFunctions$lambda);
|
|
1879
|
+
var tmp$ret$2 = this_1.g1j();
|
|
1880
|
+
tmp.h1w_1 = transform(this_0, tmp$ret$2);
|
|
1881
|
+
scope.q1w(snakeCaseClientFunctions$lambda_0);
|
|
1882
|
+
var tmp_0 = scope.h1w_1;
|
|
1883
1883
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1884
1884
|
}
|
|
1885
1885
|
function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
@@ -1890,7 +1890,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1890
1890
|
} else {
|
|
1891
1891
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1892
1892
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1893
|
-
var tmp0 = tmp0_safe_receiver.
|
|
1893
|
+
var tmp0 = tmp0_safe_receiver.o1o();
|
|
1894
1894
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1895
1895
|
var destination = ArrayList_init_$Create$();
|
|
1896
1896
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1914,7 +1914,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1914
1914
|
var _iterator__ex2g4s_0 = tmp2_safe_receiver.t();
|
|
1915
1915
|
while (_iterator__ex2g4s_0.u()) {
|
|
1916
1916
|
var item = _iterator__ex2g4s_0.v();
|
|
1917
|
-
var tmp$ret$3 = item.
|
|
1917
|
+
var tmp$ret$3 = item.t1q_1.r1j();
|
|
1918
1918
|
destination_0.x(tmp$ret$3);
|
|
1919
1919
|
}
|
|
1920
1920
|
tmp_0 = destination_0;
|
|
@@ -1926,8 +1926,8 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1926
1926
|
return _this__u8e3s4;
|
|
1927
1927
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1928
1928
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1929
|
-
scope.
|
|
1930
|
-
var tmp_1 = scope.
|
|
1929
|
+
scope.q1w(addSelfReceiverToClientFields$lambda(fieldNames));
|
|
1930
|
+
var tmp_1 = scope.h1w_1;
|
|
1931
1931
|
return isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1932
1932
|
}
|
|
1933
1933
|
function replaceReflectAsTypeAny(_this__u8e3s4) {
|
|
@@ -1936,13 +1936,13 @@ function replaceReflectAsTypeAny(_this__u8e3s4) {
|
|
|
1936
1936
|
tmp = Custom_init_$Create$('type', listOf_0(Any_instance));
|
|
1937
1937
|
} else {
|
|
1938
1938
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
1939
|
-
tmp = _this__u8e3s4.
|
|
1939
|
+
tmp = _this__u8e3s4.v1n(replaceReflectAsTypeAny(_this__u8e3s4.n1j_1));
|
|
1940
1940
|
} else {
|
|
1941
1941
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
1942
|
-
tmp = _this__u8e3s4.
|
|
1942
|
+
tmp = _this__u8e3s4.v1n(replaceReflectAsTypeAny(_this__u8e3s4.o1j_1));
|
|
1943
1943
|
} else {
|
|
1944
1944
|
if (_this__u8e3s4 instanceof Dict_0) {
|
|
1945
|
-
tmp = _this__u8e3s4.
|
|
1945
|
+
tmp = _this__u8e3s4.y1n(replaceReflectAsTypeAny(_this__u8e3s4.w1n_1), replaceReflectAsTypeAny(_this__u8e3s4.x1n_1));
|
|
1946
1946
|
} else {
|
|
1947
1947
|
tmp = _this__u8e3s4;
|
|
1948
1948
|
}
|
|
@@ -1957,12 +1957,12 @@ function replaceReflectInNonGenericStructFields$lambda(element, transformer) {
|
|
|
1957
1957
|
var tmp$ret$1;
|
|
1958
1958
|
$l$block: {
|
|
1959
1959
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1960
|
-
if (!element.
|
|
1960
|
+
if (!element.c1p_1.r()) {
|
|
1961
1961
|
tmp$ret$1 = element;
|
|
1962
1962
|
break $l$block;
|
|
1963
1963
|
}
|
|
1964
1964
|
// Inline function 'kotlin.collections.map' call
|
|
1965
|
-
var this_0 = element.
|
|
1965
|
+
var this_0 = element.y1o_1;
|
|
1966
1966
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1967
1967
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1968
1968
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -1970,14 +1970,14 @@ function replaceReflectInNonGenericStructFields$lambda(element, transformer) {
|
|
|
1970
1970
|
var item = _iterator__ex2g4s.v();
|
|
1971
1971
|
var tmp_0;
|
|
1972
1972
|
if (item instanceof Field) {
|
|
1973
|
-
tmp_0 = item.
|
|
1973
|
+
tmp_0 = item.d1r(VOID, replaceReflectAsTypeAny(item.u1q_1));
|
|
1974
1974
|
} else {
|
|
1975
1975
|
tmp_0 = item;
|
|
1976
1976
|
}
|
|
1977
1977
|
var tmp$ret$2 = tmp_0;
|
|
1978
1978
|
destination.x(tmp$ret$2);
|
|
1979
1979
|
}
|
|
1980
|
-
tmp$ret$1 = element.
|
|
1980
|
+
tmp$ret$1 = element.i1p(VOID, destination);
|
|
1981
1981
|
}
|
|
1982
1982
|
tmp = tmp$ret$1;
|
|
1983
1983
|
} else {
|
|
@@ -1988,17 +1988,17 @@ function replaceReflectInNonGenericStructFields$lambda(element, transformer) {
|
|
|
1988
1988
|
}
|
|
1989
1989
|
function replaceRefinedFunctions$lambda$lambda($constraintExpr) {
|
|
1990
1990
|
return function ($this$function) {
|
|
1991
|
-
$this$function.
|
|
1992
|
-
$this$function.
|
|
1993
|
-
$this$function.
|
|
1991
|
+
$this$function.g1i('self', Custom_init_$Create$(''));
|
|
1992
|
+
$this$function.j1i(Boolean_instance_0);
|
|
1993
|
+
$this$function.k1i($constraintExpr);
|
|
1994
1994
|
return Unit_instance;
|
|
1995
1995
|
};
|
|
1996
1996
|
}
|
|
1997
1997
|
function replaceRefinedFunctions$lambda$lambda_0($toStringExpr) {
|
|
1998
1998
|
return function ($this$function) {
|
|
1999
|
-
$this$function.
|
|
2000
|
-
$this$function.
|
|
2001
|
-
$this$function.
|
|
1999
|
+
$this$function.g1i('self', Custom_init_$Create$(''));
|
|
2000
|
+
$this$function.j1i(String_instance);
|
|
2001
|
+
$this$function.k1i(new RawExpression($toStringExpr));
|
|
2002
2002
|
return Unit_instance;
|
|
2003
2003
|
};
|
|
2004
2004
|
}
|
|
@@ -2007,7 +2007,7 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
2007
2007
|
var tmp;
|
|
2008
2008
|
if (element instanceof Struct) {
|
|
2009
2009
|
// Inline function 'kotlin.collections.mapNotNull' call
|
|
2010
|
-
var tmp0 = element.
|
|
2010
|
+
var tmp0 = element.b1p_1;
|
|
2011
2011
|
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
2012
2012
|
var destination = ArrayList_init_$Create$();
|
|
2013
2013
|
// Inline function 'kotlin.collections.forEach' call
|
|
@@ -2017,7 +2017,7 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
2017
2017
|
var tmp_0;
|
|
2018
2018
|
var tmp_1;
|
|
2019
2019
|
if (element_0 instanceof Function) {
|
|
2020
|
-
tmp_1 = element_0.
|
|
2020
|
+
tmp_1 = element_0.p1l_1.equals(Companion_getInstance().s1h('validate'));
|
|
2021
2021
|
} else {
|
|
2022
2022
|
tmp_1 = false;
|
|
2023
2023
|
}
|
|
@@ -2027,7 +2027,7 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
2027
2027
|
} else {
|
|
2028
2028
|
var tmp_2;
|
|
2029
2029
|
if (element_0 instanceof Function) {
|
|
2030
|
-
tmp_2 = element_0.
|
|
2030
|
+
tmp_2 = element_0.p1l_1.equals(Companion_getInstance().s1h('toString'));
|
|
2031
2031
|
} else {
|
|
2032
2032
|
tmp_2 = false;
|
|
2033
2033
|
}
|
|
@@ -2052,7 +2052,7 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
2052
2052
|
destination.x(tmp0_safe_receiver);
|
|
2053
2053
|
}
|
|
2054
2054
|
}
|
|
2055
|
-
tmp = element.
|
|
2055
|
+
tmp = element.i1p(VOID, VOID, VOID, VOID, destination);
|
|
2056
2056
|
} else {
|
|
2057
2057
|
tmp = element;
|
|
2058
2058
|
}
|
|
@@ -2065,23 +2065,23 @@ function snakeCaseHandlerAndCallMethods$lambda(element, transformer) {
|
|
|
2065
2065
|
if (element instanceof Interface) {
|
|
2066
2066
|
var tmp$ret$0;
|
|
2067
2067
|
$l$block: {
|
|
2068
|
-
if (!element.
|
|
2068
|
+
if (!element.k1p_1.equals(Companion_getInstance().s1h('Handler')) && !element.k1p_1.equals(Companion_getInstance().s1h('Call'))) {
|
|
2069
2069
|
tmp$ret$0 = element;
|
|
2070
2070
|
break $l$block;
|
|
2071
2071
|
}
|
|
2072
2072
|
// Inline function 'kotlin.collections.map' call
|
|
2073
|
-
var this_0 = element.
|
|
2073
|
+
var this_0 = element.l1p_1;
|
|
2074
2074
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2075
2075
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2076
2076
|
var _iterator__ex2g4s = this_0.t();
|
|
2077
2077
|
while (_iterator__ex2g4s.u()) {
|
|
2078
2078
|
var item = _iterator__ex2g4s.v();
|
|
2079
2079
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
2080
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
2080
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.a1m(Companion_getInstance().s1h(item.p1l_1.k1n()));
|
|
2081
2081
|
var tmp$ret$1 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
2082
2082
|
destination.x(tmp$ret$1);
|
|
2083
2083
|
}
|
|
2084
|
-
tmp$ret$0 = element.
|
|
2084
|
+
tmp$ret$0 = element.r1p(VOID, destination);
|
|
2085
2085
|
}
|
|
2086
2086
|
tmp = tmp$ret$0;
|
|
2087
2087
|
} else {
|
|
@@ -2096,17 +2096,17 @@ function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
|
2096
2096
|
if (!(type instanceof Custom_0)) {
|
|
2097
2097
|
tmp = type;
|
|
2098
2098
|
} else {
|
|
2099
|
-
if (!startsWith(type.
|
|
2099
|
+
if (!startsWith(type.p1j_1.t1h(), $endpointName + '.')) {
|
|
2100
2100
|
tmp = type;
|
|
2101
2101
|
} else {
|
|
2102
|
-
var suffix = removePrefix(type.
|
|
2102
|
+
var suffix = removePrefix(type.p1j_1.t1h(), $endpointName + '.');
|
|
2103
2103
|
switch (suffix) {
|
|
2104
2104
|
case 'Call':
|
|
2105
2105
|
case 'Handler':
|
|
2106
2106
|
tmp = type;
|
|
2107
2107
|
break;
|
|
2108
2108
|
default:
|
|
2109
|
-
tmp = type.
|
|
2109
|
+
tmp = type.a1o(Companion_getInstance().s1h(suffix));
|
|
2110
2110
|
break;
|
|
2111
2111
|
}
|
|
2112
2112
|
}
|
|
@@ -2117,7 +2117,7 @@ function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
|
2117
2117
|
function snakeCaseClientFunctions$lambda(element, transformer) {
|
|
2118
2118
|
var tmp;
|
|
2119
2119
|
if (element instanceof Function) {
|
|
2120
|
-
tmp = element.
|
|
2120
|
+
tmp = element.a1m(Companion_getInstance().s1h(element.p1l_1.k1n()), VOID, plus(listOf_0(new Parameter(Companion_getInstance().s1h('self'), Custom_init_$Create$(''))), element.r1l_1));
|
|
2121
2121
|
} else {
|
|
2122
2122
|
tmp = element;
|
|
2123
2123
|
}
|
|
@@ -2127,19 +2127,19 @@ function snakeCaseClientFunctions$lambda(element, transformer) {
|
|
|
2127
2127
|
function snakeCaseClientFunctions$lambda_0(stmt, tr) {
|
|
2128
2128
|
var tmp;
|
|
2129
2129
|
if (stmt instanceof FunctionCall) {
|
|
2130
|
-
var nameStr = stmt.
|
|
2131
|
-
var newName = contains(nameStr, '.') ? stmt.
|
|
2132
|
-
var tmp1_safe_receiver = stmt.
|
|
2130
|
+
var nameStr = stmt.o1n_1.r1j();
|
|
2131
|
+
var newName = contains(nameStr, '.') ? stmt.o1n_1 : Companion_getInstance().s1h(Companion_getInstance().s1h(nameStr).k1n());
|
|
2132
|
+
var tmp1_safe_receiver = stmt.m1n_1;
|
|
2133
2133
|
var tmp_0;
|
|
2134
2134
|
if (tmp1_safe_receiver == null) {
|
|
2135
2135
|
tmp_0 = null;
|
|
2136
2136
|
} else {
|
|
2137
2137
|
// Inline function 'kotlin.let' call
|
|
2138
|
-
tmp_0 = tr.
|
|
2138
|
+
tmp_0 = tr.c1w(tmp1_safe_receiver);
|
|
2139
2139
|
}
|
|
2140
2140
|
var tmp2_receiver = tmp_0;
|
|
2141
2141
|
// Inline function 'kotlin.collections.mapValues' call
|
|
2142
|
-
var this_0 = stmt.
|
|
2142
|
+
var this_0 = stmt.p1n_1;
|
|
2143
2143
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
2144
2144
|
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.a1()));
|
|
2145
2145
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
@@ -2149,10 +2149,10 @@ function snakeCaseClientFunctions$lambda_0(stmt, tr) {
|
|
|
2149
2149
|
var tmp_1 = element.k1();
|
|
2150
2150
|
// Inline function 'kotlin.collections.component2' call
|
|
2151
2151
|
var v = element.l1();
|
|
2152
|
-
var tmp$ret$4 = tr.
|
|
2152
|
+
var tmp$ret$4 = tr.c1w(v);
|
|
2153
2153
|
destination.s2(tmp_1, tmp$ret$4);
|
|
2154
2154
|
}
|
|
2155
|
-
var tmp4_isAwait = !(stmt.
|
|
2155
|
+
var tmp4_isAwait = !(stmt.m1n_1 == null);
|
|
2156
2156
|
tmp = new FunctionCall(tmp2_receiver, VOID, newName, destination, tmp4_isAwait);
|
|
2157
2157
|
} else {
|
|
2158
2158
|
tmp = transformChildren(stmt, tr);
|
|
@@ -2165,28 +2165,28 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
2165
2165
|
var tmp_0;
|
|
2166
2166
|
var tmp_1;
|
|
2167
2167
|
if (stmt instanceof FieldCall) {
|
|
2168
|
-
tmp_1 = stmt.
|
|
2168
|
+
tmp_1 = stmt.p1r_1 == null;
|
|
2169
2169
|
} else {
|
|
2170
2170
|
tmp_1 = false;
|
|
2171
2171
|
}
|
|
2172
2172
|
if (tmp_1) {
|
|
2173
|
-
tmp_0 = $fieldNames.u1(stmt.
|
|
2173
|
+
tmp_0 = $fieldNames.u1(stmt.q1r_1.r1j());
|
|
2174
2174
|
} else {
|
|
2175
2175
|
tmp_0 = false;
|
|
2176
2176
|
}
|
|
2177
2177
|
if (tmp_0) {
|
|
2178
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().s1h('self')), stmt.
|
|
2178
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().s1h('self')), stmt.q1r_1);
|
|
2179
2179
|
} else {
|
|
2180
2180
|
if (stmt instanceof FieldCall) {
|
|
2181
|
-
var tmp0_safe_receiver = stmt.
|
|
2181
|
+
var tmp0_safe_receiver = stmt.p1r_1;
|
|
2182
2182
|
var tmp_2;
|
|
2183
2183
|
if (tmp0_safe_receiver == null) {
|
|
2184
2184
|
tmp_2 = null;
|
|
2185
2185
|
} else {
|
|
2186
2186
|
// Inline function 'kotlin.let' call
|
|
2187
|
-
tmp_2 = tr.
|
|
2187
|
+
tmp_2 = tr.c1w(tmp0_safe_receiver);
|
|
2188
2188
|
}
|
|
2189
|
-
tmp = new FieldCall(tmp_2, stmt.
|
|
2189
|
+
tmp = new FieldCall(tmp_2, stmt.q1r_1);
|
|
2190
2190
|
} else {
|
|
2191
2191
|
tmp = transformChildren(stmt, tr);
|
|
2192
2192
|
}
|
|
@@ -2197,8 +2197,8 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
2197
2197
|
function PythonRefinedTypeDefinitionEmitter() {
|
|
2198
2198
|
}
|
|
2199
2199
|
function PythonShared() {
|
|
2200
|
-
this.
|
|
2201
|
-
this.
|
|
2200
|
+
this.z1z_1 = 'shared';
|
|
2201
|
+
this.a20_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";
|
|
2202
2202
|
}
|
|
2203
2203
|
protoOf(PythonShared).toString = function () {
|
|
2204
2204
|
return 'PythonShared';
|
|
@@ -2219,12 +2219,12 @@ function PythonShared_getInstance() {
|
|
|
2219
2219
|
}
|
|
2220
2220
|
function PythonTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
2221
2221
|
return function (it) {
|
|
2222
|
-
return this$0.
|
|
2222
|
+
return this$0.e20(it);
|
|
2223
2223
|
};
|
|
2224
2224
|
}
|
|
2225
2225
|
function PythonTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2226
2226
|
return function (it) {
|
|
2227
|
-
return this$0.
|
|
2227
|
+
return this$0.e20(it);
|
|
2228
2228
|
};
|
|
2229
2229
|
}
|
|
2230
2230
|
function PythonTypeDefinitionEmitter$emit$lambda_1(this$0) {
|
|
@@ -2237,28 +2237,28 @@ function PythonTypeDefinitionEmitter() {
|
|
|
2237
2237
|
function PythonUnionDefinitionEmitter() {
|
|
2238
2238
|
}
|
|
2239
2239
|
//region block: post-declaration
|
|
2240
|
-
protoOf(PythonEmitter).lq =
|
|
2241
|
-
protoOf(PythonEmitter).mq =
|
|
2242
|
-
protoOf(PythonEmitter).nq =
|
|
2243
|
-
protoOf(PythonEmitter).oq =
|
|
2244
|
-
protoOf(PythonEmitter).pq =
|
|
2245
|
-
protoOf(PythonEmitter).as =
|
|
2240
|
+
protoOf(PythonEmitter).lq = emit_5;
|
|
2241
|
+
protoOf(PythonEmitter).mq = emit_6;
|
|
2242
|
+
protoOf(PythonEmitter).nq = emit_7;
|
|
2243
|
+
protoOf(PythonEmitter).oq = emit_8;
|
|
2244
|
+
protoOf(PythonEmitter).pq = emit_10;
|
|
2245
|
+
protoOf(PythonEmitter).as = emit_14;
|
|
2246
2246
|
protoOf(PythonEmitter).vr = emit_15;
|
|
2247
|
-
protoOf(PythonEmitter).bs =
|
|
2248
|
-
protoOf(PythonEmitter).qr =
|
|
2247
|
+
protoOf(PythonEmitter).bs = emit_11;
|
|
2248
|
+
protoOf(PythonEmitter).qr = emit_4;
|
|
2249
2249
|
protoOf(PythonEmitter).or = emit_3;
|
|
2250
2250
|
protoOf(PythonEmitter).pr = emit_2;
|
|
2251
|
-
protoOf(PythonEmitter).
|
|
2252
|
-
protoOf(PythonEmitter).
|
|
2253
|
-
protoOf(PythonEmitter).
|
|
2251
|
+
protoOf(PythonEmitter).b20 = emit_9;
|
|
2252
|
+
protoOf(PythonEmitter).i1y = emit_12;
|
|
2253
|
+
protoOf(PythonEmitter).c20 = emit_13;
|
|
2254
2254
|
protoOf(PythonEmitter).cs = emitValidator;
|
|
2255
|
-
protoOf(PythonEmitter).
|
|
2256
|
-
protoOf(PythonEmitter).
|
|
2257
|
-
protoOf(PythonEmitter).
|
|
2258
|
-
protoOf(PythonEmitter).
|
|
2259
|
-
protoOf(PythonIrEmitter).
|
|
2255
|
+
protoOf(PythonEmitter).v1y = sanitize;
|
|
2256
|
+
protoOf(PythonEmitter).l1y = sanitizeKeywords;
|
|
2257
|
+
protoOf(PythonEmitter).d20 = emitType;
|
|
2258
|
+
protoOf(PythonEmitter).e20 = emitReferenceCustomImports;
|
|
2259
|
+
protoOf(PythonIrEmitter).w1w = get_extensions;
|
|
2260
2260
|
protoOf(PythonIrEmitter).eo = emit_1;
|
|
2261
|
-
protoOf(PythonIrEmitter).
|
|
2261
|
+
protoOf(PythonIrEmitter).b1x = beforeGenerate;
|
|
2262
2262
|
//endregion
|
|
2263
2263
|
//region block: init
|
|
2264
2264
|
PythonShared_instance = new PythonShared();
|