@flock/wirespec 0.18.0-RC.1 → 0.18.1-RC.2
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 +152 -158
- package/arrow-arrow-core.mjs.map +1 -1
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt.mjs +1442 -1442
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +439 -439
- package/kotlin-kotlin-stdlib.mjs +1067 -1131
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +4857 -4857
- package/kotlin-rgxgen.mjs +1793 -1793
- package/kotlinx-io-kotlinx-io-core.mjs +415 -415
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1752 -1752
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1348 -1356
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1303 -1311
- package/mordant-mordant.mjs.map +1 -1
- package/package.json +1 -1
- package/wirespec-src-compiler-core.mjs +1527 -1527
- package/wirespec-src-compiler-emitters-java.mjs +477 -451
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +413 -408
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +379 -378
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +939 -725
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +225 -233
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +558 -589
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +82 -82
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3738 -3708
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +418 -418
- package/wirespec-src-converter-avro.mjs +506 -506
- package/wirespec-src-converter-openapi.mjs +684 -684
- package/wirespec-src-plugin-arguments.mjs +181 -181
- package/wirespec-src-plugin-cli.mjs +106 -106
- package/wirespec-src-plugin-npm.mjs +36 -36
- package/wirespec-src-tools-generator.mjs +34 -34
|
@@ -104,13 +104,13 @@ import {
|
|
|
104
104
|
NonEmptyList__plus_impl_xqmb92tle8a7jcf2wm as NonEmptyList__plus_impl_xqmb9,
|
|
105
105
|
} from './arrow-arrow-core.mjs';
|
|
106
106
|
import {
|
|
107
|
+
Companion_getInstance3gvtuyxc9uhxj as Companion_getInstance,
|
|
107
108
|
Package2tniq694j1763 as Package,
|
|
108
109
|
File3dimy4iqmuock as File,
|
|
109
110
|
transformChildrend9p91tpcqdkx as transformChildren,
|
|
110
|
-
Companion_getInstance3gvtuyxc9uhxj as Companion_getInstance,
|
|
111
111
|
withElements2toq84v08e72 as withElements,
|
|
112
112
|
Namespace345pal554qu3j as Namespace,
|
|
113
|
-
|
|
113
|
+
import5uhkz67bd8tt as import_0,
|
|
114
114
|
TransformScopeyrd3lf4zrk76 as TransformScope,
|
|
115
115
|
TransformerBuildera6a1gvlhjj9b as TransformerBuilder,
|
|
116
116
|
transform3eti8i2bqvifx as transform,
|
|
@@ -131,14 +131,15 @@ import {
|
|
|
131
131
|
FunctionCall30872kpnbr7op as FunctionCall,
|
|
132
132
|
transformChildren2mszeagj5nq4c as transformChildren_0,
|
|
133
133
|
convert13xvfhgrf57n5 as convert,
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
convertClientServer3s89ijty7q130 as convertClientServer,
|
|
135
|
+
toGetterAccessors2z6mndbqwlczg as toGetterAccessors,
|
|
136
136
|
rawttvqxl50flj9 as raw,
|
|
137
137
|
generateJavaxqkwhkjcf0ke as generateJava,
|
|
138
138
|
RawElement2yts1x2rbem1g as RawElement,
|
|
139
139
|
VariableReference2vlynnhaw1i64 as VariableReference,
|
|
140
|
+
withLabelField33ehya4zusm70 as withLabelField,
|
|
140
141
|
function12vu2kapzno4w as function_0,
|
|
141
|
-
|
|
142
|
+
plusd54zq6f7l8fy as plus_3,
|
|
142
143
|
Enumlszg09mwd24f as Enum,
|
|
143
144
|
convert2loxpwk8n2r8c as convert_0,
|
|
144
145
|
Function21cuq8qizkin7 as Function,
|
|
@@ -150,13 +151,14 @@ import {
|
|
|
150
151
|
Wildcard_instance2ga1ytfwj78ra as Wildcard_instance,
|
|
151
152
|
TypeDescriptor1hvcpxrtxcqsx as TypeDescriptor,
|
|
152
153
|
JavaGenerator_instance753fwcs3a4n9 as JavaGenerator_instance,
|
|
153
|
-
|
|
154
|
+
SanitizationConfig11mmn3p2c03c1 as SanitizationConfig,
|
|
154
155
|
emit3bzdcd0f6nwtj as emit_0,
|
|
155
156
|
withSharedSource1qgrajaccojj3 as withSharedSource,
|
|
156
157
|
emitn3eihixilqyh as emit_1,
|
|
157
|
-
|
|
158
|
+
prependImports32gcj3yb8voha as prependImports,
|
|
159
|
+
placeInPackage1ffljbk9me4ug as placeInPackage,
|
|
158
160
|
convertWithValidation3ar3nbcqsbkpn as convertWithValidation,
|
|
159
|
-
|
|
161
|
+
sanitizeNames2wqmyf8vafp9x as sanitizeNames,
|
|
160
162
|
convert11ert2po54h1y as convert_1,
|
|
161
163
|
convert37aabdzvtv9vg as convert_2,
|
|
162
164
|
convert17zcptkz4mhr4 as convert_3,
|
|
@@ -171,10 +173,10 @@ import {
|
|
|
171
173
|
//endregion
|
|
172
174
|
//region block: pre-declaration
|
|
173
175
|
function emit_3(type, module_0) {
|
|
174
|
-
var tmp = this.
|
|
175
|
-
var tmp_0 = this.
|
|
176
|
+
var tmp = this.wq(type.vo_1);
|
|
177
|
+
var tmp_0 = this.vp(type.wo_1);
|
|
176
178
|
// Inline function 'kotlin.run' call
|
|
177
|
-
var $this$run = type.
|
|
179
|
+
var $this$run = type.xo_1;
|
|
178
180
|
var tmp_1;
|
|
179
181
|
if ($this$run.r()) {
|
|
180
182
|
tmp_1 = '';
|
|
@@ -185,23 +187,23 @@ function emit_3(type, module_0) {
|
|
|
185
187
|
return trimMargin('\n |public record ' + tmp + ' (\n |' + tmp_0 + '\n |)' + tmp$ret$1 + ' {\n |};\n |\n ');
|
|
186
188
|
}
|
|
187
189
|
function emit_4(_this__u8e3s4) {
|
|
188
|
-
return dropLast_0(joinToString(_this__u8e3s4.
|
|
190
|
+
return dropLast_0(joinToString(_this__u8e3s4.so_1, '\n', VOID, VOID, VOID, VOID, JavaTypeDefinitionEmitter$emit$lambda_0(this)), 1);
|
|
189
191
|
}
|
|
190
192
|
function emit_5(_this__u8e3s4) {
|
|
191
|
-
return this.
|
|
193
|
+
return this.xp(_this__u8e3s4.bp_1) + ' ' + this.wq(_this__u8e3s4.ap_1);
|
|
192
194
|
}
|
|
193
195
|
function emit_6(_this__u8e3s4) {
|
|
194
196
|
// Inline function 'kotlin.let' call
|
|
195
197
|
var it = emitType(this, _this__u8e3s4);
|
|
196
|
-
return _this__u8e3s4.
|
|
198
|
+
return _this__u8e3s4.du() ? 'java.util.Optional<' + it + '>' : it;
|
|
197
199
|
}
|
|
198
200
|
function emitRoot(_this__u8e3s4, void_0) {
|
|
199
201
|
var tmp;
|
|
200
202
|
if (_this__u8e3s4 instanceof Dict) {
|
|
201
|
-
tmp = this.
|
|
203
|
+
tmp = this.l1v(_this__u8e3s4.co_1);
|
|
202
204
|
} else {
|
|
203
205
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
204
|
-
tmp = this.
|
|
206
|
+
tmp = this.l1v(_this__u8e3s4.zn_1);
|
|
205
207
|
} else {
|
|
206
208
|
if (_this__u8e3s4 instanceof Unit) {
|
|
207
209
|
tmp = void_0;
|
|
@@ -230,15 +232,15 @@ function emitRoot(_this__u8e3s4, void_0) {
|
|
|
230
232
|
}
|
|
231
233
|
function emitRoot$default(_this__u8e3s4, void_0, $super) {
|
|
232
234
|
void_0 = void_0 === VOID ? 'void' : void_0;
|
|
233
|
-
return $super === VOID ? this.
|
|
235
|
+
return $super === VOID ? this.m1v(_this__u8e3s4, void_0) : emitRoot(_this__u8e3s4, void_0);
|
|
234
236
|
}
|
|
235
237
|
function emit_7(_this__u8e3s4) {
|
|
236
238
|
var tmp;
|
|
237
239
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
238
|
-
tmp = 'return java.util.regex.Pattern.compile("' + replace(this.
|
|
240
|
+
tmp = 'return java.util.regex.Pattern.compile("' + replace(this.zp(_this__u8e3s4.ys_1), '\\', '\\\\') + '").matcher(value).find();';
|
|
239
241
|
} else {
|
|
240
242
|
if (_this__u8e3s4 instanceof Bound) {
|
|
241
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
243
|
+
var tmp1_safe_receiver = _this__u8e3s4.pt_1;
|
|
242
244
|
var tmp_0;
|
|
243
245
|
if (tmp1_safe_receiver == null) {
|
|
244
246
|
tmp_0 = null;
|
|
@@ -247,7 +249,7 @@ function emit_7(_this__u8e3s4) {
|
|
|
247
249
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
248
250
|
}
|
|
249
251
|
var minCheck = tmp_0;
|
|
250
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
252
|
+
var tmp2_safe_receiver = _this__u8e3s4.qt_1;
|
|
251
253
|
var tmp_1;
|
|
252
254
|
if (tmp2_safe_receiver == null) {
|
|
253
255
|
tmp_1 = null;
|
|
@@ -273,16 +275,16 @@ function emit_7(_this__u8e3s4) {
|
|
|
273
275
|
}
|
|
274
276
|
initMetadataForInterface(JavaTypeDefinitionEmitter, 'JavaTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter]);
|
|
275
277
|
function emit_8(channel) {
|
|
276
|
-
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |@FunctionalInterface\n |public interface ' + this.
|
|
278
|
+
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |@FunctionalInterface\n |public interface ' + this.wq(channel.mo_1) + ' {\n | void invoke(' + emitFullyQualified(this, channel, channel.no_1) + this.l1v(channel.no_1) + ' message);\n |}\n |\n ');
|
|
277
279
|
}
|
|
278
280
|
initMetadataForInterface(JavaChannelDefinitionEmitter, 'JavaChannelDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
279
281
|
function emit_9(identifier) {
|
|
280
282
|
var tmp;
|
|
281
283
|
if (identifier instanceof DefinitionIdentifier) {
|
|
282
|
-
tmp = this.
|
|
284
|
+
tmp = this.w1v(identifier.l1());
|
|
283
285
|
} else {
|
|
284
286
|
if (identifier instanceof FieldIdentifier) {
|
|
285
|
-
tmp = this.
|
|
287
|
+
tmp = this.a1w(this.w1v(identifier.l1()));
|
|
286
288
|
} else {
|
|
287
289
|
noWhenBranchMatchedException();
|
|
288
290
|
}
|
|
@@ -300,11 +302,11 @@ function sanitizeSymbol(_this__u8e3s4) {
|
|
|
300
302
|
var item = _iterator__ex2g4s.v();
|
|
301
303
|
var _unary__edvuaz = index;
|
|
302
304
|
index = _unary__edvuaz + 1 | 0;
|
|
303
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
305
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.oq(item) : item;
|
|
304
306
|
destination.x(tmp$ret$0);
|
|
305
307
|
}
|
|
306
308
|
var tmp = asSequence(joinToString(destination, ''));
|
|
307
|
-
return this.
|
|
309
|
+
return this.z1v(joinToString_0(filter(tmp, JavaIdentifierEmitter$sanitizeSymbol$lambda), ''));
|
|
308
310
|
}
|
|
309
311
|
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
310
312
|
var tmp;
|
|
@@ -324,107 +326,44 @@ function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
|
324
326
|
return tmp;
|
|
325
327
|
}
|
|
326
328
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
327
|
-
return Companion_getInstance_0().
|
|
329
|
+
return Companion_getInstance_0().c1w_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
328
330
|
}
|
|
329
331
|
initMetadataForInterface(JavaIdentifierEmitter, 'JavaIdentifierEmitter');
|
|
330
332
|
function emit_10(enum_0, module_0) {
|
|
331
|
-
var tmp = this.
|
|
332
|
-
return trimMargin('\n |public enum ' + tmp + ' implements Wirespec.Enum {\n |' + spacer(joinToString(enum_0.
|
|
333
|
+
var tmp = this.wq(enum_0.gr_1);
|
|
334
|
+
return trimMargin('\n |public enum ' + tmp + ' implements Wirespec.Enum {\n |' + spacer(joinToString(enum_0.hr_1, ',\n', VOID, VOID, VOID, VOID, JavaEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'public final String label;\n |' + Spacer_instance.toString() + this.wq(enum_0.gr_1) + '(String label) {\n |' + Spacer_instance.qr(2) + 'this.label = label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() {\n |' + Spacer_instance.qr(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String label() {\n |' + Spacer_instance.qr(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
333
335
|
}
|
|
334
336
|
initMetadataForInterface(JavaEnumDefinitionEmitter, 'JavaEnumDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
335
|
-
function emit_11(
|
|
336
|
-
var tmp =
|
|
337
|
-
|
|
338
|
-
var tmp_1 = get_pathParams(endpoint);
|
|
339
|
-
var tmp_2 = emitObject(this, tmp_1, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
|
|
340
|
-
var tmp_3 = emitObject(this, endpoint.jp_1, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
341
|
-
var tmp_4 = emitObject(this, endpoint.kp_1, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
342
|
-
var tmp_5 = this.y1v(first_0(endpoint.lp_1), endpoint);
|
|
343
|
-
var tmp_6 = Spacer_instance.toString();
|
|
344
|
-
var tmp_7 = emitStatusInterfaces(this, endpoint);
|
|
345
|
-
var tmp_8 = emitResponseInterfaces(this, endpoint);
|
|
346
|
-
var tmp_9 = distinctByStatus(endpoint.mp_1);
|
|
347
|
-
var tmp_10 = joinToString(tmp_9, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
348
|
-
var tmp_11 = Spacer_instance.toString();
|
|
349
|
-
var tmp_12 = emitRequestFunctions(this, first_0(endpoint.lp_1), endpoint);
|
|
350
|
-
var tmp_13 = Spacer_instance.sr(2);
|
|
351
|
-
var tmp_14 = distinctByStatus(endpoint.mp_1);
|
|
352
|
-
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
353
|
-
var tmp_16 = Spacer_instance.sr(3);
|
|
354
|
-
var tmp_17 = Spacer_instance.sr(2);
|
|
355
|
-
var tmp_18 = Spacer_instance.sr(2);
|
|
356
|
-
var tmp_19 = emitFromResponse(this, endpoint);
|
|
357
|
-
var tmp_20 = Spacer_instance.sr(2);
|
|
358
|
-
var tmp_21 = Spacer_instance.sr(2);
|
|
359
|
-
var tmp_22 = this.c1w(endpoint);
|
|
360
|
-
var tmp_23 = Spacer_instance.sr(2);
|
|
361
|
-
var tmp_24 = Spacer_instance.sr(3);
|
|
362
|
-
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.ip_1, '/', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_4) + '"; }\n |' + Spacer_instance.sr(3) + '@Override public String getMethod() { return "' + endpoint.hp_1.toString() + '"; }\n |' + Spacer_instance.sr(3) + '@Override public Wirespec.ServerEdge<Request, Response<?>> getServer(Wirespec.Serialization serialization) {\n |' + Spacer_instance.sr(4) + 'return new Wirespec.ServerEdge<>() {\n |' + Spacer_instance.sr(5) + '@Override public Request from(Wirespec.RawRequest request) { return fromRequest(serialization, request); }\n |' + Spacer_instance.sr(5) + '@Override public Wirespec.RawResponse to(Response<?> response) { return toResponse(serialization, response); }\n |' + Spacer_instance.sr(4) + '};\n |' + Spacer_instance.sr(3) + '}\n |' + Spacer_instance.sr(3) + '@Override public Wirespec.ClientEdge<Request, Response<?>> getClient(Wirespec.Serialization serialization) {\n |' + Spacer_instance.sr(4) + 'return new Wirespec.ClientEdge<>() {\n |' + Spacer_instance.sr(5) + '@Override public Wirespec.RawRequest to(Request request) { return toRequest(serialization, request); }\n |' + Spacer_instance.sr(5) + '@Override public Response<?> from(Wirespec.RawResponse response) { return fromResponse(serialization, response); }\n |' + Spacer_instance.sr(4) + '};\n |' + Spacer_instance.sr(3) + '}\n |' + Spacer_instance.sr(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
363
|
-
}
|
|
364
|
-
function emitHandleFunction(endpoint) {
|
|
365
|
-
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.rq(this.yq(endpoint.gp_1)) + '(Request request);';
|
|
337
|
+
function emit_11(union) {
|
|
338
|
+
var tmp = this.wq(union.qo_1);
|
|
339
|
+
return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.ro_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
|
|
366
340
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
}
|
|
370
|
-
function emit_13(_this__u8e3s4) {
|
|
371
|
-
var tmp = Spacer_instance.toString();
|
|
372
|
-
var tmp_0 = Companion_instance_1.qq(_this__u8e3s4.sp_1);
|
|
373
|
-
var tmp_1 = Spacer_instance.sr(2);
|
|
374
|
-
var tmp_2 = Spacer_instance.sr(2);
|
|
375
|
-
var tmp_3 = Spacer_instance.sr(2);
|
|
376
|
-
var tmp_4 = emit_16(this, _this__u8e3s4.up_1);
|
|
377
|
-
var tmp_5 = Spacer_instance.toString();
|
|
378
|
-
var tmp_6 = toString_0(first(_this__u8e3s4.sp_1));
|
|
379
|
-
var tmp_7 = emit_16(this, _this__u8e3s4.up_1);
|
|
380
|
-
var tmp_8 = concatGenerics(emit_16(this, _this__u8e3s4.up_1));
|
|
381
|
-
var tmp_9 = Spacer_instance.sr(2);
|
|
382
|
-
var tmp_10 = Companion_instance_1.qq(_this__u8e3s4.sp_1);
|
|
383
|
-
var tmp_11 = orNull(joinToString(_this__u8e3s4.tp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_5(this)));
|
|
384
|
-
var tmp0_safe_receiver = _this__u8e3s4.up_1;
|
|
385
|
-
var tmp_12;
|
|
386
|
-
if (tmp0_safe_receiver == null) {
|
|
387
|
-
tmp_12 = null;
|
|
388
|
-
} else {
|
|
389
|
-
// Inline function 'kotlin.let' call
|
|
390
|
-
tmp_12 = emit_16(this, tmp0_safe_receiver) + ' body';
|
|
391
|
-
}
|
|
392
|
-
var tmp_13 = joinToString(listOfNotNull([tmp_11, tmp_12]));
|
|
393
|
-
var tmp_14 = Spacer_instance.sr(3);
|
|
394
|
-
var tmp_15 = fixStatus(_this__u8e3s4.sp_1);
|
|
395
|
-
// Inline function 'kotlin.let' call
|
|
396
|
-
var tmp_16 = 'new Headers(' + joinToString(_this__u8e3s4.tp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_6(this)) + ')';
|
|
397
|
-
var tmp_17 = _this__u8e3s4.up_1 == null ? 'null' : 'body';
|
|
398
|
-
var tmp_18 = Spacer_instance.sr(2);
|
|
399
|
-
var tmp_19 = Spacer_instance.sr(1);
|
|
400
|
-
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.tp_1, 'Headers', 'Wirespec.Response.Headers', JavaEndpointDefinitionEmitter$emit$lambda_7(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
401
|
-
}
|
|
402
|
-
initMetadataForInterface(JavaEndpointDefinitionEmitter, 'JavaEndpointDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
403
|
-
function emit_14(refined) {
|
|
404
|
-
return trimMargin('\n |public record ' + this.yq(refined.dr_1) + ' (' + this.zp(refined.er_1) + ' value) implements Wirespec.Refined<' + this.zp(refined.er_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.mr(refined) + '\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public ' + this.zp(refined.er_1) + ' value() { return value; }\n |}\n |\n ');
|
|
341
|
+
initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
342
|
+
function emit_12(refined) {
|
|
343
|
+
return trimMargin('\n |public record ' + this.wq(refined.br_1) + ' (' + this.xp(refined.cr_1) + ' value) implements Wirespec.Refined<' + this.xp(refined.cr_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.kr(refined) + '\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public ' + this.xp(refined.cr_1) + ' value() { return value; }\n |}\n |\n ');
|
|
405
344
|
}
|
|
406
345
|
function emitValidator(_this__u8e3s4) {
|
|
407
346
|
var defaultReturn = 'return true;';
|
|
408
|
-
var type = _this__u8e3s4.
|
|
347
|
+
var type = _this__u8e3s4.cr_1.pu_1;
|
|
409
348
|
var tmp;
|
|
410
349
|
if (type instanceof Integer) {
|
|
411
|
-
var tmp0_safe_receiver = type.
|
|
412
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
350
|
+
var tmp0_safe_receiver = type.ut_1;
|
|
351
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.yp(tmp0_safe_receiver);
|
|
413
352
|
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
414
353
|
} else {
|
|
415
354
|
if (type instanceof Number_0) {
|
|
416
|
-
var tmp2_safe_receiver = type.
|
|
417
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.
|
|
355
|
+
var tmp2_safe_receiver = type.xt_1;
|
|
356
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.yp(tmp2_safe_receiver);
|
|
418
357
|
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
419
358
|
} else {
|
|
420
359
|
if (type instanceof String_0) {
|
|
421
|
-
var tmp4_safe_receiver = type.
|
|
360
|
+
var tmp4_safe_receiver = type.rt_1;
|
|
422
361
|
var tmp_0;
|
|
423
362
|
var tmp_1 = tmp4_safe_receiver;
|
|
424
363
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
425
364
|
tmp_0 = null;
|
|
426
365
|
} else {
|
|
427
|
-
tmp_0 = this.
|
|
366
|
+
tmp_0 = this.yp(new RegExp_0(tmp4_safe_receiver));
|
|
428
367
|
}
|
|
429
368
|
var tmp5_elvis_lhs = tmp_0;
|
|
430
369
|
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
@@ -444,12 +383,75 @@ function emitValidator(_this__u8e3s4) {
|
|
|
444
383
|
return tmp;
|
|
445
384
|
}
|
|
446
385
|
initMetadataForInterface(JavaRefinedTypeDefinitionEmitter, 'JavaRefinedTypeDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
447
|
-
function
|
|
448
|
-
var tmp = this
|
|
449
|
-
|
|
386
|
+
function emit_13(endpoint) {
|
|
387
|
+
var tmp = emitImports_0(this, endpoint);
|
|
388
|
+
var tmp_0 = this.wq(endpoint.ep_1);
|
|
389
|
+
var tmp_1 = get_pathParams(endpoint);
|
|
390
|
+
var tmp_2 = emitObject(this, tmp_1, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
|
|
391
|
+
var tmp_3 = emitObject(this, endpoint.hp_1, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
392
|
+
var tmp_4 = emitObject(this, endpoint.ip_1, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
393
|
+
var tmp_5 = this.x1v(first_0(endpoint.jp_1), endpoint);
|
|
394
|
+
var tmp_6 = Spacer_instance.toString();
|
|
395
|
+
var tmp_7 = emitStatusInterfaces(this, endpoint);
|
|
396
|
+
var tmp_8 = emitResponseInterfaces(this, endpoint);
|
|
397
|
+
var tmp_9 = distinctByStatus(endpoint.kp_1);
|
|
398
|
+
var tmp_10 = joinToString(tmp_9, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
399
|
+
var tmp_11 = Spacer_instance.toString();
|
|
400
|
+
var tmp_12 = emitRequestFunctions(this, first_0(endpoint.jp_1), endpoint);
|
|
401
|
+
var tmp_13 = Spacer_instance.qr(2);
|
|
402
|
+
var tmp_14 = distinctByStatus(endpoint.kp_1);
|
|
403
|
+
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
404
|
+
var tmp_16 = Spacer_instance.qr(3);
|
|
405
|
+
var tmp_17 = Spacer_instance.qr(2);
|
|
406
|
+
var tmp_18 = Spacer_instance.qr(2);
|
|
407
|
+
var tmp_19 = emitFromResponse(this, endpoint);
|
|
408
|
+
var tmp_20 = Spacer_instance.qr(2);
|
|
409
|
+
var tmp_21 = Spacer_instance.qr(2);
|
|
410
|
+
var tmp_22 = this.b1w(endpoint);
|
|
411
|
+
var tmp_23 = Spacer_instance.qr(2);
|
|
412
|
+
var tmp_24 = Spacer_instance.qr(3);
|
|
413
|
+
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.gp_1, '/', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_4) + '"; }\n |' + Spacer_instance.qr(3) + '@Override public String getMethod() { return "' + endpoint.fp_1.toString() + '"; }\n |' + Spacer_instance.qr(3) + '@Override public Wirespec.ServerEdge<Request, Response<?>> getServer(Wirespec.Serialization serialization) {\n |' + Spacer_instance.qr(4) + 'return new Wirespec.ServerEdge<>() {\n |' + Spacer_instance.qr(5) + '@Override public Request from(Wirespec.RawRequest request) { return fromRequest(serialization, request); }\n |' + Spacer_instance.qr(5) + '@Override public Wirespec.RawResponse to(Response<?> response) { return toResponse(serialization, response); }\n |' + Spacer_instance.qr(4) + '};\n |' + Spacer_instance.qr(3) + '}\n |' + Spacer_instance.qr(3) + '@Override public Wirespec.ClientEdge<Request, Response<?>> getClient(Wirespec.Serialization serialization) {\n |' + Spacer_instance.qr(4) + 'return new Wirespec.ClientEdge<>() {\n |' + Spacer_instance.qr(5) + '@Override public Wirespec.RawRequest to(Request request) { return toRequest(serialization, request); }\n |' + Spacer_instance.qr(5) + '@Override public Response<?> from(Wirespec.RawResponse response) { return fromResponse(serialization, response); }\n |' + Spacer_instance.qr(4) + '};\n |' + Spacer_instance.qr(3) + '}\n |' + Spacer_instance.qr(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
450
414
|
}
|
|
451
|
-
|
|
452
|
-
|
|
415
|
+
function emitHandleFunction(endpoint) {
|
|
416
|
+
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.pq(this.wq(endpoint.ep_1)) + '(Request request);';
|
|
417
|
+
}
|
|
418
|
+
function emit_14(_this__u8e3s4, endpoint) {
|
|
419
|
+
return trimMargin('\n |' + Spacer_instance.toString() + 'record Request (\n |' + Spacer_instance.qr(2) + 'Path path,\n |' + Spacer_instance.qr(2) + 'Wirespec.Method method,\n |' + Spacer_instance.qr(2) + 'Queries queries,\n |' + Spacer_instance.qr(2) + 'RequestHeaders headers,\n |' + Spacer_instance.qr(2) + emit_16(this, _this__u8e3s4.np_1) + ' body\n |' + Spacer_instance.toString() + ') implements Wirespec.Request<' + emit_16(this, _this__u8e3s4.np_1) + '> {\n |' + Spacer_instance.qr(2) + emitConstructor(this, _this__u8e3s4, endpoint) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
420
|
+
}
|
|
421
|
+
function emit_15(_this__u8e3s4) {
|
|
422
|
+
var tmp = Spacer_instance.toString();
|
|
423
|
+
var tmp_0 = Companion_instance_1.oq(_this__u8e3s4.qp_1);
|
|
424
|
+
var tmp_1 = Spacer_instance.qr(2);
|
|
425
|
+
var tmp_2 = Spacer_instance.qr(2);
|
|
426
|
+
var tmp_3 = Spacer_instance.qr(2);
|
|
427
|
+
var tmp_4 = emit_16(this, _this__u8e3s4.sp_1);
|
|
428
|
+
var tmp_5 = Spacer_instance.toString();
|
|
429
|
+
var tmp_6 = toString_0(first(_this__u8e3s4.qp_1));
|
|
430
|
+
var tmp_7 = emit_16(this, _this__u8e3s4.sp_1);
|
|
431
|
+
var tmp_8 = concatGenerics(emit_16(this, _this__u8e3s4.sp_1));
|
|
432
|
+
var tmp_9 = Spacer_instance.qr(2);
|
|
433
|
+
var tmp_10 = Companion_instance_1.oq(_this__u8e3s4.qp_1);
|
|
434
|
+
var tmp_11 = orNull(joinToString(_this__u8e3s4.rp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_5(this)));
|
|
435
|
+
var tmp0_safe_receiver = _this__u8e3s4.sp_1;
|
|
436
|
+
var tmp_12;
|
|
437
|
+
if (tmp0_safe_receiver == null) {
|
|
438
|
+
tmp_12 = null;
|
|
439
|
+
} else {
|
|
440
|
+
// Inline function 'kotlin.let' call
|
|
441
|
+
tmp_12 = emit_16(this, tmp0_safe_receiver) + ' body';
|
|
442
|
+
}
|
|
443
|
+
var tmp_13 = joinToString(listOfNotNull([tmp_11, tmp_12]));
|
|
444
|
+
var tmp_14 = Spacer_instance.qr(3);
|
|
445
|
+
var tmp_15 = fixStatus(_this__u8e3s4.qp_1);
|
|
446
|
+
// Inline function 'kotlin.let' call
|
|
447
|
+
var tmp_16 = 'new Headers(' + joinToString(_this__u8e3s4.rp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_6(this)) + ')';
|
|
448
|
+
var tmp_17 = _this__u8e3s4.sp_1 == null ? 'null' : 'body';
|
|
449
|
+
var tmp_18 = Spacer_instance.qr(2);
|
|
450
|
+
var tmp_19 = Spacer_instance.qr(1);
|
|
451
|
+
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.rp_1, 'Headers', 'Wirespec.Response.Headers', JavaEndpointDefinitionEmitter$emit$lambda_7(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
452
|
+
}
|
|
453
|
+
initMetadataForInterface(JavaEndpointDefinitionEmitter, 'JavaEndpointDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
454
|
+
initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [JavaEnumDefinitionEmitter, JavaUnionDefinitionEmitter, JavaRefinedTypeDefinitionEmitter, JavaChannelDefinitionEmitter, JavaTypeDefinitionEmitter, JavaIdentifierEmitter, JavaEndpointDefinitionEmitter, LanguageEmitter]);
|
|
453
455
|
initMetadataForCompanion(Companion);
|
|
454
456
|
initMetadataForCompanion(Companion_0);
|
|
455
457
|
initMetadataForClass(JavaIrEmitter$shared$1);
|
|
@@ -464,7 +466,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
464
466
|
var _iterator__ex2g4s = tmp0.t();
|
|
465
467
|
while (_iterator__ex2g4s.u()) {
|
|
466
468
|
var element = _iterator__ex2g4s.v();
|
|
467
|
-
if (!(_this__u8e3s4.
|
|
469
|
+
if (!(_this__u8e3s4.vq().l1() === element.lu_1)) {
|
|
468
470
|
destination.x(element);
|
|
469
471
|
}
|
|
470
472
|
}
|
|
@@ -474,7 +476,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
474
476
|
var _iterator__ex2g4s_0 = destination.t();
|
|
475
477
|
while (_iterator__ex2g4s_0.u()) {
|
|
476
478
|
var item = _iterator__ex2g4s_0.v();
|
|
477
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
479
|
+
var tmp$ret$3 = 'import ' + $this.k1v().mr_1 + '.model.' + item.lu_1 + ';';
|
|
478
480
|
destination_0.x(tmp$ret$3);
|
|
479
481
|
}
|
|
480
482
|
var tmp = destination_0;
|
|
@@ -482,8 +484,8 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
482
484
|
}
|
|
483
485
|
function emitFullyQualified($this, _this__u8e3s4, reference) {
|
|
484
486
|
var tmp;
|
|
485
|
-
if (_this__u8e3s4.
|
|
486
|
-
tmp = $this.
|
|
487
|
+
if (_this__u8e3s4.vq().l1() === reference.l1()) {
|
|
488
|
+
tmp = $this.k1v().mr_1 + '.model.';
|
|
487
489
|
} else {
|
|
488
490
|
tmp = '';
|
|
489
491
|
}
|
|
@@ -496,49 +498,49 @@ function JavaChannelDefinitionEmitter$emitImports$lambda(it) {
|
|
|
496
498
|
function JavaChannelDefinitionEmitter() {
|
|
497
499
|
}
|
|
498
500
|
function JavaEmitter(packageName, emitShared) {
|
|
499
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
500
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
501
|
+
packageName = packageName === VOID ? Companion_instance.lr('community.flock.wirespec.generated') : packageName;
|
|
502
|
+
emitShared = emitShared === VOID ? Companion_instance_0.go() : emitShared;
|
|
501
503
|
LanguageEmitter.call(this);
|
|
502
|
-
this.
|
|
503
|
-
this.
|
|
504
|
-
this.
|
|
505
|
-
this.
|
|
506
|
-
this.
|
|
507
|
-
this.
|
|
508
|
-
}
|
|
509
|
-
protoOf(JavaEmitter).
|
|
510
|
-
return this.
|
|
504
|
+
this.n1v_1 = packageName;
|
|
505
|
+
this.o1v_1 = emitShared;
|
|
506
|
+
this.p1v_1 = '\nimport community.flock.wirespec.java.Wirespec;\n';
|
|
507
|
+
this.q1v_1 = FileExtension_Java_getInstance();
|
|
508
|
+
this.r1v_1 = JavaShared_getInstance();
|
|
509
|
+
this.s1v_1 = '//';
|
|
510
|
+
}
|
|
511
|
+
protoOf(JavaEmitter).k1v = function () {
|
|
512
|
+
return this.n1v_1;
|
|
513
|
+
};
|
|
514
|
+
protoOf(JavaEmitter).eq = function () {
|
|
515
|
+
return this.q1v_1;
|
|
511
516
|
};
|
|
512
|
-
protoOf(JavaEmitter).
|
|
517
|
+
protoOf(JavaEmitter).t1v = function () {
|
|
513
518
|
return this.r1v_1;
|
|
514
519
|
};
|
|
515
|
-
protoOf(JavaEmitter).
|
|
520
|
+
protoOf(JavaEmitter).fq = function () {
|
|
516
521
|
return this.s1v_1;
|
|
517
522
|
};
|
|
518
|
-
protoOf(JavaEmitter).
|
|
519
|
-
return this.t1v_1;
|
|
520
|
-
};
|
|
521
|
-
protoOf(JavaEmitter).vq = function (module_0, logger) {
|
|
523
|
+
protoOf(JavaEmitter).tq = function (module_0, logger) {
|
|
522
524
|
// Inline function 'kotlin.let' call
|
|
523
|
-
var it = protoOf(LanguageEmitter).
|
|
524
|
-
return this.
|
|
525
|
+
var it = protoOf(LanguageEmitter).tq.call(this, module_0, logger);
|
|
526
|
+
return this.o1v_1.ho_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.lr('community.flock.wirespec.java').or() + 'Wirespec', this.t1v().v1v_1)) : it;
|
|
525
527
|
};
|
|
526
|
-
protoOf(JavaEmitter).
|
|
528
|
+
protoOf(JavaEmitter).uq = function (definition, module_0, logger) {
|
|
527
529
|
// Inline function 'kotlin.let' call
|
|
528
|
-
var it = protoOf(LanguageEmitter).
|
|
529
|
-
var subPackageName = plus(this.
|
|
530
|
-
var tmp = subPackageName.
|
|
530
|
+
var it = protoOf(LanguageEmitter).uq.call(this, definition, module_0, logger);
|
|
531
|
+
var subPackageName = plus(this.k1v(), definition);
|
|
532
|
+
var tmp = subPackageName.or() + this.w1v(it.io_1);
|
|
531
533
|
// Inline function 'kotlin.text.trimStart' call
|
|
532
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.
|
|
534
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.qq(module_0) ? this.p1v_1 : '') + '\n |' + it.jo_1 + '\n ');
|
|
533
535
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
534
536
|
return new Emitted(tmp, tmp$ret$0);
|
|
535
537
|
};
|
|
536
538
|
function emitGetType($this, _this__u8e3s4) {
|
|
537
|
-
return 'Wirespec.getType(' + $this.
|
|
539
|
+
return 'Wirespec.getType(' + $this.m1v(_this__u8e3s4, 'Void') + '.class, ' + emitGetTypeRaw($this, _this__u8e3s4) + ')';
|
|
538
540
|
}
|
|
539
541
|
function emitGetTypeRaw($this, _this__u8e3s4) {
|
|
540
542
|
var tmp;
|
|
541
|
-
var tmp1_elvis_lhs = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
543
|
+
var tmp1_elvis_lhs = _this__u8e3s4 == null ? null : _this__u8e3s4.du();
|
|
542
544
|
if (tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs) {
|
|
543
545
|
tmp = 'java.util.Optional.class';
|
|
544
546
|
} else {
|
|
@@ -553,9 +555,9 @@ function emitGetTypeRaw($this, _this__u8e3s4) {
|
|
|
553
555
|
function emitConstructor($this, _this__u8e3s4, endpoint) {
|
|
554
556
|
var tmp = get_pathParams(endpoint);
|
|
555
557
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda($this)));
|
|
556
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
557
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
558
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
558
|
+
var tmp_1 = orNull(joinToString(endpoint.hp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_0($this)));
|
|
559
|
+
var tmp_2 = orNull(joinToString(endpoint.ip_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_1($this)));
|
|
560
|
+
var tmp0_safe_receiver = _this__u8e3s4.np_1;
|
|
559
561
|
var tmp_3;
|
|
560
562
|
if (tmp0_safe_receiver == null) {
|
|
561
563
|
tmp_3 = null;
|
|
@@ -564,112 +566,112 @@ function emitConstructor($this, _this__u8e3s4, endpoint) {
|
|
|
564
566
|
tmp_3 = emit_16($this, tmp0_safe_receiver) + ' body';
|
|
565
567
|
}
|
|
566
568
|
var tmp_4 = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]));
|
|
567
|
-
var tmp_5 = Spacer_instance.
|
|
569
|
+
var tmp_5 = Spacer_instance.qr(3);
|
|
568
570
|
var tmp_6 = get_pathParams(endpoint);
|
|
569
571
|
// Inline function 'kotlin.let' call
|
|
570
572
|
var tmp$ret$3 = 'new Path(' + joinToString(tmp_6, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_2($this)) + ')';
|
|
571
573
|
var tmp1_elvis_lhs = orNull(tmp$ret$3);
|
|
572
574
|
var tmp_7 = tmp1_elvis_lhs == null ? 'new Path()' : tmp1_elvis_lhs;
|
|
573
|
-
var tmp_8 = 'Wirespec.Method.' + endpoint.
|
|
575
|
+
var tmp_8 = 'Wirespec.Method.' + endpoint.fp_1.a3_1;
|
|
574
576
|
// Inline function 'kotlin.let' call
|
|
575
|
-
var tmp$ret$5 = 'new Queries(' + joinToString(endpoint.
|
|
577
|
+
var tmp$ret$5 = 'new Queries(' + joinToString(endpoint.hp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_3($this)) + ')';
|
|
576
578
|
var tmp2_elvis_lhs = orNull(tmp$ret$5);
|
|
577
579
|
var tmp_9 = tmp2_elvis_lhs == null ? 'new Queries()' : tmp2_elvis_lhs;
|
|
578
580
|
// Inline function 'kotlin.let' call
|
|
579
|
-
var tmp$ret$7 = 'new RequestHeaders(' + joinToString(endpoint.
|
|
581
|
+
var tmp$ret$7 = 'new RequestHeaders(' + joinToString(endpoint.ip_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_4($this)) + ')';
|
|
580
582
|
var tmp3_elvis_lhs = orNull(tmp$ret$7);
|
|
581
583
|
var tmp_10 = tmp3_elvis_lhs == null ? 'new RequestHeaders()' : tmp3_elvis_lhs;
|
|
582
584
|
var tmp_11;
|
|
583
|
-
if (_this__u8e3s4.
|
|
585
|
+
if (_this__u8e3s4.np_1 == null) {
|
|
584
586
|
tmp_11 = null;
|
|
585
587
|
} else {
|
|
586
588
|
// Inline function 'kotlin.let' call
|
|
587
589
|
tmp_11 = 'body';
|
|
588
590
|
}
|
|
589
591
|
var tmp5_elvis_lhs = tmp_11;
|
|
590
|
-
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.
|
|
592
|
+
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.qr(2) + '}';
|
|
591
593
|
}
|
|
592
594
|
function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
593
595
|
var tmp = get_indexedPathParams(endpoint);
|
|
594
596
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
|
|
595
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
596
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
597
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
597
|
+
var tmp_1 = orNull(joinToString(endpoint.hp_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
598
|
+
var tmp_2 = orNull(joinToString(endpoint.ip_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
599
|
+
var tmp0_safe_receiver = _this__u8e3s4.np_1;
|
|
598
600
|
var tmp_3;
|
|
599
601
|
if (tmp0_safe_receiver == null) {
|
|
600
602
|
tmp_3 = null;
|
|
601
603
|
} else {
|
|
602
604
|
// Inline function 'kotlin.let' call
|
|
603
|
-
tmp_3 = Spacer_instance.
|
|
605
|
+
tmp_3 = Spacer_instance.qr(4) + 'request.body().<' + emit_16($this, tmp0_safe_receiver) + '>map(body -> serialization.deserializeBody(body, ' + emitGetType($this, tmp0_safe_receiver.pp_1) + ')).orElse(null)';
|
|
604
606
|
}
|
|
605
607
|
// Inline function 'kotlin.let' call
|
|
606
608
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
607
|
-
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.
|
|
609
|
+
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.qr(3);
|
|
608
610
|
}
|
|
609
611
|
function emitDeserializedParams_0($this, _this__u8e3s4) {
|
|
610
|
-
var tmp = orNull(joinToString(_this__u8e3s4.
|
|
611
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
612
|
+
var tmp = orNull(joinToString(_this__u8e3s4.rp_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2($this)));
|
|
613
|
+
var tmp0_safe_receiver = _this__u8e3s4.sp_1;
|
|
612
614
|
var tmp_0;
|
|
613
615
|
if (tmp0_safe_receiver == null) {
|
|
614
616
|
tmp_0 = null;
|
|
615
617
|
} else {
|
|
616
618
|
// Inline function 'kotlin.let' call
|
|
617
|
-
tmp_0 = Spacer_instance.
|
|
619
|
+
tmp_0 = Spacer_instance.qr(5) + 'response.body().<' + emit_16($this, tmp0_safe_receiver) + '>map(body -> serialization.deserializeBody(body, ' + emitGetType($this, tmp0_safe_receiver.pp_1) + ')).orElse(null)';
|
|
618
620
|
}
|
|
619
621
|
// Inline function 'kotlin.let' call
|
|
620
622
|
var it = joinToString(listOfNotNull([tmp, tmp_0]), ',\n');
|
|
621
|
-
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.
|
|
623
|
+
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.qr(4);
|
|
622
624
|
}
|
|
623
625
|
function emitSerialized($this, _this__u8e3s4) {
|
|
624
626
|
var tmp;
|
|
625
|
-
if (!(_this__u8e3s4.
|
|
626
|
-
tmp = 'java.util.Optional.ofNullable(serialization.serializeBody(r.body, ' + emitGetType($this, ensureNotNull(_this__u8e3s4.
|
|
627
|
+
if (!(_this__u8e3s4.sp_1 == null)) {
|
|
628
|
+
tmp = 'java.util.Optional.ofNullable(serialization.serializeBody(r.body, ' + emitGetType($this, ensureNotNull(_this__u8e3s4.sp_1).pp_1) + '))';
|
|
627
629
|
} else {
|
|
628
630
|
tmp = 'java.util.Optional.empty()';
|
|
629
631
|
}
|
|
630
632
|
var body = tmp;
|
|
631
633
|
var tmp_0;
|
|
632
634
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
633
|
-
if (!_this__u8e3s4.
|
|
634
|
-
tmp_0 = 'java.util.Map.ofEntries(' + joinToString(_this__u8e3s4.
|
|
635
|
+
if (!_this__u8e3s4.rp_1.r()) {
|
|
636
|
+
tmp_0 = 'java.util.Map.ofEntries(' + joinToString(_this__u8e3s4.rp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitSerialized$lambda($this)) + ')';
|
|
635
637
|
} else {
|
|
636
638
|
tmp_0 = 'java.util.Collections.emptyMap()';
|
|
637
639
|
}
|
|
638
640
|
var headers = tmp_0;
|
|
639
|
-
return Spacer_instance.
|
|
641
|
+
return Spacer_instance.qr(3) + 'if (response instanceof Response' + Companion_instance_1.oq(_this__u8e3s4.qp_1) + ' r) { return new Wirespec.RawResponse(r.status(), ' + headers + ', ' + body + '); }';
|
|
640
642
|
}
|
|
641
643
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
642
|
-
return Spacer_instance.
|
|
644
|
+
return Spacer_instance.qr(4) + 'case ' + _this__u8e3s4.qp_1 + ' -> new Response' + Companion_instance_1.oq(_this__u8e3s4.qp_1) + '(' + emitDeserializedParams_0($this, _this__u8e3s4) + ');';
|
|
643
645
|
}
|
|
644
646
|
function emitSerializedParams($this, _this__u8e3s4, fields) {
|
|
645
|
-
return 'java.util.Map.entry("' + _this__u8e3s4.
|
|
647
|
+
return 'java.util.Map.entry("' + _this__u8e3s4.ap_1.l1() + '", serialization.serializeParam(request.' + (fields === 'queries' ? 'queries' : 'headers') + '().' + $this.wq(_this__u8e3s4.ap_1) + '(), ' + emitGetType($this, _this__u8e3s4.bp_1) + '))';
|
|
646
648
|
}
|
|
647
649
|
function emitDeserialized_0($this, _this__u8e3s4) {
|
|
648
|
-
return Spacer_instance.
|
|
650
|
+
return Spacer_instance.qr(4) + 'serialization.deserializePath(request.path().get(' + _this__u8e3s4.le_1 + '), ' + emitGetType($this, _this__u8e3s4.me_1.mp_1) + ')';
|
|
649
651
|
}
|
|
650
652
|
function emitDeserializedParams_1($this, _this__u8e3s4, fields, caseSensitive) {
|
|
651
653
|
var tmp;
|
|
652
654
|
if (caseSensitive) {
|
|
653
|
-
tmp = 'request.' + fields + '().getOrDefault("' + _this__u8e3s4.
|
|
655
|
+
tmp = 'request.' + fields + '().getOrDefault("' + _this__u8e3s4.ap_1.l1() + '", java.util.Collections.emptyList())';
|
|
654
656
|
} else {
|
|
655
|
-
tmp = 'request.' + fields + '().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + _this__u8e3s4.
|
|
657
|
+
tmp = 'request.' + fields + '().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + _this__u8e3s4.ap_1.l1() + '")).findFirst().map(java.util.Map.Entry::getValue).orElse(java.util.Collections.emptyList())';
|
|
656
658
|
}
|
|
657
659
|
var valuesFromField = tmp;
|
|
658
|
-
return Spacer_instance.
|
|
660
|
+
return Spacer_instance.qr(4) + 'serialization.<' + $this.xp(_this__u8e3s4.bp_1) + '>deserializeParam(' + valuesFromField + ', ' + emitGetType($this, _this__u8e3s4.bp_1) + ')';
|
|
659
661
|
}
|
|
660
662
|
function emitSerializedHeader($this, _this__u8e3s4) {
|
|
661
|
-
return 'java.util.Map.entry("' + _this__u8e3s4.
|
|
663
|
+
return 'java.util.Map.entry("' + _this__u8e3s4.ap_1.l1() + '", serialization.<' + $this.xp(_this__u8e3s4.bp_1) + '>serializeParam(r.headers().' + $this.wq(_this__u8e3s4.ap_1) + '(), ' + emitGetType($this, _this__u8e3s4.bp_1) + '))';
|
|
662
664
|
}
|
|
663
665
|
function emitIdentifier($this, _this__u8e3s4) {
|
|
664
|
-
return 'serialization.serializePath(request.path().' + Companion_instance_1.
|
|
666
|
+
return 'serialization.serializePath(request.path().' + Companion_instance_1.pq($this.wq(_this__u8e3s4.lp_1)) + '(), ' + emitGetType($this, _this__u8e3s4.mp_1) + ')';
|
|
665
667
|
}
|
|
666
668
|
function emit_16($this, _this__u8e3s4) {
|
|
667
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
668
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
669
|
+
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.pp_1;
|
|
670
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.xp(tmp1_safe_receiver);
|
|
669
671
|
return tmp2_elvis_lhs == null ? 'Void' : tmp2_elvis_lhs;
|
|
670
672
|
}
|
|
671
673
|
function emit_17($this, _this__u8e3s4) {
|
|
672
|
-
return $this.
|
|
674
|
+
return $this.xp(_this__u8e3s4.mp_1) + ' ' + $this.wq(_this__u8e3s4.lp_1);
|
|
673
675
|
}
|
|
674
676
|
function emitImports_0($this, _this__u8e3s4) {
|
|
675
677
|
// Inline function 'kotlin.collections.filter' call
|
|
@@ -679,7 +681,7 @@ function emitImports_0($this, _this__u8e3s4) {
|
|
|
679
681
|
var _iterator__ex2g4s = tmp0.t();
|
|
680
682
|
while (_iterator__ex2g4s.u()) {
|
|
681
683
|
var element = _iterator__ex2g4s.v();
|
|
682
|
-
if (!(_this__u8e3s4.
|
|
684
|
+
if (!(_this__u8e3s4.vq().l1() === element.lu_1)) {
|
|
683
685
|
destination.x(element);
|
|
684
686
|
}
|
|
685
687
|
}
|
|
@@ -689,46 +691,46 @@ function emitImports_0($this, _this__u8e3s4) {
|
|
|
689
691
|
var _iterator__ex2g4s_0 = destination.t();
|
|
690
692
|
while (_iterator__ex2g4s_0.u()) {
|
|
691
693
|
var item = _iterator__ex2g4s_0.v();
|
|
692
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
694
|
+
var tmp$ret$3 = 'import ' + $this.k1v().mr_1 + '.model.' + item.lu_1 + ';';
|
|
693
695
|
destination_0.x(tmp$ret$3);
|
|
694
696
|
}
|
|
695
697
|
var tmp = destination_0;
|
|
696
698
|
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitImports$lambda);
|
|
697
699
|
}
|
|
698
700
|
function emitRequestFunctions($this, _this__u8e3s4, endpoint) {
|
|
699
|
-
var tmp = Spacer_instance.
|
|
700
|
-
var tmp_0 = Spacer_instance.
|
|
701
|
-
var tmp_1 = Spacer_instance.
|
|
702
|
-
var tmp_2 = Spacer_instance.
|
|
703
|
-
var tmp_3 = joinToString(endpoint.
|
|
704
|
-
var tmp_4 = Spacer_instance.
|
|
701
|
+
var tmp = Spacer_instance.qr(2);
|
|
702
|
+
var tmp_0 = Spacer_instance.qr(3);
|
|
703
|
+
var tmp_1 = Spacer_instance.qr(4);
|
|
704
|
+
var tmp_2 = Spacer_instance.qr(4);
|
|
705
|
+
var tmp_3 = joinToString(endpoint.gp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda($this));
|
|
706
|
+
var tmp_4 = Spacer_instance.qr(4);
|
|
705
707
|
var tmp_5;
|
|
706
708
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
707
|
-
if (!endpoint.
|
|
708
|
-
tmp_5 = 'java.util.Map.ofEntries(' + joinToString(endpoint.
|
|
709
|
+
if (!endpoint.hp_1.r()) {
|
|
710
|
+
tmp_5 = 'java.util.Map.ofEntries(' + joinToString(endpoint.hp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_0($this)) + ')';
|
|
709
711
|
} else {
|
|
710
712
|
tmp_5 = 'java.util.Collections.emptyMap()';
|
|
711
713
|
}
|
|
712
714
|
var tmp_6 = tmp_5;
|
|
713
|
-
var tmp_7 = Spacer_instance.
|
|
715
|
+
var tmp_7 = Spacer_instance.qr(4);
|
|
714
716
|
var tmp_8;
|
|
715
717
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
716
|
-
if (!endpoint.
|
|
717
|
-
tmp_8 = 'java.util.Map.ofEntries(' + joinToString(endpoint.
|
|
718
|
+
if (!endpoint.ip_1.r()) {
|
|
719
|
+
tmp_8 = 'java.util.Map.ofEntries(' + joinToString(endpoint.ip_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1($this)) + ')';
|
|
718
720
|
} else {
|
|
719
721
|
tmp_8 = 'java.util.Collections.emptyMap()';
|
|
720
722
|
}
|
|
721
723
|
var tmp_9 = tmp_8;
|
|
722
|
-
var tmp_10 = Spacer_instance.
|
|
724
|
+
var tmp_10 = Spacer_instance.qr(4);
|
|
723
725
|
var tmp_11;
|
|
724
|
-
if (!(_this__u8e3s4.
|
|
725
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
726
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
726
|
+
if (!(_this__u8e3s4.np_1 == null)) {
|
|
727
|
+
var tmp0_safe_receiver = _this__u8e3s4.np_1;
|
|
728
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.pp_1;
|
|
727
729
|
tmp_11 = 'java.util.Optional.ofNullable(serialization.serializeBody(request.body(), ' + (tmp1_safe_receiver == null ? null : emitGetType($this, tmp1_safe_receiver)) + '))';
|
|
728
730
|
} else {
|
|
729
731
|
tmp_11 = 'java.util.Optional.empty()';
|
|
730
732
|
}
|
|
731
|
-
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.
|
|
733
|
+
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.qr(3) + ');\n |' + Spacer_instance.qr(2) + '}\n |\n |' + Spacer_instance.qr(2) + 'static Request fromRequest(Wirespec.Deserializer serialization, Wirespec.RawRequest request) {\n |' + Spacer_instance.qr(3) + 'return new Request(' + emitDeserializedParams($this, _this__u8e3s4, endpoint) + ');\n |' + Spacer_instance.qr(2) + '}\n ');
|
|
732
734
|
}
|
|
733
735
|
function emitObject($this, _this__u8e3s4, name, extends_0, block) {
|
|
734
736
|
var tmp;
|
|
@@ -742,13 +744,13 @@ function emitObject($this, _this__u8e3s4, name, extends_0, block) {
|
|
|
742
744
|
}
|
|
743
745
|
function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
744
746
|
// Inline function 'kotlin.collections.map' call
|
|
745
|
-
var this_0 = distinctByStatus(_this__u8e3s4.
|
|
747
|
+
var this_0 = distinctByStatus(_this__u8e3s4.kp_1);
|
|
746
748
|
// Inline function 'kotlin.collections.mapTo' call
|
|
747
749
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
748
750
|
var _iterator__ex2g4s = this_0.t();
|
|
749
751
|
while (_iterator__ex2g4s.u()) {
|
|
750
752
|
var item = _iterator__ex2g4s.v();
|
|
751
|
-
var tmp$ret$0 = emit_16($this, item.
|
|
753
|
+
var tmp$ret$0 = emit_16($this, item.sp_1);
|
|
752
754
|
destination.x(tmp$ret$0);
|
|
753
755
|
}
|
|
754
756
|
var tmp = distinct(destination);
|
|
@@ -756,13 +758,13 @@ function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
|
756
758
|
}
|
|
757
759
|
function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
758
760
|
// Inline function 'kotlin.collections.map' call
|
|
759
|
-
var this_0 = _this__u8e3s4.
|
|
761
|
+
var this_0 = _this__u8e3s4.kp_1;
|
|
760
762
|
// Inline function 'kotlin.collections.mapTo' call
|
|
761
763
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
762
764
|
var _iterator__ex2g4s = this_0.t();
|
|
763
765
|
while (_iterator__ex2g4s.u()) {
|
|
764
766
|
var item = _iterator__ex2g4s.v();
|
|
765
|
-
var tmp$ret$0 = new Char(first(item.
|
|
767
|
+
var tmp$ret$0 = new Char(first(item.qp_1));
|
|
766
768
|
destination.x(tmp$ret$0);
|
|
767
769
|
}
|
|
768
770
|
var tmp = distinct(destination);
|
|
@@ -770,26 +772,26 @@ function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
|
770
772
|
}
|
|
771
773
|
function emitFromResponse($this, _this__u8e3s4) {
|
|
772
774
|
// Inline function 'kotlin.collections.filter' call
|
|
773
|
-
var tmp0 = distinctByStatus(_this__u8e3s4.
|
|
775
|
+
var tmp0 = distinctByStatus(_this__u8e3s4.kp_1);
|
|
774
776
|
// Inline function 'kotlin.collections.filterTo' call
|
|
775
777
|
var destination = ArrayList_init_$Create$();
|
|
776
778
|
var _iterator__ex2g4s = tmp0.t();
|
|
777
779
|
while (_iterator__ex2g4s.u()) {
|
|
778
780
|
var element = _iterator__ex2g4s.v();
|
|
779
|
-
if (Companion_instance_1.
|
|
781
|
+
if (Companion_instance_1.rq(element.qp_1)) {
|
|
780
782
|
destination.x(element);
|
|
781
783
|
}
|
|
782
784
|
}
|
|
783
785
|
var statusResponses = destination;
|
|
784
786
|
var tmp;
|
|
785
787
|
if (statusResponses.r()) {
|
|
786
|
-
tmp = trimMargin('\n |' + Spacer_instance.
|
|
788
|
+
tmp = trimMargin('\n |' + Spacer_instance.qr(3) + 'throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n ');
|
|
787
789
|
} else if (statusResponses.a1() === 1) {
|
|
788
790
|
var response = first_0(statusResponses);
|
|
789
|
-
tmp = trimMargin('\n |' + Spacer_instance.
|
|
791
|
+
tmp = trimMargin('\n |' + Spacer_instance.qr(3) + 'if (response.statusCode() == ' + response.qp_1 + ') {\n |' + Spacer_instance.qr(4) + 'return new Response' + Companion_instance_1.oq(response.qp_1) + '(' + emitDeserializedParams_0($this, response) + ');\n |' + Spacer_instance.qr(3) + '} else {\n |' + Spacer_instance.qr(4) + 'throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n |' + Spacer_instance.qr(3) + '}\n ');
|
|
790
792
|
} else {
|
|
791
|
-
var tmp_0 = Spacer_instance.
|
|
792
|
-
tmp = trimMargin('\n |' + tmp_0 + 'return switch (response.statusCode()) {\n |' + joinToString(statusResponses, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitFromResponse$lambda($this)) + '\n |' + Spacer_instance.
|
|
793
|
+
var tmp_0 = Spacer_instance.qr(3);
|
|
794
|
+
tmp = trimMargin('\n |' + tmp_0 + 'return switch (response.statusCode()) {\n |' + joinToString(statusResponses, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitFromResponse$lambda($this)) + '\n |' + Spacer_instance.qr(4) + 'default -> throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n |' + Spacer_instance.qr(3) + '};\n ');
|
|
793
795
|
}
|
|
794
796
|
return tmp;
|
|
795
797
|
}
|
|
@@ -800,17 +802,17 @@ function JavaEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
|
800
802
|
}
|
|
801
803
|
function JavaEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
802
804
|
return function (it) {
|
|
803
|
-
return this$0.
|
|
805
|
+
return this$0.wp(it);
|
|
804
806
|
};
|
|
805
807
|
}
|
|
806
808
|
function JavaEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
807
809
|
return function (it) {
|
|
808
|
-
return this$0.
|
|
810
|
+
return this$0.wp(it);
|
|
809
811
|
};
|
|
810
812
|
}
|
|
811
813
|
function JavaEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
812
814
|
return function (it) {
|
|
813
|
-
return this$0.
|
|
815
|
+
return this$0.y1v(it);
|
|
814
816
|
};
|
|
815
817
|
}
|
|
816
818
|
function JavaEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
@@ -828,27 +830,27 @@ function JavaEndpointDefinitionEmitter$emitConstructor$lambda(this$0) {
|
|
|
828
830
|
}
|
|
829
831
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_0(this$0) {
|
|
830
832
|
return function (it) {
|
|
831
|
-
return this$0.
|
|
833
|
+
return this$0.wp(it);
|
|
832
834
|
};
|
|
833
835
|
}
|
|
834
836
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_1(this$0) {
|
|
835
837
|
return function (it) {
|
|
836
|
-
return this$0.
|
|
838
|
+
return this$0.wp(it);
|
|
837
839
|
};
|
|
838
840
|
}
|
|
839
841
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_2(this$0) {
|
|
840
842
|
return function (it) {
|
|
841
|
-
return this$0.
|
|
843
|
+
return this$0.wq(it.lp_1);
|
|
842
844
|
};
|
|
843
845
|
}
|
|
844
846
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_3(this$0) {
|
|
845
847
|
return function (it) {
|
|
846
|
-
return this$0.
|
|
848
|
+
return this$0.wq(it.ap_1);
|
|
847
849
|
};
|
|
848
850
|
}
|
|
849
851
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_4(this$0) {
|
|
850
852
|
return function (it) {
|
|
851
|
-
return this$0.
|
|
853
|
+
return this$0.wq(it.ap_1);
|
|
852
854
|
};
|
|
853
855
|
}
|
|
854
856
|
function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda(this$0) {
|
|
@@ -868,22 +870,22 @@ function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1(this$0) {
|
|
|
868
870
|
}
|
|
869
871
|
function JavaEndpointDefinitionEmitter$emit$lambda_5(this$0) {
|
|
870
872
|
return function (it) {
|
|
871
|
-
return this$0.
|
|
873
|
+
return this$0.wp(it);
|
|
872
874
|
};
|
|
873
875
|
}
|
|
874
876
|
function JavaEndpointDefinitionEmitter$emit$lambda_6(this$0) {
|
|
875
877
|
return function (it) {
|
|
876
|
-
return this$0.
|
|
878
|
+
return this$0.wq(it.ap_1);
|
|
877
879
|
};
|
|
878
880
|
}
|
|
879
881
|
function JavaEndpointDefinitionEmitter$emit$lambda_7(this$0) {
|
|
880
882
|
return function (it) {
|
|
881
|
-
return this$0.
|
|
883
|
+
return this$0.wp(it);
|
|
882
884
|
};
|
|
883
885
|
}
|
|
884
886
|
function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2(this$0) {
|
|
885
887
|
return function (it) {
|
|
886
|
-
return Spacer_instance.
|
|
888
|
+
return Spacer_instance.qr(5) + 'serialization.<' + this$0.xp(it.bp_1) + '>deserializeParam(response.headers().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + it.ap_1.l1() + '")).findFirst().map(java.util.Map.Entry::getValue).orElse(java.util.Collections.emptyList()), ' + emitGetType(this$0, it.bp_1) + ')';
|
|
887
889
|
};
|
|
888
890
|
}
|
|
889
891
|
function JavaEndpointDefinitionEmitter$emitSerialized$lambda(this$0) {
|
|
@@ -899,7 +901,7 @@ function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda(this$0) {
|
|
|
899
901
|
return function (it) {
|
|
900
902
|
var tmp;
|
|
901
903
|
if (it instanceof Literal) {
|
|
902
|
-
tmp = '"' + it.
|
|
904
|
+
tmp = '"' + it.hq_1 + '"';
|
|
903
905
|
} else {
|
|
904
906
|
if (it instanceof Param) {
|
|
905
907
|
tmp = emitIdentifier(this$0, it);
|
|
@@ -922,14 +924,14 @@ function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1(this$0) {
|
|
|
922
924
|
}
|
|
923
925
|
function JavaEndpointDefinitionEmitter$emitObject$lambda($block) {
|
|
924
926
|
return function (it) {
|
|
925
|
-
return Spacer_instance.
|
|
927
|
+
return Spacer_instance.qr(2) + $block(it);
|
|
926
928
|
};
|
|
927
929
|
}
|
|
928
930
|
function JavaEndpointDefinitionEmitter$emitResponseInterfaces$lambda(it) {
|
|
929
931
|
return Spacer_instance.toString() + 'sealed interface Response' + concatGenerics(it) + ' extends Response<' + it + '> {}';
|
|
930
932
|
}
|
|
931
933
|
function JavaEndpointDefinitionEmitter$emitStatusInterfaces$lambda(it) {
|
|
932
|
-
return Spacer_instance.toString() + 'sealed interface Response' + toString_0(it.
|
|
934
|
+
return Spacer_instance.toString() + 'sealed interface Response' + toString_0(it.h1_1) + 'XX<T> extends Response<T> {}';
|
|
933
935
|
}
|
|
934
936
|
function JavaEndpointDefinitionEmitter$emitFromResponse$lambda(this$0) {
|
|
935
937
|
return function (it) {
|
|
@@ -942,7 +944,7 @@ function sanitizeNegative($this, _this__u8e3s4) {
|
|
|
942
944
|
return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
|
|
943
945
|
}
|
|
944
946
|
function sanitizeEnum($this, _this__u8e3s4) {
|
|
945
|
-
return $this.
|
|
947
|
+
return $this.a1w($this.z1v(joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_')));
|
|
946
948
|
}
|
|
947
949
|
function JavaEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
948
950
|
return function (it) {
|
|
@@ -953,7 +955,7 @@ function JavaEnumDefinitionEmitter() {
|
|
|
953
955
|
}
|
|
954
956
|
function Companion() {
|
|
955
957
|
Companion_instance_2 = this;
|
|
956
|
-
this.
|
|
958
|
+
this.c1w_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']);
|
|
957
959
|
}
|
|
958
960
|
var Companion_instance_2;
|
|
959
961
|
function Companion_getInstance_0() {
|
|
@@ -962,16 +964,26 @@ function Companion_getInstance_0() {
|
|
|
962
964
|
return Companion_instance_2;
|
|
963
965
|
}
|
|
964
966
|
function JavaIdentifierEmitter$sanitizeSymbol$lambda(it) {
|
|
965
|
-
return isLetterOrDigit(it.
|
|
967
|
+
return isLetterOrDigit(it.h1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).u1(it);
|
|
966
968
|
}
|
|
967
969
|
function JavaIdentifierEmitter() {
|
|
968
970
|
}
|
|
971
|
+
function JavaIrEmitter$shared$o$clientServer$lambda(name) {
|
|
972
|
+
switch (name.s1h()) {
|
|
973
|
+
case 'client':
|
|
974
|
+
return Companion_getInstance().m1h('getClient');
|
|
975
|
+
case 'server':
|
|
976
|
+
return Companion_getInstance().m1h('getServer');
|
|
977
|
+
default:
|
|
978
|
+
return null;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
969
981
|
function JavaIrEmitter$shared$o$wirespecFile$lambda(this$0) {
|
|
970
982
|
return function (element, transformer) {
|
|
971
983
|
var tmp;
|
|
972
984
|
if (element instanceof File) {
|
|
973
985
|
// Inline function 'kotlin.collections.partition' call
|
|
974
|
-
var this_0 = element.
|
|
986
|
+
var this_0 = element.u1m_1;
|
|
975
987
|
var first = ArrayList_init_$Create$();
|
|
976
988
|
var second = ArrayList_init_$Create$();
|
|
977
989
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -984,9 +996,9 @@ function JavaIrEmitter$shared$o$wirespecFile$lambda(this$0) {
|
|
|
984
996
|
}
|
|
985
997
|
}
|
|
986
998
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
987
|
-
var packageElements = _destruct__k2r9zo.
|
|
988
|
-
var rest = _destruct__k2r9zo.
|
|
989
|
-
tmp = element.
|
|
999
|
+
var packageElements = _destruct__k2r9zo.ne();
|
|
1000
|
+
var rest = _destruct__k2r9zo.oe();
|
|
1001
|
+
tmp = element.x1m(VOID, plus_1(plus_1(packageElements, this$0.f1w_1), rest));
|
|
990
1002
|
} else {
|
|
991
1003
|
tmp = element;
|
|
992
1004
|
}
|
|
@@ -998,11 +1010,11 @@ function JavaIrEmitter$shared$o$wirespecFile$lambda_0(this$0) {
|
|
|
998
1010
|
return function (element, transformer) {
|
|
999
1011
|
var tmp;
|
|
1000
1012
|
if (element instanceof Namespace) {
|
|
1001
|
-
var injected = element.
|
|
1013
|
+
var injected = element.z1m_1.equals(Companion_getInstance().m1h('Wirespec')) ? this$0.g1w_1 : emptyList();
|
|
1002
1014
|
var tmp_0;
|
|
1003
1015
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1004
1016
|
if (!injected.r()) {
|
|
1005
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1017
|
+
tmp_0 = withElements(element, plus_1(element.v1m(), injected));
|
|
1006
1018
|
} else {
|
|
1007
1019
|
tmp_0 = element;
|
|
1008
1020
|
}
|
|
@@ -1025,7 +1037,7 @@ function sanitizeSymbol_0($this, _this__u8e3s4) {
|
|
|
1025
1037
|
var item = _iterator__ex2g4s.v();
|
|
1026
1038
|
var _unary__edvuaz = index;
|
|
1027
1039
|
index = _unary__edvuaz + 1 | 0;
|
|
1028
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
1040
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.oq(item) : item;
|
|
1029
1041
|
destination.x(tmp$ret$0);
|
|
1030
1042
|
}
|
|
1031
1043
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1065,7 +1077,7 @@ function sanitizeFirstIsDigit_0($this, _this__u8e3s4) {
|
|
|
1065
1077
|
return tmp;
|
|
1066
1078
|
}
|
|
1067
1079
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1068
|
-
return Companion_getInstance_1().
|
|
1080
|
+
return Companion_getInstance_1().j1w_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1069
1081
|
}
|
|
1070
1082
|
function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
1071
1083
|
return sanitizeKeywords_0($this, sanitizeFirstIsDigit_0($this, joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_')));
|
|
@@ -1078,7 +1090,7 @@ function buildImports($this, _this__u8e3s4) {
|
|
|
1078
1090
|
var _iterator__ex2g4s = tmp0.t();
|
|
1079
1091
|
while (_iterator__ex2g4s.u()) {
|
|
1080
1092
|
var element = _iterator__ex2g4s.v();
|
|
1081
|
-
if (!(_this__u8e3s4.
|
|
1093
|
+
if (!(_this__u8e3s4.vq().l1() === element.lu_1)) {
|
|
1082
1094
|
destination.x(element);
|
|
1083
1095
|
}
|
|
1084
1096
|
}
|
|
@@ -1088,7 +1100,7 @@ function buildImports($this, _this__u8e3s4) {
|
|
|
1088
1100
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1089
1101
|
while (_iterator__ex2g4s_0.u()) {
|
|
1090
1102
|
var item = _iterator__ex2g4s_0.v();
|
|
1091
|
-
var tmp$ret$3 = import_0($this.
|
|
1103
|
+
var tmp$ret$3 = import_0($this.k1v().mr_1 + '.model', item.lu_1);
|
|
1092
1104
|
destination_0.x(tmp$ret$3);
|
|
1093
1105
|
}
|
|
1094
1106
|
return destination_0;
|
|
@@ -1100,18 +1112,18 @@ function injectHandleFunction($this, _this__u8e3s4, endpoint) {
|
|
|
1100
1112
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1101
1113
|
var tmp = scope;
|
|
1102
1114
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1103
|
-
var this_0 = scope.
|
|
1115
|
+
var this_0 = scope.z1t_1;
|
|
1104
1116
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1105
1117
|
// Inline function 'kotlin.apply' call
|
|
1106
1118
|
var this_1 = new TransformerBuilder();
|
|
1107
|
-
this_1.
|
|
1108
|
-
var tmp$ret$2 = this_1.
|
|
1109
|
-
tmp.
|
|
1110
|
-
var tmp_0 = scope.
|
|
1119
|
+
this_1.d1h(JavaIrEmitter$injectHandleFunction$lambda(handlersStruct));
|
|
1120
|
+
var tmp$ret$2 = this_1.e1h();
|
|
1121
|
+
tmp.z1t_1 = transform(this_0, tmp$ret$2);
|
|
1122
|
+
var tmp_0 = scope.z1t_1;
|
|
1111
1123
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1112
1124
|
}
|
|
1113
1125
|
function buildHandlers($this, endpoint) {
|
|
1114
|
-
var pathTemplate = '/' + joinToString(endpoint.
|
|
1126
|
+
var pathTemplate = '/' + joinToString(endpoint.gp_1, '/', VOID, VOID, VOID, VOID, JavaIrEmitter$buildHandlers$lambda);
|
|
1115
1127
|
return struct('Handlers', JavaIrEmitter$buildHandlers$lambda_0(pathTemplate, endpoint));
|
|
1116
1128
|
}
|
|
1117
1129
|
function withFullyQualifiedPrefix($this, _this__u8e3s4, prefix) {
|
|
@@ -1121,8 +1133,8 @@ function withFullyQualifiedPrefix($this, _this__u8e3s4, prefix) {
|
|
|
1121
1133
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1122
1134
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1123
1135
|
var tmp_0 = JavaIrEmitter$withFullyQualifiedPrefix$lambda;
|
|
1124
|
-
scope.
|
|
1125
|
-
var tmp_1 = scope.
|
|
1136
|
+
scope.c1u(tmp_0, JavaIrEmitter$withFullyQualifiedPrefix$lambda_0(prefix));
|
|
1137
|
+
var tmp_1 = scope.z1t_1;
|
|
1126
1138
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1127
1139
|
} else {
|
|
1128
1140
|
tmp = _this__u8e3s4;
|
|
@@ -1132,20 +1144,20 @@ function withFullyQualifiedPrefix($this, _this__u8e3s4, prefix) {
|
|
|
1132
1144
|
function transformTypeDescriptors($this, _this__u8e3s4) {
|
|
1133
1145
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1134
1146
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1135
|
-
scope.
|
|
1136
|
-
var tmp = scope.
|
|
1147
|
+
scope.i1u(JavaIrEmitter$transformTypeDescriptors$lambda($this));
|
|
1148
|
+
var tmp = scope.z1t_1;
|
|
1137
1149
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1138
1150
|
}
|
|
1139
1151
|
function findRoot($this, _this__u8e3s4) {
|
|
1140
1152
|
var tmp;
|
|
1141
1153
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
1142
|
-
tmp = findRoot($this, _this__u8e3s4.
|
|
1154
|
+
tmp = findRoot($this, _this__u8e3s4.o1h_1);
|
|
1143
1155
|
} else {
|
|
1144
1156
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
1145
|
-
tmp = findRoot($this, _this__u8e3s4.
|
|
1157
|
+
tmp = findRoot($this, _this__u8e3s4.p1h_1);
|
|
1146
1158
|
} else {
|
|
1147
1159
|
if (_this__u8e3s4 instanceof Dict_0) {
|
|
1148
|
-
tmp = findRoot($this, _this__u8e3s4.
|
|
1160
|
+
tmp = findRoot($this, _this__u8e3s4.k1m_1);
|
|
1149
1161
|
} else {
|
|
1150
1162
|
tmp = _this__u8e3s4;
|
|
1151
1163
|
}
|
|
@@ -1174,7 +1186,7 @@ function toJavaName($this, _this__u8e3s4) {
|
|
|
1174
1186
|
var tmp;
|
|
1175
1187
|
if (_this__u8e3s4 instanceof Integer_0) {
|
|
1176
1188
|
var tmp_0;
|
|
1177
|
-
switch (_this__u8e3s4.
|
|
1189
|
+
switch (_this__u8e3s4.g1m_1.b3_1) {
|
|
1178
1190
|
case 0:
|
|
1179
1191
|
tmp_0 = 'Integer';
|
|
1180
1192
|
break;
|
|
@@ -1189,7 +1201,7 @@ function toJavaName($this, _this__u8e3s4) {
|
|
|
1189
1201
|
} else {
|
|
1190
1202
|
if (_this__u8e3s4 instanceof Number_1) {
|
|
1191
1203
|
var tmp_1;
|
|
1192
|
-
switch (_this__u8e3s4.
|
|
1204
|
+
switch (_this__u8e3s4.h1m_1.b3_1) {
|
|
1193
1205
|
case 0:
|
|
1194
1206
|
tmp_1 = 'Float';
|
|
1195
1207
|
break;
|
|
@@ -1218,7 +1230,7 @@ function toJavaName($this, _this__u8e3s4) {
|
|
|
1218
1230
|
tmp = 'Void';
|
|
1219
1231
|
} else {
|
|
1220
1232
|
if (_this__u8e3s4 instanceof Custom_0) {
|
|
1221
|
-
tmp = _this__u8e3s4.
|
|
1233
|
+
tmp = _this__u8e3s4.q1h_1;
|
|
1222
1234
|
} else {
|
|
1223
1235
|
tmp = 'Object';
|
|
1224
1236
|
}
|
|
@@ -1233,7 +1245,7 @@ function toJavaName($this, _this__u8e3s4) {
|
|
|
1233
1245
|
}
|
|
1234
1246
|
function Companion_0() {
|
|
1235
1247
|
Companion_instance_3 = this;
|
|
1236
|
-
this.
|
|
1248
|
+
this.j1w_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']);
|
|
1237
1249
|
}
|
|
1238
1250
|
var Companion_instance_3;
|
|
1239
1251
|
function Companion_getInstance_1() {
|
|
@@ -1245,10 +1257,10 @@ function JavaIrEmitter$sanitizationConfig$lambda(it) {
|
|
|
1245
1257
|
return '_' + it;
|
|
1246
1258
|
}
|
|
1247
1259
|
function JavaIrEmitter$sanitizationConfig$lambda_0(name) {
|
|
1248
|
-
return name.
|
|
1260
|
+
return name.n1h_1.a1() > 1 ? new Name(listOf(name.r1l())) : name;
|
|
1249
1261
|
}
|
|
1250
1262
|
function JavaIrEmitter$sanitizationConfig$lambda_1(name) {
|
|
1251
|
-
return new Name(listOf(name.
|
|
1263
|
+
return new Name(listOf(name.r1l()));
|
|
1252
1264
|
}
|
|
1253
1265
|
function JavaIrEmitter$sanitizationConfig$lambda_2(this$0) {
|
|
1254
1266
|
return function (it) {
|
|
@@ -1259,62 +1271,68 @@ function JavaIrEmitter$sanitizationConfig$lambda_3(stmt, tr) {
|
|
|
1259
1271
|
var tmp;
|
|
1260
1272
|
var tmp_0;
|
|
1261
1273
|
if (stmt instanceof FunctionCall) {
|
|
1262
|
-
tmp_0 = stmt.
|
|
1274
|
+
tmp_0 = stmt.b1m_1.s1h() === 'validate';
|
|
1263
1275
|
} else {
|
|
1264
1276
|
tmp_0 = false;
|
|
1265
1277
|
}
|
|
1266
1278
|
if (tmp_0) {
|
|
1267
|
-
tmp = transformChildren_0(stmt.
|
|
1279
|
+
tmp = transformChildren_0(stmt.f1m(VOID, emptyList()), tr);
|
|
1268
1280
|
} else {
|
|
1269
1281
|
tmp = transformChildren_0(stmt, tr);
|
|
1270
1282
|
}
|
|
1271
1283
|
return tmp;
|
|
1272
1284
|
}
|
|
1273
1285
|
function JavaIrEmitter$shared$1() {
|
|
1274
|
-
this.
|
|
1275
|
-
this.
|
|
1276
|
-
this.
|
|
1277
|
-
this.h1w_1 = plus_1(buildClientServerInterfaces(AccessorStyle_GETTER_METHODS_getInstance()), listOf(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}')));
|
|
1286
|
+
this.d1w_1 = 'community.flock.wirespec.java';
|
|
1287
|
+
this.e1w_1 = convert(new Shared(this.d1w_1));
|
|
1288
|
+
this.f1w_1 = listOf_0([import_0('java.lang.reflect', 'Type'), import_0('java.lang.reflect', 'ParameterizedType'), import_0('java.util', 'List'), import_0('java.util', 'Map')]);
|
|
1278
1289
|
var tmp = this;
|
|
1290
|
+
// Inline function 'kotlin.collections.map' call
|
|
1291
|
+
var this_0 = convertClientServer(new Shared(this.d1w_1));
|
|
1292
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1293
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1294
|
+
var _iterator__ex2g4s = this_0.t();
|
|
1295
|
+
while (_iterator__ex2g4s.u()) {
|
|
1296
|
+
var item = _iterator__ex2g4s.v();
|
|
1297
|
+
var tmp$ret$0 = toGetterAccessors(item, JavaIrEmitter$shared$o$clientServer$lambda);
|
|
1298
|
+
destination.x(tmp$ret$0);
|
|
1299
|
+
}
|
|
1300
|
+
tmp.g1w_1 = plus_1(destination, listOf(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}')));
|
|
1301
|
+
var tmp_0 = this;
|
|
1279
1302
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1280
|
-
var
|
|
1281
|
-
var scope = new TransformScope(
|
|
1303
|
+
var this_1 = this.e1w_1;
|
|
1304
|
+
var scope = new TransformScope(this_1);
|
|
1282
1305
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1283
|
-
var
|
|
1306
|
+
var tmp_1 = scope;
|
|
1284
1307
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1285
|
-
var
|
|
1308
|
+
var this_2 = scope.z1t_1;
|
|
1286
1309
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1287
1310
|
// Inline function 'kotlin.apply' call
|
|
1288
|
-
var
|
|
1289
|
-
|
|
1290
|
-
var tmp$ret$
|
|
1291
|
-
|
|
1311
|
+
var this_3 = new TransformerBuilder();
|
|
1312
|
+
this_3.d1h(JavaIrEmitter$shared$o$wirespecFile$lambda(this));
|
|
1313
|
+
var tmp$ret$5 = this_3.e1h();
|
|
1314
|
+
tmp_1.z1t_1 = transform(this_2, tmp$ret$5);
|
|
1292
1315
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1293
|
-
var
|
|
1316
|
+
var tmp_2 = scope;
|
|
1294
1317
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1295
1318
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1296
|
-
var
|
|
1319
|
+
var this_4 = scope.z1t_1;
|
|
1297
1320
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1298
1321
|
// Inline function 'kotlin.apply' call
|
|
1299
|
-
var
|
|
1300
|
-
|
|
1301
|
-
var tmp$ret$
|
|
1302
|
-
|
|
1303
|
-
var
|
|
1304
|
-
|
|
1305
|
-
this.
|
|
1306
|
-
}
|
|
1307
|
-
protoOf(JavaIrEmitter$shared$1).
|
|
1308
|
-
return this.
|
|
1322
|
+
var this_5 = new TransformerBuilder();
|
|
1323
|
+
this_5.d1h(JavaIrEmitter$shared$o$wirespecFile$lambda_0(this));
|
|
1324
|
+
var tmp$ret$10 = this_5.e1h();
|
|
1325
|
+
tmp_2.z1t_1 = transform(this_4, tmp$ret$10);
|
|
1326
|
+
var tmp_3 = scope.z1t_1;
|
|
1327
|
+
tmp_0.h1w_1 = isInterface(tmp_3, Element) ? tmp_3 : THROW_CCE();
|
|
1328
|
+
this.i1w_1 = generateJava(this.h1w_1);
|
|
1329
|
+
}
|
|
1330
|
+
protoOf(JavaIrEmitter$shared$1).r1w = function () {
|
|
1331
|
+
return this.i1w_1;
|
|
1309
1332
|
};
|
|
1310
1333
|
function JavaIrEmitter$emit$lambda(this$0) {
|
|
1311
1334
|
return function () {
|
|
1312
|
-
return new File(Companion_getInstance().
|
|
1313
|
-
};
|
|
1314
|
-
}
|
|
1315
|
-
function JavaIrEmitter$emit$lambda_0(this$0) {
|
|
1316
|
-
return function (it) {
|
|
1317
|
-
return sanitizeSymbol_0(this$0, it.u1l());
|
|
1335
|
+
return new File(Companion_getInstance().m1h(Companion_instance.lr('community.flock.wirespec.java').or() + 'Wirespec'), listOf(new RawElement(this$0.t1v().r1w())));
|
|
1318
1336
|
};
|
|
1319
1337
|
}
|
|
1320
1338
|
function JavaIrEmitter$emit$lambda$lambda(this$0) {
|
|
@@ -1323,16 +1341,16 @@ function JavaIrEmitter$emit$lambda$lambda(this$0) {
|
|
|
1323
1341
|
};
|
|
1324
1342
|
}
|
|
1325
1343
|
function JavaIrEmitter$emit$lambda$lambda_0($this$function) {
|
|
1326
|
-
$this$function.
|
|
1327
|
-
$this$function.
|
|
1344
|
+
$this$function.k1i(String_instance);
|
|
1345
|
+
$this$function.j1k(new VariableReference(Companion_getInstance().m1h('label')));
|
|
1328
1346
|
return Unit_instance;
|
|
1329
1347
|
}
|
|
1330
|
-
function JavaIrEmitter$emit$
|
|
1348
|
+
function JavaIrEmitter$emit$lambda_0(this$0) {
|
|
1331
1349
|
return function (element, transformer) {
|
|
1332
1350
|
var tmp;
|
|
1333
1351
|
if (element instanceof Enum) {
|
|
1334
|
-
var tmp_0 = JavaIrEmitter$emit$lambda$lambda(this$0);
|
|
1335
|
-
tmp =
|
|
1352
|
+
var tmp_0 = withLabelField(element, JavaIrEmitter$emit$lambda$lambda(this$0));
|
|
1353
|
+
tmp = plus_3(tmp_0, function_0('label', VOID, VOID, JavaIrEmitter$emit$lambda$lambda_0));
|
|
1336
1354
|
} else {
|
|
1337
1355
|
tmp = element;
|
|
1338
1356
|
}
|
|
@@ -1342,18 +1360,18 @@ function JavaIrEmitter$emit$lambda_1(this$0) {
|
|
|
1342
1360
|
}
|
|
1343
1361
|
function JavaIrEmitter$emit$lambda$lambda_1($refined) {
|
|
1344
1362
|
return function ($this$function) {
|
|
1345
|
-
$this$function.
|
|
1346
|
-
$this$function.
|
|
1363
|
+
$this$function.k1i(convert_0($refined.cr_1));
|
|
1364
|
+
$this$function.j1k(new VariableReference(Companion_getInstance().m1h('value')));
|
|
1347
1365
|
return Unit_instance;
|
|
1348
1366
|
};
|
|
1349
1367
|
}
|
|
1350
|
-
function JavaIrEmitter$emit$
|
|
1368
|
+
function JavaIrEmitter$emit$lambda_1($refined) {
|
|
1351
1369
|
return function (element, transformer) {
|
|
1352
1370
|
var tmp;
|
|
1353
1371
|
if (element instanceof Struct) {
|
|
1354
1372
|
var tmp_0 = listOf(new Custom_0('Wirespec.Refined'));
|
|
1355
1373
|
// Inline function 'kotlin.collections.map' call
|
|
1356
|
-
var this_0 = element.
|
|
1374
|
+
var this_0 = element.j1n_1;
|
|
1357
1375
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1358
1376
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1359
1377
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -1361,15 +1379,15 @@ function JavaIrEmitter$emit$lambda_2($refined) {
|
|
|
1361
1379
|
var item = _iterator__ex2g4s.v();
|
|
1362
1380
|
var tmp_1;
|
|
1363
1381
|
if (item instanceof Function) {
|
|
1364
|
-
tmp_1 = item.
|
|
1382
|
+
tmp_1 = item.b1k(VOID, VOID, VOID, VOID, VOID, VOID, VOID, true);
|
|
1365
1383
|
} else {
|
|
1366
1384
|
tmp_1 = item;
|
|
1367
1385
|
}
|
|
1368
1386
|
var tmp$ret$0 = tmp_1;
|
|
1369
1387
|
destination.x(tmp$ret$0);
|
|
1370
1388
|
}
|
|
1371
|
-
var tmp_2 = destination;
|
|
1372
|
-
tmp =
|
|
1389
|
+
var tmp_2 = element.l1n(VOID, VOID, VOID, tmp_0, destination);
|
|
1390
|
+
tmp = plus_3(tmp_2, function_0('value', VOID, true, JavaIrEmitter$emit$lambda$lambda_1($refined)));
|
|
1373
1391
|
} else {
|
|
1374
1392
|
tmp = element;
|
|
1375
1393
|
}
|
|
@@ -1377,11 +1395,11 @@ function JavaIrEmitter$emit$lambda_2($refined) {
|
|
|
1377
1395
|
return transformChildren(transformed, transformer);
|
|
1378
1396
|
};
|
|
1379
1397
|
}
|
|
1380
|
-
function JavaIrEmitter$emit$
|
|
1398
|
+
function JavaIrEmitter$emit$lambda_2($imports) {
|
|
1381
1399
|
return function (element, transformer) {
|
|
1382
1400
|
var tmp;
|
|
1383
1401
|
if (element instanceof File) {
|
|
1384
|
-
tmp = element.
|
|
1402
|
+
tmp = element.x1m(VOID, plus_1($imports, element.u1m_1));
|
|
1385
1403
|
} else {
|
|
1386
1404
|
tmp = element;
|
|
1387
1405
|
}
|
|
@@ -1389,7 +1407,7 @@ function JavaIrEmitter$emit$lambda_3($imports) {
|
|
|
1389
1407
|
return transformChildren(transformed, transformer);
|
|
1390
1408
|
};
|
|
1391
1409
|
}
|
|
1392
|
-
function JavaIrEmitter$emit$
|
|
1410
|
+
function JavaIrEmitter$emit$lambda_3(this$0, $fullyQualifiedPrefix) {
|
|
1393
1411
|
return function (element, transformer) {
|
|
1394
1412
|
var tmp;
|
|
1395
1413
|
if (element instanceof Interface) {
|
|
@@ -1401,12 +1419,12 @@ function JavaIrEmitter$emit$lambda_4(this$0, $fullyQualifiedPrefix) {
|
|
|
1401
1419
|
return transformChildren(transformed, transformer);
|
|
1402
1420
|
};
|
|
1403
1421
|
}
|
|
1404
|
-
function JavaIrEmitter$emit$
|
|
1422
|
+
function JavaIrEmitter$emit$lambda_4(element, transformer) {
|
|
1405
1423
|
var tmp;
|
|
1406
1424
|
if (element instanceof File) {
|
|
1407
1425
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1408
1426
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1409
|
-
var tmp0 = element.
|
|
1427
|
+
var tmp0 = element.v1m();
|
|
1410
1428
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1411
1429
|
var destination = ArrayList_init_$Create$();
|
|
1412
1430
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1418,7 +1436,7 @@ function JavaIrEmitter$emit$lambda_5(element, transformer) {
|
|
|
1418
1436
|
}
|
|
1419
1437
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1420
1438
|
var interfaceElement = ensureNotNull(tmp$ret$2);
|
|
1421
|
-
tmp = element.
|
|
1439
|
+
tmp = element.x1m(VOID, listOf_0([new RawElement('@FunctionalInterface\n'), interfaceElement]));
|
|
1422
1440
|
} else {
|
|
1423
1441
|
tmp = element;
|
|
1424
1442
|
}
|
|
@@ -1430,9 +1448,9 @@ function JavaIrEmitter$emitEndpointClient$lambda($endpointName) {
|
|
|
1430
1448
|
var tmp;
|
|
1431
1449
|
if (element instanceof Function) {
|
|
1432
1450
|
var tmp_0;
|
|
1433
|
-
if (element.
|
|
1434
|
-
var transportAssign = element.
|
|
1435
|
-
var returnStmt = last(element.
|
|
1451
|
+
if (element.y1j_1 && element.x1j_1.a1() >= 2) {
|
|
1452
|
+
var transportAssign = element.x1j_1.f1(element.x1j_1.a1() - 2 | 0);
|
|
1453
|
+
var returnStmt = last(element.x1j_1);
|
|
1436
1454
|
var tmp_1;
|
|
1437
1455
|
var tmp_2;
|
|
1438
1456
|
if (transportAssign instanceof Assignment) {
|
|
@@ -1441,11 +1459,11 @@ function JavaIrEmitter$emitEndpointClient$lambda($endpointName) {
|
|
|
1441
1459
|
tmp_2 = false;
|
|
1442
1460
|
}
|
|
1443
1461
|
if (tmp_2) {
|
|
1444
|
-
var bodyPrefix = dropLast(element.
|
|
1445
|
-
var tmp0_name = Companion_getInstance().
|
|
1446
|
-
var tmp1_receiver = transportAssign.
|
|
1447
|
-
var tmp2_arguments = mapOf(to(Companion_getInstance().
|
|
1448
|
-
tmp_1 = element.
|
|
1462
|
+
var bodyPrefix = dropLast(element.x1j_1, 2);
|
|
1463
|
+
var tmp0_name = Companion_getInstance().m1h('thenApply');
|
|
1464
|
+
var tmp1_receiver = transportAssign.w1o_1;
|
|
1465
|
+
var tmp2_arguments = mapOf(to(Companion_getInstance().m1h('mapper'), new RawExpression('rawResponse -> ' + $endpointName + '.fromRawResponse(serialization(), rawResponse)')));
|
|
1466
|
+
tmp_1 = element.b1k(VOID, VOID, VOID, VOID, plus_2(bodyPrefix, new ReturnStatement(new FunctionCall(tmp1_receiver, VOID, tmp0_name, tmp2_arguments))));
|
|
1449
1467
|
} else {
|
|
1450
1468
|
tmp_1 = element;
|
|
1451
1469
|
}
|
|
@@ -1469,7 +1487,7 @@ function JavaIrEmitter$injectHandleFunction$lambda$lambda($handlersStruct) {
|
|
|
1469
1487
|
var tmp_0;
|
|
1470
1488
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1471
1489
|
if (!injected.r()) {
|
|
1472
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1490
|
+
tmp_0 = withElements(element, plus_1(element.v1m(), injected));
|
|
1473
1491
|
} else {
|
|
1474
1492
|
tmp_0 = element;
|
|
1475
1493
|
}
|
|
@@ -1486,21 +1504,21 @@ function JavaIrEmitter$injectHandleFunction$lambda($handlersStruct) {
|
|
|
1486
1504
|
var tmp;
|
|
1487
1505
|
if (element instanceof Interface) {
|
|
1488
1506
|
var tmp_0;
|
|
1489
|
-
if (element.
|
|
1507
|
+
if (element.m1o_1.equals(Companion_getInstance().m1h('Handler'))) {
|
|
1490
1508
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1491
1509
|
var scope = new TransformScope(element);
|
|
1492
1510
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1493
1511
|
var tmp_1 = scope;
|
|
1494
1512
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1495
1513
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1496
|
-
var this_0 = scope.
|
|
1514
|
+
var this_0 = scope.z1t_1;
|
|
1497
1515
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1498
1516
|
// Inline function 'kotlin.apply' call
|
|
1499
1517
|
var this_1 = new TransformerBuilder();
|
|
1500
|
-
this_1.
|
|
1501
|
-
var tmp$ret$2 = this_1.
|
|
1502
|
-
tmp_1.
|
|
1503
|
-
var tmp_2 = scope.
|
|
1518
|
+
this_1.d1h(JavaIrEmitter$injectHandleFunction$lambda$lambda($handlersStruct));
|
|
1519
|
+
var tmp$ret$2 = this_1.e1h();
|
|
1520
|
+
tmp_1.z1t_1 = transform(this_0, tmp$ret$2);
|
|
1521
|
+
var tmp_2 = scope.z1t_1;
|
|
1504
1522
|
tmp_0 = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1505
1523
|
} else {
|
|
1506
1524
|
tmp_0 = element;
|
|
@@ -1516,10 +1534,10 @@ function JavaIrEmitter$injectHandleFunction$lambda($handlersStruct) {
|
|
|
1516
1534
|
function JavaIrEmitter$buildHandlers$lambda(it) {
|
|
1517
1535
|
var tmp;
|
|
1518
1536
|
if (it instanceof Literal) {
|
|
1519
|
-
tmp = it.
|
|
1537
|
+
tmp = it.hq_1;
|
|
1520
1538
|
} else {
|
|
1521
1539
|
if (it instanceof Param) {
|
|
1522
|
-
tmp = '{' + it.
|
|
1540
|
+
tmp = '{' + it.lp_1.l1() + '}';
|
|
1523
1541
|
} else {
|
|
1524
1542
|
noWhenBranchMatchedException();
|
|
1525
1543
|
}
|
|
@@ -1528,50 +1546,50 @@ function JavaIrEmitter$buildHandlers$lambda(it) {
|
|
|
1528
1546
|
}
|
|
1529
1547
|
function JavaIrEmitter$buildHandlers$lambda$lambda($pathTemplate) {
|
|
1530
1548
|
return function ($this$function) {
|
|
1531
|
-
$this$function.
|
|
1532
|
-
$this$function.
|
|
1549
|
+
$this$function.k1i(String_instance);
|
|
1550
|
+
$this$function.j1k($this$function.c1t($pathTemplate));
|
|
1533
1551
|
return Unit_instance;
|
|
1534
1552
|
};
|
|
1535
1553
|
}
|
|
1536
1554
|
function JavaIrEmitter$buildHandlers$lambda$lambda_0($endpoint) {
|
|
1537
1555
|
return function ($this$function) {
|
|
1538
|
-
$this$function.
|
|
1539
|
-
$this$function.
|
|
1556
|
+
$this$function.k1i(String_instance);
|
|
1557
|
+
$this$function.j1k($this$function.c1t($endpoint.fp_1.a3_1));
|
|
1540
1558
|
return Unit_instance;
|
|
1541
1559
|
};
|
|
1542
1560
|
}
|
|
1543
1561
|
function JavaIrEmitter$buildHandlers$lambda$lambda_1($this$function) {
|
|
1544
|
-
$this$function.
|
|
1545
|
-
$this$function.
|
|
1546
|
-
$this$function.
|
|
1562
|
+
$this$function.k1i($this$function.t1h('Wirespec.ServerEdge', [$this$function.t1h('Request', []), $this$function.t1h('Response', [Wildcard_instance])]));
|
|
1563
|
+
$this$function.l1i('serialization', $this$function.t1h('Wirespec.Serialization', []));
|
|
1564
|
+
$this$function.j1k(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}'));
|
|
1547
1565
|
return Unit_instance;
|
|
1548
1566
|
}
|
|
1549
1567
|
function JavaIrEmitter$buildHandlers$lambda$lambda_2($this$function) {
|
|
1550
|
-
$this$function.
|
|
1551
|
-
$this$function.
|
|
1552
|
-
$this$function.
|
|
1568
|
+
$this$function.k1i($this$function.t1h('Wirespec.ClientEdge', [$this$function.t1h('Request', []), $this$function.t1h('Response', [Wildcard_instance])]));
|
|
1569
|
+
$this$function.l1i('serialization', $this$function.t1h('Wirespec.Serialization', []));
|
|
1570
|
+
$this$function.j1k(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}'));
|
|
1553
1571
|
return Unit_instance;
|
|
1554
1572
|
}
|
|
1555
1573
|
function JavaIrEmitter$buildHandlers$lambda_0($pathTemplate, $endpoint) {
|
|
1556
1574
|
return function ($this$struct) {
|
|
1557
|
-
$this$struct.
|
|
1558
|
-
$this$struct.
|
|
1559
|
-
$this$struct.
|
|
1560
|
-
$this$struct.
|
|
1561
|
-
$this$struct.
|
|
1562
|
-
$this$struct.
|
|
1575
|
+
$this$struct.k1k($this$struct.t1h('Wirespec.Server', [$this$struct.t1h('Request', []), $this$struct.t1h('Response', [Wildcard_instance])]));
|
|
1576
|
+
$this$struct.k1k($this$struct.t1h('Wirespec.Client', [$this$struct.t1h('Request', []), $this$struct.t1h('Response', [Wildcard_instance])]));
|
|
1577
|
+
$this$struct.b1i('getPathTemplate', VOID, true, JavaIrEmitter$buildHandlers$lambda$lambda($pathTemplate));
|
|
1578
|
+
$this$struct.b1i('getMethod', VOID, true, JavaIrEmitter$buildHandlers$lambda$lambda_0($endpoint));
|
|
1579
|
+
$this$struct.b1i('getServer', VOID, true, JavaIrEmitter$buildHandlers$lambda$lambda_1);
|
|
1580
|
+
$this$struct.b1i('getClient', VOID, true, JavaIrEmitter$buildHandlers$lambda$lambda_2);
|
|
1563
1581
|
return Unit_instance;
|
|
1564
1582
|
};
|
|
1565
1583
|
}
|
|
1566
1584
|
function JavaIrEmitter$withFullyQualifiedPrefix$lambda(it) {
|
|
1567
|
-
return it.
|
|
1585
|
+
return it.v1n_1.equals(Companion_getInstance().m1h('message'));
|
|
1568
1586
|
}
|
|
1569
1587
|
function JavaIrEmitter$withFullyQualifiedPrefix$lambda_0($prefix) {
|
|
1570
1588
|
return function (param) {
|
|
1571
|
-
var t = param.
|
|
1589
|
+
var t = param.w1n_1;
|
|
1572
1590
|
var tmp;
|
|
1573
1591
|
if (t instanceof Custom_0) {
|
|
1574
|
-
tmp = param.
|
|
1592
|
+
tmp = param.y1n(VOID, t.n1m($prefix + t.q1h_1));
|
|
1575
1593
|
} else {
|
|
1576
1594
|
tmp = param;
|
|
1577
1595
|
}
|
|
@@ -1582,8 +1600,8 @@ function JavaIrEmitter$transformTypeDescriptors$lambda(this$0) {
|
|
|
1582
1600
|
return function (stmt, tr) {
|
|
1583
1601
|
var tmp;
|
|
1584
1602
|
if (stmt instanceof TypeDescriptor) {
|
|
1585
|
-
var rootType = findRoot(this$0, stmt.
|
|
1586
|
-
var containerStr = rawContainerClass(this$0, stmt.
|
|
1603
|
+
var rootType = findRoot(this$0, stmt.h1p_1);
|
|
1604
|
+
var containerStr = rawContainerClass(this$0, stmt.h1p_1);
|
|
1587
1605
|
var rootStr = toJavaName(this$0, rootType) + '.class';
|
|
1588
1606
|
var tmp_0;
|
|
1589
1607
|
if (containerStr == null) {
|
|
@@ -1603,91 +1621,99 @@ function JavaIrEmitter$transformTypeDescriptors$lambda(this$0) {
|
|
|
1603
1621
|
}
|
|
1604
1622
|
function JavaIrEmitter(packageName, emitShared) {
|
|
1605
1623
|
Companion_getInstance_1();
|
|
1606
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
1607
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
1608
|
-
this.
|
|
1609
|
-
this.
|
|
1610
|
-
this.
|
|
1611
|
-
this.
|
|
1612
|
-
this.
|
|
1624
|
+
packageName = packageName === VOID ? Companion_instance.lr('community.flock.wirespec.generated') : packageName;
|
|
1625
|
+
emitShared = emitShared === VOID ? Companion_instance_0.go() : emitShared;
|
|
1626
|
+
this.k1w_1 = packageName;
|
|
1627
|
+
this.l1w_1 = emitShared;
|
|
1628
|
+
this.m1w_1 = JavaGenerator_instance;
|
|
1629
|
+
this.n1w_1 = FileExtension_Java_getInstance();
|
|
1630
|
+
this.o1w_1 = listOf(import_0('community.flock.wirespec.java', 'Wirespec'));
|
|
1613
1631
|
var tmp = this;
|
|
1614
|
-
var tmp_0 = Companion_getInstance_1().
|
|
1632
|
+
var tmp_0 = Companion_getInstance_1().j1w_1;
|
|
1615
1633
|
var tmp_1 = JavaIrEmitter$sanitizationConfig$lambda;
|
|
1616
1634
|
var tmp_2 = JavaIrEmitter$sanitizationConfig$lambda_0;
|
|
1617
1635
|
var tmp_3 = JavaIrEmitter$sanitizationConfig$lambda_1;
|
|
1618
1636
|
var tmp_4 = JavaIrEmitter$sanitizationConfig$lambda_2(this);
|
|
1619
|
-
tmp.
|
|
1637
|
+
tmp.p1w_1 = new SanitizationConfig(tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, JavaIrEmitter$sanitizationConfig$lambda_3);
|
|
1620
1638
|
var tmp_5 = this;
|
|
1621
|
-
tmp_5.
|
|
1639
|
+
tmp_5.q1w_1 = new JavaIrEmitter$shared$1();
|
|
1622
1640
|
}
|
|
1623
|
-
protoOf(JavaIrEmitter).
|
|
1624
|
-
return this.
|
|
1641
|
+
protoOf(JavaIrEmitter).k1v = function () {
|
|
1642
|
+
return this.k1w_1;
|
|
1625
1643
|
};
|
|
1626
|
-
protoOf(JavaIrEmitter).
|
|
1627
|
-
return this.
|
|
1644
|
+
protoOf(JavaIrEmitter).m1u = function () {
|
|
1645
|
+
return this.m1w_1;
|
|
1628
1646
|
};
|
|
1629
|
-
protoOf(JavaIrEmitter).
|
|
1630
|
-
return this.
|
|
1647
|
+
protoOf(JavaIrEmitter).eq = function () {
|
|
1648
|
+
return this.n1w_1;
|
|
1631
1649
|
};
|
|
1632
|
-
protoOf(JavaIrEmitter).
|
|
1633
|
-
return this.
|
|
1650
|
+
protoOf(JavaIrEmitter).t1v = function () {
|
|
1651
|
+
return this.q1w_1;
|
|
1634
1652
|
};
|
|
1635
|
-
protoOf(JavaIrEmitter).
|
|
1653
|
+
protoOf(JavaIrEmitter).n1u = function (module_0, logger) {
|
|
1636
1654
|
var tmp = emit_0.call(this, module_0, logger);
|
|
1637
|
-
return withSharedSource(tmp, this.
|
|
1655
|
+
return withSharedSource(tmp, this.l1w_1, JavaIrEmitter$emit$lambda(this));
|
|
1638
1656
|
};
|
|
1639
|
-
protoOf(JavaIrEmitter).
|
|
1657
|
+
protoOf(JavaIrEmitter).uq = function (definition, module_0, logger) {
|
|
1640
1658
|
var file = emit_1.call(this, definition, module_0, logger);
|
|
1641
|
-
var tmp = this.
|
|
1642
|
-
|
|
1643
|
-
|
|
1659
|
+
var tmp = file.x1m(Companion_getInstance().m1h(sanitizeSymbol_0(this, file.t1m_1.x1l())));
|
|
1660
|
+
// Inline function 'kotlin.takeIf' call
|
|
1661
|
+
var this_0 = this.o1w_1;
|
|
1662
|
+
var tmp_0;
|
|
1663
|
+
if (Companion_instance_1.qq(module_0)) {
|
|
1664
|
+
tmp_0 = this_0;
|
|
1665
|
+
} else {
|
|
1666
|
+
tmp_0 = null;
|
|
1667
|
+
}
|
|
1668
|
+
var tmp$ret$1 = tmp_0;
|
|
1669
|
+
return placeInPackage(prependImports(tmp, tmp$ret$1), this.k1v(), definition);
|
|
1644
1670
|
};
|
|
1645
|
-
protoOf(JavaIrEmitter).
|
|
1646
|
-
return sanitizeNames(convertWithValidation(type, module_0), this.
|
|
1671
|
+
protoOf(JavaIrEmitter).up = function (type, module_0) {
|
|
1672
|
+
return sanitizeNames(convertWithValidation(type, module_0), this.p1w_1);
|
|
1647
1673
|
};
|
|
1648
|
-
protoOf(JavaIrEmitter).
|
|
1674
|
+
protoOf(JavaIrEmitter).ir = function (enum_0, module_0) {
|
|
1649
1675
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1650
1676
|
var this_0 = convert_1(enum_0);
|
|
1651
1677
|
var scope = new TransformScope(this_0);
|
|
1652
1678
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1653
1679
|
var tmp = scope;
|
|
1654
1680
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1655
|
-
var this_1 = scope.
|
|
1681
|
+
var this_1 = scope.z1t_1;
|
|
1656
1682
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1657
1683
|
// Inline function 'kotlin.apply' call
|
|
1658
1684
|
var this_2 = new TransformerBuilder();
|
|
1659
|
-
this_2.
|
|
1660
|
-
var tmp$ret$2 = this_2.
|
|
1661
|
-
tmp.
|
|
1662
|
-
var tmp_0 = scope.
|
|
1685
|
+
this_2.d1h(JavaIrEmitter$emit$lambda_0(this));
|
|
1686
|
+
var tmp$ret$2 = this_2.e1h();
|
|
1687
|
+
tmp.z1t_1 = transform(this_1, tmp$ret$2);
|
|
1688
|
+
var tmp_0 = scope.z1t_1;
|
|
1663
1689
|
var tmp$ret$6 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1664
|
-
return sanitizeNames(tmp$ret$6, this.
|
|
1690
|
+
return sanitizeNames(tmp$ret$6, this.p1w_1);
|
|
1665
1691
|
};
|
|
1666
|
-
protoOf(JavaIrEmitter).
|
|
1667
|
-
return sanitizeNames(convert_2(union), this.
|
|
1692
|
+
protoOf(JavaIrEmitter).yq = function (union) {
|
|
1693
|
+
return sanitizeNames(convert_2(union), this.p1w_1);
|
|
1668
1694
|
};
|
|
1669
|
-
protoOf(JavaIrEmitter).
|
|
1695
|
+
protoOf(JavaIrEmitter).dr = function (refined) {
|
|
1670
1696
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1671
1697
|
var this_0 = convert_3(refined);
|
|
1672
1698
|
var scope = new TransformScope(this_0);
|
|
1673
1699
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1674
1700
|
var tmp = scope;
|
|
1675
1701
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1676
|
-
var this_1 = scope.
|
|
1702
|
+
var this_1 = scope.z1t_1;
|
|
1677
1703
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1678
1704
|
// Inline function 'kotlin.apply' call
|
|
1679
1705
|
var this_2 = new TransformerBuilder();
|
|
1680
|
-
this_2.
|
|
1681
|
-
var tmp$ret$2 = this_2.
|
|
1682
|
-
tmp.
|
|
1683
|
-
var tmp_0 = scope.
|
|
1706
|
+
this_2.d1h(JavaIrEmitter$emit$lambda_1(refined));
|
|
1707
|
+
var tmp$ret$2 = this_2.e1h();
|
|
1708
|
+
tmp.z1t_1 = transform(this_1, tmp$ret$2);
|
|
1709
|
+
var tmp_0 = scope.z1t_1;
|
|
1684
1710
|
var tmp$ret$6 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1685
|
-
return sanitizeNames(tmp$ret$6, this.
|
|
1711
|
+
return sanitizeNames(tmp$ret$6, this.p1w_1);
|
|
1686
1712
|
};
|
|
1687
|
-
protoOf(JavaIrEmitter).
|
|
1713
|
+
protoOf(JavaIrEmitter).jr = function (endpoint) {
|
|
1688
1714
|
var imports = buildImports(this, endpoint);
|
|
1689
1715
|
// Inline function 'kotlin.let' call
|
|
1690
|
-
var file = sanitizeNames(transformTypeDescriptors(this, injectHandleFunction(this, convert_4(endpoint), endpoint)), this.
|
|
1716
|
+
var file = sanitizeNames(transformTypeDescriptors(this, injectHandleFunction(this, convert_4(endpoint), endpoint)), this.p1w_1);
|
|
1691
1717
|
var tmp;
|
|
1692
1718
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1693
1719
|
if (!imports.r()) {
|
|
@@ -1696,77 +1722,77 @@ protoOf(JavaIrEmitter).lr = function (endpoint) {
|
|
|
1696
1722
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1697
1723
|
var tmp_0 = scope;
|
|
1698
1724
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1699
|
-
var this_0 = scope.
|
|
1725
|
+
var this_0 = scope.z1t_1;
|
|
1700
1726
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1701
1727
|
// Inline function 'kotlin.apply' call
|
|
1702
1728
|
var this_1 = new TransformerBuilder();
|
|
1703
|
-
this_1.
|
|
1704
|
-
var tmp$ret$3 = this_1.
|
|
1705
|
-
tmp_0.
|
|
1706
|
-
var tmp_1 = scope.
|
|
1729
|
+
this_1.d1h(JavaIrEmitter$emit$lambda_2(imports));
|
|
1730
|
+
var tmp$ret$3 = this_1.e1h();
|
|
1731
|
+
tmp_0.z1t_1 = transform(this_0, tmp$ret$3);
|
|
1732
|
+
var tmp_1 = scope.z1t_1;
|
|
1707
1733
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1708
1734
|
} else {
|
|
1709
1735
|
tmp = file;
|
|
1710
1736
|
}
|
|
1711
1737
|
return tmp;
|
|
1712
1738
|
};
|
|
1713
|
-
protoOf(JavaIrEmitter).
|
|
1739
|
+
protoOf(JavaIrEmitter).xq = function (channel) {
|
|
1714
1740
|
var tmp;
|
|
1715
|
-
if (channel.
|
|
1716
|
-
tmp = this.
|
|
1741
|
+
if (channel.mo_1.l1() === channel.no_1.l1()) {
|
|
1742
|
+
tmp = this.k1v().mr_1 + '.model.';
|
|
1717
1743
|
} else {
|
|
1718
1744
|
tmp = '';
|
|
1719
1745
|
}
|
|
1720
1746
|
var fullyQualifiedPrefix = tmp;
|
|
1721
1747
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1722
|
-
var this_0 = sanitizeNames(convert_5(channel), this.
|
|
1748
|
+
var this_0 = sanitizeNames(convert_5(channel), this.p1w_1);
|
|
1723
1749
|
var scope = new TransformScope(this_0);
|
|
1724
1750
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1725
1751
|
var tmp_0 = scope;
|
|
1726
1752
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1727
|
-
var this_1 = scope.
|
|
1753
|
+
var this_1 = scope.z1t_1;
|
|
1728
1754
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1729
1755
|
// Inline function 'kotlin.apply' call
|
|
1730
1756
|
var this_2 = new TransformerBuilder();
|
|
1731
|
-
this_2.
|
|
1732
|
-
var tmp$ret$2 = this_2.
|
|
1733
|
-
tmp_0.
|
|
1757
|
+
this_2.d1h(JavaIrEmitter$emit$lambda_3(this, fullyQualifiedPrefix));
|
|
1758
|
+
var tmp$ret$2 = this_2.e1h();
|
|
1759
|
+
tmp_0.z1t_1 = transform(this_1, tmp$ret$2);
|
|
1734
1760
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1735
1761
|
var tmp_1 = scope;
|
|
1736
1762
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1737
|
-
var this_3 = scope.
|
|
1763
|
+
var this_3 = scope.z1t_1;
|
|
1738
1764
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1739
1765
|
// Inline function 'kotlin.apply' call
|
|
1740
1766
|
var this_4 = new TransformerBuilder();
|
|
1741
|
-
this_4.
|
|
1742
|
-
var tmp$ret$7 = this_4.
|
|
1743
|
-
tmp_1.
|
|
1744
|
-
var tmp_2 = scope.
|
|
1767
|
+
this_4.d1h(JavaIrEmitter$emit$lambda_4);
|
|
1768
|
+
var tmp$ret$7 = this_4.e1h();
|
|
1769
|
+
tmp_1.z1t_1 = transform(this_3, tmp$ret$7);
|
|
1770
|
+
var tmp_2 = scope.z1t_1;
|
|
1745
1771
|
return isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1746
1772
|
};
|
|
1747
|
-
protoOf(JavaIrEmitter).
|
|
1773
|
+
protoOf(JavaIrEmitter).q1u = function (endpoint) {
|
|
1748
1774
|
var imports = buildImports(this, endpoint);
|
|
1749
|
-
var endpointImport = import_0(this.
|
|
1750
|
-
var file = transformTypeDescriptors(this, sanitizeNames(emitEndpointClient.call(this, endpoint), this.
|
|
1751
|
-
var endpointName = endpoint.
|
|
1775
|
+
var endpointImport = import_0(this.k1v().mr_1 + '.endpoint', endpoint.ep_1.l1());
|
|
1776
|
+
var file = transformTypeDescriptors(this, sanitizeNames(emitEndpointClient.call(this, endpoint), this.p1w_1));
|
|
1777
|
+
var endpointName = endpoint.ep_1.l1();
|
|
1752
1778
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1753
1779
|
var scope = new TransformScope(file);
|
|
1754
1780
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1755
1781
|
var tmp = scope;
|
|
1756
1782
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1757
|
-
var this_0 = scope.
|
|
1783
|
+
var this_0 = scope.z1t_1;
|
|
1758
1784
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1759
1785
|
// Inline function 'kotlin.apply' call
|
|
1760
1786
|
var this_1 = new TransformerBuilder();
|
|
1761
|
-
this_1.
|
|
1762
|
-
var tmp$ret$2 = this_1.
|
|
1763
|
-
tmp.
|
|
1764
|
-
var tmp_0 = scope.
|
|
1787
|
+
this_1.d1h(JavaIrEmitter$emitEndpointClient$lambda(endpointName));
|
|
1788
|
+
var tmp$ret$2 = this_1.e1h();
|
|
1789
|
+
tmp.z1t_1 = transform(this_0, tmp$ret$2);
|
|
1790
|
+
var tmp_0 = scope.z1t_1;
|
|
1765
1791
|
var transformedFile = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1766
|
-
var subPackageName = plus_0(this.
|
|
1767
|
-
return new File(Companion_getInstance().
|
|
1792
|
+
var subPackageName = plus_0(this.k1v(), 'client');
|
|
1793
|
+
return new File(Companion_getInstance().m1h(subPackageName.or() + sanitizeSymbol_0(this, transformedFile.t1m_1.x1l())), plus_1(plus_1(plus_1(plus_1(listOf(new Package(subPackageName.mr_1)), this.o1w_1), imports), listOf(endpointImport)), transformedFile.u1m_1));
|
|
1768
1794
|
};
|
|
1769
|
-
protoOf(JavaIrEmitter).
|
|
1795
|
+
protoOf(JavaIrEmitter).p1u = function (endpoints, logger) {
|
|
1770
1796
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1771
1797
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1772
1798
|
var destination = ArrayList_init_$Create$();
|
|
@@ -1782,7 +1808,7 @@ protoOf(JavaIrEmitter).q1u = function (endpoints, logger) {
|
|
|
1782
1808
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1783
1809
|
while (_iterator__ex2g4s_0.u()) {
|
|
1784
1810
|
var e = _iterator__ex2g4s_0.v();
|
|
1785
|
-
var key = e.
|
|
1811
|
+
var key = e.lu_1;
|
|
1786
1812
|
if (set.x(key)) {
|
|
1787
1813
|
list_0.x(e);
|
|
1788
1814
|
}
|
|
@@ -1809,7 +1835,7 @@ protoOf(JavaIrEmitter).q1u = function (endpoints, logger) {
|
|
|
1809
1835
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1810
1836
|
while (_iterator__ex2g4s_2.u()) {
|
|
1811
1837
|
var element_1 = _iterator__ex2g4s_2.v();
|
|
1812
|
-
if (element_1.
|
|
1838
|
+
if (element_1.ep_1.l1() === element_0.lu_1) {
|
|
1813
1839
|
tmp$ret$5 = false;
|
|
1814
1840
|
break $l$block_0;
|
|
1815
1841
|
}
|
|
@@ -1826,7 +1852,7 @@ protoOf(JavaIrEmitter).q1u = function (endpoints, logger) {
|
|
|
1826
1852
|
var _iterator__ex2g4s_3 = destination_0.t();
|
|
1827
1853
|
while (_iterator__ex2g4s_3.u()) {
|
|
1828
1854
|
var item = _iterator__ex2g4s_3.v();
|
|
1829
|
-
var tmp$ret$10 = import_0(this.
|
|
1855
|
+
var tmp$ret$10 = import_0(this.k1v().mr_1 + '.model', item.lu_1);
|
|
1830
1856
|
destination_1.x(tmp$ret$10);
|
|
1831
1857
|
}
|
|
1832
1858
|
var imports = destination_1;
|
|
@@ -1836,7 +1862,7 @@ protoOf(JavaIrEmitter).q1u = function (endpoints, logger) {
|
|
|
1836
1862
|
var _iterator__ex2g4s_4 = endpoints.t();
|
|
1837
1863
|
while (_iterator__ex2g4s_4.u()) {
|
|
1838
1864
|
var item_0 = _iterator__ex2g4s_4.v();
|
|
1839
|
-
var tmp$ret$13 = import_0(this.
|
|
1865
|
+
var tmp$ret$13 = import_0(this.k1v().mr_1 + '.endpoint', item_0.ep_1.l1());
|
|
1840
1866
|
destination_2.x(tmp$ret$13);
|
|
1841
1867
|
}
|
|
1842
1868
|
var endpointImports = destination_2;
|
|
@@ -1846,23 +1872,23 @@ protoOf(JavaIrEmitter).q1u = function (endpoints, logger) {
|
|
|
1846
1872
|
var _iterator__ex2g4s_5 = endpoints.t();
|
|
1847
1873
|
while (_iterator__ex2g4s_5.u()) {
|
|
1848
1874
|
var item_1 = _iterator__ex2g4s_5.v();
|
|
1849
|
-
var tmp$ret$16 = import_0(this.
|
|
1875
|
+
var tmp$ret$16 = import_0(this.k1v().mr_1 + '.client', item_1.ep_1.l1() + 'Client');
|
|
1850
1876
|
destination_3.x(tmp$ret$16);
|
|
1851
1877
|
}
|
|
1852
1878
|
var clientImports = destination_3;
|
|
1853
1879
|
var allImports = plus_1(plus_1(imports, endpointImports), clientImports);
|
|
1854
|
-
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.
|
|
1855
|
-
return new File(Companion_getInstance().
|
|
1880
|
+
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.p1w_1);
|
|
1881
|
+
return new File(Companion_getInstance().m1h(this.k1v().or() + sanitizeSymbol_0(this, file.t1m_1.x1l())), plus_1(plus_1(plus_1(listOf(new Package(this.k1v().mr_1)), this.o1w_1), allImports), file.u1m_1));
|
|
1856
1882
|
};
|
|
1857
1883
|
function JavaRefinedTypeDefinitionEmitter() {
|
|
1858
1884
|
}
|
|
1859
1885
|
function JavaShared() {
|
|
1860
1886
|
JavaShared_instance = this;
|
|
1861
|
-
this.
|
|
1862
|
-
this.
|
|
1887
|
+
this.u1v_1 = 'community.flock.wirespec.java';
|
|
1888
|
+
this.v1v_1 = trimMargin('\n |package ' + this.u1v_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.qr(2) + 'Req from(RawRequest request);\n |' + Spacer_instance.qr(2) + 'RawResponse to(Res response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface ClientEdge<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.qr(2) + 'RawRequest to(Req request);\n |' + Spacer_instance.qr(2) + 'Res from(RawResponse response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.qr(2) + 'String getPathTemplate();\n |' + Spacer_instance.qr(2) + 'String getMethod();\n |' + Spacer_instance.qr(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.qr(2) + 'String getPathTemplate();\n |' + Spacer_instance.qr(2) + 'String getMethod();\n |' + Spacer_instance.qr(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.qr(2) + 'if(rawType != null) {\n |' + Spacer_instance.qr(3) + 'return new ParameterizedType() {\n |' + Spacer_instance.qr(4) + 'public Type getRawType() { return rawType; }\n |' + Spacer_instance.qr(4) + 'public Type[] getActualTypeArguments() { return new Class<?>[]{actualTypeArguments}; }\n |' + Spacer_instance.qr(4) + 'public Type getOwnerType() { return null; }\n |' + Spacer_instance.qr(3) + '};\n |' + Spacer_instance.qr(2) + '}\n |' + Spacer_instance.qr(2) + 'else { return actualTypeArguments; }\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
1863
1889
|
}
|
|
1864
|
-
protoOf(JavaShared).
|
|
1865
|
-
return this.
|
|
1890
|
+
protoOf(JavaShared).r1w = function () {
|
|
1891
|
+
return this.v1v_1;
|
|
1866
1892
|
};
|
|
1867
1893
|
protoOf(JavaShared).toString = function () {
|
|
1868
1894
|
return 'JavaShared';
|
|
@@ -1886,10 +1912,10 @@ function JavaShared_getInstance() {
|
|
|
1886
1912
|
function emitType($this, _this__u8e3s4) {
|
|
1887
1913
|
var tmp;
|
|
1888
1914
|
if (_this__u8e3s4 instanceof Dict) {
|
|
1889
|
-
tmp = 'java.util.Map<String, ' + $this.
|
|
1915
|
+
tmp = 'java.util.Map<String, ' + $this.xp(_this__u8e3s4.co_1) + '>';
|
|
1890
1916
|
} else {
|
|
1891
1917
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
1892
|
-
tmp = 'java.util.List<' + $this.
|
|
1918
|
+
tmp = 'java.util.List<' + $this.xp(_this__u8e3s4.zn_1) + '>';
|
|
1893
1919
|
} else {
|
|
1894
1920
|
if (_this__u8e3s4 instanceof Unit) {
|
|
1895
1921
|
tmp = 'void';
|
|
@@ -1898,7 +1924,7 @@ function emitType($this, _this__u8e3s4) {
|
|
|
1898
1924
|
tmp = 'Object';
|
|
1899
1925
|
} else {
|
|
1900
1926
|
if (_this__u8e3s4 instanceof Custom) {
|
|
1901
|
-
tmp = _this__u8e3s4.
|
|
1927
|
+
tmp = _this__u8e3s4.lu_1;
|
|
1902
1928
|
} else {
|
|
1903
1929
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
1904
1930
|
tmp = emit_18($this, _this__u8e3s4);
|
|
@@ -1913,14 +1939,14 @@ function emitType($this, _this__u8e3s4) {
|
|
|
1913
1939
|
return tmp;
|
|
1914
1940
|
}
|
|
1915
1941
|
function emit_18($this, _this__u8e3s4) {
|
|
1916
|
-
var t = _this__u8e3s4.
|
|
1942
|
+
var t = _this__u8e3s4.pu_1;
|
|
1917
1943
|
var tmp;
|
|
1918
1944
|
if (t instanceof String_0) {
|
|
1919
1945
|
tmp = 'String';
|
|
1920
1946
|
} else {
|
|
1921
1947
|
if (t instanceof Integer) {
|
|
1922
1948
|
var tmp_0;
|
|
1923
|
-
switch (t.
|
|
1949
|
+
switch (t.tt_1.b3_1) {
|
|
1924
1950
|
case 0:
|
|
1925
1951
|
tmp_0 = 'Integer';
|
|
1926
1952
|
break;
|
|
@@ -1935,7 +1961,7 @@ function emit_18($this, _this__u8e3s4) {
|
|
|
1935
1961
|
} else {
|
|
1936
1962
|
if (t instanceof Number_0) {
|
|
1937
1963
|
var tmp_1;
|
|
1938
|
-
switch (t.
|
|
1964
|
+
switch (t.wt_1.b3_1) {
|
|
1939
1965
|
case 0:
|
|
1940
1966
|
tmp_1 = 'Float';
|
|
1941
1967
|
break;
|
|
@@ -1964,43 +1990,43 @@ function emit_18($this, _this__u8e3s4) {
|
|
|
1964
1990
|
}
|
|
1965
1991
|
function JavaTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
1966
1992
|
return function (it) {
|
|
1967
|
-
return this$0.
|
|
1993
|
+
return this$0.xp(it);
|
|
1968
1994
|
};
|
|
1969
1995
|
}
|
|
1970
1996
|
function JavaTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
1971
1997
|
return function (it) {
|
|
1972
|
-
return Spacer_instance.toString() + this$0.
|
|
1998
|
+
return Spacer_instance.toString() + this$0.wp(it) + ',';
|
|
1973
1999
|
};
|
|
1974
2000
|
}
|
|
1975
2001
|
function JavaTypeDefinitionEmitter() {
|
|
1976
2002
|
}
|
|
1977
2003
|
function JavaUnionDefinitionEmitter$emit$lambda(it) {
|
|
1978
|
-
return it.
|
|
2004
|
+
return it.l1();
|
|
1979
2005
|
}
|
|
1980
2006
|
function JavaUnionDefinitionEmitter() {
|
|
1981
2007
|
}
|
|
1982
2008
|
//region block: post-declaration
|
|
1983
|
-
protoOf(JavaEmitter).
|
|
1984
|
-
protoOf(JavaEmitter).
|
|
1985
|
-
protoOf(JavaEmitter).
|
|
1986
|
-
protoOf(JavaEmitter).
|
|
1987
|
-
protoOf(JavaEmitter).
|
|
1988
|
-
protoOf(JavaEmitter).
|
|
1989
|
-
protoOf(JavaEmitter).
|
|
1990
|
-
protoOf(JavaEmitter).
|
|
1991
|
-
protoOf(JavaEmitter).
|
|
1992
|
-
protoOf(JavaEmitter).
|
|
1993
|
-
protoOf(JavaEmitter).
|
|
1994
|
-
protoOf(JavaEmitter).
|
|
1995
|
-
protoOf(JavaEmitter).
|
|
1996
|
-
protoOf(JavaEmitter).
|
|
1997
|
-
protoOf(JavaEmitter).
|
|
1998
|
-
protoOf(JavaEmitter).
|
|
1999
|
-
protoOf(JavaEmitter).
|
|
2000
|
-
protoOf(JavaEmitter).
|
|
2001
|
-
protoOf(JavaEmitter).
|
|
2002
|
-
protoOf(JavaEmitter).
|
|
2003
|
-
protoOf(JavaIrEmitter).
|
|
2009
|
+
protoOf(JavaEmitter).wq = emit_9;
|
|
2010
|
+
protoOf(JavaEmitter).up = emit_3;
|
|
2011
|
+
protoOf(JavaEmitter).vp = emit_4;
|
|
2012
|
+
protoOf(JavaEmitter).wp = emit_5;
|
|
2013
|
+
protoOf(JavaEmitter).xp = emit_6;
|
|
2014
|
+
protoOf(JavaEmitter).yp = emit_7;
|
|
2015
|
+
protoOf(JavaEmitter).jr = emit_13;
|
|
2016
|
+
protoOf(JavaEmitter).x1v = emit_14;
|
|
2017
|
+
protoOf(JavaEmitter).y1v = emit_15;
|
|
2018
|
+
protoOf(JavaEmitter).xq = emit_8;
|
|
2019
|
+
protoOf(JavaEmitter).ir = emit_10;
|
|
2020
|
+
protoOf(JavaEmitter).yq = emit_11;
|
|
2021
|
+
protoOf(JavaEmitter).dr = emit_12;
|
|
2022
|
+
protoOf(JavaEmitter).w1v = sanitizeSymbol;
|
|
2023
|
+
protoOf(JavaEmitter).z1v = sanitizeFirstIsDigit;
|
|
2024
|
+
protoOf(JavaEmitter).a1w = sanitizeKeywords;
|
|
2025
|
+
protoOf(JavaEmitter).m1v = emitRoot;
|
|
2026
|
+
protoOf(JavaEmitter).l1v = emitRoot$default;
|
|
2027
|
+
protoOf(JavaEmitter).b1w = emitHandleFunction;
|
|
2028
|
+
protoOf(JavaEmitter).kr = emitValidator;
|
|
2029
|
+
protoOf(JavaIrEmitter).on = emit_2;
|
|
2004
2030
|
//endregion
|
|
2005
2031
|
//region block: exports
|
|
2006
2032
|
export {
|