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