@flock/wirespec 0.19.5 → 0.20.0-RC.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.mjs +12 -12
- package/arrow-arrow-core.mjs +167 -167
- package/clikt-clikt-mordant.mjs +81 -81
- package/clikt-clikt-mordant.mjs.map +1 -1
- package/clikt-clikt.mjs +1636 -1636
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +448 -448
- package/kotest-kotest-assertions-kotest-assertions-core.mjs +4 -0
- package/kotest-kotest-assertions-kotest-assertions-core.mjs.map +1 -0
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs +4 -0
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs.map +1 -0
- package/kotest-kotest-common.mjs +56 -0
- package/kotest-kotest-common.mjs.map +1 -0
- package/kotest-kotest-framework-kotest-framework-engine.mjs +4 -0
- package/kotest-kotest-framework-kotest-framework-engine.mjs.map +1 -0
- package/kotest-kotest-property.mjs +2501 -0
- package/kotest-kotest-property.mjs.map +1 -0
- package/kotlin-kotlin-stdlib.mjs +5263 -2481
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10243 -10243
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1846 -1846
- package/kotlin-rgxgen.mjs.map +1 -1
- package/kotlinx-coroutines-test.mjs +4 -0
- package/kotlinx-coroutines-test.mjs.map +1 -0
- package/kotlinx-io-kotlinx-io-core.mjs +455 -455
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +2135 -2101
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1579 -1579
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1435 -1435
- package/package.json +5 -1
- package/wirespec-generator.d.ts +51 -0
- package/wirespec-generator.mjs +9 -0
- package/wirespec-src-compiler-core.mjs +1598 -1598
- package/wirespec-src-compiler-emitters-java.mjs +445 -445
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +343 -343
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +429 -429
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +482 -482
- package/wirespec-src-compiler-emitters-scala.mjs +194 -194
- package/wirespec-src-compiler-emitters-typescript.mjs +530 -530
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +87 -87
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3887 -3863
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +457 -457
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +521 -521
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +859 -859
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +1387 -1387
- package/wirespec-src-ide-lsp.mjs.map +1 -1
- package/wirespec-src-integration-kotest.mjs +1647 -0
- package/wirespec-src-integration-kotest.mjs.map +1 -0
- package/wirespec-src-plugin-arguments.mjs +192 -192
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +109 -109
- package/wirespec-src-plugin-npm.d.mts +21 -0
- package/wirespec-src-plugin-npm.mjs +43 -43
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +35 -35
- package/wirespec-src-tools-generator.mjs.map +1 -1
- package/xmlutil-core.mjs +4 -0
- package/xmlutil-core.mjs.map +1 -0
- package/xmlutil-serialization.mjs +4 -0
- package/xmlutil-serialization.mjs.map +1 -0
|
@@ -188,10 +188,10 @@ import {
|
|
|
188
188
|
//endregion
|
|
189
189
|
//region block: pre-declaration
|
|
190
190
|
function emit_3(type, module_0) {
|
|
191
|
-
var tmp = this.
|
|
192
|
-
var tmp_0 = this.
|
|
191
|
+
var tmp = this.yu(type.ws_1);
|
|
192
|
+
var tmp_0 = this.wt(type.xs_1);
|
|
193
193
|
// Inline function 'kotlin.run' call
|
|
194
|
-
var $this$run = type.
|
|
194
|
+
var $this$run = type.ys_1;
|
|
195
195
|
var tmp_1;
|
|
196
196
|
if ($this$run.r()) {
|
|
197
197
|
tmp_1 = '';
|
|
@@ -202,23 +202,23 @@ function emit_3(type, module_0) {
|
|
|
202
202
|
return trimMargin('\n |public record ' + tmp + ' (\n |' + tmp_0 + '\n |)' + tmp$ret$1 + ' {\n |};\n |\n ');
|
|
203
203
|
}
|
|
204
204
|
function emit_4(_this__u8e3s4) {
|
|
205
|
-
return dropLast_0(joinToString(_this__u8e3s4.
|
|
205
|
+
return dropLast_0(joinToString(_this__u8e3s4.ts_1, '\n', VOID, VOID, VOID, VOID, JavaTypeDefinitionEmitter$emit$lambda_0(this)), 1);
|
|
206
206
|
}
|
|
207
207
|
function emit_5(_this__u8e3s4) {
|
|
208
|
-
return this.
|
|
208
|
+
return this.yt(_this__u8e3s4.ct_1) + ' ' + this.yu(_this__u8e3s4.bt_1);
|
|
209
209
|
}
|
|
210
210
|
function emit_6(_this__u8e3s4) {
|
|
211
211
|
// Inline function 'kotlin.let' call
|
|
212
212
|
var it = emitType(this, _this__u8e3s4);
|
|
213
|
-
return _this__u8e3s4.
|
|
213
|
+
return _this__u8e3s4.ey() ? 'java.util.Optional<' + it + '>' : it;
|
|
214
214
|
}
|
|
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.k20(_this__u8e3s4.ds_1);
|
|
219
219
|
} else {
|
|
220
220
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
221
|
-
tmp = this.
|
|
221
|
+
tmp = this.k20(_this__u8e3s4.as_1);
|
|
222
222
|
} else {
|
|
223
223
|
if (_this__u8e3s4 instanceof Unit) {
|
|
224
224
|
tmp = void_0;
|
|
@@ -247,15 +247,15 @@ 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.l20(_this__u8e3s4, void_0) : emitRoot(_this__u8e3s4, void_0);
|
|
251
251
|
}
|
|
252
252
|
function emit_7(_this__u8e3s4) {
|
|
253
253
|
var tmp;
|
|
254
254
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
255
|
-
tmp = 'return java.util.regex.Pattern.compile("' + replace(this.
|
|
255
|
+
tmp = 'return java.util.regex.Pattern.compile("' + replace(this.au(_this__u8e3s4.ax_1), '\\', '\\\\') + '").matcher(value).find();';
|
|
256
256
|
} else {
|
|
257
257
|
if (_this__u8e3s4 instanceof Bound) {
|
|
258
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
258
|
+
var tmp1_safe_receiver = _this__u8e3s4.qx_1;
|
|
259
259
|
var tmp_0;
|
|
260
260
|
if (tmp1_safe_receiver == null) {
|
|
261
261
|
tmp_0 = null;
|
|
@@ -264,7 +264,7 @@ function emit_7(_this__u8e3s4) {
|
|
|
264
264
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
265
265
|
}
|
|
266
266
|
var minCheck = tmp_0;
|
|
267
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
267
|
+
var tmp2_safe_receiver = _this__u8e3s4.rx_1;
|
|
268
268
|
var tmp_1;
|
|
269
269
|
if (tmp2_safe_receiver == null) {
|
|
270
270
|
tmp_1 = null;
|
|
@@ -290,16 +290,16 @@ 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.
|
|
293
|
+
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |@FunctionalInterface\n |public interface ' + this.yu(channel.ns_1) + ' {\n | void invoke(' + emitFullyQualified(this, channel, channel.os_1) + this.k20(channel.os_1) + ' message);\n |}\n |\n ');
|
|
294
294
|
}
|
|
295
295
|
initMetadataForInterface(JavaChannelDefinitionEmitter, 'JavaChannelDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
296
296
|
function emit_9(identifier) {
|
|
297
297
|
var tmp;
|
|
298
298
|
if (identifier instanceof DefinitionIdentifier) {
|
|
299
|
-
tmp = this.
|
|
299
|
+
tmp = this.v20(identifier.m1());
|
|
300
300
|
} else {
|
|
301
301
|
if (identifier instanceof FieldIdentifier) {
|
|
302
|
-
tmp = this.
|
|
302
|
+
tmp = this.z20(this.v20(identifier.m1()));
|
|
303
303
|
} else {
|
|
304
304
|
noWhenBranchMatchedException();
|
|
305
305
|
}
|
|
@@ -317,11 +317,11 @@ function sanitizeSymbol(_this__u8e3s4) {
|
|
|
317
317
|
var item = _iterator__ex2g4s.v();
|
|
318
318
|
var _unary__edvuaz = index;
|
|
319
319
|
index = _unary__edvuaz + 1 | 0;
|
|
320
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
321
|
-
destination.
|
|
320
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.pu(item) : item;
|
|
321
|
+
destination.y(tmp$ret$0);
|
|
322
322
|
}
|
|
323
323
|
var tmp = asSequence(joinToString(destination, ''));
|
|
324
|
-
return this.
|
|
324
|
+
return this.y20(joinToString_0(filter(tmp, JavaIdentifierEmitter$sanitizeSymbol$lambda), ''));
|
|
325
325
|
}
|
|
326
326
|
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
327
327
|
var tmp;
|
|
@@ -341,107 +341,44 @@ function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
|
341
341
|
return tmp;
|
|
342
342
|
}
|
|
343
343
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
344
|
-
return Companion_getInstance_0().
|
|
344
|
+
return Companion_getInstance_0().b21_1.v1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
345
345
|
}
|
|
346
346
|
initMetadataForInterface(JavaIdentifierEmitter, 'JavaIdentifierEmitter');
|
|
347
|
-
function emit_10(
|
|
348
|
-
var tmp = this.
|
|
349
|
-
return trimMargin('\n |public
|
|
347
|
+
function emit_10(enum_0, module_0) {
|
|
348
|
+
var tmp = this.yu(enum_0.iv_1);
|
|
349
|
+
return trimMargin('\n |public enum ' + tmp + ' implements Wirespec.Enum {\n |' + spacer(joinToString(enum_0.jv_1, ',\n', VOID, VOID, VOID, VOID, JavaEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'public final String label;\n |' + Spacer_instance.toString() + this.yu(enum_0.iv_1) + '(String label) {\n |' + Spacer_instance.sv(2) + 'this.label = label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() {\n |' + Spacer_instance.sv(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String label() {\n |' + Spacer_instance.sv(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
350
350
|
}
|
|
351
|
-
initMetadataForInterface(
|
|
352
|
-
function emit_11(
|
|
353
|
-
var tmp =
|
|
354
|
-
|
|
355
|
-
var tmp_1 = get_pathParams(endpoint);
|
|
356
|
-
var tmp_2 = emitObject(this, tmp_1, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
|
|
357
|
-
var tmp_3 = emitObject(this, endpoint.xp_1, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
358
|
-
var tmp_4 = emitObject(this, endpoint.yp_1, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
359
|
-
var tmp_5 = this.l1x(first_0(endpoint.zp_1), endpoint);
|
|
360
|
-
var tmp_6 = Spacer_instance.toString();
|
|
361
|
-
var tmp_7 = emitStatusInterfaces(this, endpoint);
|
|
362
|
-
var tmp_8 = emitResponseInterfaces(this, endpoint);
|
|
363
|
-
var tmp_9 = distinctByStatus(endpoint.aq_1);
|
|
364
|
-
var tmp_10 = joinToString(tmp_9, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
365
|
-
var tmp_11 = Spacer_instance.toString();
|
|
366
|
-
var tmp_12 = emitRequestFunctions(this, first_0(endpoint.zp_1), endpoint);
|
|
367
|
-
var tmp_13 = Spacer_instance.hs(2);
|
|
368
|
-
var tmp_14 = distinctByStatus(endpoint.aq_1);
|
|
369
|
-
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
370
|
-
var tmp_16 = Spacer_instance.hs(3);
|
|
371
|
-
var tmp_17 = Spacer_instance.hs(2);
|
|
372
|
-
var tmp_18 = Spacer_instance.hs(2);
|
|
373
|
-
var tmp_19 = emitFromResponse(this, endpoint);
|
|
374
|
-
var tmp_20 = Spacer_instance.hs(2);
|
|
375
|
-
var tmp_21 = Spacer_instance.hs(2);
|
|
376
|
-
var tmp_22 = this.p1x(endpoint);
|
|
377
|
-
var tmp_23 = Spacer_instance.hs(2);
|
|
378
|
-
var tmp_24 = Spacer_instance.hs(3);
|
|
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 ');
|
|
380
|
-
}
|
|
381
|
-
function emitHandleFunction(endpoint) {
|
|
382
|
-
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.fr(this.nr(endpoint.up_1)) + '(Request request);';
|
|
383
|
-
}
|
|
384
|
-
function emit_12(_this__u8e3s4, endpoint) {
|
|
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 ');
|
|
386
|
-
}
|
|
387
|
-
function emit_13(_this__u8e3s4) {
|
|
388
|
-
var tmp = Spacer_instance.toString();
|
|
389
|
-
var tmp_0 = Companion_instance_1.er(_this__u8e3s4.gq_1);
|
|
390
|
-
var tmp_1 = Spacer_instance.hs(2);
|
|
391
|
-
var tmp_2 = Spacer_instance.hs(2);
|
|
392
|
-
var tmp_3 = Spacer_instance.hs(2);
|
|
393
|
-
var tmp_4 = emit_16(this, _this__u8e3s4.iq_1);
|
|
394
|
-
var tmp_5 = Spacer_instance.toString();
|
|
395
|
-
var tmp_6 = toString_0(first(_this__u8e3s4.gq_1));
|
|
396
|
-
var tmp_7 = emit_16(this, _this__u8e3s4.iq_1);
|
|
397
|
-
var tmp_8 = concatGenerics(emit_16(this, _this__u8e3s4.iq_1));
|
|
398
|
-
var tmp_9 = Spacer_instance.hs(2);
|
|
399
|
-
var tmp_10 = Companion_instance_1.er(_this__u8e3s4.gq_1);
|
|
400
|
-
var tmp_11 = orNull(joinToString(_this__u8e3s4.hq_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_5(this)));
|
|
401
|
-
var tmp0_safe_receiver = _this__u8e3s4.iq_1;
|
|
402
|
-
var tmp_12;
|
|
403
|
-
if (tmp0_safe_receiver == null) {
|
|
404
|
-
tmp_12 = null;
|
|
405
|
-
} else {
|
|
406
|
-
// Inline function 'kotlin.let' call
|
|
407
|
-
tmp_12 = emit_16(this, tmp0_safe_receiver) + ' body';
|
|
408
|
-
}
|
|
409
|
-
var tmp_13 = joinToString(listOfNotNull([tmp_11, tmp_12]));
|
|
410
|
-
var tmp_14 = Spacer_instance.hs(3);
|
|
411
|
-
var tmp_15 = fixStatus(_this__u8e3s4.gq_1);
|
|
412
|
-
// Inline function 'kotlin.let' call
|
|
413
|
-
var tmp_16 = 'new Headers(' + joinToString(_this__u8e3s4.hq_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_6(this)) + ')';
|
|
414
|
-
var tmp_17 = _this__u8e3s4.iq_1 == null ? 'null' : 'body';
|
|
415
|
-
var tmp_18 = Spacer_instance.hs(2);
|
|
416
|
-
var tmp_19 = Spacer_instance.hs(1);
|
|
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 ');
|
|
351
|
+
initMetadataForInterface(JavaEnumDefinitionEmitter, 'JavaEnumDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
352
|
+
function emit_11(union) {
|
|
353
|
+
var tmp = this.yu(union.rs_1);
|
|
354
|
+
return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.ss_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
|
|
418
355
|
}
|
|
419
|
-
initMetadataForInterface(
|
|
420
|
-
function
|
|
421
|
-
return trimMargin('\n |public record ' + this.
|
|
356
|
+
initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
357
|
+
function emit_12(refined) {
|
|
358
|
+
return trimMargin('\n |public record ' + this.yu(refined.dv_1) + ' (' + this.yt(refined.ev_1) + ' value) implements Wirespec.Refined<' + this.yt(refined.ev_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.mv(refined) + '\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public ' + this.yt(refined.ev_1) + ' value() { return value; }\n |}\n |\n ');
|
|
422
359
|
}
|
|
423
360
|
function emitValidator(_this__u8e3s4) {
|
|
424
361
|
var defaultReturn = 'return true;';
|
|
425
|
-
var type = _this__u8e3s4.
|
|
362
|
+
var type = _this__u8e3s4.ev_1.qy_1;
|
|
426
363
|
var tmp;
|
|
427
364
|
if (type instanceof Integer) {
|
|
428
|
-
var tmp0_safe_receiver = type.
|
|
429
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
365
|
+
var tmp0_safe_receiver = type.vx_1;
|
|
366
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.zt(tmp0_safe_receiver);
|
|
430
367
|
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
431
368
|
} else {
|
|
432
369
|
if (type instanceof Number_0) {
|
|
433
|
-
var tmp2_safe_receiver = type.
|
|
434
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.
|
|
370
|
+
var tmp2_safe_receiver = type.yx_1;
|
|
371
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.zt(tmp2_safe_receiver);
|
|
435
372
|
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
436
373
|
} else {
|
|
437
374
|
if (type instanceof String_0) {
|
|
438
|
-
var tmp4_safe_receiver = type.
|
|
375
|
+
var tmp4_safe_receiver = type.sx_1;
|
|
439
376
|
var tmp_0;
|
|
440
377
|
var tmp_1 = tmp4_safe_receiver;
|
|
441
378
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
442
379
|
tmp_0 = null;
|
|
443
380
|
} else {
|
|
444
|
-
tmp_0 = this.
|
|
381
|
+
tmp_0 = this.zt(new RegExp_0(tmp4_safe_receiver));
|
|
445
382
|
}
|
|
446
383
|
var tmp5_elvis_lhs = tmp_0;
|
|
447
384
|
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
@@ -461,12 +398,75 @@ function emitValidator(_this__u8e3s4) {
|
|
|
461
398
|
return tmp;
|
|
462
399
|
}
|
|
463
400
|
initMetadataForInterface(JavaRefinedTypeDefinitionEmitter, 'JavaRefinedTypeDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
464
|
-
function
|
|
465
|
-
var tmp = this
|
|
466
|
-
|
|
401
|
+
function emit_13(endpoint) {
|
|
402
|
+
var tmp = emitImports_0(this, endpoint);
|
|
403
|
+
var tmp_0 = this.yu(endpoint.ft_1);
|
|
404
|
+
var tmp_1 = get_pathParams(endpoint);
|
|
405
|
+
var tmp_2 = emitObject(this, tmp_1, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
|
|
406
|
+
var tmp_3 = emitObject(this, endpoint.it_1, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
407
|
+
var tmp_4 = emitObject(this, endpoint.jt_1, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
408
|
+
var tmp_5 = this.w20(first_0(endpoint.kt_1), endpoint);
|
|
409
|
+
var tmp_6 = Spacer_instance.toString();
|
|
410
|
+
var tmp_7 = emitStatusInterfaces(this, endpoint);
|
|
411
|
+
var tmp_8 = emitResponseInterfaces(this, endpoint);
|
|
412
|
+
var tmp_9 = distinctByStatus(endpoint.lt_1);
|
|
413
|
+
var tmp_10 = joinToString(tmp_9, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
414
|
+
var tmp_11 = Spacer_instance.toString();
|
|
415
|
+
var tmp_12 = emitRequestFunctions(this, first_0(endpoint.kt_1), endpoint);
|
|
416
|
+
var tmp_13 = Spacer_instance.sv(2);
|
|
417
|
+
var tmp_14 = distinctByStatus(endpoint.lt_1);
|
|
418
|
+
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
419
|
+
var tmp_16 = Spacer_instance.sv(3);
|
|
420
|
+
var tmp_17 = Spacer_instance.sv(2);
|
|
421
|
+
var tmp_18 = Spacer_instance.sv(2);
|
|
422
|
+
var tmp_19 = emitFromResponse(this, endpoint);
|
|
423
|
+
var tmp_20 = Spacer_instance.sv(2);
|
|
424
|
+
var tmp_21 = Spacer_instance.sv(2);
|
|
425
|
+
var tmp_22 = this.a21(endpoint);
|
|
426
|
+
var tmp_23 = Spacer_instance.sv(2);
|
|
427
|
+
var tmp_24 = Spacer_instance.sv(3);
|
|
428
|
+
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.ht_1, '/', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_4) + '"; }\n |' + Spacer_instance.sv(3) + '@Override public String getMethod() { return "' + endpoint.gt_1.toString() + '"; }\n |' + Spacer_instance.sv(3) + '@Override public Wirespec.ServerEdge<Request, Response<?>> getServer(Wirespec.Serialization serialization) {\n |' + Spacer_instance.sv(4) + 'return new Wirespec.ServerEdge<>() {\n |' + Spacer_instance.sv(5) + '@Override public Request from(Wirespec.RawRequest request) { return fromRequest(serialization, request); }\n |' + Spacer_instance.sv(5) + '@Override public Wirespec.RawResponse to(Response<?> response) { return toResponse(serialization, response); }\n |' + Spacer_instance.sv(4) + '};\n |' + Spacer_instance.sv(3) + '}\n |' + Spacer_instance.sv(3) + '@Override public Wirespec.ClientEdge<Request, Response<?>> getClient(Wirespec.Serialization serialization) {\n |' + Spacer_instance.sv(4) + 'return new Wirespec.ClientEdge<>() {\n |' + Spacer_instance.sv(5) + '@Override public Wirespec.RawRequest to(Request request) { return toRequest(serialization, request); }\n |' + Spacer_instance.sv(5) + '@Override public Response<?> from(Wirespec.RawResponse response) { return fromResponse(serialization, response); }\n |' + Spacer_instance.sv(4) + '};\n |' + Spacer_instance.sv(3) + '}\n |' + Spacer_instance.sv(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
467
429
|
}
|
|
468
|
-
|
|
469
|
-
|
|
430
|
+
function emitHandleFunction(endpoint) {
|
|
431
|
+
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.qu(this.yu(endpoint.ft_1)) + '(Request request);';
|
|
432
|
+
}
|
|
433
|
+
function emit_14(_this__u8e3s4, endpoint) {
|
|
434
|
+
return trimMargin('\n |' + Spacer_instance.toString() + 'record Request (\n |' + Spacer_instance.sv(2) + 'Path path,\n |' + Spacer_instance.sv(2) + 'Wirespec.Method method,\n |' + Spacer_instance.sv(2) + 'Queries queries,\n |' + Spacer_instance.sv(2) + 'RequestHeaders headers,\n |' + Spacer_instance.sv(2) + emit_16(this, _this__u8e3s4.ot_1) + ' body\n |' + Spacer_instance.toString() + ') implements Wirespec.Request<' + emit_16(this, _this__u8e3s4.ot_1) + '> {\n |' + Spacer_instance.sv(2) + emitConstructor(this, _this__u8e3s4, endpoint) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
435
|
+
}
|
|
436
|
+
function emit_15(_this__u8e3s4) {
|
|
437
|
+
var tmp = Spacer_instance.toString();
|
|
438
|
+
var tmp_0 = Companion_instance_1.pu(_this__u8e3s4.rt_1);
|
|
439
|
+
var tmp_1 = Spacer_instance.sv(2);
|
|
440
|
+
var tmp_2 = Spacer_instance.sv(2);
|
|
441
|
+
var tmp_3 = Spacer_instance.sv(2);
|
|
442
|
+
var tmp_4 = emit_16(this, _this__u8e3s4.tt_1);
|
|
443
|
+
var tmp_5 = Spacer_instance.toString();
|
|
444
|
+
var tmp_6 = toString_0(first(_this__u8e3s4.rt_1));
|
|
445
|
+
var tmp_7 = emit_16(this, _this__u8e3s4.tt_1);
|
|
446
|
+
var tmp_8 = concatGenerics(emit_16(this, _this__u8e3s4.tt_1));
|
|
447
|
+
var tmp_9 = Spacer_instance.sv(2);
|
|
448
|
+
var tmp_10 = Companion_instance_1.pu(_this__u8e3s4.rt_1);
|
|
449
|
+
var tmp_11 = orNull(joinToString(_this__u8e3s4.st_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_5(this)));
|
|
450
|
+
var tmp0_safe_receiver = _this__u8e3s4.tt_1;
|
|
451
|
+
var tmp_12;
|
|
452
|
+
if (tmp0_safe_receiver == null) {
|
|
453
|
+
tmp_12 = null;
|
|
454
|
+
} else {
|
|
455
|
+
// Inline function 'kotlin.let' call
|
|
456
|
+
tmp_12 = emit_16(this, tmp0_safe_receiver) + ' body';
|
|
457
|
+
}
|
|
458
|
+
var tmp_13 = joinToString(listOfNotNull([tmp_11, tmp_12]));
|
|
459
|
+
var tmp_14 = Spacer_instance.sv(3);
|
|
460
|
+
var tmp_15 = fixStatus(_this__u8e3s4.rt_1);
|
|
461
|
+
// Inline function 'kotlin.let' call
|
|
462
|
+
var tmp_16 = 'new Headers(' + joinToString(_this__u8e3s4.st_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_6(this)) + ')';
|
|
463
|
+
var tmp_17 = _this__u8e3s4.tt_1 == null ? 'null' : 'body';
|
|
464
|
+
var tmp_18 = Spacer_instance.sv(2);
|
|
465
|
+
var tmp_19 = Spacer_instance.sv(1);
|
|
466
|
+
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.st_1, 'Headers', 'Wirespec.Response.Headers', JavaEndpointDefinitionEmitter$emit$lambda_7(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
467
|
+
}
|
|
468
|
+
initMetadataForInterface(JavaEndpointDefinitionEmitter, 'JavaEndpointDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
469
|
+
initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [JavaTypeDefinitionEmitter, JavaEnumDefinitionEmitter, JavaUnionDefinitionEmitter, JavaRefinedTypeDefinitionEmitter, JavaChannelDefinitionEmitter, JavaIdentifierEmitter, JavaEndpointDefinitionEmitter, LanguageEmitter]);
|
|
470
470
|
initMetadataForCompanion(Companion);
|
|
471
471
|
initMetadataForCompanion(Companion_0);
|
|
472
472
|
initMetadataForClass(JavaIrEmitter, 'JavaIrEmitter', JavaIrEmitter, VOID, [IrEmitter]);
|
|
@@ -480,8 +480,8 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
480
480
|
var _iterator__ex2g4s = tmp0.t();
|
|
481
481
|
while (_iterator__ex2g4s.u()) {
|
|
482
482
|
var element = _iterator__ex2g4s.v();
|
|
483
|
-
if (!(_this__u8e3s4.
|
|
484
|
-
destination.
|
|
483
|
+
if (!(_this__u8e3s4.xu().m1() === element.my_1)) {
|
|
484
|
+
destination.y(element);
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
487
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -490,16 +490,16 @@ 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.
|
|
494
|
-
destination_0.
|
|
493
|
+
var tmp$ret$3 = 'import ' + $this.j20().ov_1 + '.model.' + item.my_1 + ';';
|
|
494
|
+
destination_0.y(tmp$ret$3);
|
|
495
495
|
}
|
|
496
496
|
var tmp = destination_0;
|
|
497
497
|
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaChannelDefinitionEmitter$emitImports$lambda);
|
|
498
498
|
}
|
|
499
499
|
function emitFullyQualified($this, _this__u8e3s4, reference) {
|
|
500
500
|
var tmp;
|
|
501
|
-
if (_this__u8e3s4.
|
|
502
|
-
tmp = $this.
|
|
501
|
+
if (_this__u8e3s4.xu().m1() === reference.m1()) {
|
|
502
|
+
tmp = $this.j20().ov_1 + '.model.';
|
|
503
503
|
} else {
|
|
504
504
|
tmp = '';
|
|
505
505
|
}
|
|
@@ -512,49 +512,49 @@ function JavaChannelDefinitionEmitter$emitImports$lambda(it) {
|
|
|
512
512
|
function JavaChannelDefinitionEmitter() {
|
|
513
513
|
}
|
|
514
514
|
function JavaEmitter(packageName, emitShared) {
|
|
515
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
516
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
515
|
+
packageName = packageName === VOID ? Companion_instance.nv('community.flock.wirespec.generated') : packageName;
|
|
516
|
+
emitShared = emitShared === VOID ? Companion_instance_0.hs() : 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.m20_1 = packageName;
|
|
519
|
+
this.n20_1 = emitShared;
|
|
520
|
+
this.o20_1 = '\nimport community.flock.wirespec.java.Wirespec;\n';
|
|
521
|
+
this.p20_1 = FileExtension_Java_getInstance();
|
|
522
|
+
this.q20_1 = JavaShared_getInstance();
|
|
523
|
+
this.r20_1 = '//';
|
|
524
|
+
}
|
|
525
|
+
protoOf(JavaEmitter).j20 = function () {
|
|
526
|
+
return this.m20_1;
|
|
527
527
|
};
|
|
528
|
-
protoOf(JavaEmitter).
|
|
529
|
-
return this.
|
|
528
|
+
protoOf(JavaEmitter).fu = function () {
|
|
529
|
+
return this.p20_1;
|
|
530
530
|
};
|
|
531
|
-
protoOf(JavaEmitter).
|
|
532
|
-
return this.
|
|
531
|
+
protoOf(JavaEmitter).s20 = function () {
|
|
532
|
+
return this.q20_1;
|
|
533
533
|
};
|
|
534
|
-
protoOf(JavaEmitter).
|
|
535
|
-
return this.
|
|
534
|
+
protoOf(JavaEmitter).gu = function () {
|
|
535
|
+
return this.r20_1;
|
|
536
536
|
};
|
|
537
|
-
protoOf(JavaEmitter).
|
|
537
|
+
protoOf(JavaEmitter).vu = function (module_0, logger) {
|
|
538
538
|
// Inline function 'kotlin.let' call
|
|
539
|
-
var it = protoOf(LanguageEmitter).
|
|
540
|
-
return this.
|
|
539
|
+
var it = protoOf(LanguageEmitter).vu.call(this, module_0, logger);
|
|
540
|
+
return this.n20_1.is_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.nv('community.flock.wirespec.java').qv() + 'Wirespec', this.s20().u20_1)) : it;
|
|
541
541
|
};
|
|
542
|
-
protoOf(JavaEmitter).
|
|
542
|
+
protoOf(JavaEmitter).wu = function (definition, module_0, logger) {
|
|
543
543
|
// Inline function 'kotlin.let' call
|
|
544
|
-
var it = protoOf(LanguageEmitter).
|
|
545
|
-
var subPackageName = plus(this.
|
|
546
|
-
var tmp = subPackageName.
|
|
544
|
+
var it = protoOf(LanguageEmitter).wu.call(this, definition, module_0, logger);
|
|
545
|
+
var subPackageName = plus(this.j20(), definition);
|
|
546
|
+
var tmp = subPackageName.qv() + this.v20(it.js_1);
|
|
547
547
|
// Inline function 'kotlin.text.trimStart' call
|
|
548
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.
|
|
548
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.ru(module_0) ? this.o20_1 : '') + '\n |' + it.ks_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.l20(_this__u8e3s4, 'Void') + '.class, ' + emitGetTypeRaw($this, _this__u8e3s4) + ')';
|
|
554
554
|
}
|
|
555
555
|
function emitGetTypeRaw($this, _this__u8e3s4) {
|
|
556
556
|
var tmp;
|
|
557
|
-
var tmp1_elvis_lhs = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
557
|
+
var tmp1_elvis_lhs = _this__u8e3s4 == null ? null : _this__u8e3s4.ey();
|
|
558
558
|
if (tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs) {
|
|
559
559
|
tmp = 'java.util.Optional.class';
|
|
560
560
|
} else {
|
|
@@ -569,9 +569,9 @@ function emitGetTypeRaw($this, _this__u8e3s4) {
|
|
|
569
569
|
function emitConstructor($this, _this__u8e3s4, endpoint) {
|
|
570
570
|
var tmp = get_pathParams(endpoint);
|
|
571
571
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda($this)));
|
|
572
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
573
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
574
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
572
|
+
var tmp_1 = orNull(joinToString(endpoint.it_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_0($this)));
|
|
573
|
+
var tmp_2 = orNull(joinToString(endpoint.jt_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_1($this)));
|
|
574
|
+
var tmp0_safe_receiver = _this__u8e3s4.ot_1;
|
|
575
575
|
var tmp_3;
|
|
576
576
|
if (tmp0_safe_receiver == null) {
|
|
577
577
|
tmp_3 = null;
|
|
@@ -580,112 +580,112 @@ function emitConstructor($this, _this__u8e3s4, endpoint) {
|
|
|
580
580
|
tmp_3 = emit_16($this, tmp0_safe_receiver) + ' body';
|
|
581
581
|
}
|
|
582
582
|
var tmp_4 = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]));
|
|
583
|
-
var tmp_5 = Spacer_instance.
|
|
583
|
+
var tmp_5 = Spacer_instance.sv(3);
|
|
584
584
|
var tmp_6 = get_pathParams(endpoint);
|
|
585
585
|
// Inline function 'kotlin.let' call
|
|
586
586
|
var tmp$ret$3 = 'new Path(' + joinToString(tmp_6, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_2($this)) + ')';
|
|
587
587
|
var tmp1_elvis_lhs = orNull(tmp$ret$3);
|
|
588
588
|
var tmp_7 = tmp1_elvis_lhs == null ? 'new Path()' : tmp1_elvis_lhs;
|
|
589
|
-
var tmp_8 = 'Wirespec.Method.' + endpoint.
|
|
589
|
+
var tmp_8 = 'Wirespec.Method.' + endpoint.gt_1.b3_1;
|
|
590
590
|
// Inline function 'kotlin.let' call
|
|
591
|
-
var tmp$ret$5 = 'new Queries(' + joinToString(endpoint.
|
|
591
|
+
var tmp$ret$5 = 'new Queries(' + joinToString(endpoint.it_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_3($this)) + ')';
|
|
592
592
|
var tmp2_elvis_lhs = orNull(tmp$ret$5);
|
|
593
593
|
var tmp_9 = tmp2_elvis_lhs == null ? 'new Queries()' : tmp2_elvis_lhs;
|
|
594
594
|
// Inline function 'kotlin.let' call
|
|
595
|
-
var tmp$ret$7 = 'new RequestHeaders(' + joinToString(endpoint.
|
|
595
|
+
var tmp$ret$7 = 'new RequestHeaders(' + joinToString(endpoint.jt_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_4($this)) + ')';
|
|
596
596
|
var tmp3_elvis_lhs = orNull(tmp$ret$7);
|
|
597
597
|
var tmp_10 = tmp3_elvis_lhs == null ? 'new RequestHeaders()' : tmp3_elvis_lhs;
|
|
598
598
|
var tmp_11;
|
|
599
|
-
if (_this__u8e3s4.
|
|
599
|
+
if (_this__u8e3s4.ot_1 == null) {
|
|
600
600
|
tmp_11 = null;
|
|
601
601
|
} else {
|
|
602
602
|
// Inline function 'kotlin.let' call
|
|
603
603
|
tmp_11 = 'body';
|
|
604
604
|
}
|
|
605
605
|
var tmp5_elvis_lhs = tmp_11;
|
|
606
|
-
return 'public Request(' + tmp_4 + ') {\n' + tmp_5 + 'this(' + joinToString(listOfNotNull([tmp_7, tmp_8, tmp_9, tmp_10, tmp5_elvis_lhs == null ? 'null' : tmp5_elvis_lhs])) + ');\n' + Spacer_instance.
|
|
606
|
+
return 'public Request(' + tmp_4 + ') {\n' + tmp_5 + 'this(' + joinToString(listOfNotNull([tmp_7, tmp_8, tmp_9, tmp_10, tmp5_elvis_lhs == null ? 'null' : tmp5_elvis_lhs])) + ');\n' + Spacer_instance.sv(2) + '}';
|
|
607
607
|
}
|
|
608
608
|
function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
609
609
|
var tmp = get_indexedPathParams(endpoint);
|
|
610
610
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
|
|
611
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
612
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
613
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
611
|
+
var tmp_1 = orNull(joinToString(endpoint.it_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
612
|
+
var tmp_2 = orNull(joinToString(endpoint.jt_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
613
|
+
var tmp0_safe_receiver = _this__u8e3s4.ot_1;
|
|
614
614
|
var tmp_3;
|
|
615
615
|
if (tmp0_safe_receiver == null) {
|
|
616
616
|
tmp_3 = null;
|
|
617
617
|
} else {
|
|
618
618
|
// Inline function 'kotlin.let' call
|
|
619
|
-
tmp_3 = Spacer_instance.
|
|
619
|
+
tmp_3 = Spacer_instance.sv(4) + 'request.body().<' + emit_16($this, tmp0_safe_receiver) + '>map(body -> serialization.deserializeBody(body, ' + emitGetType($this, tmp0_safe_receiver.qt_1) + ')).orElse(null)';
|
|
620
620
|
}
|
|
621
621
|
// Inline function 'kotlin.let' call
|
|
622
622
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
623
|
-
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.
|
|
623
|
+
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.sv(3);
|
|
624
624
|
}
|
|
625
625
|
function emitDeserializedParams_0($this, _this__u8e3s4) {
|
|
626
|
-
var tmp = orNull(joinToString(_this__u8e3s4.
|
|
627
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
626
|
+
var tmp = orNull(joinToString(_this__u8e3s4.st_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2($this)));
|
|
627
|
+
var tmp0_safe_receiver = _this__u8e3s4.tt_1;
|
|
628
628
|
var tmp_0;
|
|
629
629
|
if (tmp0_safe_receiver == null) {
|
|
630
630
|
tmp_0 = null;
|
|
631
631
|
} else {
|
|
632
632
|
// Inline function 'kotlin.let' call
|
|
633
|
-
tmp_0 = Spacer_instance.
|
|
633
|
+
tmp_0 = Spacer_instance.sv(5) + 'response.body().<' + emit_16($this, tmp0_safe_receiver) + '>map(body -> serialization.deserializeBody(body, ' + emitGetType($this, tmp0_safe_receiver.qt_1) + ')).orElse(null)';
|
|
634
634
|
}
|
|
635
635
|
// Inline function 'kotlin.let' call
|
|
636
636
|
var it = joinToString(listOfNotNull([tmp, tmp_0]), ',\n');
|
|
637
|
-
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.
|
|
637
|
+
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.sv(4);
|
|
638
638
|
}
|
|
639
639
|
function emitSerialized($this, _this__u8e3s4) {
|
|
640
640
|
var tmp;
|
|
641
|
-
if (!(_this__u8e3s4.
|
|
642
|
-
tmp = 'java.util.Optional.ofNullable(serialization.serializeBody(r.body, ' + emitGetType($this, ensureNotNull(_this__u8e3s4.
|
|
641
|
+
if (!(_this__u8e3s4.tt_1 == null)) {
|
|
642
|
+
tmp = 'java.util.Optional.ofNullable(serialization.serializeBody(r.body, ' + emitGetType($this, ensureNotNull(_this__u8e3s4.tt_1).qt_1) + '))';
|
|
643
643
|
} else {
|
|
644
644
|
tmp = 'java.util.Optional.empty()';
|
|
645
645
|
}
|
|
646
646
|
var body = tmp;
|
|
647
647
|
var tmp_0;
|
|
648
648
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
649
|
-
if (!_this__u8e3s4.
|
|
650
|
-
tmp_0 = 'java.util.Map.ofEntries(' + joinToString(_this__u8e3s4.
|
|
649
|
+
if (!_this__u8e3s4.st_1.r()) {
|
|
650
|
+
tmp_0 = 'java.util.Map.ofEntries(' + joinToString(_this__u8e3s4.st_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitSerialized$lambda($this)) + ')';
|
|
651
651
|
} else {
|
|
652
652
|
tmp_0 = 'java.util.Collections.emptyMap()';
|
|
653
653
|
}
|
|
654
654
|
var headers = tmp_0;
|
|
655
|
-
return Spacer_instance.
|
|
655
|
+
return Spacer_instance.sv(3) + 'if (response instanceof Response' + Companion_instance_1.pu(_this__u8e3s4.rt_1) + ' r) { return new Wirespec.RawResponse(r.status(), ' + headers + ', ' + body + '); }';
|
|
656
656
|
}
|
|
657
657
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
658
|
-
return Spacer_instance.
|
|
658
|
+
return Spacer_instance.sv(4) + 'case ' + _this__u8e3s4.rt_1 + ' -> new Response' + Companion_instance_1.pu(_this__u8e3s4.rt_1) + '(' + emitDeserializedParams_0($this, _this__u8e3s4) + ');';
|
|
659
659
|
}
|
|
660
660
|
function emitSerializedParams($this, _this__u8e3s4, fields) {
|
|
661
|
-
return 'java.util.Map.entry("' + _this__u8e3s4.
|
|
661
|
+
return 'java.util.Map.entry("' + _this__u8e3s4.bt_1.m1() + '", serialization.serializeParam(request.' + (fields === 'queries' ? 'queries' : 'headers') + '().' + $this.yu(_this__u8e3s4.bt_1) + '(), ' + emitGetType($this, _this__u8e3s4.ct_1) + '))';
|
|
662
662
|
}
|
|
663
663
|
function emitDeserialized_0($this, _this__u8e3s4) {
|
|
664
|
-
return Spacer_instance.
|
|
664
|
+
return Spacer_instance.sv(4) + 'serialization.deserializePath(request.path().get(' + _this__u8e3s4.kf_1 + '), ' + emitGetType($this, _this__u8e3s4.lf_1.nt_1) + ')';
|
|
665
665
|
}
|
|
666
666
|
function emitDeserializedParams_1($this, _this__u8e3s4, fields, caseSensitive) {
|
|
667
667
|
var tmp;
|
|
668
668
|
if (caseSensitive) {
|
|
669
|
-
tmp = 'request.' + fields + '().getOrDefault("' + _this__u8e3s4.
|
|
669
|
+
tmp = 'request.' + fields + '().getOrDefault("' + _this__u8e3s4.bt_1.m1() + '", java.util.Collections.emptyList())';
|
|
670
670
|
} else {
|
|
671
|
-
tmp = 'request.' + fields + '().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + _this__u8e3s4.
|
|
671
|
+
tmp = 'request.' + fields + '().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + _this__u8e3s4.bt_1.m1() + '")).findFirst().map(java.util.Map.Entry::getValue).orElse(java.util.Collections.emptyList())';
|
|
672
672
|
}
|
|
673
673
|
var valuesFromField = tmp;
|
|
674
|
-
return Spacer_instance.
|
|
674
|
+
return Spacer_instance.sv(4) + 'serialization.<' + $this.yt(_this__u8e3s4.ct_1) + '>deserializeParam(' + valuesFromField + ', ' + emitGetType($this, _this__u8e3s4.ct_1) + ')';
|
|
675
675
|
}
|
|
676
676
|
function emitSerializedHeader($this, _this__u8e3s4) {
|
|
677
|
-
return 'java.util.Map.entry("' + _this__u8e3s4.
|
|
677
|
+
return 'java.util.Map.entry("' + _this__u8e3s4.bt_1.m1() + '", serialization.<' + $this.yt(_this__u8e3s4.ct_1) + '>serializeParam(r.headers().' + $this.yu(_this__u8e3s4.bt_1) + '(), ' + emitGetType($this, _this__u8e3s4.ct_1) + '))';
|
|
678
678
|
}
|
|
679
679
|
function emitIdentifier($this, _this__u8e3s4) {
|
|
680
|
-
return 'serialization.serializePath(request.path().' + Companion_instance_1.
|
|
680
|
+
return 'serialization.serializePath(request.path().' + Companion_instance_1.qu($this.yu(_this__u8e3s4.mt_1)) + '(), ' + emitGetType($this, _this__u8e3s4.nt_1) + ')';
|
|
681
681
|
}
|
|
682
682
|
function emit_16($this, _this__u8e3s4) {
|
|
683
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
684
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
683
|
+
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.qt_1;
|
|
684
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.yt(tmp1_safe_receiver);
|
|
685
685
|
return tmp2_elvis_lhs == null ? 'Void' : tmp2_elvis_lhs;
|
|
686
686
|
}
|
|
687
687
|
function emit_17($this, _this__u8e3s4) {
|
|
688
|
-
return $this.
|
|
688
|
+
return $this.yt(_this__u8e3s4.nt_1) + ' ' + $this.yu(_this__u8e3s4.mt_1);
|
|
689
689
|
}
|
|
690
690
|
function emitImports_0($this, _this__u8e3s4) {
|
|
691
691
|
// Inline function 'kotlin.collections.filter' call
|
|
@@ -695,8 +695,8 @@ function emitImports_0($this, _this__u8e3s4) {
|
|
|
695
695
|
var _iterator__ex2g4s = tmp0.t();
|
|
696
696
|
while (_iterator__ex2g4s.u()) {
|
|
697
697
|
var element = _iterator__ex2g4s.v();
|
|
698
|
-
if (!(_this__u8e3s4.
|
|
699
|
-
destination.
|
|
698
|
+
if (!(_this__u8e3s4.xu().m1() === element.my_1)) {
|
|
699
|
+
destination.y(element);
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
702
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -705,46 +705,46 @@ 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.
|
|
709
|
-
destination_0.
|
|
708
|
+
var tmp$ret$3 = 'import ' + $this.j20().ov_1 + '.model.' + item.my_1 + ';';
|
|
709
|
+
destination_0.y(tmp$ret$3);
|
|
710
710
|
}
|
|
711
711
|
var tmp = destination_0;
|
|
712
712
|
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitImports$lambda);
|
|
713
713
|
}
|
|
714
714
|
function emitRequestFunctions($this, _this__u8e3s4, endpoint) {
|
|
715
|
-
var tmp = Spacer_instance.
|
|
716
|
-
var tmp_0 = Spacer_instance.
|
|
717
|
-
var tmp_1 = Spacer_instance.
|
|
718
|
-
var tmp_2 = Spacer_instance.
|
|
719
|
-
var tmp_3 = joinToString(endpoint.
|
|
720
|
-
var tmp_4 = Spacer_instance.
|
|
715
|
+
var tmp = Spacer_instance.sv(2);
|
|
716
|
+
var tmp_0 = Spacer_instance.sv(3);
|
|
717
|
+
var tmp_1 = Spacer_instance.sv(4);
|
|
718
|
+
var tmp_2 = Spacer_instance.sv(4);
|
|
719
|
+
var tmp_3 = joinToString(endpoint.ht_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda($this));
|
|
720
|
+
var tmp_4 = Spacer_instance.sv(4);
|
|
721
721
|
var tmp_5;
|
|
722
722
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
723
|
-
if (!endpoint.
|
|
724
|
-
tmp_5 = 'java.util.Map.ofEntries(' + joinToString(endpoint.
|
|
723
|
+
if (!endpoint.it_1.r()) {
|
|
724
|
+
tmp_5 = 'java.util.Map.ofEntries(' + joinToString(endpoint.it_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_0($this)) + ')';
|
|
725
725
|
} else {
|
|
726
726
|
tmp_5 = 'java.util.Collections.emptyMap()';
|
|
727
727
|
}
|
|
728
728
|
var tmp_6 = tmp_5;
|
|
729
|
-
var tmp_7 = Spacer_instance.
|
|
729
|
+
var tmp_7 = Spacer_instance.sv(4);
|
|
730
730
|
var tmp_8;
|
|
731
731
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
732
|
-
if (!endpoint.
|
|
733
|
-
tmp_8 = 'java.util.Map.ofEntries(' + joinToString(endpoint.
|
|
732
|
+
if (!endpoint.jt_1.r()) {
|
|
733
|
+
tmp_8 = 'java.util.Map.ofEntries(' + joinToString(endpoint.jt_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1($this)) + ')';
|
|
734
734
|
} else {
|
|
735
735
|
tmp_8 = 'java.util.Collections.emptyMap()';
|
|
736
736
|
}
|
|
737
737
|
var tmp_9 = tmp_8;
|
|
738
|
-
var tmp_10 = Spacer_instance.
|
|
738
|
+
var tmp_10 = Spacer_instance.sv(4);
|
|
739
739
|
var tmp_11;
|
|
740
|
-
if (!(_this__u8e3s4.
|
|
741
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
742
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
740
|
+
if (!(_this__u8e3s4.ot_1 == null)) {
|
|
741
|
+
var tmp0_safe_receiver = _this__u8e3s4.ot_1;
|
|
742
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.qt_1;
|
|
743
743
|
tmp_11 = 'java.util.Optional.ofNullable(serialization.serializeBody(request.body(), ' + (tmp1_safe_receiver == null ? null : emitGetType($this, tmp1_safe_receiver)) + '))';
|
|
744
744
|
} else {
|
|
745
745
|
tmp_11 = 'java.util.Optional.empty()';
|
|
746
746
|
}
|
|
747
|
-
return trimMargin('\n |' + tmp + 'static Wirespec.RawRequest toRequest(Wirespec.Serializer serialization, Request request) {\n |' + tmp_0 + 'return new Wirespec.RawRequest(\n |' + tmp_1 + 'request.method().name(),\n |' + tmp_2 + 'java.util.List.of(' + tmp_3 + '),\n |' + tmp_4 + tmp_6 + ',\n |' + tmp_7 + tmp_9 + ',\n |' + tmp_10 + tmp_11 + '\n |' + Spacer_instance.
|
|
747
|
+
return trimMargin('\n |' + tmp + 'static Wirespec.RawRequest toRequest(Wirespec.Serializer serialization, Request request) {\n |' + tmp_0 + 'return new Wirespec.RawRequest(\n |' + tmp_1 + 'request.method().name(),\n |' + tmp_2 + 'java.util.List.of(' + tmp_3 + '),\n |' + tmp_4 + tmp_6 + ',\n |' + tmp_7 + tmp_9 + ',\n |' + tmp_10 + tmp_11 + '\n |' + Spacer_instance.sv(3) + ');\n |' + Spacer_instance.sv(2) + '}\n |\n |' + Spacer_instance.sv(2) + 'static Request fromRequest(Wirespec.Deserializer serialization, Wirespec.RawRequest request) {\n |' + Spacer_instance.sv(3) + 'return new Request(' + emitDeserializedParams($this, _this__u8e3s4, endpoint) + ');\n |' + Spacer_instance.sv(2) + '}\n ');
|
|
748
748
|
}
|
|
749
749
|
function emitObject($this, _this__u8e3s4, name, extends_0, block) {
|
|
750
750
|
var tmp;
|
|
@@ -758,54 +758,54 @@ function emitObject($this, _this__u8e3s4, name, extends_0, block) {
|
|
|
758
758
|
}
|
|
759
759
|
function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
760
760
|
// Inline function 'kotlin.collections.map' call
|
|
761
|
-
var this_0 = distinctByStatus(_this__u8e3s4.
|
|
761
|
+
var this_0 = distinctByStatus(_this__u8e3s4.lt_1);
|
|
762
762
|
// Inline function 'kotlin.collections.mapTo' call
|
|
763
763
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
764
764
|
var _iterator__ex2g4s = this_0.t();
|
|
765
765
|
while (_iterator__ex2g4s.u()) {
|
|
766
766
|
var item = _iterator__ex2g4s.v();
|
|
767
|
-
var tmp$ret$0 = emit_16($this, item.
|
|
768
|
-
destination.
|
|
767
|
+
var tmp$ret$0 = emit_16($this, item.tt_1);
|
|
768
|
+
destination.y(tmp$ret$0);
|
|
769
769
|
}
|
|
770
770
|
var tmp = distinct(destination);
|
|
771
771
|
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitResponseInterfaces$lambda);
|
|
772
772
|
}
|
|
773
773
|
function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
774
774
|
// Inline function 'kotlin.collections.map' call
|
|
775
|
-
var this_0 = _this__u8e3s4.
|
|
775
|
+
var this_0 = _this__u8e3s4.lt_1;
|
|
776
776
|
// Inline function 'kotlin.collections.mapTo' call
|
|
777
777
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
778
778
|
var _iterator__ex2g4s = this_0.t();
|
|
779
779
|
while (_iterator__ex2g4s.u()) {
|
|
780
780
|
var item = _iterator__ex2g4s.v();
|
|
781
|
-
var tmp$ret$0 = new Char(first(item.
|
|
782
|
-
destination.
|
|
781
|
+
var tmp$ret$0 = new Char(first(item.rt_1));
|
|
782
|
+
destination.y(tmp$ret$0);
|
|
783
783
|
}
|
|
784
784
|
var tmp = distinct(destination);
|
|
785
785
|
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitStatusInterfaces$lambda);
|
|
786
786
|
}
|
|
787
787
|
function emitFromResponse($this, _this__u8e3s4) {
|
|
788
788
|
// Inline function 'kotlin.collections.filter' call
|
|
789
|
-
var tmp0 = distinctByStatus(_this__u8e3s4.
|
|
789
|
+
var tmp0 = distinctByStatus(_this__u8e3s4.lt_1);
|
|
790
790
|
// Inline function 'kotlin.collections.filterTo' call
|
|
791
791
|
var destination = ArrayList_init_$Create$();
|
|
792
792
|
var _iterator__ex2g4s = tmp0.t();
|
|
793
793
|
while (_iterator__ex2g4s.u()) {
|
|
794
794
|
var element = _iterator__ex2g4s.v();
|
|
795
|
-
if (Companion_instance_1.
|
|
796
|
-
destination.
|
|
795
|
+
if (Companion_instance_1.tu(element.rt_1)) {
|
|
796
|
+
destination.y(element);
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
799
|
var statusResponses = destination;
|
|
800
800
|
var tmp;
|
|
801
801
|
if (statusResponses.r()) {
|
|
802
|
-
tmp = trimMargin('\n |' + Spacer_instance.
|
|
803
|
-
} else if (statusResponses.
|
|
802
|
+
tmp = trimMargin('\n |' + Spacer_instance.sv(3) + 'throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n ');
|
|
803
|
+
} else if (statusResponses.b1() === 1) {
|
|
804
804
|
var response = first_0(statusResponses);
|
|
805
|
-
tmp = trimMargin('\n |' + Spacer_instance.
|
|
805
|
+
tmp = trimMargin('\n |' + Spacer_instance.sv(3) + 'if (response.statusCode() == ' + response.rt_1 + ') {\n |' + Spacer_instance.sv(4) + 'return new Response' + Companion_instance_1.pu(response.rt_1) + '(' + emitDeserializedParams_0($this, response) + ');\n |' + Spacer_instance.sv(3) + '} else {\n |' + Spacer_instance.sv(4) + 'throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n |' + Spacer_instance.sv(3) + '}\n ');
|
|
806
806
|
} else {
|
|
807
|
-
var tmp_0 = Spacer_instance.
|
|
808
|
-
tmp = trimMargin('\n |' + tmp_0 + 'return switch (response.statusCode()) {\n |' + joinToString(statusResponses, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitFromResponse$lambda($this)) + '\n |' + Spacer_instance.
|
|
807
|
+
var tmp_0 = Spacer_instance.sv(3);
|
|
808
|
+
tmp = trimMargin('\n |' + tmp_0 + 'return switch (response.statusCode()) {\n |' + joinToString(statusResponses, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitFromResponse$lambda($this)) + '\n |' + Spacer_instance.sv(4) + 'default -> throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n |' + Spacer_instance.sv(3) + '};\n ');
|
|
809
809
|
}
|
|
810
810
|
return tmp;
|
|
811
811
|
}
|
|
@@ -816,17 +816,17 @@ function JavaEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
|
816
816
|
}
|
|
817
817
|
function JavaEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
818
818
|
return function (it) {
|
|
819
|
-
return this$0.
|
|
819
|
+
return this$0.xt(it);
|
|
820
820
|
};
|
|
821
821
|
}
|
|
822
822
|
function JavaEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
823
823
|
return function (it) {
|
|
824
|
-
return this$0.
|
|
824
|
+
return this$0.xt(it);
|
|
825
825
|
};
|
|
826
826
|
}
|
|
827
827
|
function JavaEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
828
828
|
return function (it) {
|
|
829
|
-
return this$0.
|
|
829
|
+
return this$0.x20(it);
|
|
830
830
|
};
|
|
831
831
|
}
|
|
832
832
|
function JavaEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
@@ -844,27 +844,27 @@ function JavaEndpointDefinitionEmitter$emitConstructor$lambda(this$0) {
|
|
|
844
844
|
}
|
|
845
845
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_0(this$0) {
|
|
846
846
|
return function (it) {
|
|
847
|
-
return this$0.
|
|
847
|
+
return this$0.xt(it);
|
|
848
848
|
};
|
|
849
849
|
}
|
|
850
850
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_1(this$0) {
|
|
851
851
|
return function (it) {
|
|
852
|
-
return this$0.
|
|
852
|
+
return this$0.xt(it);
|
|
853
853
|
};
|
|
854
854
|
}
|
|
855
855
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_2(this$0) {
|
|
856
856
|
return function (it) {
|
|
857
|
-
return this$0.
|
|
857
|
+
return this$0.yu(it.mt_1);
|
|
858
858
|
};
|
|
859
859
|
}
|
|
860
860
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_3(this$0) {
|
|
861
861
|
return function (it) {
|
|
862
|
-
return this$0.
|
|
862
|
+
return this$0.yu(it.bt_1);
|
|
863
863
|
};
|
|
864
864
|
}
|
|
865
865
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_4(this$0) {
|
|
866
866
|
return function (it) {
|
|
867
|
-
return this$0.
|
|
867
|
+
return this$0.yu(it.bt_1);
|
|
868
868
|
};
|
|
869
869
|
}
|
|
870
870
|
function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda(this$0) {
|
|
@@ -884,22 +884,22 @@ function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1(this$0) {
|
|
|
884
884
|
}
|
|
885
885
|
function JavaEndpointDefinitionEmitter$emit$lambda_5(this$0) {
|
|
886
886
|
return function (it) {
|
|
887
|
-
return this$0.
|
|
887
|
+
return this$0.xt(it);
|
|
888
888
|
};
|
|
889
889
|
}
|
|
890
890
|
function JavaEndpointDefinitionEmitter$emit$lambda_6(this$0) {
|
|
891
891
|
return function (it) {
|
|
892
|
-
return this$0.
|
|
892
|
+
return this$0.yu(it.bt_1);
|
|
893
893
|
};
|
|
894
894
|
}
|
|
895
895
|
function JavaEndpointDefinitionEmitter$emit$lambda_7(this$0) {
|
|
896
896
|
return function (it) {
|
|
897
|
-
return this$0.
|
|
897
|
+
return this$0.xt(it);
|
|
898
898
|
};
|
|
899
899
|
}
|
|
900
900
|
function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2(this$0) {
|
|
901
901
|
return function (it) {
|
|
902
|
-
return Spacer_instance.
|
|
902
|
+
return Spacer_instance.sv(5) + 'serialization.<' + this$0.yt(it.ct_1) + '>deserializeParam(response.headers().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + it.bt_1.m1() + '")).findFirst().map(java.util.Map.Entry::getValue).orElse(java.util.Collections.emptyList()), ' + emitGetType(this$0, it.ct_1) + ')';
|
|
903
903
|
};
|
|
904
904
|
}
|
|
905
905
|
function JavaEndpointDefinitionEmitter$emitSerialized$lambda(this$0) {
|
|
@@ -915,7 +915,7 @@ function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda(this$0) {
|
|
|
915
915
|
return function (it) {
|
|
916
916
|
var tmp;
|
|
917
917
|
if (it instanceof Literal) {
|
|
918
|
-
tmp = '"' + it.
|
|
918
|
+
tmp = '"' + it.iu_1 + '"';
|
|
919
919
|
} else {
|
|
920
920
|
if (it instanceof Param) {
|
|
921
921
|
tmp = emitIdentifier(this$0, it);
|
|
@@ -938,14 +938,14 @@ function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1(this$0) {
|
|
|
938
938
|
}
|
|
939
939
|
function JavaEndpointDefinitionEmitter$emitObject$lambda($block) {
|
|
940
940
|
return function (it) {
|
|
941
|
-
return Spacer_instance.
|
|
941
|
+
return Spacer_instance.sv(2) + $block(it);
|
|
942
942
|
};
|
|
943
943
|
}
|
|
944
944
|
function JavaEndpointDefinitionEmitter$emitResponseInterfaces$lambda(it) {
|
|
945
945
|
return Spacer_instance.toString() + 'sealed interface Response' + concatGenerics(it) + ' extends Response<' + it + '> {}';
|
|
946
946
|
}
|
|
947
947
|
function JavaEndpointDefinitionEmitter$emitStatusInterfaces$lambda(it) {
|
|
948
|
-
return Spacer_instance.toString() + 'sealed interface Response' + toString_0(it.
|
|
948
|
+
return Spacer_instance.toString() + 'sealed interface Response' + toString_0(it.i1_1) + 'XX<T> extends Response<T> {}';
|
|
949
949
|
}
|
|
950
950
|
function JavaEndpointDefinitionEmitter$emitFromResponse$lambda(this$0) {
|
|
951
951
|
return function (it) {
|
|
@@ -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.z20($this.y20(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.b21_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() {
|
|
@@ -978,7 +978,7 @@ function Companion_getInstance_0() {
|
|
|
978
978
|
return Companion_instance_2;
|
|
979
979
|
}
|
|
980
980
|
function JavaIdentifierEmitter$sanitizeSymbol$lambda(it) {
|
|
981
|
-
return isLetterOrDigit(it.
|
|
981
|
+
return isLetterOrDigit(it.i1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).v1(it);
|
|
982
982
|
}
|
|
983
983
|
function JavaIdentifierEmitter() {
|
|
984
984
|
}
|
|
@@ -993,8 +993,8 @@ function sanitizeSymbol_0($this, _this__u8e3s4) {
|
|
|
993
993
|
var item = _iterator__ex2g4s.v();
|
|
994
994
|
var _unary__edvuaz = index;
|
|
995
995
|
index = _unary__edvuaz + 1 | 0;
|
|
996
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
997
|
-
destination.
|
|
996
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.pu(item) : item;
|
|
997
|
+
destination.y(tmp$ret$0);
|
|
998
998
|
}
|
|
999
999
|
// Inline function 'kotlin.text.filter' call
|
|
1000
1000
|
var tmp0 = joinToString(destination, '');
|
|
@@ -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().c21_1.v1(_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.c21_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.a1l_1.b1() > 1 ? new Name(listOf(name.f1q())) : name;
|
|
1056
1056
|
}
|
|
1057
1057
|
function JavaIrEmitter$sanitizationConfig$lambda_1(name) {
|
|
1058
|
-
return new Name(listOf(name.
|
|
1058
|
+
return new Name(listOf(name.f1q()));
|
|
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.p1q_1.y1m() === 'validate';
|
|
1070
1070
|
} else {
|
|
1071
1071
|
tmp_0 = false;
|
|
1072
1072
|
}
|
|
1073
1073
|
if (tmp_0) {
|
|
1074
|
-
tmp = transformChildren(stmt.
|
|
1074
|
+
tmp = transformChildren(stmt.t1q(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.y1m()) {
|
|
1082
1082
|
case 'client':
|
|
1083
|
-
return Companion_getInstance().
|
|
1083
|
+
return Companion_getInstance().c1l('getClient');
|
|
1084
1084
|
case 'server':
|
|
1085
|
-
return Companion_getInstance().
|
|
1085
|
+
return Companion_getInstance().c1l('getServer');
|
|
1086
1086
|
default:
|
|
1087
1087
|
return null;
|
|
1088
1088
|
}
|
|
@@ -1092,22 +1092,22 @@ 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.l1r_1;
|
|
1096
1096
|
var first = ArrayList_init_$Create$();
|
|
1097
1097
|
var second = ArrayList_init_$Create$();
|
|
1098
1098
|
var _iterator__ex2g4s = this_0.t();
|
|
1099
1099
|
while (_iterator__ex2g4s.u()) {
|
|
1100
1100
|
var element_0 = _iterator__ex2g4s.v();
|
|
1101
1101
|
if (element_0 instanceof Package) {
|
|
1102
|
-
first.
|
|
1102
|
+
first.y(element_0);
|
|
1103
1103
|
} else {
|
|
1104
|
-
second.
|
|
1104
|
+
second.y(element_0);
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
1107
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1108
|
-
var packageElements = _destruct__k2r9zo.
|
|
1109
|
-
var rest = _destruct__k2r9zo.
|
|
1110
|
-
tmp = element.
|
|
1108
|
+
var packageElements = _destruct__k2r9zo.mf();
|
|
1109
|
+
var rest = _destruct__k2r9zo.nf();
|
|
1110
|
+
tmp = element.o1r(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.q1r_1.equals(Companion_getInstance().c1l('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.m1r(), 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.j20().ov_1 + '.model', it);
|
|
1152
1152
|
};
|
|
1153
1153
|
}
|
|
1154
1154
|
function JavaIrEmitter$emit$lambda(this$0) {
|
|
@@ -1160,38 +1160,38 @@ 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.q1l(String_instance);
|
|
1164
|
+
$this$function.r1l(new VariableReference(Companion_getInstance().c1l('label')));
|
|
1165
1165
|
return Unit_instance;
|
|
1166
1166
|
}
|
|
1167
1167
|
function JavaIrEmitter(packageName, emitShared) {
|
|
1168
1168
|
Companion_getInstance_1();
|
|
1169
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
1170
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
1171
|
-
this.
|
|
1172
|
-
this.
|
|
1173
|
-
this.
|
|
1174
|
-
this.
|
|
1175
|
-
this.
|
|
1169
|
+
packageName = packageName === VOID ? Companion_instance.nv('community.flock.wirespec.generated') : packageName;
|
|
1170
|
+
emitShared = emitShared === VOID ? Companion_instance_0.hs() : emitShared;
|
|
1171
|
+
this.d21_1 = packageName;
|
|
1172
|
+
this.e21_1 = emitShared;
|
|
1173
|
+
this.f21_1 = JavaGenerator_getInstance();
|
|
1174
|
+
this.g21_1 = FileExtension_Java_getInstance();
|
|
1175
|
+
this.h21_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().c21_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.i21_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).j20 = function () {
|
|
1185
|
+
return this.d21_1;
|
|
1186
1186
|
};
|
|
1187
|
-
protoOf(JavaIrEmitter).
|
|
1188
|
-
return this.
|
|
1187
|
+
protoOf(JavaIrEmitter).i1z = function () {
|
|
1188
|
+
return this.f21_1;
|
|
1189
1189
|
};
|
|
1190
|
-
protoOf(JavaIrEmitter).
|
|
1191
|
-
return this.
|
|
1190
|
+
protoOf(JavaIrEmitter).fu = function () {
|
|
1191
|
+
return this.g21_1;
|
|
1192
1192
|
};
|
|
1193
|
-
protoOf(JavaIrEmitter).
|
|
1194
|
-
var packageName = Companion_instance.
|
|
1193
|
+
protoOf(JavaIrEmitter).m1z = function () {
|
|
1194
|
+
var packageName = Companion_instance.nv('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
|
|
1197
1197
|
var this_0 = convertClientServer(packageName);
|
|
@@ -1201,7 +1201,7 @@ protoOf(JavaIrEmitter).b1w = function () {
|
|
|
1201
1201
|
while (_iterator__ex2g4s.u()) {
|
|
1202
1202
|
var item = _iterator__ex2g4s.v();
|
|
1203
1203
|
var tmp$ret$0 = toGetterAccessors(item, JavaIrEmitter$emitShared$lambda);
|
|
1204
|
-
destination.
|
|
1204
|
+
destination.y(tmp$ret$0);
|
|
1205
1205
|
}
|
|
1206
1206
|
var clientServer = plus_2(destination, raw('public static Type getType(final Class<?> actualTypeArguments, final Class<?> rawType) {\n if(rawType != null) {\n return new ParameterizedType() {\n public Type getRawType() { return rawType; }\n public Type[] getActualTypeArguments() { return new Class<?>[]{actualTypeArguments}; }\n public Type getOwnerType() { return null; }\n };\n }\n else { return actualTypeArguments; }\n}'));
|
|
1207
1207
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -1210,49 +1210,49 @@ protoOf(JavaIrEmitter).b1w = 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.v1y_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.m1m(JavaIrEmitter$emitShared$lambda_0(imports));
|
|
1218
|
+
var tmp$ret$5 = this_3.n1m();
|
|
1219
|
+
tmp.v1y_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.v1y_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.m1m(JavaIrEmitter$emitShared$lambda_1(clientServer));
|
|
1229
|
+
var tmp$ret$10 = this_5.n1m();
|
|
1230
|
+
tmp_0.v1y_1 = transform(this_4, tmp$ret$10);
|
|
1231
|
+
var tmp_1 = scope.v1y_1;
|
|
1232
1232
|
var wirespecShared = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1233
1233
|
var tmp_2;
|
|
1234
|
-
if (this.
|
|
1234
|
+
if (this.e21_1.is_1) {
|
|
1235
1235
|
tmp_2 = wirespecShared;
|
|
1236
1236
|
} else {
|
|
1237
1237
|
tmp_2 = null;
|
|
1238
1238
|
}
|
|
1239
1239
|
return tmp_2;
|
|
1240
1240
|
};
|
|
1241
|
-
protoOf(JavaIrEmitter).
|
|
1241
|
+
protoOf(JavaIrEmitter).wu = 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.o1r(Companion_getInstance().c1l(sanitizeSymbol_0(this, file.k1r_1.d1l())));
|
|
1244
1244
|
// Inline function 'kotlin.takeIf' call
|
|
1245
|
-
var this_0 = this.
|
|
1245
|
+
var this_0 = this.h21_1;
|
|
1246
1246
|
var tmp_0;
|
|
1247
|
-
if (Companion_instance_1.
|
|
1247
|
+
if (Companion_instance_1.su(module_0)) {
|
|
1248
1248
|
tmp_0 = this_0;
|
|
1249
1249
|
} else {
|
|
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.j20(), definition);
|
|
1254
1254
|
};
|
|
1255
|
-
protoOf(JavaIrEmitter).
|
|
1255
|
+
protoOf(JavaIrEmitter).r1z = 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).g1w = function (definition, module_0) {
|
|
|
1272
1272
|
}
|
|
1273
1273
|
}
|
|
1274
1274
|
var generatorFile = tmp;
|
|
1275
|
-
var sanitized = sanitizeNames(generatorFile, this.
|
|
1276
|
-
var generatorOwnName = definition.
|
|
1275
|
+
var sanitized = sanitizeNames(generatorFile, this.i21_1);
|
|
1276
|
+
var generatorOwnName = definition.xu().m1() + '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.h21_1, modelImports)), this.j20(), 'generator');
|
|
1283
1283
|
};
|
|
1284
|
-
protoOf(JavaIrEmitter).
|
|
1285
|
-
return sanitizeNames(convertWithValidation(type, module_0), this.
|
|
1284
|
+
protoOf(JavaIrEmitter).vt = function (type, module_0) {
|
|
1285
|
+
return sanitizeNames(convertWithValidation(type, module_0), this.i21_1);
|
|
1286
1286
|
};
|
|
1287
|
-
protoOf(JavaIrEmitter).
|
|
1287
|
+
protoOf(JavaIrEmitter).kv = 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.i21_1);
|
|
1291
1291
|
};
|
|
1292
|
-
protoOf(JavaIrEmitter).
|
|
1293
|
-
return sanitizeNames(convert_1(union), this.
|
|
1292
|
+
protoOf(JavaIrEmitter).av = function (union) {
|
|
1293
|
+
return sanitizeNames(convert_1(union), this.i21_1);
|
|
1294
1294
|
};
|
|
1295
|
-
protoOf(JavaIrEmitter).
|
|
1296
|
-
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.
|
|
1295
|
+
protoOf(JavaIrEmitter).fv = function (refined) {
|
|
1296
|
+
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.i21_1);
|
|
1297
1297
|
};
|
|
1298
|
-
protoOf(JavaIrEmitter).
|
|
1299
|
-
var tmp = sanitizeNames(transformTypeDescriptors(injectApiField(injectHandleFunction(convert_3(endpoint), endpoint))), this.
|
|
1298
|
+
protoOf(JavaIrEmitter).lv = function (endpoint) {
|
|
1299
|
+
var tmp = sanitizeNames(transformTypeDescriptors(injectApiField(injectHandleFunction(convert_3(endpoint), endpoint))), this.i21_1);
|
|
1300
1300
|
// Inline function 'kotlin.takeIf' call
|
|
1301
|
-
var this_0 = buildModelImports(endpoint, this.
|
|
1301
|
+
var this_0 = buildModelImports(endpoint, this.j20());
|
|
1302
1302
|
var tmp_0;
|
|
1303
1303
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1304
1304
|
if (!this_0.r()) {
|
|
@@ -1309,25 +1309,25 @@ protoOf(JavaIrEmitter).as = function (endpoint) {
|
|
|
1309
1309
|
var tmp$ret$2 = tmp_0;
|
|
1310
1310
|
return prependImports(tmp, tmp$ret$2);
|
|
1311
1311
|
};
|
|
1312
|
-
protoOf(JavaIrEmitter).
|
|
1312
|
+
protoOf(JavaIrEmitter).zu = function (channel) {
|
|
1313
1313
|
var tmp;
|
|
1314
|
-
if (channel.
|
|
1315
|
-
tmp = this.
|
|
1314
|
+
if (channel.ns_1.m1() === channel.os_1.m1()) {
|
|
1315
|
+
tmp = this.j20().ov_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.i21_1), fullyQualifiedPrefix);
|
|
1321
1321
|
};
|
|
1322
|
-
protoOf(JavaIrEmitter).
|
|
1323
|
-
var imports = buildModelImports(endpoint, this.
|
|
1324
|
-
var endpointImport = import_0(this.
|
|
1325
|
-
var endpointName = endpoint.
|
|
1326
|
-
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.
|
|
1327
|
-
var subPackageName = plus_0(this.
|
|
1328
|
-
return new File(Companion_getInstance().
|
|
1322
|
+
protoOf(JavaIrEmitter).q1z = function (endpoint) {
|
|
1323
|
+
var imports = buildModelImports(endpoint, this.j20());
|
|
1324
|
+
var endpointImport = import_0(this.j20().ov_1 + '.endpoint', endpoint.ft_1.m1());
|
|
1325
|
+
var endpointName = endpoint.ft_1.m1();
|
|
1326
|
+
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.i21_1)), endpointName);
|
|
1327
|
+
var subPackageName = plus_0(this.j20(), 'client');
|
|
1328
|
+
return new File(Companion_getInstance().c1l(subPackageName.qv() + sanitizeSymbol_0(this, file.k1r_1.d1l())), plus_1(plus_1(plus_1(plus_1(listOf(new Package(subPackageName.ov_1)), this.h21_1), imports), listOf(endpointImport)), file.l1r_1));
|
|
1329
1329
|
};
|
|
1330
|
-
protoOf(JavaIrEmitter).
|
|
1330
|
+
protoOf(JavaIrEmitter).n1z = 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$();
|
|
@@ -1343,9 +1343,9 @@ protoOf(JavaIrEmitter).c1w = function (endpoints, logger) {
|
|
|
1343
1343
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1344
1344
|
while (_iterator__ex2g4s_0.u()) {
|
|
1345
1345
|
var e = _iterator__ex2g4s_0.v();
|
|
1346
|
-
var key = e.
|
|
1347
|
-
if (set.
|
|
1348
|
-
list_0.
|
|
1346
|
+
var key = e.my_1;
|
|
1347
|
+
if (set.y(key)) {
|
|
1348
|
+
list_0.y(e);
|
|
1349
1349
|
}
|
|
1350
1350
|
}
|
|
1351
1351
|
// Inline function 'kotlin.collections.filter' call
|
|
@@ -1370,7 +1370,7 @@ protoOf(JavaIrEmitter).c1w = function (endpoints, logger) {
|
|
|
1370
1370
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1371
1371
|
while (_iterator__ex2g4s_2.u()) {
|
|
1372
1372
|
var element_1 = _iterator__ex2g4s_2.v();
|
|
1373
|
-
if (element_1.
|
|
1373
|
+
if (element_1.ft_1.m1() === element_0.my_1) {
|
|
1374
1374
|
tmp$ret$5 = false;
|
|
1375
1375
|
break $l$block_0;
|
|
1376
1376
|
}
|
|
@@ -1378,7 +1378,7 @@ protoOf(JavaIrEmitter).c1w = function (endpoints, logger) {
|
|
|
1378
1378
|
tmp$ret$5 = true;
|
|
1379
1379
|
}
|
|
1380
1380
|
if (tmp$ret$5) {
|
|
1381
|
-
destination_0.
|
|
1381
|
+
destination_0.y(element_0);
|
|
1382
1382
|
}
|
|
1383
1383
|
}
|
|
1384
1384
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1387,8 +1387,8 @@ protoOf(JavaIrEmitter).c1w = 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.
|
|
1391
|
-
destination_1.
|
|
1390
|
+
var tmp$ret$10 = import_0(this.j20().ov_1 + '.model', item.my_1);
|
|
1391
|
+
destination_1.y(tmp$ret$10);
|
|
1392
1392
|
}
|
|
1393
1393
|
var imports = destination_1;
|
|
1394
1394
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1397,8 +1397,8 @@ protoOf(JavaIrEmitter).c1w = 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.
|
|
1401
|
-
destination_2.
|
|
1400
|
+
var tmp$ret$13 = import_0(this.j20().ov_1 + '.endpoint', item_0.ft_1.m1());
|
|
1401
|
+
destination_2.y(tmp$ret$13);
|
|
1402
1402
|
}
|
|
1403
1403
|
var endpointImports = destination_2;
|
|
1404
1404
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1407,19 +1407,19 @@ protoOf(JavaIrEmitter).c1w = 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.
|
|
1411
|
-
destination_3.
|
|
1410
|
+
var tmp$ret$16 = import_0(this.j20().ov_1 + '.client', item_1.ft_1.m1() + 'Client');
|
|
1411
|
+
destination_3.y(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.i21_1);
|
|
1416
|
+
return new File(Companion_getInstance().c1l(this.j20().qv() + sanitizeSymbol_0(this, file.k1r_1.d1l())), plus_1(plus_1(plus_1(listOf(new Package(this.j20().ov_1)), this.h21_1), allImports), file.l1r_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.e1z(transformTypeDescriptors$lambda);
|
|
1422
|
+
var tmp = scope.v1y_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.v1y_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.m1m(applyRefinedStructShape$lambda(refined));
|
|
1436
|
+
var tmp$ret$2 = this_1.n1m();
|
|
1437
|
+
tmp.v1y_1 = transform(this_0, tmp$ret$2);
|
|
1438
|
+
var tmp_0 = scope.v1y_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.v1y_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.m1m(injectApiField$lambda);
|
|
1453
|
+
var tmp$ret$2 = this_1.n1m();
|
|
1454
|
+
tmp.v1y_1 = transform(this_0, tmp$ret$2);
|
|
1455
|
+
var tmp_0 = scope.v1y_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.v1y_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.m1m(injectHandleFunction$lambda(handlersStruct));
|
|
1470
|
+
var tmp$ret$2 = this_1.n1m();
|
|
1471
|
+
tmp.v1y_1 = transform(this_0, tmp$ret$2);
|
|
1472
|
+
var tmp_0 = scope.v1y_1;
|
|
1473
1473
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1474
1474
|
}
|
|
1475
1475
|
function buildModelImports(_this__u8e3s4, packageName) {
|
|
@@ -1480,8 +1480,8 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1480
1480
|
var _iterator__ex2g4s = tmp0.t();
|
|
1481
1481
|
while (_iterator__ex2g4s.u()) {
|
|
1482
1482
|
var element = _iterator__ex2g4s.v();
|
|
1483
|
-
if (!(_this__u8e3s4.
|
|
1484
|
-
destination.
|
|
1483
|
+
if (!(_this__u8e3s4.xu().m1() === element.my_1)) {
|
|
1484
|
+
destination.y(element);
|
|
1485
1485
|
}
|
|
1486
1486
|
}
|
|
1487
1487
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1490,8 +1490,8 @@ 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.
|
|
1494
|
-
destination_0.
|
|
1493
|
+
var tmp$ret$3 = import_0(packageName.ov_1 + '.model', Companion_getInstance().c1l(item.my_1).d1l());
|
|
1494
|
+
destination_0.y(tmp$ret$3);
|
|
1495
1495
|
}
|
|
1496
1496
|
return destination_0;
|
|
1497
1497
|
}
|
|
@@ -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.v1y_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.m1m(applyFunctionalInterface$lambda(fullyQualifiedPrefix));
|
|
1509
|
+
var tmp$ret$2 = this_1.n1m();
|
|
1510
|
+
tmp.v1y_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.v1y_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.m1m(applyFunctionalInterface$lambda_0);
|
|
1519
|
+
var tmp$ret$7 = this_3.n1m();
|
|
1520
|
+
tmp_0.v1y_1 = transform(this_2, tmp$ret$7);
|
|
1521
|
+
var tmp_1 = scope.v1y_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.v1y_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.m1m(wrapAsyncReturnInThenApply$lambda(endpointName));
|
|
1535
|
+
var tmp$ret$2 = this_1.n1m();
|
|
1536
|
+
tmp.v1y_1 = transform(this_0, tmp$ret$2);
|
|
1537
|
+
var tmp_0 = scope.v1y_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.u1m_1);
|
|
1544
1544
|
} else {
|
|
1545
1545
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
1546
|
-
tmp = findRoot(_this__u8e3s4.
|
|
1546
|
+
tmp = findRoot(_this__u8e3s4.v1m_1);
|
|
1547
1547
|
} else {
|
|
1548
1548
|
if (_this__u8e3s4 instanceof Dict_0) {
|
|
1549
|
-
tmp = findRoot(_this__u8e3s4.
|
|
1549
|
+
tmp = findRoot(_this__u8e3s4.y1q_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.u1q_1.c3_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.v1q_1.c3_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.w1m_1.d1l();
|
|
1623
1623
|
} else {
|
|
1624
1624
|
tmp = 'Object';
|
|
1625
1625
|
}
|
|
@@ -1633,7 +1633,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1633
1633
|
return tmp;
|
|
1634
1634
|
}
|
|
1635
1635
|
function buildHandlersStruct(_this__u8e3s4) {
|
|
1636
|
-
var pathTemplate = '/' + joinToString(_this__u8e3s4.
|
|
1636
|
+
var pathTemplate = '/' + joinToString(_this__u8e3s4.ht_1, '/', VOID, VOID, VOID, VOID, buildHandlersStruct$lambda);
|
|
1637
1637
|
return struct('Handlers', buildHandlersStruct$lambda_0(pathTemplate, _this__u8e3s4));
|
|
1638
1638
|
}
|
|
1639
1639
|
function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
@@ -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.y1y(tmp_0, withFullyQualifiedPrefix$lambda_0(prefix));
|
|
1647
|
+
var tmp_1 = scope.v1y_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.a1t_1);
|
|
1658
|
+
var containerStr = rawContainerClass(stmt.a1t_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.q1l(convert_5($refined.ev_1));
|
|
1678
|
+
$this$function.r1l(new VariableReference(Companion_getInstance().c1l('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.z1r_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.a1p(VOID, VOID, VOID, VOID, VOID, VOID, VOID, true);
|
|
1696
1696
|
var tmp$ret$0 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
1697
|
-
destination.
|
|
1697
|
+
destination.y(tmp$ret$0);
|
|
1698
1698
|
}
|
|
1699
|
-
var tmp_1 = element.
|
|
1699
|
+
var tmp_1 = element.c1s(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.m1r(), 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.m1r(), 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.e1s_1.equals(Companion_getInstance().c1l('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.v1y_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.m1m(injectHandleFunction$lambda$lambda($handlersStruct));
|
|
1763
|
+
var tmp$ret$2 = this_1.n1m();
|
|
1764
|
+
tmp_1.v1y_1 = transform(this_0, tmp$ret$2);
|
|
1765
|
+
var tmp_2 = scope.v1y_1;
|
|
1766
1766
|
tmp_0 = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1767
1767
|
} else {
|
|
1768
1768
|
tmp_0 = element;
|
|
@@ -1792,19 +1792,19 @@ 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.m1r();
|
|
1796
1796
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1797
1797
|
var destination = ArrayList_init_$Create$();
|
|
1798
1798
|
var _iterator__ex2g4s = tmp0.t();
|
|
1799
1799
|
while (_iterator__ex2g4s.u()) {
|
|
1800
1800
|
var element_0 = _iterator__ex2g4s.v();
|
|
1801
1801
|
if (element_0 instanceof Interface) {
|
|
1802
|
-
destination.
|
|
1802
|
+
destination.y(element_0);
|
|
1803
1803
|
}
|
|
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.o1r(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.x1o_1 || element.w1o_1.b1() < 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.w1o_1.c1(element.w1o_1.b1() - 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.w1o_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.w1o_1, 2);
|
|
1840
|
+
var tmp1_name = Companion_getInstance().c1l('thenApply');
|
|
1841
|
+
var tmp2_receiver = transportAssign.d1t_1;
|
|
1842
|
+
var tmp3_arguments = mapOf(to(Companion_getInstance().c1l('mapper'), new RawExpression('rawResponse -> ' + $endpointName + '.fromRawResponse(serialization(), rawResponse)')));
|
|
1843
|
+
tmp$ret$0 = element.a1p(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 {
|
|
@@ -1853,10 +1853,10 @@ function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
|
1853
1853
|
function buildHandlersStruct$lambda(it) {
|
|
1854
1854
|
var tmp;
|
|
1855
1855
|
if (it instanceof Literal) {
|
|
1856
|
-
tmp = it.
|
|
1856
|
+
tmp = it.iu_1;
|
|
1857
1857
|
} else {
|
|
1858
1858
|
if (it instanceof Param) {
|
|
1859
|
-
tmp = '{' + it.
|
|
1859
|
+
tmp = '{' + it.mt_1.m1() + '}';
|
|
1860
1860
|
} else {
|
|
1861
1861
|
noWhenBranchMatchedException();
|
|
1862
1862
|
}
|
|
@@ -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.q1l(String_instance);
|
|
1869
|
+
$this$function.r1l($this$function.a1y($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.q1l(String_instance);
|
|
1876
|
+
$this$function.r1l($this$function.a1y($this_buildHandlersStruct.gt_1.b3_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.q1l($this$function.e1l('Wirespec.ServerEdge', [$this$function.e1l('Request', []), $this$function.e1l('Response', [Wildcard_instance])]));
|
|
1882
|
+
$this$function.n1l('serialization', $this$function.e1l('Wirespec.Serialization', []));
|
|
1883
|
+
$this$function.r1l(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.q1l($this$function.e1l('Wirespec.ClientEdge', [$this$function.e1l('Request', []), $this$function.e1l('Response', [Wildcard_instance])]));
|
|
1888
|
+
$this$function.n1l('serialization', $this$function.e1l('Wirespec.Serialization', []));
|
|
1889
|
+
$this$function.r1l(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.j1o($this$struct.e1l('Wirespec.Server', [$this$struct.e1l('Request', []), $this$struct.e1l('Response', [Wildcard_instance])]));
|
|
1895
|
+
$this$struct.j1o($this$struct.e1l('Wirespec.Client', [$this$struct.e1l('Request', []), $this$struct.e1l('Response', [Wildcard_instance])]));
|
|
1896
|
+
$this$struct.s1l('getPathTemplate', VOID, true, buildHandlersStruct$lambda$lambda($pathTemplate));
|
|
1897
|
+
$this$struct.s1l('getMethod', VOID, true, buildHandlersStruct$lambda$lambda_0($this_buildHandlersStruct));
|
|
1898
|
+
$this$struct.s1l('getServer', VOID, true, buildHandlersStruct$lambda$lambda_1);
|
|
1899
|
+
$this$struct.s1l('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.n1t_1.equals(Companion_getInstance().c1l('message'));
|
|
1905
1905
|
}
|
|
1906
1906
|
function withFullyQualifiedPrefix$lambda_0($prefix) {
|
|
1907
1907
|
return function (param) {
|
|
1908
|
-
var t = param.
|
|
1908
|
+
var t = param.o1t_1;
|
|
1909
1909
|
var tmp;
|
|
1910
1910
|
if (t instanceof Custom_0) {
|
|
1911
|
-
tmp = param.
|
|
1911
|
+
tmp = param.q1t(VOID, t.b1r(Companion_getInstance().c1l($prefix + t.w1m_1.d1l())));
|
|
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.t20_1 = 'community.flock.wirespec.java';
|
|
1923
|
+
this.u20_1 = trimMargin('\n |package ' + this.t20_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.sv(2) + 'Req from(RawRequest request);\n |' + Spacer_instance.sv(2) + 'RawResponse to(Res response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface ClientEdge<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.sv(2) + 'RawRequest to(Req request);\n |' + Spacer_instance.sv(2) + 'Res from(RawResponse response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.sv(2) + 'String getPathTemplate();\n |' + Spacer_instance.sv(2) + 'String getMethod();\n |' + Spacer_instance.sv(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.sv(2) + 'String getPathTemplate();\n |' + Spacer_instance.sv(2) + 'String getMethod();\n |' + Spacer_instance.sv(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.sv(2) + 'if(rawType != null) {\n |' + Spacer_instance.sv(3) + 'return new ParameterizedType() {\n |' + Spacer_instance.sv(4) + 'public Type getRawType() { return rawType; }\n |' + Spacer_instance.sv(4) + 'public Type[] getActualTypeArguments() { return new Class<?>[]{actualTypeArguments}; }\n |' + Spacer_instance.sv(4) + 'public Type getOwnerType() { return null; }\n |' + Spacer_instance.sv(3) + '};\n |' + Spacer_instance.sv(2) + '}\n |' + Spacer_instance.sv(2) + 'else { return actualTypeArguments; }\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
1924
1924
|
}
|
|
1925
1925
|
protoOf(JavaShared).toString = function () {
|
|
1926
1926
|
return 'JavaShared';
|
|
@@ -1944,10 +1944,10 @@ function JavaShared_getInstance() {
|
|
|
1944
1944
|
function emitType($this, _this__u8e3s4) {
|
|
1945
1945
|
var tmp;
|
|
1946
1946
|
if (_this__u8e3s4 instanceof Dict) {
|
|
1947
|
-
tmp = 'java.util.Map<String, ' + $this.
|
|
1947
|
+
tmp = 'java.util.Map<String, ' + $this.yt(_this__u8e3s4.ds_1) + '>';
|
|
1948
1948
|
} else {
|
|
1949
1949
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
1950
|
-
tmp = 'java.util.List<' + $this.
|
|
1950
|
+
tmp = 'java.util.List<' + $this.yt(_this__u8e3s4.as_1) + '>';
|
|
1951
1951
|
} else {
|
|
1952
1952
|
if (_this__u8e3s4 instanceof Unit) {
|
|
1953
1953
|
tmp = 'void';
|
|
@@ -1956,7 +1956,7 @@ function emitType($this, _this__u8e3s4) {
|
|
|
1956
1956
|
tmp = 'Object';
|
|
1957
1957
|
} else {
|
|
1958
1958
|
if (_this__u8e3s4 instanceof Custom) {
|
|
1959
|
-
tmp = _this__u8e3s4.
|
|
1959
|
+
tmp = _this__u8e3s4.my_1;
|
|
1960
1960
|
} else {
|
|
1961
1961
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
1962
1962
|
tmp = emit_18($this, _this__u8e3s4);
|
|
@@ -1971,14 +1971,14 @@ function emitType($this, _this__u8e3s4) {
|
|
|
1971
1971
|
return tmp;
|
|
1972
1972
|
}
|
|
1973
1973
|
function emit_18($this, _this__u8e3s4) {
|
|
1974
|
-
var t = _this__u8e3s4.
|
|
1974
|
+
var t = _this__u8e3s4.qy_1;
|
|
1975
1975
|
var tmp;
|
|
1976
1976
|
if (t instanceof String_0) {
|
|
1977
1977
|
tmp = 'String';
|
|
1978
1978
|
} else {
|
|
1979
1979
|
if (t instanceof Integer) {
|
|
1980
1980
|
var tmp_0;
|
|
1981
|
-
switch (t.
|
|
1981
|
+
switch (t.ux_1.c3_1) {
|
|
1982
1982
|
case 0:
|
|
1983
1983
|
tmp_0 = 'Integer';
|
|
1984
1984
|
break;
|
|
@@ -1993,7 +1993,7 @@ function emit_18($this, _this__u8e3s4) {
|
|
|
1993
1993
|
} else {
|
|
1994
1994
|
if (t instanceof Number_0) {
|
|
1995
1995
|
var tmp_1;
|
|
1996
|
-
switch (t.
|
|
1996
|
+
switch (t.xx_1.c3_1) {
|
|
1997
1997
|
case 0:
|
|
1998
1998
|
tmp_1 = 'Float';
|
|
1999
1999
|
break;
|
|
@@ -2022,46 +2022,46 @@ function emit_18($this, _this__u8e3s4) {
|
|
|
2022
2022
|
}
|
|
2023
2023
|
function JavaTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
2024
2024
|
return function (it) {
|
|
2025
|
-
return this$0.
|
|
2025
|
+
return this$0.yt(it);
|
|
2026
2026
|
};
|
|
2027
2027
|
}
|
|
2028
2028
|
function JavaTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2029
2029
|
return function (it) {
|
|
2030
|
-
return Spacer_instance.toString() + this$0.
|
|
2030
|
+
return Spacer_instance.toString() + this$0.xt(it) + ',';
|
|
2031
2031
|
};
|
|
2032
2032
|
}
|
|
2033
2033
|
function JavaTypeDefinitionEmitter() {
|
|
2034
2034
|
}
|
|
2035
2035
|
function JavaUnionDefinitionEmitter$emit$lambda(it) {
|
|
2036
|
-
return it.
|
|
2036
|
+
return it.m1();
|
|
2037
2037
|
}
|
|
2038
2038
|
function JavaUnionDefinitionEmitter() {
|
|
2039
2039
|
}
|
|
2040
2040
|
//region block: post-declaration
|
|
2041
|
-
protoOf(JavaEmitter).
|
|
2042
|
-
protoOf(JavaEmitter).
|
|
2043
|
-
protoOf(JavaEmitter).
|
|
2044
|
-
protoOf(JavaEmitter).
|
|
2045
|
-
protoOf(JavaEmitter).
|
|
2046
|
-
protoOf(JavaEmitter).
|
|
2047
|
-
protoOf(JavaEmitter).
|
|
2048
|
-
protoOf(JavaEmitter).
|
|
2049
|
-
protoOf(JavaEmitter).
|
|
2050
|
-
protoOf(JavaEmitter).
|
|
2051
|
-
protoOf(JavaEmitter).
|
|
2052
|
-
protoOf(JavaEmitter).
|
|
2053
|
-
protoOf(JavaEmitter).
|
|
2054
|
-
protoOf(JavaEmitter).
|
|
2055
|
-
protoOf(JavaEmitter).
|
|
2056
|
-
protoOf(JavaEmitter).
|
|
2057
|
-
protoOf(JavaEmitter).
|
|
2058
|
-
protoOf(JavaEmitter).
|
|
2059
|
-
protoOf(JavaEmitter).
|
|
2060
|
-
protoOf(JavaEmitter).
|
|
2061
|
-
protoOf(JavaIrEmitter).
|
|
2062
|
-
protoOf(JavaIrEmitter).
|
|
2063
|
-
protoOf(JavaIrEmitter).
|
|
2064
|
-
protoOf(JavaIrEmitter).
|
|
2041
|
+
protoOf(JavaEmitter).yu = emit_9;
|
|
2042
|
+
protoOf(JavaEmitter).vt = emit_3;
|
|
2043
|
+
protoOf(JavaEmitter).wt = emit_4;
|
|
2044
|
+
protoOf(JavaEmitter).xt = emit_5;
|
|
2045
|
+
protoOf(JavaEmitter).yt = emit_6;
|
|
2046
|
+
protoOf(JavaEmitter).zt = emit_7;
|
|
2047
|
+
protoOf(JavaEmitter).lv = emit_13;
|
|
2048
|
+
protoOf(JavaEmitter).w20 = emit_14;
|
|
2049
|
+
protoOf(JavaEmitter).x20 = emit_15;
|
|
2050
|
+
protoOf(JavaEmitter).zu = emit_8;
|
|
2051
|
+
protoOf(JavaEmitter).kv = emit_10;
|
|
2052
|
+
protoOf(JavaEmitter).av = emit_11;
|
|
2053
|
+
protoOf(JavaEmitter).fv = emit_12;
|
|
2054
|
+
protoOf(JavaEmitter).v20 = sanitizeSymbol;
|
|
2055
|
+
protoOf(JavaEmitter).y20 = sanitizeFirstIsDigit;
|
|
2056
|
+
protoOf(JavaEmitter).z20 = sanitizeKeywords;
|
|
2057
|
+
protoOf(JavaEmitter).l20 = emitRoot;
|
|
2058
|
+
protoOf(JavaEmitter).k20 = emitRoot$default;
|
|
2059
|
+
protoOf(JavaEmitter).a21 = emitHandleFunction;
|
|
2060
|
+
protoOf(JavaEmitter).mv = emitValidator;
|
|
2061
|
+
protoOf(JavaIrEmitter).k1z = get_extensions;
|
|
2062
|
+
protoOf(JavaIrEmitter).pr = emit_1;
|
|
2063
|
+
protoOf(JavaIrEmitter).l1z = emit_2;
|
|
2064
|
+
protoOf(JavaIrEmitter).p1z = beforeGenerate;
|
|
2065
2065
|
//endregion
|
|
2066
2066
|
//region block: exports
|
|
2067
2067
|
export {
|