@flock/wirespec 0.18.6 → 0.18.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.mjs +11 -11
- package/arrow-arrow-core.mjs +141 -141
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt.mjs +1395 -1395
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +442 -442
- package/kotlin-kotlin-stdlib.mjs +1051 -943
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +20812 -6818
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1797 -1797
- package/kotlinx-io-kotlinx-io-core.mjs +405 -405
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1960 -1763
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1882 -1407
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1269 -1269
- package/package.json +3 -2
- package/wirespec-lsp.mjs +7 -0
- package/wirespec-src-compiler-core.mjs +1708 -1644
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +444 -409
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +325 -290
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +340 -342
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +370 -372
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +155 -157
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +372 -372
- package/wirespec-src-compiler-emitters-wirespec.mjs +83 -83
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3211 -3312
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +399 -399
- package/wirespec-src-converter-avro.mjs +507 -507
- package/wirespec-src-converter-openapi.mjs +1487 -1413
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +4928 -0
- package/wirespec-src-ide-lsp.mjs.map +1 -0
- package/wirespec-src-plugin-arguments.mjs +175 -175
- package/wirespec-src-plugin-cli.mjs +102 -102
- package/wirespec-src-plugin-npm.d.mts +2 -0
- package/wirespec-src-plugin-npm.mjs +42 -37
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +32 -32
|
@@ -169,7 +169,7 @@ function emit_2(identifier) {
|
|
|
169
169
|
}
|
|
170
170
|
initMetadataForInterface(TypeScriptIdentifierEmitter, 'TypeScriptIdentifierEmitter');
|
|
171
171
|
function sanitizeSymbol(_this__u8e3s4) {
|
|
172
|
-
return this.
|
|
172
|
+
return this.u1v(_this__u8e3s4.l1());
|
|
173
173
|
}
|
|
174
174
|
function sanitizeSymbol_0(_this__u8e3s4) {
|
|
175
175
|
var tmp = asSequence(_this__u8e3s4);
|
|
@@ -183,7 +183,7 @@ function emit_3(type, module_0) {
|
|
|
183
183
|
var _iterator__ex2g4s = this_0.t();
|
|
184
184
|
while (_iterator__ex2g4s.u()) {
|
|
185
185
|
var e = _iterator__ex2g4s.v();
|
|
186
|
-
var key = e.
|
|
186
|
+
var key = e.pu_1;
|
|
187
187
|
if (set.x(key)) {
|
|
188
188
|
list.x(e);
|
|
189
189
|
}
|
|
@@ -194,19 +194,19 @@ function emit_3(type, module_0) {
|
|
|
194
194
|
var _iterator__ex2g4s_0 = list.t();
|
|
195
195
|
while (_iterator__ex2g4s_0.u()) {
|
|
196
196
|
var item = _iterator__ex2g4s_0.v();
|
|
197
|
-
var tmp$ret$2 = 'import {' + item.
|
|
197
|
+
var tmp$ret$2 = 'import {' + item.pu_1 + "} from './" + item.pu_1 + "'";
|
|
198
198
|
destination.x(tmp$ret$2);
|
|
199
199
|
}
|
|
200
200
|
var tmp = destination;
|
|
201
|
-
return trimMargin('\n |' + joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda) + '\n |export type ' + this.
|
|
201
|
+
return trimMargin('\n |' + joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda) + '\n |export type ' + this.c1z(type.zo_1) + ' = {\n |' + this.zp(type.ap_1) + '\n |}\n |\n ');
|
|
202
202
|
}
|
|
203
203
|
function emit_4(_this__u8e3s4) {
|
|
204
204
|
var tmp;
|
|
205
205
|
if (_this__u8e3s4 instanceof Dict) {
|
|
206
|
-
tmp = 'Record<string, ' + this.
|
|
206
|
+
tmp = 'Record<string, ' + this.bq(_this__u8e3s4.go_1) + '>';
|
|
207
207
|
} else {
|
|
208
208
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
209
|
-
tmp = this.
|
|
209
|
+
tmp = this.bq(_this__u8e3s4.do_1) + '[]';
|
|
210
210
|
} else {
|
|
211
211
|
if (_this__u8e3s4 instanceof Unit) {
|
|
212
212
|
tmp = 'void';
|
|
@@ -215,10 +215,10 @@ function emit_4(_this__u8e3s4) {
|
|
|
215
215
|
tmp = 'any';
|
|
216
216
|
} else {
|
|
217
217
|
if (_this__u8e3s4 instanceof Custom) {
|
|
218
|
-
tmp = this.
|
|
218
|
+
tmp = this.u1v(_this__u8e3s4.pu_1);
|
|
219
219
|
} else {
|
|
220
220
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
221
|
-
tmp = this.
|
|
221
|
+
tmp = this.d1z(_this__u8e3s4);
|
|
222
222
|
} else {
|
|
223
223
|
noWhenBranchMatchedException();
|
|
224
224
|
}
|
|
@@ -228,10 +228,10 @@ function emit_4(_this__u8e3s4) {
|
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
// Inline function 'kotlin.let' call
|
|
231
|
-
return tmp + (_this__u8e3s4.
|
|
231
|
+
return tmp + (_this__u8e3s4.hu() ? ' | undefined' : '');
|
|
232
232
|
}
|
|
233
233
|
function emitPrimitive(_this__u8e3s4) {
|
|
234
|
-
var tmp0_subject = _this__u8e3s4.
|
|
234
|
+
var tmp0_subject = _this__u8e3s4.tu_1;
|
|
235
235
|
var tmp;
|
|
236
236
|
if (tmp0_subject instanceof String_0) {
|
|
237
237
|
tmp = 'string';
|
|
@@ -259,10 +259,10 @@ function emitPrimitive(_this__u8e3s4) {
|
|
|
259
259
|
function emit_5(_this__u8e3s4) {
|
|
260
260
|
var tmp;
|
|
261
261
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
262
|
-
tmp = Spacer_instance.toString() + 'return ' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.
|
|
262
|
+
tmp = Spacer_instance.toString() + 'return ' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.dt_1) + '.test(value);';
|
|
263
263
|
} else {
|
|
264
264
|
if (_this__u8e3s4 instanceof Bound) {
|
|
265
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
265
|
+
var tmp1_safe_receiver = _this__u8e3s4.tt_1;
|
|
266
266
|
var tmp_0;
|
|
267
267
|
if (tmp1_safe_receiver == null) {
|
|
268
268
|
tmp_0 = null;
|
|
@@ -271,7 +271,7 @@ function emit_5(_this__u8e3s4) {
|
|
|
271
271
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
272
272
|
}
|
|
273
273
|
var minCheck = tmp_0;
|
|
274
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
274
|
+
var tmp2_safe_receiver = _this__u8e3s4.ut_1;
|
|
275
275
|
var tmp_1;
|
|
276
276
|
if (tmp2_safe_receiver == null) {
|
|
277
277
|
tmp_1 = null;
|
|
@@ -299,18 +299,18 @@ function emit_5(_this__u8e3s4) {
|
|
|
299
299
|
return tmp;
|
|
300
300
|
}
|
|
301
301
|
function emit_6(_this__u8e3s4) {
|
|
302
|
-
return joinToString(_this__u8e3s4.
|
|
302
|
+
return joinToString(_this__u8e3s4.wo_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda_0(this));
|
|
303
303
|
}
|
|
304
304
|
function emit_7(_this__u8e3s4) {
|
|
305
|
-
return Spacer_instance.toString() + this.
|
|
305
|
+
return Spacer_instance.toString() + this.br(_this__u8e3s4.ep_1) + ': ' + this.bq(_this__u8e3s4.fp_1);
|
|
306
306
|
}
|
|
307
307
|
initMetadataForInterface(TypeScriptTypeDefinitionEmitter, 'TypeScriptTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, TypeScriptIdentifierEmitter]);
|
|
308
308
|
function emitClient(ast) {
|
|
309
|
-
var tmp = 'client.' + this.
|
|
310
|
-
var tmp_0 = this.
|
|
309
|
+
var tmp = 'client.' + this.iq().rq_1;
|
|
310
|
+
var tmp_0 = this.eq(ast);
|
|
311
311
|
var tmp_1 = joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, TypeScriptClientEmitter$emitClient$lambda);
|
|
312
312
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
313
|
-
var this_0 = ast.
|
|
313
|
+
var this_0 = ast.fq_1;
|
|
314
314
|
// Inline function 'kotlin.collections.flatMap' call
|
|
315
315
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
316
316
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -318,7 +318,7 @@ function emitClient(ast) {
|
|
|
318
318
|
var _iterator__ex2g4s = tmp0.t();
|
|
319
319
|
while (_iterator__ex2g4s.u()) {
|
|
320
320
|
var element = _iterator__ex2g4s.v();
|
|
321
|
-
var list = new NonEmptyList(element.
|
|
321
|
+
var list = new NonEmptyList(element.hq_1);
|
|
322
322
|
addAll(destination, list);
|
|
323
323
|
}
|
|
324
324
|
var tmp$ret$3 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -338,14 +338,14 @@ function emitClient(ast) {
|
|
|
338
338
|
var _iterator__ex2g4s_1 = destination_0.t();
|
|
339
339
|
while (_iterator__ex2g4s_1.u()) {
|
|
340
340
|
var e = _iterator__ex2g4s_1.v();
|
|
341
|
-
var key = e.
|
|
341
|
+
var key = e.pu_1;
|
|
342
342
|
if (set.x(key)) {
|
|
343
343
|
list_1.x(e);
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
var tmp_2 = list_1;
|
|
347
347
|
var tmp_3 = joinToString(tmp_2, '\n', VOID, VOID, VOID, VOID, TypeScriptClientEmitter$emitClient$lambda_0);
|
|
348
|
-
var tmp_4 = this.
|
|
348
|
+
var tmp_4 = this.eq(ast);
|
|
349
349
|
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 '));
|
|
350
350
|
}
|
|
351
351
|
initMetadataForInterface(TypeScriptClientEmitter, 'TypeScriptClientEmitter', VOID, VOID, [ClientEmitter, TypeScriptTypeDefinitionEmitter]);
|
|
@@ -357,7 +357,7 @@ function emit_8(endpoint) {
|
|
|
357
357
|
var _iterator__ex2g4s = this_0.t();
|
|
358
358
|
while (_iterator__ex2g4s.u()) {
|
|
359
359
|
var e = _iterator__ex2g4s.v();
|
|
360
|
-
var key = e.
|
|
360
|
+
var key = e.pu_1;
|
|
361
361
|
if (set.x(key)) {
|
|
362
362
|
list.x(e);
|
|
363
363
|
}
|
|
@@ -368,64 +368,64 @@ function emit_8(endpoint) {
|
|
|
368
368
|
var _iterator__ex2g4s_0 = list.t();
|
|
369
369
|
while (_iterator__ex2g4s_0.u()) {
|
|
370
370
|
var item = _iterator__ex2g4s_0.v();
|
|
371
|
-
var tmp$ret$2 = 'import {type ' + item.
|
|
371
|
+
var tmp$ret$2 = 'import {type ' + item.pu_1 + "} from '../model'";
|
|
372
372
|
destination.x(tmp$ret$2);
|
|
373
373
|
}
|
|
374
374
|
var tmp = destination;
|
|
375
375
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda);
|
|
376
|
-
var tmp_1 = this.
|
|
376
|
+
var tmp_1 = this.c1z(endpoint.ip_1);
|
|
377
377
|
var tmp_2 = get_pathParams(endpoint);
|
|
378
378
|
var tmp_3 = emitType(this, tmp_2, 'Path', TypeScriptEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
379
|
-
var tmp_4 = emitType(this, endpoint.
|
|
380
|
-
var tmp_5 = emitType(this, endpoint.
|
|
381
|
-
var tmp_6 = emitType_1(this, first(endpoint.
|
|
382
|
-
var tmp_7 = distinctByStatus(endpoint.
|
|
379
|
+
var tmp_4 = emitType(this, endpoint.lp_1, 'Queries', TypeScriptEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
380
|
+
var tmp_5 = emitType(this, endpoint.mp_1, 'Headers', TypeScriptEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
381
|
+
var tmp_6 = emitType_1(this, first(endpoint.np_1), endpoint);
|
|
382
|
+
var tmp_7 = distinctByStatus(endpoint.op_1);
|
|
383
383
|
var tmp_8 = joinToString(tmp_7, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
384
384
|
var tmp_9 = Spacer_instance.toString();
|
|
385
|
-
var tmp_10 = distinctByStatus(endpoint.
|
|
385
|
+
var tmp_10 = distinctByStatus(endpoint.op_1);
|
|
386
386
|
var tmp_11 = joinToString(tmp_10, ' | ', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_4(this));
|
|
387
|
-
var tmp_12 = emitFunction_0(this, first(endpoint.
|
|
388
|
-
var tmp_13 = distinctByStatus(endpoint.
|
|
387
|
+
var tmp_12 = emitFunction_0(this, first(endpoint.np_1), endpoint);
|
|
388
|
+
var tmp_13 = distinctByStatus(endpoint.op_1);
|
|
389
389
|
var tmp_14 = joinToString(tmp_13, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
390
390
|
var tmp_15 = Spacer_instance.toString();
|
|
391
|
-
var tmp_16 = Spacer_instance.
|
|
391
|
+
var tmp_16 = Spacer_instance.vr(2);
|
|
392
392
|
var tmp_17 = emitHandleFunction(this, endpoint);
|
|
393
393
|
var tmp_18 = Spacer_instance.toString();
|
|
394
|
-
var tmp_19 = prependIndent(emitClient_0(this, endpoint), Spacer_instance.
|
|
395
|
-
var tmp_20 = prependIndent(emitServer(this, endpoint), Spacer_instance.
|
|
394
|
+
var tmp_19 = prependIndent(emitClient_0(this, endpoint), Spacer_instance.vr(1));
|
|
395
|
+
var tmp_20 = prependIndent(emitServer(this, endpoint), Spacer_instance.vr(1));
|
|
396
396
|
var tmp_21 = Spacer_instance.toString();
|
|
397
|
-
var tmp_22 = Spacer_instance.
|
|
398
|
-
var tmp_23 = Companion_instance_0.
|
|
399
|
-
var tmp_24 = Spacer_instance.
|
|
400
|
-
var tmp_25 = Spacer_instance.
|
|
401
|
-
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.
|
|
397
|
+
var tmp_22 = Spacer_instance.vr(2);
|
|
398
|
+
var tmp_23 = Companion_instance_0.tq(this.c1z(endpoint.ip_1));
|
|
399
|
+
var tmp_24 = Spacer_instance.vr(2);
|
|
400
|
+
var tmp_25 = Spacer_instance.vr(2);
|
|
401
|
+
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.jp_1.a3_1 + '",\n |' + tmp_25 + 'path: "' + joinToString(endpoint.kp_1, '/', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_6(this)) + '",\n |' + Spacer_instance.vr(2) + 'server,\n |' + Spacer_instance.vr(2) + 'client\n |' + Spacer_instance.toString() + '} as const\n |}\n |\n ');
|
|
402
402
|
}
|
|
403
403
|
initMetadataForInterface(TypeScriptEndpointDefinitionEmitter, 'TypeScriptEndpointDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
404
404
|
function emit_9(refined) {
|
|
405
|
-
return trimMargin('\n |export type ' + this.
|
|
405
|
+
return trimMargin('\n |export type ' + this.c1z(refined.gr_1) + ' = ' + this.bq(refined.hr_1) + ';\n |export const validate' + refined.gr_1.l1() + ' = (value: ' + this.bq(refined.hr_1) + '): value is ' + this.c1z(refined.gr_1) + ' => {\n |' + this.pr(refined) + '\n |}\n |\n ');
|
|
406
406
|
}
|
|
407
407
|
function emitValidator(_this__u8e3s4) {
|
|
408
408
|
var defaultReturn = Spacer_instance.toString() + 'return true;';
|
|
409
|
-
var type = _this__u8e3s4.
|
|
409
|
+
var type = _this__u8e3s4.hr_1.tu_1;
|
|
410
410
|
var tmp;
|
|
411
411
|
if (type instanceof Integer) {
|
|
412
|
-
var tmp0_safe_receiver = type.
|
|
413
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
412
|
+
var tmp0_safe_receiver = type.yt_1;
|
|
413
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.cq(tmp0_safe_receiver);
|
|
414
414
|
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
415
415
|
} else {
|
|
416
416
|
if (type instanceof Number_0) {
|
|
417
|
-
var tmp2_safe_receiver = type.
|
|
418
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.
|
|
417
|
+
var tmp2_safe_receiver = type.bu_1;
|
|
418
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.cq(tmp2_safe_receiver);
|
|
419
419
|
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
420
420
|
} else {
|
|
421
421
|
if (type instanceof String_0) {
|
|
422
|
-
var tmp4_safe_receiver = type.
|
|
422
|
+
var tmp4_safe_receiver = type.vt_1;
|
|
423
423
|
var tmp_0;
|
|
424
424
|
var tmp_1 = tmp4_safe_receiver;
|
|
425
425
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
426
426
|
tmp_0 = null;
|
|
427
427
|
} else {
|
|
428
|
-
tmp_0 = this.
|
|
428
|
+
tmp_0 = this.cq(new RegExp_0(tmp4_safe_receiver));
|
|
429
429
|
}
|
|
430
430
|
var tmp5_elvis_lhs = tmp_0;
|
|
431
431
|
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
@@ -446,11 +446,11 @@ function emitValidator(_this__u8e3s4) {
|
|
|
446
446
|
}
|
|
447
447
|
initMetadataForInterface(TypeScriptRefinedTypeDefinitionEmitter, 'TypeScriptRefinedTypeDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
448
448
|
function emit_10(enum_0, module_0) {
|
|
449
|
-
var tmp = this.
|
|
450
|
-
return 'export type ' + tmp + ' = ' + joinToString(enum_0.
|
|
449
|
+
var tmp = this.c1z(enum_0.lr_1);
|
|
450
|
+
return 'export type ' + tmp + ' = ' + joinToString(enum_0.mr_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEnumDefinitionEmitter$emit$lambda) + '\n';
|
|
451
451
|
}
|
|
452
452
|
initMetadataForInterface(TypeScriptEnumDefinitionEmitter, 'TypeScriptEnumDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
453
|
-
initMetadataForClass(TypeScriptEmitter, 'TypeScriptEmitter', TypeScriptEmitter, LanguageEmitter, [LanguageEmitter, TypeScriptEndpointDefinitionEmitter, TypeScriptRefinedTypeDefinitionEmitter,
|
|
453
|
+
initMetadataForClass(TypeScriptEmitter, 'TypeScriptEmitter', TypeScriptEmitter, LanguageEmitter, [LanguageEmitter, TypeScriptTypeDefinitionEmitter, TypeScriptEndpointDefinitionEmitter, TypeScriptRefinedTypeDefinitionEmitter, TypeScriptEnumDefinitionEmitter, TypeScriptClientEmitter, TypeScriptIdentifierEmitter]);
|
|
454
454
|
initMetadataForClass(EndpointParam, 'EndpointParam');
|
|
455
455
|
initMetadataForCompanion(Companion);
|
|
456
456
|
initMetadataForClass(TypeScriptIrEmitter, 'TypeScriptIrEmitter', TypeScriptIrEmitter, VOID, [IrEmitter]);
|
|
@@ -486,10 +486,10 @@ function emitClientInterface($this, _this__u8e3s4, endpoint) {
|
|
|
486
486
|
return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
487
487
|
}
|
|
488
488
|
function emitFunction($this, endpoint, request) {
|
|
489
|
-
var tmp = endpoint.
|
|
489
|
+
var tmp = endpoint.ip_1.l1();
|
|
490
490
|
var tmp_0 = emitClientInterface($this, request, endpoint);
|
|
491
491
|
var tmp_1 = Spacer_instance.toString();
|
|
492
|
-
var tmp_2 = endpoint.
|
|
492
|
+
var tmp_2 = endpoint.ip_1.l1();
|
|
493
493
|
// Inline function 'kotlin.takeIf' call
|
|
494
494
|
var this_0 = paramList(request, endpoint);
|
|
495
495
|
var tmp_3;
|
|
@@ -509,31 +509,31 @@ function emitFunction($this, endpoint, request) {
|
|
|
509
509
|
// Inline function 'kotlin.text.orEmpty' call
|
|
510
510
|
var tmp0_elvis_lhs = tmp_4;
|
|
511
511
|
var tmp$ret$5 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
512
|
-
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.
|
|
512
|
+
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.ip_1.l1() + '.client(serialization).to(req)\n |' + Spacer_instance.toString() + 'const rawResponse = await handler(rawRequest)\n |' + Spacer_instance.toString() + 'return ' + endpoint.ip_1.l1() + '.client(serialization).from(rawResponse)\n |},\n ');
|
|
513
513
|
}
|
|
514
514
|
function TypeScriptClientEmitter$emitClient$lambda(_destruct__k2r9zo) {
|
|
515
|
-
var endpoint = _destruct__k2r9zo.
|
|
516
|
-
return 'import {' + endpoint.
|
|
515
|
+
var endpoint = _destruct__k2r9zo.qe();
|
|
516
|
+
return 'import {' + endpoint.ip_1.l1() + '} from "./endpoint/' + endpoint.ip_1.l1() + '"';
|
|
517
517
|
}
|
|
518
518
|
function TypeScriptClientEmitter$emitClient$lambda_0(it) {
|
|
519
|
-
return 'import {type ' + it.
|
|
519
|
+
return 'import {type ' + it.pu_1 + '} from "./model/' + it.pu_1 + '"';
|
|
520
520
|
}
|
|
521
521
|
function TypeScriptClientEmitter$emitClient$lambda_1(this$0) {
|
|
522
522
|
return function (_destruct__k2r9zo) {
|
|
523
|
-
var endpoint = _destruct__k2r9zo.
|
|
524
|
-
var request = _destruct__k2r9zo.
|
|
523
|
+
var endpoint = _destruct__k2r9zo.qe();
|
|
524
|
+
var request = _destruct__k2r9zo.re();
|
|
525
525
|
return emitFunction(this$0, endpoint, request);
|
|
526
526
|
};
|
|
527
527
|
}
|
|
528
528
|
function TypeScriptClientEmitter$emitClientInterface$lambda(this$0) {
|
|
529
529
|
return function (it) {
|
|
530
|
-
return this$0.
|
|
530
|
+
return this$0.br(it.nq_1) + ': ' + this$0.bq(it.oq_1);
|
|
531
531
|
};
|
|
532
532
|
}
|
|
533
533
|
function TypeScriptClientEmitter() {
|
|
534
534
|
}
|
|
535
535
|
function TypeScriptEmitter$emit$lambda(it) {
|
|
536
|
-
return 'export {' + it.
|
|
536
|
+
return 'export {' + it.ar().l1() + "} from './" + it.ar().l1() + "'";
|
|
537
537
|
}
|
|
538
538
|
function TypeScriptEmitter$emit$lambda_0(it) {
|
|
539
539
|
// Inline function 'kotlin.text.trimStart' call
|
|
@@ -541,36 +541,36 @@ function TypeScriptEmitter$emit$lambda_0(it) {
|
|
|
541
541
|
}
|
|
542
542
|
function TypeScriptEmitter$emit$lambda_1(this$0) {
|
|
543
543
|
return function (it) {
|
|
544
|
-
return this$0.
|
|
544
|
+
return this$0.bq(it);
|
|
545
545
|
};
|
|
546
546
|
}
|
|
547
547
|
function TypeScriptEmitter() {
|
|
548
548
|
LanguageEmitter.call(this);
|
|
549
|
-
this.
|
|
550
|
-
this.
|
|
551
|
-
this.
|
|
549
|
+
this.e1z_1 = FileExtension_TypeScript_getInstance();
|
|
550
|
+
this.f1z_1 = TypeScriptShared_getInstance();
|
|
551
|
+
this.g1z_1 = '//';
|
|
552
552
|
}
|
|
553
|
-
protoOf(TypeScriptEmitter).
|
|
554
|
-
return this.
|
|
553
|
+
protoOf(TypeScriptEmitter).iq = function () {
|
|
554
|
+
return this.e1z_1;
|
|
555
555
|
};
|
|
556
|
-
protoOf(TypeScriptEmitter).
|
|
557
|
-
return this.
|
|
556
|
+
protoOf(TypeScriptEmitter).r1v = function () {
|
|
557
|
+
return this.f1z_1;
|
|
558
558
|
};
|
|
559
|
-
protoOf(TypeScriptEmitter).
|
|
560
|
-
return this.
|
|
559
|
+
protoOf(TypeScriptEmitter).jq = function () {
|
|
560
|
+
return this.g1z_1;
|
|
561
561
|
};
|
|
562
|
-
protoOf(TypeScriptEmitter).
|
|
562
|
+
protoOf(TypeScriptEmitter).sn = function (ast, logger) {
|
|
563
563
|
// Inline function 'kotlin.run' call
|
|
564
|
-
var $this$run = protoOf(LanguageEmitter).
|
|
564
|
+
var $this$run = protoOf(LanguageEmitter).sn.call(this, ast, logger);
|
|
565
565
|
var tmp;
|
|
566
566
|
if (hasEndpoints(ast)) {
|
|
567
|
-
tmp = NonEmptyList__plus_impl_xqmb9($this$run, this.
|
|
567
|
+
tmp = NonEmptyList__plus_impl_xqmb9($this$run, this.b1z(ast));
|
|
568
568
|
} else {
|
|
569
569
|
tmp = $this$run;
|
|
570
570
|
}
|
|
571
571
|
var tmp_0 = tmp;
|
|
572
572
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
573
|
-
var this_0 = ast.
|
|
573
|
+
var this_0 = ast.fq_1;
|
|
574
574
|
// Inline function 'kotlin.collections.flatMap' call
|
|
575
575
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
576
576
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -578,7 +578,7 @@ protoOf(TypeScriptEmitter).on = function (ast, logger) {
|
|
|
578
578
|
var _iterator__ex2g4s = tmp0.t();
|
|
579
579
|
while (_iterator__ex2g4s.u()) {
|
|
580
580
|
var element = _iterator__ex2g4s.v();
|
|
581
|
-
var list = new NonEmptyList(element.
|
|
581
|
+
var list = new NonEmptyList(element.hq_1);
|
|
582
582
|
addAll(destination, list);
|
|
583
583
|
}
|
|
584
584
|
var tmp$ret$5 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -595,7 +595,7 @@ protoOf(TypeScriptEmitter).on = function (ast, logger) {
|
|
|
595
595
|
var tmp_1;
|
|
596
596
|
if (value == null) {
|
|
597
597
|
var answer = ArrayList_init_$Create$();
|
|
598
|
-
destination_0.
|
|
598
|
+
destination_0.s2(key, answer);
|
|
599
599
|
tmp_1 = answer;
|
|
600
600
|
} else {
|
|
601
601
|
tmp_1 = value;
|
|
@@ -614,24 +614,24 @@ protoOf(TypeScriptEmitter).on = function (ast, logger) {
|
|
|
614
614
|
var ns = item.k1();
|
|
615
615
|
// Inline function 'kotlin.collections.component2' call
|
|
616
616
|
var defs = item.l1();
|
|
617
|
-
var tmp_2 = ns + '/index.' + this.
|
|
617
|
+
var tmp_2 = ns + '/index.' + this.iq().rq_1;
|
|
618
618
|
var tmp$ret$14 = new Emitted(tmp_2, joinToString(defs, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda));
|
|
619
619
|
destination_1.x(tmp$ret$14);
|
|
620
620
|
}
|
|
621
621
|
return NonEmptyList__plus_impl_xqmb9_0(tmp_0, destination_1);
|
|
622
622
|
};
|
|
623
|
-
protoOf(TypeScriptEmitter).
|
|
623
|
+
protoOf(TypeScriptEmitter).yq = function (module_0, logger) {
|
|
624
624
|
// Inline function 'kotlin.let' call
|
|
625
|
-
var it = protoOf(LanguageEmitter).
|
|
626
|
-
return NonEmptyList__plus_impl_xqmb9(it, new Emitted('Wirespec', this.
|
|
625
|
+
var it = protoOf(LanguageEmitter).yq.call(this, module_0, logger);
|
|
626
|
+
return NonEmptyList__plus_impl_xqmb9(it, new Emitted('Wirespec', this.r1v().i1z_1));
|
|
627
627
|
};
|
|
628
|
-
protoOf(TypeScriptEmitter).
|
|
628
|
+
protoOf(TypeScriptEmitter).zq = function (definition, module_0, logger) {
|
|
629
629
|
// Inline function 'kotlin.let' call
|
|
630
|
-
var it = protoOf(LanguageEmitter).
|
|
631
|
-
var subPackageName = plus(Companion_instance.
|
|
632
|
-
return new Emitted(subPackageName.
|
|
630
|
+
var it = protoOf(LanguageEmitter).zq.call(this, definition, module_0, logger);
|
|
631
|
+
var subPackageName = plus(Companion_instance.qr(''), definition);
|
|
632
|
+
return new Emitted(subPackageName.tr() + this.u1v(it.mo_1), trimMargin("\n |import {Wirespec} from '../Wirespec'\n |\n |" + it.no_1 + '\n '));
|
|
633
633
|
};
|
|
634
|
-
protoOf(TypeScriptEmitter).
|
|
634
|
+
protoOf(TypeScriptEmitter).dr = function (union) {
|
|
635
635
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
636
636
|
var this_0 = importReferences(union);
|
|
637
637
|
var set = HashSet_init_$Create$();
|
|
@@ -639,7 +639,7 @@ protoOf(TypeScriptEmitter).yq = function (union) {
|
|
|
639
639
|
var _iterator__ex2g4s = this_0.t();
|
|
640
640
|
while (_iterator__ex2g4s.u()) {
|
|
641
641
|
var e = _iterator__ex2g4s.v();
|
|
642
|
-
var key = e.
|
|
642
|
+
var key = e.pu_1;
|
|
643
643
|
if (set.x(key)) {
|
|
644
644
|
list.x(e);
|
|
645
645
|
}
|
|
@@ -650,24 +650,24 @@ protoOf(TypeScriptEmitter).yq = function (union) {
|
|
|
650
650
|
var _iterator__ex2g4s_0 = list.t();
|
|
651
651
|
while (_iterator__ex2g4s_0.u()) {
|
|
652
652
|
var item = _iterator__ex2g4s_0.v();
|
|
653
|
-
var tmp$ret$2 = 'import {type ' + item.
|
|
653
|
+
var tmp$ret$2 = 'import {type ' + item.pu_1 + "} from '../model'";
|
|
654
654
|
destination.x(tmp$ret$2);
|
|
655
655
|
}
|
|
656
656
|
var tmp = destination;
|
|
657
657
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda_0);
|
|
658
|
-
var tmp_1 = this.
|
|
659
|
-
return trimMargin('\n |' + tmp_0 + '\n |export type ' + tmp_1 + ' = ' + joinToString(union.
|
|
658
|
+
var tmp_1 = this.c1z(union.uo_1);
|
|
659
|
+
return trimMargin('\n |' + tmp_0 + '\n |export type ' + tmp_1 + ' = ' + joinToString(union.vo_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda_1(this)) + '\n |\n ');
|
|
660
660
|
};
|
|
661
|
-
protoOf(TypeScriptEmitter).
|
|
662
|
-
return this.
|
|
661
|
+
protoOf(TypeScriptEmitter).cr = function (channel) {
|
|
662
|
+
return this.kq();
|
|
663
663
|
};
|
|
664
664
|
function emit_11($this, _this__u8e3s4) {
|
|
665
665
|
var tmp;
|
|
666
666
|
if (_this__u8e3s4 instanceof Literal) {
|
|
667
|
-
tmp = _this__u8e3s4.
|
|
667
|
+
tmp = _this__u8e3s4.lq_1;
|
|
668
668
|
} else {
|
|
669
669
|
if (_this__u8e3s4 instanceof Param) {
|
|
670
|
-
tmp = ':' + _this__u8e3s4.
|
|
670
|
+
tmp = ':' + _this__u8e3s4.pp_1.l1();
|
|
671
671
|
} else {
|
|
672
672
|
noWhenBranchMatchedException();
|
|
673
673
|
}
|
|
@@ -675,64 +675,64 @@ function emit_11($this, _this__u8e3s4) {
|
|
|
675
675
|
return tmp;
|
|
676
676
|
}
|
|
677
677
|
function emitClient_0($this, _this__u8e3s4) {
|
|
678
|
-
return trimMargin('\n |export const client: Wirespec.Client<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitClientTo($this, _this__u8e3s4), Spacer_instance.
|
|
678
|
+
return trimMargin('\n |export const client: Wirespec.Client<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitClientTo($this, _this__u8e3s4), Spacer_instance.vr(1)) + ',\n |' + prependIndent(emitClientFrom($this, _this__u8e3s4), Spacer_instance.vr(1)) + '\n |})\n ');
|
|
679
679
|
}
|
|
680
680
|
function emitClientTo($this, _this__u8e3s4) {
|
|
681
|
-
var tmp = Spacer_instance.
|
|
681
|
+
var tmp = Spacer_instance.vr(1);
|
|
682
682
|
// Inline function 'kotlin.text.uppercase' call
|
|
683
683
|
// Inline function 'kotlin.js.asDynamic' call
|
|
684
|
-
var tmp_0 = _this__u8e3s4.
|
|
685
|
-
var tmp_1 = Spacer_instance.
|
|
684
|
+
var tmp_0 = _this__u8e3s4.jp_1.a3_1.toUpperCase();
|
|
685
|
+
var tmp_1 = Spacer_instance.vr(1);
|
|
686
686
|
var tmp_2 = emitPathArray($this, _this__u8e3s4);
|
|
687
|
-
var tmp_3 = Spacer_instance.
|
|
688
|
-
var tmp_4 = joinToString(_this__u8e3s4.
|
|
689
|
-
var tmp_5 = Spacer_instance.
|
|
690
|
-
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.
|
|
687
|
+
var tmp_3 = Spacer_instance.vr(1);
|
|
688
|
+
var tmp_4 = joinToString(_this__u8e3s4.lp_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientTo$lambda($this));
|
|
689
|
+
var tmp_5 = Spacer_instance.vr(1);
|
|
690
|
+
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.mp_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientTo$lambda_0($this)) + '},\n |' + Spacer_instance.vr(1) + 'body: serialization.serialize(it.body)\n |})\n ');
|
|
691
691
|
}
|
|
692
692
|
function emitClientFrom($this, _this__u8e3s4) {
|
|
693
|
-
var tmp = Spacer_instance.
|
|
694
|
-
var tmp_0 = distinctByStatus(_this__u8e3s4.
|
|
695
|
-
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.
|
|
693
|
+
var tmp = Spacer_instance.vr(1);
|
|
694
|
+
var tmp_0 = distinctByStatus(_this__u8e3s4.op_1);
|
|
695
|
+
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.vr(2)) + '\n |' + Spacer_instance.vr(2) + 'default:\n |' + Spacer_instance.vr(3) + 'throw new Error(`Cannot internalize response with status: ${it.status}`);\n |' + Spacer_instance.vr(1) + '}\n |}\n ');
|
|
696
696
|
}
|
|
697
697
|
function emitClientFromResponse($this, _this__u8e3s4) {
|
|
698
|
-
var tmp = fixStatus(_this__u8e3s4.
|
|
699
|
-
var tmp_0 = Spacer_instance.
|
|
700
|
-
var tmp_1 = Spacer_instance.
|
|
701
|
-
var tmp_2 = fixStatus(_this__u8e3s4.
|
|
702
|
-
var tmp_3 = Spacer_instance.
|
|
703
|
-
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.
|
|
698
|
+
var tmp = fixStatus(_this__u8e3s4.up_1);
|
|
699
|
+
var tmp_0 = Spacer_instance.vr(1);
|
|
700
|
+
var tmp_1 = Spacer_instance.vr(2);
|
|
701
|
+
var tmp_2 = fixStatus(_this__u8e3s4.up_1);
|
|
702
|
+
var tmp_3 = Spacer_instance.vr(2);
|
|
703
|
+
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.vp_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientFromResponse$lambda($this)) + '},\n |' + Spacer_instance.vr(2) + 'body: serialization.deserialize<' + emitReference($this, _this__u8e3s4) + '>(it.body)\n |' + Spacer_instance.vr(1) + '};\n ');
|
|
704
704
|
}
|
|
705
705
|
function emitServer($this, _this__u8e3s4) {
|
|
706
|
-
return trimMargin('\n |export const server:Wirespec.Server<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitServerFrom($this, _this__u8e3s4), Spacer_instance.
|
|
706
|
+
return trimMargin('\n |export const server:Wirespec.Server<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitServerFrom($this, _this__u8e3s4), Spacer_instance.vr(1)) + ',\n |' + prependIndent(emitServerTo($this, _this__u8e3s4), Spacer_instance.vr(1)) + '\n |})\n ');
|
|
707
707
|
}
|
|
708
708
|
function emitServerFrom($this, _this__u8e3s4) {
|
|
709
|
-
var tmp = Spacer_instance.
|
|
710
|
-
var tmp_0 = Spacer_instance.
|
|
709
|
+
var tmp = Spacer_instance.vr(1);
|
|
710
|
+
var tmp_0 = Spacer_instance.vr(2);
|
|
711
711
|
// Inline function 'kotlin.text.uppercase' call
|
|
712
712
|
// Inline function 'kotlin.js.asDynamic' call
|
|
713
|
-
var tmp_1 = _this__u8e3s4.
|
|
714
|
-
var tmp_2 = Spacer_instance.
|
|
713
|
+
var tmp_1 = _this__u8e3s4.jp_1.a3_1.toUpperCase();
|
|
714
|
+
var tmp_2 = Spacer_instance.vr(2);
|
|
715
715
|
var tmp_3 = get_indexedPathParams(_this__u8e3s4);
|
|
716
|
-
var tmp_4 = prependIndent(joinToString(tmp_3, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda($this)), Spacer_instance.
|
|
717
|
-
var tmp_5 = Spacer_instance.
|
|
718
|
-
var tmp_6 = Spacer_instance.
|
|
719
|
-
var tmp_7 = joinToString(_this__u8e3s4.
|
|
720
|
-
var tmp_8 = Spacer_instance.
|
|
721
|
-
var tmp_9 = Spacer_instance.
|
|
722
|
-
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.
|
|
716
|
+
var tmp_4 = prependIndent(joinToString(tmp_3, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda($this)), Spacer_instance.vr(3));
|
|
717
|
+
var tmp_5 = Spacer_instance.vr(2);
|
|
718
|
+
var tmp_6 = Spacer_instance.vr(2);
|
|
719
|
+
var tmp_7 = joinToString(_this__u8e3s4.lp_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_0($this));
|
|
720
|
+
var tmp_8 = Spacer_instance.vr(2);
|
|
721
|
+
var tmp_9 = Spacer_instance.vr(2);
|
|
722
|
+
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.mp_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_1($this)) + '\n |' + Spacer_instance.vr(2) + '},\n |' + Spacer_instance.vr(2) + 'body: serialization.deserialize(it.body)\n |' + Spacer_instance.vr(1) + '}\n |}\n ');
|
|
723
723
|
}
|
|
724
724
|
function emitServerTo($this, _this__u8e3s4) {
|
|
725
|
-
var tmp = Spacer_instance.
|
|
726
|
-
var tmp_0 = distinctByStatus(_this__u8e3s4.
|
|
727
|
-
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.
|
|
725
|
+
var tmp = Spacer_instance.vr(1);
|
|
726
|
+
var tmp_0 = distinctByStatus(_this__u8e3s4.op_1);
|
|
727
|
+
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.vr(2)) + '\n |' + Spacer_instance.vr(1) + '}\n |}\n ');
|
|
728
728
|
}
|
|
729
729
|
function emitServerToResponse($this, _this__u8e3s4) {
|
|
730
|
-
var tmp = fixStatus(_this__u8e3s4.
|
|
731
|
-
var tmp_0 = Spacer_instance.
|
|
732
|
-
var tmp_1 = Spacer_instance.
|
|
733
|
-
var tmp_2 = fixStatus(_this__u8e3s4.
|
|
734
|
-
var tmp_3 = Spacer_instance.
|
|
735
|
-
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {\n |' + prependIndent(joinToString(_this__u8e3s4.
|
|
730
|
+
var tmp = fixStatus(_this__u8e3s4.up_1);
|
|
731
|
+
var tmp_0 = Spacer_instance.vr(1);
|
|
732
|
+
var tmp_1 = Spacer_instance.vr(2);
|
|
733
|
+
var tmp_2 = fixStatus(_this__u8e3s4.up_1);
|
|
734
|
+
var tmp_3 = Spacer_instance.vr(2);
|
|
735
|
+
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {\n |' + prependIndent(joinToString(_this__u8e3s4.vp_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerToResponse$lambda($this)), Spacer_instance.vr(3)) + '\n |' + Spacer_instance.vr(2) + '} as Record<string, string>,\n |' + Spacer_instance.vr(2) + 'body: serialization.serialize(it.body),\n |' + Spacer_instance.vr(1) + '};\n ');
|
|
736
736
|
}
|
|
737
737
|
function emitType($this, _this__u8e3s4, name, block) {
|
|
738
738
|
var tmp;
|
|
@@ -745,7 +745,7 @@ function emitType($this, _this__u8e3s4, name, block) {
|
|
|
745
745
|
return tmp;
|
|
746
746
|
}
|
|
747
747
|
function emitName($this, _this__u8e3s4) {
|
|
748
|
-
return 'Response' + Companion_instance_0.
|
|
748
|
+
return 'Response' + Companion_instance_0.sq(_this__u8e3s4.up_1);
|
|
749
749
|
}
|
|
750
750
|
function emitFunction_0($this, _this__u8e3s4, endpoint) {
|
|
751
751
|
var tmp = Spacer_instance.toString();
|
|
@@ -771,18 +771,18 @@ function emitFunction_0($this, _this__u8e3s4, endpoint) {
|
|
|
771
771
|
// Inline function 'kotlin.text.orEmpty' call
|
|
772
772
|
var tmp0_elvis_lhs = tmp_4;
|
|
773
773
|
var tmp_5 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
774
|
-
var tmp_6 = Spacer_instance.
|
|
774
|
+
var tmp_6 = Spacer_instance.vr(2);
|
|
775
775
|
var tmp_7 = get_pathParams(endpoint);
|
|
776
776
|
var tmp_8 = joinToObject($this, tmp_7, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_0($this));
|
|
777
|
-
var tmp_9 = Spacer_instance.
|
|
778
|
-
var tmp_10 = endpoint.
|
|
779
|
-
var tmp_11 = Spacer_instance.
|
|
780
|
-
var tmp_12 = joinToObject($this, endpoint.
|
|
781
|
-
var tmp_13 = Spacer_instance.
|
|
782
|
-
var tmp_14 = joinToObject($this, endpoint.
|
|
783
|
-
var tmp_15 = Spacer_instance.
|
|
777
|
+
var tmp_9 = Spacer_instance.vr(2);
|
|
778
|
+
var tmp_10 = endpoint.jp_1.toString();
|
|
779
|
+
var tmp_11 = Spacer_instance.vr(2);
|
|
780
|
+
var tmp_12 = joinToObject($this, endpoint.lp_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_1($this));
|
|
781
|
+
var tmp_13 = Spacer_instance.vr(2);
|
|
782
|
+
var tmp_14 = joinToObject($this, endpoint.mp_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_2($this));
|
|
783
|
+
var tmp_15 = Spacer_instance.vr(2);
|
|
784
784
|
var tmp_16;
|
|
785
|
-
if (_this__u8e3s4.
|
|
785
|
+
if (_this__u8e3s4.rp_1 == null) {
|
|
786
786
|
tmp_16 = null;
|
|
787
787
|
} else {
|
|
788
788
|
// Inline function 'kotlin.let' call
|
|
@@ -793,11 +793,11 @@ function emitFunction_0($this, _this__u8e3s4, endpoint) {
|
|
|
793
793
|
}
|
|
794
794
|
function emitFunction_1($this, _this__u8e3s4) {
|
|
795
795
|
var tmp = Spacer_instance.toString();
|
|
796
|
-
var tmp_0 = Companion_instance_0.
|
|
796
|
+
var tmp_0 = Companion_instance_0.sq(_this__u8e3s4.up_1);
|
|
797
797
|
var tmp_1 = paramList_0(_this__u8e3s4);
|
|
798
798
|
var tmp_2 = joinToObject($this, tmp_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3($this));
|
|
799
799
|
var tmp_3 = Spacer_instance.toString();
|
|
800
|
-
var tmp_4 = Companion_instance_0.
|
|
800
|
+
var tmp_4 = Companion_instance_0.sq(_this__u8e3s4.up_1);
|
|
801
801
|
// Inline function 'kotlin.takeIf' call
|
|
802
802
|
var this_0 = paramList_0(_this__u8e3s4);
|
|
803
803
|
var tmp_5;
|
|
@@ -812,19 +812,19 @@ function emitFunction_1($this, _this__u8e3s4) {
|
|
|
812
812
|
tmp_6 = null;
|
|
813
813
|
} else {
|
|
814
814
|
// Inline function 'kotlin.run' call
|
|
815
|
-
tmp_6 = 'params: Response' + Companion_instance_0.
|
|
815
|
+
tmp_6 = 'params: Response' + Companion_instance_0.sq(_this__u8e3s4.up_1) + 'Params';
|
|
816
816
|
}
|
|
817
817
|
// Inline function 'kotlin.text.orEmpty' call
|
|
818
818
|
var tmp0_elvis_lhs = tmp_6;
|
|
819
819
|
var tmp_7 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
820
|
-
var tmp_8 = Companion_instance_0.
|
|
821
|
-
var tmp_9 = Spacer_instance.
|
|
822
|
-
var tmp_10 = fixStatus(_this__u8e3s4.
|
|
823
|
-
var tmp_11 = Spacer_instance.
|
|
824
|
-
var tmp_12 = joinToObject($this, _this__u8e3s4.
|
|
825
|
-
var tmp_13 = Spacer_instance.
|
|
820
|
+
var tmp_8 = Companion_instance_0.sq(_this__u8e3s4.up_1);
|
|
821
|
+
var tmp_9 = Spacer_instance.vr(2);
|
|
822
|
+
var tmp_10 = fixStatus(_this__u8e3s4.up_1);
|
|
823
|
+
var tmp_11 = Spacer_instance.vr(2);
|
|
824
|
+
var tmp_12 = joinToObject($this, _this__u8e3s4.vp_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_4($this));
|
|
825
|
+
var tmp_13 = Spacer_instance.vr(2);
|
|
826
826
|
var tmp_14;
|
|
827
|
-
if (_this__u8e3s4.
|
|
827
|
+
if (_this__u8e3s4.wp_1 == null) {
|
|
828
828
|
tmp_14 = null;
|
|
829
829
|
} else {
|
|
830
830
|
// Inline function 'kotlin.let' call
|
|
@@ -834,55 +834,55 @@ function emitFunction_1($this, _this__u8e3s4) {
|
|
|
834
834
|
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 ');
|
|
835
835
|
}
|
|
836
836
|
function emitReference($this, _this__u8e3s4) {
|
|
837
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
838
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
839
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
837
|
+
var tmp0_safe_receiver = _this__u8e3s4.wp_1;
|
|
838
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.tp_1;
|
|
839
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.bq(tmp1_safe_receiver);
|
|
840
840
|
return tmp2_elvis_lhs == null ? 'undefined' : tmp2_elvis_lhs;
|
|
841
841
|
}
|
|
842
842
|
function emitPathArray($this, _this__u8e3s4) {
|
|
843
|
-
return joinToString(_this__u8e3s4.
|
|
843
|
+
return joinToString(_this__u8e3s4.kp_1, ', ', '[', ']', VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda($this));
|
|
844
844
|
}
|
|
845
845
|
function emitType_0($this, _this__u8e3s4) {
|
|
846
846
|
var tmp = Spacer_instance.toString();
|
|
847
847
|
var tmp_0 = emitName($this, _this__u8e3s4);
|
|
848
|
-
var tmp_1 = Spacer_instance.
|
|
849
|
-
var tmp_2 = fixStatus(_this__u8e3s4.
|
|
850
|
-
var tmp_3 = Spacer_instance.
|
|
851
|
-
return trimMargin('\n |' + tmp + 'export type ' + tmp_0 + ' = {\n |' + tmp_1 + 'status: ' + tmp_2 + '\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.
|
|
848
|
+
var tmp_1 = Spacer_instance.vr(2);
|
|
849
|
+
var tmp_2 = fixStatus(_this__u8e3s4.up_1);
|
|
850
|
+
var tmp_3 = Spacer_instance.vr(2);
|
|
851
|
+
return trimMargin('\n |' + tmp + 'export type ' + tmp_0 + ' = {\n |' + tmp_1 + 'status: ' + tmp_2 + '\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.vp_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitType$lambda_0($this)) + '}\n |' + Spacer_instance.vr(2) + 'body: ' + emitReference($this, _this__u8e3s4) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
852
852
|
}
|
|
853
853
|
function emitReference_0($this, _this__u8e3s4) {
|
|
854
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
855
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
856
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
854
|
+
var tmp0_safe_receiver = _this__u8e3s4.rp_1;
|
|
855
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.tp_1;
|
|
856
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.bq(tmp1_safe_receiver);
|
|
857
857
|
return tmp2_elvis_lhs == null ? 'undefined' : tmp2_elvis_lhs;
|
|
858
858
|
}
|
|
859
859
|
function emitType_1($this, _this__u8e3s4, endpoint) {
|
|
860
|
-
return trimMargin('\n |' + Spacer_instance.toString() + 'export type Request = {\n |' + Spacer_instance.
|
|
860
|
+
return trimMargin('\n |' + Spacer_instance.toString() + 'export type Request = {\n |' + Spacer_instance.vr(2) + 'path: Path\n |' + Spacer_instance.vr(2) + 'method: "' + endpoint.jp_1.toString() + '"\n |' + Spacer_instance.vr(2) + 'queries: Queries\n |' + Spacer_instance.vr(2) + 'headers: Headers\n |' + Spacer_instance.vr(2) + 'body: ' + emitReference_0($this, _this__u8e3s4) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
861
861
|
}
|
|
862
862
|
function emit_12($this, _this__u8e3s4) {
|
|
863
|
-
return Spacer_instance.toString() + $this.
|
|
863
|
+
return Spacer_instance.toString() + $this.br(_this__u8e3s4.pp_1) + ': ' + $this.bq(_this__u8e3s4.qp_1);
|
|
864
864
|
}
|
|
865
865
|
function emit_13($this, _this__u8e3s4) {
|
|
866
|
-
return $this.
|
|
866
|
+
return $this.br(_this__u8e3s4.nq_1) + (_this__u8e3s4.oq_1.hu() ? '?' : '') + ': ' + $this.bq(_this__u8e3s4.oq_1.ju(false));
|
|
867
867
|
}
|
|
868
868
|
function emitDeserialize($this, _this__u8e3s4) {
|
|
869
|
-
return $this.
|
|
869
|
+
return $this.br(_this__u8e3s4.pe_1.pp_1) + ': serialization.deserialize(it.path[' + _this__u8e3s4.oe_1 + '])';
|
|
870
870
|
}
|
|
871
871
|
function emitDeserialize_0($this, _this__u8e3s4, fields, caseSensitive) {
|
|
872
|
-
return caseSensitive ? $this.
|
|
872
|
+
return caseSensitive ? $this.br(_this__u8e3s4.ep_1) + ': serialization.deserialize(it.' + fields + '[' + $this.br(_this__u8e3s4.ep_1) + '])' : $this.br(_this__u8e3s4.ep_1) + ': serialization.deserialize(Object.entries(it.' + fields + ').find(([key]) => key.toLowerCase() === ' + $this.br(lowercase($this, _this__u8e3s4.ep_1)) + ')?.[1])';
|
|
873
873
|
}
|
|
874
874
|
function emitDeserialize$default($this, _this__u8e3s4, fields, caseSensitive, $super) {
|
|
875
875
|
caseSensitive = caseSensitive === VOID ? true : caseSensitive;
|
|
876
876
|
return emitDeserialize_0($this, _this__u8e3s4, fields, caseSensitive);
|
|
877
877
|
}
|
|
878
878
|
function emitSerialize($this, _this__u8e3s4, fields) {
|
|
879
|
-
return $this.
|
|
879
|
+
return $this.br(_this__u8e3s4.ep_1) + ': serialization.serialize(it.' + fields + '[' + $this.br(_this__u8e3s4.ep_1) + '])';
|
|
880
880
|
}
|
|
881
881
|
function joinToObject($this, _this__u8e3s4, transform) {
|
|
882
882
|
return joinToString(_this__u8e3s4, ', ', '{', '}', VOID, VOID, transform);
|
|
883
883
|
}
|
|
884
884
|
function emitHandleFunction($this, endpoint) {
|
|
885
|
-
return Companion_instance_0.
|
|
885
|
+
return Companion_instance_0.tq($this.c1z(endpoint.ip_1)) + ': (request:Request) => Promise<Response>';
|
|
886
886
|
}
|
|
887
887
|
function lowercase($this, _this__u8e3s4) {
|
|
888
888
|
// Inline function 'kotlin.text.lowercase' call
|
|
@@ -901,12 +901,12 @@ function TypeScriptEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
|
901
901
|
}
|
|
902
902
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
903
903
|
return function (it) {
|
|
904
|
-
return this$0.
|
|
904
|
+
return this$0.aq(it);
|
|
905
905
|
};
|
|
906
906
|
}
|
|
907
907
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
908
908
|
return function (it) {
|
|
909
|
-
return this$0.
|
|
909
|
+
return this$0.aq(it);
|
|
910
910
|
};
|
|
911
911
|
}
|
|
912
912
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
@@ -956,12 +956,12 @@ function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda(this$0) {
|
|
|
956
956
|
}
|
|
957
957
|
function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_0(this$0) {
|
|
958
958
|
return function (it) {
|
|
959
|
-
return prependIndent(emitDeserialize$default(this$0, it, 'queries'), Spacer_instance.
|
|
959
|
+
return prependIndent(emitDeserialize$default(this$0, it, 'queries'), Spacer_instance.vr(3));
|
|
960
960
|
};
|
|
961
961
|
}
|
|
962
962
|
function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_1(this$0) {
|
|
963
963
|
return function (it) {
|
|
964
|
-
return prependIndent(emitDeserialize_0(this$0, it, 'headers', false), Spacer_instance.
|
|
964
|
+
return prependIndent(emitDeserialize_0(this$0, it, 'headers', false), Spacer_instance.vr(3));
|
|
965
965
|
};
|
|
966
966
|
}
|
|
967
967
|
function TypeScriptEndpointDefinitionEmitter$emitServerTo$lambda(this$0) {
|
|
@@ -976,7 +976,7 @@ function TypeScriptEndpointDefinitionEmitter$emitServerToResponse$lambda(this$0)
|
|
|
976
976
|
}
|
|
977
977
|
function TypeScriptEndpointDefinitionEmitter$emitType$lambda($block) {
|
|
978
978
|
return function (it) {
|
|
979
|
-
return Spacer_instance.
|
|
979
|
+
return Spacer_instance.vr(1) + $block(it);
|
|
980
980
|
};
|
|
981
981
|
}
|
|
982
982
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda(this$0) {
|
|
@@ -986,17 +986,17 @@ function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda(this$0) {
|
|
|
986
986
|
}
|
|
987
987
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_0(this$0) {
|
|
988
988
|
return function (it) {
|
|
989
|
-
return this$0.
|
|
989
|
+
return this$0.br(it.pp_1) + ': params[' + this$0.br(it.pp_1) + ']';
|
|
990
990
|
};
|
|
991
991
|
}
|
|
992
992
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_1(this$0) {
|
|
993
993
|
return function (it) {
|
|
994
|
-
return this$0.
|
|
994
|
+
return this$0.br(it.ep_1) + ': params[' + this$0.br(it.ep_1) + ']';
|
|
995
995
|
};
|
|
996
996
|
}
|
|
997
997
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_2(this$0) {
|
|
998
998
|
return function (it) {
|
|
999
|
-
return this$0.
|
|
999
|
+
return this$0.br(it.ep_1) + ': params[' + this$0.br(it.ep_1) + ']';
|
|
1000
1000
|
};
|
|
1001
1001
|
}
|
|
1002
1002
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3(this$0) {
|
|
@@ -1006,17 +1006,17 @@ function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3(this$0) {
|
|
|
1006
1006
|
}
|
|
1007
1007
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_4(this$0) {
|
|
1008
1008
|
return function (it) {
|
|
1009
|
-
return this$0.
|
|
1009
|
+
return this$0.br(it.ep_1) + ': params[' + this$0.br(it.ep_1) + ']';
|
|
1010
1010
|
};
|
|
1011
1011
|
}
|
|
1012
1012
|
function TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda(this$0) {
|
|
1013
1013
|
return function (it) {
|
|
1014
1014
|
var tmp;
|
|
1015
1015
|
if (it instanceof Literal) {
|
|
1016
|
-
tmp = '"' + it.
|
|
1016
|
+
tmp = '"' + it.lq_1 + '"';
|
|
1017
1017
|
} else {
|
|
1018
1018
|
if (it instanceof Param) {
|
|
1019
|
-
tmp = 'serialization.serialize(it.path[' + this$0.
|
|
1019
|
+
tmp = 'serialization.serialize(it.path[' + this$0.br(it.pp_1) + '])';
|
|
1020
1020
|
} else {
|
|
1021
1021
|
noWhenBranchMatchedException();
|
|
1022
1022
|
}
|
|
@@ -1026,7 +1026,7 @@ function TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda(this$0) {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
function TypeScriptEndpointDefinitionEmitter$emitType$lambda_0(this$0) {
|
|
1028
1028
|
return function (it) {
|
|
1029
|
-
return this$0.
|
|
1029
|
+
return this$0.br(it.ep_1) + ': ' + this$0.bq(it.fp_1);
|
|
1030
1030
|
};
|
|
1031
1031
|
}
|
|
1032
1032
|
function TypeScriptEndpointDefinitionEmitter() {
|
|
@@ -1039,7 +1039,7 @@ function TypeScriptEnumDefinitionEmitter() {
|
|
|
1039
1039
|
function TypeScriptIdentifierEmitter() {
|
|
1040
1040
|
}
|
|
1041
1041
|
function _get_sanitizationConfig__sns434($this) {
|
|
1042
|
-
var tmp0 = $this.
|
|
1042
|
+
var tmp0 = $this.l1z_1;
|
|
1043
1043
|
var tmp = KProperty1;
|
|
1044
1044
|
// Inline function 'kotlin.getValue' call
|
|
1045
1045
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, TypeScriptIrEmitter$_get_sanitizationConfig_$ref_f6f0bh(), null);
|
|
@@ -1067,7 +1067,7 @@ function sanitizeSymbol_1($this, _this__u8e3s4) {
|
|
|
1067
1067
|
return destination.toString();
|
|
1068
1068
|
}
|
|
1069
1069
|
function sanitizeKeywords($this, _this__u8e3s4) {
|
|
1070
|
-
return Companion_getInstance_0().
|
|
1070
|
+
return Companion_getInstance_0().m1z_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1071
1071
|
}
|
|
1072
1072
|
function firstToLower($this, _this__u8e3s4) {
|
|
1073
1073
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
@@ -1089,7 +1089,7 @@ function sanitizeParamName($this, identifier) {
|
|
|
1089
1089
|
var tmp0 = identifier.l1();
|
|
1090
1090
|
// Inline function 'kotlin.text.split' call
|
|
1091
1091
|
// Inline function 'kotlin.collections.filter' call
|
|
1092
|
-
var tmp0_0 = Regex_init_$Create$('[.\\s-]+').
|
|
1092
|
+
var tmp0_0 = Regex_init_$Create$('[.\\s-]+').zc(tmp0, 0);
|
|
1093
1093
|
// Inline function 'kotlin.collections.filterTo' call
|
|
1094
1094
|
var destination = ArrayList_init_$Create$();
|
|
1095
1095
|
var _iterator__ex2g4s = tmp0_0.t();
|
|
@@ -1101,7 +1101,7 @@ function sanitizeParamName($this, identifier) {
|
|
|
1101
1101
|
}
|
|
1102
1102
|
}
|
|
1103
1103
|
var parts = destination;
|
|
1104
|
-
var name = parts.a1() > 1 ? (new Name(parts)).
|
|
1104
|
+
var name = parts.a1() > 1 ? (new Name(parts)).x1l() : identifier.l1();
|
|
1105
1105
|
return sanitizeKeywords($this, sanitizeSymbol_1($this, name));
|
|
1106
1106
|
}
|
|
1107
1107
|
function buildEndpointParams($this, endpoint) {
|
|
@@ -1110,7 +1110,7 @@ function buildEndpointParams($this, endpoint) {
|
|
|
1110
1110
|
// Inline function 'kotlin.apply' call
|
|
1111
1111
|
var this_0 = ArrayList_init_$Create$();
|
|
1112
1112
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1113
|
-
var tmp0 = endpoint.
|
|
1113
|
+
var tmp0 = endpoint.kp_1;
|
|
1114
1114
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1115
1115
|
var destination = ArrayList_init_$Create$();
|
|
1116
1116
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1124,36 +1124,36 @@ function buildEndpointParams($this, endpoint) {
|
|
|
1124
1124
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1125
1125
|
while (_iterator__ex2g4s_0.u()) {
|
|
1126
1126
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
1127
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_0.
|
|
1127
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_0.pp_1), emitTypeScriptReference($this, element_0.qp_1.ju(false)), element_0.qp_1.hu()));
|
|
1128
1128
|
}
|
|
1129
1129
|
// Inline function 'kotlin.collections.forEach' call
|
|
1130
|
-
var _iterator__ex2g4s_1 = endpoint.
|
|
1130
|
+
var _iterator__ex2g4s_1 = endpoint.lp_1.t();
|
|
1131
1131
|
while (_iterator__ex2g4s_1.u()) {
|
|
1132
1132
|
var element_1 = _iterator__ex2g4s_1.v();
|
|
1133
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_1.
|
|
1133
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_1.ep_1), emitTypeScriptReference($this, element_1.fp_1.ju(false)), element_1.fp_1.hu()));
|
|
1134
1134
|
}
|
|
1135
1135
|
// Inline function 'kotlin.collections.forEach' call
|
|
1136
|
-
var _iterator__ex2g4s_2 = endpoint.
|
|
1136
|
+
var _iterator__ex2g4s_2 = endpoint.mp_1.t();
|
|
1137
1137
|
while (_iterator__ex2g4s_2.u()) {
|
|
1138
1138
|
var element_2 = _iterator__ex2g4s_2.v();
|
|
1139
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_2.
|
|
1139
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_2.ep_1), emitTypeScriptReference($this, element_2.fp_1.ju(false)), element_2.fp_1.hu()));
|
|
1140
1140
|
}
|
|
1141
|
-
var tmp0_safe_receiver = first(endpoint.
|
|
1141
|
+
var tmp0_safe_receiver = first(endpoint.np_1).rp_1;
|
|
1142
1142
|
if (tmp0_safe_receiver == null)
|
|
1143
1143
|
null;
|
|
1144
1144
|
else {
|
|
1145
1145
|
// Inline function 'kotlin.let' call
|
|
1146
|
-
this_0.x(new EndpointParam('body', emitTypeScriptReference($this, tmp0_safe_receiver.
|
|
1146
|
+
this_0.x(new EndpointParam('body', emitTypeScriptReference($this, tmp0_safe_receiver.tp_1.ju(false)), tmp0_safe_receiver.tp_1.hu()));
|
|
1147
1147
|
}
|
|
1148
1148
|
return this_0.o5();
|
|
1149
1149
|
}
|
|
1150
1150
|
function emitTypeScriptReference($this, ref) {
|
|
1151
1151
|
var tmp;
|
|
1152
1152
|
if (ref instanceof Dict) {
|
|
1153
|
-
tmp = 'Record<string, ' + emitTypeScriptReference($this, ref.
|
|
1153
|
+
tmp = 'Record<string, ' + emitTypeScriptReference($this, ref.go_1) + '>';
|
|
1154
1154
|
} else {
|
|
1155
1155
|
if (ref instanceof Iterable) {
|
|
1156
|
-
tmp = emitTypeScriptReference($this, ref.
|
|
1156
|
+
tmp = emitTypeScriptReference($this, ref.do_1) + '[]';
|
|
1157
1157
|
} else {
|
|
1158
1158
|
if (ref instanceof Unit) {
|
|
1159
1159
|
tmp = 'undefined';
|
|
@@ -1162,10 +1162,10 @@ function emitTypeScriptReference($this, ref) {
|
|
|
1162
1162
|
tmp = 'any';
|
|
1163
1163
|
} else {
|
|
1164
1164
|
if (ref instanceof Custom) {
|
|
1165
|
-
tmp = sanitizeSymbol_1($this, ref.
|
|
1165
|
+
tmp = sanitizeSymbol_1($this, ref.pu_1);
|
|
1166
1166
|
} else {
|
|
1167
1167
|
if (ref instanceof Primitive) {
|
|
1168
|
-
var tmp1_subject = ref.
|
|
1168
|
+
var tmp1_subject = ref.tu_1;
|
|
1169
1169
|
var tmp_0;
|
|
1170
1170
|
if (tmp1_subject instanceof String_0) {
|
|
1171
1171
|
tmp_0 = 'string';
|
|
@@ -1198,20 +1198,20 @@ function emitTypeScriptReference($this, ref) {
|
|
|
1198
1198
|
}
|
|
1199
1199
|
}
|
|
1200
1200
|
// Inline function 'kotlin.let' call
|
|
1201
|
-
return tmp + (ref.
|
|
1201
|
+
return tmp + (ref.hu() ? ' | undefined' : '');
|
|
1202
1202
|
}
|
|
1203
1203
|
function EndpointParam(name, type, nullable) {
|
|
1204
|
-
this.
|
|
1205
|
-
this.
|
|
1206
|
-
this.
|
|
1204
|
+
this.n1z_1 = name;
|
|
1205
|
+
this.o1z_1 = type;
|
|
1206
|
+
this.p1z_1 = nullable;
|
|
1207
1207
|
}
|
|
1208
1208
|
protoOf(EndpointParam).toString = function () {
|
|
1209
|
-
return 'EndpointParam(name=' + this.
|
|
1209
|
+
return 'EndpointParam(name=' + this.n1z_1 + ', type=' + this.o1z_1 + ', nullable=' + this.p1z_1 + ')';
|
|
1210
1210
|
};
|
|
1211
1211
|
protoOf(EndpointParam).hashCode = function () {
|
|
1212
|
-
var result = getStringHashCode(this.
|
|
1213
|
-
result = imul(result, 31) + getStringHashCode(this.
|
|
1214
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
1212
|
+
var result = getStringHashCode(this.n1z_1);
|
|
1213
|
+
result = imul(result, 31) + getStringHashCode(this.o1z_1) | 0;
|
|
1214
|
+
result = imul(result, 31) + getBooleanHashCode(this.p1z_1) | 0;
|
|
1215
1215
|
return result;
|
|
1216
1216
|
};
|
|
1217
1217
|
protoOf(EndpointParam).equals = function (other) {
|
|
@@ -1219,17 +1219,17 @@ protoOf(EndpointParam).equals = function (other) {
|
|
|
1219
1219
|
return true;
|
|
1220
1220
|
if (!(other instanceof EndpointParam))
|
|
1221
1221
|
return false;
|
|
1222
|
-
if (!(this.
|
|
1222
|
+
if (!(this.n1z_1 === other.n1z_1))
|
|
1223
1223
|
return false;
|
|
1224
|
-
if (!(this.
|
|
1224
|
+
if (!(this.o1z_1 === other.o1z_1))
|
|
1225
1225
|
return false;
|
|
1226
|
-
if (!(this.
|
|
1226
|
+
if (!(this.p1z_1 === other.p1z_1))
|
|
1227
1227
|
return false;
|
|
1228
1228
|
return true;
|
|
1229
1229
|
};
|
|
1230
1230
|
function Companion() {
|
|
1231
1231
|
Companion_instance_1 = this;
|
|
1232
|
-
this.
|
|
1232
|
+
this.m1z_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']);
|
|
1233
1233
|
}
|
|
1234
1234
|
var Companion_instance_1;
|
|
1235
1235
|
function Companion_getInstance_0() {
|
|
@@ -1242,13 +1242,13 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
1242
1242
|
}
|
|
1243
1243
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1244
1244
|
return function (name) {
|
|
1245
|
-
var sanitized = name.
|
|
1245
|
+
var sanitized = name.l1h_1.a1() > 1 ? name.x1l() : sanitizeSymbol_1(this$0, name.x1h());
|
|
1246
1246
|
return new Name(listOf(sanitized));
|
|
1247
1247
|
};
|
|
1248
1248
|
}
|
|
1249
1249
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0) {
|
|
1250
1250
|
return function (name) {
|
|
1251
|
-
var sanitized = name.
|
|
1251
|
+
var sanitized = name.l1h_1.a1() > 1 ? name.x1l() : sanitizeSymbol_1(this$0, name.x1h());
|
|
1252
1252
|
return new Name(listOf(sanitized));
|
|
1253
1253
|
};
|
|
1254
1254
|
}
|
|
@@ -1274,12 +1274,12 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0)
|
|
|
1274
1274
|
return function (stmt, tr) {
|
|
1275
1275
|
var tmp;
|
|
1276
1276
|
if (stmt instanceof VariableReference) {
|
|
1277
|
-
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
1277
|
+
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.l1o_1));
|
|
1278
1278
|
} else {
|
|
1279
1279
|
if (stmt instanceof ConstructorStatement) {
|
|
1280
|
-
var tmp_0 = tr.
|
|
1280
|
+
var tmp_0 = tr.u1t(stmt.u1m_1);
|
|
1281
1281
|
// Inline function 'kotlin.collections.map' call
|
|
1282
|
-
var this_0 = stmt.
|
|
1282
|
+
var this_0 = stmt.v1m_1;
|
|
1283
1283
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1284
1284
|
var destination = ArrayList_init_$Create$_0(this_0.a1());
|
|
1285
1285
|
// Inline function 'kotlin.collections.iterator' call
|
|
@@ -1290,13 +1290,13 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0)
|
|
|
1290
1290
|
var key = item.k1();
|
|
1291
1291
|
// Inline function 'kotlin.collections.component2' call
|
|
1292
1292
|
var value = item.l1();
|
|
1293
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.
|
|
1293
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.x1t(value));
|
|
1294
1294
|
destination.x(tmp$ret$3);
|
|
1295
1295
|
}
|
|
1296
1296
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
1297
1297
|
} else {
|
|
1298
1298
|
if (stmt instanceof Assignment) {
|
|
1299
|
-
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
1299
|
+
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.o1o_1), tr.x1t(stmt.p1o_1), stmt.q1o_1);
|
|
1300
1300
|
} else {
|
|
1301
1301
|
tmp = transformChildren(stmt, tr);
|
|
1302
1302
|
}
|
|
@@ -1307,7 +1307,7 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0)
|
|
|
1307
1307
|
}
|
|
1308
1308
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1309
1309
|
return function () {
|
|
1310
|
-
var tmp0_reservedKeywords = Companion_getInstance_0().
|
|
1310
|
+
var tmp0_reservedKeywords = Companion_getInstance_0().m1z_1;
|
|
1311
1311
|
var tmp = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1312
1312
|
var tmp_0 = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
|
|
1313
1313
|
var tmp_1 = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
|
|
@@ -1323,11 +1323,11 @@ function TypeScriptIrEmitter$_get_sanitizationConfig_$ref_f6f0bh() {
|
|
|
1323
1323
|
function TypeScriptIrEmitter$emitShared$lambda(element, transformer) {
|
|
1324
1324
|
var tmp;
|
|
1325
1325
|
if (element instanceof Namespace) {
|
|
1326
|
-
var injected = element.
|
|
1326
|
+
var injected = element.d1n_1.equals(Companion_getInstance().k1h('Wirespec')) ? listOf(new RawElement('export type Type = string')) : emptyList();
|
|
1327
1327
|
var tmp_0;
|
|
1328
1328
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1329
1329
|
if (!injected.r()) {
|
|
1330
|
-
tmp_0 = withElements(element, plus_0(injected, element.
|
|
1330
|
+
tmp_0 = withElements(element, plus_0(injected, element.z1m()));
|
|
1331
1331
|
} else {
|
|
1332
1332
|
tmp_0 = element;
|
|
1333
1333
|
}
|
|
@@ -1342,11 +1342,11 @@ function TypeScriptIrEmitter$emitShared$lambda_0($api) {
|
|
|
1342
1342
|
return function (element, transformer) {
|
|
1343
1343
|
var tmp;
|
|
1344
1344
|
if (element instanceof Namespace) {
|
|
1345
|
-
var injected = element.
|
|
1345
|
+
var injected = element.d1n_1.equals(Companion_getInstance().k1h('Wirespec')) ? listOf(new RawElement($api)) : emptyList();
|
|
1346
1346
|
var tmp_0;
|
|
1347
1347
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1348
1348
|
if (!injected.r()) {
|
|
1349
|
-
tmp_0 = withElements(element, plus_0(element.
|
|
1349
|
+
tmp_0 = withElements(element, plus_0(element.z1m(), injected));
|
|
1350
1350
|
} else {
|
|
1351
1351
|
tmp_0 = element;
|
|
1352
1352
|
}
|
|
@@ -1359,7 +1359,7 @@ function TypeScriptIrEmitter$emitShared$lambda_0($api) {
|
|
|
1359
1359
|
};
|
|
1360
1360
|
}
|
|
1361
1361
|
function TypeScriptIrEmitter$emit$lambda(it) {
|
|
1362
|
-
return 'export {' + it.
|
|
1362
|
+
return 'export {' + it.ar().l1() + "} from './" + it.ar().l1() + "'";
|
|
1363
1363
|
}
|
|
1364
1364
|
function TypeScriptIrEmitter$emit$injectApiConst$lambda($endpoint) {
|
|
1365
1365
|
return function (element, transformer) {
|
|
@@ -1369,7 +1369,7 @@ function TypeScriptIrEmitter$emit$injectApiConst$lambda($endpoint) {
|
|
|
1369
1369
|
var tmp_0;
|
|
1370
1370
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1371
1371
|
if (!injected.r()) {
|
|
1372
|
-
tmp_0 = withElements(element, plus_0(element.
|
|
1372
|
+
tmp_0 = withElements(element, plus_0(element.z1m(), injected));
|
|
1373
1373
|
} else {
|
|
1374
1374
|
tmp_0 = element;
|
|
1375
1375
|
}
|
|
@@ -1388,14 +1388,14 @@ function emit$injectApiConst(_this__u8e3s4, $endpoint) {
|
|
|
1388
1388
|
var tmp = scope;
|
|
1389
1389
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1390
1390
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1391
|
-
var this_0 = scope.
|
|
1391
|
+
var this_0 = scope.c1u_1;
|
|
1392
1392
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1393
1393
|
// Inline function 'kotlin.apply' call
|
|
1394
1394
|
var this_1 = new TransformerBuilder();
|
|
1395
|
-
this_1.
|
|
1396
|
-
var tmp$ret$2 = this_1.
|
|
1397
|
-
tmp.
|
|
1398
|
-
var tmp_0 = scope.
|
|
1395
|
+
this_1.h1h(TypeScriptIrEmitter$emit$injectApiConst$lambda($endpoint));
|
|
1396
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1397
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1398
|
+
var tmp_0 = scope.c1u_1;
|
|
1399
1399
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1400
1400
|
}
|
|
1401
1401
|
function emit$applyCallParamsIfNeeded(_this__u8e3s4, hasRequestParams) {
|
|
@@ -1403,25 +1403,25 @@ function emit$applyCallParamsIfNeeded(_this__u8e3s4, hasRequestParams) {
|
|
|
1403
1403
|
}
|
|
1404
1404
|
function TypeScriptIrEmitter$emitClient$lambda(this$0) {
|
|
1405
1405
|
return function (it) {
|
|
1406
|
-
var methodName = firstToLower(this$0, it.
|
|
1406
|
+
var methodName = firstToLower(this$0, it.ip_1.l1());
|
|
1407
1407
|
return ' ...' + methodName + 'Client(serialization, transportation),';
|
|
1408
1408
|
};
|
|
1409
1409
|
}
|
|
1410
1410
|
function TypeScriptIrEmitter() {
|
|
1411
1411
|
Companion_getInstance_0();
|
|
1412
|
-
this.
|
|
1413
|
-
this.
|
|
1412
|
+
this.j1z_1 = TypeScriptGenerator_getInstance();
|
|
1413
|
+
this.k1z_1 = FileExtension_TypeScript_getInstance();
|
|
1414
1414
|
var tmp = this;
|
|
1415
|
-
tmp.
|
|
1415
|
+
tmp.l1z_1 = lazy(TypeScriptIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1416
1416
|
}
|
|
1417
|
-
protoOf(TypeScriptIrEmitter).
|
|
1418
|
-
return this.
|
|
1417
|
+
protoOf(TypeScriptIrEmitter).p1u = function () {
|
|
1418
|
+
return this.j1z_1;
|
|
1419
1419
|
};
|
|
1420
|
-
protoOf(TypeScriptIrEmitter).
|
|
1421
|
-
return this.
|
|
1420
|
+
protoOf(TypeScriptIrEmitter).iq = function () {
|
|
1421
|
+
return this.k1z_1;
|
|
1422
1422
|
};
|
|
1423
|
-
protoOf(TypeScriptIrEmitter).
|
|
1424
|
-
var packageName = Companion_instance.
|
|
1423
|
+
protoOf(TypeScriptIrEmitter).s1u = function () {
|
|
1424
|
+
var packageName = Companion_instance.qr('community.flock.wirespec');
|
|
1425
1425
|
var api = 'export type Client<REQ extends Request<unknown>, RES extends Response<unknown>> = (serialization: Serialization) => {\n to: (request: REQ) => RawRequest;\n from: (response: RawResponse) => RES\n}\nexport type Server<REQ extends Request<unknown>, RES extends Response<unknown>> = (serialization: Serialization) => {\n from: (request: RawRequest) => REQ;\n to: (response: RES) => RawResponse\n}\nexport type Api<REQ extends Request<unknown>, RES extends Response<unknown>> = {\n name: string;\n method: Method,\n path: string,\n client: Client<REQ, RES>;\n server: Server<REQ, RES>\n}';
|
|
1426
1426
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1427
1427
|
var this_0 = convert(packageName);
|
|
@@ -1430,31 +1430,31 @@ protoOf(TypeScriptIrEmitter).n1u = function () {
|
|
|
1430
1430
|
var tmp = scope;
|
|
1431
1431
|
// Inline function 'community.flock.wirespec.ir.core.injectBefore' call
|
|
1432
1432
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1433
|
-
var this_1 = scope.
|
|
1433
|
+
var this_1 = scope.c1u_1;
|
|
1434
1434
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1435
1435
|
// Inline function 'kotlin.apply' call
|
|
1436
1436
|
var this_2 = new TransformerBuilder();
|
|
1437
|
-
this_2.
|
|
1438
|
-
var tmp$ret$2 = this_2.
|
|
1439
|
-
tmp.
|
|
1437
|
+
this_2.h1h(TypeScriptIrEmitter$emitShared$lambda);
|
|
1438
|
+
var tmp$ret$2 = this_2.i1h();
|
|
1439
|
+
tmp.c1u_1 = transform(this_1, tmp$ret$2);
|
|
1440
1440
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1441
1441
|
var tmp_0 = scope;
|
|
1442
1442
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1443
1443
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1444
|
-
var this_3 = scope.
|
|
1444
|
+
var this_3 = scope.c1u_1;
|
|
1445
1445
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1446
1446
|
// Inline function 'kotlin.apply' call
|
|
1447
1447
|
var this_4 = new TransformerBuilder();
|
|
1448
|
-
this_4.
|
|
1449
|
-
var tmp$ret$8 = this_4.
|
|
1450
|
-
tmp_0.
|
|
1451
|
-
var tmp_1 = scope.
|
|
1448
|
+
this_4.h1h(TypeScriptIrEmitter$emitShared$lambda_0(api));
|
|
1449
|
+
var tmp$ret$8 = this_4.i1h();
|
|
1450
|
+
tmp_0.c1u_1 = transform(this_3, tmp$ret$8);
|
|
1451
|
+
var tmp_1 = scope.c1u_1;
|
|
1452
1452
|
return isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1453
1453
|
};
|
|
1454
|
-
protoOf(TypeScriptIrEmitter).
|
|
1454
|
+
protoOf(TypeScriptIrEmitter).sn = function (ast, logger) {
|
|
1455
1455
|
var tmp = emit.call(this, ast, logger);
|
|
1456
1456
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
1457
|
-
var this_0 = ast.
|
|
1457
|
+
var this_0 = ast.fq_1;
|
|
1458
1458
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1459
1459
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
1460
1460
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -1462,7 +1462,7 @@ protoOf(TypeScriptIrEmitter).on = function (ast, logger) {
|
|
|
1462
1462
|
var _iterator__ex2g4s = tmp0.t();
|
|
1463
1463
|
while (_iterator__ex2g4s.u()) {
|
|
1464
1464
|
var element = _iterator__ex2g4s.v();
|
|
1465
|
-
var list = new NonEmptyList(element.
|
|
1465
|
+
var list = new NonEmptyList(element.hq_1);
|
|
1466
1466
|
addAll(destination, list);
|
|
1467
1467
|
}
|
|
1468
1468
|
var tmp$ret$3 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -1479,7 +1479,7 @@ protoOf(TypeScriptIrEmitter).on = function (ast, logger) {
|
|
|
1479
1479
|
var tmp_0;
|
|
1480
1480
|
if (value == null) {
|
|
1481
1481
|
var answer = ArrayList_init_$Create$();
|
|
1482
|
-
destination_0.
|
|
1482
|
+
destination_0.s2(key, answer);
|
|
1483
1483
|
tmp_0 = answer;
|
|
1484
1484
|
} else {
|
|
1485
1485
|
tmp_0 = value;
|
|
@@ -1498,18 +1498,18 @@ protoOf(TypeScriptIrEmitter).on = function (ast, logger) {
|
|
|
1498
1498
|
var ns = item.k1();
|
|
1499
1499
|
// Inline function 'kotlin.collections.component2' call
|
|
1500
1500
|
var defs = item.l1();
|
|
1501
|
-
var tmp_1 = ns + '/index.' + this.
|
|
1501
|
+
var tmp_1 = ns + '/index.' + this.iq().rq_1;
|
|
1502
1502
|
var tmp$ret$12 = new Emitted(tmp_1, joinToString(defs, '\n', VOID, VOID, VOID, VOID, TypeScriptIrEmitter$emit$lambda));
|
|
1503
1503
|
destination_1.x(tmp$ret$12);
|
|
1504
1504
|
}
|
|
1505
1505
|
return NonEmptyList__plus_impl_xqmb9_0(tmp, destination_1);
|
|
1506
1506
|
};
|
|
1507
|
-
protoOf(TypeScriptIrEmitter).
|
|
1507
|
+
protoOf(TypeScriptIrEmitter).zq = function (definition, module_0, logger) {
|
|
1508
1508
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1509
|
-
var subPackageName = plus(Companion_instance.
|
|
1510
|
-
return new File(Companion_getInstance().
|
|
1509
|
+
var subPackageName = plus(Companion_instance.qr(''), definition);
|
|
1510
|
+
return new File(Companion_getInstance().k1h(subPackageName.tr() + sanitizeSymbol_1(this, file.x1m_1.m1h())), plus_0(listOf(import_0('../Wirespec', 'Wirespec')), file.y1m_1));
|
|
1511
1511
|
};
|
|
1512
|
-
protoOf(TypeScriptIrEmitter).
|
|
1512
|
+
protoOf(TypeScriptIrEmitter).yp = function (type, module_0) {
|
|
1513
1513
|
var fieldValidations = classifyValidatableFields(type, module_0);
|
|
1514
1514
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1515
1515
|
var this_0 = importReferences(type);
|
|
@@ -1518,7 +1518,7 @@ protoOf(TypeScriptIrEmitter).up = function (type, module_0) {
|
|
|
1518
1518
|
var _iterator__ex2g4s = this_0.t();
|
|
1519
1519
|
while (_iterator__ex2g4s.u()) {
|
|
1520
1520
|
var e = _iterator__ex2g4s.v();
|
|
1521
|
-
var key = e.
|
|
1521
|
+
var key = e.pu_1;
|
|
1522
1522
|
if (set.x(key)) {
|
|
1523
1523
|
list.x(e);
|
|
1524
1524
|
}
|
|
@@ -1529,7 +1529,7 @@ protoOf(TypeScriptIrEmitter).up = function (type, module_0) {
|
|
|
1529
1529
|
var _iterator__ex2g4s_0 = list.t();
|
|
1530
1530
|
while (_iterator__ex2g4s_0.u()) {
|
|
1531
1531
|
var item = _iterator__ex2g4s_0.v();
|
|
1532
|
-
var tmp$ret$2 = import_0('./' + item.
|
|
1532
|
+
var tmp$ret$2 = import_0('./' + item.pu_1, item.pu_1);
|
|
1533
1533
|
destination.x(tmp$ret$2);
|
|
1534
1534
|
}
|
|
1535
1535
|
var typeImports = destination;
|
|
@@ -1539,7 +1539,7 @@ protoOf(TypeScriptIrEmitter).up = function (type, module_0) {
|
|
|
1539
1539
|
var _iterator__ex2g4s_1 = fieldValidations.t();
|
|
1540
1540
|
while (_iterator__ex2g4s_1.u()) {
|
|
1541
1541
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
1542
|
-
var tmp$ret$5 = item_0.
|
|
1542
|
+
var tmp$ret$5 = item_0.r1h_1;
|
|
1543
1543
|
destination_0.x(tmp$ret$5);
|
|
1544
1544
|
}
|
|
1545
1545
|
// Inline function 'kotlin.collections.filter' call
|
|
@@ -1549,7 +1549,7 @@ protoOf(TypeScriptIrEmitter).up = function (type, module_0) {
|
|
|
1549
1549
|
var _iterator__ex2g4s_2 = tmp0.t();
|
|
1550
1550
|
while (_iterator__ex2g4s_2.u()) {
|
|
1551
1551
|
var element = _iterator__ex2g4s_2.v();
|
|
1552
|
-
if (!(element === type.
|
|
1552
|
+
if (!(element === type.zo_1.l1())) {
|
|
1553
1553
|
destination_1.x(element);
|
|
1554
1554
|
}
|
|
1555
1555
|
}
|
|
@@ -1565,30 +1565,30 @@ protoOf(TypeScriptIrEmitter).up = function (type, module_0) {
|
|
|
1565
1565
|
var validateImports = destination_2;
|
|
1566
1566
|
var allImports = plus_0(typeImports, validateImports);
|
|
1567
1567
|
// Inline function 'kotlin.collections.map' call
|
|
1568
|
-
var this_1 = type.wo_1
|
|
1568
|
+
var this_1 = type.ap_1.wo_1;
|
|
1569
1569
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1570
1570
|
var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1571
1571
|
var _iterator__ex2g4s_4 = this_1.t();
|
|
1572
1572
|
while (_iterator__ex2g4s_4.u()) {
|
|
1573
1573
|
var item_2 = _iterator__ex2g4s_4.v();
|
|
1574
|
-
var tmp$ret$14 = item_2.
|
|
1574
|
+
var tmp$ret$14 = item_2.ep_1.l1();
|
|
1575
1575
|
destination_3.x(tmp$ret$14);
|
|
1576
1576
|
}
|
|
1577
1577
|
var fieldNames = toSet(destination_3);
|
|
1578
|
-
var file = renameValidateAndBindObjReceiver(sanitizeNames(convertWithValidation(type, module_0), _get_sanitizationConfig__sns434(this)), type.
|
|
1578
|
+
var file = renameValidateAndBindObjReceiver(sanitizeNames(convertWithValidation(type, module_0), _get_sanitizationConfig__sns434(this)), type.zo_1.l1(), fieldNames);
|
|
1579
1579
|
var tmp;
|
|
1580
1580
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1581
1581
|
if (!allImports.r()) {
|
|
1582
|
-
tmp = file.
|
|
1582
|
+
tmp = file.b1n(VOID, plus_0(allImports, file.y1m_1));
|
|
1583
1583
|
} else {
|
|
1584
1584
|
tmp = file;
|
|
1585
1585
|
}
|
|
1586
1586
|
return tmp;
|
|
1587
1587
|
};
|
|
1588
|
-
protoOf(TypeScriptIrEmitter).
|
|
1588
|
+
protoOf(TypeScriptIrEmitter).nr = function (enum_0, module_0) {
|
|
1589
1589
|
return sanitizeNames(convert_0(enum_0), _get_sanitizationConfig__sns434(this));
|
|
1590
1590
|
};
|
|
1591
|
-
protoOf(TypeScriptIrEmitter).
|
|
1591
|
+
protoOf(TypeScriptIrEmitter).dr = function (union) {
|
|
1592
1592
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1593
1593
|
var this_0 = importReferences(union);
|
|
1594
1594
|
var set = HashSet_init_$Create$();
|
|
@@ -1596,7 +1596,7 @@ protoOf(TypeScriptIrEmitter).yq = function (union) {
|
|
|
1596
1596
|
var _iterator__ex2g4s = this_0.t();
|
|
1597
1597
|
while (_iterator__ex2g4s.u()) {
|
|
1598
1598
|
var e = _iterator__ex2g4s.v();
|
|
1599
|
-
var key = e.
|
|
1599
|
+
var key = e.pu_1;
|
|
1600
1600
|
if (set.x(key)) {
|
|
1601
1601
|
list.x(e);
|
|
1602
1602
|
}
|
|
@@ -1607,7 +1607,7 @@ protoOf(TypeScriptIrEmitter).yq = function (union) {
|
|
|
1607
1607
|
var _iterator__ex2g4s_0 = list.t();
|
|
1608
1608
|
while (_iterator__ex2g4s_0.u()) {
|
|
1609
1609
|
var item = _iterator__ex2g4s_0.v();
|
|
1610
|
-
var tmp$ret$2 = import_0('../model', item.
|
|
1610
|
+
var tmp$ret$2 = import_0('../model', item.pu_1, true);
|
|
1611
1611
|
destination.x(tmp$ret$2);
|
|
1612
1612
|
}
|
|
1613
1613
|
var imports = destination;
|
|
@@ -1615,19 +1615,19 @@ protoOf(TypeScriptIrEmitter).yq = function (union) {
|
|
|
1615
1615
|
var tmp;
|
|
1616
1616
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1617
1617
|
if (!imports.r()) {
|
|
1618
|
-
tmp = file.
|
|
1618
|
+
tmp = file.b1n(VOID, plus_0(imports, file.y1m_1));
|
|
1619
1619
|
} else {
|
|
1620
1620
|
tmp = file;
|
|
1621
1621
|
}
|
|
1622
1622
|
return tmp;
|
|
1623
1623
|
};
|
|
1624
|
-
protoOf(TypeScriptIrEmitter).
|
|
1624
|
+
protoOf(TypeScriptIrEmitter).ir = function (refined) {
|
|
1625
1625
|
var converted = convert_2(refined);
|
|
1626
|
-
var constraintExpr = convertConstraint(refined.
|
|
1627
|
-
var validatorStr = TypeScriptGenerator_getInstance().
|
|
1628
|
-
return new File(converted.
|
|
1626
|
+
var constraintExpr = convertConstraint(refined.hr_1, new VariableReference(Companion_getInstance().k1h('value')));
|
|
1627
|
+
var validatorStr = TypeScriptGenerator_getInstance().a1v(constraintExpr);
|
|
1628
|
+
return new File(converted.x1m_1, listOf_0([new RawElement('export type ' + converted.x1m_1.m1h() + ' = ' + emitTypeScriptReference(this, refined.hr_1) + ';'), new RawElement('export const validate' + refined.gr_1.l1() + ' = (value: ' + emitTypeScriptReference(this, refined.hr_1) + ') =>\n ' + validatorStr + ';')]));
|
|
1629
1629
|
};
|
|
1630
|
-
protoOf(TypeScriptIrEmitter).
|
|
1630
|
+
protoOf(TypeScriptIrEmitter).or = function (endpoint) {
|
|
1631
1631
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1632
1632
|
var this_0 = importReferences(endpoint);
|
|
1633
1633
|
var set = HashSet_init_$Create$();
|
|
@@ -1635,7 +1635,7 @@ protoOf(TypeScriptIrEmitter).jr = function (endpoint) {
|
|
|
1635
1635
|
var _iterator__ex2g4s = this_0.t();
|
|
1636
1636
|
while (_iterator__ex2g4s.u()) {
|
|
1637
1637
|
var e = _iterator__ex2g4s.v();
|
|
1638
|
-
var key = e.
|
|
1638
|
+
var key = e.pu_1;
|
|
1639
1639
|
if (set.x(key)) {
|
|
1640
1640
|
list.x(e);
|
|
1641
1641
|
}
|
|
@@ -1646,7 +1646,7 @@ protoOf(TypeScriptIrEmitter).jr = function (endpoint) {
|
|
|
1646
1646
|
var _iterator__ex2g4s_0 = list.t();
|
|
1647
1647
|
while (_iterator__ex2g4s_0.u()) {
|
|
1648
1648
|
var item = _iterator__ex2g4s_0.v();
|
|
1649
|
-
var tmp$ret$2 = import_0('../model', item.
|
|
1649
|
+
var tmp$ret$2 = import_0('../model', item.pu_1, true);
|
|
1650
1650
|
destination.x(tmp$ret$2);
|
|
1651
1651
|
}
|
|
1652
1652
|
var imports = destination;
|
|
@@ -1655,25 +1655,25 @@ protoOf(TypeScriptIrEmitter).jr = function (endpoint) {
|
|
|
1655
1655
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1656
1656
|
var this_1 = stripTrailingSpaceFromErrorMessage(convert_3(endpoint));
|
|
1657
1657
|
var scope = new TransformScope(this_1);
|
|
1658
|
-
scope.
|
|
1659
|
-
var tmp = scope.
|
|
1658
|
+
scope.h1u(transformPatternSwitchToValueSwitch());
|
|
1659
|
+
var tmp = scope.c1u_1;
|
|
1660
1660
|
var tmp$ret$7 = isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1661
1661
|
// Inline function 'kotlin.let' call
|
|
1662
|
-
var it = sanitizeNames(emit$injectApiConst(emit$applyCallParamsIfNeeded(tmp$ret$7, hasRequestParams), endpoint).
|
|
1662
|
+
var it = sanitizeNames(emit$injectApiConst(emit$applyCallParamsIfNeeded(tmp$ret$7, hasRequestParams), endpoint).b1n(Companion_getInstance().k1h(sanitize(this, endpoint.ip_1))), _get_sanitizationConfig__sns434(this));
|
|
1663
1663
|
var tmp_0;
|
|
1664
1664
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1665
1665
|
if (!imports.r()) {
|
|
1666
|
-
tmp_0 = it.
|
|
1666
|
+
tmp_0 = it.b1n(VOID, plus_0(imports, it.y1m_1));
|
|
1667
1667
|
} else {
|
|
1668
1668
|
tmp_0 = it;
|
|
1669
1669
|
}
|
|
1670
1670
|
return tmp_0;
|
|
1671
1671
|
};
|
|
1672
|
-
protoOf(TypeScriptIrEmitter).
|
|
1672
|
+
protoOf(TypeScriptIrEmitter).cr = function (channel) {
|
|
1673
1673
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1674
1674
|
};
|
|
1675
|
-
protoOf(TypeScriptIrEmitter).
|
|
1676
|
-
var endpointName = endpoint.
|
|
1675
|
+
protoOf(TypeScriptIrEmitter).u1u = function (endpoint) {
|
|
1676
|
+
var endpointName = endpoint.ip_1.l1();
|
|
1677
1677
|
var methodName = firstToLower(this, endpointName);
|
|
1678
1678
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1679
1679
|
var this_0 = importReferences(endpoint);
|
|
@@ -1682,7 +1682,7 @@ protoOf(TypeScriptIrEmitter).p1u = function (endpoint) {
|
|
|
1682
1682
|
var _iterator__ex2g4s = this_0.t();
|
|
1683
1683
|
while (_iterator__ex2g4s.u()) {
|
|
1684
1684
|
var e = _iterator__ex2g4s.v();
|
|
1685
|
-
var key = e.
|
|
1685
|
+
var key = e.pu_1;
|
|
1686
1686
|
if (set.x(key)) {
|
|
1687
1687
|
list.x(e);
|
|
1688
1688
|
}
|
|
@@ -1693,7 +1693,7 @@ protoOf(TypeScriptIrEmitter).p1u = function (endpoint) {
|
|
|
1693
1693
|
var _iterator__ex2g4s_0 = list.t();
|
|
1694
1694
|
while (_iterator__ex2g4s_0.u()) {
|
|
1695
1695
|
var item = _iterator__ex2g4s_0.v();
|
|
1696
|
-
var tmp$ret$2 = import_0('../model', item.
|
|
1696
|
+
var tmp$ret$2 = import_0('../model', item.pu_1, true);
|
|
1697
1697
|
destination.x(tmp$ret$2);
|
|
1698
1698
|
}
|
|
1699
1699
|
var imports = destination;
|
|
@@ -1715,40 +1715,40 @@ protoOf(TypeScriptIrEmitter).p1u = function (endpoint) {
|
|
|
1715
1715
|
}
|
|
1716
1716
|
var requestArgs = tmp_0;
|
|
1717
1717
|
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 ');
|
|
1718
|
-
var tmp_1 = Companion_getInstance().
|
|
1718
|
+
var tmp_1 = Companion_getInstance().k1h('client/' + endpointName + 'Client');
|
|
1719
1719
|
// Inline function 'kotlin.collections.buildList' call
|
|
1720
1720
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1721
1721
|
// Inline function 'kotlin.apply' call
|
|
1722
1722
|
var this_1 = ArrayList_init_$Create$();
|
|
1723
1723
|
this_1.x(import_0('../Wirespec', 'Wirespec'));
|
|
1724
1724
|
this_1.x(import_0('../endpoint/' + endpointName, endpointName));
|
|
1725
|
-
this_1.
|
|
1725
|
+
this_1.f1(imports);
|
|
1726
1726
|
this_1.x(new RawElement(code));
|
|
1727
1727
|
var tmp$ret$10 = this_1.o5();
|
|
1728
1728
|
return new File(tmp_1, tmp$ret$10);
|
|
1729
1729
|
};
|
|
1730
|
-
protoOf(TypeScriptIrEmitter).
|
|
1731
|
-
logger.
|
|
1730
|
+
protoOf(TypeScriptIrEmitter).t1u = function (endpoints, logger) {
|
|
1731
|
+
logger.xq('Emitting main Client for ' + endpoints.a1() + ' endpoints');
|
|
1732
1732
|
// Inline function 'kotlin.collections.map' call
|
|
1733
1733
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1734
1734
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(endpoints, 10));
|
|
1735
1735
|
var _iterator__ex2g4s = endpoints.t();
|
|
1736
1736
|
while (_iterator__ex2g4s.u()) {
|
|
1737
1737
|
var item = _iterator__ex2g4s.v();
|
|
1738
|
-
var methodName = firstToLower(this, item.
|
|
1739
|
-
var tmp$ret$0 = import_0('./client/' + item.
|
|
1738
|
+
var methodName = firstToLower(this, item.ip_1.l1());
|
|
1739
|
+
var tmp$ret$0 = import_0('./client/' + item.ip_1.l1() + 'Client', methodName + 'Client');
|
|
1740
1740
|
destination.x(tmp$ret$0);
|
|
1741
1741
|
}
|
|
1742
1742
|
var clientImports = destination;
|
|
1743
1743
|
var spreadEntries = joinToString(endpoints, '\n', VOID, VOID, VOID, VOID, TypeScriptIrEmitter$emitClient$lambda(this));
|
|
1744
1744
|
var code = trimMargin('\n |export const client = (serialization: Wirespec.Serialization, transportation: Wirespec.Transportation) => ({\n |' + spreadEntries + '\n |})\n ');
|
|
1745
|
-
var tmp = Companion_getInstance().
|
|
1745
|
+
var tmp = Companion_getInstance().k1h('Client');
|
|
1746
1746
|
// Inline function 'kotlin.collections.buildList' call
|
|
1747
1747
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1748
1748
|
// Inline function 'kotlin.apply' call
|
|
1749
1749
|
var this_0 = ArrayList_init_$Create$();
|
|
1750
1750
|
this_0.x(import_0('./Wirespec', 'Wirespec'));
|
|
1751
|
-
this_0.
|
|
1751
|
+
this_0.f1(clientImports);
|
|
1752
1752
|
this_0.x(new RawElement(code));
|
|
1753
1753
|
var tmp$ret$6 = this_0.o5();
|
|
1754
1754
|
return new File(tmp, tmp$ret$6);
|
|
@@ -1757,8 +1757,8 @@ function transformPatternSwitchToValueSwitch() {
|
|
|
1757
1757
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1758
1758
|
// Inline function 'kotlin.apply' call
|
|
1759
1759
|
var this_0 = new TransformerBuilder();
|
|
1760
|
-
this_0.
|
|
1761
|
-
return this_0.
|
|
1760
|
+
this_0.j1u(transformPatternSwitchToValueSwitch$lambda);
|
|
1761
|
+
return this_0.i1h();
|
|
1762
1762
|
}
|
|
1763
1763
|
function renameValidateAndBindObjReceiver(_this__u8e3s4, typeName, fieldNames) {
|
|
1764
1764
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -1766,19 +1766,19 @@ function renameValidateAndBindObjReceiver(_this__u8e3s4, typeName, fieldNames) {
|
|
|
1766
1766
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1767
1767
|
var tmp = scope;
|
|
1768
1768
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1769
|
-
var this_0 = scope.
|
|
1769
|
+
var this_0 = scope.c1u_1;
|
|
1770
1770
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1771
1771
|
// Inline function 'kotlin.apply' call
|
|
1772
1772
|
var this_1 = new TransformerBuilder();
|
|
1773
|
-
this_1.
|
|
1774
|
-
var tmp$ret$2 = this_1.
|
|
1775
|
-
tmp.
|
|
1776
|
-
var tmp_0 = scope.
|
|
1773
|
+
this_1.h1h(renameValidateAndBindObjReceiver$lambda(typeName, fieldNames));
|
|
1774
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1775
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1776
|
+
var tmp_0 = scope.c1u_1;
|
|
1777
1777
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1778
1778
|
}
|
|
1779
1779
|
function buildApiConst(endpoint) {
|
|
1780
1780
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
1781
|
-
var this_0 = endpoint.
|
|
1781
|
+
var this_0 = endpoint.ip_1.l1();
|
|
1782
1782
|
var tmp;
|
|
1783
1783
|
// Inline function 'kotlin.text.isNotEmpty' call
|
|
1784
1784
|
if (charSequenceLength(this_0) > 0) {
|
|
@@ -1792,8 +1792,8 @@ function buildApiConst(endpoint) {
|
|
|
1792
1792
|
tmp = this_0;
|
|
1793
1793
|
}
|
|
1794
1794
|
var apiName = tmp;
|
|
1795
|
-
var method = endpoint.
|
|
1796
|
-
var pathString = joinToString(endpoint.
|
|
1795
|
+
var method = endpoint.jp_1.a3_1;
|
|
1796
|
+
var pathString = joinToString(endpoint.kp_1, '/', VOID, VOID, VOID, VOID, buildApiConst$lambda);
|
|
1797
1797
|
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 '));
|
|
1798
1798
|
}
|
|
1799
1799
|
function bindCallToRequestParams(_this__u8e3s4) {
|
|
@@ -1802,21 +1802,21 @@ function bindCallToRequestParams(_this__u8e3s4) {
|
|
|
1802
1802
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1803
1803
|
var tmp = scope;
|
|
1804
1804
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1805
|
-
var this_0 = scope.
|
|
1805
|
+
var this_0 = scope.c1u_1;
|
|
1806
1806
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1807
1807
|
// Inline function 'kotlin.apply' call
|
|
1808
1808
|
var this_1 = new TransformerBuilder();
|
|
1809
|
-
this_1.
|
|
1810
|
-
var tmp$ret$2 = this_1.
|
|
1811
|
-
tmp.
|
|
1812
|
-
var tmp_0 = scope.
|
|
1809
|
+
this_1.h1h(bindCallToRequestParams$lambda);
|
|
1810
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1811
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1812
|
+
var tmp_0 = scope.c1u_1;
|
|
1813
1813
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1814
1814
|
}
|
|
1815
1815
|
function stripTrailingSpaceFromErrorMessage(_this__u8e3s4) {
|
|
1816
1816
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1817
1817
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1818
|
-
scope.
|
|
1819
|
-
var tmp = scope.
|
|
1818
|
+
scope.j1u(stripTrailingSpaceFromErrorMessage$lambda);
|
|
1819
|
+
var tmp = scope.c1u_1;
|
|
1820
1820
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1821
1821
|
}
|
|
1822
1822
|
function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
@@ -1824,7 +1824,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1824
1824
|
if (!(stmt instanceof Switch)) {
|
|
1825
1825
|
tmp = true;
|
|
1826
1826
|
} else {
|
|
1827
|
-
var tmp0 = stmt.
|
|
1827
|
+
var tmp0 = stmt.e1p_1;
|
|
1828
1828
|
var tmp$ret$0;
|
|
1829
1829
|
$l$block_0: {
|
|
1830
1830
|
// Inline function 'kotlin.collections.none' call
|
|
@@ -1841,7 +1841,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1841
1841
|
var _iterator__ex2g4s = tmp0.t();
|
|
1842
1842
|
while (_iterator__ex2g4s.u()) {
|
|
1843
1843
|
var element = _iterator__ex2g4s.v();
|
|
1844
|
-
if (!(element.
|
|
1844
|
+
if (!(element.l1p_1 == null)) {
|
|
1845
1845
|
tmp$ret$0 = false;
|
|
1846
1846
|
break $l$block_0;
|
|
1847
1847
|
}
|
|
@@ -1852,11 +1852,11 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1852
1852
|
}
|
|
1853
1853
|
if (tmp)
|
|
1854
1854
|
return transformChildren(stmt, tr);
|
|
1855
|
-
var tmp0_safe_receiver = stmt.
|
|
1856
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1855
|
+
var tmp0_safe_receiver = stmt.g1p_1;
|
|
1856
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.x1l();
|
|
1857
1857
|
var varName = tmp1_elvis_lhs == null ? 'r' : tmp1_elvis_lhs;
|
|
1858
1858
|
// Inline function 'kotlin.collections.map' call
|
|
1859
|
-
var this_0 = stmt.
|
|
1859
|
+
var this_0 = stmt.e1p_1;
|
|
1860
1860
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1861
1861
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1862
1862
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
@@ -1864,39 +1864,39 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1864
1864
|
var item = _iterator__ex2g4s_0.v();
|
|
1865
1865
|
var tmp$ret$5;
|
|
1866
1866
|
$l$block_1: {
|
|
1867
|
-
var tmp_1 = item.
|
|
1867
|
+
var tmp_1 = item.l1p_1;
|
|
1868
1868
|
var tmp0_safe_receiver_0 = tmp_1 instanceof Custom_0 ? tmp_1 : null;
|
|
1869
|
-
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.
|
|
1870
|
-
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
1869
|
+
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.v1h_1;
|
|
1870
|
+
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.m1h();
|
|
1871
1871
|
var tmp3_safe_receiver = typeName == null ? null : substringAfterLast(typeName, '.');
|
|
1872
1872
|
var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : removePrefix(tmp3_safe_receiver, 'Response');
|
|
1873
1873
|
var statusNum = tmp4_safe_receiver == null ? null : toIntOrNull(tmp4_safe_receiver);
|
|
1874
1874
|
if (statusNum == null || typeName == null) {
|
|
1875
1875
|
// Inline function 'kotlin.collections.map' call
|
|
1876
|
-
var this_1 = item.
|
|
1876
|
+
var this_1 = item.k1p_1;
|
|
1877
1877
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1878
1878
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1879
1879
|
var _iterator__ex2g4s_1 = this_1.t();
|
|
1880
1880
|
while (_iterator__ex2g4s_1.u()) {
|
|
1881
1881
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
1882
|
-
var tmp$ret$2 = tr.
|
|
1882
|
+
var tmp$ret$2 = tr.w1t(item_0);
|
|
1883
1883
|
destination_0.x(tmp$ret$2);
|
|
1884
1884
|
}
|
|
1885
|
-
tmp$ret$5 = item.
|
|
1885
|
+
tmp$ret$5 = item.n1p(VOID, destination_0);
|
|
1886
1886
|
break $l$block_1;
|
|
1887
1887
|
}
|
|
1888
|
-
var exprCode = TypeScriptGenerator_getInstance().
|
|
1889
|
-
var castAssignment = new Assignment(Companion_getInstance().
|
|
1888
|
+
var exprCode = TypeScriptGenerator_getInstance().a1v(tr.x1t(stmt.d1p_1));
|
|
1889
|
+
var castAssignment = new Assignment(Companion_getInstance().k1h(varName), new RawExpression(exprCode + ' as ' + typeName), false);
|
|
1890
1890
|
var tmp_2 = new Literal_0(statusNum, new Integer_0());
|
|
1891
1891
|
var tmp_3 = listOf(castAssignment);
|
|
1892
1892
|
// Inline function 'kotlin.collections.map' call
|
|
1893
|
-
var this_2 = item.
|
|
1893
|
+
var this_2 = item.k1p_1;
|
|
1894
1894
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1895
1895
|
var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
|
|
1896
1896
|
var _iterator__ex2g4s_2 = this_2.t();
|
|
1897
1897
|
while (_iterator__ex2g4s_2.u()) {
|
|
1898
1898
|
var item_1 = _iterator__ex2g4s_2.v();
|
|
1899
|
-
var tmp$ret$6 = tr.
|
|
1899
|
+
var tmp$ret$6 = tr.w1t(item_1);
|
|
1900
1900
|
destination_1.x(tmp$ret$6);
|
|
1901
1901
|
}
|
|
1902
1902
|
tmp$ret$5 = new Case(tmp_2, plus_0(tmp_3, destination_1), null);
|
|
@@ -1904,8 +1904,8 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1904
1904
|
destination.x(tmp$ret$5);
|
|
1905
1905
|
}
|
|
1906
1906
|
var transformedCases = destination;
|
|
1907
|
-
var tmp_4 = new FieldCall(tr.
|
|
1908
|
-
var tmp2_safe_receiver = stmt.
|
|
1907
|
+
var tmp_4 = new FieldCall(tr.x1t(stmt.d1p_1), Companion_getInstance().k1h('status'));
|
|
1908
|
+
var tmp2_safe_receiver = stmt.f1p_1;
|
|
1909
1909
|
var tmp_5;
|
|
1910
1910
|
if (tmp2_safe_receiver == null) {
|
|
1911
1911
|
tmp_5 = null;
|
|
@@ -1916,7 +1916,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
1916
1916
|
var _iterator__ex2g4s_3 = tmp2_safe_receiver.t();
|
|
1917
1917
|
while (_iterator__ex2g4s_3.u()) {
|
|
1918
1918
|
var item_2 = _iterator__ex2g4s_3.v();
|
|
1919
|
-
var tmp$ret$11 = tr.
|
|
1919
|
+
var tmp$ret$11 = tr.w1t(item_2);
|
|
1920
1920
|
destination_2.x(tmp$ret$11);
|
|
1921
1921
|
}
|
|
1922
1922
|
tmp_5 = destination_2;
|
|
@@ -1930,43 +1930,43 @@ function renameValidateAndBindObjReceiver$lambda$lambda($fieldNames) {
|
|
|
1930
1930
|
var tmp_1;
|
|
1931
1931
|
var tmp_2;
|
|
1932
1932
|
if (s instanceof FunctionCall) {
|
|
1933
|
-
tmp_2 = s.
|
|
1933
|
+
tmp_2 = s.g1m_1.equals(Companion_getInstance().k1h('validate'));
|
|
1934
1934
|
} else {
|
|
1935
1935
|
tmp_2 = false;
|
|
1936
1936
|
}
|
|
1937
1937
|
if (tmp_2) {
|
|
1938
|
-
tmp_1 = !(s.
|
|
1938
|
+
tmp_1 = !(s.e1m_1 == null);
|
|
1939
1939
|
} else {
|
|
1940
1940
|
tmp_1 = false;
|
|
1941
1941
|
}
|
|
1942
1942
|
if (tmp_1) {
|
|
1943
1943
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1944
|
-
tmp_0 = !s.
|
|
1944
|
+
tmp_0 = !s.f1m_1.r();
|
|
1945
1945
|
} else {
|
|
1946
1946
|
tmp_0 = false;
|
|
1947
1947
|
}
|
|
1948
1948
|
if (tmp_0) {
|
|
1949
|
-
var tmp_3 = first(s.
|
|
1949
|
+
var tmp_3 = first(s.f1m_1);
|
|
1950
1950
|
var tmp0_safe_receiver = tmp_3 instanceof Custom_0 ? tmp_3 : null;
|
|
1951
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1952
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
1951
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.v1h_1;
|
|
1952
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.m1h();
|
|
1953
1953
|
var tn = tmp2_elvis_lhs == null ? '' : tmp2_elvis_lhs;
|
|
1954
|
-
tmp = new FunctionCall(VOID, VOID, Companion_getInstance().
|
|
1954
|
+
tmp = new FunctionCall(VOID, VOID, Companion_getInstance().k1h('validate' + tn), mapOf(to(Companion_getInstance().k1h('obj'), t.x1t(ensureNotNull(s.e1m_1)))));
|
|
1955
1955
|
} else {
|
|
1956
1956
|
var tmp_4;
|
|
1957
1957
|
var tmp_5;
|
|
1958
1958
|
if (s instanceof FieldCall) {
|
|
1959
|
-
tmp_5 = s.
|
|
1959
|
+
tmp_5 = s.o1p_1 == null;
|
|
1960
1960
|
} else {
|
|
1961
1961
|
tmp_5 = false;
|
|
1962
1962
|
}
|
|
1963
1963
|
if (tmp_5) {
|
|
1964
|
-
tmp_4 = $fieldNames.u1(s.
|
|
1964
|
+
tmp_4 = $fieldNames.u1(s.p1p_1.x1l());
|
|
1965
1965
|
} else {
|
|
1966
1966
|
tmp_4 = false;
|
|
1967
1967
|
}
|
|
1968
1968
|
if (tmp_4) {
|
|
1969
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().
|
|
1969
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().k1h('obj')), s.p1p_1);
|
|
1970
1970
|
} else {
|
|
1971
1971
|
tmp = transformChildren(s, t);
|
|
1972
1972
|
}
|
|
@@ -1980,15 +1980,15 @@ function renameValidateAndBindObjReceiver$lambda($typeName, $fieldNames) {
|
|
|
1980
1980
|
if (element instanceof Function) {
|
|
1981
1981
|
var tmp$ret$0;
|
|
1982
1982
|
$l$block: {
|
|
1983
|
-
if (!element.
|
|
1983
|
+
if (!element.y1j_1.equals(Companion_getInstance().k1h('validate'))) {
|
|
1984
1984
|
tmp$ret$0 = element;
|
|
1985
1985
|
break $l$block;
|
|
1986
1986
|
}
|
|
1987
1987
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1988
|
-
var this_0 = element.
|
|
1988
|
+
var this_0 = element.g1k(Companion_getInstance().k1h('validate' + $typeName), VOID, listOf(new Parameter(Companion_getInstance().k1h('obj'), Custom_init_$Create$($typeName))));
|
|
1989
1989
|
var scope = new TransformScope(this_0);
|
|
1990
|
-
scope.
|
|
1991
|
-
var tmp_0 = scope.
|
|
1990
|
+
scope.l1u(renameValidateAndBindObjReceiver$lambda$lambda($fieldNames));
|
|
1991
|
+
var tmp_0 = scope.c1u_1;
|
|
1992
1992
|
tmp$ret$0 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1993
1993
|
}
|
|
1994
1994
|
tmp = tmp$ret$0;
|
|
@@ -2002,10 +2002,10 @@ function renameValidateAndBindObjReceiver$lambda($typeName, $fieldNames) {
|
|
|
2002
2002
|
function buildApiConst$lambda(it) {
|
|
2003
2003
|
var tmp;
|
|
2004
2004
|
if (it instanceof Literal) {
|
|
2005
|
-
tmp = it.
|
|
2005
|
+
tmp = it.lq_1;
|
|
2006
2006
|
} else {
|
|
2007
2007
|
if (it instanceof Param) {
|
|
2008
|
-
tmp = '{' + it.
|
|
2008
|
+
tmp = '{' + it.pp_1.l1() + '}';
|
|
2009
2009
|
} else {
|
|
2010
2010
|
noWhenBranchMatchedException();
|
|
2011
2011
|
}
|
|
@@ -2017,23 +2017,23 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
2017
2017
|
if (element instanceof Interface) {
|
|
2018
2018
|
var tmp$ret$0;
|
|
2019
2019
|
$l$block: {
|
|
2020
|
-
if (!element.
|
|
2020
|
+
if (!element.q1n_1.equals(Companion_getInstance().k1h('Call'))) {
|
|
2021
2021
|
tmp$ret$0 = element;
|
|
2022
2022
|
break $l$block;
|
|
2023
2023
|
}
|
|
2024
2024
|
// Inline function 'kotlin.collections.map' call
|
|
2025
|
-
var this_0 = element.
|
|
2025
|
+
var this_0 = element.r1n_1;
|
|
2026
2026
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2027
2027
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2028
2028
|
var _iterator__ex2g4s = this_0.t();
|
|
2029
2029
|
while (_iterator__ex2g4s.u()) {
|
|
2030
2030
|
var item = _iterator__ex2g4s.v();
|
|
2031
2031
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
2032
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
2032
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.g1k(VOID, VOID, listOf(new Parameter(Companion_getInstance().k1h('params'), Custom_init_$Create$('RequestParams'))));
|
|
2033
2033
|
var tmp$ret$1 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
2034
2034
|
destination.x(tmp$ret$1);
|
|
2035
2035
|
}
|
|
2036
|
-
tmp$ret$0 = element.
|
|
2036
|
+
tmp$ret$0 = element.x1n(VOID, destination);
|
|
2037
2037
|
}
|
|
2038
2038
|
tmp = tmp$ret$0;
|
|
2039
2039
|
} else {
|
|
@@ -2045,7 +2045,7 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
2045
2045
|
function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
2046
2046
|
var tmp;
|
|
2047
2047
|
if (stmt instanceof Switch) {
|
|
2048
|
-
var tmp1_safe_receiver = stmt.
|
|
2048
|
+
var tmp1_safe_receiver = stmt.f1p_1;
|
|
2049
2049
|
var tmp_0;
|
|
2050
2050
|
if (tmp1_safe_receiver == null) {
|
|
2051
2051
|
tmp_0 = null;
|
|
@@ -2067,7 +2067,7 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2067
2067
|
tmp_1 = tmp0_elvis_lhs;
|
|
2068
2068
|
}
|
|
2069
2069
|
var errorStmt = tmp_1;
|
|
2070
|
-
var tmp_2 = errorStmt.
|
|
2070
|
+
var tmp_2 = errorStmt.s1p_1;
|
|
2071
2071
|
var tmp1_elvis_lhs = tmp_2 instanceof BinaryOp ? tmp_2 : null;
|
|
2072
2072
|
var tmp_3;
|
|
2073
2073
|
if (tmp1_elvis_lhs == null) {
|
|
@@ -2077,7 +2077,7 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2077
2077
|
tmp_3 = tmp1_elvis_lhs;
|
|
2078
2078
|
}
|
|
2079
2079
|
var binary = tmp_3;
|
|
2080
|
-
var tmp_4 = binary.
|
|
2080
|
+
var tmp_4 = binary.t1p_1;
|
|
2081
2081
|
var tmp2_elvis_lhs = tmp_4 instanceof Literal_0 ? tmp_4 : null;
|
|
2082
2082
|
var tmp_5;
|
|
2083
2083
|
if (tmp2_elvis_lhs == null) {
|
|
@@ -2087,13 +2087,13 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2087
2087
|
tmp_5 = tmp2_elvis_lhs;
|
|
2088
2088
|
}
|
|
2089
2089
|
var literal = tmp_5;
|
|
2090
|
-
tmp$ret$0 = new ErrorStatement(new Literal_0(trimEnd(toString(literal.
|
|
2090
|
+
tmp$ret$0 = new ErrorStatement(new Literal_0(trimEnd(toString(literal.v1o_1), charArrayOf([_Char___init__impl__6a9atx(32)])), literal.w1o_1));
|
|
2091
2091
|
}
|
|
2092
2092
|
destination.x(tmp$ret$0);
|
|
2093
2093
|
}
|
|
2094
2094
|
tmp_0 = destination;
|
|
2095
2095
|
}
|
|
2096
|
-
tmp = transformChildren(stmt.
|
|
2096
|
+
tmp = transformChildren(stmt.i1p(VOID, VOID, tmp_0), transformer);
|
|
2097
2097
|
} else {
|
|
2098
2098
|
tmp = transformChildren(stmt, transformer);
|
|
2099
2099
|
}
|
|
@@ -2103,8 +2103,8 @@ function TypeScriptRefinedTypeDefinitionEmitter() {
|
|
|
2103
2103
|
}
|
|
2104
2104
|
function TypeScriptShared() {
|
|
2105
2105
|
TypeScriptShared_instance = this;
|
|
2106
|
-
this.
|
|
2107
|
-
this.
|
|
2106
|
+
this.h1z_1 = 'community.flock.wirespec';
|
|
2107
|
+
this.i1z_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 ');
|
|
2108
2108
|
}
|
|
2109
2109
|
protoOf(TypeScriptShared).toString = function () {
|
|
2110
2110
|
return 'TypeScriptShared';
|
|
@@ -2134,28 +2134,28 @@ function TypeScriptTypeDefinitionEmitter$emit$lambda(it) {
|
|
|
2134
2134
|
}
|
|
2135
2135
|
function TypeScriptTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2136
2136
|
return function (it) {
|
|
2137
|
-
return this$0.
|
|
2137
|
+
return this$0.aq(it);
|
|
2138
2138
|
};
|
|
2139
2139
|
}
|
|
2140
2140
|
function TypeScriptTypeDefinitionEmitter() {
|
|
2141
2141
|
}
|
|
2142
2142
|
//region block: post-declaration
|
|
2143
|
-
protoOf(TypeScriptEmitter).
|
|
2144
|
-
protoOf(TypeScriptEmitter).
|
|
2145
|
-
protoOf(TypeScriptEmitter).
|
|
2146
|
-
protoOf(TypeScriptEmitter).
|
|
2147
|
-
protoOf(TypeScriptEmitter).
|
|
2148
|
-
protoOf(TypeScriptEmitter).
|
|
2149
|
-
protoOf(TypeScriptEmitter).
|
|
2150
|
-
protoOf(TypeScriptEmitter).
|
|
2151
|
-
protoOf(TypeScriptEmitter).
|
|
2152
|
-
protoOf(TypeScriptEmitter).
|
|
2153
|
-
protoOf(TypeScriptEmitter).
|
|
2154
|
-
protoOf(TypeScriptEmitter).
|
|
2155
|
-
protoOf(TypeScriptEmitter).
|
|
2156
|
-
protoOf(TypeScriptEmitter).
|
|
2157
|
-
protoOf(TypeScriptEmitter).
|
|
2158
|
-
protoOf(TypeScriptIrEmitter).
|
|
2143
|
+
protoOf(TypeScriptEmitter).yp = emit_3;
|
|
2144
|
+
protoOf(TypeScriptEmitter).zp = emit_6;
|
|
2145
|
+
protoOf(TypeScriptEmitter).aq = emit_7;
|
|
2146
|
+
protoOf(TypeScriptEmitter).bq = emit_4;
|
|
2147
|
+
protoOf(TypeScriptEmitter).cq = emit_5;
|
|
2148
|
+
protoOf(TypeScriptEmitter).nr = emit_10;
|
|
2149
|
+
protoOf(TypeScriptEmitter).ir = emit_9;
|
|
2150
|
+
protoOf(TypeScriptEmitter).or = emit_8;
|
|
2151
|
+
protoOf(TypeScriptEmitter).br = emit_2;
|
|
2152
|
+
protoOf(TypeScriptEmitter).pr = emitValidator;
|
|
2153
|
+
protoOf(TypeScriptEmitter).c1z = sanitizeSymbol;
|
|
2154
|
+
protoOf(TypeScriptEmitter).u1v = sanitizeSymbol_0;
|
|
2155
|
+
protoOf(TypeScriptEmitter).d1z = emitPrimitive;
|
|
2156
|
+
protoOf(TypeScriptEmitter).b1z = emitClient;
|
|
2157
|
+
protoOf(TypeScriptEmitter).eq = emitClientEndpointRequest;
|
|
2158
|
+
protoOf(TypeScriptIrEmitter).r1u = emit_1;
|
|
2159
2159
|
//endregion
|
|
2160
2160
|
//region block: exports
|
|
2161
2161
|
export {
|