@flock/wirespec 0.19.3 → 0.19.5
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/clikt-clikt-mordant.mjs +79 -79
- package/clikt-clikt.mjs +1312 -1312
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +432 -432
- package/kotlin-kotlin-stdlib.mjs +14 -14
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +9859 -9859
- package/kotlin-rgxgen.mjs +1760 -1760
- package/kotlinx-io-kotlinx-io-core.mjs +404 -404
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1775 -1775
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1479 -1479
- package/mordant-mordant.mjs +1192 -1192
- package/package.json +1 -1
- package/wirespec-src-compiler-core.mjs +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +259 -259
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +187 -187
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +243 -243
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +342 -342
- package/wirespec-src-compiler-emitters-scala.mjs +123 -123
- package/wirespec-src-compiler-emitters-typescript.mjs +234 -234
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +24 -24
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3322 -3322
- package/wirespec-src-compiler-lib.mjs +227 -58
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +480 -480
- package/wirespec-src-converter-openapi.mjs +344 -344
- package/wirespec-src-ide-lsp.mjs +1348 -1348
- package/wirespec-src-plugin-arguments.mjs +139 -139
- package/wirespec-src-plugin-cli.mjs +87 -87
- package/wirespec-src-plugin-npm.d.mts +39 -2
- package/wirespec-src-plugin-npm.mjs +21 -21
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +2 -2
|
@@ -215,10 +215,10 @@ function emit_6(_this__u8e3s4) {
|
|
|
215
215
|
function emitRoot(_this__u8e3s4, void_0) {
|
|
216
216
|
var tmp;
|
|
217
217
|
if (_this__u8e3s4 instanceof Dict) {
|
|
218
|
-
tmp = this.
|
|
218
|
+
tmp = this.z1w(_this__u8e3s4.so_1);
|
|
219
219
|
} else {
|
|
220
220
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
221
|
-
tmp = this.
|
|
221
|
+
tmp = this.z1w(_this__u8e3s4.po_1);
|
|
222
222
|
} else {
|
|
223
223
|
if (_this__u8e3s4 instanceof Unit) {
|
|
224
224
|
tmp = void_0;
|
|
@@ -247,7 +247,7 @@ function emitRoot(_this__u8e3s4, void_0) {
|
|
|
247
247
|
}
|
|
248
248
|
function emitRoot$default(_this__u8e3s4, void_0, $super) {
|
|
249
249
|
void_0 = void_0 === VOID ? 'void' : void_0;
|
|
250
|
-
return $super === VOID ? this.
|
|
250
|
+
return $super === VOID ? this.a1x(_this__u8e3s4, void_0) : emitRoot(_this__u8e3s4, void_0);
|
|
251
251
|
}
|
|
252
252
|
function emit_7(_this__u8e3s4) {
|
|
253
253
|
var tmp;
|
|
@@ -290,17 +290,73 @@ function emit_7(_this__u8e3s4) {
|
|
|
290
290
|
}
|
|
291
291
|
initMetadataForInterface(JavaTypeDefinitionEmitter, 'JavaTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter]);
|
|
292
292
|
function emit_8(channel) {
|
|
293
|
-
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |@FunctionalInterface\n |public interface ' + this.nr(channel.cp_1) + ' {\n | void invoke(' + emitFullyQualified(this, channel, channel.dp_1) + this.
|
|
293
|
+
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |@FunctionalInterface\n |public interface ' + this.nr(channel.cp_1) + ' {\n | void invoke(' + emitFullyQualified(this, channel, channel.dp_1) + this.z1w(channel.dp_1) + ' message);\n |}\n |\n ');
|
|
294
294
|
}
|
|
295
295
|
initMetadataForInterface(JavaChannelDefinitionEmitter, 'JavaChannelDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
296
|
-
function emit_9(
|
|
296
|
+
function emit_9(identifier) {
|
|
297
|
+
var tmp;
|
|
298
|
+
if (identifier instanceof DefinitionIdentifier) {
|
|
299
|
+
tmp = this.k1x(identifier.l1());
|
|
300
|
+
} else {
|
|
301
|
+
if (identifier instanceof FieldIdentifier) {
|
|
302
|
+
tmp = this.o1x(this.k1x(identifier.l1()));
|
|
303
|
+
} else {
|
|
304
|
+
noWhenBranchMatchedException();
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return tmp;
|
|
308
|
+
}
|
|
309
|
+
function sanitizeSymbol(_this__u8e3s4) {
|
|
310
|
+
// Inline function 'kotlin.collections.mapIndexed' call
|
|
311
|
+
var this_0 = split(_this__u8e3s4, ['.', ' ', '-']);
|
|
312
|
+
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
313
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
314
|
+
var index = 0;
|
|
315
|
+
var _iterator__ex2g4s = this_0.t();
|
|
316
|
+
while (_iterator__ex2g4s.u()) {
|
|
317
|
+
var item = _iterator__ex2g4s.v();
|
|
318
|
+
var _unary__edvuaz = index;
|
|
319
|
+
index = _unary__edvuaz + 1 | 0;
|
|
320
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.er(item) : item;
|
|
321
|
+
destination.x(tmp$ret$0);
|
|
322
|
+
}
|
|
323
|
+
var tmp = asSequence(joinToString(destination, ''));
|
|
324
|
+
return this.n1x(joinToString_0(filter(tmp, JavaIdentifierEmitter$sanitizeSymbol$lambda), ''));
|
|
325
|
+
}
|
|
326
|
+
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
327
|
+
var tmp;
|
|
328
|
+
var tmp0_safe_receiver = firstOrNull(_this__u8e3s4);
|
|
329
|
+
var tmp_0;
|
|
330
|
+
var tmp_1 = tmp0_safe_receiver;
|
|
331
|
+
if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
|
|
332
|
+
tmp_0 = null;
|
|
333
|
+
} else {
|
|
334
|
+
tmp_0 = isDigit(tmp0_safe_receiver);
|
|
335
|
+
}
|
|
336
|
+
if (tmp_0 === true) {
|
|
337
|
+
tmp = '_' + _this__u8e3s4;
|
|
338
|
+
} else {
|
|
339
|
+
tmp = _this__u8e3s4;
|
|
340
|
+
}
|
|
341
|
+
return tmp;
|
|
342
|
+
}
|
|
343
|
+
function sanitizeKeywords(_this__u8e3s4) {
|
|
344
|
+
return Companion_getInstance_0().q1x_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
345
|
+
}
|
|
346
|
+
initMetadataForInterface(JavaIdentifierEmitter, 'JavaIdentifierEmitter');
|
|
347
|
+
function emit_10(union) {
|
|
348
|
+
var tmp = this.nr(union.gp_1);
|
|
349
|
+
return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.hp_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
|
|
350
|
+
}
|
|
351
|
+
initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
352
|
+
function emit_11(endpoint) {
|
|
297
353
|
var tmp = emitImports_0(this, endpoint);
|
|
298
354
|
var tmp_0 = this.nr(endpoint.up_1);
|
|
299
355
|
var tmp_1 = get_pathParams(endpoint);
|
|
300
356
|
var tmp_2 = emitObject(this, tmp_1, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
|
|
301
357
|
var tmp_3 = emitObject(this, endpoint.xp_1, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
302
358
|
var tmp_4 = emitObject(this, endpoint.yp_1, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
303
|
-
var tmp_5 = this.
|
|
359
|
+
var tmp_5 = this.l1x(first_0(endpoint.zp_1), endpoint);
|
|
304
360
|
var tmp_6 = Spacer_instance.toString();
|
|
305
361
|
var tmp_7 = emitStatusInterfaces(this, endpoint);
|
|
306
362
|
var tmp_8 = emitResponseInterfaces(this, endpoint);
|
|
@@ -317,7 +373,7 @@ function emit_9(endpoint) {
|
|
|
317
373
|
var tmp_19 = emitFromResponse(this, endpoint);
|
|
318
374
|
var tmp_20 = Spacer_instance.hs(2);
|
|
319
375
|
var tmp_21 = Spacer_instance.hs(2);
|
|
320
|
-
var tmp_22 = this.
|
|
376
|
+
var tmp_22 = this.p1x(endpoint);
|
|
321
377
|
var tmp_23 = Spacer_instance.hs(2);
|
|
322
378
|
var tmp_24 = Spacer_instance.hs(3);
|
|
323
379
|
return trimMargin('\n |' + tmp + '\n |\n |public interface ' + tmp_0 + ' extends Wirespec.Endpoint {\n |' + tmp_2 + '\n |\n |' + tmp_3 + '\n |\n |' + tmp_4 + '\n |\n |' + tmp_5 + '\n |\n |' + tmp_6 + 'sealed interface Response<T> extends Wirespec.Response<T> {}\n |' + tmp_7 + '\n |' + tmp_8 + '\n |\n |' + tmp_10 + '\n |\n |' + tmp_11 + 'interface Handler extends Wirespec.Handler {\n |\n |' + tmp_12 + '\n |\n |' + tmp_13 + 'static Wirespec.RawResponse toResponse(Wirespec.Serializer serialization, Response<?> response) {\n |' + tmp_15 + '\n |' + tmp_16 + 'else { throw new IllegalStateException("Cannot match response with status: " + response.status());}\n |' + tmp_17 + '}\n |\n |' + tmp_18 + 'static Response<?> fromResponse(Wirespec.Deserializer serialization, Wirespec.RawResponse response) {\n |' + tmp_19 + '\n |' + tmp_20 + '}\n |\n |' + tmp_21 + tmp_22 + '\n |' + tmp_23 + 'class Handlers implements Wirespec.Server<Request, Response<?>>, Wirespec.Client<Request, Response<?>> {\n |' + tmp_24 + '@Override public String getPathTemplate() { return "/' + joinToString(endpoint.wp_1, '/', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_4) + '"; }\n |' + Spacer_instance.hs(3) + '@Override public String getMethod() { return "' + endpoint.vp_1.toString() + '"; }\n |' + Spacer_instance.hs(3) + '@Override public Wirespec.ServerEdge<Request, Response<?>> getServer(Wirespec.Serialization serialization) {\n |' + Spacer_instance.hs(4) + 'return new Wirespec.ServerEdge<>() {\n |' + Spacer_instance.hs(5) + '@Override public Request from(Wirespec.RawRequest request) { return fromRequest(serialization, request); }\n |' + Spacer_instance.hs(5) + '@Override public Wirespec.RawResponse to(Response<?> response) { return toResponse(serialization, response); }\n |' + Spacer_instance.hs(4) + '};\n |' + Spacer_instance.hs(3) + '}\n |' + Spacer_instance.hs(3) + '@Override public Wirespec.ClientEdge<Request, Response<?>> getClient(Wirespec.Serialization serialization) {\n |' + Spacer_instance.hs(4) + 'return new Wirespec.ClientEdge<>() {\n |' + Spacer_instance.hs(5) + '@Override public Wirespec.RawRequest to(Request request) { return toRequest(serialization, request); }\n |' + Spacer_instance.hs(5) + '@Override public Response<?> from(Wirespec.RawResponse response) { return fromResponse(serialization, response); }\n |' + Spacer_instance.hs(4) + '};\n |' + Spacer_instance.hs(3) + '}\n |' + Spacer_instance.hs(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
@@ -325,10 +381,10 @@ function emit_9(endpoint) {
|
|
|
325
381
|
function emitHandleFunction(endpoint) {
|
|
326
382
|
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.fr(this.nr(endpoint.up_1)) + '(Request request);';
|
|
327
383
|
}
|
|
328
|
-
function
|
|
384
|
+
function emit_12(_this__u8e3s4, endpoint) {
|
|
329
385
|
return trimMargin('\n |' + Spacer_instance.toString() + 'record Request (\n |' + Spacer_instance.hs(2) + 'Path path,\n |' + Spacer_instance.hs(2) + 'Wirespec.Method method,\n |' + Spacer_instance.hs(2) + 'Queries queries,\n |' + Spacer_instance.hs(2) + 'RequestHeaders headers,\n |' + Spacer_instance.hs(2) + emit_16(this, _this__u8e3s4.dq_1) + ' body\n |' + Spacer_instance.toString() + ') implements Wirespec.Request<' + emit_16(this, _this__u8e3s4.dq_1) + '> {\n |' + Spacer_instance.hs(2) + emitConstructor(this, _this__u8e3s4, endpoint) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
330
386
|
}
|
|
331
|
-
function
|
|
387
|
+
function emit_13(_this__u8e3s4) {
|
|
332
388
|
var tmp = Spacer_instance.toString();
|
|
333
389
|
var tmp_0 = Companion_instance_1.er(_this__u8e3s4.gq_1);
|
|
334
390
|
var tmp_1 = Spacer_instance.hs(2);
|
|
@@ -361,7 +417,7 @@ function emit_11(_this__u8e3s4) {
|
|
|
361
417
|
return trimMargin('\n |' + tmp + 'record Response' + tmp_0 + '(\n |' + tmp_1 + 'Integer status,\n |' + tmp_2 + 'Headers headers,\n |' + tmp_3 + tmp_4 + ' body\n |' + tmp_5 + ') implements Response' + tmp_6 + 'XX<' + tmp_7 + '>, Response' + tmp_8 + ' {\n |' + tmp_9 + 'public Response' + tmp_10 + '(' + tmp_13 + ') {\n |' + tmp_14 + 'this(' + tmp_15 + ', ' + tmp_16 + ', ' + tmp_17 + ');\n |' + tmp_18 + '}\n |' + tmp_19 + emitObject(this, _this__u8e3s4.hq_1, 'Headers', 'Wirespec.Response.Headers', JavaEndpointDefinitionEmitter$emit$lambda_7(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
362
418
|
}
|
|
363
419
|
initMetadataForInterface(JavaEndpointDefinitionEmitter, 'JavaEndpointDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
364
|
-
function
|
|
420
|
+
function emit_14(refined) {
|
|
365
421
|
return trimMargin('\n |public record ' + this.nr(refined.sr_1) + ' (' + this.nq(refined.tr_1) + ' value) implements Wirespec.Refined<' + this.nq(refined.tr_1) + '> {\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() { return value.toString(); }\n |' + Spacer_instance.toString() + 'public Boolean validate() {\n |' + Spacer_instance.toString() + Spacer_instance.toString() + this.bs(refined) + '\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public ' + this.nq(refined.tr_1) + ' value() { return value; }\n |}\n |\n ');
|
|
366
422
|
}
|
|
367
423
|
function emitValidator(_this__u8e3s4) {
|
|
@@ -405,68 +461,12 @@ function emitValidator(_this__u8e3s4) {
|
|
|
405
461
|
return tmp;
|
|
406
462
|
}
|
|
407
463
|
initMetadataForInterface(JavaRefinedTypeDefinitionEmitter, 'JavaRefinedTypeDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
408
|
-
function
|
|
409
|
-
var tmp;
|
|
410
|
-
if (identifier instanceof DefinitionIdentifier) {
|
|
411
|
-
tmp = this.g1x(identifier.l1());
|
|
412
|
-
} else {
|
|
413
|
-
if (identifier instanceof FieldIdentifier) {
|
|
414
|
-
tmp = this.k1x(this.g1x(identifier.l1()));
|
|
415
|
-
} else {
|
|
416
|
-
noWhenBranchMatchedException();
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
return tmp;
|
|
420
|
-
}
|
|
421
|
-
function sanitizeSymbol(_this__u8e3s4) {
|
|
422
|
-
// Inline function 'kotlin.collections.mapIndexed' call
|
|
423
|
-
var this_0 = split(_this__u8e3s4, ['.', ' ', '-']);
|
|
424
|
-
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
425
|
-
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
426
|
-
var index = 0;
|
|
427
|
-
var _iterator__ex2g4s = this_0.t();
|
|
428
|
-
while (_iterator__ex2g4s.u()) {
|
|
429
|
-
var item = _iterator__ex2g4s.v();
|
|
430
|
-
var _unary__edvuaz = index;
|
|
431
|
-
index = _unary__edvuaz + 1 | 0;
|
|
432
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.er(item) : item;
|
|
433
|
-
destination.x(tmp$ret$0);
|
|
434
|
-
}
|
|
435
|
-
var tmp = asSequence(joinToString(destination, ''));
|
|
436
|
-
return this.j1x(joinToString_0(filter(tmp, JavaIdentifierEmitter$sanitizeSymbol$lambda), ''));
|
|
437
|
-
}
|
|
438
|
-
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
439
|
-
var tmp;
|
|
440
|
-
var tmp0_safe_receiver = firstOrNull(_this__u8e3s4);
|
|
441
|
-
var tmp_0;
|
|
442
|
-
var tmp_1 = tmp0_safe_receiver;
|
|
443
|
-
if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
|
|
444
|
-
tmp_0 = null;
|
|
445
|
-
} else {
|
|
446
|
-
tmp_0 = isDigit(tmp0_safe_receiver);
|
|
447
|
-
}
|
|
448
|
-
if (tmp_0 === true) {
|
|
449
|
-
tmp = '_' + _this__u8e3s4;
|
|
450
|
-
} else {
|
|
451
|
-
tmp = _this__u8e3s4;
|
|
452
|
-
}
|
|
453
|
-
return tmp;
|
|
454
|
-
}
|
|
455
|
-
function sanitizeKeywords(_this__u8e3s4) {
|
|
456
|
-
return Companion_getInstance_0().m1x_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
457
|
-
}
|
|
458
|
-
initMetadataForInterface(JavaIdentifierEmitter, 'JavaIdentifierEmitter');
|
|
459
|
-
function emit_14(enum_0, module_0) {
|
|
464
|
+
function emit_15(enum_0, module_0) {
|
|
460
465
|
var tmp = this.nr(enum_0.xr_1);
|
|
461
466
|
return trimMargin('\n |public enum ' + tmp + ' implements Wirespec.Enum {\n |' + spacer(joinToString(enum_0.yr_1, ',\n', VOID, VOID, VOID, VOID, JavaEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'public final String label;\n |' + Spacer_instance.toString() + this.nr(enum_0.xr_1) + '(String label) {\n |' + Spacer_instance.hs(2) + 'this.label = label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() {\n |' + Spacer_instance.hs(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String label() {\n |' + Spacer_instance.hs(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
462
467
|
}
|
|
463
468
|
initMetadataForInterface(JavaEnumDefinitionEmitter, 'JavaEnumDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
464
|
-
|
|
465
|
-
var tmp = this.nr(union.gp_1);
|
|
466
|
-
return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.hp_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
|
|
467
|
-
}
|
|
468
|
-
initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
469
|
-
initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [JavaEndpointDefinitionEmitter, JavaRefinedTypeDefinitionEmitter, JavaEnumDefinitionEmitter, JavaTypeDefinitionEmitter, JavaChannelDefinitionEmitter, JavaIdentifierEmitter, JavaUnionDefinitionEmitter, LanguageEmitter]);
|
|
469
|
+
initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [JavaChannelDefinitionEmitter, JavaUnionDefinitionEmitter, JavaEndpointDefinitionEmitter, JavaTypeDefinitionEmitter, JavaRefinedTypeDefinitionEmitter, JavaIdentifierEmitter, JavaEnumDefinitionEmitter, LanguageEmitter]);
|
|
470
470
|
initMetadataForCompanion(Companion);
|
|
471
471
|
initMetadataForCompanion(Companion_0);
|
|
472
472
|
initMetadataForClass(JavaIrEmitter, 'JavaIrEmitter', JavaIrEmitter, VOID, [IrEmitter]);
|
|
@@ -490,7 +490,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
490
490
|
var _iterator__ex2g4s_0 = destination.t();
|
|
491
491
|
while (_iterator__ex2g4s_0.u()) {
|
|
492
492
|
var item = _iterator__ex2g4s_0.v();
|
|
493
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
493
|
+
var tmp$ret$3 = 'import ' + $this.y1w().ds_1 + '.model.' + item.bv_1 + ';';
|
|
494
494
|
destination_0.x(tmp$ret$3);
|
|
495
495
|
}
|
|
496
496
|
var tmp = destination_0;
|
|
@@ -499,7 +499,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
499
499
|
function emitFullyQualified($this, _this__u8e3s4, reference) {
|
|
500
500
|
var tmp;
|
|
501
501
|
if (_this__u8e3s4.mr().l1() === reference.l1()) {
|
|
502
|
-
tmp = $this.
|
|
502
|
+
tmp = $this.y1w().ds_1 + '.model.';
|
|
503
503
|
} else {
|
|
504
504
|
tmp = '';
|
|
505
505
|
}
|
|
@@ -515,42 +515,42 @@ function JavaEmitter(packageName, emitShared) {
|
|
|
515
515
|
packageName = packageName === VOID ? Companion_instance.cs('community.flock.wirespec.generated') : packageName;
|
|
516
516
|
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
517
517
|
LanguageEmitter.call(this);
|
|
518
|
-
this.
|
|
519
|
-
this.
|
|
520
|
-
this.
|
|
521
|
-
this.
|
|
522
|
-
this.
|
|
523
|
-
this.
|
|
524
|
-
}
|
|
525
|
-
protoOf(JavaEmitter).
|
|
526
|
-
return this.
|
|
518
|
+
this.b1x_1 = packageName;
|
|
519
|
+
this.c1x_1 = emitShared;
|
|
520
|
+
this.d1x_1 = '\nimport community.flock.wirespec.java.Wirespec;\n';
|
|
521
|
+
this.e1x_1 = FileExtension_Java_getInstance();
|
|
522
|
+
this.f1x_1 = JavaShared_getInstance();
|
|
523
|
+
this.g1x_1 = '//';
|
|
524
|
+
}
|
|
525
|
+
protoOf(JavaEmitter).y1w = function () {
|
|
526
|
+
return this.b1x_1;
|
|
527
527
|
};
|
|
528
528
|
protoOf(JavaEmitter).uq = function () {
|
|
529
|
-
return this.
|
|
529
|
+
return this.e1x_1;
|
|
530
530
|
};
|
|
531
|
-
protoOf(JavaEmitter).
|
|
532
|
-
return this.
|
|
531
|
+
protoOf(JavaEmitter).h1x = function () {
|
|
532
|
+
return this.f1x_1;
|
|
533
533
|
};
|
|
534
534
|
protoOf(JavaEmitter).vq = function () {
|
|
535
|
-
return this.
|
|
535
|
+
return this.g1x_1;
|
|
536
536
|
};
|
|
537
537
|
protoOf(JavaEmitter).kr = function (module_0, logger) {
|
|
538
538
|
// Inline function 'kotlin.let' call
|
|
539
539
|
var it = protoOf(LanguageEmitter).kr.call(this, module_0, logger);
|
|
540
|
-
return this.
|
|
540
|
+
return this.c1x_1.xo_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.cs('community.flock.wirespec.java').fs() + 'Wirespec', this.h1x().j1x_1)) : it;
|
|
541
541
|
};
|
|
542
542
|
protoOf(JavaEmitter).lr = function (definition, module_0, logger) {
|
|
543
543
|
// Inline function 'kotlin.let' call
|
|
544
544
|
var it = protoOf(LanguageEmitter).lr.call(this, definition, module_0, logger);
|
|
545
|
-
var subPackageName = plus(this.
|
|
546
|
-
var tmp = subPackageName.fs() + this.
|
|
545
|
+
var subPackageName = plus(this.y1w(), definition);
|
|
546
|
+
var tmp = subPackageName.fs() + this.k1x(it.yo_1);
|
|
547
547
|
// Inline function 'kotlin.text.trimStart' call
|
|
548
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.gr(module_0) ? this.
|
|
548
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.gr(module_0) ? this.d1x_1 : '') + '\n |' + it.zo_1 + '\n ');
|
|
549
549
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
550
550
|
return new Emitted(tmp, tmp$ret$0);
|
|
551
551
|
};
|
|
552
552
|
function emitGetType($this, _this__u8e3s4) {
|
|
553
|
-
return 'Wirespec.getType(' + $this.
|
|
553
|
+
return 'Wirespec.getType(' + $this.a1x(_this__u8e3s4, 'Void') + '.class, ' + emitGetTypeRaw($this, _this__u8e3s4) + ')';
|
|
554
554
|
}
|
|
555
555
|
function emitGetTypeRaw($this, _this__u8e3s4) {
|
|
556
556
|
var tmp;
|
|
@@ -705,7 +705,7 @@ function emitImports_0($this, _this__u8e3s4) {
|
|
|
705
705
|
var _iterator__ex2g4s_0 = destination.t();
|
|
706
706
|
while (_iterator__ex2g4s_0.u()) {
|
|
707
707
|
var item = _iterator__ex2g4s_0.v();
|
|
708
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
708
|
+
var tmp$ret$3 = 'import ' + $this.y1w().ds_1 + '.model.' + item.bv_1 + ';';
|
|
709
709
|
destination_0.x(tmp$ret$3);
|
|
710
710
|
}
|
|
711
711
|
var tmp = destination_0;
|
|
@@ -826,7 +826,7 @@ function JavaEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
|
826
826
|
}
|
|
827
827
|
function JavaEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
828
828
|
return function (it) {
|
|
829
|
-
return this$0.
|
|
829
|
+
return this$0.m1x(it);
|
|
830
830
|
};
|
|
831
831
|
}
|
|
832
832
|
function JavaEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
@@ -958,7 +958,7 @@ function sanitizeNegative($this, _this__u8e3s4) {
|
|
|
958
958
|
return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
|
|
959
959
|
}
|
|
960
960
|
function sanitizeEnum($this, _this__u8e3s4) {
|
|
961
|
-
return $this.
|
|
961
|
+
return $this.o1x($this.n1x(joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_')));
|
|
962
962
|
}
|
|
963
963
|
function JavaEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
964
964
|
return function (it) {
|
|
@@ -969,7 +969,7 @@ function JavaEnumDefinitionEmitter() {
|
|
|
969
969
|
}
|
|
970
970
|
function Companion() {
|
|
971
971
|
Companion_instance_2 = this;
|
|
972
|
-
this.
|
|
972
|
+
this.q1x_1 = setOf(['abstract', 'continue', 'for', 'new', 'switch', 'assert', 'default', 'goto', 'package', 'synchronized', 'boolean', 'do', 'if', 'private', 'this', 'break', 'double', 'implements', 'protected', 'throw', 'byte', 'else', 'import', 'public', 'throws', 'case', 'enum', 'instanceof', 'return', 'transient', 'catch', 'extends', 'int', 'short', 'try', 'char', 'final', 'interface', 'static', 'void', 'class', 'finally', 'long', 'strictfp', 'volatile', 'const', 'float', 'native', 'super', 'while', 'true', 'false']);
|
|
973
973
|
}
|
|
974
974
|
var Companion_instance_2;
|
|
975
975
|
function Companion_getInstance_0() {
|
|
@@ -1033,14 +1033,14 @@ function sanitizeFirstIsDigit_0($this, _this__u8e3s4) {
|
|
|
1033
1033
|
return tmp;
|
|
1034
1034
|
}
|
|
1035
1035
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1036
|
-
return Companion_getInstance_1().
|
|
1036
|
+
return Companion_getInstance_1().r1x_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1037
1037
|
}
|
|
1038
1038
|
function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
1039
1039
|
return sanitizeKeywords_0($this, sanitizeFirstIsDigit_0($this, joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_')));
|
|
1040
1040
|
}
|
|
1041
1041
|
function Companion_0() {
|
|
1042
1042
|
Companion_instance_3 = this;
|
|
1043
|
-
this.
|
|
1043
|
+
this.r1x_1 = setOf(['abstract', 'continue', 'for', 'new', 'switch', 'assert', 'default', 'goto', 'package', 'synchronized', 'boolean', 'do', 'if', 'private', 'this', 'break', 'double', 'implements', 'protected', 'throw', 'byte', 'else', 'import', 'public', 'throws', 'case', 'enum', 'instanceof', 'return', 'transient', 'catch', 'extends', 'int', 'short', 'try', 'char', 'final', 'interface', 'static', 'void', 'class', 'finally', 'long', 'strictfp', 'volatile', 'const', 'float', 'native', 'super', 'while', 'true', 'false']);
|
|
1044
1044
|
}
|
|
1045
1045
|
var Companion_instance_3;
|
|
1046
1046
|
function Companion_getInstance_1() {
|
|
@@ -1052,10 +1052,10 @@ function JavaIrEmitter$sanitizationConfig$lambda(it) {
|
|
|
1052
1052
|
return '_' + it;
|
|
1053
1053
|
}
|
|
1054
1054
|
function JavaIrEmitter$sanitizationConfig$lambda_0(name) {
|
|
1055
|
-
return name.
|
|
1055
|
+
return name.p1h_1.a1() > 1 ? new Name(listOf(name.u1m())) : name;
|
|
1056
1056
|
}
|
|
1057
1057
|
function JavaIrEmitter$sanitizationConfig$lambda_1(name) {
|
|
1058
|
-
return new Name(listOf(name.
|
|
1058
|
+
return new Name(listOf(name.u1m()));
|
|
1059
1059
|
}
|
|
1060
1060
|
function JavaIrEmitter$sanitizationConfig$lambda_2(this$0) {
|
|
1061
1061
|
return function (it) {
|
|
@@ -1066,23 +1066,23 @@ function JavaIrEmitter$sanitizationConfig$lambda_3(stmt, tr) {
|
|
|
1066
1066
|
var tmp;
|
|
1067
1067
|
var tmp_0;
|
|
1068
1068
|
if (stmt instanceof FunctionCall) {
|
|
1069
|
-
tmp_0 = stmt.
|
|
1069
|
+
tmp_0 = stmt.e1n_1.n1j() === 'validate';
|
|
1070
1070
|
} else {
|
|
1071
1071
|
tmp_0 = false;
|
|
1072
1072
|
}
|
|
1073
1073
|
if (tmp_0) {
|
|
1074
|
-
tmp = transformChildren(stmt.
|
|
1074
|
+
tmp = transformChildren(stmt.i1n(VOID, emptyList()), tr);
|
|
1075
1075
|
} else {
|
|
1076
1076
|
tmp = transformChildren(stmt, tr);
|
|
1077
1077
|
}
|
|
1078
1078
|
return tmp;
|
|
1079
1079
|
}
|
|
1080
1080
|
function JavaIrEmitter$emitShared$lambda(name) {
|
|
1081
|
-
switch (name.
|
|
1081
|
+
switch (name.n1j()) {
|
|
1082
1082
|
case 'client':
|
|
1083
|
-
return Companion_getInstance().
|
|
1083
|
+
return Companion_getInstance().r1h('getClient');
|
|
1084
1084
|
case 'server':
|
|
1085
|
-
return Companion_getInstance().
|
|
1085
|
+
return Companion_getInstance().r1h('getServer');
|
|
1086
1086
|
default:
|
|
1087
1087
|
return null;
|
|
1088
1088
|
}
|
|
@@ -1092,7 +1092,7 @@ function JavaIrEmitter$emitShared$lambda_0($imports) {
|
|
|
1092
1092
|
var tmp;
|
|
1093
1093
|
if (element instanceof File) {
|
|
1094
1094
|
// Inline function 'kotlin.collections.partition' call
|
|
1095
|
-
var this_0 = element.
|
|
1095
|
+
var this_0 = element.a1o_1;
|
|
1096
1096
|
var first = ArrayList_init_$Create$();
|
|
1097
1097
|
var second = ArrayList_init_$Create$();
|
|
1098
1098
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -1107,7 +1107,7 @@ function JavaIrEmitter$emitShared$lambda_0($imports) {
|
|
|
1107
1107
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1108
1108
|
var packageElements = _destruct__k2r9zo.ve();
|
|
1109
1109
|
var rest = _destruct__k2r9zo.we();
|
|
1110
|
-
tmp = element.
|
|
1110
|
+
tmp = element.d1o(VOID, plus_1(plus_1(packageElements, $imports), rest));
|
|
1111
1111
|
} else {
|
|
1112
1112
|
tmp = element;
|
|
1113
1113
|
}
|
|
@@ -1119,11 +1119,11 @@ function JavaIrEmitter$emitShared$lambda_1($clientServer) {
|
|
|
1119
1119
|
return function (element, transformer) {
|
|
1120
1120
|
var tmp;
|
|
1121
1121
|
if (element instanceof Namespace) {
|
|
1122
|
-
var injected = element.
|
|
1122
|
+
var injected = element.f1o_1.equals(Companion_getInstance().r1h('Wirespec')) ? $clientServer : emptyList();
|
|
1123
1123
|
var tmp_0;
|
|
1124
1124
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1125
1125
|
if (!injected.r()) {
|
|
1126
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1126
|
+
tmp_0 = withElements(element, plus_1(element.b1o(), injected));
|
|
1127
1127
|
} else {
|
|
1128
1128
|
tmp_0 = element;
|
|
1129
1129
|
}
|
|
@@ -1148,7 +1148,7 @@ function JavaIrEmitter$emitGenerator$lambda_1(it) {
|
|
|
1148
1148
|
}
|
|
1149
1149
|
function JavaIrEmitter$emitGenerator$lambda_2(this$0) {
|
|
1150
1150
|
return function (it) {
|
|
1151
|
-
return import_0(this$0.
|
|
1151
|
+
return import_0(this$0.y1w().ds_1 + '.model', it);
|
|
1152
1152
|
};
|
|
1153
1153
|
}
|
|
1154
1154
|
function JavaIrEmitter$emit$lambda(this$0) {
|
|
@@ -1160,37 +1160,37 @@ function JavaIrEmitter$emit$lambda_0(it) {
|
|
|
1160
1160
|
return listOf(function_0('label', VOID, VOID, JavaIrEmitter$emit$lambda$lambda));
|
|
1161
1161
|
}
|
|
1162
1162
|
function JavaIrEmitter$emit$lambda$lambda($this$function) {
|
|
1163
|
-
$this$function.
|
|
1164
|
-
$this$function.
|
|
1163
|
+
$this$function.f1i(String_instance);
|
|
1164
|
+
$this$function.g1i(new VariableReference(Companion_getInstance().r1h('label')));
|
|
1165
1165
|
return Unit_instance;
|
|
1166
1166
|
}
|
|
1167
1167
|
function JavaIrEmitter(packageName, emitShared) {
|
|
1168
1168
|
Companion_getInstance_1();
|
|
1169
1169
|
packageName = packageName === VOID ? Companion_instance.cs('community.flock.wirespec.generated') : packageName;
|
|
1170
1170
|
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
1171
|
-
this.
|
|
1172
|
-
this.
|
|
1173
|
-
this.
|
|
1174
|
-
this.
|
|
1175
|
-
this.
|
|
1171
|
+
this.s1x_1 = packageName;
|
|
1172
|
+
this.t1x_1 = emitShared;
|
|
1173
|
+
this.u1x_1 = JavaGenerator_getInstance();
|
|
1174
|
+
this.v1x_1 = FileExtension_Java_getInstance();
|
|
1175
|
+
this.w1x_1 = listOf(import_0('community.flock.wirespec.java', 'Wirespec'));
|
|
1176
1176
|
var tmp = this;
|
|
1177
|
-
var tmp_0 = Companion_getInstance_1().
|
|
1177
|
+
var tmp_0 = Companion_getInstance_1().r1x_1;
|
|
1178
1178
|
var tmp_1 = JavaIrEmitter$sanitizationConfig$lambda;
|
|
1179
1179
|
var tmp_2 = JavaIrEmitter$sanitizationConfig$lambda_0;
|
|
1180
1180
|
var tmp_3 = JavaIrEmitter$sanitizationConfig$lambda_1;
|
|
1181
1181
|
var tmp_4 = JavaIrEmitter$sanitizationConfig$lambda_2(this);
|
|
1182
|
-
tmp.
|
|
1182
|
+
tmp.x1x_1 = new SanitizationConfig(tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, JavaIrEmitter$sanitizationConfig$lambda_3);
|
|
1183
1183
|
}
|
|
1184
|
-
protoOf(JavaIrEmitter).
|
|
1185
|
-
return this.
|
|
1184
|
+
protoOf(JavaIrEmitter).y1w = function () {
|
|
1185
|
+
return this.s1x_1;
|
|
1186
1186
|
};
|
|
1187
|
-
protoOf(JavaIrEmitter).
|
|
1188
|
-
return this.
|
|
1187
|
+
protoOf(JavaIrEmitter).x1v = function () {
|
|
1188
|
+
return this.u1x_1;
|
|
1189
1189
|
};
|
|
1190
1190
|
protoOf(JavaIrEmitter).uq = function () {
|
|
1191
|
-
return this.
|
|
1191
|
+
return this.v1x_1;
|
|
1192
1192
|
};
|
|
1193
|
-
protoOf(JavaIrEmitter).
|
|
1193
|
+
protoOf(JavaIrEmitter).b1w = function () {
|
|
1194
1194
|
var packageName = Companion_instance.cs('community.flock.wirespec.java');
|
|
1195
1195
|
var imports = listOf_0([import_0('java.lang.reflect', 'Type'), import_0('java.lang.reflect', 'ParameterizedType'), import_0('java.util', 'List'), import_0('java.util', 'Map')]);
|
|
1196
1196
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1210,28 +1210,28 @@ protoOf(JavaIrEmitter).x1v = function () {
|
|
|
1210
1210
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1211
1211
|
var tmp = scope;
|
|
1212
1212
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1213
|
-
var this_2 = scope.
|
|
1213
|
+
var this_2 = scope.k1v_1;
|
|
1214
1214
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1215
1215
|
// Inline function 'kotlin.apply' call
|
|
1216
1216
|
var this_3 = new TransformerBuilder();
|
|
1217
|
-
this_3.
|
|
1218
|
-
var tmp$ret$5 = this_3.
|
|
1219
|
-
tmp.
|
|
1217
|
+
this_3.b1j(JavaIrEmitter$emitShared$lambda_0(imports));
|
|
1218
|
+
var tmp$ret$5 = this_3.c1j();
|
|
1219
|
+
tmp.k1v_1 = transform(this_2, tmp$ret$5);
|
|
1220
1220
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1221
1221
|
var tmp_0 = scope;
|
|
1222
1222
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1223
1223
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1224
|
-
var this_4 = scope.
|
|
1224
|
+
var this_4 = scope.k1v_1;
|
|
1225
1225
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1226
1226
|
// Inline function 'kotlin.apply' call
|
|
1227
1227
|
var this_5 = new TransformerBuilder();
|
|
1228
|
-
this_5.
|
|
1229
|
-
var tmp$ret$10 = this_5.
|
|
1230
|
-
tmp_0.
|
|
1231
|
-
var tmp_1 = scope.
|
|
1228
|
+
this_5.b1j(JavaIrEmitter$emitShared$lambda_1(clientServer));
|
|
1229
|
+
var tmp$ret$10 = this_5.c1j();
|
|
1230
|
+
tmp_0.k1v_1 = transform(this_4, tmp$ret$10);
|
|
1231
|
+
var tmp_1 = scope.k1v_1;
|
|
1232
1232
|
var wirespecShared = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1233
1233
|
var tmp_2;
|
|
1234
|
-
if (this.
|
|
1234
|
+
if (this.t1x_1.xo_1) {
|
|
1235
1235
|
tmp_2 = wirespecShared;
|
|
1236
1236
|
} else {
|
|
1237
1237
|
tmp_2 = null;
|
|
@@ -1240,9 +1240,9 @@ protoOf(JavaIrEmitter).x1v = function () {
|
|
|
1240
1240
|
};
|
|
1241
1241
|
protoOf(JavaIrEmitter).lr = function (definition, module_0, logger) {
|
|
1242
1242
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1243
|
-
var tmp = file.
|
|
1243
|
+
var tmp = file.d1o(Companion_getInstance().r1h(sanitizeSymbol_0(this, file.z1n_1.s1h())));
|
|
1244
1244
|
// Inline function 'kotlin.takeIf' call
|
|
1245
|
-
var this_0 = this.
|
|
1245
|
+
var this_0 = this.w1x_1;
|
|
1246
1246
|
var tmp_0;
|
|
1247
1247
|
if (Companion_instance_1.hr(module_0)) {
|
|
1248
1248
|
tmp_0 = this_0;
|
|
@@ -1250,9 +1250,9 @@ protoOf(JavaIrEmitter).lr = function (definition, module_0, logger) {
|
|
|
1250
1250
|
tmp_0 = null;
|
|
1251
1251
|
}
|
|
1252
1252
|
var tmp$ret$1 = tmp_0;
|
|
1253
|
-
return placeInPackage(prependImports(tmp, tmp$ret$1), this.
|
|
1253
|
+
return placeInPackage(prependImports(tmp, tmp$ret$1), this.y1w(), definition);
|
|
1254
1254
|
};
|
|
1255
|
-
protoOf(JavaIrEmitter).
|
|
1255
|
+
protoOf(JavaIrEmitter).g1w = function (definition, module_0) {
|
|
1256
1256
|
var tmp;
|
|
1257
1257
|
if (definition instanceof Type) {
|
|
1258
1258
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1272,33 +1272,33 @@ protoOf(JavaIrEmitter).c1w = function (definition, module_0) {
|
|
|
1272
1272
|
}
|
|
1273
1273
|
}
|
|
1274
1274
|
var generatorFile = tmp;
|
|
1275
|
-
var sanitized = sanitizeNames(generatorFile, this.
|
|
1275
|
+
var sanitized = sanitizeNames(generatorFile, this.x1x_1);
|
|
1276
1276
|
var generatorOwnName = definition.mr().l1() + 'Generator';
|
|
1277
1277
|
var tmp_0 = asSequence_0(collectCustomTypeNames(sanitized));
|
|
1278
1278
|
var tmp_1 = filterNot(tmp_0, JavaIrEmitter$emitGenerator$lambda);
|
|
1279
1279
|
var tmp_2 = filterNot(tmp_1, JavaIrEmitter$emitGenerator$lambda_0(generatorOwnName));
|
|
1280
1280
|
var tmp_3 = distinct_0(map(tmp_2, JavaIrEmitter$emitGenerator$lambda_1));
|
|
1281
1281
|
var modelImports = toList(map(tmp_3, JavaIrEmitter$emitGenerator$lambda_2(this)));
|
|
1282
|
-
return placeInPackage_0(prependImports(sanitized, plus_1(this.
|
|
1282
|
+
return placeInPackage_0(prependImports(sanitized, plus_1(this.w1x_1, modelImports)), this.y1w(), 'generator');
|
|
1283
1283
|
};
|
|
1284
1284
|
protoOf(JavaIrEmitter).kq = function (type, module_0) {
|
|
1285
|
-
return sanitizeNames(convertWithValidation(type, module_0), this.
|
|
1285
|
+
return sanitizeNames(convertWithValidation(type, module_0), this.x1x_1);
|
|
1286
1286
|
};
|
|
1287
1287
|
protoOf(JavaIrEmitter).zr = function (enum_0, module_0) {
|
|
1288
1288
|
var tmp = convert_0(enum_0);
|
|
1289
1289
|
var tmp_0 = JavaIrEmitter$emit$lambda(this);
|
|
1290
|
-
return sanitizeNames(injectEnumLabelField(tmp, tmp_0, JavaIrEmitter$emit$lambda_0), this.
|
|
1290
|
+
return sanitizeNames(injectEnumLabelField(tmp, tmp_0, JavaIrEmitter$emit$lambda_0), this.x1x_1);
|
|
1291
1291
|
};
|
|
1292
1292
|
protoOf(JavaIrEmitter).pr = function (union) {
|
|
1293
|
-
return sanitizeNames(convert_1(union), this.
|
|
1293
|
+
return sanitizeNames(convert_1(union), this.x1x_1);
|
|
1294
1294
|
};
|
|
1295
1295
|
protoOf(JavaIrEmitter).ur = function (refined) {
|
|
1296
|
-
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.
|
|
1296
|
+
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.x1x_1);
|
|
1297
1297
|
};
|
|
1298
1298
|
protoOf(JavaIrEmitter).as = function (endpoint) {
|
|
1299
|
-
var tmp = sanitizeNames(transformTypeDescriptors(injectApiField(injectHandleFunction(convert_3(endpoint), endpoint))), this.
|
|
1299
|
+
var tmp = sanitizeNames(transformTypeDescriptors(injectApiField(injectHandleFunction(convert_3(endpoint), endpoint))), this.x1x_1);
|
|
1300
1300
|
// Inline function 'kotlin.takeIf' call
|
|
1301
|
-
var this_0 = buildModelImports(endpoint, this.
|
|
1301
|
+
var this_0 = buildModelImports(endpoint, this.y1w());
|
|
1302
1302
|
var tmp_0;
|
|
1303
1303
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1304
1304
|
if (!this_0.r()) {
|
|
@@ -1312,22 +1312,22 @@ protoOf(JavaIrEmitter).as = function (endpoint) {
|
|
|
1312
1312
|
protoOf(JavaIrEmitter).or = function (channel) {
|
|
1313
1313
|
var tmp;
|
|
1314
1314
|
if (channel.cp_1.l1() === channel.dp_1.l1()) {
|
|
1315
|
-
tmp = this.
|
|
1315
|
+
tmp = this.y1w().ds_1 + '.model.';
|
|
1316
1316
|
} else {
|
|
1317
1317
|
tmp = '';
|
|
1318
1318
|
}
|
|
1319
1319
|
var fullyQualifiedPrefix = tmp;
|
|
1320
|
-
return applyFunctionalInterface(sanitizeNames(convert_4(channel), this.
|
|
1320
|
+
return applyFunctionalInterface(sanitizeNames(convert_4(channel), this.x1x_1), fullyQualifiedPrefix);
|
|
1321
1321
|
};
|
|
1322
|
-
protoOf(JavaIrEmitter).
|
|
1323
|
-
var imports = buildModelImports(endpoint, this.
|
|
1324
|
-
var endpointImport = import_0(this.
|
|
1322
|
+
protoOf(JavaIrEmitter).f1w = function (endpoint) {
|
|
1323
|
+
var imports = buildModelImports(endpoint, this.y1w());
|
|
1324
|
+
var endpointImport = import_0(this.y1w().ds_1 + '.endpoint', endpoint.up_1.l1());
|
|
1325
1325
|
var endpointName = endpoint.up_1.l1();
|
|
1326
|
-
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.
|
|
1327
|
-
var subPackageName = plus_0(this.
|
|
1328
|
-
return new File(Companion_getInstance().
|
|
1326
|
+
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.x1x_1)), endpointName);
|
|
1327
|
+
var subPackageName = plus_0(this.y1w(), 'client');
|
|
1328
|
+
return new File(Companion_getInstance().r1h(subPackageName.fs() + sanitizeSymbol_0(this, file.z1n_1.s1h())), plus_1(plus_1(plus_1(plus_1(listOf(new Package(subPackageName.ds_1)), this.w1x_1), imports), listOf(endpointImport)), file.a1o_1));
|
|
1329
1329
|
};
|
|
1330
|
-
protoOf(JavaIrEmitter).
|
|
1330
|
+
protoOf(JavaIrEmitter).c1w = function (endpoints, logger) {
|
|
1331
1331
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1332
1332
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1333
1333
|
var destination = ArrayList_init_$Create$();
|
|
@@ -1387,7 +1387,7 @@ protoOf(JavaIrEmitter).y1v = function (endpoints, logger) {
|
|
|
1387
1387
|
var _iterator__ex2g4s_3 = destination_0.t();
|
|
1388
1388
|
while (_iterator__ex2g4s_3.u()) {
|
|
1389
1389
|
var item = _iterator__ex2g4s_3.v();
|
|
1390
|
-
var tmp$ret$10 = import_0(this.
|
|
1390
|
+
var tmp$ret$10 = import_0(this.y1w().ds_1 + '.model', item.bv_1);
|
|
1391
1391
|
destination_1.x(tmp$ret$10);
|
|
1392
1392
|
}
|
|
1393
1393
|
var imports = destination_1;
|
|
@@ -1397,7 +1397,7 @@ protoOf(JavaIrEmitter).y1v = function (endpoints, logger) {
|
|
|
1397
1397
|
var _iterator__ex2g4s_4 = endpoints.t();
|
|
1398
1398
|
while (_iterator__ex2g4s_4.u()) {
|
|
1399
1399
|
var item_0 = _iterator__ex2g4s_4.v();
|
|
1400
|
-
var tmp$ret$13 = import_0(this.
|
|
1400
|
+
var tmp$ret$13 = import_0(this.y1w().ds_1 + '.endpoint', item_0.up_1.l1());
|
|
1401
1401
|
destination_2.x(tmp$ret$13);
|
|
1402
1402
|
}
|
|
1403
1403
|
var endpointImports = destination_2;
|
|
@@ -1407,19 +1407,19 @@ protoOf(JavaIrEmitter).y1v = function (endpoints, logger) {
|
|
|
1407
1407
|
var _iterator__ex2g4s_5 = endpoints.t();
|
|
1408
1408
|
while (_iterator__ex2g4s_5.u()) {
|
|
1409
1409
|
var item_1 = _iterator__ex2g4s_5.v();
|
|
1410
|
-
var tmp$ret$16 = import_0(this.
|
|
1410
|
+
var tmp$ret$16 = import_0(this.y1w().ds_1 + '.client', item_1.up_1.l1() + 'Client');
|
|
1411
1411
|
destination_3.x(tmp$ret$16);
|
|
1412
1412
|
}
|
|
1413
1413
|
var clientImports = destination_3;
|
|
1414
1414
|
var allImports = plus_1(plus_1(imports, endpointImports), clientImports);
|
|
1415
|
-
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.
|
|
1416
|
-
return new File(Companion_getInstance().
|
|
1415
|
+
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.x1x_1);
|
|
1416
|
+
return new File(Companion_getInstance().r1h(this.y1w().fs() + sanitizeSymbol_0(this, file.z1n_1.s1h())), plus_1(plus_1(plus_1(listOf(new Package(this.y1w().ds_1)), this.w1x_1), allImports), file.a1o_1));
|
|
1417
1417
|
};
|
|
1418
1418
|
function transformTypeDescriptors(_this__u8e3s4) {
|
|
1419
1419
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1420
1420
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1421
|
-
scope.
|
|
1422
|
-
var tmp = scope.
|
|
1421
|
+
scope.t1v(transformTypeDescriptors$lambda);
|
|
1422
|
+
var tmp = scope.k1v_1;
|
|
1423
1423
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1424
1424
|
}
|
|
1425
1425
|
function applyRefinedStructShape(_this__u8e3s4, refined) {
|
|
@@ -1428,14 +1428,14 @@ function applyRefinedStructShape(_this__u8e3s4, refined) {
|
|
|
1428
1428
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1429
1429
|
var tmp = scope;
|
|
1430
1430
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1431
|
-
var this_0 = scope.
|
|
1431
|
+
var this_0 = scope.k1v_1;
|
|
1432
1432
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1433
1433
|
// Inline function 'kotlin.apply' call
|
|
1434
1434
|
var this_1 = new TransformerBuilder();
|
|
1435
|
-
this_1.
|
|
1436
|
-
var tmp$ret$2 = this_1.
|
|
1437
|
-
tmp.
|
|
1438
|
-
var tmp_0 = scope.
|
|
1435
|
+
this_1.b1j(applyRefinedStructShape$lambda(refined));
|
|
1436
|
+
var tmp$ret$2 = this_1.c1j();
|
|
1437
|
+
tmp.k1v_1 = transform(this_0, tmp$ret$2);
|
|
1438
|
+
var tmp_0 = scope.k1v_1;
|
|
1439
1439
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1440
1440
|
}
|
|
1441
1441
|
function injectApiField(_this__u8e3s4) {
|
|
@@ -1445,14 +1445,14 @@ function injectApiField(_this__u8e3s4) {
|
|
|
1445
1445
|
var tmp = scope;
|
|
1446
1446
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1447
1447
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1448
|
-
var this_0 = scope.
|
|
1448
|
+
var this_0 = scope.k1v_1;
|
|
1449
1449
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1450
1450
|
// Inline function 'kotlin.apply' call
|
|
1451
1451
|
var this_1 = new TransformerBuilder();
|
|
1452
|
-
this_1.
|
|
1453
|
-
var tmp$ret$2 = this_1.
|
|
1454
|
-
tmp.
|
|
1455
|
-
var tmp_0 = scope.
|
|
1452
|
+
this_1.b1j(injectApiField$lambda);
|
|
1453
|
+
var tmp$ret$2 = this_1.c1j();
|
|
1454
|
+
tmp.k1v_1 = transform(this_0, tmp$ret$2);
|
|
1455
|
+
var tmp_0 = scope.k1v_1;
|
|
1456
1456
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1457
1457
|
}
|
|
1458
1458
|
function injectHandleFunction(_this__u8e3s4, endpoint) {
|
|
@@ -1462,14 +1462,14 @@ function injectHandleFunction(_this__u8e3s4, endpoint) {
|
|
|
1462
1462
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1463
1463
|
var tmp = scope;
|
|
1464
1464
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1465
|
-
var this_0 = scope.
|
|
1465
|
+
var this_0 = scope.k1v_1;
|
|
1466
1466
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1467
1467
|
// Inline function 'kotlin.apply' call
|
|
1468
1468
|
var this_1 = new TransformerBuilder();
|
|
1469
|
-
this_1.
|
|
1470
|
-
var tmp$ret$2 = this_1.
|
|
1471
|
-
tmp.
|
|
1472
|
-
var tmp_0 = scope.
|
|
1469
|
+
this_1.b1j(injectHandleFunction$lambda(handlersStruct));
|
|
1470
|
+
var tmp$ret$2 = this_1.c1j();
|
|
1471
|
+
tmp.k1v_1 = transform(this_0, tmp$ret$2);
|
|
1472
|
+
var tmp_0 = scope.k1v_1;
|
|
1473
1473
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1474
1474
|
}
|
|
1475
1475
|
function buildModelImports(_this__u8e3s4, packageName) {
|
|
@@ -1490,7 +1490,7 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1490
1490
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1491
1491
|
while (_iterator__ex2g4s_0.u()) {
|
|
1492
1492
|
var item = _iterator__ex2g4s_0.v();
|
|
1493
|
-
var tmp$ret$3 = import_0(packageName.ds_1 + '.model', Companion_getInstance().
|
|
1493
|
+
var tmp$ret$3 = import_0(packageName.ds_1 + '.model', Companion_getInstance().r1h(item.bv_1).s1h());
|
|
1494
1494
|
destination_0.x(tmp$ret$3);
|
|
1495
1495
|
}
|
|
1496
1496
|
return destination_0;
|
|
@@ -1501,24 +1501,24 @@ function applyFunctionalInterface(_this__u8e3s4, fullyQualifiedPrefix) {
|
|
|
1501
1501
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1502
1502
|
var tmp = scope;
|
|
1503
1503
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1504
|
-
var this_0 = scope.
|
|
1504
|
+
var this_0 = scope.k1v_1;
|
|
1505
1505
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1506
1506
|
// Inline function 'kotlin.apply' call
|
|
1507
1507
|
var this_1 = new TransformerBuilder();
|
|
1508
|
-
this_1.
|
|
1509
|
-
var tmp$ret$2 = this_1.
|
|
1510
|
-
tmp.
|
|
1508
|
+
this_1.b1j(applyFunctionalInterface$lambda(fullyQualifiedPrefix));
|
|
1509
|
+
var tmp$ret$2 = this_1.c1j();
|
|
1510
|
+
tmp.k1v_1 = transform(this_0, tmp$ret$2);
|
|
1511
1511
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1512
1512
|
var tmp_0 = scope;
|
|
1513
1513
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1514
|
-
var this_2 = scope.
|
|
1514
|
+
var this_2 = scope.k1v_1;
|
|
1515
1515
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1516
1516
|
// Inline function 'kotlin.apply' call
|
|
1517
1517
|
var this_3 = new TransformerBuilder();
|
|
1518
|
-
this_3.
|
|
1519
|
-
var tmp$ret$7 = this_3.
|
|
1520
|
-
tmp_0.
|
|
1521
|
-
var tmp_1 = scope.
|
|
1518
|
+
this_3.b1j(applyFunctionalInterface$lambda_0);
|
|
1519
|
+
var tmp$ret$7 = this_3.c1j();
|
|
1520
|
+
tmp_0.k1v_1 = transform(this_2, tmp$ret$7);
|
|
1521
|
+
var tmp_1 = scope.k1v_1;
|
|
1522
1522
|
return isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1523
1523
|
}
|
|
1524
1524
|
function wrapAsyncReturnInThenApply(_this__u8e3s4, endpointName) {
|
|
@@ -1527,26 +1527,26 @@ function wrapAsyncReturnInThenApply(_this__u8e3s4, endpointName) {
|
|
|
1527
1527
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1528
1528
|
var tmp = scope;
|
|
1529
1529
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1530
|
-
var this_0 = scope.
|
|
1530
|
+
var this_0 = scope.k1v_1;
|
|
1531
1531
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1532
1532
|
// Inline function 'kotlin.apply' call
|
|
1533
1533
|
var this_1 = new TransformerBuilder();
|
|
1534
|
-
this_1.
|
|
1535
|
-
var tmp$ret$2 = this_1.
|
|
1536
|
-
tmp.
|
|
1537
|
-
var tmp_0 = scope.
|
|
1534
|
+
this_1.b1j(wrapAsyncReturnInThenApply$lambda(endpointName));
|
|
1535
|
+
var tmp$ret$2 = this_1.c1j();
|
|
1536
|
+
tmp.k1v_1 = transform(this_0, tmp$ret$2);
|
|
1537
|
+
var tmp_0 = scope.k1v_1;
|
|
1538
1538
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1539
1539
|
}
|
|
1540
1540
|
function findRoot(_this__u8e3s4) {
|
|
1541
1541
|
var tmp;
|
|
1542
1542
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
1543
|
-
tmp = findRoot(_this__u8e3s4.
|
|
1543
|
+
tmp = findRoot(_this__u8e3s4.j1j_1);
|
|
1544
1544
|
} else {
|
|
1545
1545
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
1546
|
-
tmp = findRoot(_this__u8e3s4.
|
|
1546
|
+
tmp = findRoot(_this__u8e3s4.k1j_1);
|
|
1547
1547
|
} else {
|
|
1548
1548
|
if (_this__u8e3s4 instanceof Dict_0) {
|
|
1549
|
-
tmp = findRoot(_this__u8e3s4.
|
|
1549
|
+
tmp = findRoot(_this__u8e3s4.n1n_1);
|
|
1550
1550
|
} else {
|
|
1551
1551
|
tmp = _this__u8e3s4;
|
|
1552
1552
|
}
|
|
@@ -1575,7 +1575,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1575
1575
|
var tmp;
|
|
1576
1576
|
if (_this__u8e3s4 instanceof Integer_0) {
|
|
1577
1577
|
var tmp_0;
|
|
1578
|
-
switch (_this__u8e3s4.
|
|
1578
|
+
switch (_this__u8e3s4.j1n_1.b3_1) {
|
|
1579
1579
|
case 0:
|
|
1580
1580
|
tmp_0 = 'Integer';
|
|
1581
1581
|
break;
|
|
@@ -1590,7 +1590,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1590
1590
|
} else {
|
|
1591
1591
|
if (_this__u8e3s4 instanceof Number_1) {
|
|
1592
1592
|
var tmp_1;
|
|
1593
|
-
switch (_this__u8e3s4.
|
|
1593
|
+
switch (_this__u8e3s4.k1n_1.b3_1) {
|
|
1594
1594
|
case 0:
|
|
1595
1595
|
tmp_1 = 'Float';
|
|
1596
1596
|
break;
|
|
@@ -1619,7 +1619,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1619
1619
|
tmp = 'Void';
|
|
1620
1620
|
} else {
|
|
1621
1621
|
if (_this__u8e3s4 instanceof Custom_0) {
|
|
1622
|
-
tmp = _this__u8e3s4.
|
|
1622
|
+
tmp = _this__u8e3s4.l1j_1.s1h();
|
|
1623
1623
|
} else {
|
|
1624
1624
|
tmp = 'Object';
|
|
1625
1625
|
}
|
|
@@ -1643,8 +1643,8 @@ function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
|
1643
1643
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1644
1644
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1645
1645
|
var tmp_0 = withFullyQualifiedPrefix$lambda;
|
|
1646
|
-
scope.
|
|
1647
|
-
var tmp_1 = scope.
|
|
1646
|
+
scope.n1v(tmp_0, withFullyQualifiedPrefix$lambda_0(prefix));
|
|
1647
|
+
var tmp_1 = scope.k1v_1;
|
|
1648
1648
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1649
1649
|
} else {
|
|
1650
1650
|
tmp = _this__u8e3s4;
|
|
@@ -1654,8 +1654,8 @@ function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
|
1654
1654
|
function transformTypeDescriptors$lambda(stmt, tr) {
|
|
1655
1655
|
var tmp;
|
|
1656
1656
|
if (stmt instanceof TypeDescriptor) {
|
|
1657
|
-
var rootType = findRoot(stmt.
|
|
1658
|
-
var containerStr = rawContainerClass(stmt.
|
|
1657
|
+
var rootType = findRoot(stmt.p1p_1);
|
|
1658
|
+
var containerStr = rawContainerClass(stmt.p1p_1);
|
|
1659
1659
|
var rootStr = toJavaName(rootType) + '.class';
|
|
1660
1660
|
var tmp_0;
|
|
1661
1661
|
if (containerStr == null) {
|
|
@@ -1674,8 +1674,8 @@ function transformTypeDescriptors$lambda(stmt, tr) {
|
|
|
1674
1674
|
}
|
|
1675
1675
|
function applyRefinedStructShape$lambda$lambda($refined) {
|
|
1676
1676
|
return function ($this$function) {
|
|
1677
|
-
$this$function.
|
|
1678
|
-
$this$function.
|
|
1677
|
+
$this$function.f1i(convert_5($refined.tr_1));
|
|
1678
|
+
$this$function.g1i(new VariableReference(Companion_getInstance().r1h('value')));
|
|
1679
1679
|
return Unit_instance;
|
|
1680
1680
|
};
|
|
1681
1681
|
}
|
|
@@ -1685,18 +1685,18 @@ function applyRefinedStructShape$lambda($refined) {
|
|
|
1685
1685
|
if (element instanceof Struct) {
|
|
1686
1686
|
var tmp_0 = listOf(Custom_init_$Create$('Wirespec.Refined'));
|
|
1687
1687
|
// Inline function 'kotlin.collections.map' call
|
|
1688
|
-
var this_0 = element.
|
|
1688
|
+
var this_0 = element.o1o_1;
|
|
1689
1689
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1690
1690
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1691
1691
|
var _iterator__ex2g4s = this_0.t();
|
|
1692
1692
|
while (_iterator__ex2g4s.u()) {
|
|
1693
1693
|
var item = _iterator__ex2g4s.v();
|
|
1694
1694
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
1695
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1695
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.p1l(VOID, VOID, VOID, VOID, VOID, VOID, VOID, true);
|
|
1696
1696
|
var tmp$ret$0 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
1697
1697
|
destination.x(tmp$ret$0);
|
|
1698
1698
|
}
|
|
1699
|
-
var tmp_1 = element.
|
|
1699
|
+
var tmp_1 = element.r1o(VOID, VOID, VOID, tmp_0, destination);
|
|
1700
1700
|
tmp = plus_3(tmp_1, function_0('value', VOID, true, applyRefinedStructShape$lambda$lambda($refined)));
|
|
1701
1701
|
} else {
|
|
1702
1702
|
tmp = element;
|
|
@@ -1712,7 +1712,7 @@ function injectApiField$lambda(element, transformer) {
|
|
|
1712
1712
|
var tmp_0;
|
|
1713
1713
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1714
1714
|
if (!injected.r()) {
|
|
1715
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1715
|
+
tmp_0 = withElements(element, plus_1(element.b1o(), injected));
|
|
1716
1716
|
} else {
|
|
1717
1717
|
tmp_0 = element;
|
|
1718
1718
|
}
|
|
@@ -1731,7 +1731,7 @@ function injectHandleFunction$lambda$lambda($handlersStruct) {
|
|
|
1731
1731
|
var tmp_0;
|
|
1732
1732
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1733
1733
|
if (!injected.r()) {
|
|
1734
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1734
|
+
tmp_0 = withElements(element, plus_1(element.b1o(), injected));
|
|
1735
1735
|
} else {
|
|
1736
1736
|
tmp_0 = element;
|
|
1737
1737
|
}
|
|
@@ -1748,21 +1748,21 @@ function injectHandleFunction$lambda($handlersStruct) {
|
|
|
1748
1748
|
var tmp;
|
|
1749
1749
|
if (element instanceof Interface) {
|
|
1750
1750
|
var tmp_0;
|
|
1751
|
-
if (element.
|
|
1751
|
+
if (element.t1o_1.equals(Companion_getInstance().r1h('Handler'))) {
|
|
1752
1752
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1753
1753
|
var scope = new TransformScope(element);
|
|
1754
1754
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1755
1755
|
var tmp_1 = scope;
|
|
1756
1756
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1757
1757
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1758
|
-
var this_0 = scope.
|
|
1758
|
+
var this_0 = scope.k1v_1;
|
|
1759
1759
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1760
1760
|
// Inline function 'kotlin.apply' call
|
|
1761
1761
|
var this_1 = new TransformerBuilder();
|
|
1762
|
-
this_1.
|
|
1763
|
-
var tmp$ret$2 = this_1.
|
|
1764
|
-
tmp_1.
|
|
1765
|
-
var tmp_2 = scope.
|
|
1762
|
+
this_1.b1j(injectHandleFunction$lambda$lambda($handlersStruct));
|
|
1763
|
+
var tmp$ret$2 = this_1.c1j();
|
|
1764
|
+
tmp_1.k1v_1 = transform(this_0, tmp$ret$2);
|
|
1765
|
+
var tmp_2 = scope.k1v_1;
|
|
1766
1766
|
tmp_0 = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1767
1767
|
} else {
|
|
1768
1768
|
tmp_0 = element;
|
|
@@ -1792,7 +1792,7 @@ function applyFunctionalInterface$lambda_0(element, transformer) {
|
|
|
1792
1792
|
if (element instanceof File) {
|
|
1793
1793
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1794
1794
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1795
|
-
var tmp0 = element.
|
|
1795
|
+
var tmp0 = element.b1o();
|
|
1796
1796
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1797
1797
|
var destination = ArrayList_init_$Create$();
|
|
1798
1798
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1804,7 +1804,7 @@ function applyFunctionalInterface$lambda_0(element, transformer) {
|
|
|
1804
1804
|
}
|
|
1805
1805
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1806
1806
|
var interfaceElement = ensureNotNull(tmp$ret$2);
|
|
1807
|
-
tmp = element.
|
|
1807
|
+
tmp = element.d1o(VOID, listOf_0([new RawElement('@FunctionalInterface\n'), interfaceElement]));
|
|
1808
1808
|
} else {
|
|
1809
1809
|
tmp = element;
|
|
1810
1810
|
}
|
|
@@ -1817,11 +1817,11 @@ function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
|
1817
1817
|
if (element instanceof Function) {
|
|
1818
1818
|
var tmp$ret$0;
|
|
1819
1819
|
$l$block_1: {
|
|
1820
|
-
if (!element.
|
|
1820
|
+
if (!element.m1l_1 || element.l1l_1.a1() < 2) {
|
|
1821
1821
|
tmp$ret$0 = element;
|
|
1822
1822
|
break $l$block_1;
|
|
1823
1823
|
}
|
|
1824
|
-
var tmp_0 = element.
|
|
1824
|
+
var tmp_0 = element.l1l_1.b1(element.l1l_1.a1() - 2 | 0);
|
|
1825
1825
|
var tmp0_elvis_lhs = tmp_0 instanceof Assignment ? tmp_0 : null;
|
|
1826
1826
|
var tmp_1;
|
|
1827
1827
|
if (tmp0_elvis_lhs == null) {
|
|
@@ -1831,16 +1831,16 @@ function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
|
1831
1831
|
tmp_1 = tmp0_elvis_lhs;
|
|
1832
1832
|
}
|
|
1833
1833
|
var transportAssign = tmp_1;
|
|
1834
|
-
var tmp_2 = last(element.
|
|
1834
|
+
var tmp_2 = last(element.l1l_1);
|
|
1835
1835
|
if (!(tmp_2 instanceof ReturnStatement)) {
|
|
1836
1836
|
tmp$ret$0 = element;
|
|
1837
1837
|
break $l$block_1;
|
|
1838
1838
|
}
|
|
1839
|
-
var tmp_3 = dropLast(element.
|
|
1840
|
-
var tmp1_name = Companion_getInstance().
|
|
1841
|
-
var tmp2_receiver = transportAssign.
|
|
1842
|
-
var tmp3_arguments = mapOf(to(Companion_getInstance().
|
|
1843
|
-
tmp$ret$0 = element.
|
|
1839
|
+
var tmp_3 = dropLast(element.l1l_1, 2);
|
|
1840
|
+
var tmp1_name = Companion_getInstance().r1h('thenApply');
|
|
1841
|
+
var tmp2_receiver = transportAssign.s1p_1;
|
|
1842
|
+
var tmp3_arguments = mapOf(to(Companion_getInstance().r1h('mapper'), new RawExpression('rawResponse -> ' + $endpointName + '.fromRawResponse(serialization(), rawResponse)')));
|
|
1843
|
+
tmp$ret$0 = element.p1l(VOID, VOID, VOID, VOID, plus_2(tmp_3, new ReturnStatement(new FunctionCall(tmp2_receiver, VOID, tmp1_name, tmp3_arguments))));
|
|
1844
1844
|
}
|
|
1845
1845
|
tmp = tmp$ret$0;
|
|
1846
1846
|
} else {
|
|
@@ -1865,50 +1865,50 @@ function buildHandlersStruct$lambda(it) {
|
|
|
1865
1865
|
}
|
|
1866
1866
|
function buildHandlersStruct$lambda$lambda($pathTemplate) {
|
|
1867
1867
|
return function ($this$function) {
|
|
1868
|
-
$this$function.
|
|
1869
|
-
$this$function.
|
|
1868
|
+
$this$function.f1i(String_instance);
|
|
1869
|
+
$this$function.g1i($this$function.p1u($pathTemplate));
|
|
1870
1870
|
return Unit_instance;
|
|
1871
1871
|
};
|
|
1872
1872
|
}
|
|
1873
1873
|
function buildHandlersStruct$lambda$lambda_0($this_buildHandlersStruct) {
|
|
1874
1874
|
return function ($this$function) {
|
|
1875
|
-
$this$function.
|
|
1876
|
-
$this$function.
|
|
1875
|
+
$this$function.f1i(String_instance);
|
|
1876
|
+
$this$function.g1i($this$function.p1u($this_buildHandlersStruct.vp_1.a3_1));
|
|
1877
1877
|
return Unit_instance;
|
|
1878
1878
|
};
|
|
1879
1879
|
}
|
|
1880
1880
|
function buildHandlersStruct$lambda$lambda_1($this$function) {
|
|
1881
|
-
$this$function.
|
|
1882
|
-
$this$function.
|
|
1883
|
-
$this$function.
|
|
1881
|
+
$this$function.f1i($this$function.t1h('Wirespec.ServerEdge', [$this$function.t1h('Request', []), $this$function.t1h('Response', [Wildcard_instance])]));
|
|
1882
|
+
$this$function.c1i('serialization', $this$function.t1h('Wirespec.Serialization', []));
|
|
1883
|
+
$this$function.g1i(new RawExpression('new Wirespec.ServerEdge<>() {\n@Override public Request from(Wirespec.RawRequest request) {\n return fromRawRequest(serialization, request);\n}\n@Override public Wirespec.RawResponse to(Response<?> response) {\n return toRawResponse(serialization, response);\n}\n}'));
|
|
1884
1884
|
return Unit_instance;
|
|
1885
1885
|
}
|
|
1886
1886
|
function buildHandlersStruct$lambda$lambda_2($this$function) {
|
|
1887
|
-
$this$function.
|
|
1888
|
-
$this$function.
|
|
1889
|
-
$this$function.
|
|
1887
|
+
$this$function.f1i($this$function.t1h('Wirespec.ClientEdge', [$this$function.t1h('Request', []), $this$function.t1h('Response', [Wildcard_instance])]));
|
|
1888
|
+
$this$function.c1i('serialization', $this$function.t1h('Wirespec.Serialization', []));
|
|
1889
|
+
$this$function.g1i(new RawExpression('new Wirespec.ClientEdge<>() {\n@Override public Wirespec.RawRequest to(Request request) {\n return toRawRequest(serialization, request);\n}\n@Override public Response<?> from(Wirespec.RawResponse response) {\n return fromRawResponse(serialization, response);\n}\n}'));
|
|
1890
1890
|
return Unit_instance;
|
|
1891
1891
|
}
|
|
1892
1892
|
function buildHandlersStruct$lambda_0($pathTemplate, $this_buildHandlersStruct) {
|
|
1893
1893
|
return function ($this$struct) {
|
|
1894
|
-
$this$struct.
|
|
1895
|
-
$this$struct.
|
|
1896
|
-
$this$struct.
|
|
1897
|
-
$this$struct.
|
|
1898
|
-
$this$struct.
|
|
1899
|
-
$this$struct.
|
|
1894
|
+
$this$struct.y1k($this$struct.t1h('Wirespec.Server', [$this$struct.t1h('Request', []), $this$struct.t1h('Response', [Wildcard_instance])]));
|
|
1895
|
+
$this$struct.y1k($this$struct.t1h('Wirespec.Client', [$this$struct.t1h('Request', []), $this$struct.t1h('Response', [Wildcard_instance])]));
|
|
1896
|
+
$this$struct.h1i('getPathTemplate', VOID, true, buildHandlersStruct$lambda$lambda($pathTemplate));
|
|
1897
|
+
$this$struct.h1i('getMethod', VOID, true, buildHandlersStruct$lambda$lambda_0($this_buildHandlersStruct));
|
|
1898
|
+
$this$struct.h1i('getServer', VOID, true, buildHandlersStruct$lambda$lambda_1);
|
|
1899
|
+
$this$struct.h1i('getClient', VOID, true, buildHandlersStruct$lambda$lambda_2);
|
|
1900
1900
|
return Unit_instance;
|
|
1901
1901
|
};
|
|
1902
1902
|
}
|
|
1903
1903
|
function withFullyQualifiedPrefix$lambda(it) {
|
|
1904
|
-
return it.
|
|
1904
|
+
return it.c1q_1.equals(Companion_getInstance().r1h('message'));
|
|
1905
1905
|
}
|
|
1906
1906
|
function withFullyQualifiedPrefix$lambda_0($prefix) {
|
|
1907
1907
|
return function (param) {
|
|
1908
|
-
var t = param.
|
|
1908
|
+
var t = param.d1q_1;
|
|
1909
1909
|
var tmp;
|
|
1910
1910
|
if (t instanceof Custom_0) {
|
|
1911
|
-
tmp = param.
|
|
1911
|
+
tmp = param.f1q(VOID, t.q1n(Companion_getInstance().r1h($prefix + t.l1j_1.s1h())));
|
|
1912
1912
|
} else {
|
|
1913
1913
|
tmp = param;
|
|
1914
1914
|
}
|
|
@@ -1919,8 +1919,8 @@ function JavaRefinedTypeDefinitionEmitter() {
|
|
|
1919
1919
|
}
|
|
1920
1920
|
function JavaShared() {
|
|
1921
1921
|
JavaShared_instance = this;
|
|
1922
|
-
this.
|
|
1923
|
-
this.
|
|
1922
|
+
this.i1x_1 = 'community.flock.wirespec.java';
|
|
1923
|
+
this.j1x_1 = trimMargin('\n |package ' + this.i1x_1 + ';\n |\n |import java.lang.reflect.Type;\n |import java.lang.reflect.ParameterizedType;\n |import java.util.List;\n |import java.util.Map;\n |import java.util.Optional;\n |\n |public interface Wirespec {\n |' + Spacer_instance.toString() + 'interface Enum { String label(); }\n |' + Spacer_instance.toString() + 'interface Endpoint {}\n |' + Spacer_instance.toString() + 'interface Refined<T> { T value(); }\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 extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.hs(2) + 'Req from(RawRequest request);\n |' + Spacer_instance.hs(2) + 'RawResponse to(Res response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface ClientEdge<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.hs(2) + 'RawRequest to(Req request);\n |' + Spacer_instance.hs(2) + 'Res from(RawResponse response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.hs(2) + 'String getPathTemplate();\n |' + Spacer_instance.hs(2) + 'String getMethod();\n |' + Spacer_instance.hs(2) + 'ClientEdge<Req, Res> getClient(Serialization serialization);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Server<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.hs(2) + 'String getPathTemplate();\n |' + Spacer_instance.hs(2) + 'String getMethod();\n |' + Spacer_instance.hs(2) + 'ServerEdge<Req, Res> getServer(Serialization serialization);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'enum Method { GET, PUT, POST, DELETE, OPTIONS, HEAD, PATCH, TRACE }\n |' + Spacer_instance.toString() + 'interface Request<T> { Path path(); Method method(); Queries queries(); Headers headers(); T body(); interface Headers extends Wirespec.Headers {} }\n |' + Spacer_instance.toString() + 'interface Response<T> { Integer status(); Headers headers(); T body(); interface Headers extends Wirespec.Headers {} }\n |' + Spacer_instance.toString() + 'interface Serialization extends Serializer, Deserializer {}\n |' + Spacer_instance.toString() + 'interface Serializer extends BodySerializer, PathSerializer, ParamSerializer {}\n |' + Spacer_instance.toString() + 'interface Deserializer extends BodyDeserializer, PathDeserializer, ParamDeserializer {}\n |' + Spacer_instance.toString() + 'interface BodySerialization extends BodySerializer, BodyDeserializer {}\n |' + Spacer_instance.toString() + 'interface BodySerializer { <T> byte[] serializeBody(T t, Type type); }\n |' + Spacer_instance.toString() + 'interface BodyDeserializer { <T> T deserializeBody(byte[] raw, Type type); }\n |' + Spacer_instance.toString() + 'interface PathSerialization extends PathSerializer, PathDeserializer {}\n |' + Spacer_instance.toString() + 'interface PathSerializer { <T> String serializePath(T t, Type type); }\n |' + Spacer_instance.toString() + 'interface PathDeserializer { <T> T deserializePath(String raw, Type type); }\n |' + Spacer_instance.toString() + 'interface ParamSerialization extends ParamSerializer, ParamDeserializer {}\n |' + Spacer_instance.toString() + 'interface ParamSerializer { <T> List<String> serializeParam(T value, Type type); }\n |' + Spacer_instance.toString() + 'interface ParamDeserializer { <T> T deserializeParam(List<String> values, Type type); }\n |' + Spacer_instance.toString() + 'record RawRequest(String method, List<String> path, Map<String, List<String>> queries, Map<String, List<String>> headers, Optional<byte[]> body) {}\n |' + Spacer_instance.toString() + 'record RawResponse(int statusCode, Map<String, List<String>> headers, Optional<byte[]> body) {}\n |' + Spacer_instance.toString() + 'static Type getType(final Class<?> actualTypeArguments, final Class<?> rawType) {\n |' + Spacer_instance.hs(2) + 'if(rawType != null) {\n |' + Spacer_instance.hs(3) + 'return new ParameterizedType() {\n |' + Spacer_instance.hs(4) + 'public Type getRawType() { return rawType; }\n |' + Spacer_instance.hs(4) + 'public Type[] getActualTypeArguments() { return new Class<?>[]{actualTypeArguments}; }\n |' + Spacer_instance.hs(4) + 'public Type getOwnerType() { return null; }\n |' + Spacer_instance.hs(3) + '};\n |' + Spacer_instance.hs(2) + '}\n |' + Spacer_instance.hs(2) + 'else { return actualTypeArguments; }\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
1924
1924
|
}
|
|
1925
1925
|
protoOf(JavaShared).toString = function () {
|
|
1926
1926
|
return 'JavaShared';
|
|
@@ -2038,30 +2038,30 @@ function JavaUnionDefinitionEmitter$emit$lambda(it) {
|
|
|
2038
2038
|
function JavaUnionDefinitionEmitter() {
|
|
2039
2039
|
}
|
|
2040
2040
|
//region block: post-declaration
|
|
2041
|
-
protoOf(JavaEmitter).nr =
|
|
2041
|
+
protoOf(JavaEmitter).nr = emit_9;
|
|
2042
2042
|
protoOf(JavaEmitter).kq = emit_3;
|
|
2043
2043
|
protoOf(JavaEmitter).lq = emit_4;
|
|
2044
2044
|
protoOf(JavaEmitter).mq = emit_5;
|
|
2045
2045
|
protoOf(JavaEmitter).nq = emit_6;
|
|
2046
2046
|
protoOf(JavaEmitter).oq = emit_7;
|
|
2047
|
-
protoOf(JavaEmitter).as =
|
|
2048
|
-
protoOf(JavaEmitter).
|
|
2049
|
-
protoOf(JavaEmitter).
|
|
2047
|
+
protoOf(JavaEmitter).as = emit_11;
|
|
2048
|
+
protoOf(JavaEmitter).l1x = emit_12;
|
|
2049
|
+
protoOf(JavaEmitter).m1x = emit_13;
|
|
2050
2050
|
protoOf(JavaEmitter).or = emit_8;
|
|
2051
|
-
protoOf(JavaEmitter).zr =
|
|
2052
|
-
protoOf(JavaEmitter).pr =
|
|
2053
|
-
protoOf(JavaEmitter).ur =
|
|
2054
|
-
protoOf(JavaEmitter).
|
|
2055
|
-
protoOf(JavaEmitter).
|
|
2056
|
-
protoOf(JavaEmitter).
|
|
2057
|
-
protoOf(JavaEmitter).
|
|
2058
|
-
protoOf(JavaEmitter).
|
|
2059
|
-
protoOf(JavaEmitter).
|
|
2051
|
+
protoOf(JavaEmitter).zr = emit_15;
|
|
2052
|
+
protoOf(JavaEmitter).pr = emit_10;
|
|
2053
|
+
protoOf(JavaEmitter).ur = emit_14;
|
|
2054
|
+
protoOf(JavaEmitter).k1x = sanitizeSymbol;
|
|
2055
|
+
protoOf(JavaEmitter).n1x = sanitizeFirstIsDigit;
|
|
2056
|
+
protoOf(JavaEmitter).o1x = sanitizeKeywords;
|
|
2057
|
+
protoOf(JavaEmitter).a1x = emitRoot;
|
|
2058
|
+
protoOf(JavaEmitter).z1w = emitRoot$default;
|
|
2059
|
+
protoOf(JavaEmitter).p1x = emitHandleFunction;
|
|
2060
2060
|
protoOf(JavaEmitter).bs = emitValidator;
|
|
2061
|
-
protoOf(JavaIrEmitter).
|
|
2061
|
+
protoOf(JavaIrEmitter).z1v = get_extensions;
|
|
2062
2062
|
protoOf(JavaIrEmitter).eo = emit_1;
|
|
2063
|
-
protoOf(JavaIrEmitter).
|
|
2064
|
-
protoOf(JavaIrEmitter).
|
|
2063
|
+
protoOf(JavaIrEmitter).a1w = emit_2;
|
|
2064
|
+
protoOf(JavaIrEmitter).e1w = beforeGenerate;
|
|
2065
2065
|
//endregion
|
|
2066
2066
|
//region block: exports
|
|
2067
2067
|
export {
|