@flock/wirespec 0.20.0-RC.9 → 0.20.2
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 +163 -163
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt-mordant.mjs.map +1 -1
- package/clikt-clikt.mjs +1575 -1575
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +444 -444
- package/kotlin-kotlin-stdlib.mjs +2007 -1954
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10261 -10261
- package/kotlin-rgxgen.mjs +1819 -1819
- package/kotlinx-io-kotlinx-io-core.mjs +440 -440
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1887 -1887
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1577 -1577
- package/mordant-mordant.mjs +1363 -1363
- package/package.json +2 -2
- package/wirespec-src-compiler-core.mjs +1768 -2207
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +381 -1251
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +366 -1065
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +397 -1419
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +405 -403
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +214 -189
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +526 -1406
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +92 -86
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +4116 -4307
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +250 -1120
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +512 -512
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +756 -756
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +1411 -1396
- package/wirespec-src-ide-lsp.mjs.map +1 -1
- package/wirespec-src-plugin-arguments.mjs +185 -245
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +102 -128
- package/wirespec-src-plugin-cli.mjs.map +1 -1
- package/wirespec-src-plugin-npm.d.mts +0 -104
- package/wirespec-src-plugin-npm.mjs +40 -40
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +34 -34
- package/wirespec-src-tools-generator.mjs.map +1 -1
|
@@ -1,1091 +1,189 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
classifyValidatableFields11bv88x0ho39r as classifyValidatableFields,
|
|
170
|
-
convertWithValidation3ar3nbcqsbkpn as convertWithValidation,
|
|
171
|
-
convert11ert2po54h1y as convert_0,
|
|
172
|
-
convert37aabdzvtv9vg as convert_1,
|
|
173
|
-
convert17zcptkz4mhr4 as convert_2,
|
|
174
|
-
convertConstraintkgpvomct0x0s as convertConstraint,
|
|
175
|
-
requestParameters1z8fdizgtviyb as requestParameters,
|
|
176
|
-
convert32tuiui3czihh as convert_3,
|
|
177
|
-
convert1cn4bolzoed8c as convert_4,
|
|
178
|
-
get_extensions31c4or738wbxz as get_extensions,
|
|
179
|
-
emit3bzdcd0f6nwtj as emit_1,
|
|
180
|
-
beforeGenerate3o8idb3hey1b0 as beforeGenerate,
|
|
181
|
-
IrEmitterh2m93ojzvkep as IrEmitter,
|
|
182
|
-
rawttvqxl50flj9 as raw,
|
|
183
|
-
Switch3a1zi3na98deu as Switch,
|
|
184
|
-
Integer1uwg1wvo5lp6z as Integer_0,
|
|
185
|
-
Case2i7oahw4alz6h as Case,
|
|
186
|
-
FieldCall1iz7z2fx2xo4p as FieldCall,
|
|
187
|
-
Parameteruqoxd4rzw7ga as Parameter,
|
|
188
|
-
Function21cuq8qizkin7 as Function,
|
|
189
|
-
Interface3pn84xq686t2r as Interface,
|
|
190
|
-
ErrorStatement1fq19ynue37ia as ErrorStatement,
|
|
191
|
-
BinaryOp35p72iprkxis9 as BinaryOp,
|
|
192
|
-
} from './wirespec-src-compiler-ir.mjs';
|
|
193
|
-
//region block: imports
|
|
194
|
-
var imul = Math.imul;
|
|
195
|
-
//endregion
|
|
196
|
-
//region block: pre-declaration
|
|
197
|
-
function emit_2(identifier) {
|
|
198
|
-
return '"' + identifier.l1() + '"';
|
|
199
|
-
}
|
|
200
|
-
initMetadataForInterface(TypeScriptIdentifierEmitter, 'TypeScriptIdentifierEmitter');
|
|
201
|
-
function sanitizeSymbol(_this__u8e3s4) {
|
|
202
|
-
return this.h1y(_this__u8e3s4.l1());
|
|
203
|
-
}
|
|
204
|
-
function sanitizeSymbol_0(_this__u8e3s4) {
|
|
205
|
-
var tmp = asSequence_0(_this__u8e3s4);
|
|
206
|
-
return joinToString_0(filter(tmp, TypeScriptTypeDefinitionEmitter$sanitizeSymbol$lambda), '');
|
|
207
|
-
}
|
|
208
|
-
function emit_3(type, module_0) {
|
|
209
|
-
// Inline function 'kotlin.collections.distinctBy' call
|
|
210
|
-
var this_0 = importReferences(type);
|
|
211
|
-
var set = HashSet_init_$Create$();
|
|
212
|
-
var list = ArrayList_init_$Create$();
|
|
213
|
-
var _iterator__ex2g4s = this_0.t();
|
|
214
|
-
while (_iterator__ex2g4s.u()) {
|
|
215
|
-
var e = _iterator__ex2g4s.v();
|
|
216
|
-
var key = e.cv_1;
|
|
217
|
-
if (set.x(key)) {
|
|
218
|
-
list.x(e);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
// Inline function 'kotlin.collections.map' call
|
|
222
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
223
|
-
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(list, 10));
|
|
224
|
-
var _iterator__ex2g4s_0 = list.t();
|
|
225
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
226
|
-
var item = _iterator__ex2g4s_0.v();
|
|
227
|
-
var tmp$ret$2 = 'import {' + item.cv_1 + "} from './" + item.cv_1 + "'";
|
|
228
|
-
destination.x(tmp$ret$2);
|
|
229
|
-
}
|
|
230
|
-
var tmp = destination;
|
|
231
|
-
return trimMargin('\n |' + joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda) + '\n |export type ' + this.r21(type.mp_1) + ' = {\n |' + this.mq(type.np_1) + '\n |}\n |\n ');
|
|
232
|
-
}
|
|
233
|
-
function emit_4(_this__u8e3s4) {
|
|
234
|
-
var tmp;
|
|
235
|
-
if (_this__u8e3s4 instanceof Dict) {
|
|
236
|
-
tmp = 'Record<string, ' + this.oq(_this__u8e3s4.so_1) + '>';
|
|
237
|
-
} else {
|
|
238
|
-
if (_this__u8e3s4 instanceof Iterable) {
|
|
239
|
-
tmp = this.oq(_this__u8e3s4.po_1) + '[]';
|
|
240
|
-
} else {
|
|
241
|
-
if (_this__u8e3s4 instanceof Unit) {
|
|
242
|
-
tmp = 'void';
|
|
243
|
-
} else {
|
|
244
|
-
if (_this__u8e3s4 instanceof Any) {
|
|
245
|
-
tmp = 'any';
|
|
246
|
-
} else {
|
|
247
|
-
if (_this__u8e3s4 instanceof Custom) {
|
|
248
|
-
tmp = this.h1y(_this__u8e3s4.cv_1);
|
|
249
|
-
} else {
|
|
250
|
-
if (_this__u8e3s4 instanceof Primitive) {
|
|
251
|
-
tmp = this.s21(_this__u8e3s4);
|
|
252
|
-
} else {
|
|
253
|
-
noWhenBranchMatchedException();
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
// Inline function 'kotlin.let' call
|
|
261
|
-
return tmp + (_this__u8e3s4.uu() ? ' | undefined' : '');
|
|
262
|
-
}
|
|
263
|
-
function emitPrimitive(_this__u8e3s4) {
|
|
264
|
-
var tmp0_subject = _this__u8e3s4.gv_1;
|
|
265
|
-
var tmp;
|
|
266
|
-
if (tmp0_subject instanceof String_0) {
|
|
267
|
-
tmp = 'string';
|
|
268
|
-
} else {
|
|
269
|
-
if (tmp0_subject instanceof Integer) {
|
|
270
|
-
tmp = 'number';
|
|
271
|
-
} else {
|
|
272
|
-
if (tmp0_subject instanceof Number_0) {
|
|
273
|
-
tmp = 'number';
|
|
274
|
-
} else {
|
|
275
|
-
if (tmp0_subject instanceof Boolean_0) {
|
|
276
|
-
tmp = 'boolean';
|
|
277
|
-
} else {
|
|
278
|
-
if (tmp0_subject instanceof Bytes) {
|
|
279
|
-
tmp = 'ArrayBuffer';
|
|
280
|
-
} else {
|
|
281
|
-
noWhenBranchMatchedException();
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
return tmp;
|
|
288
|
-
}
|
|
289
|
-
function emit_5(_this__u8e3s4) {
|
|
290
|
-
var tmp;
|
|
291
|
-
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
292
|
-
tmp = Spacer_instance.toString() + 'return ' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.qt_1) + '.test(value);';
|
|
293
|
-
} else {
|
|
294
|
-
if (_this__u8e3s4 instanceof Bound) {
|
|
295
|
-
var tmp1_safe_receiver = _this__u8e3s4.gu_1;
|
|
296
|
-
var tmp_0;
|
|
297
|
-
if (tmp1_safe_receiver == null) {
|
|
298
|
-
tmp_0 = null;
|
|
299
|
-
} else {
|
|
300
|
-
// Inline function 'kotlin.let' call
|
|
301
|
-
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
302
|
-
}
|
|
303
|
-
var minCheck = tmp_0;
|
|
304
|
-
var tmp2_safe_receiver = _this__u8e3s4.hu_1;
|
|
305
|
-
var tmp_1;
|
|
306
|
-
if (tmp2_safe_receiver == null) {
|
|
307
|
-
tmp_1 = null;
|
|
308
|
-
} else {
|
|
309
|
-
// Inline function 'kotlin.let' call
|
|
310
|
-
tmp_1 = 'value < ' + tmp2_safe_receiver;
|
|
311
|
-
}
|
|
312
|
-
var maxCheck = tmp_1;
|
|
313
|
-
var tmp_2 = Spacer_instance.toString();
|
|
314
|
-
// Inline function 'kotlin.let' call
|
|
315
|
-
// Inline function 'kotlin.text.ifEmpty' call
|
|
316
|
-
var this_0 = joinToString(listOfNotNull([minCheck, maxCheck]), ' && ');
|
|
317
|
-
var tmp_3;
|
|
318
|
-
// Inline function 'kotlin.text.isEmpty' call
|
|
319
|
-
if (charSequenceLength(this_0) === 0) {
|
|
320
|
-
tmp_3 = 'true';
|
|
321
|
-
} else {
|
|
322
|
-
tmp_3 = this_0;
|
|
323
|
-
}
|
|
324
|
-
tmp = tmp_2 + 'return ' + tmp_3 + ';';
|
|
325
|
-
} else {
|
|
326
|
-
noWhenBranchMatchedException();
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
return tmp;
|
|
330
|
-
}
|
|
331
|
-
function emit_6(_this__u8e3s4) {
|
|
332
|
-
return joinToString(_this__u8e3s4.jp_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptTypeDefinitionEmitter$emit$lambda_0(this));
|
|
333
|
-
}
|
|
334
|
-
function emit_7(_this__u8e3s4) {
|
|
335
|
-
return Spacer_instance.toString() + this.or(_this__u8e3s4.rp_1) + ': ' + this.oq(_this__u8e3s4.sp_1);
|
|
336
|
-
}
|
|
337
|
-
initMetadataForInterface(TypeScriptTypeDefinitionEmitter, 'TypeScriptTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, TypeScriptIdentifierEmitter]);
|
|
338
|
-
function emitClient(ast) {
|
|
339
|
-
var tmp = 'client.' + this.vq().er_1;
|
|
340
|
-
var tmp_0 = this.rq(ast);
|
|
341
|
-
var tmp_1 = joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, TypeScriptClientEmitter$emitClient$lambda);
|
|
342
|
-
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
343
|
-
var this_0 = ast.sq_1;
|
|
344
|
-
// Inline function 'kotlin.collections.flatMap' call
|
|
345
|
-
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
346
|
-
// Inline function 'kotlin.collections.flatMapTo' call
|
|
347
|
-
var destination = ArrayList_init_$Create$();
|
|
348
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
349
|
-
while (_iterator__ex2g4s.u()) {
|
|
350
|
-
var element = _iterator__ex2g4s.v();
|
|
351
|
-
var list = new NonEmptyList(element.uq_1);
|
|
352
|
-
addAll(destination, list);
|
|
353
|
-
}
|
|
354
|
-
var tmp$ret$3 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
355
|
-
// Inline function 'kotlin.collections.flatMap' call
|
|
356
|
-
var tmp0_0 = NonEmptyList__toList_impl_t5xcy2(tmp$ret$3);
|
|
357
|
-
// Inline function 'kotlin.collections.flatMapTo' call
|
|
358
|
-
var destination_0 = ArrayList_init_$Create$();
|
|
359
|
-
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
360
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
361
|
-
var element_0 = _iterator__ex2g4s_0.v();
|
|
362
|
-
var list_0 = importReferences(element_0);
|
|
363
|
-
addAll(destination_0, list_0);
|
|
364
|
-
}
|
|
365
|
-
// Inline function 'kotlin.collections.distinctBy' call
|
|
366
|
-
var set = HashSet_init_$Create$();
|
|
367
|
-
var list_1 = ArrayList_init_$Create$();
|
|
368
|
-
var _iterator__ex2g4s_1 = destination_0.t();
|
|
369
|
-
while (_iterator__ex2g4s_1.u()) {
|
|
370
|
-
var e = _iterator__ex2g4s_1.v();
|
|
371
|
-
var key = e.cv_1;
|
|
372
|
-
if (set.x(key)) {
|
|
373
|
-
list_1.x(e);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
var tmp_2 = list_1;
|
|
377
|
-
var tmp_3 = joinToString(tmp_2, '\n', VOID, VOID, VOID, VOID, TypeScriptClientEmitter$emitClient$lambda_0);
|
|
378
|
-
var tmp_4 = this.rq(ast);
|
|
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 '));
|
|
380
|
-
}
|
|
381
|
-
initMetadataForInterface(TypeScriptClientEmitter, 'TypeScriptClientEmitter', VOID, VOID, [ClientEmitter, TypeScriptTypeDefinitionEmitter]);
|
|
382
|
-
function emit_8(enum_0, module_0) {
|
|
383
|
-
var tmp = this.r21(enum_0.yr_1);
|
|
384
|
-
return 'export type ' + tmp + ' = ' + joinToString(enum_0.zr_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEnumDefinitionEmitter$emit$lambda) + '\n';
|
|
385
|
-
}
|
|
386
|
-
initMetadataForInterface(TypeScriptEnumDefinitionEmitter, 'TypeScriptEnumDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
387
|
-
function emit_9(refined) {
|
|
388
|
-
return trimMargin('\n |export type ' + this.r21(refined.tr_1) + ' = ' + this.oq(refined.ur_1) + ';\n |export const validate' + refined.tr_1.l1() + ' = (value: ' + this.oq(refined.ur_1) + '): value is ' + this.r21(refined.tr_1) + ' => {\n |' + this.cs(refined) + '\n |}\n |\n ');
|
|
389
|
-
}
|
|
390
|
-
function emitValidator(_this__u8e3s4) {
|
|
391
|
-
var defaultReturn = Spacer_instance.toString() + 'return true;';
|
|
392
|
-
var type = _this__u8e3s4.ur_1.gv_1;
|
|
393
|
-
var tmp;
|
|
394
|
-
if (type instanceof Integer) {
|
|
395
|
-
var tmp0_safe_receiver = type.lu_1;
|
|
396
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.pq(tmp0_safe_receiver);
|
|
397
|
-
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
398
|
-
} else {
|
|
399
|
-
if (type instanceof Number_0) {
|
|
400
|
-
var tmp2_safe_receiver = type.ou_1;
|
|
401
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.pq(tmp2_safe_receiver);
|
|
402
|
-
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
403
|
-
} else {
|
|
404
|
-
if (type instanceof String_0) {
|
|
405
|
-
var tmp4_safe_receiver = type.iu_1;
|
|
406
|
-
var tmp_0;
|
|
407
|
-
var tmp_1 = tmp4_safe_receiver;
|
|
408
|
-
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
409
|
-
tmp_0 = null;
|
|
410
|
-
} else {
|
|
411
|
-
tmp_0 = this.pq(new RegExp_0(tmp4_safe_receiver));
|
|
412
|
-
}
|
|
413
|
-
var tmp5_elvis_lhs = tmp_0;
|
|
414
|
-
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
415
|
-
} else {
|
|
416
|
-
if (equals(type, Boolean_instance)) {
|
|
417
|
-
tmp = defaultReturn;
|
|
418
|
-
} else {
|
|
419
|
-
if (equals(type, Bytes_instance)) {
|
|
420
|
-
tmp = defaultReturn;
|
|
421
|
-
} else {
|
|
422
|
-
noWhenBranchMatchedException();
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
return tmp;
|
|
429
|
-
}
|
|
430
|
-
initMetadataForInterface(TypeScriptRefinedTypeDefinitionEmitter, 'TypeScriptRefinedTypeDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
431
|
-
function emit_10(endpoint) {
|
|
432
|
-
// Inline function 'kotlin.collections.distinctBy' call
|
|
433
|
-
var this_0 = importReferences(endpoint);
|
|
434
|
-
var set = HashSet_init_$Create$();
|
|
435
|
-
var list = ArrayList_init_$Create$();
|
|
436
|
-
var _iterator__ex2g4s = this_0.t();
|
|
437
|
-
while (_iterator__ex2g4s.u()) {
|
|
438
|
-
var e = _iterator__ex2g4s.v();
|
|
439
|
-
var key = e.cv_1;
|
|
440
|
-
if (set.x(key)) {
|
|
441
|
-
list.x(e);
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
// Inline function 'kotlin.collections.map' call
|
|
445
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
446
|
-
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(list, 10));
|
|
447
|
-
var _iterator__ex2g4s_0 = list.t();
|
|
448
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
449
|
-
var item = _iterator__ex2g4s_0.v();
|
|
450
|
-
var tmp$ret$2 = 'import {type ' + item.cv_1 + "} from '../model'";
|
|
451
|
-
destination.x(tmp$ret$2);
|
|
452
|
-
}
|
|
453
|
-
var tmp = destination;
|
|
454
|
-
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda);
|
|
455
|
-
var tmp_1 = this.r21(endpoint.vp_1);
|
|
456
|
-
var tmp_2 = get_pathParams(endpoint);
|
|
457
|
-
var tmp_3 = emitType(this, tmp_2, 'Path', TypeScriptEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
458
|
-
var tmp_4 = emitType(this, endpoint.yp_1, 'Queries', TypeScriptEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
459
|
-
var tmp_5 = emitType(this, endpoint.zp_1, 'Headers', TypeScriptEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
460
|
-
var tmp_6 = emitType_1(this, first(endpoint.aq_1), endpoint);
|
|
461
|
-
var tmp_7 = distinctByStatus(endpoint.bq_1);
|
|
462
|
-
var tmp_8 = joinToString(tmp_7, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
463
|
-
var tmp_9 = Spacer_instance.toString();
|
|
464
|
-
var tmp_10 = distinctByStatus(endpoint.bq_1);
|
|
465
|
-
var tmp_11 = joinToString(tmp_10, ' | ', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_4(this));
|
|
466
|
-
var tmp_12 = emitFunction_0(this, first(endpoint.aq_1), endpoint);
|
|
467
|
-
var tmp_13 = distinctByStatus(endpoint.bq_1);
|
|
468
|
-
var tmp_14 = joinToString(tmp_13, '\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
469
|
-
var tmp_15 = Spacer_instance.toString();
|
|
470
|
-
var tmp_16 = Spacer_instance.is(2);
|
|
471
|
-
var tmp_17 = emitHandleFunction(this, endpoint);
|
|
472
|
-
var tmp_18 = Spacer_instance.toString();
|
|
473
|
-
var tmp_19 = prependIndent(emitClient_0(this, endpoint), Spacer_instance.is(1));
|
|
474
|
-
var tmp_20 = prependIndent(emitServer(this, endpoint), Spacer_instance.is(1));
|
|
475
|
-
var tmp_21 = Spacer_instance.toString();
|
|
476
|
-
var tmp_22 = Spacer_instance.is(2);
|
|
477
|
-
var tmp_23 = Companion_instance_0.gr(this.r21(endpoint.vp_1));
|
|
478
|
-
var tmp_24 = Spacer_instance.is(2);
|
|
479
|
-
var tmp_25 = Spacer_instance.is(2);
|
|
480
|
-
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.wp_1.a3_1 + '",\n |' + tmp_25 + 'path: "' + joinToString(endpoint.xp_1, '/', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emit$lambda_6(this)) + '",\n |' + Spacer_instance.is(2) + 'server,\n |' + Spacer_instance.is(2) + 'client\n |' + Spacer_instance.toString() + '} as const\n |}\n |\n ');
|
|
481
|
-
}
|
|
482
|
-
initMetadataForInterface(TypeScriptEndpointDefinitionEmitter, 'TypeScriptEndpointDefinitionEmitter', VOID, VOID, [TypeScriptTypeDefinitionEmitter]);
|
|
483
|
-
initMetadataForClass(TypeScriptEmitter, 'TypeScriptEmitter', TypeScriptEmitter, LanguageEmitter, [LanguageEmitter, TypeScriptClientEmitter, TypeScriptEnumDefinitionEmitter, TypeScriptIdentifierEmitter, TypeScriptRefinedTypeDefinitionEmitter, TypeScriptTypeDefinitionEmitter, TypeScriptEndpointDefinitionEmitter]);
|
|
484
|
-
initMetadataForClass(EndpointParam, 'EndpointParam');
|
|
485
|
-
initMetadataForCompanion(Companion);
|
|
486
|
-
initMetadataForClass(TypeScriptIrEmitter, 'TypeScriptIrEmitter', TypeScriptIrEmitter, VOID, [IrEmitter]);
|
|
487
|
-
initMetadataForObject(TypeScriptShared, 'TypeScriptShared');
|
|
488
|
-
//endregion
|
|
489
|
-
function emitClientInterface($this, _this__u8e3s4, endpoint) {
|
|
490
|
-
// Inline function 'kotlin.takeIf' call
|
|
491
|
-
var this_0 = paramList(_this__u8e3s4, endpoint);
|
|
492
|
-
var tmp;
|
|
493
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
494
|
-
if (!this_0.r()) {
|
|
495
|
-
tmp = this_0;
|
|
496
|
-
} else {
|
|
497
|
-
tmp = null;
|
|
498
|
-
}
|
|
499
|
-
var tmp0_safe_receiver = tmp;
|
|
500
|
-
var tmp_0;
|
|
501
|
-
if (tmp0_safe_receiver == null) {
|
|
502
|
-
tmp_0 = null;
|
|
503
|
-
} else {
|
|
504
|
-
tmp_0 = joinToString(tmp0_safe_receiver, ', ', VOID, VOID, VOID, VOID, TypeScriptClientEmitter$emitClientInterface$lambda($this));
|
|
505
|
-
}
|
|
506
|
-
var tmp1_safe_receiver = tmp_0;
|
|
507
|
-
var tmp_1;
|
|
508
|
-
if (tmp1_safe_receiver == null) {
|
|
509
|
-
tmp_1 = null;
|
|
510
|
-
} else {
|
|
511
|
-
// Inline function 'kotlin.let' call
|
|
512
|
-
tmp_1 = 'params: {' + tmp1_safe_receiver + '}';
|
|
513
|
-
}
|
|
514
|
-
// Inline function 'kotlin.text.orEmpty' call
|
|
515
|
-
var tmp0_elvis_lhs = tmp_1;
|
|
516
|
-
return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
517
|
-
}
|
|
518
|
-
function emitFunction($this, endpoint, request) {
|
|
519
|
-
var tmp = endpoint.vp_1.l1();
|
|
520
|
-
var tmp_0 = emitClientInterface($this, request, endpoint);
|
|
521
|
-
var tmp_1 = Spacer_instance.toString();
|
|
522
|
-
var tmp_2 = endpoint.vp_1.l1();
|
|
523
|
-
// Inline function 'kotlin.takeIf' call
|
|
524
|
-
var this_0 = paramList(request, endpoint);
|
|
525
|
-
var tmp_3;
|
|
526
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
527
|
-
if (!this_0.r()) {
|
|
528
|
-
tmp_3 = this_0;
|
|
529
|
-
} else {
|
|
530
|
-
tmp_3 = null;
|
|
531
|
-
}
|
|
532
|
-
var tmp_4;
|
|
533
|
-
if (tmp_3 == null) {
|
|
534
|
-
tmp_4 = null;
|
|
535
|
-
} else {
|
|
536
|
-
// Inline function 'kotlin.let' call
|
|
537
|
-
tmp_4 = 'params';
|
|
538
|
-
}
|
|
539
|
-
// Inline function 'kotlin.text.orEmpty' call
|
|
540
|
-
var tmp0_elvis_lhs = tmp_4;
|
|
541
|
-
var tmp$ret$5 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
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.vp_1.l1() + '.client(serialization).to(req)\n |' + Spacer_instance.toString() + 'const rawResponse = await handler(rawRequest)\n |' + Spacer_instance.toString() + 'return ' + endpoint.vp_1.l1() + '.client(serialization).from(rawResponse)\n |},\n ');
|
|
543
|
-
}
|
|
544
|
-
function TypeScriptClientEmitter$emitClient$lambda(_destruct__k2r9zo) {
|
|
545
|
-
var endpoint = _destruct__k2r9zo.ve();
|
|
546
|
-
return 'import {' + endpoint.vp_1.l1() + '} from "./endpoint/' + endpoint.vp_1.l1() + '"';
|
|
547
|
-
}
|
|
548
|
-
function TypeScriptClientEmitter$emitClient$lambda_0(it) {
|
|
549
|
-
return 'import {type ' + it.cv_1 + '} from "./model/' + it.cv_1 + '"';
|
|
550
|
-
}
|
|
551
|
-
function TypeScriptClientEmitter$emitClient$lambda_1(this$0) {
|
|
552
|
-
return function (_destruct__k2r9zo) {
|
|
553
|
-
var endpoint = _destruct__k2r9zo.ve();
|
|
554
|
-
var request = _destruct__k2r9zo.we();
|
|
555
|
-
return emitFunction(this$0, endpoint, request);
|
|
556
|
-
};
|
|
557
|
-
}
|
|
558
|
-
function TypeScriptClientEmitter$emitClientInterface$lambda(this$0) {
|
|
559
|
-
return function (it) {
|
|
560
|
-
return this$0.or(it.ar_1) + ': ' + this$0.oq(it.br_1);
|
|
561
|
-
};
|
|
562
|
-
}
|
|
563
|
-
function TypeScriptClientEmitter() {
|
|
564
|
-
}
|
|
565
|
-
function TypeScriptEmitter$emit$lambda(it) {
|
|
566
|
-
return 'export {' + it.nr().l1() + "} from './" + it.nr().l1() + "'";
|
|
567
|
-
}
|
|
568
|
-
function TypeScriptEmitter$emit$lambda_0(it) {
|
|
569
|
-
// Inline function 'kotlin.text.trimStart' call
|
|
570
|
-
return toString(trimStart(isCharSequence(it) ? it : THROW_CCE()));
|
|
571
|
-
}
|
|
572
|
-
function TypeScriptEmitter$emit$lambda_1(this$0) {
|
|
573
|
-
return function (it) {
|
|
574
|
-
return this$0.oq(it);
|
|
575
|
-
};
|
|
576
|
-
}
|
|
577
|
-
function TypeScriptEmitter() {
|
|
578
|
-
LanguageEmitter.call(this);
|
|
579
|
-
this.t21_1 = FileExtension_TypeScript_getInstance();
|
|
580
|
-
this.u21_1 = TypeScriptShared_getInstance();
|
|
581
|
-
this.v21_1 = '//';
|
|
582
|
-
}
|
|
583
|
-
protoOf(TypeScriptEmitter).vq = function () {
|
|
584
|
-
return this.t21_1;
|
|
585
|
-
};
|
|
586
|
-
protoOf(TypeScriptEmitter).e1y = function () {
|
|
587
|
-
return this.u21_1;
|
|
588
|
-
};
|
|
589
|
-
protoOf(TypeScriptEmitter).wq = function () {
|
|
590
|
-
return this.v21_1;
|
|
591
|
-
};
|
|
592
|
-
protoOf(TypeScriptEmitter).eo = function (ast, logger) {
|
|
593
|
-
// Inline function 'kotlin.run' call
|
|
594
|
-
var $this$run = protoOf(LanguageEmitter).eo.call(this, ast, logger);
|
|
595
|
-
var tmp;
|
|
596
|
-
if (hasEndpoints(ast)) {
|
|
597
|
-
tmp = NonEmptyList__plus_impl_xqmb9($this$run, this.q21(ast));
|
|
598
|
-
} else {
|
|
599
|
-
tmp = $this$run;
|
|
600
|
-
}
|
|
601
|
-
var tmp_0 = tmp;
|
|
602
|
-
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
603
|
-
var this_0 = ast.sq_1;
|
|
604
|
-
// Inline function 'kotlin.collections.flatMap' call
|
|
605
|
-
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
606
|
-
// Inline function 'kotlin.collections.flatMapTo' call
|
|
607
|
-
var destination = ArrayList_init_$Create$();
|
|
608
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
609
|
-
while (_iterator__ex2g4s.u()) {
|
|
610
|
-
var element = _iterator__ex2g4s.v();
|
|
611
|
-
var list = new NonEmptyList(element.uq_1);
|
|
612
|
-
addAll(destination, list);
|
|
613
|
-
}
|
|
614
|
-
var tmp$ret$5 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
615
|
-
// Inline function 'kotlin.collections.groupBy' call
|
|
616
|
-
var tmp0_0 = new NonEmptyList(tmp$ret$5);
|
|
617
|
-
// Inline function 'kotlin.collections.groupByTo' call
|
|
618
|
-
var destination_0 = LinkedHashMap_init_$Create$();
|
|
619
|
-
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
620
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
621
|
-
var element_0 = _iterator__ex2g4s_0.v();
|
|
622
|
-
var key = namespace(element_0);
|
|
623
|
-
// Inline function 'kotlin.collections.getOrPut' call
|
|
624
|
-
var value = destination_0.p2(key);
|
|
625
|
-
var tmp_1;
|
|
626
|
-
if (value == null) {
|
|
627
|
-
var answer = ArrayList_init_$Create$();
|
|
628
|
-
destination_0.s2(key, answer);
|
|
629
|
-
tmp_1 = answer;
|
|
630
|
-
} else {
|
|
631
|
-
tmp_1 = value;
|
|
632
|
-
}
|
|
633
|
-
var list_0 = tmp_1;
|
|
634
|
-
list_0.x(element_0);
|
|
635
|
-
}
|
|
636
|
-
// Inline function 'kotlin.collections.map' call
|
|
637
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
638
|
-
var destination_1 = ArrayList_init_$Create$_0(destination_0.a1());
|
|
639
|
-
// Inline function 'kotlin.collections.iterator' call
|
|
640
|
-
var _iterator__ex2g4s_1 = destination_0.j1().t();
|
|
641
|
-
while (_iterator__ex2g4s_1.u()) {
|
|
642
|
-
var item = _iterator__ex2g4s_1.v();
|
|
643
|
-
// Inline function 'kotlin.collections.component1' call
|
|
644
|
-
var ns = item.k1();
|
|
645
|
-
// Inline function 'kotlin.collections.component2' call
|
|
646
|
-
var defs = item.l1();
|
|
647
|
-
var tmp_2 = ns + '/index.' + this.vq().er_1;
|
|
648
|
-
var tmp$ret$14 = new Emitted(tmp_2, joinToString(defs, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda));
|
|
649
|
-
destination_1.x(tmp$ret$14);
|
|
650
|
-
}
|
|
651
|
-
return NonEmptyList__plus_impl_xqmb9_0(tmp_0, destination_1);
|
|
652
|
-
};
|
|
653
|
-
protoOf(TypeScriptEmitter).lr = function (module_0, logger) {
|
|
654
|
-
// Inline function 'kotlin.let' call
|
|
655
|
-
var it = protoOf(LanguageEmitter).lr.call(this, module_0, logger);
|
|
656
|
-
return NonEmptyList__plus_impl_xqmb9(it, new Emitted('Wirespec', this.e1y().x21_1));
|
|
657
|
-
};
|
|
658
|
-
protoOf(TypeScriptEmitter).mr = function (definition, module_0, logger) {
|
|
659
|
-
// Inline function 'kotlin.let' call
|
|
660
|
-
var it = protoOf(LanguageEmitter).mr.call(this, definition, module_0, logger);
|
|
661
|
-
var subPackageName = plus(Companion_instance.ds(''), definition);
|
|
662
|
-
return new Emitted(subPackageName.gs() + this.h1y(it.yo_1), trimMargin("\n |import {Wirespec} from '../Wirespec'\n |\n |" + it.zo_1 + '\n '));
|
|
663
|
-
};
|
|
664
|
-
protoOf(TypeScriptEmitter).qr = function (union) {
|
|
665
|
-
// Inline function 'kotlin.collections.distinctBy' call
|
|
666
|
-
var this_0 = importReferences(union);
|
|
667
|
-
var set = HashSet_init_$Create$();
|
|
668
|
-
var list = ArrayList_init_$Create$();
|
|
669
|
-
var _iterator__ex2g4s = this_0.t();
|
|
670
|
-
while (_iterator__ex2g4s.u()) {
|
|
671
|
-
var e = _iterator__ex2g4s.v();
|
|
672
|
-
var key = e.cv_1;
|
|
673
|
-
if (set.x(key)) {
|
|
674
|
-
list.x(e);
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
// Inline function 'kotlin.collections.map' call
|
|
678
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
679
|
-
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(list, 10));
|
|
680
|
-
var _iterator__ex2g4s_0 = list.t();
|
|
681
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
682
|
-
var item = _iterator__ex2g4s_0.v();
|
|
683
|
-
var tmp$ret$2 = 'import {type ' + item.cv_1 + "} from '../model'";
|
|
684
|
-
destination.x(tmp$ret$2);
|
|
685
|
-
}
|
|
686
|
-
var tmp = destination;
|
|
687
|
-
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda_0);
|
|
688
|
-
var tmp_1 = this.r21(union.hp_1);
|
|
689
|
-
return trimMargin('\n |' + tmp_0 + '\n |export type ' + tmp_1 + ' = ' + joinToString(union.ip_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda_1(this)) + '\n |\n ');
|
|
690
|
-
};
|
|
691
|
-
protoOf(TypeScriptEmitter).pr = function (channel) {
|
|
692
|
-
return this.xq();
|
|
693
|
-
};
|
|
694
|
-
function emit_11($this, _this__u8e3s4) {
|
|
695
|
-
var tmp;
|
|
696
|
-
if (_this__u8e3s4 instanceof Literal) {
|
|
697
|
-
tmp = _this__u8e3s4.yq_1;
|
|
698
|
-
} else {
|
|
699
|
-
if (_this__u8e3s4 instanceof Param) {
|
|
700
|
-
tmp = ':' + _this__u8e3s4.cq_1.l1();
|
|
701
|
-
} else {
|
|
702
|
-
noWhenBranchMatchedException();
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
return tmp;
|
|
706
|
-
}
|
|
707
|
-
function emitClient_0($this, _this__u8e3s4) {
|
|
708
|
-
return trimMargin('\n |export const client: Wirespec.Client<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitClientTo($this, _this__u8e3s4), Spacer_instance.is(1)) + ',\n |' + prependIndent(emitClientFrom($this, _this__u8e3s4), Spacer_instance.is(1)) + '\n |})\n ');
|
|
709
|
-
}
|
|
710
|
-
function emitClientTo($this, _this__u8e3s4) {
|
|
711
|
-
var tmp = Spacer_instance.is(1);
|
|
712
|
-
// Inline function 'kotlin.text.uppercase' call
|
|
713
|
-
// Inline function 'kotlin.js.asDynamic' call
|
|
714
|
-
var tmp_0 = _this__u8e3s4.wp_1.a3_1.toUpperCase();
|
|
715
|
-
var tmp_1 = Spacer_instance.is(1);
|
|
716
|
-
var tmp_2 = emitPathArray($this, _this__u8e3s4);
|
|
717
|
-
var tmp_3 = Spacer_instance.is(1);
|
|
718
|
-
var tmp_4 = joinToString(_this__u8e3s4.yp_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientTo$lambda($this));
|
|
719
|
-
var tmp_5 = Spacer_instance.is(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.zp_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientTo$lambda_0($this)) + '},\n |' + Spacer_instance.is(1) + 'body: serialization.serialize(it.body)\n |})\n ');
|
|
721
|
-
}
|
|
722
|
-
function emitClientFrom($this, _this__u8e3s4) {
|
|
723
|
-
var tmp = Spacer_instance.is(1);
|
|
724
|
-
var tmp_0 = distinctByStatus(_this__u8e3s4.bq_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.is(2)) + '\n |' + Spacer_instance.is(2) + 'default:\n |' + Spacer_instance.is(3) + 'throw new Error(`Cannot internalize response with status: ${it.status}`);\n |' + Spacer_instance.is(1) + '}\n |}\n ');
|
|
726
|
-
}
|
|
727
|
-
function emitClientFromResponse($this, _this__u8e3s4) {
|
|
728
|
-
var tmp = fixStatus(_this__u8e3s4.hq_1);
|
|
729
|
-
var tmp_0 = Spacer_instance.is(1);
|
|
730
|
-
var tmp_1 = Spacer_instance.is(2);
|
|
731
|
-
var tmp_2 = fixStatus(_this__u8e3s4.hq_1);
|
|
732
|
-
var tmp_3 = Spacer_instance.is(2);
|
|
733
|
-
return trimMargin('\n |case ' + tmp + ':\n |' + tmp_0 + 'return {\n |' + tmp_1 + 'status: ' + tmp_2 + ',\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.iq_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitClientFromResponse$lambda($this)) + '},\n |' + Spacer_instance.is(2) + 'body: serialization.deserialize<' + emitReference($this, _this__u8e3s4) + '>(it.body)\n |' + Spacer_instance.is(1) + '};\n ');
|
|
734
|
-
}
|
|
735
|
-
function emitServer($this, _this__u8e3s4) {
|
|
736
|
-
return trimMargin('\n |export const server:Wirespec.Server<Request, Response> = (serialization: Wirespec.Serialization) => ({\n |' + prependIndent(emitServerFrom($this, _this__u8e3s4), Spacer_instance.is(1)) + ',\n |' + prependIndent(emitServerTo($this, _this__u8e3s4), Spacer_instance.is(1)) + '\n |})\n ');
|
|
737
|
-
}
|
|
738
|
-
function emitServerFrom($this, _this__u8e3s4) {
|
|
739
|
-
var tmp = Spacer_instance.is(1);
|
|
740
|
-
var tmp_0 = Spacer_instance.is(2);
|
|
741
|
-
// Inline function 'kotlin.text.uppercase' call
|
|
742
|
-
// Inline function 'kotlin.js.asDynamic' call
|
|
743
|
-
var tmp_1 = _this__u8e3s4.wp_1.a3_1.toUpperCase();
|
|
744
|
-
var tmp_2 = Spacer_instance.is(2);
|
|
745
|
-
var tmp_3 = get_indexedPathParams(_this__u8e3s4);
|
|
746
|
-
var tmp_4 = prependIndent(joinToString(tmp_3, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda($this)), Spacer_instance.is(3));
|
|
747
|
-
var tmp_5 = Spacer_instance.is(2);
|
|
748
|
-
var tmp_6 = Spacer_instance.is(2);
|
|
749
|
-
var tmp_7 = joinToString(_this__u8e3s4.yp_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_0($this));
|
|
750
|
-
var tmp_8 = Spacer_instance.is(2);
|
|
751
|
-
var tmp_9 = Spacer_instance.is(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.zp_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_1($this)) + '\n |' + Spacer_instance.is(2) + '},\n |' + Spacer_instance.is(2) + 'body: serialization.deserialize(it.body)\n |' + Spacer_instance.is(1) + '}\n |}\n ');
|
|
753
|
-
}
|
|
754
|
-
function emitServerTo($this, _this__u8e3s4) {
|
|
755
|
-
var tmp = Spacer_instance.is(1);
|
|
756
|
-
var tmp_0 = distinctByStatus(_this__u8e3s4.bq_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.is(2)) + '\n |' + Spacer_instance.is(1) + '}\n |}\n ');
|
|
758
|
-
}
|
|
759
|
-
function emitServerToResponse($this, _this__u8e3s4) {
|
|
760
|
-
var tmp = fixStatus(_this__u8e3s4.hq_1);
|
|
761
|
-
var tmp_0 = Spacer_instance.is(1);
|
|
762
|
-
var tmp_1 = Spacer_instance.is(2);
|
|
763
|
-
var tmp_2 = fixStatus(_this__u8e3s4.hq_1);
|
|
764
|
-
var tmp_3 = Spacer_instance.is(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.iq_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitServerToResponse$lambda($this)), Spacer_instance.is(3)) + '\n |' + Spacer_instance.is(2) + '} as Record<string, string>,\n |' + Spacer_instance.is(2) + 'body: serialization.serialize(it.body),\n |' + Spacer_instance.is(1) + '};\n ');
|
|
766
|
-
}
|
|
767
|
-
function emitType($this, _this__u8e3s4, name, block) {
|
|
768
|
-
var tmp;
|
|
769
|
-
if (_this__u8e3s4.r()) {
|
|
770
|
-
tmp = Spacer_instance.toString() + 'type ' + name + ' = {}';
|
|
771
|
-
} else {
|
|
772
|
-
var tmp_0 = Spacer_instance.toString();
|
|
773
|
-
tmp = trimMargin('\n |' + tmp_0 + 'type ' + name + ' = {\n |' + joinToString(_this__u8e3s4, ',\n', VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitType$lambda(block)) + ',\n |' + Spacer_instance.toString() + '}\n ');
|
|
774
|
-
}
|
|
775
|
-
return tmp;
|
|
776
|
-
}
|
|
777
|
-
function emitName($this, _this__u8e3s4) {
|
|
778
|
-
return 'Response' + Companion_instance_0.fr(_this__u8e3s4.hq_1);
|
|
779
|
-
}
|
|
780
|
-
function emitFunction_0($this, _this__u8e3s4, endpoint) {
|
|
781
|
-
var tmp = Spacer_instance.toString();
|
|
782
|
-
var tmp_0 = paramList(_this__u8e3s4, endpoint);
|
|
783
|
-
var tmp_1 = joinToObject($this, tmp_0, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda($this));
|
|
784
|
-
var tmp_2 = Spacer_instance.toString();
|
|
785
|
-
// Inline function 'kotlin.takeIf' call
|
|
786
|
-
var this_0 = paramList(_this__u8e3s4, endpoint);
|
|
787
|
-
var tmp_3;
|
|
788
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
789
|
-
if (!this_0.r()) {
|
|
790
|
-
tmp_3 = this_0;
|
|
791
|
-
} else {
|
|
792
|
-
tmp_3 = null;
|
|
793
|
-
}
|
|
794
|
-
var tmp_4;
|
|
795
|
-
if (tmp_3 == null) {
|
|
796
|
-
tmp_4 = null;
|
|
797
|
-
} else {
|
|
798
|
-
// Inline function 'kotlin.run' call
|
|
799
|
-
tmp_4 = 'params: RequestParams';
|
|
800
|
-
}
|
|
801
|
-
// Inline function 'kotlin.text.orEmpty' call
|
|
802
|
-
var tmp0_elvis_lhs = tmp_4;
|
|
803
|
-
var tmp_5 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
804
|
-
var tmp_6 = Spacer_instance.is(2);
|
|
805
|
-
var tmp_7 = get_pathParams(endpoint);
|
|
806
|
-
var tmp_8 = joinToObject($this, tmp_7, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_0($this));
|
|
807
|
-
var tmp_9 = Spacer_instance.is(2);
|
|
808
|
-
var tmp_10 = endpoint.wp_1.toString();
|
|
809
|
-
var tmp_11 = Spacer_instance.is(2);
|
|
810
|
-
var tmp_12 = joinToObject($this, endpoint.yp_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_1($this));
|
|
811
|
-
var tmp_13 = Spacer_instance.is(2);
|
|
812
|
-
var tmp_14 = joinToObject($this, endpoint.zp_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_2($this));
|
|
813
|
-
var tmp_15 = Spacer_instance.is(2);
|
|
814
|
-
var tmp_16;
|
|
815
|
-
if (_this__u8e3s4.eq_1 == null) {
|
|
816
|
-
tmp_16 = null;
|
|
817
|
-
} else {
|
|
818
|
-
// Inline function 'kotlin.let' call
|
|
819
|
-
tmp_16 = 'params.body';
|
|
820
|
-
}
|
|
821
|
-
var tmp2_elvis_lhs = tmp_16;
|
|
822
|
-
return trimMargin('\n |' + tmp + 'export type RequestParams = ' + tmp_1 + '\n |' + tmp_2 + 'export const request = (' + tmp_5 + '): Request => ({\n |' + tmp_6 + 'path: ' + tmp_8 + ',\n |' + tmp_9 + 'method: "' + tmp_10 + '",\n |' + tmp_11 + 'queries: ' + tmp_12 + ',\n |' + tmp_13 + 'headers: ' + tmp_14 + ',\n |' + tmp_15 + 'body: ' + (tmp2_elvis_lhs == null ? 'undefined' : tmp2_elvis_lhs) + ',\n |' + Spacer_instance.toString() + '})\n ');
|
|
823
|
-
}
|
|
824
|
-
function emitFunction_1($this, _this__u8e3s4) {
|
|
825
|
-
var tmp = Spacer_instance.toString();
|
|
826
|
-
var tmp_0 = Companion_instance_0.fr(_this__u8e3s4.hq_1);
|
|
827
|
-
var tmp_1 = paramList_0(_this__u8e3s4);
|
|
828
|
-
var tmp_2 = joinToObject($this, tmp_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3($this));
|
|
829
|
-
var tmp_3 = Spacer_instance.toString();
|
|
830
|
-
var tmp_4 = Companion_instance_0.fr(_this__u8e3s4.hq_1);
|
|
831
|
-
// Inline function 'kotlin.takeIf' call
|
|
832
|
-
var this_0 = paramList_0(_this__u8e3s4);
|
|
833
|
-
var tmp_5;
|
|
834
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
835
|
-
if (!this_0.r()) {
|
|
836
|
-
tmp_5 = this_0;
|
|
837
|
-
} else {
|
|
838
|
-
tmp_5 = null;
|
|
839
|
-
}
|
|
840
|
-
var tmp_6;
|
|
841
|
-
if (tmp_5 == null) {
|
|
842
|
-
tmp_6 = null;
|
|
843
|
-
} else {
|
|
844
|
-
// Inline function 'kotlin.run' call
|
|
845
|
-
tmp_6 = 'params: Response' + Companion_instance_0.fr(_this__u8e3s4.hq_1) + 'Params';
|
|
846
|
-
}
|
|
847
|
-
// Inline function 'kotlin.text.orEmpty' call
|
|
848
|
-
var tmp0_elvis_lhs = tmp_6;
|
|
849
|
-
var tmp_7 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
850
|
-
var tmp_8 = Companion_instance_0.fr(_this__u8e3s4.hq_1);
|
|
851
|
-
var tmp_9 = Spacer_instance.is(2);
|
|
852
|
-
var tmp_10 = fixStatus(_this__u8e3s4.hq_1);
|
|
853
|
-
var tmp_11 = Spacer_instance.is(2);
|
|
854
|
-
var tmp_12 = joinToObject($this, _this__u8e3s4.iq_1, TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_4($this));
|
|
855
|
-
var tmp_13 = Spacer_instance.is(2);
|
|
856
|
-
var tmp_14;
|
|
857
|
-
if (_this__u8e3s4.jq_1 == null) {
|
|
858
|
-
tmp_14 = null;
|
|
859
|
-
} else {
|
|
860
|
-
// Inline function 'kotlin.let' call
|
|
861
|
-
tmp_14 = 'params.body';
|
|
862
|
-
}
|
|
863
|
-
var tmp2_elvis_lhs = tmp_14;
|
|
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 ');
|
|
865
|
-
}
|
|
866
|
-
function emitReference($this, _this__u8e3s4) {
|
|
867
|
-
var tmp0_safe_receiver = _this__u8e3s4.jq_1;
|
|
868
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.gq_1;
|
|
869
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.oq(tmp1_safe_receiver);
|
|
870
|
-
return tmp2_elvis_lhs == null ? 'undefined' : tmp2_elvis_lhs;
|
|
871
|
-
}
|
|
872
|
-
function emitPathArray($this, _this__u8e3s4) {
|
|
873
|
-
return joinToString(_this__u8e3s4.xp_1, ', ', '[', ']', VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda($this));
|
|
874
|
-
}
|
|
875
|
-
function emitType_0($this, _this__u8e3s4) {
|
|
876
|
-
var tmp = Spacer_instance.toString();
|
|
877
|
-
var tmp_0 = emitName($this, _this__u8e3s4);
|
|
878
|
-
var tmp_1 = Spacer_instance.is(2);
|
|
879
|
-
var tmp_2 = fixStatus(_this__u8e3s4.hq_1);
|
|
880
|
-
var tmp_3 = Spacer_instance.is(2);
|
|
881
|
-
return trimMargin('\n |' + tmp + 'export type ' + tmp_0 + ' = {\n |' + tmp_1 + 'status: ' + tmp_2 + '\n |' + tmp_3 + 'headers: {' + joinToString(_this__u8e3s4.iq_1, VOID, VOID, VOID, VOID, VOID, TypeScriptEndpointDefinitionEmitter$emitType$lambda_0($this)) + '}\n |' + Spacer_instance.is(2) + 'body: ' + emitReference($this, _this__u8e3s4) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
882
|
-
}
|
|
883
|
-
function emitReference_0($this, _this__u8e3s4) {
|
|
884
|
-
var tmp0_safe_receiver = _this__u8e3s4.eq_1;
|
|
885
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.gq_1;
|
|
886
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.oq(tmp1_safe_receiver);
|
|
887
|
-
return tmp2_elvis_lhs == null ? 'undefined' : tmp2_elvis_lhs;
|
|
888
|
-
}
|
|
889
|
-
function emitType_1($this, _this__u8e3s4, endpoint) {
|
|
890
|
-
return trimMargin('\n |' + Spacer_instance.toString() + 'export type Request = {\n |' + Spacer_instance.is(2) + 'path: Path\n |' + Spacer_instance.is(2) + 'method: "' + endpoint.wp_1.toString() + '"\n |' + Spacer_instance.is(2) + 'queries: Queries\n |' + Spacer_instance.is(2) + 'headers: Headers\n |' + Spacer_instance.is(2) + 'body: ' + emitReference_0($this, _this__u8e3s4) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
891
|
-
}
|
|
892
|
-
function emit_12($this, _this__u8e3s4) {
|
|
893
|
-
return Spacer_instance.toString() + $this.or(_this__u8e3s4.cq_1) + ': ' + $this.oq(_this__u8e3s4.dq_1);
|
|
894
|
-
}
|
|
895
|
-
function emit_13($this, _this__u8e3s4) {
|
|
896
|
-
return $this.or(_this__u8e3s4.ar_1) + (_this__u8e3s4.br_1.uu() ? '?' : '') + ': ' + $this.oq(_this__u8e3s4.br_1.wu(false));
|
|
897
|
-
}
|
|
898
|
-
function emitDeserialize($this, _this__u8e3s4) {
|
|
899
|
-
return $this.or(_this__u8e3s4.ue_1.cq_1) + ': serialization.deserialize(it.path[' + _this__u8e3s4.te_1 + '])';
|
|
900
|
-
}
|
|
901
|
-
function emitDeserialize_0($this, _this__u8e3s4, fields, caseSensitive) {
|
|
902
|
-
return caseSensitive ? $this.or(_this__u8e3s4.rp_1) + ': serialization.deserialize(it.' + fields + '[' + $this.or(_this__u8e3s4.rp_1) + '])' : $this.or(_this__u8e3s4.rp_1) + ': serialization.deserialize(Object.entries(it.' + fields + ').find(([key]) => key.toLowerCase() === ' + $this.or(lowercase($this, _this__u8e3s4.rp_1)) + ')?.[1])';
|
|
903
|
-
}
|
|
904
|
-
function emitDeserialize$default($this, _this__u8e3s4, fields, caseSensitive, $super) {
|
|
905
|
-
caseSensitive = caseSensitive === VOID ? true : caseSensitive;
|
|
906
|
-
return emitDeserialize_0($this, _this__u8e3s4, fields, caseSensitive);
|
|
907
|
-
}
|
|
908
|
-
function emitSerialize($this, _this__u8e3s4, fields) {
|
|
909
|
-
return $this.or(_this__u8e3s4.rp_1) + ': serialization.serialize(it.' + fields + '[' + $this.or(_this__u8e3s4.rp_1) + '])';
|
|
910
|
-
}
|
|
911
|
-
function joinToObject($this, _this__u8e3s4, transform) {
|
|
912
|
-
return joinToString(_this__u8e3s4, ', ', '{', '}', VOID, VOID, transform);
|
|
913
|
-
}
|
|
914
|
-
function emitHandleFunction($this, endpoint) {
|
|
915
|
-
return Companion_instance_0.gr($this.r21(endpoint.vp_1)) + ': (request:Request) => Promise<Response>';
|
|
916
|
-
}
|
|
917
|
-
function lowercase($this, _this__u8e3s4) {
|
|
918
|
-
// Inline function 'kotlin.text.lowercase' call
|
|
919
|
-
// Inline function 'kotlin.js.asDynamic' call
|
|
920
|
-
var tmp$ret$1 = _this__u8e3s4.l1().toLowerCase();
|
|
921
|
-
return new FieldIdentifier(tmp$ret$1);
|
|
922
|
-
}
|
|
923
|
-
function TypeScriptEndpointDefinitionEmitter$emit$lambda(it) {
|
|
924
|
-
// Inline function 'kotlin.text.trimStart' call
|
|
925
|
-
return toString(trimStart(isCharSequence(it) ? it : THROW_CCE()));
|
|
926
|
-
}
|
|
927
|
-
function TypeScriptEndpointDefinitionEmitter$emit$lambda_0(this$0) {
|
|
928
|
-
return function (it) {
|
|
929
|
-
return emit_12(this$0, it);
|
|
930
|
-
};
|
|
931
|
-
}
|
|
932
|
-
function TypeScriptEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
933
|
-
return function (it) {
|
|
934
|
-
return this$0.nq(it);
|
|
935
|
-
};
|
|
936
|
-
}
|
|
937
|
-
function TypeScriptEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
938
|
-
return function (it) {
|
|
939
|
-
return this$0.nq(it);
|
|
940
|
-
};
|
|
941
|
-
}
|
|
942
|
-
function TypeScriptEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
943
|
-
return function (it) {
|
|
944
|
-
return emitType_0(this$0, it);
|
|
945
|
-
};
|
|
946
|
-
}
|
|
947
|
-
function TypeScriptEndpointDefinitionEmitter$emit$lambda_4(this$0) {
|
|
948
|
-
return function (it) {
|
|
949
|
-
return emitName(this$0, it);
|
|
950
|
-
};
|
|
951
|
-
}
|
|
952
|
-
function TypeScriptEndpointDefinitionEmitter$emit$lambda_5(this$0) {
|
|
953
|
-
return function (it) {
|
|
954
|
-
return emitFunction_1(this$0, it);
|
|
955
|
-
};
|
|
956
|
-
}
|
|
957
|
-
function TypeScriptEndpointDefinitionEmitter$emit$lambda_6(this$0) {
|
|
958
|
-
return function (it) {
|
|
959
|
-
return emit_11(this$0, it);
|
|
960
|
-
};
|
|
961
|
-
}
|
|
962
|
-
function TypeScriptEndpointDefinitionEmitter$emitClientTo$lambda(this$0) {
|
|
963
|
-
return function (it) {
|
|
964
|
-
return emitSerialize(this$0, it, 'queries');
|
|
965
|
-
};
|
|
966
|
-
}
|
|
967
|
-
function TypeScriptEndpointDefinitionEmitter$emitClientTo$lambda_0(this$0) {
|
|
968
|
-
return function (it) {
|
|
969
|
-
return emitSerialize(this$0, it, 'headers');
|
|
970
|
-
};
|
|
971
|
-
}
|
|
972
|
-
function TypeScriptEndpointDefinitionEmitter$emitClientFrom$lambda(this$0) {
|
|
973
|
-
return function (it) {
|
|
974
|
-
return emitClientFromResponse(this$0, it);
|
|
975
|
-
};
|
|
976
|
-
}
|
|
977
|
-
function TypeScriptEndpointDefinitionEmitter$emitClientFromResponse$lambda(this$0) {
|
|
978
|
-
return function (it) {
|
|
979
|
-
return emitDeserialize_0(this$0, it, 'headers', false);
|
|
980
|
-
};
|
|
981
|
-
}
|
|
982
|
-
function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda(this$0) {
|
|
983
|
-
return function (it) {
|
|
984
|
-
return emitDeserialize(this$0, it);
|
|
985
|
-
};
|
|
986
|
-
}
|
|
987
|
-
function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_0(this$0) {
|
|
988
|
-
return function (it) {
|
|
989
|
-
return prependIndent(emitDeserialize$default(this$0, it, 'queries'), Spacer_instance.is(3));
|
|
990
|
-
};
|
|
991
|
-
}
|
|
992
|
-
function TypeScriptEndpointDefinitionEmitter$emitServerFrom$lambda_1(this$0) {
|
|
993
|
-
return function (it) {
|
|
994
|
-
return prependIndent(emitDeserialize_0(this$0, it, 'headers', false), Spacer_instance.is(3));
|
|
995
|
-
};
|
|
996
|
-
}
|
|
997
|
-
function TypeScriptEndpointDefinitionEmitter$emitServerTo$lambda(this$0) {
|
|
998
|
-
return function (it) {
|
|
999
|
-
return emitServerToResponse(this$0, it);
|
|
1000
|
-
};
|
|
1001
|
-
}
|
|
1002
|
-
function TypeScriptEndpointDefinitionEmitter$emitServerToResponse$lambda(this$0) {
|
|
1003
|
-
return function (it) {
|
|
1004
|
-
return emitSerialize(this$0, it, 'headers');
|
|
1005
|
-
};
|
|
1006
|
-
}
|
|
1007
|
-
function TypeScriptEndpointDefinitionEmitter$emitType$lambda($block) {
|
|
1008
|
-
return function (it) {
|
|
1009
|
-
return Spacer_instance.is(1) + $block(it);
|
|
1010
|
-
};
|
|
1011
|
-
}
|
|
1012
|
-
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda(this$0) {
|
|
1013
|
-
return function (it) {
|
|
1014
|
-
return emit_13(this$0, it);
|
|
1015
|
-
};
|
|
1016
|
-
}
|
|
1017
|
-
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_0(this$0) {
|
|
1018
|
-
return function (it) {
|
|
1019
|
-
return this$0.or(it.cq_1) + ': params[' + this$0.or(it.cq_1) + ']';
|
|
1020
|
-
};
|
|
1021
|
-
}
|
|
1022
|
-
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_1(this$0) {
|
|
1023
|
-
return function (it) {
|
|
1024
|
-
return this$0.or(it.rp_1) + ': params[' + this$0.or(it.rp_1) + ']';
|
|
1025
|
-
};
|
|
1026
|
-
}
|
|
1027
|
-
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_2(this$0) {
|
|
1028
|
-
return function (it) {
|
|
1029
|
-
return this$0.or(it.rp_1) + ': params[' + this$0.or(it.rp_1) + ']';
|
|
1030
|
-
};
|
|
1031
|
-
}
|
|
1032
|
-
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_3(this$0) {
|
|
1033
|
-
return function (it) {
|
|
1034
|
-
return emit_13(this$0, it);
|
|
1035
|
-
};
|
|
1036
|
-
}
|
|
1037
|
-
function TypeScriptEndpointDefinitionEmitter$emitFunction$lambda_4(this$0) {
|
|
1038
|
-
return function (it) {
|
|
1039
|
-
return this$0.or(it.rp_1) + ': params[' + this$0.or(it.rp_1) + ']';
|
|
1040
|
-
};
|
|
1041
|
-
}
|
|
1042
|
-
function TypeScriptEndpointDefinitionEmitter$emitPathArray$lambda(this$0) {
|
|
1043
|
-
return function (it) {
|
|
1044
|
-
var tmp;
|
|
1045
|
-
if (it instanceof Literal) {
|
|
1046
|
-
tmp = '"' + it.yq_1 + '"';
|
|
1047
|
-
} else {
|
|
1048
|
-
if (it instanceof Param) {
|
|
1049
|
-
tmp = 'serialization.serialize(it.path[' + this$0.or(it.cq_1) + '])';
|
|
1050
|
-
} else {
|
|
1051
|
-
noWhenBranchMatchedException();
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
return tmp;
|
|
1055
|
-
};
|
|
1056
|
-
}
|
|
1057
|
-
function TypeScriptEndpointDefinitionEmitter$emitType$lambda_0(this$0) {
|
|
1058
|
-
return function (it) {
|
|
1059
|
-
return this$0.or(it.rp_1) + ': ' + this$0.oq(it.sp_1);
|
|
1060
|
-
};
|
|
1061
|
-
}
|
|
1062
|
-
function TypeScriptEndpointDefinitionEmitter() {
|
|
1063
|
-
}
|
|
1064
|
-
function TypeScriptEnumDefinitionEmitter$emit$lambda(it) {
|
|
1065
|
-
return '"' + it + '"';
|
|
1066
|
-
}
|
|
1067
|
-
function TypeScriptEnumDefinitionEmitter() {
|
|
1068
|
-
}
|
|
1069
|
-
function TypeScriptIdentifierEmitter() {
|
|
1070
|
-
}
|
|
2
|
+
KProperty1ca4yb4wlo496 as KProperty1,
|
|
3
|
+
getPropertyCallableRef3hckxc0xueiaj as getPropertyCallableRef,
|
|
4
|
+
StringBuilder_init_$Create$322n630qt3r8c as StringBuilder_init_$Create$,
|
|
5
|
+
charSequenceLength3278n89t01tmv as charSequenceLength,
|
|
6
|
+
charSequenceGet1vxk1y5n17t1z as charSequenceGet,
|
|
7
|
+
isLetterOrDigit2kuxd9e198haf as isLetterOrDigit,
|
|
8
|
+
_Char___init__impl__6a9atx1csff5kwtduxl as _Char___init__impl__6a9atx,
|
|
9
|
+
Unit_instance28fytmsmm6r23 as Unit_instance,
|
|
10
|
+
charCodeAt1yspne1d8erbm as charCodeAt,
|
|
11
|
+
toString3dhdjl9yf50de as toString,
|
|
12
|
+
toString1pkumu07cwy4m as toString_0,
|
|
13
|
+
substring3saq8ornu0luv as substring,
|
|
14
|
+
Regex_init_$Create$9xrx4twz2i6q as Regex_init_$Create$,
|
|
15
|
+
ArrayList_init_$Create$1jemgvhi5v0js as ArrayList_init_$Create$,
|
|
16
|
+
first58ocm7j58k3q as first,
|
|
17
|
+
noWhenBranchMatchedException2a6r7ubxgky5j as noWhenBranchMatchedException,
|
|
18
|
+
protoOf180f3jzyo7rfj as protoOf,
|
|
19
|
+
getStringHashCode26igk1bx568vk as getStringHashCode,
|
|
20
|
+
getBooleanHashCode1bbj3u6b3v0a7 as getBooleanHashCode,
|
|
21
|
+
initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
|
|
22
|
+
listOf1jh22dvmctj1r as listOf,
|
|
23
|
+
collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
|
|
24
|
+
mapCapacity1h45rc3eh9p2l as mapCapacity,
|
|
25
|
+
coerceAtLeast2bkz8m9ik7hep as coerceAtLeast,
|
|
26
|
+
LinkedHashMap_init_$Create$1s75e1k23v4xj as LinkedHashMap_init_$Create$,
|
|
27
|
+
removePrefix279df90bhrqqg as removePrefix,
|
|
28
|
+
initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
|
|
29
|
+
listOfvhqybd2zx248 as listOf_0,
|
|
30
|
+
ArrayList_init_$Create$3ivpeip4ouddx as ArrayList_init_$Create$_0,
|
|
31
|
+
to2cs3ny02qtbcb as to,
|
|
32
|
+
toMap1vec9topfei08 as toMap,
|
|
33
|
+
VOID3gxj6tk5isa35 as VOID,
|
|
34
|
+
emptyList1g2z5xcrvp2zy as emptyList,
|
|
35
|
+
plus310ted5e4i90h as plus,
|
|
36
|
+
THROW_CCE2g6jy02ryeudk as THROW_CCE,
|
|
37
|
+
equals2au1ep9vhcato as equals,
|
|
38
|
+
mapOf2zpbbmyqk8xpf as mapOf,
|
|
39
|
+
plus2m1vv33moko5t as plus_0,
|
|
40
|
+
startsWith26w8qjqapeeq6 as startsWith,
|
|
41
|
+
substringBefore3n7kj60w69hju as substringBefore,
|
|
42
|
+
endsWith3cq61xxngobwh as endsWith,
|
|
43
|
+
isInterface3d6p8outrmvmk as isInterface,
|
|
44
|
+
lazy2hsh8ze7j6ikd as lazy,
|
|
45
|
+
addAll1k27qatfgp3k5 as addAll,
|
|
46
|
+
LinkedHashMap_init_$Create$3t495nfs82xn as LinkedHashMap_init_$Create$_0,
|
|
47
|
+
joinToString1cxrrlmo0chqs as joinToString,
|
|
48
|
+
asSequence2phdjljfh9jhx as asSequence,
|
|
49
|
+
filterNot56uwv8hfomaa as filterNot,
|
|
50
|
+
mapsbvh18eqox7a as map,
|
|
51
|
+
distinct17vua5ffe1cfv as distinct,
|
|
52
|
+
toListx6x8nvfmvvht as toList,
|
|
53
|
+
LinkedHashSet_init_$Create$2lru2gvxodydo as LinkedHashSet_init_$Create$,
|
|
54
|
+
distinct10qe1scfdvu5k as distinct_0,
|
|
55
|
+
HashSet_init_$Create$33p49hmosnvr4 as HashSet_init_$Create$,
|
|
56
|
+
toSet2orjxp16sotqu as toSet,
|
|
57
|
+
trimMarginhyd3fsmh8iev as trimMargin,
|
|
58
|
+
Collection1k04j3hzsbod0 as Collection,
|
|
59
|
+
substringAfterLastuw9v7gfiiihe as substringAfterLast,
|
|
60
|
+
toIntOrNull3w2d066r9pvwm as toIntOrNull,
|
|
61
|
+
ensureNotNull1e947j3ixpazm as ensureNotNull,
|
|
62
|
+
charArrayOf27f4r3dozbrk1 as charArrayOf,
|
|
63
|
+
trimEndvvzjdhan75g as trimEnd,
|
|
64
|
+
} from './kotlin-kotlin-stdlib.mjs';
|
|
65
|
+
import {
|
|
66
|
+
Nameoqr8dt2fim9d as Name,
|
|
67
|
+
TypeScriptGenerator_getInstance3w0ea8m4h2slw as TypeScriptGenerator_getInstance,
|
|
68
|
+
transformChildren2mszeagj5nq4c as transformChildren,
|
|
69
|
+
sanitizeFieldName1ptgy1kxy8u2m as sanitizeFieldName,
|
|
70
|
+
Assignment3kcxc8wlcbmkn as Assignment,
|
|
71
|
+
ConstructorStatement1x4n4sr59iy4n as ConstructorStatement,
|
|
72
|
+
VariableReference2vlynnhaw1i64 as VariableReference,
|
|
73
|
+
SanitizationConfig11mmn3p2c03c1 as SanitizationConfig,
|
|
74
|
+
RawElement2yts1x2rbem1g as RawElement,
|
|
75
|
+
Companion_getInstance3gvtuyxc9uhxj as Companion_getInstance,
|
|
76
|
+
Mainb4yvz4x0nrxd as Main,
|
|
77
|
+
Enumlszg09mwd24f as Enum,
|
|
78
|
+
Interface3pn84xq686t2r as Interface,
|
|
79
|
+
Namespace345pal554qu3j as Namespace,
|
|
80
|
+
Struct39wf79cwtn4ty as Struct,
|
|
81
|
+
File3dimy4iqmuock as File,
|
|
82
|
+
transformChildrend9p91tpcqdkx as transformChildren_0,
|
|
83
|
+
StringLiteral3ffeojfhsbsmg as StringLiteral,
|
|
84
|
+
Field354s1ceh5pvhf as Field,
|
|
85
|
+
RawExpression2bo7ldfrptjia as RawExpression,
|
|
86
|
+
FunctionCall30872kpnbr7op as FunctionCall,
|
|
87
|
+
transformChildren3n5cjwmxlhwx9 as transformChildren_1,
|
|
88
|
+
Custom_init_$Create$2enn7oyj71j1t as Custom_init_$Create$,
|
|
89
|
+
Custom2si7lto3wompr as Custom,
|
|
90
|
+
String_instance3uxvo48ki208u as String_instance,
|
|
91
|
+
Literal50s1y3607cdv as Literal,
|
|
92
|
+
TransformScopeyrd3lf4zrk76 as TransformScope,
|
|
93
|
+
TransformerBuildera6a1gvlhjj9b as TransformerBuilder,
|
|
94
|
+
transform3eti8i2bqvifx as transform,
|
|
95
|
+
Elementitq62jg6fid3 as Element,
|
|
96
|
+
convertnty9x0e63d0u as convert,
|
|
97
|
+
emit1oxjujel6f3jb as emit,
|
|
98
|
+
emitn3eihixilqyh as emit_0,
|
|
99
|
+
import5uhkz67bd8tt as import_0,
|
|
100
|
+
convertToGenerator2wzjrmaavxhph as convertToGenerator,
|
|
101
|
+
convertToGeneratorkggw47cqose7 as convertToGenerator_0,
|
|
102
|
+
convertToGenerator3rjr3azp4vdsx as convertToGenerator_1,
|
|
103
|
+
convertToGenerator2msmr3acdd5nx as convertToGenerator_2,
|
|
104
|
+
sanitizeNames2wqmyf8vafp9x as sanitizeNames,
|
|
105
|
+
collectCustomTypeNames373f3lwl9sqd5 as collectCustomTypeNames,
|
|
106
|
+
classifyValidatableFields11bv88x0ho39r as classifyValidatableFields,
|
|
107
|
+
convertWithValidation3ar3nbcqsbkpn as convertWithValidation,
|
|
108
|
+
convert11ert2po54h1y as convert_0,
|
|
109
|
+
convert37aabdzvtv9vg as convert_1,
|
|
110
|
+
convert17zcptkz4mhr4 as convert_2,
|
|
111
|
+
convertConstraintkgpvomct0x0s as convertConstraint,
|
|
112
|
+
requestParameters1z8fdizgtviyb as requestParameters,
|
|
113
|
+
convert32tuiui3czihh as convert_3,
|
|
114
|
+
convert1cn4bolzoed8c as convert_4,
|
|
115
|
+
get_extensions31c4or738wbxz as get_extensions,
|
|
116
|
+
emit3bzdcd0f6nwtj as emit_1,
|
|
117
|
+
beforeGenerate3o8idb3hey1b0 as beforeGenerate,
|
|
118
|
+
IrEmitterh2m93ojzvkep as IrEmitter,
|
|
119
|
+
rawttvqxl50flj9 as raw,
|
|
120
|
+
Switch3a1zi3na98deu as Switch,
|
|
121
|
+
Integer1uwg1wvo5lp6z as Integer,
|
|
122
|
+
Case2i7oahw4alz6h as Case,
|
|
123
|
+
FieldCall1iz7z2fx2xo4p as FieldCall,
|
|
124
|
+
Parameteruqoxd4rzw7ga as Parameter,
|
|
125
|
+
Function21cuq8qizkin7 as Function,
|
|
126
|
+
ErrorStatement1fq19ynue37ia as ErrorStatement,
|
|
127
|
+
BinaryOp35p72iprkxis9 as BinaryOp,
|
|
128
|
+
} from './wirespec-src-compiler-ir.mjs';
|
|
129
|
+
import {
|
|
130
|
+
Paramvfwnys2w6aj1 as Param,
|
|
131
|
+
Bytes3eoc50vgt1uem as Bytes,
|
|
132
|
+
Boolean1fpfi8m5jt3fg as Boolean_0,
|
|
133
|
+
Number1mui0heypwdhp as Number_0,
|
|
134
|
+
Integer39lqx4uc63u28 as Integer_0,
|
|
135
|
+
String1czvr8pxnm6on as String_0,
|
|
136
|
+
Primitive1i8my14jkp3nk as Primitive,
|
|
137
|
+
Custom1lu6o8txpimqz as Custom_0,
|
|
138
|
+
Anyv7qdq63z63rc as Any,
|
|
139
|
+
Unit2z95clvxm08vr as Unit,
|
|
140
|
+
Iterable29qbzfup67wqp as Iterable,
|
|
141
|
+
Dict3g7w5wia7rncj as Dict,
|
|
142
|
+
FileExtension_TypeScript_getInstancebhrmnb4pwt10 as FileExtension_TypeScript_getInstance,
|
|
143
|
+
Companion_instance1a2xqc448tlhh as Companion_instance,
|
|
144
|
+
namespace2467cajrmgrc5 as namespace,
|
|
145
|
+
Emitted12h24rpo4uifw as Emitted,
|
|
146
|
+
plus3lrm73de10b42 as plus_1,
|
|
147
|
+
Unionccsavx6nrdr2 as Union,
|
|
148
|
+
Refined1lkzc0dg6wey7 as Refined,
|
|
149
|
+
Enum3l2iuc342kle6 as Enum_0,
|
|
150
|
+
Type12n1gx16iqtcu as Type,
|
|
151
|
+
plus14o24vdaiongg as plus_2,
|
|
152
|
+
importReferencesy4xv7r53sjjs as importReferences,
|
|
153
|
+
Literal331hu9r04vptz as Literal_0,
|
|
154
|
+
} from './wirespec-src-compiler-core.mjs';
|
|
155
|
+
import {
|
|
156
|
+
_NonEmptyList___get_all__impl__pmf5092svcdxelgy1aa as _NonEmptyList___get_all__impl__pmf509,
|
|
157
|
+
NonEmptyList3ak25ihy2gcvs as NonEmptyList,
|
|
158
|
+
_NonEmptyList___init__impl__fxd0xp3qwfhfa83yk9f as _NonEmptyList___init__impl__fxd0xp,
|
|
159
|
+
NonEmptyList__plus_impl_xqmb91y38uyofmba13 as NonEmptyList__plus_impl_xqmb9,
|
|
160
|
+
} from './arrow-arrow-core.mjs';
|
|
161
|
+
//region block: imports
|
|
162
|
+
var imul = Math.imul;
|
|
163
|
+
//endregion
|
|
164
|
+
//region block: pre-declaration
|
|
165
|
+
initMetadataForClass(EndpointParam, 'EndpointParam');
|
|
166
|
+
initMetadataForCompanion(Companion);
|
|
167
|
+
initMetadataForClass(TypeScriptIrEmitter, 'TypeScriptIrEmitter', TypeScriptIrEmitter, VOID, [IrEmitter]);
|
|
168
|
+
//endregion
|
|
1071
169
|
function _get_sanitizationConfig__sns434($this) {
|
|
1072
|
-
var tmp0 = $this.
|
|
170
|
+
var tmp0 = $this.m1z_1;
|
|
1073
171
|
var tmp = KProperty1;
|
|
1074
172
|
// Inline function 'kotlin.getValue' call
|
|
1075
173
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, TypeScriptIrEmitter$_get_sanitizationConfig_$ref_f6f0bh(), null);
|
|
1076
|
-
return tmp0.
|
|
174
|
+
return tmp0.m1();
|
|
1077
175
|
}
|
|
1078
176
|
function _get_modelSanitizationConfig__vgg831($this) {
|
|
1079
|
-
var tmp0 = $this.
|
|
177
|
+
var tmp0 = $this.n1z_1;
|
|
1080
178
|
var tmp = KProperty1;
|
|
1081
179
|
// Inline function 'kotlin.getValue' call
|
|
1082
180
|
getPropertyCallableRef('modelSanitizationConfig', 1, tmp, TypeScriptIrEmitter$_get_modelSanitizationConfig_$ref_ar2t88(), null);
|
|
1083
|
-
return tmp0.
|
|
181
|
+
return tmp0.m1();
|
|
1084
182
|
}
|
|
1085
183
|
function sanitize($this, _this__u8e3s4) {
|
|
1086
|
-
return '"' + _this__u8e3s4.
|
|
184
|
+
return '"' + _this__u8e3s4.m1() + '"';
|
|
1087
185
|
}
|
|
1088
|
-
function
|
|
186
|
+
function sanitizeSymbol($this, _this__u8e3s4) {
|
|
1089
187
|
// Inline function 'kotlin.text.filter' call
|
|
1090
188
|
// Inline function 'kotlin.text.filterTo' call
|
|
1091
189
|
var destination = StringBuilder_init_$Create$();
|
|
@@ -1104,7 +202,7 @@ function sanitizeSymbol_1($this, _this__u8e3s4) {
|
|
|
1104
202
|
return destination.toString();
|
|
1105
203
|
}
|
|
1106
204
|
function sanitizeKeywords($this, _this__u8e3s4) {
|
|
1107
|
-
return Companion_getInstance_0().
|
|
205
|
+
return Companion_getInstance_0().l1x().v1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1108
206
|
}
|
|
1109
207
|
function firstToLower($this, _this__u8e3s4) {
|
|
1110
208
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
@@ -1115,18 +213,18 @@ function firstToLower($this, _this__u8e3s4) {
|
|
|
1115
213
|
var this_0 = charCodeAt(_this__u8e3s4, 0);
|
|
1116
214
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1117
215
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1118
|
-
var tmp$ret$4 =
|
|
1119
|
-
tmp =
|
|
216
|
+
var tmp$ret$4 = toString(this_0).toLowerCase();
|
|
217
|
+
tmp = toString_0(tmp$ret$4) + substring(_this__u8e3s4, 1);
|
|
1120
218
|
} else {
|
|
1121
219
|
tmp = _this__u8e3s4;
|
|
1122
220
|
}
|
|
1123
221
|
return tmp;
|
|
1124
222
|
}
|
|
1125
223
|
function sanitizeParamName($this, identifier) {
|
|
1126
|
-
var tmp0 = identifier.
|
|
224
|
+
var tmp0 = identifier.m1();
|
|
1127
225
|
// Inline function 'kotlin.text.split' call
|
|
1128
226
|
// Inline function 'kotlin.collections.filter' call
|
|
1129
|
-
var tmp0_0 = Regex_init_$Create$('[.\\s-]+').
|
|
227
|
+
var tmp0_0 = Regex_init_$Create$('[.\\s-]+').ad(tmp0, 0);
|
|
1130
228
|
// Inline function 'kotlin.collections.filterTo' call
|
|
1131
229
|
var destination = ArrayList_init_$Create$();
|
|
1132
230
|
var _iterator__ex2g4s = tmp0_0.t();
|
|
@@ -1138,8 +236,8 @@ function sanitizeParamName($this, identifier) {
|
|
|
1138
236
|
}
|
|
1139
237
|
}
|
|
1140
238
|
var parts = destination;
|
|
1141
|
-
var name = parts.
|
|
1142
|
-
return sanitizeKeywords($this,
|
|
239
|
+
var name = parts.b1() > 1 ? (new Name(parts)).j1m() : identifier.m1();
|
|
240
|
+
return sanitizeKeywords($this, sanitizeSymbol($this, name));
|
|
1143
241
|
}
|
|
1144
242
|
function buildEndpointParams($this, endpoint) {
|
|
1145
243
|
// Inline function 'kotlin.collections.buildList' call
|
|
@@ -1147,7 +245,7 @@ function buildEndpointParams($this, endpoint) {
|
|
|
1147
245
|
// Inline function 'kotlin.apply' call
|
|
1148
246
|
var this_0 = ArrayList_init_$Create$();
|
|
1149
247
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1150
|
-
var tmp0 = endpoint.
|
|
248
|
+
var tmp0 = endpoint.gq_1;
|
|
1151
249
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1152
250
|
var destination = ArrayList_init_$Create$();
|
|
1153
251
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1161,36 +259,36 @@ function buildEndpointParams($this, endpoint) {
|
|
|
1161
259
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1162
260
|
while (_iterator__ex2g4s_0.u()) {
|
|
1163
261
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
1164
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_0.
|
|
262
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_0.lq_1), emitTypeScriptReference($this, element_0.mq_1.xu(false)), element_0.mq_1.vu()));
|
|
1165
263
|
}
|
|
1166
264
|
// Inline function 'kotlin.collections.forEach' call
|
|
1167
|
-
var _iterator__ex2g4s_1 = endpoint.
|
|
265
|
+
var _iterator__ex2g4s_1 = endpoint.hq_1.t();
|
|
1168
266
|
while (_iterator__ex2g4s_1.u()) {
|
|
1169
267
|
var element_1 = _iterator__ex2g4s_1.v();
|
|
1170
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_1.
|
|
268
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_1.aq_1), emitTypeScriptReference($this, element_1.bq_1.xu(false)), element_1.bq_1.vu()));
|
|
1171
269
|
}
|
|
1172
270
|
// Inline function 'kotlin.collections.forEach' call
|
|
1173
|
-
var _iterator__ex2g4s_2 = endpoint.
|
|
271
|
+
var _iterator__ex2g4s_2 = endpoint.iq_1.t();
|
|
1174
272
|
while (_iterator__ex2g4s_2.u()) {
|
|
1175
273
|
var element_2 = _iterator__ex2g4s_2.v();
|
|
1176
|
-
this_0.x(new EndpointParam(sanitizeParamName($this, element_2.
|
|
274
|
+
this_0.x(new EndpointParam(sanitizeParamName($this, element_2.aq_1), emitTypeScriptReference($this, element_2.bq_1.xu(false)), element_2.bq_1.vu()));
|
|
1177
275
|
}
|
|
1178
|
-
var tmp0_safe_receiver = first(endpoint.
|
|
276
|
+
var tmp0_safe_receiver = first(endpoint.jq_1).nq_1;
|
|
1179
277
|
if (tmp0_safe_receiver == null)
|
|
1180
278
|
null;
|
|
1181
279
|
else {
|
|
1182
280
|
// Inline function 'kotlin.let' call
|
|
1183
|
-
this_0.x(new EndpointParam('body', emitTypeScriptReference($this, tmp0_safe_receiver.
|
|
281
|
+
this_0.x(new EndpointParam('body', emitTypeScriptReference($this, tmp0_safe_receiver.pq_1.xu(false)), tmp0_safe_receiver.pq_1.vu()));
|
|
1184
282
|
}
|
|
1185
|
-
return this_0.
|
|
283
|
+
return this_0.p5();
|
|
1186
284
|
}
|
|
1187
285
|
function emitTypeScriptReference($this, ref) {
|
|
1188
286
|
var tmp;
|
|
1189
287
|
if (ref instanceof Dict) {
|
|
1190
|
-
tmp = 'Record<string, ' + emitTypeScriptReference($this, ref.
|
|
288
|
+
tmp = 'Record<string, ' + emitTypeScriptReference($this, ref.bp_1) + '>';
|
|
1191
289
|
} else {
|
|
1192
290
|
if (ref instanceof Iterable) {
|
|
1193
|
-
tmp = emitTypeScriptReference($this, ref.
|
|
291
|
+
tmp = emitTypeScriptReference($this, ref.yo_1) + '[]';
|
|
1194
292
|
} else {
|
|
1195
293
|
if (ref instanceof Unit) {
|
|
1196
294
|
tmp = 'undefined';
|
|
@@ -1198,16 +296,16 @@ function emitTypeScriptReference($this, ref) {
|
|
|
1198
296
|
if (ref instanceof Any) {
|
|
1199
297
|
tmp = 'any';
|
|
1200
298
|
} else {
|
|
1201
|
-
if (ref instanceof
|
|
1202
|
-
tmp =
|
|
299
|
+
if (ref instanceof Custom_0) {
|
|
300
|
+
tmp = sanitizeSymbol($this, ref.dv_1);
|
|
1203
301
|
} else {
|
|
1204
302
|
if (ref instanceof Primitive) {
|
|
1205
|
-
var tmp1_subject = ref.
|
|
303
|
+
var tmp1_subject = ref.ot_1;
|
|
1206
304
|
var tmp_0;
|
|
1207
305
|
if (tmp1_subject instanceof String_0) {
|
|
1208
306
|
tmp_0 = 'string';
|
|
1209
307
|
} else {
|
|
1210
|
-
if (tmp1_subject instanceof
|
|
308
|
+
if (tmp1_subject instanceof Integer_0) {
|
|
1211
309
|
tmp_0 = 'number';
|
|
1212
310
|
} else {
|
|
1213
311
|
if (tmp1_subject instanceof Number_0) {
|
|
@@ -1235,20 +333,20 @@ function emitTypeScriptReference($this, ref) {
|
|
|
1235
333
|
}
|
|
1236
334
|
}
|
|
1237
335
|
// Inline function 'kotlin.let' call
|
|
1238
|
-
return tmp + (ref.
|
|
336
|
+
return tmp + (ref.vu() ? ' | undefined' : '');
|
|
1239
337
|
}
|
|
1240
338
|
function EndpointParam(name, type, nullable) {
|
|
1241
|
-
this.
|
|
1242
|
-
this.
|
|
1243
|
-
this.
|
|
339
|
+
this.q1z_1 = name;
|
|
340
|
+
this.r1z_1 = type;
|
|
341
|
+
this.s1z_1 = nullable;
|
|
1244
342
|
}
|
|
1245
343
|
protoOf(EndpointParam).toString = function () {
|
|
1246
|
-
return 'EndpointParam(name=' + this.
|
|
344
|
+
return 'EndpointParam(name=' + this.q1z_1 + ', type=' + this.r1z_1 + ', nullable=' + this.s1z_1 + ')';
|
|
1247
345
|
};
|
|
1248
346
|
protoOf(EndpointParam).hashCode = function () {
|
|
1249
|
-
var result = getStringHashCode(this.
|
|
1250
|
-
result = imul(result, 31) + getStringHashCode(this.
|
|
1251
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
347
|
+
var result = getStringHashCode(this.q1z_1);
|
|
348
|
+
result = imul(result, 31) + getStringHashCode(this.r1z_1) | 0;
|
|
349
|
+
result = imul(result, 31) + getBooleanHashCode(this.s1z_1) | 0;
|
|
1252
350
|
return result;
|
|
1253
351
|
};
|
|
1254
352
|
protoOf(EndpointParam).equals = function (other) {
|
|
@@ -1256,20 +354,21 @@ protoOf(EndpointParam).equals = function (other) {
|
|
|
1256
354
|
return true;
|
|
1257
355
|
if (!(other instanceof EndpointParam))
|
|
1258
356
|
return false;
|
|
1259
|
-
if (!(this.
|
|
357
|
+
if (!(this.q1z_1 === other.q1z_1))
|
|
1260
358
|
return false;
|
|
1261
|
-
if (!(this.
|
|
359
|
+
if (!(this.r1z_1 === other.r1z_1))
|
|
1262
360
|
return false;
|
|
1263
|
-
if (!(this.
|
|
361
|
+
if (!(this.s1z_1 === other.s1z_1))
|
|
1264
362
|
return false;
|
|
1265
363
|
return true;
|
|
1266
364
|
};
|
|
1267
365
|
function Companion() {
|
|
1268
|
-
|
|
366
|
+
Companion_instance_0 = this;
|
|
367
|
+
this.o1z_1 = TypeScriptGenerator_getInstance();
|
|
1269
368
|
var tmp = this;
|
|
1270
369
|
// Inline function 'kotlin.collections.associateWith' call
|
|
1271
370
|
var this_0 = listOf(['GeneratorFieldString', 'GeneratorFieldInteger64', 'GeneratorFieldInteger32', 'GeneratorFieldNumber64', 'GeneratorFieldNumber32', 'GeneratorFieldBoolean', 'GeneratorFieldBytes', 'GeneratorFieldEnum', 'GeneratorFieldUnion', 'GeneratorFieldArray', 'GeneratorFieldNullable', 'GeneratorFieldShape', 'GeneratorFieldDict']);
|
|
1272
|
-
var result = LinkedHashMap_init_$Create$
|
|
371
|
+
var result = LinkedHashMap_init_$Create$(coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16));
|
|
1273
372
|
// Inline function 'kotlin.collections.associateWithTo' call
|
|
1274
373
|
var _iterator__ex2g4s = this_0.t();
|
|
1275
374
|
while (_iterator__ex2g4s.u()) {
|
|
@@ -1277,29 +376,31 @@ function Companion() {
|
|
|
1277
376
|
// Inline function 'kotlin.text.lowercase' call
|
|
1278
377
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1279
378
|
var tmp$ret$2 = removePrefix(element, 'GeneratorField').toLowerCase();
|
|
1280
|
-
result.
|
|
379
|
+
result.t2(element, tmp$ret$2);
|
|
1281
380
|
}
|
|
1282
|
-
tmp.
|
|
1283
|
-
this.d22_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']);
|
|
381
|
+
tmp.p1z_1 = result;
|
|
1284
382
|
}
|
|
1285
|
-
|
|
383
|
+
protoOf(Companion).l1x = function () {
|
|
384
|
+
return this.o1z_1.x1w_1;
|
|
385
|
+
};
|
|
386
|
+
var Companion_instance_0;
|
|
1286
387
|
function Companion_getInstance_0() {
|
|
1287
|
-
if (
|
|
388
|
+
if (Companion_instance_0 == null)
|
|
1288
389
|
new Companion();
|
|
1289
|
-
return
|
|
390
|
+
return Companion_instance_0;
|
|
1290
391
|
}
|
|
1291
392
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
1292
393
|
return it;
|
|
1293
394
|
}
|
|
1294
395
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1295
396
|
return function (name) {
|
|
1296
|
-
var sanitized = name.
|
|
397
|
+
var sanitized = name.v1g_1.b1() > 1 ? name.j1m() : sanitizeSymbol(this$0, name.w1i());
|
|
1297
398
|
return new Name(listOf_0(sanitized));
|
|
1298
399
|
};
|
|
1299
400
|
}
|
|
1300
401
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0) {
|
|
1301
402
|
return function (name) {
|
|
1302
|
-
var sanitized = name.
|
|
403
|
+
var sanitized = name.v1g_1.b1() > 1 ? name.j1m() : sanitizeSymbol(this$0, name.w1i());
|
|
1303
404
|
return new Name(listOf_0(sanitized));
|
|
1304
405
|
};
|
|
1305
406
|
}
|
|
@@ -1325,29 +426,29 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0)
|
|
|
1325
426
|
return function (stmt, tr) {
|
|
1326
427
|
var tmp;
|
|
1327
428
|
if (stmt instanceof VariableReference) {
|
|
1328
|
-
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.
|
|
429
|
+
tmp = new VariableReference(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.r1n_1));
|
|
1329
430
|
} else {
|
|
1330
431
|
if (stmt instanceof ConstructorStatement) {
|
|
1331
|
-
var tmp_0 = tr.
|
|
432
|
+
var tmp_0 = tr.i1v(stmt.o1n_1);
|
|
1332
433
|
// Inline function 'kotlin.collections.map' call
|
|
1333
|
-
var this_0 = stmt.
|
|
434
|
+
var this_0 = stmt.p1n_1;
|
|
1334
435
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1335
|
-
var destination = ArrayList_init_$Create$_0(this_0.
|
|
436
|
+
var destination = ArrayList_init_$Create$_0(this_0.b1());
|
|
1336
437
|
// Inline function 'kotlin.collections.iterator' call
|
|
1337
|
-
var _iterator__ex2g4s = this_0.
|
|
438
|
+
var _iterator__ex2g4s = this_0.k1().t();
|
|
1338
439
|
while (_iterator__ex2g4s.u()) {
|
|
1339
440
|
var item = _iterator__ex2g4s.v();
|
|
1340
441
|
// Inline function 'kotlin.collections.component1' call
|
|
1341
|
-
var key = item.
|
|
442
|
+
var key = item.l1();
|
|
1342
443
|
// Inline function 'kotlin.collections.component2' call
|
|
1343
|
-
var value = item.
|
|
1344
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.
|
|
444
|
+
var value = item.m1();
|
|
445
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), key), tr.l1v(value));
|
|
1345
446
|
destination.x(tmp$ret$3);
|
|
1346
447
|
}
|
|
1347
448
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
1348
449
|
} else {
|
|
1349
450
|
if (stmt instanceof Assignment) {
|
|
1350
|
-
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.i1q_1), tr.
|
|
451
|
+
tmp = new Assignment(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), stmt.i1q_1), tr.l1v(stmt.j1q_1), stmt.k1q_1);
|
|
1351
452
|
} else {
|
|
1352
453
|
tmp = transformChildren(stmt, tr);
|
|
1353
454
|
}
|
|
@@ -1358,7 +459,7 @@ function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0)
|
|
|
1358
459
|
}
|
|
1359
460
|
function TypeScriptIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1360
461
|
return function () {
|
|
1361
|
-
var tmp0_reservedKeywords = Companion_getInstance_0().
|
|
462
|
+
var tmp0_reservedKeywords = Companion_getInstance_0().l1x();
|
|
1362
463
|
var tmp = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1363
464
|
var tmp_0 = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
|
|
1364
465
|
var tmp_1 = TypeScriptIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
|
|
@@ -1372,7 +473,7 @@ function TypeScriptIrEmitter$_get_sanitizationConfig_$ref_f6f0bh() {
|
|
|
1372
473
|
};
|
|
1373
474
|
}
|
|
1374
475
|
function TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda$lambda(name) {
|
|
1375
|
-
return new Name(listOf_0(name.
|
|
476
|
+
return new Name(listOf_0(name.w1i()));
|
|
1376
477
|
}
|
|
1377
478
|
function TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda$lambda_0(it) {
|
|
1378
479
|
return it;
|
|
@@ -1381,7 +482,7 @@ function TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda(this$0) {
|
|
|
1381
482
|
return function () {
|
|
1382
483
|
var tmp = _get_sanitizationConfig__sns434(this$0);
|
|
1383
484
|
var tmp_0 = TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda$lambda;
|
|
1384
|
-
return tmp.
|
|
485
|
+
return tmp.j1x(VOID, VOID, tmp_0, VOID, TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda$lambda_0);
|
|
1385
486
|
};
|
|
1386
487
|
}
|
|
1387
488
|
function TypeScriptIrEmitter$_get_modelSanitizationConfig_$ref_ar2t88() {
|
|
@@ -1392,11 +493,40 @@ function TypeScriptIrEmitter$_get_modelSanitizationConfig_$ref_ar2t88() {
|
|
|
1392
493
|
function TypeScriptIrEmitter$emitShared$lambda(element, transformer) {
|
|
1393
494
|
var tmp;
|
|
1394
495
|
if (element instanceof Namespace) {
|
|
1395
|
-
var injected = element.
|
|
496
|
+
var injected = element.y1n_1.equals(Companion_getInstance().x1g('Wirespec')) ? listOf_0(new RawElement('export type Type = string')) : emptyList();
|
|
1396
497
|
var tmp_0;
|
|
1397
498
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1398
499
|
if (!injected.r()) {
|
|
1399
|
-
|
|
500
|
+
// Inline function 'community.flock.wirespec.ir.core.withElements' call
|
|
501
|
+
var elements = plus(injected, element.u1n());
|
|
502
|
+
var tmp_1;
|
|
503
|
+
if (element instanceof File) {
|
|
504
|
+
tmp_1 = element.w1n(VOID, elements);
|
|
505
|
+
} else {
|
|
506
|
+
if (element instanceof Struct) {
|
|
507
|
+
tmp_1 = element.d1q(VOID, VOID, VOID, VOID, elements);
|
|
508
|
+
} else {
|
|
509
|
+
if (element instanceof Namespace) {
|
|
510
|
+
tmp_1 = element.d1o(VOID, elements);
|
|
511
|
+
} else {
|
|
512
|
+
if (element instanceof Interface) {
|
|
513
|
+
tmp_1 = element.m1o(VOID, elements);
|
|
514
|
+
} else {
|
|
515
|
+
if (element instanceof Enum) {
|
|
516
|
+
tmp_1 = element.r1p(VOID, VOID, VOID, VOID, VOID, elements);
|
|
517
|
+
} else {
|
|
518
|
+
if (element instanceof Main) {
|
|
519
|
+
tmp_1 = element;
|
|
520
|
+
} else {
|
|
521
|
+
tmp_1 = element;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
var tmp_2 = tmp_1;
|
|
529
|
+
tmp_0 = tmp_2 instanceof Namespace ? tmp_2 : THROW_CCE();
|
|
1400
530
|
} else {
|
|
1401
531
|
tmp_0 = element;
|
|
1402
532
|
}
|
|
@@ -1411,11 +541,40 @@ function TypeScriptIrEmitter$emitShared$lambda_0($api) {
|
|
|
1411
541
|
return function (element, transformer) {
|
|
1412
542
|
var tmp;
|
|
1413
543
|
if (element instanceof Namespace) {
|
|
1414
|
-
var injected = element.
|
|
544
|
+
var injected = element.y1n_1.equals(Companion_getInstance().x1g('Wirespec')) ? listOf_0(new RawElement($api)) : emptyList();
|
|
1415
545
|
var tmp_0;
|
|
1416
546
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1417
547
|
if (!injected.r()) {
|
|
1418
|
-
|
|
548
|
+
// Inline function 'community.flock.wirespec.ir.core.withElements' call
|
|
549
|
+
var elements = plus(element.u1n(), injected);
|
|
550
|
+
var tmp_1;
|
|
551
|
+
if (element instanceof File) {
|
|
552
|
+
tmp_1 = element.w1n(VOID, elements);
|
|
553
|
+
} else {
|
|
554
|
+
if (element instanceof Struct) {
|
|
555
|
+
tmp_1 = element.d1q(VOID, VOID, VOID, VOID, elements);
|
|
556
|
+
} else {
|
|
557
|
+
if (element instanceof Namespace) {
|
|
558
|
+
tmp_1 = element.d1o(VOID, elements);
|
|
559
|
+
} else {
|
|
560
|
+
if (element instanceof Interface) {
|
|
561
|
+
tmp_1 = element.m1o(VOID, elements);
|
|
562
|
+
} else {
|
|
563
|
+
if (element instanceof Enum) {
|
|
564
|
+
tmp_1 = element.r1p(VOID, VOID, VOID, VOID, VOID, elements);
|
|
565
|
+
} else {
|
|
566
|
+
if (element instanceof Main) {
|
|
567
|
+
tmp_1 = element;
|
|
568
|
+
} else {
|
|
569
|
+
tmp_1 = element;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
var tmp_2 = tmp_1;
|
|
577
|
+
tmp_0 = tmp_2 instanceof Namespace ? tmp_2 : THROW_CCE();
|
|
1419
578
|
} else {
|
|
1420
579
|
tmp_0 = element;
|
|
1421
580
|
}
|
|
@@ -1430,13 +589,13 @@ function TypeScriptIrEmitter$emitShared$lambda_0($api) {
|
|
|
1430
589
|
function TypeScriptIrEmitter$emitShared$lambda_1(element, transformer) {
|
|
1431
590
|
var tmp;
|
|
1432
591
|
if (element instanceof Struct) {
|
|
1433
|
-
var tmp0_safe_receiver = Companion_getInstance_0().
|
|
592
|
+
var tmp0_safe_receiver = Companion_getInstance_0().p1z_1.q2(element.s1p_1.w1i());
|
|
1434
593
|
var tmp_0;
|
|
1435
594
|
if (tmp0_safe_receiver == null) {
|
|
1436
595
|
tmp_0 = null;
|
|
1437
596
|
} else {
|
|
1438
597
|
// Inline function 'kotlin.let' call
|
|
1439
|
-
tmp_0 = element.
|
|
598
|
+
tmp_0 = element.d1q(VOID, plus(listOf_0(new Field(Companion_getInstance().x1g('kind'), new StringLiteral(tmp0_safe_receiver))), element.t1p_1));
|
|
1440
599
|
}
|
|
1441
600
|
var tmp1_elvis_lhs = tmp_0;
|
|
1442
601
|
tmp = tmp1_elvis_lhs == null ? element : tmp1_elvis_lhs;
|
|
@@ -1447,7 +606,7 @@ function TypeScriptIrEmitter$emitShared$lambda_1(element, transformer) {
|
|
|
1447
606
|
return transformChildren_0(transformed, transformer);
|
|
1448
607
|
}
|
|
1449
608
|
function TypeScriptIrEmitter$emit$lambda(it) {
|
|
1450
|
-
return 'export {' + it.
|
|
609
|
+
return 'export {' + it.gr().m1() + "} from './" + it.gr().m1() + "'";
|
|
1451
610
|
}
|
|
1452
611
|
function TypeScriptIrEmitter$emitGenerator$lambda($definition) {
|
|
1453
612
|
return function (expr, t) {
|
|
@@ -1456,24 +615,24 @@ function TypeScriptIrEmitter$emitGenerator$lambda($definition) {
|
|
|
1456
615
|
var tmp_1;
|
|
1457
616
|
var tmp_2;
|
|
1458
617
|
if (expr instanceof FunctionCall) {
|
|
1459
|
-
var tmp_3 = expr.
|
|
618
|
+
var tmp_3 = expr.r1m_1;
|
|
1460
619
|
tmp_2 = tmp_3 instanceof RawExpression;
|
|
1461
620
|
} else {
|
|
1462
621
|
tmp_2 = false;
|
|
1463
622
|
}
|
|
1464
623
|
if (tmp_2) {
|
|
1465
|
-
var tmp_4 = expr.
|
|
1466
|
-
tmp_1 = (tmp_4 instanceof RawExpression ? tmp_4 : THROW_CCE()).h1q_1 === $definition.
|
|
624
|
+
var tmp_4 = expr.r1m_1;
|
|
625
|
+
tmp_1 = (tmp_4 instanceof RawExpression ? tmp_4 : THROW_CCE()).h1q_1 === $definition.rr_1.m1();
|
|
1467
626
|
} else {
|
|
1468
627
|
tmp_1 = false;
|
|
1469
628
|
}
|
|
1470
629
|
if (tmp_1) {
|
|
1471
|
-
tmp_0 = expr.
|
|
630
|
+
tmp_0 = expr.t1m_1.equals(Companion_getInstance().x1g('valueOf'));
|
|
1472
631
|
} else {
|
|
1473
632
|
tmp_0 = false;
|
|
1474
633
|
}
|
|
1475
634
|
if (tmp_0) {
|
|
1476
|
-
var tmp0_elvis_lhs = expr.
|
|
635
|
+
var tmp0_elvis_lhs = expr.u1m_1.q2(Companion_getInstance().x1g('label'));
|
|
1477
636
|
tmp = tmp0_elvis_lhs == null ? expr : tmp0_elvis_lhs;
|
|
1478
637
|
} else {
|
|
1479
638
|
tmp = transformChildren_1(expr, t);
|
|
@@ -1486,12 +645,12 @@ function TypeScriptIrEmitter$emitGenerator$lambda_0($definition) {
|
|
|
1486
645
|
var tmp;
|
|
1487
646
|
var tmp_0;
|
|
1488
647
|
if (expr instanceof ConstructorStatement) {
|
|
1489
|
-
tmp_0 = equals(expr.
|
|
648
|
+
tmp_0 = equals(expr.o1n_1, Custom_init_$Create$($definition.mr_1.m1()));
|
|
1490
649
|
} else {
|
|
1491
650
|
tmp_0 = false;
|
|
1492
651
|
}
|
|
1493
652
|
if (tmp_0) {
|
|
1494
|
-
var tmp0_elvis_lhs = expr.
|
|
653
|
+
var tmp0_elvis_lhs = expr.p1n_1.q2(Companion_getInstance().x1g('value'));
|
|
1495
654
|
tmp = tmp0_elvis_lhs == null ? expr : tmp0_elvis_lhs;
|
|
1496
655
|
} else {
|
|
1497
656
|
tmp = transformChildren_1(expr, t);
|
|
@@ -1502,37 +661,37 @@ function TypeScriptIrEmitter$emitGenerator$lambda_0($definition) {
|
|
|
1502
661
|
function TypeScriptIrEmitter$emitGenerator$lambda_1(expr, t) {
|
|
1503
662
|
var tmp;
|
|
1504
663
|
if (expr instanceof ConstructorStatement) {
|
|
1505
|
-
var tmp_0 = expr.
|
|
1506
|
-
var tmp0_safe_receiver = tmp_0 instanceof
|
|
1507
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1508
|
-
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
664
|
+
var tmp_0 = expr.o1n_1;
|
|
665
|
+
var tmp0_safe_receiver = tmp_0 instanceof Custom ? tmp_0 : null;
|
|
666
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.u1i_1;
|
|
667
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.w1i();
|
|
1509
668
|
var typeName = tmp2_safe_receiver == null ? null : removePrefix(tmp2_safe_receiver, 'Wirespec.');
|
|
1510
669
|
var tmp_1;
|
|
1511
670
|
if (typeName == null) {
|
|
1512
671
|
tmp_1 = null;
|
|
1513
672
|
} else {
|
|
1514
673
|
// Inline function 'kotlin.let' call
|
|
1515
|
-
tmp_1 = Companion_getInstance_0().
|
|
674
|
+
tmp_1 = Companion_getInstance_0().p1z_1.q2(typeName);
|
|
1516
675
|
}
|
|
1517
676
|
var kind = tmp_1;
|
|
1518
677
|
var tmp_2;
|
|
1519
678
|
if (!(kind == null)) {
|
|
1520
|
-
var tmp_3 = mapOf(to(Companion_getInstance().
|
|
679
|
+
var tmp_3 = mapOf(to(Companion_getInstance().x1g('kind'), new Literal(kind, String_instance)));
|
|
1521
680
|
// Inline function 'kotlin.collections.mapValues' call
|
|
1522
|
-
var this_0 = expr.
|
|
681
|
+
var this_0 = expr.p1n_1;
|
|
1523
682
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
1524
|
-
var destination = LinkedHashMap_init_$Create$
|
|
683
|
+
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.b1()));
|
|
1525
684
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
1526
|
-
var _iterator__ex2g4s = this_0.
|
|
685
|
+
var _iterator__ex2g4s = this_0.k1().t();
|
|
1527
686
|
while (_iterator__ex2g4s.u()) {
|
|
1528
687
|
var element = _iterator__ex2g4s.v();
|
|
1529
|
-
var tmp_4 = element.
|
|
688
|
+
var tmp_4 = element.l1();
|
|
1530
689
|
// Inline function 'kotlin.collections.component2' call
|
|
1531
|
-
var v = element.
|
|
1532
|
-
var tmp$ret$4 = t.
|
|
1533
|
-
destination.
|
|
690
|
+
var v = element.m1();
|
|
691
|
+
var tmp$ret$4 = t.l1v(v);
|
|
692
|
+
destination.t2(tmp_4, tmp$ret$4);
|
|
1534
693
|
}
|
|
1535
|
-
tmp_2 = new ConstructorStatement(expr.
|
|
694
|
+
tmp_2 = new ConstructorStatement(expr.o1n_1, plus_0(tmp_3, destination));
|
|
1536
695
|
} else {
|
|
1537
696
|
tmp_2 = transformChildren(expr, t);
|
|
1538
697
|
}
|
|
@@ -1583,7 +742,36 @@ function TypeScriptIrEmitter$emit$injectApiConst$lambda($endpoint) {
|
|
|
1583
742
|
var tmp_0;
|
|
1584
743
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1585
744
|
if (!injected.r()) {
|
|
1586
|
-
|
|
745
|
+
// Inline function 'community.flock.wirespec.ir.core.withElements' call
|
|
746
|
+
var elements = plus(element.u1n(), injected);
|
|
747
|
+
var tmp_1;
|
|
748
|
+
if (element instanceof File) {
|
|
749
|
+
tmp_1 = element.w1n(VOID, elements);
|
|
750
|
+
} else {
|
|
751
|
+
if (element instanceof Struct) {
|
|
752
|
+
tmp_1 = element.d1q(VOID, VOID, VOID, VOID, elements);
|
|
753
|
+
} else {
|
|
754
|
+
if (element instanceof Namespace) {
|
|
755
|
+
tmp_1 = element.d1o(VOID, elements);
|
|
756
|
+
} else {
|
|
757
|
+
if (element instanceof Interface) {
|
|
758
|
+
tmp_1 = element.m1o(VOID, elements);
|
|
759
|
+
} else {
|
|
760
|
+
if (element instanceof Enum) {
|
|
761
|
+
tmp_1 = element.r1p(VOID, VOID, VOID, VOID, VOID, elements);
|
|
762
|
+
} else {
|
|
763
|
+
if (element instanceof Main) {
|
|
764
|
+
tmp_1 = element;
|
|
765
|
+
} else {
|
|
766
|
+
tmp_1 = element;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
var tmp_2 = tmp_1;
|
|
774
|
+
tmp_0 = tmp_2 instanceof Namespace ? tmp_2 : THROW_CCE();
|
|
1587
775
|
} else {
|
|
1588
776
|
tmp_0 = element;
|
|
1589
777
|
}
|
|
@@ -1602,14 +790,14 @@ function emit$injectApiConst(_this__u8e3s4, $endpoint) {
|
|
|
1602
790
|
var tmp = scope;
|
|
1603
791
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1604
792
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1605
|
-
var this_0 = scope.
|
|
793
|
+
var this_0 = scope.q1v_1;
|
|
1606
794
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1607
795
|
// Inline function 'kotlin.apply' call
|
|
1608
796
|
var this_1 = new TransformerBuilder();
|
|
1609
|
-
this_1.
|
|
1610
|
-
var tmp$ret$2 = this_1.
|
|
1611
|
-
tmp.
|
|
1612
|
-
var tmp_0 = scope.
|
|
797
|
+
this_1.k1i(TypeScriptIrEmitter$emit$injectApiConst$lambda($endpoint));
|
|
798
|
+
var tmp$ret$2 = this_1.l1i();
|
|
799
|
+
tmp.q1v_1 = transform(this_0, tmp$ret$2);
|
|
800
|
+
var tmp_0 = scope.q1v_1;
|
|
1613
801
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1614
802
|
}
|
|
1615
803
|
function emit$applyCallParamsIfNeeded(_this__u8e3s4, hasRequestParams) {
|
|
@@ -1617,27 +805,27 @@ function emit$applyCallParamsIfNeeded(_this__u8e3s4, hasRequestParams) {
|
|
|
1617
805
|
}
|
|
1618
806
|
function TypeScriptIrEmitter$emitClient$lambda(this$0) {
|
|
1619
807
|
return function (it) {
|
|
1620
|
-
var methodName = firstToLower(this$0, it.
|
|
808
|
+
var methodName = firstToLower(this$0, it.eq_1.m1());
|
|
1621
809
|
return ' ...' + methodName + 'Client(serialization, transportation),';
|
|
1622
810
|
};
|
|
1623
811
|
}
|
|
1624
812
|
function TypeScriptIrEmitter() {
|
|
1625
813
|
Companion_getInstance_0();
|
|
1626
|
-
this.
|
|
1627
|
-
this.
|
|
814
|
+
this.k1z_1 = TypeScriptGenerator_getInstance();
|
|
815
|
+
this.l1z_1 = FileExtension_TypeScript_getInstance();
|
|
1628
816
|
var tmp = this;
|
|
1629
|
-
tmp.
|
|
817
|
+
tmp.m1z_1 = lazy(TypeScriptIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1630
818
|
var tmp_0 = this;
|
|
1631
|
-
tmp_0.
|
|
819
|
+
tmp_0.n1z_1 = lazy(TypeScriptIrEmitter$modelSanitizationConfig$delegate$lambda(this));
|
|
1632
820
|
}
|
|
1633
|
-
protoOf(TypeScriptIrEmitter).
|
|
1634
|
-
return this.
|
|
821
|
+
protoOf(TypeScriptIrEmitter).d1w = function () {
|
|
822
|
+
return this.k1z_1;
|
|
1635
823
|
};
|
|
1636
|
-
protoOf(TypeScriptIrEmitter).
|
|
1637
|
-
return this.
|
|
824
|
+
protoOf(TypeScriptIrEmitter).er = function () {
|
|
825
|
+
return this.l1z_1;
|
|
1638
826
|
};
|
|
1639
|
-
protoOf(TypeScriptIrEmitter).
|
|
1640
|
-
var packageName = Companion_instance.
|
|
827
|
+
protoOf(TypeScriptIrEmitter).h1w = function () {
|
|
828
|
+
var packageName = Companion_instance.bs('community.flock.wirespec');
|
|
1641
829
|
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}';
|
|
1642
830
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1643
831
|
var this_0 = convert(packageName);
|
|
@@ -1646,41 +834,41 @@ protoOf(TypeScriptIrEmitter).y1w = function () {
|
|
|
1646
834
|
var tmp = scope;
|
|
1647
835
|
// Inline function 'community.flock.wirespec.ir.core.injectBefore' call
|
|
1648
836
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1649
|
-
var this_1 = scope.
|
|
837
|
+
var this_1 = scope.q1v_1;
|
|
1650
838
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1651
839
|
// Inline function 'kotlin.apply' call
|
|
1652
840
|
var this_2 = new TransformerBuilder();
|
|
1653
|
-
this_2.
|
|
1654
|
-
var tmp$ret$2 = this_2.
|
|
1655
|
-
tmp.
|
|
841
|
+
this_2.k1i(TypeScriptIrEmitter$emitShared$lambda);
|
|
842
|
+
var tmp$ret$2 = this_2.l1i();
|
|
843
|
+
tmp.q1v_1 = transform(this_1, tmp$ret$2);
|
|
1656
844
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1657
845
|
var tmp_0 = scope;
|
|
1658
846
|
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1659
847
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1660
|
-
var this_3 = scope.
|
|
848
|
+
var this_3 = scope.q1v_1;
|
|
1661
849
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1662
850
|
// Inline function 'kotlin.apply' call
|
|
1663
851
|
var this_4 = new TransformerBuilder();
|
|
1664
|
-
this_4.
|
|
1665
|
-
var tmp$ret$8 = this_4.
|
|
1666
|
-
tmp_0.
|
|
852
|
+
this_4.k1i(TypeScriptIrEmitter$emitShared$lambda_0(api));
|
|
853
|
+
var tmp$ret$8 = this_4.l1i();
|
|
854
|
+
tmp_0.q1v_1 = transform(this_3, tmp$ret$8);
|
|
1667
855
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1668
856
|
var tmp_1 = scope;
|
|
1669
857
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1670
|
-
var this_5 = scope.
|
|
858
|
+
var this_5 = scope.q1v_1;
|
|
1671
859
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1672
860
|
// Inline function 'kotlin.apply' call
|
|
1673
861
|
var this_6 = new TransformerBuilder();
|
|
1674
|
-
this_6.
|
|
1675
|
-
var tmp$ret$14 = this_6.
|
|
1676
|
-
tmp_1.
|
|
1677
|
-
var tmp_2 = scope.
|
|
862
|
+
this_6.k1i(TypeScriptIrEmitter$emitShared$lambda_1);
|
|
863
|
+
var tmp$ret$14 = this_6.l1i();
|
|
864
|
+
tmp_1.q1v_1 = transform(this_5, tmp$ret$14);
|
|
865
|
+
var tmp_2 = scope.q1v_1;
|
|
1678
866
|
return isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1679
867
|
};
|
|
1680
|
-
protoOf(TypeScriptIrEmitter).
|
|
868
|
+
protoOf(TypeScriptIrEmitter).no = function (ast, logger) {
|
|
1681
869
|
var tmp = emit.call(this, ast, logger);
|
|
1682
870
|
// Inline function 'arrow.core.NonEmptyList.flatMap' call
|
|
1683
|
-
var this_0 = ast.
|
|
871
|
+
var this_0 = ast.br_1;
|
|
1684
872
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1685
873
|
var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_0);
|
|
1686
874
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -1688,24 +876,24 @@ protoOf(TypeScriptIrEmitter).eo = function (ast, logger) {
|
|
|
1688
876
|
var _iterator__ex2g4s = tmp0.t();
|
|
1689
877
|
while (_iterator__ex2g4s.u()) {
|
|
1690
878
|
var element = _iterator__ex2g4s.v();
|
|
1691
|
-
var list = new NonEmptyList(element.
|
|
879
|
+
var list = new NonEmptyList(element.ar_1);
|
|
1692
880
|
addAll(destination, list);
|
|
1693
881
|
}
|
|
1694
882
|
var tmp$ret$3 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
1695
883
|
// Inline function 'kotlin.collections.groupBy' call
|
|
1696
884
|
var tmp0_0 = new NonEmptyList(tmp$ret$3);
|
|
1697
885
|
// Inline function 'kotlin.collections.groupByTo' call
|
|
1698
|
-
var destination_0 = LinkedHashMap_init_$Create$();
|
|
886
|
+
var destination_0 = LinkedHashMap_init_$Create$_0();
|
|
1699
887
|
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
1700
888
|
while (_iterator__ex2g4s_0.u()) {
|
|
1701
889
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
1702
890
|
var key = namespace(element_0);
|
|
1703
891
|
// Inline function 'kotlin.collections.getOrPut' call
|
|
1704
|
-
var value = destination_0.
|
|
892
|
+
var value = destination_0.q2(key);
|
|
1705
893
|
var tmp_0;
|
|
1706
894
|
if (value == null) {
|
|
1707
895
|
var answer = ArrayList_init_$Create$();
|
|
1708
|
-
destination_0.
|
|
896
|
+
destination_0.t2(key, answer);
|
|
1709
897
|
tmp_0 = answer;
|
|
1710
898
|
} else {
|
|
1711
899
|
tmp_0 = value;
|
|
@@ -1715,45 +903,45 @@ protoOf(TypeScriptIrEmitter).eo = function (ast, logger) {
|
|
|
1715
903
|
}
|
|
1716
904
|
// Inline function 'kotlin.collections.map' call
|
|
1717
905
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1718
|
-
var destination_1 = ArrayList_init_$Create$_0(destination_0.
|
|
906
|
+
var destination_1 = ArrayList_init_$Create$_0(destination_0.b1());
|
|
1719
907
|
// Inline function 'kotlin.collections.iterator' call
|
|
1720
|
-
var _iterator__ex2g4s_1 = destination_0.
|
|
908
|
+
var _iterator__ex2g4s_1 = destination_0.k1().t();
|
|
1721
909
|
while (_iterator__ex2g4s_1.u()) {
|
|
1722
910
|
var item = _iterator__ex2g4s_1.v();
|
|
1723
911
|
// Inline function 'kotlin.collections.component1' call
|
|
1724
|
-
var ns = item.
|
|
912
|
+
var ns = item.l1();
|
|
1725
913
|
// Inline function 'kotlin.collections.component2' call
|
|
1726
|
-
var defs = item.
|
|
1727
|
-
var tmp_1 = ns + '/index.' + this.
|
|
914
|
+
var defs = item.m1();
|
|
915
|
+
var tmp_1 = ns + '/index.' + this.er().wq_1;
|
|
1728
916
|
var tmp$ret$12 = new Emitted(tmp_1, joinToString(defs, '\n', VOID, VOID, VOID, VOID, TypeScriptIrEmitter$emit$lambda));
|
|
1729
917
|
destination_1.x(tmp$ret$12);
|
|
1730
918
|
}
|
|
1731
|
-
return
|
|
919
|
+
return NonEmptyList__plus_impl_xqmb9(tmp, destination_1);
|
|
1732
920
|
};
|
|
1733
|
-
protoOf(TypeScriptIrEmitter).
|
|
921
|
+
protoOf(TypeScriptIrEmitter).fr = function (definition, module_0, logger) {
|
|
1734
922
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1735
|
-
var subPackageName =
|
|
1736
|
-
return new File(Companion_getInstance().
|
|
923
|
+
var subPackageName = plus_1(Companion_instance.bs(''), definition);
|
|
924
|
+
return new File(Companion_getInstance().x1g(subPackageName.es() + sanitizeSymbol(this, file.s1n_1.y1g())), plus(listOf_0(import_0('../Wirespec', 'Wirespec')), file.t1n_1));
|
|
1737
925
|
};
|
|
1738
|
-
protoOf(TypeScriptIrEmitter).
|
|
926
|
+
protoOf(TypeScriptIrEmitter).m1w = function (definition, module_0) {
|
|
1739
927
|
var tmp;
|
|
1740
928
|
if (definition instanceof Type) {
|
|
1741
929
|
tmp = convertToGenerator_2(definition, module_0);
|
|
1742
930
|
} else {
|
|
1743
|
-
if (definition instanceof
|
|
931
|
+
if (definition instanceof Enum_0) {
|
|
1744
932
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1745
933
|
var this_0 = convertToGenerator_1(definition);
|
|
1746
934
|
var scope = new TransformScope(this_0);
|
|
1747
|
-
scope.
|
|
1748
|
-
var tmp_0 = scope.
|
|
935
|
+
scope.y1v(TypeScriptIrEmitter$emitGenerator$lambda(definition));
|
|
936
|
+
var tmp_0 = scope.q1v_1;
|
|
1749
937
|
tmp = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1750
938
|
} else {
|
|
1751
939
|
if (definition instanceof Refined) {
|
|
1752
940
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1753
941
|
var this_1 = convertToGenerator_0(definition);
|
|
1754
942
|
var scope_0 = new TransformScope(this_1);
|
|
1755
|
-
scope_0.
|
|
1756
|
-
var tmp_1 = scope_0.
|
|
943
|
+
scope_0.y1v(TypeScriptIrEmitter$emitGenerator$lambda_0(definition));
|
|
944
|
+
var tmp_1 = scope_0.q1v_1;
|
|
1757
945
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1758
946
|
} else {
|
|
1759
947
|
if (definition instanceof Union) {
|
|
@@ -1767,10 +955,10 @@ protoOf(TypeScriptIrEmitter).d1x = function (definition, module_0) {
|
|
|
1767
955
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1768
956
|
var this_2 = sanitizeNames(tmp, _get_sanitizationConfig__sns434(this));
|
|
1769
957
|
var scope_1 = new TransformScope(this_2);
|
|
1770
|
-
scope_1.
|
|
1771
|
-
var tmp_2 = scope_1.
|
|
958
|
+
scope_1.y1v(TypeScriptIrEmitter$emitGenerator$lambda_1);
|
|
959
|
+
var tmp_2 = scope_1.q1v_1;
|
|
1772
960
|
var generatorFile = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1773
|
-
var generatorOwnName = definition.
|
|
961
|
+
var generatorOwnName = definition.gr().m1() + 'Generator';
|
|
1774
962
|
var tmp_3 = asSequence(collectCustomTypeNames(generatorFile));
|
|
1775
963
|
var tmp_4 = filterNot(tmp_3, TypeScriptIrEmitter$emitGenerator$lambda_2);
|
|
1776
964
|
var tmp_5 = filterNot(tmp_4, TypeScriptIrEmitter$emitGenerator$lambda_3(generatorOwnName));
|
|
@@ -1779,8 +967,8 @@ protoOf(TypeScriptIrEmitter).d1x = function (definition, module_0) {
|
|
|
1779
967
|
var generatorRefs = LinkedHashSet_init_$Create$();
|
|
1780
968
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1781
969
|
var scope_2 = new TransformScope(generatorFile);
|
|
1782
|
-
scope_2.
|
|
1783
|
-
var tmp_6 = scope_2.
|
|
970
|
+
scope_2.y1v(TypeScriptIrEmitter$emitGenerator$lambda_5(generatorOwnName, generatorRefs));
|
|
971
|
+
var tmp_6 = scope_2.q1v_1;
|
|
1784
972
|
isInterface(tmp_6, Element) || THROW_CCE();
|
|
1785
973
|
// Inline function 'kotlin.collections.filter' call
|
|
1786
974
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -1793,7 +981,7 @@ protoOf(TypeScriptIrEmitter).d1x = function (definition, module_0) {
|
|
|
1793
981
|
}
|
|
1794
982
|
}
|
|
1795
983
|
// Inline function 'kotlin.collections.map' call
|
|
1796
|
-
var this_3 = distinct_0(
|
|
984
|
+
var this_3 = distinct_0(plus(destination, generatorRefs));
|
|
1797
985
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1798
986
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_3, 10));
|
|
1799
987
|
var _iterator__ex2g4s_0 = this_3.t();
|
|
@@ -1823,10 +1011,10 @@ protoOf(TypeScriptIrEmitter).d1x = function (definition, module_0) {
|
|
|
1823
1011
|
destination_2.x(tmp$ret$18);
|
|
1824
1012
|
}
|
|
1825
1013
|
var modelImports = destination_2;
|
|
1826
|
-
var subPackageName =
|
|
1827
|
-
return new File(Companion_getInstance().
|
|
1014
|
+
var subPackageName = plus_2(Companion_instance.bs(''), 'generator');
|
|
1015
|
+
return new File(Companion_getInstance().x1g(subPackageName.es() + sanitizeSymbol(this, generatorFile.s1n_1.y1g())), plus(plus(plus(listOf_0(import_0('../Wirespec', 'Wirespec')), modelImports), generatorImports), generatorFile.t1n_1));
|
|
1828
1016
|
};
|
|
1829
|
-
protoOf(TypeScriptIrEmitter).
|
|
1017
|
+
protoOf(TypeScriptIrEmitter).vr = function (type, module_0) {
|
|
1830
1018
|
var fieldValidations = classifyValidatableFields(type, module_0);
|
|
1831
1019
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1832
1020
|
var this_0 = importReferences(type);
|
|
@@ -1835,7 +1023,7 @@ protoOf(TypeScriptIrEmitter).lq = function (type, module_0) {
|
|
|
1835
1023
|
var _iterator__ex2g4s = this_0.t();
|
|
1836
1024
|
while (_iterator__ex2g4s.u()) {
|
|
1837
1025
|
var e = _iterator__ex2g4s.v();
|
|
1838
|
-
var key = e.
|
|
1026
|
+
var key = e.dv_1;
|
|
1839
1027
|
if (set.x(key)) {
|
|
1840
1028
|
list.x(e);
|
|
1841
1029
|
}
|
|
@@ -1846,7 +1034,7 @@ protoOf(TypeScriptIrEmitter).lq = function (type, module_0) {
|
|
|
1846
1034
|
var _iterator__ex2g4s_0 = list.t();
|
|
1847
1035
|
while (_iterator__ex2g4s_0.u()) {
|
|
1848
1036
|
var item = _iterator__ex2g4s_0.v();
|
|
1849
|
-
var tmp$ret$2 = import_0('./' + item.
|
|
1037
|
+
var tmp$ret$2 = import_0('./' + item.dv_1, item.dv_1);
|
|
1850
1038
|
destination.x(tmp$ret$2);
|
|
1851
1039
|
}
|
|
1852
1040
|
var typeImports = destination;
|
|
@@ -1856,7 +1044,7 @@ protoOf(TypeScriptIrEmitter).lq = function (type, module_0) {
|
|
|
1856
1044
|
var _iterator__ex2g4s_1 = fieldValidations.t();
|
|
1857
1045
|
while (_iterator__ex2g4s_1.u()) {
|
|
1858
1046
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
1859
|
-
var tmp$ret$5 = item_0.
|
|
1047
|
+
var tmp$ret$5 = item_0.q1i_1;
|
|
1860
1048
|
destination_0.x(tmp$ret$5);
|
|
1861
1049
|
}
|
|
1862
1050
|
// Inline function 'kotlin.collections.filter' call
|
|
@@ -1866,7 +1054,7 @@ protoOf(TypeScriptIrEmitter).lq = function (type, module_0) {
|
|
|
1866
1054
|
var _iterator__ex2g4s_2 = tmp0.t();
|
|
1867
1055
|
while (_iterator__ex2g4s_2.u()) {
|
|
1868
1056
|
var element = _iterator__ex2g4s_2.v();
|
|
1869
|
-
if (!(element === type.
|
|
1057
|
+
if (!(element === type.vp_1.m1())) {
|
|
1870
1058
|
destination_1.x(element);
|
|
1871
1059
|
}
|
|
1872
1060
|
}
|
|
@@ -1880,32 +1068,32 @@ protoOf(TypeScriptIrEmitter).lq = function (type, module_0) {
|
|
|
1880
1068
|
destination_2.x(tmp$ret$11);
|
|
1881
1069
|
}
|
|
1882
1070
|
var validateImports = destination_2;
|
|
1883
|
-
var allImports =
|
|
1071
|
+
var allImports = plus(typeImports, validateImports);
|
|
1884
1072
|
// Inline function 'kotlin.collections.map' call
|
|
1885
|
-
var this_1 = type.
|
|
1073
|
+
var this_1 = type.wp_1.sp_1;
|
|
1886
1074
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1887
1075
|
var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1888
1076
|
var _iterator__ex2g4s_4 = this_1.t();
|
|
1889
1077
|
while (_iterator__ex2g4s_4.u()) {
|
|
1890
1078
|
var item_2 = _iterator__ex2g4s_4.v();
|
|
1891
|
-
var tmp$ret$14 = item_2.
|
|
1079
|
+
var tmp$ret$14 = item_2.aq_1.m1();
|
|
1892
1080
|
destination_3.x(tmp$ret$14);
|
|
1893
1081
|
}
|
|
1894
1082
|
var fieldNames = toSet(destination_3);
|
|
1895
|
-
var file = renameValidateAndBindObjReceiver(sanitizeNames(convertWithValidation(type, module_0), _get_modelSanitizationConfig__vgg831(this)), type.
|
|
1083
|
+
var file = renameValidateAndBindObjReceiver(sanitizeNames(convertWithValidation(type, module_0), _get_modelSanitizationConfig__vgg831(this)), type.vp_1.m1(), fieldNames);
|
|
1896
1084
|
var tmp;
|
|
1897
1085
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1898
1086
|
if (!allImports.r()) {
|
|
1899
|
-
tmp = file.
|
|
1087
|
+
tmp = file.w1n(VOID, plus(allImports, file.t1n_1));
|
|
1900
1088
|
} else {
|
|
1901
1089
|
tmp = file;
|
|
1902
1090
|
}
|
|
1903
1091
|
return tmp;
|
|
1904
1092
|
};
|
|
1905
|
-
protoOf(TypeScriptIrEmitter).
|
|
1093
|
+
protoOf(TypeScriptIrEmitter).tr = function (enum_0, module_0) {
|
|
1906
1094
|
return sanitizeNames(convert_0(enum_0), _get_sanitizationConfig__sns434(this));
|
|
1907
1095
|
};
|
|
1908
|
-
protoOf(TypeScriptIrEmitter).
|
|
1096
|
+
protoOf(TypeScriptIrEmitter).jr = function (union) {
|
|
1909
1097
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1910
1098
|
var this_0 = importReferences(union);
|
|
1911
1099
|
var set = HashSet_init_$Create$();
|
|
@@ -1913,7 +1101,7 @@ protoOf(TypeScriptIrEmitter).qr = function (union) {
|
|
|
1913
1101
|
var _iterator__ex2g4s = this_0.t();
|
|
1914
1102
|
while (_iterator__ex2g4s.u()) {
|
|
1915
1103
|
var e = _iterator__ex2g4s.v();
|
|
1916
|
-
var key = e.
|
|
1104
|
+
var key = e.dv_1;
|
|
1917
1105
|
if (set.x(key)) {
|
|
1918
1106
|
list.x(e);
|
|
1919
1107
|
}
|
|
@@ -1924,7 +1112,7 @@ protoOf(TypeScriptIrEmitter).qr = function (union) {
|
|
|
1924
1112
|
var _iterator__ex2g4s_0 = list.t();
|
|
1925
1113
|
while (_iterator__ex2g4s_0.u()) {
|
|
1926
1114
|
var item = _iterator__ex2g4s_0.v();
|
|
1927
|
-
var tmp$ret$2 = import_0('../model', item.
|
|
1115
|
+
var tmp$ret$2 = import_0('../model', item.dv_1, true);
|
|
1928
1116
|
destination.x(tmp$ret$2);
|
|
1929
1117
|
}
|
|
1930
1118
|
var imports = destination;
|
|
@@ -1932,19 +1120,19 @@ protoOf(TypeScriptIrEmitter).qr = function (union) {
|
|
|
1932
1120
|
var tmp;
|
|
1933
1121
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1934
1122
|
if (!imports.r()) {
|
|
1935
|
-
tmp = file.
|
|
1123
|
+
tmp = file.w1n(VOID, plus(imports, file.t1n_1));
|
|
1936
1124
|
} else {
|
|
1937
1125
|
tmp = file;
|
|
1938
1126
|
}
|
|
1939
1127
|
return tmp;
|
|
1940
1128
|
};
|
|
1941
|
-
protoOf(TypeScriptIrEmitter).
|
|
1129
|
+
protoOf(TypeScriptIrEmitter).or = function (refined) {
|
|
1942
1130
|
var converted = convert_2(refined);
|
|
1943
|
-
var constraintExpr = convertConstraint(refined.
|
|
1944
|
-
var validatorStr = TypeScriptGenerator_getInstance().
|
|
1945
|
-
return new File(converted.
|
|
1131
|
+
var constraintExpr = convertConstraint(refined.nr_1, new VariableReference(Companion_getInstance().x1g('value')));
|
|
1132
|
+
var validatorStr = TypeScriptGenerator_getInstance().a1x(constraintExpr);
|
|
1133
|
+
return new File(converted.s1n_1, listOf([new RawElement('export type ' + converted.s1n_1.y1g() + ' = ' + emitTypeScriptReference(this, refined.nr_1) + ';'), new RawElement('export const validate' + refined.mr_1.m1() + ' = (value: ' + emitTypeScriptReference(this, refined.nr_1) + ') =>\n ' + validatorStr + ';')]));
|
|
1946
1134
|
};
|
|
1947
|
-
protoOf(TypeScriptIrEmitter).
|
|
1135
|
+
protoOf(TypeScriptIrEmitter).ur = function (endpoint) {
|
|
1948
1136
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1949
1137
|
var this_0 = importReferences(endpoint);
|
|
1950
1138
|
var set = HashSet_init_$Create$();
|
|
@@ -1952,7 +1140,7 @@ protoOf(TypeScriptIrEmitter).bs = function (endpoint) {
|
|
|
1952
1140
|
var _iterator__ex2g4s = this_0.t();
|
|
1953
1141
|
while (_iterator__ex2g4s.u()) {
|
|
1954
1142
|
var e = _iterator__ex2g4s.v();
|
|
1955
|
-
var key = e.
|
|
1143
|
+
var key = e.dv_1;
|
|
1956
1144
|
if (set.x(key)) {
|
|
1957
1145
|
list.x(e);
|
|
1958
1146
|
}
|
|
@@ -1963,7 +1151,7 @@ protoOf(TypeScriptIrEmitter).bs = function (endpoint) {
|
|
|
1963
1151
|
var _iterator__ex2g4s_0 = list.t();
|
|
1964
1152
|
while (_iterator__ex2g4s_0.u()) {
|
|
1965
1153
|
var item = _iterator__ex2g4s_0.v();
|
|
1966
|
-
var tmp$ret$2 = import_0('../model', item.
|
|
1154
|
+
var tmp$ret$2 = import_0('../model', item.dv_1, true);
|
|
1967
1155
|
destination.x(tmp$ret$2);
|
|
1968
1156
|
}
|
|
1969
1157
|
var imports = destination;
|
|
@@ -1972,25 +1160,25 @@ protoOf(TypeScriptIrEmitter).bs = function (endpoint) {
|
|
|
1972
1160
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1973
1161
|
var this_1 = stripTrailingSpaceFromErrorMessage(convert_3(endpoint));
|
|
1974
1162
|
var scope = new TransformScope(this_1);
|
|
1975
|
-
scope.
|
|
1976
|
-
var tmp = scope.
|
|
1163
|
+
scope.v1v(transformPatternSwitchToValueSwitch());
|
|
1164
|
+
var tmp = scope.q1v_1;
|
|
1977
1165
|
var tmp$ret$7 = isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1978
1166
|
// Inline function 'kotlin.let' call
|
|
1979
|
-
var it = sanitizeNames(emit$injectApiConst(emit$applyCallParamsIfNeeded(tmp$ret$7, hasRequestParams), endpoint).
|
|
1167
|
+
var it = sanitizeNames(emit$injectApiConst(emit$applyCallParamsIfNeeded(tmp$ret$7, hasRequestParams), endpoint).w1n(Companion_getInstance().x1g(sanitize(this, endpoint.eq_1))), _get_sanitizationConfig__sns434(this));
|
|
1980
1168
|
var tmp_0;
|
|
1981
1169
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1982
1170
|
if (!imports.r()) {
|
|
1983
|
-
tmp_0 = it.
|
|
1171
|
+
tmp_0 = it.w1n(VOID, plus(imports, it.t1n_1));
|
|
1984
1172
|
} else {
|
|
1985
1173
|
tmp_0 = it;
|
|
1986
1174
|
}
|
|
1987
1175
|
return tmp_0;
|
|
1988
1176
|
};
|
|
1989
|
-
protoOf(TypeScriptIrEmitter).
|
|
1177
|
+
protoOf(TypeScriptIrEmitter).ir = function (channel) {
|
|
1990
1178
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1991
1179
|
};
|
|
1992
|
-
protoOf(TypeScriptIrEmitter).
|
|
1993
|
-
var endpointName = endpoint.
|
|
1180
|
+
protoOf(TypeScriptIrEmitter).l1w = function (endpoint) {
|
|
1181
|
+
var endpointName = endpoint.eq_1.m1();
|
|
1994
1182
|
var methodName = firstToLower(this, endpointName);
|
|
1995
1183
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1996
1184
|
var this_0 = importReferences(endpoint);
|
|
@@ -1999,7 +1187,7 @@ protoOf(TypeScriptIrEmitter).c1x = function (endpoint) {
|
|
|
1999
1187
|
var _iterator__ex2g4s = this_0.t();
|
|
2000
1188
|
while (_iterator__ex2g4s.u()) {
|
|
2001
1189
|
var e = _iterator__ex2g4s.v();
|
|
2002
|
-
var key = e.
|
|
1190
|
+
var key = e.dv_1;
|
|
2003
1191
|
if (set.x(key)) {
|
|
2004
1192
|
list.x(e);
|
|
2005
1193
|
}
|
|
@@ -2010,7 +1198,7 @@ protoOf(TypeScriptIrEmitter).c1x = function (endpoint) {
|
|
|
2010
1198
|
var _iterator__ex2g4s_0 = list.t();
|
|
2011
1199
|
while (_iterator__ex2g4s_0.u()) {
|
|
2012
1200
|
var item = _iterator__ex2g4s_0.v();
|
|
2013
|
-
var tmp$ret$2 = import_0('../model', item.
|
|
1201
|
+
var tmp$ret$2 = import_0('../model', item.dv_1, true);
|
|
2014
1202
|
destination.x(tmp$ret$2);
|
|
2015
1203
|
}
|
|
2016
1204
|
var imports = destination;
|
|
@@ -2032,50 +1220,50 @@ protoOf(TypeScriptIrEmitter).c1x = function (endpoint) {
|
|
|
2032
1220
|
}
|
|
2033
1221
|
var requestArgs = tmp_0;
|
|
2034
1222
|
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 ');
|
|
2035
|
-
var tmp_1 = Companion_getInstance().
|
|
1223
|
+
var tmp_1 = Companion_getInstance().x1g('client/' + endpointName + 'Client');
|
|
2036
1224
|
// Inline function 'kotlin.collections.buildList' call
|
|
2037
1225
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
2038
1226
|
// Inline function 'kotlin.apply' call
|
|
2039
1227
|
var this_1 = ArrayList_init_$Create$();
|
|
2040
1228
|
this_1.x(import_0('../Wirespec', 'Wirespec'));
|
|
2041
1229
|
this_1.x(import_0('../endpoint/' + endpointName, endpointName));
|
|
2042
|
-
this_1.
|
|
1230
|
+
this_1.g1(imports);
|
|
2043
1231
|
this_1.x(new RawElement(code));
|
|
2044
|
-
var tmp$ret$10 = this_1.
|
|
1232
|
+
var tmp$ret$10 = this_1.p5();
|
|
2045
1233
|
return new File(tmp_1, tmp$ret$10);
|
|
2046
1234
|
};
|
|
2047
|
-
protoOf(TypeScriptIrEmitter).
|
|
2048
|
-
logger.
|
|
1235
|
+
protoOf(TypeScriptIrEmitter).i1w = function (endpoints, logger) {
|
|
1236
|
+
logger.cr('Emitting main Client for ' + endpoints.b1() + ' endpoints');
|
|
2049
1237
|
// Inline function 'kotlin.collections.map' call
|
|
2050
1238
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2051
1239
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(endpoints, 10));
|
|
2052
1240
|
var _iterator__ex2g4s = endpoints.t();
|
|
2053
1241
|
while (_iterator__ex2g4s.u()) {
|
|
2054
1242
|
var item = _iterator__ex2g4s.v();
|
|
2055
|
-
var methodName = firstToLower(this, item.
|
|
2056
|
-
var tmp$ret$0 = import_0('./client/' + item.
|
|
1243
|
+
var methodName = firstToLower(this, item.eq_1.m1());
|
|
1244
|
+
var tmp$ret$0 = import_0('./client/' + item.eq_1.m1() + 'Client', methodName + 'Client');
|
|
2057
1245
|
destination.x(tmp$ret$0);
|
|
2058
1246
|
}
|
|
2059
1247
|
var clientImports = destination;
|
|
2060
1248
|
var spreadEntries = joinToString(endpoints, '\n', VOID, VOID, VOID, VOID, TypeScriptIrEmitter$emitClient$lambda(this));
|
|
2061
1249
|
var code = trimMargin('\n |export const client = (serialization: Wirespec.Serialization, transportation: Wirespec.Transportation) => ({\n |' + spreadEntries + '\n |})\n ');
|
|
2062
|
-
var tmp = Companion_getInstance().
|
|
1250
|
+
var tmp = Companion_getInstance().x1g('Client');
|
|
2063
1251
|
// Inline function 'kotlin.collections.buildList' call
|
|
2064
1252
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
2065
1253
|
// Inline function 'kotlin.apply' call
|
|
2066
1254
|
var this_0 = ArrayList_init_$Create$();
|
|
2067
1255
|
this_0.x(import_0('./Wirespec', 'Wirespec'));
|
|
2068
|
-
this_0.
|
|
1256
|
+
this_0.g1(clientImports);
|
|
2069
1257
|
this_0.x(new RawElement(code));
|
|
2070
|
-
var tmp$ret$6 = this_0.
|
|
1258
|
+
var tmp$ret$6 = this_0.p5();
|
|
2071
1259
|
return new File(tmp, tmp$ret$6);
|
|
2072
1260
|
};
|
|
2073
1261
|
function transformPatternSwitchToValueSwitch() {
|
|
2074
1262
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2075
1263
|
// Inline function 'kotlin.apply' call
|
|
2076
1264
|
var this_0 = new TransformerBuilder();
|
|
2077
|
-
this_0.
|
|
2078
|
-
return this_0.
|
|
1265
|
+
this_0.x1v(transformPatternSwitchToValueSwitch$lambda);
|
|
1266
|
+
return this_0.l1i();
|
|
2079
1267
|
}
|
|
2080
1268
|
function renameValidateAndBindObjReceiver(_this__u8e3s4, typeName, fieldNames) {
|
|
2081
1269
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -2083,19 +1271,19 @@ function renameValidateAndBindObjReceiver(_this__u8e3s4, typeName, fieldNames) {
|
|
|
2083
1271
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
2084
1272
|
var tmp = scope;
|
|
2085
1273
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
2086
|
-
var this_0 = scope.
|
|
1274
|
+
var this_0 = scope.q1v_1;
|
|
2087
1275
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2088
1276
|
// Inline function 'kotlin.apply' call
|
|
2089
1277
|
var this_1 = new TransformerBuilder();
|
|
2090
|
-
this_1.
|
|
2091
|
-
var tmp$ret$2 = this_1.
|
|
2092
|
-
tmp.
|
|
2093
|
-
var tmp_0 = scope.
|
|
1278
|
+
this_1.k1i(renameValidateAndBindObjReceiver$lambda(typeName, fieldNames));
|
|
1279
|
+
var tmp$ret$2 = this_1.l1i();
|
|
1280
|
+
tmp.q1v_1 = transform(this_0, tmp$ret$2);
|
|
1281
|
+
var tmp_0 = scope.q1v_1;
|
|
2094
1282
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2095
1283
|
}
|
|
2096
1284
|
function buildApiConst(endpoint) {
|
|
2097
1285
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
2098
|
-
var this_0 = endpoint.
|
|
1286
|
+
var this_0 = endpoint.eq_1.m1();
|
|
2099
1287
|
var tmp;
|
|
2100
1288
|
// Inline function 'kotlin.text.isNotEmpty' call
|
|
2101
1289
|
if (charSequenceLength(this_0) > 0) {
|
|
@@ -2103,14 +1291,14 @@ function buildApiConst(endpoint) {
|
|
|
2103
1291
|
var this_1 = charCodeAt(this_0, 0);
|
|
2104
1292
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2105
1293
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
2106
|
-
var tmp$ret$4 =
|
|
2107
|
-
tmp =
|
|
1294
|
+
var tmp$ret$4 = toString(this_1).toLowerCase();
|
|
1295
|
+
tmp = toString_0(tmp$ret$4) + substring(this_0, 1);
|
|
2108
1296
|
} else {
|
|
2109
1297
|
tmp = this_0;
|
|
2110
1298
|
}
|
|
2111
1299
|
var apiName = tmp;
|
|
2112
|
-
var method = endpoint.
|
|
2113
|
-
var pathString = joinToString(endpoint.
|
|
1300
|
+
var method = endpoint.fq_1.b3_1;
|
|
1301
|
+
var pathString = joinToString(endpoint.gq_1, '/', VOID, VOID, VOID, VOID, buildApiConst$lambda);
|
|
2114
1302
|
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 '));
|
|
2115
1303
|
}
|
|
2116
1304
|
function bindCallToRequestParams(_this__u8e3s4) {
|
|
@@ -2119,21 +1307,21 @@ function bindCallToRequestParams(_this__u8e3s4) {
|
|
|
2119
1307
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
2120
1308
|
var tmp = scope;
|
|
2121
1309
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
2122
|
-
var this_0 = scope.
|
|
1310
|
+
var this_0 = scope.q1v_1;
|
|
2123
1311
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2124
1312
|
// Inline function 'kotlin.apply' call
|
|
2125
1313
|
var this_1 = new TransformerBuilder();
|
|
2126
|
-
this_1.
|
|
2127
|
-
var tmp$ret$2 = this_1.
|
|
2128
|
-
tmp.
|
|
2129
|
-
var tmp_0 = scope.
|
|
1314
|
+
this_1.k1i(bindCallToRequestParams$lambda);
|
|
1315
|
+
var tmp$ret$2 = this_1.l1i();
|
|
1316
|
+
tmp.q1v_1 = transform(this_0, tmp$ret$2);
|
|
1317
|
+
var tmp_0 = scope.q1v_1;
|
|
2130
1318
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2131
1319
|
}
|
|
2132
1320
|
function stripTrailingSpaceFromErrorMessage(_this__u8e3s4) {
|
|
2133
1321
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2134
1322
|
var scope = new TransformScope(_this__u8e3s4);
|
|
2135
|
-
scope.
|
|
2136
|
-
var tmp = scope.
|
|
1323
|
+
scope.x1v(stripTrailingSpaceFromErrorMessage$lambda);
|
|
1324
|
+
var tmp = scope.q1v_1;
|
|
2137
1325
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
2138
1326
|
}
|
|
2139
1327
|
function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
@@ -2141,7 +1329,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2141
1329
|
if (!(stmt instanceof Switch)) {
|
|
2142
1330
|
tmp = true;
|
|
2143
1331
|
} else {
|
|
2144
|
-
var tmp0 = stmt.
|
|
1332
|
+
var tmp0 = stmt.u1q_1;
|
|
2145
1333
|
var tmp$ret$0;
|
|
2146
1334
|
$l$block_0: {
|
|
2147
1335
|
// Inline function 'kotlin.collections.none' call
|
|
@@ -2158,7 +1346,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2158
1346
|
var _iterator__ex2g4s = tmp0.t();
|
|
2159
1347
|
while (_iterator__ex2g4s.u()) {
|
|
2160
1348
|
var element = _iterator__ex2g4s.v();
|
|
2161
|
-
if (!(element.
|
|
1349
|
+
if (!(element.b1r_1 == null)) {
|
|
2162
1350
|
tmp$ret$0 = false;
|
|
2163
1351
|
break $l$block_0;
|
|
2164
1352
|
}
|
|
@@ -2169,11 +1357,11 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2169
1357
|
}
|
|
2170
1358
|
if (tmp)
|
|
2171
1359
|
return transformChildren(stmt, tr);
|
|
2172
|
-
var tmp0_safe_receiver = stmt.
|
|
2173
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1360
|
+
var tmp0_safe_receiver = stmt.w1q_1;
|
|
1361
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.j1m();
|
|
2174
1362
|
var varName = tmp1_elvis_lhs == null ? 'r' : tmp1_elvis_lhs;
|
|
2175
1363
|
// Inline function 'kotlin.collections.map' call
|
|
2176
|
-
var this_0 = stmt.
|
|
1364
|
+
var this_0 = stmt.u1q_1;
|
|
2177
1365
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2178
1366
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2179
1367
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
@@ -2181,48 +1369,48 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2181
1369
|
var item = _iterator__ex2g4s_0.v();
|
|
2182
1370
|
var tmp$ret$5;
|
|
2183
1371
|
$l$block_1: {
|
|
2184
|
-
var tmp_1 = item.
|
|
2185
|
-
var tmp0_safe_receiver_0 = tmp_1 instanceof
|
|
2186
|
-
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.
|
|
2187
|
-
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
1372
|
+
var tmp_1 = item.b1r_1;
|
|
1373
|
+
var tmp0_safe_receiver_0 = tmp_1 instanceof Custom ? tmp_1 : null;
|
|
1374
|
+
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.u1i_1;
|
|
1375
|
+
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.y1g();
|
|
2188
1376
|
var tmp3_safe_receiver = typeName == null ? null : substringAfterLast(typeName, '.');
|
|
2189
1377
|
var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : removePrefix(tmp3_safe_receiver, 'Response');
|
|
2190
1378
|
var statusNum = tmp4_safe_receiver == null ? null : toIntOrNull(tmp4_safe_receiver);
|
|
2191
|
-
if (statusNum == null
|
|
1379
|
+
if (statusNum == null) {
|
|
2192
1380
|
// Inline function 'kotlin.collections.map' call
|
|
2193
|
-
var this_1 = item.
|
|
1381
|
+
var this_1 = item.a1r_1;
|
|
2194
1382
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2195
1383
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
2196
1384
|
var _iterator__ex2g4s_1 = this_1.t();
|
|
2197
1385
|
while (_iterator__ex2g4s_1.u()) {
|
|
2198
1386
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
2199
|
-
var tmp$ret$2 = tr.
|
|
1387
|
+
var tmp$ret$2 = tr.k1v(item_0);
|
|
2200
1388
|
destination_0.x(tmp$ret$2);
|
|
2201
1389
|
}
|
|
2202
|
-
tmp$ret$5 = item.
|
|
1390
|
+
tmp$ret$5 = item.d1r(VOID, destination_0);
|
|
2203
1391
|
break $l$block_1;
|
|
2204
1392
|
}
|
|
2205
|
-
var exprCode = TypeScriptGenerator_getInstance().
|
|
2206
|
-
var castAssignment = new Assignment(Companion_getInstance().
|
|
2207
|
-
var tmp_2 = new
|
|
1393
|
+
var exprCode = TypeScriptGenerator_getInstance().a1x(tr.l1v(stmt.t1q_1));
|
|
1394
|
+
var castAssignment = new Assignment(Companion_getInstance().x1g(varName), new RawExpression(exprCode + ' as ' + typeName), false);
|
|
1395
|
+
var tmp_2 = new Literal(statusNum, new Integer());
|
|
2208
1396
|
var tmp_3 = listOf_0(castAssignment);
|
|
2209
1397
|
// Inline function 'kotlin.collections.map' call
|
|
2210
|
-
var this_2 = item.
|
|
1398
|
+
var this_2 = item.a1r_1;
|
|
2211
1399
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2212
1400
|
var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
|
|
2213
1401
|
var _iterator__ex2g4s_2 = this_2.t();
|
|
2214
1402
|
while (_iterator__ex2g4s_2.u()) {
|
|
2215
1403
|
var item_1 = _iterator__ex2g4s_2.v();
|
|
2216
|
-
var tmp$ret$6 = tr.
|
|
1404
|
+
var tmp$ret$6 = tr.k1v(item_1);
|
|
2217
1405
|
destination_1.x(tmp$ret$6);
|
|
2218
1406
|
}
|
|
2219
|
-
tmp$ret$5 = new Case(tmp_2,
|
|
1407
|
+
tmp$ret$5 = new Case(tmp_2, plus(tmp_3, destination_1), null);
|
|
2220
1408
|
}
|
|
2221
1409
|
destination.x(tmp$ret$5);
|
|
2222
1410
|
}
|
|
2223
1411
|
var transformedCases = destination;
|
|
2224
|
-
var tmp_4 = new FieldCall(tr.
|
|
2225
|
-
var tmp2_safe_receiver = stmt.
|
|
1412
|
+
var tmp_4 = new FieldCall(tr.l1v(stmt.t1q_1), Companion_getInstance().x1g('status'));
|
|
1413
|
+
var tmp2_safe_receiver = stmt.v1q_1;
|
|
2226
1414
|
var tmp_5;
|
|
2227
1415
|
if (tmp2_safe_receiver == null) {
|
|
2228
1416
|
tmp_5 = null;
|
|
@@ -2233,7 +1421,7 @@ function transformPatternSwitchToValueSwitch$lambda(stmt, tr) {
|
|
|
2233
1421
|
var _iterator__ex2g4s_3 = tmp2_safe_receiver.t();
|
|
2234
1422
|
while (_iterator__ex2g4s_3.u()) {
|
|
2235
1423
|
var item_2 = _iterator__ex2g4s_3.v();
|
|
2236
|
-
var tmp$ret$11 = tr.
|
|
1424
|
+
var tmp$ret$11 = tr.k1v(item_2);
|
|
2237
1425
|
destination_2.x(tmp$ret$11);
|
|
2238
1426
|
}
|
|
2239
1427
|
tmp_5 = destination_2;
|
|
@@ -2244,46 +1432,34 @@ function renameValidateAndBindObjReceiver$lambda$lambda($fieldNames) {
|
|
|
2244
1432
|
return function (s, t) {
|
|
2245
1433
|
var tmp;
|
|
2246
1434
|
var tmp_0;
|
|
2247
|
-
var tmp_1;
|
|
2248
|
-
var tmp_2;
|
|
2249
1435
|
if (s instanceof FunctionCall) {
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
}
|
|
2259
|
-
if (tmp_1) {
|
|
2260
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
2261
|
-
tmp_0 = !s.n1n_1.r();
|
|
1436
|
+
var tmp_1;
|
|
1437
|
+
if (s.t1m_1.equals(Companion_getInstance().x1g('validate')) && !(s.r1m_1 == null)) {
|
|
1438
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1439
|
+
tmp_1 = !s.s1m_1.r();
|
|
1440
|
+
} else {
|
|
1441
|
+
tmp_1 = false;
|
|
1442
|
+
}
|
|
1443
|
+
tmp_0 = tmp_1;
|
|
2262
1444
|
} else {
|
|
2263
1445
|
tmp_0 = false;
|
|
2264
1446
|
}
|
|
2265
1447
|
if (tmp_0) {
|
|
2266
|
-
var
|
|
2267
|
-
var
|
|
2268
|
-
var
|
|
2269
|
-
var
|
|
2270
|
-
var tn =
|
|
2271
|
-
tmp = new FunctionCall(VOID, VOID, Companion_getInstance().
|
|
1448
|
+
var tmp_2 = first(s.s1m_1);
|
|
1449
|
+
var tmp1_safe_receiver = tmp_2 instanceof Custom ? tmp_2 : null;
|
|
1450
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.u1i_1;
|
|
1451
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.y1g();
|
|
1452
|
+
var tn = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs;
|
|
1453
|
+
tmp = new FunctionCall(VOID, VOID, Companion_getInstance().x1g('validate' + tn), mapOf(to(Companion_getInstance().x1g('obj'), t.l1v(ensureNotNull(s.r1m_1)))));
|
|
2272
1454
|
} else {
|
|
2273
|
-
var
|
|
2274
|
-
var tmp_5;
|
|
1455
|
+
var tmp_3;
|
|
2275
1456
|
if (s instanceof FieldCall) {
|
|
2276
|
-
|
|
2277
|
-
} else {
|
|
2278
|
-
tmp_5 = false;
|
|
2279
|
-
}
|
|
2280
|
-
if (tmp_5) {
|
|
2281
|
-
tmp_4 = $fieldNames.u1(s.q1r_1.e1n());
|
|
1457
|
+
tmp_3 = (s.e1r_1 == null && $fieldNames.v1(s.f1r_1.j1m()));
|
|
2282
1458
|
} else {
|
|
2283
|
-
|
|
1459
|
+
tmp_3 = false;
|
|
2284
1460
|
}
|
|
2285
|
-
if (
|
|
2286
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().
|
|
1461
|
+
if (tmp_3) {
|
|
1462
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().x1g('obj')), s.f1r_1);
|
|
2287
1463
|
} else {
|
|
2288
1464
|
tmp = transformChildren(s, t);
|
|
2289
1465
|
}
|
|
@@ -2297,15 +1473,15 @@ function renameValidateAndBindObjReceiver$lambda($typeName, $fieldNames) {
|
|
|
2297
1473
|
if (element instanceof Function) {
|
|
2298
1474
|
var tmp$ret$0;
|
|
2299
1475
|
$l$block: {
|
|
2300
|
-
if (!element.
|
|
1476
|
+
if (!element.u1k_1.equals(Companion_getInstance().x1g('validate'))) {
|
|
2301
1477
|
tmp$ret$0 = element;
|
|
2302
1478
|
break $l$block;
|
|
2303
1479
|
}
|
|
2304
1480
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2305
|
-
var this_0 = element.
|
|
1481
|
+
var this_0 = element.f1l(Companion_getInstance().x1g('validate' + $typeName), VOID, listOf_0(new Parameter(Companion_getInstance().x1g('obj'), Custom_init_$Create$($typeName))));
|
|
2306
1482
|
var scope = new TransformScope(this_0);
|
|
2307
|
-
scope.
|
|
2308
|
-
var tmp_0 = scope.
|
|
1483
|
+
scope.z1v(renameValidateAndBindObjReceiver$lambda$lambda($fieldNames));
|
|
1484
|
+
var tmp_0 = scope.q1v_1;
|
|
2309
1485
|
tmp$ret$0 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2310
1486
|
}
|
|
2311
1487
|
tmp = tmp$ret$0;
|
|
@@ -2318,11 +1494,11 @@ function renameValidateAndBindObjReceiver$lambda($typeName, $fieldNames) {
|
|
|
2318
1494
|
}
|
|
2319
1495
|
function buildApiConst$lambda(it) {
|
|
2320
1496
|
var tmp;
|
|
2321
|
-
if (it instanceof
|
|
2322
|
-
tmp = it.
|
|
1497
|
+
if (it instanceof Literal_0) {
|
|
1498
|
+
tmp = it.tt_1;
|
|
2323
1499
|
} else {
|
|
2324
1500
|
if (it instanceof Param) {
|
|
2325
|
-
tmp = '{' + it.
|
|
1501
|
+
tmp = '{' + it.lq_1.m1() + '}';
|
|
2326
1502
|
} else {
|
|
2327
1503
|
noWhenBranchMatchedException();
|
|
2328
1504
|
}
|
|
@@ -2334,23 +1510,23 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
2334
1510
|
if (element instanceof Interface) {
|
|
2335
1511
|
var tmp$ret$0;
|
|
2336
1512
|
$l$block: {
|
|
2337
|
-
if (!element.
|
|
1513
|
+
if (!element.e1o_1.equals(Companion_getInstance().x1g('Call'))) {
|
|
2338
1514
|
tmp$ret$0 = element;
|
|
2339
1515
|
break $l$block;
|
|
2340
1516
|
}
|
|
2341
1517
|
// Inline function 'kotlin.collections.map' call
|
|
2342
|
-
var this_0 = element.
|
|
1518
|
+
var this_0 = element.f1o_1;
|
|
2343
1519
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2344
1520
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2345
1521
|
var _iterator__ex2g4s = this_0.t();
|
|
2346
1522
|
while (_iterator__ex2g4s.u()) {
|
|
2347
1523
|
var item = _iterator__ex2g4s.v();
|
|
2348
1524
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
2349
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1525
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.f1l(VOID, VOID, listOf_0(new Parameter(Companion_getInstance().x1g('params'), Custom_init_$Create$('RequestParams'))));
|
|
2350
1526
|
var tmp$ret$1 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
2351
1527
|
destination.x(tmp$ret$1);
|
|
2352
1528
|
}
|
|
2353
|
-
tmp$ret$0 = element.
|
|
1529
|
+
tmp$ret$0 = element.m1o(VOID, destination);
|
|
2354
1530
|
}
|
|
2355
1531
|
tmp = tmp$ret$0;
|
|
2356
1532
|
} else {
|
|
@@ -2362,7 +1538,7 @@ function bindCallToRequestParams$lambda(element, transformer) {
|
|
|
2362
1538
|
function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
2363
1539
|
var tmp;
|
|
2364
1540
|
if (stmt instanceof Switch) {
|
|
2365
|
-
var tmp1_safe_receiver = stmt.
|
|
1541
|
+
var tmp1_safe_receiver = stmt.v1q_1;
|
|
2366
1542
|
var tmp_0;
|
|
2367
1543
|
if (tmp1_safe_receiver == null) {
|
|
2368
1544
|
tmp_0 = null;
|
|
@@ -2384,7 +1560,7 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2384
1560
|
tmp_1 = tmp0_elvis_lhs;
|
|
2385
1561
|
}
|
|
2386
1562
|
var errorStmt = tmp_1;
|
|
2387
|
-
var tmp_2 = errorStmt.
|
|
1563
|
+
var tmp_2 = errorStmt.n1r_1;
|
|
2388
1564
|
var tmp1_elvis_lhs = tmp_2 instanceof BinaryOp ? tmp_2 : null;
|
|
2389
1565
|
var tmp_3;
|
|
2390
1566
|
if (tmp1_elvis_lhs == null) {
|
|
@@ -2394,8 +1570,8 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2394
1570
|
tmp_3 = tmp1_elvis_lhs;
|
|
2395
1571
|
}
|
|
2396
1572
|
var binary = tmp_3;
|
|
2397
|
-
var tmp_4 = binary.
|
|
2398
|
-
var tmp2_elvis_lhs = tmp_4 instanceof
|
|
1573
|
+
var tmp_4 = binary.o1r_1;
|
|
1574
|
+
var tmp2_elvis_lhs = tmp_4 instanceof Literal ? tmp_4 : null;
|
|
2399
1575
|
var tmp_5;
|
|
2400
1576
|
if (tmp2_elvis_lhs == null) {
|
|
2401
1577
|
tmp$ret$0 = item;
|
|
@@ -2404,81 +1580,25 @@ function stripTrailingSpaceFromErrorMessage$lambda(stmt, transformer) {
|
|
|
2404
1580
|
tmp_5 = tmp2_elvis_lhs;
|
|
2405
1581
|
}
|
|
2406
1582
|
var literal = tmp_5;
|
|
2407
|
-
tmp$ret$0 = new ErrorStatement(new
|
|
1583
|
+
tmp$ret$0 = new ErrorStatement(new Literal(trimEnd(toString_0(literal.p1q_1), charArrayOf([_Char___init__impl__6a9atx(32)])), literal.q1q_1));
|
|
2408
1584
|
}
|
|
2409
1585
|
destination.x(tmp$ret$0);
|
|
2410
1586
|
}
|
|
2411
1587
|
tmp_0 = destination;
|
|
2412
1588
|
}
|
|
2413
|
-
tmp = transformChildren(stmt.
|
|
1589
|
+
tmp = transformChildren(stmt.y1q(VOID, VOID, tmp_0), transformer);
|
|
2414
1590
|
} else {
|
|
2415
1591
|
tmp = transformChildren(stmt, transformer);
|
|
2416
1592
|
}
|
|
2417
1593
|
return tmp;
|
|
2418
1594
|
}
|
|
2419
|
-
function TypeScriptRefinedTypeDefinitionEmitter() {
|
|
2420
|
-
}
|
|
2421
|
-
function TypeScriptShared() {
|
|
2422
|
-
TypeScriptShared_instance = this;
|
|
2423
|
-
this.w21_1 = 'community.flock.wirespec';
|
|
2424
|
-
this.x21_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 ');
|
|
2425
|
-
}
|
|
2426
|
-
protoOf(TypeScriptShared).toString = function () {
|
|
2427
|
-
return 'TypeScriptShared';
|
|
2428
|
-
};
|
|
2429
|
-
protoOf(TypeScriptShared).hashCode = function () {
|
|
2430
|
-
return -646698634;
|
|
2431
|
-
};
|
|
2432
|
-
protoOf(TypeScriptShared).equals = function (other) {
|
|
2433
|
-
if (this === other)
|
|
2434
|
-
return true;
|
|
2435
|
-
if (!(other instanceof TypeScriptShared))
|
|
2436
|
-
return false;
|
|
2437
|
-
return true;
|
|
2438
|
-
};
|
|
2439
|
-
var TypeScriptShared_instance;
|
|
2440
|
-
function TypeScriptShared_getInstance() {
|
|
2441
|
-
if (TypeScriptShared_instance == null)
|
|
2442
|
-
new TypeScriptShared();
|
|
2443
|
-
return TypeScriptShared_instance;
|
|
2444
|
-
}
|
|
2445
|
-
function TypeScriptTypeDefinitionEmitter$sanitizeSymbol$lambda(it) {
|
|
2446
|
-
return isLetterOrDigit(it.h1_1) || listOf_0(new Char(_Char___init__impl__6a9atx(95))).u1(it);
|
|
2447
|
-
}
|
|
2448
|
-
function TypeScriptTypeDefinitionEmitter$emit$lambda(it) {
|
|
2449
|
-
// Inline function 'kotlin.text.trimStart' call
|
|
2450
|
-
return toString(trimStart(isCharSequence(it) ? it : THROW_CCE()));
|
|
2451
|
-
}
|
|
2452
|
-
function TypeScriptTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2453
|
-
return function (it) {
|
|
2454
|
-
return this$0.nq(it);
|
|
2455
|
-
};
|
|
2456
|
-
}
|
|
2457
|
-
function TypeScriptTypeDefinitionEmitter() {
|
|
2458
|
-
}
|
|
2459
1595
|
//region block: post-declaration
|
|
2460
|
-
protoOf(
|
|
2461
|
-
protoOf(
|
|
2462
|
-
protoOf(
|
|
2463
|
-
protoOf(TypeScriptEmitter).oq = emit_4;
|
|
2464
|
-
protoOf(TypeScriptEmitter).pq = emit_5;
|
|
2465
|
-
protoOf(TypeScriptEmitter).as = emit_8;
|
|
2466
|
-
protoOf(TypeScriptEmitter).vr = emit_9;
|
|
2467
|
-
protoOf(TypeScriptEmitter).bs = emit_10;
|
|
2468
|
-
protoOf(TypeScriptEmitter).or = emit_2;
|
|
2469
|
-
protoOf(TypeScriptEmitter).cs = emitValidator;
|
|
2470
|
-
protoOf(TypeScriptEmitter).r21 = sanitizeSymbol;
|
|
2471
|
-
protoOf(TypeScriptEmitter).h1y = sanitizeSymbol_0;
|
|
2472
|
-
protoOf(TypeScriptEmitter).s21 = emitPrimitive;
|
|
2473
|
-
protoOf(TypeScriptEmitter).q21 = emitClient;
|
|
2474
|
-
protoOf(TypeScriptEmitter).rq = emitClientEndpointRequest;
|
|
2475
|
-
protoOf(TypeScriptIrEmitter).w1w = get_extensions;
|
|
2476
|
-
protoOf(TypeScriptIrEmitter).x1w = emit_1;
|
|
2477
|
-
protoOf(TypeScriptIrEmitter).b1x = beforeGenerate;
|
|
1596
|
+
protoOf(TypeScriptIrEmitter).f1w = get_extensions;
|
|
1597
|
+
protoOf(TypeScriptIrEmitter).g1w = emit_1;
|
|
1598
|
+
protoOf(TypeScriptIrEmitter).k1w = beforeGenerate;
|
|
2478
1599
|
//endregion
|
|
2479
1600
|
//region block: exports
|
|
2480
1601
|
export {
|
|
2481
|
-
TypeScriptEmitter as TypeScriptEmitter1b8xo1btx35xi,
|
|
2482
1602
|
TypeScriptIrEmitter as TypeScriptIrEmitter3q01omscsvyj9,
|
|
2483
1603
|
};
|
|
2484
1604
|
//endregion
|