@flock/wirespec 0.20.0-RC.9 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.mjs +12 -12
- package/arrow-arrow-core.mjs +163 -163
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt-mordant.mjs.map +1 -1
- package/clikt-clikt.mjs +1571 -1571
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +444 -444
- package/kotlin-kotlin-stdlib.mjs +2001 -1948
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10257 -10257
- package/kotlin-rgxgen.mjs +1819 -1819
- package/kotlinx-io-kotlinx-io-core.mjs +440 -440
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1890 -1890
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1576 -1576
- package/mordant-mordant.mjs +1362 -1362
- package/package.json +2 -2
- package/wirespec-src-compiler-core.mjs +2462 -2388
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +482 -1337
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +376 -1060
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +424 -1417
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +479 -417
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +224 -184
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +568 -1404
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +113 -86
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +4311 -4417
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +352 -1141
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +512 -512
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +772 -760
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +1411 -1396
- package/wirespec-src-ide-lsp.mjs.map +1 -1
- package/wirespec-src-plugin-arguments.mjs +185 -245
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +102 -128
- package/wirespec-src-plugin-cli.mjs.map +1 -1
- package/wirespec-src-plugin-npm.d.mts +15 -104
- package/wirespec-src-plugin-npm.mjs +40 -40
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +40 -35
- package/wirespec-src-tools-generator.mjs.map +1 -1
|
@@ -1,999 +1,154 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
convertToGenerator2wzjrmaavxhph as convertToGenerator,
|
|
142
|
-
convertToGeneratorkggw47cqose7 as convertToGenerator_0,
|
|
143
|
-
convertToGenerator3rjr3azp4vdsx as convertToGenerator_1,
|
|
144
|
-
convertToGenerator2msmr3acdd5nx as convertToGenerator_2,
|
|
145
|
-
sanitizeNames2wqmyf8vafp9x as sanitizeNames,
|
|
146
|
-
collectCustomTypeNames373f3lwl9sqd5 as collectCustomTypeNames,
|
|
147
|
-
placeInPackagena6oqbi45fz6 as placeInPackage_0,
|
|
148
|
-
convertWithValidation3ar3nbcqsbkpn as convertWithValidation,
|
|
149
|
-
convert11ert2po54h1y as convert_0,
|
|
150
|
-
injectEnumLabelFieldyfohidz6c88i as injectEnumLabelField,
|
|
151
|
-
convert37aabdzvtv9vg as convert_1,
|
|
152
|
-
convert17zcptkz4mhr4 as convert_2,
|
|
153
|
-
convert32tuiui3czihh as convert_3,
|
|
154
|
-
convert1cn4bolzoed8c as convert_4,
|
|
155
|
-
emitEndpointClient1meajc90wf3el as emitEndpointClient,
|
|
156
|
-
emitClient32kfwzg2hm5vj as emitClient,
|
|
157
|
-
get_extensions31c4or738wbxz as get_extensions,
|
|
158
|
-
emit1oxjujel6f3jb as emit_1,
|
|
159
|
-
emit3bzdcd0f6nwtj as emit_2,
|
|
160
|
-
beforeGenerate3o8idb3hey1b0 as beforeGenerate,
|
|
161
|
-
IrEmitterh2m93ojzvkep as IrEmitter,
|
|
162
|
-
Dict22iqrhoo0g8et as Dict_0,
|
|
163
|
-
Array2goj74t0aak7b as Array_0,
|
|
164
|
-
Nullable3wjn6l6q3h6o as Nullable,
|
|
165
|
-
Custom2si7lto3wompr as Custom_0,
|
|
166
|
-
Unit_instanceyaei45a6t5rv as Unit_instance_0,
|
|
167
|
-
Any_instance2998xag3cdzh3 as Any_instance,
|
|
168
|
-
Bytes_instance3edm2lhbrwd51 as Bytes_instance_0,
|
|
169
|
-
Boolean_instance27opaqtiiiysz as Boolean_instance_0,
|
|
170
|
-
Number3azxs9q1cyulb as Number_1,
|
|
171
|
-
Integer1uwg1wvo5lp6z as Integer_0,
|
|
172
|
-
structo1silz79n3nu as struct,
|
|
173
|
-
RawExpression2bo7ldfrptjia as RawExpression,
|
|
174
|
-
TypeDescriptor1hvcpxrtxcqsx as TypeDescriptor,
|
|
175
|
-
convert2loxpwk8n2r8c as convert_5,
|
|
176
|
-
Custom_init_$Create$2enn7oyj71j1t as Custom_init_$Create$,
|
|
177
|
-
Function21cuq8qizkin7 as Function,
|
|
178
|
-
plusd54zq6f7l8fy as plus_3,
|
|
179
|
-
Struct39wf79cwtn4ty as Struct,
|
|
180
|
-
RawElement2yts1x2rbem1g as RawElement,
|
|
181
|
-
Interface3pn84xq686t2r as Interface,
|
|
182
|
-
Assignment3kcxc8wlcbmkn as Assignment,
|
|
183
|
-
ReturnStatement29qlfkn9kpy10 as ReturnStatement,
|
|
184
|
-
Wildcard_instance2ga1ytfwj78ra as Wildcard_instance,
|
|
185
|
-
transformChildren2m3cpkz6zusq1 as transformChildren_1,
|
|
186
|
-
} from './wirespec-src-compiler-ir.mjs';
|
|
187
|
-
//region block: imports
|
|
188
|
-
//endregion
|
|
189
|
-
//region block: pre-declaration
|
|
190
|
-
function emit_3(type, module_0) {
|
|
191
|
-
var tmp = this.or(type.mp_1);
|
|
192
|
-
var tmp_0 = this.mq(type.np_1);
|
|
193
|
-
// Inline function 'kotlin.run' call
|
|
194
|
-
var $this$run = type.op_1;
|
|
195
|
-
var tmp_1;
|
|
196
|
-
if ($this$run.r()) {
|
|
197
|
-
tmp_1 = '';
|
|
198
|
-
} else {
|
|
199
|
-
tmp_1 = ' implements ' + joinToString($this$run, ', ', VOID, VOID, VOID, VOID, JavaTypeDefinitionEmitter$emit$lambda(this));
|
|
200
|
-
}
|
|
201
|
-
var tmp$ret$1 = tmp_1;
|
|
202
|
-
return trimMargin('\n |public record ' + tmp + ' (\n |' + tmp_0 + '\n |)' + tmp$ret$1 + ' {\n |};\n |\n ');
|
|
203
|
-
}
|
|
204
|
-
function emit_4(_this__u8e3s4) {
|
|
205
|
-
return dropLast_0(joinToString(_this__u8e3s4.jp_1, '\n', VOID, VOID, VOID, VOID, JavaTypeDefinitionEmitter$emit$lambda_0(this)), 1);
|
|
206
|
-
}
|
|
207
|
-
function emit_5(_this__u8e3s4) {
|
|
208
|
-
return this.oq(_this__u8e3s4.sp_1) + ' ' + this.or(_this__u8e3s4.rp_1);
|
|
209
|
-
}
|
|
210
|
-
function emit_6(_this__u8e3s4) {
|
|
211
|
-
// Inline function 'kotlin.let' call
|
|
212
|
-
var it = emitType(this, _this__u8e3s4);
|
|
213
|
-
return _this__u8e3s4.uu() ? 'java.util.Optional<' + it + '>' : it;
|
|
214
|
-
}
|
|
215
|
-
function emitRoot(_this__u8e3s4, void_0) {
|
|
216
|
-
var tmp;
|
|
217
|
-
if (_this__u8e3s4 instanceof Dict) {
|
|
218
|
-
tmp = this.w1x(_this__u8e3s4.so_1);
|
|
219
|
-
} else {
|
|
220
|
-
if (_this__u8e3s4 instanceof Iterable) {
|
|
221
|
-
tmp = this.w1x(_this__u8e3s4.po_1);
|
|
222
|
-
} else {
|
|
223
|
-
if (_this__u8e3s4 instanceof Unit) {
|
|
224
|
-
tmp = void_0;
|
|
225
|
-
} else {
|
|
226
|
-
if (_this__u8e3s4 instanceof Any) {
|
|
227
|
-
tmp = emitType(this, _this__u8e3s4);
|
|
228
|
-
} else {
|
|
229
|
-
if (_this__u8e3s4 instanceof Custom) {
|
|
230
|
-
tmp = emitType(this, _this__u8e3s4);
|
|
231
|
-
} else {
|
|
232
|
-
if (_this__u8e3s4 instanceof Primitive) {
|
|
233
|
-
tmp = emitType(this, _this__u8e3s4);
|
|
234
|
-
} else {
|
|
235
|
-
if (_this__u8e3s4 == null) {
|
|
236
|
-
tmp = void_0;
|
|
237
|
-
} else {
|
|
238
|
-
noWhenBranchMatchedException();
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
return tmp;
|
|
247
|
-
}
|
|
248
|
-
function emitRoot$default(_this__u8e3s4, void_0, $super) {
|
|
249
|
-
void_0 = void_0 === VOID ? 'void' : void_0;
|
|
250
|
-
return $super === VOID ? this.x1x(_this__u8e3s4, void_0) : emitRoot(_this__u8e3s4, void_0);
|
|
251
|
-
}
|
|
252
|
-
function emit_7(_this__u8e3s4) {
|
|
253
|
-
var tmp;
|
|
254
|
-
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
255
|
-
tmp = 'return java.util.regex.Pattern.compile("' + replace(this.qq(_this__u8e3s4.qt_1), '\\', '\\\\') + '").matcher(value).find();';
|
|
256
|
-
} else {
|
|
257
|
-
if (_this__u8e3s4 instanceof Bound) {
|
|
258
|
-
var tmp1_safe_receiver = _this__u8e3s4.gu_1;
|
|
259
|
-
var tmp_0;
|
|
260
|
-
if (tmp1_safe_receiver == null) {
|
|
261
|
-
tmp_0 = null;
|
|
262
|
-
} else {
|
|
263
|
-
// Inline function 'kotlin.let' call
|
|
264
|
-
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
265
|
-
}
|
|
266
|
-
var minCheck = tmp_0;
|
|
267
|
-
var tmp2_safe_receiver = _this__u8e3s4.hu_1;
|
|
268
|
-
var tmp_1;
|
|
269
|
-
if (tmp2_safe_receiver == null) {
|
|
270
|
-
tmp_1 = null;
|
|
271
|
-
} else {
|
|
272
|
-
// Inline function 'kotlin.let' call
|
|
273
|
-
tmp_1 = 'value < ' + tmp2_safe_receiver;
|
|
274
|
-
}
|
|
275
|
-
var maxCheck = tmp_1;
|
|
276
|
-
var checks = joinToString(listOfNotNull([minCheck, maxCheck]), ' && ');
|
|
277
|
-
var tmp_2;
|
|
278
|
-
// Inline function 'kotlin.text.isEmpty' call
|
|
279
|
-
if (charSequenceLength(checks) === 0) {
|
|
280
|
-
tmp_2 = 'true';
|
|
281
|
-
} else {
|
|
282
|
-
tmp_2 = checks;
|
|
283
|
-
}
|
|
284
|
-
tmp = 'return ' + tmp_2 + ';';
|
|
285
|
-
} else {
|
|
286
|
-
noWhenBranchMatchedException();
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
return tmp;
|
|
290
|
-
}
|
|
291
|
-
initMetadataForInterface(JavaTypeDefinitionEmitter, 'JavaTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter]);
|
|
292
|
-
function emit_8(channel) {
|
|
293
|
-
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |@FunctionalInterface\n |public interface ' + this.or(channel.dp_1) + ' {\n | void invoke(' + emitFullyQualified(this, channel, channel.ep_1) + this.w1x(channel.ep_1) + ' message);\n |}\n |\n ');
|
|
294
|
-
}
|
|
295
|
-
initMetadataForInterface(JavaChannelDefinitionEmitter, 'JavaChannelDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
296
|
-
function emit_9(identifier) {
|
|
297
|
-
var tmp;
|
|
298
|
-
if (identifier instanceof DefinitionIdentifier) {
|
|
299
|
-
tmp = this.h1y(identifier.l1());
|
|
300
|
-
} else {
|
|
301
|
-
if (identifier instanceof FieldIdentifier) {
|
|
302
|
-
tmp = this.l1y(this.h1y(identifier.l1()));
|
|
303
|
-
} else {
|
|
304
|
-
noWhenBranchMatchedException();
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
return tmp;
|
|
308
|
-
}
|
|
309
|
-
function sanitizeSymbol(_this__u8e3s4) {
|
|
310
|
-
// Inline function 'kotlin.collections.mapIndexed' call
|
|
311
|
-
var this_0 = split(_this__u8e3s4, ['.', ' ', '-']);
|
|
312
|
-
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
313
|
-
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
314
|
-
var index = 0;
|
|
315
|
-
var _iterator__ex2g4s = this_0.t();
|
|
316
|
-
while (_iterator__ex2g4s.u()) {
|
|
317
|
-
var item = _iterator__ex2g4s.v();
|
|
318
|
-
var _unary__edvuaz = index;
|
|
319
|
-
index = _unary__edvuaz + 1 | 0;
|
|
320
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.fr(item) : item;
|
|
321
|
-
destination.x(tmp$ret$0);
|
|
322
|
-
}
|
|
323
|
-
var tmp = asSequence(joinToString(destination, ''));
|
|
324
|
-
return this.k1y(joinToString_0(filter(tmp, JavaIdentifierEmitter$sanitizeSymbol$lambda), ''));
|
|
325
|
-
}
|
|
326
|
-
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
327
|
-
var tmp;
|
|
328
|
-
var tmp0_safe_receiver = firstOrNull(_this__u8e3s4);
|
|
329
|
-
var tmp_0;
|
|
330
|
-
var tmp_1 = tmp0_safe_receiver;
|
|
331
|
-
if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
|
|
332
|
-
tmp_0 = null;
|
|
333
|
-
} else {
|
|
334
|
-
tmp_0 = isDigit(tmp0_safe_receiver);
|
|
335
|
-
}
|
|
336
|
-
if (tmp_0 === true) {
|
|
337
|
-
tmp = '_' + _this__u8e3s4;
|
|
338
|
-
} else {
|
|
339
|
-
tmp = _this__u8e3s4;
|
|
340
|
-
}
|
|
341
|
-
return tmp;
|
|
342
|
-
}
|
|
343
|
-
function sanitizeKeywords(_this__u8e3s4) {
|
|
344
|
-
return Companion_getInstance_0().n1y_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
345
|
-
}
|
|
346
|
-
initMetadataForInterface(JavaIdentifierEmitter, 'JavaIdentifierEmitter');
|
|
347
|
-
function emit_10(enum_0, module_0) {
|
|
348
|
-
var tmp = this.or(enum_0.yr_1);
|
|
349
|
-
return trimMargin('\n |public enum ' + tmp + ' implements Wirespec.Enum {\n |' + spacer(joinToString(enum_0.zr_1, ',\n', VOID, VOID, VOID, VOID, JavaEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'public final String label;\n |' + Spacer_instance.toString() + this.or(enum_0.yr_1) + '(String label) {\n |' + Spacer_instance.is(2) + 'this.label = label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() {\n |' + Spacer_instance.is(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String label() {\n |' + Spacer_instance.is(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
350
|
-
}
|
|
351
|
-
initMetadataForInterface(JavaEnumDefinitionEmitter, 'JavaEnumDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
352
|
-
function emit_11(endpoint) {
|
|
353
|
-
var tmp = emitImports_0(this, endpoint);
|
|
354
|
-
var tmp_0 = this.or(endpoint.vp_1);
|
|
355
|
-
var tmp_1 = get_pathParams(endpoint);
|
|
356
|
-
var tmp_2 = emitObject(this, tmp_1, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
|
|
357
|
-
var tmp_3 = emitObject(this, endpoint.yp_1, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
358
|
-
var tmp_4 = emitObject(this, endpoint.zp_1, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
359
|
-
var tmp_5 = this.i1y(first_0(endpoint.aq_1), endpoint);
|
|
360
|
-
var tmp_6 = Spacer_instance.toString();
|
|
361
|
-
var tmp_7 = emitStatusInterfaces(this, endpoint);
|
|
362
|
-
var tmp_8 = emitResponseInterfaces(this, endpoint);
|
|
363
|
-
var tmp_9 = distinctByStatus(endpoint.bq_1);
|
|
364
|
-
var tmp_10 = joinToString(tmp_9, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
365
|
-
var tmp_11 = Spacer_instance.toString();
|
|
366
|
-
var tmp_12 = emitRequestFunctions(this, first_0(endpoint.aq_1), endpoint);
|
|
367
|
-
var tmp_13 = Spacer_instance.is(2);
|
|
368
|
-
var tmp_14 = distinctByStatus(endpoint.bq_1);
|
|
369
|
-
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
370
|
-
var tmp_16 = Spacer_instance.is(3);
|
|
371
|
-
var tmp_17 = Spacer_instance.is(2);
|
|
372
|
-
var tmp_18 = Spacer_instance.is(2);
|
|
373
|
-
var tmp_19 = emitFromResponse(this, endpoint);
|
|
374
|
-
var tmp_20 = Spacer_instance.is(2);
|
|
375
|
-
var tmp_21 = Spacer_instance.is(2);
|
|
376
|
-
var tmp_22 = this.m1y(endpoint);
|
|
377
|
-
var tmp_23 = Spacer_instance.is(2);
|
|
378
|
-
var tmp_24 = Spacer_instance.is(3);
|
|
379
|
-
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.xp_1, '/', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_4) + '"; }\n |' + Spacer_instance.is(3) + '@Override public String getMethod() { return "' + endpoint.wp_1.toString() + '"; }\n |' + Spacer_instance.is(3) + '@Override public Wirespec.ServerEdge<Request, Response<?>> getServer(Wirespec.Serialization serialization) {\n |' + Spacer_instance.is(4) + 'return new Wirespec.ServerEdge<>() {\n |' + Spacer_instance.is(5) + '@Override public Request from(Wirespec.RawRequest request) { return fromRequest(serialization, request); }\n |' + Spacer_instance.is(5) + '@Override public Wirespec.RawResponse to(Response<?> response) { return toResponse(serialization, response); }\n |' + Spacer_instance.is(4) + '};\n |' + Spacer_instance.is(3) + '}\n |' + Spacer_instance.is(3) + '@Override public Wirespec.ClientEdge<Request, Response<?>> getClient(Wirespec.Serialization serialization) {\n |' + Spacer_instance.is(4) + 'return new Wirespec.ClientEdge<>() {\n |' + Spacer_instance.is(5) + '@Override public Wirespec.RawRequest to(Request request) { return toRequest(serialization, request); }\n |' + Spacer_instance.is(5) + '@Override public Response<?> from(Wirespec.RawResponse response) { return fromResponse(serialization, response); }\n |' + Spacer_instance.is(4) + '};\n |' + Spacer_instance.is(3) + '}\n |' + Spacer_instance.is(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
380
|
-
}
|
|
381
|
-
function emitHandleFunction(endpoint) {
|
|
382
|
-
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.gr(this.or(endpoint.vp_1)) + '(Request request);';
|
|
383
|
-
}
|
|
384
|
-
function emit_12(_this__u8e3s4, endpoint) {
|
|
385
|
-
return trimMargin('\n |' + Spacer_instance.toString() + 'record Request (\n |' + Spacer_instance.is(2) + 'Path path,\n |' + Spacer_instance.is(2) + 'Wirespec.Method method,\n |' + Spacer_instance.is(2) + 'Queries queries,\n |' + Spacer_instance.is(2) + 'RequestHeaders headers,\n |' + Spacer_instance.is(2) + emit_16(this, _this__u8e3s4.eq_1) + ' body\n |' + Spacer_instance.toString() + ') implements Wirespec.Request<' + emit_16(this, _this__u8e3s4.eq_1) + '> {\n |' + Spacer_instance.is(2) + emitConstructor(this, _this__u8e3s4, endpoint) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
386
|
-
}
|
|
387
|
-
function emit_13(_this__u8e3s4) {
|
|
388
|
-
var tmp = Spacer_instance.toString();
|
|
389
|
-
var tmp_0 = Companion_instance_1.fr(_this__u8e3s4.hq_1);
|
|
390
|
-
var tmp_1 = Spacer_instance.is(2);
|
|
391
|
-
var tmp_2 = Spacer_instance.is(2);
|
|
392
|
-
var tmp_3 = Spacer_instance.is(2);
|
|
393
|
-
var tmp_4 = emit_16(this, _this__u8e3s4.jq_1);
|
|
394
|
-
var tmp_5 = Spacer_instance.toString();
|
|
395
|
-
var tmp_6 = toString_0(first(_this__u8e3s4.hq_1));
|
|
396
|
-
var tmp_7 = emit_16(this, _this__u8e3s4.jq_1);
|
|
397
|
-
var tmp_8 = concatGenerics(emit_16(this, _this__u8e3s4.jq_1));
|
|
398
|
-
var tmp_9 = Spacer_instance.is(2);
|
|
399
|
-
var tmp_10 = Companion_instance_1.fr(_this__u8e3s4.hq_1);
|
|
400
|
-
var tmp_11 = orNull(joinToString(_this__u8e3s4.iq_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_5(this)));
|
|
401
|
-
var tmp0_safe_receiver = _this__u8e3s4.jq_1;
|
|
402
|
-
var tmp_12;
|
|
403
|
-
if (tmp0_safe_receiver == null) {
|
|
404
|
-
tmp_12 = null;
|
|
405
|
-
} else {
|
|
406
|
-
// Inline function 'kotlin.let' call
|
|
407
|
-
tmp_12 = emit_16(this, tmp0_safe_receiver) + ' body';
|
|
408
|
-
}
|
|
409
|
-
var tmp_13 = joinToString(listOfNotNull([tmp_11, tmp_12]));
|
|
410
|
-
var tmp_14 = Spacer_instance.is(3);
|
|
411
|
-
var tmp_15 = fixStatus(_this__u8e3s4.hq_1);
|
|
412
|
-
// Inline function 'kotlin.let' call
|
|
413
|
-
var tmp_16 = 'new Headers(' + joinToString(_this__u8e3s4.iq_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_6(this)) + ')';
|
|
414
|
-
var tmp_17 = _this__u8e3s4.jq_1 == null ? 'null' : 'body';
|
|
415
|
-
var tmp_18 = Spacer_instance.is(2);
|
|
416
|
-
var tmp_19 = Spacer_instance.is(1);
|
|
417
|
-
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.iq_1, 'Headers', 'Wirespec.Response.Headers', JavaEndpointDefinitionEmitter$emit$lambda_7(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
418
|
-
}
|
|
419
|
-
initMetadataForInterface(JavaEndpointDefinitionEmitter, 'JavaEndpointDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
420
|
-
function emit_14(refined) {
|
|
421
|
-
return trimMargin('\n |public record ' + this.or(refined.tr_1) + ' (' + this.oq(refined.ur_1) + ' value) implements Wirespec.Refined<' + this.oq(refined.ur_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.cs(refined) + '\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public ' + this.oq(refined.ur_1) + ' value() { return value; }\n |}\n |\n ');
|
|
422
|
-
}
|
|
423
|
-
function emitValidator(_this__u8e3s4) {
|
|
424
|
-
var defaultReturn = 'return true;';
|
|
425
|
-
var type = _this__u8e3s4.ur_1.gv_1;
|
|
426
|
-
var tmp;
|
|
427
|
-
if (type instanceof Integer) {
|
|
428
|
-
var tmp0_safe_receiver = type.lu_1;
|
|
429
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.pq(tmp0_safe_receiver);
|
|
430
|
-
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
431
|
-
} else {
|
|
432
|
-
if (type instanceof Number_0) {
|
|
433
|
-
var tmp2_safe_receiver = type.ou_1;
|
|
434
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.pq(tmp2_safe_receiver);
|
|
435
|
-
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
436
|
-
} else {
|
|
437
|
-
if (type instanceof String_0) {
|
|
438
|
-
var tmp4_safe_receiver = type.iu_1;
|
|
439
|
-
var tmp_0;
|
|
440
|
-
var tmp_1 = tmp4_safe_receiver;
|
|
441
|
-
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
442
|
-
tmp_0 = null;
|
|
443
|
-
} else {
|
|
444
|
-
tmp_0 = this.pq(new RegExp_0(tmp4_safe_receiver));
|
|
445
|
-
}
|
|
446
|
-
var tmp5_elvis_lhs = tmp_0;
|
|
447
|
-
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
448
|
-
} else {
|
|
449
|
-
if (equals(type, Boolean_instance)) {
|
|
450
|
-
tmp = defaultReturn;
|
|
451
|
-
} else {
|
|
452
|
-
if (equals(type, Bytes_instance)) {
|
|
453
|
-
tmp = defaultReturn;
|
|
454
|
-
} else {
|
|
455
|
-
noWhenBranchMatchedException();
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
return tmp;
|
|
462
|
-
}
|
|
463
|
-
initMetadataForInterface(JavaRefinedTypeDefinitionEmitter, 'JavaRefinedTypeDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
464
|
-
function emit_15(union) {
|
|
465
|
-
var tmp = this.or(union.hp_1);
|
|
466
|
-
return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.ip_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
|
|
467
|
-
}
|
|
468
|
-
initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
469
|
-
initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [JavaEnumDefinitionEmitter, JavaEndpointDefinitionEmitter, JavaRefinedTypeDefinitionEmitter, JavaIdentifierEmitter, JavaUnionDefinitionEmitter, JavaTypeDefinitionEmitter, JavaChannelDefinitionEmitter, LanguageEmitter]);
|
|
470
|
-
initMetadataForCompanion(Companion);
|
|
471
|
-
initMetadataForCompanion(Companion_0);
|
|
472
|
-
initMetadataForClass(JavaIrEmitter, 'JavaIrEmitter', JavaIrEmitter, VOID, [IrEmitter]);
|
|
473
|
-
initMetadataForObject(JavaShared, 'JavaShared');
|
|
474
|
-
//endregion
|
|
475
|
-
function emitImports($this, _this__u8e3s4) {
|
|
476
|
-
// Inline function 'kotlin.collections.filter' call
|
|
477
|
-
var tmp0 = importReferences(_this__u8e3s4);
|
|
478
|
-
// Inline function 'kotlin.collections.filterTo' call
|
|
479
|
-
var destination = ArrayList_init_$Create$();
|
|
480
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
481
|
-
while (_iterator__ex2g4s.u()) {
|
|
482
|
-
var element = _iterator__ex2g4s.v();
|
|
483
|
-
if (!(_this__u8e3s4.nr().l1() === element.cv_1)) {
|
|
484
|
-
destination.x(element);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
// Inline function 'kotlin.collections.map' call
|
|
488
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
489
|
-
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
|
|
490
|
-
var _iterator__ex2g4s_0 = destination.t();
|
|
491
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
492
|
-
var item = _iterator__ex2g4s_0.v();
|
|
493
|
-
var tmp$ret$3 = 'import ' + $this.v1x().es_1 + '.model.' + item.cv_1 + ';';
|
|
494
|
-
destination_0.x(tmp$ret$3);
|
|
495
|
-
}
|
|
496
|
-
var tmp = destination_0;
|
|
497
|
-
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaChannelDefinitionEmitter$emitImports$lambda);
|
|
498
|
-
}
|
|
499
|
-
function emitFullyQualified($this, _this__u8e3s4, reference) {
|
|
500
|
-
var tmp;
|
|
501
|
-
if (_this__u8e3s4.nr().l1() === reference.l1()) {
|
|
502
|
-
tmp = $this.v1x().es_1 + '.model.';
|
|
503
|
-
} else {
|
|
504
|
-
tmp = '';
|
|
505
|
-
}
|
|
506
|
-
return tmp;
|
|
507
|
-
}
|
|
508
|
-
function JavaChannelDefinitionEmitter$emitImports$lambda(it) {
|
|
509
|
-
// Inline function 'kotlin.text.trimStart' call
|
|
510
|
-
return toString(trimStart(isCharSequence(it) ? it : THROW_CCE()));
|
|
511
|
-
}
|
|
512
|
-
function JavaChannelDefinitionEmitter() {
|
|
513
|
-
}
|
|
514
|
-
function JavaEmitter(packageName, emitShared) {
|
|
515
|
-
packageName = packageName === VOID ? Companion_instance.ds('community.flock.wirespec.generated') : packageName;
|
|
516
|
-
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
517
|
-
LanguageEmitter.call(this);
|
|
518
|
-
this.y1x_1 = packageName;
|
|
519
|
-
this.z1x_1 = emitShared;
|
|
520
|
-
this.a1y_1 = '\nimport community.flock.wirespec.java.Wirespec;\n';
|
|
521
|
-
this.b1y_1 = FileExtension_Java_getInstance();
|
|
522
|
-
this.c1y_1 = JavaShared_getInstance();
|
|
523
|
-
this.d1y_1 = '//';
|
|
524
|
-
}
|
|
525
|
-
protoOf(JavaEmitter).v1x = function () {
|
|
526
|
-
return this.y1x_1;
|
|
527
|
-
};
|
|
528
|
-
protoOf(JavaEmitter).vq = function () {
|
|
529
|
-
return this.b1y_1;
|
|
530
|
-
};
|
|
531
|
-
protoOf(JavaEmitter).e1y = function () {
|
|
532
|
-
return this.c1y_1;
|
|
533
|
-
};
|
|
534
|
-
protoOf(JavaEmitter).wq = function () {
|
|
535
|
-
return this.d1y_1;
|
|
536
|
-
};
|
|
537
|
-
protoOf(JavaEmitter).lr = function (module_0, logger) {
|
|
538
|
-
// Inline function 'kotlin.let' call
|
|
539
|
-
var it = protoOf(LanguageEmitter).lr.call(this, module_0, logger);
|
|
540
|
-
return this.z1x_1.xo_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.ds('community.flock.wirespec.java').gs() + 'Wirespec', this.e1y().g1y_1)) : it;
|
|
541
|
-
};
|
|
542
|
-
protoOf(JavaEmitter).mr = function (definition, module_0, logger) {
|
|
543
|
-
// Inline function 'kotlin.let' call
|
|
544
|
-
var it = protoOf(LanguageEmitter).mr.call(this, definition, module_0, logger);
|
|
545
|
-
var subPackageName = plus(this.v1x(), definition);
|
|
546
|
-
var tmp = subPackageName.gs() + this.h1y(it.yo_1);
|
|
547
|
-
// Inline function 'kotlin.text.trimStart' call
|
|
548
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.hr(module_0) ? this.a1y_1 : '') + '\n |' + it.zo_1 + '\n ');
|
|
549
|
-
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
550
|
-
return new Emitted(tmp, tmp$ret$0);
|
|
551
|
-
};
|
|
552
|
-
function emitGetType($this, _this__u8e3s4) {
|
|
553
|
-
return 'Wirespec.getType(' + $this.x1x(_this__u8e3s4, 'Void') + '.class, ' + emitGetTypeRaw($this, _this__u8e3s4) + ')';
|
|
554
|
-
}
|
|
555
|
-
function emitGetTypeRaw($this, _this__u8e3s4) {
|
|
556
|
-
var tmp;
|
|
557
|
-
var tmp1_elvis_lhs = _this__u8e3s4 == null ? null : _this__u8e3s4.uu();
|
|
558
|
-
if (tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs) {
|
|
559
|
-
tmp = 'java.util.Optional.class';
|
|
560
|
-
} else {
|
|
561
|
-
if (_this__u8e3s4 instanceof Iterable) {
|
|
562
|
-
tmp = 'java.util.List.class';
|
|
563
|
-
} else {
|
|
564
|
-
tmp = null;
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
return tmp;
|
|
568
|
-
}
|
|
569
|
-
function emitConstructor($this, _this__u8e3s4, endpoint) {
|
|
570
|
-
var tmp = get_pathParams(endpoint);
|
|
571
|
-
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda($this)));
|
|
572
|
-
var tmp_1 = orNull(joinToString(endpoint.yp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_0($this)));
|
|
573
|
-
var tmp_2 = orNull(joinToString(endpoint.zp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_1($this)));
|
|
574
|
-
var tmp0_safe_receiver = _this__u8e3s4.eq_1;
|
|
575
|
-
var tmp_3;
|
|
576
|
-
if (tmp0_safe_receiver == null) {
|
|
577
|
-
tmp_3 = null;
|
|
578
|
-
} else {
|
|
579
|
-
// Inline function 'kotlin.let' call
|
|
580
|
-
tmp_3 = emit_16($this, tmp0_safe_receiver) + ' body';
|
|
581
|
-
}
|
|
582
|
-
var tmp_4 = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]));
|
|
583
|
-
var tmp_5 = Spacer_instance.is(3);
|
|
584
|
-
var tmp_6 = get_pathParams(endpoint);
|
|
585
|
-
// Inline function 'kotlin.let' call
|
|
586
|
-
var tmp$ret$3 = 'new Path(' + joinToString(tmp_6, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_2($this)) + ')';
|
|
587
|
-
var tmp1_elvis_lhs = orNull(tmp$ret$3);
|
|
588
|
-
var tmp_7 = tmp1_elvis_lhs == null ? 'new Path()' : tmp1_elvis_lhs;
|
|
589
|
-
var tmp_8 = 'Wirespec.Method.' + endpoint.wp_1.a3_1;
|
|
590
|
-
// Inline function 'kotlin.let' call
|
|
591
|
-
var tmp$ret$5 = 'new Queries(' + joinToString(endpoint.yp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_3($this)) + ')';
|
|
592
|
-
var tmp2_elvis_lhs = orNull(tmp$ret$5);
|
|
593
|
-
var tmp_9 = tmp2_elvis_lhs == null ? 'new Queries()' : tmp2_elvis_lhs;
|
|
594
|
-
// Inline function 'kotlin.let' call
|
|
595
|
-
var tmp$ret$7 = 'new RequestHeaders(' + joinToString(endpoint.zp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_4($this)) + ')';
|
|
596
|
-
var tmp3_elvis_lhs = orNull(tmp$ret$7);
|
|
597
|
-
var tmp_10 = tmp3_elvis_lhs == null ? 'new RequestHeaders()' : tmp3_elvis_lhs;
|
|
598
|
-
var tmp_11;
|
|
599
|
-
if (_this__u8e3s4.eq_1 == null) {
|
|
600
|
-
tmp_11 = null;
|
|
601
|
-
} else {
|
|
602
|
-
// Inline function 'kotlin.let' call
|
|
603
|
-
tmp_11 = 'body';
|
|
604
|
-
}
|
|
605
|
-
var tmp5_elvis_lhs = tmp_11;
|
|
606
|
-
return 'public Request(' + tmp_4 + ') {\n' + tmp_5 + 'this(' + joinToString(listOfNotNull([tmp_7, tmp_8, tmp_9, tmp_10, tmp5_elvis_lhs == null ? 'null' : tmp5_elvis_lhs])) + ');\n' + Spacer_instance.is(2) + '}';
|
|
607
|
-
}
|
|
608
|
-
function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
609
|
-
var tmp = get_indexedPathParams(endpoint);
|
|
610
|
-
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
|
|
611
|
-
var tmp_1 = orNull(joinToString(endpoint.yp_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
612
|
-
var tmp_2 = orNull(joinToString(endpoint.zp_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
613
|
-
var tmp0_safe_receiver = _this__u8e3s4.eq_1;
|
|
614
|
-
var tmp_3;
|
|
615
|
-
if (tmp0_safe_receiver == null) {
|
|
616
|
-
tmp_3 = null;
|
|
617
|
-
} else {
|
|
618
|
-
// Inline function 'kotlin.let' call
|
|
619
|
-
tmp_3 = Spacer_instance.is(4) + 'request.body().<' + emit_16($this, tmp0_safe_receiver) + '>map(body -> serialization.deserializeBody(body, ' + emitGetType($this, tmp0_safe_receiver.gq_1) + ')).orElse(null)';
|
|
620
|
-
}
|
|
621
|
-
// Inline function 'kotlin.let' call
|
|
622
|
-
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
623
|
-
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.is(3);
|
|
624
|
-
}
|
|
625
|
-
function emitDeserializedParams_0($this, _this__u8e3s4) {
|
|
626
|
-
var tmp = orNull(joinToString(_this__u8e3s4.iq_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2($this)));
|
|
627
|
-
var tmp0_safe_receiver = _this__u8e3s4.jq_1;
|
|
628
|
-
var tmp_0;
|
|
629
|
-
if (tmp0_safe_receiver == null) {
|
|
630
|
-
tmp_0 = null;
|
|
631
|
-
} else {
|
|
632
|
-
// Inline function 'kotlin.let' call
|
|
633
|
-
tmp_0 = Spacer_instance.is(5) + 'response.body().<' + emit_16($this, tmp0_safe_receiver) + '>map(body -> serialization.deserializeBody(body, ' + emitGetType($this, tmp0_safe_receiver.gq_1) + ')).orElse(null)';
|
|
634
|
-
}
|
|
635
|
-
// Inline function 'kotlin.let' call
|
|
636
|
-
var it = joinToString(listOfNotNull([tmp, tmp_0]), ',\n');
|
|
637
|
-
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.is(4);
|
|
638
|
-
}
|
|
639
|
-
function emitSerialized($this, _this__u8e3s4) {
|
|
640
|
-
var tmp;
|
|
641
|
-
if (!(_this__u8e3s4.jq_1 == null)) {
|
|
642
|
-
tmp = 'java.util.Optional.ofNullable(serialization.serializeBody(r.body, ' + emitGetType($this, ensureNotNull(_this__u8e3s4.jq_1).gq_1) + '))';
|
|
643
|
-
} else {
|
|
644
|
-
tmp = 'java.util.Optional.empty()';
|
|
645
|
-
}
|
|
646
|
-
var body = tmp;
|
|
647
|
-
var tmp_0;
|
|
648
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
649
|
-
if (!_this__u8e3s4.iq_1.r()) {
|
|
650
|
-
tmp_0 = 'java.util.Map.ofEntries(' + joinToString(_this__u8e3s4.iq_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitSerialized$lambda($this)) + ')';
|
|
651
|
-
} else {
|
|
652
|
-
tmp_0 = 'java.util.Collections.emptyMap()';
|
|
653
|
-
}
|
|
654
|
-
var headers = tmp_0;
|
|
655
|
-
return Spacer_instance.is(3) + 'if (response instanceof Response' + Companion_instance_1.fr(_this__u8e3s4.hq_1) + ' r) { return new Wirespec.RawResponse(r.status(), ' + headers + ', ' + body + '); }';
|
|
656
|
-
}
|
|
657
|
-
function emitDeserialized($this, _this__u8e3s4) {
|
|
658
|
-
return Spacer_instance.is(4) + 'case ' + _this__u8e3s4.hq_1 + ' -> new Response' + Companion_instance_1.fr(_this__u8e3s4.hq_1) + '(' + emitDeserializedParams_0($this, _this__u8e3s4) + ');';
|
|
659
|
-
}
|
|
660
|
-
function emitSerializedParams($this, _this__u8e3s4, fields) {
|
|
661
|
-
return 'java.util.Map.entry("' + _this__u8e3s4.rp_1.l1() + '", serialization.serializeParam(request.' + (fields === 'queries' ? 'queries' : 'headers') + '().' + $this.or(_this__u8e3s4.rp_1) + '(), ' + emitGetType($this, _this__u8e3s4.sp_1) + '))';
|
|
662
|
-
}
|
|
663
|
-
function emitDeserialized_0($this, _this__u8e3s4) {
|
|
664
|
-
return Spacer_instance.is(4) + 'serialization.deserializePath(request.path().get(' + _this__u8e3s4.te_1 + '), ' + emitGetType($this, _this__u8e3s4.ue_1.dq_1) + ')';
|
|
665
|
-
}
|
|
666
|
-
function emitDeserializedParams_1($this, _this__u8e3s4, fields, caseSensitive) {
|
|
667
|
-
var tmp;
|
|
668
|
-
if (caseSensitive) {
|
|
669
|
-
tmp = 'request.' + fields + '().getOrDefault("' + _this__u8e3s4.rp_1.l1() + '", java.util.Collections.emptyList())';
|
|
670
|
-
} else {
|
|
671
|
-
tmp = 'request.' + fields + '().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + _this__u8e3s4.rp_1.l1() + '")).findFirst().map(java.util.Map.Entry::getValue).orElse(java.util.Collections.emptyList())';
|
|
672
|
-
}
|
|
673
|
-
var valuesFromField = tmp;
|
|
674
|
-
return Spacer_instance.is(4) + 'serialization.<' + $this.oq(_this__u8e3s4.sp_1) + '>deserializeParam(' + valuesFromField + ', ' + emitGetType($this, _this__u8e3s4.sp_1) + ')';
|
|
675
|
-
}
|
|
676
|
-
function emitSerializedHeader($this, _this__u8e3s4) {
|
|
677
|
-
return 'java.util.Map.entry("' + _this__u8e3s4.rp_1.l1() + '", serialization.<' + $this.oq(_this__u8e3s4.sp_1) + '>serializeParam(r.headers().' + $this.or(_this__u8e3s4.rp_1) + '(), ' + emitGetType($this, _this__u8e3s4.sp_1) + '))';
|
|
678
|
-
}
|
|
679
|
-
function emitIdentifier($this, _this__u8e3s4) {
|
|
680
|
-
return 'serialization.serializePath(request.path().' + Companion_instance_1.gr($this.or(_this__u8e3s4.cq_1)) + '(), ' + emitGetType($this, _this__u8e3s4.dq_1) + ')';
|
|
681
|
-
}
|
|
682
|
-
function emit_16($this, _this__u8e3s4) {
|
|
683
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.gq_1;
|
|
684
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.oq(tmp1_safe_receiver);
|
|
685
|
-
return tmp2_elvis_lhs == null ? 'Void' : tmp2_elvis_lhs;
|
|
686
|
-
}
|
|
687
|
-
function emit_17($this, _this__u8e3s4) {
|
|
688
|
-
return $this.oq(_this__u8e3s4.dq_1) + ' ' + $this.or(_this__u8e3s4.cq_1);
|
|
689
|
-
}
|
|
690
|
-
function emitImports_0($this, _this__u8e3s4) {
|
|
691
|
-
// Inline function 'kotlin.collections.filter' call
|
|
692
|
-
var tmp0 = importReferences(_this__u8e3s4);
|
|
693
|
-
// Inline function 'kotlin.collections.filterTo' call
|
|
694
|
-
var destination = ArrayList_init_$Create$();
|
|
695
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
696
|
-
while (_iterator__ex2g4s.u()) {
|
|
697
|
-
var element = _iterator__ex2g4s.v();
|
|
698
|
-
if (!(_this__u8e3s4.nr().l1() === element.cv_1)) {
|
|
699
|
-
destination.x(element);
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
// Inline function 'kotlin.collections.map' call
|
|
703
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
704
|
-
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
|
|
705
|
-
var _iterator__ex2g4s_0 = destination.t();
|
|
706
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
707
|
-
var item = _iterator__ex2g4s_0.v();
|
|
708
|
-
var tmp$ret$3 = 'import ' + $this.v1x().es_1 + '.model.' + item.cv_1 + ';';
|
|
709
|
-
destination_0.x(tmp$ret$3);
|
|
710
|
-
}
|
|
711
|
-
var tmp = destination_0;
|
|
712
|
-
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitImports$lambda);
|
|
713
|
-
}
|
|
714
|
-
function emitRequestFunctions($this, _this__u8e3s4, endpoint) {
|
|
715
|
-
var tmp = Spacer_instance.is(2);
|
|
716
|
-
var tmp_0 = Spacer_instance.is(3);
|
|
717
|
-
var tmp_1 = Spacer_instance.is(4);
|
|
718
|
-
var tmp_2 = Spacer_instance.is(4);
|
|
719
|
-
var tmp_3 = joinToString(endpoint.xp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda($this));
|
|
720
|
-
var tmp_4 = Spacer_instance.is(4);
|
|
721
|
-
var tmp_5;
|
|
722
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
723
|
-
if (!endpoint.yp_1.r()) {
|
|
724
|
-
tmp_5 = 'java.util.Map.ofEntries(' + joinToString(endpoint.yp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_0($this)) + ')';
|
|
725
|
-
} else {
|
|
726
|
-
tmp_5 = 'java.util.Collections.emptyMap()';
|
|
727
|
-
}
|
|
728
|
-
var tmp_6 = tmp_5;
|
|
729
|
-
var tmp_7 = Spacer_instance.is(4);
|
|
730
|
-
var tmp_8;
|
|
731
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
732
|
-
if (!endpoint.zp_1.r()) {
|
|
733
|
-
tmp_8 = 'java.util.Map.ofEntries(' + joinToString(endpoint.zp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1($this)) + ')';
|
|
734
|
-
} else {
|
|
735
|
-
tmp_8 = 'java.util.Collections.emptyMap()';
|
|
736
|
-
}
|
|
737
|
-
var tmp_9 = tmp_8;
|
|
738
|
-
var tmp_10 = Spacer_instance.is(4);
|
|
739
|
-
var tmp_11;
|
|
740
|
-
if (!(_this__u8e3s4.eq_1 == null)) {
|
|
741
|
-
var tmp0_safe_receiver = _this__u8e3s4.eq_1;
|
|
742
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.gq_1;
|
|
743
|
-
tmp_11 = 'java.util.Optional.ofNullable(serialization.serializeBody(request.body(), ' + (tmp1_safe_receiver == null ? null : emitGetType($this, tmp1_safe_receiver)) + '))';
|
|
744
|
-
} else {
|
|
745
|
-
tmp_11 = 'java.util.Optional.empty()';
|
|
746
|
-
}
|
|
747
|
-
return trimMargin('\n |' + tmp + 'static Wirespec.RawRequest toRequest(Wirespec.Serializer serialization, Request request) {\n |' + tmp_0 + 'return new Wirespec.RawRequest(\n |' + tmp_1 + 'request.method().name(),\n |' + tmp_2 + 'java.util.List.of(' + tmp_3 + '),\n |' + tmp_4 + tmp_6 + ',\n |' + tmp_7 + tmp_9 + ',\n |' + tmp_10 + tmp_11 + '\n |' + Spacer_instance.is(3) + ');\n |' + Spacer_instance.is(2) + '}\n |\n |' + Spacer_instance.is(2) + 'static Request fromRequest(Wirespec.Deserializer serialization, Wirespec.RawRequest request) {\n |' + Spacer_instance.is(3) + 'return new Request(' + emitDeserializedParams($this, _this__u8e3s4, endpoint) + ');\n |' + Spacer_instance.is(2) + '}\n ');
|
|
748
|
-
}
|
|
749
|
-
function emitObject($this, _this__u8e3s4, name, extends_0, block) {
|
|
750
|
-
var tmp;
|
|
751
|
-
if (_this__u8e3s4.r()) {
|
|
752
|
-
tmp = Spacer_instance.toString() + 'static class ' + name + ' implements ' + extends_0 + ' {}';
|
|
753
|
-
} else {
|
|
754
|
-
var tmp_0 = Spacer_instance.toString();
|
|
755
|
-
tmp = trimMargin('\n |' + tmp_0 + 'public record ' + name + '(\n |' + joinToString(_this__u8e3s4, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitObject$lambda(block)) + '\n |' + Spacer_instance.toString() + ') implements ' + extends_0 + ' {}\n ');
|
|
756
|
-
}
|
|
757
|
-
return tmp;
|
|
758
|
-
}
|
|
759
|
-
function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
760
|
-
// Inline function 'kotlin.collections.map' call
|
|
761
|
-
var this_0 = distinctByStatus(_this__u8e3s4.bq_1);
|
|
762
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
763
|
-
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
764
|
-
var _iterator__ex2g4s = this_0.t();
|
|
765
|
-
while (_iterator__ex2g4s.u()) {
|
|
766
|
-
var item = _iterator__ex2g4s.v();
|
|
767
|
-
var tmp$ret$0 = emit_16($this, item.jq_1);
|
|
768
|
-
destination.x(tmp$ret$0);
|
|
769
|
-
}
|
|
770
|
-
var tmp = distinct(destination);
|
|
771
|
-
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitResponseInterfaces$lambda);
|
|
772
|
-
}
|
|
773
|
-
function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
774
|
-
// Inline function 'kotlin.collections.map' call
|
|
775
|
-
var this_0 = _this__u8e3s4.bq_1;
|
|
776
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
777
|
-
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
778
|
-
var _iterator__ex2g4s = this_0.t();
|
|
779
|
-
while (_iterator__ex2g4s.u()) {
|
|
780
|
-
var item = _iterator__ex2g4s.v();
|
|
781
|
-
var tmp$ret$0 = new Char(first(item.hq_1));
|
|
782
|
-
destination.x(tmp$ret$0);
|
|
783
|
-
}
|
|
784
|
-
var tmp = distinct(destination);
|
|
785
|
-
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitStatusInterfaces$lambda);
|
|
786
|
-
}
|
|
787
|
-
function emitFromResponse($this, _this__u8e3s4) {
|
|
788
|
-
// Inline function 'kotlin.collections.filter' call
|
|
789
|
-
var tmp0 = distinctByStatus(_this__u8e3s4.bq_1);
|
|
790
|
-
// Inline function 'kotlin.collections.filterTo' call
|
|
791
|
-
var destination = ArrayList_init_$Create$();
|
|
792
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
793
|
-
while (_iterator__ex2g4s.u()) {
|
|
794
|
-
var element = _iterator__ex2g4s.v();
|
|
795
|
-
if (Companion_instance_1.jr(element.hq_1)) {
|
|
796
|
-
destination.x(element);
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
var statusResponses = destination;
|
|
800
|
-
var tmp;
|
|
801
|
-
if (statusResponses.r()) {
|
|
802
|
-
tmp = trimMargin('\n |' + Spacer_instance.is(3) + 'throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n ');
|
|
803
|
-
} else if (statusResponses.a1() === 1) {
|
|
804
|
-
var response = first_0(statusResponses);
|
|
805
|
-
tmp = trimMargin('\n |' + Spacer_instance.is(3) + 'if (response.statusCode() == ' + response.hq_1 + ') {\n |' + Spacer_instance.is(4) + 'return new Response' + Companion_instance_1.fr(response.hq_1) + '(' + emitDeserializedParams_0($this, response) + ');\n |' + Spacer_instance.is(3) + '} else {\n |' + Spacer_instance.is(4) + 'throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n |' + Spacer_instance.is(3) + '}\n ');
|
|
806
|
-
} else {
|
|
807
|
-
var tmp_0 = Spacer_instance.is(3);
|
|
808
|
-
tmp = trimMargin('\n |' + tmp_0 + 'return switch (response.statusCode()) {\n |' + joinToString(statusResponses, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitFromResponse$lambda($this)) + '\n |' + Spacer_instance.is(4) + 'default -> throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n |' + Spacer_instance.is(3) + '};\n ');
|
|
809
|
-
}
|
|
810
|
-
return tmp;
|
|
811
|
-
}
|
|
812
|
-
function JavaEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
813
|
-
return function (it) {
|
|
814
|
-
return emit_17(this$0, it);
|
|
815
|
-
};
|
|
816
|
-
}
|
|
817
|
-
function JavaEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
818
|
-
return function (it) {
|
|
819
|
-
return this$0.nq(it);
|
|
820
|
-
};
|
|
821
|
-
}
|
|
822
|
-
function JavaEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
823
|
-
return function (it) {
|
|
824
|
-
return this$0.nq(it);
|
|
825
|
-
};
|
|
826
|
-
}
|
|
827
|
-
function JavaEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
828
|
-
return function (it) {
|
|
829
|
-
return this$0.j1y(it);
|
|
830
|
-
};
|
|
831
|
-
}
|
|
832
|
-
function JavaEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
833
|
-
return function (it) {
|
|
834
|
-
return emitSerialized(this$0, it);
|
|
835
|
-
};
|
|
836
|
-
}
|
|
837
|
-
function JavaEndpointDefinitionEmitter$emit$lambda_4(it) {
|
|
838
|
-
return emit(it);
|
|
839
|
-
}
|
|
840
|
-
function JavaEndpointDefinitionEmitter$emitConstructor$lambda(this$0) {
|
|
841
|
-
return function (it) {
|
|
842
|
-
return emit_17(this$0, it);
|
|
843
|
-
};
|
|
844
|
-
}
|
|
845
|
-
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_0(this$0) {
|
|
846
|
-
return function (it) {
|
|
847
|
-
return this$0.nq(it);
|
|
848
|
-
};
|
|
849
|
-
}
|
|
850
|
-
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_1(this$0) {
|
|
851
|
-
return function (it) {
|
|
852
|
-
return this$0.nq(it);
|
|
853
|
-
};
|
|
854
|
-
}
|
|
855
|
-
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_2(this$0) {
|
|
856
|
-
return function (it) {
|
|
857
|
-
return this$0.or(it.cq_1);
|
|
858
|
-
};
|
|
859
|
-
}
|
|
860
|
-
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_3(this$0) {
|
|
861
|
-
return function (it) {
|
|
862
|
-
return this$0.or(it.rp_1);
|
|
863
|
-
};
|
|
864
|
-
}
|
|
865
|
-
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_4(this$0) {
|
|
866
|
-
return function (it) {
|
|
867
|
-
return this$0.or(it.rp_1);
|
|
868
|
-
};
|
|
869
|
-
}
|
|
870
|
-
function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda(this$0) {
|
|
871
|
-
return function (it) {
|
|
872
|
-
return emitDeserialized_0(this$0, it);
|
|
873
|
-
};
|
|
874
|
-
}
|
|
875
|
-
function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_0(this$0) {
|
|
876
|
-
return function (it) {
|
|
877
|
-
return emitDeserializedParams_1(this$0, it, 'queries', true);
|
|
878
|
-
};
|
|
879
|
-
}
|
|
880
|
-
function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1(this$0) {
|
|
881
|
-
return function (it) {
|
|
882
|
-
return emitDeserializedParams_1(this$0, it, 'headers', false);
|
|
883
|
-
};
|
|
884
|
-
}
|
|
885
|
-
function JavaEndpointDefinitionEmitter$emit$lambda_5(this$0) {
|
|
886
|
-
return function (it) {
|
|
887
|
-
return this$0.nq(it);
|
|
888
|
-
};
|
|
889
|
-
}
|
|
890
|
-
function JavaEndpointDefinitionEmitter$emit$lambda_6(this$0) {
|
|
891
|
-
return function (it) {
|
|
892
|
-
return this$0.or(it.rp_1);
|
|
893
|
-
};
|
|
894
|
-
}
|
|
895
|
-
function JavaEndpointDefinitionEmitter$emit$lambda_7(this$0) {
|
|
896
|
-
return function (it) {
|
|
897
|
-
return this$0.nq(it);
|
|
898
|
-
};
|
|
899
|
-
}
|
|
900
|
-
function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2(this$0) {
|
|
901
|
-
return function (it) {
|
|
902
|
-
return Spacer_instance.is(5) + 'serialization.<' + this$0.oq(it.sp_1) + '>deserializeParam(response.headers().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + it.rp_1.l1() + '")).findFirst().map(java.util.Map.Entry::getValue).orElse(java.util.Collections.emptyList()), ' + emitGetType(this$0, it.sp_1) + ')';
|
|
903
|
-
};
|
|
904
|
-
}
|
|
905
|
-
function JavaEndpointDefinitionEmitter$emitSerialized$lambda(this$0) {
|
|
906
|
-
return function (it) {
|
|
907
|
-
return emitSerializedHeader(this$0, it);
|
|
908
|
-
};
|
|
909
|
-
}
|
|
910
|
-
function JavaEndpointDefinitionEmitter$emitImports$lambda(it) {
|
|
911
|
-
// Inline function 'kotlin.text.trimStart' call
|
|
912
|
-
return toString(trimStart(isCharSequence(it) ? it : THROW_CCE()));
|
|
913
|
-
}
|
|
914
|
-
function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda(this$0) {
|
|
915
|
-
return function (it) {
|
|
916
|
-
var tmp;
|
|
917
|
-
if (it instanceof Literal) {
|
|
918
|
-
tmp = '"' + it.yq_1 + '"';
|
|
919
|
-
} else {
|
|
920
|
-
if (it instanceof Param) {
|
|
921
|
-
tmp = emitIdentifier(this$0, it);
|
|
922
|
-
} else {
|
|
923
|
-
noWhenBranchMatchedException();
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
return tmp;
|
|
927
|
-
};
|
|
928
|
-
}
|
|
929
|
-
function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_0(this$0) {
|
|
930
|
-
return function (it) {
|
|
931
|
-
return emitSerializedParams(this$0, it, 'queries');
|
|
932
|
-
};
|
|
933
|
-
}
|
|
934
|
-
function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1(this$0) {
|
|
935
|
-
return function (it) {
|
|
936
|
-
return emitSerializedParams(this$0, it, 'headers');
|
|
937
|
-
};
|
|
938
|
-
}
|
|
939
|
-
function JavaEndpointDefinitionEmitter$emitObject$lambda($block) {
|
|
940
|
-
return function (it) {
|
|
941
|
-
return Spacer_instance.is(2) + $block(it);
|
|
942
|
-
};
|
|
943
|
-
}
|
|
944
|
-
function JavaEndpointDefinitionEmitter$emitResponseInterfaces$lambda(it) {
|
|
945
|
-
return Spacer_instance.toString() + 'sealed interface Response' + concatGenerics(it) + ' extends Response<' + it + '> {}';
|
|
946
|
-
}
|
|
947
|
-
function JavaEndpointDefinitionEmitter$emitStatusInterfaces$lambda(it) {
|
|
948
|
-
return Spacer_instance.toString() + 'sealed interface Response' + toString_0(it.h1_1) + 'XX<T> extends Response<T> {}';
|
|
949
|
-
}
|
|
950
|
-
function JavaEndpointDefinitionEmitter$emitFromResponse$lambda(this$0) {
|
|
951
|
-
return function (it) {
|
|
952
|
-
return emitDeserialized(this$0, it);
|
|
953
|
-
};
|
|
954
|
-
}
|
|
955
|
-
function JavaEndpointDefinitionEmitter() {
|
|
956
|
-
}
|
|
957
|
-
function sanitizeNegative($this, _this__u8e3s4) {
|
|
958
|
-
return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
|
|
959
|
-
}
|
|
960
|
-
function sanitizeEnum($this, _this__u8e3s4) {
|
|
961
|
-
return $this.l1y($this.k1y(joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_')));
|
|
962
|
-
}
|
|
963
|
-
function JavaEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
964
|
-
return function (it) {
|
|
965
|
-
return sanitizeEnum(this$0, it) + '("' + it + '")';
|
|
966
|
-
};
|
|
967
|
-
}
|
|
968
|
-
function JavaEnumDefinitionEmitter() {
|
|
969
|
-
}
|
|
970
|
-
function Companion() {
|
|
971
|
-
Companion_instance_2 = this;
|
|
972
|
-
this.n1y_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']);
|
|
973
|
-
}
|
|
974
|
-
var Companion_instance_2;
|
|
975
|
-
function Companion_getInstance_0() {
|
|
976
|
-
if (Companion_instance_2 == null)
|
|
977
|
-
new Companion();
|
|
978
|
-
return Companion_instance_2;
|
|
979
|
-
}
|
|
980
|
-
function JavaIdentifierEmitter$sanitizeSymbol$lambda(it) {
|
|
981
|
-
return isLetterOrDigit(it.h1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).u1(it);
|
|
982
|
-
}
|
|
983
|
-
function JavaIdentifierEmitter() {
|
|
984
|
-
}
|
|
985
|
-
function sanitizeSymbol_0($this, _this__u8e3s4) {
|
|
2
|
+
split2bvyvnrlcifjv as split,
|
|
3
|
+
collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
|
|
4
|
+
ArrayList_init_$Create$3ivpeip4ouddx as ArrayList_init_$Create$,
|
|
5
|
+
checkIndexOverflow3frtmheghr0th as checkIndexOverflow,
|
|
6
|
+
Unit_instance28fytmsmm6r23 as Unit_instance,
|
|
7
|
+
joinToString1cxrrlmo0chqs as joinToString,
|
|
8
|
+
StringBuilder_init_$Create$322n630qt3r8c as StringBuilder_init_$Create$,
|
|
9
|
+
charSequenceLength3278n89t01tmv as charSequenceLength,
|
|
10
|
+
charSequenceGet1vxk1y5n17t1z as charSequenceGet,
|
|
11
|
+
isLetterOrDigit2kuxd9e198haf as isLetterOrDigit,
|
|
12
|
+
_Char___init__impl__6a9atx1csff5kwtduxl as _Char___init__impl__6a9atx,
|
|
13
|
+
firstOrNulltrxqttxfxqju as firstOrNull,
|
|
14
|
+
isDigit3mimrri4wkzop as isDigit,
|
|
15
|
+
Char19o2r8palgjof as Char,
|
|
16
|
+
protoOf180f3jzyo7rfj as protoOf,
|
|
17
|
+
initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
|
|
18
|
+
listOfvhqybd2zx248 as listOf,
|
|
19
|
+
emptyList1g2z5xcrvp2zy as emptyList,
|
|
20
|
+
VOID3gxj6tk5isa35 as VOID,
|
|
21
|
+
ArrayList_init_$Create$1jemgvhi5v0js as ArrayList_init_$Create$_0,
|
|
22
|
+
Paire9pteg33gng7 as Pair,
|
|
23
|
+
plus310ted5e4i90h as plus,
|
|
24
|
+
THROW_CCE2g6jy02ryeudk as THROW_CCE,
|
|
25
|
+
startsWith26w8qjqapeeq6 as startsWith,
|
|
26
|
+
substringBefore3n7kj60w69hju as substringBefore,
|
|
27
|
+
listOf1jh22dvmctj1r as listOf_0,
|
|
28
|
+
plus20p0vtfmu0596 as plus_0,
|
|
29
|
+
isInterface3d6p8outrmvmk as isInterface,
|
|
30
|
+
asSequence2phdjljfh9jhx as asSequence,
|
|
31
|
+
filterNot56uwv8hfomaa as filterNot,
|
|
32
|
+
mapsbvh18eqox7a as map,
|
|
33
|
+
distinct17vua5ffe1cfv as distinct,
|
|
34
|
+
toListx6x8nvfmvvht as toList,
|
|
35
|
+
addAll1k27qatfgp3k5 as addAll,
|
|
36
|
+
HashSet_init_$Create$33p49hmosnvr4 as HashSet_init_$Create$,
|
|
37
|
+
Collection1k04j3hzsbod0 as Collection,
|
|
38
|
+
initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
|
|
39
|
+
equals2au1ep9vhcato as equals,
|
|
40
|
+
noWhenBranchMatchedException2a6r7ubxgky5j as noWhenBranchMatchedException,
|
|
41
|
+
last1vo29oleiqj36 as last,
|
|
42
|
+
dropLast1vpiyky649o34 as dropLast,
|
|
43
|
+
to2cs3ny02qtbcb as to,
|
|
44
|
+
mapOf2zpbbmyqk8xpf as mapOf,
|
|
45
|
+
} from './kotlin-kotlin-stdlib.mjs';
|
|
46
|
+
import {
|
|
47
|
+
Companion_instancebcq57hoyp8c2 as Companion_instance,
|
|
48
|
+
Companion_instance1a2xqc448tlhh as Companion_instance_0,
|
|
49
|
+
Companion_instance2ryk3262e300f as Companion_instance_1,
|
|
50
|
+
FileExtension_Java_getInstance6j3tok5j3omd as FileExtension_Java_getInstance,
|
|
51
|
+
Unionccsavx6nrdr2 as Union,
|
|
52
|
+
Refined1lkzc0dg6wey7 as Refined,
|
|
53
|
+
Enum3l2iuc342kle6 as Enum,
|
|
54
|
+
Type12n1gx16iqtcu as Type,
|
|
55
|
+
plus14o24vdaiongg as plus_1,
|
|
56
|
+
importReferencesy4xv7r53sjjs as importReferences,
|
|
57
|
+
Paramvfwnys2w6aj1 as Param,
|
|
58
|
+
Literal331hu9r04vptz as Literal,
|
|
59
|
+
} from './wirespec-src-compiler-core.mjs';
|
|
60
|
+
import {
|
|
61
|
+
JavaGenerator_getInstancepty760x3tbfi as JavaGenerator_getInstance,
|
|
62
|
+
Nameoqr8dt2fim9d as Name,
|
|
63
|
+
FunctionCall30872kpnbr7op as FunctionCall,
|
|
64
|
+
transformChildren2mszeagj5nq4c as transformChildren,
|
|
65
|
+
Companion_getInstance3gvtuyxc9uhxj as Companion_getInstance,
|
|
66
|
+
Package2tniq694j1763 as Package,
|
|
67
|
+
File3dimy4iqmuock as File,
|
|
68
|
+
transformChildrend9p91tpcqdkx as transformChildren_0,
|
|
69
|
+
Mainb4yvz4x0nrxd as Main,
|
|
70
|
+
Enumlszg09mwd24f as Enum_0,
|
|
71
|
+
Interface3pn84xq686t2r as Interface,
|
|
72
|
+
Namespace345pal554qu3j as Namespace,
|
|
73
|
+
Struct39wf79cwtn4ty as Struct,
|
|
74
|
+
import5uhkz67bd8tt as import_0,
|
|
75
|
+
function12vu2kapzno4w as function_0,
|
|
76
|
+
String_instance3uxvo48ki208u as String_instance,
|
|
77
|
+
VariableReference2vlynnhaw1i64 as VariableReference,
|
|
78
|
+
SanitizationConfig11mmn3p2c03c1 as SanitizationConfig,
|
|
79
|
+
convertClientServer1346neky3bhls as convertClientServer,
|
|
80
|
+
toGetterAccessors2z6mndbqwlczg as toGetterAccessors,
|
|
81
|
+
rawttvqxl50flj9 as raw,
|
|
82
|
+
convertnty9x0e63d0u as convert,
|
|
83
|
+
TransformScopeyrd3lf4zrk76 as TransformScope,
|
|
84
|
+
TransformerBuildera6a1gvlhjj9b as TransformerBuilder,
|
|
85
|
+
transform3eti8i2bqvifx as transform,
|
|
86
|
+
Elementitq62jg6fid3 as Element,
|
|
87
|
+
emitn3eihixilqyh as emit,
|
|
88
|
+
prependImports32gcj3yb8voha as prependImports,
|
|
89
|
+
placeInPackage1ffljbk9me4ug as placeInPackage,
|
|
90
|
+
convertToGenerator2wzjrmaavxhph as convertToGenerator,
|
|
91
|
+
convertToGeneratorkggw47cqose7 as convertToGenerator_0,
|
|
92
|
+
convertToGenerator3rjr3azp4vdsx as convertToGenerator_1,
|
|
93
|
+
convertToGenerator2msmr3acdd5nx as convertToGenerator_2,
|
|
94
|
+
sanitizeNames2wqmyf8vafp9x as sanitizeNames,
|
|
95
|
+
collectCustomTypeNames373f3lwl9sqd5 as collectCustomTypeNames,
|
|
96
|
+
placeInPackagena6oqbi45fz6 as placeInPackage_0,
|
|
97
|
+
convertWithValidation3ar3nbcqsbkpn as convertWithValidation,
|
|
98
|
+
convert11ert2po54h1y as convert_0,
|
|
99
|
+
injectEnumLabelFieldyfohidz6c88i as injectEnumLabelField,
|
|
100
|
+
convert37aabdzvtv9vg as convert_1,
|
|
101
|
+
convert17zcptkz4mhr4 as convert_2,
|
|
102
|
+
convert32tuiui3czihh as convert_3,
|
|
103
|
+
convert1cn4bolzoed8c as convert_4,
|
|
104
|
+
convert3ewo9inue7gua as convert_5,
|
|
105
|
+
emitEndpointClient1meajc90wf3el as emitEndpointClient,
|
|
106
|
+
emitClient32kfwzg2hm5vj as emitClient,
|
|
107
|
+
get_extensions31c4or738wbxz as get_extensions,
|
|
108
|
+
emit1oxjujel6f3jb as emit_0,
|
|
109
|
+
emit3bzdcd0f6nwtj as emit_1,
|
|
110
|
+
beforeGenerate3o8idb3hey1b0 as beforeGenerate,
|
|
111
|
+
IrEmitterh2m93ojzvkep as IrEmitter,
|
|
112
|
+
Dict22iqrhoo0g8et as Dict,
|
|
113
|
+
Array2goj74t0aak7b as Array_0,
|
|
114
|
+
Nullable3wjn6l6q3h6o as Nullable,
|
|
115
|
+
Custom2si7lto3wompr as Custom,
|
|
116
|
+
Unit_instanceyaei45a6t5rv as Unit_instance_0,
|
|
117
|
+
Any_instance2998xag3cdzh3 as Any_instance,
|
|
118
|
+
Bytes_instance3edm2lhbrwd51 as Bytes_instance,
|
|
119
|
+
Boolean_instance27opaqtiiiysz as Boolean_instance,
|
|
120
|
+
Number3azxs9q1cyulb as Number_0,
|
|
121
|
+
Integer1uwg1wvo5lp6z as Integer,
|
|
122
|
+
structo1silz79n3nu as struct,
|
|
123
|
+
RawExpression2bo7ldfrptjia as RawExpression,
|
|
124
|
+
TypeDescriptor1hvcpxrtxcqsx as TypeDescriptor,
|
|
125
|
+
convert2loxpwk8n2r8c as convert_6,
|
|
126
|
+
Custom_init_$Create$2enn7oyj71j1t as Custom_init_$Create$,
|
|
127
|
+
Function21cuq8qizkin7 as Function,
|
|
128
|
+
RawElement2yts1x2rbem1g as RawElement,
|
|
129
|
+
Assignment3kcxc8wlcbmkn as Assignment,
|
|
130
|
+
ReturnStatement29qlfkn9kpy10 as ReturnStatement,
|
|
131
|
+
Wildcard_instance2ga1ytfwj78ra as Wildcard_instance,
|
|
132
|
+
transformChildren2m3cpkz6zusq1 as transformChildren_1,
|
|
133
|
+
} from './wirespec-src-compiler-ir.mjs';
|
|
134
|
+
//region block: imports
|
|
135
|
+
//endregion
|
|
136
|
+
//region block: pre-declaration
|
|
137
|
+
initMetadataForCompanion(Companion);
|
|
138
|
+
initMetadataForClass(JavaIrEmitter, 'JavaIrEmitter', JavaIrEmitter, VOID, [IrEmitter]);
|
|
139
|
+
//endregion
|
|
140
|
+
function sanitizeSymbol($this, _this__u8e3s4) {
|
|
986
141
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
987
142
|
var this_0 = split(_this__u8e3s4, ['.', ' ', '-']);
|
|
988
143
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
989
|
-
var destination = ArrayList_init_$Create$
|
|
144
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
990
145
|
var index = 0;
|
|
991
146
|
var _iterator__ex2g4s = this_0.t();
|
|
992
147
|
while (_iterator__ex2g4s.u()) {
|
|
993
148
|
var item = _iterator__ex2g4s.v();
|
|
994
149
|
var _unary__edvuaz = index;
|
|
995
150
|
index = _unary__edvuaz + 1 | 0;
|
|
996
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ?
|
|
151
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance.dr(item) : item;
|
|
997
152
|
destination.x(tmp$ret$0);
|
|
998
153
|
}
|
|
999
154
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1013,9 +168,9 @@ function sanitizeSymbol_0($this, _this__u8e3s4) {
|
|
|
1013
168
|
}
|
|
1014
169
|
while (inductionVariable < last);
|
|
1015
170
|
var tmp$ret$5 = destination_0.toString();
|
|
1016
|
-
return
|
|
171
|
+
return sanitizeFirstIsDigit($this, tmp$ret$5);
|
|
1017
172
|
}
|
|
1018
|
-
function
|
|
173
|
+
function sanitizeFirstIsDigit($this, _this__u8e3s4) {
|
|
1019
174
|
var tmp;
|
|
1020
175
|
var tmp0_safe_receiver = firstOrNull(_this__u8e3s4);
|
|
1021
176
|
var tmp_0;
|
|
@@ -1032,57 +187,60 @@ function sanitizeFirstIsDigit_0($this, _this__u8e3s4) {
|
|
|
1032
187
|
}
|
|
1033
188
|
return tmp;
|
|
1034
189
|
}
|
|
1035
|
-
function
|
|
1036
|
-
return
|
|
190
|
+
function sanitizeKeywords($this, _this__u8e3s4) {
|
|
191
|
+
return Companion_getInstance_0().v1x().v1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1037
192
|
}
|
|
1038
|
-
function
|
|
1039
|
-
return
|
|
193
|
+
function sanitizeEnum($this, _this__u8e3s4) {
|
|
194
|
+
return sanitizeKeywords($this, sanitizeFirstIsDigit($this, joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_')));
|
|
1040
195
|
}
|
|
1041
|
-
function
|
|
1042
|
-
|
|
1043
|
-
this.
|
|
196
|
+
function Companion() {
|
|
197
|
+
Companion_instance_2 = this;
|
|
198
|
+
this.u1x_1 = JavaGenerator_getInstance();
|
|
1044
199
|
}
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
200
|
+
protoOf(Companion).v1x = function () {
|
|
201
|
+
return this.u1x_1.x1w_1;
|
|
202
|
+
};
|
|
203
|
+
var Companion_instance_2;
|
|
204
|
+
function Companion_getInstance_0() {
|
|
205
|
+
if (Companion_instance_2 == null)
|
|
206
|
+
new Companion();
|
|
207
|
+
return Companion_instance_2;
|
|
1050
208
|
}
|
|
1051
209
|
function JavaIrEmitter$sanitizationConfig$lambda(it) {
|
|
1052
210
|
return '_' + it;
|
|
1053
211
|
}
|
|
1054
212
|
function JavaIrEmitter$sanitizationConfig$lambda_0(name) {
|
|
1055
|
-
return name.
|
|
213
|
+
return name.f1h_1.b1() > 1 ? new Name(listOf(name.t1m())) : name;
|
|
1056
214
|
}
|
|
1057
215
|
function JavaIrEmitter$sanitizationConfig$lambda_1(name) {
|
|
1058
|
-
return new Name(listOf(name.
|
|
216
|
+
return new Name(listOf(name.t1m()));
|
|
1059
217
|
}
|
|
1060
218
|
function JavaIrEmitter$sanitizationConfig$lambda_2(this$0) {
|
|
1061
219
|
return function (it) {
|
|
1062
|
-
return
|
|
220
|
+
return sanitizeSymbol(this$0, it);
|
|
1063
221
|
};
|
|
1064
222
|
}
|
|
1065
223
|
function JavaIrEmitter$sanitizationConfig$lambda_3(stmt, tr) {
|
|
1066
224
|
var tmp;
|
|
1067
225
|
var tmp_0;
|
|
1068
226
|
if (stmt instanceof FunctionCall) {
|
|
1069
|
-
tmp_0 = stmt.
|
|
227
|
+
tmp_0 = stmt.d1n_1.g1j() === 'validate';
|
|
1070
228
|
} else {
|
|
1071
229
|
tmp_0 = false;
|
|
1072
230
|
}
|
|
1073
231
|
if (tmp_0) {
|
|
1074
|
-
tmp = transformChildren(stmt.
|
|
232
|
+
tmp = transformChildren(stmt.h1n(VOID, emptyList()), tr);
|
|
1075
233
|
} else {
|
|
1076
234
|
tmp = transformChildren(stmt, tr);
|
|
1077
235
|
}
|
|
1078
236
|
return tmp;
|
|
1079
237
|
}
|
|
1080
238
|
function JavaIrEmitter$emitShared$lambda(name) {
|
|
1081
|
-
switch (name.
|
|
239
|
+
switch (name.g1j()) {
|
|
1082
240
|
case 'client':
|
|
1083
|
-
return Companion_getInstance().
|
|
241
|
+
return Companion_getInstance().h1h('getClient');
|
|
1084
242
|
case 'server':
|
|
1085
|
-
return Companion_getInstance().
|
|
243
|
+
return Companion_getInstance().h1h('getServer');
|
|
1086
244
|
default:
|
|
1087
245
|
return null;
|
|
1088
246
|
}
|
|
@@ -1092,9 +250,9 @@ function JavaIrEmitter$emitShared$lambda_0($imports) {
|
|
|
1092
250
|
var tmp;
|
|
1093
251
|
if (element instanceof File) {
|
|
1094
252
|
// Inline function 'kotlin.collections.partition' call
|
|
1095
|
-
var this_0 = element.
|
|
1096
|
-
var first = ArrayList_init_$Create$();
|
|
1097
|
-
var second = ArrayList_init_$Create$();
|
|
253
|
+
var this_0 = element.d1o_1;
|
|
254
|
+
var first = ArrayList_init_$Create$_0();
|
|
255
|
+
var second = ArrayList_init_$Create$_0();
|
|
1098
256
|
var _iterator__ex2g4s = this_0.t();
|
|
1099
257
|
while (_iterator__ex2g4s.u()) {
|
|
1100
258
|
var element_0 = _iterator__ex2g4s.v();
|
|
@@ -1105,9 +263,9 @@ function JavaIrEmitter$emitShared$lambda_0($imports) {
|
|
|
1105
263
|
}
|
|
1106
264
|
}
|
|
1107
265
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1108
|
-
var packageElements = _destruct__k2r9zo.
|
|
1109
|
-
var rest = _destruct__k2r9zo.
|
|
1110
|
-
tmp = element.
|
|
266
|
+
var packageElements = _destruct__k2r9zo.we();
|
|
267
|
+
var rest = _destruct__k2r9zo.xe();
|
|
268
|
+
tmp = element.g1o(VOID, plus(plus(packageElements, $imports), rest));
|
|
1111
269
|
} else {
|
|
1112
270
|
tmp = element;
|
|
1113
271
|
}
|
|
@@ -1119,11 +277,40 @@ function JavaIrEmitter$emitShared$lambda_1($clientServer) {
|
|
|
1119
277
|
return function (element, transformer) {
|
|
1120
278
|
var tmp;
|
|
1121
279
|
if (element instanceof Namespace) {
|
|
1122
|
-
var injected = element.
|
|
280
|
+
var injected = element.i1o_1.equals(Companion_getInstance().h1h('Wirespec')) ? $clientServer : emptyList();
|
|
1123
281
|
var tmp_0;
|
|
1124
282
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1125
283
|
if (!injected.r()) {
|
|
1126
|
-
|
|
284
|
+
// Inline function 'community.flock.wirespec.ir.core.withElements' call
|
|
285
|
+
var elements = plus(element.e1o(), injected);
|
|
286
|
+
var tmp_1;
|
|
287
|
+
if (element instanceof File) {
|
|
288
|
+
tmp_1 = element.g1o(VOID, elements);
|
|
289
|
+
} else {
|
|
290
|
+
if (element instanceof Struct) {
|
|
291
|
+
tmp_1 = element.n1q(VOID, VOID, VOID, VOID, elements);
|
|
292
|
+
} else {
|
|
293
|
+
if (element instanceof Namespace) {
|
|
294
|
+
tmp_1 = element.n1o(VOID, elements);
|
|
295
|
+
} else {
|
|
296
|
+
if (element instanceof Interface) {
|
|
297
|
+
tmp_1 = element.w1o(VOID, elements);
|
|
298
|
+
} else {
|
|
299
|
+
if (element instanceof Enum_0) {
|
|
300
|
+
tmp_1 = element.b1q(VOID, VOID, VOID, VOID, VOID, elements);
|
|
301
|
+
} else {
|
|
302
|
+
if (element instanceof Main) {
|
|
303
|
+
tmp_1 = element;
|
|
304
|
+
} else {
|
|
305
|
+
tmp_1 = element;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
var tmp_2 = tmp_1;
|
|
313
|
+
tmp_0 = tmp_2 instanceof Namespace ? tmp_2 : THROW_CCE();
|
|
1127
314
|
} else {
|
|
1128
315
|
tmp_0 = element;
|
|
1129
316
|
}
|
|
@@ -1148,111 +335,111 @@ function JavaIrEmitter$emitGenerator$lambda_1(it) {
|
|
|
1148
335
|
}
|
|
1149
336
|
function JavaIrEmitter$emitGenerator$lambda_2(this$0) {
|
|
1150
337
|
return function (it) {
|
|
1151
|
-
return import_0(this$0.
|
|
338
|
+
return import_0(this$0.c1y().js_1 + '.model', it);
|
|
1152
339
|
};
|
|
1153
340
|
}
|
|
1154
341
|
function JavaIrEmitter$emit$lambda(this$0) {
|
|
1155
342
|
return function (it) {
|
|
1156
|
-
return
|
|
343
|
+
return sanitizeEnum(this$0, it);
|
|
1157
344
|
};
|
|
1158
345
|
}
|
|
1159
346
|
function JavaIrEmitter$emit$lambda_0(it) {
|
|
1160
347
|
return listOf(function_0('label', VOID, VOID, JavaIrEmitter$emit$lambda$lambda));
|
|
1161
348
|
}
|
|
1162
349
|
function JavaIrEmitter$emit$lambda$lambda($this$function) {
|
|
1163
|
-
$this$function.
|
|
1164
|
-
$this$function.
|
|
350
|
+
$this$function.y1h(String_instance);
|
|
351
|
+
$this$function.z1h(new VariableReference(Companion_getInstance().h1h('label')));
|
|
1165
352
|
return Unit_instance;
|
|
1166
353
|
}
|
|
1167
354
|
function JavaIrEmitter(packageName, emitShared) {
|
|
1168
|
-
|
|
1169
|
-
packageName = packageName === VOID ?
|
|
1170
|
-
emitShared = emitShared === VOID ?
|
|
1171
|
-
this.
|
|
1172
|
-
this.
|
|
1173
|
-
this.
|
|
1174
|
-
this.
|
|
1175
|
-
this.
|
|
355
|
+
Companion_getInstance_0();
|
|
356
|
+
packageName = packageName === VOID ? Companion_instance_0.is('community.flock.wirespec.generated') : packageName;
|
|
357
|
+
emitShared = emitShared === VOID ? Companion_instance_1.fp() : emitShared;
|
|
358
|
+
this.w1x_1 = packageName;
|
|
359
|
+
this.x1x_1 = emitShared;
|
|
360
|
+
this.y1x_1 = JavaGenerator_getInstance();
|
|
361
|
+
this.z1x_1 = FileExtension_Java_getInstance();
|
|
362
|
+
this.a1y_1 = listOf(import_0('community.flock.wirespec.java', 'Wirespec'));
|
|
1176
363
|
var tmp = this;
|
|
1177
|
-
var tmp_0 =
|
|
364
|
+
var tmp_0 = Companion_getInstance_0().v1x();
|
|
1178
365
|
var tmp_1 = JavaIrEmitter$sanitizationConfig$lambda;
|
|
1179
366
|
var tmp_2 = JavaIrEmitter$sanitizationConfig$lambda_0;
|
|
1180
367
|
var tmp_3 = JavaIrEmitter$sanitizationConfig$lambda_1;
|
|
1181
368
|
var tmp_4 = JavaIrEmitter$sanitizationConfig$lambda_2(this);
|
|
1182
|
-
tmp.
|
|
369
|
+
tmp.b1y_1 = new SanitizationConfig(tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, JavaIrEmitter$sanitizationConfig$lambda_3);
|
|
1183
370
|
}
|
|
1184
|
-
protoOf(JavaIrEmitter).
|
|
1185
|
-
return this.
|
|
371
|
+
protoOf(JavaIrEmitter).c1y = function () {
|
|
372
|
+
return this.w1x_1;
|
|
1186
373
|
};
|
|
1187
|
-
protoOf(JavaIrEmitter).
|
|
1188
|
-
return this.
|
|
374
|
+
protoOf(JavaIrEmitter).n1w = function () {
|
|
375
|
+
return this.y1x_1;
|
|
1189
376
|
};
|
|
1190
|
-
protoOf(JavaIrEmitter).
|
|
1191
|
-
return this.
|
|
377
|
+
protoOf(JavaIrEmitter).kr = function () {
|
|
378
|
+
return this.z1x_1;
|
|
1192
379
|
};
|
|
1193
|
-
protoOf(JavaIrEmitter).
|
|
1194
|
-
var packageName =
|
|
380
|
+
protoOf(JavaIrEmitter).r1w = function () {
|
|
381
|
+
var packageName = Companion_instance_0.is('community.flock.wirespec.java');
|
|
1195
382
|
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')]);
|
|
1196
383
|
// Inline function 'kotlin.collections.map' call
|
|
1197
|
-
var this_0 = convertClientServer(
|
|
384
|
+
var this_0 = convertClientServer();
|
|
1198
385
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1199
|
-
var destination = ArrayList_init_$Create$
|
|
386
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1200
387
|
var _iterator__ex2g4s = this_0.t();
|
|
1201
388
|
while (_iterator__ex2g4s.u()) {
|
|
1202
389
|
var item = _iterator__ex2g4s.v();
|
|
1203
390
|
var tmp$ret$0 = toGetterAccessors(item, JavaIrEmitter$emitShared$lambda);
|
|
1204
391
|
destination.x(tmp$ret$0);
|
|
1205
392
|
}
|
|
1206
|
-
var clientServer =
|
|
393
|
+
var clientServer = plus_0(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}'));
|
|
1207
394
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1208
395
|
var this_1 = convert(packageName);
|
|
1209
396
|
var scope = new TransformScope(this_1);
|
|
1210
397
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1211
398
|
var tmp = scope;
|
|
1212
399
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1213
|
-
var this_2 = scope.
|
|
400
|
+
var this_2 = scope.a1w_1;
|
|
1214
401
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1215
402
|
// Inline function 'kotlin.apply' call
|
|
1216
403
|
var this_3 = new TransformerBuilder();
|
|
1217
|
-
this_3.
|
|
1218
|
-
var tmp$ret$5 = this_3.
|
|
1219
|
-
tmp.
|
|
404
|
+
this_3.u1i(JavaIrEmitter$emitShared$lambda_0(imports));
|
|
405
|
+
var tmp$ret$5 = this_3.v1i();
|
|
406
|
+
tmp.a1w_1 = transform(this_2, tmp$ret$5);
|
|
1220
407
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1221
408
|
var tmp_0 = scope;
|
|
1222
409
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1223
410
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1224
|
-
var this_4 = scope.
|
|
411
|
+
var this_4 = scope.a1w_1;
|
|
1225
412
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1226
413
|
// Inline function 'kotlin.apply' call
|
|
1227
414
|
var this_5 = new TransformerBuilder();
|
|
1228
|
-
this_5.
|
|
1229
|
-
var tmp$ret$10 = this_5.
|
|
1230
|
-
tmp_0.
|
|
1231
|
-
var tmp_1 = scope.
|
|
415
|
+
this_5.u1i(JavaIrEmitter$emitShared$lambda_1(clientServer));
|
|
416
|
+
var tmp$ret$10 = this_5.v1i();
|
|
417
|
+
tmp_0.a1w_1 = transform(this_4, tmp$ret$10);
|
|
418
|
+
var tmp_1 = scope.a1w_1;
|
|
1232
419
|
var wirespecShared = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1233
420
|
var tmp_2;
|
|
1234
|
-
if (this.
|
|
421
|
+
if (this.x1x_1.gp_1) {
|
|
1235
422
|
tmp_2 = wirespecShared;
|
|
1236
423
|
} else {
|
|
1237
424
|
tmp_2 = null;
|
|
1238
425
|
}
|
|
1239
426
|
return tmp_2;
|
|
1240
427
|
};
|
|
1241
|
-
protoOf(JavaIrEmitter).
|
|
1242
|
-
var file =
|
|
1243
|
-
var tmp = file.
|
|
428
|
+
protoOf(JavaIrEmitter).lr = function (definition, module_0, logger) {
|
|
429
|
+
var file = emit.call(this, definition, module_0, logger);
|
|
430
|
+
var tmp = file.g1o(Companion_getInstance().h1h(sanitizeSymbol(this, file.c1o_1.i1h())));
|
|
1244
431
|
// Inline function 'kotlin.takeIf' call
|
|
1245
|
-
var this_0 = this.
|
|
432
|
+
var this_0 = this.a1y_1;
|
|
1246
433
|
var tmp_0;
|
|
1247
|
-
if (
|
|
434
|
+
if (Companion_instance.er(module_0)) {
|
|
1248
435
|
tmp_0 = this_0;
|
|
1249
436
|
} else {
|
|
1250
437
|
tmp_0 = null;
|
|
1251
438
|
}
|
|
1252
439
|
var tmp$ret$1 = tmp_0;
|
|
1253
|
-
return placeInPackage(prependImports(tmp, tmp$ret$1), this.
|
|
440
|
+
return placeInPackage(prependImports(tmp, tmp$ret$1), this.c1y(), definition);
|
|
1254
441
|
};
|
|
1255
|
-
protoOf(JavaIrEmitter).
|
|
442
|
+
protoOf(JavaIrEmitter).w1w = function (definition, module_0) {
|
|
1256
443
|
var tmp;
|
|
1257
444
|
if (definition instanceof Type) {
|
|
1258
445
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1272,33 +459,33 @@ protoOf(JavaIrEmitter).d1x = function (definition, module_0) {
|
|
|
1272
459
|
}
|
|
1273
460
|
}
|
|
1274
461
|
var generatorFile = tmp;
|
|
1275
|
-
var sanitized = sanitizeNames(generatorFile, this.
|
|
1276
|
-
var generatorOwnName = definition.
|
|
1277
|
-
var tmp_0 =
|
|
462
|
+
var sanitized = sanitizeNames(generatorFile, this.b1y_1);
|
|
463
|
+
var generatorOwnName = definition.mr().m1() + 'Generator';
|
|
464
|
+
var tmp_0 = asSequence(collectCustomTypeNames(sanitized));
|
|
1278
465
|
var tmp_1 = filterNot(tmp_0, JavaIrEmitter$emitGenerator$lambda);
|
|
1279
466
|
var tmp_2 = filterNot(tmp_1, JavaIrEmitter$emitGenerator$lambda_0(generatorOwnName));
|
|
1280
|
-
var tmp_3 =
|
|
467
|
+
var tmp_3 = distinct(map(tmp_2, JavaIrEmitter$emitGenerator$lambda_1));
|
|
1281
468
|
var modelImports = toList(map(tmp_3, JavaIrEmitter$emitGenerator$lambda_2(this)));
|
|
1282
|
-
return placeInPackage_0(prependImports(sanitized,
|
|
469
|
+
return placeInPackage_0(prependImports(sanitized, plus(this.a1y_1, modelImports)), this.c1y(), 'generator');
|
|
1283
470
|
};
|
|
1284
|
-
protoOf(JavaIrEmitter).
|
|
1285
|
-
return sanitizeNames(convertWithValidation(type, module_0), this.
|
|
471
|
+
protoOf(JavaIrEmitter).cs = function (type, module_0) {
|
|
472
|
+
return sanitizeNames(convertWithValidation(type, module_0), this.b1y_1);
|
|
1286
473
|
};
|
|
1287
474
|
protoOf(JavaIrEmitter).as = function (enum_0, module_0) {
|
|
1288
475
|
var tmp = convert_0(enum_0);
|
|
1289
476
|
var tmp_0 = JavaIrEmitter$emit$lambda(this);
|
|
1290
|
-
return sanitizeNames(injectEnumLabelField(tmp, tmp_0, JavaIrEmitter$emit$lambda_0), this.
|
|
477
|
+
return sanitizeNames(injectEnumLabelField(tmp, tmp_0, JavaIrEmitter$emit$lambda_0), this.b1y_1);
|
|
1291
478
|
};
|
|
1292
479
|
protoOf(JavaIrEmitter).qr = function (union) {
|
|
1293
|
-
return sanitizeNames(convert_1(union), this.
|
|
480
|
+
return sanitizeNames(convert_1(union), this.b1y_1);
|
|
1294
481
|
};
|
|
1295
482
|
protoOf(JavaIrEmitter).vr = function (refined) {
|
|
1296
|
-
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.
|
|
483
|
+
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.b1y_1);
|
|
1297
484
|
};
|
|
1298
485
|
protoOf(JavaIrEmitter).bs = function (endpoint) {
|
|
1299
|
-
var tmp = sanitizeNames(transformTypeDescriptors(injectApiField(injectHandleFunction(convert_3(endpoint), endpoint))), this.
|
|
486
|
+
var tmp = sanitizeNames(transformTypeDescriptors(injectApiField(injectHandleFunction(convert_3(endpoint), endpoint))), this.b1y_1);
|
|
1300
487
|
// Inline function 'kotlin.takeIf' call
|
|
1301
|
-
var this_0 = buildModelImports(endpoint, this.
|
|
488
|
+
var this_0 = buildModelImports(endpoint, this.c1y());
|
|
1302
489
|
var tmp_0;
|
|
1303
490
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1304
491
|
if (!this_0.r()) {
|
|
@@ -1311,26 +498,40 @@ protoOf(JavaIrEmitter).bs = function (endpoint) {
|
|
|
1311
498
|
};
|
|
1312
499
|
protoOf(JavaIrEmitter).pr = function (channel) {
|
|
1313
500
|
var tmp;
|
|
1314
|
-
if (channel.
|
|
1315
|
-
tmp = this.
|
|
501
|
+
if (channel.wp_1.m1() === channel.xp_1.m1()) {
|
|
502
|
+
tmp = this.c1y().js_1 + '.model.';
|
|
1316
503
|
} else {
|
|
1317
504
|
tmp = '';
|
|
1318
505
|
}
|
|
1319
506
|
var fullyQualifiedPrefix = tmp;
|
|
1320
|
-
return qualifyChannelReferences(sanitizeNames(convert_4(channel), this.
|
|
507
|
+
return qualifyChannelReferences(sanitizeNames(convert_4(channel), this.b1y_1), fullyQualifiedPrefix);
|
|
508
|
+
};
|
|
509
|
+
protoOf(JavaIrEmitter).or = function (rpc) {
|
|
510
|
+
var tmp = sanitizeNames(convert_5(rpc), this.b1y_1);
|
|
511
|
+
// Inline function 'kotlin.takeIf' call
|
|
512
|
+
var this_0 = buildModelImports(rpc, this.c1y());
|
|
513
|
+
var tmp_0;
|
|
514
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
515
|
+
if (!this_0.r()) {
|
|
516
|
+
tmp_0 = this_0;
|
|
517
|
+
} else {
|
|
518
|
+
tmp_0 = null;
|
|
519
|
+
}
|
|
520
|
+
var tmp$ret$2 = tmp_0;
|
|
521
|
+
return prependImports(tmp, tmp$ret$2);
|
|
1321
522
|
};
|
|
1322
|
-
protoOf(JavaIrEmitter).
|
|
1323
|
-
var imports = buildModelImports(endpoint, this.
|
|
1324
|
-
var endpointImport = import_0(this.
|
|
1325
|
-
var endpointName = endpoint.
|
|
1326
|
-
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.
|
|
1327
|
-
var subPackageName =
|
|
1328
|
-
return new File(Companion_getInstance().
|
|
523
|
+
protoOf(JavaIrEmitter).v1w = function (endpoint) {
|
|
524
|
+
var imports = buildModelImports(endpoint, this.c1y());
|
|
525
|
+
var endpointImport = import_0(this.c1y().js_1 + '.endpoint', endpoint.kq_1.m1());
|
|
526
|
+
var endpointName = endpoint.kq_1.m1();
|
|
527
|
+
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.b1y_1)), endpointName);
|
|
528
|
+
var subPackageName = plus_1(this.c1y(), 'client');
|
|
529
|
+
return new File(Companion_getInstance().h1h(subPackageName.ls() + sanitizeSymbol(this, file.c1o_1.i1h())), plus(plus(plus(plus(listOf(new Package(subPackageName.js_1)), this.a1y_1), imports), listOf(endpointImport)), file.d1o_1));
|
|
1329
530
|
};
|
|
1330
|
-
protoOf(JavaIrEmitter).
|
|
531
|
+
protoOf(JavaIrEmitter).s1w = function (endpoints, logger) {
|
|
1331
532
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1332
533
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1333
|
-
var destination = ArrayList_init_$Create$();
|
|
534
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1334
535
|
var _iterator__ex2g4s = endpoints.t();
|
|
1335
536
|
while (_iterator__ex2g4s.u()) {
|
|
1336
537
|
var element = _iterator__ex2g4s.v();
|
|
@@ -1339,18 +540,18 @@ protoOf(JavaIrEmitter).z1w = function (endpoints, logger) {
|
|
|
1339
540
|
}
|
|
1340
541
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1341
542
|
var set = HashSet_init_$Create$();
|
|
1342
|
-
var list_0 = ArrayList_init_$Create$();
|
|
543
|
+
var list_0 = ArrayList_init_$Create$_0();
|
|
1343
544
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1344
545
|
while (_iterator__ex2g4s_0.u()) {
|
|
1345
546
|
var e = _iterator__ex2g4s_0.v();
|
|
1346
|
-
var key = e.
|
|
547
|
+
var key = e.lv_1;
|
|
1347
548
|
if (set.x(key)) {
|
|
1348
549
|
list_0.x(e);
|
|
1349
550
|
}
|
|
1350
551
|
}
|
|
1351
552
|
// Inline function 'kotlin.collections.filter' call
|
|
1352
553
|
// Inline function 'kotlin.collections.filterTo' call
|
|
1353
|
-
var destination_0 = ArrayList_init_$Create$();
|
|
554
|
+
var destination_0 = ArrayList_init_$Create$_0();
|
|
1354
555
|
var _iterator__ex2g4s_1 = list_0.t();
|
|
1355
556
|
while (_iterator__ex2g4s_1.u()) {
|
|
1356
557
|
var element_0 = _iterator__ex2g4s_1.v();
|
|
@@ -1370,7 +571,7 @@ protoOf(JavaIrEmitter).z1w = function (endpoints, logger) {
|
|
|
1370
571
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1371
572
|
while (_iterator__ex2g4s_2.u()) {
|
|
1372
573
|
var element_1 = _iterator__ex2g4s_2.v();
|
|
1373
|
-
if (element_1.
|
|
574
|
+
if (element_1.kq_1.m1() === element_0.lv_1) {
|
|
1374
575
|
tmp$ret$5 = false;
|
|
1375
576
|
break $l$block_0;
|
|
1376
577
|
}
|
|
@@ -1383,43 +584,43 @@ protoOf(JavaIrEmitter).z1w = function (endpoints, logger) {
|
|
|
1383
584
|
}
|
|
1384
585
|
// Inline function 'kotlin.collections.map' call
|
|
1385
586
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1386
|
-
var destination_1 = ArrayList_init_$Create$
|
|
587
|
+
var destination_1 = ArrayList_init_$Create$(collectionSizeOrDefault(destination_0, 10));
|
|
1387
588
|
var _iterator__ex2g4s_3 = destination_0.t();
|
|
1388
589
|
while (_iterator__ex2g4s_3.u()) {
|
|
1389
590
|
var item = _iterator__ex2g4s_3.v();
|
|
1390
|
-
var tmp$ret$10 = import_0(this.
|
|
591
|
+
var tmp$ret$10 = import_0(this.c1y().js_1 + '.model', item.lv_1);
|
|
1391
592
|
destination_1.x(tmp$ret$10);
|
|
1392
593
|
}
|
|
1393
594
|
var imports = destination_1;
|
|
1394
595
|
// Inline function 'kotlin.collections.map' call
|
|
1395
596
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1396
|
-
var destination_2 = ArrayList_init_$Create$
|
|
597
|
+
var destination_2 = ArrayList_init_$Create$(collectionSizeOrDefault(endpoints, 10));
|
|
1397
598
|
var _iterator__ex2g4s_4 = endpoints.t();
|
|
1398
599
|
while (_iterator__ex2g4s_4.u()) {
|
|
1399
600
|
var item_0 = _iterator__ex2g4s_4.v();
|
|
1400
|
-
var tmp$ret$13 = import_0(this.
|
|
601
|
+
var tmp$ret$13 = import_0(this.c1y().js_1 + '.endpoint', item_0.kq_1.m1());
|
|
1401
602
|
destination_2.x(tmp$ret$13);
|
|
1402
603
|
}
|
|
1403
604
|
var endpointImports = destination_2;
|
|
1404
605
|
// Inline function 'kotlin.collections.map' call
|
|
1405
606
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1406
|
-
var destination_3 = ArrayList_init_$Create$
|
|
607
|
+
var destination_3 = ArrayList_init_$Create$(collectionSizeOrDefault(endpoints, 10));
|
|
1407
608
|
var _iterator__ex2g4s_5 = endpoints.t();
|
|
1408
609
|
while (_iterator__ex2g4s_5.u()) {
|
|
1409
610
|
var item_1 = _iterator__ex2g4s_5.v();
|
|
1410
|
-
var tmp$ret$16 = import_0(this.
|
|
611
|
+
var tmp$ret$16 = import_0(this.c1y().js_1 + '.client', item_1.kq_1.m1() + 'Client');
|
|
1411
612
|
destination_3.x(tmp$ret$16);
|
|
1412
613
|
}
|
|
1413
614
|
var clientImports = destination_3;
|
|
1414
|
-
var allImports =
|
|
1415
|
-
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.
|
|
1416
|
-
return new File(Companion_getInstance().
|
|
615
|
+
var allImports = plus(plus(imports, endpointImports), clientImports);
|
|
616
|
+
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.b1y_1);
|
|
617
|
+
return new File(Companion_getInstance().h1h(this.c1y().ls() + sanitizeSymbol(this, file.c1o_1.i1h())), plus(plus(plus(listOf(new Package(this.c1y().js_1)), this.a1y_1), allImports), file.d1o_1));
|
|
1417
618
|
};
|
|
1418
619
|
function transformTypeDescriptors(_this__u8e3s4) {
|
|
1419
620
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1420
621
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1421
|
-
scope.
|
|
1422
|
-
var tmp = scope.
|
|
622
|
+
scope.j1w(transformTypeDescriptors$lambda);
|
|
623
|
+
var tmp = scope.a1w_1;
|
|
1423
624
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1424
625
|
}
|
|
1425
626
|
function applyRefinedStructShape(_this__u8e3s4, refined) {
|
|
@@ -1428,14 +629,14 @@ function applyRefinedStructShape(_this__u8e3s4, refined) {
|
|
|
1428
629
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1429
630
|
var tmp = scope;
|
|
1430
631
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1431
|
-
var this_0 = scope.
|
|
632
|
+
var this_0 = scope.a1w_1;
|
|
1432
633
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1433
634
|
// Inline function 'kotlin.apply' call
|
|
1434
635
|
var this_1 = new TransformerBuilder();
|
|
1435
|
-
this_1.
|
|
1436
|
-
var tmp$ret$2 = this_1.
|
|
1437
|
-
tmp.
|
|
1438
|
-
var tmp_0 = scope.
|
|
636
|
+
this_1.u1i(applyRefinedStructShape$lambda(refined));
|
|
637
|
+
var tmp$ret$2 = this_1.v1i();
|
|
638
|
+
tmp.a1w_1 = transform(this_0, tmp$ret$2);
|
|
639
|
+
var tmp_0 = scope.a1w_1;
|
|
1439
640
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1440
641
|
}
|
|
1441
642
|
function injectApiField(_this__u8e3s4) {
|
|
@@ -1445,14 +646,14 @@ function injectApiField(_this__u8e3s4) {
|
|
|
1445
646
|
var tmp = scope;
|
|
1446
647
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1447
648
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1448
|
-
var this_0 = scope.
|
|
649
|
+
var this_0 = scope.a1w_1;
|
|
1449
650
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1450
651
|
// Inline function 'kotlin.apply' call
|
|
1451
652
|
var this_1 = new TransformerBuilder();
|
|
1452
|
-
this_1.
|
|
1453
|
-
var tmp$ret$2 = this_1.
|
|
1454
|
-
tmp.
|
|
1455
|
-
var tmp_0 = scope.
|
|
653
|
+
this_1.u1i(injectApiField$lambda);
|
|
654
|
+
var tmp$ret$2 = this_1.v1i();
|
|
655
|
+
tmp.a1w_1 = transform(this_0, tmp$ret$2);
|
|
656
|
+
var tmp_0 = scope.a1w_1;
|
|
1456
657
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1457
658
|
}
|
|
1458
659
|
function injectHandleFunction(_this__u8e3s4, endpoint) {
|
|
@@ -1462,35 +663,35 @@ function injectHandleFunction(_this__u8e3s4, endpoint) {
|
|
|
1462
663
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1463
664
|
var tmp = scope;
|
|
1464
665
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1465
|
-
var this_0 = scope.
|
|
666
|
+
var this_0 = scope.a1w_1;
|
|
1466
667
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1467
668
|
// Inline function 'kotlin.apply' call
|
|
1468
669
|
var this_1 = new TransformerBuilder();
|
|
1469
|
-
this_1.
|
|
1470
|
-
var tmp$ret$2 = this_1.
|
|
1471
|
-
tmp.
|
|
1472
|
-
var tmp_0 = scope.
|
|
670
|
+
this_1.u1i(injectHandleFunction$lambda(handlersStruct));
|
|
671
|
+
var tmp$ret$2 = this_1.v1i();
|
|
672
|
+
tmp.a1w_1 = transform(this_0, tmp$ret$2);
|
|
673
|
+
var tmp_0 = scope.a1w_1;
|
|
1473
674
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1474
675
|
}
|
|
1475
676
|
function buildModelImports(_this__u8e3s4, packageName) {
|
|
1476
677
|
// Inline function 'kotlin.collections.filter' call
|
|
1477
678
|
var tmp0 = importReferences(_this__u8e3s4);
|
|
1478
679
|
// Inline function 'kotlin.collections.filterTo' call
|
|
1479
|
-
var destination = ArrayList_init_$Create$();
|
|
680
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1480
681
|
var _iterator__ex2g4s = tmp0.t();
|
|
1481
682
|
while (_iterator__ex2g4s.u()) {
|
|
1482
683
|
var element = _iterator__ex2g4s.v();
|
|
1483
|
-
if (!(_this__u8e3s4.
|
|
684
|
+
if (!(_this__u8e3s4.mr().m1() === element.lv_1)) {
|
|
1484
685
|
destination.x(element);
|
|
1485
686
|
}
|
|
1486
687
|
}
|
|
1487
688
|
// Inline function 'kotlin.collections.map' call
|
|
1488
689
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1489
|
-
var destination_0 = ArrayList_init_$Create$
|
|
690
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(destination, 10));
|
|
1490
691
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1491
692
|
while (_iterator__ex2g4s_0.u()) {
|
|
1492
693
|
var item = _iterator__ex2g4s_0.v();
|
|
1493
|
-
var tmp$ret$3 = import_0(packageName.
|
|
694
|
+
var tmp$ret$3 = import_0(packageName.js_1 + '.model', Companion_getInstance().h1h(item.lv_1).i1h());
|
|
1494
695
|
destination_0.x(tmp$ret$3);
|
|
1495
696
|
}
|
|
1496
697
|
return destination_0;
|
|
@@ -1501,14 +702,14 @@ function qualifyChannelReferences(_this__u8e3s4, fullyQualifiedPrefix) {
|
|
|
1501
702
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1502
703
|
var tmp = scope;
|
|
1503
704
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1504
|
-
var this_0 = scope.
|
|
705
|
+
var this_0 = scope.a1w_1;
|
|
1505
706
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1506
707
|
// Inline function 'kotlin.apply' call
|
|
1507
708
|
var this_1 = new TransformerBuilder();
|
|
1508
|
-
this_1.
|
|
1509
|
-
var tmp$ret$2 = this_1.
|
|
1510
|
-
tmp.
|
|
1511
|
-
var tmp_0 = scope.
|
|
709
|
+
this_1.u1i(qualifyChannelReferences$lambda(fullyQualifiedPrefix));
|
|
710
|
+
var tmp$ret$2 = this_1.v1i();
|
|
711
|
+
tmp.a1w_1 = transform(this_0, tmp$ret$2);
|
|
712
|
+
var tmp_0 = scope.a1w_1;
|
|
1512
713
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1513
714
|
}
|
|
1514
715
|
function wrapAsyncReturnInThenApply(_this__u8e3s4, endpointName) {
|
|
@@ -1517,26 +718,26 @@ function wrapAsyncReturnInThenApply(_this__u8e3s4, endpointName) {
|
|
|
1517
718
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1518
719
|
var tmp = scope;
|
|
1519
720
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1520
|
-
var this_0 = scope.
|
|
721
|
+
var this_0 = scope.a1w_1;
|
|
1521
722
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1522
723
|
// Inline function 'kotlin.apply' call
|
|
1523
724
|
var this_1 = new TransformerBuilder();
|
|
1524
|
-
this_1.
|
|
1525
|
-
var tmp$ret$2 = this_1.
|
|
1526
|
-
tmp.
|
|
1527
|
-
var tmp_0 = scope.
|
|
725
|
+
this_1.u1i(wrapAsyncReturnInThenApply$lambda(endpointName));
|
|
726
|
+
var tmp$ret$2 = this_1.v1i();
|
|
727
|
+
tmp.a1w_1 = transform(this_0, tmp$ret$2);
|
|
728
|
+
var tmp_0 = scope.a1w_1;
|
|
1528
729
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1529
730
|
}
|
|
1530
731
|
function findRoot(_this__u8e3s4) {
|
|
1531
732
|
var tmp;
|
|
1532
733
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
1533
|
-
tmp = findRoot(_this__u8e3s4.
|
|
734
|
+
tmp = findRoot(_this__u8e3s4.c1j_1);
|
|
1534
735
|
} else {
|
|
1535
736
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
1536
|
-
tmp = findRoot(_this__u8e3s4.
|
|
737
|
+
tmp = findRoot(_this__u8e3s4.d1j_1);
|
|
1537
738
|
} else {
|
|
1538
|
-
if (_this__u8e3s4 instanceof
|
|
1539
|
-
tmp = findRoot(_this__u8e3s4.
|
|
739
|
+
if (_this__u8e3s4 instanceof Dict) {
|
|
740
|
+
tmp = findRoot(_this__u8e3s4.m1n_1);
|
|
1540
741
|
} else {
|
|
1541
742
|
tmp = _this__u8e3s4;
|
|
1542
743
|
}
|
|
@@ -1552,7 +753,7 @@ function rawContainerClass(_this__u8e3s4) {
|
|
|
1552
753
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
1553
754
|
tmp = 'java.util.List';
|
|
1554
755
|
} else {
|
|
1555
|
-
if (_this__u8e3s4 instanceof
|
|
756
|
+
if (_this__u8e3s4 instanceof Dict) {
|
|
1556
757
|
tmp = 'java.util.Map';
|
|
1557
758
|
} else {
|
|
1558
759
|
tmp = null;
|
|
@@ -1563,9 +764,9 @@ function rawContainerClass(_this__u8e3s4) {
|
|
|
1563
764
|
}
|
|
1564
765
|
function toJavaName(_this__u8e3s4) {
|
|
1565
766
|
var tmp;
|
|
1566
|
-
if (_this__u8e3s4 instanceof
|
|
767
|
+
if (_this__u8e3s4 instanceof Integer) {
|
|
1567
768
|
var tmp_0;
|
|
1568
|
-
switch (_this__u8e3s4.
|
|
769
|
+
switch (_this__u8e3s4.i1n_1.c3_1) {
|
|
1569
770
|
case 0:
|
|
1570
771
|
tmp_0 = 'Integer';
|
|
1571
772
|
break;
|
|
@@ -1578,9 +779,9 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1578
779
|
}
|
|
1579
780
|
tmp = tmp_0;
|
|
1580
781
|
} else {
|
|
1581
|
-
if (_this__u8e3s4 instanceof
|
|
782
|
+
if (_this__u8e3s4 instanceof Number_0) {
|
|
1582
783
|
var tmp_1;
|
|
1583
|
-
switch (_this__u8e3s4.
|
|
784
|
+
switch (_this__u8e3s4.j1n_1.c3_1) {
|
|
1584
785
|
case 0:
|
|
1585
786
|
tmp_1 = 'Float';
|
|
1586
787
|
break;
|
|
@@ -1596,10 +797,10 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1596
797
|
if (equals(_this__u8e3s4, String_instance)) {
|
|
1597
798
|
tmp = 'String';
|
|
1598
799
|
} else {
|
|
1599
|
-
if (equals(_this__u8e3s4,
|
|
800
|
+
if (equals(_this__u8e3s4, Boolean_instance)) {
|
|
1600
801
|
tmp = 'Boolean';
|
|
1601
802
|
} else {
|
|
1602
|
-
if (equals(_this__u8e3s4,
|
|
803
|
+
if (equals(_this__u8e3s4, Bytes_instance)) {
|
|
1603
804
|
tmp = 'byte[]';
|
|
1604
805
|
} else {
|
|
1605
806
|
if (equals(_this__u8e3s4, Any_instance)) {
|
|
@@ -1608,8 +809,8 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1608
809
|
if (equals(_this__u8e3s4, Unit_instance_0)) {
|
|
1609
810
|
tmp = 'Void';
|
|
1610
811
|
} else {
|
|
1611
|
-
if (_this__u8e3s4 instanceof
|
|
1612
|
-
tmp = _this__u8e3s4.
|
|
812
|
+
if (_this__u8e3s4 instanceof Custom) {
|
|
813
|
+
tmp = _this__u8e3s4.e1j_1.i1h();
|
|
1613
814
|
} else {
|
|
1614
815
|
tmp = 'Object';
|
|
1615
816
|
}
|
|
@@ -1623,7 +824,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1623
824
|
return tmp;
|
|
1624
825
|
}
|
|
1625
826
|
function buildHandlersStruct(_this__u8e3s4) {
|
|
1626
|
-
var pathTemplate = '/' + joinToString(_this__u8e3s4.
|
|
827
|
+
var pathTemplate = '/' + joinToString(_this__u8e3s4.mq_1, '/', VOID, VOID, VOID, VOID, buildHandlersStruct$lambda);
|
|
1627
828
|
return struct('Handlers', buildHandlersStruct$lambda_0(pathTemplate, _this__u8e3s4));
|
|
1628
829
|
}
|
|
1629
830
|
function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
@@ -1635,14 +836,14 @@ function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
|
1635
836
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matching' call
|
|
1636
837
|
var tmp_0 = scope;
|
|
1637
838
|
// Inline function 'community.flock.wirespec.ir.core.transformMatching' call
|
|
1638
|
-
var this_0 = scope.
|
|
839
|
+
var this_0 = scope.a1w_1;
|
|
1639
840
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1640
841
|
// Inline function 'kotlin.apply' call
|
|
1641
842
|
var this_1 = new TransformerBuilder();
|
|
1642
|
-
this_1.
|
|
1643
|
-
var tmp$ret$3 = this_1.
|
|
1644
|
-
tmp_0.
|
|
1645
|
-
var tmp_1 = scope.
|
|
843
|
+
this_1.g1w(withFullyQualifiedPrefix$lambda(prefix));
|
|
844
|
+
var tmp$ret$3 = this_1.v1i();
|
|
845
|
+
tmp_0.a1w_1 = transform(this_0, tmp$ret$3);
|
|
846
|
+
var tmp_1 = scope.a1w_1;
|
|
1646
847
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1647
848
|
} else {
|
|
1648
849
|
tmp = _this__u8e3s4;
|
|
@@ -1652,8 +853,8 @@ function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
|
1652
853
|
function transformTypeDescriptors$lambda(stmt, tr) {
|
|
1653
854
|
var tmp;
|
|
1654
855
|
if (stmt instanceof TypeDescriptor) {
|
|
1655
|
-
var rootType = findRoot(stmt.
|
|
1656
|
-
var containerStr = rawContainerClass(stmt.
|
|
856
|
+
var rootType = findRoot(stmt.q1q_1);
|
|
857
|
+
var containerStr = rawContainerClass(stmt.q1q_1);
|
|
1657
858
|
var rootStr = toJavaName(rootType) + '.class';
|
|
1658
859
|
var tmp_0;
|
|
1659
860
|
if (containerStr == null) {
|
|
@@ -1672,8 +873,8 @@ function transformTypeDescriptors$lambda(stmt, tr) {
|
|
|
1672
873
|
}
|
|
1673
874
|
function applyRefinedStructShape$lambda$lambda($refined) {
|
|
1674
875
|
return function ($this$function) {
|
|
1675
|
-
$this$function.
|
|
1676
|
-
$this$function.
|
|
876
|
+
$this$function.y1h(convert_6($refined.ur_1));
|
|
877
|
+
$this$function.z1h(new VariableReference(Companion_getInstance().h1h('value')));
|
|
1677
878
|
return Unit_instance;
|
|
1678
879
|
};
|
|
1679
880
|
}
|
|
@@ -1683,19 +884,48 @@ function applyRefinedStructShape$lambda($refined) {
|
|
|
1683
884
|
if (element instanceof Struct) {
|
|
1684
885
|
var tmp_0 = listOf(Custom_init_$Create$('Wirespec.Refined'));
|
|
1685
886
|
// Inline function 'kotlin.collections.map' call
|
|
1686
|
-
var this_0 = element.
|
|
887
|
+
var this_0 = element.g1q_1;
|
|
1687
888
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1688
|
-
var destination = ArrayList_init_$Create$
|
|
889
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1689
890
|
var _iterator__ex2g4s = this_0.t();
|
|
1690
891
|
while (_iterator__ex2g4s.u()) {
|
|
1691
892
|
var item = _iterator__ex2g4s.v();
|
|
1692
893
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
1693
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
894
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.p1l(VOID, VOID, VOID, VOID, VOID, VOID, VOID, true);
|
|
1694
895
|
var tmp$ret$0 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
1695
896
|
destination.x(tmp$ret$0);
|
|
1696
897
|
}
|
|
1697
|
-
var
|
|
1698
|
-
|
|
898
|
+
var tmp0 = element.n1q(VOID, VOID, VOID, tmp_0, destination);
|
|
899
|
+
// Inline function 'community.flock.wirespec.ir.core.plus' call
|
|
900
|
+
var element_0 = function_0('value', VOID, true, applyRefinedStructShape$lambda$lambda($refined));
|
|
901
|
+
var tmp_1;
|
|
902
|
+
if (tmp0 instanceof File) {
|
|
903
|
+
var tmp_2 = tmp0.g1o(VOID, plus_0(tmp0.d1o_1, element_0));
|
|
904
|
+
tmp_1 = tmp_2 instanceof Struct ? tmp_2 : THROW_CCE();
|
|
905
|
+
} else {
|
|
906
|
+
if (tmp0 instanceof Struct) {
|
|
907
|
+
var tmp_3 = tmp0.n1q(VOID, VOID, VOID, VOID, plus_0(tmp0.g1q_1, element_0));
|
|
908
|
+
tmp_1 = tmp_3 instanceof Struct ? tmp_3 : THROW_CCE();
|
|
909
|
+
} else {
|
|
910
|
+
if (tmp0 instanceof Namespace) {
|
|
911
|
+
var tmp_4 = tmp0.n1o(VOID, plus_0(tmp0.j1o_1, element_0));
|
|
912
|
+
tmp_1 = tmp_4 instanceof Struct ? tmp_4 : THROW_CCE();
|
|
913
|
+
} else {
|
|
914
|
+
if (tmp0 instanceof Interface) {
|
|
915
|
+
var tmp_5 = tmp0.w1o(VOID, plus_0(tmp0.p1o_1, element_0));
|
|
916
|
+
tmp_1 = tmp_5 instanceof Struct ? tmp_5 : THROW_CCE();
|
|
917
|
+
} else {
|
|
918
|
+
if (tmp0 instanceof Enum_0) {
|
|
919
|
+
var tmp_6 = tmp0.b1q(VOID, VOID, VOID, VOID, VOID, plus_0(tmp0.y1p_1, element_0));
|
|
920
|
+
tmp_1 = tmp_6 instanceof Struct ? tmp_6 : THROW_CCE();
|
|
921
|
+
} else {
|
|
922
|
+
noWhenBranchMatchedException();
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
tmp = tmp_1;
|
|
1699
929
|
} else {
|
|
1700
930
|
tmp = element;
|
|
1701
931
|
}
|
|
@@ -1710,7 +940,36 @@ function injectApiField$lambda(element, transformer) {
|
|
|
1710
940
|
var tmp_0;
|
|
1711
941
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1712
942
|
if (!injected.r()) {
|
|
1713
|
-
|
|
943
|
+
// Inline function 'community.flock.wirespec.ir.core.withElements' call
|
|
944
|
+
var elements = plus(element.e1o(), injected);
|
|
945
|
+
var tmp_1;
|
|
946
|
+
if (element instanceof File) {
|
|
947
|
+
tmp_1 = element.g1o(VOID, elements);
|
|
948
|
+
} else {
|
|
949
|
+
if (element instanceof Struct) {
|
|
950
|
+
tmp_1 = element.n1q(VOID, VOID, VOID, VOID, elements);
|
|
951
|
+
} else {
|
|
952
|
+
if (element instanceof Namespace) {
|
|
953
|
+
tmp_1 = element.n1o(VOID, elements);
|
|
954
|
+
} else {
|
|
955
|
+
if (element instanceof Interface) {
|
|
956
|
+
tmp_1 = element.w1o(VOID, elements);
|
|
957
|
+
} else {
|
|
958
|
+
if (element instanceof Enum_0) {
|
|
959
|
+
tmp_1 = element.b1q(VOID, VOID, VOID, VOID, VOID, elements);
|
|
960
|
+
} else {
|
|
961
|
+
if (element instanceof Main) {
|
|
962
|
+
tmp_1 = element;
|
|
963
|
+
} else {
|
|
964
|
+
tmp_1 = element;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
var tmp_2 = tmp_1;
|
|
972
|
+
tmp_0 = tmp_2 instanceof Namespace ? tmp_2 : THROW_CCE();
|
|
1714
973
|
} else {
|
|
1715
974
|
tmp_0 = element;
|
|
1716
975
|
}
|
|
@@ -1729,7 +988,36 @@ function injectHandleFunction$lambda$lambda($handlersStruct) {
|
|
|
1729
988
|
var tmp_0;
|
|
1730
989
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1731
990
|
if (!injected.r()) {
|
|
1732
|
-
|
|
991
|
+
// Inline function 'community.flock.wirespec.ir.core.withElements' call
|
|
992
|
+
var elements = plus(element.e1o(), injected);
|
|
993
|
+
var tmp_1;
|
|
994
|
+
if (element instanceof File) {
|
|
995
|
+
tmp_1 = element.g1o(VOID, elements);
|
|
996
|
+
} else {
|
|
997
|
+
if (element instanceof Struct) {
|
|
998
|
+
tmp_1 = element.n1q(VOID, VOID, VOID, VOID, elements);
|
|
999
|
+
} else {
|
|
1000
|
+
if (element instanceof Namespace) {
|
|
1001
|
+
tmp_1 = element.n1o(VOID, elements);
|
|
1002
|
+
} else {
|
|
1003
|
+
if (element instanceof Interface) {
|
|
1004
|
+
tmp_1 = element.w1o(VOID, elements);
|
|
1005
|
+
} else {
|
|
1006
|
+
if (element instanceof Enum_0) {
|
|
1007
|
+
tmp_1 = element.b1q(VOID, VOID, VOID, VOID, VOID, elements);
|
|
1008
|
+
} else {
|
|
1009
|
+
if (element instanceof Main) {
|
|
1010
|
+
tmp_1 = element;
|
|
1011
|
+
} else {
|
|
1012
|
+
tmp_1 = element;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
var tmp_2 = tmp_1;
|
|
1020
|
+
tmp_0 = tmp_2 instanceof Interface ? tmp_2 : THROW_CCE();
|
|
1733
1021
|
} else {
|
|
1734
1022
|
tmp_0 = element;
|
|
1735
1023
|
}
|
|
@@ -1746,21 +1034,21 @@ function injectHandleFunction$lambda($handlersStruct) {
|
|
|
1746
1034
|
var tmp;
|
|
1747
1035
|
if (element instanceof Interface) {
|
|
1748
1036
|
var tmp_0;
|
|
1749
|
-
if (element.
|
|
1037
|
+
if (element.o1o_1.equals(Companion_getInstance().h1h('Handler'))) {
|
|
1750
1038
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1751
1039
|
var scope = new TransformScope(element);
|
|
1752
1040
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1753
1041
|
var tmp_1 = scope;
|
|
1754
1042
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1755
1043
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1756
|
-
var this_0 = scope.
|
|
1044
|
+
var this_0 = scope.a1w_1;
|
|
1757
1045
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1758
1046
|
// Inline function 'kotlin.apply' call
|
|
1759
1047
|
var this_1 = new TransformerBuilder();
|
|
1760
|
-
this_1.
|
|
1761
|
-
var tmp$ret$2 = this_1.
|
|
1762
|
-
tmp_1.
|
|
1763
|
-
var tmp_2 = scope.
|
|
1048
|
+
this_1.u1i(injectHandleFunction$lambda$lambda($handlersStruct));
|
|
1049
|
+
var tmp$ret$2 = this_1.v1i();
|
|
1050
|
+
tmp_1.a1w_1 = transform(this_0, tmp$ret$2);
|
|
1051
|
+
var tmp_2 = scope.a1w_1;
|
|
1764
1052
|
tmp_0 = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1765
1053
|
} else {
|
|
1766
1054
|
tmp_0 = element;
|
|
@@ -1791,11 +1079,11 @@ function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
|
1791
1079
|
if (element instanceof Function) {
|
|
1792
1080
|
var tmp$ret$0;
|
|
1793
1081
|
$l$block_1: {
|
|
1794
|
-
if (!element.
|
|
1082
|
+
if (!element.j1l_1 || element.i1l_1.b1() < 2) {
|
|
1795
1083
|
tmp$ret$0 = element;
|
|
1796
1084
|
break $l$block_1;
|
|
1797
1085
|
}
|
|
1798
|
-
var tmp_0 = element.
|
|
1086
|
+
var tmp_0 = element.i1l_1.c1(element.i1l_1.b1() - 2 | 0);
|
|
1799
1087
|
var tmp0_elvis_lhs = tmp_0 instanceof Assignment ? tmp_0 : null;
|
|
1800
1088
|
var tmp_1;
|
|
1801
1089
|
if (tmp0_elvis_lhs == null) {
|
|
@@ -1805,16 +1093,16 @@ function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
|
1805
1093
|
tmp_1 = tmp0_elvis_lhs;
|
|
1806
1094
|
}
|
|
1807
1095
|
var transportAssign = tmp_1;
|
|
1808
|
-
var tmp_2 = last(element.
|
|
1096
|
+
var tmp_2 = last(element.i1l_1);
|
|
1809
1097
|
if (!(tmp_2 instanceof ReturnStatement)) {
|
|
1810
1098
|
tmp$ret$0 = element;
|
|
1811
1099
|
break $l$block_1;
|
|
1812
1100
|
}
|
|
1813
|
-
var tmp_3 = dropLast(element.
|
|
1814
|
-
var tmp1_name = Companion_getInstance().
|
|
1815
|
-
var tmp2_receiver = transportAssign.
|
|
1816
|
-
var tmp3_arguments = mapOf(to(Companion_getInstance().
|
|
1817
|
-
tmp$ret$0 = element.
|
|
1101
|
+
var tmp_3 = dropLast(element.i1l_1, 2);
|
|
1102
|
+
var tmp1_name = Companion_getInstance().h1h('thenApply');
|
|
1103
|
+
var tmp2_receiver = transportAssign.t1q_1;
|
|
1104
|
+
var tmp3_arguments = mapOf(to(Companion_getInstance().h1h('mapper'), new RawExpression('rawResponse -> ' + $endpointName + '.fromRawResponse(serialization(), rawResponse)')));
|
|
1105
|
+
tmp$ret$0 = element.p1l(VOID, VOID, VOID, VOID, plus_0(tmp_3, new ReturnStatement(new FunctionCall(tmp2_receiver, VOID, tmp1_name, tmp3_arguments))));
|
|
1818
1106
|
}
|
|
1819
1107
|
tmp = tmp$ret$0;
|
|
1820
1108
|
} else {
|
|
@@ -1827,10 +1115,10 @@ function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
|
1827
1115
|
function buildHandlersStruct$lambda(it) {
|
|
1828
1116
|
var tmp;
|
|
1829
1117
|
if (it instanceof Literal) {
|
|
1830
|
-
tmp = it.
|
|
1118
|
+
tmp = it.bu_1;
|
|
1831
1119
|
} else {
|
|
1832
1120
|
if (it instanceof Param) {
|
|
1833
|
-
tmp = '{' + it.
|
|
1121
|
+
tmp = '{' + it.rq_1.m1() + '}';
|
|
1834
1122
|
} else {
|
|
1835
1123
|
noWhenBranchMatchedException();
|
|
1836
1124
|
}
|
|
@@ -1839,46 +1127,46 @@ function buildHandlersStruct$lambda(it) {
|
|
|
1839
1127
|
}
|
|
1840
1128
|
function buildHandlersStruct$lambda$lambda($pathTemplate) {
|
|
1841
1129
|
return function ($this$function) {
|
|
1842
|
-
$this$function.
|
|
1843
|
-
$this$function.
|
|
1130
|
+
$this$function.y1h(String_instance);
|
|
1131
|
+
$this$function.z1h($this$function.g1v($pathTemplate));
|
|
1844
1132
|
return Unit_instance;
|
|
1845
1133
|
};
|
|
1846
1134
|
}
|
|
1847
1135
|
function buildHandlersStruct$lambda$lambda_0($this_buildHandlersStruct) {
|
|
1848
1136
|
return function ($this$function) {
|
|
1849
|
-
$this$function.
|
|
1850
|
-
$this$function.
|
|
1137
|
+
$this$function.y1h(String_instance);
|
|
1138
|
+
$this$function.z1h($this$function.g1v($this_buildHandlersStruct.lq_1.b3_1));
|
|
1851
1139
|
return Unit_instance;
|
|
1852
1140
|
};
|
|
1853
1141
|
}
|
|
1854
1142
|
function buildHandlersStruct$lambda$lambda_1($this$function) {
|
|
1855
|
-
$this$function.
|
|
1856
|
-
$this$function.
|
|
1857
|
-
$this$function.
|
|
1143
|
+
$this$function.y1h($this$function.j1h('Wirespec.ServerEdge', [$this$function.j1h('Request', []), $this$function.j1h('Response', [Wildcard_instance])]));
|
|
1144
|
+
$this$function.v1h('serialization', $this$function.j1h('Wirespec.Serialization', []));
|
|
1145
|
+
$this$function.z1h(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}'));
|
|
1858
1146
|
return Unit_instance;
|
|
1859
1147
|
}
|
|
1860
1148
|
function buildHandlersStruct$lambda$lambda_2($this$function) {
|
|
1861
|
-
$this$function.
|
|
1862
|
-
$this$function.
|
|
1863
|
-
$this$function.
|
|
1149
|
+
$this$function.y1h($this$function.j1h('Wirespec.ClientEdge', [$this$function.j1h('Request', []), $this$function.j1h('Response', [Wildcard_instance])]));
|
|
1150
|
+
$this$function.v1h('serialization', $this$function.j1h('Wirespec.Serialization', []));
|
|
1151
|
+
$this$function.z1h(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}'));
|
|
1864
1152
|
return Unit_instance;
|
|
1865
1153
|
}
|
|
1866
1154
|
function buildHandlersStruct$lambda_0($pathTemplate, $this_buildHandlersStruct) {
|
|
1867
1155
|
return function ($this$struct) {
|
|
1868
|
-
$this$struct.
|
|
1869
|
-
$this$struct.
|
|
1870
|
-
$this$struct.
|
|
1871
|
-
$this$struct.
|
|
1872
|
-
$this$struct.
|
|
1873
|
-
$this$struct.
|
|
1156
|
+
$this$struct.v1k($this$struct.j1h('Wirespec.Server', [$this$struct.j1h('Request', []), $this$struct.j1h('Response', [Wildcard_instance])]));
|
|
1157
|
+
$this$struct.v1k($this$struct.j1h('Wirespec.Client', [$this$struct.j1h('Request', []), $this$struct.j1h('Response', [Wildcard_instance])]));
|
|
1158
|
+
$this$struct.a1i('getPathTemplate', VOID, true, buildHandlersStruct$lambda$lambda($pathTemplate));
|
|
1159
|
+
$this$struct.a1i('getMethod', VOID, true, buildHandlersStruct$lambda$lambda_0($this_buildHandlersStruct));
|
|
1160
|
+
$this$struct.a1i('getServer', VOID, true, buildHandlersStruct$lambda$lambda_1);
|
|
1161
|
+
$this$struct.a1i('getClient', VOID, true, buildHandlersStruct$lambda$lambda_2);
|
|
1874
1162
|
return Unit_instance;
|
|
1875
1163
|
};
|
|
1876
1164
|
}
|
|
1877
1165
|
function withFullyQualifiedPrefix$lambda($prefix) {
|
|
1878
1166
|
return function (type, transformer) {
|
|
1879
1167
|
var tmp;
|
|
1880
|
-
if (type instanceof
|
|
1881
|
-
tmp = type.
|
|
1168
|
+
if (type instanceof Custom) {
|
|
1169
|
+
tmp = type.p1n(new Name(listOf($prefix + type.e1j_1.i1h())));
|
|
1882
1170
|
} else {
|
|
1883
1171
|
tmp = type;
|
|
1884
1172
|
}
|
|
@@ -1886,157 +1174,14 @@ function withFullyQualifiedPrefix$lambda($prefix) {
|
|
|
1886
1174
|
return transformChildren_1(transformed, transformer);
|
|
1887
1175
|
};
|
|
1888
1176
|
}
|
|
1889
|
-
function JavaRefinedTypeDefinitionEmitter() {
|
|
1890
|
-
}
|
|
1891
|
-
function JavaShared() {
|
|
1892
|
-
JavaShared_instance = this;
|
|
1893
|
-
this.f1y_1 = 'community.flock.wirespec.java';
|
|
1894
|
-
this.g1y_1 = trimMargin('\n |package ' + this.f1y_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.is(2) + 'Req from(RawRequest request);\n |' + Spacer_instance.is(2) + 'RawResponse to(Res response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface ClientEdge<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.is(2) + 'RawRequest to(Req request);\n |' + Spacer_instance.is(2) + 'Res from(RawResponse response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.is(2) + 'String getPathTemplate();\n |' + Spacer_instance.is(2) + 'String getMethod();\n |' + Spacer_instance.is(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.is(2) + 'String getPathTemplate();\n |' + Spacer_instance.is(2) + 'String getMethod();\n |' + Spacer_instance.is(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.is(2) + 'if(rawType != null) {\n |' + Spacer_instance.is(3) + 'return new ParameterizedType() {\n |' + Spacer_instance.is(4) + 'public Type getRawType() { return rawType; }\n |' + Spacer_instance.is(4) + 'public Type[] getActualTypeArguments() { return new Class<?>[]{actualTypeArguments}; }\n |' + Spacer_instance.is(4) + 'public Type getOwnerType() { return null; }\n |' + Spacer_instance.is(3) + '};\n |' + Spacer_instance.is(2) + '}\n |' + Spacer_instance.is(2) + 'else { return actualTypeArguments; }\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
1895
|
-
}
|
|
1896
|
-
protoOf(JavaShared).toString = function () {
|
|
1897
|
-
return 'JavaShared';
|
|
1898
|
-
};
|
|
1899
|
-
protoOf(JavaShared).hashCode = function () {
|
|
1900
|
-
return 1339168438;
|
|
1901
|
-
};
|
|
1902
|
-
protoOf(JavaShared).equals = function (other) {
|
|
1903
|
-
if (this === other)
|
|
1904
|
-
return true;
|
|
1905
|
-
if (!(other instanceof JavaShared))
|
|
1906
|
-
return false;
|
|
1907
|
-
return true;
|
|
1908
|
-
};
|
|
1909
|
-
var JavaShared_instance;
|
|
1910
|
-
function JavaShared_getInstance() {
|
|
1911
|
-
if (JavaShared_instance == null)
|
|
1912
|
-
new JavaShared();
|
|
1913
|
-
return JavaShared_instance;
|
|
1914
|
-
}
|
|
1915
|
-
function emitType($this, _this__u8e3s4) {
|
|
1916
|
-
var tmp;
|
|
1917
|
-
if (_this__u8e3s4 instanceof Dict) {
|
|
1918
|
-
tmp = 'java.util.Map<String, ' + $this.oq(_this__u8e3s4.so_1) + '>';
|
|
1919
|
-
} else {
|
|
1920
|
-
if (_this__u8e3s4 instanceof Iterable) {
|
|
1921
|
-
tmp = 'java.util.List<' + $this.oq(_this__u8e3s4.po_1) + '>';
|
|
1922
|
-
} else {
|
|
1923
|
-
if (_this__u8e3s4 instanceof Unit) {
|
|
1924
|
-
tmp = 'void';
|
|
1925
|
-
} else {
|
|
1926
|
-
if (_this__u8e3s4 instanceof Any) {
|
|
1927
|
-
tmp = 'Object';
|
|
1928
|
-
} else {
|
|
1929
|
-
if (_this__u8e3s4 instanceof Custom) {
|
|
1930
|
-
tmp = _this__u8e3s4.cv_1;
|
|
1931
|
-
} else {
|
|
1932
|
-
if (_this__u8e3s4 instanceof Primitive) {
|
|
1933
|
-
tmp = emit_18($this, _this__u8e3s4);
|
|
1934
|
-
} else {
|
|
1935
|
-
noWhenBranchMatchedException();
|
|
1936
|
-
}
|
|
1937
|
-
}
|
|
1938
|
-
}
|
|
1939
|
-
}
|
|
1940
|
-
}
|
|
1941
|
-
}
|
|
1942
|
-
return tmp;
|
|
1943
|
-
}
|
|
1944
|
-
function emit_18($this, _this__u8e3s4) {
|
|
1945
|
-
var t = _this__u8e3s4.gv_1;
|
|
1946
|
-
var tmp;
|
|
1947
|
-
if (t instanceof String_0) {
|
|
1948
|
-
tmp = 'String';
|
|
1949
|
-
} else {
|
|
1950
|
-
if (t instanceof Integer) {
|
|
1951
|
-
var tmp_0;
|
|
1952
|
-
switch (t.ku_1.b3_1) {
|
|
1953
|
-
case 0:
|
|
1954
|
-
tmp_0 = 'Integer';
|
|
1955
|
-
break;
|
|
1956
|
-
case 1:
|
|
1957
|
-
tmp_0 = 'Long';
|
|
1958
|
-
break;
|
|
1959
|
-
default:
|
|
1960
|
-
noWhenBranchMatchedException();
|
|
1961
|
-
break;
|
|
1962
|
-
}
|
|
1963
|
-
tmp = tmp_0;
|
|
1964
|
-
} else {
|
|
1965
|
-
if (t instanceof Number_0) {
|
|
1966
|
-
var tmp_1;
|
|
1967
|
-
switch (t.nu_1.b3_1) {
|
|
1968
|
-
case 0:
|
|
1969
|
-
tmp_1 = 'Float';
|
|
1970
|
-
break;
|
|
1971
|
-
case 1:
|
|
1972
|
-
tmp_1 = 'Double';
|
|
1973
|
-
break;
|
|
1974
|
-
default:
|
|
1975
|
-
noWhenBranchMatchedException();
|
|
1976
|
-
break;
|
|
1977
|
-
}
|
|
1978
|
-
tmp = tmp_1;
|
|
1979
|
-
} else {
|
|
1980
|
-
if (t instanceof Boolean_0) {
|
|
1981
|
-
tmp = 'Boolean';
|
|
1982
|
-
} else {
|
|
1983
|
-
if (t instanceof Bytes) {
|
|
1984
|
-
tmp = 'byte[]';
|
|
1985
|
-
} else {
|
|
1986
|
-
noWhenBranchMatchedException();
|
|
1987
|
-
}
|
|
1988
|
-
}
|
|
1989
|
-
}
|
|
1990
|
-
}
|
|
1991
|
-
}
|
|
1992
|
-
return tmp;
|
|
1993
|
-
}
|
|
1994
|
-
function JavaTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
1995
|
-
return function (it) {
|
|
1996
|
-
return this$0.oq(it);
|
|
1997
|
-
};
|
|
1998
|
-
}
|
|
1999
|
-
function JavaTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2000
|
-
return function (it) {
|
|
2001
|
-
return Spacer_instance.toString() + this$0.nq(it) + ',';
|
|
2002
|
-
};
|
|
2003
|
-
}
|
|
2004
|
-
function JavaTypeDefinitionEmitter() {
|
|
2005
|
-
}
|
|
2006
|
-
function JavaUnionDefinitionEmitter$emit$lambda(it) {
|
|
2007
|
-
return it.l1();
|
|
2008
|
-
}
|
|
2009
|
-
function JavaUnionDefinitionEmitter() {
|
|
2010
|
-
}
|
|
2011
1177
|
//region block: post-declaration
|
|
2012
|
-
protoOf(
|
|
2013
|
-
protoOf(
|
|
2014
|
-
protoOf(
|
|
2015
|
-
protoOf(
|
|
2016
|
-
protoOf(JavaEmitter).oq = emit_6;
|
|
2017
|
-
protoOf(JavaEmitter).pq = emit_7;
|
|
2018
|
-
protoOf(JavaEmitter).bs = emit_11;
|
|
2019
|
-
protoOf(JavaEmitter).i1y = emit_12;
|
|
2020
|
-
protoOf(JavaEmitter).j1y = emit_13;
|
|
2021
|
-
protoOf(JavaEmitter).pr = emit_8;
|
|
2022
|
-
protoOf(JavaEmitter).as = emit_10;
|
|
2023
|
-
protoOf(JavaEmitter).qr = emit_15;
|
|
2024
|
-
protoOf(JavaEmitter).vr = emit_14;
|
|
2025
|
-
protoOf(JavaEmitter).h1y = sanitizeSymbol;
|
|
2026
|
-
protoOf(JavaEmitter).k1y = sanitizeFirstIsDigit;
|
|
2027
|
-
protoOf(JavaEmitter).l1y = sanitizeKeywords;
|
|
2028
|
-
protoOf(JavaEmitter).x1x = emitRoot;
|
|
2029
|
-
protoOf(JavaEmitter).w1x = emitRoot$default;
|
|
2030
|
-
protoOf(JavaEmitter).m1y = emitHandleFunction;
|
|
2031
|
-
protoOf(JavaEmitter).cs = emitValidator;
|
|
2032
|
-
protoOf(JavaIrEmitter).w1w = get_extensions;
|
|
2033
|
-
protoOf(JavaIrEmitter).eo = emit_1;
|
|
2034
|
-
protoOf(JavaIrEmitter).x1w = emit_2;
|
|
2035
|
-
protoOf(JavaIrEmitter).b1x = beforeGenerate;
|
|
1178
|
+
protoOf(JavaIrEmitter).p1w = get_extensions;
|
|
1179
|
+
protoOf(JavaIrEmitter).no = emit_0;
|
|
1180
|
+
protoOf(JavaIrEmitter).q1w = emit_1;
|
|
1181
|
+
protoOf(JavaIrEmitter).u1w = beforeGenerate;
|
|
2036
1182
|
//endregion
|
|
2037
1183
|
//region block: exports
|
|
2038
1184
|
export {
|
|
2039
|
-
JavaEmitter as JavaEmitter1ye60adpym6m1,
|
|
2040
1185
|
JavaIrEmitter as JavaIrEmittereoab4zj7i4gq,
|
|
2041
1186
|
};
|
|
2042
1187
|
//endregion
|