@flock/wirespec 0.22.1 → 0.22.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-core.mjs +11 -5
- package/arrow-arrow-core.mjs.map +1 -1
- package/clikt-clikt-mordant.mjs +79 -79
- package/clikt-clikt.mjs +1343 -1343
- package/colormath-root-colormath.mjs +437 -437
- package/kotlin-kotlin-stdlib.mjs +259 -253
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10004 -10004
- package/kotlin-rgxgen.mjs +1762 -1762
- package/kotlinx-io-kotlinx-io-core.mjs +404 -404
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1786 -1786
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1514 -1508
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1231 -1225
- package/mordant-mordant.mjs.map +1 -1
- package/package.json +1 -1
- package/wirespec-src-compiler-core.mjs +4940 -4889
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +180 -180
- package/wirespec-src-compiler-emitters-kotlin.mjs +134 -134
- package/wirespec-src-compiler-emitters-python.mjs +157 -157
- package/wirespec-src-compiler-emitters-rust.mjs +392 -392
- package/wirespec-src-compiler-emitters-scala.mjs +168 -168
- package/wirespec-src-compiler-emitters-typescript.mjs +229 -229
- package/wirespec-src-compiler-emitters-wirespec.mjs +125 -125
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +388 -326
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-asyncapi.mjs +639 -639
- package/wirespec-src-converter-avro.mjs +548 -548
- package/wirespec-src-converter-common.mjs +16 -16
- package/wirespec-src-converter-graphql.mjs +2546 -1342
- package/wirespec-src-converter-graphql.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +593 -593
- package/wirespec-src-ide-lsp.mjs +1371 -1371
- package/wirespec-src-plugin-arguments.mjs +146 -146
- package/wirespec-src-plugin-cli.mjs +89 -89
- package/wirespec-src-plugin-npm.d.mts +21 -3
- package/wirespec-src-plugin-npm.mjs +26 -26
- package/wirespec-src-tools-generator.mjs +24 -24
|
@@ -169,14 +169,14 @@ initMetadataForCompanion(Companion);
|
|
|
169
169
|
initMetadataForClass(TypeScriptEmitter, 'TypeScriptEmitter', TypeScriptEmitter, VOID, [IrEmitter]);
|
|
170
170
|
//endregion
|
|
171
171
|
function _get_sanitizationConfig__sns434($this) {
|
|
172
|
-
var tmp0 = $this.
|
|
172
|
+
var tmp0 = $this.x21_1;
|
|
173
173
|
var tmp = KProperty1;
|
|
174
174
|
// Inline function 'kotlin.getValue' call
|
|
175
175
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, TypeScriptEmitter$_get_sanitizationConfig_$ref_eg4rmu(), null);
|
|
176
176
|
return tmp0.o1();
|
|
177
177
|
}
|
|
178
178
|
function _get_modelSanitizationConfig__vgg831($this) {
|
|
179
|
-
var tmp0 = $this.
|
|
179
|
+
var tmp0 = $this.y21_1;
|
|
180
180
|
var tmp = KProperty1;
|
|
181
181
|
// Inline function 'kotlin.getValue' call
|
|
182
182
|
getPropertyCallableRef('modelSanitizationConfig', 1, tmp, TypeScriptEmitter$_get_modelSanitizationConfig_$ref_jl2735(), null);
|
|
@@ -204,7 +204,7 @@ function sanitizeSymbol($this, $receiver) {
|
|
|
204
204
|
return destination.toString();
|
|
205
205
|
}
|
|
206
206
|
function sanitizeKeywords($this, $receiver) {
|
|
207
|
-
return Companion_getInstance_0().
|
|
207
|
+
return Companion_getInstance_0().v1z().i1($receiver) ? '_' + $receiver : $receiver;
|
|
208
208
|
}
|
|
209
209
|
function firstToLower($this, $receiver) {
|
|
210
210
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
@@ -238,7 +238,7 @@ function sanitizeParamName($this, identifier) {
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
var parts = destination;
|
|
241
|
-
var name = parts.b1() > 1 ? (new Name(parts)).
|
|
241
|
+
var name = parts.b1() > 1 ? (new Name(parts)).yt() : identifier.o1();
|
|
242
242
|
return sanitizeKeywords($this, sanitizeSymbol($this, name));
|
|
243
243
|
}
|
|
244
244
|
function buildEndpointParams($this, endpoint) {
|
|
@@ -247,7 +247,7 @@ function buildEndpointParams($this, endpoint) {
|
|
|
247
247
|
// Inline function 'kotlin.apply' call
|
|
248
248
|
var this_0 = ArrayList_init_$Create$();
|
|
249
249
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
250
|
-
var tmp0 = endpoint.
|
|
250
|
+
var tmp0 = endpoint.hr_1;
|
|
251
251
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
252
252
|
var destination = ArrayList_init_$Create$();
|
|
253
253
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -261,36 +261,36 @@ function buildEndpointParams($this, endpoint) {
|
|
|
261
261
|
var _iterator__ex2g4s_0 = destination.t();
|
|
262
262
|
while (_iterator__ex2g4s_0.u()) {
|
|
263
263
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
264
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_0.
|
|
264
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_0.mr_1), emitTypeScriptReference($this, element_0.nr_1.t19(false)), element_0.nr_1.ot()));
|
|
265
265
|
}
|
|
266
266
|
// Inline function 'kotlin.collections.forEach' call
|
|
267
|
-
var _iterator__ex2g4s_1 = get_fields(endpoint.
|
|
267
|
+
var _iterator__ex2g4s_1 = get_fields(endpoint.ir_1).t();
|
|
268
268
|
while (_iterator__ex2g4s_1.u()) {
|
|
269
269
|
var element_1 = _iterator__ex2g4s_1.v();
|
|
270
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_1.
|
|
270
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_1.op_1), emitTypeScriptReference($this, element_1.pp_1.t19(false)), element_1.pp_1.ot()));
|
|
271
271
|
}
|
|
272
272
|
// Inline function 'kotlin.collections.forEach' call
|
|
273
|
-
var _iterator__ex2g4s_2 = get_fields(endpoint.
|
|
273
|
+
var _iterator__ex2g4s_2 = get_fields(endpoint.jr_1).t();
|
|
274
274
|
while (_iterator__ex2g4s_2.u()) {
|
|
275
275
|
var element_2 = _iterator__ex2g4s_2.v();
|
|
276
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_2.
|
|
276
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_2.op_1), emitTypeScriptReference($this, element_2.pp_1.t19(false)), element_2.pp_1.ot()));
|
|
277
277
|
}
|
|
278
|
-
var tmp0_safe_receiver = first(endpoint.
|
|
278
|
+
var tmp0_safe_receiver = first(endpoint.kr_1).or_1;
|
|
279
279
|
if (tmp0_safe_receiver == null)
|
|
280
280
|
null;
|
|
281
281
|
else {
|
|
282
282
|
// Inline function 'kotlin.let' call
|
|
283
|
-
this_0.x(new EndpointParam('body', emitTypeScriptReference($this, tmp0_safe_receiver.
|
|
283
|
+
this_0.x(new EndpointParam('body', emitTypeScriptReference($this, tmp0_safe_receiver.qr_1.t19(false)), tmp0_safe_receiver.qr_1.ot()));
|
|
284
284
|
}
|
|
285
285
|
return this_0.q5();
|
|
286
286
|
}
|
|
287
287
|
function emitTypeScriptReference($this, ref) {
|
|
288
288
|
var tmp;
|
|
289
289
|
if (ref instanceof Dict) {
|
|
290
|
-
tmp = 'Record<string, ' + emitTypeScriptReference($this, ref.
|
|
290
|
+
tmp = 'Record<string, ' + emitTypeScriptReference($this, ref.bq_1) + '>';
|
|
291
291
|
} else {
|
|
292
292
|
if (ref instanceof Iterable) {
|
|
293
|
-
tmp = emitTypeScriptReference($this, ref.
|
|
293
|
+
tmp = emitTypeScriptReference($this, ref.yp_1) + '[]';
|
|
294
294
|
} else {
|
|
295
295
|
if (ref instanceof Unit) {
|
|
296
296
|
tmp = 'undefined';
|
|
@@ -299,10 +299,10 @@ function emitTypeScriptReference($this, ref) {
|
|
|
299
299
|
tmp = 'any';
|
|
300
300
|
} else {
|
|
301
301
|
if (ref instanceof Custom) {
|
|
302
|
-
tmp = sanitizeSymbol($this, ref.
|
|
302
|
+
tmp = sanitizeSymbol($this, ref.r18_1);
|
|
303
303
|
} else {
|
|
304
304
|
if (ref instanceof Primitive) {
|
|
305
|
-
var tmp1_subject = ref.
|
|
305
|
+
var tmp1_subject = ref.t18_1;
|
|
306
306
|
var tmp_0;
|
|
307
307
|
if (tmp1_subject instanceof String_0) {
|
|
308
308
|
tmp_0 = 'string';
|
|
@@ -335,20 +335,20 @@ function emitTypeScriptReference($this, ref) {
|
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
337
|
// Inline function 'kotlin.let' call
|
|
338
|
-
return tmp + (ref.
|
|
338
|
+
return tmp + (ref.ot() ? ' | undefined' : '');
|
|
339
339
|
}
|
|
340
340
|
function EndpointParam(name, type, nullable) {
|
|
341
|
-
this.
|
|
342
|
-
this.
|
|
343
|
-
this.
|
|
341
|
+
this.b22_1 = name;
|
|
342
|
+
this.c22_1 = type;
|
|
343
|
+
this.d22_1 = nullable;
|
|
344
344
|
}
|
|
345
345
|
protoOf(EndpointParam).toString = function () {
|
|
346
|
-
return 'EndpointParam(name=' + this.
|
|
346
|
+
return 'EndpointParam(name=' + this.b22_1 + ', type=' + this.c22_1 + ', nullable=' + this.d22_1 + ')';
|
|
347
347
|
};
|
|
348
348
|
protoOf(EndpointParam).hashCode = function () {
|
|
349
|
-
var result = getStringHashCode(this.
|
|
350
|
-
result = imul(result, 31) + getStringHashCode(this.
|
|
351
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
349
|
+
var result = getStringHashCode(this.b22_1);
|
|
350
|
+
result = imul(result, 31) + getStringHashCode(this.c22_1) | 0;
|
|
351
|
+
result = imul(result, 31) + getBooleanHashCode(this.d22_1) | 0;
|
|
352
352
|
return result;
|
|
353
353
|
};
|
|
354
354
|
protoOf(EndpointParam).equals = function (other) {
|
|
@@ -356,17 +356,17 @@ protoOf(EndpointParam).equals = function (other) {
|
|
|
356
356
|
return true;
|
|
357
357
|
if (!(other instanceof EndpointParam))
|
|
358
358
|
return false;
|
|
359
|
-
if (!(this.
|
|
359
|
+
if (!(this.b22_1 === other.b22_1))
|
|
360
360
|
return false;
|
|
361
|
-
if (!(this.
|
|
361
|
+
if (!(this.c22_1 === other.c22_1))
|
|
362
362
|
return false;
|
|
363
|
-
if (!(this.
|
|
363
|
+
if (!(this.d22_1 === other.d22_1))
|
|
364
364
|
return false;
|
|
365
365
|
return true;
|
|
366
366
|
};
|
|
367
367
|
function Companion() {
|
|
368
368
|
Companion_instance_0 = this;
|
|
369
|
-
this.
|
|
369
|
+
this.z21_1 = TypeScriptGenerator_getInstance();
|
|
370
370
|
var tmp = this;
|
|
371
371
|
// Inline function 'kotlin.collections.associateWith' call
|
|
372
372
|
var this_0 = listOf(['GeneratorFieldString', 'GeneratorFieldInteger64', 'GeneratorFieldInteger32', 'GeneratorFieldNumber64', 'GeneratorFieldNumber32', 'GeneratorFieldBoolean', 'GeneratorFieldBytes', 'GeneratorFieldEnum', 'GeneratorFieldUnion', 'GeneratorFieldArray', 'GeneratorFieldNullable', 'GeneratorFieldShape', 'GeneratorFieldDict']);
|
|
@@ -380,10 +380,10 @@ function Companion() {
|
|
|
380
380
|
var tmp$ret$2 = removePrefix(element, 'GeneratorField').toLowerCase();
|
|
381
381
|
result.v2(element, tmp$ret$2);
|
|
382
382
|
}
|
|
383
|
-
tmp.
|
|
383
|
+
tmp.a22_1 = result;
|
|
384
384
|
}
|
|
385
|
-
protoOf(Companion).
|
|
386
|
-
return this.
|
|
385
|
+
protoOf(Companion).v1z = function () {
|
|
386
|
+
return this.z21_1.v1a_1;
|
|
387
387
|
};
|
|
388
388
|
var Companion_instance_0;
|
|
389
389
|
function Companion_getInstance_0() {
|
|
@@ -396,13 +396,13 @@ function TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
396
396
|
}
|
|
397
397
|
function TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
398
398
|
return function (name) {
|
|
399
|
-
var sanitized = name.
|
|
399
|
+
var sanitized = name.ut_1.b1() > 1 ? name.yt() : sanitizeSymbol(this$0, name.xt());
|
|
400
400
|
return new Name(listOf_0(sanitized));
|
|
401
401
|
};
|
|
402
402
|
}
|
|
403
403
|
function TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0) {
|
|
404
404
|
return function (name) {
|
|
405
|
-
var sanitized = name.
|
|
405
|
+
var sanitized = name.ut_1.b1() > 1 ? name.yt() : sanitizeSymbol(this$0, name.xt());
|
|
406
406
|
return new Name(listOf_0(sanitized));
|
|
407
407
|
};
|
|
408
408
|
}
|
|
@@ -428,12 +428,12 @@ function TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
428
428
|
return function (stmt, tr) {
|
|
429
429
|
var tmp;
|
|
430
430
|
if (stmt instanceof VariableReference) {
|
|
431
|
-
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
431
|
+
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.gv_1));
|
|
432
432
|
} else {
|
|
433
433
|
if (stmt instanceof ConstructorStatement) {
|
|
434
|
-
var tmp_0 = tr.
|
|
434
|
+
var tmp_0 = tr.m17(stmt.dv_1);
|
|
435
435
|
// Inline function 'kotlin.collections.map' call
|
|
436
|
-
var this_0 = stmt.
|
|
436
|
+
var this_0 = stmt.ev_1;
|
|
437
437
|
// Inline function 'kotlin.collections.mapTo' call
|
|
438
438
|
var destination = ArrayList_init_$Create$_0(this_0.b1());
|
|
439
439
|
// Inline function 'kotlin.collections.iterator' call
|
|
@@ -444,13 +444,13 @@ function TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
444
444
|
var key = item.n1();
|
|
445
445
|
// Inline function 'kotlin.collections.component2' call
|
|
446
446
|
var value = item.o1();
|
|
447
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.
|
|
447
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.p17(value));
|
|
448
448
|
destination.x(tmp$ret$3);
|
|
449
449
|
}
|
|
450
450
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
451
451
|
} else {
|
|
452
452
|
if (stmt instanceof Assignment) {
|
|
453
|
-
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
453
|
+
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.jy_1), tr.p17(stmt.ky_1), stmt.ly_1);
|
|
454
454
|
} else {
|
|
455
455
|
tmp = transformChildren(stmt, tr);
|
|
456
456
|
}
|
|
@@ -461,7 +461,7 @@ function TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
461
461
|
}
|
|
462
462
|
function TypeScriptEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
463
463
|
return function () {
|
|
464
|
-
var tmp0_reservedKeywords = Companion_getInstance_0().
|
|
464
|
+
var tmp0_reservedKeywords = Companion_getInstance_0().v1z();
|
|
465
465
|
var tmp = TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
466
466
|
var tmp_0 = TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
|
|
467
467
|
var tmp_1 = TypeScriptEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
|
|
@@ -475,7 +475,7 @@ function TypeScriptEmitter$_get_sanitizationConfig_$ref_eg4rmu() {
|
|
|
475
475
|
};
|
|
476
476
|
}
|
|
477
477
|
function TypeScriptEmitter$modelSanitizationConfig$delegate$lambda$lambda(name) {
|
|
478
|
-
return new Name(listOf_0(name.
|
|
478
|
+
return new Name(listOf_0(name.xt()));
|
|
479
479
|
}
|
|
480
480
|
function TypeScriptEmitter$modelSanitizationConfig$delegate$lambda$lambda_0(it) {
|
|
481
481
|
return it;
|
|
@@ -484,7 +484,7 @@ function TypeScriptEmitter$modelSanitizationConfig$delegate$lambda(this$0) {
|
|
|
484
484
|
return function () {
|
|
485
485
|
var tmp = _get_sanitizationConfig__sns434(this$0);
|
|
486
486
|
var tmp_0 = TypeScriptEmitter$modelSanitizationConfig$delegate$lambda$lambda;
|
|
487
|
-
return tmp.
|
|
487
|
+
return tmp.h1b(VOID, VOID, tmp_0, VOID, TypeScriptEmitter$modelSanitizationConfig$delegate$lambda$lambda_0);
|
|
488
488
|
};
|
|
489
489
|
}
|
|
490
490
|
function TypeScriptEmitter$_get_modelSanitizationConfig_$ref_jl2735() {
|
|
@@ -495,27 +495,27 @@ function TypeScriptEmitter$_get_modelSanitizationConfig_$ref_jl2735() {
|
|
|
495
495
|
function TypeScriptEmitter$emitShared$lambda(element, transformer) {
|
|
496
496
|
var tmp;
|
|
497
497
|
if (element instanceof Namespace) {
|
|
498
|
-
var injected = element.
|
|
498
|
+
var injected = element.nv_1.equals(Companion_getInstance().wt('Wirespec')) ? listOf_0(new RawElement('export type Type = string')) : emptyList();
|
|
499
499
|
var tmp_0;
|
|
500
500
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
501
501
|
if (!injected.r()) {
|
|
502
502
|
// Inline function 'community.flock.wirespec.compiler.core.ir.withElements' call
|
|
503
|
-
var elements = plus(injected, element.
|
|
503
|
+
var elements = plus(injected, element.jv());
|
|
504
504
|
var tmp_1;
|
|
505
505
|
if (element instanceof File) {
|
|
506
|
-
tmp_1 = element.
|
|
506
|
+
tmp_1 = element.lv(VOID, elements);
|
|
507
507
|
} else {
|
|
508
508
|
if (element instanceof Struct) {
|
|
509
|
-
tmp_1 = element.
|
|
509
|
+
tmp_1 = element.sx(VOID, VOID, VOID, VOID, elements);
|
|
510
510
|
} else {
|
|
511
511
|
if (element instanceof Namespace) {
|
|
512
|
-
tmp_1 = element.
|
|
512
|
+
tmp_1 = element.sv(VOID, elements);
|
|
513
513
|
} else {
|
|
514
514
|
if (element instanceof Interface) {
|
|
515
|
-
tmp_1 = element.
|
|
515
|
+
tmp_1 = element.bw(VOID, elements);
|
|
516
516
|
} else {
|
|
517
517
|
if (element instanceof Enum) {
|
|
518
|
-
tmp_1 = element.
|
|
518
|
+
tmp_1 = element.gx(VOID, VOID, VOID, VOID, VOID, elements);
|
|
519
519
|
} else {
|
|
520
520
|
if (element instanceof Main) {
|
|
521
521
|
tmp_1 = element;
|
|
@@ -543,27 +543,27 @@ function TypeScriptEmitter$emitShared$lambda_0($api) {
|
|
|
543
543
|
return function (element, transformer) {
|
|
544
544
|
var tmp;
|
|
545
545
|
if (element instanceof Namespace) {
|
|
546
|
-
var injected = element.
|
|
546
|
+
var injected = element.nv_1.equals(Companion_getInstance().wt('Wirespec')) ? listOf_0(new RawElement($api)) : emptyList();
|
|
547
547
|
var tmp_0;
|
|
548
548
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
549
549
|
if (!injected.r()) {
|
|
550
550
|
// Inline function 'community.flock.wirespec.compiler.core.ir.withElements' call
|
|
551
|
-
var elements = plus(element.
|
|
551
|
+
var elements = plus(element.jv(), injected);
|
|
552
552
|
var tmp_1;
|
|
553
553
|
if (element instanceof File) {
|
|
554
|
-
tmp_1 = element.
|
|
554
|
+
tmp_1 = element.lv(VOID, elements);
|
|
555
555
|
} else {
|
|
556
556
|
if (element instanceof Struct) {
|
|
557
|
-
tmp_1 = element.
|
|
557
|
+
tmp_1 = element.sx(VOID, VOID, VOID, VOID, elements);
|
|
558
558
|
} else {
|
|
559
559
|
if (element instanceof Namespace) {
|
|
560
|
-
tmp_1 = element.
|
|
560
|
+
tmp_1 = element.sv(VOID, elements);
|
|
561
561
|
} else {
|
|
562
562
|
if (element instanceof Interface) {
|
|
563
|
-
tmp_1 = element.
|
|
563
|
+
tmp_1 = element.bw(VOID, elements);
|
|
564
564
|
} else {
|
|
565
565
|
if (element instanceof Enum) {
|
|
566
|
-
tmp_1 = element.
|
|
566
|
+
tmp_1 = element.gx(VOID, VOID, VOID, VOID, VOID, elements);
|
|
567
567
|
} else {
|
|
568
568
|
if (element instanceof Main) {
|
|
569
569
|
tmp_1 = element;
|
|
@@ -591,13 +591,13 @@ function TypeScriptEmitter$emitShared$lambda_0($api) {
|
|
|
591
591
|
function TypeScriptEmitter$emitShared$lambda_1(element, transformer) {
|
|
592
592
|
var tmp;
|
|
593
593
|
if (element instanceof Struct) {
|
|
594
|
-
var tmp0_safe_receiver = Companion_getInstance_0().
|
|
594
|
+
var tmp0_safe_receiver = Companion_getInstance_0().a22_1.s2(element.hx_1.xt());
|
|
595
595
|
var tmp_0;
|
|
596
596
|
if (tmp0_safe_receiver == null) {
|
|
597
597
|
tmp_0 = null;
|
|
598
598
|
} else {
|
|
599
599
|
// Inline function 'kotlin.let' call
|
|
600
|
-
tmp_0 = element.
|
|
600
|
+
tmp_0 = element.sx(VOID, plus(listOf_0(new Field(Companion_getInstance().wt('kind'), new StringLiteral(tmp0_safe_receiver))), element.ix_1));
|
|
601
601
|
}
|
|
602
602
|
var tmp1_elvis_lhs = tmp_0;
|
|
603
603
|
tmp = tmp1_elvis_lhs == null ? element : tmp1_elvis_lhs;
|
|
@@ -608,7 +608,7 @@ function TypeScriptEmitter$emitShared$lambda_1(element, transformer) {
|
|
|
608
608
|
return transformChildren_0(transformed, transformer);
|
|
609
609
|
}
|
|
610
610
|
function TypeScriptEmitter$emit$lambda(it) {
|
|
611
|
-
return 'export {' + it.
|
|
611
|
+
return 'export {' + it.ds().o1() + "} from './" + it.ds().o1() + "'";
|
|
612
612
|
}
|
|
613
613
|
function TypeScriptEmitter$emitGenerator$lambda($definition) {
|
|
614
614
|
return function (expr, t) {
|
|
@@ -617,24 +617,24 @@ function TypeScriptEmitter$emitGenerator$lambda($definition) {
|
|
|
617
617
|
var tmp_1;
|
|
618
618
|
var tmp_2;
|
|
619
619
|
if (expr instanceof FunctionCall) {
|
|
620
|
-
var tmp_3 = expr.
|
|
620
|
+
var tmp_3 = expr.cu_1;
|
|
621
621
|
tmp_2 = tmp_3 instanceof RawExpression;
|
|
622
622
|
} else {
|
|
623
623
|
tmp_2 = false;
|
|
624
624
|
}
|
|
625
625
|
if (tmp_2) {
|
|
626
|
-
var tmp_4 = expr.
|
|
627
|
-
tmp_1 = (tmp_4 instanceof RawExpression ? tmp_4 : THROW_CCE()).
|
|
626
|
+
var tmp_4 = expr.cu_1;
|
|
627
|
+
tmp_1 = (tmp_4 instanceof RawExpression ? tmp_4 : THROW_CCE()).iy_1 === $definition.qs_1.o1();
|
|
628
628
|
} else {
|
|
629
629
|
tmp_1 = false;
|
|
630
630
|
}
|
|
631
631
|
if (tmp_1) {
|
|
632
|
-
tmp_0 = expr.
|
|
632
|
+
tmp_0 = expr.eu_1.equals(Companion_getInstance().wt('valueOf'));
|
|
633
633
|
} else {
|
|
634
634
|
tmp_0 = false;
|
|
635
635
|
}
|
|
636
636
|
if (tmp_0) {
|
|
637
|
-
var tmp0_elvis_lhs = expr.
|
|
637
|
+
var tmp0_elvis_lhs = expr.fu_1.s2(Companion_getInstance().wt('label'));
|
|
638
638
|
tmp = tmp0_elvis_lhs == null ? expr : tmp0_elvis_lhs;
|
|
639
639
|
} else {
|
|
640
640
|
tmp = transformChildren_1(expr, t);
|
|
@@ -647,12 +647,12 @@ function TypeScriptEmitter$emitGenerator$lambda_0($definition) {
|
|
|
647
647
|
var tmp;
|
|
648
648
|
var tmp_0;
|
|
649
649
|
if (expr instanceof ConstructorStatement) {
|
|
650
|
-
tmp_0 = equals(expr.
|
|
650
|
+
tmp_0 = equals(expr.dv_1, Custom_init_$Create$($definition.ls_1.o1()));
|
|
651
651
|
} else {
|
|
652
652
|
tmp_0 = false;
|
|
653
653
|
}
|
|
654
654
|
if (tmp_0) {
|
|
655
|
-
var tmp0_elvis_lhs = expr.
|
|
655
|
+
var tmp0_elvis_lhs = expr.ev_1.s2(Companion_getInstance().wt('value'));
|
|
656
656
|
tmp = tmp0_elvis_lhs == null ? expr : tmp0_elvis_lhs;
|
|
657
657
|
} else {
|
|
658
658
|
tmp = transformChildren_1(expr, t);
|
|
@@ -663,24 +663,24 @@ function TypeScriptEmitter$emitGenerator$lambda_0($definition) {
|
|
|
663
663
|
function TypeScriptEmitter$emitGenerator$lambda_1(expr, t) {
|
|
664
664
|
var tmp;
|
|
665
665
|
if (expr instanceof ConstructorStatement) {
|
|
666
|
-
var tmp_0 = expr.
|
|
666
|
+
var tmp_0 = expr.dv_1;
|
|
667
667
|
var tmp0_safe_receiver = tmp_0 instanceof Custom_0 ? tmp_0 : null;
|
|
668
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
669
|
-
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
668
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.qu_1;
|
|
669
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.xt();
|
|
670
670
|
var typeName = tmp2_safe_receiver == null ? null : removePrefix(tmp2_safe_receiver, 'Wirespec.');
|
|
671
671
|
var tmp_1;
|
|
672
672
|
if (typeName == null) {
|
|
673
673
|
tmp_1 = null;
|
|
674
674
|
} else {
|
|
675
675
|
// Inline function 'kotlin.let' call
|
|
676
|
-
tmp_1 = Companion_getInstance_0().
|
|
676
|
+
tmp_1 = Companion_getInstance_0().a22_1.s2(typeName);
|
|
677
677
|
}
|
|
678
678
|
var kind = tmp_1;
|
|
679
679
|
var tmp_2;
|
|
680
680
|
if (!(kind == null)) {
|
|
681
|
-
var tmp_3 = mapOf(to(Companion_getInstance().
|
|
681
|
+
var tmp_3 = mapOf(to(Companion_getInstance().wt('kind'), new Literal(kind, String_instance)));
|
|
682
682
|
// Inline function 'kotlin.collections.mapValues' call
|
|
683
|
-
var this_0 = expr.
|
|
683
|
+
var this_0 = expr.ev_1;
|
|
684
684
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
685
685
|
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.b1()));
|
|
686
686
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
@@ -690,10 +690,10 @@ function TypeScriptEmitter$emitGenerator$lambda_1(expr, t) {
|
|
|
690
690
|
var tmp_4 = element.n1();
|
|
691
691
|
// Inline function 'kotlin.collections.component2' call
|
|
692
692
|
var v = element.o1();
|
|
693
|
-
var tmp$ret$6 = t.
|
|
693
|
+
var tmp$ret$6 = t.p17(v);
|
|
694
694
|
destination.v2(tmp_4, tmp$ret$6);
|
|
695
695
|
}
|
|
696
|
-
tmp_2 = new ConstructorStatement(expr.
|
|
696
|
+
tmp_2 = new ConstructorStatement(expr.dv_1, plus_0(tmp_3, destination));
|
|
697
697
|
} else {
|
|
698
698
|
tmp_2 = transformChildren(expr, t);
|
|
699
699
|
}
|
|
@@ -720,17 +720,17 @@ function TypeScriptEmitter$emitGenerator$lambda_5($generatorOwnName, $generatorR
|
|
|
720
720
|
var tmp_0;
|
|
721
721
|
var tmp_1;
|
|
722
722
|
if (expr instanceof RawExpression) {
|
|
723
|
-
tmp_1 = endsWith(expr.
|
|
723
|
+
tmp_1 = endsWith(expr.iy_1, 'Generator');
|
|
724
724
|
} else {
|
|
725
725
|
tmp_1 = false;
|
|
726
726
|
}
|
|
727
727
|
if (tmp_1) {
|
|
728
|
-
tmp_0 = !(expr.
|
|
728
|
+
tmp_0 = !(expr.iy_1 === $generatorOwnName);
|
|
729
729
|
} else {
|
|
730
730
|
tmp_0 = false;
|
|
731
731
|
}
|
|
732
732
|
if (tmp_0) {
|
|
733
|
-
$generatorRefs.x(expr.
|
|
733
|
+
$generatorRefs.x(expr.iy_1);
|
|
734
734
|
tmp = Unit_instance;
|
|
735
735
|
}
|
|
736
736
|
return transformChildren_1(expr, t);
|
|
@@ -745,22 +745,22 @@ function TypeScriptEmitter$emit$injectApiConst$lambda($endpoint) {
|
|
|
745
745
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
746
746
|
if (!injected.r()) {
|
|
747
747
|
// Inline function 'community.flock.wirespec.compiler.core.ir.withElements' call
|
|
748
|
-
var elements = plus(element.
|
|
748
|
+
var elements = plus(element.jv(), injected);
|
|
749
749
|
var tmp_1;
|
|
750
750
|
if (element instanceof File) {
|
|
751
|
-
tmp_1 = element.
|
|
751
|
+
tmp_1 = element.lv(VOID, elements);
|
|
752
752
|
} else {
|
|
753
753
|
if (element instanceof Struct) {
|
|
754
|
-
tmp_1 = element.
|
|
754
|
+
tmp_1 = element.sx(VOID, VOID, VOID, VOID, elements);
|
|
755
755
|
} else {
|
|
756
756
|
if (element instanceof Namespace) {
|
|
757
|
-
tmp_1 = element.
|
|
757
|
+
tmp_1 = element.sv(VOID, elements);
|
|
758
758
|
} else {
|
|
759
759
|
if (element instanceof Interface) {
|
|
760
|
-
tmp_1 = element.
|
|
760
|
+
tmp_1 = element.bw(VOID, elements);
|
|
761
761
|
} else {
|
|
762
762
|
if (element instanceof Enum) {
|
|
763
|
-
tmp_1 = element.
|
|
763
|
+
tmp_1 = element.gx(VOID, VOID, VOID, VOID, VOID, elements);
|
|
764
764
|
} else {
|
|
765
765
|
if (element instanceof Main) {
|
|
766
766
|
tmp_1 = element;
|
|
@@ -792,14 +792,14 @@ function emit$injectApiConst(_this__u8e3s4, $endpoint) {
|
|
|
792
792
|
var tmp = scope;
|
|
793
793
|
// Inline function 'community.flock.wirespec.compiler.core.ir.injectAfter' call
|
|
794
794
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
795
|
-
var this_0 = scope.
|
|
795
|
+
var this_0 = scope.u17_1;
|
|
796
796
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
797
797
|
// Inline function 'kotlin.apply' call
|
|
798
798
|
var this_1 = new TransformerBuilder();
|
|
799
|
-
this_1.
|
|
800
|
-
var tmp$ret$5 = this_1.
|
|
801
|
-
tmp.
|
|
802
|
-
var tmp_0 = scope.
|
|
799
|
+
this_1.o18(TypeScriptEmitter$emit$injectApiConst$lambda($endpoint));
|
|
800
|
+
var tmp$ret$5 = this_1.j18();
|
|
801
|
+
tmp.u17_1 = transform(this_0, tmp$ret$5);
|
|
802
|
+
var tmp_0 = scope.u17_1;
|
|
803
803
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
804
804
|
}
|
|
805
805
|
function emit$applyCallParamsIfNeeded(_this__u8e3s4, hasRequestParams) {
|
|
@@ -807,27 +807,27 @@ function emit$applyCallParamsIfNeeded(_this__u8e3s4, hasRequestParams) {
|
|
|
807
807
|
}
|
|
808
808
|
function TypeScriptEmitter$emitClient$lambda(this$0) {
|
|
809
809
|
return function (it) {
|
|
810
|
-
var methodName = firstToLower(this$0, it.
|
|
810
|
+
var methodName = firstToLower(this$0, it.fr_1.o1());
|
|
811
811
|
return ' ...' + methodName + 'Client(serialization, transportation),';
|
|
812
812
|
};
|
|
813
813
|
}
|
|
814
814
|
function TypeScriptEmitter() {
|
|
815
815
|
Companion_getInstance_0();
|
|
816
|
-
this.
|
|
817
|
-
this.
|
|
816
|
+
this.v21_1 = TypeScriptGenerator_getInstance();
|
|
817
|
+
this.w21_1 = FileExtension_TypeScript_getInstance();
|
|
818
818
|
var tmp = this;
|
|
819
|
-
tmp.
|
|
819
|
+
tmp.x21_1 = lazy(TypeScriptEmitter$sanitizationConfig$delegate$lambda(this));
|
|
820
820
|
var tmp_0 = this;
|
|
821
|
-
tmp_0.
|
|
821
|
+
tmp_0.y21_1 = lazy(TypeScriptEmitter$modelSanitizationConfig$delegate$lambda(this));
|
|
822
822
|
}
|
|
823
|
-
protoOf(TypeScriptEmitter).
|
|
824
|
-
return this.
|
|
823
|
+
protoOf(TypeScriptEmitter).h1a = function () {
|
|
824
|
+
return this.v21_1;
|
|
825
825
|
};
|
|
826
|
-
protoOf(TypeScriptEmitter).
|
|
827
|
-
return this.
|
|
826
|
+
protoOf(TypeScriptEmitter).wp = function () {
|
|
827
|
+
return this.w21_1;
|
|
828
828
|
};
|
|
829
|
-
protoOf(TypeScriptEmitter).
|
|
830
|
-
var packageName = Companion_instance.
|
|
829
|
+
protoOf(TypeScriptEmitter).c1a = function () {
|
|
830
|
+
var packageName = Companion_instance.at('community.flock.wirespec');
|
|
831
831
|
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}';
|
|
832
832
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
833
833
|
var this_0 = convert(packageName);
|
|
@@ -836,35 +836,35 @@ protoOf(TypeScriptEmitter).b1a = function () {
|
|
|
836
836
|
var tmp = scope;
|
|
837
837
|
// Inline function 'community.flock.wirespec.compiler.core.ir.injectBefore' call
|
|
838
838
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
839
|
-
var this_1 = scope.
|
|
839
|
+
var this_1 = scope.u17_1;
|
|
840
840
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
841
841
|
// Inline function 'kotlin.apply' call
|
|
842
842
|
var this_2 = new TransformerBuilder();
|
|
843
|
-
this_2.
|
|
844
|
-
var tmp$ret$5 = this_2.
|
|
845
|
-
tmp.
|
|
843
|
+
this_2.o18(TypeScriptEmitter$emitShared$lambda);
|
|
844
|
+
var tmp$ret$5 = this_2.j18();
|
|
845
|
+
tmp.u17_1 = transform(this_1, tmp$ret$5);
|
|
846
846
|
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.injectAfter' call
|
|
847
847
|
var tmp_0 = scope;
|
|
848
848
|
// Inline function 'community.flock.wirespec.compiler.core.ir.injectAfter' call
|
|
849
849
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
850
|
-
var this_3 = scope.
|
|
850
|
+
var this_3 = scope.u17_1;
|
|
851
851
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
852
852
|
// Inline function 'kotlin.apply' call
|
|
853
853
|
var this_4 = new TransformerBuilder();
|
|
854
|
-
this_4.
|
|
855
|
-
var tmp$ret$11 = this_4.
|
|
856
|
-
tmp_0.
|
|
854
|
+
this_4.o18(TypeScriptEmitter$emitShared$lambda_0(api));
|
|
855
|
+
var tmp$ret$11 = this_4.j18();
|
|
856
|
+
tmp_0.u17_1 = transform(this_3, tmp$ret$11);
|
|
857
857
|
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matchingElements' call
|
|
858
858
|
var tmp_1 = scope;
|
|
859
859
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
860
|
-
var this_5 = scope.
|
|
860
|
+
var this_5 = scope.u17_1;
|
|
861
861
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
862
862
|
// Inline function 'kotlin.apply' call
|
|
863
863
|
var this_6 = new TransformerBuilder();
|
|
864
|
-
this_6.
|
|
865
|
-
var tmp$ret$16 = this_6.
|
|
866
|
-
tmp_1.
|
|
867
|
-
var tmp_2 = scope.
|
|
864
|
+
this_6.o18(TypeScriptEmitter$emitShared$lambda_1);
|
|
865
|
+
var tmp$ret$16 = this_6.j18();
|
|
866
|
+
tmp_1.u17_1 = transform(this_5, tmp$ret$16);
|
|
867
|
+
var tmp_2 = scope.u17_1;
|
|
868
868
|
return isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
869
869
|
};
|
|
870
870
|
protoOf(TypeScriptEmitter).to = function (ast, logger) {
|
|
@@ -924,18 +924,18 @@ protoOf(TypeScriptEmitter).to = function (ast, logger) {
|
|
|
924
924
|
var ns = item.n1();
|
|
925
925
|
// Inline function 'kotlin.collections.component2' call
|
|
926
926
|
var defs = item.o1();
|
|
927
|
-
var tmp_1 = ns + '/index.' + this.
|
|
927
|
+
var tmp_1 = ns + '/index.' + this.wp().xr_1;
|
|
928
928
|
var tmp$ret$15 = new Emitted(tmp_1, joinToString(defs, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda));
|
|
929
929
|
destination_2.x(tmp$ret$15);
|
|
930
930
|
}
|
|
931
931
|
return NonEmptyList__plus_impl_xqmb9(tmp, destination_2);
|
|
932
932
|
};
|
|
933
|
-
protoOf(TypeScriptEmitter).
|
|
933
|
+
protoOf(TypeScriptEmitter).cs = function (definition, module_0, logger) {
|
|
934
934
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
935
|
-
var subPackageName = plus_1(Companion_instance.
|
|
936
|
-
return new File(Companion_getInstance().
|
|
935
|
+
var subPackageName = plus_1(Companion_instance.at(''), definition);
|
|
936
|
+
return new File(Companion_getInstance().wt(subPackageName.dt() + sanitizeSymbol(this, file.hv_1.zt())), plus(listOf_0(import_0('../Wirespec', 'Wirespec')), file.iv_1));
|
|
937
937
|
};
|
|
938
|
-
protoOf(TypeScriptEmitter).
|
|
938
|
+
protoOf(TypeScriptEmitter).k1a = function (definition, module_0) {
|
|
939
939
|
var tmp;
|
|
940
940
|
if (definition instanceof Type) {
|
|
941
941
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -944,16 +944,16 @@ protoOf(TypeScriptEmitter).j1a = function (definition, module_0) {
|
|
|
944
944
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
945
945
|
var this_0 = convertToGenerator_1(definition);
|
|
946
946
|
var scope = new TransformScope(this_0);
|
|
947
|
-
scope.
|
|
948
|
-
var tmp_0 = scope.
|
|
947
|
+
scope.l18(TypeScriptEmitter$emitGenerator$lambda(definition));
|
|
948
|
+
var tmp_0 = scope.u17_1;
|
|
949
949
|
tmp = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
950
950
|
} else {
|
|
951
951
|
if (definition instanceof Refined) {
|
|
952
952
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
953
953
|
var this_1 = convertToGenerator_0(definition);
|
|
954
954
|
var scope_0 = new TransformScope(this_1);
|
|
955
|
-
scope_0.
|
|
956
|
-
var tmp_1 = scope_0.
|
|
955
|
+
scope_0.l18(TypeScriptEmitter$emitGenerator$lambda_0(definition));
|
|
956
|
+
var tmp_1 = scope_0.u17_1;
|
|
957
957
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
958
958
|
} else {
|
|
959
959
|
if (definition instanceof Union) {
|
|
@@ -967,10 +967,10 @@ protoOf(TypeScriptEmitter).j1a = function (definition, module_0) {
|
|
|
967
967
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
968
968
|
var this_2 = sanitizeNames(tmp, _get_sanitizationConfig__sns434(this));
|
|
969
969
|
var scope_1 = new TransformScope(this_2);
|
|
970
|
-
scope_1.
|
|
971
|
-
var tmp_2 = scope_1.
|
|
970
|
+
scope_1.l18(TypeScriptEmitter$emitGenerator$lambda_1);
|
|
971
|
+
var tmp_2 = scope_1.u17_1;
|
|
972
972
|
var generatorFile = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
973
|
-
var generatorOwnName = definition.
|
|
973
|
+
var generatorOwnName = definition.ds().o1() + 'Generator';
|
|
974
974
|
var tmp_3 = asSequence(collectCustomTypeNames(generatorFile));
|
|
975
975
|
var tmp_4 = filterNot(tmp_3, TypeScriptEmitter$emitGenerator$lambda_2);
|
|
976
976
|
var tmp_5 = filterNot(tmp_4, TypeScriptEmitter$emitGenerator$lambda_3(generatorOwnName));
|
|
@@ -979,8 +979,8 @@ protoOf(TypeScriptEmitter).j1a = function (definition, module_0) {
|
|
|
979
979
|
var generatorRefs = LinkedHashSet_init_$Create$();
|
|
980
980
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
981
981
|
var scope_2 = new TransformScope(generatorFile);
|
|
982
|
-
scope_2.
|
|
983
|
-
var tmp_6 = scope_2.
|
|
982
|
+
scope_2.l18(TypeScriptEmitter$emitGenerator$lambda_5(generatorOwnName, generatorRefs));
|
|
983
|
+
var tmp_6 = scope_2.u17_1;
|
|
984
984
|
isInterface(tmp_6, Element) || THROW_CCE();
|
|
985
985
|
// Inline function 'kotlin.collections.filter' call
|
|
986
986
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -1023,10 +1023,10 @@ protoOf(TypeScriptEmitter).j1a = function (definition, module_0) {
|
|
|
1023
1023
|
destination_2.x(tmp$ret$20);
|
|
1024
1024
|
}
|
|
1025
1025
|
var modelImports = destination_2;
|
|
1026
|
-
var subPackageName = plus_2(Companion_instance.
|
|
1027
|
-
return new File(Companion_getInstance().
|
|
1026
|
+
var subPackageName = plus_2(Companion_instance.at(''), 'generator');
|
|
1027
|
+
return new File(Companion_getInstance().wt(subPackageName.dt() + sanitizeSymbol(this, generatorFile.hv_1.zt())), plus(plus(plus(listOf_0(import_0('../Wirespec', 'Wirespec')), modelImports), generatorImports), generatorFile.iv_1));
|
|
1028
1028
|
};
|
|
1029
|
-
protoOf(TypeScriptEmitter).
|
|
1029
|
+
protoOf(TypeScriptEmitter).us = function (type, module_0) {
|
|
1030
1030
|
var fieldValidations = classifyValidatableFields(type, module_0);
|
|
1031
1031
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1032
1032
|
var this_0 = importReferences(type);
|
|
@@ -1035,7 +1035,7 @@ protoOf(TypeScriptEmitter).ts = function (type, module_0) {
|
|
|
1035
1035
|
var _iterator__ex2g4s = this_0.t();
|
|
1036
1036
|
while (_iterator__ex2g4s.u()) {
|
|
1037
1037
|
var e = _iterator__ex2g4s.v();
|
|
1038
|
-
var key = e.
|
|
1038
|
+
var key = e.r18_1;
|
|
1039
1039
|
if (set.x(key)) {
|
|
1040
1040
|
list.x(e);
|
|
1041
1041
|
}
|
|
@@ -1046,7 +1046,7 @@ protoOf(TypeScriptEmitter).ts = function (type, module_0) {
|
|
|
1046
1046
|
var _iterator__ex2g4s_0 = list.t();
|
|
1047
1047
|
while (_iterator__ex2g4s_0.u()) {
|
|
1048
1048
|
var item = _iterator__ex2g4s_0.v();
|
|
1049
|
-
var tmp$ret$4 = import_0('./' + item.
|
|
1049
|
+
var tmp$ret$4 = import_0('./' + item.r18_1, item.r18_1);
|
|
1050
1050
|
destination.x(tmp$ret$4);
|
|
1051
1051
|
}
|
|
1052
1052
|
var typeImports = destination;
|
|
@@ -1056,7 +1056,7 @@ protoOf(TypeScriptEmitter).ts = function (type, module_0) {
|
|
|
1056
1056
|
var _iterator__ex2g4s_1 = fieldValidations.t();
|
|
1057
1057
|
while (_iterator__ex2g4s_1.u()) {
|
|
1058
1058
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
1059
|
-
var tmp$ret$7 = item_0.
|
|
1059
|
+
var tmp$ret$7 = item_0.r19_1;
|
|
1060
1060
|
destination_0.x(tmp$ret$7);
|
|
1061
1061
|
}
|
|
1062
1062
|
// Inline function 'kotlin.collections.filter' call
|
|
@@ -1066,7 +1066,7 @@ protoOf(TypeScriptEmitter).ts = function (type, module_0) {
|
|
|
1066
1066
|
var _iterator__ex2g4s_2 = tmp0.t();
|
|
1067
1067
|
while (_iterator__ex2g4s_2.u()) {
|
|
1068
1068
|
var element = _iterator__ex2g4s_2.v();
|
|
1069
|
-
if (!(element === type.
|
|
1069
|
+
if (!(element === type.kp_1.o1())) {
|
|
1070
1070
|
destination_1.x(element);
|
|
1071
1071
|
}
|
|
1072
1072
|
}
|
|
@@ -1082,30 +1082,30 @@ protoOf(TypeScriptEmitter).ts = function (type, module_0) {
|
|
|
1082
1082
|
var validateImports = destination_2;
|
|
1083
1083
|
var allImports = plus(typeImports, validateImports);
|
|
1084
1084
|
// Inline function 'kotlin.collections.map' call
|
|
1085
|
-
var this_1 = get_fields(type.
|
|
1085
|
+
var this_1 = get_fields(type.lp_1);
|
|
1086
1086
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1087
1087
|
var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1088
1088
|
var _iterator__ex2g4s_4 = this_1.t();
|
|
1089
1089
|
while (_iterator__ex2g4s_4.u()) {
|
|
1090
1090
|
var item_2 = _iterator__ex2g4s_4.v();
|
|
1091
|
-
var tmp$ret$16 = item_2.
|
|
1091
|
+
var tmp$ret$16 = item_2.op_1.o1();
|
|
1092
1092
|
destination_3.x(tmp$ret$16);
|
|
1093
1093
|
}
|
|
1094
1094
|
var fieldNames = toSet(destination_3);
|
|
1095
|
-
var file = renameValidateAndBindObjReceiver(sanitizeNames(convertWithValidation(type, module_0), _get_modelSanitizationConfig__vgg831(this)), type.
|
|
1095
|
+
var file = renameValidateAndBindObjReceiver(sanitizeNames(convertWithValidation(type, module_0), _get_modelSanitizationConfig__vgg831(this)), type.kp_1.o1(), fieldNames);
|
|
1096
1096
|
var tmp;
|
|
1097
1097
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1098
1098
|
if (!allImports.r()) {
|
|
1099
|
-
tmp = file.
|
|
1099
|
+
tmp = file.lv(VOID, plus(allImports, file.iv_1));
|
|
1100
1100
|
} else {
|
|
1101
1101
|
tmp = file;
|
|
1102
1102
|
}
|
|
1103
1103
|
return tmp;
|
|
1104
1104
|
};
|
|
1105
|
-
protoOf(TypeScriptEmitter).
|
|
1105
|
+
protoOf(TypeScriptEmitter).ss = function (enum_0, module_0) {
|
|
1106
1106
|
return sanitizeNames(convert_0(enum_0), _get_sanitizationConfig__sns434(this));
|
|
1107
1107
|
};
|
|
1108
|
-
protoOf(TypeScriptEmitter).
|
|
1108
|
+
protoOf(TypeScriptEmitter).is = function (union) {
|
|
1109
1109
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1110
1110
|
var this_0 = importReferences(union);
|
|
1111
1111
|
var set = HashSet_init_$Create$();
|
|
@@ -1113,7 +1113,7 @@ protoOf(TypeScriptEmitter).hs = function (union) {
|
|
|
1113
1113
|
var _iterator__ex2g4s = this_0.t();
|
|
1114
1114
|
while (_iterator__ex2g4s.u()) {
|
|
1115
1115
|
var e = _iterator__ex2g4s.v();
|
|
1116
|
-
var key = e.
|
|
1116
|
+
var key = e.r18_1;
|
|
1117
1117
|
if (set.x(key)) {
|
|
1118
1118
|
list.x(e);
|
|
1119
1119
|
}
|
|
@@ -1124,7 +1124,7 @@ protoOf(TypeScriptEmitter).hs = function (union) {
|
|
|
1124
1124
|
var _iterator__ex2g4s_0 = list.t();
|
|
1125
1125
|
while (_iterator__ex2g4s_0.u()) {
|
|
1126
1126
|
var item = _iterator__ex2g4s_0.v();
|
|
1127
|
-
var tmp$ret$4 = import_0('../model', item.
|
|
1127
|
+
var tmp$ret$4 = import_0('../model', item.r18_1, true);
|
|
1128
1128
|
destination.x(tmp$ret$4);
|
|
1129
1129
|
}
|
|
1130
1130
|
var imports = destination;
|
|
@@ -1132,19 +1132,19 @@ protoOf(TypeScriptEmitter).hs = function (union) {
|
|
|
1132
1132
|
var tmp;
|
|
1133
1133
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1134
1134
|
if (!imports.r()) {
|
|
1135
|
-
tmp = file.
|
|
1135
|
+
tmp = file.lv(VOID, plus(imports, file.iv_1));
|
|
1136
1136
|
} else {
|
|
1137
1137
|
tmp = file;
|
|
1138
1138
|
}
|
|
1139
1139
|
return tmp;
|
|
1140
1140
|
};
|
|
1141
|
-
protoOf(TypeScriptEmitter).
|
|
1141
|
+
protoOf(TypeScriptEmitter).ns = function (refined) {
|
|
1142
1142
|
var converted = convert_2(refined);
|
|
1143
|
-
var constraintExpr = convertConstraint(refined.
|
|
1144
|
-
var validatorStr = TypeScriptGenerator_getInstance().
|
|
1145
|
-
return new File(converted.
|
|
1143
|
+
var constraintExpr = convertConstraint(refined.ms_1, new VariableReference(Companion_getInstance().wt('value')));
|
|
1144
|
+
var validatorStr = TypeScriptGenerator_getInstance().y1a(constraintExpr);
|
|
1145
|
+
return new File(converted.hv_1, listOf([new RawElement('export type ' + converted.hv_1.zt() + ' = ' + emitTypeScriptReference(this, refined.ms_1) + ';'), new RawElement('export const validate' + refined.ls_1.o1() + ' = (value: ' + emitTypeScriptReference(this, refined.ms_1) + ') =>\n ' + validatorStr + ';')]));
|
|
1146
1146
|
};
|
|
1147
|
-
protoOf(TypeScriptEmitter).
|
|
1147
|
+
protoOf(TypeScriptEmitter).ts = function (endpoint) {
|
|
1148
1148
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1149
1149
|
var this_0 = importReferences(endpoint);
|
|
1150
1150
|
var set = HashSet_init_$Create$();
|
|
@@ -1152,7 +1152,7 @@ protoOf(TypeScriptEmitter).ss = function (endpoint) {
|
|
|
1152
1152
|
var _iterator__ex2g4s = this_0.t();
|
|
1153
1153
|
while (_iterator__ex2g4s.u()) {
|
|
1154
1154
|
var e = _iterator__ex2g4s.v();
|
|
1155
|
-
var key = e.
|
|
1155
|
+
var key = e.r18_1;
|
|
1156
1156
|
if (set.x(key)) {
|
|
1157
1157
|
list.x(e);
|
|
1158
1158
|
}
|
|
@@ -1163,7 +1163,7 @@ protoOf(TypeScriptEmitter).ss = function (endpoint) {
|
|
|
1163
1163
|
var _iterator__ex2g4s_0 = list.t();
|
|
1164
1164
|
while (_iterator__ex2g4s_0.u()) {
|
|
1165
1165
|
var item = _iterator__ex2g4s_0.v();
|
|
1166
|
-
var tmp$ret$4 = import_0('../model', item.
|
|
1166
|
+
var tmp$ret$4 = import_0('../model', item.r18_1, true);
|
|
1167
1167
|
destination.x(tmp$ret$4);
|
|
1168
1168
|
}
|
|
1169
1169
|
var imports = destination;
|
|
@@ -1172,24 +1172,24 @@ protoOf(TypeScriptEmitter).ss = function (endpoint) {
|
|
|
1172
1172
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
1173
1173
|
var this_1 = stripTrailingSpaceFromErrorMessage(convert_3(endpoint));
|
|
1174
1174
|
var scope = new TransformScope(this_1);
|
|
1175
|
-
scope.
|
|
1176
|
-
var tmp = scope.
|
|
1175
|
+
scope.z17(transformPatternSwitchToValueSwitch());
|
|
1176
|
+
var tmp = scope.u17_1;
|
|
1177
1177
|
var tmp$ret$6 = isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1178
1178
|
// Inline function 'kotlin.let' call
|
|
1179
|
-
var it = sanitizeNames(emit$injectApiConst(emit$applyCallParamsIfNeeded(tmp$ret$6, hasRequestParams), endpoint).
|
|
1179
|
+
var it = sanitizeNames(emit$injectApiConst(emit$applyCallParamsIfNeeded(tmp$ret$6, hasRequestParams), endpoint).lv(Companion_getInstance().wt(sanitize(this, endpoint.fr_1))), _get_sanitizationConfig__sns434(this));
|
|
1180
1180
|
var tmp_0;
|
|
1181
1181
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1182
1182
|
if (!imports.r()) {
|
|
1183
|
-
tmp_0 = it.
|
|
1183
|
+
tmp_0 = it.lv(VOID, plus(imports, it.iv_1));
|
|
1184
1184
|
} else {
|
|
1185
1185
|
tmp_0 = it;
|
|
1186
1186
|
}
|
|
1187
1187
|
return tmp_0;
|
|
1188
1188
|
};
|
|
1189
|
-
protoOf(TypeScriptEmitter).
|
|
1189
|
+
protoOf(TypeScriptEmitter).hs = function (channel) {
|
|
1190
1190
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1191
1191
|
};
|
|
1192
|
-
protoOf(TypeScriptEmitter).
|
|
1192
|
+
protoOf(TypeScriptEmitter).gs = function (rpc) {
|
|
1193
1193
|
// Inline function 'kotlin.let' call
|
|
1194
1194
|
var file = sanitizeNames(convert_5(rpc), _get_sanitizationConfig__sns434(this));
|
|
1195
1195
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
@@ -1199,7 +1199,7 @@ protoOf(TypeScriptEmitter).fs = function (rpc) {
|
|
|
1199
1199
|
var _iterator__ex2g4s = this_0.t();
|
|
1200
1200
|
while (_iterator__ex2g4s.u()) {
|
|
1201
1201
|
var e = _iterator__ex2g4s.v();
|
|
1202
|
-
var key = e.
|
|
1202
|
+
var key = e.r18_1;
|
|
1203
1203
|
if (set.x(key)) {
|
|
1204
1204
|
list.x(e);
|
|
1205
1205
|
}
|
|
@@ -1210,7 +1210,7 @@ protoOf(TypeScriptEmitter).fs = function (rpc) {
|
|
|
1210
1210
|
var _iterator__ex2g4s_0 = list.t();
|
|
1211
1211
|
while (_iterator__ex2g4s_0.u()) {
|
|
1212
1212
|
var item = _iterator__ex2g4s_0.v();
|
|
1213
|
-
var tmp$ret$6 = import_0('../model', item.
|
|
1213
|
+
var tmp$ret$6 = import_0('../model', item.r18_1, true);
|
|
1214
1214
|
destination.x(tmp$ret$6);
|
|
1215
1215
|
}
|
|
1216
1216
|
// Inline function 'kotlin.takeIf' call
|
|
@@ -1227,13 +1227,13 @@ protoOf(TypeScriptEmitter).fs = function (rpc) {
|
|
|
1227
1227
|
tmp_0 = null;
|
|
1228
1228
|
} else {
|
|
1229
1229
|
// Inline function 'kotlin.let' call
|
|
1230
|
-
tmp_0 = file.
|
|
1230
|
+
tmp_0 = file.lv(VOID, plus(tmp0_safe_receiver, file.iv_1));
|
|
1231
1231
|
}
|
|
1232
1232
|
var tmp1_elvis_lhs = tmp_0;
|
|
1233
1233
|
return tmp1_elvis_lhs == null ? file : tmp1_elvis_lhs;
|
|
1234
1234
|
};
|
|
1235
|
-
protoOf(TypeScriptEmitter).
|
|
1236
|
-
var endpointName = endpoint.
|
|
1235
|
+
protoOf(TypeScriptEmitter).j1a = function (endpoint) {
|
|
1236
|
+
var endpointName = endpoint.fr_1.o1();
|
|
1237
1237
|
var methodName = firstToLower(this, endpointName);
|
|
1238
1238
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1239
1239
|
var this_0 = importReferences(endpoint);
|
|
@@ -1242,7 +1242,7 @@ protoOf(TypeScriptEmitter).i1a = function (endpoint) {
|
|
|
1242
1242
|
var _iterator__ex2g4s = this_0.t();
|
|
1243
1243
|
while (_iterator__ex2g4s.u()) {
|
|
1244
1244
|
var e = _iterator__ex2g4s.v();
|
|
1245
|
-
var key = e.
|
|
1245
|
+
var key = e.r18_1;
|
|
1246
1246
|
if (set.x(key)) {
|
|
1247
1247
|
list.x(e);
|
|
1248
1248
|
}
|
|
@@ -1253,7 +1253,7 @@ protoOf(TypeScriptEmitter).i1a = function (endpoint) {
|
|
|
1253
1253
|
var _iterator__ex2g4s_0 = list.t();
|
|
1254
1254
|
while (_iterator__ex2g4s_0.u()) {
|
|
1255
1255
|
var item = _iterator__ex2g4s_0.v();
|
|
1256
|
-
var tmp$ret$4 = import_0('../model', item.
|
|
1256
|
+
var tmp$ret$4 = import_0('../model', item.r18_1, true);
|
|
1257
1257
|
destination.x(tmp$ret$4);
|
|
1258
1258
|
}
|
|
1259
1259
|
var imports = destination;
|
|
@@ -1275,7 +1275,7 @@ protoOf(TypeScriptEmitter).i1a = function (endpoint) {
|
|
|
1275
1275
|
}
|
|
1276
1276
|
var requestArgs = tmp_0;
|
|
1277
1277
|
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 ');
|
|
1278
|
-
var tmp_1 = Companion_getInstance().
|
|
1278
|
+
var tmp_1 = Companion_getInstance().wt('client/' + endpointName + 'Client');
|
|
1279
1279
|
// Inline function 'kotlin.collections.buildList' call
|
|
1280
1280
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1281
1281
|
// Inline function 'kotlin.apply' call
|
|
@@ -1287,22 +1287,22 @@ protoOf(TypeScriptEmitter).i1a = function (endpoint) {
|
|
|
1287
1287
|
var tmp$ret$7 = this_1.q5();
|
|
1288
1288
|
return new File(tmp_1, tmp$ret$7);
|
|
1289
1289
|
};
|
|
1290
|
-
protoOf(TypeScriptEmitter).
|
|
1291
|
-
logger.
|
|
1290
|
+
protoOf(TypeScriptEmitter).d1a = function (endpoints, logger) {
|
|
1291
|
+
logger.as('Emitting main Client for ' + endpoints.b1() + ' endpoints');
|
|
1292
1292
|
// Inline function 'kotlin.collections.map' call
|
|
1293
1293
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1294
1294
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(endpoints, 10));
|
|
1295
1295
|
var _iterator__ex2g4s = endpoints.t();
|
|
1296
1296
|
while (_iterator__ex2g4s.u()) {
|
|
1297
1297
|
var item = _iterator__ex2g4s.v();
|
|
1298
|
-
var methodName = firstToLower(this, item.
|
|
1299
|
-
var tmp$ret$2 = import_0('./client/' + item.
|
|
1298
|
+
var methodName = firstToLower(this, item.fr_1.o1());
|
|
1299
|
+
var tmp$ret$2 = import_0('./client/' + item.fr_1.o1() + 'Client', methodName + 'Client');
|
|
1300
1300
|
destination.x(tmp$ret$2);
|
|
1301
1301
|
}
|
|
1302
1302
|
var clientImports = destination;
|
|
1303
1303
|
var spreadEntries = joinToString(endpoints, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emitClient$lambda(this));
|
|
1304
1304
|
var code = trimMargin('\n |export const client = (serialization: Wirespec.Serialization, transportation: Wirespec.Transportation) => ({\n |' + spreadEntries + '\n |})\n ');
|
|
1305
|
-
var tmp = Companion_getInstance().
|
|
1305
|
+
var tmp = Companion_getInstance().wt('Client');
|
|
1306
1306
|
// Inline function 'kotlin.collections.buildList' call
|
|
1307
1307
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1308
1308
|
// Inline function 'kotlin.apply' call
|
|
@@ -1317,8 +1317,8 @@ function transformPatternSwitchToValueSwitch() {
|
|
|
1317
1317
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
1318
1318
|
// Inline function 'kotlin.apply' call
|
|
1319
1319
|
var this_0 = new TransformerBuilder();
|
|
1320
|
-
this_0.
|
|
1321
|
-
return this_0.
|
|
1320
|
+
this_0.k18(transformPatternSwitchToValueSwitch$lambda);
|
|
1321
|
+
return this_0.j18();
|
|
1322
1322
|
}
|
|
1323
1323
|
function renameValidateAndBindObjReceiver(_this__u8e3s4, typeName, fieldNames) {
|
|
1324
1324
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
@@ -1326,19 +1326,19 @@ function renameValidateAndBindObjReceiver(_this__u8e3s4, typeName, fieldNames) {
|
|
|
1326
1326
|
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matchingElements' call
|
|
1327
1327
|
var tmp = scope;
|
|
1328
1328
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
1329
|
-
var this_0 = scope.
|
|
1329
|
+
var this_0 = scope.u17_1;
|
|
1330
1330
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
1331
1331
|
// Inline function 'kotlin.apply' call
|
|
1332
1332
|
var this_1 = new TransformerBuilder();
|
|
1333
|
-
this_1.
|
|
1334
|
-
var tmp$ret$4 = this_1.
|
|
1335
|
-
tmp.
|
|
1336
|
-
var tmp_0 = scope.
|
|
1333
|
+
this_1.o18(renameValidateAndBindObjReceiver$lambda(typeName, fieldNames));
|
|
1334
|
+
var tmp$ret$4 = this_1.j18();
|
|
1335
|
+
tmp.u17_1 = transform(this_0, tmp$ret$4);
|
|
1336
|
+
var tmp_0 = scope.u17_1;
|
|
1337
1337
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1338
1338
|
}
|
|
1339
1339
|
function buildApiConst(endpoint) {
|
|
1340
1340
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
1341
|
-
var this_0 = endpoint.
|
|
1341
|
+
var this_0 = endpoint.fr_1.o1();
|
|
1342
1342
|
var tmp;
|
|
1343
1343
|
// Inline function 'kotlin.text.isNotEmpty' call
|
|
1344
1344
|
if (charSequenceLength(this_0) > 0) {
|
|
@@ -1352,8 +1352,8 @@ function buildApiConst(endpoint) {
|
|
|
1352
1352
|
tmp = this_0;
|
|
1353
1353
|
}
|
|
1354
1354
|
var apiName = tmp;
|
|
1355
|
-
var method = endpoint.
|
|
1356
|
-
var pathString = joinToString(endpoint.
|
|
1355
|
+
var method = endpoint.gr_1.d3_1;
|
|
1356
|
+
var pathString = joinToString(endpoint.hr_1, '/', VOID, VOID, VOID, VOID, buildApiConst$lambda);
|
|
1357
1357
|
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 '));
|
|
1358
1358
|
}
|
|
1359
1359
|
function bindCallToRequestParams(_this__u8e3s4) {
|
|
@@ -1362,21 +1362,21 @@ function bindCallToRequestParams(_this__u8e3s4) {
|
|
|
1362
1362
|
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matchingElements' call
|
|
1363
1363
|
var tmp = scope;
|
|
1364
1364
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
1365
|
-
var this_0 = scope.
|
|
1365
|
+
var this_0 = scope.u17_1;
|
|
1366
1366
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
1367
1367
|
// Inline function 'kotlin.apply' call
|
|
1368
1368
|
var this_1 = new TransformerBuilder();
|
|
1369
|
-
this_1.
|
|
1370
|
-
var tmp$ret$4 = this_1.
|
|
1371
|
-
tmp.
|
|
1372
|
-
var tmp_0 = scope.
|
|
1369
|
+
this_1.o18(bindCallToRequestParams$lambda);
|
|
1370
|
+
var tmp$ret$4 = this_1.j18();
|
|
1371
|
+
tmp.u17_1 = transform(this_0, tmp$ret$4);
|
|
1372
|
+
var tmp_0 = scope.u17_1;
|
|
1373
1373
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1374
1374
|
}
|
|
1375
1375
|
function stripTrailingSpaceFromErrorMessage(_this__u8e3s4) {
|
|
1376
1376
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
1377
1377
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1378
|
-
scope.
|
|
1379
|
-
var tmp = scope.
|
|
1378
|
+
scope.k18(stripTrailingSpaceFromErrorMessage$lambda);
|
|
1379
|
+
var tmp = scope.u17_1;
|
|
1380
1380
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1381
1381
|
}
|
|
1382
1382
|
function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
@@ -1384,7 +1384,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1384
1384
|
if (!(stmt instanceof Switch)) {
|
|
1385
1385
|
tmp = true;
|
|
1386
1386
|
} else {
|
|
1387
|
-
var tmp0 = stmt.
|
|
1387
|
+
var tmp0 = stmt.vy_1;
|
|
1388
1388
|
var tmp$ret$0;
|
|
1389
1389
|
$l$block_0: {
|
|
1390
1390
|
// Inline function 'kotlin.collections.none' call
|
|
@@ -1401,7 +1401,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1401
1401
|
var _iterator__ex2g4s = tmp0.t();
|
|
1402
1402
|
while (_iterator__ex2g4s.u()) {
|
|
1403
1403
|
var element = _iterator__ex2g4s.v();
|
|
1404
|
-
if (!(element.
|
|
1404
|
+
if (!(element.cz_1 == null)) {
|
|
1405
1405
|
tmp$ret$0 = false;
|
|
1406
1406
|
break $l$block_0;
|
|
1407
1407
|
}
|
|
@@ -1412,11 +1412,11 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1412
1412
|
}
|
|
1413
1413
|
if (tmp)
|
|
1414
1414
|
return transformChildren(stmt, tr);
|
|
1415
|
-
var tmp0_safe_receiver = stmt.
|
|
1416
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1415
|
+
var tmp0_safe_receiver = stmt.xy_1;
|
|
1416
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.yt();
|
|
1417
1417
|
var varName = tmp1_elvis_lhs == null ? 'r' : tmp1_elvis_lhs;
|
|
1418
1418
|
// Inline function 'kotlin.collections.map' call
|
|
1419
|
-
var this_0 = stmt.
|
|
1419
|
+
var this_0 = stmt.vy_1;
|
|
1420
1420
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1421
1421
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1422
1422
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
@@ -1424,39 +1424,39 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1424
1424
|
var item = _iterator__ex2g4s_0.v();
|
|
1425
1425
|
var tmp$ret$4;
|
|
1426
1426
|
$l$block_1: {
|
|
1427
|
-
var tmp_1 = item.
|
|
1427
|
+
var tmp_1 = item.cz_1;
|
|
1428
1428
|
var tmp0_safe_receiver_0 = tmp_1 instanceof Custom_0 ? tmp_1 : null;
|
|
1429
|
-
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.
|
|
1430
|
-
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
1429
|
+
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.qu_1;
|
|
1430
|
+
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.zt();
|
|
1431
1431
|
var tmp3_safe_receiver = typeName == null ? null : substringAfterLast(typeName, '.');
|
|
1432
1432
|
var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : removePrefix(tmp3_safe_receiver, 'Response');
|
|
1433
1433
|
var statusNum = tmp4_safe_receiver == null ? null : toIntOrNull(tmp4_safe_receiver);
|
|
1434
1434
|
if (statusNum == null) {
|
|
1435
1435
|
// Inline function 'kotlin.collections.map' call
|
|
1436
|
-
var this_1 = item.
|
|
1436
|
+
var this_1 = item.bz_1;
|
|
1437
1437
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1438
1438
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1439
1439
|
var _iterator__ex2g4s_1 = this_1.t();
|
|
1440
1440
|
while (_iterator__ex2g4s_1.u()) {
|
|
1441
1441
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
1442
|
-
var tmp$ret$7 = tr.
|
|
1442
|
+
var tmp$ret$7 = tr.o17(item_0);
|
|
1443
1443
|
destination_0.x(tmp$ret$7);
|
|
1444
1444
|
}
|
|
1445
|
-
tmp$ret$4 = item.
|
|
1445
|
+
tmp$ret$4 = item.ez(VOID, destination_0);
|
|
1446
1446
|
break $l$block_1;
|
|
1447
1447
|
}
|
|
1448
|
-
var exprCode = TypeScriptGenerator_getInstance().
|
|
1449
|
-
var castAssignment = new Assignment(Companion_getInstance().
|
|
1448
|
+
var exprCode = TypeScriptGenerator_getInstance().y1a(tr.p17(stmt.uy_1));
|
|
1449
|
+
var castAssignment = new Assignment(Companion_getInstance().wt(varName), new RawExpression(exprCode + ' as ' + typeName), false);
|
|
1450
1450
|
var tmp_2 = new Literal(statusNum, new Integer_0());
|
|
1451
1451
|
var tmp_3 = listOf_0(castAssignment);
|
|
1452
1452
|
// Inline function 'kotlin.collections.map' call
|
|
1453
|
-
var this_2 = item.
|
|
1453
|
+
var this_2 = item.bz_1;
|
|
1454
1454
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1455
1455
|
var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
|
|
1456
1456
|
var _iterator__ex2g4s_2 = this_2.t();
|
|
1457
1457
|
while (_iterator__ex2g4s_2.u()) {
|
|
1458
1458
|
var item_1 = _iterator__ex2g4s_2.v();
|
|
1459
|
-
var tmp$ret$10 = tr.
|
|
1459
|
+
var tmp$ret$10 = tr.o17(item_1);
|
|
1460
1460
|
destination_1.x(tmp$ret$10);
|
|
1461
1461
|
}
|
|
1462
1462
|
tmp$ret$4 = new Case(tmp_2, plus(tmp_3, destination_1), null);
|
|
@@ -1464,8 +1464,8 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1464
1464
|
destination.x(tmp$ret$4);
|
|
1465
1465
|
}
|
|
1466
1466
|
var transformedCases = destination;
|
|
1467
|
-
var tmp_4 = new FieldCall(tr.
|
|
1468
|
-
var tmp2_safe_receiver = stmt.
|
|
1467
|
+
var tmp_4 = new FieldCall(tr.p17(stmt.uy_1), Companion_getInstance().wt('status'));
|
|
1468
|
+
var tmp2_safe_receiver = stmt.wy_1;
|
|
1469
1469
|
var tmp_5;
|
|
1470
1470
|
if (tmp2_safe_receiver == null) {
|
|
1471
1471
|
tmp_5 = null;
|
|
@@ -1476,7 +1476,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1476
1476
|
var _iterator__ex2g4s_3 = tmp2_safe_receiver.t();
|
|
1477
1477
|
while (_iterator__ex2g4s_3.u()) {
|
|
1478
1478
|
var item_2 = _iterator__ex2g4s_3.v();
|
|
1479
|
-
var tmp$ret$13 = tr.
|
|
1479
|
+
var tmp$ret$13 = tr.o17(item_2);
|
|
1480
1480
|
destination_2.x(tmp$ret$13);
|
|
1481
1481
|
}
|
|
1482
1482
|
tmp_5 = destination_2;
|
|
@@ -1489,9 +1489,9 @@ function renameValidateAndBindObjReceiver$lambda$lambda($fieldNames) {
|
|
|
1489
1489
|
var tmp_0;
|
|
1490
1490
|
if (s instanceof FunctionCall) {
|
|
1491
1491
|
var tmp_1;
|
|
1492
|
-
if (s.
|
|
1492
|
+
if (s.eu_1.equals(Companion_getInstance().wt('validate')) && !(s.cu_1 == null)) {
|
|
1493
1493
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1494
|
-
tmp_1 = !s.
|
|
1494
|
+
tmp_1 = !s.du_1.r();
|
|
1495
1495
|
} else {
|
|
1496
1496
|
tmp_1 = false;
|
|
1497
1497
|
}
|
|
@@ -1500,21 +1500,21 @@ function renameValidateAndBindObjReceiver$lambda$lambda($fieldNames) {
|
|
|
1500
1500
|
tmp_0 = false;
|
|
1501
1501
|
}
|
|
1502
1502
|
if (tmp_0) {
|
|
1503
|
-
var tmp_2 = first(s.
|
|
1503
|
+
var tmp_2 = first(s.du_1);
|
|
1504
1504
|
var tmp1_safe_receiver = tmp_2 instanceof Custom_0 ? tmp_2 : null;
|
|
1505
|
-
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
1506
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.
|
|
1505
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.qu_1;
|
|
1506
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.zt();
|
|
1507
1507
|
var tn = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs;
|
|
1508
|
-
tmp = new FunctionCall(VOID, VOID, Companion_getInstance().
|
|
1508
|
+
tmp = new FunctionCall(VOID, VOID, Companion_getInstance().wt('validate' + tn), mapOf(to(Companion_getInstance().wt('obj'), t.p17(ensureNotNull(s.cu_1)))));
|
|
1509
1509
|
} else {
|
|
1510
1510
|
var tmp_3;
|
|
1511
1511
|
if (s instanceof FieldCall) {
|
|
1512
|
-
tmp_3 = (s.
|
|
1512
|
+
tmp_3 = (s.fz_1 == null && $fieldNames.i1(s.gz_1.yt()));
|
|
1513
1513
|
} else {
|
|
1514
1514
|
tmp_3 = false;
|
|
1515
1515
|
}
|
|
1516
1516
|
if (tmp_3) {
|
|
1517
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().
|
|
1517
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().wt('obj')), s.gz_1);
|
|
1518
1518
|
} else {
|
|
1519
1519
|
tmp = transformChildren(s, t);
|
|
1520
1520
|
}
|
|
@@ -1528,15 +1528,15 @@ function renameValidateAndBindObjReceiver$lambda($typeName, $fieldNames) {
|
|
|
1528
1528
|
if (element instanceof Function) {
|
|
1529
1529
|
var tmp$ret$0;
|
|
1530
1530
|
$l$block: {
|
|
1531
|
-
if (!element.
|
|
1531
|
+
if (!element.tx_1.equals(Companion_getInstance().wt('validate'))) {
|
|
1532
1532
|
tmp$ret$0 = element;
|
|
1533
1533
|
break $l$block;
|
|
1534
1534
|
}
|
|
1535
1535
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
1536
|
-
var this_0 = element.
|
|
1536
|
+
var this_0 = element.fy(Companion_getInstance().wt('validate' + $typeName), VOID, listOf_0(new Parameter(Companion_getInstance().wt('obj'), Custom_init_$Create$($typeName))));
|
|
1537
1537
|
var scope = new TransformScope(this_0);
|
|
1538
|
-
scope.
|
|
1539
|
-
var tmp_0 = scope.
|
|
1538
|
+
scope.m18(renameValidateAndBindObjReceiver$lambda$lambda($fieldNames));
|
|
1539
|
+
var tmp_0 = scope.u17_1;
|
|
1540
1540
|
tmp$ret$0 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1541
1541
|
}
|
|
1542
1542
|
tmp = tmp$ret$0;
|
|
@@ -1550,10 +1550,10 @@ function renameValidateAndBindObjReceiver$lambda($typeName, $fieldNames) {
|
|
|
1550
1550
|
function buildApiConst$lambda(it) {
|
|
1551
1551
|
var tmp;
|
|
1552
1552
|
if (it instanceof Literal_0) {
|
|
1553
|
-
tmp = it.
|
|
1553
|
+
tmp = it.a1a_1;
|
|
1554
1554
|
} else {
|
|
1555
1555
|
if (it instanceof Param) {
|
|
1556
|
-
tmp = '{' + it.
|
|
1556
|
+
tmp = '{' + it.mr_1.o1() + '}';
|
|
1557
1557
|
} else {
|
|
1558
1558
|
noWhenBranchMatchedException();
|
|
1559
1559
|
}
|
|
@@ -1565,23 +1565,23 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
1565
1565
|
if (element instanceof Interface) {
|
|
1566
1566
|
var tmp$ret$0;
|
|
1567
1567
|
$l$block: {
|
|
1568
|
-
if (!element.
|
|
1568
|
+
if (!element.tv_1.equals(Companion_getInstance().wt('Call'))) {
|
|
1569
1569
|
tmp$ret$0 = element;
|
|
1570
1570
|
break $l$block;
|
|
1571
1571
|
}
|
|
1572
1572
|
// Inline function 'kotlin.collections.map' call
|
|
1573
|
-
var this_0 = element.
|
|
1573
|
+
var this_0 = element.uv_1;
|
|
1574
1574
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1575
1575
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1576
1576
|
var _iterator__ex2g4s = this_0.t();
|
|
1577
1577
|
while (_iterator__ex2g4s.u()) {
|
|
1578
1578
|
var item = _iterator__ex2g4s.v();
|
|
1579
1579
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
1580
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1580
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.fy(VOID, VOID, listOf_0(new Parameter(Companion_getInstance().wt('params'), Custom_init_$Create$('RequestParams'))));
|
|
1581
1581
|
var tmp$ret$3 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
1582
1582
|
destination.x(tmp$ret$3);
|
|
1583
1583
|
}
|
|
1584
|
-
tmp$ret$0 = element.
|
|
1584
|
+
tmp$ret$0 = element.bw(VOID, destination);
|
|
1585
1585
|
}
|
|
1586
1586
|
tmp = tmp$ret$0;
|
|
1587
1587
|
} else {
|
|
@@ -1593,7 +1593,7 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
1593
1593
|
function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
1594
1594
|
var tmp;
|
|
1595
1595
|
if (stmt instanceof Switch) {
|
|
1596
|
-
var tmp1_safe_receiver = stmt.
|
|
1596
|
+
var tmp1_safe_receiver = stmt.wy_1;
|
|
1597
1597
|
var tmp_0;
|
|
1598
1598
|
if (tmp1_safe_receiver == null) {
|
|
1599
1599
|
tmp_0 = null;
|
|
@@ -1615,7 +1615,7 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
1615
1615
|
tmp_1 = tmp0_elvis_lhs;
|
|
1616
1616
|
}
|
|
1617
1617
|
var errorStmt = tmp_1;
|
|
1618
|
-
var tmp_2 = errorStmt.
|
|
1618
|
+
var tmp_2 = errorStmt.oz_1;
|
|
1619
1619
|
var tmp1_elvis_lhs = tmp_2 instanceof BinaryOp ? tmp_2 : null;
|
|
1620
1620
|
var tmp_3;
|
|
1621
1621
|
if (tmp1_elvis_lhs == null) {
|
|
@@ -1625,7 +1625,7 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
1625
1625
|
tmp_3 = tmp1_elvis_lhs;
|
|
1626
1626
|
}
|
|
1627
1627
|
var binary = tmp_3;
|
|
1628
|
-
var tmp_4 = binary.
|
|
1628
|
+
var tmp_4 = binary.pz_1;
|
|
1629
1629
|
var tmp2_elvis_lhs = tmp_4 instanceof Literal ? tmp_4 : null;
|
|
1630
1630
|
var tmp_5;
|
|
1631
1631
|
if (tmp2_elvis_lhs == null) {
|
|
@@ -1635,23 +1635,23 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
1635
1635
|
tmp_5 = tmp2_elvis_lhs;
|
|
1636
1636
|
}
|
|
1637
1637
|
var literal = tmp_5;
|
|
1638
|
-
tmp$ret$2 = new ErrorStatement(new Literal(trimEnd(toString_0(literal.
|
|
1638
|
+
tmp$ret$2 = new ErrorStatement(new Literal(trimEnd(toString_0(literal.qy_1), charArrayOf([_Char___init__impl__6a9atx(32)])), literal.ry_1));
|
|
1639
1639
|
}
|
|
1640
1640
|
destination.x(tmp$ret$2);
|
|
1641
1641
|
}
|
|
1642
1642
|
tmp_0 = destination;
|
|
1643
1643
|
}
|
|
1644
|
-
tmp = transformChildren(stmt.
|
|
1644
|
+
tmp = transformChildren(stmt.zy(VOID, VOID, tmp_0), transformer);
|
|
1645
1645
|
} else {
|
|
1646
1646
|
tmp = transformChildren(stmt, transformer);
|
|
1647
1647
|
}
|
|
1648
1648
|
return tmp;
|
|
1649
1649
|
}
|
|
1650
1650
|
//region block: post-declaration
|
|
1651
|
-
protoOf(TypeScriptEmitter).
|
|
1652
|
-
protoOf(TypeScriptEmitter).
|
|
1653
|
-
protoOf(TypeScriptEmitter).
|
|
1654
|
-
protoOf(TypeScriptEmitter).
|
|
1651
|
+
protoOf(TypeScriptEmitter).e1a = get_extensions;
|
|
1652
|
+
protoOf(TypeScriptEmitter).b1a = emit_1;
|
|
1653
|
+
protoOf(TypeScriptEmitter).g1a = beforeGenerate;
|
|
1654
|
+
protoOf(TypeScriptEmitter).vp = get_supportsDefaults;
|
|
1655
1655
|
//endregion
|
|
1656
1656
|
//region block: exports
|
|
1657
1657
|
export {
|