@flock/wirespec 0.19.2 → 0.19.3-RC.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.mjs +12 -12
- package/arrow-arrow-core.mjs +167 -167
- package/clikt-clikt-mordant.mjs +81 -81
- package/clikt-clikt-mordant.mjs.map +1 -1
- package/clikt-clikt.mjs +1636 -1636
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +448 -448
- package/kotest-kotest-assertions-kotest-assertions-core.mjs +4 -0
- package/kotest-kotest-assertions-kotest-assertions-core.mjs.map +1 -0
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs +4 -0
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs.map +1 -0
- package/kotest-kotest-common.mjs +56 -0
- package/kotest-kotest-common.mjs.map +1 -0
- package/kotest-kotest-framework-kotest-framework-engine.mjs +4 -0
- package/kotest-kotest-framework-kotest-framework-engine.mjs.map +1 -0
- package/kotest-kotest-property.mjs +2501 -0
- package/kotest-kotest-property.mjs.map +1 -0
- package/kotlin-kotlin-stdlib.mjs +5269 -2487
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10266 -10266
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1846 -1846
- package/kotlin-rgxgen.mjs.map +1 -1
- package/kotlinx-coroutines-test.mjs +4 -0
- package/kotlinx-coroutines-test.mjs.map +1 -0
- package/kotlinx-io-kotlinx-io-core.mjs +455 -455
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +2132 -2098
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1579 -1579
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1435 -1435
- package/package.json +5 -1
- package/wirespec-generator.d.ts +51 -0
- package/wirespec-generator.mjs +9 -0
- package/wirespec-src-compiler-core.mjs +1597 -1597
- package/wirespec-src-compiler-emitters-java.mjs +451 -451
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +371 -371
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +456 -456
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +481 -481
- package/wirespec-src-compiler-emitters-scala.mjs +193 -193
- package/wirespec-src-compiler-emitters-typescript.mjs +526 -526
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +85 -85
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3913 -3857
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +439 -439
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +521 -521
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +859 -859
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +1387 -1387
- package/wirespec-src-ide-lsp.mjs.map +1 -1
- package/wirespec-src-integration-kotest.mjs +1647 -0
- package/wirespec-src-integration-kotest.mjs.map +1 -0
- package/wirespec-src-plugin-arguments.mjs +192 -192
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +109 -109
- package/wirespec-src-plugin-npm.d.mts +21 -0
- package/wirespec-src-plugin-npm.mjs +43 -43
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +35 -35
- package/wirespec-src-tools-generator.mjs.map +1 -1
- package/xmlutil-core.mjs +4 -0
- package/xmlutil-core.mjs.map +1 -0
- package/xmlutil-serialization.mjs +4 -0
- package/xmlutil-serialization.mjs.map +1 -0
|
@@ -172,10 +172,10 @@ import {
|
|
|
172
172
|
function emit_3(identifier) {
|
|
173
173
|
var tmp;
|
|
174
174
|
if (identifier instanceof DefinitionIdentifier) {
|
|
175
|
-
tmp = this.
|
|
175
|
+
tmp = this.d21(identifier);
|
|
176
176
|
} else {
|
|
177
177
|
if (identifier instanceof FieldIdentifier) {
|
|
178
|
-
tmp = this.
|
|
178
|
+
tmp = this.t20(this.d21(identifier));
|
|
179
179
|
} else {
|
|
180
180
|
noWhenBranchMatchedException();
|
|
181
181
|
}
|
|
@@ -184,7 +184,7 @@ function emit_3(identifier) {
|
|
|
184
184
|
}
|
|
185
185
|
function sanitize(_this__u8e3s4) {
|
|
186
186
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
187
|
-
var this_0 = split(_this__u8e3s4.
|
|
187
|
+
var this_0 = split(_this__u8e3s4.m1(), ['.', ' ']);
|
|
188
188
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
189
189
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
190
190
|
var index = 0;
|
|
@@ -193,11 +193,11 @@ function sanitize(_this__u8e3s4) {
|
|
|
193
193
|
var item = _iterator__ex2g4s.v();
|
|
194
194
|
var _unary__edvuaz = index;
|
|
195
195
|
index = _unary__edvuaz + 1 | 0;
|
|
196
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
197
|
-
destination.
|
|
196
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.pu(item) : item;
|
|
197
|
+
destination.y(tmp$ret$0);
|
|
198
198
|
}
|
|
199
199
|
var tmp = asSequence(joinToString(destination, ''));
|
|
200
|
-
return this.
|
|
200
|
+
return this.s20(joinToString_0(filter(tmp, KotlinIdentifierEmitter$sanitize$lambda), ''));
|
|
201
201
|
}
|
|
202
202
|
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
203
203
|
var tmp;
|
|
@@ -217,18 +217,18 @@ function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
|
217
217
|
return tmp;
|
|
218
218
|
}
|
|
219
219
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
220
|
-
return Companion_getInstance_0().
|
|
220
|
+
return Companion_getInstance_0().q21_1.v1(_this__u8e3s4) ? addBackticks(_this__u8e3s4) : _this__u8e3s4;
|
|
221
221
|
}
|
|
222
222
|
initMetadataForInterface(KotlinIdentifierEmitter, 'KotlinIdentifierEmitter');
|
|
223
223
|
function emit_4(type, module_0) {
|
|
224
224
|
var tmp;
|
|
225
|
-
if (type.
|
|
226
|
-
tmp = 'data object ' + this.
|
|
225
|
+
if (type.xs_1.ts_1.r()) {
|
|
226
|
+
tmp = 'data object ' + this.yu(type.ws_1);
|
|
227
227
|
} else {
|
|
228
|
-
var tmp_0 = this.
|
|
229
|
-
var tmp_1 = this.
|
|
228
|
+
var tmp_0 = this.yu(type.ws_1);
|
|
229
|
+
var tmp_1 = this.wt(type.xs_1);
|
|
230
230
|
// Inline function 'kotlin.run' call
|
|
231
|
-
var $this$run = type.
|
|
231
|
+
var $this$run = type.ys_1;
|
|
232
232
|
var tmp_2;
|
|
233
233
|
if ($this$run.r()) {
|
|
234
234
|
tmp_2 = '';
|
|
@@ -241,18 +241,18 @@ function emit_4(type, module_0) {
|
|
|
241
241
|
return tmp;
|
|
242
242
|
}
|
|
243
243
|
function emit_5(_this__u8e3s4) {
|
|
244
|
-
return dropLast(joinToString(_this__u8e3s4.
|
|
244
|
+
return dropLast(joinToString(_this__u8e3s4.ts_1, '\n', VOID, VOID, VOID, VOID, KotlinTypeDefinitionEmitter$emit$lambda_0(this)), 1);
|
|
245
245
|
}
|
|
246
246
|
function emit_6(_this__u8e3s4) {
|
|
247
|
-
return this.
|
|
247
|
+
return this.yu(_this__u8e3s4.bt_1) + ': ' + this.yt(_this__u8e3s4.ct_1);
|
|
248
248
|
}
|
|
249
249
|
function emit_7(_this__u8e3s4) {
|
|
250
250
|
var tmp;
|
|
251
251
|
if (_this__u8e3s4 instanceof Dict) {
|
|
252
|
-
tmp = 'Map<String, ' + this.
|
|
252
|
+
tmp = 'Map<String, ' + this.yt(_this__u8e3s4.ds_1) + '>';
|
|
253
253
|
} else {
|
|
254
254
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
255
|
-
tmp = 'List<' + this.
|
|
255
|
+
tmp = 'List<' + this.yt(_this__u8e3s4.as_1) + '>';
|
|
256
256
|
} else {
|
|
257
257
|
if (_this__u8e3s4 instanceof Unit) {
|
|
258
258
|
tmp = 'Unit';
|
|
@@ -261,17 +261,17 @@ function emit_7(_this__u8e3s4) {
|
|
|
261
261
|
tmp = 'Any';
|
|
262
262
|
} else {
|
|
263
263
|
if (_this__u8e3s4 instanceof Custom) {
|
|
264
|
-
tmp = _this__u8e3s4.
|
|
264
|
+
tmp = _this__u8e3s4.my_1;
|
|
265
265
|
} else {
|
|
266
266
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
267
|
-
var t = _this__u8e3s4.
|
|
267
|
+
var t = _this__u8e3s4.qy_1;
|
|
268
268
|
var tmp_0;
|
|
269
269
|
if (t instanceof String_0) {
|
|
270
270
|
tmp_0 = 'String';
|
|
271
271
|
} else {
|
|
272
272
|
if (t instanceof Integer) {
|
|
273
273
|
var tmp_1;
|
|
274
|
-
switch (t.
|
|
274
|
+
switch (t.ux_1.c3_1) {
|
|
275
275
|
case 0:
|
|
276
276
|
tmp_1 = 'Int';
|
|
277
277
|
break;
|
|
@@ -286,7 +286,7 @@ function emit_7(_this__u8e3s4) {
|
|
|
286
286
|
} else {
|
|
287
287
|
if (t instanceof Number_0) {
|
|
288
288
|
var tmp_2;
|
|
289
|
-
switch (t.
|
|
289
|
+
switch (t.xx_1.c3_1) {
|
|
290
290
|
case 0:
|
|
291
291
|
tmp_2 = 'Float';
|
|
292
292
|
break;
|
|
@@ -322,15 +322,15 @@ function emit_7(_this__u8e3s4) {
|
|
|
322
322
|
}
|
|
323
323
|
// Inline function 'kotlin.let' call
|
|
324
324
|
var it = tmp;
|
|
325
|
-
return _this__u8e3s4.
|
|
325
|
+
return _this__u8e3s4.ey() ? it + '?' : it;
|
|
326
326
|
}
|
|
327
327
|
function emit_8(_this__u8e3s4) {
|
|
328
328
|
var tmp;
|
|
329
329
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
330
|
-
tmp = 'Regex("""' + this.
|
|
330
|
+
tmp = 'Regex("""' + this.au(_this__u8e3s4.ax_1) + '""").matches(value)';
|
|
331
331
|
} else {
|
|
332
332
|
if (_this__u8e3s4 instanceof Bound) {
|
|
333
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
333
|
+
var tmp1_safe_receiver = _this__u8e3s4.qx_1;
|
|
334
334
|
var tmp_0;
|
|
335
335
|
if (tmp1_safe_receiver == null) {
|
|
336
336
|
tmp_0 = null;
|
|
@@ -339,7 +339,7 @@ function emit_8(_this__u8e3s4) {
|
|
|
339
339
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
340
340
|
}
|
|
341
341
|
var minCheck = tmp_0;
|
|
342
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
342
|
+
var tmp2_safe_receiver = _this__u8e3s4.rx_1;
|
|
343
343
|
var tmp_1;
|
|
344
344
|
if (tmp2_safe_receiver == null) {
|
|
345
345
|
tmp_1 = null;
|
|
@@ -367,53 +367,13 @@ function emit_8(_this__u8e3s4) {
|
|
|
367
367
|
}
|
|
368
368
|
initMetadataForInterface(KotlinTypeDefinitionEmitter, 'KotlinTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, KotlinIdentifierEmitter]);
|
|
369
369
|
function emit_9(channel) {
|
|
370
|
-
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |fun interface ' + this.
|
|
370
|
+
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |fun interface ' + this.yu(channel.ns_1) + ' {\n | operator fun invoke(message: ' + this.yt(channel.os_1) + ')\n |}\n |\n ');
|
|
371
371
|
}
|
|
372
372
|
initMetadataForInterface(KotlinChannelDefinitionEmitter, 'KotlinChannelDefinitionEmitter', VOID, VOID, [KotlinTypeDefinitionEmitter]);
|
|
373
|
-
function emit_10(
|
|
374
|
-
return trimMargin('\n |
|
|
373
|
+
function emit_10(union) {
|
|
374
|
+
return trimMargin('\n |sealed interface ' + this.yu(union.rs_1) + '\n |\n ');
|
|
375
375
|
}
|
|
376
|
-
|
|
377
|
-
var defaultReturn = 'true';
|
|
378
|
-
var type = _this__u8e3s4.tr_1.fv_1;
|
|
379
|
-
var tmp;
|
|
380
|
-
if (type instanceof Integer) {
|
|
381
|
-
var tmp0_safe_receiver = type.ku_1;
|
|
382
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.oq(tmp0_safe_receiver);
|
|
383
|
-
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
384
|
-
} else {
|
|
385
|
-
if (type instanceof Number_0) {
|
|
386
|
-
var tmp2_safe_receiver = type.nu_1;
|
|
387
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.oq(tmp2_safe_receiver);
|
|
388
|
-
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
389
|
-
} else {
|
|
390
|
-
if (type instanceof String_0) {
|
|
391
|
-
var tmp4_safe_receiver = type.hu_1;
|
|
392
|
-
var tmp_0;
|
|
393
|
-
var tmp_1 = tmp4_safe_receiver;
|
|
394
|
-
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
395
|
-
tmp_0 = null;
|
|
396
|
-
} else {
|
|
397
|
-
tmp_0 = this.oq(new RegExp_0(tmp4_safe_receiver));
|
|
398
|
-
}
|
|
399
|
-
var tmp5_elvis_lhs = tmp_0;
|
|
400
|
-
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
401
|
-
} else {
|
|
402
|
-
if (equals(type, Boolean_instance)) {
|
|
403
|
-
tmp = defaultReturn;
|
|
404
|
-
} else {
|
|
405
|
-
if (equals(type, Bytes_instance)) {
|
|
406
|
-
tmp = defaultReturn;
|
|
407
|
-
} else {
|
|
408
|
-
noWhenBranchMatchedException();
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
return tmp;
|
|
415
|
-
}
|
|
416
|
-
initMetadataForInterface(KotlinRefinedTypeDefinitionEmitter, 'KotlinRefinedTypeDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter, KotlinTypeDefinitionEmitter]);
|
|
376
|
+
initMetadataForInterface(KotlinUnionDefinitionEmitter, 'KotlinUnionDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
417
377
|
function emit_11(endpoint) {
|
|
418
378
|
// Inline function 'kotlin.collections.map' call
|
|
419
379
|
var this_0 = importReferences(endpoint);
|
|
@@ -422,89 +382,89 @@ function emit_11(endpoint) {
|
|
|
422
382
|
var _iterator__ex2g4s = this_0.t();
|
|
423
383
|
while (_iterator__ex2g4s.u()) {
|
|
424
384
|
var item = _iterator__ex2g4s.v();
|
|
425
|
-
var tmp$ret$0 = 'import ' + this.
|
|
426
|
-
destination.
|
|
385
|
+
var tmp$ret$0 = 'import ' + this.d20().ov_1 + '.model.' + item.my_1;
|
|
386
|
+
destination.y(tmp$ret$0);
|
|
427
387
|
}
|
|
428
388
|
var tmp = destination;
|
|
429
389
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda);
|
|
430
|
-
var tmp_1 = this.
|
|
390
|
+
var tmp_1 = this.yu(endpoint.ft_1);
|
|
431
391
|
var tmp_2 = get_pathParams(endpoint);
|
|
432
392
|
var tmp_3 = emitObject$default(this, tmp_2, 'Path', 'Wirespec.Path', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
433
|
-
var tmp_4 = emitObject$default(this, endpoint.
|
|
434
|
-
var tmp_5 = emitObject$default(this, endpoint.
|
|
435
|
-
var tmp_6 = this.
|
|
393
|
+
var tmp_4 = emitObject$default(this, endpoint.it_1, 'Queries', 'Wirespec.Queries', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
394
|
+
var tmp_5 = emitObject$default(this, endpoint.jt_1, 'Headers', 'Wirespec.Request.Headers', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
395
|
+
var tmp_6 = this.q20(first(endpoint.kt_1), endpoint);
|
|
436
396
|
var tmp_7 = Spacer_instance.toString();
|
|
437
397
|
var tmp_8 = emitStatusInterfaces(this, endpoint);
|
|
438
398
|
var tmp_9 = emitResponseInterfaces(this, endpoint);
|
|
439
|
-
var tmp_10 = distinctByStatus(endpoint.
|
|
399
|
+
var tmp_10 = distinctByStatus(endpoint.lt_1);
|
|
440
400
|
var tmp_11 = joinToString(tmp_10, '\n\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
441
401
|
var tmp_12 = Spacer_instance.toString();
|
|
442
|
-
var tmp_13 = Spacer_instance.
|
|
443
|
-
var tmp_14 = distinctByStatus(endpoint.
|
|
402
|
+
var tmp_13 = Spacer_instance.sv(2);
|
|
403
|
+
var tmp_14 = distinctByStatus(endpoint.lt_1);
|
|
444
404
|
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_4(this));
|
|
445
|
-
var tmp_16 = Spacer_instance.
|
|
405
|
+
var tmp_16 = Spacer_instance.sv(2);
|
|
446
406
|
var tmp_17 = Spacer_instance.toString();
|
|
447
|
-
var tmp_18 = Spacer_instance.
|
|
407
|
+
var tmp_18 = Spacer_instance.sv(2);
|
|
448
408
|
// Inline function 'kotlin.collections.filter' call
|
|
449
|
-
var tmp0 = distinctByStatus(endpoint.
|
|
409
|
+
var tmp0 = distinctByStatus(endpoint.lt_1);
|
|
450
410
|
// Inline function 'kotlin.collections.filterTo' call
|
|
451
411
|
var destination_0 = ArrayList_init_$Create$_0();
|
|
452
412
|
var _iterator__ex2g4s_0 = tmp0.t();
|
|
453
413
|
while (_iterator__ex2g4s_0.u()) {
|
|
454
414
|
var element = _iterator__ex2g4s_0.v();
|
|
455
|
-
if (Companion_instance_1.
|
|
456
|
-
destination_0.
|
|
415
|
+
if (Companion_instance_1.tu(element.rt_1)) {
|
|
416
|
+
destination_0.y(element);
|
|
457
417
|
}
|
|
458
418
|
}
|
|
459
419
|
var tmp_19 = destination_0;
|
|
460
420
|
var tmp_20 = joinToString(tmp_19, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
461
|
-
var tmp_21 = Spacer_instance.
|
|
462
|
-
var tmp_22 = Spacer_instance.
|
|
421
|
+
var tmp_21 = Spacer_instance.sv(3);
|
|
422
|
+
var tmp_22 = Spacer_instance.sv(2);
|
|
463
423
|
var tmp_23 = Spacer_instance.toString();
|
|
464
|
-
var tmp_24 = Spacer_instance.
|
|
465
|
-
var tmp_25 = this.
|
|
466
|
-
var tmp_26 = Spacer_instance.
|
|
467
|
-
var tmp_27 = Spacer_instance.
|
|
468
|
-
return trimMargin('\n |' + tmp_0 + '\n |\n |object ' + tmp_1 + ' : Wirespec.Endpoint {\n |' + tmp_3 + '\n |\n |' + tmp_4 + '\n |\n |' + tmp_5 + '\n |\n |' + tmp_6 + '\n |\n |' + tmp_7 + 'sealed interface Response<T: Any> : Wirespec.Response<T>\n |\n |' + tmp_8 + '\n |\n |' + tmp_9 + '\n |\n |' + tmp_11 + '\n |\n |' + tmp_12 + 'fun toResponse(serialization: Wirespec.Serializer, response: Response<*>): Wirespec.RawResponse =\n |' + tmp_13 + 'when(response) {\n |' + tmp_15 + '\n |' + tmp_16 + '}\n |\n |' + tmp_17 + 'fun fromResponse(serialization: Wirespec.Deserializer, response: Wirespec.RawResponse): Response<*> =\n |' + tmp_18 + 'when (response.statusCode) {\n |' + tmp_20 + '\n |' + tmp_21 + 'else -> error("Cannot match response with status: ${response.statusCode}")\n |' + tmp_22 + '}\n |\n |' + tmp_23 + 'interface Handler: Wirespec.Handler {\n |' + tmp_24 + tmp_25 + '\n |' + tmp_26 + 'companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n |' + tmp_27 + 'override val pathTemplate = "/' + joinToString(endpoint.
|
|
424
|
+
var tmp_24 = Spacer_instance.sv(2);
|
|
425
|
+
var tmp_25 = this.u20(endpoint);
|
|
426
|
+
var tmp_26 = Spacer_instance.sv(2);
|
|
427
|
+
var tmp_27 = Spacer_instance.sv(3);
|
|
428
|
+
return trimMargin('\n |' + tmp_0 + '\n |\n |object ' + tmp_1 + ' : Wirespec.Endpoint {\n |' + tmp_3 + '\n |\n |' + tmp_4 + '\n |\n |' + tmp_5 + '\n |\n |' + tmp_6 + '\n |\n |' + tmp_7 + 'sealed interface Response<T: Any> : Wirespec.Response<T>\n |\n |' + tmp_8 + '\n |\n |' + tmp_9 + '\n |\n |' + tmp_11 + '\n |\n |' + tmp_12 + 'fun toResponse(serialization: Wirespec.Serializer, response: Response<*>): Wirespec.RawResponse =\n |' + tmp_13 + 'when(response) {\n |' + tmp_15 + '\n |' + tmp_16 + '}\n |\n |' + tmp_17 + 'fun fromResponse(serialization: Wirespec.Deserializer, response: Wirespec.RawResponse): Response<*> =\n |' + tmp_18 + 'when (response.statusCode) {\n |' + tmp_20 + '\n |' + tmp_21 + 'else -> error("Cannot match response with status: ${response.statusCode}")\n |' + tmp_22 + '}\n |\n |' + tmp_23 + 'interface Handler: Wirespec.Handler {\n |' + tmp_24 + tmp_25 + '\n |' + tmp_26 + 'companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n |' + tmp_27 + 'override val pathTemplate = "/' + joinToString(endpoint.ht_1, '/', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_6) + '"\n |' + Spacer_instance.sv(3) + 'override val method = "' + endpoint.gt_1.toString() + '"\n |' + Spacer_instance.sv(3) + 'override fun server(serialization: Wirespec.Serialization) = object : Wirespec.ServerEdge<Request, Response<*>> {\n |' + Spacer_instance.sv(4) + 'override fun from(request: Wirespec.RawRequest) = fromRequest(serialization, request)\n |' + Spacer_instance.sv(4) + 'override fun to(response: Response<*>) = toResponse(serialization, response)\n |' + Spacer_instance.sv(3) + '}\n |' + Spacer_instance.sv(3) + 'override fun client(serialization: Wirespec.Serialization) = object : Wirespec.ClientEdge<Request, Response<*>> {\n |' + Spacer_instance.sv(4) + 'override fun to(request: Request) = toRequest(serialization, request)\n |' + Spacer_instance.sv(4) + 'override fun from(response: Wirespec.RawResponse) = fromResponse(serialization, response)\n |' + Spacer_instance.sv(3) + '}\n |' + Spacer_instance.sv(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
469
429
|
}
|
|
470
430
|
function emitHandleFunction(endpoint) {
|
|
471
|
-
return 'suspend fun ' + Companion_instance_1.
|
|
431
|
+
return 'suspend fun ' + Companion_instance_1.qu(this.yu(endpoint.ft_1)) + '(request: Request): Response<*>';
|
|
472
432
|
}
|
|
473
433
|
function emit_12(_this__u8e3s4, endpoint) {
|
|
474
434
|
var tmp = Spacer_instance.toString();
|
|
475
435
|
var tmp_0 = emitConstructor(this, _this__u8e3s4, endpoint);
|
|
476
|
-
var tmp_1 = Spacer_instance.
|
|
436
|
+
var tmp_1 = Spacer_instance.sv(2);
|
|
477
437
|
var tmp_2 = get_pathParams(endpoint);
|
|
478
438
|
var tmp_3 = brace(this, joinToString(tmp_2, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_7(this)));
|
|
479
|
-
var tmp_4 = Spacer_instance.
|
|
480
|
-
var tmp_5 = Spacer_instance.
|
|
481
|
-
var tmp_6 = brace(this, joinToString(endpoint.
|
|
482
|
-
var tmp_7 = Spacer_instance.
|
|
483
|
-
var tmp_8 = brace(this, joinToString(endpoint.
|
|
484
|
-
var tmp_9 = _this__u8e3s4.
|
|
439
|
+
var tmp_4 = Spacer_instance.sv(2);
|
|
440
|
+
var tmp_5 = Spacer_instance.sv(2);
|
|
441
|
+
var tmp_6 = brace(this, joinToString(endpoint.it_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_8(this)));
|
|
442
|
+
var tmp_7 = Spacer_instance.sv(2);
|
|
443
|
+
var tmp_8 = brace(this, joinToString(endpoint.jt_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_9(this)));
|
|
444
|
+
var tmp_9 = _this__u8e3s4.ot_1 == null ? Spacer_instance.sv(2) + 'override val body = Unit\n' + Spacer_instance.toString() + '}' : Spacer_instance.toString() + '}';
|
|
485
445
|
var tmp_10 = Spacer_instance.toString();
|
|
486
|
-
var tmp_11 = Spacer_instance.
|
|
487
|
-
var tmp_12 = Spacer_instance.
|
|
488
|
-
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.
|
|
446
|
+
var tmp_11 = Spacer_instance.sv(2);
|
|
447
|
+
var tmp_12 = Spacer_instance.sv(3);
|
|
448
|
+
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.gt_1.b3_1 + '\n |' + tmp_5 + 'override val queries = Queries' + tmp_6 + '\n |' + tmp_7 + 'override val headers = Headers' + tmp_8 + '\n |' + tmp_9 + '\n |\n |' + tmp_10 + 'fun toRequest(serialization: Wirespec.Serializer, request: Request): Wirespec.RawRequest =\n |' + tmp_11 + 'Wirespec.RawRequest(\n |' + tmp_12 + 'path = listOf(' + joinToString(endpoint.ht_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_10(this)) + '),\n |' + Spacer_instance.sv(3) + 'method = request.method.name,\n |' + Spacer_instance.sv(3) + 'queries = ' + this.n21(endpoint) + ',\n |' + Spacer_instance.sv(3) + 'headers = ' + this.m21(endpoint) + ',\n |' + Spacer_instance.sv(3) + 'body = ' + (!(_this__u8e3s4.ot_1 == null) ? 'serialization.serializeBody(request.body, typeOf<' + emit_16(this, _this__u8e3s4.ot_1) + '>())' : 'null') + ',\n |' + Spacer_instance.sv(2) + ')\n |\n |' + Spacer_instance.toString() + 'fun fromRequest(serialization: Wirespec.Deserializer, request: Wirespec.RawRequest): Request =\n |' + Spacer_instance.sv(2) + 'Request' + emitDeserializedParams(this, _this__u8e3s4, endpoint) + '\n ');
|
|
489
449
|
}
|
|
490
450
|
function emitRequestHeaders(_this__u8e3s4) {
|
|
491
451
|
var tmp;
|
|
492
|
-
if (_this__u8e3s4.
|
|
452
|
+
if (_this__u8e3s4.jt_1.r()) {
|
|
493
453
|
tmp = 'emptyMap()';
|
|
494
454
|
} else {
|
|
495
|
-
var tmp_0 = Spacer_instance.
|
|
496
|
-
var tmp_1 = ',\n' + Spacer_instance.
|
|
497
|
-
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.
|
|
455
|
+
var tmp_0 = Spacer_instance.sv(5);
|
|
456
|
+
var tmp_1 = ',\n' + Spacer_instance.sv(5);
|
|
457
|
+
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.jt_1, tmp_1, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitRequestHeaders$lambda(this)) + '\n |' + Spacer_instance.sv(4) + ')\n ');
|
|
498
458
|
}
|
|
499
459
|
return tmp;
|
|
500
460
|
}
|
|
501
461
|
function emitQueries(endpoint) {
|
|
502
462
|
var tmp;
|
|
503
463
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
504
|
-
if (!endpoint.
|
|
505
|
-
var tmp_0 = Spacer_instance.
|
|
506
|
-
var tmp_1 = ',\n' + Spacer_instance.
|
|
507
|
-
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(endpoint.
|
|
464
|
+
if (!endpoint.it_1.r()) {
|
|
465
|
+
var tmp_0 = Spacer_instance.sv(5);
|
|
466
|
+
var tmp_1 = ',\n' + Spacer_instance.sv(5);
|
|
467
|
+
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(endpoint.it_1, tmp_1, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitQueries$lambda(this)) + '\n |' + Spacer_instance.sv(4) + ')\n ');
|
|
508
468
|
} else {
|
|
509
469
|
tmp = 'emptyMap()';
|
|
510
470
|
}
|
|
@@ -512,44 +472,84 @@ function emitQueries(endpoint) {
|
|
|
512
472
|
}
|
|
513
473
|
function emit_13(_this__u8e3s4) {
|
|
514
474
|
// Inline function 'kotlin.let' call
|
|
515
|
-
var it = joinToString(_this__u8e3s4.
|
|
475
|
+
var it = joinToString(_this__u8e3s4.st_1, ', ', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_11(this));
|
|
516
476
|
var responseHeaderFields = isBlank(it) ? '' : ', ' + it;
|
|
517
477
|
var tmp = Spacer_instance.toString();
|
|
518
|
-
var tmp_0 = emit_16(this, _this__u8e3s4.
|
|
519
|
-
var tmp_1 = toString_0(charCodeAt(_this__u8e3s4.
|
|
520
|
-
var tmp_2 = emit_16(this, _this__u8e3s4.
|
|
521
|
-
var tmp_3 = concatGenerics(emit_16(this, _this__u8e3s4.
|
|
522
|
-
var tmp_4 = Spacer_instance.
|
|
523
|
-
var tmp_5 = fixStatus(_this__u8e3s4.
|
|
524
|
-
var tmp_6 = Spacer_instance.
|
|
525
|
-
var tmp_7 = brace(this, joinToString(_this__u8e3s4.
|
|
526
|
-
return trimMargin('\n |' + tmp + 'data class Response' + _this__u8e3s4.
|
|
478
|
+
var tmp_0 = emit_16(this, _this__u8e3s4.tt_1);
|
|
479
|
+
var tmp_1 = toString_0(charCodeAt(_this__u8e3s4.rt_1, 0));
|
|
480
|
+
var tmp_2 = emit_16(this, _this__u8e3s4.tt_1);
|
|
481
|
+
var tmp_3 = concatGenerics(emit_16(this, _this__u8e3s4.tt_1));
|
|
482
|
+
var tmp_4 = Spacer_instance.sv(2);
|
|
483
|
+
var tmp_5 = fixStatus(_this__u8e3s4.rt_1);
|
|
484
|
+
var tmp_6 = Spacer_instance.sv(2);
|
|
485
|
+
var tmp_7 = brace(this, joinToString(_this__u8e3s4.st_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_12(this)));
|
|
486
|
+
return trimMargin('\n |' + tmp + 'data class Response' + _this__u8e3s4.rt_1 + '(override val body: ' + tmp_0 + responseHeaderFields + ') : Response' + tmp_1 + 'XX<' + tmp_2 + '>, Response' + tmp_3 + ' {\n |' + tmp_4 + 'override val status = ' + tmp_5 + '\n |' + tmp_6 + 'override val headers = ResponseHeaders' + tmp_7 + '\n |' + emitObject(this, _this__u8e3s4.st_1, 'ResponseHeaders', 'Wirespec.Response.Headers', 2, KotlinEndpointDefinitionEmitter$emit$lambda_13(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
527
487
|
}
|
|
528
488
|
function emitBody(_this__u8e3s4, content) {
|
|
529
489
|
return 'serialization.serializeBody(response.body, typeOf<' + emit_16(_this__u8e3s4, content) + '>())';
|
|
530
490
|
}
|
|
531
491
|
function emitHeaders(_this__u8e3s4) {
|
|
532
492
|
var tmp;
|
|
533
|
-
if (_this__u8e3s4.
|
|
493
|
+
if (_this__u8e3s4.st_1.r()) {
|
|
534
494
|
tmp = 'emptyMap()';
|
|
535
495
|
} else {
|
|
536
|
-
var tmp_0 = Spacer_instance.
|
|
537
|
-
var tmp_1 = ',\n' + Spacer_instance.
|
|
538
|
-
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.
|
|
496
|
+
var tmp_0 = Spacer_instance.sv(5);
|
|
497
|
+
var tmp_1 = ',\n' + Spacer_instance.sv(5);
|
|
498
|
+
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.st_1, tmp_1, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitHeaders$lambda(this)) + '\n |' + Spacer_instance.sv(4) + ')\n ');
|
|
539
499
|
}
|
|
540
500
|
return tmp;
|
|
541
501
|
}
|
|
542
502
|
initMetadataForInterface(KotlinEndpointDefinitionEmitter, 'KotlinEndpointDefinitionEmitter', VOID, VOID, [KotlinTypeDefinitionEmitter]);
|
|
543
|
-
function emit_14(
|
|
544
|
-
|
|
545
|
-
}
|
|
546
|
-
initMetadataForInterface(KotlinUnionDefinitionEmitter, 'KotlinUnionDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
547
|
-
function emit_15(enum_0, module_0) {
|
|
548
|
-
var tmp = this.r1x(enum_0.xr_1);
|
|
549
|
-
return trimMargin('\n |enum class ' + tmp + ' (override val label: String): Wirespec.Enum {\n |' + spacer(joinToString(enum_0.yr_1, ',\n', VOID, VOID, VOID, VOID, KotlinEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'override fun toString(): String {\n |' + Spacer_instance.hs(2) + 'return label\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
503
|
+
function emit_14(enum_0, module_0) {
|
|
504
|
+
var tmp = this.d21(enum_0.iv_1);
|
|
505
|
+
return trimMargin('\n |enum class ' + tmp + ' (override val label: String): Wirespec.Enum {\n |' + spacer(joinToString(enum_0.jv_1, ',\n', VOID, VOID, VOID, VOID, KotlinEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'override fun toString(): String {\n |' + Spacer_instance.sv(2) + 'return label\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
550
506
|
}
|
|
551
507
|
initMetadataForInterface(KotlinEnumDefinitionEmitter, 'KotlinEnumDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
552
|
-
|
|
508
|
+
function emit_15(refined) {
|
|
509
|
+
return trimMargin('\n |data class ' + this.d21(refined.dv_1) + '(override val value: ' + this.yt(refined.ev_1) + '): Wirespec.Refined<' + this.yt(refined.ev_1) + '> {\n |' + Spacer_instance.toString() + 'override fun toString() = value.toString()\n |' + Spacer_instance.toString() + 'override fun validate() = ' + this.mv(refined) + '\n |}\n |\n ');
|
|
510
|
+
}
|
|
511
|
+
function emitValidator(_this__u8e3s4) {
|
|
512
|
+
var defaultReturn = 'true';
|
|
513
|
+
var type = _this__u8e3s4.ev_1.qy_1;
|
|
514
|
+
var tmp;
|
|
515
|
+
if (type instanceof Integer) {
|
|
516
|
+
var tmp0_safe_receiver = type.vx_1;
|
|
517
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.zt(tmp0_safe_receiver);
|
|
518
|
+
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
519
|
+
} else {
|
|
520
|
+
if (type instanceof Number_0) {
|
|
521
|
+
var tmp2_safe_receiver = type.yx_1;
|
|
522
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.zt(tmp2_safe_receiver);
|
|
523
|
+
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
524
|
+
} else {
|
|
525
|
+
if (type instanceof String_0) {
|
|
526
|
+
var tmp4_safe_receiver = type.sx_1;
|
|
527
|
+
var tmp_0;
|
|
528
|
+
var tmp_1 = tmp4_safe_receiver;
|
|
529
|
+
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
530
|
+
tmp_0 = null;
|
|
531
|
+
} else {
|
|
532
|
+
tmp_0 = this.zt(new RegExp_0(tmp4_safe_receiver));
|
|
533
|
+
}
|
|
534
|
+
var tmp5_elvis_lhs = tmp_0;
|
|
535
|
+
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
536
|
+
} else {
|
|
537
|
+
if (equals(type, Boolean_instance)) {
|
|
538
|
+
tmp = defaultReturn;
|
|
539
|
+
} else {
|
|
540
|
+
if (equals(type, Bytes_instance)) {
|
|
541
|
+
tmp = defaultReturn;
|
|
542
|
+
} else {
|
|
543
|
+
noWhenBranchMatchedException();
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
return tmp;
|
|
550
|
+
}
|
|
551
|
+
initMetadataForInterface(KotlinRefinedTypeDefinitionEmitter, 'KotlinRefinedTypeDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter, KotlinTypeDefinitionEmitter]);
|
|
552
|
+
initMetadataForClass(KotlinEmitter, 'KotlinEmitter', KotlinEmitter, LanguageEmitter, [LanguageEmitter, KotlinTypeDefinitionEmitter, KotlinIdentifierEmitter, KotlinChannelDefinitionEmitter, KotlinUnionDefinitionEmitter, KotlinEndpointDefinitionEmitter, KotlinEnumDefinitionEmitter, KotlinRefinedTypeDefinitionEmitter]);
|
|
553
553
|
initMetadataForCompanion(Companion);
|
|
554
554
|
initMetadataForCompanion(Companion_0);
|
|
555
555
|
initMetadataForClass(KotlinIrEmitter, 'KotlinIrEmitter', KotlinIrEmitter, VOID, [IrEmitter]);
|
|
@@ -563,8 +563,8 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
563
563
|
var _iterator__ex2g4s = this_0.t();
|
|
564
564
|
while (_iterator__ex2g4s.u()) {
|
|
565
565
|
var item = _iterator__ex2g4s.v();
|
|
566
|
-
var tmp$ret$0 = 'import ' + $this.
|
|
567
|
-
destination.
|
|
566
|
+
var tmp$ret$0 = 'import ' + $this.d20().ov_1 + '.model.' + item.my_1 + ';';
|
|
567
|
+
destination.y(tmp$ret$0);
|
|
568
568
|
}
|
|
569
569
|
var tmp = destination;
|
|
570
570
|
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, KotlinChannelDefinitionEmitter$emitImports$lambda);
|
|
@@ -576,67 +576,67 @@ function KotlinChannelDefinitionEmitter$emitImports$lambda(it) {
|
|
|
576
576
|
function KotlinChannelDefinitionEmitter() {
|
|
577
577
|
}
|
|
578
578
|
function KotlinEmitter(packageName, emitShared) {
|
|
579
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
580
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
579
|
+
packageName = packageName === VOID ? Companion_instance.nv('community.flock.wirespec.generated') : packageName;
|
|
580
|
+
emitShared = emitShared === VOID ? Companion_instance_0.hs() : emitShared;
|
|
581
581
|
LanguageEmitter.call(this);
|
|
582
|
-
this.
|
|
583
|
-
this.
|
|
584
|
-
this.
|
|
585
|
-
this.
|
|
586
|
-
this.
|
|
587
|
-
this.
|
|
588
|
-
}
|
|
589
|
-
protoOf(KotlinEmitter).
|
|
590
|
-
return this.
|
|
582
|
+
this.e21_1 = packageName;
|
|
583
|
+
this.f21_1 = emitShared;
|
|
584
|
+
this.g21_1 = '\nimport community.flock.wirespec.kotlin.Wirespec\nimport kotlin.reflect.typeOf\n';
|
|
585
|
+
this.h21_1 = FileExtension_Kotlin_getInstance();
|
|
586
|
+
this.i21_1 = KotlinShared_getInstance();
|
|
587
|
+
this.j21_1 = '//';
|
|
588
|
+
}
|
|
589
|
+
protoOf(KotlinEmitter).d20 = function () {
|
|
590
|
+
return this.e21_1;
|
|
591
591
|
};
|
|
592
|
-
protoOf(KotlinEmitter).
|
|
593
|
-
return this.
|
|
592
|
+
protoOf(KotlinEmitter).fu = function () {
|
|
593
|
+
return this.h21_1;
|
|
594
594
|
};
|
|
595
|
-
protoOf(KotlinEmitter).
|
|
596
|
-
return this.
|
|
595
|
+
protoOf(KotlinEmitter).m20 = function () {
|
|
596
|
+
return this.i21_1;
|
|
597
597
|
};
|
|
598
|
-
protoOf(KotlinEmitter).
|
|
599
|
-
return this.
|
|
598
|
+
protoOf(KotlinEmitter).gu = function () {
|
|
599
|
+
return this.j21_1;
|
|
600
600
|
};
|
|
601
|
-
protoOf(KotlinEmitter).
|
|
601
|
+
protoOf(KotlinEmitter).vu = function (module_0, logger) {
|
|
602
602
|
// Inline function 'kotlin.let' call
|
|
603
|
-
var it = protoOf(LanguageEmitter).
|
|
604
|
-
return this.
|
|
603
|
+
var it = protoOf(LanguageEmitter).vu.call(this, module_0, logger);
|
|
604
|
+
return this.f21_1.is_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.nv('community.flock.wirespec.kotlin').qv() + 'Wirespec', this.m20().l21_1)) : it;
|
|
605
605
|
};
|
|
606
|
-
protoOf(KotlinEmitter).
|
|
606
|
+
protoOf(KotlinEmitter).wu = function (definition, module_0, logger) {
|
|
607
607
|
// Inline function 'kotlin.let' call
|
|
608
|
-
var it = protoOf(LanguageEmitter).
|
|
609
|
-
var subPackageName = plus(this.
|
|
610
|
-
var tmp = subPackageName.
|
|
608
|
+
var it = protoOf(LanguageEmitter).wu.call(this, definition, module_0, logger);
|
|
609
|
+
var subPackageName = plus(this.d20(), definition);
|
|
610
|
+
var tmp = subPackageName.qv() + it.js_1;
|
|
611
611
|
// Inline function 'kotlin.text.trimStart' call
|
|
612
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + '\n |' + (Companion_instance_1.
|
|
612
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + '\n |' + (Companion_instance_1.ru(module_0) ? this.g21_1 : '') + '\n |' + it.ks_1 + '\n ');
|
|
613
613
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
614
614
|
return new Emitted(tmp, tmp$ret$0);
|
|
615
615
|
};
|
|
616
616
|
function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
617
617
|
// Inline function 'kotlin.collections.map' call
|
|
618
|
-
var this_0 = _this__u8e3s4.
|
|
618
|
+
var this_0 = _this__u8e3s4.lt_1;
|
|
619
619
|
// Inline function 'kotlin.collections.mapTo' call
|
|
620
620
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
621
621
|
var _iterator__ex2g4s = this_0.t();
|
|
622
622
|
while (_iterator__ex2g4s.u()) {
|
|
623
623
|
var item = _iterator__ex2g4s.v();
|
|
624
|
-
var tmp$ret$0 = new Char(charCodeAt(item.
|
|
625
|
-
destination.
|
|
624
|
+
var tmp$ret$0 = new Char(charCodeAt(item.rt_1, 0));
|
|
625
|
+
destination.y(tmp$ret$0);
|
|
626
626
|
}
|
|
627
627
|
var tmp = distinct(destination);
|
|
628
628
|
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitStatusInterfaces$lambda);
|
|
629
629
|
}
|
|
630
630
|
function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
631
631
|
// Inline function 'kotlin.collections.map' call
|
|
632
|
-
var this_0 = _this__u8e3s4.
|
|
632
|
+
var this_0 = _this__u8e3s4.lt_1;
|
|
633
633
|
// Inline function 'kotlin.collections.mapTo' call
|
|
634
634
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
635
635
|
var _iterator__ex2g4s = this_0.t();
|
|
636
636
|
while (_iterator__ex2g4s.u()) {
|
|
637
637
|
var item = _iterator__ex2g4s.v();
|
|
638
|
-
var tmp$ret$0 = emit_16($this, item.
|
|
639
|
-
destination.
|
|
638
|
+
var tmp$ret$0 = emit_16($this, item.tt_1);
|
|
639
|
+
destination.y(tmp$ret$0);
|
|
640
640
|
}
|
|
641
641
|
var tmp = distinct(destination);
|
|
642
642
|
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitResponseInterfaces$lambda);
|
|
@@ -644,64 +644,64 @@ function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
|
644
644
|
function emitConstructor($this, _this__u8e3s4, endpoint) {
|
|
645
645
|
var tmp = get_pathParams(endpoint);
|
|
646
646
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitConstructor$lambda($this)));
|
|
647
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
648
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
649
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
647
|
+
var tmp_1 = orNull(joinToString(endpoint.it_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitConstructor$lambda_0($this)));
|
|
648
|
+
var tmp_2 = orNull(joinToString(endpoint.jt_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitConstructor$lambda_1($this)));
|
|
649
|
+
var tmp0_safe_receiver = _this__u8e3s4.ot_1;
|
|
650
650
|
var tmp_3;
|
|
651
651
|
if (tmp0_safe_receiver == null) {
|
|
652
652
|
tmp_3 = null;
|
|
653
653
|
} else {
|
|
654
654
|
// Inline function 'kotlin.let' call
|
|
655
|
-
tmp_3 = Spacer_instance.
|
|
655
|
+
tmp_3 = Spacer_instance.sv(2) + 'override val body: ' + emit_16($this, tmp0_safe_receiver) + ',';
|
|
656
656
|
}
|
|
657
657
|
// Inline function 'kotlin.let' call
|
|
658
658
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
659
|
-
return isBlank(it) ? 'object Request : Wirespec.Request<' + emit_16($this, _this__u8e3s4.
|
|
659
|
+
return isBlank(it) ? 'object Request : Wirespec.Request<' + emit_16($this, _this__u8e3s4.ot_1) + '> {' : 'class Request(\n' + it + '\n' + Spacer_instance.toString() + ') : Wirespec.Request<' + emit_16($this, _this__u8e3s4.ot_1) + '> {';
|
|
660
660
|
}
|
|
661
661
|
function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
662
662
|
var tmp = get_indexedPathParams(endpoint);
|
|
663
663
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
|
|
664
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
665
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
666
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
664
|
+
var tmp_1 = orNull(joinToString(endpoint.it_1, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
665
|
+
var tmp_2 = orNull(joinToString(endpoint.jt_1, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
666
|
+
var tmp0_safe_receiver = _this__u8e3s4.ot_1;
|
|
667
667
|
var tmp_3;
|
|
668
668
|
if (tmp0_safe_receiver == null) {
|
|
669
669
|
tmp_3 = null;
|
|
670
670
|
} else {
|
|
671
671
|
// Inline function 'kotlin.let' call
|
|
672
|
-
tmp_3 = Spacer_instance.
|
|
672
|
+
tmp_3 = Spacer_instance.sv(3) + 'body = serialization.deserializeBody(requireNotNull(request.body) { "body is null" }, typeOf<' + emit_16($this, tmp0_safe_receiver) + '>()),';
|
|
673
673
|
}
|
|
674
674
|
// Inline function 'kotlin.let' call
|
|
675
675
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
676
|
-
return isBlank(it) ? '' : '(\n' + it + '\n' + Spacer_instance.
|
|
676
|
+
return isBlank(it) ? '' : '(\n' + it + '\n' + Spacer_instance.sv(2) + ')';
|
|
677
677
|
}
|
|
678
678
|
function emitSerialized($this, _this__u8e3s4) {
|
|
679
|
-
return trimMargin('\n |' + Spacer_instance.
|
|
679
|
+
return trimMargin('\n |' + Spacer_instance.sv(3) + 'is Response' + _this__u8e3s4.rt_1 + ' -> Wirespec.RawResponse(\n |' + Spacer_instance.sv(4) + 'statusCode = response.status,\n |' + Spacer_instance.sv(4) + 'headers = ' + $this.p21(_this__u8e3s4) + ',\n |' + Spacer_instance.sv(4) + 'body = ' + (!(_this__u8e3s4.tt_1 == null) ? $this.o21($this, _this__u8e3s4.tt_1) : 'null') + ',\n |' + Spacer_instance.sv(3) + ')\n ');
|
|
680
680
|
}
|
|
681
681
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
682
|
-
var tmp = Spacer_instance.
|
|
682
|
+
var tmp = Spacer_instance.sv(3) + _this__u8e3s4.rt_1 + ' -> Response' + _this__u8e3s4.rt_1 + '(';
|
|
683
683
|
var tmp_0;
|
|
684
|
-
if (!(_this__u8e3s4.
|
|
685
|
-
tmp_0 = Spacer_instance.
|
|
684
|
+
if (!(_this__u8e3s4.tt_1 == null)) {
|
|
685
|
+
tmp_0 = Spacer_instance.sv(4) + 'body = serialization.deserializeBody(requireNotNull(response.body) { "body is null" }, typeOf<' + emit_16($this, _this__u8e3s4.tt_1) + '>()),';
|
|
686
686
|
} else {
|
|
687
|
-
tmp_0 = Spacer_instance.
|
|
687
|
+
tmp_0 = Spacer_instance.sv(4) + 'body = Unit,';
|
|
688
688
|
}
|
|
689
689
|
var tmp_1 = tmp_0;
|
|
690
|
-
return joinToString(listOfNotNull([tmp, tmp_1, orNull(joinToString(_this__u8e3s4.
|
|
690
|
+
return joinToString(listOfNotNull([tmp, tmp_1, orNull(joinToString(_this__u8e3s4.st_1, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserialized$lambda($this))), Spacer_instance.sv(3) + ')']), '\n');
|
|
691
691
|
}
|
|
692
692
|
function emitSerializedMapEntry($this, _this__u8e3s4, type, fields) {
|
|
693
|
-
return '"' + _this__u8e3s4.
|
|
693
|
+
return '"' + _this__u8e3s4.bt_1.m1() + '" to ' + type + '.' + fields + '.' + $this.yu(_this__u8e3s4.bt_1) + '?.let{ serialization.serializeParam(it, typeOf<' + $this.yt(_this__u8e3s4.ct_1) + '>()) }.orEmpty()';
|
|
694
694
|
}
|
|
695
695
|
function emitDeserialized_0($this, _this__u8e3s4) {
|
|
696
|
-
return Spacer_instance.
|
|
696
|
+
return Spacer_instance.sv(3) + $this.yu(_this__u8e3s4.lf_1.mt_1) + ' = serialization.deserializePath(request.path[' + _this__u8e3s4.kf_1 + '], typeOf<' + $this.yt(_this__u8e3s4.lf_1.nt_1) + '>())';
|
|
697
697
|
}
|
|
698
698
|
function emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive) {
|
|
699
|
-
var trimMargin_0 = trimMargin('\n |' + Spacer_instance.
|
|
699
|
+
var trimMargin_0 = trimMargin('\n |' + Spacer_instance.sv(spaces) + $this.yu(_this__u8e3s4.bt_1) + ' =\n |' + Spacer_instance.sv(spaces + 1 | 0) + type + '.' + fields + '\n |' + Spacer_instance.sv(spaces + 2 | 0) + '.entries\n |' + Spacer_instance.sv(spaces + 2 | 0) + '.find { it.key.equals("' + _this__u8e3s4.bt_1.m1() + '", ignoreCase = ' + !caseSensitive + ') }\n |' + Spacer_instance.sv(spaces + 2 | 0) + '?.let { serialization.deserializeParam(it.value, typeOf<' + $this.yt(_this__u8e3s4.ct_1) + '>()) }\n ');
|
|
700
700
|
var tmp;
|
|
701
|
-
if (_this__u8e3s4.
|
|
701
|
+
if (_this__u8e3s4.ct_1.ey()) {
|
|
702
702
|
tmp = trimMargin_0;
|
|
703
703
|
} else {
|
|
704
|
-
tmp = trimMargin_0 + '\n' + Spacer_instance.
|
|
704
|
+
tmp = trimMargin_0 + '\n' + Spacer_instance.sv(spaces + 2 | 0) + '?: throw IllegalArgumentException("' + $this.yu(_this__u8e3s4.bt_1) + ' is null")';
|
|
705
705
|
}
|
|
706
706
|
return tmp;
|
|
707
707
|
}
|
|
@@ -711,16 +711,16 @@ function emitDeserializedParams$default($this, _this__u8e3s4, type, fields, spac
|
|
|
711
711
|
return emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive);
|
|
712
712
|
}
|
|
713
713
|
function emitIdentifier($this, _this__u8e3s4) {
|
|
714
|
-
return 'request.path.' + $this.
|
|
714
|
+
return 'request.path.' + $this.yu(_this__u8e3s4.mt_1) + '.let{serialization.serializePath(it, typeOf<' + $this.yt(_this__u8e3s4.nt_1) + '>())}';
|
|
715
715
|
}
|
|
716
716
|
function emit_16($this, _this__u8e3s4) {
|
|
717
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
718
|
-
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : $this.
|
|
717
|
+
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.qt_1;
|
|
718
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : $this.yt(tmp1_safe_receiver);
|
|
719
719
|
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : removeQuestionMark(tmp2_safe_receiver);
|
|
720
720
|
return tmp3_elvis_lhs == null ? 'Unit' : tmp3_elvis_lhs;
|
|
721
721
|
}
|
|
722
722
|
function emit_17($this, _this__u8e3s4) {
|
|
723
|
-
return $this.
|
|
723
|
+
return $this.yu(_this__u8e3s4.mt_1) + ': ' + $this.yt(_this__u8e3s4.nt_1);
|
|
724
724
|
}
|
|
725
725
|
function brace($this, _this__u8e3s4) {
|
|
726
726
|
return wrap($this, _this__u8e3s4, '(', ')');
|
|
@@ -738,10 +738,10 @@ function wrap($this, _this__u8e3s4, prefix, postfix) {
|
|
|
738
738
|
function emitObject($this, _this__u8e3s4, name, extends_0, spaces, block) {
|
|
739
739
|
var tmp;
|
|
740
740
|
if (_this__u8e3s4.r()) {
|
|
741
|
-
tmp = Spacer_instance.
|
|
741
|
+
tmp = Spacer_instance.sv(spaces) + 'data object ' + name + ' : ' + extends_0;
|
|
742
742
|
} else {
|
|
743
|
-
var tmp_0 = Spacer_instance.
|
|
744
|
-
tmp = trimMargin('\n |' + tmp_0 + 'data class ' + name + '(\n |' + joinToString(_this__u8e3s4, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitObject$lambda(spaces, block)) + ',\n |' + Spacer_instance.
|
|
743
|
+
var tmp_0 = Spacer_instance.sv(spaces);
|
|
744
|
+
tmp = trimMargin('\n |' + tmp_0 + 'data class ' + name + '(\n |' + joinToString(_this__u8e3s4, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitObject$lambda(spaces, block)) + ',\n |' + Spacer_instance.sv(spaces) + ') : ' + extends_0 + '\n ');
|
|
745
745
|
}
|
|
746
746
|
return tmp;
|
|
747
747
|
}
|
|
@@ -760,17 +760,17 @@ function KotlinEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
|
760
760
|
}
|
|
761
761
|
function KotlinEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
762
762
|
return function (it) {
|
|
763
|
-
return this$0.
|
|
763
|
+
return this$0.xt(it);
|
|
764
764
|
};
|
|
765
765
|
}
|
|
766
766
|
function KotlinEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
767
767
|
return function (it) {
|
|
768
|
-
return this$0.
|
|
768
|
+
return this$0.xt(it);
|
|
769
769
|
};
|
|
770
770
|
}
|
|
771
771
|
function KotlinEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
772
772
|
return function (it) {
|
|
773
|
-
return this$0.
|
|
773
|
+
return this$0.r20(it);
|
|
774
774
|
};
|
|
775
775
|
}
|
|
776
776
|
function KotlinEndpointDefinitionEmitter$emit$lambda_4(this$0) {
|
|
@@ -787,31 +787,31 @@ function KotlinEndpointDefinitionEmitter$emit$lambda_6(it) {
|
|
|
787
787
|
return emit(it);
|
|
788
788
|
}
|
|
789
789
|
function KotlinEndpointDefinitionEmitter$emitStatusInterfaces$lambda(it) {
|
|
790
|
-
return Spacer_instance.toString() + 'sealed interface Response' + toString_0(it.
|
|
790
|
+
return Spacer_instance.toString() + 'sealed interface Response' + toString_0(it.i1_1) + 'XX<T: Any> : Response<T>';
|
|
791
791
|
}
|
|
792
792
|
function KotlinEndpointDefinitionEmitter$emitResponseInterfaces$lambda(it) {
|
|
793
793
|
return Spacer_instance.toString() + 'sealed interface Response' + concatGenerics(it) + ' : Response<' + it + '>';
|
|
794
794
|
}
|
|
795
795
|
function KotlinEndpointDefinitionEmitter$emit$lambda_7(this$0) {
|
|
796
796
|
return function (it) {
|
|
797
|
-
return this$0.
|
|
797
|
+
return this$0.yu(it.mt_1);
|
|
798
798
|
};
|
|
799
799
|
}
|
|
800
800
|
function KotlinEndpointDefinitionEmitter$emit$lambda_8(this$0) {
|
|
801
801
|
return function (it) {
|
|
802
|
-
return this$0.
|
|
802
|
+
return this$0.yu(it.bt_1);
|
|
803
803
|
};
|
|
804
804
|
}
|
|
805
805
|
function KotlinEndpointDefinitionEmitter$emit$lambda_9(this$0) {
|
|
806
806
|
return function (it) {
|
|
807
|
-
return this$0.
|
|
807
|
+
return this$0.yu(it.bt_1);
|
|
808
808
|
};
|
|
809
809
|
}
|
|
810
810
|
function KotlinEndpointDefinitionEmitter$emit$lambda_10(this$0) {
|
|
811
811
|
return function (it) {
|
|
812
812
|
var tmp;
|
|
813
813
|
if (it instanceof Literal) {
|
|
814
|
-
tmp = '"' + it.
|
|
814
|
+
tmp = '"' + it.iu_1 + '"';
|
|
815
815
|
} else {
|
|
816
816
|
if (it instanceof Param) {
|
|
817
817
|
tmp = emitIdentifier(this$0, it);
|
|
@@ -834,32 +834,32 @@ function KotlinEndpointDefinitionEmitter$emitQueries$lambda(this$0) {
|
|
|
834
834
|
}
|
|
835
835
|
function KotlinEndpointDefinitionEmitter$emit$lambda_11(this$0) {
|
|
836
836
|
return function (it) {
|
|
837
|
-
return 'val ' + this$0.
|
|
837
|
+
return 'val ' + this$0.xt(it);
|
|
838
838
|
};
|
|
839
839
|
}
|
|
840
840
|
function KotlinEndpointDefinitionEmitter$emit$lambda_12(this$0) {
|
|
841
841
|
return function (it) {
|
|
842
|
-
return this$0.
|
|
842
|
+
return this$0.yu(it.bt_1);
|
|
843
843
|
};
|
|
844
844
|
}
|
|
845
845
|
function KotlinEndpointDefinitionEmitter$emit$lambda_13(this$0) {
|
|
846
846
|
return function (it) {
|
|
847
|
-
return this$0.
|
|
847
|
+
return this$0.xt(it);
|
|
848
848
|
};
|
|
849
849
|
}
|
|
850
850
|
function KotlinEndpointDefinitionEmitter$emitConstructor$lambda(this$0) {
|
|
851
851
|
return function (it) {
|
|
852
|
-
return Spacer_instance.
|
|
852
|
+
return Spacer_instance.sv(2) + emit_17(this$0, it);
|
|
853
853
|
};
|
|
854
854
|
}
|
|
855
855
|
function KotlinEndpointDefinitionEmitter$emitConstructor$lambda_0(this$0) {
|
|
856
856
|
return function (it) {
|
|
857
|
-
return Spacer_instance.
|
|
857
|
+
return Spacer_instance.sv(2) + this$0.xt(it);
|
|
858
858
|
};
|
|
859
859
|
}
|
|
860
860
|
function KotlinEndpointDefinitionEmitter$emitConstructor$lambda_1(this$0) {
|
|
861
861
|
return function (it) {
|
|
862
|
-
return Spacer_instance.
|
|
862
|
+
return Spacer_instance.sv(2) + this$0.xt(it);
|
|
863
863
|
};
|
|
864
864
|
}
|
|
865
865
|
function KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda(this$0) {
|
|
@@ -889,7 +889,7 @@ function KotlinEndpointDefinitionEmitter$emitDeserialized$lambda(this$0) {
|
|
|
889
889
|
}
|
|
890
890
|
function KotlinEndpointDefinitionEmitter$emitObject$lambda($spaces, $block) {
|
|
891
891
|
return function (it) {
|
|
892
|
-
return Spacer_instance.
|
|
892
|
+
return Spacer_instance.sv($spaces + 1 | 0) + 'val ' + $block(it);
|
|
893
893
|
};
|
|
894
894
|
}
|
|
895
895
|
function KotlinEndpointDefinitionEmitter() {
|
|
@@ -898,18 +898,18 @@ function sanitizeNegative($this, _this__u8e3s4) {
|
|
|
898
898
|
return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
|
|
899
899
|
}
|
|
900
900
|
function sanitizeEnum($this, _this__u8e3s4) {
|
|
901
|
-
return $this.
|
|
901
|
+
return $this.s20(joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_'));
|
|
902
902
|
}
|
|
903
903
|
function KotlinEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
904
904
|
return function (it) {
|
|
905
|
-
return this$0.
|
|
905
|
+
return this$0.t20(sanitizeEnum(this$0, it)) + '("' + it + '")';
|
|
906
906
|
};
|
|
907
907
|
}
|
|
908
908
|
function KotlinEnumDefinitionEmitter() {
|
|
909
909
|
}
|
|
910
910
|
function Companion() {
|
|
911
911
|
Companion_instance_2 = this;
|
|
912
|
-
this.
|
|
912
|
+
this.q21_1 = setOf(['as', 'break', 'class', 'continue', 'do', 'else', 'false', 'for', 'fun', 'if', 'in', 'interface', 'internal', 'is', 'null', 'object', 'open', 'package', 'return', 'super', 'this', 'throw', 'true', 'try', 'typealias', 'typeof', 'val', 'var', 'when', 'while', 'private', 'public']);
|
|
913
913
|
}
|
|
914
914
|
var Companion_instance_2;
|
|
915
915
|
function Companion_getInstance_0() {
|
|
@@ -918,27 +918,27 @@ function Companion_getInstance_0() {
|
|
|
918
918
|
return Companion_instance_2;
|
|
919
919
|
}
|
|
920
920
|
function KotlinIdentifierEmitter$sanitize$lambda(it) {
|
|
921
|
-
return isLetterOrDigit(it.
|
|
921
|
+
return isLetterOrDigit(it.i1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).v1(it);
|
|
922
922
|
}
|
|
923
923
|
function KotlinIdentifierEmitter() {
|
|
924
924
|
}
|
|
925
925
|
function _get_sanitizationConfig__sns434($this) {
|
|
926
|
-
var tmp0 = $this.
|
|
926
|
+
var tmp0 = $this.w21_1;
|
|
927
927
|
var tmp = KProperty1;
|
|
928
928
|
// Inline function 'kotlin.getValue' call
|
|
929
929
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, KotlinIrEmitter$_get_sanitizationConfig_$ref_tnafwf(), null);
|
|
930
|
-
return tmp0.
|
|
930
|
+
return tmp0.m1();
|
|
931
931
|
}
|
|
932
932
|
function _get_modelSanitizationConfig__vgg831($this) {
|
|
933
|
-
var tmp0 = $this.
|
|
933
|
+
var tmp0 = $this.x21_1;
|
|
934
934
|
var tmp = KProperty1;
|
|
935
935
|
// Inline function 'kotlin.getValue' call
|
|
936
936
|
getPropertyCallableRef('modelSanitizationConfig', 1, tmp, KotlinIrEmitter$_get_modelSanitizationConfig_$ref_iulb4s(), null);
|
|
937
|
-
return tmp0.
|
|
937
|
+
return tmp0.m1();
|
|
938
938
|
}
|
|
939
939
|
function sanitize_0($this, _this__u8e3s4) {
|
|
940
940
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
941
|
-
var this_0 = split(_this__u8e3s4.
|
|
941
|
+
var this_0 = split(_this__u8e3s4.m1(), ['.', ' ']);
|
|
942
942
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
943
943
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
944
944
|
var index = 0;
|
|
@@ -947,8 +947,8 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
947
947
|
var item = _iterator__ex2g4s.v();
|
|
948
948
|
var _unary__edvuaz = index;
|
|
949
949
|
index = _unary__edvuaz + 1 | 0;
|
|
950
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
951
|
-
destination.
|
|
950
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.pu(item) : item;
|
|
951
|
+
destination.y(tmp$ret$0);
|
|
952
952
|
}
|
|
953
953
|
// Inline function 'kotlin.text.filter' call
|
|
954
954
|
var tmp0 = joinToString(destination, '');
|
|
@@ -995,7 +995,7 @@ function sanitizeFirstIsDigit_0($this, _this__u8e3s4) {
|
|
|
995
995
|
return tmp;
|
|
996
996
|
}
|
|
997
997
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
998
|
-
return Companion_getInstance_1().
|
|
998
|
+
return Companion_getInstance_1().y21_1.v1(_this__u8e3s4) ? addBackticks(_this__u8e3s4) : _this__u8e3s4;
|
|
999
999
|
}
|
|
1000
1000
|
function sanitizeSymbol($this, _this__u8e3s4) {
|
|
1001
1001
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
@@ -1008,8 +1008,8 @@ function sanitizeSymbol($this, _this__u8e3s4) {
|
|
|
1008
1008
|
var item = _iterator__ex2g4s.v();
|
|
1009
1009
|
var _unary__edvuaz = index;
|
|
1010
1010
|
index = _unary__edvuaz + 1 | 0;
|
|
1011
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
1012
|
-
destination.
|
|
1011
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.pu(item) : item;
|
|
1012
|
+
destination.y(tmp$ret$0);
|
|
1013
1013
|
}
|
|
1014
1014
|
// Inline function 'kotlin.text.filter' call
|
|
1015
1015
|
var tmp0 = joinToString(destination, '');
|
|
@@ -1068,7 +1068,7 @@ function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
|
1068
1068
|
}
|
|
1069
1069
|
function Companion_0() {
|
|
1070
1070
|
Companion_instance_3 = this;
|
|
1071
|
-
this.
|
|
1071
|
+
this.y21_1 = setOf(['as', 'break', 'class', 'continue', 'do', 'else', 'false', 'for', 'fun', 'if', 'in', 'interface', 'internal', 'is', 'null', 'object', 'open', 'package', 'return', 'super', 'this', 'throw', 'true', 'try', 'typealias', 'typeof', 'val', 'var', 'when', 'while', 'private', 'public']);
|
|
1072
1072
|
}
|
|
1073
1073
|
var Companion_instance_3;
|
|
1074
1074
|
function Companion_getInstance_1() {
|
|
@@ -1081,13 +1081,13 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
1081
1081
|
}
|
|
1082
1082
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1083
1083
|
return function (name) {
|
|
1084
|
-
var sanitized = name.
|
|
1084
|
+
var sanitized = name.w1k_1.b1() > 1 ? name.b1q() : sanitizeSymbol(this$0, name.u1m());
|
|
1085
1085
|
return new Name(listOf(sanitized));
|
|
1086
1086
|
};
|
|
1087
1087
|
}
|
|
1088
1088
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0) {
|
|
1089
1089
|
return function (name) {
|
|
1090
|
-
return new Name(listOf(sanitizeSymbol(this$0, name.
|
|
1090
|
+
return new Name(listOf(sanitizeSymbol(this$0, name.b1q())));
|
|
1091
1091
|
};
|
|
1092
1092
|
}
|
|
1093
1093
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(this$0) {
|
|
@@ -1100,29 +1100,29 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1100
1100
|
var tmp;
|
|
1101
1101
|
var tmp_0;
|
|
1102
1102
|
if (stmt instanceof FunctionCall) {
|
|
1103
|
-
tmp_0 = stmt.
|
|
1103
|
+
tmp_0 = stmt.l1q_1.u1m() === 'validate';
|
|
1104
1104
|
} else {
|
|
1105
1105
|
tmp_0 = false;
|
|
1106
1106
|
}
|
|
1107
1107
|
if (tmp_0) {
|
|
1108
|
-
tmp = transformChildren(stmt.
|
|
1108
|
+
tmp = transformChildren(stmt.p1q(VOID, emptyList()), tr);
|
|
1109
1109
|
} else {
|
|
1110
1110
|
if (stmt instanceof ConstructorStatement) {
|
|
1111
|
-
var tmp_1 = tr.
|
|
1111
|
+
var tmp_1 = tr.j1y(stmt.d1r_1);
|
|
1112
1112
|
// Inline function 'kotlin.collections.map' call
|
|
1113
|
-
var this_0 = stmt.
|
|
1113
|
+
var this_0 = stmt.e1r_1;
|
|
1114
1114
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1115
|
-
var destination = ArrayList_init_$Create$(this_0.
|
|
1115
|
+
var destination = ArrayList_init_$Create$(this_0.b1());
|
|
1116
1116
|
// Inline function 'kotlin.collections.iterator' call
|
|
1117
|
-
var _iterator__ex2g4s = this_0.
|
|
1117
|
+
var _iterator__ex2g4s = this_0.k1().t();
|
|
1118
1118
|
while (_iterator__ex2g4s.u()) {
|
|
1119
1119
|
var item = _iterator__ex2g4s.v();
|
|
1120
1120
|
// Inline function 'kotlin.collections.component1' call
|
|
1121
|
-
var name = item.
|
|
1121
|
+
var name = item.l1();
|
|
1122
1122
|
// Inline function 'kotlin.collections.component2' call
|
|
1123
|
-
var expr = item.
|
|
1124
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), name), tr.
|
|
1125
|
-
destination.
|
|
1123
|
+
var expr = item.m1();
|
|
1124
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), name), tr.m1y(expr));
|
|
1125
|
+
destination.y(tmp$ret$3);
|
|
1126
1126
|
}
|
|
1127
1127
|
tmp = new ConstructorStatement(tmp_1, toMap(destination));
|
|
1128
1128
|
} else {
|
|
@@ -1134,7 +1134,7 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1134
1134
|
}
|
|
1135
1135
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1136
1136
|
return function () {
|
|
1137
|
-
var tmp = Companion_getInstance_1().
|
|
1137
|
+
var tmp = Companion_getInstance_1().y21_1;
|
|
1138
1138
|
var tmp_0 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1139
1139
|
var tmp_1 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
|
|
1140
1140
|
var tmp_2 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
|
|
@@ -1148,7 +1148,7 @@ function KotlinIrEmitter$_get_sanitizationConfig_$ref_tnafwf() {
|
|
|
1148
1148
|
};
|
|
1149
1149
|
}
|
|
1150
1150
|
function KotlinIrEmitter$modelSanitizationConfig$delegate$lambda$lambda(name) {
|
|
1151
|
-
return new Name(listOf(name.
|
|
1151
|
+
return new Name(listOf(name.u1m()));
|
|
1152
1152
|
}
|
|
1153
1153
|
function KotlinIrEmitter$modelSanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1154
1154
|
return function (it) {
|
|
@@ -1159,7 +1159,7 @@ function KotlinIrEmitter$modelSanitizationConfig$delegate$lambda(this$0) {
|
|
|
1159
1159
|
return function () {
|
|
1160
1160
|
var tmp = _get_sanitizationConfig__sns434(this$0);
|
|
1161
1161
|
var tmp_0 = KotlinIrEmitter$modelSanitizationConfig$delegate$lambda$lambda;
|
|
1162
|
-
return tmp.
|
|
1162
|
+
return tmp.c20(VOID, VOID, tmp_0, VOID, KotlinIrEmitter$modelSanitizationConfig$delegate$lambda$lambda_0(this$0));
|
|
1163
1163
|
};
|
|
1164
1164
|
}
|
|
1165
1165
|
function KotlinIrEmitter$_get_modelSanitizationConfig_$ref_iulb4s() {
|
|
@@ -1171,22 +1171,22 @@ function KotlinIrEmitter$emitShared$lambda(element, transformer) {
|
|
|
1171
1171
|
var tmp;
|
|
1172
1172
|
if (element instanceof File) {
|
|
1173
1173
|
// Inline function 'kotlin.collections.partition' call
|
|
1174
|
-
var this_0 = element.
|
|
1174
|
+
var this_0 = element.h1r_1;
|
|
1175
1175
|
var first = ArrayList_init_$Create$_0();
|
|
1176
1176
|
var second = ArrayList_init_$Create$_0();
|
|
1177
1177
|
var _iterator__ex2g4s = this_0.t();
|
|
1178
1178
|
while (_iterator__ex2g4s.u()) {
|
|
1179
1179
|
var element_0 = _iterator__ex2g4s.v();
|
|
1180
1180
|
if (element_0 instanceof Package) {
|
|
1181
|
-
first.
|
|
1181
|
+
first.y(element_0);
|
|
1182
1182
|
} else {
|
|
1183
|
-
second.
|
|
1183
|
+
second.y(element_0);
|
|
1184
1184
|
}
|
|
1185
1185
|
}
|
|
1186
1186
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1187
|
-
var packageElements = _destruct__k2r9zo.
|
|
1188
|
-
var rest = _destruct__k2r9zo.
|
|
1189
|
-
tmp = element.
|
|
1187
|
+
var packageElements = _destruct__k2r9zo.mf();
|
|
1188
|
+
var rest = _destruct__k2r9zo.nf();
|
|
1189
|
+
tmp = element.k1r(VOID, plus_2(plus_1(packageElements, import_0('kotlin.reflect', 'KType')), rest));
|
|
1190
1190
|
} else {
|
|
1191
1191
|
tmp = element;
|
|
1192
1192
|
}
|
|
@@ -1197,11 +1197,11 @@ function KotlinIrEmitter$emitShared$lambda_0($clientServer) {
|
|
|
1197
1197
|
return function (element, transformer) {
|
|
1198
1198
|
var tmp;
|
|
1199
1199
|
if (element instanceof Namespace) {
|
|
1200
|
-
var injected = element.
|
|
1200
|
+
var injected = element.m1r_1.equals(Companion_getInstance().y1k('Wirespec')) ? $clientServer : emptyList();
|
|
1201
1201
|
var tmp_0;
|
|
1202
1202
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1203
1203
|
if (!injected.r()) {
|
|
1204
|
-
tmp_0 = withElements(element, plus_2(element.
|
|
1204
|
+
tmp_0 = withElements(element, plus_2(element.i1r(), injected));
|
|
1205
1205
|
} else {
|
|
1206
1206
|
tmp_0 = element;
|
|
1207
1207
|
}
|
|
@@ -1226,7 +1226,7 @@ function KotlinIrEmitter$emitGenerator$lambda_1(it) {
|
|
|
1226
1226
|
}
|
|
1227
1227
|
function KotlinIrEmitter$emitGenerator$lambda_2(this$0) {
|
|
1228
1228
|
return function (it) {
|
|
1229
|
-
return import_0(this$0.
|
|
1229
|
+
return import_0(this$0.d20().ov_1 + '.model', it);
|
|
1230
1230
|
};
|
|
1231
1231
|
}
|
|
1232
1232
|
function KotlinIrEmitter$emit$lambda(this$0) {
|
|
@@ -1236,29 +1236,29 @@ function KotlinIrEmitter$emit$lambda(this$0) {
|
|
|
1236
1236
|
}
|
|
1237
1237
|
function KotlinIrEmitter(packageName, emitShared) {
|
|
1238
1238
|
Companion_getInstance_1();
|
|
1239
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
1240
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
1241
|
-
this.
|
|
1242
|
-
this.
|
|
1243
|
-
this.
|
|
1244
|
-
this.
|
|
1245
|
-
this.
|
|
1239
|
+
packageName = packageName === VOID ? Companion_instance.nv('community.flock.wirespec.generated') : packageName;
|
|
1240
|
+
emitShared = emitShared === VOID ? Companion_instance_0.hs() : emitShared;
|
|
1241
|
+
this.r21_1 = packageName;
|
|
1242
|
+
this.s21_1 = emitShared;
|
|
1243
|
+
this.t21_1 = KotlinGenerator_instance;
|
|
1244
|
+
this.u21_1 = FileExtension_Kotlin_getInstance();
|
|
1245
|
+
this.v21_1 = listOf_0([import_0('community.flock.wirespec.kotlin', 'Wirespec'), import_0('kotlin.reflect', 'typeOf')]);
|
|
1246
1246
|
var tmp = this;
|
|
1247
|
-
tmp.
|
|
1247
|
+
tmp.w21_1 = lazy(KotlinIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1248
1248
|
var tmp_0 = this;
|
|
1249
|
-
tmp_0.
|
|
1249
|
+
tmp_0.x21_1 = lazy(KotlinIrEmitter$modelSanitizationConfig$delegate$lambda(this));
|
|
1250
1250
|
}
|
|
1251
|
-
protoOf(KotlinIrEmitter).
|
|
1252
|
-
return this.
|
|
1251
|
+
protoOf(KotlinIrEmitter).d20 = function () {
|
|
1252
|
+
return this.r21_1;
|
|
1253
1253
|
};
|
|
1254
|
-
protoOf(KotlinIrEmitter).
|
|
1255
|
-
return this.
|
|
1254
|
+
protoOf(KotlinIrEmitter).e1z = function () {
|
|
1255
|
+
return this.t21_1;
|
|
1256
1256
|
};
|
|
1257
|
-
protoOf(KotlinIrEmitter).
|
|
1258
|
-
return this.
|
|
1257
|
+
protoOf(KotlinIrEmitter).fu = function () {
|
|
1258
|
+
return this.u21_1;
|
|
1259
1259
|
};
|
|
1260
|
-
protoOf(KotlinIrEmitter).
|
|
1261
|
-
var packageName = Companion_instance.
|
|
1260
|
+
protoOf(KotlinIrEmitter).h1z = function () {
|
|
1261
|
+
var packageName = Companion_instance.nv('community.flock.wirespec.kotlin');
|
|
1262
1262
|
var clientServer = convertClientServer(packageName);
|
|
1263
1263
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1264
1264
|
var this_0 = convert(packageName);
|
|
@@ -1266,48 +1266,48 @@ protoOf(KotlinIrEmitter).v1v = function () {
|
|
|
1266
1266
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1267
1267
|
var tmp = scope;
|
|
1268
1268
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1269
|
-
var this_1 = scope.
|
|
1269
|
+
var this_1 = scope.r1y_1;
|
|
1270
1270
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1271
1271
|
// Inline function 'kotlin.apply' call
|
|
1272
1272
|
var this_2 = new TransformerBuilder();
|
|
1273
|
-
this_2.
|
|
1274
|
-
var tmp$ret$2 = this_2.
|
|
1275
|
-
tmp.
|
|
1273
|
+
this_2.i1m(KotlinIrEmitter$emitShared$lambda);
|
|
1274
|
+
var tmp$ret$2 = this_2.j1m();
|
|
1275
|
+
tmp.r1y_1 = transform(this_1, tmp$ret$2);
|
|
1276
1276
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1277
1277
|
var tmp_0 = scope;
|
|
1278
1278
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1279
1279
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1280
|
-
var this_3 = scope.
|
|
1280
|
+
var this_3 = scope.r1y_1;
|
|
1281
1281
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1282
1282
|
// Inline function 'kotlin.apply' call
|
|
1283
1283
|
var this_4 = new TransformerBuilder();
|
|
1284
|
-
this_4.
|
|
1285
|
-
var tmp$ret$7 = this_4.
|
|
1286
|
-
tmp_0.
|
|
1287
|
-
var tmp_1 = scope.
|
|
1284
|
+
this_4.i1m(KotlinIrEmitter$emitShared$lambda_0(clientServer));
|
|
1285
|
+
var tmp$ret$7 = this_4.j1m();
|
|
1286
|
+
tmp_0.r1y_1 = transform(this_3, tmp$ret$7);
|
|
1287
|
+
var tmp_1 = scope.r1y_1;
|
|
1288
1288
|
var wirespecShared = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1289
1289
|
var tmp_2;
|
|
1290
|
-
if (this.
|
|
1290
|
+
if (this.s21_1.is_1) {
|
|
1291
1291
|
tmp_2 = wirespecShared;
|
|
1292
1292
|
} else {
|
|
1293
1293
|
tmp_2 = null;
|
|
1294
1294
|
}
|
|
1295
1295
|
return tmp_2;
|
|
1296
1296
|
};
|
|
1297
|
-
protoOf(KotlinIrEmitter).
|
|
1297
|
+
protoOf(KotlinIrEmitter).wu = function (definition, module_0, logger) {
|
|
1298
1298
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1299
1299
|
// Inline function 'kotlin.takeIf' call
|
|
1300
|
-
var this_0 = this.
|
|
1300
|
+
var this_0 = this.v21_1;
|
|
1301
1301
|
var tmp;
|
|
1302
|
-
if (Companion_instance_1.
|
|
1302
|
+
if (Companion_instance_1.su(module_0)) {
|
|
1303
1303
|
tmp = this_0;
|
|
1304
1304
|
} else {
|
|
1305
1305
|
tmp = null;
|
|
1306
1306
|
}
|
|
1307
1307
|
var tmp$ret$1 = tmp;
|
|
1308
|
-
return placeInPackage(prependImports(file, tmp$ret$1), this.
|
|
1308
|
+
return placeInPackage(prependImports(file, tmp$ret$1), this.d20(), definition);
|
|
1309
1309
|
};
|
|
1310
|
-
protoOf(KotlinIrEmitter).
|
|
1310
|
+
protoOf(KotlinIrEmitter).l1z = function (definition, module_0) {
|
|
1311
1311
|
var tmp;
|
|
1312
1312
|
if (definition instanceof Type) {
|
|
1313
1313
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1328,60 +1328,60 @@ protoOf(KotlinIrEmitter).z1v = function (definition, module_0) {
|
|
|
1328
1328
|
}
|
|
1329
1329
|
var generatorFile = tmp;
|
|
1330
1330
|
var sanitized = sanitizeNames(generatorFile, _get_sanitizationConfig__sns434(this));
|
|
1331
|
-
var generatorOwnName = definition.
|
|
1331
|
+
var generatorOwnName = definition.xu().m1() + 'Generator';
|
|
1332
1332
|
var tmp_0 = asSequence_0(collectCustomTypeNames(sanitized));
|
|
1333
1333
|
var tmp_1 = filterNot(tmp_0, KotlinIrEmitter$emitGenerator$lambda);
|
|
1334
1334
|
var tmp_2 = filterNot(tmp_1, KotlinIrEmitter$emitGenerator$lambda_0(generatorOwnName));
|
|
1335
1335
|
var tmp_3 = distinct_0(map(tmp_2, KotlinIrEmitter$emitGenerator$lambda_1));
|
|
1336
1336
|
var modelImports = toList(map(tmp_3, KotlinIrEmitter$emitGenerator$lambda_2(this)));
|
|
1337
|
-
return placeInPackage_0(prependImports(sanitized, plus_2(this.
|
|
1337
|
+
return placeInPackage_0(prependImports(sanitized, plus_2(this.v21_1, modelImports)), this.d20(), 'generator');
|
|
1338
1338
|
};
|
|
1339
|
-
protoOf(KotlinIrEmitter).
|
|
1339
|
+
protoOf(KotlinIrEmitter).vt = function (type, module_0) {
|
|
1340
1340
|
return ensureEmptyStructHasConstructor(sanitizeNames(convertWithValidation(type, module_0), _get_modelSanitizationConfig__vgg831(this)));
|
|
1341
1341
|
};
|
|
1342
|
-
protoOf(KotlinIrEmitter).
|
|
1342
|
+
protoOf(KotlinIrEmitter).kv = function (enum_0, module_0) {
|
|
1343
1343
|
var tmp = sanitizeNames(convert_0(enum_0), _get_sanitizationConfig__sns434(this));
|
|
1344
1344
|
return injectEnumLabelField(tmp, KotlinIrEmitter$emit$lambda(this));
|
|
1345
1345
|
};
|
|
1346
|
-
protoOf(KotlinIrEmitter).
|
|
1346
|
+
protoOf(KotlinIrEmitter).av = function (union) {
|
|
1347
1347
|
return sanitizeNames(convert_1(union), _get_sanitizationConfig__sns434(this));
|
|
1348
1348
|
};
|
|
1349
|
-
protoOf(KotlinIrEmitter).
|
|
1349
|
+
protoOf(KotlinIrEmitter).fv = function (refined) {
|
|
1350
1350
|
var file = sanitizeNames(convert_2(refined), _get_sanitizationConfig__sns434(this));
|
|
1351
1351
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1352
1352
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1353
|
-
var tmp0 = file.
|
|
1353
|
+
var tmp0 = file.i1r();
|
|
1354
1354
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1355
1355
|
var destination = ArrayList_init_$Create$_0();
|
|
1356
1356
|
var _iterator__ex2g4s = tmp0.t();
|
|
1357
1357
|
while (_iterator__ex2g4s.u()) {
|
|
1358
1358
|
var element = _iterator__ex2g4s.v();
|
|
1359
1359
|
if (element instanceof Struct) {
|
|
1360
|
-
destination.
|
|
1360
|
+
destination.y(element);
|
|
1361
1361
|
}
|
|
1362
1362
|
}
|
|
1363
1363
|
var tmp0_safe_receiver = firstOrNull_0(destination);
|
|
1364
1364
|
var updatedStruct = tmp0_safe_receiver == null ? null : markMembersAsOverride(tmp0_safe_receiver);
|
|
1365
|
-
return new File(Companion_getInstance().
|
|
1365
|
+
return new File(Companion_getInstance().y1k(sanitize_0(this, refined.dv_1)), listOfNotNull_0(updatedStruct));
|
|
1366
1366
|
};
|
|
1367
|
-
protoOf(KotlinIrEmitter).
|
|
1368
|
-
var imports = buildModelImports(endpoint, this.
|
|
1367
|
+
protoOf(KotlinIrEmitter).lv = function (endpoint) {
|
|
1368
|
+
var imports = buildModelImports(endpoint, this.d20());
|
|
1369
1369
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1370
1370
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1371
|
-
var tmp0 = convert_3(endpoint).
|
|
1371
|
+
var tmp0 = convert_3(endpoint).i1r();
|
|
1372
1372
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1373
1373
|
var destination = ArrayList_init_$Create$_0();
|
|
1374
1374
|
var _iterator__ex2g4s = tmp0.t();
|
|
1375
1375
|
while (_iterator__ex2g4s.u()) {
|
|
1376
1376
|
var element = _iterator__ex2g4s.v();
|
|
1377
1377
|
if (element instanceof Namespace) {
|
|
1378
|
-
destination.
|
|
1378
|
+
destination.y(element);
|
|
1379
1379
|
}
|
|
1380
1380
|
}
|
|
1381
1381
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1382
1382
|
var endpointNamespace = ensureNotNull(tmp$ret$2);
|
|
1383
1383
|
var body = injectApiAlias(injectCompanionObject(endpointNamespace, endpoint));
|
|
1384
|
-
var tmp = sanitizeNames(new File(Companion_getInstance().
|
|
1384
|
+
var tmp = sanitizeNames(new File(Companion_getInstance().y1k(sanitize_0(this, endpoint.ft_1)), listOf(body)), _get_sanitizationConfig__sns434(this));
|
|
1385
1385
|
// Inline function 'kotlin.takeIf' call
|
|
1386
1386
|
var tmp_0;
|
|
1387
1387
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
@@ -1393,10 +1393,10 @@ protoOf(KotlinIrEmitter).as = function (endpoint) {
|
|
|
1393
1393
|
var tmp$ret$5 = tmp_0;
|
|
1394
1394
|
return prependImports(tmp, tmp$ret$5);
|
|
1395
1395
|
};
|
|
1396
|
-
protoOf(KotlinIrEmitter).
|
|
1396
|
+
protoOf(KotlinIrEmitter).zu = function (channel) {
|
|
1397
1397
|
var tmp = sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1398
1398
|
// Inline function 'kotlin.takeIf' call
|
|
1399
|
-
var this_0 = buildModelImports(channel, this.
|
|
1399
|
+
var this_0 = buildModelImports(channel, this.d20());
|
|
1400
1400
|
var tmp_0;
|
|
1401
1401
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1402
1402
|
if (!this_0.r()) {
|
|
@@ -1407,25 +1407,25 @@ protoOf(KotlinIrEmitter).or = function (channel) {
|
|
|
1407
1407
|
var tmp$ret$2 = tmp_0;
|
|
1408
1408
|
return prependImports(tmp, tmp$ret$2);
|
|
1409
1409
|
};
|
|
1410
|
-
protoOf(KotlinIrEmitter).
|
|
1411
|
-
var imports = buildModelImports(endpoint, this.
|
|
1412
|
-
var endpointImport = import_0(this.
|
|
1410
|
+
protoOf(KotlinIrEmitter).k1z = function (endpoint) {
|
|
1411
|
+
var imports = buildModelImports(endpoint, this.d20());
|
|
1412
|
+
var endpointImport = import_0(this.d20().ov_1 + '.endpoint', endpoint.ft_1.m1());
|
|
1413
1413
|
var file = sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this));
|
|
1414
|
-
var subPackageName = plus_0(this.
|
|
1415
|
-
var tmp = Companion_getInstance().
|
|
1414
|
+
var subPackageName = plus_0(this.d20(), 'client');
|
|
1415
|
+
var tmp = Companion_getInstance().y1k(subPackageName.qv() + file.g1r_1.z1k());
|
|
1416
1416
|
// Inline function 'kotlin.collections.buildList' call
|
|
1417
1417
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1418
1418
|
// Inline function 'kotlin.apply' call
|
|
1419
1419
|
var this_0 = ArrayList_init_$Create$_0();
|
|
1420
|
-
this_0.
|
|
1421
|
-
this_0.
|
|
1422
|
-
this_0.
|
|
1423
|
-
this_0.
|
|
1424
|
-
this_0.
|
|
1425
|
-
var tmp$ret$3 = this_0.
|
|
1420
|
+
this_0.y(new Package(subPackageName.ov_1));
|
|
1421
|
+
this_0.g1(this.v21_1);
|
|
1422
|
+
this_0.g1(imports);
|
|
1423
|
+
this_0.y(endpointImport);
|
|
1424
|
+
this_0.g1(file.h1r_1);
|
|
1425
|
+
var tmp$ret$3 = this_0.p5();
|
|
1426
1426
|
return new File(tmp, tmp$ret$3);
|
|
1427
1427
|
};
|
|
1428
|
-
protoOf(KotlinIrEmitter).
|
|
1428
|
+
protoOf(KotlinIrEmitter).i1z = function (endpoints, logger) {
|
|
1429
1429
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1430
1430
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1431
1431
|
var destination = ArrayList_init_$Create$_0();
|
|
@@ -1441,9 +1441,9 @@ protoOf(KotlinIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1441
1441
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1442
1442
|
while (_iterator__ex2g4s_0.u()) {
|
|
1443
1443
|
var e = _iterator__ex2g4s_0.v();
|
|
1444
|
-
var key = e.
|
|
1445
|
-
if (set.
|
|
1446
|
-
list_0.
|
|
1444
|
+
var key = e.my_1;
|
|
1445
|
+
if (set.y(key)) {
|
|
1446
|
+
list_0.y(e);
|
|
1447
1447
|
}
|
|
1448
1448
|
}
|
|
1449
1449
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1452,8 +1452,8 @@ protoOf(KotlinIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1452
1452
|
var _iterator__ex2g4s_1 = list_0.t();
|
|
1453
1453
|
while (_iterator__ex2g4s_1.u()) {
|
|
1454
1454
|
var item = _iterator__ex2g4s_1.v();
|
|
1455
|
-
var tmp$ret$5 = import_0(this.
|
|
1456
|
-
destination_0.
|
|
1455
|
+
var tmp$ret$5 = import_0(this.d20().ov_1 + '.model', item.my_1);
|
|
1456
|
+
destination_0.y(tmp$ret$5);
|
|
1457
1457
|
}
|
|
1458
1458
|
var imports = destination_0;
|
|
1459
1459
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1462,8 +1462,8 @@ protoOf(KotlinIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1462
1462
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1463
1463
|
while (_iterator__ex2g4s_2.u()) {
|
|
1464
1464
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
1465
|
-
var tmp$ret$8 = import_0(this.
|
|
1466
|
-
destination_1.
|
|
1465
|
+
var tmp$ret$8 = import_0(this.d20().ov_1 + '.endpoint', item_0.ft_1.m1());
|
|
1466
|
+
destination_1.y(tmp$ret$8);
|
|
1467
1467
|
}
|
|
1468
1468
|
var endpointImports = destination_1;
|
|
1469
1469
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1472,22 +1472,22 @@ protoOf(KotlinIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1472
1472
|
var _iterator__ex2g4s_3 = endpoints.t();
|
|
1473
1473
|
while (_iterator__ex2g4s_3.u()) {
|
|
1474
1474
|
var item_1 = _iterator__ex2g4s_3.v();
|
|
1475
|
-
var tmp$ret$11 = import_0(this.
|
|
1476
|
-
destination_2.
|
|
1475
|
+
var tmp$ret$11 = import_0(this.d20().ov_1 + '.client', item_1.ft_1.m1() + 'Client');
|
|
1476
|
+
destination_2.y(tmp$ret$11);
|
|
1477
1477
|
}
|
|
1478
1478
|
var clientImports = destination_2;
|
|
1479
1479
|
var allImports = plus_2(plus_2(imports, endpointImports), clientImports);
|
|
1480
1480
|
var file = sanitizeNames(emitClient.call(this, endpoints, logger), _get_sanitizationConfig__sns434(this));
|
|
1481
|
-
var tmp = Companion_getInstance().
|
|
1481
|
+
var tmp = Companion_getInstance().y1k(this.d20().qv() + file.g1r_1.z1k());
|
|
1482
1482
|
// Inline function 'kotlin.collections.buildList' call
|
|
1483
1483
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1484
1484
|
// Inline function 'kotlin.apply' call
|
|
1485
1485
|
var this_0 = ArrayList_init_$Create$_0();
|
|
1486
|
-
this_0.
|
|
1487
|
-
this_0.
|
|
1488
|
-
this_0.
|
|
1489
|
-
this_0.
|
|
1490
|
-
var tmp$ret$17 = this_0.
|
|
1486
|
+
this_0.y(new Package(this.d20().ov_1));
|
|
1487
|
+
this_0.g1(this.v21_1);
|
|
1488
|
+
this_0.g1(allImports);
|
|
1489
|
+
this_0.g1(file.h1r_1);
|
|
1490
|
+
var tmp$ret$17 = this_0.p5();
|
|
1491
1491
|
return new File(tmp, tmp$ret$17);
|
|
1492
1492
|
};
|
|
1493
1493
|
function buildModelImports(_this__u8e3s4, packageName) {
|
|
@@ -1498,9 +1498,9 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1498
1498
|
var _iterator__ex2g4s = this_0.t();
|
|
1499
1499
|
while (_iterator__ex2g4s.u()) {
|
|
1500
1500
|
var e = _iterator__ex2g4s.v();
|
|
1501
|
-
var key = e.
|
|
1502
|
-
if (set.
|
|
1503
|
-
list.
|
|
1501
|
+
var key = e.my_1;
|
|
1502
|
+
if (set.y(key)) {
|
|
1503
|
+
list.y(e);
|
|
1504
1504
|
}
|
|
1505
1505
|
}
|
|
1506
1506
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1509,8 +1509,8 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1509
1509
|
var _iterator__ex2g4s_0 = list.t();
|
|
1510
1510
|
while (_iterator__ex2g4s_0.u()) {
|
|
1511
1511
|
var item = _iterator__ex2g4s_0.v();
|
|
1512
|
-
var tmp$ret$2 = import_0(packageName.
|
|
1513
|
-
destination.
|
|
1512
|
+
var tmp$ret$2 = import_0(packageName.ov_1 + '.model', Companion_getInstance().y1k(item.my_1).z1k());
|
|
1513
|
+
destination.y(tmp$ret$2);
|
|
1514
1514
|
}
|
|
1515
1515
|
return destination;
|
|
1516
1516
|
}
|
|
@@ -1521,14 +1521,14 @@ function injectApiAlias(_this__u8e3s4) {
|
|
|
1521
1521
|
var tmp = scope;
|
|
1522
1522
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1523
1523
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1524
|
-
var this_0 = scope.
|
|
1524
|
+
var this_0 = scope.r1y_1;
|
|
1525
1525
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1526
1526
|
// Inline function 'kotlin.apply' call
|
|
1527
1527
|
var this_1 = new TransformerBuilder();
|
|
1528
|
-
this_1.
|
|
1529
|
-
var tmp$ret$2 = this_1.
|
|
1530
|
-
tmp.
|
|
1531
|
-
var tmp_0 = scope.
|
|
1528
|
+
this_1.i1m(injectApiAlias$lambda);
|
|
1529
|
+
var tmp$ret$2 = this_1.j1m();
|
|
1530
|
+
tmp.r1y_1 = transform(this_0, tmp$ret$2);
|
|
1531
|
+
var tmp_0 = scope.r1y_1;
|
|
1532
1532
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1533
1533
|
}
|
|
1534
1534
|
function injectCompanionObject(_this__u8e3s4, endpoint) {
|
|
@@ -1538,20 +1538,20 @@ function injectCompanionObject(_this__u8e3s4, endpoint) {
|
|
|
1538
1538
|
var tmp = scope;
|
|
1539
1539
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1540
1540
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1541
|
-
var this_0 = scope.
|
|
1541
|
+
var this_0 = scope.r1y_1;
|
|
1542
1542
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1543
1543
|
// Inline function 'kotlin.apply' call
|
|
1544
1544
|
var this_1 = new TransformerBuilder();
|
|
1545
|
-
this_1.
|
|
1546
|
-
var tmp$ret$2 = this_1.
|
|
1547
|
-
tmp.
|
|
1548
|
-
var tmp_0 = scope.
|
|
1545
|
+
this_1.i1m(injectCompanionObject$lambda(endpoint));
|
|
1546
|
+
var tmp$ret$2 = this_1.j1m();
|
|
1547
|
+
tmp.r1y_1 = transform(this_0, tmp$ret$2);
|
|
1548
|
+
var tmp_0 = scope.r1y_1;
|
|
1549
1549
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1550
1550
|
}
|
|
1551
1551
|
function buildCompanionObject(endpoint) {
|
|
1552
|
-
var pathTemplate = '/' + joinToString(endpoint.
|
|
1552
|
+
var pathTemplate = '/' + joinToString(endpoint.ht_1, '/', VOID, VOID, VOID, VOID, buildCompanionObject$lambda);
|
|
1553
1553
|
// Inline function 'kotlin.let' call
|
|
1554
|
-
var p0 = trimMargin('\n |companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n | override val pathTemplate = "' + pathTemplate + '"\n | override val method = "' + endpoint.
|
|
1554
|
+
var p0 = trimMargin('\n |companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n | override val pathTemplate = "' + pathTemplate + '"\n | override val method = "' + endpoint.gt_1.toString() + '"\n | override fun server(serialization: Wirespec.Serialization) = object : Wirespec.ServerEdge<Request, Response<*>> {\n | override fun from(request: Wirespec.RawRequest) = fromRawRequest(serialization, request)\n | override fun to(response: Response<*>) = toRawResponse(serialization, response)\n | }\n | override fun client(serialization: Wirespec.Serialization) = object : Wirespec.ClientEdge<Request, Response<*>> {\n | override fun to(request: Request) = toRawRequest(serialization, request)\n | override fun from(response: Wirespec.RawResponse) = fromRawResponse(serialization, response)\n | }\n |}\n ');
|
|
1555
1555
|
return raw(p0);
|
|
1556
1556
|
}
|
|
1557
1557
|
function injectApiAlias$lambda(element, transformer) {
|
|
@@ -1561,7 +1561,7 @@ function injectApiAlias$lambda(element, transformer) {
|
|
|
1561
1561
|
var tmp_0;
|
|
1562
1562
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1563
1563
|
if (!injected.r()) {
|
|
1564
|
-
tmp_0 = withElements(element, plus_2(element.
|
|
1564
|
+
tmp_0 = withElements(element, plus_2(element.i1r(), injected));
|
|
1565
1565
|
} else {
|
|
1566
1566
|
tmp_0 = element;
|
|
1567
1567
|
}
|
|
@@ -1576,11 +1576,11 @@ function injectCompanionObject$lambda($endpoint) {
|
|
|
1576
1576
|
return function (element, transformer) {
|
|
1577
1577
|
var tmp;
|
|
1578
1578
|
if (element instanceof Interface) {
|
|
1579
|
-
var injected = element.
|
|
1579
|
+
var injected = element.a1s_1.equals(Companion_getInstance().y1k('Handler')) ? listOf(buildCompanionObject($endpoint)) : emptyList();
|
|
1580
1580
|
var tmp_0;
|
|
1581
1581
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1582
1582
|
if (!injected.r()) {
|
|
1583
|
-
tmp_0 = withElements(element, plus_2(element.
|
|
1583
|
+
tmp_0 = withElements(element, plus_2(element.i1r(), injected));
|
|
1584
1584
|
} else {
|
|
1585
1585
|
tmp_0 = element;
|
|
1586
1586
|
}
|
|
@@ -1595,10 +1595,10 @@ function injectCompanionObject$lambda($endpoint) {
|
|
|
1595
1595
|
function buildCompanionObject$lambda(it) {
|
|
1596
1596
|
var tmp;
|
|
1597
1597
|
if (it instanceof Literal) {
|
|
1598
|
-
tmp = it.
|
|
1598
|
+
tmp = it.iu_1;
|
|
1599
1599
|
} else {
|
|
1600
1600
|
if (it instanceof Param) {
|
|
1601
|
-
tmp = '{' + it.
|
|
1601
|
+
tmp = '{' + it.mt_1.m1() + '}';
|
|
1602
1602
|
} else {
|
|
1603
1603
|
noWhenBranchMatchedException();
|
|
1604
1604
|
}
|
|
@@ -1609,8 +1609,8 @@ function KotlinRefinedTypeDefinitionEmitter() {
|
|
|
1609
1609
|
}
|
|
1610
1610
|
function KotlinShared() {
|
|
1611
1611
|
KotlinShared_instance = this;
|
|
1612
|
-
this.
|
|
1613
|
-
this.
|
|
1612
|
+
this.k21_1 = 'community.flock.wirespec.kotlin';
|
|
1613
|
+
this.l21_1 = trimMargin('\n |package ' + this.k21_1 + '\n |\n |import kotlin.reflect.KType\n |\n |object Wirespec {\n |' + Spacer_instance.toString() + 'interface Enum { val label: String }\n |' + Spacer_instance.toString() + 'interface Endpoint\n |' + Spacer_instance.toString() + 'interface Refined<T> {\n |' + Spacer_instance.sv(2) + 'val value: T\n |' + Spacer_instance.sv(2) + 'fun validate(): Boolean\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Path\n |' + Spacer_instance.toString() + 'interface Queries\n |' + Spacer_instance.toString() + 'interface Headers\n |' + Spacer_instance.toString() + 'interface Handler\n |' + Spacer_instance.toString() + 'interface ServerEdge<Req: Request<*>, Res: Response<*>> { \n |' + Spacer_instance.toString() + 'fun from(request: RawRequest): Req \n |' + Spacer_instance.toString() + 'fun to(response: Res): RawResponse\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface ClientEdge<Req: Request<*>, Res: Response<*>> { \n |' + Spacer_instance.sv(2) + 'fun to(request: Req): RawRequest\n |' + Spacer_instance.sv(2) + 'fun from(response: RawResponse): Res\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req : Request<*>, Res : Response<*>> {\n |' + Spacer_instance.sv(2) + 'val pathTemplate: String\n |' + Spacer_instance.sv(2) + 'val method: String\n |' + Spacer_instance.sv(2) + 'fun client(serialization: Serialization): ClientEdge<Req, Res>\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Server<Req : Request<*>, Res : Response<*>> {\n |' + Spacer_instance.sv(2) + 'val pathTemplate: String\n |' + Spacer_instance.sv(2) + 'val method: String\n |' + Spacer_instance.sv(2) + 'fun server(serialization: Serialization): ServerEdge<Req, Res>\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'enum class Method { GET, PUT, POST, DELETE, OPTIONS, HEAD, PATCH, TRACE }\n |' + Spacer_instance.toString() + 'interface Request<T : Any> { val path: Path; val method: Method; val queries: Queries; val headers: Headers; val body: T; interface Headers : Wirespec.Headers }\n |' + Spacer_instance.toString() + 'interface Response<T : Any> { val status: Int; val headers: Headers; val body: T; interface Headers : Wirespec.Headers }\n |' + Spacer_instance.toString() + 'interface Serialization : Serializer, Deserializer\n |' + Spacer_instance.toString() + 'interface Serializer : BodySerializer, PathSerializer, ParamSerializer\n |' + Spacer_instance.toString() + 'interface Deserializer : BodyDeserializer, PathDeserializer, ParamDeserializer\n |' + Spacer_instance.toString() + 'interface BodySerialization : BodySerializer, BodyDeserializer\n |' + Spacer_instance.toString() + 'interface BodySerializer { fun <T : Any> serializeBody(t: T, kType: KType): ByteArray }\n |' + Spacer_instance.toString() + 'interface BodyDeserializer { fun <T : Any> deserializeBody(raw: ByteArray, kType: KType): T }\n |' + Spacer_instance.toString() + 'interface PathSerialization : PathSerializer, PathDeserializer\n |' + Spacer_instance.toString() + 'interface PathSerializer { fun <T : Any> serializePath(t: T, kType: KType): String }\n |' + Spacer_instance.toString() + 'interface PathDeserializer { fun <T : Any> deserializePath(raw: String, kType: KType): T }\n |' + Spacer_instance.toString() + 'interface ParamSerialization : ParamSerializer, ParamDeserializer\n |' + Spacer_instance.toString() + 'interface ParamSerializer { fun <T : Any> serializeParam(value: T, kType: KType): List<String> }\n |' + Spacer_instance.toString() + 'interface ParamDeserializer { fun <T : Any> deserializeParam(values: List<String>, kType: KType): T }\n |' + Spacer_instance.toString() + 'data class RawRequest(val method: String, val path: List<String>, val queries: Map<String, List<String>>, val headers: Map<String, List<String>>, val body: ByteArray?) \n |' + Spacer_instance.toString() + 'data class RawResponse(val statusCode: Int, val headers: Map<String, List<String>>, val body: ByteArray?)\n |}\n ');
|
|
1614
1614
|
}
|
|
1615
1615
|
protoOf(KotlinShared).toString = function () {
|
|
1616
1616
|
return 'KotlinShared';
|
|
@@ -1633,12 +1633,12 @@ function KotlinShared_getInstance() {
|
|
|
1633
1633
|
}
|
|
1634
1634
|
function KotlinTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
1635
1635
|
return function (it) {
|
|
1636
|
-
return this$0.
|
|
1636
|
+
return this$0.yt(it);
|
|
1637
1637
|
};
|
|
1638
1638
|
}
|
|
1639
1639
|
function KotlinTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
1640
1640
|
return function (it) {
|
|
1641
|
-
return Spacer_instance.toString() + 'val ' + this$0.
|
|
1641
|
+
return Spacer_instance.toString() + 'val ' + this$0.xt(it) + ',';
|
|
1642
1642
|
};
|
|
1643
1643
|
}
|
|
1644
1644
|
function KotlinTypeDefinitionEmitter() {
|
|
@@ -1646,31 +1646,31 @@ function KotlinTypeDefinitionEmitter() {
|
|
|
1646
1646
|
function KotlinUnionDefinitionEmitter() {
|
|
1647
1647
|
}
|
|
1648
1648
|
//region block: post-declaration
|
|
1649
|
-
protoOf(KotlinEmitter).
|
|
1650
|
-
protoOf(KotlinEmitter).
|
|
1651
|
-
protoOf(KotlinEmitter).
|
|
1652
|
-
protoOf(KotlinEmitter).
|
|
1653
|
-
protoOf(KotlinEmitter).
|
|
1654
|
-
protoOf(KotlinEmitter).
|
|
1655
|
-
protoOf(KotlinEmitter).
|
|
1656
|
-
protoOf(KotlinEmitter).
|
|
1657
|
-
protoOf(KotlinEmitter).
|
|
1658
|
-
protoOf(KotlinEmitter).
|
|
1659
|
-
protoOf(KotlinEmitter).
|
|
1660
|
-
protoOf(KotlinEmitter).
|
|
1661
|
-
protoOf(KotlinEmitter).
|
|
1662
|
-
protoOf(KotlinEmitter).
|
|
1663
|
-
protoOf(KotlinEmitter).
|
|
1664
|
-
protoOf(KotlinEmitter).
|
|
1665
|
-
protoOf(KotlinEmitter).
|
|
1666
|
-
protoOf(KotlinEmitter).
|
|
1667
|
-
protoOf(KotlinEmitter).
|
|
1668
|
-
protoOf(KotlinEmitter).
|
|
1669
|
-
protoOf(KotlinEmitter).
|
|
1670
|
-
protoOf(KotlinEmitter).
|
|
1671
|
-
protoOf(KotlinIrEmitter).
|
|
1672
|
-
protoOf(KotlinIrEmitter).
|
|
1673
|
-
protoOf(KotlinIrEmitter).
|
|
1649
|
+
protoOf(KotlinEmitter).vt = emit_4;
|
|
1650
|
+
protoOf(KotlinEmitter).wt = emit_5;
|
|
1651
|
+
protoOf(KotlinEmitter).xt = emit_6;
|
|
1652
|
+
protoOf(KotlinEmitter).yt = emit_7;
|
|
1653
|
+
protoOf(KotlinEmitter).zt = emit_8;
|
|
1654
|
+
protoOf(KotlinEmitter).kv = emit_14;
|
|
1655
|
+
protoOf(KotlinEmitter).fv = emit_15;
|
|
1656
|
+
protoOf(KotlinEmitter).lv = emit_11;
|
|
1657
|
+
protoOf(KotlinEmitter).av = emit_10;
|
|
1658
|
+
protoOf(KotlinEmitter).yu = emit_3;
|
|
1659
|
+
protoOf(KotlinEmitter).zu = emit_9;
|
|
1660
|
+
protoOf(KotlinEmitter).q20 = emit_12;
|
|
1661
|
+
protoOf(KotlinEmitter).r20 = emit_13;
|
|
1662
|
+
protoOf(KotlinEmitter).mv = emitValidator;
|
|
1663
|
+
protoOf(KotlinEmitter).d21 = sanitize;
|
|
1664
|
+
protoOf(KotlinEmitter).s20 = sanitizeFirstIsDigit;
|
|
1665
|
+
protoOf(KotlinEmitter).t20 = sanitizeKeywords;
|
|
1666
|
+
protoOf(KotlinEmitter).u20 = emitHandleFunction;
|
|
1667
|
+
protoOf(KotlinEmitter).m21 = emitRequestHeaders;
|
|
1668
|
+
protoOf(KotlinEmitter).n21 = emitQueries;
|
|
1669
|
+
protoOf(KotlinEmitter).o21 = emitBody;
|
|
1670
|
+
protoOf(KotlinEmitter).p21 = emitHeaders;
|
|
1671
|
+
protoOf(KotlinIrEmitter).pr = emit_1;
|
|
1672
|
+
protoOf(KotlinIrEmitter).g1z = emit_2;
|
|
1673
|
+
protoOf(KotlinIrEmitter).j1z = beforeGenerate;
|
|
1674
1674
|
//endregion
|
|
1675
1675
|
//region block: exports
|
|
1676
1676
|
export {
|