@flock/wirespec 0.18.0-RC.1 → 0.18.1-RC.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.mjs +12 -12
- package/arrow-arrow-core.mjs +152 -158
- package/arrow-arrow-core.mjs.map +1 -1
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt.mjs +1442 -1442
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +439 -439
- package/kotlin-kotlin-stdlib.mjs +1072 -1136
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +4857 -4857
- package/kotlin-rgxgen.mjs +1793 -1793
- package/kotlinx-io-kotlinx-io-core.mjs +415 -415
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1752 -1752
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1348 -1356
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1303 -1311
- package/mordant-mordant.mjs.map +1 -1
- package/package.json +1 -1
- package/wirespec-fetch.mjs +13 -19
- package/wirespec-src-compiler-core.mjs +1526 -1526
- package/wirespec-src-compiler-emitters-java.mjs +477 -451
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +458 -453
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +419 -418
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +939 -725
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +225 -233
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +524 -555
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +81 -81
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3738 -3708
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +418 -418
- package/wirespec-src-converter-avro.mjs +506 -506
- package/wirespec-src-converter-openapi.mjs +684 -684
- package/wirespec-src-plugin-arguments.mjs +181 -181
- package/wirespec-src-plugin-cli.mjs +106 -106
- package/wirespec-src-plugin-npm.mjs +36 -36
- package/wirespec-src-tools-generator.mjs +34 -34
|
@@ -92,9 +92,8 @@ import {
|
|
|
92
92
|
toIntOrNull3w2d066r9pvwm as toIntOrNull,
|
|
93
93
|
lazy2hsh8ze7j6ikd as lazy,
|
|
94
94
|
distinct10qe1scfdvu5k as distinct,
|
|
95
|
-
listOf1jh22dvmctj1r as listOf_0,
|
|
96
95
|
toSet2orjxp16sotqu as toSet,
|
|
97
|
-
|
|
96
|
+
listOf1jh22dvmctj1r as listOf_0,
|
|
98
97
|
equals2au1ep9vhcato as equals,
|
|
99
98
|
initMetadataForObject1cxne3s9w65el as initMetadataForObject,
|
|
100
99
|
Char19o2r8palgjof as Char,
|
|
@@ -121,11 +120,11 @@ import {
|
|
|
121
120
|
TransformerBuildera6a1gvlhjj9b as TransformerBuilder,
|
|
122
121
|
Nameoqr8dt2fim9d as Name,
|
|
123
122
|
transformChildren2mszeagj5nq4c as transformChildren_0,
|
|
124
|
-
|
|
123
|
+
sanitizeFieldName1ptgy1kxy8u2m as sanitizeFieldName,
|
|
125
124
|
Assignment3kcxc8wlcbmkn as Assignment,
|
|
126
125
|
ConstructorStatement1x4n4sr59iy4n as ConstructorStatement,
|
|
127
126
|
VariableReference2vlynnhaw1i64 as VariableReference,
|
|
128
|
-
|
|
127
|
+
SanitizationConfig11mmn3p2c03c1 as SanitizationConfig,
|
|
129
128
|
convert13xvfhgrf57n5 as convert,
|
|
130
129
|
TransformScopeyrd3lf4zrk76 as TransformScope,
|
|
131
130
|
transform3eti8i2bqvifx as transform,
|
|
@@ -149,9 +148,10 @@ import {
|
|
|
149
148
|
emit3bzdcd0f6nwtj as emit_0,
|
|
150
149
|
File3dimy4iqmuock as File,
|
|
151
150
|
emitn3eihixilqyh as emit_1,
|
|
151
|
+
import5uhkz67bd8tt as import_0,
|
|
152
152
|
classifyValidatableFields11bv88x0ho39r as classifyValidatableFields,
|
|
153
153
|
convertWithValidation3ar3nbcqsbkpn as convertWithValidation,
|
|
154
|
-
|
|
154
|
+
sanitizeNames2wqmyf8vafp9x as sanitizeNames,
|
|
155
155
|
convert11ert2po54h1y as convert_0,
|
|
156
156
|
convert37aabdzvtv9vg as convert_1,
|
|
157
157
|
convert17zcptkz4mhr4 as convert_2,
|
|
@@ -166,11 +166,11 @@ var imul = Math.imul;
|
|
|
166
166
|
//endregion
|
|
167
167
|
//region block: pre-declaration
|
|
168
168
|
function emit_2(identifier) {
|
|
169
|
-
return '"' + identifier.
|
|
169
|
+
return '"' + identifier.l1() + '"';
|
|
170
170
|
}
|
|
171
171
|
initMetadataForInterface(TypeScriptIdentifierEmitter, 'TypeScriptIdentifierEmitter');
|
|
172
172
|
function sanitizeSymbol(_this__u8e3s4) {
|
|
173
|
-
return this.
|
|
173
|
+
return this.w1v(_this__u8e3s4.l1());
|
|
174
174
|
}
|
|
175
175
|
function sanitizeSymbol_0(_this__u8e3s4) {
|
|
176
176
|
var tmp = asSequence(_this__u8e3s4);
|
|
@@ -184,7 +184,7 @@ function emit_3(type, module_0) {
|
|
|
184
184
|
var _iterator__ex2g4s = this_0.t();
|
|
185
185
|
while (_iterator__ex2g4s.u()) {
|
|
186
186
|
var e = _iterator__ex2g4s.v();
|
|
187
|
-
var key = e.
|
|
187
|
+
var key = e.lu_1;
|
|
188
188
|
if (set.x(key)) {
|
|
189
189
|
list.x(e);
|
|
190
190
|
}
|
|
@@ -195,19 +195,19 @@ function emit_3(type, module_0) {
|
|
|
195
195
|
var _iterator__ex2g4s_0 = list.t();
|
|
196
196
|
while (_iterator__ex2g4s_0.u()) {
|
|
197
197
|
var item = _iterator__ex2g4s_0.v();
|
|
198
|
-
var tmp$ret$2 = 'import {' + item.
|
|
198
|
+
var tmp$ret$2 = 'import {' + item.lu_1 + "} from './" + item.lu_1 + "'";
|
|
199
199
|
destination.x(tmp$ret$2);
|
|
200
200
|
}
|
|
201
201
|
var tmp = destination;
|
|
202
|
-
return trimMargin('\n |' + joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda) + '\n |export type ' + this.
|
|
202
|
+
return trimMargin('\n |' + joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda) + '\n |export type ' + this.n20(type.vo_1) + ' = {\n |' + this.vp(type.wo_1) + '\n |}\n |\n ');
|
|
203
203
|
}
|
|
204
204
|
function emit_4(_this__u8e3s4) {
|
|
205
205
|
var tmp;
|
|
206
206
|
if (_this__u8e3s4 instanceof Dict) {
|
|
207
|
-
tmp = 'Record<string, ' + this.
|
|
207
|
+
tmp = 'Record<string, ' + this.xp(_this__u8e3s4.co_1) + '>';
|
|
208
208
|
} else {
|
|
209
209
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
210
|
-
tmp = this.
|
|
210
|
+
tmp = this.xp(_this__u8e3s4.zn_1) + '[]';
|
|
211
211
|
} else {
|
|
212
212
|
if (_this__u8e3s4 instanceof Unit) {
|
|
213
213
|
tmp = 'void';
|
|
@@ -216,10 +216,10 @@ function emit_4(_this__u8e3s4) {
|
|
|
216
216
|
tmp = 'any';
|
|
217
217
|
} else {
|
|
218
218
|
if (_this__u8e3s4 instanceof Custom) {
|
|
219
|
-
tmp = this.
|
|
219
|
+
tmp = this.w1v(_this__u8e3s4.lu_1);
|
|
220
220
|
} else {
|
|
221
221
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
222
|
-
tmp = this.
|
|
222
|
+
tmp = this.o20(_this__u8e3s4);
|
|
223
223
|
} else {
|
|
224
224
|
noWhenBranchMatchedException();
|
|
225
225
|
}
|
|
@@ -229,10 +229,10 @@ function emit_4(_this__u8e3s4) {
|
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
// Inline function 'kotlin.let' call
|
|
232
|
-
return tmp + (_this__u8e3s4.
|
|
232
|
+
return tmp + (_this__u8e3s4.du() ? ' | undefined' : '');
|
|
233
233
|
}
|
|
234
234
|
function emitPrimitive(_this__u8e3s4) {
|
|
235
|
-
var tmp0_subject = _this__u8e3s4.
|
|
235
|
+
var tmp0_subject = _this__u8e3s4.pu_1;
|
|
236
236
|
var tmp;
|
|
237
237
|
if (tmp0_subject instanceof String_0) {
|
|
238
238
|
tmp = 'string';
|
|
@@ -260,10 +260,10 @@ function emitPrimitive(_this__u8e3s4) {
|
|
|
260
260
|
function emit_5(_this__u8e3s4) {
|
|
261
261
|
var tmp;
|
|
262
262
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
263
|
-
tmp = Spacer_instance.toString() + 'return ' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.
|
|
263
|
+
tmp = Spacer_instance.toString() + 'return ' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.ys_1) + '.test(value);';
|
|
264
264
|
} else {
|
|
265
265
|
if (_this__u8e3s4 instanceof Bound) {
|
|
266
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
266
|
+
var tmp1_safe_receiver = _this__u8e3s4.pt_1;
|
|
267
267
|
var tmp_0;
|
|
268
268
|
if (tmp1_safe_receiver == null) {
|
|
269
269
|
tmp_0 = null;
|
|
@@ -272,7 +272,7 @@ function emit_5(_this__u8e3s4) {
|
|
|
272
272
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
273
273
|
}
|
|
274
274
|
var minCheck = tmp_0;
|
|
275
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
275
|
+
var tmp2_safe_receiver = _this__u8e3s4.qt_1;
|
|
276
276
|
var tmp_1;
|
|
277
277
|
if (tmp2_safe_receiver == null) {
|
|
278
278
|
tmp_1 = null;
|
|
@@ -300,18 +300,18 @@ function emit_5(_this__u8e3s4) {
|
|
|
300
300
|
return tmp;
|
|
301
301
|
}
|
|
302
302
|
function emit_6(_this__u8e3s4) {
|
|
303
|
-
return joinToString(_this__u8e3s4.
|
|
303
|
+
return joinToString(_this__u8e3s4.so_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda_0(this));
|
|
304
304
|
}
|
|
305
305
|
function emit_7(_this__u8e3s4) {
|
|
306
|
-
return Spacer_instance.toString() + this.
|
|
306
|
+
return Spacer_instance.toString() + this.wq(_this__u8e3s4.ap_1) + ': ' + this.xp(_this__u8e3s4.bp_1);
|
|
307
307
|
}
|
|
308
308
|
initMetadataForInterface(TypeScriptTypeDefinitionEmitter, 'TypeScriptTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, TypeScriptIdentifierEmitter]);
|
|
309
309
|
function emitClient(ast) {
|
|
310
|
-
var tmp = 'client.' + this.
|
|
311
|
-
var tmp_0 = this.
|
|
310
|
+
var tmp = 'client.' + this.eq().nq_1;
|
|
311
|
+
var tmp_0 = this.aq(ast);
|
|
312
312
|
var tmp_1 = joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, TypeScriptClientEmitter$emitClient$lambda);
|
|
313
313
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
314
|
-
var this_0 = ast.
|
|
314
|
+
var this_0 = ast.bq_1;
|
|
315
315
|
// Inline function 'kotlin.collections.flatMap' call
|
|
316
316
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
317
317
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -319,7 +319,7 @@ function emitClient(ast) {
|
|
|
319
319
|
var _iterator__ex2g4s = tmp0.t();
|
|
320
320
|
while (_iterator__ex2g4s.u()) {
|
|
321
321
|
var element = _iterator__ex2g4s.v();
|
|
322
|
-
var list = new NonEmptyList(element.
|
|
322
|
+
var list = new NonEmptyList(element.dq_1);
|
|
323
323
|
addAll(destination, list);
|
|
324
324
|
}
|
|
325
325
|
var tmp$ret$3 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -339,18 +339,23 @@ function emitClient(ast) {
|
|
|
339
339
|
var _iterator__ex2g4s_1 = destination_0.t();
|
|
340
340
|
while (_iterator__ex2g4s_1.u()) {
|
|
341
341
|
var e = _iterator__ex2g4s_1.v();
|
|
342
|
-
var key = e.
|
|
342
|
+
var key = e.lu_1;
|
|
343
343
|
if (set.x(key)) {
|
|
344
344
|
list_1.x(e);
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
var tmp_2 = list_1;
|
|
348
348
|
var tmp_3 = joinToString(tmp_2, '\n', VOID, VOID, VOID, VOID, TypeScriptClientEmitter$emitClient$lambda_0);
|
|
349
|
-
var tmp_4 = this.
|
|
349
|
+
var tmp_4 = this.aq(ast);
|
|
350
350
|
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 '));
|
|
351
351
|
}
|
|
352
352
|
initMetadataForInterface(TypeScriptClientEmitter, 'TypeScriptClientEmitter', VOID, VOID, [ClientEmitter, TypeScriptTypeDefinitionEmitter]);
|
|
353
|
-
function emit_8(
|
|
353
|
+
function emit_8(enum_0, module_0) {
|
|
354
|
+
var tmp = this.n20(enum_0.gr_1);
|
|
355
|
+
return 'export type ' + tmp + ' = ' + joinToString(enum_0.hr_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEnumDefinitionEmitter$emit$lambda) + '\n';
|
|
356
|
+
}
|
|
357
|
+
initMetadataForInterface(TypeScriptEnumDefinitionEmitter, 'TypeScriptEnumDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
358
|
+
function emit_9(endpoint) {
|
|
354
359
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
355
360
|
var this_0 = importReferences(endpoint);
|
|
356
361
|
var set = HashSet_init_$Create$();
|
|
@@ -358,7 +363,7 @@ function emit_8(endpoint) {
|
|
|
358
363
|
var _iterator__ex2g4s = this_0.t();
|
|
359
364
|
while (_iterator__ex2g4s.u()) {
|
|
360
365
|
var e = _iterator__ex2g4s.v();
|
|
361
|
-
var key = e.
|
|
366
|
+
var key = e.lu_1;
|
|
362
367
|
if (set.x(key)) {
|
|
363
368
|
list.x(e);
|
|
364
369
|
}
|
|
@@ -369,69 +374,64 @@ function emit_8(endpoint) {
|
|
|
369
374
|
var _iterator__ex2g4s_0 = list.t();
|
|
370
375
|
while (_iterator__ex2g4s_0.u()) {
|
|
371
376
|
var item = _iterator__ex2g4s_0.v();
|
|
372
|
-
var tmp$ret$2 = 'import {type ' + item.
|
|
377
|
+
var tmp$ret$2 = 'import {type ' + item.lu_1 + "} from '../model'";
|
|
373
378
|
destination.x(tmp$ret$2);
|
|
374
379
|
}
|
|
375
380
|
var tmp = destination;
|
|
376
381
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda);
|
|
377
|
-
var tmp_1 = this.
|
|
382
|
+
var tmp_1 = this.n20(endpoint.ep_1);
|
|
378
383
|
var tmp_2 = get_pathParams(endpoint);
|
|
379
384
|
var tmp_3 = emitType(this, tmp_2, 'Path', TypeScriptEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
380
|
-
var tmp_4 = emitType(this, endpoint.
|
|
381
|
-
var tmp_5 = emitType(this, endpoint.
|
|
382
|
-
var tmp_6 = emitType_1(this, first(endpoint.
|
|
383
|
-
var tmp_7 = distinctByStatus(endpoint.
|
|
385
|
+
var tmp_4 = emitType(this, endpoint.hp_1, 'Queries', TypeScriptEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
386
|
+
var tmp_5 = emitType(this, endpoint.ip_1, 'Headers', TypeScriptEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
387
|
+
var tmp_6 = emitType_1(this, first(endpoint.jp_1), endpoint);
|
|
388
|
+
var tmp_7 = distinctByStatus(endpoint.kp_1);
|
|
384
389
|
var tmp_8 = joinToString(tmp_7, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
385
390
|
var tmp_9 = Spacer_instance.toString();
|
|
386
|
-
var tmp_10 = distinctByStatus(endpoint.
|
|
391
|
+
var tmp_10 = distinctByStatus(endpoint.kp_1);
|
|
387
392
|
var tmp_11 = joinToString(tmp_10, ' | ', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_4(this));
|
|
388
|
-
var tmp_12 = emitFunction_0(this, first(endpoint.
|
|
389
|
-
var tmp_13 = distinctByStatus(endpoint.
|
|
393
|
+
var tmp_12 = emitFunction_0(this, first(endpoint.jp_1), endpoint);
|
|
394
|
+
var tmp_13 = distinctByStatus(endpoint.kp_1);
|
|
390
395
|
var tmp_14 = joinToString(tmp_13, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
391
396
|
var tmp_15 = Spacer_instance.toString();
|
|
392
|
-
var tmp_16 = Spacer_instance.
|
|
397
|
+
var tmp_16 = Spacer_instance.qr(2);
|
|
393
398
|
var tmp_17 = emitHandleFunction(this, endpoint);
|
|
394
399
|
var tmp_18 = Spacer_instance.toString();
|
|
395
|
-
var tmp_19 = prependIndent(emitClient_0(this, endpoint), Spacer_instance.
|
|
396
|
-
var tmp_20 = prependIndent(emitServer(this, endpoint), Spacer_instance.
|
|
400
|
+
var tmp_19 = prependIndent(emitClient_0(this, endpoint), Spacer_instance.qr(1));
|
|
401
|
+
var tmp_20 = prependIndent(emitServer(this, endpoint), Spacer_instance.qr(1));
|
|
397
402
|
var tmp_21 = Spacer_instance.toString();
|
|
398
|
-
var tmp_22 = Spacer_instance.
|
|
399
|
-
var tmp_23 = Companion_instance_0.
|
|
400
|
-
var tmp_24 = Spacer_instance.
|
|
401
|
-
var tmp_25 = Spacer_instance.
|
|
402
|
-
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.
|
|
403
|
+
var tmp_22 = Spacer_instance.qr(2);
|
|
404
|
+
var tmp_23 = Companion_instance_0.pq(this.n20(endpoint.ep_1));
|
|
405
|
+
var tmp_24 = Spacer_instance.qr(2);
|
|
406
|
+
var tmp_25 = Spacer_instance.qr(2);
|
|
407
|
+
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.fp_1.a3_1 + '",\n |' + tmp_25 + 'path: "' + joinToString(endpoint.gp_1, '/', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_6(this)) + '",\n |' + Spacer_instance.qr(2) + 'server,\n |' + Spacer_instance.qr(2) + 'client\n |' + Spacer_instance.toString() + '} as const\n |}\n |\n ');
|
|
403
408
|
}
|
|
404
409
|
initMetadataForInterface(TypeScriptEndpointDefinitionEmitter, 'TypeScriptEndpointDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
405
|
-
function emit_9(enum_0, module_0) {
|
|
406
|
-
var tmp = this.h20(enum_0.ir_1);
|
|
407
|
-
return 'export type ' + tmp + ' = ' + joinToString(enum_0.jr_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEnumDefinitionEmitter$emit$lambda) + '\n';
|
|
408
|
-
}
|
|
409
|
-
initMetadataForInterface(TypeScriptEnumDefinitionEmitter, 'TypeScriptEnumDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
410
410
|
function emit_10(refined) {
|
|
411
|
-
return trimMargin('\n |export type ' + this.
|
|
411
|
+
return trimMargin('\n |export type ' + this.n20(refined.br_1) + ' = ' + this.xp(refined.cr_1) + ';\n |export const validate' + refined.br_1.l1() + ' = (value: ' + this.xp(refined.cr_1) + '): value is ' + this.n20(refined.br_1) + ' => {\n |' + this.kr(refined) + '\n |}\n |\n ');
|
|
412
412
|
}
|
|
413
413
|
function emitValidator(_this__u8e3s4) {
|
|
414
414
|
var defaultReturn = Spacer_instance.toString() + 'return true;';
|
|
415
|
-
var type = _this__u8e3s4.
|
|
415
|
+
var type = _this__u8e3s4.cr_1.pu_1;
|
|
416
416
|
var tmp;
|
|
417
417
|
if (type instanceof Integer) {
|
|
418
|
-
var tmp0_safe_receiver = type.
|
|
419
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
418
|
+
var tmp0_safe_receiver = type.ut_1;
|
|
419
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.yp(tmp0_safe_receiver);
|
|
420
420
|
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
421
421
|
} else {
|
|
422
422
|
if (type instanceof Number_0) {
|
|
423
|
-
var tmp2_safe_receiver = type.
|
|
424
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.
|
|
423
|
+
var tmp2_safe_receiver = type.xt_1;
|
|
424
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.yp(tmp2_safe_receiver);
|
|
425
425
|
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
426
426
|
} else {
|
|
427
427
|
if (type instanceof String_0) {
|
|
428
|
-
var tmp4_safe_receiver = type.
|
|
428
|
+
var tmp4_safe_receiver = type.rt_1;
|
|
429
429
|
var tmp_0;
|
|
430
430
|
var tmp_1 = tmp4_safe_receiver;
|
|
431
431
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
432
432
|
tmp_0 = null;
|
|
433
433
|
} else {
|
|
434
|
-
tmp_0 = this.
|
|
434
|
+
tmp_0 = this.yp(new RegExp_0(tmp4_safe_receiver));
|
|
435
435
|
}
|
|
436
436
|
var tmp5_elvis_lhs = tmp_0;
|
|
437
437
|
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
@@ -451,7 +451,7 @@ function emitValidator(_this__u8e3s4) {
|
|
|
451
451
|
return tmp;
|
|
452
452
|
}
|
|
453
453
|
initMetadataForInterface(TypeScriptRefinedTypeDefinitionEmitter, 'TypeScriptRefinedTypeDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
454
|
-
initMetadataForClass(TypeScriptEmitter, 'TypeScriptEmitter', TypeScriptEmitter, LanguageEmitter, [LanguageEmitter,
|
|
454
|
+
initMetadataForClass(TypeScriptEmitter, 'TypeScriptEmitter', TypeScriptEmitter, LanguageEmitter, [LanguageEmitter, TypeScriptEnumDefinitionEmitter, TypeScriptIdentifierEmitter, TypeScriptClientEmitter, TypeScriptTypeDefinitionEmitter, TypeScriptEndpointDefinitionEmitter, TypeScriptRefinedTypeDefinitionEmitter]);
|
|
455
455
|
initMetadataForClass(EndpointParam, 'EndpointParam');
|
|
456
456
|
initMetadataForCompanion(Companion);
|
|
457
457
|
initMetadataForClass(TypeScriptIrEmitter$shared$1);
|
|
@@ -488,10 +488,10 @@ function emitClientInterface($this, _this__u8e3s4, endpoint) {
|
|
|
488
488
|
return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
489
489
|
}
|
|
490
490
|
function emitFunction($this, endpoint, request) {
|
|
491
|
-
var tmp = endpoint.
|
|
491
|
+
var tmp = endpoint.ep_1.l1();
|
|
492
492
|
var tmp_0 = emitClientInterface($this, request, endpoint);
|
|
493
493
|
var tmp_1 = Spacer_instance.toString();
|
|
494
|
-
var tmp_2 = endpoint.
|
|
494
|
+
var tmp_2 = endpoint.ep_1.l1();
|
|
495
495
|
// Inline function 'kotlin.takeIf' call
|
|
496
496
|
var this_0 = paramList(request, endpoint);
|
|
497
497
|
var tmp_3;
|
|
@@ -511,31 +511,31 @@ function emitFunction($this, endpoint, request) {
|
|
|
511
511
|
// Inline function 'kotlin.text.orEmpty' call
|
|
512
512
|
var tmp0_elvis_lhs = tmp_4;
|
|
513
513
|
var tmp$ret$5 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
514
|
-
return trimMargin('\n |' + tmp + ': async (' + tmp_0 + ') => {\n |' + tmp_1 + 'const req = ' + tmp_2 + '.request(' + tmp$ret$5 + ')\n |' + Spacer_instance.toString() + 'const rawRequest = ' + endpoint.
|
|
514
|
+
return trimMargin('\n |' + tmp + ': async (' + tmp_0 + ') => {\n |' + tmp_1 + 'const req = ' + tmp_2 + '.request(' + tmp$ret$5 + ')\n |' + Spacer_instance.toString() + 'const rawRequest = ' + endpoint.ep_1.l1() + '.client(serialization).to(req)\n |' + Spacer_instance.toString() + 'const rawResponse = await handler(rawRequest)\n |' + Spacer_instance.toString() + 'return ' + endpoint.ep_1.l1() + '.client(serialization).from(rawResponse)\n |},\n ');
|
|
515
515
|
}
|
|
516
516
|
function TypeScriptClientEmitter$emitClient$lambda(_destruct__k2r9zo) {
|
|
517
|
-
var endpoint = _destruct__k2r9zo.
|
|
518
|
-
return 'import {' + endpoint.
|
|
517
|
+
var endpoint = _destruct__k2r9zo.ne();
|
|
518
|
+
return 'import {' + endpoint.ep_1.l1() + '} from "./endpoint/' + endpoint.ep_1.l1() + '"';
|
|
519
519
|
}
|
|
520
520
|
function TypeScriptClientEmitter$emitClient$lambda_0(it) {
|
|
521
|
-
return 'import {type ' + it.
|
|
521
|
+
return 'import {type ' + it.lu_1 + '} from "./model/' + it.lu_1 + '"';
|
|
522
522
|
}
|
|
523
523
|
function TypeScriptClientEmitter$emitClient$lambda_1(this$0) {
|
|
524
524
|
return function (_destruct__k2r9zo) {
|
|
525
|
-
var endpoint = _destruct__k2r9zo.
|
|
526
|
-
var request = _destruct__k2r9zo.
|
|
525
|
+
var endpoint = _destruct__k2r9zo.ne();
|
|
526
|
+
var request = _destruct__k2r9zo.oe();
|
|
527
527
|
return emitFunction(this$0, endpoint, request);
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
530
|
function TypeScriptClientEmitter$emitClientInterface$lambda(this$0) {
|
|
531
531
|
return function (it) {
|
|
532
|
-
return this$0.
|
|
532
|
+
return this$0.wq(it.jq_1) + ': ' + this$0.xp(it.kq_1);
|
|
533
533
|
};
|
|
534
534
|
}
|
|
535
535
|
function TypeScriptClientEmitter() {
|
|
536
536
|
}
|
|
537
537
|
function TypeScriptEmitter$emit$lambda(it) {
|
|
538
|
-
return 'export {' + it.
|
|
538
|
+
return 'export {' + it.vq().l1() + "} from './" + it.vq().l1() + "'";
|
|
539
539
|
}
|
|
540
540
|
function TypeScriptEmitter$emit$lambda_0(it) {
|
|
541
541
|
// Inline function 'kotlin.text.trimStart' call
|
|
@@ -543,36 +543,36 @@ function TypeScriptEmitter$emit$lambda_0(it) {
|
|
|
543
543
|
}
|
|
544
544
|
function TypeScriptEmitter$emit$lambda_1(this$0) {
|
|
545
545
|
return function (it) {
|
|
546
|
-
return this$0.
|
|
546
|
+
return this$0.xp(it);
|
|
547
547
|
};
|
|
548
548
|
}
|
|
549
549
|
function TypeScriptEmitter() {
|
|
550
550
|
LanguageEmitter.call(this);
|
|
551
|
-
this.
|
|
552
|
-
this.
|
|
553
|
-
this.
|
|
551
|
+
this.p20_1 = FileExtension_TypeScript_getInstance();
|
|
552
|
+
this.q20_1 = TypeScriptShared_getInstance();
|
|
553
|
+
this.r20_1 = '//';
|
|
554
554
|
}
|
|
555
|
-
protoOf(TypeScriptEmitter).
|
|
556
|
-
return this.
|
|
555
|
+
protoOf(TypeScriptEmitter).eq = function () {
|
|
556
|
+
return this.p20_1;
|
|
557
557
|
};
|
|
558
|
-
protoOf(TypeScriptEmitter).
|
|
559
|
-
return this.
|
|
558
|
+
protoOf(TypeScriptEmitter).t1v = function () {
|
|
559
|
+
return this.q20_1;
|
|
560
560
|
};
|
|
561
|
-
protoOf(TypeScriptEmitter).
|
|
562
|
-
return this.
|
|
561
|
+
protoOf(TypeScriptEmitter).fq = function () {
|
|
562
|
+
return this.r20_1;
|
|
563
563
|
};
|
|
564
|
-
protoOf(TypeScriptEmitter).
|
|
564
|
+
protoOf(TypeScriptEmitter).on = function (ast, logger) {
|
|
565
565
|
// Inline function 'kotlin.run' call
|
|
566
|
-
var $this$run = protoOf(LanguageEmitter).
|
|
566
|
+
var $this$run = protoOf(LanguageEmitter).on.call(this, ast, logger);
|
|
567
567
|
var tmp;
|
|
568
568
|
if (hasEndpoints(ast)) {
|
|
569
|
-
tmp = NonEmptyList__plus_impl_xqmb9($this$run, this.
|
|
569
|
+
tmp = NonEmptyList__plus_impl_xqmb9($this$run, this.m20(ast));
|
|
570
570
|
} else {
|
|
571
571
|
tmp = $this$run;
|
|
572
572
|
}
|
|
573
573
|
var tmp_0 = tmp;
|
|
574
574
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
575
|
-
var this_0 = ast.
|
|
575
|
+
var this_0 = ast.bq_1;
|
|
576
576
|
// Inline function 'kotlin.collections.flatMap' call
|
|
577
577
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
578
578
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -580,7 +580,7 @@ protoOf(TypeScriptEmitter).qn = function (ast, logger) {
|
|
|
580
580
|
var _iterator__ex2g4s = tmp0.t();
|
|
581
581
|
while (_iterator__ex2g4s.u()) {
|
|
582
582
|
var element = _iterator__ex2g4s.v();
|
|
583
|
-
var list = new NonEmptyList(element.
|
|
583
|
+
var list = new NonEmptyList(element.dq_1);
|
|
584
584
|
addAll(destination, list);
|
|
585
585
|
}
|
|
586
586
|
var tmp$ret$5 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -593,11 +593,11 @@ protoOf(TypeScriptEmitter).qn = function (ast, logger) {
|
|
|
593
593
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
594
594
|
var key = namespace(element_0);
|
|
595
595
|
// Inline function 'kotlin.collections.getOrPut' call
|
|
596
|
-
var value = destination_0.
|
|
596
|
+
var value = destination_0.p2(key);
|
|
597
597
|
var tmp_1;
|
|
598
598
|
if (value == null) {
|
|
599
599
|
var answer = ArrayList_init_$Create$();
|
|
600
|
-
destination_0.
|
|
600
|
+
destination_0.w2(key, answer);
|
|
601
601
|
tmp_1 = answer;
|
|
602
602
|
} else {
|
|
603
603
|
tmp_1 = value;
|
|
@@ -609,31 +609,31 @@ protoOf(TypeScriptEmitter).qn = function (ast, logger) {
|
|
|
609
609
|
// Inline function 'kotlin.collections.mapTo' call
|
|
610
610
|
var destination_1 = ArrayList_init_$Create$_0(destination_0.a1());
|
|
611
611
|
// Inline function 'kotlin.collections.iterator' call
|
|
612
|
-
var _iterator__ex2g4s_1 = destination_0.
|
|
612
|
+
var _iterator__ex2g4s_1 = destination_0.j1().t();
|
|
613
613
|
while (_iterator__ex2g4s_1.u()) {
|
|
614
614
|
var item = _iterator__ex2g4s_1.v();
|
|
615
615
|
// Inline function 'kotlin.collections.component1' call
|
|
616
|
-
var ns = item.
|
|
616
|
+
var ns = item.k1();
|
|
617
617
|
// Inline function 'kotlin.collections.component2' call
|
|
618
|
-
var defs = item.
|
|
619
|
-
var tmp_2 = ns + '/index.' + this.
|
|
618
|
+
var defs = item.l1();
|
|
619
|
+
var tmp_2 = ns + '/index.' + this.eq().nq_1;
|
|
620
620
|
var tmp$ret$14 = new Emitted(tmp_2, joinToString(defs, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda));
|
|
621
621
|
destination_1.x(tmp$ret$14);
|
|
622
622
|
}
|
|
623
623
|
return NonEmptyList__plus_impl_xqmb9_0(tmp_0, destination_1);
|
|
624
624
|
};
|
|
625
|
-
protoOf(TypeScriptEmitter).
|
|
625
|
+
protoOf(TypeScriptEmitter).tq = function (module_0, logger) {
|
|
626
626
|
// Inline function 'kotlin.let' call
|
|
627
|
-
var it = protoOf(LanguageEmitter).
|
|
628
|
-
return NonEmptyList__plus_impl_xqmb9(it, new Emitted('Wirespec', this.
|
|
627
|
+
var it = protoOf(LanguageEmitter).tq.call(this, module_0, logger);
|
|
628
|
+
return NonEmptyList__plus_impl_xqmb9(it, new Emitted('Wirespec', this.t1v().t20_1));
|
|
629
629
|
};
|
|
630
|
-
protoOf(TypeScriptEmitter).
|
|
630
|
+
protoOf(TypeScriptEmitter).uq = function (definition, module_0, logger) {
|
|
631
631
|
// Inline function 'kotlin.let' call
|
|
632
|
-
var it = protoOf(LanguageEmitter).
|
|
633
|
-
var subPackageName = plus(Companion_instance.
|
|
634
|
-
return new Emitted(subPackageName.
|
|
632
|
+
var it = protoOf(LanguageEmitter).uq.call(this, definition, module_0, logger);
|
|
633
|
+
var subPackageName = plus(Companion_instance.lr(''), definition);
|
|
634
|
+
return new Emitted(subPackageName.or() + this.w1v(it.io_1), trimMargin("\n |import {Wirespec} from '../Wirespec'\n |\n |" + it.jo_1 + '\n '));
|
|
635
635
|
};
|
|
636
|
-
protoOf(TypeScriptEmitter).
|
|
636
|
+
protoOf(TypeScriptEmitter).yq = function (union) {
|
|
637
637
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
638
638
|
var this_0 = importReferences(union);
|
|
639
639
|
var set = HashSet_init_$Create$();
|
|
@@ -641,7 +641,7 @@ protoOf(TypeScriptEmitter).ar = function (union) {
|
|
|
641
641
|
var _iterator__ex2g4s = this_0.t();
|
|
642
642
|
while (_iterator__ex2g4s.u()) {
|
|
643
643
|
var e = _iterator__ex2g4s.v();
|
|
644
|
-
var key = e.
|
|
644
|
+
var key = e.lu_1;
|
|
645
645
|
if (set.x(key)) {
|
|
646
646
|
list.x(e);
|
|
647
647
|
}
|
|
@@ -652,24 +652,24 @@ protoOf(TypeScriptEmitter).ar = function (union) {
|
|
|
652
652
|
var _iterator__ex2g4s_0 = list.t();
|
|
653
653
|
while (_iterator__ex2g4s_0.u()) {
|
|
654
654
|
var item = _iterator__ex2g4s_0.v();
|
|
655
|
-
var tmp$ret$2 = 'import {type ' + item.
|
|
655
|
+
var tmp$ret$2 = 'import {type ' + item.lu_1 + "} from '../model'";
|
|
656
656
|
destination.x(tmp$ret$2);
|
|
657
657
|
}
|
|
658
658
|
var tmp = destination;
|
|
659
659
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda_0);
|
|
660
|
-
var tmp_1 = this.
|
|
661
|
-
return trimMargin('\n |' + tmp_0 + '\n |export type ' + tmp_1 + ' = ' + joinToString(union.
|
|
660
|
+
var tmp_1 = this.n20(union.qo_1);
|
|
661
|
+
return trimMargin('\n |' + tmp_0 + '\n |export type ' + tmp_1 + ' = ' + joinToString(union.ro_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda_1(this)) + '\n |\n ');
|
|
662
662
|
};
|
|
663
|
-
protoOf(TypeScriptEmitter).
|
|
664
|
-
return this.
|
|
663
|
+
protoOf(TypeScriptEmitter).xq = function (channel) {
|
|
664
|
+
return this.gq();
|
|
665
665
|
};
|
|
666
666
|
function emit_11($this, _this__u8e3s4) {
|
|
667
667
|
var tmp;
|
|
668
668
|
if (_this__u8e3s4 instanceof Literal) {
|
|
669
|
-
tmp = _this__u8e3s4.
|
|
669
|
+
tmp = _this__u8e3s4.hq_1;
|
|
670
670
|
} else {
|
|
671
671
|
if (_this__u8e3s4 instanceof Param) {
|
|
672
|
-
tmp = ':' + _this__u8e3s4.
|
|
672
|
+
tmp = ':' + _this__u8e3s4.lp_1.l1();
|
|
673
673
|
} else {
|
|
674
674
|
noWhenBranchMatchedException();
|
|
675
675
|
}
|
|
@@ -677,64 +677,64 @@ function emit_11($this, _this__u8e3s4) {
|
|
|
677
677
|
return tmp;
|
|
678
678
|
}
|
|
679
679
|
function emitClient_0($this, _this__u8e3s4) {
|
|
680
|
-
return trimMargin('\n |export const client: Wirespec.Client<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitClientTo($this, _this__u8e3s4), Spacer_instance.
|
|
680
|
+
return trimMargin('\n |export const client: Wirespec.Client<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitClientTo($this, _this__u8e3s4), Spacer_instance.qr(1)) + ',\n |' + prependIndent(emitClientFrom($this, _this__u8e3s4), Spacer_instance.qr(1)) + '\n |})\n ');
|
|
681
681
|
}
|
|
682
682
|
function emitClientTo($this, _this__u8e3s4) {
|
|
683
|
-
var tmp = Spacer_instance.
|
|
683
|
+
var tmp = Spacer_instance.qr(1);
|
|
684
684
|
// Inline function 'kotlin.text.uppercase' call
|
|
685
685
|
// Inline function 'kotlin.js.asDynamic' call
|
|
686
|
-
var tmp_0 = _this__u8e3s4.
|
|
687
|
-
var tmp_1 = Spacer_instance.
|
|
686
|
+
var tmp_0 = _this__u8e3s4.fp_1.a3_1.toUpperCase();
|
|
687
|
+
var tmp_1 = Spacer_instance.qr(1);
|
|
688
688
|
var tmp_2 = emitPathArray($this, _this__u8e3s4);
|
|
689
|
-
var tmp_3 = Spacer_instance.
|
|
690
|
-
var tmp_4 = joinToString(_this__u8e3s4.
|
|
691
|
-
var tmp_5 = Spacer_instance.
|
|
692
|
-
return trimMargin('\n |to: (it) => ({\n |' + tmp + 'method: "' + tmp_0 + '",\n |' + tmp_1 + 'path: ' + tmp_2 + ',\n |' + tmp_3 + 'queries: {' + tmp_4 + '},\n |' + tmp_5 + 'headers: {' + joinToString(_this__u8e3s4.
|
|
689
|
+
var tmp_3 = Spacer_instance.qr(1);
|
|
690
|
+
var tmp_4 = joinToString(_this__u8e3s4.hp_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientTo$lambda($this));
|
|
691
|
+
var tmp_5 = Spacer_instance.qr(1);
|
|
692
|
+
return trimMargin('\n |to: (it) => ({\n |' + tmp + 'method: "' + tmp_0 + '",\n |' + tmp_1 + 'path: ' + tmp_2 + ',\n |' + tmp_3 + 'queries: {' + tmp_4 + '},\n |' + tmp_5 + 'headers: {' + joinToString(_this__u8e3s4.ip_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientTo$lambda_0($this)) + '},\n |' + Spacer_instance.qr(1) + 'body: serialization.serialize(it.body)\n |})\n ');
|
|
693
693
|
}
|
|
694
694
|
function emitClientFrom($this, _this__u8e3s4) {
|
|
695
|
-
var tmp = Spacer_instance.
|
|
696
|
-
var tmp_0 = distinctByStatus(_this__u8e3s4.
|
|
697
|
-
return trimMargin('\n |from: (it) => {\n |' + tmp + 'switch (it.status) {\n |' + prependIndent(joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientFrom$lambda($this)), Spacer_instance.
|
|
695
|
+
var tmp = Spacer_instance.qr(1);
|
|
696
|
+
var tmp_0 = distinctByStatus(_this__u8e3s4.kp_1);
|
|
697
|
+
return trimMargin('\n |from: (it) => {\n |' + tmp + 'switch (it.status) {\n |' + prependIndent(joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientFrom$lambda($this)), Spacer_instance.qr(2)) + '\n |' + Spacer_instance.qr(2) + 'default:\n |' + Spacer_instance.qr(3) + 'throw new Error(`Cannot internalize response with status: ${it.status}`);\n |' + Spacer_instance.qr(1) + '}\n |}\n ');
|
|
698
698
|
}
|
|
699
699
|
function emitClientFromResponse($this, _this__u8e3s4) {
|
|
700
|
-
var tmp = fixStatus(_this__u8e3s4.
|
|
701
|
-
var tmp_0 = Spacer_instance.
|
|
702
|
-
var tmp_1 = Spacer_instance.
|
|
703
|
-
var tmp_2 = fixStatus(_this__u8e3s4.
|
|
704
|
-
var tmp_3 = Spacer_instance.
|
|
705
|
-
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.
|
|
700
|
+
var tmp = fixStatus(_this__u8e3s4.qp_1);
|
|
701
|
+
var tmp_0 = Spacer_instance.qr(1);
|
|
702
|
+
var tmp_1 = Spacer_instance.qr(2);
|
|
703
|
+
var tmp_2 = fixStatus(_this__u8e3s4.qp_1);
|
|
704
|
+
var tmp_3 = Spacer_instance.qr(2);
|
|
705
|
+
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.rp_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientFromResponse$lambda($this)) + '},\n |' + Spacer_instance.qr(2) + 'body: serialization.deserialize<' + emitReference($this, _this__u8e3s4) + '>(it.body)\n |' + Spacer_instance.qr(1) + '};\n ');
|
|
706
706
|
}
|
|
707
707
|
function emitServer($this, _this__u8e3s4) {
|
|
708
|
-
return trimMargin('\n |export const server:Wirespec.Server<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitServerFrom($this, _this__u8e3s4), Spacer_instance.
|
|
708
|
+
return trimMargin('\n |export const server:Wirespec.Server<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitServerFrom($this, _this__u8e3s4), Spacer_instance.qr(1)) + ',\n |' + prependIndent(emitServerTo($this, _this__u8e3s4), Spacer_instance.qr(1)) + '\n |})\n ');
|
|
709
709
|
}
|
|
710
710
|
function emitServerFrom($this, _this__u8e3s4) {
|
|
711
|
-
var tmp = Spacer_instance.
|
|
712
|
-
var tmp_0 = Spacer_instance.
|
|
711
|
+
var tmp = Spacer_instance.qr(1);
|
|
712
|
+
var tmp_0 = Spacer_instance.qr(2);
|
|
713
713
|
// Inline function 'kotlin.text.uppercase' call
|
|
714
714
|
// Inline function 'kotlin.js.asDynamic' call
|
|
715
|
-
var tmp_1 = _this__u8e3s4.
|
|
716
|
-
var tmp_2 = Spacer_instance.
|
|
715
|
+
var tmp_1 = _this__u8e3s4.fp_1.a3_1.toUpperCase();
|
|
716
|
+
var tmp_2 = Spacer_instance.qr(2);
|
|
717
717
|
var tmp_3 = get_indexedPathParams(_this__u8e3s4);
|
|
718
|
-
var tmp_4 = prependIndent(joinToString(tmp_3, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda($this)), Spacer_instance.
|
|
719
|
-
var tmp_5 = Spacer_instance.
|
|
720
|
-
var tmp_6 = Spacer_instance.
|
|
721
|
-
var tmp_7 = joinToString(_this__u8e3s4.
|
|
722
|
-
var tmp_8 = Spacer_instance.
|
|
723
|
-
var tmp_9 = Spacer_instance.
|
|
724
|
-
return trimMargin('\n |from: (it) => {\n |' + tmp + 'return {\n |' + tmp_0 + 'method: "' + tmp_1 + '",\n |' + tmp_2 + 'path: {\n |' + tmp_4 + '\n |' + tmp_5 + '},\n |' + tmp_6 + 'queries: {\n |' + tmp_7 + '\n |' + tmp_8 + '},\n |' + tmp_9 + 'headers: {\n |' + joinToString(_this__u8e3s4.
|
|
718
|
+
var tmp_4 = prependIndent(joinToString(tmp_3, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda($this)), Spacer_instance.qr(3));
|
|
719
|
+
var tmp_5 = Spacer_instance.qr(2);
|
|
720
|
+
var tmp_6 = Spacer_instance.qr(2);
|
|
721
|
+
var tmp_7 = joinToString(_this__u8e3s4.hp_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_0($this));
|
|
722
|
+
var tmp_8 = Spacer_instance.qr(2);
|
|
723
|
+
var tmp_9 = Spacer_instance.qr(2);
|
|
724
|
+
return trimMargin('\n |from: (it) => {\n |' + tmp + 'return {\n |' + tmp_0 + 'method: "' + tmp_1 + '",\n |' + tmp_2 + 'path: {\n |' + tmp_4 + '\n |' + tmp_5 + '},\n |' + tmp_6 + 'queries: {\n |' + tmp_7 + '\n |' + tmp_8 + '},\n |' + tmp_9 + 'headers: {\n |' + joinToString(_this__u8e3s4.ip_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_1($this)) + '\n |' + Spacer_instance.qr(2) + '},\n |' + Spacer_instance.qr(2) + 'body: serialization.deserialize(it.body)\n |' + Spacer_instance.qr(1) + '}\n |}\n ');
|
|
725
725
|
}
|
|
726
726
|
function emitServerTo($this, _this__u8e3s4) {
|
|
727
|
-
var tmp = Spacer_instance.
|
|
728
|
-
var tmp_0 = distinctByStatus(_this__u8e3s4.
|
|
729
|
-
return trimMargin('\n |to: (it) => {\n |' + tmp + 'switch (it.status) {\n |' + prependIndent(joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerTo$lambda($this)), Spacer_instance.
|
|
727
|
+
var tmp = Spacer_instance.qr(1);
|
|
728
|
+
var tmp_0 = distinctByStatus(_this__u8e3s4.kp_1);
|
|
729
|
+
return trimMargin('\n |to: (it) => {\n |' + tmp + 'switch (it.status) {\n |' + prependIndent(joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerTo$lambda($this)), Spacer_instance.qr(2)) + '\n |' + Spacer_instance.qr(1) + '}\n |}\n ');
|
|
730
730
|
}
|
|
731
731
|
function emitServerToResponse($this, _this__u8e3s4) {
|
|
732
|
-
var tmp = fixStatus(_this__u8e3s4.
|
|
733
|
-
var tmp_0 = Spacer_instance.
|
|
734
|
-
var tmp_1 = Spacer_instance.
|
|
735
|
-
var tmp_2 = fixStatus(_this__u8e3s4.
|
|
736
|
-
var tmp_3 = Spacer_instance.
|
|
737
|
-
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {\n |' + prependIndent(joinToString(_this__u8e3s4.
|
|
732
|
+
var tmp = fixStatus(_this__u8e3s4.qp_1);
|
|
733
|
+
var tmp_0 = Spacer_instance.qr(1);
|
|
734
|
+
var tmp_1 = Spacer_instance.qr(2);
|
|
735
|
+
var tmp_2 = fixStatus(_this__u8e3s4.qp_1);
|
|
736
|
+
var tmp_3 = Spacer_instance.qr(2);
|
|
737
|
+
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {\n |' + prependIndent(joinToString(_this__u8e3s4.rp_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerToResponse$lambda($this)), Spacer_instance.qr(3)) + '\n |' + Spacer_instance.qr(2) + '} as Record<string, string>,\n |' + Spacer_instance.qr(2) + 'body: serialization.serialize(it.body),\n |' + Spacer_instance.qr(1) + '};\n ');
|
|
738
738
|
}
|
|
739
739
|
function emitType($this, _this__u8e3s4, name, block) {
|
|
740
740
|
var tmp;
|
|
@@ -747,7 +747,7 @@ function emitType($this, _this__u8e3s4, name, block) {
|
|
|
747
747
|
return tmp;
|
|
748
748
|
}
|
|
749
749
|
function emitName($this, _this__u8e3s4) {
|
|
750
|
-
return 'Response' + Companion_instance_0.
|
|
750
|
+
return 'Response' + Companion_instance_0.oq(_this__u8e3s4.qp_1);
|
|
751
751
|
}
|
|
752
752
|
function emitFunction_0($this, _this__u8e3s4, endpoint) {
|
|
753
753
|
var tmp = Spacer_instance.toString();
|
|
@@ -773,18 +773,18 @@ function emitFunction_0($this, _this__u8e3s4, endpoint) {
|
|
|
773
773
|
// Inline function 'kotlin.text.orEmpty' call
|
|
774
774
|
var tmp0_elvis_lhs = tmp_4;
|
|
775
775
|
var tmp_5 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
776
|
-
var tmp_6 = Spacer_instance.
|
|
776
|
+
var tmp_6 = Spacer_instance.qr(2);
|
|
777
777
|
var tmp_7 = get_pathParams(endpoint);
|
|
778
778
|
var tmp_8 = joinToObject($this, tmp_7, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_0($this));
|
|
779
|
-
var tmp_9 = Spacer_instance.
|
|
780
|
-
var tmp_10 = endpoint.
|
|
781
|
-
var tmp_11 = Spacer_instance.
|
|
782
|
-
var tmp_12 = joinToObject($this, endpoint.
|
|
783
|
-
var tmp_13 = Spacer_instance.
|
|
784
|
-
var tmp_14 = joinToObject($this, endpoint.
|
|
785
|
-
var tmp_15 = Spacer_instance.
|
|
779
|
+
var tmp_9 = Spacer_instance.qr(2);
|
|
780
|
+
var tmp_10 = endpoint.fp_1.toString();
|
|
781
|
+
var tmp_11 = Spacer_instance.qr(2);
|
|
782
|
+
var tmp_12 = joinToObject($this, endpoint.hp_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_1($this));
|
|
783
|
+
var tmp_13 = Spacer_instance.qr(2);
|
|
784
|
+
var tmp_14 = joinToObject($this, endpoint.ip_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_2($this));
|
|
785
|
+
var tmp_15 = Spacer_instance.qr(2);
|
|
786
786
|
var tmp_16;
|
|
787
|
-
if (_this__u8e3s4.
|
|
787
|
+
if (_this__u8e3s4.np_1 == null) {
|
|
788
788
|
tmp_16 = null;
|
|
789
789
|
} else {
|
|
790
790
|
// Inline function 'kotlin.let' call
|
|
@@ -795,11 +795,11 @@ function emitFunction_0($this, _this__u8e3s4, endpoint) {
|
|
|
795
795
|
}
|
|
796
796
|
function emitFunction_1($this, _this__u8e3s4) {
|
|
797
797
|
var tmp = Spacer_instance.toString();
|
|
798
|
-
var tmp_0 = Companion_instance_0.
|
|
798
|
+
var tmp_0 = Companion_instance_0.oq(_this__u8e3s4.qp_1);
|
|
799
799
|
var tmp_1 = paramList_0(_this__u8e3s4);
|
|
800
800
|
var tmp_2 = joinToObject($this, tmp_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3($this));
|
|
801
801
|
var tmp_3 = Spacer_instance.toString();
|
|
802
|
-
var tmp_4 = Companion_instance_0.
|
|
802
|
+
var tmp_4 = Companion_instance_0.oq(_this__u8e3s4.qp_1);
|
|
803
803
|
// Inline function 'kotlin.takeIf' call
|
|
804
804
|
var this_0 = paramList_0(_this__u8e3s4);
|
|
805
805
|
var tmp_5;
|
|
@@ -814,19 +814,19 @@ function emitFunction_1($this, _this__u8e3s4) {
|
|
|
814
814
|
tmp_6 = null;
|
|
815
815
|
} else {
|
|
816
816
|
// Inline function 'kotlin.run' call
|
|
817
|
-
tmp_6 = 'params: Response' + Companion_instance_0.
|
|
817
|
+
tmp_6 = 'params: Response' + Companion_instance_0.oq(_this__u8e3s4.qp_1) + 'Params';
|
|
818
818
|
}
|
|
819
819
|
// Inline function 'kotlin.text.orEmpty' call
|
|
820
820
|
var tmp0_elvis_lhs = tmp_6;
|
|
821
821
|
var tmp_7 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
822
|
-
var tmp_8 = Companion_instance_0.
|
|
823
|
-
var tmp_9 = Spacer_instance.
|
|
824
|
-
var tmp_10 = fixStatus(_this__u8e3s4.
|
|
825
|
-
var tmp_11 = Spacer_instance.
|
|
826
|
-
var tmp_12 = joinToObject($this, _this__u8e3s4.
|
|
827
|
-
var tmp_13 = Spacer_instance.
|
|
822
|
+
var tmp_8 = Companion_instance_0.oq(_this__u8e3s4.qp_1);
|
|
823
|
+
var tmp_9 = Spacer_instance.qr(2);
|
|
824
|
+
var tmp_10 = fixStatus(_this__u8e3s4.qp_1);
|
|
825
|
+
var tmp_11 = Spacer_instance.qr(2);
|
|
826
|
+
var tmp_12 = joinToObject($this, _this__u8e3s4.rp_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_4($this));
|
|
827
|
+
var tmp_13 = Spacer_instance.qr(2);
|
|
828
828
|
var tmp_14;
|
|
829
|
-
if (_this__u8e3s4.
|
|
829
|
+
if (_this__u8e3s4.sp_1 == null) {
|
|
830
830
|
tmp_14 = null;
|
|
831
831
|
} else {
|
|
832
832
|
// Inline function 'kotlin.let' call
|
|
@@ -836,60 +836,60 @@ function emitFunction_1($this, _this__u8e3s4) {
|
|
|
836
836
|
return trimMargin('\n |' + tmp + 'export type Response' + tmp_0 + 'Params = ' + tmp_2 + '\n |' + tmp_3 + 'export const response' + tmp_4 + ' = (' + tmp_7 + '): Response' + tmp_8 + ' => ({\n |' + tmp_9 + 'status: ' + tmp_10 + ',\n |' + tmp_11 + 'headers: ' + tmp_12 + ',\n |' + tmp_13 + 'body: ' + (tmp2_elvis_lhs == null ? 'undefined' : tmp2_elvis_lhs) + ',\n |' + Spacer_instance.toString() + '})\n ');
|
|
837
837
|
}
|
|
838
838
|
function emitReference($this, _this__u8e3s4) {
|
|
839
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
840
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
841
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
839
|
+
var tmp0_safe_receiver = _this__u8e3s4.sp_1;
|
|
840
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.pp_1;
|
|
841
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.xp(tmp1_safe_receiver);
|
|
842
842
|
return tmp2_elvis_lhs == null ? 'undefined' : tmp2_elvis_lhs;
|
|
843
843
|
}
|
|
844
844
|
function emitPathArray($this, _this__u8e3s4) {
|
|
845
|
-
return joinToString(_this__u8e3s4.
|
|
845
|
+
return joinToString(_this__u8e3s4.gp_1, ', ', '[', ']', VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda($this));
|
|
846
846
|
}
|
|
847
847
|
function emitType_0($this, _this__u8e3s4) {
|
|
848
848
|
var tmp = Spacer_instance.toString();
|
|
849
849
|
var tmp_0 = emitName($this, _this__u8e3s4);
|
|
850
|
-
var tmp_1 = Spacer_instance.
|
|
851
|
-
var tmp_2 = fixStatus(_this__u8e3s4.
|
|
852
|
-
var tmp_3 = Spacer_instance.
|
|
853
|
-
return trimMargin('\n |' + tmp + 'export type ' + tmp_0 + ' = {\n |' + tmp_1 + 'status: ' + tmp_2 + '\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.
|
|
850
|
+
var tmp_1 = Spacer_instance.qr(2);
|
|
851
|
+
var tmp_2 = fixStatus(_this__u8e3s4.qp_1);
|
|
852
|
+
var tmp_3 = Spacer_instance.qr(2);
|
|
853
|
+
return trimMargin('\n |' + tmp + 'export type ' + tmp_0 + ' = {\n |' + tmp_1 + 'status: ' + tmp_2 + '\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.rp_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitType$lambda_0($this)) + '}\n |' + Spacer_instance.qr(2) + 'body: ' + emitReference($this, _this__u8e3s4) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
854
854
|
}
|
|
855
855
|
function emitReference_0($this, _this__u8e3s4) {
|
|
856
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
857
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
858
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
856
|
+
var tmp0_safe_receiver = _this__u8e3s4.np_1;
|
|
857
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.pp_1;
|
|
858
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.xp(tmp1_safe_receiver);
|
|
859
859
|
return tmp2_elvis_lhs == null ? 'undefined' : tmp2_elvis_lhs;
|
|
860
860
|
}
|
|
861
861
|
function emitType_1($this, _this__u8e3s4, endpoint) {
|
|
862
|
-
return trimMargin('\n |' + Spacer_instance.toString() + 'export type Request = {\n |' + Spacer_instance.
|
|
862
|
+
return trimMargin('\n |' + Spacer_instance.toString() + 'export type Request = {\n |' + Spacer_instance.qr(2) + 'path: Path\n |' + Spacer_instance.qr(2) + 'method: "' + endpoint.fp_1.toString() + '"\n |' + Spacer_instance.qr(2) + 'queries: Queries\n |' + Spacer_instance.qr(2) + 'headers: Headers\n |' + Spacer_instance.qr(2) + 'body: ' + emitReference_0($this, _this__u8e3s4) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
863
863
|
}
|
|
864
864
|
function emit_12($this, _this__u8e3s4) {
|
|
865
|
-
return Spacer_instance.toString() + $this.
|
|
865
|
+
return Spacer_instance.toString() + $this.wq(_this__u8e3s4.lp_1) + ': ' + $this.xp(_this__u8e3s4.mp_1);
|
|
866
866
|
}
|
|
867
867
|
function emit_13($this, _this__u8e3s4) {
|
|
868
|
-
return $this.
|
|
868
|
+
return $this.wq(_this__u8e3s4.jq_1) + (_this__u8e3s4.kq_1.du() ? '?' : '') + ': ' + $this.xp(_this__u8e3s4.kq_1.fu(false));
|
|
869
869
|
}
|
|
870
870
|
function emitDeserialize($this, _this__u8e3s4) {
|
|
871
|
-
return $this.
|
|
871
|
+
return $this.wq(_this__u8e3s4.me_1.lp_1) + ': serialization.deserialize(it.path[' + _this__u8e3s4.le_1 + '])';
|
|
872
872
|
}
|
|
873
873
|
function emitDeserialize_0($this, _this__u8e3s4, fields, caseSensitive) {
|
|
874
|
-
return caseSensitive ? $this.
|
|
874
|
+
return caseSensitive ? $this.wq(_this__u8e3s4.ap_1) + ': serialization.deserialize(it.' + fields + '[' + $this.wq(_this__u8e3s4.ap_1) + '])' : $this.wq(_this__u8e3s4.ap_1) + ': serialization.deserialize(Object.entries(it.' + fields + ').find(([key]) => key.toLowerCase() === ' + $this.wq(lowercase($this, _this__u8e3s4.ap_1)) + ')?.[1])';
|
|
875
875
|
}
|
|
876
876
|
function emitDeserialize$default($this, _this__u8e3s4, fields, caseSensitive, $super) {
|
|
877
877
|
caseSensitive = caseSensitive === VOID ? true : caseSensitive;
|
|
878
878
|
return emitDeserialize_0($this, _this__u8e3s4, fields, caseSensitive);
|
|
879
879
|
}
|
|
880
880
|
function emitSerialize($this, _this__u8e3s4, fields) {
|
|
881
|
-
return $this.
|
|
881
|
+
return $this.wq(_this__u8e3s4.ap_1) + ': serialization.serialize(it.' + fields + '[' + $this.wq(_this__u8e3s4.ap_1) + '])';
|
|
882
882
|
}
|
|
883
883
|
function joinToObject($this, _this__u8e3s4, transform) {
|
|
884
884
|
return joinToString(_this__u8e3s4, ', ', '{', '}', VOID, VOID, transform);
|
|
885
885
|
}
|
|
886
886
|
function emitHandleFunction($this, endpoint) {
|
|
887
|
-
return Companion_instance_0.
|
|
887
|
+
return Companion_instance_0.pq($this.n20(endpoint.ep_1)) + ': (request:Request) => Promise<Response>';
|
|
888
888
|
}
|
|
889
889
|
function lowercase($this, _this__u8e3s4) {
|
|
890
890
|
// Inline function 'kotlin.text.lowercase' call
|
|
891
891
|
// Inline function 'kotlin.js.asDynamic' call
|
|
892
|
-
var tmp$ret$1 = _this__u8e3s4.
|
|
892
|
+
var tmp$ret$1 = _this__u8e3s4.l1().toLowerCase();
|
|
893
893
|
return new FieldIdentifier(tmp$ret$1);
|
|
894
894
|
}
|
|
895
895
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda(it) {
|
|
@@ -903,12 +903,12 @@ function TypeScriptEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
|
903
903
|
}
|
|
904
904
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
905
905
|
return function (it) {
|
|
906
|
-
return this$0.
|
|
906
|
+
return this$0.wp(it);
|
|
907
907
|
};
|
|
908
908
|
}
|
|
909
909
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
910
910
|
return function (it) {
|
|
911
|
-
return this$0.
|
|
911
|
+
return this$0.wp(it);
|
|
912
912
|
};
|
|
913
913
|
}
|
|
914
914
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
@@ -958,12 +958,12 @@ function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda(this$0) {
|
|
|
958
958
|
}
|
|
959
959
|
function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_0(this$0) {
|
|
960
960
|
return function (it) {
|
|
961
|
-
return prependIndent(emitDeserialize$default(this$0, it, 'queries'), Spacer_instance.
|
|
961
|
+
return prependIndent(emitDeserialize$default(this$0, it, 'queries'), Spacer_instance.qr(3));
|
|
962
962
|
};
|
|
963
963
|
}
|
|
964
964
|
function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_1(this$0) {
|
|
965
965
|
return function (it) {
|
|
966
|
-
return prependIndent(emitDeserialize_0(this$0, it, 'headers', false), Spacer_instance.
|
|
966
|
+
return prependIndent(emitDeserialize_0(this$0, it, 'headers', false), Spacer_instance.qr(3));
|
|
967
967
|
};
|
|
968
968
|
}
|
|
969
969
|
function TypeScriptEndpointDefinitionEmitter$emitServerTo$lambda(this$0) {
|
|
@@ -978,7 +978,7 @@ function TypeScriptEndpointDefinitionEmitter$emitServerToResponse$lambda(this$0)
|
|
|
978
978
|
}
|
|
979
979
|
function TypeScriptEndpointDefinitionEmitter$emitType$lambda($block) {
|
|
980
980
|
return function (it) {
|
|
981
|
-
return Spacer_instance.
|
|
981
|
+
return Spacer_instance.qr(1) + $block(it);
|
|
982
982
|
};
|
|
983
983
|
}
|
|
984
984
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda(this$0) {
|
|
@@ -988,17 +988,17 @@ function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda(this$0) {
|
|
|
988
988
|
}
|
|
989
989
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_0(this$0) {
|
|
990
990
|
return function (it) {
|
|
991
|
-
return this$0.
|
|
991
|
+
return this$0.wq(it.lp_1) + ': params[' + this$0.wq(it.lp_1) + ']';
|
|
992
992
|
};
|
|
993
993
|
}
|
|
994
994
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_1(this$0) {
|
|
995
995
|
return function (it) {
|
|
996
|
-
return this$0.
|
|
996
|
+
return this$0.wq(it.ap_1) + ': params[' + this$0.wq(it.ap_1) + ']';
|
|
997
997
|
};
|
|
998
998
|
}
|
|
999
999
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_2(this$0) {
|
|
1000
1000
|
return function (it) {
|
|
1001
|
-
return this$0.
|
|
1001
|
+
return this$0.wq(it.ap_1) + ': params[' + this$0.wq(it.ap_1) + ']';
|
|
1002
1002
|
};
|
|
1003
1003
|
}
|
|
1004
1004
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3(this$0) {
|
|
@@ -1008,17 +1008,17 @@ function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3(this$0) {
|
|
|
1008
1008
|
}
|
|
1009
1009
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_4(this$0) {
|
|
1010
1010
|
return function (it) {
|
|
1011
|
-
return this$0.
|
|
1011
|
+
return this$0.wq(it.ap_1) + ': params[' + this$0.wq(it.ap_1) + ']';
|
|
1012
1012
|
};
|
|
1013
1013
|
}
|
|
1014
1014
|
function TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda(this$0) {
|
|
1015
1015
|
return function (it) {
|
|
1016
1016
|
var tmp;
|
|
1017
1017
|
if (it instanceof Literal) {
|
|
1018
|
-
tmp = '"' + it.
|
|
1018
|
+
tmp = '"' + it.hq_1 + '"';
|
|
1019
1019
|
} else {
|
|
1020
1020
|
if (it instanceof Param) {
|
|
1021
|
-
tmp = 'serialization.serialize(it.path[' + this$0.
|
|
1021
|
+
tmp = 'serialization.serialize(it.path[' + this$0.wq(it.lp_1) + '])';
|
|
1022
1022
|
} else {
|
|
1023
1023
|
noWhenBranchMatchedException();
|
|
1024
1024
|
}
|
|
@@ -1028,7 +1028,7 @@ function TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda(this$0) {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
function TypeScriptEndpointDefinitionEmitter$emitType$lambda_0(this$0) {
|
|
1030
1030
|
return function (it) {
|
|
1031
|
-
return this$0.
|
|
1031
|
+
return this$0.wq(it.ap_1) + ': ' + this$0.xp(it.bp_1);
|
|
1032
1032
|
};
|
|
1033
1033
|
}
|
|
1034
1034
|
function TypeScriptEndpointDefinitionEmitter() {
|
|
@@ -1043,11 +1043,11 @@ function TypeScriptIdentifierEmitter() {
|
|
|
1043
1043
|
function TypeScriptIrEmitter$shared$o$source$lambda(element, transformer) {
|
|
1044
1044
|
var tmp;
|
|
1045
1045
|
if (element instanceof Namespace) {
|
|
1046
|
-
var injected = element.
|
|
1046
|
+
var injected = element.z1m_1.equals(Companion_getInstance().m1h('Wirespec')) ? listOf(new RawElement('export type Type = string')) : emptyList();
|
|
1047
1047
|
var tmp_0;
|
|
1048
1048
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1049
1049
|
if (!injected.r()) {
|
|
1050
|
-
tmp_0 = withElements(element, plus_0(injected, element.
|
|
1050
|
+
tmp_0 = withElements(element, plus_0(injected, element.v1m()));
|
|
1051
1051
|
} else {
|
|
1052
1052
|
tmp_0 = element;
|
|
1053
1053
|
}
|
|
@@ -1062,11 +1062,11 @@ function TypeScriptIrEmitter$shared$o$source$lambda_0(this$0) {
|
|
|
1062
1062
|
return function (element, transformer) {
|
|
1063
1063
|
var tmp;
|
|
1064
1064
|
if (element instanceof Namespace) {
|
|
1065
|
-
var injected = element.
|
|
1065
|
+
var injected = element.z1m_1.equals(Companion_getInstance().m1h('Wirespec')) ? listOf(new RawElement(this$0.u20_1)) : emptyList();
|
|
1066
1066
|
var tmp_0;
|
|
1067
1067
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1068
1068
|
if (!injected.r()) {
|
|
1069
|
-
tmp_0 = withElements(element, plus_0(element.
|
|
1069
|
+
tmp_0 = withElements(element, plus_0(element.v1m(), injected));
|
|
1070
1070
|
} else {
|
|
1071
1071
|
tmp_0 = element;
|
|
1072
1072
|
}
|
|
@@ -1079,27 +1079,27 @@ function TypeScriptIrEmitter$shared$o$source$lambda_0(this$0) {
|
|
|
1079
1079
|
};
|
|
1080
1080
|
}
|
|
1081
1081
|
function _get_sanitizationConfig__sns434($this) {
|
|
1082
|
-
var tmp0 = $this.
|
|
1082
|
+
var tmp0 = $this.z20_1;
|
|
1083
1083
|
var tmp = KProperty1;
|
|
1084
1084
|
// Inline function 'kotlin.getValue' call
|
|
1085
1085
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, TypeScriptIrEmitter$_get_sanitizationConfig_$ref_f6f0bh(), null);
|
|
1086
|
-
return tmp0.
|
|
1086
|
+
return tmp0.l1();
|
|
1087
1087
|
}
|
|
1088
1088
|
function buildApiConst($this, endpoint) {
|
|
1089
|
-
var apiName = firstToLower($this, endpoint.
|
|
1090
|
-
var method = endpoint.
|
|
1091
|
-
var pathString = joinToString(endpoint.
|
|
1089
|
+
var apiName = firstToLower($this, endpoint.ep_1.l1());
|
|
1090
|
+
var method = endpoint.fp_1.a3_1;
|
|
1091
|
+
var pathString = joinToString(endpoint.gp_1, '/', VOID, VOID, VOID, VOID, TypeScriptIrEmitter$buildApiConst$lambda);
|
|
1092
1092
|
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 '));
|
|
1093
1093
|
}
|
|
1094
1094
|
function transformPatternSwitchToValueSwitch($this) {
|
|
1095
1095
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1096
1096
|
// Inline function 'kotlin.apply' call
|
|
1097
1097
|
var this_0 = new TransformerBuilder();
|
|
1098
|
-
this_0.
|
|
1099
|
-
return this_0.
|
|
1098
|
+
this_0.g1u(TypeScriptIrEmitter$transformPatternSwitchToValueSwitch$lambda);
|
|
1099
|
+
return this_0.e1h();
|
|
1100
1100
|
}
|
|
1101
1101
|
function sanitize($this, _this__u8e3s4) {
|
|
1102
|
-
return '"' + _this__u8e3s4.
|
|
1102
|
+
return '"' + _this__u8e3s4.l1() + '"';
|
|
1103
1103
|
}
|
|
1104
1104
|
function sanitizeSymbol_1($this, _this__u8e3s4) {
|
|
1105
1105
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1120,7 +1120,7 @@ function sanitizeSymbol_1($this, _this__u8e3s4) {
|
|
|
1120
1120
|
return destination.toString();
|
|
1121
1121
|
}
|
|
1122
1122
|
function sanitizeKeywords($this, _this__u8e3s4) {
|
|
1123
|
-
return Companion_getInstance_0().
|
|
1123
|
+
return Companion_getInstance_0().b21_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1124
1124
|
}
|
|
1125
1125
|
function firstToLower($this, _this__u8e3s4) {
|
|
1126
1126
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
@@ -1139,7 +1139,7 @@ function firstToLower($this, _this__u8e3s4) {
|
|
|
1139
1139
|
return tmp;
|
|
1140
1140
|
}
|
|
1141
1141
|
function sanitizeParamName($this, identifier) {
|
|
1142
|
-
var tmp0 = identifier.
|
|
1142
|
+
var tmp0 = identifier.l1();
|
|
1143
1143
|
// Inline function 'kotlin.text.split' call
|
|
1144
1144
|
// Inline function 'kotlin.collections.filter' call
|
|
1145
1145
|
var tmp0_0 = Regex_init_$Create$('[.\\s-]+').xc(tmp0, 0);
|
|
@@ -1154,7 +1154,7 @@ function sanitizeParamName($this, identifier) {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
}
|
|
1156
1156
|
var parts = destination;
|
|
1157
|
-
var name = parts.a1() > 1 ? (new Name(parts)).
|
|
1157
|
+
var name = parts.a1() > 1 ? (new Name(parts)).r1l() : identifier.l1();
|
|
1158
1158
|
return sanitizeKeywords($this, sanitizeSymbol_1($this, name));
|
|
1159
1159
|
}
|
|
1160
1160
|
function buildEndpointParams($this, endpoint) {
|
|
@@ -1163,7 +1163,7 @@ function buildEndpointParams($this, endpoint) {
|
|
|
1163
1163
|
// Inline function 'kotlin.apply' call
|
|
1164
1164
|
var this_0 = ArrayList_init_$Create$();
|
|
1165
1165
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1166
|
-
var tmp0 = endpoint.
|
|
1166
|
+
var tmp0 = endpoint.gp_1;
|
|
1167
1167
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1168
1168
|
var destination = ArrayList_init_$Create$();
|
|
1169
1169
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1177,36 +1177,36 @@ function buildEndpointParams($this, endpoint) {
|
|
|
1177
1177
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1178
1178
|
while (_iterator__ex2g4s_0.u()) {
|
|
1179
1179
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
1180
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_0.
|
|
1180
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_0.lp_1), emitTypeScriptReference($this, element_0.mp_1.fu(false)), element_0.mp_1.du()));
|
|
1181
1181
|
}
|
|
1182
1182
|
// Inline function 'kotlin.collections.forEach' call
|
|
1183
|
-
var _iterator__ex2g4s_1 = endpoint.
|
|
1183
|
+
var _iterator__ex2g4s_1 = endpoint.hp_1.t();
|
|
1184
1184
|
while (_iterator__ex2g4s_1.u()) {
|
|
1185
1185
|
var element_1 = _iterator__ex2g4s_1.v();
|
|
1186
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_1.
|
|
1186
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_1.ap_1), emitTypeScriptReference($this, element_1.bp_1.fu(false)), element_1.bp_1.du()));
|
|
1187
1187
|
}
|
|
1188
1188
|
// Inline function 'kotlin.collections.forEach' call
|
|
1189
|
-
var _iterator__ex2g4s_2 = endpoint.
|
|
1189
|
+
var _iterator__ex2g4s_2 = endpoint.ip_1.t();
|
|
1190
1190
|
while (_iterator__ex2g4s_2.u()) {
|
|
1191
1191
|
var element_2 = _iterator__ex2g4s_2.v();
|
|
1192
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_2.
|
|
1192
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_2.ap_1), emitTypeScriptReference($this, element_2.bp_1.fu(false)), element_2.bp_1.du()));
|
|
1193
1193
|
}
|
|
1194
|
-
var tmp0_safe_receiver = first(endpoint.
|
|
1194
|
+
var tmp0_safe_receiver = first(endpoint.jp_1).np_1;
|
|
1195
1195
|
if (tmp0_safe_receiver == null)
|
|
1196
1196
|
null;
|
|
1197
1197
|
else {
|
|
1198
1198
|
// Inline function 'kotlin.let' call
|
|
1199
|
-
this_0.x(new EndpointParam('body', emitTypeScriptReference($this, tmp0_safe_receiver.
|
|
1199
|
+
this_0.x(new EndpointParam('body', emitTypeScriptReference($this, tmp0_safe_receiver.pp_1.fu(false)), tmp0_safe_receiver.pp_1.du()));
|
|
1200
1200
|
}
|
|
1201
1201
|
return this_0.o5();
|
|
1202
1202
|
}
|
|
1203
1203
|
function emitTypeScriptReference($this, ref) {
|
|
1204
1204
|
var tmp;
|
|
1205
1205
|
if (ref instanceof Dict) {
|
|
1206
|
-
tmp = 'Record<string, ' + emitTypeScriptReference($this, ref.
|
|
1206
|
+
tmp = 'Record<string, ' + emitTypeScriptReference($this, ref.co_1) + '>';
|
|
1207
1207
|
} else {
|
|
1208
1208
|
if (ref instanceof Iterable) {
|
|
1209
|
-
tmp = emitTypeScriptReference($this, ref.
|
|
1209
|
+
tmp = emitTypeScriptReference($this, ref.zn_1) + '[]';
|
|
1210
1210
|
} else {
|
|
1211
1211
|
if (ref instanceof Unit) {
|
|
1212
1212
|
tmp = 'undefined';
|
|
@@ -1215,10 +1215,10 @@ function emitTypeScriptReference($this, ref) {
|
|
|
1215
1215
|
tmp = 'any';
|
|
1216
1216
|
} else {
|
|
1217
1217
|
if (ref instanceof Custom) {
|
|
1218
|
-
tmp = sanitizeSymbol_1($this, ref.
|
|
1218
|
+
tmp = sanitizeSymbol_1($this, ref.lu_1);
|
|
1219
1219
|
} else {
|
|
1220
1220
|
if (ref instanceof Primitive) {
|
|
1221
|
-
var tmp1_subject = ref.
|
|
1221
|
+
var tmp1_subject = ref.pu_1;
|
|
1222
1222
|
var tmp_0;
|
|
1223
1223
|
if (tmp1_subject instanceof String_0) {
|
|
1224
1224
|
tmp_0 = 'string';
|
|
@@ -1251,20 +1251,20 @@ function emitTypeScriptReference($this, ref) {
|
|
|
1251
1251
|
}
|
|
1252
1252
|
}
|
|
1253
1253
|
// Inline function 'kotlin.let' call
|
|
1254
|
-
return tmp + (ref.
|
|
1254
|
+
return tmp + (ref.du() ? ' | undefined' : '');
|
|
1255
1255
|
}
|
|
1256
1256
|
function EndpointParam(name, type, nullable) {
|
|
1257
|
-
this.
|
|
1258
|
-
this.
|
|
1259
|
-
this.
|
|
1257
|
+
this.c21_1 = name;
|
|
1258
|
+
this.d21_1 = type;
|
|
1259
|
+
this.e21_1 = nullable;
|
|
1260
1260
|
}
|
|
1261
1261
|
protoOf(EndpointParam).toString = function () {
|
|
1262
|
-
return 'EndpointParam(name=' + this.
|
|
1262
|
+
return 'EndpointParam(name=' + this.c21_1 + ', type=' + this.d21_1 + ', nullable=' + this.e21_1 + ')';
|
|
1263
1263
|
};
|
|
1264
1264
|
protoOf(EndpointParam).hashCode = function () {
|
|
1265
|
-
var result = getStringHashCode(this.
|
|
1266
|
-
result = imul(result, 31) + getStringHashCode(this.
|
|
1267
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
1265
|
+
var result = getStringHashCode(this.c21_1);
|
|
1266
|
+
result = imul(result, 31) + getStringHashCode(this.d21_1) | 0;
|
|
1267
|
+
result = imul(result, 31) + getBooleanHashCode(this.e21_1) | 0;
|
|
1268
1268
|
return result;
|
|
1269
1269
|
};
|
|
1270
1270
|
protoOf(EndpointParam).equals = function (other) {
|
|
@@ -1272,17 +1272,17 @@ protoOf(EndpointParam).equals = function (other) {
|
|
|
1272
1272
|
return true;
|
|
1273
1273
|
if (!(other instanceof EndpointParam))
|
|
1274
1274
|
return false;
|
|
1275
|
-
if (!(this.
|
|
1275
|
+
if (!(this.c21_1 === other.c21_1))
|
|
1276
1276
|
return false;
|
|
1277
|
-
if (!(this.
|
|
1277
|
+
if (!(this.d21_1 === other.d21_1))
|
|
1278
1278
|
return false;
|
|
1279
|
-
if (!(this.
|
|
1279
|
+
if (!(this.e21_1 === other.e21_1))
|
|
1280
1280
|
return false;
|
|
1281
1281
|
return true;
|
|
1282
1282
|
};
|
|
1283
1283
|
function Companion() {
|
|
1284
1284
|
Companion_instance_1 = this;
|
|
1285
|
-
this.
|
|
1285
|
+
this.b21_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']);
|
|
1286
1286
|
}
|
|
1287
1287
|
var Companion_instance_1;
|
|
1288
1288
|
function Companion_getInstance_0() {
|
|
@@ -1295,13 +1295,13 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
1295
1295
|
}
|
|
1296
1296
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1297
1297
|
return function (name) {
|
|
1298
|
-
var sanitized = name.
|
|
1298
|
+
var sanitized = name.n1h_1.a1() > 1 ? name.r1l() : sanitizeSymbol_1(this$0, name.s1h());
|
|
1299
1299
|
return new Name(listOf(sanitized));
|
|
1300
1300
|
};
|
|
1301
1301
|
}
|
|
1302
1302
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0) {
|
|
1303
1303
|
return function (name) {
|
|
1304
|
-
var sanitized = name.
|
|
1304
|
+
var sanitized = name.n1h_1.a1() > 1 ? name.r1l() : sanitizeSymbol_1(this$0, name.s1h());
|
|
1305
1305
|
return new Name(listOf(sanitized));
|
|
1306
1306
|
};
|
|
1307
1307
|
}
|
|
@@ -1327,29 +1327,29 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0)
|
|
|
1327
1327
|
return function (stmt, tr) {
|
|
1328
1328
|
var tmp;
|
|
1329
1329
|
if (stmt instanceof VariableReference) {
|
|
1330
|
-
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
1330
|
+
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.u1o_1));
|
|
1331
1331
|
} else {
|
|
1332
1332
|
if (stmt instanceof ConstructorStatement) {
|
|
1333
|
-
var tmp_0 = tr.
|
|
1333
|
+
var tmp_0 = tr.r1t(stmt.p1m_1);
|
|
1334
1334
|
// Inline function 'kotlin.collections.map' call
|
|
1335
|
-
var this_0 = stmt.
|
|
1335
|
+
var this_0 = stmt.q1m_1;
|
|
1336
1336
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1337
1337
|
var destination = ArrayList_init_$Create$_0(this_0.a1());
|
|
1338
1338
|
// Inline function 'kotlin.collections.iterator' call
|
|
1339
|
-
var _iterator__ex2g4s = this_0.
|
|
1339
|
+
var _iterator__ex2g4s = this_0.j1().t();
|
|
1340
1340
|
while (_iterator__ex2g4s.u()) {
|
|
1341
1341
|
var item = _iterator__ex2g4s.v();
|
|
1342
1342
|
// Inline function 'kotlin.collections.component1' call
|
|
1343
|
-
var key = item.
|
|
1343
|
+
var key = item.k1();
|
|
1344
1344
|
// Inline function 'kotlin.collections.component2' call
|
|
1345
|
-
var value = item.
|
|
1346
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.
|
|
1345
|
+
var value = item.l1();
|
|
1346
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.u1t(value));
|
|
1347
1347
|
destination.x(tmp$ret$3);
|
|
1348
1348
|
}
|
|
1349
1349
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
1350
1350
|
} else {
|
|
1351
1351
|
if (stmt instanceof Assignment) {
|
|
1352
|
-
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
1352
|
+
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.v1o_1), tr.u1t(stmt.w1o_1), stmt.x1o_1);
|
|
1353
1353
|
} else {
|
|
1354
1354
|
tmp = transformChildren_0(stmt, tr);
|
|
1355
1355
|
}
|
|
@@ -1360,7 +1360,7 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0)
|
|
|
1360
1360
|
}
|
|
1361
1361
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1362
1362
|
return function () {
|
|
1363
|
-
var tmp0_reservedKeywords = Companion_getInstance_0().
|
|
1363
|
+
var tmp0_reservedKeywords = Companion_getInstance_0().b21_1;
|
|
1364
1364
|
var tmp = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1365
1365
|
var tmp_0 = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
|
|
1366
1366
|
var tmp_1 = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
|
|
@@ -1374,49 +1374,43 @@ function TypeScriptIrEmitter$_get_sanitizationConfig_$ref_f6f0bh() {
|
|
|
1374
1374
|
};
|
|
1375
1375
|
}
|
|
1376
1376
|
function TypeScriptIrEmitter$shared$1() {
|
|
1377
|
-
this.
|
|
1378
|
-
this.
|
|
1377
|
+
this.u20_1 = '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}';
|
|
1378
|
+
this.v20_1 = 'community.flock.wirespec';
|
|
1379
1379
|
var tmp = this;
|
|
1380
1380
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1381
|
-
var this_0 = convert(new Shared(this.
|
|
1381
|
+
var this_0 = convert(new Shared(this.v20_1));
|
|
1382
1382
|
var scope = new TransformScope(this_0);
|
|
1383
1383
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectBefore' call
|
|
1384
1384
|
var tmp_0 = scope;
|
|
1385
1385
|
// Inline function 'community.flock.wirespec.ir.core.injectBefore' call
|
|
1386
1386
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1387
|
-
var this_1 = scope.
|
|
1387
|
+
var this_1 = scope.z1t_1;
|
|
1388
1388
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1389
1389
|
// Inline function 'kotlin.apply' call
|
|
1390
1390
|
var this_2 = new TransformerBuilder();
|
|
1391
|
-
this_2.
|
|
1392
|
-
var tmp$ret$2 = this_2.
|
|
1393
|
-
tmp_0.
|
|
1391
|
+
this_2.d1h(TypeScriptIrEmitter$shared$o$source$lambda);
|
|
1392
|
+
var tmp$ret$2 = this_2.e1h();
|
|
1393
|
+
tmp_0.z1t_1 = transform(this_1, tmp$ret$2);
|
|
1394
1394
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1395
1395
|
var tmp_1 = scope;
|
|
1396
1396
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1397
1397
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1398
|
-
var this_3 = scope.
|
|
1398
|
+
var this_3 = scope.z1t_1;
|
|
1399
1399
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1400
1400
|
// Inline function 'kotlin.apply' call
|
|
1401
1401
|
var this_4 = new TransformerBuilder();
|
|
1402
|
-
this_4.
|
|
1403
|
-
var tmp$ret$8 = this_4.
|
|
1404
|
-
tmp_1.
|
|
1405
|
-
var tmp_2 = scope.
|
|
1402
|
+
this_4.d1h(TypeScriptIrEmitter$shared$o$source$lambda_0(this));
|
|
1403
|
+
var tmp$ret$8 = this_4.e1h();
|
|
1404
|
+
tmp_1.z1t_1 = transform(this_3, tmp$ret$8);
|
|
1405
|
+
var tmp_2 = scope.z1t_1;
|
|
1406
1406
|
var tmp$ret$13 = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1407
|
-
tmp.
|
|
1407
|
+
tmp.w20_1 = generateTypeScript(tmp$ret$13);
|
|
1408
1408
|
}
|
|
1409
|
-
protoOf(TypeScriptIrEmitter$shared$1).
|
|
1410
|
-
return this.
|
|
1409
|
+
protoOf(TypeScriptIrEmitter$shared$1).r1w = function () {
|
|
1410
|
+
return this.w20_1;
|
|
1411
1411
|
};
|
|
1412
1412
|
function TypeScriptIrEmitter$emit$lambda(it) {
|
|
1413
|
-
return 'export {' + it.
|
|
1414
|
-
}
|
|
1415
|
-
function TypeScriptIrEmitter$emit$lambda_0(it) {
|
|
1416
|
-
return 'import {' + it.nu_1 + "} from './" + it.nu_1 + "'";
|
|
1417
|
-
}
|
|
1418
|
-
function TypeScriptIrEmitter$emit$lambda_1(it) {
|
|
1419
|
-
return 'import {validate' + it + "} from './" + it + "'";
|
|
1413
|
+
return 'export {' + it.vq().l1() + "} from './" + it.vq().l1() + "'";
|
|
1420
1414
|
}
|
|
1421
1415
|
function TypeScriptIrEmitter$emit$lambda$lambda($fieldNames) {
|
|
1422
1416
|
return function (s, t) {
|
|
@@ -1425,42 +1419,42 @@ function TypeScriptIrEmitter$emit$lambda$lambda($fieldNames) {
|
|
|
1425
1419
|
var tmp_1;
|
|
1426
1420
|
var tmp_2;
|
|
1427
1421
|
if (s instanceof FunctionCall) {
|
|
1428
|
-
tmp_2 = s.
|
|
1422
|
+
tmp_2 = s.b1m_1.equals(Companion_getInstance().m1h('validate'));
|
|
1429
1423
|
} else {
|
|
1430
1424
|
tmp_2 = false;
|
|
1431
1425
|
}
|
|
1432
1426
|
if (tmp_2) {
|
|
1433
|
-
tmp_1 = !(s.
|
|
1427
|
+
tmp_1 = !(s.z1l_1 == null);
|
|
1434
1428
|
} else {
|
|
1435
1429
|
tmp_1 = false;
|
|
1436
1430
|
}
|
|
1437
1431
|
if (tmp_1) {
|
|
1438
1432
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1439
|
-
tmp_0 = !s.
|
|
1433
|
+
tmp_0 = !s.a1m_1.r();
|
|
1440
1434
|
} else {
|
|
1441
1435
|
tmp_0 = false;
|
|
1442
1436
|
}
|
|
1443
1437
|
if (tmp_0) {
|
|
1444
|
-
var tmp_3 = first(s.
|
|
1438
|
+
var tmp_3 = first(s.a1m_1);
|
|
1445
1439
|
var tmp0_safe_receiver = tmp_3 instanceof Custom_0 ? tmp_3 : null;
|
|
1446
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1440
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.q1h_1;
|
|
1447
1441
|
var typeName = tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
|
|
1448
|
-
tmp = new FunctionCall(VOID, VOID, Companion_getInstance().
|
|
1442
|
+
tmp = new FunctionCall(VOID, VOID, Companion_getInstance().m1h('validate' + typeName), mapOf(to(Companion_getInstance().m1h('obj'), t.u1t(ensureNotNull(s.z1l_1)))));
|
|
1449
1443
|
} else {
|
|
1450
1444
|
var tmp_4;
|
|
1451
1445
|
var tmp_5;
|
|
1452
1446
|
if (s instanceof FieldCall) {
|
|
1453
|
-
tmp_5 = s.
|
|
1447
|
+
tmp_5 = s.i1p_1 == null;
|
|
1454
1448
|
} else {
|
|
1455
1449
|
tmp_5 = false;
|
|
1456
1450
|
}
|
|
1457
1451
|
if (tmp_5) {
|
|
1458
|
-
tmp_4 = $fieldNames.
|
|
1452
|
+
tmp_4 = $fieldNames.u1(s.j1p_1.r1l());
|
|
1459
1453
|
} else {
|
|
1460
1454
|
tmp_4 = false;
|
|
1461
1455
|
}
|
|
1462
1456
|
if (tmp_4) {
|
|
1463
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().
|
|
1457
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().m1h('obj')), s.j1p_1);
|
|
1464
1458
|
} else {
|
|
1465
1459
|
tmp = transformChildren_0(s, t);
|
|
1466
1460
|
}
|
|
@@ -1468,17 +1462,17 @@ function TypeScriptIrEmitter$emit$lambda$lambda($fieldNames) {
|
|
|
1468
1462
|
return tmp;
|
|
1469
1463
|
};
|
|
1470
1464
|
}
|
|
1471
|
-
function TypeScriptIrEmitter$emit$
|
|
1465
|
+
function TypeScriptIrEmitter$emit$lambda_0($type, $fieldNames) {
|
|
1472
1466
|
return function (element, transformer) {
|
|
1473
1467
|
var tmp;
|
|
1474
1468
|
if (element instanceof Function) {
|
|
1475
1469
|
var tmp_0;
|
|
1476
|
-
if (element.
|
|
1470
|
+
if (element.t1j_1.equals(Companion_getInstance().m1h('validate'))) {
|
|
1477
1471
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1478
|
-
var this_0 = element.
|
|
1472
|
+
var this_0 = element.b1k(Companion_getInstance().m1h('validate' + $type.vo_1.l1()), VOID, listOf(new Parameter(Companion_getInstance().m1h('obj'), new Custom_0($type.vo_1.l1()))));
|
|
1479
1473
|
var scope = new TransformScope(this_0);
|
|
1480
|
-
scope.
|
|
1481
|
-
var tmp_1 = scope.
|
|
1474
|
+
scope.i1u(TypeScriptIrEmitter$emit$lambda$lambda($fieldNames));
|
|
1475
|
+
var tmp_1 = scope.z1t_1;
|
|
1482
1476
|
tmp_0 = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1483
1477
|
} else {
|
|
1484
1478
|
tmp_0 = element;
|
|
@@ -1491,16 +1485,10 @@ function TypeScriptIrEmitter$emit$lambda_2($type, $fieldNames) {
|
|
|
1491
1485
|
return transformChildren(transformed, transformer);
|
|
1492
1486
|
};
|
|
1493
1487
|
}
|
|
1494
|
-
function TypeScriptIrEmitter$emit$
|
|
1495
|
-
return 'import {type ' + it.nu_1 + "} from '../model'";
|
|
1496
|
-
}
|
|
1497
|
-
function TypeScriptIrEmitter$emit$lambda_4(it) {
|
|
1498
|
-
return 'import {type ' + it.nu_1 + "} from '../model'";
|
|
1499
|
-
}
|
|
1500
|
-
function TypeScriptIrEmitter$emit$lambda_5(stmt, transformer) {
|
|
1488
|
+
function TypeScriptIrEmitter$emit$lambda_1(stmt, transformer) {
|
|
1501
1489
|
var tmp;
|
|
1502
1490
|
if (stmt instanceof Switch) {
|
|
1503
|
-
var tmp1_safe_receiver = stmt.
|
|
1491
|
+
var tmp1_safe_receiver = stmt.o1p_1;
|
|
1504
1492
|
var tmp_0;
|
|
1505
1493
|
if (tmp1_safe_receiver == null) {
|
|
1506
1494
|
tmp_0 = null;
|
|
@@ -1514,17 +1502,17 @@ function TypeScriptIrEmitter$emit$lambda_5(stmt, transformer) {
|
|
|
1514
1502
|
var tmp_1;
|
|
1515
1503
|
var tmp_2;
|
|
1516
1504
|
if (item instanceof ErrorStatement) {
|
|
1517
|
-
var tmp_3 = item.
|
|
1505
|
+
var tmp_3 = item.s1p_1;
|
|
1518
1506
|
tmp_2 = tmp_3 instanceof BinaryOp;
|
|
1519
1507
|
} else {
|
|
1520
1508
|
tmp_2 = false;
|
|
1521
1509
|
}
|
|
1522
1510
|
if (tmp_2) {
|
|
1523
|
-
var tmp_4 = item.
|
|
1511
|
+
var tmp_4 = item.s1p_1;
|
|
1524
1512
|
var binary = tmp_4 instanceof BinaryOp ? tmp_4 : THROW_CCE();
|
|
1525
|
-
var tmp_5 = binary.
|
|
1513
|
+
var tmp_5 = binary.t1p_1;
|
|
1526
1514
|
var literal = tmp_5 instanceof Literal_0 ? tmp_5 : null;
|
|
1527
|
-
tmp_1 = !(literal == null) ? new ErrorStatement(new Literal_0(trimEnd(toString(literal.
|
|
1515
|
+
tmp_1 = !(literal == null) ? new ErrorStatement(new Literal_0(trimEnd(toString(literal.d1p_1), charArrayOf([_Char___init__impl__6a9atx(32)])), literal.e1p_1)) : item;
|
|
1528
1516
|
} else {
|
|
1529
1517
|
tmp_1 = item;
|
|
1530
1518
|
}
|
|
@@ -1533,19 +1521,19 @@ function TypeScriptIrEmitter$emit$lambda_5(stmt, transformer) {
|
|
|
1533
1521
|
}
|
|
1534
1522
|
tmp_0 = destination;
|
|
1535
1523
|
}
|
|
1536
|
-
tmp = transformChildren_0(stmt.
|
|
1524
|
+
tmp = transformChildren_0(stmt.r1p(VOID, VOID, tmp_0), transformer);
|
|
1537
1525
|
} else {
|
|
1538
1526
|
tmp = transformChildren_0(stmt, transformer);
|
|
1539
1527
|
}
|
|
1540
1528
|
return tmp;
|
|
1541
1529
|
}
|
|
1542
|
-
function TypeScriptIrEmitter$emit$
|
|
1530
|
+
function TypeScriptIrEmitter$emit$lambda_2(element, transformer) {
|
|
1543
1531
|
var tmp;
|
|
1544
1532
|
if (element instanceof Interface) {
|
|
1545
1533
|
var tmp_0;
|
|
1546
|
-
if (element.
|
|
1534
|
+
if (element.m1o_1.equals(Companion_getInstance().m1h('Call'))) {
|
|
1547
1535
|
// Inline function 'kotlin.collections.map' call
|
|
1548
|
-
var this_0 = element.
|
|
1536
|
+
var this_0 = element.n1o_1;
|
|
1549
1537
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1550
1538
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1551
1539
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -1553,14 +1541,14 @@ function TypeScriptIrEmitter$emit$lambda_6(element, transformer) {
|
|
|
1553
1541
|
var item = _iterator__ex2g4s.v();
|
|
1554
1542
|
var tmp_1;
|
|
1555
1543
|
if (item instanceof Function) {
|
|
1556
|
-
tmp_1 = item.
|
|
1544
|
+
tmp_1 = item.b1k(VOID, VOID, listOf(new Parameter(Companion_getInstance().m1h('params'), new Custom_0('RequestParams'))));
|
|
1557
1545
|
} else {
|
|
1558
1546
|
tmp_1 = item;
|
|
1559
1547
|
}
|
|
1560
1548
|
var tmp$ret$0 = tmp_1;
|
|
1561
1549
|
destination.x(tmp$ret$0);
|
|
1562
1550
|
}
|
|
1563
|
-
tmp_0 = element.
|
|
1551
|
+
tmp_0 = element.t1o(VOID, destination);
|
|
1564
1552
|
} else {
|
|
1565
1553
|
tmp_0 = element;
|
|
1566
1554
|
}
|
|
@@ -1571,7 +1559,7 @@ function TypeScriptIrEmitter$emit$lambda_6(element, transformer) {
|
|
|
1571
1559
|
var transformed = tmp;
|
|
1572
1560
|
return transformChildren(transformed, transformer);
|
|
1573
1561
|
}
|
|
1574
|
-
function TypeScriptIrEmitter$emit$
|
|
1562
|
+
function TypeScriptIrEmitter$emit$lambda_3(this$0, $endpoint) {
|
|
1575
1563
|
return function (element, transformer) {
|
|
1576
1564
|
var tmp;
|
|
1577
1565
|
if (element instanceof Namespace) {
|
|
@@ -1579,7 +1567,7 @@ function TypeScriptIrEmitter$emit$lambda_7(this$0, $endpoint) {
|
|
|
1579
1567
|
var tmp_0;
|
|
1580
1568
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1581
1569
|
if (!injected.r()) {
|
|
1582
|
-
tmp_0 = withElements(element, plus_0(element.
|
|
1570
|
+
tmp_0 = withElements(element, plus_0(element.v1m(), injected));
|
|
1583
1571
|
} else {
|
|
1584
1572
|
tmp_0 = element;
|
|
1585
1573
|
}
|
|
@@ -1594,28 +1582,19 @@ function TypeScriptIrEmitter$emit$lambda_7(this$0, $endpoint) {
|
|
|
1594
1582
|
function TypeScriptIrEmitter$buildApiConst$lambda(it) {
|
|
1595
1583
|
var tmp;
|
|
1596
1584
|
if (it instanceof Literal) {
|
|
1597
|
-
tmp = it.
|
|
1585
|
+
tmp = it.hq_1;
|
|
1598
1586
|
} else {
|
|
1599
1587
|
if (it instanceof Param) {
|
|
1600
|
-
tmp = '{' + it.
|
|
1588
|
+
tmp = '{' + it.lp_1.l1() + '}';
|
|
1601
1589
|
} else {
|
|
1602
1590
|
noWhenBranchMatchedException();
|
|
1603
1591
|
}
|
|
1604
1592
|
}
|
|
1605
1593
|
return tmp;
|
|
1606
1594
|
}
|
|
1607
|
-
function TypeScriptIrEmitter$emitEndpointClient$lambda(it) {
|
|
1608
|
-
return 'import {type ' + it.nu_1 + "} from '../model'";
|
|
1609
|
-
}
|
|
1610
1595
|
function TypeScriptIrEmitter$emitClient$lambda(this$0) {
|
|
1611
1596
|
return function (it) {
|
|
1612
|
-
var methodName = firstToLower(this$0, it.
|
|
1613
|
-
return 'import {' + methodName + "Client} from './client/" + it.gp_1.n1() + "Client'";
|
|
1614
|
-
};
|
|
1615
|
-
}
|
|
1616
|
-
function TypeScriptIrEmitter$emitClient$lambda_0(this$0) {
|
|
1617
|
-
return function (it) {
|
|
1618
|
-
var methodName = firstToLower(this$0, it.gp_1.n1());
|
|
1597
|
+
var methodName = firstToLower(this$0, it.ep_1.l1());
|
|
1619
1598
|
return ' ...' + methodName + 'Client(serialization, transportation),';
|
|
1620
1599
|
};
|
|
1621
1600
|
}
|
|
@@ -1623,7 +1602,7 @@ function TypeScriptIrEmitter$transformPatternSwitchToValueSwitch$lambda(stmt, tr
|
|
|
1623
1602
|
var tmp;
|
|
1624
1603
|
var tmp_0;
|
|
1625
1604
|
if (stmt instanceof Switch) {
|
|
1626
|
-
var tmp0 = stmt.
|
|
1605
|
+
var tmp0 = stmt.n1p_1;
|
|
1627
1606
|
var tmp$ret$0;
|
|
1628
1607
|
$l$block_0: {
|
|
1629
1608
|
// Inline function 'kotlin.collections.any' call
|
|
@@ -1640,7 +1619,7 @@ function TypeScriptIrEmitter$transformPatternSwitchToValueSwitch$lambda(stmt, tr
|
|
|
1640
1619
|
var _iterator__ex2g4s = tmp0.t();
|
|
1641
1620
|
while (_iterator__ex2g4s.u()) {
|
|
1642
1621
|
var element = _iterator__ex2g4s.v();
|
|
1643
|
-
if (!(element.
|
|
1622
|
+
if (!(element.a1q_1 == null)) {
|
|
1644
1623
|
tmp$ret$0 = true;
|
|
1645
1624
|
break $l$block_0;
|
|
1646
1625
|
}
|
|
@@ -1652,58 +1631,58 @@ function TypeScriptIrEmitter$transformPatternSwitchToValueSwitch$lambda(stmt, tr
|
|
|
1652
1631
|
tmp_0 = false;
|
|
1653
1632
|
}
|
|
1654
1633
|
if (tmp_0) {
|
|
1655
|
-
var tmp0_safe_receiver = stmt.
|
|
1656
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1634
|
+
var tmp0_safe_receiver = stmt.p1p_1;
|
|
1635
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.r1l();
|
|
1657
1636
|
var varName = tmp1_elvis_lhs == null ? 'r' : tmp1_elvis_lhs;
|
|
1658
1637
|
// Inline function 'kotlin.collections.map' call
|
|
1659
|
-
var this_0 = stmt.
|
|
1638
|
+
var this_0 = stmt.n1p_1;
|
|
1660
1639
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1661
1640
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1662
1641
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
1663
1642
|
while (_iterator__ex2g4s_0.u()) {
|
|
1664
1643
|
var item = _iterator__ex2g4s_0.v();
|
|
1665
|
-
var tmp_2 = item.
|
|
1644
|
+
var tmp_2 = item.a1q_1;
|
|
1666
1645
|
var tmp0_safe_receiver_0 = tmp_2 instanceof Custom_0 ? tmp_2 : null;
|
|
1667
|
-
var typeName = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.
|
|
1646
|
+
var typeName = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.q1h_1;
|
|
1668
1647
|
var tmp2_safe_receiver = typeName == null ? null : substringAfterLast(typeName, '.');
|
|
1669
1648
|
var tmp3_safe_receiver = tmp2_safe_receiver == null ? null : removePrefix(tmp2_safe_receiver, 'Response');
|
|
1670
1649
|
var statusNum = tmp3_safe_receiver == null ? null : toIntOrNull(tmp3_safe_receiver);
|
|
1671
1650
|
var tmp_3;
|
|
1672
1651
|
if (!(statusNum == null) && !(typeName == null)) {
|
|
1673
|
-
var exprCode = TypeScriptGenerator_instance.
|
|
1674
|
-
var castAssignment = new Assignment(Companion_getInstance().
|
|
1652
|
+
var exprCode = TypeScriptGenerator_instance.a1v(tr.u1t(stmt.m1p_1));
|
|
1653
|
+
var castAssignment = new Assignment(Companion_getInstance().m1h(varName), new RawExpression(exprCode + ' as ' + typeName), false);
|
|
1675
1654
|
var tmp_4 = new Literal_0(statusNum, new Integer_0());
|
|
1676
1655
|
var tmp_5 = listOf(castAssignment);
|
|
1677
1656
|
// Inline function 'kotlin.collections.map' call
|
|
1678
|
-
var this_1 = item.
|
|
1657
|
+
var this_1 = item.z1p_1;
|
|
1679
1658
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1680
1659
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1681
1660
|
var _iterator__ex2g4s_1 = this_1.t();
|
|
1682
1661
|
while (_iterator__ex2g4s_1.u()) {
|
|
1683
1662
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
1684
|
-
var tmp$ret$2 = tr.
|
|
1663
|
+
var tmp$ret$2 = tr.t1t(item_0);
|
|
1685
1664
|
destination_0.x(tmp$ret$2);
|
|
1686
1665
|
}
|
|
1687
1666
|
tmp_3 = new Case(tmp_4, plus_0(tmp_5, destination_0), null);
|
|
1688
1667
|
} else {
|
|
1689
1668
|
// Inline function 'kotlin.collections.map' call
|
|
1690
|
-
var this_2 = item.
|
|
1669
|
+
var this_2 = item.z1p_1;
|
|
1691
1670
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1692
1671
|
var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
|
|
1693
1672
|
var _iterator__ex2g4s_2 = this_2.t();
|
|
1694
1673
|
while (_iterator__ex2g4s_2.u()) {
|
|
1695
1674
|
var item_1 = _iterator__ex2g4s_2.v();
|
|
1696
|
-
var tmp$ret$5 = tr.
|
|
1675
|
+
var tmp$ret$5 = tr.t1t(item_1);
|
|
1697
1676
|
destination_1.x(tmp$ret$5);
|
|
1698
1677
|
}
|
|
1699
|
-
tmp_3 = item.
|
|
1678
|
+
tmp_3 = item.c1q(VOID, destination_1);
|
|
1700
1679
|
}
|
|
1701
1680
|
var tmp$ret$8 = tmp_3;
|
|
1702
1681
|
destination.x(tmp$ret$8);
|
|
1703
1682
|
}
|
|
1704
1683
|
var transformedCases = destination;
|
|
1705
|
-
var tmp_6 = new FieldCall(tr.
|
|
1706
|
-
var tmp2_safe_receiver_0 = stmt.
|
|
1684
|
+
var tmp_6 = new FieldCall(tr.u1t(stmt.m1p_1), Companion_getInstance().m1h('status'));
|
|
1685
|
+
var tmp2_safe_receiver_0 = stmt.o1p_1;
|
|
1707
1686
|
var tmp_7;
|
|
1708
1687
|
if (tmp2_safe_receiver_0 == null) {
|
|
1709
1688
|
tmp_7 = null;
|
|
@@ -1714,7 +1693,7 @@ function TypeScriptIrEmitter$transformPatternSwitchToValueSwitch$lambda(stmt, tr
|
|
|
1714
1693
|
var _iterator__ex2g4s_3 = tmp2_safe_receiver_0.t();
|
|
1715
1694
|
while (_iterator__ex2g4s_3.u()) {
|
|
1716
1695
|
var item_2 = _iterator__ex2g4s_3.v();
|
|
1717
|
-
var tmp$ret$11 = tr.
|
|
1696
|
+
var tmp$ret$11 = tr.t1t(item_2);
|
|
1718
1697
|
destination_2.x(tmp$ret$11);
|
|
1719
1698
|
}
|
|
1720
1699
|
tmp_7 = destination_2;
|
|
@@ -1727,26 +1706,26 @@ function TypeScriptIrEmitter$transformPatternSwitchToValueSwitch$lambda(stmt, tr
|
|
|
1727
1706
|
}
|
|
1728
1707
|
function TypeScriptIrEmitter() {
|
|
1729
1708
|
Companion_getInstance_0();
|
|
1730
|
-
this.
|
|
1731
|
-
this.
|
|
1709
|
+
this.x20_1 = TypeScriptGenerator_instance;
|
|
1710
|
+
this.y20_1 = FileExtension_TypeScript_getInstance();
|
|
1732
1711
|
var tmp = this;
|
|
1733
|
-
tmp.
|
|
1712
|
+
tmp.z20_1 = lazy(TypeScriptIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1734
1713
|
var tmp_0 = this;
|
|
1735
|
-
tmp_0.
|
|
1714
|
+
tmp_0.a21_1 = new TypeScriptIrEmitter$shared$1();
|
|
1736
1715
|
}
|
|
1737
|
-
protoOf(TypeScriptIrEmitter).
|
|
1738
|
-
return this.
|
|
1716
|
+
protoOf(TypeScriptIrEmitter).m1u = function () {
|
|
1717
|
+
return this.x20_1;
|
|
1739
1718
|
};
|
|
1740
|
-
protoOf(TypeScriptIrEmitter).
|
|
1741
|
-
return this.
|
|
1719
|
+
protoOf(TypeScriptIrEmitter).eq = function () {
|
|
1720
|
+
return this.y20_1;
|
|
1742
1721
|
};
|
|
1743
|
-
protoOf(TypeScriptIrEmitter).
|
|
1744
|
-
return this.
|
|
1722
|
+
protoOf(TypeScriptIrEmitter).t1v = function () {
|
|
1723
|
+
return this.a21_1;
|
|
1745
1724
|
};
|
|
1746
|
-
protoOf(TypeScriptIrEmitter).
|
|
1725
|
+
protoOf(TypeScriptIrEmitter).on = function (ast, logger) {
|
|
1747
1726
|
var tmp = emit.call(this, ast, logger);
|
|
1748
1727
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
1749
|
-
var this_0 = ast.
|
|
1728
|
+
var this_0 = ast.bq_1;
|
|
1750
1729
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1751
1730
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
1752
1731
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -1754,7 +1733,7 @@ protoOf(TypeScriptIrEmitter).qn = function (ast, logger) {
|
|
|
1754
1733
|
var _iterator__ex2g4s = tmp0.t();
|
|
1755
1734
|
while (_iterator__ex2g4s.u()) {
|
|
1756
1735
|
var element = _iterator__ex2g4s.v();
|
|
1757
|
-
var list = new NonEmptyList(element.
|
|
1736
|
+
var list = new NonEmptyList(element.dq_1);
|
|
1758
1737
|
addAll(destination, list);
|
|
1759
1738
|
}
|
|
1760
1739
|
var tmp$ret$3 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -1767,11 +1746,11 @@ protoOf(TypeScriptIrEmitter).qn = function (ast, logger) {
|
|
|
1767
1746
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
1768
1747
|
var key = namespace(element_0);
|
|
1769
1748
|
// Inline function 'kotlin.collections.getOrPut' call
|
|
1770
|
-
var value = destination_0.
|
|
1749
|
+
var value = destination_0.p2(key);
|
|
1771
1750
|
var tmp_0;
|
|
1772
1751
|
if (value == null) {
|
|
1773
1752
|
var answer = ArrayList_init_$Create$();
|
|
1774
|
-
destination_0.
|
|
1753
|
+
destination_0.w2(key, answer);
|
|
1775
1754
|
tmp_0 = answer;
|
|
1776
1755
|
} else {
|
|
1777
1756
|
tmp_0 = value;
|
|
@@ -1783,28 +1762,28 @@ protoOf(TypeScriptIrEmitter).qn = function (ast, logger) {
|
|
|
1783
1762
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1784
1763
|
var destination_1 = ArrayList_init_$Create$_0(destination_0.a1());
|
|
1785
1764
|
// Inline function 'kotlin.collections.iterator' call
|
|
1786
|
-
var _iterator__ex2g4s_1 = destination_0.
|
|
1765
|
+
var _iterator__ex2g4s_1 = destination_0.j1().t();
|
|
1787
1766
|
while (_iterator__ex2g4s_1.u()) {
|
|
1788
1767
|
var item = _iterator__ex2g4s_1.v();
|
|
1789
1768
|
// Inline function 'kotlin.collections.component1' call
|
|
1790
|
-
var ns = item.
|
|
1769
|
+
var ns = item.k1();
|
|
1791
1770
|
// Inline function 'kotlin.collections.component2' call
|
|
1792
|
-
var defs = item.
|
|
1793
|
-
var tmp_1 = ns + '/index.' + this.
|
|
1771
|
+
var defs = item.l1();
|
|
1772
|
+
var tmp_1 = ns + '/index.' + this.eq().nq_1;
|
|
1794
1773
|
var tmp$ret$12 = new Emitted(tmp_1, joinToString(defs, '\n', VOID, VOID, VOID, VOID, TypeScriptIrEmitter$emit$lambda));
|
|
1795
1774
|
destination_1.x(tmp$ret$12);
|
|
1796
1775
|
}
|
|
1797
1776
|
return NonEmptyList__plus_impl_xqmb9_0(tmp, destination_1);
|
|
1798
1777
|
};
|
|
1799
|
-
protoOf(TypeScriptIrEmitter).
|
|
1800
|
-
return NonEmptyList__plus_impl_xqmb9(emit_0.call(this, module_0, logger), new File(Companion_getInstance().
|
|
1778
|
+
protoOf(TypeScriptIrEmitter).n1u = function (module_0, logger) {
|
|
1779
|
+
return NonEmptyList__plus_impl_xqmb9(emit_0.call(this, module_0, logger), new File(Companion_getInstance().m1h('Wirespec'), listOf(new RawElement(this.t1v().r1w()))));
|
|
1801
1780
|
};
|
|
1802
|
-
protoOf(TypeScriptIrEmitter).
|
|
1781
|
+
protoOf(TypeScriptIrEmitter).uq = function (definition, module_0, logger) {
|
|
1803
1782
|
var file = emit_1.call(this, definition, module_0, logger);
|
|
1804
|
-
var subPackageName = plus(Companion_instance.
|
|
1805
|
-
return new File(Companion_getInstance().
|
|
1783
|
+
var subPackageName = plus(Companion_instance.lr(''), definition);
|
|
1784
|
+
return new File(Companion_getInstance().m1h(subPackageName.or() + sanitizeSymbol_1(this, file.t1m_1.x1l())), plus_0(listOf(import_0('../Wirespec', 'Wirespec')), file.u1m_1));
|
|
1806
1785
|
};
|
|
1807
|
-
protoOf(TypeScriptIrEmitter).
|
|
1786
|
+
protoOf(TypeScriptIrEmitter).up = function (type, module_0) {
|
|
1808
1787
|
var fieldValidations = classifyValidatableFields(type, module_0);
|
|
1809
1788
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1810
1789
|
var this_0 = importReferences(type);
|
|
@@ -1813,87 +1792,91 @@ protoOf(TypeScriptIrEmitter).wp = function (type, module_0) {
|
|
|
1813
1792
|
var _iterator__ex2g4s = this_0.t();
|
|
1814
1793
|
while (_iterator__ex2g4s.u()) {
|
|
1815
1794
|
var e = _iterator__ex2g4s.v();
|
|
1816
|
-
var key = e.
|
|
1795
|
+
var key = e.lu_1;
|
|
1817
1796
|
if (set.x(key)) {
|
|
1818
1797
|
list.x(e);
|
|
1819
1798
|
}
|
|
1820
1799
|
}
|
|
1821
|
-
var tmp = list;
|
|
1822
|
-
var typeImports = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptIrEmitter$emit$lambda_0);
|
|
1823
1800
|
// Inline function 'kotlin.collections.map' call
|
|
1824
1801
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1825
|
-
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(
|
|
1826
|
-
var _iterator__ex2g4s_0 =
|
|
1802
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(list, 10));
|
|
1803
|
+
var _iterator__ex2g4s_0 = list.t();
|
|
1827
1804
|
while (_iterator__ex2g4s_0.u()) {
|
|
1828
1805
|
var item = _iterator__ex2g4s_0.v();
|
|
1829
|
-
var tmp$ret$2 = item.
|
|
1806
|
+
var tmp$ret$2 = import_0('./' + item.lu_1, item.lu_1);
|
|
1830
1807
|
destination.x(tmp$ret$2);
|
|
1831
1808
|
}
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
// Inline function 'kotlin.collections.
|
|
1835
|
-
var destination_0 = ArrayList_init_$Create$();
|
|
1836
|
-
var _iterator__ex2g4s_1 =
|
|
1809
|
+
var typeImports = destination;
|
|
1810
|
+
// Inline function 'kotlin.collections.map' call
|
|
1811
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1812
|
+
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(fieldValidations, 10));
|
|
1813
|
+
var _iterator__ex2g4s_1 = fieldValidations.t();
|
|
1837
1814
|
while (_iterator__ex2g4s_1.u()) {
|
|
1838
|
-
var
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
}
|
|
1815
|
+
var item_0 = _iterator__ex2g4s_1.v();
|
|
1816
|
+
var tmp$ret$5 = item_0.j1h_1;
|
|
1817
|
+
destination_0.x(tmp$ret$5);
|
|
1842
1818
|
}
|
|
1843
|
-
var tmp_0 = destination_0;
|
|
1844
|
-
var validateImports = joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, TypeScriptIrEmitter$emit$lambda_1);
|
|
1845
1819
|
// Inline function 'kotlin.collections.filter' call
|
|
1846
|
-
var
|
|
1820
|
+
var tmp0 = distinct(destination_0);
|
|
1847
1821
|
// Inline function 'kotlin.collections.filterTo' call
|
|
1848
1822
|
var destination_1 = ArrayList_init_$Create$();
|
|
1849
|
-
var _iterator__ex2g4s_2 =
|
|
1823
|
+
var _iterator__ex2g4s_2 = tmp0.t();
|
|
1850
1824
|
while (_iterator__ex2g4s_2.u()) {
|
|
1851
|
-
var
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
destination_1.x(element_0);
|
|
1825
|
+
var element = _iterator__ex2g4s_2.v();
|
|
1826
|
+
if (!(element === type.vo_1.l1())) {
|
|
1827
|
+
destination_1.x(element);
|
|
1855
1828
|
}
|
|
1856
1829
|
}
|
|
1857
|
-
var allImports = joinToString(destination_1, '\n');
|
|
1858
1830
|
// Inline function 'kotlin.collections.map' call
|
|
1859
|
-
var this_1 = type.yo_1.uo_1;
|
|
1860
1831
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1861
|
-
var destination_2 = ArrayList_init_$Create$_0(collectionSizeOrDefault(
|
|
1862
|
-
var _iterator__ex2g4s_3 =
|
|
1832
|
+
var destination_2 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_1, 10));
|
|
1833
|
+
var _iterator__ex2g4s_3 = destination_1.t();
|
|
1863
1834
|
while (_iterator__ex2g4s_3.u()) {
|
|
1864
|
-
var
|
|
1865
|
-
var tmp$ret$
|
|
1866
|
-
destination_2.x(tmp$ret$
|
|
1835
|
+
var item_1 = _iterator__ex2g4s_3.v();
|
|
1836
|
+
var tmp$ret$11 = import_0('./' + item_1, 'validate' + item_1);
|
|
1837
|
+
destination_2.x(tmp$ret$11);
|
|
1838
|
+
}
|
|
1839
|
+
var validateImports = destination_2;
|
|
1840
|
+
var allImports = plus_0(typeImports, validateImports);
|
|
1841
|
+
// Inline function 'kotlin.collections.map' call
|
|
1842
|
+
var this_1 = type.wo_1.so_1;
|
|
1843
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1844
|
+
var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1845
|
+
var _iterator__ex2g4s_4 = this_1.t();
|
|
1846
|
+
while (_iterator__ex2g4s_4.u()) {
|
|
1847
|
+
var item_2 = _iterator__ex2g4s_4.v();
|
|
1848
|
+
var tmp$ret$14 = item_2.ap_1.l1();
|
|
1849
|
+
destination_3.x(tmp$ret$14);
|
|
1867
1850
|
}
|
|
1868
|
-
var fieldNames = toSet(
|
|
1851
|
+
var fieldNames = toSet(destination_3);
|
|
1869
1852
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1870
1853
|
var this_2 = sanitizeNames(convertWithValidation(type, module_0), _get_sanitizationConfig__sns434(this));
|
|
1871
1854
|
var scope = new TransformScope(this_2);
|
|
1872
1855
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1873
|
-
var
|
|
1856
|
+
var tmp = scope;
|
|
1874
1857
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1875
|
-
var this_3 = scope.
|
|
1858
|
+
var this_3 = scope.z1t_1;
|
|
1876
1859
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1877
1860
|
// Inline function 'kotlin.apply' call
|
|
1878
1861
|
var this_4 = new TransformerBuilder();
|
|
1879
|
-
this_4.
|
|
1880
|
-
var tmp$ret$
|
|
1881
|
-
|
|
1882
|
-
var
|
|
1883
|
-
var file = isInterface(
|
|
1884
|
-
var
|
|
1885
|
-
// Inline function 'kotlin.
|
|
1886
|
-
if (
|
|
1887
|
-
|
|
1862
|
+
this_4.d1h(TypeScriptIrEmitter$emit$lambda_0(type, fieldNames));
|
|
1863
|
+
var tmp$ret$19 = this_4.e1h();
|
|
1864
|
+
tmp.z1t_1 = transform(this_3, tmp$ret$19);
|
|
1865
|
+
var tmp_0 = scope.z1t_1;
|
|
1866
|
+
var file = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1867
|
+
var tmp_1;
|
|
1868
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1869
|
+
if (!allImports.r()) {
|
|
1870
|
+
tmp_1 = file.x1m(VOID, plus_0(allImports, file.u1m_1));
|
|
1888
1871
|
} else {
|
|
1889
|
-
|
|
1872
|
+
tmp_1 = file;
|
|
1890
1873
|
}
|
|
1891
|
-
return
|
|
1874
|
+
return tmp_1;
|
|
1892
1875
|
};
|
|
1893
|
-
protoOf(TypeScriptIrEmitter).
|
|
1876
|
+
protoOf(TypeScriptIrEmitter).ir = function (enum_0, module_0) {
|
|
1894
1877
|
return sanitizeNames(convert_0(enum_0), _get_sanitizationConfig__sns434(this));
|
|
1895
1878
|
};
|
|
1896
|
-
protoOf(TypeScriptIrEmitter).
|
|
1879
|
+
protoOf(TypeScriptIrEmitter).yq = function (union) {
|
|
1897
1880
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1898
1881
|
var this_0 = importReferences(union);
|
|
1899
1882
|
var set = HashSet_init_$Create$();
|
|
@@ -1901,30 +1884,38 @@ protoOf(TypeScriptIrEmitter).ar = function (union) {
|
|
|
1901
1884
|
var _iterator__ex2g4s = this_0.t();
|
|
1902
1885
|
while (_iterator__ex2g4s.u()) {
|
|
1903
1886
|
var e = _iterator__ex2g4s.v();
|
|
1904
|
-
var key = e.
|
|
1887
|
+
var key = e.lu_1;
|
|
1905
1888
|
if (set.x(key)) {
|
|
1906
1889
|
list.x(e);
|
|
1907
1890
|
}
|
|
1908
1891
|
}
|
|
1909
|
-
|
|
1910
|
-
|
|
1892
|
+
// Inline function 'kotlin.collections.map' call
|
|
1893
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1894
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(list, 10));
|
|
1895
|
+
var _iterator__ex2g4s_0 = list.t();
|
|
1896
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
1897
|
+
var item = _iterator__ex2g4s_0.v();
|
|
1898
|
+
var tmp$ret$2 = import_0('../model', item.lu_1, true);
|
|
1899
|
+
destination.x(tmp$ret$2);
|
|
1900
|
+
}
|
|
1901
|
+
var imports = destination;
|
|
1911
1902
|
var file = sanitizeNames(convert_1(union), _get_sanitizationConfig__sns434(this));
|
|
1912
|
-
var
|
|
1913
|
-
// Inline function 'kotlin.
|
|
1914
|
-
if (
|
|
1915
|
-
|
|
1903
|
+
var tmp;
|
|
1904
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1905
|
+
if (!imports.r()) {
|
|
1906
|
+
tmp = file.x1m(VOID, plus_0(imports, file.u1m_1));
|
|
1916
1907
|
} else {
|
|
1917
|
-
|
|
1908
|
+
tmp = file;
|
|
1918
1909
|
}
|
|
1919
|
-
return
|
|
1910
|
+
return tmp;
|
|
1920
1911
|
};
|
|
1921
|
-
protoOf(TypeScriptIrEmitter).
|
|
1912
|
+
protoOf(TypeScriptIrEmitter).dr = function (refined) {
|
|
1922
1913
|
var converted = convert_2(refined);
|
|
1923
|
-
var constraintExpr = convertConstraint(refined.
|
|
1924
|
-
var validatorStr = TypeScriptGenerator_instance.
|
|
1925
|
-
return new File(converted.
|
|
1914
|
+
var constraintExpr = convertConstraint(refined.cr_1, new VariableReference(Companion_getInstance().m1h('value')));
|
|
1915
|
+
var validatorStr = TypeScriptGenerator_instance.a1v(constraintExpr);
|
|
1916
|
+
return new File(converted.t1m_1, listOf_0([new RawElement('export type ' + converted.t1m_1.x1l() + ' = ' + emitTypeScriptReference(this, refined.cr_1) + ';'), new RawElement('export const validate' + refined.br_1.l1() + ' = (value: ' + emitTypeScriptReference(this, refined.cr_1) + ') =>\n ' + validatorStr + ';')]));
|
|
1926
1917
|
};
|
|
1927
|
-
protoOf(TypeScriptIrEmitter).
|
|
1918
|
+
protoOf(TypeScriptIrEmitter).jr = function (endpoint) {
|
|
1928
1919
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1929
1920
|
var this_0 = importReferences(endpoint);
|
|
1930
1921
|
var set = HashSet_init_$Create$();
|
|
@@ -1932,85 +1923,81 @@ protoOf(TypeScriptIrEmitter).lr = function (endpoint) {
|
|
|
1932
1923
|
var _iterator__ex2g4s = this_0.t();
|
|
1933
1924
|
while (_iterator__ex2g4s.u()) {
|
|
1934
1925
|
var e = _iterator__ex2g4s.v();
|
|
1935
|
-
var key = e.
|
|
1926
|
+
var key = e.lu_1;
|
|
1936
1927
|
if (set.x(key)) {
|
|
1937
1928
|
list.x(e);
|
|
1938
1929
|
}
|
|
1939
1930
|
}
|
|
1940
|
-
|
|
1941
|
-
|
|
1931
|
+
// Inline function 'kotlin.collections.map' call
|
|
1932
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1933
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(list, 10));
|
|
1934
|
+
var _iterator__ex2g4s_0 = list.t();
|
|
1935
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
1936
|
+
var item = _iterator__ex2g4s_0.v();
|
|
1937
|
+
var tmp$ret$2 = import_0('../model', item.lu_1, true);
|
|
1938
|
+
destination.x(tmp$ret$2);
|
|
1939
|
+
}
|
|
1940
|
+
var imports = destination;
|
|
1942
1941
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1943
1942
|
var hasRequestParams = !requestParameters(endpoint).r();
|
|
1944
1943
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1945
1944
|
var this_1 = convert_3(endpoint);
|
|
1946
1945
|
var scope = new TransformScope(this_1);
|
|
1947
|
-
scope.
|
|
1948
|
-
var
|
|
1946
|
+
scope.g1u(TypeScriptIrEmitter$emit$lambda_1);
|
|
1947
|
+
var tmp = scope.z1t_1;
|
|
1949
1948
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1950
|
-
var this_2 = isInterface(
|
|
1949
|
+
var this_2 = isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1951
1950
|
var scope_0 = new TransformScope(this_2);
|
|
1952
|
-
scope_0.
|
|
1953
|
-
var
|
|
1951
|
+
scope_0.e1u(transformPatternSwitchToValueSwitch(this));
|
|
1952
|
+
var tmp_0 = scope_0.z1t_1;
|
|
1954
1953
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1955
|
-
var this_3 = isInterface(
|
|
1954
|
+
var this_3 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1956
1955
|
var scope_1 = new TransformScope(this_3);
|
|
1957
1956
|
if (hasRequestParams) {
|
|
1958
1957
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1959
|
-
var
|
|
1958
|
+
var tmp_1 = scope_1;
|
|
1960
1959
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1961
|
-
var this_4 = scope_1.
|
|
1960
|
+
var this_4 = scope_1.z1t_1;
|
|
1962
1961
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1963
1962
|
// Inline function 'kotlin.apply' call
|
|
1964
1963
|
var this_5 = new TransformerBuilder();
|
|
1965
|
-
this_5.
|
|
1966
|
-
var tmp$ret$
|
|
1967
|
-
|
|
1964
|
+
this_5.d1h(TypeScriptIrEmitter$emit$lambda_2);
|
|
1965
|
+
var tmp$ret$12 = this_5.e1h();
|
|
1966
|
+
tmp_1.z1t_1 = transform(this_4, tmp$ret$12);
|
|
1968
1967
|
}
|
|
1969
|
-
var
|
|
1970
|
-
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1971
|
-
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1972
|
-
var tmp0 = (isInterface(tmp_3, Element) ? tmp_3 : THROW_CCE()).s1m();
|
|
1973
|
-
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1974
|
-
var destination = ArrayList_init_$Create$();
|
|
1975
|
-
var _iterator__ex2g4s_0 = tmp0.t();
|
|
1976
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
1977
|
-
var element = _iterator__ex2g4s_0.v();
|
|
1978
|
-
if (element instanceof Namespace) {
|
|
1979
|
-
destination.x(element);
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1982
|
-
var tmp$ret$16 = firstOrNull(destination);
|
|
1983
|
-
var endpointNamespace = ensureNotNull(tmp$ret$16);
|
|
1968
|
+
var tmp_2 = scope_1.z1t_1;
|
|
1984
1969
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1985
|
-
var
|
|
1970
|
+
var this_6 = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1971
|
+
var scope_2 = new TransformScope(this_6);
|
|
1986
1972
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1987
|
-
var
|
|
1973
|
+
var tmp_3 = scope_2;
|
|
1988
1974
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1989
1975
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1990
|
-
var
|
|
1976
|
+
var this_7 = scope_2.z1t_1;
|
|
1991
1977
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1992
1978
|
// Inline function 'kotlin.apply' call
|
|
1993
|
-
var
|
|
1994
|
-
|
|
1995
|
-
var tmp$ret$19 =
|
|
1996
|
-
|
|
1997
|
-
var
|
|
1998
|
-
var
|
|
1999
|
-
|
|
2000
|
-
var
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
1979
|
+
var this_8 = new TransformerBuilder();
|
|
1980
|
+
this_8.d1h(TypeScriptIrEmitter$emit$lambda_3(this, endpoint));
|
|
1981
|
+
var tmp$ret$19 = this_8.e1h();
|
|
1982
|
+
tmp_3.z1t_1 = transform(this_7, tmp$ret$19);
|
|
1983
|
+
var tmp_4 = scope_2.z1t_1;
|
|
1984
|
+
var tmp$ret$24 = isInterface(tmp_4, Element) ? tmp_4 : THROW_CCE();
|
|
1985
|
+
// Inline function 'kotlin.let' call
|
|
1986
|
+
var it = sanitizeNames(tmp$ret$24.x1m(Companion_getInstance().m1h(sanitize(this, endpoint.ep_1))), _get_sanitizationConfig__sns434(this));
|
|
1987
|
+
var tmp_5;
|
|
1988
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1989
|
+
if (!imports.r()) {
|
|
1990
|
+
tmp_5 = it.x1m(VOID, plus_0(imports, it.u1m_1));
|
|
2004
1991
|
} else {
|
|
2005
|
-
|
|
1992
|
+
tmp_5 = it;
|
|
2006
1993
|
}
|
|
2007
|
-
return
|
|
1994
|
+
return tmp_5;
|
|
2008
1995
|
};
|
|
2009
|
-
protoOf(TypeScriptIrEmitter).
|
|
1996
|
+
protoOf(TypeScriptIrEmitter).xq = function (channel) {
|
|
2010
1997
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
2011
1998
|
};
|
|
2012
|
-
protoOf(TypeScriptIrEmitter).
|
|
2013
|
-
var endpointName = endpoint.
|
|
1999
|
+
protoOf(TypeScriptIrEmitter).q1u = function (endpoint) {
|
|
2000
|
+
var endpointName = endpoint.ep_1.l1();
|
|
2014
2001
|
var methodName = firstToLower(this, endpointName);
|
|
2015
2002
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
2016
2003
|
var this_0 = importReferences(endpoint);
|
|
@@ -2019,104 +2006,86 @@ protoOf(TypeScriptIrEmitter).r1u = function (endpoint) {
|
|
|
2019
2006
|
var _iterator__ex2g4s = this_0.t();
|
|
2020
2007
|
while (_iterator__ex2g4s.u()) {
|
|
2021
2008
|
var e = _iterator__ex2g4s.v();
|
|
2022
|
-
var key = e.
|
|
2009
|
+
var key = e.lu_1;
|
|
2023
2010
|
if (set.x(key)) {
|
|
2024
2011
|
list.x(e);
|
|
2025
2012
|
}
|
|
2026
2013
|
}
|
|
2027
|
-
|
|
2028
|
-
|
|
2014
|
+
// Inline function 'kotlin.collections.map' call
|
|
2015
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2016
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(list, 10));
|
|
2017
|
+
var _iterator__ex2g4s_0 = list.t();
|
|
2018
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
2019
|
+
var item = _iterator__ex2g4s_0.v();
|
|
2020
|
+
var tmp$ret$2 = import_0('../model', item.lu_1, true);
|
|
2021
|
+
destination.x(tmp$ret$2);
|
|
2022
|
+
}
|
|
2023
|
+
var imports = destination;
|
|
2029
2024
|
var params = buildEndpointParams(this, endpoint);
|
|
2030
|
-
var
|
|
2025
|
+
var tmp;
|
|
2031
2026
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
2032
2027
|
if (!params.r()) {
|
|
2033
|
-
|
|
2028
|
+
tmp = 'params: ' + endpointName + '.RequestParams';
|
|
2034
2029
|
} else {
|
|
2035
|
-
|
|
2030
|
+
tmp = '';
|
|
2036
2031
|
}
|
|
2037
|
-
var paramList =
|
|
2038
|
-
var
|
|
2032
|
+
var paramList = tmp;
|
|
2033
|
+
var tmp_0;
|
|
2039
2034
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
2040
2035
|
if (!params.r()) {
|
|
2041
|
-
|
|
2036
|
+
tmp_0 = endpointName + '.request(params)';
|
|
2042
2037
|
} else {
|
|
2043
|
-
|
|
2038
|
+
tmp_0 = endpointName + '.request()';
|
|
2044
2039
|
}
|
|
2045
|
-
var requestArgs =
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
var this_1 = StringBuilder_init_$Create$();
|
|
2049
|
-
// Inline function 'kotlin.text.appendLine' call
|
|
2050
|
-
var value = 'export const ' + methodName + 'Client = (serialization: Wirespec.Serialization, transportation: Wirespec.Transportation) => ({';
|
|
2051
|
-
// Inline function 'kotlin.text.appendLine' call
|
|
2052
|
-
this_1.q(value).s(_Char___init__impl__6a9atx(10));
|
|
2053
|
-
// Inline function 'kotlin.text.appendLine' call
|
|
2054
|
-
var value_0 = ' ' + methodName + ': async (' + paramList + '): Promise<' + endpointName + '.Response<unknown>> => {';
|
|
2055
|
-
// Inline function 'kotlin.text.appendLine' call
|
|
2056
|
-
this_1.q(value_0).s(_Char___init__impl__6a9atx(10));
|
|
2057
|
-
// Inline function 'kotlin.text.appendLine' call
|
|
2058
|
-
var value_1 = ' const request: ' + endpointName + '.Request = ' + requestArgs + ';';
|
|
2059
|
-
// Inline function 'kotlin.text.appendLine' call
|
|
2060
|
-
this_1.q(value_1).s(_Char___init__impl__6a9atx(10));
|
|
2061
|
-
// Inline function 'kotlin.text.appendLine' call
|
|
2062
|
-
var value_2 = ' const rawRequest = ' + endpointName + '.toRawRequest(serialization, request);';
|
|
2063
|
-
// Inline function 'kotlin.text.appendLine' call
|
|
2064
|
-
this_1.q(value_2).s(_Char___init__impl__6a9atx(10));
|
|
2065
|
-
// Inline function 'kotlin.text.appendLine' call
|
|
2066
|
-
var value_3 = ' const rawResponse = await transportation.transport(rawRequest);';
|
|
2067
|
-
// Inline function 'kotlin.text.appendLine' call
|
|
2068
|
-
this_1.q(value_3).s(_Char___init__impl__6a9atx(10));
|
|
2069
|
-
// Inline function 'kotlin.text.appendLine' call
|
|
2070
|
-
var value_4 = ' return ' + endpointName + '.fromRawResponse(serialization, rawResponse);';
|
|
2071
|
-
// Inline function 'kotlin.text.appendLine' call
|
|
2072
|
-
this_1.q(value_4).s(_Char___init__impl__6a9atx(10));
|
|
2073
|
-
// Inline function 'kotlin.text.appendLine' call
|
|
2074
|
-
// Inline function 'kotlin.text.appendLine' call
|
|
2075
|
-
this_1.q(' }').s(_Char___init__impl__6a9atx(10));
|
|
2076
|
-
this_1.q('})');
|
|
2077
|
-
var code = this_1.toString();
|
|
2078
|
-
var tmp_2 = Companion_getInstance().o1h('client/' + endpointName + 'Client');
|
|
2040
|
+
var requestArgs = tmp_0;
|
|
2041
|
+
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 ');
|
|
2042
|
+
var tmp_1 = Companion_getInstance().m1h('client/' + endpointName + 'Client');
|
|
2079
2043
|
// Inline function 'kotlin.collections.buildList' call
|
|
2080
2044
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
2081
2045
|
// Inline function 'kotlin.apply' call
|
|
2082
|
-
var
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
this_2.x(new RawElement(code));
|
|
2090
|
-
var tmp$ret$25 = this_2.o5();
|
|
2091
|
-
return new File(tmp_2, tmp$ret$25);
|
|
2046
|
+
var this_1 = ArrayList_init_$Create$();
|
|
2047
|
+
this_1.x(import_0('../Wirespec', 'Wirespec'));
|
|
2048
|
+
this_1.x(import_0('../endpoint/' + endpointName, endpointName));
|
|
2049
|
+
this_1.e1(imports);
|
|
2050
|
+
this_1.x(new RawElement(code));
|
|
2051
|
+
var tmp$ret$10 = this_1.o5();
|
|
2052
|
+
return new File(tmp_1, tmp$ret$10);
|
|
2092
2053
|
};
|
|
2093
|
-
protoOf(TypeScriptIrEmitter).
|
|
2094
|
-
logger.
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2054
|
+
protoOf(TypeScriptIrEmitter).p1u = function (endpoints, logger) {
|
|
2055
|
+
logger.sq('Emitting main Client for ' + endpoints.a1() + ' endpoints');
|
|
2056
|
+
// Inline function 'kotlin.collections.map' call
|
|
2057
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2058
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(endpoints, 10));
|
|
2059
|
+
var _iterator__ex2g4s = endpoints.t();
|
|
2060
|
+
while (_iterator__ex2g4s.u()) {
|
|
2061
|
+
var item = _iterator__ex2g4s.v();
|
|
2062
|
+
var methodName = firstToLower(this, item.ep_1.l1());
|
|
2063
|
+
var tmp$ret$0 = import_0('./client/' + item.ep_1.l1() + 'Client', methodName + 'Client');
|
|
2064
|
+
destination.x(tmp$ret$0);
|
|
2065
|
+
}
|
|
2066
|
+
var clientImports = destination;
|
|
2067
|
+
var spreadEntries = joinToString(endpoints, '\n', VOID, VOID, VOID, VOID, TypeScriptIrEmitter$emitClient$lambda(this));
|
|
2068
|
+
var code = trimMargin('\n |export const client = (serialization: Wirespec.Serialization, transportation: Wirespec.Transportation) => ({\n |' + spreadEntries + '\n |})\n ');
|
|
2069
|
+
var tmp = Companion_getInstance().m1h('Client');
|
|
2070
|
+
// Inline function 'kotlin.collections.buildList' call
|
|
2071
|
+
// Inline function 'kotlin.collections.buildListInternal' call
|
|
2098
2072
|
// Inline function 'kotlin.apply' call
|
|
2099
|
-
var this_0 =
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
this_0.
|
|
2104
|
-
|
|
2105
|
-
// Inline function 'kotlin.text.appendLine' call
|
|
2106
|
-
this_0.q(spreadEntries).s(_Char___init__impl__6a9atx(10));
|
|
2107
|
-
this_0.q('})');
|
|
2108
|
-
var code = this_0.toString();
|
|
2109
|
-
return new File(Companion_getInstance().o1h('Client'), listOf_0([new RawElement("import {Wirespec} from './Wirespec'"), new RawElement(clientImports), new RawElement(code)]));
|
|
2073
|
+
var this_0 = ArrayList_init_$Create$();
|
|
2074
|
+
this_0.x(import_0('./Wirespec', 'Wirespec'));
|
|
2075
|
+
this_0.e1(clientImports);
|
|
2076
|
+
this_0.x(new RawElement(code));
|
|
2077
|
+
var tmp$ret$6 = this_0.o5();
|
|
2078
|
+
return new File(tmp, tmp$ret$6);
|
|
2110
2079
|
};
|
|
2111
2080
|
function TypeScriptRefinedTypeDefinitionEmitter() {
|
|
2112
2081
|
}
|
|
2113
2082
|
function TypeScriptShared() {
|
|
2114
2083
|
TypeScriptShared_instance = this;
|
|
2115
|
-
this.
|
|
2116
|
-
this.
|
|
2084
|
+
this.s20_1 = 'community.flock.wirespec';
|
|
2085
|
+
this.t20_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 ');
|
|
2117
2086
|
}
|
|
2118
|
-
protoOf(TypeScriptShared).
|
|
2119
|
-
return this.
|
|
2087
|
+
protoOf(TypeScriptShared).r1w = function () {
|
|
2088
|
+
return this.t20_1;
|
|
2120
2089
|
};
|
|
2121
2090
|
protoOf(TypeScriptShared).toString = function () {
|
|
2122
2091
|
return 'TypeScriptShared';
|
|
@@ -2138,7 +2107,7 @@ function TypeScriptShared_getInstance() {
|
|
|
2138
2107
|
return TypeScriptShared_instance;
|
|
2139
2108
|
}
|
|
2140
2109
|
function TypeScriptTypeDefinitionEmitter$sanitizeSymbol$lambda(it) {
|
|
2141
|
-
return isLetterOrDigit(it.
|
|
2110
|
+
return isLetterOrDigit(it.h1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).u1(it);
|
|
2142
2111
|
}
|
|
2143
2112
|
function TypeScriptTypeDefinitionEmitter$emit$lambda(it) {
|
|
2144
2113
|
// Inline function 'kotlin.text.trimStart' call
|
|
@@ -2146,27 +2115,27 @@ function TypeScriptTypeDefinitionEmitter$emit$lambda(it) {
|
|
|
2146
2115
|
}
|
|
2147
2116
|
function TypeScriptTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2148
2117
|
return function (it) {
|
|
2149
|
-
return this$0.
|
|
2118
|
+
return this$0.wp(it);
|
|
2150
2119
|
};
|
|
2151
2120
|
}
|
|
2152
2121
|
function TypeScriptTypeDefinitionEmitter() {
|
|
2153
2122
|
}
|
|
2154
2123
|
//region block: post-declaration
|
|
2155
|
-
protoOf(TypeScriptEmitter).
|
|
2156
|
-
protoOf(TypeScriptEmitter).
|
|
2157
|
-
protoOf(TypeScriptEmitter).
|
|
2158
|
-
protoOf(TypeScriptEmitter).
|
|
2159
|
-
protoOf(TypeScriptEmitter).
|
|
2160
|
-
protoOf(TypeScriptEmitter).
|
|
2161
|
-
protoOf(TypeScriptEmitter).
|
|
2162
|
-
protoOf(TypeScriptEmitter).
|
|
2163
|
-
protoOf(TypeScriptEmitter).
|
|
2164
|
-
protoOf(TypeScriptEmitter).
|
|
2165
|
-
protoOf(TypeScriptEmitter).
|
|
2166
|
-
protoOf(TypeScriptEmitter).
|
|
2167
|
-
protoOf(TypeScriptEmitter).
|
|
2168
|
-
protoOf(TypeScriptEmitter).
|
|
2169
|
-
protoOf(TypeScriptEmitter).
|
|
2124
|
+
protoOf(TypeScriptEmitter).up = emit_3;
|
|
2125
|
+
protoOf(TypeScriptEmitter).vp = emit_6;
|
|
2126
|
+
protoOf(TypeScriptEmitter).wp = emit_7;
|
|
2127
|
+
protoOf(TypeScriptEmitter).xp = emit_4;
|
|
2128
|
+
protoOf(TypeScriptEmitter).yp = emit_5;
|
|
2129
|
+
protoOf(TypeScriptEmitter).ir = emit_8;
|
|
2130
|
+
protoOf(TypeScriptEmitter).dr = emit_10;
|
|
2131
|
+
protoOf(TypeScriptEmitter).jr = emit_9;
|
|
2132
|
+
protoOf(TypeScriptEmitter).wq = emit_2;
|
|
2133
|
+
protoOf(TypeScriptEmitter).kr = emitValidator;
|
|
2134
|
+
protoOf(TypeScriptEmitter).n20 = sanitizeSymbol;
|
|
2135
|
+
protoOf(TypeScriptEmitter).w1v = sanitizeSymbol_0;
|
|
2136
|
+
protoOf(TypeScriptEmitter).o20 = emitPrimitive;
|
|
2137
|
+
protoOf(TypeScriptEmitter).m20 = emitClient;
|
|
2138
|
+
protoOf(TypeScriptEmitter).aq = emitClientEndpointRequest;
|
|
2170
2139
|
//endregion
|
|
2171
2140
|
//region block: exports
|
|
2172
2141
|
export {
|