@flock/wirespec 0.19.2 → 0.19.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/clikt-clikt-mordant.mjs +39 -39
- package/colormath-root-colormath.mjs +432 -432
- package/kotlin-kotlin-stdlib.mjs +6 -6
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +9765 -9765
- package/kotlin-rgxgen.mjs +1756 -1756
- package/kotlinx-io-kotlinx-io-core.mjs +403 -403
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1759 -1759
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1468 -1468
- package/mordant-mordant.mjs +1181 -1181
- package/package.json +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +238 -236
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +139 -137
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +176 -174
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +305 -303
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +112 -110
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +179 -177
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +24 -24
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +2626 -2578
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +479 -479
- package/wirespec-src-converter-openapi.mjs +338 -338
- package/wirespec-src-ide-lsp.mjs +1351 -1351
- package/wirespec-src-plugin-arguments.mjs +134 -134
- package/wirespec-src-plugin-cli.mjs +84 -84
- package/wirespec-src-plugin-npm.mjs +18 -18
- package/wirespec-src-tools-generator.mjs +2 -2
|
@@ -175,6 +175,7 @@ import {
|
|
|
175
175
|
requestParameters1z8fdizgtviyb as requestParameters,
|
|
176
176
|
convert32tuiui3czihh as convert_3,
|
|
177
177
|
convert1cn4bolzoed8c as convert_4,
|
|
178
|
+
get_extensions31c4or738wbxz as get_extensions,
|
|
178
179
|
emit3bzdcd0f6nwtj as emit_1,
|
|
179
180
|
beforeGenerate3o8idb3hey1b0 as beforeGenerate,
|
|
180
181
|
IrEmitterh2m93ojzvkep as IrEmitter,
|
|
@@ -198,7 +199,7 @@ function emit_2(identifier) {
|
|
|
198
199
|
}
|
|
199
200
|
initMetadataForInterface(TypeScriptIdentifierEmitter, 'TypeScriptIdentifierEmitter');
|
|
200
201
|
function sanitizeSymbol(_this__u8e3s4) {
|
|
201
|
-
return this.
|
|
202
|
+
return this.g1x(_this__u8e3s4.l1());
|
|
202
203
|
}
|
|
203
204
|
function sanitizeSymbol_0(_this__u8e3s4) {
|
|
204
205
|
var tmp = asSequence_0(_this__u8e3s4);
|
|
@@ -227,7 +228,7 @@ function emit_3(type, module_0) {
|
|
|
227
228
|
destination.x(tmp$ret$2);
|
|
228
229
|
}
|
|
229
230
|
var tmp = destination;
|
|
230
|
-
return trimMargin('\n |' + joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda) + '\n |export type ' + this.
|
|
231
|
+
return trimMargin('\n |' + joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda) + '\n |export type ' + this.q20(type.lp_1) + ' = {\n |' + this.lq(type.mp_1) + '\n |}\n |\n ');
|
|
231
232
|
}
|
|
232
233
|
function emit_4(_this__u8e3s4) {
|
|
233
234
|
var tmp;
|
|
@@ -244,10 +245,10 @@ function emit_4(_this__u8e3s4) {
|
|
|
244
245
|
tmp = 'any';
|
|
245
246
|
} else {
|
|
246
247
|
if (_this__u8e3s4 instanceof Custom) {
|
|
247
|
-
tmp = this.
|
|
248
|
+
tmp = this.g1x(_this__u8e3s4.bv_1);
|
|
248
249
|
} else {
|
|
249
250
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
250
|
-
tmp = this.
|
|
251
|
+
tmp = this.r20(_this__u8e3s4);
|
|
251
252
|
} else {
|
|
252
253
|
noWhenBranchMatchedException();
|
|
253
254
|
}
|
|
@@ -378,13 +379,8 @@ function emitClient(ast) {
|
|
|
378
379
|
return new Emitted(tmp, trimMargin('\n |import {Wirespec} from "./Wirespec"\n |\n |' + tmp_1 + '\n |\n |' + tmp_3 + '\n |\n |type RawHandler = (req: Wirespec.RawRequest) => Promise<Wirespec.RawResponse>\n |\n |export const client = (serialization: Wirespec.Serialization, handler: RawHandler) => ({\n |' + spacer(joinToString(tmp_4, '\n', VOID, VOID, VOID, VOID, TypeScriptClientEmitter$emitClient$lambda_1(this)), 1) + '\n |})\n |\n '));
|
|
379
380
|
}
|
|
380
381
|
initMetadataForInterface(TypeScriptClientEmitter, 'TypeScriptClientEmitter', VOID, VOID, [ClientEmitter, TypeScriptTypeDefinitionEmitter]);
|
|
381
|
-
function emit_8(
|
|
382
|
-
|
|
383
|
-
return 'export type ' + tmp + ' = ' + joinToString(enum_0.yr_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEnumDefinitionEmitter$emit$lambda) + '\n';
|
|
384
|
-
}
|
|
385
|
-
initMetadataForInterface(TypeScriptEnumDefinitionEmitter, 'TypeScriptEnumDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
386
|
-
function emit_9(refined) {
|
|
387
|
-
return trimMargin('\n |export type ' + this.n20(refined.sr_1) + ' = ' + this.nq(refined.tr_1) + ';\n |export const validate' + refined.sr_1.l1() + ' = (value: ' + this.nq(refined.tr_1) + '): value is ' + this.n20(refined.sr_1) + ' => {\n |' + this.bs(refined) + '\n |}\n |\n ');
|
|
382
|
+
function emit_8(refined) {
|
|
383
|
+
return trimMargin('\n |export type ' + this.q20(refined.sr_1) + ' = ' + this.nq(refined.tr_1) + ';\n |export const validate' + refined.sr_1.l1() + ' = (value: ' + this.nq(refined.tr_1) + '): value is ' + this.q20(refined.sr_1) + ' => {\n |' + this.bs(refined) + '\n |}\n |\n ');
|
|
388
384
|
}
|
|
389
385
|
function emitValidator(_this__u8e3s4) {
|
|
390
386
|
var defaultReturn = Spacer_instance.toString() + 'return true;';
|
|
@@ -427,7 +423,7 @@ function emitValidator(_this__u8e3s4) {
|
|
|
427
423
|
return tmp;
|
|
428
424
|
}
|
|
429
425
|
initMetadataForInterface(TypeScriptRefinedTypeDefinitionEmitter, 'TypeScriptRefinedTypeDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
430
|
-
function
|
|
426
|
+
function emit_9(endpoint) {
|
|
431
427
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
432
428
|
var this_0 = importReferences(endpoint);
|
|
433
429
|
var set = HashSet_init_$Create$();
|
|
@@ -451,7 +447,7 @@ function emit_10(endpoint) {
|
|
|
451
447
|
}
|
|
452
448
|
var tmp = destination;
|
|
453
449
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda);
|
|
454
|
-
var tmp_1 = this.
|
|
450
|
+
var tmp_1 = this.q20(endpoint.up_1);
|
|
455
451
|
var tmp_2 = get_pathParams(endpoint);
|
|
456
452
|
var tmp_3 = emitType(this, tmp_2, 'Path', TypeScriptEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
457
453
|
var tmp_4 = emitType(this, endpoint.xp_1, 'Queries', TypeScriptEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
@@ -473,13 +469,18 @@ function emit_10(endpoint) {
|
|
|
473
469
|
var tmp_20 = prependIndent(emitServer(this, endpoint), Spacer_instance.hs(1));
|
|
474
470
|
var tmp_21 = Spacer_instance.toString();
|
|
475
471
|
var tmp_22 = Spacer_instance.hs(2);
|
|
476
|
-
var tmp_23 = Companion_instance_0.fr(this.
|
|
472
|
+
var tmp_23 = Companion_instance_0.fr(this.q20(endpoint.up_1));
|
|
477
473
|
var tmp_24 = Spacer_instance.hs(2);
|
|
478
474
|
var tmp_25 = Spacer_instance.hs(2);
|
|
479
475
|
return trimMargin('\n |' + tmp_0 + '\n |export namespace ' + tmp_1 + ' {\n |' + tmp_3 + '\n |' + tmp_4 + '\n |' + tmp_5 + '\n |' + tmp_6 + '\n |' + tmp_8 + '\n |' + tmp_9 + 'export type Response = ' + tmp_11 + '\n |' + tmp_12 + '\n |' + tmp_14 + '\n |' + tmp_15 + 'export type Handler = {\n |' + tmp_16 + tmp_17 + '\n |' + tmp_18 + '}\n |' + tmp_19 + '\n |' + tmp_20 + '\n |' + tmp_21 + 'export const api = {\n |' + tmp_22 + 'name: "' + tmp_23 + '",\n |' + tmp_24 + 'method: "' + endpoint.vp_1.a3_1 + '",\n |' + tmp_25 + 'path: "' + joinToString(endpoint.wp_1, '/', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_6(this)) + '",\n |' + Spacer_instance.hs(2) + 'server,\n |' + Spacer_instance.hs(2) + 'client\n |' + Spacer_instance.toString() + '} as const\n |}\n |\n ');
|
|
480
476
|
}
|
|
481
477
|
initMetadataForInterface(TypeScriptEndpointDefinitionEmitter, 'TypeScriptEndpointDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
482
|
-
|
|
478
|
+
function emit_10(enum_0, module_0) {
|
|
479
|
+
var tmp = this.q20(enum_0.xr_1);
|
|
480
|
+
return 'export type ' + tmp + ' = ' + joinToString(enum_0.yr_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEnumDefinitionEmitter$emit$lambda) + '\n';
|
|
481
|
+
}
|
|
482
|
+
initMetadataForInterface(TypeScriptEnumDefinitionEmitter, 'TypeScriptEnumDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
483
|
+
initMetadataForClass(TypeScriptEmitter, 'TypeScriptEmitter', TypeScriptEmitter, LanguageEmitter, [LanguageEmitter, TypeScriptRefinedTypeDefinitionEmitter, TypeScriptEndpointDefinitionEmitter, TypeScriptClientEmitter, TypeScriptIdentifierEmitter, TypeScriptTypeDefinitionEmitter, TypeScriptEnumDefinitionEmitter]);
|
|
483
484
|
initMetadataForClass(EndpointParam, 'EndpointParam');
|
|
484
485
|
initMetadataForCompanion(Companion);
|
|
485
486
|
initMetadataForClass(TypeScriptIrEmitter, 'TypeScriptIrEmitter', TypeScriptIrEmitter, VOID, [IrEmitter]);
|
|
@@ -575,25 +576,25 @@ function TypeScriptEmitter$emit$lambda_1(this$0) {
|
|
|
575
576
|
}
|
|
576
577
|
function TypeScriptEmitter() {
|
|
577
578
|
LanguageEmitter.call(this);
|
|
578
|
-
this.
|
|
579
|
-
this.
|
|
580
|
-
this.
|
|
579
|
+
this.s20_1 = FileExtension_TypeScript_getInstance();
|
|
580
|
+
this.t20_1 = TypeScriptShared_getInstance();
|
|
581
|
+
this.u20_1 = '//';
|
|
581
582
|
}
|
|
582
583
|
protoOf(TypeScriptEmitter).uq = function () {
|
|
583
|
-
return this.
|
|
584
|
+
return this.s20_1;
|
|
584
585
|
};
|
|
585
|
-
protoOf(TypeScriptEmitter).
|
|
586
|
-
return this.
|
|
586
|
+
protoOf(TypeScriptEmitter).d1x = function () {
|
|
587
|
+
return this.t20_1;
|
|
587
588
|
};
|
|
588
589
|
protoOf(TypeScriptEmitter).vq = function () {
|
|
589
|
-
return this.
|
|
590
|
+
return this.u20_1;
|
|
590
591
|
};
|
|
591
592
|
protoOf(TypeScriptEmitter).eo = function (ast, logger) {
|
|
592
593
|
// Inline function 'kotlin.run' call
|
|
593
594
|
var $this$run = protoOf(LanguageEmitter).eo.call(this, ast, logger);
|
|
594
595
|
var tmp;
|
|
595
596
|
if (hasEndpoints(ast)) {
|
|
596
|
-
tmp = NonEmptyList__plus_impl_xqmb9($this$run, this.
|
|
597
|
+
tmp = NonEmptyList__plus_impl_xqmb9($this$run, this.p20(ast));
|
|
597
598
|
} else {
|
|
598
599
|
tmp = $this$run;
|
|
599
600
|
}
|
|
@@ -652,13 +653,13 @@ protoOf(TypeScriptEmitter).eo = function (ast, logger) {
|
|
|
652
653
|
protoOf(TypeScriptEmitter).kr = function (module_0, logger) {
|
|
653
654
|
// Inline function 'kotlin.let' call
|
|
654
655
|
var it = protoOf(LanguageEmitter).kr.call(this, module_0, logger);
|
|
655
|
-
return NonEmptyList__plus_impl_xqmb9(it, new Emitted('Wirespec', this.
|
|
656
|
+
return NonEmptyList__plus_impl_xqmb9(it, new Emitted('Wirespec', this.d1x().w20_1));
|
|
656
657
|
};
|
|
657
658
|
protoOf(TypeScriptEmitter).lr = function (definition, module_0, logger) {
|
|
658
659
|
// Inline function 'kotlin.let' call
|
|
659
660
|
var it = protoOf(LanguageEmitter).lr.call(this, definition, module_0, logger);
|
|
660
661
|
var subPackageName = plus(Companion_instance.cs(''), definition);
|
|
661
|
-
return new Emitted(subPackageName.fs() + this.
|
|
662
|
+
return new Emitted(subPackageName.fs() + this.g1x(it.yo_1), trimMargin("\n |import {Wirespec} from '../Wirespec'\n |\n |" + it.zo_1 + '\n '));
|
|
662
663
|
};
|
|
663
664
|
protoOf(TypeScriptEmitter).pr = function (union) {
|
|
664
665
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
@@ -684,7 +685,7 @@ protoOf(TypeScriptEmitter).pr = function (union) {
|
|
|
684
685
|
}
|
|
685
686
|
var tmp = destination;
|
|
686
687
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda_0);
|
|
687
|
-
var tmp_1 = this.
|
|
688
|
+
var tmp_1 = this.q20(union.gp_1);
|
|
688
689
|
return trimMargin('\n |' + tmp_0 + '\n |export type ' + tmp_1 + ' = ' + joinToString(union.hp_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda_1(this)) + '\n |\n ');
|
|
689
690
|
};
|
|
690
691
|
protoOf(TypeScriptEmitter).or = function (channel) {
|
|
@@ -911,7 +912,7 @@ function joinToObject($this, _this__u8e3s4, transform) {
|
|
|
911
912
|
return joinToString(_this__u8e3s4, ', ', '{', '}', VOID, VOID, transform);
|
|
912
913
|
}
|
|
913
914
|
function emitHandleFunction($this, endpoint) {
|
|
914
|
-
return Companion_instance_0.fr($this.
|
|
915
|
+
return Companion_instance_0.fr($this.q20(endpoint.up_1)) + ': (request:Request) => Promise<Response>';
|
|
915
916
|
}
|
|
916
917
|
function lowercase($this, _this__u8e3s4) {
|
|
917
918
|
// Inline function 'kotlin.text.lowercase' call
|
|
@@ -1068,14 +1069,14 @@ function TypeScriptEnumDefinitionEmitter() {
|
|
|
1068
1069
|
function TypeScriptIdentifierEmitter() {
|
|
1069
1070
|
}
|
|
1070
1071
|
function _get_sanitizationConfig__sns434($this) {
|
|
1071
|
-
var tmp0 = $this.
|
|
1072
|
+
var tmp0 = $this.z20_1;
|
|
1072
1073
|
var tmp = KProperty1;
|
|
1073
1074
|
// Inline function 'kotlin.getValue' call
|
|
1074
1075
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, TypeScriptIrEmitter$_get_sanitizationConfig_$ref_f6f0bh(), null);
|
|
1075
1076
|
return tmp0.l1();
|
|
1076
1077
|
}
|
|
1077
1078
|
function _get_modelSanitizationConfig__vgg831($this) {
|
|
1078
|
-
var tmp0 = $this.
|
|
1079
|
+
var tmp0 = $this.a21_1;
|
|
1079
1080
|
var tmp = KProperty1;
|
|
1080
1081
|
// Inline function 'kotlin.getValue' call
|
|
1081
1082
|
getPropertyCallableRef('modelSanitizationConfig', 1, tmp, TypeScriptIrEmitter$_get_modelSanitizationConfig_$ref_ar2t88(), null);
|
|
@@ -1103,7 +1104,7 @@ function sanitizeSymbol_1($this, _this__u8e3s4) {
|
|
|
1103
1104
|
return destination.toString();
|
|
1104
1105
|
}
|
|
1105
1106
|
function sanitizeKeywords($this, _this__u8e3s4) {
|
|
1106
|
-
return Companion_getInstance_0().
|
|
1107
|
+
return Companion_getInstance_0().c21_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1107
1108
|
}
|
|
1108
1109
|
function firstToLower($this, _this__u8e3s4) {
|
|
1109
1110
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
@@ -1237,17 +1238,17 @@ function emitTypeScriptReference($this, ref) {
|
|
|
1237
1238
|
return tmp + (ref.tu() ? ' | undefined' : '');
|
|
1238
1239
|
}
|
|
1239
1240
|
function EndpointParam(name, type, nullable) {
|
|
1240
|
-
this.
|
|
1241
|
-
this.
|
|
1242
|
-
this.
|
|
1241
|
+
this.d21_1 = name;
|
|
1242
|
+
this.e21_1 = type;
|
|
1243
|
+
this.f21_1 = nullable;
|
|
1243
1244
|
}
|
|
1244
1245
|
protoOf(EndpointParam).toString = function () {
|
|
1245
|
-
return 'EndpointParam(name=' + this.
|
|
1246
|
+
return 'EndpointParam(name=' + this.d21_1 + ', type=' + this.e21_1 + ', nullable=' + this.f21_1 + ')';
|
|
1246
1247
|
};
|
|
1247
1248
|
protoOf(EndpointParam).hashCode = function () {
|
|
1248
|
-
var result = getStringHashCode(this.
|
|
1249
|
-
result = imul(result, 31) + getStringHashCode(this.
|
|
1250
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
1249
|
+
var result = getStringHashCode(this.d21_1);
|
|
1250
|
+
result = imul(result, 31) + getStringHashCode(this.e21_1) | 0;
|
|
1251
|
+
result = imul(result, 31) + getBooleanHashCode(this.f21_1) | 0;
|
|
1251
1252
|
return result;
|
|
1252
1253
|
};
|
|
1253
1254
|
protoOf(EndpointParam).equals = function (other) {
|
|
@@ -1255,11 +1256,11 @@ protoOf(EndpointParam).equals = function (other) {
|
|
|
1255
1256
|
return true;
|
|
1256
1257
|
if (!(other instanceof EndpointParam))
|
|
1257
1258
|
return false;
|
|
1258
|
-
if (!(this.
|
|
1259
|
+
if (!(this.d21_1 === other.d21_1))
|
|
1259
1260
|
return false;
|
|
1260
|
-
if (!(this.
|
|
1261
|
+
if (!(this.e21_1 === other.e21_1))
|
|
1261
1262
|
return false;
|
|
1262
|
-
if (!(this.
|
|
1263
|
+
if (!(this.f21_1 === other.f21_1))
|
|
1263
1264
|
return false;
|
|
1264
1265
|
return true;
|
|
1265
1266
|
};
|
|
@@ -1278,8 +1279,8 @@ function Companion() {
|
|
|
1278
1279
|
var tmp$ret$2 = removePrefix(element, 'GeneratorField').toLowerCase();
|
|
1279
1280
|
result.s2(element, tmp$ret$2);
|
|
1280
1281
|
}
|
|
1281
|
-
tmp.
|
|
1282
|
-
this.
|
|
1282
|
+
tmp.b21_1 = result;
|
|
1283
|
+
this.c21_1 = setOf(['break', 'case', 'catch', 'continue', 'debugger', 'default', 'delete', 'do', 'else', 'finally', 'for', 'function', 'if', 'in', 'instanceof', 'new', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'var', 'void', 'while', 'with', 'class', 'const', 'enum', 'export', 'extends', 'import', 'super', 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', 'yield', 'type', 'async', 'await']);
|
|
1283
1284
|
}
|
|
1284
1285
|
var Companion_instance_1;
|
|
1285
1286
|
function Companion_getInstance_0() {
|
|
@@ -1324,12 +1325,12 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0)
|
|
|
1324
1325
|
return function (stmt, tr) {
|
|
1325
1326
|
var tmp;
|
|
1326
1327
|
if (stmt instanceof VariableReference) {
|
|
1327
|
-
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
1328
|
+
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.k1p_1));
|
|
1328
1329
|
} else {
|
|
1329
1330
|
if (stmt instanceof ConstructorStatement) {
|
|
1330
|
-
var tmp_0 = tr.
|
|
1331
|
+
var tmp_0 = tr.y1u(stmt.s1n_1);
|
|
1331
1332
|
// Inline function 'kotlin.collections.map' call
|
|
1332
|
-
var this_0 = stmt.
|
|
1333
|
+
var this_0 = stmt.t1n_1;
|
|
1333
1334
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1334
1335
|
var destination = ArrayList_init_$Create$_0(this_0.a1());
|
|
1335
1336
|
// Inline function 'kotlin.collections.iterator' call
|
|
@@ -1340,13 +1341,13 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0)
|
|
|
1340
1341
|
var key = item.k1();
|
|
1341
1342
|
// Inline function 'kotlin.collections.component2' call
|
|
1342
1343
|
var value = item.l1();
|
|
1343
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.
|
|
1344
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.b1v(value));
|
|
1344
1345
|
destination.x(tmp$ret$3);
|
|
1345
1346
|
}
|
|
1346
1347
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
1347
1348
|
} else {
|
|
1348
1349
|
if (stmt instanceof Assignment) {
|
|
1349
|
-
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
1350
|
+
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.n1p_1), tr.b1v(stmt.o1p_1), stmt.p1p_1);
|
|
1350
1351
|
} else {
|
|
1351
1352
|
tmp = transformChildren(stmt, tr);
|
|
1352
1353
|
}
|
|
@@ -1357,7 +1358,7 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0)
|
|
|
1357
1358
|
}
|
|
1358
1359
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1359
1360
|
return function () {
|
|
1360
|
-
var tmp0_reservedKeywords = Companion_getInstance_0().
|
|
1361
|
+
var tmp0_reservedKeywords = Companion_getInstance_0().c21_1;
|
|
1361
1362
|
var tmp = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1362
1363
|
var tmp_0 = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
|
|
1363
1364
|
var tmp_1 = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
|
|
@@ -1380,7 +1381,7 @@ function TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda(this$0) {
|
|
|
1380
1381
|
return function () {
|
|
1381
1382
|
var tmp = _get_sanitizationConfig__sns434(this$0);
|
|
1382
1383
|
var tmp_0 = TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda$lambda;
|
|
1383
|
-
return tmp.
|
|
1384
|
+
return tmp.t1w(VOID, VOID, tmp_0, VOID, TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda$lambda_0);
|
|
1384
1385
|
};
|
|
1385
1386
|
}
|
|
1386
1387
|
function TypeScriptIrEmitter$_get_modelSanitizationConfig_$ref_ar2t88() {
|
|
@@ -1391,11 +1392,11 @@ function TypeScriptIrEmitter$_get_modelSanitizationConfig_$ref_ar2t88() {
|
|
|
1391
1392
|
function TypeScriptIrEmitter$emitShared$lambda(element, transformer) {
|
|
1392
1393
|
var tmp;
|
|
1393
1394
|
if (element instanceof Namespace) {
|
|
1394
|
-
var injected = element.
|
|
1395
|
+
var injected = element.b1o_1.equals(Companion_getInstance().n1h('Wirespec')) ? listOf_0(new RawElement('export type Type = string')) : emptyList();
|
|
1395
1396
|
var tmp_0;
|
|
1396
1397
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1397
1398
|
if (!injected.r()) {
|
|
1398
|
-
tmp_0 = withElements(element, plus_1(injected, element.
|
|
1399
|
+
tmp_0 = withElements(element, plus_1(injected, element.x1n()));
|
|
1399
1400
|
} else {
|
|
1400
1401
|
tmp_0 = element;
|
|
1401
1402
|
}
|
|
@@ -1410,11 +1411,11 @@ function TypeScriptIrEmitter$emitShared$lambda_0($api) {
|
|
|
1410
1411
|
return function (element, transformer) {
|
|
1411
1412
|
var tmp;
|
|
1412
1413
|
if (element instanceof Namespace) {
|
|
1413
|
-
var injected = element.
|
|
1414
|
+
var injected = element.b1o_1.equals(Companion_getInstance().n1h('Wirespec')) ? listOf_0(new RawElement($api)) : emptyList();
|
|
1414
1415
|
var tmp_0;
|
|
1415
1416
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1416
1417
|
if (!injected.r()) {
|
|
1417
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1418
|
+
tmp_0 = withElements(element, plus_1(element.x1n(), injected));
|
|
1418
1419
|
} else {
|
|
1419
1420
|
tmp_0 = element;
|
|
1420
1421
|
}
|
|
@@ -1429,13 +1430,13 @@ function TypeScriptIrEmitter$emitShared$lambda_0($api) {
|
|
|
1429
1430
|
function TypeScriptIrEmitter$emitShared$lambda_1(element, transformer) {
|
|
1430
1431
|
var tmp;
|
|
1431
1432
|
if (element instanceof Struct) {
|
|
1432
|
-
var tmp0_safe_receiver = Companion_getInstance_0().
|
|
1433
|
+
var tmp0_safe_receiver = Companion_getInstance_0().b21_1.p2(element.g1o_1.j1j());
|
|
1433
1434
|
var tmp_0;
|
|
1434
1435
|
if (tmp0_safe_receiver == null) {
|
|
1435
1436
|
tmp_0 = null;
|
|
1436
1437
|
} else {
|
|
1437
1438
|
// Inline function 'kotlin.let' call
|
|
1438
|
-
tmp_0 = element.
|
|
1439
|
+
tmp_0 = element.n1o(VOID, plus_1(listOf_0(new Field(Companion_getInstance().n1h('kind'), new StringLiteral(tmp0_safe_receiver))), element.h1o_1));
|
|
1439
1440
|
}
|
|
1440
1441
|
var tmp1_elvis_lhs = tmp_0;
|
|
1441
1442
|
tmp = tmp1_elvis_lhs == null ? element : tmp1_elvis_lhs;
|
|
@@ -1455,24 +1456,24 @@ function TypeScriptIrEmitter$emitGenerator$lambda($definition) {
|
|
|
1455
1456
|
var tmp_1;
|
|
1456
1457
|
var tmp_2;
|
|
1457
1458
|
if (expr instanceof FunctionCall) {
|
|
1458
|
-
var tmp_3 = expr.
|
|
1459
|
+
var tmp_3 = expr.y1m_1;
|
|
1459
1460
|
tmp_2 = tmp_3 instanceof RawExpression;
|
|
1460
1461
|
} else {
|
|
1461
1462
|
tmp_2 = false;
|
|
1462
1463
|
}
|
|
1463
1464
|
if (tmp_2) {
|
|
1464
|
-
var tmp_4 = expr.
|
|
1465
|
-
tmp_1 = (tmp_4 instanceof RawExpression ? tmp_4 : THROW_CCE()).
|
|
1465
|
+
var tmp_4 = expr.y1m_1;
|
|
1466
|
+
tmp_1 = (tmp_4 instanceof RawExpression ? tmp_4 : THROW_CCE()).m1p_1 === $definition.xr_1.l1();
|
|
1466
1467
|
} else {
|
|
1467
1468
|
tmp_1 = false;
|
|
1468
1469
|
}
|
|
1469
1470
|
if (tmp_1) {
|
|
1470
|
-
tmp_0 = expr.
|
|
1471
|
+
tmp_0 = expr.a1n_1.equals(Companion_getInstance().n1h('valueOf'));
|
|
1471
1472
|
} else {
|
|
1472
1473
|
tmp_0 = false;
|
|
1473
1474
|
}
|
|
1474
1475
|
if (tmp_0) {
|
|
1475
|
-
var tmp0_elvis_lhs = expr.
|
|
1476
|
+
var tmp0_elvis_lhs = expr.b1n_1.p2(Companion_getInstance().n1h('label'));
|
|
1476
1477
|
tmp = tmp0_elvis_lhs == null ? expr : tmp0_elvis_lhs;
|
|
1477
1478
|
} else {
|
|
1478
1479
|
tmp = transformChildren_1(expr, t);
|
|
@@ -1485,12 +1486,12 @@ function TypeScriptIrEmitter$emitGenerator$lambda_0($definition) {
|
|
|
1485
1486
|
var tmp;
|
|
1486
1487
|
var tmp_0;
|
|
1487
1488
|
if (expr instanceof ConstructorStatement) {
|
|
1488
|
-
tmp_0 = equals(expr.
|
|
1489
|
+
tmp_0 = equals(expr.s1n_1, Custom_init_$Create$($definition.sr_1.l1()));
|
|
1489
1490
|
} else {
|
|
1490
1491
|
tmp_0 = false;
|
|
1491
1492
|
}
|
|
1492
1493
|
if (tmp_0) {
|
|
1493
|
-
var tmp0_elvis_lhs = expr.
|
|
1494
|
+
var tmp0_elvis_lhs = expr.t1n_1.p2(Companion_getInstance().n1h('value'));
|
|
1494
1495
|
tmp = tmp0_elvis_lhs == null ? expr : tmp0_elvis_lhs;
|
|
1495
1496
|
} else {
|
|
1496
1497
|
tmp = transformChildren_1(expr, t);
|
|
@@ -1501,7 +1502,7 @@ function TypeScriptIrEmitter$emitGenerator$lambda_0($definition) {
|
|
|
1501
1502
|
function TypeScriptIrEmitter$emitGenerator$lambda_1(expr, t) {
|
|
1502
1503
|
var tmp;
|
|
1503
1504
|
if (expr instanceof ConstructorStatement) {
|
|
1504
|
-
var tmp_0 = expr.
|
|
1505
|
+
var tmp_0 = expr.s1n_1;
|
|
1505
1506
|
var tmp0_safe_receiver = tmp_0 instanceof Custom_0 ? tmp_0 : null;
|
|
1506
1507
|
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.h1j_1;
|
|
1507
1508
|
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.j1j();
|
|
@@ -1511,14 +1512,14 @@ function TypeScriptIrEmitter$emitGenerator$lambda_1(expr, t) {
|
|
|
1511
1512
|
tmp_1 = null;
|
|
1512
1513
|
} else {
|
|
1513
1514
|
// Inline function 'kotlin.let' call
|
|
1514
|
-
tmp_1 = Companion_getInstance_0().
|
|
1515
|
+
tmp_1 = Companion_getInstance_0().b21_1.p2(typeName);
|
|
1515
1516
|
}
|
|
1516
1517
|
var kind = tmp_1;
|
|
1517
1518
|
var tmp_2;
|
|
1518
1519
|
if (!(kind == null)) {
|
|
1519
1520
|
var tmp_3 = mapOf(to(Companion_getInstance().n1h('kind'), new Literal_0(kind, String_instance)));
|
|
1520
1521
|
// Inline function 'kotlin.collections.mapValues' call
|
|
1521
|
-
var this_0 = expr.
|
|
1522
|
+
var this_0 = expr.t1n_1;
|
|
1522
1523
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
1523
1524
|
var destination = LinkedHashMap_init_$Create$_0(mapCapacity(this_0.a1()));
|
|
1524
1525
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
@@ -1528,10 +1529,10 @@ function TypeScriptIrEmitter$emitGenerator$lambda_1(expr, t) {
|
|
|
1528
1529
|
var tmp_4 = element.k1();
|
|
1529
1530
|
// Inline function 'kotlin.collections.component2' call
|
|
1530
1531
|
var v = element.l1();
|
|
1531
|
-
var tmp$ret$4 = t.
|
|
1532
|
+
var tmp$ret$4 = t.b1v(v);
|
|
1532
1533
|
destination.s2(tmp_4, tmp$ret$4);
|
|
1533
1534
|
}
|
|
1534
|
-
tmp_2 = new ConstructorStatement(expr.
|
|
1535
|
+
tmp_2 = new ConstructorStatement(expr.s1n_1, plus_2(tmp_3, destination));
|
|
1535
1536
|
} else {
|
|
1536
1537
|
tmp_2 = transformChildren(expr, t);
|
|
1537
1538
|
}
|
|
@@ -1558,17 +1559,17 @@ function TypeScriptIrEmitter$emitGenerator$lambda_5($generatorOwnName, $generato
|
|
|
1558
1559
|
var tmp_0;
|
|
1559
1560
|
var tmp_1;
|
|
1560
1561
|
if (expr instanceof RawExpression) {
|
|
1561
|
-
tmp_1 = endsWith(expr.
|
|
1562
|
+
tmp_1 = endsWith(expr.m1p_1, 'Generator');
|
|
1562
1563
|
} else {
|
|
1563
1564
|
tmp_1 = false;
|
|
1564
1565
|
}
|
|
1565
1566
|
if (tmp_1) {
|
|
1566
|
-
tmp_0 = !(expr.
|
|
1567
|
+
tmp_0 = !(expr.m1p_1 === $generatorOwnName);
|
|
1567
1568
|
} else {
|
|
1568
1569
|
tmp_0 = false;
|
|
1569
1570
|
}
|
|
1570
1571
|
if (tmp_0) {
|
|
1571
|
-
$generatorRefs.x(expr.
|
|
1572
|
+
$generatorRefs.x(expr.m1p_1);
|
|
1572
1573
|
tmp = Unit_instance;
|
|
1573
1574
|
}
|
|
1574
1575
|
return transformChildren_1(expr, t);
|
|
@@ -1582,7 +1583,7 @@ function TypeScriptIrEmitter$emit$injectApiConst$lambda($endpoint) {
|
|
|
1582
1583
|
var tmp_0;
|
|
1583
1584
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1584
1585
|
if (!injected.r()) {
|
|
1585
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1586
|
+
tmp_0 = withElements(element, plus_1(element.x1n(), injected));
|
|
1586
1587
|
} else {
|
|
1587
1588
|
tmp_0 = element;
|
|
1588
1589
|
}
|
|
@@ -1601,14 +1602,14 @@ function emit$injectApiConst(_this__u8e3s4, $endpoint) {
|
|
|
1601
1602
|
var tmp = scope;
|
|
1602
1603
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1603
1604
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1604
|
-
var this_0 = scope.
|
|
1605
|
+
var this_0 = scope.g1v_1;
|
|
1605
1606
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1606
1607
|
// Inline function 'kotlin.apply' call
|
|
1607
1608
|
var this_1 = new TransformerBuilder();
|
|
1608
|
-
this_1.
|
|
1609
|
-
var tmp$ret$2 = this_1.
|
|
1610
|
-
tmp.
|
|
1611
|
-
var tmp_0 = scope.
|
|
1609
|
+
this_1.x1i(TypeScriptIrEmitter$emit$injectApiConst$lambda($endpoint));
|
|
1610
|
+
var tmp$ret$2 = this_1.y1i();
|
|
1611
|
+
tmp.g1v_1 = transform(this_0, tmp$ret$2);
|
|
1612
|
+
var tmp_0 = scope.g1v_1;
|
|
1612
1613
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1613
1614
|
}
|
|
1614
1615
|
function emit$applyCallParamsIfNeeded(_this__u8e3s4, hasRequestParams) {
|
|
@@ -1622,20 +1623,20 @@ function TypeScriptIrEmitter$emitClient$lambda(this$0) {
|
|
|
1622
1623
|
}
|
|
1623
1624
|
function TypeScriptIrEmitter() {
|
|
1624
1625
|
Companion_getInstance_0();
|
|
1625
|
-
this.
|
|
1626
|
-
this.
|
|
1626
|
+
this.x20_1 = TypeScriptGenerator_getInstance();
|
|
1627
|
+
this.y20_1 = FileExtension_TypeScript_getInstance();
|
|
1627
1628
|
var tmp = this;
|
|
1628
|
-
tmp.
|
|
1629
|
+
tmp.z20_1 = lazy(TypeScriptIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1629
1630
|
var tmp_0 = this;
|
|
1630
|
-
tmp_0.
|
|
1631
|
+
tmp_0.a21_1 = lazy(TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda(this));
|
|
1631
1632
|
}
|
|
1632
|
-
protoOf(TypeScriptIrEmitter).
|
|
1633
|
-
return this.
|
|
1633
|
+
protoOf(TypeScriptIrEmitter).t1v = function () {
|
|
1634
|
+
return this.x20_1;
|
|
1634
1635
|
};
|
|
1635
1636
|
protoOf(TypeScriptIrEmitter).uq = function () {
|
|
1636
|
-
return this.
|
|
1637
|
+
return this.y20_1;
|
|
1637
1638
|
};
|
|
1638
|
-
protoOf(TypeScriptIrEmitter).
|
|
1639
|
+
protoOf(TypeScriptIrEmitter).x1v = function () {
|
|
1639
1640
|
var packageName = Companion_instance.cs('community.flock.wirespec');
|
|
1640
1641
|
var api = 'export type Client<REQ extends Request<unknown>, RES extends Response<unknown>> = (serialization: Serialization) => {\n to: (request: REQ) => RawRequest;\n from: (response: RawResponse) => RES\n}\nexport type Server<REQ extends Request<unknown>, RES extends Response<unknown>> = (serialization: Serialization) => {\n from: (request: RawRequest) => REQ;\n to: (response: RES) => RawResponse\n}\nexport type Api<REQ extends Request<unknown>, RES extends Response<unknown>> = {\n name: string;\n method: Method,\n path: string,\n client: Client<REQ, RES>;\n server: Server<REQ, RES>\n}';
|
|
1641
1642
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -1645,35 +1646,35 @@ protoOf(TypeScriptIrEmitter).v1v = function () {
|
|
|
1645
1646
|
var tmp = scope;
|
|
1646
1647
|
// Inline function 'community.flock.wirespec.ir.core.injectBefore' call
|
|
1647
1648
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1648
|
-
var this_1 = scope.
|
|
1649
|
+
var this_1 = scope.g1v_1;
|
|
1649
1650
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1650
1651
|
// Inline function 'kotlin.apply' call
|
|
1651
1652
|
var this_2 = new TransformerBuilder();
|
|
1652
|
-
this_2.
|
|
1653
|
-
var tmp$ret$2 = this_2.
|
|
1654
|
-
tmp.
|
|
1653
|
+
this_2.x1i(TypeScriptIrEmitter$emitShared$lambda);
|
|
1654
|
+
var tmp$ret$2 = this_2.y1i();
|
|
1655
|
+
tmp.g1v_1 = transform(this_1, tmp$ret$2);
|
|
1655
1656
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1656
1657
|
var tmp_0 = scope;
|
|
1657
1658
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1658
1659
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1659
|
-
var this_3 = scope.
|
|
1660
|
+
var this_3 = scope.g1v_1;
|
|
1660
1661
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1661
1662
|
// Inline function 'kotlin.apply' call
|
|
1662
1663
|
var this_4 = new TransformerBuilder();
|
|
1663
|
-
this_4.
|
|
1664
|
-
var tmp$ret$8 = this_4.
|
|
1665
|
-
tmp_0.
|
|
1664
|
+
this_4.x1i(TypeScriptIrEmitter$emitShared$lambda_0(api));
|
|
1665
|
+
var tmp$ret$8 = this_4.y1i();
|
|
1666
|
+
tmp_0.g1v_1 = transform(this_3, tmp$ret$8);
|
|
1666
1667
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1667
1668
|
var tmp_1 = scope;
|
|
1668
1669
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1669
|
-
var this_5 = scope.
|
|
1670
|
+
var this_5 = scope.g1v_1;
|
|
1670
1671
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1671
1672
|
// Inline function 'kotlin.apply' call
|
|
1672
1673
|
var this_6 = new TransformerBuilder();
|
|
1673
|
-
this_6.
|
|
1674
|
-
var tmp$ret$14 = this_6.
|
|
1675
|
-
tmp_1.
|
|
1676
|
-
var tmp_2 = scope.
|
|
1674
|
+
this_6.x1i(TypeScriptIrEmitter$emitShared$lambda_1);
|
|
1675
|
+
var tmp$ret$14 = this_6.y1i();
|
|
1676
|
+
tmp_1.g1v_1 = transform(this_5, tmp$ret$14);
|
|
1677
|
+
var tmp_2 = scope.g1v_1;
|
|
1677
1678
|
return isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1678
1679
|
};
|
|
1679
1680
|
protoOf(TypeScriptIrEmitter).eo = function (ast, logger) {
|
|
@@ -1732,9 +1733,9 @@ protoOf(TypeScriptIrEmitter).eo = function (ast, logger) {
|
|
|
1732
1733
|
protoOf(TypeScriptIrEmitter).lr = function (definition, module_0, logger) {
|
|
1733
1734
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1734
1735
|
var subPackageName = plus(Companion_instance.cs(''), definition);
|
|
1735
|
-
return new File(Companion_getInstance().n1h(subPackageName.fs() + sanitizeSymbol_1(this, file.
|
|
1736
|
+
return new File(Companion_getInstance().n1h(subPackageName.fs() + sanitizeSymbol_1(this, file.v1n_1.o1h())), plus_1(listOf_0(import_0('../Wirespec', 'Wirespec')), file.w1n_1));
|
|
1736
1737
|
};
|
|
1737
|
-
protoOf(TypeScriptIrEmitter).
|
|
1738
|
+
protoOf(TypeScriptIrEmitter).c1w = function (definition, module_0) {
|
|
1738
1739
|
var tmp;
|
|
1739
1740
|
if (definition instanceof Type) {
|
|
1740
1741
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1743,16 +1744,16 @@ protoOf(TypeScriptIrEmitter).z1v = function (definition, module_0) {
|
|
|
1743
1744
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1744
1745
|
var this_0 = convertToGenerator_1(definition);
|
|
1745
1746
|
var scope = new TransformScope(this_0);
|
|
1746
|
-
scope.
|
|
1747
|
-
var tmp_0 = scope.
|
|
1747
|
+
scope.o1v(TypeScriptIrEmitter$emitGenerator$lambda(definition));
|
|
1748
|
+
var tmp_0 = scope.g1v_1;
|
|
1748
1749
|
tmp = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1749
1750
|
} else {
|
|
1750
1751
|
if (definition instanceof Refined) {
|
|
1751
1752
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1752
1753
|
var this_1 = convertToGenerator_0(definition);
|
|
1753
1754
|
var scope_0 = new TransformScope(this_1);
|
|
1754
|
-
scope_0.
|
|
1755
|
-
var tmp_1 = scope_0.
|
|
1755
|
+
scope_0.o1v(TypeScriptIrEmitter$emitGenerator$lambda_0(definition));
|
|
1756
|
+
var tmp_1 = scope_0.g1v_1;
|
|
1756
1757
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1757
1758
|
} else {
|
|
1758
1759
|
if (definition instanceof Union) {
|
|
@@ -1766,8 +1767,8 @@ protoOf(TypeScriptIrEmitter).z1v = function (definition, module_0) {
|
|
|
1766
1767
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1767
1768
|
var this_2 = sanitizeNames(tmp, _get_sanitizationConfig__sns434(this));
|
|
1768
1769
|
var scope_1 = new TransformScope(this_2);
|
|
1769
|
-
scope_1.
|
|
1770
|
-
var tmp_2 = scope_1.
|
|
1770
|
+
scope_1.o1v(TypeScriptIrEmitter$emitGenerator$lambda_1);
|
|
1771
|
+
var tmp_2 = scope_1.g1v_1;
|
|
1771
1772
|
var generatorFile = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1772
1773
|
var generatorOwnName = definition.mr().l1() + 'Generator';
|
|
1773
1774
|
var tmp_3 = asSequence(collectCustomTypeNames(generatorFile));
|
|
@@ -1778,8 +1779,8 @@ protoOf(TypeScriptIrEmitter).z1v = function (definition, module_0) {
|
|
|
1778
1779
|
var generatorRefs = LinkedHashSet_init_$Create$();
|
|
1779
1780
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1780
1781
|
var scope_2 = new TransformScope(generatorFile);
|
|
1781
|
-
scope_2.
|
|
1782
|
-
var tmp_6 = scope_2.
|
|
1782
|
+
scope_2.o1v(TypeScriptIrEmitter$emitGenerator$lambda_5(generatorOwnName, generatorRefs));
|
|
1783
|
+
var tmp_6 = scope_2.g1v_1;
|
|
1783
1784
|
isInterface(tmp_6, Element) || THROW_CCE();
|
|
1784
1785
|
// Inline function 'kotlin.collections.filter' call
|
|
1785
1786
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -1823,7 +1824,7 @@ protoOf(TypeScriptIrEmitter).z1v = function (definition, module_0) {
|
|
|
1823
1824
|
}
|
|
1824
1825
|
var modelImports = destination_2;
|
|
1825
1826
|
var subPackageName = plus_0(Companion_instance.cs(''), 'generator');
|
|
1826
|
-
return new File(Companion_getInstance().n1h(subPackageName.fs() + sanitizeSymbol_1(this, generatorFile.
|
|
1827
|
+
return new File(Companion_getInstance().n1h(subPackageName.fs() + sanitizeSymbol_1(this, generatorFile.v1n_1.o1h())), plus_1(plus_1(plus_1(listOf_0(import_0('../Wirespec', 'Wirespec')), modelImports), generatorImports), generatorFile.w1n_1));
|
|
1827
1828
|
};
|
|
1828
1829
|
protoOf(TypeScriptIrEmitter).kq = function (type, module_0) {
|
|
1829
1830
|
var fieldValidations = classifyValidatableFields(type, module_0);
|
|
@@ -1895,7 +1896,7 @@ protoOf(TypeScriptIrEmitter).kq = function (type, module_0) {
|
|
|
1895
1896
|
var tmp;
|
|
1896
1897
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1897
1898
|
if (!allImports.r()) {
|
|
1898
|
-
tmp = file.
|
|
1899
|
+
tmp = file.z1n(VOID, plus_1(allImports, file.w1n_1));
|
|
1899
1900
|
} else {
|
|
1900
1901
|
tmp = file;
|
|
1901
1902
|
}
|
|
@@ -1931,7 +1932,7 @@ protoOf(TypeScriptIrEmitter).pr = function (union) {
|
|
|
1931
1932
|
var tmp;
|
|
1932
1933
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1933
1934
|
if (!imports.r()) {
|
|
1934
|
-
tmp = file.
|
|
1935
|
+
tmp = file.z1n(VOID, plus_1(imports, file.w1n_1));
|
|
1935
1936
|
} else {
|
|
1936
1937
|
tmp = file;
|
|
1937
1938
|
}
|
|
@@ -1940,8 +1941,8 @@ protoOf(TypeScriptIrEmitter).pr = function (union) {
|
|
|
1940
1941
|
protoOf(TypeScriptIrEmitter).ur = function (refined) {
|
|
1941
1942
|
var converted = convert_2(refined);
|
|
1942
1943
|
var constraintExpr = convertConstraint(refined.tr_1, new VariableReference(Companion_getInstance().n1h('value')));
|
|
1943
|
-
var validatorStr = TypeScriptGenerator_getInstance().
|
|
1944
|
-
return new File(converted.
|
|
1944
|
+
var validatorStr = TypeScriptGenerator_getInstance().k1w(constraintExpr);
|
|
1945
|
+
return new File(converted.v1n_1, listOf([new RawElement('export type ' + converted.v1n_1.o1h() + ' = ' + emitTypeScriptReference(this, refined.tr_1) + ';'), new RawElement('export const validate' + refined.sr_1.l1() + ' = (value: ' + emitTypeScriptReference(this, refined.tr_1) + ') =>\n ' + validatorStr + ';')]));
|
|
1945
1946
|
};
|
|
1946
1947
|
protoOf(TypeScriptIrEmitter).as = function (endpoint) {
|
|
1947
1948
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
@@ -1971,15 +1972,15 @@ protoOf(TypeScriptIrEmitter).as = function (endpoint) {
|
|
|
1971
1972
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1972
1973
|
var this_1 = stripTrailingSpaceFromErrorMessage(convert_3(endpoint));
|
|
1973
1974
|
var scope = new TransformScope(this_1);
|
|
1974
|
-
scope.
|
|
1975
|
-
var tmp = scope.
|
|
1975
|
+
scope.l1v(transformPatternSwitchToValueSwitch());
|
|
1976
|
+
var tmp = scope.g1v_1;
|
|
1976
1977
|
var tmp$ret$7 = isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1977
1978
|
// Inline function 'kotlin.let' call
|
|
1978
|
-
var it = sanitizeNames(emit$injectApiConst(emit$applyCallParamsIfNeeded(tmp$ret$7, hasRequestParams), endpoint).
|
|
1979
|
+
var it = sanitizeNames(emit$injectApiConst(emit$applyCallParamsIfNeeded(tmp$ret$7, hasRequestParams), endpoint).z1n(Companion_getInstance().n1h(sanitize(this, endpoint.up_1))), _get_sanitizationConfig__sns434(this));
|
|
1979
1980
|
var tmp_0;
|
|
1980
1981
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1981
1982
|
if (!imports.r()) {
|
|
1982
|
-
tmp_0 = it.
|
|
1983
|
+
tmp_0 = it.z1n(VOID, plus_1(imports, it.w1n_1));
|
|
1983
1984
|
} else {
|
|
1984
1985
|
tmp_0 = it;
|
|
1985
1986
|
}
|
|
@@ -1988,7 +1989,7 @@ protoOf(TypeScriptIrEmitter).as = function (endpoint) {
|
|
|
1988
1989
|
protoOf(TypeScriptIrEmitter).or = function (channel) {
|
|
1989
1990
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1990
1991
|
};
|
|
1991
|
-
protoOf(TypeScriptIrEmitter).
|
|
1992
|
+
protoOf(TypeScriptIrEmitter).b1w = function (endpoint) {
|
|
1992
1993
|
var endpointName = endpoint.up_1.l1();
|
|
1993
1994
|
var methodName = firstToLower(this, endpointName);
|
|
1994
1995
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
@@ -2043,7 +2044,7 @@ protoOf(TypeScriptIrEmitter).y1v = function (endpoint) {
|
|
|
2043
2044
|
var tmp$ret$10 = this_1.o5();
|
|
2044
2045
|
return new File(tmp_1, tmp$ret$10);
|
|
2045
2046
|
};
|
|
2046
|
-
protoOf(TypeScriptIrEmitter).
|
|
2047
|
+
protoOf(TypeScriptIrEmitter).y1v = function (endpoints, logger) {
|
|
2047
2048
|
logger.jr('Emitting main Client for ' + endpoints.a1() + ' endpoints');
|
|
2048
2049
|
// Inline function 'kotlin.collections.map' call
|
|
2049
2050
|
// Inline function 'kotlin.collections.mapTo' call
|
|
@@ -2073,8 +2074,8 @@ function transformPatternSwitchToValueSwitch() {
|
|
|
2073
2074
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2074
2075
|
// Inline function 'kotlin.apply' call
|
|
2075
2076
|
var this_0 = new TransformerBuilder();
|
|
2076
|
-
this_0.
|
|
2077
|
-
return this_0.
|
|
2077
|
+
this_0.n1v(transformPatternSwitchToValueSwitch$lambda);
|
|
2078
|
+
return this_0.y1i();
|
|
2078
2079
|
}
|
|
2079
2080
|
function renameValidateAndBindObjReceiver(_this__u8e3s4, typeName, fieldNames) {
|
|
2080
2081
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -2082,14 +2083,14 @@ function renameValidateAndBindObjReceiver(_this__u8e3s4, typeName, fieldNames) {
|
|
|
2082
2083
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
2083
2084
|
var tmp = scope;
|
|
2084
2085
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
2085
|
-
var this_0 = scope.
|
|
2086
|
+
var this_0 = scope.g1v_1;
|
|
2086
2087
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2087
2088
|
// Inline function 'kotlin.apply' call
|
|
2088
2089
|
var this_1 = new TransformerBuilder();
|
|
2089
|
-
this_1.
|
|
2090
|
-
var tmp$ret$2 = this_1.
|
|
2091
|
-
tmp.
|
|
2092
|
-
var tmp_0 = scope.
|
|
2090
|
+
this_1.x1i(renameValidateAndBindObjReceiver$lambda(typeName, fieldNames));
|
|
2091
|
+
var tmp$ret$2 = this_1.y1i();
|
|
2092
|
+
tmp.g1v_1 = transform(this_0, tmp$ret$2);
|
|
2093
|
+
var tmp_0 = scope.g1v_1;
|
|
2093
2094
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2094
2095
|
}
|
|
2095
2096
|
function buildApiConst(endpoint) {
|
|
@@ -2118,21 +2119,21 @@ function bindCallToRequestParams(_this__u8e3s4) {
|
|
|
2118
2119
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
2119
2120
|
var tmp = scope;
|
|
2120
2121
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
2121
|
-
var this_0 = scope.
|
|
2122
|
+
var this_0 = scope.g1v_1;
|
|
2122
2123
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2123
2124
|
// Inline function 'kotlin.apply' call
|
|
2124
2125
|
var this_1 = new TransformerBuilder();
|
|
2125
|
-
this_1.
|
|
2126
|
-
var tmp$ret$2 = this_1.
|
|
2127
|
-
tmp.
|
|
2128
|
-
var tmp_0 = scope.
|
|
2126
|
+
this_1.x1i(bindCallToRequestParams$lambda);
|
|
2127
|
+
var tmp$ret$2 = this_1.y1i();
|
|
2128
|
+
tmp.g1v_1 = transform(this_0, tmp$ret$2);
|
|
2129
|
+
var tmp_0 = scope.g1v_1;
|
|
2129
2130
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2130
2131
|
}
|
|
2131
2132
|
function stripTrailingSpaceFromErrorMessage(_this__u8e3s4) {
|
|
2132
2133
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2133
2134
|
var scope = new TransformScope(_this__u8e3s4);
|
|
2134
|
-
scope.
|
|
2135
|
-
var tmp = scope.
|
|
2135
|
+
scope.n1v(stripTrailingSpaceFromErrorMessage$lambda);
|
|
2136
|
+
var tmp = scope.g1v_1;
|
|
2136
2137
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
2137
2138
|
}
|
|
2138
2139
|
function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
@@ -2140,7 +2141,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2140
2141
|
if (!(stmt instanceof Switch)) {
|
|
2141
2142
|
tmp = true;
|
|
2142
2143
|
} else {
|
|
2143
|
-
var tmp0 = stmt.
|
|
2144
|
+
var tmp0 = stmt.i1q_1;
|
|
2144
2145
|
var tmp$ret$0;
|
|
2145
2146
|
$l$block_0: {
|
|
2146
2147
|
// Inline function 'kotlin.collections.none' call
|
|
@@ -2157,7 +2158,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2157
2158
|
var _iterator__ex2g4s = tmp0.t();
|
|
2158
2159
|
while (_iterator__ex2g4s.u()) {
|
|
2159
2160
|
var element = _iterator__ex2g4s.v();
|
|
2160
|
-
if (!(element.
|
|
2161
|
+
if (!(element.p1q_1 == null)) {
|
|
2161
2162
|
tmp$ret$0 = false;
|
|
2162
2163
|
break $l$block_0;
|
|
2163
2164
|
}
|
|
@@ -2168,11 +2169,11 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2168
2169
|
}
|
|
2169
2170
|
if (tmp)
|
|
2170
2171
|
return transformChildren(stmt, tr);
|
|
2171
|
-
var tmp0_safe_receiver = stmt.
|
|
2172
|
+
var tmp0_safe_receiver = stmt.k1q_1;
|
|
2172
2173
|
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.q1m();
|
|
2173
2174
|
var varName = tmp1_elvis_lhs == null ? 'r' : tmp1_elvis_lhs;
|
|
2174
2175
|
// Inline function 'kotlin.collections.map' call
|
|
2175
|
-
var this_0 = stmt.
|
|
2176
|
+
var this_0 = stmt.i1q_1;
|
|
2176
2177
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2177
2178
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2178
2179
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
@@ -2180,39 +2181,39 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2180
2181
|
var item = _iterator__ex2g4s_0.v();
|
|
2181
2182
|
var tmp$ret$5;
|
|
2182
2183
|
$l$block_1: {
|
|
2183
|
-
var tmp_1 = item.
|
|
2184
|
+
var tmp_1 = item.p1q_1;
|
|
2184
2185
|
var tmp0_safe_receiver_0 = tmp_1 instanceof Custom_0 ? tmp_1 : null;
|
|
2185
2186
|
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.h1j_1;
|
|
2186
|
-
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
2187
|
+
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.o1h();
|
|
2187
2188
|
var tmp3_safe_receiver = typeName == null ? null : substringAfterLast(typeName, '.');
|
|
2188
2189
|
var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : removePrefix(tmp3_safe_receiver, 'Response');
|
|
2189
2190
|
var statusNum = tmp4_safe_receiver == null ? null : toIntOrNull(tmp4_safe_receiver);
|
|
2190
2191
|
if (statusNum == null || typeName == null) {
|
|
2191
2192
|
// Inline function 'kotlin.collections.map' call
|
|
2192
|
-
var this_1 = item.
|
|
2193
|
+
var this_1 = item.o1q_1;
|
|
2193
2194
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2194
2195
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
2195
2196
|
var _iterator__ex2g4s_1 = this_1.t();
|
|
2196
2197
|
while (_iterator__ex2g4s_1.u()) {
|
|
2197
2198
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
2198
|
-
var tmp$ret$2 = tr.
|
|
2199
|
+
var tmp$ret$2 = tr.a1v(item_0);
|
|
2199
2200
|
destination_0.x(tmp$ret$2);
|
|
2200
2201
|
}
|
|
2201
|
-
tmp$ret$5 = item.
|
|
2202
|
+
tmp$ret$5 = item.r1q(VOID, destination_0);
|
|
2202
2203
|
break $l$block_1;
|
|
2203
2204
|
}
|
|
2204
|
-
var exprCode = TypeScriptGenerator_getInstance().
|
|
2205
|
+
var exprCode = TypeScriptGenerator_getInstance().k1w(tr.b1v(stmt.h1q_1));
|
|
2205
2206
|
var castAssignment = new Assignment(Companion_getInstance().n1h(varName), new RawExpression(exprCode + ' as ' + typeName), false);
|
|
2206
2207
|
var tmp_2 = new Literal_0(statusNum, new Integer_0());
|
|
2207
2208
|
var tmp_3 = listOf_0(castAssignment);
|
|
2208
2209
|
// Inline function 'kotlin.collections.map' call
|
|
2209
|
-
var this_2 = item.
|
|
2210
|
+
var this_2 = item.o1q_1;
|
|
2210
2211
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2211
2212
|
var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
|
|
2212
2213
|
var _iterator__ex2g4s_2 = this_2.t();
|
|
2213
2214
|
while (_iterator__ex2g4s_2.u()) {
|
|
2214
2215
|
var item_1 = _iterator__ex2g4s_2.v();
|
|
2215
|
-
var tmp$ret$6 = tr.
|
|
2216
|
+
var tmp$ret$6 = tr.a1v(item_1);
|
|
2216
2217
|
destination_1.x(tmp$ret$6);
|
|
2217
2218
|
}
|
|
2218
2219
|
tmp$ret$5 = new Case(tmp_2, plus_1(tmp_3, destination_1), null);
|
|
@@ -2220,8 +2221,8 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2220
2221
|
destination.x(tmp$ret$5);
|
|
2221
2222
|
}
|
|
2222
2223
|
var transformedCases = destination;
|
|
2223
|
-
var tmp_4 = new FieldCall(tr.
|
|
2224
|
-
var tmp2_safe_receiver = stmt.
|
|
2224
|
+
var tmp_4 = new FieldCall(tr.b1v(stmt.h1q_1), Companion_getInstance().n1h('status'));
|
|
2225
|
+
var tmp2_safe_receiver = stmt.j1q_1;
|
|
2225
2226
|
var tmp_5;
|
|
2226
2227
|
if (tmp2_safe_receiver == null) {
|
|
2227
2228
|
tmp_5 = null;
|
|
@@ -2232,7 +2233,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2232
2233
|
var _iterator__ex2g4s_3 = tmp2_safe_receiver.t();
|
|
2233
2234
|
while (_iterator__ex2g4s_3.u()) {
|
|
2234
2235
|
var item_2 = _iterator__ex2g4s_3.v();
|
|
2235
|
-
var tmp$ret$11 = tr.
|
|
2236
|
+
var tmp$ret$11 = tr.a1v(item_2);
|
|
2236
2237
|
destination_2.x(tmp$ret$11);
|
|
2237
2238
|
}
|
|
2238
2239
|
tmp_5 = destination_2;
|
|
@@ -2246,43 +2247,43 @@ function renameValidateAndBindObjReceiver$lambda$lambda($fieldNames) {
|
|
|
2246
2247
|
var tmp_1;
|
|
2247
2248
|
var tmp_2;
|
|
2248
2249
|
if (s instanceof FunctionCall) {
|
|
2249
|
-
tmp_2 = s.
|
|
2250
|
+
tmp_2 = s.a1n_1.equals(Companion_getInstance().n1h('validate'));
|
|
2250
2251
|
} else {
|
|
2251
2252
|
tmp_2 = false;
|
|
2252
2253
|
}
|
|
2253
2254
|
if (tmp_2) {
|
|
2254
|
-
tmp_1 = !(s.
|
|
2255
|
+
tmp_1 = !(s.y1m_1 == null);
|
|
2255
2256
|
} else {
|
|
2256
2257
|
tmp_1 = false;
|
|
2257
2258
|
}
|
|
2258
2259
|
if (tmp_1) {
|
|
2259
2260
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
2260
|
-
tmp_0 = !s.
|
|
2261
|
+
tmp_0 = !s.z1m_1.r();
|
|
2261
2262
|
} else {
|
|
2262
2263
|
tmp_0 = false;
|
|
2263
2264
|
}
|
|
2264
2265
|
if (tmp_0) {
|
|
2265
|
-
var tmp_3 = first(s.
|
|
2266
|
+
var tmp_3 = first(s.z1m_1);
|
|
2266
2267
|
var tmp0_safe_receiver = tmp_3 instanceof Custom_0 ? tmp_3 : null;
|
|
2267
2268
|
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.h1j_1;
|
|
2268
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
2269
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.o1h();
|
|
2269
2270
|
var tn = tmp2_elvis_lhs == null ? '' : tmp2_elvis_lhs;
|
|
2270
|
-
tmp = new FunctionCall(VOID, VOID, Companion_getInstance().n1h('validate' + tn), mapOf(to(Companion_getInstance().n1h('obj'), t.
|
|
2271
|
+
tmp = new FunctionCall(VOID, VOID, Companion_getInstance().n1h('validate' + tn), mapOf(to(Companion_getInstance().n1h('obj'), t.b1v(ensureNotNull(s.y1m_1)))));
|
|
2271
2272
|
} else {
|
|
2272
2273
|
var tmp_4;
|
|
2273
2274
|
var tmp_5;
|
|
2274
2275
|
if (s instanceof FieldCall) {
|
|
2275
|
-
tmp_5 = s.
|
|
2276
|
+
tmp_5 = s.s1q_1 == null;
|
|
2276
2277
|
} else {
|
|
2277
2278
|
tmp_5 = false;
|
|
2278
2279
|
}
|
|
2279
2280
|
if (tmp_5) {
|
|
2280
|
-
tmp_4 = $fieldNames.u1(s.
|
|
2281
|
+
tmp_4 = $fieldNames.u1(s.t1q_1.q1m());
|
|
2281
2282
|
} else {
|
|
2282
2283
|
tmp_4 = false;
|
|
2283
2284
|
}
|
|
2284
2285
|
if (tmp_4) {
|
|
2285
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().n1h('obj')), s.
|
|
2286
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().n1h('obj')), s.t1q_1);
|
|
2286
2287
|
} else {
|
|
2287
2288
|
tmp = transformChildren(s, t);
|
|
2288
2289
|
}
|
|
@@ -2303,8 +2304,8 @@ function renameValidateAndBindObjReceiver$lambda($typeName, $fieldNames) {
|
|
|
2303
2304
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2304
2305
|
var this_0 = element.l1l(Companion_getInstance().n1h('validate' + $typeName), VOID, listOf_0(new Parameter(Companion_getInstance().n1h('obj'), Custom_init_$Create$($typeName))));
|
|
2305
2306
|
var scope = new TransformScope(this_0);
|
|
2306
|
-
scope.
|
|
2307
|
-
var tmp_0 = scope.
|
|
2307
|
+
scope.p1v(renameValidateAndBindObjReceiver$lambda$lambda($fieldNames));
|
|
2308
|
+
var tmp_0 = scope.g1v_1;
|
|
2308
2309
|
tmp$ret$0 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2309
2310
|
}
|
|
2310
2311
|
tmp = tmp$ret$0;
|
|
@@ -2333,12 +2334,12 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
2333
2334
|
if (element instanceof Interface) {
|
|
2334
2335
|
var tmp$ret$0;
|
|
2335
2336
|
$l$block: {
|
|
2336
|
-
if (!element.
|
|
2337
|
+
if (!element.p1o_1.equals(Companion_getInstance().n1h('Call'))) {
|
|
2337
2338
|
tmp$ret$0 = element;
|
|
2338
2339
|
break $l$block;
|
|
2339
2340
|
}
|
|
2340
2341
|
// Inline function 'kotlin.collections.map' call
|
|
2341
|
-
var this_0 = element.
|
|
2342
|
+
var this_0 = element.q1o_1;
|
|
2342
2343
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2343
2344
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2344
2345
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -2349,7 +2350,7 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
2349
2350
|
var tmp$ret$1 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
2350
2351
|
destination.x(tmp$ret$1);
|
|
2351
2352
|
}
|
|
2352
|
-
tmp$ret$0 = element.
|
|
2353
|
+
tmp$ret$0 = element.w1o(VOID, destination);
|
|
2353
2354
|
}
|
|
2354
2355
|
tmp = tmp$ret$0;
|
|
2355
2356
|
} else {
|
|
@@ -2361,7 +2362,7 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
2361
2362
|
function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
2362
2363
|
var tmp;
|
|
2363
2364
|
if (stmt instanceof Switch) {
|
|
2364
|
-
var tmp1_safe_receiver = stmt.
|
|
2365
|
+
var tmp1_safe_receiver = stmt.j1q_1;
|
|
2365
2366
|
var tmp_0;
|
|
2366
2367
|
if (tmp1_safe_receiver == null) {
|
|
2367
2368
|
tmp_0 = null;
|
|
@@ -2383,7 +2384,7 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2383
2384
|
tmp_1 = tmp0_elvis_lhs;
|
|
2384
2385
|
}
|
|
2385
2386
|
var errorStmt = tmp_1;
|
|
2386
|
-
var tmp_2 = errorStmt.
|
|
2387
|
+
var tmp_2 = errorStmt.w1q_1;
|
|
2387
2388
|
var tmp1_elvis_lhs = tmp_2 instanceof BinaryOp ? tmp_2 : null;
|
|
2388
2389
|
var tmp_3;
|
|
2389
2390
|
if (tmp1_elvis_lhs == null) {
|
|
@@ -2393,7 +2394,7 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2393
2394
|
tmp_3 = tmp1_elvis_lhs;
|
|
2394
2395
|
}
|
|
2395
2396
|
var binary = tmp_3;
|
|
2396
|
-
var tmp_4 = binary.
|
|
2397
|
+
var tmp_4 = binary.x1q_1;
|
|
2397
2398
|
var tmp2_elvis_lhs = tmp_4 instanceof Literal_0 ? tmp_4 : null;
|
|
2398
2399
|
var tmp_5;
|
|
2399
2400
|
if (tmp2_elvis_lhs == null) {
|
|
@@ -2403,13 +2404,13 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2403
2404
|
tmp_5 = tmp2_elvis_lhs;
|
|
2404
2405
|
}
|
|
2405
2406
|
var literal = tmp_5;
|
|
2406
|
-
tmp$ret$0 = new ErrorStatement(new Literal_0(trimEnd(toString(literal.
|
|
2407
|
+
tmp$ret$0 = new ErrorStatement(new Literal_0(trimEnd(toString(literal.u1p_1), charArrayOf([_Char___init__impl__6a9atx(32)])), literal.v1p_1));
|
|
2407
2408
|
}
|
|
2408
2409
|
destination.x(tmp$ret$0);
|
|
2409
2410
|
}
|
|
2410
2411
|
tmp_0 = destination;
|
|
2411
2412
|
}
|
|
2412
|
-
tmp = transformChildren(stmt.
|
|
2413
|
+
tmp = transformChildren(stmt.m1q(VOID, VOID, tmp_0), transformer);
|
|
2413
2414
|
} else {
|
|
2414
2415
|
tmp = transformChildren(stmt, transformer);
|
|
2415
2416
|
}
|
|
@@ -2419,8 +2420,8 @@ function TypeScriptRefinedTypeDefinitionEmitter() {
|
|
|
2419
2420
|
}
|
|
2420
2421
|
function TypeScriptShared() {
|
|
2421
2422
|
TypeScriptShared_instance = this;
|
|
2422
|
-
this.
|
|
2423
|
-
this.
|
|
2423
|
+
this.v20_1 = 'community.flock.wirespec';
|
|
2424
|
+
this.w20_1 = trimMargin('\n |export namespace Wirespec {\n |' + Spacer_instance.toString() + 'export type Method = "GET" | "PUT" | "POST" | "DELETE" | "OPTIONS" | "HEAD" | "PATCH" | "TRACE"\n |' + Spacer_instance.toString() + 'export type RawRequest = { method: Method, path: string[], queries: Record<string, string>, headers: Record<string, string>, body?: string }\n |' + Spacer_instance.toString() + 'export type RawResponse = { status: number, headers: Record<string, string>, body?: string }\n |' + Spacer_instance.toString() + 'export type Request<T> = { path: Record<string, unknown>, method: Method, queries?: Record<string, unknown>, headers?: Record<string, unknown>, body?:T }\n |' + Spacer_instance.toString() + 'export type Response<T> = { status:number, headers?: Record<string, unknown>, body?:T }\n |' + Spacer_instance.toString() + 'export type Serialization = { serialize: <T>(type: T) => string; deserialize: <T>(raw: string | undefined) => T }\n |' + Spacer_instance.toString() + 'export type Client<REQ extends Request<unknown>, RES extends Response<unknown>> = (serialization: Serialization) => { to: (request: REQ) => RawRequest; from: (response: RawResponse) => RES }\n |' + Spacer_instance.toString() + 'export type Server<REQ extends Request<unknown>, RES extends Response<unknown>> = (serialization: Serialization) => { from: (request: RawRequest) => REQ; to: (response: RES) => RawResponse }\n |' + Spacer_instance.toString() + 'export type Api<REQ extends Request<unknown>, RES extends Response<unknown>> = { name: string; method: Method, path: string, client: Client<REQ, RES>; server: Server<REQ, RES> }\n |}\n ');
|
|
2424
2425
|
}
|
|
2425
2426
|
protoOf(TypeScriptShared).toString = function () {
|
|
2426
2427
|
return 'TypeScriptShared';
|
|
@@ -2461,18 +2462,19 @@ protoOf(TypeScriptEmitter).lq = emit_6;
|
|
|
2461
2462
|
protoOf(TypeScriptEmitter).mq = emit_7;
|
|
2462
2463
|
protoOf(TypeScriptEmitter).nq = emit_4;
|
|
2463
2464
|
protoOf(TypeScriptEmitter).oq = emit_5;
|
|
2464
|
-
protoOf(TypeScriptEmitter).zr =
|
|
2465
|
-
protoOf(TypeScriptEmitter).ur =
|
|
2466
|
-
protoOf(TypeScriptEmitter).as =
|
|
2465
|
+
protoOf(TypeScriptEmitter).zr = emit_10;
|
|
2466
|
+
protoOf(TypeScriptEmitter).ur = emit_8;
|
|
2467
|
+
protoOf(TypeScriptEmitter).as = emit_9;
|
|
2467
2468
|
protoOf(TypeScriptEmitter).nr = emit_2;
|
|
2468
2469
|
protoOf(TypeScriptEmitter).bs = emitValidator;
|
|
2469
|
-
protoOf(TypeScriptEmitter).
|
|
2470
|
-
protoOf(TypeScriptEmitter).
|
|
2471
|
-
protoOf(TypeScriptEmitter).
|
|
2472
|
-
protoOf(TypeScriptEmitter).
|
|
2470
|
+
protoOf(TypeScriptEmitter).q20 = sanitizeSymbol;
|
|
2471
|
+
protoOf(TypeScriptEmitter).g1x = sanitizeSymbol_0;
|
|
2472
|
+
protoOf(TypeScriptEmitter).r20 = emitPrimitive;
|
|
2473
|
+
protoOf(TypeScriptEmitter).p20 = emitClient;
|
|
2473
2474
|
protoOf(TypeScriptEmitter).qq = emitClientEndpointRequest;
|
|
2474
|
-
protoOf(TypeScriptIrEmitter).
|
|
2475
|
-
protoOf(TypeScriptIrEmitter).
|
|
2475
|
+
protoOf(TypeScriptIrEmitter).v1v = get_extensions;
|
|
2476
|
+
protoOf(TypeScriptIrEmitter).w1v = emit_1;
|
|
2477
|
+
protoOf(TypeScriptIrEmitter).a1w = beforeGenerate;
|
|
2476
2478
|
//endregion
|
|
2477
2479
|
//region block: exports
|
|
2478
2480
|
export {
|