@flock/wirespec 0.22.6 → 0.22.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.mjs +11 -11
- package/arrow-arrow-core.mjs +150 -150
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt.mjs +1488 -1488
- package/colormath-root-colormath.mjs +441 -441
- package/kotlin-kotlin-stdlib.mjs +1622 -1600
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10028 -10028
- package/kotlin-rgxgen.mjs +1802 -1802
- package/kotlinx-io-kotlinx-io-core.mjs +414 -414
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1816 -1816
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1570 -1570
- package/mordant-mordant.mjs +1278 -1278
- package/package.json +1 -1
- package/wirespec-src-compiler-core.mjs +6104 -5969
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +177 -177
- package/wirespec-src-compiler-emitters-kotlin.mjs +132 -132
- package/wirespec-src-compiler-emitters-python.mjs +166 -166
- package/wirespec-src-compiler-emitters-rust.mjs +409 -409
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +165 -165
- package/wirespec-src-compiler-emitters-typescript.mjs +214 -214
- package/wirespec-src-compiler-emitters-wirespec.mjs +175 -195
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +282 -282
- package/wirespec-src-converter-asyncapi.mjs +849 -767
- package/wirespec-src-converter-asyncapi.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +596 -595
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-common.mjs +18 -18
- package/wirespec-src-converter-graphql.mjs +1063 -1063
- package/wirespec-src-converter-openapi.mjs +773 -661
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +1379 -1379
- package/wirespec-src-plugin-arguments.mjs +200 -190
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +112 -112
- package/wirespec-src-plugin-extensions.mjs +1034 -998
- package/wirespec-src-plugin-extensions.mjs.map +1 -1
- package/wirespec-src-plugin-npm.mjs +54 -54
- package/wirespec-src-tools-generator.mjs +32 -32
|
@@ -166,14 +166,14 @@ initMetadataForCompanion(Companion);
|
|
|
166
166
|
initMetadataForClass(TypeScriptEmitter, 'TypeScriptEmitter', TypeScriptEmitter, VOID, [IrEmitter]);
|
|
167
167
|
//endregion
|
|
168
168
|
function _get_sanitizationConfig__sns434($this) {
|
|
169
|
-
var tmp0 = $this.
|
|
169
|
+
var tmp0 = $this.p39_1;
|
|
170
170
|
var tmp = KProperty1;
|
|
171
171
|
// Inline function 'kotlin.getValue' call
|
|
172
172
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, TypeScriptEmitter$_get_sanitizationConfig_$ref_eg4rmu(), null);
|
|
173
173
|
return tmp0.o1();
|
|
174
174
|
}
|
|
175
175
|
function _get_modelSanitizationConfig__vgg831($this) {
|
|
176
|
-
var tmp0 = $this.
|
|
176
|
+
var tmp0 = $this.q39_1;
|
|
177
177
|
var tmp = KProperty1;
|
|
178
178
|
// Inline function 'kotlin.getValue' call
|
|
179
179
|
getPropertyCallableRef('modelSanitizationConfig', 1, tmp, TypeScriptEmitter$_get_modelSanitizationConfig_$ref_jl2735(), null);
|
|
@@ -201,7 +201,7 @@ function sanitizeSymbol($this, $receiver) {
|
|
|
201
201
|
return destination.toString();
|
|
202
202
|
}
|
|
203
203
|
function sanitizeKeywords($this, $receiver) {
|
|
204
|
-
return Companion_getInstance_0().
|
|
204
|
+
return Companion_getInstance_0().n37().i1($receiver) ? '_' + $receiver : $receiver;
|
|
205
205
|
}
|
|
206
206
|
function firstToLower($this, $receiver) {
|
|
207
207
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
@@ -223,7 +223,7 @@ function sanitizeParamName($this, identifier) {
|
|
|
223
223
|
var tmp0 = identifier.o1();
|
|
224
224
|
// Inline function 'kotlin.text.split' call
|
|
225
225
|
// Inline function 'kotlin.collections.filter' call
|
|
226
|
-
var tmp0_0 = Regex_init_$Create$('[.\\s-]+').
|
|
226
|
+
var tmp0_0 = Regex_init_$Create$('[.\\s-]+').fd(tmp0, 0);
|
|
227
227
|
// Inline function 'kotlin.collections.filterTo' call
|
|
228
228
|
var destination = ArrayList_init_$Create$();
|
|
229
229
|
var _iterator__ex2g4s = tmp0_0.t();
|
|
@@ -235,7 +235,7 @@ function sanitizeParamName($this, identifier) {
|
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
var parts = destination;
|
|
238
|
-
var name = parts.c1() > 1 ? (new Name(parts)).
|
|
238
|
+
var name = parts.c1() > 1 ? (new Name(parts)).cu() : identifier.o1();
|
|
239
239
|
return sanitizeKeywords($this, sanitizeSymbol($this, name));
|
|
240
240
|
}
|
|
241
241
|
function buildEndpointParams($this, endpoint) {
|
|
@@ -244,7 +244,7 @@ function buildEndpointParams($this, endpoint) {
|
|
|
244
244
|
// Inline function 'kotlin.apply' call
|
|
245
245
|
var this_0 = ArrayList_init_$Create$();
|
|
246
246
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
247
|
-
var tmp0 = endpoint.
|
|
247
|
+
var tmp0 = endpoint.ir_1;
|
|
248
248
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
249
249
|
var destination = ArrayList_init_$Create$();
|
|
250
250
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -258,36 +258,36 @@ function buildEndpointParams($this, endpoint) {
|
|
|
258
258
|
var _iterator__ex2g4s_0 = destination.t();
|
|
259
259
|
while (_iterator__ex2g4s_0.u()) {
|
|
260
260
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
261
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_0.
|
|
261
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_0.nr_1), emitTypeScriptReference($this, element_0.or_1.x1a(false)), element_0.or_1.ot()));
|
|
262
262
|
}
|
|
263
263
|
// Inline function 'kotlin.collections.forEach' call
|
|
264
|
-
var _iterator__ex2g4s_1 = get_fields(endpoint.
|
|
264
|
+
var _iterator__ex2g4s_1 = get_fields(endpoint.jr_1).t();
|
|
265
265
|
while (_iterator__ex2g4s_1.u()) {
|
|
266
266
|
var element_1 = _iterator__ex2g4s_1.v();
|
|
267
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_1.
|
|
267
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_1.pp_1), emitTypeScriptReference($this, element_1.qp_1.x1a(false)), element_1.qp_1.ot()));
|
|
268
268
|
}
|
|
269
269
|
// Inline function 'kotlin.collections.forEach' call
|
|
270
|
-
var _iterator__ex2g4s_2 = get_fields(endpoint.
|
|
270
|
+
var _iterator__ex2g4s_2 = get_fields(endpoint.kr_1).t();
|
|
271
271
|
while (_iterator__ex2g4s_2.u()) {
|
|
272
272
|
var element_2 = _iterator__ex2g4s_2.v();
|
|
273
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_2.
|
|
273
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_2.pp_1), emitTypeScriptReference($this, element_2.qp_1.x1a(false)), element_2.qp_1.ot()));
|
|
274
274
|
}
|
|
275
|
-
var tmp0_safe_receiver = first(endpoint.
|
|
275
|
+
var tmp0_safe_receiver = first(endpoint.lr_1).pr_1;
|
|
276
276
|
if (tmp0_safe_receiver == null)
|
|
277
277
|
null;
|
|
278
278
|
else {
|
|
279
279
|
// Inline function 'kotlin.let' call
|
|
280
|
-
this_0.x(new EndpointParam('body', emitTypeScriptReference($this, tmp0_safe_receiver.
|
|
280
|
+
this_0.x(new EndpointParam('body', emitTypeScriptReference($this, tmp0_safe_receiver.rr_1.x1a(false)), tmp0_safe_receiver.rr_1.ot()));
|
|
281
281
|
}
|
|
282
|
-
return this_0.
|
|
282
|
+
return this_0.r5();
|
|
283
283
|
}
|
|
284
284
|
function emitTypeScriptReference($this, ref) {
|
|
285
285
|
var tmp;
|
|
286
286
|
if (ref instanceof Dict) {
|
|
287
|
-
tmp = 'Record<string, ' + emitTypeScriptReference($this, ref.
|
|
287
|
+
tmp = 'Record<string, ' + emitTypeScriptReference($this, ref.cq_1) + '>';
|
|
288
288
|
} else {
|
|
289
289
|
if (ref instanceof Iterable) {
|
|
290
|
-
tmp = emitTypeScriptReference($this, ref.
|
|
290
|
+
tmp = emitTypeScriptReference($this, ref.zp_1) + '[]';
|
|
291
291
|
} else {
|
|
292
292
|
if (ref instanceof Unit) {
|
|
293
293
|
tmp = 'undefined';
|
|
@@ -296,10 +296,10 @@ function emitTypeScriptReference($this, ref) {
|
|
|
296
296
|
tmp = 'any';
|
|
297
297
|
} else {
|
|
298
298
|
if (ref instanceof Custom) {
|
|
299
|
-
tmp = sanitizeSymbol($this, ref.
|
|
299
|
+
tmp = sanitizeSymbol($this, ref.b1a_1);
|
|
300
300
|
} else {
|
|
301
301
|
if (ref instanceof Primitive) {
|
|
302
|
-
var tmp1_subject = ref.
|
|
302
|
+
var tmp1_subject = ref.d1a_1;
|
|
303
303
|
var tmp_0;
|
|
304
304
|
if (tmp1_subject instanceof String_0) {
|
|
305
305
|
tmp_0 = 'string';
|
|
@@ -335,17 +335,17 @@ function emitTypeScriptReference($this, ref) {
|
|
|
335
335
|
return tmp + (ref.ot() ? ' | undefined' : '');
|
|
336
336
|
}
|
|
337
337
|
function EndpointParam(name, type, nullable) {
|
|
338
|
-
this.
|
|
339
|
-
this.
|
|
340
|
-
this.
|
|
338
|
+
this.t39_1 = name;
|
|
339
|
+
this.u39_1 = type;
|
|
340
|
+
this.v39_1 = nullable;
|
|
341
341
|
}
|
|
342
342
|
protoOf(EndpointParam).toString = function () {
|
|
343
|
-
return 'EndpointParam(name=' + this.
|
|
343
|
+
return 'EndpointParam(name=' + this.t39_1 + ', type=' + this.u39_1 + ', nullable=' + this.v39_1 + ')';
|
|
344
344
|
};
|
|
345
345
|
protoOf(EndpointParam).hashCode = function () {
|
|
346
|
-
var result = getStringHashCode(this.
|
|
347
|
-
result = imul(result, 31) + getStringHashCode(this.
|
|
348
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
346
|
+
var result = getStringHashCode(this.t39_1);
|
|
347
|
+
result = imul(result, 31) + getStringHashCode(this.u39_1) | 0;
|
|
348
|
+
result = imul(result, 31) + getBooleanHashCode(this.v39_1) | 0;
|
|
349
349
|
return result;
|
|
350
350
|
};
|
|
351
351
|
protoOf(EndpointParam).equals = function (other) {
|
|
@@ -353,17 +353,17 @@ protoOf(EndpointParam).equals = function (other) {
|
|
|
353
353
|
return true;
|
|
354
354
|
if (!(other instanceof EndpointParam))
|
|
355
355
|
return false;
|
|
356
|
-
if (!(this.
|
|
356
|
+
if (!(this.t39_1 === other.t39_1))
|
|
357
357
|
return false;
|
|
358
|
-
if (!(this.
|
|
358
|
+
if (!(this.u39_1 === other.u39_1))
|
|
359
359
|
return false;
|
|
360
|
-
if (!(this.
|
|
360
|
+
if (!(this.v39_1 === other.v39_1))
|
|
361
361
|
return false;
|
|
362
362
|
return true;
|
|
363
363
|
};
|
|
364
364
|
function Companion() {
|
|
365
365
|
Companion_instance_0 = this;
|
|
366
|
-
this.
|
|
366
|
+
this.r39_1 = TypeScriptGenerator_getInstance();
|
|
367
367
|
var tmp = this;
|
|
368
368
|
// Inline function 'kotlin.collections.associateWith' call
|
|
369
369
|
var this_0 = listOf(['GeneratorFieldString', 'GeneratorFieldInteger64', 'GeneratorFieldInteger32', 'GeneratorFieldNumber64', 'GeneratorFieldNumber32', 'GeneratorFieldBoolean', 'GeneratorFieldBytes', 'GeneratorFieldEnum', 'GeneratorFieldUnion', 'GeneratorFieldArray', 'GeneratorFieldNullable', 'GeneratorFieldShape', 'GeneratorFieldDict']);
|
|
@@ -375,12 +375,12 @@ function Companion() {
|
|
|
375
375
|
// Inline function 'kotlin.text.lowercase' call
|
|
376
376
|
// Inline function 'kotlin.js.asDynamic' call
|
|
377
377
|
var tmp$ret$2 = removePrefix(element, 'GeneratorField').toLowerCase();
|
|
378
|
-
result.
|
|
378
|
+
result.w2(element, tmp$ret$2);
|
|
379
379
|
}
|
|
380
|
-
tmp.
|
|
380
|
+
tmp.s39_1 = result;
|
|
381
381
|
}
|
|
382
|
-
protoOf(Companion).
|
|
383
|
-
return this.
|
|
382
|
+
protoOf(Companion).n37 = function () {
|
|
383
|
+
return this.r39_1.x1c_1;
|
|
384
384
|
};
|
|
385
385
|
var Companion_instance_0;
|
|
386
386
|
function Companion_getInstance_0() {
|
|
@@ -393,13 +393,13 @@ function TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
393
393
|
}
|
|
394
394
|
function TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
395
395
|
return function (name) {
|
|
396
|
-
var sanitized = name.
|
|
396
|
+
var sanitized = name.yt_1.c1() > 1 ? name.cu() : sanitizeSymbol(this$0, name.bu());
|
|
397
397
|
return new Name(listOf_0(sanitized));
|
|
398
398
|
};
|
|
399
399
|
}
|
|
400
400
|
function TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0) {
|
|
401
401
|
return function (name) {
|
|
402
|
-
var sanitized = name.
|
|
402
|
+
var sanitized = name.yt_1.c1() > 1 ? name.cu() : sanitizeSymbol(this$0, name.bu());
|
|
403
403
|
return new Name(listOf_0(sanitized));
|
|
404
404
|
};
|
|
405
405
|
}
|
|
@@ -425,12 +425,12 @@ function TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
425
425
|
return function (stmt, tr) {
|
|
426
426
|
var tmp;
|
|
427
427
|
if (stmt instanceof VariableReference) {
|
|
428
|
-
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
428
|
+
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.ev_1));
|
|
429
429
|
} else {
|
|
430
430
|
if (stmt instanceof ConstructorStatement) {
|
|
431
|
-
var tmp_0 = tr.
|
|
431
|
+
var tmp_0 = tr.w18(stmt.gu_1);
|
|
432
432
|
// Inline function 'kotlin.collections.map' call
|
|
433
|
-
var this_0 = stmt.
|
|
433
|
+
var this_0 = stmt.hu_1;
|
|
434
434
|
// Inline function 'kotlin.collections.mapTo' call
|
|
435
435
|
var destination = ArrayList_init_$Create$_0(this_0.c1());
|
|
436
436
|
// Inline function 'kotlin.collections.iterator' call
|
|
@@ -441,13 +441,13 @@ function TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
441
441
|
var key = item.n1();
|
|
442
442
|
// Inline function 'kotlin.collections.component2' call
|
|
443
443
|
var value = item.o1();
|
|
444
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.
|
|
444
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.z18(value));
|
|
445
445
|
destination.x(tmp$ret$3);
|
|
446
446
|
}
|
|
447
447
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
448
448
|
} else {
|
|
449
449
|
if (stmt instanceof Assignment) {
|
|
450
|
-
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
450
|
+
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.hy_1), tr.z18(stmt.iy_1), stmt.jy_1);
|
|
451
451
|
} else {
|
|
452
452
|
tmp = transformChildren(stmt, tr);
|
|
453
453
|
}
|
|
@@ -458,7 +458,7 @@ function TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
458
458
|
}
|
|
459
459
|
function TypeScriptEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
460
460
|
return function () {
|
|
461
|
-
var tmp0_reservedKeywords = Companion_getInstance_0().
|
|
461
|
+
var tmp0_reservedKeywords = Companion_getInstance_0().n37();
|
|
462
462
|
var tmp = TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
463
463
|
var tmp_0 = TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
|
|
464
464
|
var tmp_1 = TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
|
|
@@ -472,7 +472,7 @@ function TypeScriptEmitter$_get_sanitizationConfig_$ref_eg4rmu() {
|
|
|
472
472
|
};
|
|
473
473
|
}
|
|
474
474
|
function TypeScriptEmitter$modelSanitizationConfig$delegate$lambda$lambda(name) {
|
|
475
|
-
return new Name(listOf_0(name.
|
|
475
|
+
return new Name(listOf_0(name.bu()));
|
|
476
476
|
}
|
|
477
477
|
function TypeScriptEmitter$modelSanitizationConfig$delegate$lambda$lambda_0(it) {
|
|
478
478
|
return it;
|
|
@@ -481,7 +481,7 @@ function TypeScriptEmitter$modelSanitizationConfig$delegate$lambda(this$0) {
|
|
|
481
481
|
return function () {
|
|
482
482
|
var tmp = _get_sanitizationConfig__sns434(this$0);
|
|
483
483
|
var tmp_0 = TypeScriptEmitter$modelSanitizationConfig$delegate$lambda$lambda;
|
|
484
|
-
return tmp.
|
|
484
|
+
return tmp.j1d(VOID, VOID, tmp_0, VOID, TypeScriptEmitter$modelSanitizationConfig$delegate$lambda$lambda_0);
|
|
485
485
|
};
|
|
486
486
|
}
|
|
487
487
|
function TypeScriptEmitter$_get_modelSanitizationConfig_$ref_jl2735() {
|
|
@@ -492,27 +492,27 @@ function TypeScriptEmitter$_get_modelSanitizationConfig_$ref_jl2735() {
|
|
|
492
492
|
function TypeScriptEmitter$emitShared$lambda(element, transformer) {
|
|
493
493
|
var tmp;
|
|
494
494
|
if (element instanceof Namespace) {
|
|
495
|
-
var injected = element.
|
|
495
|
+
var injected = element.lv_1.equals(Companion_getInstance().au('Wirespec')) ? listOf_0(new RawElement('export type Type = string')) : emptyList();
|
|
496
496
|
var tmp_0;
|
|
497
497
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
498
498
|
if (!injected.r()) {
|
|
499
499
|
// Inline function 'community.flock.wirespec.compiler.core.ir.withElements' call
|
|
500
|
-
var elements = plus(injected, element.
|
|
500
|
+
var elements = plus(injected, element.hv());
|
|
501
501
|
var tmp_1;
|
|
502
502
|
if (element instanceof File) {
|
|
503
|
-
tmp_1 = element.
|
|
503
|
+
tmp_1 = element.jv(VOID, elements);
|
|
504
504
|
} else {
|
|
505
505
|
if (element instanceof Struct) {
|
|
506
|
-
tmp_1 = element.
|
|
506
|
+
tmp_1 = element.qx(VOID, VOID, VOID, VOID, elements);
|
|
507
507
|
} else {
|
|
508
508
|
if (element instanceof Namespace) {
|
|
509
|
-
tmp_1 = element.
|
|
509
|
+
tmp_1 = element.qv(VOID, elements);
|
|
510
510
|
} else {
|
|
511
511
|
if (element instanceof Interface) {
|
|
512
|
-
tmp_1 = element.
|
|
512
|
+
tmp_1 = element.zv(VOID, elements);
|
|
513
513
|
} else {
|
|
514
514
|
if (element instanceof Enum) {
|
|
515
|
-
tmp_1 = element.
|
|
515
|
+
tmp_1 = element.ex(VOID, VOID, VOID, VOID, VOID, elements);
|
|
516
516
|
} else {
|
|
517
517
|
if (element instanceof Main) {
|
|
518
518
|
tmp_1 = element;
|
|
@@ -540,27 +540,27 @@ function TypeScriptEmitter$emitShared$lambda_0($api) {
|
|
|
540
540
|
return function (element, transformer) {
|
|
541
541
|
var tmp;
|
|
542
542
|
if (element instanceof Namespace) {
|
|
543
|
-
var injected = element.
|
|
543
|
+
var injected = element.lv_1.equals(Companion_getInstance().au('Wirespec')) ? listOf_0(new RawElement($api)) : emptyList();
|
|
544
544
|
var tmp_0;
|
|
545
545
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
546
546
|
if (!injected.r()) {
|
|
547
547
|
// Inline function 'community.flock.wirespec.compiler.core.ir.withElements' call
|
|
548
|
-
var elements = plus(element.
|
|
548
|
+
var elements = plus(element.hv(), injected);
|
|
549
549
|
var tmp_1;
|
|
550
550
|
if (element instanceof File) {
|
|
551
|
-
tmp_1 = element.
|
|
551
|
+
tmp_1 = element.jv(VOID, elements);
|
|
552
552
|
} else {
|
|
553
553
|
if (element instanceof Struct) {
|
|
554
|
-
tmp_1 = element.
|
|
554
|
+
tmp_1 = element.qx(VOID, VOID, VOID, VOID, elements);
|
|
555
555
|
} else {
|
|
556
556
|
if (element instanceof Namespace) {
|
|
557
|
-
tmp_1 = element.
|
|
557
|
+
tmp_1 = element.qv(VOID, elements);
|
|
558
558
|
} else {
|
|
559
559
|
if (element instanceof Interface) {
|
|
560
|
-
tmp_1 = element.
|
|
560
|
+
tmp_1 = element.zv(VOID, elements);
|
|
561
561
|
} else {
|
|
562
562
|
if (element instanceof Enum) {
|
|
563
|
-
tmp_1 = element.
|
|
563
|
+
tmp_1 = element.ex(VOID, VOID, VOID, VOID, VOID, elements);
|
|
564
564
|
} else {
|
|
565
565
|
if (element instanceof Main) {
|
|
566
566
|
tmp_1 = element;
|
|
@@ -588,13 +588,13 @@ function TypeScriptEmitter$emitShared$lambda_0($api) {
|
|
|
588
588
|
function TypeScriptEmitter$emitShared$lambda_1(element, transformer) {
|
|
589
589
|
var tmp;
|
|
590
590
|
if (element instanceof Struct) {
|
|
591
|
-
var tmp0_safe_receiver = Companion_getInstance_0().
|
|
591
|
+
var tmp0_safe_receiver = Companion_getInstance_0().s39_1.t2(element.fx_1.bu());
|
|
592
592
|
var tmp_0;
|
|
593
593
|
if (tmp0_safe_receiver == null) {
|
|
594
594
|
tmp_0 = null;
|
|
595
595
|
} else {
|
|
596
596
|
// Inline function 'kotlin.let' call
|
|
597
|
-
tmp_0 = element.
|
|
597
|
+
tmp_0 = element.qx(VOID, plus(listOf_0(new Field(Companion_getInstance().au('kind'), new StringLiteral(tmp0_safe_receiver))), element.gx_1));
|
|
598
598
|
}
|
|
599
599
|
var tmp1_elvis_lhs = tmp_0;
|
|
600
600
|
tmp = tmp1_elvis_lhs == null ? element : tmp1_elvis_lhs;
|
|
@@ -605,7 +605,7 @@ function TypeScriptEmitter$emitShared$lambda_1(element, transformer) {
|
|
|
605
605
|
return transformChildren_0(transformed, transformer);
|
|
606
606
|
}
|
|
607
607
|
function TypeScriptEmitter$emit$lambda(it) {
|
|
608
|
-
return 'export {' + it.
|
|
608
|
+
return 'export {' + it.es().o1() + "} from './" + it.es().o1() + "'";
|
|
609
609
|
}
|
|
610
610
|
function TypeScriptEmitter$emitGenerator$lambda($definition) {
|
|
611
611
|
return function (expr, t) {
|
|
@@ -614,24 +614,24 @@ function TypeScriptEmitter$emitGenerator$lambda($definition) {
|
|
|
614
614
|
var tmp_1;
|
|
615
615
|
var tmp_2;
|
|
616
616
|
if (expr instanceof FunctionCall) {
|
|
617
|
-
var tmp_3 = expr.
|
|
617
|
+
var tmp_3 = expr.oy_1;
|
|
618
618
|
tmp_2 = tmp_3 instanceof RawExpression;
|
|
619
619
|
} else {
|
|
620
620
|
tmp_2 = false;
|
|
621
621
|
}
|
|
622
622
|
if (tmp_2) {
|
|
623
|
-
var tmp_4 = expr.
|
|
624
|
-
tmp_1 = (tmp_4 instanceof RawExpression ? tmp_4 : THROW_CCE()).
|
|
623
|
+
var tmp_4 = expr.oy_1;
|
|
624
|
+
tmp_1 = (tmp_4 instanceof RawExpression ? tmp_4 : THROW_CCE()).gy_1 === $definition.rs_1.o1();
|
|
625
625
|
} else {
|
|
626
626
|
tmp_1 = false;
|
|
627
627
|
}
|
|
628
628
|
if (tmp_1) {
|
|
629
|
-
tmp_0 = expr.
|
|
629
|
+
tmp_0 = expr.qy_1.equals(Companion_getInstance().au('valueOf'));
|
|
630
630
|
} else {
|
|
631
631
|
tmp_0 = false;
|
|
632
632
|
}
|
|
633
633
|
if (tmp_0) {
|
|
634
|
-
var tmp0_elvis_lhs = expr.
|
|
634
|
+
var tmp0_elvis_lhs = expr.ry_1.t2(Companion_getInstance().au('label'));
|
|
635
635
|
tmp = tmp0_elvis_lhs == null ? expr : tmp0_elvis_lhs;
|
|
636
636
|
} else {
|
|
637
637
|
tmp = transformChildren_1(expr, t);
|
|
@@ -644,12 +644,12 @@ function TypeScriptEmitter$emitGenerator$lambda_0($definition) {
|
|
|
644
644
|
var tmp;
|
|
645
645
|
var tmp_0;
|
|
646
646
|
if (expr instanceof ConstructorStatement) {
|
|
647
|
-
tmp_0 = equals(expr.
|
|
647
|
+
tmp_0 = equals(expr.gu_1, Custom_init_$Create$($definition.ms_1.o1()));
|
|
648
648
|
} else {
|
|
649
649
|
tmp_0 = false;
|
|
650
650
|
}
|
|
651
651
|
if (tmp_0) {
|
|
652
|
-
var tmp0_elvis_lhs = expr.
|
|
652
|
+
var tmp0_elvis_lhs = expr.hu_1.t2(Companion_getInstance().au('value'));
|
|
653
653
|
tmp = tmp0_elvis_lhs == null ? expr : tmp0_elvis_lhs;
|
|
654
654
|
} else {
|
|
655
655
|
tmp = transformChildren_1(expr, t);
|
|
@@ -660,24 +660,24 @@ function TypeScriptEmitter$emitGenerator$lambda_0($definition) {
|
|
|
660
660
|
function TypeScriptEmitter$emitGenerator$lambda_1(expr, t) {
|
|
661
661
|
var tmp;
|
|
662
662
|
if (expr instanceof ConstructorStatement) {
|
|
663
|
-
var tmp_0 = expr.
|
|
663
|
+
var tmp_0 = expr.gu_1;
|
|
664
664
|
var tmp0_safe_receiver = tmp_0 instanceof Custom_0 ? tmp_0 : null;
|
|
665
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
666
|
-
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
665
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.ru_1;
|
|
666
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.bu();
|
|
667
667
|
var typeName = tmp2_safe_receiver == null ? null : removePrefix(tmp2_safe_receiver, 'Wirespec.');
|
|
668
668
|
var tmp_1;
|
|
669
669
|
if (typeName == null) {
|
|
670
670
|
tmp_1 = null;
|
|
671
671
|
} else {
|
|
672
672
|
// Inline function 'kotlin.let' call
|
|
673
|
-
tmp_1 = Companion_getInstance_0().
|
|
673
|
+
tmp_1 = Companion_getInstance_0().s39_1.t2(typeName);
|
|
674
674
|
}
|
|
675
675
|
var kind = tmp_1;
|
|
676
676
|
var tmp_2;
|
|
677
677
|
if (!(kind == null)) {
|
|
678
|
-
var tmp_3 = mapOf(to(Companion_getInstance().
|
|
678
|
+
var tmp_3 = mapOf(to(Companion_getInstance().au('kind'), new Literal(kind, String_instance)));
|
|
679
679
|
// Inline function 'kotlin.collections.mapValues' call
|
|
680
|
-
var this_0 = expr.
|
|
680
|
+
var this_0 = expr.hu_1;
|
|
681
681
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
682
682
|
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.c1()));
|
|
683
683
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
@@ -687,10 +687,10 @@ function TypeScriptEmitter$emitGenerator$lambda_1(expr, t) {
|
|
|
687
687
|
var tmp_4 = element.n1();
|
|
688
688
|
// Inline function 'kotlin.collections.component2' call
|
|
689
689
|
var v = element.o1();
|
|
690
|
-
var tmp$ret$6 = t.
|
|
691
|
-
destination.
|
|
690
|
+
var tmp$ret$6 = t.z18(v);
|
|
691
|
+
destination.w2(tmp_4, tmp$ret$6);
|
|
692
692
|
}
|
|
693
|
-
tmp_2 = new ConstructorStatement(expr.
|
|
693
|
+
tmp_2 = new ConstructorStatement(expr.gu_1, plus_0(tmp_3, destination));
|
|
694
694
|
} else {
|
|
695
695
|
tmp_2 = transformChildren(expr, t);
|
|
696
696
|
}
|
|
@@ -717,17 +717,17 @@ function TypeScriptEmitter$emitGenerator$lambda_5($generatorOwnName, $generatorR
|
|
|
717
717
|
var tmp_0;
|
|
718
718
|
var tmp_1;
|
|
719
719
|
if (expr instanceof RawExpression) {
|
|
720
|
-
tmp_1 = endsWith(expr.
|
|
720
|
+
tmp_1 = endsWith(expr.gy_1, 'Generator');
|
|
721
721
|
} else {
|
|
722
722
|
tmp_1 = false;
|
|
723
723
|
}
|
|
724
724
|
if (tmp_1) {
|
|
725
|
-
tmp_0 = !(expr.
|
|
725
|
+
tmp_0 = !(expr.gy_1 === $generatorOwnName);
|
|
726
726
|
} else {
|
|
727
727
|
tmp_0 = false;
|
|
728
728
|
}
|
|
729
729
|
if (tmp_0) {
|
|
730
|
-
$generatorRefs.x(expr.
|
|
730
|
+
$generatorRefs.x(expr.gy_1);
|
|
731
731
|
tmp = Unit_instance;
|
|
732
732
|
}
|
|
733
733
|
return transformChildren_1(expr, t);
|
|
@@ -742,22 +742,22 @@ function TypeScriptEmitter$emit$injectApiConst$lambda($endpoint) {
|
|
|
742
742
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
743
743
|
if (!injected.r()) {
|
|
744
744
|
// Inline function 'community.flock.wirespec.compiler.core.ir.withElements' call
|
|
745
|
-
var elements = plus(element.
|
|
745
|
+
var elements = plus(element.hv(), injected);
|
|
746
746
|
var tmp_1;
|
|
747
747
|
if (element instanceof File) {
|
|
748
|
-
tmp_1 = element.
|
|
748
|
+
tmp_1 = element.jv(VOID, elements);
|
|
749
749
|
} else {
|
|
750
750
|
if (element instanceof Struct) {
|
|
751
|
-
tmp_1 = element.
|
|
751
|
+
tmp_1 = element.qx(VOID, VOID, VOID, VOID, elements);
|
|
752
752
|
} else {
|
|
753
753
|
if (element instanceof Namespace) {
|
|
754
|
-
tmp_1 = element.
|
|
754
|
+
tmp_1 = element.qv(VOID, elements);
|
|
755
755
|
} else {
|
|
756
756
|
if (element instanceof Interface) {
|
|
757
|
-
tmp_1 = element.
|
|
757
|
+
tmp_1 = element.zv(VOID, elements);
|
|
758
758
|
} else {
|
|
759
759
|
if (element instanceof Enum) {
|
|
760
|
-
tmp_1 = element.
|
|
760
|
+
tmp_1 = element.ex(VOID, VOID, VOID, VOID, VOID, elements);
|
|
761
761
|
} else {
|
|
762
762
|
if (element instanceof Main) {
|
|
763
763
|
tmp_1 = element;
|
|
@@ -789,14 +789,14 @@ function emit$injectApiConst(_this__u8e3s4, $endpoint) {
|
|
|
789
789
|
var tmp = scope;
|
|
790
790
|
// Inline function 'community.flock.wirespec.compiler.core.ir.injectAfter' call
|
|
791
791
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
792
|
-
var this_0 = scope.
|
|
792
|
+
var this_0 = scope.e19_1;
|
|
793
793
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
794
794
|
// Inline function 'kotlin.apply' call
|
|
795
795
|
var this_1 = new TransformerBuilder();
|
|
796
|
-
this_1.
|
|
797
|
-
var tmp$ret$5 = this_1.
|
|
798
|
-
tmp.
|
|
799
|
-
var tmp_0 = scope.
|
|
796
|
+
this_1.y19(TypeScriptEmitter$emit$injectApiConst$lambda($endpoint));
|
|
797
|
+
var tmp$ret$5 = this_1.t19();
|
|
798
|
+
tmp.e19_1 = transform(this_0, tmp$ret$5);
|
|
799
|
+
var tmp_0 = scope.e19_1;
|
|
800
800
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
801
801
|
}
|
|
802
802
|
function emit$applyCallParamsIfNeeded(_this__u8e3s4, hasRequestParams) {
|
|
@@ -804,26 +804,26 @@ function emit$applyCallParamsIfNeeded(_this__u8e3s4, hasRequestParams) {
|
|
|
804
804
|
}
|
|
805
805
|
function TypeScriptEmitter$emitClient$lambda(this$0) {
|
|
806
806
|
return function (it) {
|
|
807
|
-
var methodName = firstToLower(this$0, it.
|
|
807
|
+
var methodName = firstToLower(this$0, it.gr_1.o1());
|
|
808
808
|
return ' ...' + methodName + 'Client(serialization, transportation),';
|
|
809
809
|
};
|
|
810
810
|
}
|
|
811
811
|
function TypeScriptEmitter() {
|
|
812
812
|
Companion_getInstance_0();
|
|
813
|
-
this.
|
|
814
|
-
this.
|
|
813
|
+
this.n39_1 = TypeScriptGenerator_getInstance();
|
|
814
|
+
this.o39_1 = FileExtension_TypeScript_getInstance();
|
|
815
815
|
var tmp = this;
|
|
816
|
-
tmp.
|
|
816
|
+
tmp.p39_1 = lazy(TypeScriptEmitter$sanitizationConfig$delegate$lambda(this));
|
|
817
817
|
var tmp_0 = this;
|
|
818
|
-
tmp_0.
|
|
818
|
+
tmp_0.q39_1 = lazy(TypeScriptEmitter$modelSanitizationConfig$delegate$lambda(this));
|
|
819
819
|
}
|
|
820
|
-
protoOf(TypeScriptEmitter).
|
|
821
|
-
return this.
|
|
820
|
+
protoOf(TypeScriptEmitter).l1b = function () {
|
|
821
|
+
return this.n39_1;
|
|
822
822
|
};
|
|
823
|
-
protoOf(TypeScriptEmitter).
|
|
824
|
-
return this.
|
|
823
|
+
protoOf(TypeScriptEmitter).xp = function () {
|
|
824
|
+
return this.o39_1;
|
|
825
825
|
};
|
|
826
|
-
protoOf(TypeScriptEmitter).
|
|
826
|
+
protoOf(TypeScriptEmitter).g1b = function () {
|
|
827
827
|
var packageName = Companion_instance.at('community.flock.wirespec');
|
|
828
828
|
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}';
|
|
829
829
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
@@ -833,41 +833,41 @@ protoOf(TypeScriptEmitter).c1b = function () {
|
|
|
833
833
|
var tmp = scope;
|
|
834
834
|
// Inline function 'community.flock.wirespec.compiler.core.ir.injectBefore' call
|
|
835
835
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
836
|
-
var this_1 = scope.
|
|
836
|
+
var this_1 = scope.e19_1;
|
|
837
837
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
838
838
|
// Inline function 'kotlin.apply' call
|
|
839
839
|
var this_2 = new TransformerBuilder();
|
|
840
|
-
this_2.
|
|
841
|
-
var tmp$ret$5 = this_2.
|
|
842
|
-
tmp.
|
|
840
|
+
this_2.y19(TypeScriptEmitter$emitShared$lambda);
|
|
841
|
+
var tmp$ret$5 = this_2.t19();
|
|
842
|
+
tmp.e19_1 = transform(this_1, tmp$ret$5);
|
|
843
843
|
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.injectAfter' call
|
|
844
844
|
var tmp_0 = scope;
|
|
845
845
|
// Inline function 'community.flock.wirespec.compiler.core.ir.injectAfter' call
|
|
846
846
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
847
|
-
var this_3 = scope.
|
|
847
|
+
var this_3 = scope.e19_1;
|
|
848
848
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
849
849
|
// Inline function 'kotlin.apply' call
|
|
850
850
|
var this_4 = new TransformerBuilder();
|
|
851
|
-
this_4.
|
|
852
|
-
var tmp$ret$11 = this_4.
|
|
853
|
-
tmp_0.
|
|
851
|
+
this_4.y19(TypeScriptEmitter$emitShared$lambda_0(api));
|
|
852
|
+
var tmp$ret$11 = this_4.t19();
|
|
853
|
+
tmp_0.e19_1 = transform(this_3, tmp$ret$11);
|
|
854
854
|
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matchingElements' call
|
|
855
855
|
var tmp_1 = scope;
|
|
856
856
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
857
|
-
var this_5 = scope.
|
|
857
|
+
var this_5 = scope.e19_1;
|
|
858
858
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
859
859
|
// Inline function 'kotlin.apply' call
|
|
860
860
|
var this_6 = new TransformerBuilder();
|
|
861
|
-
this_6.
|
|
862
|
-
var tmp$ret$16 = this_6.
|
|
863
|
-
tmp_1.
|
|
864
|
-
var tmp_2 = scope.
|
|
861
|
+
this_6.y19(TypeScriptEmitter$emitShared$lambda_1);
|
|
862
|
+
var tmp$ret$16 = this_6.t19();
|
|
863
|
+
tmp_1.e19_1 = transform(this_5, tmp$ret$16);
|
|
864
|
+
var tmp_2 = scope.e19_1;
|
|
865
865
|
return isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
866
866
|
};
|
|
867
|
-
protoOf(TypeScriptEmitter).
|
|
867
|
+
protoOf(TypeScriptEmitter).uo = function (ast, logger) {
|
|
868
868
|
var tmp = emit.call(this, ast, logger);
|
|
869
869
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
870
|
-
var this_0 = ast.
|
|
870
|
+
var this_0 = ast.fp_1;
|
|
871
871
|
// Inline function 'kotlin.collections.flatMap' call
|
|
872
872
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
873
873
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -875,7 +875,7 @@ protoOf(TypeScriptEmitter).to = function (ast, logger) {
|
|
|
875
875
|
var _iterator__ex2g4s = tmp0.t();
|
|
876
876
|
while (_iterator__ex2g4s.u()) {
|
|
877
877
|
var element = _iterator__ex2g4s.v();
|
|
878
|
-
var list = new NonEmptyList(element.
|
|
878
|
+
var list = new NonEmptyList(element.hp_1);
|
|
879
879
|
addAll(destination, list);
|
|
880
880
|
}
|
|
881
881
|
var tmp$ret$0 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -898,11 +898,11 @@ protoOf(TypeScriptEmitter).to = function (ast, logger) {
|
|
|
898
898
|
var element_1 = _iterator__ex2g4s_1.v();
|
|
899
899
|
var key = namespace(element_1);
|
|
900
900
|
// Inline function 'kotlin.collections.getOrPut' call
|
|
901
|
-
var value = destination_1.
|
|
901
|
+
var value = destination_1.t2(key);
|
|
902
902
|
var tmp_0;
|
|
903
903
|
if (value == null) {
|
|
904
904
|
var answer = ArrayList_init_$Create$();
|
|
905
|
-
destination_1.
|
|
905
|
+
destination_1.w2(key, answer);
|
|
906
906
|
tmp_0 = answer;
|
|
907
907
|
} else {
|
|
908
908
|
tmp_0 = value;
|
|
@@ -921,18 +921,18 @@ protoOf(TypeScriptEmitter).to = function (ast, logger) {
|
|
|
921
921
|
var ns = item.n1();
|
|
922
922
|
// Inline function 'kotlin.collections.component2' call
|
|
923
923
|
var defs = item.o1();
|
|
924
|
-
var tmp_1 = ns + '/index.' + this.
|
|
924
|
+
var tmp_1 = ns + '/index.' + this.xp().yr_1;
|
|
925
925
|
var tmp$ret$15 = new Emitted(tmp_1, joinToString(defs, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda));
|
|
926
926
|
destination_2.x(tmp$ret$15);
|
|
927
927
|
}
|
|
928
928
|
return NonEmptyList__plus_impl_xqmb9(tmp, destination_2);
|
|
929
929
|
};
|
|
930
|
-
protoOf(TypeScriptEmitter).
|
|
930
|
+
protoOf(TypeScriptEmitter).ds = function (definition, module_0, logger) {
|
|
931
931
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
932
932
|
var subPackageName = plus_1(Companion_instance.at(''), definition);
|
|
933
|
-
return new File(Companion_getInstance().
|
|
933
|
+
return new File(Companion_getInstance().au(subPackageName.dt() + sanitizeSymbol(this, file.fv_1.du())), plus(listOf_0(import_0('../Wirespec', 'Wirespec')), file.gv_1));
|
|
934
934
|
};
|
|
935
|
-
protoOf(TypeScriptEmitter).
|
|
935
|
+
protoOf(TypeScriptEmitter).o1b = function (definition, module_0) {
|
|
936
936
|
var tmp;
|
|
937
937
|
if (definition instanceof Type) {
|
|
938
938
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -941,16 +941,16 @@ protoOf(TypeScriptEmitter).k1b = function (definition, module_0) {
|
|
|
941
941
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
942
942
|
var this_0 = convertToGenerator_1(definition);
|
|
943
943
|
var scope = new TransformScope(this_0);
|
|
944
|
-
scope.
|
|
945
|
-
var tmp_0 = scope.
|
|
944
|
+
scope.v19(TypeScriptEmitter$emitGenerator$lambda(definition));
|
|
945
|
+
var tmp_0 = scope.e19_1;
|
|
946
946
|
tmp = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
947
947
|
} else {
|
|
948
948
|
if (definition instanceof Refined) {
|
|
949
949
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
950
950
|
var this_1 = convertToGenerator_0(definition);
|
|
951
951
|
var scope_0 = new TransformScope(this_1);
|
|
952
|
-
scope_0.
|
|
953
|
-
var tmp_1 = scope_0.
|
|
952
|
+
scope_0.v19(TypeScriptEmitter$emitGenerator$lambda_0(definition));
|
|
953
|
+
var tmp_1 = scope_0.e19_1;
|
|
954
954
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
955
955
|
} else {
|
|
956
956
|
if (definition instanceof Union) {
|
|
@@ -964,10 +964,10 @@ protoOf(TypeScriptEmitter).k1b = function (definition, module_0) {
|
|
|
964
964
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
965
965
|
var this_2 = sanitizeNames(tmp, _get_sanitizationConfig__sns434(this));
|
|
966
966
|
var scope_1 = new TransformScope(this_2);
|
|
967
|
-
scope_1.
|
|
968
|
-
var tmp_2 = scope_1.
|
|
967
|
+
scope_1.v19(TypeScriptEmitter$emitGenerator$lambda_1);
|
|
968
|
+
var tmp_2 = scope_1.e19_1;
|
|
969
969
|
var generatorFile = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
970
|
-
var generatorOwnName = definition.
|
|
970
|
+
var generatorOwnName = definition.es().o1() + 'Generator';
|
|
971
971
|
var tmp_3 = asSequence(collectCustomTypeNames(generatorFile));
|
|
972
972
|
var tmp_4 = filterNot(tmp_3, TypeScriptEmitter$emitGenerator$lambda_2);
|
|
973
973
|
var tmp_5 = filterNot(tmp_4, TypeScriptEmitter$emitGenerator$lambda_3(generatorOwnName));
|
|
@@ -976,8 +976,8 @@ protoOf(TypeScriptEmitter).k1b = function (definition, module_0) {
|
|
|
976
976
|
var generatorRefs = LinkedHashSet_init_$Create$();
|
|
977
977
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
978
978
|
var scope_2 = new TransformScope(generatorFile);
|
|
979
|
-
scope_2.
|
|
980
|
-
var tmp_6 = scope_2.
|
|
979
|
+
scope_2.v19(TypeScriptEmitter$emitGenerator$lambda_5(generatorOwnName, generatorRefs));
|
|
980
|
+
var tmp_6 = scope_2.e19_1;
|
|
981
981
|
isInterface(tmp_6, Element) || THROW_CCE();
|
|
982
982
|
// Inline function 'kotlin.collections.filter' call
|
|
983
983
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -1021,9 +1021,9 @@ protoOf(TypeScriptEmitter).k1b = function (definition, module_0) {
|
|
|
1021
1021
|
}
|
|
1022
1022
|
var modelImports = destination_2;
|
|
1023
1023
|
var subPackageName = plus_2(Companion_instance.at(''), 'generator');
|
|
1024
|
-
return new File(Companion_getInstance().
|
|
1024
|
+
return new File(Companion_getInstance().au(subPackageName.dt() + sanitizeSymbol(this, generatorFile.fv_1.du())), plus(plus(plus(listOf_0(import_0('../Wirespec', 'Wirespec')), modelImports), generatorImports), generatorFile.gv_1));
|
|
1025
1025
|
};
|
|
1026
|
-
protoOf(TypeScriptEmitter).
|
|
1026
|
+
protoOf(TypeScriptEmitter).vs = function (type, module_0) {
|
|
1027
1027
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1028
1028
|
var this_0 = importReferences(type);
|
|
1029
1029
|
var set = HashSet_init_$Create$();
|
|
@@ -1031,7 +1031,7 @@ protoOf(TypeScriptEmitter).us = function (type, module_0) {
|
|
|
1031
1031
|
var _iterator__ex2g4s = this_0.t();
|
|
1032
1032
|
while (_iterator__ex2g4s.u()) {
|
|
1033
1033
|
var e = _iterator__ex2g4s.v();
|
|
1034
|
-
var key = e.
|
|
1034
|
+
var key = e.b1a_1;
|
|
1035
1035
|
if (set.x(key)) {
|
|
1036
1036
|
list.x(e);
|
|
1037
1037
|
}
|
|
@@ -1042,7 +1042,7 @@ protoOf(TypeScriptEmitter).us = function (type, module_0) {
|
|
|
1042
1042
|
var _iterator__ex2g4s_0 = list.t();
|
|
1043
1043
|
while (_iterator__ex2g4s_0.u()) {
|
|
1044
1044
|
var item = _iterator__ex2g4s_0.v();
|
|
1045
|
-
var tmp$ret$4 = import_0('./' + item.
|
|
1045
|
+
var tmp$ret$4 = import_0('./' + item.b1a_1, item.b1a_1);
|
|
1046
1046
|
destination.x(tmp$ret$4);
|
|
1047
1047
|
}
|
|
1048
1048
|
var typeImports = destination;
|
|
@@ -1050,16 +1050,16 @@ protoOf(TypeScriptEmitter).us = function (type, module_0) {
|
|
|
1050
1050
|
var tmp;
|
|
1051
1051
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1052
1052
|
if (!typeImports.r()) {
|
|
1053
|
-
tmp = file.
|
|
1053
|
+
tmp = file.jv(VOID, plus(typeImports, file.gv_1));
|
|
1054
1054
|
} else {
|
|
1055
1055
|
tmp = file;
|
|
1056
1056
|
}
|
|
1057
1057
|
return tmp;
|
|
1058
1058
|
};
|
|
1059
|
-
protoOf(TypeScriptEmitter).
|
|
1059
|
+
protoOf(TypeScriptEmitter).ts = function (enum_0, module_0) {
|
|
1060
1060
|
return sanitizeNames(convert_1(enum_0), _get_sanitizationConfig__sns434(this));
|
|
1061
1061
|
};
|
|
1062
|
-
protoOf(TypeScriptEmitter).
|
|
1062
|
+
protoOf(TypeScriptEmitter).js = function (union) {
|
|
1063
1063
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1064
1064
|
var this_0 = importReferences(union);
|
|
1065
1065
|
var set = HashSet_init_$Create$();
|
|
@@ -1067,7 +1067,7 @@ protoOf(TypeScriptEmitter).is = function (union) {
|
|
|
1067
1067
|
var _iterator__ex2g4s = this_0.t();
|
|
1068
1068
|
while (_iterator__ex2g4s.u()) {
|
|
1069
1069
|
var e = _iterator__ex2g4s.v();
|
|
1070
|
-
var key = e.
|
|
1070
|
+
var key = e.b1a_1;
|
|
1071
1071
|
if (set.x(key)) {
|
|
1072
1072
|
list.x(e);
|
|
1073
1073
|
}
|
|
@@ -1078,7 +1078,7 @@ protoOf(TypeScriptEmitter).is = function (union) {
|
|
|
1078
1078
|
var _iterator__ex2g4s_0 = list.t();
|
|
1079
1079
|
while (_iterator__ex2g4s_0.u()) {
|
|
1080
1080
|
var item = _iterator__ex2g4s_0.v();
|
|
1081
|
-
var tmp$ret$4 = import_0('../model', item.
|
|
1081
|
+
var tmp$ret$4 = import_0('../model', item.b1a_1, true);
|
|
1082
1082
|
destination.x(tmp$ret$4);
|
|
1083
1083
|
}
|
|
1084
1084
|
var imports = destination;
|
|
@@ -1086,19 +1086,19 @@ protoOf(TypeScriptEmitter).is = function (union) {
|
|
|
1086
1086
|
var tmp;
|
|
1087
1087
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1088
1088
|
if (!imports.r()) {
|
|
1089
|
-
tmp = file.
|
|
1089
|
+
tmp = file.jv(VOID, plus(imports, file.gv_1));
|
|
1090
1090
|
} else {
|
|
1091
1091
|
tmp = file;
|
|
1092
1092
|
}
|
|
1093
1093
|
return tmp;
|
|
1094
1094
|
};
|
|
1095
|
-
protoOf(TypeScriptEmitter).
|
|
1095
|
+
protoOf(TypeScriptEmitter).os = function (refined) {
|
|
1096
1096
|
var converted = convert_3(refined);
|
|
1097
|
-
var constraintExpr = convertConstraint(refined.
|
|
1098
|
-
var validatorStr = TypeScriptGenerator_getInstance().
|
|
1099
|
-
return new File(converted.
|
|
1097
|
+
var constraintExpr = convertConstraint(refined.ns_1, new VariableReference(Companion_getInstance().au('value')));
|
|
1098
|
+
var validatorStr = TypeScriptGenerator_getInstance().a1d(constraintExpr);
|
|
1099
|
+
return new File(converted.fv_1, listOf([new RawElement('export type ' + converted.fv_1.du() + ' = ' + emitTypeScriptReference(this, refined.ns_1) + ';'), new RawElement('export const validate' + refined.ms_1.o1() + ' = (value: ' + emitTypeScriptReference(this, refined.ns_1) + ') =>\n ' + validatorStr + ';')]));
|
|
1100
1100
|
};
|
|
1101
|
-
protoOf(TypeScriptEmitter).
|
|
1101
|
+
protoOf(TypeScriptEmitter).us = function (endpoint) {
|
|
1102
1102
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1103
1103
|
var this_0 = importReferences(endpoint);
|
|
1104
1104
|
var set = HashSet_init_$Create$();
|
|
@@ -1106,7 +1106,7 @@ protoOf(TypeScriptEmitter).ts = function (endpoint) {
|
|
|
1106
1106
|
var _iterator__ex2g4s = this_0.t();
|
|
1107
1107
|
while (_iterator__ex2g4s.u()) {
|
|
1108
1108
|
var e = _iterator__ex2g4s.v();
|
|
1109
|
-
var key = e.
|
|
1109
|
+
var key = e.b1a_1;
|
|
1110
1110
|
if (set.x(key)) {
|
|
1111
1111
|
list.x(e);
|
|
1112
1112
|
}
|
|
@@ -1117,7 +1117,7 @@ protoOf(TypeScriptEmitter).ts = function (endpoint) {
|
|
|
1117
1117
|
var _iterator__ex2g4s_0 = list.t();
|
|
1118
1118
|
while (_iterator__ex2g4s_0.u()) {
|
|
1119
1119
|
var item = _iterator__ex2g4s_0.v();
|
|
1120
|
-
var tmp$ret$4 = import_0('../model', item.
|
|
1120
|
+
var tmp$ret$4 = import_0('../model', item.b1a_1, true);
|
|
1121
1121
|
destination.x(tmp$ret$4);
|
|
1122
1122
|
}
|
|
1123
1123
|
var imports = destination;
|
|
@@ -1126,24 +1126,24 @@ protoOf(TypeScriptEmitter).ts = function (endpoint) {
|
|
|
1126
1126
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
1127
1127
|
var this_1 = stripTrailingSpaceFromErrorMessage(convert_4(endpoint));
|
|
1128
1128
|
var scope = new TransformScope(this_1);
|
|
1129
|
-
scope.
|
|
1130
|
-
var tmp = scope.
|
|
1129
|
+
scope.j19(transformPatternSwitchToValueSwitch());
|
|
1130
|
+
var tmp = scope.e19_1;
|
|
1131
1131
|
var tmp$ret$6 = isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1132
1132
|
// Inline function 'kotlin.let' call
|
|
1133
|
-
var it = sanitizeNames(emit$injectApiConst(emit$applyCallParamsIfNeeded(tmp$ret$6, hasRequestParams), endpoint).
|
|
1133
|
+
var it = sanitizeNames(emit$injectApiConst(emit$applyCallParamsIfNeeded(tmp$ret$6, hasRequestParams), endpoint).jv(Companion_getInstance().au(sanitize(this, endpoint.gr_1))), _get_sanitizationConfig__sns434(this));
|
|
1134
1134
|
var tmp_0;
|
|
1135
1135
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1136
1136
|
if (!imports.r()) {
|
|
1137
|
-
tmp_0 = it.
|
|
1137
|
+
tmp_0 = it.jv(VOID, plus(imports, it.gv_1));
|
|
1138
1138
|
} else {
|
|
1139
1139
|
tmp_0 = it;
|
|
1140
1140
|
}
|
|
1141
1141
|
return tmp_0;
|
|
1142
1142
|
};
|
|
1143
|
-
protoOf(TypeScriptEmitter).
|
|
1143
|
+
protoOf(TypeScriptEmitter).is = function (channel) {
|
|
1144
1144
|
return sanitizeNames(convert_5(channel), _get_sanitizationConfig__sns434(this));
|
|
1145
1145
|
};
|
|
1146
|
-
protoOf(TypeScriptEmitter).
|
|
1146
|
+
protoOf(TypeScriptEmitter).hs = function (rpc) {
|
|
1147
1147
|
// Inline function 'kotlin.let' call
|
|
1148
1148
|
var file = sanitizeNames(convert_6(rpc), _get_sanitizationConfig__sns434(this));
|
|
1149
1149
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
@@ -1153,7 +1153,7 @@ protoOf(TypeScriptEmitter).gs = function (rpc) {
|
|
|
1153
1153
|
var _iterator__ex2g4s = this_0.t();
|
|
1154
1154
|
while (_iterator__ex2g4s.u()) {
|
|
1155
1155
|
var e = _iterator__ex2g4s.v();
|
|
1156
|
-
var key = e.
|
|
1156
|
+
var key = e.b1a_1;
|
|
1157
1157
|
if (set.x(key)) {
|
|
1158
1158
|
list.x(e);
|
|
1159
1159
|
}
|
|
@@ -1164,7 +1164,7 @@ protoOf(TypeScriptEmitter).gs = function (rpc) {
|
|
|
1164
1164
|
var _iterator__ex2g4s_0 = list.t();
|
|
1165
1165
|
while (_iterator__ex2g4s_0.u()) {
|
|
1166
1166
|
var item = _iterator__ex2g4s_0.v();
|
|
1167
|
-
var tmp$ret$6 = import_0('../model', item.
|
|
1167
|
+
var tmp$ret$6 = import_0('../model', item.b1a_1, true);
|
|
1168
1168
|
destination.x(tmp$ret$6);
|
|
1169
1169
|
}
|
|
1170
1170
|
// Inline function 'kotlin.takeIf' call
|
|
@@ -1181,13 +1181,13 @@ protoOf(TypeScriptEmitter).gs = function (rpc) {
|
|
|
1181
1181
|
tmp_0 = null;
|
|
1182
1182
|
} else {
|
|
1183
1183
|
// Inline function 'kotlin.let' call
|
|
1184
|
-
tmp_0 = file.
|
|
1184
|
+
tmp_0 = file.jv(VOID, plus(tmp0_safe_receiver, file.gv_1));
|
|
1185
1185
|
}
|
|
1186
1186
|
var tmp1_elvis_lhs = tmp_0;
|
|
1187
1187
|
return tmp1_elvis_lhs == null ? file : tmp1_elvis_lhs;
|
|
1188
1188
|
};
|
|
1189
|
-
protoOf(TypeScriptEmitter).
|
|
1190
|
-
var endpointName = endpoint.
|
|
1189
|
+
protoOf(TypeScriptEmitter).n1b = function (endpoint) {
|
|
1190
|
+
var endpointName = endpoint.gr_1.o1();
|
|
1191
1191
|
var methodName = firstToLower(this, endpointName);
|
|
1192
1192
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1193
1193
|
var this_0 = importReferences(endpoint);
|
|
@@ -1196,7 +1196,7 @@ protoOf(TypeScriptEmitter).j1b = function (endpoint) {
|
|
|
1196
1196
|
var _iterator__ex2g4s = this_0.t();
|
|
1197
1197
|
while (_iterator__ex2g4s.u()) {
|
|
1198
1198
|
var e = _iterator__ex2g4s.v();
|
|
1199
|
-
var key = e.
|
|
1199
|
+
var key = e.b1a_1;
|
|
1200
1200
|
if (set.x(key)) {
|
|
1201
1201
|
list.x(e);
|
|
1202
1202
|
}
|
|
@@ -1207,7 +1207,7 @@ protoOf(TypeScriptEmitter).j1b = function (endpoint) {
|
|
|
1207
1207
|
var _iterator__ex2g4s_0 = list.t();
|
|
1208
1208
|
while (_iterator__ex2g4s_0.u()) {
|
|
1209
1209
|
var item = _iterator__ex2g4s_0.v();
|
|
1210
|
-
var tmp$ret$4 = import_0('../model', item.
|
|
1210
|
+
var tmp$ret$4 = import_0('../model', item.b1a_1, true);
|
|
1211
1211
|
destination.x(tmp$ret$4);
|
|
1212
1212
|
}
|
|
1213
1213
|
var imports = destination;
|
|
@@ -1229,7 +1229,7 @@ protoOf(TypeScriptEmitter).j1b = function (endpoint) {
|
|
|
1229
1229
|
}
|
|
1230
1230
|
var requestArgs = tmp_0;
|
|
1231
1231
|
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 ');
|
|
1232
|
-
var tmp_1 = Companion_getInstance().
|
|
1232
|
+
var tmp_1 = Companion_getInstance().au('client/' + endpointName + 'Client');
|
|
1233
1233
|
// Inline function 'kotlin.collections.buildList' call
|
|
1234
1234
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1235
1235
|
// Inline function 'kotlin.apply' call
|
|
@@ -1238,25 +1238,25 @@ protoOf(TypeScriptEmitter).j1b = function (endpoint) {
|
|
|
1238
1238
|
this_1.x(import_0('../endpoint/' + endpointName, endpointName));
|
|
1239
1239
|
this_1.g1(imports);
|
|
1240
1240
|
this_1.x(new RawElement(code));
|
|
1241
|
-
var tmp$ret$7 = this_1.
|
|
1241
|
+
var tmp$ret$7 = this_1.r5();
|
|
1242
1242
|
return new File(tmp_1, tmp$ret$7);
|
|
1243
1243
|
};
|
|
1244
|
-
protoOf(TypeScriptEmitter).
|
|
1245
|
-
logger.
|
|
1244
|
+
protoOf(TypeScriptEmitter).h1b = function (endpoints, logger) {
|
|
1245
|
+
logger.bs('Emitting main Client for ' + endpoints.c1() + ' endpoints');
|
|
1246
1246
|
// Inline function 'kotlin.collections.map' call
|
|
1247
1247
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1248
1248
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(endpoints, 10));
|
|
1249
1249
|
var _iterator__ex2g4s = endpoints.t();
|
|
1250
1250
|
while (_iterator__ex2g4s.u()) {
|
|
1251
1251
|
var item = _iterator__ex2g4s.v();
|
|
1252
|
-
var methodName = firstToLower(this, item.
|
|
1253
|
-
var tmp$ret$2 = import_0('./client/' + item.
|
|
1252
|
+
var methodName = firstToLower(this, item.gr_1.o1());
|
|
1253
|
+
var tmp$ret$2 = import_0('./client/' + item.gr_1.o1() + 'Client', methodName + 'Client');
|
|
1254
1254
|
destination.x(tmp$ret$2);
|
|
1255
1255
|
}
|
|
1256
1256
|
var clientImports = destination;
|
|
1257
1257
|
var spreadEntries = joinToString(endpoints, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emitClient$lambda(this));
|
|
1258
1258
|
var code = trimMargin('\n |export const client = (serialization: Wirespec.Serialization, transportation: Wirespec.Transportation) => ({\n |' + spreadEntries + '\n |})\n ');
|
|
1259
|
-
var tmp = Companion_getInstance().
|
|
1259
|
+
var tmp = Companion_getInstance().au('Client');
|
|
1260
1260
|
// Inline function 'kotlin.collections.buildList' call
|
|
1261
1261
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1262
1262
|
// Inline function 'kotlin.apply' call
|
|
@@ -1264,19 +1264,19 @@ protoOf(TypeScriptEmitter).d1b = function (endpoints, logger) {
|
|
|
1264
1264
|
this_0.x(import_0('./Wirespec', 'Wirespec'));
|
|
1265
1265
|
this_0.g1(clientImports);
|
|
1266
1266
|
this_0.x(new RawElement(code));
|
|
1267
|
-
var tmp$ret$3 = this_0.
|
|
1267
|
+
var tmp$ret$3 = this_0.r5();
|
|
1268
1268
|
return new File(tmp, tmp$ret$3);
|
|
1269
1269
|
};
|
|
1270
1270
|
function transformPatternSwitchToValueSwitch() {
|
|
1271
1271
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
1272
1272
|
// Inline function 'kotlin.apply' call
|
|
1273
1273
|
var this_0 = new TransformerBuilder();
|
|
1274
|
-
this_0.
|
|
1275
|
-
return this_0.
|
|
1274
|
+
this_0.u19(transformPatternSwitchToValueSwitch$lambda);
|
|
1275
|
+
return this_0.t19();
|
|
1276
1276
|
}
|
|
1277
1277
|
function buildApiConst(endpoint) {
|
|
1278
1278
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
1279
|
-
var this_0 = endpoint.
|
|
1279
|
+
var this_0 = endpoint.gr_1.o1();
|
|
1280
1280
|
var tmp;
|
|
1281
1281
|
// Inline function 'kotlin.text.isNotEmpty' call
|
|
1282
1282
|
if (charSequenceLength(this_0) > 0) {
|
|
@@ -1290,8 +1290,8 @@ function buildApiConst(endpoint) {
|
|
|
1290
1290
|
tmp = this_0;
|
|
1291
1291
|
}
|
|
1292
1292
|
var apiName = tmp;
|
|
1293
|
-
var method = endpoint.
|
|
1294
|
-
var pathString = joinToString(endpoint.
|
|
1293
|
+
var method = endpoint.hr_1.e3_1;
|
|
1294
|
+
var pathString = joinToString(endpoint.ir_1, '/', VOID, VOID, VOID, VOID, buildApiConst$lambda);
|
|
1295
1295
|
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 '));
|
|
1296
1296
|
}
|
|
1297
1297
|
function bindCallToRequestParams(_this__u8e3s4) {
|
|
@@ -1300,21 +1300,21 @@ function bindCallToRequestParams(_this__u8e3s4) {
|
|
|
1300
1300
|
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matchingElements' call
|
|
1301
1301
|
var tmp = scope;
|
|
1302
1302
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
1303
|
-
var this_0 = scope.
|
|
1303
|
+
var this_0 = scope.e19_1;
|
|
1304
1304
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
1305
1305
|
// Inline function 'kotlin.apply' call
|
|
1306
1306
|
var this_1 = new TransformerBuilder();
|
|
1307
|
-
this_1.
|
|
1308
|
-
var tmp$ret$4 = this_1.
|
|
1309
|
-
tmp.
|
|
1310
|
-
var tmp_0 = scope.
|
|
1307
|
+
this_1.y19(bindCallToRequestParams$lambda);
|
|
1308
|
+
var tmp$ret$4 = this_1.t19();
|
|
1309
|
+
tmp.e19_1 = transform(this_0, tmp$ret$4);
|
|
1310
|
+
var tmp_0 = scope.e19_1;
|
|
1311
1311
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1312
1312
|
}
|
|
1313
1313
|
function stripTrailingSpaceFromErrorMessage(_this__u8e3s4) {
|
|
1314
1314
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
1315
1315
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1316
|
-
scope.
|
|
1317
|
-
var tmp = scope.
|
|
1316
|
+
scope.u19(stripTrailingSpaceFromErrorMessage$lambda);
|
|
1317
|
+
var tmp = scope.e19_1;
|
|
1318
1318
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1319
1319
|
}
|
|
1320
1320
|
function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
@@ -1322,7 +1322,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1322
1322
|
if (!(stmt instanceof Switch)) {
|
|
1323
1323
|
tmp = true;
|
|
1324
1324
|
} else {
|
|
1325
|
-
var tmp0 = stmt.
|
|
1325
|
+
var tmp0 = stmt.az_1;
|
|
1326
1326
|
var tmp$ret$0;
|
|
1327
1327
|
$l$block_0: {
|
|
1328
1328
|
// Inline function 'kotlin.collections.none' call
|
|
@@ -1339,7 +1339,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1339
1339
|
var _iterator__ex2g4s = tmp0.t();
|
|
1340
1340
|
while (_iterator__ex2g4s.u()) {
|
|
1341
1341
|
var element = _iterator__ex2g4s.v();
|
|
1342
|
-
if (!(element.
|
|
1342
|
+
if (!(element.hz_1 == null)) {
|
|
1343
1343
|
tmp$ret$0 = false;
|
|
1344
1344
|
break $l$block_0;
|
|
1345
1345
|
}
|
|
@@ -1350,11 +1350,11 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1350
1350
|
}
|
|
1351
1351
|
if (tmp)
|
|
1352
1352
|
return transformChildren(stmt, tr);
|
|
1353
|
-
var tmp0_safe_receiver = stmt.
|
|
1354
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1353
|
+
var tmp0_safe_receiver = stmt.cz_1;
|
|
1354
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.cu();
|
|
1355
1355
|
var varName = tmp1_elvis_lhs == null ? 'r' : tmp1_elvis_lhs;
|
|
1356
1356
|
// Inline function 'kotlin.collections.map' call
|
|
1357
|
-
var this_0 = stmt.
|
|
1357
|
+
var this_0 = stmt.az_1;
|
|
1358
1358
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1359
1359
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1360
1360
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
@@ -1362,39 +1362,39 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1362
1362
|
var item = _iterator__ex2g4s_0.v();
|
|
1363
1363
|
var tmp$ret$4;
|
|
1364
1364
|
$l$block_1: {
|
|
1365
|
-
var tmp_1 = item.
|
|
1365
|
+
var tmp_1 = item.hz_1;
|
|
1366
1366
|
var tmp0_safe_receiver_0 = tmp_1 instanceof Custom_0 ? tmp_1 : null;
|
|
1367
|
-
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.
|
|
1368
|
-
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
1367
|
+
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.ru_1;
|
|
1368
|
+
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.du();
|
|
1369
1369
|
var tmp3_safe_receiver = typeName == null ? null : substringAfterLast(typeName, '.');
|
|
1370
1370
|
var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : removePrefix(tmp3_safe_receiver, 'Response');
|
|
1371
1371
|
var statusNum = tmp4_safe_receiver == null ? null : toIntOrNull(tmp4_safe_receiver);
|
|
1372
1372
|
if (statusNum == null) {
|
|
1373
1373
|
// Inline function 'kotlin.collections.map' call
|
|
1374
|
-
var this_1 = item.
|
|
1374
|
+
var this_1 = item.gz_1;
|
|
1375
1375
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1376
1376
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1377
1377
|
var _iterator__ex2g4s_1 = this_1.t();
|
|
1378
1378
|
while (_iterator__ex2g4s_1.u()) {
|
|
1379
1379
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
1380
|
-
var tmp$ret$7 = tr.
|
|
1380
|
+
var tmp$ret$7 = tr.y18(item_0);
|
|
1381
1381
|
destination_0.x(tmp$ret$7);
|
|
1382
1382
|
}
|
|
1383
|
-
tmp$ret$4 = item.
|
|
1383
|
+
tmp$ret$4 = item.jz(VOID, destination_0);
|
|
1384
1384
|
break $l$block_1;
|
|
1385
1385
|
}
|
|
1386
|
-
var exprCode = TypeScriptGenerator_getInstance().
|
|
1387
|
-
var castAssignment = new Assignment(Companion_getInstance().
|
|
1386
|
+
var exprCode = TypeScriptGenerator_getInstance().a1d(tr.z18(stmt.zy_1));
|
|
1387
|
+
var castAssignment = new Assignment(Companion_getInstance().au(varName), new RawExpression(exprCode + ' as ' + typeName), false);
|
|
1388
1388
|
var tmp_2 = new Literal(statusNum, new Integer_0());
|
|
1389
1389
|
var tmp_3 = listOf_0(castAssignment);
|
|
1390
1390
|
// Inline function 'kotlin.collections.map' call
|
|
1391
|
-
var this_2 = item.
|
|
1391
|
+
var this_2 = item.gz_1;
|
|
1392
1392
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1393
1393
|
var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
|
|
1394
1394
|
var _iterator__ex2g4s_2 = this_2.t();
|
|
1395
1395
|
while (_iterator__ex2g4s_2.u()) {
|
|
1396
1396
|
var item_1 = _iterator__ex2g4s_2.v();
|
|
1397
|
-
var tmp$ret$10 = tr.
|
|
1397
|
+
var tmp$ret$10 = tr.y18(item_1);
|
|
1398
1398
|
destination_1.x(tmp$ret$10);
|
|
1399
1399
|
}
|
|
1400
1400
|
tmp$ret$4 = new Case(tmp_2, plus(tmp_3, destination_1), null);
|
|
@@ -1402,8 +1402,8 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1402
1402
|
destination.x(tmp$ret$4);
|
|
1403
1403
|
}
|
|
1404
1404
|
var transformedCases = destination;
|
|
1405
|
-
var tmp_4 = new FieldCall(tr.
|
|
1406
|
-
var tmp2_safe_receiver = stmt.
|
|
1405
|
+
var tmp_4 = new FieldCall(tr.z18(stmt.zy_1), Companion_getInstance().au('status'));
|
|
1406
|
+
var tmp2_safe_receiver = stmt.bz_1;
|
|
1407
1407
|
var tmp_5;
|
|
1408
1408
|
if (tmp2_safe_receiver == null) {
|
|
1409
1409
|
tmp_5 = null;
|
|
@@ -1414,7 +1414,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1414
1414
|
var _iterator__ex2g4s_3 = tmp2_safe_receiver.t();
|
|
1415
1415
|
while (_iterator__ex2g4s_3.u()) {
|
|
1416
1416
|
var item_2 = _iterator__ex2g4s_3.v();
|
|
1417
|
-
var tmp$ret$13 = tr.
|
|
1417
|
+
var tmp$ret$13 = tr.y18(item_2);
|
|
1418
1418
|
destination_2.x(tmp$ret$13);
|
|
1419
1419
|
}
|
|
1420
1420
|
tmp_5 = destination_2;
|
|
@@ -1424,10 +1424,10 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1424
1424
|
function buildApiConst$lambda(it) {
|
|
1425
1425
|
var tmp;
|
|
1426
1426
|
if (it instanceof Literal_0) {
|
|
1427
|
-
tmp = it.
|
|
1427
|
+
tmp = it.e1b_1;
|
|
1428
1428
|
} else {
|
|
1429
1429
|
if (it instanceof Param) {
|
|
1430
|
-
tmp = '{' + it.
|
|
1430
|
+
tmp = '{' + it.nr_1.o1() + '}';
|
|
1431
1431
|
} else {
|
|
1432
1432
|
noWhenBranchMatchedException();
|
|
1433
1433
|
}
|
|
@@ -1439,23 +1439,23 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
1439
1439
|
if (element instanceof Interface) {
|
|
1440
1440
|
var tmp$ret$0;
|
|
1441
1441
|
$l$block: {
|
|
1442
|
-
if (!element.
|
|
1442
|
+
if (!element.rv_1.equals(Companion_getInstance().au('Call'))) {
|
|
1443
1443
|
tmp$ret$0 = element;
|
|
1444
1444
|
break $l$block;
|
|
1445
1445
|
}
|
|
1446
1446
|
// Inline function 'kotlin.collections.map' call
|
|
1447
|
-
var this_0 = element.
|
|
1447
|
+
var this_0 = element.sv_1;
|
|
1448
1448
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1449
1449
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1450
1450
|
var _iterator__ex2g4s = this_0.t();
|
|
1451
1451
|
while (_iterator__ex2g4s.u()) {
|
|
1452
1452
|
var item = _iterator__ex2g4s.v();
|
|
1453
1453
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
1454
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1454
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.dy(VOID, VOID, listOf_0(new Parameter(Companion_getInstance().au('params'), Custom_init_$Create$('RequestParams'))));
|
|
1455
1455
|
var tmp$ret$3 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
1456
1456
|
destination.x(tmp$ret$3);
|
|
1457
1457
|
}
|
|
1458
|
-
tmp$ret$0 = element.
|
|
1458
|
+
tmp$ret$0 = element.zv(VOID, destination);
|
|
1459
1459
|
}
|
|
1460
1460
|
tmp = tmp$ret$0;
|
|
1461
1461
|
} else {
|
|
@@ -1467,7 +1467,7 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
1467
1467
|
function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
1468
1468
|
var tmp;
|
|
1469
1469
|
if (stmt instanceof Switch) {
|
|
1470
|
-
var tmp1_safe_receiver = stmt.
|
|
1470
|
+
var tmp1_safe_receiver = stmt.bz_1;
|
|
1471
1471
|
var tmp_0;
|
|
1472
1472
|
if (tmp1_safe_receiver == null) {
|
|
1473
1473
|
tmp_0 = null;
|
|
@@ -1489,7 +1489,7 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
1489
1489
|
tmp_1 = tmp0_elvis_lhs;
|
|
1490
1490
|
}
|
|
1491
1491
|
var errorStmt = tmp_1;
|
|
1492
|
-
var tmp_2 = errorStmt.
|
|
1492
|
+
var tmp_2 = errorStmt.tz_1;
|
|
1493
1493
|
var tmp1_elvis_lhs = tmp_2 instanceof BinaryOp ? tmp_2 : null;
|
|
1494
1494
|
var tmp_3;
|
|
1495
1495
|
if (tmp1_elvis_lhs == null) {
|
|
@@ -1499,7 +1499,7 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
1499
1499
|
tmp_3 = tmp1_elvis_lhs;
|
|
1500
1500
|
}
|
|
1501
1501
|
var binary = tmp_3;
|
|
1502
|
-
var tmp_4 = binary.
|
|
1502
|
+
var tmp_4 = binary.uz_1;
|
|
1503
1503
|
var tmp2_elvis_lhs = tmp_4 instanceof Literal ? tmp_4 : null;
|
|
1504
1504
|
var tmp_5;
|
|
1505
1505
|
if (tmp2_elvis_lhs == null) {
|
|
@@ -1509,23 +1509,23 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
1509
1509
|
tmp_5 = tmp2_elvis_lhs;
|
|
1510
1510
|
}
|
|
1511
1511
|
var literal = tmp_5;
|
|
1512
|
-
tmp$ret$2 = new ErrorStatement(new Literal(trimEnd(toString_0(literal.
|
|
1512
|
+
tmp$ret$2 = new ErrorStatement(new Literal(trimEnd(toString_0(literal.vy_1), charArrayOf([_Char___init__impl__6a9atx(32)])), literal.wy_1));
|
|
1513
1513
|
}
|
|
1514
1514
|
destination.x(tmp$ret$2);
|
|
1515
1515
|
}
|
|
1516
1516
|
tmp_0 = destination;
|
|
1517
1517
|
}
|
|
1518
|
-
tmp = transformChildren(stmt.
|
|
1518
|
+
tmp = transformChildren(stmt.ez(VOID, VOID, tmp_0), transformer);
|
|
1519
1519
|
} else {
|
|
1520
1520
|
tmp = transformChildren(stmt, transformer);
|
|
1521
1521
|
}
|
|
1522
1522
|
return tmp;
|
|
1523
1523
|
}
|
|
1524
1524
|
//region block: post-declaration
|
|
1525
|
-
protoOf(TypeScriptEmitter).
|
|
1526
|
-
protoOf(TypeScriptEmitter).
|
|
1527
|
-
protoOf(TypeScriptEmitter).
|
|
1528
|
-
protoOf(TypeScriptEmitter).
|
|
1525
|
+
protoOf(TypeScriptEmitter).i1b = get_extensions;
|
|
1526
|
+
protoOf(TypeScriptEmitter).f1b = emit_1;
|
|
1527
|
+
protoOf(TypeScriptEmitter).k1b = beforeGenerate;
|
|
1528
|
+
protoOf(TypeScriptEmitter).wp = get_supportsDefaults;
|
|
1529
1529
|
//endregion
|
|
1530
1530
|
//region block: exports
|
|
1531
1531
|
export {
|