@flock/wirespec 0.18.14 → 0.18.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/clikt-clikt-mordant.mjs +39 -39
- package/colormath-root-colormath.mjs +432 -432
- package/kotlin-kotlin-stdlib.mjs +20 -10
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +9842 -9842
- package/kotlin-rgxgen.mjs +1758 -1758
- package/kotlinx-io-kotlinx-io-core.mjs +404 -404
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1775 -1775
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1466 -1466
- package/mordant-mordant.mjs +1190 -1190
- package/package.json +1 -1
- package/wirespec-src-compiler-core.mjs +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +182 -182
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +197 -133
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +147 -147
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +68 -54
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +29 -29
- package/wirespec-src-compiler-emitters-typescript.mjs +81 -54
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +26 -26
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +144 -134
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +479 -479
- package/wirespec-src-converter-openapi.mjs +320 -320
- package/wirespec-src-ide-lsp.mjs +1348 -1348
- package/wirespec-src-plugin-arguments.mjs +136 -136
- package/wirespec-src-plugin-cli.mjs +84 -84
- package/wirespec-src-plugin-npm.mjs +10 -10
- package/wirespec-src-tools-generator.mjs +2 -2
|
@@ -197,10 +197,10 @@ function emit_6(_this__u8e3s4) {
|
|
|
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.l1v(_this__u8e3s4.go_1);
|
|
201
201
|
} else {
|
|
202
202
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
203
|
-
tmp = this.
|
|
203
|
+
tmp = this.l1v(_this__u8e3s4.do_1);
|
|
204
204
|
} else {
|
|
205
205
|
if (_this__u8e3s4 instanceof Unit) {
|
|
206
206
|
tmp = void_0;
|
|
@@ -229,7 +229,7 @@ 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.m1v(_this__u8e3s4, void_0) : emitRoot(_this__u8e3s4, void_0);
|
|
233
233
|
}
|
|
234
234
|
function emit_7(_this__u8e3s4) {
|
|
235
235
|
var tmp;
|
|
@@ -272,117 +272,17 @@ 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.br(channel.qo_1) + ' {\n | void invoke(' + emitFullyQualified(this, channel, channel.ro_1) + 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.l1v(channel.ro_1) + ' message);\n |}\n |\n ');
|
|
276
276
|
}
|
|
277
277
|
initMetadataForInterface(JavaChannelDefinitionEmitter, 'JavaChannelDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
278
|
-
function emit_9(
|
|
279
|
-
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 ');
|
|
280
|
-
}
|
|
281
|
-
function emitValidator(_this__u8e3s4) {
|
|
282
|
-
var defaultReturn = 'return true;';
|
|
283
|
-
var type = _this__u8e3s4.hr_1.tu_1;
|
|
284
|
-
var tmp;
|
|
285
|
-
if (type instanceof Integer) {
|
|
286
|
-
var tmp0_safe_receiver = type.yt_1;
|
|
287
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.cq(tmp0_safe_receiver);
|
|
288
|
-
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
289
|
-
} else {
|
|
290
|
-
if (type instanceof Number_0) {
|
|
291
|
-
var tmp2_safe_receiver = type.bu_1;
|
|
292
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.cq(tmp2_safe_receiver);
|
|
293
|
-
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
294
|
-
} else {
|
|
295
|
-
if (type instanceof String_0) {
|
|
296
|
-
var tmp4_safe_receiver = type.vt_1;
|
|
297
|
-
var tmp_0;
|
|
298
|
-
var tmp_1 = tmp4_safe_receiver;
|
|
299
|
-
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
300
|
-
tmp_0 = null;
|
|
301
|
-
} else {
|
|
302
|
-
tmp_0 = this.cq(new RegExp_0(tmp4_safe_receiver));
|
|
303
|
-
}
|
|
304
|
-
var tmp5_elvis_lhs = tmp_0;
|
|
305
|
-
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
306
|
-
} else {
|
|
307
|
-
if (equals(type, Boolean_instance)) {
|
|
308
|
-
tmp = defaultReturn;
|
|
309
|
-
} else {
|
|
310
|
-
if (equals(type, Bytes_instance)) {
|
|
311
|
-
tmp = defaultReturn;
|
|
312
|
-
} else {
|
|
313
|
-
noWhenBranchMatchedException();
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
return tmp;
|
|
320
|
-
}
|
|
321
|
-
initMetadataForInterface(JavaRefinedTypeDefinitionEmitter, 'JavaRefinedTypeDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
322
|
-
function emit_10(identifier) {
|
|
323
|
-
var tmp;
|
|
324
|
-
if (identifier instanceof DefinitionIdentifier) {
|
|
325
|
-
tmp = this.u1v(identifier.l1());
|
|
326
|
-
} else {
|
|
327
|
-
if (identifier instanceof FieldIdentifier) {
|
|
328
|
-
tmp = this.y1v(this.u1v(identifier.l1()));
|
|
329
|
-
} else {
|
|
330
|
-
noWhenBranchMatchedException();
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
return tmp;
|
|
334
|
-
}
|
|
335
|
-
function sanitizeSymbol(_this__u8e3s4) {
|
|
336
|
-
// Inline function 'kotlin.collections.mapIndexed' call
|
|
337
|
-
var this_0 = split(_this__u8e3s4, ['.', ' ', '-']);
|
|
338
|
-
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
339
|
-
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
340
|
-
var index = 0;
|
|
341
|
-
var _iterator__ex2g4s = this_0.t();
|
|
342
|
-
while (_iterator__ex2g4s.u()) {
|
|
343
|
-
var item = _iterator__ex2g4s.v();
|
|
344
|
-
var _unary__edvuaz = index;
|
|
345
|
-
index = _unary__edvuaz + 1 | 0;
|
|
346
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.sq(item) : item;
|
|
347
|
-
destination.x(tmp$ret$0);
|
|
348
|
-
}
|
|
349
|
-
var tmp = asSequence(joinToString(destination, ''));
|
|
350
|
-
return this.x1v(joinToString_0(filter(tmp, JavaIdentifierEmitter$sanitizeSymbol$lambda), ''));
|
|
351
|
-
}
|
|
352
|
-
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
353
|
-
var tmp;
|
|
354
|
-
var tmp0_safe_receiver = firstOrNull(_this__u8e3s4);
|
|
355
|
-
var tmp_0;
|
|
356
|
-
var tmp_1 = tmp0_safe_receiver;
|
|
357
|
-
if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
|
|
358
|
-
tmp_0 = null;
|
|
359
|
-
} else {
|
|
360
|
-
tmp_0 = isDigit(tmp0_safe_receiver);
|
|
361
|
-
}
|
|
362
|
-
if (tmp_0 === true) {
|
|
363
|
-
tmp = '_' + _this__u8e3s4;
|
|
364
|
-
} else {
|
|
365
|
-
tmp = _this__u8e3s4;
|
|
366
|
-
}
|
|
367
|
-
return tmp;
|
|
368
|
-
}
|
|
369
|
-
function sanitizeKeywords(_this__u8e3s4) {
|
|
370
|
-
return Companion_getInstance_0().a1w_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
371
|
-
}
|
|
372
|
-
initMetadataForInterface(JavaIdentifierEmitter, 'JavaIdentifierEmitter');
|
|
373
|
-
function emit_11(enum_0, module_0) {
|
|
374
|
-
var tmp = this.br(enum_0.lr_1);
|
|
375
|
-
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 ');
|
|
376
|
-
}
|
|
377
|
-
initMetadataForInterface(JavaEnumDefinitionEmitter, 'JavaEnumDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
378
|
-
function emit_12(endpoint) {
|
|
278
|
+
function emit_9(endpoint) {
|
|
379
279
|
var tmp = emitImports_0(this, endpoint);
|
|
380
280
|
var tmp_0 = this.br(endpoint.ip_1);
|
|
381
281
|
var tmp_1 = get_pathParams(endpoint);
|
|
382
282
|
var tmp_2 = emitObject(this, tmp_1, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
|
|
383
283
|
var tmp_3 = emitObject(this, endpoint.lp_1, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
384
284
|
var tmp_4 = emitObject(this, endpoint.mp_1, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
385
|
-
var tmp_5 = this.
|
|
285
|
+
var tmp_5 = this.x1v(first_0(endpoint.np_1), endpoint);
|
|
386
286
|
var tmp_6 = Spacer_instance.toString();
|
|
387
287
|
var tmp_7 = emitStatusInterfaces(this, endpoint);
|
|
388
288
|
var tmp_8 = emitResponseInterfaces(this, endpoint);
|
|
@@ -399,7 +299,7 @@ function emit_12(endpoint) {
|
|
|
399
299
|
var tmp_19 = emitFromResponse(this, endpoint);
|
|
400
300
|
var tmp_20 = Spacer_instance.vr(2);
|
|
401
301
|
var tmp_21 = Spacer_instance.vr(2);
|
|
402
|
-
var tmp_22 = this.
|
|
302
|
+
var tmp_22 = this.b1w(endpoint);
|
|
403
303
|
var tmp_23 = Spacer_instance.vr(2);
|
|
404
304
|
var tmp_24 = Spacer_instance.vr(3);
|
|
405
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 ');
|
|
@@ -407,10 +307,10 @@ function emit_12(endpoint) {
|
|
|
407
307
|
function emitHandleFunction(endpoint) {
|
|
408
308
|
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.tq(this.br(endpoint.ip_1)) + '(Request request);';
|
|
409
309
|
}
|
|
410
|
-
function
|
|
310
|
+
function emit_10(_this__u8e3s4, endpoint) {
|
|
411
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 ');
|
|
412
312
|
}
|
|
413
|
-
function
|
|
313
|
+
function emit_11(_this__u8e3s4) {
|
|
414
314
|
var tmp = Spacer_instance.toString();
|
|
415
315
|
var tmp_0 = Companion_instance_1.sq(_this__u8e3s4.up_1);
|
|
416
316
|
var tmp_1 = Spacer_instance.vr(2);
|
|
@@ -443,12 +343,112 @@ function emit_14(_this__u8e3s4) {
|
|
|
443
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 ');
|
|
444
344
|
}
|
|
445
345
|
initMetadataForInterface(JavaEndpointDefinitionEmitter, 'JavaEndpointDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
346
|
+
function emit_12(identifier) {
|
|
347
|
+
var tmp;
|
|
348
|
+
if (identifier instanceof DefinitionIdentifier) {
|
|
349
|
+
tmp = this.w1v(identifier.l1());
|
|
350
|
+
} else {
|
|
351
|
+
if (identifier instanceof FieldIdentifier) {
|
|
352
|
+
tmp = this.a1w(this.w1v(identifier.l1()));
|
|
353
|
+
} else {
|
|
354
|
+
noWhenBranchMatchedException();
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return tmp;
|
|
358
|
+
}
|
|
359
|
+
function sanitizeSymbol(_this__u8e3s4) {
|
|
360
|
+
// Inline function 'kotlin.collections.mapIndexed' call
|
|
361
|
+
var this_0 = split(_this__u8e3s4, ['.', ' ', '-']);
|
|
362
|
+
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
363
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
364
|
+
var index = 0;
|
|
365
|
+
var _iterator__ex2g4s = this_0.t();
|
|
366
|
+
while (_iterator__ex2g4s.u()) {
|
|
367
|
+
var item = _iterator__ex2g4s.v();
|
|
368
|
+
var _unary__edvuaz = index;
|
|
369
|
+
index = _unary__edvuaz + 1 | 0;
|
|
370
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.sq(item) : item;
|
|
371
|
+
destination.x(tmp$ret$0);
|
|
372
|
+
}
|
|
373
|
+
var tmp = asSequence(joinToString(destination, ''));
|
|
374
|
+
return this.z1v(joinToString_0(filter(tmp, JavaIdentifierEmitter$sanitizeSymbol$lambda), ''));
|
|
375
|
+
}
|
|
376
|
+
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
377
|
+
var tmp;
|
|
378
|
+
var tmp0_safe_receiver = firstOrNull(_this__u8e3s4);
|
|
379
|
+
var tmp_0;
|
|
380
|
+
var tmp_1 = tmp0_safe_receiver;
|
|
381
|
+
if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
|
|
382
|
+
tmp_0 = null;
|
|
383
|
+
} else {
|
|
384
|
+
tmp_0 = isDigit(tmp0_safe_receiver);
|
|
385
|
+
}
|
|
386
|
+
if (tmp_0 === true) {
|
|
387
|
+
tmp = '_' + _this__u8e3s4;
|
|
388
|
+
} else {
|
|
389
|
+
tmp = _this__u8e3s4;
|
|
390
|
+
}
|
|
391
|
+
return tmp;
|
|
392
|
+
}
|
|
393
|
+
function sanitizeKeywords(_this__u8e3s4) {
|
|
394
|
+
return Companion_getInstance_0().c1w_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
395
|
+
}
|
|
396
|
+
initMetadataForInterface(JavaIdentifierEmitter, 'JavaIdentifierEmitter');
|
|
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 ');
|
|
404
|
+
}
|
|
405
|
+
function emitValidator(_this__u8e3s4) {
|
|
406
|
+
var defaultReturn = 'return true;';
|
|
407
|
+
var type = _this__u8e3s4.hr_1.tu_1;
|
|
408
|
+
var tmp;
|
|
409
|
+
if (type instanceof Integer) {
|
|
410
|
+
var tmp0_safe_receiver = type.yt_1;
|
|
411
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.cq(tmp0_safe_receiver);
|
|
412
|
+
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
413
|
+
} else {
|
|
414
|
+
if (type instanceof Number_0) {
|
|
415
|
+
var tmp2_safe_receiver = type.bu_1;
|
|
416
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.cq(tmp2_safe_receiver);
|
|
417
|
+
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
418
|
+
} else {
|
|
419
|
+
if (type instanceof String_0) {
|
|
420
|
+
var tmp4_safe_receiver = type.vt_1;
|
|
421
|
+
var tmp_0;
|
|
422
|
+
var tmp_1 = tmp4_safe_receiver;
|
|
423
|
+
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
424
|
+
tmp_0 = null;
|
|
425
|
+
} else {
|
|
426
|
+
tmp_0 = this.cq(new RegExp_0(tmp4_safe_receiver));
|
|
427
|
+
}
|
|
428
|
+
var tmp5_elvis_lhs = tmp_0;
|
|
429
|
+
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
430
|
+
} else {
|
|
431
|
+
if (equals(type, Boolean_instance)) {
|
|
432
|
+
tmp = defaultReturn;
|
|
433
|
+
} else {
|
|
434
|
+
if (equals(type, Bytes_instance)) {
|
|
435
|
+
tmp = defaultReturn;
|
|
436
|
+
} else {
|
|
437
|
+
noWhenBranchMatchedException();
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
return tmp;
|
|
444
|
+
}
|
|
445
|
+
initMetadataForInterface(JavaRefinedTypeDefinitionEmitter, 'JavaRefinedTypeDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
446
446
|
function emit_15(union) {
|
|
447
447
|
var tmp = this.br(union.uo_1);
|
|
448
448
|
return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.vo_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
|
|
449
449
|
}
|
|
450
450
|
initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
451
|
-
initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [
|
|
451
|
+
initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [JavaTypeDefinitionEmitter, JavaEndpointDefinitionEmitter, JavaEnumDefinitionEmitter, JavaIdentifierEmitter, JavaRefinedTypeDefinitionEmitter, JavaUnionDefinitionEmitter, JavaChannelDefinitionEmitter, LanguageEmitter]);
|
|
452
452
|
initMetadataForCompanion(Companion);
|
|
453
453
|
initMetadataForCompanion(Companion_0);
|
|
454
454
|
initMetadataForClass(JavaIrEmitter, 'JavaIrEmitter', JavaIrEmitter, VOID, [IrEmitter]);
|
|
@@ -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.k1v().rr_1 + '.model.' + item.pu_1 + ';';
|
|
476
476
|
destination_0.x(tmp$ret$3);
|
|
477
477
|
}
|
|
478
478
|
var tmp = destination_0;
|
|
@@ -481,7 +481,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
481
481
|
function emitFullyQualified($this, _this__u8e3s4, reference) {
|
|
482
482
|
var tmp;
|
|
483
483
|
if (_this__u8e3s4.ar().l1() === reference.l1()) {
|
|
484
|
-
tmp = $this.
|
|
484
|
+
tmp = $this.k1v().rr_1 + '.model.';
|
|
485
485
|
} else {
|
|
486
486
|
tmp = '';
|
|
487
487
|
}
|
|
@@ -497,42 +497,42 @@ function JavaEmitter(packageName, emitShared) {
|
|
|
497
497
|
packageName = packageName === VOID ? Companion_instance.qr('community.flock.wirespec.generated') : packageName;
|
|
498
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.n1v_1 = packageName;
|
|
501
|
+
this.o1v_1 = emitShared;
|
|
502
|
+
this.p1v_1 = '\nimport community.flock.wirespec.java.Wirespec;\n';
|
|
503
|
+
this.q1v_1 = FileExtension_Java_getInstance();
|
|
504
|
+
this.r1v_1 = JavaShared_getInstance();
|
|
505
|
+
this.s1v_1 = '//';
|
|
506
|
+
}
|
|
507
|
+
protoOf(JavaEmitter).k1v = function () {
|
|
508
|
+
return this.n1v_1;
|
|
509
509
|
};
|
|
510
510
|
protoOf(JavaEmitter).iq = function () {
|
|
511
|
-
return this.
|
|
511
|
+
return this.q1v_1;
|
|
512
512
|
};
|
|
513
|
-
protoOf(JavaEmitter).
|
|
514
|
-
return this.
|
|
513
|
+
protoOf(JavaEmitter).t1v = function () {
|
|
514
|
+
return this.r1v_1;
|
|
515
515
|
};
|
|
516
516
|
protoOf(JavaEmitter).jq = function () {
|
|
517
|
-
return this.
|
|
517
|
+
return this.s1v_1;
|
|
518
518
|
};
|
|
519
519
|
protoOf(JavaEmitter).yq = function (module_0, logger) {
|
|
520
520
|
// Inline function 'kotlin.let' call
|
|
521
521
|
var it = protoOf(LanguageEmitter).yq.call(this, module_0, logger);
|
|
522
|
-
return this.
|
|
522
|
+
return this.o1v_1.lo_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.qr('community.flock.wirespec.java').tr() + 'Wirespec', this.t1v().v1v_1)) : it;
|
|
523
523
|
};
|
|
524
524
|
protoOf(JavaEmitter).zq = function (definition, module_0, logger) {
|
|
525
525
|
// Inline function 'kotlin.let' call
|
|
526
526
|
var it = protoOf(LanguageEmitter).zq.call(this, definition, module_0, logger);
|
|
527
|
-
var subPackageName = plus(this.
|
|
528
|
-
var tmp = subPackageName.tr() + this.
|
|
527
|
+
var subPackageName = plus(this.k1v(), definition);
|
|
528
|
+
var tmp = subPackageName.tr() + this.w1v(it.mo_1);
|
|
529
529
|
// Inline function 'kotlin.text.trimStart' call
|
|
530
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.uq(module_0) ? this.
|
|
530
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.uq(module_0) ? this.p1v_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.m1v(_this__u8e3s4, 'Void') + '.class, ' + emitGetTypeRaw($this, _this__u8e3s4) + ')';
|
|
536
536
|
}
|
|
537
537
|
function emitGetTypeRaw($this, _this__u8e3s4) {
|
|
538
538
|
var tmp;
|
|
@@ -687,7 +687,7 @@ 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.k1v().rr_1 + '.model.' + item.pu_1 + ';';
|
|
691
691
|
destination_0.x(tmp$ret$3);
|
|
692
692
|
}
|
|
693
693
|
var tmp = destination_0;
|
|
@@ -808,7 +808,7 @@ function JavaEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
|
808
808
|
}
|
|
809
809
|
function JavaEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
810
810
|
return function (it) {
|
|
811
|
-
return this$0.
|
|
811
|
+
return this$0.y1v(it);
|
|
812
812
|
};
|
|
813
813
|
}
|
|
814
814
|
function JavaEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
@@ -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.a1w($this.z1v(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.c1w_1 = setOf(['abstract', 'continue', 'for', 'new', 'switch', 'assert', 'default', 'goto', 'package', 'synchronized', 'boolean', 'do', 'if', 'private', 'this', 'break', 'double', 'implements', 'protected', 'throw', 'byte', 'else', 'import', 'public', 'throws', 'case', 'enum', 'instanceof', 'return', 'transient', 'catch', 'extends', 'int', 'short', 'try', 'char', 'final', 'interface', 'static', 'void', 'class', 'finally', 'long', 'strictfp', 'volatile', 'const', 'float', 'native', 'super', 'while', 'true', 'false']);
|
|
955
955
|
}
|
|
956
956
|
var Companion_instance_2;
|
|
957
957
|
function Companion_getInstance_0() {
|
|
@@ -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().d1w_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.d1w_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() {
|
|
@@ -1134,27 +1134,27 @@ function JavaIrEmitter(packageName, emitShared) {
|
|
|
1134
1134
|
Companion_getInstance_1();
|
|
1135
1135
|
packageName = packageName === VOID ? Companion_instance.qr('community.flock.wirespec.generated') : packageName;
|
|
1136
1136
|
emitShared = emitShared === VOID ? Companion_instance_0.ko() : emitShared;
|
|
1137
|
-
this.
|
|
1138
|
-
this.
|
|
1139
|
-
this.
|
|
1140
|
-
this.
|
|
1141
|
-
this.
|
|
1137
|
+
this.e1w_1 = packageName;
|
|
1138
|
+
this.f1w_1 = emitShared;
|
|
1139
|
+
this.g1w_1 = JavaGenerator_instance;
|
|
1140
|
+
this.h1w_1 = FileExtension_Java_getInstance();
|
|
1141
|
+
this.i1w_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().d1w_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.j1w_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).k1v = function () {
|
|
1151
|
+
return this.e1w_1;
|
|
1152
1152
|
};
|
|
1153
1153
|
protoOf(JavaIrEmitter).p1u = function () {
|
|
1154
|
-
return this.
|
|
1154
|
+
return this.g1w_1;
|
|
1155
1155
|
};
|
|
1156
1156
|
protoOf(JavaIrEmitter).iq = function () {
|
|
1157
|
-
return this.
|
|
1157
|
+
return this.h1w_1;
|
|
1158
1158
|
};
|
|
1159
1159
|
protoOf(JavaIrEmitter).s1u = function () {
|
|
1160
1160
|
var packageName = Companion_instance.qr('community.flock.wirespec.java');
|
|
@@ -1197,7 +1197,7 @@ protoOf(JavaIrEmitter).s1u = function () {
|
|
|
1197
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.f1w_1.lo_1) {
|
|
1201
1201
|
tmp_2 = wirespecShared;
|
|
1202
1202
|
} else {
|
|
1203
1203
|
tmp_2 = null;
|
|
@@ -1208,7 +1208,7 @@ protoOf(JavaIrEmitter).zq = function (definition, module_0, logger) {
|
|
|
1208
1208
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1209
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.i1w_1;
|
|
1212
1212
|
var tmp_0;
|
|
1213
1213
|
if (Companion_instance_1.vq(module_0)) {
|
|
1214
1214
|
tmp_0 = this_0;
|
|
@@ -1216,26 +1216,26 @@ protoOf(JavaIrEmitter).zq = function (definition, module_0, logger) {
|
|
|
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.k1v(), definition);
|
|
1220
1220
|
};
|
|
1221
1221
|
protoOf(JavaIrEmitter).yp = function (type, module_0) {
|
|
1222
|
-
return sanitizeNames(convertWithValidation(type, module_0), this.
|
|
1222
|
+
return sanitizeNames(convertWithValidation(type, module_0), this.j1w_1);
|
|
1223
1223
|
};
|
|
1224
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.j1w_1);
|
|
1228
1228
|
};
|
|
1229
1229
|
protoOf(JavaIrEmitter).dr = function (union) {
|
|
1230
|
-
return sanitizeNames(convert_1(union), this.
|
|
1230
|
+
return sanitizeNames(convert_1(union), this.j1w_1);
|
|
1231
1231
|
};
|
|
1232
1232
|
protoOf(JavaIrEmitter).ir = function (refined) {
|
|
1233
|
-
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.
|
|
1233
|
+
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.j1w_1);
|
|
1234
1234
|
};
|
|
1235
1235
|
protoOf(JavaIrEmitter).or = function (endpoint) {
|
|
1236
|
-
var tmp = sanitizeNames(transformTypeDescriptors(injectApiField(injectHandleFunction(convert_3(endpoint), endpoint))), this.
|
|
1236
|
+
var tmp = sanitizeNames(transformTypeDescriptors(injectApiField(injectHandleFunction(convert_3(endpoint), endpoint))), this.j1w_1);
|
|
1237
1237
|
// Inline function 'kotlin.takeIf' call
|
|
1238
|
-
var this_0 = buildModelImports(endpoint, this.
|
|
1238
|
+
var this_0 = buildModelImports(endpoint, this.k1v());
|
|
1239
1239
|
var tmp_0;
|
|
1240
1240
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1241
1241
|
if (!this_0.r()) {
|
|
@@ -1249,20 +1249,20 @@ protoOf(JavaIrEmitter).or = function (endpoint) {
|
|
|
1249
1249
|
protoOf(JavaIrEmitter).cr = function (channel) {
|
|
1250
1250
|
var tmp;
|
|
1251
1251
|
if (channel.qo_1.l1() === channel.ro_1.l1()) {
|
|
1252
|
-
tmp = this.
|
|
1252
|
+
tmp = this.k1v().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.j1w_1), fullyQualifiedPrefix);
|
|
1258
1258
|
};
|
|
1259
1259
|
protoOf(JavaIrEmitter).u1u = function (endpoint) {
|
|
1260
|
-
var imports = buildModelImports(endpoint, this.
|
|
1261
|
-
var endpointImport = import_0(this.
|
|
1260
|
+
var imports = buildModelImports(endpoint, this.k1v());
|
|
1261
|
+
var endpointImport = import_0(this.k1v().rr_1 + '.endpoint', endpoint.ip_1.l1());
|
|
1262
1262
|
var endpointName = endpoint.ip_1.l1();
|
|
1263
|
-
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.
|
|
1264
|
-
var subPackageName = plus_0(this.
|
|
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.
|
|
1263
|
+
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.j1w_1)), endpointName);
|
|
1264
|
+
var subPackageName = plus_0(this.k1v(), '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.i1w_1), imports), listOf(endpointImport)), file.y1m_1));
|
|
1266
1266
|
};
|
|
1267
1267
|
protoOf(JavaIrEmitter).t1u = function (endpoints, logger) {
|
|
1268
1268
|
// Inline function 'kotlin.collections.flatMap' call
|
|
@@ -1324,7 +1324,7 @@ protoOf(JavaIrEmitter).t1u = 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.k1v().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).t1u = 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.k1v().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,13 +1344,13 @@ protoOf(JavaIrEmitter).t1u = 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.k1v().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().k1h(this.
|
|
1352
|
+
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.j1w_1);
|
|
1353
|
+
return new File(Companion_getInstance().k1h(this.k1v().tr() + sanitizeSymbol_0(this, file.x1m_1.m1h())), plus_1(plus_1(plus_1(listOf(new Package(this.k1v().rr_1)), this.i1w_1), allImports), file.y1m_1));
|
|
1354
1354
|
};
|
|
1355
1355
|
function transformTypeDescriptors(_this__u8e3s4) {
|
|
1356
1356
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -1856,8 +1856,8 @@ function JavaRefinedTypeDefinitionEmitter() {
|
|
|
1856
1856
|
}
|
|
1857
1857
|
function JavaShared() {
|
|
1858
1858
|
JavaShared_instance = this;
|
|
1859
|
-
this.
|
|
1860
|
-
this.
|
|
1859
|
+
this.u1v_1 = 'community.flock.wirespec.java';
|
|
1860
|
+
this.v1v_1 = trimMargin('\n |package ' + this.u1v_1 + ';\n |\n |import java.lang.reflect.Type;\n |import java.lang.reflect.ParameterizedType;\n |import java.util.List;\n |import java.util.Map;\n |import java.util.Optional;\n |\n |public interface Wirespec {\n |' + Spacer_instance.toString() + 'interface Enum { String label(); }\n |' + Spacer_instance.toString() + 'interface Endpoint {}\n |' + Spacer_instance.toString() + 'interface Refined<T> { T value(); }\n |' + Spacer_instance.toString() + 'interface Path {}\n |' + Spacer_instance.toString() + 'interface Queries {}\n |' + Spacer_instance.toString() + 'interface Headers {}\n |' + Spacer_instance.toString() + 'interface Handler {}\n |' + Spacer_instance.toString() + 'interface ServerEdge<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.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 ');
|
|
1861
1861
|
}
|
|
1862
1862
|
protoOf(JavaShared).toString = function () {
|
|
1863
1863
|
return 'JavaShared';
|
|
@@ -1975,25 +1975,25 @@ function JavaUnionDefinitionEmitter$emit$lambda(it) {
|
|
|
1975
1975
|
function JavaUnionDefinitionEmitter() {
|
|
1976
1976
|
}
|
|
1977
1977
|
//region block: post-declaration
|
|
1978
|
-
protoOf(JavaEmitter).br =
|
|
1978
|
+
protoOf(JavaEmitter).br = emit_12;
|
|
1979
1979
|
protoOf(JavaEmitter).yp = emit_3;
|
|
1980
1980
|
protoOf(JavaEmitter).zp = emit_4;
|
|
1981
1981
|
protoOf(JavaEmitter).aq = emit_5;
|
|
1982
1982
|
protoOf(JavaEmitter).bq = emit_6;
|
|
1983
1983
|
protoOf(JavaEmitter).cq = emit_7;
|
|
1984
|
-
protoOf(JavaEmitter).or =
|
|
1985
|
-
protoOf(JavaEmitter).
|
|
1986
|
-
protoOf(JavaEmitter).
|
|
1984
|
+
protoOf(JavaEmitter).or = emit_9;
|
|
1985
|
+
protoOf(JavaEmitter).x1v = emit_10;
|
|
1986
|
+
protoOf(JavaEmitter).y1v = emit_11;
|
|
1987
1987
|
protoOf(JavaEmitter).cr = emit_8;
|
|
1988
|
-
protoOf(JavaEmitter).nr =
|
|
1988
|
+
protoOf(JavaEmitter).nr = emit_13;
|
|
1989
1989
|
protoOf(JavaEmitter).dr = emit_15;
|
|
1990
|
-
protoOf(JavaEmitter).ir =
|
|
1991
|
-
protoOf(JavaEmitter).
|
|
1992
|
-
protoOf(JavaEmitter).
|
|
1993
|
-
protoOf(JavaEmitter).
|
|
1994
|
-
protoOf(JavaEmitter).
|
|
1995
|
-
protoOf(JavaEmitter).
|
|
1996
|
-
protoOf(JavaEmitter).
|
|
1990
|
+
protoOf(JavaEmitter).ir = emit_14;
|
|
1991
|
+
protoOf(JavaEmitter).w1v = sanitizeSymbol;
|
|
1992
|
+
protoOf(JavaEmitter).z1v = sanitizeFirstIsDigit;
|
|
1993
|
+
protoOf(JavaEmitter).a1w = sanitizeKeywords;
|
|
1994
|
+
protoOf(JavaEmitter).m1v = emitRoot;
|
|
1995
|
+
protoOf(JavaEmitter).l1v = emitRoot$default;
|
|
1996
|
+
protoOf(JavaEmitter).b1w = emitHandleFunction;
|
|
1997
1997
|
protoOf(JavaEmitter).pr = emitValidator;
|
|
1998
1998
|
protoOf(JavaIrEmitter).sn = emit_1;
|
|
1999
1999
|
protoOf(JavaIrEmitter).r1u = emit_2;
|