@flock/wirespec 0.19.2 → 0.19.3-RC.1
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/arrow-arrow-atomic.mjs +12 -12
- package/arrow-arrow-core.mjs +167 -167
- package/clikt-clikt-mordant.mjs +81 -81
- package/clikt-clikt-mordant.mjs.map +1 -1
- package/clikt-clikt.mjs +1636 -1636
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +448 -448
- package/kotest-kotest-assertions-kotest-assertions-core.mjs +4 -0
- package/kotest-kotest-assertions-kotest-assertions-core.mjs.map +1 -0
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs +4 -0
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs.map +1 -0
- package/kotest-kotest-common.mjs +56 -0
- package/kotest-kotest-common.mjs.map +1 -0
- package/kotest-kotest-framework-kotest-framework-engine.mjs +4 -0
- package/kotest-kotest-framework-kotest-framework-engine.mjs.map +1 -0
- package/kotest-kotest-property.mjs +2501 -0
- package/kotest-kotest-property.mjs.map +1 -0
- package/kotlin-kotlin-stdlib.mjs +5269 -2487
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10266 -10266
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1846 -1846
- package/kotlin-rgxgen.mjs.map +1 -1
- package/kotlinx-coroutines-test.mjs +4 -0
- package/kotlinx-coroutines-test.mjs.map +1 -0
- package/kotlinx-io-kotlinx-io-core.mjs +455 -455
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +2132 -2098
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1579 -1579
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1435 -1435
- package/package.json +5 -1
- package/wirespec-generator.d.ts +51 -0
- package/wirespec-generator.mjs +9 -0
- package/wirespec-src-compiler-core.mjs +1597 -1597
- package/wirespec-src-compiler-emitters-java.mjs +451 -451
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +371 -371
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +456 -456
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +481 -481
- package/wirespec-src-compiler-emitters-scala.mjs +193 -193
- package/wirespec-src-compiler-emitters-typescript.mjs +526 -526
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +85 -85
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3913 -3857
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +439 -439
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +521 -521
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +859 -859
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +1387 -1387
- package/wirespec-src-ide-lsp.mjs.map +1 -1
- package/wirespec-src-integration-kotest.mjs +1647 -0
- package/wirespec-src-integration-kotest.mjs.map +1 -0
- package/wirespec-src-plugin-arguments.mjs +192 -192
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +109 -109
- package/wirespec-src-plugin-npm.d.mts +21 -0
- package/wirespec-src-plugin-npm.mjs +43 -43
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +35 -35
- package/wirespec-src-tools-generator.mjs.map +1 -1
- package/xmlutil-core.mjs +4 -0
- package/xmlutil-core.mjs.map +1 -0
- package/xmlutil-serialization.mjs +4 -0
- package/xmlutil-serialization.mjs.map +1 -0
|
@@ -206,10 +206,10 @@ initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, V
|
|
|
206
206
|
function emit_3(identifier) {
|
|
207
207
|
var tmp;
|
|
208
208
|
if (identifier instanceof DefinitionIdentifier) {
|
|
209
|
-
tmp = this.
|
|
209
|
+
tmp = this.d21(identifier);
|
|
210
210
|
} else {
|
|
211
211
|
if (identifier instanceof FieldIdentifier) {
|
|
212
|
-
tmp = this.
|
|
212
|
+
tmp = this.t20(this.d21(identifier));
|
|
213
213
|
} else {
|
|
214
214
|
noWhenBranchMatchedException();
|
|
215
215
|
}
|
|
@@ -218,7 +218,7 @@ function emit_3(identifier) {
|
|
|
218
218
|
}
|
|
219
219
|
function sanitize(_this__u8e3s4) {
|
|
220
220
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
221
|
-
var this_0 = split(_this__u8e3s4.
|
|
221
|
+
var this_0 = split(_this__u8e3s4.m1(), ['.', ' ']);
|
|
222
222
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
223
223
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
224
224
|
var index = 0;
|
|
@@ -227,8 +227,8 @@ function sanitize(_this__u8e3s4) {
|
|
|
227
227
|
var item = _iterator__ex2g4s.v();
|
|
228
228
|
var _unary__edvuaz = index;
|
|
229
229
|
index = _unary__edvuaz + 1 | 0;
|
|
230
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
231
|
-
destination.
|
|
230
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.pu(item) : item;
|
|
231
|
+
destination.y(tmp$ret$0);
|
|
232
232
|
}
|
|
233
233
|
// Inline function 'kotlin.text.filter' call
|
|
234
234
|
var tmp0 = joinToString(destination, '');
|
|
@@ -265,42 +265,42 @@ function sanitize(_this__u8e3s4) {
|
|
|
265
265
|
return tmp;
|
|
266
266
|
}
|
|
267
267
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
268
|
-
return Companion_getInstance_0().
|
|
268
|
+
return Companion_getInstance_0().n22_1.v1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
269
269
|
}
|
|
270
270
|
initMetadataForInterface(PythonIdentifierEmitter, 'PythonIdentifierEmitter');
|
|
271
271
|
function emit_4(type, module_0) {
|
|
272
272
|
var tmp;
|
|
273
|
-
if (type.
|
|
274
|
-
var tmp_0 = this.
|
|
273
|
+
if (type.xs_1.ts_1.r()) {
|
|
274
|
+
var tmp_0 = this.yu(type.ws_1);
|
|
275
275
|
var tmp_1 = Spacer_instance.toString();
|
|
276
276
|
var tmp_2 = importReferences(type);
|
|
277
277
|
tmp = trimMargin('\n |@dataclass\n |class ' + tmp_0 + ':\n |' + tmp_1 + 'pass\n |\n |' + joinToString(tmp_2, '\n', VOID, VOID, VOID, VOID, PythonTypeDefinitionEmitter$emit$lambda(this)) + '\n |\n ');
|
|
278
278
|
} else {
|
|
279
|
-
var tmp_3 = this.
|
|
280
|
-
var tmp_4 = this.
|
|
279
|
+
var tmp_3 = this.yu(type.ws_1);
|
|
280
|
+
var tmp_4 = this.wt(type.xs_1);
|
|
281
281
|
var tmp_5 = importReferences(type);
|
|
282
282
|
tmp = trimMargin('\n |@dataclass\n |class ' + tmp_3 + ':\n |' + tmp_4 + '\n |\n |' + joinToString(tmp_5, '\n', VOID, VOID, VOID, VOID, PythonTypeDefinitionEmitter$emit$lambda_0(this)) + '\n ');
|
|
283
283
|
}
|
|
284
284
|
return tmp;
|
|
285
285
|
}
|
|
286
286
|
function emit_5(_this__u8e3s4) {
|
|
287
|
-
return joinToString(_this__u8e3s4.
|
|
287
|
+
return joinToString(_this__u8e3s4.ts_1, '\n', VOID, VOID, VOID, VOID, PythonTypeDefinitionEmitter$emit$lambda_1(this));
|
|
288
288
|
}
|
|
289
289
|
function emit_6(_this__u8e3s4) {
|
|
290
|
-
return this.
|
|
290
|
+
return this.yu(_this__u8e3s4.bt_1) + ": '" + this.yt(_this__u8e3s4.ct_1) + "'";
|
|
291
291
|
}
|
|
292
292
|
function emit_7(_this__u8e3s4) {
|
|
293
293
|
// Inline function 'kotlin.let' call
|
|
294
|
-
var it = this.
|
|
295
|
-
return _this__u8e3s4.
|
|
294
|
+
var it = this.l22(_this__u8e3s4);
|
|
295
|
+
return _this__u8e3s4.ey() ? 'Optional[' + it + ']' : it;
|
|
296
296
|
}
|
|
297
297
|
function emitType(_this__u8e3s4) {
|
|
298
298
|
var tmp;
|
|
299
299
|
if (_this__u8e3s4 instanceof Dict) {
|
|
300
|
-
tmp = 'Dict[str, ' + this.
|
|
300
|
+
tmp = 'Dict[str, ' + this.yt(_this__u8e3s4.ds_1) + ']';
|
|
301
301
|
} else {
|
|
302
302
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
303
|
-
tmp = 'List[' + this.
|
|
303
|
+
tmp = 'List[' + this.yt(_this__u8e3s4.as_1) + ']';
|
|
304
304
|
} else {
|
|
305
305
|
if (_this__u8e3s4 instanceof Unit) {
|
|
306
306
|
tmp = 'None';
|
|
@@ -309,10 +309,10 @@ function emitType(_this__u8e3s4) {
|
|
|
309
309
|
tmp = 'Any';
|
|
310
310
|
} else {
|
|
311
311
|
if (_this__u8e3s4 instanceof Custom) {
|
|
312
|
-
tmp = _this__u8e3s4.
|
|
312
|
+
tmp = _this__u8e3s4.my_1;
|
|
313
313
|
} else {
|
|
314
314
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
315
|
-
tmp = this.
|
|
315
|
+
tmp = this.j22(_this__u8e3s4.qy_1);
|
|
316
316
|
} else {
|
|
317
317
|
noWhenBranchMatchedException();
|
|
318
318
|
}
|
|
@@ -351,10 +351,10 @@ function emit_8(_this__u8e3s4) {
|
|
|
351
351
|
function emit_9(_this__u8e3s4) {
|
|
352
352
|
var tmp;
|
|
353
353
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
354
|
-
tmp = 'bool(re.match(r"' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.
|
|
354
|
+
tmp = 'bool(re.match(r"' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.ax_1) + '", self.value))';
|
|
355
355
|
} else {
|
|
356
356
|
if (_this__u8e3s4 instanceof Bound) {
|
|
357
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
357
|
+
var tmp1_safe_receiver = _this__u8e3s4.qx_1;
|
|
358
358
|
var tmp_0;
|
|
359
359
|
if (tmp1_safe_receiver == null) {
|
|
360
360
|
tmp_0 = null;
|
|
@@ -363,7 +363,7 @@ function emit_9(_this__u8e3s4) {
|
|
|
363
363
|
tmp_0 = tmp1_safe_receiver + ' < self.value';
|
|
364
364
|
}
|
|
365
365
|
var minCheck = tmp_0;
|
|
366
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
366
|
+
var tmp2_safe_receiver = _this__u8e3s4.rx_1;
|
|
367
367
|
var tmp_1;
|
|
368
368
|
if (tmp2_safe_receiver == null) {
|
|
369
369
|
tmp_1 = null;
|
|
@@ -389,26 +389,70 @@ function emit_9(_this__u8e3s4) {
|
|
|
389
389
|
return tmp;
|
|
390
390
|
}
|
|
391
391
|
function emitReferenceCustomImports(_this__u8e3s4) {
|
|
392
|
-
return 'from ..model.' + _this__u8e3s4.
|
|
392
|
+
return 'from ..model.' + _this__u8e3s4.my_1 + ' import ' + _this__u8e3s4.my_1;
|
|
393
393
|
}
|
|
394
394
|
initMetadataForInterface(PythonTypeDefinitionEmitter, 'PythonTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
395
|
-
function emit_10(
|
|
395
|
+
function emit_10(refined) {
|
|
396
|
+
return trimMargin('\n |@dataclass\n |class ' + this.d21(refined.dv_1) + '(Wirespec.Refined):\n |' + Spacer_instance.toString() + 'value: ' + this.l22(refined.ev_1) + '\n |\n |' + Spacer_instance.toString() + 'def validate(self) -> bool:\n |' + Spacer_instance.sv(2) + 'return ' + this.mv(refined) + '\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.sv(2) + 'return str(self.value)\n |\n ');
|
|
397
|
+
}
|
|
398
|
+
function emitValidator(_this__u8e3s4) {
|
|
399
|
+
var defaultReturn = 'True';
|
|
400
|
+
var type = _this__u8e3s4.ev_1.qy_1;
|
|
401
|
+
var tmp;
|
|
402
|
+
if (type instanceof Integer) {
|
|
403
|
+
var tmp0_safe_receiver = type.vx_1;
|
|
404
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.zt(tmp0_safe_receiver);
|
|
405
|
+
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
406
|
+
} else {
|
|
407
|
+
if (type instanceof Number_0) {
|
|
408
|
+
var tmp2_safe_receiver = type.yx_1;
|
|
409
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.zt(tmp2_safe_receiver);
|
|
410
|
+
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
411
|
+
} else {
|
|
412
|
+
if (type instanceof String_0) {
|
|
413
|
+
var tmp4_safe_receiver = type.sx_1;
|
|
414
|
+
var tmp_0;
|
|
415
|
+
var tmp_1 = tmp4_safe_receiver;
|
|
416
|
+
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
417
|
+
tmp_0 = null;
|
|
418
|
+
} else {
|
|
419
|
+
tmp_0 = this.zt(new RegExp_0(tmp4_safe_receiver));
|
|
420
|
+
}
|
|
421
|
+
var tmp5_elvis_lhs = tmp_0;
|
|
422
|
+
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
423
|
+
} else {
|
|
424
|
+
if (equals(type, Boolean_instance)) {
|
|
425
|
+
tmp = defaultReturn;
|
|
426
|
+
} else {
|
|
427
|
+
if (equals(type, Bytes_instance)) {
|
|
428
|
+
tmp = defaultReturn;
|
|
429
|
+
} else {
|
|
430
|
+
noWhenBranchMatchedException();
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
return tmp;
|
|
437
|
+
}
|
|
438
|
+
initMetadataForInterface(PythonRefinedTypeDefinitionEmitter, 'PythonRefinedTypeDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
439
|
+
function emit_11(endpoint) {
|
|
396
440
|
var tmp = importReferences(endpoint);
|
|
397
441
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda(this));
|
|
398
|
-
var tmp_1 = this.
|
|
399
|
-
var tmp_2 = spacer(this.
|
|
400
|
-
var tmp_3 = distinctByStatus(endpoint.
|
|
442
|
+
var tmp_1 = this.yu(endpoint.ft_1);
|
|
443
|
+
var tmp_2 = spacer(this.q20(first(endpoint.kt_1), endpoint), 1);
|
|
444
|
+
var tmp_3 = distinctByStatus(endpoint.lt_1);
|
|
401
445
|
return trimMargin('\n |' + tmp_0 + '\n |\n |class ' + tmp_1 + ' (Wirespec.Endpoint):\n |' + tmp_2 + '\n |' + spacer(joinToString(tmp_3, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda_0(this, endpoint)), 1) + '\n |' + spacer(emitResponseUnion(this, endpoint), 1) + '\n |' + spacer(emitHandleClass(this, endpoint), 1) + '\n |' + spacer(emitConvertClass(this, endpoint), 1) + '\n |\n ');
|
|
402
446
|
}
|
|
403
|
-
function
|
|
404
|
-
var tmp = emit_18(this, _this__u8e3s4.
|
|
447
|
+
function emit_12(_this__u8e3s4, endpoint) {
|
|
448
|
+
var tmp = emit_18(this, _this__u8e3s4.ot_1);
|
|
405
449
|
var tmp_0 = get_pathParams(endpoint);
|
|
406
450
|
var tmp_1 = emitObject$default(this, tmp_0, 'Path', 'Wirespec.Request.Path', VOID, PythonEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
407
|
-
var tmp_2 = emitObject$default(this, endpoint.
|
|
408
|
-
var tmp_3 = emitObject$default(this, endpoint.
|
|
451
|
+
var tmp_2 = emitObject$default(this, endpoint.it_1, 'Queries', 'Wirespec.Request.Queries', VOID, PythonEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
452
|
+
var tmp_3 = emitObject$default(this, endpoint.jt_1, 'Headers', 'Wirespec.Request.Headers', VOID, PythonEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
409
453
|
var tmp_4 = Spacer_instance.toString();
|
|
410
454
|
var tmp_5 = Spacer_instance.toString();
|
|
411
|
-
var tmp_6 = emit_18(this, _this__u8e3s4.
|
|
455
|
+
var tmp_6 = emit_18(this, _this__u8e3s4.ot_1);
|
|
412
456
|
var tmp_7 = Spacer_instance.toString();
|
|
413
457
|
var tmp_8 = Spacer_instance.toString();
|
|
414
458
|
var tmp_9 = Spacer_instance.toString();
|
|
@@ -424,90 +468,46 @@ function emit_11(_this__u8e3s4, endpoint) {
|
|
|
424
468
|
var tmp_19 = Spacer_instance.toString();
|
|
425
469
|
var tmp_20 = Spacer_instance.toString();
|
|
426
470
|
var tmp_21 = Spacer_instance.toString();
|
|
427
|
-
var tmp_22 = emit_18(this, _this__u8e3s4.
|
|
471
|
+
var tmp_22 = emit_18(this, _this__u8e3s4.ot_1);
|
|
428
472
|
var tmp_23 = Spacer_instance.toString();
|
|
429
473
|
var tmp_24 = Spacer_instance.toString();
|
|
430
474
|
var tmp_25 = Spacer_instance.toString();
|
|
431
475
|
var tmp_26 = Spacer_instance.toString();
|
|
432
476
|
var tmp_27 = Spacer_instance.toString();
|
|
433
477
|
var tmp_28 = paramList(_this__u8e3s4, endpoint);
|
|
434
|
-
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.
|
|
478
|
+
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.gt_1.b3_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 ');
|
|
435
479
|
}
|
|
436
|
-
function
|
|
437
|
-
var tmp = emit_18(this, _this__u8e3s4.
|
|
438
|
-
var tmp_0 = emitObject$default(this, _this__u8e3s4.
|
|
480
|
+
function emit_13(_this__u8e3s4, endpoint) {
|
|
481
|
+
var tmp = emit_18(this, _this__u8e3s4.tt_1);
|
|
482
|
+
var tmp_0 = emitObject$default(this, _this__u8e3s4.st_1, 'Headers', 'Wirespec.Response.Headers', VOID, PythonEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
439
483
|
var tmp_1 = Spacer_instance.toString();
|
|
440
484
|
var tmp_2 = Spacer_instance.toString();
|
|
441
485
|
var tmp_3 = Spacer_instance.toString();
|
|
442
486
|
var tmp_4 = Spacer_instance.toString();
|
|
443
487
|
var tmp_5 = Spacer_instance.toString();
|
|
444
488
|
var tmp_6 = Spacer_instance.toString();
|
|
445
|
-
var tmp_7 = emit_18(this, _this__u8e3s4.
|
|
489
|
+
var tmp_7 = emit_18(this, _this__u8e3s4.tt_1);
|
|
446
490
|
var tmp_8 = Spacer_instance.toString();
|
|
447
491
|
var tmp_9 = Spacer_instance.toString();
|
|
448
492
|
var tmp_10 = Spacer_instance.toString();
|
|
449
|
-
var tmp_11 = emit_18(this, _this__u8e3s4.
|
|
493
|
+
var tmp_11 = emit_18(this, _this__u8e3s4.tt_1);
|
|
450
494
|
var tmp_12 = Spacer_instance.toString();
|
|
451
495
|
var tmp_13 = Spacer_instance.toString();
|
|
452
496
|
var tmp_14 = Spacer_instance.toString();
|
|
453
497
|
var tmp_15 = paramList_0(_this__u8e3s4);
|
|
454
|
-
return trimMargin('\n |@dataclass\n |class Response' + _this__u8e3s4.
|
|
498
|
+
return trimMargin('\n |@dataclass\n |class Response' + _this__u8e3s4.rt_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.rt_1 + '\n |\n |' + tmp_14 + 'def __init__(self, ' + joinToString(tmp_15, ', ', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda_6(this)) + '):\n |' + spacer(emitAssignSelf_1(this, _this__u8e3s4, endpoint), 2) + '\n |\n ');
|
|
455
499
|
}
|
|
456
500
|
initMetadataForInterface(PythonEndpointDefinitionEmitter, 'PythonEndpointDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter]);
|
|
457
|
-
function emit_13(enum_0, module_0) {
|
|
458
|
-
var tmp = this.r1x(enum_0.xr_1);
|
|
459
|
-
return trimMargin('\n |class ' + tmp + '(str, Enum):\n |' + joinToString(enum_0.yr_1, '\n', VOID, VOID, VOID, VOID, PythonEnumDefinitionEmitter$emit$lambda(this)) + '\n |\n |' + Spacer_instance.toString() + '@property\n |' + Spacer_instance.toString() + 'def label(self) -> str:\n |' + Spacer_instance.hs(2) + 'return self.value\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.hs(2) + 'return self.value\n ');
|
|
460
|
-
}
|
|
461
|
-
initMetadataForInterface(PythonEnumDefinitionEmitter, 'PythonEnumDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
462
501
|
function emit_14(union) {
|
|
463
|
-
return trimMargin('\n |class ' + this.
|
|
502
|
+
return trimMargin('\n |class ' + this.yu(union.rs_1) + '(ABC):\n |' + Spacer_instance.toString() + 'pass\n ');
|
|
464
503
|
}
|
|
465
504
|
initMetadataForInterface(PythonUnionDefinitionEmitter, 'PythonUnionDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
466
|
-
function emit_15(
|
|
467
|
-
|
|
505
|
+
function emit_15(enum_0, module_0) {
|
|
506
|
+
var tmp = this.d21(enum_0.iv_1);
|
|
507
|
+
return trimMargin('\n |class ' + tmp + '(str, Enum):\n |' + joinToString(enum_0.jv_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.sv(2) + 'return self.value\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.sv(2) + 'return self.value\n ');
|
|
468
508
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
var type = _this__u8e3s4.tr_1.fv_1;
|
|
472
|
-
var tmp;
|
|
473
|
-
if (type instanceof Integer) {
|
|
474
|
-
var tmp0_safe_receiver = type.ku_1;
|
|
475
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.oq(tmp0_safe_receiver);
|
|
476
|
-
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
477
|
-
} else {
|
|
478
|
-
if (type instanceof Number_0) {
|
|
479
|
-
var tmp2_safe_receiver = type.nu_1;
|
|
480
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.oq(tmp2_safe_receiver);
|
|
481
|
-
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
482
|
-
} else {
|
|
483
|
-
if (type instanceof String_0) {
|
|
484
|
-
var tmp4_safe_receiver = type.hu_1;
|
|
485
|
-
var tmp_0;
|
|
486
|
-
var tmp_1 = tmp4_safe_receiver;
|
|
487
|
-
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
488
|
-
tmp_0 = null;
|
|
489
|
-
} else {
|
|
490
|
-
tmp_0 = this.oq(new RegExp_0(tmp4_safe_receiver));
|
|
491
|
-
}
|
|
492
|
-
var tmp5_elvis_lhs = tmp_0;
|
|
493
|
-
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
494
|
-
} else {
|
|
495
|
-
if (equals(type, Boolean_instance)) {
|
|
496
|
-
tmp = defaultReturn;
|
|
497
|
-
} else {
|
|
498
|
-
if (equals(type, Bytes_instance)) {
|
|
499
|
-
tmp = defaultReturn;
|
|
500
|
-
} else {
|
|
501
|
-
noWhenBranchMatchedException();
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
return tmp;
|
|
508
|
-
}
|
|
509
|
-
initMetadataForInterface(PythonRefinedTypeDefinitionEmitter, 'PythonRefinedTypeDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
510
|
-
initMetadataForClass(PythonEmitter, 'PythonEmitter', PythonEmitter, LanguageEmitter, [LanguageEmitter, PythonIdentifierEmitter, PythonEndpointDefinitionEmitter, PythonChannelDefinitionEmitter, PythonEnumDefinitionEmitter, PythonUnionDefinitionEmitter, PythonRefinedTypeDefinitionEmitter, PythonTypeDefinitionEmitter]);
|
|
509
|
+
initMetadataForInterface(PythonEnumDefinitionEmitter, 'PythonEnumDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
510
|
+
initMetadataForClass(PythonEmitter, 'PythonEmitter', PythonEmitter, LanguageEmitter, [LanguageEmitter, PythonRefinedTypeDefinitionEmitter, PythonEndpointDefinitionEmitter, PythonUnionDefinitionEmitter, PythonTypeDefinitionEmitter, PythonChannelDefinitionEmitter, PythonIdentifierEmitter, PythonEnumDefinitionEmitter]);
|
|
511
511
|
initMetadataForCompanion(Companion);
|
|
512
512
|
initMetadataForCompanion(Companion_0);
|
|
513
513
|
initMetadataForClass(sam$kotlin_Comparator$0_0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
|
|
@@ -517,23 +517,23 @@ initMetadataForObject(PythonShared, 'PythonShared');
|
|
|
517
517
|
function PythonChannelDefinitionEmitter() {
|
|
518
518
|
}
|
|
519
519
|
function sam$kotlin_Comparator$0(function_0) {
|
|
520
|
-
this.
|
|
520
|
+
this.z21_1 = function_0;
|
|
521
521
|
}
|
|
522
|
-
protoOf(sam$kotlin_Comparator$0).
|
|
523
|
-
return this.
|
|
522
|
+
protoOf(sam$kotlin_Comparator$0).ud = function (a, b) {
|
|
523
|
+
return this.z21_1(a, b);
|
|
524
524
|
};
|
|
525
525
|
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
526
|
-
return this.
|
|
526
|
+
return this.ud(a, b);
|
|
527
527
|
};
|
|
528
|
-
protoOf(sam$kotlin_Comparator$0).
|
|
529
|
-
return this.
|
|
528
|
+
protoOf(sam$kotlin_Comparator$0).m3 = function () {
|
|
529
|
+
return this.z21_1;
|
|
530
530
|
};
|
|
531
531
|
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
532
532
|
var tmp;
|
|
533
533
|
if (!(other == null) ? isInterface(other, Comparator) : false) {
|
|
534
534
|
var tmp_0;
|
|
535
535
|
if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
|
|
536
|
-
tmp_0 = equals(this.
|
|
536
|
+
tmp_0 = equals(this.m3(), other.m3());
|
|
537
537
|
} else {
|
|
538
538
|
tmp_0 = false;
|
|
539
539
|
}
|
|
@@ -544,40 +544,40 @@ protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
|
544
544
|
return tmp;
|
|
545
545
|
};
|
|
546
546
|
protoOf(sam$kotlin_Comparator$0).hashCode = function () {
|
|
547
|
-
return hashCode(this.
|
|
547
|
+
return hashCode(this.m3());
|
|
548
548
|
};
|
|
549
549
|
function PythonEmitter$emit$lambda(this$0) {
|
|
550
550
|
return function (a, b) {
|
|
551
551
|
// Inline function 'kotlin.comparisons.compareValuesBy' call
|
|
552
|
-
var tmp = this$0.
|
|
553
|
-
var tmp$ret$1 = this$0.
|
|
552
|
+
var tmp = this$0.g22(a);
|
|
553
|
+
var tmp$ret$1 = this$0.g22(b);
|
|
554
554
|
return compareValues(tmp, tmp$ret$1);
|
|
555
555
|
};
|
|
556
556
|
}
|
|
557
557
|
function emit$emitInit(this$0, def) {
|
|
558
|
-
return 'from .' + this$0.
|
|
558
|
+
return 'from .' + this$0.yu(def.xu()) + ' import ' + this$0.yu(def.xu());
|
|
559
559
|
}
|
|
560
560
|
function PythonEmitter(packageName, emitShared) {
|
|
561
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
562
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
561
|
+
packageName = packageName === VOID ? Companion_instance.nv('community.flock.wirespec.generated') : packageName;
|
|
562
|
+
emitShared = emitShared === VOID ? Companion_instance_0.hs() : emitShared;
|
|
563
563
|
LanguageEmitter.call(this);
|
|
564
|
-
this.
|
|
565
|
-
this.
|
|
566
|
-
this.
|
|
567
|
-
this.
|
|
568
|
-
this.
|
|
569
|
-
this.
|
|
570
|
-
}
|
|
571
|
-
protoOf(PythonEmitter).
|
|
572
|
-
return this.
|
|
564
|
+
this.a22_1 = packageName;
|
|
565
|
+
this.b22_1 = emitShared;
|
|
566
|
+
this.c22_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';
|
|
567
|
+
this.d22_1 = FileExtension_Python_getInstance();
|
|
568
|
+
this.e22_1 = PythonShared_instance;
|
|
569
|
+
this.f22_1 = '#';
|
|
570
|
+
}
|
|
571
|
+
protoOf(PythonEmitter).fu = function () {
|
|
572
|
+
return this.d22_1;
|
|
573
573
|
};
|
|
574
|
-
protoOf(PythonEmitter).
|
|
575
|
-
return this.
|
|
574
|
+
protoOf(PythonEmitter).m20 = function () {
|
|
575
|
+
return this.e22_1;
|
|
576
576
|
};
|
|
577
|
-
protoOf(PythonEmitter).
|
|
578
|
-
return this.
|
|
577
|
+
protoOf(PythonEmitter).gu = function () {
|
|
578
|
+
return this.f22_1;
|
|
579
579
|
};
|
|
580
|
-
protoOf(PythonEmitter).
|
|
580
|
+
protoOf(PythonEmitter).g22 = function (definition) {
|
|
581
581
|
var tmp;
|
|
582
582
|
if (definition instanceof Enum) {
|
|
583
583
|
tmp = 1;
|
|
@@ -606,28 +606,28 @@ protoOf(PythonEmitter).u1y = function (definition) {
|
|
|
606
606
|
}
|
|
607
607
|
return tmp;
|
|
608
608
|
};
|
|
609
|
-
protoOf(PythonEmitter).
|
|
609
|
+
protoOf(PythonEmitter).vu = function (module_0, logger) {
|
|
610
610
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
611
|
-
var this_0 = new NonEmptyList(module_0.
|
|
611
|
+
var this_0 = new NonEmptyList(module_0.eu_1);
|
|
612
612
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
613
613
|
var tmp = PythonEmitter$emit$lambda(this);
|
|
614
614
|
var tmp$ret$0 = new sam$kotlin_Comparator$0(tmp);
|
|
615
615
|
var tmp$ret$1 = sortedWith(this_0, tmp$ret$0);
|
|
616
616
|
var tmp_0 = toNonEmptyListOrNull(tmp$ret$1);
|
|
617
|
-
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).
|
|
617
|
+
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).zp_1;
|
|
618
618
|
// Inline function 'kotlin.let' call
|
|
619
|
-
var it = protoOf(LanguageEmitter).
|
|
620
|
-
var init = new Emitted(this.
|
|
621
|
-
var tmp_1 = this.
|
|
619
|
+
var it = protoOf(LanguageEmitter).vu.call(this, module_0.xy(VOID, statements), logger);
|
|
620
|
+
var init = new Emitted(this.a22_1.qv() + '__init__', 'from . import model\nfrom . import endpoint\nfrom . import wirespec\n');
|
|
621
|
+
var tmp_1 = this.a22_1.qv() + 'endpoint/' + '__init__';
|
|
622
622
|
// Inline function 'kotlin.collections.filter' call
|
|
623
|
-
var tmp0 = new NonEmptyList(module_0.
|
|
623
|
+
var tmp0 = new NonEmptyList(module_0.eu_1);
|
|
624
624
|
// Inline function 'kotlin.collections.filterTo' call
|
|
625
625
|
var destination = ArrayList_init_$Create$();
|
|
626
626
|
var _iterator__ex2g4s = tmp0.t();
|
|
627
627
|
while (_iterator__ex2g4s.u()) {
|
|
628
628
|
var element = _iterator__ex2g4s.v();
|
|
629
629
|
if (element instanceof Endpoint) {
|
|
630
|
-
destination.
|
|
630
|
+
destination.y(element);
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
633
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -637,19 +637,19 @@ protoOf(PythonEmitter).kr = function (module_0, logger) {
|
|
|
637
637
|
while (_iterator__ex2g4s_0.u()) {
|
|
638
638
|
var item = _iterator__ex2g4s_0.v();
|
|
639
639
|
var tmp$ret$5 = emit$emitInit(this, item);
|
|
640
|
-
destination_0.
|
|
640
|
+
destination_0.y(tmp$ret$5);
|
|
641
641
|
}
|
|
642
642
|
var initEndpoint = new Emitted(tmp_1, joinToString(destination_0, '\n'));
|
|
643
|
-
var tmp_2 = this.
|
|
643
|
+
var tmp_2 = this.a22_1.qv() + 'model/' + '__init__';
|
|
644
644
|
// Inline function 'kotlin.collections.filter' call
|
|
645
|
-
var tmp0_0 = new NonEmptyList(module_0.
|
|
645
|
+
var tmp0_0 = new NonEmptyList(module_0.eu_1);
|
|
646
646
|
// Inline function 'kotlin.collections.filterTo' call
|
|
647
647
|
var destination_1 = ArrayList_init_$Create$();
|
|
648
648
|
var _iterator__ex2g4s_1 = tmp0_0.t();
|
|
649
649
|
while (_iterator__ex2g4s_1.u()) {
|
|
650
650
|
var element_0 = _iterator__ex2g4s_1.v();
|
|
651
651
|
if (isInterface(element_0, Model)) {
|
|
652
|
-
destination_1.
|
|
652
|
+
destination_1.y(element_0);
|
|
653
653
|
}
|
|
654
654
|
}
|
|
655
655
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -659,36 +659,36 @@ protoOf(PythonEmitter).kr = function (module_0, logger) {
|
|
|
659
659
|
while (_iterator__ex2g4s_2.u()) {
|
|
660
660
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
661
661
|
var tmp$ret$11 = emit$emitInit(this, item_0);
|
|
662
|
-
destination_2.
|
|
662
|
+
destination_2.y(tmp$ret$11);
|
|
663
663
|
}
|
|
664
664
|
var initModel = new Emitted(tmp_2, joinToString(destination_2, '\n'));
|
|
665
|
-
var shared = new Emitted(this.
|
|
666
|
-
return this.
|
|
665
|
+
var shared = new Emitted(this.a22_1.qv() + 'wirespec', this.m20().i22_1);
|
|
666
|
+
return this.b22_1.is_1 ? NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(it, init), initEndpoint), initModel), shared) : NonEmptyList__plus_impl_xqmb9(it, init);
|
|
667
667
|
};
|
|
668
|
-
protoOf(PythonEmitter).
|
|
669
|
-
var subPackageName = plus_1(this.
|
|
668
|
+
protoOf(PythonEmitter).wu = function (definition, module_0, logger) {
|
|
669
|
+
var subPackageName = plus_1(this.a22_1, definition);
|
|
670
670
|
// Inline function 'kotlin.let' call
|
|
671
|
-
var it = protoOf(LanguageEmitter).
|
|
672
|
-
var tmp = subPackageName.
|
|
671
|
+
var it = protoOf(LanguageEmitter).wu.call(this, definition, module_0, logger);
|
|
672
|
+
var tmp = subPackageName.qv() + it.js_1;
|
|
673
673
|
// Inline function 'kotlin.text.trimStart' call
|
|
674
|
-
var this_0 = trimMargin('\n |' + this.
|
|
674
|
+
var this_0 = trimMargin('\n |' + this.c22_1 + '\n |' + it.ks_1 + '\n ');
|
|
675
675
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
676
676
|
return new Emitted(tmp, tmp$ret$0);
|
|
677
677
|
};
|
|
678
678
|
function emitToRawRequest($this, _this__u8e3s4, endpoint) {
|
|
679
|
-
var tmp = $this.
|
|
679
|
+
var tmp = $this.yu(endpoint.ft_1);
|
|
680
680
|
var tmp_0 = Spacer_instance.toString();
|
|
681
681
|
var tmp_1 = Spacer_instance.toString();
|
|
682
682
|
var tmp_2 = Spacer_instance.toString();
|
|
683
|
-
var tmp_3 = joinToString(endpoint.
|
|
683
|
+
var tmp_3 = joinToString(endpoint.ht_1, VOID, VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawRequest$lambda($this));
|
|
684
684
|
var tmp_4 = Spacer_instance.toString();
|
|
685
685
|
var tmp_5 = Spacer_instance.toString();
|
|
686
686
|
var tmp_6 = Spacer_instance.toString();
|
|
687
687
|
var tmp_7 = Spacer_instance.toString();
|
|
688
688
|
var tmp_8;
|
|
689
689
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
690
|
-
if (!endpoint.
|
|
691
|
-
tmp_8 = prependIndent(joinToString(endpoint.
|
|
690
|
+
if (!endpoint.it_1.r()) {
|
|
691
|
+
tmp_8 = prependIndent(joinToString(endpoint.it_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawRequest$lambda_0($this)), Spacer_instance.sv(3));
|
|
692
692
|
} else {
|
|
693
693
|
tmp_8 = '';
|
|
694
694
|
}
|
|
@@ -699,8 +699,8 @@ function emitToRawRequest($this, _this__u8e3s4, endpoint) {
|
|
|
699
699
|
var tmp_13 = Spacer_instance.toString();
|
|
700
700
|
var tmp_14;
|
|
701
701
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
702
|
-
if (!endpoint.
|
|
703
|
-
tmp_14 = prependIndent(joinToString(endpoint.
|
|
702
|
+
if (!endpoint.jt_1.r()) {
|
|
703
|
+
tmp_14 = prependIndent(joinToString(endpoint.jt_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawRequest$lambda_1($this)), Spacer_instance.sv(3));
|
|
704
704
|
} else {
|
|
705
705
|
tmp_14 = '';
|
|
706
706
|
}
|
|
@@ -709,48 +709,48 @@ function emitToRawRequest($this, _this__u8e3s4, endpoint) {
|
|
|
709
709
|
var tmp_17 = Spacer_instance.toString();
|
|
710
710
|
var tmp_18 = Spacer_instance.toString();
|
|
711
711
|
var tmp_19 = Spacer_instance.toString();
|
|
712
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
713
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
714
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
712
|
+
var tmp0_safe_receiver = _this__u8e3s4.ot_1;
|
|
713
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.qt_1;
|
|
714
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.l22(tmp1_safe_receiver);
|
|
715
715
|
return trimMargin("\n |@staticmethod\n |def to_raw_request(serialization: Wirespec.Serializer, request: '" + tmp + ".Request') -> Wirespec.RawRequest:\n |" + tmp_0 + 'return Wirespec.RawRequest(\n |' + tmp_1 + tmp_2 + 'path = [' + tmp_3 + '],\n |' + tmp_4 + tmp_5 + 'method = request.method.value,\n |' + tmp_6 + tmp_7 + 'queries = {\n |' + tmp_9 + '\n |' + tmp_10 + tmp_11 + '},\n |' + tmp_12 + tmp_13 + 'headers = {\n |' + tmp_15 + '\n |' + tmp_16 + tmp_17 + '},\n |' + tmp_18 + tmp_19 + 'body = serialization.serialize(request.body, ' + (tmp2_elvis_lhs == null ? 'type(None)' : tmp2_elvis_lhs) + '),\n |' + Spacer_instance.toString() + ')\n |\n ');
|
|
716
716
|
}
|
|
717
717
|
function emitFromRawRequest($this, _this__u8e3s4, endpoint) {
|
|
718
|
-
return trimMargin("\n |@staticmethod\n |def from_raw_request(serialization: Wirespec.Deserializer, request: Wirespec.RawRequest) -> '" + $this.
|
|
718
|
+
return trimMargin("\n |@staticmethod\n |def from_raw_request(serialization: Wirespec.Deserializer, request: Wirespec.RawRequest) -> '" + $this.yu(endpoint.ft_1) + ".Request':\n |" + Spacer_instance.toString() + 'return ' + $this.yu(endpoint.ft_1) + '.Request' + emitDeserializedParams($this, _this__u8e3s4, endpoint) + '\n |\n ');
|
|
719
719
|
}
|
|
720
720
|
function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
721
721
|
var tmp = get_indexedPathParams(endpoint);
|
|
722
722
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
|
|
723
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
724
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
725
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
723
|
+
var tmp_1 = orNull(joinToString(endpoint.it_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
724
|
+
var tmp_2 = orNull(joinToString(endpoint.jt_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
725
|
+
var tmp0_safe_receiver = _this__u8e3s4.ot_1;
|
|
726
726
|
var tmp_3;
|
|
727
727
|
if (tmp0_safe_receiver == null) {
|
|
728
728
|
tmp_3 = null;
|
|
729
729
|
} else {
|
|
730
730
|
// Inline function 'kotlin.let' call
|
|
731
|
-
tmp_3 = Spacer_instance.
|
|
731
|
+
tmp_3 = Spacer_instance.sv(3) + 'body = serialization.deserialize(request.body, ' + $this.l22(tmp0_safe_receiver.qt_1) + '),';
|
|
732
732
|
}
|
|
733
733
|
// Inline function 'kotlin.let' call
|
|
734
734
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
735
735
|
return isBlank(it) ? '()' : '(\n' + it + '\n)';
|
|
736
736
|
}
|
|
737
737
|
function emitResponseUnion($this, _this__u8e3s4) {
|
|
738
|
-
return trimMargin('\n |Response = ' + joinToString(_this__u8e3s4.
|
|
738
|
+
return trimMargin('\n |Response = ' + joinToString(_this__u8e3s4.lt_1, ' | ', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitResponseUnion$lambda) + '\n |\n ');
|
|
739
739
|
}
|
|
740
740
|
function emitHandleClass($this, _this__u8e3s4) {
|
|
741
|
-
return trimMargin('\n |class Handler(Wirespec.Endpoint.Handler):\n |' + Spacer_instance.toString() + '@abstractmethod\n |' + Spacer_instance.toString() + 'def ' + _this__u8e3s4.
|
|
741
|
+
return trimMargin('\n |class Handler(Wirespec.Endpoint.Handler):\n |' + Spacer_instance.toString() + '@abstractmethod\n |' + Spacer_instance.toString() + 'def ' + _this__u8e3s4.ft_1.m1() + "(self, req: '" + $this.yu(_this__u8e3s4.ft_1) + ".Request') -> '" + $this.yu(_this__u8e3s4.ft_1) + ".Response': pass\n |\n ");
|
|
742
742
|
}
|
|
743
743
|
function emitConvertClass($this, _this__u8e3s4) {
|
|
744
|
-
return trimMargin('\n |class Convert(Wirespec.Endpoint.Convert[Request, Response]):\n |' + spacer(emitToRawRequest($this, first(_this__u8e3s4.
|
|
744
|
+
return trimMargin('\n |class Convert(Wirespec.Endpoint.Convert[Request, Response]):\n |' + spacer(emitToRawRequest($this, first(_this__u8e3s4.kt_1), _this__u8e3s4), 1) + '\n |' + spacer(emitFromRawRequest($this, first(_this__u8e3s4.kt_1), _this__u8e3s4), 1) + '\n |' + spacer(emitToRawResponse($this, _this__u8e3s4), 1) + '\n |' + spacer(emitFromRawResponse($this, _this__u8e3s4), 1) + '\n |\n ');
|
|
745
745
|
}
|
|
746
746
|
function emit_16($this, _this__u8e3s4) {
|
|
747
|
-
return $this.
|
|
747
|
+
return $this.yu(_this__u8e3s4.ku_1) + ': ' + $this.yt(_this__u8e3s4.lu_1);
|
|
748
748
|
}
|
|
749
749
|
function emitAssignSelf($this, _this__u8e3s4) {
|
|
750
|
-
return $this.
|
|
750
|
+
return $this.yu(_this__u8e3s4.ku_1) + ' = ' + $this.yu(_this__u8e3s4.ku_1);
|
|
751
751
|
}
|
|
752
752
|
function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
753
|
-
var tmp = $this.
|
|
753
|
+
var tmp = $this.yu(endpoint.ft_1);
|
|
754
754
|
// Inline function 'kotlin.collections.filter' call
|
|
755
755
|
var tmp0 = paramList(_this__u8e3s4, endpoint);
|
|
756
756
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -758,13 +758,13 @@ function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
|
758
758
|
var _iterator__ex2g4s = tmp0.t();
|
|
759
759
|
while (_iterator__ex2g4s.u()) {
|
|
760
760
|
var element = _iterator__ex2g4s.v();
|
|
761
|
-
if (element.
|
|
762
|
-
destination.
|
|
761
|
+
if (element.ju_1.equals(ParamType_PATH_getInstance())) {
|
|
762
|
+
destination.y(element);
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
765
|
var tmp_0 = destination;
|
|
766
766
|
var tmp_1 = joinToString(tmp_0, VOID, VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda($this));
|
|
767
|
-
var tmp_2 = $this.
|
|
767
|
+
var tmp_2 = $this.yu(endpoint.ft_1);
|
|
768
768
|
// Inline function 'kotlin.collections.filter' call
|
|
769
769
|
var tmp0_0 = paramList(_this__u8e3s4, endpoint);
|
|
770
770
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -772,13 +772,13 @@ function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
|
772
772
|
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
773
773
|
while (_iterator__ex2g4s_0.u()) {
|
|
774
774
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
775
|
-
if (element_0.
|
|
776
|
-
destination_0.
|
|
775
|
+
if (element_0.ju_1.equals(ParamType_QUERY_getInstance())) {
|
|
776
|
+
destination_0.y(element_0);
|
|
777
777
|
}
|
|
778
778
|
}
|
|
779
779
|
var tmp_3 = destination_0;
|
|
780
780
|
var tmp_4 = spacer(joinToString(tmp_3, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_0($this)), 1);
|
|
781
|
-
var tmp_5 = $this.
|
|
781
|
+
var tmp_5 = $this.yu(endpoint.ft_1);
|
|
782
782
|
// Inline function 'kotlin.collections.filter' call
|
|
783
783
|
var tmp0_1 = paramList(_this__u8e3s4, endpoint);
|
|
784
784
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -786,14 +786,14 @@ function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
|
786
786
|
var _iterator__ex2g4s_1 = tmp0_1.t();
|
|
787
787
|
while (_iterator__ex2g4s_1.u()) {
|
|
788
788
|
var element_1 = _iterator__ex2g4s_1.v();
|
|
789
|
-
if (element_1.
|
|
790
|
-
destination_1.
|
|
789
|
+
if (element_1.ju_1.equals(ParamType_HEADER_getInstance())) {
|
|
790
|
+
destination_1.y(element_1);
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
793
|
var tmp_6 = destination_1;
|
|
794
794
|
var tmp_7 = spacer(joinToString(tmp_6, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_1($this)), 1);
|
|
795
795
|
var tmp_8;
|
|
796
|
-
if (_this__u8e3s4.
|
|
796
|
+
if (_this__u8e3s4.ot_1 == null) {
|
|
797
797
|
tmp_8 = null;
|
|
798
798
|
} else {
|
|
799
799
|
// Inline function 'kotlin.let' call
|
|
@@ -803,7 +803,7 @@ function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
|
803
803
|
return trimMargin('\n |self._path = ' + tmp + '.Request.Path(' + tmp_1 + ')\n |self._queries =' + tmp_2 + '.Request.Queries(' + tmp_4 + ')\n |self._headers = ' + tmp_5 + '.Request.Headers(' + tmp_7 + ')\n |self._body = ' + (tmp1_elvis_lhs == null ? 'None' : tmp1_elvis_lhs) + '\n ');
|
|
804
804
|
}
|
|
805
805
|
function emitAssignSelf_1($this, _this__u8e3s4, endpoint) {
|
|
806
|
-
var tmp = $this.
|
|
806
|
+
var tmp = $this.yu(endpoint.ft_1);
|
|
807
807
|
// Inline function 'kotlin.collections.filter' call
|
|
808
808
|
var tmp0 = paramList_0(_this__u8e3s4);
|
|
809
809
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -811,35 +811,35 @@ function emitAssignSelf_1($this, _this__u8e3s4, endpoint) {
|
|
|
811
811
|
var _iterator__ex2g4s = tmp0.t();
|
|
812
812
|
while (_iterator__ex2g4s.u()) {
|
|
813
813
|
var element = _iterator__ex2g4s.v();
|
|
814
|
-
if (element.
|
|
815
|
-
destination.
|
|
814
|
+
if (element.ju_1.equals(ParamType_HEADER_getInstance())) {
|
|
815
|
+
destination.y(element);
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
818
|
var tmp_0 = destination;
|
|
819
819
|
var tmp_1 = spacer(joinToString(tmp_0, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_2($this)), 1);
|
|
820
820
|
var tmp_2;
|
|
821
|
-
if (_this__u8e3s4.
|
|
821
|
+
if (_this__u8e3s4.tt_1 == null) {
|
|
822
822
|
tmp_2 = null;
|
|
823
823
|
} else {
|
|
824
824
|
// Inline function 'kotlin.let' call
|
|
825
825
|
tmp_2 = 'body';
|
|
826
826
|
}
|
|
827
827
|
var tmp1_elvis_lhs = tmp_2;
|
|
828
|
-
return trimMargin('\n |self._headers = ' + tmp + '.Response' + _this__u8e3s4.
|
|
828
|
+
return trimMargin('\n |self._headers = ' + tmp + '.Response' + _this__u8e3s4.rt_1 + '.Headers(' + tmp_1 + ')\n |self._body = ' + (tmp1_elvis_lhs == null ? 'None' : tmp1_elvis_lhs) + '\n ');
|
|
829
829
|
}
|
|
830
830
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
831
|
-
return Spacer_instance.
|
|
831
|
+
return Spacer_instance.sv(3) + $this.yu(_this__u8e3s4.lf_1.mt_1) + ' = serialization.deserialize(request.path[' + _this__u8e3s4.kf_1 + '], ' + $this.l22(_this__u8e3s4.lf_1.nt_1) + ')';
|
|
832
832
|
}
|
|
833
833
|
function emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive) {
|
|
834
834
|
var tmp;
|
|
835
835
|
if (caseSensitive) {
|
|
836
|
-
tmp = Spacer_instance.
|
|
836
|
+
tmp = Spacer_instance.sv(spaces) + $this.yu(_this__u8e3s4.bt_1) + ' = serialization.deserialize_param(' + type + '.' + fields + '.get("' + _this__u8e3s4.bt_1.m1() + '"), ' + $this.l22(_this__u8e3s4.ct_1) + ')';
|
|
837
837
|
} else {
|
|
838
|
-
var tmp_0 = Spacer_instance.
|
|
839
|
-
var tmp_1 = $this.
|
|
838
|
+
var tmp_0 = Spacer_instance.sv(spaces);
|
|
839
|
+
var tmp_1 = $this.yu(_this__u8e3s4.bt_1);
|
|
840
840
|
// Inline function 'kotlin.text.lowercase' call
|
|
841
841
|
// Inline function 'kotlin.js.asDynamic' call
|
|
842
|
-
tmp = tmp_0 + tmp_1 + ' = serialization.deserialize_param(next((v for k, v in ' + type + '.' + fields + '.items() if k.lower() == "' + _this__u8e3s4.
|
|
842
|
+
tmp = tmp_0 + tmp_1 + ' = serialization.deserialize_param(next((v for k, v in ' + type + '.' + fields + '.items() if k.lower() == "' + _this__u8e3s4.bt_1.m1().toLowerCase() + '"), None), ' + $this.l22(_this__u8e3s4.ct_1) + ')';
|
|
843
843
|
}
|
|
844
844
|
return tmp;
|
|
845
845
|
}
|
|
@@ -849,73 +849,73 @@ function emitDeserializedParams$default($this, _this__u8e3s4, type, fields, spac
|
|
|
849
849
|
return emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive);
|
|
850
850
|
}
|
|
851
851
|
function emitToRawResponse($this, _this__u8e3s4) {
|
|
852
|
-
var tmp = $this.
|
|
852
|
+
var tmp = $this.yu(_this__u8e3s4.ft_1);
|
|
853
853
|
var tmp_0 = Spacer_instance.toString();
|
|
854
|
-
var tmp_1 = distinctByStatus(_this__u8e3s4.
|
|
854
|
+
var tmp_1 = distinctByStatus(_this__u8e3s4.lt_1);
|
|
855
855
|
return trimMargin("\n |@staticmethod\n |def to_raw_response(serialization: Wirespec.Serializer, response: '" + tmp + ".Response') -> Wirespec.RawResponse:\n |" + tmp_0 + 'match response:\n |' + spacer(joinToString(tmp_1, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawResponse$lambda($this, _this__u8e3s4)), 2) + '\n |' + Spacer_instance.toString() + Spacer_instance.toString() + 'case _:\n |' + Spacer_instance.toString() + Spacer_instance.toString() + Spacer_instance.toString() + 'raise Exception("Cannot match response with status: " + str(response.status))\n ');
|
|
856
856
|
}
|
|
857
857
|
function emitFromRawResponse($this, _this__u8e3s4) {
|
|
858
|
-
var tmp = $this.
|
|
858
|
+
var tmp = $this.yu(_this__u8e3s4.ft_1);
|
|
859
859
|
var tmp_0 = Spacer_instance.toString();
|
|
860
860
|
// Inline function 'kotlin.collections.filter' call
|
|
861
|
-
var tmp0 = distinctByStatus(_this__u8e3s4.
|
|
861
|
+
var tmp0 = distinctByStatus(_this__u8e3s4.lt_1);
|
|
862
862
|
// Inline function 'kotlin.collections.filterTo' call
|
|
863
863
|
var destination = ArrayList_init_$Create$();
|
|
864
864
|
var _iterator__ex2g4s = tmp0.t();
|
|
865
865
|
while (_iterator__ex2g4s.u()) {
|
|
866
866
|
var element = _iterator__ex2g4s.v();
|
|
867
|
-
if (Companion_instance_1.
|
|
868
|
-
destination.
|
|
867
|
+
if (Companion_instance_1.tu(element.rt_1)) {
|
|
868
|
+
destination.y(element);
|
|
869
869
|
}
|
|
870
870
|
}
|
|
871
871
|
var tmp_1 = destination;
|
|
872
|
-
return trimMargin("\n |@staticmethod\n |def from_raw_response(serialization: Wirespec.Deserializer, response: Wirespec.RawResponse) -> '" + tmp + ".Response':\n |" + tmp_0 + 'match response.status_code:\n |' + spacer(joinToString(tmp_1, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitFromRawResponse$lambda($this, _this__u8e3s4)), 2) + '\n |' + Spacer_instance.
|
|
872
|
+
return trimMargin("\n |@staticmethod\n |def from_raw_response(serialization: Wirespec.Deserializer, response: Wirespec.RawResponse) -> '" + tmp + ".Response':\n |" + tmp_0 + 'match response.status_code:\n |' + spacer(joinToString(tmp_1, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitFromRawResponse$lambda($this, _this__u8e3s4)), 2) + '\n |' + Spacer_instance.sv(2) + 'case _:\n |' + Spacer_instance.sv(3) + 'raise Exception("Cannot match response with status: " + str(response.status_code))\n |\n ');
|
|
873
873
|
}
|
|
874
874
|
function emitDeserialized_0($this, _this__u8e3s4, endpoint) {
|
|
875
|
-
var tmp = 'case ' + _this__u8e3s4.
|
|
876
|
-
var tmp_0 = Spacer_instance.toString() + 'return ' + $this.
|
|
877
|
-
var tmp_1 = Spacer_instance.
|
|
878
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
879
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
880
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
875
|
+
var tmp = 'case ' + _this__u8e3s4.rt_1 + ':';
|
|
876
|
+
var tmp_0 = Spacer_instance.toString() + 'return ' + $this.yu(endpoint.ft_1) + '.Response' + _this__u8e3s4.rt_1 + '(';
|
|
877
|
+
var tmp_1 = Spacer_instance.sv(2);
|
|
878
|
+
var tmp0_safe_receiver = _this__u8e3s4.tt_1;
|
|
879
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.qt_1;
|
|
880
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.l22(tmp1_safe_receiver);
|
|
881
881
|
var tmp_2 = tmp_1 + 'body = serialization.deserialize(response.body, ' + (tmp2_elvis_lhs == null ? 'type(None)' : tmp2_elvis_lhs) + '),';
|
|
882
|
-
return joinToString(listOfNotNull([tmp, tmp_0, tmp_2, orNull(joinToString(_this__u8e3s4.
|
|
882
|
+
return joinToString(listOfNotNull([tmp, tmp_0, tmp_2, orNull(joinToString(_this__u8e3s4.st_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserialized$lambda($this))), Spacer_instance.toString() + ')']), '\n');
|
|
883
883
|
}
|
|
884
884
|
function emitSerialized($this, _this__u8e3s4, endpoint) {
|
|
885
|
-
var tmp = $this.
|
|
886
|
-
var tmp_0 = Spacer_instance.
|
|
887
|
-
var tmp_1 = Spacer_instance.
|
|
888
|
-
var tmp_2 = Spacer_instance.
|
|
885
|
+
var tmp = $this.yu(endpoint.ft_1);
|
|
886
|
+
var tmp_0 = Spacer_instance.sv(1);
|
|
887
|
+
var tmp_1 = Spacer_instance.sv(2);
|
|
888
|
+
var tmp_2 = Spacer_instance.sv(2);
|
|
889
889
|
var tmp_3;
|
|
890
890
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
891
|
-
if (!_this__u8e3s4.
|
|
892
|
-
tmp_3 = joinToString(_this__u8e3s4.
|
|
891
|
+
if (!_this__u8e3s4.st_1.r()) {
|
|
892
|
+
tmp_3 = joinToString(_this__u8e3s4.st_1, ', ', '{', '}', VOID, VOID, PythonEndpointDefinitionEmitter$emitSerialized$lambda($this));
|
|
893
893
|
} else {
|
|
894
894
|
tmp_3 = '{}';
|
|
895
895
|
}
|
|
896
896
|
var tmp_4 = tmp_3;
|
|
897
|
-
var tmp_5 = Spacer_instance.
|
|
898
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
897
|
+
var tmp_5 = Spacer_instance.sv(2);
|
|
898
|
+
var tmp0_safe_receiver = _this__u8e3s4.tt_1;
|
|
899
899
|
var tmp_6;
|
|
900
900
|
if (tmp0_safe_receiver == null) {
|
|
901
901
|
tmp_6 = null;
|
|
902
902
|
} else {
|
|
903
903
|
// Inline function 'kotlin.let' call
|
|
904
|
-
tmp_6 = 'serialization.serialize(response.body, ' + $this.
|
|
904
|
+
tmp_6 = 'serialization.serialize(response.body, ' + $this.l22(tmp0_safe_receiver.qt_1) + ')';
|
|
905
905
|
}
|
|
906
906
|
var tmp1_elvis_lhs = tmp_6;
|
|
907
|
-
return trimMargin('\n |case ' + tmp + '.Response' + _this__u8e3s4.
|
|
907
|
+
return trimMargin('\n |case ' + tmp + '.Response' + _this__u8e3s4.rt_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.sv(1) + ')\n ');
|
|
908
908
|
}
|
|
909
909
|
function emitSerializedParams($this, _this__u8e3s4, type, fields) {
|
|
910
|
-
return '"' + _this__u8e3s4.
|
|
910
|
+
return '"' + _this__u8e3s4.bt_1.m1() + '": serialization.serialize_param(' + type + '.' + fields + '.' + $this.yu(_this__u8e3s4.bt_1) + ', ' + $this.l22(_this__u8e3s4.ct_1) + ')';
|
|
911
911
|
}
|
|
912
912
|
function emitObject($this, _this__u8e3s4, name, extends_0, spaces, block) {
|
|
913
913
|
var tmp;
|
|
914
914
|
if (_this__u8e3s4.r()) {
|
|
915
|
-
tmp = trimMargin('\n |' + Spacer_instance.
|
|
915
|
+
tmp = trimMargin('\n |' + Spacer_instance.sv(spaces) + '@dataclass\n |' + Spacer_instance.sv(spaces) + 'class ' + name + ' (' + extends_0 + '): pass\n ');
|
|
916
916
|
} else {
|
|
917
|
-
var tmp_0 = Spacer_instance.
|
|
918
|
-
var tmp_1 = Spacer_instance.
|
|
917
|
+
var tmp_0 = Spacer_instance.sv(spaces);
|
|
918
|
+
var tmp_1 = Spacer_instance.sv(spaces);
|
|
919
919
|
tmp = trimMargin('\n |' + tmp_0 + '@dataclass\n |' + tmp_1 + 'class ' + name + ' (' + extends_0 + '):\n |' + joinToString(_this__u8e3s4, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitObject$lambda(spaces, block)) + '\n ');
|
|
920
920
|
}
|
|
921
921
|
return tmp;
|
|
@@ -925,21 +925,21 @@ function emitObject$default($this, _this__u8e3s4, name, extends_0, spaces, block
|
|
|
925
925
|
return emitObject($this, _this__u8e3s4, name, extends_0, spaces, block);
|
|
926
926
|
}
|
|
927
927
|
function emit_17($this, _this__u8e3s4) {
|
|
928
|
-
return $this.
|
|
928
|
+
return $this.yu(_this__u8e3s4.mt_1) + ': ' + $this.yt(_this__u8e3s4.nt_1);
|
|
929
929
|
}
|
|
930
930
|
function emit_18($this, _this__u8e3s4) {
|
|
931
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
932
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
931
|
+
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.qt_1;
|
|
932
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.yt(tmp1_safe_receiver);
|
|
933
933
|
return tmp2_elvis_lhs == null ? 'None' : tmp2_elvis_lhs;
|
|
934
934
|
}
|
|
935
935
|
function PythonEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
936
936
|
return function (it) {
|
|
937
|
-
return this$0.
|
|
937
|
+
return this$0.m22(it);
|
|
938
938
|
};
|
|
939
939
|
}
|
|
940
940
|
function PythonEndpointDefinitionEmitter$emit$lambda_0(this$0, $endpoint) {
|
|
941
941
|
return function (it) {
|
|
942
|
-
return this$0.
|
|
942
|
+
return this$0.k22(it, $endpoint);
|
|
943
943
|
};
|
|
944
944
|
}
|
|
945
945
|
function PythonEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
@@ -949,12 +949,12 @@ function PythonEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
|
949
949
|
}
|
|
950
950
|
function PythonEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
951
951
|
return function (it) {
|
|
952
|
-
return this$0.
|
|
952
|
+
return this$0.xt(it);
|
|
953
953
|
};
|
|
954
954
|
}
|
|
955
955
|
function PythonEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
956
956
|
return function (it) {
|
|
957
|
-
return this$0.
|
|
957
|
+
return this$0.xt(it);
|
|
958
958
|
};
|
|
959
959
|
}
|
|
960
960
|
function PythonEndpointDefinitionEmitter$emit$lambda_4(this$0) {
|
|
@@ -966,10 +966,10 @@ function PythonEndpointDefinitionEmitter$emitToRawRequest$lambda(this$0) {
|
|
|
966
966
|
return function (it) {
|
|
967
967
|
var tmp;
|
|
968
968
|
if (it instanceof Literal) {
|
|
969
|
-
tmp = '"' + it.
|
|
969
|
+
tmp = '"' + it.iu_1 + '"';
|
|
970
970
|
} else {
|
|
971
971
|
if (it instanceof Param) {
|
|
972
|
-
tmp = 'str(request.path.' + this$0.
|
|
972
|
+
tmp = 'str(request.path.' + this$0.yu(it.mt_1) + ')';
|
|
973
973
|
} else {
|
|
974
974
|
noWhenBranchMatchedException();
|
|
975
975
|
}
|
|
@@ -1003,7 +1003,7 @@ function PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda_1(this$0)
|
|
|
1003
1003
|
};
|
|
1004
1004
|
}
|
|
1005
1005
|
function PythonEndpointDefinitionEmitter$emitResponseUnion$lambda(it) {
|
|
1006
|
-
return 'Response' + it.
|
|
1006
|
+
return 'Response' + it.rt_1;
|
|
1007
1007
|
}
|
|
1008
1008
|
function PythonEndpointDefinitionEmitter$emitAssignSelf$lambda(this$0) {
|
|
1009
1009
|
return function (it) {
|
|
@@ -1027,7 +1027,7 @@ function PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_2(this$0) {
|
|
|
1027
1027
|
}
|
|
1028
1028
|
function PythonEndpointDefinitionEmitter$emit$lambda_5(this$0) {
|
|
1029
1029
|
return function (it) {
|
|
1030
|
-
return this$0.
|
|
1030
|
+
return this$0.xt(it);
|
|
1031
1031
|
};
|
|
1032
1032
|
}
|
|
1033
1033
|
function PythonEndpointDefinitionEmitter$emit$lambda_6(this$0) {
|
|
@@ -1057,7 +1057,7 @@ function PythonEndpointDefinitionEmitter$emitSerialized$lambda(this$0) {
|
|
|
1057
1057
|
}
|
|
1058
1058
|
function PythonEndpointDefinitionEmitter$emitObject$lambda($spaces, $block) {
|
|
1059
1059
|
return function (it) {
|
|
1060
|
-
return Spacer_instance.
|
|
1060
|
+
return Spacer_instance.sv($spaces + 2 | 0) + $block(it);
|
|
1061
1061
|
};
|
|
1062
1062
|
}
|
|
1063
1063
|
function PythonEndpointDefinitionEmitter() {
|
|
@@ -1086,14 +1086,14 @@ function sanitizeEnum($this, _this__u8e3s4) {
|
|
|
1086
1086
|
}
|
|
1087
1087
|
function PythonEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
1088
1088
|
return function (it) {
|
|
1089
|
-
return Spacer_instance.toString() + this$0.
|
|
1089
|
+
return Spacer_instance.toString() + this$0.t20(sanitizeEnum(this$0, it)) + ' = "' + it + '"';
|
|
1090
1090
|
};
|
|
1091
1091
|
}
|
|
1092
1092
|
function PythonEnumDefinitionEmitter() {
|
|
1093
1093
|
}
|
|
1094
1094
|
function Companion() {
|
|
1095
1095
|
Companion_instance_2 = this;
|
|
1096
|
-
this.
|
|
1096
|
+
this.n22_1 = setOf(['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']);
|
|
1097
1097
|
}
|
|
1098
1098
|
var Companion_instance_2;
|
|
1099
1099
|
function Companion_getInstance_0() {
|
|
@@ -1104,15 +1104,15 @@ function Companion_getInstance_0() {
|
|
|
1104
1104
|
function PythonIdentifierEmitter() {
|
|
1105
1105
|
}
|
|
1106
1106
|
function _get_sanitizationConfig__sns434($this) {
|
|
1107
|
-
var tmp0 = $this.
|
|
1107
|
+
var tmp0 = $this.s22_1;
|
|
1108
1108
|
var tmp = KProperty1;
|
|
1109
1109
|
// Inline function 'kotlin.getValue' call
|
|
1110
1110
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, PythonIrEmitter$_get_sanitizationConfig_$ref_1q5eai(), null);
|
|
1111
|
-
return tmp0.
|
|
1111
|
+
return tmp0.m1();
|
|
1112
1112
|
}
|
|
1113
1113
|
function sanitize_0($this, _this__u8e3s4) {
|
|
1114
1114
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
1115
|
-
var this_0 = split(_this__u8e3s4.
|
|
1115
|
+
var this_0 = split(_this__u8e3s4.m1(), ['.', ' ']);
|
|
1116
1116
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
1117
1117
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1118
1118
|
var index = 0;
|
|
@@ -1121,8 +1121,8 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
1121
1121
|
var item = _iterator__ex2g4s.v();
|
|
1122
1122
|
var _unary__edvuaz = index;
|
|
1123
1123
|
index = _unary__edvuaz + 1 | 0;
|
|
1124
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
1125
|
-
destination.
|
|
1124
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.pu(item) : item;
|
|
1125
|
+
destination.y(tmp$ret$0);
|
|
1126
1126
|
}
|
|
1127
1127
|
// Inline function 'kotlin.text.filter' call
|
|
1128
1128
|
var tmp0 = joinToString(destination, '');
|
|
@@ -1167,7 +1167,7 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
1167
1167
|
return tmp_2;
|
|
1168
1168
|
}
|
|
1169
1169
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1170
|
-
return Companion_getInstance_1().
|
|
1170
|
+
return Companion_getInstance_1().u22_1.v1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1171
1171
|
}
|
|
1172
1172
|
function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
1173
1173
|
// Inline function 'kotlin.let' call
|
|
@@ -1193,7 +1193,7 @@ function buildImports($this, wirespecPath) {
|
|
|
1193
1193
|
}
|
|
1194
1194
|
function Companion_0() {
|
|
1195
1195
|
Companion_instance_3 = this;
|
|
1196
|
-
this.
|
|
1196
|
+
this.u22_1 = setOf(['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']);
|
|
1197
1197
|
}
|
|
1198
1198
|
var Companion_instance_3;
|
|
1199
1199
|
function Companion_getInstance_1() {
|
|
@@ -1202,23 +1202,23 @@ function Companion_getInstance_1() {
|
|
|
1202
1202
|
return Companion_instance_3;
|
|
1203
1203
|
}
|
|
1204
1204
|
function sam$kotlin_Comparator$0_0(function_0) {
|
|
1205
|
-
this.
|
|
1205
|
+
this.v22_1 = function_0;
|
|
1206
1206
|
}
|
|
1207
|
-
protoOf(sam$kotlin_Comparator$0_0).
|
|
1208
|
-
return this.
|
|
1207
|
+
protoOf(sam$kotlin_Comparator$0_0).ud = function (a, b) {
|
|
1208
|
+
return this.v22_1(a, b);
|
|
1209
1209
|
};
|
|
1210
1210
|
protoOf(sam$kotlin_Comparator$0_0).compare = function (a, b) {
|
|
1211
|
-
return this.
|
|
1211
|
+
return this.ud(a, b);
|
|
1212
1212
|
};
|
|
1213
|
-
protoOf(sam$kotlin_Comparator$0_0).
|
|
1214
|
-
return this.
|
|
1213
|
+
protoOf(sam$kotlin_Comparator$0_0).m3 = function () {
|
|
1214
|
+
return this.v22_1;
|
|
1215
1215
|
};
|
|
1216
1216
|
protoOf(sam$kotlin_Comparator$0_0).equals = function (other) {
|
|
1217
1217
|
var tmp;
|
|
1218
1218
|
if (!(other == null) ? isInterface(other, Comparator) : false) {
|
|
1219
1219
|
var tmp_0;
|
|
1220
1220
|
if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
|
|
1221
|
-
tmp_0 = equals(this.
|
|
1221
|
+
tmp_0 = equals(this.m3(), other.m3());
|
|
1222
1222
|
} else {
|
|
1223
1223
|
tmp_0 = false;
|
|
1224
1224
|
}
|
|
@@ -1229,17 +1229,17 @@ protoOf(sam$kotlin_Comparator$0_0).equals = function (other) {
|
|
|
1229
1229
|
return tmp;
|
|
1230
1230
|
};
|
|
1231
1231
|
protoOf(sam$kotlin_Comparator$0_0).hashCode = function () {
|
|
1232
|
-
return hashCode(this.
|
|
1232
|
+
return hashCode(this.m3());
|
|
1233
1233
|
};
|
|
1234
1234
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
1235
1235
|
return '_' + it;
|
|
1236
1236
|
}
|
|
1237
1237
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(name) {
|
|
1238
|
-
var sanitized = name.
|
|
1238
|
+
var sanitized = name.w1k_1.b1() > 1 ? name.b1q() : name.u1m();
|
|
1239
1239
|
return new Name(listOf_0(sanitized));
|
|
1240
1240
|
}
|
|
1241
1241
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(name) {
|
|
1242
|
-
return new Name(listOf_0(name.
|
|
1242
|
+
return new Name(listOf_0(name.b1q()));
|
|
1243
1243
|
}
|
|
1244
1244
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(it) {
|
|
1245
1245
|
return it;
|
|
@@ -1248,21 +1248,21 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1248
1248
|
return function (stmt, tr) {
|
|
1249
1249
|
var tmp;
|
|
1250
1250
|
if (stmt instanceof ConstructorStatement) {
|
|
1251
|
-
var tmp_0 = tr.
|
|
1251
|
+
var tmp_0 = tr.j1y(stmt.d1r_1);
|
|
1252
1252
|
// Inline function 'kotlin.collections.map' call
|
|
1253
|
-
var this_0 = stmt.
|
|
1253
|
+
var this_0 = stmt.e1r_1;
|
|
1254
1254
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1255
|
-
var destination = ArrayList_init_$Create$_0(this_0.
|
|
1255
|
+
var destination = ArrayList_init_$Create$_0(this_0.b1());
|
|
1256
1256
|
// Inline function 'kotlin.collections.iterator' call
|
|
1257
|
-
var _iterator__ex2g4s = this_0.
|
|
1257
|
+
var _iterator__ex2g4s = this_0.k1().t();
|
|
1258
1258
|
while (_iterator__ex2g4s.u()) {
|
|
1259
1259
|
var item = _iterator__ex2g4s.v();
|
|
1260
1260
|
// Inline function 'kotlin.collections.component1' call
|
|
1261
|
-
var k = item.
|
|
1261
|
+
var k = item.l1();
|
|
1262
1262
|
// Inline function 'kotlin.collections.component2' call
|
|
1263
|
-
var v = item.
|
|
1264
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.
|
|
1265
|
-
destination.
|
|
1263
|
+
var v = item.m1();
|
|
1264
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.m1y(v));
|
|
1265
|
+
destination.y(tmp$ret$3);
|
|
1266
1266
|
}
|
|
1267
1267
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
1268
1268
|
} else {
|
|
@@ -1273,7 +1273,7 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1273
1273
|
}
|
|
1274
1274
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1275
1275
|
return function () {
|
|
1276
|
-
var tmp = Companion_getInstance_1().
|
|
1276
|
+
var tmp = Companion_getInstance_1().u22_1;
|
|
1277
1277
|
var tmp_0 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1278
1278
|
var tmp_1 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0;
|
|
1279
1279
|
var tmp_2 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1;
|
|
@@ -1293,7 +1293,7 @@ function PythonIrEmitter$emit$lambda(a, b) {
|
|
|
1293
1293
|
return compareValues(tmp, tmp$ret$1);
|
|
1294
1294
|
}
|
|
1295
1295
|
function emit$emitInitImport(this$0, def) {
|
|
1296
|
-
return import_0('.' + sanitize_0(this$0, def.
|
|
1296
|
+
return import_0('.' + sanitize_0(this$0, def.xu()), sanitize_0(this$0, def.xu()));
|
|
1297
1297
|
}
|
|
1298
1298
|
function PythonIrEmitter$emitGenerator$lambda(it) {
|
|
1299
1299
|
return startsWith(it, 'Wirespec.') || it === 'Wirespec';
|
|
@@ -1312,17 +1312,17 @@ function PythonIrEmitter$emitGenerator$lambda_2($generatorOwnName, $generatorRef
|
|
|
1312
1312
|
var tmp_0;
|
|
1313
1313
|
var tmp_1;
|
|
1314
1314
|
if (expr instanceof RawExpression) {
|
|
1315
|
-
tmp_1 = endsWith(expr.
|
|
1315
|
+
tmp_1 = endsWith(expr.x1s_1, 'Generator');
|
|
1316
1316
|
} else {
|
|
1317
1317
|
tmp_1 = false;
|
|
1318
1318
|
}
|
|
1319
1319
|
if (tmp_1) {
|
|
1320
|
-
tmp_0 = !(expr.
|
|
1320
|
+
tmp_0 = !(expr.x1s_1 === $generatorOwnName);
|
|
1321
1321
|
} else {
|
|
1322
1322
|
tmp_0 = false;
|
|
1323
1323
|
}
|
|
1324
1324
|
if (tmp_0) {
|
|
1325
|
-
$generatorRefs.
|
|
1325
|
+
$generatorRefs.y(expr.x1s_1);
|
|
1326
1326
|
tmp = Unit_instance;
|
|
1327
1327
|
}
|
|
1328
1328
|
return transformChildren_0(expr, t);
|
|
@@ -1335,43 +1335,43 @@ function PythonIrEmitter$emit$lambda_0(this$0) {
|
|
|
1335
1335
|
}
|
|
1336
1336
|
function PythonIrEmitter(packageName, emitShared) {
|
|
1337
1337
|
Companion_getInstance_1();
|
|
1338
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
1339
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
1340
|
-
this.
|
|
1341
|
-
this.
|
|
1342
|
-
this.
|
|
1343
|
-
this.
|
|
1338
|
+
packageName = packageName === VOID ? Companion_instance.nv('community.flock.wirespec.generated') : packageName;
|
|
1339
|
+
emitShared = emitShared === VOID ? Companion_instance_0.hs() : emitShared;
|
|
1340
|
+
this.o22_1 = packageName;
|
|
1341
|
+
this.p22_1 = emitShared;
|
|
1342
|
+
this.q22_1 = PythonGenerator_instance;
|
|
1343
|
+
this.r22_1 = FileExtension_Python_getInstance();
|
|
1344
1344
|
var tmp = this;
|
|
1345
|
-
tmp.
|
|
1346
|
-
this.
|
|
1345
|
+
tmp.s22_1 = lazy(PythonIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1346
|
+
this.t22_1 = "from __future__ import annotations\n\nimport enum\nfrom abc import ABC, abstractmethod\nfrom dataclasses import dataclass\nfrom typing import Any, Callable, Generic, Optional, Type, TypeVar\n\nT = TypeVar('T')\nV = TypeVar('V')\n\n\ndef _raise(msg: str) -> Any:\n raise Exception(msg)\n\n";
|
|
1347
1347
|
}
|
|
1348
|
-
protoOf(PythonIrEmitter).
|
|
1349
|
-
return this.
|
|
1348
|
+
protoOf(PythonIrEmitter).e1z = function () {
|
|
1349
|
+
return this.q22_1;
|
|
1350
1350
|
};
|
|
1351
|
-
protoOf(PythonIrEmitter).
|
|
1352
|
-
return this.
|
|
1351
|
+
protoOf(PythonIrEmitter).fu = function () {
|
|
1352
|
+
return this.r22_1;
|
|
1353
1353
|
};
|
|
1354
|
-
protoOf(PythonIrEmitter).
|
|
1355
|
-
var source = replaceReflectInNonGenericStructFields(convert(Companion_instance.
|
|
1354
|
+
protoOf(PythonIrEmitter).h1z = function () {
|
|
1355
|
+
var source = replaceReflectInNonGenericStructFields(convert(Companion_instance.nv('shared')));
|
|
1356
1356
|
var tmp;
|
|
1357
|
-
if (this.
|
|
1358
|
-
tmp = new File(Companion_getInstance().
|
|
1357
|
+
if (this.p22_1.is_1) {
|
|
1358
|
+
tmp = new File(Companion_getInstance().y1k(this.o22_1.qv() + 'wirespec'), listOf_0(raw(this.t22_1 + PythonGenerator_instance.f1z(source))));
|
|
1359
1359
|
} else {
|
|
1360
1360
|
tmp = null;
|
|
1361
1361
|
}
|
|
1362
1362
|
return tmp;
|
|
1363
1363
|
};
|
|
1364
|
-
protoOf(PythonIrEmitter).
|
|
1364
|
+
protoOf(PythonIrEmitter).g1z = function (module_0, logger) {
|
|
1365
1365
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
1366
|
-
var this_0 = new NonEmptyList(module_0.
|
|
1366
|
+
var this_0 = new NonEmptyList(module_0.eu_1);
|
|
1367
1367
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
1368
1368
|
var tmp = PythonIrEmitter$emit$lambda;
|
|
1369
1369
|
var tmp$ret$0 = new sam$kotlin_Comparator$0_0(tmp);
|
|
1370
1370
|
var tmp$ret$1 = sortedWith(this_0, tmp$ret$0);
|
|
1371
1371
|
var tmp_0 = toNonEmptyListOrNull(tmp$ret$1);
|
|
1372
|
-
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).
|
|
1373
|
-
var emitted = emit.call(this, module_0.
|
|
1374
|
-
var tmp0 = new NonEmptyList(module_0.
|
|
1372
|
+
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).zp_1;
|
|
1373
|
+
var emitted = emit.call(this, module_0.xy(VOID, statements), logger);
|
|
1374
|
+
var tmp0 = new NonEmptyList(module_0.eu_1);
|
|
1375
1375
|
var tmp$ret$2;
|
|
1376
1376
|
$l$block_0: {
|
|
1377
1377
|
// Inline function 'kotlin.collections.any' call
|
|
@@ -1396,29 +1396,29 @@ protoOf(PythonIrEmitter).u1v = function (module_0, logger) {
|
|
|
1396
1396
|
tmp$ret$2 = false;
|
|
1397
1397
|
}
|
|
1398
1398
|
var hasEndpoints = tmp$ret$2;
|
|
1399
|
-
var tmp_2 = Companion_getInstance().
|
|
1399
|
+
var tmp_2 = Companion_getInstance().y1k(this.o22_1.qv() + '__init__');
|
|
1400
1400
|
// Inline function 'kotlin.collections.buildList' call
|
|
1401
1401
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1402
1402
|
// Inline function 'kotlin.apply' call
|
|
1403
1403
|
var this_1 = ArrayList_init_$Create$();
|
|
1404
|
-
this_1.
|
|
1405
|
-
this_1.
|
|
1404
|
+
this_1.y(import_0('.', 'model'));
|
|
1405
|
+
this_1.y(import_0('.', 'endpoint'));
|
|
1406
1406
|
if (hasEndpoints) {
|
|
1407
|
-
this_1.
|
|
1407
|
+
this_1.y(import_0('.', 'client'));
|
|
1408
1408
|
}
|
|
1409
|
-
this_1.
|
|
1410
|
-
var tmp$ret$7 = this_1.
|
|
1409
|
+
this_1.y(import_0('.', 'wirespec'));
|
|
1410
|
+
var tmp$ret$7 = this_1.p5();
|
|
1411
1411
|
var init = new File(tmp_2, tmp$ret$7);
|
|
1412
|
-
var tmp_3 = Companion_getInstance().
|
|
1412
|
+
var tmp_3 = Companion_getInstance().y1k(this.o22_1.qv() + 'endpoint/' + '__init__');
|
|
1413
1413
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1414
|
-
var tmp0_0 = new NonEmptyList(module_0.
|
|
1414
|
+
var tmp0_0 = new NonEmptyList(module_0.eu_1);
|
|
1415
1415
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1416
1416
|
var destination = ArrayList_init_$Create$();
|
|
1417
1417
|
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
1418
1418
|
while (_iterator__ex2g4s_0.u()) {
|
|
1419
1419
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
1420
1420
|
if (element_0 instanceof Endpoint) {
|
|
1421
|
-
destination.
|
|
1421
|
+
destination.y(element_0);
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
1424
1424
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1428,19 +1428,19 @@ protoOf(PythonIrEmitter).u1v = function (module_0, logger) {
|
|
|
1428
1428
|
while (_iterator__ex2g4s_1.u()) {
|
|
1429
1429
|
var item = _iterator__ex2g4s_1.v();
|
|
1430
1430
|
var tmp$ret$10 = emit$emitInitImport(this, item);
|
|
1431
|
-
destination_0.
|
|
1431
|
+
destination_0.y(tmp$ret$10);
|
|
1432
1432
|
}
|
|
1433
1433
|
var initEndpoint = new File(tmp_3, destination_0);
|
|
1434
|
-
var tmp_4 = Companion_getInstance().
|
|
1434
|
+
var tmp_4 = Companion_getInstance().y1k(this.o22_1.qv() + 'model/' + '__init__');
|
|
1435
1435
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1436
|
-
var tmp0_1 = new NonEmptyList(module_0.
|
|
1436
|
+
var tmp0_1 = new NonEmptyList(module_0.eu_1);
|
|
1437
1437
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1438
1438
|
var destination_1 = ArrayList_init_$Create$();
|
|
1439
1439
|
var _iterator__ex2g4s_2 = tmp0_1.t();
|
|
1440
1440
|
while (_iterator__ex2g4s_2.u()) {
|
|
1441
1441
|
var element_1 = _iterator__ex2g4s_2.v();
|
|
1442
1442
|
if (!(element_1 == null) ? isInterface(element_1, Model) : false) {
|
|
1443
|
-
destination_1.
|
|
1443
|
+
destination_1.y(element_1);
|
|
1444
1444
|
}
|
|
1445
1445
|
}
|
|
1446
1446
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1450,11 +1450,11 @@ protoOf(PythonIrEmitter).u1v = function (module_0, logger) {
|
|
|
1450
1450
|
while (_iterator__ex2g4s_3.u()) {
|
|
1451
1451
|
var item_0 = _iterator__ex2g4s_3.v();
|
|
1452
1452
|
var tmp$ret$15 = emit$emitInitImport(this, item_0);
|
|
1453
|
-
destination_2.
|
|
1453
|
+
destination_2.y(tmp$ret$15);
|
|
1454
1454
|
}
|
|
1455
1455
|
var initModel = new File(tmp_4, destination_2);
|
|
1456
|
-
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().
|
|
1457
|
-
var tmp0_2 = dropLast(split(this.
|
|
1456
|
+
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().y1k(this.o22_1.qv() + 'client/' + '__init__'), emptyList())) : emptyList();
|
|
1457
|
+
var tmp0_2 = dropLast(split(this.o22_1.ov_1, ['.']), 1);
|
|
1458
1458
|
var tmp$ret$18;
|
|
1459
1459
|
$l$block_1: {
|
|
1460
1460
|
// Inline function 'kotlin.collections.runningFold' call
|
|
@@ -1465,7 +1465,7 @@ protoOf(PythonIrEmitter).u1v = function (module_0, logger) {
|
|
|
1465
1465
|
}
|
|
1466
1466
|
// Inline function 'kotlin.apply' call
|
|
1467
1467
|
var this_2 = ArrayList_init_$Create$_0(estimatedSize + 1 | 0);
|
|
1468
|
-
this_2.
|
|
1468
|
+
this_2.y('');
|
|
1469
1469
|
var result = this_2;
|
|
1470
1470
|
var accumulator = '';
|
|
1471
1471
|
var _iterator__ex2g4s_4 = tmp0_2.t();
|
|
@@ -1480,7 +1480,7 @@ protoOf(PythonIrEmitter).u1v = function (module_0, logger) {
|
|
|
1480
1480
|
tmp_5 = acc + '/' + element_2;
|
|
1481
1481
|
}
|
|
1482
1482
|
accumulator = tmp_5;
|
|
1483
|
-
result.
|
|
1483
|
+
result.y(accumulator);
|
|
1484
1484
|
}
|
|
1485
1485
|
tmp$ret$18 = result;
|
|
1486
1486
|
}
|
|
@@ -1491,17 +1491,17 @@ protoOf(PythonIrEmitter).u1v = function (module_0, logger) {
|
|
|
1491
1491
|
var _iterator__ex2g4s_5 = this_3.t();
|
|
1492
1492
|
while (_iterator__ex2g4s_5.u()) {
|
|
1493
1493
|
var item_1 = _iterator__ex2g4s_5.v();
|
|
1494
|
-
var tmp$ret$23 = new File(Companion_getInstance().
|
|
1495
|
-
destination_3.
|
|
1494
|
+
var tmp$ret$23 = new File(Companion_getInstance().y1k(item_1 + '/__init__'), emptyList());
|
|
1495
|
+
destination_3.y(tmp$ret$23);
|
|
1496
1496
|
}
|
|
1497
1497
|
var parentInits = destination_3;
|
|
1498
|
-
return this.
|
|
1498
|
+
return this.p22_1.is_1 ? NonEmptyList__plus_impl_xqmb9_0(NonEmptyList__plus_impl_xqmb9_0(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(emitted, init), initEndpoint), initModel), initClient), parentInits) : NonEmptyList__plus_impl_xqmb9_0(NonEmptyList__plus_impl_xqmb9(emitted, init), parentInits);
|
|
1499
1499
|
};
|
|
1500
|
-
protoOf(PythonIrEmitter).
|
|
1500
|
+
protoOf(PythonIrEmitter).wu = function (definition, module_0, logger) {
|
|
1501
1501
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1502
|
-
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.
|
|
1502
|
+
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.o22_1, definition);
|
|
1503
1503
|
};
|
|
1504
|
-
protoOf(PythonIrEmitter).
|
|
1504
|
+
protoOf(PythonIrEmitter).l1z = function (definition, module_0) {
|
|
1505
1505
|
var tmp;
|
|
1506
1506
|
if (definition instanceof Type) {
|
|
1507
1507
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1522,7 +1522,7 @@ protoOf(PythonIrEmitter).z1v = function (definition, module_0) {
|
|
|
1522
1522
|
}
|
|
1523
1523
|
var generatorFile = tmp;
|
|
1524
1524
|
var sanitized = sanitizeNames(generatorFile, _get_sanitizationConfig__sns434(this));
|
|
1525
|
-
var generatorOwnName = definition.
|
|
1525
|
+
var generatorOwnName = definition.xu().m1() + 'Generator';
|
|
1526
1526
|
var tmp_0 = asSequence(collectCustomTypeNames(sanitized));
|
|
1527
1527
|
var tmp_1 = filterNot(tmp_0, PythonIrEmitter$emitGenerator$lambda);
|
|
1528
1528
|
var tmp_2 = filterNot(tmp_1, PythonIrEmitter$emitGenerator$lambda_0(generatorOwnName));
|
|
@@ -1531,8 +1531,8 @@ protoOf(PythonIrEmitter).z1v = function (definition, module_0) {
|
|
|
1531
1531
|
var generatorRefs = LinkedHashSet_init_$Create$();
|
|
1532
1532
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1533
1533
|
var scope = new TransformScope(sanitized);
|
|
1534
|
-
scope.
|
|
1535
|
-
var tmp_3 = scope.
|
|
1534
|
+
scope.z1y(PythonIrEmitter$emitGenerator$lambda_2(generatorOwnName, generatorRefs));
|
|
1535
|
+
var tmp_3 = scope.r1y_1;
|
|
1536
1536
|
isInterface(tmp_3, Element) || THROW_CCE();
|
|
1537
1537
|
// Inline function 'kotlin.collections.filter' call
|
|
1538
1538
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -1541,7 +1541,7 @@ protoOf(PythonIrEmitter).z1v = function (definition, module_0) {
|
|
|
1541
1541
|
while (_iterator__ex2g4s.u()) {
|
|
1542
1542
|
var element = _iterator__ex2g4s.v();
|
|
1543
1543
|
if (endsWith(element, 'Generator')) {
|
|
1544
|
-
destination.
|
|
1544
|
+
destination.y(element);
|
|
1545
1545
|
}
|
|
1546
1546
|
}
|
|
1547
1547
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1552,7 +1552,7 @@ protoOf(PythonIrEmitter).z1v = function (definition, module_0) {
|
|
|
1552
1552
|
while (_iterator__ex2g4s_0.u()) {
|
|
1553
1553
|
var item = _iterator__ex2g4s_0.v();
|
|
1554
1554
|
var tmp$ret$6 = import_0('.' + item, item);
|
|
1555
|
-
destination_0.
|
|
1555
|
+
destination_0.y(tmp$ret$6);
|
|
1556
1556
|
}
|
|
1557
1557
|
var generatorImports = destination_0;
|
|
1558
1558
|
// Inline function 'kotlin.collections.filterNot' call
|
|
@@ -1562,7 +1562,7 @@ protoOf(PythonIrEmitter).z1v = function (definition, module_0) {
|
|
|
1562
1562
|
while (_iterator__ex2g4s_1.u()) {
|
|
1563
1563
|
var element_0 = _iterator__ex2g4s_1.v();
|
|
1564
1564
|
if (!endsWith(element_0, 'Generator')) {
|
|
1565
|
-
destination_1.
|
|
1565
|
+
destination_1.y(element_0);
|
|
1566
1566
|
}
|
|
1567
1567
|
}
|
|
1568
1568
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1572,12 +1572,12 @@ protoOf(PythonIrEmitter).z1v = function (definition, module_0) {
|
|
|
1572
1572
|
while (_iterator__ex2g4s_2.u()) {
|
|
1573
1573
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
1574
1574
|
var tmp$ret$12 = import_0('..model.' + item_0, item_0);
|
|
1575
|
-
destination_2.
|
|
1575
|
+
destination_2.y(tmp$ret$12);
|
|
1576
1576
|
}
|
|
1577
1577
|
var modelImports = destination_2;
|
|
1578
|
-
return placeInModule_0(prependImports(sanitized, plus(plus(buildImports(this, '..wirespec'), modelImports), generatorImports)), this.
|
|
1578
|
+
return placeInModule_0(prependImports(sanitized, plus(plus(buildImports(this, '..wirespec'), modelImports), generatorImports)), this.o22_1, 'generator');
|
|
1579
1579
|
};
|
|
1580
|
-
protoOf(PythonIrEmitter).
|
|
1580
|
+
protoOf(PythonIrEmitter).vt = function (type, module_0) {
|
|
1581
1581
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1582
1582
|
var this_0 = importReferences(type);
|
|
1583
1583
|
var set = HashSet_init_$Create$();
|
|
@@ -1585,9 +1585,9 @@ protoOf(PythonIrEmitter).kq = function (type, module_0) {
|
|
|
1585
1585
|
var _iterator__ex2g4s = this_0.t();
|
|
1586
1586
|
while (_iterator__ex2g4s.u()) {
|
|
1587
1587
|
var e = _iterator__ex2g4s.v();
|
|
1588
|
-
var key = e.
|
|
1589
|
-
if (set.
|
|
1590
|
-
list.
|
|
1588
|
+
var key = e.my_1;
|
|
1589
|
+
if (set.y(key)) {
|
|
1590
|
+
list.y(e);
|
|
1591
1591
|
}
|
|
1592
1592
|
}
|
|
1593
1593
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1596,19 +1596,19 @@ protoOf(PythonIrEmitter).kq = function (type, module_0) {
|
|
|
1596
1596
|
var _iterator__ex2g4s_0 = list.t();
|
|
1597
1597
|
while (_iterator__ex2g4s_0.u()) {
|
|
1598
1598
|
var item = _iterator__ex2g4s_0.v();
|
|
1599
|
-
var tmp$ret$2 = import_0('.' + item.
|
|
1600
|
-
destination.
|
|
1599
|
+
var tmp$ret$2 = import_0('.' + item.my_1, item.my_1);
|
|
1600
|
+
destination.y(tmp$ret$2);
|
|
1601
1601
|
}
|
|
1602
1602
|
var typeImports = destination;
|
|
1603
1603
|
// Inline function 'kotlin.collections.map' call
|
|
1604
|
-
var this_1 = type.
|
|
1604
|
+
var this_1 = type.xs_1.ts_1;
|
|
1605
1605
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1606
1606
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1607
1607
|
var _iterator__ex2g4s_1 = this_1.t();
|
|
1608
1608
|
while (_iterator__ex2g4s_1.u()) {
|
|
1609
1609
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
1610
|
-
var tmp$ret$5 = item_0.
|
|
1611
|
-
destination_0.
|
|
1610
|
+
var tmp$ret$5 = item_0.bt_1.m1();
|
|
1611
|
+
destination_0.y(tmp$ret$5);
|
|
1612
1612
|
}
|
|
1613
1613
|
var fieldNames = toSet(destination_0);
|
|
1614
1614
|
var tmp = sanitizeNames(injectSelfReceiverToValidate(convertWithValidation(type, module_0), fieldNames), _get_sanitizationConfig__sns434(this));
|
|
@@ -1623,17 +1623,17 @@ protoOf(PythonIrEmitter).kq = function (type, module_0) {
|
|
|
1623
1623
|
var tmp$ret$10 = tmp_0;
|
|
1624
1624
|
return prependImports(tmp, tmp$ret$10);
|
|
1625
1625
|
};
|
|
1626
|
-
protoOf(PythonIrEmitter).
|
|
1626
|
+
protoOf(PythonIrEmitter).kv = function (enum_0, module_0) {
|
|
1627
1627
|
var tmp = convert_0(enum_0);
|
|
1628
1628
|
return sanitizeNames(sanitizeEnumEntries(tmp, PythonIrEmitter$emit$lambda_0(this)), _get_sanitizationConfig__sns434(this));
|
|
1629
1629
|
};
|
|
1630
|
-
protoOf(PythonIrEmitter).
|
|
1630
|
+
protoOf(PythonIrEmitter).av = function (union) {
|
|
1631
1631
|
return sanitizeNames(convert_1(union), _get_sanitizationConfig__sns434(this));
|
|
1632
1632
|
};
|
|
1633
|
-
protoOf(PythonIrEmitter).
|
|
1633
|
+
protoOf(PythonIrEmitter).fv = function (refined) {
|
|
1634
1634
|
return sanitizeNames(replaceRefinedFunctions(convert_2(refined), refined), _get_sanitizationConfig__sns434(this));
|
|
1635
1635
|
};
|
|
1636
|
-
protoOf(PythonIrEmitter).
|
|
1636
|
+
protoOf(PythonIrEmitter).lv = function (endpoint) {
|
|
1637
1637
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1638
1638
|
var this_0 = importReferences(endpoint);
|
|
1639
1639
|
var set = HashSet_init_$Create$();
|
|
@@ -1641,9 +1641,9 @@ protoOf(PythonIrEmitter).as = function (endpoint) {
|
|
|
1641
1641
|
var _iterator__ex2g4s = this_0.t();
|
|
1642
1642
|
while (_iterator__ex2g4s.u()) {
|
|
1643
1643
|
var e = _iterator__ex2g4s.v();
|
|
1644
|
-
var key = e.
|
|
1645
|
-
if (set.
|
|
1646
|
-
list.
|
|
1644
|
+
var key = e.my_1;
|
|
1645
|
+
if (set.y(key)) {
|
|
1646
|
+
list.y(e);
|
|
1647
1647
|
}
|
|
1648
1648
|
}
|
|
1649
1649
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1652,19 +1652,19 @@ protoOf(PythonIrEmitter).as = function (endpoint) {
|
|
|
1652
1652
|
var _iterator__ex2g4s_0 = list.t();
|
|
1653
1653
|
while (_iterator__ex2g4s_0.u()) {
|
|
1654
1654
|
var item = _iterator__ex2g4s_0.v();
|
|
1655
|
-
var tmp$ret$2 = import_0('..model.' + item.
|
|
1656
|
-
destination.
|
|
1655
|
+
var tmp$ret$2 = import_0('..model.' + item.my_1, item.my_1);
|
|
1656
|
+
destination.y(tmp$ret$2);
|
|
1657
1657
|
}
|
|
1658
1658
|
var endpointImports = destination;
|
|
1659
1659
|
// Inline function 'kotlin.let' call
|
|
1660
1660
|
var it = splitEndpointStructsToModuleLevel(convert_3(endpoint));
|
|
1661
|
-
var tmp$ret$6 = it.
|
|
1661
|
+
var tmp$ret$6 = it.k1r(VOID, plus(endpointImports, it.h1r_1));
|
|
1662
1662
|
return sanitizeNames(snakeCaseHandlerAndCallMethods(tmp$ret$6), _get_sanitizationConfig__sns434(this));
|
|
1663
1663
|
};
|
|
1664
|
-
protoOf(PythonIrEmitter).
|
|
1664
|
+
protoOf(PythonIrEmitter).zu = function (channel) {
|
|
1665
1665
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1666
1666
|
};
|
|
1667
|
-
protoOf(PythonIrEmitter).
|
|
1667
|
+
protoOf(PythonIrEmitter).k1z = function (endpoint) {
|
|
1668
1668
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1669
1669
|
var this_0 = importReferences(endpoint);
|
|
1670
1670
|
var set = HashSet_init_$Create$();
|
|
@@ -1672,9 +1672,9 @@ protoOf(PythonIrEmitter).y1v = function (endpoint) {
|
|
|
1672
1672
|
var _iterator__ex2g4s = this_0.t();
|
|
1673
1673
|
while (_iterator__ex2g4s.u()) {
|
|
1674
1674
|
var e = _iterator__ex2g4s.v();
|
|
1675
|
-
var key = e.
|
|
1676
|
-
if (set.
|
|
1677
|
-
list.
|
|
1675
|
+
var key = e.my_1;
|
|
1676
|
+
if (set.y(key)) {
|
|
1677
|
+
list.y(e);
|
|
1678
1678
|
}
|
|
1679
1679
|
}
|
|
1680
1680
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1683,17 +1683,17 @@ protoOf(PythonIrEmitter).y1v = function (endpoint) {
|
|
|
1683
1683
|
var _iterator__ex2g4s_0 = list.t();
|
|
1684
1684
|
while (_iterator__ex2g4s_0.u()) {
|
|
1685
1685
|
var item = _iterator__ex2g4s_0.v();
|
|
1686
|
-
var tmp$ret$2 = import_0('..model.' + item.
|
|
1687
|
-
destination.
|
|
1686
|
+
var tmp$ret$2 = import_0('..model.' + item.my_1, item.my_1);
|
|
1687
|
+
destination.y(tmp$ret$2);
|
|
1688
1688
|
}
|
|
1689
1689
|
var modelImports = destination;
|
|
1690
|
-
var endpointImport = import_0('..endpoint.' + endpoint.
|
|
1691
|
-
var endpointName = endpoint.
|
|
1690
|
+
var endpointImport = import_0('..endpoint.' + endpoint.ft_1.m1(), '*');
|
|
1691
|
+
var endpointName = endpoint.ft_1.m1();
|
|
1692
1692
|
var file = flattenEndpointTypeRefs(snakeCaseClientFunctions(addSelfReceiverToClientFields(sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this)))), endpointName);
|
|
1693
|
-
var subPackageName = plus_2(this.
|
|
1694
|
-
return new File(Companion_getInstance().
|
|
1693
|
+
var subPackageName = plus_2(this.o22_1, 'client');
|
|
1694
|
+
return new File(Companion_getInstance().y1k(subPackageName.qv() + file.g1r_1.z1k()), plus(plus(plus(buildImports(this, '..wirespec'), modelImports), listOf_0(endpointImport)), file.h1r_1));
|
|
1695
1695
|
};
|
|
1696
|
-
protoOf(PythonIrEmitter).
|
|
1696
|
+
protoOf(PythonIrEmitter).i1z = function (endpoints, logger) {
|
|
1697
1697
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1698
1698
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1699
1699
|
var destination = ArrayList_init_$Create$();
|
|
@@ -1709,9 +1709,9 @@ protoOf(PythonIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1709
1709
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1710
1710
|
while (_iterator__ex2g4s_0.u()) {
|
|
1711
1711
|
var e = _iterator__ex2g4s_0.v();
|
|
1712
|
-
var key = e.
|
|
1713
|
-
if (set.
|
|
1714
|
-
list_0.
|
|
1712
|
+
var key = e.my_1;
|
|
1713
|
+
if (set.y(key)) {
|
|
1714
|
+
list_0.y(e);
|
|
1715
1715
|
}
|
|
1716
1716
|
}
|
|
1717
1717
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1720,8 +1720,8 @@ protoOf(PythonIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1720
1720
|
var _iterator__ex2g4s_1 = list_0.t();
|
|
1721
1721
|
while (_iterator__ex2g4s_1.u()) {
|
|
1722
1722
|
var item = _iterator__ex2g4s_1.v();
|
|
1723
|
-
var tmp$ret$5 = import_0('.model.' + item.
|
|
1724
|
-
destination_0.
|
|
1723
|
+
var tmp$ret$5 = import_0('.model.' + item.my_1, item.my_1);
|
|
1724
|
+
destination_0.y(tmp$ret$5);
|
|
1725
1725
|
}
|
|
1726
1726
|
var modelImports = destination_0;
|
|
1727
1727
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1730,8 +1730,8 @@ protoOf(PythonIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1730
1730
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1731
1731
|
while (_iterator__ex2g4s_2.u()) {
|
|
1732
1732
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
1733
|
-
var tmp$ret$8 = import_0('.endpoint.' + item_0.
|
|
1734
|
-
destination_1.
|
|
1733
|
+
var tmp$ret$8 = import_0('.endpoint.' + item_0.ft_1.m1(), '*');
|
|
1734
|
+
destination_1.y(tmp$ret$8);
|
|
1735
1735
|
}
|
|
1736
1736
|
var endpointImports = destination_1;
|
|
1737
1737
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1740,8 +1740,8 @@ protoOf(PythonIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1740
1740
|
var _iterator__ex2g4s_3 = endpoints.t();
|
|
1741
1741
|
while (_iterator__ex2g4s_3.u()) {
|
|
1742
1742
|
var item_1 = _iterator__ex2g4s_3.v();
|
|
1743
|
-
var tmp$ret$11 = import_0('.client.' + item_1.
|
|
1744
|
-
destination_2.
|
|
1743
|
+
var tmp$ret$11 = import_0('.client.' + item_1.ft_1.m1() + 'Client', item_1.ft_1.m1() + 'Client');
|
|
1744
|
+
destination_2.y(tmp$ret$11);
|
|
1745
1745
|
}
|
|
1746
1746
|
var clientImports = destination_2;
|
|
1747
1747
|
var allImports = plus(plus(modelImports, endpointImports), clientImports);
|
|
@@ -1751,8 +1751,8 @@ protoOf(PythonIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1751
1751
|
var _iterator__ex2g4s_4 = endpoints.t();
|
|
1752
1752
|
while (_iterator__ex2g4s_4.u()) {
|
|
1753
1753
|
var item_2 = _iterator__ex2g4s_4.v();
|
|
1754
|
-
var tmp$ret$14 = item_2.
|
|
1755
|
-
destination_3.
|
|
1754
|
+
var tmp$ret$14 = item_2.ft_1.m1();
|
|
1755
|
+
destination_3.y(tmp$ret$14);
|
|
1756
1756
|
}
|
|
1757
1757
|
var endpointNames = destination_3;
|
|
1758
1758
|
// Inline function 'kotlin.let' call
|
|
@@ -1765,7 +1765,7 @@ protoOf(PythonIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1765
1765
|
accumulator = flattenEndpointTypeRefs(acc, element_0);
|
|
1766
1766
|
}
|
|
1767
1767
|
var file = accumulator;
|
|
1768
|
-
return new File(Companion_getInstance().
|
|
1768
|
+
return new File(Companion_getInstance().y1k(this.o22_1.qv() + file.g1r_1.z1k()), plus(plus(buildImports(this, '.wirespec'), allImports), file.h1r_1));
|
|
1769
1769
|
};
|
|
1770
1770
|
function replaceReflectInNonGenericStructFields(_this__u8e3s4) {
|
|
1771
1771
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -1773,14 +1773,14 @@ function replaceReflectInNonGenericStructFields(_this__u8e3s4) {
|
|
|
1773
1773
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1774
1774
|
var tmp = scope;
|
|
1775
1775
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1776
|
-
var this_0 = scope.
|
|
1776
|
+
var this_0 = scope.r1y_1;
|
|
1777
1777
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1778
1778
|
// Inline function 'kotlin.apply' call
|
|
1779
1779
|
var this_1 = new TransformerBuilder();
|
|
1780
|
-
this_1.
|
|
1781
|
-
var tmp$ret$2 = this_1.
|
|
1782
|
-
tmp.
|
|
1783
|
-
var tmp_0 = scope.
|
|
1780
|
+
this_1.i1m(replaceReflectInNonGenericStructFields$lambda);
|
|
1781
|
+
var tmp$ret$2 = this_1.j1m();
|
|
1782
|
+
tmp.r1y_1 = transform(this_0, tmp$ret$2);
|
|
1783
|
+
var tmp_0 = scope.r1y_1;
|
|
1784
1784
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1785
1785
|
}
|
|
1786
1786
|
function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
@@ -1789,14 +1789,14 @@ function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
|
1789
1789
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1790
1790
|
var tmp = scope;
|
|
1791
1791
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1792
|
-
var this_0 = scope.
|
|
1792
|
+
var this_0 = scope.r1y_1;
|
|
1793
1793
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1794
1794
|
// Inline function 'kotlin.apply' call
|
|
1795
1795
|
var this_1 = new TransformerBuilder();
|
|
1796
|
-
this_1.
|
|
1797
|
-
var tmp$ret$2 = this_1.
|
|
1798
|
-
tmp.
|
|
1799
|
-
var tmp_0 = scope.
|
|
1796
|
+
this_1.i1m(replaceRefinedFunctions$lambda(refined));
|
|
1797
|
+
var tmp$ret$2 = this_1.j1m();
|
|
1798
|
+
tmp.r1y_1 = transform(this_0, tmp$ret$2);
|
|
1799
|
+
var tmp_0 = scope.r1y_1;
|
|
1800
1800
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1801
1801
|
}
|
|
1802
1802
|
function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
@@ -1805,33 +1805,33 @@ function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
|
1805
1805
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1806
1806
|
var tmp = scope;
|
|
1807
1807
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1808
|
-
var this_0 = scope.
|
|
1808
|
+
var this_0 = scope.r1y_1;
|
|
1809
1809
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1810
1810
|
// Inline function 'kotlin.apply' call
|
|
1811
1811
|
var this_1 = new TransformerBuilder();
|
|
1812
|
-
this_1.
|
|
1813
|
-
var tmp$ret$2 = this_1.
|
|
1814
|
-
tmp.
|
|
1815
|
-
var tmp_0 = scope.
|
|
1812
|
+
this_1.i1m(snakeCaseHandlerAndCallMethods$lambda);
|
|
1813
|
+
var tmp$ret$2 = this_1.j1m();
|
|
1814
|
+
tmp.r1y_1 = transform(this_0, tmp$ret$2);
|
|
1815
|
+
var tmp_0 = scope.r1y_1;
|
|
1816
1816
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1817
1817
|
}
|
|
1818
1818
|
function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
1819
1819
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1820
1820
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1821
|
-
var tmp0 = _this__u8e3s4.
|
|
1821
|
+
var tmp0 = _this__u8e3s4.i1r();
|
|
1822
1822
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1823
1823
|
var destination = ArrayList_init_$Create$();
|
|
1824
1824
|
var _iterator__ex2g4s = tmp0.t();
|
|
1825
1825
|
while (_iterator__ex2g4s.u()) {
|
|
1826
1826
|
var element = _iterator__ex2g4s.v();
|
|
1827
1827
|
if (element instanceof Namespace) {
|
|
1828
|
-
destination.
|
|
1828
|
+
destination.y(element);
|
|
1829
1829
|
}
|
|
1830
1830
|
}
|
|
1831
1831
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1832
1832
|
var namespace = ensureNotNull(tmp$ret$2);
|
|
1833
1833
|
// Inline function 'kotlin.collections.partition' call
|
|
1834
|
-
var this_0 = namespace.
|
|
1834
|
+
var this_0 = namespace.n1r_1;
|
|
1835
1835
|
var first = ArrayList_init_$Create$();
|
|
1836
1836
|
var second = ArrayList_init_$Create$();
|
|
1837
1837
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
@@ -1844,22 +1844,22 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1844
1844
|
tmp = element_0 instanceof Union_0;
|
|
1845
1845
|
}
|
|
1846
1846
|
if (tmp) {
|
|
1847
|
-
first.
|
|
1847
|
+
first.y(element_0);
|
|
1848
1848
|
} else {
|
|
1849
|
-
second.
|
|
1849
|
+
second.y(element_0);
|
|
1850
1850
|
}
|
|
1851
1851
|
}
|
|
1852
1852
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1853
|
-
var moduleElements = _destruct__k2r9zo.
|
|
1854
|
-
var classElements = _destruct__k2r9zo.
|
|
1855
|
-
var endpointClass = new Namespace(namespace.
|
|
1856
|
-
return new File(namespace.
|
|
1853
|
+
var moduleElements = _destruct__k2r9zo.mf();
|
|
1854
|
+
var classElements = _destruct__k2r9zo.nf();
|
|
1855
|
+
var endpointClass = new Namespace(namespace.m1r_1, classElements, namespace.o1r_1);
|
|
1856
|
+
return new File(namespace.m1r_1, plus_0(moduleElements, endpointClass));
|
|
1857
1857
|
}
|
|
1858
1858
|
function flattenEndpointTypeRefs(_this__u8e3s4, endpointName) {
|
|
1859
1859
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1860
1860
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1861
|
-
scope.
|
|
1862
|
-
var tmp = scope.
|
|
1861
|
+
scope.x1y(flattenEndpointTypeRefs$lambda(endpointName));
|
|
1862
|
+
var tmp = scope.r1y_1;
|
|
1863
1863
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1864
1864
|
}
|
|
1865
1865
|
function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
@@ -1868,15 +1868,15 @@ function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
|
1868
1868
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1869
1869
|
var tmp = scope;
|
|
1870
1870
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1871
|
-
var this_0 = scope.
|
|
1871
|
+
var this_0 = scope.r1y_1;
|
|
1872
1872
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1873
1873
|
// Inline function 'kotlin.apply' call
|
|
1874
1874
|
var this_1 = new TransformerBuilder();
|
|
1875
|
-
this_1.
|
|
1876
|
-
var tmp$ret$2 = this_1.
|
|
1877
|
-
tmp.
|
|
1878
|
-
scope.
|
|
1879
|
-
var tmp_0 = scope.
|
|
1875
|
+
this_1.i1m(snakeCaseClientFunctions$lambda);
|
|
1876
|
+
var tmp$ret$2 = this_1.j1m();
|
|
1877
|
+
tmp.r1y_1 = transform(this_0, tmp$ret$2);
|
|
1878
|
+
scope.a1z(snakeCaseClientFunctions$lambda_0);
|
|
1879
|
+
var tmp_0 = scope.r1y_1;
|
|
1880
1880
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1881
1881
|
}
|
|
1882
1882
|
function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
@@ -1887,20 +1887,20 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1887
1887
|
} else {
|
|
1888
1888
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1889
1889
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1890
|
-
var tmp0 = tmp0_safe_receiver.
|
|
1890
|
+
var tmp0 = tmp0_safe_receiver.i1r();
|
|
1891
1891
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1892
1892
|
var destination = ArrayList_init_$Create$();
|
|
1893
1893
|
var _iterator__ex2g4s = tmp0.t();
|
|
1894
1894
|
while (_iterator__ex2g4s.u()) {
|
|
1895
1895
|
var element = _iterator__ex2g4s.v();
|
|
1896
1896
|
if (element instanceof Struct) {
|
|
1897
|
-
destination.
|
|
1897
|
+
destination.y(element);
|
|
1898
1898
|
}
|
|
1899
1899
|
}
|
|
1900
1900
|
tmp = firstOrNull_0(destination);
|
|
1901
1901
|
}
|
|
1902
1902
|
var struct = tmp;
|
|
1903
|
-
var tmp2_safe_receiver = struct == null ? null : struct.
|
|
1903
|
+
var tmp2_safe_receiver = struct == null ? null : struct.s1r_1;
|
|
1904
1904
|
var tmp_0;
|
|
1905
1905
|
if (tmp2_safe_receiver == null) {
|
|
1906
1906
|
tmp_0 = null;
|
|
@@ -1911,8 +1911,8 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1911
1911
|
var _iterator__ex2g4s_0 = tmp2_safe_receiver.t();
|
|
1912
1912
|
while (_iterator__ex2g4s_0.u()) {
|
|
1913
1913
|
var item = _iterator__ex2g4s_0.v();
|
|
1914
|
-
var tmp$ret$3 = item.
|
|
1915
|
-
destination_0.
|
|
1914
|
+
var tmp$ret$3 = item.n1t_1.u1m();
|
|
1915
|
+
destination_0.y(tmp$ret$3);
|
|
1916
1916
|
}
|
|
1917
1917
|
tmp_0 = destination_0;
|
|
1918
1918
|
}
|
|
@@ -1923,8 +1923,8 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1923
1923
|
return _this__u8e3s4;
|
|
1924
1924
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1925
1925
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1926
|
-
scope.
|
|
1927
|
-
var tmp_1 = scope.
|
|
1926
|
+
scope.a1z(addSelfReceiverToClientFields$lambda(fieldNames));
|
|
1927
|
+
var tmp_1 = scope.r1y_1;
|
|
1928
1928
|
return isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1929
1929
|
}
|
|
1930
1930
|
function replaceReflectAsTypeAny(_this__u8e3s4) {
|
|
@@ -1933,13 +1933,13 @@ function replaceReflectAsTypeAny(_this__u8e3s4) {
|
|
|
1933
1933
|
tmp = Custom_init_$Create$('type', listOf_0(Any_instance));
|
|
1934
1934
|
} else {
|
|
1935
1935
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
1936
|
-
tmp = _this__u8e3s4.
|
|
1936
|
+
tmp = _this__u8e3s4.s1q(replaceReflectAsTypeAny(_this__u8e3s4.q1m_1));
|
|
1937
1937
|
} else {
|
|
1938
1938
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
1939
|
-
tmp = _this__u8e3s4.
|
|
1939
|
+
tmp = _this__u8e3s4.s1q(replaceReflectAsTypeAny(_this__u8e3s4.r1m_1));
|
|
1940
1940
|
} else {
|
|
1941
1941
|
if (_this__u8e3s4 instanceof Dict_0) {
|
|
1942
|
-
tmp = _this__u8e3s4.
|
|
1942
|
+
tmp = _this__u8e3s4.v1q(replaceReflectAsTypeAny(_this__u8e3s4.t1q_1), replaceReflectAsTypeAny(_this__u8e3s4.u1q_1));
|
|
1943
1943
|
} else {
|
|
1944
1944
|
tmp = _this__u8e3s4;
|
|
1945
1945
|
}
|
|
@@ -1954,21 +1954,21 @@ function replaceReflectInNonGenericStructFields$lambda(element, transformer) {
|
|
|
1954
1954
|
var tmp$ret$1;
|
|
1955
1955
|
$l$block: {
|
|
1956
1956
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1957
|
-
if (!element.
|
|
1957
|
+
if (!element.w1r_1.r()) {
|
|
1958
1958
|
tmp$ret$1 = element;
|
|
1959
1959
|
break $l$block;
|
|
1960
1960
|
}
|
|
1961
1961
|
// Inline function 'kotlin.collections.map' call
|
|
1962
|
-
var this_0 = element.
|
|
1962
|
+
var this_0 = element.s1r_1;
|
|
1963
1963
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1964
1964
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1965
1965
|
var _iterator__ex2g4s = this_0.t();
|
|
1966
1966
|
while (_iterator__ex2g4s.u()) {
|
|
1967
1967
|
var item = _iterator__ex2g4s.v();
|
|
1968
|
-
var tmp$ret$2 = item.
|
|
1969
|
-
destination.
|
|
1968
|
+
var tmp$ret$2 = item.r1t(VOID, replaceReflectAsTypeAny(item.o1t_1));
|
|
1969
|
+
destination.y(tmp$ret$2);
|
|
1970
1970
|
}
|
|
1971
|
-
tmp$ret$1 = element.
|
|
1971
|
+
tmp$ret$1 = element.y1r(VOID, destination);
|
|
1972
1972
|
}
|
|
1973
1973
|
tmp = tmp$ret$1;
|
|
1974
1974
|
} else {
|
|
@@ -1979,17 +1979,17 @@ function replaceReflectInNonGenericStructFields$lambda(element, transformer) {
|
|
|
1979
1979
|
}
|
|
1980
1980
|
function replaceRefinedFunctions$lambda$lambda($constraintExpr) {
|
|
1981
1981
|
return function ($this$function) {
|
|
1982
|
-
$this$function.
|
|
1983
|
-
$this$function.
|
|
1984
|
-
$this$function.
|
|
1982
|
+
$this$function.j1l('self', Custom_init_$Create$(''));
|
|
1983
|
+
$this$function.m1l(Boolean_instance_0);
|
|
1984
|
+
$this$function.n1l($constraintExpr);
|
|
1985
1985
|
return Unit_instance;
|
|
1986
1986
|
};
|
|
1987
1987
|
}
|
|
1988
1988
|
function replaceRefinedFunctions$lambda$lambda_0($toStringExpr) {
|
|
1989
1989
|
return function ($this$function) {
|
|
1990
|
-
$this$function.
|
|
1991
|
-
$this$function.
|
|
1992
|
-
$this$function.
|
|
1990
|
+
$this$function.j1l('self', Custom_init_$Create$(''));
|
|
1991
|
+
$this$function.m1l(String_instance);
|
|
1992
|
+
$this$function.n1l(new RawExpression($toStringExpr));
|
|
1993
1993
|
return Unit_instance;
|
|
1994
1994
|
};
|
|
1995
1995
|
}
|
|
@@ -1998,7 +1998,7 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
1998
1998
|
var tmp;
|
|
1999
1999
|
if (element instanceof Struct) {
|
|
2000
2000
|
// Inline function 'kotlin.collections.mapNotNull' call
|
|
2001
|
-
var tmp0 = element.
|
|
2001
|
+
var tmp0 = element.v1r_1;
|
|
2002
2002
|
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
2003
2003
|
var destination = ArrayList_init_$Create$();
|
|
2004
2004
|
// Inline function 'kotlin.collections.forEach' call
|
|
@@ -2008,23 +2008,23 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
2008
2008
|
var tmp_0;
|
|
2009
2009
|
var tmp_1;
|
|
2010
2010
|
if (element_0 instanceof Function) {
|
|
2011
|
-
tmp_1 = element_0.
|
|
2011
|
+
tmp_1 = element_0.o1o_1.equals(Companion_getInstance().y1k('validate'));
|
|
2012
2012
|
} else {
|
|
2013
2013
|
tmp_1 = false;
|
|
2014
2014
|
}
|
|
2015
2015
|
if (tmp_1) {
|
|
2016
|
-
var constraintExpr = convertConstraint($refined.
|
|
2016
|
+
var constraintExpr = convertConstraint($refined.ev_1, new FieldCall(new VariableReference(Companion_getInstance().y1k('self')), Companion_getInstance().y1k('value')));
|
|
2017
2017
|
tmp_0 = function_0('validate', VOID, VOID, replaceRefinedFunctions$lambda$lambda(constraintExpr));
|
|
2018
2018
|
} else {
|
|
2019
2019
|
var tmp_2;
|
|
2020
2020
|
if (element_0 instanceof Function) {
|
|
2021
|
-
tmp_2 = element_0.
|
|
2021
|
+
tmp_2 = element_0.o1o_1.equals(Companion_getInstance().y1k('toString'));
|
|
2022
2022
|
} else {
|
|
2023
2023
|
tmp_2 = false;
|
|
2024
2024
|
}
|
|
2025
2025
|
if (tmp_2) {
|
|
2026
2026
|
var tmp_3;
|
|
2027
|
-
if ($refined.
|
|
2027
|
+
if ($refined.ev_1.qy_1 instanceof String_0) {
|
|
2028
2028
|
tmp_3 = 'self.value';
|
|
2029
2029
|
} else {
|
|
2030
2030
|
tmp_3 = 'str(self.value)';
|
|
@@ -2040,10 +2040,10 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
2040
2040
|
null;
|
|
2041
2041
|
else {
|
|
2042
2042
|
// Inline function 'kotlin.let' call
|
|
2043
|
-
destination.
|
|
2043
|
+
destination.y(tmp0_safe_receiver);
|
|
2044
2044
|
}
|
|
2045
2045
|
}
|
|
2046
|
-
tmp = element.
|
|
2046
|
+
tmp = element.y1r(VOID, VOID, VOID, VOID, destination);
|
|
2047
2047
|
} else {
|
|
2048
2048
|
tmp = element;
|
|
2049
2049
|
}
|
|
@@ -2056,23 +2056,23 @@ function snakeCaseHandlerAndCallMethods$lambda(element, transformer) {
|
|
|
2056
2056
|
if (element instanceof Interface) {
|
|
2057
2057
|
var tmp$ret$0;
|
|
2058
2058
|
$l$block: {
|
|
2059
|
-
if (!element.
|
|
2059
|
+
if (!element.a1s_1.equals(Companion_getInstance().y1k('Handler')) && !element.a1s_1.equals(Companion_getInstance().y1k('Call'))) {
|
|
2060
2060
|
tmp$ret$0 = element;
|
|
2061
2061
|
break $l$block;
|
|
2062
2062
|
}
|
|
2063
2063
|
// Inline function 'kotlin.collections.map' call
|
|
2064
|
-
var this_0 = element.
|
|
2064
|
+
var this_0 = element.b1s_1;
|
|
2065
2065
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2066
2066
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2067
2067
|
var _iterator__ex2g4s = this_0.t();
|
|
2068
2068
|
while (_iterator__ex2g4s.u()) {
|
|
2069
2069
|
var item = _iterator__ex2g4s.v();
|
|
2070
2070
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
2071
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
2071
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.w1o(Companion_getInstance().y1k(item.o1o_1.h1q()));
|
|
2072
2072
|
var tmp$ret$1 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
2073
|
-
destination.
|
|
2073
|
+
destination.y(tmp$ret$1);
|
|
2074
2074
|
}
|
|
2075
|
-
tmp$ret$0 = element.
|
|
2075
|
+
tmp$ret$0 = element.h1s(VOID, destination);
|
|
2076
2076
|
}
|
|
2077
2077
|
tmp = tmp$ret$0;
|
|
2078
2078
|
} else {
|
|
@@ -2087,17 +2087,17 @@ function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
|
2087
2087
|
if (!(type instanceof Custom_0)) {
|
|
2088
2088
|
tmp = type;
|
|
2089
2089
|
} else {
|
|
2090
|
-
if (!startsWith(type.
|
|
2090
|
+
if (!startsWith(type.s1m_1.z1k(), $endpointName + '.')) {
|
|
2091
2091
|
tmp = type;
|
|
2092
2092
|
} else {
|
|
2093
|
-
var suffix = removePrefix(type.
|
|
2093
|
+
var suffix = removePrefix(type.s1m_1.z1k(), $endpointName + '.');
|
|
2094
2094
|
switch (suffix) {
|
|
2095
2095
|
case 'Call':
|
|
2096
2096
|
case 'Handler':
|
|
2097
2097
|
tmp = type;
|
|
2098
2098
|
break;
|
|
2099
2099
|
default:
|
|
2100
|
-
tmp = type.
|
|
2100
|
+
tmp = type.x1q(Companion_getInstance().y1k(suffix));
|
|
2101
2101
|
break;
|
|
2102
2102
|
}
|
|
2103
2103
|
}
|
|
@@ -2108,7 +2108,7 @@ function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
|
2108
2108
|
function snakeCaseClientFunctions$lambda(element, transformer) {
|
|
2109
2109
|
var tmp;
|
|
2110
2110
|
if (element instanceof Function) {
|
|
2111
|
-
tmp = element.
|
|
2111
|
+
tmp = element.w1o(Companion_getInstance().y1k(element.o1o_1.h1q()), VOID, plus(listOf_0(new Parameter(Companion_getInstance().y1k('self'), Custom_init_$Create$(''))), element.q1o_1));
|
|
2112
2112
|
} else {
|
|
2113
2113
|
tmp = element;
|
|
2114
2114
|
}
|
|
@@ -2118,32 +2118,32 @@ function snakeCaseClientFunctions$lambda(element, transformer) {
|
|
|
2118
2118
|
function snakeCaseClientFunctions$lambda_0(stmt, tr) {
|
|
2119
2119
|
var tmp;
|
|
2120
2120
|
if (stmt instanceof FunctionCall) {
|
|
2121
|
-
var nameStr = stmt.
|
|
2122
|
-
var newName = contains(nameStr, '.') ? stmt.
|
|
2123
|
-
var tmp1_safe_receiver = stmt.
|
|
2121
|
+
var nameStr = stmt.l1q_1.u1m();
|
|
2122
|
+
var newName = contains(nameStr, '.') ? stmt.l1q_1 : Companion_getInstance().y1k(Companion_getInstance().y1k(nameStr).h1q());
|
|
2123
|
+
var tmp1_safe_receiver = stmt.j1q_1;
|
|
2124
2124
|
var tmp_0;
|
|
2125
2125
|
if (tmp1_safe_receiver == null) {
|
|
2126
2126
|
tmp_0 = null;
|
|
2127
2127
|
} else {
|
|
2128
2128
|
// Inline function 'kotlin.let' call
|
|
2129
|
-
tmp_0 = tr.
|
|
2129
|
+
tmp_0 = tr.m1y(tmp1_safe_receiver);
|
|
2130
2130
|
}
|
|
2131
2131
|
var tmp2_receiver = tmp_0;
|
|
2132
2132
|
// Inline function 'kotlin.collections.mapValues' call
|
|
2133
|
-
var this_0 = stmt.
|
|
2133
|
+
var this_0 = stmt.m1q_1;
|
|
2134
2134
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
2135
|
-
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.
|
|
2135
|
+
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.b1()));
|
|
2136
2136
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
2137
|
-
var _iterator__ex2g4s = this_0.
|
|
2137
|
+
var _iterator__ex2g4s = this_0.k1().t();
|
|
2138
2138
|
while (_iterator__ex2g4s.u()) {
|
|
2139
2139
|
var element = _iterator__ex2g4s.v();
|
|
2140
|
-
var tmp_1 = element.
|
|
2140
|
+
var tmp_1 = element.l1();
|
|
2141
2141
|
// Inline function 'kotlin.collections.component2' call
|
|
2142
|
-
var v = element.
|
|
2143
|
-
var tmp$ret$4 = tr.
|
|
2144
|
-
destination.
|
|
2142
|
+
var v = element.m1();
|
|
2143
|
+
var tmp$ret$4 = tr.m1y(v);
|
|
2144
|
+
destination.t2(tmp_1, tmp$ret$4);
|
|
2145
2145
|
}
|
|
2146
|
-
var tmp4_isAwait = !(stmt.
|
|
2146
|
+
var tmp4_isAwait = !(stmt.j1q_1 == null);
|
|
2147
2147
|
tmp = new FunctionCall(tmp2_receiver, VOID, newName, destination, tmp4_isAwait);
|
|
2148
2148
|
} else {
|
|
2149
2149
|
tmp = transformChildren(stmt, tr);
|
|
@@ -2156,28 +2156,28 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
2156
2156
|
var tmp_0;
|
|
2157
2157
|
var tmp_1;
|
|
2158
2158
|
if (stmt instanceof FieldCall) {
|
|
2159
|
-
tmp_1 = stmt.
|
|
2159
|
+
tmp_1 = stmt.d1u_1 == null;
|
|
2160
2160
|
} else {
|
|
2161
2161
|
tmp_1 = false;
|
|
2162
2162
|
}
|
|
2163
2163
|
if (tmp_1) {
|
|
2164
|
-
tmp_0 = $fieldNames.
|
|
2164
|
+
tmp_0 = $fieldNames.v1(stmt.e1u_1.u1m());
|
|
2165
2165
|
} else {
|
|
2166
2166
|
tmp_0 = false;
|
|
2167
2167
|
}
|
|
2168
2168
|
if (tmp_0) {
|
|
2169
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().
|
|
2169
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().y1k('self')), stmt.e1u_1);
|
|
2170
2170
|
} else {
|
|
2171
2171
|
if (stmt instanceof FieldCall) {
|
|
2172
|
-
var tmp0_safe_receiver = stmt.
|
|
2172
|
+
var tmp0_safe_receiver = stmt.d1u_1;
|
|
2173
2173
|
var tmp_2;
|
|
2174
2174
|
if (tmp0_safe_receiver == null) {
|
|
2175
2175
|
tmp_2 = null;
|
|
2176
2176
|
} else {
|
|
2177
2177
|
// Inline function 'kotlin.let' call
|
|
2178
|
-
tmp_2 = tr.
|
|
2178
|
+
tmp_2 = tr.m1y(tmp0_safe_receiver);
|
|
2179
2179
|
}
|
|
2180
|
-
tmp = new FieldCall(tmp_2, stmt.
|
|
2180
|
+
tmp = new FieldCall(tmp_2, stmt.e1u_1);
|
|
2181
2181
|
} else {
|
|
2182
2182
|
tmp = transformChildren(stmt, tr);
|
|
2183
2183
|
}
|
|
@@ -2188,8 +2188,8 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
2188
2188
|
function PythonRefinedTypeDefinitionEmitter() {
|
|
2189
2189
|
}
|
|
2190
2190
|
function PythonShared() {
|
|
2191
|
-
this.
|
|
2192
|
-
this.
|
|
2191
|
+
this.h22_1 = 'shared';
|
|
2192
|
+
this.i22_1 = "from abc import ABC, abstractmethod\nfrom dataclasses import dataclass\nfrom enum import Enum\nfrom typing import Generic, List, Dict, Optional, TypeVar\n\nT = TypeVar('T')\nREQ = TypeVar('REQ')\nRES = TypeVar('RES')\n\nclass Wirespec:\n\n class Refined(ABC, Generic[T]):\n @property\n @abstractmethod\n def value(self) -> T: pass\n\n class Endpoint(ABC):\n\n class Handler(ABC):\n pass\n\n class Convert(ABC, Generic[REQ, RES]):\n @staticmethod\n @abstractmethod\n def to_raw_request(serializer: 'Wirespec.Serializer', req: REQ) -> 'Wirespec.RawRequest': pass\n\n @staticmethod\n @abstractmethod\n def from_raw_response(serializer: 'Wirespec.Deserializer', res: 'Wirespec.RawResponse') -> RES: pass\n\n @staticmethod\n @abstractmethod\n def to_raw_response(serializer: 'Wirespec.Serializer', res: RES) -> 'Wirespec.RawResponse': pass\n\n @staticmethod\n @abstractmethod\n def from_raw_request(serializer: 'Wirespec.Deserializer[T]', req: 'Wirespec.RawRequest') -> REQ: pass\n\n class Method(Enum):\n GET = \"GET\"\n PUT = \"PUT\"\n POST = \"POST\"\n DELETE = \"DELETE\"\n OPTIONS = \"OPTIONS\"\n HEAD = \"HEAD\"\n PATCH = \"PATCH\"\n TRACE = \"TRACE\"\n\n class Request(Generic[T], ABC):\n\n class Path(ABC): pass\n\n class Queries(ABC): pass\n\n class Headers(ABC): pass\n\n @property\n @abstractmethod\n def path(self) -> Path: pass\n\n @property\n @abstractmethod\n def method(self) -> 'Wirespec.Method': pass\n\n @property\n @abstractmethod\n def queries(self) -> Queries: pass\n\n @property\n @abstractmethod\n def headers(self) -> Headers: pass\n\n @property\n @abstractmethod\n def body(self) -> T: pass\n\n class Response(Generic[T], ABC):\n\n class Headers(ABC): pass\n\n @property\n @abstractmethod\n def status(self) -> int: pass\n\n @property\n @abstractmethod\n def headers(self) -> Headers: pass\n\n @property\n @abstractmethod\n def body(self) -> T: pass\n\n class Serializer(Generic[T], ABC):\n @abstractmethod\n def serialize(self, value: T, t: type[T]) -> str: pass\n @abstractmethod\n def serialize_param(self, value: T, t: type[T]) -> List[str]: pass\n\n class Deserializer(Generic[T], ABC):\n @abstractmethod\n def deserialize(self, value: str | None, t: type[T]) -> T: pass\n @abstractmethod\n def deserialize_param(self, value: List[str] | None, t: type[T]) -> T: pass\n\n class Serialization(Serializer, Deserializer):\n @abstractmethod\n def serialize(self, value: T, t: type[T]) -> str: pass\n @abstractmethod\n def serialize_param(self, value: T, t: type[T]) -> List[str]: pass\n @abstractmethod\n def deserialize(self, value: str | None, t: type[T]) -> T: pass\n @abstractmethod\n def deserialize_param(self, value: List[str] | None, t: type[T]) -> T: pass\n\n @dataclass\n class RawRequest:\n method: str\n path: List[str]\n queries: Dict[str, List[str]]\n headers: Dict[str, List[str]]\n body: Optional[str]\n\n\n @dataclass\n class RawResponse:\n status_code: int\n headers: Dict[str, List[str]]\n body: Optional[str]\n";
|
|
2193
2193
|
}
|
|
2194
2194
|
protoOf(PythonShared).toString = function () {
|
|
2195
2195
|
return 'PythonShared';
|
|
@@ -2210,17 +2210,17 @@ function PythonShared_getInstance() {
|
|
|
2210
2210
|
}
|
|
2211
2211
|
function PythonTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
2212
2212
|
return function (it) {
|
|
2213
|
-
return this$0.
|
|
2213
|
+
return this$0.m22(it);
|
|
2214
2214
|
};
|
|
2215
2215
|
}
|
|
2216
2216
|
function PythonTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2217
2217
|
return function (it) {
|
|
2218
|
-
return this$0.
|
|
2218
|
+
return this$0.m22(it);
|
|
2219
2219
|
};
|
|
2220
2220
|
}
|
|
2221
2221
|
function PythonTypeDefinitionEmitter$emit$lambda_1(this$0) {
|
|
2222
2222
|
return function (it) {
|
|
2223
|
-
return Spacer_instance.toString() + this$0.
|
|
2223
|
+
return Spacer_instance.toString() + this$0.xt(it);
|
|
2224
2224
|
};
|
|
2225
2225
|
}
|
|
2226
2226
|
function PythonTypeDefinitionEmitter() {
|
|
@@ -2228,27 +2228,27 @@ function PythonTypeDefinitionEmitter() {
|
|
|
2228
2228
|
function PythonUnionDefinitionEmitter() {
|
|
2229
2229
|
}
|
|
2230
2230
|
//region block: post-declaration
|
|
2231
|
-
protoOf(PythonEmitter).
|
|
2232
|
-
protoOf(PythonEmitter).
|
|
2233
|
-
protoOf(PythonEmitter).
|
|
2234
|
-
protoOf(PythonEmitter).
|
|
2235
|
-
protoOf(PythonEmitter).
|
|
2236
|
-
protoOf(PythonEmitter).
|
|
2237
|
-
protoOf(PythonEmitter).
|
|
2238
|
-
protoOf(PythonEmitter).
|
|
2239
|
-
protoOf(PythonEmitter).
|
|
2240
|
-
protoOf(PythonEmitter).
|
|
2241
|
-
protoOf(PythonEmitter).
|
|
2242
|
-
protoOf(PythonEmitter).
|
|
2243
|
-
protoOf(PythonEmitter).
|
|
2244
|
-
protoOf(PythonEmitter).
|
|
2245
|
-
protoOf(PythonEmitter).
|
|
2246
|
-
protoOf(PythonEmitter).
|
|
2247
|
-
protoOf(PythonEmitter).
|
|
2248
|
-
protoOf(PythonEmitter).
|
|
2249
|
-
protoOf(PythonEmitter).
|
|
2250
|
-
protoOf(PythonIrEmitter).
|
|
2251
|
-
protoOf(PythonIrEmitter).
|
|
2231
|
+
protoOf(PythonEmitter).vt = emit_4;
|
|
2232
|
+
protoOf(PythonEmitter).wt = emit_5;
|
|
2233
|
+
protoOf(PythonEmitter).xt = emit_6;
|
|
2234
|
+
protoOf(PythonEmitter).yt = emit_7;
|
|
2235
|
+
protoOf(PythonEmitter).zt = emit_9;
|
|
2236
|
+
protoOf(PythonEmitter).kv = emit_15;
|
|
2237
|
+
protoOf(PythonEmitter).fv = emit_10;
|
|
2238
|
+
protoOf(PythonEmitter).lv = emit_11;
|
|
2239
|
+
protoOf(PythonEmitter).av = emit_14;
|
|
2240
|
+
protoOf(PythonEmitter).yu = emit_3;
|
|
2241
|
+
protoOf(PythonEmitter).zu = emit_2;
|
|
2242
|
+
protoOf(PythonEmitter).j22 = emit_8;
|
|
2243
|
+
protoOf(PythonEmitter).q20 = emit_12;
|
|
2244
|
+
protoOf(PythonEmitter).k22 = emit_13;
|
|
2245
|
+
protoOf(PythonEmitter).mv = emitValidator;
|
|
2246
|
+
protoOf(PythonEmitter).d21 = sanitize;
|
|
2247
|
+
protoOf(PythonEmitter).t20 = sanitizeKeywords;
|
|
2248
|
+
protoOf(PythonEmitter).l22 = emitType;
|
|
2249
|
+
protoOf(PythonEmitter).m22 = emitReferenceCustomImports;
|
|
2250
|
+
protoOf(PythonIrEmitter).pr = emit_1;
|
|
2251
|
+
protoOf(PythonIrEmitter).j1z = beforeGenerate;
|
|
2252
2252
|
//endregion
|
|
2253
2253
|
//region block: init
|
|
2254
2254
|
PythonShared_instance = new PythonShared();
|