@flock/wirespec 0.18.6 → 0.18.13
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 +11 -11
- package/arrow-arrow-core.mjs +141 -141
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt.mjs +1395 -1395
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +442 -442
- package/kotlin-kotlin-stdlib.mjs +1051 -943
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +20812 -6818
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1797 -1797
- package/kotlinx-io-kotlinx-io-core.mjs +405 -405
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1960 -1763
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1882 -1407
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1269 -1269
- package/package.json +3 -2
- package/wirespec-lsp.mjs +7 -0
- package/wirespec-src-compiler-core.mjs +1708 -1644
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +444 -409
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +325 -290
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +340 -342
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +370 -372
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +155 -157
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +372 -372
- package/wirespec-src-compiler-emitters-wirespec.mjs +83 -83
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3211 -3312
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +399 -399
- package/wirespec-src-converter-avro.mjs +507 -507
- package/wirespec-src-converter-openapi.mjs +1487 -1413
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +4928 -0
- package/wirespec-src-ide-lsp.mjs.map +1 -0
- package/wirespec-src-plugin-arguments.mjs +175 -175
- package/wirespec-src-plugin-cli.mjs +102 -102
- package/wirespec-src-plugin-npm.d.mts +2 -0
- package/wirespec-src-plugin-npm.mjs +42 -37
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +32 -32
|
@@ -160,8 +160,8 @@ import {
|
|
|
160
160
|
Function21cuq8qizkin7 as Function,
|
|
161
161
|
plusd54zq6f7l8fy as plus_3,
|
|
162
162
|
Struct39wf79cwtn4ty as Struct,
|
|
163
|
-
Interface3pn84xq686t2r as Interface,
|
|
164
163
|
RawElement2yts1x2rbem1g as RawElement,
|
|
164
|
+
Interface3pn84xq686t2r as Interface,
|
|
165
165
|
Assignment3kcxc8wlcbmkn as Assignment,
|
|
166
166
|
ReturnStatement29qlfkn9kpy10 as ReturnStatement,
|
|
167
167
|
Wildcard_instance2ga1ytfwj78ra as Wildcard_instance,
|
|
@@ -170,10 +170,10 @@ import {
|
|
|
170
170
|
//endregion
|
|
171
171
|
//region block: pre-declaration
|
|
172
172
|
function emit_3(type, module_0) {
|
|
173
|
-
var tmp = this.
|
|
174
|
-
var tmp_0 = this.
|
|
173
|
+
var tmp = this.br(type.zo_1);
|
|
174
|
+
var tmp_0 = this.zp(type.ap_1);
|
|
175
175
|
// Inline function 'kotlin.run' call
|
|
176
|
-
var $this$run = type.
|
|
176
|
+
var $this$run = type.bp_1;
|
|
177
177
|
var tmp_1;
|
|
178
178
|
if ($this$run.r()) {
|
|
179
179
|
tmp_1 = '';
|
|
@@ -184,23 +184,23 @@ function emit_3(type, module_0) {
|
|
|
184
184
|
return trimMargin('\n |public record ' + tmp + ' (\n |' + tmp_0 + '\n |)' + tmp$ret$1 + ' {\n |};\n |\n ');
|
|
185
185
|
}
|
|
186
186
|
function emit_4(_this__u8e3s4) {
|
|
187
|
-
return dropLast_0(joinToString(_this__u8e3s4.
|
|
187
|
+
return dropLast_0(joinToString(_this__u8e3s4.wo_1, '\n', VOID, VOID, VOID, VOID, JavaTypeDefinitionEmitter$emit$lambda_0(this)), 1);
|
|
188
188
|
}
|
|
189
189
|
function emit_5(_this__u8e3s4) {
|
|
190
|
-
return this.
|
|
190
|
+
return this.bq(_this__u8e3s4.fp_1) + ' ' + this.br(_this__u8e3s4.ep_1);
|
|
191
191
|
}
|
|
192
192
|
function emit_6(_this__u8e3s4) {
|
|
193
193
|
// Inline function 'kotlin.let' call
|
|
194
194
|
var it = emitType(this, _this__u8e3s4);
|
|
195
|
-
return _this__u8e3s4.
|
|
195
|
+
return _this__u8e3s4.hu() ? 'java.util.Optional<' + it + '>' : it;
|
|
196
196
|
}
|
|
197
197
|
function emitRoot(_this__u8e3s4, void_0) {
|
|
198
198
|
var tmp;
|
|
199
199
|
if (_this__u8e3s4 instanceof Dict) {
|
|
200
|
-
tmp = this.
|
|
200
|
+
tmp = this.j1v(_this__u8e3s4.go_1);
|
|
201
201
|
} else {
|
|
202
202
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
203
|
-
tmp = this.
|
|
203
|
+
tmp = this.j1v(_this__u8e3s4.do_1);
|
|
204
204
|
} else {
|
|
205
205
|
if (_this__u8e3s4 instanceof Unit) {
|
|
206
206
|
tmp = void_0;
|
|
@@ -229,15 +229,15 @@ function emitRoot(_this__u8e3s4, void_0) {
|
|
|
229
229
|
}
|
|
230
230
|
function emitRoot$default(_this__u8e3s4, void_0, $super) {
|
|
231
231
|
void_0 = void_0 === VOID ? 'void' : void_0;
|
|
232
|
-
return $super === VOID ? this.
|
|
232
|
+
return $super === VOID ? this.k1v(_this__u8e3s4, void_0) : emitRoot(_this__u8e3s4, void_0);
|
|
233
233
|
}
|
|
234
234
|
function emit_7(_this__u8e3s4) {
|
|
235
235
|
var tmp;
|
|
236
236
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
237
|
-
tmp = 'return java.util.regex.Pattern.compile("' + replace(this.
|
|
237
|
+
tmp = 'return java.util.regex.Pattern.compile("' + replace(this.dq(_this__u8e3s4.dt_1), '\\', '\\\\') + '").matcher(value).find();';
|
|
238
238
|
} else {
|
|
239
239
|
if (_this__u8e3s4 instanceof Bound) {
|
|
240
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
240
|
+
var tmp1_safe_receiver = _this__u8e3s4.tt_1;
|
|
241
241
|
var tmp_0;
|
|
242
242
|
if (tmp1_safe_receiver == null) {
|
|
243
243
|
tmp_0 = null;
|
|
@@ -246,7 +246,7 @@ function emit_7(_this__u8e3s4) {
|
|
|
246
246
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
247
247
|
}
|
|
248
248
|
var minCheck = tmp_0;
|
|
249
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
249
|
+
var tmp2_safe_receiver = _this__u8e3s4.ut_1;
|
|
250
250
|
var tmp_1;
|
|
251
251
|
if (tmp2_safe_receiver == null) {
|
|
252
252
|
tmp_1 = null;
|
|
@@ -272,16 +272,84 @@ function emit_7(_this__u8e3s4) {
|
|
|
272
272
|
}
|
|
273
273
|
initMetadataForInterface(JavaTypeDefinitionEmitter, 'JavaTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter]);
|
|
274
274
|
function emit_8(channel) {
|
|
275
|
-
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |@FunctionalInterface\n |public interface ' + this.
|
|
275
|
+
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |@FunctionalInterface\n |public interface ' + this.br(channel.qo_1) + ' {\n | void invoke(' + emitFullyQualified(this, channel, channel.ro_1) + this.j1v(channel.ro_1) + ' message);\n |}\n |\n ');
|
|
276
276
|
}
|
|
277
277
|
initMetadataForInterface(JavaChannelDefinitionEmitter, 'JavaChannelDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
278
|
-
function emit_9(
|
|
278
|
+
function emit_9(endpoint) {
|
|
279
|
+
var tmp = emitImports_0(this, endpoint);
|
|
280
|
+
var tmp_0 = this.br(endpoint.ip_1);
|
|
281
|
+
var tmp_1 = get_pathParams(endpoint);
|
|
282
|
+
var tmp_2 = emitObject(this, tmp_1, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
|
|
283
|
+
var tmp_3 = emitObject(this, endpoint.lp_1, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
284
|
+
var tmp_4 = emitObject(this, endpoint.mp_1, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
285
|
+
var tmp_5 = this.v1v(first_0(endpoint.np_1), endpoint);
|
|
286
|
+
var tmp_6 = Spacer_instance.toString();
|
|
287
|
+
var tmp_7 = emitStatusInterfaces(this, endpoint);
|
|
288
|
+
var tmp_8 = emitResponseInterfaces(this, endpoint);
|
|
289
|
+
var tmp_9 = distinctByStatus(endpoint.op_1);
|
|
290
|
+
var tmp_10 = joinToString(tmp_9, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
291
|
+
var tmp_11 = Spacer_instance.toString();
|
|
292
|
+
var tmp_12 = emitRequestFunctions(this, first_0(endpoint.np_1), endpoint);
|
|
293
|
+
var tmp_13 = Spacer_instance.vr(2);
|
|
294
|
+
var tmp_14 = distinctByStatus(endpoint.op_1);
|
|
295
|
+
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
296
|
+
var tmp_16 = Spacer_instance.vr(3);
|
|
297
|
+
var tmp_17 = Spacer_instance.vr(2);
|
|
298
|
+
var tmp_18 = Spacer_instance.vr(2);
|
|
299
|
+
var tmp_19 = emitFromResponse(this, endpoint);
|
|
300
|
+
var tmp_20 = Spacer_instance.vr(2);
|
|
301
|
+
var tmp_21 = Spacer_instance.vr(2);
|
|
302
|
+
var tmp_22 = this.z1v(endpoint);
|
|
303
|
+
var tmp_23 = Spacer_instance.vr(2);
|
|
304
|
+
var tmp_24 = Spacer_instance.vr(3);
|
|
305
|
+
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.kp_1, '/', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_4) + '"; }\n |' + Spacer_instance.vr(3) + '@Override public String getMethod() { return "' + endpoint.jp_1.toString() + '"; }\n |' + Spacer_instance.vr(3) + '@Override public Wirespec.ServerEdge<Request, Response<?>> getServer(Wirespec.Serialization serialization) {\n |' + Spacer_instance.vr(4) + 'return new Wirespec.ServerEdge<>() {\n |' + Spacer_instance.vr(5) + '@Override public Request from(Wirespec.RawRequest request) { return fromRequest(serialization, request); }\n |' + Spacer_instance.vr(5) + '@Override public Wirespec.RawResponse to(Response<?> response) { return toResponse(serialization, response); }\n |' + Spacer_instance.vr(4) + '};\n |' + Spacer_instance.vr(3) + '}\n |' + Spacer_instance.vr(3) + '@Override public Wirespec.ClientEdge<Request, Response<?>> getClient(Wirespec.Serialization serialization) {\n |' + Spacer_instance.vr(4) + 'return new Wirespec.ClientEdge<>() {\n |' + Spacer_instance.vr(5) + '@Override public Wirespec.RawRequest to(Request request) { return toRequest(serialization, request); }\n |' + Spacer_instance.vr(5) + '@Override public Response<?> from(Wirespec.RawResponse response) { return fromResponse(serialization, response); }\n |' + Spacer_instance.vr(4) + '};\n |' + Spacer_instance.vr(3) + '}\n |' + Spacer_instance.vr(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
306
|
+
}
|
|
307
|
+
function emitHandleFunction(endpoint) {
|
|
308
|
+
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.tq(this.br(endpoint.ip_1)) + '(Request request);';
|
|
309
|
+
}
|
|
310
|
+
function emit_10(_this__u8e3s4, endpoint) {
|
|
311
|
+
return trimMargin('\n |' + Spacer_instance.toString() + 'record Request (\n |' + Spacer_instance.vr(2) + 'Path path,\n |' + Spacer_instance.vr(2) + 'Wirespec.Method method,\n |' + Spacer_instance.vr(2) + 'Queries queries,\n |' + Spacer_instance.vr(2) + 'RequestHeaders headers,\n |' + Spacer_instance.vr(2) + emit_16(this, _this__u8e3s4.rp_1) + ' body\n |' + Spacer_instance.toString() + ') implements Wirespec.Request<' + emit_16(this, _this__u8e3s4.rp_1) + '> {\n |' + Spacer_instance.vr(2) + emitConstructor(this, _this__u8e3s4, endpoint) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
312
|
+
}
|
|
313
|
+
function emit_11(_this__u8e3s4) {
|
|
314
|
+
var tmp = Spacer_instance.toString();
|
|
315
|
+
var tmp_0 = Companion_instance_1.sq(_this__u8e3s4.up_1);
|
|
316
|
+
var tmp_1 = Spacer_instance.vr(2);
|
|
317
|
+
var tmp_2 = Spacer_instance.vr(2);
|
|
318
|
+
var tmp_3 = Spacer_instance.vr(2);
|
|
319
|
+
var tmp_4 = emit_16(this, _this__u8e3s4.wp_1);
|
|
320
|
+
var tmp_5 = Spacer_instance.toString();
|
|
321
|
+
var tmp_6 = toString_0(first(_this__u8e3s4.up_1));
|
|
322
|
+
var tmp_7 = emit_16(this, _this__u8e3s4.wp_1);
|
|
323
|
+
var tmp_8 = concatGenerics(emit_16(this, _this__u8e3s4.wp_1));
|
|
324
|
+
var tmp_9 = Spacer_instance.vr(2);
|
|
325
|
+
var tmp_10 = Companion_instance_1.sq(_this__u8e3s4.up_1);
|
|
326
|
+
var tmp_11 = orNull(joinToString(_this__u8e3s4.vp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_5(this)));
|
|
327
|
+
var tmp0_safe_receiver = _this__u8e3s4.wp_1;
|
|
328
|
+
var tmp_12;
|
|
329
|
+
if (tmp0_safe_receiver == null) {
|
|
330
|
+
tmp_12 = null;
|
|
331
|
+
} else {
|
|
332
|
+
// Inline function 'kotlin.let' call
|
|
333
|
+
tmp_12 = emit_16(this, tmp0_safe_receiver) + ' body';
|
|
334
|
+
}
|
|
335
|
+
var tmp_13 = joinToString(listOfNotNull([tmp_11, tmp_12]));
|
|
336
|
+
var tmp_14 = Spacer_instance.vr(3);
|
|
337
|
+
var tmp_15 = fixStatus(_this__u8e3s4.up_1);
|
|
338
|
+
// Inline function 'kotlin.let' call
|
|
339
|
+
var tmp_16 = 'new Headers(' + joinToString(_this__u8e3s4.vp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_6(this)) + ')';
|
|
340
|
+
var tmp_17 = _this__u8e3s4.wp_1 == null ? 'null' : 'body';
|
|
341
|
+
var tmp_18 = Spacer_instance.vr(2);
|
|
342
|
+
var tmp_19 = Spacer_instance.vr(1);
|
|
343
|
+
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.vp_1, 'Headers', 'Wirespec.Response.Headers', JavaEndpointDefinitionEmitter$emit$lambda_7(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
344
|
+
}
|
|
345
|
+
initMetadataForInterface(JavaEndpointDefinitionEmitter, 'JavaEndpointDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
346
|
+
function emit_12(identifier) {
|
|
279
347
|
var tmp;
|
|
280
348
|
if (identifier instanceof DefinitionIdentifier) {
|
|
281
|
-
tmp = this.
|
|
349
|
+
tmp = this.u1v(identifier.l1());
|
|
282
350
|
} else {
|
|
283
351
|
if (identifier instanceof FieldIdentifier) {
|
|
284
|
-
tmp = this.
|
|
352
|
+
tmp = this.y1v(this.u1v(identifier.l1()));
|
|
285
353
|
} else {
|
|
286
354
|
noWhenBranchMatchedException();
|
|
287
355
|
}
|
|
@@ -299,11 +367,11 @@ function sanitizeSymbol(_this__u8e3s4) {
|
|
|
299
367
|
var item = _iterator__ex2g4s.v();
|
|
300
368
|
var _unary__edvuaz = index;
|
|
301
369
|
index = _unary__edvuaz + 1 | 0;
|
|
302
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
370
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.sq(item) : item;
|
|
303
371
|
destination.x(tmp$ret$0);
|
|
304
372
|
}
|
|
305
373
|
var tmp = asSequence(joinToString(destination, ''));
|
|
306
|
-
return this.
|
|
374
|
+
return this.x1v(joinToString_0(filter(tmp, JavaIdentifierEmitter$sanitizeSymbol$lambda), ''));
|
|
307
375
|
}
|
|
308
376
|
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
309
377
|
var tmp;
|
|
@@ -323,34 +391,39 @@ function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
|
323
391
|
return tmp;
|
|
324
392
|
}
|
|
325
393
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
326
|
-
return Companion_getInstance_0().
|
|
394
|
+
return Companion_getInstance_0().a1w_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
327
395
|
}
|
|
328
396
|
initMetadataForInterface(JavaIdentifierEmitter, 'JavaIdentifierEmitter');
|
|
329
|
-
function
|
|
330
|
-
|
|
397
|
+
function emit_13(enum_0, module_0) {
|
|
398
|
+
var tmp = this.br(enum_0.lr_1);
|
|
399
|
+
return trimMargin('\n |public enum ' + tmp + ' implements Wirespec.Enum {\n |' + spacer(joinToString(enum_0.mr_1, ',\n', VOID, VOID, VOID, VOID, JavaEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'public final String label;\n |' + Spacer_instance.toString() + this.br(enum_0.lr_1) + '(String label) {\n |' + Spacer_instance.vr(2) + 'this.label = label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() {\n |' + Spacer_instance.vr(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String label() {\n |' + Spacer_instance.vr(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
400
|
+
}
|
|
401
|
+
initMetadataForInterface(JavaEnumDefinitionEmitter, 'JavaEnumDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
402
|
+
function emit_14(refined) {
|
|
403
|
+
return trimMargin('\n |public record ' + this.br(refined.gr_1) + ' (' + this.bq(refined.hr_1) + ' value) implements Wirespec.Refined<' + this.bq(refined.hr_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.pr(refined) + '\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public ' + this.bq(refined.hr_1) + ' value() { return value; }\n |}\n |\n ');
|
|
331
404
|
}
|
|
332
405
|
function emitValidator(_this__u8e3s4) {
|
|
333
406
|
var defaultReturn = 'return true;';
|
|
334
|
-
var type = _this__u8e3s4.
|
|
407
|
+
var type = _this__u8e3s4.hr_1.tu_1;
|
|
335
408
|
var tmp;
|
|
336
409
|
if (type instanceof Integer) {
|
|
337
|
-
var tmp0_safe_receiver = type.
|
|
338
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
410
|
+
var tmp0_safe_receiver = type.yt_1;
|
|
411
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.cq(tmp0_safe_receiver);
|
|
339
412
|
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
340
413
|
} else {
|
|
341
414
|
if (type instanceof Number_0) {
|
|
342
|
-
var tmp2_safe_receiver = type.
|
|
343
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.
|
|
415
|
+
var tmp2_safe_receiver = type.bu_1;
|
|
416
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.cq(tmp2_safe_receiver);
|
|
344
417
|
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
345
418
|
} else {
|
|
346
419
|
if (type instanceof String_0) {
|
|
347
|
-
var tmp4_safe_receiver = type.
|
|
420
|
+
var tmp4_safe_receiver = type.vt_1;
|
|
348
421
|
var tmp_0;
|
|
349
422
|
var tmp_1 = tmp4_safe_receiver;
|
|
350
423
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
351
424
|
tmp_0 = null;
|
|
352
425
|
} else {
|
|
353
|
-
tmp_0 = this.
|
|
426
|
+
tmp_0 = this.cq(new RegExp_0(tmp4_safe_receiver));
|
|
354
427
|
}
|
|
355
428
|
var tmp5_elvis_lhs = tmp_0;
|
|
356
429
|
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
@@ -370,85 +443,12 @@ function emitValidator(_this__u8e3s4) {
|
|
|
370
443
|
return tmp;
|
|
371
444
|
}
|
|
372
445
|
initMetadataForInterface(JavaRefinedTypeDefinitionEmitter, 'JavaRefinedTypeDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
373
|
-
function
|
|
374
|
-
var tmp =
|
|
375
|
-
|
|
376
|
-
var tmp_1 = get_pathParams(endpoint);
|
|
377
|
-
var tmp_2 = emitObject(this, tmp_1, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
|
|
378
|
-
var tmp_3 = emitObject(this, endpoint.hp_1, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
379
|
-
var tmp_4 = emitObject(this, endpoint.ip_1, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
380
|
-
var tmp_5 = this.q1v(first_0(endpoint.jp_1), endpoint);
|
|
381
|
-
var tmp_6 = Spacer_instance.toString();
|
|
382
|
-
var tmp_7 = emitStatusInterfaces(this, endpoint);
|
|
383
|
-
var tmp_8 = emitResponseInterfaces(this, endpoint);
|
|
384
|
-
var tmp_9 = distinctByStatus(endpoint.kp_1);
|
|
385
|
-
var tmp_10 = joinToString(tmp_9, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
386
|
-
var tmp_11 = Spacer_instance.toString();
|
|
387
|
-
var tmp_12 = emitRequestFunctions(this, first_0(endpoint.jp_1), endpoint);
|
|
388
|
-
var tmp_13 = Spacer_instance.qr(2);
|
|
389
|
-
var tmp_14 = distinctByStatus(endpoint.kp_1);
|
|
390
|
-
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
391
|
-
var tmp_16 = Spacer_instance.qr(3);
|
|
392
|
-
var tmp_17 = Spacer_instance.qr(2);
|
|
393
|
-
var tmp_18 = Spacer_instance.qr(2);
|
|
394
|
-
var tmp_19 = emitFromResponse(this, endpoint);
|
|
395
|
-
var tmp_20 = Spacer_instance.qr(2);
|
|
396
|
-
var tmp_21 = Spacer_instance.qr(2);
|
|
397
|
-
var tmp_22 = this.u1v(endpoint);
|
|
398
|
-
var tmp_23 = Spacer_instance.qr(2);
|
|
399
|
-
var tmp_24 = Spacer_instance.qr(3);
|
|
400
|
-
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 ');
|
|
401
|
-
}
|
|
402
|
-
function emitHandleFunction(endpoint) {
|
|
403
|
-
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.pq(this.wq(endpoint.ep_1)) + '(Request request);';
|
|
404
|
-
}
|
|
405
|
-
function emit_12(_this__u8e3s4, endpoint) {
|
|
406
|
-
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 ');
|
|
407
|
-
}
|
|
408
|
-
function emit_13(_this__u8e3s4) {
|
|
409
|
-
var tmp = Spacer_instance.toString();
|
|
410
|
-
var tmp_0 = Companion_instance_1.oq(_this__u8e3s4.qp_1);
|
|
411
|
-
var tmp_1 = Spacer_instance.qr(2);
|
|
412
|
-
var tmp_2 = Spacer_instance.qr(2);
|
|
413
|
-
var tmp_3 = Spacer_instance.qr(2);
|
|
414
|
-
var tmp_4 = emit_16(this, _this__u8e3s4.sp_1);
|
|
415
|
-
var tmp_5 = Spacer_instance.toString();
|
|
416
|
-
var tmp_6 = toString_0(first(_this__u8e3s4.qp_1));
|
|
417
|
-
var tmp_7 = emit_16(this, _this__u8e3s4.sp_1);
|
|
418
|
-
var tmp_8 = concatGenerics(emit_16(this, _this__u8e3s4.sp_1));
|
|
419
|
-
var tmp_9 = Spacer_instance.qr(2);
|
|
420
|
-
var tmp_10 = Companion_instance_1.oq(_this__u8e3s4.qp_1);
|
|
421
|
-
var tmp_11 = orNull(joinToString(_this__u8e3s4.rp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_5(this)));
|
|
422
|
-
var tmp0_safe_receiver = _this__u8e3s4.sp_1;
|
|
423
|
-
var tmp_12;
|
|
424
|
-
if (tmp0_safe_receiver == null) {
|
|
425
|
-
tmp_12 = null;
|
|
426
|
-
} else {
|
|
427
|
-
// Inline function 'kotlin.let' call
|
|
428
|
-
tmp_12 = emit_16(this, tmp0_safe_receiver) + ' body';
|
|
429
|
-
}
|
|
430
|
-
var tmp_13 = joinToString(listOfNotNull([tmp_11, tmp_12]));
|
|
431
|
-
var tmp_14 = Spacer_instance.qr(3);
|
|
432
|
-
var tmp_15 = fixStatus(_this__u8e3s4.qp_1);
|
|
433
|
-
// Inline function 'kotlin.let' call
|
|
434
|
-
var tmp_16 = 'new Headers(' + joinToString(_this__u8e3s4.rp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_6(this)) + ')';
|
|
435
|
-
var tmp_17 = _this__u8e3s4.sp_1 == null ? 'null' : 'body';
|
|
436
|
-
var tmp_18 = Spacer_instance.qr(2);
|
|
437
|
-
var tmp_19 = Spacer_instance.qr(1);
|
|
438
|
-
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 ');
|
|
439
|
-
}
|
|
440
|
-
initMetadataForInterface(JavaEndpointDefinitionEmitter, 'JavaEndpointDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
441
|
-
function emit_14(union) {
|
|
442
|
-
var tmp = this.wq(union.qo_1);
|
|
443
|
-
return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.ro_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
|
|
446
|
+
function emit_15(union) {
|
|
447
|
+
var tmp = this.br(union.uo_1);
|
|
448
|
+
return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.vo_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
|
|
444
449
|
}
|
|
445
450
|
initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
446
|
-
|
|
447
|
-
var tmp = this.wq(enum_0.gr_1);
|
|
448
|
-
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 ');
|
|
449
|
-
}
|
|
450
|
-
initMetadataForInterface(JavaEnumDefinitionEmitter, 'JavaEnumDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
451
|
-
initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [JavaChannelDefinitionEmitter, JavaIdentifierEmitter, JavaRefinedTypeDefinitionEmitter, JavaEndpointDefinitionEmitter, JavaUnionDefinitionEmitter, JavaTypeDefinitionEmitter, JavaEnumDefinitionEmitter, LanguageEmitter]);
|
|
451
|
+
initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [JavaEndpointDefinitionEmitter, JavaEnumDefinitionEmitter, JavaRefinedTypeDefinitionEmitter, JavaUnionDefinitionEmitter, JavaTypeDefinitionEmitter, JavaIdentifierEmitter, JavaChannelDefinitionEmitter, LanguageEmitter]);
|
|
452
452
|
initMetadataForCompanion(Companion);
|
|
453
453
|
initMetadataForCompanion(Companion_0);
|
|
454
454
|
initMetadataForClass(JavaIrEmitter, 'JavaIrEmitter', JavaIrEmitter, VOID, [IrEmitter]);
|
|
@@ -462,7 +462,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
462
462
|
var _iterator__ex2g4s = tmp0.t();
|
|
463
463
|
while (_iterator__ex2g4s.u()) {
|
|
464
464
|
var element = _iterator__ex2g4s.v();
|
|
465
|
-
if (!(_this__u8e3s4.
|
|
465
|
+
if (!(_this__u8e3s4.ar().l1() === element.pu_1)) {
|
|
466
466
|
destination.x(element);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
@@ -472,7 +472,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
472
472
|
var _iterator__ex2g4s_0 = destination.t();
|
|
473
473
|
while (_iterator__ex2g4s_0.u()) {
|
|
474
474
|
var item = _iterator__ex2g4s_0.v();
|
|
475
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
475
|
+
var tmp$ret$3 = 'import ' + $this.i1v().rr_1 + '.model.' + item.pu_1 + ';';
|
|
476
476
|
destination_0.x(tmp$ret$3);
|
|
477
477
|
}
|
|
478
478
|
var tmp = destination_0;
|
|
@@ -480,8 +480,8 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
480
480
|
}
|
|
481
481
|
function emitFullyQualified($this, _this__u8e3s4, reference) {
|
|
482
482
|
var tmp;
|
|
483
|
-
if (_this__u8e3s4.
|
|
484
|
-
tmp = $this.
|
|
483
|
+
if (_this__u8e3s4.ar().l1() === reference.l1()) {
|
|
484
|
+
tmp = $this.i1v().rr_1 + '.model.';
|
|
485
485
|
} else {
|
|
486
486
|
tmp = '';
|
|
487
487
|
}
|
|
@@ -494,49 +494,49 @@ function JavaChannelDefinitionEmitter$emitImports$lambda(it) {
|
|
|
494
494
|
function JavaChannelDefinitionEmitter() {
|
|
495
495
|
}
|
|
496
496
|
function JavaEmitter(packageName, emitShared) {
|
|
497
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
498
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
497
|
+
packageName = packageName === VOID ? Companion_instance.qr('community.flock.wirespec.generated') : packageName;
|
|
498
|
+
emitShared = emitShared === VOID ? Companion_instance_0.ko() : emitShared;
|
|
499
499
|
LanguageEmitter.call(this);
|
|
500
|
-
this.
|
|
501
|
-
this.
|
|
502
|
-
this.
|
|
503
|
-
this.
|
|
504
|
-
this.
|
|
505
|
-
this.
|
|
506
|
-
}
|
|
507
|
-
protoOf(JavaEmitter).
|
|
508
|
-
return this.
|
|
500
|
+
this.l1v_1 = packageName;
|
|
501
|
+
this.m1v_1 = emitShared;
|
|
502
|
+
this.n1v_1 = '\nimport community.flock.wirespec.java.Wirespec;\n';
|
|
503
|
+
this.o1v_1 = FileExtension_Java_getInstance();
|
|
504
|
+
this.p1v_1 = JavaShared_getInstance();
|
|
505
|
+
this.q1v_1 = '//';
|
|
506
|
+
}
|
|
507
|
+
protoOf(JavaEmitter).i1v = function () {
|
|
508
|
+
return this.l1v_1;
|
|
509
509
|
};
|
|
510
|
-
protoOf(JavaEmitter).
|
|
511
|
-
return this.
|
|
510
|
+
protoOf(JavaEmitter).iq = function () {
|
|
511
|
+
return this.o1v_1;
|
|
512
512
|
};
|
|
513
|
-
protoOf(JavaEmitter).
|
|
514
|
-
return this.
|
|
513
|
+
protoOf(JavaEmitter).r1v = function () {
|
|
514
|
+
return this.p1v_1;
|
|
515
515
|
};
|
|
516
|
-
protoOf(JavaEmitter).
|
|
517
|
-
return this.
|
|
516
|
+
protoOf(JavaEmitter).jq = function () {
|
|
517
|
+
return this.q1v_1;
|
|
518
518
|
};
|
|
519
|
-
protoOf(JavaEmitter).
|
|
519
|
+
protoOf(JavaEmitter).yq = function (module_0, logger) {
|
|
520
520
|
// Inline function 'kotlin.let' call
|
|
521
|
-
var it = protoOf(LanguageEmitter).
|
|
522
|
-
return this.
|
|
521
|
+
var it = protoOf(LanguageEmitter).yq.call(this, module_0, logger);
|
|
522
|
+
return this.m1v_1.lo_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.qr('community.flock.wirespec.java').tr() + 'Wirespec', this.r1v().t1v_1)) : it;
|
|
523
523
|
};
|
|
524
|
-
protoOf(JavaEmitter).
|
|
524
|
+
protoOf(JavaEmitter).zq = function (definition, module_0, logger) {
|
|
525
525
|
// Inline function 'kotlin.let' call
|
|
526
|
-
var it = protoOf(LanguageEmitter).
|
|
527
|
-
var subPackageName = plus(this.
|
|
528
|
-
var tmp = subPackageName.
|
|
526
|
+
var it = protoOf(LanguageEmitter).zq.call(this, definition, module_0, logger);
|
|
527
|
+
var subPackageName = plus(this.i1v(), definition);
|
|
528
|
+
var tmp = subPackageName.tr() + this.u1v(it.mo_1);
|
|
529
529
|
// Inline function 'kotlin.text.trimStart' call
|
|
530
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.
|
|
530
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.uq(module_0) ? this.n1v_1 : '') + '\n |' + it.no_1 + '\n ');
|
|
531
531
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
532
532
|
return new Emitted(tmp, tmp$ret$0);
|
|
533
533
|
};
|
|
534
534
|
function emitGetType($this, _this__u8e3s4) {
|
|
535
|
-
return 'Wirespec.getType(' + $this.
|
|
535
|
+
return 'Wirespec.getType(' + $this.k1v(_this__u8e3s4, 'Void') + '.class, ' + emitGetTypeRaw($this, _this__u8e3s4) + ')';
|
|
536
536
|
}
|
|
537
537
|
function emitGetTypeRaw($this, _this__u8e3s4) {
|
|
538
538
|
var tmp;
|
|
539
|
-
var tmp1_elvis_lhs = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
539
|
+
var tmp1_elvis_lhs = _this__u8e3s4 == null ? null : _this__u8e3s4.hu();
|
|
540
540
|
if (tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs) {
|
|
541
541
|
tmp = 'java.util.Optional.class';
|
|
542
542
|
} else {
|
|
@@ -551,9 +551,9 @@ function emitGetTypeRaw($this, _this__u8e3s4) {
|
|
|
551
551
|
function emitConstructor($this, _this__u8e3s4, endpoint) {
|
|
552
552
|
var tmp = get_pathParams(endpoint);
|
|
553
553
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda($this)));
|
|
554
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
555
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
556
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
554
|
+
var tmp_1 = orNull(joinToString(endpoint.lp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_0($this)));
|
|
555
|
+
var tmp_2 = orNull(joinToString(endpoint.mp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_1($this)));
|
|
556
|
+
var tmp0_safe_receiver = _this__u8e3s4.rp_1;
|
|
557
557
|
var tmp_3;
|
|
558
558
|
if (tmp0_safe_receiver == null) {
|
|
559
559
|
tmp_3 = null;
|
|
@@ -562,112 +562,112 @@ function emitConstructor($this, _this__u8e3s4, endpoint) {
|
|
|
562
562
|
tmp_3 = emit_16($this, tmp0_safe_receiver) + ' body';
|
|
563
563
|
}
|
|
564
564
|
var tmp_4 = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]));
|
|
565
|
-
var tmp_5 = Spacer_instance.
|
|
565
|
+
var tmp_5 = Spacer_instance.vr(3);
|
|
566
566
|
var tmp_6 = get_pathParams(endpoint);
|
|
567
567
|
// Inline function 'kotlin.let' call
|
|
568
568
|
var tmp$ret$3 = 'new Path(' + joinToString(tmp_6, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_2($this)) + ')';
|
|
569
569
|
var tmp1_elvis_lhs = orNull(tmp$ret$3);
|
|
570
570
|
var tmp_7 = tmp1_elvis_lhs == null ? 'new Path()' : tmp1_elvis_lhs;
|
|
571
|
-
var tmp_8 = 'Wirespec.Method.' + endpoint.
|
|
571
|
+
var tmp_8 = 'Wirespec.Method.' + endpoint.jp_1.a3_1;
|
|
572
572
|
// Inline function 'kotlin.let' call
|
|
573
|
-
var tmp$ret$5 = 'new Queries(' + joinToString(endpoint.
|
|
573
|
+
var tmp$ret$5 = 'new Queries(' + joinToString(endpoint.lp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_3($this)) + ')';
|
|
574
574
|
var tmp2_elvis_lhs = orNull(tmp$ret$5);
|
|
575
575
|
var tmp_9 = tmp2_elvis_lhs == null ? 'new Queries()' : tmp2_elvis_lhs;
|
|
576
576
|
// Inline function 'kotlin.let' call
|
|
577
|
-
var tmp$ret$7 = 'new RequestHeaders(' + joinToString(endpoint.
|
|
577
|
+
var tmp$ret$7 = 'new RequestHeaders(' + joinToString(endpoint.mp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_4($this)) + ')';
|
|
578
578
|
var tmp3_elvis_lhs = orNull(tmp$ret$7);
|
|
579
579
|
var tmp_10 = tmp3_elvis_lhs == null ? 'new RequestHeaders()' : tmp3_elvis_lhs;
|
|
580
580
|
var tmp_11;
|
|
581
|
-
if (_this__u8e3s4.
|
|
581
|
+
if (_this__u8e3s4.rp_1 == null) {
|
|
582
582
|
tmp_11 = null;
|
|
583
583
|
} else {
|
|
584
584
|
// Inline function 'kotlin.let' call
|
|
585
585
|
tmp_11 = 'body';
|
|
586
586
|
}
|
|
587
587
|
var tmp5_elvis_lhs = tmp_11;
|
|
588
|
-
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.
|
|
588
|
+
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.vr(2) + '}';
|
|
589
589
|
}
|
|
590
590
|
function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
591
591
|
var tmp = get_indexedPathParams(endpoint);
|
|
592
592
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
|
|
593
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
594
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
595
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
593
|
+
var tmp_1 = orNull(joinToString(endpoint.lp_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
594
|
+
var tmp_2 = orNull(joinToString(endpoint.mp_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
595
|
+
var tmp0_safe_receiver = _this__u8e3s4.rp_1;
|
|
596
596
|
var tmp_3;
|
|
597
597
|
if (tmp0_safe_receiver == null) {
|
|
598
598
|
tmp_3 = null;
|
|
599
599
|
} else {
|
|
600
600
|
// Inline function 'kotlin.let' call
|
|
601
|
-
tmp_3 = Spacer_instance.
|
|
601
|
+
tmp_3 = Spacer_instance.vr(4) + 'request.body().<' + emit_16($this, tmp0_safe_receiver) + '>map(body -> serialization.deserializeBody(body, ' + emitGetType($this, tmp0_safe_receiver.tp_1) + ')).orElse(null)';
|
|
602
602
|
}
|
|
603
603
|
// Inline function 'kotlin.let' call
|
|
604
604
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
605
|
-
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.
|
|
605
|
+
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.vr(3);
|
|
606
606
|
}
|
|
607
607
|
function emitDeserializedParams_0($this, _this__u8e3s4) {
|
|
608
|
-
var tmp = orNull(joinToString(_this__u8e3s4.
|
|
609
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
608
|
+
var tmp = orNull(joinToString(_this__u8e3s4.vp_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2($this)));
|
|
609
|
+
var tmp0_safe_receiver = _this__u8e3s4.wp_1;
|
|
610
610
|
var tmp_0;
|
|
611
611
|
if (tmp0_safe_receiver == null) {
|
|
612
612
|
tmp_0 = null;
|
|
613
613
|
} else {
|
|
614
614
|
// Inline function 'kotlin.let' call
|
|
615
|
-
tmp_0 = Spacer_instance.
|
|
615
|
+
tmp_0 = Spacer_instance.vr(5) + 'response.body().<' + emit_16($this, tmp0_safe_receiver) + '>map(body -> serialization.deserializeBody(body, ' + emitGetType($this, tmp0_safe_receiver.tp_1) + ')).orElse(null)';
|
|
616
616
|
}
|
|
617
617
|
// Inline function 'kotlin.let' call
|
|
618
618
|
var it = joinToString(listOfNotNull([tmp, tmp_0]), ',\n');
|
|
619
|
-
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.
|
|
619
|
+
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.vr(4);
|
|
620
620
|
}
|
|
621
621
|
function emitSerialized($this, _this__u8e3s4) {
|
|
622
622
|
var tmp;
|
|
623
|
-
if (!(_this__u8e3s4.
|
|
624
|
-
tmp = 'java.util.Optional.ofNullable(serialization.serializeBody(r.body, ' + emitGetType($this, ensureNotNull(_this__u8e3s4.
|
|
623
|
+
if (!(_this__u8e3s4.wp_1 == null)) {
|
|
624
|
+
tmp = 'java.util.Optional.ofNullable(serialization.serializeBody(r.body, ' + emitGetType($this, ensureNotNull(_this__u8e3s4.wp_1).tp_1) + '))';
|
|
625
625
|
} else {
|
|
626
626
|
tmp = 'java.util.Optional.empty()';
|
|
627
627
|
}
|
|
628
628
|
var body = tmp;
|
|
629
629
|
var tmp_0;
|
|
630
630
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
631
|
-
if (!_this__u8e3s4.
|
|
632
|
-
tmp_0 = 'java.util.Map.ofEntries(' + joinToString(_this__u8e3s4.
|
|
631
|
+
if (!_this__u8e3s4.vp_1.r()) {
|
|
632
|
+
tmp_0 = 'java.util.Map.ofEntries(' + joinToString(_this__u8e3s4.vp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitSerialized$lambda($this)) + ')';
|
|
633
633
|
} else {
|
|
634
634
|
tmp_0 = 'java.util.Collections.emptyMap()';
|
|
635
635
|
}
|
|
636
636
|
var headers = tmp_0;
|
|
637
|
-
return Spacer_instance.
|
|
637
|
+
return Spacer_instance.vr(3) + 'if (response instanceof Response' + Companion_instance_1.sq(_this__u8e3s4.up_1) + ' r) { return new Wirespec.RawResponse(r.status(), ' + headers + ', ' + body + '); }';
|
|
638
638
|
}
|
|
639
639
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
640
|
-
return Spacer_instance.
|
|
640
|
+
return Spacer_instance.vr(4) + 'case ' + _this__u8e3s4.up_1 + ' -> new Response' + Companion_instance_1.sq(_this__u8e3s4.up_1) + '(' + emitDeserializedParams_0($this, _this__u8e3s4) + ');';
|
|
641
641
|
}
|
|
642
642
|
function emitSerializedParams($this, _this__u8e3s4, fields) {
|
|
643
|
-
return 'java.util.Map.entry("' + _this__u8e3s4.
|
|
643
|
+
return 'java.util.Map.entry("' + _this__u8e3s4.ep_1.l1() + '", serialization.serializeParam(request.' + (fields === 'queries' ? 'queries' : 'headers') + '().' + $this.br(_this__u8e3s4.ep_1) + '(), ' + emitGetType($this, _this__u8e3s4.fp_1) + '))';
|
|
644
644
|
}
|
|
645
645
|
function emitDeserialized_0($this, _this__u8e3s4) {
|
|
646
|
-
return Spacer_instance.
|
|
646
|
+
return Spacer_instance.vr(4) + 'serialization.deserializePath(request.path().get(' + _this__u8e3s4.oe_1 + '), ' + emitGetType($this, _this__u8e3s4.pe_1.qp_1) + ')';
|
|
647
647
|
}
|
|
648
648
|
function emitDeserializedParams_1($this, _this__u8e3s4, fields, caseSensitive) {
|
|
649
649
|
var tmp;
|
|
650
650
|
if (caseSensitive) {
|
|
651
|
-
tmp = 'request.' + fields + '().getOrDefault("' + _this__u8e3s4.
|
|
651
|
+
tmp = 'request.' + fields + '().getOrDefault("' + _this__u8e3s4.ep_1.l1() + '", java.util.Collections.emptyList())';
|
|
652
652
|
} else {
|
|
653
|
-
tmp = 'request.' + fields + '().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + _this__u8e3s4.
|
|
653
|
+
tmp = 'request.' + fields + '().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + _this__u8e3s4.ep_1.l1() + '")).findFirst().map(java.util.Map.Entry::getValue).orElse(java.util.Collections.emptyList())';
|
|
654
654
|
}
|
|
655
655
|
var valuesFromField = tmp;
|
|
656
|
-
return Spacer_instance.
|
|
656
|
+
return Spacer_instance.vr(4) + 'serialization.<' + $this.bq(_this__u8e3s4.fp_1) + '>deserializeParam(' + valuesFromField + ', ' + emitGetType($this, _this__u8e3s4.fp_1) + ')';
|
|
657
657
|
}
|
|
658
658
|
function emitSerializedHeader($this, _this__u8e3s4) {
|
|
659
|
-
return 'java.util.Map.entry("' + _this__u8e3s4.
|
|
659
|
+
return 'java.util.Map.entry("' + _this__u8e3s4.ep_1.l1() + '", serialization.<' + $this.bq(_this__u8e3s4.fp_1) + '>serializeParam(r.headers().' + $this.br(_this__u8e3s4.ep_1) + '(), ' + emitGetType($this, _this__u8e3s4.fp_1) + '))';
|
|
660
660
|
}
|
|
661
661
|
function emitIdentifier($this, _this__u8e3s4) {
|
|
662
|
-
return 'serialization.serializePath(request.path().' + Companion_instance_1.
|
|
662
|
+
return 'serialization.serializePath(request.path().' + Companion_instance_1.tq($this.br(_this__u8e3s4.pp_1)) + '(), ' + emitGetType($this, _this__u8e3s4.qp_1) + ')';
|
|
663
663
|
}
|
|
664
664
|
function emit_16($this, _this__u8e3s4) {
|
|
665
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
666
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
665
|
+
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.tp_1;
|
|
666
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.bq(tmp1_safe_receiver);
|
|
667
667
|
return tmp2_elvis_lhs == null ? 'Void' : tmp2_elvis_lhs;
|
|
668
668
|
}
|
|
669
669
|
function emit_17($this, _this__u8e3s4) {
|
|
670
|
-
return $this.
|
|
670
|
+
return $this.bq(_this__u8e3s4.qp_1) + ' ' + $this.br(_this__u8e3s4.pp_1);
|
|
671
671
|
}
|
|
672
672
|
function emitImports_0($this, _this__u8e3s4) {
|
|
673
673
|
// Inline function 'kotlin.collections.filter' call
|
|
@@ -677,7 +677,7 @@ function emitImports_0($this, _this__u8e3s4) {
|
|
|
677
677
|
var _iterator__ex2g4s = tmp0.t();
|
|
678
678
|
while (_iterator__ex2g4s.u()) {
|
|
679
679
|
var element = _iterator__ex2g4s.v();
|
|
680
|
-
if (!(_this__u8e3s4.
|
|
680
|
+
if (!(_this__u8e3s4.ar().l1() === element.pu_1)) {
|
|
681
681
|
destination.x(element);
|
|
682
682
|
}
|
|
683
683
|
}
|
|
@@ -687,46 +687,46 @@ function emitImports_0($this, _this__u8e3s4) {
|
|
|
687
687
|
var _iterator__ex2g4s_0 = destination.t();
|
|
688
688
|
while (_iterator__ex2g4s_0.u()) {
|
|
689
689
|
var item = _iterator__ex2g4s_0.v();
|
|
690
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
690
|
+
var tmp$ret$3 = 'import ' + $this.i1v().rr_1 + '.model.' + item.pu_1 + ';';
|
|
691
691
|
destination_0.x(tmp$ret$3);
|
|
692
692
|
}
|
|
693
693
|
var tmp = destination_0;
|
|
694
694
|
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitImports$lambda);
|
|
695
695
|
}
|
|
696
696
|
function emitRequestFunctions($this, _this__u8e3s4, endpoint) {
|
|
697
|
-
var tmp = Spacer_instance.
|
|
698
|
-
var tmp_0 = Spacer_instance.
|
|
699
|
-
var tmp_1 = Spacer_instance.
|
|
700
|
-
var tmp_2 = Spacer_instance.
|
|
701
|
-
var tmp_3 = joinToString(endpoint.
|
|
702
|
-
var tmp_4 = Spacer_instance.
|
|
697
|
+
var tmp = Spacer_instance.vr(2);
|
|
698
|
+
var tmp_0 = Spacer_instance.vr(3);
|
|
699
|
+
var tmp_1 = Spacer_instance.vr(4);
|
|
700
|
+
var tmp_2 = Spacer_instance.vr(4);
|
|
701
|
+
var tmp_3 = joinToString(endpoint.kp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda($this));
|
|
702
|
+
var tmp_4 = Spacer_instance.vr(4);
|
|
703
703
|
var tmp_5;
|
|
704
704
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
705
|
-
if (!endpoint.
|
|
706
|
-
tmp_5 = 'java.util.Map.ofEntries(' + joinToString(endpoint.
|
|
705
|
+
if (!endpoint.lp_1.r()) {
|
|
706
|
+
tmp_5 = 'java.util.Map.ofEntries(' + joinToString(endpoint.lp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_0($this)) + ')';
|
|
707
707
|
} else {
|
|
708
708
|
tmp_5 = 'java.util.Collections.emptyMap()';
|
|
709
709
|
}
|
|
710
710
|
var tmp_6 = tmp_5;
|
|
711
|
-
var tmp_7 = Spacer_instance.
|
|
711
|
+
var tmp_7 = Spacer_instance.vr(4);
|
|
712
712
|
var tmp_8;
|
|
713
713
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
714
|
-
if (!endpoint.
|
|
715
|
-
tmp_8 = 'java.util.Map.ofEntries(' + joinToString(endpoint.
|
|
714
|
+
if (!endpoint.mp_1.r()) {
|
|
715
|
+
tmp_8 = 'java.util.Map.ofEntries(' + joinToString(endpoint.mp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1($this)) + ')';
|
|
716
716
|
} else {
|
|
717
717
|
tmp_8 = 'java.util.Collections.emptyMap()';
|
|
718
718
|
}
|
|
719
719
|
var tmp_9 = tmp_8;
|
|
720
|
-
var tmp_10 = Spacer_instance.
|
|
720
|
+
var tmp_10 = Spacer_instance.vr(4);
|
|
721
721
|
var tmp_11;
|
|
722
|
-
if (!(_this__u8e3s4.
|
|
723
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
724
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
722
|
+
if (!(_this__u8e3s4.rp_1 == null)) {
|
|
723
|
+
var tmp0_safe_receiver = _this__u8e3s4.rp_1;
|
|
724
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.tp_1;
|
|
725
725
|
tmp_11 = 'java.util.Optional.ofNullable(serialization.serializeBody(request.body(), ' + (tmp1_safe_receiver == null ? null : emitGetType($this, tmp1_safe_receiver)) + '))';
|
|
726
726
|
} else {
|
|
727
727
|
tmp_11 = 'java.util.Optional.empty()';
|
|
728
728
|
}
|
|
729
|
-
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.
|
|
729
|
+
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.vr(3) + ');\n |' + Spacer_instance.vr(2) + '}\n |\n |' + Spacer_instance.vr(2) + 'static Request fromRequest(Wirespec.Deserializer serialization, Wirespec.RawRequest request) {\n |' + Spacer_instance.vr(3) + 'return new Request(' + emitDeserializedParams($this, _this__u8e3s4, endpoint) + ');\n |' + Spacer_instance.vr(2) + '}\n ');
|
|
730
730
|
}
|
|
731
731
|
function emitObject($this, _this__u8e3s4, name, extends_0, block) {
|
|
732
732
|
var tmp;
|
|
@@ -740,13 +740,13 @@ function emitObject($this, _this__u8e3s4, name, extends_0, block) {
|
|
|
740
740
|
}
|
|
741
741
|
function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
742
742
|
// Inline function 'kotlin.collections.map' call
|
|
743
|
-
var this_0 = distinctByStatus(_this__u8e3s4.
|
|
743
|
+
var this_0 = distinctByStatus(_this__u8e3s4.op_1);
|
|
744
744
|
// Inline function 'kotlin.collections.mapTo' call
|
|
745
745
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
746
746
|
var _iterator__ex2g4s = this_0.t();
|
|
747
747
|
while (_iterator__ex2g4s.u()) {
|
|
748
748
|
var item = _iterator__ex2g4s.v();
|
|
749
|
-
var tmp$ret$0 = emit_16($this, item.
|
|
749
|
+
var tmp$ret$0 = emit_16($this, item.wp_1);
|
|
750
750
|
destination.x(tmp$ret$0);
|
|
751
751
|
}
|
|
752
752
|
var tmp = distinct(destination);
|
|
@@ -754,13 +754,13 @@ function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
|
754
754
|
}
|
|
755
755
|
function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
756
756
|
// Inline function 'kotlin.collections.map' call
|
|
757
|
-
var this_0 = _this__u8e3s4.
|
|
757
|
+
var this_0 = _this__u8e3s4.op_1;
|
|
758
758
|
// Inline function 'kotlin.collections.mapTo' call
|
|
759
759
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
760
760
|
var _iterator__ex2g4s = this_0.t();
|
|
761
761
|
while (_iterator__ex2g4s.u()) {
|
|
762
762
|
var item = _iterator__ex2g4s.v();
|
|
763
|
-
var tmp$ret$0 = new Char(first(item.
|
|
763
|
+
var tmp$ret$0 = new Char(first(item.up_1));
|
|
764
764
|
destination.x(tmp$ret$0);
|
|
765
765
|
}
|
|
766
766
|
var tmp = distinct(destination);
|
|
@@ -768,26 +768,26 @@ function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
|
768
768
|
}
|
|
769
769
|
function emitFromResponse($this, _this__u8e3s4) {
|
|
770
770
|
// Inline function 'kotlin.collections.filter' call
|
|
771
|
-
var tmp0 = distinctByStatus(_this__u8e3s4.
|
|
771
|
+
var tmp0 = distinctByStatus(_this__u8e3s4.op_1);
|
|
772
772
|
// Inline function 'kotlin.collections.filterTo' call
|
|
773
773
|
var destination = ArrayList_init_$Create$();
|
|
774
774
|
var _iterator__ex2g4s = tmp0.t();
|
|
775
775
|
while (_iterator__ex2g4s.u()) {
|
|
776
776
|
var element = _iterator__ex2g4s.v();
|
|
777
|
-
if (Companion_instance_1.
|
|
777
|
+
if (Companion_instance_1.wq(element.up_1)) {
|
|
778
778
|
destination.x(element);
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
781
|
var statusResponses = destination;
|
|
782
782
|
var tmp;
|
|
783
783
|
if (statusResponses.r()) {
|
|
784
|
-
tmp = trimMargin('\n |' + Spacer_instance.
|
|
784
|
+
tmp = trimMargin('\n |' + Spacer_instance.vr(3) + 'throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n ');
|
|
785
785
|
} else if (statusResponses.a1() === 1) {
|
|
786
786
|
var response = first_0(statusResponses);
|
|
787
|
-
tmp = trimMargin('\n |' + Spacer_instance.
|
|
787
|
+
tmp = trimMargin('\n |' + Spacer_instance.vr(3) + 'if (response.statusCode() == ' + response.up_1 + ') {\n |' + Spacer_instance.vr(4) + 'return new Response' + Companion_instance_1.sq(response.up_1) + '(' + emitDeserializedParams_0($this, response) + ');\n |' + Spacer_instance.vr(3) + '} else {\n |' + Spacer_instance.vr(4) + 'throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n |' + Spacer_instance.vr(3) + '}\n ');
|
|
788
788
|
} else {
|
|
789
|
-
var tmp_0 = Spacer_instance.
|
|
790
|
-
tmp = trimMargin('\n |' + tmp_0 + 'return switch (response.statusCode()) {\n |' + joinToString(statusResponses, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitFromResponse$lambda($this)) + '\n |' + Spacer_instance.
|
|
789
|
+
var tmp_0 = Spacer_instance.vr(3);
|
|
790
|
+
tmp = trimMargin('\n |' + tmp_0 + 'return switch (response.statusCode()) {\n |' + joinToString(statusResponses, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitFromResponse$lambda($this)) + '\n |' + Spacer_instance.vr(4) + 'default -> throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n |' + Spacer_instance.vr(3) + '};\n ');
|
|
791
791
|
}
|
|
792
792
|
return tmp;
|
|
793
793
|
}
|
|
@@ -798,17 +798,17 @@ function JavaEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
|
798
798
|
}
|
|
799
799
|
function JavaEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
800
800
|
return function (it) {
|
|
801
|
-
return this$0.
|
|
801
|
+
return this$0.aq(it);
|
|
802
802
|
};
|
|
803
803
|
}
|
|
804
804
|
function JavaEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
805
805
|
return function (it) {
|
|
806
|
-
return this$0.
|
|
806
|
+
return this$0.aq(it);
|
|
807
807
|
};
|
|
808
808
|
}
|
|
809
809
|
function JavaEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
810
810
|
return function (it) {
|
|
811
|
-
return this$0.
|
|
811
|
+
return this$0.w1v(it);
|
|
812
812
|
};
|
|
813
813
|
}
|
|
814
814
|
function JavaEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
@@ -826,27 +826,27 @@ function JavaEndpointDefinitionEmitter$emitConstructor$lambda(this$0) {
|
|
|
826
826
|
}
|
|
827
827
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_0(this$0) {
|
|
828
828
|
return function (it) {
|
|
829
|
-
return this$0.
|
|
829
|
+
return this$0.aq(it);
|
|
830
830
|
};
|
|
831
831
|
}
|
|
832
832
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_1(this$0) {
|
|
833
833
|
return function (it) {
|
|
834
|
-
return this$0.
|
|
834
|
+
return this$0.aq(it);
|
|
835
835
|
};
|
|
836
836
|
}
|
|
837
837
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_2(this$0) {
|
|
838
838
|
return function (it) {
|
|
839
|
-
return this$0.
|
|
839
|
+
return this$0.br(it.pp_1);
|
|
840
840
|
};
|
|
841
841
|
}
|
|
842
842
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_3(this$0) {
|
|
843
843
|
return function (it) {
|
|
844
|
-
return this$0.
|
|
844
|
+
return this$0.br(it.ep_1);
|
|
845
845
|
};
|
|
846
846
|
}
|
|
847
847
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_4(this$0) {
|
|
848
848
|
return function (it) {
|
|
849
|
-
return this$0.
|
|
849
|
+
return this$0.br(it.ep_1);
|
|
850
850
|
};
|
|
851
851
|
}
|
|
852
852
|
function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda(this$0) {
|
|
@@ -866,22 +866,22 @@ function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1(this$0) {
|
|
|
866
866
|
}
|
|
867
867
|
function JavaEndpointDefinitionEmitter$emit$lambda_5(this$0) {
|
|
868
868
|
return function (it) {
|
|
869
|
-
return this$0.
|
|
869
|
+
return this$0.aq(it);
|
|
870
870
|
};
|
|
871
871
|
}
|
|
872
872
|
function JavaEndpointDefinitionEmitter$emit$lambda_6(this$0) {
|
|
873
873
|
return function (it) {
|
|
874
|
-
return this$0.
|
|
874
|
+
return this$0.br(it.ep_1);
|
|
875
875
|
};
|
|
876
876
|
}
|
|
877
877
|
function JavaEndpointDefinitionEmitter$emit$lambda_7(this$0) {
|
|
878
878
|
return function (it) {
|
|
879
|
-
return this$0.
|
|
879
|
+
return this$0.aq(it);
|
|
880
880
|
};
|
|
881
881
|
}
|
|
882
882
|
function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2(this$0) {
|
|
883
883
|
return function (it) {
|
|
884
|
-
return Spacer_instance.
|
|
884
|
+
return Spacer_instance.vr(5) + 'serialization.<' + this$0.bq(it.fp_1) + '>deserializeParam(response.headers().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + it.ep_1.l1() + '")).findFirst().map(java.util.Map.Entry::getValue).orElse(java.util.Collections.emptyList()), ' + emitGetType(this$0, it.fp_1) + ')';
|
|
885
885
|
};
|
|
886
886
|
}
|
|
887
887
|
function JavaEndpointDefinitionEmitter$emitSerialized$lambda(this$0) {
|
|
@@ -897,7 +897,7 @@ function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda(this$0) {
|
|
|
897
897
|
return function (it) {
|
|
898
898
|
var tmp;
|
|
899
899
|
if (it instanceof Literal) {
|
|
900
|
-
tmp = '"' + it.
|
|
900
|
+
tmp = '"' + it.lq_1 + '"';
|
|
901
901
|
} else {
|
|
902
902
|
if (it instanceof Param) {
|
|
903
903
|
tmp = emitIdentifier(this$0, it);
|
|
@@ -920,7 +920,7 @@ function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1(this$0) {
|
|
|
920
920
|
}
|
|
921
921
|
function JavaEndpointDefinitionEmitter$emitObject$lambda($block) {
|
|
922
922
|
return function (it) {
|
|
923
|
-
return Spacer_instance.
|
|
923
|
+
return Spacer_instance.vr(2) + $block(it);
|
|
924
924
|
};
|
|
925
925
|
}
|
|
926
926
|
function JavaEndpointDefinitionEmitter$emitResponseInterfaces$lambda(it) {
|
|
@@ -940,7 +940,7 @@ function sanitizeNegative($this, _this__u8e3s4) {
|
|
|
940
940
|
return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
|
|
941
941
|
}
|
|
942
942
|
function sanitizeEnum($this, _this__u8e3s4) {
|
|
943
|
-
return $this.
|
|
943
|
+
return $this.y1v($this.x1v(joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_')));
|
|
944
944
|
}
|
|
945
945
|
function JavaEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
946
946
|
return function (it) {
|
|
@@ -951,7 +951,7 @@ function JavaEnumDefinitionEmitter() {
|
|
|
951
951
|
}
|
|
952
952
|
function Companion() {
|
|
953
953
|
Companion_instance_2 = this;
|
|
954
|
-
this.
|
|
954
|
+
this.a1w_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']);
|
|
955
955
|
}
|
|
956
956
|
var Companion_instance_2;
|
|
957
957
|
function Companion_getInstance_0() {
|
|
@@ -975,7 +975,7 @@ function sanitizeSymbol_0($this, _this__u8e3s4) {
|
|
|
975
975
|
var item = _iterator__ex2g4s.v();
|
|
976
976
|
var _unary__edvuaz = index;
|
|
977
977
|
index = _unary__edvuaz + 1 | 0;
|
|
978
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
978
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.sq(item) : item;
|
|
979
979
|
destination.x(tmp$ret$0);
|
|
980
980
|
}
|
|
981
981
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1015,14 +1015,14 @@ function sanitizeFirstIsDigit_0($this, _this__u8e3s4) {
|
|
|
1015
1015
|
return tmp;
|
|
1016
1016
|
}
|
|
1017
1017
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1018
|
-
return Companion_getInstance_1().
|
|
1018
|
+
return Companion_getInstance_1().b1w_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1019
1019
|
}
|
|
1020
1020
|
function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
1021
1021
|
return sanitizeKeywords_0($this, sanitizeFirstIsDigit_0($this, joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_')));
|
|
1022
1022
|
}
|
|
1023
1023
|
function Companion_0() {
|
|
1024
1024
|
Companion_instance_3 = this;
|
|
1025
|
-
this.
|
|
1025
|
+
this.b1w_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']);
|
|
1026
1026
|
}
|
|
1027
1027
|
var Companion_instance_3;
|
|
1028
1028
|
function Companion_getInstance_1() {
|
|
@@ -1034,10 +1034,10 @@ function JavaIrEmitter$sanitizationConfig$lambda(it) {
|
|
|
1034
1034
|
return '_' + it;
|
|
1035
1035
|
}
|
|
1036
1036
|
function JavaIrEmitter$sanitizationConfig$lambda_0(name) {
|
|
1037
|
-
return name.
|
|
1037
|
+
return name.l1h_1.a1() > 1 ? new Name(listOf(name.x1l())) : name;
|
|
1038
1038
|
}
|
|
1039
1039
|
function JavaIrEmitter$sanitizationConfig$lambda_1(name) {
|
|
1040
|
-
return new Name(listOf(name.
|
|
1040
|
+
return new Name(listOf(name.x1l()));
|
|
1041
1041
|
}
|
|
1042
1042
|
function JavaIrEmitter$sanitizationConfig$lambda_2(this$0) {
|
|
1043
1043
|
return function (it) {
|
|
@@ -1048,23 +1048,23 @@ function JavaIrEmitter$sanitizationConfig$lambda_3(stmt, tr) {
|
|
|
1048
1048
|
var tmp;
|
|
1049
1049
|
var tmp_0;
|
|
1050
1050
|
if (stmt instanceof FunctionCall) {
|
|
1051
|
-
tmp_0 = stmt.
|
|
1051
|
+
tmp_0 = stmt.g1m_1.x1h() === 'validate';
|
|
1052
1052
|
} else {
|
|
1053
1053
|
tmp_0 = false;
|
|
1054
1054
|
}
|
|
1055
1055
|
if (tmp_0) {
|
|
1056
|
-
tmp = transformChildren(stmt.
|
|
1056
|
+
tmp = transformChildren(stmt.k1m(VOID, emptyList()), tr);
|
|
1057
1057
|
} else {
|
|
1058
1058
|
tmp = transformChildren(stmt, tr);
|
|
1059
1059
|
}
|
|
1060
1060
|
return tmp;
|
|
1061
1061
|
}
|
|
1062
1062
|
function JavaIrEmitter$emitShared$lambda(name) {
|
|
1063
|
-
switch (name.
|
|
1063
|
+
switch (name.x1h()) {
|
|
1064
1064
|
case 'client':
|
|
1065
|
-
return Companion_getInstance().
|
|
1065
|
+
return Companion_getInstance().k1h('getClient');
|
|
1066
1066
|
case 'server':
|
|
1067
|
-
return Companion_getInstance().
|
|
1067
|
+
return Companion_getInstance().k1h('getServer');
|
|
1068
1068
|
default:
|
|
1069
1069
|
return null;
|
|
1070
1070
|
}
|
|
@@ -1074,7 +1074,7 @@ function JavaIrEmitter$emitShared$lambda_0($imports) {
|
|
|
1074
1074
|
var tmp;
|
|
1075
1075
|
if (element instanceof File) {
|
|
1076
1076
|
// Inline function 'kotlin.collections.partition' call
|
|
1077
|
-
var this_0 = element.
|
|
1077
|
+
var this_0 = element.y1m_1;
|
|
1078
1078
|
var first = ArrayList_init_$Create$();
|
|
1079
1079
|
var second = ArrayList_init_$Create$();
|
|
1080
1080
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -1087,9 +1087,9 @@ function JavaIrEmitter$emitShared$lambda_0($imports) {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
}
|
|
1089
1089
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1090
|
-
var packageElements = _destruct__k2r9zo.
|
|
1091
|
-
var rest = _destruct__k2r9zo.
|
|
1092
|
-
tmp = element.
|
|
1090
|
+
var packageElements = _destruct__k2r9zo.qe();
|
|
1091
|
+
var rest = _destruct__k2r9zo.re();
|
|
1092
|
+
tmp = element.b1n(VOID, plus_1(plus_1(packageElements, $imports), rest));
|
|
1093
1093
|
} else {
|
|
1094
1094
|
tmp = element;
|
|
1095
1095
|
}
|
|
@@ -1101,11 +1101,11 @@ function JavaIrEmitter$emitShared$lambda_1($clientServer) {
|
|
|
1101
1101
|
return function (element, transformer) {
|
|
1102
1102
|
var tmp;
|
|
1103
1103
|
if (element instanceof Namespace) {
|
|
1104
|
-
var injected = element.
|
|
1104
|
+
var injected = element.d1n_1.equals(Companion_getInstance().k1h('Wirespec')) ? $clientServer : emptyList();
|
|
1105
1105
|
var tmp_0;
|
|
1106
1106
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1107
1107
|
if (!injected.r()) {
|
|
1108
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1108
|
+
tmp_0 = withElements(element, plus_1(element.z1m(), injected));
|
|
1109
1109
|
} else {
|
|
1110
1110
|
tmp_0 = element;
|
|
1111
1111
|
}
|
|
@@ -1126,38 +1126,38 @@ function JavaIrEmitter$emit$lambda_0(it) {
|
|
|
1126
1126
|
return listOf(function_0('label', VOID, VOID, JavaIrEmitter$emit$lambda$lambda));
|
|
1127
1127
|
}
|
|
1128
1128
|
function JavaIrEmitter$emit$lambda$lambda($this$function) {
|
|
1129
|
-
$this$function.
|
|
1130
|
-
$this$function.
|
|
1129
|
+
$this$function.p1i(String_instance);
|
|
1130
|
+
$this$function.o1k(new VariableReference(Companion_getInstance().k1h('label')));
|
|
1131
1131
|
return Unit_instance;
|
|
1132
1132
|
}
|
|
1133
1133
|
function JavaIrEmitter(packageName, emitShared) {
|
|
1134
1134
|
Companion_getInstance_1();
|
|
1135
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
1136
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
1137
|
-
this.
|
|
1138
|
-
this.
|
|
1139
|
-
this.
|
|
1140
|
-
this.
|
|
1141
|
-
this.
|
|
1135
|
+
packageName = packageName === VOID ? Companion_instance.qr('community.flock.wirespec.generated') : packageName;
|
|
1136
|
+
emitShared = emitShared === VOID ? Companion_instance_0.ko() : emitShared;
|
|
1137
|
+
this.c1w_1 = packageName;
|
|
1138
|
+
this.d1w_1 = emitShared;
|
|
1139
|
+
this.e1w_1 = JavaGenerator_instance;
|
|
1140
|
+
this.f1w_1 = FileExtension_Java_getInstance();
|
|
1141
|
+
this.g1w_1 = listOf(import_0('community.flock.wirespec.java', 'Wirespec'));
|
|
1142
1142
|
var tmp = this;
|
|
1143
|
-
var tmp_0 = Companion_getInstance_1().
|
|
1143
|
+
var tmp_0 = Companion_getInstance_1().b1w_1;
|
|
1144
1144
|
var tmp_1 = JavaIrEmitter$sanitizationConfig$lambda;
|
|
1145
1145
|
var tmp_2 = JavaIrEmitter$sanitizationConfig$lambda_0;
|
|
1146
1146
|
var tmp_3 = JavaIrEmitter$sanitizationConfig$lambda_1;
|
|
1147
1147
|
var tmp_4 = JavaIrEmitter$sanitizationConfig$lambda_2(this);
|
|
1148
|
-
tmp.
|
|
1148
|
+
tmp.h1w_1 = new SanitizationConfig(tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, JavaIrEmitter$sanitizationConfig$lambda_3);
|
|
1149
1149
|
}
|
|
1150
|
-
protoOf(JavaIrEmitter).
|
|
1151
|
-
return this.
|
|
1150
|
+
protoOf(JavaIrEmitter).i1v = function () {
|
|
1151
|
+
return this.c1w_1;
|
|
1152
1152
|
};
|
|
1153
|
-
protoOf(JavaIrEmitter).
|
|
1154
|
-
return this.
|
|
1153
|
+
protoOf(JavaIrEmitter).p1u = function () {
|
|
1154
|
+
return this.e1w_1;
|
|
1155
1155
|
};
|
|
1156
|
-
protoOf(JavaIrEmitter).
|
|
1157
|
-
return this.
|
|
1156
|
+
protoOf(JavaIrEmitter).iq = function () {
|
|
1157
|
+
return this.f1w_1;
|
|
1158
1158
|
};
|
|
1159
|
-
protoOf(JavaIrEmitter).
|
|
1160
|
-
var packageName = Companion_instance.
|
|
1159
|
+
protoOf(JavaIrEmitter).s1u = function () {
|
|
1160
|
+
var packageName = Companion_instance.qr('community.flock.wirespec.java');
|
|
1161
1161
|
var imports = listOf_0([import_0('java.lang.reflect', 'Type'), import_0('java.lang.reflect', 'ParameterizedType'), import_0('java.util', 'List'), import_0('java.util', 'Map')]);
|
|
1162
1162
|
// Inline function 'kotlin.collections.map' call
|
|
1163
1163
|
var this_0 = convertClientServer(packageName);
|
|
@@ -1176,66 +1176,66 @@ protoOf(JavaIrEmitter).n1u = function () {
|
|
|
1176
1176
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1177
1177
|
var tmp = scope;
|
|
1178
1178
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1179
|
-
var this_2 = scope.
|
|
1179
|
+
var this_2 = scope.c1u_1;
|
|
1180
1180
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1181
1181
|
// Inline function 'kotlin.apply' call
|
|
1182
1182
|
var this_3 = new TransformerBuilder();
|
|
1183
|
-
this_3.
|
|
1184
|
-
var tmp$ret$5 = this_3.
|
|
1185
|
-
tmp.
|
|
1183
|
+
this_3.h1h(JavaIrEmitter$emitShared$lambda_0(imports));
|
|
1184
|
+
var tmp$ret$5 = this_3.i1h();
|
|
1185
|
+
tmp.c1u_1 = transform(this_2, tmp$ret$5);
|
|
1186
1186
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1187
1187
|
var tmp_0 = scope;
|
|
1188
1188
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1189
1189
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1190
|
-
var this_4 = scope.
|
|
1190
|
+
var this_4 = scope.c1u_1;
|
|
1191
1191
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1192
1192
|
// Inline function 'kotlin.apply' call
|
|
1193
1193
|
var this_5 = new TransformerBuilder();
|
|
1194
|
-
this_5.
|
|
1195
|
-
var tmp$ret$10 = this_5.
|
|
1196
|
-
tmp_0.
|
|
1197
|
-
var tmp_1 = scope.
|
|
1194
|
+
this_5.h1h(JavaIrEmitter$emitShared$lambda_1(clientServer));
|
|
1195
|
+
var tmp$ret$10 = this_5.i1h();
|
|
1196
|
+
tmp_0.c1u_1 = transform(this_4, tmp$ret$10);
|
|
1197
|
+
var tmp_1 = scope.c1u_1;
|
|
1198
1198
|
var wirespecShared = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1199
1199
|
var tmp_2;
|
|
1200
|
-
if (this.
|
|
1200
|
+
if (this.d1w_1.lo_1) {
|
|
1201
1201
|
tmp_2 = wirespecShared;
|
|
1202
1202
|
} else {
|
|
1203
1203
|
tmp_2 = null;
|
|
1204
1204
|
}
|
|
1205
1205
|
return tmp_2;
|
|
1206
1206
|
};
|
|
1207
|
-
protoOf(JavaIrEmitter).
|
|
1207
|
+
protoOf(JavaIrEmitter).zq = function (definition, module_0, logger) {
|
|
1208
1208
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1209
|
-
var tmp = file.
|
|
1209
|
+
var tmp = file.b1n(Companion_getInstance().k1h(sanitizeSymbol_0(this, file.x1m_1.m1h())));
|
|
1210
1210
|
// Inline function 'kotlin.takeIf' call
|
|
1211
|
-
var this_0 = this.
|
|
1211
|
+
var this_0 = this.g1w_1;
|
|
1212
1212
|
var tmp_0;
|
|
1213
|
-
if (Companion_instance_1.
|
|
1213
|
+
if (Companion_instance_1.vq(module_0)) {
|
|
1214
1214
|
tmp_0 = this_0;
|
|
1215
1215
|
} else {
|
|
1216
1216
|
tmp_0 = null;
|
|
1217
1217
|
}
|
|
1218
1218
|
var tmp$ret$1 = tmp_0;
|
|
1219
|
-
return placeInPackage(prependImports(tmp, tmp$ret$1), this.
|
|
1219
|
+
return placeInPackage(prependImports(tmp, tmp$ret$1), this.i1v(), definition);
|
|
1220
1220
|
};
|
|
1221
|
-
protoOf(JavaIrEmitter).
|
|
1222
|
-
return sanitizeNames(convertWithValidation(type, module_0), this.
|
|
1221
|
+
protoOf(JavaIrEmitter).yp = function (type, module_0) {
|
|
1222
|
+
return sanitizeNames(convertWithValidation(type, module_0), this.h1w_1);
|
|
1223
1223
|
};
|
|
1224
|
-
protoOf(JavaIrEmitter).
|
|
1224
|
+
protoOf(JavaIrEmitter).nr = function (enum_0, module_0) {
|
|
1225
1225
|
var tmp = convert_0(enum_0);
|
|
1226
1226
|
var tmp_0 = JavaIrEmitter$emit$lambda(this);
|
|
1227
|
-
return sanitizeNames(injectEnumLabelField(tmp, tmp_0, JavaIrEmitter$emit$lambda_0), this.
|
|
1227
|
+
return sanitizeNames(injectEnumLabelField(tmp, tmp_0, JavaIrEmitter$emit$lambda_0), this.h1w_1);
|
|
1228
1228
|
};
|
|
1229
|
-
protoOf(JavaIrEmitter).
|
|
1230
|
-
return sanitizeNames(convert_1(union), this.
|
|
1229
|
+
protoOf(JavaIrEmitter).dr = function (union) {
|
|
1230
|
+
return sanitizeNames(convert_1(union), this.h1w_1);
|
|
1231
1231
|
};
|
|
1232
|
-
protoOf(JavaIrEmitter).
|
|
1233
|
-
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.
|
|
1232
|
+
protoOf(JavaIrEmitter).ir = function (refined) {
|
|
1233
|
+
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.h1w_1);
|
|
1234
1234
|
};
|
|
1235
|
-
protoOf(JavaIrEmitter).
|
|
1236
|
-
var tmp = sanitizeNames(transformTypeDescriptors(injectHandleFunction(convert_3(endpoint), endpoint)), this.
|
|
1235
|
+
protoOf(JavaIrEmitter).or = function (endpoint) {
|
|
1236
|
+
var tmp = sanitizeNames(transformTypeDescriptors(injectApiField(injectHandleFunction(convert_3(endpoint), endpoint))), this.h1w_1);
|
|
1237
1237
|
// Inline function 'kotlin.takeIf' call
|
|
1238
|
-
var this_0 = buildModelImports(endpoint, this.
|
|
1238
|
+
var this_0 = buildModelImports(endpoint, this.i1v());
|
|
1239
1239
|
var tmp_0;
|
|
1240
1240
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1241
1241
|
if (!this_0.r()) {
|
|
@@ -1246,25 +1246,25 @@ protoOf(JavaIrEmitter).jr = function (endpoint) {
|
|
|
1246
1246
|
var tmp$ret$2 = tmp_0;
|
|
1247
1247
|
return prependImports(tmp, tmp$ret$2);
|
|
1248
1248
|
};
|
|
1249
|
-
protoOf(JavaIrEmitter).
|
|
1249
|
+
protoOf(JavaIrEmitter).cr = function (channel) {
|
|
1250
1250
|
var tmp;
|
|
1251
|
-
if (channel.
|
|
1252
|
-
tmp = this.
|
|
1251
|
+
if (channel.qo_1.l1() === channel.ro_1.l1()) {
|
|
1252
|
+
tmp = this.i1v().rr_1 + '.model.';
|
|
1253
1253
|
} else {
|
|
1254
1254
|
tmp = '';
|
|
1255
1255
|
}
|
|
1256
1256
|
var fullyQualifiedPrefix = tmp;
|
|
1257
|
-
return applyFunctionalInterface(sanitizeNames(convert_4(channel), this.
|
|
1257
|
+
return applyFunctionalInterface(sanitizeNames(convert_4(channel), this.h1w_1), fullyQualifiedPrefix);
|
|
1258
1258
|
};
|
|
1259
|
-
protoOf(JavaIrEmitter).
|
|
1260
|
-
var imports = buildModelImports(endpoint, this.
|
|
1261
|
-
var endpointImport = import_0(this.
|
|
1262
|
-
var endpointName = endpoint.
|
|
1263
|
-
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.
|
|
1264
|
-
var subPackageName = plus_0(this.
|
|
1265
|
-
return new File(Companion_getInstance().
|
|
1259
|
+
protoOf(JavaIrEmitter).u1u = function (endpoint) {
|
|
1260
|
+
var imports = buildModelImports(endpoint, this.i1v());
|
|
1261
|
+
var endpointImport = import_0(this.i1v().rr_1 + '.endpoint', endpoint.ip_1.l1());
|
|
1262
|
+
var endpointName = endpoint.ip_1.l1();
|
|
1263
|
+
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.h1w_1)), endpointName);
|
|
1264
|
+
var subPackageName = plus_0(this.i1v(), 'client');
|
|
1265
|
+
return new File(Companion_getInstance().k1h(subPackageName.tr() + sanitizeSymbol_0(this, file.x1m_1.m1h())), plus_1(plus_1(plus_1(plus_1(listOf(new Package(subPackageName.rr_1)), this.g1w_1), imports), listOf(endpointImport)), file.y1m_1));
|
|
1266
1266
|
};
|
|
1267
|
-
protoOf(JavaIrEmitter).
|
|
1267
|
+
protoOf(JavaIrEmitter).t1u = function (endpoints, logger) {
|
|
1268
1268
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1269
1269
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1270
1270
|
var destination = ArrayList_init_$Create$();
|
|
@@ -1280,7 +1280,7 @@ protoOf(JavaIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1280
1280
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1281
1281
|
while (_iterator__ex2g4s_0.u()) {
|
|
1282
1282
|
var e = _iterator__ex2g4s_0.v();
|
|
1283
|
-
var key = e.
|
|
1283
|
+
var key = e.pu_1;
|
|
1284
1284
|
if (set.x(key)) {
|
|
1285
1285
|
list_0.x(e);
|
|
1286
1286
|
}
|
|
@@ -1307,7 +1307,7 @@ protoOf(JavaIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1307
1307
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1308
1308
|
while (_iterator__ex2g4s_2.u()) {
|
|
1309
1309
|
var element_1 = _iterator__ex2g4s_2.v();
|
|
1310
|
-
if (element_1.
|
|
1310
|
+
if (element_1.ip_1.l1() === element_0.pu_1) {
|
|
1311
1311
|
tmp$ret$5 = false;
|
|
1312
1312
|
break $l$block_0;
|
|
1313
1313
|
}
|
|
@@ -1324,7 +1324,7 @@ protoOf(JavaIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1324
1324
|
var _iterator__ex2g4s_3 = destination_0.t();
|
|
1325
1325
|
while (_iterator__ex2g4s_3.u()) {
|
|
1326
1326
|
var item = _iterator__ex2g4s_3.v();
|
|
1327
|
-
var tmp$ret$10 = import_0(this.
|
|
1327
|
+
var tmp$ret$10 = import_0(this.i1v().rr_1 + '.model', item.pu_1);
|
|
1328
1328
|
destination_1.x(tmp$ret$10);
|
|
1329
1329
|
}
|
|
1330
1330
|
var imports = destination_1;
|
|
@@ -1334,7 +1334,7 @@ protoOf(JavaIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1334
1334
|
var _iterator__ex2g4s_4 = endpoints.t();
|
|
1335
1335
|
while (_iterator__ex2g4s_4.u()) {
|
|
1336
1336
|
var item_0 = _iterator__ex2g4s_4.v();
|
|
1337
|
-
var tmp$ret$13 = import_0(this.
|
|
1337
|
+
var tmp$ret$13 = import_0(this.i1v().rr_1 + '.endpoint', item_0.ip_1.l1());
|
|
1338
1338
|
destination_2.x(tmp$ret$13);
|
|
1339
1339
|
}
|
|
1340
1340
|
var endpointImports = destination_2;
|
|
@@ -1344,19 +1344,19 @@ protoOf(JavaIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1344
1344
|
var _iterator__ex2g4s_5 = endpoints.t();
|
|
1345
1345
|
while (_iterator__ex2g4s_5.u()) {
|
|
1346
1346
|
var item_1 = _iterator__ex2g4s_5.v();
|
|
1347
|
-
var tmp$ret$16 = import_0(this.
|
|
1347
|
+
var tmp$ret$16 = import_0(this.i1v().rr_1 + '.client', item_1.ip_1.l1() + 'Client');
|
|
1348
1348
|
destination_3.x(tmp$ret$16);
|
|
1349
1349
|
}
|
|
1350
1350
|
var clientImports = destination_3;
|
|
1351
1351
|
var allImports = plus_1(plus_1(imports, endpointImports), clientImports);
|
|
1352
|
-
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.
|
|
1353
|
-
return new File(Companion_getInstance().
|
|
1352
|
+
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.h1w_1);
|
|
1353
|
+
return new File(Companion_getInstance().k1h(this.i1v().tr() + sanitizeSymbol_0(this, file.x1m_1.m1h())), plus_1(plus_1(plus_1(listOf(new Package(this.i1v().rr_1)), this.g1w_1), allImports), file.y1m_1));
|
|
1354
1354
|
};
|
|
1355
1355
|
function transformTypeDescriptors(_this__u8e3s4) {
|
|
1356
1356
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1357
1357
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1358
|
-
scope.
|
|
1359
|
-
var tmp = scope.
|
|
1358
|
+
scope.l1u(transformTypeDescriptors$lambda);
|
|
1359
|
+
var tmp = scope.c1u_1;
|
|
1360
1360
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1361
1361
|
}
|
|
1362
1362
|
function applyRefinedStructShape(_this__u8e3s4, refined) {
|
|
@@ -1365,14 +1365,31 @@ function applyRefinedStructShape(_this__u8e3s4, refined) {
|
|
|
1365
1365
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1366
1366
|
var tmp = scope;
|
|
1367
1367
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1368
|
-
var this_0 = scope.
|
|
1368
|
+
var this_0 = scope.c1u_1;
|
|
1369
|
+
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1370
|
+
// Inline function 'kotlin.apply' call
|
|
1371
|
+
var this_1 = new TransformerBuilder();
|
|
1372
|
+
this_1.h1h(applyRefinedStructShape$lambda(refined));
|
|
1373
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1374
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1375
|
+
var tmp_0 = scope.c1u_1;
|
|
1376
|
+
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1377
|
+
}
|
|
1378
|
+
function injectApiField(_this__u8e3s4) {
|
|
1379
|
+
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1380
|
+
var scope = new TransformScope(_this__u8e3s4);
|
|
1381
|
+
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1382
|
+
var tmp = scope;
|
|
1383
|
+
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1384
|
+
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1385
|
+
var this_0 = scope.c1u_1;
|
|
1369
1386
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1370
1387
|
// Inline function 'kotlin.apply' call
|
|
1371
1388
|
var this_1 = new TransformerBuilder();
|
|
1372
|
-
this_1.
|
|
1373
|
-
var tmp$ret$2 = this_1.
|
|
1374
|
-
tmp.
|
|
1375
|
-
var tmp_0 = scope.
|
|
1389
|
+
this_1.h1h(injectApiField$lambda);
|
|
1390
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1391
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1392
|
+
var tmp_0 = scope.c1u_1;
|
|
1376
1393
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1377
1394
|
}
|
|
1378
1395
|
function injectHandleFunction(_this__u8e3s4, endpoint) {
|
|
@@ -1382,14 +1399,14 @@ function injectHandleFunction(_this__u8e3s4, endpoint) {
|
|
|
1382
1399
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1383
1400
|
var tmp = scope;
|
|
1384
1401
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1385
|
-
var this_0 = scope.
|
|
1402
|
+
var this_0 = scope.c1u_1;
|
|
1386
1403
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1387
1404
|
// Inline function 'kotlin.apply' call
|
|
1388
1405
|
var this_1 = new TransformerBuilder();
|
|
1389
|
-
this_1.
|
|
1390
|
-
var tmp$ret$2 = this_1.
|
|
1391
|
-
tmp.
|
|
1392
|
-
var tmp_0 = scope.
|
|
1406
|
+
this_1.h1h(injectHandleFunction$lambda(handlersStruct));
|
|
1407
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1408
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1409
|
+
var tmp_0 = scope.c1u_1;
|
|
1393
1410
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1394
1411
|
}
|
|
1395
1412
|
function buildModelImports(_this__u8e3s4, packageName) {
|
|
@@ -1400,7 +1417,7 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1400
1417
|
var _iterator__ex2g4s = tmp0.t();
|
|
1401
1418
|
while (_iterator__ex2g4s.u()) {
|
|
1402
1419
|
var element = _iterator__ex2g4s.v();
|
|
1403
|
-
if (!(_this__u8e3s4.
|
|
1420
|
+
if (!(_this__u8e3s4.ar().l1() === element.pu_1)) {
|
|
1404
1421
|
destination.x(element);
|
|
1405
1422
|
}
|
|
1406
1423
|
}
|
|
@@ -1410,7 +1427,7 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1410
1427
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1411
1428
|
while (_iterator__ex2g4s_0.u()) {
|
|
1412
1429
|
var item = _iterator__ex2g4s_0.v();
|
|
1413
|
-
var tmp$ret$3 = import_0(packageName.
|
|
1430
|
+
var tmp$ret$3 = import_0(packageName.rr_1 + '.model', Companion_getInstance().k1h(item.pu_1).m1h());
|
|
1414
1431
|
destination_0.x(tmp$ret$3);
|
|
1415
1432
|
}
|
|
1416
1433
|
return destination_0;
|
|
@@ -1421,24 +1438,24 @@ function applyFunctionalInterface(_this__u8e3s4, fullyQualifiedPrefix) {
|
|
|
1421
1438
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1422
1439
|
var tmp = scope;
|
|
1423
1440
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1424
|
-
var this_0 = scope.
|
|
1441
|
+
var this_0 = scope.c1u_1;
|
|
1425
1442
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1426
1443
|
// Inline function 'kotlin.apply' call
|
|
1427
1444
|
var this_1 = new TransformerBuilder();
|
|
1428
|
-
this_1.
|
|
1429
|
-
var tmp$ret$2 = this_1.
|
|
1430
|
-
tmp.
|
|
1445
|
+
this_1.h1h(applyFunctionalInterface$lambda(fullyQualifiedPrefix));
|
|
1446
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1447
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1431
1448
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1432
1449
|
var tmp_0 = scope;
|
|
1433
1450
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1434
|
-
var this_2 = scope.
|
|
1451
|
+
var this_2 = scope.c1u_1;
|
|
1435
1452
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1436
1453
|
// Inline function 'kotlin.apply' call
|
|
1437
1454
|
var this_3 = new TransformerBuilder();
|
|
1438
|
-
this_3.
|
|
1439
|
-
var tmp$ret$7 = this_3.
|
|
1440
|
-
tmp_0.
|
|
1441
|
-
var tmp_1 = scope.
|
|
1455
|
+
this_3.h1h(applyFunctionalInterface$lambda_0);
|
|
1456
|
+
var tmp$ret$7 = this_3.i1h();
|
|
1457
|
+
tmp_0.c1u_1 = transform(this_2, tmp$ret$7);
|
|
1458
|
+
var tmp_1 = scope.c1u_1;
|
|
1442
1459
|
return isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1443
1460
|
}
|
|
1444
1461
|
function wrapAsyncReturnInThenApply(_this__u8e3s4, endpointName) {
|
|
@@ -1447,26 +1464,26 @@ function wrapAsyncReturnInThenApply(_this__u8e3s4, endpointName) {
|
|
|
1447
1464
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1448
1465
|
var tmp = scope;
|
|
1449
1466
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1450
|
-
var this_0 = scope.
|
|
1467
|
+
var this_0 = scope.c1u_1;
|
|
1451
1468
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1452
1469
|
// Inline function 'kotlin.apply' call
|
|
1453
1470
|
var this_1 = new TransformerBuilder();
|
|
1454
|
-
this_1.
|
|
1455
|
-
var tmp$ret$2 = this_1.
|
|
1456
|
-
tmp.
|
|
1457
|
-
var tmp_0 = scope.
|
|
1471
|
+
this_1.h1h(wrapAsyncReturnInThenApply$lambda(endpointName));
|
|
1472
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1473
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1474
|
+
var tmp_0 = scope.c1u_1;
|
|
1458
1475
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1459
1476
|
}
|
|
1460
1477
|
function findRoot(_this__u8e3s4) {
|
|
1461
1478
|
var tmp;
|
|
1462
1479
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
1463
|
-
tmp = findRoot(_this__u8e3s4.
|
|
1480
|
+
tmp = findRoot(_this__u8e3s4.t1h_1);
|
|
1464
1481
|
} else {
|
|
1465
1482
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
1466
|
-
tmp = findRoot(_this__u8e3s4.
|
|
1483
|
+
tmp = findRoot(_this__u8e3s4.u1h_1);
|
|
1467
1484
|
} else {
|
|
1468
1485
|
if (_this__u8e3s4 instanceof Dict_0) {
|
|
1469
|
-
tmp = findRoot(_this__u8e3s4.
|
|
1486
|
+
tmp = findRoot(_this__u8e3s4.p1m_1);
|
|
1470
1487
|
} else {
|
|
1471
1488
|
tmp = _this__u8e3s4;
|
|
1472
1489
|
}
|
|
@@ -1495,7 +1512,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1495
1512
|
var tmp;
|
|
1496
1513
|
if (_this__u8e3s4 instanceof Integer_0) {
|
|
1497
1514
|
var tmp_0;
|
|
1498
|
-
switch (_this__u8e3s4.
|
|
1515
|
+
switch (_this__u8e3s4.l1m_1.b3_1) {
|
|
1499
1516
|
case 0:
|
|
1500
1517
|
tmp_0 = 'Integer';
|
|
1501
1518
|
break;
|
|
@@ -1510,7 +1527,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1510
1527
|
} else {
|
|
1511
1528
|
if (_this__u8e3s4 instanceof Number_1) {
|
|
1512
1529
|
var tmp_1;
|
|
1513
|
-
switch (_this__u8e3s4.
|
|
1530
|
+
switch (_this__u8e3s4.m1m_1.b3_1) {
|
|
1514
1531
|
case 0:
|
|
1515
1532
|
tmp_1 = 'Float';
|
|
1516
1533
|
break;
|
|
@@ -1539,7 +1556,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1539
1556
|
tmp = 'Void';
|
|
1540
1557
|
} else {
|
|
1541
1558
|
if (_this__u8e3s4 instanceof Custom_0) {
|
|
1542
|
-
tmp = _this__u8e3s4.
|
|
1559
|
+
tmp = _this__u8e3s4.v1h_1.m1h();
|
|
1543
1560
|
} else {
|
|
1544
1561
|
tmp = 'Object';
|
|
1545
1562
|
}
|
|
@@ -1553,7 +1570,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1553
1570
|
return tmp;
|
|
1554
1571
|
}
|
|
1555
1572
|
function buildHandlersStruct(_this__u8e3s4) {
|
|
1556
|
-
var pathTemplate = '/' + joinToString(_this__u8e3s4.
|
|
1573
|
+
var pathTemplate = '/' + joinToString(_this__u8e3s4.kp_1, '/', VOID, VOID, VOID, VOID, buildHandlersStruct$lambda);
|
|
1557
1574
|
return struct('Handlers', buildHandlersStruct$lambda_0(pathTemplate, _this__u8e3s4));
|
|
1558
1575
|
}
|
|
1559
1576
|
function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
@@ -1563,8 +1580,8 @@ function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
|
1563
1580
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1564
1581
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1565
1582
|
var tmp_0 = withFullyQualifiedPrefix$lambda;
|
|
1566
|
-
scope.
|
|
1567
|
-
var tmp_1 = scope.
|
|
1583
|
+
scope.f1u(tmp_0, withFullyQualifiedPrefix$lambda_0(prefix));
|
|
1584
|
+
var tmp_1 = scope.c1u_1;
|
|
1568
1585
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1569
1586
|
} else {
|
|
1570
1587
|
tmp = _this__u8e3s4;
|
|
@@ -1574,8 +1591,8 @@ function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
|
1574
1591
|
function transformTypeDescriptors$lambda(stmt, tr) {
|
|
1575
1592
|
var tmp;
|
|
1576
1593
|
if (stmt instanceof TypeDescriptor) {
|
|
1577
|
-
var rootType = findRoot(stmt.
|
|
1578
|
-
var containerStr = rawContainerClass(stmt.
|
|
1594
|
+
var rootType = findRoot(stmt.m1o_1);
|
|
1595
|
+
var containerStr = rawContainerClass(stmt.m1o_1);
|
|
1579
1596
|
var rootStr = toJavaName(rootType) + '.class';
|
|
1580
1597
|
var tmp_0;
|
|
1581
1598
|
if (containerStr == null) {
|
|
@@ -1594,8 +1611,8 @@ function transformTypeDescriptors$lambda(stmt, tr) {
|
|
|
1594
1611
|
}
|
|
1595
1612
|
function applyRefinedStructShape$lambda$lambda($refined) {
|
|
1596
1613
|
return function ($this$function) {
|
|
1597
|
-
$this$function.
|
|
1598
|
-
$this$function.
|
|
1614
|
+
$this$function.p1i(convert_5($refined.hr_1));
|
|
1615
|
+
$this$function.o1k(new VariableReference(Companion_getInstance().k1h('value')));
|
|
1599
1616
|
return Unit_instance;
|
|
1600
1617
|
};
|
|
1601
1618
|
}
|
|
@@ -1605,18 +1622,18 @@ function applyRefinedStructShape$lambda($refined) {
|
|
|
1605
1622
|
if (element instanceof Struct) {
|
|
1606
1623
|
var tmp_0 = listOf(Custom_init_$Create$('Wirespec.Refined'));
|
|
1607
1624
|
// Inline function 'kotlin.collections.map' call
|
|
1608
|
-
var this_0 = element.
|
|
1625
|
+
var this_0 = element.m1n_1;
|
|
1609
1626
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1610
1627
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1611
1628
|
var _iterator__ex2g4s = this_0.t();
|
|
1612
1629
|
while (_iterator__ex2g4s.u()) {
|
|
1613
1630
|
var item = _iterator__ex2g4s.v();
|
|
1614
1631
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
1615
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1632
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.g1k(VOID, VOID, VOID, VOID, VOID, VOID, VOID, true);
|
|
1616
1633
|
var tmp$ret$0 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
1617
1634
|
destination.x(tmp$ret$0);
|
|
1618
1635
|
}
|
|
1619
|
-
var tmp_1 = element.
|
|
1636
|
+
var tmp_1 = element.o1n(VOID, VOID, VOID, tmp_0, destination);
|
|
1620
1637
|
tmp = plus_3(tmp_1, function_0('value', VOID, true, applyRefinedStructShape$lambda$lambda($refined)));
|
|
1621
1638
|
} else {
|
|
1622
1639
|
tmp = element;
|
|
@@ -1625,6 +1642,24 @@ function applyRefinedStructShape$lambda($refined) {
|
|
|
1625
1642
|
return transformChildren_0(transformed, transformer);
|
|
1626
1643
|
};
|
|
1627
1644
|
}
|
|
1645
|
+
function injectApiField$lambda(element, transformer) {
|
|
1646
|
+
var tmp;
|
|
1647
|
+
if (element instanceof Namespace) {
|
|
1648
|
+
var injected = listOf(new RawElement('Handler.Handlers api = new Handler.Handlers();\n'));
|
|
1649
|
+
var tmp_0;
|
|
1650
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1651
|
+
if (!injected.r()) {
|
|
1652
|
+
tmp_0 = withElements(element, plus_1(element.z1m(), injected));
|
|
1653
|
+
} else {
|
|
1654
|
+
tmp_0 = element;
|
|
1655
|
+
}
|
|
1656
|
+
tmp = tmp_0;
|
|
1657
|
+
} else {
|
|
1658
|
+
tmp = element;
|
|
1659
|
+
}
|
|
1660
|
+
var transformed = tmp;
|
|
1661
|
+
return transformChildren_0(transformed, transformer);
|
|
1662
|
+
}
|
|
1628
1663
|
function injectHandleFunction$lambda$lambda($handlersStruct) {
|
|
1629
1664
|
return function (element, transformer) {
|
|
1630
1665
|
var tmp;
|
|
@@ -1633,7 +1668,7 @@ function injectHandleFunction$lambda$lambda($handlersStruct) {
|
|
|
1633
1668
|
var tmp_0;
|
|
1634
1669
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1635
1670
|
if (!injected.r()) {
|
|
1636
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1671
|
+
tmp_0 = withElements(element, plus_1(element.z1m(), injected));
|
|
1637
1672
|
} else {
|
|
1638
1673
|
tmp_0 = element;
|
|
1639
1674
|
}
|
|
@@ -1650,21 +1685,21 @@ function injectHandleFunction$lambda($handlersStruct) {
|
|
|
1650
1685
|
var tmp;
|
|
1651
1686
|
if (element instanceof Interface) {
|
|
1652
1687
|
var tmp_0;
|
|
1653
|
-
if (element.
|
|
1688
|
+
if (element.q1n_1.equals(Companion_getInstance().k1h('Handler'))) {
|
|
1654
1689
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1655
1690
|
var scope = new TransformScope(element);
|
|
1656
1691
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1657
1692
|
var tmp_1 = scope;
|
|
1658
1693
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1659
1694
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1660
|
-
var this_0 = scope.
|
|
1695
|
+
var this_0 = scope.c1u_1;
|
|
1661
1696
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1662
1697
|
// Inline function 'kotlin.apply' call
|
|
1663
1698
|
var this_1 = new TransformerBuilder();
|
|
1664
|
-
this_1.
|
|
1665
|
-
var tmp$ret$2 = this_1.
|
|
1666
|
-
tmp_1.
|
|
1667
|
-
var tmp_2 = scope.
|
|
1699
|
+
this_1.h1h(injectHandleFunction$lambda$lambda($handlersStruct));
|
|
1700
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1701
|
+
tmp_1.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1702
|
+
var tmp_2 = scope.c1u_1;
|
|
1668
1703
|
tmp_0 = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1669
1704
|
} else {
|
|
1670
1705
|
tmp_0 = element;
|
|
@@ -1694,7 +1729,7 @@ function applyFunctionalInterface$lambda_0(element, transformer) {
|
|
|
1694
1729
|
if (element instanceof File) {
|
|
1695
1730
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1696
1731
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1697
|
-
var tmp0 = element.
|
|
1732
|
+
var tmp0 = element.z1m();
|
|
1698
1733
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1699
1734
|
var destination = ArrayList_init_$Create$();
|
|
1700
1735
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1706,7 +1741,7 @@ function applyFunctionalInterface$lambda_0(element, transformer) {
|
|
|
1706
1741
|
}
|
|
1707
1742
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1708
1743
|
var interfaceElement = ensureNotNull(tmp$ret$2);
|
|
1709
|
-
tmp = element.
|
|
1744
|
+
tmp = element.b1n(VOID, listOf_0([new RawElement('@FunctionalInterface\n'), interfaceElement]));
|
|
1710
1745
|
} else {
|
|
1711
1746
|
tmp = element;
|
|
1712
1747
|
}
|
|
@@ -1719,11 +1754,11 @@ function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
|
1719
1754
|
if (element instanceof Function) {
|
|
1720
1755
|
var tmp$ret$0;
|
|
1721
1756
|
$l$block_1: {
|
|
1722
|
-
if (!element.
|
|
1757
|
+
if (!element.d1k_1 || element.c1k_1.a1() < 2) {
|
|
1723
1758
|
tmp$ret$0 = element;
|
|
1724
1759
|
break $l$block_1;
|
|
1725
1760
|
}
|
|
1726
|
-
var tmp_0 = element.
|
|
1761
|
+
var tmp_0 = element.c1k_1.b1(element.c1k_1.a1() - 2 | 0);
|
|
1727
1762
|
var tmp0_elvis_lhs = tmp_0 instanceof Assignment ? tmp_0 : null;
|
|
1728
1763
|
var tmp_1;
|
|
1729
1764
|
if (tmp0_elvis_lhs == null) {
|
|
@@ -1733,16 +1768,16 @@ function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
|
1733
1768
|
tmp_1 = tmp0_elvis_lhs;
|
|
1734
1769
|
}
|
|
1735
1770
|
var transportAssign = tmp_1;
|
|
1736
|
-
var tmp_2 = last(element.
|
|
1771
|
+
var tmp_2 = last(element.c1k_1);
|
|
1737
1772
|
if (!(tmp_2 instanceof ReturnStatement)) {
|
|
1738
1773
|
tmp$ret$0 = element;
|
|
1739
1774
|
break $l$block_1;
|
|
1740
1775
|
}
|
|
1741
|
-
var tmp_3 = dropLast(element.
|
|
1742
|
-
var tmp1_name = Companion_getInstance().
|
|
1743
|
-
var tmp2_receiver = transportAssign.
|
|
1744
|
-
var tmp3_arguments = mapOf(to(Companion_getInstance().
|
|
1745
|
-
tmp$ret$0 = element.
|
|
1776
|
+
var tmp_3 = dropLast(element.c1k_1, 2);
|
|
1777
|
+
var tmp1_name = Companion_getInstance().k1h('thenApply');
|
|
1778
|
+
var tmp2_receiver = transportAssign.p1o_1;
|
|
1779
|
+
var tmp3_arguments = mapOf(to(Companion_getInstance().k1h('mapper'), new RawExpression('rawResponse -> ' + $endpointName + '.fromRawResponse(serialization(), rawResponse)')));
|
|
1780
|
+
tmp$ret$0 = element.g1k(VOID, VOID, VOID, VOID, plus_2(tmp_3, new ReturnStatement(new FunctionCall(tmp2_receiver, VOID, tmp1_name, tmp3_arguments))));
|
|
1746
1781
|
}
|
|
1747
1782
|
tmp = tmp$ret$0;
|
|
1748
1783
|
} else {
|
|
@@ -1755,10 +1790,10 @@ function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
|
1755
1790
|
function buildHandlersStruct$lambda(it) {
|
|
1756
1791
|
var tmp;
|
|
1757
1792
|
if (it instanceof Literal) {
|
|
1758
|
-
tmp = it.
|
|
1793
|
+
tmp = it.lq_1;
|
|
1759
1794
|
} else {
|
|
1760
1795
|
if (it instanceof Param) {
|
|
1761
|
-
tmp = '{' + it.
|
|
1796
|
+
tmp = '{' + it.pp_1.l1() + '}';
|
|
1762
1797
|
} else {
|
|
1763
1798
|
noWhenBranchMatchedException();
|
|
1764
1799
|
}
|
|
@@ -1767,50 +1802,50 @@ function buildHandlersStruct$lambda(it) {
|
|
|
1767
1802
|
}
|
|
1768
1803
|
function buildHandlersStruct$lambda$lambda($pathTemplate) {
|
|
1769
1804
|
return function ($this$function) {
|
|
1770
|
-
$this$function.
|
|
1771
|
-
$this$function.
|
|
1805
|
+
$this$function.p1i(String_instance);
|
|
1806
|
+
$this$function.o1k($this$function.f1t($pathTemplate));
|
|
1772
1807
|
return Unit_instance;
|
|
1773
1808
|
};
|
|
1774
1809
|
}
|
|
1775
1810
|
function buildHandlersStruct$lambda$lambda_0($this_buildHandlersStruct) {
|
|
1776
1811
|
return function ($this$function) {
|
|
1777
|
-
$this$function.
|
|
1778
|
-
$this$function.
|
|
1812
|
+
$this$function.p1i(String_instance);
|
|
1813
|
+
$this$function.o1k($this$function.f1t($this_buildHandlersStruct.jp_1.a3_1));
|
|
1779
1814
|
return Unit_instance;
|
|
1780
1815
|
};
|
|
1781
1816
|
}
|
|
1782
1817
|
function buildHandlersStruct$lambda$lambda_1($this$function) {
|
|
1783
|
-
$this$function.
|
|
1784
|
-
$this$function.
|
|
1785
|
-
$this$function.
|
|
1818
|
+
$this$function.p1i($this$function.y1h('Wirespec.ServerEdge', [$this$function.y1h('Request', []), $this$function.y1h('Response', [Wildcard_instance])]));
|
|
1819
|
+
$this$function.q1i('serialization', $this$function.y1h('Wirespec.Serialization', []));
|
|
1820
|
+
$this$function.o1k(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}'));
|
|
1786
1821
|
return Unit_instance;
|
|
1787
1822
|
}
|
|
1788
1823
|
function buildHandlersStruct$lambda$lambda_2($this$function) {
|
|
1789
|
-
$this$function.
|
|
1790
|
-
$this$function.
|
|
1791
|
-
$this$function.
|
|
1824
|
+
$this$function.p1i($this$function.y1h('Wirespec.ClientEdge', [$this$function.y1h('Request', []), $this$function.y1h('Response', [Wildcard_instance])]));
|
|
1825
|
+
$this$function.q1i('serialization', $this$function.y1h('Wirespec.Serialization', []));
|
|
1826
|
+
$this$function.o1k(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}'));
|
|
1792
1827
|
return Unit_instance;
|
|
1793
1828
|
}
|
|
1794
1829
|
function buildHandlersStruct$lambda_0($pathTemplate, $this_buildHandlersStruct) {
|
|
1795
1830
|
return function ($this$struct) {
|
|
1796
|
-
$this$struct.
|
|
1797
|
-
$this$struct.
|
|
1798
|
-
$this$struct.
|
|
1799
|
-
$this$struct.
|
|
1800
|
-
$this$struct.
|
|
1801
|
-
$this$struct.
|
|
1831
|
+
$this$struct.p1k($this$struct.y1h('Wirespec.Server', [$this$struct.y1h('Request', []), $this$struct.y1h('Response', [Wildcard_instance])]));
|
|
1832
|
+
$this$struct.p1k($this$struct.y1h('Wirespec.Client', [$this$struct.y1h('Request', []), $this$struct.y1h('Response', [Wildcard_instance])]));
|
|
1833
|
+
$this$struct.g1i('getPathTemplate', VOID, true, buildHandlersStruct$lambda$lambda($pathTemplate));
|
|
1834
|
+
$this$struct.g1i('getMethod', VOID, true, buildHandlersStruct$lambda$lambda_0($this_buildHandlersStruct));
|
|
1835
|
+
$this$struct.g1i('getServer', VOID, true, buildHandlersStruct$lambda$lambda_1);
|
|
1836
|
+
$this$struct.g1i('getClient', VOID, true, buildHandlersStruct$lambda$lambda_2);
|
|
1802
1837
|
return Unit_instance;
|
|
1803
1838
|
};
|
|
1804
1839
|
}
|
|
1805
1840
|
function withFullyQualifiedPrefix$lambda(it) {
|
|
1806
|
-
return it.
|
|
1841
|
+
return it.z1o_1.equals(Companion_getInstance().k1h('message'));
|
|
1807
1842
|
}
|
|
1808
1843
|
function withFullyQualifiedPrefix$lambda_0($prefix) {
|
|
1809
1844
|
return function (param) {
|
|
1810
|
-
var t = param.
|
|
1845
|
+
var t = param.a1p_1;
|
|
1811
1846
|
var tmp;
|
|
1812
1847
|
if (t instanceof Custom_0) {
|
|
1813
|
-
tmp = param.
|
|
1848
|
+
tmp = param.c1p(VOID, t.s1m(Companion_getInstance().k1h($prefix + t.v1h_1.m1h())));
|
|
1814
1849
|
} else {
|
|
1815
1850
|
tmp = param;
|
|
1816
1851
|
}
|
|
@@ -1821,8 +1856,8 @@ function JavaRefinedTypeDefinitionEmitter() {
|
|
|
1821
1856
|
}
|
|
1822
1857
|
function JavaShared() {
|
|
1823
1858
|
JavaShared_instance = this;
|
|
1824
|
-
this.
|
|
1825
|
-
this.
|
|
1859
|
+
this.s1v_1 = 'community.flock.wirespec.java';
|
|
1860
|
+
this.t1v_1 = trimMargin('\n |package ' + this.s1v_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.vr(2) + 'Req from(RawRequest request);\n |' + Spacer_instance.vr(2) + 'RawResponse to(Res response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface ClientEdge<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.vr(2) + 'RawRequest to(Req request);\n |' + Spacer_instance.vr(2) + 'Res from(RawResponse response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.vr(2) + 'String getPathTemplate();\n |' + Spacer_instance.vr(2) + 'String getMethod();\n |' + Spacer_instance.vr(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.vr(2) + 'String getPathTemplate();\n |' + Spacer_instance.vr(2) + 'String getMethod();\n |' + Spacer_instance.vr(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.vr(2) + 'if(rawType != null) {\n |' + Spacer_instance.vr(3) + 'return new ParameterizedType() {\n |' + Spacer_instance.vr(4) + 'public Type getRawType() { return rawType; }\n |' + Spacer_instance.vr(4) + 'public Type[] getActualTypeArguments() { return new Class<?>[]{actualTypeArguments}; }\n |' + Spacer_instance.vr(4) + 'public Type getOwnerType() { return null; }\n |' + Spacer_instance.vr(3) + '};\n |' + Spacer_instance.vr(2) + '}\n |' + Spacer_instance.vr(2) + 'else { return actualTypeArguments; }\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
1826
1861
|
}
|
|
1827
1862
|
protoOf(JavaShared).toString = function () {
|
|
1828
1863
|
return 'JavaShared';
|
|
@@ -1846,10 +1881,10 @@ function JavaShared_getInstance() {
|
|
|
1846
1881
|
function emitType($this, _this__u8e3s4) {
|
|
1847
1882
|
var tmp;
|
|
1848
1883
|
if (_this__u8e3s4 instanceof Dict) {
|
|
1849
|
-
tmp = 'java.util.Map<String, ' + $this.
|
|
1884
|
+
tmp = 'java.util.Map<String, ' + $this.bq(_this__u8e3s4.go_1) + '>';
|
|
1850
1885
|
} else {
|
|
1851
1886
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
1852
|
-
tmp = 'java.util.List<' + $this.
|
|
1887
|
+
tmp = 'java.util.List<' + $this.bq(_this__u8e3s4.do_1) + '>';
|
|
1853
1888
|
} else {
|
|
1854
1889
|
if (_this__u8e3s4 instanceof Unit) {
|
|
1855
1890
|
tmp = 'void';
|
|
@@ -1858,7 +1893,7 @@ function emitType($this, _this__u8e3s4) {
|
|
|
1858
1893
|
tmp = 'Object';
|
|
1859
1894
|
} else {
|
|
1860
1895
|
if (_this__u8e3s4 instanceof Custom) {
|
|
1861
|
-
tmp = _this__u8e3s4.
|
|
1896
|
+
tmp = _this__u8e3s4.pu_1;
|
|
1862
1897
|
} else {
|
|
1863
1898
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
1864
1899
|
tmp = emit_18($this, _this__u8e3s4);
|
|
@@ -1873,14 +1908,14 @@ function emitType($this, _this__u8e3s4) {
|
|
|
1873
1908
|
return tmp;
|
|
1874
1909
|
}
|
|
1875
1910
|
function emit_18($this, _this__u8e3s4) {
|
|
1876
|
-
var t = _this__u8e3s4.
|
|
1911
|
+
var t = _this__u8e3s4.tu_1;
|
|
1877
1912
|
var tmp;
|
|
1878
1913
|
if (t instanceof String_0) {
|
|
1879
1914
|
tmp = 'String';
|
|
1880
1915
|
} else {
|
|
1881
1916
|
if (t instanceof Integer) {
|
|
1882
1917
|
var tmp_0;
|
|
1883
|
-
switch (t.
|
|
1918
|
+
switch (t.xt_1.b3_1) {
|
|
1884
1919
|
case 0:
|
|
1885
1920
|
tmp_0 = 'Integer';
|
|
1886
1921
|
break;
|
|
@@ -1895,7 +1930,7 @@ function emit_18($this, _this__u8e3s4) {
|
|
|
1895
1930
|
} else {
|
|
1896
1931
|
if (t instanceof Number_0) {
|
|
1897
1932
|
var tmp_1;
|
|
1898
|
-
switch (t.
|
|
1933
|
+
switch (t.au_1.b3_1) {
|
|
1899
1934
|
case 0:
|
|
1900
1935
|
tmp_1 = 'Float';
|
|
1901
1936
|
break;
|
|
@@ -1924,12 +1959,12 @@ function emit_18($this, _this__u8e3s4) {
|
|
|
1924
1959
|
}
|
|
1925
1960
|
function JavaTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
1926
1961
|
return function (it) {
|
|
1927
|
-
return this$0.
|
|
1962
|
+
return this$0.bq(it);
|
|
1928
1963
|
};
|
|
1929
1964
|
}
|
|
1930
1965
|
function JavaTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
1931
1966
|
return function (it) {
|
|
1932
|
-
return Spacer_instance.toString() + this$0.
|
|
1967
|
+
return Spacer_instance.toString() + this$0.aq(it) + ',';
|
|
1933
1968
|
};
|
|
1934
1969
|
}
|
|
1935
1970
|
function JavaTypeDefinitionEmitter() {
|
|
@@ -1940,28 +1975,28 @@ function JavaUnionDefinitionEmitter$emit$lambda(it) {
|
|
|
1940
1975
|
function JavaUnionDefinitionEmitter() {
|
|
1941
1976
|
}
|
|
1942
1977
|
//region block: post-declaration
|
|
1943
|
-
protoOf(JavaEmitter).
|
|
1944
|
-
protoOf(JavaEmitter).
|
|
1945
|
-
protoOf(JavaEmitter).
|
|
1946
|
-
protoOf(JavaEmitter).
|
|
1947
|
-
protoOf(JavaEmitter).
|
|
1948
|
-
protoOf(JavaEmitter).
|
|
1949
|
-
protoOf(JavaEmitter).
|
|
1950
|
-
protoOf(JavaEmitter).
|
|
1951
|
-
protoOf(JavaEmitter).
|
|
1952
|
-
protoOf(JavaEmitter).
|
|
1953
|
-
protoOf(JavaEmitter).
|
|
1954
|
-
protoOf(JavaEmitter).
|
|
1955
|
-
protoOf(JavaEmitter).
|
|
1956
|
-
protoOf(JavaEmitter).
|
|
1957
|
-
protoOf(JavaEmitter).
|
|
1958
|
-
protoOf(JavaEmitter).
|
|
1959
|
-
protoOf(JavaEmitter).
|
|
1960
|
-
protoOf(JavaEmitter).
|
|
1961
|
-
protoOf(JavaEmitter).
|
|
1962
|
-
protoOf(JavaEmitter).
|
|
1963
|
-
protoOf(JavaIrEmitter).
|
|
1964
|
-
protoOf(JavaIrEmitter).
|
|
1978
|
+
protoOf(JavaEmitter).br = emit_12;
|
|
1979
|
+
protoOf(JavaEmitter).yp = emit_3;
|
|
1980
|
+
protoOf(JavaEmitter).zp = emit_4;
|
|
1981
|
+
protoOf(JavaEmitter).aq = emit_5;
|
|
1982
|
+
protoOf(JavaEmitter).bq = emit_6;
|
|
1983
|
+
protoOf(JavaEmitter).cq = emit_7;
|
|
1984
|
+
protoOf(JavaEmitter).or = emit_9;
|
|
1985
|
+
protoOf(JavaEmitter).v1v = emit_10;
|
|
1986
|
+
protoOf(JavaEmitter).w1v = emit_11;
|
|
1987
|
+
protoOf(JavaEmitter).cr = emit_8;
|
|
1988
|
+
protoOf(JavaEmitter).nr = emit_13;
|
|
1989
|
+
protoOf(JavaEmitter).dr = emit_15;
|
|
1990
|
+
protoOf(JavaEmitter).ir = emit_14;
|
|
1991
|
+
protoOf(JavaEmitter).u1v = sanitizeSymbol;
|
|
1992
|
+
protoOf(JavaEmitter).x1v = sanitizeFirstIsDigit;
|
|
1993
|
+
protoOf(JavaEmitter).y1v = sanitizeKeywords;
|
|
1994
|
+
protoOf(JavaEmitter).k1v = emitRoot;
|
|
1995
|
+
protoOf(JavaEmitter).j1v = emitRoot$default;
|
|
1996
|
+
protoOf(JavaEmitter).z1v = emitHandleFunction;
|
|
1997
|
+
protoOf(JavaEmitter).pr = emitValidator;
|
|
1998
|
+
protoOf(JavaIrEmitter).sn = emit_1;
|
|
1999
|
+
protoOf(JavaIrEmitter).r1u = emit_2;
|
|
1965
2000
|
//endregion
|
|
1966
2001
|
//region block: exports
|
|
1967
2002
|
export {
|