@flock/wirespec 0.19.6 → 0.19.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/clikt-clikt-mordant.mjs +79 -79
- package/clikt-clikt.mjs +1265 -1265
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +406 -406
- package/kotlin-kotlin-stdlib.mjs +6 -6
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +9383 -9383
- package/kotlin-rgxgen.mjs +1757 -1757
- package/kotlinx-io-kotlinx-io-core.mjs +397 -397
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1708 -1708
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1449 -1449
- package/mordant-mordant.mjs +1097 -1097
- package/package.json +2 -2
- package/wirespec-src-compiler-core.mjs +973 -968
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +416 -416
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +295 -295
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +381 -381
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +377 -377
- package/wirespec-src-compiler-emitters-scala.mjs +153 -153
- package/wirespec-src-compiler-emitters-typescript.mjs +400 -400
- package/wirespec-src-compiler-emitters-wirespec.mjs +89 -79
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3425 -3425
- package/wirespec-src-compiler-lib.mjs +343 -343
- package/wirespec-src-converter-avro.mjs +499 -499
- package/wirespec-src-converter-openapi.mjs +555 -555
- package/wirespec-src-ide-lsp.mjs +1350 -1350
- package/wirespec-src-plugin-arguments.mjs +121 -121
- package/wirespec-src-plugin-cli.mjs +91 -91
- package/wirespec-src-plugin-npm.mjs +26 -26
- package/wirespec-src-tools-generator.mjs +23 -23
|
@@ -173,10 +173,10 @@ import {
|
|
|
173
173
|
function emit_3(identifier) {
|
|
174
174
|
var tmp;
|
|
175
175
|
if (identifier instanceof DefinitionIdentifier) {
|
|
176
|
-
tmp = this.
|
|
176
|
+
tmp = this.x1x(identifier);
|
|
177
177
|
} else {
|
|
178
178
|
if (identifier instanceof FieldIdentifier) {
|
|
179
|
-
tmp = this.
|
|
179
|
+
tmp = this.n1x(this.x1x(identifier));
|
|
180
180
|
} else {
|
|
181
181
|
noWhenBranchMatchedException();
|
|
182
182
|
}
|
|
@@ -194,11 +194,11 @@ function sanitize(_this__u8e3s4) {
|
|
|
194
194
|
var item = _iterator__ex2g4s.v();
|
|
195
195
|
var _unary__edvuaz = index;
|
|
196
196
|
index = _unary__edvuaz + 1 | 0;
|
|
197
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
197
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.fr(item) : item;
|
|
198
198
|
destination.x(tmp$ret$0);
|
|
199
199
|
}
|
|
200
200
|
var tmp = asSequence(joinToString(destination, ''));
|
|
201
|
-
return this.
|
|
201
|
+
return this.m1x(joinToString_0(filter(tmp, KotlinIdentifierEmitter$sanitize$lambda), ''));
|
|
202
202
|
}
|
|
203
203
|
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
204
204
|
var tmp;
|
|
@@ -218,18 +218,18 @@ function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
|
218
218
|
return tmp;
|
|
219
219
|
}
|
|
220
220
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
221
|
-
return Companion_getInstance_0().
|
|
221
|
+
return Companion_getInstance_0().k1y_1.u1(_this__u8e3s4) ? addBackticks(_this__u8e3s4) : _this__u8e3s4;
|
|
222
222
|
}
|
|
223
223
|
initMetadataForInterface(KotlinIdentifierEmitter, 'KotlinIdentifierEmitter');
|
|
224
224
|
function emit_4(type, module_0) {
|
|
225
225
|
var tmp;
|
|
226
|
-
if (type.
|
|
227
|
-
tmp = 'data object ' + this.
|
|
226
|
+
if (type.np_1.jp_1.r()) {
|
|
227
|
+
tmp = 'data object ' + this.or(type.mp_1);
|
|
228
228
|
} else {
|
|
229
|
-
var tmp_0 = this.
|
|
230
|
-
var tmp_1 = this.
|
|
229
|
+
var tmp_0 = this.or(type.mp_1);
|
|
230
|
+
var tmp_1 = this.mq(type.np_1);
|
|
231
231
|
// Inline function 'kotlin.run' call
|
|
232
|
-
var $this$run = type.
|
|
232
|
+
var $this$run = type.op_1;
|
|
233
233
|
var tmp_2;
|
|
234
234
|
if ($this$run.r()) {
|
|
235
235
|
tmp_2 = '';
|
|
@@ -242,18 +242,18 @@ function emit_4(type, module_0) {
|
|
|
242
242
|
return tmp;
|
|
243
243
|
}
|
|
244
244
|
function emit_5(_this__u8e3s4) {
|
|
245
|
-
return dropLast(joinToString(_this__u8e3s4.
|
|
245
|
+
return dropLast(joinToString(_this__u8e3s4.jp_1, '\n', VOID, VOID, VOID, VOID, KotlinTypeDefinitionEmitter$emit$lambda_0(this)), 1);
|
|
246
246
|
}
|
|
247
247
|
function emit_6(_this__u8e3s4) {
|
|
248
|
-
return this.
|
|
248
|
+
return this.or(_this__u8e3s4.rp_1) + ': ' + this.oq(_this__u8e3s4.sp_1);
|
|
249
249
|
}
|
|
250
250
|
function emit_7(_this__u8e3s4) {
|
|
251
251
|
var tmp;
|
|
252
252
|
if (_this__u8e3s4 instanceof Dict) {
|
|
253
|
-
tmp = 'Map<String, ' + this.
|
|
253
|
+
tmp = 'Map<String, ' + this.oq(_this__u8e3s4.so_1) + '>';
|
|
254
254
|
} else {
|
|
255
255
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
256
|
-
tmp = 'List<' + this.
|
|
256
|
+
tmp = 'List<' + this.oq(_this__u8e3s4.po_1) + '>';
|
|
257
257
|
} else {
|
|
258
258
|
if (_this__u8e3s4 instanceof Unit) {
|
|
259
259
|
tmp = 'Unit';
|
|
@@ -262,17 +262,17 @@ function emit_7(_this__u8e3s4) {
|
|
|
262
262
|
tmp = 'Any';
|
|
263
263
|
} else {
|
|
264
264
|
if (_this__u8e3s4 instanceof Custom) {
|
|
265
|
-
tmp = _this__u8e3s4.
|
|
265
|
+
tmp = _this__u8e3s4.cv_1;
|
|
266
266
|
} else {
|
|
267
267
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
268
|
-
var t = _this__u8e3s4.
|
|
268
|
+
var t = _this__u8e3s4.gv_1;
|
|
269
269
|
var tmp_0;
|
|
270
270
|
if (t instanceof String_0) {
|
|
271
271
|
tmp_0 = 'String';
|
|
272
272
|
} else {
|
|
273
273
|
if (t instanceof Integer) {
|
|
274
274
|
var tmp_1;
|
|
275
|
-
switch (t.
|
|
275
|
+
switch (t.ku_1.b3_1) {
|
|
276
276
|
case 0:
|
|
277
277
|
tmp_1 = 'Int';
|
|
278
278
|
break;
|
|
@@ -287,7 +287,7 @@ function emit_7(_this__u8e3s4) {
|
|
|
287
287
|
} else {
|
|
288
288
|
if (t instanceof Number_0) {
|
|
289
289
|
var tmp_2;
|
|
290
|
-
switch (t.
|
|
290
|
+
switch (t.nu_1.b3_1) {
|
|
291
291
|
case 0:
|
|
292
292
|
tmp_2 = 'Float';
|
|
293
293
|
break;
|
|
@@ -323,15 +323,15 @@ function emit_7(_this__u8e3s4) {
|
|
|
323
323
|
}
|
|
324
324
|
// Inline function 'kotlin.let' call
|
|
325
325
|
var it = tmp;
|
|
326
|
-
return _this__u8e3s4.
|
|
326
|
+
return _this__u8e3s4.uu() ? it + '?' : it;
|
|
327
327
|
}
|
|
328
328
|
function emit_8(_this__u8e3s4) {
|
|
329
329
|
var tmp;
|
|
330
330
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
331
|
-
tmp = 'Regex("""' + this.
|
|
331
|
+
tmp = 'Regex("""' + this.qq(_this__u8e3s4.qt_1) + '""").matches(value)';
|
|
332
332
|
} else {
|
|
333
333
|
if (_this__u8e3s4 instanceof Bound) {
|
|
334
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
334
|
+
var tmp1_safe_receiver = _this__u8e3s4.gu_1;
|
|
335
335
|
var tmp_0;
|
|
336
336
|
if (tmp1_safe_receiver == null) {
|
|
337
337
|
tmp_0 = null;
|
|
@@ -340,7 +340,7 @@ function emit_8(_this__u8e3s4) {
|
|
|
340
340
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
341
341
|
}
|
|
342
342
|
var minCheck = tmp_0;
|
|
343
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
343
|
+
var tmp2_safe_receiver = _this__u8e3s4.hu_1;
|
|
344
344
|
var tmp_1;
|
|
345
345
|
if (tmp2_safe_receiver == null) {
|
|
346
346
|
tmp_1 = null;
|
|
@@ -368,18 +368,18 @@ function emit_8(_this__u8e3s4) {
|
|
|
368
368
|
}
|
|
369
369
|
initMetadataForInterface(KotlinTypeDefinitionEmitter, 'KotlinTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, KotlinIdentifierEmitter]);
|
|
370
370
|
function emit_9(channel) {
|
|
371
|
-
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |fun interface ' + this.
|
|
371
|
+
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |fun interface ' + this.or(channel.dp_1) + ' {\n | operator fun invoke(message: ' + this.oq(channel.ep_1) + ')\n |}\n |\n ');
|
|
372
372
|
}
|
|
373
373
|
initMetadataForInterface(KotlinChannelDefinitionEmitter, 'KotlinChannelDefinitionEmitter', VOID, VOID, [KotlinTypeDefinitionEmitter]);
|
|
374
|
-
function emit_10(
|
|
375
|
-
|
|
376
|
-
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 ');
|
|
377
|
-
}
|
|
378
|
-
initMetadataForInterface(KotlinEnumDefinitionEmitter, 'KotlinEnumDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
379
|
-
function emit_11(union) {
|
|
380
|
-
return trimMargin('\n |sealed interface ' + this.nr(union.gp_1) + '\n |\n ');
|
|
374
|
+
function emit_10(union) {
|
|
375
|
+
return trimMargin('\n |sealed interface ' + this.or(union.hp_1) + '\n |\n ');
|
|
381
376
|
}
|
|
382
377
|
initMetadataForInterface(KotlinUnionDefinitionEmitter, 'KotlinUnionDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
378
|
+
function emit_11(enum_0, module_0) {
|
|
379
|
+
var tmp = this.x1x(enum_0.yr_1);
|
|
380
|
+
return trimMargin('\n |enum class ' + tmp + ' (override val label: String): Wirespec.Enum {\n |' + spacer(joinToString(enum_0.zr_1, ',\n', VOID, VOID, VOID, VOID, KotlinEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'override fun toString(): String {\n |' + Spacer_instance.is(2) + 'return label\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
381
|
+
}
|
|
382
|
+
initMetadataForInterface(KotlinEnumDefinitionEmitter, 'KotlinEnumDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
383
383
|
function emit_12(endpoint) {
|
|
384
384
|
// Inline function 'kotlin.collections.map' call
|
|
385
385
|
var this_0 = importReferences(endpoint);
|
|
@@ -388,89 +388,89 @@ function emit_12(endpoint) {
|
|
|
388
388
|
var _iterator__ex2g4s = this_0.t();
|
|
389
389
|
while (_iterator__ex2g4s.u()) {
|
|
390
390
|
var item = _iterator__ex2g4s.v();
|
|
391
|
-
var tmp$ret$0 = 'import ' + this.
|
|
391
|
+
var tmp$ret$0 = 'import ' + this.x1w().es_1 + '.model.' + item.cv_1;
|
|
392
392
|
destination.x(tmp$ret$0);
|
|
393
393
|
}
|
|
394
394
|
var tmp = destination;
|
|
395
395
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda);
|
|
396
|
-
var tmp_1 = this.
|
|
396
|
+
var tmp_1 = this.or(endpoint.vp_1);
|
|
397
397
|
var tmp_2 = get_pathParams(endpoint);
|
|
398
398
|
var tmp_3 = emitObject$default(this, tmp_2, 'Path', 'Wirespec.Path', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
399
|
-
var tmp_4 = emitObject$default(this, endpoint.
|
|
400
|
-
var tmp_5 = emitObject$default(this, endpoint.
|
|
401
|
-
var tmp_6 = this.
|
|
399
|
+
var tmp_4 = emitObject$default(this, endpoint.yp_1, 'Queries', 'Wirespec.Queries', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
400
|
+
var tmp_5 = emitObject$default(this, endpoint.zp_1, 'Headers', 'Wirespec.Request.Headers', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
401
|
+
var tmp_6 = this.k1x(first(endpoint.aq_1), endpoint);
|
|
402
402
|
var tmp_7 = Spacer_instance.toString();
|
|
403
403
|
var tmp_8 = emitStatusInterfaces(this, endpoint);
|
|
404
404
|
var tmp_9 = emitResponseInterfaces(this, endpoint);
|
|
405
|
-
var tmp_10 = distinctByStatus(endpoint.
|
|
405
|
+
var tmp_10 = distinctByStatus(endpoint.bq_1);
|
|
406
406
|
var tmp_11 = joinToString(tmp_10, '\n\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
407
407
|
var tmp_12 = Spacer_instance.toString();
|
|
408
|
-
var tmp_13 = Spacer_instance.
|
|
409
|
-
var tmp_14 = distinctByStatus(endpoint.
|
|
408
|
+
var tmp_13 = Spacer_instance.is(2);
|
|
409
|
+
var tmp_14 = distinctByStatus(endpoint.bq_1);
|
|
410
410
|
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_4(this));
|
|
411
|
-
var tmp_16 = Spacer_instance.
|
|
411
|
+
var tmp_16 = Spacer_instance.is(2);
|
|
412
412
|
var tmp_17 = Spacer_instance.toString();
|
|
413
|
-
var tmp_18 = Spacer_instance.
|
|
413
|
+
var tmp_18 = Spacer_instance.is(2);
|
|
414
414
|
// Inline function 'kotlin.collections.filter' call
|
|
415
|
-
var tmp0 = distinctByStatus(endpoint.
|
|
415
|
+
var tmp0 = distinctByStatus(endpoint.bq_1);
|
|
416
416
|
// Inline function 'kotlin.collections.filterTo' call
|
|
417
417
|
var destination_0 = ArrayList_init_$Create$_0();
|
|
418
418
|
var _iterator__ex2g4s_0 = tmp0.t();
|
|
419
419
|
while (_iterator__ex2g4s_0.u()) {
|
|
420
420
|
var element = _iterator__ex2g4s_0.v();
|
|
421
|
-
if (Companion_instance_1.
|
|
421
|
+
if (Companion_instance_1.jr(element.hq_1)) {
|
|
422
422
|
destination_0.x(element);
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
var tmp_19 = destination_0;
|
|
426
426
|
var tmp_20 = joinToString(tmp_19, '\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
427
|
-
var tmp_21 = Spacer_instance.
|
|
428
|
-
var tmp_22 = Spacer_instance.
|
|
427
|
+
var tmp_21 = Spacer_instance.is(3);
|
|
428
|
+
var tmp_22 = Spacer_instance.is(2);
|
|
429
429
|
var tmp_23 = Spacer_instance.toString();
|
|
430
|
-
var tmp_24 = Spacer_instance.
|
|
431
|
-
var tmp_25 = this.
|
|
432
|
-
var tmp_26 = Spacer_instance.
|
|
433
|
-
var tmp_27 = Spacer_instance.
|
|
434
|
-
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.
|
|
430
|
+
var tmp_24 = Spacer_instance.is(2);
|
|
431
|
+
var tmp_25 = this.o1x(endpoint);
|
|
432
|
+
var tmp_26 = Spacer_instance.is(2);
|
|
433
|
+
var tmp_27 = Spacer_instance.is(3);
|
|
434
|
+
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.xp_1, '/', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_6) + '"\n |' + Spacer_instance.is(3) + 'override val method = "' + endpoint.wp_1.toString() + '"\n |' + Spacer_instance.is(3) + 'override fun server(serialization: Wirespec.Serialization) = object : Wirespec.ServerEdge<Request, Response<*>> {\n |' + Spacer_instance.is(4) + 'override fun from(request: Wirespec.RawRequest) = fromRequest(serialization, request)\n |' + Spacer_instance.is(4) + 'override fun to(response: Response<*>) = toResponse(serialization, response)\n |' + Spacer_instance.is(3) + '}\n |' + Spacer_instance.is(3) + 'override fun client(serialization: Wirespec.Serialization) = object : Wirespec.ClientEdge<Request, Response<*>> {\n |' + Spacer_instance.is(4) + 'override fun to(request: Request) = toRequest(serialization, request)\n |' + Spacer_instance.is(4) + 'override fun from(response: Wirespec.RawResponse) = fromResponse(serialization, response)\n |' + Spacer_instance.is(3) + '}\n |' + Spacer_instance.is(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
435
435
|
}
|
|
436
436
|
function emitHandleFunction(endpoint) {
|
|
437
|
-
return 'suspend fun ' + Companion_instance_1.
|
|
437
|
+
return 'suspend fun ' + Companion_instance_1.gr(this.or(endpoint.vp_1)) + '(request: Request): Response<*>';
|
|
438
438
|
}
|
|
439
439
|
function emit_13(_this__u8e3s4, endpoint) {
|
|
440
440
|
var tmp = Spacer_instance.toString();
|
|
441
441
|
var tmp_0 = emitConstructor(this, _this__u8e3s4, endpoint);
|
|
442
|
-
var tmp_1 = Spacer_instance.
|
|
442
|
+
var tmp_1 = Spacer_instance.is(2);
|
|
443
443
|
var tmp_2 = get_pathParams(endpoint);
|
|
444
444
|
var tmp_3 = brace(this, joinToString(tmp_2, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_7(this)));
|
|
445
|
-
var tmp_4 = Spacer_instance.
|
|
446
|
-
var tmp_5 = Spacer_instance.
|
|
447
|
-
var tmp_6 = brace(this, joinToString(endpoint.
|
|
448
|
-
var tmp_7 = Spacer_instance.
|
|
449
|
-
var tmp_8 = brace(this, joinToString(endpoint.
|
|
450
|
-
var tmp_9 = _this__u8e3s4.
|
|
445
|
+
var tmp_4 = Spacer_instance.is(2);
|
|
446
|
+
var tmp_5 = Spacer_instance.is(2);
|
|
447
|
+
var tmp_6 = brace(this, joinToString(endpoint.yp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_8(this)));
|
|
448
|
+
var tmp_7 = Spacer_instance.is(2);
|
|
449
|
+
var tmp_8 = brace(this, joinToString(endpoint.zp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_9(this)));
|
|
450
|
+
var tmp_9 = _this__u8e3s4.eq_1 == null ? Spacer_instance.is(2) + 'override val body = Unit\n' + Spacer_instance.toString() + '}' : Spacer_instance.toString() + '}';
|
|
451
451
|
var tmp_10 = Spacer_instance.toString();
|
|
452
|
-
var tmp_11 = Spacer_instance.
|
|
453
|
-
var tmp_12 = Spacer_instance.
|
|
454
|
-
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.
|
|
452
|
+
var tmp_11 = Spacer_instance.is(2);
|
|
453
|
+
var tmp_12 = Spacer_instance.is(3);
|
|
454
|
+
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.wp_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.xp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_10(this)) + '),\n |' + Spacer_instance.is(3) + 'method = request.method.name,\n |' + Spacer_instance.is(3) + 'queries = ' + this.h1y(endpoint) + ',\n |' + Spacer_instance.is(3) + 'headers = ' + this.g1y(endpoint) + ',\n |' + Spacer_instance.is(3) + 'body = ' + (!(_this__u8e3s4.eq_1 == null) ? 'serialization.serializeBody(request.body, typeOf<' + emit_16(this, _this__u8e3s4.eq_1) + '>())' : 'null') + ',\n |' + Spacer_instance.is(2) + ')\n |\n |' + Spacer_instance.toString() + 'fun fromRequest(serialization: Wirespec.Deserializer, request: Wirespec.RawRequest): Request =\n |' + Spacer_instance.is(2) + 'Request' + emitDeserializedParams(this, _this__u8e3s4, endpoint) + '\n ');
|
|
455
455
|
}
|
|
456
456
|
function emitRequestHeaders(_this__u8e3s4) {
|
|
457
457
|
var tmp;
|
|
458
|
-
if (_this__u8e3s4.
|
|
458
|
+
if (_this__u8e3s4.zp_1.r()) {
|
|
459
459
|
tmp = 'emptyMap()';
|
|
460
460
|
} else {
|
|
461
|
-
var tmp_0 = Spacer_instance.
|
|
462
|
-
var tmp_1 = ',\n' + Spacer_instance.
|
|
463
|
-
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.
|
|
461
|
+
var tmp_0 = Spacer_instance.is(5);
|
|
462
|
+
var tmp_1 = ',\n' + Spacer_instance.is(5);
|
|
463
|
+
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.zp_1, tmp_1, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitRequestHeaders$lambda(this)) + '\n |' + Spacer_instance.is(4) + ')\n ');
|
|
464
464
|
}
|
|
465
465
|
return tmp;
|
|
466
466
|
}
|
|
467
467
|
function emitQueries(endpoint) {
|
|
468
468
|
var tmp;
|
|
469
469
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
470
|
-
if (!endpoint.
|
|
471
|
-
var tmp_0 = Spacer_instance.
|
|
472
|
-
var tmp_1 = ',\n' + Spacer_instance.
|
|
473
|
-
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(endpoint.
|
|
470
|
+
if (!endpoint.yp_1.r()) {
|
|
471
|
+
var tmp_0 = Spacer_instance.is(5);
|
|
472
|
+
var tmp_1 = ',\n' + Spacer_instance.is(5);
|
|
473
|
+
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(endpoint.yp_1, tmp_1, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitQueries$lambda(this)) + '\n |' + Spacer_instance.is(4) + ')\n ');
|
|
474
474
|
} else {
|
|
475
475
|
tmp = 'emptyMap()';
|
|
476
476
|
}
|
|
@@ -478,59 +478,59 @@ function emitQueries(endpoint) {
|
|
|
478
478
|
}
|
|
479
479
|
function emit_14(_this__u8e3s4) {
|
|
480
480
|
// Inline function 'kotlin.let' call
|
|
481
|
-
var it = joinToString(_this__u8e3s4.
|
|
481
|
+
var it = joinToString(_this__u8e3s4.iq_1, ', ', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_11(this));
|
|
482
482
|
var responseHeaderFields = isBlank(it) ? '' : ', ' + it;
|
|
483
483
|
var tmp = Spacer_instance.toString();
|
|
484
|
-
var tmp_0 = emit_16(this, _this__u8e3s4.
|
|
485
|
-
var tmp_1 = toString_0(charCodeAt(_this__u8e3s4.
|
|
486
|
-
var tmp_2 = emit_16(this, _this__u8e3s4.
|
|
487
|
-
var tmp_3 = concatGenerics(emit_16(this, _this__u8e3s4.
|
|
488
|
-
var tmp_4 = Spacer_instance.
|
|
489
|
-
var tmp_5 = fixStatus(_this__u8e3s4.
|
|
490
|
-
var tmp_6 = Spacer_instance.
|
|
491
|
-
var tmp_7 = brace(this, joinToString(_this__u8e3s4.
|
|
492
|
-
return trimMargin('\n |' + tmp + 'data class Response' + _this__u8e3s4.
|
|
484
|
+
var tmp_0 = emit_16(this, _this__u8e3s4.jq_1);
|
|
485
|
+
var tmp_1 = toString_0(charCodeAt(_this__u8e3s4.hq_1, 0));
|
|
486
|
+
var tmp_2 = emit_16(this, _this__u8e3s4.jq_1);
|
|
487
|
+
var tmp_3 = concatGenerics(emit_16(this, _this__u8e3s4.jq_1));
|
|
488
|
+
var tmp_4 = Spacer_instance.is(2);
|
|
489
|
+
var tmp_5 = fixStatus(_this__u8e3s4.hq_1);
|
|
490
|
+
var tmp_6 = Spacer_instance.is(2);
|
|
491
|
+
var tmp_7 = brace(this, joinToString(_this__u8e3s4.iq_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_12(this)));
|
|
492
|
+
return trimMargin('\n |' + tmp + 'data class Response' + _this__u8e3s4.hq_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.iq_1, 'ResponseHeaders', 'Wirespec.Response.Headers', 2, KotlinEndpointDefinitionEmitter$emit$lambda_13(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
493
493
|
}
|
|
494
494
|
function emitBody(_this__u8e3s4, content) {
|
|
495
495
|
return 'serialization.serializeBody(response.body, typeOf<' + emit_16(_this__u8e3s4, content) + '>())';
|
|
496
496
|
}
|
|
497
497
|
function emitHeaders(_this__u8e3s4) {
|
|
498
498
|
var tmp;
|
|
499
|
-
if (_this__u8e3s4.
|
|
499
|
+
if (_this__u8e3s4.iq_1.r()) {
|
|
500
500
|
tmp = 'emptyMap()';
|
|
501
501
|
} else {
|
|
502
|
-
var tmp_0 = Spacer_instance.
|
|
503
|
-
var tmp_1 = ',\n' + Spacer_instance.
|
|
504
|
-
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.
|
|
502
|
+
var tmp_0 = Spacer_instance.is(5);
|
|
503
|
+
var tmp_1 = ',\n' + Spacer_instance.is(5);
|
|
504
|
+
tmp = trimMargin('\n |mapOf(\n |' + tmp_0 + joinToString(_this__u8e3s4.iq_1, tmp_1, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitHeaders$lambda(this)) + '\n |' + Spacer_instance.is(4) + ')\n ');
|
|
505
505
|
}
|
|
506
506
|
return tmp;
|
|
507
507
|
}
|
|
508
508
|
initMetadataForInterface(KotlinEndpointDefinitionEmitter, 'KotlinEndpointDefinitionEmitter', VOID, VOID, [KotlinTypeDefinitionEmitter]);
|
|
509
509
|
function emit_15(refined) {
|
|
510
|
-
return trimMargin('\n |data class ' + this.
|
|
510
|
+
return trimMargin('\n |data class ' + this.x1x(refined.tr_1) + '(override val value: ' + this.oq(refined.ur_1) + '): Wirespec.Refined<' + this.oq(refined.ur_1) + '> {\n |' + Spacer_instance.toString() + 'override fun toString() = value.toString()\n |' + Spacer_instance.toString() + 'override fun validate() = ' + this.cs(refined) + '\n |}\n |\n ');
|
|
511
511
|
}
|
|
512
512
|
function emitValidator(_this__u8e3s4) {
|
|
513
513
|
var defaultReturn = 'true';
|
|
514
|
-
var type = _this__u8e3s4.
|
|
514
|
+
var type = _this__u8e3s4.ur_1.gv_1;
|
|
515
515
|
var tmp;
|
|
516
516
|
if (type instanceof Integer) {
|
|
517
|
-
var tmp0_safe_receiver = type.
|
|
518
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
517
|
+
var tmp0_safe_receiver = type.lu_1;
|
|
518
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.pq(tmp0_safe_receiver);
|
|
519
519
|
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
520
520
|
} else {
|
|
521
521
|
if (type instanceof Number_0) {
|
|
522
|
-
var tmp2_safe_receiver = type.
|
|
523
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.
|
|
522
|
+
var tmp2_safe_receiver = type.ou_1;
|
|
523
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.pq(tmp2_safe_receiver);
|
|
524
524
|
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
525
525
|
} else {
|
|
526
526
|
if (type instanceof String_0) {
|
|
527
|
-
var tmp4_safe_receiver = type.
|
|
527
|
+
var tmp4_safe_receiver = type.iu_1;
|
|
528
528
|
var tmp_0;
|
|
529
529
|
var tmp_1 = tmp4_safe_receiver;
|
|
530
530
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
531
531
|
tmp_0 = null;
|
|
532
532
|
} else {
|
|
533
|
-
tmp_0 = this.
|
|
533
|
+
tmp_0 = this.pq(new RegExp_0(tmp4_safe_receiver));
|
|
534
534
|
}
|
|
535
535
|
var tmp5_elvis_lhs = tmp_0;
|
|
536
536
|
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
@@ -550,7 +550,7 @@ function emitValidator(_this__u8e3s4) {
|
|
|
550
550
|
return tmp;
|
|
551
551
|
}
|
|
552
552
|
initMetadataForInterface(KotlinRefinedTypeDefinitionEmitter, 'KotlinRefinedTypeDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter, KotlinTypeDefinitionEmitter]);
|
|
553
|
-
initMetadataForClass(KotlinEmitter, 'KotlinEmitter', KotlinEmitter, LanguageEmitter, [LanguageEmitter,
|
|
553
|
+
initMetadataForClass(KotlinEmitter, 'KotlinEmitter', KotlinEmitter, LanguageEmitter, [LanguageEmitter, KotlinUnionDefinitionEmitter, KotlinChannelDefinitionEmitter, KotlinTypeDefinitionEmitter, KotlinEnumDefinitionEmitter, KotlinIdentifierEmitter, KotlinEndpointDefinitionEmitter, KotlinRefinedTypeDefinitionEmitter]);
|
|
554
554
|
initMetadataForCompanion(Companion);
|
|
555
555
|
initMetadataForCompanion(Companion_0);
|
|
556
556
|
initMetadataForClass(KotlinIrEmitter, 'KotlinIrEmitter', KotlinIrEmitter, VOID, [IrEmitter]);
|
|
@@ -564,7 +564,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
564
564
|
var _iterator__ex2g4s = this_0.t();
|
|
565
565
|
while (_iterator__ex2g4s.u()) {
|
|
566
566
|
var item = _iterator__ex2g4s.v();
|
|
567
|
-
var tmp$ret$0 = 'import ' + $this.
|
|
567
|
+
var tmp$ret$0 = 'import ' + $this.x1w().es_1 + '.model.' + item.cv_1 + ';';
|
|
568
568
|
destination.x(tmp$ret$0);
|
|
569
569
|
}
|
|
570
570
|
var tmp = destination;
|
|
@@ -577,52 +577,52 @@ function KotlinChannelDefinitionEmitter$emitImports$lambda(it) {
|
|
|
577
577
|
function KotlinChannelDefinitionEmitter() {
|
|
578
578
|
}
|
|
579
579
|
function KotlinEmitter(packageName, emitShared) {
|
|
580
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
580
|
+
packageName = packageName === VOID ? Companion_instance.ds('community.flock.wirespec.generated') : packageName;
|
|
581
581
|
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
582
582
|
LanguageEmitter.call(this);
|
|
583
|
-
this.
|
|
584
|
-
this.
|
|
585
|
-
this.
|
|
586
|
-
this.
|
|
587
|
-
this.
|
|
588
|
-
this.
|
|
589
|
-
}
|
|
590
|
-
protoOf(KotlinEmitter).
|
|
591
|
-
return this.
|
|
583
|
+
this.y1x_1 = packageName;
|
|
584
|
+
this.z1x_1 = emitShared;
|
|
585
|
+
this.a1y_1 = '\nimport community.flock.wirespec.kotlin.Wirespec\nimport kotlin.reflect.typeOf\n';
|
|
586
|
+
this.b1y_1 = FileExtension_Kotlin_getInstance();
|
|
587
|
+
this.c1y_1 = KotlinShared_getInstance();
|
|
588
|
+
this.d1y_1 = '//';
|
|
589
|
+
}
|
|
590
|
+
protoOf(KotlinEmitter).x1w = function () {
|
|
591
|
+
return this.y1x_1;
|
|
592
592
|
};
|
|
593
|
-
protoOf(KotlinEmitter).
|
|
594
|
-
return this.a1y_1;
|
|
595
|
-
};
|
|
596
|
-
protoOf(KotlinEmitter).f1x = function () {
|
|
593
|
+
protoOf(KotlinEmitter).vq = function () {
|
|
597
594
|
return this.b1y_1;
|
|
598
595
|
};
|
|
599
|
-
protoOf(KotlinEmitter).
|
|
596
|
+
protoOf(KotlinEmitter).g1x = function () {
|
|
600
597
|
return this.c1y_1;
|
|
601
598
|
};
|
|
602
|
-
protoOf(KotlinEmitter).
|
|
599
|
+
protoOf(KotlinEmitter).wq = function () {
|
|
600
|
+
return this.d1y_1;
|
|
601
|
+
};
|
|
602
|
+
protoOf(KotlinEmitter).lr = function (module_0, logger) {
|
|
603
603
|
// Inline function 'kotlin.let' call
|
|
604
|
-
var it = protoOf(LanguageEmitter).
|
|
605
|
-
return this.
|
|
604
|
+
var it = protoOf(LanguageEmitter).lr.call(this, module_0, logger);
|
|
605
|
+
return this.z1x_1.xo_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.ds('community.flock.wirespec.kotlin').gs() + 'Wirespec', this.g1x().f1y_1)) : it;
|
|
606
606
|
};
|
|
607
|
-
protoOf(KotlinEmitter).
|
|
607
|
+
protoOf(KotlinEmitter).mr = function (definition, module_0, logger) {
|
|
608
608
|
// Inline function 'kotlin.let' call
|
|
609
|
-
var it = protoOf(LanguageEmitter).
|
|
610
|
-
var subPackageName = plus(this.
|
|
611
|
-
var tmp = subPackageName.
|
|
609
|
+
var it = protoOf(LanguageEmitter).mr.call(this, definition, module_0, logger);
|
|
610
|
+
var subPackageName = plus(this.x1w(), definition);
|
|
611
|
+
var tmp = subPackageName.gs() + it.yo_1;
|
|
612
612
|
// Inline function 'kotlin.text.trimStart' call
|
|
613
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + '\n |' + (Companion_instance_1.
|
|
613
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + '\n |' + (Companion_instance_1.hr(module_0) ? this.a1y_1 : '') + '\n |' + it.zo_1 + '\n ');
|
|
614
614
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
615
615
|
return new Emitted(tmp, tmp$ret$0);
|
|
616
616
|
};
|
|
617
617
|
function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
618
618
|
// Inline function 'kotlin.collections.map' call
|
|
619
|
-
var this_0 = _this__u8e3s4.
|
|
619
|
+
var this_0 = _this__u8e3s4.bq_1;
|
|
620
620
|
// Inline function 'kotlin.collections.mapTo' call
|
|
621
621
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
622
622
|
var _iterator__ex2g4s = this_0.t();
|
|
623
623
|
while (_iterator__ex2g4s.u()) {
|
|
624
624
|
var item = _iterator__ex2g4s.v();
|
|
625
|
-
var tmp$ret$0 = new Char(charCodeAt(item.
|
|
625
|
+
var tmp$ret$0 = new Char(charCodeAt(item.hq_1, 0));
|
|
626
626
|
destination.x(tmp$ret$0);
|
|
627
627
|
}
|
|
628
628
|
var tmp = distinct(destination);
|
|
@@ -630,13 +630,13 @@ function emitStatusInterfaces($this, _this__u8e3s4) {
|
|
|
630
630
|
}
|
|
631
631
|
function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
632
632
|
// Inline function 'kotlin.collections.map' call
|
|
633
|
-
var this_0 = _this__u8e3s4.
|
|
633
|
+
var this_0 = _this__u8e3s4.bq_1;
|
|
634
634
|
// Inline function 'kotlin.collections.mapTo' call
|
|
635
635
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
636
636
|
var _iterator__ex2g4s = this_0.t();
|
|
637
637
|
while (_iterator__ex2g4s.u()) {
|
|
638
638
|
var item = _iterator__ex2g4s.v();
|
|
639
|
-
var tmp$ret$0 = emit_16($this, item.
|
|
639
|
+
var tmp$ret$0 = emit_16($this, item.jq_1);
|
|
640
640
|
destination.x(tmp$ret$0);
|
|
641
641
|
}
|
|
642
642
|
var tmp = distinct(destination);
|
|
@@ -645,64 +645,64 @@ function emitResponseInterfaces($this, _this__u8e3s4) {
|
|
|
645
645
|
function emitConstructor($this, _this__u8e3s4, endpoint) {
|
|
646
646
|
var tmp = get_pathParams(endpoint);
|
|
647
647
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitConstructor$lambda($this)));
|
|
648
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
649
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
650
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
648
|
+
var tmp_1 = orNull(joinToString(endpoint.yp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitConstructor$lambda_0($this)));
|
|
649
|
+
var tmp_2 = orNull(joinToString(endpoint.zp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitConstructor$lambda_1($this)));
|
|
650
|
+
var tmp0_safe_receiver = _this__u8e3s4.eq_1;
|
|
651
651
|
var tmp_3;
|
|
652
652
|
if (tmp0_safe_receiver == null) {
|
|
653
653
|
tmp_3 = null;
|
|
654
654
|
} else {
|
|
655
655
|
// Inline function 'kotlin.let' call
|
|
656
|
-
tmp_3 = Spacer_instance.
|
|
656
|
+
tmp_3 = Spacer_instance.is(2) + 'override val body: ' + emit_16($this, tmp0_safe_receiver) + ',';
|
|
657
657
|
}
|
|
658
658
|
// Inline function 'kotlin.let' call
|
|
659
659
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
660
|
-
return isBlank(it) ? 'object Request : Wirespec.Request<' + emit_16($this, _this__u8e3s4.
|
|
660
|
+
return isBlank(it) ? 'object Request : Wirespec.Request<' + emit_16($this, _this__u8e3s4.eq_1) + '> {' : 'class Request(\n' + it + '\n' + Spacer_instance.toString() + ') : Wirespec.Request<' + emit_16($this, _this__u8e3s4.eq_1) + '> {';
|
|
661
661
|
}
|
|
662
662
|
function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
663
663
|
var tmp = get_indexedPathParams(endpoint);
|
|
664
664
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
|
|
665
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
666
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
667
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
665
|
+
var tmp_1 = orNull(joinToString(endpoint.yp_1, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
666
|
+
var tmp_2 = orNull(joinToString(endpoint.zp_1, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
667
|
+
var tmp0_safe_receiver = _this__u8e3s4.eq_1;
|
|
668
668
|
var tmp_3;
|
|
669
669
|
if (tmp0_safe_receiver == null) {
|
|
670
670
|
tmp_3 = null;
|
|
671
671
|
} else {
|
|
672
672
|
// Inline function 'kotlin.let' call
|
|
673
|
-
tmp_3 = Spacer_instance.
|
|
673
|
+
tmp_3 = Spacer_instance.is(3) + 'body = serialization.deserializeBody(requireNotNull(request.body) { "body is null" }, typeOf<' + emit_16($this, tmp0_safe_receiver) + '>()),';
|
|
674
674
|
}
|
|
675
675
|
// Inline function 'kotlin.let' call
|
|
676
676
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
677
|
-
return isBlank(it) ? '' : '(\n' + it + '\n' + Spacer_instance.
|
|
677
|
+
return isBlank(it) ? '' : '(\n' + it + '\n' + Spacer_instance.is(2) + ')';
|
|
678
678
|
}
|
|
679
679
|
function emitSerialized($this, _this__u8e3s4) {
|
|
680
|
-
return trimMargin('\n |' + Spacer_instance.
|
|
680
|
+
return trimMargin('\n |' + Spacer_instance.is(3) + 'is Response' + _this__u8e3s4.hq_1 + ' -> Wirespec.RawResponse(\n |' + Spacer_instance.is(4) + 'statusCode = response.status,\n |' + Spacer_instance.is(4) + 'headers = ' + $this.j1y(_this__u8e3s4) + ',\n |' + Spacer_instance.is(4) + 'body = ' + (!(_this__u8e3s4.jq_1 == null) ? $this.i1y($this, _this__u8e3s4.jq_1) : 'null') + ',\n |' + Spacer_instance.is(3) + ')\n ');
|
|
681
681
|
}
|
|
682
682
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
683
|
-
var tmp = Spacer_instance.
|
|
683
|
+
var tmp = Spacer_instance.is(3) + _this__u8e3s4.hq_1 + ' -> Response' + _this__u8e3s4.hq_1 + '(';
|
|
684
684
|
var tmp_0;
|
|
685
|
-
if (!(_this__u8e3s4.
|
|
686
|
-
tmp_0 = Spacer_instance.
|
|
685
|
+
if (!(_this__u8e3s4.jq_1 == null)) {
|
|
686
|
+
tmp_0 = Spacer_instance.is(4) + 'body = serialization.deserializeBody(requireNotNull(response.body) { "body is null" }, typeOf<' + emit_16($this, _this__u8e3s4.jq_1) + '>()),';
|
|
687
687
|
} else {
|
|
688
|
-
tmp_0 = Spacer_instance.
|
|
688
|
+
tmp_0 = Spacer_instance.is(4) + 'body = Unit,';
|
|
689
689
|
}
|
|
690
690
|
var tmp_1 = tmp_0;
|
|
691
|
-
return joinToString(listOfNotNull([tmp, tmp_1, orNull(joinToString(_this__u8e3s4.
|
|
691
|
+
return joinToString(listOfNotNull([tmp, tmp_1, orNull(joinToString(_this__u8e3s4.iq_1, ',\n', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emitDeserialized$lambda($this))), Spacer_instance.is(3) + ')']), '\n');
|
|
692
692
|
}
|
|
693
693
|
function emitSerializedMapEntry($this, _this__u8e3s4, type, fields) {
|
|
694
|
-
return '"' + _this__u8e3s4.
|
|
694
|
+
return '"' + _this__u8e3s4.rp_1.l1() + '" to ' + type + '.' + fields + '.' + $this.or(_this__u8e3s4.rp_1) + '?.let{ serialization.serializeParam(it, typeOf<' + $this.oq(_this__u8e3s4.sp_1) + '>()) }.orEmpty()';
|
|
695
695
|
}
|
|
696
696
|
function emitDeserialized_0($this, _this__u8e3s4) {
|
|
697
|
-
return Spacer_instance.
|
|
697
|
+
return Spacer_instance.is(3) + $this.or(_this__u8e3s4.ue_1.cq_1) + ' = serialization.deserializePath(request.path[' + _this__u8e3s4.te_1 + '], typeOf<' + $this.oq(_this__u8e3s4.ue_1.dq_1) + '>())';
|
|
698
698
|
}
|
|
699
699
|
function emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive) {
|
|
700
|
-
var trimMargin_0 = trimMargin('\n |' + Spacer_instance.
|
|
700
|
+
var trimMargin_0 = trimMargin('\n |' + Spacer_instance.is(spaces) + $this.or(_this__u8e3s4.rp_1) + ' =\n |' + Spacer_instance.is(spaces + 1 | 0) + type + '.' + fields + '\n |' + Spacer_instance.is(spaces + 2 | 0) + '.entries\n |' + Spacer_instance.is(spaces + 2 | 0) + '.find { it.key.equals("' + _this__u8e3s4.rp_1.l1() + '", ignoreCase = ' + !caseSensitive + ') }\n |' + Spacer_instance.is(spaces + 2 | 0) + '?.let { serialization.deserializeParam(it.value, typeOf<' + $this.oq(_this__u8e3s4.sp_1) + '>()) }\n ');
|
|
701
701
|
var tmp;
|
|
702
|
-
if (_this__u8e3s4.
|
|
702
|
+
if (_this__u8e3s4.sp_1.uu()) {
|
|
703
703
|
tmp = trimMargin_0;
|
|
704
704
|
} else {
|
|
705
|
-
tmp = trimMargin_0 + '\n' + Spacer_instance.
|
|
705
|
+
tmp = trimMargin_0 + '\n' + Spacer_instance.is(spaces + 2 | 0) + '?: throw IllegalArgumentException("' + $this.or(_this__u8e3s4.rp_1) + ' is null")';
|
|
706
706
|
}
|
|
707
707
|
return tmp;
|
|
708
708
|
}
|
|
@@ -712,16 +712,16 @@ function emitDeserializedParams$default($this, _this__u8e3s4, type, fields, spac
|
|
|
712
712
|
return emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive);
|
|
713
713
|
}
|
|
714
714
|
function emitIdentifier($this, _this__u8e3s4) {
|
|
715
|
-
return 'request.path.' + $this.
|
|
715
|
+
return 'request.path.' + $this.or(_this__u8e3s4.cq_1) + '.let{serialization.serializePath(it, typeOf<' + $this.oq(_this__u8e3s4.dq_1) + '>())}';
|
|
716
716
|
}
|
|
717
717
|
function emit_16($this, _this__u8e3s4) {
|
|
718
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
719
|
-
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : $this.
|
|
718
|
+
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.gq_1;
|
|
719
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : $this.oq(tmp1_safe_receiver);
|
|
720
720
|
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : removeQuestionMark(tmp2_safe_receiver);
|
|
721
721
|
return tmp3_elvis_lhs == null ? 'Unit' : tmp3_elvis_lhs;
|
|
722
722
|
}
|
|
723
723
|
function emit_17($this, _this__u8e3s4) {
|
|
724
|
-
return $this.
|
|
724
|
+
return $this.or(_this__u8e3s4.cq_1) + ': ' + $this.oq(_this__u8e3s4.dq_1);
|
|
725
725
|
}
|
|
726
726
|
function brace($this, _this__u8e3s4) {
|
|
727
727
|
return wrap($this, _this__u8e3s4, '(', ')');
|
|
@@ -739,10 +739,10 @@ function wrap($this, _this__u8e3s4, prefix, postfix) {
|
|
|
739
739
|
function emitObject($this, _this__u8e3s4, name, extends_0, spaces, block) {
|
|
740
740
|
var tmp;
|
|
741
741
|
if (_this__u8e3s4.r()) {
|
|
742
|
-
tmp = Spacer_instance.
|
|
742
|
+
tmp = Spacer_instance.is(spaces) + 'data object ' + name + ' : ' + extends_0;
|
|
743
743
|
} else {
|
|
744
|
-
var tmp_0 = Spacer_instance.
|
|
745
|
-
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.
|
|
744
|
+
var tmp_0 = Spacer_instance.is(spaces);
|
|
745
|
+
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.is(spaces) + ') : ' + extends_0 + '\n ');
|
|
746
746
|
}
|
|
747
747
|
return tmp;
|
|
748
748
|
}
|
|
@@ -761,17 +761,17 @@ function KotlinEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
|
761
761
|
}
|
|
762
762
|
function KotlinEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
763
763
|
return function (it) {
|
|
764
|
-
return this$0.
|
|
764
|
+
return this$0.nq(it);
|
|
765
765
|
};
|
|
766
766
|
}
|
|
767
767
|
function KotlinEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
768
768
|
return function (it) {
|
|
769
|
-
return this$0.
|
|
769
|
+
return this$0.nq(it);
|
|
770
770
|
};
|
|
771
771
|
}
|
|
772
772
|
function KotlinEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
773
773
|
return function (it) {
|
|
774
|
-
return this$0.
|
|
774
|
+
return this$0.l1x(it);
|
|
775
775
|
};
|
|
776
776
|
}
|
|
777
777
|
function KotlinEndpointDefinitionEmitter$emit$lambda_4(this$0) {
|
|
@@ -795,24 +795,24 @@ function KotlinEndpointDefinitionEmitter$emitResponseInterfaces$lambda(it) {
|
|
|
795
795
|
}
|
|
796
796
|
function KotlinEndpointDefinitionEmitter$emit$lambda_7(this$0) {
|
|
797
797
|
return function (it) {
|
|
798
|
-
return this$0.
|
|
798
|
+
return this$0.or(it.cq_1);
|
|
799
799
|
};
|
|
800
800
|
}
|
|
801
801
|
function KotlinEndpointDefinitionEmitter$emit$lambda_8(this$0) {
|
|
802
802
|
return function (it) {
|
|
803
|
-
return this$0.
|
|
803
|
+
return this$0.or(it.rp_1);
|
|
804
804
|
};
|
|
805
805
|
}
|
|
806
806
|
function KotlinEndpointDefinitionEmitter$emit$lambda_9(this$0) {
|
|
807
807
|
return function (it) {
|
|
808
|
-
return this$0.
|
|
808
|
+
return this$0.or(it.rp_1);
|
|
809
809
|
};
|
|
810
810
|
}
|
|
811
811
|
function KotlinEndpointDefinitionEmitter$emit$lambda_10(this$0) {
|
|
812
812
|
return function (it) {
|
|
813
813
|
var tmp;
|
|
814
814
|
if (it instanceof Literal) {
|
|
815
|
-
tmp = '"' + it.
|
|
815
|
+
tmp = '"' + it.yq_1 + '"';
|
|
816
816
|
} else {
|
|
817
817
|
if (it instanceof Param) {
|
|
818
818
|
tmp = emitIdentifier(this$0, it);
|
|
@@ -835,32 +835,32 @@ function KotlinEndpointDefinitionEmitter$emitQueries$lambda(this$0) {
|
|
|
835
835
|
}
|
|
836
836
|
function KotlinEndpointDefinitionEmitter$emit$lambda_11(this$0) {
|
|
837
837
|
return function (it) {
|
|
838
|
-
return 'val ' + this$0.
|
|
838
|
+
return 'val ' + this$0.nq(it);
|
|
839
839
|
};
|
|
840
840
|
}
|
|
841
841
|
function KotlinEndpointDefinitionEmitter$emit$lambda_12(this$0) {
|
|
842
842
|
return function (it) {
|
|
843
|
-
return this$0.
|
|
843
|
+
return this$0.or(it.rp_1);
|
|
844
844
|
};
|
|
845
845
|
}
|
|
846
846
|
function KotlinEndpointDefinitionEmitter$emit$lambda_13(this$0) {
|
|
847
847
|
return function (it) {
|
|
848
|
-
return this$0.
|
|
848
|
+
return this$0.nq(it);
|
|
849
849
|
};
|
|
850
850
|
}
|
|
851
851
|
function KotlinEndpointDefinitionEmitter$emitConstructor$lambda(this$0) {
|
|
852
852
|
return function (it) {
|
|
853
|
-
return Spacer_instance.
|
|
853
|
+
return Spacer_instance.is(2) + emit_17(this$0, it);
|
|
854
854
|
};
|
|
855
855
|
}
|
|
856
856
|
function KotlinEndpointDefinitionEmitter$emitConstructor$lambda_0(this$0) {
|
|
857
857
|
return function (it) {
|
|
858
|
-
return Spacer_instance.
|
|
858
|
+
return Spacer_instance.is(2) + this$0.nq(it);
|
|
859
859
|
};
|
|
860
860
|
}
|
|
861
861
|
function KotlinEndpointDefinitionEmitter$emitConstructor$lambda_1(this$0) {
|
|
862
862
|
return function (it) {
|
|
863
|
-
return Spacer_instance.
|
|
863
|
+
return Spacer_instance.is(2) + this$0.nq(it);
|
|
864
864
|
};
|
|
865
865
|
}
|
|
866
866
|
function KotlinEndpointDefinitionEmitter$emitDeserializedParams$lambda(this$0) {
|
|
@@ -890,7 +890,7 @@ function KotlinEndpointDefinitionEmitter$emitDeserialized$lambda(this$0) {
|
|
|
890
890
|
}
|
|
891
891
|
function KotlinEndpointDefinitionEmitter$emitObject$lambda($spaces, $block) {
|
|
892
892
|
return function (it) {
|
|
893
|
-
return Spacer_instance.
|
|
893
|
+
return Spacer_instance.is($spaces + 1 | 0) + 'val ' + $block(it);
|
|
894
894
|
};
|
|
895
895
|
}
|
|
896
896
|
function KotlinEndpointDefinitionEmitter() {
|
|
@@ -899,18 +899,18 @@ function sanitizeNegative($this, _this__u8e3s4) {
|
|
|
899
899
|
return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
|
|
900
900
|
}
|
|
901
901
|
function sanitizeEnum($this, _this__u8e3s4) {
|
|
902
|
-
return $this.
|
|
902
|
+
return $this.m1x(joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_'));
|
|
903
903
|
}
|
|
904
904
|
function KotlinEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
905
905
|
return function (it) {
|
|
906
|
-
return this$0.
|
|
906
|
+
return this$0.n1x(sanitizeEnum(this$0, it)) + '("' + it + '")';
|
|
907
907
|
};
|
|
908
908
|
}
|
|
909
909
|
function KotlinEnumDefinitionEmitter() {
|
|
910
910
|
}
|
|
911
911
|
function Companion() {
|
|
912
912
|
Companion_instance_2 = this;
|
|
913
|
-
this.
|
|
913
|
+
this.k1y_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']);
|
|
914
914
|
}
|
|
915
915
|
var Companion_instance_2;
|
|
916
916
|
function Companion_getInstance_0() {
|
|
@@ -924,14 +924,14 @@ function KotlinIdentifierEmitter$sanitize$lambda(it) {
|
|
|
924
924
|
function KotlinIdentifierEmitter() {
|
|
925
925
|
}
|
|
926
926
|
function _get_sanitizationConfig__sns434($this) {
|
|
927
|
-
var tmp0 = $this.
|
|
927
|
+
var tmp0 = $this.q1y_1;
|
|
928
928
|
var tmp = KProperty1;
|
|
929
929
|
// Inline function 'kotlin.getValue' call
|
|
930
930
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, KotlinIrEmitter$_get_sanitizationConfig_$ref_tnafwf(), null);
|
|
931
931
|
return tmp0.l1();
|
|
932
932
|
}
|
|
933
933
|
function _get_modelSanitizationConfig__vgg831($this) {
|
|
934
|
-
var tmp0 = $this.
|
|
934
|
+
var tmp0 = $this.r1y_1;
|
|
935
935
|
var tmp = KProperty1;
|
|
936
936
|
// Inline function 'kotlin.getValue' call
|
|
937
937
|
getPropertyCallableRef('modelSanitizationConfig', 1, tmp, KotlinIrEmitter$_get_modelSanitizationConfig_$ref_iulb4s(), null);
|
|
@@ -948,7 +948,7 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
948
948
|
var item = _iterator__ex2g4s.v();
|
|
949
949
|
var _unary__edvuaz = index;
|
|
950
950
|
index = _unary__edvuaz + 1 | 0;
|
|
951
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
951
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.fr(item) : item;
|
|
952
952
|
destination.x(tmp$ret$0);
|
|
953
953
|
}
|
|
954
954
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -996,7 +996,7 @@ function sanitizeFirstIsDigit_0($this, _this__u8e3s4) {
|
|
|
996
996
|
return tmp;
|
|
997
997
|
}
|
|
998
998
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
999
|
-
return Companion_getInstance_1().
|
|
999
|
+
return Companion_getInstance_1().s1y_1.u1(_this__u8e3s4) ? addBackticks(_this__u8e3s4) : _this__u8e3s4;
|
|
1000
1000
|
}
|
|
1001
1001
|
function sanitizeSymbol($this, _this__u8e3s4) {
|
|
1002
1002
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
@@ -1009,7 +1009,7 @@ function sanitizeSymbol($this, _this__u8e3s4) {
|
|
|
1009
1009
|
var item = _iterator__ex2g4s.v();
|
|
1010
1010
|
var _unary__edvuaz = index;
|
|
1011
1011
|
index = _unary__edvuaz + 1 | 0;
|
|
1012
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
1012
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.fr(item) : item;
|
|
1013
1013
|
destination.x(tmp$ret$0);
|
|
1014
1014
|
}
|
|
1015
1015
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1069,7 +1069,7 @@ function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
function Companion_0() {
|
|
1071
1071
|
Companion_instance_3 = this;
|
|
1072
|
-
this.
|
|
1072
|
+
this.s1y_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']);
|
|
1073
1073
|
}
|
|
1074
1074
|
var Companion_instance_3;
|
|
1075
1075
|
function Companion_getInstance_1() {
|
|
@@ -1082,13 +1082,13 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
1082
1082
|
}
|
|
1083
1083
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1084
1084
|
return function (name) {
|
|
1085
|
-
var sanitized = name.
|
|
1085
|
+
var sanitized = name.q1h_1.a1() > 1 ? name.u1m() : sanitizeSymbol(this$0, name.o1j());
|
|
1086
1086
|
return new Name(listOf(sanitized));
|
|
1087
1087
|
};
|
|
1088
1088
|
}
|
|
1089
1089
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0) {
|
|
1090
1090
|
return function (name) {
|
|
1091
|
-
return new Name(listOf(sanitizeSymbol(this$0, name.
|
|
1091
|
+
return new Name(listOf(sanitizeSymbol(this$0, name.u1m())));
|
|
1092
1092
|
};
|
|
1093
1093
|
}
|
|
1094
1094
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(this$0) {
|
|
@@ -1101,17 +1101,17 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1101
1101
|
var tmp;
|
|
1102
1102
|
var tmp_0;
|
|
1103
1103
|
if (stmt instanceof FunctionCall) {
|
|
1104
|
-
tmp_0 = stmt.
|
|
1104
|
+
tmp_0 = stmt.e1n_1.o1j() === 'validate';
|
|
1105
1105
|
} else {
|
|
1106
1106
|
tmp_0 = false;
|
|
1107
1107
|
}
|
|
1108
1108
|
if (tmp_0) {
|
|
1109
|
-
tmp = transformChildren(stmt.
|
|
1109
|
+
tmp = transformChildren(stmt.i1n(VOID, emptyList()), tr);
|
|
1110
1110
|
} else {
|
|
1111
1111
|
if (stmt instanceof ConstructorStatement) {
|
|
1112
|
-
var tmp_1 = tr.
|
|
1112
|
+
var tmp_1 = tr.b1v(stmt.w1n_1);
|
|
1113
1113
|
// Inline function 'kotlin.collections.map' call
|
|
1114
|
-
var this_0 = stmt.
|
|
1114
|
+
var this_0 = stmt.x1n_1;
|
|
1115
1115
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1116
1116
|
var destination = ArrayList_init_$Create$(this_0.a1());
|
|
1117
1117
|
// Inline function 'kotlin.collections.iterator' call
|
|
@@ -1122,7 +1122,7 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1122
1122
|
var name = item.k1();
|
|
1123
1123
|
// Inline function 'kotlin.collections.component2' call
|
|
1124
1124
|
var expr = item.l1();
|
|
1125
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), name), tr.
|
|
1125
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), name), tr.e1v(expr));
|
|
1126
1126
|
destination.x(tmp$ret$3);
|
|
1127
1127
|
}
|
|
1128
1128
|
tmp = new ConstructorStatement(tmp_1, toMap(destination));
|
|
@@ -1135,7 +1135,7 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1135
1135
|
}
|
|
1136
1136
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1137
1137
|
return function () {
|
|
1138
|
-
var tmp = Companion_getInstance_1().
|
|
1138
|
+
var tmp = Companion_getInstance_1().s1y_1;
|
|
1139
1139
|
var tmp_0 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1140
1140
|
var tmp_1 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
|
|
1141
1141
|
var tmp_2 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
|
|
@@ -1149,7 +1149,7 @@ function KotlinIrEmitter$_get_sanitizationConfig_$ref_tnafwf() {
|
|
|
1149
1149
|
};
|
|
1150
1150
|
}
|
|
1151
1151
|
function KotlinIrEmitter$modelSanitizationConfig$delegate$lambda$lambda(name) {
|
|
1152
|
-
return new Name(listOf(name.
|
|
1152
|
+
return new Name(listOf(name.o1j()));
|
|
1153
1153
|
}
|
|
1154
1154
|
function KotlinIrEmitter$modelSanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1155
1155
|
return function (it) {
|
|
@@ -1160,7 +1160,7 @@ function KotlinIrEmitter$modelSanitizationConfig$delegate$lambda(this$0) {
|
|
|
1160
1160
|
return function () {
|
|
1161
1161
|
var tmp = _get_sanitizationConfig__sns434(this$0);
|
|
1162
1162
|
var tmp_0 = KotlinIrEmitter$modelSanitizationConfig$delegate$lambda$lambda;
|
|
1163
|
-
return tmp.
|
|
1163
|
+
return tmp.w1w(VOID, VOID, tmp_0, VOID, KotlinIrEmitter$modelSanitizationConfig$delegate$lambda$lambda_0(this$0));
|
|
1164
1164
|
};
|
|
1165
1165
|
}
|
|
1166
1166
|
function KotlinIrEmitter$_get_modelSanitizationConfig_$ref_iulb4s() {
|
|
@@ -1172,7 +1172,7 @@ function KotlinIrEmitter$emitShared$lambda(element, transformer) {
|
|
|
1172
1172
|
var tmp;
|
|
1173
1173
|
if (element instanceof File) {
|
|
1174
1174
|
// Inline function 'kotlin.collections.partition' call
|
|
1175
|
-
var this_0 = element.
|
|
1175
|
+
var this_0 = element.a1o_1;
|
|
1176
1176
|
var first = ArrayList_init_$Create$_0();
|
|
1177
1177
|
var second = ArrayList_init_$Create$_0();
|
|
1178
1178
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -1187,7 +1187,7 @@ function KotlinIrEmitter$emitShared$lambda(element, transformer) {
|
|
|
1187
1187
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1188
1188
|
var packageElements = _destruct__k2r9zo.ve();
|
|
1189
1189
|
var rest = _destruct__k2r9zo.we();
|
|
1190
|
-
tmp = element.
|
|
1190
|
+
tmp = element.d1o(VOID, plus_2(plus_1(packageElements, import_0('kotlin.reflect', 'KType')), rest));
|
|
1191
1191
|
} else {
|
|
1192
1192
|
tmp = element;
|
|
1193
1193
|
}
|
|
@@ -1198,11 +1198,11 @@ function KotlinIrEmitter$emitShared$lambda_0($clientServer) {
|
|
|
1198
1198
|
return function (element, transformer) {
|
|
1199
1199
|
var tmp;
|
|
1200
1200
|
if (element instanceof Namespace) {
|
|
1201
|
-
var injected = element.
|
|
1201
|
+
var injected = element.f1o_1.equals(Companion_getInstance().s1h('Wirespec')) ? $clientServer : emptyList();
|
|
1202
1202
|
var tmp_0;
|
|
1203
1203
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1204
1204
|
if (!injected.r()) {
|
|
1205
|
-
tmp_0 = withElements(element, plus_2(element.
|
|
1205
|
+
tmp_0 = withElements(element, plus_2(element.b1o(), injected));
|
|
1206
1206
|
} else {
|
|
1207
1207
|
tmp_0 = element;
|
|
1208
1208
|
}
|
|
@@ -1227,7 +1227,7 @@ function KotlinIrEmitter$emitGenerator$lambda_1(it) {
|
|
|
1227
1227
|
}
|
|
1228
1228
|
function KotlinIrEmitter$emitGenerator$lambda_2(this$0) {
|
|
1229
1229
|
return function (it) {
|
|
1230
|
-
return import_0(this$0.
|
|
1230
|
+
return import_0(this$0.x1w().es_1 + '.model', it);
|
|
1231
1231
|
};
|
|
1232
1232
|
}
|
|
1233
1233
|
function KotlinIrEmitter$emit$lambda(this$0) {
|
|
@@ -1237,29 +1237,29 @@ function KotlinIrEmitter$emit$lambda(this$0) {
|
|
|
1237
1237
|
}
|
|
1238
1238
|
function KotlinIrEmitter(packageName, emitShared) {
|
|
1239
1239
|
Companion_getInstance_1();
|
|
1240
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
1240
|
+
packageName = packageName === VOID ? Companion_instance.ds('community.flock.wirespec.generated') : packageName;
|
|
1241
1241
|
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
1242
|
-
this.
|
|
1243
|
-
this.
|
|
1244
|
-
this.
|
|
1245
|
-
this.
|
|
1246
|
-
this.
|
|
1242
|
+
this.l1y_1 = packageName;
|
|
1243
|
+
this.m1y_1 = emitShared;
|
|
1244
|
+
this.n1y_1 = KotlinGenerator_instance;
|
|
1245
|
+
this.o1y_1 = FileExtension_Kotlin_getInstance();
|
|
1246
|
+
this.p1y_1 = listOf_0([import_0('community.flock.wirespec.kotlin', 'Wirespec'), import_0('kotlin.reflect', 'typeOf')]);
|
|
1247
1247
|
var tmp = this;
|
|
1248
|
-
tmp.
|
|
1248
|
+
tmp.q1y_1 = lazy(KotlinIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1249
1249
|
var tmp_0 = this;
|
|
1250
|
-
tmp_0.
|
|
1250
|
+
tmp_0.r1y_1 = lazy(KotlinIrEmitter$modelSanitizationConfig$delegate$lambda(this));
|
|
1251
1251
|
}
|
|
1252
|
-
protoOf(KotlinIrEmitter).
|
|
1253
|
-
return this.
|
|
1254
|
-
};
|
|
1255
|
-
protoOf(KotlinIrEmitter).v1v = function () {
|
|
1256
|
-
return this.m1y_1;
|
|
1252
|
+
protoOf(KotlinIrEmitter).x1w = function () {
|
|
1253
|
+
return this.l1y_1;
|
|
1257
1254
|
};
|
|
1258
|
-
protoOf(KotlinIrEmitter).
|
|
1255
|
+
protoOf(KotlinIrEmitter).w1v = function () {
|
|
1259
1256
|
return this.n1y_1;
|
|
1260
1257
|
};
|
|
1261
|
-
protoOf(KotlinIrEmitter).
|
|
1262
|
-
|
|
1258
|
+
protoOf(KotlinIrEmitter).vq = function () {
|
|
1259
|
+
return this.o1y_1;
|
|
1260
|
+
};
|
|
1261
|
+
protoOf(KotlinIrEmitter).a1w = function () {
|
|
1262
|
+
var packageName = Companion_instance.ds('community.flock.wirespec.kotlin');
|
|
1263
1263
|
var clientServer = convertClientServer(packageName);
|
|
1264
1264
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1265
1265
|
var this_0 = convert(packageName);
|
|
@@ -1267,48 +1267,48 @@ protoOf(KotlinIrEmitter).z1v = function () {
|
|
|
1267
1267
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1268
1268
|
var tmp = scope;
|
|
1269
1269
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1270
|
-
var this_1 = scope.
|
|
1270
|
+
var this_1 = scope.j1v_1;
|
|
1271
1271
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1272
1272
|
// Inline function 'kotlin.apply' call
|
|
1273
1273
|
var this_2 = new TransformerBuilder();
|
|
1274
|
-
this_2.
|
|
1275
|
-
var tmp$ret$2 = this_2.
|
|
1276
|
-
tmp.
|
|
1274
|
+
this_2.c1j(KotlinIrEmitter$emitShared$lambda);
|
|
1275
|
+
var tmp$ret$2 = this_2.d1j();
|
|
1276
|
+
tmp.j1v_1 = transform(this_1, tmp$ret$2);
|
|
1277
1277
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1278
1278
|
var tmp_0 = scope;
|
|
1279
1279
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1280
1280
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1281
|
-
var this_3 = scope.
|
|
1281
|
+
var this_3 = scope.j1v_1;
|
|
1282
1282
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1283
1283
|
// Inline function 'kotlin.apply' call
|
|
1284
1284
|
var this_4 = new TransformerBuilder();
|
|
1285
|
-
this_4.
|
|
1286
|
-
var tmp$ret$7 = this_4.
|
|
1287
|
-
tmp_0.
|
|
1288
|
-
var tmp_1 = scope.
|
|
1285
|
+
this_4.c1j(KotlinIrEmitter$emitShared$lambda_0(clientServer));
|
|
1286
|
+
var tmp$ret$7 = this_4.d1j();
|
|
1287
|
+
tmp_0.j1v_1 = transform(this_3, tmp$ret$7);
|
|
1288
|
+
var tmp_1 = scope.j1v_1;
|
|
1289
1289
|
var wirespecShared = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1290
1290
|
var tmp_2;
|
|
1291
|
-
if (this.
|
|
1291
|
+
if (this.m1y_1.xo_1) {
|
|
1292
1292
|
tmp_2 = wirespecShared;
|
|
1293
1293
|
} else {
|
|
1294
1294
|
tmp_2 = null;
|
|
1295
1295
|
}
|
|
1296
1296
|
return tmp_2;
|
|
1297
1297
|
};
|
|
1298
|
-
protoOf(KotlinIrEmitter).
|
|
1298
|
+
protoOf(KotlinIrEmitter).mr = function (definition, module_0, logger) {
|
|
1299
1299
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1300
1300
|
// Inline function 'kotlin.takeIf' call
|
|
1301
|
-
var this_0 = this.
|
|
1301
|
+
var this_0 = this.p1y_1;
|
|
1302
1302
|
var tmp;
|
|
1303
|
-
if (Companion_instance_1.
|
|
1303
|
+
if (Companion_instance_1.ir(module_0)) {
|
|
1304
1304
|
tmp = this_0;
|
|
1305
1305
|
} else {
|
|
1306
1306
|
tmp = null;
|
|
1307
1307
|
}
|
|
1308
1308
|
var tmp$ret$1 = tmp;
|
|
1309
|
-
return placeInPackage(prependImports(file, tmp$ret$1), this.
|
|
1309
|
+
return placeInPackage(prependImports(file, tmp$ret$1), this.x1w(), definition);
|
|
1310
1310
|
};
|
|
1311
|
-
protoOf(KotlinIrEmitter).
|
|
1311
|
+
protoOf(KotlinIrEmitter).f1w = function (definition, module_0) {
|
|
1312
1312
|
var tmp;
|
|
1313
1313
|
if (definition instanceof Type) {
|
|
1314
1314
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1329,29 +1329,29 @@ protoOf(KotlinIrEmitter).e1w = function (definition, module_0) {
|
|
|
1329
1329
|
}
|
|
1330
1330
|
var generatorFile = tmp;
|
|
1331
1331
|
var sanitized = sanitizeNames(generatorFile, _get_sanitizationConfig__sns434(this));
|
|
1332
|
-
var generatorOwnName = definition.
|
|
1332
|
+
var generatorOwnName = definition.nr().l1() + 'Generator';
|
|
1333
1333
|
var tmp_0 = asSequence_0(collectCustomTypeNames(sanitized));
|
|
1334
1334
|
var tmp_1 = filterNot(tmp_0, KotlinIrEmitter$emitGenerator$lambda);
|
|
1335
1335
|
var tmp_2 = filterNot(tmp_1, KotlinIrEmitter$emitGenerator$lambda_0(generatorOwnName));
|
|
1336
1336
|
var tmp_3 = distinct_0(map(tmp_2, KotlinIrEmitter$emitGenerator$lambda_1));
|
|
1337
1337
|
var modelImports = toList(map(tmp_3, KotlinIrEmitter$emitGenerator$lambda_2(this)));
|
|
1338
|
-
return placeInPackage_0(prependImports(sanitized, plus_2(this.
|
|
1338
|
+
return placeInPackage_0(prependImports(sanitized, plus_2(this.p1y_1, modelImports)), this.x1w(), 'generator');
|
|
1339
1339
|
};
|
|
1340
|
-
protoOf(KotlinIrEmitter).
|
|
1340
|
+
protoOf(KotlinIrEmitter).lq = function (type, module_0) {
|
|
1341
1341
|
return ensureEmptyStructHasConstructor(sanitizeNames(convertWithValidation(type, module_0), _get_modelSanitizationConfig__vgg831(this)));
|
|
1342
1342
|
};
|
|
1343
|
-
protoOf(KotlinIrEmitter).
|
|
1343
|
+
protoOf(KotlinIrEmitter).as = function (enum_0, module_0) {
|
|
1344
1344
|
var tmp = sanitizeNames(convert_0(enum_0), _get_sanitizationConfig__sns434(this));
|
|
1345
1345
|
return injectEnumLabelField(tmp, KotlinIrEmitter$emit$lambda(this));
|
|
1346
1346
|
};
|
|
1347
|
-
protoOf(KotlinIrEmitter).
|
|
1347
|
+
protoOf(KotlinIrEmitter).qr = function (union) {
|
|
1348
1348
|
return sanitizeNames(convert_1(union), _get_sanitizationConfig__sns434(this));
|
|
1349
1349
|
};
|
|
1350
|
-
protoOf(KotlinIrEmitter).
|
|
1350
|
+
protoOf(KotlinIrEmitter).vr = function (refined) {
|
|
1351
1351
|
var file = sanitizeNames(convert_2(refined), _get_sanitizationConfig__sns434(this));
|
|
1352
1352
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1353
1353
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1354
|
-
var tmp0 = file.
|
|
1354
|
+
var tmp0 = file.b1o();
|
|
1355
1355
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1356
1356
|
var destination = ArrayList_init_$Create$_0();
|
|
1357
1357
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1363,13 +1363,13 @@ protoOf(KotlinIrEmitter).ur = function (refined) {
|
|
|
1363
1363
|
}
|
|
1364
1364
|
var tmp0_safe_receiver = firstOrNull_0(destination);
|
|
1365
1365
|
var updatedStruct = tmp0_safe_receiver == null ? null : markMembersAsOverride(tmp0_safe_receiver);
|
|
1366
|
-
return new File(Companion_getInstance().
|
|
1366
|
+
return new File(Companion_getInstance().s1h(sanitize_0(this, refined.tr_1)), listOfNotNull_0(updatedStruct));
|
|
1367
1367
|
};
|
|
1368
|
-
protoOf(KotlinIrEmitter).
|
|
1369
|
-
var imports = buildModelImports(endpoint, this.
|
|
1368
|
+
protoOf(KotlinIrEmitter).bs = function (endpoint) {
|
|
1369
|
+
var imports = buildModelImports(endpoint, this.x1w());
|
|
1370
1370
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1371
1371
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1372
|
-
var tmp0 = convert_3(endpoint).
|
|
1372
|
+
var tmp0 = convert_3(endpoint).b1o();
|
|
1373
1373
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1374
1374
|
var destination = ArrayList_init_$Create$_0();
|
|
1375
1375
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1382,7 +1382,7 @@ protoOf(KotlinIrEmitter).as = function (endpoint) {
|
|
|
1382
1382
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1383
1383
|
var endpointNamespace = ensureNotNull(tmp$ret$2);
|
|
1384
1384
|
var body = injectApiAlias(injectCompanionObject(endpointNamespace, endpoint));
|
|
1385
|
-
var tmp = sanitizeNames(new File(Companion_getInstance().
|
|
1385
|
+
var tmp = sanitizeNames(new File(Companion_getInstance().s1h(sanitize_0(this, endpoint.vp_1)), listOf(body)), _get_sanitizationConfig__sns434(this));
|
|
1386
1386
|
// Inline function 'kotlin.takeIf' call
|
|
1387
1387
|
var tmp_0;
|
|
1388
1388
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
@@ -1394,10 +1394,10 @@ protoOf(KotlinIrEmitter).as = function (endpoint) {
|
|
|
1394
1394
|
var tmp$ret$5 = tmp_0;
|
|
1395
1395
|
return prependImports(tmp, tmp$ret$5);
|
|
1396
1396
|
};
|
|
1397
|
-
protoOf(KotlinIrEmitter).
|
|
1397
|
+
protoOf(KotlinIrEmitter).pr = function (channel) {
|
|
1398
1398
|
var tmp = sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1399
1399
|
// Inline function 'kotlin.takeIf' call
|
|
1400
|
-
var this_0 = buildModelImports(channel, this.
|
|
1400
|
+
var this_0 = buildModelImports(channel, this.x1w());
|
|
1401
1401
|
var tmp_0;
|
|
1402
1402
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1403
1403
|
if (!this_0.r()) {
|
|
@@ -1408,25 +1408,25 @@ protoOf(KotlinIrEmitter).or = function (channel) {
|
|
|
1408
1408
|
var tmp$ret$2 = tmp_0;
|
|
1409
1409
|
return prependImports(tmp, tmp$ret$2);
|
|
1410
1410
|
};
|
|
1411
|
-
protoOf(KotlinIrEmitter).
|
|
1412
|
-
var imports = buildModelImports(endpoint, this.
|
|
1413
|
-
var endpointImport = import_0(this.
|
|
1411
|
+
protoOf(KotlinIrEmitter).e1w = function (endpoint) {
|
|
1412
|
+
var imports = buildModelImports(endpoint, this.x1w());
|
|
1413
|
+
var endpointImport = import_0(this.x1w().es_1 + '.endpoint', endpoint.vp_1.l1());
|
|
1414
1414
|
var file = sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this));
|
|
1415
|
-
var subPackageName = plus_0(this.
|
|
1416
|
-
var tmp = Companion_getInstance().
|
|
1415
|
+
var subPackageName = plus_0(this.x1w(), 'client');
|
|
1416
|
+
var tmp = Companion_getInstance().s1h(subPackageName.gs() + file.z1n_1.t1h());
|
|
1417
1417
|
// Inline function 'kotlin.collections.buildList' call
|
|
1418
1418
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1419
1419
|
// Inline function 'kotlin.apply' call
|
|
1420
1420
|
var this_0 = ArrayList_init_$Create$_0();
|
|
1421
|
-
this_0.x(new Package(subPackageName.
|
|
1422
|
-
this_0.f1(this.
|
|
1421
|
+
this_0.x(new Package(subPackageName.es_1));
|
|
1422
|
+
this_0.f1(this.p1y_1);
|
|
1423
1423
|
this_0.f1(imports);
|
|
1424
1424
|
this_0.x(endpointImport);
|
|
1425
|
-
this_0.f1(file.
|
|
1425
|
+
this_0.f1(file.a1o_1);
|
|
1426
1426
|
var tmp$ret$3 = this_0.o5();
|
|
1427
1427
|
return new File(tmp, tmp$ret$3);
|
|
1428
1428
|
};
|
|
1429
|
-
protoOf(KotlinIrEmitter).
|
|
1429
|
+
protoOf(KotlinIrEmitter).b1w = function (endpoints, logger) {
|
|
1430
1430
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1431
1431
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1432
1432
|
var destination = ArrayList_init_$Create$_0();
|
|
@@ -1442,7 +1442,7 @@ protoOf(KotlinIrEmitter).a1w = function (endpoints, logger) {
|
|
|
1442
1442
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1443
1443
|
while (_iterator__ex2g4s_0.u()) {
|
|
1444
1444
|
var e = _iterator__ex2g4s_0.v();
|
|
1445
|
-
var key = e.
|
|
1445
|
+
var key = e.cv_1;
|
|
1446
1446
|
if (set.x(key)) {
|
|
1447
1447
|
list_0.x(e);
|
|
1448
1448
|
}
|
|
@@ -1453,7 +1453,7 @@ protoOf(KotlinIrEmitter).a1w = function (endpoints, logger) {
|
|
|
1453
1453
|
var _iterator__ex2g4s_1 = list_0.t();
|
|
1454
1454
|
while (_iterator__ex2g4s_1.u()) {
|
|
1455
1455
|
var item = _iterator__ex2g4s_1.v();
|
|
1456
|
-
var tmp$ret$5 = import_0(this.
|
|
1456
|
+
var tmp$ret$5 = import_0(this.x1w().es_1 + '.model', item.cv_1);
|
|
1457
1457
|
destination_0.x(tmp$ret$5);
|
|
1458
1458
|
}
|
|
1459
1459
|
var imports = destination_0;
|
|
@@ -1463,7 +1463,7 @@ protoOf(KotlinIrEmitter).a1w = function (endpoints, logger) {
|
|
|
1463
1463
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1464
1464
|
while (_iterator__ex2g4s_2.u()) {
|
|
1465
1465
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
1466
|
-
var tmp$ret$8 = import_0(this.
|
|
1466
|
+
var tmp$ret$8 = import_0(this.x1w().es_1 + '.endpoint', item_0.vp_1.l1());
|
|
1467
1467
|
destination_1.x(tmp$ret$8);
|
|
1468
1468
|
}
|
|
1469
1469
|
var endpointImports = destination_1;
|
|
@@ -1473,21 +1473,21 @@ protoOf(KotlinIrEmitter).a1w = function (endpoints, logger) {
|
|
|
1473
1473
|
var _iterator__ex2g4s_3 = endpoints.t();
|
|
1474
1474
|
while (_iterator__ex2g4s_3.u()) {
|
|
1475
1475
|
var item_1 = _iterator__ex2g4s_3.v();
|
|
1476
|
-
var tmp$ret$11 = import_0(this.
|
|
1476
|
+
var tmp$ret$11 = import_0(this.x1w().es_1 + '.client', item_1.vp_1.l1() + 'Client');
|
|
1477
1477
|
destination_2.x(tmp$ret$11);
|
|
1478
1478
|
}
|
|
1479
1479
|
var clientImports = destination_2;
|
|
1480
1480
|
var allImports = plus_2(plus_2(imports, endpointImports), clientImports);
|
|
1481
1481
|
var file = sanitizeNames(emitClient.call(this, endpoints, logger), _get_sanitizationConfig__sns434(this));
|
|
1482
|
-
var tmp = Companion_getInstance().
|
|
1482
|
+
var tmp = Companion_getInstance().s1h(this.x1w().gs() + file.z1n_1.t1h());
|
|
1483
1483
|
// Inline function 'kotlin.collections.buildList' call
|
|
1484
1484
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1485
1485
|
// Inline function 'kotlin.apply' call
|
|
1486
1486
|
var this_0 = ArrayList_init_$Create$_0();
|
|
1487
|
-
this_0.x(new Package(this.
|
|
1488
|
-
this_0.f1(this.
|
|
1487
|
+
this_0.x(new Package(this.x1w().es_1));
|
|
1488
|
+
this_0.f1(this.p1y_1);
|
|
1489
1489
|
this_0.f1(allImports);
|
|
1490
|
-
this_0.f1(file.
|
|
1490
|
+
this_0.f1(file.a1o_1);
|
|
1491
1491
|
var tmp$ret$17 = this_0.o5();
|
|
1492
1492
|
return new File(tmp, tmp$ret$17);
|
|
1493
1493
|
};
|
|
@@ -1499,7 +1499,7 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1499
1499
|
var _iterator__ex2g4s = this_0.t();
|
|
1500
1500
|
while (_iterator__ex2g4s.u()) {
|
|
1501
1501
|
var e = _iterator__ex2g4s.v();
|
|
1502
|
-
var key = e.
|
|
1502
|
+
var key = e.cv_1;
|
|
1503
1503
|
if (set.x(key)) {
|
|
1504
1504
|
list.x(e);
|
|
1505
1505
|
}
|
|
@@ -1510,7 +1510,7 @@ function buildModelImports(_this__u8e3s4, packageName) {
|
|
|
1510
1510
|
var _iterator__ex2g4s_0 = list.t();
|
|
1511
1511
|
while (_iterator__ex2g4s_0.u()) {
|
|
1512
1512
|
var item = _iterator__ex2g4s_0.v();
|
|
1513
|
-
var tmp$ret$2 = import_0(packageName.
|
|
1513
|
+
var tmp$ret$2 = import_0(packageName.es_1 + '.model', Companion_getInstance().s1h(item.cv_1).t1h());
|
|
1514
1514
|
destination.x(tmp$ret$2);
|
|
1515
1515
|
}
|
|
1516
1516
|
return destination;
|
|
@@ -1522,14 +1522,14 @@ function injectApiAlias(_this__u8e3s4) {
|
|
|
1522
1522
|
var tmp = scope;
|
|
1523
1523
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1524
1524
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1525
|
-
var this_0 = scope.
|
|
1525
|
+
var this_0 = scope.j1v_1;
|
|
1526
1526
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1527
1527
|
// Inline function 'kotlin.apply' call
|
|
1528
1528
|
var this_1 = new TransformerBuilder();
|
|
1529
|
-
this_1.
|
|
1530
|
-
var tmp$ret$2 = this_1.
|
|
1531
|
-
tmp.
|
|
1532
|
-
var tmp_0 = scope.
|
|
1529
|
+
this_1.c1j(injectApiAlias$lambda);
|
|
1530
|
+
var tmp$ret$2 = this_1.d1j();
|
|
1531
|
+
tmp.j1v_1 = transform(this_0, tmp$ret$2);
|
|
1532
|
+
var tmp_0 = scope.j1v_1;
|
|
1533
1533
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1534
1534
|
}
|
|
1535
1535
|
function injectCompanionObject(_this__u8e3s4, endpoint) {
|
|
@@ -1539,20 +1539,20 @@ function injectCompanionObject(_this__u8e3s4, endpoint) {
|
|
|
1539
1539
|
var tmp = scope;
|
|
1540
1540
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1541
1541
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1542
|
-
var this_0 = scope.
|
|
1542
|
+
var this_0 = scope.j1v_1;
|
|
1543
1543
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1544
1544
|
// Inline function 'kotlin.apply' call
|
|
1545
1545
|
var this_1 = new TransformerBuilder();
|
|
1546
|
-
this_1.
|
|
1547
|
-
var tmp$ret$2 = this_1.
|
|
1548
|
-
tmp.
|
|
1549
|
-
var tmp_0 = scope.
|
|
1546
|
+
this_1.c1j(injectCompanionObject$lambda(endpoint));
|
|
1547
|
+
var tmp$ret$2 = this_1.d1j();
|
|
1548
|
+
tmp.j1v_1 = transform(this_0, tmp$ret$2);
|
|
1549
|
+
var tmp_0 = scope.j1v_1;
|
|
1550
1550
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1551
1551
|
}
|
|
1552
1552
|
function buildCompanionObject(endpoint) {
|
|
1553
|
-
var pathTemplate = '/' + joinToString(endpoint.
|
|
1553
|
+
var pathTemplate = '/' + joinToString(endpoint.xp_1, '/', VOID, VOID, VOID, VOID, buildCompanionObject$lambda);
|
|
1554
1554
|
// Inline function 'kotlin.let' call
|
|
1555
|
-
var p0 = trimMargin('\n |companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n | override val pathTemplate = "' + pathTemplate + '"\n | override val method = "' + endpoint.
|
|
1555
|
+
var p0 = trimMargin('\n |companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n | override val pathTemplate = "' + pathTemplate + '"\n | override val method = "' + endpoint.wp_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 ');
|
|
1556
1556
|
return raw(p0);
|
|
1557
1557
|
}
|
|
1558
1558
|
function injectApiAlias$lambda(element, transformer) {
|
|
@@ -1562,7 +1562,7 @@ function injectApiAlias$lambda(element, transformer) {
|
|
|
1562
1562
|
var tmp_0;
|
|
1563
1563
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1564
1564
|
if (!injected.r()) {
|
|
1565
|
-
tmp_0 = withElements(element, plus_2(element.
|
|
1565
|
+
tmp_0 = withElements(element, plus_2(element.b1o(), injected));
|
|
1566
1566
|
} else {
|
|
1567
1567
|
tmp_0 = element;
|
|
1568
1568
|
}
|
|
@@ -1577,11 +1577,11 @@ function injectCompanionObject$lambda($endpoint) {
|
|
|
1577
1577
|
return function (element, transformer) {
|
|
1578
1578
|
var tmp;
|
|
1579
1579
|
if (element instanceof Interface) {
|
|
1580
|
-
var injected = element.
|
|
1580
|
+
var injected = element.t1o_1.equals(Companion_getInstance().s1h('Handler')) ? listOf(buildCompanionObject($endpoint)) : emptyList();
|
|
1581
1581
|
var tmp_0;
|
|
1582
1582
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1583
1583
|
if (!injected.r()) {
|
|
1584
|
-
tmp_0 = withElements(element, plus_2(element.
|
|
1584
|
+
tmp_0 = withElements(element, plus_2(element.b1o(), injected));
|
|
1585
1585
|
} else {
|
|
1586
1586
|
tmp_0 = element;
|
|
1587
1587
|
}
|
|
@@ -1596,10 +1596,10 @@ function injectCompanionObject$lambda($endpoint) {
|
|
|
1596
1596
|
function buildCompanionObject$lambda(it) {
|
|
1597
1597
|
var tmp;
|
|
1598
1598
|
if (it instanceof Literal) {
|
|
1599
|
-
tmp = it.
|
|
1599
|
+
tmp = it.yq_1;
|
|
1600
1600
|
} else {
|
|
1601
1601
|
if (it instanceof Param) {
|
|
1602
|
-
tmp = '{' + it.
|
|
1602
|
+
tmp = '{' + it.cq_1.l1() + '}';
|
|
1603
1603
|
} else {
|
|
1604
1604
|
noWhenBranchMatchedException();
|
|
1605
1605
|
}
|
|
@@ -1610,8 +1610,8 @@ function KotlinRefinedTypeDefinitionEmitter() {
|
|
|
1610
1610
|
}
|
|
1611
1611
|
function KotlinShared() {
|
|
1612
1612
|
KotlinShared_instance = this;
|
|
1613
|
-
this.
|
|
1614
|
-
this.
|
|
1613
|
+
this.e1y_1 = 'community.flock.wirespec.kotlin';
|
|
1614
|
+
this.f1y_1 = trimMargin('\n |package ' + this.e1y_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.is(2) + 'val value: T\n |' + Spacer_instance.is(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.is(2) + 'fun to(request: Req): RawRequest\n |' + Spacer_instance.is(2) + 'fun from(response: RawResponse): Res\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req : Request<*>, Res : Response<*>> {\n |' + Spacer_instance.is(2) + 'val pathTemplate: String\n |' + Spacer_instance.is(2) + 'val method: String\n |' + Spacer_instance.is(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.is(2) + 'val pathTemplate: String\n |' + Spacer_instance.is(2) + 'val method: String\n |' + Spacer_instance.is(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 ');
|
|
1615
1615
|
}
|
|
1616
1616
|
protoOf(KotlinShared).toString = function () {
|
|
1617
1617
|
return 'KotlinShared';
|
|
@@ -1634,12 +1634,12 @@ function KotlinShared_getInstance() {
|
|
|
1634
1634
|
}
|
|
1635
1635
|
function KotlinTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
1636
1636
|
return function (it) {
|
|
1637
|
-
return this$0.
|
|
1637
|
+
return this$0.oq(it);
|
|
1638
1638
|
};
|
|
1639
1639
|
}
|
|
1640
1640
|
function KotlinTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
1641
1641
|
return function (it) {
|
|
1642
|
-
return Spacer_instance.toString() + 'val ' + this$0.
|
|
1642
|
+
return Spacer_instance.toString() + 'val ' + this$0.nq(it) + ',';
|
|
1643
1643
|
};
|
|
1644
1644
|
}
|
|
1645
1645
|
function KotlinTypeDefinitionEmitter() {
|
|
@@ -1647,32 +1647,32 @@ function KotlinTypeDefinitionEmitter() {
|
|
|
1647
1647
|
function KotlinUnionDefinitionEmitter() {
|
|
1648
1648
|
}
|
|
1649
1649
|
//region block: post-declaration
|
|
1650
|
-
protoOf(KotlinEmitter).
|
|
1651
|
-
protoOf(KotlinEmitter).
|
|
1652
|
-
protoOf(KotlinEmitter).
|
|
1653
|
-
protoOf(KotlinEmitter).
|
|
1654
|
-
protoOf(KotlinEmitter).
|
|
1655
|
-
protoOf(KotlinEmitter).
|
|
1656
|
-
protoOf(KotlinEmitter).
|
|
1657
|
-
protoOf(KotlinEmitter).
|
|
1658
|
-
protoOf(KotlinEmitter).
|
|
1659
|
-
protoOf(KotlinEmitter).
|
|
1660
|
-
protoOf(KotlinEmitter).
|
|
1661
|
-
protoOf(KotlinEmitter).
|
|
1662
|
-
protoOf(KotlinEmitter).
|
|
1663
|
-
protoOf(KotlinEmitter).
|
|
1664
|
-
protoOf(KotlinEmitter).
|
|
1665
|
-
protoOf(KotlinEmitter).
|
|
1666
|
-
protoOf(KotlinEmitter).
|
|
1667
|
-
protoOf(KotlinEmitter).
|
|
1668
|
-
protoOf(KotlinEmitter).
|
|
1669
|
-
protoOf(KotlinEmitter).
|
|
1670
|
-
protoOf(KotlinEmitter).
|
|
1671
|
-
protoOf(KotlinEmitter).
|
|
1672
|
-
protoOf(KotlinIrEmitter).
|
|
1650
|
+
protoOf(KotlinEmitter).lq = emit_4;
|
|
1651
|
+
protoOf(KotlinEmitter).mq = emit_5;
|
|
1652
|
+
protoOf(KotlinEmitter).nq = emit_6;
|
|
1653
|
+
protoOf(KotlinEmitter).oq = emit_7;
|
|
1654
|
+
protoOf(KotlinEmitter).pq = emit_8;
|
|
1655
|
+
protoOf(KotlinEmitter).as = emit_11;
|
|
1656
|
+
protoOf(KotlinEmitter).vr = emit_15;
|
|
1657
|
+
protoOf(KotlinEmitter).bs = emit_12;
|
|
1658
|
+
protoOf(KotlinEmitter).qr = emit_10;
|
|
1659
|
+
protoOf(KotlinEmitter).or = emit_3;
|
|
1660
|
+
protoOf(KotlinEmitter).pr = emit_9;
|
|
1661
|
+
protoOf(KotlinEmitter).k1x = emit_13;
|
|
1662
|
+
protoOf(KotlinEmitter).l1x = emit_14;
|
|
1663
|
+
protoOf(KotlinEmitter).cs = emitValidator;
|
|
1664
|
+
protoOf(KotlinEmitter).x1x = sanitize;
|
|
1665
|
+
protoOf(KotlinEmitter).m1x = sanitizeFirstIsDigit;
|
|
1666
|
+
protoOf(KotlinEmitter).n1x = sanitizeKeywords;
|
|
1667
|
+
protoOf(KotlinEmitter).o1x = emitHandleFunction;
|
|
1668
|
+
protoOf(KotlinEmitter).g1y = emitRequestHeaders;
|
|
1669
|
+
protoOf(KotlinEmitter).h1y = emitQueries;
|
|
1670
|
+
protoOf(KotlinEmitter).i1y = emitBody;
|
|
1671
|
+
protoOf(KotlinEmitter).j1y = emitHeaders;
|
|
1672
|
+
protoOf(KotlinIrEmitter).y1v = get_extensions;
|
|
1673
1673
|
protoOf(KotlinIrEmitter).eo = emit_1;
|
|
1674
|
-
protoOf(KotlinIrEmitter).
|
|
1675
|
-
protoOf(KotlinIrEmitter).
|
|
1674
|
+
protoOf(KotlinIrEmitter).z1v = emit_2;
|
|
1675
|
+
protoOf(KotlinIrEmitter).d1w = beforeGenerate;
|
|
1676
1676
|
//endregion
|
|
1677
1677
|
//region block: exports
|
|
1678
1678
|
export {
|