@flock/wirespec 0.18.6 → 0.18.13
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 +11 -11
- package/arrow-arrow-core.mjs +141 -141
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt.mjs +1395 -1395
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +442 -442
- package/kotlin-kotlin-stdlib.mjs +1051 -943
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +20812 -6818
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1797 -1797
- package/kotlinx-io-kotlinx-io-core.mjs +405 -405
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1960 -1763
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1882 -1407
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1269 -1269
- package/package.json +3 -2
- package/wirespec-lsp.mjs +7 -0
- package/wirespec-src-compiler-core.mjs +1708 -1644
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +444 -409
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +325 -290
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +340 -342
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +370 -372
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +155 -157
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +372 -372
- 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 +3211 -3312
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +399 -399
- package/wirespec-src-converter-avro.mjs +507 -507
- package/wirespec-src-converter-openapi.mjs +1487 -1413
- 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 +175 -175
- package/wirespec-src-plugin-cli.mjs +102 -102
- package/wirespec-src-plugin-npm.d.mts +2 -0
- package/wirespec-src-plugin-npm.mjs +42 -37
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +32 -32
|
@@ -156,7 +156,6 @@ import {
|
|
|
156
156
|
transform3eti8i2bqvifx as transform,
|
|
157
157
|
Elementitq62jg6fid3 as Element,
|
|
158
158
|
Namespace345pal554qu3j as Namespace,
|
|
159
|
-
flattenNestedStructs2956rxx8q2zxl as flattenNestedStructs,
|
|
160
159
|
Union38f3pecvfcpxh as Union_0,
|
|
161
160
|
Struct39wf79cwtn4ty as Struct,
|
|
162
161
|
Custom_init_$Create$2enn7oyj71j1t as Custom_init_$Create$,
|
|
@@ -185,10 +184,10 @@ initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, V
|
|
|
185
184
|
function emit_3(identifier) {
|
|
186
185
|
var tmp;
|
|
187
186
|
if (identifier instanceof DefinitionIdentifier) {
|
|
188
|
-
tmp = this.
|
|
187
|
+
tmp = this.i1w(identifier);
|
|
189
188
|
} else {
|
|
190
189
|
if (identifier instanceof FieldIdentifier) {
|
|
191
|
-
tmp = this.
|
|
190
|
+
tmp = this.y1v(this.i1w(identifier));
|
|
192
191
|
} else {
|
|
193
192
|
noWhenBranchMatchedException();
|
|
194
193
|
}
|
|
@@ -206,7 +205,7 @@ function sanitize(_this__u8e3s4) {
|
|
|
206
205
|
var item = _iterator__ex2g4s.v();
|
|
207
206
|
var _unary__edvuaz = index;
|
|
208
207
|
index = _unary__edvuaz + 1 | 0;
|
|
209
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
208
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.sq(item) : item;
|
|
210
209
|
destination.x(tmp$ret$0);
|
|
211
210
|
}
|
|
212
211
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -244,42 +243,51 @@ function sanitize(_this__u8e3s4) {
|
|
|
244
243
|
return tmp;
|
|
245
244
|
}
|
|
246
245
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
247
|
-
return Companion_getInstance_0().
|
|
246
|
+
return Companion_getInstance_0().r1x_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
248
247
|
}
|
|
249
248
|
initMetadataForInterface(PythonIdentifierEmitter, 'PythonIdentifierEmitter');
|
|
250
|
-
function emit_4(
|
|
249
|
+
function emit_4(enum_0, module_0) {
|
|
250
|
+
var tmp = this.i1w(enum_0.lr_1);
|
|
251
|
+
return trimMargin('\n |class ' + tmp + '(str, Enum):\n |' + joinToString(enum_0.mr_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.vr(2) + 'return self.value\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.vr(2) + 'return self.value\n ');
|
|
252
|
+
}
|
|
253
|
+
initMetadataForInterface(PythonEnumDefinitionEmitter, 'PythonEnumDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
254
|
+
function emit_5(union) {
|
|
255
|
+
return trimMargin('\n |class ' + this.br(union.uo_1) + '(ABC):\n |' + Spacer_instance.toString() + 'pass\n ');
|
|
256
|
+
}
|
|
257
|
+
initMetadataForInterface(PythonUnionDefinitionEmitter, 'PythonUnionDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
258
|
+
function emit_6(type, module_0) {
|
|
251
259
|
var tmp;
|
|
252
|
-
if (type.wo_1.
|
|
253
|
-
var tmp_0 = this.
|
|
260
|
+
if (type.ap_1.wo_1.r()) {
|
|
261
|
+
var tmp_0 = this.br(type.zo_1);
|
|
254
262
|
var tmp_1 = Spacer_instance.toString();
|
|
255
263
|
var tmp_2 = importReferences(type);
|
|
256
264
|
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 ');
|
|
257
265
|
} else {
|
|
258
|
-
var tmp_3 = this.
|
|
259
|
-
var tmp_4 = this.
|
|
266
|
+
var tmp_3 = this.br(type.zo_1);
|
|
267
|
+
var tmp_4 = this.zp(type.ap_1);
|
|
260
268
|
var tmp_5 = importReferences(type);
|
|
261
269
|
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 ');
|
|
262
270
|
}
|
|
263
271
|
return tmp;
|
|
264
272
|
}
|
|
265
|
-
function
|
|
266
|
-
return joinToString(_this__u8e3s4.
|
|
273
|
+
function emit_7(_this__u8e3s4) {
|
|
274
|
+
return joinToString(_this__u8e3s4.wo_1, '\n', VOID, VOID, VOID, VOID, PythonTypeDefinitionEmitter$emit$lambda_1(this));
|
|
267
275
|
}
|
|
268
|
-
function
|
|
269
|
-
return this.
|
|
276
|
+
function emit_8(_this__u8e3s4) {
|
|
277
|
+
return this.br(_this__u8e3s4.ep_1) + ": '" + this.bq(_this__u8e3s4.fp_1) + "'";
|
|
270
278
|
}
|
|
271
|
-
function
|
|
279
|
+
function emit_9(_this__u8e3s4) {
|
|
272
280
|
// Inline function 'kotlin.let' call
|
|
273
|
-
var it = this.
|
|
274
|
-
return _this__u8e3s4.
|
|
281
|
+
var it = this.p1x(_this__u8e3s4);
|
|
282
|
+
return _this__u8e3s4.hu() ? 'Optional[' + it + ']' : it;
|
|
275
283
|
}
|
|
276
284
|
function emitType(_this__u8e3s4) {
|
|
277
285
|
var tmp;
|
|
278
286
|
if (_this__u8e3s4 instanceof Dict) {
|
|
279
|
-
tmp = 'Dict[str, ' + this.
|
|
287
|
+
tmp = 'Dict[str, ' + this.bq(_this__u8e3s4.go_1) + ']';
|
|
280
288
|
} else {
|
|
281
289
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
282
|
-
tmp = 'List[' + this.
|
|
290
|
+
tmp = 'List[' + this.bq(_this__u8e3s4.do_1) + ']';
|
|
283
291
|
} else {
|
|
284
292
|
if (_this__u8e3s4 instanceof Unit) {
|
|
285
293
|
tmp = 'None';
|
|
@@ -288,10 +296,10 @@ function emitType(_this__u8e3s4) {
|
|
|
288
296
|
tmp = 'Any';
|
|
289
297
|
} else {
|
|
290
298
|
if (_this__u8e3s4 instanceof Custom) {
|
|
291
|
-
tmp = _this__u8e3s4.
|
|
299
|
+
tmp = _this__u8e3s4.pu_1;
|
|
292
300
|
} else {
|
|
293
301
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
294
|
-
tmp = this.
|
|
302
|
+
tmp = this.n1x(_this__u8e3s4.tu_1);
|
|
295
303
|
} else {
|
|
296
304
|
noWhenBranchMatchedException();
|
|
297
305
|
}
|
|
@@ -302,7 +310,7 @@ function emitType(_this__u8e3s4) {
|
|
|
302
310
|
}
|
|
303
311
|
return tmp;
|
|
304
312
|
}
|
|
305
|
-
function
|
|
313
|
+
function emit_10(_this__u8e3s4) {
|
|
306
314
|
var tmp;
|
|
307
315
|
if (_this__u8e3s4 instanceof String_0) {
|
|
308
316
|
tmp = 'str';
|
|
@@ -327,13 +335,13 @@ function emit_8(_this__u8e3s4) {
|
|
|
327
335
|
}
|
|
328
336
|
return tmp;
|
|
329
337
|
}
|
|
330
|
-
function
|
|
338
|
+
function emit_11(_this__u8e3s4) {
|
|
331
339
|
var tmp;
|
|
332
340
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
333
|
-
tmp = 'bool(re.match(r"' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.
|
|
341
|
+
tmp = 'bool(re.match(r"' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.dt_1) + '", self.value))';
|
|
334
342
|
} else {
|
|
335
343
|
if (_this__u8e3s4 instanceof Bound) {
|
|
336
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
344
|
+
var tmp1_safe_receiver = _this__u8e3s4.tt_1;
|
|
337
345
|
var tmp_0;
|
|
338
346
|
if (tmp1_safe_receiver == null) {
|
|
339
347
|
tmp_0 = null;
|
|
@@ -342,7 +350,7 @@ function emit_9(_this__u8e3s4) {
|
|
|
342
350
|
tmp_0 = tmp1_safe_receiver + ' < self.value';
|
|
343
351
|
}
|
|
344
352
|
var minCheck = tmp_0;
|
|
345
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
353
|
+
var tmp2_safe_receiver = _this__u8e3s4.ut_1;
|
|
346
354
|
var tmp_1;
|
|
347
355
|
if (tmp2_safe_receiver == null) {
|
|
348
356
|
tmp_1 = null;
|
|
@@ -368,26 +376,26 @@ function emit_9(_this__u8e3s4) {
|
|
|
368
376
|
return tmp;
|
|
369
377
|
}
|
|
370
378
|
function emitReferenceCustomImports(_this__u8e3s4) {
|
|
371
|
-
return 'from ..model.' + _this__u8e3s4.
|
|
379
|
+
return 'from ..model.' + _this__u8e3s4.pu_1 + ' import ' + _this__u8e3s4.pu_1;
|
|
372
380
|
}
|
|
373
381
|
initMetadataForInterface(PythonTypeDefinitionEmitter, 'PythonTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
374
|
-
function
|
|
382
|
+
function emit_12(endpoint) {
|
|
375
383
|
var tmp = importReferences(endpoint);
|
|
376
384
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda(this));
|
|
377
|
-
var tmp_1 = this.
|
|
378
|
-
var tmp_2 = spacer(this.
|
|
379
|
-
var tmp_3 = distinctByStatus(endpoint.
|
|
385
|
+
var tmp_1 = this.br(endpoint.ip_1);
|
|
386
|
+
var tmp_2 = spacer(this.v1v(first(endpoint.np_1), endpoint), 1);
|
|
387
|
+
var tmp_3 = distinctByStatus(endpoint.op_1);
|
|
380
388
|
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 ');
|
|
381
389
|
}
|
|
382
|
-
function
|
|
383
|
-
var tmp = emit_18(this, _this__u8e3s4.
|
|
390
|
+
function emit_13(_this__u8e3s4, endpoint) {
|
|
391
|
+
var tmp = emit_18(this, _this__u8e3s4.rp_1);
|
|
384
392
|
var tmp_0 = get_pathParams(endpoint);
|
|
385
393
|
var tmp_1 = emitObject$default(this, tmp_0, 'Path', 'Wirespec.Request.Path', VOID, PythonEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
386
|
-
var tmp_2 = emitObject$default(this, endpoint.
|
|
387
|
-
var tmp_3 = emitObject$default(this, endpoint.
|
|
394
|
+
var tmp_2 = emitObject$default(this, endpoint.lp_1, 'Queries', 'Wirespec.Request.Queries', VOID, PythonEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
395
|
+
var tmp_3 = emitObject$default(this, endpoint.mp_1, 'Headers', 'Wirespec.Request.Headers', VOID, PythonEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
388
396
|
var tmp_4 = Spacer_instance.toString();
|
|
389
397
|
var tmp_5 = Spacer_instance.toString();
|
|
390
|
-
var tmp_6 = emit_18(this, _this__u8e3s4.
|
|
398
|
+
var tmp_6 = emit_18(this, _this__u8e3s4.rp_1);
|
|
391
399
|
var tmp_7 = Spacer_instance.toString();
|
|
392
400
|
var tmp_8 = Spacer_instance.toString();
|
|
393
401
|
var tmp_9 = Spacer_instance.toString();
|
|
@@ -403,70 +411,61 @@ function emit_11(_this__u8e3s4, endpoint) {
|
|
|
403
411
|
var tmp_19 = Spacer_instance.toString();
|
|
404
412
|
var tmp_20 = Spacer_instance.toString();
|
|
405
413
|
var tmp_21 = Spacer_instance.toString();
|
|
406
|
-
var tmp_22 = emit_18(this, _this__u8e3s4.
|
|
414
|
+
var tmp_22 = emit_18(this, _this__u8e3s4.rp_1);
|
|
407
415
|
var tmp_23 = Spacer_instance.toString();
|
|
408
416
|
var tmp_24 = Spacer_instance.toString();
|
|
409
417
|
var tmp_25 = Spacer_instance.toString();
|
|
410
418
|
var tmp_26 = Spacer_instance.toString();
|
|
411
419
|
var tmp_27 = Spacer_instance.toString();
|
|
412
420
|
var tmp_28 = paramList(_this__u8e3s4, endpoint);
|
|
413
|
-
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.
|
|
421
|
+
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.jp_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 ');
|
|
414
422
|
}
|
|
415
|
-
function
|
|
416
|
-
var tmp = emit_18(this, _this__u8e3s4.
|
|
417
|
-
var tmp_0 = emitObject$default(this, _this__u8e3s4.
|
|
423
|
+
function emit_14(_this__u8e3s4, endpoint) {
|
|
424
|
+
var tmp = emit_18(this, _this__u8e3s4.wp_1);
|
|
425
|
+
var tmp_0 = emitObject$default(this, _this__u8e3s4.vp_1, 'Headers', 'Wirespec.Response.Headers', VOID, PythonEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
418
426
|
var tmp_1 = Spacer_instance.toString();
|
|
419
427
|
var tmp_2 = Spacer_instance.toString();
|
|
420
428
|
var tmp_3 = Spacer_instance.toString();
|
|
421
429
|
var tmp_4 = Spacer_instance.toString();
|
|
422
430
|
var tmp_5 = Spacer_instance.toString();
|
|
423
431
|
var tmp_6 = Spacer_instance.toString();
|
|
424
|
-
var tmp_7 = emit_18(this, _this__u8e3s4.
|
|
432
|
+
var tmp_7 = emit_18(this, _this__u8e3s4.wp_1);
|
|
425
433
|
var tmp_8 = Spacer_instance.toString();
|
|
426
434
|
var tmp_9 = Spacer_instance.toString();
|
|
427
435
|
var tmp_10 = Spacer_instance.toString();
|
|
428
|
-
var tmp_11 = emit_18(this, _this__u8e3s4.
|
|
436
|
+
var tmp_11 = emit_18(this, _this__u8e3s4.wp_1);
|
|
429
437
|
var tmp_12 = Spacer_instance.toString();
|
|
430
438
|
var tmp_13 = Spacer_instance.toString();
|
|
431
439
|
var tmp_14 = Spacer_instance.toString();
|
|
432
440
|
var tmp_15 = paramList_0(_this__u8e3s4);
|
|
433
|
-
return trimMargin('\n |@dataclass\n |class Response' + _this__u8e3s4.
|
|
441
|
+
return trimMargin('\n |@dataclass\n |class Response' + _this__u8e3s4.up_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.up_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 ');
|
|
434
442
|
}
|
|
435
443
|
initMetadataForInterface(PythonEndpointDefinitionEmitter, 'PythonEndpointDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter]);
|
|
436
|
-
function emit_13(union) {
|
|
437
|
-
return trimMargin('\n |class ' + this.wq(union.qo_1) + '(ABC):\n |' + Spacer_instance.toString() + 'pass\n ');
|
|
438
|
-
}
|
|
439
|
-
initMetadataForInterface(PythonUnionDefinitionEmitter, 'PythonUnionDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
440
|
-
function emit_14(enum_0, module_0) {
|
|
441
|
-
var tmp = this.d1w(enum_0.gr_1);
|
|
442
|
-
return trimMargin('\n |class ' + tmp + '(str, Enum):\n |' + joinToString(enum_0.hr_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.qr(2) + 'return self.value\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.qr(2) + 'return self.value\n ');
|
|
443
|
-
}
|
|
444
|
-
initMetadataForInterface(PythonEnumDefinitionEmitter, 'PythonEnumDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
445
444
|
function emit_15(refined) {
|
|
446
|
-
return trimMargin('\n |@dataclass\n |class ' + this.
|
|
445
|
+
return trimMargin('\n |@dataclass\n |class ' + this.i1w(refined.gr_1) + '(Wirespec.Refined):\n |' + Spacer_instance.toString() + 'value: ' + this.p1x(refined.hr_1) + '\n |\n |' + Spacer_instance.toString() + 'def validate(self) -> bool:\n |' + Spacer_instance.vr(2) + 'return ' + this.pr(refined) + '\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.vr(2) + 'return str(self.value)\n |\n ');
|
|
447
446
|
}
|
|
448
447
|
function emitValidator(_this__u8e3s4) {
|
|
449
448
|
var defaultReturn = 'True';
|
|
450
|
-
var type = _this__u8e3s4.
|
|
449
|
+
var type = _this__u8e3s4.hr_1.tu_1;
|
|
451
450
|
var tmp;
|
|
452
451
|
if (type instanceof Integer) {
|
|
453
|
-
var tmp0_safe_receiver = type.
|
|
454
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
452
|
+
var tmp0_safe_receiver = type.yt_1;
|
|
453
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.cq(tmp0_safe_receiver);
|
|
455
454
|
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
456
455
|
} else {
|
|
457
456
|
if (type instanceof Number_0) {
|
|
458
|
-
var tmp2_safe_receiver = type.
|
|
459
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.
|
|
457
|
+
var tmp2_safe_receiver = type.bu_1;
|
|
458
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.cq(tmp2_safe_receiver);
|
|
460
459
|
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
461
460
|
} else {
|
|
462
461
|
if (type instanceof String_0) {
|
|
463
|
-
var tmp4_safe_receiver = type.
|
|
462
|
+
var tmp4_safe_receiver = type.vt_1;
|
|
464
463
|
var tmp_0;
|
|
465
464
|
var tmp_1 = tmp4_safe_receiver;
|
|
466
465
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
467
466
|
tmp_0 = null;
|
|
468
467
|
} else {
|
|
469
|
-
tmp_0 = this.
|
|
468
|
+
tmp_0 = this.cq(new RegExp_0(tmp4_safe_receiver));
|
|
470
469
|
}
|
|
471
470
|
var tmp5_elvis_lhs = tmp_0;
|
|
472
471
|
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
@@ -486,7 +485,7 @@ function emitValidator(_this__u8e3s4) {
|
|
|
486
485
|
return tmp;
|
|
487
486
|
}
|
|
488
487
|
initMetadataForInterface(PythonRefinedTypeDefinitionEmitter, 'PythonRefinedTypeDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
489
|
-
initMetadataForClass(PythonEmitter, 'PythonEmitter', PythonEmitter, LanguageEmitter, [LanguageEmitter,
|
|
488
|
+
initMetadataForClass(PythonEmitter, 'PythonEmitter', PythonEmitter, LanguageEmitter, [LanguageEmitter, PythonChannelDefinitionEmitter, PythonEnumDefinitionEmitter, PythonIdentifierEmitter, PythonUnionDefinitionEmitter, PythonTypeDefinitionEmitter, PythonEndpointDefinitionEmitter, PythonRefinedTypeDefinitionEmitter]);
|
|
490
489
|
initMetadataForCompanion(Companion);
|
|
491
490
|
initMetadataForCompanion(Companion_0);
|
|
492
491
|
initMetadataForClass(sam$kotlin_Comparator$0_0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
|
|
@@ -496,16 +495,16 @@ initMetadataForObject(PythonShared, 'PythonShared');
|
|
|
496
495
|
function PythonChannelDefinitionEmitter() {
|
|
497
496
|
}
|
|
498
497
|
function sam$kotlin_Comparator$0(function_0) {
|
|
499
|
-
this.
|
|
498
|
+
this.d1x_1 = function_0;
|
|
500
499
|
}
|
|
501
|
-
protoOf(sam$kotlin_Comparator$0).
|
|
502
|
-
return this.
|
|
500
|
+
protoOf(sam$kotlin_Comparator$0).td = function (a, b) {
|
|
501
|
+
return this.d1x_1(a, b);
|
|
503
502
|
};
|
|
504
503
|
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
505
|
-
return this.
|
|
504
|
+
return this.td(a, b);
|
|
506
505
|
};
|
|
507
506
|
protoOf(sam$kotlin_Comparator$0).l3 = function () {
|
|
508
|
-
return this.
|
|
507
|
+
return this.d1x_1;
|
|
509
508
|
};
|
|
510
509
|
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
511
510
|
var tmp;
|
|
@@ -528,35 +527,35 @@ protoOf(sam$kotlin_Comparator$0).hashCode = function () {
|
|
|
528
527
|
function PythonEmitter$emit$lambda(this$0) {
|
|
529
528
|
return function (a, b) {
|
|
530
529
|
// Inline function 'kotlin.comparisons.compareValuesBy' call
|
|
531
|
-
var tmp = this$0.
|
|
532
|
-
var tmp$ret$1 = this$0.
|
|
530
|
+
var tmp = this$0.k1x(a);
|
|
531
|
+
var tmp$ret$1 = this$0.k1x(b);
|
|
533
532
|
return compareValues(tmp, tmp$ret$1);
|
|
534
533
|
};
|
|
535
534
|
}
|
|
536
535
|
function emit$emitInit(this$0, def) {
|
|
537
|
-
return 'from .' + this$0.
|
|
536
|
+
return 'from .' + this$0.br(def.ar()) + ' import ' + this$0.br(def.ar());
|
|
538
537
|
}
|
|
539
538
|
function PythonEmitter(packageName, emitShared) {
|
|
540
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
541
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
539
|
+
packageName = packageName === VOID ? Companion_instance.qr('community.flock.wirespec.generated') : packageName;
|
|
540
|
+
emitShared = emitShared === VOID ? Companion_instance_0.ko() : emitShared;
|
|
542
541
|
LanguageEmitter.call(this);
|
|
543
|
-
this.
|
|
544
|
-
this.
|
|
545
|
-
this.
|
|
546
|
-
this.
|
|
547
|
-
this.
|
|
548
|
-
this.
|
|
549
|
-
}
|
|
550
|
-
protoOf(PythonEmitter).
|
|
551
|
-
return this.
|
|
542
|
+
this.e1x_1 = packageName;
|
|
543
|
+
this.f1x_1 = emitShared;
|
|
544
|
+
this.g1x_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';
|
|
545
|
+
this.h1x_1 = FileExtension_Python_getInstance();
|
|
546
|
+
this.i1x_1 = PythonShared_instance;
|
|
547
|
+
this.j1x_1 = '#';
|
|
548
|
+
}
|
|
549
|
+
protoOf(PythonEmitter).iq = function () {
|
|
550
|
+
return this.h1x_1;
|
|
552
551
|
};
|
|
553
|
-
protoOf(PythonEmitter).
|
|
554
|
-
return this.
|
|
552
|
+
protoOf(PythonEmitter).r1v = function () {
|
|
553
|
+
return this.i1x_1;
|
|
555
554
|
};
|
|
556
|
-
protoOf(PythonEmitter).
|
|
557
|
-
return this.
|
|
555
|
+
protoOf(PythonEmitter).jq = function () {
|
|
556
|
+
return this.j1x_1;
|
|
558
557
|
};
|
|
559
|
-
protoOf(PythonEmitter).
|
|
558
|
+
protoOf(PythonEmitter).k1x = function (definition) {
|
|
560
559
|
var tmp;
|
|
561
560
|
if (definition instanceof Enum) {
|
|
562
561
|
tmp = 1;
|
|
@@ -585,21 +584,21 @@ protoOf(PythonEmitter).f1x = function (definition) {
|
|
|
585
584
|
}
|
|
586
585
|
return tmp;
|
|
587
586
|
};
|
|
588
|
-
protoOf(PythonEmitter).
|
|
587
|
+
protoOf(PythonEmitter).yq = function (module_0, logger) {
|
|
589
588
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
590
|
-
var this_0 = new NonEmptyList(module_0.
|
|
589
|
+
var this_0 = new NonEmptyList(module_0.hq_1);
|
|
591
590
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
592
591
|
var tmp = PythonEmitter$emit$lambda(this);
|
|
593
592
|
var tmp$ret$0 = new sam$kotlin_Comparator$0(tmp);
|
|
594
593
|
var tmp$ret$1 = sortedWith(this_0, tmp$ret$0);
|
|
595
594
|
var tmp_0 = toNonEmptyListOrNull(tmp$ret$1);
|
|
596
|
-
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).
|
|
595
|
+
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).cm_1;
|
|
597
596
|
// Inline function 'kotlin.let' call
|
|
598
|
-
var it = protoOf(LanguageEmitter).
|
|
599
|
-
var init = new Emitted(this.
|
|
600
|
-
var tmp_1 = this.
|
|
597
|
+
var it = protoOf(LanguageEmitter).yq.call(this, module_0.av(VOID, statements), logger);
|
|
598
|
+
var init = new Emitted(this.e1x_1.tr() + '__init__', 'from . import model\nfrom . import endpoint\nfrom . import wirespec\n');
|
|
599
|
+
var tmp_1 = this.e1x_1.tr() + 'endpoint/' + '__init__';
|
|
601
600
|
// Inline function 'kotlin.collections.filter' call
|
|
602
|
-
var tmp0 = new NonEmptyList(module_0.
|
|
601
|
+
var tmp0 = new NonEmptyList(module_0.hq_1);
|
|
603
602
|
// Inline function 'kotlin.collections.filterTo' call
|
|
604
603
|
var destination = ArrayList_init_$Create$();
|
|
605
604
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -619,9 +618,9 @@ protoOf(PythonEmitter).tq = function (module_0, logger) {
|
|
|
619
618
|
destination_0.x(tmp$ret$5);
|
|
620
619
|
}
|
|
621
620
|
var initEndpoint = new Emitted(tmp_1, joinToString(destination_0, '\n'));
|
|
622
|
-
var tmp_2 = this.
|
|
621
|
+
var tmp_2 = this.e1x_1.tr() + 'model/' + '__init__';
|
|
623
622
|
// Inline function 'kotlin.collections.filter' call
|
|
624
|
-
var tmp0_0 = new NonEmptyList(module_0.
|
|
623
|
+
var tmp0_0 = new NonEmptyList(module_0.hq_1);
|
|
625
624
|
// Inline function 'kotlin.collections.filterTo' call
|
|
626
625
|
var destination_1 = ArrayList_init_$Create$();
|
|
627
626
|
var _iterator__ex2g4s_1 = tmp0_0.t();
|
|
@@ -641,33 +640,33 @@ protoOf(PythonEmitter).tq = function (module_0, logger) {
|
|
|
641
640
|
destination_2.x(tmp$ret$11);
|
|
642
641
|
}
|
|
643
642
|
var initModel = new Emitted(tmp_2, joinToString(destination_2, '\n'));
|
|
644
|
-
var shared = new Emitted(this.
|
|
645
|
-
return this.
|
|
643
|
+
var shared = new Emitted(this.e1x_1.tr() + 'wirespec', this.r1v().m1x_1);
|
|
644
|
+
return this.f1x_1.lo_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);
|
|
646
645
|
};
|
|
647
|
-
protoOf(PythonEmitter).
|
|
648
|
-
var subPackageName = plus_1(this.
|
|
646
|
+
protoOf(PythonEmitter).zq = function (definition, module_0, logger) {
|
|
647
|
+
var subPackageName = plus_1(this.e1x_1, definition);
|
|
649
648
|
// Inline function 'kotlin.let' call
|
|
650
|
-
var it = protoOf(LanguageEmitter).
|
|
651
|
-
var tmp = subPackageName.
|
|
649
|
+
var it = protoOf(LanguageEmitter).zq.call(this, definition, module_0, logger);
|
|
650
|
+
var tmp = subPackageName.tr() + it.mo_1;
|
|
652
651
|
// Inline function 'kotlin.text.trimStart' call
|
|
653
|
-
var this_0 = trimMargin('\n |' + this.
|
|
652
|
+
var this_0 = trimMargin('\n |' + this.g1x_1 + '\n |' + it.no_1 + '\n ');
|
|
654
653
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
655
654
|
return new Emitted(tmp, tmp$ret$0);
|
|
656
655
|
};
|
|
657
656
|
function emitToRawRequest($this, _this__u8e3s4, endpoint) {
|
|
658
|
-
var tmp = $this.
|
|
657
|
+
var tmp = $this.br(endpoint.ip_1);
|
|
659
658
|
var tmp_0 = Spacer_instance.toString();
|
|
660
659
|
var tmp_1 = Spacer_instance.toString();
|
|
661
660
|
var tmp_2 = Spacer_instance.toString();
|
|
662
|
-
var tmp_3 = joinToString(endpoint.
|
|
661
|
+
var tmp_3 = joinToString(endpoint.kp_1, VOID, VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawRequest$lambda($this));
|
|
663
662
|
var tmp_4 = Spacer_instance.toString();
|
|
664
663
|
var tmp_5 = Spacer_instance.toString();
|
|
665
664
|
var tmp_6 = Spacer_instance.toString();
|
|
666
665
|
var tmp_7 = Spacer_instance.toString();
|
|
667
666
|
var tmp_8;
|
|
668
667
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
669
|
-
if (!endpoint.
|
|
670
|
-
tmp_8 = prependIndent(joinToString(endpoint.
|
|
668
|
+
if (!endpoint.lp_1.r()) {
|
|
669
|
+
tmp_8 = prependIndent(joinToString(endpoint.lp_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawRequest$lambda_0($this)), Spacer_instance.vr(3));
|
|
671
670
|
} else {
|
|
672
671
|
tmp_8 = '';
|
|
673
672
|
}
|
|
@@ -678,8 +677,8 @@ function emitToRawRequest($this, _this__u8e3s4, endpoint) {
|
|
|
678
677
|
var tmp_13 = Spacer_instance.toString();
|
|
679
678
|
var tmp_14;
|
|
680
679
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
681
|
-
if (!endpoint.
|
|
682
|
-
tmp_14 = prependIndent(joinToString(endpoint.
|
|
680
|
+
if (!endpoint.mp_1.r()) {
|
|
681
|
+
tmp_14 = prependIndent(joinToString(endpoint.mp_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawRequest$lambda_1($this)), Spacer_instance.vr(3));
|
|
683
682
|
} else {
|
|
684
683
|
tmp_14 = '';
|
|
685
684
|
}
|
|
@@ -688,48 +687,48 @@ function emitToRawRequest($this, _this__u8e3s4, endpoint) {
|
|
|
688
687
|
var tmp_17 = Spacer_instance.toString();
|
|
689
688
|
var tmp_18 = Spacer_instance.toString();
|
|
690
689
|
var tmp_19 = Spacer_instance.toString();
|
|
691
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
692
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
693
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
690
|
+
var tmp0_safe_receiver = _this__u8e3s4.rp_1;
|
|
691
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.tp_1;
|
|
692
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.p1x(tmp1_safe_receiver);
|
|
694
693
|
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 ');
|
|
695
694
|
}
|
|
696
695
|
function emitFromRawRequest($this, _this__u8e3s4, endpoint) {
|
|
697
|
-
return trimMargin("\n |@staticmethod\n |def from_raw_request(serialization: Wirespec.Deserializer, request: Wirespec.RawRequest) -> '" + $this.
|
|
696
|
+
return trimMargin("\n |@staticmethod\n |def from_raw_request(serialization: Wirespec.Deserializer, request: Wirespec.RawRequest) -> '" + $this.br(endpoint.ip_1) + ".Request':\n |" + Spacer_instance.toString() + 'return ' + $this.br(endpoint.ip_1) + '.Request' + emitDeserializedParams($this, _this__u8e3s4, endpoint) + '\n |\n ');
|
|
698
697
|
}
|
|
699
698
|
function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
700
699
|
var tmp = get_indexedPathParams(endpoint);
|
|
701
700
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
|
|
702
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
703
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
704
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
701
|
+
var tmp_1 = orNull(joinToString(endpoint.lp_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
702
|
+
var tmp_2 = orNull(joinToString(endpoint.mp_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
703
|
+
var tmp0_safe_receiver = _this__u8e3s4.rp_1;
|
|
705
704
|
var tmp_3;
|
|
706
705
|
if (tmp0_safe_receiver == null) {
|
|
707
706
|
tmp_3 = null;
|
|
708
707
|
} else {
|
|
709
708
|
// Inline function 'kotlin.let' call
|
|
710
|
-
tmp_3 = Spacer_instance.
|
|
709
|
+
tmp_3 = Spacer_instance.vr(3) + 'body = serialization.deserialize(request.body, ' + $this.p1x(tmp0_safe_receiver.tp_1) + '),';
|
|
711
710
|
}
|
|
712
711
|
// Inline function 'kotlin.let' call
|
|
713
712
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
714
713
|
return isBlank(it) ? '()' : '(\n' + it + '\n)';
|
|
715
714
|
}
|
|
716
715
|
function emitResponseUnion($this, _this__u8e3s4) {
|
|
717
|
-
return trimMargin('\n |Response = ' + joinToString(_this__u8e3s4.
|
|
716
|
+
return trimMargin('\n |Response = ' + joinToString(_this__u8e3s4.op_1, ' | ', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitResponseUnion$lambda) + '\n |\n ');
|
|
718
717
|
}
|
|
719
718
|
function emitHandleClass($this, _this__u8e3s4) {
|
|
720
|
-
return trimMargin('\n |class Handler(Wirespec.Endpoint.Handler):\n |' + Spacer_instance.toString() + '@abstractmethod\n |' + Spacer_instance.toString() + 'def ' + _this__u8e3s4.
|
|
719
|
+
return trimMargin('\n |class Handler(Wirespec.Endpoint.Handler):\n |' + Spacer_instance.toString() + '@abstractmethod\n |' + Spacer_instance.toString() + 'def ' + _this__u8e3s4.ip_1.l1() + "(self, req: '" + $this.br(_this__u8e3s4.ip_1) + ".Request') -> '" + $this.br(_this__u8e3s4.ip_1) + ".Response': pass\n |\n ");
|
|
721
720
|
}
|
|
722
721
|
function emitConvertClass($this, _this__u8e3s4) {
|
|
723
|
-
return trimMargin('\n |class Convert(Wirespec.Endpoint.Convert[Request, Response]):\n |' + spacer(emitToRawRequest($this, first(_this__u8e3s4.
|
|
722
|
+
return trimMargin('\n |class Convert(Wirespec.Endpoint.Convert[Request, Response]):\n |' + spacer(emitToRawRequest($this, first(_this__u8e3s4.np_1), _this__u8e3s4), 1) + '\n |' + spacer(emitFromRawRequest($this, first(_this__u8e3s4.np_1), _this__u8e3s4), 1) + '\n |' + spacer(emitToRawResponse($this, _this__u8e3s4), 1) + '\n |' + spacer(emitFromRawResponse($this, _this__u8e3s4), 1) + '\n |\n ');
|
|
724
723
|
}
|
|
725
724
|
function emit_16($this, _this__u8e3s4) {
|
|
726
|
-
return $this.
|
|
725
|
+
return $this.br(_this__u8e3s4.nq_1) + ': ' + $this.bq(_this__u8e3s4.oq_1);
|
|
727
726
|
}
|
|
728
727
|
function emitAssignSelf($this, _this__u8e3s4) {
|
|
729
|
-
return $this.
|
|
728
|
+
return $this.br(_this__u8e3s4.nq_1) + ' = ' + $this.br(_this__u8e3s4.nq_1);
|
|
730
729
|
}
|
|
731
730
|
function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
732
|
-
var tmp = $this.
|
|
731
|
+
var tmp = $this.br(endpoint.ip_1);
|
|
733
732
|
// Inline function 'kotlin.collections.filter' call
|
|
734
733
|
var tmp0 = paramList(_this__u8e3s4, endpoint);
|
|
735
734
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -737,13 +736,13 @@ function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
|
737
736
|
var _iterator__ex2g4s = tmp0.t();
|
|
738
737
|
while (_iterator__ex2g4s.u()) {
|
|
739
738
|
var element = _iterator__ex2g4s.v();
|
|
740
|
-
if (element.
|
|
739
|
+
if (element.mq_1.equals(ParamType_PATH_getInstance())) {
|
|
741
740
|
destination.x(element);
|
|
742
741
|
}
|
|
743
742
|
}
|
|
744
743
|
var tmp_0 = destination;
|
|
745
744
|
var tmp_1 = joinToString(tmp_0, VOID, VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda($this));
|
|
746
|
-
var tmp_2 = $this.
|
|
745
|
+
var tmp_2 = $this.br(endpoint.ip_1);
|
|
747
746
|
// Inline function 'kotlin.collections.filter' call
|
|
748
747
|
var tmp0_0 = paramList(_this__u8e3s4, endpoint);
|
|
749
748
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -751,13 +750,13 @@ function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
|
751
750
|
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
752
751
|
while (_iterator__ex2g4s_0.u()) {
|
|
753
752
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
754
|
-
if (element_0.
|
|
753
|
+
if (element_0.mq_1.equals(ParamType_QUERY_getInstance())) {
|
|
755
754
|
destination_0.x(element_0);
|
|
756
755
|
}
|
|
757
756
|
}
|
|
758
757
|
var tmp_3 = destination_0;
|
|
759
758
|
var tmp_4 = spacer(joinToString(tmp_3, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_0($this)), 1);
|
|
760
|
-
var tmp_5 = $this.
|
|
759
|
+
var tmp_5 = $this.br(endpoint.ip_1);
|
|
761
760
|
// Inline function 'kotlin.collections.filter' call
|
|
762
761
|
var tmp0_1 = paramList(_this__u8e3s4, endpoint);
|
|
763
762
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -765,14 +764,14 @@ function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
|
765
764
|
var _iterator__ex2g4s_1 = tmp0_1.t();
|
|
766
765
|
while (_iterator__ex2g4s_1.u()) {
|
|
767
766
|
var element_1 = _iterator__ex2g4s_1.v();
|
|
768
|
-
if (element_1.
|
|
767
|
+
if (element_1.mq_1.equals(ParamType_HEADER_getInstance())) {
|
|
769
768
|
destination_1.x(element_1);
|
|
770
769
|
}
|
|
771
770
|
}
|
|
772
771
|
var tmp_6 = destination_1;
|
|
773
772
|
var tmp_7 = spacer(joinToString(tmp_6, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_1($this)), 1);
|
|
774
773
|
var tmp_8;
|
|
775
|
-
if (_this__u8e3s4.
|
|
774
|
+
if (_this__u8e3s4.rp_1 == null) {
|
|
776
775
|
tmp_8 = null;
|
|
777
776
|
} else {
|
|
778
777
|
// Inline function 'kotlin.let' call
|
|
@@ -782,7 +781,7 @@ function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
|
782
781
|
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 ');
|
|
783
782
|
}
|
|
784
783
|
function emitAssignSelf_1($this, _this__u8e3s4, endpoint) {
|
|
785
|
-
var tmp = $this.
|
|
784
|
+
var tmp = $this.br(endpoint.ip_1);
|
|
786
785
|
// Inline function 'kotlin.collections.filter' call
|
|
787
786
|
var tmp0 = paramList_0(_this__u8e3s4);
|
|
788
787
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -790,35 +789,35 @@ function emitAssignSelf_1($this, _this__u8e3s4, endpoint) {
|
|
|
790
789
|
var _iterator__ex2g4s = tmp0.t();
|
|
791
790
|
while (_iterator__ex2g4s.u()) {
|
|
792
791
|
var element = _iterator__ex2g4s.v();
|
|
793
|
-
if (element.
|
|
792
|
+
if (element.mq_1.equals(ParamType_HEADER_getInstance())) {
|
|
794
793
|
destination.x(element);
|
|
795
794
|
}
|
|
796
795
|
}
|
|
797
796
|
var tmp_0 = destination;
|
|
798
797
|
var tmp_1 = spacer(joinToString(tmp_0, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_2($this)), 1);
|
|
799
798
|
var tmp_2;
|
|
800
|
-
if (_this__u8e3s4.
|
|
799
|
+
if (_this__u8e3s4.wp_1 == null) {
|
|
801
800
|
tmp_2 = null;
|
|
802
801
|
} else {
|
|
803
802
|
// Inline function 'kotlin.let' call
|
|
804
803
|
tmp_2 = 'body';
|
|
805
804
|
}
|
|
806
805
|
var tmp1_elvis_lhs = tmp_2;
|
|
807
|
-
return trimMargin('\n |self._headers = ' + tmp + '.Response' + _this__u8e3s4.
|
|
806
|
+
return trimMargin('\n |self._headers = ' + tmp + '.Response' + _this__u8e3s4.up_1 + '.Headers(' + tmp_1 + ')\n |self._body = ' + (tmp1_elvis_lhs == null ? 'None' : tmp1_elvis_lhs) + '\n ');
|
|
808
807
|
}
|
|
809
808
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
810
|
-
return Spacer_instance.
|
|
809
|
+
return Spacer_instance.vr(3) + $this.br(_this__u8e3s4.pe_1.pp_1) + ' = serialization.deserialize(request.path[' + _this__u8e3s4.oe_1 + '], ' + $this.p1x(_this__u8e3s4.pe_1.qp_1) + ')';
|
|
811
810
|
}
|
|
812
811
|
function emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive) {
|
|
813
812
|
var tmp;
|
|
814
813
|
if (caseSensitive) {
|
|
815
|
-
tmp = Spacer_instance.
|
|
814
|
+
tmp = Spacer_instance.vr(spaces) + $this.br(_this__u8e3s4.ep_1) + ' = serialization.deserialize_param(' + type + '.' + fields + '.get("' + _this__u8e3s4.ep_1.l1() + '"), ' + $this.p1x(_this__u8e3s4.fp_1) + ')';
|
|
816
815
|
} else {
|
|
817
|
-
var tmp_0 = Spacer_instance.
|
|
818
|
-
var tmp_1 = $this.
|
|
816
|
+
var tmp_0 = Spacer_instance.vr(spaces);
|
|
817
|
+
var tmp_1 = $this.br(_this__u8e3s4.ep_1);
|
|
819
818
|
// Inline function 'kotlin.text.lowercase' call
|
|
820
819
|
// Inline function 'kotlin.js.asDynamic' call
|
|
821
|
-
tmp = tmp_0 + tmp_1 + ' = serialization.deserialize_param(next((v for k, v in ' + type + '.' + fields + '.items() if k.lower() == "' + _this__u8e3s4.
|
|
820
|
+
tmp = tmp_0 + tmp_1 + ' = serialization.deserialize_param(next((v for k, v in ' + type + '.' + fields + '.items() if k.lower() == "' + _this__u8e3s4.ep_1.l1().toLowerCase() + '"), None), ' + $this.p1x(_this__u8e3s4.fp_1) + ')';
|
|
822
821
|
}
|
|
823
822
|
return tmp;
|
|
824
823
|
}
|
|
@@ -828,73 +827,73 @@ function emitDeserializedParams$default($this, _this__u8e3s4, type, fields, spac
|
|
|
828
827
|
return emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive);
|
|
829
828
|
}
|
|
830
829
|
function emitToRawResponse($this, _this__u8e3s4) {
|
|
831
|
-
var tmp = $this.
|
|
830
|
+
var tmp = $this.br(_this__u8e3s4.ip_1);
|
|
832
831
|
var tmp_0 = Spacer_instance.toString();
|
|
833
|
-
var tmp_1 = distinctByStatus(_this__u8e3s4.
|
|
832
|
+
var tmp_1 = distinctByStatus(_this__u8e3s4.op_1);
|
|
834
833
|
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 ');
|
|
835
834
|
}
|
|
836
835
|
function emitFromRawResponse($this, _this__u8e3s4) {
|
|
837
|
-
var tmp = $this.
|
|
836
|
+
var tmp = $this.br(_this__u8e3s4.ip_1);
|
|
838
837
|
var tmp_0 = Spacer_instance.toString();
|
|
839
838
|
// Inline function 'kotlin.collections.filter' call
|
|
840
|
-
var tmp0 = distinctByStatus(_this__u8e3s4.
|
|
839
|
+
var tmp0 = distinctByStatus(_this__u8e3s4.op_1);
|
|
841
840
|
// Inline function 'kotlin.collections.filterTo' call
|
|
842
841
|
var destination = ArrayList_init_$Create$();
|
|
843
842
|
var _iterator__ex2g4s = tmp0.t();
|
|
844
843
|
while (_iterator__ex2g4s.u()) {
|
|
845
844
|
var element = _iterator__ex2g4s.v();
|
|
846
|
-
if (Companion_instance_1.
|
|
845
|
+
if (Companion_instance_1.wq(element.up_1)) {
|
|
847
846
|
destination.x(element);
|
|
848
847
|
}
|
|
849
848
|
}
|
|
850
849
|
var tmp_1 = destination;
|
|
851
|
-
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.
|
|
850
|
+
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.vr(2) + 'case _:\n |' + Spacer_instance.vr(3) + 'raise Exception("Cannot match response with status: " + str(response.status_code))\n |\n ');
|
|
852
851
|
}
|
|
853
852
|
function emitDeserialized_0($this, _this__u8e3s4, endpoint) {
|
|
854
|
-
var tmp = 'case ' + _this__u8e3s4.
|
|
855
|
-
var tmp_0 = Spacer_instance.toString() + 'return ' + $this.
|
|
856
|
-
var tmp_1 = Spacer_instance.
|
|
857
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
858
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
859
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
853
|
+
var tmp = 'case ' + _this__u8e3s4.up_1 + ':';
|
|
854
|
+
var tmp_0 = Spacer_instance.toString() + 'return ' + $this.br(endpoint.ip_1) + '.Response' + _this__u8e3s4.up_1 + '(';
|
|
855
|
+
var tmp_1 = Spacer_instance.vr(2);
|
|
856
|
+
var tmp0_safe_receiver = _this__u8e3s4.wp_1;
|
|
857
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.tp_1;
|
|
858
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.p1x(tmp1_safe_receiver);
|
|
860
859
|
var tmp_2 = tmp_1 + 'body = serialization.deserialize(response.body, ' + (tmp2_elvis_lhs == null ? 'type(None)' : tmp2_elvis_lhs) + '),';
|
|
861
|
-
return joinToString(listOfNotNull([tmp, tmp_0, tmp_2, orNull(joinToString(_this__u8e3s4.
|
|
860
|
+
return joinToString(listOfNotNull([tmp, tmp_0, tmp_2, orNull(joinToString(_this__u8e3s4.vp_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserialized$lambda($this))), Spacer_instance.toString() + ')']), '\n');
|
|
862
861
|
}
|
|
863
862
|
function emitSerialized($this, _this__u8e3s4, endpoint) {
|
|
864
|
-
var tmp = $this.
|
|
865
|
-
var tmp_0 = Spacer_instance.
|
|
866
|
-
var tmp_1 = Spacer_instance.
|
|
867
|
-
var tmp_2 = Spacer_instance.
|
|
863
|
+
var tmp = $this.br(endpoint.ip_1);
|
|
864
|
+
var tmp_0 = Spacer_instance.vr(1);
|
|
865
|
+
var tmp_1 = Spacer_instance.vr(2);
|
|
866
|
+
var tmp_2 = Spacer_instance.vr(2);
|
|
868
867
|
var tmp_3;
|
|
869
868
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
870
|
-
if (!_this__u8e3s4.
|
|
871
|
-
tmp_3 = joinToString(_this__u8e3s4.
|
|
869
|
+
if (!_this__u8e3s4.vp_1.r()) {
|
|
870
|
+
tmp_3 = joinToString(_this__u8e3s4.vp_1, ', ', '{', '}', VOID, VOID, PythonEndpointDefinitionEmitter$emitSerialized$lambda($this));
|
|
872
871
|
} else {
|
|
873
872
|
tmp_3 = '{}';
|
|
874
873
|
}
|
|
875
874
|
var tmp_4 = tmp_3;
|
|
876
|
-
var tmp_5 = Spacer_instance.
|
|
877
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
875
|
+
var tmp_5 = Spacer_instance.vr(2);
|
|
876
|
+
var tmp0_safe_receiver = _this__u8e3s4.wp_1;
|
|
878
877
|
var tmp_6;
|
|
879
878
|
if (tmp0_safe_receiver == null) {
|
|
880
879
|
tmp_6 = null;
|
|
881
880
|
} else {
|
|
882
881
|
// Inline function 'kotlin.let' call
|
|
883
|
-
tmp_6 = 'serialization.serialize(response.body, ' + $this.
|
|
882
|
+
tmp_6 = 'serialization.serialize(response.body, ' + $this.p1x(tmp0_safe_receiver.tp_1) + ')';
|
|
884
883
|
}
|
|
885
884
|
var tmp1_elvis_lhs = tmp_6;
|
|
886
|
-
return trimMargin('\n |case ' + tmp + '.Response' + _this__u8e3s4.
|
|
885
|
+
return trimMargin('\n |case ' + tmp + '.Response' + _this__u8e3s4.up_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.vr(1) + ')\n ');
|
|
887
886
|
}
|
|
888
887
|
function emitSerializedParams($this, _this__u8e3s4, type, fields) {
|
|
889
|
-
return '"' + _this__u8e3s4.
|
|
888
|
+
return '"' + _this__u8e3s4.ep_1.l1() + '": serialization.serialize_param(' + type + '.' + fields + '.' + $this.br(_this__u8e3s4.ep_1) + ', ' + $this.p1x(_this__u8e3s4.fp_1) + ')';
|
|
890
889
|
}
|
|
891
890
|
function emitObject($this, _this__u8e3s4, name, extends_0, spaces, block) {
|
|
892
891
|
var tmp;
|
|
893
892
|
if (_this__u8e3s4.r()) {
|
|
894
|
-
tmp = trimMargin('\n |' + Spacer_instance.
|
|
893
|
+
tmp = trimMargin('\n |' + Spacer_instance.vr(spaces) + '@dataclass\n |' + Spacer_instance.vr(spaces) + 'class ' + name + ' (' + extends_0 + '): pass\n ');
|
|
895
894
|
} else {
|
|
896
|
-
var tmp_0 = Spacer_instance.
|
|
897
|
-
var tmp_1 = Spacer_instance.
|
|
895
|
+
var tmp_0 = Spacer_instance.vr(spaces);
|
|
896
|
+
var tmp_1 = Spacer_instance.vr(spaces);
|
|
898
897
|
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 ');
|
|
899
898
|
}
|
|
900
899
|
return tmp;
|
|
@@ -904,21 +903,21 @@ function emitObject$default($this, _this__u8e3s4, name, extends_0, spaces, block
|
|
|
904
903
|
return emitObject($this, _this__u8e3s4, name, extends_0, spaces, block);
|
|
905
904
|
}
|
|
906
905
|
function emit_17($this, _this__u8e3s4) {
|
|
907
|
-
return $this.
|
|
906
|
+
return $this.br(_this__u8e3s4.pp_1) + ': ' + $this.bq(_this__u8e3s4.qp_1);
|
|
908
907
|
}
|
|
909
908
|
function emit_18($this, _this__u8e3s4) {
|
|
910
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
911
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
909
|
+
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.tp_1;
|
|
910
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.bq(tmp1_safe_receiver);
|
|
912
911
|
return tmp2_elvis_lhs == null ? 'None' : tmp2_elvis_lhs;
|
|
913
912
|
}
|
|
914
913
|
function PythonEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
915
914
|
return function (it) {
|
|
916
|
-
return this$0.
|
|
915
|
+
return this$0.q1x(it);
|
|
917
916
|
};
|
|
918
917
|
}
|
|
919
918
|
function PythonEndpointDefinitionEmitter$emit$lambda_0(this$0, $endpoint) {
|
|
920
919
|
return function (it) {
|
|
921
|
-
return this$0.
|
|
920
|
+
return this$0.o1x(it, $endpoint);
|
|
922
921
|
};
|
|
923
922
|
}
|
|
924
923
|
function PythonEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
@@ -928,12 +927,12 @@ function PythonEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
|
928
927
|
}
|
|
929
928
|
function PythonEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
930
929
|
return function (it) {
|
|
931
|
-
return this$0.
|
|
930
|
+
return this$0.aq(it);
|
|
932
931
|
};
|
|
933
932
|
}
|
|
934
933
|
function PythonEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
935
934
|
return function (it) {
|
|
936
|
-
return this$0.
|
|
935
|
+
return this$0.aq(it);
|
|
937
936
|
};
|
|
938
937
|
}
|
|
939
938
|
function PythonEndpointDefinitionEmitter$emit$lambda_4(this$0) {
|
|
@@ -945,10 +944,10 @@ function PythonEndpointDefinitionEmitter$emitToRawRequest$lambda(this$0) {
|
|
|
945
944
|
return function (it) {
|
|
946
945
|
var tmp;
|
|
947
946
|
if (it instanceof Literal) {
|
|
948
|
-
tmp = '"' + it.
|
|
947
|
+
tmp = '"' + it.lq_1 + '"';
|
|
949
948
|
} else {
|
|
950
949
|
if (it instanceof Param) {
|
|
951
|
-
tmp = 'str(request.path.' + this$0.
|
|
950
|
+
tmp = 'str(request.path.' + this$0.br(it.pp_1) + ')';
|
|
952
951
|
} else {
|
|
953
952
|
noWhenBranchMatchedException();
|
|
954
953
|
}
|
|
@@ -982,7 +981,7 @@ function PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda_1(this$0)
|
|
|
982
981
|
};
|
|
983
982
|
}
|
|
984
983
|
function PythonEndpointDefinitionEmitter$emitResponseUnion$lambda(it) {
|
|
985
|
-
return 'Response' + it.
|
|
984
|
+
return 'Response' + it.up_1;
|
|
986
985
|
}
|
|
987
986
|
function PythonEndpointDefinitionEmitter$emitAssignSelf$lambda(this$0) {
|
|
988
987
|
return function (it) {
|
|
@@ -1006,7 +1005,7 @@ function PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_2(this$0) {
|
|
|
1006
1005
|
}
|
|
1007
1006
|
function PythonEndpointDefinitionEmitter$emit$lambda_5(this$0) {
|
|
1008
1007
|
return function (it) {
|
|
1009
|
-
return this$0.
|
|
1008
|
+
return this$0.aq(it);
|
|
1010
1009
|
};
|
|
1011
1010
|
}
|
|
1012
1011
|
function PythonEndpointDefinitionEmitter$emit$lambda_6(this$0) {
|
|
@@ -1036,7 +1035,7 @@ function PythonEndpointDefinitionEmitter$emitSerialized$lambda(this$0) {
|
|
|
1036
1035
|
}
|
|
1037
1036
|
function PythonEndpointDefinitionEmitter$emitObject$lambda($spaces, $block) {
|
|
1038
1037
|
return function (it) {
|
|
1039
|
-
return Spacer_instance.
|
|
1038
|
+
return Spacer_instance.vr($spaces + 2 | 0) + $block(it);
|
|
1040
1039
|
};
|
|
1041
1040
|
}
|
|
1042
1041
|
function PythonEndpointDefinitionEmitter() {
|
|
@@ -1065,14 +1064,14 @@ function sanitizeEnum($this, _this__u8e3s4) {
|
|
|
1065
1064
|
}
|
|
1066
1065
|
function PythonEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
1067
1066
|
return function (it) {
|
|
1068
|
-
return Spacer_instance.toString() + this$0.
|
|
1067
|
+
return Spacer_instance.toString() + this$0.y1v(sanitizeEnum(this$0, it)) + ' = "' + it + '"';
|
|
1069
1068
|
};
|
|
1070
1069
|
}
|
|
1071
1070
|
function PythonEnumDefinitionEmitter() {
|
|
1072
1071
|
}
|
|
1073
1072
|
function Companion() {
|
|
1074
1073
|
Companion_instance_2 = this;
|
|
1075
|
-
this.
|
|
1074
|
+
this.r1x_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']);
|
|
1076
1075
|
}
|
|
1077
1076
|
var Companion_instance_2;
|
|
1078
1077
|
function Companion_getInstance_0() {
|
|
@@ -1083,7 +1082,7 @@ function Companion_getInstance_0() {
|
|
|
1083
1082
|
function PythonIdentifierEmitter() {
|
|
1084
1083
|
}
|
|
1085
1084
|
function _get_sanitizationConfig__sns434($this) {
|
|
1086
|
-
var tmp0 = $this.
|
|
1085
|
+
var tmp0 = $this.w1x_1;
|
|
1087
1086
|
var tmp = KProperty1;
|
|
1088
1087
|
// Inline function 'kotlin.getValue' call
|
|
1089
1088
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, PythonIrEmitter$_get_sanitizationConfig_$ref_1q5eai(), null);
|
|
@@ -1100,7 +1099,7 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
1100
1099
|
var item = _iterator__ex2g4s.v();
|
|
1101
1100
|
var _unary__edvuaz = index;
|
|
1102
1101
|
index = _unary__edvuaz + 1 | 0;
|
|
1103
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
1102
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.sq(item) : item;
|
|
1104
1103
|
destination.x(tmp$ret$0);
|
|
1105
1104
|
}
|
|
1106
1105
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1146,7 +1145,7 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
1146
1145
|
return tmp_2;
|
|
1147
1146
|
}
|
|
1148
1147
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1149
|
-
return Companion_getInstance_1().
|
|
1148
|
+
return Companion_getInstance_1().y1x_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1150
1149
|
}
|
|
1151
1150
|
function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
1152
1151
|
// Inline function 'kotlin.let' call
|
|
@@ -1172,7 +1171,7 @@ function buildImports($this, wirespecPath) {
|
|
|
1172
1171
|
}
|
|
1173
1172
|
function Companion_0() {
|
|
1174
1173
|
Companion_instance_3 = this;
|
|
1175
|
-
this.
|
|
1174
|
+
this.y1x_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']);
|
|
1176
1175
|
}
|
|
1177
1176
|
var Companion_instance_3;
|
|
1178
1177
|
function Companion_getInstance_1() {
|
|
@@ -1181,16 +1180,16 @@ function Companion_getInstance_1() {
|
|
|
1181
1180
|
return Companion_instance_3;
|
|
1182
1181
|
}
|
|
1183
1182
|
function sam$kotlin_Comparator$0_0(function_0) {
|
|
1184
|
-
this.
|
|
1183
|
+
this.z1x_1 = function_0;
|
|
1185
1184
|
}
|
|
1186
|
-
protoOf(sam$kotlin_Comparator$0_0).
|
|
1187
|
-
return this.
|
|
1185
|
+
protoOf(sam$kotlin_Comparator$0_0).td = function (a, b) {
|
|
1186
|
+
return this.z1x_1(a, b);
|
|
1188
1187
|
};
|
|
1189
1188
|
protoOf(sam$kotlin_Comparator$0_0).compare = function (a, b) {
|
|
1190
|
-
return this.
|
|
1189
|
+
return this.td(a, b);
|
|
1191
1190
|
};
|
|
1192
1191
|
protoOf(sam$kotlin_Comparator$0_0).l3 = function () {
|
|
1193
|
-
return this.
|
|
1192
|
+
return this.z1x_1;
|
|
1194
1193
|
};
|
|
1195
1194
|
protoOf(sam$kotlin_Comparator$0_0).equals = function (other) {
|
|
1196
1195
|
var tmp;
|
|
@@ -1214,11 +1213,11 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
1214
1213
|
return '_' + it;
|
|
1215
1214
|
}
|
|
1216
1215
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(name) {
|
|
1217
|
-
var sanitized = name.
|
|
1216
|
+
var sanitized = name.l1h_1.a1() > 1 ? name.x1l() : name.x1h();
|
|
1218
1217
|
return new Name(listOf_0(sanitized));
|
|
1219
1218
|
}
|
|
1220
1219
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(name) {
|
|
1221
|
-
return new Name(listOf_0(name.
|
|
1220
|
+
return new Name(listOf_0(name.x1l()));
|
|
1222
1221
|
}
|
|
1223
1222
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(it) {
|
|
1224
1223
|
return it;
|
|
@@ -1227,9 +1226,9 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1227
1226
|
return function (stmt, tr) {
|
|
1228
1227
|
var tmp;
|
|
1229
1228
|
if (stmt instanceof ConstructorStatement) {
|
|
1230
|
-
var tmp_0 = tr.
|
|
1229
|
+
var tmp_0 = tr.u1t(stmt.u1m_1);
|
|
1231
1230
|
// Inline function 'kotlin.collections.map' call
|
|
1232
|
-
var this_0 = stmt.
|
|
1231
|
+
var this_0 = stmt.v1m_1;
|
|
1233
1232
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1234
1233
|
var destination = ArrayList_init_$Create$_0(this_0.a1());
|
|
1235
1234
|
// Inline function 'kotlin.collections.iterator' call
|
|
@@ -1240,7 +1239,7 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1240
1239
|
var k = item.k1();
|
|
1241
1240
|
// Inline function 'kotlin.collections.component2' call
|
|
1242
1241
|
var v = item.l1();
|
|
1243
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.
|
|
1242
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.x1t(v));
|
|
1244
1243
|
destination.x(tmp$ret$3);
|
|
1245
1244
|
}
|
|
1246
1245
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
@@ -1252,7 +1251,7 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1252
1251
|
}
|
|
1253
1252
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1254
1253
|
return function () {
|
|
1255
|
-
var tmp = Companion_getInstance_1().
|
|
1254
|
+
var tmp = Companion_getInstance_1().y1x_1;
|
|
1256
1255
|
var tmp_0 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1257
1256
|
var tmp_1 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0;
|
|
1258
1257
|
var tmp_2 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1;
|
|
@@ -1272,7 +1271,7 @@ function PythonIrEmitter$emit$lambda(a, b) {
|
|
|
1272
1271
|
return compareValues(tmp, tmp$ret$1);
|
|
1273
1272
|
}
|
|
1274
1273
|
function emit$emitInitImport(this$0, def) {
|
|
1275
|
-
return import_0('.' + sanitize_0(this$0, def.
|
|
1274
|
+
return import_0('.' + sanitize_0(this$0, def.ar()), sanitize_0(this$0, def.ar()));
|
|
1276
1275
|
}
|
|
1277
1276
|
function PythonIrEmitter$emit$lambda_0(this$0) {
|
|
1278
1277
|
return function (it) {
|
|
@@ -1281,43 +1280,43 @@ function PythonIrEmitter$emit$lambda_0(this$0) {
|
|
|
1281
1280
|
}
|
|
1282
1281
|
function PythonIrEmitter(packageName, emitShared) {
|
|
1283
1282
|
Companion_getInstance_1();
|
|
1284
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
1285
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
1286
|
-
this.
|
|
1287
|
-
this.
|
|
1288
|
-
this.
|
|
1289
|
-
this.
|
|
1283
|
+
packageName = packageName === VOID ? Companion_instance.qr('community.flock.wirespec.generated') : packageName;
|
|
1284
|
+
emitShared = emitShared === VOID ? Companion_instance_0.ko() : emitShared;
|
|
1285
|
+
this.s1x_1 = packageName;
|
|
1286
|
+
this.t1x_1 = emitShared;
|
|
1287
|
+
this.u1x_1 = PythonGenerator_instance;
|
|
1288
|
+
this.v1x_1 = FileExtension_Python_getInstance();
|
|
1290
1289
|
var tmp = this;
|
|
1291
|
-
tmp.
|
|
1292
|
-
this.
|
|
1290
|
+
tmp.w1x_1 = lazy(PythonIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1291
|
+
this.x1x_1 = "from __future__ import annotations\n\nimport enum\nfrom abc import ABC, abstractmethod\nfrom dataclasses import dataclass\nfrom typing import Any, Generic, Optional, Type, TypeVar\n\nT = TypeVar('T')\n\n\ndef _raise(msg: str) -> Any:\n raise Exception(msg)\n\n";
|
|
1293
1292
|
}
|
|
1294
|
-
protoOf(PythonIrEmitter).
|
|
1295
|
-
return this.
|
|
1293
|
+
protoOf(PythonIrEmitter).p1u = function () {
|
|
1294
|
+
return this.u1x_1;
|
|
1296
1295
|
};
|
|
1297
|
-
protoOf(PythonIrEmitter).
|
|
1298
|
-
return this.
|
|
1296
|
+
protoOf(PythonIrEmitter).iq = function () {
|
|
1297
|
+
return this.v1x_1;
|
|
1299
1298
|
};
|
|
1300
|
-
protoOf(PythonIrEmitter).
|
|
1301
|
-
var source = convert(Companion_instance.
|
|
1299
|
+
protoOf(PythonIrEmitter).s1u = function () {
|
|
1300
|
+
var source = convert(Companion_instance.qr('shared'));
|
|
1302
1301
|
var tmp;
|
|
1303
|
-
if (this.
|
|
1304
|
-
tmp = new File(Companion_getInstance().
|
|
1302
|
+
if (this.t1x_1.lo_1) {
|
|
1303
|
+
tmp = new File(Companion_getInstance().k1h(this.s1x_1.tr() + 'wirespec'), listOf_0(raw(this.x1x_1 + PythonGenerator_instance.q1u(source))));
|
|
1305
1304
|
} else {
|
|
1306
1305
|
tmp = null;
|
|
1307
1306
|
}
|
|
1308
1307
|
return tmp;
|
|
1309
1308
|
};
|
|
1310
|
-
protoOf(PythonIrEmitter).
|
|
1309
|
+
protoOf(PythonIrEmitter).r1u = function (module_0, logger) {
|
|
1311
1310
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
1312
|
-
var this_0 = new NonEmptyList(module_0.
|
|
1311
|
+
var this_0 = new NonEmptyList(module_0.hq_1);
|
|
1313
1312
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
1314
1313
|
var tmp = PythonIrEmitter$emit$lambda;
|
|
1315
1314
|
var tmp$ret$0 = new sam$kotlin_Comparator$0_0(tmp);
|
|
1316
1315
|
var tmp$ret$1 = sortedWith(this_0, tmp$ret$0);
|
|
1317
1316
|
var tmp_0 = toNonEmptyListOrNull(tmp$ret$1);
|
|
1318
|
-
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).
|
|
1319
|
-
var emitted = emit.call(this, module_0.
|
|
1320
|
-
var tmp0 = new NonEmptyList(module_0.
|
|
1317
|
+
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).cm_1;
|
|
1318
|
+
var emitted = emit.call(this, module_0.av(VOID, statements), logger);
|
|
1319
|
+
var tmp0 = new NonEmptyList(module_0.hq_1);
|
|
1321
1320
|
var tmp$ret$2;
|
|
1322
1321
|
$l$block_0: {
|
|
1323
1322
|
// Inline function 'kotlin.collections.any' call
|
|
@@ -1342,7 +1341,7 @@ protoOf(PythonIrEmitter).m1u = function (module_0, logger) {
|
|
|
1342
1341
|
tmp$ret$2 = false;
|
|
1343
1342
|
}
|
|
1344
1343
|
var hasEndpoints = tmp$ret$2;
|
|
1345
|
-
var tmp_2 = Companion_getInstance().
|
|
1344
|
+
var tmp_2 = Companion_getInstance().k1h(this.s1x_1.tr() + '__init__');
|
|
1346
1345
|
// Inline function 'kotlin.collections.buildList' call
|
|
1347
1346
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1348
1347
|
// Inline function 'kotlin.apply' call
|
|
@@ -1355,9 +1354,9 @@ protoOf(PythonIrEmitter).m1u = function (module_0, logger) {
|
|
|
1355
1354
|
this_1.x(import_0('.', 'wirespec'));
|
|
1356
1355
|
var tmp$ret$7 = this_1.o5();
|
|
1357
1356
|
var init = new File(tmp_2, tmp$ret$7);
|
|
1358
|
-
var tmp_3 = Companion_getInstance().
|
|
1357
|
+
var tmp_3 = Companion_getInstance().k1h(this.s1x_1.tr() + 'endpoint/' + '__init__');
|
|
1359
1358
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1360
|
-
var tmp0_0 = new NonEmptyList(module_0.
|
|
1359
|
+
var tmp0_0 = new NonEmptyList(module_0.hq_1);
|
|
1361
1360
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1362
1361
|
var destination = ArrayList_init_$Create$();
|
|
1363
1362
|
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
@@ -1377,9 +1376,9 @@ protoOf(PythonIrEmitter).m1u = function (module_0, logger) {
|
|
|
1377
1376
|
destination_0.x(tmp$ret$10);
|
|
1378
1377
|
}
|
|
1379
1378
|
var initEndpoint = new File(tmp_3, destination_0);
|
|
1380
|
-
var tmp_4 = Companion_getInstance().
|
|
1379
|
+
var tmp_4 = Companion_getInstance().k1h(this.s1x_1.tr() + 'model/' + '__init__');
|
|
1381
1380
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1382
|
-
var tmp0_1 = new NonEmptyList(module_0.
|
|
1381
|
+
var tmp0_1 = new NonEmptyList(module_0.hq_1);
|
|
1383
1382
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1384
1383
|
var destination_1 = ArrayList_init_$Create$();
|
|
1385
1384
|
var _iterator__ex2g4s_2 = tmp0_1.t();
|
|
@@ -1399,8 +1398,8 @@ protoOf(PythonIrEmitter).m1u = function (module_0, logger) {
|
|
|
1399
1398
|
destination_2.x(tmp$ret$15);
|
|
1400
1399
|
}
|
|
1401
1400
|
var initModel = new File(tmp_4, destination_2);
|
|
1402
|
-
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().
|
|
1403
|
-
var tmp0_2 = dropLast(split(this.
|
|
1401
|
+
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().k1h(this.s1x_1.tr() + 'client/' + '__init__'), emptyList())) : emptyList();
|
|
1402
|
+
var tmp0_2 = dropLast(split(this.s1x_1.rr_1, ['.']), 1);
|
|
1404
1403
|
var tmp$ret$18;
|
|
1405
1404
|
$l$block_1: {
|
|
1406
1405
|
// Inline function 'kotlin.collections.runningFold' call
|
|
@@ -1437,17 +1436,17 @@ protoOf(PythonIrEmitter).m1u = function (module_0, logger) {
|
|
|
1437
1436
|
var _iterator__ex2g4s_5 = this_3.t();
|
|
1438
1437
|
while (_iterator__ex2g4s_5.u()) {
|
|
1439
1438
|
var item_1 = _iterator__ex2g4s_5.v();
|
|
1440
|
-
var tmp$ret$23 = new File(Companion_getInstance().
|
|
1439
|
+
var tmp$ret$23 = new File(Companion_getInstance().k1h(item_1 + '/__init__'), emptyList());
|
|
1441
1440
|
destination_3.x(tmp$ret$23);
|
|
1442
1441
|
}
|
|
1443
1442
|
var parentInits = destination_3;
|
|
1444
|
-
return this.
|
|
1443
|
+
return this.t1x_1.lo_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);
|
|
1445
1444
|
};
|
|
1446
|
-
protoOf(PythonIrEmitter).
|
|
1445
|
+
protoOf(PythonIrEmitter).zq = function (definition, module_0, logger) {
|
|
1447
1446
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1448
|
-
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.
|
|
1447
|
+
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.s1x_1, definition);
|
|
1449
1448
|
};
|
|
1450
|
-
protoOf(PythonIrEmitter).
|
|
1449
|
+
protoOf(PythonIrEmitter).yp = function (type, module_0) {
|
|
1451
1450
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1452
1451
|
var this_0 = importReferences(type);
|
|
1453
1452
|
var set = HashSet_init_$Create$();
|
|
@@ -1455,7 +1454,7 @@ protoOf(PythonIrEmitter).up = function (type, module_0) {
|
|
|
1455
1454
|
var _iterator__ex2g4s = this_0.t();
|
|
1456
1455
|
while (_iterator__ex2g4s.u()) {
|
|
1457
1456
|
var e = _iterator__ex2g4s.v();
|
|
1458
|
-
var key = e.
|
|
1457
|
+
var key = e.pu_1;
|
|
1459
1458
|
if (set.x(key)) {
|
|
1460
1459
|
list.x(e);
|
|
1461
1460
|
}
|
|
@@ -1466,18 +1465,18 @@ protoOf(PythonIrEmitter).up = function (type, module_0) {
|
|
|
1466
1465
|
var _iterator__ex2g4s_0 = list.t();
|
|
1467
1466
|
while (_iterator__ex2g4s_0.u()) {
|
|
1468
1467
|
var item = _iterator__ex2g4s_0.v();
|
|
1469
|
-
var tmp$ret$2 = import_0('.' + item.
|
|
1468
|
+
var tmp$ret$2 = import_0('.' + item.pu_1, item.pu_1);
|
|
1470
1469
|
destination.x(tmp$ret$2);
|
|
1471
1470
|
}
|
|
1472
1471
|
var typeImports = destination;
|
|
1473
1472
|
// Inline function 'kotlin.collections.map' call
|
|
1474
|
-
var this_1 = type.wo_1
|
|
1473
|
+
var this_1 = type.ap_1.wo_1;
|
|
1475
1474
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1476
1475
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1477
1476
|
var _iterator__ex2g4s_1 = this_1.t();
|
|
1478
1477
|
while (_iterator__ex2g4s_1.u()) {
|
|
1479
1478
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
1480
|
-
var tmp$ret$5 = item_0.
|
|
1479
|
+
var tmp$ret$5 = item_0.ep_1.l1();
|
|
1481
1480
|
destination_0.x(tmp$ret$5);
|
|
1482
1481
|
}
|
|
1483
1482
|
var fieldNames = toSet(destination_0);
|
|
@@ -1493,17 +1492,17 @@ protoOf(PythonIrEmitter).up = function (type, module_0) {
|
|
|
1493
1492
|
var tmp$ret$10 = tmp_0;
|
|
1494
1493
|
return prependImports(tmp, tmp$ret$10);
|
|
1495
1494
|
};
|
|
1496
|
-
protoOf(PythonIrEmitter).
|
|
1495
|
+
protoOf(PythonIrEmitter).nr = function (enum_0, module_0) {
|
|
1497
1496
|
var tmp = convert_0(enum_0);
|
|
1498
1497
|
return sanitizeNames(sanitizeEnumEntries(tmp, PythonIrEmitter$emit$lambda_0(this)), _get_sanitizationConfig__sns434(this));
|
|
1499
1498
|
};
|
|
1500
|
-
protoOf(PythonIrEmitter).
|
|
1499
|
+
protoOf(PythonIrEmitter).dr = function (union) {
|
|
1501
1500
|
return sanitizeNames(convert_1(union), _get_sanitizationConfig__sns434(this));
|
|
1502
1501
|
};
|
|
1503
|
-
protoOf(PythonIrEmitter).
|
|
1502
|
+
protoOf(PythonIrEmitter).ir = function (refined) {
|
|
1504
1503
|
return sanitizeNames(replaceRefinedFunctions(convert_2(refined), refined), _get_sanitizationConfig__sns434(this));
|
|
1505
1504
|
};
|
|
1506
|
-
protoOf(PythonIrEmitter).
|
|
1505
|
+
protoOf(PythonIrEmitter).or = function (endpoint) {
|
|
1507
1506
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1508
1507
|
var this_0 = importReferences(endpoint);
|
|
1509
1508
|
var set = HashSet_init_$Create$();
|
|
@@ -1511,7 +1510,7 @@ protoOf(PythonIrEmitter).jr = function (endpoint) {
|
|
|
1511
1510
|
var _iterator__ex2g4s = this_0.t();
|
|
1512
1511
|
while (_iterator__ex2g4s.u()) {
|
|
1513
1512
|
var e = _iterator__ex2g4s.v();
|
|
1514
|
-
var key = e.
|
|
1513
|
+
var key = e.pu_1;
|
|
1515
1514
|
if (set.x(key)) {
|
|
1516
1515
|
list.x(e);
|
|
1517
1516
|
}
|
|
@@ -1522,19 +1521,19 @@ protoOf(PythonIrEmitter).jr = function (endpoint) {
|
|
|
1522
1521
|
var _iterator__ex2g4s_0 = list.t();
|
|
1523
1522
|
while (_iterator__ex2g4s_0.u()) {
|
|
1524
1523
|
var item = _iterator__ex2g4s_0.v();
|
|
1525
|
-
var tmp$ret$2 = import_0('..model.' + item.
|
|
1524
|
+
var tmp$ret$2 = import_0('..model.' + item.pu_1, item.pu_1);
|
|
1526
1525
|
destination.x(tmp$ret$2);
|
|
1527
1526
|
}
|
|
1528
1527
|
var endpointImports = destination;
|
|
1529
1528
|
// Inline function 'kotlin.let' call
|
|
1530
1529
|
var it = splitEndpointStructsToModuleLevel(convert_3(endpoint));
|
|
1531
|
-
var tmp$ret$6 = it.
|
|
1530
|
+
var tmp$ret$6 = it.b1n(VOID, plus(endpointImports, it.y1m_1));
|
|
1532
1531
|
return sanitizeNames(snakeCaseHandlerAndCallMethods(tmp$ret$6), _get_sanitizationConfig__sns434(this));
|
|
1533
1532
|
};
|
|
1534
|
-
protoOf(PythonIrEmitter).
|
|
1533
|
+
protoOf(PythonIrEmitter).cr = function (channel) {
|
|
1535
1534
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1536
1535
|
};
|
|
1537
|
-
protoOf(PythonIrEmitter).
|
|
1536
|
+
protoOf(PythonIrEmitter).u1u = function (endpoint) {
|
|
1538
1537
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1539
1538
|
var this_0 = importReferences(endpoint);
|
|
1540
1539
|
var set = HashSet_init_$Create$();
|
|
@@ -1542,7 +1541,7 @@ protoOf(PythonIrEmitter).p1u = function (endpoint) {
|
|
|
1542
1541
|
var _iterator__ex2g4s = this_0.t();
|
|
1543
1542
|
while (_iterator__ex2g4s.u()) {
|
|
1544
1543
|
var e = _iterator__ex2g4s.v();
|
|
1545
|
-
var key = e.
|
|
1544
|
+
var key = e.pu_1;
|
|
1546
1545
|
if (set.x(key)) {
|
|
1547
1546
|
list.x(e);
|
|
1548
1547
|
}
|
|
@@ -1553,17 +1552,17 @@ protoOf(PythonIrEmitter).p1u = function (endpoint) {
|
|
|
1553
1552
|
var _iterator__ex2g4s_0 = list.t();
|
|
1554
1553
|
while (_iterator__ex2g4s_0.u()) {
|
|
1555
1554
|
var item = _iterator__ex2g4s_0.v();
|
|
1556
|
-
var tmp$ret$2 = import_0('..model.' + item.
|
|
1555
|
+
var tmp$ret$2 = import_0('..model.' + item.pu_1, item.pu_1);
|
|
1557
1556
|
destination.x(tmp$ret$2);
|
|
1558
1557
|
}
|
|
1559
1558
|
var modelImports = destination;
|
|
1560
|
-
var endpointImport = import_0('..endpoint.' + endpoint.
|
|
1561
|
-
var endpointName = endpoint.
|
|
1559
|
+
var endpointImport = import_0('..endpoint.' + endpoint.ip_1.l1(), '*');
|
|
1560
|
+
var endpointName = endpoint.ip_1.l1();
|
|
1562
1561
|
var file = flattenEndpointTypeRefs(snakeCaseClientFunctions(addSelfReceiverToClientFields(sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this)))), endpointName);
|
|
1563
|
-
var subPackageName = plus_2(this.
|
|
1564
|
-
return new File(Companion_getInstance().
|
|
1562
|
+
var subPackageName = plus_2(this.s1x_1, 'client');
|
|
1563
|
+
return new File(Companion_getInstance().k1h(subPackageName.tr() + file.x1m_1.m1h()), plus(plus(plus(buildImports(this, '..wirespec'), modelImports), listOf_0(endpointImport)), file.y1m_1));
|
|
1565
1564
|
};
|
|
1566
|
-
protoOf(PythonIrEmitter).
|
|
1565
|
+
protoOf(PythonIrEmitter).t1u = function (endpoints, logger) {
|
|
1567
1566
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1568
1567
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1569
1568
|
var destination = ArrayList_init_$Create$();
|
|
@@ -1579,7 +1578,7 @@ protoOf(PythonIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1579
1578
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1580
1579
|
while (_iterator__ex2g4s_0.u()) {
|
|
1581
1580
|
var e = _iterator__ex2g4s_0.v();
|
|
1582
|
-
var key = e.
|
|
1581
|
+
var key = e.pu_1;
|
|
1583
1582
|
if (set.x(key)) {
|
|
1584
1583
|
list_0.x(e);
|
|
1585
1584
|
}
|
|
@@ -1590,7 +1589,7 @@ protoOf(PythonIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1590
1589
|
var _iterator__ex2g4s_1 = list_0.t();
|
|
1591
1590
|
while (_iterator__ex2g4s_1.u()) {
|
|
1592
1591
|
var item = _iterator__ex2g4s_1.v();
|
|
1593
|
-
var tmp$ret$5 = import_0('.model.' + item.
|
|
1592
|
+
var tmp$ret$5 = import_0('.model.' + item.pu_1, item.pu_1);
|
|
1594
1593
|
destination_0.x(tmp$ret$5);
|
|
1595
1594
|
}
|
|
1596
1595
|
var modelImports = destination_0;
|
|
@@ -1600,7 +1599,7 @@ protoOf(PythonIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1600
1599
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1601
1600
|
while (_iterator__ex2g4s_2.u()) {
|
|
1602
1601
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
1603
|
-
var tmp$ret$8 = import_0('.endpoint.' + item_0.
|
|
1602
|
+
var tmp$ret$8 = import_0('.endpoint.' + item_0.ip_1.l1(), '*');
|
|
1604
1603
|
destination_1.x(tmp$ret$8);
|
|
1605
1604
|
}
|
|
1606
1605
|
var endpointImports = destination_1;
|
|
@@ -1610,7 +1609,7 @@ protoOf(PythonIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1610
1609
|
var _iterator__ex2g4s_3 = endpoints.t();
|
|
1611
1610
|
while (_iterator__ex2g4s_3.u()) {
|
|
1612
1611
|
var item_1 = _iterator__ex2g4s_3.v();
|
|
1613
|
-
var tmp$ret$11 = import_0('.client.' + item_1.
|
|
1612
|
+
var tmp$ret$11 = import_0('.client.' + item_1.ip_1.l1() + 'Client', item_1.ip_1.l1() + 'Client');
|
|
1614
1613
|
destination_2.x(tmp$ret$11);
|
|
1615
1614
|
}
|
|
1616
1615
|
var clientImports = destination_2;
|
|
@@ -1621,7 +1620,7 @@ protoOf(PythonIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1621
1620
|
var _iterator__ex2g4s_4 = endpoints.t();
|
|
1622
1621
|
while (_iterator__ex2g4s_4.u()) {
|
|
1623
1622
|
var item_2 = _iterator__ex2g4s_4.v();
|
|
1624
|
-
var tmp$ret$14 = item_2.
|
|
1623
|
+
var tmp$ret$14 = item_2.ip_1.l1();
|
|
1625
1624
|
destination_3.x(tmp$ret$14);
|
|
1626
1625
|
}
|
|
1627
1626
|
var endpointNames = destination_3;
|
|
@@ -1635,7 +1634,7 @@ protoOf(PythonIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1635
1634
|
accumulator = flattenEndpointTypeRefs(acc, element_0);
|
|
1636
1635
|
}
|
|
1637
1636
|
var file = accumulator;
|
|
1638
|
-
return new File(Companion_getInstance().
|
|
1637
|
+
return new File(Companion_getInstance().k1h(this.s1x_1.tr() + file.x1m_1.m1h()), plus(plus(buildImports(this, '.wirespec'), allImports), file.y1m_1));
|
|
1639
1638
|
};
|
|
1640
1639
|
function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
1641
1640
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -1643,14 +1642,14 @@ function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
|
1643
1642
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1644
1643
|
var tmp = scope;
|
|
1645
1644
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1646
|
-
var this_0 = scope.
|
|
1645
|
+
var this_0 = scope.c1u_1;
|
|
1647
1646
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1648
1647
|
// Inline function 'kotlin.apply' call
|
|
1649
1648
|
var this_1 = new TransformerBuilder();
|
|
1650
|
-
this_1.
|
|
1651
|
-
var tmp$ret$2 = this_1.
|
|
1652
|
-
tmp.
|
|
1653
|
-
var tmp_0 = scope.
|
|
1649
|
+
this_1.h1h(replaceRefinedFunctions$lambda(refined));
|
|
1650
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1651
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1652
|
+
var tmp_0 = scope.c1u_1;
|
|
1654
1653
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1655
1654
|
}
|
|
1656
1655
|
function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
@@ -1659,20 +1658,20 @@ function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
|
1659
1658
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1660
1659
|
var tmp = scope;
|
|
1661
1660
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1662
|
-
var this_0 = scope.
|
|
1661
|
+
var this_0 = scope.c1u_1;
|
|
1663
1662
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1664
1663
|
// Inline function 'kotlin.apply' call
|
|
1665
1664
|
var this_1 = new TransformerBuilder();
|
|
1666
|
-
this_1.
|
|
1667
|
-
var tmp$ret$2 = this_1.
|
|
1668
|
-
tmp.
|
|
1669
|
-
var tmp_0 = scope.
|
|
1665
|
+
this_1.h1h(snakeCaseHandlerAndCallMethods$lambda);
|
|
1666
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1667
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1668
|
+
var tmp_0 = scope.c1u_1;
|
|
1670
1669
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1671
1670
|
}
|
|
1672
1671
|
function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
1673
1672
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1674
1673
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1675
|
-
var tmp0 = _this__u8e3s4.
|
|
1674
|
+
var tmp0 = _this__u8e3s4.z1m();
|
|
1676
1675
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1677
1676
|
var destination = ArrayList_init_$Create$();
|
|
1678
1677
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1684,9 +1683,8 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1684
1683
|
}
|
|
1685
1684
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1686
1685
|
var namespace = ensureNotNull(tmp$ret$2);
|
|
1687
|
-
var flattened = flattenNestedStructs(namespace);
|
|
1688
1686
|
// Inline function 'kotlin.collections.partition' call
|
|
1689
|
-
var this_0 =
|
|
1687
|
+
var this_0 = namespace.e1n_1;
|
|
1690
1688
|
var first = ArrayList_init_$Create$();
|
|
1691
1689
|
var second = ArrayList_init_$Create$();
|
|
1692
1690
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
@@ -1705,16 +1703,16 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1705
1703
|
}
|
|
1706
1704
|
}
|
|
1707
1705
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1708
|
-
var moduleElements = _destruct__k2r9zo.
|
|
1709
|
-
var classElements = _destruct__k2r9zo.
|
|
1710
|
-
var endpointClass = new Namespace(namespace.
|
|
1711
|
-
return new File(namespace.
|
|
1706
|
+
var moduleElements = _destruct__k2r9zo.qe();
|
|
1707
|
+
var classElements = _destruct__k2r9zo.re();
|
|
1708
|
+
var endpointClass = new Namespace(namespace.d1n_1, classElements, namespace.f1n_1);
|
|
1709
|
+
return new File(namespace.d1n_1, plus_0(moduleElements, endpointClass));
|
|
1712
1710
|
}
|
|
1713
1711
|
function flattenEndpointTypeRefs(_this__u8e3s4, endpointName) {
|
|
1714
1712
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1715
1713
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1716
|
-
scope.
|
|
1717
|
-
var tmp = scope.
|
|
1714
|
+
scope.i1u(flattenEndpointTypeRefs$lambda(endpointName));
|
|
1715
|
+
var tmp = scope.c1u_1;
|
|
1718
1716
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1719
1717
|
}
|
|
1720
1718
|
function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
@@ -1723,15 +1721,15 @@ function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
|
1723
1721
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1724
1722
|
var tmp = scope;
|
|
1725
1723
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1726
|
-
var this_0 = scope.
|
|
1724
|
+
var this_0 = scope.c1u_1;
|
|
1727
1725
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1728
1726
|
// Inline function 'kotlin.apply' call
|
|
1729
1727
|
var this_1 = new TransformerBuilder();
|
|
1730
|
-
this_1.
|
|
1731
|
-
var tmp$ret$2 = this_1.
|
|
1732
|
-
tmp.
|
|
1733
|
-
scope.
|
|
1734
|
-
var tmp_0 = scope.
|
|
1728
|
+
this_1.h1h(snakeCaseClientFunctions$lambda);
|
|
1729
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1730
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1731
|
+
scope.l1u(snakeCaseClientFunctions$lambda_0);
|
|
1732
|
+
var tmp_0 = scope.c1u_1;
|
|
1735
1733
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1736
1734
|
}
|
|
1737
1735
|
function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
@@ -1742,7 +1740,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1742
1740
|
} else {
|
|
1743
1741
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1744
1742
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1745
|
-
var tmp0 = tmp0_safe_receiver.
|
|
1743
|
+
var tmp0 = tmp0_safe_receiver.z1m();
|
|
1746
1744
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1747
1745
|
var destination = ArrayList_init_$Create$();
|
|
1748
1746
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1755,7 +1753,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1755
1753
|
tmp = firstOrNull_0(destination);
|
|
1756
1754
|
}
|
|
1757
1755
|
var struct = tmp;
|
|
1758
|
-
var tmp2_safe_receiver = struct == null ? null : struct.
|
|
1756
|
+
var tmp2_safe_receiver = struct == null ? null : struct.j1n_1;
|
|
1759
1757
|
var tmp_0;
|
|
1760
1758
|
if (tmp2_safe_receiver == null) {
|
|
1761
1759
|
tmp_0 = null;
|
|
@@ -1766,7 +1764,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1766
1764
|
var _iterator__ex2g4s_0 = tmp2_safe_receiver.t();
|
|
1767
1765
|
while (_iterator__ex2g4s_0.u()) {
|
|
1768
1766
|
var item = _iterator__ex2g4s_0.v();
|
|
1769
|
-
var tmp$ret$3 = item.
|
|
1767
|
+
var tmp$ret$3 = item.e1q_1.x1h();
|
|
1770
1768
|
destination_0.x(tmp$ret$3);
|
|
1771
1769
|
}
|
|
1772
1770
|
tmp_0 = destination_0;
|
|
@@ -1778,23 +1776,23 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1778
1776
|
return _this__u8e3s4;
|
|
1779
1777
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1780
1778
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1781
|
-
scope.
|
|
1782
|
-
var tmp_1 = scope.
|
|
1779
|
+
scope.l1u(addSelfReceiverToClientFields$lambda(fieldNames));
|
|
1780
|
+
var tmp_1 = scope.c1u_1;
|
|
1783
1781
|
return isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1784
1782
|
}
|
|
1785
1783
|
function replaceRefinedFunctions$lambda$lambda($constraintExpr) {
|
|
1786
1784
|
return function ($this$function) {
|
|
1787
|
-
$this$function.
|
|
1788
|
-
$this$function.
|
|
1789
|
-
$this$function.
|
|
1785
|
+
$this$function.q1i('self', Custom_init_$Create$(''));
|
|
1786
|
+
$this$function.p1i(Boolean_instance_0);
|
|
1787
|
+
$this$function.o1k($constraintExpr);
|
|
1790
1788
|
return Unit_instance;
|
|
1791
1789
|
};
|
|
1792
1790
|
}
|
|
1793
1791
|
function replaceRefinedFunctions$lambda$lambda_0($toStringExpr) {
|
|
1794
1792
|
return function ($this$function) {
|
|
1795
|
-
$this$function.
|
|
1796
|
-
$this$function.
|
|
1797
|
-
$this$function.
|
|
1793
|
+
$this$function.q1i('self', Custom_init_$Create$(''));
|
|
1794
|
+
$this$function.p1i(String_instance);
|
|
1795
|
+
$this$function.o1k(new RawExpression($toStringExpr));
|
|
1798
1796
|
return Unit_instance;
|
|
1799
1797
|
};
|
|
1800
1798
|
}
|
|
@@ -1803,7 +1801,7 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
1803
1801
|
var tmp;
|
|
1804
1802
|
if (element instanceof Struct) {
|
|
1805
1803
|
// Inline function 'kotlin.collections.mapNotNull' call
|
|
1806
|
-
var tmp0 = element.
|
|
1804
|
+
var tmp0 = element.m1n_1;
|
|
1807
1805
|
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
1808
1806
|
var destination = ArrayList_init_$Create$();
|
|
1809
1807
|
// Inline function 'kotlin.collections.forEach' call
|
|
@@ -1813,23 +1811,23 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
1813
1811
|
var tmp_0;
|
|
1814
1812
|
var tmp_1;
|
|
1815
1813
|
if (element_0 instanceof Function) {
|
|
1816
|
-
tmp_1 = element_0.
|
|
1814
|
+
tmp_1 = element_0.y1j_1.equals(Companion_getInstance().k1h('validate'));
|
|
1817
1815
|
} else {
|
|
1818
1816
|
tmp_1 = false;
|
|
1819
1817
|
}
|
|
1820
1818
|
if (tmp_1) {
|
|
1821
|
-
var constraintExpr = convertConstraint($refined.
|
|
1819
|
+
var constraintExpr = convertConstraint($refined.hr_1, new FieldCall(new VariableReference(Companion_getInstance().k1h('self')), Companion_getInstance().k1h('value')));
|
|
1822
1820
|
tmp_0 = function_0('validate', VOID, VOID, replaceRefinedFunctions$lambda$lambda(constraintExpr));
|
|
1823
1821
|
} else {
|
|
1824
1822
|
var tmp_2;
|
|
1825
1823
|
if (element_0 instanceof Function) {
|
|
1826
|
-
tmp_2 = element_0.
|
|
1824
|
+
tmp_2 = element_0.y1j_1.equals(Companion_getInstance().k1h('toString'));
|
|
1827
1825
|
} else {
|
|
1828
1826
|
tmp_2 = false;
|
|
1829
1827
|
}
|
|
1830
1828
|
if (tmp_2) {
|
|
1831
1829
|
var tmp_3;
|
|
1832
|
-
if ($refined.
|
|
1830
|
+
if ($refined.hr_1.tu_1 instanceof String_0) {
|
|
1833
1831
|
tmp_3 = 'self.value';
|
|
1834
1832
|
} else {
|
|
1835
1833
|
tmp_3 = 'str(self.value)';
|
|
@@ -1848,7 +1846,7 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
1848
1846
|
destination.x(tmp0_safe_receiver);
|
|
1849
1847
|
}
|
|
1850
1848
|
}
|
|
1851
|
-
tmp = element.
|
|
1849
|
+
tmp = element.o1n(VOID, VOID, VOID, VOID, destination);
|
|
1852
1850
|
} else {
|
|
1853
1851
|
tmp = element;
|
|
1854
1852
|
}
|
|
@@ -1861,23 +1859,23 @@ function snakeCaseHandlerAndCallMethods$lambda(element, transformer) {
|
|
|
1861
1859
|
if (element instanceof Interface) {
|
|
1862
1860
|
var tmp$ret$0;
|
|
1863
1861
|
$l$block: {
|
|
1864
|
-
if (!element.
|
|
1862
|
+
if (!element.q1n_1.equals(Companion_getInstance().k1h('Handler')) && !element.q1n_1.equals(Companion_getInstance().k1h('Call'))) {
|
|
1865
1863
|
tmp$ret$0 = element;
|
|
1866
1864
|
break $l$block;
|
|
1867
1865
|
}
|
|
1868
1866
|
// Inline function 'kotlin.collections.map' call
|
|
1869
|
-
var this_0 = element.
|
|
1867
|
+
var this_0 = element.r1n_1;
|
|
1870
1868
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1871
1869
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1872
1870
|
var _iterator__ex2g4s = this_0.t();
|
|
1873
1871
|
while (_iterator__ex2g4s.u()) {
|
|
1874
1872
|
var item = _iterator__ex2g4s.v();
|
|
1875
1873
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
1876
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1874
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.g1k(Companion_getInstance().k1h(item.y1j_1.d1m()));
|
|
1877
1875
|
var tmp$ret$1 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
1878
1876
|
destination.x(tmp$ret$1);
|
|
1879
1877
|
}
|
|
1880
|
-
tmp$ret$0 = element.
|
|
1878
|
+
tmp$ret$0 = element.x1n(VOID, destination);
|
|
1881
1879
|
}
|
|
1882
1880
|
tmp = tmp$ret$0;
|
|
1883
1881
|
} else {
|
|
@@ -1892,17 +1890,17 @@ function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
|
1892
1890
|
if (!(type instanceof Custom_0)) {
|
|
1893
1891
|
tmp = type;
|
|
1894
1892
|
} else {
|
|
1895
|
-
if (!startsWith(type.
|
|
1893
|
+
if (!startsWith(type.v1h_1.m1h(), $endpointName + '.')) {
|
|
1896
1894
|
tmp = type;
|
|
1897
1895
|
} else {
|
|
1898
|
-
var suffix = removePrefix(type.
|
|
1896
|
+
var suffix = removePrefix(type.v1h_1.m1h(), $endpointName + '.');
|
|
1899
1897
|
switch (suffix) {
|
|
1900
1898
|
case 'Call':
|
|
1901
1899
|
case 'Handler':
|
|
1902
1900
|
tmp = type;
|
|
1903
1901
|
break;
|
|
1904
1902
|
default:
|
|
1905
|
-
tmp = type.
|
|
1903
|
+
tmp = type.s1m(Companion_getInstance().k1h(suffix));
|
|
1906
1904
|
break;
|
|
1907
1905
|
}
|
|
1908
1906
|
}
|
|
@@ -1913,7 +1911,7 @@ function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
|
1913
1911
|
function snakeCaseClientFunctions$lambda(element, transformer) {
|
|
1914
1912
|
var tmp;
|
|
1915
1913
|
if (element instanceof Function) {
|
|
1916
|
-
tmp = element.
|
|
1914
|
+
tmp = element.g1k(Companion_getInstance().k1h(element.y1j_1.d1m()), VOID, plus(listOf_0(new Parameter(Companion_getInstance().k1h('self'), Custom_init_$Create$(''))), element.a1k_1));
|
|
1917
1915
|
} else {
|
|
1918
1916
|
tmp = element;
|
|
1919
1917
|
}
|
|
@@ -1923,19 +1921,19 @@ function snakeCaseClientFunctions$lambda(element, transformer) {
|
|
|
1923
1921
|
function snakeCaseClientFunctions$lambda_0(stmt, tr) {
|
|
1924
1922
|
var tmp;
|
|
1925
1923
|
if (stmt instanceof FunctionCall) {
|
|
1926
|
-
var nameStr = stmt.
|
|
1927
|
-
var newName = contains(nameStr, '.') ? stmt.
|
|
1928
|
-
var tmp1_safe_receiver = stmt.
|
|
1924
|
+
var nameStr = stmt.g1m_1.x1h();
|
|
1925
|
+
var newName = contains(nameStr, '.') ? stmt.g1m_1 : Companion_getInstance().k1h(Companion_getInstance().k1h(nameStr).d1m());
|
|
1926
|
+
var tmp1_safe_receiver = stmt.e1m_1;
|
|
1929
1927
|
var tmp_0;
|
|
1930
1928
|
if (tmp1_safe_receiver == null) {
|
|
1931
1929
|
tmp_0 = null;
|
|
1932
1930
|
} else {
|
|
1933
1931
|
// Inline function 'kotlin.let' call
|
|
1934
|
-
tmp_0 = tr.
|
|
1932
|
+
tmp_0 = tr.x1t(tmp1_safe_receiver);
|
|
1935
1933
|
}
|
|
1936
1934
|
var tmp2_receiver = tmp_0;
|
|
1937
1935
|
// Inline function 'kotlin.collections.mapValues' call
|
|
1938
|
-
var this_0 = stmt.
|
|
1936
|
+
var this_0 = stmt.h1m_1;
|
|
1939
1937
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
1940
1938
|
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.a1()));
|
|
1941
1939
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
@@ -1945,10 +1943,10 @@ function snakeCaseClientFunctions$lambda_0(stmt, tr) {
|
|
|
1945
1943
|
var tmp_1 = element.k1();
|
|
1946
1944
|
// Inline function 'kotlin.collections.component2' call
|
|
1947
1945
|
var v = element.l1();
|
|
1948
|
-
var tmp$ret$4 = tr.
|
|
1949
|
-
destination.
|
|
1946
|
+
var tmp$ret$4 = tr.x1t(v);
|
|
1947
|
+
destination.s2(tmp_1, tmp$ret$4);
|
|
1950
1948
|
}
|
|
1951
|
-
var tmp4_isAwait = !(stmt.
|
|
1949
|
+
var tmp4_isAwait = !(stmt.e1m_1 == null);
|
|
1952
1950
|
tmp = new FunctionCall(tmp2_receiver, VOID, newName, destination, tmp4_isAwait);
|
|
1953
1951
|
} else {
|
|
1954
1952
|
tmp = transformChildren(stmt, tr);
|
|
@@ -1961,28 +1959,28 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
1961
1959
|
var tmp_0;
|
|
1962
1960
|
var tmp_1;
|
|
1963
1961
|
if (stmt instanceof FieldCall) {
|
|
1964
|
-
tmp_1 = stmt.
|
|
1962
|
+
tmp_1 = stmt.o1p_1 == null;
|
|
1965
1963
|
} else {
|
|
1966
1964
|
tmp_1 = false;
|
|
1967
1965
|
}
|
|
1968
1966
|
if (tmp_1) {
|
|
1969
|
-
tmp_0 = $fieldNames.u1(stmt.
|
|
1967
|
+
tmp_0 = $fieldNames.u1(stmt.p1p_1.x1h());
|
|
1970
1968
|
} else {
|
|
1971
1969
|
tmp_0 = false;
|
|
1972
1970
|
}
|
|
1973
1971
|
if (tmp_0) {
|
|
1974
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().
|
|
1972
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().k1h('self')), stmt.p1p_1);
|
|
1975
1973
|
} else {
|
|
1976
1974
|
if (stmt instanceof FieldCall) {
|
|
1977
|
-
var tmp0_safe_receiver = stmt.
|
|
1975
|
+
var tmp0_safe_receiver = stmt.o1p_1;
|
|
1978
1976
|
var tmp_2;
|
|
1979
1977
|
if (tmp0_safe_receiver == null) {
|
|
1980
1978
|
tmp_2 = null;
|
|
1981
1979
|
} else {
|
|
1982
1980
|
// Inline function 'kotlin.let' call
|
|
1983
|
-
tmp_2 = tr.
|
|
1981
|
+
tmp_2 = tr.x1t(tmp0_safe_receiver);
|
|
1984
1982
|
}
|
|
1985
|
-
tmp = new FieldCall(tmp_2, stmt.
|
|
1983
|
+
tmp = new FieldCall(tmp_2, stmt.p1p_1);
|
|
1986
1984
|
} else {
|
|
1987
1985
|
tmp = transformChildren(stmt, tr);
|
|
1988
1986
|
}
|
|
@@ -1993,8 +1991,8 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
1993
1991
|
function PythonRefinedTypeDefinitionEmitter() {
|
|
1994
1992
|
}
|
|
1995
1993
|
function PythonShared() {
|
|
1996
|
-
this.
|
|
1997
|
-
this.
|
|
1994
|
+
this.l1x_1 = 'shared';
|
|
1995
|
+
this.m1x_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";
|
|
1998
1996
|
}
|
|
1999
1997
|
protoOf(PythonShared).toString = function () {
|
|
2000
1998
|
return 'PythonShared';
|
|
@@ -2015,17 +2013,17 @@ function PythonShared_getInstance() {
|
|
|
2015
2013
|
}
|
|
2016
2014
|
function PythonTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
2017
2015
|
return function (it) {
|
|
2018
|
-
return this$0.
|
|
2016
|
+
return this$0.q1x(it);
|
|
2019
2017
|
};
|
|
2020
2018
|
}
|
|
2021
2019
|
function PythonTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2022
2020
|
return function (it) {
|
|
2023
|
-
return this$0.
|
|
2021
|
+
return this$0.q1x(it);
|
|
2024
2022
|
};
|
|
2025
2023
|
}
|
|
2026
2024
|
function PythonTypeDefinitionEmitter$emit$lambda_1(this$0) {
|
|
2027
2025
|
return function (it) {
|
|
2028
|
-
return Spacer_instance.toString() + this$0.
|
|
2026
|
+
return Spacer_instance.toString() + this$0.aq(it);
|
|
2029
2027
|
};
|
|
2030
2028
|
}
|
|
2031
2029
|
function PythonTypeDefinitionEmitter() {
|
|
@@ -2033,26 +2031,26 @@ function PythonTypeDefinitionEmitter() {
|
|
|
2033
2031
|
function PythonUnionDefinitionEmitter() {
|
|
2034
2032
|
}
|
|
2035
2033
|
//region block: post-declaration
|
|
2036
|
-
protoOf(PythonEmitter).
|
|
2037
|
-
protoOf(PythonEmitter).
|
|
2038
|
-
protoOf(PythonEmitter).
|
|
2039
|
-
protoOf(PythonEmitter).
|
|
2040
|
-
protoOf(PythonEmitter).
|
|
2041
|
-
protoOf(PythonEmitter).
|
|
2042
|
-
protoOf(PythonEmitter).
|
|
2043
|
-
protoOf(PythonEmitter).
|
|
2044
|
-
protoOf(PythonEmitter).
|
|
2045
|
-
protoOf(PythonEmitter).
|
|
2046
|
-
protoOf(PythonEmitter).
|
|
2047
|
-
protoOf(PythonEmitter).
|
|
2048
|
-
protoOf(PythonEmitter).
|
|
2049
|
-
protoOf(PythonEmitter).
|
|
2050
|
-
protoOf(PythonEmitter).
|
|
2051
|
-
protoOf(PythonEmitter).
|
|
2052
|
-
protoOf(PythonEmitter).
|
|
2053
|
-
protoOf(PythonEmitter).
|
|
2054
|
-
protoOf(PythonEmitter).
|
|
2055
|
-
protoOf(PythonIrEmitter).
|
|
2034
|
+
protoOf(PythonEmitter).yp = emit_6;
|
|
2035
|
+
protoOf(PythonEmitter).zp = emit_7;
|
|
2036
|
+
protoOf(PythonEmitter).aq = emit_8;
|
|
2037
|
+
protoOf(PythonEmitter).bq = emit_9;
|
|
2038
|
+
protoOf(PythonEmitter).cq = emit_11;
|
|
2039
|
+
protoOf(PythonEmitter).nr = emit_4;
|
|
2040
|
+
protoOf(PythonEmitter).ir = emit_15;
|
|
2041
|
+
protoOf(PythonEmitter).or = emit_12;
|
|
2042
|
+
protoOf(PythonEmitter).dr = emit_5;
|
|
2043
|
+
protoOf(PythonEmitter).br = emit_3;
|
|
2044
|
+
protoOf(PythonEmitter).cr = emit_2;
|
|
2045
|
+
protoOf(PythonEmitter).n1x = emit_10;
|
|
2046
|
+
protoOf(PythonEmitter).v1v = emit_13;
|
|
2047
|
+
protoOf(PythonEmitter).o1x = emit_14;
|
|
2048
|
+
protoOf(PythonEmitter).pr = emitValidator;
|
|
2049
|
+
protoOf(PythonEmitter).i1w = sanitize;
|
|
2050
|
+
protoOf(PythonEmitter).y1v = sanitizeKeywords;
|
|
2051
|
+
protoOf(PythonEmitter).p1x = emitType;
|
|
2052
|
+
protoOf(PythonEmitter).q1x = emitReferenceCustomImports;
|
|
2053
|
+
protoOf(PythonIrEmitter).sn = emit_1;
|
|
2056
2054
|
//endregion
|
|
2057
2055
|
//region block: init
|
|
2058
2056
|
PythonShared_instance = new PythonShared();
|