@flock/wirespec 0.17.8 → 0.17.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/clikt-clikt.mjs +1159 -1159
- package/colormath-root-colormath.mjs +425 -425
- package/kotlin-kotlin-stdlib.mjs +6 -6
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +2604 -2452
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1767 -1767
- package/kotlinx-io-kotlinx-io-core.mjs +380 -380
- package/markdown.mjs +1879 -1879
- package/mordant-mordant.mjs +1630 -1630
- package/package.json +1 -1
- package/wirespec-src-compiler-core.mjs +3936 -3920
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +272 -272
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +248 -248
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +218 -218
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +228 -229
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +130 -97
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +367 -367
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +316 -316
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +2156 -2271
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-plugin-arguments.mjs +139 -139
- package/wirespec-src-plugin-cli.mjs +78 -78
- package/wirespec-src-plugin-cli.mjs.map +1 -1
- package/wirespec-src-plugin-npm.mjs +40 -40
- package/wirespec-src-tools-generator.mjs +46 -46
- package/wirespec-src-tools-generator.mjs.map +1 -1
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
importReferencesy4xv7r53sjjs as importReferences,
|
|
3
3
|
LanguageEmitterxhzgykhux3qm as LanguageEmitter,
|
|
4
4
|
Companion_instance2ag0h5twtdral as Companion_instance,
|
|
5
5
|
Companion_instance26a9xkw31611z as Companion_instance_0,
|
|
6
6
|
FileExtension_Java_getInstance2uobrrnxaf610 as FileExtension_Java_getInstance,
|
|
7
7
|
Emitted12h24rpo4uifw as Emitted,
|
|
8
|
-
|
|
8
|
+
plus3lrm73de10b42 as plus,
|
|
9
9
|
Companion_instance2piryw1e8zn12 as Companion_instance_1,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
Iterable29qbzfup67wqp as Iterable,
|
|
11
|
+
get_pathParamsf41cxx5qebxt as get_pathParams,
|
|
12
12
|
orNull2zq556ke3x99j as orNull,
|
|
13
13
|
Spacer_instancel9yep7i0q3er as Spacer_instance,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
get_indexedPathParams2pzt0qs62068 as get_indexedPathParams,
|
|
15
|
+
distinctByStatus134zrt4nyr6p2 as distinctByStatus,
|
|
16
|
+
emit2koty5c8abmj3 as emit,
|
|
17
|
+
Paramvfwnys2w6aj1 as Param,
|
|
18
|
+
Literal331hu9r04vptz as Literal,
|
|
19
19
|
concatGenerics2esceo9p1a45k as concatGenerics,
|
|
20
20
|
fixStatus2l9jrn3538wpy as fixStatus,
|
|
21
21
|
spacer28p2fwyb64afn as spacer,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
FieldIdentifier34k7iphndcnl0 as FieldIdentifier,
|
|
23
|
+
DefinitionIdentifiervfasqdb33qef as DefinitionIdentifier,
|
|
24
|
+
Bytes_instance2qx139msy62dm as Bytes_instance,
|
|
25
|
+
Boolean_instance15dmfsx1e5thd as Boolean_instance,
|
|
26
|
+
RegExpiyof7szm5zfu as RegExp_0,
|
|
27
|
+
String1czvr8pxnm6on as String_0,
|
|
28
|
+
Number1mui0heypwdhp as Number_0,
|
|
29
|
+
Integer39lqx4uc63u28 as Integer,
|
|
30
|
+
Primitive1i8my14jkp3nk as Primitive,
|
|
31
|
+
Custom1lu6o8txpimqz as Custom,
|
|
32
|
+
Anyv7qdq63z63rc as Any,
|
|
33
|
+
Unit2z95clvxm08vr as Unit,
|
|
34
|
+
Dict3g7w5wia7rncj as Dict,
|
|
35
|
+
Bytes3eoc50vgt1uem as Bytes,
|
|
36
|
+
Boolean1fpfi8m5jt3fg as Boolean_0,
|
|
37
|
+
Bound2mp7s0560derz as Bound,
|
|
38
38
|
TypeDefinitionEmitter18est4d94fpw8 as TypeDefinitionEmitter,
|
|
39
39
|
} from './wirespec-src-compiler-core.mjs';
|
|
40
40
|
import {
|
|
@@ -82,12 +82,12 @@ import {
|
|
|
82
82
|
//endregion
|
|
83
83
|
//region block: pre-declaration
|
|
84
84
|
function emit_0(type, module_0) {
|
|
85
|
-
var tmp = this.
|
|
86
|
-
var tmp_0 = this.
|
|
85
|
+
var tmp = this.y25(type.x23_1);
|
|
86
|
+
var tmp_0 = this.x24(type.y23_1);
|
|
87
87
|
// Inline function 'kotlin.run' call
|
|
88
88
|
// Inline function 'kotlin.contracts.contract' call
|
|
89
89
|
// Inline function 'community.flock.wirespec.emitters.java.JavaTypeDefinitionEmitter.emit.<anonymous>' call
|
|
90
|
-
var $this$run = type.
|
|
90
|
+
var $this$run = type.z23_1;
|
|
91
91
|
var tmp_1;
|
|
92
92
|
if ($this$run.l()) {
|
|
93
93
|
tmp_1 = '';
|
|
@@ -98,10 +98,10 @@ function emit_0(type, module_0) {
|
|
|
98
98
|
return trimMargin('\n |public record ' + tmp + ' (\n |' + tmp_0 + '\n |)' + tmp$ret$1 + ' {\n |};\n |\n ');
|
|
99
99
|
}
|
|
100
100
|
function emit_1(_this__u8e3s4) {
|
|
101
|
-
return dropLast(joinToString(_this__u8e3s4.
|
|
101
|
+
return dropLast(joinToString(_this__u8e3s4.u23_1, '\n', VOID, VOID, VOID, VOID, JavaTypeDefinitionEmitter$emit$lambda_0(this)), 1);
|
|
102
102
|
}
|
|
103
103
|
function emit_2(_this__u8e3s4) {
|
|
104
|
-
return this.
|
|
104
|
+
return this.z24(_this__u8e3s4.d24_1) + ' ' + this.y25(_this__u8e3s4.c24_1);
|
|
105
105
|
}
|
|
106
106
|
function emit_3(_this__u8e3s4) {
|
|
107
107
|
// Inline function 'kotlin.let' call
|
|
@@ -113,10 +113,10 @@ function emit_3(_this__u8e3s4) {
|
|
|
113
113
|
function emitRoot(_this__u8e3s4, void_0) {
|
|
114
114
|
var tmp;
|
|
115
115
|
if (_this__u8e3s4 instanceof Dict) {
|
|
116
|
-
tmp = this.
|
|
116
|
+
tmp = this.a2b(_this__u8e3s4.e23_1);
|
|
117
117
|
} else {
|
|
118
118
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
119
|
-
tmp = this.
|
|
119
|
+
tmp = this.a2b(_this__u8e3s4.b23_1);
|
|
120
120
|
} else {
|
|
121
121
|
if (_this__u8e3s4 instanceof Unit) {
|
|
122
122
|
tmp = void_0;
|
|
@@ -145,15 +145,15 @@ function emitRoot(_this__u8e3s4, void_0) {
|
|
|
145
145
|
}
|
|
146
146
|
function emitRoot$default(_this__u8e3s4, void_0, $super) {
|
|
147
147
|
void_0 = void_0 === VOID ? 'void' : void_0;
|
|
148
|
-
return $super === VOID ? this.
|
|
148
|
+
return $super === VOID ? this.b2b(_this__u8e3s4, void_0) : emitRoot(_this__u8e3s4, void_0);
|
|
149
149
|
}
|
|
150
150
|
function emit_4(_this__u8e3s4) {
|
|
151
151
|
var tmp;
|
|
152
152
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
153
|
-
tmp = 'java.util.regex.Pattern.compile("' + replace(this.
|
|
153
|
+
tmp = 'java.util.regex.Pattern.compile("' + replace(this.b25(_this__u8e3s4.a28_1), '\\', '\\\\') + '").matcher(record.value).find();';
|
|
154
154
|
} else {
|
|
155
155
|
if (_this__u8e3s4 instanceof Bound) {
|
|
156
|
-
tmp = '' + _this__u8e3s4.
|
|
156
|
+
tmp = '' + _this__u8e3s4.o28_1 + ' < record.value && record.value < ' + _this__u8e3s4.p28_1 + ';';
|
|
157
157
|
} else {
|
|
158
158
|
noWhenBranchMatchedException();
|
|
159
159
|
}
|
|
@@ -162,16 +162,16 @@ function emit_4(_this__u8e3s4) {
|
|
|
162
162
|
}
|
|
163
163
|
initMetadataForInterface(JavaTypeDefinitionEmitter, 'JavaTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter]);
|
|
164
164
|
function emit_5(channel) {
|
|
165
|
-
return trimMargin('\n |' + emitImports(channel, this) + '\n |\n |@FunctionalInterface\n |public interface ' + this.
|
|
165
|
+
return trimMargin('\n |' + emitImports(channel, this) + '\n |\n |@FunctionalInterface\n |public interface ' + this.y25(channel.o23_1) + ' {\n | void invoke(' + emitFullyQualified(channel, this, channel.p23_1) + this.a2b(channel.p23_1) + ' message);\n |}\n |\n ');
|
|
166
166
|
}
|
|
167
167
|
initMetadataForInterface(JavaChannelDefinitionEmitter, 'JavaChannelDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
168
168
|
function emit_6(identifier) {
|
|
169
169
|
var tmp;
|
|
170
170
|
if (identifier instanceof DefinitionIdentifier) {
|
|
171
|
-
tmp = this.
|
|
171
|
+
tmp = this.k2b(identifier.b1());
|
|
172
172
|
} else {
|
|
173
173
|
if (identifier instanceof FieldIdentifier) {
|
|
174
|
-
tmp = this.
|
|
174
|
+
tmp = this.l2a(this.k2b(identifier.b1()));
|
|
175
175
|
} else {
|
|
176
176
|
noWhenBranchMatchedException();
|
|
177
177
|
}
|
|
@@ -190,11 +190,11 @@ function sanitizeSymbol(_this__u8e3s4) {
|
|
|
190
190
|
// Inline function 'community.flock.wirespec.emitters.java.JavaIdentifierEmitter.sanitizeSymbol.<anonymous>' call
|
|
191
191
|
var tmp1 = index;
|
|
192
192
|
index = tmp1 + 1 | 0;
|
|
193
|
-
var tmp$ret$0 = checkIndexOverflow(tmp1) > 0 ? Companion_instance_1.
|
|
193
|
+
var tmp$ret$0 = checkIndexOverflow(tmp1) > 0 ? Companion_instance_1.q25(item) : item;
|
|
194
194
|
destination.e(tmp$ret$0);
|
|
195
195
|
}
|
|
196
196
|
var tmp = asSequence(joinToString(destination, ''));
|
|
197
|
-
return this.
|
|
197
|
+
return this.k2a(joinToString_0(filter(tmp, JavaIdentifierEmitter$sanitizeSymbol$lambda), ''));
|
|
198
198
|
}
|
|
199
199
|
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
200
200
|
var tmp;
|
|
@@ -214,65 +214,122 @@ function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
|
214
214
|
return tmp;
|
|
215
215
|
}
|
|
216
216
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
217
|
-
return Companion_getInstance().
|
|
217
|
+
return Companion_getInstance().l2b_1.o1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
218
218
|
}
|
|
219
219
|
initMetadataForInterface(JavaIdentifierEmitter, 'JavaIdentifierEmitter');
|
|
220
|
-
function emit_7(
|
|
220
|
+
function emit_7(enum_0, module_0) {
|
|
221
|
+
var tmp = this.y25(enum_0.i26_1);
|
|
222
|
+
return trimMargin('\n |public enum ' + tmp + ' implements Wirespec.Enum {\n |' + spacer(joinToString(enum_0.j26_1, ',\n', VOID, VOID, VOID, VOID, JavaEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'public final String label;\n |' + Spacer_instance.toString() + this.y25(enum_0.i26_1) + '(String label) {\n |' + Spacer_instance.s26(2) + 'this.label = label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() {\n |' + Spacer_instance.s26(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String getLabel() {\n |' + Spacer_instance.s26(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
223
|
+
}
|
|
224
|
+
function sanitizeEnum(_this__u8e3s4) {
|
|
225
|
+
return this.l2a(this.k2a(joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_')));
|
|
226
|
+
}
|
|
227
|
+
initMetadataForInterface(JavaEnumDefinitionEmitter, 'JavaEnumDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
228
|
+
function emit_8(union) {
|
|
229
|
+
var tmp = this.y25(union.s23_1);
|
|
230
|
+
return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.t23_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
|
|
231
|
+
}
|
|
232
|
+
initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
233
|
+
function emit_9(refined) {
|
|
234
|
+
return trimMargin('\n |public record ' + this.y25(refined.d26_1) + ' (String value) implements Wirespec.Refined {\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() { return value; }\n |' + Spacer_instance.toString() + 'public static boolean validate(' + this.y25(refined.d26_1) + ' record) {\n |' + Spacer_instance.toString() + Spacer_instance.toString() + 'return ' + this.m26(refined) + '\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String getValue() { return value; }\n |}\n |\n ');
|
|
235
|
+
}
|
|
236
|
+
function emitValidator(_this__u8e3s4) {
|
|
237
|
+
var defaultReturn = 'true;';
|
|
238
|
+
var type = _this__u8e3s4.e26_1.o29_1;
|
|
239
|
+
var tmp;
|
|
240
|
+
if (type instanceof Integer) {
|
|
241
|
+
var tmp0_safe_receiver = type.t28_1;
|
|
242
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.a25(tmp0_safe_receiver);
|
|
243
|
+
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
244
|
+
} else {
|
|
245
|
+
if (type instanceof Number_0) {
|
|
246
|
+
var tmp2_safe_receiver = type.x28_1;
|
|
247
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.a25(tmp2_safe_receiver);
|
|
248
|
+
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
249
|
+
} else {
|
|
250
|
+
if (type instanceof String_0) {
|
|
251
|
+
var tmp4_safe_receiver = type.q28_1;
|
|
252
|
+
var tmp_0;
|
|
253
|
+
var tmp_1 = tmp4_safe_receiver;
|
|
254
|
+
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
255
|
+
tmp_0 = null;
|
|
256
|
+
} else {
|
|
257
|
+
tmp_0 = this.a25(new RegExp_0(tmp4_safe_receiver));
|
|
258
|
+
}
|
|
259
|
+
var tmp5_elvis_lhs = tmp_0;
|
|
260
|
+
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
261
|
+
} else {
|
|
262
|
+
if (equals(type, Boolean_instance)) {
|
|
263
|
+
tmp = defaultReturn;
|
|
264
|
+
} else {
|
|
265
|
+
if (equals(type, Bytes_instance)) {
|
|
266
|
+
tmp = defaultReturn;
|
|
267
|
+
} else {
|
|
268
|
+
noWhenBranchMatchedException();
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return tmp;
|
|
275
|
+
}
|
|
276
|
+
initMetadataForInterface(JavaRefinedTypeDefinitionEmitter, 'JavaRefinedTypeDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
277
|
+
function emit_10(endpoint) {
|
|
221
278
|
var tmp = emitImports_0(endpoint, this);
|
|
222
|
-
var tmp_0 = this.
|
|
279
|
+
var tmp_0 = this.y25(endpoint.g24_1);
|
|
223
280
|
var tmp_1 = get_pathParams(endpoint);
|
|
224
281
|
var tmp_2 = emitObject(tmp_1, this, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
|
|
225
|
-
var tmp_3 = emitObject(endpoint.
|
|
226
|
-
var tmp_4 = emitObject(endpoint.
|
|
227
|
-
var tmp_5 = this.
|
|
282
|
+
var tmp_3 = emitObject(endpoint.j24_1, this, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
283
|
+
var tmp_4 = emitObject(endpoint.k24_1, this, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
284
|
+
var tmp_5 = this.v2a(first_0(endpoint.l24_1), endpoint);
|
|
228
285
|
var tmp_6 = Spacer_instance.toString();
|
|
229
286
|
var tmp_7 = emitStatusInterfaces(endpoint, this);
|
|
230
287
|
var tmp_8 = emitResponseInterfaces(endpoint, this);
|
|
231
|
-
var tmp_9 = distinctByStatus(endpoint.
|
|
288
|
+
var tmp_9 = distinctByStatus(endpoint.m24_1);
|
|
232
289
|
var tmp_10 = joinToString(tmp_9, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
233
290
|
var tmp_11 = Spacer_instance.toString();
|
|
234
|
-
var tmp_12 = emitRequestFunctions(first_0(endpoint.
|
|
235
|
-
var tmp_13 = Spacer_instance.
|
|
236
|
-
var tmp_14 = distinctByStatus(endpoint.
|
|
291
|
+
var tmp_12 = emitRequestFunctions(first_0(endpoint.l24_1), this, endpoint);
|
|
292
|
+
var tmp_13 = Spacer_instance.s26(2);
|
|
293
|
+
var tmp_14 = distinctByStatus(endpoint.m24_1);
|
|
237
294
|
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
238
|
-
var tmp_16 = Spacer_instance.
|
|
239
|
-
var tmp_17 = Spacer_instance.
|
|
240
|
-
var tmp_18 = Spacer_instance.
|
|
241
|
-
var tmp_19 = Spacer_instance.
|
|
295
|
+
var tmp_16 = Spacer_instance.s26(3);
|
|
296
|
+
var tmp_17 = Spacer_instance.s26(2);
|
|
297
|
+
var tmp_18 = Spacer_instance.s26(2);
|
|
298
|
+
var tmp_19 = Spacer_instance.s26(3);
|
|
242
299
|
// Inline function 'kotlin.collections.filter' call
|
|
243
300
|
// Inline function 'kotlin.collections.filterTo' call
|
|
244
|
-
var this_0 = distinctByStatus(endpoint.
|
|
301
|
+
var this_0 = distinctByStatus(endpoint.m24_1);
|
|
245
302
|
var destination = ArrayList_init_$Create$();
|
|
246
303
|
var tmp0_iterator = this_0.g();
|
|
247
304
|
while (tmp0_iterator.h()) {
|
|
248
305
|
var element = tmp0_iterator.i();
|
|
249
306
|
// Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emit.<anonymous>' call
|
|
250
|
-
if (Companion_instance_1.
|
|
307
|
+
if (Companion_instance_1.t25(element.s24_1)) {
|
|
251
308
|
destination.e(element);
|
|
252
309
|
}
|
|
253
310
|
}
|
|
254
311
|
var tmp_20 = destination;
|
|
255
312
|
var tmp_21 = joinToString(tmp_20, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_4(this));
|
|
256
|
-
var tmp_22 = Spacer_instance.
|
|
257
|
-
var tmp_23 = Spacer_instance.
|
|
258
|
-
var tmp_24 = Spacer_instance.
|
|
259
|
-
var tmp_25 = Spacer_instance.
|
|
260
|
-
var tmp_26 = this.
|
|
261
|
-
var tmp_27 = Spacer_instance.
|
|
262
|
-
var tmp_28 = Spacer_instance.
|
|
263
|
-
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.getStatus());}\n |' + tmp_17 + '}\n |\n |' + tmp_18 + 'static Response<?> fromResponse(Wirespec.Deserializer serialization, Wirespec.RawResponse response) {\n |' + tmp_19 + 'switch (response.statusCode()) {\n |' + tmp_21 + '\n |' + tmp_22 + 'default: throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n |' + tmp_23 + '}\n |' + tmp_24 + '}\n |\n |' + tmp_25 + tmp_26 + '\n |' + tmp_27 + 'class Handlers implements Wirespec.Server<Request, Response<?>>, Wirespec.Client<Request, Response<?>> {\n |' + tmp_28 + '@Override public String getPathTemplate() { return "/' + joinToString(endpoint.
|
|
313
|
+
var tmp_22 = Spacer_instance.s26(4);
|
|
314
|
+
var tmp_23 = Spacer_instance.s26(3);
|
|
315
|
+
var tmp_24 = Spacer_instance.s26(2);
|
|
316
|
+
var tmp_25 = Spacer_instance.s26(2);
|
|
317
|
+
var tmp_26 = this.x2a(endpoint);
|
|
318
|
+
var tmp_27 = Spacer_instance.s26(2);
|
|
319
|
+
var tmp_28 = Spacer_instance.s26(3);
|
|
320
|
+
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.getStatus());}\n |' + tmp_17 + '}\n |\n |' + tmp_18 + 'static Response<?> fromResponse(Wirespec.Deserializer serialization, Wirespec.RawResponse response) {\n |' + tmp_19 + 'switch (response.statusCode()) {\n |' + tmp_21 + '\n |' + tmp_22 + 'default: throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n |' + tmp_23 + '}\n |' + tmp_24 + '}\n |\n |' + tmp_25 + tmp_26 + '\n |' + tmp_27 + 'class Handlers implements Wirespec.Server<Request, Response<?>>, Wirespec.Client<Request, Response<?>> {\n |' + tmp_28 + '@Override public String getPathTemplate() { return "/' + joinToString(endpoint.i24_1, '/', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_5) + '"; }\n |' + Spacer_instance.s26(3) + '@Override public String getMethod() { return "' + endpoint.h24_1.toString() + '"; }\n |' + Spacer_instance.s26(3) + '@Override public Wirespec.ServerEdge<Request, Response<?>> getServer(Wirespec.Serialization serialization) {\n |' + Spacer_instance.s26(4) + 'return new Wirespec.ServerEdge<>() {\n |' + Spacer_instance.s26(5) + '@Override public Request from(Wirespec.RawRequest request) { return fromRequest(serialization, request); }\n |' + Spacer_instance.s26(5) + '@Override public Wirespec.RawResponse to(Response<?> response) { return toResponse(serialization, response); }\n |' + Spacer_instance.s26(4) + '};\n |' + Spacer_instance.s26(3) + '}\n |' + Spacer_instance.s26(3) + '@Override public Wirespec.ClientEdge<Request, Response<?>> getClient(Wirespec.Serialization serialization) {\n |' + Spacer_instance.s26(4) + 'return new Wirespec.ClientEdge<>() {\n |' + Spacer_instance.s26(5) + '@Override public Wirespec.RawRequest to(Request request) { return toRequest(serialization, request); }\n |' + Spacer_instance.s26(5) + '@Override public Response<?> from(Wirespec.RawResponse response) { return fromResponse(serialization, response); }\n |' + Spacer_instance.s26(4) + '};\n |' + Spacer_instance.s26(3) + '}\n |' + Spacer_instance.s26(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
264
321
|
}
|
|
265
322
|
function emitHandleFunction(endpoint) {
|
|
266
|
-
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.
|
|
323
|
+
return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.r25(this.y25(endpoint.g24_1)) + '(Request request);';
|
|
267
324
|
}
|
|
268
|
-
function
|
|
269
|
-
return trimMargin('\n |' + Spacer_instance.toString() + 'class Request implements Wirespec.Request<' + emit_13(_this__u8e3s4.
|
|
325
|
+
function emit_11(_this__u8e3s4, endpoint) {
|
|
326
|
+
return trimMargin('\n |' + Spacer_instance.toString() + 'class Request implements Wirespec.Request<' + emit_13(_this__u8e3s4.p24_1, this) + '> {\n |' + Spacer_instance.s26(2) + 'private final Path path;\n |' + Spacer_instance.s26(2) + 'private final Wirespec.Method method;\n |' + Spacer_instance.s26(2) + 'private final Queries queries;\n |' + Spacer_instance.s26(2) + 'private final RequestHeaders headers;\n |' + Spacer_instance.s26(2) + 'private final ' + emit_13(_this__u8e3s4.p24_1, this) + ' body;\n |' + Spacer_instance.s26(2) + emitConstructor(_this__u8e3s4, this, endpoint) + '\n |' + Spacer_instance.s26(2) + '@Override public Path getPath() { return path; }\n |' + Spacer_instance.s26(2) + '@Override public Wirespec.Method getMethod() { return method; }\n |' + Spacer_instance.s26(2) + '@Override public Queries getQueries() { return queries; }\n |' + Spacer_instance.s26(2) + '@Override public RequestHeaders getHeaders() { return headers; }\n |' + Spacer_instance.s26(2) + '@Override public ' + emit_13(_this__u8e3s4.p24_1, this) + ' getBody() { return body; }\n |' + Spacer_instance.toString() + '}\n ');
|
|
270
327
|
}
|
|
271
|
-
function
|
|
328
|
+
function emit_12(_this__u8e3s4) {
|
|
272
329
|
var tmp = Spacer_instance.toString();
|
|
273
|
-
var tmp_0 = Companion_instance_1.
|
|
274
|
-
var tmp_1 = orNull(joinToString(_this__u8e3s4.
|
|
275
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
330
|
+
var tmp_0 = Companion_instance_1.q25(_this__u8e3s4.s24_1);
|
|
331
|
+
var tmp_1 = orNull(joinToString(_this__u8e3s4.t24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_6(this)));
|
|
332
|
+
var tmp0_safe_receiver = _this__u8e3s4.u24_1;
|
|
276
333
|
var tmp_2;
|
|
277
334
|
if (tmp0_safe_receiver == null) {
|
|
278
335
|
tmp_2 = null;
|
|
@@ -283,81 +340,24 @@ function emit_9(_this__u8e3s4) {
|
|
|
283
340
|
tmp_2 = emit_13(tmp0_safe_receiver, this) + ' body';
|
|
284
341
|
}
|
|
285
342
|
var tmp_3 = joinToString(listOfNotNull([tmp_1, tmp_2]));
|
|
286
|
-
var tmp_4 = toString_0(first(_this__u8e3s4.
|
|
287
|
-
var tmp_5 = emit_13(_this__u8e3s4.
|
|
288
|
-
var tmp_6 = concatGenerics(emit_13(_this__u8e3s4.
|
|
289
|
-
var tmp_7 = Spacer_instance.
|
|
290
|
-
var tmp_8 = fixStatus(_this__u8e3s4.
|
|
291
|
-
var tmp_9 = Spacer_instance.
|
|
343
|
+
var tmp_4 = toString_0(first(_this__u8e3s4.s24_1));
|
|
344
|
+
var tmp_5 = emit_13(_this__u8e3s4.u24_1, this);
|
|
345
|
+
var tmp_6 = concatGenerics(emit_13(_this__u8e3s4.u24_1, this));
|
|
346
|
+
var tmp_7 = Spacer_instance.s26(2);
|
|
347
|
+
var tmp_8 = fixStatus(_this__u8e3s4.s24_1);
|
|
348
|
+
var tmp_9 = Spacer_instance.s26(2);
|
|
292
349
|
// Inline function 'kotlin.let' call
|
|
293
350
|
// Inline function 'kotlin.contracts.contract' call
|
|
294
351
|
// Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emit.<anonymous>' call
|
|
295
|
-
var tmp_10 = '@Override public Headers getHeaders() { return new Headers(' + joinToString(_this__u8e3s4.
|
|
296
|
-
var tmp_11 = Spacer_instance.
|
|
297
|
-
var tmp_12 = emit_13(_this__u8e3s4.
|
|
298
|
-
var tmp_13 = _this__u8e3s4.
|
|
299
|
-
var tmp_14 = Spacer_instance.
|
|
300
|
-
return trimMargin('\n |' + tmp + 'record Response' + tmp_0 + '(' + tmp_3 + ') implements Response' + tmp_4 + 'XX<' + tmp_5 + '>, Response' + tmp_6 + ' {\n |' + tmp_7 + '@Override public int getStatus() { return ' + tmp_8 + '; }\n |' + tmp_9 + tmp_10 + '\n |' + tmp_11 + '@Override public ' + tmp_12 + ' getBody() { return ' + tmp_13 + '; }\n |' + tmp_14 + emitObject(_this__u8e3s4.
|
|
352
|
+
var tmp_10 = '@Override public Headers getHeaders() { return new Headers(' + joinToString(_this__u8e3s4.t24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_7(this)) + '); }';
|
|
353
|
+
var tmp_11 = Spacer_instance.s26(2);
|
|
354
|
+
var tmp_12 = emit_13(_this__u8e3s4.u24_1, this);
|
|
355
|
+
var tmp_13 = _this__u8e3s4.u24_1 == null ? 'null' : 'body';
|
|
356
|
+
var tmp_14 = Spacer_instance.s26(1);
|
|
357
|
+
return trimMargin('\n |' + tmp + 'record Response' + tmp_0 + '(' + tmp_3 + ') implements Response' + tmp_4 + 'XX<' + tmp_5 + '>, Response' + tmp_6 + ' {\n |' + tmp_7 + '@Override public int getStatus() { return ' + tmp_8 + '; }\n |' + tmp_9 + tmp_10 + '\n |' + tmp_11 + '@Override public ' + tmp_12 + ' getBody() { return ' + tmp_13 + '; }\n |' + tmp_14 + emitObject(_this__u8e3s4.t24_1, this, 'Headers', 'Wirespec.Response.Headers', JavaEndpointDefinitionEmitter$emit$lambda_8(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
301
358
|
}
|
|
302
359
|
initMetadataForInterface(JavaEndpointDefinitionEmitter, 'JavaEndpointDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
303
|
-
|
|
304
|
-
var tmp = this.h25(enum_0.r25_1);
|
|
305
|
-
return trimMargin('\n |public enum ' + tmp + ' implements Wirespec.Enum {\n |' + spacer(joinToString(enum_0.s25_1, ',\n', VOID, VOID, VOID, VOID, JavaEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'public final String label;\n |' + Spacer_instance.toString() + this.h25(enum_0.r25_1) + '(String label) {\n |' + Spacer_instance.b26(2) + 'this.label = label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() {\n |' + Spacer_instance.b26(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String getLabel() {\n |' + Spacer_instance.b26(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
306
|
-
}
|
|
307
|
-
function sanitizeEnum(_this__u8e3s4) {
|
|
308
|
-
return this.t29(this.s29(joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_')));
|
|
309
|
-
}
|
|
310
|
-
initMetadataForInterface(JavaEnumDefinitionEmitter, 'JavaEnumDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
311
|
-
function emit_11(refined) {
|
|
312
|
-
return trimMargin('\n |public record ' + this.h25(refined.m25_1) + ' (String value) implements Wirespec.Refined {\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() { return value; }\n |' + Spacer_instance.toString() + 'public static boolean validate(' + this.h25(refined.m25_1) + ' record) {\n |' + Spacer_instance.toString() + Spacer_instance.toString() + 'return ' + this.v25(refined) + '\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String getValue() { return value; }\n |}\n |\n ');
|
|
313
|
-
}
|
|
314
|
-
function emitValidator(_this__u8e3s4) {
|
|
315
|
-
var defaultReturn = 'true;';
|
|
316
|
-
var type = _this__u8e3s4.n25_1.p28_1;
|
|
317
|
-
var tmp;
|
|
318
|
-
if (type instanceof Integer) {
|
|
319
|
-
var tmp0_safe_receiver = type.v27_1;
|
|
320
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.j24(tmp0_safe_receiver);
|
|
321
|
-
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
322
|
-
} else {
|
|
323
|
-
if (type instanceof Number_0) {
|
|
324
|
-
var tmp2_safe_receiver = type.y27_1;
|
|
325
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.j24(tmp2_safe_receiver);
|
|
326
|
-
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
327
|
-
} else {
|
|
328
|
-
if (type instanceof String_0) {
|
|
329
|
-
var tmp4_safe_receiver = type.s27_1;
|
|
330
|
-
var tmp_0;
|
|
331
|
-
var tmp_1 = tmp4_safe_receiver;
|
|
332
|
-
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
333
|
-
tmp_0 = null;
|
|
334
|
-
} else {
|
|
335
|
-
tmp_0 = this.j24(new RegExp_0(tmp4_safe_receiver));
|
|
336
|
-
}
|
|
337
|
-
var tmp5_elvis_lhs = tmp_0;
|
|
338
|
-
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
339
|
-
} else {
|
|
340
|
-
if (equals(type, Boolean_instance)) {
|
|
341
|
-
tmp = defaultReturn;
|
|
342
|
-
} else {
|
|
343
|
-
if (equals(type, Bytes_instance)) {
|
|
344
|
-
tmp = defaultReturn;
|
|
345
|
-
} else {
|
|
346
|
-
noWhenBranchMatchedException();
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
return tmp;
|
|
353
|
-
}
|
|
354
|
-
initMetadataForInterface(JavaRefinedTypeDefinitionEmitter, 'JavaRefinedTypeDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
|
|
355
|
-
function emit_12(union) {
|
|
356
|
-
var tmp = this.h25(union.c23_1);
|
|
357
|
-
return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.d23_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
|
|
358
|
-
}
|
|
359
|
-
initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
|
|
360
|
-
initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [JavaIdentifierEmitter, JavaEndpointDefinitionEmitter, JavaEnumDefinitionEmitter, JavaChannelDefinitionEmitter, JavaRefinedTypeDefinitionEmitter, JavaTypeDefinitionEmitter, JavaUnionDefinitionEmitter, LanguageEmitter]);
|
|
360
|
+
initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [JavaChannelDefinitionEmitter, JavaEnumDefinitionEmitter, JavaUnionDefinitionEmitter, JavaRefinedTypeDefinitionEmitter, JavaTypeDefinitionEmitter, JavaIdentifierEmitter, JavaEndpointDefinitionEmitter, LanguageEmitter]);
|
|
361
361
|
initMetadataForCompanion(Companion);
|
|
362
362
|
initMetadataForObject(JavaShared, 'JavaShared');
|
|
363
363
|
//endregion
|
|
@@ -371,7 +371,7 @@ function emitImports(_this__u8e3s4, $this) {
|
|
|
371
371
|
while (tmp0_iterator.h()) {
|
|
372
372
|
var element = tmp0_iterator.i();
|
|
373
373
|
// Inline function 'community.flock.wirespec.emitters.java.JavaChannelDefinitionEmitter.emitImports.<anonymous>' call
|
|
374
|
-
if (!(_this__u8e3s4.
|
|
374
|
+
if (!(_this__u8e3s4.w25().b1() === element.k29_1)) {
|
|
375
375
|
destination.e(element);
|
|
376
376
|
}
|
|
377
377
|
}
|
|
@@ -381,7 +381,7 @@ function emitImports(_this__u8e3s4, $this) {
|
|
|
381
381
|
while (tmp0_iterator_0.h()) {
|
|
382
382
|
var item = tmp0_iterator_0.i();
|
|
383
383
|
// Inline function 'community.flock.wirespec.emitters.java.JavaChannelDefinitionEmitter.emitImports.<anonymous>' call
|
|
384
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
384
|
+
var tmp$ret$3 = 'import ' + $this.i2a().o26_1 + '.model.' + item.k29_1 + ';';
|
|
385
385
|
destination_0.e(tmp$ret$3);
|
|
386
386
|
}
|
|
387
387
|
var tmp = destination_0;
|
|
@@ -389,8 +389,8 @@ function emitImports(_this__u8e3s4, $this) {
|
|
|
389
389
|
}
|
|
390
390
|
function emitFullyQualified(_this__u8e3s4, $this, reference) {
|
|
391
391
|
var tmp;
|
|
392
|
-
if (_this__u8e3s4.
|
|
393
|
-
tmp = $this.
|
|
392
|
+
if (_this__u8e3s4.w25().b1() === reference.b1()) {
|
|
393
|
+
tmp = $this.i2a().o26_1 + '.model.';
|
|
394
394
|
} else {
|
|
395
395
|
tmp = '';
|
|
396
396
|
}
|
|
@@ -403,49 +403,49 @@ function JavaChannelDefinitionEmitter$emitImports$lambda(it) {
|
|
|
403
403
|
function JavaChannelDefinitionEmitter() {
|
|
404
404
|
}
|
|
405
405
|
function JavaEmitter(packageName, emitShared) {
|
|
406
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
407
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
406
|
+
packageName = packageName === VOID ? Companion_instance.n26('community.flock.wirespec.generated') : packageName;
|
|
407
|
+
emitShared = emitShared === VOID ? Companion_instance_0.i23() : emitShared;
|
|
408
408
|
LanguageEmitter.call(this);
|
|
409
|
-
this.
|
|
410
|
-
this.
|
|
411
|
-
this.
|
|
412
|
-
this.
|
|
413
|
-
this.
|
|
414
|
-
this.
|
|
415
|
-
}
|
|
416
|
-
protoOf(JavaEmitter).
|
|
417
|
-
return this.
|
|
409
|
+
this.c2b_1 = packageName;
|
|
410
|
+
this.d2b_1 = emitShared;
|
|
411
|
+
this.e2b_1 = '\nimport community.flock.wirespec.java.Wirespec;\n';
|
|
412
|
+
this.f2b_1 = FileExtension_Java_getInstance();
|
|
413
|
+
this.g2b_1 = JavaShared_getInstance();
|
|
414
|
+
this.h2b_1 = '//';
|
|
415
|
+
}
|
|
416
|
+
protoOf(JavaEmitter).i2a = function () {
|
|
417
|
+
return this.c2b_1;
|
|
418
418
|
};
|
|
419
|
-
protoOf(JavaEmitter).
|
|
420
|
-
return this.
|
|
419
|
+
protoOf(JavaEmitter).g25 = function () {
|
|
420
|
+
return this.f2b_1;
|
|
421
421
|
};
|
|
422
|
-
protoOf(JavaEmitter).
|
|
423
|
-
return this.
|
|
422
|
+
protoOf(JavaEmitter).s2a = function () {
|
|
423
|
+
return this.g2b_1;
|
|
424
424
|
};
|
|
425
|
-
protoOf(JavaEmitter).
|
|
426
|
-
return this.
|
|
425
|
+
protoOf(JavaEmitter).h25 = function () {
|
|
426
|
+
return this.h2b_1;
|
|
427
427
|
};
|
|
428
|
-
protoOf(JavaEmitter).
|
|
428
|
+
protoOf(JavaEmitter).u25 = function (module_0, logger) {
|
|
429
429
|
// Inline function 'kotlin.let' call
|
|
430
430
|
// Inline function 'kotlin.contracts.contract' call
|
|
431
431
|
// Inline function 'community.flock.wirespec.emitters.java.JavaEmitter.emit.<anonymous>' call
|
|
432
|
-
var it = protoOf(LanguageEmitter).
|
|
433
|
-
return this.
|
|
432
|
+
var it = protoOf(LanguageEmitter).u25.call(this, module_0, logger);
|
|
433
|
+
return this.d2b_1.j23_1 ? it.vk(new Emitted(Companion_instance.n26('community.flock.wirespec.java').q26() + 'Wirespec', this.s2a().j2b_1)) : it;
|
|
434
434
|
};
|
|
435
|
-
protoOf(JavaEmitter).
|
|
435
|
+
protoOf(JavaEmitter).v25 = function (definition, module_0, logger) {
|
|
436
436
|
// Inline function 'kotlin.let' call
|
|
437
437
|
// Inline function 'kotlin.contracts.contract' call
|
|
438
438
|
// Inline function 'community.flock.wirespec.emitters.java.JavaEmitter.emit.<anonymous>' call
|
|
439
|
-
var it = protoOf(LanguageEmitter).
|
|
440
|
-
var subPackageName = plus(this.
|
|
441
|
-
var tmp = subPackageName.
|
|
439
|
+
var it = protoOf(LanguageEmitter).v25.call(this, definition, module_0, logger);
|
|
440
|
+
var subPackageName = plus(this.i2a(), definition);
|
|
441
|
+
var tmp = subPackageName.q26() + this.k2b(it.k23_1);
|
|
442
442
|
// Inline function 'kotlin.text.trimStart' call
|
|
443
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.
|
|
443
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.s25(module_0) ? this.e2b_1 : '') + '\n |' + it.l23_1 + '\n ');
|
|
444
444
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
445
445
|
return new Emitted(tmp, tmp$ret$0);
|
|
446
446
|
};
|
|
447
447
|
function emitGetType(_this__u8e3s4, $this) {
|
|
448
|
-
return 'Wirespec.getType(' + $this.
|
|
448
|
+
return 'Wirespec.getType(' + $this.b2b(_this__u8e3s4, 'Void') + '.class, ' + emitGetTypeRaw(_this__u8e3s4, $this) + ')';
|
|
449
449
|
}
|
|
450
450
|
function emitGetTypeRaw(_this__u8e3s4, $this) {
|
|
451
451
|
var tmp;
|
|
@@ -464,9 +464,9 @@ function emitGetTypeRaw(_this__u8e3s4, $this) {
|
|
|
464
464
|
function emitConstructor(_this__u8e3s4, $this, endpoint) {
|
|
465
465
|
var tmp = get_pathParams(endpoint);
|
|
466
466
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda($this)));
|
|
467
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
468
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
469
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
467
|
+
var tmp_1 = orNull(joinToString(endpoint.j24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_0($this)));
|
|
468
|
+
var tmp_2 = orNull(joinToString(endpoint.k24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_1($this)));
|
|
469
|
+
var tmp0_safe_receiver = _this__u8e3s4.p24_1;
|
|
470
470
|
var tmp_3;
|
|
471
471
|
if (tmp0_safe_receiver == null) {
|
|
472
472
|
tmp_3 = null;
|
|
@@ -477,23 +477,23 @@ function emitConstructor(_this__u8e3s4, $this, endpoint) {
|
|
|
477
477
|
tmp_3 = emit_13(tmp0_safe_receiver, $this) + ' body';
|
|
478
478
|
}
|
|
479
479
|
var tmp_4 = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]));
|
|
480
|
-
var tmp_5 = Spacer_instance.
|
|
480
|
+
var tmp_5 = Spacer_instance.s26(3);
|
|
481
481
|
// Inline function 'kotlin.let' call
|
|
482
482
|
var tmp_6 = get_pathParams(endpoint);
|
|
483
483
|
// Inline function 'kotlin.contracts.contract' call
|
|
484
484
|
// Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitConstructor.<anonymous>' call
|
|
485
485
|
var tmp_7 = 'this.path = new Path(' + joinToString(tmp_6, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_2($this)) + ');';
|
|
486
|
-
var tmp_8 = 'this.method = Wirespec.Method.' + endpoint.
|
|
486
|
+
var tmp_8 = 'this.method = Wirespec.Method.' + endpoint.h24_1.q2_1 + ';';
|
|
487
487
|
// Inline function 'kotlin.let' call
|
|
488
488
|
// Inline function 'kotlin.contracts.contract' call
|
|
489
489
|
// Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitConstructor.<anonymous>' call
|
|
490
|
-
var tmp_9 = 'this.queries = new Queries(' + joinToString(endpoint.
|
|
490
|
+
var tmp_9 = 'this.queries = new Queries(' + joinToString(endpoint.j24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_3($this)) + ');';
|
|
491
491
|
// Inline function 'kotlin.let' call
|
|
492
492
|
// Inline function 'kotlin.contracts.contract' call
|
|
493
493
|
// Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitConstructor.<anonymous>' call
|
|
494
|
-
var tmp_10 = 'this.headers = new RequestHeaders(' + joinToString(endpoint.
|
|
494
|
+
var tmp_10 = 'this.headers = new RequestHeaders(' + joinToString(endpoint.k24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_4($this)) + ');';
|
|
495
495
|
var tmp_11;
|
|
496
|
-
if (_this__u8e3s4.
|
|
496
|
+
if (_this__u8e3s4.p24_1 == null) {
|
|
497
497
|
tmp_11 = null;
|
|
498
498
|
} else {
|
|
499
499
|
// Inline function 'kotlin.let' call
|
|
@@ -502,15 +502,15 @@ function emitConstructor(_this__u8e3s4, $this, endpoint) {
|
|
|
502
502
|
tmp_11 = 'body';
|
|
503
503
|
}
|
|
504
504
|
var tmp2_elvis_lhs = tmp_11;
|
|
505
|
-
return 'public Request(' + tmp_4 + ') {\n' + tmp_5 + joinToString(listOfNotNull([tmp_7, tmp_8, tmp_9, tmp_10, 'this.body = ' + (tmp2_elvis_lhs == null ? 'null' : tmp2_elvis_lhs) + ';']), '\n' + Spacer_instance.
|
|
505
|
+
return 'public Request(' + tmp_4 + ') {\n' + tmp_5 + joinToString(listOfNotNull([tmp_7, tmp_8, tmp_9, tmp_10, 'this.body = ' + (tmp2_elvis_lhs == null ? 'null' : tmp2_elvis_lhs) + ';']), '\n' + Spacer_instance.s26(3)) + '\n' + Spacer_instance.s26(2) + '}';
|
|
506
506
|
}
|
|
507
507
|
function emitDeserializedParams(_this__u8e3s4, $this, endpoint) {
|
|
508
508
|
// Inline function 'kotlin.let' call
|
|
509
509
|
var tmp = get_indexedPathParams(endpoint);
|
|
510
510
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
|
|
511
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
512
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
513
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
511
|
+
var tmp_1 = orNull(joinToString(endpoint.j24_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
512
|
+
var tmp_2 = orNull(joinToString(endpoint.k24_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
513
|
+
var tmp0_safe_receiver = _this__u8e3s4.p24_1;
|
|
514
514
|
var tmp_3;
|
|
515
515
|
if (tmp0_safe_receiver == null) {
|
|
516
516
|
tmp_3 = null;
|
|
@@ -518,17 +518,17 @@ function emitDeserializedParams(_this__u8e3s4, $this, endpoint) {
|
|
|
518
518
|
// Inline function 'kotlin.let' call
|
|
519
519
|
// Inline function 'kotlin.contracts.contract' call
|
|
520
520
|
// Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitDeserializedParams.<anonymous>' call
|
|
521
|
-
tmp_3 = Spacer_instance.
|
|
521
|
+
tmp_3 = Spacer_instance.s26(4) + 'serialization.deserializeBody(request.body(), ' + emitGetType(tmp0_safe_receiver.r24_1, $this) + ')';
|
|
522
522
|
}
|
|
523
523
|
// Inline function 'kotlin.contracts.contract' call
|
|
524
524
|
// Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitDeserializedParams.<anonymous>' call
|
|
525
525
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
526
|
-
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.
|
|
526
|
+
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.s26(3);
|
|
527
527
|
}
|
|
528
528
|
function emitDeserializedParams_0(_this__u8e3s4, $this) {
|
|
529
529
|
// Inline function 'kotlin.let' call
|
|
530
|
-
var tmp = orNull(joinToString(_this__u8e3s4.
|
|
531
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
530
|
+
var tmp = orNull(joinToString(_this__u8e3s4.t24_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2($this)));
|
|
531
|
+
var tmp0_safe_receiver = _this__u8e3s4.u24_1;
|
|
532
532
|
var tmp_0;
|
|
533
533
|
if (tmp0_safe_receiver == null) {
|
|
534
534
|
tmp_0 = null;
|
|
@@ -536,50 +536,50 @@ function emitDeserializedParams_0(_this__u8e3s4, $this) {
|
|
|
536
536
|
// Inline function 'kotlin.let' call
|
|
537
537
|
// Inline function 'kotlin.contracts.contract' call
|
|
538
538
|
// Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitDeserializedParams.<anonymous>' call
|
|
539
|
-
tmp_0 = Spacer_instance.
|
|
539
|
+
tmp_0 = Spacer_instance.s26(4) + 'serialization.deserializeBody(response.body(), ' + emitGetType(tmp0_safe_receiver.r24_1, $this) + ')';
|
|
540
540
|
}
|
|
541
541
|
// Inline function 'kotlin.contracts.contract' call
|
|
542
542
|
// Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitDeserializedParams.<anonymous>' call
|
|
543
543
|
var it = joinToString(listOfNotNull([tmp, tmp_0]), ',\n');
|
|
544
|
-
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.
|
|
544
|
+
return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.s26(3);
|
|
545
545
|
}
|
|
546
546
|
function emitSerialized(_this__u8e3s4, $this) {
|
|
547
|
-
var tmp = Spacer_instance.
|
|
548
|
-
var tmp_0 = Companion_instance_1.
|
|
547
|
+
var tmp = Spacer_instance.s26(3);
|
|
548
|
+
var tmp_0 = Companion_instance_1.q25(_this__u8e3s4.s24_1);
|
|
549
549
|
var tmp_1;
|
|
550
550
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
551
|
-
if (!_this__u8e3s4.
|
|
552
|
-
tmp_1 = 'java.util.Map.ofEntries(' + joinToString(_this__u8e3s4.
|
|
551
|
+
if (!_this__u8e3s4.t24_1.l()) {
|
|
552
|
+
tmp_1 = 'java.util.Map.ofEntries(' + joinToString(_this__u8e3s4.t24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitSerialized$lambda($this)) + ')';
|
|
553
553
|
} else {
|
|
554
554
|
tmp_1 = 'java.util.Collections.emptyMap()';
|
|
555
555
|
}
|
|
556
|
-
return tmp + 'if (response instanceof Response' + tmp_0 + ' r) { return new Wirespec.RawResponse(r.getStatus(), ' + tmp_1 + ', ' + (!(_this__u8e3s4.
|
|
556
|
+
return tmp + 'if (response instanceof Response' + tmp_0 + ' r) { return new Wirespec.RawResponse(r.getStatus(), ' + tmp_1 + ', ' + (!(_this__u8e3s4.u24_1 == null) ? 'serialization.serializeBody(r.body, ' + emitGetType(ensureNotNull(_this__u8e3s4.u24_1).r24_1, $this) + ')' : 'null') + '); }';
|
|
557
557
|
}
|
|
558
558
|
function emitDeserialized(_this__u8e3s4, $this) {
|
|
559
|
-
return Spacer_instance.
|
|
559
|
+
return Spacer_instance.s26(4) + 'case ' + _this__u8e3s4.s24_1 + ': return new Response' + Companion_instance_1.q25(_this__u8e3s4.s24_1) + '(' + emitDeserializedParams_0(_this__u8e3s4, $this) + ');';
|
|
560
560
|
}
|
|
561
561
|
function emitSerializedParams(_this__u8e3s4, $this, fields) {
|
|
562
|
-
return 'java.util.Map.entry("' + _this__u8e3s4.
|
|
562
|
+
return 'java.util.Map.entry("' + _this__u8e3s4.c24_1.b1() + '", serialization.serializeParam(request.' + fields + '.' + $this.y25(_this__u8e3s4.c24_1) + ', ' + emitGetType(_this__u8e3s4.d24_1, $this) + '))';
|
|
563
563
|
}
|
|
564
564
|
function emitDeserialized_0(_this__u8e3s4, $this) {
|
|
565
|
-
return Spacer_instance.
|
|
565
|
+
return Spacer_instance.s26(4) + 'serialization.deserializePath(request.path().get(' + _this__u8e3s4.qd_1 + '), ' + emitGetType(_this__u8e3s4.rd_1.o24_1, $this) + ')';
|
|
566
566
|
}
|
|
567
567
|
function emitDeserializedParams_1(_this__u8e3s4, $this, fields) {
|
|
568
|
-
return Spacer_instance.
|
|
568
|
+
return Spacer_instance.s26(4) + 'serialization.deserializeParam(request.' + fields + '().getOrDefault("' + _this__u8e3s4.c24_1.b1() + '", java.util.Collections.emptyList()), ' + emitGetType(_this__u8e3s4.d24_1, $this) + ')';
|
|
569
569
|
}
|
|
570
570
|
function emitSerializedHeader(_this__u8e3s4, $this) {
|
|
571
|
-
return 'java.util.Map.entry("' + _this__u8e3s4.
|
|
571
|
+
return 'java.util.Map.entry("' + _this__u8e3s4.c24_1.b1() + '", serialization.serializeParam(r.getHeaders().' + $this.y25(_this__u8e3s4.c24_1) + '(), ' + emitGetType(_this__u8e3s4.d24_1, $this) + '))';
|
|
572
572
|
}
|
|
573
573
|
function emitIdentifier(_this__u8e3s4, $this) {
|
|
574
|
-
return 'serialization.serializePath(request.path.' + Companion_instance_1.
|
|
574
|
+
return 'serialization.serializePath(request.path.' + Companion_instance_1.r25($this.y25(_this__u8e3s4.n24_1)) + ', ' + emitGetType(_this__u8e3s4.o24_1, $this) + ')';
|
|
575
575
|
}
|
|
576
576
|
function emit_13(_this__u8e3s4, $this) {
|
|
577
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
578
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
577
|
+
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.r24_1;
|
|
578
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.z24(tmp1_safe_receiver);
|
|
579
579
|
return tmp2_elvis_lhs == null ? 'Void' : tmp2_elvis_lhs;
|
|
580
580
|
}
|
|
581
581
|
function emit_14(_this__u8e3s4, $this) {
|
|
582
|
-
return $this.
|
|
582
|
+
return $this.z24(_this__u8e3s4.o24_1) + ' ' + $this.y25(_this__u8e3s4.n24_1);
|
|
583
583
|
}
|
|
584
584
|
function emitImports_0(_this__u8e3s4, $this) {
|
|
585
585
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -591,7 +591,7 @@ function emitImports_0(_this__u8e3s4, $this) {
|
|
|
591
591
|
while (tmp0_iterator.h()) {
|
|
592
592
|
var element = tmp0_iterator.i();
|
|
593
593
|
// Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitImports.<anonymous>' call
|
|
594
|
-
if (!(_this__u8e3s4.
|
|
594
|
+
if (!(_this__u8e3s4.w25().b1() === element.k29_1)) {
|
|
595
595
|
destination.e(element);
|
|
596
596
|
}
|
|
597
597
|
}
|
|
@@ -601,46 +601,46 @@ function emitImports_0(_this__u8e3s4, $this) {
|
|
|
601
601
|
while (tmp0_iterator_0.h()) {
|
|
602
602
|
var item = tmp0_iterator_0.i();
|
|
603
603
|
// Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitImports.<anonymous>' call
|
|
604
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
604
|
+
var tmp$ret$3 = 'import ' + $this.i2a().o26_1 + '.model.' + item.k29_1 + ';';
|
|
605
605
|
destination_0.e(tmp$ret$3);
|
|
606
606
|
}
|
|
607
607
|
var tmp = destination_0;
|
|
608
608
|
return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitImports$lambda);
|
|
609
609
|
}
|
|
610
610
|
function emitRequestFunctions(_this__u8e3s4, $this, endpoint) {
|
|
611
|
-
var tmp = Spacer_instance.
|
|
612
|
-
var tmp_0 = Spacer_instance.
|
|
613
|
-
var tmp_1 = Spacer_instance.
|
|
614
|
-
var tmp_2 = Spacer_instance.
|
|
615
|
-
var tmp_3 = joinToString(endpoint.
|
|
616
|
-
var tmp_4 = Spacer_instance.
|
|
611
|
+
var tmp = Spacer_instance.s26(2);
|
|
612
|
+
var tmp_0 = Spacer_instance.s26(3);
|
|
613
|
+
var tmp_1 = Spacer_instance.s26(4);
|
|
614
|
+
var tmp_2 = Spacer_instance.s26(4);
|
|
615
|
+
var tmp_3 = joinToString(endpoint.i24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda($this));
|
|
616
|
+
var tmp_4 = Spacer_instance.s26(4);
|
|
617
617
|
var tmp_5;
|
|
618
618
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
619
|
-
if (!endpoint.
|
|
620
|
-
tmp_5 = 'java.util.Map.ofEntries(' + joinToString(endpoint.
|
|
619
|
+
if (!endpoint.j24_1.l()) {
|
|
620
|
+
tmp_5 = 'java.util.Map.ofEntries(' + joinToString(endpoint.j24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_0($this)) + ')';
|
|
621
621
|
} else {
|
|
622
622
|
tmp_5 = 'java.util.Collections.emptyMap()';
|
|
623
623
|
}
|
|
624
624
|
var tmp_6 = tmp_5;
|
|
625
|
-
var tmp_7 = Spacer_instance.
|
|
625
|
+
var tmp_7 = Spacer_instance.s26(4);
|
|
626
626
|
var tmp_8;
|
|
627
627
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
628
|
-
if (!endpoint.
|
|
629
|
-
tmp_8 = 'java.util.Map.ofEntries(' + joinToString(endpoint.
|
|
628
|
+
if (!endpoint.k24_1.l()) {
|
|
629
|
+
tmp_8 = 'java.util.Map.ofEntries(' + joinToString(endpoint.k24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1($this)) + ')';
|
|
630
630
|
} else {
|
|
631
631
|
tmp_8 = 'java.util.Collections.emptyMap()';
|
|
632
632
|
}
|
|
633
633
|
var tmp_9 = tmp_8;
|
|
634
|
-
var tmp_10 = Spacer_instance.
|
|
634
|
+
var tmp_10 = Spacer_instance.s26(4);
|
|
635
635
|
var tmp_11;
|
|
636
|
-
if (!(_this__u8e3s4.
|
|
637
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
638
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
636
|
+
if (!(_this__u8e3s4.p24_1 == null)) {
|
|
637
|
+
var tmp0_safe_receiver = _this__u8e3s4.p24_1;
|
|
638
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.r24_1;
|
|
639
639
|
tmp_11 = 'serialization.serializeBody(request.getBody(), ' + (tmp1_safe_receiver == null ? null : emitGetType(tmp1_safe_receiver, $this)) + ')';
|
|
640
640
|
} else {
|
|
641
641
|
tmp_11 = 'null';
|
|
642
642
|
}
|
|
643
|
-
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.
|
|
643
|
+
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.s26(3) + ');\n |' + Spacer_instance.s26(2) + '}\n |\n |' + Spacer_instance.s26(2) + 'static Request fromRequest(Wirespec.Deserializer serialization, Wirespec.RawRequest request) {\n |' + Spacer_instance.s26(3) + 'return new Request(' + emitDeserializedParams(_this__u8e3s4, $this, endpoint) + ');\n |' + Spacer_instance.s26(2) + '}\n ');
|
|
644
644
|
}
|
|
645
645
|
function emitObject(_this__u8e3s4, $this, name, extends_0, block) {
|
|
646
646
|
var tmp;
|
|
@@ -654,14 +654,14 @@ function emitObject(_this__u8e3s4, $this, name, extends_0, block) {
|
|
|
654
654
|
}
|
|
655
655
|
function emitResponseInterfaces(_this__u8e3s4, $this) {
|
|
656
656
|
// Inline function 'kotlin.collections.map' call
|
|
657
|
-
var this_0 = distinctByStatus(_this__u8e3s4.
|
|
657
|
+
var this_0 = distinctByStatus(_this__u8e3s4.m24_1);
|
|
658
658
|
// Inline function 'kotlin.collections.mapTo' call
|
|
659
659
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
660
660
|
var tmp0_iterator = this_0.g();
|
|
661
661
|
while (tmp0_iterator.h()) {
|
|
662
662
|
var item = tmp0_iterator.i();
|
|
663
663
|
// Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitResponseInterfaces.<anonymous>' call
|
|
664
|
-
var tmp$ret$0 = emit_13(item.
|
|
664
|
+
var tmp$ret$0 = emit_13(item.u24_1, $this);
|
|
665
665
|
destination.e(tmp$ret$0);
|
|
666
666
|
}
|
|
667
667
|
var tmp = distinct(destination);
|
|
@@ -669,14 +669,14 @@ function emitResponseInterfaces(_this__u8e3s4, $this) {
|
|
|
669
669
|
}
|
|
670
670
|
function emitStatusInterfaces(_this__u8e3s4, $this) {
|
|
671
671
|
// Inline function 'kotlin.collections.map' call
|
|
672
|
-
var this_0 = _this__u8e3s4.
|
|
672
|
+
var this_0 = _this__u8e3s4.m24_1;
|
|
673
673
|
// Inline function 'kotlin.collections.mapTo' call
|
|
674
674
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
675
675
|
var tmp0_iterator = this_0.g();
|
|
676
676
|
while (tmp0_iterator.h()) {
|
|
677
677
|
var item = tmp0_iterator.i();
|
|
678
678
|
// Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitStatusInterfaces.<anonymous>' call
|
|
679
|
-
var tmp$ret$0 = new Char(first(item.
|
|
679
|
+
var tmp$ret$0 = new Char(first(item.s24_1));
|
|
680
680
|
destination.e(tmp$ret$0);
|
|
681
681
|
}
|
|
682
682
|
var tmp = distinct(destination);
|
|
@@ -689,17 +689,17 @@ function JavaEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
|
689
689
|
}
|
|
690
690
|
function JavaEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
691
691
|
return function (it) {
|
|
692
|
-
return this$0.
|
|
692
|
+
return this$0.y24(it);
|
|
693
693
|
};
|
|
694
694
|
}
|
|
695
695
|
function JavaEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
696
696
|
return function (it) {
|
|
697
|
-
return this$0.
|
|
697
|
+
return this$0.y24(it);
|
|
698
698
|
};
|
|
699
699
|
}
|
|
700
700
|
function JavaEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
701
701
|
return function (it) {
|
|
702
|
-
return this$0.
|
|
702
|
+
return this$0.w2a(it);
|
|
703
703
|
};
|
|
704
704
|
}
|
|
705
705
|
function JavaEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
@@ -722,27 +722,27 @@ function JavaEndpointDefinitionEmitter$emitConstructor$lambda(this$0) {
|
|
|
722
722
|
}
|
|
723
723
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_0(this$0) {
|
|
724
724
|
return function (it) {
|
|
725
|
-
return this$0.
|
|
725
|
+
return this$0.y24(it);
|
|
726
726
|
};
|
|
727
727
|
}
|
|
728
728
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_1(this$0) {
|
|
729
729
|
return function (it) {
|
|
730
|
-
return this$0.
|
|
730
|
+
return this$0.y24(it);
|
|
731
731
|
};
|
|
732
732
|
}
|
|
733
733
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_2(this$0) {
|
|
734
734
|
return function (it) {
|
|
735
|
-
return this$0.
|
|
735
|
+
return this$0.y25(it.n24_1);
|
|
736
736
|
};
|
|
737
737
|
}
|
|
738
738
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_3(this$0) {
|
|
739
739
|
return function (it) {
|
|
740
|
-
return this$0.
|
|
740
|
+
return this$0.y25(it.c24_1);
|
|
741
741
|
};
|
|
742
742
|
}
|
|
743
743
|
function JavaEndpointDefinitionEmitter$emitConstructor$lambda_4(this$0) {
|
|
744
744
|
return function (it) {
|
|
745
|
-
return this$0.
|
|
745
|
+
return this$0.y25(it.c24_1);
|
|
746
746
|
};
|
|
747
747
|
}
|
|
748
748
|
function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda(this$0) {
|
|
@@ -762,22 +762,22 @@ function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1(this$0) {
|
|
|
762
762
|
}
|
|
763
763
|
function JavaEndpointDefinitionEmitter$emit$lambda_6(this$0) {
|
|
764
764
|
return function (it) {
|
|
765
|
-
return this$0.
|
|
765
|
+
return this$0.y24(it);
|
|
766
766
|
};
|
|
767
767
|
}
|
|
768
768
|
function JavaEndpointDefinitionEmitter$emit$lambda_7(this$0) {
|
|
769
769
|
return function (it) {
|
|
770
|
-
return this$0.
|
|
770
|
+
return this$0.y25(it.c24_1);
|
|
771
771
|
};
|
|
772
772
|
}
|
|
773
773
|
function JavaEndpointDefinitionEmitter$emit$lambda_8(this$0) {
|
|
774
774
|
return function (it) {
|
|
775
|
-
return this$0.
|
|
775
|
+
return this$0.y24(it);
|
|
776
776
|
};
|
|
777
777
|
}
|
|
778
778
|
function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2(this$0) {
|
|
779
779
|
return function (it) {
|
|
780
|
-
return Spacer_instance.
|
|
780
|
+
return Spacer_instance.s26(4) + 'serialization.deserializeParam(response.headers().getOrDefault("' + it.c24_1.b1() + '", java.util.Collections.emptyList()), ' + emitGetType(it.d24_1, this$0) + ')';
|
|
781
781
|
};
|
|
782
782
|
}
|
|
783
783
|
function JavaEndpointDefinitionEmitter$emitSerialized$lambda(this$0) {
|
|
@@ -793,7 +793,7 @@ function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda(this$0) {
|
|
|
793
793
|
return function (it) {
|
|
794
794
|
var tmp;
|
|
795
795
|
if (it instanceof Literal) {
|
|
796
|
-
tmp = '"' + it.
|
|
796
|
+
tmp = '"' + it.j25_1 + '"';
|
|
797
797
|
} else {
|
|
798
798
|
if (it instanceof Param) {
|
|
799
799
|
tmp = emitIdentifier(it, this$0);
|
|
@@ -816,7 +816,7 @@ function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1(this$0) {
|
|
|
816
816
|
}
|
|
817
817
|
function JavaEndpointDefinitionEmitter$emitObject$lambda($block) {
|
|
818
818
|
return function (it) {
|
|
819
|
-
return Spacer_instance.
|
|
819
|
+
return Spacer_instance.s26(2) + $block(it);
|
|
820
820
|
};
|
|
821
821
|
}
|
|
822
822
|
function JavaEndpointDefinitionEmitter$emitResponseInterfaces$lambda(it) {
|
|
@@ -829,14 +829,14 @@ function JavaEndpointDefinitionEmitter() {
|
|
|
829
829
|
}
|
|
830
830
|
function JavaEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
831
831
|
return function (it) {
|
|
832
|
-
return this$0.
|
|
832
|
+
return this$0.y2a(it) + '("' + it + '")';
|
|
833
833
|
};
|
|
834
834
|
}
|
|
835
835
|
function JavaEnumDefinitionEmitter() {
|
|
836
836
|
}
|
|
837
837
|
function Companion() {
|
|
838
838
|
Companion_instance_2 = this;
|
|
839
|
-
this.
|
|
839
|
+
this.l2b_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']);
|
|
840
840
|
}
|
|
841
841
|
var Companion_instance_2;
|
|
842
842
|
function Companion_getInstance() {
|
|
@@ -853,8 +853,8 @@ function JavaRefinedTypeDefinitionEmitter() {
|
|
|
853
853
|
}
|
|
854
854
|
function JavaShared() {
|
|
855
855
|
JavaShared_instance = this;
|
|
856
|
-
this.
|
|
857
|
-
this.
|
|
856
|
+
this.i2b_1 = 'community.flock.wirespec.java';
|
|
857
|
+
this.j2b_1 = trimMargin('\n |package ' + this.i2b_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 |\n |public interface Wirespec {\n |' + Spacer_instance.toString() + 'interface Enum { String getLabel(); }\n |' + Spacer_instance.toString() + 'interface Endpoint {}\n |' + Spacer_instance.toString() + 'interface Refined { String getValue(); }\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.s26(2) + 'Req from(RawRequest request);\n |' + Spacer_instance.s26(2) + 'RawResponse to(Res response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface ClientEdge<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.s26(2) + 'RawRequest to(Req request);\n |' + Spacer_instance.s26(2) + 'Res from(RawResponse response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.s26(2) + 'String getPathTemplate();\n |' + Spacer_instance.s26(2) + 'String getMethod();\n |' + Spacer_instance.s26(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.s26(2) + 'String getPathTemplate();\n |' + Spacer_instance.s26(2) + 'String getMethod();\n |' + Spacer_instance.s26(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 getPath(); Method getMethod(); Queries getQueries(); Headers getHeaders(); T getBody(); interface Headers extends Wirespec.Headers {} }\n |' + Spacer_instance.toString() + 'interface Response<T> { int getStatus(); Headers getHeaders(); T getBody(); 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, byte[] body) {} \n |' + Spacer_instance.toString() + 'record RawResponse(int statusCode, Map<String, List<String>> headers, byte[] body) {}\n |' + Spacer_instance.toString() + 'static Type getType(final Class<?> actualTypeArguments, final Class<?> rawType) {\n |' + Spacer_instance.s26(2) + 'if(rawType != null) {\n |' + Spacer_instance.s26(3) + 'return new ParameterizedType() {\n |' + Spacer_instance.s26(4) + 'public Type getRawType() { return rawType; }\n |' + Spacer_instance.s26(4) + 'public Type[] getActualTypeArguments() { return new Class<?>[]{actualTypeArguments}; }\n |' + Spacer_instance.s26(4) + 'public Type getOwnerType() { return null; }\n |' + Spacer_instance.s26(3) + '};\n |' + Spacer_instance.s26(2) + '}\n |' + Spacer_instance.s26(2) + 'else { return actualTypeArguments; }\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
858
858
|
}
|
|
859
859
|
protoOf(JavaShared).toString = function () {
|
|
860
860
|
return 'JavaShared';
|
|
@@ -879,10 +879,10 @@ function JavaShared_getInstance() {
|
|
|
879
879
|
function emitType(_this__u8e3s4, $this) {
|
|
880
880
|
var tmp;
|
|
881
881
|
if (_this__u8e3s4 instanceof Dict) {
|
|
882
|
-
tmp = 'java.util.Map<String, ' + $this.
|
|
882
|
+
tmp = 'java.util.Map<String, ' + $this.z24(_this__u8e3s4.e23_1) + '>';
|
|
883
883
|
} else {
|
|
884
884
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
885
|
-
tmp = 'java.util.List<' + $this.
|
|
885
|
+
tmp = 'java.util.List<' + $this.z24(_this__u8e3s4.b23_1) + '>';
|
|
886
886
|
} else {
|
|
887
887
|
if (_this__u8e3s4 instanceof Unit) {
|
|
888
888
|
tmp = 'void';
|
|
@@ -891,7 +891,7 @@ function emitType(_this__u8e3s4, $this) {
|
|
|
891
891
|
tmp = 'Object';
|
|
892
892
|
} else {
|
|
893
893
|
if (_this__u8e3s4 instanceof Custom) {
|
|
894
|
-
tmp = _this__u8e3s4.
|
|
894
|
+
tmp = _this__u8e3s4.k29_1;
|
|
895
895
|
} else {
|
|
896
896
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
897
897
|
tmp = emit_15(_this__u8e3s4, $this);
|
|
@@ -906,14 +906,14 @@ function emitType(_this__u8e3s4, $this) {
|
|
|
906
906
|
return tmp;
|
|
907
907
|
}
|
|
908
908
|
function emit_15(_this__u8e3s4, $this) {
|
|
909
|
-
var t = _this__u8e3s4.
|
|
909
|
+
var t = _this__u8e3s4.o29_1;
|
|
910
910
|
var tmp;
|
|
911
911
|
if (t instanceof String_0) {
|
|
912
912
|
tmp = 'String';
|
|
913
913
|
} else {
|
|
914
914
|
if (t instanceof Integer) {
|
|
915
915
|
var tmp_0;
|
|
916
|
-
switch (t.
|
|
916
|
+
switch (t.s28_1.r2_1) {
|
|
917
917
|
case 0:
|
|
918
918
|
tmp_0 = 'Integer';
|
|
919
919
|
break;
|
|
@@ -928,7 +928,7 @@ function emit_15(_this__u8e3s4, $this) {
|
|
|
928
928
|
} else {
|
|
929
929
|
if (t instanceof Number_0) {
|
|
930
930
|
var tmp_1;
|
|
931
|
-
switch (t.
|
|
931
|
+
switch (t.w28_1.r2_1) {
|
|
932
932
|
case 0:
|
|
933
933
|
tmp_1 = 'Float';
|
|
934
934
|
break;
|
|
@@ -957,12 +957,12 @@ function emit_15(_this__u8e3s4, $this) {
|
|
|
957
957
|
}
|
|
958
958
|
function JavaTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
959
959
|
return function (it) {
|
|
960
|
-
return this$0.
|
|
960
|
+
return this$0.z24(it);
|
|
961
961
|
};
|
|
962
962
|
}
|
|
963
963
|
function JavaTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
964
964
|
return function (it) {
|
|
965
|
-
return Spacer_instance.toString() + this$0.
|
|
965
|
+
return Spacer_instance.toString() + this$0.y24(it) + ',';
|
|
966
966
|
};
|
|
967
967
|
}
|
|
968
968
|
function JavaTypeDefinitionEmitter() {
|
|
@@ -973,27 +973,27 @@ function JavaUnionDefinitionEmitter$emit$lambda(it) {
|
|
|
973
973
|
function JavaUnionDefinitionEmitter() {
|
|
974
974
|
}
|
|
975
975
|
//region block: post-declaration
|
|
976
|
-
protoOf(JavaEmitter).
|
|
977
|
-
protoOf(JavaEmitter).
|
|
978
|
-
protoOf(JavaEmitter).
|
|
979
|
-
protoOf(JavaEmitter).
|
|
980
|
-
protoOf(JavaEmitter).
|
|
981
|
-
protoOf(JavaEmitter).
|
|
982
|
-
protoOf(JavaEmitter).
|
|
983
|
-
protoOf(JavaEmitter).
|
|
984
|
-
protoOf(JavaEmitter).
|
|
985
|
-
protoOf(JavaEmitter).
|
|
986
|
-
protoOf(JavaEmitter).
|
|
987
|
-
protoOf(JavaEmitter).
|
|
988
|
-
protoOf(JavaEmitter).
|
|
989
|
-
protoOf(JavaEmitter).
|
|
990
|
-
protoOf(JavaEmitter).
|
|
991
|
-
protoOf(JavaEmitter).
|
|
992
|
-
protoOf(JavaEmitter).
|
|
993
|
-
protoOf(JavaEmitter).
|
|
994
|
-
protoOf(JavaEmitter).
|
|
995
|
-
protoOf(JavaEmitter).
|
|
996
|
-
protoOf(JavaEmitter).
|
|
976
|
+
protoOf(JavaEmitter).y25 = emit_6;
|
|
977
|
+
protoOf(JavaEmitter).w24 = emit_0;
|
|
978
|
+
protoOf(JavaEmitter).x24 = emit_1;
|
|
979
|
+
protoOf(JavaEmitter).y24 = emit_2;
|
|
980
|
+
protoOf(JavaEmitter).z24 = emit_3;
|
|
981
|
+
protoOf(JavaEmitter).a25 = emit_4;
|
|
982
|
+
protoOf(JavaEmitter).l26 = emit_10;
|
|
983
|
+
protoOf(JavaEmitter).v2a = emit_11;
|
|
984
|
+
protoOf(JavaEmitter).w2a = emit_12;
|
|
985
|
+
protoOf(JavaEmitter).z25 = emit_5;
|
|
986
|
+
protoOf(JavaEmitter).k26 = emit_7;
|
|
987
|
+
protoOf(JavaEmitter).a26 = emit_8;
|
|
988
|
+
protoOf(JavaEmitter).f26 = emit_9;
|
|
989
|
+
protoOf(JavaEmitter).k2b = sanitizeSymbol;
|
|
990
|
+
protoOf(JavaEmitter).k2a = sanitizeFirstIsDigit;
|
|
991
|
+
protoOf(JavaEmitter).l2a = sanitizeKeywords;
|
|
992
|
+
protoOf(JavaEmitter).b2b = emitRoot;
|
|
993
|
+
protoOf(JavaEmitter).a2b = emitRoot$default;
|
|
994
|
+
protoOf(JavaEmitter).x2a = emitHandleFunction;
|
|
995
|
+
protoOf(JavaEmitter).y2a = sanitizeEnum;
|
|
996
|
+
protoOf(JavaEmitter).m26 = emitValidator;
|
|
997
997
|
//endregion
|
|
998
998
|
//region block: exports
|
|
999
999
|
export {
|