@flock/wirespec 0.18.0-RC.1 → 0.18.1-RC.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.mjs +12 -12
- package/arrow-arrow-core.mjs +152 -158
- package/arrow-arrow-core.mjs.map +1 -1
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt.mjs +1442 -1442
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +439 -439
- package/kotlin-kotlin-stdlib.mjs +1067 -1131
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +4857 -4857
- package/kotlin-rgxgen.mjs +1793 -1793
- package/kotlinx-io-kotlinx-io-core.mjs +415 -415
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1752 -1752
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1348 -1356
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1303 -1311
- package/mordant-mordant.mjs.map +1 -1
- package/package.json +1 -1
- package/wirespec-src-compiler-core.mjs +1527 -1527
- package/wirespec-src-compiler-emitters-java.mjs +477 -451
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +413 -408
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +379 -378
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +939 -725
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +225 -233
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +558 -589
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +82 -82
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3738 -3708
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +418 -418
- package/wirespec-src-converter-avro.mjs +506 -506
- package/wirespec-src-converter-openapi.mjs +684 -684
- package/wirespec-src-plugin-arguments.mjs +181 -181
- package/wirespec-src-plugin-cli.mjs +106 -106
- package/wirespec-src-plugin-npm.mjs +36 -36
- package/wirespec-src-tools-generator.mjs +34 -34
|
@@ -91,10 +91,10 @@ import {
|
|
|
91
91
|
isInterface3d6p8outrmvmk as isInterface,
|
|
92
92
|
to2cs3ny02qtbcb as to,
|
|
93
93
|
toMap1vec9topfei08 as toMap,
|
|
94
|
+
listOf1jh22dvmctj1r as listOf_0,
|
|
94
95
|
lazy2hsh8ze7j6ikd as lazy,
|
|
95
96
|
firstOrNull1982767dljvdy as firstOrNull_0,
|
|
96
97
|
ensureNotNull1e947j3ixpazm as ensureNotNull,
|
|
97
|
-
listOf1jh22dvmctj1r as listOf_0,
|
|
98
98
|
addAll1k27qatfgp3k5 as addAll,
|
|
99
99
|
equals2au1ep9vhcato as equals,
|
|
100
100
|
initMetadataForObject1cxne3s9w65el as initMetadataForObject,
|
|
@@ -106,8 +106,7 @@ import {
|
|
|
106
106
|
} from './arrow-arrow-core.mjs';
|
|
107
107
|
import {
|
|
108
108
|
Package2tniq694j1763 as Package,
|
|
109
|
-
|
|
110
|
-
Importdjdfxu3pjkxa as Import,
|
|
109
|
+
import5uhkz67bd8tt as import_0,
|
|
111
110
|
File3dimy4iqmuock as File,
|
|
112
111
|
transformChildrend9p91tpcqdkx as transformChildren,
|
|
113
112
|
Companion_getInstance3gvtuyxc9uhxj as Companion_getInstance,
|
|
@@ -120,28 +119,27 @@ import {
|
|
|
120
119
|
rawttvqxl50flj9 as raw,
|
|
121
120
|
Nameoqr8dt2fim9d as Name,
|
|
122
121
|
transformChildren2mszeagj5nq4c as transformChildren_0,
|
|
123
|
-
|
|
122
|
+
sanitizeFieldName1ptgy1kxy8u2m as sanitizeFieldName,
|
|
124
123
|
ConstructorStatement1x4n4sr59iy4n as ConstructorStatement,
|
|
125
124
|
FunctionCall30872kpnbr7op as FunctionCall,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
buildClientServerInterfaces2363tdgi9w3me as buildClientServerInterfaces,
|
|
125
|
+
SanitizationConfig11mmn3p2c03c1 as SanitizationConfig,
|
|
126
|
+
convertClientServer3s89ijty7q130 as convertClientServer,
|
|
129
127
|
convert13xvfhgrf57n5 as convert,
|
|
130
128
|
generateKotlin23t0psnmer03b as generateKotlin,
|
|
131
129
|
RawElement2yts1x2rbem1g as RawElement,
|
|
132
130
|
Constructor3io4sluuia3gk as Constructor,
|
|
133
131
|
Struct39wf79cwtn4ty as Struct,
|
|
134
|
-
|
|
135
|
-
withLabelField22w2j91tp01o3 as withLabelField,
|
|
132
|
+
withLabelField33ehya4zusm70 as withLabelField,
|
|
136
133
|
Enumlszg09mwd24f as Enum,
|
|
137
134
|
Interface3pn84xq686t2r as Interface,
|
|
138
135
|
KotlinGenerator_instance3iknxuxfla2k5 as KotlinGenerator_instance,
|
|
139
136
|
emit3bzdcd0f6nwtj as emit_0,
|
|
140
137
|
withSharedSource1qgrajaccojj3 as withSharedSource,
|
|
141
138
|
emitn3eihixilqyh as emit_1,
|
|
142
|
-
|
|
139
|
+
prependImports32gcj3yb8voha as prependImports,
|
|
140
|
+
placeInPackage1ffljbk9me4ug as placeInPackage,
|
|
143
141
|
convertWithValidation3ar3nbcqsbkpn as convertWithValidation,
|
|
144
|
-
|
|
142
|
+
sanitizeNames2wqmyf8vafp9x as sanitizeNames,
|
|
145
143
|
convert11ert2po54h1y as convert_0,
|
|
146
144
|
convert37aabdzvtv9vg as convert_1,
|
|
147
145
|
convert17zcptkz4mhr4 as convert_2,
|
|
@@ -159,10 +157,10 @@ import {
|
|
|
159
157
|
function emit_3(identifier) {
|
|
160
158
|
var tmp;
|
|
161
159
|
if (identifier instanceof DefinitionIdentifier) {
|
|
162
|
-
tmp = this.
|
|
160
|
+
tmp = this.s1w(identifier);
|
|
163
161
|
} else {
|
|
164
162
|
if (identifier instanceof FieldIdentifier) {
|
|
165
|
-
tmp = this.
|
|
163
|
+
tmp = this.a1w(this.s1w(identifier));
|
|
166
164
|
} else {
|
|
167
165
|
noWhenBranchMatchedException();
|
|
168
166
|
}
|
|
@@ -171,7 +169,7 @@ function emit_3(identifier) {
|
|
|
171
169
|
}
|
|
172
170
|
function sanitize(_this__u8e3s4) {
|
|
173
171
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
174
|
-
var this_0 = split(_this__u8e3s4.
|
|
172
|
+
var this_0 = split(_this__u8e3s4.l1(), ['.', ' ']);
|
|
175
173
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
176
174
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
177
175
|
var index = 0;
|
|
@@ -180,11 +178,11 @@ function sanitize(_this__u8e3s4) {
|
|
|
180
178
|
var item = _iterator__ex2g4s.v();
|
|
181
179
|
var _unary__edvuaz = index;
|
|
182
180
|
index = _unary__edvuaz + 1 | 0;
|
|
183
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
181
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.oq(item) : item;
|
|
184
182
|
destination.x(tmp$ret$0);
|
|
185
183
|
}
|
|
186
184
|
var tmp = asSequence(joinToString(destination, ''));
|
|
187
|
-
return this.
|
|
185
|
+
return this.z1v(joinToString_0(filter(tmp, KotlinIdentifierEmitter$sanitize$lambda), ''));
|
|
188
186
|
}
|
|
189
187
|
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
190
188
|
var tmp;
|
|
@@ -204,18 +202,18 @@ function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
|
204
202
|
return tmp;
|
|
205
203
|
}
|
|
206
204
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
207
|
-
return Companion_getInstance_0().
|
|
205
|
+
return Companion_getInstance_0().f1x_1.u1(_this__u8e3s4) ? addBackticks(_this__u8e3s4) : _this__u8e3s4;
|
|
208
206
|
}
|
|
209
207
|
initMetadataForInterface(KotlinIdentifierEmitter, 'KotlinIdentifierEmitter');
|
|
210
208
|
function emit_4(type, module_0) {
|
|
211
209
|
var tmp;
|
|
212
|
-
if (type.
|
|
213
|
-
tmp = 'data object ' + this.
|
|
210
|
+
if (type.wo_1.so_1.r()) {
|
|
211
|
+
tmp = 'data object ' + this.wq(type.vo_1);
|
|
214
212
|
} else {
|
|
215
|
-
var tmp_0 = this.
|
|
216
|
-
var tmp_1 = this.
|
|
213
|
+
var tmp_0 = this.wq(type.vo_1);
|
|
214
|
+
var tmp_1 = this.vp(type.wo_1);
|
|
217
215
|
// Inline function 'kotlin.run' call
|
|
218
|
-
var $this$run = type.
|
|
216
|
+
var $this$run = type.xo_1;
|
|
219
217
|
var tmp_2;
|
|
220
218
|
if ($this$run.r()) {
|
|
221
219
|
tmp_2 = '';
|
|
@@ -228,18 +226,18 @@ function emit_4(type, module_0) {
|
|
|
228
226
|
return tmp;
|
|
229
227
|
}
|
|
230
228
|
function emit_5(_this__u8e3s4) {
|
|
231
|
-
return dropLast(joinToString(_this__u8e3s4.
|
|
229
|
+
return dropLast(joinToString(_this__u8e3s4.so_1, '\n', VOID, VOID, VOID, VOID, KotlinTypeDefinitionEmitter$emit$lambda_0(this)), 1);
|
|
232
230
|
}
|
|
233
231
|
function emit_6(_this__u8e3s4) {
|
|
234
|
-
return this.
|
|
232
|
+
return this.wq(_this__u8e3s4.ap_1) + ': ' + this.xp(_this__u8e3s4.bp_1);
|
|
235
233
|
}
|
|
236
234
|
function emit_7(_this__u8e3s4) {
|
|
237
235
|
var tmp;
|
|
238
236
|
if (_this__u8e3s4 instanceof Dict) {
|
|
239
|
-
tmp = 'Map<String, ' + this.
|
|
237
|
+
tmp = 'Map<String, ' + this.xp(_this__u8e3s4.co_1) + '>';
|
|
240
238
|
} else {
|
|
241
239
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
242
|
-
tmp = 'List<' + this.
|
|
240
|
+
tmp = 'List<' + this.xp(_this__u8e3s4.zn_1) + '>';
|
|
243
241
|
} else {
|
|
244
242
|
if (_this__u8e3s4 instanceof Unit) {
|
|
245
243
|
tmp = 'Unit';
|
|
@@ -248,17 +246,17 @@ function emit_7(_this__u8e3s4) {
|
|
|
248
246
|
tmp = 'Any';
|
|
249
247
|
} else {
|
|
250
248
|
if (_this__u8e3s4 instanceof Custom) {
|
|
251
|
-
tmp = _this__u8e3s4.
|
|
249
|
+
tmp = _this__u8e3s4.lu_1;
|
|
252
250
|
} else {
|
|
253
251
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
254
|
-
var t = _this__u8e3s4.
|
|
252
|
+
var t = _this__u8e3s4.pu_1;
|
|
255
253
|
var tmp_0;
|
|
256
254
|
if (t instanceof String_0) {
|
|
257
255
|
tmp_0 = 'String';
|
|
258
256
|
} else {
|
|
259
257
|
if (t instanceof Integer) {
|
|
260
258
|
var tmp_1;
|
|
261
|
-
switch (t.
|
|
259
|
+
switch (t.tt_1.b3_1) {
|
|
262
260
|
case 0:
|
|
263
261
|
tmp_1 = 'Int';
|
|
264
262
|
break;
|
|
@@ -273,7 +271,7 @@ function emit_7(_this__u8e3s4) {
|
|
|
273
271
|
} else {
|
|
274
272
|
if (t instanceof Number_0) {
|
|
275
273
|
var tmp_2;
|
|
276
|
-
switch (t.
|
|
274
|
+
switch (t.wt_1.b3_1) {
|
|
277
275
|
case 0:
|
|
278
276
|
tmp_2 = 'Float';
|
|
279
277
|
break;
|
|
@@ -309,15 +307,15 @@ function emit_7(_this__u8e3s4) {
|
|
|
309
307
|
}
|
|
310
308
|
// Inline function 'kotlin.let' call
|
|
311
309
|
var it = tmp;
|
|
312
|
-
return _this__u8e3s4.
|
|
310
|
+
return _this__u8e3s4.du() ? it + '?' : it;
|
|
313
311
|
}
|
|
314
312
|
function emit_8(_this__u8e3s4) {
|
|
315
313
|
var tmp;
|
|
316
314
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
317
|
-
tmp = 'Regex("""' + this.
|
|
315
|
+
tmp = 'Regex("""' + this.zp(_this__u8e3s4.ys_1) + '""").matches(value)';
|
|
318
316
|
} else {
|
|
319
317
|
if (_this__u8e3s4 instanceof Bound) {
|
|
320
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
318
|
+
var tmp1_safe_receiver = _this__u8e3s4.pt_1;
|
|
321
319
|
var tmp_0;
|
|
322
320
|
if (tmp1_safe_receiver == null) {
|
|
323
321
|
tmp_0 = null;
|
|
@@ -326,7 +324,7 @@ function emit_8(_this__u8e3s4) {
|
|
|
326
324
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
327
325
|
}
|
|
328
326
|
var minCheck = tmp_0;
|
|
329
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
327
|
+
var tmp2_safe_receiver = _this__u8e3s4.qt_1;
|
|
330
328
|
var tmp_1;
|
|
331
329
|
if (tmp2_safe_receiver == null) {
|
|
332
330
|
tmp_1 = null;
|
|
@@ -354,7 +352,7 @@ function emit_8(_this__u8e3s4) {
|
|
|
354
352
|
}
|
|
355
353
|
initMetadataForInterface(KotlinTypeDefinitionEmitter, 'KotlinTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, KotlinIdentifierEmitter]);
|
|
356
354
|
function emit_9(channel) {
|
|
357
|
-
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |fun interface ' + this.
|
|
355
|
+
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |fun interface ' + this.wq(channel.mo_1) + ' {\n | operator fun invoke(message: ' + this.xp(channel.no_1) + ')\n |}\n |\n ');
|
|
358
356
|
}
|
|
359
357
|
initMetadataForInterface(KotlinChannelDefinitionEmitter, 'KotlinChannelDefinitionEmitter', VOID, VOID, [KotlinTypeDefinitionEmitter]);
|
|
360
358
|
function emit_10(endpoint) {
|
|
@@ -365,89 +363,89 @@ function emit_10(endpoint) {
|
|
|
365
363
|
var _iterator__ex2g4s = this_0.t();
|
|
366
364
|
while (_iterator__ex2g4s.u()) {
|
|
367
365
|
var item = _iterator__ex2g4s.v();
|
|
368
|
-
var tmp$ret$0 = 'import ' + this.
|
|
366
|
+
var tmp$ret$0 = 'import ' + this.k1v().mr_1 + '.model.' + item.lu_1;
|
|
369
367
|
destination.x(tmp$ret$0);
|
|
370
368
|
}
|
|
371
369
|
var tmp = destination;
|
|
372
370
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda);
|
|
373
|
-
var tmp_1 = this.
|
|
371
|
+
var tmp_1 = this.wq(endpoint.ep_1);
|
|
374
372
|
var tmp_2 = get_pathParams(endpoint);
|
|
375
373
|
var tmp_3 = emitObject$default(this, tmp_2, 'Path', 'Wirespec.Path', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
376
|
-
var tmp_4 = emitObject$default(this, endpoint.
|
|
377
|
-
var tmp_5 = emitObject$default(this, endpoint.
|
|
378
|
-
var tmp_6 = this.
|
|
374
|
+
var tmp_4 = emitObject$default(this, endpoint.hp_1, 'Queries', 'Wirespec.Queries', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
375
|
+
var tmp_5 = emitObject$default(this, endpoint.ip_1, 'Headers', 'Wirespec.Request.Headers', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
376
|
+
var tmp_6 = this.x1v(first(endpoint.jp_1), endpoint);
|
|
379
377
|
var tmp_7 = Spacer_instance.toString();
|
|
380
378
|
var tmp_8 = emitStatusInterfaces(this, endpoint);
|
|
381
379
|
var tmp_9 = emitResponseInterfaces(this, endpoint);
|
|
382
|
-
var tmp_10 = distinctByStatus(endpoint.
|
|
380
|
+
var tmp_10 = distinctByStatus(endpoint.kp_1);
|
|
383
381
|
var tmp_11 = joinToString(tmp_10, '\n\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
384
382
|
var tmp_12 = Spacer_instance.toString();
|
|
385
|
-
var tmp_13 = Spacer_instance.
|
|
386
|
-
var tmp_14 = distinctByStatus(endpoint.
|
|
383
|
+
var tmp_13 = Spacer_instance.qr(2);
|
|
384
|
+
var tmp_14 = distinctByStatus(endpoint.kp_1);
|
|
387
385
|
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_4(this));
|
|
388
|
-
var tmp_16 = Spacer_instance.
|
|
386
|
+
var tmp_16 = Spacer_instance.qr(2);
|
|
389
387
|
var tmp_17 = Spacer_instance.toString();
|
|
390
|
-
var tmp_18 = Spacer_instance.
|
|
388
|
+
var tmp_18 = Spacer_instance.qr(2);
|
|
391
389
|
// Inline function 'kotlin.collections.filter' call
|
|
392
|
-
var tmp0 = distinctByStatus(endpoint.
|
|
390
|
+
var tmp0 = distinctByStatus(endpoint.kp_1);
|
|
393
391
|
// Inline function 'kotlin.collections.filterTo' call
|
|
394
392
|
var destination_0 = ArrayList_init_$Create$_0();
|
|
395
393
|
var _iterator__ex2g4s_0 = tmp0.t();
|
|
396
394
|
while (_iterator__ex2g4s_0.u()) {
|
|
397
395
|
var element = _iterator__ex2g4s_0.v();
|
|
398
|
-
if (Companion_instance_1.
|
|
396
|
+
if (Companion_instance_1.rq(element.qp_1)) {
|
|
399
397
|
destination_0.x(element);
|
|
400
398
|
}
|
|
401
399
|
}
|
|
402
400
|
var tmp_19 = destination_0;
|
|
403
401
|
var tmp_20 = joinToString(tmp_19, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
404
|
-
var tmp_21 = Spacer_instance.
|
|
405
|
-
var tmp_22 = Spacer_instance.
|
|
402
|
+
var tmp_21 = Spacer_instance.qr(3);
|
|
403
|
+
var tmp_22 = Spacer_instance.qr(2);
|
|
406
404
|
var tmp_23 = Spacer_instance.toString();
|
|
407
|
-
var tmp_24 = Spacer_instance.
|
|
408
|
-
var tmp_25 = this.
|
|
409
|
-
var tmp_26 = Spacer_instance.
|
|
410
|
-
var tmp_27 = Spacer_instance.
|
|
411
|
-
return trimMargin('\n |' + tmp_0 + '\n |\n |object ' + tmp_1 + ' : Wirespec.Endpoint {\n |' + tmp_3 + '\n |\n |' + tmp_4 + '\n |\n |' + tmp_5 + '\n |\n |' + tmp_6 + '\n |\n |' + tmp_7 + 'sealed interface Response<T: Any> : Wirespec.Response<T>\n |\n |' + tmp_8 + '\n |\n |' + tmp_9 + '\n |\n |' + tmp_11 + '\n |\n |' + tmp_12 + 'fun toResponse(serialization: Wirespec.Serializer, response: Response<*>): Wirespec.RawResponse =\n |' + tmp_13 + 'when(response) {\n |' + tmp_15 + '\n |' + tmp_16 + '}\n |\n |' + tmp_17 + 'fun fromResponse(serialization: Wirespec.Deserializer, response: Wirespec.RawResponse): Response<*> =\n |' + tmp_18 + 'when (response.statusCode) {\n |' + tmp_20 + '\n |' + tmp_21 + 'else -> error("Cannot match response with status: ${response.statusCode}")\n |' + tmp_22 + '}\n |\n |' + tmp_23 + 'interface Handler: Wirespec.Handler {\n |' + tmp_24 + tmp_25 + '\n |' + tmp_26 + 'companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n |' + tmp_27 + 'override val pathTemplate = "/' + joinToString(endpoint.
|
|
405
|
+
var tmp_24 = Spacer_instance.qr(2);
|
|
406
|
+
var tmp_25 = this.b1w(endpoint);
|
|
407
|
+
var tmp_26 = Spacer_instance.qr(2);
|
|
408
|
+
var tmp_27 = Spacer_instance.qr(3);
|
|
409
|
+
return trimMargin('\n |' + tmp_0 + '\n |\n |object ' + tmp_1 + ' : Wirespec.Endpoint {\n |' + tmp_3 + '\n |\n |' + tmp_4 + '\n |\n |' + tmp_5 + '\n |\n |' + tmp_6 + '\n |\n |' + tmp_7 + 'sealed interface Response<T: Any> : Wirespec.Response<T>\n |\n |' + tmp_8 + '\n |\n |' + tmp_9 + '\n |\n |' + tmp_11 + '\n |\n |' + tmp_12 + 'fun toResponse(serialization: Wirespec.Serializer, response: Response<*>): Wirespec.RawResponse =\n |' + tmp_13 + 'when(response) {\n |' + tmp_15 + '\n |' + tmp_16 + '}\n |\n |' + tmp_17 + 'fun fromResponse(serialization: Wirespec.Deserializer, response: Wirespec.RawResponse): Response<*> =\n |' + tmp_18 + 'when (response.statusCode) {\n |' + tmp_20 + '\n |' + tmp_21 + 'else -> error("Cannot match response with status: ${response.statusCode}")\n |' + tmp_22 + '}\n |\n |' + tmp_23 + 'interface Handler: Wirespec.Handler {\n |' + tmp_24 + tmp_25 + '\n |' + tmp_26 + 'companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n |' + tmp_27 + 'override val pathTemplate = "/' + joinToString(endpoint.gp_1, '/', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_6) + '"\n |' + Spacer_instance.qr(3) + 'override val method = "' + endpoint.fp_1.toString() + '"\n |' + Spacer_instance.qr(3) + 'override fun server(serialization: Wirespec.Serialization) = object : Wirespec.ServerEdge<Request, Response<*>> {\n |' + Spacer_instance.qr(4) + 'override fun from(request: Wirespec.RawRequest) = fromRequest(serialization, request)\n |' + Spacer_instance.qr(4) + 'override fun to(response: Response<*>) = toResponse(serialization, response)\n |' + Spacer_instance.qr(3) + '}\n |' + Spacer_instance.qr(3) + 'override fun client(serialization: Wirespec.Serialization) = object : Wirespec.ClientEdge<Request, Response<*>> {\n |' + Spacer_instance.qr(4) + 'override fun to(request: Request) = toRequest(serialization, request)\n |' + Spacer_instance.qr(4) + 'override fun from(response: Wirespec.RawResponse) = fromResponse(serialization, response)\n |' + Spacer_instance.qr(3) + '}\n |' + Spacer_instance.qr(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
412
410
|
}
|
|
413
411
|
function emitHandleFunction(endpoint) {
|
|
414
|
-
return 'suspend fun ' + Companion_instance_1.
|
|
412
|
+
return 'suspend fun ' + Companion_instance_1.pq(this.wq(endpoint.ep_1)) + '(request: Request): Response<*>';
|
|
415
413
|
}
|
|
416
414
|
function emit_11(_this__u8e3s4, endpoint) {
|
|
417
415
|
var tmp = Spacer_instance.toString();
|
|
418
416
|
var tmp_0 = emitConstructor(this, _this__u8e3s4, endpoint);
|
|
419
|
-
var tmp_1 = Spacer_instance.
|
|
417
|
+
var tmp_1 = Spacer_instance.qr(2);
|
|
420
418
|
var tmp_2 = get_pathParams(endpoint);
|
|
421
419
|
var tmp_3 = brace(this, joinToString(tmp_2, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_7(this)));
|
|
422
|
-
var tmp_4 = Spacer_instance.
|
|
423
|
-
var tmp_5 = Spacer_instance.
|
|
424
|
-
var tmp_6 = brace(this, joinToString(endpoint.
|
|
425
|
-
var tmp_7 = Spacer_instance.
|
|
426
|
-
var tmp_8 = brace(this, joinToString(endpoint.
|
|
427
|
-
var tmp_9 = _this__u8e3s4.
|
|
420
|
+
var tmp_4 = Spacer_instance.qr(2);
|
|
421
|
+
var tmp_5 = Spacer_instance.qr(2);
|
|
422
|
+
var tmp_6 = brace(this, joinToString(endpoint.hp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_8(this)));
|
|
423
|
+
var tmp_7 = Spacer_instance.qr(2);
|
|
424
|
+
var tmp_8 = brace(this, joinToString(endpoint.ip_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_9(this)));
|
|
425
|
+
var tmp_9 = _this__u8e3s4.np_1 == null ? Spacer_instance.qr(2) + 'override val body = Unit\n' + Spacer_instance.toString() + '}' : Spacer_instance.toString() + '}';
|
|
428
426
|
var tmp_10 = Spacer_instance.toString();
|
|
429
|
-
var tmp_11 = Spacer_instance.
|
|
430
|
-
var tmp_12 = Spacer_instance.
|
|
431
|
-
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.
|
|
427
|
+
var tmp_11 = Spacer_instance.qr(2);
|
|
428
|
+
var tmp_12 = Spacer_instance.qr(3);
|
|
429
|
+
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.fp_1.a3_1 + '\n |' + tmp_5 + 'override val queries = Queries' + tmp_6 + '\n |' + tmp_7 + 'override val headers = Headers' + tmp_8 + '\n |' + tmp_9 + '\n |\n |' + tmp_10 + 'fun toRequest(serialization: Wirespec.Serializer, request: Request): Wirespec.RawRequest =\n |' + tmp_11 + 'Wirespec.RawRequest(\n |' + tmp_12 + 'path = listOf(' + joinToString(endpoint.gp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_10(this)) + '),\n |' + Spacer_instance.qr(3) + 'method = request.method.name,\n |' + Spacer_instance.qr(3) + 'queries = ' + this.c1x(endpoint) + ',\n |' + Spacer_instance.qr(3) + 'headers = ' + this.b1x(endpoint) + ',\n |' + Spacer_instance.qr(3) + 'body = ' + (!(_this__u8e3s4.np_1 == null) ? 'serialization.serializeBody(request.body, typeOf<' + emit_16(this, _this__u8e3s4.np_1) + '>())' : 'null') + ',\n |' + Spacer_instance.qr(2) + ')\n |\n |' + Spacer_instance.toString() + 'fun fromRequest(serialization: Wirespec.Deserializer, request: Wirespec.RawRequest): Request =\n |' + Spacer_instance.qr(2) + 'Request' + emitDeserializedParams(this, _this__u8e3s4, endpoint) + '\n ');
|
|
432
430
|
}
|
|
433
431
|
function emitRequestHeaders(_this__u8e3s4) {
|
|
434
432
|
var tmp;
|
|
435
|
-
if (_this__u8e3s4.
|
|
433
|
+
if (_this__u8e3s4.ip_1.r()) {
|
|
436
434
|
tmp = 'emptyMap()';
|
|
437
435
|
} else {
|
|
438
|
-
var tmp_0 = Spacer_instance.
|
|
439
|
-
var tmp_1 = ',\n' + Spacer_instance.
|
|
440
|
-
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.
|
|
436
|
+
var tmp_0 = Spacer_instance.qr(5);
|
|
437
|
+
var tmp_1 = ',\n' + Spacer_instance.qr(5);
|
|
438
|
+
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.ip_1, tmp_1, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitRequestHeaders$lambda(this)) + '\n |' + Spacer_instance.qr(4) + ')\n ');
|
|
441
439
|
}
|
|
442
440
|
return tmp;
|
|
443
441
|
}
|
|
444
442
|
function emitQueries(endpoint) {
|
|
445
443
|
var tmp;
|
|
446
444
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
447
|
-
if (!endpoint.
|
|
448
|
-
var tmp_0 = Spacer_instance.
|
|
449
|
-
var tmp_1 = ',\n' + Spacer_instance.
|
|
450
|
-
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(endpoint.
|
|
445
|
+
if (!endpoint.hp_1.r()) {
|
|
446
|
+
var tmp_0 = Spacer_instance.qr(5);
|
|
447
|
+
var tmp_1 = ',\n' + Spacer_instance.qr(5);
|
|
448
|
+
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(endpoint.hp_1, tmp_1, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitQueries$lambda(this)) + '\n |' + Spacer_instance.qr(4) + ')\n ');
|
|
451
449
|
} else {
|
|
452
450
|
tmp = 'emptyMap()';
|
|
453
451
|
}
|
|
@@ -455,68 +453,68 @@ function emitQueries(endpoint) {
|
|
|
455
453
|
}
|
|
456
454
|
function emit_12(_this__u8e3s4) {
|
|
457
455
|
// Inline function 'kotlin.let' call
|
|
458
|
-
var it = joinToString(_this__u8e3s4.
|
|
456
|
+
var it = joinToString(_this__u8e3s4.rp_1, ', ', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_11(this));
|
|
459
457
|
var responseHeaderFields = isBlank(it) ? '' : ', ' + it;
|
|
460
458
|
var tmp = Spacer_instance.toString();
|
|
461
|
-
var tmp_0 = emit_16(this, _this__u8e3s4.
|
|
462
|
-
var tmp_1 = toString_0(charCodeAt(_this__u8e3s4.
|
|
463
|
-
var tmp_2 = emit_16(this, _this__u8e3s4.
|
|
464
|
-
var tmp_3 = concatGenerics(emit_16(this, _this__u8e3s4.
|
|
465
|
-
var tmp_4 = Spacer_instance.
|
|
466
|
-
var tmp_5 = fixStatus(_this__u8e3s4.
|
|
467
|
-
var tmp_6 = Spacer_instance.
|
|
468
|
-
var tmp_7 = brace(this, joinToString(_this__u8e3s4.
|
|
469
|
-
return trimMargin('\n |' + tmp + 'data class Response' + _this__u8e3s4.
|
|
459
|
+
var tmp_0 = emit_16(this, _this__u8e3s4.sp_1);
|
|
460
|
+
var tmp_1 = toString_0(charCodeAt(_this__u8e3s4.qp_1, 0));
|
|
461
|
+
var tmp_2 = emit_16(this, _this__u8e3s4.sp_1);
|
|
462
|
+
var tmp_3 = concatGenerics(emit_16(this, _this__u8e3s4.sp_1));
|
|
463
|
+
var tmp_4 = Spacer_instance.qr(2);
|
|
464
|
+
var tmp_5 = fixStatus(_this__u8e3s4.qp_1);
|
|
465
|
+
var tmp_6 = Spacer_instance.qr(2);
|
|
466
|
+
var tmp_7 = brace(this, joinToString(_this__u8e3s4.rp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_12(this)));
|
|
467
|
+
return trimMargin('\n |' + tmp + 'data class Response' + _this__u8e3s4.qp_1 + '(override val body: ' + tmp_0 + responseHeaderFields + ') : Response' + tmp_1 + 'XX<' + tmp_2 + '>, Response' + tmp_3 + ' {\n |' + tmp_4 + 'override val status = ' + tmp_5 + '\n |' + tmp_6 + 'override val headers = ResponseHeaders' + tmp_7 + '\n |' + emitObject(this, _this__u8e3s4.rp_1, 'ResponseHeaders', 'Wirespec.Response.Headers', 2, KotlinEndpointDefinitionEmitter$emit$lambda_13(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
470
468
|
}
|
|
471
469
|
function emitBody(_this__u8e3s4, content) {
|
|
472
470
|
return 'serialization.serializeBody(response.body, typeOf<' + emit_16(_this__u8e3s4, content) + '>())';
|
|
473
471
|
}
|
|
474
472
|
function emitHeaders(_this__u8e3s4) {
|
|
475
473
|
var tmp;
|
|
476
|
-
if (_this__u8e3s4.
|
|
474
|
+
if (_this__u8e3s4.rp_1.r()) {
|
|
477
475
|
tmp = 'emptyMap()';
|
|
478
476
|
} else {
|
|
479
|
-
var tmp_0 = Spacer_instance.
|
|
480
|
-
var tmp_1 = ',\n' + Spacer_instance.
|
|
481
|
-
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.
|
|
477
|
+
var tmp_0 = Spacer_instance.qr(5);
|
|
478
|
+
var tmp_1 = ',\n' + Spacer_instance.qr(5);
|
|
479
|
+
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.rp_1, tmp_1, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitHeaders$lambda(this)) + '\n |' + Spacer_instance.qr(4) + ')\n ');
|
|
482
480
|
}
|
|
483
481
|
return tmp;
|
|
484
482
|
}
|
|
485
483
|
initMetadataForInterface(KotlinEndpointDefinitionEmitter, 'KotlinEndpointDefinitionEmitter', VOID, VOID, [KotlinTypeDefinitionEmitter]);
|
|
486
484
|
function emit_13(union) {
|
|
487
|
-
return trimMargin('\n |sealed interface ' + this.
|
|
485
|
+
return trimMargin('\n |sealed interface ' + this.wq(union.qo_1) + '\n |\n ');
|
|
488
486
|
}
|
|
489
487
|
initMetadataForInterface(KotlinUnionDefinitionEmitter, 'KotlinUnionDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
490
488
|
function emit_14(enum_0, module_0) {
|
|
491
|
-
var tmp = this.
|
|
492
|
-
return trimMargin('\n |enum class ' + tmp + ' (override val label: String): Wirespec.Enum {\n |' + spacer(joinToString(enum_0.
|
|
489
|
+
var tmp = this.s1w(enum_0.gr_1);
|
|
490
|
+
return trimMargin('\n |enum class ' + tmp + ' (override val label: String): Wirespec.Enum {\n |' + spacer(joinToString(enum_0.hr_1, ',\n', VOID, VOID, VOID, VOID, KotlinEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'override fun toString(): String {\n |' + Spacer_instance.qr(2) + 'return label\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
493
491
|
}
|
|
494
492
|
initMetadataForInterface(KotlinEnumDefinitionEmitter, 'KotlinEnumDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
495
493
|
function emit_15(refined) {
|
|
496
|
-
return trimMargin('\n |data class ' + this.
|
|
494
|
+
return trimMargin('\n |data class ' + this.s1w(refined.br_1) + '(override val value: ' + this.xp(refined.cr_1) + '): Wirespec.Refined<' + this.xp(refined.cr_1) + '> {\n |' + Spacer_instance.toString() + 'override fun toString() = value.toString()\n |' + Spacer_instance.toString() + 'override fun validate() = ' + this.kr(refined) + '\n |}\n |\n ');
|
|
497
495
|
}
|
|
498
496
|
function emitValidator(_this__u8e3s4) {
|
|
499
497
|
var defaultReturn = 'true';
|
|
500
|
-
var type = _this__u8e3s4.
|
|
498
|
+
var type = _this__u8e3s4.cr_1.pu_1;
|
|
501
499
|
var tmp;
|
|
502
500
|
if (type instanceof Integer) {
|
|
503
|
-
var tmp0_safe_receiver = type.
|
|
504
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
501
|
+
var tmp0_safe_receiver = type.ut_1;
|
|
502
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.yp(tmp0_safe_receiver);
|
|
505
503
|
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
506
504
|
} else {
|
|
507
505
|
if (type instanceof Number_0) {
|
|
508
|
-
var tmp2_safe_receiver = type.
|
|
509
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.
|
|
506
|
+
var tmp2_safe_receiver = type.xt_1;
|
|
507
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.yp(tmp2_safe_receiver);
|
|
510
508
|
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
511
509
|
} else {
|
|
512
510
|
if (type instanceof String_0) {
|
|
513
|
-
var tmp4_safe_receiver = type.
|
|
511
|
+
var tmp4_safe_receiver = type.rt_1;
|
|
514
512
|
var tmp_0;
|
|
515
513
|
var tmp_1 = tmp4_safe_receiver;
|
|
516
514
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
517
515
|
tmp_0 = null;
|
|
518
516
|
} else {
|
|
519
|
-
tmp_0 = this.
|
|
517
|
+
tmp_0 = this.yp(new RegExp_0(tmp4_safe_receiver));
|
|
520
518
|
}
|
|
521
519
|
var tmp5_elvis_lhs = tmp_0;
|
|
522
520
|
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
@@ -536,7 +534,7 @@ function emitValidator(_this__u8e3s4) {
|
|
|
536
534
|
return tmp;
|
|
537
535
|
}
|
|
538
536
|
initMetadataForInterface(KotlinRefinedTypeDefinitionEmitter, 'KotlinRefinedTypeDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter, KotlinTypeDefinitionEmitter]);
|
|
539
|
-
initMetadataForClass(KotlinEmitter, 'KotlinEmitter', KotlinEmitter, LanguageEmitter, [LanguageEmitter, KotlinEndpointDefinitionEmitter, KotlinUnionDefinitionEmitter,
|
|
537
|
+
initMetadataForClass(KotlinEmitter, 'KotlinEmitter', KotlinEmitter, LanguageEmitter, [LanguageEmitter, KotlinEndpointDefinitionEmitter, KotlinChannelDefinitionEmitter, KotlinUnionDefinitionEmitter, KotlinEnumDefinitionEmitter, KotlinIdentifierEmitter, KotlinTypeDefinitionEmitter, KotlinRefinedTypeDefinitionEmitter]);
|
|
540
538
|
initMetadataForCompanion(Companion);
|
|
541
539
|
initMetadataForCompanion(Companion_0);
|
|
542
540
|
initMetadataForClass(KotlinIrEmitter$shared$1);
|
|
@@ -551,7 +549,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
551
549
|
var _iterator__ex2g4s = this_0.t();
|
|
552
550
|
while (_iterator__ex2g4s.u()) {
|
|
553
551
|
var item = _iterator__ex2g4s.v();
|
|
554
|
-
var tmp$ret$0 = 'import ' + $this.
|
|
552
|
+
var tmp$ret$0 = 'import ' + $this.k1v().mr_1 + '.model.' + item.lu_1 + ';';
|
|
555
553
|
destination.x(tmp$ret$0);
|
|
556
554
|
}
|
|
557
555
|
var tmp = destination;
|
|
@@ -564,52 +562,52 @@ function KotlinChannelDefinitionEmitter$emitImports$lambda(it) {
|
|
|
564
562
|
function KotlinChannelDefinitionEmitter() {
|
|
565
563
|
}
|
|
566
564
|
function KotlinEmitter(packageName, emitShared) {
|
|
567
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
568
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
565
|
+
packageName = packageName === VOID ? Companion_instance.lr('community.flock.wirespec.generated') : packageName;
|
|
566
|
+
emitShared = emitShared === VOID ? Companion_instance_0.go() : emitShared;
|
|
569
567
|
LanguageEmitter.call(this);
|
|
570
|
-
this.
|
|
571
|
-
this.
|
|
572
|
-
this.
|
|
573
|
-
this.
|
|
574
|
-
this.
|
|
575
|
-
this.
|
|
576
|
-
}
|
|
577
|
-
protoOf(KotlinEmitter).
|
|
578
|
-
return this.
|
|
568
|
+
this.t1w_1 = packageName;
|
|
569
|
+
this.u1w_1 = emitShared;
|
|
570
|
+
this.v1w_1 = '\nimport community.flock.wirespec.kotlin.Wirespec\nimport kotlin.reflect.typeOf\n';
|
|
571
|
+
this.w1w_1 = FileExtension_Kotlin_getInstance();
|
|
572
|
+
this.x1w_1 = KotlinShared_getInstance();
|
|
573
|
+
this.y1w_1 = '//';
|
|
574
|
+
}
|
|
575
|
+
protoOf(KotlinEmitter).k1v = function () {
|
|
576
|
+
return this.t1w_1;
|
|
577
|
+
};
|
|
578
|
+
protoOf(KotlinEmitter).eq = function () {
|
|
579
|
+
return this.w1w_1;
|
|
579
580
|
};
|
|
580
|
-
protoOf(KotlinEmitter).
|
|
581
|
+
protoOf(KotlinEmitter).t1v = function () {
|
|
581
582
|
return this.x1w_1;
|
|
582
583
|
};
|
|
583
|
-
protoOf(KotlinEmitter).
|
|
584
|
+
protoOf(KotlinEmitter).fq = function () {
|
|
584
585
|
return this.y1w_1;
|
|
585
586
|
};
|
|
586
|
-
protoOf(KotlinEmitter).
|
|
587
|
-
return this.z1w_1;
|
|
588
|
-
};
|
|
589
|
-
protoOf(KotlinEmitter).vq = function (module_0, logger) {
|
|
587
|
+
protoOf(KotlinEmitter).tq = function (module_0, logger) {
|
|
590
588
|
// Inline function 'kotlin.let' call
|
|
591
|
-
var it = protoOf(LanguageEmitter).
|
|
592
|
-
return this.
|
|
589
|
+
var it = protoOf(LanguageEmitter).tq.call(this, module_0, logger);
|
|
590
|
+
return this.u1w_1.ho_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.lr('community.flock.wirespec.kotlin').or() + 'Wirespec', this.t1v().a1x_1)) : it;
|
|
593
591
|
};
|
|
594
|
-
protoOf(KotlinEmitter).
|
|
592
|
+
protoOf(KotlinEmitter).uq = function (definition, module_0, logger) {
|
|
595
593
|
// Inline function 'kotlin.let' call
|
|
596
|
-
var it = protoOf(LanguageEmitter).
|
|
597
|
-
var subPackageName = plus(this.
|
|
598
|
-
var tmp = subPackageName.
|
|
594
|
+
var it = protoOf(LanguageEmitter).uq.call(this, definition, module_0, logger);
|
|
595
|
+
var subPackageName = plus(this.k1v(), definition);
|
|
596
|
+
var tmp = subPackageName.or() + it.io_1;
|
|
599
597
|
// Inline function 'kotlin.text.trimStart' call
|
|
600
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + '\n |' + (Companion_instance_1.
|
|
598
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + '\n |' + (Companion_instance_1.qq(module_0) ? this.v1w_1 : '') + '\n |' + it.jo_1 + '\n ');
|
|
601
599
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
602
600
|
return new Emitted(tmp, tmp$ret$0);
|
|
603
601
|
};
|
|
604
602
|
function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
605
603
|
// Inline function 'kotlin.collections.map' call
|
|
606
|
-
var this_0 = _this__u8e3s4.
|
|
604
|
+
var this_0 = _this__u8e3s4.kp_1;
|
|
607
605
|
// Inline function 'kotlin.collections.mapTo' call
|
|
608
606
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
609
607
|
var _iterator__ex2g4s = this_0.t();
|
|
610
608
|
while (_iterator__ex2g4s.u()) {
|
|
611
609
|
var item = _iterator__ex2g4s.v();
|
|
612
|
-
var tmp$ret$0 = new Char(charCodeAt(item.
|
|
610
|
+
var tmp$ret$0 = new Char(charCodeAt(item.qp_1, 0));
|
|
613
611
|
destination.x(tmp$ret$0);
|
|
614
612
|
}
|
|
615
613
|
var tmp = distinct(destination);
|
|
@@ -617,13 +615,13 @@ function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
|
617
615
|
}
|
|
618
616
|
function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
619
617
|
// Inline function 'kotlin.collections.map' call
|
|
620
|
-
var this_0 = _this__u8e3s4.
|
|
618
|
+
var this_0 = _this__u8e3s4.kp_1;
|
|
621
619
|
// Inline function 'kotlin.collections.mapTo' call
|
|
622
620
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
623
621
|
var _iterator__ex2g4s = this_0.t();
|
|
624
622
|
while (_iterator__ex2g4s.u()) {
|
|
625
623
|
var item = _iterator__ex2g4s.v();
|
|
626
|
-
var tmp$ret$0 = emit_16($this, item.
|
|
624
|
+
var tmp$ret$0 = emit_16($this, item.sp_1);
|
|
627
625
|
destination.x(tmp$ret$0);
|
|
628
626
|
}
|
|
629
627
|
var tmp = distinct(destination);
|
|
@@ -632,64 +630,64 @@ function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
|
632
630
|
function emitConstructor($this, _this__u8e3s4, endpoint) {
|
|
633
631
|
var tmp = get_pathParams(endpoint);
|
|
634
632
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitConstructor$lambda($this)));
|
|
635
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
636
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
637
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
633
|
+
var tmp_1 = orNull(joinToString(endpoint.hp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitConstructor$lambda_0($this)));
|
|
634
|
+
var tmp_2 = orNull(joinToString(endpoint.ip_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitConstructor$lambda_1($this)));
|
|
635
|
+
var tmp0_safe_receiver = _this__u8e3s4.np_1;
|
|
638
636
|
var tmp_3;
|
|
639
637
|
if (tmp0_safe_receiver == null) {
|
|
640
638
|
tmp_3 = null;
|
|
641
639
|
} else {
|
|
642
640
|
// Inline function 'kotlin.let' call
|
|
643
|
-
tmp_3 = Spacer_instance.
|
|
641
|
+
tmp_3 = Spacer_instance.qr(2) + 'override val body: ' + emit_16($this, tmp0_safe_receiver) + ',';
|
|
644
642
|
}
|
|
645
643
|
// Inline function 'kotlin.let' call
|
|
646
644
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
647
|
-
return isBlank(it) ? 'object Request : Wirespec.Request<' + emit_16($this, _this__u8e3s4.
|
|
645
|
+
return isBlank(it) ? 'object Request : Wirespec.Request<' + emit_16($this, _this__u8e3s4.np_1) + '> {' : 'class Request(\n' + it + '\n' + Spacer_instance.toString() + ') : Wirespec.Request<' + emit_16($this, _this__u8e3s4.np_1) + '> {';
|
|
648
646
|
}
|
|
649
647
|
function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
650
648
|
var tmp = get_indexedPathParams(endpoint);
|
|
651
649
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
|
|
652
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
653
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
654
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
650
|
+
var tmp_1 = orNull(joinToString(endpoint.hp_1, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
651
|
+
var tmp_2 = orNull(joinToString(endpoint.ip_1, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
652
|
+
var tmp0_safe_receiver = _this__u8e3s4.np_1;
|
|
655
653
|
var tmp_3;
|
|
656
654
|
if (tmp0_safe_receiver == null) {
|
|
657
655
|
tmp_3 = null;
|
|
658
656
|
} else {
|
|
659
657
|
// Inline function 'kotlin.let' call
|
|
660
|
-
tmp_3 = Spacer_instance.
|
|
658
|
+
tmp_3 = Spacer_instance.qr(3) + 'body = serialization.deserializeBody(requireNotNull(request.body) { "body is null" }, typeOf<' + emit_16($this, tmp0_safe_receiver) + '>()),';
|
|
661
659
|
}
|
|
662
660
|
// Inline function 'kotlin.let' call
|
|
663
661
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
664
|
-
return isBlank(it) ? '' : '(\n' + it + '\n' + Spacer_instance.
|
|
662
|
+
return isBlank(it) ? '' : '(\n' + it + '\n' + Spacer_instance.qr(2) + ')';
|
|
665
663
|
}
|
|
666
664
|
function emitSerialized($this, _this__u8e3s4) {
|
|
667
|
-
return trimMargin('\n |' + Spacer_instance.
|
|
665
|
+
return trimMargin('\n |' + Spacer_instance.qr(3) + 'is Response' + _this__u8e3s4.qp_1 + ' -> Wirespec.RawResponse(\n |' + Spacer_instance.qr(4) + 'statusCode = response.status,\n |' + Spacer_instance.qr(4) + 'headers = ' + $this.e1x(_this__u8e3s4) + ',\n |' + Spacer_instance.qr(4) + 'body = ' + (!(_this__u8e3s4.sp_1 == null) ? $this.d1x($this, _this__u8e3s4.sp_1) : 'null') + ',\n |' + Spacer_instance.qr(3) + ')\n ');
|
|
668
666
|
}
|
|
669
667
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
670
|
-
var tmp = Spacer_instance.
|
|
668
|
+
var tmp = Spacer_instance.qr(3) + _this__u8e3s4.qp_1 + ' -> Response' + _this__u8e3s4.qp_1 + '(';
|
|
671
669
|
var tmp_0;
|
|
672
|
-
if (!(_this__u8e3s4.
|
|
673
|
-
tmp_0 = Spacer_instance.
|
|
670
|
+
if (!(_this__u8e3s4.sp_1 == null)) {
|
|
671
|
+
tmp_0 = Spacer_instance.qr(4) + 'body = serialization.deserializeBody(requireNotNull(response.body) { "body is null" }, typeOf<' + emit_16($this, _this__u8e3s4.sp_1) + '>()),';
|
|
674
672
|
} else {
|
|
675
|
-
tmp_0 = Spacer_instance.
|
|
673
|
+
tmp_0 = Spacer_instance.qr(4) + 'body = Unit,';
|
|
676
674
|
}
|
|
677
675
|
var tmp_1 = tmp_0;
|
|
678
|
-
return joinToString(listOfNotNull([tmp, tmp_1, orNull(joinToString(_this__u8e3s4.
|
|
676
|
+
return joinToString(listOfNotNull([tmp, tmp_1, orNull(joinToString(_this__u8e3s4.rp_1, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserialized$lambda($this))), Spacer_instance.qr(3) + ')']), '\n');
|
|
679
677
|
}
|
|
680
678
|
function emitSerializedMapEntry($this, _this__u8e3s4, type, fields) {
|
|
681
|
-
return '"' + _this__u8e3s4.
|
|
679
|
+
return '"' + _this__u8e3s4.ap_1.l1() + '" to ' + type + '.' + fields + '.' + $this.wq(_this__u8e3s4.ap_1) + '?.let{ serialization.serializeParam(it, typeOf<' + $this.xp(_this__u8e3s4.bp_1) + '>()) }.orEmpty()';
|
|
682
680
|
}
|
|
683
681
|
function emitDeserialized_0($this, _this__u8e3s4) {
|
|
684
|
-
return Spacer_instance.
|
|
682
|
+
return Spacer_instance.qr(3) + $this.wq(_this__u8e3s4.me_1.lp_1) + ' = serialization.deserializePath(request.path[' + _this__u8e3s4.le_1 + '], typeOf<' + $this.xp(_this__u8e3s4.me_1.mp_1) + '>())';
|
|
685
683
|
}
|
|
686
684
|
function emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive) {
|
|
687
|
-
var trimMargin_0 = trimMargin('\n |' + Spacer_instance.
|
|
685
|
+
var trimMargin_0 = trimMargin('\n |' + Spacer_instance.qr(spaces) + $this.wq(_this__u8e3s4.ap_1) + ' =\n |' + Spacer_instance.qr(spaces + 1 | 0) + type + '.' + fields + '\n |' + Spacer_instance.qr(spaces + 2 | 0) + '.entries\n |' + Spacer_instance.qr(spaces + 2 | 0) + '.find { it.key.equals("' + _this__u8e3s4.ap_1.l1() + '", ignoreCase = ' + !caseSensitive + ') }\n |' + Spacer_instance.qr(spaces + 2 | 0) + '?.let { serialization.deserializeParam(it.value, typeOf<' + $this.xp(_this__u8e3s4.bp_1) + '>()) }\n ');
|
|
688
686
|
var tmp;
|
|
689
|
-
if (_this__u8e3s4.
|
|
687
|
+
if (_this__u8e3s4.bp_1.du()) {
|
|
690
688
|
tmp = trimMargin_0;
|
|
691
689
|
} else {
|
|
692
|
-
tmp = trimMargin_0 + '\n' + Spacer_instance.
|
|
690
|
+
tmp = trimMargin_0 + '\n' + Spacer_instance.qr(spaces + 2 | 0) + '?: throw IllegalArgumentException("' + $this.wq(_this__u8e3s4.ap_1) + ' is null")';
|
|
693
691
|
}
|
|
694
692
|
return tmp;
|
|
695
693
|
}
|
|
@@ -699,16 +697,16 @@ function emitDeserializedParams$default($this, _this__u8e3s4, type, fields, spac
|
|
|
699
697
|
return emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive);
|
|
700
698
|
}
|
|
701
699
|
function emitIdentifier($this, _this__u8e3s4) {
|
|
702
|
-
return 'request.path.' + $this.
|
|
700
|
+
return 'request.path.' + $this.wq(_this__u8e3s4.lp_1) + '.let{serialization.serializePath(it, typeOf<' + $this.xp(_this__u8e3s4.mp_1) + '>())}';
|
|
703
701
|
}
|
|
704
702
|
function emit_16($this, _this__u8e3s4) {
|
|
705
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
706
|
-
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : $this.
|
|
703
|
+
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.pp_1;
|
|
704
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : $this.xp(tmp1_safe_receiver);
|
|
707
705
|
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : removeQuestionMark(tmp2_safe_receiver);
|
|
708
706
|
return tmp3_elvis_lhs == null ? 'Unit' : tmp3_elvis_lhs;
|
|
709
707
|
}
|
|
710
708
|
function emit_17($this, _this__u8e3s4) {
|
|
711
|
-
return $this.
|
|
709
|
+
return $this.wq(_this__u8e3s4.lp_1) + ': ' + $this.xp(_this__u8e3s4.mp_1);
|
|
712
710
|
}
|
|
713
711
|
function brace($this, _this__u8e3s4) {
|
|
714
712
|
return wrap($this, _this__u8e3s4, '(', ')');
|
|
@@ -726,10 +724,10 @@ function wrap($this, _this__u8e3s4, prefix, postfix) {
|
|
|
726
724
|
function emitObject($this, _this__u8e3s4, name, extends_0, spaces, block) {
|
|
727
725
|
var tmp;
|
|
728
726
|
if (_this__u8e3s4.r()) {
|
|
729
|
-
tmp = Spacer_instance.
|
|
727
|
+
tmp = Spacer_instance.qr(spaces) + 'data object ' + name + ' : ' + extends_0;
|
|
730
728
|
} else {
|
|
731
|
-
var tmp_0 = Spacer_instance.
|
|
732
|
-
tmp = trimMargin('\n |' + tmp_0 + 'data class ' + name + '(\n |' + joinToString(_this__u8e3s4, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitObject$lambda(spaces, block)) + ',\n |' + Spacer_instance.
|
|
729
|
+
var tmp_0 = Spacer_instance.qr(spaces);
|
|
730
|
+
tmp = trimMargin('\n |' + tmp_0 + 'data class ' + name + '(\n |' + joinToString(_this__u8e3s4, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitObject$lambda(spaces, block)) + ',\n |' + Spacer_instance.qr(spaces) + ') : ' + extends_0 + '\n ');
|
|
733
731
|
}
|
|
734
732
|
return tmp;
|
|
735
733
|
}
|
|
@@ -748,17 +746,17 @@ function KotlinEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
|
748
746
|
}
|
|
749
747
|
function KotlinEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
750
748
|
return function (it) {
|
|
751
|
-
return this$0.
|
|
749
|
+
return this$0.wp(it);
|
|
752
750
|
};
|
|
753
751
|
}
|
|
754
752
|
function KotlinEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
755
753
|
return function (it) {
|
|
756
|
-
return this$0.
|
|
754
|
+
return this$0.wp(it);
|
|
757
755
|
};
|
|
758
756
|
}
|
|
759
757
|
function KotlinEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
760
758
|
return function (it) {
|
|
761
|
-
return this$0.
|
|
759
|
+
return this$0.y1v(it);
|
|
762
760
|
};
|
|
763
761
|
}
|
|
764
762
|
function KotlinEndpointDefinitionEmitter$emit$lambda_4(this$0) {
|
|
@@ -775,31 +773,31 @@ function KotlinEndpointDefinitionEmitter$emit$lambda_6(it) {
|
|
|
775
773
|
return emit(it);
|
|
776
774
|
}
|
|
777
775
|
function KotlinEndpointDefinitionEmitter$emitStatusInterfaces$lambda(it) {
|
|
778
|
-
return Spacer_instance.toString() + 'sealed interface Response' + toString_0(it.
|
|
776
|
+
return Spacer_instance.toString() + 'sealed interface Response' + toString_0(it.h1_1) + 'XX<T: Any> : Response<T>';
|
|
779
777
|
}
|
|
780
778
|
function KotlinEndpointDefinitionEmitter$emitResponseInterfaces$lambda(it) {
|
|
781
779
|
return Spacer_instance.toString() + 'sealed interface Response' + concatGenerics(it) + ' : Response<' + it + '>';
|
|
782
780
|
}
|
|
783
781
|
function KotlinEndpointDefinitionEmitter$emit$lambda_7(this$0) {
|
|
784
782
|
return function (it) {
|
|
785
|
-
return this$0.
|
|
783
|
+
return this$0.wq(it.lp_1);
|
|
786
784
|
};
|
|
787
785
|
}
|
|
788
786
|
function KotlinEndpointDefinitionEmitter$emit$lambda_8(this$0) {
|
|
789
787
|
return function (it) {
|
|
790
|
-
return this$0.
|
|
788
|
+
return this$0.wq(it.ap_1);
|
|
791
789
|
};
|
|
792
790
|
}
|
|
793
791
|
function KotlinEndpointDefinitionEmitter$emit$lambda_9(this$0) {
|
|
794
792
|
return function (it) {
|
|
795
|
-
return this$0.
|
|
793
|
+
return this$0.wq(it.ap_1);
|
|
796
794
|
};
|
|
797
795
|
}
|
|
798
796
|
function KotlinEndpointDefinitionEmitter$emit$lambda_10(this$0) {
|
|
799
797
|
return function (it) {
|
|
800
798
|
var tmp;
|
|
801
799
|
if (it instanceof Literal) {
|
|
802
|
-
tmp = '"' + it.
|
|
800
|
+
tmp = '"' + it.hq_1 + '"';
|
|
803
801
|
} else {
|
|
804
802
|
if (it instanceof Param) {
|
|
805
803
|
tmp = emitIdentifier(this$0, it);
|
|
@@ -822,32 +820,32 @@ function KotlinEndpointDefinitionEmitter$emitQueries$lambda(this$0) {
|
|
|
822
820
|
}
|
|
823
821
|
function KotlinEndpointDefinitionEmitter$emit$lambda_11(this$0) {
|
|
824
822
|
return function (it) {
|
|
825
|
-
return 'val ' + this$0.
|
|
823
|
+
return 'val ' + this$0.wp(it);
|
|
826
824
|
};
|
|
827
825
|
}
|
|
828
826
|
function KotlinEndpointDefinitionEmitter$emit$lambda_12(this$0) {
|
|
829
827
|
return function (it) {
|
|
830
|
-
return this$0.
|
|
828
|
+
return this$0.wq(it.ap_1);
|
|
831
829
|
};
|
|
832
830
|
}
|
|
833
831
|
function KotlinEndpointDefinitionEmitter$emit$lambda_13(this$0) {
|
|
834
832
|
return function (it) {
|
|
835
|
-
return this$0.
|
|
833
|
+
return this$0.wp(it);
|
|
836
834
|
};
|
|
837
835
|
}
|
|
838
836
|
function KotlinEndpointDefinitionEmitter$emitConstructor$lambda(this$0) {
|
|
839
837
|
return function (it) {
|
|
840
|
-
return Spacer_instance.
|
|
838
|
+
return Spacer_instance.qr(2) + emit_17(this$0, it);
|
|
841
839
|
};
|
|
842
840
|
}
|
|
843
841
|
function KotlinEndpointDefinitionEmitter$emitConstructor$lambda_0(this$0) {
|
|
844
842
|
return function (it) {
|
|
845
|
-
return Spacer_instance.
|
|
843
|
+
return Spacer_instance.qr(2) + this$0.wp(it);
|
|
846
844
|
};
|
|
847
845
|
}
|
|
848
846
|
function KotlinEndpointDefinitionEmitter$emitConstructor$lambda_1(this$0) {
|
|
849
847
|
return function (it) {
|
|
850
|
-
return Spacer_instance.
|
|
848
|
+
return Spacer_instance.qr(2) + this$0.wp(it);
|
|
851
849
|
};
|
|
852
850
|
}
|
|
853
851
|
function KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda(this$0) {
|
|
@@ -877,7 +875,7 @@ function KotlinEndpointDefinitionEmitter$emitDeserialized$lambda(this$0) {
|
|
|
877
875
|
}
|
|
878
876
|
function KotlinEndpointDefinitionEmitter$emitObject$lambda($spaces, $block) {
|
|
879
877
|
return function (it) {
|
|
880
|
-
return Spacer_instance.
|
|
878
|
+
return Spacer_instance.qr($spaces + 1 | 0) + 'val ' + $block(it);
|
|
881
879
|
};
|
|
882
880
|
}
|
|
883
881
|
function KotlinEndpointDefinitionEmitter() {
|
|
@@ -886,18 +884,18 @@ function sanitizeNegative($this, _this__u8e3s4) {
|
|
|
886
884
|
return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
|
|
887
885
|
}
|
|
888
886
|
function sanitizeEnum($this, _this__u8e3s4) {
|
|
889
|
-
return $this.
|
|
887
|
+
return $this.z1v(joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_'));
|
|
890
888
|
}
|
|
891
889
|
function KotlinEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
892
890
|
return function (it) {
|
|
893
|
-
return this$0.
|
|
891
|
+
return this$0.a1w(sanitizeEnum(this$0, it)) + '("' + it + '")';
|
|
894
892
|
};
|
|
895
893
|
}
|
|
896
894
|
function KotlinEnumDefinitionEmitter() {
|
|
897
895
|
}
|
|
898
896
|
function Companion() {
|
|
899
897
|
Companion_instance_2 = this;
|
|
900
|
-
this.
|
|
898
|
+
this.f1x_1 = setOf(['as', 'break', 'class', 'continue', 'do', 'else', 'false', 'for', 'fun', 'if', 'in', 'interface', 'internal', 'is', 'null', 'object', 'open', 'package', 'return', 'super', 'this', 'throw', 'true', 'try', 'typealias', 'typeof', 'val', 'var', 'when', 'while', 'private', 'public']);
|
|
901
899
|
}
|
|
902
900
|
var Companion_instance_2;
|
|
903
901
|
function Companion_getInstance_0() {
|
|
@@ -906,7 +904,7 @@ function Companion_getInstance_0() {
|
|
|
906
904
|
return Companion_instance_2;
|
|
907
905
|
}
|
|
908
906
|
function KotlinIdentifierEmitter$sanitize$lambda(it) {
|
|
909
|
-
return isLetterOrDigit(it.
|
|
907
|
+
return isLetterOrDigit(it.h1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).u1(it);
|
|
910
908
|
}
|
|
911
909
|
function KotlinIdentifierEmitter() {
|
|
912
910
|
}
|
|
@@ -914,7 +912,7 @@ function KotlinIrEmitter$shared$o$source$lambda(element, transformer) {
|
|
|
914
912
|
var tmp;
|
|
915
913
|
if (element instanceof File) {
|
|
916
914
|
// Inline function 'kotlin.collections.partition' call
|
|
917
|
-
var this_0 = element.
|
|
915
|
+
var this_0 = element.u1m_1;
|
|
918
916
|
var first = ArrayList_init_$Create$_0();
|
|
919
917
|
var second = ArrayList_init_$Create$_0();
|
|
920
918
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -927,9 +925,9 @@ function KotlinIrEmitter$shared$o$source$lambda(element, transformer) {
|
|
|
927
925
|
}
|
|
928
926
|
}
|
|
929
927
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
930
|
-
var packageElements = _destruct__k2r9zo.
|
|
931
|
-
var rest = _destruct__k2r9zo.
|
|
932
|
-
tmp = element.
|
|
928
|
+
var packageElements = _destruct__k2r9zo.ne();
|
|
929
|
+
var rest = _destruct__k2r9zo.oe();
|
|
930
|
+
tmp = element.x1m(VOID, plus_2(plus_1(packageElements, import_0('kotlin.reflect', 'KType')), rest));
|
|
933
931
|
} else {
|
|
934
932
|
tmp = element;
|
|
935
933
|
}
|
|
@@ -940,11 +938,11 @@ function KotlinIrEmitter$shared$o$source$lambda_0(this$0) {
|
|
|
940
938
|
return function (element, transformer) {
|
|
941
939
|
var tmp;
|
|
942
940
|
if (element instanceof Namespace) {
|
|
943
|
-
var injected = element.
|
|
941
|
+
var injected = element.z1m_1.equals(Companion_getInstance().m1h('Wirespec')) ? this$0.h1x_1 : emptyList();
|
|
944
942
|
var tmp_0;
|
|
945
943
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
946
944
|
if (!injected.r()) {
|
|
947
|
-
tmp_0 = withElements(element, plus_2(element.
|
|
945
|
+
tmp_0 = withElements(element, plus_2(element.v1m(), injected));
|
|
948
946
|
} else {
|
|
949
947
|
tmp_0 = element;
|
|
950
948
|
}
|
|
@@ -957,15 +955,15 @@ function KotlinIrEmitter$shared$o$source$lambda_0(this$0) {
|
|
|
957
955
|
};
|
|
958
956
|
}
|
|
959
957
|
function _get_sanitizationConfig__sns434($this) {
|
|
960
|
-
var tmp0 = $this.
|
|
958
|
+
var tmp0 = $this.o1x_1;
|
|
961
959
|
var tmp = KProperty1;
|
|
962
960
|
// Inline function 'kotlin.getValue' call
|
|
963
961
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, KotlinIrEmitter$_get_sanitizationConfig_$ref_tnafwf(), null);
|
|
964
|
-
return tmp0.
|
|
962
|
+
return tmp0.l1();
|
|
965
963
|
}
|
|
966
964
|
function sanitize_0($this, _this__u8e3s4) {
|
|
967
965
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
968
|
-
var this_0 = split(_this__u8e3s4.
|
|
966
|
+
var this_0 = split(_this__u8e3s4.l1(), ['.', ' ']);
|
|
969
967
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
970
968
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
971
969
|
var index = 0;
|
|
@@ -974,7 +972,7 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
974
972
|
var item = _iterator__ex2g4s.v();
|
|
975
973
|
var _unary__edvuaz = index;
|
|
976
974
|
index = _unary__edvuaz + 1 | 0;
|
|
977
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
975
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.oq(item) : item;
|
|
978
976
|
destination.x(tmp$ret$0);
|
|
979
977
|
}
|
|
980
978
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1022,7 +1020,7 @@ function sanitizeFirstIsDigit_0($this, _this__u8e3s4) {
|
|
|
1022
1020
|
return tmp;
|
|
1023
1021
|
}
|
|
1024
1022
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1025
|
-
return Companion_getInstance_1().
|
|
1023
|
+
return Companion_getInstance_1().q1x_1.u1(_this__u8e3s4) ? addBackticks(_this__u8e3s4) : _this__u8e3s4;
|
|
1026
1024
|
}
|
|
1027
1025
|
function sanitizeSymbol($this, _this__u8e3s4) {
|
|
1028
1026
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
@@ -1035,7 +1033,7 @@ function sanitizeSymbol($this, _this__u8e3s4) {
|
|
|
1035
1033
|
var item = _iterator__ex2g4s.v();
|
|
1036
1034
|
var _unary__edvuaz = index;
|
|
1037
1035
|
index = _unary__edvuaz + 1 | 0;
|
|
1038
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
1036
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.oq(item) : item;
|
|
1039
1037
|
destination.x(tmp$ret$0);
|
|
1040
1038
|
}
|
|
1041
1039
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1068,13 +1066,21 @@ function buildImports($this, _this__u8e3s4) {
|
|
|
1068
1066
|
var _iterator__ex2g4s = this_0.t();
|
|
1069
1067
|
while (_iterator__ex2g4s.u()) {
|
|
1070
1068
|
var e = _iterator__ex2g4s.v();
|
|
1071
|
-
var key = e.
|
|
1069
|
+
var key = e.lu_1;
|
|
1072
1070
|
if (set.x(key)) {
|
|
1073
1071
|
list.x(e);
|
|
1074
1072
|
}
|
|
1075
1073
|
}
|
|
1076
|
-
|
|
1077
|
-
|
|
1074
|
+
// Inline function 'kotlin.collections.map' call
|
|
1075
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1076
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(list, 10));
|
|
1077
|
+
var _iterator__ex2g4s_0 = list.t();
|
|
1078
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
1079
|
+
var item = _iterator__ex2g4s_0.v();
|
|
1080
|
+
var tmp$ret$2 = import_0($this.k1v().mr_1 + '.model', item.lu_1);
|
|
1081
|
+
destination.x(tmp$ret$2);
|
|
1082
|
+
}
|
|
1083
|
+
return destination;
|
|
1078
1084
|
}
|
|
1079
1085
|
function injectCompanionObject($this, _this__u8e3s4, endpoint) {
|
|
1080
1086
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -1083,25 +1089,25 @@ function injectCompanionObject($this, _this__u8e3s4, endpoint) {
|
|
|
1083
1089
|
var tmp = scope;
|
|
1084
1090
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1085
1091
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1086
|
-
var this_0 = scope.
|
|
1092
|
+
var this_0 = scope.z1t_1;
|
|
1087
1093
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1088
1094
|
// Inline function 'kotlin.apply' call
|
|
1089
1095
|
var this_1 = new TransformerBuilder();
|
|
1090
|
-
this_1.
|
|
1091
|
-
var tmp$ret$2 = this_1.
|
|
1092
|
-
tmp.
|
|
1093
|
-
var tmp_0 = scope.
|
|
1096
|
+
this_1.d1h(KotlinIrEmitter$injectCompanionObject$lambda($this, endpoint));
|
|
1097
|
+
var tmp$ret$2 = this_1.e1h();
|
|
1098
|
+
tmp.z1t_1 = transform(this_0, tmp$ret$2);
|
|
1099
|
+
var tmp_0 = scope.z1t_1;
|
|
1094
1100
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1095
1101
|
}
|
|
1096
1102
|
function buildCompanionObject($this, endpoint) {
|
|
1097
|
-
var pathTemplate = '/' + joinToString(endpoint.
|
|
1103
|
+
var pathTemplate = '/' + joinToString(endpoint.gp_1, '/', VOID, VOID, VOID, VOID, KotlinIrEmitter$buildCompanionObject$lambda);
|
|
1098
1104
|
// Inline function 'kotlin.let' call
|
|
1099
|
-
var p0 = trimMargin('\n |companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n | override val pathTemplate = "' + pathTemplate + '"\n | override val method = "' + endpoint.
|
|
1105
|
+
var p0 = trimMargin('\n |companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n | override val pathTemplate = "' + pathTemplate + '"\n | override val method = "' + endpoint.fp_1.toString() + '"\n | override fun server(serialization: Wirespec.Serialization) = object : Wirespec.ServerEdge<Request, Response<*>> {\n | override fun from(request: Wirespec.RawRequest) = fromRawRequest(serialization, request)\n | override fun to(response: Response<*>) = toRawResponse(serialization, response)\n | }\n | override fun client(serialization: Wirespec.Serialization) = object : Wirespec.ClientEdge<Request, Response<*>> {\n | override fun to(request: Request) = toRawRequest(serialization, request)\n | override fun from(response: Wirespec.RawResponse) = fromRawResponse(serialization, response)\n | }\n |}\n ');
|
|
1100
1106
|
return raw(p0);
|
|
1101
1107
|
}
|
|
1102
1108
|
function Companion_0() {
|
|
1103
1109
|
Companion_instance_3 = this;
|
|
1104
|
-
this.
|
|
1110
|
+
this.q1x_1 = setOf(['as', 'break', 'class', 'continue', 'do', 'else', 'false', 'for', 'fun', 'if', 'in', 'interface', 'internal', 'is', 'null', 'object', 'open', 'package', 'return', 'super', 'this', 'throw', 'true', 'try', 'typealias', 'typeof', 'val', 'var', 'when', 'while', 'private', 'public']);
|
|
1105
1111
|
}
|
|
1106
1112
|
var Companion_instance_3;
|
|
1107
1113
|
function Companion_getInstance_1() {
|
|
@@ -1114,13 +1120,13 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
1114
1120
|
}
|
|
1115
1121
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1116
1122
|
return function (name) {
|
|
1117
|
-
var sanitized = name.
|
|
1123
|
+
var sanitized = name.n1h_1.a1() > 1 ? name.r1l() : sanitizeSymbol(this$0, name.s1h());
|
|
1118
1124
|
return new Name(listOf(sanitized));
|
|
1119
1125
|
};
|
|
1120
1126
|
}
|
|
1121
1127
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0) {
|
|
1122
1128
|
return function (name) {
|
|
1123
|
-
return new Name(listOf(sanitizeSymbol(this$0, name.
|
|
1129
|
+
return new Name(listOf(sanitizeSymbol(this$0, name.r1l())));
|
|
1124
1130
|
};
|
|
1125
1131
|
}
|
|
1126
1132
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(this$0) {
|
|
@@ -1133,28 +1139,28 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1133
1139
|
var tmp;
|
|
1134
1140
|
if (stmt instanceof FunctionCall) {
|
|
1135
1141
|
var tmp_0;
|
|
1136
|
-
if (stmt.
|
|
1137
|
-
tmp_0 = transformChildren_0(stmt.
|
|
1142
|
+
if (stmt.b1m_1.s1h() === 'validate') {
|
|
1143
|
+
tmp_0 = transformChildren_0(stmt.f1m(VOID, emptyList()), tr);
|
|
1138
1144
|
} else {
|
|
1139
1145
|
tmp_0 = transformChildren_0(stmt, tr);
|
|
1140
1146
|
}
|
|
1141
1147
|
tmp = tmp_0;
|
|
1142
1148
|
} else {
|
|
1143
1149
|
if (stmt instanceof ConstructorStatement) {
|
|
1144
|
-
var tmp_1 = tr.
|
|
1150
|
+
var tmp_1 = tr.r1t(stmt.p1m_1);
|
|
1145
1151
|
// Inline function 'kotlin.collections.map' call
|
|
1146
|
-
var this_0 = stmt.
|
|
1152
|
+
var this_0 = stmt.q1m_1;
|
|
1147
1153
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1148
1154
|
var destination = ArrayList_init_$Create$(this_0.a1());
|
|
1149
1155
|
// Inline function 'kotlin.collections.iterator' call
|
|
1150
|
-
var _iterator__ex2g4s = this_0.
|
|
1156
|
+
var _iterator__ex2g4s = this_0.j1().t();
|
|
1151
1157
|
while (_iterator__ex2g4s.u()) {
|
|
1152
1158
|
var item = _iterator__ex2g4s.v();
|
|
1153
1159
|
// Inline function 'kotlin.collections.component1' call
|
|
1154
|
-
var name = item.
|
|
1160
|
+
var name = item.k1();
|
|
1155
1161
|
// Inline function 'kotlin.collections.component2' call
|
|
1156
|
-
var expr = item.
|
|
1157
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), name), tr.
|
|
1162
|
+
var expr = item.l1();
|
|
1163
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), name), tr.u1t(expr));
|
|
1158
1164
|
destination.x(tmp$ret$3);
|
|
1159
1165
|
}
|
|
1160
1166
|
tmp = new ConstructorStatement(tmp_1, toMap(destination));
|
|
@@ -1167,7 +1173,7 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1167
1173
|
}
|
|
1168
1174
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1169
1175
|
return function () {
|
|
1170
|
-
var tmp = Companion_getInstance_1().
|
|
1176
|
+
var tmp = Companion_getInstance_1().q1x_1;
|
|
1171
1177
|
var tmp_0 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1172
1178
|
var tmp_1 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
|
|
1173
1179
|
var tmp_2 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
|
|
@@ -1181,49 +1187,49 @@ function KotlinIrEmitter$_get_sanitizationConfig_$ref_tnafwf() {
|
|
|
1181
1187
|
};
|
|
1182
1188
|
}
|
|
1183
1189
|
function KotlinIrEmitter$shared$1() {
|
|
1184
|
-
this.
|
|
1185
|
-
this.
|
|
1190
|
+
this.g1x_1 = 'community.flock.wirespec.kotlin';
|
|
1191
|
+
this.h1x_1 = convertClientServer(new Shared(this.g1x_1));
|
|
1186
1192
|
var tmp = this;
|
|
1187
1193
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1188
|
-
var this_0 = convert(new Shared(this.
|
|
1194
|
+
var this_0 = convert(new Shared(this.g1x_1));
|
|
1189
1195
|
var scope = new TransformScope(this_0);
|
|
1190
1196
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1191
1197
|
var tmp_0 = scope;
|
|
1192
1198
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1193
|
-
var this_1 = scope.
|
|
1199
|
+
var this_1 = scope.z1t_1;
|
|
1194
1200
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1195
1201
|
// Inline function 'kotlin.apply' call
|
|
1196
1202
|
var this_2 = new TransformerBuilder();
|
|
1197
|
-
this_2.
|
|
1198
|
-
var tmp$ret$2 = this_2.
|
|
1199
|
-
tmp_0.
|
|
1203
|
+
this_2.d1h(KotlinIrEmitter$shared$o$source$lambda);
|
|
1204
|
+
var tmp$ret$2 = this_2.e1h();
|
|
1205
|
+
tmp_0.z1t_1 = transform(this_1, tmp$ret$2);
|
|
1200
1206
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1201
1207
|
var tmp_1 = scope;
|
|
1202
1208
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1203
1209
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1204
|
-
var this_3 = scope.
|
|
1210
|
+
var this_3 = scope.z1t_1;
|
|
1205
1211
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1206
1212
|
// Inline function 'kotlin.apply' call
|
|
1207
1213
|
var this_4 = new TransformerBuilder();
|
|
1208
|
-
this_4.
|
|
1209
|
-
var tmp$ret$7 = this_4.
|
|
1210
|
-
tmp_1.
|
|
1211
|
-
var tmp_2 = scope.
|
|
1214
|
+
this_4.d1h(KotlinIrEmitter$shared$o$source$lambda_0(this));
|
|
1215
|
+
var tmp$ret$7 = this_4.e1h();
|
|
1216
|
+
tmp_1.z1t_1 = transform(this_3, tmp$ret$7);
|
|
1217
|
+
var tmp_2 = scope.z1t_1;
|
|
1212
1218
|
var tmp$ret$12 = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1213
|
-
tmp.
|
|
1219
|
+
tmp.i1x_1 = generateKotlin(tmp$ret$12);
|
|
1214
1220
|
}
|
|
1215
|
-
protoOf(KotlinIrEmitter$shared$1).
|
|
1216
|
-
return this.
|
|
1221
|
+
protoOf(KotlinIrEmitter$shared$1).r1w = function () {
|
|
1222
|
+
return this.i1x_1;
|
|
1217
1223
|
};
|
|
1218
1224
|
function KotlinIrEmitter$emit$lambda(this$0) {
|
|
1219
1225
|
return function () {
|
|
1220
|
-
return new File(Companion_getInstance().
|
|
1226
|
+
return new File(Companion_getInstance().m1h(Companion_instance.lr('community.flock.wirespec.kotlin').or() + 'Wirespec'), listOf(new RawElement(this$0.t1v().r1w())));
|
|
1221
1227
|
};
|
|
1222
1228
|
}
|
|
1223
1229
|
function KotlinIrEmitter$emit$lambda_0(element, transformer) {
|
|
1224
1230
|
var tmp;
|
|
1225
1231
|
if (element instanceof Struct) {
|
|
1226
|
-
tmp = element.
|
|
1232
|
+
tmp = element.g1n_1.r() ? element.l1n(VOID, VOID, listOf(new Constructor(emptyList(), emptyList()))) : element;
|
|
1227
1233
|
} else {
|
|
1228
1234
|
tmp = element;
|
|
1229
1235
|
}
|
|
@@ -1239,7 +1245,7 @@ function KotlinIrEmitter$emit$lambda_1(this$0) {
|
|
|
1239
1245
|
return function (element, transformer) {
|
|
1240
1246
|
var tmp;
|
|
1241
1247
|
if (element instanceof Enum) {
|
|
1242
|
-
tmp = withLabelField(element, KotlinIrEmitter$emit$lambda$lambda(this$0)
|
|
1248
|
+
tmp = withLabelField(element, KotlinIrEmitter$emit$lambda$lambda(this$0));
|
|
1243
1249
|
} else {
|
|
1244
1250
|
tmp = element;
|
|
1245
1251
|
}
|
|
@@ -1247,35 +1253,15 @@ function KotlinIrEmitter$emit$lambda_1(this$0) {
|
|
|
1247
1253
|
return transformChildren(transformed, transformer);
|
|
1248
1254
|
};
|
|
1249
1255
|
}
|
|
1250
|
-
function KotlinIrEmitter$emitClient$lambda(this$0) {
|
|
1251
|
-
return function (it) {
|
|
1252
|
-
return 'import ' + this$0.l1v().or_1 + '.model.' + it.nu_1;
|
|
1253
|
-
};
|
|
1254
|
-
}
|
|
1255
|
-
function KotlinIrEmitter$emitClient$lambda_0(this$0) {
|
|
1256
|
-
return function (it) {
|
|
1257
|
-
return 'import ' + this$0.l1v().or_1 + '.endpoint.' + it.gp_1.n1();
|
|
1258
|
-
};
|
|
1259
|
-
}
|
|
1260
|
-
function KotlinIrEmitter$emitClient$lambda_1(this$0) {
|
|
1261
|
-
return function (it) {
|
|
1262
|
-
return 'import ' + this$0.l1v().or_1 + '.client.' + it.gp_1.n1() + 'Client';
|
|
1263
|
-
};
|
|
1264
|
-
}
|
|
1265
|
-
function KotlinIrEmitter$buildImports$lambda(this$0) {
|
|
1266
|
-
return function (it) {
|
|
1267
|
-
return 'import ' + this$0.l1v().or_1 + '.model.' + it.nu_1;
|
|
1268
|
-
};
|
|
1269
|
-
}
|
|
1270
1256
|
function KotlinIrEmitter$injectCompanionObject$lambda(this$0, $endpoint) {
|
|
1271
1257
|
return function (element, transformer) {
|
|
1272
1258
|
var tmp;
|
|
1273
1259
|
if (element instanceof Interface) {
|
|
1274
|
-
var injected = element.
|
|
1260
|
+
var injected = element.m1o_1.equals(Companion_getInstance().m1h('Handler')) ? listOf(buildCompanionObject(this$0, $endpoint)) : emptyList();
|
|
1275
1261
|
var tmp_0;
|
|
1276
1262
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1277
1263
|
if (!injected.r()) {
|
|
1278
|
-
tmp_0 = withElements(element, plus_2(element.
|
|
1264
|
+
tmp_0 = withElements(element, plus_2(element.v1m(), injected));
|
|
1279
1265
|
} else {
|
|
1280
1266
|
tmp_0 = element;
|
|
1281
1267
|
}
|
|
@@ -1290,10 +1276,10 @@ function KotlinIrEmitter$injectCompanionObject$lambda(this$0, $endpoint) {
|
|
|
1290
1276
|
function KotlinIrEmitter$buildCompanionObject$lambda(it) {
|
|
1291
1277
|
var tmp;
|
|
1292
1278
|
if (it instanceof Literal) {
|
|
1293
|
-
tmp = it.
|
|
1279
|
+
tmp = it.hq_1;
|
|
1294
1280
|
} else {
|
|
1295
1281
|
if (it instanceof Param) {
|
|
1296
|
-
tmp = '{' + it.
|
|
1282
|
+
tmp = '{' + it.lp_1.l1() + '}';
|
|
1297
1283
|
} else {
|
|
1298
1284
|
noWhenBranchMatchedException();
|
|
1299
1285
|
}
|
|
@@ -1302,80 +1288,89 @@ function KotlinIrEmitter$buildCompanionObject$lambda(it) {
|
|
|
1302
1288
|
}
|
|
1303
1289
|
function KotlinIrEmitter(packageName, emitShared) {
|
|
1304
1290
|
Companion_getInstance_1();
|
|
1305
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
1306
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
1307
|
-
this.
|
|
1308
|
-
this.
|
|
1309
|
-
this.
|
|
1310
|
-
this.
|
|
1311
|
-
this.
|
|
1291
|
+
packageName = packageName === VOID ? Companion_instance.lr('community.flock.wirespec.generated') : packageName;
|
|
1292
|
+
emitShared = emitShared === VOID ? Companion_instance_0.go() : emitShared;
|
|
1293
|
+
this.j1x_1 = packageName;
|
|
1294
|
+
this.k1x_1 = emitShared;
|
|
1295
|
+
this.l1x_1 = KotlinGenerator_instance;
|
|
1296
|
+
this.m1x_1 = FileExtension_Kotlin_getInstance();
|
|
1297
|
+
this.n1x_1 = listOf_0([import_0('community.flock.wirespec.kotlin', 'Wirespec'), import_0('kotlin.reflect', 'typeOf')]);
|
|
1312
1298
|
var tmp = this;
|
|
1313
|
-
tmp.
|
|
1299
|
+
tmp.o1x_1 = lazy(KotlinIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1314
1300
|
var tmp_0 = this;
|
|
1315
|
-
tmp_0.
|
|
1301
|
+
tmp_0.p1x_1 = new KotlinIrEmitter$shared$1();
|
|
1316
1302
|
}
|
|
1317
|
-
protoOf(KotlinIrEmitter).
|
|
1318
|
-
return this.
|
|
1303
|
+
protoOf(KotlinIrEmitter).k1v = function () {
|
|
1304
|
+
return this.j1x_1;
|
|
1319
1305
|
};
|
|
1320
|
-
protoOf(KotlinIrEmitter).
|
|
1321
|
-
return this.
|
|
1306
|
+
protoOf(KotlinIrEmitter).m1u = function () {
|
|
1307
|
+
return this.l1x_1;
|
|
1322
1308
|
};
|
|
1323
|
-
protoOf(KotlinIrEmitter).
|
|
1324
|
-
return this.
|
|
1309
|
+
protoOf(KotlinIrEmitter).eq = function () {
|
|
1310
|
+
return this.m1x_1;
|
|
1325
1311
|
};
|
|
1326
|
-
protoOf(KotlinIrEmitter).
|
|
1327
|
-
return this.
|
|
1312
|
+
protoOf(KotlinIrEmitter).t1v = function () {
|
|
1313
|
+
return this.p1x_1;
|
|
1328
1314
|
};
|
|
1329
|
-
protoOf(KotlinIrEmitter).
|
|
1315
|
+
protoOf(KotlinIrEmitter).n1u = function (module_0, logger) {
|
|
1330
1316
|
var tmp = emit_0.call(this, module_0, logger);
|
|
1331
|
-
return withSharedSource(tmp, this.
|
|
1317
|
+
return withSharedSource(tmp, this.k1x_1, KotlinIrEmitter$emit$lambda(this));
|
|
1332
1318
|
};
|
|
1333
|
-
protoOf(KotlinIrEmitter).
|
|
1319
|
+
protoOf(KotlinIrEmitter).uq = function (definition, module_0, logger) {
|
|
1334
1320
|
var file = emit_1.call(this, definition, module_0, logger);
|
|
1335
|
-
|
|
1321
|
+
// Inline function 'kotlin.takeIf' call
|
|
1322
|
+
var this_0 = this.n1x_1;
|
|
1323
|
+
var tmp;
|
|
1324
|
+
if (Companion_instance_1.qq(module_0)) {
|
|
1325
|
+
tmp = this_0;
|
|
1326
|
+
} else {
|
|
1327
|
+
tmp = null;
|
|
1328
|
+
}
|
|
1329
|
+
var tmp$ret$1 = tmp;
|
|
1330
|
+
return placeInPackage(prependImports(file, tmp$ret$1), this.k1v(), definition);
|
|
1336
1331
|
};
|
|
1337
|
-
protoOf(KotlinIrEmitter).
|
|
1332
|
+
protoOf(KotlinIrEmitter).up = function (type, module_0) {
|
|
1338
1333
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1339
1334
|
var this_0 = sanitizeNames(convertWithValidation(type, module_0), _get_sanitizationConfig__sns434(this));
|
|
1340
1335
|
var scope = new TransformScope(this_0);
|
|
1341
1336
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1342
1337
|
var tmp = scope;
|
|
1343
1338
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1344
|
-
var this_1 = scope.
|
|
1339
|
+
var this_1 = scope.z1t_1;
|
|
1345
1340
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1346
1341
|
// Inline function 'kotlin.apply' call
|
|
1347
1342
|
var this_2 = new TransformerBuilder();
|
|
1348
|
-
this_2.
|
|
1349
|
-
var tmp$ret$2 = this_2.
|
|
1350
|
-
tmp.
|
|
1351
|
-
var tmp_0 = scope.
|
|
1343
|
+
this_2.d1h(KotlinIrEmitter$emit$lambda_0);
|
|
1344
|
+
var tmp$ret$2 = this_2.e1h();
|
|
1345
|
+
tmp.z1t_1 = transform(this_1, tmp$ret$2);
|
|
1346
|
+
var tmp_0 = scope.z1t_1;
|
|
1352
1347
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1353
1348
|
};
|
|
1354
|
-
protoOf(KotlinIrEmitter).
|
|
1349
|
+
protoOf(KotlinIrEmitter).ir = function (enum_0, module_0) {
|
|
1355
1350
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1356
1351
|
var this_0 = sanitizeNames(convert_0(enum_0), _get_sanitizationConfig__sns434(this));
|
|
1357
1352
|
var scope = new TransformScope(this_0);
|
|
1358
1353
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1359
1354
|
var tmp = scope;
|
|
1360
1355
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1361
|
-
var this_1 = scope.
|
|
1356
|
+
var this_1 = scope.z1t_1;
|
|
1362
1357
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1363
1358
|
// Inline function 'kotlin.apply' call
|
|
1364
1359
|
var this_2 = new TransformerBuilder();
|
|
1365
|
-
this_2.
|
|
1366
|
-
var tmp$ret$2 = this_2.
|
|
1367
|
-
tmp.
|
|
1368
|
-
var tmp_0 = scope.
|
|
1360
|
+
this_2.d1h(KotlinIrEmitter$emit$lambda_1(this));
|
|
1361
|
+
var tmp$ret$2 = this_2.e1h();
|
|
1362
|
+
tmp.z1t_1 = transform(this_1, tmp$ret$2);
|
|
1363
|
+
var tmp_0 = scope.z1t_1;
|
|
1369
1364
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1370
1365
|
};
|
|
1371
|
-
protoOf(KotlinIrEmitter).
|
|
1366
|
+
protoOf(KotlinIrEmitter).yq = function (union) {
|
|
1372
1367
|
return sanitizeNames(convert_1(union), _get_sanitizationConfig__sns434(this));
|
|
1373
1368
|
};
|
|
1374
|
-
protoOf(KotlinIrEmitter).
|
|
1369
|
+
protoOf(KotlinIrEmitter).dr = function (refined) {
|
|
1375
1370
|
var file = sanitizeNames(convert_2(refined), _get_sanitizationConfig__sns434(this));
|
|
1376
1371
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1377
1372
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1378
|
-
var tmp0 = file.
|
|
1373
|
+
var tmp0 = file.v1m();
|
|
1379
1374
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1380
1375
|
var destination = ArrayList_init_$Create$_0();
|
|
1381
1376
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1385,44 +1380,58 @@ protoOf(KotlinIrEmitter).fr = function (refined) {
|
|
|
1385
1380
|
destination.x(element);
|
|
1386
1381
|
}
|
|
1387
1382
|
}
|
|
1388
|
-
var
|
|
1389
|
-
var
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
var
|
|
1397
|
-
var
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
var
|
|
1408
|
-
var
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1383
|
+
var struct = firstOrNull_0(destination);
|
|
1384
|
+
var tmp;
|
|
1385
|
+
if (struct == null) {
|
|
1386
|
+
tmp = null;
|
|
1387
|
+
} else {
|
|
1388
|
+
// Inline function 'kotlin.collections.map' call
|
|
1389
|
+
var this_0 = struct.g1n_1;
|
|
1390
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1391
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1392
|
+
var _iterator__ex2g4s_0 = this_0.t();
|
|
1393
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
1394
|
+
var item = _iterator__ex2g4s_0.v();
|
|
1395
|
+
var tmp$ret$3 = item.q1n(VOID, VOID, true);
|
|
1396
|
+
destination_0.x(tmp$ret$3);
|
|
1397
|
+
}
|
|
1398
|
+
var tmp_0 = destination_0;
|
|
1399
|
+
// Inline function 'kotlin.collections.map' call
|
|
1400
|
+
var this_1 = struct.j1n_1;
|
|
1401
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1402
|
+
var destination_1 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
1403
|
+
var _iterator__ex2g4s_1 = this_1.t();
|
|
1404
|
+
while (_iterator__ex2g4s_1.u()) {
|
|
1405
|
+
var item_0 = _iterator__ex2g4s_1.v();
|
|
1406
|
+
var tmp_1;
|
|
1407
|
+
if (item_0 instanceof Function) {
|
|
1408
|
+
tmp_1 = item_0.b1k(VOID, VOID, VOID, VOID, VOID, VOID, VOID, true);
|
|
1409
|
+
} else {
|
|
1410
|
+
tmp_1 = item_0;
|
|
1411
|
+
}
|
|
1412
|
+
var tmp$ret$6 = tmp_1;
|
|
1413
|
+
destination_1.x(tmp$ret$6);
|
|
1413
1414
|
}
|
|
1414
|
-
|
|
1415
|
-
destination_1.x(tmp$ret$6);
|
|
1415
|
+
tmp = struct.l1n(VOID, tmp_0, VOID, VOID, destination_1);
|
|
1416
1416
|
}
|
|
1417
|
-
var updatedStruct =
|
|
1418
|
-
|
|
1417
|
+
var updatedStruct = tmp;
|
|
1418
|
+
var tmp_2 = Companion_getInstance().m1h(sanitize_0(this, refined.br_1));
|
|
1419
|
+
var tmp_3;
|
|
1420
|
+
if (updatedStruct == null) {
|
|
1421
|
+
tmp_3 = null;
|
|
1422
|
+
} else {
|
|
1423
|
+
// Inline function 'kotlin.let' call
|
|
1424
|
+
tmp_3 = listOf(updatedStruct);
|
|
1425
|
+
}
|
|
1426
|
+
var tmp2_elvis_lhs = tmp_3;
|
|
1427
|
+
return new File(tmp_2, tmp2_elvis_lhs == null ? emptyList() : tmp2_elvis_lhs);
|
|
1419
1428
|
};
|
|
1420
|
-
protoOf(KotlinIrEmitter).
|
|
1429
|
+
protoOf(KotlinIrEmitter).jr = function (endpoint) {
|
|
1421
1430
|
var imports = buildImports(this, endpoint);
|
|
1422
1431
|
var file = convert_3(endpoint);
|
|
1423
1432
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1424
1433
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1425
|
-
var tmp0 = file.
|
|
1434
|
+
var tmp0 = file.v1m();
|
|
1426
1435
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1427
1436
|
var destination = ArrayList_init_$Create$_0();
|
|
1428
1437
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1435,62 +1444,47 @@ protoOf(KotlinIrEmitter).lr = function (endpoint) {
|
|
|
1435
1444
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1436
1445
|
var endpointNamespace = ensureNotNull(tmp$ret$2);
|
|
1437
1446
|
var body = injectCompanionObject(this, endpointNamespace, endpoint);
|
|
1438
|
-
var sanitized = sanitizeNames(new File(Companion_getInstance().
|
|
1447
|
+
var sanitized = sanitizeNames(new File(Companion_getInstance().m1h(sanitize_0(this, endpoint.ep_1)), listOf(body)), _get_sanitizationConfig__sns434(this));
|
|
1439
1448
|
var tmp;
|
|
1440
|
-
// Inline function 'kotlin.
|
|
1441
|
-
if (
|
|
1442
|
-
tmp = sanitized.
|
|
1449
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1450
|
+
if (!imports.r()) {
|
|
1451
|
+
tmp = sanitized.x1m(VOID, plus_2(imports, sanitized.u1m_1));
|
|
1443
1452
|
} else {
|
|
1444
1453
|
tmp = sanitized;
|
|
1445
1454
|
}
|
|
1446
1455
|
return tmp;
|
|
1447
1456
|
};
|
|
1448
|
-
protoOf(KotlinIrEmitter).
|
|
1457
|
+
protoOf(KotlinIrEmitter).xq = function (channel) {
|
|
1449
1458
|
var imports = buildImports(this, channel);
|
|
1450
1459
|
var file = sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1451
1460
|
var tmp;
|
|
1452
|
-
// Inline function 'kotlin.
|
|
1453
|
-
if (
|
|
1454
|
-
tmp = file.
|
|
1461
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1462
|
+
if (!imports.r()) {
|
|
1463
|
+
tmp = file.x1m(VOID, plus_2(imports, file.u1m_1));
|
|
1455
1464
|
} else {
|
|
1456
1465
|
tmp = file;
|
|
1457
1466
|
}
|
|
1458
1467
|
return tmp;
|
|
1459
1468
|
};
|
|
1460
|
-
protoOf(KotlinIrEmitter).
|
|
1469
|
+
protoOf(KotlinIrEmitter).q1u = function (endpoint) {
|
|
1461
1470
|
var imports = buildImports(this, endpoint);
|
|
1462
|
-
var endpointImport =
|
|
1463
|
-
// Inline function 'kotlin.collections.filter' call
|
|
1464
|
-
var tmp0 = listOf_0([imports, endpointImport]);
|
|
1465
|
-
// Inline function 'kotlin.collections.filterTo' call
|
|
1466
|
-
var destination = ArrayList_init_$Create$_0();
|
|
1467
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
1468
|
-
while (_iterator__ex2g4s.u()) {
|
|
1469
|
-
var element = _iterator__ex2g4s.v();
|
|
1470
|
-
// Inline function 'kotlin.text.isNotEmpty' call
|
|
1471
|
-
if (charSequenceLength(element) > 0) {
|
|
1472
|
-
destination.x(element);
|
|
1473
|
-
}
|
|
1474
|
-
}
|
|
1475
|
-
var allImports = joinToString(destination, '\n');
|
|
1471
|
+
var endpointImport = import_0(this.k1v().mr_1 + '.endpoint', endpoint.ep_1.l1());
|
|
1476
1472
|
var file = sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this));
|
|
1477
|
-
var subPackageName = plus_0(this.
|
|
1478
|
-
var tmp = Companion_getInstance().
|
|
1473
|
+
var subPackageName = plus_0(this.k1v(), 'client');
|
|
1474
|
+
var tmp = Companion_getInstance().m1h(subPackageName.or() + file.t1m_1.x1l());
|
|
1479
1475
|
// Inline function 'kotlin.collections.buildList' call
|
|
1480
1476
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1481
1477
|
// Inline function 'kotlin.apply' call
|
|
1482
1478
|
var this_0 = ArrayList_init_$Create$_0();
|
|
1483
|
-
this_0.x(new Package(subPackageName.
|
|
1484
|
-
this_0.
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
var tmp$ret$8 = this_0.o5();
|
|
1491
|
-
return new File(tmp, tmp$ret$8);
|
|
1479
|
+
this_0.x(new Package(subPackageName.mr_1));
|
|
1480
|
+
this_0.e1(this.n1x_1);
|
|
1481
|
+
this_0.e1(imports);
|
|
1482
|
+
this_0.x(endpointImport);
|
|
1483
|
+
this_0.e1(file.u1m_1);
|
|
1484
|
+
var tmp$ret$3 = this_0.o5();
|
|
1485
|
+
return new File(tmp, tmp$ret$3);
|
|
1492
1486
|
};
|
|
1493
|
-
protoOf(KotlinIrEmitter).
|
|
1487
|
+
protoOf(KotlinIrEmitter).p1u = function (endpoints, logger) {
|
|
1494
1488
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1495
1489
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1496
1490
|
var destination = ArrayList_init_$Create$_0();
|
|
@@ -1506,53 +1500,64 @@ protoOf(KotlinIrEmitter).q1u = function (endpoints, logger) {
|
|
|
1506
1500
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1507
1501
|
while (_iterator__ex2g4s_0.u()) {
|
|
1508
1502
|
var e = _iterator__ex2g4s_0.v();
|
|
1509
|
-
var key = e.
|
|
1503
|
+
var key = e.lu_1;
|
|
1510
1504
|
if (set.x(key)) {
|
|
1511
1505
|
list_0.x(e);
|
|
1512
1506
|
}
|
|
1513
1507
|
}
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
var
|
|
1517
|
-
var
|
|
1518
|
-
// Inline function 'kotlin.collections.filter' call
|
|
1519
|
-
var tmp0 = listOf_0([imports, endpointImports, clientImports]);
|
|
1520
|
-
// Inline function 'kotlin.collections.filterTo' call
|
|
1521
|
-
var destination_0 = ArrayList_init_$Create$_0();
|
|
1522
|
-
var _iterator__ex2g4s_1 = tmp0.t();
|
|
1508
|
+
// Inline function 'kotlin.collections.map' call
|
|
1509
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1510
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(list_0, 10));
|
|
1511
|
+
var _iterator__ex2g4s_1 = list_0.t();
|
|
1523
1512
|
while (_iterator__ex2g4s_1.u()) {
|
|
1524
|
-
var
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1513
|
+
var item = _iterator__ex2g4s_1.v();
|
|
1514
|
+
var tmp$ret$5 = import_0(this.k1v().mr_1 + '.model', item.lu_1);
|
|
1515
|
+
destination_0.x(tmp$ret$5);
|
|
1516
|
+
}
|
|
1517
|
+
var imports = destination_0;
|
|
1518
|
+
// Inline function 'kotlin.collections.map' call
|
|
1519
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1520
|
+
var destination_1 = ArrayList_init_$Create$(collectionSizeOrDefault(endpoints, 10));
|
|
1521
|
+
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1522
|
+
while (_iterator__ex2g4s_2.u()) {
|
|
1523
|
+
var item_0 = _iterator__ex2g4s_2.v();
|
|
1524
|
+
var tmp$ret$8 = import_0(this.k1v().mr_1 + '.endpoint', item_0.ep_1.l1());
|
|
1525
|
+
destination_1.x(tmp$ret$8);
|
|
1529
1526
|
}
|
|
1530
|
-
var
|
|
1527
|
+
var endpointImports = destination_1;
|
|
1528
|
+
// Inline function 'kotlin.collections.map' call
|
|
1529
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1530
|
+
var destination_2 = ArrayList_init_$Create$(collectionSizeOrDefault(endpoints, 10));
|
|
1531
|
+
var _iterator__ex2g4s_3 = endpoints.t();
|
|
1532
|
+
while (_iterator__ex2g4s_3.u()) {
|
|
1533
|
+
var item_1 = _iterator__ex2g4s_3.v();
|
|
1534
|
+
var tmp$ret$11 = import_0(this.k1v().mr_1 + '.client', item_1.ep_1.l1() + 'Client');
|
|
1535
|
+
destination_2.x(tmp$ret$11);
|
|
1536
|
+
}
|
|
1537
|
+
var clientImports = destination_2;
|
|
1538
|
+
var allImports = plus_2(plus_2(imports, endpointImports), clientImports);
|
|
1531
1539
|
var file = sanitizeNames(emitClient.call(this, endpoints, logger), _get_sanitizationConfig__sns434(this));
|
|
1532
|
-
var
|
|
1540
|
+
var tmp = Companion_getInstance().m1h(this.k1v().or() + file.t1m_1.x1l());
|
|
1533
1541
|
// Inline function 'kotlin.collections.buildList' call
|
|
1534
1542
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1535
1543
|
// Inline function 'kotlin.apply' call
|
|
1536
1544
|
var this_0 = ArrayList_init_$Create$_0();
|
|
1537
|
-
this_0.x(new Package(this.
|
|
1538
|
-
this_0.
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
this_0.e1(file.r1m_1);
|
|
1544
|
-
var tmp$ret$13 = this_0.o5();
|
|
1545
|
-
return new File(tmp_0, tmp$ret$13);
|
|
1545
|
+
this_0.x(new Package(this.k1v().mr_1));
|
|
1546
|
+
this_0.e1(this.n1x_1);
|
|
1547
|
+
this_0.e1(allImports);
|
|
1548
|
+
this_0.e1(file.u1m_1);
|
|
1549
|
+
var tmp$ret$17 = this_0.o5();
|
|
1550
|
+
return new File(tmp, tmp$ret$17);
|
|
1546
1551
|
};
|
|
1547
1552
|
function KotlinRefinedTypeDefinitionEmitter() {
|
|
1548
1553
|
}
|
|
1549
1554
|
function KotlinShared() {
|
|
1550
1555
|
KotlinShared_instance = this;
|
|
1551
|
-
this.
|
|
1552
|
-
this.
|
|
1556
|
+
this.z1w_1 = 'community.flock.wirespec.kotlin';
|
|
1557
|
+
this.a1x_1 = trimMargin('\n |package ' + this.z1w_1 + '\n |\n |import kotlin.reflect.KType\n |\n |object Wirespec {\n |' + Spacer_instance.toString() + 'interface Enum { val label: String }\n |' + Spacer_instance.toString() + 'interface Endpoint\n |' + Spacer_instance.toString() + 'interface Refined<T> { val value: T }\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: Request<*>, Res: Response<*>> { \n |' + Spacer_instance.toString() + 'fun from(request: RawRequest): Req \n |' + Spacer_instance.toString() + 'fun to(response: Res): RawResponse\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface ClientEdge<Req: Request<*>, Res: Response<*>> { \n |' + Spacer_instance.qr(2) + 'fun to(request: Req): RawRequest\n |' + Spacer_instance.qr(2) + 'fun from(response: RawResponse): Res\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req : Request<*>, Res : Response<*>> {\n |' + Spacer_instance.qr(2) + 'val pathTemplate: String\n |' + Spacer_instance.qr(2) + 'val method: String\n |' + Spacer_instance.qr(2) + 'fun client(serialization: Serialization): ClientEdge<Req, Res>\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Server<Req : Request<*>, Res : Response<*>> {\n |' + Spacer_instance.qr(2) + 'val pathTemplate: String\n |' + Spacer_instance.qr(2) + 'val method: String\n |' + Spacer_instance.qr(2) + 'fun server(serialization: Serialization): ServerEdge<Req, Res>\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'enum class Method { GET, PUT, POST, DELETE, OPTIONS, HEAD, PATCH, TRACE }\n |' + Spacer_instance.toString() + 'interface Request<T : Any> { val path: Path; val method: Method; val queries: Queries; val headers: Headers; val body: T; interface Headers : Wirespec.Headers }\n |' + Spacer_instance.toString() + 'interface Response<T : Any> { val status: Int; val headers: Headers; val body: T; interface Headers : Wirespec.Headers }\n |' + Spacer_instance.toString() + 'interface Serialization : Serializer, Deserializer\n |' + Spacer_instance.toString() + 'interface Serializer : BodySerializer, PathSerializer, ParamSerializer\n |' + Spacer_instance.toString() + 'interface Deserializer : BodyDeserializer, PathDeserializer, ParamDeserializer\n |' + Spacer_instance.toString() + 'interface BodySerialization : BodySerializer, BodyDeserializer\n |' + Spacer_instance.toString() + 'interface BodySerializer { fun <T : Any> serializeBody(t: T, kType: KType): ByteArray }\n |' + Spacer_instance.toString() + 'interface BodyDeserializer { fun <T : Any> deserializeBody(raw: ByteArray, kType: KType): T }\n |' + Spacer_instance.toString() + 'interface PathSerialization : PathSerializer, PathDeserializer\n |' + Spacer_instance.toString() + 'interface PathSerializer { fun <T : Any> serializePath(t: T, kType: KType): String }\n |' + Spacer_instance.toString() + 'interface PathDeserializer { fun <T : Any> deserializePath(raw: String, kType: KType): T }\n |' + Spacer_instance.toString() + 'interface ParamSerialization : ParamSerializer, ParamDeserializer\n |' + Spacer_instance.toString() + 'interface ParamSerializer { fun <T : Any> serializeParam(value: T, kType: KType): List<String> }\n |' + Spacer_instance.toString() + 'interface ParamDeserializer { fun <T : Any> deserializeParam(values: List<String>, kType: KType): T }\n |' + Spacer_instance.toString() + 'data class RawRequest(val method: String, val path: List<String>, val queries: Map<String, List<String>>, val headers: Map<String, List<String>>, val body: ByteArray?) \n |' + Spacer_instance.toString() + 'data class RawResponse(val statusCode: Int, val headers: Map<String, List<String>>, val body: ByteArray?)\n |}\n ');
|
|
1553
1558
|
}
|
|
1554
|
-
protoOf(KotlinShared).
|
|
1555
|
-
return this.
|
|
1559
|
+
protoOf(KotlinShared).r1w = function () {
|
|
1560
|
+
return this.a1x_1;
|
|
1556
1561
|
};
|
|
1557
1562
|
protoOf(KotlinShared).toString = function () {
|
|
1558
1563
|
return 'KotlinShared';
|
|
@@ -1575,12 +1580,12 @@ function KotlinShared_getInstance() {
|
|
|
1575
1580
|
}
|
|
1576
1581
|
function KotlinTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
1577
1582
|
return function (it) {
|
|
1578
|
-
return this$0.
|
|
1583
|
+
return this$0.xp(it);
|
|
1579
1584
|
};
|
|
1580
1585
|
}
|
|
1581
1586
|
function KotlinTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
1582
1587
|
return function (it) {
|
|
1583
|
-
return Spacer_instance.toString() + 'val ' + this$0.
|
|
1588
|
+
return Spacer_instance.toString() + 'val ' + this$0.wp(it) + ',';
|
|
1584
1589
|
};
|
|
1585
1590
|
}
|
|
1586
1591
|
function KotlinTypeDefinitionEmitter() {
|
|
@@ -1588,29 +1593,29 @@ function KotlinTypeDefinitionEmitter() {
|
|
|
1588
1593
|
function KotlinUnionDefinitionEmitter() {
|
|
1589
1594
|
}
|
|
1590
1595
|
//region block: post-declaration
|
|
1591
|
-
protoOf(KotlinEmitter).
|
|
1592
|
-
protoOf(KotlinEmitter).
|
|
1593
|
-
protoOf(KotlinEmitter).
|
|
1594
|
-
protoOf(KotlinEmitter).
|
|
1595
|
-
protoOf(KotlinEmitter).
|
|
1596
|
-
protoOf(KotlinEmitter).
|
|
1597
|
-
protoOf(KotlinEmitter).
|
|
1598
|
-
protoOf(KotlinEmitter).
|
|
1599
|
-
protoOf(KotlinEmitter).
|
|
1600
|
-
protoOf(KotlinEmitter).
|
|
1601
|
-
protoOf(KotlinEmitter).
|
|
1602
|
-
protoOf(KotlinEmitter).
|
|
1603
|
-
protoOf(KotlinEmitter).
|
|
1604
|
-
protoOf(KotlinEmitter).
|
|
1605
|
-
protoOf(KotlinEmitter).
|
|
1606
|
-
protoOf(KotlinEmitter).
|
|
1607
|
-
protoOf(KotlinEmitter).
|
|
1608
|
-
protoOf(KotlinEmitter).
|
|
1609
|
-
protoOf(KotlinEmitter).
|
|
1610
|
-
protoOf(KotlinEmitter).
|
|
1611
|
-
protoOf(KotlinEmitter).
|
|
1612
|
-
protoOf(KotlinEmitter).
|
|
1613
|
-
protoOf(KotlinIrEmitter).
|
|
1596
|
+
protoOf(KotlinEmitter).up = emit_4;
|
|
1597
|
+
protoOf(KotlinEmitter).vp = emit_5;
|
|
1598
|
+
protoOf(KotlinEmitter).wp = emit_6;
|
|
1599
|
+
protoOf(KotlinEmitter).xp = emit_7;
|
|
1600
|
+
protoOf(KotlinEmitter).yp = emit_8;
|
|
1601
|
+
protoOf(KotlinEmitter).ir = emit_14;
|
|
1602
|
+
protoOf(KotlinEmitter).dr = emit_15;
|
|
1603
|
+
protoOf(KotlinEmitter).jr = emit_10;
|
|
1604
|
+
protoOf(KotlinEmitter).yq = emit_13;
|
|
1605
|
+
protoOf(KotlinEmitter).wq = emit_3;
|
|
1606
|
+
protoOf(KotlinEmitter).xq = emit_9;
|
|
1607
|
+
protoOf(KotlinEmitter).x1v = emit_11;
|
|
1608
|
+
protoOf(KotlinEmitter).y1v = emit_12;
|
|
1609
|
+
protoOf(KotlinEmitter).kr = emitValidator;
|
|
1610
|
+
protoOf(KotlinEmitter).s1w = sanitize;
|
|
1611
|
+
protoOf(KotlinEmitter).z1v = sanitizeFirstIsDigit;
|
|
1612
|
+
protoOf(KotlinEmitter).a1w = sanitizeKeywords;
|
|
1613
|
+
protoOf(KotlinEmitter).b1w = emitHandleFunction;
|
|
1614
|
+
protoOf(KotlinEmitter).b1x = emitRequestHeaders;
|
|
1615
|
+
protoOf(KotlinEmitter).c1x = emitQueries;
|
|
1616
|
+
protoOf(KotlinEmitter).d1x = emitBody;
|
|
1617
|
+
protoOf(KotlinEmitter).e1x = emitHeaders;
|
|
1618
|
+
protoOf(KotlinIrEmitter).on = emit_2;
|
|
1614
1619
|
//endregion
|
|
1615
1620
|
//region block: exports
|
|
1616
1621
|
export {
|