@flock/wirespec 0.19.3-RC.1 → 0.19.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.mjs +12 -12
- package/arrow-arrow-core.mjs +167 -167
- package/clikt-clikt-mordant.mjs +81 -81
- package/clikt-clikt-mordant.mjs.map +1 -1
- package/clikt-clikt.mjs +1636 -1636
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +448 -448
- package/kotlin-kotlin-stdlib.mjs +2428 -5210
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10248 -10248
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1846 -1846
- package/kotlin-rgxgen.mjs.map +1 -1
- package/kotlinx-io-kotlinx-io-core.mjs +455 -455
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +2101 -2135
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1579 -1579
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1435 -1435
- package/package.json +1 -5
- package/wirespec-src-compiler-core.mjs +1598 -1598
- package/wirespec-src-compiler-emitters-java.mjs +453 -451
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +341 -339
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +430 -428
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +483 -481
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +195 -193
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +501 -499
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +82 -82
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3901 -3909
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +439 -439
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +521 -521
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +859 -859
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +1387 -1387
- package/wirespec-src-ide-lsp.mjs.map +1 -1
- package/wirespec-src-plugin-arguments.mjs +192 -192
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +109 -109
- package/wirespec-src-plugin-npm.d.mts +0 -21
- package/wirespec-src-plugin-npm.mjs +43 -43
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +35 -35
- package/wirespec-src-tools-generator.mjs.map +1 -1
- package/kotest-kotest-assertions-kotest-assertions-core.mjs +0 -4
- package/kotest-kotest-assertions-kotest-assertions-core.mjs.map +0 -1
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs +0 -4
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs.map +0 -1
- package/kotest-kotest-common.mjs +0 -56
- package/kotest-kotest-common.mjs.map +0 -1
- package/kotest-kotest-framework-kotest-framework-engine.mjs +0 -4
- package/kotest-kotest-framework-kotest-framework-engine.mjs.map +0 -1
- package/kotest-kotest-property.mjs +0 -2501
- package/kotest-kotest-property.mjs.map +0 -1
- package/kotlinx-coroutines-test.mjs +0 -4
- package/kotlinx-coroutines-test.mjs.map +0 -1
- package/wirespec-generator.d.ts +0 -51
- package/wirespec-generator.mjs +0 -9
- package/wirespec-src-integration-kotest.mjs +0 -1647
- package/wirespec-src-integration-kotest.mjs.map +0 -1
- package/xmlutil-core.mjs +0 -4
- package/xmlutil-core.mjs.map +0 -1
- package/xmlutil-serialization.mjs +0 -4
- package/xmlutil-serialization.mjs.map +0 -1
|
@@ -175,6 +175,7 @@ import {
|
|
|
175
175
|
requestParameters1z8fdizgtviyb as requestParameters,
|
|
176
176
|
convert32tuiui3czihh as convert_3,
|
|
177
177
|
convert1cn4bolzoed8c as convert_4,
|
|
178
|
+
get_extensions31c4or738wbxz as get_extensions,
|
|
178
179
|
emit3bzdcd0f6nwtj as emit_1,
|
|
179
180
|
beforeGenerate3o8idb3hey1b0 as beforeGenerate,
|
|
180
181
|
IrEmitterh2m93ojzvkep as IrEmitter,
|
|
@@ -194,11 +195,11 @@ var imul = Math.imul;
|
|
|
194
195
|
//endregion
|
|
195
196
|
//region block: pre-declaration
|
|
196
197
|
function emit_2(identifier) {
|
|
197
|
-
return '"' + identifier.
|
|
198
|
+
return '"' + identifier.l1() + '"';
|
|
198
199
|
}
|
|
199
200
|
initMetadataForInterface(TypeScriptIdentifierEmitter, 'TypeScriptIdentifierEmitter');
|
|
200
201
|
function sanitizeSymbol(_this__u8e3s4) {
|
|
201
|
-
return this.
|
|
202
|
+
return this.g1x(_this__u8e3s4.l1());
|
|
202
203
|
}
|
|
203
204
|
function sanitizeSymbol_0(_this__u8e3s4) {
|
|
204
205
|
var tmp = asSequence_0(_this__u8e3s4);
|
|
@@ -212,9 +213,9 @@ function emit_3(type, module_0) {
|
|
|
212
213
|
var _iterator__ex2g4s = this_0.t();
|
|
213
214
|
while (_iterator__ex2g4s.u()) {
|
|
214
215
|
var e = _iterator__ex2g4s.v();
|
|
215
|
-
var key = e.
|
|
216
|
-
if (set.
|
|
217
|
-
list.
|
|
216
|
+
var key = e.bv_1;
|
|
217
|
+
if (set.x(key)) {
|
|
218
|
+
list.x(e);
|
|
218
219
|
}
|
|
219
220
|
}
|
|
220
221
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -223,19 +224,19 @@ function emit_3(type, module_0) {
|
|
|
223
224
|
var _iterator__ex2g4s_0 = list.t();
|
|
224
225
|
while (_iterator__ex2g4s_0.u()) {
|
|
225
226
|
var item = _iterator__ex2g4s_0.v();
|
|
226
|
-
var tmp$ret$2 = 'import {' + item.
|
|
227
|
-
destination.
|
|
227
|
+
var tmp$ret$2 = 'import {' + item.bv_1 + "} from './" + item.bv_1 + "'";
|
|
228
|
+
destination.x(tmp$ret$2);
|
|
228
229
|
}
|
|
229
230
|
var tmp = destination;
|
|
230
|
-
return trimMargin('\n |' + joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda) + '\n |export type ' + this.
|
|
231
|
+
return trimMargin('\n |' + joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda) + '\n |export type ' + this.q20(type.lp_1) + ' = {\n |' + this.lq(type.mp_1) + '\n |}\n |\n ');
|
|
231
232
|
}
|
|
232
233
|
function emit_4(_this__u8e3s4) {
|
|
233
234
|
var tmp;
|
|
234
235
|
if (_this__u8e3s4 instanceof Dict) {
|
|
235
|
-
tmp = 'Record<string, ' + this.
|
|
236
|
+
tmp = 'Record<string, ' + this.nq(_this__u8e3s4.so_1) + '>';
|
|
236
237
|
} else {
|
|
237
238
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
238
|
-
tmp = this.
|
|
239
|
+
tmp = this.nq(_this__u8e3s4.po_1) + '[]';
|
|
239
240
|
} else {
|
|
240
241
|
if (_this__u8e3s4 instanceof Unit) {
|
|
241
242
|
tmp = 'void';
|
|
@@ -244,10 +245,10 @@ function emit_4(_this__u8e3s4) {
|
|
|
244
245
|
tmp = 'any';
|
|
245
246
|
} else {
|
|
246
247
|
if (_this__u8e3s4 instanceof Custom) {
|
|
247
|
-
tmp = this.
|
|
248
|
+
tmp = this.g1x(_this__u8e3s4.bv_1);
|
|
248
249
|
} else {
|
|
249
250
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
250
|
-
tmp = this.
|
|
251
|
+
tmp = this.r20(_this__u8e3s4);
|
|
251
252
|
} else {
|
|
252
253
|
noWhenBranchMatchedException();
|
|
253
254
|
}
|
|
@@ -257,10 +258,10 @@ function emit_4(_this__u8e3s4) {
|
|
|
257
258
|
}
|
|
258
259
|
}
|
|
259
260
|
// Inline function 'kotlin.let' call
|
|
260
|
-
return tmp + (_this__u8e3s4.
|
|
261
|
+
return tmp + (_this__u8e3s4.tu() ? ' | undefined' : '');
|
|
261
262
|
}
|
|
262
263
|
function emitPrimitive(_this__u8e3s4) {
|
|
263
|
-
var tmp0_subject = _this__u8e3s4.
|
|
264
|
+
var tmp0_subject = _this__u8e3s4.fv_1;
|
|
264
265
|
var tmp;
|
|
265
266
|
if (tmp0_subject instanceof String_0) {
|
|
266
267
|
tmp = 'string';
|
|
@@ -288,10 +289,10 @@ function emitPrimitive(_this__u8e3s4) {
|
|
|
288
289
|
function emit_5(_this__u8e3s4) {
|
|
289
290
|
var tmp;
|
|
290
291
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
291
|
-
tmp = Spacer_instance.toString() + 'return ' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.
|
|
292
|
+
tmp = Spacer_instance.toString() + 'return ' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.pt_1) + '.test(value);';
|
|
292
293
|
} else {
|
|
293
294
|
if (_this__u8e3s4 instanceof Bound) {
|
|
294
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
295
|
+
var tmp1_safe_receiver = _this__u8e3s4.fu_1;
|
|
295
296
|
var tmp_0;
|
|
296
297
|
if (tmp1_safe_receiver == null) {
|
|
297
298
|
tmp_0 = null;
|
|
@@ -300,7 +301,7 @@ function emit_5(_this__u8e3s4) {
|
|
|
300
301
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
301
302
|
}
|
|
302
303
|
var minCheck = tmp_0;
|
|
303
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
304
|
+
var tmp2_safe_receiver = _this__u8e3s4.gu_1;
|
|
304
305
|
var tmp_1;
|
|
305
306
|
if (tmp2_safe_receiver == null) {
|
|
306
307
|
tmp_1 = null;
|
|
@@ -328,18 +329,18 @@ function emit_5(_this__u8e3s4) {
|
|
|
328
329
|
return tmp;
|
|
329
330
|
}
|
|
330
331
|
function emit_6(_this__u8e3s4) {
|
|
331
|
-
return joinToString(_this__u8e3s4.
|
|
332
|
+
return joinToString(_this__u8e3s4.ip_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda_0(this));
|
|
332
333
|
}
|
|
333
334
|
function emit_7(_this__u8e3s4) {
|
|
334
|
-
return Spacer_instance.toString() + this.
|
|
335
|
+
return Spacer_instance.toString() + this.nr(_this__u8e3s4.qp_1) + ': ' + this.nq(_this__u8e3s4.rp_1);
|
|
335
336
|
}
|
|
336
337
|
initMetadataForInterface(TypeScriptTypeDefinitionEmitter, 'TypeScriptTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, TypeScriptIdentifierEmitter]);
|
|
337
338
|
function emitClient(ast) {
|
|
338
|
-
var tmp = 'client.' + this.
|
|
339
|
-
var tmp_0 = this.
|
|
339
|
+
var tmp = 'client.' + this.uq().dr_1;
|
|
340
|
+
var tmp_0 = this.qq(ast);
|
|
340
341
|
var tmp_1 = joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, TypeScriptClientEmitter$emitClient$lambda);
|
|
341
342
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
342
|
-
var this_0 = ast.
|
|
343
|
+
var this_0 = ast.rq_1;
|
|
343
344
|
// Inline function 'kotlin.collections.flatMap' call
|
|
344
345
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
345
346
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -347,7 +348,7 @@ function emitClient(ast) {
|
|
|
347
348
|
var _iterator__ex2g4s = tmp0.t();
|
|
348
349
|
while (_iterator__ex2g4s.u()) {
|
|
349
350
|
var element = _iterator__ex2g4s.v();
|
|
350
|
-
var list = new NonEmptyList(element.
|
|
351
|
+
var list = new NonEmptyList(element.tq_1);
|
|
351
352
|
addAll(destination, list);
|
|
352
353
|
}
|
|
353
354
|
var tmp$ret$3 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -367,23 +368,18 @@ function emitClient(ast) {
|
|
|
367
368
|
var _iterator__ex2g4s_1 = destination_0.t();
|
|
368
369
|
while (_iterator__ex2g4s_1.u()) {
|
|
369
370
|
var e = _iterator__ex2g4s_1.v();
|
|
370
|
-
var key = e.
|
|
371
|
-
if (set.
|
|
372
|
-
list_1.
|
|
371
|
+
var key = e.bv_1;
|
|
372
|
+
if (set.x(key)) {
|
|
373
|
+
list_1.x(e);
|
|
373
374
|
}
|
|
374
375
|
}
|
|
375
376
|
var tmp_2 = list_1;
|
|
376
377
|
var tmp_3 = joinToString(tmp_2, '\n', VOID, VOID, VOID, VOID, TypeScriptClientEmitter$emitClient$lambda_0);
|
|
377
|
-
var tmp_4 = this.
|
|
378
|
+
var tmp_4 = this.qq(ast);
|
|
378
379
|
return new Emitted(tmp, trimMargin('\n |import {Wirespec} from "./Wirespec"\n |\n |' + tmp_1 + '\n |\n |' + tmp_3 + '\n |\n |type RawHandler = (req: Wirespec.RawRequest) => Promise<Wirespec.RawResponse>\n |\n |export const client = (serialization: Wirespec.Serialization, handler: RawHandler) => ({\n |' + spacer(joinToString(tmp_4, '\n', VOID, VOID, VOID, VOID, TypeScriptClientEmitter$emitClient$lambda_1(this)), 1) + '\n |})\n |\n '));
|
|
379
380
|
}
|
|
380
381
|
initMetadataForInterface(TypeScriptClientEmitter, 'TypeScriptClientEmitter', VOID, VOID, [ClientEmitter, TypeScriptTypeDefinitionEmitter]);
|
|
381
|
-
function emit_8(
|
|
382
|
-
var tmp = this.z23(enum_0.iv_1);
|
|
383
|
-
return 'export type ' + tmp + ' = ' + joinToString(enum_0.jv_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEnumDefinitionEmitter$emit$lambda) + '\n';
|
|
384
|
-
}
|
|
385
|
-
initMetadataForInterface(TypeScriptEnumDefinitionEmitter, 'TypeScriptEnumDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
386
|
-
function emit_9(endpoint) {
|
|
382
|
+
function emit_8(endpoint) {
|
|
387
383
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
388
384
|
var this_0 = importReferences(endpoint);
|
|
389
385
|
var set = HashSet_init_$Create$();
|
|
@@ -391,9 +387,9 @@ function emit_9(endpoint) {
|
|
|
391
387
|
var _iterator__ex2g4s = this_0.t();
|
|
392
388
|
while (_iterator__ex2g4s.u()) {
|
|
393
389
|
var e = _iterator__ex2g4s.v();
|
|
394
|
-
var key = e.
|
|
395
|
-
if (set.
|
|
396
|
-
list.
|
|
390
|
+
var key = e.bv_1;
|
|
391
|
+
if (set.x(key)) {
|
|
392
|
+
list.x(e);
|
|
397
393
|
}
|
|
398
394
|
}
|
|
399
395
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -402,64 +398,64 @@ function emit_9(endpoint) {
|
|
|
402
398
|
var _iterator__ex2g4s_0 = list.t();
|
|
403
399
|
while (_iterator__ex2g4s_0.u()) {
|
|
404
400
|
var item = _iterator__ex2g4s_0.v();
|
|
405
|
-
var tmp$ret$2 = 'import {type ' + item.
|
|
406
|
-
destination.
|
|
401
|
+
var tmp$ret$2 = 'import {type ' + item.bv_1 + "} from '../model'";
|
|
402
|
+
destination.x(tmp$ret$2);
|
|
407
403
|
}
|
|
408
404
|
var tmp = destination;
|
|
409
405
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda);
|
|
410
|
-
var tmp_1 = this.
|
|
406
|
+
var tmp_1 = this.q20(endpoint.up_1);
|
|
411
407
|
var tmp_2 = get_pathParams(endpoint);
|
|
412
408
|
var tmp_3 = emitType(this, tmp_2, 'Path', TypeScriptEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
413
|
-
var tmp_4 = emitType(this, endpoint.
|
|
414
|
-
var tmp_5 = emitType(this, endpoint.
|
|
415
|
-
var tmp_6 = emitType_1(this, first(endpoint.
|
|
416
|
-
var tmp_7 = distinctByStatus(endpoint.
|
|
409
|
+
var tmp_4 = emitType(this, endpoint.xp_1, 'Queries', TypeScriptEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
410
|
+
var tmp_5 = emitType(this, endpoint.yp_1, 'Headers', TypeScriptEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
411
|
+
var tmp_6 = emitType_1(this, first(endpoint.zp_1), endpoint);
|
|
412
|
+
var tmp_7 = distinctByStatus(endpoint.aq_1);
|
|
417
413
|
var tmp_8 = joinToString(tmp_7, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
418
414
|
var tmp_9 = Spacer_instance.toString();
|
|
419
|
-
var tmp_10 = distinctByStatus(endpoint.
|
|
415
|
+
var tmp_10 = distinctByStatus(endpoint.aq_1);
|
|
420
416
|
var tmp_11 = joinToString(tmp_10, ' | ', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_4(this));
|
|
421
|
-
var tmp_12 = emitFunction_0(this, first(endpoint.
|
|
422
|
-
var tmp_13 = distinctByStatus(endpoint.
|
|
417
|
+
var tmp_12 = emitFunction_0(this, first(endpoint.zp_1), endpoint);
|
|
418
|
+
var tmp_13 = distinctByStatus(endpoint.aq_1);
|
|
423
419
|
var tmp_14 = joinToString(tmp_13, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
424
420
|
var tmp_15 = Spacer_instance.toString();
|
|
425
|
-
var tmp_16 = Spacer_instance.
|
|
421
|
+
var tmp_16 = Spacer_instance.hs(2);
|
|
426
422
|
var tmp_17 = emitHandleFunction(this, endpoint);
|
|
427
423
|
var tmp_18 = Spacer_instance.toString();
|
|
428
|
-
var tmp_19 = prependIndent(emitClient_0(this, endpoint), Spacer_instance.
|
|
429
|
-
var tmp_20 = prependIndent(emitServer(this, endpoint), Spacer_instance.
|
|
424
|
+
var tmp_19 = prependIndent(emitClient_0(this, endpoint), Spacer_instance.hs(1));
|
|
425
|
+
var tmp_20 = prependIndent(emitServer(this, endpoint), Spacer_instance.hs(1));
|
|
430
426
|
var tmp_21 = Spacer_instance.toString();
|
|
431
|
-
var tmp_22 = Spacer_instance.
|
|
432
|
-
var tmp_23 = Companion_instance_0.
|
|
433
|
-
var tmp_24 = Spacer_instance.
|
|
434
|
-
var tmp_25 = Spacer_instance.
|
|
435
|
-
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.
|
|
427
|
+
var tmp_22 = Spacer_instance.hs(2);
|
|
428
|
+
var tmp_23 = Companion_instance_0.fr(this.q20(endpoint.up_1));
|
|
429
|
+
var tmp_24 = Spacer_instance.hs(2);
|
|
430
|
+
var tmp_25 = Spacer_instance.hs(2);
|
|
431
|
+
return trimMargin('\n |' + tmp_0 + '\n |export namespace ' + tmp_1 + ' {\n |' + tmp_3 + '\n |' + tmp_4 + '\n |' + tmp_5 + '\n |' + tmp_6 + '\n |' + tmp_8 + '\n |' + tmp_9 + 'export type Response = ' + tmp_11 + '\n |' + tmp_12 + '\n |' + tmp_14 + '\n |' + tmp_15 + 'export type Handler = {\n |' + tmp_16 + tmp_17 + '\n |' + tmp_18 + '}\n |' + tmp_19 + '\n |' + tmp_20 + '\n |' + tmp_21 + 'export const api = {\n |' + tmp_22 + 'name: "' + tmp_23 + '",\n |' + tmp_24 + 'method: "' + endpoint.vp_1.a3_1 + '",\n |' + tmp_25 + 'path: "' + joinToString(endpoint.wp_1, '/', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_6(this)) + '",\n |' + Spacer_instance.hs(2) + 'server,\n |' + Spacer_instance.hs(2) + 'client\n |' + Spacer_instance.toString() + '} as const\n |}\n |\n ');
|
|
436
432
|
}
|
|
437
433
|
initMetadataForInterface(TypeScriptEndpointDefinitionEmitter, 'TypeScriptEndpointDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
438
|
-
function
|
|
439
|
-
return trimMargin('\n |export type ' + this.
|
|
434
|
+
function emit_9(refined) {
|
|
435
|
+
return trimMargin('\n |export type ' + this.q20(refined.sr_1) + ' = ' + this.nq(refined.tr_1) + ';\n |export const validate' + refined.sr_1.l1() + ' = (value: ' + this.nq(refined.tr_1) + '): value is ' + this.q20(refined.sr_1) + ' => {\n |' + this.bs(refined) + '\n |}\n |\n ');
|
|
440
436
|
}
|
|
441
437
|
function emitValidator(_this__u8e3s4) {
|
|
442
438
|
var defaultReturn = Spacer_instance.toString() + 'return true;';
|
|
443
|
-
var type = _this__u8e3s4.
|
|
439
|
+
var type = _this__u8e3s4.tr_1.fv_1;
|
|
444
440
|
var tmp;
|
|
445
441
|
if (type instanceof Integer) {
|
|
446
|
-
var tmp0_safe_receiver = type.
|
|
447
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
442
|
+
var tmp0_safe_receiver = type.ku_1;
|
|
443
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.oq(tmp0_safe_receiver);
|
|
448
444
|
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
449
445
|
} else {
|
|
450
446
|
if (type instanceof Number_0) {
|
|
451
|
-
var tmp2_safe_receiver = type.
|
|
452
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.
|
|
447
|
+
var tmp2_safe_receiver = type.nu_1;
|
|
448
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.oq(tmp2_safe_receiver);
|
|
453
449
|
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
454
450
|
} else {
|
|
455
451
|
if (type instanceof String_0) {
|
|
456
|
-
var tmp4_safe_receiver = type.
|
|
452
|
+
var tmp4_safe_receiver = type.hu_1;
|
|
457
453
|
var tmp_0;
|
|
458
454
|
var tmp_1 = tmp4_safe_receiver;
|
|
459
455
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
460
456
|
tmp_0 = null;
|
|
461
457
|
} else {
|
|
462
|
-
tmp_0 = this.
|
|
458
|
+
tmp_0 = this.oq(new RegExp_0(tmp4_safe_receiver));
|
|
463
459
|
}
|
|
464
460
|
var tmp5_elvis_lhs = tmp_0;
|
|
465
461
|
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
@@ -479,7 +475,12 @@ function emitValidator(_this__u8e3s4) {
|
|
|
479
475
|
return tmp;
|
|
480
476
|
}
|
|
481
477
|
initMetadataForInterface(TypeScriptRefinedTypeDefinitionEmitter, 'TypeScriptRefinedTypeDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
482
|
-
|
|
478
|
+
function emit_10(enum_0, module_0) {
|
|
479
|
+
var tmp = this.q20(enum_0.xr_1);
|
|
480
|
+
return 'export type ' + tmp + ' = ' + joinToString(enum_0.yr_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEnumDefinitionEmitter$emit$lambda) + '\n';
|
|
481
|
+
}
|
|
482
|
+
initMetadataForInterface(TypeScriptEnumDefinitionEmitter, 'TypeScriptEnumDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
483
|
+
initMetadataForClass(TypeScriptEmitter, 'TypeScriptEmitter', TypeScriptEmitter, LanguageEmitter, [LanguageEmitter, TypeScriptTypeDefinitionEmitter, TypeScriptEndpointDefinitionEmitter, TypeScriptIdentifierEmitter, TypeScriptRefinedTypeDefinitionEmitter, TypeScriptEnumDefinitionEmitter, TypeScriptClientEmitter]);
|
|
483
484
|
initMetadataForClass(EndpointParam, 'EndpointParam');
|
|
484
485
|
initMetadataForCompanion(Companion);
|
|
485
486
|
initMetadataForClass(TypeScriptIrEmitter, 'TypeScriptIrEmitter', TypeScriptIrEmitter, VOID, [IrEmitter]);
|
|
@@ -515,10 +516,10 @@ function emitClientInterface($this, _this__u8e3s4, endpoint) {
|
|
|
515
516
|
return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
516
517
|
}
|
|
517
518
|
function emitFunction($this, endpoint, request) {
|
|
518
|
-
var tmp = endpoint.
|
|
519
|
+
var tmp = endpoint.up_1.l1();
|
|
519
520
|
var tmp_0 = emitClientInterface($this, request, endpoint);
|
|
520
521
|
var tmp_1 = Spacer_instance.toString();
|
|
521
|
-
var tmp_2 = endpoint.
|
|
522
|
+
var tmp_2 = endpoint.up_1.l1();
|
|
522
523
|
// Inline function 'kotlin.takeIf' call
|
|
523
524
|
var this_0 = paramList(request, endpoint);
|
|
524
525
|
var tmp_3;
|
|
@@ -538,31 +539,31 @@ function emitFunction($this, endpoint, request) {
|
|
|
538
539
|
// Inline function 'kotlin.text.orEmpty' call
|
|
539
540
|
var tmp0_elvis_lhs = tmp_4;
|
|
540
541
|
var tmp$ret$5 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
541
|
-
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.
|
|
542
|
+
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.up_1.l1() + '.client(serialization).to(req)\n |' + Spacer_instance.toString() + 'const rawResponse = await handler(rawRequest)\n |' + Spacer_instance.toString() + 'return ' + endpoint.up_1.l1() + '.client(serialization).from(rawResponse)\n |},\n ');
|
|
542
543
|
}
|
|
543
544
|
function TypeScriptClientEmitter$emitClient$lambda(_destruct__k2r9zo) {
|
|
544
|
-
var endpoint = _destruct__k2r9zo.
|
|
545
|
-
return 'import {' + endpoint.
|
|
545
|
+
var endpoint = _destruct__k2r9zo.ve();
|
|
546
|
+
return 'import {' + endpoint.up_1.l1() + '} from "./endpoint/' + endpoint.up_1.l1() + '"';
|
|
546
547
|
}
|
|
547
548
|
function TypeScriptClientEmitter$emitClient$lambda_0(it) {
|
|
548
|
-
return 'import {type ' + it.
|
|
549
|
+
return 'import {type ' + it.bv_1 + '} from "./model/' + it.bv_1 + '"';
|
|
549
550
|
}
|
|
550
551
|
function TypeScriptClientEmitter$emitClient$lambda_1(this$0) {
|
|
551
552
|
return function (_destruct__k2r9zo) {
|
|
552
|
-
var endpoint = _destruct__k2r9zo.
|
|
553
|
-
var request = _destruct__k2r9zo.
|
|
553
|
+
var endpoint = _destruct__k2r9zo.ve();
|
|
554
|
+
var request = _destruct__k2r9zo.we();
|
|
554
555
|
return emitFunction(this$0, endpoint, request);
|
|
555
556
|
};
|
|
556
557
|
}
|
|
557
558
|
function TypeScriptClientEmitter$emitClientInterface$lambda(this$0) {
|
|
558
559
|
return function (it) {
|
|
559
|
-
return this$0.
|
|
560
|
+
return this$0.nr(it.zq_1) + ': ' + this$0.nq(it.ar_1);
|
|
560
561
|
};
|
|
561
562
|
}
|
|
562
563
|
function TypeScriptClientEmitter() {
|
|
563
564
|
}
|
|
564
565
|
function TypeScriptEmitter$emit$lambda(it) {
|
|
565
|
-
return 'export {' + it.
|
|
566
|
+
return 'export {' + it.mr().l1() + "} from './" + it.mr().l1() + "'";
|
|
566
567
|
}
|
|
567
568
|
function TypeScriptEmitter$emit$lambda_0(it) {
|
|
568
569
|
// Inline function 'kotlin.text.trimStart' call
|
|
@@ -570,36 +571,36 @@ function TypeScriptEmitter$emit$lambda_0(it) {
|
|
|
570
571
|
}
|
|
571
572
|
function TypeScriptEmitter$emit$lambda_1(this$0) {
|
|
572
573
|
return function (it) {
|
|
573
|
-
return this$0.
|
|
574
|
+
return this$0.nq(it);
|
|
574
575
|
};
|
|
575
576
|
}
|
|
576
577
|
function TypeScriptEmitter() {
|
|
577
578
|
LanguageEmitter.call(this);
|
|
578
|
-
this.
|
|
579
|
-
this.
|
|
580
|
-
this.
|
|
579
|
+
this.s20_1 = FileExtension_TypeScript_getInstance();
|
|
580
|
+
this.t20_1 = TypeScriptShared_getInstance();
|
|
581
|
+
this.u20_1 = '//';
|
|
581
582
|
}
|
|
582
|
-
protoOf(TypeScriptEmitter).
|
|
583
|
-
return this.
|
|
583
|
+
protoOf(TypeScriptEmitter).uq = function () {
|
|
584
|
+
return this.s20_1;
|
|
584
585
|
};
|
|
585
|
-
protoOf(TypeScriptEmitter).
|
|
586
|
-
return this.
|
|
586
|
+
protoOf(TypeScriptEmitter).d1x = function () {
|
|
587
|
+
return this.t20_1;
|
|
587
588
|
};
|
|
588
|
-
protoOf(TypeScriptEmitter).
|
|
589
|
-
return this.
|
|
589
|
+
protoOf(TypeScriptEmitter).vq = function () {
|
|
590
|
+
return this.u20_1;
|
|
590
591
|
};
|
|
591
|
-
protoOf(TypeScriptEmitter).
|
|
592
|
+
protoOf(TypeScriptEmitter).eo = function (ast, logger) {
|
|
592
593
|
// Inline function 'kotlin.run' call
|
|
593
|
-
var $this$run = protoOf(LanguageEmitter).
|
|
594
|
+
var $this$run = protoOf(LanguageEmitter).eo.call(this, ast, logger);
|
|
594
595
|
var tmp;
|
|
595
596
|
if (hasEndpoints(ast)) {
|
|
596
|
-
tmp = NonEmptyList__plus_impl_xqmb9($this$run, this.
|
|
597
|
+
tmp = NonEmptyList__plus_impl_xqmb9($this$run, this.p20(ast));
|
|
597
598
|
} else {
|
|
598
599
|
tmp = $this$run;
|
|
599
600
|
}
|
|
600
601
|
var tmp_0 = tmp;
|
|
601
602
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
602
|
-
var this_0 = ast.
|
|
603
|
+
var this_0 = ast.rq_1;
|
|
603
604
|
// Inline function 'kotlin.collections.flatMap' call
|
|
604
605
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
605
606
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -607,7 +608,7 @@ protoOf(TypeScriptEmitter).pr = function (ast, logger) {
|
|
|
607
608
|
var _iterator__ex2g4s = tmp0.t();
|
|
608
609
|
while (_iterator__ex2g4s.u()) {
|
|
609
610
|
var element = _iterator__ex2g4s.v();
|
|
610
|
-
var list = new NonEmptyList(element.
|
|
611
|
+
var list = new NonEmptyList(element.tq_1);
|
|
611
612
|
addAll(destination, list);
|
|
612
613
|
}
|
|
613
614
|
var tmp$ret$5 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -620,47 +621,47 @@ protoOf(TypeScriptEmitter).pr = function (ast, logger) {
|
|
|
620
621
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
621
622
|
var key = namespace(element_0);
|
|
622
623
|
// Inline function 'kotlin.collections.getOrPut' call
|
|
623
|
-
var value = destination_0.
|
|
624
|
+
var value = destination_0.p2(key);
|
|
624
625
|
var tmp_1;
|
|
625
626
|
if (value == null) {
|
|
626
627
|
var answer = ArrayList_init_$Create$();
|
|
627
|
-
destination_0.
|
|
628
|
+
destination_0.s2(key, answer);
|
|
628
629
|
tmp_1 = answer;
|
|
629
630
|
} else {
|
|
630
631
|
tmp_1 = value;
|
|
631
632
|
}
|
|
632
633
|
var list_0 = tmp_1;
|
|
633
|
-
list_0.
|
|
634
|
+
list_0.x(element_0);
|
|
634
635
|
}
|
|
635
636
|
// Inline function 'kotlin.collections.map' call
|
|
636
637
|
// Inline function 'kotlin.collections.mapTo' call
|
|
637
|
-
var destination_1 = ArrayList_init_$Create$_0(destination_0.
|
|
638
|
+
var destination_1 = ArrayList_init_$Create$_0(destination_0.a1());
|
|
638
639
|
// Inline function 'kotlin.collections.iterator' call
|
|
639
|
-
var _iterator__ex2g4s_1 = destination_0.
|
|
640
|
+
var _iterator__ex2g4s_1 = destination_0.j1().t();
|
|
640
641
|
while (_iterator__ex2g4s_1.u()) {
|
|
641
642
|
var item = _iterator__ex2g4s_1.v();
|
|
642
643
|
// Inline function 'kotlin.collections.component1' call
|
|
643
|
-
var ns = item.
|
|
644
|
+
var ns = item.k1();
|
|
644
645
|
// Inline function 'kotlin.collections.component2' call
|
|
645
|
-
var defs = item.
|
|
646
|
-
var tmp_2 = ns + '/index.' + this.
|
|
646
|
+
var defs = item.l1();
|
|
647
|
+
var tmp_2 = ns + '/index.' + this.uq().dr_1;
|
|
647
648
|
var tmp$ret$14 = new Emitted(tmp_2, joinToString(defs, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda));
|
|
648
|
-
destination_1.
|
|
649
|
+
destination_1.x(tmp$ret$14);
|
|
649
650
|
}
|
|
650
651
|
return NonEmptyList__plus_impl_xqmb9_0(tmp_0, destination_1);
|
|
651
652
|
};
|
|
652
|
-
protoOf(TypeScriptEmitter).
|
|
653
|
+
protoOf(TypeScriptEmitter).kr = function (module_0, logger) {
|
|
653
654
|
// Inline function 'kotlin.let' call
|
|
654
|
-
var it = protoOf(LanguageEmitter).
|
|
655
|
-
return NonEmptyList__plus_impl_xqmb9(it, new Emitted('Wirespec', this.
|
|
655
|
+
var it = protoOf(LanguageEmitter).kr.call(this, module_0, logger);
|
|
656
|
+
return NonEmptyList__plus_impl_xqmb9(it, new Emitted('Wirespec', this.d1x().w20_1));
|
|
656
657
|
};
|
|
657
|
-
protoOf(TypeScriptEmitter).
|
|
658
|
+
protoOf(TypeScriptEmitter).lr = function (definition, module_0, logger) {
|
|
658
659
|
// Inline function 'kotlin.let' call
|
|
659
|
-
var it = protoOf(LanguageEmitter).
|
|
660
|
-
var subPackageName = plus(Companion_instance.
|
|
661
|
-
return new Emitted(subPackageName.
|
|
660
|
+
var it = protoOf(LanguageEmitter).lr.call(this, definition, module_0, logger);
|
|
661
|
+
var subPackageName = plus(Companion_instance.cs(''), definition);
|
|
662
|
+
return new Emitted(subPackageName.fs() + this.g1x(it.yo_1), trimMargin("\n |import {Wirespec} from '../Wirespec'\n |\n |" + it.zo_1 + '\n '));
|
|
662
663
|
};
|
|
663
|
-
protoOf(TypeScriptEmitter).
|
|
664
|
+
protoOf(TypeScriptEmitter).pr = function (union) {
|
|
664
665
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
665
666
|
var this_0 = importReferences(union);
|
|
666
667
|
var set = HashSet_init_$Create$();
|
|
@@ -668,9 +669,9 @@ protoOf(TypeScriptEmitter).av = function (union) {
|
|
|
668
669
|
var _iterator__ex2g4s = this_0.t();
|
|
669
670
|
while (_iterator__ex2g4s.u()) {
|
|
670
671
|
var e = _iterator__ex2g4s.v();
|
|
671
|
-
var key = e.
|
|
672
|
-
if (set.
|
|
673
|
-
list.
|
|
672
|
+
var key = e.bv_1;
|
|
673
|
+
if (set.x(key)) {
|
|
674
|
+
list.x(e);
|
|
674
675
|
}
|
|
675
676
|
}
|
|
676
677
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -679,24 +680,24 @@ protoOf(TypeScriptEmitter).av = function (union) {
|
|
|
679
680
|
var _iterator__ex2g4s_0 = list.t();
|
|
680
681
|
while (_iterator__ex2g4s_0.u()) {
|
|
681
682
|
var item = _iterator__ex2g4s_0.v();
|
|
682
|
-
var tmp$ret$2 = 'import {type ' + item.
|
|
683
|
-
destination.
|
|
683
|
+
var tmp$ret$2 = 'import {type ' + item.bv_1 + "} from '../model'";
|
|
684
|
+
destination.x(tmp$ret$2);
|
|
684
685
|
}
|
|
685
686
|
var tmp = destination;
|
|
686
687
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda_0);
|
|
687
|
-
var tmp_1 = this.
|
|
688
|
-
return trimMargin('\n |' + tmp_0 + '\n |export type ' + tmp_1 + ' = ' + joinToString(union.
|
|
688
|
+
var tmp_1 = this.q20(union.gp_1);
|
|
689
|
+
return trimMargin('\n |' + tmp_0 + '\n |export type ' + tmp_1 + ' = ' + joinToString(union.hp_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda_1(this)) + '\n |\n ');
|
|
689
690
|
};
|
|
690
|
-
protoOf(TypeScriptEmitter).
|
|
691
|
-
return this.
|
|
691
|
+
protoOf(TypeScriptEmitter).or = function (channel) {
|
|
692
|
+
return this.wq();
|
|
692
693
|
};
|
|
693
694
|
function emit_11($this, _this__u8e3s4) {
|
|
694
695
|
var tmp;
|
|
695
696
|
if (_this__u8e3s4 instanceof Literal) {
|
|
696
|
-
tmp = _this__u8e3s4.
|
|
697
|
+
tmp = _this__u8e3s4.xq_1;
|
|
697
698
|
} else {
|
|
698
699
|
if (_this__u8e3s4 instanceof Param) {
|
|
699
|
-
tmp = ':' + _this__u8e3s4.
|
|
700
|
+
tmp = ':' + _this__u8e3s4.bq_1.l1();
|
|
700
701
|
} else {
|
|
701
702
|
noWhenBranchMatchedException();
|
|
702
703
|
}
|
|
@@ -704,64 +705,64 @@ function emit_11($this, _this__u8e3s4) {
|
|
|
704
705
|
return tmp;
|
|
705
706
|
}
|
|
706
707
|
function emitClient_0($this, _this__u8e3s4) {
|
|
707
|
-
return trimMargin('\n |export const client: Wirespec.Client<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitClientTo($this, _this__u8e3s4), Spacer_instance.
|
|
708
|
+
return trimMargin('\n |export const client: Wirespec.Client<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitClientTo($this, _this__u8e3s4), Spacer_instance.hs(1)) + ',\n |' + prependIndent(emitClientFrom($this, _this__u8e3s4), Spacer_instance.hs(1)) + '\n |})\n ');
|
|
708
709
|
}
|
|
709
710
|
function emitClientTo($this, _this__u8e3s4) {
|
|
710
|
-
var tmp = Spacer_instance.
|
|
711
|
+
var tmp = Spacer_instance.hs(1);
|
|
711
712
|
// Inline function 'kotlin.text.uppercase' call
|
|
712
713
|
// Inline function 'kotlin.js.asDynamic' call
|
|
713
|
-
var tmp_0 = _this__u8e3s4.
|
|
714
|
-
var tmp_1 = Spacer_instance.
|
|
714
|
+
var tmp_0 = _this__u8e3s4.vp_1.a3_1.toUpperCase();
|
|
715
|
+
var tmp_1 = Spacer_instance.hs(1);
|
|
715
716
|
var tmp_2 = emitPathArray($this, _this__u8e3s4);
|
|
716
|
-
var tmp_3 = Spacer_instance.
|
|
717
|
-
var tmp_4 = joinToString(_this__u8e3s4.
|
|
718
|
-
var tmp_5 = Spacer_instance.
|
|
719
|
-
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.
|
|
717
|
+
var tmp_3 = Spacer_instance.hs(1);
|
|
718
|
+
var tmp_4 = joinToString(_this__u8e3s4.xp_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientTo$lambda($this));
|
|
719
|
+
var tmp_5 = Spacer_instance.hs(1);
|
|
720
|
+
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.yp_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientTo$lambda_0($this)) + '},\n |' + Spacer_instance.hs(1) + 'body: serialization.serialize(it.body)\n |})\n ');
|
|
720
721
|
}
|
|
721
722
|
function emitClientFrom($this, _this__u8e3s4) {
|
|
722
|
-
var tmp = Spacer_instance.
|
|
723
|
-
var tmp_0 = distinctByStatus(_this__u8e3s4.
|
|
724
|
-
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.
|
|
723
|
+
var tmp = Spacer_instance.hs(1);
|
|
724
|
+
var tmp_0 = distinctByStatus(_this__u8e3s4.aq_1);
|
|
725
|
+
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.hs(2)) + '\n |' + Spacer_instance.hs(2) + 'default:\n |' + Spacer_instance.hs(3) + 'throw new Error(`Cannot internalize response with status: ${it.status}`);\n |' + Spacer_instance.hs(1) + '}\n |}\n ');
|
|
725
726
|
}
|
|
726
727
|
function emitClientFromResponse($this, _this__u8e3s4) {
|
|
727
|
-
var tmp = fixStatus(_this__u8e3s4.
|
|
728
|
-
var tmp_0 = Spacer_instance.
|
|
729
|
-
var tmp_1 = Spacer_instance.
|
|
730
|
-
var tmp_2 = fixStatus(_this__u8e3s4.
|
|
731
|
-
var tmp_3 = Spacer_instance.
|
|
732
|
-
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.
|
|
728
|
+
var tmp = fixStatus(_this__u8e3s4.gq_1);
|
|
729
|
+
var tmp_0 = Spacer_instance.hs(1);
|
|
730
|
+
var tmp_1 = Spacer_instance.hs(2);
|
|
731
|
+
var tmp_2 = fixStatus(_this__u8e3s4.gq_1);
|
|
732
|
+
var tmp_3 = Spacer_instance.hs(2);
|
|
733
|
+
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.hq_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientFromResponse$lambda($this)) + '},\n |' + Spacer_instance.hs(2) + 'body: serialization.deserialize<' + emitReference($this, _this__u8e3s4) + '>(it.body)\n |' + Spacer_instance.hs(1) + '};\n ');
|
|
733
734
|
}
|
|
734
735
|
function emitServer($this, _this__u8e3s4) {
|
|
735
|
-
return trimMargin('\n |export const server:Wirespec.Server<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitServerFrom($this, _this__u8e3s4), Spacer_instance.
|
|
736
|
+
return trimMargin('\n |export const server:Wirespec.Server<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitServerFrom($this, _this__u8e3s4), Spacer_instance.hs(1)) + ',\n |' + prependIndent(emitServerTo($this, _this__u8e3s4), Spacer_instance.hs(1)) + '\n |})\n ');
|
|
736
737
|
}
|
|
737
738
|
function emitServerFrom($this, _this__u8e3s4) {
|
|
738
|
-
var tmp = Spacer_instance.
|
|
739
|
-
var tmp_0 = Spacer_instance.
|
|
739
|
+
var tmp = Spacer_instance.hs(1);
|
|
740
|
+
var tmp_0 = Spacer_instance.hs(2);
|
|
740
741
|
// Inline function 'kotlin.text.uppercase' call
|
|
741
742
|
// Inline function 'kotlin.js.asDynamic' call
|
|
742
|
-
var tmp_1 = _this__u8e3s4.
|
|
743
|
-
var tmp_2 = Spacer_instance.
|
|
743
|
+
var tmp_1 = _this__u8e3s4.vp_1.a3_1.toUpperCase();
|
|
744
|
+
var tmp_2 = Spacer_instance.hs(2);
|
|
744
745
|
var tmp_3 = get_indexedPathParams(_this__u8e3s4);
|
|
745
|
-
var tmp_4 = prependIndent(joinToString(tmp_3, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda($this)), Spacer_instance.
|
|
746
|
-
var tmp_5 = Spacer_instance.
|
|
747
|
-
var tmp_6 = Spacer_instance.
|
|
748
|
-
var tmp_7 = joinToString(_this__u8e3s4.
|
|
749
|
-
var tmp_8 = Spacer_instance.
|
|
750
|
-
var tmp_9 = Spacer_instance.
|
|
751
|
-
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.
|
|
746
|
+
var tmp_4 = prependIndent(joinToString(tmp_3, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda($this)), Spacer_instance.hs(3));
|
|
747
|
+
var tmp_5 = Spacer_instance.hs(2);
|
|
748
|
+
var tmp_6 = Spacer_instance.hs(2);
|
|
749
|
+
var tmp_7 = joinToString(_this__u8e3s4.xp_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_0($this));
|
|
750
|
+
var tmp_8 = Spacer_instance.hs(2);
|
|
751
|
+
var tmp_9 = Spacer_instance.hs(2);
|
|
752
|
+
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.yp_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_1($this)) + '\n |' + Spacer_instance.hs(2) + '},\n |' + Spacer_instance.hs(2) + 'body: serialization.deserialize(it.body)\n |' + Spacer_instance.hs(1) + '}\n |}\n ');
|
|
752
753
|
}
|
|
753
754
|
function emitServerTo($this, _this__u8e3s4) {
|
|
754
|
-
var tmp = Spacer_instance.
|
|
755
|
-
var tmp_0 = distinctByStatus(_this__u8e3s4.
|
|
756
|
-
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.
|
|
755
|
+
var tmp = Spacer_instance.hs(1);
|
|
756
|
+
var tmp_0 = distinctByStatus(_this__u8e3s4.aq_1);
|
|
757
|
+
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.hs(2)) + '\n |' + Spacer_instance.hs(1) + '}\n |}\n ');
|
|
757
758
|
}
|
|
758
759
|
function emitServerToResponse($this, _this__u8e3s4) {
|
|
759
|
-
var tmp = fixStatus(_this__u8e3s4.
|
|
760
|
-
var tmp_0 = Spacer_instance.
|
|
761
|
-
var tmp_1 = Spacer_instance.
|
|
762
|
-
var tmp_2 = fixStatus(_this__u8e3s4.
|
|
763
|
-
var tmp_3 = Spacer_instance.
|
|
764
|
-
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {\n |' + prependIndent(joinToString(_this__u8e3s4.
|
|
760
|
+
var tmp = fixStatus(_this__u8e3s4.gq_1);
|
|
761
|
+
var tmp_0 = Spacer_instance.hs(1);
|
|
762
|
+
var tmp_1 = Spacer_instance.hs(2);
|
|
763
|
+
var tmp_2 = fixStatus(_this__u8e3s4.gq_1);
|
|
764
|
+
var tmp_3 = Spacer_instance.hs(2);
|
|
765
|
+
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {\n |' + prependIndent(joinToString(_this__u8e3s4.hq_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerToResponse$lambda($this)), Spacer_instance.hs(3)) + '\n |' + Spacer_instance.hs(2) + '} as Record<string, string>,\n |' + Spacer_instance.hs(2) + 'body: serialization.serialize(it.body),\n |' + Spacer_instance.hs(1) + '};\n ');
|
|
765
766
|
}
|
|
766
767
|
function emitType($this, _this__u8e3s4, name, block) {
|
|
767
768
|
var tmp;
|
|
@@ -774,7 +775,7 @@ function emitType($this, _this__u8e3s4, name, block) {
|
|
|
774
775
|
return tmp;
|
|
775
776
|
}
|
|
776
777
|
function emitName($this, _this__u8e3s4) {
|
|
777
|
-
return 'Response' + Companion_instance_0.
|
|
778
|
+
return 'Response' + Companion_instance_0.er(_this__u8e3s4.gq_1);
|
|
778
779
|
}
|
|
779
780
|
function emitFunction_0($this, _this__u8e3s4, endpoint) {
|
|
780
781
|
var tmp = Spacer_instance.toString();
|
|
@@ -800,18 +801,18 @@ function emitFunction_0($this, _this__u8e3s4, endpoint) {
|
|
|
800
801
|
// Inline function 'kotlin.text.orEmpty' call
|
|
801
802
|
var tmp0_elvis_lhs = tmp_4;
|
|
802
803
|
var tmp_5 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
803
|
-
var tmp_6 = Spacer_instance.
|
|
804
|
+
var tmp_6 = Spacer_instance.hs(2);
|
|
804
805
|
var tmp_7 = get_pathParams(endpoint);
|
|
805
806
|
var tmp_8 = joinToObject($this, tmp_7, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_0($this));
|
|
806
|
-
var tmp_9 = Spacer_instance.
|
|
807
|
-
var tmp_10 = endpoint.
|
|
808
|
-
var tmp_11 = Spacer_instance.
|
|
809
|
-
var tmp_12 = joinToObject($this, endpoint.
|
|
810
|
-
var tmp_13 = Spacer_instance.
|
|
811
|
-
var tmp_14 = joinToObject($this, endpoint.
|
|
812
|
-
var tmp_15 = Spacer_instance.
|
|
807
|
+
var tmp_9 = Spacer_instance.hs(2);
|
|
808
|
+
var tmp_10 = endpoint.vp_1.toString();
|
|
809
|
+
var tmp_11 = Spacer_instance.hs(2);
|
|
810
|
+
var tmp_12 = joinToObject($this, endpoint.xp_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_1($this));
|
|
811
|
+
var tmp_13 = Spacer_instance.hs(2);
|
|
812
|
+
var tmp_14 = joinToObject($this, endpoint.yp_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_2($this));
|
|
813
|
+
var tmp_15 = Spacer_instance.hs(2);
|
|
813
814
|
var tmp_16;
|
|
814
|
-
if (_this__u8e3s4.
|
|
815
|
+
if (_this__u8e3s4.dq_1 == null) {
|
|
815
816
|
tmp_16 = null;
|
|
816
817
|
} else {
|
|
817
818
|
// Inline function 'kotlin.let' call
|
|
@@ -822,11 +823,11 @@ function emitFunction_0($this, _this__u8e3s4, endpoint) {
|
|
|
822
823
|
}
|
|
823
824
|
function emitFunction_1($this, _this__u8e3s4) {
|
|
824
825
|
var tmp = Spacer_instance.toString();
|
|
825
|
-
var tmp_0 = Companion_instance_0.
|
|
826
|
+
var tmp_0 = Companion_instance_0.er(_this__u8e3s4.gq_1);
|
|
826
827
|
var tmp_1 = paramList_0(_this__u8e3s4);
|
|
827
828
|
var tmp_2 = joinToObject($this, tmp_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3($this));
|
|
828
829
|
var tmp_3 = Spacer_instance.toString();
|
|
829
|
-
var tmp_4 = Companion_instance_0.
|
|
830
|
+
var tmp_4 = Companion_instance_0.er(_this__u8e3s4.gq_1);
|
|
830
831
|
// Inline function 'kotlin.takeIf' call
|
|
831
832
|
var this_0 = paramList_0(_this__u8e3s4);
|
|
832
833
|
var tmp_5;
|
|
@@ -841,19 +842,19 @@ function emitFunction_1($this, _this__u8e3s4) {
|
|
|
841
842
|
tmp_6 = null;
|
|
842
843
|
} else {
|
|
843
844
|
// Inline function 'kotlin.run' call
|
|
844
|
-
tmp_6 = 'params: Response' + Companion_instance_0.
|
|
845
|
+
tmp_6 = 'params: Response' + Companion_instance_0.er(_this__u8e3s4.gq_1) + 'Params';
|
|
845
846
|
}
|
|
846
847
|
// Inline function 'kotlin.text.orEmpty' call
|
|
847
848
|
var tmp0_elvis_lhs = tmp_6;
|
|
848
849
|
var tmp_7 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
849
|
-
var tmp_8 = Companion_instance_0.
|
|
850
|
-
var tmp_9 = Spacer_instance.
|
|
851
|
-
var tmp_10 = fixStatus(_this__u8e3s4.
|
|
852
|
-
var tmp_11 = Spacer_instance.
|
|
853
|
-
var tmp_12 = joinToObject($this, _this__u8e3s4.
|
|
854
|
-
var tmp_13 = Spacer_instance.
|
|
850
|
+
var tmp_8 = Companion_instance_0.er(_this__u8e3s4.gq_1);
|
|
851
|
+
var tmp_9 = Spacer_instance.hs(2);
|
|
852
|
+
var tmp_10 = fixStatus(_this__u8e3s4.gq_1);
|
|
853
|
+
var tmp_11 = Spacer_instance.hs(2);
|
|
854
|
+
var tmp_12 = joinToObject($this, _this__u8e3s4.hq_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_4($this));
|
|
855
|
+
var tmp_13 = Spacer_instance.hs(2);
|
|
855
856
|
var tmp_14;
|
|
856
|
-
if (_this__u8e3s4.
|
|
857
|
+
if (_this__u8e3s4.iq_1 == null) {
|
|
857
858
|
tmp_14 = null;
|
|
858
859
|
} else {
|
|
859
860
|
// Inline function 'kotlin.let' call
|
|
@@ -863,60 +864,60 @@ function emitFunction_1($this, _this__u8e3s4) {
|
|
|
863
864
|
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 ');
|
|
864
865
|
}
|
|
865
866
|
function emitReference($this, _this__u8e3s4) {
|
|
866
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
867
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
868
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
867
|
+
var tmp0_safe_receiver = _this__u8e3s4.iq_1;
|
|
868
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.fq_1;
|
|
869
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.nq(tmp1_safe_receiver);
|
|
869
870
|
return tmp2_elvis_lhs == null ? 'undefined' : tmp2_elvis_lhs;
|
|
870
871
|
}
|
|
871
872
|
function emitPathArray($this, _this__u8e3s4) {
|
|
872
|
-
return joinToString(_this__u8e3s4.
|
|
873
|
+
return joinToString(_this__u8e3s4.wp_1, ', ', '[', ']', VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda($this));
|
|
873
874
|
}
|
|
874
875
|
function emitType_0($this, _this__u8e3s4) {
|
|
875
876
|
var tmp = Spacer_instance.toString();
|
|
876
877
|
var tmp_0 = emitName($this, _this__u8e3s4);
|
|
877
|
-
var tmp_1 = Spacer_instance.
|
|
878
|
-
var tmp_2 = fixStatus(_this__u8e3s4.
|
|
879
|
-
var tmp_3 = Spacer_instance.
|
|
880
|
-
return trimMargin('\n |' + tmp + 'export type ' + tmp_0 + ' = {\n |' + tmp_1 + 'status: ' + tmp_2 + '\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.
|
|
878
|
+
var tmp_1 = Spacer_instance.hs(2);
|
|
879
|
+
var tmp_2 = fixStatus(_this__u8e3s4.gq_1);
|
|
880
|
+
var tmp_3 = Spacer_instance.hs(2);
|
|
881
|
+
return trimMargin('\n |' + tmp + 'export type ' + tmp_0 + ' = {\n |' + tmp_1 + 'status: ' + tmp_2 + '\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.hq_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitType$lambda_0($this)) + '}\n |' + Spacer_instance.hs(2) + 'body: ' + emitReference($this, _this__u8e3s4) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
881
882
|
}
|
|
882
883
|
function emitReference_0($this, _this__u8e3s4) {
|
|
883
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
884
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
885
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
884
|
+
var tmp0_safe_receiver = _this__u8e3s4.dq_1;
|
|
885
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.fq_1;
|
|
886
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.nq(tmp1_safe_receiver);
|
|
886
887
|
return tmp2_elvis_lhs == null ? 'undefined' : tmp2_elvis_lhs;
|
|
887
888
|
}
|
|
888
889
|
function emitType_1($this, _this__u8e3s4, endpoint) {
|
|
889
|
-
return trimMargin('\n |' + Spacer_instance.toString() + 'export type Request = {\n |' + Spacer_instance.
|
|
890
|
+
return trimMargin('\n |' + Spacer_instance.toString() + 'export type Request = {\n |' + Spacer_instance.hs(2) + 'path: Path\n |' + Spacer_instance.hs(2) + 'method: "' + endpoint.vp_1.toString() + '"\n |' + Spacer_instance.hs(2) + 'queries: Queries\n |' + Spacer_instance.hs(2) + 'headers: Headers\n |' + Spacer_instance.hs(2) + 'body: ' + emitReference_0($this, _this__u8e3s4) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
890
891
|
}
|
|
891
892
|
function emit_12($this, _this__u8e3s4) {
|
|
892
|
-
return Spacer_instance.toString() + $this.
|
|
893
|
+
return Spacer_instance.toString() + $this.nr(_this__u8e3s4.bq_1) + ': ' + $this.nq(_this__u8e3s4.cq_1);
|
|
893
894
|
}
|
|
894
895
|
function emit_13($this, _this__u8e3s4) {
|
|
895
|
-
return $this.
|
|
896
|
+
return $this.nr(_this__u8e3s4.zq_1) + (_this__u8e3s4.ar_1.tu() ? '?' : '') + ': ' + $this.nq(_this__u8e3s4.ar_1.vu(false));
|
|
896
897
|
}
|
|
897
898
|
function emitDeserialize($this, _this__u8e3s4) {
|
|
898
|
-
return $this.
|
|
899
|
+
return $this.nr(_this__u8e3s4.ue_1.bq_1) + ': serialization.deserialize(it.path[' + _this__u8e3s4.te_1 + '])';
|
|
899
900
|
}
|
|
900
901
|
function emitDeserialize_0($this, _this__u8e3s4, fields, caseSensitive) {
|
|
901
|
-
return caseSensitive ? $this.
|
|
902
|
+
return caseSensitive ? $this.nr(_this__u8e3s4.qp_1) + ': serialization.deserialize(it.' + fields + '[' + $this.nr(_this__u8e3s4.qp_1) + '])' : $this.nr(_this__u8e3s4.qp_1) + ': serialization.deserialize(Object.entries(it.' + fields + ').find(([key]) => key.toLowerCase() === ' + $this.nr(lowercase($this, _this__u8e3s4.qp_1)) + ')?.[1])';
|
|
902
903
|
}
|
|
903
904
|
function emitDeserialize$default($this, _this__u8e3s4, fields, caseSensitive, $super) {
|
|
904
905
|
caseSensitive = caseSensitive === VOID ? true : caseSensitive;
|
|
905
906
|
return emitDeserialize_0($this, _this__u8e3s4, fields, caseSensitive);
|
|
906
907
|
}
|
|
907
908
|
function emitSerialize($this, _this__u8e3s4, fields) {
|
|
908
|
-
return $this.
|
|
909
|
+
return $this.nr(_this__u8e3s4.qp_1) + ': serialization.serialize(it.' + fields + '[' + $this.nr(_this__u8e3s4.qp_1) + '])';
|
|
909
910
|
}
|
|
910
911
|
function joinToObject($this, _this__u8e3s4, transform) {
|
|
911
912
|
return joinToString(_this__u8e3s4, ', ', '{', '}', VOID, VOID, transform);
|
|
912
913
|
}
|
|
913
914
|
function emitHandleFunction($this, endpoint) {
|
|
914
|
-
return Companion_instance_0.
|
|
915
|
+
return Companion_instance_0.fr($this.q20(endpoint.up_1)) + ': (request:Request) => Promise<Response>';
|
|
915
916
|
}
|
|
916
917
|
function lowercase($this, _this__u8e3s4) {
|
|
917
918
|
// Inline function 'kotlin.text.lowercase' call
|
|
918
919
|
// Inline function 'kotlin.js.asDynamic' call
|
|
919
|
-
var tmp$ret$1 = _this__u8e3s4.
|
|
920
|
+
var tmp$ret$1 = _this__u8e3s4.l1().toLowerCase();
|
|
920
921
|
return new FieldIdentifier(tmp$ret$1);
|
|
921
922
|
}
|
|
922
923
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda(it) {
|
|
@@ -930,12 +931,12 @@ function TypeScriptEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
|
930
931
|
}
|
|
931
932
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
932
933
|
return function (it) {
|
|
933
|
-
return this$0.
|
|
934
|
+
return this$0.mq(it);
|
|
934
935
|
};
|
|
935
936
|
}
|
|
936
937
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
937
938
|
return function (it) {
|
|
938
|
-
return this$0.
|
|
939
|
+
return this$0.mq(it);
|
|
939
940
|
};
|
|
940
941
|
}
|
|
941
942
|
function TypeScriptEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
@@ -985,12 +986,12 @@ function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda(this$0) {
|
|
|
985
986
|
}
|
|
986
987
|
function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_0(this$0) {
|
|
987
988
|
return function (it) {
|
|
988
|
-
return prependIndent(emitDeserialize$default(this$0, it, 'queries'), Spacer_instance.
|
|
989
|
+
return prependIndent(emitDeserialize$default(this$0, it, 'queries'), Spacer_instance.hs(3));
|
|
989
990
|
};
|
|
990
991
|
}
|
|
991
992
|
function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_1(this$0) {
|
|
992
993
|
return function (it) {
|
|
993
|
-
return prependIndent(emitDeserialize_0(this$0, it, 'headers', false), Spacer_instance.
|
|
994
|
+
return prependIndent(emitDeserialize_0(this$0, it, 'headers', false), Spacer_instance.hs(3));
|
|
994
995
|
};
|
|
995
996
|
}
|
|
996
997
|
function TypeScriptEndpointDefinitionEmitter$emitServerTo$lambda(this$0) {
|
|
@@ -1005,7 +1006,7 @@ function TypeScriptEndpointDefinitionEmitter$emitServerToResponse$lambda(this$0)
|
|
|
1005
1006
|
}
|
|
1006
1007
|
function TypeScriptEndpointDefinitionEmitter$emitType$lambda($block) {
|
|
1007
1008
|
return function (it) {
|
|
1008
|
-
return Spacer_instance.
|
|
1009
|
+
return Spacer_instance.hs(1) + $block(it);
|
|
1009
1010
|
};
|
|
1010
1011
|
}
|
|
1011
1012
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda(this$0) {
|
|
@@ -1015,17 +1016,17 @@ function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda(this$0) {
|
|
|
1015
1016
|
}
|
|
1016
1017
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_0(this$0) {
|
|
1017
1018
|
return function (it) {
|
|
1018
|
-
return this$0.
|
|
1019
|
+
return this$0.nr(it.bq_1) + ': params[' + this$0.nr(it.bq_1) + ']';
|
|
1019
1020
|
};
|
|
1020
1021
|
}
|
|
1021
1022
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_1(this$0) {
|
|
1022
1023
|
return function (it) {
|
|
1023
|
-
return this$0.
|
|
1024
|
+
return this$0.nr(it.qp_1) + ': params[' + this$0.nr(it.qp_1) + ']';
|
|
1024
1025
|
};
|
|
1025
1026
|
}
|
|
1026
1027
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_2(this$0) {
|
|
1027
1028
|
return function (it) {
|
|
1028
|
-
return this$0.
|
|
1029
|
+
return this$0.nr(it.qp_1) + ': params[' + this$0.nr(it.qp_1) + ']';
|
|
1029
1030
|
};
|
|
1030
1031
|
}
|
|
1031
1032
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3(this$0) {
|
|
@@ -1035,17 +1036,17 @@ function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3(this$0) {
|
|
|
1035
1036
|
}
|
|
1036
1037
|
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_4(this$0) {
|
|
1037
1038
|
return function (it) {
|
|
1038
|
-
return this$0.
|
|
1039
|
+
return this$0.nr(it.qp_1) + ': params[' + this$0.nr(it.qp_1) + ']';
|
|
1039
1040
|
};
|
|
1040
1041
|
}
|
|
1041
1042
|
function TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda(this$0) {
|
|
1042
1043
|
return function (it) {
|
|
1043
1044
|
var tmp;
|
|
1044
1045
|
if (it instanceof Literal) {
|
|
1045
|
-
tmp = '"' + it.
|
|
1046
|
+
tmp = '"' + it.xq_1 + '"';
|
|
1046
1047
|
} else {
|
|
1047
1048
|
if (it instanceof Param) {
|
|
1048
|
-
tmp = 'serialization.serialize(it.path[' + this$0.
|
|
1049
|
+
tmp = 'serialization.serialize(it.path[' + this$0.nr(it.bq_1) + '])';
|
|
1049
1050
|
} else {
|
|
1050
1051
|
noWhenBranchMatchedException();
|
|
1051
1052
|
}
|
|
@@ -1055,7 +1056,7 @@ function TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda(this$0) {
|
|
|
1055
1056
|
}
|
|
1056
1057
|
function TypeScriptEndpointDefinitionEmitter$emitType$lambda_0(this$0) {
|
|
1057
1058
|
return function (it) {
|
|
1058
|
-
return this$0.
|
|
1059
|
+
return this$0.nr(it.qp_1) + ': ' + this$0.nq(it.rp_1);
|
|
1059
1060
|
};
|
|
1060
1061
|
}
|
|
1061
1062
|
function TypeScriptEndpointDefinitionEmitter() {
|
|
@@ -1068,21 +1069,21 @@ function TypeScriptEnumDefinitionEmitter() {
|
|
|
1068
1069
|
function TypeScriptIdentifierEmitter() {
|
|
1069
1070
|
}
|
|
1070
1071
|
function _get_sanitizationConfig__sns434($this) {
|
|
1071
|
-
var tmp0 = $this.
|
|
1072
|
+
var tmp0 = $this.z20_1;
|
|
1072
1073
|
var tmp = KProperty1;
|
|
1073
1074
|
// Inline function 'kotlin.getValue' call
|
|
1074
1075
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, TypeScriptIrEmitter$_get_sanitizationConfig_$ref_f6f0bh(), null);
|
|
1075
|
-
return tmp0.
|
|
1076
|
+
return tmp0.l1();
|
|
1076
1077
|
}
|
|
1077
1078
|
function _get_modelSanitizationConfig__vgg831($this) {
|
|
1078
|
-
var tmp0 = $this.
|
|
1079
|
+
var tmp0 = $this.a21_1;
|
|
1079
1080
|
var tmp = KProperty1;
|
|
1080
1081
|
// Inline function 'kotlin.getValue' call
|
|
1081
1082
|
getPropertyCallableRef('modelSanitizationConfig', 1, tmp, TypeScriptIrEmitter$_get_modelSanitizationConfig_$ref_ar2t88(), null);
|
|
1082
|
-
return tmp0.
|
|
1083
|
+
return tmp0.l1();
|
|
1083
1084
|
}
|
|
1084
1085
|
function sanitize($this, _this__u8e3s4) {
|
|
1085
|
-
return '"' + _this__u8e3s4.
|
|
1086
|
+
return '"' + _this__u8e3s4.l1() + '"';
|
|
1086
1087
|
}
|
|
1087
1088
|
function sanitizeSymbol_1($this, _this__u8e3s4) {
|
|
1088
1089
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1103,7 +1104,7 @@ function sanitizeSymbol_1($this, _this__u8e3s4) {
|
|
|
1103
1104
|
return destination.toString();
|
|
1104
1105
|
}
|
|
1105
1106
|
function sanitizeKeywords($this, _this__u8e3s4) {
|
|
1106
|
-
return Companion_getInstance_0().
|
|
1107
|
+
return Companion_getInstance_0().c21_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1107
1108
|
}
|
|
1108
1109
|
function firstToLower($this, _this__u8e3s4) {
|
|
1109
1110
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
@@ -1122,10 +1123,10 @@ function firstToLower($this, _this__u8e3s4) {
|
|
|
1122
1123
|
return tmp;
|
|
1123
1124
|
}
|
|
1124
1125
|
function sanitizeParamName($this, identifier) {
|
|
1125
|
-
var tmp0 = identifier.
|
|
1126
|
+
var tmp0 = identifier.l1();
|
|
1126
1127
|
// Inline function 'kotlin.text.split' call
|
|
1127
1128
|
// Inline function 'kotlin.collections.filter' call
|
|
1128
|
-
var tmp0_0 = Regex_init_$Create$('[.\\s-]+').
|
|
1129
|
+
var tmp0_0 = Regex_init_$Create$('[.\\s-]+').zc(tmp0, 0);
|
|
1129
1130
|
// Inline function 'kotlin.collections.filterTo' call
|
|
1130
1131
|
var destination = ArrayList_init_$Create$();
|
|
1131
1132
|
var _iterator__ex2g4s = tmp0_0.t();
|
|
@@ -1133,11 +1134,11 @@ function sanitizeParamName($this, identifier) {
|
|
|
1133
1134
|
var element = _iterator__ex2g4s.v();
|
|
1134
1135
|
// Inline function 'kotlin.text.isNotEmpty' call
|
|
1135
1136
|
if (charSequenceLength(element) > 0) {
|
|
1136
|
-
destination.
|
|
1137
|
+
destination.x(element);
|
|
1137
1138
|
}
|
|
1138
1139
|
}
|
|
1139
1140
|
var parts = destination;
|
|
1140
|
-
var name = parts.
|
|
1141
|
+
var name = parts.a1() > 1 ? (new Name(parts)).q1m() : identifier.l1();
|
|
1141
1142
|
return sanitizeKeywords($this, sanitizeSymbol_1($this, name));
|
|
1142
1143
|
}
|
|
1143
1144
|
function buildEndpointParams($this, endpoint) {
|
|
@@ -1146,50 +1147,50 @@ function buildEndpointParams($this, endpoint) {
|
|
|
1146
1147
|
// Inline function 'kotlin.apply' call
|
|
1147
1148
|
var this_0 = ArrayList_init_$Create$();
|
|
1148
1149
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1149
|
-
var tmp0 = endpoint.
|
|
1150
|
+
var tmp0 = endpoint.wp_1;
|
|
1150
1151
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1151
1152
|
var destination = ArrayList_init_$Create$();
|
|
1152
1153
|
var _iterator__ex2g4s = tmp0.t();
|
|
1153
1154
|
while (_iterator__ex2g4s.u()) {
|
|
1154
1155
|
var element = _iterator__ex2g4s.v();
|
|
1155
1156
|
if (element instanceof Param) {
|
|
1156
|
-
destination.
|
|
1157
|
+
destination.x(element);
|
|
1157
1158
|
}
|
|
1158
1159
|
}
|
|
1159
1160
|
// Inline function 'kotlin.collections.forEach' call
|
|
1160
1161
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1161
1162
|
while (_iterator__ex2g4s_0.u()) {
|
|
1162
1163
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
1163
|
-
this_0.
|
|
1164
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_0.bq_1), emitTypeScriptReference($this, element_0.cq_1.vu(false)), element_0.cq_1.tu()));
|
|
1164
1165
|
}
|
|
1165
1166
|
// Inline function 'kotlin.collections.forEach' call
|
|
1166
|
-
var _iterator__ex2g4s_1 = endpoint.
|
|
1167
|
+
var _iterator__ex2g4s_1 = endpoint.xp_1.t();
|
|
1167
1168
|
while (_iterator__ex2g4s_1.u()) {
|
|
1168
1169
|
var element_1 = _iterator__ex2g4s_1.v();
|
|
1169
|
-
this_0.
|
|
1170
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_1.qp_1), emitTypeScriptReference($this, element_1.rp_1.vu(false)), element_1.rp_1.tu()));
|
|
1170
1171
|
}
|
|
1171
1172
|
// Inline function 'kotlin.collections.forEach' call
|
|
1172
|
-
var _iterator__ex2g4s_2 = endpoint.
|
|
1173
|
+
var _iterator__ex2g4s_2 = endpoint.yp_1.t();
|
|
1173
1174
|
while (_iterator__ex2g4s_2.u()) {
|
|
1174
1175
|
var element_2 = _iterator__ex2g4s_2.v();
|
|
1175
|
-
this_0.
|
|
1176
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_2.qp_1), emitTypeScriptReference($this, element_2.rp_1.vu(false)), element_2.rp_1.tu()));
|
|
1176
1177
|
}
|
|
1177
|
-
var tmp0_safe_receiver = first(endpoint.
|
|
1178
|
+
var tmp0_safe_receiver = first(endpoint.zp_1).dq_1;
|
|
1178
1179
|
if (tmp0_safe_receiver == null)
|
|
1179
1180
|
null;
|
|
1180
1181
|
else {
|
|
1181
1182
|
// Inline function 'kotlin.let' call
|
|
1182
|
-
this_0.
|
|
1183
|
+
this_0.x(new EndpointParam('body', emitTypeScriptReference($this, tmp0_safe_receiver.fq_1.vu(false)), tmp0_safe_receiver.fq_1.tu()));
|
|
1183
1184
|
}
|
|
1184
|
-
return this_0.
|
|
1185
|
+
return this_0.o5();
|
|
1185
1186
|
}
|
|
1186
1187
|
function emitTypeScriptReference($this, ref) {
|
|
1187
1188
|
var tmp;
|
|
1188
1189
|
if (ref instanceof Dict) {
|
|
1189
|
-
tmp = 'Record<string, ' + emitTypeScriptReference($this, ref.
|
|
1190
|
+
tmp = 'Record<string, ' + emitTypeScriptReference($this, ref.so_1) + '>';
|
|
1190
1191
|
} else {
|
|
1191
1192
|
if (ref instanceof Iterable) {
|
|
1192
|
-
tmp = emitTypeScriptReference($this, ref.
|
|
1193
|
+
tmp = emitTypeScriptReference($this, ref.po_1) + '[]';
|
|
1193
1194
|
} else {
|
|
1194
1195
|
if (ref instanceof Unit) {
|
|
1195
1196
|
tmp = 'undefined';
|
|
@@ -1198,10 +1199,10 @@ function emitTypeScriptReference($this, ref) {
|
|
|
1198
1199
|
tmp = 'any';
|
|
1199
1200
|
} else {
|
|
1200
1201
|
if (ref instanceof Custom) {
|
|
1201
|
-
tmp = sanitizeSymbol_1($this, ref.
|
|
1202
|
+
tmp = sanitizeSymbol_1($this, ref.bv_1);
|
|
1202
1203
|
} else {
|
|
1203
1204
|
if (ref instanceof Primitive) {
|
|
1204
|
-
var tmp1_subject = ref.
|
|
1205
|
+
var tmp1_subject = ref.fv_1;
|
|
1205
1206
|
var tmp_0;
|
|
1206
1207
|
if (tmp1_subject instanceof String_0) {
|
|
1207
1208
|
tmp_0 = 'string';
|
|
@@ -1234,20 +1235,20 @@ function emitTypeScriptReference($this, ref) {
|
|
|
1234
1235
|
}
|
|
1235
1236
|
}
|
|
1236
1237
|
// Inline function 'kotlin.let' call
|
|
1237
|
-
return tmp + (ref.
|
|
1238
|
+
return tmp + (ref.tu() ? ' | undefined' : '');
|
|
1238
1239
|
}
|
|
1239
1240
|
function EndpointParam(name, type, nullable) {
|
|
1240
|
-
this.
|
|
1241
|
-
this.
|
|
1242
|
-
this.
|
|
1241
|
+
this.d21_1 = name;
|
|
1242
|
+
this.e21_1 = type;
|
|
1243
|
+
this.f21_1 = nullable;
|
|
1243
1244
|
}
|
|
1244
1245
|
protoOf(EndpointParam).toString = function () {
|
|
1245
|
-
return 'EndpointParam(name=' + this.
|
|
1246
|
+
return 'EndpointParam(name=' + this.d21_1 + ', type=' + this.e21_1 + ', nullable=' + this.f21_1 + ')';
|
|
1246
1247
|
};
|
|
1247
1248
|
protoOf(EndpointParam).hashCode = function () {
|
|
1248
|
-
var result = getStringHashCode(this.
|
|
1249
|
-
result = imul(result, 31) + getStringHashCode(this.
|
|
1250
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
1249
|
+
var result = getStringHashCode(this.d21_1);
|
|
1250
|
+
result = imul(result, 31) + getStringHashCode(this.e21_1) | 0;
|
|
1251
|
+
result = imul(result, 31) + getBooleanHashCode(this.f21_1) | 0;
|
|
1251
1252
|
return result;
|
|
1252
1253
|
};
|
|
1253
1254
|
protoOf(EndpointParam).equals = function (other) {
|
|
@@ -1255,11 +1256,11 @@ protoOf(EndpointParam).equals = function (other) {
|
|
|
1255
1256
|
return true;
|
|
1256
1257
|
if (!(other instanceof EndpointParam))
|
|
1257
1258
|
return false;
|
|
1258
|
-
if (!(this.
|
|
1259
|
+
if (!(this.d21_1 === other.d21_1))
|
|
1259
1260
|
return false;
|
|
1260
|
-
if (!(this.
|
|
1261
|
+
if (!(this.e21_1 === other.e21_1))
|
|
1261
1262
|
return false;
|
|
1262
|
-
if (!(this.
|
|
1263
|
+
if (!(this.f21_1 === other.f21_1))
|
|
1263
1264
|
return false;
|
|
1264
1265
|
return true;
|
|
1265
1266
|
};
|
|
@@ -1276,10 +1277,10 @@ function Companion() {
|
|
|
1276
1277
|
// Inline function 'kotlin.text.lowercase' call
|
|
1277
1278
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1278
1279
|
var tmp$ret$2 = removePrefix(element, 'GeneratorField').toLowerCase();
|
|
1279
|
-
result.
|
|
1280
|
+
result.s2(element, tmp$ret$2);
|
|
1280
1281
|
}
|
|
1281
|
-
tmp.
|
|
1282
|
-
this.
|
|
1282
|
+
tmp.b21_1 = result;
|
|
1283
|
+
this.c21_1 = setOf(['break', 'case', 'catch', 'continue', 'debugger', 'default', 'delete', 'do', 'else', 'finally', 'for', 'function', 'if', 'in', 'instanceof', 'new', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'var', 'void', 'while', 'with', 'class', 'const', 'enum', 'export', 'extends', 'import', 'super', 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', 'yield', 'type', 'async', 'await']);
|
|
1283
1284
|
}
|
|
1284
1285
|
var Companion_instance_1;
|
|
1285
1286
|
function Companion_getInstance_0() {
|
|
@@ -1292,13 +1293,13 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
1292
1293
|
}
|
|
1293
1294
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1294
1295
|
return function (name) {
|
|
1295
|
-
var sanitized = name.
|
|
1296
|
+
var sanitized = name.l1h_1.a1() > 1 ? name.q1m() : sanitizeSymbol_1(this$0, name.j1j());
|
|
1296
1297
|
return new Name(listOf_0(sanitized));
|
|
1297
1298
|
};
|
|
1298
1299
|
}
|
|
1299
1300
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0) {
|
|
1300
1301
|
return function (name) {
|
|
1301
|
-
var sanitized = name.
|
|
1302
|
+
var sanitized = name.l1h_1.a1() > 1 ? name.q1m() : sanitizeSymbol_1(this$0, name.j1j());
|
|
1302
1303
|
return new Name(listOf_0(sanitized));
|
|
1303
1304
|
};
|
|
1304
1305
|
}
|
|
@@ -1324,29 +1325,29 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0)
|
|
|
1324
1325
|
return function (stmt, tr) {
|
|
1325
1326
|
var tmp;
|
|
1326
1327
|
if (stmt instanceof VariableReference) {
|
|
1327
|
-
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
1328
|
+
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.k1p_1));
|
|
1328
1329
|
} else {
|
|
1329
1330
|
if (stmt instanceof ConstructorStatement) {
|
|
1330
|
-
var tmp_0 = tr.
|
|
1331
|
+
var tmp_0 = tr.y1u(stmt.s1n_1);
|
|
1331
1332
|
// Inline function 'kotlin.collections.map' call
|
|
1332
|
-
var this_0 = stmt.
|
|
1333
|
+
var this_0 = stmt.t1n_1;
|
|
1333
1334
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1334
|
-
var destination = ArrayList_init_$Create$_0(this_0.
|
|
1335
|
+
var destination = ArrayList_init_$Create$_0(this_0.a1());
|
|
1335
1336
|
// Inline function 'kotlin.collections.iterator' call
|
|
1336
|
-
var _iterator__ex2g4s = this_0.
|
|
1337
|
+
var _iterator__ex2g4s = this_0.j1().t();
|
|
1337
1338
|
while (_iterator__ex2g4s.u()) {
|
|
1338
1339
|
var item = _iterator__ex2g4s.v();
|
|
1339
1340
|
// Inline function 'kotlin.collections.component1' call
|
|
1340
|
-
var key = item.
|
|
1341
|
+
var key = item.k1();
|
|
1341
1342
|
// Inline function 'kotlin.collections.component2' call
|
|
1342
|
-
var value = item.
|
|
1343
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.
|
|
1344
|
-
destination.
|
|
1343
|
+
var value = item.l1();
|
|
1344
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.b1v(value));
|
|
1345
|
+
destination.x(tmp$ret$3);
|
|
1345
1346
|
}
|
|
1346
1347
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
1347
1348
|
} else {
|
|
1348
1349
|
if (stmt instanceof Assignment) {
|
|
1349
|
-
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
1350
|
+
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.n1p_1), tr.b1v(stmt.o1p_1), stmt.p1p_1);
|
|
1350
1351
|
} else {
|
|
1351
1352
|
tmp = transformChildren(stmt, tr);
|
|
1352
1353
|
}
|
|
@@ -1357,7 +1358,7 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0)
|
|
|
1357
1358
|
}
|
|
1358
1359
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1359
1360
|
return function () {
|
|
1360
|
-
var tmp0_reservedKeywords = Companion_getInstance_0().
|
|
1361
|
+
var tmp0_reservedKeywords = Companion_getInstance_0().c21_1;
|
|
1361
1362
|
var tmp = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1362
1363
|
var tmp_0 = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
|
|
1363
1364
|
var tmp_1 = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
|
|
@@ -1371,7 +1372,7 @@ function TypeScriptIrEmitter$_get_sanitizationConfig_$ref_f6f0bh() {
|
|
|
1371
1372
|
};
|
|
1372
1373
|
}
|
|
1373
1374
|
function TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda$lambda(name) {
|
|
1374
|
-
return new Name(listOf_0(name.
|
|
1375
|
+
return new Name(listOf_0(name.j1j()));
|
|
1375
1376
|
}
|
|
1376
1377
|
function TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda$lambda_0(it) {
|
|
1377
1378
|
return it;
|
|
@@ -1380,7 +1381,7 @@ function TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda(this$0) {
|
|
|
1380
1381
|
return function () {
|
|
1381
1382
|
var tmp = _get_sanitizationConfig__sns434(this$0);
|
|
1382
1383
|
var tmp_0 = TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda$lambda;
|
|
1383
|
-
return tmp.
|
|
1384
|
+
return tmp.t1w(VOID, VOID, tmp_0, VOID, TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda$lambda_0);
|
|
1384
1385
|
};
|
|
1385
1386
|
}
|
|
1386
1387
|
function TypeScriptIrEmitter$_get_modelSanitizationConfig_$ref_ar2t88() {
|
|
@@ -1391,11 +1392,11 @@ function TypeScriptIrEmitter$_get_modelSanitizationConfig_$ref_ar2t88() {
|
|
|
1391
1392
|
function TypeScriptIrEmitter$emitShared$lambda(element, transformer) {
|
|
1392
1393
|
var tmp;
|
|
1393
1394
|
if (element instanceof Namespace) {
|
|
1394
|
-
var injected = element.
|
|
1395
|
+
var injected = element.b1o_1.equals(Companion_getInstance().n1h('Wirespec')) ? listOf_0(new RawElement('export type Type = string')) : emptyList();
|
|
1395
1396
|
var tmp_0;
|
|
1396
1397
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1397
1398
|
if (!injected.r()) {
|
|
1398
|
-
tmp_0 = withElements(element, plus_1(injected, element.
|
|
1399
|
+
tmp_0 = withElements(element, plus_1(injected, element.x1n()));
|
|
1399
1400
|
} else {
|
|
1400
1401
|
tmp_0 = element;
|
|
1401
1402
|
}
|
|
@@ -1410,11 +1411,11 @@ function TypeScriptIrEmitter$emitShared$lambda_0($api) {
|
|
|
1410
1411
|
return function (element, transformer) {
|
|
1411
1412
|
var tmp;
|
|
1412
1413
|
if (element instanceof Namespace) {
|
|
1413
|
-
var injected = element.
|
|
1414
|
+
var injected = element.b1o_1.equals(Companion_getInstance().n1h('Wirespec')) ? listOf_0(new RawElement($api)) : emptyList();
|
|
1414
1415
|
var tmp_0;
|
|
1415
1416
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1416
1417
|
if (!injected.r()) {
|
|
1417
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1418
|
+
tmp_0 = withElements(element, plus_1(element.x1n(), injected));
|
|
1418
1419
|
} else {
|
|
1419
1420
|
tmp_0 = element;
|
|
1420
1421
|
}
|
|
@@ -1429,13 +1430,13 @@ function TypeScriptIrEmitter$emitShared$lambda_0($api) {
|
|
|
1429
1430
|
function TypeScriptIrEmitter$emitShared$lambda_1(element, transformer) {
|
|
1430
1431
|
var tmp;
|
|
1431
1432
|
if (element instanceof Struct) {
|
|
1432
|
-
var tmp0_safe_receiver = Companion_getInstance_0().
|
|
1433
|
+
var tmp0_safe_receiver = Companion_getInstance_0().b21_1.p2(element.g1o_1.j1j());
|
|
1433
1434
|
var tmp_0;
|
|
1434
1435
|
if (tmp0_safe_receiver == null) {
|
|
1435
1436
|
tmp_0 = null;
|
|
1436
1437
|
} else {
|
|
1437
1438
|
// Inline function 'kotlin.let' call
|
|
1438
|
-
tmp_0 = element.
|
|
1439
|
+
tmp_0 = element.n1o(VOID, plus_1(listOf_0(new Field(Companion_getInstance().n1h('kind'), new StringLiteral(tmp0_safe_receiver))), element.h1o_1));
|
|
1439
1440
|
}
|
|
1440
1441
|
var tmp1_elvis_lhs = tmp_0;
|
|
1441
1442
|
tmp = tmp1_elvis_lhs == null ? element : tmp1_elvis_lhs;
|
|
@@ -1446,7 +1447,7 @@ function TypeScriptIrEmitter$emitShared$lambda_1(element, transformer) {
|
|
|
1446
1447
|
return transformChildren_0(transformed, transformer);
|
|
1447
1448
|
}
|
|
1448
1449
|
function TypeScriptIrEmitter$emit$lambda(it) {
|
|
1449
|
-
return 'export {' + it.
|
|
1450
|
+
return 'export {' + it.mr().l1() + "} from './" + it.mr().l1() + "'";
|
|
1450
1451
|
}
|
|
1451
1452
|
function TypeScriptIrEmitter$emitGenerator$lambda($definition) {
|
|
1452
1453
|
return function (expr, t) {
|
|
@@ -1455,24 +1456,24 @@ function TypeScriptIrEmitter$emitGenerator$lambda($definition) {
|
|
|
1455
1456
|
var tmp_1;
|
|
1456
1457
|
var tmp_2;
|
|
1457
1458
|
if (expr instanceof FunctionCall) {
|
|
1458
|
-
var tmp_3 = expr.
|
|
1459
|
+
var tmp_3 = expr.y1m_1;
|
|
1459
1460
|
tmp_2 = tmp_3 instanceof RawExpression;
|
|
1460
1461
|
} else {
|
|
1461
1462
|
tmp_2 = false;
|
|
1462
1463
|
}
|
|
1463
1464
|
if (tmp_2) {
|
|
1464
|
-
var tmp_4 = expr.
|
|
1465
|
-
tmp_1 = (tmp_4 instanceof RawExpression ? tmp_4 : THROW_CCE()).
|
|
1465
|
+
var tmp_4 = expr.y1m_1;
|
|
1466
|
+
tmp_1 = (tmp_4 instanceof RawExpression ? tmp_4 : THROW_CCE()).m1p_1 === $definition.xr_1.l1();
|
|
1466
1467
|
} else {
|
|
1467
1468
|
tmp_1 = false;
|
|
1468
1469
|
}
|
|
1469
1470
|
if (tmp_1) {
|
|
1470
|
-
tmp_0 = expr.
|
|
1471
|
+
tmp_0 = expr.a1n_1.equals(Companion_getInstance().n1h('valueOf'));
|
|
1471
1472
|
} else {
|
|
1472
1473
|
tmp_0 = false;
|
|
1473
1474
|
}
|
|
1474
1475
|
if (tmp_0) {
|
|
1475
|
-
var tmp0_elvis_lhs = expr.
|
|
1476
|
+
var tmp0_elvis_lhs = expr.b1n_1.p2(Companion_getInstance().n1h('label'));
|
|
1476
1477
|
tmp = tmp0_elvis_lhs == null ? expr : tmp0_elvis_lhs;
|
|
1477
1478
|
} else {
|
|
1478
1479
|
tmp = transformChildren_1(expr, t);
|
|
@@ -1485,12 +1486,12 @@ function TypeScriptIrEmitter$emitGenerator$lambda_0($definition) {
|
|
|
1485
1486
|
var tmp;
|
|
1486
1487
|
var tmp_0;
|
|
1487
1488
|
if (expr instanceof ConstructorStatement) {
|
|
1488
|
-
tmp_0 = equals(expr.
|
|
1489
|
+
tmp_0 = equals(expr.s1n_1, Custom_init_$Create$($definition.sr_1.l1()));
|
|
1489
1490
|
} else {
|
|
1490
1491
|
tmp_0 = false;
|
|
1491
1492
|
}
|
|
1492
1493
|
if (tmp_0) {
|
|
1493
|
-
var tmp0_elvis_lhs = expr.
|
|
1494
|
+
var tmp0_elvis_lhs = expr.t1n_1.p2(Companion_getInstance().n1h('value'));
|
|
1494
1495
|
tmp = tmp0_elvis_lhs == null ? expr : tmp0_elvis_lhs;
|
|
1495
1496
|
} else {
|
|
1496
1497
|
tmp = transformChildren_1(expr, t);
|
|
@@ -1501,37 +1502,37 @@ function TypeScriptIrEmitter$emitGenerator$lambda_0($definition) {
|
|
|
1501
1502
|
function TypeScriptIrEmitter$emitGenerator$lambda_1(expr, t) {
|
|
1502
1503
|
var tmp;
|
|
1503
1504
|
if (expr instanceof ConstructorStatement) {
|
|
1504
|
-
var tmp_0 = expr.
|
|
1505
|
+
var tmp_0 = expr.s1n_1;
|
|
1505
1506
|
var tmp0_safe_receiver = tmp_0 instanceof Custom_0 ? tmp_0 : null;
|
|
1506
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1507
|
-
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
1507
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.h1j_1;
|
|
1508
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.j1j();
|
|
1508
1509
|
var typeName = tmp2_safe_receiver == null ? null : removePrefix(tmp2_safe_receiver, 'Wirespec.');
|
|
1509
1510
|
var tmp_1;
|
|
1510
1511
|
if (typeName == null) {
|
|
1511
1512
|
tmp_1 = null;
|
|
1512
1513
|
} else {
|
|
1513
1514
|
// Inline function 'kotlin.let' call
|
|
1514
|
-
tmp_1 = Companion_getInstance_0().
|
|
1515
|
+
tmp_1 = Companion_getInstance_0().b21_1.p2(typeName);
|
|
1515
1516
|
}
|
|
1516
1517
|
var kind = tmp_1;
|
|
1517
1518
|
var tmp_2;
|
|
1518
1519
|
if (!(kind == null)) {
|
|
1519
|
-
var tmp_3 = mapOf(to(Companion_getInstance().
|
|
1520
|
+
var tmp_3 = mapOf(to(Companion_getInstance().n1h('kind'), new Literal_0(kind, String_instance)));
|
|
1520
1521
|
// Inline function 'kotlin.collections.mapValues' call
|
|
1521
|
-
var this_0 = expr.
|
|
1522
|
+
var this_0 = expr.t1n_1;
|
|
1522
1523
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
1523
|
-
var destination = LinkedHashMap_init_$Create$_0(mapCapacity(this_0.
|
|
1524
|
+
var destination = LinkedHashMap_init_$Create$_0(mapCapacity(this_0.a1()));
|
|
1524
1525
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
1525
|
-
var _iterator__ex2g4s = this_0.
|
|
1526
|
+
var _iterator__ex2g4s = this_0.j1().t();
|
|
1526
1527
|
while (_iterator__ex2g4s.u()) {
|
|
1527
1528
|
var element = _iterator__ex2g4s.v();
|
|
1528
|
-
var tmp_4 = element.
|
|
1529
|
+
var tmp_4 = element.k1();
|
|
1529
1530
|
// Inline function 'kotlin.collections.component2' call
|
|
1530
|
-
var v = element.
|
|
1531
|
-
var tmp$ret$4 = t.
|
|
1532
|
-
destination.
|
|
1531
|
+
var v = element.l1();
|
|
1532
|
+
var tmp$ret$4 = t.b1v(v);
|
|
1533
|
+
destination.s2(tmp_4, tmp$ret$4);
|
|
1533
1534
|
}
|
|
1534
|
-
tmp_2 = new ConstructorStatement(expr.
|
|
1535
|
+
tmp_2 = new ConstructorStatement(expr.s1n_1, plus_2(tmp_3, destination));
|
|
1535
1536
|
} else {
|
|
1536
1537
|
tmp_2 = transformChildren(expr, t);
|
|
1537
1538
|
}
|
|
@@ -1558,17 +1559,17 @@ function TypeScriptIrEmitter$emitGenerator$lambda_5($generatorOwnName, $generato
|
|
|
1558
1559
|
var tmp_0;
|
|
1559
1560
|
var tmp_1;
|
|
1560
1561
|
if (expr instanceof RawExpression) {
|
|
1561
|
-
tmp_1 = endsWith(expr.
|
|
1562
|
+
tmp_1 = endsWith(expr.m1p_1, 'Generator');
|
|
1562
1563
|
} else {
|
|
1563
1564
|
tmp_1 = false;
|
|
1564
1565
|
}
|
|
1565
1566
|
if (tmp_1) {
|
|
1566
|
-
tmp_0 = !(expr.
|
|
1567
|
+
tmp_0 = !(expr.m1p_1 === $generatorOwnName);
|
|
1567
1568
|
} else {
|
|
1568
1569
|
tmp_0 = false;
|
|
1569
1570
|
}
|
|
1570
1571
|
if (tmp_0) {
|
|
1571
|
-
$generatorRefs.
|
|
1572
|
+
$generatorRefs.x(expr.m1p_1);
|
|
1572
1573
|
tmp = Unit_instance;
|
|
1573
1574
|
}
|
|
1574
1575
|
return transformChildren_1(expr, t);
|
|
@@ -1582,7 +1583,7 @@ function TypeScriptIrEmitter$emit$injectApiConst$lambda($endpoint) {
|
|
|
1582
1583
|
var tmp_0;
|
|
1583
1584
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1584
1585
|
if (!injected.r()) {
|
|
1585
|
-
tmp_0 = withElements(element, plus_1(element.
|
|
1586
|
+
tmp_0 = withElements(element, plus_1(element.x1n(), injected));
|
|
1586
1587
|
} else {
|
|
1587
1588
|
tmp_0 = element;
|
|
1588
1589
|
}
|
|
@@ -1601,14 +1602,14 @@ function emit$injectApiConst(_this__u8e3s4, $endpoint) {
|
|
|
1601
1602
|
var tmp = scope;
|
|
1602
1603
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1603
1604
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1604
|
-
var this_0 = scope.
|
|
1605
|
+
var this_0 = scope.g1v_1;
|
|
1605
1606
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1606
1607
|
// Inline function 'kotlin.apply' call
|
|
1607
1608
|
var this_1 = new TransformerBuilder();
|
|
1608
|
-
this_1.
|
|
1609
|
-
var tmp$ret$2 = this_1.
|
|
1610
|
-
tmp.
|
|
1611
|
-
var tmp_0 = scope.
|
|
1609
|
+
this_1.x1i(TypeScriptIrEmitter$emit$injectApiConst$lambda($endpoint));
|
|
1610
|
+
var tmp$ret$2 = this_1.y1i();
|
|
1611
|
+
tmp.g1v_1 = transform(this_0, tmp$ret$2);
|
|
1612
|
+
var tmp_0 = scope.g1v_1;
|
|
1612
1613
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1613
1614
|
}
|
|
1614
1615
|
function emit$applyCallParamsIfNeeded(_this__u8e3s4, hasRequestParams) {
|
|
@@ -1616,27 +1617,27 @@ function emit$applyCallParamsIfNeeded(_this__u8e3s4, hasRequestParams) {
|
|
|
1616
1617
|
}
|
|
1617
1618
|
function TypeScriptIrEmitter$emitClient$lambda(this$0) {
|
|
1618
1619
|
return function (it) {
|
|
1619
|
-
var methodName = firstToLower(this$0, it.
|
|
1620
|
+
var methodName = firstToLower(this$0, it.up_1.l1());
|
|
1620
1621
|
return ' ...' + methodName + 'Client(serialization, transportation),';
|
|
1621
1622
|
};
|
|
1622
1623
|
}
|
|
1623
1624
|
function TypeScriptIrEmitter() {
|
|
1624
1625
|
Companion_getInstance_0();
|
|
1625
|
-
this.
|
|
1626
|
-
this.
|
|
1626
|
+
this.x20_1 = TypeScriptGenerator_getInstance();
|
|
1627
|
+
this.y20_1 = FileExtension_TypeScript_getInstance();
|
|
1627
1628
|
var tmp = this;
|
|
1628
|
-
tmp.
|
|
1629
|
+
tmp.z20_1 = lazy(TypeScriptIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1629
1630
|
var tmp_0 = this;
|
|
1630
|
-
tmp_0.
|
|
1631
|
+
tmp_0.a21_1 = lazy(TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda(this));
|
|
1631
1632
|
}
|
|
1632
|
-
protoOf(TypeScriptIrEmitter).
|
|
1633
|
-
return this.
|
|
1633
|
+
protoOf(TypeScriptIrEmitter).t1v = function () {
|
|
1634
|
+
return this.x20_1;
|
|
1634
1635
|
};
|
|
1635
|
-
protoOf(TypeScriptIrEmitter).
|
|
1636
|
-
return this.
|
|
1636
|
+
protoOf(TypeScriptIrEmitter).uq = function () {
|
|
1637
|
+
return this.y20_1;
|
|
1637
1638
|
};
|
|
1638
|
-
protoOf(TypeScriptIrEmitter).
|
|
1639
|
-
var packageName = Companion_instance.
|
|
1639
|
+
protoOf(TypeScriptIrEmitter).x1v = function () {
|
|
1640
|
+
var packageName = Companion_instance.cs('community.flock.wirespec');
|
|
1640
1641
|
var api = 'export type Client<REQ extends Request<unknown>, RES extends Response<unknown>> = (serialization: Serialization) => {\n to: (request: REQ) => RawRequest;\n from: (response: RawResponse) => RES\n}\nexport type Server<REQ extends Request<unknown>, RES extends Response<unknown>> = (serialization: Serialization) => {\n from: (request: RawRequest) => REQ;\n to: (response: RES) => RawResponse\n}\nexport type Api<REQ extends Request<unknown>, RES extends Response<unknown>> = {\n name: string;\n method: Method,\n path: string,\n client: Client<REQ, RES>;\n server: Server<REQ, RES>\n}';
|
|
1641
1642
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1642
1643
|
var this_0 = convert(packageName);
|
|
@@ -1645,41 +1646,41 @@ protoOf(TypeScriptIrEmitter).h1z = function () {
|
|
|
1645
1646
|
var tmp = scope;
|
|
1646
1647
|
// Inline function 'community.flock.wirespec.ir.core.injectBefore' call
|
|
1647
1648
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1648
|
-
var this_1 = scope.
|
|
1649
|
+
var this_1 = scope.g1v_1;
|
|
1649
1650
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1650
1651
|
// Inline function 'kotlin.apply' call
|
|
1651
1652
|
var this_2 = new TransformerBuilder();
|
|
1652
|
-
this_2.
|
|
1653
|
-
var tmp$ret$2 = this_2.
|
|
1654
|
-
tmp.
|
|
1653
|
+
this_2.x1i(TypeScriptIrEmitter$emitShared$lambda);
|
|
1654
|
+
var tmp$ret$2 = this_2.y1i();
|
|
1655
|
+
tmp.g1v_1 = transform(this_1, tmp$ret$2);
|
|
1655
1656
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1656
1657
|
var tmp_0 = scope;
|
|
1657
1658
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1658
1659
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1659
|
-
var this_3 = scope.
|
|
1660
|
+
var this_3 = scope.g1v_1;
|
|
1660
1661
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1661
1662
|
// Inline function 'kotlin.apply' call
|
|
1662
1663
|
var this_4 = new TransformerBuilder();
|
|
1663
|
-
this_4.
|
|
1664
|
-
var tmp$ret$8 = this_4.
|
|
1665
|
-
tmp_0.
|
|
1664
|
+
this_4.x1i(TypeScriptIrEmitter$emitShared$lambda_0(api));
|
|
1665
|
+
var tmp$ret$8 = this_4.y1i();
|
|
1666
|
+
tmp_0.g1v_1 = transform(this_3, tmp$ret$8);
|
|
1666
1667
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1667
1668
|
var tmp_1 = scope;
|
|
1668
1669
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1669
|
-
var this_5 = scope.
|
|
1670
|
+
var this_5 = scope.g1v_1;
|
|
1670
1671
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1671
1672
|
// Inline function 'kotlin.apply' call
|
|
1672
1673
|
var this_6 = new TransformerBuilder();
|
|
1673
|
-
this_6.
|
|
1674
|
-
var tmp$ret$14 = this_6.
|
|
1675
|
-
tmp_1.
|
|
1676
|
-
var tmp_2 = scope.
|
|
1674
|
+
this_6.x1i(TypeScriptIrEmitter$emitShared$lambda_1);
|
|
1675
|
+
var tmp$ret$14 = this_6.y1i();
|
|
1676
|
+
tmp_1.g1v_1 = transform(this_5, tmp$ret$14);
|
|
1677
|
+
var tmp_2 = scope.g1v_1;
|
|
1677
1678
|
return isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1678
1679
|
};
|
|
1679
|
-
protoOf(TypeScriptIrEmitter).
|
|
1680
|
+
protoOf(TypeScriptIrEmitter).eo = function (ast, logger) {
|
|
1680
1681
|
var tmp = emit.call(this, ast, logger);
|
|
1681
1682
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
1682
|
-
var this_0 = ast.
|
|
1683
|
+
var this_0 = ast.rq_1;
|
|
1683
1684
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1684
1685
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
1685
1686
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -1687,7 +1688,7 @@ protoOf(TypeScriptIrEmitter).pr = function (ast, logger) {
|
|
|
1687
1688
|
var _iterator__ex2g4s = tmp0.t();
|
|
1688
1689
|
while (_iterator__ex2g4s.u()) {
|
|
1689
1690
|
var element = _iterator__ex2g4s.v();
|
|
1690
|
-
var list = new NonEmptyList(element.
|
|
1691
|
+
var list = new NonEmptyList(element.tq_1);
|
|
1691
1692
|
addAll(destination, list);
|
|
1692
1693
|
}
|
|
1693
1694
|
var tmp$ret$3 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -1700,41 +1701,41 @@ protoOf(TypeScriptIrEmitter).pr = function (ast, logger) {
|
|
|
1700
1701
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
1701
1702
|
var key = namespace(element_0);
|
|
1702
1703
|
// Inline function 'kotlin.collections.getOrPut' call
|
|
1703
|
-
var value = destination_0.
|
|
1704
|
+
var value = destination_0.p2(key);
|
|
1704
1705
|
var tmp_0;
|
|
1705
1706
|
if (value == null) {
|
|
1706
1707
|
var answer = ArrayList_init_$Create$();
|
|
1707
|
-
destination_0.
|
|
1708
|
+
destination_0.s2(key, answer);
|
|
1708
1709
|
tmp_0 = answer;
|
|
1709
1710
|
} else {
|
|
1710
1711
|
tmp_0 = value;
|
|
1711
1712
|
}
|
|
1712
1713
|
var list_0 = tmp_0;
|
|
1713
|
-
list_0.
|
|
1714
|
+
list_0.x(element_0);
|
|
1714
1715
|
}
|
|
1715
1716
|
// Inline function 'kotlin.collections.map' call
|
|
1716
1717
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1717
|
-
var destination_1 = ArrayList_init_$Create$_0(destination_0.
|
|
1718
|
+
var destination_1 = ArrayList_init_$Create$_0(destination_0.a1());
|
|
1718
1719
|
// Inline function 'kotlin.collections.iterator' call
|
|
1719
|
-
var _iterator__ex2g4s_1 = destination_0.
|
|
1720
|
+
var _iterator__ex2g4s_1 = destination_0.j1().t();
|
|
1720
1721
|
while (_iterator__ex2g4s_1.u()) {
|
|
1721
1722
|
var item = _iterator__ex2g4s_1.v();
|
|
1722
1723
|
// Inline function 'kotlin.collections.component1' call
|
|
1723
|
-
var ns = item.
|
|
1724
|
+
var ns = item.k1();
|
|
1724
1725
|
// Inline function 'kotlin.collections.component2' call
|
|
1725
|
-
var defs = item.
|
|
1726
|
-
var tmp_1 = ns + '/index.' + this.
|
|
1726
|
+
var defs = item.l1();
|
|
1727
|
+
var tmp_1 = ns + '/index.' + this.uq().dr_1;
|
|
1727
1728
|
var tmp$ret$12 = new Emitted(tmp_1, joinToString(defs, '\n', VOID, VOID, VOID, VOID, TypeScriptIrEmitter$emit$lambda));
|
|
1728
|
-
destination_1.
|
|
1729
|
+
destination_1.x(tmp$ret$12);
|
|
1729
1730
|
}
|
|
1730
1731
|
return NonEmptyList__plus_impl_xqmb9_0(tmp, destination_1);
|
|
1731
1732
|
};
|
|
1732
|
-
protoOf(TypeScriptIrEmitter).
|
|
1733
|
+
protoOf(TypeScriptIrEmitter).lr = function (definition, module_0, logger) {
|
|
1733
1734
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1734
|
-
var subPackageName = plus(Companion_instance.
|
|
1735
|
-
return new File(Companion_getInstance().
|
|
1735
|
+
var subPackageName = plus(Companion_instance.cs(''), definition);
|
|
1736
|
+
return new File(Companion_getInstance().n1h(subPackageName.fs() + sanitizeSymbol_1(this, file.v1n_1.o1h())), plus_1(listOf_0(import_0('../Wirespec', 'Wirespec')), file.w1n_1));
|
|
1736
1737
|
};
|
|
1737
|
-
protoOf(TypeScriptIrEmitter).
|
|
1738
|
+
protoOf(TypeScriptIrEmitter).c1w = function (definition, module_0) {
|
|
1738
1739
|
var tmp;
|
|
1739
1740
|
if (definition instanceof Type) {
|
|
1740
1741
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1743,16 +1744,16 @@ protoOf(TypeScriptIrEmitter).l1z = function (definition, module_0) {
|
|
|
1743
1744
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1744
1745
|
var this_0 = convertToGenerator_1(definition);
|
|
1745
1746
|
var scope = new TransformScope(this_0);
|
|
1746
|
-
scope.
|
|
1747
|
-
var tmp_0 = scope.
|
|
1747
|
+
scope.o1v(TypeScriptIrEmitter$emitGenerator$lambda(definition));
|
|
1748
|
+
var tmp_0 = scope.g1v_1;
|
|
1748
1749
|
tmp = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1749
1750
|
} else {
|
|
1750
1751
|
if (definition instanceof Refined) {
|
|
1751
1752
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1752
1753
|
var this_1 = convertToGenerator_0(definition);
|
|
1753
1754
|
var scope_0 = new TransformScope(this_1);
|
|
1754
|
-
scope_0.
|
|
1755
|
-
var tmp_1 = scope_0.
|
|
1755
|
+
scope_0.o1v(TypeScriptIrEmitter$emitGenerator$lambda_0(definition));
|
|
1756
|
+
var tmp_1 = scope_0.g1v_1;
|
|
1756
1757
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1757
1758
|
} else {
|
|
1758
1759
|
if (definition instanceof Union) {
|
|
@@ -1766,10 +1767,10 @@ protoOf(TypeScriptIrEmitter).l1z = function (definition, module_0) {
|
|
|
1766
1767
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1767
1768
|
var this_2 = sanitizeNames(tmp, _get_sanitizationConfig__sns434(this));
|
|
1768
1769
|
var scope_1 = new TransformScope(this_2);
|
|
1769
|
-
scope_1.
|
|
1770
|
-
var tmp_2 = scope_1.
|
|
1770
|
+
scope_1.o1v(TypeScriptIrEmitter$emitGenerator$lambda_1);
|
|
1771
|
+
var tmp_2 = scope_1.g1v_1;
|
|
1771
1772
|
var generatorFile = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1772
|
-
var generatorOwnName = definition.
|
|
1773
|
+
var generatorOwnName = definition.mr().l1() + 'Generator';
|
|
1773
1774
|
var tmp_3 = asSequence(collectCustomTypeNames(generatorFile));
|
|
1774
1775
|
var tmp_4 = filterNot(tmp_3, TypeScriptIrEmitter$emitGenerator$lambda_2);
|
|
1775
1776
|
var tmp_5 = filterNot(tmp_4, TypeScriptIrEmitter$emitGenerator$lambda_3(generatorOwnName));
|
|
@@ -1778,8 +1779,8 @@ protoOf(TypeScriptIrEmitter).l1z = function (definition, module_0) {
|
|
|
1778
1779
|
var generatorRefs = LinkedHashSet_init_$Create$();
|
|
1779
1780
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1780
1781
|
var scope_2 = new TransformScope(generatorFile);
|
|
1781
|
-
scope_2.
|
|
1782
|
-
var tmp_6 = scope_2.
|
|
1782
|
+
scope_2.o1v(TypeScriptIrEmitter$emitGenerator$lambda_5(generatorOwnName, generatorRefs));
|
|
1783
|
+
var tmp_6 = scope_2.g1v_1;
|
|
1783
1784
|
isInterface(tmp_6, Element) || THROW_CCE();
|
|
1784
1785
|
// Inline function 'kotlin.collections.filter' call
|
|
1785
1786
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -1788,7 +1789,7 @@ protoOf(TypeScriptIrEmitter).l1z = function (definition, module_0) {
|
|
|
1788
1789
|
while (_iterator__ex2g4s.u()) {
|
|
1789
1790
|
var element = _iterator__ex2g4s.v();
|
|
1790
1791
|
if (endsWith(element, 'Generator')) {
|
|
1791
|
-
destination.
|
|
1792
|
+
destination.x(element);
|
|
1792
1793
|
}
|
|
1793
1794
|
}
|
|
1794
1795
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1799,7 +1800,7 @@ protoOf(TypeScriptIrEmitter).l1z = function (definition, module_0) {
|
|
|
1799
1800
|
while (_iterator__ex2g4s_0.u()) {
|
|
1800
1801
|
var item = _iterator__ex2g4s_0.v();
|
|
1801
1802
|
var tmp$ret$12 = import_0('./' + item, item);
|
|
1802
|
-
destination_0.
|
|
1803
|
+
destination_0.x(tmp$ret$12);
|
|
1803
1804
|
}
|
|
1804
1805
|
var generatorImports = destination_0;
|
|
1805
1806
|
// Inline function 'kotlin.collections.filterNot' call
|
|
@@ -1809,7 +1810,7 @@ protoOf(TypeScriptIrEmitter).l1z = function (definition, module_0) {
|
|
|
1809
1810
|
while (_iterator__ex2g4s_1.u()) {
|
|
1810
1811
|
var element_0 = _iterator__ex2g4s_1.v();
|
|
1811
1812
|
if (!endsWith(element_0, 'Generator')) {
|
|
1812
|
-
destination_1.
|
|
1813
|
+
destination_1.x(element_0);
|
|
1813
1814
|
}
|
|
1814
1815
|
}
|
|
1815
1816
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1819,13 +1820,13 @@ protoOf(TypeScriptIrEmitter).l1z = function (definition, module_0) {
|
|
|
1819
1820
|
while (_iterator__ex2g4s_2.u()) {
|
|
1820
1821
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
1821
1822
|
var tmp$ret$18 = import_0('../model/' + item_0, item_0);
|
|
1822
|
-
destination_2.
|
|
1823
|
+
destination_2.x(tmp$ret$18);
|
|
1823
1824
|
}
|
|
1824
1825
|
var modelImports = destination_2;
|
|
1825
|
-
var subPackageName = plus_0(Companion_instance.
|
|
1826
|
-
return new File(Companion_getInstance().
|
|
1826
|
+
var subPackageName = plus_0(Companion_instance.cs(''), 'generator');
|
|
1827
|
+
return new File(Companion_getInstance().n1h(subPackageName.fs() + sanitizeSymbol_1(this, generatorFile.v1n_1.o1h())), plus_1(plus_1(plus_1(listOf_0(import_0('../Wirespec', 'Wirespec')), modelImports), generatorImports), generatorFile.w1n_1));
|
|
1827
1828
|
};
|
|
1828
|
-
protoOf(TypeScriptIrEmitter).
|
|
1829
|
+
protoOf(TypeScriptIrEmitter).kq = function (type, module_0) {
|
|
1829
1830
|
var fieldValidations = classifyValidatableFields(type, module_0);
|
|
1830
1831
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1831
1832
|
var this_0 = importReferences(type);
|
|
@@ -1834,9 +1835,9 @@ protoOf(TypeScriptIrEmitter).vt = function (type, module_0) {
|
|
|
1834
1835
|
var _iterator__ex2g4s = this_0.t();
|
|
1835
1836
|
while (_iterator__ex2g4s.u()) {
|
|
1836
1837
|
var e = _iterator__ex2g4s.v();
|
|
1837
|
-
var key = e.
|
|
1838
|
-
if (set.
|
|
1839
|
-
list.
|
|
1838
|
+
var key = e.bv_1;
|
|
1839
|
+
if (set.x(key)) {
|
|
1840
|
+
list.x(e);
|
|
1840
1841
|
}
|
|
1841
1842
|
}
|
|
1842
1843
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1845,8 +1846,8 @@ protoOf(TypeScriptIrEmitter).vt = function (type, module_0) {
|
|
|
1845
1846
|
var _iterator__ex2g4s_0 = list.t();
|
|
1846
1847
|
while (_iterator__ex2g4s_0.u()) {
|
|
1847
1848
|
var item = _iterator__ex2g4s_0.v();
|
|
1848
|
-
var tmp$ret$2 = import_0('./' + item.
|
|
1849
|
-
destination.
|
|
1849
|
+
var tmp$ret$2 = import_0('./' + item.bv_1, item.bv_1);
|
|
1850
|
+
destination.x(tmp$ret$2);
|
|
1850
1851
|
}
|
|
1851
1852
|
var typeImports = destination;
|
|
1852
1853
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1855,8 +1856,8 @@ protoOf(TypeScriptIrEmitter).vt = function (type, module_0) {
|
|
|
1855
1856
|
var _iterator__ex2g4s_1 = fieldValidations.t();
|
|
1856
1857
|
while (_iterator__ex2g4s_1.u()) {
|
|
1857
1858
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
1858
|
-
var tmp$ret$5 = item_0.
|
|
1859
|
-
destination_0.
|
|
1859
|
+
var tmp$ret$5 = item_0.d1j_1;
|
|
1860
|
+
destination_0.x(tmp$ret$5);
|
|
1860
1861
|
}
|
|
1861
1862
|
// Inline function 'kotlin.collections.filter' call
|
|
1862
1863
|
var tmp0 = distinct_0(destination_0);
|
|
@@ -1865,8 +1866,8 @@ protoOf(TypeScriptIrEmitter).vt = function (type, module_0) {
|
|
|
1865
1866
|
var _iterator__ex2g4s_2 = tmp0.t();
|
|
1866
1867
|
while (_iterator__ex2g4s_2.u()) {
|
|
1867
1868
|
var element = _iterator__ex2g4s_2.v();
|
|
1868
|
-
if (!(element === type.
|
|
1869
|
-
destination_1.
|
|
1869
|
+
if (!(element === type.lp_1.l1())) {
|
|
1870
|
+
destination_1.x(element);
|
|
1870
1871
|
}
|
|
1871
1872
|
}
|
|
1872
1873
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1876,35 +1877,35 @@ protoOf(TypeScriptIrEmitter).vt = function (type, module_0) {
|
|
|
1876
1877
|
while (_iterator__ex2g4s_3.u()) {
|
|
1877
1878
|
var item_1 = _iterator__ex2g4s_3.v();
|
|
1878
1879
|
var tmp$ret$11 = import_0('./' + item_1, 'validate' + item_1);
|
|
1879
|
-
destination_2.
|
|
1880
|
+
destination_2.x(tmp$ret$11);
|
|
1880
1881
|
}
|
|
1881
1882
|
var validateImports = destination_2;
|
|
1882
1883
|
var allImports = plus_1(typeImports, validateImports);
|
|
1883
1884
|
// Inline function 'kotlin.collections.map' call
|
|
1884
|
-
var this_1 = type.
|
|
1885
|
+
var this_1 = type.mp_1.ip_1;
|
|
1885
1886
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1886
1887
|
var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1887
1888
|
var _iterator__ex2g4s_4 = this_1.t();
|
|
1888
1889
|
while (_iterator__ex2g4s_4.u()) {
|
|
1889
1890
|
var item_2 = _iterator__ex2g4s_4.v();
|
|
1890
|
-
var tmp$ret$14 = item_2.
|
|
1891
|
-
destination_3.
|
|
1891
|
+
var tmp$ret$14 = item_2.qp_1.l1();
|
|
1892
|
+
destination_3.x(tmp$ret$14);
|
|
1892
1893
|
}
|
|
1893
1894
|
var fieldNames = toSet(destination_3);
|
|
1894
|
-
var file = renameValidateAndBindObjReceiver(sanitizeNames(convertWithValidation(type, module_0), _get_modelSanitizationConfig__vgg831(this)), type.
|
|
1895
|
+
var file = renameValidateAndBindObjReceiver(sanitizeNames(convertWithValidation(type, module_0), _get_modelSanitizationConfig__vgg831(this)), type.lp_1.l1(), fieldNames);
|
|
1895
1896
|
var tmp;
|
|
1896
1897
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1897
1898
|
if (!allImports.r()) {
|
|
1898
|
-
tmp = file.
|
|
1899
|
+
tmp = file.z1n(VOID, plus_1(allImports, file.w1n_1));
|
|
1899
1900
|
} else {
|
|
1900
1901
|
tmp = file;
|
|
1901
1902
|
}
|
|
1902
1903
|
return tmp;
|
|
1903
1904
|
};
|
|
1904
|
-
protoOf(TypeScriptIrEmitter).
|
|
1905
|
+
protoOf(TypeScriptIrEmitter).zr = function (enum_0, module_0) {
|
|
1905
1906
|
return sanitizeNames(convert_0(enum_0), _get_sanitizationConfig__sns434(this));
|
|
1906
1907
|
};
|
|
1907
|
-
protoOf(TypeScriptIrEmitter).
|
|
1908
|
+
protoOf(TypeScriptIrEmitter).pr = function (union) {
|
|
1908
1909
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1909
1910
|
var this_0 = importReferences(union);
|
|
1910
1911
|
var set = HashSet_init_$Create$();
|
|
@@ -1912,9 +1913,9 @@ protoOf(TypeScriptIrEmitter).av = function (union) {
|
|
|
1912
1913
|
var _iterator__ex2g4s = this_0.t();
|
|
1913
1914
|
while (_iterator__ex2g4s.u()) {
|
|
1914
1915
|
var e = _iterator__ex2g4s.v();
|
|
1915
|
-
var key = e.
|
|
1916
|
-
if (set.
|
|
1917
|
-
list.
|
|
1916
|
+
var key = e.bv_1;
|
|
1917
|
+
if (set.x(key)) {
|
|
1918
|
+
list.x(e);
|
|
1918
1919
|
}
|
|
1919
1920
|
}
|
|
1920
1921
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1923,27 +1924,27 @@ protoOf(TypeScriptIrEmitter).av = function (union) {
|
|
|
1923
1924
|
var _iterator__ex2g4s_0 = list.t();
|
|
1924
1925
|
while (_iterator__ex2g4s_0.u()) {
|
|
1925
1926
|
var item = _iterator__ex2g4s_0.v();
|
|
1926
|
-
var tmp$ret$2 = import_0('../model', item.
|
|
1927
|
-
destination.
|
|
1927
|
+
var tmp$ret$2 = import_0('../model', item.bv_1, true);
|
|
1928
|
+
destination.x(tmp$ret$2);
|
|
1928
1929
|
}
|
|
1929
1930
|
var imports = destination;
|
|
1930
1931
|
var file = sanitizeNames(convert_1(union), _get_sanitizationConfig__sns434(this));
|
|
1931
1932
|
var tmp;
|
|
1932
1933
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1933
1934
|
if (!imports.r()) {
|
|
1934
|
-
tmp = file.
|
|
1935
|
+
tmp = file.z1n(VOID, plus_1(imports, file.w1n_1));
|
|
1935
1936
|
} else {
|
|
1936
1937
|
tmp = file;
|
|
1937
1938
|
}
|
|
1938
1939
|
return tmp;
|
|
1939
1940
|
};
|
|
1940
|
-
protoOf(TypeScriptIrEmitter).
|
|
1941
|
+
protoOf(TypeScriptIrEmitter).ur = function (refined) {
|
|
1941
1942
|
var converted = convert_2(refined);
|
|
1942
|
-
var constraintExpr = convertConstraint(refined.
|
|
1943
|
-
var validatorStr = TypeScriptGenerator_getInstance().
|
|
1944
|
-
return new File(converted.
|
|
1943
|
+
var constraintExpr = convertConstraint(refined.tr_1, new VariableReference(Companion_getInstance().n1h('value')));
|
|
1944
|
+
var validatorStr = TypeScriptGenerator_getInstance().k1w(constraintExpr);
|
|
1945
|
+
return new File(converted.v1n_1, listOf([new RawElement('export type ' + converted.v1n_1.o1h() + ' = ' + emitTypeScriptReference(this, refined.tr_1) + ';'), new RawElement('export const validate' + refined.sr_1.l1() + ' = (value: ' + emitTypeScriptReference(this, refined.tr_1) + ') =>\n ' + validatorStr + ';')]));
|
|
1945
1946
|
};
|
|
1946
|
-
protoOf(TypeScriptIrEmitter).
|
|
1947
|
+
protoOf(TypeScriptIrEmitter).as = function (endpoint) {
|
|
1947
1948
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1948
1949
|
var this_0 = importReferences(endpoint);
|
|
1949
1950
|
var set = HashSet_init_$Create$();
|
|
@@ -1951,9 +1952,9 @@ protoOf(TypeScriptIrEmitter).lv = function (endpoint) {
|
|
|
1951
1952
|
var _iterator__ex2g4s = this_0.t();
|
|
1952
1953
|
while (_iterator__ex2g4s.u()) {
|
|
1953
1954
|
var e = _iterator__ex2g4s.v();
|
|
1954
|
-
var key = e.
|
|
1955
|
-
if (set.
|
|
1956
|
-
list.
|
|
1955
|
+
var key = e.bv_1;
|
|
1956
|
+
if (set.x(key)) {
|
|
1957
|
+
list.x(e);
|
|
1957
1958
|
}
|
|
1958
1959
|
}
|
|
1959
1960
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -1962,8 +1963,8 @@ protoOf(TypeScriptIrEmitter).lv = function (endpoint) {
|
|
|
1962
1963
|
var _iterator__ex2g4s_0 = list.t();
|
|
1963
1964
|
while (_iterator__ex2g4s_0.u()) {
|
|
1964
1965
|
var item = _iterator__ex2g4s_0.v();
|
|
1965
|
-
var tmp$ret$2 = import_0('../model', item.
|
|
1966
|
-
destination.
|
|
1966
|
+
var tmp$ret$2 = import_0('../model', item.bv_1, true);
|
|
1967
|
+
destination.x(tmp$ret$2);
|
|
1967
1968
|
}
|
|
1968
1969
|
var imports = destination;
|
|
1969
1970
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
@@ -1971,25 +1972,25 @@ protoOf(TypeScriptIrEmitter).lv = function (endpoint) {
|
|
|
1971
1972
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1972
1973
|
var this_1 = stripTrailingSpaceFromErrorMessage(convert_3(endpoint));
|
|
1973
1974
|
var scope = new TransformScope(this_1);
|
|
1974
|
-
scope.
|
|
1975
|
-
var tmp = scope.
|
|
1975
|
+
scope.l1v(transformPatternSwitchToValueSwitch());
|
|
1976
|
+
var tmp = scope.g1v_1;
|
|
1976
1977
|
var tmp$ret$7 = isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1977
1978
|
// Inline function 'kotlin.let' call
|
|
1978
|
-
var it = sanitizeNames(emit$injectApiConst(emit$applyCallParamsIfNeeded(tmp$ret$7, hasRequestParams), endpoint).
|
|
1979
|
+
var it = sanitizeNames(emit$injectApiConst(emit$applyCallParamsIfNeeded(tmp$ret$7, hasRequestParams), endpoint).z1n(Companion_getInstance().n1h(sanitize(this, endpoint.up_1))), _get_sanitizationConfig__sns434(this));
|
|
1979
1980
|
var tmp_0;
|
|
1980
1981
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1981
1982
|
if (!imports.r()) {
|
|
1982
|
-
tmp_0 = it.
|
|
1983
|
+
tmp_0 = it.z1n(VOID, plus_1(imports, it.w1n_1));
|
|
1983
1984
|
} else {
|
|
1984
1985
|
tmp_0 = it;
|
|
1985
1986
|
}
|
|
1986
1987
|
return tmp_0;
|
|
1987
1988
|
};
|
|
1988
|
-
protoOf(TypeScriptIrEmitter).
|
|
1989
|
+
protoOf(TypeScriptIrEmitter).or = function (channel) {
|
|
1989
1990
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1990
1991
|
};
|
|
1991
|
-
protoOf(TypeScriptIrEmitter).
|
|
1992
|
-
var endpointName = endpoint.
|
|
1992
|
+
protoOf(TypeScriptIrEmitter).b1w = function (endpoint) {
|
|
1993
|
+
var endpointName = endpoint.up_1.l1();
|
|
1993
1994
|
var methodName = firstToLower(this, endpointName);
|
|
1994
1995
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1995
1996
|
var this_0 = importReferences(endpoint);
|
|
@@ -1998,9 +1999,9 @@ protoOf(TypeScriptIrEmitter).k1z = function (endpoint) {
|
|
|
1998
1999
|
var _iterator__ex2g4s = this_0.t();
|
|
1999
2000
|
while (_iterator__ex2g4s.u()) {
|
|
2000
2001
|
var e = _iterator__ex2g4s.v();
|
|
2001
|
-
var key = e.
|
|
2002
|
-
if (set.
|
|
2003
|
-
list.
|
|
2002
|
+
var key = e.bv_1;
|
|
2003
|
+
if (set.x(key)) {
|
|
2004
|
+
list.x(e);
|
|
2004
2005
|
}
|
|
2005
2006
|
}
|
|
2006
2007
|
// Inline function 'kotlin.collections.map' call
|
|
@@ -2009,8 +2010,8 @@ protoOf(TypeScriptIrEmitter).k1z = function (endpoint) {
|
|
|
2009
2010
|
var _iterator__ex2g4s_0 = list.t();
|
|
2010
2011
|
while (_iterator__ex2g4s_0.u()) {
|
|
2011
2012
|
var item = _iterator__ex2g4s_0.v();
|
|
2012
|
-
var tmp$ret$2 = import_0('../model', item.
|
|
2013
|
-
destination.
|
|
2013
|
+
var tmp$ret$2 = import_0('../model', item.bv_1, true);
|
|
2014
|
+
destination.x(tmp$ret$2);
|
|
2014
2015
|
}
|
|
2015
2016
|
var imports = destination;
|
|
2016
2017
|
var params = buildEndpointParams(this, endpoint);
|
|
@@ -2031,50 +2032,50 @@ protoOf(TypeScriptIrEmitter).k1z = function (endpoint) {
|
|
|
2031
2032
|
}
|
|
2032
2033
|
var requestArgs = tmp_0;
|
|
2033
2034
|
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 ');
|
|
2034
|
-
var tmp_1 = Companion_getInstance().
|
|
2035
|
+
var tmp_1 = Companion_getInstance().n1h('client/' + endpointName + 'Client');
|
|
2035
2036
|
// Inline function 'kotlin.collections.buildList' call
|
|
2036
2037
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
2037
2038
|
// Inline function 'kotlin.apply' call
|
|
2038
2039
|
var this_1 = ArrayList_init_$Create$();
|
|
2039
|
-
this_1.
|
|
2040
|
-
this_1.
|
|
2041
|
-
this_1.
|
|
2042
|
-
this_1.
|
|
2043
|
-
var tmp$ret$10 = this_1.
|
|
2040
|
+
this_1.x(import_0('../Wirespec', 'Wirespec'));
|
|
2041
|
+
this_1.x(import_0('../endpoint/' + endpointName, endpointName));
|
|
2042
|
+
this_1.f1(imports);
|
|
2043
|
+
this_1.x(new RawElement(code));
|
|
2044
|
+
var tmp$ret$10 = this_1.o5();
|
|
2044
2045
|
return new File(tmp_1, tmp$ret$10);
|
|
2045
2046
|
};
|
|
2046
|
-
protoOf(TypeScriptIrEmitter).
|
|
2047
|
-
logger.
|
|
2047
|
+
protoOf(TypeScriptIrEmitter).y1v = function (endpoints, logger) {
|
|
2048
|
+
logger.jr('Emitting main Client for ' + endpoints.a1() + ' endpoints');
|
|
2048
2049
|
// Inline function 'kotlin.collections.map' call
|
|
2049
2050
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2050
2051
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(endpoints, 10));
|
|
2051
2052
|
var _iterator__ex2g4s = endpoints.t();
|
|
2052
2053
|
while (_iterator__ex2g4s.u()) {
|
|
2053
2054
|
var item = _iterator__ex2g4s.v();
|
|
2054
|
-
var methodName = firstToLower(this, item.
|
|
2055
|
-
var tmp$ret$0 = import_0('./client/' + item.
|
|
2056
|
-
destination.
|
|
2055
|
+
var methodName = firstToLower(this, item.up_1.l1());
|
|
2056
|
+
var tmp$ret$0 = import_0('./client/' + item.up_1.l1() + 'Client', methodName + 'Client');
|
|
2057
|
+
destination.x(tmp$ret$0);
|
|
2057
2058
|
}
|
|
2058
2059
|
var clientImports = destination;
|
|
2059
2060
|
var spreadEntries = joinToString(endpoints, '\n', VOID, VOID, VOID, VOID, TypeScriptIrEmitter$emitClient$lambda(this));
|
|
2060
2061
|
var code = trimMargin('\n |export const client = (serialization: Wirespec.Serialization, transportation: Wirespec.Transportation) => ({\n |' + spreadEntries + '\n |})\n ');
|
|
2061
|
-
var tmp = Companion_getInstance().
|
|
2062
|
+
var tmp = Companion_getInstance().n1h('Client');
|
|
2062
2063
|
// Inline function 'kotlin.collections.buildList' call
|
|
2063
2064
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
2064
2065
|
// Inline function 'kotlin.apply' call
|
|
2065
2066
|
var this_0 = ArrayList_init_$Create$();
|
|
2066
|
-
this_0.
|
|
2067
|
-
this_0.
|
|
2068
|
-
this_0.
|
|
2069
|
-
var tmp$ret$6 = this_0.
|
|
2067
|
+
this_0.x(import_0('./Wirespec', 'Wirespec'));
|
|
2068
|
+
this_0.f1(clientImports);
|
|
2069
|
+
this_0.x(new RawElement(code));
|
|
2070
|
+
var tmp$ret$6 = this_0.o5();
|
|
2070
2071
|
return new File(tmp, tmp$ret$6);
|
|
2071
2072
|
};
|
|
2072
2073
|
function transformPatternSwitchToValueSwitch() {
|
|
2073
2074
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2074
2075
|
// Inline function 'kotlin.apply' call
|
|
2075
2076
|
var this_0 = new TransformerBuilder();
|
|
2076
|
-
this_0.
|
|
2077
|
-
return this_0.
|
|
2077
|
+
this_0.n1v(transformPatternSwitchToValueSwitch$lambda);
|
|
2078
|
+
return this_0.y1i();
|
|
2078
2079
|
}
|
|
2079
2080
|
function renameValidateAndBindObjReceiver(_this__u8e3s4, typeName, fieldNames) {
|
|
2080
2081
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -2082,19 +2083,19 @@ function renameValidateAndBindObjReceiver(_this__u8e3s4, typeName, fieldNames) {
|
|
|
2082
2083
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
2083
2084
|
var tmp = scope;
|
|
2084
2085
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
2085
|
-
var this_0 = scope.
|
|
2086
|
+
var this_0 = scope.g1v_1;
|
|
2086
2087
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2087
2088
|
// Inline function 'kotlin.apply' call
|
|
2088
2089
|
var this_1 = new TransformerBuilder();
|
|
2089
|
-
this_1.
|
|
2090
|
-
var tmp$ret$2 = this_1.
|
|
2091
|
-
tmp.
|
|
2092
|
-
var tmp_0 = scope.
|
|
2090
|
+
this_1.x1i(renameValidateAndBindObjReceiver$lambda(typeName, fieldNames));
|
|
2091
|
+
var tmp$ret$2 = this_1.y1i();
|
|
2092
|
+
tmp.g1v_1 = transform(this_0, tmp$ret$2);
|
|
2093
|
+
var tmp_0 = scope.g1v_1;
|
|
2093
2094
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2094
2095
|
}
|
|
2095
2096
|
function buildApiConst(endpoint) {
|
|
2096
2097
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
2097
|
-
var this_0 = endpoint.
|
|
2098
|
+
var this_0 = endpoint.up_1.l1();
|
|
2098
2099
|
var tmp;
|
|
2099
2100
|
// Inline function 'kotlin.text.isNotEmpty' call
|
|
2100
2101
|
if (charSequenceLength(this_0) > 0) {
|
|
@@ -2108,8 +2109,8 @@ function buildApiConst(endpoint) {
|
|
|
2108
2109
|
tmp = this_0;
|
|
2109
2110
|
}
|
|
2110
2111
|
var apiName = tmp;
|
|
2111
|
-
var method = endpoint.
|
|
2112
|
-
var pathString = joinToString(endpoint.
|
|
2112
|
+
var method = endpoint.vp_1.a3_1;
|
|
2113
|
+
var pathString = joinToString(endpoint.wp_1, '/', VOID, VOID, VOID, VOID, buildApiConst$lambda);
|
|
2113
2114
|
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 '));
|
|
2114
2115
|
}
|
|
2115
2116
|
function bindCallToRequestParams(_this__u8e3s4) {
|
|
@@ -2118,21 +2119,21 @@ function bindCallToRequestParams(_this__u8e3s4) {
|
|
|
2118
2119
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
2119
2120
|
var tmp = scope;
|
|
2120
2121
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
2121
|
-
var this_0 = scope.
|
|
2122
|
+
var this_0 = scope.g1v_1;
|
|
2122
2123
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2123
2124
|
// Inline function 'kotlin.apply' call
|
|
2124
2125
|
var this_1 = new TransformerBuilder();
|
|
2125
|
-
this_1.
|
|
2126
|
-
var tmp$ret$2 = this_1.
|
|
2127
|
-
tmp.
|
|
2128
|
-
var tmp_0 = scope.
|
|
2126
|
+
this_1.x1i(bindCallToRequestParams$lambda);
|
|
2127
|
+
var tmp$ret$2 = this_1.y1i();
|
|
2128
|
+
tmp.g1v_1 = transform(this_0, tmp$ret$2);
|
|
2129
|
+
var tmp_0 = scope.g1v_1;
|
|
2129
2130
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2130
2131
|
}
|
|
2131
2132
|
function stripTrailingSpaceFromErrorMessage(_this__u8e3s4) {
|
|
2132
2133
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2133
2134
|
var scope = new TransformScope(_this__u8e3s4);
|
|
2134
|
-
scope.
|
|
2135
|
-
var tmp = scope.
|
|
2135
|
+
scope.n1v(stripTrailingSpaceFromErrorMessage$lambda);
|
|
2136
|
+
var tmp = scope.g1v_1;
|
|
2136
2137
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
2137
2138
|
}
|
|
2138
2139
|
function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
@@ -2140,7 +2141,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2140
2141
|
if (!(stmt instanceof Switch)) {
|
|
2141
2142
|
tmp = true;
|
|
2142
2143
|
} else {
|
|
2143
|
-
var tmp0 = stmt.
|
|
2144
|
+
var tmp0 = stmt.i1q_1;
|
|
2144
2145
|
var tmp$ret$0;
|
|
2145
2146
|
$l$block_0: {
|
|
2146
2147
|
// Inline function 'kotlin.collections.none' call
|
|
@@ -2157,7 +2158,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2157
2158
|
var _iterator__ex2g4s = tmp0.t();
|
|
2158
2159
|
while (_iterator__ex2g4s.u()) {
|
|
2159
2160
|
var element = _iterator__ex2g4s.v();
|
|
2160
|
-
if (!(element.
|
|
2161
|
+
if (!(element.p1q_1 == null)) {
|
|
2161
2162
|
tmp$ret$0 = false;
|
|
2162
2163
|
break $l$block_0;
|
|
2163
2164
|
}
|
|
@@ -2168,11 +2169,11 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2168
2169
|
}
|
|
2169
2170
|
if (tmp)
|
|
2170
2171
|
return transformChildren(stmt, tr);
|
|
2171
|
-
var tmp0_safe_receiver = stmt.
|
|
2172
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
2172
|
+
var tmp0_safe_receiver = stmt.k1q_1;
|
|
2173
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.q1m();
|
|
2173
2174
|
var varName = tmp1_elvis_lhs == null ? 'r' : tmp1_elvis_lhs;
|
|
2174
2175
|
// Inline function 'kotlin.collections.map' call
|
|
2175
|
-
var this_0 = stmt.
|
|
2176
|
+
var this_0 = stmt.i1q_1;
|
|
2176
2177
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2177
2178
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2178
2179
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
@@ -2180,48 +2181,48 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2180
2181
|
var item = _iterator__ex2g4s_0.v();
|
|
2181
2182
|
var tmp$ret$5;
|
|
2182
2183
|
$l$block_1: {
|
|
2183
|
-
var tmp_1 = item.
|
|
2184
|
+
var tmp_1 = item.p1q_1;
|
|
2184
2185
|
var tmp0_safe_receiver_0 = tmp_1 instanceof Custom_0 ? tmp_1 : null;
|
|
2185
|
-
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.
|
|
2186
|
-
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
2186
|
+
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.h1j_1;
|
|
2187
|
+
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.o1h();
|
|
2187
2188
|
var tmp3_safe_receiver = typeName == null ? null : substringAfterLast(typeName, '.');
|
|
2188
2189
|
var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : removePrefix(tmp3_safe_receiver, 'Response');
|
|
2189
2190
|
var statusNum = tmp4_safe_receiver == null ? null : toIntOrNull(tmp4_safe_receiver);
|
|
2190
2191
|
if (statusNum == null || typeName == null) {
|
|
2191
2192
|
// Inline function 'kotlin.collections.map' call
|
|
2192
|
-
var this_1 = item.
|
|
2193
|
+
var this_1 = item.o1q_1;
|
|
2193
2194
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2194
2195
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
2195
2196
|
var _iterator__ex2g4s_1 = this_1.t();
|
|
2196
2197
|
while (_iterator__ex2g4s_1.u()) {
|
|
2197
2198
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
2198
|
-
var tmp$ret$2 = tr.
|
|
2199
|
-
destination_0.
|
|
2199
|
+
var tmp$ret$2 = tr.a1v(item_0);
|
|
2200
|
+
destination_0.x(tmp$ret$2);
|
|
2200
2201
|
}
|
|
2201
|
-
tmp$ret$5 = item.
|
|
2202
|
+
tmp$ret$5 = item.r1q(VOID, destination_0);
|
|
2202
2203
|
break $l$block_1;
|
|
2203
2204
|
}
|
|
2204
|
-
var exprCode = TypeScriptGenerator_getInstance().
|
|
2205
|
-
var castAssignment = new Assignment(Companion_getInstance().
|
|
2205
|
+
var exprCode = TypeScriptGenerator_getInstance().k1w(tr.b1v(stmt.h1q_1));
|
|
2206
|
+
var castAssignment = new Assignment(Companion_getInstance().n1h(varName), new RawExpression(exprCode + ' as ' + typeName), false);
|
|
2206
2207
|
var tmp_2 = new Literal_0(statusNum, new Integer_0());
|
|
2207
2208
|
var tmp_3 = listOf_0(castAssignment);
|
|
2208
2209
|
// Inline function 'kotlin.collections.map' call
|
|
2209
|
-
var this_2 = item.
|
|
2210
|
+
var this_2 = item.o1q_1;
|
|
2210
2211
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2211
2212
|
var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
|
|
2212
2213
|
var _iterator__ex2g4s_2 = this_2.t();
|
|
2213
2214
|
while (_iterator__ex2g4s_2.u()) {
|
|
2214
2215
|
var item_1 = _iterator__ex2g4s_2.v();
|
|
2215
|
-
var tmp$ret$6 = tr.
|
|
2216
|
-
destination_1.
|
|
2216
|
+
var tmp$ret$6 = tr.a1v(item_1);
|
|
2217
|
+
destination_1.x(tmp$ret$6);
|
|
2217
2218
|
}
|
|
2218
2219
|
tmp$ret$5 = new Case(tmp_2, plus_1(tmp_3, destination_1), null);
|
|
2219
2220
|
}
|
|
2220
|
-
destination.
|
|
2221
|
+
destination.x(tmp$ret$5);
|
|
2221
2222
|
}
|
|
2222
2223
|
var transformedCases = destination;
|
|
2223
|
-
var tmp_4 = new FieldCall(tr.
|
|
2224
|
-
var tmp2_safe_receiver = stmt.
|
|
2224
|
+
var tmp_4 = new FieldCall(tr.b1v(stmt.h1q_1), Companion_getInstance().n1h('status'));
|
|
2225
|
+
var tmp2_safe_receiver = stmt.j1q_1;
|
|
2225
2226
|
var tmp_5;
|
|
2226
2227
|
if (tmp2_safe_receiver == null) {
|
|
2227
2228
|
tmp_5 = null;
|
|
@@ -2232,8 +2233,8 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2232
2233
|
var _iterator__ex2g4s_3 = tmp2_safe_receiver.t();
|
|
2233
2234
|
while (_iterator__ex2g4s_3.u()) {
|
|
2234
2235
|
var item_2 = _iterator__ex2g4s_3.v();
|
|
2235
|
-
var tmp$ret$11 = tr.
|
|
2236
|
-
destination_2.
|
|
2236
|
+
var tmp$ret$11 = tr.a1v(item_2);
|
|
2237
|
+
destination_2.x(tmp$ret$11);
|
|
2237
2238
|
}
|
|
2238
2239
|
tmp_5 = destination_2;
|
|
2239
2240
|
}
|
|
@@ -2246,43 +2247,43 @@ function renameValidateAndBindObjReceiver$lambda$lambda($fieldNames) {
|
|
|
2246
2247
|
var tmp_1;
|
|
2247
2248
|
var tmp_2;
|
|
2248
2249
|
if (s instanceof FunctionCall) {
|
|
2249
|
-
tmp_2 = s.
|
|
2250
|
+
tmp_2 = s.a1n_1.equals(Companion_getInstance().n1h('validate'));
|
|
2250
2251
|
} else {
|
|
2251
2252
|
tmp_2 = false;
|
|
2252
2253
|
}
|
|
2253
2254
|
if (tmp_2) {
|
|
2254
|
-
tmp_1 = !(s.
|
|
2255
|
+
tmp_1 = !(s.y1m_1 == null);
|
|
2255
2256
|
} else {
|
|
2256
2257
|
tmp_1 = false;
|
|
2257
2258
|
}
|
|
2258
2259
|
if (tmp_1) {
|
|
2259
2260
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
2260
|
-
tmp_0 = !s.
|
|
2261
|
+
tmp_0 = !s.z1m_1.r();
|
|
2261
2262
|
} else {
|
|
2262
2263
|
tmp_0 = false;
|
|
2263
2264
|
}
|
|
2264
2265
|
if (tmp_0) {
|
|
2265
|
-
var tmp_3 = first(s.
|
|
2266
|
+
var tmp_3 = first(s.z1m_1);
|
|
2266
2267
|
var tmp0_safe_receiver = tmp_3 instanceof Custom_0 ? tmp_3 : null;
|
|
2267
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
2268
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
2268
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.h1j_1;
|
|
2269
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.o1h();
|
|
2269
2270
|
var tn = tmp2_elvis_lhs == null ? '' : tmp2_elvis_lhs;
|
|
2270
|
-
tmp = new FunctionCall(VOID, VOID, Companion_getInstance().
|
|
2271
|
+
tmp = new FunctionCall(VOID, VOID, Companion_getInstance().n1h('validate' + tn), mapOf(to(Companion_getInstance().n1h('obj'), t.b1v(ensureNotNull(s.y1m_1)))));
|
|
2271
2272
|
} else {
|
|
2272
2273
|
var tmp_4;
|
|
2273
2274
|
var tmp_5;
|
|
2274
2275
|
if (s instanceof FieldCall) {
|
|
2275
|
-
tmp_5 = s.
|
|
2276
|
+
tmp_5 = s.s1q_1 == null;
|
|
2276
2277
|
} else {
|
|
2277
2278
|
tmp_5 = false;
|
|
2278
2279
|
}
|
|
2279
2280
|
if (tmp_5) {
|
|
2280
|
-
tmp_4 = $fieldNames.
|
|
2281
|
+
tmp_4 = $fieldNames.u1(s.t1q_1.q1m());
|
|
2281
2282
|
} else {
|
|
2282
2283
|
tmp_4 = false;
|
|
2283
2284
|
}
|
|
2284
2285
|
if (tmp_4) {
|
|
2285
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().
|
|
2286
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().n1h('obj')), s.t1q_1);
|
|
2286
2287
|
} else {
|
|
2287
2288
|
tmp = transformChildren(s, t);
|
|
2288
2289
|
}
|
|
@@ -2296,15 +2297,15 @@ function renameValidateAndBindObjReceiver$lambda($typeName, $fieldNames) {
|
|
|
2296
2297
|
if (element instanceof Function) {
|
|
2297
2298
|
var tmp$ret$0;
|
|
2298
2299
|
$l$block: {
|
|
2299
|
-
if (!element.
|
|
2300
|
+
if (!element.d1l_1.equals(Companion_getInstance().n1h('validate'))) {
|
|
2300
2301
|
tmp$ret$0 = element;
|
|
2301
2302
|
break $l$block;
|
|
2302
2303
|
}
|
|
2303
2304
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2304
|
-
var this_0 = element.
|
|
2305
|
+
var this_0 = element.l1l(Companion_getInstance().n1h('validate' + $typeName), VOID, listOf_0(new Parameter(Companion_getInstance().n1h('obj'), Custom_init_$Create$($typeName))));
|
|
2305
2306
|
var scope = new TransformScope(this_0);
|
|
2306
|
-
scope.
|
|
2307
|
-
var tmp_0 = scope.
|
|
2307
|
+
scope.p1v(renameValidateAndBindObjReceiver$lambda$lambda($fieldNames));
|
|
2308
|
+
var tmp_0 = scope.g1v_1;
|
|
2308
2309
|
tmp$ret$0 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2309
2310
|
}
|
|
2310
2311
|
tmp = tmp$ret$0;
|
|
@@ -2318,10 +2319,10 @@ function renameValidateAndBindObjReceiver$lambda($typeName, $fieldNames) {
|
|
|
2318
2319
|
function buildApiConst$lambda(it) {
|
|
2319
2320
|
var tmp;
|
|
2320
2321
|
if (it instanceof Literal) {
|
|
2321
|
-
tmp = it.
|
|
2322
|
+
tmp = it.xq_1;
|
|
2322
2323
|
} else {
|
|
2323
2324
|
if (it instanceof Param) {
|
|
2324
|
-
tmp = '{' + it.
|
|
2325
|
+
tmp = '{' + it.bq_1.l1() + '}';
|
|
2325
2326
|
} else {
|
|
2326
2327
|
noWhenBranchMatchedException();
|
|
2327
2328
|
}
|
|
@@ -2333,23 +2334,23 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
2333
2334
|
if (element instanceof Interface) {
|
|
2334
2335
|
var tmp$ret$0;
|
|
2335
2336
|
$l$block: {
|
|
2336
|
-
if (!element.
|
|
2337
|
+
if (!element.p1o_1.equals(Companion_getInstance().n1h('Call'))) {
|
|
2337
2338
|
tmp$ret$0 = element;
|
|
2338
2339
|
break $l$block;
|
|
2339
2340
|
}
|
|
2340
2341
|
// Inline function 'kotlin.collections.map' call
|
|
2341
|
-
var this_0 = element.
|
|
2342
|
+
var this_0 = element.q1o_1;
|
|
2342
2343
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2343
2344
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2344
2345
|
var _iterator__ex2g4s = this_0.t();
|
|
2345
2346
|
while (_iterator__ex2g4s.u()) {
|
|
2346
2347
|
var item = _iterator__ex2g4s.v();
|
|
2347
2348
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
2348
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
2349
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.l1l(VOID, VOID, listOf_0(new Parameter(Companion_getInstance().n1h('params'), Custom_init_$Create$('RequestParams'))));
|
|
2349
2350
|
var tmp$ret$1 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
2350
|
-
destination.
|
|
2351
|
+
destination.x(tmp$ret$1);
|
|
2351
2352
|
}
|
|
2352
|
-
tmp$ret$0 = element.
|
|
2353
|
+
tmp$ret$0 = element.w1o(VOID, destination);
|
|
2353
2354
|
}
|
|
2354
2355
|
tmp = tmp$ret$0;
|
|
2355
2356
|
} else {
|
|
@@ -2361,7 +2362,7 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
2361
2362
|
function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
2362
2363
|
var tmp;
|
|
2363
2364
|
if (stmt instanceof Switch) {
|
|
2364
|
-
var tmp1_safe_receiver = stmt.
|
|
2365
|
+
var tmp1_safe_receiver = stmt.j1q_1;
|
|
2365
2366
|
var tmp_0;
|
|
2366
2367
|
if (tmp1_safe_receiver == null) {
|
|
2367
2368
|
tmp_0 = null;
|
|
@@ -2383,7 +2384,7 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2383
2384
|
tmp_1 = tmp0_elvis_lhs;
|
|
2384
2385
|
}
|
|
2385
2386
|
var errorStmt = tmp_1;
|
|
2386
|
-
var tmp_2 = errorStmt.
|
|
2387
|
+
var tmp_2 = errorStmt.w1q_1;
|
|
2387
2388
|
var tmp1_elvis_lhs = tmp_2 instanceof BinaryOp ? tmp_2 : null;
|
|
2388
2389
|
var tmp_3;
|
|
2389
2390
|
if (tmp1_elvis_lhs == null) {
|
|
@@ -2393,7 +2394,7 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2393
2394
|
tmp_3 = tmp1_elvis_lhs;
|
|
2394
2395
|
}
|
|
2395
2396
|
var binary = tmp_3;
|
|
2396
|
-
var tmp_4 = binary.
|
|
2397
|
+
var tmp_4 = binary.x1q_1;
|
|
2397
2398
|
var tmp2_elvis_lhs = tmp_4 instanceof Literal_0 ? tmp_4 : null;
|
|
2398
2399
|
var tmp_5;
|
|
2399
2400
|
if (tmp2_elvis_lhs == null) {
|
|
@@ -2403,13 +2404,13 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2403
2404
|
tmp_5 = tmp2_elvis_lhs;
|
|
2404
2405
|
}
|
|
2405
2406
|
var literal = tmp_5;
|
|
2406
|
-
tmp$ret$0 = new ErrorStatement(new Literal_0(trimEnd(toString(literal.
|
|
2407
|
+
tmp$ret$0 = new ErrorStatement(new Literal_0(trimEnd(toString(literal.u1p_1), charArrayOf([_Char___init__impl__6a9atx(32)])), literal.v1p_1));
|
|
2407
2408
|
}
|
|
2408
|
-
destination.
|
|
2409
|
+
destination.x(tmp$ret$0);
|
|
2409
2410
|
}
|
|
2410
2411
|
tmp_0 = destination;
|
|
2411
2412
|
}
|
|
2412
|
-
tmp = transformChildren(stmt.
|
|
2413
|
+
tmp = transformChildren(stmt.m1q(VOID, VOID, tmp_0), transformer);
|
|
2413
2414
|
} else {
|
|
2414
2415
|
tmp = transformChildren(stmt, transformer);
|
|
2415
2416
|
}
|
|
@@ -2419,8 +2420,8 @@ function TypeScriptRefinedTypeDefinitionEmitter() {
|
|
|
2419
2420
|
}
|
|
2420
2421
|
function TypeScriptShared() {
|
|
2421
2422
|
TypeScriptShared_instance = this;
|
|
2422
|
-
this.
|
|
2423
|
-
this.
|
|
2423
|
+
this.v20_1 = 'community.flock.wirespec';
|
|
2424
|
+
this.w20_1 = trimMargin('\n |export namespace Wirespec {\n |' + Spacer_instance.toString() + 'export type Method = "GET" | "PUT" | "POST" | "DELETE" | "OPTIONS" | "HEAD" | "PATCH" | "TRACE"\n |' + Spacer_instance.toString() + 'export type RawRequest = { method: Method, path: string[], queries: Record<string, string>, headers: Record<string, string>, body?: string }\n |' + Spacer_instance.toString() + 'export type RawResponse = { status: number, headers: Record<string, string>, body?: string }\n |' + Spacer_instance.toString() + 'export type Request<T> = { path: Record<string, unknown>, method: Method, queries?: Record<string, unknown>, headers?: Record<string, unknown>, body?:T }\n |' + Spacer_instance.toString() + 'export type Response<T> = { status:number, headers?: Record<string, unknown>, body?:T }\n |' + Spacer_instance.toString() + 'export type Serialization = { serialize: <T>(type: T) => string; deserialize: <T>(raw: string | undefined) => T }\n |' + Spacer_instance.toString() + 'export type Client<REQ extends Request<unknown>, RES extends Response<unknown>> = (serialization: Serialization) => { to: (request: REQ) => RawRequest; from: (response: RawResponse) => RES }\n |' + Spacer_instance.toString() + 'export type Server<REQ extends Request<unknown>, RES extends Response<unknown>> = (serialization: Serialization) => { from: (request: RawRequest) => REQ; to: (response: RES) => RawResponse }\n |' + Spacer_instance.toString() + 'export type Api<REQ extends Request<unknown>, RES extends Response<unknown>> = { name: string; method: Method, path: string, client: Client<REQ, RES>; server: Server<REQ, RES> }\n |}\n ');
|
|
2424
2425
|
}
|
|
2425
2426
|
protoOf(TypeScriptShared).toString = function () {
|
|
2426
2427
|
return 'TypeScriptShared';
|
|
@@ -2442,7 +2443,7 @@ function TypeScriptShared_getInstance() {
|
|
|
2442
2443
|
return TypeScriptShared_instance;
|
|
2443
2444
|
}
|
|
2444
2445
|
function TypeScriptTypeDefinitionEmitter$sanitizeSymbol$lambda(it) {
|
|
2445
|
-
return isLetterOrDigit(it.
|
|
2446
|
+
return isLetterOrDigit(it.h1_1) || listOf_0(new Char(_Char___init__impl__6a9atx(95))).u1(it);
|
|
2446
2447
|
}
|
|
2447
2448
|
function TypeScriptTypeDefinitionEmitter$emit$lambda(it) {
|
|
2448
2449
|
// Inline function 'kotlin.text.trimStart' call
|
|
@@ -2450,29 +2451,30 @@ function TypeScriptTypeDefinitionEmitter$emit$lambda(it) {
|
|
|
2450
2451
|
}
|
|
2451
2452
|
function TypeScriptTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2452
2453
|
return function (it) {
|
|
2453
|
-
return this$0.
|
|
2454
|
+
return this$0.mq(it);
|
|
2454
2455
|
};
|
|
2455
2456
|
}
|
|
2456
2457
|
function TypeScriptTypeDefinitionEmitter() {
|
|
2457
2458
|
}
|
|
2458
2459
|
//region block: post-declaration
|
|
2459
|
-
protoOf(TypeScriptEmitter).
|
|
2460
|
-
protoOf(TypeScriptEmitter).
|
|
2461
|
-
protoOf(TypeScriptEmitter).
|
|
2462
|
-
protoOf(TypeScriptEmitter).
|
|
2463
|
-
protoOf(TypeScriptEmitter).
|
|
2464
|
-
protoOf(TypeScriptEmitter).
|
|
2465
|
-
protoOf(TypeScriptEmitter).
|
|
2466
|
-
protoOf(TypeScriptEmitter).
|
|
2467
|
-
protoOf(TypeScriptEmitter).
|
|
2468
|
-
protoOf(TypeScriptEmitter).
|
|
2469
|
-
protoOf(TypeScriptEmitter).
|
|
2470
|
-
protoOf(TypeScriptEmitter).
|
|
2471
|
-
protoOf(TypeScriptEmitter).
|
|
2472
|
-
protoOf(TypeScriptEmitter).
|
|
2473
|
-
protoOf(TypeScriptEmitter).
|
|
2474
|
-
protoOf(TypeScriptIrEmitter).
|
|
2475
|
-
protoOf(TypeScriptIrEmitter).
|
|
2460
|
+
protoOf(TypeScriptEmitter).kq = emit_3;
|
|
2461
|
+
protoOf(TypeScriptEmitter).lq = emit_6;
|
|
2462
|
+
protoOf(TypeScriptEmitter).mq = emit_7;
|
|
2463
|
+
protoOf(TypeScriptEmitter).nq = emit_4;
|
|
2464
|
+
protoOf(TypeScriptEmitter).oq = emit_5;
|
|
2465
|
+
protoOf(TypeScriptEmitter).zr = emit_10;
|
|
2466
|
+
protoOf(TypeScriptEmitter).ur = emit_9;
|
|
2467
|
+
protoOf(TypeScriptEmitter).as = emit_8;
|
|
2468
|
+
protoOf(TypeScriptEmitter).nr = emit_2;
|
|
2469
|
+
protoOf(TypeScriptEmitter).bs = emitValidator;
|
|
2470
|
+
protoOf(TypeScriptEmitter).q20 = sanitizeSymbol;
|
|
2471
|
+
protoOf(TypeScriptEmitter).g1x = sanitizeSymbol_0;
|
|
2472
|
+
protoOf(TypeScriptEmitter).r20 = emitPrimitive;
|
|
2473
|
+
protoOf(TypeScriptEmitter).p20 = emitClient;
|
|
2474
|
+
protoOf(TypeScriptEmitter).qq = emitClientEndpointRequest;
|
|
2475
|
+
protoOf(TypeScriptIrEmitter).v1v = get_extensions;
|
|
2476
|
+
protoOf(TypeScriptIrEmitter).w1v = emit_1;
|
|
2477
|
+
protoOf(TypeScriptIrEmitter).a1w = beforeGenerate;
|
|
2476
2478
|
//endregion
|
|
2477
2479
|
//region block: exports
|
|
2478
2480
|
export {
|