@flock/wirespec 0.19.2 → 0.19.3
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 +39 -39
- package/colormath-root-colormath.mjs +432 -432
- package/kotlin-kotlin-stdlib.mjs +6 -6
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +9765 -9765
- package/kotlin-rgxgen.mjs +1756 -1756
- package/kotlinx-io-kotlinx-io-core.mjs +403 -403
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1759 -1759
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1468 -1468
- package/mordant-mordant.mjs +1181 -1181
- package/package.json +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +238 -236
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +139 -137
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +176 -174
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +305 -303
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +112 -110
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +179 -177
- 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 +2626 -2578
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +479 -479
- package/wirespec-src-converter-openapi.mjs +338 -338
- package/wirespec-src-ide-lsp.mjs +1351 -1351
- package/wirespec-src-plugin-arguments.mjs +134 -134
- package/wirespec-src-plugin-cli.mjs +84 -84
- package/wirespec-src-plugin-npm.mjs +18 -18
- package/wirespec-src-tools-generator.mjs +2 -2
|
@@ -155,6 +155,7 @@ import {
|
|
|
155
155
|
convert1cn4bolzoed8c as convert_4,
|
|
156
156
|
emitEndpointClient1meajc90wf3el as emitEndpointClient,
|
|
157
157
|
emitClient32kfwzg2hm5vj as emitClient,
|
|
158
|
+
get_extensions31c4or738wbxz as get_extensions,
|
|
158
159
|
emit1oxjujel6f3jb as emit_1,
|
|
159
160
|
emit3bzdcd0f6nwtj as emit_2,
|
|
160
161
|
beforeGenerate3o8idb3hey1b0 as beforeGenerate,
|
|
@@ -214,10 +215,10 @@ function emit_6(_this__u8e3s4) {
|
|
|
214
215
|
function emitRoot(_this__u8e3s4, void_0) {
|
|
215
216
|
var tmp;
|
|
216
217
|
if (_this__u8e3s4 instanceof Dict) {
|
|
217
|
-
tmp = this.
|
|
218
|
+
tmp = this.v1w(_this__u8e3s4.so_1);
|
|
218
219
|
} else {
|
|
219
220
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
220
|
-
tmp = this.
|
|
221
|
+
tmp = this.v1w(_this__u8e3s4.po_1);
|
|
221
222
|
} else {
|
|
222
223
|
if (_this__u8e3s4 instanceof Unit) {
|
|
223
224
|
tmp = void_0;
|
|
@@ -246,7 +247,7 @@ function emitRoot(_this__u8e3s4, void_0) {
|
|
|
246
247
|
}
|
|
247
248
|
function emitRoot$default(_this__u8e3s4, void_0, $super) {
|
|
248
249
|
void_0 = void_0 === VOID ? 'void' : void_0;
|
|
249
|
-
return $super === VOID ? this.
|
|
250
|
+
return $super === VOID ? this.w1w(_this__u8e3s4, void_0) : emitRoot(_this__u8e3s4, void_0);
|
|
250
251
|
}
|
|
251
252
|
function emit_7(_this__u8e3s4) {
|
|
252
253
|
var tmp;
|
|
@@ -289,7 +290,7 @@ function emit_7(_this__u8e3s4) {
|
|
|
289
290
|
}
|
|
290
291
|
initMetadataForInterface(JavaTypeDefinitionEmitter, 'JavaTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter]);
|
|
291
292
|
function emit_8(channel) {
|
|
292
|
-
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.v1w(channel.dp_1) + ' message);\n |}\n |\n ');
|
|
293
294
|
}
|
|
294
295
|
initMetadataForInterface(JavaChannelDefinitionEmitter, 'JavaChannelDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
295
296
|
function emit_9(endpoint) {
|
|
@@ -299,7 +300,7 @@ function emit_9(endpoint) {
|
|
|
299
300
|
var tmp_2 = emitObject(this, tmp_1, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
|
|
300
301
|
var tmp_3 = emitObject(this, endpoint.xp_1, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
301
302
|
var tmp_4 = emitObject(this, endpoint.yp_1, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
302
|
-
var tmp_5 = this.
|
|
303
|
+
var tmp_5 = this.h1x(first_0(endpoint.zp_1), endpoint);
|
|
303
304
|
var tmp_6 = Spacer_instance.toString();
|
|
304
305
|
var tmp_7 = emitStatusInterfaces(this, endpoint);
|
|
305
306
|
var tmp_8 = emitResponseInterfaces(this, endpoint);
|
|
@@ -316,7 +317,7 @@ function emit_9(endpoint) {
|
|
|
316
317
|
var tmp_19 = emitFromResponse(this, endpoint);
|
|
317
318
|
var tmp_20 = Spacer_instance.hs(2);
|
|
318
319
|
var tmp_21 = Spacer_instance.hs(2);
|
|
319
|
-
var tmp_22 = this.
|
|
320
|
+
var tmp_22 = this.l1x(endpoint);
|
|
320
321
|
var tmp_23 = Spacer_instance.hs(2);
|
|
321
322
|
var tmp_24 = Spacer_instance.hs(3);
|
|
322
323
|
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 ');
|
|
@@ -360,13 +361,57 @@ function emit_11(_this__u8e3s4) {
|
|
|
360
361
|
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 ');
|
|
361
362
|
}
|
|
362
363
|
initMetadataForInterface(JavaEndpointDefinitionEmitter, 'JavaEndpointDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
363
|
-
function emit_12(
|
|
364
|
+
function emit_12(refined) {
|
|
365
|
+
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
|
+
}
|
|
367
|
+
function emitValidator(_this__u8e3s4) {
|
|
368
|
+
var defaultReturn = 'return true;';
|
|
369
|
+
var type = _this__u8e3s4.tr_1.fv_1;
|
|
370
|
+
var tmp;
|
|
371
|
+
if (type instanceof Integer) {
|
|
372
|
+
var tmp0_safe_receiver = type.ku_1;
|
|
373
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.oq(tmp0_safe_receiver);
|
|
374
|
+
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
375
|
+
} else {
|
|
376
|
+
if (type instanceof Number_0) {
|
|
377
|
+
var tmp2_safe_receiver = type.nu_1;
|
|
378
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.oq(tmp2_safe_receiver);
|
|
379
|
+
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
380
|
+
} else {
|
|
381
|
+
if (type instanceof String_0) {
|
|
382
|
+
var tmp4_safe_receiver = type.hu_1;
|
|
383
|
+
var tmp_0;
|
|
384
|
+
var tmp_1 = tmp4_safe_receiver;
|
|
385
|
+
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
386
|
+
tmp_0 = null;
|
|
387
|
+
} else {
|
|
388
|
+
tmp_0 = this.oq(new RegExp_0(tmp4_safe_receiver));
|
|
389
|
+
}
|
|
390
|
+
var tmp5_elvis_lhs = tmp_0;
|
|
391
|
+
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
392
|
+
} else {
|
|
393
|
+
if (equals(type, Boolean_instance)) {
|
|
394
|
+
tmp = defaultReturn;
|
|
395
|
+
} else {
|
|
396
|
+
if (equals(type, Bytes_instance)) {
|
|
397
|
+
tmp = defaultReturn;
|
|
398
|
+
} else {
|
|
399
|
+
noWhenBranchMatchedException();
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
return tmp;
|
|
406
|
+
}
|
|
407
|
+
initMetadataForInterface(JavaRefinedTypeDefinitionEmitter, 'JavaRefinedTypeDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
408
|
+
function emit_13(identifier) {
|
|
364
409
|
var tmp;
|
|
365
410
|
if (identifier instanceof DefinitionIdentifier) {
|
|
366
|
-
tmp = this.
|
|
411
|
+
tmp = this.g1x(identifier.l1());
|
|
367
412
|
} else {
|
|
368
413
|
if (identifier instanceof FieldIdentifier) {
|
|
369
|
-
tmp = this.
|
|
414
|
+
tmp = this.k1x(this.g1x(identifier.l1()));
|
|
370
415
|
} else {
|
|
371
416
|
noWhenBranchMatchedException();
|
|
372
417
|
}
|
|
@@ -388,7 +433,7 @@ function sanitizeSymbol(_this__u8e3s4) {
|
|
|
388
433
|
destination.x(tmp$ret$0);
|
|
389
434
|
}
|
|
390
435
|
var tmp = asSequence(joinToString(destination, ''));
|
|
391
|
-
return this.
|
|
436
|
+
return this.j1x(joinToString_0(filter(tmp, JavaIdentifierEmitter$sanitizeSymbol$lambda), ''));
|
|
392
437
|
}
|
|
393
438
|
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
394
439
|
var tmp;
|
|
@@ -408,64 +453,20 @@ function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
|
408
453
|
return tmp;
|
|
409
454
|
}
|
|
410
455
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
411
|
-
return Companion_getInstance_0().
|
|
456
|
+
return Companion_getInstance_0().m1x_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
412
457
|
}
|
|
413
458
|
initMetadataForInterface(JavaIdentifierEmitter, 'JavaIdentifierEmitter');
|
|
414
|
-
function
|
|
415
|
-
var tmp = this.nr(union.gp_1);
|
|
416
|
-
return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.hp_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
|
|
417
|
-
}
|
|
418
|
-
initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
419
|
-
function emit_14(refined) {
|
|
420
|
-
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 ');
|
|
421
|
-
}
|
|
422
|
-
function emitValidator(_this__u8e3s4) {
|
|
423
|
-
var defaultReturn = 'return true;';
|
|
424
|
-
var type = _this__u8e3s4.tr_1.fv_1;
|
|
425
|
-
var tmp;
|
|
426
|
-
if (type instanceof Integer) {
|
|
427
|
-
var tmp0_safe_receiver = type.ku_1;
|
|
428
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.oq(tmp0_safe_receiver);
|
|
429
|
-
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
430
|
-
} else {
|
|
431
|
-
if (type instanceof Number_0) {
|
|
432
|
-
var tmp2_safe_receiver = type.nu_1;
|
|
433
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.oq(tmp2_safe_receiver);
|
|
434
|
-
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
435
|
-
} else {
|
|
436
|
-
if (type instanceof String_0) {
|
|
437
|
-
var tmp4_safe_receiver = type.hu_1;
|
|
438
|
-
var tmp_0;
|
|
439
|
-
var tmp_1 = tmp4_safe_receiver;
|
|
440
|
-
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
441
|
-
tmp_0 = null;
|
|
442
|
-
} else {
|
|
443
|
-
tmp_0 = this.oq(new RegExp_0(tmp4_safe_receiver));
|
|
444
|
-
}
|
|
445
|
-
var tmp5_elvis_lhs = tmp_0;
|
|
446
|
-
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
447
|
-
} else {
|
|
448
|
-
if (equals(type, Boolean_instance)) {
|
|
449
|
-
tmp = defaultReturn;
|
|
450
|
-
} else {
|
|
451
|
-
if (equals(type, Bytes_instance)) {
|
|
452
|
-
tmp = defaultReturn;
|
|
453
|
-
} else {
|
|
454
|
-
noWhenBranchMatchedException();
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
return tmp;
|
|
461
|
-
}
|
|
462
|
-
initMetadataForInterface(JavaRefinedTypeDefinitionEmitter, 'JavaRefinedTypeDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
463
|
-
function emit_15(enum_0, module_0) {
|
|
459
|
+
function emit_14(enum_0, module_0) {
|
|
464
460
|
var tmp = this.nr(enum_0.xr_1);
|
|
465
461
|
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 ');
|
|
466
462
|
}
|
|
467
463
|
initMetadataForInterface(JavaEnumDefinitionEmitter, 'JavaEnumDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
468
|
-
|
|
464
|
+
function emit_15(union) {
|
|
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
470
|
initMetadataForCompanion(Companion);
|
|
470
471
|
initMetadataForCompanion(Companion_0);
|
|
471
472
|
initMetadataForClass(JavaIrEmitter, 'JavaIrEmitter', JavaIrEmitter, VOID, [IrEmitter]);
|
|
@@ -489,7 +490,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
489
490
|
var _iterator__ex2g4s_0 = destination.t();
|
|
490
491
|
while (_iterator__ex2g4s_0.u()) {
|
|
491
492
|
var item = _iterator__ex2g4s_0.v();
|
|
492
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
493
|
+
var tmp$ret$3 = 'import ' + $this.u1w().ds_1 + '.model.' + item.bv_1 + ';';
|
|
493
494
|
destination_0.x(tmp$ret$3);
|
|
494
495
|
}
|
|
495
496
|
var tmp = destination_0;
|
|
@@ -498,7 +499,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
498
499
|
function emitFullyQualified($this, _this__u8e3s4, reference) {
|
|
499
500
|
var tmp;
|
|
500
501
|
if (_this__u8e3s4.mr().l1() === reference.l1()) {
|
|
501
|
-
tmp = $this.
|
|
502
|
+
tmp = $this.u1w().ds_1 + '.model.';
|
|
502
503
|
} else {
|
|
503
504
|
tmp = '';
|
|
504
505
|
}
|
|
@@ -514,42 +515,42 @@ function JavaEmitter(packageName, emitShared) {
|
|
|
514
515
|
packageName = packageName === VOID ? Companion_instance.cs('community.flock.wirespec.generated') : packageName;
|
|
515
516
|
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
516
517
|
LanguageEmitter.call(this);
|
|
517
|
-
this.
|
|
518
|
-
this.
|
|
519
|
-
this.
|
|
520
|
-
this.
|
|
521
|
-
this.
|
|
522
|
-
this.
|
|
523
|
-
}
|
|
524
|
-
protoOf(JavaEmitter).
|
|
525
|
-
return this.
|
|
518
|
+
this.x1w_1 = packageName;
|
|
519
|
+
this.y1w_1 = emitShared;
|
|
520
|
+
this.z1w_1 = '\nimport community.flock.wirespec.java.Wirespec;\n';
|
|
521
|
+
this.a1x_1 = FileExtension_Java_getInstance();
|
|
522
|
+
this.b1x_1 = JavaShared_getInstance();
|
|
523
|
+
this.c1x_1 = '//';
|
|
524
|
+
}
|
|
525
|
+
protoOf(JavaEmitter).u1w = function () {
|
|
526
|
+
return this.x1w_1;
|
|
526
527
|
};
|
|
527
528
|
protoOf(JavaEmitter).uq = function () {
|
|
528
|
-
return this.
|
|
529
|
+
return this.a1x_1;
|
|
529
530
|
};
|
|
530
|
-
protoOf(JavaEmitter).
|
|
531
|
-
return this.
|
|
531
|
+
protoOf(JavaEmitter).d1x = function () {
|
|
532
|
+
return this.b1x_1;
|
|
532
533
|
};
|
|
533
534
|
protoOf(JavaEmitter).vq = function () {
|
|
534
|
-
return this.
|
|
535
|
+
return this.c1x_1;
|
|
535
536
|
};
|
|
536
537
|
protoOf(JavaEmitter).kr = function (module_0, logger) {
|
|
537
538
|
// Inline function 'kotlin.let' call
|
|
538
539
|
var it = protoOf(LanguageEmitter).kr.call(this, module_0, logger);
|
|
539
|
-
return this.
|
|
540
|
+
return this.y1w_1.xo_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.cs('community.flock.wirespec.java').fs() + 'Wirespec', this.d1x().f1x_1)) : it;
|
|
540
541
|
};
|
|
541
542
|
protoOf(JavaEmitter).lr = function (definition, module_0, logger) {
|
|
542
543
|
// Inline function 'kotlin.let' call
|
|
543
544
|
var it = protoOf(LanguageEmitter).lr.call(this, definition, module_0, logger);
|
|
544
|
-
var subPackageName = plus(this.
|
|
545
|
-
var tmp = subPackageName.fs() + this.
|
|
545
|
+
var subPackageName = plus(this.u1w(), definition);
|
|
546
|
+
var tmp = subPackageName.fs() + this.g1x(it.yo_1);
|
|
546
547
|
// Inline function 'kotlin.text.trimStart' call
|
|
547
|
-
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.z1w_1 : '') + '\n |' + it.zo_1 + '\n ');
|
|
548
549
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
549
550
|
return new Emitted(tmp, tmp$ret$0);
|
|
550
551
|
};
|
|
551
552
|
function emitGetType($this, _this__u8e3s4) {
|
|
552
|
-
return 'Wirespec.getType(' + $this.
|
|
553
|
+
return 'Wirespec.getType(' + $this.w1w(_this__u8e3s4, 'Void') + '.class, ' + emitGetTypeRaw($this, _this__u8e3s4) + ')';
|
|
553
554
|
}
|
|
554
555
|
function emitGetTypeRaw($this, _this__u8e3s4) {
|
|
555
556
|
var tmp;
|
|
@@ -704,7 +705,7 @@ function emitImports_0($this, _this__u8e3s4) {
|
|
|
704
705
|
var _iterator__ex2g4s_0 = destination.t();
|
|
705
706
|
while (_iterator__ex2g4s_0.u()) {
|
|
706
707
|
var item = _iterator__ex2g4s_0.v();
|
|
707
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
708
|
+
var tmp$ret$3 = 'import ' + $this.u1w().ds_1 + '.model.' + item.bv_1 + ';';
|
|
708
709
|
destination_0.x(tmp$ret$3);
|
|
709
710
|
}
|
|
710
711
|
var tmp = destination_0;
|
|
@@ -825,7 +826,7 @@ function JavaEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
|
825
826
|
}
|
|
826
827
|
function JavaEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
827
828
|
return function (it) {
|
|
828
|
-
return this$0.
|
|
829
|
+
return this$0.i1x(it);
|
|
829
830
|
};
|
|
830
831
|
}
|
|
831
832
|
function JavaEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
@@ -957,7 +958,7 @@ function sanitizeNegative($this, _this__u8e3s4) {
|
|
|
957
958
|
return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
|
|
958
959
|
}
|
|
959
960
|
function sanitizeEnum($this, _this__u8e3s4) {
|
|
960
|
-
return $this.
|
|
961
|
+
return $this.k1x($this.j1x(joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_')));
|
|
961
962
|
}
|
|
962
963
|
function JavaEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
963
964
|
return function (it) {
|
|
@@ -968,7 +969,7 @@ function JavaEnumDefinitionEmitter() {
|
|
|
968
969
|
}
|
|
969
970
|
function Companion() {
|
|
970
971
|
Companion_instance_2 = this;
|
|
971
|
-
this.
|
|
972
|
+
this.m1x_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']);
|
|
972
973
|
}
|
|
973
974
|
var Companion_instance_2;
|
|
974
975
|
function Companion_getInstance_0() {
|
|
@@ -1032,14 +1033,14 @@ function sanitizeFirstIsDigit_0($this, _this__u8e3s4) {
|
|
|
1032
1033
|
return tmp;
|
|
1033
1034
|
}
|
|
1034
1035
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1035
|
-
return Companion_getInstance_1().
|
|
1036
|
+
return Companion_getInstance_1().n1x_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1036
1037
|
}
|
|
1037
1038
|
function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
1038
1039
|
return sanitizeKeywords_0($this, sanitizeFirstIsDigit_0($this, joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_')));
|
|
1039
1040
|
}
|
|
1040
1041
|
function Companion_0() {
|
|
1041
1042
|
Companion_instance_3 = this;
|
|
1042
|
-
this.
|
|
1043
|
+
this.n1x_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']);
|
|
1043
1044
|
}
|
|
1044
1045
|
var Companion_instance_3;
|
|
1045
1046
|
function Companion_getInstance_1() {
|
|
@@ -1065,12 +1066,12 @@ function JavaIrEmitter$sanitizationConfig$lambda_3(stmt, tr) {
|
|
|
1065
1066
|
var tmp;
|
|
1066
1067
|
var tmp_0;
|
|
1067
1068
|
if (stmt instanceof FunctionCall) {
|
|
1068
|
-
tmp_0 = stmt.
|
|
1069
|
+
tmp_0 = stmt.a1n_1.j1j() === 'validate';
|
|
1069
1070
|
} else {
|
|
1070
1071
|
tmp_0 = false;
|
|
1071
1072
|
}
|
|
1072
1073
|
if (tmp_0) {
|
|
1073
|
-
tmp = transformChildren(stmt.
|
|
1074
|
+
tmp = transformChildren(stmt.e1n(VOID, emptyList()), tr);
|
|
1074
1075
|
} else {
|
|
1075
1076
|
tmp = transformChildren(stmt, tr);
|
|
1076
1077
|
}
|
|
@@ -1091,7 +1092,7 @@ function JavaIrEmitter$emitShared$lambda_0($imports) {
|
|
|
1091
1092
|
var tmp;
|
|
1092
1093
|
if (element instanceof File) {
|
|
1093
1094
|
// Inline function 'kotlin.collections.partition' call
|
|
1094
|
-
var this_0 = element.
|
|
1095
|
+
var this_0 = element.w1n_1;
|
|
1095
1096
|
var first = ArrayList_init_$Create$();
|
|
1096
1097
|
var second = ArrayList_init_$Create$();
|
|
1097
1098
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -1106,7 +1107,7 @@ function JavaIrEmitter$emitShared$lambda_0($imports) {
|
|
|
1106
1107
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1107
1108
|
var packageElements = _destruct__k2r9zo.ve();
|
|
1108
1109
|
var rest = _destruct__k2r9zo.we();
|
|
1109
|
-
tmp = element.
|
|
1110
|
+
tmp = element.z1n(VOID, plus_1(plus_1(packageElements, $imports), rest));
|
|
1110
1111
|
} else {
|
|
1111
1112
|
tmp = element;
|
|
1112
1113
|
}
|
|
@@ -1118,11 +1119,11 @@ function JavaIrEmitter$emitShared$lambda_1($clientServer) {
|
|
|
1118
1119
|
return function (element, transformer) {
|
|
1119
1120
|
var tmp;
|
|
1120
1121
|
if (element instanceof Namespace) {
|
|
1121
|
-
var injected = element.
|
|
1122
|
+
var injected = element.b1o_1.equals(Companion_getInstance().n1h('Wirespec')) ? $clientServer : emptyList();
|
|
1122
1123
|
var tmp_0;
|
|
1123
1124
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1124
1125
|
if (!injected.r()) {
|
|
1125
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1126
|
+
tmp_0 = withElements(element, plus_1(element.x1n(), injected));
|
|
1126
1127
|
} else {
|
|
1127
1128
|
tmp_0 = element;
|
|
1128
1129
|
}
|
|
@@ -1147,7 +1148,7 @@ function JavaIrEmitter$emitGenerator$lambda_1(it) {
|
|
|
1147
1148
|
}
|
|
1148
1149
|
function JavaIrEmitter$emitGenerator$lambda_2(this$0) {
|
|
1149
1150
|
return function (it) {
|
|
1150
|
-
return import_0(this$0.
|
|
1151
|
+
return import_0(this$0.u1w().ds_1 + '.model', it);
|
|
1151
1152
|
};
|
|
1152
1153
|
}
|
|
1153
1154
|
function JavaIrEmitter$emit$lambda(this$0) {
|
|
@@ -1159,37 +1160,37 @@ function JavaIrEmitter$emit$lambda_0(it) {
|
|
|
1159
1160
|
return listOf(function_0('label', VOID, VOID, JavaIrEmitter$emit$lambda$lambda));
|
|
1160
1161
|
}
|
|
1161
1162
|
function JavaIrEmitter$emit$lambda$lambda($this$function) {
|
|
1162
|
-
$this$function.
|
|
1163
|
-
$this$function.
|
|
1163
|
+
$this$function.b1i(String_instance);
|
|
1164
|
+
$this$function.c1i(new VariableReference(Companion_getInstance().n1h('label')));
|
|
1164
1165
|
return Unit_instance;
|
|
1165
1166
|
}
|
|
1166
1167
|
function JavaIrEmitter(packageName, emitShared) {
|
|
1167
1168
|
Companion_getInstance_1();
|
|
1168
1169
|
packageName = packageName === VOID ? Companion_instance.cs('community.flock.wirespec.generated') : packageName;
|
|
1169
1170
|
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
1170
|
-
this.
|
|
1171
|
-
this.
|
|
1172
|
-
this.
|
|
1173
|
-
this.
|
|
1174
|
-
this.
|
|
1171
|
+
this.o1x_1 = packageName;
|
|
1172
|
+
this.p1x_1 = emitShared;
|
|
1173
|
+
this.q1x_1 = JavaGenerator_getInstance();
|
|
1174
|
+
this.r1x_1 = FileExtension_Java_getInstance();
|
|
1175
|
+
this.s1x_1 = listOf(import_0('community.flock.wirespec.java', 'Wirespec'));
|
|
1175
1176
|
var tmp = this;
|
|
1176
|
-
var tmp_0 = Companion_getInstance_1().
|
|
1177
|
+
var tmp_0 = Companion_getInstance_1().n1x_1;
|
|
1177
1178
|
var tmp_1 = JavaIrEmitter$sanitizationConfig$lambda;
|
|
1178
1179
|
var tmp_2 = JavaIrEmitter$sanitizationConfig$lambda_0;
|
|
1179
1180
|
var tmp_3 = JavaIrEmitter$sanitizationConfig$lambda_1;
|
|
1180
1181
|
var tmp_4 = JavaIrEmitter$sanitizationConfig$lambda_2(this);
|
|
1181
|
-
tmp.
|
|
1182
|
+
tmp.t1x_1 = new SanitizationConfig(tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, JavaIrEmitter$sanitizationConfig$lambda_3);
|
|
1182
1183
|
}
|
|
1183
|
-
protoOf(JavaIrEmitter).
|
|
1184
|
-
return this.
|
|
1184
|
+
protoOf(JavaIrEmitter).u1w = function () {
|
|
1185
|
+
return this.o1x_1;
|
|
1185
1186
|
};
|
|
1186
|
-
protoOf(JavaIrEmitter).
|
|
1187
|
-
return this.
|
|
1187
|
+
protoOf(JavaIrEmitter).t1v = function () {
|
|
1188
|
+
return this.q1x_1;
|
|
1188
1189
|
};
|
|
1189
1190
|
protoOf(JavaIrEmitter).uq = function () {
|
|
1190
|
-
return this.
|
|
1191
|
+
return this.r1x_1;
|
|
1191
1192
|
};
|
|
1192
|
-
protoOf(JavaIrEmitter).
|
|
1193
|
+
protoOf(JavaIrEmitter).x1v = function () {
|
|
1193
1194
|
var packageName = Companion_instance.cs('community.flock.wirespec.java');
|
|
1194
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')]);
|
|
1195
1196
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1209,28 +1210,28 @@ protoOf(JavaIrEmitter).v1v = function () {
|
|
|
1209
1210
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1210
1211
|
var tmp = scope;
|
|
1211
1212
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1212
|
-
var this_2 = scope.
|
|
1213
|
+
var this_2 = scope.g1v_1;
|
|
1213
1214
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1214
1215
|
// Inline function 'kotlin.apply' call
|
|
1215
1216
|
var this_3 = new TransformerBuilder();
|
|
1216
|
-
this_3.
|
|
1217
|
-
var tmp$ret$5 = this_3.
|
|
1218
|
-
tmp.
|
|
1217
|
+
this_3.x1i(JavaIrEmitter$emitShared$lambda_0(imports));
|
|
1218
|
+
var tmp$ret$5 = this_3.y1i();
|
|
1219
|
+
tmp.g1v_1 = transform(this_2, tmp$ret$5);
|
|
1219
1220
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1220
1221
|
var tmp_0 = scope;
|
|
1221
1222
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1222
1223
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1223
|
-
var this_4 = scope.
|
|
1224
|
+
var this_4 = scope.g1v_1;
|
|
1224
1225
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1225
1226
|
// Inline function 'kotlin.apply' call
|
|
1226
1227
|
var this_5 = new TransformerBuilder();
|
|
1227
|
-
this_5.
|
|
1228
|
-
var tmp$ret$10 = this_5.
|
|
1229
|
-
tmp_0.
|
|
1230
|
-
var tmp_1 = scope.
|
|
1228
|
+
this_5.x1i(JavaIrEmitter$emitShared$lambda_1(clientServer));
|
|
1229
|
+
var tmp$ret$10 = this_5.y1i();
|
|
1230
|
+
tmp_0.g1v_1 = transform(this_4, tmp$ret$10);
|
|
1231
|
+
var tmp_1 = scope.g1v_1;
|
|
1231
1232
|
var wirespecShared = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1232
1233
|
var tmp_2;
|
|
1233
|
-
if (this.
|
|
1234
|
+
if (this.p1x_1.xo_1) {
|
|
1234
1235
|
tmp_2 = wirespecShared;
|
|
1235
1236
|
} else {
|
|
1236
1237
|
tmp_2 = null;
|
|
@@ -1239,9 +1240,9 @@ protoOf(JavaIrEmitter).v1v = function () {
|
|
|
1239
1240
|
};
|
|
1240
1241
|
protoOf(JavaIrEmitter).lr = function (definition, module_0, logger) {
|
|
1241
1242
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1242
|
-
var tmp = file.
|
|
1243
|
+
var tmp = file.z1n(Companion_getInstance().n1h(sanitizeSymbol_0(this, file.v1n_1.o1h())));
|
|
1243
1244
|
// Inline function 'kotlin.takeIf' call
|
|
1244
|
-
var this_0 = this.
|
|
1245
|
+
var this_0 = this.s1x_1;
|
|
1245
1246
|
var tmp_0;
|
|
1246
1247
|
if (Companion_instance_1.hr(module_0)) {
|
|
1247
1248
|
tmp_0 = this_0;
|
|
@@ -1249,9 +1250,9 @@ protoOf(JavaIrEmitter).lr = function (definition, module_0, logger) {
|
|
|
1249
1250
|
tmp_0 = null;
|
|
1250
1251
|
}
|
|
1251
1252
|
var tmp$ret$1 = tmp_0;
|
|
1252
|
-
return placeInPackage(prependImports(tmp, tmp$ret$1), this.
|
|
1253
|
+
return placeInPackage(prependImports(tmp, tmp$ret$1), this.u1w(), definition);
|
|
1253
1254
|
};
|
|
1254
|
-
protoOf(JavaIrEmitter).
|
|
1255
|
+
protoOf(JavaIrEmitter).c1w = function (definition, module_0) {
|
|
1255
1256
|
var tmp;
|
|
1256
1257
|
if (definition instanceof Type) {
|
|
1257
1258
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1271,33 +1272,33 @@ protoOf(JavaIrEmitter).z1v = function (definition, module_0) {
|
|
|
1271
1272
|
}
|
|
1272
1273
|
}
|
|
1273
1274
|
var generatorFile = tmp;
|
|
1274
|
-
var sanitized = sanitizeNames(generatorFile, this.
|
|
1275
|
+
var sanitized = sanitizeNames(generatorFile, this.t1x_1);
|
|
1275
1276
|
var generatorOwnName = definition.mr().l1() + 'Generator';
|
|
1276
1277
|
var tmp_0 = asSequence_0(collectCustomTypeNames(sanitized));
|
|
1277
1278
|
var tmp_1 = filterNot(tmp_0, JavaIrEmitter$emitGenerator$lambda);
|
|
1278
1279
|
var tmp_2 = filterNot(tmp_1, JavaIrEmitter$emitGenerator$lambda_0(generatorOwnName));
|
|
1279
1280
|
var tmp_3 = distinct_0(map(tmp_2, JavaIrEmitter$emitGenerator$lambda_1));
|
|
1280
1281
|
var modelImports = toList(map(tmp_3, JavaIrEmitter$emitGenerator$lambda_2(this)));
|
|
1281
|
-
return placeInPackage_0(prependImports(sanitized, plus_1(this.
|
|
1282
|
+
return placeInPackage_0(prependImports(sanitized, plus_1(this.s1x_1, modelImports)), this.u1w(), 'generator');
|
|
1282
1283
|
};
|
|
1283
1284
|
protoOf(JavaIrEmitter).kq = function (type, module_0) {
|
|
1284
|
-
return sanitizeNames(convertWithValidation(type, module_0), this.
|
|
1285
|
+
return sanitizeNames(convertWithValidation(type, module_0), this.t1x_1);
|
|
1285
1286
|
};
|
|
1286
1287
|
protoOf(JavaIrEmitter).zr = function (enum_0, module_0) {
|
|
1287
1288
|
var tmp = convert_0(enum_0);
|
|
1288
1289
|
var tmp_0 = JavaIrEmitter$emit$lambda(this);
|
|
1289
|
-
return sanitizeNames(injectEnumLabelField(tmp, tmp_0, JavaIrEmitter$emit$lambda_0), this.
|
|
1290
|
+
return sanitizeNames(injectEnumLabelField(tmp, tmp_0, JavaIrEmitter$emit$lambda_0), this.t1x_1);
|
|
1290
1291
|
};
|
|
1291
1292
|
protoOf(JavaIrEmitter).pr = function (union) {
|
|
1292
|
-
return sanitizeNames(convert_1(union), this.
|
|
1293
|
+
return sanitizeNames(convert_1(union), this.t1x_1);
|
|
1293
1294
|
};
|
|
1294
1295
|
protoOf(JavaIrEmitter).ur = function (refined) {
|
|
1295
|
-
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.
|
|
1296
|
+
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.t1x_1);
|
|
1296
1297
|
};
|
|
1297
1298
|
protoOf(JavaIrEmitter).as = function (endpoint) {
|
|
1298
|
-
var tmp = sanitizeNames(transformTypeDescriptors(injectApiField(injectHandleFunction(convert_3(endpoint), endpoint))), this.
|
|
1299
|
+
var tmp = sanitizeNames(transformTypeDescriptors(injectApiField(injectHandleFunction(convert_3(endpoint), endpoint))), this.t1x_1);
|
|
1299
1300
|
// Inline function 'kotlin.takeIf' call
|
|
1300
|
-
var this_0 = buildModelImports(endpoint, this.
|
|
1301
|
+
var this_0 = buildModelImports(endpoint, this.u1w());
|
|
1301
1302
|
var tmp_0;
|
|
1302
1303
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1303
1304
|
if (!this_0.r()) {
|
|
@@ -1311,22 +1312,22 @@ protoOf(JavaIrEmitter).as = function (endpoint) {
|
|
|
1311
1312
|
protoOf(JavaIrEmitter).or = function (channel) {
|
|
1312
1313
|
var tmp;
|
|
1313
1314
|
if (channel.cp_1.l1() === channel.dp_1.l1()) {
|
|
1314
|
-
tmp = this.
|
|
1315
|
+
tmp = this.u1w().ds_1 + '.model.';
|
|
1315
1316
|
} else {
|
|
1316
1317
|
tmp = '';
|
|
1317
1318
|
}
|
|
1318
1319
|
var fullyQualifiedPrefix = tmp;
|
|
1319
|
-
return applyFunctionalInterface(sanitizeNames(convert_4(channel), this.
|
|
1320
|
+
return applyFunctionalInterface(sanitizeNames(convert_4(channel), this.t1x_1), fullyQualifiedPrefix);
|
|
1320
1321
|
};
|
|
1321
|
-
protoOf(JavaIrEmitter).
|
|
1322
|
-
var imports = buildModelImports(endpoint, this.
|
|
1323
|
-
var endpointImport = import_0(this.
|
|
1322
|
+
protoOf(JavaIrEmitter).b1w = function (endpoint) {
|
|
1323
|
+
var imports = buildModelImports(endpoint, this.u1w());
|
|
1324
|
+
var endpointImport = import_0(this.u1w().ds_1 + '.endpoint', endpoint.up_1.l1());
|
|
1324
1325
|
var endpointName = endpoint.up_1.l1();
|
|
1325
|
-
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.
|
|
1326
|
-
var subPackageName = plus_0(this.
|
|
1327
|
-
return new File(Companion_getInstance().n1h(subPackageName.fs() + sanitizeSymbol_0(this, file.
|
|
1326
|
+
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.t1x_1)), endpointName);
|
|
1327
|
+
var subPackageName = plus_0(this.u1w(), 'client');
|
|
1328
|
+
return new File(Companion_getInstance().n1h(subPackageName.fs() + sanitizeSymbol_0(this, file.v1n_1.o1h())), plus_1(plus_1(plus_1(plus_1(listOf(new Package(subPackageName.ds_1)), this.s1x_1), imports), listOf(endpointImport)), file.w1n_1));
|
|
1328
1329
|
};
|
|
1329
|
-
protoOf(JavaIrEmitter).
|
|
1330
|
+
protoOf(JavaIrEmitter).y1v = function (endpoints, logger) {
|
|
1330
1331
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1331
1332
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1332
1333
|
var destination = ArrayList_init_$Create$();
|
|
@@ -1386,7 +1387,7 @@ protoOf(JavaIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1386
1387
|
var _iterator__ex2g4s_3 = destination_0.t();
|
|
1387
1388
|
while (_iterator__ex2g4s_3.u()) {
|
|
1388
1389
|
var item = _iterator__ex2g4s_3.v();
|
|
1389
|
-
var tmp$ret$10 = import_0(this.
|
|
1390
|
+
var tmp$ret$10 = import_0(this.u1w().ds_1 + '.model', item.bv_1);
|
|
1390
1391
|
destination_1.x(tmp$ret$10);
|
|
1391
1392
|
}
|
|
1392
1393
|
var imports = destination_1;
|
|
@@ -1396,7 +1397,7 @@ protoOf(JavaIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1396
1397
|
var _iterator__ex2g4s_4 = endpoints.t();
|
|
1397
1398
|
while (_iterator__ex2g4s_4.u()) {
|
|
1398
1399
|
var item_0 = _iterator__ex2g4s_4.v();
|
|
1399
|
-
var tmp$ret$13 = import_0(this.
|
|
1400
|
+
var tmp$ret$13 = import_0(this.u1w().ds_1 + '.endpoint', item_0.up_1.l1());
|
|
1400
1401
|
destination_2.x(tmp$ret$13);
|
|
1401
1402
|
}
|
|
1402
1403
|
var endpointImports = destination_2;
|
|
@@ -1406,19 +1407,19 @@ protoOf(JavaIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1406
1407
|
var _iterator__ex2g4s_5 = endpoints.t();
|
|
1407
1408
|
while (_iterator__ex2g4s_5.u()) {
|
|
1408
1409
|
var item_1 = _iterator__ex2g4s_5.v();
|
|
1409
|
-
var tmp$ret$16 = import_0(this.
|
|
1410
|
+
var tmp$ret$16 = import_0(this.u1w().ds_1 + '.client', item_1.up_1.l1() + 'Client');
|
|
1410
1411
|
destination_3.x(tmp$ret$16);
|
|
1411
1412
|
}
|
|
1412
1413
|
var clientImports = destination_3;
|
|
1413
1414
|
var allImports = plus_1(plus_1(imports, endpointImports), clientImports);
|
|
1414
|
-
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.
|
|
1415
|
-
return new File(Companion_getInstance().n1h(this.
|
|
1415
|
+
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.t1x_1);
|
|
1416
|
+
return new File(Companion_getInstance().n1h(this.u1w().fs() + sanitizeSymbol_0(this, file.v1n_1.o1h())), plus_1(plus_1(plus_1(listOf(new Package(this.u1w().ds_1)), this.s1x_1), allImports), file.w1n_1));
|
|
1416
1417
|
};
|
|
1417
1418
|
function transformTypeDescriptors(_this__u8e3s4) {
|
|
1418
1419
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1419
1420
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1420
|
-
scope.
|
|
1421
|
-
var tmp = scope.
|
|
1421
|
+
scope.p1v(transformTypeDescriptors$lambda);
|
|
1422
|
+
var tmp = scope.g1v_1;
|
|
1422
1423
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1423
1424
|
}
|
|
1424
1425
|
function applyRefinedStructShape(_this__u8e3s4, refined) {
|
|
@@ -1427,14 +1428,14 @@ function applyRefinedStructShape(_this__u8e3s4, refined) {
|
|
|
1427
1428
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1428
1429
|
var tmp = scope;
|
|
1429
1430
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1430
|
-
var this_0 = scope.
|
|
1431
|
+
var this_0 = scope.g1v_1;
|
|
1431
1432
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1432
1433
|
// Inline function 'kotlin.apply' call
|
|
1433
1434
|
var this_1 = new TransformerBuilder();
|
|
1434
|
-
this_1.
|
|
1435
|
-
var tmp$ret$2 = this_1.
|
|
1436
|
-
tmp.
|
|
1437
|
-
var tmp_0 = scope.
|
|
1435
|
+
this_1.x1i(applyRefinedStructShape$lambda(refined));
|
|
1436
|
+
var tmp$ret$2 = this_1.y1i();
|
|
1437
|
+
tmp.g1v_1 = transform(this_0, tmp$ret$2);
|
|
1438
|
+
var tmp_0 = scope.g1v_1;
|
|
1438
1439
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1439
1440
|
}
|
|
1440
1441
|
function injectApiField(_this__u8e3s4) {
|
|
@@ -1444,14 +1445,14 @@ function injectApiField(_this__u8e3s4) {
|
|
|
1444
1445
|
var tmp = scope;
|
|
1445
1446
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1446
1447
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1447
|
-
var this_0 = scope.
|
|
1448
|
+
var this_0 = scope.g1v_1;
|
|
1448
1449
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1449
1450
|
// Inline function 'kotlin.apply' call
|
|
1450
1451
|
var this_1 = new TransformerBuilder();
|
|
1451
|
-
this_1.
|
|
1452
|
-
var tmp$ret$2 = this_1.
|
|
1453
|
-
tmp.
|
|
1454
|
-
var tmp_0 = scope.
|
|
1452
|
+
this_1.x1i(injectApiField$lambda);
|
|
1453
|
+
var tmp$ret$2 = this_1.y1i();
|
|
1454
|
+
tmp.g1v_1 = transform(this_0, tmp$ret$2);
|
|
1455
|
+
var tmp_0 = scope.g1v_1;
|
|
1455
1456
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1456
1457
|
}
|
|
1457
1458
|
function injectHandleFunction(_this__u8e3s4, endpoint) {
|
|
@@ -1461,14 +1462,14 @@ function injectHandleFunction(_this__u8e3s4, endpoint) {
|
|
|
1461
1462
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1462
1463
|
var tmp = scope;
|
|
1463
1464
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1464
|
-
var this_0 = scope.
|
|
1465
|
+
var this_0 = scope.g1v_1;
|
|
1465
1466
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1466
1467
|
// Inline function 'kotlin.apply' call
|
|
1467
1468
|
var this_1 = new TransformerBuilder();
|
|
1468
|
-
this_1.
|
|
1469
|
-
var tmp$ret$2 = this_1.
|
|
1470
|
-
tmp.
|
|
1471
|
-
var tmp_0 = scope.
|
|
1469
|
+
this_1.x1i(injectHandleFunction$lambda(handlersStruct));
|
|
1470
|
+
var tmp$ret$2 = this_1.y1i();
|
|
1471
|
+
tmp.g1v_1 = transform(this_0, tmp$ret$2);
|
|
1472
|
+
var tmp_0 = scope.g1v_1;
|
|
1472
1473
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1473
1474
|
}
|
|
1474
1475
|
function buildModelImports(_this__u8e3s4, packageName) {
|
|
@@ -1489,7 +1490,7 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1489
1490
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1490
1491
|
while (_iterator__ex2g4s_0.u()) {
|
|
1491
1492
|
var item = _iterator__ex2g4s_0.v();
|
|
1492
|
-
var tmp$ret$3 = import_0(packageName.ds_1 + '.model', Companion_getInstance().n1h(item.bv_1).
|
|
1493
|
+
var tmp$ret$3 = import_0(packageName.ds_1 + '.model', Companion_getInstance().n1h(item.bv_1).o1h());
|
|
1493
1494
|
destination_0.x(tmp$ret$3);
|
|
1494
1495
|
}
|
|
1495
1496
|
return destination_0;
|
|
@@ -1500,24 +1501,24 @@ function applyFunctionalInterface(_this__u8e3s4, fullyQualifiedPrefix) {
|
|
|
1500
1501
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1501
1502
|
var tmp = scope;
|
|
1502
1503
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1503
|
-
var this_0 = scope.
|
|
1504
|
+
var this_0 = scope.g1v_1;
|
|
1504
1505
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1505
1506
|
// Inline function 'kotlin.apply' call
|
|
1506
1507
|
var this_1 = new TransformerBuilder();
|
|
1507
|
-
this_1.
|
|
1508
|
-
var tmp$ret$2 = this_1.
|
|
1509
|
-
tmp.
|
|
1508
|
+
this_1.x1i(applyFunctionalInterface$lambda(fullyQualifiedPrefix));
|
|
1509
|
+
var tmp$ret$2 = this_1.y1i();
|
|
1510
|
+
tmp.g1v_1 = transform(this_0, tmp$ret$2);
|
|
1510
1511
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1511
1512
|
var tmp_0 = scope;
|
|
1512
1513
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1513
|
-
var this_2 = scope.
|
|
1514
|
+
var this_2 = scope.g1v_1;
|
|
1514
1515
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1515
1516
|
// Inline function 'kotlin.apply' call
|
|
1516
1517
|
var this_3 = new TransformerBuilder();
|
|
1517
|
-
this_3.
|
|
1518
|
-
var tmp$ret$7 = this_3.
|
|
1519
|
-
tmp_0.
|
|
1520
|
-
var tmp_1 = scope.
|
|
1518
|
+
this_3.x1i(applyFunctionalInterface$lambda_0);
|
|
1519
|
+
var tmp$ret$7 = this_3.y1i();
|
|
1520
|
+
tmp_0.g1v_1 = transform(this_2, tmp$ret$7);
|
|
1521
|
+
var tmp_1 = scope.g1v_1;
|
|
1521
1522
|
return isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1522
1523
|
}
|
|
1523
1524
|
function wrapAsyncReturnInThenApply(_this__u8e3s4, endpointName) {
|
|
@@ -1526,14 +1527,14 @@ function wrapAsyncReturnInThenApply(_this__u8e3s4, endpointName) {
|
|
|
1526
1527
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1527
1528
|
var tmp = scope;
|
|
1528
1529
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1529
|
-
var this_0 = scope.
|
|
1530
|
+
var this_0 = scope.g1v_1;
|
|
1530
1531
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1531
1532
|
// Inline function 'kotlin.apply' call
|
|
1532
1533
|
var this_1 = new TransformerBuilder();
|
|
1533
|
-
this_1.
|
|
1534
|
-
var tmp$ret$2 = this_1.
|
|
1535
|
-
tmp.
|
|
1536
|
-
var tmp_0 = scope.
|
|
1534
|
+
this_1.x1i(wrapAsyncReturnInThenApply$lambda(endpointName));
|
|
1535
|
+
var tmp$ret$2 = this_1.y1i();
|
|
1536
|
+
tmp.g1v_1 = transform(this_0, tmp$ret$2);
|
|
1537
|
+
var tmp_0 = scope.g1v_1;
|
|
1537
1538
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1538
1539
|
}
|
|
1539
1540
|
function findRoot(_this__u8e3s4) {
|
|
@@ -1545,7 +1546,7 @@ function findRoot(_this__u8e3s4) {
|
|
|
1545
1546
|
tmp = findRoot(_this__u8e3s4.g1j_1);
|
|
1546
1547
|
} else {
|
|
1547
1548
|
if (_this__u8e3s4 instanceof Dict_0) {
|
|
1548
|
-
tmp = findRoot(_this__u8e3s4.
|
|
1549
|
+
tmp = findRoot(_this__u8e3s4.j1n_1);
|
|
1549
1550
|
} else {
|
|
1550
1551
|
tmp = _this__u8e3s4;
|
|
1551
1552
|
}
|
|
@@ -1574,7 +1575,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1574
1575
|
var tmp;
|
|
1575
1576
|
if (_this__u8e3s4 instanceof Integer_0) {
|
|
1576
1577
|
var tmp_0;
|
|
1577
|
-
switch (_this__u8e3s4.
|
|
1578
|
+
switch (_this__u8e3s4.f1n_1.b3_1) {
|
|
1578
1579
|
case 0:
|
|
1579
1580
|
tmp_0 = 'Integer';
|
|
1580
1581
|
break;
|
|
@@ -1589,7 +1590,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1589
1590
|
} else {
|
|
1590
1591
|
if (_this__u8e3s4 instanceof Number_1) {
|
|
1591
1592
|
var tmp_1;
|
|
1592
|
-
switch (_this__u8e3s4.
|
|
1593
|
+
switch (_this__u8e3s4.g1n_1.b3_1) {
|
|
1593
1594
|
case 0:
|
|
1594
1595
|
tmp_1 = 'Float';
|
|
1595
1596
|
break;
|
|
@@ -1618,7 +1619,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1618
1619
|
tmp = 'Void';
|
|
1619
1620
|
} else {
|
|
1620
1621
|
if (_this__u8e3s4 instanceof Custom_0) {
|
|
1621
|
-
tmp = _this__u8e3s4.h1j_1.
|
|
1622
|
+
tmp = _this__u8e3s4.h1j_1.o1h();
|
|
1622
1623
|
} else {
|
|
1623
1624
|
tmp = 'Object';
|
|
1624
1625
|
}
|
|
@@ -1642,8 +1643,8 @@ function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
|
1642
1643
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1643
1644
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1644
1645
|
var tmp_0 = withFullyQualifiedPrefix$lambda;
|
|
1645
|
-
scope.
|
|
1646
|
-
var tmp_1 = scope.
|
|
1646
|
+
scope.j1v(tmp_0, withFullyQualifiedPrefix$lambda_0(prefix));
|
|
1647
|
+
var tmp_1 = scope.g1v_1;
|
|
1647
1648
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1648
1649
|
} else {
|
|
1649
1650
|
tmp = _this__u8e3s4;
|
|
@@ -1653,8 +1654,8 @@ function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
|
1653
1654
|
function transformTypeDescriptors$lambda(stmt, tr) {
|
|
1654
1655
|
var tmp;
|
|
1655
1656
|
if (stmt instanceof TypeDescriptor) {
|
|
1656
|
-
var rootType = findRoot(stmt.
|
|
1657
|
-
var containerStr = rawContainerClass(stmt.
|
|
1657
|
+
var rootType = findRoot(stmt.l1p_1);
|
|
1658
|
+
var containerStr = rawContainerClass(stmt.l1p_1);
|
|
1658
1659
|
var rootStr = toJavaName(rootType) + '.class';
|
|
1659
1660
|
var tmp_0;
|
|
1660
1661
|
if (containerStr == null) {
|
|
@@ -1673,8 +1674,8 @@ function transformTypeDescriptors$lambda(stmt, tr) {
|
|
|
1673
1674
|
}
|
|
1674
1675
|
function applyRefinedStructShape$lambda$lambda($refined) {
|
|
1675
1676
|
return function ($this$function) {
|
|
1676
|
-
$this$function.
|
|
1677
|
-
$this$function.
|
|
1677
|
+
$this$function.b1i(convert_5($refined.tr_1));
|
|
1678
|
+
$this$function.c1i(new VariableReference(Companion_getInstance().n1h('value')));
|
|
1678
1679
|
return Unit_instance;
|
|
1679
1680
|
};
|
|
1680
1681
|
}
|
|
@@ -1684,7 +1685,7 @@ function applyRefinedStructShape$lambda($refined) {
|
|
|
1684
1685
|
if (element instanceof Struct) {
|
|
1685
1686
|
var tmp_0 = listOf(Custom_init_$Create$('Wirespec.Refined'));
|
|
1686
1687
|
// Inline function 'kotlin.collections.map' call
|
|
1687
|
-
var this_0 = element.
|
|
1688
|
+
var this_0 = element.k1o_1;
|
|
1688
1689
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1689
1690
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1690
1691
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -1695,7 +1696,7 @@ function applyRefinedStructShape$lambda($refined) {
|
|
|
1695
1696
|
var tmp$ret$0 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
1696
1697
|
destination.x(tmp$ret$0);
|
|
1697
1698
|
}
|
|
1698
|
-
var tmp_1 = element.
|
|
1699
|
+
var tmp_1 = element.n1o(VOID, VOID, VOID, tmp_0, destination);
|
|
1699
1700
|
tmp = plus_3(tmp_1, function_0('value', VOID, true, applyRefinedStructShape$lambda$lambda($refined)));
|
|
1700
1701
|
} else {
|
|
1701
1702
|
tmp = element;
|
|
@@ -1711,7 +1712,7 @@ function injectApiField$lambda(element, transformer) {
|
|
|
1711
1712
|
var tmp_0;
|
|
1712
1713
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1713
1714
|
if (!injected.r()) {
|
|
1714
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1715
|
+
tmp_0 = withElements(element, plus_1(element.x1n(), injected));
|
|
1715
1716
|
} else {
|
|
1716
1717
|
tmp_0 = element;
|
|
1717
1718
|
}
|
|
@@ -1730,7 +1731,7 @@ function injectHandleFunction$lambda$lambda($handlersStruct) {
|
|
|
1730
1731
|
var tmp_0;
|
|
1731
1732
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1732
1733
|
if (!injected.r()) {
|
|
1733
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1734
|
+
tmp_0 = withElements(element, plus_1(element.x1n(), injected));
|
|
1734
1735
|
} else {
|
|
1735
1736
|
tmp_0 = element;
|
|
1736
1737
|
}
|
|
@@ -1747,21 +1748,21 @@ function injectHandleFunction$lambda($handlersStruct) {
|
|
|
1747
1748
|
var tmp;
|
|
1748
1749
|
if (element instanceof Interface) {
|
|
1749
1750
|
var tmp_0;
|
|
1750
|
-
if (element.
|
|
1751
|
+
if (element.p1o_1.equals(Companion_getInstance().n1h('Handler'))) {
|
|
1751
1752
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1752
1753
|
var scope = new TransformScope(element);
|
|
1753
1754
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1754
1755
|
var tmp_1 = scope;
|
|
1755
1756
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1756
1757
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1757
|
-
var this_0 = scope.
|
|
1758
|
+
var this_0 = scope.g1v_1;
|
|
1758
1759
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1759
1760
|
// Inline function 'kotlin.apply' call
|
|
1760
1761
|
var this_1 = new TransformerBuilder();
|
|
1761
|
-
this_1.
|
|
1762
|
-
var tmp$ret$2 = this_1.
|
|
1763
|
-
tmp_1.
|
|
1764
|
-
var tmp_2 = scope.
|
|
1762
|
+
this_1.x1i(injectHandleFunction$lambda$lambda($handlersStruct));
|
|
1763
|
+
var tmp$ret$2 = this_1.y1i();
|
|
1764
|
+
tmp_1.g1v_1 = transform(this_0, tmp$ret$2);
|
|
1765
|
+
var tmp_2 = scope.g1v_1;
|
|
1765
1766
|
tmp_0 = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1766
1767
|
} else {
|
|
1767
1768
|
tmp_0 = element;
|
|
@@ -1791,7 +1792,7 @@ function applyFunctionalInterface$lambda_0(element, transformer) {
|
|
|
1791
1792
|
if (element instanceof File) {
|
|
1792
1793
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1793
1794
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1794
|
-
var tmp0 = element.
|
|
1795
|
+
var tmp0 = element.x1n();
|
|
1795
1796
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1796
1797
|
var destination = ArrayList_init_$Create$();
|
|
1797
1798
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1803,7 +1804,7 @@ function applyFunctionalInterface$lambda_0(element, transformer) {
|
|
|
1803
1804
|
}
|
|
1804
1805
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1805
1806
|
var interfaceElement = ensureNotNull(tmp$ret$2);
|
|
1806
|
-
tmp = element.
|
|
1807
|
+
tmp = element.z1n(VOID, listOf_0([new RawElement('@FunctionalInterface\n'), interfaceElement]));
|
|
1807
1808
|
} else {
|
|
1808
1809
|
tmp = element;
|
|
1809
1810
|
}
|
|
@@ -1837,7 +1838,7 @@ function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
|
1837
1838
|
}
|
|
1838
1839
|
var tmp_3 = dropLast(element.h1l_1, 2);
|
|
1839
1840
|
var tmp1_name = Companion_getInstance().n1h('thenApply');
|
|
1840
|
-
var tmp2_receiver = transportAssign.
|
|
1841
|
+
var tmp2_receiver = transportAssign.o1p_1;
|
|
1841
1842
|
var tmp3_arguments = mapOf(to(Companion_getInstance().n1h('mapper'), new RawExpression('rawResponse -> ' + $endpointName + '.fromRawResponse(serialization(), rawResponse)')));
|
|
1842
1843
|
tmp$ret$0 = element.l1l(VOID, VOID, VOID, VOID, plus_2(tmp_3, new ReturnStatement(new FunctionCall(tmp2_receiver, VOID, tmp1_name, tmp3_arguments))));
|
|
1843
1844
|
}
|
|
@@ -1864,50 +1865,50 @@ function buildHandlersStruct$lambda(it) {
|
|
|
1864
1865
|
}
|
|
1865
1866
|
function buildHandlersStruct$lambda$lambda($pathTemplate) {
|
|
1866
1867
|
return function ($this$function) {
|
|
1867
|
-
$this$function.
|
|
1868
|
-
$this$function.
|
|
1868
|
+
$this$function.b1i(String_instance);
|
|
1869
|
+
$this$function.c1i($this$function.l1u($pathTemplate));
|
|
1869
1870
|
return Unit_instance;
|
|
1870
1871
|
};
|
|
1871
1872
|
}
|
|
1872
1873
|
function buildHandlersStruct$lambda$lambda_0($this_buildHandlersStruct) {
|
|
1873
1874
|
return function ($this$function) {
|
|
1874
|
-
$this$function.
|
|
1875
|
-
$this$function.
|
|
1875
|
+
$this$function.b1i(String_instance);
|
|
1876
|
+
$this$function.c1i($this$function.l1u($this_buildHandlersStruct.vp_1.a3_1));
|
|
1876
1877
|
return Unit_instance;
|
|
1877
1878
|
};
|
|
1878
1879
|
}
|
|
1879
1880
|
function buildHandlersStruct$lambda$lambda_1($this$function) {
|
|
1880
|
-
$this$function.
|
|
1881
|
-
$this$function.
|
|
1882
|
-
$this$function.
|
|
1881
|
+
$this$function.b1i($this$function.p1h('Wirespec.ServerEdge', [$this$function.p1h('Request', []), $this$function.p1h('Response', [Wildcard_instance])]));
|
|
1882
|
+
$this$function.y1h('serialization', $this$function.p1h('Wirespec.Serialization', []));
|
|
1883
|
+
$this$function.c1i(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}'));
|
|
1883
1884
|
return Unit_instance;
|
|
1884
1885
|
}
|
|
1885
1886
|
function buildHandlersStruct$lambda$lambda_2($this$function) {
|
|
1886
|
-
$this$function.
|
|
1887
|
-
$this$function.
|
|
1888
|
-
$this$function.
|
|
1887
|
+
$this$function.b1i($this$function.p1h('Wirespec.ClientEdge', [$this$function.p1h('Request', []), $this$function.p1h('Response', [Wildcard_instance])]));
|
|
1888
|
+
$this$function.y1h('serialization', $this$function.p1h('Wirespec.Serialization', []));
|
|
1889
|
+
$this$function.c1i(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}'));
|
|
1889
1890
|
return Unit_instance;
|
|
1890
1891
|
}
|
|
1891
1892
|
function buildHandlersStruct$lambda_0($pathTemplate, $this_buildHandlersStruct) {
|
|
1892
1893
|
return function ($this$struct) {
|
|
1893
|
-
$this$struct.u1k($this$struct.
|
|
1894
|
-
$this$struct.u1k($this$struct.
|
|
1895
|
-
$this$struct.
|
|
1896
|
-
$this$struct.
|
|
1897
|
-
$this$struct.
|
|
1898
|
-
$this$struct.
|
|
1894
|
+
$this$struct.u1k($this$struct.p1h('Wirespec.Server', [$this$struct.p1h('Request', []), $this$struct.p1h('Response', [Wildcard_instance])]));
|
|
1895
|
+
$this$struct.u1k($this$struct.p1h('Wirespec.Client', [$this$struct.p1h('Request', []), $this$struct.p1h('Response', [Wildcard_instance])]));
|
|
1896
|
+
$this$struct.d1i('getPathTemplate', VOID, true, buildHandlersStruct$lambda$lambda($pathTemplate));
|
|
1897
|
+
$this$struct.d1i('getMethod', VOID, true, buildHandlersStruct$lambda$lambda_0($this_buildHandlersStruct));
|
|
1898
|
+
$this$struct.d1i('getServer', VOID, true, buildHandlersStruct$lambda$lambda_1);
|
|
1899
|
+
$this$struct.d1i('getClient', VOID, true, buildHandlersStruct$lambda$lambda_2);
|
|
1899
1900
|
return Unit_instance;
|
|
1900
1901
|
};
|
|
1901
1902
|
}
|
|
1902
1903
|
function withFullyQualifiedPrefix$lambda(it) {
|
|
1903
|
-
return it.
|
|
1904
|
+
return it.y1p_1.equals(Companion_getInstance().n1h('message'));
|
|
1904
1905
|
}
|
|
1905
1906
|
function withFullyQualifiedPrefix$lambda_0($prefix) {
|
|
1906
1907
|
return function (param) {
|
|
1907
|
-
var t = param.
|
|
1908
|
+
var t = param.z1p_1;
|
|
1908
1909
|
var tmp;
|
|
1909
1910
|
if (t instanceof Custom_0) {
|
|
1910
|
-
tmp = param.
|
|
1911
|
+
tmp = param.b1q(VOID, t.m1n(Companion_getInstance().n1h($prefix + t.h1j_1.o1h())));
|
|
1911
1912
|
} else {
|
|
1912
1913
|
tmp = param;
|
|
1913
1914
|
}
|
|
@@ -1918,8 +1919,8 @@ function JavaRefinedTypeDefinitionEmitter() {
|
|
|
1918
1919
|
}
|
|
1919
1920
|
function JavaShared() {
|
|
1920
1921
|
JavaShared_instance = this;
|
|
1921
|
-
this.
|
|
1922
|
-
this.
|
|
1922
|
+
this.e1x_1 = 'community.flock.wirespec.java';
|
|
1923
|
+
this.f1x_1 = trimMargin('\n |package ' + this.e1x_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 ');
|
|
1923
1924
|
}
|
|
1924
1925
|
protoOf(JavaShared).toString = function () {
|
|
1925
1926
|
return 'JavaShared';
|
|
@@ -2037,29 +2038,30 @@ function JavaUnionDefinitionEmitter$emit$lambda(it) {
|
|
|
2037
2038
|
function JavaUnionDefinitionEmitter() {
|
|
2038
2039
|
}
|
|
2039
2040
|
//region block: post-declaration
|
|
2040
|
-
protoOf(JavaEmitter).nr =
|
|
2041
|
+
protoOf(JavaEmitter).nr = emit_13;
|
|
2041
2042
|
protoOf(JavaEmitter).kq = emit_3;
|
|
2042
2043
|
protoOf(JavaEmitter).lq = emit_4;
|
|
2043
2044
|
protoOf(JavaEmitter).mq = emit_5;
|
|
2044
2045
|
protoOf(JavaEmitter).nq = emit_6;
|
|
2045
2046
|
protoOf(JavaEmitter).oq = emit_7;
|
|
2046
2047
|
protoOf(JavaEmitter).as = emit_9;
|
|
2047
|
-
protoOf(JavaEmitter).
|
|
2048
|
-
protoOf(JavaEmitter).
|
|
2048
|
+
protoOf(JavaEmitter).h1x = emit_10;
|
|
2049
|
+
protoOf(JavaEmitter).i1x = emit_11;
|
|
2049
2050
|
protoOf(JavaEmitter).or = emit_8;
|
|
2050
|
-
protoOf(JavaEmitter).zr =
|
|
2051
|
-
protoOf(JavaEmitter).pr =
|
|
2052
|
-
protoOf(JavaEmitter).ur =
|
|
2053
|
-
protoOf(JavaEmitter).
|
|
2054
|
-
protoOf(JavaEmitter).
|
|
2055
|
-
protoOf(JavaEmitter).
|
|
2056
|
-
protoOf(JavaEmitter).
|
|
2057
|
-
protoOf(JavaEmitter).
|
|
2058
|
-
protoOf(JavaEmitter).
|
|
2051
|
+
protoOf(JavaEmitter).zr = emit_14;
|
|
2052
|
+
protoOf(JavaEmitter).pr = emit_15;
|
|
2053
|
+
protoOf(JavaEmitter).ur = emit_12;
|
|
2054
|
+
protoOf(JavaEmitter).g1x = sanitizeSymbol;
|
|
2055
|
+
protoOf(JavaEmitter).j1x = sanitizeFirstIsDigit;
|
|
2056
|
+
protoOf(JavaEmitter).k1x = sanitizeKeywords;
|
|
2057
|
+
protoOf(JavaEmitter).w1w = emitRoot;
|
|
2058
|
+
protoOf(JavaEmitter).v1w = emitRoot$default;
|
|
2059
|
+
protoOf(JavaEmitter).l1x = emitHandleFunction;
|
|
2059
2060
|
protoOf(JavaEmitter).bs = emitValidator;
|
|
2061
|
+
protoOf(JavaIrEmitter).v1v = get_extensions;
|
|
2060
2062
|
protoOf(JavaIrEmitter).eo = emit_1;
|
|
2061
|
-
protoOf(JavaIrEmitter).
|
|
2062
|
-
protoOf(JavaIrEmitter).
|
|
2063
|
+
protoOf(JavaIrEmitter).w1v = emit_2;
|
|
2064
|
+
protoOf(JavaIrEmitter).a1w = beforeGenerate;
|
|
2063
2065
|
//endregion
|
|
2064
2066
|
//region block: exports
|
|
2065
2067
|
export {
|