@flock/wirespec 0.19.0-RC.2 → 0.19.0-RC.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.mjs +12 -12
- package/arrow-arrow-core.mjs +163 -163
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt.mjs +1570 -1570
- package/colormath-root-colormath.mjs +444 -444
- package/kotest-kotest-property.mjs +605 -1435
- package/kotest-kotest-property.mjs.map +1 -1
- package/kotest-property-arbs.mjs +0 -478
- package/kotest-property-arbs.mjs.map +1 -1
- package/kotlin-kotlin-stdlib.mjs +2478 -2738
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +4926 -4926
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1819 -1819
- package/kotlinx-io-kotlinx-io-core.mjs +440 -440
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1792 -1792
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1395 -1395
- package/mordant-mordant.mjs +1362 -1362
- package/package.json +1 -1
- package/wirespec-src-compiler-core.mjs +1541 -1541
- package/wirespec-src-compiler-emitters-java.mjs +387 -387
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +341 -341
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +371 -371
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +416 -416
- package/wirespec-src-compiler-emitters-scala.mjs +168 -168
- package/wirespec-src-compiler-emitters-typescript.mjs +471 -471
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +87 -87
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3672 -3672
- package/wirespec-src-compiler-lib.mjs +418 -418
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +512 -512
- package/wirespec-src-converter-openapi.mjs +772 -772
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-integration-kotest.mjs +490 -572
- package/wirespec-src-integration-kotest.mjs.map +1 -1
- package/wirespec-src-plugin-arguments.mjs +185 -185
- package/wirespec-src-plugin-cli.mjs +106 -106
- package/wirespec-src-plugin-npm.d.mts +1 -1
- package/wirespec-src-plugin-npm.mjs +40 -40
- package/wirespec-src-tools-generator.mjs +35 -35
|
@@ -170,10 +170,10 @@ import {
|
|
|
170
170
|
function emit_3(identifier) {
|
|
171
171
|
var tmp;
|
|
172
172
|
if (identifier instanceof DefinitionIdentifier) {
|
|
173
|
-
tmp = this.
|
|
173
|
+
tmp = this.v20(identifier);
|
|
174
174
|
} else {
|
|
175
175
|
if (identifier instanceof FieldIdentifier) {
|
|
176
|
-
tmp = this.
|
|
176
|
+
tmp = this.l20(this.v20(identifier));
|
|
177
177
|
} else {
|
|
178
178
|
noWhenBranchMatchedException();
|
|
179
179
|
}
|
|
@@ -182,7 +182,7 @@ function emit_3(identifier) {
|
|
|
182
182
|
}
|
|
183
183
|
function sanitize(_this__u8e3s4) {
|
|
184
184
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
185
|
-
var this_0 = split(_this__u8e3s4.
|
|
185
|
+
var this_0 = split(_this__u8e3s4.m1(), ['.', ' ']);
|
|
186
186
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
187
187
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
188
188
|
var index = 0;
|
|
@@ -191,11 +191,11 @@ function sanitize(_this__u8e3s4) {
|
|
|
191
191
|
var item = _iterator__ex2g4s.v();
|
|
192
192
|
var _unary__edvuaz = index;
|
|
193
193
|
index = _unary__edvuaz + 1 | 0;
|
|
194
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
194
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.mu(item) : item;
|
|
195
195
|
destination.x(tmp$ret$0);
|
|
196
196
|
}
|
|
197
197
|
var tmp = asSequence(joinToString(destination, ''));
|
|
198
|
-
return this.
|
|
198
|
+
return this.k20(joinToString_0(filter(tmp, KotlinIdentifierEmitter$sanitize$lambda), ''));
|
|
199
199
|
}
|
|
200
200
|
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
201
201
|
var tmp;
|
|
@@ -215,18 +215,18 @@ function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
|
215
215
|
return tmp;
|
|
216
216
|
}
|
|
217
217
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
218
|
-
return Companion_getInstance_0().
|
|
218
|
+
return Companion_getInstance_0().i21_1.v1(_this__u8e3s4) ? addBackticks(_this__u8e3s4) : _this__u8e3s4;
|
|
219
219
|
}
|
|
220
220
|
initMetadataForInterface(KotlinIdentifierEmitter, 'KotlinIdentifierEmitter');
|
|
221
221
|
function emit_4(type, module_0) {
|
|
222
222
|
var tmp;
|
|
223
|
-
if (type.
|
|
224
|
-
tmp = 'data object ' + this.
|
|
223
|
+
if (type.us_1.qs_1.r()) {
|
|
224
|
+
tmp = 'data object ' + this.uu(type.ts_1);
|
|
225
225
|
} else {
|
|
226
|
-
var tmp_0 = this.
|
|
227
|
-
var tmp_1 = this.
|
|
226
|
+
var tmp_0 = this.uu(type.ts_1);
|
|
227
|
+
var tmp_1 = this.tt(type.us_1);
|
|
228
228
|
// Inline function 'kotlin.run' call
|
|
229
|
-
var $this$run = type.
|
|
229
|
+
var $this$run = type.vs_1;
|
|
230
230
|
var tmp_2;
|
|
231
231
|
if ($this$run.r()) {
|
|
232
232
|
tmp_2 = '';
|
|
@@ -239,18 +239,18 @@ function emit_4(type, module_0) {
|
|
|
239
239
|
return tmp;
|
|
240
240
|
}
|
|
241
241
|
function emit_5(_this__u8e3s4) {
|
|
242
|
-
return dropLast(joinToString(_this__u8e3s4.
|
|
242
|
+
return dropLast(joinToString(_this__u8e3s4.qs_1, '\n', VOID, VOID, VOID, VOID, KotlinTypeDefinitionEmitter$emit$lambda_0(this)), 1);
|
|
243
243
|
}
|
|
244
244
|
function emit_6(_this__u8e3s4) {
|
|
245
|
-
return this.
|
|
245
|
+
return this.uu(_this__u8e3s4.ys_1) + ': ' + this.vt(_this__u8e3s4.zs_1);
|
|
246
246
|
}
|
|
247
247
|
function emit_7(_this__u8e3s4) {
|
|
248
248
|
var tmp;
|
|
249
249
|
if (_this__u8e3s4 instanceof Dict) {
|
|
250
|
-
tmp = 'Map<String, ' + this.
|
|
250
|
+
tmp = 'Map<String, ' + this.vt(_this__u8e3s4.as_1) + '>';
|
|
251
251
|
} else {
|
|
252
252
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
253
|
-
tmp = 'List<' + this.
|
|
253
|
+
tmp = 'List<' + this.vt(_this__u8e3s4.xr_1) + '>';
|
|
254
254
|
} else {
|
|
255
255
|
if (_this__u8e3s4 instanceof Unit) {
|
|
256
256
|
tmp = 'Unit';
|
|
@@ -259,17 +259,17 @@ function emit_7(_this__u8e3s4) {
|
|
|
259
259
|
tmp = 'Any';
|
|
260
260
|
} else {
|
|
261
261
|
if (_this__u8e3s4 instanceof Custom) {
|
|
262
|
-
tmp = _this__u8e3s4.
|
|
262
|
+
tmp = _this__u8e3s4.iy_1;
|
|
263
263
|
} else {
|
|
264
264
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
265
|
-
var t = _this__u8e3s4.
|
|
265
|
+
var t = _this__u8e3s4.my_1;
|
|
266
266
|
var tmp_0;
|
|
267
267
|
if (t instanceof String_0) {
|
|
268
268
|
tmp_0 = 'String';
|
|
269
269
|
} else {
|
|
270
270
|
if (t instanceof Integer) {
|
|
271
271
|
var tmp_1;
|
|
272
|
-
switch (t.
|
|
272
|
+
switch (t.qx_1.c3_1) {
|
|
273
273
|
case 0:
|
|
274
274
|
tmp_1 = 'Int';
|
|
275
275
|
break;
|
|
@@ -284,7 +284,7 @@ function emit_7(_this__u8e3s4) {
|
|
|
284
284
|
} else {
|
|
285
285
|
if (t instanceof Number_0) {
|
|
286
286
|
var tmp_2;
|
|
287
|
-
switch (t.
|
|
287
|
+
switch (t.tx_1.c3_1) {
|
|
288
288
|
case 0:
|
|
289
289
|
tmp_2 = 'Float';
|
|
290
290
|
break;
|
|
@@ -320,15 +320,15 @@ function emit_7(_this__u8e3s4) {
|
|
|
320
320
|
}
|
|
321
321
|
// Inline function 'kotlin.let' call
|
|
322
322
|
var it = tmp;
|
|
323
|
-
return _this__u8e3s4.
|
|
323
|
+
return _this__u8e3s4.ay() ? it + '?' : it;
|
|
324
324
|
}
|
|
325
325
|
function emit_8(_this__u8e3s4) {
|
|
326
326
|
var tmp;
|
|
327
327
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
328
|
-
tmp = 'Regex("""' + this.
|
|
328
|
+
tmp = 'Regex("""' + this.xt(_this__u8e3s4.ww_1) + '""").matches(value)';
|
|
329
329
|
} else {
|
|
330
330
|
if (_this__u8e3s4 instanceof Bound) {
|
|
331
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
331
|
+
var tmp1_safe_receiver = _this__u8e3s4.mx_1;
|
|
332
332
|
var tmp_0;
|
|
333
333
|
if (tmp1_safe_receiver == null) {
|
|
334
334
|
tmp_0 = null;
|
|
@@ -337,7 +337,7 @@ function emit_8(_this__u8e3s4) {
|
|
|
337
337
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
338
338
|
}
|
|
339
339
|
var minCheck = tmp_0;
|
|
340
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
340
|
+
var tmp2_safe_receiver = _this__u8e3s4.nx_1;
|
|
341
341
|
var tmp_1;
|
|
342
342
|
if (tmp2_safe_receiver == null) {
|
|
343
343
|
tmp_1 = null;
|
|
@@ -365,54 +365,19 @@ function emit_8(_this__u8e3s4) {
|
|
|
365
365
|
}
|
|
366
366
|
initMetadataForInterface(KotlinTypeDefinitionEmitter, 'KotlinTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, KotlinIdentifierEmitter]);
|
|
367
367
|
function emit_9(channel) {
|
|
368
|
-
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |fun interface ' + this.
|
|
368
|
+
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |fun interface ' + this.uu(channel.ks_1) + ' {\n | operator fun invoke(message: ' + this.vt(channel.ls_1) + ')\n |}\n |\n ');
|
|
369
369
|
}
|
|
370
370
|
initMetadataForInterface(KotlinChannelDefinitionEmitter, 'KotlinChannelDefinitionEmitter', VOID, VOID, [KotlinTypeDefinitionEmitter]);
|
|
371
|
-
function emit_10(
|
|
372
|
-
|
|
371
|
+
function emit_10(enum_0, module_0) {
|
|
372
|
+
var tmp = this.v20(enum_0.ev_1);
|
|
373
|
+
return trimMargin('\n |enum class ' + tmp + ' (override val label: String): Wirespec.Enum {\n |' + spacer(joinToString(enum_0.fv_1, ',\n', VOID, VOID, VOID, VOID, KotlinEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'override fun toString(): String {\n |' + Spacer_instance.ov(2) + 'return label\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
373
374
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
var tmp;
|
|
378
|
-
if (type instanceof Integer) {
|
|
379
|
-
var tmp0_safe_receiver = type.jy_1;
|
|
380
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.ou(tmp0_safe_receiver);
|
|
381
|
-
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
382
|
-
} else {
|
|
383
|
-
if (type instanceof Number_0) {
|
|
384
|
-
var tmp2_safe_receiver = type.my_1;
|
|
385
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.ou(tmp2_safe_receiver);
|
|
386
|
-
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
387
|
-
} else {
|
|
388
|
-
if (type instanceof String_0) {
|
|
389
|
-
var tmp4_safe_receiver = type.gy_1;
|
|
390
|
-
var tmp_0;
|
|
391
|
-
var tmp_1 = tmp4_safe_receiver;
|
|
392
|
-
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
393
|
-
tmp_0 = null;
|
|
394
|
-
} else {
|
|
395
|
-
tmp_0 = this.ou(new RegExp_0(tmp4_safe_receiver));
|
|
396
|
-
}
|
|
397
|
-
var tmp5_elvis_lhs = tmp_0;
|
|
398
|
-
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
399
|
-
} else {
|
|
400
|
-
if (equals(type, Boolean_instance)) {
|
|
401
|
-
tmp = defaultReturn;
|
|
402
|
-
} else {
|
|
403
|
-
if (equals(type, Bytes_instance)) {
|
|
404
|
-
tmp = defaultReturn;
|
|
405
|
-
} else {
|
|
406
|
-
noWhenBranchMatchedException();
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
return tmp;
|
|
375
|
+
initMetadataForInterface(KotlinEnumDefinitionEmitter, 'KotlinEnumDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
376
|
+
function emit_11(union) {
|
|
377
|
+
return trimMargin('\n |sealed interface ' + this.uu(union.os_1) + '\n |\n ');
|
|
413
378
|
}
|
|
414
|
-
initMetadataForInterface(
|
|
415
|
-
function
|
|
379
|
+
initMetadataForInterface(KotlinUnionDefinitionEmitter, 'KotlinUnionDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
380
|
+
function emit_12(endpoint) {
|
|
416
381
|
// Inline function 'kotlin.collections.map' call
|
|
417
382
|
var this_0 = importReferences(endpoint);
|
|
418
383
|
// Inline function 'kotlin.collections.mapTo' call
|
|
@@ -420,134 +385,169 @@ function emit_11(endpoint) {
|
|
|
420
385
|
var _iterator__ex2g4s = this_0.t();
|
|
421
386
|
while (_iterator__ex2g4s.u()) {
|
|
422
387
|
var item = _iterator__ex2g4s.v();
|
|
423
|
-
var tmp$ret$0 = 'import ' + this.
|
|
388
|
+
var tmp$ret$0 = 'import ' + this.v1z().kv_1 + '.model.' + item.iy_1;
|
|
424
389
|
destination.x(tmp$ret$0);
|
|
425
390
|
}
|
|
426
391
|
var tmp = destination;
|
|
427
392
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda);
|
|
428
|
-
var tmp_1 = this.
|
|
393
|
+
var tmp_1 = this.uu(endpoint.ct_1);
|
|
429
394
|
var tmp_2 = get_pathParams(endpoint);
|
|
430
395
|
var tmp_3 = emitObject$default(this, tmp_2, 'Path', 'Wirespec.Path', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
431
|
-
var tmp_4 = emitObject$default(this, endpoint.
|
|
432
|
-
var tmp_5 = emitObject$default(this, endpoint.
|
|
433
|
-
var tmp_6 = this.
|
|
396
|
+
var tmp_4 = emitObject$default(this, endpoint.ft_1, 'Queries', 'Wirespec.Queries', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
397
|
+
var tmp_5 = emitObject$default(this, endpoint.gt_1, 'Headers', 'Wirespec.Request.Headers', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
398
|
+
var tmp_6 = this.i20(first(endpoint.ht_1), endpoint);
|
|
434
399
|
var tmp_7 = Spacer_instance.toString();
|
|
435
400
|
var tmp_8 = emitStatusInterfaces(this, endpoint);
|
|
436
401
|
var tmp_9 = emitResponseInterfaces(this, endpoint);
|
|
437
|
-
var tmp_10 = distinctByStatus(endpoint.
|
|
402
|
+
var tmp_10 = distinctByStatus(endpoint.it_1);
|
|
438
403
|
var tmp_11 = joinToString(tmp_10, '\n\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
439
404
|
var tmp_12 = Spacer_instance.toString();
|
|
440
|
-
var tmp_13 = Spacer_instance.
|
|
441
|
-
var tmp_14 = distinctByStatus(endpoint.
|
|
405
|
+
var tmp_13 = Spacer_instance.ov(2);
|
|
406
|
+
var tmp_14 = distinctByStatus(endpoint.it_1);
|
|
442
407
|
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_4(this));
|
|
443
|
-
var tmp_16 = Spacer_instance.
|
|
408
|
+
var tmp_16 = Spacer_instance.ov(2);
|
|
444
409
|
var tmp_17 = Spacer_instance.toString();
|
|
445
|
-
var tmp_18 = Spacer_instance.
|
|
410
|
+
var tmp_18 = Spacer_instance.ov(2);
|
|
446
411
|
// Inline function 'kotlin.collections.filter' call
|
|
447
|
-
var tmp0 = distinctByStatus(endpoint.
|
|
412
|
+
var tmp0 = distinctByStatus(endpoint.it_1);
|
|
448
413
|
// Inline function 'kotlin.collections.filterTo' call
|
|
449
414
|
var destination_0 = ArrayList_init_$Create$_0();
|
|
450
415
|
var _iterator__ex2g4s_0 = tmp0.t();
|
|
451
416
|
while (_iterator__ex2g4s_0.u()) {
|
|
452
417
|
var element = _iterator__ex2g4s_0.v();
|
|
453
|
-
if (Companion_instance_1.
|
|
418
|
+
if (Companion_instance_1.pu(element.ot_1)) {
|
|
454
419
|
destination_0.x(element);
|
|
455
420
|
}
|
|
456
421
|
}
|
|
457
422
|
var tmp_19 = destination_0;
|
|
458
423
|
var tmp_20 = joinToString(tmp_19, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
459
|
-
var tmp_21 = Spacer_instance.
|
|
460
|
-
var tmp_22 = Spacer_instance.
|
|
424
|
+
var tmp_21 = Spacer_instance.ov(3);
|
|
425
|
+
var tmp_22 = Spacer_instance.ov(2);
|
|
461
426
|
var tmp_23 = Spacer_instance.toString();
|
|
462
|
-
var tmp_24 = Spacer_instance.
|
|
463
|
-
var tmp_25 = this.
|
|
464
|
-
var tmp_26 = Spacer_instance.
|
|
465
|
-
var tmp_27 = Spacer_instance.
|
|
466
|
-
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.
|
|
427
|
+
var tmp_24 = Spacer_instance.ov(2);
|
|
428
|
+
var tmp_25 = this.m20(endpoint);
|
|
429
|
+
var tmp_26 = Spacer_instance.ov(2);
|
|
430
|
+
var tmp_27 = Spacer_instance.ov(3);
|
|
431
|
+
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.et_1, '/', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_6) + '"\n |' + Spacer_instance.ov(3) + 'override val method = "' + endpoint.dt_1.toString() + '"\n |' + Spacer_instance.ov(3) + 'override fun server(serialization: Wirespec.Serialization) = object : Wirespec.ServerEdge<Request, Response<*>> {\n |' + Spacer_instance.ov(4) + 'override fun from(request: Wirespec.RawRequest) = fromRequest(serialization, request)\n |' + Spacer_instance.ov(4) + 'override fun to(response: Response<*>) = toResponse(serialization, response)\n |' + Spacer_instance.ov(3) + '}\n |' + Spacer_instance.ov(3) + 'override fun client(serialization: Wirespec.Serialization) = object : Wirespec.ClientEdge<Request, Response<*>> {\n |' + Spacer_instance.ov(4) + 'override fun to(request: Request) = toRequest(serialization, request)\n |' + Spacer_instance.ov(4) + 'override fun from(response: Wirespec.RawResponse) = fromResponse(serialization, response)\n |' + Spacer_instance.ov(3) + '}\n |' + Spacer_instance.ov(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
467
432
|
}
|
|
468
433
|
function emitHandleFunction(endpoint) {
|
|
469
|
-
return 'suspend fun ' + Companion_instance_1.
|
|
434
|
+
return 'suspend fun ' + Companion_instance_1.nu(this.uu(endpoint.ct_1)) + '(request: Request): Response<*>';
|
|
470
435
|
}
|
|
471
|
-
function
|
|
436
|
+
function emit_13(_this__u8e3s4, endpoint) {
|
|
472
437
|
var tmp = Spacer_instance.toString();
|
|
473
438
|
var tmp_0 = emitConstructor(this, _this__u8e3s4, endpoint);
|
|
474
|
-
var tmp_1 = Spacer_instance.
|
|
439
|
+
var tmp_1 = Spacer_instance.ov(2);
|
|
475
440
|
var tmp_2 = get_pathParams(endpoint);
|
|
476
441
|
var tmp_3 = brace(this, joinToString(tmp_2, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_7(this)));
|
|
477
|
-
var tmp_4 = Spacer_instance.
|
|
478
|
-
var tmp_5 = Spacer_instance.
|
|
479
|
-
var tmp_6 = brace(this, joinToString(endpoint.
|
|
480
|
-
var tmp_7 = Spacer_instance.
|
|
481
|
-
var tmp_8 = brace(this, joinToString(endpoint.
|
|
482
|
-
var tmp_9 = _this__u8e3s4.
|
|
442
|
+
var tmp_4 = Spacer_instance.ov(2);
|
|
443
|
+
var tmp_5 = Spacer_instance.ov(2);
|
|
444
|
+
var tmp_6 = brace(this, joinToString(endpoint.ft_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_8(this)));
|
|
445
|
+
var tmp_7 = Spacer_instance.ov(2);
|
|
446
|
+
var tmp_8 = brace(this, joinToString(endpoint.gt_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_9(this)));
|
|
447
|
+
var tmp_9 = _this__u8e3s4.lt_1 == null ? Spacer_instance.ov(2) + 'override val body = Unit\n' + Spacer_instance.toString() + '}' : Spacer_instance.toString() + '}';
|
|
483
448
|
var tmp_10 = Spacer_instance.toString();
|
|
484
|
-
var tmp_11 = Spacer_instance.
|
|
485
|
-
var tmp_12 = Spacer_instance.
|
|
486
|
-
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.
|
|
449
|
+
var tmp_11 = Spacer_instance.ov(2);
|
|
450
|
+
var tmp_12 = Spacer_instance.ov(3);
|
|
451
|
+
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.dt_1.b3_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.et_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_10(this)) + '),\n |' + Spacer_instance.ov(3) + 'method = request.method.name,\n |' + Spacer_instance.ov(3) + 'queries = ' + this.f21(endpoint) + ',\n |' + Spacer_instance.ov(3) + 'headers = ' + this.e21(endpoint) + ',\n |' + Spacer_instance.ov(3) + 'body = ' + (!(_this__u8e3s4.lt_1 == null) ? 'serialization.serializeBody(request.body, typeOf<' + emit_16(this, _this__u8e3s4.lt_1) + '>())' : 'null') + ',\n |' + Spacer_instance.ov(2) + ')\n |\n |' + Spacer_instance.toString() + 'fun fromRequest(serialization: Wirespec.Deserializer, request: Wirespec.RawRequest): Request =\n |' + Spacer_instance.ov(2) + 'Request' + emitDeserializedParams(this, _this__u8e3s4, endpoint) + '\n ');
|
|
487
452
|
}
|
|
488
453
|
function emitRequestHeaders(_this__u8e3s4) {
|
|
489
454
|
var tmp;
|
|
490
|
-
if (_this__u8e3s4.
|
|
455
|
+
if (_this__u8e3s4.gt_1.r()) {
|
|
491
456
|
tmp = 'emptyMap()';
|
|
492
457
|
} else {
|
|
493
|
-
var tmp_0 = Spacer_instance.
|
|
494
|
-
var tmp_1 = ',\n' + Spacer_instance.
|
|
495
|
-
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.
|
|
458
|
+
var tmp_0 = Spacer_instance.ov(5);
|
|
459
|
+
var tmp_1 = ',\n' + Spacer_instance.ov(5);
|
|
460
|
+
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.gt_1, tmp_1, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitRequestHeaders$lambda(this)) + '\n |' + Spacer_instance.ov(4) + ')\n ');
|
|
496
461
|
}
|
|
497
462
|
return tmp;
|
|
498
463
|
}
|
|
499
464
|
function emitQueries(endpoint) {
|
|
500
465
|
var tmp;
|
|
501
466
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
502
|
-
if (!endpoint.
|
|
503
|
-
var tmp_0 = Spacer_instance.
|
|
504
|
-
var tmp_1 = ',\n' + Spacer_instance.
|
|
505
|
-
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(endpoint.
|
|
467
|
+
if (!endpoint.ft_1.r()) {
|
|
468
|
+
var tmp_0 = Spacer_instance.ov(5);
|
|
469
|
+
var tmp_1 = ',\n' + Spacer_instance.ov(5);
|
|
470
|
+
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(endpoint.ft_1, tmp_1, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitQueries$lambda(this)) + '\n |' + Spacer_instance.ov(4) + ')\n ');
|
|
506
471
|
} else {
|
|
507
472
|
tmp = 'emptyMap()';
|
|
508
473
|
}
|
|
509
474
|
return tmp;
|
|
510
475
|
}
|
|
511
|
-
function
|
|
476
|
+
function emit_14(_this__u8e3s4) {
|
|
512
477
|
// Inline function 'kotlin.let' call
|
|
513
|
-
var it = joinToString(_this__u8e3s4.
|
|
478
|
+
var it = joinToString(_this__u8e3s4.pt_1, ', ', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_11(this));
|
|
514
479
|
var responseHeaderFields = isBlank(it) ? '' : ', ' + it;
|
|
515
480
|
var tmp = Spacer_instance.toString();
|
|
516
|
-
var tmp_0 = emit_16(this, _this__u8e3s4.
|
|
517
|
-
var tmp_1 = toString_0(charCodeAt(_this__u8e3s4.
|
|
518
|
-
var tmp_2 = emit_16(this, _this__u8e3s4.
|
|
519
|
-
var tmp_3 = concatGenerics(emit_16(this, _this__u8e3s4.
|
|
520
|
-
var tmp_4 = Spacer_instance.
|
|
521
|
-
var tmp_5 = fixStatus(_this__u8e3s4.
|
|
522
|
-
var tmp_6 = Spacer_instance.
|
|
523
|
-
var tmp_7 = brace(this, joinToString(_this__u8e3s4.
|
|
524
|
-
return trimMargin('\n |' + tmp + 'data class Response' + _this__u8e3s4.
|
|
481
|
+
var tmp_0 = emit_16(this, _this__u8e3s4.qt_1);
|
|
482
|
+
var tmp_1 = toString_0(charCodeAt(_this__u8e3s4.ot_1, 0));
|
|
483
|
+
var tmp_2 = emit_16(this, _this__u8e3s4.qt_1);
|
|
484
|
+
var tmp_3 = concatGenerics(emit_16(this, _this__u8e3s4.qt_1));
|
|
485
|
+
var tmp_4 = Spacer_instance.ov(2);
|
|
486
|
+
var tmp_5 = fixStatus(_this__u8e3s4.ot_1);
|
|
487
|
+
var tmp_6 = Spacer_instance.ov(2);
|
|
488
|
+
var tmp_7 = brace(this, joinToString(_this__u8e3s4.pt_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_12(this)));
|
|
489
|
+
return trimMargin('\n |' + tmp + 'data class Response' + _this__u8e3s4.ot_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.pt_1, 'ResponseHeaders', 'Wirespec.Response.Headers', 2, KotlinEndpointDefinitionEmitter$emit$lambda_13(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
525
490
|
}
|
|
526
491
|
function emitBody(_this__u8e3s4, content) {
|
|
527
492
|
return 'serialization.serializeBody(response.body, typeOf<' + emit_16(_this__u8e3s4, content) + '>())';
|
|
528
493
|
}
|
|
529
494
|
function emitHeaders(_this__u8e3s4) {
|
|
530
495
|
var tmp;
|
|
531
|
-
if (_this__u8e3s4.
|
|
496
|
+
if (_this__u8e3s4.pt_1.r()) {
|
|
532
497
|
tmp = 'emptyMap()';
|
|
533
498
|
} else {
|
|
534
|
-
var tmp_0 = Spacer_instance.
|
|
535
|
-
var tmp_1 = ',\n' + Spacer_instance.
|
|
536
|
-
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.
|
|
499
|
+
var tmp_0 = Spacer_instance.ov(5);
|
|
500
|
+
var tmp_1 = ',\n' + Spacer_instance.ov(5);
|
|
501
|
+
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.pt_1, tmp_1, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitHeaders$lambda(this)) + '\n |' + Spacer_instance.ov(4) + ')\n ');
|
|
537
502
|
}
|
|
538
503
|
return tmp;
|
|
539
504
|
}
|
|
540
505
|
initMetadataForInterface(KotlinEndpointDefinitionEmitter, 'KotlinEndpointDefinitionEmitter', VOID, VOID, [KotlinTypeDefinitionEmitter]);
|
|
541
|
-
function
|
|
542
|
-
return trimMargin('\n |
|
|
506
|
+
function emit_15(refined) {
|
|
507
|
+
return trimMargin('\n |data class ' + this.v20(refined.zu_1) + '(override val value: ' + this.vt(refined.av_1) + '): Wirespec.Refined<' + this.vt(refined.av_1) + '> {\n |' + Spacer_instance.toString() + 'override fun toString() = value.toString()\n |' + Spacer_instance.toString() + 'override fun validate() = ' + this.iv(refined) + '\n |}\n |\n ');
|
|
543
508
|
}
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
var
|
|
547
|
-
|
|
509
|
+
function emitValidator(_this__u8e3s4) {
|
|
510
|
+
var defaultReturn = 'true';
|
|
511
|
+
var type = _this__u8e3s4.av_1.my_1;
|
|
512
|
+
var tmp;
|
|
513
|
+
if (type instanceof Integer) {
|
|
514
|
+
var tmp0_safe_receiver = type.rx_1;
|
|
515
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.wt(tmp0_safe_receiver);
|
|
516
|
+
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
517
|
+
} else {
|
|
518
|
+
if (type instanceof Number_0) {
|
|
519
|
+
var tmp2_safe_receiver = type.ux_1;
|
|
520
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.wt(tmp2_safe_receiver);
|
|
521
|
+
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
522
|
+
} else {
|
|
523
|
+
if (type instanceof String_0) {
|
|
524
|
+
var tmp4_safe_receiver = type.ox_1;
|
|
525
|
+
var tmp_0;
|
|
526
|
+
var tmp_1 = tmp4_safe_receiver;
|
|
527
|
+
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
528
|
+
tmp_0 = null;
|
|
529
|
+
} else {
|
|
530
|
+
tmp_0 = this.wt(new RegExp_0(tmp4_safe_receiver));
|
|
531
|
+
}
|
|
532
|
+
var tmp5_elvis_lhs = tmp_0;
|
|
533
|
+
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
534
|
+
} else {
|
|
535
|
+
if (equals(type, Boolean_instance)) {
|
|
536
|
+
tmp = defaultReturn;
|
|
537
|
+
} else {
|
|
538
|
+
if (equals(type, Bytes_instance)) {
|
|
539
|
+
tmp = defaultReturn;
|
|
540
|
+
} else {
|
|
541
|
+
noWhenBranchMatchedException();
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
return tmp;
|
|
548
548
|
}
|
|
549
|
-
initMetadataForInterface(
|
|
550
|
-
initMetadataForClass(KotlinEmitter, 'KotlinEmitter', KotlinEmitter, LanguageEmitter, [LanguageEmitter,
|
|
549
|
+
initMetadataForInterface(KotlinRefinedTypeDefinitionEmitter, 'KotlinRefinedTypeDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter, KotlinTypeDefinitionEmitter]);
|
|
550
|
+
initMetadataForClass(KotlinEmitter, 'KotlinEmitter', KotlinEmitter, LanguageEmitter, [LanguageEmitter, KotlinEnumDefinitionEmitter, KotlinUnionDefinitionEmitter, KotlinTypeDefinitionEmitter, KotlinChannelDefinitionEmitter, KotlinEndpointDefinitionEmitter, KotlinIdentifierEmitter, KotlinRefinedTypeDefinitionEmitter]);
|
|
551
551
|
initMetadataForCompanion(Companion);
|
|
552
552
|
initMetadataForCompanion(Companion_0);
|
|
553
553
|
initMetadataForClass(KotlinIrEmitter, 'KotlinIrEmitter', KotlinIrEmitter, VOID, [IrEmitter]);
|
|
@@ -561,7 +561,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
561
561
|
var _iterator__ex2g4s = this_0.t();
|
|
562
562
|
while (_iterator__ex2g4s.u()) {
|
|
563
563
|
var item = _iterator__ex2g4s.v();
|
|
564
|
-
var tmp$ret$0 = 'import ' + $this.
|
|
564
|
+
var tmp$ret$0 = 'import ' + $this.v1z().kv_1 + '.model.' + item.iy_1 + ';';
|
|
565
565
|
destination.x(tmp$ret$0);
|
|
566
566
|
}
|
|
567
567
|
var tmp = destination;
|
|
@@ -574,52 +574,52 @@ function KotlinChannelDefinitionEmitter$emitImports$lambda(it) {
|
|
|
574
574
|
function KotlinChannelDefinitionEmitter() {
|
|
575
575
|
}
|
|
576
576
|
function KotlinEmitter(packageName, emitShared) {
|
|
577
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
578
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
577
|
+
packageName = packageName === VOID ? Companion_instance.jv('community.flock.wirespec.generated') : packageName;
|
|
578
|
+
emitShared = emitShared === VOID ? Companion_instance_0.es() : emitShared;
|
|
579
579
|
LanguageEmitter.call(this);
|
|
580
|
-
this.
|
|
581
|
-
this.
|
|
582
|
-
this.
|
|
583
|
-
this.
|
|
584
|
-
this.
|
|
585
|
-
this.
|
|
586
|
-
}
|
|
587
|
-
protoOf(KotlinEmitter).
|
|
588
|
-
return this.
|
|
580
|
+
this.w20_1 = packageName;
|
|
581
|
+
this.x20_1 = emitShared;
|
|
582
|
+
this.y20_1 = '\nimport community.flock.wirespec.kotlin.Wirespec\nimport kotlin.reflect.typeOf\n';
|
|
583
|
+
this.z20_1 = FileExtension_Kotlin_getInstance();
|
|
584
|
+
this.a21_1 = KotlinShared_getInstance();
|
|
585
|
+
this.b21_1 = '//';
|
|
586
|
+
}
|
|
587
|
+
protoOf(KotlinEmitter).v1z = function () {
|
|
588
|
+
return this.w20_1;
|
|
589
589
|
};
|
|
590
|
-
protoOf(KotlinEmitter).
|
|
591
|
-
return this.
|
|
590
|
+
protoOf(KotlinEmitter).cu = function () {
|
|
591
|
+
return this.z20_1;
|
|
592
592
|
};
|
|
593
|
-
protoOf(KotlinEmitter).
|
|
594
|
-
return this.
|
|
593
|
+
protoOf(KotlinEmitter).e20 = function () {
|
|
594
|
+
return this.a21_1;
|
|
595
595
|
};
|
|
596
|
-
protoOf(KotlinEmitter).
|
|
597
|
-
return this.
|
|
596
|
+
protoOf(KotlinEmitter).du = function () {
|
|
597
|
+
return this.b21_1;
|
|
598
598
|
};
|
|
599
|
-
protoOf(KotlinEmitter).
|
|
599
|
+
protoOf(KotlinEmitter).ru = function (module_0, logger) {
|
|
600
600
|
// Inline function 'kotlin.let' call
|
|
601
|
-
var it = protoOf(LanguageEmitter).
|
|
602
|
-
return this.
|
|
601
|
+
var it = protoOf(LanguageEmitter).ru.call(this, module_0, logger);
|
|
602
|
+
return this.x20_1.fs_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.jv('community.flock.wirespec.kotlin').mv() + 'Wirespec', this.e20().d21_1)) : it;
|
|
603
603
|
};
|
|
604
|
-
protoOf(KotlinEmitter).
|
|
604
|
+
protoOf(KotlinEmitter).su = function (definition, module_0, logger) {
|
|
605
605
|
// Inline function 'kotlin.let' call
|
|
606
|
-
var it = protoOf(LanguageEmitter).
|
|
607
|
-
var subPackageName = plus(this.
|
|
608
|
-
var tmp = subPackageName.
|
|
606
|
+
var it = protoOf(LanguageEmitter).su.call(this, definition, module_0, logger);
|
|
607
|
+
var subPackageName = plus(this.v1z(), definition);
|
|
608
|
+
var tmp = subPackageName.mv() + it.gs_1;
|
|
609
609
|
// Inline function 'kotlin.text.trimStart' call
|
|
610
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + '\n |' + (Companion_instance_1.
|
|
610
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + '\n |' + (Companion_instance_1.ou(module_0) ? this.y20_1 : '') + '\n |' + it.hs_1 + '\n ');
|
|
611
611
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
612
612
|
return new Emitted(tmp, tmp$ret$0);
|
|
613
613
|
};
|
|
614
614
|
function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
615
615
|
// Inline function 'kotlin.collections.map' call
|
|
616
|
-
var this_0 = _this__u8e3s4.
|
|
616
|
+
var this_0 = _this__u8e3s4.it_1;
|
|
617
617
|
// Inline function 'kotlin.collections.mapTo' call
|
|
618
618
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
619
619
|
var _iterator__ex2g4s = this_0.t();
|
|
620
620
|
while (_iterator__ex2g4s.u()) {
|
|
621
621
|
var item = _iterator__ex2g4s.v();
|
|
622
|
-
var tmp$ret$0 = new Char(charCodeAt(item.
|
|
622
|
+
var tmp$ret$0 = new Char(charCodeAt(item.ot_1, 0));
|
|
623
623
|
destination.x(tmp$ret$0);
|
|
624
624
|
}
|
|
625
625
|
var tmp = distinct(destination);
|
|
@@ -627,13 +627,13 @@ function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
|
627
627
|
}
|
|
628
628
|
function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
629
629
|
// Inline function 'kotlin.collections.map' call
|
|
630
|
-
var this_0 = _this__u8e3s4.
|
|
630
|
+
var this_0 = _this__u8e3s4.it_1;
|
|
631
631
|
// Inline function 'kotlin.collections.mapTo' call
|
|
632
632
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
633
633
|
var _iterator__ex2g4s = this_0.t();
|
|
634
634
|
while (_iterator__ex2g4s.u()) {
|
|
635
635
|
var item = _iterator__ex2g4s.v();
|
|
636
|
-
var tmp$ret$0 = emit_16($this, item.
|
|
636
|
+
var tmp$ret$0 = emit_16($this, item.qt_1);
|
|
637
637
|
destination.x(tmp$ret$0);
|
|
638
638
|
}
|
|
639
639
|
var tmp = distinct(destination);
|
|
@@ -642,64 +642,64 @@ function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
|
642
642
|
function emitConstructor($this, _this__u8e3s4, endpoint) {
|
|
643
643
|
var tmp = get_pathParams(endpoint);
|
|
644
644
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitConstructor$lambda($this)));
|
|
645
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
646
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
647
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
645
|
+
var tmp_1 = orNull(joinToString(endpoint.ft_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitConstructor$lambda_0($this)));
|
|
646
|
+
var tmp_2 = orNull(joinToString(endpoint.gt_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitConstructor$lambda_1($this)));
|
|
647
|
+
var tmp0_safe_receiver = _this__u8e3s4.lt_1;
|
|
648
648
|
var tmp_3;
|
|
649
649
|
if (tmp0_safe_receiver == null) {
|
|
650
650
|
tmp_3 = null;
|
|
651
651
|
} else {
|
|
652
652
|
// Inline function 'kotlin.let' call
|
|
653
|
-
tmp_3 = Spacer_instance.
|
|
653
|
+
tmp_3 = Spacer_instance.ov(2) + 'override val body: ' + emit_16($this, tmp0_safe_receiver) + ',';
|
|
654
654
|
}
|
|
655
655
|
// Inline function 'kotlin.let' call
|
|
656
656
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
657
|
-
return isBlank(it) ? 'object Request : Wirespec.Request<' + emit_16($this, _this__u8e3s4.
|
|
657
|
+
return isBlank(it) ? 'object Request : Wirespec.Request<' + emit_16($this, _this__u8e3s4.lt_1) + '> {' : 'class Request(\n' + it + '\n' + Spacer_instance.toString() + ') : Wirespec.Request<' + emit_16($this, _this__u8e3s4.lt_1) + '> {';
|
|
658
658
|
}
|
|
659
659
|
function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
660
660
|
var tmp = get_indexedPathParams(endpoint);
|
|
661
661
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
|
|
662
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
663
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
664
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
662
|
+
var tmp_1 = orNull(joinToString(endpoint.ft_1, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
663
|
+
var tmp_2 = orNull(joinToString(endpoint.gt_1, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
664
|
+
var tmp0_safe_receiver = _this__u8e3s4.lt_1;
|
|
665
665
|
var tmp_3;
|
|
666
666
|
if (tmp0_safe_receiver == null) {
|
|
667
667
|
tmp_3 = null;
|
|
668
668
|
} else {
|
|
669
669
|
// Inline function 'kotlin.let' call
|
|
670
|
-
tmp_3 = Spacer_instance.
|
|
670
|
+
tmp_3 = Spacer_instance.ov(3) + 'body = serialization.deserializeBody(requireNotNull(request.body) { "body is null" }, typeOf<' + emit_16($this, tmp0_safe_receiver) + '>()),';
|
|
671
671
|
}
|
|
672
672
|
// Inline function 'kotlin.let' call
|
|
673
673
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
674
|
-
return isBlank(it) ? '' : '(\n' + it + '\n' + Spacer_instance.
|
|
674
|
+
return isBlank(it) ? '' : '(\n' + it + '\n' + Spacer_instance.ov(2) + ')';
|
|
675
675
|
}
|
|
676
676
|
function emitSerialized($this, _this__u8e3s4) {
|
|
677
|
-
return trimMargin('\n |' + Spacer_instance.
|
|
677
|
+
return trimMargin('\n |' + Spacer_instance.ov(3) + 'is Response' + _this__u8e3s4.ot_1 + ' -> Wirespec.RawResponse(\n |' + Spacer_instance.ov(4) + 'statusCode = response.status,\n |' + Spacer_instance.ov(4) + 'headers = ' + $this.h21(_this__u8e3s4) + ',\n |' + Spacer_instance.ov(4) + 'body = ' + (!(_this__u8e3s4.qt_1 == null) ? $this.g21($this, _this__u8e3s4.qt_1) : 'null') + ',\n |' + Spacer_instance.ov(3) + ')\n ');
|
|
678
678
|
}
|
|
679
679
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
680
|
-
var tmp = Spacer_instance.
|
|
680
|
+
var tmp = Spacer_instance.ov(3) + _this__u8e3s4.ot_1 + ' -> Response' + _this__u8e3s4.ot_1 + '(';
|
|
681
681
|
var tmp_0;
|
|
682
|
-
if (!(_this__u8e3s4.
|
|
683
|
-
tmp_0 = Spacer_instance.
|
|
682
|
+
if (!(_this__u8e3s4.qt_1 == null)) {
|
|
683
|
+
tmp_0 = Spacer_instance.ov(4) + 'body = serialization.deserializeBody(requireNotNull(response.body) { "body is null" }, typeOf<' + emit_16($this, _this__u8e3s4.qt_1) + '>()),';
|
|
684
684
|
} else {
|
|
685
|
-
tmp_0 = Spacer_instance.
|
|
685
|
+
tmp_0 = Spacer_instance.ov(4) + 'body = Unit,';
|
|
686
686
|
}
|
|
687
687
|
var tmp_1 = tmp_0;
|
|
688
|
-
return joinToString(listOfNotNull([tmp, tmp_1, orNull(joinToString(_this__u8e3s4.
|
|
688
|
+
return joinToString(listOfNotNull([tmp, tmp_1, orNull(joinToString(_this__u8e3s4.pt_1, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserialized$lambda($this))), Spacer_instance.ov(3) + ')']), '\n');
|
|
689
689
|
}
|
|
690
690
|
function emitSerializedMapEntry($this, _this__u8e3s4, type, fields) {
|
|
691
|
-
return '"' + _this__u8e3s4.
|
|
691
|
+
return '"' + _this__u8e3s4.ys_1.m1() + '" to ' + type + '.' + fields + '.' + $this.uu(_this__u8e3s4.ys_1) + '?.let{ serialization.serializeParam(it, typeOf<' + $this.vt(_this__u8e3s4.zs_1) + '>()) }.orEmpty()';
|
|
692
692
|
}
|
|
693
693
|
function emitDeserialized_0($this, _this__u8e3s4) {
|
|
694
|
-
return Spacer_instance.
|
|
694
|
+
return Spacer_instance.ov(3) + $this.uu(_this__u8e3s4.jf_1.jt_1) + ' = serialization.deserializePath(request.path[' + _this__u8e3s4.if_1 + '], typeOf<' + $this.vt(_this__u8e3s4.jf_1.kt_1) + '>())';
|
|
695
695
|
}
|
|
696
696
|
function emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive) {
|
|
697
|
-
var trimMargin_0 = trimMargin('\n |' + Spacer_instance.
|
|
697
|
+
var trimMargin_0 = trimMargin('\n |' + Spacer_instance.ov(spaces) + $this.uu(_this__u8e3s4.ys_1) + ' =\n |' + Spacer_instance.ov(spaces + 1 | 0) + type + '.' + fields + '\n |' + Spacer_instance.ov(spaces + 2 | 0) + '.entries\n |' + Spacer_instance.ov(spaces + 2 | 0) + '.find { it.key.equals("' + _this__u8e3s4.ys_1.m1() + '", ignoreCase = ' + !caseSensitive + ') }\n |' + Spacer_instance.ov(spaces + 2 | 0) + '?.let { serialization.deserializeParam(it.value, typeOf<' + $this.vt(_this__u8e3s4.zs_1) + '>()) }\n ');
|
|
698
698
|
var tmp;
|
|
699
|
-
if (_this__u8e3s4.
|
|
699
|
+
if (_this__u8e3s4.zs_1.ay()) {
|
|
700
700
|
tmp = trimMargin_0;
|
|
701
701
|
} else {
|
|
702
|
-
tmp = trimMargin_0 + '\n' + Spacer_instance.
|
|
702
|
+
tmp = trimMargin_0 + '\n' + Spacer_instance.ov(spaces + 2 | 0) + '?: throw IllegalArgumentException("' + $this.uu(_this__u8e3s4.ys_1) + ' is null")';
|
|
703
703
|
}
|
|
704
704
|
return tmp;
|
|
705
705
|
}
|
|
@@ -709,16 +709,16 @@ function emitDeserializedParams$default($this, _this__u8e3s4, type, fields, spac
|
|
|
709
709
|
return emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive);
|
|
710
710
|
}
|
|
711
711
|
function emitIdentifier($this, _this__u8e3s4) {
|
|
712
|
-
return 'request.path.' + $this.
|
|
712
|
+
return 'request.path.' + $this.uu(_this__u8e3s4.jt_1) + '.let{serialization.serializePath(it, typeOf<' + $this.vt(_this__u8e3s4.kt_1) + '>())}';
|
|
713
713
|
}
|
|
714
714
|
function emit_16($this, _this__u8e3s4) {
|
|
715
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
716
|
-
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : $this.
|
|
715
|
+
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.nt_1;
|
|
716
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : $this.vt(tmp1_safe_receiver);
|
|
717
717
|
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : removeQuestionMark(tmp2_safe_receiver);
|
|
718
718
|
return tmp3_elvis_lhs == null ? 'Unit' : tmp3_elvis_lhs;
|
|
719
719
|
}
|
|
720
720
|
function emit_17($this, _this__u8e3s4) {
|
|
721
|
-
return $this.
|
|
721
|
+
return $this.uu(_this__u8e3s4.jt_1) + ': ' + $this.vt(_this__u8e3s4.kt_1);
|
|
722
722
|
}
|
|
723
723
|
function brace($this, _this__u8e3s4) {
|
|
724
724
|
return wrap($this, _this__u8e3s4, '(', ')');
|
|
@@ -736,10 +736,10 @@ function wrap($this, _this__u8e3s4, prefix, postfix) {
|
|
|
736
736
|
function emitObject($this, _this__u8e3s4, name, extends_0, spaces, block) {
|
|
737
737
|
var tmp;
|
|
738
738
|
if (_this__u8e3s4.r()) {
|
|
739
|
-
tmp = Spacer_instance.
|
|
739
|
+
tmp = Spacer_instance.ov(spaces) + 'data object ' + name + ' : ' + extends_0;
|
|
740
740
|
} else {
|
|
741
|
-
var tmp_0 = Spacer_instance.
|
|
742
|
-
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.
|
|
741
|
+
var tmp_0 = Spacer_instance.ov(spaces);
|
|
742
|
+
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.ov(spaces) + ') : ' + extends_0 + '\n ');
|
|
743
743
|
}
|
|
744
744
|
return tmp;
|
|
745
745
|
}
|
|
@@ -758,17 +758,17 @@ function KotlinEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
|
758
758
|
}
|
|
759
759
|
function KotlinEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
760
760
|
return function (it) {
|
|
761
|
-
return this$0.
|
|
761
|
+
return this$0.ut(it);
|
|
762
762
|
};
|
|
763
763
|
}
|
|
764
764
|
function KotlinEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
765
765
|
return function (it) {
|
|
766
|
-
return this$0.
|
|
766
|
+
return this$0.ut(it);
|
|
767
767
|
};
|
|
768
768
|
}
|
|
769
769
|
function KotlinEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
770
770
|
return function (it) {
|
|
771
|
-
return this$0.
|
|
771
|
+
return this$0.j20(it);
|
|
772
772
|
};
|
|
773
773
|
}
|
|
774
774
|
function KotlinEndpointDefinitionEmitter$emit$lambda_4(this$0) {
|
|
@@ -785,31 +785,31 @@ function KotlinEndpointDefinitionEmitter$emit$lambda_6(it) {
|
|
|
785
785
|
return emit(it);
|
|
786
786
|
}
|
|
787
787
|
function KotlinEndpointDefinitionEmitter$emitStatusInterfaces$lambda(it) {
|
|
788
|
-
return Spacer_instance.toString() + 'sealed interface Response' + toString_0(it.
|
|
788
|
+
return Spacer_instance.toString() + 'sealed interface Response' + toString_0(it.h1_1) + 'XX<T: Any> : Response<T>';
|
|
789
789
|
}
|
|
790
790
|
function KotlinEndpointDefinitionEmitter$emitResponseInterfaces$lambda(it) {
|
|
791
791
|
return Spacer_instance.toString() + 'sealed interface Response' + concatGenerics(it) + ' : Response<' + it + '>';
|
|
792
792
|
}
|
|
793
793
|
function KotlinEndpointDefinitionEmitter$emit$lambda_7(this$0) {
|
|
794
794
|
return function (it) {
|
|
795
|
-
return this$0.
|
|
795
|
+
return this$0.uu(it.jt_1);
|
|
796
796
|
};
|
|
797
797
|
}
|
|
798
798
|
function KotlinEndpointDefinitionEmitter$emit$lambda_8(this$0) {
|
|
799
799
|
return function (it) {
|
|
800
|
-
return this$0.
|
|
800
|
+
return this$0.uu(it.ys_1);
|
|
801
801
|
};
|
|
802
802
|
}
|
|
803
803
|
function KotlinEndpointDefinitionEmitter$emit$lambda_9(this$0) {
|
|
804
804
|
return function (it) {
|
|
805
|
-
return this$0.
|
|
805
|
+
return this$0.uu(it.ys_1);
|
|
806
806
|
};
|
|
807
807
|
}
|
|
808
808
|
function KotlinEndpointDefinitionEmitter$emit$lambda_10(this$0) {
|
|
809
809
|
return function (it) {
|
|
810
810
|
var tmp;
|
|
811
811
|
if (it instanceof Literal) {
|
|
812
|
-
tmp = '"' + it.
|
|
812
|
+
tmp = '"' + it.fu_1 + '"';
|
|
813
813
|
} else {
|
|
814
814
|
if (it instanceof Param) {
|
|
815
815
|
tmp = emitIdentifier(this$0, it);
|
|
@@ -832,32 +832,32 @@ function KotlinEndpointDefinitionEmitter$emitQueries$lambda(this$0) {
|
|
|
832
832
|
}
|
|
833
833
|
function KotlinEndpointDefinitionEmitter$emit$lambda_11(this$0) {
|
|
834
834
|
return function (it) {
|
|
835
|
-
return 'val ' + this$0.
|
|
835
|
+
return 'val ' + this$0.ut(it);
|
|
836
836
|
};
|
|
837
837
|
}
|
|
838
838
|
function KotlinEndpointDefinitionEmitter$emit$lambda_12(this$0) {
|
|
839
839
|
return function (it) {
|
|
840
|
-
return this$0.
|
|
840
|
+
return this$0.uu(it.ys_1);
|
|
841
841
|
};
|
|
842
842
|
}
|
|
843
843
|
function KotlinEndpointDefinitionEmitter$emit$lambda_13(this$0) {
|
|
844
844
|
return function (it) {
|
|
845
|
-
return this$0.
|
|
845
|
+
return this$0.ut(it);
|
|
846
846
|
};
|
|
847
847
|
}
|
|
848
848
|
function KotlinEndpointDefinitionEmitter$emitConstructor$lambda(this$0) {
|
|
849
849
|
return function (it) {
|
|
850
|
-
return Spacer_instance.
|
|
850
|
+
return Spacer_instance.ov(2) + emit_17(this$0, it);
|
|
851
851
|
};
|
|
852
852
|
}
|
|
853
853
|
function KotlinEndpointDefinitionEmitter$emitConstructor$lambda_0(this$0) {
|
|
854
854
|
return function (it) {
|
|
855
|
-
return Spacer_instance.
|
|
855
|
+
return Spacer_instance.ov(2) + this$0.ut(it);
|
|
856
856
|
};
|
|
857
857
|
}
|
|
858
858
|
function KotlinEndpointDefinitionEmitter$emitConstructor$lambda_1(this$0) {
|
|
859
859
|
return function (it) {
|
|
860
|
-
return Spacer_instance.
|
|
860
|
+
return Spacer_instance.ov(2) + this$0.ut(it);
|
|
861
861
|
};
|
|
862
862
|
}
|
|
863
863
|
function KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda(this$0) {
|
|
@@ -887,7 +887,7 @@ function KotlinEndpointDefinitionEmitter$emitDeserialized$lambda(this$0) {
|
|
|
887
887
|
}
|
|
888
888
|
function KotlinEndpointDefinitionEmitter$emitObject$lambda($spaces, $block) {
|
|
889
889
|
return function (it) {
|
|
890
|
-
return Spacer_instance.
|
|
890
|
+
return Spacer_instance.ov($spaces + 1 | 0) + 'val ' + $block(it);
|
|
891
891
|
};
|
|
892
892
|
}
|
|
893
893
|
function KotlinEndpointDefinitionEmitter() {
|
|
@@ -896,18 +896,18 @@ function sanitizeNegative($this, _this__u8e3s4) {
|
|
|
896
896
|
return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
|
|
897
897
|
}
|
|
898
898
|
function sanitizeEnum($this, _this__u8e3s4) {
|
|
899
|
-
return $this.
|
|
899
|
+
return $this.k20(joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_'));
|
|
900
900
|
}
|
|
901
901
|
function KotlinEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
902
902
|
return function (it) {
|
|
903
|
-
return this$0.
|
|
903
|
+
return this$0.l20(sanitizeEnum(this$0, it)) + '("' + it + '")';
|
|
904
904
|
};
|
|
905
905
|
}
|
|
906
906
|
function KotlinEnumDefinitionEmitter() {
|
|
907
907
|
}
|
|
908
908
|
function Companion() {
|
|
909
909
|
Companion_instance_2 = this;
|
|
910
|
-
this.
|
|
910
|
+
this.i21_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']);
|
|
911
911
|
}
|
|
912
912
|
var Companion_instance_2;
|
|
913
913
|
function Companion_getInstance_0() {
|
|
@@ -916,20 +916,20 @@ function Companion_getInstance_0() {
|
|
|
916
916
|
return Companion_instance_2;
|
|
917
917
|
}
|
|
918
918
|
function KotlinIdentifierEmitter$sanitize$lambda(it) {
|
|
919
|
-
return isLetterOrDigit(it.
|
|
919
|
+
return isLetterOrDigit(it.h1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).v1(it);
|
|
920
920
|
}
|
|
921
921
|
function KotlinIdentifierEmitter() {
|
|
922
922
|
}
|
|
923
923
|
function _get_sanitizationConfig__sns434($this) {
|
|
924
|
-
var tmp0 = $this.
|
|
924
|
+
var tmp0 = $this.o21_1;
|
|
925
925
|
var tmp = KProperty1;
|
|
926
926
|
// Inline function 'kotlin.getValue' call
|
|
927
927
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, KotlinIrEmitter$_get_sanitizationConfig_$ref_tnafwf(), null);
|
|
928
|
-
return tmp0.
|
|
928
|
+
return tmp0.m1();
|
|
929
929
|
}
|
|
930
930
|
function sanitize_0($this, _this__u8e3s4) {
|
|
931
931
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
932
|
-
var this_0 = split(_this__u8e3s4.
|
|
932
|
+
var this_0 = split(_this__u8e3s4.m1(), ['.', ' ']);
|
|
933
933
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
934
934
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
935
935
|
var index = 0;
|
|
@@ -938,7 +938,7 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
938
938
|
var item = _iterator__ex2g4s.v();
|
|
939
939
|
var _unary__edvuaz = index;
|
|
940
940
|
index = _unary__edvuaz + 1 | 0;
|
|
941
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
941
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.mu(item) : item;
|
|
942
942
|
destination.x(tmp$ret$0);
|
|
943
943
|
}
|
|
944
944
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -986,7 +986,7 @@ function sanitizeFirstIsDigit_0($this, _this__u8e3s4) {
|
|
|
986
986
|
return tmp;
|
|
987
987
|
}
|
|
988
988
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
989
|
-
return Companion_getInstance_1().
|
|
989
|
+
return Companion_getInstance_1().p21_1.v1(_this__u8e3s4) ? addBackticks(_this__u8e3s4) : _this__u8e3s4;
|
|
990
990
|
}
|
|
991
991
|
function sanitizeSymbol($this, _this__u8e3s4) {
|
|
992
992
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
@@ -999,7 +999,7 @@ function sanitizeSymbol($this, _this__u8e3s4) {
|
|
|
999
999
|
var item = _iterator__ex2g4s.v();
|
|
1000
1000
|
var _unary__edvuaz = index;
|
|
1001
1001
|
index = _unary__edvuaz + 1 | 0;
|
|
1002
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
1002
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.mu(item) : item;
|
|
1003
1003
|
destination.x(tmp$ret$0);
|
|
1004
1004
|
}
|
|
1005
1005
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1026,7 +1026,7 @@ function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
function Companion_0() {
|
|
1028
1028
|
Companion_instance_3 = this;
|
|
1029
|
-
this.
|
|
1029
|
+
this.p21_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']);
|
|
1030
1030
|
}
|
|
1031
1031
|
var Companion_instance_3;
|
|
1032
1032
|
function Companion_getInstance_1() {
|
|
@@ -1039,13 +1039,13 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
1039
1039
|
}
|
|
1040
1040
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1041
1041
|
return function (name) {
|
|
1042
|
-
var sanitized = name.
|
|
1042
|
+
var sanitized = name.s1k_1.a1() > 1 ? name.v1p() : sanitizeSymbol(this$0, name.p1m());
|
|
1043
1043
|
return new Name(listOf(sanitized));
|
|
1044
1044
|
};
|
|
1045
1045
|
}
|
|
1046
1046
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0) {
|
|
1047
1047
|
return function (name) {
|
|
1048
|
-
return new Name(listOf(sanitizeSymbol(this$0, name.
|
|
1048
|
+
return new Name(listOf(sanitizeSymbol(this$0, name.v1p())));
|
|
1049
1049
|
};
|
|
1050
1050
|
}
|
|
1051
1051
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(this$0) {
|
|
@@ -1058,28 +1058,28 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1058
1058
|
var tmp;
|
|
1059
1059
|
var tmp_0;
|
|
1060
1060
|
if (stmt instanceof FunctionCall) {
|
|
1061
|
-
tmp_0 = stmt.
|
|
1061
|
+
tmp_0 = stmt.f1q_1.p1m() === 'validate';
|
|
1062
1062
|
} else {
|
|
1063
1063
|
tmp_0 = false;
|
|
1064
1064
|
}
|
|
1065
1065
|
if (tmp_0) {
|
|
1066
|
-
tmp = transformChildren(stmt.
|
|
1066
|
+
tmp = transformChildren(stmt.j1q(VOID, emptyList()), tr);
|
|
1067
1067
|
} else {
|
|
1068
1068
|
if (stmt instanceof ConstructorStatement) {
|
|
1069
|
-
var tmp_1 = tr.
|
|
1069
|
+
var tmp_1 = tr.d1y(stmt.x1q_1);
|
|
1070
1070
|
// Inline function 'kotlin.collections.map' call
|
|
1071
|
-
var this_0 = stmt.
|
|
1071
|
+
var this_0 = stmt.y1q_1;
|
|
1072
1072
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1073
|
-
var destination = ArrayList_init_$Create$(this_0.
|
|
1073
|
+
var destination = ArrayList_init_$Create$(this_0.a1());
|
|
1074
1074
|
// Inline function 'kotlin.collections.iterator' call
|
|
1075
|
-
var _iterator__ex2g4s = this_0.
|
|
1075
|
+
var _iterator__ex2g4s = this_0.k1().t();
|
|
1076
1076
|
while (_iterator__ex2g4s.u()) {
|
|
1077
1077
|
var item = _iterator__ex2g4s.v();
|
|
1078
1078
|
// Inline function 'kotlin.collections.component1' call
|
|
1079
|
-
var name = item.
|
|
1079
|
+
var name = item.l1();
|
|
1080
1080
|
// Inline function 'kotlin.collections.component2' call
|
|
1081
|
-
var expr = item.
|
|
1082
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), name), tr.
|
|
1081
|
+
var expr = item.m1();
|
|
1082
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), name), tr.g1y(expr));
|
|
1083
1083
|
destination.x(tmp$ret$3);
|
|
1084
1084
|
}
|
|
1085
1085
|
tmp = new ConstructorStatement(tmp_1, toMap(destination));
|
|
@@ -1092,7 +1092,7 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1092
1092
|
}
|
|
1093
1093
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1094
1094
|
return function () {
|
|
1095
|
-
var tmp = Companion_getInstance_1().
|
|
1095
|
+
var tmp = Companion_getInstance_1().p21_1;
|
|
1096
1096
|
var tmp_0 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1097
1097
|
var tmp_1 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
|
|
1098
1098
|
var tmp_2 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
|
|
@@ -1109,7 +1109,7 @@ function KotlinIrEmitter$emitShared$lambda(element, transformer) {
|
|
|
1109
1109
|
var tmp;
|
|
1110
1110
|
if (element instanceof File) {
|
|
1111
1111
|
// Inline function 'kotlin.collections.partition' call
|
|
1112
|
-
var this_0 = element.
|
|
1112
|
+
var this_0 = element.b1r_1;
|
|
1113
1113
|
var first = ArrayList_init_$Create$_0();
|
|
1114
1114
|
var second = ArrayList_init_$Create$_0();
|
|
1115
1115
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -1122,9 +1122,9 @@ function KotlinIrEmitter$emitShared$lambda(element, transformer) {
|
|
|
1122
1122
|
}
|
|
1123
1123
|
}
|
|
1124
1124
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1125
|
-
var packageElements = _destruct__k2r9zo.
|
|
1126
|
-
var rest = _destruct__k2r9zo.
|
|
1127
|
-
tmp = element.
|
|
1125
|
+
var packageElements = _destruct__k2r9zo.kf();
|
|
1126
|
+
var rest = _destruct__k2r9zo.lf();
|
|
1127
|
+
tmp = element.e1r(VOID, plus_2(plus_1(packageElements, import_0('kotlin.reflect', 'KType')), rest));
|
|
1128
1128
|
} else {
|
|
1129
1129
|
tmp = element;
|
|
1130
1130
|
}
|
|
@@ -1135,11 +1135,11 @@ function KotlinIrEmitter$emitShared$lambda_0($clientServer) {
|
|
|
1135
1135
|
return function (element, transformer) {
|
|
1136
1136
|
var tmp;
|
|
1137
1137
|
if (element instanceof Namespace) {
|
|
1138
|
-
var injected = element.
|
|
1138
|
+
var injected = element.g1r_1.equals(Companion_getInstance().u1k('Wirespec')) ? $clientServer : emptyList();
|
|
1139
1139
|
var tmp_0;
|
|
1140
1140
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1141
1141
|
if (!injected.r()) {
|
|
1142
|
-
tmp_0 = withElements(element, plus_2(element.
|
|
1142
|
+
tmp_0 = withElements(element, plus_2(element.c1r(), injected));
|
|
1143
1143
|
} else {
|
|
1144
1144
|
tmp_0 = element;
|
|
1145
1145
|
}
|
|
@@ -1164,7 +1164,7 @@ function KotlinIrEmitter$emitGenerator$lambda_1(it) {
|
|
|
1164
1164
|
}
|
|
1165
1165
|
function KotlinIrEmitter$emitGenerator$lambda_2(this$0) {
|
|
1166
1166
|
return function (it) {
|
|
1167
|
-
return import_0(this$0.
|
|
1167
|
+
return import_0(this$0.v1z().kv_1 + '.model', it);
|
|
1168
1168
|
};
|
|
1169
1169
|
}
|
|
1170
1170
|
function KotlinIrEmitter$emit$lambda(this$0) {
|
|
@@ -1174,27 +1174,27 @@ function KotlinIrEmitter$emit$lambda(this$0) {
|
|
|
1174
1174
|
}
|
|
1175
1175
|
function KotlinIrEmitter(packageName, emitShared) {
|
|
1176
1176
|
Companion_getInstance_1();
|
|
1177
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
1178
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
1179
|
-
this.
|
|
1180
|
-
this.
|
|
1181
|
-
this.
|
|
1182
|
-
this.
|
|
1183
|
-
this.
|
|
1177
|
+
packageName = packageName === VOID ? Companion_instance.jv('community.flock.wirespec.generated') : packageName;
|
|
1178
|
+
emitShared = emitShared === VOID ? Companion_instance_0.es() : emitShared;
|
|
1179
|
+
this.j21_1 = packageName;
|
|
1180
|
+
this.k21_1 = emitShared;
|
|
1181
|
+
this.l21_1 = KotlinGenerator_instance;
|
|
1182
|
+
this.m21_1 = FileExtension_Kotlin_getInstance();
|
|
1183
|
+
this.n21_1 = listOf_0([import_0('community.flock.wirespec.kotlin', 'Wirespec'), import_0('kotlin.reflect', 'typeOf')]);
|
|
1184
1184
|
var tmp = this;
|
|
1185
|
-
tmp.
|
|
1185
|
+
tmp.o21_1 = lazy(KotlinIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1186
1186
|
}
|
|
1187
|
-
protoOf(KotlinIrEmitter).
|
|
1188
|
-
return this.
|
|
1187
|
+
protoOf(KotlinIrEmitter).v1z = function () {
|
|
1188
|
+
return this.j21_1;
|
|
1189
1189
|
};
|
|
1190
|
-
protoOf(KotlinIrEmitter).
|
|
1191
|
-
return this.
|
|
1190
|
+
protoOf(KotlinIrEmitter).y1y = function () {
|
|
1191
|
+
return this.l21_1;
|
|
1192
1192
|
};
|
|
1193
|
-
protoOf(KotlinIrEmitter).
|
|
1194
|
-
return this.
|
|
1193
|
+
protoOf(KotlinIrEmitter).cu = function () {
|
|
1194
|
+
return this.m21_1;
|
|
1195
1195
|
};
|
|
1196
|
-
protoOf(KotlinIrEmitter).
|
|
1197
|
-
var packageName = Companion_instance.
|
|
1196
|
+
protoOf(KotlinIrEmitter).b1z = function () {
|
|
1197
|
+
var packageName = Companion_instance.jv('community.flock.wirespec.kotlin');
|
|
1198
1198
|
var clientServer = convertClientServer(packageName);
|
|
1199
1199
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1200
1200
|
var this_0 = convert(packageName);
|
|
@@ -1202,48 +1202,48 @@ protoOf(KotlinIrEmitter).t1z = function () {
|
|
|
1202
1202
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1203
1203
|
var tmp = scope;
|
|
1204
1204
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1205
|
-
var this_1 = scope.
|
|
1205
|
+
var this_1 = scope.l1y_1;
|
|
1206
1206
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1207
1207
|
// Inline function 'kotlin.apply' call
|
|
1208
1208
|
var this_2 = new TransformerBuilder();
|
|
1209
|
-
this_2.
|
|
1210
|
-
var tmp$ret$2 = this_2.
|
|
1211
|
-
tmp.
|
|
1209
|
+
this_2.d1m(KotlinIrEmitter$emitShared$lambda);
|
|
1210
|
+
var tmp$ret$2 = this_2.e1m();
|
|
1211
|
+
tmp.l1y_1 = transform(this_1, tmp$ret$2);
|
|
1212
1212
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1213
1213
|
var tmp_0 = scope;
|
|
1214
1214
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1215
1215
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1216
|
-
var this_3 = scope.
|
|
1216
|
+
var this_3 = scope.l1y_1;
|
|
1217
1217
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1218
1218
|
// Inline function 'kotlin.apply' call
|
|
1219
1219
|
var this_4 = new TransformerBuilder();
|
|
1220
|
-
this_4.
|
|
1221
|
-
var tmp$ret$7 = this_4.
|
|
1222
|
-
tmp_0.
|
|
1223
|
-
var tmp_1 = scope.
|
|
1220
|
+
this_4.d1m(KotlinIrEmitter$emitShared$lambda_0(clientServer));
|
|
1221
|
+
var tmp$ret$7 = this_4.e1m();
|
|
1222
|
+
tmp_0.l1y_1 = transform(this_3, tmp$ret$7);
|
|
1223
|
+
var tmp_1 = scope.l1y_1;
|
|
1224
1224
|
var wirespecShared = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1225
1225
|
var tmp_2;
|
|
1226
|
-
if (this.
|
|
1227
|
-
tmp_2 = wirespecShared.
|
|
1226
|
+
if (this.k21_1.fs_1) {
|
|
1227
|
+
tmp_2 = wirespecShared.e1r(Companion_getInstance().u1k(packageName.mv() + wirespecShared.a1r_1.p1m()));
|
|
1228
1228
|
} else {
|
|
1229
1229
|
tmp_2 = null;
|
|
1230
1230
|
}
|
|
1231
1231
|
return tmp_2;
|
|
1232
1232
|
};
|
|
1233
|
-
protoOf(KotlinIrEmitter).
|
|
1233
|
+
protoOf(KotlinIrEmitter).su = function (definition, module_0, logger) {
|
|
1234
1234
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1235
1235
|
// Inline function 'kotlin.takeIf' call
|
|
1236
|
-
var this_0 = this.
|
|
1236
|
+
var this_0 = this.n21_1;
|
|
1237
1237
|
var tmp;
|
|
1238
|
-
if (Companion_instance_1.
|
|
1238
|
+
if (Companion_instance_1.ou(module_0)) {
|
|
1239
1239
|
tmp = this_0;
|
|
1240
1240
|
} else {
|
|
1241
1241
|
tmp = null;
|
|
1242
1242
|
}
|
|
1243
1243
|
var tmp$ret$1 = tmp;
|
|
1244
|
-
return placeInPackage(prependImports(file, tmp$ret$1), this.
|
|
1244
|
+
return placeInPackage(prependImports(file, tmp$ret$1), this.v1z(), definition);
|
|
1245
1245
|
};
|
|
1246
|
-
protoOf(KotlinIrEmitter).
|
|
1246
|
+
protoOf(KotlinIrEmitter).f1z = function (definition, module_0) {
|
|
1247
1247
|
var tmp;
|
|
1248
1248
|
if (definition instanceof Type) {
|
|
1249
1249
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1264,29 +1264,29 @@ protoOf(KotlinIrEmitter).x1z = function (definition, module_0) {
|
|
|
1264
1264
|
}
|
|
1265
1265
|
var generatorFile = tmp;
|
|
1266
1266
|
var sanitized = sanitizeNames(generatorFile, _get_sanitizationConfig__sns434(this));
|
|
1267
|
-
var generatorOwnName = definition.
|
|
1267
|
+
var generatorOwnName = definition.tu().m1() + 'Generator';
|
|
1268
1268
|
var tmp_0 = asSequence_0(collectCustomTypeNames(sanitized));
|
|
1269
1269
|
var tmp_1 = filterNot(tmp_0, KotlinIrEmitter$emitGenerator$lambda);
|
|
1270
1270
|
var tmp_2 = filterNot(tmp_1, KotlinIrEmitter$emitGenerator$lambda_0(generatorOwnName));
|
|
1271
1271
|
var tmp_3 = distinct_0(map(tmp_2, KotlinIrEmitter$emitGenerator$lambda_1));
|
|
1272
1272
|
var modelImports = toList(map(tmp_3, KotlinIrEmitter$emitGenerator$lambda_2(this)));
|
|
1273
|
-
return placeInPackage_0(prependImports(sanitized, plus_2(this.
|
|
1273
|
+
return placeInPackage_0(prependImports(sanitized, plus_2(this.n21_1, modelImports)), this.v1z(), 'generator');
|
|
1274
1274
|
};
|
|
1275
|
-
protoOf(KotlinIrEmitter).
|
|
1275
|
+
protoOf(KotlinIrEmitter).st = function (type, module_0) {
|
|
1276
1276
|
return ensureEmptyStructHasConstructor(sanitizeNames(convertWithValidation(type, module_0), _get_sanitizationConfig__sns434(this)));
|
|
1277
1277
|
};
|
|
1278
|
-
protoOf(KotlinIrEmitter).
|
|
1278
|
+
protoOf(KotlinIrEmitter).gv = function (enum_0, module_0) {
|
|
1279
1279
|
var tmp = sanitizeNames(convert_0(enum_0), _get_sanitizationConfig__sns434(this));
|
|
1280
1280
|
return injectEnumLabelField(tmp, KotlinIrEmitter$emit$lambda(this));
|
|
1281
1281
|
};
|
|
1282
|
-
protoOf(KotlinIrEmitter).
|
|
1282
|
+
protoOf(KotlinIrEmitter).wu = function (union) {
|
|
1283
1283
|
return sanitizeNames(convert_1(union), _get_sanitizationConfig__sns434(this));
|
|
1284
1284
|
};
|
|
1285
|
-
protoOf(KotlinIrEmitter).
|
|
1285
|
+
protoOf(KotlinIrEmitter).bv = function (refined) {
|
|
1286
1286
|
var file = sanitizeNames(convert_2(refined), _get_sanitizationConfig__sns434(this));
|
|
1287
1287
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1288
1288
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1289
|
-
var tmp0 = file.
|
|
1289
|
+
var tmp0 = file.c1r();
|
|
1290
1290
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1291
1291
|
var destination = ArrayList_init_$Create$_0();
|
|
1292
1292
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1298,13 +1298,13 @@ protoOf(KotlinIrEmitter).tv = function (refined) {
|
|
|
1298
1298
|
}
|
|
1299
1299
|
var tmp0_safe_receiver = firstOrNull_0(destination);
|
|
1300
1300
|
var updatedStruct = tmp0_safe_receiver == null ? null : markMembersAsOverride(tmp0_safe_receiver);
|
|
1301
|
-
return new File(Companion_getInstance().
|
|
1301
|
+
return new File(Companion_getInstance().u1k(sanitize_0(this, refined.zu_1)), listOfNotNull_0(updatedStruct));
|
|
1302
1302
|
};
|
|
1303
|
-
protoOf(KotlinIrEmitter).
|
|
1304
|
-
var imports = buildModelImports(endpoint, this.
|
|
1303
|
+
protoOf(KotlinIrEmitter).hv = function (endpoint) {
|
|
1304
|
+
var imports = buildModelImports(endpoint, this.v1z());
|
|
1305
1305
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1306
1306
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1307
|
-
var tmp0 = convert_3(endpoint).
|
|
1307
|
+
var tmp0 = convert_3(endpoint).c1r();
|
|
1308
1308
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1309
1309
|
var destination = ArrayList_init_$Create$_0();
|
|
1310
1310
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1317,7 +1317,7 @@ protoOf(KotlinIrEmitter).zv = function (endpoint) {
|
|
|
1317
1317
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1318
1318
|
var endpointNamespace = ensureNotNull(tmp$ret$2);
|
|
1319
1319
|
var body = injectCompanionObject(endpointNamespace, endpoint);
|
|
1320
|
-
var tmp = sanitizeNames(new File(Companion_getInstance().
|
|
1320
|
+
var tmp = sanitizeNames(new File(Companion_getInstance().u1k(sanitize_0(this, endpoint.ct_1)), listOf(body)), _get_sanitizationConfig__sns434(this));
|
|
1321
1321
|
// Inline function 'kotlin.takeIf' call
|
|
1322
1322
|
var tmp_0;
|
|
1323
1323
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
@@ -1329,10 +1329,10 @@ protoOf(KotlinIrEmitter).zv = function (endpoint) {
|
|
|
1329
1329
|
var tmp$ret$5 = tmp_0;
|
|
1330
1330
|
return prependImports(tmp, tmp$ret$5);
|
|
1331
1331
|
};
|
|
1332
|
-
protoOf(KotlinIrEmitter).
|
|
1332
|
+
protoOf(KotlinIrEmitter).vu = function (channel) {
|
|
1333
1333
|
var tmp = sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1334
1334
|
// Inline function 'kotlin.takeIf' call
|
|
1335
|
-
var this_0 = buildModelImports(channel, this.
|
|
1335
|
+
var this_0 = buildModelImports(channel, this.v1z());
|
|
1336
1336
|
var tmp_0;
|
|
1337
1337
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1338
1338
|
if (!this_0.r()) {
|
|
@@ -1343,25 +1343,25 @@ protoOf(KotlinIrEmitter).nv = function (channel) {
|
|
|
1343
1343
|
var tmp$ret$2 = tmp_0;
|
|
1344
1344
|
return prependImports(tmp, tmp$ret$2);
|
|
1345
1345
|
};
|
|
1346
|
-
protoOf(KotlinIrEmitter).
|
|
1347
|
-
var imports = buildModelImports(endpoint, this.
|
|
1348
|
-
var endpointImport = import_0(this.
|
|
1346
|
+
protoOf(KotlinIrEmitter).e1z = function (endpoint) {
|
|
1347
|
+
var imports = buildModelImports(endpoint, this.v1z());
|
|
1348
|
+
var endpointImport = import_0(this.v1z().kv_1 + '.endpoint', endpoint.ct_1.m1());
|
|
1349
1349
|
var file = sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this));
|
|
1350
|
-
var subPackageName = plus_0(this.
|
|
1351
|
-
var tmp = Companion_getInstance().
|
|
1350
|
+
var subPackageName = plus_0(this.v1z(), 'client');
|
|
1351
|
+
var tmp = Companion_getInstance().u1k(subPackageName.mv() + file.a1r_1.b1q());
|
|
1352
1352
|
// Inline function 'kotlin.collections.buildList' call
|
|
1353
1353
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1354
1354
|
// Inline function 'kotlin.apply' call
|
|
1355
1355
|
var this_0 = ArrayList_init_$Create$_0();
|
|
1356
|
-
this_0.x(new Package(subPackageName.
|
|
1357
|
-
this_0.
|
|
1358
|
-
this_0.
|
|
1356
|
+
this_0.x(new Package(subPackageName.kv_1));
|
|
1357
|
+
this_0.e1(this.n21_1);
|
|
1358
|
+
this_0.e1(imports);
|
|
1359
1359
|
this_0.x(endpointImport);
|
|
1360
|
-
this_0.
|
|
1361
|
-
var tmp$ret$3 = this_0.
|
|
1360
|
+
this_0.e1(file.b1r_1);
|
|
1361
|
+
var tmp$ret$3 = this_0.p5();
|
|
1362
1362
|
return new File(tmp, tmp$ret$3);
|
|
1363
1363
|
};
|
|
1364
|
-
protoOf(KotlinIrEmitter).
|
|
1364
|
+
protoOf(KotlinIrEmitter).c1z = function (endpoints, logger) {
|
|
1365
1365
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1366
1366
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1367
1367
|
var destination = ArrayList_init_$Create$_0();
|
|
@@ -1377,7 +1377,7 @@ protoOf(KotlinIrEmitter).u1z = function (endpoints, logger) {
|
|
|
1377
1377
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1378
1378
|
while (_iterator__ex2g4s_0.u()) {
|
|
1379
1379
|
var e = _iterator__ex2g4s_0.v();
|
|
1380
|
-
var key = e.
|
|
1380
|
+
var key = e.iy_1;
|
|
1381
1381
|
if (set.x(key)) {
|
|
1382
1382
|
list_0.x(e);
|
|
1383
1383
|
}
|
|
@@ -1388,7 +1388,7 @@ protoOf(KotlinIrEmitter).u1z = function (endpoints, logger) {
|
|
|
1388
1388
|
var _iterator__ex2g4s_1 = list_0.t();
|
|
1389
1389
|
while (_iterator__ex2g4s_1.u()) {
|
|
1390
1390
|
var item = _iterator__ex2g4s_1.v();
|
|
1391
|
-
var tmp$ret$5 = import_0(this.
|
|
1391
|
+
var tmp$ret$5 = import_0(this.v1z().kv_1 + '.model', item.iy_1);
|
|
1392
1392
|
destination_0.x(tmp$ret$5);
|
|
1393
1393
|
}
|
|
1394
1394
|
var imports = destination_0;
|
|
@@ -1398,7 +1398,7 @@ protoOf(KotlinIrEmitter).u1z = function (endpoints, logger) {
|
|
|
1398
1398
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1399
1399
|
while (_iterator__ex2g4s_2.u()) {
|
|
1400
1400
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
1401
|
-
var tmp$ret$8 = import_0(this.
|
|
1401
|
+
var tmp$ret$8 = import_0(this.v1z().kv_1 + '.endpoint', item_0.ct_1.m1());
|
|
1402
1402
|
destination_1.x(tmp$ret$8);
|
|
1403
1403
|
}
|
|
1404
1404
|
var endpointImports = destination_1;
|
|
@@ -1408,22 +1408,22 @@ protoOf(KotlinIrEmitter).u1z = function (endpoints, logger) {
|
|
|
1408
1408
|
var _iterator__ex2g4s_3 = endpoints.t();
|
|
1409
1409
|
while (_iterator__ex2g4s_3.u()) {
|
|
1410
1410
|
var item_1 = _iterator__ex2g4s_3.v();
|
|
1411
|
-
var tmp$ret$11 = import_0(this.
|
|
1411
|
+
var tmp$ret$11 = import_0(this.v1z().kv_1 + '.client', item_1.ct_1.m1() + 'Client');
|
|
1412
1412
|
destination_2.x(tmp$ret$11);
|
|
1413
1413
|
}
|
|
1414
1414
|
var clientImports = destination_2;
|
|
1415
1415
|
var allImports = plus_2(plus_2(imports, endpointImports), clientImports);
|
|
1416
1416
|
var file = sanitizeNames(emitClient.call(this, endpoints, logger), _get_sanitizationConfig__sns434(this));
|
|
1417
|
-
var tmp = Companion_getInstance().
|
|
1417
|
+
var tmp = Companion_getInstance().u1k(this.v1z().mv() + file.a1r_1.b1q());
|
|
1418
1418
|
// Inline function 'kotlin.collections.buildList' call
|
|
1419
1419
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1420
1420
|
// Inline function 'kotlin.apply' call
|
|
1421
1421
|
var this_0 = ArrayList_init_$Create$_0();
|
|
1422
|
-
this_0.x(new Package(this.
|
|
1423
|
-
this_0.
|
|
1424
|
-
this_0.
|
|
1425
|
-
this_0.
|
|
1426
|
-
var tmp$ret$17 = this_0.
|
|
1422
|
+
this_0.x(new Package(this.v1z().kv_1));
|
|
1423
|
+
this_0.e1(this.n21_1);
|
|
1424
|
+
this_0.e1(allImports);
|
|
1425
|
+
this_0.e1(file.b1r_1);
|
|
1426
|
+
var tmp$ret$17 = this_0.p5();
|
|
1427
1427
|
return new File(tmp, tmp$ret$17);
|
|
1428
1428
|
};
|
|
1429
1429
|
function buildModelImports(_this__u8e3s4, packageName) {
|
|
@@ -1434,7 +1434,7 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1434
1434
|
var _iterator__ex2g4s = this_0.t();
|
|
1435
1435
|
while (_iterator__ex2g4s.u()) {
|
|
1436
1436
|
var e = _iterator__ex2g4s.v();
|
|
1437
|
-
var key = e.
|
|
1437
|
+
var key = e.iy_1;
|
|
1438
1438
|
if (set.x(key)) {
|
|
1439
1439
|
list.x(e);
|
|
1440
1440
|
}
|
|
@@ -1445,7 +1445,7 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1445
1445
|
var _iterator__ex2g4s_0 = list.t();
|
|
1446
1446
|
while (_iterator__ex2g4s_0.u()) {
|
|
1447
1447
|
var item = _iterator__ex2g4s_0.v();
|
|
1448
|
-
var tmp$ret$2 = import_0(packageName.
|
|
1448
|
+
var tmp$ret$2 = import_0(packageName.kv_1 + '.model', item.iy_1);
|
|
1449
1449
|
destination.x(tmp$ret$2);
|
|
1450
1450
|
}
|
|
1451
1451
|
return destination;
|
|
@@ -1457,31 +1457,31 @@ function injectCompanionObject(_this__u8e3s4, endpoint) {
|
|
|
1457
1457
|
var tmp = scope;
|
|
1458
1458
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1459
1459
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1460
|
-
var this_0 = scope.
|
|
1460
|
+
var this_0 = scope.l1y_1;
|
|
1461
1461
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1462
1462
|
// Inline function 'kotlin.apply' call
|
|
1463
1463
|
var this_1 = new TransformerBuilder();
|
|
1464
|
-
this_1.
|
|
1465
|
-
var tmp$ret$2 = this_1.
|
|
1466
|
-
tmp.
|
|
1467
|
-
var tmp_0 = scope.
|
|
1464
|
+
this_1.d1m(injectCompanionObject$lambda(endpoint));
|
|
1465
|
+
var tmp$ret$2 = this_1.e1m();
|
|
1466
|
+
tmp.l1y_1 = transform(this_0, tmp$ret$2);
|
|
1467
|
+
var tmp_0 = scope.l1y_1;
|
|
1468
1468
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1469
1469
|
}
|
|
1470
1470
|
function buildCompanionObject(endpoint) {
|
|
1471
|
-
var pathTemplate = '/' + joinToString(endpoint.
|
|
1471
|
+
var pathTemplate = '/' + joinToString(endpoint.et_1, '/', VOID, VOID, VOID, VOID, buildCompanionObject$lambda);
|
|
1472
1472
|
// Inline function 'kotlin.let' call
|
|
1473
|
-
var p0 = trimMargin('\n |companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n | override val pathTemplate = "' + pathTemplate + '"\n | override val method = "' + endpoint.
|
|
1473
|
+
var p0 = trimMargin('\n |companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n | override val pathTemplate = "' + pathTemplate + '"\n | override val method = "' + endpoint.dt_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 ');
|
|
1474
1474
|
return raw(p0);
|
|
1475
1475
|
}
|
|
1476
1476
|
function injectCompanionObject$lambda($endpoint) {
|
|
1477
1477
|
return function (element, transformer) {
|
|
1478
1478
|
var tmp;
|
|
1479
1479
|
if (element instanceof Interface) {
|
|
1480
|
-
var injected = element.
|
|
1480
|
+
var injected = element.t1r_1.equals(Companion_getInstance().u1k('Handler')) ? listOf(buildCompanionObject($endpoint)) : emptyList();
|
|
1481
1481
|
var tmp_0;
|
|
1482
1482
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1483
1483
|
if (!injected.r()) {
|
|
1484
|
-
tmp_0 = withElements(element, plus_2(element.
|
|
1484
|
+
tmp_0 = withElements(element, plus_2(element.c1r(), injected));
|
|
1485
1485
|
} else {
|
|
1486
1486
|
tmp_0 = element;
|
|
1487
1487
|
}
|
|
@@ -1496,10 +1496,10 @@ function injectCompanionObject$lambda($endpoint) {
|
|
|
1496
1496
|
function buildCompanionObject$lambda(it) {
|
|
1497
1497
|
var tmp;
|
|
1498
1498
|
if (it instanceof Literal) {
|
|
1499
|
-
tmp = it.
|
|
1499
|
+
tmp = it.fu_1;
|
|
1500
1500
|
} else {
|
|
1501
1501
|
if (it instanceof Param) {
|
|
1502
|
-
tmp = '{' + it.
|
|
1502
|
+
tmp = '{' + it.jt_1.m1() + '}';
|
|
1503
1503
|
} else {
|
|
1504
1504
|
noWhenBranchMatchedException();
|
|
1505
1505
|
}
|
|
@@ -1510,8 +1510,8 @@ function KotlinRefinedTypeDefinitionEmitter() {
|
|
|
1510
1510
|
}
|
|
1511
1511
|
function KotlinShared() {
|
|
1512
1512
|
KotlinShared_instance = this;
|
|
1513
|
-
this.
|
|
1514
|
-
this.
|
|
1513
|
+
this.c21_1 = 'community.flock.wirespec.kotlin';
|
|
1514
|
+
this.d21_1 = trimMargin('\n |package ' + this.c21_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.ov(2) + 'fun to(request: Req): RawRequest\n |' + Spacer_instance.ov(2) + 'fun from(response: RawResponse): Res\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req : Request<*>, Res : Response<*>> {\n |' + Spacer_instance.ov(2) + 'val pathTemplate: String\n |' + Spacer_instance.ov(2) + 'val method: String\n |' + Spacer_instance.ov(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.ov(2) + 'val pathTemplate: String\n |' + Spacer_instance.ov(2) + 'val method: String\n |' + Spacer_instance.ov(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 ');
|
|
1515
1515
|
}
|
|
1516
1516
|
protoOf(KotlinShared).toString = function () {
|
|
1517
1517
|
return 'KotlinShared';
|
|
@@ -1534,12 +1534,12 @@ function KotlinShared_getInstance() {
|
|
|
1534
1534
|
}
|
|
1535
1535
|
function KotlinTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
1536
1536
|
return function (it) {
|
|
1537
|
-
return this$0.
|
|
1537
|
+
return this$0.vt(it);
|
|
1538
1538
|
};
|
|
1539
1539
|
}
|
|
1540
1540
|
function KotlinTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
1541
1541
|
return function (it) {
|
|
1542
|
-
return Spacer_instance.toString() + 'val ' + this$0.
|
|
1542
|
+
return Spacer_instance.toString() + 'val ' + this$0.ut(it) + ',';
|
|
1543
1543
|
};
|
|
1544
1544
|
}
|
|
1545
1545
|
function KotlinTypeDefinitionEmitter() {
|
|
@@ -1547,31 +1547,31 @@ function KotlinTypeDefinitionEmitter() {
|
|
|
1547
1547
|
function KotlinUnionDefinitionEmitter() {
|
|
1548
1548
|
}
|
|
1549
1549
|
//region block: post-declaration
|
|
1550
|
-
protoOf(KotlinEmitter).
|
|
1551
|
-
protoOf(KotlinEmitter).
|
|
1552
|
-
protoOf(KotlinEmitter).
|
|
1553
|
-
protoOf(KotlinEmitter).
|
|
1554
|
-
protoOf(KotlinEmitter).
|
|
1555
|
-
protoOf(KotlinEmitter).
|
|
1556
|
-
protoOf(KotlinEmitter).
|
|
1557
|
-
protoOf(KotlinEmitter).
|
|
1558
|
-
protoOf(KotlinEmitter).
|
|
1559
|
-
protoOf(KotlinEmitter).
|
|
1560
|
-
protoOf(KotlinEmitter).
|
|
1561
|
-
protoOf(KotlinEmitter).
|
|
1562
|
-
protoOf(KotlinEmitter).
|
|
1563
|
-
protoOf(KotlinEmitter).
|
|
1564
|
-
protoOf(KotlinEmitter).
|
|
1565
|
-
protoOf(KotlinEmitter).
|
|
1566
|
-
protoOf(KotlinEmitter).
|
|
1567
|
-
protoOf(KotlinEmitter).
|
|
1568
|
-
protoOf(KotlinEmitter).
|
|
1569
|
-
protoOf(KotlinEmitter).
|
|
1570
|
-
protoOf(KotlinEmitter).
|
|
1571
|
-
protoOf(KotlinEmitter).
|
|
1572
|
-
protoOf(KotlinIrEmitter).
|
|
1573
|
-
protoOf(KotlinIrEmitter).
|
|
1574
|
-
protoOf(KotlinIrEmitter).
|
|
1550
|
+
protoOf(KotlinEmitter).st = emit_4;
|
|
1551
|
+
protoOf(KotlinEmitter).tt = emit_5;
|
|
1552
|
+
protoOf(KotlinEmitter).ut = emit_6;
|
|
1553
|
+
protoOf(KotlinEmitter).vt = emit_7;
|
|
1554
|
+
protoOf(KotlinEmitter).wt = emit_8;
|
|
1555
|
+
protoOf(KotlinEmitter).gv = emit_10;
|
|
1556
|
+
protoOf(KotlinEmitter).bv = emit_15;
|
|
1557
|
+
protoOf(KotlinEmitter).hv = emit_12;
|
|
1558
|
+
protoOf(KotlinEmitter).wu = emit_11;
|
|
1559
|
+
protoOf(KotlinEmitter).uu = emit_3;
|
|
1560
|
+
protoOf(KotlinEmitter).vu = emit_9;
|
|
1561
|
+
protoOf(KotlinEmitter).i20 = emit_13;
|
|
1562
|
+
protoOf(KotlinEmitter).j20 = emit_14;
|
|
1563
|
+
protoOf(KotlinEmitter).iv = emitValidator;
|
|
1564
|
+
protoOf(KotlinEmitter).v20 = sanitize;
|
|
1565
|
+
protoOf(KotlinEmitter).k20 = sanitizeFirstIsDigit;
|
|
1566
|
+
protoOf(KotlinEmitter).l20 = sanitizeKeywords;
|
|
1567
|
+
protoOf(KotlinEmitter).m20 = emitHandleFunction;
|
|
1568
|
+
protoOf(KotlinEmitter).e21 = emitRequestHeaders;
|
|
1569
|
+
protoOf(KotlinEmitter).f21 = emitQueries;
|
|
1570
|
+
protoOf(KotlinEmitter).g21 = emitBody;
|
|
1571
|
+
protoOf(KotlinEmitter).h21 = emitHeaders;
|
|
1572
|
+
protoOf(KotlinIrEmitter).mr = emit_1;
|
|
1573
|
+
protoOf(KotlinIrEmitter).a1z = emit_2;
|
|
1574
|
+
protoOf(KotlinIrEmitter).d1z = beforeGenerate;
|
|
1575
1575
|
//endregion
|
|
1576
1576
|
//region block: exports
|
|
1577
1577
|
export {
|