@flock/wirespec 0.19.2 → 0.19.3-RC.1
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 +167 -167
- package/clikt-clikt-mordant.mjs +81 -81
- package/clikt-clikt-mordant.mjs.map +1 -1
- package/clikt-clikt.mjs +1636 -1636
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +448 -448
- package/kotest-kotest-assertions-kotest-assertions-core.mjs +4 -0
- package/kotest-kotest-assertions-kotest-assertions-core.mjs.map +1 -0
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs +4 -0
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs.map +1 -0
- package/kotest-kotest-common.mjs +56 -0
- package/kotest-kotest-common.mjs.map +1 -0
- package/kotest-kotest-framework-kotest-framework-engine.mjs +4 -0
- package/kotest-kotest-framework-kotest-framework-engine.mjs.map +1 -0
- package/kotest-kotest-property.mjs +2501 -0
- package/kotest-kotest-property.mjs.map +1 -0
- package/kotlin-kotlin-stdlib.mjs +5269 -2487
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10266 -10266
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1846 -1846
- package/kotlin-rgxgen.mjs.map +1 -1
- package/kotlinx-coroutines-test.mjs +4 -0
- package/kotlinx-coroutines-test.mjs.map +1 -0
- package/kotlinx-io-kotlinx-io-core.mjs +455 -455
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +2132 -2098
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1579 -1579
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1435 -1435
- package/package.json +5 -1
- package/wirespec-generator.d.ts +51 -0
- package/wirespec-generator.mjs +9 -0
- package/wirespec-src-compiler-core.mjs +1597 -1597
- package/wirespec-src-compiler-emitters-java.mjs +451 -451
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +371 -371
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +456 -456
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +481 -481
- package/wirespec-src-compiler-emitters-scala.mjs +193 -193
- package/wirespec-src-compiler-emitters-typescript.mjs +526 -526
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +85 -85
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3913 -3857
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +439 -439
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +521 -521
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +859 -859
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +1387 -1387
- package/wirespec-src-ide-lsp.mjs.map +1 -1
- package/wirespec-src-integration-kotest.mjs +1647 -0
- package/wirespec-src-integration-kotest.mjs.map +1 -0
- package/wirespec-src-plugin-arguments.mjs +192 -192
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +109 -109
- package/wirespec-src-plugin-npm.d.mts +21 -0
- package/wirespec-src-plugin-npm.mjs +43 -43
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +35 -35
- package/wirespec-src-tools-generator.mjs.map +1 -1
- package/xmlutil-core.mjs +4 -0
- package/xmlutil-core.mjs.map +1 -0
- package/xmlutil-serialization.mjs +4 -0
- package/xmlutil-serialization.mjs.map +1 -0
|
@@ -194,11 +194,11 @@ var imul = Math.imul;
|
|
|
194
194
|
//endregion
|
|
195
195
|
//region block: pre-declaration
|
|
196
196
|
function emit_2(identifier) {
|
|
197
|
-
return '"' + identifier.
|
|
197
|
+
return '"' + identifier.m1() + '"';
|
|
198
198
|
}
|
|
199
199
|
initMetadataForInterface(TypeScriptIdentifierEmitter, 'TypeScriptIdentifierEmitter');
|
|
200
200
|
function sanitizeSymbol(_this__u8e3s4) {
|
|
201
|
-
return this.
|
|
201
|
+
return this.p20(_this__u8e3s4.m1());
|
|
202
202
|
}
|
|
203
203
|
function sanitizeSymbol_0(_this__u8e3s4) {
|
|
204
204
|
var tmp = asSequence_0(_this__u8e3s4);
|
|
@@ -212,9 +212,9 @@ function emit_3(type, module_0) {
|
|
|
212
212
|
var _iterator__ex2g4s = this_0.t();
|
|
213
213
|
while (_iterator__ex2g4s.u()) {
|
|
214
214
|
var e = _iterator__ex2g4s.v();
|
|
215
|
-
var key = e.
|
|
216
|
-
if (set.
|
|
217
|
-
list.
|
|
215
|
+
var key = e.my_1;
|
|
216
|
+
if (set.y(key)) {
|
|
217
|
+
list.y(e);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -223,19 +223,19 @@ function emit_3(type, module_0) {
|
|
|
223
223
|
var _iterator__ex2g4s_0 = list.t();
|
|
224
224
|
while (_iterator__ex2g4s_0.u()) {
|
|
225
225
|
var item = _iterator__ex2g4s_0.v();
|
|
226
|
-
var tmp$ret$2 = 'import {' + item.
|
|
227
|
-
destination.
|
|
226
|
+
var tmp$ret$2 = 'import {' + item.my_1 + "} from './" + item.my_1 + "'";
|
|
227
|
+
destination.y(tmp$ret$2);
|
|
228
228
|
}
|
|
229
229
|
var tmp = destination;
|
|
230
|
-
return trimMargin('\n |' + joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda) + '\n |export type ' + this.
|
|
230
|
+
return trimMargin('\n |' + joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda) + '\n |export type ' + this.z23(type.ws_1) + ' = {\n |' + this.wt(type.xs_1) + '\n |}\n |\n ');
|
|
231
231
|
}
|
|
232
232
|
function emit_4(_this__u8e3s4) {
|
|
233
233
|
var tmp;
|
|
234
234
|
if (_this__u8e3s4 instanceof Dict) {
|
|
235
|
-
tmp = 'Record<string, ' + this.
|
|
235
|
+
tmp = 'Record<string, ' + this.yt(_this__u8e3s4.ds_1) + '>';
|
|
236
236
|
} else {
|
|
237
237
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
238
|
-
tmp = this.
|
|
238
|
+
tmp = this.yt(_this__u8e3s4.as_1) + '[]';
|
|
239
239
|
} else {
|
|
240
240
|
if (_this__u8e3s4 instanceof Unit) {
|
|
241
241
|
tmp = 'void';
|
|
@@ -244,10 +244,10 @@ function emit_4(_this__u8e3s4) {
|
|
|
244
244
|
tmp = 'any';
|
|
245
245
|
} else {
|
|
246
246
|
if (_this__u8e3s4 instanceof Custom) {
|
|
247
|
-
tmp = this.
|
|
247
|
+
tmp = this.p20(_this__u8e3s4.my_1);
|
|
248
248
|
} else {
|
|
249
249
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
250
|
-
tmp = this.
|
|
250
|
+
tmp = this.a24(_this__u8e3s4);
|
|
251
251
|
} else {
|
|
252
252
|
noWhenBranchMatchedException();
|
|
253
253
|
}
|
|
@@ -257,10 +257,10 @@ function emit_4(_this__u8e3s4) {
|
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
// Inline function 'kotlin.let' call
|
|
260
|
-
return tmp + (_this__u8e3s4.
|
|
260
|
+
return tmp + (_this__u8e3s4.ey() ? ' | undefined' : '');
|
|
261
261
|
}
|
|
262
262
|
function emitPrimitive(_this__u8e3s4) {
|
|
263
|
-
var tmp0_subject = _this__u8e3s4.
|
|
263
|
+
var tmp0_subject = _this__u8e3s4.qy_1;
|
|
264
264
|
var tmp;
|
|
265
265
|
if (tmp0_subject instanceof String_0) {
|
|
266
266
|
tmp = 'string';
|
|
@@ -288,10 +288,10 @@ function emitPrimitive(_this__u8e3s4) {
|
|
|
288
288
|
function emit_5(_this__u8e3s4) {
|
|
289
289
|
var tmp;
|
|
290
290
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
291
|
-
tmp = Spacer_instance.toString() + 'return ' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.
|
|
291
|
+
tmp = Spacer_instance.toString() + 'return ' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.ax_1) + '.test(value);';
|
|
292
292
|
} else {
|
|
293
293
|
if (_this__u8e3s4 instanceof Bound) {
|
|
294
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
294
|
+
var tmp1_safe_receiver = _this__u8e3s4.qx_1;
|
|
295
295
|
var tmp_0;
|
|
296
296
|
if (tmp1_safe_receiver == null) {
|
|
297
297
|
tmp_0 = null;
|
|
@@ -300,7 +300,7 @@ function emit_5(_this__u8e3s4) {
|
|
|
300
300
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
301
301
|
}
|
|
302
302
|
var minCheck = tmp_0;
|
|
303
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
303
|
+
var tmp2_safe_receiver = _this__u8e3s4.rx_1;
|
|
304
304
|
var tmp_1;
|
|
305
305
|
if (tmp2_safe_receiver == null) {
|
|
306
306
|
tmp_1 = null;
|
|
@@ -328,18 +328,18 @@ function emit_5(_this__u8e3s4) {
|
|
|
328
328
|
return tmp;
|
|
329
329
|
}
|
|
330
330
|
function emit_6(_this__u8e3s4) {
|
|
331
|
-
return joinToString(_this__u8e3s4.
|
|
331
|
+
return joinToString(_this__u8e3s4.ts_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda_0(this));
|
|
332
332
|
}
|
|
333
333
|
function emit_7(_this__u8e3s4) {
|
|
334
|
-
return Spacer_instance.toString() + this.
|
|
334
|
+
return Spacer_instance.toString() + this.yu(_this__u8e3s4.bt_1) + ': ' + this.yt(_this__u8e3s4.ct_1);
|
|
335
335
|
}
|
|
336
336
|
initMetadataForInterface(TypeScriptTypeDefinitionEmitter, 'TypeScriptTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, TypeScriptIdentifierEmitter]);
|
|
337
337
|
function emitClient(ast) {
|
|
338
|
-
var tmp = 'client.' + this.
|
|
339
|
-
var tmp_0 = this.
|
|
338
|
+
var tmp = 'client.' + this.fu().ou_1;
|
|
339
|
+
var tmp_0 = this.bu(ast);
|
|
340
340
|
var tmp_1 = joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, TypeScriptClientEmitter$emitClient$lambda);
|
|
341
341
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
342
|
-
var this_0 = ast.
|
|
342
|
+
var this_0 = ast.cu_1;
|
|
343
343
|
// Inline function 'kotlin.collections.flatMap' call
|
|
344
344
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
345
345
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -347,7 +347,7 @@ function emitClient(ast) {
|
|
|
347
347
|
var _iterator__ex2g4s = tmp0.t();
|
|
348
348
|
while (_iterator__ex2g4s.u()) {
|
|
349
349
|
var element = _iterator__ex2g4s.v();
|
|
350
|
-
var list = new NonEmptyList(element.
|
|
350
|
+
var list = new NonEmptyList(element.eu_1);
|
|
351
351
|
addAll(destination, list);
|
|
352
352
|
}
|
|
353
353
|
var tmp$ret$3 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -367,47 +367,99 @@ function emitClient(ast) {
|
|
|
367
367
|
var _iterator__ex2g4s_1 = destination_0.t();
|
|
368
368
|
while (_iterator__ex2g4s_1.u()) {
|
|
369
369
|
var e = _iterator__ex2g4s_1.v();
|
|
370
|
-
var key = e.
|
|
371
|
-
if (set.
|
|
372
|
-
list_1.
|
|
370
|
+
var key = e.my_1;
|
|
371
|
+
if (set.y(key)) {
|
|
372
|
+
list_1.y(e);
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
var tmp_2 = list_1;
|
|
376
376
|
var tmp_3 = joinToString(tmp_2, '\n', VOID, VOID, VOID, VOID, TypeScriptClientEmitter$emitClient$lambda_0);
|
|
377
|
-
var tmp_4 = this.
|
|
377
|
+
var tmp_4 = this.bu(ast);
|
|
378
378
|
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 '));
|
|
379
379
|
}
|
|
380
380
|
initMetadataForInterface(TypeScriptClientEmitter, 'TypeScriptClientEmitter', VOID, VOID, [ClientEmitter, TypeScriptTypeDefinitionEmitter]);
|
|
381
381
|
function emit_8(enum_0, module_0) {
|
|
382
|
-
var tmp = this.
|
|
383
|
-
return 'export type ' + tmp + ' = ' + joinToString(enum_0.
|
|
382
|
+
var tmp = this.z23(enum_0.iv_1);
|
|
383
|
+
return 'export type ' + tmp + ' = ' + joinToString(enum_0.jv_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEnumDefinitionEmitter$emit$lambda) + '\n';
|
|
384
384
|
}
|
|
385
385
|
initMetadataForInterface(TypeScriptEnumDefinitionEmitter, 'TypeScriptEnumDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
386
|
-
function emit_9(
|
|
387
|
-
|
|
386
|
+
function emit_9(endpoint) {
|
|
387
|
+
// Inline function 'kotlin.collections.distinctBy' call
|
|
388
|
+
var this_0 = importReferences(endpoint);
|
|
389
|
+
var set = HashSet_init_$Create$();
|
|
390
|
+
var list = ArrayList_init_$Create$();
|
|
391
|
+
var _iterator__ex2g4s = this_0.t();
|
|
392
|
+
while (_iterator__ex2g4s.u()) {
|
|
393
|
+
var e = _iterator__ex2g4s.v();
|
|
394
|
+
var key = e.my_1;
|
|
395
|
+
if (set.y(key)) {
|
|
396
|
+
list.y(e);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
// Inline function 'kotlin.collections.map' call
|
|
400
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
401
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(list, 10));
|
|
402
|
+
var _iterator__ex2g4s_0 = list.t();
|
|
403
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
404
|
+
var item = _iterator__ex2g4s_0.v();
|
|
405
|
+
var tmp$ret$2 = 'import {type ' + item.my_1 + "} from '../model'";
|
|
406
|
+
destination.y(tmp$ret$2);
|
|
407
|
+
}
|
|
408
|
+
var tmp = destination;
|
|
409
|
+
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda);
|
|
410
|
+
var tmp_1 = this.z23(endpoint.ft_1);
|
|
411
|
+
var tmp_2 = get_pathParams(endpoint);
|
|
412
|
+
var tmp_3 = emitType(this, tmp_2, 'Path', TypeScriptEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
413
|
+
var tmp_4 = emitType(this, endpoint.it_1, 'Queries', TypeScriptEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
414
|
+
var tmp_5 = emitType(this, endpoint.jt_1, 'Headers', TypeScriptEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
415
|
+
var tmp_6 = emitType_1(this, first(endpoint.kt_1), endpoint);
|
|
416
|
+
var tmp_7 = distinctByStatus(endpoint.lt_1);
|
|
417
|
+
var tmp_8 = joinToString(tmp_7, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
418
|
+
var tmp_9 = Spacer_instance.toString();
|
|
419
|
+
var tmp_10 = distinctByStatus(endpoint.lt_1);
|
|
420
|
+
var tmp_11 = joinToString(tmp_10, ' | ', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_4(this));
|
|
421
|
+
var tmp_12 = emitFunction_0(this, first(endpoint.kt_1), endpoint);
|
|
422
|
+
var tmp_13 = distinctByStatus(endpoint.lt_1);
|
|
423
|
+
var tmp_14 = joinToString(tmp_13, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
424
|
+
var tmp_15 = Spacer_instance.toString();
|
|
425
|
+
var tmp_16 = Spacer_instance.sv(2);
|
|
426
|
+
var tmp_17 = emitHandleFunction(this, endpoint);
|
|
427
|
+
var tmp_18 = Spacer_instance.toString();
|
|
428
|
+
var tmp_19 = prependIndent(emitClient_0(this, endpoint), Spacer_instance.sv(1));
|
|
429
|
+
var tmp_20 = prependIndent(emitServer(this, endpoint), Spacer_instance.sv(1));
|
|
430
|
+
var tmp_21 = Spacer_instance.toString();
|
|
431
|
+
var tmp_22 = Spacer_instance.sv(2);
|
|
432
|
+
var tmp_23 = Companion_instance_0.qu(this.z23(endpoint.ft_1));
|
|
433
|
+
var tmp_24 = Spacer_instance.sv(2);
|
|
434
|
+
var tmp_25 = Spacer_instance.sv(2);
|
|
435
|
+
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.gt_1.b3_1 + '",\n |' + tmp_25 + 'path: "' + joinToString(endpoint.ht_1, '/', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_6(this)) + '",\n |' + Spacer_instance.sv(2) + 'server,\n |' + Spacer_instance.sv(2) + 'client\n |' + Spacer_instance.toString() + '} as const\n |}\n |\n ');
|
|
436
|
+
}
|
|
437
|
+
initMetadataForInterface(TypeScriptEndpointDefinitionEmitter, 'TypeScriptEndpointDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
438
|
+
function emit_10(refined) {
|
|
439
|
+
return trimMargin('\n |export type ' + this.z23(refined.dv_1) + ' = ' + this.yt(refined.ev_1) + ';\n |export const validate' + refined.dv_1.m1() + ' = (value: ' + this.yt(refined.ev_1) + '): value is ' + this.z23(refined.dv_1) + ' => {\n |' + this.mv(refined) + '\n |}\n |\n ');
|
|
388
440
|
}
|
|
389
441
|
function emitValidator(_this__u8e3s4) {
|
|
390
442
|
var defaultReturn = Spacer_instance.toString() + 'return true;';
|
|
391
|
-
var type = _this__u8e3s4.
|
|
443
|
+
var type = _this__u8e3s4.ev_1.qy_1;
|
|
392
444
|
var tmp;
|
|
393
445
|
if (type instanceof Integer) {
|
|
394
|
-
var tmp0_safe_receiver = type.
|
|
395
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
446
|
+
var tmp0_safe_receiver = type.vx_1;
|
|
447
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.zt(tmp0_safe_receiver);
|
|
396
448
|
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
397
449
|
} else {
|
|
398
450
|
if (type instanceof Number_0) {
|
|
399
|
-
var tmp2_safe_receiver = type.
|
|
400
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.
|
|
451
|
+
var tmp2_safe_receiver = type.yx_1;
|
|
452
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.zt(tmp2_safe_receiver);
|
|
401
453
|
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
402
454
|
} else {
|
|
403
455
|
if (type instanceof String_0) {
|
|
404
|
-
var tmp4_safe_receiver = type.
|
|
456
|
+
var tmp4_safe_receiver = type.sx_1;
|
|
405
457
|
var tmp_0;
|
|
406
458
|
var tmp_1 = tmp4_safe_receiver;
|
|
407
459
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
408
460
|
tmp_0 = null;
|
|
409
461
|
} else {
|
|
410
|
-
tmp_0 = this.
|
|
462
|
+
tmp_0 = this.zt(new RegExp_0(tmp4_safe_receiver));
|
|
411
463
|
}
|
|
412
464
|
var tmp5_elvis_lhs = tmp_0;
|
|
413
465
|
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
@@ -427,59 +479,7 @@ function emitValidator(_this__u8e3s4) {
|
|
|
427
479
|
return tmp;
|
|
428
480
|
}
|
|
429
481
|
initMetadataForInterface(TypeScriptRefinedTypeDefinitionEmitter, 'TypeScriptRefinedTypeDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
430
|
-
|
|
431
|
-
// Inline function 'kotlin.collections.distinctBy' call
|
|
432
|
-
var this_0 = importReferences(endpoint);
|
|
433
|
-
var set = HashSet_init_$Create$();
|
|
434
|
-
var list = ArrayList_init_$Create$();
|
|
435
|
-
var _iterator__ex2g4s = this_0.t();
|
|
436
|
-
while (_iterator__ex2g4s.u()) {
|
|
437
|
-
var e = _iterator__ex2g4s.v();
|
|
438
|
-
var key = e.bv_1;
|
|
439
|
-
if (set.x(key)) {
|
|
440
|
-
list.x(e);
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
// Inline function 'kotlin.collections.map' call
|
|
444
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
445
|
-
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(list, 10));
|
|
446
|
-
var _iterator__ex2g4s_0 = list.t();
|
|
447
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
448
|
-
var item = _iterator__ex2g4s_0.v();
|
|
449
|
-
var tmp$ret$2 = 'import {type ' + item.bv_1 + "} from '../model'";
|
|
450
|
-
destination.x(tmp$ret$2);
|
|
451
|
-
}
|
|
452
|
-
var tmp = destination;
|
|
453
|
-
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda);
|
|
454
|
-
var tmp_1 = this.n20(endpoint.up_1);
|
|
455
|
-
var tmp_2 = get_pathParams(endpoint);
|
|
456
|
-
var tmp_3 = emitType(this, tmp_2, 'Path', TypeScriptEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
457
|
-
var tmp_4 = emitType(this, endpoint.xp_1, 'Queries', TypeScriptEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
458
|
-
var tmp_5 = emitType(this, endpoint.yp_1, 'Headers', TypeScriptEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
459
|
-
var tmp_6 = emitType_1(this, first(endpoint.zp_1), endpoint);
|
|
460
|
-
var tmp_7 = distinctByStatus(endpoint.aq_1);
|
|
461
|
-
var tmp_8 = joinToString(tmp_7, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
462
|
-
var tmp_9 = Spacer_instance.toString();
|
|
463
|
-
var tmp_10 = distinctByStatus(endpoint.aq_1);
|
|
464
|
-
var tmp_11 = joinToString(tmp_10, ' | ', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_4(this));
|
|
465
|
-
var tmp_12 = emitFunction_0(this, first(endpoint.zp_1), endpoint);
|
|
466
|
-
var tmp_13 = distinctByStatus(endpoint.aq_1);
|
|
467
|
-
var tmp_14 = joinToString(tmp_13, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
468
|
-
var tmp_15 = Spacer_instance.toString();
|
|
469
|
-
var tmp_16 = Spacer_instance.hs(2);
|
|
470
|
-
var tmp_17 = emitHandleFunction(this, endpoint);
|
|
471
|
-
var tmp_18 = Spacer_instance.toString();
|
|
472
|
-
var tmp_19 = prependIndent(emitClient_0(this, endpoint), Spacer_instance.hs(1));
|
|
473
|
-
var tmp_20 = prependIndent(emitServer(this, endpoint), Spacer_instance.hs(1));
|
|
474
|
-
var tmp_21 = Spacer_instance.toString();
|
|
475
|
-
var tmp_22 = Spacer_instance.hs(2);
|
|
476
|
-
var tmp_23 = Companion_instance_0.fr(this.n20(endpoint.up_1));
|
|
477
|
-
var tmp_24 = Spacer_instance.hs(2);
|
|
478
|
-
var tmp_25 = Spacer_instance.hs(2);
|
|
479
|
-
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.vp_1.a3_1 + '",\n |' + tmp_25 + 'path: "' + joinToString(endpoint.wp_1, '/', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_6(this)) + '",\n |' + Spacer_instance.hs(2) + 'server,\n |' + Spacer_instance.hs(2) + 'client\n |' + Spacer_instance.toString() + '} as const\n |}\n |\n ');
|
|
480
|
-
}
|
|
481
|
-
initMetadataForInterface(TypeScriptEndpointDefinitionEmitter, 'TypeScriptEndpointDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
482
|
-
initMetadataForClass(TypeScriptEmitter, 'TypeScriptEmitter', TypeScriptEmitter, LanguageEmitter, [LanguageEmitter, TypeScriptEnumDefinitionEmitter, TypeScriptTypeDefinitionEmitter, TypeScriptRefinedTypeDefinitionEmitter, TypeScriptEndpointDefinitionEmitter, TypeScriptIdentifierEmitter, TypeScriptClientEmitter]);
|
|
482
|
+
initMetadataForClass(TypeScriptEmitter, 'TypeScriptEmitter', TypeScriptEmitter, LanguageEmitter, [LanguageEmitter, TypeScriptEnumDefinitionEmitter, TypeScriptIdentifierEmitter, TypeScriptTypeDefinitionEmitter, TypeScriptClientEmitter, TypeScriptEndpointDefinitionEmitter, TypeScriptRefinedTypeDefinitionEmitter]);
|
|
483
483
|
initMetadataForClass(EndpointParam, 'EndpointParam');
|
|
484
484
|
initMetadataForCompanion(Companion);
|
|
485
485
|
initMetadataForClass(TypeScriptIrEmitter, 'TypeScriptIrEmitter', TypeScriptIrEmitter, VOID, [IrEmitter]);
|
|
@@ -515,10 +515,10 @@ function emitClientInterface($this, _this__u8e3s4, endpoint) {
|
|
|
515
515
|
return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
516
516
|
}
|
|
517
517
|
function emitFunction($this, endpoint, request) {
|
|
518
|
-
var tmp = endpoint.
|
|
518
|
+
var tmp = endpoint.ft_1.m1();
|
|
519
519
|
var tmp_0 = emitClientInterface($this, request, endpoint);
|
|
520
520
|
var tmp_1 = Spacer_instance.toString();
|
|
521
|
-
var tmp_2 = endpoint.
|
|
521
|
+
var tmp_2 = endpoint.ft_1.m1();
|
|
522
522
|
// Inline function 'kotlin.takeIf' call
|
|
523
523
|
var this_0 = paramList(request, endpoint);
|
|
524
524
|
var tmp_3;
|
|
@@ -538,31 +538,31 @@ function emitFunction($this, endpoint, request) {
|
|
|
538
538
|
// Inline function 'kotlin.text.orEmpty' call
|
|
539
539
|
var tmp0_elvis_lhs = tmp_4;
|
|
540
540
|
var tmp$ret$5 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
541
|
-
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.
|
|
541
|
+
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.ft_1.m1() + '.client(serialization).to(req)\n |' + Spacer_instance.toString() + 'const rawResponse = await handler(rawRequest)\n |' + Spacer_instance.toString() + 'return ' + endpoint.ft_1.m1() + '.client(serialization).from(rawResponse)\n |},\n ');
|
|
542
542
|
}
|
|
543
543
|
function TypeScriptClientEmitter$emitClient$lambda(_destruct__k2r9zo) {
|
|
544
|
-
var endpoint = _destruct__k2r9zo.
|
|
545
|
-
return 'import {' + endpoint.
|
|
544
|
+
var endpoint = _destruct__k2r9zo.mf();
|
|
545
|
+
return 'import {' + endpoint.ft_1.m1() + '} from "./endpoint/' + endpoint.ft_1.m1() + '"';
|
|
546
546
|
}
|
|
547
547
|
function TypeScriptClientEmitter$emitClient$lambda_0(it) {
|
|
548
|
-
return 'import {type ' + it.
|
|
548
|
+
return 'import {type ' + it.my_1 + '} from "./model/' + it.my_1 + '"';
|
|
549
549
|
}
|
|
550
550
|
function TypeScriptClientEmitter$emitClient$lambda_1(this$0) {
|
|
551
551
|
return function (_destruct__k2r9zo) {
|
|
552
|
-
var endpoint = _destruct__k2r9zo.
|
|
553
|
-
var request = _destruct__k2r9zo.
|
|
552
|
+
var endpoint = _destruct__k2r9zo.mf();
|
|
553
|
+
var request = _destruct__k2r9zo.nf();
|
|
554
554
|
return emitFunction(this$0, endpoint, request);
|
|
555
555
|
};
|
|
556
556
|
}
|
|
557
557
|
function TypeScriptClientEmitter$emitClientInterface$lambda(this$0) {
|
|
558
558
|
return function (it) {
|
|
559
|
-
return this$0.
|
|
559
|
+
return this$0.yu(it.ku_1) + ': ' + this$0.yt(it.lu_1);
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
562
|
function TypeScriptClientEmitter() {
|
|
563
563
|
}
|
|
564
564
|
function TypeScriptEmitter$emit$lambda(it) {
|
|
565
|
-
return 'export {' + it.
|
|
565
|
+
return 'export {' + it.xu().m1() + "} from './" + it.xu().m1() + "'";
|
|
566
566
|
}
|
|
567
567
|
function TypeScriptEmitter$emit$lambda_0(it) {
|
|
568
568
|
// Inline function 'kotlin.text.trimStart' call
|
|
@@ -570,36 +570,36 @@ function TypeScriptEmitter$emit$lambda_0(it) {
|
|
|
570
570
|
}
|
|
571
571
|
function TypeScriptEmitter$emit$lambda_1(this$0) {
|
|
572
572
|
return function (it) {
|
|
573
|
-
return this$0.
|
|
573
|
+
return this$0.yt(it);
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
576
|
function TypeScriptEmitter() {
|
|
577
577
|
LanguageEmitter.call(this);
|
|
578
|
-
this.
|
|
579
|
-
this.
|
|
580
|
-
this.
|
|
578
|
+
this.b24_1 = FileExtension_TypeScript_getInstance();
|
|
579
|
+
this.c24_1 = TypeScriptShared_getInstance();
|
|
580
|
+
this.d24_1 = '//';
|
|
581
581
|
}
|
|
582
|
-
protoOf(TypeScriptEmitter).
|
|
583
|
-
return this.
|
|
582
|
+
protoOf(TypeScriptEmitter).fu = function () {
|
|
583
|
+
return this.b24_1;
|
|
584
584
|
};
|
|
585
|
-
protoOf(TypeScriptEmitter).
|
|
586
|
-
return this.
|
|
585
|
+
protoOf(TypeScriptEmitter).m20 = function () {
|
|
586
|
+
return this.c24_1;
|
|
587
587
|
};
|
|
588
|
-
protoOf(TypeScriptEmitter).
|
|
589
|
-
return this.
|
|
588
|
+
protoOf(TypeScriptEmitter).gu = function () {
|
|
589
|
+
return this.d24_1;
|
|
590
590
|
};
|
|
591
|
-
protoOf(TypeScriptEmitter).
|
|
591
|
+
protoOf(TypeScriptEmitter).pr = function (ast, logger) {
|
|
592
592
|
// Inline function 'kotlin.run' call
|
|
593
|
-
var $this$run = protoOf(LanguageEmitter).
|
|
593
|
+
var $this$run = protoOf(LanguageEmitter).pr.call(this, ast, logger);
|
|
594
594
|
var tmp;
|
|
595
595
|
if (hasEndpoints(ast)) {
|
|
596
|
-
tmp = NonEmptyList__plus_impl_xqmb9($this$run, this.
|
|
596
|
+
tmp = NonEmptyList__plus_impl_xqmb9($this$run, this.y23(ast));
|
|
597
597
|
} else {
|
|
598
598
|
tmp = $this$run;
|
|
599
599
|
}
|
|
600
600
|
var tmp_0 = tmp;
|
|
601
601
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
602
|
-
var this_0 = ast.
|
|
602
|
+
var this_0 = ast.cu_1;
|
|
603
603
|
// Inline function 'kotlin.collections.flatMap' call
|
|
604
604
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
605
605
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -607,7 +607,7 @@ protoOf(TypeScriptEmitter).eo = function (ast, logger) {
|
|
|
607
607
|
var _iterator__ex2g4s = tmp0.t();
|
|
608
608
|
while (_iterator__ex2g4s.u()) {
|
|
609
609
|
var element = _iterator__ex2g4s.v();
|
|
610
|
-
var list = new NonEmptyList(element.
|
|
610
|
+
var list = new NonEmptyList(element.eu_1);
|
|
611
611
|
addAll(destination, list);
|
|
612
612
|
}
|
|
613
613
|
var tmp$ret$5 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -620,47 +620,47 @@ protoOf(TypeScriptEmitter).eo = function (ast, logger) {
|
|
|
620
620
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
621
621
|
var key = namespace(element_0);
|
|
622
622
|
// Inline function 'kotlin.collections.getOrPut' call
|
|
623
|
-
var value = destination_0.
|
|
623
|
+
var value = destination_0.q2(key);
|
|
624
624
|
var tmp_1;
|
|
625
625
|
if (value == null) {
|
|
626
626
|
var answer = ArrayList_init_$Create$();
|
|
627
|
-
destination_0.
|
|
627
|
+
destination_0.t2(key, answer);
|
|
628
628
|
tmp_1 = answer;
|
|
629
629
|
} else {
|
|
630
630
|
tmp_1 = value;
|
|
631
631
|
}
|
|
632
632
|
var list_0 = tmp_1;
|
|
633
|
-
list_0.
|
|
633
|
+
list_0.y(element_0);
|
|
634
634
|
}
|
|
635
635
|
// Inline function 'kotlin.collections.map' call
|
|
636
636
|
// Inline function 'kotlin.collections.mapTo' call
|
|
637
|
-
var destination_1 = ArrayList_init_$Create$_0(destination_0.
|
|
637
|
+
var destination_1 = ArrayList_init_$Create$_0(destination_0.b1());
|
|
638
638
|
// Inline function 'kotlin.collections.iterator' call
|
|
639
|
-
var _iterator__ex2g4s_1 = destination_0.
|
|
639
|
+
var _iterator__ex2g4s_1 = destination_0.k1().t();
|
|
640
640
|
while (_iterator__ex2g4s_1.u()) {
|
|
641
641
|
var item = _iterator__ex2g4s_1.v();
|
|
642
642
|
// Inline function 'kotlin.collections.component1' call
|
|
643
|
-
var ns = item.
|
|
643
|
+
var ns = item.l1();
|
|
644
644
|
// Inline function 'kotlin.collections.component2' call
|
|
645
|
-
var defs = item.
|
|
646
|
-
var tmp_2 = ns + '/index.' + this.
|
|
645
|
+
var defs = item.m1();
|
|
646
|
+
var tmp_2 = ns + '/index.' + this.fu().ou_1;
|
|
647
647
|
var tmp$ret$14 = new Emitted(tmp_2, joinToString(defs, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda));
|
|
648
|
-
destination_1.
|
|
648
|
+
destination_1.y(tmp$ret$14);
|
|
649
649
|
}
|
|
650
650
|
return NonEmptyList__plus_impl_xqmb9_0(tmp_0, destination_1);
|
|
651
651
|
};
|
|
652
|
-
protoOf(TypeScriptEmitter).
|
|
652
|
+
protoOf(TypeScriptEmitter).vu = function (module_0, logger) {
|
|
653
653
|
// Inline function 'kotlin.let' call
|
|
654
|
-
var it = protoOf(LanguageEmitter).
|
|
655
|
-
return NonEmptyList__plus_impl_xqmb9(it, new Emitted('Wirespec', this.
|
|
654
|
+
var it = protoOf(LanguageEmitter).vu.call(this, module_0, logger);
|
|
655
|
+
return NonEmptyList__plus_impl_xqmb9(it, new Emitted('Wirespec', this.m20().f24_1));
|
|
656
656
|
};
|
|
657
|
-
protoOf(TypeScriptEmitter).
|
|
657
|
+
protoOf(TypeScriptEmitter).wu = function (definition, module_0, logger) {
|
|
658
658
|
// Inline function 'kotlin.let' call
|
|
659
|
-
var it = protoOf(LanguageEmitter).
|
|
660
|
-
var subPackageName = plus(Companion_instance.
|
|
661
|
-
return new Emitted(subPackageName.
|
|
659
|
+
var it = protoOf(LanguageEmitter).wu.call(this, definition, module_0, logger);
|
|
660
|
+
var subPackageName = plus(Companion_instance.nv(''), definition);
|
|
661
|
+
return new Emitted(subPackageName.qv() + this.p20(it.js_1), trimMargin("\n |import {Wirespec} from '../Wirespec'\n |\n |" + it.ks_1 + '\n '));
|
|
662
662
|
};
|
|
663
|
-
protoOf(TypeScriptEmitter).
|
|
663
|
+
protoOf(TypeScriptEmitter).av = function (union) {
|
|
664
664
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
665
665
|
var this_0 = importReferences(union);
|
|
666
666
|
var set = HashSet_init_$Create$();
|
|
@@ -668,9 +668,9 @@ protoOf(TypeScriptEmitter).pr = function (union) {
|
|
|
668
668
|
var _iterator__ex2g4s = this_0.t();
|
|
669
669
|
while (_iterator__ex2g4s.u()) {
|
|
670
670
|
var e = _iterator__ex2g4s.v();
|
|
671
|
-
var key = e.
|
|
672
|
-
if (set.
|
|
673
|
-
list.
|
|
671
|
+
var key = e.my_1;
|
|
672
|
+
if (set.y(key)) {
|
|
673
|
+
list.y(e);
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
676
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -679,24 +679,24 @@ protoOf(TypeScriptEmitter).pr = function (union) {
|
|
|
679
679
|
var _iterator__ex2g4s_0 = list.t();
|
|
680
680
|
while (_iterator__ex2g4s_0.u()) {
|
|
681
681
|
var item = _iterator__ex2g4s_0.v();
|
|
682
|
-
var tmp$ret$2 = 'import {type ' + item.
|
|
683
|
-
destination.
|
|
682
|
+
var tmp$ret$2 = 'import {type ' + item.my_1 + "} from '../model'";
|
|
683
|
+
destination.y(tmp$ret$2);
|
|
684
684
|
}
|
|
685
685
|
var tmp = destination;
|
|
686
686
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda_0);
|
|
687
|
-
var tmp_1 = this.
|
|
688
|
-
return trimMargin('\n |' + tmp_0 + '\n |export type ' + tmp_1 + ' = ' + joinToString(union.
|
|
687
|
+
var tmp_1 = this.z23(union.rs_1);
|
|
688
|
+
return trimMargin('\n |' + tmp_0 + '\n |export type ' + tmp_1 + ' = ' + joinToString(union.ss_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda_1(this)) + '\n |\n ');
|
|
689
689
|
};
|
|
690
|
-
protoOf(TypeScriptEmitter).
|
|
691
|
-
return this.
|
|
690
|
+
protoOf(TypeScriptEmitter).zu = function (channel) {
|
|
691
|
+
return this.hu();
|
|
692
692
|
};
|
|
693
693
|
function emit_11($this, _this__u8e3s4) {
|
|
694
694
|
var tmp;
|
|
695
695
|
if (_this__u8e3s4 instanceof Literal) {
|
|
696
|
-
tmp = _this__u8e3s4.
|
|
696
|
+
tmp = _this__u8e3s4.iu_1;
|
|
697
697
|
} else {
|
|
698
698
|
if (_this__u8e3s4 instanceof Param) {
|
|
699
|
-
tmp = ':' + _this__u8e3s4.
|
|
699
|
+
tmp = ':' + _this__u8e3s4.mt_1.m1();
|
|
700
700
|
} else {
|
|
701
701
|
noWhenBranchMatchedException();
|
|
702
702
|
}
|
|
@@ -704,64 +704,64 @@ function emit_11($this, _this__u8e3s4) {
|
|
|
704
704
|
return tmp;
|
|
705
705
|
}
|
|
706
706
|
function emitClient_0($this, _this__u8e3s4) {
|
|
707
|
-
return trimMargin('\n |export const client: Wirespec.Client<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitClientTo($this, _this__u8e3s4), Spacer_instance.
|
|
707
|
+
return trimMargin('\n |export const client: Wirespec.Client<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitClientTo($this, _this__u8e3s4), Spacer_instance.sv(1)) + ',\n |' + prependIndent(emitClientFrom($this, _this__u8e3s4), Spacer_instance.sv(1)) + '\n |})\n ');
|
|
708
708
|
}
|
|
709
709
|
function emitClientTo($this, _this__u8e3s4) {
|
|
710
|
-
var tmp = Spacer_instance.
|
|
710
|
+
var tmp = Spacer_instance.sv(1);
|
|
711
711
|
// Inline function 'kotlin.text.uppercase' call
|
|
712
712
|
// Inline function 'kotlin.js.asDynamic' call
|
|
713
|
-
var tmp_0 = _this__u8e3s4.
|
|
714
|
-
var tmp_1 = Spacer_instance.
|
|
713
|
+
var tmp_0 = _this__u8e3s4.gt_1.b3_1.toUpperCase();
|
|
714
|
+
var tmp_1 = Spacer_instance.sv(1);
|
|
715
715
|
var tmp_2 = emitPathArray($this, _this__u8e3s4);
|
|
716
|
-
var tmp_3 = Spacer_instance.
|
|
717
|
-
var tmp_4 = joinToString(_this__u8e3s4.
|
|
718
|
-
var tmp_5 = Spacer_instance.
|
|
719
|
-
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.
|
|
716
|
+
var tmp_3 = Spacer_instance.sv(1);
|
|
717
|
+
var tmp_4 = joinToString(_this__u8e3s4.it_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientTo$lambda($this));
|
|
718
|
+
var tmp_5 = Spacer_instance.sv(1);
|
|
719
|
+
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.jt_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientTo$lambda_0($this)) + '},\n |' + Spacer_instance.sv(1) + 'body: serialization.serialize(it.body)\n |})\n ');
|
|
720
720
|
}
|
|
721
721
|
function emitClientFrom($this, _this__u8e3s4) {
|
|
722
|
-
var tmp = Spacer_instance.
|
|
723
|
-
var tmp_0 = distinctByStatus(_this__u8e3s4.
|
|
724
|
-
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.
|
|
722
|
+
var tmp = Spacer_instance.sv(1);
|
|
723
|
+
var tmp_0 = distinctByStatus(_this__u8e3s4.lt_1);
|
|
724
|
+
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.sv(2)) + '\n |' + Spacer_instance.sv(2) + 'default:\n |' + Spacer_instance.sv(3) + 'throw new Error(`Cannot internalize response with status: ${it.status}`);\n |' + Spacer_instance.sv(1) + '}\n |}\n ');
|
|
725
725
|
}
|
|
726
726
|
function emitClientFromResponse($this, _this__u8e3s4) {
|
|
727
|
-
var tmp = fixStatus(_this__u8e3s4.
|
|
728
|
-
var tmp_0 = Spacer_instance.
|
|
729
|
-
var tmp_1 = Spacer_instance.
|
|
730
|
-
var tmp_2 = fixStatus(_this__u8e3s4.
|
|
731
|
-
var tmp_3 = Spacer_instance.
|
|
732
|
-
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.
|
|
727
|
+
var tmp = fixStatus(_this__u8e3s4.rt_1);
|
|
728
|
+
var tmp_0 = Spacer_instance.sv(1);
|
|
729
|
+
var tmp_1 = Spacer_instance.sv(2);
|
|
730
|
+
var tmp_2 = fixStatus(_this__u8e3s4.rt_1);
|
|
731
|
+
var tmp_3 = Spacer_instance.sv(2);
|
|
732
|
+
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.st_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientFromResponse$lambda($this)) + '},\n |' + Spacer_instance.sv(2) + 'body: serialization.deserialize<' + emitReference($this, _this__u8e3s4) + '>(it.body)\n |' + Spacer_instance.sv(1) + '};\n ');
|
|
733
733
|
}
|
|
734
734
|
function emitServer($this, _this__u8e3s4) {
|
|
735
|
-
return trimMargin('\n |export const server:Wirespec.Server<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitServerFrom($this, _this__u8e3s4), Spacer_instance.
|
|
735
|
+
return trimMargin('\n |export const server:Wirespec.Server<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitServerFrom($this, _this__u8e3s4), Spacer_instance.sv(1)) + ',\n |' + prependIndent(emitServerTo($this, _this__u8e3s4), Spacer_instance.sv(1)) + '\n |})\n ');
|
|
736
736
|
}
|
|
737
737
|
function emitServerFrom($this, _this__u8e3s4) {
|
|
738
|
-
var tmp = Spacer_instance.
|
|
739
|
-
var tmp_0 = Spacer_instance.
|
|
738
|
+
var tmp = Spacer_instance.sv(1);
|
|
739
|
+
var tmp_0 = Spacer_instance.sv(2);
|
|
740
740
|
// Inline function 'kotlin.text.uppercase' call
|
|
741
741
|
// Inline function 'kotlin.js.asDynamic' call
|
|
742
|
-
var tmp_1 = _this__u8e3s4.
|
|
743
|
-
var tmp_2 = Spacer_instance.
|
|
742
|
+
var tmp_1 = _this__u8e3s4.gt_1.b3_1.toUpperCase();
|
|
743
|
+
var tmp_2 = Spacer_instance.sv(2);
|
|
744
744
|
var tmp_3 = get_indexedPathParams(_this__u8e3s4);
|
|
745
|
-
var tmp_4 = prependIndent(joinToString(tmp_3, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda($this)), Spacer_instance.
|
|
746
|
-
var tmp_5 = Spacer_instance.
|
|
747
|
-
var tmp_6 = Spacer_instance.
|
|
748
|
-
var tmp_7 = joinToString(_this__u8e3s4.
|
|
749
|
-
var tmp_8 = Spacer_instance.
|
|
750
|
-
var tmp_9 = Spacer_instance.
|
|
751
|
-
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.
|
|
745
|
+
var tmp_4 = prependIndent(joinToString(tmp_3, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda($this)), Spacer_instance.sv(3));
|
|
746
|
+
var tmp_5 = Spacer_instance.sv(2);
|
|
747
|
+
var tmp_6 = Spacer_instance.sv(2);
|
|
748
|
+
var tmp_7 = joinToString(_this__u8e3s4.it_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_0($this));
|
|
749
|
+
var tmp_8 = Spacer_instance.sv(2);
|
|
750
|
+
var tmp_9 = Spacer_instance.sv(2);
|
|
751
|
+
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.jt_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_1($this)) + '\n |' + Spacer_instance.sv(2) + '},\n |' + Spacer_instance.sv(2) + 'body: serialization.deserialize(it.body)\n |' + Spacer_instance.sv(1) + '}\n |}\n ');
|
|
752
752
|
}
|
|
753
753
|
function emitServerTo($this, _this__u8e3s4) {
|
|
754
|
-
var tmp = Spacer_instance.
|
|
755
|
-
var tmp_0 = distinctByStatus(_this__u8e3s4.
|
|
756
|
-
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.
|
|
754
|
+
var tmp = Spacer_instance.sv(1);
|
|
755
|
+
var tmp_0 = distinctByStatus(_this__u8e3s4.lt_1);
|
|
756
|
+
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.sv(2)) + '\n |' + Spacer_instance.sv(1) + '}\n |}\n ');
|
|
757
757
|
}
|
|
758
758
|
function emitServerToResponse($this, _this__u8e3s4) {
|
|
759
|
-
var tmp = fixStatus(_this__u8e3s4.
|
|
760
|
-
var tmp_0 = Spacer_instance.
|
|
761
|
-
var tmp_1 = Spacer_instance.
|
|
762
|
-
var tmp_2 = fixStatus(_this__u8e3s4.
|
|
763
|
-
var tmp_3 = Spacer_instance.
|
|
764
|
-
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {\n |' + prependIndent(joinToString(_this__u8e3s4.
|
|
759
|
+
var tmp = fixStatus(_this__u8e3s4.rt_1);
|
|
760
|
+
var tmp_0 = Spacer_instance.sv(1);
|
|
761
|
+
var tmp_1 = Spacer_instance.sv(2);
|
|
762
|
+
var tmp_2 = fixStatus(_this__u8e3s4.rt_1);
|
|
763
|
+
var tmp_3 = Spacer_instance.sv(2);
|
|
764
|
+
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {\n |' + prependIndent(joinToString(_this__u8e3s4.st_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerToResponse$lambda($this)), Spacer_instance.sv(3)) + '\n |' + Spacer_instance.sv(2) + '} as Record<string, string>,\n |' + Spacer_instance.sv(2) + 'body: serialization.serialize(it.body),\n |' + Spacer_instance.sv(1) + '};\n ');
|
|
765
765
|
}
|
|
766
766
|
function emitType($this, _this__u8e3s4, name, block) {
|
|
767
767
|
var tmp;
|
|
@@ -774,7 +774,7 @@ function emitType($this, _this__u8e3s4, name, block) {
|
|
|
774
774
|
return tmp;
|
|
775
775
|
}
|
|
776
776
|
function emitName($this, _this__u8e3s4) {
|
|
777
|
-
return 'Response' + Companion_instance_0.
|
|
777
|
+
return 'Response' + Companion_instance_0.pu(_this__u8e3s4.rt_1);
|
|
778
778
|
}
|
|
779
779
|
function emitFunction_0($this, _this__u8e3s4, endpoint) {
|
|
780
780
|
var tmp = Spacer_instance.toString();
|
|
@@ -800,18 +800,18 @@ function emitFunction_0($this, _this__u8e3s4, endpoint) {
|
|
|
800
800
|
// Inline function 'kotlin.text.orEmpty' call
|
|
801
801
|
var tmp0_elvis_lhs = tmp_4;
|
|
802
802
|
var tmp_5 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
803
|
-
var tmp_6 = Spacer_instance.
|
|
803
|
+
var tmp_6 = Spacer_instance.sv(2);
|
|
804
804
|
var tmp_7 = get_pathParams(endpoint);
|
|
805
805
|
var tmp_8 = joinToObject($this, tmp_7, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_0($this));
|
|
806
|
-
var tmp_9 = Spacer_instance.
|
|
807
|
-
var tmp_10 = endpoint.
|
|
808
|
-
var tmp_11 = Spacer_instance.
|
|
809
|
-
var tmp_12 = joinToObject($this, endpoint.
|
|
810
|
-
var tmp_13 = Spacer_instance.
|
|
811
|
-
var tmp_14 = joinToObject($this, endpoint.
|
|
812
|
-
var tmp_15 = Spacer_instance.
|
|
806
|
+
var tmp_9 = Spacer_instance.sv(2);
|
|
807
|
+
var tmp_10 = endpoint.gt_1.toString();
|
|
808
|
+
var tmp_11 = Spacer_instance.sv(2);
|
|
809
|
+
var tmp_12 = joinToObject($this, endpoint.it_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_1($this));
|
|
810
|
+
var tmp_13 = Spacer_instance.sv(2);
|
|
811
|
+
var tmp_14 = joinToObject($this, endpoint.jt_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_2($this));
|
|
812
|
+
var tmp_15 = Spacer_instance.sv(2);
|
|
813
813
|
var tmp_16;
|
|
814
|
-
if (_this__u8e3s4.
|
|
814
|
+
if (_this__u8e3s4.ot_1 == null) {
|
|
815
815
|
tmp_16 = null;
|
|
816
816
|
} else {
|
|
817
817
|
// Inline function 'kotlin.let' call
|
|
@@ -822,11 +822,11 @@ function emitFunction_0($this, _this__u8e3s4, endpoint) {
|
|
|
822
822
|
}
|
|
823
823
|
function emitFunction_1($this, _this__u8e3s4) {
|
|
824
824
|
var tmp = Spacer_instance.toString();
|
|
825
|
-
var tmp_0 = Companion_instance_0.
|
|
825
|
+
var tmp_0 = Companion_instance_0.pu(_this__u8e3s4.rt_1);
|
|
826
826
|
var tmp_1 = paramList_0(_this__u8e3s4);
|
|
827
827
|
var tmp_2 = joinToObject($this, tmp_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3($this));
|
|
828
828
|
var tmp_3 = Spacer_instance.toString();
|
|
829
|
-
var tmp_4 = Companion_instance_0.
|
|
829
|
+
var tmp_4 = Companion_instance_0.pu(_this__u8e3s4.rt_1);
|
|
830
830
|
// Inline function 'kotlin.takeIf' call
|
|
831
831
|
var this_0 = paramList_0(_this__u8e3s4);
|
|
832
832
|
var tmp_5;
|
|
@@ -841,19 +841,19 @@ function emitFunction_1($this, _this__u8e3s4) {
|
|
|
841
841
|
tmp_6 = null;
|
|
842
842
|
} else {
|
|
843
843
|
// Inline function 'kotlin.run' call
|
|
844
|
-
tmp_6 = 'params: Response' + Companion_instance_0.
|
|
844
|
+
tmp_6 = 'params: Response' + Companion_instance_0.pu(_this__u8e3s4.rt_1) + 'Params';
|
|
845
845
|
}
|
|
846
846
|
// Inline function 'kotlin.text.orEmpty' call
|
|
847
847
|
var tmp0_elvis_lhs = tmp_6;
|
|
848
848
|
var tmp_7 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
849
|
-
var tmp_8 = Companion_instance_0.
|
|
850
|
-
var tmp_9 = Spacer_instance.
|
|
851
|
-
var tmp_10 = fixStatus(_this__u8e3s4.
|
|
852
|
-
var tmp_11 = Spacer_instance.
|
|
853
|
-
var tmp_12 = joinToObject($this, _this__u8e3s4.
|
|
854
|
-
var tmp_13 = Spacer_instance.
|
|
849
|
+
var tmp_8 = Companion_instance_0.pu(_this__u8e3s4.rt_1);
|
|
850
|
+
var tmp_9 = Spacer_instance.sv(2);
|
|
851
|
+
var tmp_10 = fixStatus(_this__u8e3s4.rt_1);
|
|
852
|
+
var tmp_11 = Spacer_instance.sv(2);
|
|
853
|
+
var tmp_12 = joinToObject($this, _this__u8e3s4.st_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_4($this));
|
|
854
|
+
var tmp_13 = Spacer_instance.sv(2);
|
|
855
855
|
var tmp_14;
|
|
856
|
-
if (_this__u8e3s4.
|
|
856
|
+
if (_this__u8e3s4.tt_1 == null) {
|
|
857
857
|
tmp_14 = null;
|
|
858
858
|
} else {
|
|
859
859
|
// Inline function 'kotlin.let' call
|
|
@@ -863,60 +863,60 @@ function emitFunction_1($this, _this__u8e3s4) {
|
|
|
863
863
|
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 ');
|
|
864
864
|
}
|
|
865
865
|
function emitReference($this, _this__u8e3s4) {
|
|
866
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
867
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
868
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
866
|
+
var tmp0_safe_receiver = _this__u8e3s4.tt_1;
|
|
867
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.qt_1;
|
|
868
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.yt(tmp1_safe_receiver);
|
|
869
869
|
return tmp2_elvis_lhs == null ? 'undefined' : tmp2_elvis_lhs;
|
|
870
870
|
}
|
|
871
871
|
function emitPathArray($this, _this__u8e3s4) {
|
|
872
|
-
return joinToString(_this__u8e3s4.
|
|
872
|
+
return joinToString(_this__u8e3s4.ht_1, ', ', '[', ']', VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda($this));
|
|
873
873
|
}
|
|
874
874
|
function emitType_0($this, _this__u8e3s4) {
|
|
875
875
|
var tmp = Spacer_instance.toString();
|
|
876
876
|
var tmp_0 = emitName($this, _this__u8e3s4);
|
|
877
|
-
var tmp_1 = Spacer_instance.
|
|
878
|
-
var tmp_2 = fixStatus(_this__u8e3s4.
|
|
879
|
-
var tmp_3 = Spacer_instance.
|
|
880
|
-
return trimMargin('\n |' + tmp + 'export type ' + tmp_0 + ' = {\n |' + tmp_1 + 'status: ' + tmp_2 + '\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.
|
|
877
|
+
var tmp_1 = Spacer_instance.sv(2);
|
|
878
|
+
var tmp_2 = fixStatus(_this__u8e3s4.rt_1);
|
|
879
|
+
var tmp_3 = Spacer_instance.sv(2);
|
|
880
|
+
return trimMargin('\n |' + tmp + 'export type ' + tmp_0 + ' = {\n |' + tmp_1 + 'status: ' + tmp_2 + '\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.st_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitType$lambda_0($this)) + '}\n |' + Spacer_instance.sv(2) + 'body: ' + emitReference($this, _this__u8e3s4) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
881
881
|
}
|
|
882
882
|
function emitReference_0($this, _this__u8e3s4) {
|
|
883
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
884
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
885
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
883
|
+
var tmp0_safe_receiver = _this__u8e3s4.ot_1;
|
|
884
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.qt_1;
|
|
885
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.yt(tmp1_safe_receiver);
|
|
886
886
|
return tmp2_elvis_lhs == null ? 'undefined' : tmp2_elvis_lhs;
|
|
887
887
|
}
|
|
888
888
|
function emitType_1($this, _this__u8e3s4, endpoint) {
|
|
889
|
-
return trimMargin('\n |' + Spacer_instance.toString() + 'export type Request = {\n |' + Spacer_instance.
|
|
889
|
+
return trimMargin('\n |' + Spacer_instance.toString() + 'export type Request = {\n |' + Spacer_instance.sv(2) + 'path: Path\n |' + Spacer_instance.sv(2) + 'method: "' + endpoint.gt_1.toString() + '"\n |' + Spacer_instance.sv(2) + 'queries: Queries\n |' + Spacer_instance.sv(2) + 'headers: Headers\n |' + Spacer_instance.sv(2) + 'body: ' + emitReference_0($this, _this__u8e3s4) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
890
890
|
}
|
|
891
891
|
function emit_12($this, _this__u8e3s4) {
|
|
892
|
-
return Spacer_instance.toString() + $this.
|
|
892
|
+
return Spacer_instance.toString() + $this.yu(_this__u8e3s4.mt_1) + ': ' + $this.yt(_this__u8e3s4.nt_1);
|
|
893
893
|
}
|
|
894
894
|
function emit_13($this, _this__u8e3s4) {
|
|
895
|
-
return $this.
|
|
895
|
+
return $this.yu(_this__u8e3s4.ku_1) + (_this__u8e3s4.lu_1.ey() ? '?' : '') + ': ' + $this.yt(_this__u8e3s4.lu_1.gy(false));
|
|
896
896
|
}
|
|
897
897
|
function emitDeserialize($this, _this__u8e3s4) {
|
|
898
|
-
return $this.
|
|
898
|
+
return $this.yu(_this__u8e3s4.lf_1.mt_1) + ': serialization.deserialize(it.path[' + _this__u8e3s4.kf_1 + '])';
|
|
899
899
|
}
|
|
900
900
|
function emitDeserialize_0($this, _this__u8e3s4, fields, caseSensitive) {
|
|
901
|
-
return caseSensitive ? $this.
|
|
901
|
+
return caseSensitive ? $this.yu(_this__u8e3s4.bt_1) + ': serialization.deserialize(it.' + fields + '[' + $this.yu(_this__u8e3s4.bt_1) + '])' : $this.yu(_this__u8e3s4.bt_1) + ': serialization.deserialize(Object.entries(it.' + fields + ').find(([key]) => key.toLowerCase() === ' + $this.yu(lowercase($this, _this__u8e3s4.bt_1)) + ')?.[1])';
|
|
902
902
|
}
|
|
903
903
|
function emitDeserialize$default($this, _this__u8e3s4, fields, caseSensitive, $super) {
|
|
904
904
|
caseSensitive = caseSensitive === VOID ? true : caseSensitive;
|
|
905
905
|
return emitDeserialize_0($this, _this__u8e3s4, fields, caseSensitive);
|
|
906
906
|
}
|
|
907
907
|
function emitSerialize($this, _this__u8e3s4, fields) {
|
|
908
|
-
return $this.
|
|
908
|
+
return $this.yu(_this__u8e3s4.bt_1) + ': serialization.serialize(it.' + fields + '[' + $this.yu(_this__u8e3s4.bt_1) + '])';
|
|
909
909
|
}
|
|
910
910
|
function joinToObject($this, _this__u8e3s4, transform) {
|
|
911
911
|
return joinToString(_this__u8e3s4, ', ', '{', '}', VOID, VOID, transform);
|
|
912
912
|
}
|
|
913
913
|
function emitHandleFunction($this, endpoint) {
|
|
914
|
-
return Companion_instance_0.
|
|
914
|
+
return Companion_instance_0.qu($this.z23(endpoint.ft_1)) + ': (request:Request) => Promise<Response>';
|
|
915
915
|
}
|
|
916
916
|
function lowercase($this, _this__u8e3s4) {
|
|
917
917
|
// Inline function 'kotlin.text.lowercase' call
|
|
918
918
|
// Inline function 'kotlin.js.asDynamic' call
|
|
919
|
-
var tmp$ret$1 = _this__u8e3s4.
|
|
919
|
+
var tmp$ret$1 = _this__u8e3s4.m1().toLowerCase();
|
|
920
920
|
return new FieldIdentifier(tmp$ret$1);
|
|
921
921
|
}
|
|
922
922
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda(it) {
|
|
@@ -930,12 +930,12 @@ function TypeScriptEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
|
930
930
|
}
|
|
931
931
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
932
932
|
return function (it) {
|
|
933
|
-
return this$0.
|
|
933
|
+
return this$0.xt(it);
|
|
934
934
|
};
|
|
935
935
|
}
|
|
936
936
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
937
937
|
return function (it) {
|
|
938
|
-
return this$0.
|
|
938
|
+
return this$0.xt(it);
|
|
939
939
|
};
|
|
940
940
|
}
|
|
941
941
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
@@ -985,12 +985,12 @@ function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda(this$0) {
|
|
|
985
985
|
}
|
|
986
986
|
function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_0(this$0) {
|
|
987
987
|
return function (it) {
|
|
988
|
-
return prependIndent(emitDeserialize$default(this$0, it, 'queries'), Spacer_instance.
|
|
988
|
+
return prependIndent(emitDeserialize$default(this$0, it, 'queries'), Spacer_instance.sv(3));
|
|
989
989
|
};
|
|
990
990
|
}
|
|
991
991
|
function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_1(this$0) {
|
|
992
992
|
return function (it) {
|
|
993
|
-
return prependIndent(emitDeserialize_0(this$0, it, 'headers', false), Spacer_instance.
|
|
993
|
+
return prependIndent(emitDeserialize_0(this$0, it, 'headers', false), Spacer_instance.sv(3));
|
|
994
994
|
};
|
|
995
995
|
}
|
|
996
996
|
function TypeScriptEndpointDefinitionEmitter$emitServerTo$lambda(this$0) {
|
|
@@ -1005,7 +1005,7 @@ function TypeScriptEndpointDefinitionEmitter$emitServerToResponse$lambda(this$0)
|
|
|
1005
1005
|
}
|
|
1006
1006
|
function TypeScriptEndpointDefinitionEmitter$emitType$lambda($block) {
|
|
1007
1007
|
return function (it) {
|
|
1008
|
-
return Spacer_instance.
|
|
1008
|
+
return Spacer_instance.sv(1) + $block(it);
|
|
1009
1009
|
};
|
|
1010
1010
|
}
|
|
1011
1011
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda(this$0) {
|
|
@@ -1015,17 +1015,17 @@ function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda(this$0) {
|
|
|
1015
1015
|
}
|
|
1016
1016
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_0(this$0) {
|
|
1017
1017
|
return function (it) {
|
|
1018
|
-
return this$0.
|
|
1018
|
+
return this$0.yu(it.mt_1) + ': params[' + this$0.yu(it.mt_1) + ']';
|
|
1019
1019
|
};
|
|
1020
1020
|
}
|
|
1021
1021
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_1(this$0) {
|
|
1022
1022
|
return function (it) {
|
|
1023
|
-
return this$0.
|
|
1023
|
+
return this$0.yu(it.bt_1) + ': params[' + this$0.yu(it.bt_1) + ']';
|
|
1024
1024
|
};
|
|
1025
1025
|
}
|
|
1026
1026
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_2(this$0) {
|
|
1027
1027
|
return function (it) {
|
|
1028
|
-
return this$0.
|
|
1028
|
+
return this$0.yu(it.bt_1) + ': params[' + this$0.yu(it.bt_1) + ']';
|
|
1029
1029
|
};
|
|
1030
1030
|
}
|
|
1031
1031
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3(this$0) {
|
|
@@ -1035,17 +1035,17 @@ function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3(this$0) {
|
|
|
1035
1035
|
}
|
|
1036
1036
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_4(this$0) {
|
|
1037
1037
|
return function (it) {
|
|
1038
|
-
return this$0.
|
|
1038
|
+
return this$0.yu(it.bt_1) + ': params[' + this$0.yu(it.bt_1) + ']';
|
|
1039
1039
|
};
|
|
1040
1040
|
}
|
|
1041
1041
|
function TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda(this$0) {
|
|
1042
1042
|
return function (it) {
|
|
1043
1043
|
var tmp;
|
|
1044
1044
|
if (it instanceof Literal) {
|
|
1045
|
-
tmp = '"' + it.
|
|
1045
|
+
tmp = '"' + it.iu_1 + '"';
|
|
1046
1046
|
} else {
|
|
1047
1047
|
if (it instanceof Param) {
|
|
1048
|
-
tmp = 'serialization.serialize(it.path[' + this$0.
|
|
1048
|
+
tmp = 'serialization.serialize(it.path[' + this$0.yu(it.mt_1) + '])';
|
|
1049
1049
|
} else {
|
|
1050
1050
|
noWhenBranchMatchedException();
|
|
1051
1051
|
}
|
|
@@ -1055,7 +1055,7 @@ function TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda(this$0) {
|
|
|
1055
1055
|
}
|
|
1056
1056
|
function TypeScriptEndpointDefinitionEmitter$emitType$lambda_0(this$0) {
|
|
1057
1057
|
return function (it) {
|
|
1058
|
-
return this$0.
|
|
1058
|
+
return this$0.yu(it.bt_1) + ': ' + this$0.yt(it.ct_1);
|
|
1059
1059
|
};
|
|
1060
1060
|
}
|
|
1061
1061
|
function TypeScriptEndpointDefinitionEmitter() {
|
|
@@ -1068,21 +1068,21 @@ function TypeScriptEnumDefinitionEmitter() {
|
|
|
1068
1068
|
function TypeScriptIdentifierEmitter() {
|
|
1069
1069
|
}
|
|
1070
1070
|
function _get_sanitizationConfig__sns434($this) {
|
|
1071
|
-
var tmp0 = $this.
|
|
1071
|
+
var tmp0 = $this.i24_1;
|
|
1072
1072
|
var tmp = KProperty1;
|
|
1073
1073
|
// Inline function 'kotlin.getValue' call
|
|
1074
1074
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, TypeScriptIrEmitter$_get_sanitizationConfig_$ref_f6f0bh(), null);
|
|
1075
|
-
return tmp0.
|
|
1075
|
+
return tmp0.m1();
|
|
1076
1076
|
}
|
|
1077
1077
|
function _get_modelSanitizationConfig__vgg831($this) {
|
|
1078
|
-
var tmp0 = $this.
|
|
1078
|
+
var tmp0 = $this.j24_1;
|
|
1079
1079
|
var tmp = KProperty1;
|
|
1080
1080
|
// Inline function 'kotlin.getValue' call
|
|
1081
1081
|
getPropertyCallableRef('modelSanitizationConfig', 1, tmp, TypeScriptIrEmitter$_get_modelSanitizationConfig_$ref_ar2t88(), null);
|
|
1082
|
-
return tmp0.
|
|
1082
|
+
return tmp0.m1();
|
|
1083
1083
|
}
|
|
1084
1084
|
function sanitize($this, _this__u8e3s4) {
|
|
1085
|
-
return '"' + _this__u8e3s4.
|
|
1085
|
+
return '"' + _this__u8e3s4.m1() + '"';
|
|
1086
1086
|
}
|
|
1087
1087
|
function sanitizeSymbol_1($this, _this__u8e3s4) {
|
|
1088
1088
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1103,7 +1103,7 @@ function sanitizeSymbol_1($this, _this__u8e3s4) {
|
|
|
1103
1103
|
return destination.toString();
|
|
1104
1104
|
}
|
|
1105
1105
|
function sanitizeKeywords($this, _this__u8e3s4) {
|
|
1106
|
-
return Companion_getInstance_0().
|
|
1106
|
+
return Companion_getInstance_0().l24_1.v1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1107
1107
|
}
|
|
1108
1108
|
function firstToLower($this, _this__u8e3s4) {
|
|
1109
1109
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
@@ -1122,10 +1122,10 @@ function firstToLower($this, _this__u8e3s4) {
|
|
|
1122
1122
|
return tmp;
|
|
1123
1123
|
}
|
|
1124
1124
|
function sanitizeParamName($this, identifier) {
|
|
1125
|
-
var tmp0 = identifier.
|
|
1125
|
+
var tmp0 = identifier.m1();
|
|
1126
1126
|
// Inline function 'kotlin.text.split' call
|
|
1127
1127
|
// Inline function 'kotlin.collections.filter' call
|
|
1128
|
-
var tmp0_0 = Regex_init_$Create$('[.\\s-]+').
|
|
1128
|
+
var tmp0_0 = Regex_init_$Create$('[.\\s-]+').ad(tmp0, 0);
|
|
1129
1129
|
// Inline function 'kotlin.collections.filterTo' call
|
|
1130
1130
|
var destination = ArrayList_init_$Create$();
|
|
1131
1131
|
var _iterator__ex2g4s = tmp0_0.t();
|
|
@@ -1133,11 +1133,11 @@ function sanitizeParamName($this, identifier) {
|
|
|
1133
1133
|
var element = _iterator__ex2g4s.v();
|
|
1134
1134
|
// Inline function 'kotlin.text.isNotEmpty' call
|
|
1135
1135
|
if (charSequenceLength(element) > 0) {
|
|
1136
|
-
destination.
|
|
1136
|
+
destination.y(element);
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
1139
1139
|
var parts = destination;
|
|
1140
|
-
var name = parts.
|
|
1140
|
+
var name = parts.b1() > 1 ? (new Name(parts)).b1q() : identifier.m1();
|
|
1141
1141
|
return sanitizeKeywords($this, sanitizeSymbol_1($this, name));
|
|
1142
1142
|
}
|
|
1143
1143
|
function buildEndpointParams($this, endpoint) {
|
|
@@ -1146,50 +1146,50 @@ function buildEndpointParams($this, endpoint) {
|
|
|
1146
1146
|
// Inline function 'kotlin.apply' call
|
|
1147
1147
|
var this_0 = ArrayList_init_$Create$();
|
|
1148
1148
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1149
|
-
var tmp0 = endpoint.
|
|
1149
|
+
var tmp0 = endpoint.ht_1;
|
|
1150
1150
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1151
1151
|
var destination = ArrayList_init_$Create$();
|
|
1152
1152
|
var _iterator__ex2g4s = tmp0.t();
|
|
1153
1153
|
while (_iterator__ex2g4s.u()) {
|
|
1154
1154
|
var element = _iterator__ex2g4s.v();
|
|
1155
1155
|
if (element instanceof Param) {
|
|
1156
|
-
destination.
|
|
1156
|
+
destination.y(element);
|
|
1157
1157
|
}
|
|
1158
1158
|
}
|
|
1159
1159
|
// Inline function 'kotlin.collections.forEach' call
|
|
1160
1160
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1161
1161
|
while (_iterator__ex2g4s_0.u()) {
|
|
1162
1162
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
1163
|
-
this_0.
|
|
1163
|
+
this_0.y(new EndpointParam(sanitizeParamName($this, element_0.mt_1), emitTypeScriptReference($this, element_0.nt_1.gy(false)), element_0.nt_1.ey()));
|
|
1164
1164
|
}
|
|
1165
1165
|
// Inline function 'kotlin.collections.forEach' call
|
|
1166
|
-
var _iterator__ex2g4s_1 = endpoint.
|
|
1166
|
+
var _iterator__ex2g4s_1 = endpoint.it_1.t();
|
|
1167
1167
|
while (_iterator__ex2g4s_1.u()) {
|
|
1168
1168
|
var element_1 = _iterator__ex2g4s_1.v();
|
|
1169
|
-
this_0.
|
|
1169
|
+
this_0.y(new EndpointParam(sanitizeParamName($this, element_1.bt_1), emitTypeScriptReference($this, element_1.ct_1.gy(false)), element_1.ct_1.ey()));
|
|
1170
1170
|
}
|
|
1171
1171
|
// Inline function 'kotlin.collections.forEach' call
|
|
1172
|
-
var _iterator__ex2g4s_2 = endpoint.
|
|
1172
|
+
var _iterator__ex2g4s_2 = endpoint.jt_1.t();
|
|
1173
1173
|
while (_iterator__ex2g4s_2.u()) {
|
|
1174
1174
|
var element_2 = _iterator__ex2g4s_2.v();
|
|
1175
|
-
this_0.
|
|
1175
|
+
this_0.y(new EndpointParam(sanitizeParamName($this, element_2.bt_1), emitTypeScriptReference($this, element_2.ct_1.gy(false)), element_2.ct_1.ey()));
|
|
1176
1176
|
}
|
|
1177
|
-
var tmp0_safe_receiver = first(endpoint.
|
|
1177
|
+
var tmp0_safe_receiver = first(endpoint.kt_1).ot_1;
|
|
1178
1178
|
if (tmp0_safe_receiver == null)
|
|
1179
1179
|
null;
|
|
1180
1180
|
else {
|
|
1181
1181
|
// Inline function 'kotlin.let' call
|
|
1182
|
-
this_0.
|
|
1182
|
+
this_0.y(new EndpointParam('body', emitTypeScriptReference($this, tmp0_safe_receiver.qt_1.gy(false)), tmp0_safe_receiver.qt_1.ey()));
|
|
1183
1183
|
}
|
|
1184
|
-
return this_0.
|
|
1184
|
+
return this_0.p5();
|
|
1185
1185
|
}
|
|
1186
1186
|
function emitTypeScriptReference($this, ref) {
|
|
1187
1187
|
var tmp;
|
|
1188
1188
|
if (ref instanceof Dict) {
|
|
1189
|
-
tmp = 'Record<string, ' + emitTypeScriptReference($this, ref.
|
|
1189
|
+
tmp = 'Record<string, ' + emitTypeScriptReference($this, ref.ds_1) + '>';
|
|
1190
1190
|
} else {
|
|
1191
1191
|
if (ref instanceof Iterable) {
|
|
1192
|
-
tmp = emitTypeScriptReference($this, ref.
|
|
1192
|
+
tmp = emitTypeScriptReference($this, ref.as_1) + '[]';
|
|
1193
1193
|
} else {
|
|
1194
1194
|
if (ref instanceof Unit) {
|
|
1195
1195
|
tmp = 'undefined';
|
|
@@ -1198,10 +1198,10 @@ function emitTypeScriptReference($this, ref) {
|
|
|
1198
1198
|
tmp = 'any';
|
|
1199
1199
|
} else {
|
|
1200
1200
|
if (ref instanceof Custom) {
|
|
1201
|
-
tmp = sanitizeSymbol_1($this, ref.
|
|
1201
|
+
tmp = sanitizeSymbol_1($this, ref.my_1);
|
|
1202
1202
|
} else {
|
|
1203
1203
|
if (ref instanceof Primitive) {
|
|
1204
|
-
var tmp1_subject = ref.
|
|
1204
|
+
var tmp1_subject = ref.qy_1;
|
|
1205
1205
|
var tmp_0;
|
|
1206
1206
|
if (tmp1_subject instanceof String_0) {
|
|
1207
1207
|
tmp_0 = 'string';
|
|
@@ -1234,20 +1234,20 @@ function emitTypeScriptReference($this, ref) {
|
|
|
1234
1234
|
}
|
|
1235
1235
|
}
|
|
1236
1236
|
// Inline function 'kotlin.let' call
|
|
1237
|
-
return tmp + (ref.
|
|
1237
|
+
return tmp + (ref.ey() ? ' | undefined' : '');
|
|
1238
1238
|
}
|
|
1239
1239
|
function EndpointParam(name, type, nullable) {
|
|
1240
|
-
this.
|
|
1241
|
-
this.
|
|
1242
|
-
this.
|
|
1240
|
+
this.m24_1 = name;
|
|
1241
|
+
this.n24_1 = type;
|
|
1242
|
+
this.o24_1 = nullable;
|
|
1243
1243
|
}
|
|
1244
1244
|
protoOf(EndpointParam).toString = function () {
|
|
1245
|
-
return 'EndpointParam(name=' + this.
|
|
1245
|
+
return 'EndpointParam(name=' + this.m24_1 + ', type=' + this.n24_1 + ', nullable=' + this.o24_1 + ')';
|
|
1246
1246
|
};
|
|
1247
1247
|
protoOf(EndpointParam).hashCode = function () {
|
|
1248
|
-
var result = getStringHashCode(this.
|
|
1249
|
-
result = imul(result, 31) + getStringHashCode(this.
|
|
1250
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
1248
|
+
var result = getStringHashCode(this.m24_1);
|
|
1249
|
+
result = imul(result, 31) + getStringHashCode(this.n24_1) | 0;
|
|
1250
|
+
result = imul(result, 31) + getBooleanHashCode(this.o24_1) | 0;
|
|
1251
1251
|
return result;
|
|
1252
1252
|
};
|
|
1253
1253
|
protoOf(EndpointParam).equals = function (other) {
|
|
@@ -1255,11 +1255,11 @@ protoOf(EndpointParam).equals = function (other) {
|
|
|
1255
1255
|
return true;
|
|
1256
1256
|
if (!(other instanceof EndpointParam))
|
|
1257
1257
|
return false;
|
|
1258
|
-
if (!(this.
|
|
1258
|
+
if (!(this.m24_1 === other.m24_1))
|
|
1259
1259
|
return false;
|
|
1260
|
-
if (!(this.
|
|
1260
|
+
if (!(this.n24_1 === other.n24_1))
|
|
1261
1261
|
return false;
|
|
1262
|
-
if (!(this.
|
|
1262
|
+
if (!(this.o24_1 === other.o24_1))
|
|
1263
1263
|
return false;
|
|
1264
1264
|
return true;
|
|
1265
1265
|
};
|
|
@@ -1276,10 +1276,10 @@ function Companion() {
|
|
|
1276
1276
|
// Inline function 'kotlin.text.lowercase' call
|
|
1277
1277
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1278
1278
|
var tmp$ret$2 = removePrefix(element, 'GeneratorField').toLowerCase();
|
|
1279
|
-
result.
|
|
1279
|
+
result.t2(element, tmp$ret$2);
|
|
1280
1280
|
}
|
|
1281
|
-
tmp.
|
|
1282
|
-
this.
|
|
1281
|
+
tmp.k24_1 = result;
|
|
1282
|
+
this.l24_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']);
|
|
1283
1283
|
}
|
|
1284
1284
|
var Companion_instance_1;
|
|
1285
1285
|
function Companion_getInstance_0() {
|
|
@@ -1292,13 +1292,13 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
1292
1292
|
}
|
|
1293
1293
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1294
1294
|
return function (name) {
|
|
1295
|
-
var sanitized = name.
|
|
1295
|
+
var sanitized = name.w1k_1.b1() > 1 ? name.b1q() : sanitizeSymbol_1(this$0, name.u1m());
|
|
1296
1296
|
return new Name(listOf_0(sanitized));
|
|
1297
1297
|
};
|
|
1298
1298
|
}
|
|
1299
1299
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0) {
|
|
1300
1300
|
return function (name) {
|
|
1301
|
-
var sanitized = name.
|
|
1301
|
+
var sanitized = name.w1k_1.b1() > 1 ? name.b1q() : sanitizeSymbol_1(this$0, name.u1m());
|
|
1302
1302
|
return new Name(listOf_0(sanitized));
|
|
1303
1303
|
};
|
|
1304
1304
|
}
|
|
@@ -1324,29 +1324,29 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0)
|
|
|
1324
1324
|
return function (stmt, tr) {
|
|
1325
1325
|
var tmp;
|
|
1326
1326
|
if (stmt instanceof VariableReference) {
|
|
1327
|
-
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
1327
|
+
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.v1s_1));
|
|
1328
1328
|
} else {
|
|
1329
1329
|
if (stmt instanceof ConstructorStatement) {
|
|
1330
|
-
var tmp_0 = tr.
|
|
1330
|
+
var tmp_0 = tr.j1y(stmt.d1r_1);
|
|
1331
1331
|
// Inline function 'kotlin.collections.map' call
|
|
1332
|
-
var this_0 = stmt.
|
|
1332
|
+
var this_0 = stmt.e1r_1;
|
|
1333
1333
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1334
|
-
var destination = ArrayList_init_$Create$_0(this_0.
|
|
1334
|
+
var destination = ArrayList_init_$Create$_0(this_0.b1());
|
|
1335
1335
|
// Inline function 'kotlin.collections.iterator' call
|
|
1336
|
-
var _iterator__ex2g4s = this_0.
|
|
1336
|
+
var _iterator__ex2g4s = this_0.k1().t();
|
|
1337
1337
|
while (_iterator__ex2g4s.u()) {
|
|
1338
1338
|
var item = _iterator__ex2g4s.v();
|
|
1339
1339
|
// Inline function 'kotlin.collections.component1' call
|
|
1340
|
-
var key = item.
|
|
1340
|
+
var key = item.l1();
|
|
1341
1341
|
// Inline function 'kotlin.collections.component2' call
|
|
1342
|
-
var value = item.
|
|
1343
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.
|
|
1344
|
-
destination.
|
|
1342
|
+
var value = item.m1();
|
|
1343
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.m1y(value));
|
|
1344
|
+
destination.y(tmp$ret$3);
|
|
1345
1345
|
}
|
|
1346
1346
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
1347
1347
|
} else {
|
|
1348
1348
|
if (stmt instanceof Assignment) {
|
|
1349
|
-
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
1349
|
+
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.y1s_1), tr.m1y(stmt.z1s_1), stmt.a1t_1);
|
|
1350
1350
|
} else {
|
|
1351
1351
|
tmp = transformChildren(stmt, tr);
|
|
1352
1352
|
}
|
|
@@ -1357,7 +1357,7 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0)
|
|
|
1357
1357
|
}
|
|
1358
1358
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1359
1359
|
return function () {
|
|
1360
|
-
var tmp0_reservedKeywords = Companion_getInstance_0().
|
|
1360
|
+
var tmp0_reservedKeywords = Companion_getInstance_0().l24_1;
|
|
1361
1361
|
var tmp = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1362
1362
|
var tmp_0 = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
|
|
1363
1363
|
var tmp_1 = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
|
|
@@ -1371,7 +1371,7 @@ function TypeScriptIrEmitter$_get_sanitizationConfig_$ref_f6f0bh() {
|
|
|
1371
1371
|
};
|
|
1372
1372
|
}
|
|
1373
1373
|
function TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda$lambda(name) {
|
|
1374
|
-
return new Name(listOf_0(name.
|
|
1374
|
+
return new Name(listOf_0(name.u1m()));
|
|
1375
1375
|
}
|
|
1376
1376
|
function TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda$lambda_0(it) {
|
|
1377
1377
|
return it;
|
|
@@ -1380,7 +1380,7 @@ function TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda(this$0) {
|
|
|
1380
1380
|
return function () {
|
|
1381
1381
|
var tmp = _get_sanitizationConfig__sns434(this$0);
|
|
1382
1382
|
var tmp_0 = TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda$lambda;
|
|
1383
|
-
return tmp.
|
|
1383
|
+
return tmp.c20(VOID, VOID, tmp_0, VOID, TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda$lambda_0);
|
|
1384
1384
|
};
|
|
1385
1385
|
}
|
|
1386
1386
|
function TypeScriptIrEmitter$_get_modelSanitizationConfig_$ref_ar2t88() {
|
|
@@ -1391,11 +1391,11 @@ function TypeScriptIrEmitter$_get_modelSanitizationConfig_$ref_ar2t88() {
|
|
|
1391
1391
|
function TypeScriptIrEmitter$emitShared$lambda(element, transformer) {
|
|
1392
1392
|
var tmp;
|
|
1393
1393
|
if (element instanceof Namespace) {
|
|
1394
|
-
var injected = element.
|
|
1394
|
+
var injected = element.m1r_1.equals(Companion_getInstance().y1k('Wirespec')) ? listOf_0(new RawElement('export type Type = string')) : emptyList();
|
|
1395
1395
|
var tmp_0;
|
|
1396
1396
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1397
1397
|
if (!injected.r()) {
|
|
1398
|
-
tmp_0 = withElements(element, plus_1(injected, element.
|
|
1398
|
+
tmp_0 = withElements(element, plus_1(injected, element.i1r()));
|
|
1399
1399
|
} else {
|
|
1400
1400
|
tmp_0 = element;
|
|
1401
1401
|
}
|
|
@@ -1410,11 +1410,11 @@ function TypeScriptIrEmitter$emitShared$lambda_0($api) {
|
|
|
1410
1410
|
return function (element, transformer) {
|
|
1411
1411
|
var tmp;
|
|
1412
1412
|
if (element instanceof Namespace) {
|
|
1413
|
-
var injected = element.
|
|
1413
|
+
var injected = element.m1r_1.equals(Companion_getInstance().y1k('Wirespec')) ? listOf_0(new RawElement($api)) : emptyList();
|
|
1414
1414
|
var tmp_0;
|
|
1415
1415
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1416
1416
|
if (!injected.r()) {
|
|
1417
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1417
|
+
tmp_0 = withElements(element, plus_1(element.i1r(), injected));
|
|
1418
1418
|
} else {
|
|
1419
1419
|
tmp_0 = element;
|
|
1420
1420
|
}
|
|
@@ -1429,13 +1429,13 @@ function TypeScriptIrEmitter$emitShared$lambda_0($api) {
|
|
|
1429
1429
|
function TypeScriptIrEmitter$emitShared$lambda_1(element, transformer) {
|
|
1430
1430
|
var tmp;
|
|
1431
1431
|
if (element instanceof Struct) {
|
|
1432
|
-
var tmp0_safe_receiver = Companion_getInstance_0().
|
|
1432
|
+
var tmp0_safe_receiver = Companion_getInstance_0().k24_1.q2(element.r1r_1.u1m());
|
|
1433
1433
|
var tmp_0;
|
|
1434
1434
|
if (tmp0_safe_receiver == null) {
|
|
1435
1435
|
tmp_0 = null;
|
|
1436
1436
|
} else {
|
|
1437
1437
|
// Inline function 'kotlin.let' call
|
|
1438
|
-
tmp_0 = element.
|
|
1438
|
+
tmp_0 = element.y1r(VOID, plus_1(listOf_0(new Field(Companion_getInstance().y1k('kind'), new StringLiteral(tmp0_safe_receiver))), element.s1r_1));
|
|
1439
1439
|
}
|
|
1440
1440
|
var tmp1_elvis_lhs = tmp_0;
|
|
1441
1441
|
tmp = tmp1_elvis_lhs == null ? element : tmp1_elvis_lhs;
|
|
@@ -1446,7 +1446,7 @@ function TypeScriptIrEmitter$emitShared$lambda_1(element, transformer) {
|
|
|
1446
1446
|
return transformChildren_0(transformed, transformer);
|
|
1447
1447
|
}
|
|
1448
1448
|
function TypeScriptIrEmitter$emit$lambda(it) {
|
|
1449
|
-
return 'export {' + it.
|
|
1449
|
+
return 'export {' + it.xu().m1() + "} from './" + it.xu().m1() + "'";
|
|
1450
1450
|
}
|
|
1451
1451
|
function TypeScriptIrEmitter$emitGenerator$lambda($definition) {
|
|
1452
1452
|
return function (expr, t) {
|
|
@@ -1455,24 +1455,24 @@ function TypeScriptIrEmitter$emitGenerator$lambda($definition) {
|
|
|
1455
1455
|
var tmp_1;
|
|
1456
1456
|
var tmp_2;
|
|
1457
1457
|
if (expr instanceof FunctionCall) {
|
|
1458
|
-
var tmp_3 = expr.
|
|
1458
|
+
var tmp_3 = expr.j1q_1;
|
|
1459
1459
|
tmp_2 = tmp_3 instanceof RawExpression;
|
|
1460
1460
|
} else {
|
|
1461
1461
|
tmp_2 = false;
|
|
1462
1462
|
}
|
|
1463
1463
|
if (tmp_2) {
|
|
1464
|
-
var tmp_4 = expr.
|
|
1465
|
-
tmp_1 = (tmp_4 instanceof RawExpression ? tmp_4 : THROW_CCE()).
|
|
1464
|
+
var tmp_4 = expr.j1q_1;
|
|
1465
|
+
tmp_1 = (tmp_4 instanceof RawExpression ? tmp_4 : THROW_CCE()).x1s_1 === $definition.iv_1.m1();
|
|
1466
1466
|
} else {
|
|
1467
1467
|
tmp_1 = false;
|
|
1468
1468
|
}
|
|
1469
1469
|
if (tmp_1) {
|
|
1470
|
-
tmp_0 = expr.
|
|
1470
|
+
tmp_0 = expr.l1q_1.equals(Companion_getInstance().y1k('valueOf'));
|
|
1471
1471
|
} else {
|
|
1472
1472
|
tmp_0 = false;
|
|
1473
1473
|
}
|
|
1474
1474
|
if (tmp_0) {
|
|
1475
|
-
var tmp0_elvis_lhs = expr.
|
|
1475
|
+
var tmp0_elvis_lhs = expr.m1q_1.q2(Companion_getInstance().y1k('label'));
|
|
1476
1476
|
tmp = tmp0_elvis_lhs == null ? expr : tmp0_elvis_lhs;
|
|
1477
1477
|
} else {
|
|
1478
1478
|
tmp = transformChildren_1(expr, t);
|
|
@@ -1485,12 +1485,12 @@ function TypeScriptIrEmitter$emitGenerator$lambda_0($definition) {
|
|
|
1485
1485
|
var tmp;
|
|
1486
1486
|
var tmp_0;
|
|
1487
1487
|
if (expr instanceof ConstructorStatement) {
|
|
1488
|
-
tmp_0 = equals(expr.
|
|
1488
|
+
tmp_0 = equals(expr.d1r_1, Custom_init_$Create$($definition.dv_1.m1()));
|
|
1489
1489
|
} else {
|
|
1490
1490
|
tmp_0 = false;
|
|
1491
1491
|
}
|
|
1492
1492
|
if (tmp_0) {
|
|
1493
|
-
var tmp0_elvis_lhs = expr.
|
|
1493
|
+
var tmp0_elvis_lhs = expr.e1r_1.q2(Companion_getInstance().y1k('value'));
|
|
1494
1494
|
tmp = tmp0_elvis_lhs == null ? expr : tmp0_elvis_lhs;
|
|
1495
1495
|
} else {
|
|
1496
1496
|
tmp = transformChildren_1(expr, t);
|
|
@@ -1501,37 +1501,37 @@ function TypeScriptIrEmitter$emitGenerator$lambda_0($definition) {
|
|
|
1501
1501
|
function TypeScriptIrEmitter$emitGenerator$lambda_1(expr, t) {
|
|
1502
1502
|
var tmp;
|
|
1503
1503
|
if (expr instanceof ConstructorStatement) {
|
|
1504
|
-
var tmp_0 = expr.
|
|
1504
|
+
var tmp_0 = expr.d1r_1;
|
|
1505
1505
|
var tmp0_safe_receiver = tmp_0 instanceof Custom_0 ? tmp_0 : null;
|
|
1506
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1507
|
-
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
1506
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.s1m_1;
|
|
1507
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.u1m();
|
|
1508
1508
|
var typeName = tmp2_safe_receiver == null ? null : removePrefix(tmp2_safe_receiver, 'Wirespec.');
|
|
1509
1509
|
var tmp_1;
|
|
1510
1510
|
if (typeName == null) {
|
|
1511
1511
|
tmp_1 = null;
|
|
1512
1512
|
} else {
|
|
1513
1513
|
// Inline function 'kotlin.let' call
|
|
1514
|
-
tmp_1 = Companion_getInstance_0().
|
|
1514
|
+
tmp_1 = Companion_getInstance_0().k24_1.q2(typeName);
|
|
1515
1515
|
}
|
|
1516
1516
|
var kind = tmp_1;
|
|
1517
1517
|
var tmp_2;
|
|
1518
1518
|
if (!(kind == null)) {
|
|
1519
|
-
var tmp_3 = mapOf(to(Companion_getInstance().
|
|
1519
|
+
var tmp_3 = mapOf(to(Companion_getInstance().y1k('kind'), new Literal_0(kind, String_instance)));
|
|
1520
1520
|
// Inline function 'kotlin.collections.mapValues' call
|
|
1521
|
-
var this_0 = expr.
|
|
1521
|
+
var this_0 = expr.e1r_1;
|
|
1522
1522
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
1523
|
-
var destination = LinkedHashMap_init_$Create$_0(mapCapacity(this_0.
|
|
1523
|
+
var destination = LinkedHashMap_init_$Create$_0(mapCapacity(this_0.b1()));
|
|
1524
1524
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
1525
|
-
var _iterator__ex2g4s = this_0.
|
|
1525
|
+
var _iterator__ex2g4s = this_0.k1().t();
|
|
1526
1526
|
while (_iterator__ex2g4s.u()) {
|
|
1527
1527
|
var element = _iterator__ex2g4s.v();
|
|
1528
|
-
var tmp_4 = element.
|
|
1528
|
+
var tmp_4 = element.l1();
|
|
1529
1529
|
// Inline function 'kotlin.collections.component2' call
|
|
1530
|
-
var v = element.
|
|
1531
|
-
var tmp$ret$4 = t.
|
|
1532
|
-
destination.
|
|
1530
|
+
var v = element.m1();
|
|
1531
|
+
var tmp$ret$4 = t.m1y(v);
|
|
1532
|
+
destination.t2(tmp_4, tmp$ret$4);
|
|
1533
1533
|
}
|
|
1534
|
-
tmp_2 = new ConstructorStatement(expr.
|
|
1534
|
+
tmp_2 = new ConstructorStatement(expr.d1r_1, plus_2(tmp_3, destination));
|
|
1535
1535
|
} else {
|
|
1536
1536
|
tmp_2 = transformChildren(expr, t);
|
|
1537
1537
|
}
|
|
@@ -1558,17 +1558,17 @@ function TypeScriptIrEmitter$emitGenerator$lambda_5($generatorOwnName, $generato
|
|
|
1558
1558
|
var tmp_0;
|
|
1559
1559
|
var tmp_1;
|
|
1560
1560
|
if (expr instanceof RawExpression) {
|
|
1561
|
-
tmp_1 = endsWith(expr.
|
|
1561
|
+
tmp_1 = endsWith(expr.x1s_1, 'Generator');
|
|
1562
1562
|
} else {
|
|
1563
1563
|
tmp_1 = false;
|
|
1564
1564
|
}
|
|
1565
1565
|
if (tmp_1) {
|
|
1566
|
-
tmp_0 = !(expr.
|
|
1566
|
+
tmp_0 = !(expr.x1s_1 === $generatorOwnName);
|
|
1567
1567
|
} else {
|
|
1568
1568
|
tmp_0 = false;
|
|
1569
1569
|
}
|
|
1570
1570
|
if (tmp_0) {
|
|
1571
|
-
$generatorRefs.
|
|
1571
|
+
$generatorRefs.y(expr.x1s_1);
|
|
1572
1572
|
tmp = Unit_instance;
|
|
1573
1573
|
}
|
|
1574
1574
|
return transformChildren_1(expr, t);
|
|
@@ -1582,7 +1582,7 @@ function TypeScriptIrEmitter$emit$injectApiConst$lambda($endpoint) {
|
|
|
1582
1582
|
var tmp_0;
|
|
1583
1583
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1584
1584
|
if (!injected.r()) {
|
|
1585
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1585
|
+
tmp_0 = withElements(element, plus_1(element.i1r(), injected));
|
|
1586
1586
|
} else {
|
|
1587
1587
|
tmp_0 = element;
|
|
1588
1588
|
}
|
|
@@ -1601,14 +1601,14 @@ function emit$injectApiConst(_this__u8e3s4, $endpoint) {
|
|
|
1601
1601
|
var tmp = scope;
|
|
1602
1602
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1603
1603
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1604
|
-
var this_0 = scope.
|
|
1604
|
+
var this_0 = scope.r1y_1;
|
|
1605
1605
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1606
1606
|
// Inline function 'kotlin.apply' call
|
|
1607
1607
|
var this_1 = new TransformerBuilder();
|
|
1608
|
-
this_1.
|
|
1609
|
-
var tmp$ret$2 = this_1.
|
|
1610
|
-
tmp.
|
|
1611
|
-
var tmp_0 = scope.
|
|
1608
|
+
this_1.i1m(TypeScriptIrEmitter$emit$injectApiConst$lambda($endpoint));
|
|
1609
|
+
var tmp$ret$2 = this_1.j1m();
|
|
1610
|
+
tmp.r1y_1 = transform(this_0, tmp$ret$2);
|
|
1611
|
+
var tmp_0 = scope.r1y_1;
|
|
1612
1612
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1613
1613
|
}
|
|
1614
1614
|
function emit$applyCallParamsIfNeeded(_this__u8e3s4, hasRequestParams) {
|
|
@@ -1616,27 +1616,27 @@ function emit$applyCallParamsIfNeeded(_this__u8e3s4, hasRequestParams) {
|
|
|
1616
1616
|
}
|
|
1617
1617
|
function TypeScriptIrEmitter$emitClient$lambda(this$0) {
|
|
1618
1618
|
return function (it) {
|
|
1619
|
-
var methodName = firstToLower(this$0, it.
|
|
1619
|
+
var methodName = firstToLower(this$0, it.ft_1.m1());
|
|
1620
1620
|
return ' ...' + methodName + 'Client(serialization, transportation),';
|
|
1621
1621
|
};
|
|
1622
1622
|
}
|
|
1623
1623
|
function TypeScriptIrEmitter() {
|
|
1624
1624
|
Companion_getInstance_0();
|
|
1625
|
-
this.
|
|
1626
|
-
this.
|
|
1625
|
+
this.g24_1 = TypeScriptGenerator_getInstance();
|
|
1626
|
+
this.h24_1 = FileExtension_TypeScript_getInstance();
|
|
1627
1627
|
var tmp = this;
|
|
1628
|
-
tmp.
|
|
1628
|
+
tmp.i24_1 = lazy(TypeScriptIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1629
1629
|
var tmp_0 = this;
|
|
1630
|
-
tmp_0.
|
|
1630
|
+
tmp_0.j24_1 = lazy(TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda(this));
|
|
1631
1631
|
}
|
|
1632
|
-
protoOf(TypeScriptIrEmitter).
|
|
1633
|
-
return this.
|
|
1632
|
+
protoOf(TypeScriptIrEmitter).e1z = function () {
|
|
1633
|
+
return this.g24_1;
|
|
1634
1634
|
};
|
|
1635
|
-
protoOf(TypeScriptIrEmitter).
|
|
1636
|
-
return this.
|
|
1635
|
+
protoOf(TypeScriptIrEmitter).fu = function () {
|
|
1636
|
+
return this.h24_1;
|
|
1637
1637
|
};
|
|
1638
|
-
protoOf(TypeScriptIrEmitter).
|
|
1639
|
-
var packageName = Companion_instance.
|
|
1638
|
+
protoOf(TypeScriptIrEmitter).h1z = function () {
|
|
1639
|
+
var packageName = Companion_instance.nv('community.flock.wirespec');
|
|
1640
1640
|
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}';
|
|
1641
1641
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1642
1642
|
var this_0 = convert(packageName);
|
|
@@ -1645,41 +1645,41 @@ protoOf(TypeScriptIrEmitter).v1v = function () {
|
|
|
1645
1645
|
var tmp = scope;
|
|
1646
1646
|
// Inline function 'community.flock.wirespec.ir.core.injectBefore' call
|
|
1647
1647
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1648
|
-
var this_1 = scope.
|
|
1648
|
+
var this_1 = scope.r1y_1;
|
|
1649
1649
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1650
1650
|
// Inline function 'kotlin.apply' call
|
|
1651
1651
|
var this_2 = new TransformerBuilder();
|
|
1652
|
-
this_2.
|
|
1653
|
-
var tmp$ret$2 = this_2.
|
|
1654
|
-
tmp.
|
|
1652
|
+
this_2.i1m(TypeScriptIrEmitter$emitShared$lambda);
|
|
1653
|
+
var tmp$ret$2 = this_2.j1m();
|
|
1654
|
+
tmp.r1y_1 = transform(this_1, tmp$ret$2);
|
|
1655
1655
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1656
1656
|
var tmp_0 = scope;
|
|
1657
1657
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1658
1658
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1659
|
-
var this_3 = scope.
|
|
1659
|
+
var this_3 = scope.r1y_1;
|
|
1660
1660
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1661
1661
|
// Inline function 'kotlin.apply' call
|
|
1662
1662
|
var this_4 = new TransformerBuilder();
|
|
1663
|
-
this_4.
|
|
1664
|
-
var tmp$ret$8 = this_4.
|
|
1665
|
-
tmp_0.
|
|
1663
|
+
this_4.i1m(TypeScriptIrEmitter$emitShared$lambda_0(api));
|
|
1664
|
+
var tmp$ret$8 = this_4.j1m();
|
|
1665
|
+
tmp_0.r1y_1 = transform(this_3, tmp$ret$8);
|
|
1666
1666
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1667
1667
|
var tmp_1 = scope;
|
|
1668
1668
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1669
|
-
var this_5 = scope.
|
|
1669
|
+
var this_5 = scope.r1y_1;
|
|
1670
1670
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1671
1671
|
// Inline function 'kotlin.apply' call
|
|
1672
1672
|
var this_6 = new TransformerBuilder();
|
|
1673
|
-
this_6.
|
|
1674
|
-
var tmp$ret$14 = this_6.
|
|
1675
|
-
tmp_1.
|
|
1676
|
-
var tmp_2 = scope.
|
|
1673
|
+
this_6.i1m(TypeScriptIrEmitter$emitShared$lambda_1);
|
|
1674
|
+
var tmp$ret$14 = this_6.j1m();
|
|
1675
|
+
tmp_1.r1y_1 = transform(this_5, tmp$ret$14);
|
|
1676
|
+
var tmp_2 = scope.r1y_1;
|
|
1677
1677
|
return isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1678
1678
|
};
|
|
1679
|
-
protoOf(TypeScriptIrEmitter).
|
|
1679
|
+
protoOf(TypeScriptIrEmitter).pr = function (ast, logger) {
|
|
1680
1680
|
var tmp = emit.call(this, ast, logger);
|
|
1681
1681
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
1682
|
-
var this_0 = ast.
|
|
1682
|
+
var this_0 = ast.cu_1;
|
|
1683
1683
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1684
1684
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
1685
1685
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -1687,7 +1687,7 @@ protoOf(TypeScriptIrEmitter).eo = function (ast, logger) {
|
|
|
1687
1687
|
var _iterator__ex2g4s = tmp0.t();
|
|
1688
1688
|
while (_iterator__ex2g4s.u()) {
|
|
1689
1689
|
var element = _iterator__ex2g4s.v();
|
|
1690
|
-
var list = new NonEmptyList(element.
|
|
1690
|
+
var list = new NonEmptyList(element.eu_1);
|
|
1691
1691
|
addAll(destination, list);
|
|
1692
1692
|
}
|
|
1693
1693
|
var tmp$ret$3 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -1700,41 +1700,41 @@ protoOf(TypeScriptIrEmitter).eo = function (ast, logger) {
|
|
|
1700
1700
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
1701
1701
|
var key = namespace(element_0);
|
|
1702
1702
|
// Inline function 'kotlin.collections.getOrPut' call
|
|
1703
|
-
var value = destination_0.
|
|
1703
|
+
var value = destination_0.q2(key);
|
|
1704
1704
|
var tmp_0;
|
|
1705
1705
|
if (value == null) {
|
|
1706
1706
|
var answer = ArrayList_init_$Create$();
|
|
1707
|
-
destination_0.
|
|
1707
|
+
destination_0.t2(key, answer);
|
|
1708
1708
|
tmp_0 = answer;
|
|
1709
1709
|
} else {
|
|
1710
1710
|
tmp_0 = value;
|
|
1711
1711
|
}
|
|
1712
1712
|
var list_0 = tmp_0;
|
|
1713
|
-
list_0.
|
|
1713
|
+
list_0.y(element_0);
|
|
1714
1714
|
}
|
|
1715
1715
|
// Inline function 'kotlin.collections.map' call
|
|
1716
1716
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1717
|
-
var destination_1 = ArrayList_init_$Create$_0(destination_0.
|
|
1717
|
+
var destination_1 = ArrayList_init_$Create$_0(destination_0.b1());
|
|
1718
1718
|
// Inline function 'kotlin.collections.iterator' call
|
|
1719
|
-
var _iterator__ex2g4s_1 = destination_0.
|
|
1719
|
+
var _iterator__ex2g4s_1 = destination_0.k1().t();
|
|
1720
1720
|
while (_iterator__ex2g4s_1.u()) {
|
|
1721
1721
|
var item = _iterator__ex2g4s_1.v();
|
|
1722
1722
|
// Inline function 'kotlin.collections.component1' call
|
|
1723
|
-
var ns = item.
|
|
1723
|
+
var ns = item.l1();
|
|
1724
1724
|
// Inline function 'kotlin.collections.component2' call
|
|
1725
|
-
var defs = item.
|
|
1726
|
-
var tmp_1 = ns + '/index.' + this.
|
|
1725
|
+
var defs = item.m1();
|
|
1726
|
+
var tmp_1 = ns + '/index.' + this.fu().ou_1;
|
|
1727
1727
|
var tmp$ret$12 = new Emitted(tmp_1, joinToString(defs, '\n', VOID, VOID, VOID, VOID, TypeScriptIrEmitter$emit$lambda));
|
|
1728
|
-
destination_1.
|
|
1728
|
+
destination_1.y(tmp$ret$12);
|
|
1729
1729
|
}
|
|
1730
1730
|
return NonEmptyList__plus_impl_xqmb9_0(tmp, destination_1);
|
|
1731
1731
|
};
|
|
1732
|
-
protoOf(TypeScriptIrEmitter).
|
|
1732
|
+
protoOf(TypeScriptIrEmitter).wu = function (definition, module_0, logger) {
|
|
1733
1733
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1734
|
-
var subPackageName = plus(Companion_instance.
|
|
1735
|
-
return new File(Companion_getInstance().
|
|
1734
|
+
var subPackageName = plus(Companion_instance.nv(''), definition);
|
|
1735
|
+
return new File(Companion_getInstance().y1k(subPackageName.qv() + sanitizeSymbol_1(this, file.g1r_1.z1k())), plus_1(listOf_0(import_0('../Wirespec', 'Wirespec')), file.h1r_1));
|
|
1736
1736
|
};
|
|
1737
|
-
protoOf(TypeScriptIrEmitter).
|
|
1737
|
+
protoOf(TypeScriptIrEmitter).l1z = function (definition, module_0) {
|
|
1738
1738
|
var tmp;
|
|
1739
1739
|
if (definition instanceof Type) {
|
|
1740
1740
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1743,16 +1743,16 @@ protoOf(TypeScriptIrEmitter).z1v = function (definition, module_0) {
|
|
|
1743
1743
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1744
1744
|
var this_0 = convertToGenerator_1(definition);
|
|
1745
1745
|
var scope = new TransformScope(this_0);
|
|
1746
|
-
scope.
|
|
1747
|
-
var tmp_0 = scope.
|
|
1746
|
+
scope.z1y(TypeScriptIrEmitter$emitGenerator$lambda(definition));
|
|
1747
|
+
var tmp_0 = scope.r1y_1;
|
|
1748
1748
|
tmp = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1749
1749
|
} else {
|
|
1750
1750
|
if (definition instanceof Refined) {
|
|
1751
1751
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1752
1752
|
var this_1 = convertToGenerator_0(definition);
|
|
1753
1753
|
var scope_0 = new TransformScope(this_1);
|
|
1754
|
-
scope_0.
|
|
1755
|
-
var tmp_1 = scope_0.
|
|
1754
|
+
scope_0.z1y(TypeScriptIrEmitter$emitGenerator$lambda_0(definition));
|
|
1755
|
+
var tmp_1 = scope_0.r1y_1;
|
|
1756
1756
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1757
1757
|
} else {
|
|
1758
1758
|
if (definition instanceof Union) {
|
|
@@ -1766,10 +1766,10 @@ protoOf(TypeScriptIrEmitter).z1v = function (definition, module_0) {
|
|
|
1766
1766
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1767
1767
|
var this_2 = sanitizeNames(tmp, _get_sanitizationConfig__sns434(this));
|
|
1768
1768
|
var scope_1 = new TransformScope(this_2);
|
|
1769
|
-
scope_1.
|
|
1770
|
-
var tmp_2 = scope_1.
|
|
1769
|
+
scope_1.z1y(TypeScriptIrEmitter$emitGenerator$lambda_1);
|
|
1770
|
+
var tmp_2 = scope_1.r1y_1;
|
|
1771
1771
|
var generatorFile = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1772
|
-
var generatorOwnName = definition.
|
|
1772
|
+
var generatorOwnName = definition.xu().m1() + 'Generator';
|
|
1773
1773
|
var tmp_3 = asSequence(collectCustomTypeNames(generatorFile));
|
|
1774
1774
|
var tmp_4 = filterNot(tmp_3, TypeScriptIrEmitter$emitGenerator$lambda_2);
|
|
1775
1775
|
var tmp_5 = filterNot(tmp_4, TypeScriptIrEmitter$emitGenerator$lambda_3(generatorOwnName));
|
|
@@ -1778,8 +1778,8 @@ protoOf(TypeScriptIrEmitter).z1v = function (definition, module_0) {
|
|
|
1778
1778
|
var generatorRefs = LinkedHashSet_init_$Create$();
|
|
1779
1779
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1780
1780
|
var scope_2 = new TransformScope(generatorFile);
|
|
1781
|
-
scope_2.
|
|
1782
|
-
var tmp_6 = scope_2.
|
|
1781
|
+
scope_2.z1y(TypeScriptIrEmitter$emitGenerator$lambda_5(generatorOwnName, generatorRefs));
|
|
1782
|
+
var tmp_6 = scope_2.r1y_1;
|
|
1783
1783
|
isInterface(tmp_6, Element) || THROW_CCE();
|
|
1784
1784
|
// Inline function 'kotlin.collections.filter' call
|
|
1785
1785
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -1788,7 +1788,7 @@ protoOf(TypeScriptIrEmitter).z1v = function (definition, module_0) {
|
|
|
1788
1788
|
while (_iterator__ex2g4s.u()) {
|
|
1789
1789
|
var element = _iterator__ex2g4s.v();
|
|
1790
1790
|
if (endsWith(element, 'Generator')) {
|
|
1791
|
-
destination.
|
|
1791
|
+
destination.y(element);
|
|
1792
1792
|
}
|
|
1793
1793
|
}
|
|
1794
1794
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1799,7 +1799,7 @@ protoOf(TypeScriptIrEmitter).z1v = function (definition, module_0) {
|
|
|
1799
1799
|
while (_iterator__ex2g4s_0.u()) {
|
|
1800
1800
|
var item = _iterator__ex2g4s_0.v();
|
|
1801
1801
|
var tmp$ret$12 = import_0('./' + item, item);
|
|
1802
|
-
destination_0.
|
|
1802
|
+
destination_0.y(tmp$ret$12);
|
|
1803
1803
|
}
|
|
1804
1804
|
var generatorImports = destination_0;
|
|
1805
1805
|
// Inline function 'kotlin.collections.filterNot' call
|
|
@@ -1809,7 +1809,7 @@ protoOf(TypeScriptIrEmitter).z1v = function (definition, module_0) {
|
|
|
1809
1809
|
while (_iterator__ex2g4s_1.u()) {
|
|
1810
1810
|
var element_0 = _iterator__ex2g4s_1.v();
|
|
1811
1811
|
if (!endsWith(element_0, 'Generator')) {
|
|
1812
|
-
destination_1.
|
|
1812
|
+
destination_1.y(element_0);
|
|
1813
1813
|
}
|
|
1814
1814
|
}
|
|
1815
1815
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1819,13 +1819,13 @@ protoOf(TypeScriptIrEmitter).z1v = function (definition, module_0) {
|
|
|
1819
1819
|
while (_iterator__ex2g4s_2.u()) {
|
|
1820
1820
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
1821
1821
|
var tmp$ret$18 = import_0('../model/' + item_0, item_0);
|
|
1822
|
-
destination_2.
|
|
1822
|
+
destination_2.y(tmp$ret$18);
|
|
1823
1823
|
}
|
|
1824
1824
|
var modelImports = destination_2;
|
|
1825
|
-
var subPackageName = plus_0(Companion_instance.
|
|
1826
|
-
return new File(Companion_getInstance().
|
|
1825
|
+
var subPackageName = plus_0(Companion_instance.nv(''), 'generator');
|
|
1826
|
+
return new File(Companion_getInstance().y1k(subPackageName.qv() + sanitizeSymbol_1(this, generatorFile.g1r_1.z1k())), plus_1(plus_1(plus_1(listOf_0(import_0('../Wirespec', 'Wirespec')), modelImports), generatorImports), generatorFile.h1r_1));
|
|
1827
1827
|
};
|
|
1828
|
-
protoOf(TypeScriptIrEmitter).
|
|
1828
|
+
protoOf(TypeScriptIrEmitter).vt = function (type, module_0) {
|
|
1829
1829
|
var fieldValidations = classifyValidatableFields(type, module_0);
|
|
1830
1830
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1831
1831
|
var this_0 = importReferences(type);
|
|
@@ -1834,9 +1834,9 @@ protoOf(TypeScriptIrEmitter).kq = function (type, module_0) {
|
|
|
1834
1834
|
var _iterator__ex2g4s = this_0.t();
|
|
1835
1835
|
while (_iterator__ex2g4s.u()) {
|
|
1836
1836
|
var e = _iterator__ex2g4s.v();
|
|
1837
|
-
var key = e.
|
|
1838
|
-
if (set.
|
|
1839
|
-
list.
|
|
1837
|
+
var key = e.my_1;
|
|
1838
|
+
if (set.y(key)) {
|
|
1839
|
+
list.y(e);
|
|
1840
1840
|
}
|
|
1841
1841
|
}
|
|
1842
1842
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1845,8 +1845,8 @@ protoOf(TypeScriptIrEmitter).kq = function (type, module_0) {
|
|
|
1845
1845
|
var _iterator__ex2g4s_0 = list.t();
|
|
1846
1846
|
while (_iterator__ex2g4s_0.u()) {
|
|
1847
1847
|
var item = _iterator__ex2g4s_0.v();
|
|
1848
|
-
var tmp$ret$2 = import_0('./' + item.
|
|
1849
|
-
destination.
|
|
1848
|
+
var tmp$ret$2 = import_0('./' + item.my_1, item.my_1);
|
|
1849
|
+
destination.y(tmp$ret$2);
|
|
1850
1850
|
}
|
|
1851
1851
|
var typeImports = destination;
|
|
1852
1852
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1855,8 +1855,8 @@ protoOf(TypeScriptIrEmitter).kq = function (type, module_0) {
|
|
|
1855
1855
|
var _iterator__ex2g4s_1 = fieldValidations.t();
|
|
1856
1856
|
while (_iterator__ex2g4s_1.u()) {
|
|
1857
1857
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
1858
|
-
var tmp$ret$5 = item_0.
|
|
1859
|
-
destination_0.
|
|
1858
|
+
var tmp$ret$5 = item_0.o1m_1;
|
|
1859
|
+
destination_0.y(tmp$ret$5);
|
|
1860
1860
|
}
|
|
1861
1861
|
// Inline function 'kotlin.collections.filter' call
|
|
1862
1862
|
var tmp0 = distinct_0(destination_0);
|
|
@@ -1865,8 +1865,8 @@ protoOf(TypeScriptIrEmitter).kq = function (type, module_0) {
|
|
|
1865
1865
|
var _iterator__ex2g4s_2 = tmp0.t();
|
|
1866
1866
|
while (_iterator__ex2g4s_2.u()) {
|
|
1867
1867
|
var element = _iterator__ex2g4s_2.v();
|
|
1868
|
-
if (!(element === type.
|
|
1869
|
-
destination_1.
|
|
1868
|
+
if (!(element === type.ws_1.m1())) {
|
|
1869
|
+
destination_1.y(element);
|
|
1870
1870
|
}
|
|
1871
1871
|
}
|
|
1872
1872
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1876,35 +1876,35 @@ protoOf(TypeScriptIrEmitter).kq = function (type, module_0) {
|
|
|
1876
1876
|
while (_iterator__ex2g4s_3.u()) {
|
|
1877
1877
|
var item_1 = _iterator__ex2g4s_3.v();
|
|
1878
1878
|
var tmp$ret$11 = import_0('./' + item_1, 'validate' + item_1);
|
|
1879
|
-
destination_2.
|
|
1879
|
+
destination_2.y(tmp$ret$11);
|
|
1880
1880
|
}
|
|
1881
1881
|
var validateImports = destination_2;
|
|
1882
1882
|
var allImports = plus_1(typeImports, validateImports);
|
|
1883
1883
|
// Inline function 'kotlin.collections.map' call
|
|
1884
|
-
var this_1 = type.
|
|
1884
|
+
var this_1 = type.xs_1.ts_1;
|
|
1885
1885
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1886
1886
|
var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1887
1887
|
var _iterator__ex2g4s_4 = this_1.t();
|
|
1888
1888
|
while (_iterator__ex2g4s_4.u()) {
|
|
1889
1889
|
var item_2 = _iterator__ex2g4s_4.v();
|
|
1890
|
-
var tmp$ret$14 = item_2.
|
|
1891
|
-
destination_3.
|
|
1890
|
+
var tmp$ret$14 = item_2.bt_1.m1();
|
|
1891
|
+
destination_3.y(tmp$ret$14);
|
|
1892
1892
|
}
|
|
1893
1893
|
var fieldNames = toSet(destination_3);
|
|
1894
|
-
var file = renameValidateAndBindObjReceiver(sanitizeNames(convertWithValidation(type, module_0), _get_modelSanitizationConfig__vgg831(this)), type.
|
|
1894
|
+
var file = renameValidateAndBindObjReceiver(sanitizeNames(convertWithValidation(type, module_0), _get_modelSanitizationConfig__vgg831(this)), type.ws_1.m1(), fieldNames);
|
|
1895
1895
|
var tmp;
|
|
1896
1896
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1897
1897
|
if (!allImports.r()) {
|
|
1898
|
-
tmp = file.
|
|
1898
|
+
tmp = file.k1r(VOID, plus_1(allImports, file.h1r_1));
|
|
1899
1899
|
} else {
|
|
1900
1900
|
tmp = file;
|
|
1901
1901
|
}
|
|
1902
1902
|
return tmp;
|
|
1903
1903
|
};
|
|
1904
|
-
protoOf(TypeScriptIrEmitter).
|
|
1904
|
+
protoOf(TypeScriptIrEmitter).kv = function (enum_0, module_0) {
|
|
1905
1905
|
return sanitizeNames(convert_0(enum_0), _get_sanitizationConfig__sns434(this));
|
|
1906
1906
|
};
|
|
1907
|
-
protoOf(TypeScriptIrEmitter).
|
|
1907
|
+
protoOf(TypeScriptIrEmitter).av = function (union) {
|
|
1908
1908
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1909
1909
|
var this_0 = importReferences(union);
|
|
1910
1910
|
var set = HashSet_init_$Create$();
|
|
@@ -1912,9 +1912,9 @@ protoOf(TypeScriptIrEmitter).pr = function (union) {
|
|
|
1912
1912
|
var _iterator__ex2g4s = this_0.t();
|
|
1913
1913
|
while (_iterator__ex2g4s.u()) {
|
|
1914
1914
|
var e = _iterator__ex2g4s.v();
|
|
1915
|
-
var key = e.
|
|
1916
|
-
if (set.
|
|
1917
|
-
list.
|
|
1915
|
+
var key = e.my_1;
|
|
1916
|
+
if (set.y(key)) {
|
|
1917
|
+
list.y(e);
|
|
1918
1918
|
}
|
|
1919
1919
|
}
|
|
1920
1920
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1923,27 +1923,27 @@ protoOf(TypeScriptIrEmitter).pr = function (union) {
|
|
|
1923
1923
|
var _iterator__ex2g4s_0 = list.t();
|
|
1924
1924
|
while (_iterator__ex2g4s_0.u()) {
|
|
1925
1925
|
var item = _iterator__ex2g4s_0.v();
|
|
1926
|
-
var tmp$ret$2 = import_0('../model', item.
|
|
1927
|
-
destination.
|
|
1926
|
+
var tmp$ret$2 = import_0('../model', item.my_1, true);
|
|
1927
|
+
destination.y(tmp$ret$2);
|
|
1928
1928
|
}
|
|
1929
1929
|
var imports = destination;
|
|
1930
1930
|
var file = sanitizeNames(convert_1(union), _get_sanitizationConfig__sns434(this));
|
|
1931
1931
|
var tmp;
|
|
1932
1932
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1933
1933
|
if (!imports.r()) {
|
|
1934
|
-
tmp = file.
|
|
1934
|
+
tmp = file.k1r(VOID, plus_1(imports, file.h1r_1));
|
|
1935
1935
|
} else {
|
|
1936
1936
|
tmp = file;
|
|
1937
1937
|
}
|
|
1938
1938
|
return tmp;
|
|
1939
1939
|
};
|
|
1940
|
-
protoOf(TypeScriptIrEmitter).
|
|
1940
|
+
protoOf(TypeScriptIrEmitter).fv = function (refined) {
|
|
1941
1941
|
var converted = convert_2(refined);
|
|
1942
|
-
var constraintExpr = convertConstraint(refined.
|
|
1943
|
-
var validatorStr = TypeScriptGenerator_getInstance().
|
|
1944
|
-
return new File(converted.
|
|
1942
|
+
var constraintExpr = convertConstraint(refined.ev_1, new VariableReference(Companion_getInstance().y1k('value')));
|
|
1943
|
+
var validatorStr = TypeScriptGenerator_getInstance().t1z(constraintExpr);
|
|
1944
|
+
return new File(converted.g1r_1, listOf([new RawElement('export type ' + converted.g1r_1.z1k() + ' = ' + emitTypeScriptReference(this, refined.ev_1) + ';'), new RawElement('export const validate' + refined.dv_1.m1() + ' = (value: ' + emitTypeScriptReference(this, refined.ev_1) + ') =>\n ' + validatorStr + ';')]));
|
|
1945
1945
|
};
|
|
1946
|
-
protoOf(TypeScriptIrEmitter).
|
|
1946
|
+
protoOf(TypeScriptIrEmitter).lv = function (endpoint) {
|
|
1947
1947
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1948
1948
|
var this_0 = importReferences(endpoint);
|
|
1949
1949
|
var set = HashSet_init_$Create$();
|
|
@@ -1951,9 +1951,9 @@ protoOf(TypeScriptIrEmitter).as = function (endpoint) {
|
|
|
1951
1951
|
var _iterator__ex2g4s = this_0.t();
|
|
1952
1952
|
while (_iterator__ex2g4s.u()) {
|
|
1953
1953
|
var e = _iterator__ex2g4s.v();
|
|
1954
|
-
var key = e.
|
|
1955
|
-
if (set.
|
|
1956
|
-
list.
|
|
1954
|
+
var key = e.my_1;
|
|
1955
|
+
if (set.y(key)) {
|
|
1956
|
+
list.y(e);
|
|
1957
1957
|
}
|
|
1958
1958
|
}
|
|
1959
1959
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1962,8 +1962,8 @@ protoOf(TypeScriptIrEmitter).as = function (endpoint) {
|
|
|
1962
1962
|
var _iterator__ex2g4s_0 = list.t();
|
|
1963
1963
|
while (_iterator__ex2g4s_0.u()) {
|
|
1964
1964
|
var item = _iterator__ex2g4s_0.v();
|
|
1965
|
-
var tmp$ret$2 = import_0('../model', item.
|
|
1966
|
-
destination.
|
|
1965
|
+
var tmp$ret$2 = import_0('../model', item.my_1, true);
|
|
1966
|
+
destination.y(tmp$ret$2);
|
|
1967
1967
|
}
|
|
1968
1968
|
var imports = destination;
|
|
1969
1969
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
@@ -1971,25 +1971,25 @@ protoOf(TypeScriptIrEmitter).as = function (endpoint) {
|
|
|
1971
1971
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1972
1972
|
var this_1 = stripTrailingSpaceFromErrorMessage(convert_3(endpoint));
|
|
1973
1973
|
var scope = new TransformScope(this_1);
|
|
1974
|
-
scope.
|
|
1975
|
-
var tmp = scope.
|
|
1974
|
+
scope.w1y(transformPatternSwitchToValueSwitch());
|
|
1975
|
+
var tmp = scope.r1y_1;
|
|
1976
1976
|
var tmp$ret$7 = isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1977
1977
|
// Inline function 'kotlin.let' call
|
|
1978
|
-
var it = sanitizeNames(emit$injectApiConst(emit$applyCallParamsIfNeeded(tmp$ret$7, hasRequestParams), endpoint).
|
|
1978
|
+
var it = sanitizeNames(emit$injectApiConst(emit$applyCallParamsIfNeeded(tmp$ret$7, hasRequestParams), endpoint).k1r(Companion_getInstance().y1k(sanitize(this, endpoint.ft_1))), _get_sanitizationConfig__sns434(this));
|
|
1979
1979
|
var tmp_0;
|
|
1980
1980
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1981
1981
|
if (!imports.r()) {
|
|
1982
|
-
tmp_0 = it.
|
|
1982
|
+
tmp_0 = it.k1r(VOID, plus_1(imports, it.h1r_1));
|
|
1983
1983
|
} else {
|
|
1984
1984
|
tmp_0 = it;
|
|
1985
1985
|
}
|
|
1986
1986
|
return tmp_0;
|
|
1987
1987
|
};
|
|
1988
|
-
protoOf(TypeScriptIrEmitter).
|
|
1988
|
+
protoOf(TypeScriptIrEmitter).zu = function (channel) {
|
|
1989
1989
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1990
1990
|
};
|
|
1991
|
-
protoOf(TypeScriptIrEmitter).
|
|
1992
|
-
var endpointName = endpoint.
|
|
1991
|
+
protoOf(TypeScriptIrEmitter).k1z = function (endpoint) {
|
|
1992
|
+
var endpointName = endpoint.ft_1.m1();
|
|
1993
1993
|
var methodName = firstToLower(this, endpointName);
|
|
1994
1994
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1995
1995
|
var this_0 = importReferences(endpoint);
|
|
@@ -1998,9 +1998,9 @@ protoOf(TypeScriptIrEmitter).y1v = function (endpoint) {
|
|
|
1998
1998
|
var _iterator__ex2g4s = this_0.t();
|
|
1999
1999
|
while (_iterator__ex2g4s.u()) {
|
|
2000
2000
|
var e = _iterator__ex2g4s.v();
|
|
2001
|
-
var key = e.
|
|
2002
|
-
if (set.
|
|
2003
|
-
list.
|
|
2001
|
+
var key = e.my_1;
|
|
2002
|
+
if (set.y(key)) {
|
|
2003
|
+
list.y(e);
|
|
2004
2004
|
}
|
|
2005
2005
|
}
|
|
2006
2006
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -2009,8 +2009,8 @@ protoOf(TypeScriptIrEmitter).y1v = function (endpoint) {
|
|
|
2009
2009
|
var _iterator__ex2g4s_0 = list.t();
|
|
2010
2010
|
while (_iterator__ex2g4s_0.u()) {
|
|
2011
2011
|
var item = _iterator__ex2g4s_0.v();
|
|
2012
|
-
var tmp$ret$2 = import_0('../model', item.
|
|
2013
|
-
destination.
|
|
2012
|
+
var tmp$ret$2 = import_0('../model', item.my_1, true);
|
|
2013
|
+
destination.y(tmp$ret$2);
|
|
2014
2014
|
}
|
|
2015
2015
|
var imports = destination;
|
|
2016
2016
|
var params = buildEndpointParams(this, endpoint);
|
|
@@ -2031,50 +2031,50 @@ protoOf(TypeScriptIrEmitter).y1v = function (endpoint) {
|
|
|
2031
2031
|
}
|
|
2032
2032
|
var requestArgs = tmp_0;
|
|
2033
2033
|
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 ');
|
|
2034
|
-
var tmp_1 = Companion_getInstance().
|
|
2034
|
+
var tmp_1 = Companion_getInstance().y1k('client/' + endpointName + 'Client');
|
|
2035
2035
|
// Inline function 'kotlin.collections.buildList' call
|
|
2036
2036
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
2037
2037
|
// Inline function 'kotlin.apply' call
|
|
2038
2038
|
var this_1 = ArrayList_init_$Create$();
|
|
2039
|
-
this_1.
|
|
2040
|
-
this_1.
|
|
2041
|
-
this_1.
|
|
2042
|
-
this_1.
|
|
2043
|
-
var tmp$ret$10 = this_1.
|
|
2039
|
+
this_1.y(import_0('../Wirespec', 'Wirespec'));
|
|
2040
|
+
this_1.y(import_0('../endpoint/' + endpointName, endpointName));
|
|
2041
|
+
this_1.g1(imports);
|
|
2042
|
+
this_1.y(new RawElement(code));
|
|
2043
|
+
var tmp$ret$10 = this_1.p5();
|
|
2044
2044
|
return new File(tmp_1, tmp$ret$10);
|
|
2045
2045
|
};
|
|
2046
|
-
protoOf(TypeScriptIrEmitter).
|
|
2047
|
-
logger.
|
|
2046
|
+
protoOf(TypeScriptIrEmitter).i1z = function (endpoints, logger) {
|
|
2047
|
+
logger.uu('Emitting main Client for ' + endpoints.b1() + ' endpoints');
|
|
2048
2048
|
// Inline function 'kotlin.collections.map' call
|
|
2049
2049
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2050
2050
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(endpoints, 10));
|
|
2051
2051
|
var _iterator__ex2g4s = endpoints.t();
|
|
2052
2052
|
while (_iterator__ex2g4s.u()) {
|
|
2053
2053
|
var item = _iterator__ex2g4s.v();
|
|
2054
|
-
var methodName = firstToLower(this, item.
|
|
2055
|
-
var tmp$ret$0 = import_0('./client/' + item.
|
|
2056
|
-
destination.
|
|
2054
|
+
var methodName = firstToLower(this, item.ft_1.m1());
|
|
2055
|
+
var tmp$ret$0 = import_0('./client/' + item.ft_1.m1() + 'Client', methodName + 'Client');
|
|
2056
|
+
destination.y(tmp$ret$0);
|
|
2057
2057
|
}
|
|
2058
2058
|
var clientImports = destination;
|
|
2059
2059
|
var spreadEntries = joinToString(endpoints, '\n', VOID, VOID, VOID, VOID, TypeScriptIrEmitter$emitClient$lambda(this));
|
|
2060
2060
|
var code = trimMargin('\n |export const client = (serialization: Wirespec.Serialization, transportation: Wirespec.Transportation) => ({\n |' + spreadEntries + '\n |})\n ');
|
|
2061
|
-
var tmp = Companion_getInstance().
|
|
2061
|
+
var tmp = Companion_getInstance().y1k('Client');
|
|
2062
2062
|
// Inline function 'kotlin.collections.buildList' call
|
|
2063
2063
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
2064
2064
|
// Inline function 'kotlin.apply' call
|
|
2065
2065
|
var this_0 = ArrayList_init_$Create$();
|
|
2066
|
-
this_0.
|
|
2067
|
-
this_0.
|
|
2068
|
-
this_0.
|
|
2069
|
-
var tmp$ret$6 = this_0.
|
|
2066
|
+
this_0.y(import_0('./Wirespec', 'Wirespec'));
|
|
2067
|
+
this_0.g1(clientImports);
|
|
2068
|
+
this_0.y(new RawElement(code));
|
|
2069
|
+
var tmp$ret$6 = this_0.p5();
|
|
2070
2070
|
return new File(tmp, tmp$ret$6);
|
|
2071
2071
|
};
|
|
2072
2072
|
function transformPatternSwitchToValueSwitch() {
|
|
2073
2073
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2074
2074
|
// Inline function 'kotlin.apply' call
|
|
2075
2075
|
var this_0 = new TransformerBuilder();
|
|
2076
|
-
this_0.
|
|
2077
|
-
return this_0.
|
|
2076
|
+
this_0.y1y(transformPatternSwitchToValueSwitch$lambda);
|
|
2077
|
+
return this_0.j1m();
|
|
2078
2078
|
}
|
|
2079
2079
|
function renameValidateAndBindObjReceiver(_this__u8e3s4, typeName, fieldNames) {
|
|
2080
2080
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -2082,19 +2082,19 @@ function renameValidateAndBindObjReceiver(_this__u8e3s4, typeName, fieldNames) {
|
|
|
2082
2082
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
2083
2083
|
var tmp = scope;
|
|
2084
2084
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
2085
|
-
var this_0 = scope.
|
|
2085
|
+
var this_0 = scope.r1y_1;
|
|
2086
2086
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2087
2087
|
// Inline function 'kotlin.apply' call
|
|
2088
2088
|
var this_1 = new TransformerBuilder();
|
|
2089
|
-
this_1.
|
|
2090
|
-
var tmp$ret$2 = this_1.
|
|
2091
|
-
tmp.
|
|
2092
|
-
var tmp_0 = scope.
|
|
2089
|
+
this_1.i1m(renameValidateAndBindObjReceiver$lambda(typeName, fieldNames));
|
|
2090
|
+
var tmp$ret$2 = this_1.j1m();
|
|
2091
|
+
tmp.r1y_1 = transform(this_0, tmp$ret$2);
|
|
2092
|
+
var tmp_0 = scope.r1y_1;
|
|
2093
2093
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2094
2094
|
}
|
|
2095
2095
|
function buildApiConst(endpoint) {
|
|
2096
2096
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
2097
|
-
var this_0 = endpoint.
|
|
2097
|
+
var this_0 = endpoint.ft_1.m1();
|
|
2098
2098
|
var tmp;
|
|
2099
2099
|
// Inline function 'kotlin.text.isNotEmpty' call
|
|
2100
2100
|
if (charSequenceLength(this_0) > 0) {
|
|
@@ -2108,8 +2108,8 @@ function buildApiConst(endpoint) {
|
|
|
2108
2108
|
tmp = this_0;
|
|
2109
2109
|
}
|
|
2110
2110
|
var apiName = tmp;
|
|
2111
|
-
var method = endpoint.
|
|
2112
|
-
var pathString = joinToString(endpoint.
|
|
2111
|
+
var method = endpoint.gt_1.b3_1;
|
|
2112
|
+
var pathString = joinToString(endpoint.ht_1, '/', VOID, VOID, VOID, VOID, buildApiConst$lambda);
|
|
2113
2113
|
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 '));
|
|
2114
2114
|
}
|
|
2115
2115
|
function bindCallToRequestParams(_this__u8e3s4) {
|
|
@@ -2118,21 +2118,21 @@ function bindCallToRequestParams(_this__u8e3s4) {
|
|
|
2118
2118
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
2119
2119
|
var tmp = scope;
|
|
2120
2120
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
2121
|
-
var this_0 = scope.
|
|
2121
|
+
var this_0 = scope.r1y_1;
|
|
2122
2122
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2123
2123
|
// Inline function 'kotlin.apply' call
|
|
2124
2124
|
var this_1 = new TransformerBuilder();
|
|
2125
|
-
this_1.
|
|
2126
|
-
var tmp$ret$2 = this_1.
|
|
2127
|
-
tmp.
|
|
2128
|
-
var tmp_0 = scope.
|
|
2125
|
+
this_1.i1m(bindCallToRequestParams$lambda);
|
|
2126
|
+
var tmp$ret$2 = this_1.j1m();
|
|
2127
|
+
tmp.r1y_1 = transform(this_0, tmp$ret$2);
|
|
2128
|
+
var tmp_0 = scope.r1y_1;
|
|
2129
2129
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2130
2130
|
}
|
|
2131
2131
|
function stripTrailingSpaceFromErrorMessage(_this__u8e3s4) {
|
|
2132
2132
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2133
2133
|
var scope = new TransformScope(_this__u8e3s4);
|
|
2134
|
-
scope.
|
|
2135
|
-
var tmp = scope.
|
|
2134
|
+
scope.y1y(stripTrailingSpaceFromErrorMessage$lambda);
|
|
2135
|
+
var tmp = scope.r1y_1;
|
|
2136
2136
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
2137
2137
|
}
|
|
2138
2138
|
function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
@@ -2140,7 +2140,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2140
2140
|
if (!(stmt instanceof Switch)) {
|
|
2141
2141
|
tmp = true;
|
|
2142
2142
|
} else {
|
|
2143
|
-
var tmp0 = stmt.
|
|
2143
|
+
var tmp0 = stmt.t1t_1;
|
|
2144
2144
|
var tmp$ret$0;
|
|
2145
2145
|
$l$block_0: {
|
|
2146
2146
|
// Inline function 'kotlin.collections.none' call
|
|
@@ -2157,7 +2157,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2157
2157
|
var _iterator__ex2g4s = tmp0.t();
|
|
2158
2158
|
while (_iterator__ex2g4s.u()) {
|
|
2159
2159
|
var element = _iterator__ex2g4s.v();
|
|
2160
|
-
if (!(element.
|
|
2160
|
+
if (!(element.a1u_1 == null)) {
|
|
2161
2161
|
tmp$ret$0 = false;
|
|
2162
2162
|
break $l$block_0;
|
|
2163
2163
|
}
|
|
@@ -2168,11 +2168,11 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2168
2168
|
}
|
|
2169
2169
|
if (tmp)
|
|
2170
2170
|
return transformChildren(stmt, tr);
|
|
2171
|
-
var tmp0_safe_receiver = stmt.
|
|
2172
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
2171
|
+
var tmp0_safe_receiver = stmt.v1t_1;
|
|
2172
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.b1q();
|
|
2173
2173
|
var varName = tmp1_elvis_lhs == null ? 'r' : tmp1_elvis_lhs;
|
|
2174
2174
|
// Inline function 'kotlin.collections.map' call
|
|
2175
|
-
var this_0 = stmt.
|
|
2175
|
+
var this_0 = stmt.t1t_1;
|
|
2176
2176
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2177
2177
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2178
2178
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
@@ -2180,48 +2180,48 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2180
2180
|
var item = _iterator__ex2g4s_0.v();
|
|
2181
2181
|
var tmp$ret$5;
|
|
2182
2182
|
$l$block_1: {
|
|
2183
|
-
var tmp_1 = item.
|
|
2183
|
+
var tmp_1 = item.a1u_1;
|
|
2184
2184
|
var tmp0_safe_receiver_0 = tmp_1 instanceof Custom_0 ? tmp_1 : null;
|
|
2185
|
-
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.
|
|
2186
|
-
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
2185
|
+
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.s1m_1;
|
|
2186
|
+
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.z1k();
|
|
2187
2187
|
var tmp3_safe_receiver = typeName == null ? null : substringAfterLast(typeName, '.');
|
|
2188
2188
|
var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : removePrefix(tmp3_safe_receiver, 'Response');
|
|
2189
2189
|
var statusNum = tmp4_safe_receiver == null ? null : toIntOrNull(tmp4_safe_receiver);
|
|
2190
2190
|
if (statusNum == null || typeName == null) {
|
|
2191
2191
|
// Inline function 'kotlin.collections.map' call
|
|
2192
|
-
var this_1 = item.
|
|
2192
|
+
var this_1 = item.z1t_1;
|
|
2193
2193
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2194
2194
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
2195
2195
|
var _iterator__ex2g4s_1 = this_1.t();
|
|
2196
2196
|
while (_iterator__ex2g4s_1.u()) {
|
|
2197
2197
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
2198
|
-
var tmp$ret$2 = tr.
|
|
2199
|
-
destination_0.
|
|
2198
|
+
var tmp$ret$2 = tr.l1y(item_0);
|
|
2199
|
+
destination_0.y(tmp$ret$2);
|
|
2200
2200
|
}
|
|
2201
|
-
tmp$ret$5 = item.
|
|
2201
|
+
tmp$ret$5 = item.c1u(VOID, destination_0);
|
|
2202
2202
|
break $l$block_1;
|
|
2203
2203
|
}
|
|
2204
|
-
var exprCode = TypeScriptGenerator_getInstance().
|
|
2205
|
-
var castAssignment = new Assignment(Companion_getInstance().
|
|
2204
|
+
var exprCode = TypeScriptGenerator_getInstance().t1z(tr.m1y(stmt.s1t_1));
|
|
2205
|
+
var castAssignment = new Assignment(Companion_getInstance().y1k(varName), new RawExpression(exprCode + ' as ' + typeName), false);
|
|
2206
2206
|
var tmp_2 = new Literal_0(statusNum, new Integer_0());
|
|
2207
2207
|
var tmp_3 = listOf_0(castAssignment);
|
|
2208
2208
|
// Inline function 'kotlin.collections.map' call
|
|
2209
|
-
var this_2 = item.
|
|
2209
|
+
var this_2 = item.z1t_1;
|
|
2210
2210
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2211
2211
|
var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
|
|
2212
2212
|
var _iterator__ex2g4s_2 = this_2.t();
|
|
2213
2213
|
while (_iterator__ex2g4s_2.u()) {
|
|
2214
2214
|
var item_1 = _iterator__ex2g4s_2.v();
|
|
2215
|
-
var tmp$ret$6 = tr.
|
|
2216
|
-
destination_1.
|
|
2215
|
+
var tmp$ret$6 = tr.l1y(item_1);
|
|
2216
|
+
destination_1.y(tmp$ret$6);
|
|
2217
2217
|
}
|
|
2218
2218
|
tmp$ret$5 = new Case(tmp_2, plus_1(tmp_3, destination_1), null);
|
|
2219
2219
|
}
|
|
2220
|
-
destination.
|
|
2220
|
+
destination.y(tmp$ret$5);
|
|
2221
2221
|
}
|
|
2222
2222
|
var transformedCases = destination;
|
|
2223
|
-
var tmp_4 = new FieldCall(tr.
|
|
2224
|
-
var tmp2_safe_receiver = stmt.
|
|
2223
|
+
var tmp_4 = new FieldCall(tr.m1y(stmt.s1t_1), Companion_getInstance().y1k('status'));
|
|
2224
|
+
var tmp2_safe_receiver = stmt.u1t_1;
|
|
2225
2225
|
var tmp_5;
|
|
2226
2226
|
if (tmp2_safe_receiver == null) {
|
|
2227
2227
|
tmp_5 = null;
|
|
@@ -2232,8 +2232,8 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2232
2232
|
var _iterator__ex2g4s_3 = tmp2_safe_receiver.t();
|
|
2233
2233
|
while (_iterator__ex2g4s_3.u()) {
|
|
2234
2234
|
var item_2 = _iterator__ex2g4s_3.v();
|
|
2235
|
-
var tmp$ret$11 = tr.
|
|
2236
|
-
destination_2.
|
|
2235
|
+
var tmp$ret$11 = tr.l1y(item_2);
|
|
2236
|
+
destination_2.y(tmp$ret$11);
|
|
2237
2237
|
}
|
|
2238
2238
|
tmp_5 = destination_2;
|
|
2239
2239
|
}
|
|
@@ -2246,43 +2246,43 @@ function renameValidateAndBindObjReceiver$lambda$lambda($fieldNames) {
|
|
|
2246
2246
|
var tmp_1;
|
|
2247
2247
|
var tmp_2;
|
|
2248
2248
|
if (s instanceof FunctionCall) {
|
|
2249
|
-
tmp_2 = s.
|
|
2249
|
+
tmp_2 = s.l1q_1.equals(Companion_getInstance().y1k('validate'));
|
|
2250
2250
|
} else {
|
|
2251
2251
|
tmp_2 = false;
|
|
2252
2252
|
}
|
|
2253
2253
|
if (tmp_2) {
|
|
2254
|
-
tmp_1 = !(s.
|
|
2254
|
+
tmp_1 = !(s.j1q_1 == null);
|
|
2255
2255
|
} else {
|
|
2256
2256
|
tmp_1 = false;
|
|
2257
2257
|
}
|
|
2258
2258
|
if (tmp_1) {
|
|
2259
2259
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
2260
|
-
tmp_0 = !s.
|
|
2260
|
+
tmp_0 = !s.k1q_1.r();
|
|
2261
2261
|
} else {
|
|
2262
2262
|
tmp_0 = false;
|
|
2263
2263
|
}
|
|
2264
2264
|
if (tmp_0) {
|
|
2265
|
-
var tmp_3 = first(s.
|
|
2265
|
+
var tmp_3 = first(s.k1q_1);
|
|
2266
2266
|
var tmp0_safe_receiver = tmp_3 instanceof Custom_0 ? tmp_3 : null;
|
|
2267
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
2268
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
2267
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.s1m_1;
|
|
2268
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.z1k();
|
|
2269
2269
|
var tn = tmp2_elvis_lhs == null ? '' : tmp2_elvis_lhs;
|
|
2270
|
-
tmp = new FunctionCall(VOID, VOID, Companion_getInstance().
|
|
2270
|
+
tmp = new FunctionCall(VOID, VOID, Companion_getInstance().y1k('validate' + tn), mapOf(to(Companion_getInstance().y1k('obj'), t.m1y(ensureNotNull(s.j1q_1)))));
|
|
2271
2271
|
} else {
|
|
2272
2272
|
var tmp_4;
|
|
2273
2273
|
var tmp_5;
|
|
2274
2274
|
if (s instanceof FieldCall) {
|
|
2275
|
-
tmp_5 = s.
|
|
2275
|
+
tmp_5 = s.d1u_1 == null;
|
|
2276
2276
|
} else {
|
|
2277
2277
|
tmp_5 = false;
|
|
2278
2278
|
}
|
|
2279
2279
|
if (tmp_5) {
|
|
2280
|
-
tmp_4 = $fieldNames.
|
|
2280
|
+
tmp_4 = $fieldNames.v1(s.e1u_1.b1q());
|
|
2281
2281
|
} else {
|
|
2282
2282
|
tmp_4 = false;
|
|
2283
2283
|
}
|
|
2284
2284
|
if (tmp_4) {
|
|
2285
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().
|
|
2285
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().y1k('obj')), s.e1u_1);
|
|
2286
2286
|
} else {
|
|
2287
2287
|
tmp = transformChildren(s, t);
|
|
2288
2288
|
}
|
|
@@ -2296,15 +2296,15 @@ function renameValidateAndBindObjReceiver$lambda($typeName, $fieldNames) {
|
|
|
2296
2296
|
if (element instanceof Function) {
|
|
2297
2297
|
var tmp$ret$0;
|
|
2298
2298
|
$l$block: {
|
|
2299
|
-
if (!element.
|
|
2299
|
+
if (!element.o1o_1.equals(Companion_getInstance().y1k('validate'))) {
|
|
2300
2300
|
tmp$ret$0 = element;
|
|
2301
2301
|
break $l$block;
|
|
2302
2302
|
}
|
|
2303
2303
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2304
|
-
var this_0 = element.
|
|
2304
|
+
var this_0 = element.w1o(Companion_getInstance().y1k('validate' + $typeName), VOID, listOf_0(new Parameter(Companion_getInstance().y1k('obj'), Custom_init_$Create$($typeName))));
|
|
2305
2305
|
var scope = new TransformScope(this_0);
|
|
2306
|
-
scope.
|
|
2307
|
-
var tmp_0 = scope.
|
|
2306
|
+
scope.a1z(renameValidateAndBindObjReceiver$lambda$lambda($fieldNames));
|
|
2307
|
+
var tmp_0 = scope.r1y_1;
|
|
2308
2308
|
tmp$ret$0 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2309
2309
|
}
|
|
2310
2310
|
tmp = tmp$ret$0;
|
|
@@ -2318,10 +2318,10 @@ function renameValidateAndBindObjReceiver$lambda($typeName, $fieldNames) {
|
|
|
2318
2318
|
function buildApiConst$lambda(it) {
|
|
2319
2319
|
var tmp;
|
|
2320
2320
|
if (it instanceof Literal) {
|
|
2321
|
-
tmp = it.
|
|
2321
|
+
tmp = it.iu_1;
|
|
2322
2322
|
} else {
|
|
2323
2323
|
if (it instanceof Param) {
|
|
2324
|
-
tmp = '{' + it.
|
|
2324
|
+
tmp = '{' + it.mt_1.m1() + '}';
|
|
2325
2325
|
} else {
|
|
2326
2326
|
noWhenBranchMatchedException();
|
|
2327
2327
|
}
|
|
@@ -2333,23 +2333,23 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
2333
2333
|
if (element instanceof Interface) {
|
|
2334
2334
|
var tmp$ret$0;
|
|
2335
2335
|
$l$block: {
|
|
2336
|
-
if (!element.
|
|
2336
|
+
if (!element.a1s_1.equals(Companion_getInstance().y1k('Call'))) {
|
|
2337
2337
|
tmp$ret$0 = element;
|
|
2338
2338
|
break $l$block;
|
|
2339
2339
|
}
|
|
2340
2340
|
// Inline function 'kotlin.collections.map' call
|
|
2341
|
-
var this_0 = element.
|
|
2341
|
+
var this_0 = element.b1s_1;
|
|
2342
2342
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2343
2343
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2344
2344
|
var _iterator__ex2g4s = this_0.t();
|
|
2345
2345
|
while (_iterator__ex2g4s.u()) {
|
|
2346
2346
|
var item = _iterator__ex2g4s.v();
|
|
2347
2347
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
2348
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
2348
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.w1o(VOID, VOID, listOf_0(new Parameter(Companion_getInstance().y1k('params'), Custom_init_$Create$('RequestParams'))));
|
|
2349
2349
|
var tmp$ret$1 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
2350
|
-
destination.
|
|
2350
|
+
destination.y(tmp$ret$1);
|
|
2351
2351
|
}
|
|
2352
|
-
tmp$ret$0 = element.
|
|
2352
|
+
tmp$ret$0 = element.h1s(VOID, destination);
|
|
2353
2353
|
}
|
|
2354
2354
|
tmp = tmp$ret$0;
|
|
2355
2355
|
} else {
|
|
@@ -2361,7 +2361,7 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
2361
2361
|
function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
2362
2362
|
var tmp;
|
|
2363
2363
|
if (stmt instanceof Switch) {
|
|
2364
|
-
var tmp1_safe_receiver = stmt.
|
|
2364
|
+
var tmp1_safe_receiver = stmt.u1t_1;
|
|
2365
2365
|
var tmp_0;
|
|
2366
2366
|
if (tmp1_safe_receiver == null) {
|
|
2367
2367
|
tmp_0 = null;
|
|
@@ -2383,7 +2383,7 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2383
2383
|
tmp_1 = tmp0_elvis_lhs;
|
|
2384
2384
|
}
|
|
2385
2385
|
var errorStmt = tmp_1;
|
|
2386
|
-
var tmp_2 = errorStmt.
|
|
2386
|
+
var tmp_2 = errorStmt.h1u_1;
|
|
2387
2387
|
var tmp1_elvis_lhs = tmp_2 instanceof BinaryOp ? tmp_2 : null;
|
|
2388
2388
|
var tmp_3;
|
|
2389
2389
|
if (tmp1_elvis_lhs == null) {
|
|
@@ -2393,7 +2393,7 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2393
2393
|
tmp_3 = tmp1_elvis_lhs;
|
|
2394
2394
|
}
|
|
2395
2395
|
var binary = tmp_3;
|
|
2396
|
-
var tmp_4 = binary.
|
|
2396
|
+
var tmp_4 = binary.i1u_1;
|
|
2397
2397
|
var tmp2_elvis_lhs = tmp_4 instanceof Literal_0 ? tmp_4 : null;
|
|
2398
2398
|
var tmp_5;
|
|
2399
2399
|
if (tmp2_elvis_lhs == null) {
|
|
@@ -2403,13 +2403,13 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2403
2403
|
tmp_5 = tmp2_elvis_lhs;
|
|
2404
2404
|
}
|
|
2405
2405
|
var literal = tmp_5;
|
|
2406
|
-
tmp$ret$0 = new ErrorStatement(new Literal_0(trimEnd(toString(literal.
|
|
2406
|
+
tmp$ret$0 = new ErrorStatement(new Literal_0(trimEnd(toString(literal.f1t_1), charArrayOf([_Char___init__impl__6a9atx(32)])), literal.g1t_1));
|
|
2407
2407
|
}
|
|
2408
|
-
destination.
|
|
2408
|
+
destination.y(tmp$ret$0);
|
|
2409
2409
|
}
|
|
2410
2410
|
tmp_0 = destination;
|
|
2411
2411
|
}
|
|
2412
|
-
tmp = transformChildren(stmt.
|
|
2412
|
+
tmp = transformChildren(stmt.x1t(VOID, VOID, tmp_0), transformer);
|
|
2413
2413
|
} else {
|
|
2414
2414
|
tmp = transformChildren(stmt, transformer);
|
|
2415
2415
|
}
|
|
@@ -2419,8 +2419,8 @@ function TypeScriptRefinedTypeDefinitionEmitter() {
|
|
|
2419
2419
|
}
|
|
2420
2420
|
function TypeScriptShared() {
|
|
2421
2421
|
TypeScriptShared_instance = this;
|
|
2422
|
-
this.
|
|
2423
|
-
this.
|
|
2422
|
+
this.e24_1 = 'community.flock.wirespec';
|
|
2423
|
+
this.f24_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 ');
|
|
2424
2424
|
}
|
|
2425
2425
|
protoOf(TypeScriptShared).toString = function () {
|
|
2426
2426
|
return 'TypeScriptShared';
|
|
@@ -2442,7 +2442,7 @@ function TypeScriptShared_getInstance() {
|
|
|
2442
2442
|
return TypeScriptShared_instance;
|
|
2443
2443
|
}
|
|
2444
2444
|
function TypeScriptTypeDefinitionEmitter$sanitizeSymbol$lambda(it) {
|
|
2445
|
-
return isLetterOrDigit(it.
|
|
2445
|
+
return isLetterOrDigit(it.i1_1) || listOf_0(new Char(_Char___init__impl__6a9atx(95))).v1(it);
|
|
2446
2446
|
}
|
|
2447
2447
|
function TypeScriptTypeDefinitionEmitter$emit$lambda(it) {
|
|
2448
2448
|
// Inline function 'kotlin.text.trimStart' call
|
|
@@ -2450,29 +2450,29 @@ function TypeScriptTypeDefinitionEmitter$emit$lambda(it) {
|
|
|
2450
2450
|
}
|
|
2451
2451
|
function TypeScriptTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2452
2452
|
return function (it) {
|
|
2453
|
-
return this$0.
|
|
2453
|
+
return this$0.xt(it);
|
|
2454
2454
|
};
|
|
2455
2455
|
}
|
|
2456
2456
|
function TypeScriptTypeDefinitionEmitter() {
|
|
2457
2457
|
}
|
|
2458
2458
|
//region block: post-declaration
|
|
2459
|
-
protoOf(TypeScriptEmitter).
|
|
2460
|
-
protoOf(TypeScriptEmitter).
|
|
2461
|
-
protoOf(TypeScriptEmitter).
|
|
2462
|
-
protoOf(TypeScriptEmitter).
|
|
2463
|
-
protoOf(TypeScriptEmitter).
|
|
2464
|
-
protoOf(TypeScriptEmitter).
|
|
2465
|
-
protoOf(TypeScriptEmitter).
|
|
2466
|
-
protoOf(TypeScriptEmitter).
|
|
2467
|
-
protoOf(TypeScriptEmitter).
|
|
2468
|
-
protoOf(TypeScriptEmitter).
|
|
2469
|
-
protoOf(TypeScriptEmitter).
|
|
2470
|
-
protoOf(TypeScriptEmitter).
|
|
2471
|
-
protoOf(TypeScriptEmitter).
|
|
2472
|
-
protoOf(TypeScriptEmitter).
|
|
2473
|
-
protoOf(TypeScriptEmitter).
|
|
2474
|
-
protoOf(TypeScriptIrEmitter).
|
|
2475
|
-
protoOf(TypeScriptIrEmitter).
|
|
2459
|
+
protoOf(TypeScriptEmitter).vt = emit_3;
|
|
2460
|
+
protoOf(TypeScriptEmitter).wt = emit_6;
|
|
2461
|
+
protoOf(TypeScriptEmitter).xt = emit_7;
|
|
2462
|
+
protoOf(TypeScriptEmitter).yt = emit_4;
|
|
2463
|
+
protoOf(TypeScriptEmitter).zt = emit_5;
|
|
2464
|
+
protoOf(TypeScriptEmitter).kv = emit_8;
|
|
2465
|
+
protoOf(TypeScriptEmitter).fv = emit_10;
|
|
2466
|
+
protoOf(TypeScriptEmitter).lv = emit_9;
|
|
2467
|
+
protoOf(TypeScriptEmitter).yu = emit_2;
|
|
2468
|
+
protoOf(TypeScriptEmitter).mv = emitValidator;
|
|
2469
|
+
protoOf(TypeScriptEmitter).z23 = sanitizeSymbol;
|
|
2470
|
+
protoOf(TypeScriptEmitter).p20 = sanitizeSymbol_0;
|
|
2471
|
+
protoOf(TypeScriptEmitter).a24 = emitPrimitive;
|
|
2472
|
+
protoOf(TypeScriptEmitter).y23 = emitClient;
|
|
2473
|
+
protoOf(TypeScriptEmitter).bu = emitClientEndpointRequest;
|
|
2474
|
+
protoOf(TypeScriptIrEmitter).g1z = emit_1;
|
|
2475
|
+
protoOf(TypeScriptIrEmitter).j1z = beforeGenerate;
|
|
2476
2476
|
//endregion
|
|
2477
2477
|
//region block: exports
|
|
2478
2478
|
export {
|