@flock/wirespec 0.18.1-RC.3 → 0.18.5
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 +79 -79
- package/clikt-clikt.mjs +1265 -1265
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +433 -433
- package/kotlin-kotlin-stdlib.mjs +40 -34
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +5407 -5405
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1760 -1760
- package/kotlinx-io-kotlinx-io-core.mjs +404 -404
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1701 -1701
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1320 -1319
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1198 -1198
- package/package.json +1 -1
- package/wirespec-src-compiler-core.mjs +193 -206
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +758 -824
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +319 -426
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +629 -758
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +1582 -1708
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +680 -635
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +626 -609
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +41 -41
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +5428 -6057
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +279 -279
- package/wirespec-src-converter-avro.mjs +559 -559
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +802 -404
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-plugin-arguments.mjs +144 -144
- package/wirespec-src-plugin-cli.mjs +87 -87
- package/wirespec-src-plugin-npm.mjs +44 -25
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +13 -13
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
spacer28p2fwyb64afn as spacer,
|
|
22
22
|
FieldIdentifier34k7iphndcnl0 as FieldIdentifier,
|
|
23
23
|
DefinitionIdentifiervfasqdb33qef as DefinitionIdentifier,
|
|
24
|
-
Shared1uygqfbd22ukz as Shared,
|
|
25
24
|
plus14o24vdaiongg as plus_0,
|
|
26
25
|
Bytes_instance1o9u095wd3kx6 as Bytes_instance,
|
|
27
26
|
Boolean_instance237vwt01w3hs8 as Boolean_instance,
|
|
@@ -77,24 +76,24 @@ import {
|
|
|
77
76
|
joinToStringooja5rkatz3u as joinToString_0,
|
|
78
77
|
firstOrNulltrxqttxfxqju as firstOrNull,
|
|
79
78
|
isDigit3mimrri4wkzop as isDigit,
|
|
80
|
-
Paire9pteg33gng7 as Pair,
|
|
81
|
-
plus310ted5e4i90h as plus_1,
|
|
82
|
-
emptyList1g2z5xcrvp2zy as emptyList,
|
|
83
79
|
StringBuilder_init_$Create$322n630qt3r8c as StringBuilder_init_$Create$,
|
|
84
80
|
charSequenceLength3278n89t01tmv as charSequenceLength,
|
|
85
81
|
charSequenceGet1vxk1y5n17t1z as charSequenceGet,
|
|
82
|
+
emptyList1g2z5xcrvp2zy as emptyList,
|
|
83
|
+
Paire9pteg33gng7 as Pair,
|
|
84
|
+
plus310ted5e4i90h as plus_1,
|
|
85
|
+
listOf1jh22dvmctj1r as listOf_0,
|
|
86
|
+
plus20p0vtfmu0596 as plus_2,
|
|
86
87
|
isInterface3d6p8outrmvmk as isInterface,
|
|
88
|
+
addAll1k27qatfgp3k5 as addAll,
|
|
89
|
+
HashSet_init_$Create$33p49hmosnvr4 as HashSet_init_$Create$,
|
|
90
|
+
Collection1k04j3hzsbod0 as Collection,
|
|
87
91
|
equals2au1ep9vhcato as equals,
|
|
88
|
-
listOf1jh22dvmctj1r as listOf_0,
|
|
89
92
|
firstOrNull1982767dljvdy as firstOrNull_0,
|
|
90
93
|
last1vo29oleiqj36 as last,
|
|
91
94
|
dropLast1vpiyky649o34 as dropLast,
|
|
92
95
|
to2cs3ny02qtbcb as to,
|
|
93
96
|
mapOf2zpbbmyqk8xpf as mapOf,
|
|
94
|
-
plus20p0vtfmu0596 as plus_2,
|
|
95
|
-
addAll1k27qatfgp3k5 as addAll,
|
|
96
|
-
HashSet_init_$Create$33p49hmosnvr4 as HashSet_init_$Create$,
|
|
97
|
-
Collection1k04j3hzsbod0 as Collection,
|
|
98
97
|
initMetadataForObject1cxne3s9w65el as initMetadataForObject,
|
|
99
98
|
dropLastlqc2oyv04br0 as dropLast_0,
|
|
100
99
|
replace3le3ie7l9k8aq as replace,
|
|
@@ -104,18 +103,45 @@ import {
|
|
|
104
103
|
NonEmptyList__plus_impl_xqmb92tle8a7jcf2wm as NonEmptyList__plus_impl_xqmb9,
|
|
105
104
|
} from './arrow-arrow-core.mjs';
|
|
106
105
|
import {
|
|
106
|
+
Nameoqr8dt2fim9d as Name,
|
|
107
|
+
FunctionCall30872kpnbr7op as FunctionCall,
|
|
108
|
+
transformChildren2mszeagj5nq4c as transformChildren,
|
|
107
109
|
Companion_getInstance3gvtuyxc9uhxj as Companion_getInstance,
|
|
108
110
|
Package2tniq694j1763 as Package,
|
|
109
111
|
File3dimy4iqmuock as File,
|
|
110
|
-
transformChildrend9p91tpcqdkx as
|
|
112
|
+
transformChildrend9p91tpcqdkx as transformChildren_0,
|
|
111
113
|
withElements2toq84v08e72 as withElements,
|
|
112
114
|
Namespace345pal554qu3j as Namespace,
|
|
115
|
+
function12vu2kapzno4w as function_0,
|
|
116
|
+
String_instance3uxvo48ki208u as String_instance,
|
|
117
|
+
VariableReference2vlynnhaw1i64 as VariableReference,
|
|
118
|
+
JavaGenerator_instance753fwcs3a4n9 as JavaGenerator_instance,
|
|
113
119
|
import5uhkz67bd8tt as import_0,
|
|
120
|
+
SanitizationConfig11mmn3p2c03c1 as SanitizationConfig,
|
|
121
|
+
convertClientServer1w4pgeabrnbb9 as convertClientServer,
|
|
122
|
+
toGetterAccessors2z6mndbqwlczg as toGetterAccessors,
|
|
123
|
+
rawttvqxl50flj9 as raw,
|
|
124
|
+
convertnty9x0e63d0u as convert,
|
|
114
125
|
TransformScopeyrd3lf4zrk76 as TransformScope,
|
|
115
126
|
TransformerBuildera6a1gvlhjj9b as TransformerBuilder,
|
|
116
127
|
transform3eti8i2bqvifx as transform,
|
|
117
128
|
Elementitq62jg6fid3 as Element,
|
|
118
|
-
|
|
129
|
+
emitn3eihixilqyh as emit_0,
|
|
130
|
+
prependImports32gcj3yb8voha as prependImports,
|
|
131
|
+
placeInPackage1ffljbk9me4ug as placeInPackage,
|
|
132
|
+
convertWithValidation3ar3nbcqsbkpn as convertWithValidation,
|
|
133
|
+
sanitizeNames2wqmyf8vafp9x as sanitizeNames,
|
|
134
|
+
convert11ert2po54h1y as convert_0,
|
|
135
|
+
injectEnumLabelFieldyfohidz6c88i as injectEnumLabelField,
|
|
136
|
+
convert37aabdzvtv9vg as convert_1,
|
|
137
|
+
convert17zcptkz4mhr4 as convert_2,
|
|
138
|
+
convert32tuiui3czihh as convert_3,
|
|
139
|
+
convert1cn4bolzoed8c as convert_4,
|
|
140
|
+
emitEndpointClient1meajc90wf3el as emitEndpointClient,
|
|
141
|
+
emitClient32kfwzg2hm5vj as emitClient,
|
|
142
|
+
emit1oxjujel6f3jb as emit_1,
|
|
143
|
+
emit3bzdcd0f6nwtj as emit_2,
|
|
144
|
+
IrEmitterh2m93ojzvkep as IrEmitter,
|
|
119
145
|
Dict22iqrhoo0g8et as Dict_0,
|
|
120
146
|
Array2goj74t0aak7b as Array_0,
|
|
121
147
|
Nullable3wjn6l6q3h6o as Nullable,
|
|
@@ -124,50 +150,20 @@ import {
|
|
|
124
150
|
Any_instance2998xag3cdzh3 as Any_instance,
|
|
125
151
|
Bytes_instance3edm2lhbrwd51 as Bytes_instance_0,
|
|
126
152
|
Boolean_instance27opaqtiiiysz as Boolean_instance_0,
|
|
127
|
-
String_instance3uxvo48ki208u as String_instance,
|
|
128
153
|
Number3azxs9q1cyulb as Number_1,
|
|
129
154
|
Integer1uwg1wvo5lp6z as Integer_0,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
convertClientServer3s89ijty7q130 as convertClientServer,
|
|
135
|
-
toGetterAccessors2z6mndbqwlczg as toGetterAccessors,
|
|
136
|
-
rawttvqxl50flj9 as raw,
|
|
137
|
-
generateJavaxqkwhkjcf0ke as generateJava,
|
|
138
|
-
RawElement2yts1x2rbem1g as RawElement,
|
|
139
|
-
VariableReference2vlynnhaw1i64 as VariableReference,
|
|
140
|
-
withLabelField33ehya4zusm70 as withLabelField,
|
|
141
|
-
function12vu2kapzno4w as function_0,
|
|
142
|
-
plusd54zq6f7l8fy as plus_3,
|
|
143
|
-
Enumlszg09mwd24f as Enum,
|
|
144
|
-
convert2loxpwk8n2r8c as convert_0,
|
|
155
|
+
structo1silz79n3nu as struct,
|
|
156
|
+
RawExpression2bo7ldfrptjia as RawExpression,
|
|
157
|
+
TypeDescriptor1hvcpxrtxcqsx as TypeDescriptor,
|
|
158
|
+
convert2loxpwk8n2r8c as convert_5,
|
|
145
159
|
Function21cuq8qizkin7 as Function,
|
|
160
|
+
plusd54zq6f7l8fy as plus_3,
|
|
146
161
|
Struct39wf79cwtn4ty as Struct,
|
|
147
162
|
Interface3pn84xq686t2r as Interface,
|
|
148
|
-
|
|
163
|
+
RawElement2yts1x2rbem1g as RawElement,
|
|
149
164
|
Assignment3kcxc8wlcbmkn as Assignment,
|
|
150
|
-
|
|
165
|
+
ReturnStatement29qlfkn9kpy10 as ReturnStatement,
|
|
151
166
|
Wildcard_instance2ga1ytfwj78ra as Wildcard_instance,
|
|
152
|
-
TypeDescriptor1hvcpxrtxcqsx as TypeDescriptor,
|
|
153
|
-
JavaGenerator_instance753fwcs3a4n9 as JavaGenerator_instance,
|
|
154
|
-
SanitizationConfig11mmn3p2c03c1 as SanitizationConfig,
|
|
155
|
-
emit3bzdcd0f6nwtj as emit_0,
|
|
156
|
-
withSharedSource1qgrajaccojj3 as withSharedSource,
|
|
157
|
-
emitn3eihixilqyh as emit_1,
|
|
158
|
-
prependImports32gcj3yb8voha as prependImports,
|
|
159
|
-
placeInPackage1ffljbk9me4ug as placeInPackage,
|
|
160
|
-
convertWithValidation3ar3nbcqsbkpn as convertWithValidation,
|
|
161
|
-
sanitizeNames2wqmyf8vafp9x as sanitizeNames,
|
|
162
|
-
convert11ert2po54h1y as convert_1,
|
|
163
|
-
convert37aabdzvtv9vg as convert_2,
|
|
164
|
-
convert17zcptkz4mhr4 as convert_3,
|
|
165
|
-
convert32tuiui3czihh as convert_4,
|
|
166
|
-
convert1cn4bolzoed8c as convert_5,
|
|
167
|
-
emitEndpointClient1meajc90wf3el as emitEndpointClient,
|
|
168
|
-
emitClient32kfwzg2hm5vj as emitClient,
|
|
169
|
-
emit1oxjujel6f3jb as emit_2,
|
|
170
|
-
IrEmitterh2m93ojzvkep as IrEmitter,
|
|
171
167
|
} from './wirespec-src-compiler-ir.mjs';
|
|
172
168
|
//region block: imports
|
|
173
169
|
//endregion
|
|
@@ -195,15 +191,15 @@ function emit_5(_this__u8e3s4) {
|
|
|
195
191
|
function emit_6(_this__u8e3s4) {
|
|
196
192
|
// Inline function 'kotlin.let' call
|
|
197
193
|
var it = emitType(this, _this__u8e3s4);
|
|
198
|
-
return _this__u8e3s4.
|
|
194
|
+
return _this__u8e3s4.cu() ? 'java.util.Optional<' + it + '>' : it;
|
|
199
195
|
}
|
|
200
196
|
function emitRoot(_this__u8e3s4, void_0) {
|
|
201
197
|
var tmp;
|
|
202
198
|
if (_this__u8e3s4 instanceof Dict) {
|
|
203
|
-
tmp = this.
|
|
199
|
+
tmp = this.d1v(_this__u8e3s4.co_1);
|
|
204
200
|
} else {
|
|
205
201
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
206
|
-
tmp = this.
|
|
202
|
+
tmp = this.d1v(_this__u8e3s4.zn_1);
|
|
207
203
|
} else {
|
|
208
204
|
if (_this__u8e3s4 instanceof Unit) {
|
|
209
205
|
tmp = void_0;
|
|
@@ -232,7 +228,7 @@ function emitRoot(_this__u8e3s4, void_0) {
|
|
|
232
228
|
}
|
|
233
229
|
function emitRoot$default(_this__u8e3s4, void_0, $super) {
|
|
234
230
|
void_0 = void_0 === VOID ? 'void' : void_0;
|
|
235
|
-
return $super === VOID ? this.
|
|
231
|
+
return $super === VOID ? this.e1v(_this__u8e3s4, void_0) : emitRoot(_this__u8e3s4, void_0);
|
|
236
232
|
}
|
|
237
233
|
function emit_7(_this__u8e3s4) {
|
|
238
234
|
var tmp;
|
|
@@ -240,7 +236,7 @@ function emit_7(_this__u8e3s4) {
|
|
|
240
236
|
tmp = 'return java.util.regex.Pattern.compile("' + replace(this.zp(_this__u8e3s4.ys_1), '\\', '\\\\') + '").matcher(value).find();';
|
|
241
237
|
} else {
|
|
242
238
|
if (_this__u8e3s4 instanceof Bound) {
|
|
243
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
239
|
+
var tmp1_safe_receiver = _this__u8e3s4.ot_1;
|
|
244
240
|
var tmp_0;
|
|
245
241
|
if (tmp1_safe_receiver == null) {
|
|
246
242
|
tmp_0 = null;
|
|
@@ -249,7 +245,7 @@ function emit_7(_this__u8e3s4) {
|
|
|
249
245
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
250
246
|
}
|
|
251
247
|
var minCheck = tmp_0;
|
|
252
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
248
|
+
var tmp2_safe_receiver = _this__u8e3s4.pt_1;
|
|
253
249
|
var tmp_1;
|
|
254
250
|
if (tmp2_safe_receiver == null) {
|
|
255
251
|
tmp_1 = null;
|
|
@@ -275,16 +271,84 @@ function emit_7(_this__u8e3s4) {
|
|
|
275
271
|
}
|
|
276
272
|
initMetadataForInterface(JavaTypeDefinitionEmitter, 'JavaTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter]);
|
|
277
273
|
function emit_8(channel) {
|
|
278
|
-
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |@FunctionalInterface\n |public interface ' + this.wq(channel.mo_1) + ' {\n | void invoke(' + emitFullyQualified(this, channel, channel.no_1) + this.
|
|
274
|
+
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |@FunctionalInterface\n |public interface ' + this.wq(channel.mo_1) + ' {\n | void invoke(' + emitFullyQualified(this, channel, channel.no_1) + this.d1v(channel.no_1) + ' message);\n |}\n |\n ');
|
|
279
275
|
}
|
|
280
276
|
initMetadataForInterface(JavaChannelDefinitionEmitter, 'JavaChannelDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
281
|
-
function emit_9(
|
|
277
|
+
function emit_9(endpoint) {
|
|
278
|
+
var tmp = emitImports_0(this, endpoint);
|
|
279
|
+
var tmp_0 = this.wq(endpoint.ep_1);
|
|
280
|
+
var tmp_1 = get_pathParams(endpoint);
|
|
281
|
+
var tmp_2 = emitObject(this, tmp_1, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
|
|
282
|
+
var tmp_3 = emitObject(this, endpoint.hp_1, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
283
|
+
var tmp_4 = emitObject(this, endpoint.ip_1, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
284
|
+
var tmp_5 = this.p1v(first_0(endpoint.jp_1), endpoint);
|
|
285
|
+
var tmp_6 = Spacer_instance.toString();
|
|
286
|
+
var tmp_7 = emitStatusInterfaces(this, endpoint);
|
|
287
|
+
var tmp_8 = emitResponseInterfaces(this, endpoint);
|
|
288
|
+
var tmp_9 = distinctByStatus(endpoint.kp_1);
|
|
289
|
+
var tmp_10 = joinToString(tmp_9, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
290
|
+
var tmp_11 = Spacer_instance.toString();
|
|
291
|
+
var tmp_12 = emitRequestFunctions(this, first_0(endpoint.jp_1), endpoint);
|
|
292
|
+
var tmp_13 = Spacer_instance.qr(2);
|
|
293
|
+
var tmp_14 = distinctByStatus(endpoint.kp_1);
|
|
294
|
+
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
295
|
+
var tmp_16 = Spacer_instance.qr(3);
|
|
296
|
+
var tmp_17 = Spacer_instance.qr(2);
|
|
297
|
+
var tmp_18 = Spacer_instance.qr(2);
|
|
298
|
+
var tmp_19 = emitFromResponse(this, endpoint);
|
|
299
|
+
var tmp_20 = Spacer_instance.qr(2);
|
|
300
|
+
var tmp_21 = Spacer_instance.qr(2);
|
|
301
|
+
var tmp_22 = this.t1v(endpoint);
|
|
302
|
+
var tmp_23 = Spacer_instance.qr(2);
|
|
303
|
+
var tmp_24 = Spacer_instance.qr(3);
|
|
304
|
+
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 ');
|
|
305
|
+
}
|
|
306
|
+
function emitHandleFunction(endpoint) {
|
|
307
|
+
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.pq(this.wq(endpoint.ep_1)) + '(Request request);';
|
|
308
|
+
}
|
|
309
|
+
function emit_10(_this__u8e3s4, endpoint) {
|
|
310
|
+
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 ');
|
|
311
|
+
}
|
|
312
|
+
function emit_11(_this__u8e3s4) {
|
|
313
|
+
var tmp = Spacer_instance.toString();
|
|
314
|
+
var tmp_0 = Companion_instance_1.oq(_this__u8e3s4.qp_1);
|
|
315
|
+
var tmp_1 = Spacer_instance.qr(2);
|
|
316
|
+
var tmp_2 = Spacer_instance.qr(2);
|
|
317
|
+
var tmp_3 = Spacer_instance.qr(2);
|
|
318
|
+
var tmp_4 = emit_16(this, _this__u8e3s4.sp_1);
|
|
319
|
+
var tmp_5 = Spacer_instance.toString();
|
|
320
|
+
var tmp_6 = toString_0(first(_this__u8e3s4.qp_1));
|
|
321
|
+
var tmp_7 = emit_16(this, _this__u8e3s4.sp_1);
|
|
322
|
+
var tmp_8 = concatGenerics(emit_16(this, _this__u8e3s4.sp_1));
|
|
323
|
+
var tmp_9 = Spacer_instance.qr(2);
|
|
324
|
+
var tmp_10 = Companion_instance_1.oq(_this__u8e3s4.qp_1);
|
|
325
|
+
var tmp_11 = orNull(joinToString(_this__u8e3s4.rp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_5(this)));
|
|
326
|
+
var tmp0_safe_receiver = _this__u8e3s4.sp_1;
|
|
327
|
+
var tmp_12;
|
|
328
|
+
if (tmp0_safe_receiver == null) {
|
|
329
|
+
tmp_12 = null;
|
|
330
|
+
} else {
|
|
331
|
+
// Inline function 'kotlin.let' call
|
|
332
|
+
tmp_12 = emit_16(this, tmp0_safe_receiver) + ' body';
|
|
333
|
+
}
|
|
334
|
+
var tmp_13 = joinToString(listOfNotNull([tmp_11, tmp_12]));
|
|
335
|
+
var tmp_14 = Spacer_instance.qr(3);
|
|
336
|
+
var tmp_15 = fixStatus(_this__u8e3s4.qp_1);
|
|
337
|
+
// Inline function 'kotlin.let' call
|
|
338
|
+
var tmp_16 = 'new Headers(' + joinToString(_this__u8e3s4.rp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_6(this)) + ')';
|
|
339
|
+
var tmp_17 = _this__u8e3s4.sp_1 == null ? 'null' : 'body';
|
|
340
|
+
var tmp_18 = Spacer_instance.qr(2);
|
|
341
|
+
var tmp_19 = Spacer_instance.qr(1);
|
|
342
|
+
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 ');
|
|
343
|
+
}
|
|
344
|
+
initMetadataForInterface(JavaEndpointDefinitionEmitter, 'JavaEndpointDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
345
|
+
function emit_12(identifier) {
|
|
282
346
|
var tmp;
|
|
283
347
|
if (identifier instanceof DefinitionIdentifier) {
|
|
284
|
-
tmp = this.
|
|
348
|
+
tmp = this.o1v(identifier.l1());
|
|
285
349
|
} else {
|
|
286
350
|
if (identifier instanceof FieldIdentifier) {
|
|
287
|
-
tmp = this.
|
|
351
|
+
tmp = this.s1v(this.o1v(identifier.l1()));
|
|
288
352
|
} else {
|
|
289
353
|
noWhenBranchMatchedException();
|
|
290
354
|
}
|
|
@@ -306,7 +370,7 @@ function sanitizeSymbol(_this__u8e3s4) {
|
|
|
306
370
|
destination.x(tmp$ret$0);
|
|
307
371
|
}
|
|
308
372
|
var tmp = asSequence(joinToString(destination, ''));
|
|
309
|
-
return this.
|
|
373
|
+
return this.r1v(joinToString_0(filter(tmp, JavaIdentifierEmitter$sanitizeSymbol$lambda), ''));
|
|
310
374
|
}
|
|
311
375
|
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
312
376
|
var tmp;
|
|
@@ -326,33 +390,33 @@ function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
|
326
390
|
return tmp;
|
|
327
391
|
}
|
|
328
392
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
329
|
-
return Companion_getInstance_0().
|
|
393
|
+
return Companion_getInstance_0().u1v_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
330
394
|
}
|
|
331
395
|
initMetadataForInterface(JavaIdentifierEmitter, 'JavaIdentifierEmitter');
|
|
332
|
-
function
|
|
333
|
-
var tmp = this.wq(
|
|
334
|
-
return trimMargin('\n |public
|
|
396
|
+
function emit_13(union) {
|
|
397
|
+
var tmp = this.wq(union.qo_1);
|
|
398
|
+
return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.ro_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
|
|
335
399
|
}
|
|
336
|
-
initMetadataForInterface(
|
|
337
|
-
function
|
|
400
|
+
initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
401
|
+
function emit_14(refined) {
|
|
338
402
|
return trimMargin('\n |public record ' + this.wq(refined.br_1) + ' (' + this.xp(refined.cr_1) + ' value) implements Wirespec.Refined<' + this.xp(refined.cr_1) + '> {\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() { return value.toString(); }\n |' + Spacer_instance.toString() + 'public boolean validate() {\n |' + Spacer_instance.toString() + Spacer_instance.toString() + this.kr(refined) + '\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public ' + this.xp(refined.cr_1) + ' value() { return value; }\n |}\n |\n ');
|
|
339
403
|
}
|
|
340
404
|
function emitValidator(_this__u8e3s4) {
|
|
341
405
|
var defaultReturn = 'return true;';
|
|
342
|
-
var type = _this__u8e3s4.cr_1.
|
|
406
|
+
var type = _this__u8e3s4.cr_1.ou_1;
|
|
343
407
|
var tmp;
|
|
344
408
|
if (type instanceof Integer) {
|
|
345
|
-
var tmp0_safe_receiver = type.
|
|
409
|
+
var tmp0_safe_receiver = type.tt_1;
|
|
346
410
|
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.yp(tmp0_safe_receiver);
|
|
347
411
|
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
348
412
|
} else {
|
|
349
413
|
if (type instanceof Number_0) {
|
|
350
|
-
var tmp2_safe_receiver = type.
|
|
414
|
+
var tmp2_safe_receiver = type.wt_1;
|
|
351
415
|
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.yp(tmp2_safe_receiver);
|
|
352
416
|
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
353
417
|
} else {
|
|
354
418
|
if (type instanceof String_0) {
|
|
355
|
-
var tmp4_safe_receiver = type.
|
|
419
|
+
var tmp4_safe_receiver = type.qt_1;
|
|
356
420
|
var tmp_0;
|
|
357
421
|
var tmp_1 = tmp4_safe_receiver;
|
|
358
422
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
@@ -378,83 +442,14 @@ function emitValidator(_this__u8e3s4) {
|
|
|
378
442
|
return tmp;
|
|
379
443
|
}
|
|
380
444
|
initMetadataForInterface(JavaRefinedTypeDefinitionEmitter, 'JavaRefinedTypeDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
381
|
-
function
|
|
382
|
-
var tmp = this.wq(
|
|
383
|
-
return trimMargin('\n |public
|
|
384
|
-
}
|
|
385
|
-
initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
386
|
-
function emit_13(endpoint) {
|
|
387
|
-
var tmp = emitImports_0(this, endpoint);
|
|
388
|
-
var tmp_0 = this.wq(endpoint.ep_1);
|
|
389
|
-
var tmp_1 = get_pathParams(endpoint);
|
|
390
|
-
var tmp_2 = emitObject(this, tmp_1, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
|
|
391
|
-
var tmp_3 = emitObject(this, endpoint.hp_1, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
392
|
-
var tmp_4 = emitObject(this, endpoint.ip_1, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
393
|
-
var tmp_5 = this.x1v(first_0(endpoint.jp_1), endpoint);
|
|
394
|
-
var tmp_6 = Spacer_instance.toString();
|
|
395
|
-
var tmp_7 = emitStatusInterfaces(this, endpoint);
|
|
396
|
-
var tmp_8 = emitResponseInterfaces(this, endpoint);
|
|
397
|
-
var tmp_9 = distinctByStatus(endpoint.kp_1);
|
|
398
|
-
var tmp_10 = joinToString(tmp_9, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
399
|
-
var tmp_11 = Spacer_instance.toString();
|
|
400
|
-
var tmp_12 = emitRequestFunctions(this, first_0(endpoint.jp_1), endpoint);
|
|
401
|
-
var tmp_13 = Spacer_instance.qr(2);
|
|
402
|
-
var tmp_14 = distinctByStatus(endpoint.kp_1);
|
|
403
|
-
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
404
|
-
var tmp_16 = Spacer_instance.qr(3);
|
|
405
|
-
var tmp_17 = Spacer_instance.qr(2);
|
|
406
|
-
var tmp_18 = Spacer_instance.qr(2);
|
|
407
|
-
var tmp_19 = emitFromResponse(this, endpoint);
|
|
408
|
-
var tmp_20 = Spacer_instance.qr(2);
|
|
409
|
-
var tmp_21 = Spacer_instance.qr(2);
|
|
410
|
-
var tmp_22 = this.b1w(endpoint);
|
|
411
|
-
var tmp_23 = Spacer_instance.qr(2);
|
|
412
|
-
var tmp_24 = Spacer_instance.qr(3);
|
|
413
|
-
return trimMargin('\n |' + tmp + '\n |\n |public interface ' + tmp_0 + ' extends Wirespec.Endpoint {\n |' + tmp_2 + '\n |\n |' + tmp_3 + '\n |\n |' + tmp_4 + '\n |\n |' + tmp_5 + '\n |\n |' + tmp_6 + 'sealed interface Response<T> extends Wirespec.Response<T> {}\n |' + tmp_7 + '\n |' + tmp_8 + '\n |\n |' + tmp_10 + '\n |\n |' + tmp_11 + 'interface Handler extends Wirespec.Handler {\n |\n |' + tmp_12 + '\n |\n |' + tmp_13 + 'static Wirespec.RawResponse toResponse(Wirespec.Serializer serialization, Response<?> response) {\n |' + tmp_15 + '\n |' + tmp_16 + 'else { throw new IllegalStateException("Cannot match response with status: " + response.status());}\n |' + tmp_17 + '}\n |\n |' + tmp_18 + 'static Response<?> fromResponse(Wirespec.Deserializer serialization, Wirespec.RawResponse response) {\n |' + tmp_19 + '\n |' + tmp_20 + '}\n |\n |' + tmp_21 + tmp_22 + '\n |' + tmp_23 + 'class Handlers implements Wirespec.Server<Request, Response<?>>, Wirespec.Client<Request, Response<?>> {\n |' + tmp_24 + '@Override public String getPathTemplate() { return "/' + joinToString(endpoint.gp_1, '/', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_4) + '"; }\n |' + Spacer_instance.qr(3) + '@Override public String getMethod() { return "' + endpoint.fp_1.toString() + '"; }\n |' + Spacer_instance.qr(3) + '@Override public Wirespec.ServerEdge<Request, Response<?>> getServer(Wirespec.Serialization serialization) {\n |' + Spacer_instance.qr(4) + 'return new Wirespec.ServerEdge<>() {\n |' + Spacer_instance.qr(5) + '@Override public Request from(Wirespec.RawRequest request) { return fromRequest(serialization, request); }\n |' + Spacer_instance.qr(5) + '@Override public Wirespec.RawResponse to(Response<?> response) { return toResponse(serialization, response); }\n |' + Spacer_instance.qr(4) + '};\n |' + Spacer_instance.qr(3) + '}\n |' + Spacer_instance.qr(3) + '@Override public Wirespec.ClientEdge<Request, Response<?>> getClient(Wirespec.Serialization serialization) {\n |' + Spacer_instance.qr(4) + 'return new Wirespec.ClientEdge<>() {\n |' + Spacer_instance.qr(5) + '@Override public Wirespec.RawRequest to(Request request) { return toRequest(serialization, request); }\n |' + Spacer_instance.qr(5) + '@Override public Response<?> from(Wirespec.RawResponse response) { return fromResponse(serialization, response); }\n |' + Spacer_instance.qr(4) + '};\n |' + Spacer_instance.qr(3) + '}\n |' + Spacer_instance.qr(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
414
|
-
}
|
|
415
|
-
function emitHandleFunction(endpoint) {
|
|
416
|
-
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.pq(this.wq(endpoint.ep_1)) + '(Request request);';
|
|
417
|
-
}
|
|
418
|
-
function emit_14(_this__u8e3s4, endpoint) {
|
|
419
|
-
return trimMargin('\n |' + Spacer_instance.toString() + 'record Request (\n |' + Spacer_instance.qr(2) + 'Path path,\n |' + Spacer_instance.qr(2) + 'Wirespec.Method method,\n |' + Spacer_instance.qr(2) + 'Queries queries,\n |' + Spacer_instance.qr(2) + 'RequestHeaders headers,\n |' + Spacer_instance.qr(2) + emit_16(this, _this__u8e3s4.np_1) + ' body\n |' + Spacer_instance.toString() + ') implements Wirespec.Request<' + emit_16(this, _this__u8e3s4.np_1) + '> {\n |' + Spacer_instance.qr(2) + emitConstructor(this, _this__u8e3s4, endpoint) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
420
|
-
}
|
|
421
|
-
function emit_15(_this__u8e3s4) {
|
|
422
|
-
var tmp = Spacer_instance.toString();
|
|
423
|
-
var tmp_0 = Companion_instance_1.oq(_this__u8e3s4.qp_1);
|
|
424
|
-
var tmp_1 = Spacer_instance.qr(2);
|
|
425
|
-
var tmp_2 = Spacer_instance.qr(2);
|
|
426
|
-
var tmp_3 = Spacer_instance.qr(2);
|
|
427
|
-
var tmp_4 = emit_16(this, _this__u8e3s4.sp_1);
|
|
428
|
-
var tmp_5 = Spacer_instance.toString();
|
|
429
|
-
var tmp_6 = toString_0(first(_this__u8e3s4.qp_1));
|
|
430
|
-
var tmp_7 = emit_16(this, _this__u8e3s4.sp_1);
|
|
431
|
-
var tmp_8 = concatGenerics(emit_16(this, _this__u8e3s4.sp_1));
|
|
432
|
-
var tmp_9 = Spacer_instance.qr(2);
|
|
433
|
-
var tmp_10 = Companion_instance_1.oq(_this__u8e3s4.qp_1);
|
|
434
|
-
var tmp_11 = orNull(joinToString(_this__u8e3s4.rp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_5(this)));
|
|
435
|
-
var tmp0_safe_receiver = _this__u8e3s4.sp_1;
|
|
436
|
-
var tmp_12;
|
|
437
|
-
if (tmp0_safe_receiver == null) {
|
|
438
|
-
tmp_12 = null;
|
|
439
|
-
} else {
|
|
440
|
-
// Inline function 'kotlin.let' call
|
|
441
|
-
tmp_12 = emit_16(this, tmp0_safe_receiver) + ' body';
|
|
442
|
-
}
|
|
443
|
-
var tmp_13 = joinToString(listOfNotNull([tmp_11, tmp_12]));
|
|
444
|
-
var tmp_14 = Spacer_instance.qr(3);
|
|
445
|
-
var tmp_15 = fixStatus(_this__u8e3s4.qp_1);
|
|
446
|
-
// Inline function 'kotlin.let' call
|
|
447
|
-
var tmp_16 = 'new Headers(' + joinToString(_this__u8e3s4.rp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_6(this)) + ')';
|
|
448
|
-
var tmp_17 = _this__u8e3s4.sp_1 == null ? 'null' : 'body';
|
|
449
|
-
var tmp_18 = Spacer_instance.qr(2);
|
|
450
|
-
var tmp_19 = Spacer_instance.qr(1);
|
|
451
|
-
return trimMargin('\n |' + tmp + 'record Response' + tmp_0 + '(\n |' + tmp_1 + 'Integer status,\n |' + tmp_2 + 'Headers headers,\n |' + tmp_3 + tmp_4 + ' body\n |' + tmp_5 + ') implements Response' + tmp_6 + 'XX<' + tmp_7 + '>, Response' + tmp_8 + ' {\n |' + tmp_9 + 'public Response' + tmp_10 + '(' + tmp_13 + ') {\n |' + tmp_14 + 'this(' + tmp_15 + ', ' + tmp_16 + ', ' + tmp_17 + ');\n |' + tmp_18 + '}\n |' + tmp_19 + emitObject(this, _this__u8e3s4.rp_1, 'Headers', 'Wirespec.Response.Headers', JavaEndpointDefinitionEmitter$emit$lambda_7(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
445
|
+
function emit_15(enum_0, module_0) {
|
|
446
|
+
var tmp = this.wq(enum_0.gr_1);
|
|
447
|
+
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 ');
|
|
452
448
|
}
|
|
453
|
-
initMetadataForInterface(
|
|
454
|
-
initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [
|
|
449
|
+
initMetadataForInterface(JavaEnumDefinitionEmitter, 'JavaEnumDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
450
|
+
initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [JavaEndpointDefinitionEmitter, JavaChannelDefinitionEmitter, JavaIdentifierEmitter, JavaTypeDefinitionEmitter, JavaUnionDefinitionEmitter, JavaRefinedTypeDefinitionEmitter, JavaEnumDefinitionEmitter, LanguageEmitter]);
|
|
455
451
|
initMetadataForCompanion(Companion);
|
|
456
452
|
initMetadataForCompanion(Companion_0);
|
|
457
|
-
initMetadataForClass(JavaIrEmitter$shared$1);
|
|
458
453
|
initMetadataForClass(JavaIrEmitter, 'JavaIrEmitter', JavaIrEmitter, VOID, [IrEmitter]);
|
|
459
454
|
initMetadataForObject(JavaShared, 'JavaShared');
|
|
460
455
|
//endregion
|
|
@@ -466,7 +461,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
466
461
|
var _iterator__ex2g4s = tmp0.t();
|
|
467
462
|
while (_iterator__ex2g4s.u()) {
|
|
468
463
|
var element = _iterator__ex2g4s.v();
|
|
469
|
-
if (!(_this__u8e3s4.vq().l1() === element.
|
|
464
|
+
if (!(_this__u8e3s4.vq().l1() === element.ku_1)) {
|
|
470
465
|
destination.x(element);
|
|
471
466
|
}
|
|
472
467
|
}
|
|
@@ -476,7 +471,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
476
471
|
var _iterator__ex2g4s_0 = destination.t();
|
|
477
472
|
while (_iterator__ex2g4s_0.u()) {
|
|
478
473
|
var item = _iterator__ex2g4s_0.v();
|
|
479
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
474
|
+
var tmp$ret$3 = 'import ' + $this.c1v().mr_1 + '.model.' + item.ku_1 + ';';
|
|
480
475
|
destination_0.x(tmp$ret$3);
|
|
481
476
|
}
|
|
482
477
|
var tmp = destination_0;
|
|
@@ -485,7 +480,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
485
480
|
function emitFullyQualified($this, _this__u8e3s4, reference) {
|
|
486
481
|
var tmp;
|
|
487
482
|
if (_this__u8e3s4.vq().l1() === reference.l1()) {
|
|
488
|
-
tmp = $this.
|
|
483
|
+
tmp = $this.c1v().mr_1 + '.model.';
|
|
489
484
|
} else {
|
|
490
485
|
tmp = '';
|
|
491
486
|
}
|
|
@@ -501,46 +496,46 @@ function JavaEmitter(packageName, emitShared) {
|
|
|
501
496
|
packageName = packageName === VOID ? Companion_instance.lr('community.flock.wirespec.generated') : packageName;
|
|
502
497
|
emitShared = emitShared === VOID ? Companion_instance_0.go() : emitShared;
|
|
503
498
|
LanguageEmitter.call(this);
|
|
504
|
-
this.
|
|
505
|
-
this.
|
|
506
|
-
this.
|
|
507
|
-
this.
|
|
508
|
-
this.
|
|
509
|
-
this.
|
|
510
|
-
}
|
|
511
|
-
protoOf(JavaEmitter).
|
|
512
|
-
return this.
|
|
499
|
+
this.f1v_1 = packageName;
|
|
500
|
+
this.g1v_1 = emitShared;
|
|
501
|
+
this.h1v_1 = '\nimport community.flock.wirespec.java.Wirespec;\n';
|
|
502
|
+
this.i1v_1 = FileExtension_Java_getInstance();
|
|
503
|
+
this.j1v_1 = JavaShared_getInstance();
|
|
504
|
+
this.k1v_1 = '//';
|
|
505
|
+
}
|
|
506
|
+
protoOf(JavaEmitter).c1v = function () {
|
|
507
|
+
return this.f1v_1;
|
|
513
508
|
};
|
|
514
509
|
protoOf(JavaEmitter).eq = function () {
|
|
515
|
-
return this.
|
|
510
|
+
return this.i1v_1;
|
|
516
511
|
};
|
|
517
|
-
protoOf(JavaEmitter).
|
|
518
|
-
return this.
|
|
512
|
+
protoOf(JavaEmitter).l1v = function () {
|
|
513
|
+
return this.j1v_1;
|
|
519
514
|
};
|
|
520
515
|
protoOf(JavaEmitter).fq = function () {
|
|
521
|
-
return this.
|
|
516
|
+
return this.k1v_1;
|
|
522
517
|
};
|
|
523
518
|
protoOf(JavaEmitter).tq = function (module_0, logger) {
|
|
524
519
|
// Inline function 'kotlin.let' call
|
|
525
520
|
var it = protoOf(LanguageEmitter).tq.call(this, module_0, logger);
|
|
526
|
-
return this.
|
|
521
|
+
return this.g1v_1.ho_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.lr('community.flock.wirespec.java').or() + 'Wirespec', this.l1v().n1v_1)) : it;
|
|
527
522
|
};
|
|
528
523
|
protoOf(JavaEmitter).uq = function (definition, module_0, logger) {
|
|
529
524
|
// Inline function 'kotlin.let' call
|
|
530
525
|
var it = protoOf(LanguageEmitter).uq.call(this, definition, module_0, logger);
|
|
531
|
-
var subPackageName = plus(this.
|
|
532
|
-
var tmp = subPackageName.or() + this.
|
|
526
|
+
var subPackageName = plus(this.c1v(), definition);
|
|
527
|
+
var tmp = subPackageName.or() + this.o1v(it.io_1);
|
|
533
528
|
// Inline function 'kotlin.text.trimStart' call
|
|
534
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.qq(module_0) ? this.
|
|
529
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.qq(module_0) ? this.h1v_1 : '') + '\n |' + it.jo_1 + '\n ');
|
|
535
530
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
536
531
|
return new Emitted(tmp, tmp$ret$0);
|
|
537
532
|
};
|
|
538
533
|
function emitGetType($this, _this__u8e3s4) {
|
|
539
|
-
return 'Wirespec.getType(' + $this.
|
|
534
|
+
return 'Wirespec.getType(' + $this.e1v(_this__u8e3s4, 'Void') + '.class, ' + emitGetTypeRaw($this, _this__u8e3s4) + ')';
|
|
540
535
|
}
|
|
541
536
|
function emitGetTypeRaw($this, _this__u8e3s4) {
|
|
542
537
|
var tmp;
|
|
543
|
-
var tmp1_elvis_lhs = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
538
|
+
var tmp1_elvis_lhs = _this__u8e3s4 == null ? null : _this__u8e3s4.cu();
|
|
544
539
|
if (tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs) {
|
|
545
540
|
tmp = 'java.util.Optional.class';
|
|
546
541
|
} else {
|
|
@@ -681,7 +676,7 @@ function emitImports_0($this, _this__u8e3s4) {
|
|
|
681
676
|
var _iterator__ex2g4s = tmp0.t();
|
|
682
677
|
while (_iterator__ex2g4s.u()) {
|
|
683
678
|
var element = _iterator__ex2g4s.v();
|
|
684
|
-
if (!(_this__u8e3s4.vq().l1() === element.
|
|
679
|
+
if (!(_this__u8e3s4.vq().l1() === element.ku_1)) {
|
|
685
680
|
destination.x(element);
|
|
686
681
|
}
|
|
687
682
|
}
|
|
@@ -691,7 +686,7 @@ function emitImports_0($this, _this__u8e3s4) {
|
|
|
691
686
|
var _iterator__ex2g4s_0 = destination.t();
|
|
692
687
|
while (_iterator__ex2g4s_0.u()) {
|
|
693
688
|
var item = _iterator__ex2g4s_0.v();
|
|
694
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
689
|
+
var tmp$ret$3 = 'import ' + $this.c1v().mr_1 + '.model.' + item.ku_1 + ';';
|
|
695
690
|
destination_0.x(tmp$ret$3);
|
|
696
691
|
}
|
|
697
692
|
var tmp = destination_0;
|
|
@@ -812,7 +807,7 @@ function JavaEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
|
812
807
|
}
|
|
813
808
|
function JavaEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
814
809
|
return function (it) {
|
|
815
|
-
return this$0.
|
|
810
|
+
return this$0.q1v(it);
|
|
816
811
|
};
|
|
817
812
|
}
|
|
818
813
|
function JavaEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
@@ -944,7 +939,7 @@ function sanitizeNegative($this, _this__u8e3s4) {
|
|
|
944
939
|
return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
|
|
945
940
|
}
|
|
946
941
|
function sanitizeEnum($this, _this__u8e3s4) {
|
|
947
|
-
return $this.
|
|
942
|
+
return $this.s1v($this.r1v(joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_')));
|
|
948
943
|
}
|
|
949
944
|
function JavaEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
950
945
|
return function (it) {
|
|
@@ -955,7 +950,7 @@ function JavaEnumDefinitionEmitter() {
|
|
|
955
950
|
}
|
|
956
951
|
function Companion() {
|
|
957
952
|
Companion_instance_2 = this;
|
|
958
|
-
this.
|
|
953
|
+
this.u1v_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']);
|
|
959
954
|
}
|
|
960
955
|
var Companion_instance_2;
|
|
961
956
|
function Companion_getInstance_0() {
|
|
@@ -968,64 +963,6 @@ function JavaIdentifierEmitter$sanitizeSymbol$lambda(it) {
|
|
|
968
963
|
}
|
|
969
964
|
function JavaIdentifierEmitter() {
|
|
970
965
|
}
|
|
971
|
-
function JavaIrEmitter$shared$o$clientServer$lambda(name) {
|
|
972
|
-
switch (name.s1h()) {
|
|
973
|
-
case 'client':
|
|
974
|
-
return Companion_getInstance().m1h('getClient');
|
|
975
|
-
case 'server':
|
|
976
|
-
return Companion_getInstance().m1h('getServer');
|
|
977
|
-
default:
|
|
978
|
-
return null;
|
|
979
|
-
}
|
|
980
|
-
}
|
|
981
|
-
function JavaIrEmitter$shared$o$wirespecFile$lambda(this$0) {
|
|
982
|
-
return function (element, transformer) {
|
|
983
|
-
var tmp;
|
|
984
|
-
if (element instanceof File) {
|
|
985
|
-
// Inline function 'kotlin.collections.partition' call
|
|
986
|
-
var this_0 = element.u1m_1;
|
|
987
|
-
var first = ArrayList_init_$Create$();
|
|
988
|
-
var second = ArrayList_init_$Create$();
|
|
989
|
-
var _iterator__ex2g4s = this_0.t();
|
|
990
|
-
while (_iterator__ex2g4s.u()) {
|
|
991
|
-
var element_0 = _iterator__ex2g4s.v();
|
|
992
|
-
if (element_0 instanceof Package) {
|
|
993
|
-
first.x(element_0);
|
|
994
|
-
} else {
|
|
995
|
-
second.x(element_0);
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
var _destruct__k2r9zo = new Pair(first, second);
|
|
999
|
-
var packageElements = _destruct__k2r9zo.ne();
|
|
1000
|
-
var rest = _destruct__k2r9zo.oe();
|
|
1001
|
-
tmp = element.x1m(VOID, plus_1(plus_1(packageElements, this$0.f1w_1), rest));
|
|
1002
|
-
} else {
|
|
1003
|
-
tmp = element;
|
|
1004
|
-
}
|
|
1005
|
-
var transformed = tmp;
|
|
1006
|
-
return transformChildren(transformed, transformer);
|
|
1007
|
-
};
|
|
1008
|
-
}
|
|
1009
|
-
function JavaIrEmitter$shared$o$wirespecFile$lambda_0(this$0) {
|
|
1010
|
-
return function (element, transformer) {
|
|
1011
|
-
var tmp;
|
|
1012
|
-
if (element instanceof Namespace) {
|
|
1013
|
-
var injected = element.z1m_1.equals(Companion_getInstance().m1h('Wirespec')) ? this$0.g1w_1 : emptyList();
|
|
1014
|
-
var tmp_0;
|
|
1015
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1016
|
-
if (!injected.r()) {
|
|
1017
|
-
tmp_0 = withElements(element, plus_1(element.v1m(), injected));
|
|
1018
|
-
} else {
|
|
1019
|
-
tmp_0 = element;
|
|
1020
|
-
}
|
|
1021
|
-
tmp = tmp_0;
|
|
1022
|
-
} else {
|
|
1023
|
-
tmp = element;
|
|
1024
|
-
}
|
|
1025
|
-
var transformed = tmp;
|
|
1026
|
-
return transformChildren(transformed, transformer);
|
|
1027
|
-
};
|
|
1028
|
-
}
|
|
1029
966
|
function sanitizeSymbol_0($this, _this__u8e3s4) {
|
|
1030
967
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
1031
968
|
var this_0 = split(_this__u8e3s4, ['.', ' ', '-']);
|
|
@@ -1077,87 +1014,458 @@ function sanitizeFirstIsDigit_0($this, _this__u8e3s4) {
|
|
|
1077
1014
|
return tmp;
|
|
1078
1015
|
}
|
|
1079
1016
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1080
|
-
return Companion_getInstance_1().
|
|
1017
|
+
return Companion_getInstance_1().v1v_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1081
1018
|
}
|
|
1082
1019
|
function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
1083
1020
|
return sanitizeKeywords_0($this, sanitizeFirstIsDigit_0($this, joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_')));
|
|
1084
1021
|
}
|
|
1085
|
-
function
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1022
|
+
function Companion_0() {
|
|
1023
|
+
Companion_instance_3 = this;
|
|
1024
|
+
this.v1v_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']);
|
|
1025
|
+
}
|
|
1026
|
+
var Companion_instance_3;
|
|
1027
|
+
function Companion_getInstance_1() {
|
|
1028
|
+
if (Companion_instance_3 == null)
|
|
1029
|
+
new Companion_0();
|
|
1030
|
+
return Companion_instance_3;
|
|
1031
|
+
}
|
|
1032
|
+
function JavaIrEmitter$sanitizationConfig$lambda(it) {
|
|
1033
|
+
return '_' + it;
|
|
1034
|
+
}
|
|
1035
|
+
function JavaIrEmitter$sanitizationConfig$lambda_0(name) {
|
|
1036
|
+
return name.m1h_1.a1() > 1 ? new Name(listOf(name.q1l())) : name;
|
|
1037
|
+
}
|
|
1038
|
+
function JavaIrEmitter$sanitizationConfig$lambda_1(name) {
|
|
1039
|
+
return new Name(listOf(name.q1l()));
|
|
1040
|
+
}
|
|
1041
|
+
function JavaIrEmitter$sanitizationConfig$lambda_2(this$0) {
|
|
1042
|
+
return function (it) {
|
|
1043
|
+
return sanitizeSymbol_0(this$0, it);
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
function JavaIrEmitter$sanitizationConfig$lambda_3(stmt, tr) {
|
|
1047
|
+
var tmp;
|
|
1048
|
+
var tmp_0;
|
|
1049
|
+
if (stmt instanceof FunctionCall) {
|
|
1050
|
+
tmp_0 = stmt.a1m_1.r1h() === 'validate';
|
|
1051
|
+
} else {
|
|
1052
|
+
tmp_0 = false;
|
|
1053
|
+
}
|
|
1054
|
+
if (tmp_0) {
|
|
1055
|
+
tmp = transformChildren(stmt.e1m(VOID, emptyList()), tr);
|
|
1056
|
+
} else {
|
|
1057
|
+
tmp = transformChildren(stmt, tr);
|
|
1058
|
+
}
|
|
1059
|
+
return tmp;
|
|
1060
|
+
}
|
|
1061
|
+
function JavaIrEmitter$emitShared$lambda(name) {
|
|
1062
|
+
switch (name.r1h()) {
|
|
1063
|
+
case 'client':
|
|
1064
|
+
return Companion_getInstance().l1h('getClient');
|
|
1065
|
+
case 'server':
|
|
1066
|
+
return Companion_getInstance().l1h('getServer');
|
|
1067
|
+
default:
|
|
1068
|
+
return null;
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
function JavaIrEmitter$emitShared$lambda_0($imports) {
|
|
1072
|
+
return function (element, transformer) {
|
|
1073
|
+
var tmp;
|
|
1074
|
+
if (element instanceof File) {
|
|
1075
|
+
// Inline function 'kotlin.collections.partition' call
|
|
1076
|
+
var this_0 = element.s1m_1;
|
|
1077
|
+
var first = ArrayList_init_$Create$();
|
|
1078
|
+
var second = ArrayList_init_$Create$();
|
|
1079
|
+
var _iterator__ex2g4s = this_0.t();
|
|
1080
|
+
while (_iterator__ex2g4s.u()) {
|
|
1081
|
+
var element_0 = _iterator__ex2g4s.v();
|
|
1082
|
+
if (element_0 instanceof Package) {
|
|
1083
|
+
first.x(element_0);
|
|
1084
|
+
} else {
|
|
1085
|
+
second.x(element_0);
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
var _destruct__k2r9zo = new Pair(first, second);
|
|
1089
|
+
var packageElements = _destruct__k2r9zo.ne();
|
|
1090
|
+
var rest = _destruct__k2r9zo.oe();
|
|
1091
|
+
tmp = element.v1m(VOID, plus_1(plus_1(packageElements, $imports), rest));
|
|
1092
|
+
} else {
|
|
1093
|
+
tmp = element;
|
|
1094
|
+
}
|
|
1095
|
+
var transformed = tmp;
|
|
1096
|
+
return transformChildren_0(transformed, transformer);
|
|
1097
|
+
};
|
|
1098
|
+
}
|
|
1099
|
+
function JavaIrEmitter$emitShared$lambda_1($clientServer) {
|
|
1100
|
+
return function (element, transformer) {
|
|
1101
|
+
var tmp;
|
|
1102
|
+
if (element instanceof Namespace) {
|
|
1103
|
+
var injected = element.x1m_1.equals(Companion_getInstance().l1h('Wirespec')) ? $clientServer : emptyList();
|
|
1104
|
+
var tmp_0;
|
|
1105
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1106
|
+
if (!injected.r()) {
|
|
1107
|
+
tmp_0 = withElements(element, plus_1(element.t1m(), injected));
|
|
1108
|
+
} else {
|
|
1109
|
+
tmp_0 = element;
|
|
1110
|
+
}
|
|
1111
|
+
tmp = tmp_0;
|
|
1112
|
+
} else {
|
|
1113
|
+
tmp = element;
|
|
1114
|
+
}
|
|
1115
|
+
var transformed = tmp;
|
|
1116
|
+
return transformChildren_0(transformed, transformer);
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1119
|
+
function JavaIrEmitter$emit$lambda(this$0) {
|
|
1120
|
+
return function (it) {
|
|
1121
|
+
return sanitizeEnum_0(this$0, it);
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
function JavaIrEmitter$emit$lambda_0(it) {
|
|
1125
|
+
return listOf(function_0('label', VOID, VOID, JavaIrEmitter$emit$lambda$lambda));
|
|
1126
|
+
}
|
|
1127
|
+
function JavaIrEmitter$emit$lambda$lambda($this$function) {
|
|
1128
|
+
$this$function.j1i(String_instance);
|
|
1129
|
+
$this$function.i1k(new VariableReference(Companion_getInstance().l1h('label')));
|
|
1130
|
+
return Unit_instance;
|
|
1131
|
+
}
|
|
1132
|
+
function JavaIrEmitter(packageName, emitShared) {
|
|
1133
|
+
Companion_getInstance_1();
|
|
1134
|
+
packageName = packageName === VOID ? Companion_instance.lr('community.flock.wirespec.generated') : packageName;
|
|
1135
|
+
emitShared = emitShared === VOID ? Companion_instance_0.go() : emitShared;
|
|
1136
|
+
this.w1v_1 = packageName;
|
|
1137
|
+
this.x1v_1 = emitShared;
|
|
1138
|
+
this.y1v_1 = JavaGenerator_instance;
|
|
1139
|
+
this.z1v_1 = FileExtension_Java_getInstance();
|
|
1140
|
+
this.a1w_1 = listOf(import_0('community.flock.wirespec.java', 'Wirespec'));
|
|
1141
|
+
var tmp = this;
|
|
1142
|
+
var tmp_0 = Companion_getInstance_1().v1v_1;
|
|
1143
|
+
var tmp_1 = JavaIrEmitter$sanitizationConfig$lambda;
|
|
1144
|
+
var tmp_2 = JavaIrEmitter$sanitizationConfig$lambda_0;
|
|
1145
|
+
var tmp_3 = JavaIrEmitter$sanitizationConfig$lambda_1;
|
|
1146
|
+
var tmp_4 = JavaIrEmitter$sanitizationConfig$lambda_2(this);
|
|
1147
|
+
tmp.b1w_1 = new SanitizationConfig(tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, JavaIrEmitter$sanitizationConfig$lambda_3);
|
|
1148
|
+
}
|
|
1149
|
+
protoOf(JavaIrEmitter).c1v = function () {
|
|
1150
|
+
return this.w1v_1;
|
|
1151
|
+
};
|
|
1152
|
+
protoOf(JavaIrEmitter).j1u = function () {
|
|
1153
|
+
return this.y1v_1;
|
|
1154
|
+
};
|
|
1155
|
+
protoOf(JavaIrEmitter).eq = function () {
|
|
1156
|
+
return this.z1v_1;
|
|
1157
|
+
};
|
|
1158
|
+
protoOf(JavaIrEmitter).m1u = function () {
|
|
1159
|
+
var packageName = Companion_instance.lr('community.flock.wirespec.java');
|
|
1160
|
+
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')]);
|
|
1161
|
+
// Inline function 'kotlin.collections.map' call
|
|
1162
|
+
var this_0 = convertClientServer(packageName);
|
|
1163
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1164
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1165
|
+
var _iterator__ex2g4s = this_0.t();
|
|
1166
|
+
while (_iterator__ex2g4s.u()) {
|
|
1167
|
+
var item = _iterator__ex2g4s.v();
|
|
1168
|
+
var tmp$ret$0 = toGetterAccessors(item, JavaIrEmitter$emitShared$lambda);
|
|
1169
|
+
destination.x(tmp$ret$0);
|
|
1170
|
+
}
|
|
1171
|
+
var clientServer = plus_2(destination, raw('public static Type getType(final Class<?> actualTypeArguments, final Class<?> rawType) {\n if(rawType != null) {\n return new ParameterizedType() {\n public Type getRawType() { return rawType; }\n public Type[] getActualTypeArguments() { return new Class<?>[]{actualTypeArguments}; }\n public Type getOwnerType() { return null; }\n };\n }\n else { return actualTypeArguments; }\n}'));
|
|
1172
|
+
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1173
|
+
var this_1 = convert(packageName);
|
|
1174
|
+
var scope = new TransformScope(this_1);
|
|
1175
|
+
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1176
|
+
var tmp = scope;
|
|
1177
|
+
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1178
|
+
var this_2 = scope.w1t_1;
|
|
1179
|
+
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1180
|
+
// Inline function 'kotlin.apply' call
|
|
1181
|
+
var this_3 = new TransformerBuilder();
|
|
1182
|
+
this_3.c1h(JavaIrEmitter$emitShared$lambda_0(imports));
|
|
1183
|
+
var tmp$ret$5 = this_3.d1h();
|
|
1184
|
+
tmp.w1t_1 = transform(this_2, tmp$ret$5);
|
|
1185
|
+
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1186
|
+
var tmp_0 = scope;
|
|
1187
|
+
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1188
|
+
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1189
|
+
var this_4 = scope.w1t_1;
|
|
1190
|
+
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1191
|
+
// Inline function 'kotlin.apply' call
|
|
1192
|
+
var this_5 = new TransformerBuilder();
|
|
1193
|
+
this_5.c1h(JavaIrEmitter$emitShared$lambda_1(clientServer));
|
|
1194
|
+
var tmp$ret$10 = this_5.d1h();
|
|
1195
|
+
tmp_0.w1t_1 = transform(this_4, tmp$ret$10);
|
|
1196
|
+
var tmp_1 = scope.w1t_1;
|
|
1197
|
+
var wirespecShared = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1198
|
+
var tmp_2;
|
|
1199
|
+
if (this.x1v_1.ho_1) {
|
|
1200
|
+
tmp_2 = wirespecShared;
|
|
1201
|
+
} else {
|
|
1202
|
+
tmp_2 = null;
|
|
1203
|
+
}
|
|
1204
|
+
return tmp_2;
|
|
1205
|
+
};
|
|
1206
|
+
protoOf(JavaIrEmitter).uq = function (definition, module_0, logger) {
|
|
1207
|
+
var file = emit_0.call(this, definition, module_0, logger);
|
|
1208
|
+
var tmp = file.v1m(Companion_getInstance().l1h(sanitizeSymbol_0(this, file.r1m_1.w1l())));
|
|
1209
|
+
// Inline function 'kotlin.takeIf' call
|
|
1210
|
+
var this_0 = this.a1w_1;
|
|
1211
|
+
var tmp_0;
|
|
1212
|
+
if (Companion_instance_1.qq(module_0)) {
|
|
1213
|
+
tmp_0 = this_0;
|
|
1214
|
+
} else {
|
|
1215
|
+
tmp_0 = null;
|
|
1216
|
+
}
|
|
1217
|
+
var tmp$ret$1 = tmp_0;
|
|
1218
|
+
return placeInPackage(prependImports(tmp, tmp$ret$1), this.c1v(), definition);
|
|
1219
|
+
};
|
|
1220
|
+
protoOf(JavaIrEmitter).up = function (type, module_0) {
|
|
1221
|
+
return sanitizeNames(convertWithValidation(type, module_0), this.b1w_1);
|
|
1222
|
+
};
|
|
1223
|
+
protoOf(JavaIrEmitter).ir = function (enum_0, module_0) {
|
|
1224
|
+
var tmp = convert_0(enum_0);
|
|
1225
|
+
var tmp_0 = JavaIrEmitter$emit$lambda(this);
|
|
1226
|
+
return sanitizeNames(injectEnumLabelField(tmp, tmp_0, JavaIrEmitter$emit$lambda_0), this.b1w_1);
|
|
1227
|
+
};
|
|
1228
|
+
protoOf(JavaIrEmitter).yq = function (union) {
|
|
1229
|
+
return sanitizeNames(convert_1(union), this.b1w_1);
|
|
1230
|
+
};
|
|
1231
|
+
protoOf(JavaIrEmitter).dr = function (refined) {
|
|
1232
|
+
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.b1w_1);
|
|
1233
|
+
};
|
|
1234
|
+
protoOf(JavaIrEmitter).jr = function (endpoint) {
|
|
1235
|
+
var tmp = sanitizeNames(transformTypeDescriptors(injectHandleFunction(convert_3(endpoint), endpoint)), this.b1w_1);
|
|
1236
|
+
// Inline function 'kotlin.takeIf' call
|
|
1237
|
+
var this_0 = buildModelImports(endpoint, this.c1v());
|
|
1238
|
+
var tmp_0;
|
|
1239
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1240
|
+
if (!this_0.r()) {
|
|
1241
|
+
tmp_0 = this_0;
|
|
1242
|
+
} else {
|
|
1243
|
+
tmp_0 = null;
|
|
1244
|
+
}
|
|
1245
|
+
var tmp$ret$2 = tmp_0;
|
|
1246
|
+
return prependImports(tmp, tmp$ret$2);
|
|
1247
|
+
};
|
|
1248
|
+
protoOf(JavaIrEmitter).xq = function (channel) {
|
|
1249
|
+
var tmp;
|
|
1250
|
+
if (channel.mo_1.l1() === channel.no_1.l1()) {
|
|
1251
|
+
tmp = this.c1v().mr_1 + '.model.';
|
|
1252
|
+
} else {
|
|
1253
|
+
tmp = '';
|
|
1254
|
+
}
|
|
1255
|
+
var fullyQualifiedPrefix = tmp;
|
|
1256
|
+
return applyFunctionalInterface(sanitizeNames(convert_4(channel), this.b1w_1), fullyQualifiedPrefix);
|
|
1257
|
+
};
|
|
1258
|
+
protoOf(JavaIrEmitter).o1u = function (endpoint) {
|
|
1259
|
+
var imports = buildModelImports(endpoint, this.c1v());
|
|
1260
|
+
var endpointImport = import_0(this.c1v().mr_1 + '.endpoint', endpoint.ep_1.l1());
|
|
1261
|
+
var endpointName = endpoint.ep_1.l1();
|
|
1262
|
+
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.b1w_1)), endpointName);
|
|
1263
|
+
var subPackageName = plus_0(this.c1v(), 'client');
|
|
1264
|
+
return new File(Companion_getInstance().l1h(subPackageName.or() + sanitizeSymbol_0(this, file.r1m_1.w1l())), plus_1(plus_1(plus_1(plus_1(listOf(new Package(subPackageName.mr_1)), this.a1w_1), imports), listOf(endpointImport)), file.s1m_1));
|
|
1265
|
+
};
|
|
1266
|
+
protoOf(JavaIrEmitter).n1u = function (endpoints, logger) {
|
|
1267
|
+
// Inline function 'kotlin.collections.flatMap' call
|
|
1268
|
+
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1269
|
+
var destination = ArrayList_init_$Create$();
|
|
1270
|
+
var _iterator__ex2g4s = endpoints.t();
|
|
1271
|
+
while (_iterator__ex2g4s.u()) {
|
|
1272
|
+
var element = _iterator__ex2g4s.v();
|
|
1273
|
+
var list = importReferences(element);
|
|
1274
|
+
addAll(destination, list);
|
|
1275
|
+
}
|
|
1276
|
+
// Inline function 'kotlin.collections.distinctBy' call
|
|
1277
|
+
var set = HashSet_init_$Create$();
|
|
1278
|
+
var list_0 = ArrayList_init_$Create$();
|
|
1100
1279
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1101
1280
|
while (_iterator__ex2g4s_0.u()) {
|
|
1102
|
-
var
|
|
1103
|
-
var
|
|
1104
|
-
|
|
1281
|
+
var e = _iterator__ex2g4s_0.v();
|
|
1282
|
+
var key = e.ku_1;
|
|
1283
|
+
if (set.x(key)) {
|
|
1284
|
+
list_0.x(e);
|
|
1285
|
+
}
|
|
1105
1286
|
}
|
|
1106
|
-
|
|
1287
|
+
// Inline function 'kotlin.collections.filter' call
|
|
1288
|
+
// Inline function 'kotlin.collections.filterTo' call
|
|
1289
|
+
var destination_0 = ArrayList_init_$Create$();
|
|
1290
|
+
var _iterator__ex2g4s_1 = list_0.t();
|
|
1291
|
+
while (_iterator__ex2g4s_1.u()) {
|
|
1292
|
+
var element_0 = _iterator__ex2g4s_1.v();
|
|
1293
|
+
var tmp$ret$5;
|
|
1294
|
+
$l$block_0: {
|
|
1295
|
+
// Inline function 'kotlin.collections.none' call
|
|
1296
|
+
var tmp;
|
|
1297
|
+
if (isInterface(endpoints, Collection)) {
|
|
1298
|
+
tmp = endpoints.r();
|
|
1299
|
+
} else {
|
|
1300
|
+
tmp = false;
|
|
1301
|
+
}
|
|
1302
|
+
if (tmp) {
|
|
1303
|
+
tmp$ret$5 = true;
|
|
1304
|
+
break $l$block_0;
|
|
1305
|
+
}
|
|
1306
|
+
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1307
|
+
while (_iterator__ex2g4s_2.u()) {
|
|
1308
|
+
var element_1 = _iterator__ex2g4s_2.v();
|
|
1309
|
+
if (element_1.ep_1.l1() === element_0.ku_1) {
|
|
1310
|
+
tmp$ret$5 = false;
|
|
1311
|
+
break $l$block_0;
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
tmp$ret$5 = true;
|
|
1315
|
+
}
|
|
1316
|
+
if (tmp$ret$5) {
|
|
1317
|
+
destination_0.x(element_0);
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
// Inline function 'kotlin.collections.map' call
|
|
1321
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1322
|
+
var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_0, 10));
|
|
1323
|
+
var _iterator__ex2g4s_3 = destination_0.t();
|
|
1324
|
+
while (_iterator__ex2g4s_3.u()) {
|
|
1325
|
+
var item = _iterator__ex2g4s_3.v();
|
|
1326
|
+
var tmp$ret$10 = import_0(this.c1v().mr_1 + '.model', item.ku_1);
|
|
1327
|
+
destination_1.x(tmp$ret$10);
|
|
1328
|
+
}
|
|
1329
|
+
var imports = destination_1;
|
|
1330
|
+
// Inline function 'kotlin.collections.map' call
|
|
1331
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1332
|
+
var destination_2 = ArrayList_init_$Create$_0(collectionSizeOrDefault(endpoints, 10));
|
|
1333
|
+
var _iterator__ex2g4s_4 = endpoints.t();
|
|
1334
|
+
while (_iterator__ex2g4s_4.u()) {
|
|
1335
|
+
var item_0 = _iterator__ex2g4s_4.v();
|
|
1336
|
+
var tmp$ret$13 = import_0(this.c1v().mr_1 + '.endpoint', item_0.ep_1.l1());
|
|
1337
|
+
destination_2.x(tmp$ret$13);
|
|
1338
|
+
}
|
|
1339
|
+
var endpointImports = destination_2;
|
|
1340
|
+
// Inline function 'kotlin.collections.map' call
|
|
1341
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1342
|
+
var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(endpoints, 10));
|
|
1343
|
+
var _iterator__ex2g4s_5 = endpoints.t();
|
|
1344
|
+
while (_iterator__ex2g4s_5.u()) {
|
|
1345
|
+
var item_1 = _iterator__ex2g4s_5.v();
|
|
1346
|
+
var tmp$ret$16 = import_0(this.c1v().mr_1 + '.client', item_1.ep_1.l1() + 'Client');
|
|
1347
|
+
destination_3.x(tmp$ret$16);
|
|
1348
|
+
}
|
|
1349
|
+
var clientImports = destination_3;
|
|
1350
|
+
var allImports = plus_1(plus_1(imports, endpointImports), clientImports);
|
|
1351
|
+
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.b1w_1);
|
|
1352
|
+
return new File(Companion_getInstance().l1h(this.c1v().or() + sanitizeSymbol_0(this, file.r1m_1.w1l())), plus_1(plus_1(plus_1(listOf(new Package(this.c1v().mr_1)), this.a1w_1), allImports), file.s1m_1));
|
|
1353
|
+
};
|
|
1354
|
+
function transformTypeDescriptors(_this__u8e3s4) {
|
|
1355
|
+
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1356
|
+
var scope = new TransformScope(_this__u8e3s4);
|
|
1357
|
+
scope.f1u(transformTypeDescriptors$lambda);
|
|
1358
|
+
var tmp = scope.w1t_1;
|
|
1359
|
+
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1107
1360
|
}
|
|
1108
|
-
function
|
|
1109
|
-
var handlersStruct = buildHandlers($this, endpoint);
|
|
1361
|
+
function applyRefinedStructShape(_this__u8e3s4, refined) {
|
|
1110
1362
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1111
1363
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1112
1364
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1113
1365
|
var tmp = scope;
|
|
1114
1366
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1115
|
-
var this_0 = scope.
|
|
1367
|
+
var this_0 = scope.w1t_1;
|
|
1116
1368
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1117
1369
|
// Inline function 'kotlin.apply' call
|
|
1118
1370
|
var this_1 = new TransformerBuilder();
|
|
1119
|
-
this_1.
|
|
1120
|
-
var tmp$ret$2 = this_1.
|
|
1121
|
-
tmp.
|
|
1122
|
-
var tmp_0 = scope.
|
|
1371
|
+
this_1.c1h(applyRefinedStructShape$lambda(refined));
|
|
1372
|
+
var tmp$ret$2 = this_1.d1h();
|
|
1373
|
+
tmp.w1t_1 = transform(this_0, tmp$ret$2);
|
|
1374
|
+
var tmp_0 = scope.w1t_1;
|
|
1123
1375
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1124
1376
|
}
|
|
1125
|
-
function
|
|
1126
|
-
var
|
|
1127
|
-
|
|
1377
|
+
function injectHandleFunction(_this__u8e3s4, endpoint) {
|
|
1378
|
+
var handlersStruct = buildHandlersStruct(endpoint);
|
|
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.matchingElements' call
|
|
1382
|
+
var tmp = scope;
|
|
1383
|
+
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1384
|
+
var this_0 = scope.w1t_1;
|
|
1385
|
+
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1386
|
+
// Inline function 'kotlin.apply' call
|
|
1387
|
+
var this_1 = new TransformerBuilder();
|
|
1388
|
+
this_1.c1h(injectHandleFunction$lambda(handlersStruct));
|
|
1389
|
+
var tmp$ret$2 = this_1.d1h();
|
|
1390
|
+
tmp.w1t_1 = transform(this_0, tmp$ret$2);
|
|
1391
|
+
var tmp_0 = scope.w1t_1;
|
|
1392
|
+
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1128
1393
|
}
|
|
1129
|
-
function
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
tmp = _this__u8e3s4;
|
|
1394
|
+
function buildModelImports(_this__u8e3s4, packageName) {
|
|
1395
|
+
// Inline function 'kotlin.collections.filter' call
|
|
1396
|
+
var tmp0 = importReferences(_this__u8e3s4);
|
|
1397
|
+
// Inline function 'kotlin.collections.filterTo' call
|
|
1398
|
+
var destination = ArrayList_init_$Create$();
|
|
1399
|
+
var _iterator__ex2g4s = tmp0.t();
|
|
1400
|
+
while (_iterator__ex2g4s.u()) {
|
|
1401
|
+
var element = _iterator__ex2g4s.v();
|
|
1402
|
+
if (!(_this__u8e3s4.vq().l1() === element.ku_1)) {
|
|
1403
|
+
destination.x(element);
|
|
1404
|
+
}
|
|
1141
1405
|
}
|
|
1142
|
-
|
|
1406
|
+
// Inline function 'kotlin.collections.map' call
|
|
1407
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1408
|
+
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
|
|
1409
|
+
var _iterator__ex2g4s_0 = destination.t();
|
|
1410
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
1411
|
+
var item = _iterator__ex2g4s_0.v();
|
|
1412
|
+
var tmp$ret$3 = import_0(packageName.mr_1 + '.model', item.ku_1);
|
|
1413
|
+
destination_0.x(tmp$ret$3);
|
|
1414
|
+
}
|
|
1415
|
+
return destination_0;
|
|
1143
1416
|
}
|
|
1144
|
-
function
|
|
1417
|
+
function applyFunctionalInterface(_this__u8e3s4, fullyQualifiedPrefix) {
|
|
1145
1418
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1146
1419
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1147
|
-
|
|
1148
|
-
var tmp = scope
|
|
1149
|
-
|
|
1420
|
+
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1421
|
+
var tmp = scope;
|
|
1422
|
+
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1423
|
+
var this_0 = scope.w1t_1;
|
|
1424
|
+
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1425
|
+
// Inline function 'kotlin.apply' call
|
|
1426
|
+
var this_1 = new TransformerBuilder();
|
|
1427
|
+
this_1.c1h(applyFunctionalInterface$lambda(fullyQualifiedPrefix));
|
|
1428
|
+
var tmp$ret$2 = this_1.d1h();
|
|
1429
|
+
tmp.w1t_1 = transform(this_0, tmp$ret$2);
|
|
1430
|
+
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1431
|
+
var tmp_0 = scope;
|
|
1432
|
+
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1433
|
+
var this_2 = scope.w1t_1;
|
|
1434
|
+
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1435
|
+
// Inline function 'kotlin.apply' call
|
|
1436
|
+
var this_3 = new TransformerBuilder();
|
|
1437
|
+
this_3.c1h(applyFunctionalInterface$lambda_0);
|
|
1438
|
+
var tmp$ret$7 = this_3.d1h();
|
|
1439
|
+
tmp_0.w1t_1 = transform(this_2, tmp$ret$7);
|
|
1440
|
+
var tmp_1 = scope.w1t_1;
|
|
1441
|
+
return isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1442
|
+
}
|
|
1443
|
+
function wrapAsyncReturnInThenApply(_this__u8e3s4, endpointName) {
|
|
1444
|
+
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1445
|
+
var scope = new TransformScope(_this__u8e3s4);
|
|
1446
|
+
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1447
|
+
var tmp = scope;
|
|
1448
|
+
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1449
|
+
var this_0 = scope.w1t_1;
|
|
1450
|
+
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1451
|
+
// Inline function 'kotlin.apply' call
|
|
1452
|
+
var this_1 = new TransformerBuilder();
|
|
1453
|
+
this_1.c1h(wrapAsyncReturnInThenApply$lambda(endpointName));
|
|
1454
|
+
var tmp$ret$2 = this_1.d1h();
|
|
1455
|
+
tmp.w1t_1 = transform(this_0, tmp$ret$2);
|
|
1456
|
+
var tmp_0 = scope.w1t_1;
|
|
1457
|
+
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1150
1458
|
}
|
|
1151
|
-
function findRoot(
|
|
1459
|
+
function findRoot(_this__u8e3s4) {
|
|
1152
1460
|
var tmp;
|
|
1153
1461
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
1154
|
-
tmp = findRoot(
|
|
1462
|
+
tmp = findRoot(_this__u8e3s4.n1h_1);
|
|
1155
1463
|
} else {
|
|
1156
1464
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
1157
|
-
tmp = findRoot(
|
|
1465
|
+
tmp = findRoot(_this__u8e3s4.o1h_1);
|
|
1158
1466
|
} else {
|
|
1159
1467
|
if (_this__u8e3s4 instanceof Dict_0) {
|
|
1160
|
-
tmp = findRoot(
|
|
1468
|
+
tmp = findRoot(_this__u8e3s4.j1m_1);
|
|
1161
1469
|
} else {
|
|
1162
1470
|
tmp = _this__u8e3s4;
|
|
1163
1471
|
}
|
|
@@ -1165,7 +1473,7 @@ function findRoot($this, _this__u8e3s4) {
|
|
|
1165
1473
|
}
|
|
1166
1474
|
return tmp;
|
|
1167
1475
|
}
|
|
1168
|
-
function rawContainerClass(
|
|
1476
|
+
function rawContainerClass(_this__u8e3s4) {
|
|
1169
1477
|
var tmp;
|
|
1170
1478
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
1171
1479
|
tmp = 'java.util.Optional';
|
|
@@ -1182,11 +1490,11 @@ function rawContainerClass($this, _this__u8e3s4) {
|
|
|
1182
1490
|
}
|
|
1183
1491
|
return tmp;
|
|
1184
1492
|
}
|
|
1185
|
-
function toJavaName(
|
|
1493
|
+
function toJavaName(_this__u8e3s4) {
|
|
1186
1494
|
var tmp;
|
|
1187
1495
|
if (_this__u8e3s4 instanceof Integer_0) {
|
|
1188
1496
|
var tmp_0;
|
|
1189
|
-
switch (_this__u8e3s4.
|
|
1497
|
+
switch (_this__u8e3s4.f1m_1.b3_1) {
|
|
1190
1498
|
case 0:
|
|
1191
1499
|
tmp_0 = 'Integer';
|
|
1192
1500
|
break;
|
|
@@ -1201,7 +1509,7 @@ function toJavaName($this, _this__u8e3s4) {
|
|
|
1201
1509
|
} else {
|
|
1202
1510
|
if (_this__u8e3s4 instanceof Number_1) {
|
|
1203
1511
|
var tmp_1;
|
|
1204
|
-
switch (_this__u8e3s4.
|
|
1512
|
+
switch (_this__u8e3s4.g1m_1.b3_1) {
|
|
1205
1513
|
case 0:
|
|
1206
1514
|
tmp_1 = 'Float';
|
|
1207
1515
|
break;
|
|
@@ -1230,7 +1538,7 @@ function toJavaName($this, _this__u8e3s4) {
|
|
|
1230
1538
|
tmp = 'Void';
|
|
1231
1539
|
} else {
|
|
1232
1540
|
if (_this__u8e3s4 instanceof Custom_0) {
|
|
1233
|
-
tmp = _this__u8e3s4.
|
|
1541
|
+
tmp = _this__u8e3s4.p1h_1;
|
|
1234
1542
|
} else {
|
|
1235
1543
|
tmp = 'Object';
|
|
1236
1544
|
}
|
|
@@ -1243,188 +1551,149 @@ function toJavaName($this, _this__u8e3s4) {
|
|
|
1243
1551
|
}
|
|
1244
1552
|
return tmp;
|
|
1245
1553
|
}
|
|
1246
|
-
function
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
}
|
|
1250
|
-
var Companion_instance_3;
|
|
1251
|
-
function Companion_getInstance_1() {
|
|
1252
|
-
if (Companion_instance_3 == null)
|
|
1253
|
-
new Companion_0();
|
|
1254
|
-
return Companion_instance_3;
|
|
1255
|
-
}
|
|
1256
|
-
function JavaIrEmitter$sanitizationConfig$lambda(it) {
|
|
1257
|
-
return '_' + it;
|
|
1258
|
-
}
|
|
1259
|
-
function JavaIrEmitter$sanitizationConfig$lambda_0(name) {
|
|
1260
|
-
return name.n1h_1.a1() > 1 ? new Name(listOf(name.r1l())) : name;
|
|
1261
|
-
}
|
|
1262
|
-
function JavaIrEmitter$sanitizationConfig$lambda_1(name) {
|
|
1263
|
-
return new Name(listOf(name.r1l()));
|
|
1264
|
-
}
|
|
1265
|
-
function JavaIrEmitter$sanitizationConfig$lambda_2(this$0) {
|
|
1266
|
-
return function (it) {
|
|
1267
|
-
return sanitizeSymbol_0(this$0, it);
|
|
1268
|
-
};
|
|
1554
|
+
function buildHandlersStruct(_this__u8e3s4) {
|
|
1555
|
+
var pathTemplate = '/' + joinToString(_this__u8e3s4.gp_1, '/', VOID, VOID, VOID, VOID, buildHandlersStruct$lambda);
|
|
1556
|
+
return struct('Handlers', buildHandlersStruct$lambda_0(pathTemplate, _this__u8e3s4));
|
|
1269
1557
|
}
|
|
1270
|
-
function
|
|
1558
|
+
function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
1271
1559
|
var tmp;
|
|
1272
|
-
|
|
1273
|
-
if (
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
tmp_0 =
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
tmp =
|
|
1560
|
+
// Inline function 'kotlin.text.isNotEmpty' call
|
|
1561
|
+
if (charSequenceLength(prefix) > 0) {
|
|
1562
|
+
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1563
|
+
var scope = new TransformScope(_this__u8e3s4);
|
|
1564
|
+
var tmp_0 = withFullyQualifiedPrefix$lambda;
|
|
1565
|
+
scope.z1t(tmp_0, withFullyQualifiedPrefix$lambda_0(prefix));
|
|
1566
|
+
var tmp_1 = scope.w1t_1;
|
|
1567
|
+
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1280
1568
|
} else {
|
|
1281
|
-
tmp =
|
|
1569
|
+
tmp = _this__u8e3s4;
|
|
1282
1570
|
}
|
|
1283
1571
|
return tmp;
|
|
1284
1572
|
}
|
|
1285
|
-
function
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
var _iterator__ex2g4s = this_0.t();
|
|
1295
|
-
while (_iterator__ex2g4s.u()) {
|
|
1296
|
-
var item = _iterator__ex2g4s.v();
|
|
1297
|
-
var tmp$ret$0 = toGetterAccessors(item, JavaIrEmitter$shared$o$clientServer$lambda);
|
|
1298
|
-
destination.x(tmp$ret$0);
|
|
1299
|
-
}
|
|
1300
|
-
tmp.g1w_1 = plus_1(destination, listOf(raw('public static Type getType(final Class<?> actualTypeArguments, final Class<?> rawType) {\n if(rawType != null) {\n return new ParameterizedType() {\n public Type getRawType() { return rawType; }\n public Type[] getActualTypeArguments() { return new Class<?>[]{actualTypeArguments}; }\n public Type getOwnerType() { return null; }\n };\n }\n else { return actualTypeArguments; }\n}')));
|
|
1301
|
-
var tmp_0 = this;
|
|
1302
|
-
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1303
|
-
var this_1 = this.e1w_1;
|
|
1304
|
-
var scope = new TransformScope(this_1);
|
|
1305
|
-
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1306
|
-
var tmp_1 = scope;
|
|
1307
|
-
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1308
|
-
var this_2 = scope.z1t_1;
|
|
1309
|
-
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1310
|
-
// Inline function 'kotlin.apply' call
|
|
1311
|
-
var this_3 = new TransformerBuilder();
|
|
1312
|
-
this_3.d1h(JavaIrEmitter$shared$o$wirespecFile$lambda(this));
|
|
1313
|
-
var tmp$ret$5 = this_3.e1h();
|
|
1314
|
-
tmp_1.z1t_1 = transform(this_2, tmp$ret$5);
|
|
1315
|
-
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1316
|
-
var tmp_2 = scope;
|
|
1317
|
-
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1318
|
-
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1319
|
-
var this_4 = scope.z1t_1;
|
|
1320
|
-
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1321
|
-
// Inline function 'kotlin.apply' call
|
|
1322
|
-
var this_5 = new TransformerBuilder();
|
|
1323
|
-
this_5.d1h(JavaIrEmitter$shared$o$wirespecFile$lambda_0(this));
|
|
1324
|
-
var tmp$ret$10 = this_5.e1h();
|
|
1325
|
-
tmp_2.z1t_1 = transform(this_4, tmp$ret$10);
|
|
1326
|
-
var tmp_3 = scope.z1t_1;
|
|
1327
|
-
tmp_0.h1w_1 = isInterface(tmp_3, Element) ? tmp_3 : THROW_CCE();
|
|
1328
|
-
this.i1w_1 = generateJava(this.h1w_1);
|
|
1329
|
-
}
|
|
1330
|
-
protoOf(JavaIrEmitter$shared$1).r1w = function () {
|
|
1331
|
-
return this.i1w_1;
|
|
1332
|
-
};
|
|
1333
|
-
function JavaIrEmitter$emit$lambda(this$0) {
|
|
1334
|
-
return function () {
|
|
1335
|
-
return new File(Companion_getInstance().m1h(Companion_instance.lr('community.flock.wirespec.java').or() + 'Wirespec'), listOf(new RawElement(this$0.t1v().r1w())));
|
|
1336
|
-
};
|
|
1337
|
-
}
|
|
1338
|
-
function JavaIrEmitter$emit$lambda$lambda(this$0) {
|
|
1339
|
-
return function (it) {
|
|
1340
|
-
return sanitizeEnum_0(this$0, it);
|
|
1341
|
-
};
|
|
1342
|
-
}
|
|
1343
|
-
function JavaIrEmitter$emit$lambda$lambda_0($this$function) {
|
|
1344
|
-
$this$function.k1i(String_instance);
|
|
1345
|
-
$this$function.j1k(new VariableReference(Companion_getInstance().m1h('label')));
|
|
1346
|
-
return Unit_instance;
|
|
1347
|
-
}
|
|
1348
|
-
function JavaIrEmitter$emit$lambda_0(this$0) {
|
|
1349
|
-
return function (element, transformer) {
|
|
1350
|
-
var tmp;
|
|
1351
|
-
if (element instanceof Enum) {
|
|
1352
|
-
var tmp_0 = withLabelField(element, JavaIrEmitter$emit$lambda$lambda(this$0));
|
|
1353
|
-
tmp = plus_3(tmp_0, function_0('label', VOID, VOID, JavaIrEmitter$emit$lambda$lambda_0));
|
|
1573
|
+
function transformTypeDescriptors$lambda(stmt, tr) {
|
|
1574
|
+
var tmp;
|
|
1575
|
+
if (stmt instanceof TypeDescriptor) {
|
|
1576
|
+
var rootType = findRoot(stmt.g1o_1);
|
|
1577
|
+
var containerStr = rawContainerClass(stmt.g1o_1);
|
|
1578
|
+
var rootStr = toJavaName(rootType) + '.class';
|
|
1579
|
+
var tmp_0;
|
|
1580
|
+
if (containerStr == null) {
|
|
1581
|
+
tmp_0 = null;
|
|
1354
1582
|
} else {
|
|
1355
|
-
|
|
1583
|
+
// Inline function 'kotlin.let' call
|
|
1584
|
+
tmp_0 = containerStr + '.class';
|
|
1356
1585
|
}
|
|
1357
|
-
var
|
|
1358
|
-
|
|
1359
|
-
|
|
1586
|
+
var tmp2_elvis_lhs = tmp_0;
|
|
1587
|
+
var containerArg = tmp2_elvis_lhs == null ? 'null' : tmp2_elvis_lhs;
|
|
1588
|
+
tmp = new RawExpression('Wirespec.getType(' + rootStr + ', ' + containerArg + ')');
|
|
1589
|
+
} else {
|
|
1590
|
+
tmp = transformChildren(stmt, tr);
|
|
1591
|
+
}
|
|
1592
|
+
return tmp;
|
|
1360
1593
|
}
|
|
1361
|
-
function
|
|
1594
|
+
function applyRefinedStructShape$lambda$lambda($refined) {
|
|
1362
1595
|
return function ($this$function) {
|
|
1363
|
-
$this$function.
|
|
1364
|
-
$this$function.
|
|
1596
|
+
$this$function.j1i(convert_5($refined.cr_1));
|
|
1597
|
+
$this$function.i1k(new VariableReference(Companion_getInstance().l1h('value')));
|
|
1365
1598
|
return Unit_instance;
|
|
1366
1599
|
};
|
|
1367
1600
|
}
|
|
1368
|
-
function
|
|
1601
|
+
function applyRefinedStructShape$lambda($refined) {
|
|
1369
1602
|
return function (element, transformer) {
|
|
1370
1603
|
var tmp;
|
|
1371
1604
|
if (element instanceof Struct) {
|
|
1372
1605
|
var tmp_0 = listOf(new Custom_0('Wirespec.Refined'));
|
|
1373
1606
|
// Inline function 'kotlin.collections.map' call
|
|
1374
|
-
var this_0 = element.
|
|
1607
|
+
var this_0 = element.g1n_1;
|
|
1375
1608
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1376
1609
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1377
1610
|
var _iterator__ex2g4s = this_0.t();
|
|
1378
1611
|
while (_iterator__ex2g4s.u()) {
|
|
1379
1612
|
var item = _iterator__ex2g4s.v();
|
|
1380
|
-
var
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
} else {
|
|
1384
|
-
tmp_1 = item;
|
|
1385
|
-
}
|
|
1386
|
-
var tmp$ret$0 = tmp_1;
|
|
1613
|
+
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
1614
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.a1k(VOID, VOID, VOID, VOID, VOID, VOID, VOID, true);
|
|
1615
|
+
var tmp$ret$0 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
1387
1616
|
destination.x(tmp$ret$0);
|
|
1388
1617
|
}
|
|
1389
|
-
var
|
|
1390
|
-
tmp = plus_3(
|
|
1618
|
+
var tmp_1 = element.i1n(VOID, VOID, VOID, tmp_0, destination);
|
|
1619
|
+
tmp = plus_3(tmp_1, function_0('value', VOID, true, applyRefinedStructShape$lambda$lambda($refined)));
|
|
1620
|
+
} else {
|
|
1621
|
+
tmp = element;
|
|
1622
|
+
}
|
|
1623
|
+
var transformed = tmp;
|
|
1624
|
+
return transformChildren_0(transformed, transformer);
|
|
1625
|
+
};
|
|
1626
|
+
}
|
|
1627
|
+
function injectHandleFunction$lambda$lambda($handlersStruct) {
|
|
1628
|
+
return function (element, transformer) {
|
|
1629
|
+
var tmp;
|
|
1630
|
+
if (element instanceof Interface) {
|
|
1631
|
+
var injected = listOf($handlersStruct);
|
|
1632
|
+
var tmp_0;
|
|
1633
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1634
|
+
if (!injected.r()) {
|
|
1635
|
+
tmp_0 = withElements(element, plus_1(element.t1m(), injected));
|
|
1636
|
+
} else {
|
|
1637
|
+
tmp_0 = element;
|
|
1638
|
+
}
|
|
1639
|
+
tmp = tmp_0;
|
|
1391
1640
|
} else {
|
|
1392
1641
|
tmp = element;
|
|
1393
1642
|
}
|
|
1394
1643
|
var transformed = tmp;
|
|
1395
|
-
return
|
|
1644
|
+
return transformChildren_0(transformed, transformer);
|
|
1396
1645
|
};
|
|
1397
1646
|
}
|
|
1398
|
-
function
|
|
1647
|
+
function injectHandleFunction$lambda($handlersStruct) {
|
|
1399
1648
|
return function (element, transformer) {
|
|
1400
1649
|
var tmp;
|
|
1401
|
-
if (element instanceof
|
|
1402
|
-
|
|
1650
|
+
if (element instanceof Interface) {
|
|
1651
|
+
var tmp_0;
|
|
1652
|
+
if (element.j1n_1.equals(Companion_getInstance().l1h('Handler'))) {
|
|
1653
|
+
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1654
|
+
var scope = new TransformScope(element);
|
|
1655
|
+
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1656
|
+
var tmp_1 = scope;
|
|
1657
|
+
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1658
|
+
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1659
|
+
var this_0 = scope.w1t_1;
|
|
1660
|
+
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1661
|
+
// Inline function 'kotlin.apply' call
|
|
1662
|
+
var this_1 = new TransformerBuilder();
|
|
1663
|
+
this_1.c1h(injectHandleFunction$lambda$lambda($handlersStruct));
|
|
1664
|
+
var tmp$ret$2 = this_1.d1h();
|
|
1665
|
+
tmp_1.w1t_1 = transform(this_0, tmp$ret$2);
|
|
1666
|
+
var tmp_2 = scope.w1t_1;
|
|
1667
|
+
tmp_0 = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1668
|
+
} else {
|
|
1669
|
+
tmp_0 = element;
|
|
1670
|
+
}
|
|
1671
|
+
tmp = tmp_0;
|
|
1403
1672
|
} else {
|
|
1404
1673
|
tmp = element;
|
|
1405
1674
|
}
|
|
1406
1675
|
var transformed = tmp;
|
|
1407
|
-
return
|
|
1676
|
+
return transformChildren_0(transformed, transformer);
|
|
1408
1677
|
};
|
|
1409
1678
|
}
|
|
1410
|
-
function
|
|
1679
|
+
function applyFunctionalInterface$lambda($fullyQualifiedPrefix) {
|
|
1411
1680
|
return function (element, transformer) {
|
|
1412
1681
|
var tmp;
|
|
1413
1682
|
if (element instanceof Interface) {
|
|
1414
|
-
tmp = withFullyQualifiedPrefix(
|
|
1683
|
+
tmp = withFullyQualifiedPrefix(element, $fullyQualifiedPrefix);
|
|
1415
1684
|
} else {
|
|
1416
1685
|
tmp = element;
|
|
1417
1686
|
}
|
|
1418
1687
|
var transformed = tmp;
|
|
1419
|
-
return
|
|
1688
|
+
return transformChildren_0(transformed, transformer);
|
|
1420
1689
|
};
|
|
1421
1690
|
}
|
|
1422
|
-
function
|
|
1691
|
+
function applyFunctionalInterface$lambda_0(element, transformer) {
|
|
1423
1692
|
var tmp;
|
|
1424
1693
|
if (element instanceof File) {
|
|
1425
1694
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1426
1695
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1427
|
-
var tmp0 = element.
|
|
1696
|
+
var tmp0 = element.t1m();
|
|
1428
1697
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1429
1698
|
var destination = ArrayList_init_$Create$();
|
|
1430
1699
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1436,102 +1705,53 @@ function JavaIrEmitter$emit$lambda_4(element, transformer) {
|
|
|
1436
1705
|
}
|
|
1437
1706
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1438
1707
|
var interfaceElement = ensureNotNull(tmp$ret$2);
|
|
1439
|
-
tmp = element.
|
|
1708
|
+
tmp = element.v1m(VOID, listOf_0([new RawElement('@FunctionalInterface\n'), interfaceElement]));
|
|
1440
1709
|
} else {
|
|
1441
1710
|
tmp = element;
|
|
1442
1711
|
}
|
|
1443
1712
|
var transformed = tmp;
|
|
1444
|
-
return
|
|
1713
|
+
return transformChildren_0(transformed, transformer);
|
|
1445
1714
|
}
|
|
1446
|
-
function
|
|
1715
|
+
function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
1447
1716
|
return function (element, transformer) {
|
|
1448
1717
|
var tmp;
|
|
1449
1718
|
if (element instanceof Function) {
|
|
1450
|
-
var
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1719
|
+
var tmp$ret$0;
|
|
1720
|
+
$l$block_1: {
|
|
1721
|
+
if (!element.x1j_1 || element.w1j_1.a1() < 2) {
|
|
1722
|
+
tmp$ret$0 = element;
|
|
1723
|
+
break $l$block_1;
|
|
1724
|
+
}
|
|
1725
|
+
var tmp_0 = element.w1j_1.f1(element.w1j_1.a1() - 2 | 0);
|
|
1726
|
+
var tmp0_elvis_lhs = tmp_0 instanceof Assignment ? tmp_0 : null;
|
|
1454
1727
|
var tmp_1;
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1728
|
+
if (tmp0_elvis_lhs == null) {
|
|
1729
|
+
tmp$ret$0 = element;
|
|
1730
|
+
break $l$block_1;
|
|
1458
1731
|
} else {
|
|
1459
|
-
|
|
1732
|
+
tmp_1 = tmp0_elvis_lhs;
|
|
1460
1733
|
}
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
tmp_1 = element.b1k(VOID, VOID, VOID, VOID, plus_2(bodyPrefix, new ReturnStatement(new FunctionCall(tmp1_receiver, VOID, tmp0_name, tmp2_arguments))));
|
|
1467
|
-
} else {
|
|
1468
|
-
tmp_1 = element;
|
|
1734
|
+
var transportAssign = tmp_1;
|
|
1735
|
+
var tmp_2 = last(element.w1j_1);
|
|
1736
|
+
if (!(tmp_2 instanceof ReturnStatement)) {
|
|
1737
|
+
tmp$ret$0 = element;
|
|
1738
|
+
break $l$block_1;
|
|
1469
1739
|
}
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
} else {
|
|
1476
|
-
tmp = element;
|
|
1477
|
-
}
|
|
1478
|
-
var transformed = tmp;
|
|
1479
|
-
return transformChildren(transformed, transformer);
|
|
1480
|
-
};
|
|
1481
|
-
}
|
|
1482
|
-
function JavaIrEmitter$injectHandleFunction$lambda$lambda($handlersStruct) {
|
|
1483
|
-
return function (element, transformer) {
|
|
1484
|
-
var tmp;
|
|
1485
|
-
if (element instanceof Interface) {
|
|
1486
|
-
var injected = listOf($handlersStruct);
|
|
1487
|
-
var tmp_0;
|
|
1488
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1489
|
-
if (!injected.r()) {
|
|
1490
|
-
tmp_0 = withElements(element, plus_1(element.v1m(), injected));
|
|
1491
|
-
} else {
|
|
1492
|
-
tmp_0 = element;
|
|
1493
|
-
}
|
|
1494
|
-
tmp = tmp_0;
|
|
1495
|
-
} else {
|
|
1496
|
-
tmp = element;
|
|
1497
|
-
}
|
|
1498
|
-
var transformed = tmp;
|
|
1499
|
-
return transformChildren(transformed, transformer);
|
|
1500
|
-
};
|
|
1501
|
-
}
|
|
1502
|
-
function JavaIrEmitter$injectHandleFunction$lambda($handlersStruct) {
|
|
1503
|
-
return function (element, transformer) {
|
|
1504
|
-
var tmp;
|
|
1505
|
-
if (element instanceof Interface) {
|
|
1506
|
-
var tmp_0;
|
|
1507
|
-
if (element.m1o_1.equals(Companion_getInstance().m1h('Handler'))) {
|
|
1508
|
-
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1509
|
-
var scope = new TransformScope(element);
|
|
1510
|
-
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1511
|
-
var tmp_1 = scope;
|
|
1512
|
-
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1513
|
-
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1514
|
-
var this_0 = scope.z1t_1;
|
|
1515
|
-
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1516
|
-
// Inline function 'kotlin.apply' call
|
|
1517
|
-
var this_1 = new TransformerBuilder();
|
|
1518
|
-
this_1.d1h(JavaIrEmitter$injectHandleFunction$lambda$lambda($handlersStruct));
|
|
1519
|
-
var tmp$ret$2 = this_1.e1h();
|
|
1520
|
-
tmp_1.z1t_1 = transform(this_0, tmp$ret$2);
|
|
1521
|
-
var tmp_2 = scope.z1t_1;
|
|
1522
|
-
tmp_0 = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1523
|
-
} else {
|
|
1524
|
-
tmp_0 = element;
|
|
1740
|
+
var tmp_3 = dropLast(element.w1j_1, 2);
|
|
1741
|
+
var tmp1_name = Companion_getInstance().l1h('thenApply');
|
|
1742
|
+
var tmp2_receiver = transportAssign.j1o_1;
|
|
1743
|
+
var tmp3_arguments = mapOf(to(Companion_getInstance().l1h('mapper'), new RawExpression('rawResponse -> ' + $endpointName + '.fromRawResponse(serialization(), rawResponse)')));
|
|
1744
|
+
tmp$ret$0 = element.a1k(VOID, VOID, VOID, VOID, plus_2(tmp_3, new ReturnStatement(new FunctionCall(tmp2_receiver, VOID, tmp1_name, tmp3_arguments))));
|
|
1525
1745
|
}
|
|
1526
|
-
tmp =
|
|
1746
|
+
tmp = tmp$ret$0;
|
|
1527
1747
|
} else {
|
|
1528
1748
|
tmp = element;
|
|
1529
1749
|
}
|
|
1530
1750
|
var transformed = tmp;
|
|
1531
|
-
return
|
|
1751
|
+
return transformChildren_0(transformed, transformer);
|
|
1532
1752
|
};
|
|
1533
1753
|
}
|
|
1534
|
-
function
|
|
1754
|
+
function buildHandlersStruct$lambda(it) {
|
|
1535
1755
|
var tmp;
|
|
1536
1756
|
if (it instanceof Literal) {
|
|
1537
1757
|
tmp = it.hq_1;
|
|
@@ -1544,352 +1764,65 @@ function JavaIrEmitter$buildHandlers$lambda(it) {
|
|
|
1544
1764
|
}
|
|
1545
1765
|
return tmp;
|
|
1546
1766
|
}
|
|
1547
|
-
function
|
|
1767
|
+
function buildHandlersStruct$lambda$lambda($pathTemplate) {
|
|
1548
1768
|
return function ($this$function) {
|
|
1549
|
-
$this$function.
|
|
1550
|
-
$this$function.
|
|
1769
|
+
$this$function.j1i(String_instance);
|
|
1770
|
+
$this$function.i1k($this$function.z1s($pathTemplate));
|
|
1551
1771
|
return Unit_instance;
|
|
1552
1772
|
};
|
|
1553
1773
|
}
|
|
1554
|
-
function
|
|
1774
|
+
function buildHandlersStruct$lambda$lambda_0($this_buildHandlersStruct) {
|
|
1555
1775
|
return function ($this$function) {
|
|
1556
|
-
$this$function.
|
|
1557
|
-
$this$function.
|
|
1776
|
+
$this$function.j1i(String_instance);
|
|
1777
|
+
$this$function.i1k($this$function.z1s($this_buildHandlersStruct.fp_1.a3_1));
|
|
1558
1778
|
return Unit_instance;
|
|
1559
1779
|
};
|
|
1560
1780
|
}
|
|
1561
|
-
function
|
|
1562
|
-
$this$function.
|
|
1563
|
-
$this$function.
|
|
1564
|
-
$this$function.
|
|
1781
|
+
function buildHandlersStruct$lambda$lambda_1($this$function) {
|
|
1782
|
+
$this$function.j1i($this$function.s1h('Wirespec.ServerEdge', [$this$function.s1h('Request', []), $this$function.s1h('Response', [Wildcard_instance])]));
|
|
1783
|
+
$this$function.k1i('serialization', $this$function.s1h('Wirespec.Serialization', []));
|
|
1784
|
+
$this$function.i1k(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}'));
|
|
1565
1785
|
return Unit_instance;
|
|
1566
1786
|
}
|
|
1567
|
-
function
|
|
1568
|
-
$this$function.
|
|
1569
|
-
$this$function.
|
|
1570
|
-
$this$function.
|
|
1787
|
+
function buildHandlersStruct$lambda$lambda_2($this$function) {
|
|
1788
|
+
$this$function.j1i($this$function.s1h('Wirespec.ClientEdge', [$this$function.s1h('Request', []), $this$function.s1h('Response', [Wildcard_instance])]));
|
|
1789
|
+
$this$function.k1i('serialization', $this$function.s1h('Wirespec.Serialization', []));
|
|
1790
|
+
$this$function.i1k(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}'));
|
|
1571
1791
|
return Unit_instance;
|
|
1572
1792
|
}
|
|
1573
|
-
function
|
|
1793
|
+
function buildHandlersStruct$lambda_0($pathTemplate, $this_buildHandlersStruct) {
|
|
1574
1794
|
return function ($this$struct) {
|
|
1575
|
-
$this$struct.
|
|
1576
|
-
$this$struct.
|
|
1577
|
-
$this$struct.
|
|
1578
|
-
$this$struct.
|
|
1579
|
-
$this$struct.
|
|
1580
|
-
$this$struct.
|
|
1795
|
+
$this$struct.j1k($this$struct.s1h('Wirespec.Server', [$this$struct.s1h('Request', []), $this$struct.s1h('Response', [Wildcard_instance])]));
|
|
1796
|
+
$this$struct.j1k($this$struct.s1h('Wirespec.Client', [$this$struct.s1h('Request', []), $this$struct.s1h('Response', [Wildcard_instance])]));
|
|
1797
|
+
$this$struct.a1i('getPathTemplate', VOID, true, buildHandlersStruct$lambda$lambda($pathTemplate));
|
|
1798
|
+
$this$struct.a1i('getMethod', VOID, true, buildHandlersStruct$lambda$lambda_0($this_buildHandlersStruct));
|
|
1799
|
+
$this$struct.a1i('getServer', VOID, true, buildHandlersStruct$lambda$lambda_1);
|
|
1800
|
+
$this$struct.a1i('getClient', VOID, true, buildHandlersStruct$lambda$lambda_2);
|
|
1581
1801
|
return Unit_instance;
|
|
1582
1802
|
};
|
|
1583
1803
|
}
|
|
1584
|
-
function
|
|
1585
|
-
return it.
|
|
1804
|
+
function withFullyQualifiedPrefix$lambda(it) {
|
|
1805
|
+
return it.t1o_1.equals(Companion_getInstance().l1h('message'));
|
|
1586
1806
|
}
|
|
1587
|
-
function
|
|
1807
|
+
function withFullyQualifiedPrefix$lambda_0($prefix) {
|
|
1588
1808
|
return function (param) {
|
|
1589
|
-
var t = param.
|
|
1809
|
+
var t = param.u1o_1;
|
|
1590
1810
|
var tmp;
|
|
1591
1811
|
if (t instanceof Custom_0) {
|
|
1592
|
-
tmp = param.
|
|
1812
|
+
tmp = param.w1o(VOID, t.m1m($prefix + t.p1h_1));
|
|
1593
1813
|
} else {
|
|
1594
1814
|
tmp = param;
|
|
1595
1815
|
}
|
|
1596
1816
|
return tmp;
|
|
1597
1817
|
};
|
|
1598
1818
|
}
|
|
1599
|
-
function JavaIrEmitter$transformTypeDescriptors$lambda(this$0) {
|
|
1600
|
-
return function (stmt, tr) {
|
|
1601
|
-
var tmp;
|
|
1602
|
-
if (stmt instanceof TypeDescriptor) {
|
|
1603
|
-
var rootType = findRoot(this$0, stmt.h1p_1);
|
|
1604
|
-
var containerStr = rawContainerClass(this$0, stmt.h1p_1);
|
|
1605
|
-
var rootStr = toJavaName(this$0, rootType) + '.class';
|
|
1606
|
-
var tmp_0;
|
|
1607
|
-
if (containerStr == null) {
|
|
1608
|
-
tmp_0 = null;
|
|
1609
|
-
} else {
|
|
1610
|
-
// Inline function 'kotlin.let' call
|
|
1611
|
-
tmp_0 = containerStr + '.class';
|
|
1612
|
-
}
|
|
1613
|
-
var tmp2_elvis_lhs = tmp_0;
|
|
1614
|
-
var containerArg = tmp2_elvis_lhs == null ? 'null' : tmp2_elvis_lhs;
|
|
1615
|
-
tmp = new RawExpression('Wirespec.getType(' + rootStr + ', ' + containerArg + ')');
|
|
1616
|
-
} else {
|
|
1617
|
-
tmp = transformChildren_0(stmt, tr);
|
|
1618
|
-
}
|
|
1619
|
-
return tmp;
|
|
1620
|
-
};
|
|
1621
|
-
}
|
|
1622
|
-
function JavaIrEmitter(packageName, emitShared) {
|
|
1623
|
-
Companion_getInstance_1();
|
|
1624
|
-
packageName = packageName === VOID ? Companion_instance.lr('community.flock.wirespec.generated') : packageName;
|
|
1625
|
-
emitShared = emitShared === VOID ? Companion_instance_0.go() : emitShared;
|
|
1626
|
-
this.k1w_1 = packageName;
|
|
1627
|
-
this.l1w_1 = emitShared;
|
|
1628
|
-
this.m1w_1 = JavaGenerator_instance;
|
|
1629
|
-
this.n1w_1 = FileExtension_Java_getInstance();
|
|
1630
|
-
this.o1w_1 = listOf(import_0('community.flock.wirespec.java', 'Wirespec'));
|
|
1631
|
-
var tmp = this;
|
|
1632
|
-
var tmp_0 = Companion_getInstance_1().j1w_1;
|
|
1633
|
-
var tmp_1 = JavaIrEmitter$sanitizationConfig$lambda;
|
|
1634
|
-
var tmp_2 = JavaIrEmitter$sanitizationConfig$lambda_0;
|
|
1635
|
-
var tmp_3 = JavaIrEmitter$sanitizationConfig$lambda_1;
|
|
1636
|
-
var tmp_4 = JavaIrEmitter$sanitizationConfig$lambda_2(this);
|
|
1637
|
-
tmp.p1w_1 = new SanitizationConfig(tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, JavaIrEmitter$sanitizationConfig$lambda_3);
|
|
1638
|
-
var tmp_5 = this;
|
|
1639
|
-
tmp_5.q1w_1 = new JavaIrEmitter$shared$1();
|
|
1640
|
-
}
|
|
1641
|
-
protoOf(JavaIrEmitter).k1v = function () {
|
|
1642
|
-
return this.k1w_1;
|
|
1643
|
-
};
|
|
1644
|
-
protoOf(JavaIrEmitter).m1u = function () {
|
|
1645
|
-
return this.m1w_1;
|
|
1646
|
-
};
|
|
1647
|
-
protoOf(JavaIrEmitter).eq = function () {
|
|
1648
|
-
return this.n1w_1;
|
|
1649
|
-
};
|
|
1650
|
-
protoOf(JavaIrEmitter).t1v = function () {
|
|
1651
|
-
return this.q1w_1;
|
|
1652
|
-
};
|
|
1653
|
-
protoOf(JavaIrEmitter).n1u = function (module_0, logger) {
|
|
1654
|
-
var tmp = emit_0.call(this, module_0, logger);
|
|
1655
|
-
return withSharedSource(tmp, this.l1w_1, JavaIrEmitter$emit$lambda(this));
|
|
1656
|
-
};
|
|
1657
|
-
protoOf(JavaIrEmitter).uq = function (definition, module_0, logger) {
|
|
1658
|
-
var file = emit_1.call(this, definition, module_0, logger);
|
|
1659
|
-
var tmp = file.x1m(Companion_getInstance().m1h(sanitizeSymbol_0(this, file.t1m_1.x1l())));
|
|
1660
|
-
// Inline function 'kotlin.takeIf' call
|
|
1661
|
-
var this_0 = this.o1w_1;
|
|
1662
|
-
var tmp_0;
|
|
1663
|
-
if (Companion_instance_1.qq(module_0)) {
|
|
1664
|
-
tmp_0 = this_0;
|
|
1665
|
-
} else {
|
|
1666
|
-
tmp_0 = null;
|
|
1667
|
-
}
|
|
1668
|
-
var tmp$ret$1 = tmp_0;
|
|
1669
|
-
return placeInPackage(prependImports(tmp, tmp$ret$1), this.k1v(), definition);
|
|
1670
|
-
};
|
|
1671
|
-
protoOf(JavaIrEmitter).up = function (type, module_0) {
|
|
1672
|
-
return sanitizeNames(convertWithValidation(type, module_0), this.p1w_1);
|
|
1673
|
-
};
|
|
1674
|
-
protoOf(JavaIrEmitter).ir = function (enum_0, module_0) {
|
|
1675
|
-
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1676
|
-
var this_0 = convert_1(enum_0);
|
|
1677
|
-
var scope = new TransformScope(this_0);
|
|
1678
|
-
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1679
|
-
var tmp = scope;
|
|
1680
|
-
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1681
|
-
var this_1 = scope.z1t_1;
|
|
1682
|
-
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1683
|
-
// Inline function 'kotlin.apply' call
|
|
1684
|
-
var this_2 = new TransformerBuilder();
|
|
1685
|
-
this_2.d1h(JavaIrEmitter$emit$lambda_0(this));
|
|
1686
|
-
var tmp$ret$2 = this_2.e1h();
|
|
1687
|
-
tmp.z1t_1 = transform(this_1, tmp$ret$2);
|
|
1688
|
-
var tmp_0 = scope.z1t_1;
|
|
1689
|
-
var tmp$ret$6 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1690
|
-
return sanitizeNames(tmp$ret$6, this.p1w_1);
|
|
1691
|
-
};
|
|
1692
|
-
protoOf(JavaIrEmitter).yq = function (union) {
|
|
1693
|
-
return sanitizeNames(convert_2(union), this.p1w_1);
|
|
1694
|
-
};
|
|
1695
|
-
protoOf(JavaIrEmitter).dr = function (refined) {
|
|
1696
|
-
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1697
|
-
var this_0 = convert_3(refined);
|
|
1698
|
-
var scope = new TransformScope(this_0);
|
|
1699
|
-
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1700
|
-
var tmp = scope;
|
|
1701
|
-
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1702
|
-
var this_1 = scope.z1t_1;
|
|
1703
|
-
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1704
|
-
// Inline function 'kotlin.apply' call
|
|
1705
|
-
var this_2 = new TransformerBuilder();
|
|
1706
|
-
this_2.d1h(JavaIrEmitter$emit$lambda_1(refined));
|
|
1707
|
-
var tmp$ret$2 = this_2.e1h();
|
|
1708
|
-
tmp.z1t_1 = transform(this_1, tmp$ret$2);
|
|
1709
|
-
var tmp_0 = scope.z1t_1;
|
|
1710
|
-
var tmp$ret$6 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1711
|
-
return sanitizeNames(tmp$ret$6, this.p1w_1);
|
|
1712
|
-
};
|
|
1713
|
-
protoOf(JavaIrEmitter).jr = function (endpoint) {
|
|
1714
|
-
var imports = buildImports(this, endpoint);
|
|
1715
|
-
// Inline function 'kotlin.let' call
|
|
1716
|
-
var file = sanitizeNames(transformTypeDescriptors(this, injectHandleFunction(this, convert_4(endpoint), endpoint)), this.p1w_1);
|
|
1717
|
-
var tmp;
|
|
1718
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1719
|
-
if (!imports.r()) {
|
|
1720
|
-
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1721
|
-
var scope = new TransformScope(file);
|
|
1722
|
-
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1723
|
-
var tmp_0 = scope;
|
|
1724
|
-
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1725
|
-
var this_0 = scope.z1t_1;
|
|
1726
|
-
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1727
|
-
// Inline function 'kotlin.apply' call
|
|
1728
|
-
var this_1 = new TransformerBuilder();
|
|
1729
|
-
this_1.d1h(JavaIrEmitter$emit$lambda_2(imports));
|
|
1730
|
-
var tmp$ret$3 = this_1.e1h();
|
|
1731
|
-
tmp_0.z1t_1 = transform(this_0, tmp$ret$3);
|
|
1732
|
-
var tmp_1 = scope.z1t_1;
|
|
1733
|
-
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1734
|
-
} else {
|
|
1735
|
-
tmp = file;
|
|
1736
|
-
}
|
|
1737
|
-
return tmp;
|
|
1738
|
-
};
|
|
1739
|
-
protoOf(JavaIrEmitter).xq = function (channel) {
|
|
1740
|
-
var tmp;
|
|
1741
|
-
if (channel.mo_1.l1() === channel.no_1.l1()) {
|
|
1742
|
-
tmp = this.k1v().mr_1 + '.model.';
|
|
1743
|
-
} else {
|
|
1744
|
-
tmp = '';
|
|
1745
|
-
}
|
|
1746
|
-
var fullyQualifiedPrefix = tmp;
|
|
1747
|
-
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1748
|
-
var this_0 = sanitizeNames(convert_5(channel), this.p1w_1);
|
|
1749
|
-
var scope = new TransformScope(this_0);
|
|
1750
|
-
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1751
|
-
var tmp_0 = scope;
|
|
1752
|
-
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1753
|
-
var this_1 = scope.z1t_1;
|
|
1754
|
-
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1755
|
-
// Inline function 'kotlin.apply' call
|
|
1756
|
-
var this_2 = new TransformerBuilder();
|
|
1757
|
-
this_2.d1h(JavaIrEmitter$emit$lambda_3(this, fullyQualifiedPrefix));
|
|
1758
|
-
var tmp$ret$2 = this_2.e1h();
|
|
1759
|
-
tmp_0.z1t_1 = transform(this_1, tmp$ret$2);
|
|
1760
|
-
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1761
|
-
var tmp_1 = scope;
|
|
1762
|
-
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1763
|
-
var this_3 = scope.z1t_1;
|
|
1764
|
-
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1765
|
-
// Inline function 'kotlin.apply' call
|
|
1766
|
-
var this_4 = new TransformerBuilder();
|
|
1767
|
-
this_4.d1h(JavaIrEmitter$emit$lambda_4);
|
|
1768
|
-
var tmp$ret$7 = this_4.e1h();
|
|
1769
|
-
tmp_1.z1t_1 = transform(this_3, tmp$ret$7);
|
|
1770
|
-
var tmp_2 = scope.z1t_1;
|
|
1771
|
-
return isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1772
|
-
};
|
|
1773
|
-
protoOf(JavaIrEmitter).q1u = function (endpoint) {
|
|
1774
|
-
var imports = buildImports(this, endpoint);
|
|
1775
|
-
var endpointImport = import_0(this.k1v().mr_1 + '.endpoint', endpoint.ep_1.l1());
|
|
1776
|
-
var file = transformTypeDescriptors(this, sanitizeNames(emitEndpointClient.call(this, endpoint), this.p1w_1));
|
|
1777
|
-
var endpointName = endpoint.ep_1.l1();
|
|
1778
|
-
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1779
|
-
var scope = new TransformScope(file);
|
|
1780
|
-
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1781
|
-
var tmp = scope;
|
|
1782
|
-
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1783
|
-
var this_0 = scope.z1t_1;
|
|
1784
|
-
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1785
|
-
// Inline function 'kotlin.apply' call
|
|
1786
|
-
var this_1 = new TransformerBuilder();
|
|
1787
|
-
this_1.d1h(JavaIrEmitter$emitEndpointClient$lambda(endpointName));
|
|
1788
|
-
var tmp$ret$2 = this_1.e1h();
|
|
1789
|
-
tmp.z1t_1 = transform(this_0, tmp$ret$2);
|
|
1790
|
-
var tmp_0 = scope.z1t_1;
|
|
1791
|
-
var transformedFile = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1792
|
-
var subPackageName = plus_0(this.k1v(), 'client');
|
|
1793
|
-
return new File(Companion_getInstance().m1h(subPackageName.or() + sanitizeSymbol_0(this, transformedFile.t1m_1.x1l())), plus_1(plus_1(plus_1(plus_1(listOf(new Package(subPackageName.mr_1)), this.o1w_1), imports), listOf(endpointImport)), transformedFile.u1m_1));
|
|
1794
|
-
};
|
|
1795
|
-
protoOf(JavaIrEmitter).p1u = function (endpoints, logger) {
|
|
1796
|
-
// Inline function 'kotlin.collections.flatMap' call
|
|
1797
|
-
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1798
|
-
var destination = ArrayList_init_$Create$();
|
|
1799
|
-
var _iterator__ex2g4s = endpoints.t();
|
|
1800
|
-
while (_iterator__ex2g4s.u()) {
|
|
1801
|
-
var element = _iterator__ex2g4s.v();
|
|
1802
|
-
var list = importReferences(element);
|
|
1803
|
-
addAll(destination, list);
|
|
1804
|
-
}
|
|
1805
|
-
// Inline function 'kotlin.collections.distinctBy' call
|
|
1806
|
-
var set = HashSet_init_$Create$();
|
|
1807
|
-
var list_0 = ArrayList_init_$Create$();
|
|
1808
|
-
var _iterator__ex2g4s_0 = destination.t();
|
|
1809
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
1810
|
-
var e = _iterator__ex2g4s_0.v();
|
|
1811
|
-
var key = e.lu_1;
|
|
1812
|
-
if (set.x(key)) {
|
|
1813
|
-
list_0.x(e);
|
|
1814
|
-
}
|
|
1815
|
-
}
|
|
1816
|
-
// Inline function 'kotlin.collections.filter' call
|
|
1817
|
-
// Inline function 'kotlin.collections.filterTo' call
|
|
1818
|
-
var destination_0 = ArrayList_init_$Create$();
|
|
1819
|
-
var _iterator__ex2g4s_1 = list_0.t();
|
|
1820
|
-
while (_iterator__ex2g4s_1.u()) {
|
|
1821
|
-
var element_0 = _iterator__ex2g4s_1.v();
|
|
1822
|
-
var tmp$ret$5;
|
|
1823
|
-
$l$block_0: {
|
|
1824
|
-
// Inline function 'kotlin.collections.none' call
|
|
1825
|
-
var tmp;
|
|
1826
|
-
if (isInterface(endpoints, Collection)) {
|
|
1827
|
-
tmp = endpoints.r();
|
|
1828
|
-
} else {
|
|
1829
|
-
tmp = false;
|
|
1830
|
-
}
|
|
1831
|
-
if (tmp) {
|
|
1832
|
-
tmp$ret$5 = true;
|
|
1833
|
-
break $l$block_0;
|
|
1834
|
-
}
|
|
1835
|
-
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1836
|
-
while (_iterator__ex2g4s_2.u()) {
|
|
1837
|
-
var element_1 = _iterator__ex2g4s_2.v();
|
|
1838
|
-
if (element_1.ep_1.l1() === element_0.lu_1) {
|
|
1839
|
-
tmp$ret$5 = false;
|
|
1840
|
-
break $l$block_0;
|
|
1841
|
-
}
|
|
1842
|
-
}
|
|
1843
|
-
tmp$ret$5 = true;
|
|
1844
|
-
}
|
|
1845
|
-
if (tmp$ret$5) {
|
|
1846
|
-
destination_0.x(element_0);
|
|
1847
|
-
}
|
|
1848
|
-
}
|
|
1849
|
-
// Inline function 'kotlin.collections.map' call
|
|
1850
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
1851
|
-
var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_0, 10));
|
|
1852
|
-
var _iterator__ex2g4s_3 = destination_0.t();
|
|
1853
|
-
while (_iterator__ex2g4s_3.u()) {
|
|
1854
|
-
var item = _iterator__ex2g4s_3.v();
|
|
1855
|
-
var tmp$ret$10 = import_0(this.k1v().mr_1 + '.model', item.lu_1);
|
|
1856
|
-
destination_1.x(tmp$ret$10);
|
|
1857
|
-
}
|
|
1858
|
-
var imports = destination_1;
|
|
1859
|
-
// Inline function 'kotlin.collections.map' call
|
|
1860
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
1861
|
-
var destination_2 = ArrayList_init_$Create$_0(collectionSizeOrDefault(endpoints, 10));
|
|
1862
|
-
var _iterator__ex2g4s_4 = endpoints.t();
|
|
1863
|
-
while (_iterator__ex2g4s_4.u()) {
|
|
1864
|
-
var item_0 = _iterator__ex2g4s_4.v();
|
|
1865
|
-
var tmp$ret$13 = import_0(this.k1v().mr_1 + '.endpoint', item_0.ep_1.l1());
|
|
1866
|
-
destination_2.x(tmp$ret$13);
|
|
1867
|
-
}
|
|
1868
|
-
var endpointImports = destination_2;
|
|
1869
|
-
// Inline function 'kotlin.collections.map' call
|
|
1870
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
1871
|
-
var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(endpoints, 10));
|
|
1872
|
-
var _iterator__ex2g4s_5 = endpoints.t();
|
|
1873
|
-
while (_iterator__ex2g4s_5.u()) {
|
|
1874
|
-
var item_1 = _iterator__ex2g4s_5.v();
|
|
1875
|
-
var tmp$ret$16 = import_0(this.k1v().mr_1 + '.client', item_1.ep_1.l1() + 'Client');
|
|
1876
|
-
destination_3.x(tmp$ret$16);
|
|
1877
|
-
}
|
|
1878
|
-
var clientImports = destination_3;
|
|
1879
|
-
var allImports = plus_1(plus_1(imports, endpointImports), clientImports);
|
|
1880
|
-
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.p1w_1);
|
|
1881
|
-
return new File(Companion_getInstance().m1h(this.k1v().or() + sanitizeSymbol_0(this, file.t1m_1.x1l())), plus_1(plus_1(plus_1(listOf(new Package(this.k1v().mr_1)), this.o1w_1), allImports), file.u1m_1));
|
|
1882
|
-
};
|
|
1883
1819
|
function JavaRefinedTypeDefinitionEmitter() {
|
|
1884
1820
|
}
|
|
1885
1821
|
function JavaShared() {
|
|
1886
1822
|
JavaShared_instance = this;
|
|
1887
|
-
this.
|
|
1888
|
-
this.
|
|
1823
|
+
this.m1v_1 = 'community.flock.wirespec.java';
|
|
1824
|
+
this.n1v_1 = trimMargin('\n |package ' + this.m1v_1 + ';\n |\n |import java.lang.reflect.Type;\n |import java.lang.reflect.ParameterizedType;\n |import java.util.List;\n |import java.util.Map;\n |import java.util.Optional;\n |\n |public interface Wirespec {\n |' + Spacer_instance.toString() + 'interface Enum { String label(); }\n |' + Spacer_instance.toString() + 'interface Endpoint {}\n |' + Spacer_instance.toString() + 'interface Refined<T> { T value(); }\n |' + Spacer_instance.toString() + 'interface Path {}\n |' + Spacer_instance.toString() + 'interface Queries {}\n |' + Spacer_instance.toString() + 'interface Headers {}\n |' + Spacer_instance.toString() + 'interface Handler {}\n |' + Spacer_instance.toString() + 'interface ServerEdge<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.qr(2) + 'Req from(RawRequest request);\n |' + Spacer_instance.qr(2) + 'RawResponse to(Res response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface ClientEdge<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.qr(2) + 'RawRequest to(Req request);\n |' + Spacer_instance.qr(2) + 'Res from(RawResponse response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.qr(2) + 'String getPathTemplate();\n |' + Spacer_instance.qr(2) + 'String getMethod();\n |' + Spacer_instance.qr(2) + 'ClientEdge<Req, Res> getClient(Serialization serialization);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Server<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.qr(2) + 'String getPathTemplate();\n |' + Spacer_instance.qr(2) + 'String getMethod();\n |' + Spacer_instance.qr(2) + 'ServerEdge<Req, Res> getServer(Serialization serialization);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'enum Method { GET, PUT, POST, DELETE, OPTIONS, HEAD, PATCH, TRACE }\n |' + Spacer_instance.toString() + 'interface Request<T> { Path path(); Method method(); Queries queries(); Headers headers(); T body(); interface Headers extends Wirespec.Headers {} }\n |' + Spacer_instance.toString() + 'interface Response<T> { Integer status(); Headers headers(); T body(); interface Headers extends Wirespec.Headers {} }\n |' + Spacer_instance.toString() + 'interface Serialization extends Serializer, Deserializer {}\n |' + Spacer_instance.toString() + 'interface Serializer extends BodySerializer, PathSerializer, ParamSerializer {}\n |' + Spacer_instance.toString() + 'interface Deserializer extends BodyDeserializer, PathDeserializer, ParamDeserializer {}\n |' + Spacer_instance.toString() + 'interface BodySerialization extends BodySerializer, BodyDeserializer {}\n |' + Spacer_instance.toString() + 'interface BodySerializer { <T> byte[] serializeBody(T t, Type type); }\n |' + Spacer_instance.toString() + 'interface BodyDeserializer { <T> T deserializeBody(byte[] raw, Type type); }\n |' + Spacer_instance.toString() + 'interface PathSerialization extends PathSerializer, PathDeserializer {}\n |' + Spacer_instance.toString() + 'interface PathSerializer { <T> String serializePath(T t, Type type); }\n |' + Spacer_instance.toString() + 'interface PathDeserializer { <T> T deserializePath(String raw, Type type); }\n |' + Spacer_instance.toString() + 'interface ParamSerialization extends ParamSerializer, ParamDeserializer {}\n |' + Spacer_instance.toString() + 'interface ParamSerializer { <T> List<String> serializeParam(T value, Type type); }\n |' + Spacer_instance.toString() + 'interface ParamDeserializer { <T> T deserializeParam(List<String> values, Type type); }\n |' + Spacer_instance.toString() + 'record RawRequest(String method, List<String> path, Map<String, List<String>> queries, Map<String, List<String>> headers, Optional<byte[]> body) {}\n |' + Spacer_instance.toString() + 'record RawResponse(int statusCode, Map<String, List<String>> headers, Optional<byte[]> body) {}\n |' + Spacer_instance.toString() + 'static Type getType(final Class<?> actualTypeArguments, final Class<?> rawType) {\n |' + Spacer_instance.qr(2) + 'if(rawType != null) {\n |' + Spacer_instance.qr(3) + 'return new ParameterizedType() {\n |' + Spacer_instance.qr(4) + 'public Type getRawType() { return rawType; }\n |' + Spacer_instance.qr(4) + 'public Type[] getActualTypeArguments() { return new Class<?>[]{actualTypeArguments}; }\n |' + Spacer_instance.qr(4) + 'public Type getOwnerType() { return null; }\n |' + Spacer_instance.qr(3) + '};\n |' + Spacer_instance.qr(2) + '}\n |' + Spacer_instance.qr(2) + 'else { return actualTypeArguments; }\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
1889
1825
|
}
|
|
1890
|
-
protoOf(JavaShared).r1w = function () {
|
|
1891
|
-
return this.v1v_1;
|
|
1892
|
-
};
|
|
1893
1826
|
protoOf(JavaShared).toString = function () {
|
|
1894
1827
|
return 'JavaShared';
|
|
1895
1828
|
};
|
|
@@ -1924,7 +1857,7 @@ function emitType($this, _this__u8e3s4) {
|
|
|
1924
1857
|
tmp = 'Object';
|
|
1925
1858
|
} else {
|
|
1926
1859
|
if (_this__u8e3s4 instanceof Custom) {
|
|
1927
|
-
tmp = _this__u8e3s4.
|
|
1860
|
+
tmp = _this__u8e3s4.ku_1;
|
|
1928
1861
|
} else {
|
|
1929
1862
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
1930
1863
|
tmp = emit_18($this, _this__u8e3s4);
|
|
@@ -1939,14 +1872,14 @@ function emitType($this, _this__u8e3s4) {
|
|
|
1939
1872
|
return tmp;
|
|
1940
1873
|
}
|
|
1941
1874
|
function emit_18($this, _this__u8e3s4) {
|
|
1942
|
-
var t = _this__u8e3s4.
|
|
1875
|
+
var t = _this__u8e3s4.ou_1;
|
|
1943
1876
|
var tmp;
|
|
1944
1877
|
if (t instanceof String_0) {
|
|
1945
1878
|
tmp = 'String';
|
|
1946
1879
|
} else {
|
|
1947
1880
|
if (t instanceof Integer) {
|
|
1948
1881
|
var tmp_0;
|
|
1949
|
-
switch (t.
|
|
1882
|
+
switch (t.st_1.b3_1) {
|
|
1950
1883
|
case 0:
|
|
1951
1884
|
tmp_0 = 'Integer';
|
|
1952
1885
|
break;
|
|
@@ -1961,7 +1894,7 @@ function emit_18($this, _this__u8e3s4) {
|
|
|
1961
1894
|
} else {
|
|
1962
1895
|
if (t instanceof Number_0) {
|
|
1963
1896
|
var tmp_1;
|
|
1964
|
-
switch (t.
|
|
1897
|
+
switch (t.vt_1.b3_1) {
|
|
1965
1898
|
case 0:
|
|
1966
1899
|
tmp_1 = 'Float';
|
|
1967
1900
|
break;
|
|
@@ -2006,27 +1939,28 @@ function JavaUnionDefinitionEmitter$emit$lambda(it) {
|
|
|
2006
1939
|
function JavaUnionDefinitionEmitter() {
|
|
2007
1940
|
}
|
|
2008
1941
|
//region block: post-declaration
|
|
2009
|
-
protoOf(JavaEmitter).wq =
|
|
1942
|
+
protoOf(JavaEmitter).wq = emit_12;
|
|
2010
1943
|
protoOf(JavaEmitter).up = emit_3;
|
|
2011
1944
|
protoOf(JavaEmitter).vp = emit_4;
|
|
2012
1945
|
protoOf(JavaEmitter).wp = emit_5;
|
|
2013
1946
|
protoOf(JavaEmitter).xp = emit_6;
|
|
2014
1947
|
protoOf(JavaEmitter).yp = emit_7;
|
|
2015
|
-
protoOf(JavaEmitter).jr =
|
|
2016
|
-
protoOf(JavaEmitter).
|
|
2017
|
-
protoOf(JavaEmitter).
|
|
1948
|
+
protoOf(JavaEmitter).jr = emit_9;
|
|
1949
|
+
protoOf(JavaEmitter).p1v = emit_10;
|
|
1950
|
+
protoOf(JavaEmitter).q1v = emit_11;
|
|
2018
1951
|
protoOf(JavaEmitter).xq = emit_8;
|
|
2019
|
-
protoOf(JavaEmitter).ir =
|
|
2020
|
-
protoOf(JavaEmitter).yq =
|
|
2021
|
-
protoOf(JavaEmitter).dr =
|
|
2022
|
-
protoOf(JavaEmitter).
|
|
2023
|
-
protoOf(JavaEmitter).
|
|
2024
|
-
protoOf(JavaEmitter).
|
|
2025
|
-
protoOf(JavaEmitter).
|
|
2026
|
-
protoOf(JavaEmitter).
|
|
2027
|
-
protoOf(JavaEmitter).
|
|
1952
|
+
protoOf(JavaEmitter).ir = emit_15;
|
|
1953
|
+
protoOf(JavaEmitter).yq = emit_13;
|
|
1954
|
+
protoOf(JavaEmitter).dr = emit_14;
|
|
1955
|
+
protoOf(JavaEmitter).o1v = sanitizeSymbol;
|
|
1956
|
+
protoOf(JavaEmitter).r1v = sanitizeFirstIsDigit;
|
|
1957
|
+
protoOf(JavaEmitter).s1v = sanitizeKeywords;
|
|
1958
|
+
protoOf(JavaEmitter).e1v = emitRoot;
|
|
1959
|
+
protoOf(JavaEmitter).d1v = emitRoot$default;
|
|
1960
|
+
protoOf(JavaEmitter).t1v = emitHandleFunction;
|
|
2028
1961
|
protoOf(JavaEmitter).kr = emitValidator;
|
|
2029
|
-
protoOf(JavaIrEmitter).on =
|
|
1962
|
+
protoOf(JavaIrEmitter).on = emit_1;
|
|
1963
|
+
protoOf(JavaIrEmitter).l1u = emit_2;
|
|
2030
1964
|
//endregion
|
|
2031
1965
|
//region block: exports
|
|
2032
1966
|
export {
|