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