@flock/wirespec 0.19.0-RC.2 → 0.19.0-RC.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.mjs +12 -12
- package/arrow-arrow-core.mjs +163 -163
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt.mjs +1570 -1570
- package/colormath-root-colormath.mjs +444 -444
- package/kotest-kotest-property.mjs +605 -1435
- package/kotest-kotest-property.mjs.map +1 -1
- package/kotest-property-arbs.mjs +0 -478
- package/kotest-property-arbs.mjs.map +1 -1
- package/kotlin-kotlin-stdlib.mjs +2478 -2738
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +4926 -4926
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1819 -1819
- package/kotlinx-io-kotlinx-io-core.mjs +440 -440
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1792 -1792
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1395 -1395
- package/mordant-mordant.mjs +1362 -1362
- package/package.json +1 -1
- package/wirespec-src-compiler-core.mjs +1541 -1541
- package/wirespec-src-compiler-emitters-java.mjs +387 -387
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +341 -341
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +371 -371
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +416 -416
- package/wirespec-src-compiler-emitters-scala.mjs +168 -168
- package/wirespec-src-compiler-emitters-typescript.mjs +471 -471
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +87 -87
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3672 -3672
- package/wirespec-src-compiler-lib.mjs +418 -418
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +512 -512
- package/wirespec-src-converter-openapi.mjs +772 -772
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-integration-kotest.mjs +490 -572
- package/wirespec-src-integration-kotest.mjs.map +1 -1
- package/wirespec-src-plugin-arguments.mjs +185 -185
- package/wirespec-src-plugin-cli.mjs +106 -106
- package/wirespec-src-plugin-npm.d.mts +1 -1
- package/wirespec-src-plugin-npm.mjs +40 -40
- package/wirespec-src-tools-generator.mjs +35 -35
|
@@ -193,11 +193,11 @@ var imul = Math.imul;
|
|
|
193
193
|
//endregion
|
|
194
194
|
//region block: pre-declaration
|
|
195
195
|
function emit_2(identifier) {
|
|
196
|
-
return '"' + identifier.
|
|
196
|
+
return '"' + identifier.m1() + '"';
|
|
197
197
|
}
|
|
198
198
|
initMetadataForInterface(TypeScriptIdentifierEmitter, 'TypeScriptIdentifierEmitter');
|
|
199
199
|
function sanitizeSymbol(_this__u8e3s4) {
|
|
200
|
-
return this.
|
|
200
|
+
return this.h20(_this__u8e3s4.m1());
|
|
201
201
|
}
|
|
202
202
|
function sanitizeSymbol_0(_this__u8e3s4) {
|
|
203
203
|
var tmp = asSequence_0(_this__u8e3s4);
|
|
@@ -211,7 +211,7 @@ function emit_3(type, module_0) {
|
|
|
211
211
|
var _iterator__ex2g4s = this_0.t();
|
|
212
212
|
while (_iterator__ex2g4s.u()) {
|
|
213
213
|
var e = _iterator__ex2g4s.v();
|
|
214
|
-
var key = e.
|
|
214
|
+
var key = e.iy_1;
|
|
215
215
|
if (set.x(key)) {
|
|
216
216
|
list.x(e);
|
|
217
217
|
}
|
|
@@ -222,19 +222,19 @@ function emit_3(type, module_0) {
|
|
|
222
222
|
var _iterator__ex2g4s_0 = list.t();
|
|
223
223
|
while (_iterator__ex2g4s_0.u()) {
|
|
224
224
|
var item = _iterator__ex2g4s_0.v();
|
|
225
|
-
var tmp$ret$2 = 'import {' + item.
|
|
225
|
+
var tmp$ret$2 = 'import {' + item.iy_1 + "} from './" + item.iy_1 + "'";
|
|
226
226
|
destination.x(tmp$ret$2);
|
|
227
227
|
}
|
|
228
228
|
var tmp = destination;
|
|
229
|
-
return trimMargin('\n |' + joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda) + '\n |export type ' + this.
|
|
229
|
+
return trimMargin('\n |' + joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda) + '\n |export type ' + this.q23(type.ts_1) + ' = {\n |' + this.tt(type.us_1) + '\n |}\n |\n ');
|
|
230
230
|
}
|
|
231
231
|
function emit_4(_this__u8e3s4) {
|
|
232
232
|
var tmp;
|
|
233
233
|
if (_this__u8e3s4 instanceof Dict) {
|
|
234
|
-
tmp = 'Record<string, ' + this.
|
|
234
|
+
tmp = 'Record<string, ' + this.vt(_this__u8e3s4.as_1) + '>';
|
|
235
235
|
} else {
|
|
236
236
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
237
|
-
tmp = this.
|
|
237
|
+
tmp = this.vt(_this__u8e3s4.xr_1) + '[]';
|
|
238
238
|
} else {
|
|
239
239
|
if (_this__u8e3s4 instanceof Unit) {
|
|
240
240
|
tmp = 'void';
|
|
@@ -243,10 +243,10 @@ function emit_4(_this__u8e3s4) {
|
|
|
243
243
|
tmp = 'any';
|
|
244
244
|
} else {
|
|
245
245
|
if (_this__u8e3s4 instanceof Custom) {
|
|
246
|
-
tmp = this.
|
|
246
|
+
tmp = this.h20(_this__u8e3s4.iy_1);
|
|
247
247
|
} else {
|
|
248
248
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
249
|
-
tmp = this.
|
|
249
|
+
tmp = this.r23(_this__u8e3s4);
|
|
250
250
|
} else {
|
|
251
251
|
noWhenBranchMatchedException();
|
|
252
252
|
}
|
|
@@ -256,10 +256,10 @@ function emit_4(_this__u8e3s4) {
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
// Inline function 'kotlin.let' call
|
|
259
|
-
return tmp + (_this__u8e3s4.
|
|
259
|
+
return tmp + (_this__u8e3s4.ay() ? ' | undefined' : '');
|
|
260
260
|
}
|
|
261
261
|
function emitPrimitive(_this__u8e3s4) {
|
|
262
|
-
var tmp0_subject = _this__u8e3s4.
|
|
262
|
+
var tmp0_subject = _this__u8e3s4.my_1;
|
|
263
263
|
var tmp;
|
|
264
264
|
if (tmp0_subject instanceof String_0) {
|
|
265
265
|
tmp = 'string';
|
|
@@ -287,10 +287,10 @@ function emitPrimitive(_this__u8e3s4) {
|
|
|
287
287
|
function emit_5(_this__u8e3s4) {
|
|
288
288
|
var tmp;
|
|
289
289
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
290
|
-
tmp = Spacer_instance.toString() + 'return ' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.
|
|
290
|
+
tmp = Spacer_instance.toString() + 'return ' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.ww_1) + '.test(value);';
|
|
291
291
|
} else {
|
|
292
292
|
if (_this__u8e3s4 instanceof Bound) {
|
|
293
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
293
|
+
var tmp1_safe_receiver = _this__u8e3s4.mx_1;
|
|
294
294
|
var tmp_0;
|
|
295
295
|
if (tmp1_safe_receiver == null) {
|
|
296
296
|
tmp_0 = null;
|
|
@@ -299,7 +299,7 @@ function emit_5(_this__u8e3s4) {
|
|
|
299
299
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
300
300
|
}
|
|
301
301
|
var minCheck = tmp_0;
|
|
302
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
302
|
+
var tmp2_safe_receiver = _this__u8e3s4.nx_1;
|
|
303
303
|
var tmp_1;
|
|
304
304
|
if (tmp2_safe_receiver == null) {
|
|
305
305
|
tmp_1 = null;
|
|
@@ -327,18 +327,18 @@ function emit_5(_this__u8e3s4) {
|
|
|
327
327
|
return tmp;
|
|
328
328
|
}
|
|
329
329
|
function emit_6(_this__u8e3s4) {
|
|
330
|
-
return joinToString(_this__u8e3s4.
|
|
330
|
+
return joinToString(_this__u8e3s4.qs_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda_0(this));
|
|
331
331
|
}
|
|
332
332
|
function emit_7(_this__u8e3s4) {
|
|
333
|
-
return Spacer_instance.toString() + this.
|
|
333
|
+
return Spacer_instance.toString() + this.uu(_this__u8e3s4.ys_1) + ': ' + this.vt(_this__u8e3s4.zs_1);
|
|
334
334
|
}
|
|
335
335
|
initMetadataForInterface(TypeScriptTypeDefinitionEmitter, 'TypeScriptTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, TypeScriptIdentifierEmitter]);
|
|
336
336
|
function emitClient(ast) {
|
|
337
|
-
var tmp = 'client.' + this.
|
|
338
|
-
var tmp_0 = this.
|
|
337
|
+
var tmp = 'client.' + this.cu().lu_1;
|
|
338
|
+
var tmp_0 = this.yt(ast);
|
|
339
339
|
var tmp_1 = joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, TypeScriptClientEmitter$emitClient$lambda);
|
|
340
340
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
341
|
-
var this_0 = ast.
|
|
341
|
+
var this_0 = ast.zt_1;
|
|
342
342
|
// Inline function 'kotlin.collections.flatMap' call
|
|
343
343
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
344
344
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -346,7 +346,7 @@ function emitClient(ast) {
|
|
|
346
346
|
var _iterator__ex2g4s = tmp0.t();
|
|
347
347
|
while (_iterator__ex2g4s.u()) {
|
|
348
348
|
var element = _iterator__ex2g4s.v();
|
|
349
|
-
var list = new NonEmptyList(element.
|
|
349
|
+
var list = new NonEmptyList(element.bu_1);
|
|
350
350
|
addAll(destination, list);
|
|
351
351
|
}
|
|
352
352
|
var tmp$ret$3 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -366,47 +366,94 @@ function emitClient(ast) {
|
|
|
366
366
|
var _iterator__ex2g4s_1 = destination_0.t();
|
|
367
367
|
while (_iterator__ex2g4s_1.u()) {
|
|
368
368
|
var e = _iterator__ex2g4s_1.v();
|
|
369
|
-
var key = e.
|
|
369
|
+
var key = e.iy_1;
|
|
370
370
|
if (set.x(key)) {
|
|
371
371
|
list_1.x(e);
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
var tmp_2 = list_1;
|
|
375
375
|
var tmp_3 = joinToString(tmp_2, '\n', VOID, VOID, VOID, VOID, TypeScriptClientEmitter$emitClient$lambda_0);
|
|
376
|
-
var tmp_4 = this.
|
|
376
|
+
var tmp_4 = this.yt(ast);
|
|
377
377
|
return new Emitted(tmp, trimMargin('\n |import {Wirespec} from "./Wirespec"\n |\n |' + tmp_1 + '\n |\n |' + tmp_3 + '\n |\n |type RawHandler = (req: Wirespec.RawRequest) => Promise<Wirespec.RawResponse>\n |\n |export const client = (serialization: Wirespec.Serialization, handler: RawHandler) => ({\n |' + spacer(joinToString(tmp_4, '\n', VOID, VOID, VOID, VOID, TypeScriptClientEmitter$emitClient$lambda_1(this)), 1) + '\n |})\n |\n '));
|
|
378
378
|
}
|
|
379
379
|
initMetadataForInterface(TypeScriptClientEmitter, 'TypeScriptClientEmitter', VOID, VOID, [ClientEmitter, TypeScriptTypeDefinitionEmitter]);
|
|
380
|
-
function emit_8(
|
|
381
|
-
|
|
382
|
-
|
|
380
|
+
function emit_8(endpoint) {
|
|
381
|
+
// Inline function 'kotlin.collections.distinctBy' call
|
|
382
|
+
var this_0 = importReferences(endpoint);
|
|
383
|
+
var set = HashSet_init_$Create$();
|
|
384
|
+
var list = ArrayList_init_$Create$();
|
|
385
|
+
var _iterator__ex2g4s = this_0.t();
|
|
386
|
+
while (_iterator__ex2g4s.u()) {
|
|
387
|
+
var e = _iterator__ex2g4s.v();
|
|
388
|
+
var key = e.iy_1;
|
|
389
|
+
if (set.x(key)) {
|
|
390
|
+
list.x(e);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
// Inline function 'kotlin.collections.map' call
|
|
394
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
395
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(list, 10));
|
|
396
|
+
var _iterator__ex2g4s_0 = list.t();
|
|
397
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
398
|
+
var item = _iterator__ex2g4s_0.v();
|
|
399
|
+
var tmp$ret$2 = 'import {type ' + item.iy_1 + "} from '../model'";
|
|
400
|
+
destination.x(tmp$ret$2);
|
|
401
|
+
}
|
|
402
|
+
var tmp = destination;
|
|
403
|
+
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda);
|
|
404
|
+
var tmp_1 = this.q23(endpoint.ct_1);
|
|
405
|
+
var tmp_2 = get_pathParams(endpoint);
|
|
406
|
+
var tmp_3 = emitType(this, tmp_2, 'Path', TypeScriptEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
407
|
+
var tmp_4 = emitType(this, endpoint.ft_1, 'Queries', TypeScriptEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
408
|
+
var tmp_5 = emitType(this, endpoint.gt_1, 'Headers', TypeScriptEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
409
|
+
var tmp_6 = emitType_1(this, first(endpoint.ht_1), endpoint);
|
|
410
|
+
var tmp_7 = distinctByStatus(endpoint.it_1);
|
|
411
|
+
var tmp_8 = joinToString(tmp_7, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
412
|
+
var tmp_9 = Spacer_instance.toString();
|
|
413
|
+
var tmp_10 = distinctByStatus(endpoint.it_1);
|
|
414
|
+
var tmp_11 = joinToString(tmp_10, ' | ', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_4(this));
|
|
415
|
+
var tmp_12 = emitFunction_0(this, first(endpoint.ht_1), endpoint);
|
|
416
|
+
var tmp_13 = distinctByStatus(endpoint.it_1);
|
|
417
|
+
var tmp_14 = joinToString(tmp_13, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
418
|
+
var tmp_15 = Spacer_instance.toString();
|
|
419
|
+
var tmp_16 = Spacer_instance.ov(2);
|
|
420
|
+
var tmp_17 = emitHandleFunction(this, endpoint);
|
|
421
|
+
var tmp_18 = Spacer_instance.toString();
|
|
422
|
+
var tmp_19 = prependIndent(emitClient_0(this, endpoint), Spacer_instance.ov(1));
|
|
423
|
+
var tmp_20 = prependIndent(emitServer(this, endpoint), Spacer_instance.ov(1));
|
|
424
|
+
var tmp_21 = Spacer_instance.toString();
|
|
425
|
+
var tmp_22 = Spacer_instance.ov(2);
|
|
426
|
+
var tmp_23 = Companion_instance_0.nu(this.q23(endpoint.ct_1));
|
|
427
|
+
var tmp_24 = Spacer_instance.ov(2);
|
|
428
|
+
var tmp_25 = Spacer_instance.ov(2);
|
|
429
|
+
return trimMargin('\n |' + tmp_0 + '\n |export namespace ' + tmp_1 + ' {\n |' + tmp_3 + '\n |' + tmp_4 + '\n |' + tmp_5 + '\n |' + tmp_6 + '\n |' + tmp_8 + '\n |' + tmp_9 + 'export type Response = ' + tmp_11 + '\n |' + tmp_12 + '\n |' + tmp_14 + '\n |' + tmp_15 + 'export type Handler = {\n |' + tmp_16 + tmp_17 + '\n |' + tmp_18 + '}\n |' + tmp_19 + '\n |' + tmp_20 + '\n |' + tmp_21 + 'export const api = {\n |' + tmp_22 + 'name: "' + tmp_23 + '",\n |' + tmp_24 + 'method: "' + endpoint.dt_1.b3_1 + '",\n |' + tmp_25 + 'path: "' + joinToString(endpoint.et_1, '/', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_6(this)) + '",\n |' + Spacer_instance.ov(2) + 'server,\n |' + Spacer_instance.ov(2) + 'client\n |' + Spacer_instance.toString() + '} as const\n |}\n |\n ');
|
|
383
430
|
}
|
|
384
|
-
initMetadataForInterface(
|
|
431
|
+
initMetadataForInterface(TypeScriptEndpointDefinitionEmitter, 'TypeScriptEndpointDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
385
432
|
function emit_9(refined) {
|
|
386
|
-
return trimMargin('\n |export type ' + this.
|
|
433
|
+
return trimMargin('\n |export type ' + this.q23(refined.zu_1) + ' = ' + this.vt(refined.av_1) + ';\n |export const validate' + refined.zu_1.m1() + ' = (value: ' + this.vt(refined.av_1) + '): value is ' + this.q23(refined.zu_1) + ' => {\n |' + this.iv(refined) + '\n |}\n |\n ');
|
|
387
434
|
}
|
|
388
435
|
function emitValidator(_this__u8e3s4) {
|
|
389
436
|
var defaultReturn = Spacer_instance.toString() + 'return true;';
|
|
390
|
-
var type = _this__u8e3s4.
|
|
437
|
+
var type = _this__u8e3s4.av_1.my_1;
|
|
391
438
|
var tmp;
|
|
392
439
|
if (type instanceof Integer) {
|
|
393
|
-
var tmp0_safe_receiver = type.
|
|
394
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
440
|
+
var tmp0_safe_receiver = type.rx_1;
|
|
441
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.wt(tmp0_safe_receiver);
|
|
395
442
|
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
396
443
|
} else {
|
|
397
444
|
if (type instanceof Number_0) {
|
|
398
|
-
var tmp2_safe_receiver = type.
|
|
399
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.
|
|
445
|
+
var tmp2_safe_receiver = type.ux_1;
|
|
446
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.wt(tmp2_safe_receiver);
|
|
400
447
|
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
401
448
|
} else {
|
|
402
449
|
if (type instanceof String_0) {
|
|
403
|
-
var tmp4_safe_receiver = type.
|
|
450
|
+
var tmp4_safe_receiver = type.ox_1;
|
|
404
451
|
var tmp_0;
|
|
405
452
|
var tmp_1 = tmp4_safe_receiver;
|
|
406
453
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
407
454
|
tmp_0 = null;
|
|
408
455
|
} else {
|
|
409
|
-
tmp_0 = this.
|
|
456
|
+
tmp_0 = this.wt(new RegExp_0(tmp4_safe_receiver));
|
|
410
457
|
}
|
|
411
458
|
var tmp5_elvis_lhs = tmp_0;
|
|
412
459
|
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
@@ -426,59 +473,12 @@ function emitValidator(_this__u8e3s4) {
|
|
|
426
473
|
return tmp;
|
|
427
474
|
}
|
|
428
475
|
initMetadataForInterface(TypeScriptRefinedTypeDefinitionEmitter, 'TypeScriptRefinedTypeDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
429
|
-
function emit_10(
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
var set = HashSet_init_$Create$();
|
|
433
|
-
var list = ArrayList_init_$Create$();
|
|
434
|
-
var _iterator__ex2g4s = this_0.t();
|
|
435
|
-
while (_iterator__ex2g4s.u()) {
|
|
436
|
-
var e = _iterator__ex2g4s.v();
|
|
437
|
-
var key = e.az_1;
|
|
438
|
-
if (set.x(key)) {
|
|
439
|
-
list.x(e);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
// Inline function 'kotlin.collections.map' call
|
|
443
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
444
|
-
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(list, 10));
|
|
445
|
-
var _iterator__ex2g4s_0 = list.t();
|
|
446
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
447
|
-
var item = _iterator__ex2g4s_0.v();
|
|
448
|
-
var tmp$ret$2 = 'import {type ' + item.az_1 + "} from '../model'";
|
|
449
|
-
destination.x(tmp$ret$2);
|
|
450
|
-
}
|
|
451
|
-
var tmp = destination;
|
|
452
|
-
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda);
|
|
453
|
-
var tmp_1 = this.i24(endpoint.ut_1);
|
|
454
|
-
var tmp_2 = get_pathParams(endpoint);
|
|
455
|
-
var tmp_3 = emitType(this, tmp_2, 'Path', TypeScriptEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
456
|
-
var tmp_4 = emitType(this, endpoint.xt_1, 'Queries', TypeScriptEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
457
|
-
var tmp_5 = emitType(this, endpoint.yt_1, 'Headers', TypeScriptEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
458
|
-
var tmp_6 = emitType_1(this, first(endpoint.zt_1), endpoint);
|
|
459
|
-
var tmp_7 = distinctByStatus(endpoint.au_1);
|
|
460
|
-
var tmp_8 = joinToString(tmp_7, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
461
|
-
var tmp_9 = Spacer_instance.toString();
|
|
462
|
-
var tmp_10 = distinctByStatus(endpoint.au_1);
|
|
463
|
-
var tmp_11 = joinToString(tmp_10, ' | ', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_4(this));
|
|
464
|
-
var tmp_12 = emitFunction_0(this, first(endpoint.zt_1), endpoint);
|
|
465
|
-
var tmp_13 = distinctByStatus(endpoint.au_1);
|
|
466
|
-
var tmp_14 = joinToString(tmp_13, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
467
|
-
var tmp_15 = Spacer_instance.toString();
|
|
468
|
-
var tmp_16 = Spacer_instance.gw(2);
|
|
469
|
-
var tmp_17 = emitHandleFunction(this, endpoint);
|
|
470
|
-
var tmp_18 = Spacer_instance.toString();
|
|
471
|
-
var tmp_19 = prependIndent(emitClient_0(this, endpoint), Spacer_instance.gw(1));
|
|
472
|
-
var tmp_20 = prependIndent(emitServer(this, endpoint), Spacer_instance.gw(1));
|
|
473
|
-
var tmp_21 = Spacer_instance.toString();
|
|
474
|
-
var tmp_22 = Spacer_instance.gw(2);
|
|
475
|
-
var tmp_23 = Companion_instance_0.fv(this.i24(endpoint.ut_1));
|
|
476
|
-
var tmp_24 = Spacer_instance.gw(2);
|
|
477
|
-
var tmp_25 = Spacer_instance.gw(2);
|
|
478
|
-
return trimMargin('\n |' + tmp_0 + '\n |export namespace ' + tmp_1 + ' {\n |' + tmp_3 + '\n |' + tmp_4 + '\n |' + tmp_5 + '\n |' + tmp_6 + '\n |' + tmp_8 + '\n |' + tmp_9 + 'export type Response = ' + tmp_11 + '\n |' + tmp_12 + '\n |' + tmp_14 + '\n |' + tmp_15 + 'export type Handler = {\n |' + tmp_16 + tmp_17 + '\n |' + tmp_18 + '}\n |' + tmp_19 + '\n |' + tmp_20 + '\n |' + tmp_21 + 'export const api = {\n |' + tmp_22 + 'name: "' + tmp_23 + '",\n |' + tmp_24 + 'method: "' + endpoint.vt_1.g3_1 + '",\n |' + tmp_25 + 'path: "' + joinToString(endpoint.wt_1, '/', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_6(this)) + '",\n |' + Spacer_instance.gw(2) + 'server,\n |' + Spacer_instance.gw(2) + 'client\n |' + Spacer_instance.toString() + '} as const\n |}\n |\n ');
|
|
476
|
+
function emit_10(enum_0, module_0) {
|
|
477
|
+
var tmp = this.q23(enum_0.ev_1);
|
|
478
|
+
return 'export type ' + tmp + ' = ' + joinToString(enum_0.fv_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEnumDefinitionEmitter$emit$lambda) + '\n';
|
|
479
479
|
}
|
|
480
|
-
initMetadataForInterface(
|
|
481
|
-
initMetadataForClass(TypeScriptEmitter, 'TypeScriptEmitter', TypeScriptEmitter, LanguageEmitter, [LanguageEmitter,
|
|
480
|
+
initMetadataForInterface(TypeScriptEnumDefinitionEmitter, 'TypeScriptEnumDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
481
|
+
initMetadataForClass(TypeScriptEmitter, 'TypeScriptEmitter', TypeScriptEmitter, LanguageEmitter, [LanguageEmitter, TypeScriptTypeDefinitionEmitter, TypeScriptEndpointDefinitionEmitter, TypeScriptRefinedTypeDefinitionEmitter, TypeScriptEnumDefinitionEmitter, TypeScriptClientEmitter, TypeScriptIdentifierEmitter]);
|
|
482
482
|
initMetadataForClass(EndpointParam, 'EndpointParam');
|
|
483
483
|
initMetadataForCompanion(Companion);
|
|
484
484
|
initMetadataForClass(TypeScriptIrEmitter, 'TypeScriptIrEmitter', TypeScriptIrEmitter, VOID, [IrEmitter]);
|
|
@@ -514,10 +514,10 @@ function emitClientInterface($this, _this__u8e3s4, endpoint) {
|
|
|
514
514
|
return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
515
515
|
}
|
|
516
516
|
function emitFunction($this, endpoint, request) {
|
|
517
|
-
var tmp = endpoint.
|
|
517
|
+
var tmp = endpoint.ct_1.m1();
|
|
518
518
|
var tmp_0 = emitClientInterface($this, request, endpoint);
|
|
519
519
|
var tmp_1 = Spacer_instance.toString();
|
|
520
|
-
var tmp_2 = endpoint.
|
|
520
|
+
var tmp_2 = endpoint.ct_1.m1();
|
|
521
521
|
// Inline function 'kotlin.takeIf' call
|
|
522
522
|
var this_0 = paramList(request, endpoint);
|
|
523
523
|
var tmp_3;
|
|
@@ -537,31 +537,31 @@ function emitFunction($this, endpoint, request) {
|
|
|
537
537
|
// Inline function 'kotlin.text.orEmpty' call
|
|
538
538
|
var tmp0_elvis_lhs = tmp_4;
|
|
539
539
|
var tmp$ret$5 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
540
|
-
return trimMargin('\n |' + tmp + ': async (' + tmp_0 + ') => {\n |' + tmp_1 + 'const req = ' + tmp_2 + '.request(' + tmp$ret$5 + ')\n |' + Spacer_instance.toString() + 'const rawRequest = ' + endpoint.
|
|
540
|
+
return trimMargin('\n |' + tmp + ': async (' + tmp_0 + ') => {\n |' + tmp_1 + 'const req = ' + tmp_2 + '.request(' + tmp$ret$5 + ')\n |' + Spacer_instance.toString() + 'const rawRequest = ' + endpoint.ct_1.m1() + '.client(serialization).to(req)\n |' + Spacer_instance.toString() + 'const rawResponse = await handler(rawRequest)\n |' + Spacer_instance.toString() + 'return ' + endpoint.ct_1.m1() + '.client(serialization).from(rawResponse)\n |},\n ');
|
|
541
541
|
}
|
|
542
542
|
function TypeScriptClientEmitter$emitClient$lambda(_destruct__k2r9zo) {
|
|
543
|
-
var endpoint = _destruct__k2r9zo.
|
|
544
|
-
return 'import {' + endpoint.
|
|
543
|
+
var endpoint = _destruct__k2r9zo.kf();
|
|
544
|
+
return 'import {' + endpoint.ct_1.m1() + '} from "./endpoint/' + endpoint.ct_1.m1() + '"';
|
|
545
545
|
}
|
|
546
546
|
function TypeScriptClientEmitter$emitClient$lambda_0(it) {
|
|
547
|
-
return 'import {type ' + it.
|
|
547
|
+
return 'import {type ' + it.iy_1 + '} from "./model/' + it.iy_1 + '"';
|
|
548
548
|
}
|
|
549
549
|
function TypeScriptClientEmitter$emitClient$lambda_1(this$0) {
|
|
550
550
|
return function (_destruct__k2r9zo) {
|
|
551
|
-
var endpoint = _destruct__k2r9zo.
|
|
552
|
-
var request = _destruct__k2r9zo.
|
|
551
|
+
var endpoint = _destruct__k2r9zo.kf();
|
|
552
|
+
var request = _destruct__k2r9zo.lf();
|
|
553
553
|
return emitFunction(this$0, endpoint, request);
|
|
554
554
|
};
|
|
555
555
|
}
|
|
556
556
|
function TypeScriptClientEmitter$emitClientInterface$lambda(this$0) {
|
|
557
557
|
return function (it) {
|
|
558
|
-
return this$0.
|
|
558
|
+
return this$0.uu(it.hu_1) + ': ' + this$0.vt(it.iu_1);
|
|
559
559
|
};
|
|
560
560
|
}
|
|
561
561
|
function TypeScriptClientEmitter() {
|
|
562
562
|
}
|
|
563
563
|
function TypeScriptEmitter$emit$lambda(it) {
|
|
564
|
-
return 'export {' + it.
|
|
564
|
+
return 'export {' + it.tu().m1() + "} from './" + it.tu().m1() + "'";
|
|
565
565
|
}
|
|
566
566
|
function TypeScriptEmitter$emit$lambda_0(it) {
|
|
567
567
|
// Inline function 'kotlin.text.trimStart' call
|
|
@@ -569,36 +569,36 @@ function TypeScriptEmitter$emit$lambda_0(it) {
|
|
|
569
569
|
}
|
|
570
570
|
function TypeScriptEmitter$emit$lambda_1(this$0) {
|
|
571
571
|
return function (it) {
|
|
572
|
-
return this$0.
|
|
572
|
+
return this$0.vt(it);
|
|
573
573
|
};
|
|
574
574
|
}
|
|
575
575
|
function TypeScriptEmitter() {
|
|
576
576
|
LanguageEmitter.call(this);
|
|
577
|
-
this.
|
|
578
|
-
this.
|
|
579
|
-
this.
|
|
577
|
+
this.s23_1 = FileExtension_TypeScript_getInstance();
|
|
578
|
+
this.t23_1 = TypeScriptShared_getInstance();
|
|
579
|
+
this.u23_1 = '//';
|
|
580
580
|
}
|
|
581
|
-
protoOf(TypeScriptEmitter).
|
|
582
|
-
return this.
|
|
581
|
+
protoOf(TypeScriptEmitter).cu = function () {
|
|
582
|
+
return this.s23_1;
|
|
583
583
|
};
|
|
584
|
-
protoOf(TypeScriptEmitter).
|
|
585
|
-
return this.
|
|
584
|
+
protoOf(TypeScriptEmitter).e20 = function () {
|
|
585
|
+
return this.t23_1;
|
|
586
586
|
};
|
|
587
|
-
protoOf(TypeScriptEmitter).
|
|
588
|
-
return this.
|
|
587
|
+
protoOf(TypeScriptEmitter).du = function () {
|
|
588
|
+
return this.u23_1;
|
|
589
589
|
};
|
|
590
|
-
protoOf(TypeScriptEmitter).
|
|
590
|
+
protoOf(TypeScriptEmitter).mr = function (ast, logger) {
|
|
591
591
|
// Inline function 'kotlin.run' call
|
|
592
|
-
var $this$run = protoOf(LanguageEmitter).
|
|
592
|
+
var $this$run = protoOf(LanguageEmitter).mr.call(this, ast, logger);
|
|
593
593
|
var tmp;
|
|
594
594
|
if (hasEndpoints(ast)) {
|
|
595
|
-
tmp = NonEmptyList__plus_impl_xqmb9($this$run, this.
|
|
595
|
+
tmp = NonEmptyList__plus_impl_xqmb9($this$run, this.p23(ast));
|
|
596
596
|
} else {
|
|
597
597
|
tmp = $this$run;
|
|
598
598
|
}
|
|
599
599
|
var tmp_0 = tmp;
|
|
600
600
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
601
|
-
var this_0 = ast.
|
|
601
|
+
var this_0 = ast.zt_1;
|
|
602
602
|
// Inline function 'kotlin.collections.flatMap' call
|
|
603
603
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
604
604
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -606,7 +606,7 @@ protoOf(TypeScriptEmitter).es = function (ast, logger) {
|
|
|
606
606
|
var _iterator__ex2g4s = tmp0.t();
|
|
607
607
|
while (_iterator__ex2g4s.u()) {
|
|
608
608
|
var element = _iterator__ex2g4s.v();
|
|
609
|
-
var list = new NonEmptyList(element.
|
|
609
|
+
var list = new NonEmptyList(element.bu_1);
|
|
610
610
|
addAll(destination, list);
|
|
611
611
|
}
|
|
612
612
|
var tmp$ret$5 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -619,11 +619,11 @@ protoOf(TypeScriptEmitter).es = function (ast, logger) {
|
|
|
619
619
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
620
620
|
var key = namespace(element_0);
|
|
621
621
|
// Inline function 'kotlin.collections.getOrPut' call
|
|
622
|
-
var value = destination_0.
|
|
622
|
+
var value = destination_0.q2(key);
|
|
623
623
|
var tmp_1;
|
|
624
624
|
if (value == null) {
|
|
625
625
|
var answer = ArrayList_init_$Create$();
|
|
626
|
-
destination_0.
|
|
626
|
+
destination_0.y2(key, answer);
|
|
627
627
|
tmp_1 = answer;
|
|
628
628
|
} else {
|
|
629
629
|
tmp_1 = value;
|
|
@@ -633,33 +633,33 @@ protoOf(TypeScriptEmitter).es = function (ast, logger) {
|
|
|
633
633
|
}
|
|
634
634
|
// Inline function 'kotlin.collections.map' call
|
|
635
635
|
// Inline function 'kotlin.collections.mapTo' call
|
|
636
|
-
var destination_1 = ArrayList_init_$Create$_0(destination_0.
|
|
636
|
+
var destination_1 = ArrayList_init_$Create$_0(destination_0.a1());
|
|
637
637
|
// Inline function 'kotlin.collections.iterator' call
|
|
638
|
-
var _iterator__ex2g4s_1 = destination_0.
|
|
638
|
+
var _iterator__ex2g4s_1 = destination_0.k1().t();
|
|
639
639
|
while (_iterator__ex2g4s_1.u()) {
|
|
640
640
|
var item = _iterator__ex2g4s_1.v();
|
|
641
641
|
// Inline function 'kotlin.collections.component1' call
|
|
642
|
-
var ns = item.
|
|
642
|
+
var ns = item.l1();
|
|
643
643
|
// Inline function 'kotlin.collections.component2' call
|
|
644
|
-
var defs = item.
|
|
645
|
-
var tmp_2 = ns + '/index.' + this.
|
|
644
|
+
var defs = item.m1();
|
|
645
|
+
var tmp_2 = ns + '/index.' + this.cu().lu_1;
|
|
646
646
|
var tmp$ret$14 = new Emitted(tmp_2, joinToString(defs, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda));
|
|
647
647
|
destination_1.x(tmp$ret$14);
|
|
648
648
|
}
|
|
649
649
|
return NonEmptyList__plus_impl_xqmb9_0(tmp_0, destination_1);
|
|
650
650
|
};
|
|
651
|
-
protoOf(TypeScriptEmitter).
|
|
651
|
+
protoOf(TypeScriptEmitter).ru = function (module_0, logger) {
|
|
652
652
|
// Inline function 'kotlin.let' call
|
|
653
|
-
var it = protoOf(LanguageEmitter).
|
|
654
|
-
return NonEmptyList__plus_impl_xqmb9(it, new Emitted('Wirespec', this.
|
|
653
|
+
var it = protoOf(LanguageEmitter).ru.call(this, module_0, logger);
|
|
654
|
+
return NonEmptyList__plus_impl_xqmb9(it, new Emitted('Wirespec', this.e20().w23_1));
|
|
655
655
|
};
|
|
656
|
-
protoOf(TypeScriptEmitter).
|
|
656
|
+
protoOf(TypeScriptEmitter).su = function (definition, module_0, logger) {
|
|
657
657
|
// Inline function 'kotlin.let' call
|
|
658
|
-
var it = protoOf(LanguageEmitter).
|
|
659
|
-
var subPackageName = plus(Companion_instance.
|
|
660
|
-
return new Emitted(subPackageName.
|
|
658
|
+
var it = protoOf(LanguageEmitter).su.call(this, definition, module_0, logger);
|
|
659
|
+
var subPackageName = plus(Companion_instance.jv(''), definition);
|
|
660
|
+
return new Emitted(subPackageName.mv() + this.h20(it.gs_1), trimMargin("\n |import {Wirespec} from '../Wirespec'\n |\n |" + it.hs_1 + '\n '));
|
|
661
661
|
};
|
|
662
|
-
protoOf(TypeScriptEmitter).
|
|
662
|
+
protoOf(TypeScriptEmitter).wu = function (union) {
|
|
663
663
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
664
664
|
var this_0 = importReferences(union);
|
|
665
665
|
var set = HashSet_init_$Create$();
|
|
@@ -667,7 +667,7 @@ protoOf(TypeScriptEmitter).ov = function (union) {
|
|
|
667
667
|
var _iterator__ex2g4s = this_0.t();
|
|
668
668
|
while (_iterator__ex2g4s.u()) {
|
|
669
669
|
var e = _iterator__ex2g4s.v();
|
|
670
|
-
var key = e.
|
|
670
|
+
var key = e.iy_1;
|
|
671
671
|
if (set.x(key)) {
|
|
672
672
|
list.x(e);
|
|
673
673
|
}
|
|
@@ -678,24 +678,24 @@ protoOf(TypeScriptEmitter).ov = function (union) {
|
|
|
678
678
|
var _iterator__ex2g4s_0 = list.t();
|
|
679
679
|
while (_iterator__ex2g4s_0.u()) {
|
|
680
680
|
var item = _iterator__ex2g4s_0.v();
|
|
681
|
-
var tmp$ret$2 = 'import {type ' + item.
|
|
681
|
+
var tmp$ret$2 = 'import {type ' + item.iy_1 + "} from '../model'";
|
|
682
682
|
destination.x(tmp$ret$2);
|
|
683
683
|
}
|
|
684
684
|
var tmp = destination;
|
|
685
685
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda_0);
|
|
686
|
-
var tmp_1 = this.
|
|
687
|
-
return trimMargin('\n |' + tmp_0 + '\n |export type ' + tmp_1 + ' = ' + joinToString(union.
|
|
686
|
+
var tmp_1 = this.q23(union.os_1);
|
|
687
|
+
return trimMargin('\n |' + tmp_0 + '\n |export type ' + tmp_1 + ' = ' + joinToString(union.ps_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda_1(this)) + '\n |\n ');
|
|
688
688
|
};
|
|
689
|
-
protoOf(TypeScriptEmitter).
|
|
690
|
-
return this.
|
|
689
|
+
protoOf(TypeScriptEmitter).vu = function (channel) {
|
|
690
|
+
return this.eu();
|
|
691
691
|
};
|
|
692
692
|
function emit_11($this, _this__u8e3s4) {
|
|
693
693
|
var tmp;
|
|
694
694
|
if (_this__u8e3s4 instanceof Literal) {
|
|
695
|
-
tmp = _this__u8e3s4.
|
|
695
|
+
tmp = _this__u8e3s4.fu_1;
|
|
696
696
|
} else {
|
|
697
697
|
if (_this__u8e3s4 instanceof Param) {
|
|
698
|
-
tmp = ':' + _this__u8e3s4.
|
|
698
|
+
tmp = ':' + _this__u8e3s4.jt_1.m1();
|
|
699
699
|
} else {
|
|
700
700
|
noWhenBranchMatchedException();
|
|
701
701
|
}
|
|
@@ -703,64 +703,64 @@ function emit_11($this, _this__u8e3s4) {
|
|
|
703
703
|
return tmp;
|
|
704
704
|
}
|
|
705
705
|
function emitClient_0($this, _this__u8e3s4) {
|
|
706
|
-
return trimMargin('\n |export const client: Wirespec.Client<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitClientTo($this, _this__u8e3s4), Spacer_instance.
|
|
706
|
+
return trimMargin('\n |export const client: Wirespec.Client<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitClientTo($this, _this__u8e3s4), Spacer_instance.ov(1)) + ',\n |' + prependIndent(emitClientFrom($this, _this__u8e3s4), Spacer_instance.ov(1)) + '\n |})\n ');
|
|
707
707
|
}
|
|
708
708
|
function emitClientTo($this, _this__u8e3s4) {
|
|
709
|
-
var tmp = Spacer_instance.
|
|
709
|
+
var tmp = Spacer_instance.ov(1);
|
|
710
710
|
// Inline function 'kotlin.text.uppercase' call
|
|
711
711
|
// Inline function 'kotlin.js.asDynamic' call
|
|
712
|
-
var tmp_0 = _this__u8e3s4.
|
|
713
|
-
var tmp_1 = Spacer_instance.
|
|
712
|
+
var tmp_0 = _this__u8e3s4.dt_1.b3_1.toUpperCase();
|
|
713
|
+
var tmp_1 = Spacer_instance.ov(1);
|
|
714
714
|
var tmp_2 = emitPathArray($this, _this__u8e3s4);
|
|
715
|
-
var tmp_3 = Spacer_instance.
|
|
716
|
-
var tmp_4 = joinToString(_this__u8e3s4.
|
|
717
|
-
var tmp_5 = Spacer_instance.
|
|
718
|
-
return trimMargin('\n |to: (it) => ({\n |' + tmp + 'method: "' + tmp_0 + '",\n |' + tmp_1 + 'path: ' + tmp_2 + ',\n |' + tmp_3 + 'queries: {' + tmp_4 + '},\n |' + tmp_5 + 'headers: {' + joinToString(_this__u8e3s4.
|
|
715
|
+
var tmp_3 = Spacer_instance.ov(1);
|
|
716
|
+
var tmp_4 = joinToString(_this__u8e3s4.ft_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientTo$lambda($this));
|
|
717
|
+
var tmp_5 = Spacer_instance.ov(1);
|
|
718
|
+
return trimMargin('\n |to: (it) => ({\n |' + tmp + 'method: "' + tmp_0 + '",\n |' + tmp_1 + 'path: ' + tmp_2 + ',\n |' + tmp_3 + 'queries: {' + tmp_4 + '},\n |' + tmp_5 + 'headers: {' + joinToString(_this__u8e3s4.gt_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientTo$lambda_0($this)) + '},\n |' + Spacer_instance.ov(1) + 'body: serialization.serialize(it.body)\n |})\n ');
|
|
719
719
|
}
|
|
720
720
|
function emitClientFrom($this, _this__u8e3s4) {
|
|
721
|
-
var tmp = Spacer_instance.
|
|
722
|
-
var tmp_0 = distinctByStatus(_this__u8e3s4.
|
|
723
|
-
return trimMargin('\n |from: (it) => {\n |' + tmp + 'switch (it.status) {\n |' + prependIndent(joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientFrom$lambda($this)), Spacer_instance.
|
|
721
|
+
var tmp = Spacer_instance.ov(1);
|
|
722
|
+
var tmp_0 = distinctByStatus(_this__u8e3s4.it_1);
|
|
723
|
+
return trimMargin('\n |from: (it) => {\n |' + tmp + 'switch (it.status) {\n |' + prependIndent(joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientFrom$lambda($this)), Spacer_instance.ov(2)) + '\n |' + Spacer_instance.ov(2) + 'default:\n |' + Spacer_instance.ov(3) + 'throw new Error(`Cannot internalize response with status: ${it.status}`);\n |' + Spacer_instance.ov(1) + '}\n |}\n ');
|
|
724
724
|
}
|
|
725
725
|
function emitClientFromResponse($this, _this__u8e3s4) {
|
|
726
|
-
var tmp = fixStatus(_this__u8e3s4.
|
|
727
|
-
var tmp_0 = Spacer_instance.
|
|
728
|
-
var tmp_1 = Spacer_instance.
|
|
729
|
-
var tmp_2 = fixStatus(_this__u8e3s4.
|
|
730
|
-
var tmp_3 = Spacer_instance.
|
|
731
|
-
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.
|
|
726
|
+
var tmp = fixStatus(_this__u8e3s4.ot_1);
|
|
727
|
+
var tmp_0 = Spacer_instance.ov(1);
|
|
728
|
+
var tmp_1 = Spacer_instance.ov(2);
|
|
729
|
+
var tmp_2 = fixStatus(_this__u8e3s4.ot_1);
|
|
730
|
+
var tmp_3 = Spacer_instance.ov(2);
|
|
731
|
+
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.pt_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientFromResponse$lambda($this)) + '},\n |' + Spacer_instance.ov(2) + 'body: serialization.deserialize<' + emitReference($this, _this__u8e3s4) + '>(it.body)\n |' + Spacer_instance.ov(1) + '};\n ');
|
|
732
732
|
}
|
|
733
733
|
function emitServer($this, _this__u8e3s4) {
|
|
734
|
-
return trimMargin('\n |export const server:Wirespec.Server<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitServerFrom($this, _this__u8e3s4), Spacer_instance.
|
|
734
|
+
return trimMargin('\n |export const server:Wirespec.Server<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitServerFrom($this, _this__u8e3s4), Spacer_instance.ov(1)) + ',\n |' + prependIndent(emitServerTo($this, _this__u8e3s4), Spacer_instance.ov(1)) + '\n |})\n ');
|
|
735
735
|
}
|
|
736
736
|
function emitServerFrom($this, _this__u8e3s4) {
|
|
737
|
-
var tmp = Spacer_instance.
|
|
738
|
-
var tmp_0 = Spacer_instance.
|
|
737
|
+
var tmp = Spacer_instance.ov(1);
|
|
738
|
+
var tmp_0 = Spacer_instance.ov(2);
|
|
739
739
|
// Inline function 'kotlin.text.uppercase' call
|
|
740
740
|
// Inline function 'kotlin.js.asDynamic' call
|
|
741
|
-
var tmp_1 = _this__u8e3s4.
|
|
742
|
-
var tmp_2 = Spacer_instance.
|
|
741
|
+
var tmp_1 = _this__u8e3s4.dt_1.b3_1.toUpperCase();
|
|
742
|
+
var tmp_2 = Spacer_instance.ov(2);
|
|
743
743
|
var tmp_3 = get_indexedPathParams(_this__u8e3s4);
|
|
744
|
-
var tmp_4 = prependIndent(joinToString(tmp_3, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda($this)), Spacer_instance.
|
|
745
|
-
var tmp_5 = Spacer_instance.
|
|
746
|
-
var tmp_6 = Spacer_instance.
|
|
747
|
-
var tmp_7 = joinToString(_this__u8e3s4.
|
|
748
|
-
var tmp_8 = Spacer_instance.
|
|
749
|
-
var tmp_9 = Spacer_instance.
|
|
750
|
-
return trimMargin('\n |from: (it) => {\n |' + tmp + 'return {\n |' + tmp_0 + 'method: "' + tmp_1 + '",\n |' + tmp_2 + 'path: {\n |' + tmp_4 + '\n |' + tmp_5 + '},\n |' + tmp_6 + 'queries: {\n |' + tmp_7 + '\n |' + tmp_8 + '},\n |' + tmp_9 + 'headers: {\n |' + joinToString(_this__u8e3s4.
|
|
744
|
+
var tmp_4 = prependIndent(joinToString(tmp_3, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda($this)), Spacer_instance.ov(3));
|
|
745
|
+
var tmp_5 = Spacer_instance.ov(2);
|
|
746
|
+
var tmp_6 = Spacer_instance.ov(2);
|
|
747
|
+
var tmp_7 = joinToString(_this__u8e3s4.ft_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_0($this));
|
|
748
|
+
var tmp_8 = Spacer_instance.ov(2);
|
|
749
|
+
var tmp_9 = Spacer_instance.ov(2);
|
|
750
|
+
return trimMargin('\n |from: (it) => {\n |' + tmp + 'return {\n |' + tmp_0 + 'method: "' + tmp_1 + '",\n |' + tmp_2 + 'path: {\n |' + tmp_4 + '\n |' + tmp_5 + '},\n |' + tmp_6 + 'queries: {\n |' + tmp_7 + '\n |' + tmp_8 + '},\n |' + tmp_9 + 'headers: {\n |' + joinToString(_this__u8e3s4.gt_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_1($this)) + '\n |' + Spacer_instance.ov(2) + '},\n |' + Spacer_instance.ov(2) + 'body: serialization.deserialize(it.body)\n |' + Spacer_instance.ov(1) + '}\n |}\n ');
|
|
751
751
|
}
|
|
752
752
|
function emitServerTo($this, _this__u8e3s4) {
|
|
753
|
-
var tmp = Spacer_instance.
|
|
754
|
-
var tmp_0 = distinctByStatus(_this__u8e3s4.
|
|
755
|
-
return trimMargin('\n |to: (it) => {\n |' + tmp + 'switch (it.status) {\n |' + prependIndent(joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerTo$lambda($this)), Spacer_instance.
|
|
753
|
+
var tmp = Spacer_instance.ov(1);
|
|
754
|
+
var tmp_0 = distinctByStatus(_this__u8e3s4.it_1);
|
|
755
|
+
return trimMargin('\n |to: (it) => {\n |' + tmp + 'switch (it.status) {\n |' + prependIndent(joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerTo$lambda($this)), Spacer_instance.ov(2)) + '\n |' + Spacer_instance.ov(1) + '}\n |}\n ');
|
|
756
756
|
}
|
|
757
757
|
function emitServerToResponse($this, _this__u8e3s4) {
|
|
758
|
-
var tmp = fixStatus(_this__u8e3s4.
|
|
759
|
-
var tmp_0 = Spacer_instance.
|
|
760
|
-
var tmp_1 = Spacer_instance.
|
|
761
|
-
var tmp_2 = fixStatus(_this__u8e3s4.
|
|
762
|
-
var tmp_3 = Spacer_instance.
|
|
763
|
-
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {\n |' + prependIndent(joinToString(_this__u8e3s4.
|
|
758
|
+
var tmp = fixStatus(_this__u8e3s4.ot_1);
|
|
759
|
+
var tmp_0 = Spacer_instance.ov(1);
|
|
760
|
+
var tmp_1 = Spacer_instance.ov(2);
|
|
761
|
+
var tmp_2 = fixStatus(_this__u8e3s4.ot_1);
|
|
762
|
+
var tmp_3 = Spacer_instance.ov(2);
|
|
763
|
+
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {\n |' + prependIndent(joinToString(_this__u8e3s4.pt_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerToResponse$lambda($this)), Spacer_instance.ov(3)) + '\n |' + Spacer_instance.ov(2) + '} as Record<string, string>,\n |' + Spacer_instance.ov(2) + 'body: serialization.serialize(it.body),\n |' + Spacer_instance.ov(1) + '};\n ');
|
|
764
764
|
}
|
|
765
765
|
function emitType($this, _this__u8e3s4, name, block) {
|
|
766
766
|
var tmp;
|
|
@@ -773,7 +773,7 @@ function emitType($this, _this__u8e3s4, name, block) {
|
|
|
773
773
|
return tmp;
|
|
774
774
|
}
|
|
775
775
|
function emitName($this, _this__u8e3s4) {
|
|
776
|
-
return 'Response' + Companion_instance_0.
|
|
776
|
+
return 'Response' + Companion_instance_0.mu(_this__u8e3s4.ot_1);
|
|
777
777
|
}
|
|
778
778
|
function emitFunction_0($this, _this__u8e3s4, endpoint) {
|
|
779
779
|
var tmp = Spacer_instance.toString();
|
|
@@ -799,18 +799,18 @@ function emitFunction_0($this, _this__u8e3s4, endpoint) {
|
|
|
799
799
|
// Inline function 'kotlin.text.orEmpty' call
|
|
800
800
|
var tmp0_elvis_lhs = tmp_4;
|
|
801
801
|
var tmp_5 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
802
|
-
var tmp_6 = Spacer_instance.
|
|
802
|
+
var tmp_6 = Spacer_instance.ov(2);
|
|
803
803
|
var tmp_7 = get_pathParams(endpoint);
|
|
804
804
|
var tmp_8 = joinToObject($this, tmp_7, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_0($this));
|
|
805
|
-
var tmp_9 = Spacer_instance.
|
|
806
|
-
var tmp_10 = endpoint.
|
|
807
|
-
var tmp_11 = Spacer_instance.
|
|
808
|
-
var tmp_12 = joinToObject($this, endpoint.
|
|
809
|
-
var tmp_13 = Spacer_instance.
|
|
810
|
-
var tmp_14 = joinToObject($this, endpoint.
|
|
811
|
-
var tmp_15 = Spacer_instance.
|
|
805
|
+
var tmp_9 = Spacer_instance.ov(2);
|
|
806
|
+
var tmp_10 = endpoint.dt_1.toString();
|
|
807
|
+
var tmp_11 = Spacer_instance.ov(2);
|
|
808
|
+
var tmp_12 = joinToObject($this, endpoint.ft_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_1($this));
|
|
809
|
+
var tmp_13 = Spacer_instance.ov(2);
|
|
810
|
+
var tmp_14 = joinToObject($this, endpoint.gt_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_2($this));
|
|
811
|
+
var tmp_15 = Spacer_instance.ov(2);
|
|
812
812
|
var tmp_16;
|
|
813
|
-
if (_this__u8e3s4.
|
|
813
|
+
if (_this__u8e3s4.lt_1 == null) {
|
|
814
814
|
tmp_16 = null;
|
|
815
815
|
} else {
|
|
816
816
|
// Inline function 'kotlin.let' call
|
|
@@ -821,11 +821,11 @@ function emitFunction_0($this, _this__u8e3s4, endpoint) {
|
|
|
821
821
|
}
|
|
822
822
|
function emitFunction_1($this, _this__u8e3s4) {
|
|
823
823
|
var tmp = Spacer_instance.toString();
|
|
824
|
-
var tmp_0 = Companion_instance_0.
|
|
824
|
+
var tmp_0 = Companion_instance_0.mu(_this__u8e3s4.ot_1);
|
|
825
825
|
var tmp_1 = paramList_0(_this__u8e3s4);
|
|
826
826
|
var tmp_2 = joinToObject($this, tmp_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3($this));
|
|
827
827
|
var tmp_3 = Spacer_instance.toString();
|
|
828
|
-
var tmp_4 = Companion_instance_0.
|
|
828
|
+
var tmp_4 = Companion_instance_0.mu(_this__u8e3s4.ot_1);
|
|
829
829
|
// Inline function 'kotlin.takeIf' call
|
|
830
830
|
var this_0 = paramList_0(_this__u8e3s4);
|
|
831
831
|
var tmp_5;
|
|
@@ -840,19 +840,19 @@ function emitFunction_1($this, _this__u8e3s4) {
|
|
|
840
840
|
tmp_6 = null;
|
|
841
841
|
} else {
|
|
842
842
|
// Inline function 'kotlin.run' call
|
|
843
|
-
tmp_6 = 'params: Response' + Companion_instance_0.
|
|
843
|
+
tmp_6 = 'params: Response' + Companion_instance_0.mu(_this__u8e3s4.ot_1) + 'Params';
|
|
844
844
|
}
|
|
845
845
|
// Inline function 'kotlin.text.orEmpty' call
|
|
846
846
|
var tmp0_elvis_lhs = tmp_6;
|
|
847
847
|
var tmp_7 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
848
|
-
var tmp_8 = Companion_instance_0.
|
|
849
|
-
var tmp_9 = Spacer_instance.
|
|
850
|
-
var tmp_10 = fixStatus(_this__u8e3s4.
|
|
851
|
-
var tmp_11 = Spacer_instance.
|
|
852
|
-
var tmp_12 = joinToObject($this, _this__u8e3s4.
|
|
853
|
-
var tmp_13 = Spacer_instance.
|
|
848
|
+
var tmp_8 = Companion_instance_0.mu(_this__u8e3s4.ot_1);
|
|
849
|
+
var tmp_9 = Spacer_instance.ov(2);
|
|
850
|
+
var tmp_10 = fixStatus(_this__u8e3s4.ot_1);
|
|
851
|
+
var tmp_11 = Spacer_instance.ov(2);
|
|
852
|
+
var tmp_12 = joinToObject($this, _this__u8e3s4.pt_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_4($this));
|
|
853
|
+
var tmp_13 = Spacer_instance.ov(2);
|
|
854
854
|
var tmp_14;
|
|
855
|
-
if (_this__u8e3s4.
|
|
855
|
+
if (_this__u8e3s4.qt_1 == null) {
|
|
856
856
|
tmp_14 = null;
|
|
857
857
|
} else {
|
|
858
858
|
// Inline function 'kotlin.let' call
|
|
@@ -862,60 +862,60 @@ function emitFunction_1($this, _this__u8e3s4) {
|
|
|
862
862
|
return trimMargin('\n |' + tmp + 'export type Response' + tmp_0 + 'Params = ' + tmp_2 + '\n |' + tmp_3 + 'export const response' + tmp_4 + ' = (' + tmp_7 + '): Response' + tmp_8 + ' => ({\n |' + tmp_9 + 'status: ' + tmp_10 + ',\n |' + tmp_11 + 'headers: ' + tmp_12 + ',\n |' + tmp_13 + 'body: ' + (tmp2_elvis_lhs == null ? 'undefined' : tmp2_elvis_lhs) + ',\n |' + Spacer_instance.toString() + '})\n ');
|
|
863
863
|
}
|
|
864
864
|
function emitReference($this, _this__u8e3s4) {
|
|
865
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
866
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
867
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
865
|
+
var tmp0_safe_receiver = _this__u8e3s4.qt_1;
|
|
866
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.nt_1;
|
|
867
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.vt(tmp1_safe_receiver);
|
|
868
868
|
return tmp2_elvis_lhs == null ? 'undefined' : tmp2_elvis_lhs;
|
|
869
869
|
}
|
|
870
870
|
function emitPathArray($this, _this__u8e3s4) {
|
|
871
|
-
return joinToString(_this__u8e3s4.
|
|
871
|
+
return joinToString(_this__u8e3s4.et_1, ', ', '[', ']', VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda($this));
|
|
872
872
|
}
|
|
873
873
|
function emitType_0($this, _this__u8e3s4) {
|
|
874
874
|
var tmp = Spacer_instance.toString();
|
|
875
875
|
var tmp_0 = emitName($this, _this__u8e3s4);
|
|
876
|
-
var tmp_1 = Spacer_instance.
|
|
877
|
-
var tmp_2 = fixStatus(_this__u8e3s4.
|
|
878
|
-
var tmp_3 = Spacer_instance.
|
|
879
|
-
return trimMargin('\n |' + tmp + 'export type ' + tmp_0 + ' = {\n |' + tmp_1 + 'status: ' + tmp_2 + '\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.
|
|
876
|
+
var tmp_1 = Spacer_instance.ov(2);
|
|
877
|
+
var tmp_2 = fixStatus(_this__u8e3s4.ot_1);
|
|
878
|
+
var tmp_3 = Spacer_instance.ov(2);
|
|
879
|
+
return trimMargin('\n |' + tmp + 'export type ' + tmp_0 + ' = {\n |' + tmp_1 + 'status: ' + tmp_2 + '\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.pt_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitType$lambda_0($this)) + '}\n |' + Spacer_instance.ov(2) + 'body: ' + emitReference($this, _this__u8e3s4) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
880
880
|
}
|
|
881
881
|
function emitReference_0($this, _this__u8e3s4) {
|
|
882
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
883
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
884
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
882
|
+
var tmp0_safe_receiver = _this__u8e3s4.lt_1;
|
|
883
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.nt_1;
|
|
884
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.vt(tmp1_safe_receiver);
|
|
885
885
|
return tmp2_elvis_lhs == null ? 'undefined' : tmp2_elvis_lhs;
|
|
886
886
|
}
|
|
887
887
|
function emitType_1($this, _this__u8e3s4, endpoint) {
|
|
888
|
-
return trimMargin('\n |' + Spacer_instance.toString() + 'export type Request = {\n |' + Spacer_instance.
|
|
888
|
+
return trimMargin('\n |' + Spacer_instance.toString() + 'export type Request = {\n |' + Spacer_instance.ov(2) + 'path: Path\n |' + Spacer_instance.ov(2) + 'method: "' + endpoint.dt_1.toString() + '"\n |' + Spacer_instance.ov(2) + 'queries: Queries\n |' + Spacer_instance.ov(2) + 'headers: Headers\n |' + Spacer_instance.ov(2) + 'body: ' + emitReference_0($this, _this__u8e3s4) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
889
889
|
}
|
|
890
890
|
function emit_12($this, _this__u8e3s4) {
|
|
891
|
-
return Spacer_instance.toString() + $this.
|
|
891
|
+
return Spacer_instance.toString() + $this.uu(_this__u8e3s4.jt_1) + ': ' + $this.vt(_this__u8e3s4.kt_1);
|
|
892
892
|
}
|
|
893
893
|
function emit_13($this, _this__u8e3s4) {
|
|
894
|
-
return $this.
|
|
894
|
+
return $this.uu(_this__u8e3s4.hu_1) + (_this__u8e3s4.iu_1.ay() ? '?' : '') + ': ' + $this.vt(_this__u8e3s4.iu_1.cy(false));
|
|
895
895
|
}
|
|
896
896
|
function emitDeserialize($this, _this__u8e3s4) {
|
|
897
|
-
return $this.
|
|
897
|
+
return $this.uu(_this__u8e3s4.jf_1.jt_1) + ': serialization.deserialize(it.path[' + _this__u8e3s4.if_1 + '])';
|
|
898
898
|
}
|
|
899
899
|
function emitDeserialize_0($this, _this__u8e3s4, fields, caseSensitive) {
|
|
900
|
-
return caseSensitive ? $this.
|
|
900
|
+
return caseSensitive ? $this.uu(_this__u8e3s4.ys_1) + ': serialization.deserialize(it.' + fields + '[' + $this.uu(_this__u8e3s4.ys_1) + '])' : $this.uu(_this__u8e3s4.ys_1) + ': serialization.deserialize(Object.entries(it.' + fields + ').find(([key]) => key.toLowerCase() === ' + $this.uu(lowercase($this, _this__u8e3s4.ys_1)) + ')?.[1])';
|
|
901
901
|
}
|
|
902
902
|
function emitDeserialize$default($this, _this__u8e3s4, fields, caseSensitive, $super) {
|
|
903
903
|
caseSensitive = caseSensitive === VOID ? true : caseSensitive;
|
|
904
904
|
return emitDeserialize_0($this, _this__u8e3s4, fields, caseSensitive);
|
|
905
905
|
}
|
|
906
906
|
function emitSerialize($this, _this__u8e3s4, fields) {
|
|
907
|
-
return $this.
|
|
907
|
+
return $this.uu(_this__u8e3s4.ys_1) + ': serialization.serialize(it.' + fields + '[' + $this.uu(_this__u8e3s4.ys_1) + '])';
|
|
908
908
|
}
|
|
909
909
|
function joinToObject($this, _this__u8e3s4, transform) {
|
|
910
910
|
return joinToString(_this__u8e3s4, ', ', '{', '}', VOID, VOID, transform);
|
|
911
911
|
}
|
|
912
912
|
function emitHandleFunction($this, endpoint) {
|
|
913
|
-
return Companion_instance_0.
|
|
913
|
+
return Companion_instance_0.nu($this.q23(endpoint.ct_1)) + ': (request:Request) => Promise<Response>';
|
|
914
914
|
}
|
|
915
915
|
function lowercase($this, _this__u8e3s4) {
|
|
916
916
|
// Inline function 'kotlin.text.lowercase' call
|
|
917
917
|
// Inline function 'kotlin.js.asDynamic' call
|
|
918
|
-
var tmp$ret$1 = _this__u8e3s4.
|
|
918
|
+
var tmp$ret$1 = _this__u8e3s4.m1().toLowerCase();
|
|
919
919
|
return new FieldIdentifier(tmp$ret$1);
|
|
920
920
|
}
|
|
921
921
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda(it) {
|
|
@@ -929,12 +929,12 @@ function TypeScriptEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
|
929
929
|
}
|
|
930
930
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
931
931
|
return function (it) {
|
|
932
|
-
return this$0.
|
|
932
|
+
return this$0.ut(it);
|
|
933
933
|
};
|
|
934
934
|
}
|
|
935
935
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
936
936
|
return function (it) {
|
|
937
|
-
return this$0.
|
|
937
|
+
return this$0.ut(it);
|
|
938
938
|
};
|
|
939
939
|
}
|
|
940
940
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
@@ -984,12 +984,12 @@ function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda(this$0) {
|
|
|
984
984
|
}
|
|
985
985
|
function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_0(this$0) {
|
|
986
986
|
return function (it) {
|
|
987
|
-
return prependIndent(emitDeserialize$default(this$0, it, 'queries'), Spacer_instance.
|
|
987
|
+
return prependIndent(emitDeserialize$default(this$0, it, 'queries'), Spacer_instance.ov(3));
|
|
988
988
|
};
|
|
989
989
|
}
|
|
990
990
|
function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_1(this$0) {
|
|
991
991
|
return function (it) {
|
|
992
|
-
return prependIndent(emitDeserialize_0(this$0, it, 'headers', false), Spacer_instance.
|
|
992
|
+
return prependIndent(emitDeserialize_0(this$0, it, 'headers', false), Spacer_instance.ov(3));
|
|
993
993
|
};
|
|
994
994
|
}
|
|
995
995
|
function TypeScriptEndpointDefinitionEmitter$emitServerTo$lambda(this$0) {
|
|
@@ -1004,7 +1004,7 @@ function TypeScriptEndpointDefinitionEmitter$emitServerToResponse$lambda(this$0)
|
|
|
1004
1004
|
}
|
|
1005
1005
|
function TypeScriptEndpointDefinitionEmitter$emitType$lambda($block) {
|
|
1006
1006
|
return function (it) {
|
|
1007
|
-
return Spacer_instance.
|
|
1007
|
+
return Spacer_instance.ov(1) + $block(it);
|
|
1008
1008
|
};
|
|
1009
1009
|
}
|
|
1010
1010
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda(this$0) {
|
|
@@ -1014,17 +1014,17 @@ function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda(this$0) {
|
|
|
1014
1014
|
}
|
|
1015
1015
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_0(this$0) {
|
|
1016
1016
|
return function (it) {
|
|
1017
|
-
return this$0.
|
|
1017
|
+
return this$0.uu(it.jt_1) + ': params[' + this$0.uu(it.jt_1) + ']';
|
|
1018
1018
|
};
|
|
1019
1019
|
}
|
|
1020
1020
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_1(this$0) {
|
|
1021
1021
|
return function (it) {
|
|
1022
|
-
return this$0.
|
|
1022
|
+
return this$0.uu(it.ys_1) + ': params[' + this$0.uu(it.ys_1) + ']';
|
|
1023
1023
|
};
|
|
1024
1024
|
}
|
|
1025
1025
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_2(this$0) {
|
|
1026
1026
|
return function (it) {
|
|
1027
|
-
return this$0.
|
|
1027
|
+
return this$0.uu(it.ys_1) + ': params[' + this$0.uu(it.ys_1) + ']';
|
|
1028
1028
|
};
|
|
1029
1029
|
}
|
|
1030
1030
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3(this$0) {
|
|
@@ -1034,17 +1034,17 @@ function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3(this$0) {
|
|
|
1034
1034
|
}
|
|
1035
1035
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_4(this$0) {
|
|
1036
1036
|
return function (it) {
|
|
1037
|
-
return this$0.
|
|
1037
|
+
return this$0.uu(it.ys_1) + ': params[' + this$0.uu(it.ys_1) + ']';
|
|
1038
1038
|
};
|
|
1039
1039
|
}
|
|
1040
1040
|
function TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda(this$0) {
|
|
1041
1041
|
return function (it) {
|
|
1042
1042
|
var tmp;
|
|
1043
1043
|
if (it instanceof Literal) {
|
|
1044
|
-
tmp = '"' + it.
|
|
1044
|
+
tmp = '"' + it.fu_1 + '"';
|
|
1045
1045
|
} else {
|
|
1046
1046
|
if (it instanceof Param) {
|
|
1047
|
-
tmp = 'serialization.serialize(it.path[' + this$0.
|
|
1047
|
+
tmp = 'serialization.serialize(it.path[' + this$0.uu(it.jt_1) + '])';
|
|
1048
1048
|
} else {
|
|
1049
1049
|
noWhenBranchMatchedException();
|
|
1050
1050
|
}
|
|
@@ -1054,7 +1054,7 @@ function TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda(this$0) {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
function TypeScriptEndpointDefinitionEmitter$emitType$lambda_0(this$0) {
|
|
1056
1056
|
return function (it) {
|
|
1057
|
-
return this$0.
|
|
1057
|
+
return this$0.uu(it.ys_1) + ': ' + this$0.vt(it.zs_1);
|
|
1058
1058
|
};
|
|
1059
1059
|
}
|
|
1060
1060
|
function TypeScriptEndpointDefinitionEmitter() {
|
|
@@ -1067,14 +1067,14 @@ function TypeScriptEnumDefinitionEmitter() {
|
|
|
1067
1067
|
function TypeScriptIdentifierEmitter() {
|
|
1068
1068
|
}
|
|
1069
1069
|
function _get_sanitizationConfig__sns434($this) {
|
|
1070
|
-
var tmp0 = $this.
|
|
1070
|
+
var tmp0 = $this.z23_1;
|
|
1071
1071
|
var tmp = KProperty1;
|
|
1072
1072
|
// Inline function 'kotlin.getValue' call
|
|
1073
1073
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, TypeScriptIrEmitter$_get_sanitizationConfig_$ref_f6f0bh(), null);
|
|
1074
|
-
return tmp0.
|
|
1074
|
+
return tmp0.m1();
|
|
1075
1075
|
}
|
|
1076
1076
|
function sanitize($this, _this__u8e3s4) {
|
|
1077
|
-
return '"' + _this__u8e3s4.
|
|
1077
|
+
return '"' + _this__u8e3s4.m1() + '"';
|
|
1078
1078
|
}
|
|
1079
1079
|
function sanitizeSymbol_1($this, _this__u8e3s4) {
|
|
1080
1080
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1095,7 +1095,7 @@ function sanitizeSymbol_1($this, _this__u8e3s4) {
|
|
|
1095
1095
|
return destination.toString();
|
|
1096
1096
|
}
|
|
1097
1097
|
function sanitizeKeywords($this, _this__u8e3s4) {
|
|
1098
|
-
return Companion_getInstance_0().
|
|
1098
|
+
return Companion_getInstance_0().b24_1.v1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1099
1099
|
}
|
|
1100
1100
|
function firstToLower($this, _this__u8e3s4) {
|
|
1101
1101
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
@@ -1114,10 +1114,10 @@ function firstToLower($this, _this__u8e3s4) {
|
|
|
1114
1114
|
return tmp;
|
|
1115
1115
|
}
|
|
1116
1116
|
function sanitizeParamName($this, identifier) {
|
|
1117
|
-
var tmp0 = identifier.
|
|
1117
|
+
var tmp0 = identifier.m1();
|
|
1118
1118
|
// Inline function 'kotlin.text.split' call
|
|
1119
1119
|
// Inline function 'kotlin.collections.filter' call
|
|
1120
|
-
var tmp0_0 = Regex_init_$Create$('[.\\s-]+').
|
|
1120
|
+
var tmp0_0 = Regex_init_$Create$('[.\\s-]+').zc(tmp0, 0);
|
|
1121
1121
|
// Inline function 'kotlin.collections.filterTo' call
|
|
1122
1122
|
var destination = ArrayList_init_$Create$();
|
|
1123
1123
|
var _iterator__ex2g4s = tmp0_0.t();
|
|
@@ -1129,7 +1129,7 @@ function sanitizeParamName($this, identifier) {
|
|
|
1129
1129
|
}
|
|
1130
1130
|
}
|
|
1131
1131
|
var parts = destination;
|
|
1132
|
-
var name = parts.
|
|
1132
|
+
var name = parts.a1() > 1 ? (new Name(parts)).v1p() : identifier.m1();
|
|
1133
1133
|
return sanitizeKeywords($this, sanitizeSymbol_1($this, name));
|
|
1134
1134
|
}
|
|
1135
1135
|
function buildEndpointParams($this, endpoint) {
|
|
@@ -1138,7 +1138,7 @@ function buildEndpointParams($this, endpoint) {
|
|
|
1138
1138
|
// Inline function 'kotlin.apply' call
|
|
1139
1139
|
var this_0 = ArrayList_init_$Create$();
|
|
1140
1140
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1141
|
-
var tmp0 = endpoint.
|
|
1141
|
+
var tmp0 = endpoint.et_1;
|
|
1142
1142
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1143
1143
|
var destination = ArrayList_init_$Create$();
|
|
1144
1144
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1152,36 +1152,36 @@ function buildEndpointParams($this, endpoint) {
|
|
|
1152
1152
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1153
1153
|
while (_iterator__ex2g4s_0.u()) {
|
|
1154
1154
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
1155
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_0.
|
|
1155
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_0.jt_1), emitTypeScriptReference($this, element_0.kt_1.cy(false)), element_0.kt_1.ay()));
|
|
1156
1156
|
}
|
|
1157
1157
|
// Inline function 'kotlin.collections.forEach' call
|
|
1158
|
-
var _iterator__ex2g4s_1 = endpoint.
|
|
1158
|
+
var _iterator__ex2g4s_1 = endpoint.ft_1.t();
|
|
1159
1159
|
while (_iterator__ex2g4s_1.u()) {
|
|
1160
1160
|
var element_1 = _iterator__ex2g4s_1.v();
|
|
1161
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_1.
|
|
1161
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_1.ys_1), emitTypeScriptReference($this, element_1.zs_1.cy(false)), element_1.zs_1.ay()));
|
|
1162
1162
|
}
|
|
1163
1163
|
// Inline function 'kotlin.collections.forEach' call
|
|
1164
|
-
var _iterator__ex2g4s_2 = endpoint.
|
|
1164
|
+
var _iterator__ex2g4s_2 = endpoint.gt_1.t();
|
|
1165
1165
|
while (_iterator__ex2g4s_2.u()) {
|
|
1166
1166
|
var element_2 = _iterator__ex2g4s_2.v();
|
|
1167
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_2.
|
|
1167
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_2.ys_1), emitTypeScriptReference($this, element_2.zs_1.cy(false)), element_2.zs_1.ay()));
|
|
1168
1168
|
}
|
|
1169
|
-
var tmp0_safe_receiver = first(endpoint.
|
|
1169
|
+
var tmp0_safe_receiver = first(endpoint.ht_1).lt_1;
|
|
1170
1170
|
if (tmp0_safe_receiver == null)
|
|
1171
1171
|
null;
|
|
1172
1172
|
else {
|
|
1173
1173
|
// Inline function 'kotlin.let' call
|
|
1174
|
-
this_0.x(new EndpointParam('body', emitTypeScriptReference($this, tmp0_safe_receiver.
|
|
1174
|
+
this_0.x(new EndpointParam('body', emitTypeScriptReference($this, tmp0_safe_receiver.nt_1.cy(false)), tmp0_safe_receiver.nt_1.ay()));
|
|
1175
1175
|
}
|
|
1176
|
-
return this_0.
|
|
1176
|
+
return this_0.p5();
|
|
1177
1177
|
}
|
|
1178
1178
|
function emitTypeScriptReference($this, ref) {
|
|
1179
1179
|
var tmp;
|
|
1180
1180
|
if (ref instanceof Dict) {
|
|
1181
|
-
tmp = 'Record<string, ' + emitTypeScriptReference($this, ref.
|
|
1181
|
+
tmp = 'Record<string, ' + emitTypeScriptReference($this, ref.as_1) + '>';
|
|
1182
1182
|
} else {
|
|
1183
1183
|
if (ref instanceof Iterable) {
|
|
1184
|
-
tmp = emitTypeScriptReference($this, ref.
|
|
1184
|
+
tmp = emitTypeScriptReference($this, ref.xr_1) + '[]';
|
|
1185
1185
|
} else {
|
|
1186
1186
|
if (ref instanceof Unit) {
|
|
1187
1187
|
tmp = 'undefined';
|
|
@@ -1190,10 +1190,10 @@ function emitTypeScriptReference($this, ref) {
|
|
|
1190
1190
|
tmp = 'any';
|
|
1191
1191
|
} else {
|
|
1192
1192
|
if (ref instanceof Custom) {
|
|
1193
|
-
tmp = sanitizeSymbol_1($this, ref.
|
|
1193
|
+
tmp = sanitizeSymbol_1($this, ref.iy_1);
|
|
1194
1194
|
} else {
|
|
1195
1195
|
if (ref instanceof Primitive) {
|
|
1196
|
-
var tmp1_subject = ref.
|
|
1196
|
+
var tmp1_subject = ref.my_1;
|
|
1197
1197
|
var tmp_0;
|
|
1198
1198
|
if (tmp1_subject instanceof String_0) {
|
|
1199
1199
|
tmp_0 = 'string';
|
|
@@ -1226,20 +1226,20 @@ function emitTypeScriptReference($this, ref) {
|
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
1228
1228
|
// Inline function 'kotlin.let' call
|
|
1229
|
-
return tmp + (ref.
|
|
1229
|
+
return tmp + (ref.ay() ? ' | undefined' : '');
|
|
1230
1230
|
}
|
|
1231
1231
|
function EndpointParam(name, type, nullable) {
|
|
1232
|
-
this.
|
|
1233
|
-
this.
|
|
1234
|
-
this.
|
|
1232
|
+
this.c24_1 = name;
|
|
1233
|
+
this.d24_1 = type;
|
|
1234
|
+
this.e24_1 = nullable;
|
|
1235
1235
|
}
|
|
1236
1236
|
protoOf(EndpointParam).toString = function () {
|
|
1237
|
-
return 'EndpointParam(name=' + this.
|
|
1237
|
+
return 'EndpointParam(name=' + this.c24_1 + ', type=' + this.d24_1 + ', nullable=' + this.e24_1 + ')';
|
|
1238
1238
|
};
|
|
1239
1239
|
protoOf(EndpointParam).hashCode = function () {
|
|
1240
|
-
var result = getStringHashCode(this.
|
|
1241
|
-
result = imul(result, 31) + getStringHashCode(this.
|
|
1242
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
1240
|
+
var result = getStringHashCode(this.c24_1);
|
|
1241
|
+
result = imul(result, 31) + getStringHashCode(this.d24_1) | 0;
|
|
1242
|
+
result = imul(result, 31) + getBooleanHashCode(this.e24_1) | 0;
|
|
1243
1243
|
return result;
|
|
1244
1244
|
};
|
|
1245
1245
|
protoOf(EndpointParam).equals = function (other) {
|
|
@@ -1247,11 +1247,11 @@ protoOf(EndpointParam).equals = function (other) {
|
|
|
1247
1247
|
return true;
|
|
1248
1248
|
if (!(other instanceof EndpointParam))
|
|
1249
1249
|
return false;
|
|
1250
|
-
if (!(this.
|
|
1250
|
+
if (!(this.c24_1 === other.c24_1))
|
|
1251
1251
|
return false;
|
|
1252
|
-
if (!(this.
|
|
1252
|
+
if (!(this.d24_1 === other.d24_1))
|
|
1253
1253
|
return false;
|
|
1254
|
-
if (!(this.
|
|
1254
|
+
if (!(this.e24_1 === other.e24_1))
|
|
1255
1255
|
return false;
|
|
1256
1256
|
return true;
|
|
1257
1257
|
};
|
|
@@ -1268,10 +1268,10 @@ function Companion() {
|
|
|
1268
1268
|
// Inline function 'kotlin.text.lowercase' call
|
|
1269
1269
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1270
1270
|
var tmp$ret$2 = removePrefix(element, 'GeneratorField').toLowerCase();
|
|
1271
|
-
result.
|
|
1271
|
+
result.y2(element, tmp$ret$2);
|
|
1272
1272
|
}
|
|
1273
|
-
tmp.
|
|
1274
|
-
this.
|
|
1273
|
+
tmp.a24_1 = result;
|
|
1274
|
+
this.b24_1 = setOf(['break', 'case', 'catch', 'continue', 'debugger', 'default', 'delete', 'do', 'else', 'finally', 'for', 'function', 'if', 'in', 'instanceof', 'new', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'var', 'void', 'while', 'with', 'class', 'const', 'enum', 'export', 'extends', 'import', 'super', 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', 'yield', 'type', 'async', 'await']);
|
|
1275
1275
|
}
|
|
1276
1276
|
var Companion_instance_1;
|
|
1277
1277
|
function Companion_getInstance_0() {
|
|
@@ -1284,13 +1284,13 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
1284
1284
|
}
|
|
1285
1285
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1286
1286
|
return function (name) {
|
|
1287
|
-
var sanitized = name.
|
|
1287
|
+
var sanitized = name.s1k_1.a1() > 1 ? name.v1p() : sanitizeSymbol_1(this$0, name.p1m());
|
|
1288
1288
|
return new Name(listOf_0(sanitized));
|
|
1289
1289
|
};
|
|
1290
1290
|
}
|
|
1291
1291
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0) {
|
|
1292
1292
|
return function (name) {
|
|
1293
|
-
var sanitized = name.
|
|
1293
|
+
var sanitized = name.s1k_1.a1() > 1 ? name.v1p() : sanitizeSymbol_1(this$0, name.p1m());
|
|
1294
1294
|
return new Name(listOf_0(sanitized));
|
|
1295
1295
|
};
|
|
1296
1296
|
}
|
|
@@ -1316,29 +1316,29 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0)
|
|
|
1316
1316
|
return function (stmt, tr) {
|
|
1317
1317
|
var tmp;
|
|
1318
1318
|
if (stmt instanceof VariableReference) {
|
|
1319
|
-
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
1319
|
+
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.p1s_1));
|
|
1320
1320
|
} else {
|
|
1321
1321
|
if (stmt instanceof ConstructorStatement) {
|
|
1322
|
-
var tmp_0 = tr.
|
|
1322
|
+
var tmp_0 = tr.d1y(stmt.x1q_1);
|
|
1323
1323
|
// Inline function 'kotlin.collections.map' call
|
|
1324
|
-
var this_0 = stmt.
|
|
1324
|
+
var this_0 = stmt.y1q_1;
|
|
1325
1325
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1326
|
-
var destination = ArrayList_init_$Create$_0(this_0.
|
|
1326
|
+
var destination = ArrayList_init_$Create$_0(this_0.a1());
|
|
1327
1327
|
// Inline function 'kotlin.collections.iterator' call
|
|
1328
|
-
var _iterator__ex2g4s = this_0.
|
|
1328
|
+
var _iterator__ex2g4s = this_0.k1().t();
|
|
1329
1329
|
while (_iterator__ex2g4s.u()) {
|
|
1330
1330
|
var item = _iterator__ex2g4s.v();
|
|
1331
1331
|
// Inline function 'kotlin.collections.component1' call
|
|
1332
|
-
var key = item.
|
|
1332
|
+
var key = item.l1();
|
|
1333
1333
|
// Inline function 'kotlin.collections.component2' call
|
|
1334
|
-
var value = item.
|
|
1335
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.
|
|
1334
|
+
var value = item.m1();
|
|
1335
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.g1y(value));
|
|
1336
1336
|
destination.x(tmp$ret$3);
|
|
1337
1337
|
}
|
|
1338
1338
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
1339
1339
|
} else {
|
|
1340
1340
|
if (stmt instanceof Assignment) {
|
|
1341
|
-
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
1341
|
+
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.s1s_1), tr.g1y(stmt.t1s_1), stmt.u1s_1);
|
|
1342
1342
|
} else {
|
|
1343
1343
|
tmp = transformChildren(stmt, tr);
|
|
1344
1344
|
}
|
|
@@ -1349,7 +1349,7 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0)
|
|
|
1349
1349
|
}
|
|
1350
1350
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1351
1351
|
return function () {
|
|
1352
|
-
var tmp0_reservedKeywords = Companion_getInstance_0().
|
|
1352
|
+
var tmp0_reservedKeywords = Companion_getInstance_0().b24_1;
|
|
1353
1353
|
var tmp = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1354
1354
|
var tmp_0 = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
|
|
1355
1355
|
var tmp_1 = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
|
|
@@ -1365,11 +1365,11 @@ function TypeScriptIrEmitter$_get_sanitizationConfig_$ref_f6f0bh() {
|
|
|
1365
1365
|
function TypeScriptIrEmitter$emitShared$lambda(element, transformer) {
|
|
1366
1366
|
var tmp;
|
|
1367
1367
|
if (element instanceof Namespace) {
|
|
1368
|
-
var injected = element.
|
|
1368
|
+
var injected = element.g1r_1.equals(Companion_getInstance().u1k('Wirespec')) ? listOf_0(new RawElement('export type Type = string')) : emptyList();
|
|
1369
1369
|
var tmp_0;
|
|
1370
1370
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1371
1371
|
if (!injected.r()) {
|
|
1372
|
-
tmp_0 = withElements(element, plus_1(injected, element.
|
|
1372
|
+
tmp_0 = withElements(element, plus_1(injected, element.c1r()));
|
|
1373
1373
|
} else {
|
|
1374
1374
|
tmp_0 = element;
|
|
1375
1375
|
}
|
|
@@ -1384,11 +1384,11 @@ function TypeScriptIrEmitter$emitShared$lambda_0($api) {
|
|
|
1384
1384
|
return function (element, transformer) {
|
|
1385
1385
|
var tmp;
|
|
1386
1386
|
if (element instanceof Namespace) {
|
|
1387
|
-
var injected = element.
|
|
1387
|
+
var injected = element.g1r_1.equals(Companion_getInstance().u1k('Wirespec')) ? listOf_0(new RawElement($api)) : emptyList();
|
|
1388
1388
|
var tmp_0;
|
|
1389
1389
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1390
1390
|
if (!injected.r()) {
|
|
1391
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1391
|
+
tmp_0 = withElements(element, plus_1(element.c1r(), injected));
|
|
1392
1392
|
} else {
|
|
1393
1393
|
tmp_0 = element;
|
|
1394
1394
|
}
|
|
@@ -1403,13 +1403,13 @@ function TypeScriptIrEmitter$emitShared$lambda_0($api) {
|
|
|
1403
1403
|
function TypeScriptIrEmitter$emitShared$lambda_1(element, transformer) {
|
|
1404
1404
|
var tmp;
|
|
1405
1405
|
if (element instanceof Struct) {
|
|
1406
|
-
var tmp0_safe_receiver = Companion_getInstance_0().
|
|
1406
|
+
var tmp0_safe_receiver = Companion_getInstance_0().a24_1.q2(element.l1r_1.p1m());
|
|
1407
1407
|
var tmp_0;
|
|
1408
1408
|
if (tmp0_safe_receiver == null) {
|
|
1409
1409
|
tmp_0 = null;
|
|
1410
1410
|
} else {
|
|
1411
1411
|
// Inline function 'kotlin.let' call
|
|
1412
|
-
tmp_0 = element.
|
|
1412
|
+
tmp_0 = element.s1r(VOID, plus_1(listOf_0(new Field(Companion_getInstance().u1k('kind'), new StringLiteral(tmp0_safe_receiver))), element.m1r_1));
|
|
1413
1413
|
}
|
|
1414
1414
|
var tmp1_elvis_lhs = tmp_0;
|
|
1415
1415
|
tmp = tmp1_elvis_lhs == null ? element : tmp1_elvis_lhs;
|
|
@@ -1420,7 +1420,7 @@ function TypeScriptIrEmitter$emitShared$lambda_1(element, transformer) {
|
|
|
1420
1420
|
return transformChildren_0(transformed, transformer);
|
|
1421
1421
|
}
|
|
1422
1422
|
function TypeScriptIrEmitter$emit$lambda(it) {
|
|
1423
|
-
return 'export {' + it.
|
|
1423
|
+
return 'export {' + it.tu().m1() + "} from './" + it.tu().m1() + "'";
|
|
1424
1424
|
}
|
|
1425
1425
|
function TypeScriptIrEmitter$emitGenerator$lambda($definition) {
|
|
1426
1426
|
return function (expr, t) {
|
|
@@ -1429,24 +1429,24 @@ function TypeScriptIrEmitter$emitGenerator$lambda($definition) {
|
|
|
1429
1429
|
var tmp_1;
|
|
1430
1430
|
var tmp_2;
|
|
1431
1431
|
if (expr instanceof FunctionCall) {
|
|
1432
|
-
var tmp_3 = expr.
|
|
1432
|
+
var tmp_3 = expr.d1q_1;
|
|
1433
1433
|
tmp_2 = tmp_3 instanceof RawExpression;
|
|
1434
1434
|
} else {
|
|
1435
1435
|
tmp_2 = false;
|
|
1436
1436
|
}
|
|
1437
1437
|
if (tmp_2) {
|
|
1438
|
-
var tmp_4 = expr.
|
|
1439
|
-
tmp_1 = (tmp_4 instanceof RawExpression ? tmp_4 : THROW_CCE()).
|
|
1438
|
+
var tmp_4 = expr.d1q_1;
|
|
1439
|
+
tmp_1 = (tmp_4 instanceof RawExpression ? tmp_4 : THROW_CCE()).r1s_1 === $definition.ev_1.m1();
|
|
1440
1440
|
} else {
|
|
1441
1441
|
tmp_1 = false;
|
|
1442
1442
|
}
|
|
1443
1443
|
if (tmp_1) {
|
|
1444
|
-
tmp_0 = expr.
|
|
1444
|
+
tmp_0 = expr.f1q_1.equals(Companion_getInstance().u1k('valueOf'));
|
|
1445
1445
|
} else {
|
|
1446
1446
|
tmp_0 = false;
|
|
1447
1447
|
}
|
|
1448
1448
|
if (tmp_0) {
|
|
1449
|
-
var tmp0_elvis_lhs = expr.
|
|
1449
|
+
var tmp0_elvis_lhs = expr.g1q_1.q2(Companion_getInstance().u1k('label'));
|
|
1450
1450
|
tmp = tmp0_elvis_lhs == null ? expr : tmp0_elvis_lhs;
|
|
1451
1451
|
} else {
|
|
1452
1452
|
tmp = transformChildren_1(expr, t);
|
|
@@ -1459,12 +1459,12 @@ function TypeScriptIrEmitter$emitGenerator$lambda_0($definition) {
|
|
|
1459
1459
|
var tmp;
|
|
1460
1460
|
var tmp_0;
|
|
1461
1461
|
if (expr instanceof ConstructorStatement) {
|
|
1462
|
-
tmp_0 = equals(expr.
|
|
1462
|
+
tmp_0 = equals(expr.x1q_1, new Custom_0($definition.zu_1.m1()));
|
|
1463
1463
|
} else {
|
|
1464
1464
|
tmp_0 = false;
|
|
1465
1465
|
}
|
|
1466
1466
|
if (tmp_0) {
|
|
1467
|
-
var tmp0_elvis_lhs = expr.
|
|
1467
|
+
var tmp0_elvis_lhs = expr.y1q_1.q2(Companion_getInstance().u1k('value'));
|
|
1468
1468
|
tmp = tmp0_elvis_lhs == null ? expr : tmp0_elvis_lhs;
|
|
1469
1469
|
} else {
|
|
1470
1470
|
tmp = transformChildren_1(expr, t);
|
|
@@ -1475,36 +1475,36 @@ function TypeScriptIrEmitter$emitGenerator$lambda_0($definition) {
|
|
|
1475
1475
|
function TypeScriptIrEmitter$emitGenerator$lambda_1(expr, t) {
|
|
1476
1476
|
var tmp;
|
|
1477
1477
|
if (expr instanceof ConstructorStatement) {
|
|
1478
|
-
var tmp_0 = expr.
|
|
1478
|
+
var tmp_0 = expr.x1q_1;
|
|
1479
1479
|
var tmp0_safe_receiver = tmp_0 instanceof Custom_0 ? tmp_0 : null;
|
|
1480
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1480
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.n1m_1;
|
|
1481
1481
|
var typeName = tmp1_safe_receiver == null ? null : removePrefix(tmp1_safe_receiver, 'Wirespec.');
|
|
1482
1482
|
var tmp_1;
|
|
1483
1483
|
if (typeName == null) {
|
|
1484
1484
|
tmp_1 = null;
|
|
1485
1485
|
} else {
|
|
1486
1486
|
// Inline function 'kotlin.let' call
|
|
1487
|
-
tmp_1 = Companion_getInstance_0().
|
|
1487
|
+
tmp_1 = Companion_getInstance_0().a24_1.q2(typeName);
|
|
1488
1488
|
}
|
|
1489
1489
|
var kind = tmp_1;
|
|
1490
1490
|
var tmp_2;
|
|
1491
1491
|
if (!(kind == null)) {
|
|
1492
|
-
var tmp_3 = mapOf(to(Companion_getInstance().
|
|
1492
|
+
var tmp_3 = mapOf(to(Companion_getInstance().u1k('kind'), new Literal_0(kind, String_instance)));
|
|
1493
1493
|
// Inline function 'kotlin.collections.mapValues' call
|
|
1494
|
-
var this_0 = expr.
|
|
1494
|
+
var this_0 = expr.y1q_1;
|
|
1495
1495
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
1496
|
-
var destination = LinkedHashMap_init_$Create$_0(mapCapacity(this_0.
|
|
1496
|
+
var destination = LinkedHashMap_init_$Create$_0(mapCapacity(this_0.a1()));
|
|
1497
1497
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
1498
|
-
var _iterator__ex2g4s = this_0.
|
|
1498
|
+
var _iterator__ex2g4s = this_0.k1().t();
|
|
1499
1499
|
while (_iterator__ex2g4s.u()) {
|
|
1500
1500
|
var element = _iterator__ex2g4s.v();
|
|
1501
|
-
var tmp_4 = element.
|
|
1501
|
+
var tmp_4 = element.l1();
|
|
1502
1502
|
// Inline function 'kotlin.collections.component2' call
|
|
1503
|
-
var v = element.
|
|
1504
|
-
var tmp$ret$4 = t.
|
|
1505
|
-
destination.
|
|
1503
|
+
var v = element.m1();
|
|
1504
|
+
var tmp$ret$4 = t.g1y(v);
|
|
1505
|
+
destination.y2(tmp_4, tmp$ret$4);
|
|
1506
1506
|
}
|
|
1507
|
-
tmp_2 = new ConstructorStatement(expr.
|
|
1507
|
+
tmp_2 = new ConstructorStatement(expr.x1q_1, plus_2(tmp_3, destination));
|
|
1508
1508
|
} else {
|
|
1509
1509
|
tmp_2 = transformChildren(expr, t);
|
|
1510
1510
|
}
|
|
@@ -1531,17 +1531,17 @@ function TypeScriptIrEmitter$emitGenerator$lambda_5($generatorOwnName, $generato
|
|
|
1531
1531
|
var tmp_0;
|
|
1532
1532
|
var tmp_1;
|
|
1533
1533
|
if (expr instanceof RawExpression) {
|
|
1534
|
-
tmp_1 = endsWith(expr.
|
|
1534
|
+
tmp_1 = endsWith(expr.r1s_1, 'Generator');
|
|
1535
1535
|
} else {
|
|
1536
1536
|
tmp_1 = false;
|
|
1537
1537
|
}
|
|
1538
1538
|
if (tmp_1) {
|
|
1539
|
-
tmp_0 = !(expr.
|
|
1539
|
+
tmp_0 = !(expr.r1s_1 === $generatorOwnName);
|
|
1540
1540
|
} else {
|
|
1541
1541
|
tmp_0 = false;
|
|
1542
1542
|
}
|
|
1543
1543
|
if (tmp_0) {
|
|
1544
|
-
$generatorRefs.x(expr.
|
|
1544
|
+
$generatorRefs.x(expr.r1s_1);
|
|
1545
1545
|
tmp = Unit_instance;
|
|
1546
1546
|
}
|
|
1547
1547
|
return transformChildren_1(expr, t);
|
|
@@ -1555,7 +1555,7 @@ function TypeScriptIrEmitter$emit$injectApiConst$lambda($endpoint) {
|
|
|
1555
1555
|
var tmp_0;
|
|
1556
1556
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1557
1557
|
if (!injected.r()) {
|
|
1558
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1558
|
+
tmp_0 = withElements(element, plus_1(element.c1r(), injected));
|
|
1559
1559
|
} else {
|
|
1560
1560
|
tmp_0 = element;
|
|
1561
1561
|
}
|
|
@@ -1574,14 +1574,14 @@ function emit$injectApiConst(_this__u8e3s4, $endpoint) {
|
|
|
1574
1574
|
var tmp = scope;
|
|
1575
1575
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1576
1576
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1577
|
-
var this_0 = scope.
|
|
1577
|
+
var this_0 = scope.l1y_1;
|
|
1578
1578
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1579
1579
|
// Inline function 'kotlin.apply' call
|
|
1580
1580
|
var this_1 = new TransformerBuilder();
|
|
1581
|
-
this_1.
|
|
1582
|
-
var tmp$ret$2 = this_1.
|
|
1583
|
-
tmp.
|
|
1584
|
-
var tmp_0 = scope.
|
|
1581
|
+
this_1.d1m(TypeScriptIrEmitter$emit$injectApiConst$lambda($endpoint));
|
|
1582
|
+
var tmp$ret$2 = this_1.e1m();
|
|
1583
|
+
tmp.l1y_1 = transform(this_0, tmp$ret$2);
|
|
1584
|
+
var tmp_0 = scope.l1y_1;
|
|
1585
1585
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1586
1586
|
}
|
|
1587
1587
|
function emit$applyCallParamsIfNeeded(_this__u8e3s4, hasRequestParams) {
|
|
@@ -1589,25 +1589,25 @@ function emit$applyCallParamsIfNeeded(_this__u8e3s4, hasRequestParams) {
|
|
|
1589
1589
|
}
|
|
1590
1590
|
function TypeScriptIrEmitter$emitClient$lambda(this$0) {
|
|
1591
1591
|
return function (it) {
|
|
1592
|
-
var methodName = firstToLower(this$0, it.
|
|
1592
|
+
var methodName = firstToLower(this$0, it.ct_1.m1());
|
|
1593
1593
|
return ' ...' + methodName + 'Client(serialization, transportation),';
|
|
1594
1594
|
};
|
|
1595
1595
|
}
|
|
1596
1596
|
function TypeScriptIrEmitter() {
|
|
1597
1597
|
Companion_getInstance_0();
|
|
1598
|
-
this.
|
|
1599
|
-
this.
|
|
1598
|
+
this.x23_1 = TypeScriptGenerator_getInstance();
|
|
1599
|
+
this.y23_1 = FileExtension_TypeScript_getInstance();
|
|
1600
1600
|
var tmp = this;
|
|
1601
|
-
tmp.
|
|
1601
|
+
tmp.z23_1 = lazy(TypeScriptIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1602
1602
|
}
|
|
1603
|
-
protoOf(TypeScriptIrEmitter).
|
|
1604
|
-
return this.
|
|
1603
|
+
protoOf(TypeScriptIrEmitter).y1y = function () {
|
|
1604
|
+
return this.x23_1;
|
|
1605
1605
|
};
|
|
1606
|
-
protoOf(TypeScriptIrEmitter).
|
|
1607
|
-
return this.
|
|
1606
|
+
protoOf(TypeScriptIrEmitter).cu = function () {
|
|
1607
|
+
return this.y23_1;
|
|
1608
1608
|
};
|
|
1609
|
-
protoOf(TypeScriptIrEmitter).
|
|
1610
|
-
var packageName = Companion_instance.
|
|
1609
|
+
protoOf(TypeScriptIrEmitter).b1z = function () {
|
|
1610
|
+
var packageName = Companion_instance.jv('community.flock.wirespec');
|
|
1611
1611
|
var api = 'export type Client<REQ extends Request<unknown>, RES extends Response<unknown>> = (serialization: Serialization) => {\n to: (request: REQ) => RawRequest;\n from: (response: RawResponse) => RES\n}\nexport type Server<REQ extends Request<unknown>, RES extends Response<unknown>> = (serialization: Serialization) => {\n from: (request: RawRequest) => REQ;\n to: (response: RES) => RawResponse\n}\nexport type Api<REQ extends Request<unknown>, RES extends Response<unknown>> = {\n name: string;\n method: Method,\n path: string,\n client: Client<REQ, RES>;\n server: Server<REQ, RES>\n}';
|
|
1612
1612
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1613
1613
|
var this_0 = convert(packageName);
|
|
@@ -1616,41 +1616,41 @@ protoOf(TypeScriptIrEmitter).t1z = function () {
|
|
|
1616
1616
|
var tmp = scope;
|
|
1617
1617
|
// Inline function 'community.flock.wirespec.ir.core.injectBefore' call
|
|
1618
1618
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1619
|
-
var this_1 = scope.
|
|
1619
|
+
var this_1 = scope.l1y_1;
|
|
1620
1620
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1621
1621
|
// Inline function 'kotlin.apply' call
|
|
1622
1622
|
var this_2 = new TransformerBuilder();
|
|
1623
|
-
this_2.
|
|
1624
|
-
var tmp$ret$2 = this_2.
|
|
1625
|
-
tmp.
|
|
1623
|
+
this_2.d1m(TypeScriptIrEmitter$emitShared$lambda);
|
|
1624
|
+
var tmp$ret$2 = this_2.e1m();
|
|
1625
|
+
tmp.l1y_1 = transform(this_1, tmp$ret$2);
|
|
1626
1626
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1627
1627
|
var tmp_0 = scope;
|
|
1628
1628
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1629
1629
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1630
|
-
var this_3 = scope.
|
|
1630
|
+
var this_3 = scope.l1y_1;
|
|
1631
1631
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1632
1632
|
// Inline function 'kotlin.apply' call
|
|
1633
1633
|
var this_4 = new TransformerBuilder();
|
|
1634
|
-
this_4.
|
|
1635
|
-
var tmp$ret$8 = this_4.
|
|
1636
|
-
tmp_0.
|
|
1634
|
+
this_4.d1m(TypeScriptIrEmitter$emitShared$lambda_0(api));
|
|
1635
|
+
var tmp$ret$8 = this_4.e1m();
|
|
1636
|
+
tmp_0.l1y_1 = transform(this_3, tmp$ret$8);
|
|
1637
1637
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1638
1638
|
var tmp_1 = scope;
|
|
1639
1639
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1640
|
-
var this_5 = scope.
|
|
1640
|
+
var this_5 = scope.l1y_1;
|
|
1641
1641
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1642
1642
|
// Inline function 'kotlin.apply' call
|
|
1643
1643
|
var this_6 = new TransformerBuilder();
|
|
1644
|
-
this_6.
|
|
1645
|
-
var tmp$ret$14 = this_6.
|
|
1646
|
-
tmp_1.
|
|
1647
|
-
var tmp_2 = scope.
|
|
1644
|
+
this_6.d1m(TypeScriptIrEmitter$emitShared$lambda_1);
|
|
1645
|
+
var tmp$ret$14 = this_6.e1m();
|
|
1646
|
+
tmp_1.l1y_1 = transform(this_5, tmp$ret$14);
|
|
1647
|
+
var tmp_2 = scope.l1y_1;
|
|
1648
1648
|
return isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1649
1649
|
};
|
|
1650
|
-
protoOf(TypeScriptIrEmitter).
|
|
1650
|
+
protoOf(TypeScriptIrEmitter).mr = function (ast, logger) {
|
|
1651
1651
|
var tmp = emit.call(this, ast, logger);
|
|
1652
1652
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
1653
|
-
var this_0 = ast.
|
|
1653
|
+
var this_0 = ast.zt_1;
|
|
1654
1654
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1655
1655
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
1656
1656
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -1658,7 +1658,7 @@ protoOf(TypeScriptIrEmitter).es = function (ast, logger) {
|
|
|
1658
1658
|
var _iterator__ex2g4s = tmp0.t();
|
|
1659
1659
|
while (_iterator__ex2g4s.u()) {
|
|
1660
1660
|
var element = _iterator__ex2g4s.v();
|
|
1661
|
-
var list = new NonEmptyList(element.
|
|
1661
|
+
var list = new NonEmptyList(element.bu_1);
|
|
1662
1662
|
addAll(destination, list);
|
|
1663
1663
|
}
|
|
1664
1664
|
var tmp$ret$3 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -1671,11 +1671,11 @@ protoOf(TypeScriptIrEmitter).es = function (ast, logger) {
|
|
|
1671
1671
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
1672
1672
|
var key = namespace(element_0);
|
|
1673
1673
|
// Inline function 'kotlin.collections.getOrPut' call
|
|
1674
|
-
var value = destination_0.
|
|
1674
|
+
var value = destination_0.q2(key);
|
|
1675
1675
|
var tmp_0;
|
|
1676
1676
|
if (value == null) {
|
|
1677
1677
|
var answer = ArrayList_init_$Create$();
|
|
1678
|
-
destination_0.
|
|
1678
|
+
destination_0.y2(key, answer);
|
|
1679
1679
|
tmp_0 = answer;
|
|
1680
1680
|
} else {
|
|
1681
1681
|
tmp_0 = value;
|
|
@@ -1685,27 +1685,27 @@ protoOf(TypeScriptIrEmitter).es = function (ast, logger) {
|
|
|
1685
1685
|
}
|
|
1686
1686
|
// Inline function 'kotlin.collections.map' call
|
|
1687
1687
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1688
|
-
var destination_1 = ArrayList_init_$Create$_0(destination_0.
|
|
1688
|
+
var destination_1 = ArrayList_init_$Create$_0(destination_0.a1());
|
|
1689
1689
|
// Inline function 'kotlin.collections.iterator' call
|
|
1690
|
-
var _iterator__ex2g4s_1 = destination_0.
|
|
1690
|
+
var _iterator__ex2g4s_1 = destination_0.k1().t();
|
|
1691
1691
|
while (_iterator__ex2g4s_1.u()) {
|
|
1692
1692
|
var item = _iterator__ex2g4s_1.v();
|
|
1693
1693
|
// Inline function 'kotlin.collections.component1' call
|
|
1694
|
-
var ns = item.
|
|
1694
|
+
var ns = item.l1();
|
|
1695
1695
|
// Inline function 'kotlin.collections.component2' call
|
|
1696
|
-
var defs = item.
|
|
1697
|
-
var tmp_1 = ns + '/index.' + this.
|
|
1696
|
+
var defs = item.m1();
|
|
1697
|
+
var tmp_1 = ns + '/index.' + this.cu().lu_1;
|
|
1698
1698
|
var tmp$ret$12 = new Emitted(tmp_1, joinToString(defs, '\n', VOID, VOID, VOID, VOID, TypeScriptIrEmitter$emit$lambda));
|
|
1699
1699
|
destination_1.x(tmp$ret$12);
|
|
1700
1700
|
}
|
|
1701
1701
|
return NonEmptyList__plus_impl_xqmb9_0(tmp, destination_1);
|
|
1702
1702
|
};
|
|
1703
|
-
protoOf(TypeScriptIrEmitter).
|
|
1703
|
+
protoOf(TypeScriptIrEmitter).su = function (definition, module_0, logger) {
|
|
1704
1704
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1705
|
-
var subPackageName = plus(Companion_instance.
|
|
1706
|
-
return new File(Companion_getInstance().
|
|
1705
|
+
var subPackageName = plus(Companion_instance.jv(''), definition);
|
|
1706
|
+
return new File(Companion_getInstance().u1k(subPackageName.mv() + sanitizeSymbol_1(this, file.a1r_1.b1q())), plus_1(listOf_0(import_0('../Wirespec', 'Wirespec')), file.b1r_1));
|
|
1707
1707
|
};
|
|
1708
|
-
protoOf(TypeScriptIrEmitter).
|
|
1708
|
+
protoOf(TypeScriptIrEmitter).f1z = function (definition, module_0) {
|
|
1709
1709
|
var tmp;
|
|
1710
1710
|
if (definition instanceof Type) {
|
|
1711
1711
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1714,16 +1714,16 @@ protoOf(TypeScriptIrEmitter).x1z = function (definition, module_0) {
|
|
|
1714
1714
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1715
1715
|
var this_0 = convertToGenerator_1(definition);
|
|
1716
1716
|
var scope = new TransformScope(this_0);
|
|
1717
|
-
scope.
|
|
1718
|
-
var tmp_0 = scope.
|
|
1717
|
+
scope.t1y(TypeScriptIrEmitter$emitGenerator$lambda(definition));
|
|
1718
|
+
var tmp_0 = scope.l1y_1;
|
|
1719
1719
|
tmp = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1720
1720
|
} else {
|
|
1721
1721
|
if (definition instanceof Refined) {
|
|
1722
1722
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1723
1723
|
var this_1 = convertToGenerator_0(definition);
|
|
1724
1724
|
var scope_0 = new TransformScope(this_1);
|
|
1725
|
-
scope_0.
|
|
1726
|
-
var tmp_1 = scope_0.
|
|
1725
|
+
scope_0.t1y(TypeScriptIrEmitter$emitGenerator$lambda_0(definition));
|
|
1726
|
+
var tmp_1 = scope_0.l1y_1;
|
|
1727
1727
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1728
1728
|
} else {
|
|
1729
1729
|
if (definition instanceof Union) {
|
|
@@ -1737,10 +1737,10 @@ protoOf(TypeScriptIrEmitter).x1z = function (definition, module_0) {
|
|
|
1737
1737
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1738
1738
|
var this_2 = sanitizeNames(tmp, _get_sanitizationConfig__sns434(this));
|
|
1739
1739
|
var scope_1 = new TransformScope(this_2);
|
|
1740
|
-
scope_1.
|
|
1741
|
-
var tmp_2 = scope_1.
|
|
1740
|
+
scope_1.t1y(TypeScriptIrEmitter$emitGenerator$lambda_1);
|
|
1741
|
+
var tmp_2 = scope_1.l1y_1;
|
|
1742
1742
|
var generatorFile = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1743
|
-
var generatorOwnName = definition.
|
|
1743
|
+
var generatorOwnName = definition.tu().m1() + 'Generator';
|
|
1744
1744
|
var tmp_3 = asSequence(collectCustomTypeNames(generatorFile));
|
|
1745
1745
|
var tmp_4 = filterNot(tmp_3, TypeScriptIrEmitter$emitGenerator$lambda_2);
|
|
1746
1746
|
var tmp_5 = filterNot(tmp_4, TypeScriptIrEmitter$emitGenerator$lambda_3(generatorOwnName));
|
|
@@ -1749,8 +1749,8 @@ protoOf(TypeScriptIrEmitter).x1z = function (definition, module_0) {
|
|
|
1749
1749
|
var generatorRefs = LinkedHashSet_init_$Create$();
|
|
1750
1750
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1751
1751
|
var scope_2 = new TransformScope(generatorFile);
|
|
1752
|
-
scope_2.
|
|
1753
|
-
var tmp_6 = scope_2.
|
|
1752
|
+
scope_2.t1y(TypeScriptIrEmitter$emitGenerator$lambda_5(generatorOwnName, generatorRefs));
|
|
1753
|
+
var tmp_6 = scope_2.l1y_1;
|
|
1754
1754
|
isInterface(tmp_6, Element) || THROW_CCE();
|
|
1755
1755
|
// Inline function 'kotlin.collections.filter' call
|
|
1756
1756
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -1793,10 +1793,10 @@ protoOf(TypeScriptIrEmitter).x1z = function (definition, module_0) {
|
|
|
1793
1793
|
destination_2.x(tmp$ret$18);
|
|
1794
1794
|
}
|
|
1795
1795
|
var modelImports = destination_2;
|
|
1796
|
-
var subPackageName = plus_0(Companion_instance.
|
|
1797
|
-
return new File(Companion_getInstance().
|
|
1796
|
+
var subPackageName = plus_0(Companion_instance.jv(''), 'generator');
|
|
1797
|
+
return new File(Companion_getInstance().u1k(subPackageName.mv() + sanitizeSymbol_1(this, generatorFile.a1r_1.b1q())), plus_1(plus_1(plus_1(listOf_0(import_0('../Wirespec', 'Wirespec')), modelImports), generatorImports), generatorFile.b1r_1));
|
|
1798
1798
|
};
|
|
1799
|
-
protoOf(TypeScriptIrEmitter).
|
|
1799
|
+
protoOf(TypeScriptIrEmitter).st = function (type, module_0) {
|
|
1800
1800
|
var fieldValidations = classifyValidatableFields(type, module_0);
|
|
1801
1801
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1802
1802
|
var this_0 = importReferences(type);
|
|
@@ -1805,7 +1805,7 @@ protoOf(TypeScriptIrEmitter).ku = function (type, module_0) {
|
|
|
1805
1805
|
var _iterator__ex2g4s = this_0.t();
|
|
1806
1806
|
while (_iterator__ex2g4s.u()) {
|
|
1807
1807
|
var e = _iterator__ex2g4s.v();
|
|
1808
|
-
var key = e.
|
|
1808
|
+
var key = e.iy_1;
|
|
1809
1809
|
if (set.x(key)) {
|
|
1810
1810
|
list.x(e);
|
|
1811
1811
|
}
|
|
@@ -1816,7 +1816,7 @@ protoOf(TypeScriptIrEmitter).ku = function (type, module_0) {
|
|
|
1816
1816
|
var _iterator__ex2g4s_0 = list.t();
|
|
1817
1817
|
while (_iterator__ex2g4s_0.u()) {
|
|
1818
1818
|
var item = _iterator__ex2g4s_0.v();
|
|
1819
|
-
var tmp$ret$2 = import_0('./' + item.
|
|
1819
|
+
var tmp$ret$2 = import_0('./' + item.iy_1, item.iy_1);
|
|
1820
1820
|
destination.x(tmp$ret$2);
|
|
1821
1821
|
}
|
|
1822
1822
|
var typeImports = destination;
|
|
@@ -1826,7 +1826,7 @@ protoOf(TypeScriptIrEmitter).ku = function (type, module_0) {
|
|
|
1826
1826
|
var _iterator__ex2g4s_1 = fieldValidations.t();
|
|
1827
1827
|
while (_iterator__ex2g4s_1.u()) {
|
|
1828
1828
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
1829
|
-
var tmp$ret$5 = item_0.
|
|
1829
|
+
var tmp$ret$5 = item_0.j1m_1;
|
|
1830
1830
|
destination_0.x(tmp$ret$5);
|
|
1831
1831
|
}
|
|
1832
1832
|
// Inline function 'kotlin.collections.filter' call
|
|
@@ -1836,7 +1836,7 @@ protoOf(TypeScriptIrEmitter).ku = function (type, module_0) {
|
|
|
1836
1836
|
var _iterator__ex2g4s_2 = tmp0.t();
|
|
1837
1837
|
while (_iterator__ex2g4s_2.u()) {
|
|
1838
1838
|
var element = _iterator__ex2g4s_2.v();
|
|
1839
|
-
if (!(element === type.
|
|
1839
|
+
if (!(element === type.ts_1.m1())) {
|
|
1840
1840
|
destination_1.x(element);
|
|
1841
1841
|
}
|
|
1842
1842
|
}
|
|
@@ -1852,30 +1852,30 @@ protoOf(TypeScriptIrEmitter).ku = function (type, module_0) {
|
|
|
1852
1852
|
var validateImports = destination_2;
|
|
1853
1853
|
var allImports = plus_1(typeImports, validateImports);
|
|
1854
1854
|
// Inline function 'kotlin.collections.map' call
|
|
1855
|
-
var this_1 = type.
|
|
1855
|
+
var this_1 = type.us_1.qs_1;
|
|
1856
1856
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1857
1857
|
var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1858
1858
|
var _iterator__ex2g4s_4 = this_1.t();
|
|
1859
1859
|
while (_iterator__ex2g4s_4.u()) {
|
|
1860
1860
|
var item_2 = _iterator__ex2g4s_4.v();
|
|
1861
|
-
var tmp$ret$14 = item_2.
|
|
1861
|
+
var tmp$ret$14 = item_2.ys_1.m1();
|
|
1862
1862
|
destination_3.x(tmp$ret$14);
|
|
1863
1863
|
}
|
|
1864
1864
|
var fieldNames = toSet(destination_3);
|
|
1865
|
-
var file = renameValidateAndBindObjReceiver(sanitizeNames(convertWithValidation(type, module_0), _get_sanitizationConfig__sns434(this)), type.
|
|
1865
|
+
var file = renameValidateAndBindObjReceiver(sanitizeNames(convertWithValidation(type, module_0), _get_sanitizationConfig__sns434(this)), type.ts_1.m1(), fieldNames);
|
|
1866
1866
|
var tmp;
|
|
1867
1867
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1868
1868
|
if (!allImports.r()) {
|
|
1869
|
-
tmp = file.
|
|
1869
|
+
tmp = file.e1r(VOID, plus_1(allImports, file.b1r_1));
|
|
1870
1870
|
} else {
|
|
1871
1871
|
tmp = file;
|
|
1872
1872
|
}
|
|
1873
1873
|
return tmp;
|
|
1874
1874
|
};
|
|
1875
|
-
protoOf(TypeScriptIrEmitter).
|
|
1875
|
+
protoOf(TypeScriptIrEmitter).gv = function (enum_0, module_0) {
|
|
1876
1876
|
return sanitizeNames(convert_0(enum_0), _get_sanitizationConfig__sns434(this));
|
|
1877
1877
|
};
|
|
1878
|
-
protoOf(TypeScriptIrEmitter).
|
|
1878
|
+
protoOf(TypeScriptIrEmitter).wu = function (union) {
|
|
1879
1879
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1880
1880
|
var this_0 = importReferences(union);
|
|
1881
1881
|
var set = HashSet_init_$Create$();
|
|
@@ -1883,7 +1883,7 @@ protoOf(TypeScriptIrEmitter).ov = function (union) {
|
|
|
1883
1883
|
var _iterator__ex2g4s = this_0.t();
|
|
1884
1884
|
while (_iterator__ex2g4s.u()) {
|
|
1885
1885
|
var e = _iterator__ex2g4s.v();
|
|
1886
|
-
var key = e.
|
|
1886
|
+
var key = e.iy_1;
|
|
1887
1887
|
if (set.x(key)) {
|
|
1888
1888
|
list.x(e);
|
|
1889
1889
|
}
|
|
@@ -1894,7 +1894,7 @@ protoOf(TypeScriptIrEmitter).ov = function (union) {
|
|
|
1894
1894
|
var _iterator__ex2g4s_0 = list.t();
|
|
1895
1895
|
while (_iterator__ex2g4s_0.u()) {
|
|
1896
1896
|
var item = _iterator__ex2g4s_0.v();
|
|
1897
|
-
var tmp$ret$2 = import_0('../model', item.
|
|
1897
|
+
var tmp$ret$2 = import_0('../model', item.iy_1, true);
|
|
1898
1898
|
destination.x(tmp$ret$2);
|
|
1899
1899
|
}
|
|
1900
1900
|
var imports = destination;
|
|
@@ -1902,19 +1902,19 @@ protoOf(TypeScriptIrEmitter).ov = function (union) {
|
|
|
1902
1902
|
var tmp;
|
|
1903
1903
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1904
1904
|
if (!imports.r()) {
|
|
1905
|
-
tmp = file.
|
|
1905
|
+
tmp = file.e1r(VOID, plus_1(imports, file.b1r_1));
|
|
1906
1906
|
} else {
|
|
1907
1907
|
tmp = file;
|
|
1908
1908
|
}
|
|
1909
1909
|
return tmp;
|
|
1910
1910
|
};
|
|
1911
|
-
protoOf(TypeScriptIrEmitter).
|
|
1911
|
+
protoOf(TypeScriptIrEmitter).bv = function (refined) {
|
|
1912
1912
|
var converted = convert_2(refined);
|
|
1913
|
-
var constraintExpr = convertConstraint(refined.
|
|
1914
|
-
var validatorStr = TypeScriptGenerator_getInstance().
|
|
1915
|
-
return new File(converted.
|
|
1913
|
+
var constraintExpr = convertConstraint(refined.av_1, new VariableReference(Companion_getInstance().u1k('value')));
|
|
1914
|
+
var validatorStr = TypeScriptGenerator_getInstance().n1z(constraintExpr);
|
|
1915
|
+
return new File(converted.a1r_1, listOf([new RawElement('export type ' + converted.a1r_1.b1q() + ' = ' + emitTypeScriptReference(this, refined.av_1) + ';'), new RawElement('export const validate' + refined.zu_1.m1() + ' = (value: ' + emitTypeScriptReference(this, refined.av_1) + ') =>\n ' + validatorStr + ';')]));
|
|
1916
1916
|
};
|
|
1917
|
-
protoOf(TypeScriptIrEmitter).
|
|
1917
|
+
protoOf(TypeScriptIrEmitter).hv = function (endpoint) {
|
|
1918
1918
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1919
1919
|
var this_0 = importReferences(endpoint);
|
|
1920
1920
|
var set = HashSet_init_$Create$();
|
|
@@ -1922,7 +1922,7 @@ protoOf(TypeScriptIrEmitter).zv = function (endpoint) {
|
|
|
1922
1922
|
var _iterator__ex2g4s = this_0.t();
|
|
1923
1923
|
while (_iterator__ex2g4s.u()) {
|
|
1924
1924
|
var e = _iterator__ex2g4s.v();
|
|
1925
|
-
var key = e.
|
|
1925
|
+
var key = e.iy_1;
|
|
1926
1926
|
if (set.x(key)) {
|
|
1927
1927
|
list.x(e);
|
|
1928
1928
|
}
|
|
@@ -1933,7 +1933,7 @@ protoOf(TypeScriptIrEmitter).zv = function (endpoint) {
|
|
|
1933
1933
|
var _iterator__ex2g4s_0 = list.t();
|
|
1934
1934
|
while (_iterator__ex2g4s_0.u()) {
|
|
1935
1935
|
var item = _iterator__ex2g4s_0.v();
|
|
1936
|
-
var tmp$ret$2 = import_0('../model', item.
|
|
1936
|
+
var tmp$ret$2 = import_0('../model', item.iy_1, true);
|
|
1937
1937
|
destination.x(tmp$ret$2);
|
|
1938
1938
|
}
|
|
1939
1939
|
var imports = destination;
|
|
@@ -1942,25 +1942,25 @@ protoOf(TypeScriptIrEmitter).zv = function (endpoint) {
|
|
|
1942
1942
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1943
1943
|
var this_1 = stripTrailingSpaceFromErrorMessage(convert_3(endpoint));
|
|
1944
1944
|
var scope = new TransformScope(this_1);
|
|
1945
|
-
scope.
|
|
1946
|
-
var tmp = scope.
|
|
1945
|
+
scope.q1y(transformPatternSwitchToValueSwitch());
|
|
1946
|
+
var tmp = scope.l1y_1;
|
|
1947
1947
|
var tmp$ret$7 = isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1948
1948
|
// Inline function 'kotlin.let' call
|
|
1949
|
-
var it = sanitizeNames(emit$injectApiConst(emit$applyCallParamsIfNeeded(tmp$ret$7, hasRequestParams), endpoint).
|
|
1949
|
+
var it = sanitizeNames(emit$injectApiConst(emit$applyCallParamsIfNeeded(tmp$ret$7, hasRequestParams), endpoint).e1r(Companion_getInstance().u1k(sanitize(this, endpoint.ct_1))), _get_sanitizationConfig__sns434(this));
|
|
1950
1950
|
var tmp_0;
|
|
1951
1951
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1952
1952
|
if (!imports.r()) {
|
|
1953
|
-
tmp_0 = it.
|
|
1953
|
+
tmp_0 = it.e1r(VOID, plus_1(imports, it.b1r_1));
|
|
1954
1954
|
} else {
|
|
1955
1955
|
tmp_0 = it;
|
|
1956
1956
|
}
|
|
1957
1957
|
return tmp_0;
|
|
1958
1958
|
};
|
|
1959
|
-
protoOf(TypeScriptIrEmitter).
|
|
1959
|
+
protoOf(TypeScriptIrEmitter).vu = function (channel) {
|
|
1960
1960
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1961
1961
|
};
|
|
1962
|
-
protoOf(TypeScriptIrEmitter).
|
|
1963
|
-
var endpointName = endpoint.
|
|
1962
|
+
protoOf(TypeScriptIrEmitter).e1z = function (endpoint) {
|
|
1963
|
+
var endpointName = endpoint.ct_1.m1();
|
|
1964
1964
|
var methodName = firstToLower(this, endpointName);
|
|
1965
1965
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1966
1966
|
var this_0 = importReferences(endpoint);
|
|
@@ -1969,7 +1969,7 @@ protoOf(TypeScriptIrEmitter).w1z = function (endpoint) {
|
|
|
1969
1969
|
var _iterator__ex2g4s = this_0.t();
|
|
1970
1970
|
while (_iterator__ex2g4s.u()) {
|
|
1971
1971
|
var e = _iterator__ex2g4s.v();
|
|
1972
|
-
var key = e.
|
|
1972
|
+
var key = e.iy_1;
|
|
1973
1973
|
if (set.x(key)) {
|
|
1974
1974
|
list.x(e);
|
|
1975
1975
|
}
|
|
@@ -1980,7 +1980,7 @@ protoOf(TypeScriptIrEmitter).w1z = function (endpoint) {
|
|
|
1980
1980
|
var _iterator__ex2g4s_0 = list.t();
|
|
1981
1981
|
while (_iterator__ex2g4s_0.u()) {
|
|
1982
1982
|
var item = _iterator__ex2g4s_0.v();
|
|
1983
|
-
var tmp$ret$2 = import_0('../model', item.
|
|
1983
|
+
var tmp$ret$2 = import_0('../model', item.iy_1, true);
|
|
1984
1984
|
destination.x(tmp$ret$2);
|
|
1985
1985
|
}
|
|
1986
1986
|
var imports = destination;
|
|
@@ -2002,50 +2002,50 @@ protoOf(TypeScriptIrEmitter).w1z = function (endpoint) {
|
|
|
2002
2002
|
}
|
|
2003
2003
|
var requestArgs = tmp_0;
|
|
2004
2004
|
var code = trimMargin('\n |export const ' + methodName + 'Client = (serialization: Wirespec.Serialization, transportation: Wirespec.Transportation) => ({\n | ' + methodName + ': async (' + paramList + '): Promise<' + endpointName + '.Response<unknown>> => {\n | const request: ' + endpointName + '.Request = ' + requestArgs + ';\n | const rawRequest = ' + endpointName + '.toRawRequest(serialization, request);\n | const rawResponse = await transportation.transport(rawRequest);\n | return ' + endpointName + '.fromRawResponse(serialization, rawResponse);\n | }\n |})\n ');
|
|
2005
|
-
var tmp_1 = Companion_getInstance().
|
|
2005
|
+
var tmp_1 = Companion_getInstance().u1k('client/' + endpointName + 'Client');
|
|
2006
2006
|
// Inline function 'kotlin.collections.buildList' call
|
|
2007
2007
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
2008
2008
|
// Inline function 'kotlin.apply' call
|
|
2009
2009
|
var this_1 = ArrayList_init_$Create$();
|
|
2010
2010
|
this_1.x(import_0('../Wirespec', 'Wirespec'));
|
|
2011
2011
|
this_1.x(import_0('../endpoint/' + endpointName, endpointName));
|
|
2012
|
-
this_1.
|
|
2012
|
+
this_1.e1(imports);
|
|
2013
2013
|
this_1.x(new RawElement(code));
|
|
2014
|
-
var tmp$ret$10 = this_1.
|
|
2014
|
+
var tmp$ret$10 = this_1.p5();
|
|
2015
2015
|
return new File(tmp_1, tmp$ret$10);
|
|
2016
2016
|
};
|
|
2017
|
-
protoOf(TypeScriptIrEmitter).
|
|
2018
|
-
logger.
|
|
2017
|
+
protoOf(TypeScriptIrEmitter).c1z = function (endpoints, logger) {
|
|
2018
|
+
logger.qu('Emitting main Client for ' + endpoints.a1() + ' endpoints');
|
|
2019
2019
|
// Inline function 'kotlin.collections.map' call
|
|
2020
2020
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2021
2021
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(endpoints, 10));
|
|
2022
2022
|
var _iterator__ex2g4s = endpoints.t();
|
|
2023
2023
|
while (_iterator__ex2g4s.u()) {
|
|
2024
2024
|
var item = _iterator__ex2g4s.v();
|
|
2025
|
-
var methodName = firstToLower(this, item.
|
|
2026
|
-
var tmp$ret$0 = import_0('./client/' + item.
|
|
2025
|
+
var methodName = firstToLower(this, item.ct_1.m1());
|
|
2026
|
+
var tmp$ret$0 = import_0('./client/' + item.ct_1.m1() + 'Client', methodName + 'Client');
|
|
2027
2027
|
destination.x(tmp$ret$0);
|
|
2028
2028
|
}
|
|
2029
2029
|
var clientImports = destination;
|
|
2030
2030
|
var spreadEntries = joinToString(endpoints, '\n', VOID, VOID, VOID, VOID, TypeScriptIrEmitter$emitClient$lambda(this));
|
|
2031
2031
|
var code = trimMargin('\n |export const client = (serialization: Wirespec.Serialization, transportation: Wirespec.Transportation) => ({\n |' + spreadEntries + '\n |})\n ');
|
|
2032
|
-
var tmp = Companion_getInstance().
|
|
2032
|
+
var tmp = Companion_getInstance().u1k('Client');
|
|
2033
2033
|
// Inline function 'kotlin.collections.buildList' call
|
|
2034
2034
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
2035
2035
|
// Inline function 'kotlin.apply' call
|
|
2036
2036
|
var this_0 = ArrayList_init_$Create$();
|
|
2037
2037
|
this_0.x(import_0('./Wirespec', 'Wirespec'));
|
|
2038
|
-
this_0.
|
|
2038
|
+
this_0.e1(clientImports);
|
|
2039
2039
|
this_0.x(new RawElement(code));
|
|
2040
|
-
var tmp$ret$6 = this_0.
|
|
2040
|
+
var tmp$ret$6 = this_0.p5();
|
|
2041
2041
|
return new File(tmp, tmp$ret$6);
|
|
2042
2042
|
};
|
|
2043
2043
|
function transformPatternSwitchToValueSwitch() {
|
|
2044
2044
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2045
2045
|
// Inline function 'kotlin.apply' call
|
|
2046
2046
|
var this_0 = new TransformerBuilder();
|
|
2047
|
-
this_0.
|
|
2048
|
-
return this_0.
|
|
2047
|
+
this_0.s1y(transformPatternSwitchToValueSwitch$lambda);
|
|
2048
|
+
return this_0.e1m();
|
|
2049
2049
|
}
|
|
2050
2050
|
function renameValidateAndBindObjReceiver(_this__u8e3s4, typeName, fieldNames) {
|
|
2051
2051
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -2053,19 +2053,19 @@ function renameValidateAndBindObjReceiver(_this__u8e3s4, typeName, fieldNames) {
|
|
|
2053
2053
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
2054
2054
|
var tmp = scope;
|
|
2055
2055
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
2056
|
-
var this_0 = scope.
|
|
2056
|
+
var this_0 = scope.l1y_1;
|
|
2057
2057
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2058
2058
|
// Inline function 'kotlin.apply' call
|
|
2059
2059
|
var this_1 = new TransformerBuilder();
|
|
2060
|
-
this_1.
|
|
2061
|
-
var tmp$ret$2 = this_1.
|
|
2062
|
-
tmp.
|
|
2063
|
-
var tmp_0 = scope.
|
|
2060
|
+
this_1.d1m(renameValidateAndBindObjReceiver$lambda(typeName, fieldNames));
|
|
2061
|
+
var tmp$ret$2 = this_1.e1m();
|
|
2062
|
+
tmp.l1y_1 = transform(this_0, tmp$ret$2);
|
|
2063
|
+
var tmp_0 = scope.l1y_1;
|
|
2064
2064
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2065
2065
|
}
|
|
2066
2066
|
function buildApiConst(endpoint) {
|
|
2067
2067
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
2068
|
-
var this_0 = endpoint.
|
|
2068
|
+
var this_0 = endpoint.ct_1.m1();
|
|
2069
2069
|
var tmp;
|
|
2070
2070
|
// Inline function 'kotlin.text.isNotEmpty' call
|
|
2071
2071
|
if (charSequenceLength(this_0) > 0) {
|
|
@@ -2079,8 +2079,8 @@ function buildApiConst(endpoint) {
|
|
|
2079
2079
|
tmp = this_0;
|
|
2080
2080
|
}
|
|
2081
2081
|
var apiName = tmp;
|
|
2082
|
-
var method = endpoint.
|
|
2083
|
-
var pathString = joinToString(endpoint.
|
|
2082
|
+
var method = endpoint.dt_1.b3_1;
|
|
2083
|
+
var pathString = joinToString(endpoint.et_1, '/', VOID, VOID, VOID, VOID, buildApiConst$lambda);
|
|
2084
2084
|
return raw(trimMargin('\n |export const client:Wirespec.Client<Request, Response> = (serialization: Wirespec.Serialization) => ({\n | from: (it) => fromRawResponse(serialization, it),\n | to: (it) => toRawRequest(serialization, it)\n |})\n |export const server:Wirespec.Server<Request, Response> = (serialization: Wirespec.Serialization) => ({\n | from: (it) => fromRawRequest(serialization, it),\n | to: (it) => toRawResponse(serialization, it)\n |})\n |export const api = {\n | name: "' + apiName + '",\n | method: "' + method + '",\n | path: "' + pathString + '",\n | server,\n | client\n |} as const\n '));
|
|
2085
2085
|
}
|
|
2086
2086
|
function bindCallToRequestParams(_this__u8e3s4) {
|
|
@@ -2089,21 +2089,21 @@ function bindCallToRequestParams(_this__u8e3s4) {
|
|
|
2089
2089
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
2090
2090
|
var tmp = scope;
|
|
2091
2091
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
2092
|
-
var this_0 = scope.
|
|
2092
|
+
var this_0 = scope.l1y_1;
|
|
2093
2093
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2094
2094
|
// Inline function 'kotlin.apply' call
|
|
2095
2095
|
var this_1 = new TransformerBuilder();
|
|
2096
|
-
this_1.
|
|
2097
|
-
var tmp$ret$2 = this_1.
|
|
2098
|
-
tmp.
|
|
2099
|
-
var tmp_0 = scope.
|
|
2096
|
+
this_1.d1m(bindCallToRequestParams$lambda);
|
|
2097
|
+
var tmp$ret$2 = this_1.e1m();
|
|
2098
|
+
tmp.l1y_1 = transform(this_0, tmp$ret$2);
|
|
2099
|
+
var tmp_0 = scope.l1y_1;
|
|
2100
2100
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2101
2101
|
}
|
|
2102
2102
|
function stripTrailingSpaceFromErrorMessage(_this__u8e3s4) {
|
|
2103
2103
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2104
2104
|
var scope = new TransformScope(_this__u8e3s4);
|
|
2105
|
-
scope.
|
|
2106
|
-
var tmp = scope.
|
|
2105
|
+
scope.s1y(stripTrailingSpaceFromErrorMessage$lambda);
|
|
2106
|
+
var tmp = scope.l1y_1;
|
|
2107
2107
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
2108
2108
|
}
|
|
2109
2109
|
function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
@@ -2111,7 +2111,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2111
2111
|
if (!(stmt instanceof Switch)) {
|
|
2112
2112
|
tmp = true;
|
|
2113
2113
|
} else {
|
|
2114
|
-
var tmp0 = stmt.
|
|
2114
|
+
var tmp0 = stmt.n1t_1;
|
|
2115
2115
|
var tmp$ret$0;
|
|
2116
2116
|
$l$block_0: {
|
|
2117
2117
|
// Inline function 'kotlin.collections.none' call
|
|
@@ -2128,7 +2128,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2128
2128
|
var _iterator__ex2g4s = tmp0.t();
|
|
2129
2129
|
while (_iterator__ex2g4s.u()) {
|
|
2130
2130
|
var element = _iterator__ex2g4s.v();
|
|
2131
|
-
if (!(element.
|
|
2131
|
+
if (!(element.u1t_1 == null)) {
|
|
2132
2132
|
tmp$ret$0 = false;
|
|
2133
2133
|
break $l$block_0;
|
|
2134
2134
|
}
|
|
@@ -2139,11 +2139,11 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2139
2139
|
}
|
|
2140
2140
|
if (tmp)
|
|
2141
2141
|
return transformChildren(stmt, tr);
|
|
2142
|
-
var tmp0_safe_receiver = stmt.
|
|
2143
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
2142
|
+
var tmp0_safe_receiver = stmt.p1t_1;
|
|
2143
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.v1p();
|
|
2144
2144
|
var varName = tmp1_elvis_lhs == null ? 'r' : tmp1_elvis_lhs;
|
|
2145
2145
|
// Inline function 'kotlin.collections.map' call
|
|
2146
|
-
var this_0 = stmt.
|
|
2146
|
+
var this_0 = stmt.n1t_1;
|
|
2147
2147
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2148
2148
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2149
2149
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
@@ -2151,38 +2151,38 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2151
2151
|
var item = _iterator__ex2g4s_0.v();
|
|
2152
2152
|
var tmp$ret$5;
|
|
2153
2153
|
$l$block_1: {
|
|
2154
|
-
var tmp_1 = item.
|
|
2154
|
+
var tmp_1 = item.u1t_1;
|
|
2155
2155
|
var tmp0_safe_receiver_0 = tmp_1 instanceof Custom_0 ? tmp_1 : null;
|
|
2156
|
-
var typeName = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.
|
|
2156
|
+
var typeName = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.n1m_1;
|
|
2157
2157
|
var tmp2_safe_receiver = typeName == null ? null : substringAfterLast(typeName, '.');
|
|
2158
2158
|
var tmp3_safe_receiver = tmp2_safe_receiver == null ? null : removePrefix(tmp2_safe_receiver, 'Response');
|
|
2159
2159
|
var statusNum = tmp3_safe_receiver == null ? null : toIntOrNull(tmp3_safe_receiver);
|
|
2160
2160
|
if (statusNum == null || typeName == null) {
|
|
2161
2161
|
// Inline function 'kotlin.collections.map' call
|
|
2162
|
-
var this_1 = item.
|
|
2162
|
+
var this_1 = item.t1t_1;
|
|
2163
2163
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2164
2164
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
2165
2165
|
var _iterator__ex2g4s_1 = this_1.t();
|
|
2166
2166
|
while (_iterator__ex2g4s_1.u()) {
|
|
2167
2167
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
2168
|
-
var tmp$ret$2 = tr.
|
|
2168
|
+
var tmp$ret$2 = tr.f1y(item_0);
|
|
2169
2169
|
destination_0.x(tmp$ret$2);
|
|
2170
2170
|
}
|
|
2171
|
-
tmp$ret$5 = item.
|
|
2171
|
+
tmp$ret$5 = item.w1t(VOID, destination_0);
|
|
2172
2172
|
break $l$block_1;
|
|
2173
2173
|
}
|
|
2174
|
-
var exprCode = TypeScriptGenerator_getInstance().
|
|
2175
|
-
var castAssignment = new Assignment(Companion_getInstance().
|
|
2174
|
+
var exprCode = TypeScriptGenerator_getInstance().n1z(tr.g1y(stmt.m1t_1));
|
|
2175
|
+
var castAssignment = new Assignment(Companion_getInstance().u1k(varName), new RawExpression(exprCode + ' as ' + typeName), false);
|
|
2176
2176
|
var tmp_2 = new Literal_0(statusNum, new Integer_0());
|
|
2177
2177
|
var tmp_3 = listOf_0(castAssignment);
|
|
2178
2178
|
// Inline function 'kotlin.collections.map' call
|
|
2179
|
-
var this_2 = item.
|
|
2179
|
+
var this_2 = item.t1t_1;
|
|
2180
2180
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2181
2181
|
var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
|
|
2182
2182
|
var _iterator__ex2g4s_2 = this_2.t();
|
|
2183
2183
|
while (_iterator__ex2g4s_2.u()) {
|
|
2184
2184
|
var item_1 = _iterator__ex2g4s_2.v();
|
|
2185
|
-
var tmp$ret$6 = tr.
|
|
2185
|
+
var tmp$ret$6 = tr.f1y(item_1);
|
|
2186
2186
|
destination_1.x(tmp$ret$6);
|
|
2187
2187
|
}
|
|
2188
2188
|
tmp$ret$5 = new Case(tmp_2, plus_1(tmp_3, destination_1), null);
|
|
@@ -2190,8 +2190,8 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2190
2190
|
destination.x(tmp$ret$5);
|
|
2191
2191
|
}
|
|
2192
2192
|
var transformedCases = destination;
|
|
2193
|
-
var tmp_4 = new FieldCall(tr.
|
|
2194
|
-
var tmp2_safe_receiver_0 = stmt.
|
|
2193
|
+
var tmp_4 = new FieldCall(tr.g1y(stmt.m1t_1), Companion_getInstance().u1k('status'));
|
|
2194
|
+
var tmp2_safe_receiver_0 = stmt.o1t_1;
|
|
2195
2195
|
var tmp_5;
|
|
2196
2196
|
if (tmp2_safe_receiver_0 == null) {
|
|
2197
2197
|
tmp_5 = null;
|
|
@@ -2202,7 +2202,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2202
2202
|
var _iterator__ex2g4s_3 = tmp2_safe_receiver_0.t();
|
|
2203
2203
|
while (_iterator__ex2g4s_3.u()) {
|
|
2204
2204
|
var item_2 = _iterator__ex2g4s_3.v();
|
|
2205
|
-
var tmp$ret$11 = tr.
|
|
2205
|
+
var tmp$ret$11 = tr.f1y(item_2);
|
|
2206
2206
|
destination_2.x(tmp$ret$11);
|
|
2207
2207
|
}
|
|
2208
2208
|
tmp_5 = destination_2;
|
|
@@ -2216,42 +2216,42 @@ function renameValidateAndBindObjReceiver$lambda$lambda($fieldNames) {
|
|
|
2216
2216
|
var tmp_1;
|
|
2217
2217
|
var tmp_2;
|
|
2218
2218
|
if (s instanceof FunctionCall) {
|
|
2219
|
-
tmp_2 = s.
|
|
2219
|
+
tmp_2 = s.f1q_1.equals(Companion_getInstance().u1k('validate'));
|
|
2220
2220
|
} else {
|
|
2221
2221
|
tmp_2 = false;
|
|
2222
2222
|
}
|
|
2223
2223
|
if (tmp_2) {
|
|
2224
|
-
tmp_1 = !(s.
|
|
2224
|
+
tmp_1 = !(s.d1q_1 == null);
|
|
2225
2225
|
} else {
|
|
2226
2226
|
tmp_1 = false;
|
|
2227
2227
|
}
|
|
2228
2228
|
if (tmp_1) {
|
|
2229
2229
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
2230
|
-
tmp_0 = !s.
|
|
2230
|
+
tmp_0 = !s.e1q_1.r();
|
|
2231
2231
|
} else {
|
|
2232
2232
|
tmp_0 = false;
|
|
2233
2233
|
}
|
|
2234
2234
|
if (tmp_0) {
|
|
2235
|
-
var tmp_3 = first(s.
|
|
2235
|
+
var tmp_3 = first(s.e1q_1);
|
|
2236
2236
|
var tmp0_safe_receiver = tmp_3 instanceof Custom_0 ? tmp_3 : null;
|
|
2237
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
2237
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.n1m_1;
|
|
2238
2238
|
var tn = tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
|
|
2239
|
-
tmp = new FunctionCall(VOID, VOID, Companion_getInstance().
|
|
2239
|
+
tmp = new FunctionCall(VOID, VOID, Companion_getInstance().u1k('validate' + tn), mapOf(to(Companion_getInstance().u1k('obj'), t.g1y(ensureNotNull(s.d1q_1)))));
|
|
2240
2240
|
} else {
|
|
2241
2241
|
var tmp_4;
|
|
2242
2242
|
var tmp_5;
|
|
2243
2243
|
if (s instanceof FieldCall) {
|
|
2244
|
-
tmp_5 = s.
|
|
2244
|
+
tmp_5 = s.x1t_1 == null;
|
|
2245
2245
|
} else {
|
|
2246
2246
|
tmp_5 = false;
|
|
2247
2247
|
}
|
|
2248
2248
|
if (tmp_5) {
|
|
2249
|
-
tmp_4 = $fieldNames.
|
|
2249
|
+
tmp_4 = $fieldNames.v1(s.y1t_1.v1p());
|
|
2250
2250
|
} else {
|
|
2251
2251
|
tmp_4 = false;
|
|
2252
2252
|
}
|
|
2253
2253
|
if (tmp_4) {
|
|
2254
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().
|
|
2254
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().u1k('obj')), s.y1t_1);
|
|
2255
2255
|
} else {
|
|
2256
2256
|
tmp = transformChildren(s, t);
|
|
2257
2257
|
}
|
|
@@ -2265,15 +2265,15 @@ function renameValidateAndBindObjReceiver$lambda($typeName, $fieldNames) {
|
|
|
2265
2265
|
if (element instanceof Function) {
|
|
2266
2266
|
var tmp$ret$0;
|
|
2267
2267
|
$l$block: {
|
|
2268
|
-
if (!element.
|
|
2268
|
+
if (!element.j1o_1.equals(Companion_getInstance().u1k('validate'))) {
|
|
2269
2269
|
tmp$ret$0 = element;
|
|
2270
2270
|
break $l$block;
|
|
2271
2271
|
}
|
|
2272
2272
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2273
|
-
var this_0 = element.
|
|
2273
|
+
var this_0 = element.r1o(Companion_getInstance().u1k('validate' + $typeName), VOID, listOf_0(new Parameter(Companion_getInstance().u1k('obj'), new Custom_0($typeName))));
|
|
2274
2274
|
var scope = new TransformScope(this_0);
|
|
2275
|
-
scope.
|
|
2276
|
-
var tmp_0 = scope.
|
|
2275
|
+
scope.u1y(renameValidateAndBindObjReceiver$lambda$lambda($fieldNames));
|
|
2276
|
+
var tmp_0 = scope.l1y_1;
|
|
2277
2277
|
tmp$ret$0 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2278
2278
|
}
|
|
2279
2279
|
tmp = tmp$ret$0;
|
|
@@ -2287,10 +2287,10 @@ function renameValidateAndBindObjReceiver$lambda($typeName, $fieldNames) {
|
|
|
2287
2287
|
function buildApiConst$lambda(it) {
|
|
2288
2288
|
var tmp;
|
|
2289
2289
|
if (it instanceof Literal) {
|
|
2290
|
-
tmp = it.
|
|
2290
|
+
tmp = it.fu_1;
|
|
2291
2291
|
} else {
|
|
2292
2292
|
if (it instanceof Param) {
|
|
2293
|
-
tmp = '{' + it.
|
|
2293
|
+
tmp = '{' + it.jt_1.m1() + '}';
|
|
2294
2294
|
} else {
|
|
2295
2295
|
noWhenBranchMatchedException();
|
|
2296
2296
|
}
|
|
@@ -2302,23 +2302,23 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
2302
2302
|
if (element instanceof Interface) {
|
|
2303
2303
|
var tmp$ret$0;
|
|
2304
2304
|
$l$block: {
|
|
2305
|
-
if (!element.
|
|
2305
|
+
if (!element.t1r_1.equals(Companion_getInstance().u1k('Call'))) {
|
|
2306
2306
|
tmp$ret$0 = element;
|
|
2307
2307
|
break $l$block;
|
|
2308
2308
|
}
|
|
2309
2309
|
// Inline function 'kotlin.collections.map' call
|
|
2310
|
-
var this_0 = element.
|
|
2310
|
+
var this_0 = element.u1r_1;
|
|
2311
2311
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2312
2312
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2313
2313
|
var _iterator__ex2g4s = this_0.t();
|
|
2314
2314
|
while (_iterator__ex2g4s.u()) {
|
|
2315
2315
|
var item = _iterator__ex2g4s.v();
|
|
2316
2316
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
2317
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
2317
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.r1o(VOID, VOID, listOf_0(new Parameter(Companion_getInstance().u1k('params'), new Custom_0('RequestParams'))));
|
|
2318
2318
|
var tmp$ret$1 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
2319
2319
|
destination.x(tmp$ret$1);
|
|
2320
2320
|
}
|
|
2321
|
-
tmp$ret$0 = element.
|
|
2321
|
+
tmp$ret$0 = element.a1s(VOID, destination);
|
|
2322
2322
|
}
|
|
2323
2323
|
tmp = tmp$ret$0;
|
|
2324
2324
|
} else {
|
|
@@ -2330,7 +2330,7 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
2330
2330
|
function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
2331
2331
|
var tmp;
|
|
2332
2332
|
if (stmt instanceof Switch) {
|
|
2333
|
-
var tmp1_safe_receiver = stmt.
|
|
2333
|
+
var tmp1_safe_receiver = stmt.o1t_1;
|
|
2334
2334
|
var tmp_0;
|
|
2335
2335
|
if (tmp1_safe_receiver == null) {
|
|
2336
2336
|
tmp_0 = null;
|
|
@@ -2352,7 +2352,7 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2352
2352
|
tmp_1 = tmp0_elvis_lhs;
|
|
2353
2353
|
}
|
|
2354
2354
|
var errorStmt = tmp_1;
|
|
2355
|
-
var tmp_2 = errorStmt.
|
|
2355
|
+
var tmp_2 = errorStmt.b1u_1;
|
|
2356
2356
|
var tmp1_elvis_lhs = tmp_2 instanceof BinaryOp ? tmp_2 : null;
|
|
2357
2357
|
var tmp_3;
|
|
2358
2358
|
if (tmp1_elvis_lhs == null) {
|
|
@@ -2362,7 +2362,7 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2362
2362
|
tmp_3 = tmp1_elvis_lhs;
|
|
2363
2363
|
}
|
|
2364
2364
|
var binary = tmp_3;
|
|
2365
|
-
var tmp_4 = binary.
|
|
2365
|
+
var tmp_4 = binary.c1u_1;
|
|
2366
2366
|
var tmp2_elvis_lhs = tmp_4 instanceof Literal_0 ? tmp_4 : null;
|
|
2367
2367
|
var tmp_5;
|
|
2368
2368
|
if (tmp2_elvis_lhs == null) {
|
|
@@ -2372,13 +2372,13 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2372
2372
|
tmp_5 = tmp2_elvis_lhs;
|
|
2373
2373
|
}
|
|
2374
2374
|
var literal = tmp_5;
|
|
2375
|
-
tmp$ret$0 = new ErrorStatement(new Literal_0(trimEnd(toString(literal.
|
|
2375
|
+
tmp$ret$0 = new ErrorStatement(new Literal_0(trimEnd(toString(literal.z1s_1), charArrayOf([_Char___init__impl__6a9atx(32)])), literal.a1t_1));
|
|
2376
2376
|
}
|
|
2377
2377
|
destination.x(tmp$ret$0);
|
|
2378
2378
|
}
|
|
2379
2379
|
tmp_0 = destination;
|
|
2380
2380
|
}
|
|
2381
|
-
tmp = transformChildren(stmt.
|
|
2381
|
+
tmp = transformChildren(stmt.r1t(VOID, VOID, tmp_0), transformer);
|
|
2382
2382
|
} else {
|
|
2383
2383
|
tmp = transformChildren(stmt, transformer);
|
|
2384
2384
|
}
|
|
@@ -2388,8 +2388,8 @@ function TypeScriptRefinedTypeDefinitionEmitter() {
|
|
|
2388
2388
|
}
|
|
2389
2389
|
function TypeScriptShared() {
|
|
2390
2390
|
TypeScriptShared_instance = this;
|
|
2391
|
-
this.
|
|
2392
|
-
this.
|
|
2391
|
+
this.v23_1 = 'community.flock.wirespec';
|
|
2392
|
+
this.w23_1 = trimMargin('\n |export namespace Wirespec {\n |' + Spacer_instance.toString() + 'export type Method = "GET" | "PUT" | "POST" | "DELETE" | "OPTIONS" | "HEAD" | "PATCH" | "TRACE"\n |' + Spacer_instance.toString() + 'export type RawRequest = { method: Method, path: string[], queries: Record<string, string>, headers: Record<string, string>, body?: string }\n |' + Spacer_instance.toString() + 'export type RawResponse = { status: number, headers: Record<string, string>, body?: string }\n |' + Spacer_instance.toString() + 'export type Request<T> = { path: Record<string, unknown>, method: Method, queries?: Record<string, unknown>, headers?: Record<string, unknown>, body?:T }\n |' + Spacer_instance.toString() + 'export type Response<T> = { status:number, headers?: Record<string, unknown>, body?:T }\n |' + Spacer_instance.toString() + 'export type Serialization = { serialize: <T>(type: T) => string; deserialize: <T>(raw: string | undefined) => T }\n |' + Spacer_instance.toString() + 'export type Client<REQ extends Request<unknown>, RES extends Response<unknown>> = (serialization: Serialization) => { to: (request: REQ) => RawRequest; from: (response: RawResponse) => RES }\n |' + Spacer_instance.toString() + 'export type Server<REQ extends Request<unknown>, RES extends Response<unknown>> = (serialization: Serialization) => { from: (request: RawRequest) => REQ; to: (response: RES) => RawResponse }\n |' + Spacer_instance.toString() + 'export type Api<REQ extends Request<unknown>, RES extends Response<unknown>> = { name: string; method: Method, path: string, client: Client<REQ, RES>; server: Server<REQ, RES> }\n |}\n ');
|
|
2393
2393
|
}
|
|
2394
2394
|
protoOf(TypeScriptShared).toString = function () {
|
|
2395
2395
|
return 'TypeScriptShared';
|
|
@@ -2411,7 +2411,7 @@ function TypeScriptShared_getInstance() {
|
|
|
2411
2411
|
return TypeScriptShared_instance;
|
|
2412
2412
|
}
|
|
2413
2413
|
function TypeScriptTypeDefinitionEmitter$sanitizeSymbol$lambda(it) {
|
|
2414
|
-
return isLetterOrDigit(it.
|
|
2414
|
+
return isLetterOrDigit(it.h1_1) || listOf_0(new Char(_Char___init__impl__6a9atx(95))).v1(it);
|
|
2415
2415
|
}
|
|
2416
2416
|
function TypeScriptTypeDefinitionEmitter$emit$lambda(it) {
|
|
2417
2417
|
// Inline function 'kotlin.text.trimStart' call
|
|
@@ -2419,29 +2419,29 @@ function TypeScriptTypeDefinitionEmitter$emit$lambda(it) {
|
|
|
2419
2419
|
}
|
|
2420
2420
|
function TypeScriptTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2421
2421
|
return function (it) {
|
|
2422
|
-
return this$0.
|
|
2422
|
+
return this$0.ut(it);
|
|
2423
2423
|
};
|
|
2424
2424
|
}
|
|
2425
2425
|
function TypeScriptTypeDefinitionEmitter() {
|
|
2426
2426
|
}
|
|
2427
2427
|
//region block: post-declaration
|
|
2428
|
-
protoOf(TypeScriptEmitter).
|
|
2429
|
-
protoOf(TypeScriptEmitter).
|
|
2430
|
-
protoOf(TypeScriptEmitter).
|
|
2431
|
-
protoOf(TypeScriptEmitter).
|
|
2432
|
-
protoOf(TypeScriptEmitter).
|
|
2433
|
-
protoOf(TypeScriptEmitter).
|
|
2434
|
-
protoOf(TypeScriptEmitter).
|
|
2435
|
-
protoOf(TypeScriptEmitter).
|
|
2436
|
-
protoOf(TypeScriptEmitter).
|
|
2437
|
-
protoOf(TypeScriptEmitter).
|
|
2438
|
-
protoOf(TypeScriptEmitter).
|
|
2439
|
-
protoOf(TypeScriptEmitter).
|
|
2440
|
-
protoOf(TypeScriptEmitter).
|
|
2441
|
-
protoOf(TypeScriptEmitter).
|
|
2442
|
-
protoOf(TypeScriptEmitter).
|
|
2443
|
-
protoOf(TypeScriptIrEmitter).
|
|
2444
|
-
protoOf(TypeScriptIrEmitter).
|
|
2428
|
+
protoOf(TypeScriptEmitter).st = emit_3;
|
|
2429
|
+
protoOf(TypeScriptEmitter).tt = emit_6;
|
|
2430
|
+
protoOf(TypeScriptEmitter).ut = emit_7;
|
|
2431
|
+
protoOf(TypeScriptEmitter).vt = emit_4;
|
|
2432
|
+
protoOf(TypeScriptEmitter).wt = emit_5;
|
|
2433
|
+
protoOf(TypeScriptEmitter).gv = emit_10;
|
|
2434
|
+
protoOf(TypeScriptEmitter).bv = emit_9;
|
|
2435
|
+
protoOf(TypeScriptEmitter).hv = emit_8;
|
|
2436
|
+
protoOf(TypeScriptEmitter).uu = emit_2;
|
|
2437
|
+
protoOf(TypeScriptEmitter).iv = emitValidator;
|
|
2438
|
+
protoOf(TypeScriptEmitter).q23 = sanitizeSymbol;
|
|
2439
|
+
protoOf(TypeScriptEmitter).h20 = sanitizeSymbol_0;
|
|
2440
|
+
protoOf(TypeScriptEmitter).r23 = emitPrimitive;
|
|
2441
|
+
protoOf(TypeScriptEmitter).p23 = emitClient;
|
|
2442
|
+
protoOf(TypeScriptEmitter).yt = emitClientEndpointRequest;
|
|
2443
|
+
protoOf(TypeScriptIrEmitter).a1z = emit_1;
|
|
2444
|
+
protoOf(TypeScriptIrEmitter).d1z = beforeGenerate;
|
|
2445
2445
|
//endregion
|
|
2446
2446
|
//region block: exports
|
|
2447
2447
|
export {
|