@flock/wirespec 0.18.6 → 0.19.0-RC.3
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/Kotlin-DateTime-library-kotlinx-datetime.mjs +4 -0
- package/Kotlin-DateTime-library-kotlinx-datetime.mjs.map +1 -0
- package/arrow-arrow-atomic.mjs +12 -12
- package/arrow-arrow-core.mjs +154 -154
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt-mordant.mjs.map +1 -1
- package/clikt-clikt.mjs +1549 -1549
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +441 -441
- package/kotest-kotest-assertions-kotest-assertions-core.mjs +4 -0
- package/kotest-kotest-assertions-kotest-assertions-core.mjs.map +1 -0
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs +4 -0
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs.map +1 -0
- package/kotest-kotest-common.mjs +56 -0
- package/kotest-kotest-common.mjs.map +1 -0
- package/kotest-kotest-framework-kotest-framework-engine.mjs +4 -0
- package/kotest-kotest-framework-kotest-framework-engine.mjs.map +1 -0
- package/kotest-kotest-property-kotest-property-datetime.mjs +4 -0
- package/kotest-kotest-property-kotest-property-datetime.mjs.map +1 -0
- package/kotest-kotest-property.mjs +2400 -0
- package/kotest-kotest-property.mjs.map +1 -0
- package/kotest-property-arbs.mjs +4 -0
- package/kotest-property-arbs.mjs.map +1 -0
- package/kotlin-kotlin-stdlib.mjs +5198 -2276
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +4933 -4933
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1802 -1802
- package/kotlinx-coroutines-test.mjs +4 -0
- package/kotlinx-coroutines-test.mjs.map +1 -0
- package/kotlinx-io-kotlinx-io-core.mjs +432 -432
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1993 -1959
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1388 -1388
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1321 -1321
- package/package.json +9 -2
- package/wirespec-generator.d.ts +52 -0
- package/wirespec-generator.mjs +9 -0
- package/wirespec-src-compiler-core.mjs +1538 -1537
- package/wirespec-src-compiler-emitters-java.mjs +451 -389
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +364 -301
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +556 -359
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +758 -458
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +243 -165
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +706 -420
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +80 -80
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +6639 -4861
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +418 -418
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +509 -509
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +753 -753
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-integration-kotest.mjs +1455 -0
- package/wirespec-src-integration-kotest.mjs.map +1 -0
- package/wirespec-src-plugin-arguments.mjs +182 -182
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +106 -106
- package/wirespec-src-plugin-npm.d.mts +11 -0
- package/wirespec-src-plugin-npm.mjs +41 -41
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +53 -53
- package/wirespec-src-tools-generator.mjs.map +1 -1
- package/xmlutil-core.mjs +4 -0
- package/xmlutil-core.mjs.map +1 -0
- package/xmlutil-serialization.mjs +4 -0
- package/xmlutil-serialization.mjs.map +1 -0
|
@@ -21,6 +21,10 @@ import {
|
|
|
21
21
|
spacer28p2fwyb64afn as spacer,
|
|
22
22
|
FieldIdentifier34k7iphndcnl0 as FieldIdentifier,
|
|
23
23
|
DefinitionIdentifiervfasqdb33qef as DefinitionIdentifier,
|
|
24
|
+
Unionccsavx6nrdr2 as Union,
|
|
25
|
+
Refined1lkzc0dg6wey7 as Refined,
|
|
26
|
+
Enum3l2iuc342kle6 as Enum,
|
|
27
|
+
Type12n1gx16iqtcu as Type,
|
|
24
28
|
plus14o24vdaiongg as plus_0,
|
|
25
29
|
Bytes_instance1o9u095wd3kx6 as Bytes_instance,
|
|
26
30
|
Boolean_instance237vwt01w3hs8 as Boolean_instance,
|
|
@@ -82,9 +86,15 @@ import {
|
|
|
82
86
|
emptyList1g2z5xcrvp2zy as emptyList,
|
|
83
87
|
Paire9pteg33gng7 as Pair,
|
|
84
88
|
plus310ted5e4i90h as plus_1,
|
|
89
|
+
substringBefore3n7kj60w69hju as substringBefore,
|
|
85
90
|
listOf1jh22dvmctj1r as listOf_0,
|
|
86
91
|
plus20p0vtfmu0596 as plus_2,
|
|
87
92
|
isInterface3d6p8outrmvmk as isInterface,
|
|
93
|
+
asSequence2phdjljfh9jhx as asSequence_0,
|
|
94
|
+
filterNot56uwv8hfomaa as filterNot,
|
|
95
|
+
mapsbvh18eqox7a as map,
|
|
96
|
+
distinct17vua5ffe1cfv as distinct_0,
|
|
97
|
+
toListx6x8nvfmvvht as toList,
|
|
88
98
|
addAll1k27qatfgp3k5 as addAll,
|
|
89
99
|
HashSet_init_$Create$33p49hmosnvr4 as HashSet_init_$Create$,
|
|
90
100
|
Collection1k04j3hzsbod0 as Collection,
|
|
@@ -112,11 +122,11 @@ import {
|
|
|
112
122
|
transformChildrend9p91tpcqdkx as transformChildren_0,
|
|
113
123
|
withElements2toq84v08e72 as withElements,
|
|
114
124
|
Namespace345pal554qu3j as Namespace,
|
|
125
|
+
import5uhkz67bd8tt as import_0,
|
|
115
126
|
function12vu2kapzno4w as function_0,
|
|
116
127
|
String_instance3uxvo48ki208u as String_instance,
|
|
117
128
|
VariableReference2vlynnhaw1i64 as VariableReference,
|
|
118
|
-
|
|
119
|
-
import5uhkz67bd8tt as import_0,
|
|
129
|
+
JavaGenerator_getInstancepty760x3tbfi as JavaGenerator_getInstance,
|
|
120
130
|
SanitizationConfig11mmn3p2c03c1 as SanitizationConfig,
|
|
121
131
|
convertClientServer1w4pgeabrnbb9 as convertClientServer,
|
|
122
132
|
toGetterAccessors2z6mndbqwlczg as toGetterAccessors,
|
|
@@ -129,8 +139,14 @@ import {
|
|
|
129
139
|
emitn3eihixilqyh as emit_0,
|
|
130
140
|
prependImports32gcj3yb8voha as prependImports,
|
|
131
141
|
placeInPackage1ffljbk9me4ug as placeInPackage,
|
|
132
|
-
|
|
142
|
+
convertToGenerator2wzjrmaavxhph as convertToGenerator,
|
|
143
|
+
convertToGeneratorkggw47cqose7 as convertToGenerator_0,
|
|
144
|
+
convertToGenerator3rjr3azp4vdsx as convertToGenerator_1,
|
|
145
|
+
convertToGenerator2msmr3acdd5nx as convertToGenerator_2,
|
|
133
146
|
sanitizeNames2wqmyf8vafp9x as sanitizeNames,
|
|
147
|
+
collectCustomTypeNames373f3lwl9sqd5 as collectCustomTypeNames,
|
|
148
|
+
placeInPackagena6oqbi45fz6 as placeInPackage_0,
|
|
149
|
+
convertWithValidation3ar3nbcqsbkpn as convertWithValidation,
|
|
134
150
|
convert11ert2po54h1y as convert_0,
|
|
135
151
|
injectEnumLabelFieldyfohidz6c88i as injectEnumLabelField,
|
|
136
152
|
convert37aabdzvtv9vg as convert_1,
|
|
@@ -141,6 +157,7 @@ import {
|
|
|
141
157
|
emitClient32kfwzg2hm5vj as emitClient,
|
|
142
158
|
emit1oxjujel6f3jb as emit_1,
|
|
143
159
|
emit3bzdcd0f6nwtj as emit_2,
|
|
160
|
+
beforeGenerate3o8idb3hey1b0 as beforeGenerate,
|
|
144
161
|
IrEmitterh2m93ojzvkep as IrEmitter,
|
|
145
162
|
Dict22iqrhoo0g8et as Dict_0,
|
|
146
163
|
Array2goj74t0aak7b as Array_0,
|
|
@@ -156,7 +173,6 @@ import {
|
|
|
156
173
|
RawExpression2bo7ldfrptjia as RawExpression,
|
|
157
174
|
TypeDescriptor1hvcpxrtxcqsx as TypeDescriptor,
|
|
158
175
|
convert2loxpwk8n2r8c as convert_5,
|
|
159
|
-
Custom_init_$Create$2enn7oyj71j1t as Custom_init_$Create$,
|
|
160
176
|
Function21cuq8qizkin7 as Function,
|
|
161
177
|
plusd54zq6f7l8fy as plus_3,
|
|
162
178
|
Struct39wf79cwtn4ty as Struct,
|
|
@@ -170,10 +186,10 @@ import {
|
|
|
170
186
|
//endregion
|
|
171
187
|
//region block: pre-declaration
|
|
172
188
|
function emit_3(type, module_0) {
|
|
173
|
-
var tmp = this.
|
|
174
|
-
var tmp_0 = this.
|
|
189
|
+
var tmp = this.uu(type.ts_1);
|
|
190
|
+
var tmp_0 = this.tt(type.us_1);
|
|
175
191
|
// Inline function 'kotlin.run' call
|
|
176
|
-
var $this$run = type.
|
|
192
|
+
var $this$run = type.vs_1;
|
|
177
193
|
var tmp_1;
|
|
178
194
|
if ($this$run.r()) {
|
|
179
195
|
tmp_1 = '';
|
|
@@ -184,23 +200,23 @@ function emit_3(type, module_0) {
|
|
|
184
200
|
return trimMargin('\n |public record ' + tmp + ' (\n |' + tmp_0 + '\n |)' + tmp$ret$1 + ' {\n |};\n |\n ');
|
|
185
201
|
}
|
|
186
202
|
function emit_4(_this__u8e3s4) {
|
|
187
|
-
return dropLast_0(joinToString(_this__u8e3s4.
|
|
203
|
+
return dropLast_0(joinToString(_this__u8e3s4.qs_1, '\n', VOID, VOID, VOID, VOID, JavaTypeDefinitionEmitter$emit$lambda_0(this)), 1);
|
|
188
204
|
}
|
|
189
205
|
function emit_5(_this__u8e3s4) {
|
|
190
|
-
return this.
|
|
206
|
+
return this.vt(_this__u8e3s4.zs_1) + ' ' + this.uu(_this__u8e3s4.ys_1);
|
|
191
207
|
}
|
|
192
208
|
function emit_6(_this__u8e3s4) {
|
|
193
209
|
// Inline function 'kotlin.let' call
|
|
194
210
|
var it = emitType(this, _this__u8e3s4);
|
|
195
|
-
return _this__u8e3s4.
|
|
211
|
+
return _this__u8e3s4.ay() ? 'java.util.Optional<' + it + '>' : it;
|
|
196
212
|
}
|
|
197
213
|
function emitRoot(_this__u8e3s4, void_0) {
|
|
198
214
|
var tmp;
|
|
199
215
|
if (_this__u8e3s4 instanceof Dict) {
|
|
200
|
-
tmp = this.
|
|
216
|
+
tmp = this.w1z(_this__u8e3s4.as_1);
|
|
201
217
|
} else {
|
|
202
218
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
203
|
-
tmp = this.
|
|
219
|
+
tmp = this.w1z(_this__u8e3s4.xr_1);
|
|
204
220
|
} else {
|
|
205
221
|
if (_this__u8e3s4 instanceof Unit) {
|
|
206
222
|
tmp = void_0;
|
|
@@ -229,15 +245,15 @@ function emitRoot(_this__u8e3s4, void_0) {
|
|
|
229
245
|
}
|
|
230
246
|
function emitRoot$default(_this__u8e3s4, void_0, $super) {
|
|
231
247
|
void_0 = void_0 === VOID ? 'void' : void_0;
|
|
232
|
-
return $super === VOID ? this.
|
|
248
|
+
return $super === VOID ? this.x1z(_this__u8e3s4, void_0) : emitRoot(_this__u8e3s4, void_0);
|
|
233
249
|
}
|
|
234
250
|
function emit_7(_this__u8e3s4) {
|
|
235
251
|
var tmp;
|
|
236
252
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
237
|
-
tmp = 'return java.util.regex.Pattern.compile("' + replace(this.
|
|
253
|
+
tmp = 'return java.util.regex.Pattern.compile("' + replace(this.xt(_this__u8e3s4.ww_1), '\\', '\\\\') + '").matcher(value).find();';
|
|
238
254
|
} else {
|
|
239
255
|
if (_this__u8e3s4 instanceof Bound) {
|
|
240
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
256
|
+
var tmp1_safe_receiver = _this__u8e3s4.mx_1;
|
|
241
257
|
var tmp_0;
|
|
242
258
|
if (tmp1_safe_receiver == null) {
|
|
243
259
|
tmp_0 = null;
|
|
@@ -246,7 +262,7 @@ function emit_7(_this__u8e3s4) {
|
|
|
246
262
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
247
263
|
}
|
|
248
264
|
var minCheck = tmp_0;
|
|
249
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
265
|
+
var tmp2_safe_receiver = _this__u8e3s4.nx_1;
|
|
250
266
|
var tmp_1;
|
|
251
267
|
if (tmp2_safe_receiver == null) {
|
|
252
268
|
tmp_1 = null;
|
|
@@ -272,16 +288,16 @@ function emit_7(_this__u8e3s4) {
|
|
|
272
288
|
}
|
|
273
289
|
initMetadataForInterface(JavaTypeDefinitionEmitter, 'JavaTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter]);
|
|
274
290
|
function emit_8(channel) {
|
|
275
|
-
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |@FunctionalInterface\n |public interface ' + this.
|
|
291
|
+
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |@FunctionalInterface\n |public interface ' + this.uu(channel.ks_1) + ' {\n | void invoke(' + emitFullyQualified(this, channel, channel.ls_1) + this.w1z(channel.ls_1) + ' message);\n |}\n |\n ');
|
|
276
292
|
}
|
|
277
293
|
initMetadataForInterface(JavaChannelDefinitionEmitter, 'JavaChannelDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
278
294
|
function emit_9(identifier) {
|
|
279
295
|
var tmp;
|
|
280
296
|
if (identifier instanceof DefinitionIdentifier) {
|
|
281
|
-
tmp = this.
|
|
297
|
+
tmp = this.h20(identifier.m1());
|
|
282
298
|
} else {
|
|
283
299
|
if (identifier instanceof FieldIdentifier) {
|
|
284
|
-
tmp = this.
|
|
300
|
+
tmp = this.l20(this.h20(identifier.m1()));
|
|
285
301
|
} else {
|
|
286
302
|
noWhenBranchMatchedException();
|
|
287
303
|
}
|
|
@@ -299,11 +315,11 @@ function sanitizeSymbol(_this__u8e3s4) {
|
|
|
299
315
|
var item = _iterator__ex2g4s.v();
|
|
300
316
|
var _unary__edvuaz = index;
|
|
301
317
|
index = _unary__edvuaz + 1 | 0;
|
|
302
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
318
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.mu(item) : item;
|
|
303
319
|
destination.x(tmp$ret$0);
|
|
304
320
|
}
|
|
305
321
|
var tmp = asSequence(joinToString(destination, ''));
|
|
306
|
-
return this.
|
|
322
|
+
return this.k20(joinToString_0(filter(tmp, JavaIdentifierEmitter$sanitizeSymbol$lambda), ''));
|
|
307
323
|
}
|
|
308
324
|
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
309
325
|
var tmp;
|
|
@@ -323,34 +339,44 @@ function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
|
323
339
|
return tmp;
|
|
324
340
|
}
|
|
325
341
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
326
|
-
return Companion_getInstance_0().
|
|
342
|
+
return Companion_getInstance_0().n20_1.v1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
327
343
|
}
|
|
328
344
|
initMetadataForInterface(JavaIdentifierEmitter, 'JavaIdentifierEmitter');
|
|
329
|
-
function emit_10(
|
|
330
|
-
|
|
345
|
+
function emit_10(enum_0, module_0) {
|
|
346
|
+
var tmp = this.uu(enum_0.ev_1);
|
|
347
|
+
return trimMargin('\n |public enum ' + tmp + ' implements Wirespec.Enum {\n |' + spacer(joinToString(enum_0.fv_1, ',\n', VOID, VOID, VOID, VOID, JavaEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'public final String label;\n |' + Spacer_instance.toString() + this.uu(enum_0.ev_1) + '(String label) {\n |' + Spacer_instance.ov(2) + 'this.label = label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() {\n |' + Spacer_instance.ov(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String label() {\n |' + Spacer_instance.ov(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
348
|
+
}
|
|
349
|
+
initMetadataForInterface(JavaEnumDefinitionEmitter, 'JavaEnumDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
350
|
+
function emit_11(union) {
|
|
351
|
+
var tmp = this.uu(union.os_1);
|
|
352
|
+
return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.ps_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
|
|
353
|
+
}
|
|
354
|
+
initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
355
|
+
function emit_12(refined) {
|
|
356
|
+
return trimMargin('\n |public record ' + this.uu(refined.zu_1) + ' (' + this.vt(refined.av_1) + ' value) implements Wirespec.Refined<' + this.vt(refined.av_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.iv(refined) + '\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public ' + this.vt(refined.av_1) + ' value() { return value; }\n |}\n |\n ');
|
|
331
357
|
}
|
|
332
358
|
function emitValidator(_this__u8e3s4) {
|
|
333
359
|
var defaultReturn = 'return true;';
|
|
334
|
-
var type = _this__u8e3s4.
|
|
360
|
+
var type = _this__u8e3s4.av_1.my_1;
|
|
335
361
|
var tmp;
|
|
336
362
|
if (type instanceof Integer) {
|
|
337
|
-
var tmp0_safe_receiver = type.
|
|
338
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
363
|
+
var tmp0_safe_receiver = type.rx_1;
|
|
364
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.wt(tmp0_safe_receiver);
|
|
339
365
|
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
340
366
|
} else {
|
|
341
367
|
if (type instanceof Number_0) {
|
|
342
|
-
var tmp2_safe_receiver = type.
|
|
343
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.
|
|
368
|
+
var tmp2_safe_receiver = type.ux_1;
|
|
369
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.wt(tmp2_safe_receiver);
|
|
344
370
|
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
345
371
|
} else {
|
|
346
372
|
if (type instanceof String_0) {
|
|
347
|
-
var tmp4_safe_receiver = type.
|
|
373
|
+
var tmp4_safe_receiver = type.ox_1;
|
|
348
374
|
var tmp_0;
|
|
349
375
|
var tmp_1 = tmp4_safe_receiver;
|
|
350
376
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
351
377
|
tmp_0 = null;
|
|
352
378
|
} else {
|
|
353
|
-
tmp_0 = this.
|
|
379
|
+
tmp_0 = this.wt(new RegExp_0(tmp4_safe_receiver));
|
|
354
380
|
}
|
|
355
381
|
var tmp5_elvis_lhs = tmp_0;
|
|
356
382
|
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
@@ -370,56 +396,56 @@ function emitValidator(_this__u8e3s4) {
|
|
|
370
396
|
return tmp;
|
|
371
397
|
}
|
|
372
398
|
initMetadataForInterface(JavaRefinedTypeDefinitionEmitter, 'JavaRefinedTypeDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
373
|
-
function
|
|
399
|
+
function emit_13(endpoint) {
|
|
374
400
|
var tmp = emitImports_0(this, endpoint);
|
|
375
|
-
var tmp_0 = this.
|
|
401
|
+
var tmp_0 = this.uu(endpoint.ct_1);
|
|
376
402
|
var tmp_1 = get_pathParams(endpoint);
|
|
377
403
|
var tmp_2 = emitObject(this, tmp_1, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
|
|
378
|
-
var tmp_3 = emitObject(this, endpoint.
|
|
379
|
-
var tmp_4 = emitObject(this, endpoint.
|
|
380
|
-
var tmp_5 = this.
|
|
404
|
+
var tmp_3 = emitObject(this, endpoint.ft_1, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
405
|
+
var tmp_4 = emitObject(this, endpoint.gt_1, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
406
|
+
var tmp_5 = this.i20(first_0(endpoint.ht_1), endpoint);
|
|
381
407
|
var tmp_6 = Spacer_instance.toString();
|
|
382
408
|
var tmp_7 = emitStatusInterfaces(this, endpoint);
|
|
383
409
|
var tmp_8 = emitResponseInterfaces(this, endpoint);
|
|
384
|
-
var tmp_9 = distinctByStatus(endpoint.
|
|
410
|
+
var tmp_9 = distinctByStatus(endpoint.it_1);
|
|
385
411
|
var tmp_10 = joinToString(tmp_9, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
386
412
|
var tmp_11 = Spacer_instance.toString();
|
|
387
|
-
var tmp_12 = emitRequestFunctions(this, first_0(endpoint.
|
|
388
|
-
var tmp_13 = Spacer_instance.
|
|
389
|
-
var tmp_14 = distinctByStatus(endpoint.
|
|
413
|
+
var tmp_12 = emitRequestFunctions(this, first_0(endpoint.ht_1), endpoint);
|
|
414
|
+
var tmp_13 = Spacer_instance.ov(2);
|
|
415
|
+
var tmp_14 = distinctByStatus(endpoint.it_1);
|
|
390
416
|
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
391
|
-
var tmp_16 = Spacer_instance.
|
|
392
|
-
var tmp_17 = Spacer_instance.
|
|
393
|
-
var tmp_18 = Spacer_instance.
|
|
417
|
+
var tmp_16 = Spacer_instance.ov(3);
|
|
418
|
+
var tmp_17 = Spacer_instance.ov(2);
|
|
419
|
+
var tmp_18 = Spacer_instance.ov(2);
|
|
394
420
|
var tmp_19 = emitFromResponse(this, endpoint);
|
|
395
|
-
var tmp_20 = Spacer_instance.
|
|
396
|
-
var tmp_21 = Spacer_instance.
|
|
397
|
-
var tmp_22 = this.
|
|
398
|
-
var tmp_23 = Spacer_instance.
|
|
399
|
-
var tmp_24 = Spacer_instance.
|
|
400
|
-
return trimMargin('\n |' + tmp + '\n |\n |public interface ' + tmp_0 + ' extends Wirespec.Endpoint {\n |' + tmp_2 + '\n |\n |' + tmp_3 + '\n |\n |' + tmp_4 + '\n |\n |' + tmp_5 + '\n |\n |' + tmp_6 + 'sealed interface Response<T> extends Wirespec.Response<T> {}\n |' + tmp_7 + '\n |' + tmp_8 + '\n |\n |' + tmp_10 + '\n |\n |' + tmp_11 + 'interface Handler extends Wirespec.Handler {\n |\n |' + tmp_12 + '\n |\n |' + tmp_13 + 'static Wirespec.RawResponse toResponse(Wirespec.Serializer serialization, Response<?> response) {\n |' + tmp_15 + '\n |' + tmp_16 + 'else { throw new IllegalStateException("Cannot match response with status: " + response.status());}\n |' + tmp_17 + '}\n |\n |' + tmp_18 + 'static Response<?> fromResponse(Wirespec.Deserializer serialization, Wirespec.RawResponse response) {\n |' + tmp_19 + '\n |' + tmp_20 + '}\n |\n |' + tmp_21 + tmp_22 + '\n |' + tmp_23 + 'class Handlers implements Wirespec.Server<Request, Response<?>>, Wirespec.Client<Request, Response<?>> {\n |' + tmp_24 + '@Override public String getPathTemplate() { return "/' + joinToString(endpoint.
|
|
421
|
+
var tmp_20 = Spacer_instance.ov(2);
|
|
422
|
+
var tmp_21 = Spacer_instance.ov(2);
|
|
423
|
+
var tmp_22 = this.m20(endpoint);
|
|
424
|
+
var tmp_23 = Spacer_instance.ov(2);
|
|
425
|
+
var tmp_24 = Spacer_instance.ov(3);
|
|
426
|
+
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.et_1, '/', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_4) + '"; }\n |' + Spacer_instance.ov(3) + '@Override public String getMethod() { return "' + endpoint.dt_1.toString() + '"; }\n |' + Spacer_instance.ov(3) + '@Override public Wirespec.ServerEdge<Request, Response<?>> getServer(Wirespec.Serialization serialization) {\n |' + Spacer_instance.ov(4) + 'return new Wirespec.ServerEdge<>() {\n |' + Spacer_instance.ov(5) + '@Override public Request from(Wirespec.RawRequest request) { return fromRequest(serialization, request); }\n |' + Spacer_instance.ov(5) + '@Override public Wirespec.RawResponse to(Response<?> response) { return toResponse(serialization, response); }\n |' + Spacer_instance.ov(4) + '};\n |' + Spacer_instance.ov(3) + '}\n |' + Spacer_instance.ov(3) + '@Override public Wirespec.ClientEdge<Request, Response<?>> getClient(Wirespec.Serialization serialization) {\n |' + Spacer_instance.ov(4) + 'return new Wirespec.ClientEdge<>() {\n |' + Spacer_instance.ov(5) + '@Override public Wirespec.RawRequest to(Request request) { return toRequest(serialization, request); }\n |' + Spacer_instance.ov(5) + '@Override public Response<?> from(Wirespec.RawResponse response) { return fromResponse(serialization, response); }\n |' + Spacer_instance.ov(4) + '};\n |' + Spacer_instance.ov(3) + '}\n |' + Spacer_instance.ov(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
401
427
|
}
|
|
402
428
|
function emitHandleFunction(endpoint) {
|
|
403
|
-
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.
|
|
429
|
+
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.nu(this.uu(endpoint.ct_1)) + '(Request request);';
|
|
404
430
|
}
|
|
405
|
-
function
|
|
406
|
-
return trimMargin('\n |' + Spacer_instance.toString() + 'record Request (\n |' + Spacer_instance.
|
|
431
|
+
function emit_14(_this__u8e3s4, endpoint) {
|
|
432
|
+
return trimMargin('\n |' + Spacer_instance.toString() + 'record Request (\n |' + Spacer_instance.ov(2) + 'Path path,\n |' + Spacer_instance.ov(2) + 'Wirespec.Method method,\n |' + Spacer_instance.ov(2) + 'Queries queries,\n |' + Spacer_instance.ov(2) + 'RequestHeaders headers,\n |' + Spacer_instance.ov(2) + emit_16(this, _this__u8e3s4.lt_1) + ' body\n |' + Spacer_instance.toString() + ') implements Wirespec.Request<' + emit_16(this, _this__u8e3s4.lt_1) + '> {\n |' + Spacer_instance.ov(2) + emitConstructor(this, _this__u8e3s4, endpoint) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
407
433
|
}
|
|
408
|
-
function
|
|
434
|
+
function emit_15(_this__u8e3s4) {
|
|
409
435
|
var tmp = Spacer_instance.toString();
|
|
410
|
-
var tmp_0 = Companion_instance_1.
|
|
411
|
-
var tmp_1 = Spacer_instance.
|
|
412
|
-
var tmp_2 = Spacer_instance.
|
|
413
|
-
var tmp_3 = Spacer_instance.
|
|
414
|
-
var tmp_4 = emit_16(this, _this__u8e3s4.
|
|
436
|
+
var tmp_0 = Companion_instance_1.mu(_this__u8e3s4.ot_1);
|
|
437
|
+
var tmp_1 = Spacer_instance.ov(2);
|
|
438
|
+
var tmp_2 = Spacer_instance.ov(2);
|
|
439
|
+
var tmp_3 = Spacer_instance.ov(2);
|
|
440
|
+
var tmp_4 = emit_16(this, _this__u8e3s4.qt_1);
|
|
415
441
|
var tmp_5 = Spacer_instance.toString();
|
|
416
|
-
var tmp_6 = toString_0(first(_this__u8e3s4.
|
|
417
|
-
var tmp_7 = emit_16(this, _this__u8e3s4.
|
|
418
|
-
var tmp_8 = concatGenerics(emit_16(this, _this__u8e3s4.
|
|
419
|
-
var tmp_9 = Spacer_instance.
|
|
420
|
-
var tmp_10 = Companion_instance_1.
|
|
421
|
-
var tmp_11 = orNull(joinToString(_this__u8e3s4.
|
|
422
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
442
|
+
var tmp_6 = toString_0(first(_this__u8e3s4.ot_1));
|
|
443
|
+
var tmp_7 = emit_16(this, _this__u8e3s4.qt_1);
|
|
444
|
+
var tmp_8 = concatGenerics(emit_16(this, _this__u8e3s4.qt_1));
|
|
445
|
+
var tmp_9 = Spacer_instance.ov(2);
|
|
446
|
+
var tmp_10 = Companion_instance_1.mu(_this__u8e3s4.ot_1);
|
|
447
|
+
var tmp_11 = orNull(joinToString(_this__u8e3s4.pt_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_5(this)));
|
|
448
|
+
var tmp0_safe_receiver = _this__u8e3s4.qt_1;
|
|
423
449
|
var tmp_12;
|
|
424
450
|
if (tmp0_safe_receiver == null) {
|
|
425
451
|
tmp_12 = null;
|
|
@@ -428,27 +454,17 @@ function emit_13(_this__u8e3s4) {
|
|
|
428
454
|
tmp_12 = emit_16(this, tmp0_safe_receiver) + ' body';
|
|
429
455
|
}
|
|
430
456
|
var tmp_13 = joinToString(listOfNotNull([tmp_11, tmp_12]));
|
|
431
|
-
var tmp_14 = Spacer_instance.
|
|
432
|
-
var tmp_15 = fixStatus(_this__u8e3s4.
|
|
457
|
+
var tmp_14 = Spacer_instance.ov(3);
|
|
458
|
+
var tmp_15 = fixStatus(_this__u8e3s4.ot_1);
|
|
433
459
|
// Inline function 'kotlin.let' call
|
|
434
|
-
var tmp_16 = 'new Headers(' + joinToString(_this__u8e3s4.
|
|
435
|
-
var tmp_17 = _this__u8e3s4.
|
|
436
|
-
var tmp_18 = Spacer_instance.
|
|
437
|
-
var tmp_19 = Spacer_instance.
|
|
438
|
-
return trimMargin('\n |' + tmp + 'record Response' + tmp_0 + '(\n |' + tmp_1 + 'Integer status,\n |' + tmp_2 + 'Headers headers,\n |' + tmp_3 + tmp_4 + ' body\n |' + tmp_5 + ') implements Response' + tmp_6 + 'XX<' + tmp_7 + '>, Response' + tmp_8 + ' {\n |' + tmp_9 + 'public Response' + tmp_10 + '(' + tmp_13 + ') {\n |' + tmp_14 + 'this(' + tmp_15 + ', ' + tmp_16 + ', ' + tmp_17 + ');\n |' + tmp_18 + '}\n |' + tmp_19 + emitObject(this, _this__u8e3s4.
|
|
460
|
+
var tmp_16 = 'new Headers(' + joinToString(_this__u8e3s4.pt_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_6(this)) + ')';
|
|
461
|
+
var tmp_17 = _this__u8e3s4.qt_1 == null ? 'null' : 'body';
|
|
462
|
+
var tmp_18 = Spacer_instance.ov(2);
|
|
463
|
+
var tmp_19 = Spacer_instance.ov(1);
|
|
464
|
+
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.pt_1, 'Headers', 'Wirespec.Response.Headers', JavaEndpointDefinitionEmitter$emit$lambda_7(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
439
465
|
}
|
|
440
466
|
initMetadataForInterface(JavaEndpointDefinitionEmitter, 'JavaEndpointDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
441
|
-
|
|
442
|
-
var tmp = this.wq(union.qo_1);
|
|
443
|
-
return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.ro_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
|
|
444
|
-
}
|
|
445
|
-
initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
446
|
-
function emit_15(enum_0, module_0) {
|
|
447
|
-
var tmp = this.wq(enum_0.gr_1);
|
|
448
|
-
return trimMargin('\n |public enum ' + tmp + ' implements Wirespec.Enum {\n |' + spacer(joinToString(enum_0.hr_1, ',\n', VOID, VOID, VOID, VOID, JavaEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'public final String label;\n |' + Spacer_instance.toString() + this.wq(enum_0.gr_1) + '(String label) {\n |' + Spacer_instance.qr(2) + 'this.label = label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() {\n |' + Spacer_instance.qr(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String label() {\n |' + Spacer_instance.qr(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
449
|
-
}
|
|
450
|
-
initMetadataForInterface(JavaEnumDefinitionEmitter, 'JavaEnumDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
451
|
-
initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [JavaChannelDefinitionEmitter, JavaIdentifierEmitter, JavaRefinedTypeDefinitionEmitter, JavaEndpointDefinitionEmitter, JavaUnionDefinitionEmitter, JavaTypeDefinitionEmitter, JavaEnumDefinitionEmitter, LanguageEmitter]);
|
|
467
|
+
initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [JavaEnumDefinitionEmitter, JavaUnionDefinitionEmitter, JavaRefinedTypeDefinitionEmitter, JavaIdentifierEmitter, JavaTypeDefinitionEmitter, JavaEndpointDefinitionEmitter, JavaChannelDefinitionEmitter, LanguageEmitter]);
|
|
452
468
|
initMetadataForCompanion(Companion);
|
|
453
469
|
initMetadataForCompanion(Companion_0);
|
|
454
470
|
initMetadataForClass(JavaIrEmitter, 'JavaIrEmitter', JavaIrEmitter, VOID, [IrEmitter]);
|
|
@@ -462,7 +478,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
462
478
|
var _iterator__ex2g4s = tmp0.t();
|
|
463
479
|
while (_iterator__ex2g4s.u()) {
|
|
464
480
|
var element = _iterator__ex2g4s.v();
|
|
465
|
-
if (!(_this__u8e3s4.
|
|
481
|
+
if (!(_this__u8e3s4.tu().m1() === element.iy_1)) {
|
|
466
482
|
destination.x(element);
|
|
467
483
|
}
|
|
468
484
|
}
|
|
@@ -472,7 +488,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
472
488
|
var _iterator__ex2g4s_0 = destination.t();
|
|
473
489
|
while (_iterator__ex2g4s_0.u()) {
|
|
474
490
|
var item = _iterator__ex2g4s_0.v();
|
|
475
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
491
|
+
var tmp$ret$3 = 'import ' + $this.v1z().kv_1 + '.model.' + item.iy_1 + ';';
|
|
476
492
|
destination_0.x(tmp$ret$3);
|
|
477
493
|
}
|
|
478
494
|
var tmp = destination_0;
|
|
@@ -480,8 +496,8 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
480
496
|
}
|
|
481
497
|
function emitFullyQualified($this, _this__u8e3s4, reference) {
|
|
482
498
|
var tmp;
|
|
483
|
-
if (_this__u8e3s4.
|
|
484
|
-
tmp = $this.
|
|
499
|
+
if (_this__u8e3s4.tu().m1() === reference.m1()) {
|
|
500
|
+
tmp = $this.v1z().kv_1 + '.model.';
|
|
485
501
|
} else {
|
|
486
502
|
tmp = '';
|
|
487
503
|
}
|
|
@@ -494,49 +510,49 @@ function JavaChannelDefinitionEmitter$emitImports$lambda(it) {
|
|
|
494
510
|
function JavaChannelDefinitionEmitter() {
|
|
495
511
|
}
|
|
496
512
|
function JavaEmitter(packageName, emitShared) {
|
|
497
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
498
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
513
|
+
packageName = packageName === VOID ? Companion_instance.jv('community.flock.wirespec.generated') : packageName;
|
|
514
|
+
emitShared = emitShared === VOID ? Companion_instance_0.es() : emitShared;
|
|
499
515
|
LanguageEmitter.call(this);
|
|
500
|
-
this.
|
|
501
|
-
this.
|
|
502
|
-
this.
|
|
503
|
-
this.
|
|
504
|
-
this.
|
|
505
|
-
this.
|
|
506
|
-
}
|
|
507
|
-
protoOf(JavaEmitter).
|
|
508
|
-
return this.
|
|
516
|
+
this.y1z_1 = packageName;
|
|
517
|
+
this.z1z_1 = emitShared;
|
|
518
|
+
this.a20_1 = '\nimport community.flock.wirespec.java.Wirespec;\n';
|
|
519
|
+
this.b20_1 = FileExtension_Java_getInstance();
|
|
520
|
+
this.c20_1 = JavaShared_getInstance();
|
|
521
|
+
this.d20_1 = '//';
|
|
522
|
+
}
|
|
523
|
+
protoOf(JavaEmitter).v1z = function () {
|
|
524
|
+
return this.y1z_1;
|
|
509
525
|
};
|
|
510
|
-
protoOf(JavaEmitter).
|
|
511
|
-
return this.
|
|
526
|
+
protoOf(JavaEmitter).cu = function () {
|
|
527
|
+
return this.b20_1;
|
|
512
528
|
};
|
|
513
|
-
protoOf(JavaEmitter).
|
|
514
|
-
return this.
|
|
529
|
+
protoOf(JavaEmitter).e20 = function () {
|
|
530
|
+
return this.c20_1;
|
|
515
531
|
};
|
|
516
|
-
protoOf(JavaEmitter).
|
|
517
|
-
return this.
|
|
532
|
+
protoOf(JavaEmitter).du = function () {
|
|
533
|
+
return this.d20_1;
|
|
518
534
|
};
|
|
519
|
-
protoOf(JavaEmitter).
|
|
535
|
+
protoOf(JavaEmitter).ru = function (module_0, logger) {
|
|
520
536
|
// Inline function 'kotlin.let' call
|
|
521
|
-
var it = protoOf(LanguageEmitter).
|
|
522
|
-
return this.
|
|
537
|
+
var it = protoOf(LanguageEmitter).ru.call(this, module_0, logger);
|
|
538
|
+
return this.z1z_1.fs_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.jv('community.flock.wirespec.java').mv() + 'Wirespec', this.e20().g20_1)) : it;
|
|
523
539
|
};
|
|
524
|
-
protoOf(JavaEmitter).
|
|
540
|
+
protoOf(JavaEmitter).su = function (definition, module_0, logger) {
|
|
525
541
|
// Inline function 'kotlin.let' call
|
|
526
|
-
var it = protoOf(LanguageEmitter).
|
|
527
|
-
var subPackageName = plus(this.
|
|
528
|
-
var tmp = subPackageName.
|
|
542
|
+
var it = protoOf(LanguageEmitter).su.call(this, definition, module_0, logger);
|
|
543
|
+
var subPackageName = plus(this.v1z(), definition);
|
|
544
|
+
var tmp = subPackageName.mv() + this.h20(it.gs_1);
|
|
529
545
|
// Inline function 'kotlin.text.trimStart' call
|
|
530
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.
|
|
546
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.ou(module_0) ? this.a20_1 : '') + '\n |' + it.hs_1 + '\n ');
|
|
531
547
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
532
548
|
return new Emitted(tmp, tmp$ret$0);
|
|
533
549
|
};
|
|
534
550
|
function emitGetType($this, _this__u8e3s4) {
|
|
535
|
-
return 'Wirespec.getType(' + $this.
|
|
551
|
+
return 'Wirespec.getType(' + $this.x1z(_this__u8e3s4, 'Void') + '.class, ' + emitGetTypeRaw($this, _this__u8e3s4) + ')';
|
|
536
552
|
}
|
|
537
553
|
function emitGetTypeRaw($this, _this__u8e3s4) {
|
|
538
554
|
var tmp;
|
|
539
|
-
var tmp1_elvis_lhs = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
555
|
+
var tmp1_elvis_lhs = _this__u8e3s4 == null ? null : _this__u8e3s4.ay();
|
|
540
556
|
if (tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs) {
|
|
541
557
|
tmp = 'java.util.Optional.class';
|
|
542
558
|
} else {
|
|
@@ -551,9 +567,9 @@ function emitGetTypeRaw($this, _this__u8e3s4) {
|
|
|
551
567
|
function emitConstructor($this, _this__u8e3s4, endpoint) {
|
|
552
568
|
var tmp = get_pathParams(endpoint);
|
|
553
569
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda($this)));
|
|
554
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
555
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
556
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
570
|
+
var tmp_1 = orNull(joinToString(endpoint.ft_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_0($this)));
|
|
571
|
+
var tmp_2 = orNull(joinToString(endpoint.gt_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_1($this)));
|
|
572
|
+
var tmp0_safe_receiver = _this__u8e3s4.lt_1;
|
|
557
573
|
var tmp_3;
|
|
558
574
|
if (tmp0_safe_receiver == null) {
|
|
559
575
|
tmp_3 = null;
|
|
@@ -562,112 +578,112 @@ function emitConstructor($this, _this__u8e3s4, endpoint) {
|
|
|
562
578
|
tmp_3 = emit_16($this, tmp0_safe_receiver) + ' body';
|
|
563
579
|
}
|
|
564
580
|
var tmp_4 = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]));
|
|
565
|
-
var tmp_5 = Spacer_instance.
|
|
581
|
+
var tmp_5 = Spacer_instance.ov(3);
|
|
566
582
|
var tmp_6 = get_pathParams(endpoint);
|
|
567
583
|
// Inline function 'kotlin.let' call
|
|
568
584
|
var tmp$ret$3 = 'new Path(' + joinToString(tmp_6, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_2($this)) + ')';
|
|
569
585
|
var tmp1_elvis_lhs = orNull(tmp$ret$3);
|
|
570
586
|
var tmp_7 = tmp1_elvis_lhs == null ? 'new Path()' : tmp1_elvis_lhs;
|
|
571
|
-
var tmp_8 = 'Wirespec.Method.' + endpoint.
|
|
587
|
+
var tmp_8 = 'Wirespec.Method.' + endpoint.dt_1.b3_1;
|
|
572
588
|
// Inline function 'kotlin.let' call
|
|
573
|
-
var tmp$ret$5 = 'new Queries(' + joinToString(endpoint.
|
|
589
|
+
var tmp$ret$5 = 'new Queries(' + joinToString(endpoint.ft_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_3($this)) + ')';
|
|
574
590
|
var tmp2_elvis_lhs = orNull(tmp$ret$5);
|
|
575
591
|
var tmp_9 = tmp2_elvis_lhs == null ? 'new Queries()' : tmp2_elvis_lhs;
|
|
576
592
|
// Inline function 'kotlin.let' call
|
|
577
|
-
var tmp$ret$7 = 'new RequestHeaders(' + joinToString(endpoint.
|
|
593
|
+
var tmp$ret$7 = 'new RequestHeaders(' + joinToString(endpoint.gt_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_4($this)) + ')';
|
|
578
594
|
var tmp3_elvis_lhs = orNull(tmp$ret$7);
|
|
579
595
|
var tmp_10 = tmp3_elvis_lhs == null ? 'new RequestHeaders()' : tmp3_elvis_lhs;
|
|
580
596
|
var tmp_11;
|
|
581
|
-
if (_this__u8e3s4.
|
|
597
|
+
if (_this__u8e3s4.lt_1 == null) {
|
|
582
598
|
tmp_11 = null;
|
|
583
599
|
} else {
|
|
584
600
|
// Inline function 'kotlin.let' call
|
|
585
601
|
tmp_11 = 'body';
|
|
586
602
|
}
|
|
587
603
|
var tmp5_elvis_lhs = tmp_11;
|
|
588
|
-
return 'public Request(' + tmp_4 + ') {\n' + tmp_5 + 'this(' + joinToString(listOfNotNull([tmp_7, tmp_8, tmp_9, tmp_10, tmp5_elvis_lhs == null ? 'null' : tmp5_elvis_lhs])) + ');\n' + Spacer_instance.
|
|
604
|
+
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.ov(2) + '}';
|
|
589
605
|
}
|
|
590
606
|
function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
591
607
|
var tmp = get_indexedPathParams(endpoint);
|
|
592
608
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
|
|
593
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
594
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
595
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
609
|
+
var tmp_1 = orNull(joinToString(endpoint.ft_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
610
|
+
var tmp_2 = orNull(joinToString(endpoint.gt_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
611
|
+
var tmp0_safe_receiver = _this__u8e3s4.lt_1;
|
|
596
612
|
var tmp_3;
|
|
597
613
|
if (tmp0_safe_receiver == null) {
|
|
598
614
|
tmp_3 = null;
|
|
599
615
|
} else {
|
|
600
616
|
// Inline function 'kotlin.let' call
|
|
601
|
-
tmp_3 = Spacer_instance.
|
|
617
|
+
tmp_3 = Spacer_instance.ov(4) + 'request.body().<' + emit_16($this, tmp0_safe_receiver) + '>map(body -> serialization.deserializeBody(body, ' + emitGetType($this, tmp0_safe_receiver.nt_1) + ')).orElse(null)';
|
|
602
618
|
}
|
|
603
619
|
// Inline function 'kotlin.let' call
|
|
604
620
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
605
|
-
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.
|
|
621
|
+
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.ov(3);
|
|
606
622
|
}
|
|
607
623
|
function emitDeserializedParams_0($this, _this__u8e3s4) {
|
|
608
|
-
var tmp = orNull(joinToString(_this__u8e3s4.
|
|
609
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
624
|
+
var tmp = orNull(joinToString(_this__u8e3s4.pt_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2($this)));
|
|
625
|
+
var tmp0_safe_receiver = _this__u8e3s4.qt_1;
|
|
610
626
|
var tmp_0;
|
|
611
627
|
if (tmp0_safe_receiver == null) {
|
|
612
628
|
tmp_0 = null;
|
|
613
629
|
} else {
|
|
614
630
|
// Inline function 'kotlin.let' call
|
|
615
|
-
tmp_0 = Spacer_instance.
|
|
631
|
+
tmp_0 = Spacer_instance.ov(5) + 'response.body().<' + emit_16($this, tmp0_safe_receiver) + '>map(body -> serialization.deserializeBody(body, ' + emitGetType($this, tmp0_safe_receiver.nt_1) + ')).orElse(null)';
|
|
616
632
|
}
|
|
617
633
|
// Inline function 'kotlin.let' call
|
|
618
634
|
var it = joinToString(listOfNotNull([tmp, tmp_0]), ',\n');
|
|
619
|
-
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.
|
|
635
|
+
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.ov(4);
|
|
620
636
|
}
|
|
621
637
|
function emitSerialized($this, _this__u8e3s4) {
|
|
622
638
|
var tmp;
|
|
623
|
-
if (!(_this__u8e3s4.
|
|
624
|
-
tmp = 'java.util.Optional.ofNullable(serialization.serializeBody(r.body, ' + emitGetType($this, ensureNotNull(_this__u8e3s4.
|
|
639
|
+
if (!(_this__u8e3s4.qt_1 == null)) {
|
|
640
|
+
tmp = 'java.util.Optional.ofNullable(serialization.serializeBody(r.body, ' + emitGetType($this, ensureNotNull(_this__u8e3s4.qt_1).nt_1) + '))';
|
|
625
641
|
} else {
|
|
626
642
|
tmp = 'java.util.Optional.empty()';
|
|
627
643
|
}
|
|
628
644
|
var body = tmp;
|
|
629
645
|
var tmp_0;
|
|
630
646
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
631
|
-
if (!_this__u8e3s4.
|
|
632
|
-
tmp_0 = 'java.util.Map.ofEntries(' + joinToString(_this__u8e3s4.
|
|
647
|
+
if (!_this__u8e3s4.pt_1.r()) {
|
|
648
|
+
tmp_0 = 'java.util.Map.ofEntries(' + joinToString(_this__u8e3s4.pt_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitSerialized$lambda($this)) + ')';
|
|
633
649
|
} else {
|
|
634
650
|
tmp_0 = 'java.util.Collections.emptyMap()';
|
|
635
651
|
}
|
|
636
652
|
var headers = tmp_0;
|
|
637
|
-
return Spacer_instance.
|
|
653
|
+
return Spacer_instance.ov(3) + 'if (response instanceof Response' + Companion_instance_1.mu(_this__u8e3s4.ot_1) + ' r) { return new Wirespec.RawResponse(r.status(), ' + headers + ', ' + body + '); }';
|
|
638
654
|
}
|
|
639
655
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
640
|
-
return Spacer_instance.
|
|
656
|
+
return Spacer_instance.ov(4) + 'case ' + _this__u8e3s4.ot_1 + ' -> new Response' + Companion_instance_1.mu(_this__u8e3s4.ot_1) + '(' + emitDeserializedParams_0($this, _this__u8e3s4) + ');';
|
|
641
657
|
}
|
|
642
658
|
function emitSerializedParams($this, _this__u8e3s4, fields) {
|
|
643
|
-
return 'java.util.Map.entry("' + _this__u8e3s4.
|
|
659
|
+
return 'java.util.Map.entry("' + _this__u8e3s4.ys_1.m1() + '", serialization.serializeParam(request.' + (fields === 'queries' ? 'queries' : 'headers') + '().' + $this.uu(_this__u8e3s4.ys_1) + '(), ' + emitGetType($this, _this__u8e3s4.zs_1) + '))';
|
|
644
660
|
}
|
|
645
661
|
function emitDeserialized_0($this, _this__u8e3s4) {
|
|
646
|
-
return Spacer_instance.
|
|
662
|
+
return Spacer_instance.ov(4) + 'serialization.deserializePath(request.path().get(' + _this__u8e3s4.if_1 + '), ' + emitGetType($this, _this__u8e3s4.jf_1.kt_1) + ')';
|
|
647
663
|
}
|
|
648
664
|
function emitDeserializedParams_1($this, _this__u8e3s4, fields, caseSensitive) {
|
|
649
665
|
var tmp;
|
|
650
666
|
if (caseSensitive) {
|
|
651
|
-
tmp = 'request.' + fields + '().getOrDefault("' + _this__u8e3s4.
|
|
667
|
+
tmp = 'request.' + fields + '().getOrDefault("' + _this__u8e3s4.ys_1.m1() + '", java.util.Collections.emptyList())';
|
|
652
668
|
} else {
|
|
653
|
-
tmp = 'request.' + fields + '().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + _this__u8e3s4.
|
|
669
|
+
tmp = 'request.' + fields + '().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + _this__u8e3s4.ys_1.m1() + '")).findFirst().map(java.util.Map.Entry::getValue).orElse(java.util.Collections.emptyList())';
|
|
654
670
|
}
|
|
655
671
|
var valuesFromField = tmp;
|
|
656
|
-
return Spacer_instance.
|
|
672
|
+
return Spacer_instance.ov(4) + 'serialization.<' + $this.vt(_this__u8e3s4.zs_1) + '>deserializeParam(' + valuesFromField + ', ' + emitGetType($this, _this__u8e3s4.zs_1) + ')';
|
|
657
673
|
}
|
|
658
674
|
function emitSerializedHeader($this, _this__u8e3s4) {
|
|
659
|
-
return 'java.util.Map.entry("' + _this__u8e3s4.
|
|
675
|
+
return 'java.util.Map.entry("' + _this__u8e3s4.ys_1.m1() + '", serialization.<' + $this.vt(_this__u8e3s4.zs_1) + '>serializeParam(r.headers().' + $this.uu(_this__u8e3s4.ys_1) + '(), ' + emitGetType($this, _this__u8e3s4.zs_1) + '))';
|
|
660
676
|
}
|
|
661
677
|
function emitIdentifier($this, _this__u8e3s4) {
|
|
662
|
-
return 'serialization.serializePath(request.path().' + Companion_instance_1.
|
|
678
|
+
return 'serialization.serializePath(request.path().' + Companion_instance_1.nu($this.uu(_this__u8e3s4.jt_1)) + '(), ' + emitGetType($this, _this__u8e3s4.kt_1) + ')';
|
|
663
679
|
}
|
|
664
680
|
function emit_16($this, _this__u8e3s4) {
|
|
665
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
666
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
681
|
+
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.nt_1;
|
|
682
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.vt(tmp1_safe_receiver);
|
|
667
683
|
return tmp2_elvis_lhs == null ? 'Void' : tmp2_elvis_lhs;
|
|
668
684
|
}
|
|
669
685
|
function emit_17($this, _this__u8e3s4) {
|
|
670
|
-
return $this.
|
|
686
|
+
return $this.vt(_this__u8e3s4.kt_1) + ' ' + $this.uu(_this__u8e3s4.jt_1);
|
|
671
687
|
}
|
|
672
688
|
function emitImports_0($this, _this__u8e3s4) {
|
|
673
689
|
// Inline function 'kotlin.collections.filter' call
|
|
@@ -677,7 +693,7 @@ function emitImports_0($this, _this__u8e3s4) {
|
|
|
677
693
|
var _iterator__ex2g4s = tmp0.t();
|
|
678
694
|
while (_iterator__ex2g4s.u()) {
|
|
679
695
|
var element = _iterator__ex2g4s.v();
|
|
680
|
-
if (!(_this__u8e3s4.
|
|
696
|
+
if (!(_this__u8e3s4.tu().m1() === element.iy_1)) {
|
|
681
697
|
destination.x(element);
|
|
682
698
|
}
|
|
683
699
|
}
|
|
@@ -687,46 +703,46 @@ function emitImports_0($this, _this__u8e3s4) {
|
|
|
687
703
|
var _iterator__ex2g4s_0 = destination.t();
|
|
688
704
|
while (_iterator__ex2g4s_0.u()) {
|
|
689
705
|
var item = _iterator__ex2g4s_0.v();
|
|
690
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
706
|
+
var tmp$ret$3 = 'import ' + $this.v1z().kv_1 + '.model.' + item.iy_1 + ';';
|
|
691
707
|
destination_0.x(tmp$ret$3);
|
|
692
708
|
}
|
|
693
709
|
var tmp = destination_0;
|
|
694
710
|
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitImports$lambda);
|
|
695
711
|
}
|
|
696
712
|
function emitRequestFunctions($this, _this__u8e3s4, endpoint) {
|
|
697
|
-
var tmp = Spacer_instance.
|
|
698
|
-
var tmp_0 = Spacer_instance.
|
|
699
|
-
var tmp_1 = Spacer_instance.
|
|
700
|
-
var tmp_2 = Spacer_instance.
|
|
701
|
-
var tmp_3 = joinToString(endpoint.
|
|
702
|
-
var tmp_4 = Spacer_instance.
|
|
713
|
+
var tmp = Spacer_instance.ov(2);
|
|
714
|
+
var tmp_0 = Spacer_instance.ov(3);
|
|
715
|
+
var tmp_1 = Spacer_instance.ov(4);
|
|
716
|
+
var tmp_2 = Spacer_instance.ov(4);
|
|
717
|
+
var tmp_3 = joinToString(endpoint.et_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda($this));
|
|
718
|
+
var tmp_4 = Spacer_instance.ov(4);
|
|
703
719
|
var tmp_5;
|
|
704
720
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
705
|
-
if (!endpoint.
|
|
706
|
-
tmp_5 = 'java.util.Map.ofEntries(' + joinToString(endpoint.
|
|
721
|
+
if (!endpoint.ft_1.r()) {
|
|
722
|
+
tmp_5 = 'java.util.Map.ofEntries(' + joinToString(endpoint.ft_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_0($this)) + ')';
|
|
707
723
|
} else {
|
|
708
724
|
tmp_5 = 'java.util.Collections.emptyMap()';
|
|
709
725
|
}
|
|
710
726
|
var tmp_6 = tmp_5;
|
|
711
|
-
var tmp_7 = Spacer_instance.
|
|
727
|
+
var tmp_7 = Spacer_instance.ov(4);
|
|
712
728
|
var tmp_8;
|
|
713
729
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
714
|
-
if (!endpoint.
|
|
715
|
-
tmp_8 = 'java.util.Map.ofEntries(' + joinToString(endpoint.
|
|
730
|
+
if (!endpoint.gt_1.r()) {
|
|
731
|
+
tmp_8 = 'java.util.Map.ofEntries(' + joinToString(endpoint.gt_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1($this)) + ')';
|
|
716
732
|
} else {
|
|
717
733
|
tmp_8 = 'java.util.Collections.emptyMap()';
|
|
718
734
|
}
|
|
719
735
|
var tmp_9 = tmp_8;
|
|
720
|
-
var tmp_10 = Spacer_instance.
|
|
736
|
+
var tmp_10 = Spacer_instance.ov(4);
|
|
721
737
|
var tmp_11;
|
|
722
|
-
if (!(_this__u8e3s4.
|
|
723
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
724
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
738
|
+
if (!(_this__u8e3s4.lt_1 == null)) {
|
|
739
|
+
var tmp0_safe_receiver = _this__u8e3s4.lt_1;
|
|
740
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.nt_1;
|
|
725
741
|
tmp_11 = 'java.util.Optional.ofNullable(serialization.serializeBody(request.body(), ' + (tmp1_safe_receiver == null ? null : emitGetType($this, tmp1_safe_receiver)) + '))';
|
|
726
742
|
} else {
|
|
727
743
|
tmp_11 = 'java.util.Optional.empty()';
|
|
728
744
|
}
|
|
729
|
-
return trimMargin('\n |' + tmp + 'static Wirespec.RawRequest toRequest(Wirespec.Serializer serialization, Request request) {\n |' + tmp_0 + 'return new Wirespec.RawRequest(\n |' + tmp_1 + 'request.method().name(),\n |' + tmp_2 + 'java.util.List.of(' + tmp_3 + '),\n |' + tmp_4 + tmp_6 + ',\n |' + tmp_7 + tmp_9 + ',\n |' + tmp_10 + tmp_11 + '\n |' + Spacer_instance.
|
|
745
|
+
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.ov(3) + ');\n |' + Spacer_instance.ov(2) + '}\n |\n |' + Spacer_instance.ov(2) + 'static Request fromRequest(Wirespec.Deserializer serialization, Wirespec.RawRequest request) {\n |' + Spacer_instance.ov(3) + 'return new Request(' + emitDeserializedParams($this, _this__u8e3s4, endpoint) + ');\n |' + Spacer_instance.ov(2) + '}\n ');
|
|
730
746
|
}
|
|
731
747
|
function emitObject($this, _this__u8e3s4, name, extends_0, block) {
|
|
732
748
|
var tmp;
|
|
@@ -740,13 +756,13 @@ function emitObject($this, _this__u8e3s4, name, extends_0, block) {
|
|
|
740
756
|
}
|
|
741
757
|
function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
742
758
|
// Inline function 'kotlin.collections.map' call
|
|
743
|
-
var this_0 = distinctByStatus(_this__u8e3s4.
|
|
759
|
+
var this_0 = distinctByStatus(_this__u8e3s4.it_1);
|
|
744
760
|
// Inline function 'kotlin.collections.mapTo' call
|
|
745
761
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
746
762
|
var _iterator__ex2g4s = this_0.t();
|
|
747
763
|
while (_iterator__ex2g4s.u()) {
|
|
748
764
|
var item = _iterator__ex2g4s.v();
|
|
749
|
-
var tmp$ret$0 = emit_16($this, item.
|
|
765
|
+
var tmp$ret$0 = emit_16($this, item.qt_1);
|
|
750
766
|
destination.x(tmp$ret$0);
|
|
751
767
|
}
|
|
752
768
|
var tmp = distinct(destination);
|
|
@@ -754,13 +770,13 @@ function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
|
754
770
|
}
|
|
755
771
|
function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
756
772
|
// Inline function 'kotlin.collections.map' call
|
|
757
|
-
var this_0 = _this__u8e3s4.
|
|
773
|
+
var this_0 = _this__u8e3s4.it_1;
|
|
758
774
|
// Inline function 'kotlin.collections.mapTo' call
|
|
759
775
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
760
776
|
var _iterator__ex2g4s = this_0.t();
|
|
761
777
|
while (_iterator__ex2g4s.u()) {
|
|
762
778
|
var item = _iterator__ex2g4s.v();
|
|
763
|
-
var tmp$ret$0 = new Char(first(item.
|
|
779
|
+
var tmp$ret$0 = new Char(first(item.ot_1));
|
|
764
780
|
destination.x(tmp$ret$0);
|
|
765
781
|
}
|
|
766
782
|
var tmp = distinct(destination);
|
|
@@ -768,26 +784,26 @@ function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
|
768
784
|
}
|
|
769
785
|
function emitFromResponse($this, _this__u8e3s4) {
|
|
770
786
|
// Inline function 'kotlin.collections.filter' call
|
|
771
|
-
var tmp0 = distinctByStatus(_this__u8e3s4.
|
|
787
|
+
var tmp0 = distinctByStatus(_this__u8e3s4.it_1);
|
|
772
788
|
// Inline function 'kotlin.collections.filterTo' call
|
|
773
789
|
var destination = ArrayList_init_$Create$();
|
|
774
790
|
var _iterator__ex2g4s = tmp0.t();
|
|
775
791
|
while (_iterator__ex2g4s.u()) {
|
|
776
792
|
var element = _iterator__ex2g4s.v();
|
|
777
|
-
if (Companion_instance_1.
|
|
793
|
+
if (Companion_instance_1.pu(element.ot_1)) {
|
|
778
794
|
destination.x(element);
|
|
779
795
|
}
|
|
780
796
|
}
|
|
781
797
|
var statusResponses = destination;
|
|
782
798
|
var tmp;
|
|
783
799
|
if (statusResponses.r()) {
|
|
784
|
-
tmp = trimMargin('\n |' + Spacer_instance.
|
|
800
|
+
tmp = trimMargin('\n |' + Spacer_instance.ov(3) + 'throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n ');
|
|
785
801
|
} else if (statusResponses.a1() === 1) {
|
|
786
802
|
var response = first_0(statusResponses);
|
|
787
|
-
tmp = trimMargin('\n |' + Spacer_instance.
|
|
803
|
+
tmp = trimMargin('\n |' + Spacer_instance.ov(3) + 'if (response.statusCode() == ' + response.ot_1 + ') {\n |' + Spacer_instance.ov(4) + 'return new Response' + Companion_instance_1.mu(response.ot_1) + '(' + emitDeserializedParams_0($this, response) + ');\n |' + Spacer_instance.ov(3) + '} else {\n |' + Spacer_instance.ov(4) + 'throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n |' + Spacer_instance.ov(3) + '}\n ');
|
|
788
804
|
} else {
|
|
789
|
-
var tmp_0 = Spacer_instance.
|
|
790
|
-
tmp = trimMargin('\n |' + tmp_0 + 'return switch (response.statusCode()) {\n |' + joinToString(statusResponses, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitFromResponse$lambda($this)) + '\n |' + Spacer_instance.
|
|
805
|
+
var tmp_0 = Spacer_instance.ov(3);
|
|
806
|
+
tmp = trimMargin('\n |' + tmp_0 + 'return switch (response.statusCode()) {\n |' + joinToString(statusResponses, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitFromResponse$lambda($this)) + '\n |' + Spacer_instance.ov(4) + 'default -> throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n |' + Spacer_instance.ov(3) + '};\n ');
|
|
791
807
|
}
|
|
792
808
|
return tmp;
|
|
793
809
|
}
|
|
@@ -798,17 +814,17 @@ function JavaEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
|
798
814
|
}
|
|
799
815
|
function JavaEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
800
816
|
return function (it) {
|
|
801
|
-
return this$0.
|
|
817
|
+
return this$0.ut(it);
|
|
802
818
|
};
|
|
803
819
|
}
|
|
804
820
|
function JavaEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
805
821
|
return function (it) {
|
|
806
|
-
return this$0.
|
|
822
|
+
return this$0.ut(it);
|
|
807
823
|
};
|
|
808
824
|
}
|
|
809
825
|
function JavaEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
810
826
|
return function (it) {
|
|
811
|
-
return this$0.
|
|
827
|
+
return this$0.j20(it);
|
|
812
828
|
};
|
|
813
829
|
}
|
|
814
830
|
function JavaEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
@@ -826,27 +842,27 @@ function JavaEndpointDefinitionEmitter$emitConstructor$lambda(this$0) {
|
|
|
826
842
|
}
|
|
827
843
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_0(this$0) {
|
|
828
844
|
return function (it) {
|
|
829
|
-
return this$0.
|
|
845
|
+
return this$0.ut(it);
|
|
830
846
|
};
|
|
831
847
|
}
|
|
832
848
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_1(this$0) {
|
|
833
849
|
return function (it) {
|
|
834
|
-
return this$0.
|
|
850
|
+
return this$0.ut(it);
|
|
835
851
|
};
|
|
836
852
|
}
|
|
837
853
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_2(this$0) {
|
|
838
854
|
return function (it) {
|
|
839
|
-
return this$0.
|
|
855
|
+
return this$0.uu(it.jt_1);
|
|
840
856
|
};
|
|
841
857
|
}
|
|
842
858
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_3(this$0) {
|
|
843
859
|
return function (it) {
|
|
844
|
-
return this$0.
|
|
860
|
+
return this$0.uu(it.ys_1);
|
|
845
861
|
};
|
|
846
862
|
}
|
|
847
863
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_4(this$0) {
|
|
848
864
|
return function (it) {
|
|
849
|
-
return this$0.
|
|
865
|
+
return this$0.uu(it.ys_1);
|
|
850
866
|
};
|
|
851
867
|
}
|
|
852
868
|
function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda(this$0) {
|
|
@@ -866,22 +882,22 @@ function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1(this$0) {
|
|
|
866
882
|
}
|
|
867
883
|
function JavaEndpointDefinitionEmitter$emit$lambda_5(this$0) {
|
|
868
884
|
return function (it) {
|
|
869
|
-
return this$0.
|
|
885
|
+
return this$0.ut(it);
|
|
870
886
|
};
|
|
871
887
|
}
|
|
872
888
|
function JavaEndpointDefinitionEmitter$emit$lambda_6(this$0) {
|
|
873
889
|
return function (it) {
|
|
874
|
-
return this$0.
|
|
890
|
+
return this$0.uu(it.ys_1);
|
|
875
891
|
};
|
|
876
892
|
}
|
|
877
893
|
function JavaEndpointDefinitionEmitter$emit$lambda_7(this$0) {
|
|
878
894
|
return function (it) {
|
|
879
|
-
return this$0.
|
|
895
|
+
return this$0.ut(it);
|
|
880
896
|
};
|
|
881
897
|
}
|
|
882
898
|
function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2(this$0) {
|
|
883
899
|
return function (it) {
|
|
884
|
-
return Spacer_instance.
|
|
900
|
+
return Spacer_instance.ov(5) + 'serialization.<' + this$0.vt(it.zs_1) + '>deserializeParam(response.headers().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + it.ys_1.m1() + '")).findFirst().map(java.util.Map.Entry::getValue).orElse(java.util.Collections.emptyList()), ' + emitGetType(this$0, it.zs_1) + ')';
|
|
885
901
|
};
|
|
886
902
|
}
|
|
887
903
|
function JavaEndpointDefinitionEmitter$emitSerialized$lambda(this$0) {
|
|
@@ -897,7 +913,7 @@ function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda(this$0) {
|
|
|
897
913
|
return function (it) {
|
|
898
914
|
var tmp;
|
|
899
915
|
if (it instanceof Literal) {
|
|
900
|
-
tmp = '"' + it.
|
|
916
|
+
tmp = '"' + it.fu_1 + '"';
|
|
901
917
|
} else {
|
|
902
918
|
if (it instanceof Param) {
|
|
903
919
|
tmp = emitIdentifier(this$0, it);
|
|
@@ -920,7 +936,7 @@ function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1(this$0) {
|
|
|
920
936
|
}
|
|
921
937
|
function JavaEndpointDefinitionEmitter$emitObject$lambda($block) {
|
|
922
938
|
return function (it) {
|
|
923
|
-
return Spacer_instance.
|
|
939
|
+
return Spacer_instance.ov(2) + $block(it);
|
|
924
940
|
};
|
|
925
941
|
}
|
|
926
942
|
function JavaEndpointDefinitionEmitter$emitResponseInterfaces$lambda(it) {
|
|
@@ -940,7 +956,7 @@ function sanitizeNegative($this, _this__u8e3s4) {
|
|
|
940
956
|
return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
|
|
941
957
|
}
|
|
942
958
|
function sanitizeEnum($this, _this__u8e3s4) {
|
|
943
|
-
return $this.
|
|
959
|
+
return $this.l20($this.k20(joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_')));
|
|
944
960
|
}
|
|
945
961
|
function JavaEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
946
962
|
return function (it) {
|
|
@@ -951,7 +967,7 @@ function JavaEnumDefinitionEmitter() {
|
|
|
951
967
|
}
|
|
952
968
|
function Companion() {
|
|
953
969
|
Companion_instance_2 = this;
|
|
954
|
-
this.
|
|
970
|
+
this.n20_1 = setOf(['abstract', 'continue', 'for', 'new', 'switch', 'assert', 'default', 'goto', 'package', 'synchronized', 'boolean', 'do', 'if', 'private', 'this', 'break', 'double', 'implements', 'protected', 'throw', 'byte', 'else', 'import', 'public', 'throws', 'case', 'enum', 'instanceof', 'return', 'transient', 'catch', 'extends', 'int', 'short', 'try', 'char', 'final', 'interface', 'static', 'void', 'class', 'finally', 'long', 'strictfp', 'volatile', 'const', 'float', 'native', 'super', 'while', 'true', 'false']);
|
|
955
971
|
}
|
|
956
972
|
var Companion_instance_2;
|
|
957
973
|
function Companion_getInstance_0() {
|
|
@@ -960,7 +976,7 @@ function Companion_getInstance_0() {
|
|
|
960
976
|
return Companion_instance_2;
|
|
961
977
|
}
|
|
962
978
|
function JavaIdentifierEmitter$sanitizeSymbol$lambda(it) {
|
|
963
|
-
return isLetterOrDigit(it.h1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).
|
|
979
|
+
return isLetterOrDigit(it.h1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).v1(it);
|
|
964
980
|
}
|
|
965
981
|
function JavaIdentifierEmitter() {
|
|
966
982
|
}
|
|
@@ -975,7 +991,7 @@ function sanitizeSymbol_0($this, _this__u8e3s4) {
|
|
|
975
991
|
var item = _iterator__ex2g4s.v();
|
|
976
992
|
var _unary__edvuaz = index;
|
|
977
993
|
index = _unary__edvuaz + 1 | 0;
|
|
978
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
994
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.mu(item) : item;
|
|
979
995
|
destination.x(tmp$ret$0);
|
|
980
996
|
}
|
|
981
997
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1015,14 +1031,14 @@ function sanitizeFirstIsDigit_0($this, _this__u8e3s4) {
|
|
|
1015
1031
|
return tmp;
|
|
1016
1032
|
}
|
|
1017
1033
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1018
|
-
return Companion_getInstance_1().
|
|
1034
|
+
return Companion_getInstance_1().o20_1.v1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1019
1035
|
}
|
|
1020
1036
|
function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
1021
1037
|
return sanitizeKeywords_0($this, sanitizeFirstIsDigit_0($this, joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_')));
|
|
1022
1038
|
}
|
|
1023
1039
|
function Companion_0() {
|
|
1024
1040
|
Companion_instance_3 = this;
|
|
1025
|
-
this.
|
|
1041
|
+
this.o20_1 = setOf(['abstract', 'continue', 'for', 'new', 'switch', 'assert', 'default', 'goto', 'package', 'synchronized', 'boolean', 'do', 'if', 'private', 'this', 'break', 'double', 'implements', 'protected', 'throw', 'byte', 'else', 'import', 'public', 'throws', 'case', 'enum', 'instanceof', 'return', 'transient', 'catch', 'extends', 'int', 'short', 'try', 'char', 'final', 'interface', 'static', 'void', 'class', 'finally', 'long', 'strictfp', 'volatile', 'const', 'float', 'native', 'super', 'while', 'true', 'false']);
|
|
1026
1042
|
}
|
|
1027
1043
|
var Companion_instance_3;
|
|
1028
1044
|
function Companion_getInstance_1() {
|
|
@@ -1034,10 +1050,10 @@ function JavaIrEmitter$sanitizationConfig$lambda(it) {
|
|
|
1034
1050
|
return '_' + it;
|
|
1035
1051
|
}
|
|
1036
1052
|
function JavaIrEmitter$sanitizationConfig$lambda_0(name) {
|
|
1037
|
-
return name.
|
|
1053
|
+
return name.s1k_1.a1() > 1 ? new Name(listOf(name.v1p())) : name;
|
|
1038
1054
|
}
|
|
1039
1055
|
function JavaIrEmitter$sanitizationConfig$lambda_1(name) {
|
|
1040
|
-
return new Name(listOf(name.
|
|
1056
|
+
return new Name(listOf(name.v1p()));
|
|
1041
1057
|
}
|
|
1042
1058
|
function JavaIrEmitter$sanitizationConfig$lambda_2(this$0) {
|
|
1043
1059
|
return function (it) {
|
|
@@ -1048,23 +1064,23 @@ function JavaIrEmitter$sanitizationConfig$lambda_3(stmt, tr) {
|
|
|
1048
1064
|
var tmp;
|
|
1049
1065
|
var tmp_0;
|
|
1050
1066
|
if (stmt instanceof FunctionCall) {
|
|
1051
|
-
tmp_0 = stmt.
|
|
1067
|
+
tmp_0 = stmt.f1q_1.p1m() === 'validate';
|
|
1052
1068
|
} else {
|
|
1053
1069
|
tmp_0 = false;
|
|
1054
1070
|
}
|
|
1055
1071
|
if (tmp_0) {
|
|
1056
|
-
tmp = transformChildren(stmt.
|
|
1072
|
+
tmp = transformChildren(stmt.j1q(VOID, emptyList()), tr);
|
|
1057
1073
|
} else {
|
|
1058
1074
|
tmp = transformChildren(stmt, tr);
|
|
1059
1075
|
}
|
|
1060
1076
|
return tmp;
|
|
1061
1077
|
}
|
|
1062
1078
|
function JavaIrEmitter$emitShared$lambda(name) {
|
|
1063
|
-
switch (name.
|
|
1079
|
+
switch (name.p1m()) {
|
|
1064
1080
|
case 'client':
|
|
1065
|
-
return Companion_getInstance().
|
|
1081
|
+
return Companion_getInstance().u1k('getClient');
|
|
1066
1082
|
case 'server':
|
|
1067
|
-
return Companion_getInstance().
|
|
1083
|
+
return Companion_getInstance().u1k('getServer');
|
|
1068
1084
|
default:
|
|
1069
1085
|
return null;
|
|
1070
1086
|
}
|
|
@@ -1074,7 +1090,7 @@ function JavaIrEmitter$emitShared$lambda_0($imports) {
|
|
|
1074
1090
|
var tmp;
|
|
1075
1091
|
if (element instanceof File) {
|
|
1076
1092
|
// Inline function 'kotlin.collections.partition' call
|
|
1077
|
-
var this_0 = element.
|
|
1093
|
+
var this_0 = element.b1r_1;
|
|
1078
1094
|
var first = ArrayList_init_$Create$();
|
|
1079
1095
|
var second = ArrayList_init_$Create$();
|
|
1080
1096
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -1087,9 +1103,9 @@ function JavaIrEmitter$emitShared$lambda_0($imports) {
|
|
|
1087
1103
|
}
|
|
1088
1104
|
}
|
|
1089
1105
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1090
|
-
var packageElements = _destruct__k2r9zo.
|
|
1091
|
-
var rest = _destruct__k2r9zo.
|
|
1092
|
-
tmp = element.
|
|
1106
|
+
var packageElements = _destruct__k2r9zo.kf();
|
|
1107
|
+
var rest = _destruct__k2r9zo.lf();
|
|
1108
|
+
tmp = element.e1r(VOID, plus_1(plus_1(packageElements, $imports), rest));
|
|
1093
1109
|
} else {
|
|
1094
1110
|
tmp = element;
|
|
1095
1111
|
}
|
|
@@ -1101,11 +1117,11 @@ function JavaIrEmitter$emitShared$lambda_1($clientServer) {
|
|
|
1101
1117
|
return function (element, transformer) {
|
|
1102
1118
|
var tmp;
|
|
1103
1119
|
if (element instanceof Namespace) {
|
|
1104
|
-
var injected = element.
|
|
1120
|
+
var injected = element.g1r_1.equals(Companion_getInstance().u1k('Wirespec')) ? $clientServer : emptyList();
|
|
1105
1121
|
var tmp_0;
|
|
1106
1122
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1107
1123
|
if (!injected.r()) {
|
|
1108
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1124
|
+
tmp_0 = withElements(element, plus_1(element.c1r(), injected));
|
|
1109
1125
|
} else {
|
|
1110
1126
|
tmp_0 = element;
|
|
1111
1127
|
}
|
|
@@ -1117,6 +1133,22 @@ function JavaIrEmitter$emitShared$lambda_1($clientServer) {
|
|
|
1117
1133
|
return transformChildren_0(transformed, transformer);
|
|
1118
1134
|
};
|
|
1119
1135
|
}
|
|
1136
|
+
function JavaIrEmitter$emitGenerator$lambda(it) {
|
|
1137
|
+
return startsWith(it, 'Wirespec.') || it === 'Wirespec';
|
|
1138
|
+
}
|
|
1139
|
+
function JavaIrEmitter$emitGenerator$lambda_0($generatorOwnName) {
|
|
1140
|
+
return function (it) {
|
|
1141
|
+
return it === $generatorOwnName;
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
function JavaIrEmitter$emitGenerator$lambda_1(it) {
|
|
1145
|
+
return substringBefore(it, _Char___init__impl__6a9atx(60));
|
|
1146
|
+
}
|
|
1147
|
+
function JavaIrEmitter$emitGenerator$lambda_2(this$0) {
|
|
1148
|
+
return function (it) {
|
|
1149
|
+
return import_0(this$0.v1z().kv_1 + '.model', it);
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1120
1152
|
function JavaIrEmitter$emit$lambda(this$0) {
|
|
1121
1153
|
return function (it) {
|
|
1122
1154
|
return sanitizeEnum_0(this$0, it);
|
|
@@ -1126,38 +1158,38 @@ function JavaIrEmitter$emit$lambda_0(it) {
|
|
|
1126
1158
|
return listOf(function_0('label', VOID, VOID, JavaIrEmitter$emit$lambda$lambda));
|
|
1127
1159
|
}
|
|
1128
1160
|
function JavaIrEmitter$emit$lambda$lambda($this$function) {
|
|
1129
|
-
$this$function.
|
|
1130
|
-
$this$function.
|
|
1161
|
+
$this$function.h1l(String_instance);
|
|
1162
|
+
$this$function.i1l(new VariableReference(Companion_getInstance().u1k('label')));
|
|
1131
1163
|
return Unit_instance;
|
|
1132
1164
|
}
|
|
1133
1165
|
function JavaIrEmitter(packageName, emitShared) {
|
|
1134
1166
|
Companion_getInstance_1();
|
|
1135
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
1136
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
1137
|
-
this.
|
|
1138
|
-
this.
|
|
1139
|
-
this.
|
|
1140
|
-
this.
|
|
1141
|
-
this.
|
|
1167
|
+
packageName = packageName === VOID ? Companion_instance.jv('community.flock.wirespec.generated') : packageName;
|
|
1168
|
+
emitShared = emitShared === VOID ? Companion_instance_0.es() : emitShared;
|
|
1169
|
+
this.p20_1 = packageName;
|
|
1170
|
+
this.q20_1 = emitShared;
|
|
1171
|
+
this.r20_1 = JavaGenerator_getInstance();
|
|
1172
|
+
this.s20_1 = FileExtension_Java_getInstance();
|
|
1173
|
+
this.t20_1 = listOf(import_0('community.flock.wirespec.java', 'Wirespec'));
|
|
1142
1174
|
var tmp = this;
|
|
1143
|
-
var tmp_0 = Companion_getInstance_1().
|
|
1175
|
+
var tmp_0 = Companion_getInstance_1().o20_1;
|
|
1144
1176
|
var tmp_1 = JavaIrEmitter$sanitizationConfig$lambda;
|
|
1145
1177
|
var tmp_2 = JavaIrEmitter$sanitizationConfig$lambda_0;
|
|
1146
1178
|
var tmp_3 = JavaIrEmitter$sanitizationConfig$lambda_1;
|
|
1147
1179
|
var tmp_4 = JavaIrEmitter$sanitizationConfig$lambda_2(this);
|
|
1148
|
-
tmp.
|
|
1180
|
+
tmp.u20_1 = new SanitizationConfig(tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, JavaIrEmitter$sanitizationConfig$lambda_3);
|
|
1149
1181
|
}
|
|
1150
|
-
protoOf(JavaIrEmitter).
|
|
1151
|
-
return this.
|
|
1182
|
+
protoOf(JavaIrEmitter).v1z = function () {
|
|
1183
|
+
return this.p20_1;
|
|
1152
1184
|
};
|
|
1153
|
-
protoOf(JavaIrEmitter).
|
|
1154
|
-
return this.
|
|
1185
|
+
protoOf(JavaIrEmitter).y1y = function () {
|
|
1186
|
+
return this.r20_1;
|
|
1155
1187
|
};
|
|
1156
|
-
protoOf(JavaIrEmitter).
|
|
1157
|
-
return this.
|
|
1188
|
+
protoOf(JavaIrEmitter).cu = function () {
|
|
1189
|
+
return this.s20_1;
|
|
1158
1190
|
};
|
|
1159
|
-
protoOf(JavaIrEmitter).
|
|
1160
|
-
var packageName = Companion_instance.
|
|
1191
|
+
protoOf(JavaIrEmitter).b1z = function () {
|
|
1192
|
+
var packageName = Companion_instance.jv('community.flock.wirespec.java');
|
|
1161
1193
|
var imports = listOf_0([import_0('java.lang.reflect', 'Type'), import_0('java.lang.reflect', 'ParameterizedType'), import_0('java.util', 'List'), import_0('java.util', 'Map')]);
|
|
1162
1194
|
// Inline function 'kotlin.collections.map' call
|
|
1163
1195
|
var this_0 = convertClientServer(packageName);
|
|
@@ -1176,66 +1208,95 @@ protoOf(JavaIrEmitter).n1u = function () {
|
|
|
1176
1208
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1177
1209
|
var tmp = scope;
|
|
1178
1210
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1179
|
-
var this_2 = scope.
|
|
1211
|
+
var this_2 = scope.l1y_1;
|
|
1180
1212
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1181
1213
|
// Inline function 'kotlin.apply' call
|
|
1182
1214
|
var this_3 = new TransformerBuilder();
|
|
1183
|
-
this_3.
|
|
1184
|
-
var tmp$ret$5 = this_3.
|
|
1185
|
-
tmp.
|
|
1215
|
+
this_3.d1m(JavaIrEmitter$emitShared$lambda_0(imports));
|
|
1216
|
+
var tmp$ret$5 = this_3.e1m();
|
|
1217
|
+
tmp.l1y_1 = transform(this_2, tmp$ret$5);
|
|
1186
1218
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1187
1219
|
var tmp_0 = scope;
|
|
1188
1220
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1189
1221
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1190
|
-
var this_4 = scope.
|
|
1222
|
+
var this_4 = scope.l1y_1;
|
|
1191
1223
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1192
1224
|
// Inline function 'kotlin.apply' call
|
|
1193
1225
|
var this_5 = new TransformerBuilder();
|
|
1194
|
-
this_5.
|
|
1195
|
-
var tmp$ret$10 = this_5.
|
|
1196
|
-
tmp_0.
|
|
1197
|
-
var tmp_1 = scope.
|
|
1226
|
+
this_5.d1m(JavaIrEmitter$emitShared$lambda_1(clientServer));
|
|
1227
|
+
var tmp$ret$10 = this_5.e1m();
|
|
1228
|
+
tmp_0.l1y_1 = transform(this_4, tmp$ret$10);
|
|
1229
|
+
var tmp_1 = scope.l1y_1;
|
|
1198
1230
|
var wirespecShared = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1199
1231
|
var tmp_2;
|
|
1200
|
-
if (this.
|
|
1232
|
+
if (this.q20_1.fs_1) {
|
|
1201
1233
|
tmp_2 = wirespecShared;
|
|
1202
1234
|
} else {
|
|
1203
1235
|
tmp_2 = null;
|
|
1204
1236
|
}
|
|
1205
1237
|
return tmp_2;
|
|
1206
1238
|
};
|
|
1207
|
-
protoOf(JavaIrEmitter).
|
|
1239
|
+
protoOf(JavaIrEmitter).su = function (definition, module_0, logger) {
|
|
1208
1240
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1209
|
-
var tmp = file.
|
|
1241
|
+
var tmp = file.e1r(Companion_getInstance().u1k(sanitizeSymbol_0(this, file.a1r_1.b1q())));
|
|
1210
1242
|
// Inline function 'kotlin.takeIf' call
|
|
1211
|
-
var this_0 = this.
|
|
1243
|
+
var this_0 = this.t20_1;
|
|
1212
1244
|
var tmp_0;
|
|
1213
|
-
if (Companion_instance_1.
|
|
1245
|
+
if (Companion_instance_1.ou(module_0)) {
|
|
1214
1246
|
tmp_0 = this_0;
|
|
1215
1247
|
} else {
|
|
1216
1248
|
tmp_0 = null;
|
|
1217
1249
|
}
|
|
1218
1250
|
var tmp$ret$1 = tmp_0;
|
|
1219
|
-
return placeInPackage(prependImports(tmp, tmp$ret$1), this.
|
|
1251
|
+
return placeInPackage(prependImports(tmp, tmp$ret$1), this.v1z(), definition);
|
|
1252
|
+
};
|
|
1253
|
+
protoOf(JavaIrEmitter).f1z = function (definition, module_0) {
|
|
1254
|
+
var tmp;
|
|
1255
|
+
if (definition instanceof Type) {
|
|
1256
|
+
tmp = convertToGenerator_2(definition, module_0);
|
|
1257
|
+
} else {
|
|
1258
|
+
if (definition instanceof Enum) {
|
|
1259
|
+
tmp = convertToGenerator_1(definition);
|
|
1260
|
+
} else {
|
|
1261
|
+
if (definition instanceof Refined) {
|
|
1262
|
+
tmp = convertToGenerator_0(definition);
|
|
1263
|
+
} else {
|
|
1264
|
+
if (definition instanceof Union) {
|
|
1265
|
+
tmp = convertToGenerator(definition);
|
|
1266
|
+
} else {
|
|
1267
|
+
return null;
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
var generatorFile = tmp;
|
|
1273
|
+
var sanitized = sanitizeNames(generatorFile, this.u20_1);
|
|
1274
|
+
var generatorOwnName = definition.tu().m1() + 'Generator';
|
|
1275
|
+
var tmp_0 = asSequence_0(collectCustomTypeNames(sanitized));
|
|
1276
|
+
var tmp_1 = filterNot(tmp_0, JavaIrEmitter$emitGenerator$lambda);
|
|
1277
|
+
var tmp_2 = filterNot(tmp_1, JavaIrEmitter$emitGenerator$lambda_0(generatorOwnName));
|
|
1278
|
+
var tmp_3 = distinct_0(map(tmp_2, JavaIrEmitter$emitGenerator$lambda_1));
|
|
1279
|
+
var modelImports = toList(map(tmp_3, JavaIrEmitter$emitGenerator$lambda_2(this)));
|
|
1280
|
+
return placeInPackage_0(prependImports(sanitized, plus_1(this.t20_1, modelImports)), this.v1z(), 'generator');
|
|
1220
1281
|
};
|
|
1221
|
-
protoOf(JavaIrEmitter).
|
|
1222
|
-
return sanitizeNames(convertWithValidation(type, module_0), this.
|
|
1282
|
+
protoOf(JavaIrEmitter).st = function (type, module_0) {
|
|
1283
|
+
return sanitizeNames(convertWithValidation(type, module_0), this.u20_1);
|
|
1223
1284
|
};
|
|
1224
|
-
protoOf(JavaIrEmitter).
|
|
1285
|
+
protoOf(JavaIrEmitter).gv = function (enum_0, module_0) {
|
|
1225
1286
|
var tmp = convert_0(enum_0);
|
|
1226
1287
|
var tmp_0 = JavaIrEmitter$emit$lambda(this);
|
|
1227
|
-
return sanitizeNames(injectEnumLabelField(tmp, tmp_0, JavaIrEmitter$emit$lambda_0), this.
|
|
1288
|
+
return sanitizeNames(injectEnumLabelField(tmp, tmp_0, JavaIrEmitter$emit$lambda_0), this.u20_1);
|
|
1228
1289
|
};
|
|
1229
|
-
protoOf(JavaIrEmitter).
|
|
1230
|
-
return sanitizeNames(convert_1(union), this.
|
|
1290
|
+
protoOf(JavaIrEmitter).wu = function (union) {
|
|
1291
|
+
return sanitizeNames(convert_1(union), this.u20_1);
|
|
1231
1292
|
};
|
|
1232
|
-
protoOf(JavaIrEmitter).
|
|
1233
|
-
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.
|
|
1293
|
+
protoOf(JavaIrEmitter).bv = function (refined) {
|
|
1294
|
+
return sanitizeNames(applyRefinedStructShape(convert_2(refined), refined), this.u20_1);
|
|
1234
1295
|
};
|
|
1235
|
-
protoOf(JavaIrEmitter).
|
|
1236
|
-
var tmp = sanitizeNames(transformTypeDescriptors(injectHandleFunction(convert_3(endpoint), endpoint)), this.
|
|
1296
|
+
protoOf(JavaIrEmitter).hv = function (endpoint) {
|
|
1297
|
+
var tmp = sanitizeNames(transformTypeDescriptors(injectHandleFunction(convert_3(endpoint), endpoint)), this.u20_1);
|
|
1237
1298
|
// Inline function 'kotlin.takeIf' call
|
|
1238
|
-
var this_0 = buildModelImports(endpoint, this.
|
|
1299
|
+
var this_0 = buildModelImports(endpoint, this.v1z());
|
|
1239
1300
|
var tmp_0;
|
|
1240
1301
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1241
1302
|
if (!this_0.r()) {
|
|
@@ -1246,25 +1307,25 @@ protoOf(JavaIrEmitter).jr = function (endpoint) {
|
|
|
1246
1307
|
var tmp$ret$2 = tmp_0;
|
|
1247
1308
|
return prependImports(tmp, tmp$ret$2);
|
|
1248
1309
|
};
|
|
1249
|
-
protoOf(JavaIrEmitter).
|
|
1310
|
+
protoOf(JavaIrEmitter).vu = function (channel) {
|
|
1250
1311
|
var tmp;
|
|
1251
|
-
if (channel.
|
|
1252
|
-
tmp = this.
|
|
1312
|
+
if (channel.ks_1.m1() === channel.ls_1.m1()) {
|
|
1313
|
+
tmp = this.v1z().kv_1 + '.model.';
|
|
1253
1314
|
} else {
|
|
1254
1315
|
tmp = '';
|
|
1255
1316
|
}
|
|
1256
1317
|
var fullyQualifiedPrefix = tmp;
|
|
1257
|
-
return applyFunctionalInterface(sanitizeNames(convert_4(channel), this.
|
|
1318
|
+
return applyFunctionalInterface(sanitizeNames(convert_4(channel), this.u20_1), fullyQualifiedPrefix);
|
|
1258
1319
|
};
|
|
1259
|
-
protoOf(JavaIrEmitter).
|
|
1260
|
-
var imports = buildModelImports(endpoint, this.
|
|
1261
|
-
var endpointImport = import_0(this.
|
|
1262
|
-
var endpointName = endpoint.
|
|
1263
|
-
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.
|
|
1264
|
-
var subPackageName = plus_0(this.
|
|
1265
|
-
return new File(Companion_getInstance().
|
|
1320
|
+
protoOf(JavaIrEmitter).e1z = function (endpoint) {
|
|
1321
|
+
var imports = buildModelImports(endpoint, this.v1z());
|
|
1322
|
+
var endpointImport = import_0(this.v1z().kv_1 + '.endpoint', endpoint.ct_1.m1());
|
|
1323
|
+
var endpointName = endpoint.ct_1.m1();
|
|
1324
|
+
var file = wrapAsyncReturnInThenApply(transformTypeDescriptors(sanitizeNames(emitEndpointClient.call(this, endpoint), this.u20_1)), endpointName);
|
|
1325
|
+
var subPackageName = plus_0(this.v1z(), 'client');
|
|
1326
|
+
return new File(Companion_getInstance().u1k(subPackageName.mv() + sanitizeSymbol_0(this, file.a1r_1.b1q())), plus_1(plus_1(plus_1(plus_1(listOf(new Package(subPackageName.kv_1)), this.t20_1), imports), listOf(endpointImport)), file.b1r_1));
|
|
1266
1327
|
};
|
|
1267
|
-
protoOf(JavaIrEmitter).
|
|
1328
|
+
protoOf(JavaIrEmitter).c1z = function (endpoints, logger) {
|
|
1268
1329
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1269
1330
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1270
1331
|
var destination = ArrayList_init_$Create$();
|
|
@@ -1280,7 +1341,7 @@ protoOf(JavaIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1280
1341
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1281
1342
|
while (_iterator__ex2g4s_0.u()) {
|
|
1282
1343
|
var e = _iterator__ex2g4s_0.v();
|
|
1283
|
-
var key = e.
|
|
1344
|
+
var key = e.iy_1;
|
|
1284
1345
|
if (set.x(key)) {
|
|
1285
1346
|
list_0.x(e);
|
|
1286
1347
|
}
|
|
@@ -1307,7 +1368,7 @@ protoOf(JavaIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1307
1368
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1308
1369
|
while (_iterator__ex2g4s_2.u()) {
|
|
1309
1370
|
var element_1 = _iterator__ex2g4s_2.v();
|
|
1310
|
-
if (element_1.
|
|
1371
|
+
if (element_1.ct_1.m1() === element_0.iy_1) {
|
|
1311
1372
|
tmp$ret$5 = false;
|
|
1312
1373
|
break $l$block_0;
|
|
1313
1374
|
}
|
|
@@ -1324,7 +1385,7 @@ protoOf(JavaIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1324
1385
|
var _iterator__ex2g4s_3 = destination_0.t();
|
|
1325
1386
|
while (_iterator__ex2g4s_3.u()) {
|
|
1326
1387
|
var item = _iterator__ex2g4s_3.v();
|
|
1327
|
-
var tmp$ret$10 = import_0(this.
|
|
1388
|
+
var tmp$ret$10 = import_0(this.v1z().kv_1 + '.model', item.iy_1);
|
|
1328
1389
|
destination_1.x(tmp$ret$10);
|
|
1329
1390
|
}
|
|
1330
1391
|
var imports = destination_1;
|
|
@@ -1334,7 +1395,7 @@ protoOf(JavaIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1334
1395
|
var _iterator__ex2g4s_4 = endpoints.t();
|
|
1335
1396
|
while (_iterator__ex2g4s_4.u()) {
|
|
1336
1397
|
var item_0 = _iterator__ex2g4s_4.v();
|
|
1337
|
-
var tmp$ret$13 = import_0(this.
|
|
1398
|
+
var tmp$ret$13 = import_0(this.v1z().kv_1 + '.endpoint', item_0.ct_1.m1());
|
|
1338
1399
|
destination_2.x(tmp$ret$13);
|
|
1339
1400
|
}
|
|
1340
1401
|
var endpointImports = destination_2;
|
|
@@ -1344,19 +1405,19 @@ protoOf(JavaIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1344
1405
|
var _iterator__ex2g4s_5 = endpoints.t();
|
|
1345
1406
|
while (_iterator__ex2g4s_5.u()) {
|
|
1346
1407
|
var item_1 = _iterator__ex2g4s_5.v();
|
|
1347
|
-
var tmp$ret$16 = import_0(this.
|
|
1408
|
+
var tmp$ret$16 = import_0(this.v1z().kv_1 + '.client', item_1.ct_1.m1() + 'Client');
|
|
1348
1409
|
destination_3.x(tmp$ret$16);
|
|
1349
1410
|
}
|
|
1350
1411
|
var clientImports = destination_3;
|
|
1351
1412
|
var allImports = plus_1(plus_1(imports, endpointImports), clientImports);
|
|
1352
|
-
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.
|
|
1353
|
-
return new File(Companion_getInstance().
|
|
1413
|
+
var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.u20_1);
|
|
1414
|
+
return new File(Companion_getInstance().u1k(this.v1z().mv() + sanitizeSymbol_0(this, file.a1r_1.b1q())), plus_1(plus_1(plus_1(listOf(new Package(this.v1z().kv_1)), this.t20_1), allImports), file.b1r_1));
|
|
1354
1415
|
};
|
|
1355
1416
|
function transformTypeDescriptors(_this__u8e3s4) {
|
|
1356
1417
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1357
1418
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1358
|
-
scope.
|
|
1359
|
-
var tmp = scope.
|
|
1419
|
+
scope.u1y(transformTypeDescriptors$lambda);
|
|
1420
|
+
var tmp = scope.l1y_1;
|
|
1360
1421
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1361
1422
|
}
|
|
1362
1423
|
function applyRefinedStructShape(_this__u8e3s4, refined) {
|
|
@@ -1365,14 +1426,14 @@ function applyRefinedStructShape(_this__u8e3s4, refined) {
|
|
|
1365
1426
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1366
1427
|
var tmp = scope;
|
|
1367
1428
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1368
|
-
var this_0 = scope.
|
|
1429
|
+
var this_0 = scope.l1y_1;
|
|
1369
1430
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1370
1431
|
// Inline function 'kotlin.apply' call
|
|
1371
1432
|
var this_1 = new TransformerBuilder();
|
|
1372
|
-
this_1.
|
|
1373
|
-
var tmp$ret$2 = this_1.
|
|
1374
|
-
tmp.
|
|
1375
|
-
var tmp_0 = scope.
|
|
1433
|
+
this_1.d1m(applyRefinedStructShape$lambda(refined));
|
|
1434
|
+
var tmp$ret$2 = this_1.e1m();
|
|
1435
|
+
tmp.l1y_1 = transform(this_0, tmp$ret$2);
|
|
1436
|
+
var tmp_0 = scope.l1y_1;
|
|
1376
1437
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1377
1438
|
}
|
|
1378
1439
|
function injectHandleFunction(_this__u8e3s4, endpoint) {
|
|
@@ -1382,14 +1443,14 @@ function injectHandleFunction(_this__u8e3s4, endpoint) {
|
|
|
1382
1443
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1383
1444
|
var tmp = scope;
|
|
1384
1445
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1385
|
-
var this_0 = scope.
|
|
1446
|
+
var this_0 = scope.l1y_1;
|
|
1386
1447
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1387
1448
|
// Inline function 'kotlin.apply' call
|
|
1388
1449
|
var this_1 = new TransformerBuilder();
|
|
1389
|
-
this_1.
|
|
1390
|
-
var tmp$ret$2 = this_1.
|
|
1391
|
-
tmp.
|
|
1392
|
-
var tmp_0 = scope.
|
|
1450
|
+
this_1.d1m(injectHandleFunction$lambda(handlersStruct));
|
|
1451
|
+
var tmp$ret$2 = this_1.e1m();
|
|
1452
|
+
tmp.l1y_1 = transform(this_0, tmp$ret$2);
|
|
1453
|
+
var tmp_0 = scope.l1y_1;
|
|
1393
1454
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1394
1455
|
}
|
|
1395
1456
|
function buildModelImports(_this__u8e3s4, packageName) {
|
|
@@ -1400,7 +1461,7 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1400
1461
|
var _iterator__ex2g4s = tmp0.t();
|
|
1401
1462
|
while (_iterator__ex2g4s.u()) {
|
|
1402
1463
|
var element = _iterator__ex2g4s.v();
|
|
1403
|
-
if (!(_this__u8e3s4.
|
|
1464
|
+
if (!(_this__u8e3s4.tu().m1() === element.iy_1)) {
|
|
1404
1465
|
destination.x(element);
|
|
1405
1466
|
}
|
|
1406
1467
|
}
|
|
@@ -1410,7 +1471,7 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1410
1471
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1411
1472
|
while (_iterator__ex2g4s_0.u()) {
|
|
1412
1473
|
var item = _iterator__ex2g4s_0.v();
|
|
1413
|
-
var tmp$ret$3 = import_0(packageName.
|
|
1474
|
+
var tmp$ret$3 = import_0(packageName.kv_1 + '.model', item.iy_1);
|
|
1414
1475
|
destination_0.x(tmp$ret$3);
|
|
1415
1476
|
}
|
|
1416
1477
|
return destination_0;
|
|
@@ -1421,24 +1482,24 @@ function applyFunctionalInterface(_this__u8e3s4, fullyQualifiedPrefix) {
|
|
|
1421
1482
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1422
1483
|
var tmp = scope;
|
|
1423
1484
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1424
|
-
var this_0 = scope.
|
|
1485
|
+
var this_0 = scope.l1y_1;
|
|
1425
1486
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1426
1487
|
// Inline function 'kotlin.apply' call
|
|
1427
1488
|
var this_1 = new TransformerBuilder();
|
|
1428
|
-
this_1.
|
|
1429
|
-
var tmp$ret$2 = this_1.
|
|
1430
|
-
tmp.
|
|
1489
|
+
this_1.d1m(applyFunctionalInterface$lambda(fullyQualifiedPrefix));
|
|
1490
|
+
var tmp$ret$2 = this_1.e1m();
|
|
1491
|
+
tmp.l1y_1 = transform(this_0, tmp$ret$2);
|
|
1431
1492
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1432
1493
|
var tmp_0 = scope;
|
|
1433
1494
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1434
|
-
var this_2 = scope.
|
|
1495
|
+
var this_2 = scope.l1y_1;
|
|
1435
1496
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1436
1497
|
// Inline function 'kotlin.apply' call
|
|
1437
1498
|
var this_3 = new TransformerBuilder();
|
|
1438
|
-
this_3.
|
|
1439
|
-
var tmp$ret$7 = this_3.
|
|
1440
|
-
tmp_0.
|
|
1441
|
-
var tmp_1 = scope.
|
|
1499
|
+
this_3.d1m(applyFunctionalInterface$lambda_0);
|
|
1500
|
+
var tmp$ret$7 = this_3.e1m();
|
|
1501
|
+
tmp_0.l1y_1 = transform(this_2, tmp$ret$7);
|
|
1502
|
+
var tmp_1 = scope.l1y_1;
|
|
1442
1503
|
return isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1443
1504
|
}
|
|
1444
1505
|
function wrapAsyncReturnInThenApply(_this__u8e3s4, endpointName) {
|
|
@@ -1447,26 +1508,26 @@ function wrapAsyncReturnInThenApply(_this__u8e3s4, endpointName) {
|
|
|
1447
1508
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1448
1509
|
var tmp = scope;
|
|
1449
1510
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1450
|
-
var this_0 = scope.
|
|
1511
|
+
var this_0 = scope.l1y_1;
|
|
1451
1512
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1452
1513
|
// Inline function 'kotlin.apply' call
|
|
1453
1514
|
var this_1 = new TransformerBuilder();
|
|
1454
|
-
this_1.
|
|
1455
|
-
var tmp$ret$2 = this_1.
|
|
1456
|
-
tmp.
|
|
1457
|
-
var tmp_0 = scope.
|
|
1515
|
+
this_1.d1m(wrapAsyncReturnInThenApply$lambda(endpointName));
|
|
1516
|
+
var tmp$ret$2 = this_1.e1m();
|
|
1517
|
+
tmp.l1y_1 = transform(this_0, tmp$ret$2);
|
|
1518
|
+
var tmp_0 = scope.l1y_1;
|
|
1458
1519
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1459
1520
|
}
|
|
1460
1521
|
function findRoot(_this__u8e3s4) {
|
|
1461
1522
|
var tmp;
|
|
1462
1523
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
1463
|
-
tmp = findRoot(_this__u8e3s4.
|
|
1524
|
+
tmp = findRoot(_this__u8e3s4.l1m_1);
|
|
1464
1525
|
} else {
|
|
1465
1526
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
1466
|
-
tmp = findRoot(_this__u8e3s4.
|
|
1527
|
+
tmp = findRoot(_this__u8e3s4.m1m_1);
|
|
1467
1528
|
} else {
|
|
1468
1529
|
if (_this__u8e3s4 instanceof Dict_0) {
|
|
1469
|
-
tmp = findRoot(_this__u8e3s4.
|
|
1530
|
+
tmp = findRoot(_this__u8e3s4.o1q_1);
|
|
1470
1531
|
} else {
|
|
1471
1532
|
tmp = _this__u8e3s4;
|
|
1472
1533
|
}
|
|
@@ -1495,7 +1556,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1495
1556
|
var tmp;
|
|
1496
1557
|
if (_this__u8e3s4 instanceof Integer_0) {
|
|
1497
1558
|
var tmp_0;
|
|
1498
|
-
switch (_this__u8e3s4.
|
|
1559
|
+
switch (_this__u8e3s4.k1q_1.c3_1) {
|
|
1499
1560
|
case 0:
|
|
1500
1561
|
tmp_0 = 'Integer';
|
|
1501
1562
|
break;
|
|
@@ -1510,7 +1571,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1510
1571
|
} else {
|
|
1511
1572
|
if (_this__u8e3s4 instanceof Number_1) {
|
|
1512
1573
|
var tmp_1;
|
|
1513
|
-
switch (_this__u8e3s4.
|
|
1574
|
+
switch (_this__u8e3s4.l1q_1.c3_1) {
|
|
1514
1575
|
case 0:
|
|
1515
1576
|
tmp_1 = 'Float';
|
|
1516
1577
|
break;
|
|
@@ -1539,7 +1600,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1539
1600
|
tmp = 'Void';
|
|
1540
1601
|
} else {
|
|
1541
1602
|
if (_this__u8e3s4 instanceof Custom_0) {
|
|
1542
|
-
tmp = _this__u8e3s4.
|
|
1603
|
+
tmp = _this__u8e3s4.n1m_1;
|
|
1543
1604
|
} else {
|
|
1544
1605
|
tmp = 'Object';
|
|
1545
1606
|
}
|
|
@@ -1553,7 +1614,7 @@ function toJavaName(_this__u8e3s4) {
|
|
|
1553
1614
|
return tmp;
|
|
1554
1615
|
}
|
|
1555
1616
|
function buildHandlersStruct(_this__u8e3s4) {
|
|
1556
|
-
var pathTemplate = '/' + joinToString(_this__u8e3s4.
|
|
1617
|
+
var pathTemplate = '/' + joinToString(_this__u8e3s4.et_1, '/', VOID, VOID, VOID, VOID, buildHandlersStruct$lambda);
|
|
1557
1618
|
return struct('Handlers', buildHandlersStruct$lambda_0(pathTemplate, _this__u8e3s4));
|
|
1558
1619
|
}
|
|
1559
1620
|
function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
@@ -1563,8 +1624,8 @@ function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
|
1563
1624
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1564
1625
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1565
1626
|
var tmp_0 = withFullyQualifiedPrefix$lambda;
|
|
1566
|
-
scope.
|
|
1567
|
-
var tmp_1 = scope.
|
|
1627
|
+
scope.o1y(tmp_0, withFullyQualifiedPrefix$lambda_0(prefix));
|
|
1628
|
+
var tmp_1 = scope.l1y_1;
|
|
1568
1629
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1569
1630
|
} else {
|
|
1570
1631
|
tmp = _this__u8e3s4;
|
|
@@ -1574,8 +1635,8 @@ function withFullyQualifiedPrefix(_this__u8e3s4, prefix) {
|
|
|
1574
1635
|
function transformTypeDescriptors$lambda(stmt, tr) {
|
|
1575
1636
|
var tmp;
|
|
1576
1637
|
if (stmt instanceof TypeDescriptor) {
|
|
1577
|
-
var rootType = findRoot(stmt.
|
|
1578
|
-
var containerStr = rawContainerClass(stmt.
|
|
1638
|
+
var rootType = findRoot(stmt.q1s_1);
|
|
1639
|
+
var containerStr = rawContainerClass(stmt.q1s_1);
|
|
1579
1640
|
var rootStr = toJavaName(rootType) + '.class';
|
|
1580
1641
|
var tmp_0;
|
|
1581
1642
|
if (containerStr == null) {
|
|
@@ -1594,8 +1655,8 @@ function transformTypeDescriptors$lambda(stmt, tr) {
|
|
|
1594
1655
|
}
|
|
1595
1656
|
function applyRefinedStructShape$lambda$lambda($refined) {
|
|
1596
1657
|
return function ($this$function) {
|
|
1597
|
-
$this$function.
|
|
1598
|
-
$this$function.
|
|
1658
|
+
$this$function.h1l(convert_5($refined.av_1));
|
|
1659
|
+
$this$function.i1l(new VariableReference(Companion_getInstance().u1k('value')));
|
|
1599
1660
|
return Unit_instance;
|
|
1600
1661
|
};
|
|
1601
1662
|
}
|
|
@@ -1603,20 +1664,20 @@ function applyRefinedStructShape$lambda($refined) {
|
|
|
1603
1664
|
return function (element, transformer) {
|
|
1604
1665
|
var tmp;
|
|
1605
1666
|
if (element instanceof Struct) {
|
|
1606
|
-
var tmp_0 = listOf(
|
|
1667
|
+
var tmp_0 = listOf(new Custom_0('Wirespec.Refined'));
|
|
1607
1668
|
// Inline function 'kotlin.collections.map' call
|
|
1608
|
-
var this_0 = element.
|
|
1669
|
+
var this_0 = element.p1r_1;
|
|
1609
1670
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1610
1671
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1611
1672
|
var _iterator__ex2g4s = this_0.t();
|
|
1612
1673
|
while (_iterator__ex2g4s.u()) {
|
|
1613
1674
|
var item = _iterator__ex2g4s.v();
|
|
1614
1675
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
1615
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1676
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.r1o(VOID, VOID, VOID, VOID, VOID, VOID, VOID, true);
|
|
1616
1677
|
var tmp$ret$0 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
1617
1678
|
destination.x(tmp$ret$0);
|
|
1618
1679
|
}
|
|
1619
|
-
var tmp_1 = element.
|
|
1680
|
+
var tmp_1 = element.s1r(VOID, VOID, VOID, tmp_0, destination);
|
|
1620
1681
|
tmp = plus_3(tmp_1, function_0('value', VOID, true, applyRefinedStructShape$lambda$lambda($refined)));
|
|
1621
1682
|
} else {
|
|
1622
1683
|
tmp = element;
|
|
@@ -1633,7 +1694,7 @@ function injectHandleFunction$lambda$lambda($handlersStruct) {
|
|
|
1633
1694
|
var tmp_0;
|
|
1634
1695
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1635
1696
|
if (!injected.r()) {
|
|
1636
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1697
|
+
tmp_0 = withElements(element, plus_1(element.c1r(), injected));
|
|
1637
1698
|
} else {
|
|
1638
1699
|
tmp_0 = element;
|
|
1639
1700
|
}
|
|
@@ -1650,21 +1711,21 @@ function injectHandleFunction$lambda($handlersStruct) {
|
|
|
1650
1711
|
var tmp;
|
|
1651
1712
|
if (element instanceof Interface) {
|
|
1652
1713
|
var tmp_0;
|
|
1653
|
-
if (element.
|
|
1714
|
+
if (element.t1r_1.equals(Companion_getInstance().u1k('Handler'))) {
|
|
1654
1715
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1655
1716
|
var scope = new TransformScope(element);
|
|
1656
1717
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1657
1718
|
var tmp_1 = scope;
|
|
1658
1719
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1659
1720
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1660
|
-
var this_0 = scope.
|
|
1721
|
+
var this_0 = scope.l1y_1;
|
|
1661
1722
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1662
1723
|
// Inline function 'kotlin.apply' call
|
|
1663
1724
|
var this_1 = new TransformerBuilder();
|
|
1664
|
-
this_1.
|
|
1665
|
-
var tmp$ret$2 = this_1.
|
|
1666
|
-
tmp_1.
|
|
1667
|
-
var tmp_2 = scope.
|
|
1725
|
+
this_1.d1m(injectHandleFunction$lambda$lambda($handlersStruct));
|
|
1726
|
+
var tmp$ret$2 = this_1.e1m();
|
|
1727
|
+
tmp_1.l1y_1 = transform(this_0, tmp$ret$2);
|
|
1728
|
+
var tmp_2 = scope.l1y_1;
|
|
1668
1729
|
tmp_0 = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1669
1730
|
} else {
|
|
1670
1731
|
tmp_0 = element;
|
|
@@ -1694,7 +1755,7 @@ function applyFunctionalInterface$lambda_0(element, transformer) {
|
|
|
1694
1755
|
if (element instanceof File) {
|
|
1695
1756
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1696
1757
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1697
|
-
var tmp0 = element.
|
|
1758
|
+
var tmp0 = element.c1r();
|
|
1698
1759
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1699
1760
|
var destination = ArrayList_init_$Create$();
|
|
1700
1761
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1706,7 +1767,7 @@ function applyFunctionalInterface$lambda_0(element, transformer) {
|
|
|
1706
1767
|
}
|
|
1707
1768
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1708
1769
|
var interfaceElement = ensureNotNull(tmp$ret$2);
|
|
1709
|
-
tmp = element.
|
|
1770
|
+
tmp = element.e1r(VOID, listOf_0([new RawElement('@FunctionalInterface\n'), interfaceElement]));
|
|
1710
1771
|
} else {
|
|
1711
1772
|
tmp = element;
|
|
1712
1773
|
}
|
|
@@ -1719,11 +1780,11 @@ function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
|
1719
1780
|
if (element instanceof Function) {
|
|
1720
1781
|
var tmp$ret$0;
|
|
1721
1782
|
$l$block_1: {
|
|
1722
|
-
if (!element.
|
|
1783
|
+
if (!element.o1o_1 || element.n1o_1.a1() < 2) {
|
|
1723
1784
|
tmp$ret$0 = element;
|
|
1724
1785
|
break $l$block_1;
|
|
1725
1786
|
}
|
|
1726
|
-
var tmp_0 = element.
|
|
1787
|
+
var tmp_0 = element.n1o_1.f1(element.n1o_1.a1() - 2 | 0);
|
|
1727
1788
|
var tmp0_elvis_lhs = tmp_0 instanceof Assignment ? tmp_0 : null;
|
|
1728
1789
|
var tmp_1;
|
|
1729
1790
|
if (tmp0_elvis_lhs == null) {
|
|
@@ -1733,16 +1794,16 @@ function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
|
1733
1794
|
tmp_1 = tmp0_elvis_lhs;
|
|
1734
1795
|
}
|
|
1735
1796
|
var transportAssign = tmp_1;
|
|
1736
|
-
var tmp_2 = last(element.
|
|
1797
|
+
var tmp_2 = last(element.n1o_1);
|
|
1737
1798
|
if (!(tmp_2 instanceof ReturnStatement)) {
|
|
1738
1799
|
tmp$ret$0 = element;
|
|
1739
1800
|
break $l$block_1;
|
|
1740
1801
|
}
|
|
1741
|
-
var tmp_3 = dropLast(element.
|
|
1742
|
-
var tmp1_name = Companion_getInstance().
|
|
1743
|
-
var tmp2_receiver = transportAssign.
|
|
1744
|
-
var tmp3_arguments = mapOf(to(Companion_getInstance().
|
|
1745
|
-
tmp$ret$0 = element.
|
|
1802
|
+
var tmp_3 = dropLast(element.n1o_1, 2);
|
|
1803
|
+
var tmp1_name = Companion_getInstance().u1k('thenApply');
|
|
1804
|
+
var tmp2_receiver = transportAssign.t1s_1;
|
|
1805
|
+
var tmp3_arguments = mapOf(to(Companion_getInstance().u1k('mapper'), new RawExpression('rawResponse -> ' + $endpointName + '.fromRawResponse(serialization(), rawResponse)')));
|
|
1806
|
+
tmp$ret$0 = element.r1o(VOID, VOID, VOID, VOID, plus_2(tmp_3, new ReturnStatement(new FunctionCall(tmp2_receiver, VOID, tmp1_name, tmp3_arguments))));
|
|
1746
1807
|
}
|
|
1747
1808
|
tmp = tmp$ret$0;
|
|
1748
1809
|
} else {
|
|
@@ -1755,10 +1816,10 @@ function wrapAsyncReturnInThenApply$lambda($endpointName) {
|
|
|
1755
1816
|
function buildHandlersStruct$lambda(it) {
|
|
1756
1817
|
var tmp;
|
|
1757
1818
|
if (it instanceof Literal) {
|
|
1758
|
-
tmp = it.
|
|
1819
|
+
tmp = it.fu_1;
|
|
1759
1820
|
} else {
|
|
1760
1821
|
if (it instanceof Param) {
|
|
1761
|
-
tmp = '{' + it.
|
|
1822
|
+
tmp = '{' + it.jt_1.m1() + '}';
|
|
1762
1823
|
} else {
|
|
1763
1824
|
noWhenBranchMatchedException();
|
|
1764
1825
|
}
|
|
@@ -1767,50 +1828,50 @@ function buildHandlersStruct$lambda(it) {
|
|
|
1767
1828
|
}
|
|
1768
1829
|
function buildHandlersStruct$lambda$lambda($pathTemplate) {
|
|
1769
1830
|
return function ($this$function) {
|
|
1770
|
-
$this$function.
|
|
1771
|
-
$this$function.
|
|
1831
|
+
$this$function.h1l(String_instance);
|
|
1832
|
+
$this$function.i1l($this$function.q1x($pathTemplate));
|
|
1772
1833
|
return Unit_instance;
|
|
1773
1834
|
};
|
|
1774
1835
|
}
|
|
1775
1836
|
function buildHandlersStruct$lambda$lambda_0($this_buildHandlersStruct) {
|
|
1776
1837
|
return function ($this$function) {
|
|
1777
|
-
$this$function.
|
|
1778
|
-
$this$function.
|
|
1838
|
+
$this$function.h1l(String_instance);
|
|
1839
|
+
$this$function.i1l($this$function.q1x($this_buildHandlersStruct.dt_1.b3_1));
|
|
1779
1840
|
return Unit_instance;
|
|
1780
1841
|
};
|
|
1781
1842
|
}
|
|
1782
1843
|
function buildHandlersStruct$lambda$lambda_1($this$function) {
|
|
1783
|
-
$this$function.
|
|
1784
|
-
$this$function.
|
|
1785
|
-
$this$function.
|
|
1844
|
+
$this$function.h1l($this$function.v1k('Wirespec.ServerEdge', [$this$function.v1k('Request', []), $this$function.v1k('Response', [Wildcard_instance])]));
|
|
1845
|
+
$this$function.e1l('serialization', $this$function.v1k('Wirespec.Serialization', []));
|
|
1846
|
+
$this$function.i1l(new RawExpression('new Wirespec.ServerEdge<>() {\n@Override public Request from(Wirespec.RawRequest request) {\n return fromRawRequest(serialization, request);\n}\n@Override public Wirespec.RawResponse to(Response<?> response) {\n return toRawResponse(serialization, response);\n}\n}'));
|
|
1786
1847
|
return Unit_instance;
|
|
1787
1848
|
}
|
|
1788
1849
|
function buildHandlersStruct$lambda$lambda_2($this$function) {
|
|
1789
|
-
$this$function.
|
|
1790
|
-
$this$function.
|
|
1791
|
-
$this$function.
|
|
1850
|
+
$this$function.h1l($this$function.v1k('Wirespec.ClientEdge', [$this$function.v1k('Request', []), $this$function.v1k('Response', [Wildcard_instance])]));
|
|
1851
|
+
$this$function.e1l('serialization', $this$function.v1k('Wirespec.Serialization', []));
|
|
1852
|
+
$this$function.i1l(new RawExpression('new Wirespec.ClientEdge<>() {\n@Override public Wirespec.RawRequest to(Request request) {\n return toRawRequest(serialization, request);\n}\n@Override public Response<?> from(Wirespec.RawResponse response) {\n return fromRawResponse(serialization, response);\n}\n}'));
|
|
1792
1853
|
return Unit_instance;
|
|
1793
1854
|
}
|
|
1794
1855
|
function buildHandlersStruct$lambda_0($pathTemplate, $this_buildHandlersStruct) {
|
|
1795
1856
|
return function ($this$struct) {
|
|
1796
|
-
$this$struct.
|
|
1797
|
-
$this$struct.
|
|
1798
|
-
$this$struct.
|
|
1799
|
-
$this$struct.
|
|
1800
|
-
$this$struct.
|
|
1801
|
-
$this$struct.
|
|
1857
|
+
$this$struct.a1o($this$struct.v1k('Wirespec.Server', [$this$struct.v1k('Request', []), $this$struct.v1k('Response', [Wildcard_instance])]));
|
|
1858
|
+
$this$struct.a1o($this$struct.v1k('Wirespec.Client', [$this$struct.v1k('Request', []), $this$struct.v1k('Response', [Wildcard_instance])]));
|
|
1859
|
+
$this$struct.j1l('getPathTemplate', VOID, true, buildHandlersStruct$lambda$lambda($pathTemplate));
|
|
1860
|
+
$this$struct.j1l('getMethod', VOID, true, buildHandlersStruct$lambda$lambda_0($this_buildHandlersStruct));
|
|
1861
|
+
$this$struct.j1l('getServer', VOID, true, buildHandlersStruct$lambda$lambda_1);
|
|
1862
|
+
$this$struct.j1l('getClient', VOID, true, buildHandlersStruct$lambda$lambda_2);
|
|
1802
1863
|
return Unit_instance;
|
|
1803
1864
|
};
|
|
1804
1865
|
}
|
|
1805
1866
|
function withFullyQualifiedPrefix$lambda(it) {
|
|
1806
|
-
return it.
|
|
1867
|
+
return it.d1t_1.equals(Companion_getInstance().u1k('message'));
|
|
1807
1868
|
}
|
|
1808
1869
|
function withFullyQualifiedPrefix$lambda_0($prefix) {
|
|
1809
1870
|
return function (param) {
|
|
1810
|
-
var t = param.
|
|
1871
|
+
var t = param.e1t_1;
|
|
1811
1872
|
var tmp;
|
|
1812
1873
|
if (t instanceof Custom_0) {
|
|
1813
|
-
tmp = param.
|
|
1874
|
+
tmp = param.g1t(VOID, t.r1q($prefix + t.n1m_1));
|
|
1814
1875
|
} else {
|
|
1815
1876
|
tmp = param;
|
|
1816
1877
|
}
|
|
@@ -1821,8 +1882,8 @@ function JavaRefinedTypeDefinitionEmitter() {
|
|
|
1821
1882
|
}
|
|
1822
1883
|
function JavaShared() {
|
|
1823
1884
|
JavaShared_instance = this;
|
|
1824
|
-
this.
|
|
1825
|
-
this.
|
|
1885
|
+
this.f20_1 = 'community.flock.wirespec.java';
|
|
1886
|
+
this.g20_1 = trimMargin('\n |package ' + this.f20_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.ov(2) + 'Req from(RawRequest request);\n |' + Spacer_instance.ov(2) + 'RawResponse to(Res response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface ClientEdge<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.ov(2) + 'RawRequest to(Req request);\n |' + Spacer_instance.ov(2) + 'Res from(RawResponse response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.ov(2) + 'String getPathTemplate();\n |' + Spacer_instance.ov(2) + 'String getMethod();\n |' + Spacer_instance.ov(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.ov(2) + 'String getPathTemplate();\n |' + Spacer_instance.ov(2) + 'String getMethod();\n |' + Spacer_instance.ov(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.ov(2) + 'if(rawType != null) {\n |' + Spacer_instance.ov(3) + 'return new ParameterizedType() {\n |' + Spacer_instance.ov(4) + 'public Type getRawType() { return rawType; }\n |' + Spacer_instance.ov(4) + 'public Type[] getActualTypeArguments() { return new Class<?>[]{actualTypeArguments}; }\n |' + Spacer_instance.ov(4) + 'public Type getOwnerType() { return null; }\n |' + Spacer_instance.ov(3) + '};\n |' + Spacer_instance.ov(2) + '}\n |' + Spacer_instance.ov(2) + 'else { return actualTypeArguments; }\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
1826
1887
|
}
|
|
1827
1888
|
protoOf(JavaShared).toString = function () {
|
|
1828
1889
|
return 'JavaShared';
|
|
@@ -1846,10 +1907,10 @@ function JavaShared_getInstance() {
|
|
|
1846
1907
|
function emitType($this, _this__u8e3s4) {
|
|
1847
1908
|
var tmp;
|
|
1848
1909
|
if (_this__u8e3s4 instanceof Dict) {
|
|
1849
|
-
tmp = 'java.util.Map<String, ' + $this.
|
|
1910
|
+
tmp = 'java.util.Map<String, ' + $this.vt(_this__u8e3s4.as_1) + '>';
|
|
1850
1911
|
} else {
|
|
1851
1912
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
1852
|
-
tmp = 'java.util.List<' + $this.
|
|
1913
|
+
tmp = 'java.util.List<' + $this.vt(_this__u8e3s4.xr_1) + '>';
|
|
1853
1914
|
} else {
|
|
1854
1915
|
if (_this__u8e3s4 instanceof Unit) {
|
|
1855
1916
|
tmp = 'void';
|
|
@@ -1858,7 +1919,7 @@ function emitType($this, _this__u8e3s4) {
|
|
|
1858
1919
|
tmp = 'Object';
|
|
1859
1920
|
} else {
|
|
1860
1921
|
if (_this__u8e3s4 instanceof Custom) {
|
|
1861
|
-
tmp = _this__u8e3s4.
|
|
1922
|
+
tmp = _this__u8e3s4.iy_1;
|
|
1862
1923
|
} else {
|
|
1863
1924
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
1864
1925
|
tmp = emit_18($this, _this__u8e3s4);
|
|
@@ -1873,14 +1934,14 @@ function emitType($this, _this__u8e3s4) {
|
|
|
1873
1934
|
return tmp;
|
|
1874
1935
|
}
|
|
1875
1936
|
function emit_18($this, _this__u8e3s4) {
|
|
1876
|
-
var t = _this__u8e3s4.
|
|
1937
|
+
var t = _this__u8e3s4.my_1;
|
|
1877
1938
|
var tmp;
|
|
1878
1939
|
if (t instanceof String_0) {
|
|
1879
1940
|
tmp = 'String';
|
|
1880
1941
|
} else {
|
|
1881
1942
|
if (t instanceof Integer) {
|
|
1882
1943
|
var tmp_0;
|
|
1883
|
-
switch (t.
|
|
1944
|
+
switch (t.qx_1.c3_1) {
|
|
1884
1945
|
case 0:
|
|
1885
1946
|
tmp_0 = 'Integer';
|
|
1886
1947
|
break;
|
|
@@ -1895,7 +1956,7 @@ function emit_18($this, _this__u8e3s4) {
|
|
|
1895
1956
|
} else {
|
|
1896
1957
|
if (t instanceof Number_0) {
|
|
1897
1958
|
var tmp_1;
|
|
1898
|
-
switch (t.
|
|
1959
|
+
switch (t.tx_1.c3_1) {
|
|
1899
1960
|
case 0:
|
|
1900
1961
|
tmp_1 = 'Float';
|
|
1901
1962
|
break;
|
|
@@ -1924,44 +1985,45 @@ function emit_18($this, _this__u8e3s4) {
|
|
|
1924
1985
|
}
|
|
1925
1986
|
function JavaTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
1926
1987
|
return function (it) {
|
|
1927
|
-
return this$0.
|
|
1988
|
+
return this$0.vt(it);
|
|
1928
1989
|
};
|
|
1929
1990
|
}
|
|
1930
1991
|
function JavaTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
1931
1992
|
return function (it) {
|
|
1932
|
-
return Spacer_instance.toString() + this$0.
|
|
1993
|
+
return Spacer_instance.toString() + this$0.ut(it) + ',';
|
|
1933
1994
|
};
|
|
1934
1995
|
}
|
|
1935
1996
|
function JavaTypeDefinitionEmitter() {
|
|
1936
1997
|
}
|
|
1937
1998
|
function JavaUnionDefinitionEmitter$emit$lambda(it) {
|
|
1938
|
-
return it.
|
|
1999
|
+
return it.m1();
|
|
1939
2000
|
}
|
|
1940
2001
|
function JavaUnionDefinitionEmitter() {
|
|
1941
2002
|
}
|
|
1942
2003
|
//region block: post-declaration
|
|
1943
|
-
protoOf(JavaEmitter).
|
|
1944
|
-
protoOf(JavaEmitter).
|
|
1945
|
-
protoOf(JavaEmitter).
|
|
1946
|
-
protoOf(JavaEmitter).
|
|
1947
|
-
protoOf(JavaEmitter).
|
|
1948
|
-
protoOf(JavaEmitter).
|
|
1949
|
-
protoOf(JavaEmitter).
|
|
1950
|
-
protoOf(JavaEmitter).
|
|
1951
|
-
protoOf(JavaEmitter).
|
|
1952
|
-
protoOf(JavaEmitter).
|
|
1953
|
-
protoOf(JavaEmitter).
|
|
1954
|
-
protoOf(JavaEmitter).
|
|
1955
|
-
protoOf(JavaEmitter).
|
|
1956
|
-
protoOf(JavaEmitter).
|
|
1957
|
-
protoOf(JavaEmitter).
|
|
1958
|
-
protoOf(JavaEmitter).
|
|
1959
|
-
protoOf(JavaEmitter).
|
|
1960
|
-
protoOf(JavaEmitter).
|
|
1961
|
-
protoOf(JavaEmitter).
|
|
1962
|
-
protoOf(JavaEmitter).
|
|
1963
|
-
protoOf(JavaIrEmitter).
|
|
1964
|
-
protoOf(JavaIrEmitter).
|
|
2004
|
+
protoOf(JavaEmitter).uu = emit_9;
|
|
2005
|
+
protoOf(JavaEmitter).st = emit_3;
|
|
2006
|
+
protoOf(JavaEmitter).tt = emit_4;
|
|
2007
|
+
protoOf(JavaEmitter).ut = emit_5;
|
|
2008
|
+
protoOf(JavaEmitter).vt = emit_6;
|
|
2009
|
+
protoOf(JavaEmitter).wt = emit_7;
|
|
2010
|
+
protoOf(JavaEmitter).hv = emit_13;
|
|
2011
|
+
protoOf(JavaEmitter).i20 = emit_14;
|
|
2012
|
+
protoOf(JavaEmitter).j20 = emit_15;
|
|
2013
|
+
protoOf(JavaEmitter).vu = emit_8;
|
|
2014
|
+
protoOf(JavaEmitter).gv = emit_10;
|
|
2015
|
+
protoOf(JavaEmitter).wu = emit_11;
|
|
2016
|
+
protoOf(JavaEmitter).bv = emit_12;
|
|
2017
|
+
protoOf(JavaEmitter).h20 = sanitizeSymbol;
|
|
2018
|
+
protoOf(JavaEmitter).k20 = sanitizeFirstIsDigit;
|
|
2019
|
+
protoOf(JavaEmitter).l20 = sanitizeKeywords;
|
|
2020
|
+
protoOf(JavaEmitter).x1z = emitRoot;
|
|
2021
|
+
protoOf(JavaEmitter).w1z = emitRoot$default;
|
|
2022
|
+
protoOf(JavaEmitter).m20 = emitHandleFunction;
|
|
2023
|
+
protoOf(JavaEmitter).iv = emitValidator;
|
|
2024
|
+
protoOf(JavaIrEmitter).mr = emit_1;
|
|
2025
|
+
protoOf(JavaIrEmitter).a1z = emit_2;
|
|
2026
|
+
protoOf(JavaIrEmitter).d1z = beforeGenerate;
|
|
1965
2027
|
//endregion
|
|
1966
2028
|
//region block: exports
|
|
1967
2029
|
export {
|