@flock/wirespec 0.19.0-RC.3 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.mjs +12 -12
- package/arrow-arrow-core.mjs +156 -156
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt-mordant.mjs.map +1 -1
- package/clikt-clikt.mjs +1547 -1547
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +444 -444
- package/kotlin-kotlin-stdlib.mjs +2347 -5055
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +20865 -6871
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1806 -1806
- package/kotlinx-io-kotlinx-io-core.mjs +432 -432
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +2213 -2050
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1947 -1472
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1333 -1333
- package/package.json +14 -9
- package/wirespec-lsp.mjs +7 -0
- package/wirespec-msw.d.ts +53 -0
- package/wirespec-msw.mjs +83 -0
- package/wirespec-src-compiler-core.mjs +1752 -1688
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +457 -421
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +440 -341
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +381 -382
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +447 -424
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +172 -173
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +475 -444
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +83 -83
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3833 -3883
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +418 -418
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +510 -510
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +1584 -1510
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +4928 -0
- package/wirespec-src-ide-lsp.mjs.map +1 -0
- package/wirespec-src-plugin-arguments.mjs +183 -183
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +106 -106
- package/wirespec-src-plugin-npm.d.mts +2 -11
- package/wirespec-src-plugin-npm.mjs +47 -42
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +53 -53
- package/wirespec-src-tools-generator.mjs.map +1 -1
- package/Kotlin-DateTime-library-kotlinx-datetime.mjs +0 -4
- package/Kotlin-DateTime-library-kotlinx-datetime.mjs.map +0 -1
- package/kotest-kotest-assertions-kotest-assertions-core.mjs +0 -4
- package/kotest-kotest-assertions-kotest-assertions-core.mjs.map +0 -1
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs +0 -4
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs.map +0 -1
- package/kotest-kotest-common.mjs +0 -56
- package/kotest-kotest-common.mjs.map +0 -1
- package/kotest-kotest-framework-kotest-framework-engine.mjs +0 -4
- package/kotest-kotest-framework-kotest-framework-engine.mjs.map +0 -1
- package/kotest-kotest-property-kotest-property-datetime.mjs +0 -4
- package/kotest-kotest-property-kotest-property-datetime.mjs.map +0 -1
- package/kotest-kotest-property.mjs +0 -2400
- package/kotest-kotest-property.mjs.map +0 -1
- package/kotest-property-arbs.mjs +0 -4
- package/kotest-property-arbs.mjs.map +0 -1
- package/kotlinx-coroutines-test.mjs +0 -4
- package/kotlinx-coroutines-test.mjs.map +0 -1
- package/wirespec-generator.d.ts +0 -52
- package/wirespec-generator.mjs +0 -9
- package/wirespec-src-integration-kotest.mjs +0 -1455
- package/wirespec-src-integration-kotest.mjs.map +0 -1
- package/xmlutil-core.mjs +0 -4
- package/xmlutil-core.mjs.map +0 -1
- package/xmlutil-serialization.mjs +0 -4
- package/xmlutil-serialization.mjs.map +0 -1
|
@@ -86,6 +86,8 @@ import {
|
|
|
86
86
|
getPropertyCallableRef3hckxc0xueiaj as getPropertyCallableRef,
|
|
87
87
|
StringBuilder_init_$Create$322n630qt3r8c as StringBuilder_init_$Create$,
|
|
88
88
|
charSequenceGet1vxk1y5n17t1z as charSequenceGet,
|
|
89
|
+
first3kg261hmihapu as first_0,
|
|
90
|
+
isLettere1qnx5bysxbd as isLetter,
|
|
89
91
|
to2cs3ny02qtbcb as to,
|
|
90
92
|
toMap1vec9topfei08 as toMap,
|
|
91
93
|
emptyList1g2z5xcrvp2zy as emptyList,
|
|
@@ -170,10 +172,10 @@ import {
|
|
|
170
172
|
function emit_3(identifier) {
|
|
171
173
|
var tmp;
|
|
172
174
|
if (identifier instanceof DefinitionIdentifier) {
|
|
173
|
-
tmp = this.
|
|
175
|
+
tmp = this.r1x(identifier);
|
|
174
176
|
} else {
|
|
175
177
|
if (identifier instanceof FieldIdentifier) {
|
|
176
|
-
tmp = this.
|
|
178
|
+
tmp = this.h1x(this.r1x(identifier));
|
|
177
179
|
} else {
|
|
178
180
|
noWhenBranchMatchedException();
|
|
179
181
|
}
|
|
@@ -182,7 +184,7 @@ function emit_3(identifier) {
|
|
|
182
184
|
}
|
|
183
185
|
function sanitize(_this__u8e3s4) {
|
|
184
186
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
185
|
-
var this_0 = split(_this__u8e3s4.
|
|
187
|
+
var this_0 = split(_this__u8e3s4.l1(), ['.', ' ']);
|
|
186
188
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
187
189
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
188
190
|
var index = 0;
|
|
@@ -191,11 +193,11 @@ function sanitize(_this__u8e3s4) {
|
|
|
191
193
|
var item = _iterator__ex2g4s.v();
|
|
192
194
|
var _unary__edvuaz = index;
|
|
193
195
|
index = _unary__edvuaz + 1 | 0;
|
|
194
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
196
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.er(item) : item;
|
|
195
197
|
destination.x(tmp$ret$0);
|
|
196
198
|
}
|
|
197
199
|
var tmp = asSequence(joinToString(destination, ''));
|
|
198
|
-
return this.
|
|
200
|
+
return this.g1x(joinToString_0(filter(tmp, KotlinIdentifierEmitter$sanitize$lambda), ''));
|
|
199
201
|
}
|
|
200
202
|
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
201
203
|
var tmp;
|
|
@@ -215,18 +217,18 @@ function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
|
215
217
|
return tmp;
|
|
216
218
|
}
|
|
217
219
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
218
|
-
return Companion_getInstance_0().
|
|
220
|
+
return Companion_getInstance_0().e1y_1.u1(_this__u8e3s4) ? addBackticks(_this__u8e3s4) : _this__u8e3s4;
|
|
219
221
|
}
|
|
220
222
|
initMetadataForInterface(KotlinIdentifierEmitter, 'KotlinIdentifierEmitter');
|
|
221
223
|
function emit_4(type, module_0) {
|
|
222
224
|
var tmp;
|
|
223
|
-
if (type.
|
|
224
|
-
tmp = 'data object ' + this.
|
|
225
|
+
if (type.mp_1.ip_1.r()) {
|
|
226
|
+
tmp = 'data object ' + this.nr(type.lp_1);
|
|
225
227
|
} else {
|
|
226
|
-
var tmp_0 = this.
|
|
227
|
-
var tmp_1 = this.
|
|
228
|
+
var tmp_0 = this.nr(type.lp_1);
|
|
229
|
+
var tmp_1 = this.lq(type.mp_1);
|
|
228
230
|
// Inline function 'kotlin.run' call
|
|
229
|
-
var $this$run = type.
|
|
231
|
+
var $this$run = type.np_1;
|
|
230
232
|
var tmp_2;
|
|
231
233
|
if ($this$run.r()) {
|
|
232
234
|
tmp_2 = '';
|
|
@@ -239,18 +241,18 @@ function emit_4(type, module_0) {
|
|
|
239
241
|
return tmp;
|
|
240
242
|
}
|
|
241
243
|
function emit_5(_this__u8e3s4) {
|
|
242
|
-
return dropLast(joinToString(_this__u8e3s4.
|
|
244
|
+
return dropLast(joinToString(_this__u8e3s4.ip_1, '\n', VOID, VOID, VOID, VOID, KotlinTypeDefinitionEmitter$emit$lambda_0(this)), 1);
|
|
243
245
|
}
|
|
244
246
|
function emit_6(_this__u8e3s4) {
|
|
245
|
-
return this.
|
|
247
|
+
return this.nr(_this__u8e3s4.qp_1) + ': ' + this.nq(_this__u8e3s4.rp_1);
|
|
246
248
|
}
|
|
247
249
|
function emit_7(_this__u8e3s4) {
|
|
248
250
|
var tmp;
|
|
249
251
|
if (_this__u8e3s4 instanceof Dict) {
|
|
250
|
-
tmp = 'Map<String, ' + this.
|
|
252
|
+
tmp = 'Map<String, ' + this.nq(_this__u8e3s4.so_1) + '>';
|
|
251
253
|
} else {
|
|
252
254
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
253
|
-
tmp = 'List<' + this.
|
|
255
|
+
tmp = 'List<' + this.nq(_this__u8e3s4.po_1) + '>';
|
|
254
256
|
} else {
|
|
255
257
|
if (_this__u8e3s4 instanceof Unit) {
|
|
256
258
|
tmp = 'Unit';
|
|
@@ -259,17 +261,17 @@ function emit_7(_this__u8e3s4) {
|
|
|
259
261
|
tmp = 'Any';
|
|
260
262
|
} else {
|
|
261
263
|
if (_this__u8e3s4 instanceof Custom) {
|
|
262
|
-
tmp = _this__u8e3s4.
|
|
264
|
+
tmp = _this__u8e3s4.bv_1;
|
|
263
265
|
} else {
|
|
264
266
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
265
|
-
var t = _this__u8e3s4.
|
|
267
|
+
var t = _this__u8e3s4.fv_1;
|
|
266
268
|
var tmp_0;
|
|
267
269
|
if (t instanceof String_0) {
|
|
268
270
|
tmp_0 = 'String';
|
|
269
271
|
} else {
|
|
270
272
|
if (t instanceof Integer) {
|
|
271
273
|
var tmp_1;
|
|
272
|
-
switch (t.
|
|
274
|
+
switch (t.ju_1.b3_1) {
|
|
273
275
|
case 0:
|
|
274
276
|
tmp_1 = 'Int';
|
|
275
277
|
break;
|
|
@@ -284,7 +286,7 @@ function emit_7(_this__u8e3s4) {
|
|
|
284
286
|
} else {
|
|
285
287
|
if (t instanceof Number_0) {
|
|
286
288
|
var tmp_2;
|
|
287
|
-
switch (t.
|
|
289
|
+
switch (t.mu_1.b3_1) {
|
|
288
290
|
case 0:
|
|
289
291
|
tmp_2 = 'Float';
|
|
290
292
|
break;
|
|
@@ -320,15 +322,15 @@ function emit_7(_this__u8e3s4) {
|
|
|
320
322
|
}
|
|
321
323
|
// Inline function 'kotlin.let' call
|
|
322
324
|
var it = tmp;
|
|
323
|
-
return _this__u8e3s4.
|
|
325
|
+
return _this__u8e3s4.tu() ? it + '?' : it;
|
|
324
326
|
}
|
|
325
327
|
function emit_8(_this__u8e3s4) {
|
|
326
328
|
var tmp;
|
|
327
329
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
328
|
-
tmp = 'Regex("""' + this.
|
|
330
|
+
tmp = 'Regex("""' + this.pq(_this__u8e3s4.pt_1) + '""").matches(value)';
|
|
329
331
|
} else {
|
|
330
332
|
if (_this__u8e3s4 instanceof Bound) {
|
|
331
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
333
|
+
var tmp1_safe_receiver = _this__u8e3s4.fu_1;
|
|
332
334
|
var tmp_0;
|
|
333
335
|
if (tmp1_safe_receiver == null) {
|
|
334
336
|
tmp_0 = null;
|
|
@@ -337,7 +339,7 @@ function emit_8(_this__u8e3s4) {
|
|
|
337
339
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
338
340
|
}
|
|
339
341
|
var minCheck = tmp_0;
|
|
340
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
342
|
+
var tmp2_safe_receiver = _this__u8e3s4.gu_1;
|
|
341
343
|
var tmp_1;
|
|
342
344
|
if (tmp2_safe_receiver == null) {
|
|
343
345
|
tmp_1 = null;
|
|
@@ -365,19 +367,63 @@ function emit_8(_this__u8e3s4) {
|
|
|
365
367
|
}
|
|
366
368
|
initMetadataForInterface(KotlinTypeDefinitionEmitter, 'KotlinTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, KotlinIdentifierEmitter]);
|
|
367
369
|
function emit_9(channel) {
|
|
368
|
-
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |fun interface ' + this.
|
|
370
|
+
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |fun interface ' + this.nr(channel.cp_1) + ' {\n | operator fun invoke(message: ' + this.nq(channel.dp_1) + ')\n |}\n |\n ');
|
|
369
371
|
}
|
|
370
372
|
initMetadataForInterface(KotlinChannelDefinitionEmitter, 'KotlinChannelDefinitionEmitter', VOID, VOID, [KotlinTypeDefinitionEmitter]);
|
|
371
|
-
function emit_10(
|
|
372
|
-
|
|
373
|
-
|
|
373
|
+
function emit_10(refined) {
|
|
374
|
+
return trimMargin('\n |data class ' + this.r1x(refined.sr_1) + '(override val value: ' + this.nq(refined.tr_1) + '): Wirespec.Refined<' + this.nq(refined.tr_1) + '> {\n |' + Spacer_instance.toString() + 'override fun toString() = value.toString()\n |' + Spacer_instance.toString() + 'override fun validate() = ' + this.bs(refined) + '\n |}\n |\n ');
|
|
375
|
+
}
|
|
376
|
+
function emitValidator(_this__u8e3s4) {
|
|
377
|
+
var defaultReturn = 'true';
|
|
378
|
+
var type = _this__u8e3s4.tr_1.fv_1;
|
|
379
|
+
var tmp;
|
|
380
|
+
if (type instanceof Integer) {
|
|
381
|
+
var tmp0_safe_receiver = type.ku_1;
|
|
382
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.oq(tmp0_safe_receiver);
|
|
383
|
+
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
384
|
+
} else {
|
|
385
|
+
if (type instanceof Number_0) {
|
|
386
|
+
var tmp2_safe_receiver = type.nu_1;
|
|
387
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.oq(tmp2_safe_receiver);
|
|
388
|
+
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
389
|
+
} else {
|
|
390
|
+
if (type instanceof String_0) {
|
|
391
|
+
var tmp4_safe_receiver = type.hu_1;
|
|
392
|
+
var tmp_0;
|
|
393
|
+
var tmp_1 = tmp4_safe_receiver;
|
|
394
|
+
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
395
|
+
tmp_0 = null;
|
|
396
|
+
} else {
|
|
397
|
+
tmp_0 = this.oq(new RegExp_0(tmp4_safe_receiver));
|
|
398
|
+
}
|
|
399
|
+
var tmp5_elvis_lhs = tmp_0;
|
|
400
|
+
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
401
|
+
} else {
|
|
402
|
+
if (equals(type, Boolean_instance)) {
|
|
403
|
+
tmp = defaultReturn;
|
|
404
|
+
} else {
|
|
405
|
+
if (equals(type, Bytes_instance)) {
|
|
406
|
+
tmp = defaultReturn;
|
|
407
|
+
} else {
|
|
408
|
+
noWhenBranchMatchedException();
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
return tmp;
|
|
415
|
+
}
|
|
416
|
+
initMetadataForInterface(KotlinRefinedTypeDefinitionEmitter, 'KotlinRefinedTypeDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter, KotlinTypeDefinitionEmitter]);
|
|
417
|
+
function emit_11(enum_0, module_0) {
|
|
418
|
+
var tmp = this.r1x(enum_0.xr_1);
|
|
419
|
+
return trimMargin('\n |enum class ' + tmp + ' (override val label: String): Wirespec.Enum {\n |' + spacer(joinToString(enum_0.yr_1, ',\n', VOID, VOID, VOID, VOID, KotlinEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'override fun toString(): String {\n |' + Spacer_instance.hs(2) + 'return label\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
374
420
|
}
|
|
375
421
|
initMetadataForInterface(KotlinEnumDefinitionEmitter, 'KotlinEnumDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
376
|
-
function
|
|
377
|
-
return trimMargin('\n |sealed interface ' + this.
|
|
422
|
+
function emit_12(union) {
|
|
423
|
+
return trimMargin('\n |sealed interface ' + this.nr(union.gp_1) + '\n |\n ');
|
|
378
424
|
}
|
|
379
425
|
initMetadataForInterface(KotlinUnionDefinitionEmitter, 'KotlinUnionDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
380
|
-
function
|
|
426
|
+
function emit_13(endpoint) {
|
|
381
427
|
// Inline function 'kotlin.collections.map' call
|
|
382
428
|
var this_0 = importReferences(endpoint);
|
|
383
429
|
// Inline function 'kotlin.collections.mapTo' call
|
|
@@ -385,169 +431,125 @@ function emit_12(endpoint) {
|
|
|
385
431
|
var _iterator__ex2g4s = this_0.t();
|
|
386
432
|
while (_iterator__ex2g4s.u()) {
|
|
387
433
|
var item = _iterator__ex2g4s.v();
|
|
388
|
-
var tmp$ret$0 = 'import ' + this.
|
|
434
|
+
var tmp$ret$0 = 'import ' + this.r1w().ds_1 + '.model.' + item.bv_1;
|
|
389
435
|
destination.x(tmp$ret$0);
|
|
390
436
|
}
|
|
391
437
|
var tmp = destination;
|
|
392
438
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda);
|
|
393
|
-
var tmp_1 = this.
|
|
439
|
+
var tmp_1 = this.nr(endpoint.up_1);
|
|
394
440
|
var tmp_2 = get_pathParams(endpoint);
|
|
395
441
|
var tmp_3 = emitObject$default(this, tmp_2, 'Path', 'Wirespec.Path', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
396
|
-
var tmp_4 = emitObject$default(this, endpoint.
|
|
397
|
-
var tmp_5 = emitObject$default(this, endpoint.
|
|
398
|
-
var tmp_6 = this.
|
|
442
|
+
var tmp_4 = emitObject$default(this, endpoint.xp_1, 'Queries', 'Wirespec.Queries', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
443
|
+
var tmp_5 = emitObject$default(this, endpoint.yp_1, 'Headers', 'Wirespec.Request.Headers', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
444
|
+
var tmp_6 = this.e1x(first(endpoint.zp_1), endpoint);
|
|
399
445
|
var tmp_7 = Spacer_instance.toString();
|
|
400
446
|
var tmp_8 = emitStatusInterfaces(this, endpoint);
|
|
401
447
|
var tmp_9 = emitResponseInterfaces(this, endpoint);
|
|
402
|
-
var tmp_10 = distinctByStatus(endpoint.
|
|
448
|
+
var tmp_10 = distinctByStatus(endpoint.aq_1);
|
|
403
449
|
var tmp_11 = joinToString(tmp_10, '\n\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
404
450
|
var tmp_12 = Spacer_instance.toString();
|
|
405
|
-
var tmp_13 = Spacer_instance.
|
|
406
|
-
var tmp_14 = distinctByStatus(endpoint.
|
|
451
|
+
var tmp_13 = Spacer_instance.hs(2);
|
|
452
|
+
var tmp_14 = distinctByStatus(endpoint.aq_1);
|
|
407
453
|
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_4(this));
|
|
408
|
-
var tmp_16 = Spacer_instance.
|
|
454
|
+
var tmp_16 = Spacer_instance.hs(2);
|
|
409
455
|
var tmp_17 = Spacer_instance.toString();
|
|
410
|
-
var tmp_18 = Spacer_instance.
|
|
456
|
+
var tmp_18 = Spacer_instance.hs(2);
|
|
411
457
|
// Inline function 'kotlin.collections.filter' call
|
|
412
|
-
var tmp0 = distinctByStatus(endpoint.
|
|
458
|
+
var tmp0 = distinctByStatus(endpoint.aq_1);
|
|
413
459
|
// Inline function 'kotlin.collections.filterTo' call
|
|
414
460
|
var destination_0 = ArrayList_init_$Create$_0();
|
|
415
461
|
var _iterator__ex2g4s_0 = tmp0.t();
|
|
416
462
|
while (_iterator__ex2g4s_0.u()) {
|
|
417
463
|
var element = _iterator__ex2g4s_0.v();
|
|
418
|
-
if (Companion_instance_1.
|
|
464
|
+
if (Companion_instance_1.ir(element.gq_1)) {
|
|
419
465
|
destination_0.x(element);
|
|
420
466
|
}
|
|
421
467
|
}
|
|
422
468
|
var tmp_19 = destination_0;
|
|
423
469
|
var tmp_20 = joinToString(tmp_19, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
424
|
-
var tmp_21 = Spacer_instance.
|
|
425
|
-
var tmp_22 = Spacer_instance.
|
|
470
|
+
var tmp_21 = Spacer_instance.hs(3);
|
|
471
|
+
var tmp_22 = Spacer_instance.hs(2);
|
|
426
472
|
var tmp_23 = Spacer_instance.toString();
|
|
427
|
-
var tmp_24 = Spacer_instance.
|
|
428
|
-
var tmp_25 = this.
|
|
429
|
-
var tmp_26 = Spacer_instance.
|
|
430
|
-
var tmp_27 = Spacer_instance.
|
|
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.
|
|
473
|
+
var tmp_24 = Spacer_instance.hs(2);
|
|
474
|
+
var tmp_25 = this.i1x(endpoint);
|
|
475
|
+
var tmp_26 = Spacer_instance.hs(2);
|
|
476
|
+
var tmp_27 = Spacer_instance.hs(3);
|
|
477
|
+
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.wp_1, '/', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_6) + '"\n |' + Spacer_instance.hs(3) + 'override val method = "' + endpoint.vp_1.toString() + '"\n |' + Spacer_instance.hs(3) + 'override fun server(serialization: Wirespec.Serialization) = object : Wirespec.ServerEdge<Request, Response<*>> {\n |' + Spacer_instance.hs(4) + 'override fun from(request: Wirespec.RawRequest) = fromRequest(serialization, request)\n |' + Spacer_instance.hs(4) + 'override fun to(response: Response<*>) = toResponse(serialization, response)\n |' + Spacer_instance.hs(3) + '}\n |' + Spacer_instance.hs(3) + 'override fun client(serialization: Wirespec.Serialization) = object : Wirespec.ClientEdge<Request, Response<*>> {\n |' + Spacer_instance.hs(4) + 'override fun to(request: Request) = toRequest(serialization, request)\n |' + Spacer_instance.hs(4) + 'override fun from(response: Wirespec.RawResponse) = fromResponse(serialization, response)\n |' + Spacer_instance.hs(3) + '}\n |' + Spacer_instance.hs(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
432
478
|
}
|
|
433
479
|
function emitHandleFunction(endpoint) {
|
|
434
|
-
return 'suspend fun ' + Companion_instance_1.
|
|
480
|
+
return 'suspend fun ' + Companion_instance_1.fr(this.nr(endpoint.up_1)) + '(request: Request): Response<*>';
|
|
435
481
|
}
|
|
436
|
-
function
|
|
482
|
+
function emit_14(_this__u8e3s4, endpoint) {
|
|
437
483
|
var tmp = Spacer_instance.toString();
|
|
438
484
|
var tmp_0 = emitConstructor(this, _this__u8e3s4, endpoint);
|
|
439
|
-
var tmp_1 = Spacer_instance.
|
|
485
|
+
var tmp_1 = Spacer_instance.hs(2);
|
|
440
486
|
var tmp_2 = get_pathParams(endpoint);
|
|
441
487
|
var tmp_3 = brace(this, joinToString(tmp_2, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_7(this)));
|
|
442
|
-
var tmp_4 = Spacer_instance.
|
|
443
|
-
var tmp_5 = Spacer_instance.
|
|
444
|
-
var tmp_6 = brace(this, joinToString(endpoint.
|
|
445
|
-
var tmp_7 = Spacer_instance.
|
|
446
|
-
var tmp_8 = brace(this, joinToString(endpoint.
|
|
447
|
-
var tmp_9 = _this__u8e3s4.
|
|
488
|
+
var tmp_4 = Spacer_instance.hs(2);
|
|
489
|
+
var tmp_5 = Spacer_instance.hs(2);
|
|
490
|
+
var tmp_6 = brace(this, joinToString(endpoint.xp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_8(this)));
|
|
491
|
+
var tmp_7 = Spacer_instance.hs(2);
|
|
492
|
+
var tmp_8 = brace(this, joinToString(endpoint.yp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_9(this)));
|
|
493
|
+
var tmp_9 = _this__u8e3s4.dq_1 == null ? Spacer_instance.hs(2) + 'override val body = Unit\n' + Spacer_instance.toString() + '}' : Spacer_instance.toString() + '}';
|
|
448
494
|
var tmp_10 = Spacer_instance.toString();
|
|
449
|
-
var tmp_11 = Spacer_instance.
|
|
450
|
-
var tmp_12 = Spacer_instance.
|
|
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.
|
|
495
|
+
var tmp_11 = Spacer_instance.hs(2);
|
|
496
|
+
var tmp_12 = Spacer_instance.hs(3);
|
|
497
|
+
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.vp_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.wp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_10(this)) + '),\n |' + Spacer_instance.hs(3) + 'method = request.method.name,\n |' + Spacer_instance.hs(3) + 'queries = ' + this.b1y(endpoint) + ',\n |' + Spacer_instance.hs(3) + 'headers = ' + this.a1y(endpoint) + ',\n |' + Spacer_instance.hs(3) + 'body = ' + (!(_this__u8e3s4.dq_1 == null) ? 'serialization.serializeBody(request.body, typeOf<' + emit_16(this, _this__u8e3s4.dq_1) + '>())' : 'null') + ',\n |' + Spacer_instance.hs(2) + ')\n |\n |' + Spacer_instance.toString() + 'fun fromRequest(serialization: Wirespec.Deserializer, request: Wirespec.RawRequest): Request =\n |' + Spacer_instance.hs(2) + 'Request' + emitDeserializedParams(this, _this__u8e3s4, endpoint) + '\n ');
|
|
452
498
|
}
|
|
453
499
|
function emitRequestHeaders(_this__u8e3s4) {
|
|
454
500
|
var tmp;
|
|
455
|
-
if (_this__u8e3s4.
|
|
501
|
+
if (_this__u8e3s4.yp_1.r()) {
|
|
456
502
|
tmp = 'emptyMap()';
|
|
457
503
|
} else {
|
|
458
|
-
var tmp_0 = Spacer_instance.
|
|
459
|
-
var tmp_1 = ',\n' + Spacer_instance.
|
|
460
|
-
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.
|
|
504
|
+
var tmp_0 = Spacer_instance.hs(5);
|
|
505
|
+
var tmp_1 = ',\n' + Spacer_instance.hs(5);
|
|
506
|
+
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.yp_1, tmp_1, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitRequestHeaders$lambda(this)) + '\n |' + Spacer_instance.hs(4) + ')\n ');
|
|
461
507
|
}
|
|
462
508
|
return tmp;
|
|
463
509
|
}
|
|
464
510
|
function emitQueries(endpoint) {
|
|
465
511
|
var tmp;
|
|
466
512
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
467
|
-
if (!endpoint.
|
|
468
|
-
var tmp_0 = Spacer_instance.
|
|
469
|
-
var tmp_1 = ',\n' + Spacer_instance.
|
|
470
|
-
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(endpoint.
|
|
513
|
+
if (!endpoint.xp_1.r()) {
|
|
514
|
+
var tmp_0 = Spacer_instance.hs(5);
|
|
515
|
+
var tmp_1 = ',\n' + Spacer_instance.hs(5);
|
|
516
|
+
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(endpoint.xp_1, tmp_1, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitQueries$lambda(this)) + '\n |' + Spacer_instance.hs(4) + ')\n ');
|
|
471
517
|
} else {
|
|
472
518
|
tmp = 'emptyMap()';
|
|
473
519
|
}
|
|
474
520
|
return tmp;
|
|
475
521
|
}
|
|
476
|
-
function
|
|
522
|
+
function emit_15(_this__u8e3s4) {
|
|
477
523
|
// Inline function 'kotlin.let' call
|
|
478
|
-
var it = joinToString(_this__u8e3s4.
|
|
524
|
+
var it = joinToString(_this__u8e3s4.hq_1, ', ', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_11(this));
|
|
479
525
|
var responseHeaderFields = isBlank(it) ? '' : ', ' + it;
|
|
480
526
|
var tmp = Spacer_instance.toString();
|
|
481
|
-
var tmp_0 = emit_16(this, _this__u8e3s4.
|
|
482
|
-
var tmp_1 = toString_0(charCodeAt(_this__u8e3s4.
|
|
483
|
-
var tmp_2 = emit_16(this, _this__u8e3s4.
|
|
484
|
-
var tmp_3 = concatGenerics(emit_16(this, _this__u8e3s4.
|
|
485
|
-
var tmp_4 = Spacer_instance.
|
|
486
|
-
var tmp_5 = fixStatus(_this__u8e3s4.
|
|
487
|
-
var tmp_6 = Spacer_instance.
|
|
488
|
-
var tmp_7 = brace(this, joinToString(_this__u8e3s4.
|
|
489
|
-
return trimMargin('\n |' + tmp + 'data class Response' + _this__u8e3s4.
|
|
527
|
+
var tmp_0 = emit_16(this, _this__u8e3s4.iq_1);
|
|
528
|
+
var tmp_1 = toString_0(charCodeAt(_this__u8e3s4.gq_1, 0));
|
|
529
|
+
var tmp_2 = emit_16(this, _this__u8e3s4.iq_1);
|
|
530
|
+
var tmp_3 = concatGenerics(emit_16(this, _this__u8e3s4.iq_1));
|
|
531
|
+
var tmp_4 = Spacer_instance.hs(2);
|
|
532
|
+
var tmp_5 = fixStatus(_this__u8e3s4.gq_1);
|
|
533
|
+
var tmp_6 = Spacer_instance.hs(2);
|
|
534
|
+
var tmp_7 = brace(this, joinToString(_this__u8e3s4.hq_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_12(this)));
|
|
535
|
+
return trimMargin('\n |' + tmp + 'data class Response' + _this__u8e3s4.gq_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.hq_1, 'ResponseHeaders', 'Wirespec.Response.Headers', 2, KotlinEndpointDefinitionEmitter$emit$lambda_13(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
490
536
|
}
|
|
491
537
|
function emitBody(_this__u8e3s4, content) {
|
|
492
538
|
return 'serialization.serializeBody(response.body, typeOf<' + emit_16(_this__u8e3s4, content) + '>())';
|
|
493
539
|
}
|
|
494
540
|
function emitHeaders(_this__u8e3s4) {
|
|
495
541
|
var tmp;
|
|
496
|
-
if (_this__u8e3s4.
|
|
542
|
+
if (_this__u8e3s4.hq_1.r()) {
|
|
497
543
|
tmp = 'emptyMap()';
|
|
498
544
|
} else {
|
|
499
|
-
var tmp_0 = Spacer_instance.
|
|
500
|
-
var tmp_1 = ',\n' + Spacer_instance.
|
|
501
|
-
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.
|
|
545
|
+
var tmp_0 = Spacer_instance.hs(5);
|
|
546
|
+
var tmp_1 = ',\n' + Spacer_instance.hs(5);
|
|
547
|
+
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.hq_1, tmp_1, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitHeaders$lambda(this)) + '\n |' + Spacer_instance.hs(4) + ')\n ');
|
|
502
548
|
}
|
|
503
549
|
return tmp;
|
|
504
550
|
}
|
|
505
551
|
initMetadataForInterface(KotlinEndpointDefinitionEmitter, 'KotlinEndpointDefinitionEmitter', VOID, VOID, [KotlinTypeDefinitionEmitter]);
|
|
506
|
-
|
|
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 ');
|
|
508
|
-
}
|
|
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
|
-
}
|
|
549
|
-
initMetadataForInterface(KotlinRefinedTypeDefinitionEmitter, 'KotlinRefinedTypeDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter, KotlinTypeDefinitionEmitter]);
|
|
550
|
-
initMetadataForClass(KotlinEmitter, 'KotlinEmitter', KotlinEmitter, LanguageEmitter, [LanguageEmitter, KotlinEnumDefinitionEmitter, KotlinUnionDefinitionEmitter, KotlinTypeDefinitionEmitter, KotlinChannelDefinitionEmitter, KotlinEndpointDefinitionEmitter, KotlinIdentifierEmitter, KotlinRefinedTypeDefinitionEmitter]);
|
|
552
|
+
initMetadataForClass(KotlinEmitter, 'KotlinEmitter', KotlinEmitter, LanguageEmitter, [LanguageEmitter, KotlinChannelDefinitionEmitter, KotlinRefinedTypeDefinitionEmitter, KotlinEnumDefinitionEmitter, KotlinUnionDefinitionEmitter, KotlinIdentifierEmitter, KotlinTypeDefinitionEmitter, KotlinEndpointDefinitionEmitter]);
|
|
551
553
|
initMetadataForCompanion(Companion);
|
|
552
554
|
initMetadataForCompanion(Companion_0);
|
|
553
555
|
initMetadataForClass(KotlinIrEmitter, 'KotlinIrEmitter', KotlinIrEmitter, VOID, [IrEmitter]);
|
|
@@ -561,7 +563,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
561
563
|
var _iterator__ex2g4s = this_0.t();
|
|
562
564
|
while (_iterator__ex2g4s.u()) {
|
|
563
565
|
var item = _iterator__ex2g4s.v();
|
|
564
|
-
var tmp$ret$0 = 'import ' + $this.
|
|
566
|
+
var tmp$ret$0 = 'import ' + $this.r1w().ds_1 + '.model.' + item.bv_1 + ';';
|
|
565
567
|
destination.x(tmp$ret$0);
|
|
566
568
|
}
|
|
567
569
|
var tmp = destination;
|
|
@@ -574,52 +576,52 @@ function KotlinChannelDefinitionEmitter$emitImports$lambda(it) {
|
|
|
574
576
|
function KotlinChannelDefinitionEmitter() {
|
|
575
577
|
}
|
|
576
578
|
function KotlinEmitter(packageName, emitShared) {
|
|
577
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
578
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
579
|
+
packageName = packageName === VOID ? Companion_instance.cs('community.flock.wirespec.generated') : packageName;
|
|
580
|
+
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
579
581
|
LanguageEmitter.call(this);
|
|
580
|
-
this.
|
|
581
|
-
this.
|
|
582
|
-
this.
|
|
583
|
-
this.
|
|
584
|
-
this.
|
|
585
|
-
this.
|
|
586
|
-
}
|
|
587
|
-
protoOf(KotlinEmitter).
|
|
588
|
-
return this.
|
|
582
|
+
this.s1x_1 = packageName;
|
|
583
|
+
this.t1x_1 = emitShared;
|
|
584
|
+
this.u1x_1 = '\nimport community.flock.wirespec.kotlin.Wirespec\nimport kotlin.reflect.typeOf\n';
|
|
585
|
+
this.v1x_1 = FileExtension_Kotlin_getInstance();
|
|
586
|
+
this.w1x_1 = KotlinShared_getInstance();
|
|
587
|
+
this.x1x_1 = '//';
|
|
588
|
+
}
|
|
589
|
+
protoOf(KotlinEmitter).r1w = function () {
|
|
590
|
+
return this.s1x_1;
|
|
589
591
|
};
|
|
590
|
-
protoOf(KotlinEmitter).
|
|
591
|
-
return this.
|
|
592
|
+
protoOf(KotlinEmitter).uq = function () {
|
|
593
|
+
return this.v1x_1;
|
|
592
594
|
};
|
|
593
|
-
protoOf(KotlinEmitter).
|
|
594
|
-
return this.
|
|
595
|
+
protoOf(KotlinEmitter).a1x = function () {
|
|
596
|
+
return this.w1x_1;
|
|
595
597
|
};
|
|
596
|
-
protoOf(KotlinEmitter).
|
|
597
|
-
return this.
|
|
598
|
+
protoOf(KotlinEmitter).vq = function () {
|
|
599
|
+
return this.x1x_1;
|
|
598
600
|
};
|
|
599
|
-
protoOf(KotlinEmitter).
|
|
601
|
+
protoOf(KotlinEmitter).kr = function (module_0, logger) {
|
|
600
602
|
// Inline function 'kotlin.let' call
|
|
601
|
-
var it = protoOf(LanguageEmitter).
|
|
602
|
-
return this.
|
|
603
|
+
var it = protoOf(LanguageEmitter).kr.call(this, module_0, logger);
|
|
604
|
+
return this.t1x_1.xo_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.cs('community.flock.wirespec.kotlin').fs() + 'Wirespec', this.a1x().z1x_1)) : it;
|
|
603
605
|
};
|
|
604
|
-
protoOf(KotlinEmitter).
|
|
606
|
+
protoOf(KotlinEmitter).lr = function (definition, module_0, logger) {
|
|
605
607
|
// Inline function 'kotlin.let' call
|
|
606
|
-
var it = protoOf(LanguageEmitter).
|
|
607
|
-
var subPackageName = plus(this.
|
|
608
|
-
var tmp = subPackageName.
|
|
608
|
+
var it = protoOf(LanguageEmitter).lr.call(this, definition, module_0, logger);
|
|
609
|
+
var subPackageName = plus(this.r1w(), definition);
|
|
610
|
+
var tmp = subPackageName.fs() + it.yo_1;
|
|
609
611
|
// Inline function 'kotlin.text.trimStart' call
|
|
610
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + '\n |' + (Companion_instance_1.
|
|
612
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + '\n |' + (Companion_instance_1.gr(module_0) ? this.u1x_1 : '') + '\n |' + it.zo_1 + '\n ');
|
|
611
613
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
612
614
|
return new Emitted(tmp, tmp$ret$0);
|
|
613
615
|
};
|
|
614
616
|
function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
615
617
|
// Inline function 'kotlin.collections.map' call
|
|
616
|
-
var this_0 = _this__u8e3s4.
|
|
618
|
+
var this_0 = _this__u8e3s4.aq_1;
|
|
617
619
|
// Inline function 'kotlin.collections.mapTo' call
|
|
618
620
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
619
621
|
var _iterator__ex2g4s = this_0.t();
|
|
620
622
|
while (_iterator__ex2g4s.u()) {
|
|
621
623
|
var item = _iterator__ex2g4s.v();
|
|
622
|
-
var tmp$ret$0 = new Char(charCodeAt(item.
|
|
624
|
+
var tmp$ret$0 = new Char(charCodeAt(item.gq_1, 0));
|
|
623
625
|
destination.x(tmp$ret$0);
|
|
624
626
|
}
|
|
625
627
|
var tmp = distinct(destination);
|
|
@@ -627,13 +629,13 @@ function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
|
627
629
|
}
|
|
628
630
|
function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
629
631
|
// Inline function 'kotlin.collections.map' call
|
|
630
|
-
var this_0 = _this__u8e3s4.
|
|
632
|
+
var this_0 = _this__u8e3s4.aq_1;
|
|
631
633
|
// Inline function 'kotlin.collections.mapTo' call
|
|
632
634
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
633
635
|
var _iterator__ex2g4s = this_0.t();
|
|
634
636
|
while (_iterator__ex2g4s.u()) {
|
|
635
637
|
var item = _iterator__ex2g4s.v();
|
|
636
|
-
var tmp$ret$0 = emit_16($this, item.
|
|
638
|
+
var tmp$ret$0 = emit_16($this, item.iq_1);
|
|
637
639
|
destination.x(tmp$ret$0);
|
|
638
640
|
}
|
|
639
641
|
var tmp = distinct(destination);
|
|
@@ -642,64 +644,64 @@ function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
|
642
644
|
function emitConstructor($this, _this__u8e3s4, endpoint) {
|
|
643
645
|
var tmp = get_pathParams(endpoint);
|
|
644
646
|
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.
|
|
647
|
+
var tmp_1 = orNull(joinToString(endpoint.xp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitConstructor$lambda_0($this)));
|
|
648
|
+
var tmp_2 = orNull(joinToString(endpoint.yp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitConstructor$lambda_1($this)));
|
|
649
|
+
var tmp0_safe_receiver = _this__u8e3s4.dq_1;
|
|
648
650
|
var tmp_3;
|
|
649
651
|
if (tmp0_safe_receiver == null) {
|
|
650
652
|
tmp_3 = null;
|
|
651
653
|
} else {
|
|
652
654
|
// Inline function 'kotlin.let' call
|
|
653
|
-
tmp_3 = Spacer_instance.
|
|
655
|
+
tmp_3 = Spacer_instance.hs(2) + 'override val body: ' + emit_16($this, tmp0_safe_receiver) + ',';
|
|
654
656
|
}
|
|
655
657
|
// Inline function 'kotlin.let' call
|
|
656
658
|
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.
|
|
659
|
+
return isBlank(it) ? 'object Request : Wirespec.Request<' + emit_16($this, _this__u8e3s4.dq_1) + '> {' : 'class Request(\n' + it + '\n' + Spacer_instance.toString() + ') : Wirespec.Request<' + emit_16($this, _this__u8e3s4.dq_1) + '> {';
|
|
658
660
|
}
|
|
659
661
|
function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
660
662
|
var tmp = get_indexedPathParams(endpoint);
|
|
661
663
|
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.
|
|
664
|
+
var tmp_1 = orNull(joinToString(endpoint.xp_1, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
665
|
+
var tmp_2 = orNull(joinToString(endpoint.yp_1, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
666
|
+
var tmp0_safe_receiver = _this__u8e3s4.dq_1;
|
|
665
667
|
var tmp_3;
|
|
666
668
|
if (tmp0_safe_receiver == null) {
|
|
667
669
|
tmp_3 = null;
|
|
668
670
|
} else {
|
|
669
671
|
// Inline function 'kotlin.let' call
|
|
670
|
-
tmp_3 = Spacer_instance.
|
|
672
|
+
tmp_3 = Spacer_instance.hs(3) + 'body = serialization.deserializeBody(requireNotNull(request.body) { "body is null" }, typeOf<' + emit_16($this, tmp0_safe_receiver) + '>()),';
|
|
671
673
|
}
|
|
672
674
|
// Inline function 'kotlin.let' call
|
|
673
675
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
674
|
-
return isBlank(it) ? '' : '(\n' + it + '\n' + Spacer_instance.
|
|
676
|
+
return isBlank(it) ? '' : '(\n' + it + '\n' + Spacer_instance.hs(2) + ')';
|
|
675
677
|
}
|
|
676
678
|
function emitSerialized($this, _this__u8e3s4) {
|
|
677
|
-
return trimMargin('\n |' + Spacer_instance.
|
|
679
|
+
return trimMargin('\n |' + Spacer_instance.hs(3) + 'is Response' + _this__u8e3s4.gq_1 + ' -> Wirespec.RawResponse(\n |' + Spacer_instance.hs(4) + 'statusCode = response.status,\n |' + Spacer_instance.hs(4) + 'headers = ' + $this.d1y(_this__u8e3s4) + ',\n |' + Spacer_instance.hs(4) + 'body = ' + (!(_this__u8e3s4.iq_1 == null) ? $this.c1y($this, _this__u8e3s4.iq_1) : 'null') + ',\n |' + Spacer_instance.hs(3) + ')\n ');
|
|
678
680
|
}
|
|
679
681
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
680
|
-
var tmp = Spacer_instance.
|
|
682
|
+
var tmp = Spacer_instance.hs(3) + _this__u8e3s4.gq_1 + ' -> Response' + _this__u8e3s4.gq_1 + '(';
|
|
681
683
|
var tmp_0;
|
|
682
|
-
if (!(_this__u8e3s4.
|
|
683
|
-
tmp_0 = Spacer_instance.
|
|
684
|
+
if (!(_this__u8e3s4.iq_1 == null)) {
|
|
685
|
+
tmp_0 = Spacer_instance.hs(4) + 'body = serialization.deserializeBody(requireNotNull(response.body) { "body is null" }, typeOf<' + emit_16($this, _this__u8e3s4.iq_1) + '>()),';
|
|
684
686
|
} else {
|
|
685
|
-
tmp_0 = Spacer_instance.
|
|
687
|
+
tmp_0 = Spacer_instance.hs(4) + 'body = Unit,';
|
|
686
688
|
}
|
|
687
689
|
var tmp_1 = tmp_0;
|
|
688
|
-
return joinToString(listOfNotNull([tmp, tmp_1, orNull(joinToString(_this__u8e3s4.
|
|
690
|
+
return joinToString(listOfNotNull([tmp, tmp_1, orNull(joinToString(_this__u8e3s4.hq_1, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserialized$lambda($this))), Spacer_instance.hs(3) + ')']), '\n');
|
|
689
691
|
}
|
|
690
692
|
function emitSerializedMapEntry($this, _this__u8e3s4, type, fields) {
|
|
691
|
-
return '"' + _this__u8e3s4.
|
|
693
|
+
return '"' + _this__u8e3s4.qp_1.l1() + '" to ' + type + '.' + fields + '.' + $this.nr(_this__u8e3s4.qp_1) + '?.let{ serialization.serializeParam(it, typeOf<' + $this.nq(_this__u8e3s4.rp_1) + '>()) }.orEmpty()';
|
|
692
694
|
}
|
|
693
695
|
function emitDeserialized_0($this, _this__u8e3s4) {
|
|
694
|
-
return Spacer_instance.
|
|
696
|
+
return Spacer_instance.hs(3) + $this.nr(_this__u8e3s4.ue_1.bq_1) + ' = serialization.deserializePath(request.path[' + _this__u8e3s4.te_1 + '], typeOf<' + $this.nq(_this__u8e3s4.ue_1.cq_1) + '>())';
|
|
695
697
|
}
|
|
696
698
|
function emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive) {
|
|
697
|
-
var trimMargin_0 = trimMargin('\n |' + Spacer_instance.
|
|
699
|
+
var trimMargin_0 = trimMargin('\n |' + Spacer_instance.hs(spaces) + $this.nr(_this__u8e3s4.qp_1) + ' =\n |' + Spacer_instance.hs(spaces + 1 | 0) + type + '.' + fields + '\n |' + Spacer_instance.hs(spaces + 2 | 0) + '.entries\n |' + Spacer_instance.hs(spaces + 2 | 0) + '.find { it.key.equals("' + _this__u8e3s4.qp_1.l1() + '", ignoreCase = ' + !caseSensitive + ') }\n |' + Spacer_instance.hs(spaces + 2 | 0) + '?.let { serialization.deserializeParam(it.value, typeOf<' + $this.nq(_this__u8e3s4.rp_1) + '>()) }\n ');
|
|
698
700
|
var tmp;
|
|
699
|
-
if (_this__u8e3s4.
|
|
701
|
+
if (_this__u8e3s4.rp_1.tu()) {
|
|
700
702
|
tmp = trimMargin_0;
|
|
701
703
|
} else {
|
|
702
|
-
tmp = trimMargin_0 + '\n' + Spacer_instance.
|
|
704
|
+
tmp = trimMargin_0 + '\n' + Spacer_instance.hs(spaces + 2 | 0) + '?: throw IllegalArgumentException("' + $this.nr(_this__u8e3s4.qp_1) + ' is null")';
|
|
703
705
|
}
|
|
704
706
|
return tmp;
|
|
705
707
|
}
|
|
@@ -709,16 +711,16 @@ function emitDeserializedParams$default($this, _this__u8e3s4, type, fields, spac
|
|
|
709
711
|
return emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive);
|
|
710
712
|
}
|
|
711
713
|
function emitIdentifier($this, _this__u8e3s4) {
|
|
712
|
-
return 'request.path.' + $this.
|
|
714
|
+
return 'request.path.' + $this.nr(_this__u8e3s4.bq_1) + '.let{serialization.serializePath(it, typeOf<' + $this.nq(_this__u8e3s4.cq_1) + '>())}';
|
|
713
715
|
}
|
|
714
716
|
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.
|
|
717
|
+
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.fq_1;
|
|
718
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : $this.nq(tmp1_safe_receiver);
|
|
717
719
|
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : removeQuestionMark(tmp2_safe_receiver);
|
|
718
720
|
return tmp3_elvis_lhs == null ? 'Unit' : tmp3_elvis_lhs;
|
|
719
721
|
}
|
|
720
722
|
function emit_17($this, _this__u8e3s4) {
|
|
721
|
-
return $this.
|
|
723
|
+
return $this.nr(_this__u8e3s4.bq_1) + ': ' + $this.nq(_this__u8e3s4.cq_1);
|
|
722
724
|
}
|
|
723
725
|
function brace($this, _this__u8e3s4) {
|
|
724
726
|
return wrap($this, _this__u8e3s4, '(', ')');
|
|
@@ -736,10 +738,10 @@ function wrap($this, _this__u8e3s4, prefix, postfix) {
|
|
|
736
738
|
function emitObject($this, _this__u8e3s4, name, extends_0, spaces, block) {
|
|
737
739
|
var tmp;
|
|
738
740
|
if (_this__u8e3s4.r()) {
|
|
739
|
-
tmp = Spacer_instance.
|
|
741
|
+
tmp = Spacer_instance.hs(spaces) + 'data object ' + name + ' : ' + extends_0;
|
|
740
742
|
} 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.
|
|
743
|
+
var tmp_0 = Spacer_instance.hs(spaces);
|
|
744
|
+
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.hs(spaces) + ') : ' + extends_0 + '\n ');
|
|
743
745
|
}
|
|
744
746
|
return tmp;
|
|
745
747
|
}
|
|
@@ -758,17 +760,17 @@ function KotlinEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
|
758
760
|
}
|
|
759
761
|
function KotlinEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
760
762
|
return function (it) {
|
|
761
|
-
return this$0.
|
|
763
|
+
return this$0.mq(it);
|
|
762
764
|
};
|
|
763
765
|
}
|
|
764
766
|
function KotlinEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
765
767
|
return function (it) {
|
|
766
|
-
return this$0.
|
|
768
|
+
return this$0.mq(it);
|
|
767
769
|
};
|
|
768
770
|
}
|
|
769
771
|
function KotlinEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
770
772
|
return function (it) {
|
|
771
|
-
return this$0.
|
|
773
|
+
return this$0.f1x(it);
|
|
772
774
|
};
|
|
773
775
|
}
|
|
774
776
|
function KotlinEndpointDefinitionEmitter$emit$lambda_4(this$0) {
|
|
@@ -792,24 +794,24 @@ function KotlinEndpointDefinitionEmitter$emitResponseInterfaces$lambda(it) {
|
|
|
792
794
|
}
|
|
793
795
|
function KotlinEndpointDefinitionEmitter$emit$lambda_7(this$0) {
|
|
794
796
|
return function (it) {
|
|
795
|
-
return this$0.
|
|
797
|
+
return this$0.nr(it.bq_1);
|
|
796
798
|
};
|
|
797
799
|
}
|
|
798
800
|
function KotlinEndpointDefinitionEmitter$emit$lambda_8(this$0) {
|
|
799
801
|
return function (it) {
|
|
800
|
-
return this$0.
|
|
802
|
+
return this$0.nr(it.qp_1);
|
|
801
803
|
};
|
|
802
804
|
}
|
|
803
805
|
function KotlinEndpointDefinitionEmitter$emit$lambda_9(this$0) {
|
|
804
806
|
return function (it) {
|
|
805
|
-
return this$0.
|
|
807
|
+
return this$0.nr(it.qp_1);
|
|
806
808
|
};
|
|
807
809
|
}
|
|
808
810
|
function KotlinEndpointDefinitionEmitter$emit$lambda_10(this$0) {
|
|
809
811
|
return function (it) {
|
|
810
812
|
var tmp;
|
|
811
813
|
if (it instanceof Literal) {
|
|
812
|
-
tmp = '"' + it.
|
|
814
|
+
tmp = '"' + it.xq_1 + '"';
|
|
813
815
|
} else {
|
|
814
816
|
if (it instanceof Param) {
|
|
815
817
|
tmp = emitIdentifier(this$0, it);
|
|
@@ -832,32 +834,32 @@ function KotlinEndpointDefinitionEmitter$emitQueries$lambda(this$0) {
|
|
|
832
834
|
}
|
|
833
835
|
function KotlinEndpointDefinitionEmitter$emit$lambda_11(this$0) {
|
|
834
836
|
return function (it) {
|
|
835
|
-
return 'val ' + this$0.
|
|
837
|
+
return 'val ' + this$0.mq(it);
|
|
836
838
|
};
|
|
837
839
|
}
|
|
838
840
|
function KotlinEndpointDefinitionEmitter$emit$lambda_12(this$0) {
|
|
839
841
|
return function (it) {
|
|
840
|
-
return this$0.
|
|
842
|
+
return this$0.nr(it.qp_1);
|
|
841
843
|
};
|
|
842
844
|
}
|
|
843
845
|
function KotlinEndpointDefinitionEmitter$emit$lambda_13(this$0) {
|
|
844
846
|
return function (it) {
|
|
845
|
-
return this$0.
|
|
847
|
+
return this$0.mq(it);
|
|
846
848
|
};
|
|
847
849
|
}
|
|
848
850
|
function KotlinEndpointDefinitionEmitter$emitConstructor$lambda(this$0) {
|
|
849
851
|
return function (it) {
|
|
850
|
-
return Spacer_instance.
|
|
852
|
+
return Spacer_instance.hs(2) + emit_17(this$0, it);
|
|
851
853
|
};
|
|
852
854
|
}
|
|
853
855
|
function KotlinEndpointDefinitionEmitter$emitConstructor$lambda_0(this$0) {
|
|
854
856
|
return function (it) {
|
|
855
|
-
return Spacer_instance.
|
|
857
|
+
return Spacer_instance.hs(2) + this$0.mq(it);
|
|
856
858
|
};
|
|
857
859
|
}
|
|
858
860
|
function KotlinEndpointDefinitionEmitter$emitConstructor$lambda_1(this$0) {
|
|
859
861
|
return function (it) {
|
|
860
|
-
return Spacer_instance.
|
|
862
|
+
return Spacer_instance.hs(2) + this$0.mq(it);
|
|
861
863
|
};
|
|
862
864
|
}
|
|
863
865
|
function KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda(this$0) {
|
|
@@ -887,7 +889,7 @@ function KotlinEndpointDefinitionEmitter$emitDeserialized$lambda(this$0) {
|
|
|
887
889
|
}
|
|
888
890
|
function KotlinEndpointDefinitionEmitter$emitObject$lambda($spaces, $block) {
|
|
889
891
|
return function (it) {
|
|
890
|
-
return Spacer_instance.
|
|
892
|
+
return Spacer_instance.hs($spaces + 1 | 0) + 'val ' + $block(it);
|
|
891
893
|
};
|
|
892
894
|
}
|
|
893
895
|
function KotlinEndpointDefinitionEmitter() {
|
|
@@ -896,18 +898,18 @@ function sanitizeNegative($this, _this__u8e3s4) {
|
|
|
896
898
|
return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
|
|
897
899
|
}
|
|
898
900
|
function sanitizeEnum($this, _this__u8e3s4) {
|
|
899
|
-
return $this.
|
|
901
|
+
return $this.g1x(joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_'));
|
|
900
902
|
}
|
|
901
903
|
function KotlinEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
902
904
|
return function (it) {
|
|
903
|
-
return this$0.
|
|
905
|
+
return this$0.h1x(sanitizeEnum(this$0, it)) + '("' + it + '")';
|
|
904
906
|
};
|
|
905
907
|
}
|
|
906
908
|
function KotlinEnumDefinitionEmitter() {
|
|
907
909
|
}
|
|
908
910
|
function Companion() {
|
|
909
911
|
Companion_instance_2 = this;
|
|
910
|
-
this.
|
|
912
|
+
this.e1y_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
913
|
}
|
|
912
914
|
var Companion_instance_2;
|
|
913
915
|
function Companion_getInstance_0() {
|
|
@@ -916,20 +918,27 @@ function Companion_getInstance_0() {
|
|
|
916
918
|
return Companion_instance_2;
|
|
917
919
|
}
|
|
918
920
|
function KotlinIdentifierEmitter$sanitize$lambda(it) {
|
|
919
|
-
return isLetterOrDigit(it.h1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).
|
|
921
|
+
return isLetterOrDigit(it.h1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).u1(it);
|
|
920
922
|
}
|
|
921
923
|
function KotlinIdentifierEmitter() {
|
|
922
924
|
}
|
|
923
925
|
function _get_sanitizationConfig__sns434($this) {
|
|
924
|
-
var tmp0 = $this.
|
|
926
|
+
var tmp0 = $this.k1y_1;
|
|
925
927
|
var tmp = KProperty1;
|
|
926
928
|
// Inline function 'kotlin.getValue' call
|
|
927
929
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, KotlinIrEmitter$_get_sanitizationConfig_$ref_tnafwf(), null);
|
|
928
|
-
return tmp0.
|
|
930
|
+
return tmp0.l1();
|
|
931
|
+
}
|
|
932
|
+
function _get_modelSanitizationConfig__vgg831($this) {
|
|
933
|
+
var tmp0 = $this.l1y_1;
|
|
934
|
+
var tmp = KProperty1;
|
|
935
|
+
// Inline function 'kotlin.getValue' call
|
|
936
|
+
getPropertyCallableRef('modelSanitizationConfig', 1, tmp, KotlinIrEmitter$_get_modelSanitizationConfig_$ref_iulb4s(), null);
|
|
937
|
+
return tmp0.l1();
|
|
929
938
|
}
|
|
930
939
|
function sanitize_0($this, _this__u8e3s4) {
|
|
931
940
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
932
|
-
var this_0 = split(_this__u8e3s4.
|
|
941
|
+
var this_0 = split(_this__u8e3s4.l1(), ['.', ' ']);
|
|
933
942
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
934
943
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
935
944
|
var index = 0;
|
|
@@ -938,7 +947,7 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
938
947
|
var item = _iterator__ex2g4s.v();
|
|
939
948
|
var _unary__edvuaz = index;
|
|
940
949
|
index = _unary__edvuaz + 1 | 0;
|
|
941
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
950
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.er(item) : item;
|
|
942
951
|
destination.x(tmp$ret$0);
|
|
943
952
|
}
|
|
944
953
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -986,7 +995,7 @@ function sanitizeFirstIsDigit_0($this, _this__u8e3s4) {
|
|
|
986
995
|
return tmp;
|
|
987
996
|
}
|
|
988
997
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
989
|
-
return Companion_getInstance_1().
|
|
998
|
+
return Companion_getInstance_1().m1y_1.u1(_this__u8e3s4) ? addBackticks(_this__u8e3s4) : _this__u8e3s4;
|
|
990
999
|
}
|
|
991
1000
|
function sanitizeSymbol($this, _this__u8e3s4) {
|
|
992
1001
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
@@ -999,7 +1008,7 @@ function sanitizeSymbol($this, _this__u8e3s4) {
|
|
|
999
1008
|
var item = _iterator__ex2g4s.v();
|
|
1000
1009
|
var _unary__edvuaz = index;
|
|
1001
1010
|
index = _unary__edvuaz + 1 | 0;
|
|
1002
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
1011
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.er(item) : item;
|
|
1003
1012
|
destination.x(tmp$ret$0);
|
|
1004
1013
|
}
|
|
1005
1014
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1021,12 +1030,45 @@ function sanitizeSymbol($this, _this__u8e3s4) {
|
|
|
1021
1030
|
var tmp$ret$5 = destination_0.toString();
|
|
1022
1031
|
return sanitizeFirstIsDigit_0($this, tmp$ret$5);
|
|
1023
1032
|
}
|
|
1033
|
+
function sanitizeFieldSymbol($this, _this__u8e3s4) {
|
|
1034
|
+
return isBareIdentifier($this, _this__u8e3s4) ? _this__u8e3s4 : addBackticks(_this__u8e3s4);
|
|
1035
|
+
}
|
|
1036
|
+
function isBareIdentifier($this, _this__u8e3s4) {
|
|
1037
|
+
var tmp;
|
|
1038
|
+
var tmp_0;
|
|
1039
|
+
// Inline function 'kotlin.text.isNotEmpty' call
|
|
1040
|
+
if (charSequenceLength(_this__u8e3s4) > 0) {
|
|
1041
|
+
tmp_0 = isLetter(first_0(_this__u8e3s4)) || first_0(_this__u8e3s4) === _Char___init__impl__6a9atx(95);
|
|
1042
|
+
} else {
|
|
1043
|
+
tmp_0 = false;
|
|
1044
|
+
}
|
|
1045
|
+
if (tmp_0) {
|
|
1046
|
+
var tmp$ret$2;
|
|
1047
|
+
$l$block: {
|
|
1048
|
+
// Inline function 'kotlin.text.all' call
|
|
1049
|
+
var inductionVariable = 0;
|
|
1050
|
+
while (inductionVariable < charSequenceLength(_this__u8e3s4)) {
|
|
1051
|
+
var element = charSequenceGet(_this__u8e3s4, inductionVariable);
|
|
1052
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
1053
|
+
if (!(isLetterOrDigit(element) || element === _Char___init__impl__6a9atx(95))) {
|
|
1054
|
+
tmp$ret$2 = false;
|
|
1055
|
+
break $l$block;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
tmp$ret$2 = true;
|
|
1059
|
+
}
|
|
1060
|
+
tmp = tmp$ret$2;
|
|
1061
|
+
} else {
|
|
1062
|
+
tmp = false;
|
|
1063
|
+
}
|
|
1064
|
+
return tmp;
|
|
1065
|
+
}
|
|
1024
1066
|
function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
1025
1067
|
return sanitizeKeywords_0($this, sanitizeFirstIsDigit_0($this, joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_')));
|
|
1026
1068
|
}
|
|
1027
1069
|
function Companion_0() {
|
|
1028
1070
|
Companion_instance_3 = this;
|
|
1029
|
-
this.
|
|
1071
|
+
this.m1y_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
1072
|
}
|
|
1031
1073
|
var Companion_instance_3;
|
|
1032
1074
|
function Companion_getInstance_1() {
|
|
@@ -1039,13 +1081,13 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
1039
1081
|
}
|
|
1040
1082
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1041
1083
|
return function (name) {
|
|
1042
|
-
var sanitized = name.
|
|
1084
|
+
var sanitized = name.l1h_1.a1() > 1 ? name.q1m() : sanitizeSymbol(this$0, name.j1j());
|
|
1043
1085
|
return new Name(listOf(sanitized));
|
|
1044
1086
|
};
|
|
1045
1087
|
}
|
|
1046
1088
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0) {
|
|
1047
1089
|
return function (name) {
|
|
1048
|
-
return new Name(listOf(sanitizeSymbol(this$0, name.
|
|
1090
|
+
return new Name(listOf(sanitizeSymbol(this$0, name.q1m())));
|
|
1049
1091
|
};
|
|
1050
1092
|
}
|
|
1051
1093
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(this$0) {
|
|
@@ -1058,28 +1100,28 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1058
1100
|
var tmp;
|
|
1059
1101
|
var tmp_0;
|
|
1060
1102
|
if (stmt instanceof FunctionCall) {
|
|
1061
|
-
tmp_0 = stmt.
|
|
1103
|
+
tmp_0 = stmt.z1m_1.j1j() === 'validate';
|
|
1062
1104
|
} else {
|
|
1063
1105
|
tmp_0 = false;
|
|
1064
1106
|
}
|
|
1065
1107
|
if (tmp_0) {
|
|
1066
|
-
tmp = transformChildren(stmt.
|
|
1108
|
+
tmp = transformChildren(stmt.d1n(VOID, emptyList()), tr);
|
|
1067
1109
|
} else {
|
|
1068
1110
|
if (stmt instanceof ConstructorStatement) {
|
|
1069
|
-
var tmp_1 = tr.
|
|
1111
|
+
var tmp_1 = tr.x1u(stmt.r1n_1);
|
|
1070
1112
|
// Inline function 'kotlin.collections.map' call
|
|
1071
|
-
var this_0 = stmt.
|
|
1113
|
+
var this_0 = stmt.s1n_1;
|
|
1072
1114
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1073
1115
|
var destination = ArrayList_init_$Create$(this_0.a1());
|
|
1074
1116
|
// Inline function 'kotlin.collections.iterator' call
|
|
1075
|
-
var _iterator__ex2g4s = this_0.
|
|
1117
|
+
var _iterator__ex2g4s = this_0.j1().t();
|
|
1076
1118
|
while (_iterator__ex2g4s.u()) {
|
|
1077
1119
|
var item = _iterator__ex2g4s.v();
|
|
1078
1120
|
// Inline function 'kotlin.collections.component1' call
|
|
1079
|
-
var name = item.
|
|
1121
|
+
var name = item.k1();
|
|
1080
1122
|
// Inline function 'kotlin.collections.component2' call
|
|
1081
|
-
var expr = item.
|
|
1082
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), name), tr.
|
|
1123
|
+
var expr = item.l1();
|
|
1124
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), name), tr.a1v(expr));
|
|
1083
1125
|
destination.x(tmp$ret$3);
|
|
1084
1126
|
}
|
|
1085
1127
|
tmp = new ConstructorStatement(tmp_1, toMap(destination));
|
|
@@ -1092,7 +1134,7 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1092
1134
|
}
|
|
1093
1135
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1094
1136
|
return function () {
|
|
1095
|
-
var tmp = Companion_getInstance_1().
|
|
1137
|
+
var tmp = Companion_getInstance_1().m1y_1;
|
|
1096
1138
|
var tmp_0 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1097
1139
|
var tmp_1 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
|
|
1098
1140
|
var tmp_2 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
|
|
@@ -1105,11 +1147,31 @@ function KotlinIrEmitter$_get_sanitizationConfig_$ref_tnafwf() {
|
|
|
1105
1147
|
return _get_sanitizationConfig__sns434(p0);
|
|
1106
1148
|
};
|
|
1107
1149
|
}
|
|
1150
|
+
function KotlinIrEmitter$modelSanitizationConfig$delegate$lambda$lambda(name) {
|
|
1151
|
+
return new Name(listOf(name.j1j()));
|
|
1152
|
+
}
|
|
1153
|
+
function KotlinIrEmitter$modelSanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1154
|
+
return function (it) {
|
|
1155
|
+
return sanitizeFieldSymbol(this$0, it);
|
|
1156
|
+
};
|
|
1157
|
+
}
|
|
1158
|
+
function KotlinIrEmitter$modelSanitizationConfig$delegate$lambda(this$0) {
|
|
1159
|
+
return function () {
|
|
1160
|
+
var tmp = _get_sanitizationConfig__sns434(this$0);
|
|
1161
|
+
var tmp_0 = KotlinIrEmitter$modelSanitizationConfig$delegate$lambda$lambda;
|
|
1162
|
+
return tmp.q1w(VOID, VOID, tmp_0, VOID, KotlinIrEmitter$modelSanitizationConfig$delegate$lambda$lambda_0(this$0));
|
|
1163
|
+
};
|
|
1164
|
+
}
|
|
1165
|
+
function KotlinIrEmitter$_get_modelSanitizationConfig_$ref_iulb4s() {
|
|
1166
|
+
return function (p0) {
|
|
1167
|
+
return _get_modelSanitizationConfig__vgg831(p0);
|
|
1168
|
+
};
|
|
1169
|
+
}
|
|
1108
1170
|
function KotlinIrEmitter$emitShared$lambda(element, transformer) {
|
|
1109
1171
|
var tmp;
|
|
1110
1172
|
if (element instanceof File) {
|
|
1111
1173
|
// Inline function 'kotlin.collections.partition' call
|
|
1112
|
-
var this_0 = element.
|
|
1174
|
+
var this_0 = element.v1n_1;
|
|
1113
1175
|
var first = ArrayList_init_$Create$_0();
|
|
1114
1176
|
var second = ArrayList_init_$Create$_0();
|
|
1115
1177
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -1122,9 +1184,9 @@ function KotlinIrEmitter$emitShared$lambda(element, transformer) {
|
|
|
1122
1184
|
}
|
|
1123
1185
|
}
|
|
1124
1186
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1125
|
-
var packageElements = _destruct__k2r9zo.
|
|
1126
|
-
var rest = _destruct__k2r9zo.
|
|
1127
|
-
tmp = element.
|
|
1187
|
+
var packageElements = _destruct__k2r9zo.ve();
|
|
1188
|
+
var rest = _destruct__k2r9zo.we();
|
|
1189
|
+
tmp = element.y1n(VOID, plus_2(plus_1(packageElements, import_0('kotlin.reflect', 'KType')), rest));
|
|
1128
1190
|
} else {
|
|
1129
1191
|
tmp = element;
|
|
1130
1192
|
}
|
|
@@ -1135,11 +1197,11 @@ function KotlinIrEmitter$emitShared$lambda_0($clientServer) {
|
|
|
1135
1197
|
return function (element, transformer) {
|
|
1136
1198
|
var tmp;
|
|
1137
1199
|
if (element instanceof Namespace) {
|
|
1138
|
-
var injected = element.
|
|
1200
|
+
var injected = element.a1o_1.equals(Companion_getInstance().n1h('Wirespec')) ? $clientServer : emptyList();
|
|
1139
1201
|
var tmp_0;
|
|
1140
1202
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1141
1203
|
if (!injected.r()) {
|
|
1142
|
-
tmp_0 = withElements(element, plus_2(element.
|
|
1204
|
+
tmp_0 = withElements(element, plus_2(element.w1n(), injected));
|
|
1143
1205
|
} else {
|
|
1144
1206
|
tmp_0 = element;
|
|
1145
1207
|
}
|
|
@@ -1164,7 +1226,7 @@ function KotlinIrEmitter$emitGenerator$lambda_1(it) {
|
|
|
1164
1226
|
}
|
|
1165
1227
|
function KotlinIrEmitter$emitGenerator$lambda_2(this$0) {
|
|
1166
1228
|
return function (it) {
|
|
1167
|
-
return import_0(this$0.
|
|
1229
|
+
return import_0(this$0.r1w().ds_1 + '.model', it);
|
|
1168
1230
|
};
|
|
1169
1231
|
}
|
|
1170
1232
|
function KotlinIrEmitter$emit$lambda(this$0) {
|
|
@@ -1174,27 +1236,29 @@ function KotlinIrEmitter$emit$lambda(this$0) {
|
|
|
1174
1236
|
}
|
|
1175
1237
|
function KotlinIrEmitter(packageName, emitShared) {
|
|
1176
1238
|
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.
|
|
1239
|
+
packageName = packageName === VOID ? Companion_instance.cs('community.flock.wirespec.generated') : packageName;
|
|
1240
|
+
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
1241
|
+
this.f1y_1 = packageName;
|
|
1242
|
+
this.g1y_1 = emitShared;
|
|
1243
|
+
this.h1y_1 = KotlinGenerator_instance;
|
|
1244
|
+
this.i1y_1 = FileExtension_Kotlin_getInstance();
|
|
1245
|
+
this.j1y_1 = listOf_0([import_0('community.flock.wirespec.kotlin', 'Wirespec'), import_0('kotlin.reflect', 'typeOf')]);
|
|
1184
1246
|
var tmp = this;
|
|
1185
|
-
tmp.
|
|
1247
|
+
tmp.k1y_1 = lazy(KotlinIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1248
|
+
var tmp_0 = this;
|
|
1249
|
+
tmp_0.l1y_1 = lazy(KotlinIrEmitter$modelSanitizationConfig$delegate$lambda(this));
|
|
1186
1250
|
}
|
|
1187
|
-
protoOf(KotlinIrEmitter).
|
|
1188
|
-
return this.
|
|
1251
|
+
protoOf(KotlinIrEmitter).r1w = function () {
|
|
1252
|
+
return this.f1y_1;
|
|
1189
1253
|
};
|
|
1190
|
-
protoOf(KotlinIrEmitter).
|
|
1191
|
-
return this.
|
|
1254
|
+
protoOf(KotlinIrEmitter).s1v = function () {
|
|
1255
|
+
return this.h1y_1;
|
|
1192
1256
|
};
|
|
1193
|
-
protoOf(KotlinIrEmitter).
|
|
1194
|
-
return this.
|
|
1257
|
+
protoOf(KotlinIrEmitter).uq = function () {
|
|
1258
|
+
return this.i1y_1;
|
|
1195
1259
|
};
|
|
1196
|
-
protoOf(KotlinIrEmitter).
|
|
1197
|
-
var packageName = Companion_instance.
|
|
1260
|
+
protoOf(KotlinIrEmitter).v1v = function () {
|
|
1261
|
+
var packageName = Companion_instance.cs('community.flock.wirespec.kotlin');
|
|
1198
1262
|
var clientServer = convertClientServer(packageName);
|
|
1199
1263
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1200
1264
|
var this_0 = convert(packageName);
|
|
@@ -1202,48 +1266,48 @@ protoOf(KotlinIrEmitter).b1z = function () {
|
|
|
1202
1266
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1203
1267
|
var tmp = scope;
|
|
1204
1268
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1205
|
-
var this_1 = scope.
|
|
1269
|
+
var this_1 = scope.f1v_1;
|
|
1206
1270
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1207
1271
|
// Inline function 'kotlin.apply' call
|
|
1208
1272
|
var this_2 = new TransformerBuilder();
|
|
1209
|
-
this_2.
|
|
1210
|
-
var tmp$ret$2 = this_2.
|
|
1211
|
-
tmp.
|
|
1273
|
+
this_2.w1i(KotlinIrEmitter$emitShared$lambda);
|
|
1274
|
+
var tmp$ret$2 = this_2.x1i();
|
|
1275
|
+
tmp.f1v_1 = transform(this_1, tmp$ret$2);
|
|
1212
1276
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1213
1277
|
var tmp_0 = scope;
|
|
1214
1278
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1215
1279
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1216
|
-
var this_3 = scope.
|
|
1280
|
+
var this_3 = scope.f1v_1;
|
|
1217
1281
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1218
1282
|
// Inline function 'kotlin.apply' call
|
|
1219
1283
|
var this_4 = new TransformerBuilder();
|
|
1220
|
-
this_4.
|
|
1221
|
-
var tmp$ret$7 = this_4.
|
|
1222
|
-
tmp_0.
|
|
1223
|
-
var tmp_1 = scope.
|
|
1284
|
+
this_4.w1i(KotlinIrEmitter$emitShared$lambda_0(clientServer));
|
|
1285
|
+
var tmp$ret$7 = this_4.x1i();
|
|
1286
|
+
tmp_0.f1v_1 = transform(this_3, tmp$ret$7);
|
|
1287
|
+
var tmp_1 = scope.f1v_1;
|
|
1224
1288
|
var wirespecShared = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1225
1289
|
var tmp_2;
|
|
1226
|
-
if (this.
|
|
1227
|
-
tmp_2 = wirespecShared
|
|
1290
|
+
if (this.g1y_1.xo_1) {
|
|
1291
|
+
tmp_2 = wirespecShared;
|
|
1228
1292
|
} else {
|
|
1229
1293
|
tmp_2 = null;
|
|
1230
1294
|
}
|
|
1231
1295
|
return tmp_2;
|
|
1232
1296
|
};
|
|
1233
|
-
protoOf(KotlinIrEmitter).
|
|
1297
|
+
protoOf(KotlinIrEmitter).lr = function (definition, module_0, logger) {
|
|
1234
1298
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1235
1299
|
// Inline function 'kotlin.takeIf' call
|
|
1236
|
-
var this_0 = this.
|
|
1300
|
+
var this_0 = this.j1y_1;
|
|
1237
1301
|
var tmp;
|
|
1238
|
-
if (Companion_instance_1.
|
|
1302
|
+
if (Companion_instance_1.hr(module_0)) {
|
|
1239
1303
|
tmp = this_0;
|
|
1240
1304
|
} else {
|
|
1241
1305
|
tmp = null;
|
|
1242
1306
|
}
|
|
1243
1307
|
var tmp$ret$1 = tmp;
|
|
1244
|
-
return placeInPackage(prependImports(file, tmp$ret$1), this.
|
|
1308
|
+
return placeInPackage(prependImports(file, tmp$ret$1), this.r1w(), definition);
|
|
1245
1309
|
};
|
|
1246
|
-
protoOf(KotlinIrEmitter).
|
|
1310
|
+
protoOf(KotlinIrEmitter).z1v = function (definition, module_0) {
|
|
1247
1311
|
var tmp;
|
|
1248
1312
|
if (definition instanceof Type) {
|
|
1249
1313
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1264,29 +1328,29 @@ protoOf(KotlinIrEmitter).f1z = function (definition, module_0) {
|
|
|
1264
1328
|
}
|
|
1265
1329
|
var generatorFile = tmp;
|
|
1266
1330
|
var sanitized = sanitizeNames(generatorFile, _get_sanitizationConfig__sns434(this));
|
|
1267
|
-
var generatorOwnName = definition.
|
|
1331
|
+
var generatorOwnName = definition.mr().l1() + 'Generator';
|
|
1268
1332
|
var tmp_0 = asSequence_0(collectCustomTypeNames(sanitized));
|
|
1269
1333
|
var tmp_1 = filterNot(tmp_0, KotlinIrEmitter$emitGenerator$lambda);
|
|
1270
1334
|
var tmp_2 = filterNot(tmp_1, KotlinIrEmitter$emitGenerator$lambda_0(generatorOwnName));
|
|
1271
1335
|
var tmp_3 = distinct_0(map(tmp_2, KotlinIrEmitter$emitGenerator$lambda_1));
|
|
1272
1336
|
var modelImports = toList(map(tmp_3, KotlinIrEmitter$emitGenerator$lambda_2(this)));
|
|
1273
|
-
return placeInPackage_0(prependImports(sanitized, plus_2(this.
|
|
1337
|
+
return placeInPackage_0(prependImports(sanitized, plus_2(this.j1y_1, modelImports)), this.r1w(), 'generator');
|
|
1274
1338
|
};
|
|
1275
|
-
protoOf(KotlinIrEmitter).
|
|
1276
|
-
return ensureEmptyStructHasConstructor(sanitizeNames(convertWithValidation(type, module_0),
|
|
1339
|
+
protoOf(KotlinIrEmitter).kq = function (type, module_0) {
|
|
1340
|
+
return ensureEmptyStructHasConstructor(sanitizeNames(convertWithValidation(type, module_0), _get_modelSanitizationConfig__vgg831(this)));
|
|
1277
1341
|
};
|
|
1278
|
-
protoOf(KotlinIrEmitter).
|
|
1342
|
+
protoOf(KotlinIrEmitter).zr = function (enum_0, module_0) {
|
|
1279
1343
|
var tmp = sanitizeNames(convert_0(enum_0), _get_sanitizationConfig__sns434(this));
|
|
1280
1344
|
return injectEnumLabelField(tmp, KotlinIrEmitter$emit$lambda(this));
|
|
1281
1345
|
};
|
|
1282
|
-
protoOf(KotlinIrEmitter).
|
|
1346
|
+
protoOf(KotlinIrEmitter).pr = function (union) {
|
|
1283
1347
|
return sanitizeNames(convert_1(union), _get_sanitizationConfig__sns434(this));
|
|
1284
1348
|
};
|
|
1285
|
-
protoOf(KotlinIrEmitter).
|
|
1349
|
+
protoOf(KotlinIrEmitter).ur = function (refined) {
|
|
1286
1350
|
var file = sanitizeNames(convert_2(refined), _get_sanitizationConfig__sns434(this));
|
|
1287
1351
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1288
1352
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1289
|
-
var tmp0 = file.
|
|
1353
|
+
var tmp0 = file.w1n();
|
|
1290
1354
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1291
1355
|
var destination = ArrayList_init_$Create$_0();
|
|
1292
1356
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1298,13 +1362,13 @@ protoOf(KotlinIrEmitter).bv = function (refined) {
|
|
|
1298
1362
|
}
|
|
1299
1363
|
var tmp0_safe_receiver = firstOrNull_0(destination);
|
|
1300
1364
|
var updatedStruct = tmp0_safe_receiver == null ? null : markMembersAsOverride(tmp0_safe_receiver);
|
|
1301
|
-
return new File(Companion_getInstance().
|
|
1365
|
+
return new File(Companion_getInstance().n1h(sanitize_0(this, refined.sr_1)), listOfNotNull_0(updatedStruct));
|
|
1302
1366
|
};
|
|
1303
|
-
protoOf(KotlinIrEmitter).
|
|
1304
|
-
var imports = buildModelImports(endpoint, this.
|
|
1367
|
+
protoOf(KotlinIrEmitter).as = function (endpoint) {
|
|
1368
|
+
var imports = buildModelImports(endpoint, this.r1w());
|
|
1305
1369
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1306
1370
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1307
|
-
var tmp0 = convert_3(endpoint).
|
|
1371
|
+
var tmp0 = convert_3(endpoint).w1n();
|
|
1308
1372
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1309
1373
|
var destination = ArrayList_init_$Create$_0();
|
|
1310
1374
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1316,8 +1380,8 @@ protoOf(KotlinIrEmitter).hv = function (endpoint) {
|
|
|
1316
1380
|
}
|
|
1317
1381
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1318
1382
|
var endpointNamespace = ensureNotNull(tmp$ret$2);
|
|
1319
|
-
var body = injectCompanionObject(endpointNamespace, endpoint);
|
|
1320
|
-
var tmp = sanitizeNames(new File(Companion_getInstance().
|
|
1383
|
+
var body = injectApiAlias(injectCompanionObject(endpointNamespace, endpoint));
|
|
1384
|
+
var tmp = sanitizeNames(new File(Companion_getInstance().n1h(sanitize_0(this, endpoint.up_1)), listOf(body)), _get_sanitizationConfig__sns434(this));
|
|
1321
1385
|
// Inline function 'kotlin.takeIf' call
|
|
1322
1386
|
var tmp_0;
|
|
1323
1387
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
@@ -1329,10 +1393,10 @@ protoOf(KotlinIrEmitter).hv = function (endpoint) {
|
|
|
1329
1393
|
var tmp$ret$5 = tmp_0;
|
|
1330
1394
|
return prependImports(tmp, tmp$ret$5);
|
|
1331
1395
|
};
|
|
1332
|
-
protoOf(KotlinIrEmitter).
|
|
1396
|
+
protoOf(KotlinIrEmitter).or = function (channel) {
|
|
1333
1397
|
var tmp = sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1334
1398
|
// Inline function 'kotlin.takeIf' call
|
|
1335
|
-
var this_0 = buildModelImports(channel, this.
|
|
1399
|
+
var this_0 = buildModelImports(channel, this.r1w());
|
|
1336
1400
|
var tmp_0;
|
|
1337
1401
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1338
1402
|
if (!this_0.r()) {
|
|
@@ -1343,25 +1407,25 @@ protoOf(KotlinIrEmitter).vu = function (channel) {
|
|
|
1343
1407
|
var tmp$ret$2 = tmp_0;
|
|
1344
1408
|
return prependImports(tmp, tmp$ret$2);
|
|
1345
1409
|
};
|
|
1346
|
-
protoOf(KotlinIrEmitter).
|
|
1347
|
-
var imports = buildModelImports(endpoint, this.
|
|
1348
|
-
var endpointImport = import_0(this.
|
|
1410
|
+
protoOf(KotlinIrEmitter).y1v = function (endpoint) {
|
|
1411
|
+
var imports = buildModelImports(endpoint, this.r1w());
|
|
1412
|
+
var endpointImport = import_0(this.r1w().ds_1 + '.endpoint', endpoint.up_1.l1());
|
|
1349
1413
|
var file = sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this));
|
|
1350
|
-
var subPackageName = plus_0(this.
|
|
1351
|
-
var tmp = Companion_getInstance().
|
|
1414
|
+
var subPackageName = plus_0(this.r1w(), 'client');
|
|
1415
|
+
var tmp = Companion_getInstance().n1h(subPackageName.fs() + file.u1n_1.y1i());
|
|
1352
1416
|
// Inline function 'kotlin.collections.buildList' call
|
|
1353
1417
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1354
1418
|
// Inline function 'kotlin.apply' call
|
|
1355
1419
|
var this_0 = ArrayList_init_$Create$_0();
|
|
1356
|
-
this_0.x(new Package(subPackageName.
|
|
1357
|
-
this_0.
|
|
1358
|
-
this_0.
|
|
1420
|
+
this_0.x(new Package(subPackageName.ds_1));
|
|
1421
|
+
this_0.f1(this.j1y_1);
|
|
1422
|
+
this_0.f1(imports);
|
|
1359
1423
|
this_0.x(endpointImport);
|
|
1360
|
-
this_0.
|
|
1361
|
-
var tmp$ret$3 = this_0.
|
|
1424
|
+
this_0.f1(file.v1n_1);
|
|
1425
|
+
var tmp$ret$3 = this_0.o5();
|
|
1362
1426
|
return new File(tmp, tmp$ret$3);
|
|
1363
1427
|
};
|
|
1364
|
-
protoOf(KotlinIrEmitter).
|
|
1428
|
+
protoOf(KotlinIrEmitter).w1v = function (endpoints, logger) {
|
|
1365
1429
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1366
1430
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1367
1431
|
var destination = ArrayList_init_$Create$_0();
|
|
@@ -1377,7 +1441,7 @@ protoOf(KotlinIrEmitter).c1z = function (endpoints, logger) {
|
|
|
1377
1441
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1378
1442
|
while (_iterator__ex2g4s_0.u()) {
|
|
1379
1443
|
var e = _iterator__ex2g4s_0.v();
|
|
1380
|
-
var key = e.
|
|
1444
|
+
var key = e.bv_1;
|
|
1381
1445
|
if (set.x(key)) {
|
|
1382
1446
|
list_0.x(e);
|
|
1383
1447
|
}
|
|
@@ -1388,7 +1452,7 @@ protoOf(KotlinIrEmitter).c1z = function (endpoints, logger) {
|
|
|
1388
1452
|
var _iterator__ex2g4s_1 = list_0.t();
|
|
1389
1453
|
while (_iterator__ex2g4s_1.u()) {
|
|
1390
1454
|
var item = _iterator__ex2g4s_1.v();
|
|
1391
|
-
var tmp$ret$5 = import_0(this.
|
|
1455
|
+
var tmp$ret$5 = import_0(this.r1w().ds_1 + '.model', item.bv_1);
|
|
1392
1456
|
destination_0.x(tmp$ret$5);
|
|
1393
1457
|
}
|
|
1394
1458
|
var imports = destination_0;
|
|
@@ -1398,7 +1462,7 @@ protoOf(KotlinIrEmitter).c1z = function (endpoints, logger) {
|
|
|
1398
1462
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1399
1463
|
while (_iterator__ex2g4s_2.u()) {
|
|
1400
1464
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
1401
|
-
var tmp$ret$8 = import_0(this.
|
|
1465
|
+
var tmp$ret$8 = import_0(this.r1w().ds_1 + '.endpoint', item_0.up_1.l1());
|
|
1402
1466
|
destination_1.x(tmp$ret$8);
|
|
1403
1467
|
}
|
|
1404
1468
|
var endpointImports = destination_1;
|
|
@@ -1408,22 +1472,22 @@ protoOf(KotlinIrEmitter).c1z = function (endpoints, logger) {
|
|
|
1408
1472
|
var _iterator__ex2g4s_3 = endpoints.t();
|
|
1409
1473
|
while (_iterator__ex2g4s_3.u()) {
|
|
1410
1474
|
var item_1 = _iterator__ex2g4s_3.v();
|
|
1411
|
-
var tmp$ret$11 = import_0(this.
|
|
1475
|
+
var tmp$ret$11 = import_0(this.r1w().ds_1 + '.client', item_1.up_1.l1() + 'Client');
|
|
1412
1476
|
destination_2.x(tmp$ret$11);
|
|
1413
1477
|
}
|
|
1414
1478
|
var clientImports = destination_2;
|
|
1415
1479
|
var allImports = plus_2(plus_2(imports, endpointImports), clientImports);
|
|
1416
1480
|
var file = sanitizeNames(emitClient.call(this, endpoints, logger), _get_sanitizationConfig__sns434(this));
|
|
1417
|
-
var tmp = Companion_getInstance().
|
|
1481
|
+
var tmp = Companion_getInstance().n1h(this.r1w().fs() + file.u1n_1.y1i());
|
|
1418
1482
|
// Inline function 'kotlin.collections.buildList' call
|
|
1419
1483
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1420
1484
|
// Inline function 'kotlin.apply' call
|
|
1421
1485
|
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.
|
|
1486
|
+
this_0.x(new Package(this.r1w().ds_1));
|
|
1487
|
+
this_0.f1(this.j1y_1);
|
|
1488
|
+
this_0.f1(allImports);
|
|
1489
|
+
this_0.f1(file.v1n_1);
|
|
1490
|
+
var tmp$ret$17 = this_0.o5();
|
|
1427
1491
|
return new File(tmp, tmp$ret$17);
|
|
1428
1492
|
};
|
|
1429
1493
|
function buildModelImports(_this__u8e3s4, packageName) {
|
|
@@ -1434,7 +1498,7 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1434
1498
|
var _iterator__ex2g4s = this_0.t();
|
|
1435
1499
|
while (_iterator__ex2g4s.u()) {
|
|
1436
1500
|
var e = _iterator__ex2g4s.v();
|
|
1437
|
-
var key = e.
|
|
1501
|
+
var key = e.bv_1;
|
|
1438
1502
|
if (set.x(key)) {
|
|
1439
1503
|
list.x(e);
|
|
1440
1504
|
}
|
|
@@ -1445,11 +1509,28 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1445
1509
|
var _iterator__ex2g4s_0 = list.t();
|
|
1446
1510
|
while (_iterator__ex2g4s_0.u()) {
|
|
1447
1511
|
var item = _iterator__ex2g4s_0.v();
|
|
1448
|
-
var tmp$ret$2 = import_0(packageName.
|
|
1512
|
+
var tmp$ret$2 = import_0(packageName.ds_1 + '.model', Companion_getInstance().n1h(item.bv_1).y1i());
|
|
1449
1513
|
destination.x(tmp$ret$2);
|
|
1450
1514
|
}
|
|
1451
1515
|
return destination;
|
|
1452
1516
|
}
|
|
1517
|
+
function injectApiAlias(_this__u8e3s4) {
|
|
1518
|
+
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1519
|
+
var scope = new TransformScope(_this__u8e3s4);
|
|
1520
|
+
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1521
|
+
var tmp = scope;
|
|
1522
|
+
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1523
|
+
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1524
|
+
var this_0 = scope.f1v_1;
|
|
1525
|
+
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1526
|
+
// Inline function 'kotlin.apply' call
|
|
1527
|
+
var this_1 = new TransformerBuilder();
|
|
1528
|
+
this_1.w1i(injectApiAlias$lambda);
|
|
1529
|
+
var tmp$ret$2 = this_1.x1i();
|
|
1530
|
+
tmp.f1v_1 = transform(this_0, tmp$ret$2);
|
|
1531
|
+
var tmp_0 = scope.f1v_1;
|
|
1532
|
+
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1533
|
+
}
|
|
1453
1534
|
function injectCompanionObject(_this__u8e3s4, endpoint) {
|
|
1454
1535
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1455
1536
|
var scope = new TransformScope(_this__u8e3s4);
|
|
@@ -1457,31 +1538,49 @@ function injectCompanionObject(_this__u8e3s4, endpoint) {
|
|
|
1457
1538
|
var tmp = scope;
|
|
1458
1539
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1459
1540
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1460
|
-
var this_0 = scope.
|
|
1541
|
+
var this_0 = scope.f1v_1;
|
|
1461
1542
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1462
1543
|
// Inline function 'kotlin.apply' call
|
|
1463
1544
|
var this_1 = new TransformerBuilder();
|
|
1464
|
-
this_1.
|
|
1465
|
-
var tmp$ret$2 = this_1.
|
|
1466
|
-
tmp.
|
|
1467
|
-
var tmp_0 = scope.
|
|
1545
|
+
this_1.w1i(injectCompanionObject$lambda(endpoint));
|
|
1546
|
+
var tmp$ret$2 = this_1.x1i();
|
|
1547
|
+
tmp.f1v_1 = transform(this_0, tmp$ret$2);
|
|
1548
|
+
var tmp_0 = scope.f1v_1;
|
|
1468
1549
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1469
1550
|
}
|
|
1470
1551
|
function buildCompanionObject(endpoint) {
|
|
1471
|
-
var pathTemplate = '/' + joinToString(endpoint.
|
|
1552
|
+
var pathTemplate = '/' + joinToString(endpoint.wp_1, '/', VOID, VOID, VOID, VOID, buildCompanionObject$lambda);
|
|
1472
1553
|
// 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.
|
|
1554
|
+
var p0 = trimMargin('\n |companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n | override val pathTemplate = "' + pathTemplate + '"\n | override val method = "' + endpoint.vp_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
1555
|
return raw(p0);
|
|
1475
1556
|
}
|
|
1557
|
+
function injectApiAlias$lambda(element, transformer) {
|
|
1558
|
+
var tmp;
|
|
1559
|
+
if (element instanceof Namespace) {
|
|
1560
|
+
var injected = listOf(raw('val api = Handler'));
|
|
1561
|
+
var tmp_0;
|
|
1562
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1563
|
+
if (!injected.r()) {
|
|
1564
|
+
tmp_0 = withElements(element, plus_2(element.w1n(), injected));
|
|
1565
|
+
} else {
|
|
1566
|
+
tmp_0 = element;
|
|
1567
|
+
}
|
|
1568
|
+
tmp = tmp_0;
|
|
1569
|
+
} else {
|
|
1570
|
+
tmp = element;
|
|
1571
|
+
}
|
|
1572
|
+
var transformed = tmp;
|
|
1573
|
+
return transformChildren_0(transformed, transformer);
|
|
1574
|
+
}
|
|
1476
1575
|
function injectCompanionObject$lambda($endpoint) {
|
|
1477
1576
|
return function (element, transformer) {
|
|
1478
1577
|
var tmp;
|
|
1479
1578
|
if (element instanceof Interface) {
|
|
1480
|
-
var injected = element.
|
|
1579
|
+
var injected = element.o1o_1.equals(Companion_getInstance().n1h('Handler')) ? listOf(buildCompanionObject($endpoint)) : emptyList();
|
|
1481
1580
|
var tmp_0;
|
|
1482
1581
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1483
1582
|
if (!injected.r()) {
|
|
1484
|
-
tmp_0 = withElements(element, plus_2(element.
|
|
1583
|
+
tmp_0 = withElements(element, plus_2(element.w1n(), injected));
|
|
1485
1584
|
} else {
|
|
1486
1585
|
tmp_0 = element;
|
|
1487
1586
|
}
|
|
@@ -1496,10 +1595,10 @@ function injectCompanionObject$lambda($endpoint) {
|
|
|
1496
1595
|
function buildCompanionObject$lambda(it) {
|
|
1497
1596
|
var tmp;
|
|
1498
1597
|
if (it instanceof Literal) {
|
|
1499
|
-
tmp = it.
|
|
1598
|
+
tmp = it.xq_1;
|
|
1500
1599
|
} else {
|
|
1501
1600
|
if (it instanceof Param) {
|
|
1502
|
-
tmp = '{' + it.
|
|
1601
|
+
tmp = '{' + it.bq_1.l1() + '}';
|
|
1503
1602
|
} else {
|
|
1504
1603
|
noWhenBranchMatchedException();
|
|
1505
1604
|
}
|
|
@@ -1510,8 +1609,8 @@ function KotlinRefinedTypeDefinitionEmitter() {
|
|
|
1510
1609
|
}
|
|
1511
1610
|
function KotlinShared() {
|
|
1512
1611
|
KotlinShared_instance = this;
|
|
1513
|
-
this.
|
|
1514
|
-
this.
|
|
1612
|
+
this.y1x_1 = 'community.flock.wirespec.kotlin';
|
|
1613
|
+
this.z1x_1 = trimMargin('\n |package ' + this.y1x_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> {\n |' + Spacer_instance.hs(2) + 'val value: T\n |' + Spacer_instance.hs(2) + 'fun validate(): Boolean\n |' + Spacer_instance.toString() + '}\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.hs(2) + 'fun to(request: Req): RawRequest\n |' + Spacer_instance.hs(2) + 'fun from(response: RawResponse): Res\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req : Request<*>, Res : Response<*>> {\n |' + Spacer_instance.hs(2) + 'val pathTemplate: String\n |' + Spacer_instance.hs(2) + 'val method: String\n |' + Spacer_instance.hs(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.hs(2) + 'val pathTemplate: String\n |' + Spacer_instance.hs(2) + 'val method: String\n |' + Spacer_instance.hs(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
1614
|
}
|
|
1516
1615
|
protoOf(KotlinShared).toString = function () {
|
|
1517
1616
|
return 'KotlinShared';
|
|
@@ -1534,12 +1633,12 @@ function KotlinShared_getInstance() {
|
|
|
1534
1633
|
}
|
|
1535
1634
|
function KotlinTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
1536
1635
|
return function (it) {
|
|
1537
|
-
return this$0.
|
|
1636
|
+
return this$0.nq(it);
|
|
1538
1637
|
};
|
|
1539
1638
|
}
|
|
1540
1639
|
function KotlinTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
1541
1640
|
return function (it) {
|
|
1542
|
-
return Spacer_instance.toString() + 'val ' + this$0.
|
|
1641
|
+
return Spacer_instance.toString() + 'val ' + this$0.mq(it) + ',';
|
|
1543
1642
|
};
|
|
1544
1643
|
}
|
|
1545
1644
|
function KotlinTypeDefinitionEmitter() {
|
|
@@ -1547,31 +1646,31 @@ function KotlinTypeDefinitionEmitter() {
|
|
|
1547
1646
|
function KotlinUnionDefinitionEmitter() {
|
|
1548
1647
|
}
|
|
1549
1648
|
//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).
|
|
1649
|
+
protoOf(KotlinEmitter).kq = emit_4;
|
|
1650
|
+
protoOf(KotlinEmitter).lq = emit_5;
|
|
1651
|
+
protoOf(KotlinEmitter).mq = emit_6;
|
|
1652
|
+
protoOf(KotlinEmitter).nq = emit_7;
|
|
1653
|
+
protoOf(KotlinEmitter).oq = emit_8;
|
|
1654
|
+
protoOf(KotlinEmitter).zr = emit_11;
|
|
1655
|
+
protoOf(KotlinEmitter).ur = emit_10;
|
|
1656
|
+
protoOf(KotlinEmitter).as = emit_13;
|
|
1657
|
+
protoOf(KotlinEmitter).pr = emit_12;
|
|
1658
|
+
protoOf(KotlinEmitter).nr = emit_3;
|
|
1659
|
+
protoOf(KotlinEmitter).or = emit_9;
|
|
1660
|
+
protoOf(KotlinEmitter).e1x = emit_14;
|
|
1661
|
+
protoOf(KotlinEmitter).f1x = emit_15;
|
|
1662
|
+
protoOf(KotlinEmitter).bs = emitValidator;
|
|
1663
|
+
protoOf(KotlinEmitter).r1x = sanitize;
|
|
1664
|
+
protoOf(KotlinEmitter).g1x = sanitizeFirstIsDigit;
|
|
1665
|
+
protoOf(KotlinEmitter).h1x = sanitizeKeywords;
|
|
1666
|
+
protoOf(KotlinEmitter).i1x = emitHandleFunction;
|
|
1667
|
+
protoOf(KotlinEmitter).a1y = emitRequestHeaders;
|
|
1668
|
+
protoOf(KotlinEmitter).b1y = emitQueries;
|
|
1669
|
+
protoOf(KotlinEmitter).c1y = emitBody;
|
|
1670
|
+
protoOf(KotlinEmitter).d1y = emitHeaders;
|
|
1671
|
+
protoOf(KotlinIrEmitter).eo = emit_1;
|
|
1672
|
+
protoOf(KotlinIrEmitter).u1v = emit_2;
|
|
1673
|
+
protoOf(KotlinIrEmitter).x1v = beforeGenerate;
|
|
1575
1674
|
//endregion
|
|
1576
1675
|
//region block: exports
|
|
1577
1676
|
export {
|