@flock/wirespec 0.19.0-RC.2 → 0.19.0
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 +163 -163
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt-mordant.mjs.map +1 -1
- package/clikt-clikt.mjs +1566 -1566
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +444 -444
- package/kotlin-kotlin-stdlib.mjs +2571 -5539
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +20696 -6702
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1818 -1818
- package/kotlinx-io-kotlinx-io-core.mjs +453 -453
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +2224 -2061
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1956 -1481
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1361 -1361
- package/package.json +14 -9
- package/wirespec-lsp.mjs +7 -0
- package/wirespec-msw.d.ts +53 -0
- package/wirespec-msw.mjs +83 -0
- package/wirespec-src-compiler-core.mjs +1760 -1696
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +461 -425
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +408 -309
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +382 -383
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +448 -425
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +171 -172
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +508 -477
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +83 -83
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3869 -3919
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +418 -418
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +512 -512
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +1596 -1522
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +4928 -0
- package/wirespec-src-ide-lsp.mjs.map +1 -0
- package/wirespec-src-plugin-arguments.mjs +185 -185
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +106 -106
- package/wirespec-src-plugin-npm.d.mts +2 -11
- package/wirespec-src-plugin-npm.mjs +47 -42
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +53 -53
- package/wirespec-src-tools-generator.mjs.map +1 -1
- package/Kotlin-DateTime-library-kotlinx-datetime.mjs +0 -4
- package/Kotlin-DateTime-library-kotlinx-datetime.mjs.map +0 -1
- package/kotest-kotest-assertions-kotest-assertions-core.mjs +0 -4
- package/kotest-kotest-assertions-kotest-assertions-core.mjs.map +0 -1
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs +0 -4
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs.map +0 -1
- package/kotest-kotest-common.mjs +0 -56
- package/kotest-kotest-common.mjs.map +0 -1
- package/kotest-kotest-framework-kotest-framework-engine.mjs +0 -4
- package/kotest-kotest-framework-kotest-framework-engine.mjs.map +0 -1
- package/kotest-kotest-property-kotest-property-datetime.mjs +0 -4
- package/kotest-kotest-property-kotest-property-datetime.mjs.map +0 -1
- package/kotest-kotest-property.mjs +0 -3230
- package/kotest-kotest-property.mjs.map +0 -1
- package/kotest-property-arbs.mjs +0 -482
- package/kotest-property-arbs.mjs.map +0 -1
- package/kotlinx-coroutines-test.mjs +0 -4
- package/kotlinx-coroutines-test.mjs.map +0 -1
- package/wirespec-generator.d.ts +0 -52
- package/wirespec-generator.mjs +0 -9
- package/wirespec-src-integration-kotest.mjs +0 -1537
- package/wirespec-src-integration-kotest.mjs.map +0 -1
- package/xmlutil-core.mjs +0 -4
- package/xmlutil-core.mjs.map +0 -1
- package/xmlutil-serialization.mjs +0 -4
- package/xmlutil-serialization.mjs.map +0 -1
|
@@ -174,14 +174,13 @@ import {
|
|
|
174
174
|
TransformerBuildera6a1gvlhjj9b as TransformerBuilder,
|
|
175
175
|
transform3eti8i2bqvifx as transform,
|
|
176
176
|
Namespace345pal554qu3j as Namespace,
|
|
177
|
-
flattenNestedStructs2956rxx8q2zxl as flattenNestedStructs,
|
|
178
177
|
Union38f3pecvfcpxh as Union_0,
|
|
179
178
|
Struct39wf79cwtn4ty as Struct,
|
|
180
179
|
Dict22iqrhoo0g8et as Dict_0,
|
|
181
180
|
Array2goj74t0aak7b as Array_0,
|
|
182
181
|
Nullable3wjn6l6q3h6o as Nullable,
|
|
183
182
|
Any_instance2998xag3cdzh3 as Any_instance,
|
|
184
|
-
|
|
183
|
+
Custom_init_$Create$2enn7oyj71j1t as Custom_init_$Create$,
|
|
185
184
|
Reflect_instance3i17lxiopj78t as Reflect_instance,
|
|
186
185
|
transformChildrend9p91tpcqdkx as transformChildren_1,
|
|
187
186
|
Boolean_instance27opaqtiiiysz as Boolean_instance_0,
|
|
@@ -192,6 +191,7 @@ import {
|
|
|
192
191
|
FieldCall1iz7z2fx2xo4p as FieldCall,
|
|
193
192
|
convertConstraintkgpvomct0x0s as convertConstraint,
|
|
194
193
|
Interface3pn84xq686t2r as Interface,
|
|
194
|
+
Custom2si7lto3wompr as Custom_0,
|
|
195
195
|
Parameteruqoxd4rzw7ga as Parameter,
|
|
196
196
|
FunctionCall30872kpnbr7op as FunctionCall,
|
|
197
197
|
} from './wirespec-src-compiler-ir.mjs';
|
|
@@ -206,10 +206,10 @@ initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, V
|
|
|
206
206
|
function emit_3(identifier) {
|
|
207
207
|
var tmp;
|
|
208
208
|
if (identifier instanceof DefinitionIdentifier) {
|
|
209
|
-
tmp = this.
|
|
209
|
+
tmp = this.r1x(identifier);
|
|
210
210
|
} else {
|
|
211
211
|
if (identifier instanceof FieldIdentifier) {
|
|
212
|
-
tmp = this.
|
|
212
|
+
tmp = this.h1x(this.r1x(identifier));
|
|
213
213
|
} else {
|
|
214
214
|
noWhenBranchMatchedException();
|
|
215
215
|
}
|
|
@@ -218,7 +218,7 @@ function emit_3(identifier) {
|
|
|
218
218
|
}
|
|
219
219
|
function sanitize(_this__u8e3s4) {
|
|
220
220
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
221
|
-
var this_0 = split(_this__u8e3s4.
|
|
221
|
+
var this_0 = split(_this__u8e3s4.l1(), ['.', ' ']);
|
|
222
222
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
223
223
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
224
224
|
var index = 0;
|
|
@@ -227,7 +227,7 @@ function sanitize(_this__u8e3s4) {
|
|
|
227
227
|
var item = _iterator__ex2g4s.v();
|
|
228
228
|
var _unary__edvuaz = index;
|
|
229
229
|
index = _unary__edvuaz + 1 | 0;
|
|
230
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
230
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.er(item) : item;
|
|
231
231
|
destination.x(tmp$ret$0);
|
|
232
232
|
}
|
|
233
233
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -265,42 +265,51 @@ function sanitize(_this__u8e3s4) {
|
|
|
265
265
|
return tmp;
|
|
266
266
|
}
|
|
267
267
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
268
|
-
return Companion_getInstance_0().
|
|
268
|
+
return Companion_getInstance_0().b1z_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
269
269
|
}
|
|
270
270
|
initMetadataForInterface(PythonIdentifierEmitter, 'PythonIdentifierEmitter');
|
|
271
|
-
function emit_4(
|
|
271
|
+
function emit_4(union) {
|
|
272
|
+
return trimMargin('\n |class ' + this.nr(union.gp_1) + '(ABC):\n |' + Spacer_instance.toString() + 'pass\n ');
|
|
273
|
+
}
|
|
274
|
+
initMetadataForInterface(PythonUnionDefinitionEmitter, 'PythonUnionDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
275
|
+
function emit_5(enum_0, module_0) {
|
|
276
|
+
var tmp = this.r1x(enum_0.xr_1);
|
|
277
|
+
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 ');
|
|
278
|
+
}
|
|
279
|
+
initMetadataForInterface(PythonEnumDefinitionEmitter, 'PythonEnumDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
280
|
+
function emit_6(type, module_0) {
|
|
272
281
|
var tmp;
|
|
273
|
-
if (type.
|
|
274
|
-
var tmp_0 = this.
|
|
282
|
+
if (type.mp_1.ip_1.r()) {
|
|
283
|
+
var tmp_0 = this.nr(type.lp_1);
|
|
275
284
|
var tmp_1 = Spacer_instance.toString();
|
|
276
285
|
var tmp_2 = importReferences(type);
|
|
277
286
|
tmp = trimMargin('\n |@dataclass\n |class ' + tmp_0 + ':\n |' + tmp_1 + 'pass\n |\n |' + joinToString(tmp_2, '\n', VOID, VOID, VOID, VOID, PythonTypeDefinitionEmitter$emit$lambda(this)) + '\n |\n ');
|
|
278
287
|
} else {
|
|
279
|
-
var tmp_3 = this.
|
|
280
|
-
var tmp_4 = this.
|
|
288
|
+
var tmp_3 = this.nr(type.lp_1);
|
|
289
|
+
var tmp_4 = this.lq(type.mp_1);
|
|
281
290
|
var tmp_5 = importReferences(type);
|
|
282
291
|
tmp = trimMargin('\n |@dataclass\n |class ' + tmp_3 + ':\n |' + tmp_4 + '\n |\n |' + joinToString(tmp_5, '\n', VOID, VOID, VOID, VOID, PythonTypeDefinitionEmitter$emit$lambda_0(this)) + '\n ');
|
|
283
292
|
}
|
|
284
293
|
return tmp;
|
|
285
294
|
}
|
|
286
|
-
function
|
|
287
|
-
return joinToString(_this__u8e3s4.
|
|
295
|
+
function emit_7(_this__u8e3s4) {
|
|
296
|
+
return joinToString(_this__u8e3s4.ip_1, '\n', VOID, VOID, VOID, VOID, PythonTypeDefinitionEmitter$emit$lambda_1(this));
|
|
288
297
|
}
|
|
289
|
-
function
|
|
290
|
-
return this.
|
|
298
|
+
function emit_8(_this__u8e3s4) {
|
|
299
|
+
return this.nr(_this__u8e3s4.qp_1) + ": '" + this.nq(_this__u8e3s4.rp_1) + "'";
|
|
291
300
|
}
|
|
292
|
-
function
|
|
301
|
+
function emit_9(_this__u8e3s4) {
|
|
293
302
|
// Inline function 'kotlin.let' call
|
|
294
|
-
var it = this.
|
|
295
|
-
return _this__u8e3s4.
|
|
303
|
+
var it = this.z1y(_this__u8e3s4);
|
|
304
|
+
return _this__u8e3s4.tu() ? 'Optional[' + it + ']' : it;
|
|
296
305
|
}
|
|
297
306
|
function emitType(_this__u8e3s4) {
|
|
298
307
|
var tmp;
|
|
299
308
|
if (_this__u8e3s4 instanceof Dict) {
|
|
300
|
-
tmp = 'Dict[str, ' + this.
|
|
309
|
+
tmp = 'Dict[str, ' + this.nq(_this__u8e3s4.so_1) + ']';
|
|
301
310
|
} else {
|
|
302
311
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
303
|
-
tmp = 'List[' + this.
|
|
312
|
+
tmp = 'List[' + this.nq(_this__u8e3s4.po_1) + ']';
|
|
304
313
|
} else {
|
|
305
314
|
if (_this__u8e3s4 instanceof Unit) {
|
|
306
315
|
tmp = 'None';
|
|
@@ -309,10 +318,10 @@ function emitType(_this__u8e3s4) {
|
|
|
309
318
|
tmp = 'Any';
|
|
310
319
|
} else {
|
|
311
320
|
if (_this__u8e3s4 instanceof Custom) {
|
|
312
|
-
tmp = _this__u8e3s4.
|
|
321
|
+
tmp = _this__u8e3s4.bv_1;
|
|
313
322
|
} else {
|
|
314
323
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
315
|
-
tmp = this.
|
|
324
|
+
tmp = this.x1y(_this__u8e3s4.fv_1);
|
|
316
325
|
} else {
|
|
317
326
|
noWhenBranchMatchedException();
|
|
318
327
|
}
|
|
@@ -323,7 +332,7 @@ function emitType(_this__u8e3s4) {
|
|
|
323
332
|
}
|
|
324
333
|
return tmp;
|
|
325
334
|
}
|
|
326
|
-
function
|
|
335
|
+
function emit_10(_this__u8e3s4) {
|
|
327
336
|
var tmp;
|
|
328
337
|
if (_this__u8e3s4 instanceof String_0) {
|
|
329
338
|
tmp = 'str';
|
|
@@ -348,13 +357,13 @@ function emit_8(_this__u8e3s4) {
|
|
|
348
357
|
}
|
|
349
358
|
return tmp;
|
|
350
359
|
}
|
|
351
|
-
function
|
|
360
|
+
function emit_11(_this__u8e3s4) {
|
|
352
361
|
var tmp;
|
|
353
362
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
354
|
-
tmp = 'bool(re.match(r"' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.
|
|
363
|
+
tmp = 'bool(re.match(r"' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.pt_1) + '", self.value))';
|
|
355
364
|
} else {
|
|
356
365
|
if (_this__u8e3s4 instanceof Bound) {
|
|
357
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
366
|
+
var tmp1_safe_receiver = _this__u8e3s4.fu_1;
|
|
358
367
|
var tmp_0;
|
|
359
368
|
if (tmp1_safe_receiver == null) {
|
|
360
369
|
tmp_0 = null;
|
|
@@ -363,7 +372,7 @@ function emit_9(_this__u8e3s4) {
|
|
|
363
372
|
tmp_0 = tmp1_safe_receiver + ' < self.value';
|
|
364
373
|
}
|
|
365
374
|
var minCheck = tmp_0;
|
|
366
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
375
|
+
var tmp2_safe_receiver = _this__u8e3s4.gu_1;
|
|
367
376
|
var tmp_1;
|
|
368
377
|
if (tmp2_safe_receiver == null) {
|
|
369
378
|
tmp_1 = null;
|
|
@@ -389,26 +398,26 @@ function emit_9(_this__u8e3s4) {
|
|
|
389
398
|
return tmp;
|
|
390
399
|
}
|
|
391
400
|
function emitReferenceCustomImports(_this__u8e3s4) {
|
|
392
|
-
return 'from ..model.' + _this__u8e3s4.
|
|
401
|
+
return 'from ..model.' + _this__u8e3s4.bv_1 + ' import ' + _this__u8e3s4.bv_1;
|
|
393
402
|
}
|
|
394
403
|
initMetadataForInterface(PythonTypeDefinitionEmitter, 'PythonTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
395
|
-
function
|
|
404
|
+
function emit_12(endpoint) {
|
|
396
405
|
var tmp = importReferences(endpoint);
|
|
397
406
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda(this));
|
|
398
|
-
var tmp_1 = this.
|
|
399
|
-
var tmp_2 = spacer(this.
|
|
400
|
-
var tmp_3 = distinctByStatus(endpoint.
|
|
407
|
+
var tmp_1 = this.nr(endpoint.up_1);
|
|
408
|
+
var tmp_2 = spacer(this.e1x(first(endpoint.zp_1), endpoint), 1);
|
|
409
|
+
var tmp_3 = distinctByStatus(endpoint.aq_1);
|
|
401
410
|
return trimMargin('\n |' + tmp_0 + '\n |\n |class ' + tmp_1 + ' (Wirespec.Endpoint):\n |' + tmp_2 + '\n |' + spacer(joinToString(tmp_3, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda_0(this, endpoint)), 1) + '\n |' + spacer(emitResponseUnion(this, endpoint), 1) + '\n |' + spacer(emitHandleClass(this, endpoint), 1) + '\n |' + spacer(emitConvertClass(this, endpoint), 1) + '\n |\n ');
|
|
402
411
|
}
|
|
403
|
-
function
|
|
404
|
-
var tmp = emit_18(this, _this__u8e3s4.
|
|
412
|
+
function emit_13(_this__u8e3s4, endpoint) {
|
|
413
|
+
var tmp = emit_18(this, _this__u8e3s4.dq_1);
|
|
405
414
|
var tmp_0 = get_pathParams(endpoint);
|
|
406
415
|
var tmp_1 = emitObject$default(this, tmp_0, 'Path', 'Wirespec.Request.Path', VOID, PythonEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
407
|
-
var tmp_2 = emitObject$default(this, endpoint.
|
|
408
|
-
var tmp_3 = emitObject$default(this, endpoint.
|
|
416
|
+
var tmp_2 = emitObject$default(this, endpoint.xp_1, 'Queries', 'Wirespec.Request.Queries', VOID, PythonEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
417
|
+
var tmp_3 = emitObject$default(this, endpoint.yp_1, 'Headers', 'Wirespec.Request.Headers', VOID, PythonEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
409
418
|
var tmp_4 = Spacer_instance.toString();
|
|
410
419
|
var tmp_5 = Spacer_instance.toString();
|
|
411
|
-
var tmp_6 = emit_18(this, _this__u8e3s4.
|
|
420
|
+
var tmp_6 = emit_18(this, _this__u8e3s4.dq_1);
|
|
412
421
|
var tmp_7 = Spacer_instance.toString();
|
|
413
422
|
var tmp_8 = Spacer_instance.toString();
|
|
414
423
|
var tmp_9 = Spacer_instance.toString();
|
|
@@ -424,70 +433,61 @@ function emit_11(_this__u8e3s4, endpoint) {
|
|
|
424
433
|
var tmp_19 = Spacer_instance.toString();
|
|
425
434
|
var tmp_20 = Spacer_instance.toString();
|
|
426
435
|
var tmp_21 = Spacer_instance.toString();
|
|
427
|
-
var tmp_22 = emit_18(this, _this__u8e3s4.
|
|
436
|
+
var tmp_22 = emit_18(this, _this__u8e3s4.dq_1);
|
|
428
437
|
var tmp_23 = Spacer_instance.toString();
|
|
429
438
|
var tmp_24 = Spacer_instance.toString();
|
|
430
439
|
var tmp_25 = Spacer_instance.toString();
|
|
431
440
|
var tmp_26 = Spacer_instance.toString();
|
|
432
441
|
var tmp_27 = Spacer_instance.toString();
|
|
433
442
|
var tmp_28 = paramList(_this__u8e3s4, endpoint);
|
|
434
|
-
return trimMargin('\n |@dataclass\n |class Request(Wirespec.Request[' + tmp + ']):\n |' + tmp_1 + '\n |' + tmp_2 + '\n |' + tmp_3 + '\n |\n |' + tmp_4 + '@property\n |' + tmp_5 + 'def body(self) -> ' + tmp_6 + ':\n |' + tmp_7 + tmp_8 + 'return self._body\n |\n |' + tmp_9 + '@property\n |' + tmp_10 + 'def path(self) -> Path:\n |' + tmp_11 + tmp_12 + 'return self._path\n |\n |' + tmp_13 + '@property\n |' + tmp_14 + 'def queries(self) -> Queries:\n |' + tmp_15 + tmp_16 + 'return self._queries\n |\n |' + tmp_17 + '@property\n |' + tmp_18 + 'def headers(self) -> Headers:\n |' + tmp_19 + tmp_20 + 'return self._headers\n |\n |' + tmp_21 + '_body: ' + tmp_22 + '\n |' + tmp_23 + '_headers: Headers\n |' + tmp_24 + '_queries: Queries\n |' + tmp_25 + '_path: Path\n |' + tmp_26 + 'method: Wirespec.Method = Wirespec.Method.' + endpoint.
|
|
443
|
+
return trimMargin('\n |@dataclass\n |class Request(Wirespec.Request[' + tmp + ']):\n |' + tmp_1 + '\n |' + tmp_2 + '\n |' + tmp_3 + '\n |\n |' + tmp_4 + '@property\n |' + tmp_5 + 'def body(self) -> ' + tmp_6 + ':\n |' + tmp_7 + tmp_8 + 'return self._body\n |\n |' + tmp_9 + '@property\n |' + tmp_10 + 'def path(self) -> Path:\n |' + tmp_11 + tmp_12 + 'return self._path\n |\n |' + tmp_13 + '@property\n |' + tmp_14 + 'def queries(self) -> Queries:\n |' + tmp_15 + tmp_16 + 'return self._queries\n |\n |' + tmp_17 + '@property\n |' + tmp_18 + 'def headers(self) -> Headers:\n |' + tmp_19 + tmp_20 + 'return self._headers\n |\n |' + tmp_21 + '_body: ' + tmp_22 + '\n |' + tmp_23 + '_headers: Headers\n |' + tmp_24 + '_queries: Queries\n |' + tmp_25 + '_path: Path\n |' + tmp_26 + 'method: Wirespec.Method = Wirespec.Method.' + endpoint.vp_1.a3_1 + '\n |\n |' + tmp_27 + 'def __init__(self, ' + joinToString(tmp_28, ', ', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda_4(this)) + '):\n |' + spacer(emitAssignSelf_0(this, _this__u8e3s4, endpoint), 2) + '\n |\n ');
|
|
435
444
|
}
|
|
436
|
-
function
|
|
437
|
-
var tmp = emit_18(this, _this__u8e3s4.
|
|
438
|
-
var tmp_0 = emitObject$default(this, _this__u8e3s4.
|
|
445
|
+
function emit_14(_this__u8e3s4, endpoint) {
|
|
446
|
+
var tmp = emit_18(this, _this__u8e3s4.iq_1);
|
|
447
|
+
var tmp_0 = emitObject$default(this, _this__u8e3s4.hq_1, 'Headers', 'Wirespec.Response.Headers', VOID, PythonEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
439
448
|
var tmp_1 = Spacer_instance.toString();
|
|
440
449
|
var tmp_2 = Spacer_instance.toString();
|
|
441
450
|
var tmp_3 = Spacer_instance.toString();
|
|
442
451
|
var tmp_4 = Spacer_instance.toString();
|
|
443
452
|
var tmp_5 = Spacer_instance.toString();
|
|
444
453
|
var tmp_6 = Spacer_instance.toString();
|
|
445
|
-
var tmp_7 = emit_18(this, _this__u8e3s4.
|
|
454
|
+
var tmp_7 = emit_18(this, _this__u8e3s4.iq_1);
|
|
446
455
|
var tmp_8 = Spacer_instance.toString();
|
|
447
456
|
var tmp_9 = Spacer_instance.toString();
|
|
448
457
|
var tmp_10 = Spacer_instance.toString();
|
|
449
|
-
var tmp_11 = emit_18(this, _this__u8e3s4.
|
|
458
|
+
var tmp_11 = emit_18(this, _this__u8e3s4.iq_1);
|
|
450
459
|
var tmp_12 = Spacer_instance.toString();
|
|
451
460
|
var tmp_13 = Spacer_instance.toString();
|
|
452
461
|
var tmp_14 = Spacer_instance.toString();
|
|
453
462
|
var tmp_15 = paramList_0(_this__u8e3s4);
|
|
454
|
-
return trimMargin('\n |@dataclass\n |class Response' + _this__u8e3s4.
|
|
463
|
+
return trimMargin('\n |@dataclass\n |class Response' + _this__u8e3s4.gq_1 + '(Wirespec.Response[' + tmp + ']):\n |' + tmp_0 + '\n |\n |' + tmp_1 + '@property\n |' + tmp_2 + 'def headers(self) -> Headers:\n |' + tmp_3 + tmp_4 + 'return self._headers\n |\n |' + tmp_5 + '@property\n |' + tmp_6 + 'def body(self) -> ' + tmp_7 + ':\n |' + tmp_8 + tmp_9 + 'return self._body\n |\n |' + tmp_10 + '_body: ' + tmp_11 + '\n |' + tmp_12 + '_headers: Headers\n |' + tmp_13 + 'status: int = ' + _this__u8e3s4.gq_1 + '\n |\n |' + tmp_14 + 'def __init__(self, ' + joinToString(tmp_15, ', ', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda_6(this)) + '):\n |' + spacer(emitAssignSelf_1(this, _this__u8e3s4, endpoint), 2) + '\n |\n ');
|
|
455
464
|
}
|
|
456
465
|
initMetadataForInterface(PythonEndpointDefinitionEmitter, 'PythonEndpointDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter]);
|
|
457
|
-
function emit_13(union) {
|
|
458
|
-
return trimMargin('\n |class ' + this.mv(union.gt_1) + '(ABC):\n |' + Spacer_instance.toString() + 'pass\n ');
|
|
459
|
-
}
|
|
460
|
-
initMetadataForInterface(PythonUnionDefinitionEmitter, 'PythonUnionDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
461
|
-
function emit_14(enum_0, module_0) {
|
|
462
|
-
var tmp = this.n21(enum_0.wv_1);
|
|
463
|
-
return trimMargin('\n |class ' + tmp + '(str, Enum):\n |' + joinToString(enum_0.xv_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.gw(2) + 'return self.value\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.gw(2) + 'return self.value\n ');
|
|
464
|
-
}
|
|
465
|
-
initMetadataForInterface(PythonEnumDefinitionEmitter, 'PythonEnumDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
466
466
|
function emit_15(refined) {
|
|
467
|
-
return trimMargin('\n |@dataclass\n |class ' + this.
|
|
467
|
+
return trimMargin('\n |@dataclass\n |class ' + this.r1x(refined.sr_1) + '(Wirespec.Refined):\n |' + Spacer_instance.toString() + 'value: ' + this.z1y(refined.tr_1) + '\n |\n |' + Spacer_instance.toString() + 'def validate(self) -> bool:\n |' + Spacer_instance.hs(2) + 'return ' + this.bs(refined) + '\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.hs(2) + 'return str(self.value)\n |\n ');
|
|
468
468
|
}
|
|
469
469
|
function emitValidator(_this__u8e3s4) {
|
|
470
470
|
var defaultReturn = 'True';
|
|
471
|
-
var type = _this__u8e3s4.
|
|
471
|
+
var type = _this__u8e3s4.tr_1.fv_1;
|
|
472
472
|
var tmp;
|
|
473
473
|
if (type instanceof Integer) {
|
|
474
|
-
var tmp0_safe_receiver = type.
|
|
475
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
474
|
+
var tmp0_safe_receiver = type.ku_1;
|
|
475
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.oq(tmp0_safe_receiver);
|
|
476
476
|
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
477
477
|
} else {
|
|
478
478
|
if (type instanceof Number_0) {
|
|
479
|
-
var tmp2_safe_receiver = type.
|
|
480
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.
|
|
479
|
+
var tmp2_safe_receiver = type.nu_1;
|
|
480
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.oq(tmp2_safe_receiver);
|
|
481
481
|
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
482
482
|
} else {
|
|
483
483
|
if (type instanceof String_0) {
|
|
484
|
-
var tmp4_safe_receiver = type.
|
|
484
|
+
var tmp4_safe_receiver = type.hu_1;
|
|
485
485
|
var tmp_0;
|
|
486
486
|
var tmp_1 = tmp4_safe_receiver;
|
|
487
487
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
488
488
|
tmp_0 = null;
|
|
489
489
|
} else {
|
|
490
|
-
tmp_0 = this.
|
|
490
|
+
tmp_0 = this.oq(new RegExp_0(tmp4_safe_receiver));
|
|
491
491
|
}
|
|
492
492
|
var tmp5_elvis_lhs = tmp_0;
|
|
493
493
|
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
@@ -507,7 +507,7 @@ function emitValidator(_this__u8e3s4) {
|
|
|
507
507
|
return tmp;
|
|
508
508
|
}
|
|
509
509
|
initMetadataForInterface(PythonRefinedTypeDefinitionEmitter, 'PythonRefinedTypeDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
510
|
-
initMetadataForClass(PythonEmitter, 'PythonEmitter', PythonEmitter, LanguageEmitter, [LanguageEmitter, PythonIdentifierEmitter,
|
|
510
|
+
initMetadataForClass(PythonEmitter, 'PythonEmitter', PythonEmitter, LanguageEmitter, [LanguageEmitter, PythonIdentifierEmitter, PythonUnionDefinitionEmitter, PythonEnumDefinitionEmitter, PythonEndpointDefinitionEmitter, PythonTypeDefinitionEmitter, PythonChannelDefinitionEmitter, PythonRefinedTypeDefinitionEmitter]);
|
|
511
511
|
initMetadataForCompanion(Companion);
|
|
512
512
|
initMetadataForCompanion(Companion_0);
|
|
513
513
|
initMetadataForClass(sam$kotlin_Comparator$0_0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
|
|
@@ -517,23 +517,23 @@ initMetadataForObject(PythonShared, 'PythonShared');
|
|
|
517
517
|
function PythonChannelDefinitionEmitter() {
|
|
518
518
|
}
|
|
519
519
|
function sam$kotlin_Comparator$0(function_0) {
|
|
520
|
-
this.
|
|
520
|
+
this.n1y_1 = function_0;
|
|
521
521
|
}
|
|
522
|
-
protoOf(sam$kotlin_Comparator$0).
|
|
523
|
-
return this.
|
|
522
|
+
protoOf(sam$kotlin_Comparator$0).td = function (a, b) {
|
|
523
|
+
return this.n1y_1(a, b);
|
|
524
524
|
};
|
|
525
525
|
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
526
|
-
return this.
|
|
526
|
+
return this.td(a, b);
|
|
527
527
|
};
|
|
528
|
-
protoOf(sam$kotlin_Comparator$0).
|
|
529
|
-
return this.
|
|
528
|
+
protoOf(sam$kotlin_Comparator$0).l3 = function () {
|
|
529
|
+
return this.n1y_1;
|
|
530
530
|
};
|
|
531
531
|
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
532
532
|
var tmp;
|
|
533
533
|
if (!(other == null) ? isInterface(other, Comparator) : false) {
|
|
534
534
|
var tmp_0;
|
|
535
535
|
if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
|
|
536
|
-
tmp_0 = equals(this.
|
|
536
|
+
tmp_0 = equals(this.l3(), other.l3());
|
|
537
537
|
} else {
|
|
538
538
|
tmp_0 = false;
|
|
539
539
|
}
|
|
@@ -544,40 +544,40 @@ protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
|
544
544
|
return tmp;
|
|
545
545
|
};
|
|
546
546
|
protoOf(sam$kotlin_Comparator$0).hashCode = function () {
|
|
547
|
-
return hashCode(this.
|
|
547
|
+
return hashCode(this.l3());
|
|
548
548
|
};
|
|
549
549
|
function PythonEmitter$emit$lambda(this$0) {
|
|
550
550
|
return function (a, b) {
|
|
551
551
|
// Inline function 'kotlin.comparisons.compareValuesBy' call
|
|
552
|
-
var tmp = this$0.
|
|
553
|
-
var tmp$ret$1 = this$0.
|
|
552
|
+
var tmp = this$0.u1y(a);
|
|
553
|
+
var tmp$ret$1 = this$0.u1y(b);
|
|
554
554
|
return compareValues(tmp, tmp$ret$1);
|
|
555
555
|
};
|
|
556
556
|
}
|
|
557
557
|
function emit$emitInit(this$0, def) {
|
|
558
|
-
return 'from .' + this$0.
|
|
558
|
+
return 'from .' + this$0.nr(def.mr()) + ' import ' + this$0.nr(def.mr());
|
|
559
559
|
}
|
|
560
560
|
function PythonEmitter(packageName, emitShared) {
|
|
561
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
562
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
561
|
+
packageName = packageName === VOID ? Companion_instance.cs('community.flock.wirespec.generated') : packageName;
|
|
562
|
+
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
563
563
|
LanguageEmitter.call(this);
|
|
564
|
-
this.
|
|
565
|
-
this.
|
|
566
|
-
this.
|
|
567
|
-
this.
|
|
568
|
-
this.
|
|
569
|
-
this.
|
|
570
|
-
}
|
|
571
|
-
protoOf(PythonEmitter).
|
|
572
|
-
return this.
|
|
564
|
+
this.o1y_1 = packageName;
|
|
565
|
+
this.p1y_1 = emitShared;
|
|
566
|
+
this.q1y_1 = 'import re\n\nfrom abc import abstractmethod\nfrom dataclasses import dataclass\nfrom typing import List, Optional\nfrom enum import Enum\n\nfrom ..wirespec import T, Wirespec\n';
|
|
567
|
+
this.r1y_1 = FileExtension_Python_getInstance();
|
|
568
|
+
this.s1y_1 = PythonShared_instance;
|
|
569
|
+
this.t1y_1 = '#';
|
|
570
|
+
}
|
|
571
|
+
protoOf(PythonEmitter).uq = function () {
|
|
572
|
+
return this.r1y_1;
|
|
573
573
|
};
|
|
574
|
-
protoOf(PythonEmitter).
|
|
575
|
-
return this.
|
|
574
|
+
protoOf(PythonEmitter).a1x = function () {
|
|
575
|
+
return this.s1y_1;
|
|
576
576
|
};
|
|
577
|
-
protoOf(PythonEmitter).
|
|
578
|
-
return this.
|
|
577
|
+
protoOf(PythonEmitter).vq = function () {
|
|
578
|
+
return this.t1y_1;
|
|
579
579
|
};
|
|
580
|
-
protoOf(PythonEmitter).
|
|
580
|
+
protoOf(PythonEmitter).u1y = function (definition) {
|
|
581
581
|
var tmp;
|
|
582
582
|
if (definition instanceof Enum) {
|
|
583
583
|
tmp = 1;
|
|
@@ -606,21 +606,21 @@ protoOf(PythonEmitter).p22 = function (definition) {
|
|
|
606
606
|
}
|
|
607
607
|
return tmp;
|
|
608
608
|
};
|
|
609
|
-
protoOf(PythonEmitter).
|
|
609
|
+
protoOf(PythonEmitter).kr = function (module_0, logger) {
|
|
610
610
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
611
|
-
var this_0 = new NonEmptyList(module_0.
|
|
611
|
+
var this_0 = new NonEmptyList(module_0.tq_1);
|
|
612
612
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
613
613
|
var tmp = PythonEmitter$emit$lambda(this);
|
|
614
614
|
var tmp$ret$0 = new sam$kotlin_Comparator$0(tmp);
|
|
615
615
|
var tmp$ret$1 = sortedWith(this_0, tmp$ret$0);
|
|
616
616
|
var tmp_0 = toNonEmptyListOrNull(tmp$ret$1);
|
|
617
|
-
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).
|
|
617
|
+
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).om_1;
|
|
618
618
|
// Inline function 'kotlin.let' call
|
|
619
|
-
var it = protoOf(LanguageEmitter).
|
|
620
|
-
var init = new Emitted(this.
|
|
621
|
-
var tmp_1 = this.
|
|
619
|
+
var it = protoOf(LanguageEmitter).kr.call(this, module_0.mv(VOID, statements), logger);
|
|
620
|
+
var init = new Emitted(this.o1y_1.fs() + '__init__', 'from . import model\nfrom . import endpoint\nfrom . import wirespec\n');
|
|
621
|
+
var tmp_1 = this.o1y_1.fs() + 'endpoint/' + '__init__';
|
|
622
622
|
// Inline function 'kotlin.collections.filter' call
|
|
623
|
-
var tmp0 = new NonEmptyList(module_0.
|
|
623
|
+
var tmp0 = new NonEmptyList(module_0.tq_1);
|
|
624
624
|
// Inline function 'kotlin.collections.filterTo' call
|
|
625
625
|
var destination = ArrayList_init_$Create$();
|
|
626
626
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -640,9 +640,9 @@ protoOf(PythonEmitter).jv = function (module_0, logger) {
|
|
|
640
640
|
destination_0.x(tmp$ret$5);
|
|
641
641
|
}
|
|
642
642
|
var initEndpoint = new Emitted(tmp_1, joinToString(destination_0, '\n'));
|
|
643
|
-
var tmp_2 = this.
|
|
643
|
+
var tmp_2 = this.o1y_1.fs() + 'model/' + '__init__';
|
|
644
644
|
// Inline function 'kotlin.collections.filter' call
|
|
645
|
-
var tmp0_0 = new NonEmptyList(module_0.
|
|
645
|
+
var tmp0_0 = new NonEmptyList(module_0.tq_1);
|
|
646
646
|
// Inline function 'kotlin.collections.filterTo' call
|
|
647
647
|
var destination_1 = ArrayList_init_$Create$();
|
|
648
648
|
var _iterator__ex2g4s_1 = tmp0_0.t();
|
|
@@ -662,33 +662,33 @@ protoOf(PythonEmitter).jv = function (module_0, logger) {
|
|
|
662
662
|
destination_2.x(tmp$ret$11);
|
|
663
663
|
}
|
|
664
664
|
var initModel = new Emitted(tmp_2, joinToString(destination_2, '\n'));
|
|
665
|
-
var shared = new Emitted(this.
|
|
666
|
-
return this.
|
|
665
|
+
var shared = new Emitted(this.o1y_1.fs() + 'wirespec', this.a1x().w1y_1);
|
|
666
|
+
return this.p1y_1.xo_1 ? NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(it, init), initEndpoint), initModel), shared) : NonEmptyList__plus_impl_xqmb9(it, init);
|
|
667
667
|
};
|
|
668
|
-
protoOf(PythonEmitter).
|
|
669
|
-
var subPackageName = plus_1(this.
|
|
668
|
+
protoOf(PythonEmitter).lr = function (definition, module_0, logger) {
|
|
669
|
+
var subPackageName = plus_1(this.o1y_1, definition);
|
|
670
670
|
// Inline function 'kotlin.let' call
|
|
671
|
-
var it = protoOf(LanguageEmitter).
|
|
672
|
-
var tmp = subPackageName.
|
|
671
|
+
var it = protoOf(LanguageEmitter).lr.call(this, definition, module_0, logger);
|
|
672
|
+
var tmp = subPackageName.fs() + it.yo_1;
|
|
673
673
|
// Inline function 'kotlin.text.trimStart' call
|
|
674
|
-
var this_0 = trimMargin('\n |' + this.
|
|
674
|
+
var this_0 = trimMargin('\n |' + this.q1y_1 + '\n |' + it.zo_1 + '\n ');
|
|
675
675
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
676
676
|
return new Emitted(tmp, tmp$ret$0);
|
|
677
677
|
};
|
|
678
678
|
function emitToRawRequest($this, _this__u8e3s4, endpoint) {
|
|
679
|
-
var tmp = $this.
|
|
679
|
+
var tmp = $this.nr(endpoint.up_1);
|
|
680
680
|
var tmp_0 = Spacer_instance.toString();
|
|
681
681
|
var tmp_1 = Spacer_instance.toString();
|
|
682
682
|
var tmp_2 = Spacer_instance.toString();
|
|
683
|
-
var tmp_3 = joinToString(endpoint.
|
|
683
|
+
var tmp_3 = joinToString(endpoint.wp_1, VOID, VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawRequest$lambda($this));
|
|
684
684
|
var tmp_4 = Spacer_instance.toString();
|
|
685
685
|
var tmp_5 = Spacer_instance.toString();
|
|
686
686
|
var tmp_6 = Spacer_instance.toString();
|
|
687
687
|
var tmp_7 = Spacer_instance.toString();
|
|
688
688
|
var tmp_8;
|
|
689
689
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
690
|
-
if (!endpoint.
|
|
691
|
-
tmp_8 = prependIndent(joinToString(endpoint.
|
|
690
|
+
if (!endpoint.xp_1.r()) {
|
|
691
|
+
tmp_8 = prependIndent(joinToString(endpoint.xp_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawRequest$lambda_0($this)), Spacer_instance.hs(3));
|
|
692
692
|
} else {
|
|
693
693
|
tmp_8 = '';
|
|
694
694
|
}
|
|
@@ -699,8 +699,8 @@ function emitToRawRequest($this, _this__u8e3s4, endpoint) {
|
|
|
699
699
|
var tmp_13 = Spacer_instance.toString();
|
|
700
700
|
var tmp_14;
|
|
701
701
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
702
|
-
if (!endpoint.
|
|
703
|
-
tmp_14 = prependIndent(joinToString(endpoint.
|
|
702
|
+
if (!endpoint.yp_1.r()) {
|
|
703
|
+
tmp_14 = prependIndent(joinToString(endpoint.yp_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawRequest$lambda_1($this)), Spacer_instance.hs(3));
|
|
704
704
|
} else {
|
|
705
705
|
tmp_14 = '';
|
|
706
706
|
}
|
|
@@ -709,48 +709,48 @@ function emitToRawRequest($this, _this__u8e3s4, endpoint) {
|
|
|
709
709
|
var tmp_17 = Spacer_instance.toString();
|
|
710
710
|
var tmp_18 = Spacer_instance.toString();
|
|
711
711
|
var tmp_19 = Spacer_instance.toString();
|
|
712
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
713
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
714
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
712
|
+
var tmp0_safe_receiver = _this__u8e3s4.dq_1;
|
|
713
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.fq_1;
|
|
714
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.z1y(tmp1_safe_receiver);
|
|
715
715
|
return trimMargin("\n |@staticmethod\n |def to_raw_request(serialization: Wirespec.Serializer, request: '" + tmp + ".Request') -> Wirespec.RawRequest:\n |" + tmp_0 + 'return Wirespec.RawRequest(\n |' + tmp_1 + tmp_2 + 'path = [' + tmp_3 + '],\n |' + tmp_4 + tmp_5 + 'method = request.method.value,\n |' + tmp_6 + tmp_7 + 'queries = {\n |' + tmp_9 + '\n |' + tmp_10 + tmp_11 + '},\n |' + tmp_12 + tmp_13 + 'headers = {\n |' + tmp_15 + '\n |' + tmp_16 + tmp_17 + '},\n |' + tmp_18 + tmp_19 + 'body = serialization.serialize(request.body, ' + (tmp2_elvis_lhs == null ? 'type(None)' : tmp2_elvis_lhs) + '),\n |' + Spacer_instance.toString() + ')\n |\n ');
|
|
716
716
|
}
|
|
717
717
|
function emitFromRawRequest($this, _this__u8e3s4, endpoint) {
|
|
718
|
-
return trimMargin("\n |@staticmethod\n |def from_raw_request(serialization: Wirespec.Deserializer, request: Wirespec.RawRequest) -> '" + $this.
|
|
718
|
+
return trimMargin("\n |@staticmethod\n |def from_raw_request(serialization: Wirespec.Deserializer, request: Wirespec.RawRequest) -> '" + $this.nr(endpoint.up_1) + ".Request':\n |" + Spacer_instance.toString() + 'return ' + $this.nr(endpoint.up_1) + '.Request' + emitDeserializedParams($this, _this__u8e3s4, endpoint) + '\n |\n ');
|
|
719
719
|
}
|
|
720
720
|
function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
721
721
|
var tmp = get_indexedPathParams(endpoint);
|
|
722
722
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
|
|
723
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
724
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
725
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
723
|
+
var tmp_1 = orNull(joinToString(endpoint.xp_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
724
|
+
var tmp_2 = orNull(joinToString(endpoint.yp_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
725
|
+
var tmp0_safe_receiver = _this__u8e3s4.dq_1;
|
|
726
726
|
var tmp_3;
|
|
727
727
|
if (tmp0_safe_receiver == null) {
|
|
728
728
|
tmp_3 = null;
|
|
729
729
|
} else {
|
|
730
730
|
// Inline function 'kotlin.let' call
|
|
731
|
-
tmp_3 = Spacer_instance.
|
|
731
|
+
tmp_3 = Spacer_instance.hs(3) + 'body = serialization.deserialize(request.body, ' + $this.z1y(tmp0_safe_receiver.fq_1) + '),';
|
|
732
732
|
}
|
|
733
733
|
// Inline function 'kotlin.let' call
|
|
734
734
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
735
735
|
return isBlank(it) ? '()' : '(\n' + it + '\n)';
|
|
736
736
|
}
|
|
737
737
|
function emitResponseUnion($this, _this__u8e3s4) {
|
|
738
|
-
return trimMargin('\n |Response = ' + joinToString(_this__u8e3s4.
|
|
738
|
+
return trimMargin('\n |Response = ' + joinToString(_this__u8e3s4.aq_1, ' | ', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitResponseUnion$lambda) + '\n |\n ');
|
|
739
739
|
}
|
|
740
740
|
function emitHandleClass($this, _this__u8e3s4) {
|
|
741
|
-
return trimMargin('\n |class Handler(Wirespec.Endpoint.Handler):\n |' + Spacer_instance.toString() + '@abstractmethod\n |' + Spacer_instance.toString() + 'def ' + _this__u8e3s4.
|
|
741
|
+
return trimMargin('\n |class Handler(Wirespec.Endpoint.Handler):\n |' + Spacer_instance.toString() + '@abstractmethod\n |' + Spacer_instance.toString() + 'def ' + _this__u8e3s4.up_1.l1() + "(self, req: '" + $this.nr(_this__u8e3s4.up_1) + ".Request') -> '" + $this.nr(_this__u8e3s4.up_1) + ".Response': pass\n |\n ");
|
|
742
742
|
}
|
|
743
743
|
function emitConvertClass($this, _this__u8e3s4) {
|
|
744
|
-
return trimMargin('\n |class Convert(Wirespec.Endpoint.Convert[Request, Response]):\n |' + spacer(emitToRawRequest($this, first(_this__u8e3s4.
|
|
744
|
+
return trimMargin('\n |class Convert(Wirespec.Endpoint.Convert[Request, Response]):\n |' + spacer(emitToRawRequest($this, first(_this__u8e3s4.zp_1), _this__u8e3s4), 1) + '\n |' + spacer(emitFromRawRequest($this, first(_this__u8e3s4.zp_1), _this__u8e3s4), 1) + '\n |' + spacer(emitToRawResponse($this, _this__u8e3s4), 1) + '\n |' + spacer(emitFromRawResponse($this, _this__u8e3s4), 1) + '\n |\n ');
|
|
745
745
|
}
|
|
746
746
|
function emit_16($this, _this__u8e3s4) {
|
|
747
|
-
return $this.
|
|
747
|
+
return $this.nr(_this__u8e3s4.zq_1) + ': ' + $this.nq(_this__u8e3s4.ar_1);
|
|
748
748
|
}
|
|
749
749
|
function emitAssignSelf($this, _this__u8e3s4) {
|
|
750
|
-
return $this.
|
|
750
|
+
return $this.nr(_this__u8e3s4.zq_1) + ' = ' + $this.nr(_this__u8e3s4.zq_1);
|
|
751
751
|
}
|
|
752
752
|
function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
753
|
-
var tmp = $this.
|
|
753
|
+
var tmp = $this.nr(endpoint.up_1);
|
|
754
754
|
// Inline function 'kotlin.collections.filter' call
|
|
755
755
|
var tmp0 = paramList(_this__u8e3s4, endpoint);
|
|
756
756
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -758,13 +758,13 @@ function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
|
758
758
|
var _iterator__ex2g4s = tmp0.t();
|
|
759
759
|
while (_iterator__ex2g4s.u()) {
|
|
760
760
|
var element = _iterator__ex2g4s.v();
|
|
761
|
-
if (element.
|
|
761
|
+
if (element.yq_1.equals(ParamType_PATH_getInstance())) {
|
|
762
762
|
destination.x(element);
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
765
|
var tmp_0 = destination;
|
|
766
766
|
var tmp_1 = joinToString(tmp_0, VOID, VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda($this));
|
|
767
|
-
var tmp_2 = $this.
|
|
767
|
+
var tmp_2 = $this.nr(endpoint.up_1);
|
|
768
768
|
// Inline function 'kotlin.collections.filter' call
|
|
769
769
|
var tmp0_0 = paramList(_this__u8e3s4, endpoint);
|
|
770
770
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -772,13 +772,13 @@ function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
|
772
772
|
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
773
773
|
while (_iterator__ex2g4s_0.u()) {
|
|
774
774
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
775
|
-
if (element_0.
|
|
775
|
+
if (element_0.yq_1.equals(ParamType_QUERY_getInstance())) {
|
|
776
776
|
destination_0.x(element_0);
|
|
777
777
|
}
|
|
778
778
|
}
|
|
779
779
|
var tmp_3 = destination_0;
|
|
780
780
|
var tmp_4 = spacer(joinToString(tmp_3, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_0($this)), 1);
|
|
781
|
-
var tmp_5 = $this.
|
|
781
|
+
var tmp_5 = $this.nr(endpoint.up_1);
|
|
782
782
|
// Inline function 'kotlin.collections.filter' call
|
|
783
783
|
var tmp0_1 = paramList(_this__u8e3s4, endpoint);
|
|
784
784
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -786,14 +786,14 @@ function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
|
786
786
|
var _iterator__ex2g4s_1 = tmp0_1.t();
|
|
787
787
|
while (_iterator__ex2g4s_1.u()) {
|
|
788
788
|
var element_1 = _iterator__ex2g4s_1.v();
|
|
789
|
-
if (element_1.
|
|
789
|
+
if (element_1.yq_1.equals(ParamType_HEADER_getInstance())) {
|
|
790
790
|
destination_1.x(element_1);
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
793
|
var tmp_6 = destination_1;
|
|
794
794
|
var tmp_7 = spacer(joinToString(tmp_6, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_1($this)), 1);
|
|
795
795
|
var tmp_8;
|
|
796
|
-
if (_this__u8e3s4.
|
|
796
|
+
if (_this__u8e3s4.dq_1 == null) {
|
|
797
797
|
tmp_8 = null;
|
|
798
798
|
} else {
|
|
799
799
|
// Inline function 'kotlin.let' call
|
|
@@ -803,7 +803,7 @@ function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
|
803
803
|
return trimMargin('\n |self._path = ' + tmp + '.Request.Path(' + tmp_1 + ')\n |self._queries =' + tmp_2 + '.Request.Queries(' + tmp_4 + ')\n |self._headers = ' + tmp_5 + '.Request.Headers(' + tmp_7 + ')\n |self._body = ' + (tmp1_elvis_lhs == null ? 'None' : tmp1_elvis_lhs) + '\n ');
|
|
804
804
|
}
|
|
805
805
|
function emitAssignSelf_1($this, _this__u8e3s4, endpoint) {
|
|
806
|
-
var tmp = $this.
|
|
806
|
+
var tmp = $this.nr(endpoint.up_1);
|
|
807
807
|
// Inline function 'kotlin.collections.filter' call
|
|
808
808
|
var tmp0 = paramList_0(_this__u8e3s4);
|
|
809
809
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -811,35 +811,35 @@ function emitAssignSelf_1($this, _this__u8e3s4, endpoint) {
|
|
|
811
811
|
var _iterator__ex2g4s = tmp0.t();
|
|
812
812
|
while (_iterator__ex2g4s.u()) {
|
|
813
813
|
var element = _iterator__ex2g4s.v();
|
|
814
|
-
if (element.
|
|
814
|
+
if (element.yq_1.equals(ParamType_HEADER_getInstance())) {
|
|
815
815
|
destination.x(element);
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
818
|
var tmp_0 = destination;
|
|
819
819
|
var tmp_1 = spacer(joinToString(tmp_0, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_2($this)), 1);
|
|
820
820
|
var tmp_2;
|
|
821
|
-
if (_this__u8e3s4.
|
|
821
|
+
if (_this__u8e3s4.iq_1 == null) {
|
|
822
822
|
tmp_2 = null;
|
|
823
823
|
} else {
|
|
824
824
|
// Inline function 'kotlin.let' call
|
|
825
825
|
tmp_2 = 'body';
|
|
826
826
|
}
|
|
827
827
|
var tmp1_elvis_lhs = tmp_2;
|
|
828
|
-
return trimMargin('\n |self._headers = ' + tmp + '.Response' + _this__u8e3s4.
|
|
828
|
+
return trimMargin('\n |self._headers = ' + tmp + '.Response' + _this__u8e3s4.gq_1 + '.Headers(' + tmp_1 + ')\n |self._body = ' + (tmp1_elvis_lhs == null ? 'None' : tmp1_elvis_lhs) + '\n ');
|
|
829
829
|
}
|
|
830
830
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
831
|
-
return Spacer_instance.
|
|
831
|
+
return Spacer_instance.hs(3) + $this.nr(_this__u8e3s4.ue_1.bq_1) + ' = serialization.deserialize(request.path[' + _this__u8e3s4.te_1 + '], ' + $this.z1y(_this__u8e3s4.ue_1.cq_1) + ')';
|
|
832
832
|
}
|
|
833
833
|
function emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive) {
|
|
834
834
|
var tmp;
|
|
835
835
|
if (caseSensitive) {
|
|
836
|
-
tmp = Spacer_instance.
|
|
836
|
+
tmp = Spacer_instance.hs(spaces) + $this.nr(_this__u8e3s4.qp_1) + ' = serialization.deserialize_param(' + type + '.' + fields + '.get("' + _this__u8e3s4.qp_1.l1() + '"), ' + $this.z1y(_this__u8e3s4.rp_1) + ')';
|
|
837
837
|
} else {
|
|
838
|
-
var tmp_0 = Spacer_instance.
|
|
839
|
-
var tmp_1 = $this.
|
|
838
|
+
var tmp_0 = Spacer_instance.hs(spaces);
|
|
839
|
+
var tmp_1 = $this.nr(_this__u8e3s4.qp_1);
|
|
840
840
|
// Inline function 'kotlin.text.lowercase' call
|
|
841
841
|
// Inline function 'kotlin.js.asDynamic' call
|
|
842
|
-
tmp = tmp_0 + tmp_1 + ' = serialization.deserialize_param(next((v for k, v in ' + type + '.' + fields + '.items() if k.lower() == "' + _this__u8e3s4.
|
|
842
|
+
tmp = tmp_0 + tmp_1 + ' = serialization.deserialize_param(next((v for k, v in ' + type + '.' + fields + '.items() if k.lower() == "' + _this__u8e3s4.qp_1.l1().toLowerCase() + '"), None), ' + $this.z1y(_this__u8e3s4.rp_1) + ')';
|
|
843
843
|
}
|
|
844
844
|
return tmp;
|
|
845
845
|
}
|
|
@@ -849,73 +849,73 @@ function emitDeserializedParams$default($this, _this__u8e3s4, type, fields, spac
|
|
|
849
849
|
return emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive);
|
|
850
850
|
}
|
|
851
851
|
function emitToRawResponse($this, _this__u8e3s4) {
|
|
852
|
-
var tmp = $this.
|
|
852
|
+
var tmp = $this.nr(_this__u8e3s4.up_1);
|
|
853
853
|
var tmp_0 = Spacer_instance.toString();
|
|
854
|
-
var tmp_1 = distinctByStatus(_this__u8e3s4.
|
|
854
|
+
var tmp_1 = distinctByStatus(_this__u8e3s4.aq_1);
|
|
855
855
|
return trimMargin("\n |@staticmethod\n |def to_raw_response(serialization: Wirespec.Serializer, response: '" + tmp + ".Response') -> Wirespec.RawResponse:\n |" + tmp_0 + 'match response:\n |' + spacer(joinToString(tmp_1, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawResponse$lambda($this, _this__u8e3s4)), 2) + '\n |' + Spacer_instance.toString() + Spacer_instance.toString() + 'case _:\n |' + Spacer_instance.toString() + Spacer_instance.toString() + Spacer_instance.toString() + 'raise Exception("Cannot match response with status: " + str(response.status))\n ');
|
|
856
856
|
}
|
|
857
857
|
function emitFromRawResponse($this, _this__u8e3s4) {
|
|
858
|
-
var tmp = $this.
|
|
858
|
+
var tmp = $this.nr(_this__u8e3s4.up_1);
|
|
859
859
|
var tmp_0 = Spacer_instance.toString();
|
|
860
860
|
// Inline function 'kotlin.collections.filter' call
|
|
861
|
-
var tmp0 = distinctByStatus(_this__u8e3s4.
|
|
861
|
+
var tmp0 = distinctByStatus(_this__u8e3s4.aq_1);
|
|
862
862
|
// Inline function 'kotlin.collections.filterTo' call
|
|
863
863
|
var destination = ArrayList_init_$Create$();
|
|
864
864
|
var _iterator__ex2g4s = tmp0.t();
|
|
865
865
|
while (_iterator__ex2g4s.u()) {
|
|
866
866
|
var element = _iterator__ex2g4s.v();
|
|
867
|
-
if (Companion_instance_1.
|
|
867
|
+
if (Companion_instance_1.ir(element.gq_1)) {
|
|
868
868
|
destination.x(element);
|
|
869
869
|
}
|
|
870
870
|
}
|
|
871
871
|
var tmp_1 = destination;
|
|
872
|
-
return trimMargin("\n |@staticmethod\n |def from_raw_response(serialization: Wirespec.Deserializer, response: Wirespec.RawResponse) -> '" + tmp + ".Response':\n |" + tmp_0 + 'match response.status_code:\n |' + spacer(joinToString(tmp_1, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitFromRawResponse$lambda($this, _this__u8e3s4)), 2) + '\n |' + Spacer_instance.
|
|
872
|
+
return trimMargin("\n |@staticmethod\n |def from_raw_response(serialization: Wirespec.Deserializer, response: Wirespec.RawResponse) -> '" + tmp + ".Response':\n |" + tmp_0 + 'match response.status_code:\n |' + spacer(joinToString(tmp_1, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitFromRawResponse$lambda($this, _this__u8e3s4)), 2) + '\n |' + Spacer_instance.hs(2) + 'case _:\n |' + Spacer_instance.hs(3) + 'raise Exception("Cannot match response with status: " + str(response.status_code))\n |\n ');
|
|
873
873
|
}
|
|
874
874
|
function emitDeserialized_0($this, _this__u8e3s4, endpoint) {
|
|
875
|
-
var tmp = 'case ' + _this__u8e3s4.
|
|
876
|
-
var tmp_0 = Spacer_instance.toString() + 'return ' + $this.
|
|
877
|
-
var tmp_1 = Spacer_instance.
|
|
878
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
879
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
880
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
875
|
+
var tmp = 'case ' + _this__u8e3s4.gq_1 + ':';
|
|
876
|
+
var tmp_0 = Spacer_instance.toString() + 'return ' + $this.nr(endpoint.up_1) + '.Response' + _this__u8e3s4.gq_1 + '(';
|
|
877
|
+
var tmp_1 = Spacer_instance.hs(2);
|
|
878
|
+
var tmp0_safe_receiver = _this__u8e3s4.iq_1;
|
|
879
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.fq_1;
|
|
880
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.z1y(tmp1_safe_receiver);
|
|
881
881
|
var tmp_2 = tmp_1 + 'body = serialization.deserialize(response.body, ' + (tmp2_elvis_lhs == null ? 'type(None)' : tmp2_elvis_lhs) + '),';
|
|
882
|
-
return joinToString(listOfNotNull([tmp, tmp_0, tmp_2, orNull(joinToString(_this__u8e3s4.
|
|
882
|
+
return joinToString(listOfNotNull([tmp, tmp_0, tmp_2, orNull(joinToString(_this__u8e3s4.hq_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserialized$lambda($this))), Spacer_instance.toString() + ')']), '\n');
|
|
883
883
|
}
|
|
884
884
|
function emitSerialized($this, _this__u8e3s4, endpoint) {
|
|
885
|
-
var tmp = $this.
|
|
886
|
-
var tmp_0 = Spacer_instance.
|
|
887
|
-
var tmp_1 = Spacer_instance.
|
|
888
|
-
var tmp_2 = Spacer_instance.
|
|
885
|
+
var tmp = $this.nr(endpoint.up_1);
|
|
886
|
+
var tmp_0 = Spacer_instance.hs(1);
|
|
887
|
+
var tmp_1 = Spacer_instance.hs(2);
|
|
888
|
+
var tmp_2 = Spacer_instance.hs(2);
|
|
889
889
|
var tmp_3;
|
|
890
890
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
891
|
-
if (!_this__u8e3s4.
|
|
892
|
-
tmp_3 = joinToString(_this__u8e3s4.
|
|
891
|
+
if (!_this__u8e3s4.hq_1.r()) {
|
|
892
|
+
tmp_3 = joinToString(_this__u8e3s4.hq_1, ', ', '{', '}', VOID, VOID, PythonEndpointDefinitionEmitter$emitSerialized$lambda($this));
|
|
893
893
|
} else {
|
|
894
894
|
tmp_3 = '{}';
|
|
895
895
|
}
|
|
896
896
|
var tmp_4 = tmp_3;
|
|
897
|
-
var tmp_5 = Spacer_instance.
|
|
898
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
897
|
+
var tmp_5 = Spacer_instance.hs(2);
|
|
898
|
+
var tmp0_safe_receiver = _this__u8e3s4.iq_1;
|
|
899
899
|
var tmp_6;
|
|
900
900
|
if (tmp0_safe_receiver == null) {
|
|
901
901
|
tmp_6 = null;
|
|
902
902
|
} else {
|
|
903
903
|
// Inline function 'kotlin.let' call
|
|
904
|
-
tmp_6 = 'serialization.serialize(response.body, ' + $this.
|
|
904
|
+
tmp_6 = 'serialization.serialize(response.body, ' + $this.z1y(tmp0_safe_receiver.fq_1) + ')';
|
|
905
905
|
}
|
|
906
906
|
var tmp1_elvis_lhs = tmp_6;
|
|
907
|
-
return trimMargin('\n |case ' + tmp + '.Response' + _this__u8e3s4.
|
|
907
|
+
return trimMargin('\n |case ' + tmp + '.Response' + _this__u8e3s4.gq_1 + '():\n |' + tmp_0 + 'return Wirespec.RawResponse(\n |' + tmp_1 + 'status_code = response.status,\n |' + tmp_2 + 'headers = ' + tmp_4 + ',\n |' + tmp_5 + 'body = ' + (tmp1_elvis_lhs == null ? 'type(None)' : tmp1_elvis_lhs) + ',\n |' + Spacer_instance.hs(1) + ')\n ');
|
|
908
908
|
}
|
|
909
909
|
function emitSerializedParams($this, _this__u8e3s4, type, fields) {
|
|
910
|
-
return '"' + _this__u8e3s4.
|
|
910
|
+
return '"' + _this__u8e3s4.qp_1.l1() + '": serialization.serialize_param(' + type + '.' + fields + '.' + $this.nr(_this__u8e3s4.qp_1) + ', ' + $this.z1y(_this__u8e3s4.rp_1) + ')';
|
|
911
911
|
}
|
|
912
912
|
function emitObject($this, _this__u8e3s4, name, extends_0, spaces, block) {
|
|
913
913
|
var tmp;
|
|
914
914
|
if (_this__u8e3s4.r()) {
|
|
915
|
-
tmp = trimMargin('\n |' + Spacer_instance.
|
|
915
|
+
tmp = trimMargin('\n |' + Spacer_instance.hs(spaces) + '@dataclass\n |' + Spacer_instance.hs(spaces) + 'class ' + name + ' (' + extends_0 + '): pass\n ');
|
|
916
916
|
} else {
|
|
917
|
-
var tmp_0 = Spacer_instance.
|
|
918
|
-
var tmp_1 = Spacer_instance.
|
|
917
|
+
var tmp_0 = Spacer_instance.hs(spaces);
|
|
918
|
+
var tmp_1 = Spacer_instance.hs(spaces);
|
|
919
919
|
tmp = trimMargin('\n |' + tmp_0 + '@dataclass\n |' + tmp_1 + 'class ' + name + ' (' + extends_0 + '):\n |' + joinToString(_this__u8e3s4, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitObject$lambda(spaces, block)) + '\n ');
|
|
920
920
|
}
|
|
921
921
|
return tmp;
|
|
@@ -925,21 +925,21 @@ function emitObject$default($this, _this__u8e3s4, name, extends_0, spaces, block
|
|
|
925
925
|
return emitObject($this, _this__u8e3s4, name, extends_0, spaces, block);
|
|
926
926
|
}
|
|
927
927
|
function emit_17($this, _this__u8e3s4) {
|
|
928
|
-
return $this.
|
|
928
|
+
return $this.nr(_this__u8e3s4.bq_1) + ': ' + $this.nq(_this__u8e3s4.cq_1);
|
|
929
929
|
}
|
|
930
930
|
function emit_18($this, _this__u8e3s4) {
|
|
931
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
932
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
931
|
+
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.fq_1;
|
|
932
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.nq(tmp1_safe_receiver);
|
|
933
933
|
return tmp2_elvis_lhs == null ? 'None' : tmp2_elvis_lhs;
|
|
934
934
|
}
|
|
935
935
|
function PythonEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
936
936
|
return function (it) {
|
|
937
|
-
return this$0.
|
|
937
|
+
return this$0.a1z(it);
|
|
938
938
|
};
|
|
939
939
|
}
|
|
940
940
|
function PythonEndpointDefinitionEmitter$emit$lambda_0(this$0, $endpoint) {
|
|
941
941
|
return function (it) {
|
|
942
|
-
return this$0.
|
|
942
|
+
return this$0.y1y(it, $endpoint);
|
|
943
943
|
};
|
|
944
944
|
}
|
|
945
945
|
function PythonEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
@@ -949,12 +949,12 @@ function PythonEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
|
949
949
|
}
|
|
950
950
|
function PythonEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
951
951
|
return function (it) {
|
|
952
|
-
return this$0.
|
|
952
|
+
return this$0.mq(it);
|
|
953
953
|
};
|
|
954
954
|
}
|
|
955
955
|
function PythonEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
956
956
|
return function (it) {
|
|
957
|
-
return this$0.
|
|
957
|
+
return this$0.mq(it);
|
|
958
958
|
};
|
|
959
959
|
}
|
|
960
960
|
function PythonEndpointDefinitionEmitter$emit$lambda_4(this$0) {
|
|
@@ -966,10 +966,10 @@ function PythonEndpointDefinitionEmitter$emitToRawRequest$lambda(this$0) {
|
|
|
966
966
|
return function (it) {
|
|
967
967
|
var tmp;
|
|
968
968
|
if (it instanceof Literal) {
|
|
969
|
-
tmp = '"' + it.
|
|
969
|
+
tmp = '"' + it.xq_1 + '"';
|
|
970
970
|
} else {
|
|
971
971
|
if (it instanceof Param) {
|
|
972
|
-
tmp = 'str(request.path.' + this$0.
|
|
972
|
+
tmp = 'str(request.path.' + this$0.nr(it.bq_1) + ')';
|
|
973
973
|
} else {
|
|
974
974
|
noWhenBranchMatchedException();
|
|
975
975
|
}
|
|
@@ -1003,7 +1003,7 @@ function PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda_1(this$0)
|
|
|
1003
1003
|
};
|
|
1004
1004
|
}
|
|
1005
1005
|
function PythonEndpointDefinitionEmitter$emitResponseUnion$lambda(it) {
|
|
1006
|
-
return 'Response' + it.
|
|
1006
|
+
return 'Response' + it.gq_1;
|
|
1007
1007
|
}
|
|
1008
1008
|
function PythonEndpointDefinitionEmitter$emitAssignSelf$lambda(this$0) {
|
|
1009
1009
|
return function (it) {
|
|
@@ -1027,7 +1027,7 @@ function PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_2(this$0) {
|
|
|
1027
1027
|
}
|
|
1028
1028
|
function PythonEndpointDefinitionEmitter$emit$lambda_5(this$0) {
|
|
1029
1029
|
return function (it) {
|
|
1030
|
-
return this$0.
|
|
1030
|
+
return this$0.mq(it);
|
|
1031
1031
|
};
|
|
1032
1032
|
}
|
|
1033
1033
|
function PythonEndpointDefinitionEmitter$emit$lambda_6(this$0) {
|
|
@@ -1057,7 +1057,7 @@ function PythonEndpointDefinitionEmitter$emitSerialized$lambda(this$0) {
|
|
|
1057
1057
|
}
|
|
1058
1058
|
function PythonEndpointDefinitionEmitter$emitObject$lambda($spaces, $block) {
|
|
1059
1059
|
return function (it) {
|
|
1060
|
-
return Spacer_instance.
|
|
1060
|
+
return Spacer_instance.hs($spaces + 2 | 0) + $block(it);
|
|
1061
1061
|
};
|
|
1062
1062
|
}
|
|
1063
1063
|
function PythonEndpointDefinitionEmitter() {
|
|
@@ -1086,14 +1086,14 @@ function sanitizeEnum($this, _this__u8e3s4) {
|
|
|
1086
1086
|
}
|
|
1087
1087
|
function PythonEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
1088
1088
|
return function (it) {
|
|
1089
|
-
return Spacer_instance.toString() + this$0.
|
|
1089
|
+
return Spacer_instance.toString() + this$0.h1x(sanitizeEnum(this$0, it)) + ' = "' + it + '"';
|
|
1090
1090
|
};
|
|
1091
1091
|
}
|
|
1092
1092
|
function PythonEnumDefinitionEmitter() {
|
|
1093
1093
|
}
|
|
1094
1094
|
function Companion() {
|
|
1095
1095
|
Companion_instance_2 = this;
|
|
1096
|
-
this.
|
|
1096
|
+
this.b1z_1 = setOf(['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']);
|
|
1097
1097
|
}
|
|
1098
1098
|
var Companion_instance_2;
|
|
1099
1099
|
function Companion_getInstance_0() {
|
|
@@ -1104,15 +1104,15 @@ function Companion_getInstance_0() {
|
|
|
1104
1104
|
function PythonIdentifierEmitter() {
|
|
1105
1105
|
}
|
|
1106
1106
|
function _get_sanitizationConfig__sns434($this) {
|
|
1107
|
-
var tmp0 = $this.
|
|
1107
|
+
var tmp0 = $this.g1z_1;
|
|
1108
1108
|
var tmp = KProperty1;
|
|
1109
1109
|
// Inline function 'kotlin.getValue' call
|
|
1110
1110
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, PythonIrEmitter$_get_sanitizationConfig_$ref_1q5eai(), null);
|
|
1111
|
-
return tmp0.
|
|
1111
|
+
return tmp0.l1();
|
|
1112
1112
|
}
|
|
1113
1113
|
function sanitize_0($this, _this__u8e3s4) {
|
|
1114
1114
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
1115
|
-
var this_0 = split(_this__u8e3s4.
|
|
1115
|
+
var this_0 = split(_this__u8e3s4.l1(), ['.', ' ']);
|
|
1116
1116
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
1117
1117
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1118
1118
|
var index = 0;
|
|
@@ -1121,7 +1121,7 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
1121
1121
|
var item = _iterator__ex2g4s.v();
|
|
1122
1122
|
var _unary__edvuaz = index;
|
|
1123
1123
|
index = _unary__edvuaz + 1 | 0;
|
|
1124
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
1124
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.er(item) : item;
|
|
1125
1125
|
destination.x(tmp$ret$0);
|
|
1126
1126
|
}
|
|
1127
1127
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1167,7 +1167,7 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
1167
1167
|
return tmp_2;
|
|
1168
1168
|
}
|
|
1169
1169
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1170
|
-
return Companion_getInstance_1().
|
|
1170
|
+
return Companion_getInstance_1().i1z_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1171
1171
|
}
|
|
1172
1172
|
function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
1173
1173
|
// Inline function 'kotlin.let' call
|
|
@@ -1193,7 +1193,7 @@ function buildImports($this, wirespecPath) {
|
|
|
1193
1193
|
}
|
|
1194
1194
|
function Companion_0() {
|
|
1195
1195
|
Companion_instance_3 = this;
|
|
1196
|
-
this.
|
|
1196
|
+
this.i1z_1 = setOf(['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']);
|
|
1197
1197
|
}
|
|
1198
1198
|
var Companion_instance_3;
|
|
1199
1199
|
function Companion_getInstance_1() {
|
|
@@ -1202,23 +1202,23 @@ function Companion_getInstance_1() {
|
|
|
1202
1202
|
return Companion_instance_3;
|
|
1203
1203
|
}
|
|
1204
1204
|
function sam$kotlin_Comparator$0_0(function_0) {
|
|
1205
|
-
this.
|
|
1205
|
+
this.j1z_1 = function_0;
|
|
1206
1206
|
}
|
|
1207
|
-
protoOf(sam$kotlin_Comparator$0_0).
|
|
1208
|
-
return this.
|
|
1207
|
+
protoOf(sam$kotlin_Comparator$0_0).td = function (a, b) {
|
|
1208
|
+
return this.j1z_1(a, b);
|
|
1209
1209
|
};
|
|
1210
1210
|
protoOf(sam$kotlin_Comparator$0_0).compare = function (a, b) {
|
|
1211
|
-
return this.
|
|
1211
|
+
return this.td(a, b);
|
|
1212
1212
|
};
|
|
1213
|
-
protoOf(sam$kotlin_Comparator$0_0).
|
|
1214
|
-
return this.
|
|
1213
|
+
protoOf(sam$kotlin_Comparator$0_0).l3 = function () {
|
|
1214
|
+
return this.j1z_1;
|
|
1215
1215
|
};
|
|
1216
1216
|
protoOf(sam$kotlin_Comparator$0_0).equals = function (other) {
|
|
1217
1217
|
var tmp;
|
|
1218
1218
|
if (!(other == null) ? isInterface(other, Comparator) : false) {
|
|
1219
1219
|
var tmp_0;
|
|
1220
1220
|
if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
|
|
1221
|
-
tmp_0 = equals(this.
|
|
1221
|
+
tmp_0 = equals(this.l3(), other.l3());
|
|
1222
1222
|
} else {
|
|
1223
1223
|
tmp_0 = false;
|
|
1224
1224
|
}
|
|
@@ -1229,17 +1229,17 @@ protoOf(sam$kotlin_Comparator$0_0).equals = function (other) {
|
|
|
1229
1229
|
return tmp;
|
|
1230
1230
|
};
|
|
1231
1231
|
protoOf(sam$kotlin_Comparator$0_0).hashCode = function () {
|
|
1232
|
-
return hashCode(this.
|
|
1232
|
+
return hashCode(this.l3());
|
|
1233
1233
|
};
|
|
1234
1234
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
1235
1235
|
return '_' + it;
|
|
1236
1236
|
}
|
|
1237
1237
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(name) {
|
|
1238
|
-
var sanitized = name.
|
|
1238
|
+
var sanitized = name.l1h_1.a1() > 1 ? name.q1m() : name.j1j();
|
|
1239
1239
|
return new Name(listOf_0(sanitized));
|
|
1240
1240
|
}
|
|
1241
1241
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(name) {
|
|
1242
|
-
return new Name(listOf_0(name.
|
|
1242
|
+
return new Name(listOf_0(name.q1m()));
|
|
1243
1243
|
}
|
|
1244
1244
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(it) {
|
|
1245
1245
|
return it;
|
|
@@ -1248,20 +1248,20 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1248
1248
|
return function (stmt, tr) {
|
|
1249
1249
|
var tmp;
|
|
1250
1250
|
if (stmt instanceof ConstructorStatement) {
|
|
1251
|
-
var tmp_0 = tr.
|
|
1251
|
+
var tmp_0 = tr.x1u(stmt.r1n_1);
|
|
1252
1252
|
// Inline function 'kotlin.collections.map' call
|
|
1253
|
-
var this_0 = stmt.
|
|
1253
|
+
var this_0 = stmt.s1n_1;
|
|
1254
1254
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1255
|
-
var destination = ArrayList_init_$Create$_0(this_0.
|
|
1255
|
+
var destination = ArrayList_init_$Create$_0(this_0.a1());
|
|
1256
1256
|
// Inline function 'kotlin.collections.iterator' call
|
|
1257
|
-
var _iterator__ex2g4s = this_0.
|
|
1257
|
+
var _iterator__ex2g4s = this_0.j1().t();
|
|
1258
1258
|
while (_iterator__ex2g4s.u()) {
|
|
1259
1259
|
var item = _iterator__ex2g4s.v();
|
|
1260
1260
|
// Inline function 'kotlin.collections.component1' call
|
|
1261
|
-
var k = item.
|
|
1261
|
+
var k = item.k1();
|
|
1262
1262
|
// Inline function 'kotlin.collections.component2' call
|
|
1263
|
-
var v = item.
|
|
1264
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.
|
|
1263
|
+
var v = item.l1();
|
|
1264
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.a1v(v));
|
|
1265
1265
|
destination.x(tmp$ret$3);
|
|
1266
1266
|
}
|
|
1267
1267
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
@@ -1273,7 +1273,7 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1273
1273
|
}
|
|
1274
1274
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1275
1275
|
return function () {
|
|
1276
|
-
var tmp = Companion_getInstance_1().
|
|
1276
|
+
var tmp = Companion_getInstance_1().i1z_1;
|
|
1277
1277
|
var tmp_0 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1278
1278
|
var tmp_1 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0;
|
|
1279
1279
|
var tmp_2 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1;
|
|
@@ -1293,7 +1293,7 @@ function PythonIrEmitter$emit$lambda(a, b) {
|
|
|
1293
1293
|
return compareValues(tmp, tmp$ret$1);
|
|
1294
1294
|
}
|
|
1295
1295
|
function emit$emitInitImport(this$0, def) {
|
|
1296
|
-
return import_0('.' + sanitize_0(this$0, def.
|
|
1296
|
+
return import_0('.' + sanitize_0(this$0, def.mr()), sanitize_0(this$0, def.mr()));
|
|
1297
1297
|
}
|
|
1298
1298
|
function PythonIrEmitter$emitGenerator$lambda(it) {
|
|
1299
1299
|
return startsWith(it, 'Wirespec.') || it === 'Wirespec';
|
|
@@ -1312,17 +1312,17 @@ function PythonIrEmitter$emitGenerator$lambda_2($generatorOwnName, $generatorRef
|
|
|
1312
1312
|
var tmp_0;
|
|
1313
1313
|
var tmp_1;
|
|
1314
1314
|
if (expr instanceof RawExpression) {
|
|
1315
|
-
tmp_1 = endsWith(expr.
|
|
1315
|
+
tmp_1 = endsWith(expr.l1p_1, 'Generator');
|
|
1316
1316
|
} else {
|
|
1317
1317
|
tmp_1 = false;
|
|
1318
1318
|
}
|
|
1319
1319
|
if (tmp_1) {
|
|
1320
|
-
tmp_0 = !(expr.
|
|
1320
|
+
tmp_0 = !(expr.l1p_1 === $generatorOwnName);
|
|
1321
1321
|
} else {
|
|
1322
1322
|
tmp_0 = false;
|
|
1323
1323
|
}
|
|
1324
1324
|
if (tmp_0) {
|
|
1325
|
-
$generatorRefs.x(expr.
|
|
1325
|
+
$generatorRefs.x(expr.l1p_1);
|
|
1326
1326
|
tmp = Unit_instance;
|
|
1327
1327
|
}
|
|
1328
1328
|
return transformChildren_0(expr, t);
|
|
@@ -1335,43 +1335,43 @@ function PythonIrEmitter$emit$lambda_0(this$0) {
|
|
|
1335
1335
|
}
|
|
1336
1336
|
function PythonIrEmitter(packageName, emitShared) {
|
|
1337
1337
|
Companion_getInstance_1();
|
|
1338
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
1339
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
1340
|
-
this.
|
|
1341
|
-
this.
|
|
1342
|
-
this.
|
|
1343
|
-
this.
|
|
1338
|
+
packageName = packageName === VOID ? Companion_instance.cs('community.flock.wirespec.generated') : packageName;
|
|
1339
|
+
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
1340
|
+
this.c1z_1 = packageName;
|
|
1341
|
+
this.d1z_1 = emitShared;
|
|
1342
|
+
this.e1z_1 = PythonGenerator_instance;
|
|
1343
|
+
this.f1z_1 = FileExtension_Python_getInstance();
|
|
1344
1344
|
var tmp = this;
|
|
1345
|
-
tmp.
|
|
1346
|
-
this.
|
|
1345
|
+
tmp.g1z_1 = lazy(PythonIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1346
|
+
this.h1z_1 = "from __future__ import annotations\n\nimport enum\nfrom abc import ABC, abstractmethod\nfrom dataclasses import dataclass\nfrom typing import Any, Callable, Generic, Optional, Type, TypeVar\n\nT = TypeVar('T')\nV = TypeVar('V')\n\n\ndef _raise(msg: str) -> Any:\n raise Exception(msg)\n\n";
|
|
1347
1347
|
}
|
|
1348
|
-
protoOf(PythonIrEmitter).
|
|
1349
|
-
return this.
|
|
1348
|
+
protoOf(PythonIrEmitter).s1v = function () {
|
|
1349
|
+
return this.e1z_1;
|
|
1350
1350
|
};
|
|
1351
|
-
protoOf(PythonIrEmitter).
|
|
1352
|
-
return this.
|
|
1351
|
+
protoOf(PythonIrEmitter).uq = function () {
|
|
1352
|
+
return this.f1z_1;
|
|
1353
1353
|
};
|
|
1354
|
-
protoOf(PythonIrEmitter).
|
|
1355
|
-
var source = replaceReflectInNonGenericStructFields(convert(Companion_instance.
|
|
1354
|
+
protoOf(PythonIrEmitter).v1v = function () {
|
|
1355
|
+
var source = replaceReflectInNonGenericStructFields(convert(Companion_instance.cs('shared')));
|
|
1356
1356
|
var tmp;
|
|
1357
|
-
if (this.
|
|
1358
|
-
tmp = new File(Companion_getInstance().
|
|
1357
|
+
if (this.d1z_1.xo_1) {
|
|
1358
|
+
tmp = new File(Companion_getInstance().n1h(this.c1z_1.fs() + 'wirespec'), listOf_0(raw(this.h1z_1 + PythonGenerator_instance.t1v(source))));
|
|
1359
1359
|
} else {
|
|
1360
1360
|
tmp = null;
|
|
1361
1361
|
}
|
|
1362
1362
|
return tmp;
|
|
1363
1363
|
};
|
|
1364
|
-
protoOf(PythonIrEmitter).
|
|
1364
|
+
protoOf(PythonIrEmitter).u1v = function (module_0, logger) {
|
|
1365
1365
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
1366
|
-
var this_0 = new NonEmptyList(module_0.
|
|
1366
|
+
var this_0 = new NonEmptyList(module_0.tq_1);
|
|
1367
1367
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
1368
1368
|
var tmp = PythonIrEmitter$emit$lambda;
|
|
1369
1369
|
var tmp$ret$0 = new sam$kotlin_Comparator$0_0(tmp);
|
|
1370
1370
|
var tmp$ret$1 = sortedWith(this_0, tmp$ret$0);
|
|
1371
1371
|
var tmp_0 = toNonEmptyListOrNull(tmp$ret$1);
|
|
1372
|
-
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).
|
|
1373
|
-
var emitted = emit.call(this, module_0.
|
|
1374
|
-
var tmp0 = new NonEmptyList(module_0.
|
|
1372
|
+
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).om_1;
|
|
1373
|
+
var emitted = emit.call(this, module_0.mv(VOID, statements), logger);
|
|
1374
|
+
var tmp0 = new NonEmptyList(module_0.tq_1);
|
|
1375
1375
|
var tmp$ret$2;
|
|
1376
1376
|
$l$block_0: {
|
|
1377
1377
|
// Inline function 'kotlin.collections.any' call
|
|
@@ -1396,7 +1396,7 @@ protoOf(PythonIrEmitter).s1z = function (module_0, logger) {
|
|
|
1396
1396
|
tmp$ret$2 = false;
|
|
1397
1397
|
}
|
|
1398
1398
|
var hasEndpoints = tmp$ret$2;
|
|
1399
|
-
var tmp_2 = Companion_getInstance().
|
|
1399
|
+
var tmp_2 = Companion_getInstance().n1h(this.c1z_1.fs() + '__init__');
|
|
1400
1400
|
// Inline function 'kotlin.collections.buildList' call
|
|
1401
1401
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1402
1402
|
// Inline function 'kotlin.apply' call
|
|
@@ -1407,11 +1407,11 @@ protoOf(PythonIrEmitter).s1z = function (module_0, logger) {
|
|
|
1407
1407
|
this_1.x(import_0('.', 'client'));
|
|
1408
1408
|
}
|
|
1409
1409
|
this_1.x(import_0('.', 'wirespec'));
|
|
1410
|
-
var tmp$ret$7 = this_1.
|
|
1410
|
+
var tmp$ret$7 = this_1.o5();
|
|
1411
1411
|
var init = new File(tmp_2, tmp$ret$7);
|
|
1412
|
-
var tmp_3 = Companion_getInstance().
|
|
1412
|
+
var tmp_3 = Companion_getInstance().n1h(this.c1z_1.fs() + 'endpoint/' + '__init__');
|
|
1413
1413
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1414
|
-
var tmp0_0 = new NonEmptyList(module_0.
|
|
1414
|
+
var tmp0_0 = new NonEmptyList(module_0.tq_1);
|
|
1415
1415
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1416
1416
|
var destination = ArrayList_init_$Create$();
|
|
1417
1417
|
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
@@ -1431,9 +1431,9 @@ protoOf(PythonIrEmitter).s1z = function (module_0, logger) {
|
|
|
1431
1431
|
destination_0.x(tmp$ret$10);
|
|
1432
1432
|
}
|
|
1433
1433
|
var initEndpoint = new File(tmp_3, destination_0);
|
|
1434
|
-
var tmp_4 = Companion_getInstance().
|
|
1434
|
+
var tmp_4 = Companion_getInstance().n1h(this.c1z_1.fs() + 'model/' + '__init__');
|
|
1435
1435
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1436
|
-
var tmp0_1 = new NonEmptyList(module_0.
|
|
1436
|
+
var tmp0_1 = new NonEmptyList(module_0.tq_1);
|
|
1437
1437
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1438
1438
|
var destination_1 = ArrayList_init_$Create$();
|
|
1439
1439
|
var _iterator__ex2g4s_2 = tmp0_1.t();
|
|
@@ -1453,8 +1453,8 @@ protoOf(PythonIrEmitter).s1z = function (module_0, logger) {
|
|
|
1453
1453
|
destination_2.x(tmp$ret$15);
|
|
1454
1454
|
}
|
|
1455
1455
|
var initModel = new File(tmp_4, destination_2);
|
|
1456
|
-
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().
|
|
1457
|
-
var tmp0_2 = dropLast(split(this.
|
|
1456
|
+
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().n1h(this.c1z_1.fs() + 'client/' + '__init__'), emptyList())) : emptyList();
|
|
1457
|
+
var tmp0_2 = dropLast(split(this.c1z_1.ds_1, ['.']), 1);
|
|
1458
1458
|
var tmp$ret$18;
|
|
1459
1459
|
$l$block_1: {
|
|
1460
1460
|
// Inline function 'kotlin.collections.runningFold' call
|
|
@@ -1491,17 +1491,17 @@ protoOf(PythonIrEmitter).s1z = function (module_0, logger) {
|
|
|
1491
1491
|
var _iterator__ex2g4s_5 = this_3.t();
|
|
1492
1492
|
while (_iterator__ex2g4s_5.u()) {
|
|
1493
1493
|
var item_1 = _iterator__ex2g4s_5.v();
|
|
1494
|
-
var tmp$ret$23 = new File(Companion_getInstance().
|
|
1494
|
+
var tmp$ret$23 = new File(Companion_getInstance().n1h(item_1 + '/__init__'), emptyList());
|
|
1495
1495
|
destination_3.x(tmp$ret$23);
|
|
1496
1496
|
}
|
|
1497
1497
|
var parentInits = destination_3;
|
|
1498
|
-
return this.
|
|
1498
|
+
return this.d1z_1.xo_1 ? NonEmptyList__plus_impl_xqmb9_0(NonEmptyList__plus_impl_xqmb9_0(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(emitted, init), initEndpoint), initModel), initClient), parentInits) : NonEmptyList__plus_impl_xqmb9_0(NonEmptyList__plus_impl_xqmb9(emitted, init), parentInits);
|
|
1499
1499
|
};
|
|
1500
|
-
protoOf(PythonIrEmitter).
|
|
1500
|
+
protoOf(PythonIrEmitter).lr = function (definition, module_0, logger) {
|
|
1501
1501
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1502
|
-
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.
|
|
1502
|
+
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.c1z_1, definition);
|
|
1503
1503
|
};
|
|
1504
|
-
protoOf(PythonIrEmitter).
|
|
1504
|
+
protoOf(PythonIrEmitter).z1v = function (definition, module_0) {
|
|
1505
1505
|
var tmp;
|
|
1506
1506
|
if (definition instanceof Type) {
|
|
1507
1507
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1522,7 +1522,7 @@ protoOf(PythonIrEmitter).x1z = function (definition, module_0) {
|
|
|
1522
1522
|
}
|
|
1523
1523
|
var generatorFile = tmp;
|
|
1524
1524
|
var sanitized = sanitizeNames(generatorFile, _get_sanitizationConfig__sns434(this));
|
|
1525
|
-
var generatorOwnName = definition.
|
|
1525
|
+
var generatorOwnName = definition.mr().l1() + 'Generator';
|
|
1526
1526
|
var tmp_0 = asSequence(collectCustomTypeNames(sanitized));
|
|
1527
1527
|
var tmp_1 = filterNot(tmp_0, PythonIrEmitter$emitGenerator$lambda);
|
|
1528
1528
|
var tmp_2 = filterNot(tmp_1, PythonIrEmitter$emitGenerator$lambda_0(generatorOwnName));
|
|
@@ -1531,8 +1531,8 @@ protoOf(PythonIrEmitter).x1z = function (definition, module_0) {
|
|
|
1531
1531
|
var generatorRefs = LinkedHashSet_init_$Create$();
|
|
1532
1532
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1533
1533
|
var scope = new TransformScope(sanitized);
|
|
1534
|
-
scope.
|
|
1535
|
-
var tmp_3 = scope.
|
|
1534
|
+
scope.n1v(PythonIrEmitter$emitGenerator$lambda_2(generatorOwnName, generatorRefs));
|
|
1535
|
+
var tmp_3 = scope.f1v_1;
|
|
1536
1536
|
isInterface(tmp_3, Element) || THROW_CCE();
|
|
1537
1537
|
// Inline function 'kotlin.collections.filter' call
|
|
1538
1538
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -1575,9 +1575,9 @@ protoOf(PythonIrEmitter).x1z = function (definition, module_0) {
|
|
|
1575
1575
|
destination_2.x(tmp$ret$12);
|
|
1576
1576
|
}
|
|
1577
1577
|
var modelImports = destination_2;
|
|
1578
|
-
return placeInModule_0(prependImports(sanitized, plus(plus(buildImports(this, '..wirespec'), modelImports), generatorImports)), this.
|
|
1578
|
+
return placeInModule_0(prependImports(sanitized, plus(plus(buildImports(this, '..wirespec'), modelImports), generatorImports)), this.c1z_1, 'generator');
|
|
1579
1579
|
};
|
|
1580
|
-
protoOf(PythonIrEmitter).
|
|
1580
|
+
protoOf(PythonIrEmitter).kq = function (type, module_0) {
|
|
1581
1581
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1582
1582
|
var this_0 = importReferences(type);
|
|
1583
1583
|
var set = HashSet_init_$Create$();
|
|
@@ -1585,7 +1585,7 @@ protoOf(PythonIrEmitter).ku = function (type, module_0) {
|
|
|
1585
1585
|
var _iterator__ex2g4s = this_0.t();
|
|
1586
1586
|
while (_iterator__ex2g4s.u()) {
|
|
1587
1587
|
var e = _iterator__ex2g4s.v();
|
|
1588
|
-
var key = e.
|
|
1588
|
+
var key = e.bv_1;
|
|
1589
1589
|
if (set.x(key)) {
|
|
1590
1590
|
list.x(e);
|
|
1591
1591
|
}
|
|
@@ -1596,18 +1596,18 @@ protoOf(PythonIrEmitter).ku = function (type, module_0) {
|
|
|
1596
1596
|
var _iterator__ex2g4s_0 = list.t();
|
|
1597
1597
|
while (_iterator__ex2g4s_0.u()) {
|
|
1598
1598
|
var item = _iterator__ex2g4s_0.v();
|
|
1599
|
-
var tmp$ret$2 = import_0('.' + item.
|
|
1599
|
+
var tmp$ret$2 = import_0('.' + item.bv_1, item.bv_1);
|
|
1600
1600
|
destination.x(tmp$ret$2);
|
|
1601
1601
|
}
|
|
1602
1602
|
var typeImports = destination;
|
|
1603
1603
|
// Inline function 'kotlin.collections.map' call
|
|
1604
|
-
var this_1 = type.
|
|
1604
|
+
var this_1 = type.mp_1.ip_1;
|
|
1605
1605
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1606
1606
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1607
1607
|
var _iterator__ex2g4s_1 = this_1.t();
|
|
1608
1608
|
while (_iterator__ex2g4s_1.u()) {
|
|
1609
1609
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
1610
|
-
var tmp$ret$5 = item_0.
|
|
1610
|
+
var tmp$ret$5 = item_0.qp_1.l1();
|
|
1611
1611
|
destination_0.x(tmp$ret$5);
|
|
1612
1612
|
}
|
|
1613
1613
|
var fieldNames = toSet(destination_0);
|
|
@@ -1623,17 +1623,17 @@ protoOf(PythonIrEmitter).ku = function (type, module_0) {
|
|
|
1623
1623
|
var tmp$ret$10 = tmp_0;
|
|
1624
1624
|
return prependImports(tmp, tmp$ret$10);
|
|
1625
1625
|
};
|
|
1626
|
-
protoOf(PythonIrEmitter).
|
|
1626
|
+
protoOf(PythonIrEmitter).zr = function (enum_0, module_0) {
|
|
1627
1627
|
var tmp = convert_0(enum_0);
|
|
1628
1628
|
return sanitizeNames(sanitizeEnumEntries(tmp, PythonIrEmitter$emit$lambda_0(this)), _get_sanitizationConfig__sns434(this));
|
|
1629
1629
|
};
|
|
1630
|
-
protoOf(PythonIrEmitter).
|
|
1630
|
+
protoOf(PythonIrEmitter).pr = function (union) {
|
|
1631
1631
|
return sanitizeNames(convert_1(union), _get_sanitizationConfig__sns434(this));
|
|
1632
1632
|
};
|
|
1633
|
-
protoOf(PythonIrEmitter).
|
|
1633
|
+
protoOf(PythonIrEmitter).ur = function (refined) {
|
|
1634
1634
|
return sanitizeNames(replaceRefinedFunctions(convert_2(refined), refined), _get_sanitizationConfig__sns434(this));
|
|
1635
1635
|
};
|
|
1636
|
-
protoOf(PythonIrEmitter).
|
|
1636
|
+
protoOf(PythonIrEmitter).as = function (endpoint) {
|
|
1637
1637
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1638
1638
|
var this_0 = importReferences(endpoint);
|
|
1639
1639
|
var set = HashSet_init_$Create$();
|
|
@@ -1641,7 +1641,7 @@ protoOf(PythonIrEmitter).zv = function (endpoint) {
|
|
|
1641
1641
|
var _iterator__ex2g4s = this_0.t();
|
|
1642
1642
|
while (_iterator__ex2g4s.u()) {
|
|
1643
1643
|
var e = _iterator__ex2g4s.v();
|
|
1644
|
-
var key = e.
|
|
1644
|
+
var key = e.bv_1;
|
|
1645
1645
|
if (set.x(key)) {
|
|
1646
1646
|
list.x(e);
|
|
1647
1647
|
}
|
|
@@ -1652,19 +1652,19 @@ protoOf(PythonIrEmitter).zv = function (endpoint) {
|
|
|
1652
1652
|
var _iterator__ex2g4s_0 = list.t();
|
|
1653
1653
|
while (_iterator__ex2g4s_0.u()) {
|
|
1654
1654
|
var item = _iterator__ex2g4s_0.v();
|
|
1655
|
-
var tmp$ret$2 = import_0('..model.' + item.
|
|
1655
|
+
var tmp$ret$2 = import_0('..model.' + item.bv_1, item.bv_1);
|
|
1656
1656
|
destination.x(tmp$ret$2);
|
|
1657
1657
|
}
|
|
1658
1658
|
var endpointImports = destination;
|
|
1659
1659
|
// Inline function 'kotlin.let' call
|
|
1660
1660
|
var it = splitEndpointStructsToModuleLevel(convert_3(endpoint));
|
|
1661
|
-
var tmp$ret$6 = it.
|
|
1661
|
+
var tmp$ret$6 = it.y1n(VOID, plus(endpointImports, it.v1n_1));
|
|
1662
1662
|
return sanitizeNames(snakeCaseHandlerAndCallMethods(tmp$ret$6), _get_sanitizationConfig__sns434(this));
|
|
1663
1663
|
};
|
|
1664
|
-
protoOf(PythonIrEmitter).
|
|
1664
|
+
protoOf(PythonIrEmitter).or = function (channel) {
|
|
1665
1665
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1666
1666
|
};
|
|
1667
|
-
protoOf(PythonIrEmitter).
|
|
1667
|
+
protoOf(PythonIrEmitter).y1v = function (endpoint) {
|
|
1668
1668
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1669
1669
|
var this_0 = importReferences(endpoint);
|
|
1670
1670
|
var set = HashSet_init_$Create$();
|
|
@@ -1672,7 +1672,7 @@ protoOf(PythonIrEmitter).w1z = function (endpoint) {
|
|
|
1672
1672
|
var _iterator__ex2g4s = this_0.t();
|
|
1673
1673
|
while (_iterator__ex2g4s.u()) {
|
|
1674
1674
|
var e = _iterator__ex2g4s.v();
|
|
1675
|
-
var key = e.
|
|
1675
|
+
var key = e.bv_1;
|
|
1676
1676
|
if (set.x(key)) {
|
|
1677
1677
|
list.x(e);
|
|
1678
1678
|
}
|
|
@@ -1683,17 +1683,17 @@ protoOf(PythonIrEmitter).w1z = function (endpoint) {
|
|
|
1683
1683
|
var _iterator__ex2g4s_0 = list.t();
|
|
1684
1684
|
while (_iterator__ex2g4s_0.u()) {
|
|
1685
1685
|
var item = _iterator__ex2g4s_0.v();
|
|
1686
|
-
var tmp$ret$2 = import_0('..model.' + item.
|
|
1686
|
+
var tmp$ret$2 = import_0('..model.' + item.bv_1, item.bv_1);
|
|
1687
1687
|
destination.x(tmp$ret$2);
|
|
1688
1688
|
}
|
|
1689
1689
|
var modelImports = destination;
|
|
1690
|
-
var endpointImport = import_0('..endpoint.' + endpoint.
|
|
1691
|
-
var endpointName = endpoint.
|
|
1690
|
+
var endpointImport = import_0('..endpoint.' + endpoint.up_1.l1(), '*');
|
|
1691
|
+
var endpointName = endpoint.up_1.l1();
|
|
1692
1692
|
var file = flattenEndpointTypeRefs(snakeCaseClientFunctions(addSelfReceiverToClientFields(sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this)))), endpointName);
|
|
1693
|
-
var subPackageName = plus_2(this.
|
|
1694
|
-
return new File(Companion_getInstance().
|
|
1693
|
+
var subPackageName = plus_2(this.c1z_1, 'client');
|
|
1694
|
+
return new File(Companion_getInstance().n1h(subPackageName.fs() + file.u1n_1.y1i()), plus(plus(plus(buildImports(this, '..wirespec'), modelImports), listOf_0(endpointImport)), file.v1n_1));
|
|
1695
1695
|
};
|
|
1696
|
-
protoOf(PythonIrEmitter).
|
|
1696
|
+
protoOf(PythonIrEmitter).w1v = function (endpoints, logger) {
|
|
1697
1697
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1698
1698
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1699
1699
|
var destination = ArrayList_init_$Create$();
|
|
@@ -1709,7 +1709,7 @@ protoOf(PythonIrEmitter).u1z = function (endpoints, logger) {
|
|
|
1709
1709
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1710
1710
|
while (_iterator__ex2g4s_0.u()) {
|
|
1711
1711
|
var e = _iterator__ex2g4s_0.v();
|
|
1712
|
-
var key = e.
|
|
1712
|
+
var key = e.bv_1;
|
|
1713
1713
|
if (set.x(key)) {
|
|
1714
1714
|
list_0.x(e);
|
|
1715
1715
|
}
|
|
@@ -1720,7 +1720,7 @@ protoOf(PythonIrEmitter).u1z = function (endpoints, logger) {
|
|
|
1720
1720
|
var _iterator__ex2g4s_1 = list_0.t();
|
|
1721
1721
|
while (_iterator__ex2g4s_1.u()) {
|
|
1722
1722
|
var item = _iterator__ex2g4s_1.v();
|
|
1723
|
-
var tmp$ret$5 = import_0('.model.' + item.
|
|
1723
|
+
var tmp$ret$5 = import_0('.model.' + item.bv_1, item.bv_1);
|
|
1724
1724
|
destination_0.x(tmp$ret$5);
|
|
1725
1725
|
}
|
|
1726
1726
|
var modelImports = destination_0;
|
|
@@ -1730,7 +1730,7 @@ protoOf(PythonIrEmitter).u1z = function (endpoints, logger) {
|
|
|
1730
1730
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1731
1731
|
while (_iterator__ex2g4s_2.u()) {
|
|
1732
1732
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
1733
|
-
var tmp$ret$8 = import_0('.endpoint.' + item_0.
|
|
1733
|
+
var tmp$ret$8 = import_0('.endpoint.' + item_0.up_1.l1(), '*');
|
|
1734
1734
|
destination_1.x(tmp$ret$8);
|
|
1735
1735
|
}
|
|
1736
1736
|
var endpointImports = destination_1;
|
|
@@ -1740,7 +1740,7 @@ protoOf(PythonIrEmitter).u1z = function (endpoints, logger) {
|
|
|
1740
1740
|
var _iterator__ex2g4s_3 = endpoints.t();
|
|
1741
1741
|
while (_iterator__ex2g4s_3.u()) {
|
|
1742
1742
|
var item_1 = _iterator__ex2g4s_3.v();
|
|
1743
|
-
var tmp$ret$11 = import_0('.client.' + item_1.
|
|
1743
|
+
var tmp$ret$11 = import_0('.client.' + item_1.up_1.l1() + 'Client', item_1.up_1.l1() + 'Client');
|
|
1744
1744
|
destination_2.x(tmp$ret$11);
|
|
1745
1745
|
}
|
|
1746
1746
|
var clientImports = destination_2;
|
|
@@ -1751,7 +1751,7 @@ protoOf(PythonIrEmitter).u1z = function (endpoints, logger) {
|
|
|
1751
1751
|
var _iterator__ex2g4s_4 = endpoints.t();
|
|
1752
1752
|
while (_iterator__ex2g4s_4.u()) {
|
|
1753
1753
|
var item_2 = _iterator__ex2g4s_4.v();
|
|
1754
|
-
var tmp$ret$14 = item_2.
|
|
1754
|
+
var tmp$ret$14 = item_2.up_1.l1();
|
|
1755
1755
|
destination_3.x(tmp$ret$14);
|
|
1756
1756
|
}
|
|
1757
1757
|
var endpointNames = destination_3;
|
|
@@ -1765,7 +1765,7 @@ protoOf(PythonIrEmitter).u1z = function (endpoints, logger) {
|
|
|
1765
1765
|
accumulator = flattenEndpointTypeRefs(acc, element_0);
|
|
1766
1766
|
}
|
|
1767
1767
|
var file = accumulator;
|
|
1768
|
-
return new File(Companion_getInstance().
|
|
1768
|
+
return new File(Companion_getInstance().n1h(this.c1z_1.fs() + file.u1n_1.y1i()), plus(plus(buildImports(this, '.wirespec'), allImports), file.v1n_1));
|
|
1769
1769
|
};
|
|
1770
1770
|
function replaceReflectInNonGenericStructFields(_this__u8e3s4) {
|
|
1771
1771
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -1773,14 +1773,14 @@ function replaceReflectInNonGenericStructFields(_this__u8e3s4) {
|
|
|
1773
1773
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1774
1774
|
var tmp = scope;
|
|
1775
1775
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1776
|
-
var this_0 = scope.
|
|
1776
|
+
var this_0 = scope.f1v_1;
|
|
1777
1777
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1778
1778
|
// Inline function 'kotlin.apply' call
|
|
1779
1779
|
var this_1 = new TransformerBuilder();
|
|
1780
|
-
this_1.
|
|
1781
|
-
var tmp$ret$2 = this_1.
|
|
1782
|
-
tmp.
|
|
1783
|
-
var tmp_0 = scope.
|
|
1780
|
+
this_1.w1i(replaceReflectInNonGenericStructFields$lambda);
|
|
1781
|
+
var tmp$ret$2 = this_1.x1i();
|
|
1782
|
+
tmp.f1v_1 = transform(this_0, tmp$ret$2);
|
|
1783
|
+
var tmp_0 = scope.f1v_1;
|
|
1784
1784
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1785
1785
|
}
|
|
1786
1786
|
function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
@@ -1789,14 +1789,14 @@ function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
|
1789
1789
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1790
1790
|
var tmp = scope;
|
|
1791
1791
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1792
|
-
var this_0 = scope.
|
|
1792
|
+
var this_0 = scope.f1v_1;
|
|
1793
1793
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1794
1794
|
// Inline function 'kotlin.apply' call
|
|
1795
1795
|
var this_1 = new TransformerBuilder();
|
|
1796
|
-
this_1.
|
|
1797
|
-
var tmp$ret$2 = this_1.
|
|
1798
|
-
tmp.
|
|
1799
|
-
var tmp_0 = scope.
|
|
1796
|
+
this_1.w1i(replaceRefinedFunctions$lambda(refined));
|
|
1797
|
+
var tmp$ret$2 = this_1.x1i();
|
|
1798
|
+
tmp.f1v_1 = transform(this_0, tmp$ret$2);
|
|
1799
|
+
var tmp_0 = scope.f1v_1;
|
|
1800
1800
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1801
1801
|
}
|
|
1802
1802
|
function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
@@ -1805,20 +1805,20 @@ function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
|
1805
1805
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1806
1806
|
var tmp = scope;
|
|
1807
1807
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1808
|
-
var this_0 = scope.
|
|
1808
|
+
var this_0 = scope.f1v_1;
|
|
1809
1809
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1810
1810
|
// Inline function 'kotlin.apply' call
|
|
1811
1811
|
var this_1 = new TransformerBuilder();
|
|
1812
|
-
this_1.
|
|
1813
|
-
var tmp$ret$2 = this_1.
|
|
1814
|
-
tmp.
|
|
1815
|
-
var tmp_0 = scope.
|
|
1812
|
+
this_1.w1i(snakeCaseHandlerAndCallMethods$lambda);
|
|
1813
|
+
var tmp$ret$2 = this_1.x1i();
|
|
1814
|
+
tmp.f1v_1 = transform(this_0, tmp$ret$2);
|
|
1815
|
+
var tmp_0 = scope.f1v_1;
|
|
1816
1816
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1817
1817
|
}
|
|
1818
1818
|
function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
1819
1819
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1820
1820
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1821
|
-
var tmp0 = _this__u8e3s4.
|
|
1821
|
+
var tmp0 = _this__u8e3s4.w1n();
|
|
1822
1822
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1823
1823
|
var destination = ArrayList_init_$Create$();
|
|
1824
1824
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1830,9 +1830,8 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1830
1830
|
}
|
|
1831
1831
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1832
1832
|
var namespace = ensureNotNull(tmp$ret$2);
|
|
1833
|
-
var flattened = flattenNestedStructs(namespace);
|
|
1834
1833
|
// Inline function 'kotlin.collections.partition' call
|
|
1835
|
-
var this_0 =
|
|
1834
|
+
var this_0 = namespace.b1o_1;
|
|
1836
1835
|
var first = ArrayList_init_$Create$();
|
|
1837
1836
|
var second = ArrayList_init_$Create$();
|
|
1838
1837
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
@@ -1851,16 +1850,16 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1851
1850
|
}
|
|
1852
1851
|
}
|
|
1853
1852
|
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.
|
|
1853
|
+
var moduleElements = _destruct__k2r9zo.ve();
|
|
1854
|
+
var classElements = _destruct__k2r9zo.we();
|
|
1855
|
+
var endpointClass = new Namespace(namespace.a1o_1, classElements, namespace.c1o_1);
|
|
1856
|
+
return new File(namespace.a1o_1, plus_0(moduleElements, endpointClass));
|
|
1858
1857
|
}
|
|
1859
1858
|
function flattenEndpointTypeRefs(_this__u8e3s4, endpointName) {
|
|
1860
1859
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1861
1860
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1862
|
-
scope.
|
|
1863
|
-
var tmp = scope.
|
|
1861
|
+
scope.l1v(flattenEndpointTypeRefs$lambda(endpointName));
|
|
1862
|
+
var tmp = scope.f1v_1;
|
|
1864
1863
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1865
1864
|
}
|
|
1866
1865
|
function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
@@ -1869,15 +1868,15 @@ function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
|
1869
1868
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1870
1869
|
var tmp = scope;
|
|
1871
1870
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1872
|
-
var this_0 = scope.
|
|
1871
|
+
var this_0 = scope.f1v_1;
|
|
1873
1872
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1874
1873
|
// Inline function 'kotlin.apply' call
|
|
1875
1874
|
var this_1 = new TransformerBuilder();
|
|
1876
|
-
this_1.
|
|
1877
|
-
var tmp$ret$2 = this_1.
|
|
1878
|
-
tmp.
|
|
1879
|
-
scope.
|
|
1880
|
-
var tmp_0 = scope.
|
|
1875
|
+
this_1.w1i(snakeCaseClientFunctions$lambda);
|
|
1876
|
+
var tmp$ret$2 = this_1.x1i();
|
|
1877
|
+
tmp.f1v_1 = transform(this_0, tmp$ret$2);
|
|
1878
|
+
scope.o1v(snakeCaseClientFunctions$lambda_0);
|
|
1879
|
+
var tmp_0 = scope.f1v_1;
|
|
1881
1880
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1882
1881
|
}
|
|
1883
1882
|
function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
@@ -1888,7 +1887,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1888
1887
|
} else {
|
|
1889
1888
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1890
1889
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1891
|
-
var tmp0 = tmp0_safe_receiver.
|
|
1890
|
+
var tmp0 = tmp0_safe_receiver.w1n();
|
|
1892
1891
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1893
1892
|
var destination = ArrayList_init_$Create$();
|
|
1894
1893
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1901,7 +1900,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1901
1900
|
tmp = firstOrNull_0(destination);
|
|
1902
1901
|
}
|
|
1903
1902
|
var struct = tmp;
|
|
1904
|
-
var tmp2_safe_receiver = struct == null ? null : struct.
|
|
1903
|
+
var tmp2_safe_receiver = struct == null ? null : struct.g1o_1;
|
|
1905
1904
|
var tmp_0;
|
|
1906
1905
|
if (tmp2_safe_receiver == null) {
|
|
1907
1906
|
tmp_0 = null;
|
|
@@ -1912,7 +1911,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1912
1911
|
var _iterator__ex2g4s_0 = tmp2_safe_receiver.t();
|
|
1913
1912
|
while (_iterator__ex2g4s_0.u()) {
|
|
1914
1913
|
var item = _iterator__ex2g4s_0.v();
|
|
1915
|
-
var tmp$ret$3 = item.
|
|
1914
|
+
var tmp$ret$3 = item.b1q_1.j1j();
|
|
1916
1915
|
destination_0.x(tmp$ret$3);
|
|
1917
1916
|
}
|
|
1918
1917
|
tmp_0 = destination_0;
|
|
@@ -1924,23 +1923,23 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1924
1923
|
return _this__u8e3s4;
|
|
1925
1924
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1926
1925
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1927
|
-
scope.
|
|
1928
|
-
var tmp_1 = scope.
|
|
1926
|
+
scope.o1v(addSelfReceiverToClientFields$lambda(fieldNames));
|
|
1927
|
+
var tmp_1 = scope.f1v_1;
|
|
1929
1928
|
return isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1930
1929
|
}
|
|
1931
1930
|
function replaceReflectAsTypeAny(_this__u8e3s4) {
|
|
1932
1931
|
var tmp;
|
|
1933
1932
|
if (equals(_this__u8e3s4, Reflect_instance)) {
|
|
1934
|
-
tmp =
|
|
1933
|
+
tmp = Custom_init_$Create$('type', listOf_0(Any_instance));
|
|
1935
1934
|
} else {
|
|
1936
1935
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
1937
|
-
tmp = _this__u8e3s4.
|
|
1936
|
+
tmp = _this__u8e3s4.g1n(replaceReflectAsTypeAny(_this__u8e3s4.f1j_1));
|
|
1938
1937
|
} else {
|
|
1939
1938
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
1940
|
-
tmp = _this__u8e3s4.
|
|
1939
|
+
tmp = _this__u8e3s4.g1n(replaceReflectAsTypeAny(_this__u8e3s4.g1j_1));
|
|
1941
1940
|
} else {
|
|
1942
1941
|
if (_this__u8e3s4 instanceof Dict_0) {
|
|
1943
|
-
tmp = _this__u8e3s4.
|
|
1942
|
+
tmp = _this__u8e3s4.j1n(replaceReflectAsTypeAny(_this__u8e3s4.h1n_1), replaceReflectAsTypeAny(_this__u8e3s4.i1n_1));
|
|
1944
1943
|
} else {
|
|
1945
1944
|
tmp = _this__u8e3s4;
|
|
1946
1945
|
}
|
|
@@ -1955,21 +1954,21 @@ function replaceReflectInNonGenericStructFields$lambda(element, transformer) {
|
|
|
1955
1954
|
var tmp$ret$1;
|
|
1956
1955
|
$l$block: {
|
|
1957
1956
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1958
|
-
if (!element.
|
|
1957
|
+
if (!element.k1o_1.r()) {
|
|
1959
1958
|
tmp$ret$1 = element;
|
|
1960
1959
|
break $l$block;
|
|
1961
1960
|
}
|
|
1962
1961
|
// Inline function 'kotlin.collections.map' call
|
|
1963
|
-
var this_0 = element.
|
|
1962
|
+
var this_0 = element.g1o_1;
|
|
1964
1963
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1965
1964
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1966
1965
|
var _iterator__ex2g4s = this_0.t();
|
|
1967
1966
|
while (_iterator__ex2g4s.u()) {
|
|
1968
1967
|
var item = _iterator__ex2g4s.v();
|
|
1969
|
-
var tmp$ret$2 = item.
|
|
1968
|
+
var tmp$ret$2 = item.f1q(VOID, replaceReflectAsTypeAny(item.c1q_1));
|
|
1970
1969
|
destination.x(tmp$ret$2);
|
|
1971
1970
|
}
|
|
1972
|
-
tmp$ret$1 = element.
|
|
1971
|
+
tmp$ret$1 = element.m1o(VOID, destination);
|
|
1973
1972
|
}
|
|
1974
1973
|
tmp = tmp$ret$1;
|
|
1975
1974
|
} else {
|
|
@@ -1980,17 +1979,17 @@ function replaceReflectInNonGenericStructFields$lambda(element, transformer) {
|
|
|
1980
1979
|
}
|
|
1981
1980
|
function replaceRefinedFunctions$lambda$lambda($constraintExpr) {
|
|
1982
1981
|
return function ($this$function) {
|
|
1983
|
-
$this$function.
|
|
1984
|
-
$this$function.
|
|
1985
|
-
$this$function.
|
|
1982
|
+
$this$function.x1h('self', Custom_init_$Create$(''));
|
|
1983
|
+
$this$function.a1i(Boolean_instance_0);
|
|
1984
|
+
$this$function.b1i($constraintExpr);
|
|
1986
1985
|
return Unit_instance;
|
|
1987
1986
|
};
|
|
1988
1987
|
}
|
|
1989
1988
|
function replaceRefinedFunctions$lambda$lambda_0($toStringExpr) {
|
|
1990
1989
|
return function ($this$function) {
|
|
1991
|
-
$this$function.
|
|
1992
|
-
$this$function.
|
|
1993
|
-
$this$function.
|
|
1990
|
+
$this$function.x1h('self', Custom_init_$Create$(''));
|
|
1991
|
+
$this$function.a1i(String_instance);
|
|
1992
|
+
$this$function.b1i(new RawExpression($toStringExpr));
|
|
1994
1993
|
return Unit_instance;
|
|
1995
1994
|
};
|
|
1996
1995
|
}
|
|
@@ -1999,7 +1998,7 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
1999
1998
|
var tmp;
|
|
2000
1999
|
if (element instanceof Struct) {
|
|
2001
2000
|
// Inline function 'kotlin.collections.mapNotNull' call
|
|
2002
|
-
var tmp0 = element.
|
|
2001
|
+
var tmp0 = element.j1o_1;
|
|
2003
2002
|
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
2004
2003
|
var destination = ArrayList_init_$Create$();
|
|
2005
2004
|
// Inline function 'kotlin.collections.forEach' call
|
|
@@ -2009,23 +2008,23 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
2009
2008
|
var tmp_0;
|
|
2010
2009
|
var tmp_1;
|
|
2011
2010
|
if (element_0 instanceof Function) {
|
|
2012
|
-
tmp_1 = element_0.
|
|
2011
|
+
tmp_1 = element_0.d1l_1.equals(Companion_getInstance().n1h('validate'));
|
|
2013
2012
|
} else {
|
|
2014
2013
|
tmp_1 = false;
|
|
2015
2014
|
}
|
|
2016
2015
|
if (tmp_1) {
|
|
2017
|
-
var constraintExpr = convertConstraint($refined.
|
|
2016
|
+
var constraintExpr = convertConstraint($refined.tr_1, new FieldCall(new VariableReference(Companion_getInstance().n1h('self')), Companion_getInstance().n1h('value')));
|
|
2018
2017
|
tmp_0 = function_0('validate', VOID, VOID, replaceRefinedFunctions$lambda$lambda(constraintExpr));
|
|
2019
2018
|
} else {
|
|
2020
2019
|
var tmp_2;
|
|
2021
2020
|
if (element_0 instanceof Function) {
|
|
2022
|
-
tmp_2 = element_0.
|
|
2021
|
+
tmp_2 = element_0.d1l_1.equals(Companion_getInstance().n1h('toString'));
|
|
2023
2022
|
} else {
|
|
2024
2023
|
tmp_2 = false;
|
|
2025
2024
|
}
|
|
2026
2025
|
if (tmp_2) {
|
|
2027
2026
|
var tmp_3;
|
|
2028
|
-
if ($refined.
|
|
2027
|
+
if ($refined.tr_1.fv_1 instanceof String_0) {
|
|
2029
2028
|
tmp_3 = 'self.value';
|
|
2030
2029
|
} else {
|
|
2031
2030
|
tmp_3 = 'str(self.value)';
|
|
@@ -2044,7 +2043,7 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
2044
2043
|
destination.x(tmp0_safe_receiver);
|
|
2045
2044
|
}
|
|
2046
2045
|
}
|
|
2047
|
-
tmp = element.
|
|
2046
|
+
tmp = element.m1o(VOID, VOID, VOID, VOID, destination);
|
|
2048
2047
|
} else {
|
|
2049
2048
|
tmp = element;
|
|
2050
2049
|
}
|
|
@@ -2057,23 +2056,23 @@ function snakeCaseHandlerAndCallMethods$lambda(element, transformer) {
|
|
|
2057
2056
|
if (element instanceof Interface) {
|
|
2058
2057
|
var tmp$ret$0;
|
|
2059
2058
|
$l$block: {
|
|
2060
|
-
if (!element.
|
|
2059
|
+
if (!element.o1o_1.equals(Companion_getInstance().n1h('Handler')) && !element.o1o_1.equals(Companion_getInstance().n1h('Call'))) {
|
|
2061
2060
|
tmp$ret$0 = element;
|
|
2062
2061
|
break $l$block;
|
|
2063
2062
|
}
|
|
2064
2063
|
// Inline function 'kotlin.collections.map' call
|
|
2065
|
-
var this_0 = element.
|
|
2064
|
+
var this_0 = element.p1o_1;
|
|
2066
2065
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2067
2066
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2068
2067
|
var _iterator__ex2g4s = this_0.t();
|
|
2069
2068
|
while (_iterator__ex2g4s.u()) {
|
|
2070
2069
|
var item = _iterator__ex2g4s.v();
|
|
2071
2070
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
2072
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
2071
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.l1l(Companion_getInstance().n1h(item.d1l_1.w1m()));
|
|
2073
2072
|
var tmp$ret$1 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
2074
2073
|
destination.x(tmp$ret$1);
|
|
2075
2074
|
}
|
|
2076
|
-
tmp$ret$0 = element.
|
|
2075
|
+
tmp$ret$0 = element.v1o(VOID, destination);
|
|
2077
2076
|
}
|
|
2078
2077
|
tmp = tmp$ret$0;
|
|
2079
2078
|
} else {
|
|
@@ -2088,17 +2087,17 @@ function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
|
2088
2087
|
if (!(type instanceof Custom_0)) {
|
|
2089
2088
|
tmp = type;
|
|
2090
2089
|
} else {
|
|
2091
|
-
if (!startsWith(type.
|
|
2090
|
+
if (!startsWith(type.h1j_1.y1i(), $endpointName + '.')) {
|
|
2092
2091
|
tmp = type;
|
|
2093
2092
|
} else {
|
|
2094
|
-
var suffix = removePrefix(type.
|
|
2093
|
+
var suffix = removePrefix(type.h1j_1.y1i(), $endpointName + '.');
|
|
2095
2094
|
switch (suffix) {
|
|
2096
2095
|
case 'Call':
|
|
2097
2096
|
case 'Handler':
|
|
2098
2097
|
tmp = type;
|
|
2099
2098
|
break;
|
|
2100
2099
|
default:
|
|
2101
|
-
tmp = type.
|
|
2100
|
+
tmp = type.l1n(Companion_getInstance().n1h(suffix));
|
|
2102
2101
|
break;
|
|
2103
2102
|
}
|
|
2104
2103
|
}
|
|
@@ -2109,7 +2108,7 @@ function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
|
2109
2108
|
function snakeCaseClientFunctions$lambda(element, transformer) {
|
|
2110
2109
|
var tmp;
|
|
2111
2110
|
if (element instanceof Function) {
|
|
2112
|
-
tmp = element.
|
|
2111
|
+
tmp = element.l1l(Companion_getInstance().n1h(element.d1l_1.w1m()), VOID, plus(listOf_0(new Parameter(Companion_getInstance().n1h('self'), Custom_init_$Create$(''))), element.f1l_1));
|
|
2113
2112
|
} else {
|
|
2114
2113
|
tmp = element;
|
|
2115
2114
|
}
|
|
@@ -2119,32 +2118,32 @@ function snakeCaseClientFunctions$lambda(element, transformer) {
|
|
|
2119
2118
|
function snakeCaseClientFunctions$lambda_0(stmt, tr) {
|
|
2120
2119
|
var tmp;
|
|
2121
2120
|
if (stmt instanceof FunctionCall) {
|
|
2122
|
-
var nameStr = stmt.
|
|
2123
|
-
var newName = contains(nameStr, '.') ? stmt.
|
|
2124
|
-
var tmp1_safe_receiver = stmt.
|
|
2121
|
+
var nameStr = stmt.z1m_1.j1j();
|
|
2122
|
+
var newName = contains(nameStr, '.') ? stmt.z1m_1 : Companion_getInstance().n1h(Companion_getInstance().n1h(nameStr).w1m());
|
|
2123
|
+
var tmp1_safe_receiver = stmt.x1m_1;
|
|
2125
2124
|
var tmp_0;
|
|
2126
2125
|
if (tmp1_safe_receiver == null) {
|
|
2127
2126
|
tmp_0 = null;
|
|
2128
2127
|
} else {
|
|
2129
2128
|
// Inline function 'kotlin.let' call
|
|
2130
|
-
tmp_0 = tr.
|
|
2129
|
+
tmp_0 = tr.a1v(tmp1_safe_receiver);
|
|
2131
2130
|
}
|
|
2132
2131
|
var tmp2_receiver = tmp_0;
|
|
2133
2132
|
// Inline function 'kotlin.collections.mapValues' call
|
|
2134
|
-
var this_0 = stmt.
|
|
2133
|
+
var this_0 = stmt.a1n_1;
|
|
2135
2134
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
2136
|
-
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.
|
|
2135
|
+
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.a1()));
|
|
2137
2136
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
2138
|
-
var _iterator__ex2g4s = this_0.
|
|
2137
|
+
var _iterator__ex2g4s = this_0.j1().t();
|
|
2139
2138
|
while (_iterator__ex2g4s.u()) {
|
|
2140
2139
|
var element = _iterator__ex2g4s.v();
|
|
2141
|
-
var tmp_1 = element.
|
|
2140
|
+
var tmp_1 = element.k1();
|
|
2142
2141
|
// Inline function 'kotlin.collections.component2' call
|
|
2143
|
-
var v = element.
|
|
2144
|
-
var tmp$ret$4 = tr.
|
|
2145
|
-
destination.
|
|
2142
|
+
var v = element.l1();
|
|
2143
|
+
var tmp$ret$4 = tr.a1v(v);
|
|
2144
|
+
destination.s2(tmp_1, tmp$ret$4);
|
|
2146
2145
|
}
|
|
2147
|
-
var tmp4_isAwait = !(stmt.
|
|
2146
|
+
var tmp4_isAwait = !(stmt.x1m_1 == null);
|
|
2148
2147
|
tmp = new FunctionCall(tmp2_receiver, VOID, newName, destination, tmp4_isAwait);
|
|
2149
2148
|
} else {
|
|
2150
2149
|
tmp = transformChildren(stmt, tr);
|
|
@@ -2157,28 +2156,28 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
2157
2156
|
var tmp_0;
|
|
2158
2157
|
var tmp_1;
|
|
2159
2158
|
if (stmt instanceof FieldCall) {
|
|
2160
|
-
tmp_1 = stmt.
|
|
2159
|
+
tmp_1 = stmt.r1q_1 == null;
|
|
2161
2160
|
} else {
|
|
2162
2161
|
tmp_1 = false;
|
|
2163
2162
|
}
|
|
2164
2163
|
if (tmp_1) {
|
|
2165
|
-
tmp_0 = $fieldNames.
|
|
2164
|
+
tmp_0 = $fieldNames.u1(stmt.s1q_1.j1j());
|
|
2166
2165
|
} else {
|
|
2167
2166
|
tmp_0 = false;
|
|
2168
2167
|
}
|
|
2169
2168
|
if (tmp_0) {
|
|
2170
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().
|
|
2169
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().n1h('self')), stmt.s1q_1);
|
|
2171
2170
|
} else {
|
|
2172
2171
|
if (stmt instanceof FieldCall) {
|
|
2173
|
-
var tmp0_safe_receiver = stmt.
|
|
2172
|
+
var tmp0_safe_receiver = stmt.r1q_1;
|
|
2174
2173
|
var tmp_2;
|
|
2175
2174
|
if (tmp0_safe_receiver == null) {
|
|
2176
2175
|
tmp_2 = null;
|
|
2177
2176
|
} else {
|
|
2178
2177
|
// Inline function 'kotlin.let' call
|
|
2179
|
-
tmp_2 = tr.
|
|
2178
|
+
tmp_2 = tr.a1v(tmp0_safe_receiver);
|
|
2180
2179
|
}
|
|
2181
|
-
tmp = new FieldCall(tmp_2, stmt.
|
|
2180
|
+
tmp = new FieldCall(tmp_2, stmt.s1q_1);
|
|
2182
2181
|
} else {
|
|
2183
2182
|
tmp = transformChildren(stmt, tr);
|
|
2184
2183
|
}
|
|
@@ -2189,8 +2188,8 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
2189
2188
|
function PythonRefinedTypeDefinitionEmitter() {
|
|
2190
2189
|
}
|
|
2191
2190
|
function PythonShared() {
|
|
2192
|
-
this.
|
|
2193
|
-
this.
|
|
2191
|
+
this.v1y_1 = 'shared';
|
|
2192
|
+
this.w1y_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
2193
|
}
|
|
2195
2194
|
protoOf(PythonShared).toString = function () {
|
|
2196
2195
|
return 'PythonShared';
|
|
@@ -2211,17 +2210,17 @@ function PythonShared_getInstance() {
|
|
|
2211
2210
|
}
|
|
2212
2211
|
function PythonTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
2213
2212
|
return function (it) {
|
|
2214
|
-
return this$0.
|
|
2213
|
+
return this$0.a1z(it);
|
|
2215
2214
|
};
|
|
2216
2215
|
}
|
|
2217
2216
|
function PythonTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2218
2217
|
return function (it) {
|
|
2219
|
-
return this$0.
|
|
2218
|
+
return this$0.a1z(it);
|
|
2220
2219
|
};
|
|
2221
2220
|
}
|
|
2222
2221
|
function PythonTypeDefinitionEmitter$emit$lambda_1(this$0) {
|
|
2223
2222
|
return function (it) {
|
|
2224
|
-
return Spacer_instance.toString() + this$0.
|
|
2223
|
+
return Spacer_instance.toString() + this$0.mq(it);
|
|
2225
2224
|
};
|
|
2226
2225
|
}
|
|
2227
2226
|
function PythonTypeDefinitionEmitter() {
|
|
@@ -2229,27 +2228,27 @@ function PythonTypeDefinitionEmitter() {
|
|
|
2229
2228
|
function PythonUnionDefinitionEmitter() {
|
|
2230
2229
|
}
|
|
2231
2230
|
//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).
|
|
2231
|
+
protoOf(PythonEmitter).kq = emit_6;
|
|
2232
|
+
protoOf(PythonEmitter).lq = emit_7;
|
|
2233
|
+
protoOf(PythonEmitter).mq = emit_8;
|
|
2234
|
+
protoOf(PythonEmitter).nq = emit_9;
|
|
2235
|
+
protoOf(PythonEmitter).oq = emit_11;
|
|
2236
|
+
protoOf(PythonEmitter).zr = emit_5;
|
|
2237
|
+
protoOf(PythonEmitter).ur = emit_15;
|
|
2238
|
+
protoOf(PythonEmitter).as = emit_12;
|
|
2239
|
+
protoOf(PythonEmitter).pr = emit_4;
|
|
2240
|
+
protoOf(PythonEmitter).nr = emit_3;
|
|
2241
|
+
protoOf(PythonEmitter).or = emit_2;
|
|
2242
|
+
protoOf(PythonEmitter).x1y = emit_10;
|
|
2243
|
+
protoOf(PythonEmitter).e1x = emit_13;
|
|
2244
|
+
protoOf(PythonEmitter).y1y = emit_14;
|
|
2245
|
+
protoOf(PythonEmitter).bs = emitValidator;
|
|
2246
|
+
protoOf(PythonEmitter).r1x = sanitize;
|
|
2247
|
+
protoOf(PythonEmitter).h1x = sanitizeKeywords;
|
|
2248
|
+
protoOf(PythonEmitter).z1y = emitType;
|
|
2249
|
+
protoOf(PythonEmitter).a1z = emitReferenceCustomImports;
|
|
2250
|
+
protoOf(PythonIrEmitter).eo = emit_1;
|
|
2251
|
+
protoOf(PythonIrEmitter).x1v = beforeGenerate;
|
|
2253
2252
|
//endregion
|
|
2254
2253
|
//region block: init
|
|
2255
2254
|
PythonShared_instance = new PythonShared();
|