@flock/wirespec 0.19.2 → 0.19.3-RC.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.mjs +12 -12
- package/arrow-arrow-core.mjs +167 -167
- package/clikt-clikt-mordant.mjs +81 -81
- package/clikt-clikt-mordant.mjs.map +1 -1
- package/clikt-clikt.mjs +1636 -1636
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +448 -448
- package/kotest-kotest-assertions-kotest-assertions-core.mjs +4 -0
- package/kotest-kotest-assertions-kotest-assertions-core.mjs.map +1 -0
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs +4 -0
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs.map +1 -0
- package/kotest-kotest-common.mjs +56 -0
- package/kotest-kotest-common.mjs.map +1 -0
- package/kotest-kotest-framework-kotest-framework-engine.mjs +4 -0
- package/kotest-kotest-framework-kotest-framework-engine.mjs.map +1 -0
- package/kotest-kotest-property.mjs +2501 -0
- package/kotest-kotest-property.mjs.map +1 -0
- package/kotlin-kotlin-stdlib.mjs +5269 -2487
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10266 -10266
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1846 -1846
- package/kotlin-rgxgen.mjs.map +1 -1
- package/kotlinx-coroutines-test.mjs +4 -0
- package/kotlinx-coroutines-test.mjs.map +1 -0
- package/kotlinx-io-kotlinx-io-core.mjs +455 -455
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +2132 -2098
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1579 -1579
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1435 -1435
- package/package.json +5 -1
- package/wirespec-generator.d.ts +51 -0
- package/wirespec-generator.mjs +9 -0
- package/wirespec-src-compiler-core.mjs +1597 -1597
- package/wirespec-src-compiler-emitters-java.mjs +451 -451
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +371 -371
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +456 -456
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +481 -481
- package/wirespec-src-compiler-emitters-scala.mjs +193 -193
- package/wirespec-src-compiler-emitters-typescript.mjs +526 -526
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +85 -85
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3913 -3857
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +439 -439
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +521 -521
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +859 -859
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +1387 -1387
- package/wirespec-src-ide-lsp.mjs.map +1 -1
- package/wirespec-src-integration-kotest.mjs +1647 -0
- package/wirespec-src-integration-kotest.mjs.map +1 -0
- package/wirespec-src-plugin-arguments.mjs +192 -192
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +109 -109
- package/wirespec-src-plugin-npm.d.mts +21 -0
- package/wirespec-src-plugin-npm.mjs +43 -43
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +35 -35
- package/wirespec-src-tools-generator.mjs.map +1 -1
- package/xmlutil-core.mjs +4 -0
- package/xmlutil-core.mjs.map +1 -0
- package/xmlutil-serialization.mjs +4 -0
- package/xmlutil-serialization.mjs.map +1 -0
|
@@ -187,10 +187,10 @@ import {
|
|
|
187
187
|
//endregion
|
|
188
188
|
//region block: pre-declaration
|
|
189
189
|
function emit_3(type, module_0) {
|
|
190
|
-
var tmp = this.
|
|
191
|
-
var tmp_0 = this.
|
|
190
|
+
var tmp = this.yu(type.ws_1);
|
|
191
|
+
var tmp_0 = this.wt(type.xs_1);
|
|
192
192
|
// Inline function 'kotlin.run' call
|
|
193
|
-
var $this$run = type.
|
|
193
|
+
var $this$run = type.ys_1;
|
|
194
194
|
var tmp_1;
|
|
195
195
|
if ($this$run.r()) {
|
|
196
196
|
tmp_1 = '';
|
|
@@ -201,23 +201,23 @@ function emit_3(type, module_0) {
|
|
|
201
201
|
return trimMargin('\n |public record ' + tmp + ' (\n |' + tmp_0 + '\n |)' + tmp$ret$1 + ' {\n |};\n |\n ');
|
|
202
202
|
}
|
|
203
203
|
function emit_4(_this__u8e3s4) {
|
|
204
|
-
return dropLast_0(joinToString(_this__u8e3s4.
|
|
204
|
+
return dropLast_0(joinToString(_this__u8e3s4.ts_1, '\n', VOID, VOID, VOID, VOID, JavaTypeDefinitionEmitter$emit$lambda_0(this)), 1);
|
|
205
205
|
}
|
|
206
206
|
function emit_5(_this__u8e3s4) {
|
|
207
|
-
return this.
|
|
207
|
+
return this.yt(_this__u8e3s4.ct_1) + ' ' + this.yu(_this__u8e3s4.bt_1);
|
|
208
208
|
}
|
|
209
209
|
function emit_6(_this__u8e3s4) {
|
|
210
210
|
// Inline function 'kotlin.let' call
|
|
211
211
|
var it = emitType(this, _this__u8e3s4);
|
|
212
|
-
return _this__u8e3s4.
|
|
212
|
+
return _this__u8e3s4.ey() ? 'java.util.Optional<' + it + '>' : it;
|
|
213
213
|
}
|
|
214
214
|
function emitRoot(_this__u8e3s4, void_0) {
|
|
215
215
|
var tmp;
|
|
216
216
|
if (_this__u8e3s4 instanceof Dict) {
|
|
217
|
-
tmp = this.
|
|
217
|
+
tmp = this.e20(_this__u8e3s4.ds_1);
|
|
218
218
|
} else {
|
|
219
219
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
220
|
-
tmp = this.
|
|
220
|
+
tmp = this.e20(_this__u8e3s4.as_1);
|
|
221
221
|
} else {
|
|
222
222
|
if (_this__u8e3s4 instanceof Unit) {
|
|
223
223
|
tmp = void_0;
|
|
@@ -246,15 +246,15 @@ function emitRoot(_this__u8e3s4, void_0) {
|
|
|
246
246
|
}
|
|
247
247
|
function emitRoot$default(_this__u8e3s4, void_0, $super) {
|
|
248
248
|
void_0 = void_0 === VOID ? 'void' : void_0;
|
|
249
|
-
return $super === VOID ? this.
|
|
249
|
+
return $super === VOID ? this.f20(_this__u8e3s4, void_0) : emitRoot(_this__u8e3s4, void_0);
|
|
250
250
|
}
|
|
251
251
|
function emit_7(_this__u8e3s4) {
|
|
252
252
|
var tmp;
|
|
253
253
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
254
|
-
tmp = 'return java.util.regex.Pattern.compile("' + replace(this.
|
|
254
|
+
tmp = 'return java.util.regex.Pattern.compile("' + replace(this.au(_this__u8e3s4.ax_1), '\\', '\\\\') + '").matcher(value).find();';
|
|
255
255
|
} else {
|
|
256
256
|
if (_this__u8e3s4 instanceof Bound) {
|
|
257
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
257
|
+
var tmp1_safe_receiver = _this__u8e3s4.qx_1;
|
|
258
258
|
var tmp_0;
|
|
259
259
|
if (tmp1_safe_receiver == null) {
|
|
260
260
|
tmp_0 = null;
|
|
@@ -263,7 +263,7 @@ function emit_7(_this__u8e3s4) {
|
|
|
263
263
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
264
264
|
}
|
|
265
265
|
var minCheck = tmp_0;
|
|
266
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
266
|
+
var tmp2_safe_receiver = _this__u8e3s4.rx_1;
|
|
267
267
|
var tmp_1;
|
|
268
268
|
if (tmp2_safe_receiver == null) {
|
|
269
269
|
tmp_1 = null;
|
|
@@ -289,59 +289,59 @@ function emit_7(_this__u8e3s4) {
|
|
|
289
289
|
}
|
|
290
290
|
initMetadataForInterface(JavaTypeDefinitionEmitter, 'JavaTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter]);
|
|
291
291
|
function emit_8(channel) {
|
|
292
|
-
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |@FunctionalInterface\n |public interface ' + this.
|
|
292
|
+
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.e20(channel.os_1) + ' message);\n |}\n |\n ');
|
|
293
293
|
}
|
|
294
294
|
initMetadataForInterface(JavaChannelDefinitionEmitter, 'JavaChannelDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
295
295
|
function emit_9(endpoint) {
|
|
296
296
|
var tmp = emitImports_0(this, endpoint);
|
|
297
|
-
var tmp_0 = this.
|
|
297
|
+
var tmp_0 = this.yu(endpoint.ft_1);
|
|
298
298
|
var tmp_1 = get_pathParams(endpoint);
|
|
299
299
|
var tmp_2 = emitObject(this, tmp_1, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
|
|
300
|
-
var tmp_3 = emitObject(this, endpoint.
|
|
301
|
-
var tmp_4 = emitObject(this, endpoint.
|
|
302
|
-
var tmp_5 = this.
|
|
300
|
+
var tmp_3 = emitObject(this, endpoint.it_1, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
301
|
+
var tmp_4 = emitObject(this, endpoint.jt_1, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
302
|
+
var tmp_5 = this.q20(first_0(endpoint.kt_1), endpoint);
|
|
303
303
|
var tmp_6 = Spacer_instance.toString();
|
|
304
304
|
var tmp_7 = emitStatusInterfaces(this, endpoint);
|
|
305
305
|
var tmp_8 = emitResponseInterfaces(this, endpoint);
|
|
306
|
-
var tmp_9 = distinctByStatus(endpoint.
|
|
306
|
+
var tmp_9 = distinctByStatus(endpoint.lt_1);
|
|
307
307
|
var tmp_10 = joinToString(tmp_9, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
308
308
|
var tmp_11 = Spacer_instance.toString();
|
|
309
|
-
var tmp_12 = emitRequestFunctions(this, first_0(endpoint.
|
|
310
|
-
var tmp_13 = Spacer_instance.
|
|
311
|
-
var tmp_14 = distinctByStatus(endpoint.
|
|
309
|
+
var tmp_12 = emitRequestFunctions(this, first_0(endpoint.kt_1), endpoint);
|
|
310
|
+
var tmp_13 = Spacer_instance.sv(2);
|
|
311
|
+
var tmp_14 = distinctByStatus(endpoint.lt_1);
|
|
312
312
|
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
313
|
-
var tmp_16 = Spacer_instance.
|
|
314
|
-
var tmp_17 = Spacer_instance.
|
|
315
|
-
var tmp_18 = Spacer_instance.
|
|
313
|
+
var tmp_16 = Spacer_instance.sv(3);
|
|
314
|
+
var tmp_17 = Spacer_instance.sv(2);
|
|
315
|
+
var tmp_18 = Spacer_instance.sv(2);
|
|
316
316
|
var tmp_19 = emitFromResponse(this, endpoint);
|
|
317
|
-
var tmp_20 = Spacer_instance.
|
|
318
|
-
var tmp_21 = Spacer_instance.
|
|
319
|
-
var tmp_22 = this.
|
|
320
|
-
var tmp_23 = Spacer_instance.
|
|
321
|
-
var tmp_24 = Spacer_instance.
|
|
322
|
-
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.
|
|
317
|
+
var tmp_20 = Spacer_instance.sv(2);
|
|
318
|
+
var tmp_21 = Spacer_instance.sv(2);
|
|
319
|
+
var tmp_22 = this.u20(endpoint);
|
|
320
|
+
var tmp_23 = Spacer_instance.sv(2);
|
|
321
|
+
var tmp_24 = Spacer_instance.sv(3);
|
|
322
|
+
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 ');
|
|
323
323
|
}
|
|
324
324
|
function emitHandleFunction(endpoint) {
|
|
325
|
-
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.
|
|
325
|
+
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.qu(this.yu(endpoint.ft_1)) + '(Request request);';
|
|
326
326
|
}
|
|
327
327
|
function emit_10(_this__u8e3s4, endpoint) {
|
|
328
|
-
return trimMargin('\n |' + Spacer_instance.toString() + 'record Request (\n |' + Spacer_instance.
|
|
328
|
+
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 ');
|
|
329
329
|
}
|
|
330
330
|
function emit_11(_this__u8e3s4) {
|
|
331
331
|
var tmp = Spacer_instance.toString();
|
|
332
|
-
var tmp_0 = Companion_instance_1.
|
|
333
|
-
var tmp_1 = Spacer_instance.
|
|
334
|
-
var tmp_2 = Spacer_instance.
|
|
335
|
-
var tmp_3 = Spacer_instance.
|
|
336
|
-
var tmp_4 = emit_16(this, _this__u8e3s4.
|
|
332
|
+
var tmp_0 = Companion_instance_1.pu(_this__u8e3s4.rt_1);
|
|
333
|
+
var tmp_1 = Spacer_instance.sv(2);
|
|
334
|
+
var tmp_2 = Spacer_instance.sv(2);
|
|
335
|
+
var tmp_3 = Spacer_instance.sv(2);
|
|
336
|
+
var tmp_4 = emit_16(this, _this__u8e3s4.tt_1);
|
|
337
337
|
var tmp_5 = Spacer_instance.toString();
|
|
338
|
-
var tmp_6 = toString_0(first(_this__u8e3s4.
|
|
339
|
-
var tmp_7 = emit_16(this, _this__u8e3s4.
|
|
340
|
-
var tmp_8 = concatGenerics(emit_16(this, _this__u8e3s4.
|
|
341
|
-
var tmp_9 = Spacer_instance.
|
|
342
|
-
var tmp_10 = Companion_instance_1.
|
|
343
|
-
var tmp_11 = orNull(joinToString(_this__u8e3s4.
|
|
344
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
338
|
+
var tmp_6 = toString_0(first(_this__u8e3s4.rt_1));
|
|
339
|
+
var tmp_7 = emit_16(this, _this__u8e3s4.tt_1);
|
|
340
|
+
var tmp_8 = concatGenerics(emit_16(this, _this__u8e3s4.tt_1));
|
|
341
|
+
var tmp_9 = Spacer_instance.sv(2);
|
|
342
|
+
var tmp_10 = Companion_instance_1.pu(_this__u8e3s4.rt_1);
|
|
343
|
+
var tmp_11 = orNull(joinToString(_this__u8e3s4.st_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_5(this)));
|
|
344
|
+
var tmp0_safe_receiver = _this__u8e3s4.tt_1;
|
|
345
345
|
var tmp_12;
|
|
346
346
|
if (tmp0_safe_receiver == null) {
|
|
347
347
|
tmp_12 = null;
|
|
@@ -350,23 +350,67 @@ function emit_11(_this__u8e3s4) {
|
|
|
350
350
|
tmp_12 = emit_16(this, tmp0_safe_receiver) + ' body';
|
|
351
351
|
}
|
|
352
352
|
var tmp_13 = joinToString(listOfNotNull([tmp_11, tmp_12]));
|
|
353
|
-
var tmp_14 = Spacer_instance.
|
|
354
|
-
var tmp_15 = fixStatus(_this__u8e3s4.
|
|
353
|
+
var tmp_14 = Spacer_instance.sv(3);
|
|
354
|
+
var tmp_15 = fixStatus(_this__u8e3s4.rt_1);
|
|
355
355
|
// Inline function 'kotlin.let' call
|
|
356
|
-
var tmp_16 = 'new Headers(' + joinToString(_this__u8e3s4.
|
|
357
|
-
var tmp_17 = _this__u8e3s4.
|
|
358
|
-
var tmp_18 = Spacer_instance.
|
|
359
|
-
var tmp_19 = Spacer_instance.
|
|
360
|
-
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.
|
|
356
|
+
var tmp_16 = 'new Headers(' + joinToString(_this__u8e3s4.st_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_6(this)) + ')';
|
|
357
|
+
var tmp_17 = _this__u8e3s4.tt_1 == null ? 'null' : 'body';
|
|
358
|
+
var tmp_18 = Spacer_instance.sv(2);
|
|
359
|
+
var tmp_19 = Spacer_instance.sv(1);
|
|
360
|
+
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 ');
|
|
361
361
|
}
|
|
362
362
|
initMetadataForInterface(JavaEndpointDefinitionEmitter, 'JavaEndpointDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
363
|
-
function emit_12(
|
|
363
|
+
function emit_12(refined) {
|
|
364
|
+
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 ');
|
|
365
|
+
}
|
|
366
|
+
function emitValidator(_this__u8e3s4) {
|
|
367
|
+
var defaultReturn = 'return true;';
|
|
368
|
+
var type = _this__u8e3s4.ev_1.qy_1;
|
|
369
|
+
var tmp;
|
|
370
|
+
if (type instanceof Integer) {
|
|
371
|
+
var tmp0_safe_receiver = type.vx_1;
|
|
372
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.zt(tmp0_safe_receiver);
|
|
373
|
+
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
374
|
+
} else {
|
|
375
|
+
if (type instanceof Number_0) {
|
|
376
|
+
var tmp2_safe_receiver = type.yx_1;
|
|
377
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.zt(tmp2_safe_receiver);
|
|
378
|
+
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
379
|
+
} else {
|
|
380
|
+
if (type instanceof String_0) {
|
|
381
|
+
var tmp4_safe_receiver = type.sx_1;
|
|
382
|
+
var tmp_0;
|
|
383
|
+
var tmp_1 = tmp4_safe_receiver;
|
|
384
|
+
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
385
|
+
tmp_0 = null;
|
|
386
|
+
} else {
|
|
387
|
+
tmp_0 = this.zt(new RegExp_0(tmp4_safe_receiver));
|
|
388
|
+
}
|
|
389
|
+
var tmp5_elvis_lhs = tmp_0;
|
|
390
|
+
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
391
|
+
} else {
|
|
392
|
+
if (equals(type, Boolean_instance)) {
|
|
393
|
+
tmp = defaultReturn;
|
|
394
|
+
} else {
|
|
395
|
+
if (equals(type, Bytes_instance)) {
|
|
396
|
+
tmp = defaultReturn;
|
|
397
|
+
} else {
|
|
398
|
+
noWhenBranchMatchedException();
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
return tmp;
|
|
405
|
+
}
|
|
406
|
+
initMetadataForInterface(JavaRefinedTypeDefinitionEmitter, 'JavaRefinedTypeDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
407
|
+
function emit_13(identifier) {
|
|
364
408
|
var tmp;
|
|
365
409
|
if (identifier instanceof DefinitionIdentifier) {
|
|
366
|
-
tmp = this.
|
|
410
|
+
tmp = this.p20(identifier.m1());
|
|
367
411
|
} else {
|
|
368
412
|
if (identifier instanceof FieldIdentifier) {
|
|
369
|
-
tmp = this.
|
|
413
|
+
tmp = this.t20(this.p20(identifier.m1()));
|
|
370
414
|
} else {
|
|
371
415
|
noWhenBranchMatchedException();
|
|
372
416
|
}
|
|
@@ -384,11 +428,11 @@ function sanitizeSymbol(_this__u8e3s4) {
|
|
|
384
428
|
var item = _iterator__ex2g4s.v();
|
|
385
429
|
var _unary__edvuaz = index;
|
|
386
430
|
index = _unary__edvuaz + 1 | 0;
|
|
387
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
388
|
-
destination.
|
|
431
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.pu(item) : item;
|
|
432
|
+
destination.y(tmp$ret$0);
|
|
389
433
|
}
|
|
390
434
|
var tmp = asSequence(joinToString(destination, ''));
|
|
391
|
-
return this.
|
|
435
|
+
return this.s20(joinToString_0(filter(tmp, JavaIdentifierEmitter$sanitizeSymbol$lambda), ''));
|
|
392
436
|
}
|
|
393
437
|
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
394
438
|
var tmp;
|
|
@@ -408,64 +452,20 @@ function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
|
408
452
|
return tmp;
|
|
409
453
|
}
|
|
410
454
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
411
|
-
return Companion_getInstance_0().
|
|
455
|
+
return Companion_getInstance_0().v20_1.v1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
412
456
|
}
|
|
413
457
|
initMetadataForInterface(JavaIdentifierEmitter, 'JavaIdentifierEmitter');
|
|
414
|
-
function
|
|
415
|
-
var tmp = this.
|
|
416
|
-
return trimMargin('\n |public
|
|
417
|
-
}
|
|
418
|
-
initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
419
|
-
function emit_14(refined) {
|
|
420
|
-
return trimMargin('\n |public record ' + this.nr(refined.sr_1) + ' (' + this.nq(refined.tr_1) + ' value) implements Wirespec.Refined<' + this.nq(refined.tr_1) + '> {\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() { return value.toString(); }\n |' + Spacer_instance.toString() + 'public Boolean validate() {\n |' + Spacer_instance.toString() + Spacer_instance.toString() + this.bs(refined) + '\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public ' + this.nq(refined.tr_1) + ' value() { return value; }\n |}\n |\n ');
|
|
421
|
-
}
|
|
422
|
-
function emitValidator(_this__u8e3s4) {
|
|
423
|
-
var defaultReturn = 'return true;';
|
|
424
|
-
var type = _this__u8e3s4.tr_1.fv_1;
|
|
425
|
-
var tmp;
|
|
426
|
-
if (type instanceof Integer) {
|
|
427
|
-
var tmp0_safe_receiver = type.ku_1;
|
|
428
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.oq(tmp0_safe_receiver);
|
|
429
|
-
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
430
|
-
} else {
|
|
431
|
-
if (type instanceof Number_0) {
|
|
432
|
-
var tmp2_safe_receiver = type.nu_1;
|
|
433
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.oq(tmp2_safe_receiver);
|
|
434
|
-
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
435
|
-
} else {
|
|
436
|
-
if (type instanceof String_0) {
|
|
437
|
-
var tmp4_safe_receiver = type.hu_1;
|
|
438
|
-
var tmp_0;
|
|
439
|
-
var tmp_1 = tmp4_safe_receiver;
|
|
440
|
-
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
441
|
-
tmp_0 = null;
|
|
442
|
-
} else {
|
|
443
|
-
tmp_0 = this.oq(new RegExp_0(tmp4_safe_receiver));
|
|
444
|
-
}
|
|
445
|
-
var tmp5_elvis_lhs = tmp_0;
|
|
446
|
-
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
447
|
-
} else {
|
|
448
|
-
if (equals(type, Boolean_instance)) {
|
|
449
|
-
tmp = defaultReturn;
|
|
450
|
-
} else {
|
|
451
|
-
if (equals(type, Bytes_instance)) {
|
|
452
|
-
tmp = defaultReturn;
|
|
453
|
-
} else {
|
|
454
|
-
noWhenBranchMatchedException();
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
return tmp;
|
|
461
|
-
}
|
|
462
|
-
initMetadataForInterface(JavaRefinedTypeDefinitionEmitter, 'JavaRefinedTypeDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
463
|
-
function emit_15(enum_0, module_0) {
|
|
464
|
-
var tmp = this.nr(enum_0.xr_1);
|
|
465
|
-
return trimMargin('\n |public enum ' + tmp + ' implements Wirespec.Enum {\n |' + spacer(joinToString(enum_0.yr_1, ',\n', VOID, VOID, VOID, VOID, JavaEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'public final String label;\n |' + Spacer_instance.toString() + this.nr(enum_0.xr_1) + '(String label) {\n |' + Spacer_instance.hs(2) + 'this.label = label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() {\n |' + Spacer_instance.hs(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String label() {\n |' + Spacer_instance.hs(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
458
|
+
function emit_14(enum_0, module_0) {
|
|
459
|
+
var tmp = this.yu(enum_0.iv_1);
|
|
460
|
+
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 ');
|
|
466
461
|
}
|
|
467
462
|
initMetadataForInterface(JavaEnumDefinitionEmitter, 'JavaEnumDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
468
|
-
|
|
463
|
+
function emit_15(union) {
|
|
464
|
+
var tmp = this.yu(union.rs_1);
|
|
465
|
+
return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.ss_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
|
|
466
|
+
}
|
|
467
|
+
initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
468
|
+
initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [JavaTypeDefinitionEmitter, JavaEndpointDefinitionEmitter, JavaRefinedTypeDefinitionEmitter, JavaChannelDefinitionEmitter, JavaEnumDefinitionEmitter, JavaIdentifierEmitter, JavaUnionDefinitionEmitter, LanguageEmitter]);
|
|
469
469
|
initMetadataForCompanion(Companion);
|
|
470
470
|
initMetadataForCompanion(Companion_0);
|
|
471
471
|
initMetadataForClass(JavaIrEmitter, 'JavaIrEmitter', JavaIrEmitter, VOID, [IrEmitter]);
|
|
@@ -479,8 +479,8 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
479
479
|
var _iterator__ex2g4s = tmp0.t();
|
|
480
480
|
while (_iterator__ex2g4s.u()) {
|
|
481
481
|
var element = _iterator__ex2g4s.v();
|
|
482
|
-
if (!(_this__u8e3s4.
|
|
483
|
-
destination.
|
|
482
|
+
if (!(_this__u8e3s4.xu().m1() === element.my_1)) {
|
|
483
|
+
destination.y(element);
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -489,16 +489,16 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
489
489
|
var _iterator__ex2g4s_0 = destination.t();
|
|
490
490
|
while (_iterator__ex2g4s_0.u()) {
|
|
491
491
|
var item = _iterator__ex2g4s_0.v();
|
|
492
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
493
|
-
destination_0.
|
|
492
|
+
var tmp$ret$3 = 'import ' + $this.d20().ov_1 + '.model.' + item.my_1 + ';';
|
|
493
|
+
destination_0.y(tmp$ret$3);
|
|
494
494
|
}
|
|
495
495
|
var tmp = destination_0;
|
|
496
496
|
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaChannelDefinitionEmitter$emitImports$lambda);
|
|
497
497
|
}
|
|
498
498
|
function emitFullyQualified($this, _this__u8e3s4, reference) {
|
|
499
499
|
var tmp;
|
|
500
|
-
if (_this__u8e3s4.
|
|
501
|
-
tmp = $this.
|
|
500
|
+
if (_this__u8e3s4.xu().m1() === reference.m1()) {
|
|
501
|
+
tmp = $this.d20().ov_1 + '.model.';
|
|
502
502
|
} else {
|
|
503
503
|
tmp = '';
|
|
504
504
|
}
|
|
@@ -511,49 +511,49 @@ function JavaChannelDefinitionEmitter$emitImports$lambda(it) {
|
|
|
511
511
|
function JavaChannelDefinitionEmitter() {
|
|
512
512
|
}
|
|
513
513
|
function JavaEmitter(packageName, emitShared) {
|
|
514
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
515
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
514
|
+
packageName = packageName === VOID ? Companion_instance.nv('community.flock.wirespec.generated') : packageName;
|
|
515
|
+
emitShared = emitShared === VOID ? Companion_instance_0.hs() : emitShared;
|
|
516
516
|
LanguageEmitter.call(this);
|
|
517
|
-
this.
|
|
518
|
-
this.
|
|
519
|
-
this.
|
|
520
|
-
this.
|
|
521
|
-
this.
|
|
522
|
-
this.
|
|
523
|
-
}
|
|
524
|
-
protoOf(JavaEmitter).
|
|
525
|
-
return this.
|
|
517
|
+
this.g20_1 = packageName;
|
|
518
|
+
this.h20_1 = emitShared;
|
|
519
|
+
this.i20_1 = '\nimport community.flock.wirespec.java.Wirespec;\n';
|
|
520
|
+
this.j20_1 = FileExtension_Java_getInstance();
|
|
521
|
+
this.k20_1 = JavaShared_getInstance();
|
|
522
|
+
this.l20_1 = '//';
|
|
523
|
+
}
|
|
524
|
+
protoOf(JavaEmitter).d20 = function () {
|
|
525
|
+
return this.g20_1;
|
|
526
526
|
};
|
|
527
|
-
protoOf(JavaEmitter).
|
|
528
|
-
return this.
|
|
527
|
+
protoOf(JavaEmitter).fu = function () {
|
|
528
|
+
return this.j20_1;
|
|
529
529
|
};
|
|
530
|
-
protoOf(JavaEmitter).
|
|
531
|
-
return this.
|
|
530
|
+
protoOf(JavaEmitter).m20 = function () {
|
|
531
|
+
return this.k20_1;
|
|
532
532
|
};
|
|
533
|
-
protoOf(JavaEmitter).
|
|
534
|
-
return this.
|
|
533
|
+
protoOf(JavaEmitter).gu = function () {
|
|
534
|
+
return this.l20_1;
|
|
535
535
|
};
|
|
536
|
-
protoOf(JavaEmitter).
|
|
536
|
+
protoOf(JavaEmitter).vu = function (module_0, logger) {
|
|
537
537
|
// Inline function 'kotlin.let' call
|
|
538
|
-
var it = protoOf(LanguageEmitter).
|
|
539
|
-
return this.
|
|
538
|
+
var it = protoOf(LanguageEmitter).vu.call(this, module_0, logger);
|
|
539
|
+
return this.h20_1.is_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.nv('community.flock.wirespec.java').qv() + 'Wirespec', this.m20().o20_1)) : it;
|
|
540
540
|
};
|
|
541
|
-
protoOf(JavaEmitter).
|
|
541
|
+
protoOf(JavaEmitter).wu = function (definition, module_0, logger) {
|
|
542
542
|
// Inline function 'kotlin.let' call
|
|
543
|
-
var it = protoOf(LanguageEmitter).
|
|
544
|
-
var subPackageName = plus(this.
|
|
545
|
-
var tmp = subPackageName.
|
|
543
|
+
var it = protoOf(LanguageEmitter).wu.call(this, definition, module_0, logger);
|
|
544
|
+
var subPackageName = plus(this.d20(), definition);
|
|
545
|
+
var tmp = subPackageName.qv() + this.p20(it.js_1);
|
|
546
546
|
// Inline function 'kotlin.text.trimStart' call
|
|
547
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.
|
|
547
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.ru(module_0) ? this.i20_1 : '') + '\n |' + it.ks_1 + '\n ');
|
|
548
548
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
549
549
|
return new Emitted(tmp, tmp$ret$0);
|
|
550
550
|
};
|
|
551
551
|
function emitGetType($this, _this__u8e3s4) {
|
|
552
|
-
return 'Wirespec.getType(' + $this.
|
|
552
|
+
return 'Wirespec.getType(' + $this.f20(_this__u8e3s4, 'Void') + '.class, ' + emitGetTypeRaw($this, _this__u8e3s4) + ')';
|
|
553
553
|
}
|
|
554
554
|
function emitGetTypeRaw($this, _this__u8e3s4) {
|
|
555
555
|
var tmp;
|
|
556
|
-
var tmp1_elvis_lhs = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
556
|
+
var tmp1_elvis_lhs = _this__u8e3s4 == null ? null : _this__u8e3s4.ey();
|
|
557
557
|
if (tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs) {
|
|
558
558
|
tmp = 'java.util.Optional.class';
|
|
559
559
|
} else {
|
|
@@ -568,9 +568,9 @@ function emitGetTypeRaw($this, _this__u8e3s4) {
|
|
|
568
568
|
function emitConstructor($this, _this__u8e3s4, endpoint) {
|
|
569
569
|
var tmp = get_pathParams(endpoint);
|
|
570
570
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda($this)));
|
|
571
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
572
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
573
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
571
|
+
var tmp_1 = orNull(joinToString(endpoint.it_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_0($this)));
|
|
572
|
+
var tmp_2 = orNull(joinToString(endpoint.jt_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_1($this)));
|
|
573
|
+
var tmp0_safe_receiver = _this__u8e3s4.ot_1;
|
|
574
574
|
var tmp_3;
|
|
575
575
|
if (tmp0_safe_receiver == null) {
|
|
576
576
|
tmp_3 = null;
|
|
@@ -579,112 +579,112 @@ function emitConstructor($this, _this__u8e3s4, endpoint) {
|
|
|
579
579
|
tmp_3 = emit_16($this, tmp0_safe_receiver) + ' body';
|
|
580
580
|
}
|
|
581
581
|
var tmp_4 = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]));
|
|
582
|
-
var tmp_5 = Spacer_instance.
|
|
582
|
+
var tmp_5 = Spacer_instance.sv(3);
|
|
583
583
|
var tmp_6 = get_pathParams(endpoint);
|
|
584
584
|
// Inline function 'kotlin.let' call
|
|
585
585
|
var tmp$ret$3 = 'new Path(' + joinToString(tmp_6, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_2($this)) + ')';
|
|
586
586
|
var tmp1_elvis_lhs = orNull(tmp$ret$3);
|
|
587
587
|
var tmp_7 = tmp1_elvis_lhs == null ? 'new Path()' : tmp1_elvis_lhs;
|
|
588
|
-
var tmp_8 = 'Wirespec.Method.' + endpoint.
|
|
588
|
+
var tmp_8 = 'Wirespec.Method.' + endpoint.gt_1.b3_1;
|
|
589
589
|
// Inline function 'kotlin.let' call
|
|
590
|
-
var tmp$ret$5 = 'new Queries(' + joinToString(endpoint.
|
|
590
|
+
var tmp$ret$5 = 'new Queries(' + joinToString(endpoint.it_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_3($this)) + ')';
|
|
591
591
|
var tmp2_elvis_lhs = orNull(tmp$ret$5);
|
|
592
592
|
var tmp_9 = tmp2_elvis_lhs == null ? 'new Queries()' : tmp2_elvis_lhs;
|
|
593
593
|
// Inline function 'kotlin.let' call
|
|
594
|
-
var tmp$ret$7 = 'new RequestHeaders(' + joinToString(endpoint.
|
|
594
|
+
var tmp$ret$7 = 'new RequestHeaders(' + joinToString(endpoint.jt_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_4($this)) + ')';
|
|
595
595
|
var tmp3_elvis_lhs = orNull(tmp$ret$7);
|
|
596
596
|
var tmp_10 = tmp3_elvis_lhs == null ? 'new RequestHeaders()' : tmp3_elvis_lhs;
|
|
597
597
|
var tmp_11;
|
|
598
|
-
if (_this__u8e3s4.
|
|
598
|
+
if (_this__u8e3s4.ot_1 == null) {
|
|
599
599
|
tmp_11 = null;
|
|
600
600
|
} else {
|
|
601
601
|
// Inline function 'kotlin.let' call
|
|
602
602
|
tmp_11 = 'body';
|
|
603
603
|
}
|
|
604
604
|
var tmp5_elvis_lhs = tmp_11;
|
|
605
|
-
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.
|
|
605
|
+
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) + '}';
|
|
606
606
|
}
|
|
607
607
|
function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
608
608
|
var tmp = get_indexedPathParams(endpoint);
|
|
609
609
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
|
|
610
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
611
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
612
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
610
|
+
var tmp_1 = orNull(joinToString(endpoint.it_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
611
|
+
var tmp_2 = orNull(joinToString(endpoint.jt_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
612
|
+
var tmp0_safe_receiver = _this__u8e3s4.ot_1;
|
|
613
613
|
var tmp_3;
|
|
614
614
|
if (tmp0_safe_receiver == null) {
|
|
615
615
|
tmp_3 = null;
|
|
616
616
|
} else {
|
|
617
617
|
// Inline function 'kotlin.let' call
|
|
618
|
-
tmp_3 = Spacer_instance.
|
|
618
|
+
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)';
|
|
619
619
|
}
|
|
620
620
|
// Inline function 'kotlin.let' call
|
|
621
621
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
622
|
-
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.
|
|
622
|
+
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.sv(3);
|
|
623
623
|
}
|
|
624
624
|
function emitDeserializedParams_0($this, _this__u8e3s4) {
|
|
625
|
-
var tmp = orNull(joinToString(_this__u8e3s4.
|
|
626
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
625
|
+
var tmp = orNull(joinToString(_this__u8e3s4.st_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2($this)));
|
|
626
|
+
var tmp0_safe_receiver = _this__u8e3s4.tt_1;
|
|
627
627
|
var tmp_0;
|
|
628
628
|
if (tmp0_safe_receiver == null) {
|
|
629
629
|
tmp_0 = null;
|
|
630
630
|
} else {
|
|
631
631
|
// Inline function 'kotlin.let' call
|
|
632
|
-
tmp_0 = Spacer_instance.
|
|
632
|
+
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)';
|
|
633
633
|
}
|
|
634
634
|
// Inline function 'kotlin.let' call
|
|
635
635
|
var it = joinToString(listOfNotNull([tmp, tmp_0]), ',\n');
|
|
636
|
-
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.
|
|
636
|
+
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.sv(4);
|
|
637
637
|
}
|
|
638
638
|
function emitSerialized($this, _this__u8e3s4) {
|
|
639
639
|
var tmp;
|
|
640
|
-
if (!(_this__u8e3s4.
|
|
641
|
-
tmp = 'java.util.Optional.ofNullable(serialization.serializeBody(r.body, ' + emitGetType($this, ensureNotNull(_this__u8e3s4.
|
|
640
|
+
if (!(_this__u8e3s4.tt_1 == null)) {
|
|
641
|
+
tmp = 'java.util.Optional.ofNullable(serialization.serializeBody(r.body, ' + emitGetType($this, ensureNotNull(_this__u8e3s4.tt_1).qt_1) + '))';
|
|
642
642
|
} else {
|
|
643
643
|
tmp = 'java.util.Optional.empty()';
|
|
644
644
|
}
|
|
645
645
|
var body = tmp;
|
|
646
646
|
var tmp_0;
|
|
647
647
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
648
|
-
if (!_this__u8e3s4.
|
|
649
|
-
tmp_0 = 'java.util.Map.ofEntries(' + joinToString(_this__u8e3s4.
|
|
648
|
+
if (!_this__u8e3s4.st_1.r()) {
|
|
649
|
+
tmp_0 = 'java.util.Map.ofEntries(' + joinToString(_this__u8e3s4.st_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitSerialized$lambda($this)) + ')';
|
|
650
650
|
} else {
|
|
651
651
|
tmp_0 = 'java.util.Collections.emptyMap()';
|
|
652
652
|
}
|
|
653
653
|
var headers = tmp_0;
|
|
654
|
-
return Spacer_instance.
|
|
654
|
+
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 + '); }';
|
|
655
655
|
}
|
|
656
656
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
657
|
-
return Spacer_instance.
|
|
657
|
+
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) + ');';
|
|
658
658
|
}
|
|
659
659
|
function emitSerializedParams($this, _this__u8e3s4, fields) {
|
|
660
|
-
return 'java.util.Map.entry("' + _this__u8e3s4.
|
|
660
|
+
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) + '))';
|
|
661
661
|
}
|
|
662
662
|
function emitDeserialized_0($this, _this__u8e3s4) {
|
|
663
|
-
return Spacer_instance.
|
|
663
|
+
return Spacer_instance.sv(4) + 'serialization.deserializePath(request.path().get(' + _this__u8e3s4.kf_1 + '), ' + emitGetType($this, _this__u8e3s4.lf_1.nt_1) + ')';
|
|
664
664
|
}
|
|
665
665
|
function emitDeserializedParams_1($this, _this__u8e3s4, fields, caseSensitive) {
|
|
666
666
|
var tmp;
|
|
667
667
|
if (caseSensitive) {
|
|
668
|
-
tmp = 'request.' + fields + '().getOrDefault("' + _this__u8e3s4.
|
|
668
|
+
tmp = 'request.' + fields + '().getOrDefault("' + _this__u8e3s4.bt_1.m1() + '", java.util.Collections.emptyList())';
|
|
669
669
|
} else {
|
|
670
|
-
tmp = 'request.' + fields + '().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + _this__u8e3s4.
|
|
670
|
+
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())';
|
|
671
671
|
}
|
|
672
672
|
var valuesFromField = tmp;
|
|
673
|
-
return Spacer_instance.
|
|
673
|
+
return Spacer_instance.sv(4) + 'serialization.<' + $this.yt(_this__u8e3s4.ct_1) + '>deserializeParam(' + valuesFromField + ', ' + emitGetType($this, _this__u8e3s4.ct_1) + ')';
|
|
674
674
|
}
|
|
675
675
|
function emitSerializedHeader($this, _this__u8e3s4) {
|
|
676
|
-
return 'java.util.Map.entry("' + _this__u8e3s4.
|
|
676
|
+
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) + '))';
|
|
677
677
|
}
|
|
678
678
|
function emitIdentifier($this, _this__u8e3s4) {
|
|
679
|
-
return 'serialization.serializePath(request.path().' + Companion_instance_1.
|
|
679
|
+
return 'serialization.serializePath(request.path().' + Companion_instance_1.qu($this.yu(_this__u8e3s4.mt_1)) + '(), ' + emitGetType($this, _this__u8e3s4.nt_1) + ')';
|
|
680
680
|
}
|
|
681
681
|
function emit_16($this, _this__u8e3s4) {
|
|
682
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
683
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
682
|
+
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.qt_1;
|
|
683
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.yt(tmp1_safe_receiver);
|
|
684
684
|
return tmp2_elvis_lhs == null ? 'Void' : tmp2_elvis_lhs;
|
|
685
685
|
}
|
|
686
686
|
function emit_17($this, _this__u8e3s4) {
|
|
687
|
-
return $this.
|
|
687
|
+
return $this.yt(_this__u8e3s4.nt_1) + ' ' + $this.yu(_this__u8e3s4.mt_1);
|
|
688
688
|
}
|
|
689
689
|
function emitImports_0($this, _this__u8e3s4) {
|
|
690
690
|
// Inline function 'kotlin.collections.filter' call
|
|
@@ -694,8 +694,8 @@ function emitImports_0($this, _this__u8e3s4) {
|
|
|
694
694
|
var _iterator__ex2g4s = tmp0.t();
|
|
695
695
|
while (_iterator__ex2g4s.u()) {
|
|
696
696
|
var element = _iterator__ex2g4s.v();
|
|
697
|
-
if (!(_this__u8e3s4.
|
|
698
|
-
destination.
|
|
697
|
+
if (!(_this__u8e3s4.xu().m1() === element.my_1)) {
|
|
698
|
+
destination.y(element);
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
701
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -704,46 +704,46 @@ function emitImports_0($this, _this__u8e3s4) {
|
|
|
704
704
|
var _iterator__ex2g4s_0 = destination.t();
|
|
705
705
|
while (_iterator__ex2g4s_0.u()) {
|
|
706
706
|
var item = _iterator__ex2g4s_0.v();
|
|
707
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
708
|
-
destination_0.
|
|
707
|
+
var tmp$ret$3 = 'import ' + $this.d20().ov_1 + '.model.' + item.my_1 + ';';
|
|
708
|
+
destination_0.y(tmp$ret$3);
|
|
709
709
|
}
|
|
710
710
|
var tmp = destination_0;
|
|
711
711
|
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitImports$lambda);
|
|
712
712
|
}
|
|
713
713
|
function emitRequestFunctions($this, _this__u8e3s4, endpoint) {
|
|
714
|
-
var tmp = Spacer_instance.
|
|
715
|
-
var tmp_0 = Spacer_instance.
|
|
716
|
-
var tmp_1 = Spacer_instance.
|
|
717
|
-
var tmp_2 = Spacer_instance.
|
|
718
|
-
var tmp_3 = joinToString(endpoint.
|
|
719
|
-
var tmp_4 = Spacer_instance.
|
|
714
|
+
var tmp = Spacer_instance.sv(2);
|
|
715
|
+
var tmp_0 = Spacer_instance.sv(3);
|
|
716
|
+
var tmp_1 = Spacer_instance.sv(4);
|
|
717
|
+
var tmp_2 = Spacer_instance.sv(4);
|
|
718
|
+
var tmp_3 = joinToString(endpoint.ht_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda($this));
|
|
719
|
+
var tmp_4 = Spacer_instance.sv(4);
|
|
720
720
|
var tmp_5;
|
|
721
721
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
722
|
-
if (!endpoint.
|
|
723
|
-
tmp_5 = 'java.util.Map.ofEntries(' + joinToString(endpoint.
|
|
722
|
+
if (!endpoint.it_1.r()) {
|
|
723
|
+
tmp_5 = 'java.util.Map.ofEntries(' + joinToString(endpoint.it_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_0($this)) + ')';
|
|
724
724
|
} else {
|
|
725
725
|
tmp_5 = 'java.util.Collections.emptyMap()';
|
|
726
726
|
}
|
|
727
727
|
var tmp_6 = tmp_5;
|
|
728
|
-
var tmp_7 = Spacer_instance.
|
|
728
|
+
var tmp_7 = Spacer_instance.sv(4);
|
|
729
729
|
var tmp_8;
|
|
730
730
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
731
|
-
if (!endpoint.
|
|
732
|
-
tmp_8 = 'java.util.Map.ofEntries(' + joinToString(endpoint.
|
|
731
|
+
if (!endpoint.jt_1.r()) {
|
|
732
|
+
tmp_8 = 'java.util.Map.ofEntries(' + joinToString(endpoint.jt_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1($this)) + ')';
|
|
733
733
|
} else {
|
|
734
734
|
tmp_8 = 'java.util.Collections.emptyMap()';
|
|
735
735
|
}
|
|
736
736
|
var tmp_9 = tmp_8;
|
|
737
|
-
var tmp_10 = Spacer_instance.
|
|
737
|
+
var tmp_10 = Spacer_instance.sv(4);
|
|
738
738
|
var tmp_11;
|
|
739
|
-
if (!(_this__u8e3s4.
|
|
740
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
741
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
739
|
+
if (!(_this__u8e3s4.ot_1 == null)) {
|
|
740
|
+
var tmp0_safe_receiver = _this__u8e3s4.ot_1;
|
|
741
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.qt_1;
|
|
742
742
|
tmp_11 = 'java.util.Optional.ofNullable(serialization.serializeBody(request.body(), ' + (tmp1_safe_receiver == null ? null : emitGetType($this, tmp1_safe_receiver)) + '))';
|
|
743
743
|
} else {
|
|
744
744
|
tmp_11 = 'java.util.Optional.empty()';
|
|
745
745
|
}
|
|
746
|
-
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.
|
|
746
|
+
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 ');
|
|
747
747
|
}
|
|
748
748
|
function emitObject($this, _this__u8e3s4, name, extends_0, block) {
|
|
749
749
|
var tmp;
|
|
@@ -757,54 +757,54 @@ function emitObject($this, _this__u8e3s4, name, extends_0, block) {
|
|
|
757
757
|
}
|
|
758
758
|
function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
759
759
|
// Inline function 'kotlin.collections.map' call
|
|
760
|
-
var this_0 = distinctByStatus(_this__u8e3s4.
|
|
760
|
+
var this_0 = distinctByStatus(_this__u8e3s4.lt_1);
|
|
761
761
|
// Inline function 'kotlin.collections.mapTo' call
|
|
762
762
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
763
763
|
var _iterator__ex2g4s = this_0.t();
|
|
764
764
|
while (_iterator__ex2g4s.u()) {
|
|
765
765
|
var item = _iterator__ex2g4s.v();
|
|
766
|
-
var tmp$ret$0 = emit_16($this, item.
|
|
767
|
-
destination.
|
|
766
|
+
var tmp$ret$0 = emit_16($this, item.tt_1);
|
|
767
|
+
destination.y(tmp$ret$0);
|
|
768
768
|
}
|
|
769
769
|
var tmp = distinct(destination);
|
|
770
770
|
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitResponseInterfaces$lambda);
|
|
771
771
|
}
|
|
772
772
|
function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
773
773
|
// Inline function 'kotlin.collections.map' call
|
|
774
|
-
var this_0 = _this__u8e3s4.
|
|
774
|
+
var this_0 = _this__u8e3s4.lt_1;
|
|
775
775
|
// Inline function 'kotlin.collections.mapTo' call
|
|
776
776
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
777
777
|
var _iterator__ex2g4s = this_0.t();
|
|
778
778
|
while (_iterator__ex2g4s.u()) {
|
|
779
779
|
var item = _iterator__ex2g4s.v();
|
|
780
|
-
var tmp$ret$0 = new Char(first(item.
|
|
781
|
-
destination.
|
|
780
|
+
var tmp$ret$0 = new Char(first(item.rt_1));
|
|
781
|
+
destination.y(tmp$ret$0);
|
|
782
782
|
}
|
|
783
783
|
var tmp = distinct(destination);
|
|
784
784
|
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitStatusInterfaces$lambda);
|
|
785
785
|
}
|
|
786
786
|
function emitFromResponse($this, _this__u8e3s4) {
|
|
787
787
|
// Inline function 'kotlin.collections.filter' call
|
|
788
|
-
var tmp0 = distinctByStatus(_this__u8e3s4.
|
|
788
|
+
var tmp0 = distinctByStatus(_this__u8e3s4.lt_1);
|
|
789
789
|
// Inline function 'kotlin.collections.filterTo' call
|
|
790
790
|
var destination = ArrayList_init_$Create$();
|
|
791
791
|
var _iterator__ex2g4s = tmp0.t();
|
|
792
792
|
while (_iterator__ex2g4s.u()) {
|
|
793
793
|
var element = _iterator__ex2g4s.v();
|
|
794
|
-
if (Companion_instance_1.
|
|
795
|
-
destination.
|
|
794
|
+
if (Companion_instance_1.tu(element.rt_1)) {
|
|
795
|
+
destination.y(element);
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
798
|
var statusResponses = destination;
|
|
799
799
|
var tmp;
|
|
800
800
|
if (statusResponses.r()) {
|
|
801
|
-
tmp = trimMargin('\n |' + Spacer_instance.
|
|
802
|
-
} else if (statusResponses.
|
|
801
|
+
tmp = trimMargin('\n |' + Spacer_instance.sv(3) + 'throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n ');
|
|
802
|
+
} else if (statusResponses.b1() === 1) {
|
|
803
803
|
var response = first_0(statusResponses);
|
|
804
|
-
tmp = trimMargin('\n |' + Spacer_instance.
|
|
804
|
+
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 ');
|
|
805
805
|
} else {
|
|
806
|
-
var tmp_0 = Spacer_instance.
|
|
807
|
-
tmp = trimMargin('\n |' + tmp_0 + 'return switch (response.statusCode()) {\n |' + joinToString(statusResponses, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitFromResponse$lambda($this)) + '\n |' + Spacer_instance.
|
|
806
|
+
var tmp_0 = Spacer_instance.sv(3);
|
|
807
|
+
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 ');
|
|
808
808
|
}
|
|
809
809
|
return tmp;
|
|
810
810
|
}
|
|
@@ -815,17 +815,17 @@ function JavaEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
|
815
815
|
}
|
|
816
816
|
function JavaEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
817
817
|
return function (it) {
|
|
818
|
-
return this$0.
|
|
818
|
+
return this$0.xt(it);
|
|
819
819
|
};
|
|
820
820
|
}
|
|
821
821
|
function JavaEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
822
822
|
return function (it) {
|
|
823
|
-
return this$0.
|
|
823
|
+
return this$0.xt(it);
|
|
824
824
|
};
|
|
825
825
|
}
|
|
826
826
|
function JavaEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
827
827
|
return function (it) {
|
|
828
|
-
return this$0.
|
|
828
|
+
return this$0.r20(it);
|
|
829
829
|
};
|
|
830
830
|
}
|
|
831
831
|
function JavaEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
@@ -843,27 +843,27 @@ function JavaEndpointDefinitionEmitter$emitConstructor$lambda(this$0) {
|
|
|
843
843
|
}
|
|
844
844
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_0(this$0) {
|
|
845
845
|
return function (it) {
|
|
846
|
-
return this$0.
|
|
846
|
+
return this$0.xt(it);
|
|
847
847
|
};
|
|
848
848
|
}
|
|
849
849
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_1(this$0) {
|
|
850
850
|
return function (it) {
|
|
851
|
-
return this$0.
|
|
851
|
+
return this$0.xt(it);
|
|
852
852
|
};
|
|
853
853
|
}
|
|
854
854
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_2(this$0) {
|
|
855
855
|
return function (it) {
|
|
856
|
-
return this$0.
|
|
856
|
+
return this$0.yu(it.mt_1);
|
|
857
857
|
};
|
|
858
858
|
}
|
|
859
859
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_3(this$0) {
|
|
860
860
|
return function (it) {
|
|
861
|
-
return this$0.
|
|
861
|
+
return this$0.yu(it.bt_1);
|
|
862
862
|
};
|
|
863
863
|
}
|
|
864
864
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_4(this$0) {
|
|
865
865
|
return function (it) {
|
|
866
|
-
return this$0.
|
|
866
|
+
return this$0.yu(it.bt_1);
|
|
867
867
|
};
|
|
868
868
|
}
|
|
869
869
|
function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda(this$0) {
|
|
@@ -883,22 +883,22 @@ function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1(this$0) {
|
|
|
883
883
|
}
|
|
884
884
|
function JavaEndpointDefinitionEmitter$emit$lambda_5(this$0) {
|
|
885
885
|
return function (it) {
|
|
886
|
-
return this$0.
|
|
886
|
+
return this$0.xt(it);
|
|
887
887
|
};
|
|
888
888
|
}
|
|
889
889
|
function JavaEndpointDefinitionEmitter$emit$lambda_6(this$0) {
|
|
890
890
|
return function (it) {
|
|
891
|
-
return this$0.
|
|
891
|
+
return this$0.yu(it.bt_1);
|
|
892
892
|
};
|
|
893
893
|
}
|
|
894
894
|
function JavaEndpointDefinitionEmitter$emit$lambda_7(this$0) {
|
|
895
895
|
return function (it) {
|
|
896
|
-
return this$0.
|
|
896
|
+
return this$0.xt(it);
|
|
897
897
|
};
|
|
898
898
|
}
|
|
899
899
|
function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2(this$0) {
|
|
900
900
|
return function (it) {
|
|
901
|
-
return Spacer_instance.
|
|
901
|
+
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) + ')';
|
|
902
902
|
};
|
|
903
903
|
}
|
|
904
904
|
function JavaEndpointDefinitionEmitter$emitSerialized$lambda(this$0) {
|
|
@@ -914,7 +914,7 @@ function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda(this$0) {
|
|
|
914
914
|
return function (it) {
|
|
915
915
|
var tmp;
|
|
916
916
|
if (it instanceof Literal) {
|
|
917
|
-
tmp = '"' + it.
|
|
917
|
+
tmp = '"' + it.iu_1 + '"';
|
|
918
918
|
} else {
|
|
919
919
|
if (it instanceof Param) {
|
|
920
920
|
tmp = emitIdentifier(this$0, it);
|
|
@@ -937,14 +937,14 @@ function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1(this$0) {
|
|
|
937
937
|
}
|
|
938
938
|
function JavaEndpointDefinitionEmitter$emitObject$lambda($block) {
|
|
939
939
|
return function (it) {
|
|
940
|
-
return Spacer_instance.
|
|
940
|
+
return Spacer_instance.sv(2) + $block(it);
|
|
941
941
|
};
|
|
942
942
|
}
|
|
943
943
|
function JavaEndpointDefinitionEmitter$emitResponseInterfaces$lambda(it) {
|
|
944
944
|
return Spacer_instance.toString() + 'sealed interface Response' + concatGenerics(it) + ' extends Response<' + it + '> {}';
|
|
945
945
|
}
|
|
946
946
|
function JavaEndpointDefinitionEmitter$emitStatusInterfaces$lambda(it) {
|
|
947
|
-
return Spacer_instance.toString() + 'sealed interface Response' + toString_0(it.
|
|
947
|
+
return Spacer_instance.toString() + 'sealed interface Response' + toString_0(it.i1_1) + 'XX<T> extends Response<T> {}';
|
|
948
948
|
}
|
|
949
949
|
function JavaEndpointDefinitionEmitter$emitFromResponse$lambda(this$0) {
|
|
950
950
|
return function (it) {
|
|
@@ -957,7 +957,7 @@ function sanitizeNegative($this, _this__u8e3s4) {
|
|
|
957
957
|
return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
|
|
958
958
|
}
|
|
959
959
|
function sanitizeEnum($this, _this__u8e3s4) {
|
|
960
|
-
return $this.
|
|
960
|
+
return $this.t20($this.s20(joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_')));
|
|
961
961
|
}
|
|
962
962
|
function JavaEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
963
963
|
return function (it) {
|
|
@@ -968,7 +968,7 @@ function JavaEnumDefinitionEmitter() {
|
|
|
968
968
|
}
|
|
969
969
|
function Companion() {
|
|
970
970
|
Companion_instance_2 = this;
|
|
971
|
-
this.
|
|
971
|
+
this.v20_1 = setOf(['abstract', 'continue', 'for', 'new', 'switch', 'assert', 'default', 'goto', 'package', 'synchronized', 'boolean', 'do', 'if', 'private', 'this', 'break', 'double', 'implements', 'protected', 'throw', 'byte', 'else', 'import', 'public', 'throws', 'case', 'enum', 'instanceof', 'return', 'transient', 'catch', 'extends', 'int', 'short', 'try', 'char', 'final', 'interface', 'static', 'void', 'class', 'finally', 'long', 'strictfp', 'volatile', 'const', 'float', 'native', 'super', 'while', 'true', 'false']);
|
|
972
972
|
}
|
|
973
973
|
var Companion_instance_2;
|
|
974
974
|
function Companion_getInstance_0() {
|
|
@@ -977,7 +977,7 @@ function Companion_getInstance_0() {
|
|
|
977
977
|
return Companion_instance_2;
|
|
978
978
|
}
|
|
979
979
|
function JavaIdentifierEmitter$sanitizeSymbol$lambda(it) {
|
|
980
|
-
return isLetterOrDigit(it.
|
|
980
|
+
return isLetterOrDigit(it.i1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).v1(it);
|
|
981
981
|
}
|
|
982
982
|
function JavaIdentifierEmitter() {
|
|
983
983
|
}
|
|
@@ -992,8 +992,8 @@ function sanitizeSymbol_0($this, _this__u8e3s4) {
|
|
|
992
992
|
var item = _iterator__ex2g4s.v();
|
|
993
993
|
var _unary__edvuaz = index;
|
|
994
994
|
index = _unary__edvuaz + 1 | 0;
|
|
995
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
996
|
-
destination.
|
|
995
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.pu(item) : item;
|
|
996
|
+
destination.y(tmp$ret$0);
|
|
997
997
|
}
|
|
998
998
|
// Inline function 'kotlin.text.filter' call
|
|
999
999
|
var tmp0 = joinToString(destination, '');
|
|
@@ -1032,14 +1032,14 @@ function sanitizeFirstIsDigit_0($this, _this__u8e3s4) {
|
|
|
1032
1032
|
return tmp;
|
|
1033
1033
|
}
|
|
1034
1034
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1035
|
-
return Companion_getInstance_1().
|
|
1035
|
+
return Companion_getInstance_1().w20_1.v1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1036
1036
|
}
|
|
1037
1037
|
function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
1038
1038
|
return sanitizeKeywords_0($this, sanitizeFirstIsDigit_0($this, joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_')));
|
|
1039
1039
|
}
|
|
1040
1040
|
function Companion_0() {
|
|
1041
1041
|
Companion_instance_3 = this;
|
|
1042
|
-
this.
|
|
1042
|
+
this.w20_1 = setOf(['abstract', 'continue', 'for', 'new', 'switch', 'assert', 'default', 'goto', 'package', 'synchronized', 'boolean', 'do', 'if', 'private', 'this', 'break', 'double', 'implements', 'protected', 'throw', 'byte', 'else', 'import', 'public', 'throws', 'case', 'enum', 'instanceof', 'return', 'transient', 'catch', 'extends', 'int', 'short', 'try', 'char', 'final', 'interface', 'static', 'void', 'class', 'finally', 'long', 'strictfp', 'volatile', 'const', 'float', 'native', 'super', 'while', 'true', 'false']);
|
|
1043
1043
|
}
|
|
1044
1044
|
var Companion_instance_3;
|
|
1045
1045
|
function Companion_getInstance_1() {
|
|
@@ -1051,10 +1051,10 @@ function JavaIrEmitter$sanitizationConfig$lambda(it) {
|
|
|
1051
1051
|
return '_' + it;
|
|
1052
1052
|
}
|
|
1053
1053
|
function JavaIrEmitter$sanitizationConfig$lambda_0(name) {
|
|
1054
|
-
return name.
|
|
1054
|
+
return name.w1k_1.b1() > 1 ? new Name(listOf(name.b1q())) : name;
|
|
1055
1055
|
}
|
|
1056
1056
|
function JavaIrEmitter$sanitizationConfig$lambda_1(name) {
|
|
1057
|
-
return new Name(listOf(name.
|
|
1057
|
+
return new Name(listOf(name.b1q()));
|
|
1058
1058
|
}
|
|
1059
1059
|
function JavaIrEmitter$sanitizationConfig$lambda_2(this$0) {
|
|
1060
1060
|
return function (it) {
|
|
@@ -1065,23 +1065,23 @@ function JavaIrEmitter$sanitizationConfig$lambda_3(stmt, tr) {
|
|
|
1065
1065
|
var tmp;
|
|
1066
1066
|
var tmp_0;
|
|
1067
1067
|
if (stmt instanceof FunctionCall) {
|
|
1068
|
-
tmp_0 = stmt.
|
|
1068
|
+
tmp_0 = stmt.l1q_1.u1m() === 'validate';
|
|
1069
1069
|
} else {
|
|
1070
1070
|
tmp_0 = false;
|
|
1071
1071
|
}
|
|
1072
1072
|
if (tmp_0) {
|
|
1073
|
-
tmp = transformChildren(stmt.
|
|
1073
|
+
tmp = transformChildren(stmt.p1q(VOID, emptyList()), tr);
|
|
1074
1074
|
} else {
|
|
1075
1075
|
tmp = transformChildren(stmt, tr);
|
|
1076
1076
|
}
|
|
1077
1077
|
return tmp;
|
|
1078
1078
|
}
|
|
1079
1079
|
function JavaIrEmitter$emitShared$lambda(name) {
|
|
1080
|
-
switch (name.
|
|
1080
|
+
switch (name.u1m()) {
|
|
1081
1081
|
case 'client':
|
|
1082
|
-
return Companion_getInstance().
|
|
1082
|
+
return Companion_getInstance().y1k('getClient');
|
|
1083
1083
|
case 'server':
|
|
1084
|
-
return Companion_getInstance().
|
|
1084
|
+
return Companion_getInstance().y1k('getServer');
|
|
1085
1085
|
default:
|
|
1086
1086
|
return null;
|
|
1087
1087
|
}
|
|
@@ -1091,22 +1091,22 @@ function JavaIrEmitter$emitShared$lambda_0($imports) {
|
|
|
1091
1091
|
var tmp;
|
|
1092
1092
|
if (element instanceof File) {
|
|
1093
1093
|
// Inline function 'kotlin.collections.partition' call
|
|
1094
|
-
var this_0 = element.
|
|
1094
|
+
var this_0 = element.h1r_1;
|
|
1095
1095
|
var first = ArrayList_init_$Create$();
|
|
1096
1096
|
var second = ArrayList_init_$Create$();
|
|
1097
1097
|
var _iterator__ex2g4s = this_0.t();
|
|
1098
1098
|
while (_iterator__ex2g4s.u()) {
|
|
1099
1099
|
var element_0 = _iterator__ex2g4s.v();
|
|
1100
1100
|
if (element_0 instanceof Package) {
|
|
1101
|
-
first.
|
|
1101
|
+
first.y(element_0);
|
|
1102
1102
|
} else {
|
|
1103
|
-
second.
|
|
1103
|
+
second.y(element_0);
|
|
1104
1104
|
}
|
|
1105
1105
|
}
|
|
1106
1106
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1107
|
-
var packageElements = _destruct__k2r9zo.
|
|
1108
|
-
var rest = _destruct__k2r9zo.
|
|
1109
|
-
tmp = element.
|
|
1107
|
+
var packageElements = _destruct__k2r9zo.mf();
|
|
1108
|
+
var rest = _destruct__k2r9zo.nf();
|
|
1109
|
+
tmp = element.k1r(VOID, plus_1(plus_1(packageElements, $imports), rest));
|
|
1110
1110
|
} else {
|
|
1111
1111
|
tmp = element;
|
|
1112
1112
|
}
|
|
@@ -1118,11 +1118,11 @@ function JavaIrEmitter$emitShared$lambda_1($clientServer) {
|
|
|
1118
1118
|
return function (element, transformer) {
|
|
1119
1119
|
var tmp;
|
|
1120
1120
|
if (element instanceof Namespace) {
|
|
1121
|
-
var injected = element.
|
|
1121
|
+
var injected = element.m1r_1.equals(Companion_getInstance().y1k('Wirespec')) ? $clientServer : emptyList();
|
|
1122
1122
|
var tmp_0;
|
|
1123
1123
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1124
1124
|
if (!injected.r()) {
|
|
1125
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1125
|
+
tmp_0 = withElements(element, plus_1(element.i1r(), injected));
|
|
1126
1126
|
} else {
|
|
1127
1127
|
tmp_0 = element;
|
|
1128
1128
|
}
|
|
@@ -1147,7 +1147,7 @@ function JavaIrEmitter$emitGenerator$lambda_1(it) {
|
|
|
1147
1147
|
}
|
|
1148
1148
|
function JavaIrEmitter$emitGenerator$lambda_2(this$0) {
|
|
1149
1149
|
return function (it) {
|
|
1150
|
-
return import_0(this$0.
|
|
1150
|
+
return import_0(this$0.d20().ov_1 + '.model', it);
|
|
1151
1151
|
};
|
|
1152
1152
|
}
|
|
1153
1153
|
function JavaIrEmitter$emit$lambda(this$0) {
|
|
@@ -1159,38 +1159,38 @@ function JavaIrEmitter$emit$lambda_0(it) {
|
|
|
1159
1159
|
return listOf(function_0('label', VOID, VOID, JavaIrEmitter$emit$lambda$lambda));
|
|
1160
1160
|
}
|
|
1161
1161
|
function JavaIrEmitter$emit$lambda$lambda($this$function) {
|
|
1162
|
-
$this$function.
|
|
1163
|
-
$this$function.
|
|
1162
|
+
$this$function.m1l(String_instance);
|
|
1163
|
+
$this$function.n1l(new VariableReference(Companion_getInstance().y1k('label')));
|
|
1164
1164
|
return Unit_instance;
|
|
1165
1165
|
}
|
|
1166
1166
|
function JavaIrEmitter(packageName, emitShared) {
|
|
1167
1167
|
Companion_getInstance_1();
|
|
1168
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
1169
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
1170
|
-
this.
|
|
1171
|
-
this.
|
|
1172
|
-
this.
|
|
1173
|
-
this.
|
|
1174
|
-
this.
|
|
1168
|
+
packageName = packageName === VOID ? Companion_instance.nv('community.flock.wirespec.generated') : packageName;
|
|
1169
|
+
emitShared = emitShared === VOID ? Companion_instance_0.hs() : emitShared;
|
|
1170
|
+
this.x20_1 = packageName;
|
|
1171
|
+
this.y20_1 = emitShared;
|
|
1172
|
+
this.z20_1 = JavaGenerator_getInstance();
|
|
1173
|
+
this.a21_1 = FileExtension_Java_getInstance();
|
|
1174
|
+
this.b21_1 = listOf(import_0('community.flock.wirespec.java', 'Wirespec'));
|
|
1175
1175
|
var tmp = this;
|
|
1176
|
-
var tmp_0 = Companion_getInstance_1().
|
|
1176
|
+
var tmp_0 = Companion_getInstance_1().w20_1;
|
|
1177
1177
|
var tmp_1 = JavaIrEmitter$sanitizationConfig$lambda;
|
|
1178
1178
|
var tmp_2 = JavaIrEmitter$sanitizationConfig$lambda_0;
|
|
1179
1179
|
var tmp_3 = JavaIrEmitter$sanitizationConfig$lambda_1;
|
|
1180
1180
|
var tmp_4 = JavaIrEmitter$sanitizationConfig$lambda_2(this);
|
|
1181
|
-
tmp.
|
|
1181
|
+
tmp.c21_1 = new SanitizationConfig(tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, JavaIrEmitter$sanitizationConfig$lambda_3);
|
|
1182
1182
|
}
|
|
1183
|
-
protoOf(JavaIrEmitter).
|
|
1184
|
-
return this.
|
|
1183
|
+
protoOf(JavaIrEmitter).d20 = function () {
|
|
1184
|
+
return this.x20_1;
|
|
1185
1185
|
};
|
|
1186
|
-
protoOf(JavaIrEmitter).
|
|
1187
|
-
return this.
|
|
1186
|
+
protoOf(JavaIrEmitter).e1z = function () {
|
|
1187
|
+
return this.z20_1;
|
|
1188
1188
|
};
|
|
1189
|
-
protoOf(JavaIrEmitter).
|
|
1190
|
-
return this.
|
|
1189
|
+
protoOf(JavaIrEmitter).fu = function () {
|
|
1190
|
+
return this.a21_1;
|
|
1191
1191
|
};
|
|
1192
|
-
protoOf(JavaIrEmitter).
|
|
1193
|
-
var packageName = Companion_instance.
|
|
1192
|
+
protoOf(JavaIrEmitter).h1z = function () {
|
|
1193
|
+
var packageName = Companion_instance.nv('community.flock.wirespec.java');
|
|
1194
1194
|
var imports = listOf_0([import_0('java.lang.reflect', 'Type'), import_0('java.lang.reflect', 'ParameterizedType'), import_0('java.util', 'List'), import_0('java.util', 'Map')]);
|
|
1195
1195
|
// Inline function 'kotlin.collections.map' call
|
|
1196
1196
|
var this_0 = convertClientServer(packageName);
|
|
@@ -1200,7 +1200,7 @@ protoOf(JavaIrEmitter).v1v = function () {
|
|
|
1200
1200
|
while (_iterator__ex2g4s.u()) {
|
|
1201
1201
|
var item = _iterator__ex2g4s.v();
|
|
1202
1202
|
var tmp$ret$0 = toGetterAccessors(item, JavaIrEmitter$emitShared$lambda);
|
|
1203
|
-
destination.
|
|
1203
|
+
destination.y(tmp$ret$0);
|
|
1204
1204
|
}
|
|
1205
1205
|
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}'));
|
|
1206
1206
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -1209,49 +1209,49 @@ protoOf(JavaIrEmitter).v1v = function () {
|
|
|
1209
1209
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1210
1210
|
var tmp = scope;
|
|
1211
1211
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1212
|
-
var this_2 = scope.
|
|
1212
|
+
var this_2 = scope.r1y_1;
|
|
1213
1213
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1214
1214
|
// Inline function 'kotlin.apply' call
|
|
1215
1215
|
var this_3 = new TransformerBuilder();
|
|
1216
|
-
this_3.
|
|
1217
|
-
var tmp$ret$5 = this_3.
|
|
1218
|
-
tmp.
|
|
1216
|
+
this_3.i1m(JavaIrEmitter$emitShared$lambda_0(imports));
|
|
1217
|
+
var tmp$ret$5 = this_3.j1m();
|
|
1218
|
+
tmp.r1y_1 = transform(this_2, tmp$ret$5);
|
|
1219
1219
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1220
1220
|
var tmp_0 = scope;
|
|
1221
1221
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1222
1222
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1223
|
-
var this_4 = scope.
|
|
1223
|
+
var this_4 = scope.r1y_1;
|
|
1224
1224
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1225
1225
|
// Inline function 'kotlin.apply' call
|
|
1226
1226
|
var this_5 = new TransformerBuilder();
|
|
1227
|
-
this_5.
|
|
1228
|
-
var tmp$ret$10 = this_5.
|
|
1229
|
-
tmp_0.
|
|
1230
|
-
var tmp_1 = scope.
|
|
1227
|
+
this_5.i1m(JavaIrEmitter$emitShared$lambda_1(clientServer));
|
|
1228
|
+
var tmp$ret$10 = this_5.j1m();
|
|
1229
|
+
tmp_0.r1y_1 = transform(this_4, tmp$ret$10);
|
|
1230
|
+
var tmp_1 = scope.r1y_1;
|
|
1231
1231
|
var wirespecShared = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1232
1232
|
var tmp_2;
|
|
1233
|
-
if (this.
|
|
1233
|
+
if (this.y20_1.is_1) {
|
|
1234
1234
|
tmp_2 = wirespecShared;
|
|
1235
1235
|
} else {
|
|
1236
1236
|
tmp_2 = null;
|
|
1237
1237
|
}
|
|
1238
1238
|
return tmp_2;
|
|
1239
1239
|
};
|
|
1240
|
-
protoOf(JavaIrEmitter).
|
|
1240
|
+
protoOf(JavaIrEmitter).wu = function (definition, module_0, logger) {
|
|
1241
1241
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1242
|
-
var tmp = file.
|
|
1242
|
+
var tmp = file.k1r(Companion_getInstance().y1k(sanitizeSymbol_0(this, file.g1r_1.z1k())));
|
|
1243
1243
|
// Inline function 'kotlin.takeIf' call
|
|
1244
|
-
var this_0 = this.
|
|
1244
|
+
var this_0 = this.b21_1;
|
|
1245
1245
|
var tmp_0;
|
|
1246
|
-
if (Companion_instance_1.
|
|
1246
|
+
if (Companion_instance_1.su(module_0)) {
|
|
1247
1247
|
tmp_0 = this_0;
|
|
1248
1248
|
} else {
|
|
1249
1249
|
tmp_0 = null;
|
|
1250
1250
|
}
|
|
1251
1251
|
var tmp$ret$1 = tmp_0;
|
|
1252
|
-
return placeInPackage(prependImports(tmp, tmp$ret$1), this.
|
|
1252
|
+
return placeInPackage(prependImports(tmp, tmp$ret$1), this.d20(), definition);
|
|
1253
1253
|
};
|
|
1254
|
-
protoOf(JavaIrEmitter).
|
|
1254
|
+
protoOf(JavaIrEmitter).l1z = function (definition, module_0) {
|
|
1255
1255
|
var tmp;
|
|
1256
1256
|
if (definition instanceof Type) {
|
|
1257
1257
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1271,33 +1271,33 @@ protoOf(JavaIrEmitter).z1v = function (definition, module_0) {
|
|
|
1271
1271
|
}
|
|
1272
1272
|
}
|
|
1273
1273
|
var generatorFile = tmp;
|
|
1274
|
-
var sanitized = sanitizeNames(generatorFile, this.
|
|
1275
|
-
var generatorOwnName = definition.
|
|
1274
|
+
var sanitized = sanitizeNames(generatorFile, this.c21_1);
|
|
1275
|
+
var generatorOwnName = definition.xu().m1() + 'Generator';
|
|
1276
1276
|
var tmp_0 = asSequence_0(collectCustomTypeNames(sanitized));
|
|
1277
1277
|
var tmp_1 = filterNot(tmp_0, JavaIrEmitter$emitGenerator$lambda);
|
|
1278
1278
|
var tmp_2 = filterNot(tmp_1, JavaIrEmitter$emitGenerator$lambda_0(generatorOwnName));
|
|
1279
1279
|
var tmp_3 = distinct_0(map(tmp_2, JavaIrEmitter$emitGenerator$lambda_1));
|
|
1280
1280
|
var modelImports = toList(map(tmp_3, JavaIrEmitter$emitGenerator$lambda_2(this)));
|
|
1281
|
-
return placeInPackage_0(prependImports(sanitized, plus_1(this.
|
|
1281
|
+
return placeInPackage_0(prependImports(sanitized, plus_1(this.b21_1, modelImports)), this.d20(), 'generator');
|
|
1282
1282
|
};
|
|
1283
|
-
protoOf(JavaIrEmitter).
|
|
1284
|
-
return sanitizeNames(convertWithValidation(type, module_0), this.
|
|
1283
|
+
protoOf(JavaIrEmitter).vt = function (type, module_0) {
|
|
1284
|
+
return sanitizeNames(convertWithValidation(type, module_0), this.c21_1);
|
|
1285
1285
|
};
|
|
1286
|
-
protoOf(JavaIrEmitter).
|
|
1286
|
+
protoOf(JavaIrEmitter).kv = function (enum_0, module_0) {
|
|
1287
1287
|
var tmp = convert_0(enum_0);
|
|
1288
1288
|
var tmp_0 = JavaIrEmitter$emit$lambda(this);
|
|
1289
|
-
return sanitizeNames(injectEnumLabelField(tmp, tmp_0, JavaIrEmitter$emit$lambda_0), this.
|
|
1289
|
+
return sanitizeNames(injectEnumLabelField(tmp, tmp_0, JavaIrEmitter$emit$lambda_0), this.c21_1);
|
|
1290
1290
|
};
|
|
1291
|
-
protoOf(JavaIrEmitter).
|
|
1292
|
-
return sanitizeNames(convert_1(union), this.
|
|
1291
|
+
protoOf(JavaIrEmitter).av = function (union) {
|
|
1292
|
+
return sanitizeNames(convert_1(union), this.c21_1);
|
|
1293
1293
|
};
|
|
1294
|
-
protoOf(JavaIrEmitter).
|
|
1295
|
-
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.
|
|
1294
|
+
protoOf(JavaIrEmitter).fv = function (refined) {
|
|
1295
|
+
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.c21_1);
|
|
1296
1296
|
};
|
|
1297
|
-
protoOf(JavaIrEmitter).
|
|
1298
|
-
var tmp = sanitizeNames(transformTypeDescriptors(injectApiField(injectHandleFunction(convert_3(endpoint), endpoint))), this.
|
|
1297
|
+
protoOf(JavaIrEmitter).lv = function (endpoint) {
|
|
1298
|
+
var tmp = sanitizeNames(transformTypeDescriptors(injectApiField(injectHandleFunction(convert_3(endpoint), endpoint))), this.c21_1);
|
|
1299
1299
|
// Inline function 'kotlin.takeIf' call
|
|
1300
|
-
var this_0 = buildModelImports(endpoint, this.
|
|
1300
|
+
var this_0 = buildModelImports(endpoint, this.d20());
|
|
1301
1301
|
var tmp_0;
|
|
1302
1302
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1303
1303
|
if (!this_0.r()) {
|
|
@@ -1308,25 +1308,25 @@ protoOf(JavaIrEmitter).as = function (endpoint) {
|
|
|
1308
1308
|
var tmp$ret$2 = tmp_0;
|
|
1309
1309
|
return prependImports(tmp, tmp$ret$2);
|
|
1310
1310
|
};
|
|
1311
|
-
protoOf(JavaIrEmitter).
|
|
1311
|
+
protoOf(JavaIrEmitter).zu = function (channel) {
|
|
1312
1312
|
var tmp;
|
|
1313
|
-
if (channel.
|
|
1314
|
-
tmp = this.
|
|
1313
|
+
if (channel.ns_1.m1() === channel.os_1.m1()) {
|
|
1314
|
+
tmp = this.d20().ov_1 + '.model.';
|
|
1315
1315
|
} else {
|
|
1316
1316
|
tmp = '';
|
|
1317
1317
|
}
|
|
1318
1318
|
var fullyQualifiedPrefix = tmp;
|
|
1319
|
-
return applyFunctionalInterface(sanitizeNames(convert_4(channel), this.
|
|
1319
|
+
return applyFunctionalInterface(sanitizeNames(convert_4(channel), this.c21_1), fullyQualifiedPrefix);
|
|
1320
1320
|
};
|
|
1321
|
-
protoOf(JavaIrEmitter).
|
|
1322
|
-
var imports = buildModelImports(endpoint, this.
|
|
1323
|
-
var endpointImport = import_0(this.
|
|
1324
|
-
var endpointName = endpoint.
|
|
1325
|
-
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.
|
|
1326
|
-
var subPackageName = plus_0(this.
|
|
1327
|
-
return new File(Companion_getInstance().
|
|
1321
|
+
protoOf(JavaIrEmitter).k1z = function (endpoint) {
|
|
1322
|
+
var imports = buildModelImports(endpoint, this.d20());
|
|
1323
|
+
var endpointImport = import_0(this.d20().ov_1 + '.endpoint', endpoint.ft_1.m1());
|
|
1324
|
+
var endpointName = endpoint.ft_1.m1();
|
|
1325
|
+
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.c21_1)), endpointName);
|
|
1326
|
+
var subPackageName = plus_0(this.d20(), 'client');
|
|
1327
|
+
return new File(Companion_getInstance().y1k(subPackageName.qv() + sanitizeSymbol_0(this, file.g1r_1.z1k())), plus_1(plus_1(plus_1(plus_1(listOf(new Package(subPackageName.ov_1)), this.b21_1), imports), listOf(endpointImport)), file.h1r_1));
|
|
1328
1328
|
};
|
|
1329
|
-
protoOf(JavaIrEmitter).
|
|
1329
|
+
protoOf(JavaIrEmitter).i1z = function (endpoints, logger) {
|
|
1330
1330
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1331
1331
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1332
1332
|
var destination = ArrayList_init_$Create$();
|
|
@@ -1342,9 +1342,9 @@ protoOf(JavaIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1342
1342
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1343
1343
|
while (_iterator__ex2g4s_0.u()) {
|
|
1344
1344
|
var e = _iterator__ex2g4s_0.v();
|
|
1345
|
-
var key = e.
|
|
1346
|
-
if (set.
|
|
1347
|
-
list_0.
|
|
1345
|
+
var key = e.my_1;
|
|
1346
|
+
if (set.y(key)) {
|
|
1347
|
+
list_0.y(e);
|
|
1348
1348
|
}
|
|
1349
1349
|
}
|
|
1350
1350
|
// Inline function 'kotlin.collections.filter' call
|
|
@@ -1369,7 +1369,7 @@ protoOf(JavaIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1369
1369
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1370
1370
|
while (_iterator__ex2g4s_2.u()) {
|
|
1371
1371
|
var element_1 = _iterator__ex2g4s_2.v();
|
|
1372
|
-
if (element_1.
|
|
1372
|
+
if (element_1.ft_1.m1() === element_0.my_1) {
|
|
1373
1373
|
tmp$ret$5 = false;
|
|
1374
1374
|
break $l$block_0;
|
|
1375
1375
|
}
|
|
@@ -1377,7 +1377,7 @@ protoOf(JavaIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1377
1377
|
tmp$ret$5 = true;
|
|
1378
1378
|
}
|
|
1379
1379
|
if (tmp$ret$5) {
|
|
1380
|
-
destination_0.
|
|
1380
|
+
destination_0.y(element_0);
|
|
1381
1381
|
}
|
|
1382
1382
|
}
|
|
1383
1383
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1386,8 +1386,8 @@ protoOf(JavaIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1386
1386
|
var _iterator__ex2g4s_3 = destination_0.t();
|
|
1387
1387
|
while (_iterator__ex2g4s_3.u()) {
|
|
1388
1388
|
var item = _iterator__ex2g4s_3.v();
|
|
1389
|
-
var tmp$ret$10 = import_0(this.
|
|
1390
|
-
destination_1.
|
|
1389
|
+
var tmp$ret$10 = import_0(this.d20().ov_1 + '.model', item.my_1);
|
|
1390
|
+
destination_1.y(tmp$ret$10);
|
|
1391
1391
|
}
|
|
1392
1392
|
var imports = destination_1;
|
|
1393
1393
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1396,8 +1396,8 @@ protoOf(JavaIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1396
1396
|
var _iterator__ex2g4s_4 = endpoints.t();
|
|
1397
1397
|
while (_iterator__ex2g4s_4.u()) {
|
|
1398
1398
|
var item_0 = _iterator__ex2g4s_4.v();
|
|
1399
|
-
var tmp$ret$13 = import_0(this.
|
|
1400
|
-
destination_2.
|
|
1399
|
+
var tmp$ret$13 = import_0(this.d20().ov_1 + '.endpoint', item_0.ft_1.m1());
|
|
1400
|
+
destination_2.y(tmp$ret$13);
|
|
1401
1401
|
}
|
|
1402
1402
|
var endpointImports = destination_2;
|
|
1403
1403
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1406,19 +1406,19 @@ protoOf(JavaIrEmitter).w1v = function (endpoints, logger) {
|
|
|
1406
1406
|
var _iterator__ex2g4s_5 = endpoints.t();
|
|
1407
1407
|
while (_iterator__ex2g4s_5.u()) {
|
|
1408
1408
|
var item_1 = _iterator__ex2g4s_5.v();
|
|
1409
|
-
var tmp$ret$16 = import_0(this.
|
|
1410
|
-
destination_3.
|
|
1409
|
+
var tmp$ret$16 = import_0(this.d20().ov_1 + '.client', item_1.ft_1.m1() + 'Client');
|
|
1410
|
+
destination_3.y(tmp$ret$16);
|
|
1411
1411
|
}
|
|
1412
1412
|
var clientImports = destination_3;
|
|
1413
1413
|
var allImports = plus_1(plus_1(imports, endpointImports), clientImports);
|
|
1414
|
-
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.
|
|
1415
|
-
return new File(Companion_getInstance().
|
|
1414
|
+
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.c21_1);
|
|
1415
|
+
return new File(Companion_getInstance().y1k(this.d20().qv() + sanitizeSymbol_0(this, file.g1r_1.z1k())), plus_1(plus_1(plus_1(listOf(new Package(this.d20().ov_1)), this.b21_1), allImports), file.h1r_1));
|
|
1416
1416
|
};
|
|
1417
1417
|
function transformTypeDescriptors(_this__u8e3s4) {
|
|
1418
1418
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1419
1419
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1420
|
-
scope.
|
|
1421
|
-
var tmp = scope.
|
|
1420
|
+
scope.a1z(transformTypeDescriptors$lambda);
|
|
1421
|
+
var tmp = scope.r1y_1;
|
|
1422
1422
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1423
1423
|
}
|
|
1424
1424
|
function applyRefinedStructShape(_this__u8e3s4, refined) {
|
|
@@ -1427,14 +1427,14 @@ function applyRefinedStructShape(_this__u8e3s4, refined) {
|
|
|
1427
1427
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1428
1428
|
var tmp = scope;
|
|
1429
1429
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1430
|
-
var this_0 = scope.
|
|
1430
|
+
var this_0 = scope.r1y_1;
|
|
1431
1431
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1432
1432
|
// Inline function 'kotlin.apply' call
|
|
1433
1433
|
var this_1 = new TransformerBuilder();
|
|
1434
|
-
this_1.
|
|
1435
|
-
var tmp$ret$2 = this_1.
|
|
1436
|
-
tmp.
|
|
1437
|
-
var tmp_0 = scope.
|
|
1434
|
+
this_1.i1m(applyRefinedStructShape$lambda(refined));
|
|
1435
|
+
var tmp$ret$2 = this_1.j1m();
|
|
1436
|
+
tmp.r1y_1 = transform(this_0, tmp$ret$2);
|
|
1437
|
+
var tmp_0 = scope.r1y_1;
|
|
1438
1438
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1439
1439
|
}
|
|
1440
1440
|
function injectApiField(_this__u8e3s4) {
|
|
@@ -1444,14 +1444,14 @@ function injectApiField(_this__u8e3s4) {
|
|
|
1444
1444
|
var tmp = scope;
|
|
1445
1445
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1446
1446
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1447
|
-
var this_0 = scope.
|
|
1447
|
+
var this_0 = scope.r1y_1;
|
|
1448
1448
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1449
1449
|
// Inline function 'kotlin.apply' call
|
|
1450
1450
|
var this_1 = new TransformerBuilder();
|
|
1451
|
-
this_1.
|
|
1452
|
-
var tmp$ret$2 = this_1.
|
|
1453
|
-
tmp.
|
|
1454
|
-
var tmp_0 = scope.
|
|
1451
|
+
this_1.i1m(injectApiField$lambda);
|
|
1452
|
+
var tmp$ret$2 = this_1.j1m();
|
|
1453
|
+
tmp.r1y_1 = transform(this_0, tmp$ret$2);
|
|
1454
|
+
var tmp_0 = scope.r1y_1;
|
|
1455
1455
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1456
1456
|
}
|
|
1457
1457
|
function injectHandleFunction(_this__u8e3s4, endpoint) {
|
|
@@ -1461,14 +1461,14 @@ function injectHandleFunction(_this__u8e3s4, endpoint) {
|
|
|
1461
1461
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1462
1462
|
var tmp = scope;
|
|
1463
1463
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1464
|
-
var this_0 = scope.
|
|
1464
|
+
var this_0 = scope.r1y_1;
|
|
1465
1465
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1466
1466
|
// Inline function 'kotlin.apply' call
|
|
1467
1467
|
var this_1 = new TransformerBuilder();
|
|
1468
|
-
this_1.
|
|
1469
|
-
var tmp$ret$2 = this_1.
|
|
1470
|
-
tmp.
|
|
1471
|
-
var tmp_0 = scope.
|
|
1468
|
+
this_1.i1m(injectHandleFunction$lambda(handlersStruct));
|
|
1469
|
+
var tmp$ret$2 = this_1.j1m();
|
|
1470
|
+
tmp.r1y_1 = transform(this_0, tmp$ret$2);
|
|
1471
|
+
var tmp_0 = scope.r1y_1;
|
|
1472
1472
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1473
1473
|
}
|
|
1474
1474
|
function buildModelImports(_this__u8e3s4, packageName) {
|
|
@@ -1479,8 +1479,8 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1479
1479
|
var _iterator__ex2g4s = tmp0.t();
|
|
1480
1480
|
while (_iterator__ex2g4s.u()) {
|
|
1481
1481
|
var element = _iterator__ex2g4s.v();
|
|
1482
|
-
if (!(_this__u8e3s4.
|
|
1483
|
-
destination.
|
|
1482
|
+
if (!(_this__u8e3s4.xu().m1() === element.my_1)) {
|
|
1483
|
+
destination.y(element);
|
|
1484
1484
|
}
|
|
1485
1485
|
}
|
|
1486
1486
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1489,8 +1489,8 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1489
1489
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1490
1490
|
while (_iterator__ex2g4s_0.u()) {
|
|
1491
1491
|
var item = _iterator__ex2g4s_0.v();
|
|
1492
|
-
var tmp$ret$3 = import_0(packageName.
|
|
1493
|
-
destination_0.
|
|
1492
|
+
var tmp$ret$3 = import_0(packageName.ov_1 + '.model', Companion_getInstance().y1k(item.my_1).z1k());
|
|
1493
|
+
destination_0.y(tmp$ret$3);
|
|
1494
1494
|
}
|
|
1495
1495
|
return destination_0;
|
|
1496
1496
|
}
|
|
@@ -1500,24 +1500,24 @@ function applyFunctionalInterface(_this__u8e3s4, fullyQualifiedPrefix) {
|
|
|
1500
1500
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1501
1501
|
var tmp = scope;
|
|
1502
1502
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1503
|
-
var this_0 = scope.
|
|
1503
|
+
var this_0 = scope.r1y_1;
|
|
1504
1504
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1505
1505
|
// Inline function 'kotlin.apply' call
|
|
1506
1506
|
var this_1 = new TransformerBuilder();
|
|
1507
|
-
this_1.
|
|
1508
|
-
var tmp$ret$2 = this_1.
|
|
1509
|
-
tmp.
|
|
1507
|
+
this_1.i1m(applyFunctionalInterface$lambda(fullyQualifiedPrefix));
|
|
1508
|
+
var tmp$ret$2 = this_1.j1m();
|
|
1509
|
+
tmp.r1y_1 = transform(this_0, tmp$ret$2);
|
|
1510
1510
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1511
1511
|
var tmp_0 = scope;
|
|
1512
1512
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1513
|
-
var this_2 = scope.
|
|
1513
|
+
var this_2 = scope.r1y_1;
|
|
1514
1514
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1515
1515
|
// Inline function 'kotlin.apply' call
|
|
1516
1516
|
var this_3 = new TransformerBuilder();
|
|
1517
|
-
this_3.
|
|
1518
|
-
var tmp$ret$7 = this_3.
|
|
1519
|
-
tmp_0.
|
|
1520
|
-
var tmp_1 = scope.
|
|
1517
|
+
this_3.i1m(applyFunctionalInterface$lambda_0);
|
|
1518
|
+
var tmp$ret$7 = this_3.j1m();
|
|
1519
|
+
tmp_0.r1y_1 = transform(this_2, tmp$ret$7);
|
|
1520
|
+
var tmp_1 = scope.r1y_1;
|
|
1521
1521
|
return isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1522
1522
|
}
|
|
1523
1523
|
function wrapAsyncReturnInThenApply(_this__u8e3s4, endpointName) {
|
|
@@ -1526,26 +1526,26 @@ function wrapAsyncReturnInThenApply(_this__u8e3s4, endpointName) {
|
|
|
1526
1526
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1527
1527
|
var tmp = scope;
|
|
1528
1528
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1529
|
-
var this_0 = scope.
|
|
1529
|
+
var this_0 = scope.r1y_1;
|
|
1530
1530
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1531
1531
|
// Inline function 'kotlin.apply' call
|
|
1532
1532
|
var this_1 = new TransformerBuilder();
|
|
1533
|
-
this_1.
|
|
1534
|
-
var tmp$ret$2 = this_1.
|
|
1535
|
-
tmp.
|
|
1536
|
-
var tmp_0 = scope.
|
|
1533
|
+
this_1.i1m(wrapAsyncReturnInThenApply$lambda(endpointName));
|
|
1534
|
+
var tmp$ret$2 = this_1.j1m();
|
|
1535
|
+
tmp.r1y_1 = transform(this_0, tmp$ret$2);
|
|
1536
|
+
var tmp_0 = scope.r1y_1;
|
|
1537
1537
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1538
1538
|
}
|
|
1539
1539
|
function findRoot(_this__u8e3s4) {
|
|
1540
1540
|
var tmp;
|
|
1541
1541
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
1542
|
-
tmp = findRoot(_this__u8e3s4.
|
|
1542
|
+
tmp = findRoot(_this__u8e3s4.q1m_1);
|
|
1543
1543
|
} else {
|
|
1544
1544
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
1545
|
-
tmp = findRoot(_this__u8e3s4.
|
|
1545
|
+
tmp = findRoot(_this__u8e3s4.r1m_1);
|
|
1546
1546
|
} else {
|
|
1547
1547
|
if (_this__u8e3s4 instanceof Dict_0) {
|
|
1548
|
-
tmp = findRoot(_this__u8e3s4.
|
|
1548
|
+
tmp = findRoot(_this__u8e3s4.u1q_1);
|
|
1549
1549
|
} else {
|
|
1550
1550
|
tmp = _this__u8e3s4;
|
|
1551
1551
|
}
|
|
@@ -1574,7 +1574,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1574
1574
|
var tmp;
|
|
1575
1575
|
if (_this__u8e3s4 instanceof Integer_0) {
|
|
1576
1576
|
var tmp_0;
|
|
1577
|
-
switch (_this__u8e3s4.
|
|
1577
|
+
switch (_this__u8e3s4.q1q_1.c3_1) {
|
|
1578
1578
|
case 0:
|
|
1579
1579
|
tmp_0 = 'Integer';
|
|
1580
1580
|
break;
|
|
@@ -1589,7 +1589,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1589
1589
|
} else {
|
|
1590
1590
|
if (_this__u8e3s4 instanceof Number_1) {
|
|
1591
1591
|
var tmp_1;
|
|
1592
|
-
switch (_this__u8e3s4.
|
|
1592
|
+
switch (_this__u8e3s4.r1q_1.c3_1) {
|
|
1593
1593
|
case 0:
|
|
1594
1594
|
tmp_1 = 'Float';
|
|
1595
1595
|
break;
|
|
@@ -1618,7 +1618,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1618
1618
|
tmp = 'Void';
|
|
1619
1619
|
} else {
|
|
1620
1620
|
if (_this__u8e3s4 instanceof Custom_0) {
|
|
1621
|
-
tmp = _this__u8e3s4.
|
|
1621
|
+
tmp = _this__u8e3s4.s1m_1.z1k();
|
|
1622
1622
|
} else {
|
|
1623
1623
|
tmp = 'Object';
|
|
1624
1624
|
}
|
|
@@ -1632,7 +1632,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1632
1632
|
return tmp;
|
|
1633
1633
|
}
|
|
1634
1634
|
function buildHandlersStruct(_this__u8e3s4) {
|
|
1635
|
-
var pathTemplate = '/' + joinToString(_this__u8e3s4.
|
|
1635
|
+
var pathTemplate = '/' + joinToString(_this__u8e3s4.ht_1, '/', VOID, VOID, VOID, VOID, buildHandlersStruct$lambda);
|
|
1636
1636
|
return struct('Handlers', buildHandlersStruct$lambda_0(pathTemplate, _this__u8e3s4));
|
|
1637
1637
|
}
|
|
1638
1638
|
function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
@@ -1642,8 +1642,8 @@ function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
|
1642
1642
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1643
1643
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1644
1644
|
var tmp_0 = withFullyQualifiedPrefix$lambda;
|
|
1645
|
-
scope.
|
|
1646
|
-
var tmp_1 = scope.
|
|
1645
|
+
scope.u1y(tmp_0, withFullyQualifiedPrefix$lambda_0(prefix));
|
|
1646
|
+
var tmp_1 = scope.r1y_1;
|
|
1647
1647
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1648
1648
|
} else {
|
|
1649
1649
|
tmp = _this__u8e3s4;
|
|
@@ -1653,8 +1653,8 @@ function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
|
1653
1653
|
function transformTypeDescriptors$lambda(stmt, tr) {
|
|
1654
1654
|
var tmp;
|
|
1655
1655
|
if (stmt instanceof TypeDescriptor) {
|
|
1656
|
-
var rootType = findRoot(stmt.
|
|
1657
|
-
var containerStr = rawContainerClass(stmt.
|
|
1656
|
+
var rootType = findRoot(stmt.w1s_1);
|
|
1657
|
+
var containerStr = rawContainerClass(stmt.w1s_1);
|
|
1658
1658
|
var rootStr = toJavaName(rootType) + '.class';
|
|
1659
1659
|
var tmp_0;
|
|
1660
1660
|
if (containerStr == null) {
|
|
@@ -1673,8 +1673,8 @@ function transformTypeDescriptors$lambda(stmt, tr) {
|
|
|
1673
1673
|
}
|
|
1674
1674
|
function applyRefinedStructShape$lambda$lambda($refined) {
|
|
1675
1675
|
return function ($this$function) {
|
|
1676
|
-
$this$function.
|
|
1677
|
-
$this$function.
|
|
1676
|
+
$this$function.m1l(convert_5($refined.ev_1));
|
|
1677
|
+
$this$function.n1l(new VariableReference(Companion_getInstance().y1k('value')));
|
|
1678
1678
|
return Unit_instance;
|
|
1679
1679
|
};
|
|
1680
1680
|
}
|
|
@@ -1684,18 +1684,18 @@ function applyRefinedStructShape$lambda($refined) {
|
|
|
1684
1684
|
if (element instanceof Struct) {
|
|
1685
1685
|
var tmp_0 = listOf(Custom_init_$Create$('Wirespec.Refined'));
|
|
1686
1686
|
// Inline function 'kotlin.collections.map' call
|
|
1687
|
-
var this_0 = element.
|
|
1687
|
+
var this_0 = element.v1r_1;
|
|
1688
1688
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1689
1689
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1690
1690
|
var _iterator__ex2g4s = this_0.t();
|
|
1691
1691
|
while (_iterator__ex2g4s.u()) {
|
|
1692
1692
|
var item = _iterator__ex2g4s.v();
|
|
1693
1693
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
1694
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1694
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.w1o(VOID, VOID, VOID, VOID, VOID, VOID, VOID, true);
|
|
1695
1695
|
var tmp$ret$0 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
1696
|
-
destination.
|
|
1696
|
+
destination.y(tmp$ret$0);
|
|
1697
1697
|
}
|
|
1698
|
-
var tmp_1 = element.
|
|
1698
|
+
var tmp_1 = element.y1r(VOID, VOID, VOID, tmp_0, destination);
|
|
1699
1699
|
tmp = plus_3(tmp_1, function_0('value', VOID, true, applyRefinedStructShape$lambda$lambda($refined)));
|
|
1700
1700
|
} else {
|
|
1701
1701
|
tmp = element;
|
|
@@ -1711,7 +1711,7 @@ function injectApiField$lambda(element, transformer) {
|
|
|
1711
1711
|
var tmp_0;
|
|
1712
1712
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1713
1713
|
if (!injected.r()) {
|
|
1714
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1714
|
+
tmp_0 = withElements(element, plus_1(element.i1r(), injected));
|
|
1715
1715
|
} else {
|
|
1716
1716
|
tmp_0 = element;
|
|
1717
1717
|
}
|
|
@@ -1730,7 +1730,7 @@ function injectHandleFunction$lambda$lambda($handlersStruct) {
|
|
|
1730
1730
|
var tmp_0;
|
|
1731
1731
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1732
1732
|
if (!injected.r()) {
|
|
1733
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1733
|
+
tmp_0 = withElements(element, plus_1(element.i1r(), injected));
|
|
1734
1734
|
} else {
|
|
1735
1735
|
tmp_0 = element;
|
|
1736
1736
|
}
|
|
@@ -1747,21 +1747,21 @@ function injectHandleFunction$lambda($handlersStruct) {
|
|
|
1747
1747
|
var tmp;
|
|
1748
1748
|
if (element instanceof Interface) {
|
|
1749
1749
|
var tmp_0;
|
|
1750
|
-
if (element.
|
|
1750
|
+
if (element.a1s_1.equals(Companion_getInstance().y1k('Handler'))) {
|
|
1751
1751
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1752
1752
|
var scope = new TransformScope(element);
|
|
1753
1753
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1754
1754
|
var tmp_1 = scope;
|
|
1755
1755
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1756
1756
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1757
|
-
var this_0 = scope.
|
|
1757
|
+
var this_0 = scope.r1y_1;
|
|
1758
1758
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1759
1759
|
// Inline function 'kotlin.apply' call
|
|
1760
1760
|
var this_1 = new TransformerBuilder();
|
|
1761
|
-
this_1.
|
|
1762
|
-
var tmp$ret$2 = this_1.
|
|
1763
|
-
tmp_1.
|
|
1764
|
-
var tmp_2 = scope.
|
|
1761
|
+
this_1.i1m(injectHandleFunction$lambda$lambda($handlersStruct));
|
|
1762
|
+
var tmp$ret$2 = this_1.j1m();
|
|
1763
|
+
tmp_1.r1y_1 = transform(this_0, tmp$ret$2);
|
|
1764
|
+
var tmp_2 = scope.r1y_1;
|
|
1765
1765
|
tmp_0 = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1766
1766
|
} else {
|
|
1767
1767
|
tmp_0 = element;
|
|
@@ -1791,19 +1791,19 @@ function applyFunctionalInterface$lambda_0(element, transformer) {
|
|
|
1791
1791
|
if (element instanceof File) {
|
|
1792
1792
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1793
1793
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1794
|
-
var tmp0 = element.
|
|
1794
|
+
var tmp0 = element.i1r();
|
|
1795
1795
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1796
1796
|
var destination = ArrayList_init_$Create$();
|
|
1797
1797
|
var _iterator__ex2g4s = tmp0.t();
|
|
1798
1798
|
while (_iterator__ex2g4s.u()) {
|
|
1799
1799
|
var element_0 = _iterator__ex2g4s.v();
|
|
1800
1800
|
if (element_0 instanceof Interface) {
|
|
1801
|
-
destination.
|
|
1801
|
+
destination.y(element_0);
|
|
1802
1802
|
}
|
|
1803
1803
|
}
|
|
1804
1804
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1805
1805
|
var interfaceElement = ensureNotNull(tmp$ret$2);
|
|
1806
|
-
tmp = element.
|
|
1806
|
+
tmp = element.k1r(VOID, listOf_0([new RawElement('@FunctionalInterface\n'), interfaceElement]));
|
|
1807
1807
|
} else {
|
|
1808
1808
|
tmp = element;
|
|
1809
1809
|
}
|
|
@@ -1816,11 +1816,11 @@ function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
|
1816
1816
|
if (element instanceof Function) {
|
|
1817
1817
|
var tmp$ret$0;
|
|
1818
1818
|
$l$block_1: {
|
|
1819
|
-
if (!element.
|
|
1819
|
+
if (!element.t1o_1 || element.s1o_1.b1() < 2) {
|
|
1820
1820
|
tmp$ret$0 = element;
|
|
1821
1821
|
break $l$block_1;
|
|
1822
1822
|
}
|
|
1823
|
-
var tmp_0 = element.
|
|
1823
|
+
var tmp_0 = element.s1o_1.c1(element.s1o_1.b1() - 2 | 0);
|
|
1824
1824
|
var tmp0_elvis_lhs = tmp_0 instanceof Assignment ? tmp_0 : null;
|
|
1825
1825
|
var tmp_1;
|
|
1826
1826
|
if (tmp0_elvis_lhs == null) {
|
|
@@ -1830,16 +1830,16 @@ function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
|
1830
1830
|
tmp_1 = tmp0_elvis_lhs;
|
|
1831
1831
|
}
|
|
1832
1832
|
var transportAssign = tmp_1;
|
|
1833
|
-
var tmp_2 = last(element.
|
|
1833
|
+
var tmp_2 = last(element.s1o_1);
|
|
1834
1834
|
if (!(tmp_2 instanceof ReturnStatement)) {
|
|
1835
1835
|
tmp$ret$0 = element;
|
|
1836
1836
|
break $l$block_1;
|
|
1837
1837
|
}
|
|
1838
|
-
var tmp_3 = dropLast(element.
|
|
1839
|
-
var tmp1_name = Companion_getInstance().
|
|
1840
|
-
var tmp2_receiver = transportAssign.
|
|
1841
|
-
var tmp3_arguments = mapOf(to(Companion_getInstance().
|
|
1842
|
-
tmp$ret$0 = element.
|
|
1838
|
+
var tmp_3 = dropLast(element.s1o_1, 2);
|
|
1839
|
+
var tmp1_name = Companion_getInstance().y1k('thenApply');
|
|
1840
|
+
var tmp2_receiver = transportAssign.z1s_1;
|
|
1841
|
+
var tmp3_arguments = mapOf(to(Companion_getInstance().y1k('mapper'), new RawExpression('rawResponse -> ' + $endpointName + '.fromRawResponse(serialization(), rawResponse)')));
|
|
1842
|
+
tmp$ret$0 = element.w1o(VOID, VOID, VOID, VOID, plus_2(tmp_3, new ReturnStatement(new FunctionCall(tmp2_receiver, VOID, tmp1_name, tmp3_arguments))));
|
|
1843
1843
|
}
|
|
1844
1844
|
tmp = tmp$ret$0;
|
|
1845
1845
|
} else {
|
|
@@ -1852,10 +1852,10 @@ function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
|
1852
1852
|
function buildHandlersStruct$lambda(it) {
|
|
1853
1853
|
var tmp;
|
|
1854
1854
|
if (it instanceof Literal) {
|
|
1855
|
-
tmp = it.
|
|
1855
|
+
tmp = it.iu_1;
|
|
1856
1856
|
} else {
|
|
1857
1857
|
if (it instanceof Param) {
|
|
1858
|
-
tmp = '{' + it.
|
|
1858
|
+
tmp = '{' + it.mt_1.m1() + '}';
|
|
1859
1859
|
} else {
|
|
1860
1860
|
noWhenBranchMatchedException();
|
|
1861
1861
|
}
|
|
@@ -1864,50 +1864,50 @@ function buildHandlersStruct$lambda(it) {
|
|
|
1864
1864
|
}
|
|
1865
1865
|
function buildHandlersStruct$lambda$lambda($pathTemplate) {
|
|
1866
1866
|
return function ($this$function) {
|
|
1867
|
-
$this$function.
|
|
1868
|
-
$this$function.
|
|
1867
|
+
$this$function.m1l(String_instance);
|
|
1868
|
+
$this$function.n1l($this$function.w1x($pathTemplate));
|
|
1869
1869
|
return Unit_instance;
|
|
1870
1870
|
};
|
|
1871
1871
|
}
|
|
1872
1872
|
function buildHandlersStruct$lambda$lambda_0($this_buildHandlersStruct) {
|
|
1873
1873
|
return function ($this$function) {
|
|
1874
|
-
$this$function.
|
|
1875
|
-
$this$function.
|
|
1874
|
+
$this$function.m1l(String_instance);
|
|
1875
|
+
$this$function.n1l($this$function.w1x($this_buildHandlersStruct.gt_1.b3_1));
|
|
1876
1876
|
return Unit_instance;
|
|
1877
1877
|
};
|
|
1878
1878
|
}
|
|
1879
1879
|
function buildHandlersStruct$lambda$lambda_1($this$function) {
|
|
1880
|
-
$this$function.
|
|
1881
|
-
$this$function.
|
|
1882
|
-
$this$function.
|
|
1880
|
+
$this$function.m1l($this$function.a1l('Wirespec.ServerEdge', [$this$function.a1l('Request', []), $this$function.a1l('Response', [Wildcard_instance])]));
|
|
1881
|
+
$this$function.j1l('serialization', $this$function.a1l('Wirespec.Serialization', []));
|
|
1882
|
+
$this$function.n1l(new RawExpression('new Wirespec.ServerEdge<>() {\n@Override public Request from(Wirespec.RawRequest request) {\n return fromRawRequest(serialization, request);\n}\n@Override public Wirespec.RawResponse to(Response<?> response) {\n return toRawResponse(serialization, response);\n}\n}'));
|
|
1883
1883
|
return Unit_instance;
|
|
1884
1884
|
}
|
|
1885
1885
|
function buildHandlersStruct$lambda$lambda_2($this$function) {
|
|
1886
|
-
$this$function.
|
|
1887
|
-
$this$function.
|
|
1888
|
-
$this$function.
|
|
1886
|
+
$this$function.m1l($this$function.a1l('Wirespec.ClientEdge', [$this$function.a1l('Request', []), $this$function.a1l('Response', [Wildcard_instance])]));
|
|
1887
|
+
$this$function.j1l('serialization', $this$function.a1l('Wirespec.Serialization', []));
|
|
1888
|
+
$this$function.n1l(new RawExpression('new Wirespec.ClientEdge<>() {\n@Override public Wirespec.RawRequest to(Request request) {\n return toRawRequest(serialization, request);\n}\n@Override public Response<?> from(Wirespec.RawResponse response) {\n return fromRawResponse(serialization, response);\n}\n}'));
|
|
1889
1889
|
return Unit_instance;
|
|
1890
1890
|
}
|
|
1891
1891
|
function buildHandlersStruct$lambda_0($pathTemplate, $this_buildHandlersStruct) {
|
|
1892
1892
|
return function ($this$struct) {
|
|
1893
|
-
$this$struct.
|
|
1894
|
-
$this$struct.
|
|
1895
|
-
$this$struct.
|
|
1896
|
-
$this$struct.
|
|
1897
|
-
$this$struct.
|
|
1898
|
-
$this$struct.
|
|
1893
|
+
$this$struct.f1o($this$struct.a1l('Wirespec.Server', [$this$struct.a1l('Request', []), $this$struct.a1l('Response', [Wildcard_instance])]));
|
|
1894
|
+
$this$struct.f1o($this$struct.a1l('Wirespec.Client', [$this$struct.a1l('Request', []), $this$struct.a1l('Response', [Wildcard_instance])]));
|
|
1895
|
+
$this$struct.o1l('getPathTemplate', VOID, true, buildHandlersStruct$lambda$lambda($pathTemplate));
|
|
1896
|
+
$this$struct.o1l('getMethod', VOID, true, buildHandlersStruct$lambda$lambda_0($this_buildHandlersStruct));
|
|
1897
|
+
$this$struct.o1l('getServer', VOID, true, buildHandlersStruct$lambda$lambda_1);
|
|
1898
|
+
$this$struct.o1l('getClient', VOID, true, buildHandlersStruct$lambda$lambda_2);
|
|
1899
1899
|
return Unit_instance;
|
|
1900
1900
|
};
|
|
1901
1901
|
}
|
|
1902
1902
|
function withFullyQualifiedPrefix$lambda(it) {
|
|
1903
|
-
return it.
|
|
1903
|
+
return it.j1t_1.equals(Companion_getInstance().y1k('message'));
|
|
1904
1904
|
}
|
|
1905
1905
|
function withFullyQualifiedPrefix$lambda_0($prefix) {
|
|
1906
1906
|
return function (param) {
|
|
1907
|
-
var t = param.
|
|
1907
|
+
var t = param.k1t_1;
|
|
1908
1908
|
var tmp;
|
|
1909
1909
|
if (t instanceof Custom_0) {
|
|
1910
|
-
tmp = param.
|
|
1910
|
+
tmp = param.m1t(VOID, t.x1q(Companion_getInstance().y1k($prefix + t.s1m_1.z1k())));
|
|
1911
1911
|
} else {
|
|
1912
1912
|
tmp = param;
|
|
1913
1913
|
}
|
|
@@ -1918,8 +1918,8 @@ function JavaRefinedTypeDefinitionEmitter() {
|
|
|
1918
1918
|
}
|
|
1919
1919
|
function JavaShared() {
|
|
1920
1920
|
JavaShared_instance = this;
|
|
1921
|
-
this.
|
|
1922
|
-
this.
|
|
1921
|
+
this.n20_1 = 'community.flock.wirespec.java';
|
|
1922
|
+
this.o20_1 = trimMargin('\n |package ' + this.n20_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 ');
|
|
1923
1923
|
}
|
|
1924
1924
|
protoOf(JavaShared).toString = function () {
|
|
1925
1925
|
return 'JavaShared';
|
|
@@ -1943,10 +1943,10 @@ function JavaShared_getInstance() {
|
|
|
1943
1943
|
function emitType($this, _this__u8e3s4) {
|
|
1944
1944
|
var tmp;
|
|
1945
1945
|
if (_this__u8e3s4 instanceof Dict) {
|
|
1946
|
-
tmp = 'java.util.Map<String, ' + $this.
|
|
1946
|
+
tmp = 'java.util.Map<String, ' + $this.yt(_this__u8e3s4.ds_1) + '>';
|
|
1947
1947
|
} else {
|
|
1948
1948
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
1949
|
-
tmp = 'java.util.List<' + $this.
|
|
1949
|
+
tmp = 'java.util.List<' + $this.yt(_this__u8e3s4.as_1) + '>';
|
|
1950
1950
|
} else {
|
|
1951
1951
|
if (_this__u8e3s4 instanceof Unit) {
|
|
1952
1952
|
tmp = 'void';
|
|
@@ -1955,7 +1955,7 @@ function emitType($this, _this__u8e3s4) {
|
|
|
1955
1955
|
tmp = 'Object';
|
|
1956
1956
|
} else {
|
|
1957
1957
|
if (_this__u8e3s4 instanceof Custom) {
|
|
1958
|
-
tmp = _this__u8e3s4.
|
|
1958
|
+
tmp = _this__u8e3s4.my_1;
|
|
1959
1959
|
} else {
|
|
1960
1960
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
1961
1961
|
tmp = emit_18($this, _this__u8e3s4);
|
|
@@ -1970,14 +1970,14 @@ function emitType($this, _this__u8e3s4) {
|
|
|
1970
1970
|
return tmp;
|
|
1971
1971
|
}
|
|
1972
1972
|
function emit_18($this, _this__u8e3s4) {
|
|
1973
|
-
var t = _this__u8e3s4.
|
|
1973
|
+
var t = _this__u8e3s4.qy_1;
|
|
1974
1974
|
var tmp;
|
|
1975
1975
|
if (t instanceof String_0) {
|
|
1976
1976
|
tmp = 'String';
|
|
1977
1977
|
} else {
|
|
1978
1978
|
if (t instanceof Integer) {
|
|
1979
1979
|
var tmp_0;
|
|
1980
|
-
switch (t.
|
|
1980
|
+
switch (t.ux_1.c3_1) {
|
|
1981
1981
|
case 0:
|
|
1982
1982
|
tmp_0 = 'Integer';
|
|
1983
1983
|
break;
|
|
@@ -1992,7 +1992,7 @@ function emit_18($this, _this__u8e3s4) {
|
|
|
1992
1992
|
} else {
|
|
1993
1993
|
if (t instanceof Number_0) {
|
|
1994
1994
|
var tmp_1;
|
|
1995
|
-
switch (t.
|
|
1995
|
+
switch (t.xx_1.c3_1) {
|
|
1996
1996
|
case 0:
|
|
1997
1997
|
tmp_1 = 'Float';
|
|
1998
1998
|
break;
|
|
@@ -2021,45 +2021,45 @@ function emit_18($this, _this__u8e3s4) {
|
|
|
2021
2021
|
}
|
|
2022
2022
|
function JavaTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
2023
2023
|
return function (it) {
|
|
2024
|
-
return this$0.
|
|
2024
|
+
return this$0.yt(it);
|
|
2025
2025
|
};
|
|
2026
2026
|
}
|
|
2027
2027
|
function JavaTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2028
2028
|
return function (it) {
|
|
2029
|
-
return Spacer_instance.toString() + this$0.
|
|
2029
|
+
return Spacer_instance.toString() + this$0.xt(it) + ',';
|
|
2030
2030
|
};
|
|
2031
2031
|
}
|
|
2032
2032
|
function JavaTypeDefinitionEmitter() {
|
|
2033
2033
|
}
|
|
2034
2034
|
function JavaUnionDefinitionEmitter$emit$lambda(it) {
|
|
2035
|
-
return it.
|
|
2035
|
+
return it.m1();
|
|
2036
2036
|
}
|
|
2037
2037
|
function JavaUnionDefinitionEmitter() {
|
|
2038
2038
|
}
|
|
2039
2039
|
//region block: post-declaration
|
|
2040
|
-
protoOf(JavaEmitter).
|
|
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(JavaIrEmitter).
|
|
2061
|
-
protoOf(JavaIrEmitter).
|
|
2062
|
-
protoOf(JavaIrEmitter).
|
|
2040
|
+
protoOf(JavaEmitter).yu = emit_13;
|
|
2041
|
+
protoOf(JavaEmitter).vt = emit_3;
|
|
2042
|
+
protoOf(JavaEmitter).wt = emit_4;
|
|
2043
|
+
protoOf(JavaEmitter).xt = emit_5;
|
|
2044
|
+
protoOf(JavaEmitter).yt = emit_6;
|
|
2045
|
+
protoOf(JavaEmitter).zt = emit_7;
|
|
2046
|
+
protoOf(JavaEmitter).lv = emit_9;
|
|
2047
|
+
protoOf(JavaEmitter).q20 = emit_10;
|
|
2048
|
+
protoOf(JavaEmitter).r20 = emit_11;
|
|
2049
|
+
protoOf(JavaEmitter).zu = emit_8;
|
|
2050
|
+
protoOf(JavaEmitter).kv = emit_14;
|
|
2051
|
+
protoOf(JavaEmitter).av = emit_15;
|
|
2052
|
+
protoOf(JavaEmitter).fv = emit_12;
|
|
2053
|
+
protoOf(JavaEmitter).p20 = sanitizeSymbol;
|
|
2054
|
+
protoOf(JavaEmitter).s20 = sanitizeFirstIsDigit;
|
|
2055
|
+
protoOf(JavaEmitter).t20 = sanitizeKeywords;
|
|
2056
|
+
protoOf(JavaEmitter).f20 = emitRoot;
|
|
2057
|
+
protoOf(JavaEmitter).e20 = emitRoot$default;
|
|
2058
|
+
protoOf(JavaEmitter).u20 = emitHandleFunction;
|
|
2059
|
+
protoOf(JavaEmitter).mv = emitValidator;
|
|
2060
|
+
protoOf(JavaIrEmitter).pr = emit_1;
|
|
2061
|
+
protoOf(JavaIrEmitter).g1z = emit_2;
|
|
2062
|
+
protoOf(JavaIrEmitter).j1z = beforeGenerate;
|
|
2063
2063
|
//endregion
|
|
2064
2064
|
//region block: exports
|
|
2065
2065
|
export {
|