@flock/wirespec 0.20.0-RC.9 → 0.21.0
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 +1571 -1571
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +444 -444
- package/kotlin-kotlin-stdlib.mjs +2001 -1948
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10257 -10257
- package/kotlin-rgxgen.mjs +1819 -1819
- package/kotlinx-io-kotlinx-io-core.mjs +440 -440
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1890 -1890
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1576 -1576
- package/mordant-mordant.mjs +1362 -1362
- package/package.json +2 -2
- package/wirespec-src-compiler-core.mjs +2462 -2388
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +482 -1337
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +376 -1060
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +424 -1417
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +479 -417
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +224 -184
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +568 -1404
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +113 -86
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +4311 -4417
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +352 -1141
- 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 +772 -760
- 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 +15 -104
- package/wirespec-src-plugin-npm.mjs +40 -40
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +40 -35
- package/wirespec-src-tools-generator.mjs.map +1 -1
|
@@ -1,1130 +1,183 @@
|
|
|
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
|
-
injectSelfReceiverToValidate4xgr9r5gl5n3 as injectSelfReceiverToValidate,
|
|
163
|
-
convert11ert2po54h1y as convert_0,
|
|
164
|
-
sanitizeEnumEntries3pphrvzq8r9fn as sanitizeEnumEntries,
|
|
165
|
-
convert37aabdzvtv9vg as convert_1,
|
|
166
|
-
convert17zcptkz4mhr4 as convert_2,
|
|
167
|
-
convert32tuiui3czihh as convert_3,
|
|
168
|
-
convert1cn4bolzoed8c as convert_4,
|
|
169
|
-
emitEndpointClient1meajc90wf3el as emitEndpointClient,
|
|
170
|
-
emitClient32kfwzg2hm5vj as emitClient,
|
|
171
|
-
get_extensions31c4or738wbxz as get_extensions,
|
|
172
|
-
emit1oxjujel6f3jb as emit_1,
|
|
173
|
-
beforeGenerate3o8idb3hey1b0 as beforeGenerate,
|
|
174
|
-
IrEmitterh2m93ojzvkep as IrEmitter,
|
|
175
|
-
TransformerBuildera6a1gvlhjj9b as TransformerBuilder,
|
|
176
|
-
transform3eti8i2bqvifx as transform,
|
|
177
|
-
Namespace345pal554qu3j as Namespace,
|
|
178
|
-
Union38f3pecvfcpxh as Union_0,
|
|
179
|
-
Struct39wf79cwtn4ty as Struct,
|
|
180
|
-
fieldList3dg35dj9v5h4v as fieldList,
|
|
181
|
-
Dict22iqrhoo0g8et as Dict_0,
|
|
182
|
-
Array2goj74t0aak7b as Array_0,
|
|
183
|
-
Nullable3wjn6l6q3h6o as Nullable,
|
|
184
|
-
Any_instance2998xag3cdzh3 as Any_instance,
|
|
185
|
-
Custom_init_$Create$2enn7oyj71j1t as Custom_init_$Create$,
|
|
186
|
-
Reflect_instance3i17lxiopj78t as Reflect_instance,
|
|
187
|
-
Field354s1ceh5pvhf as Field,
|
|
188
|
-
transformChildrend9p91tpcqdkx as transformChildren_1,
|
|
189
|
-
Boolean_instance27opaqtiiiysz as Boolean_instance_0,
|
|
190
|
-
String_instance3uxvo48ki208u as String_instance,
|
|
191
|
-
Function21cuq8qizkin7 as Function,
|
|
192
|
-
function12vu2kapzno4w as function_0,
|
|
193
|
-
VariableReference2vlynnhaw1i64 as VariableReference,
|
|
194
|
-
FieldCall1iz7z2fx2xo4p as FieldCall,
|
|
195
|
-
convertConstraintkgpvomct0x0s as convertConstraint,
|
|
196
|
-
Interface3pn84xq686t2r as Interface,
|
|
197
|
-
Custom2si7lto3wompr as Custom_0,
|
|
198
|
-
Parameteruqoxd4rzw7ga as Parameter,
|
|
199
|
-
FunctionCall30872kpnbr7op as FunctionCall,
|
|
200
|
-
} from './wirespec-src-compiler-ir.mjs';
|
|
201
|
-
//region block: imports
|
|
202
|
-
//endregion
|
|
203
|
-
//region block: pre-declaration
|
|
204
|
-
function emit_2(channel) {
|
|
205
|
-
return '';
|
|
206
|
-
}
|
|
207
|
-
initMetadataForInterface(PythonChannelDefinitionEmitter, 'PythonChannelDefinitionEmitter');
|
|
208
|
-
initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
|
|
209
|
-
function emit_3(identifier) {
|
|
210
|
-
var tmp;
|
|
211
|
-
if (identifier instanceof DefinitionIdentifier) {
|
|
212
|
-
tmp = this.v1y(identifier);
|
|
213
|
-
} else {
|
|
214
|
-
if (identifier instanceof FieldIdentifier) {
|
|
215
|
-
tmp = this.l1y(this.v1y(identifier));
|
|
216
|
-
} else {
|
|
217
|
-
noWhenBranchMatchedException();
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
return tmp;
|
|
221
|
-
}
|
|
222
|
-
function sanitize(_this__u8e3s4) {
|
|
223
|
-
// Inline function 'kotlin.collections.mapIndexed' call
|
|
224
|
-
var this_0 = split(_this__u8e3s4.l1(), ['.', ' ']);
|
|
225
|
-
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
226
|
-
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
227
|
-
var index = 0;
|
|
228
|
-
var _iterator__ex2g4s = this_0.t();
|
|
229
|
-
while (_iterator__ex2g4s.u()) {
|
|
230
|
-
var item = _iterator__ex2g4s.v();
|
|
231
|
-
var _unary__edvuaz = index;
|
|
232
|
-
index = _unary__edvuaz + 1 | 0;
|
|
233
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.fr(item) : item;
|
|
234
|
-
destination.x(tmp$ret$0);
|
|
235
|
-
}
|
|
236
|
-
// Inline function 'kotlin.text.filter' call
|
|
237
|
-
var tmp0 = joinToString(destination, '');
|
|
238
|
-
// Inline function 'kotlin.text.filterTo' call
|
|
239
|
-
var destination_0 = StringBuilder_init_$Create$();
|
|
240
|
-
var inductionVariable = 0;
|
|
241
|
-
var last = charSequenceLength(tmp0);
|
|
242
|
-
if (inductionVariable < last)
|
|
243
|
-
do {
|
|
244
|
-
var index_0 = inductionVariable;
|
|
245
|
-
inductionVariable = inductionVariable + 1 | 0;
|
|
246
|
-
var element = charSequenceGet(tmp0, index_0);
|
|
247
|
-
if (isLetterOrDigit(element) || element === _Char___init__impl__6a9atx(95)) {
|
|
248
|
-
destination_0.s(element);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
while (inductionVariable < last);
|
|
252
|
-
// Inline function 'kotlin.let' call
|
|
253
|
-
var it = destination_0.toString();
|
|
254
|
-
var tmp;
|
|
255
|
-
var tmp0_safe_receiver = firstOrNull(it);
|
|
256
|
-
var tmp_0;
|
|
257
|
-
var tmp_1 = tmp0_safe_receiver;
|
|
258
|
-
if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
|
|
259
|
-
tmp_0 = null;
|
|
260
|
-
} else {
|
|
261
|
-
tmp_0 = isDigit(tmp0_safe_receiver);
|
|
262
|
-
}
|
|
263
|
-
if (tmp_0 === true) {
|
|
264
|
-
tmp = '_' + it;
|
|
265
|
-
} else {
|
|
266
|
-
tmp = it;
|
|
267
|
-
}
|
|
268
|
-
return tmp;
|
|
269
|
-
}
|
|
270
|
-
function sanitizeKeywords(_this__u8e3s4) {
|
|
271
|
-
return Companion_getInstance_0().f20_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
272
|
-
}
|
|
273
|
-
initMetadataForInterface(PythonIdentifierEmitter, 'PythonIdentifierEmitter');
|
|
274
|
-
function emit_4(type, module_0) {
|
|
275
|
-
var tmp;
|
|
276
|
-
if (type.np_1.jp_1.r()) {
|
|
277
|
-
var tmp_0 = this.or(type.mp_1);
|
|
278
|
-
var tmp_1 = Spacer_instance.toString();
|
|
279
|
-
var tmp_2 = importReferences(type);
|
|
280
|
-
tmp = trimMargin('\n |@dataclass\n |class ' + tmp_0 + ':\n |' + tmp_1 + 'pass\n |\n |' + joinToString(tmp_2, '\n', VOID, VOID, VOID, VOID, PythonTypeDefinitionEmitter$emit$lambda(this)) + '\n |\n ');
|
|
281
|
-
} else {
|
|
282
|
-
var tmp_3 = this.or(type.mp_1);
|
|
283
|
-
var tmp_4 = this.mq(type.np_1);
|
|
284
|
-
var tmp_5 = importReferences(type);
|
|
285
|
-
tmp = trimMargin('\n |@dataclass\n |class ' + tmp_3 + ':\n |' + tmp_4 + '\n |\n |' + joinToString(tmp_5, '\n', VOID, VOID, VOID, VOID, PythonTypeDefinitionEmitter$emit$lambda_0(this)) + '\n ');
|
|
286
|
-
}
|
|
287
|
-
return tmp;
|
|
288
|
-
}
|
|
289
|
-
function emit_5(_this__u8e3s4) {
|
|
290
|
-
return joinToString(_this__u8e3s4.jp_1, '\n', VOID, VOID, VOID, VOID, PythonTypeDefinitionEmitter$emit$lambda_1(this));
|
|
291
|
-
}
|
|
292
|
-
function emit_6(_this__u8e3s4) {
|
|
293
|
-
return this.or(_this__u8e3s4.rp_1) + ": '" + this.oq(_this__u8e3s4.sp_1) + "'";
|
|
294
|
-
}
|
|
295
|
-
function emit_7(_this__u8e3s4) {
|
|
296
|
-
// Inline function 'kotlin.let' call
|
|
297
|
-
var it = this.d20(_this__u8e3s4);
|
|
298
|
-
return _this__u8e3s4.uu() ? 'Optional[' + it + ']' : it;
|
|
299
|
-
}
|
|
300
|
-
function emitType(_this__u8e3s4) {
|
|
301
|
-
var tmp;
|
|
302
|
-
if (_this__u8e3s4 instanceof Dict) {
|
|
303
|
-
tmp = 'Dict[str, ' + this.oq(_this__u8e3s4.so_1) + ']';
|
|
304
|
-
} else {
|
|
305
|
-
if (_this__u8e3s4 instanceof Iterable) {
|
|
306
|
-
tmp = 'List[' + this.oq(_this__u8e3s4.po_1) + ']';
|
|
307
|
-
} else {
|
|
308
|
-
if (_this__u8e3s4 instanceof Unit) {
|
|
309
|
-
tmp = 'None';
|
|
310
|
-
} else {
|
|
311
|
-
if (_this__u8e3s4 instanceof Any) {
|
|
312
|
-
tmp = 'Any';
|
|
313
|
-
} else {
|
|
314
|
-
if (_this__u8e3s4 instanceof Custom) {
|
|
315
|
-
tmp = _this__u8e3s4.cv_1;
|
|
316
|
-
} else {
|
|
317
|
-
if (_this__u8e3s4 instanceof Primitive) {
|
|
318
|
-
tmp = this.b20(_this__u8e3s4.gv_1);
|
|
319
|
-
} else {
|
|
320
|
-
noWhenBranchMatchedException();
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
return tmp;
|
|
328
|
-
}
|
|
329
|
-
function emit_8(_this__u8e3s4) {
|
|
330
|
-
var tmp;
|
|
331
|
-
if (_this__u8e3s4 instanceof String_0) {
|
|
332
|
-
tmp = 'str';
|
|
333
|
-
} else {
|
|
334
|
-
if (_this__u8e3s4 instanceof Integer) {
|
|
335
|
-
tmp = 'int';
|
|
336
|
-
} else {
|
|
337
|
-
if (_this__u8e3s4 instanceof Number_0) {
|
|
338
|
-
tmp = 'float';
|
|
339
|
-
} else {
|
|
340
|
-
if (_this__u8e3s4 instanceof Boolean_0) {
|
|
341
|
-
tmp = 'bool';
|
|
342
|
-
} else {
|
|
343
|
-
if (_this__u8e3s4 instanceof Bytes) {
|
|
344
|
-
tmp = 'bytes';
|
|
345
|
-
} else {
|
|
346
|
-
noWhenBranchMatchedException();
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
return tmp;
|
|
353
|
-
}
|
|
354
|
-
function emit_9(_this__u8e3s4) {
|
|
355
|
-
var tmp;
|
|
356
|
-
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
357
|
-
tmp = 'bool(re.match(r"' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.qt_1) + '", self.value))';
|
|
358
|
-
} else {
|
|
359
|
-
if (_this__u8e3s4 instanceof Bound) {
|
|
360
|
-
var tmp1_safe_receiver = _this__u8e3s4.gu_1;
|
|
361
|
-
var tmp_0;
|
|
362
|
-
if (tmp1_safe_receiver == null) {
|
|
363
|
-
tmp_0 = null;
|
|
364
|
-
} else {
|
|
365
|
-
// Inline function 'kotlin.let' call
|
|
366
|
-
tmp_0 = tmp1_safe_receiver + ' < self.value';
|
|
367
|
-
}
|
|
368
|
-
var minCheck = tmp_0;
|
|
369
|
-
var tmp2_safe_receiver = _this__u8e3s4.hu_1;
|
|
370
|
-
var tmp_1;
|
|
371
|
-
if (tmp2_safe_receiver == null) {
|
|
372
|
-
tmp_1 = null;
|
|
373
|
-
} else {
|
|
374
|
-
// Inline function 'kotlin.let' call
|
|
375
|
-
tmp_1 = 'self.value < ' + tmp2_safe_receiver;
|
|
376
|
-
}
|
|
377
|
-
var maxCheck = tmp_1;
|
|
378
|
-
// Inline function 'kotlin.let' call
|
|
379
|
-
var it = joinToString(listOfNotNull([minCheck, maxCheck]), ' and ');
|
|
380
|
-
var tmp_2;
|
|
381
|
-
// Inline function 'kotlin.text.isEmpty' call
|
|
382
|
-
if (charSequenceLength(it) === 0) {
|
|
383
|
-
tmp_2 = 'True';
|
|
384
|
-
} else {
|
|
385
|
-
tmp_2 = it;
|
|
386
|
-
}
|
|
387
|
-
tmp = tmp_2;
|
|
388
|
-
} else {
|
|
389
|
-
noWhenBranchMatchedException();
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
return tmp;
|
|
393
|
-
}
|
|
394
|
-
function emitReferenceCustomImports(_this__u8e3s4) {
|
|
395
|
-
return 'from ..model.' + _this__u8e3s4.cv_1 + ' import ' + _this__u8e3s4.cv_1;
|
|
396
|
-
}
|
|
397
|
-
initMetadataForInterface(PythonTypeDefinitionEmitter, 'PythonTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
398
|
-
function emit_10(refined) {
|
|
399
|
-
return trimMargin('\n |@dataclass\n |class ' + this.v1y(refined.tr_1) + '(Wirespec.Refined):\n |' + Spacer_instance.toString() + 'value: ' + this.d20(refined.ur_1) + '\n |\n |' + Spacer_instance.toString() + 'def validate(self) -> bool:\n |' + Spacer_instance.is(2) + 'return ' + this.cs(refined) + '\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.is(2) + 'return str(self.value)\n |\n ');
|
|
400
|
-
}
|
|
401
|
-
function emitValidator(_this__u8e3s4) {
|
|
402
|
-
var defaultReturn = 'True';
|
|
403
|
-
var type = _this__u8e3s4.ur_1.gv_1;
|
|
404
|
-
var tmp;
|
|
405
|
-
if (type instanceof Integer) {
|
|
406
|
-
var tmp0_safe_receiver = type.lu_1;
|
|
407
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.pq(tmp0_safe_receiver);
|
|
408
|
-
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
409
|
-
} else {
|
|
410
|
-
if (type instanceof Number_0) {
|
|
411
|
-
var tmp2_safe_receiver = type.ou_1;
|
|
412
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.pq(tmp2_safe_receiver);
|
|
413
|
-
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
414
|
-
} else {
|
|
415
|
-
if (type instanceof String_0) {
|
|
416
|
-
var tmp4_safe_receiver = type.iu_1;
|
|
417
|
-
var tmp_0;
|
|
418
|
-
var tmp_1 = tmp4_safe_receiver;
|
|
419
|
-
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
420
|
-
tmp_0 = null;
|
|
421
|
-
} else {
|
|
422
|
-
tmp_0 = this.pq(new RegExp_0(tmp4_safe_receiver));
|
|
423
|
-
}
|
|
424
|
-
var tmp5_elvis_lhs = tmp_0;
|
|
425
|
-
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
426
|
-
} else {
|
|
427
|
-
if (equals(type, Boolean_instance)) {
|
|
428
|
-
tmp = defaultReturn;
|
|
429
|
-
} else {
|
|
430
|
-
if (equals(type, Bytes_instance)) {
|
|
431
|
-
tmp = defaultReturn;
|
|
432
|
-
} else {
|
|
433
|
-
noWhenBranchMatchedException();
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
return tmp;
|
|
440
|
-
}
|
|
441
|
-
initMetadataForInterface(PythonRefinedTypeDefinitionEmitter, 'PythonRefinedTypeDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
442
|
-
function emit_11(enum_0, module_0) {
|
|
443
|
-
var tmp = this.v1y(enum_0.yr_1);
|
|
444
|
-
return trimMargin('\n |class ' + tmp + '(str, Enum):\n |' + joinToString(enum_0.zr_1, '\n', VOID, VOID, VOID, VOID, PythonEnumDefinitionEmitter$emit$lambda(this)) + '\n |\n |' + Spacer_instance.toString() + '@property\n |' + Spacer_instance.toString() + 'def label(self) -> str:\n |' + Spacer_instance.is(2) + 'return self.value\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.is(2) + 'return self.value\n ');
|
|
445
|
-
}
|
|
446
|
-
initMetadataForInterface(PythonEnumDefinitionEmitter, 'PythonEnumDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
447
|
-
function emit_12(union) {
|
|
448
|
-
return trimMargin('\n |class ' + this.or(union.hp_1) + '(ABC):\n |' + Spacer_instance.toString() + 'pass\n ');
|
|
449
|
-
}
|
|
450
|
-
initMetadataForInterface(PythonUnionDefinitionEmitter, 'PythonUnionDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
451
|
-
function emit_13(endpoint) {
|
|
452
|
-
var tmp = importReferences(endpoint);
|
|
453
|
-
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda(this));
|
|
454
|
-
var tmp_1 = this.or(endpoint.vp_1);
|
|
455
|
-
var tmp_2 = spacer(this.i1y(first(endpoint.aq_1), endpoint), 1);
|
|
456
|
-
var tmp_3 = distinctByStatus(endpoint.bq_1);
|
|
457
|
-
return trimMargin('\n |' + tmp_0 + '\n |\n |class ' + tmp_1 + ' (Wirespec.Endpoint):\n |' + tmp_2 + '\n |' + spacer(joinToString(tmp_3, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda_0(this, endpoint)), 1) + '\n |' + spacer(emitResponseUnion(this, endpoint), 1) + '\n |' + spacer(emitHandleClass(this, endpoint), 1) + '\n |' + spacer(emitConvertClass(this, endpoint), 1) + '\n |\n ');
|
|
458
|
-
}
|
|
459
|
-
function emit_14(_this__u8e3s4, endpoint) {
|
|
460
|
-
var tmp = emit_18(this, _this__u8e3s4.eq_1);
|
|
461
|
-
var tmp_0 = get_pathParams(endpoint);
|
|
462
|
-
var tmp_1 = emitObject$default(this, tmp_0, 'Path', 'Wirespec.Request.Path', VOID, PythonEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
463
|
-
var tmp_2 = emitObject$default(this, endpoint.yp_1, 'Queries', 'Wirespec.Request.Queries', VOID, PythonEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
464
|
-
var tmp_3 = emitObject$default(this, endpoint.zp_1, 'Headers', 'Wirespec.Request.Headers', VOID, PythonEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
465
|
-
var tmp_4 = Spacer_instance.toString();
|
|
466
|
-
var tmp_5 = Spacer_instance.toString();
|
|
467
|
-
var tmp_6 = emit_18(this, _this__u8e3s4.eq_1);
|
|
468
|
-
var tmp_7 = Spacer_instance.toString();
|
|
469
|
-
var tmp_8 = Spacer_instance.toString();
|
|
470
|
-
var tmp_9 = Spacer_instance.toString();
|
|
471
|
-
var tmp_10 = Spacer_instance.toString();
|
|
472
|
-
var tmp_11 = Spacer_instance.toString();
|
|
473
|
-
var tmp_12 = Spacer_instance.toString();
|
|
474
|
-
var tmp_13 = Spacer_instance.toString();
|
|
475
|
-
var tmp_14 = Spacer_instance.toString();
|
|
476
|
-
var tmp_15 = Spacer_instance.toString();
|
|
477
|
-
var tmp_16 = Spacer_instance.toString();
|
|
478
|
-
var tmp_17 = Spacer_instance.toString();
|
|
479
|
-
var tmp_18 = Spacer_instance.toString();
|
|
480
|
-
var tmp_19 = Spacer_instance.toString();
|
|
481
|
-
var tmp_20 = Spacer_instance.toString();
|
|
482
|
-
var tmp_21 = Spacer_instance.toString();
|
|
483
|
-
var tmp_22 = emit_18(this, _this__u8e3s4.eq_1);
|
|
484
|
-
var tmp_23 = Spacer_instance.toString();
|
|
485
|
-
var tmp_24 = Spacer_instance.toString();
|
|
486
|
-
var tmp_25 = Spacer_instance.toString();
|
|
487
|
-
var tmp_26 = Spacer_instance.toString();
|
|
488
|
-
var tmp_27 = Spacer_instance.toString();
|
|
489
|
-
var tmp_28 = paramList(_this__u8e3s4, endpoint);
|
|
490
|
-
return trimMargin('\n |@dataclass\n |class Request(Wirespec.Request[' + tmp + ']):\n |' + tmp_1 + '\n |' + tmp_2 + '\n |' + tmp_3 + '\n |\n |' + tmp_4 + '@property\n |' + tmp_5 + 'def body(self) -> ' + tmp_6 + ':\n |' + tmp_7 + tmp_8 + 'return self._body\n |\n |' + tmp_9 + '@property\n |' + tmp_10 + 'def path(self) -> Path:\n |' + tmp_11 + tmp_12 + 'return self._path\n |\n |' + tmp_13 + '@property\n |' + tmp_14 + 'def queries(self) -> Queries:\n |' + tmp_15 + tmp_16 + 'return self._queries\n |\n |' + tmp_17 + '@property\n |' + tmp_18 + 'def headers(self) -> Headers:\n |' + tmp_19 + tmp_20 + 'return self._headers\n |\n |' + tmp_21 + '_body: ' + tmp_22 + '\n |' + tmp_23 + '_headers: Headers\n |' + tmp_24 + '_queries: Queries\n |' + tmp_25 + '_path: Path\n |' + tmp_26 + 'method: Wirespec.Method = Wirespec.Method.' + endpoint.wp_1.a3_1 + '\n |\n |' + tmp_27 + 'def __init__(self, ' + joinToString(tmp_28, ', ', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda_4(this)) + '):\n |' + spacer(emitAssignSelf_0(this, _this__u8e3s4, endpoint), 2) + '\n |\n ');
|
|
491
|
-
}
|
|
492
|
-
function emit_15(_this__u8e3s4, endpoint) {
|
|
493
|
-
var tmp = emit_18(this, _this__u8e3s4.jq_1);
|
|
494
|
-
var tmp_0 = emitObject$default(this, _this__u8e3s4.iq_1, 'Headers', 'Wirespec.Response.Headers', VOID, PythonEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
495
|
-
var tmp_1 = Spacer_instance.toString();
|
|
496
|
-
var tmp_2 = Spacer_instance.toString();
|
|
497
|
-
var tmp_3 = Spacer_instance.toString();
|
|
498
|
-
var tmp_4 = Spacer_instance.toString();
|
|
499
|
-
var tmp_5 = Spacer_instance.toString();
|
|
500
|
-
var tmp_6 = Spacer_instance.toString();
|
|
501
|
-
var tmp_7 = emit_18(this, _this__u8e3s4.jq_1);
|
|
502
|
-
var tmp_8 = Spacer_instance.toString();
|
|
503
|
-
var tmp_9 = Spacer_instance.toString();
|
|
504
|
-
var tmp_10 = Spacer_instance.toString();
|
|
505
|
-
var tmp_11 = emit_18(this, _this__u8e3s4.jq_1);
|
|
506
|
-
var tmp_12 = Spacer_instance.toString();
|
|
507
|
-
var tmp_13 = Spacer_instance.toString();
|
|
508
|
-
var tmp_14 = Spacer_instance.toString();
|
|
509
|
-
var tmp_15 = paramList_0(_this__u8e3s4);
|
|
510
|
-
return trimMargin('\n |@dataclass\n |class Response' + _this__u8e3s4.hq_1 + '(Wirespec.Response[' + tmp + ']):\n |' + tmp_0 + '\n |\n |' + tmp_1 + '@property\n |' + tmp_2 + 'def headers(self) -> Headers:\n |' + tmp_3 + tmp_4 + 'return self._headers\n |\n |' + tmp_5 + '@property\n |' + tmp_6 + 'def body(self) -> ' + tmp_7 + ':\n |' + tmp_8 + tmp_9 + 'return self._body\n |\n |' + tmp_10 + '_body: ' + tmp_11 + '\n |' + tmp_12 + '_headers: Headers\n |' + tmp_13 + 'status: int = ' + _this__u8e3s4.hq_1 + '\n |\n |' + tmp_14 + 'def __init__(self, ' + joinToString(tmp_15, ', ', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda_6(this)) + '):\n |' + spacer(emitAssignSelf_1(this, _this__u8e3s4, endpoint), 2) + '\n |\n ');
|
|
511
|
-
}
|
|
512
|
-
initMetadataForInterface(PythonEndpointDefinitionEmitter, 'PythonEndpointDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter]);
|
|
513
|
-
initMetadataForClass(PythonEmitter, 'PythonEmitter', PythonEmitter, LanguageEmitter, [LanguageEmitter, PythonRefinedTypeDefinitionEmitter, PythonTypeDefinitionEmitter, PythonChannelDefinitionEmitter, PythonEnumDefinitionEmitter, PythonIdentifierEmitter, PythonUnionDefinitionEmitter, PythonEndpointDefinitionEmitter]);
|
|
514
|
-
initMetadataForCompanion(Companion);
|
|
515
|
-
initMetadataForCompanion(Companion_0);
|
|
516
|
-
initMetadataForClass(sam$kotlin_Comparator$0_0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
|
|
517
|
-
initMetadataForClass(PythonIrEmitter, 'PythonIrEmitter', PythonIrEmitter, VOID, [IrEmitter]);
|
|
518
|
-
initMetadataForObject(PythonShared, 'PythonShared');
|
|
519
|
-
//endregion
|
|
520
|
-
function PythonChannelDefinitionEmitter() {
|
|
521
|
-
}
|
|
522
|
-
function sam$kotlin_Comparator$0(function_0) {
|
|
523
|
-
this.r1z_1 = function_0;
|
|
524
|
-
}
|
|
525
|
-
protoOf(sam$kotlin_Comparator$0).td = function (a, b) {
|
|
526
|
-
return this.r1z_1(a, b);
|
|
527
|
-
};
|
|
528
|
-
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
529
|
-
return this.td(a, b);
|
|
530
|
-
};
|
|
531
|
-
protoOf(sam$kotlin_Comparator$0).l3 = function () {
|
|
532
|
-
return this.r1z_1;
|
|
533
|
-
};
|
|
534
|
-
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
535
|
-
var tmp;
|
|
536
|
-
if (!(other == null) ? isInterface(other, Comparator) : false) {
|
|
537
|
-
var tmp_0;
|
|
538
|
-
if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
|
|
539
|
-
tmp_0 = equals(this.l3(), other.l3());
|
|
540
|
-
} else {
|
|
541
|
-
tmp_0 = false;
|
|
542
|
-
}
|
|
543
|
-
tmp = tmp_0;
|
|
544
|
-
} else {
|
|
545
|
-
tmp = false;
|
|
546
|
-
}
|
|
547
|
-
return tmp;
|
|
548
|
-
};
|
|
549
|
-
protoOf(sam$kotlin_Comparator$0).hashCode = function () {
|
|
550
|
-
return hashCode(this.l3());
|
|
551
|
-
};
|
|
552
|
-
function PythonEmitter$emit$lambda(this$0) {
|
|
553
|
-
return function (a, b) {
|
|
554
|
-
// Inline function 'kotlin.comparisons.compareValuesBy' call
|
|
555
|
-
var tmp = this$0.y1z(a);
|
|
556
|
-
var tmp$ret$1 = this$0.y1z(b);
|
|
557
|
-
return compareValues(tmp, tmp$ret$1);
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
|
-
function emit$emitInit(this$0, def) {
|
|
561
|
-
return 'from .' + this$0.or(def.nr()) + ' import ' + this$0.or(def.nr());
|
|
562
|
-
}
|
|
563
|
-
function PythonEmitter(packageName, emitShared) {
|
|
564
|
-
packageName = packageName === VOID ? Companion_instance.ds('community.flock.wirespec.generated') : packageName;
|
|
565
|
-
emitShared = emitShared === VOID ? Companion_instance_0.wo() : emitShared;
|
|
566
|
-
LanguageEmitter.call(this);
|
|
567
|
-
this.s1z_1 = packageName;
|
|
568
|
-
this.t1z_1 = emitShared;
|
|
569
|
-
this.u1z_1 = 'import re\n\nfrom abc import abstractmethod\nfrom dataclasses import dataclass\nfrom typing import List, Optional\nfrom enum import Enum\n\nfrom ..wirespec import T, Wirespec\n';
|
|
570
|
-
this.v1z_1 = FileExtension_Python_getInstance();
|
|
571
|
-
this.w1z_1 = PythonShared_instance;
|
|
572
|
-
this.x1z_1 = '#';
|
|
573
|
-
}
|
|
574
|
-
protoOf(PythonEmitter).vq = function () {
|
|
575
|
-
return this.v1z_1;
|
|
576
|
-
};
|
|
577
|
-
protoOf(PythonEmitter).e1y = function () {
|
|
578
|
-
return this.w1z_1;
|
|
579
|
-
};
|
|
580
|
-
protoOf(PythonEmitter).wq = function () {
|
|
581
|
-
return this.x1z_1;
|
|
582
|
-
};
|
|
583
|
-
protoOf(PythonEmitter).y1z = function (definition) {
|
|
584
|
-
var tmp;
|
|
585
|
-
if (definition instanceof Enum) {
|
|
586
|
-
tmp = 1;
|
|
587
|
-
} else {
|
|
588
|
-
if (definition instanceof Refined) {
|
|
589
|
-
tmp = 2;
|
|
590
|
-
} else {
|
|
591
|
-
if (definition instanceof Type) {
|
|
592
|
-
tmp = 3;
|
|
593
|
-
} else {
|
|
594
|
-
if (definition instanceof Union) {
|
|
595
|
-
tmp = 4;
|
|
596
|
-
} else {
|
|
597
|
-
if (definition instanceof Endpoint) {
|
|
598
|
-
tmp = 5;
|
|
599
|
-
} else {
|
|
600
|
-
if (definition instanceof Channel) {
|
|
601
|
-
tmp = 6;
|
|
602
|
-
} else {
|
|
603
|
-
noWhenBranchMatchedException();
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
return tmp;
|
|
611
|
-
};
|
|
612
|
-
protoOf(PythonEmitter).lr = function (module_0, logger) {
|
|
613
|
-
// Inline function 'kotlin.collections.sortedBy' call
|
|
614
|
-
var this_0 = new NonEmptyList(module_0.uq_1);
|
|
615
|
-
// Inline function 'kotlin.comparisons.compareBy' call
|
|
616
|
-
var tmp = PythonEmitter$emit$lambda(this);
|
|
617
|
-
var tmp$ret$0 = new sam$kotlin_Comparator$0(tmp);
|
|
618
|
-
var tmp$ret$1 = sortedWith(this_0, tmp$ret$0);
|
|
619
|
-
var tmp_0 = toNonEmptyListOrNull(tmp$ret$1);
|
|
620
|
-
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).om_1;
|
|
621
|
-
// Inline function 'kotlin.let' call
|
|
622
|
-
var it = protoOf(LanguageEmitter).lr.call(this, module_0.nv(VOID, statements), logger);
|
|
623
|
-
var init = new Emitted(this.s1z_1.gs() + '__init__', 'from . import model\nfrom . import endpoint\nfrom . import wirespec\n');
|
|
624
|
-
var tmp_1 = this.s1z_1.gs() + 'endpoint/' + '__init__';
|
|
625
|
-
// Inline function 'kotlin.collections.filter' call
|
|
626
|
-
var tmp0 = new NonEmptyList(module_0.uq_1);
|
|
627
|
-
// Inline function 'kotlin.collections.filterTo' call
|
|
628
|
-
var destination = ArrayList_init_$Create$();
|
|
629
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
630
|
-
while (_iterator__ex2g4s.u()) {
|
|
631
|
-
var element = _iterator__ex2g4s.v();
|
|
632
|
-
if (element instanceof Endpoint) {
|
|
633
|
-
destination.x(element);
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
// Inline function 'kotlin.collections.map' call
|
|
637
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
638
|
-
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
|
|
639
|
-
var _iterator__ex2g4s_0 = destination.t();
|
|
640
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
641
|
-
var item = _iterator__ex2g4s_0.v();
|
|
642
|
-
var tmp$ret$5 = emit$emitInit(this, item);
|
|
643
|
-
destination_0.x(tmp$ret$5);
|
|
644
|
-
}
|
|
645
|
-
var initEndpoint = new Emitted(tmp_1, joinToString(destination_0, '\n'));
|
|
646
|
-
var tmp_2 = this.s1z_1.gs() + 'model/' + '__init__';
|
|
647
|
-
// Inline function 'kotlin.collections.filter' call
|
|
648
|
-
var tmp0_0 = new NonEmptyList(module_0.uq_1);
|
|
649
|
-
// Inline function 'kotlin.collections.filterTo' call
|
|
650
|
-
var destination_1 = ArrayList_init_$Create$();
|
|
651
|
-
var _iterator__ex2g4s_1 = tmp0_0.t();
|
|
652
|
-
while (_iterator__ex2g4s_1.u()) {
|
|
653
|
-
var element_0 = _iterator__ex2g4s_1.v();
|
|
654
|
-
if (isInterface(element_0, Model)) {
|
|
655
|
-
destination_1.x(element_0);
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
// Inline function 'kotlin.collections.map' call
|
|
659
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
660
|
-
var destination_2 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_1, 10));
|
|
661
|
-
var _iterator__ex2g4s_2 = destination_1.t();
|
|
662
|
-
while (_iterator__ex2g4s_2.u()) {
|
|
663
|
-
var item_0 = _iterator__ex2g4s_2.v();
|
|
664
|
-
var tmp$ret$11 = emit$emitInit(this, item_0);
|
|
665
|
-
destination_2.x(tmp$ret$11);
|
|
666
|
-
}
|
|
667
|
-
var initModel = new Emitted(tmp_2, joinToString(destination_2, '\n'));
|
|
668
|
-
var shared = new Emitted(this.s1z_1.gs() + 'wirespec', this.e1y().a20_1);
|
|
669
|
-
return this.t1z_1.xo_1 ? NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(it, init), initEndpoint), initModel), shared) : NonEmptyList__plus_impl_xqmb9(it, init);
|
|
670
|
-
};
|
|
671
|
-
protoOf(PythonEmitter).mr = function (definition, module_0, logger) {
|
|
672
|
-
var subPackageName = plus_1(this.s1z_1, definition);
|
|
673
|
-
// Inline function 'kotlin.let' call
|
|
674
|
-
var it = protoOf(LanguageEmitter).mr.call(this, definition, module_0, logger);
|
|
675
|
-
var tmp = subPackageName.gs() + it.yo_1;
|
|
676
|
-
// Inline function 'kotlin.text.trimStart' call
|
|
677
|
-
var this_0 = trimMargin('\n |' + this.u1z_1 + '\n |' + it.zo_1 + '\n ');
|
|
678
|
-
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
679
|
-
return new Emitted(tmp, tmp$ret$0);
|
|
680
|
-
};
|
|
681
|
-
function emitToRawRequest($this, _this__u8e3s4, endpoint) {
|
|
682
|
-
var tmp = $this.or(endpoint.vp_1);
|
|
683
|
-
var tmp_0 = Spacer_instance.toString();
|
|
684
|
-
var tmp_1 = Spacer_instance.toString();
|
|
685
|
-
var tmp_2 = Spacer_instance.toString();
|
|
686
|
-
var tmp_3 = joinToString(endpoint.xp_1, VOID, VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawRequest$lambda($this));
|
|
687
|
-
var tmp_4 = Spacer_instance.toString();
|
|
688
|
-
var tmp_5 = Spacer_instance.toString();
|
|
689
|
-
var tmp_6 = Spacer_instance.toString();
|
|
690
|
-
var tmp_7 = Spacer_instance.toString();
|
|
691
|
-
var tmp_8;
|
|
692
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
693
|
-
if (!endpoint.yp_1.r()) {
|
|
694
|
-
tmp_8 = prependIndent(joinToString(endpoint.yp_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawRequest$lambda_0($this)), Spacer_instance.is(3));
|
|
695
|
-
} else {
|
|
696
|
-
tmp_8 = '';
|
|
697
|
-
}
|
|
698
|
-
var tmp_9 = tmp_8;
|
|
699
|
-
var tmp_10 = Spacer_instance.toString();
|
|
700
|
-
var tmp_11 = Spacer_instance.toString();
|
|
701
|
-
var tmp_12 = Spacer_instance.toString();
|
|
702
|
-
var tmp_13 = Spacer_instance.toString();
|
|
703
|
-
var tmp_14;
|
|
704
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
705
|
-
if (!endpoint.zp_1.r()) {
|
|
706
|
-
tmp_14 = prependIndent(joinToString(endpoint.zp_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawRequest$lambda_1($this)), Spacer_instance.is(3));
|
|
707
|
-
} else {
|
|
708
|
-
tmp_14 = '';
|
|
709
|
-
}
|
|
710
|
-
var tmp_15 = tmp_14;
|
|
711
|
-
var tmp_16 = Spacer_instance.toString();
|
|
712
|
-
var tmp_17 = Spacer_instance.toString();
|
|
713
|
-
var tmp_18 = Spacer_instance.toString();
|
|
714
|
-
var tmp_19 = Spacer_instance.toString();
|
|
715
|
-
var tmp0_safe_receiver = _this__u8e3s4.eq_1;
|
|
716
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.gq_1;
|
|
717
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.d20(tmp1_safe_receiver);
|
|
718
|
-
return trimMargin("\n |@staticmethod\n |def to_raw_request(serialization: Wirespec.Serializer, request: '" + tmp + ".Request') -> Wirespec.RawRequest:\n |" + tmp_0 + 'return Wirespec.RawRequest(\n |' + tmp_1 + tmp_2 + 'path = [' + tmp_3 + '],\n |' + tmp_4 + tmp_5 + 'method = request.method.value,\n |' + tmp_6 + tmp_7 + 'queries = {\n |' + tmp_9 + '\n |' + tmp_10 + tmp_11 + '},\n |' + tmp_12 + tmp_13 + 'headers = {\n |' + tmp_15 + '\n |' + tmp_16 + tmp_17 + '},\n |' + tmp_18 + tmp_19 + 'body = serialization.serialize(request.body, ' + (tmp2_elvis_lhs == null ? 'type(None)' : tmp2_elvis_lhs) + '),\n |' + Spacer_instance.toString() + ')\n |\n ');
|
|
719
|
-
}
|
|
720
|
-
function emitFromRawRequest($this, _this__u8e3s4, endpoint) {
|
|
721
|
-
return trimMargin("\n |@staticmethod\n |def from_raw_request(serialization: Wirespec.Deserializer, request: Wirespec.RawRequest) -> '" + $this.or(endpoint.vp_1) + ".Request':\n |" + Spacer_instance.toString() + 'return ' + $this.or(endpoint.vp_1) + '.Request' + emitDeserializedParams($this, _this__u8e3s4, endpoint) + '\n |\n ');
|
|
722
|
-
}
|
|
723
|
-
function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
724
|
-
var tmp = get_indexedPathParams(endpoint);
|
|
725
|
-
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
|
|
726
|
-
var tmp_1 = orNull(joinToString(endpoint.yp_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
727
|
-
var tmp_2 = orNull(joinToString(endpoint.zp_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
728
|
-
var tmp0_safe_receiver = _this__u8e3s4.eq_1;
|
|
729
|
-
var tmp_3;
|
|
730
|
-
if (tmp0_safe_receiver == null) {
|
|
731
|
-
tmp_3 = null;
|
|
732
|
-
} else {
|
|
733
|
-
// Inline function 'kotlin.let' call
|
|
734
|
-
tmp_3 = Spacer_instance.is(3) + 'body = serialization.deserialize(request.body, ' + $this.d20(tmp0_safe_receiver.gq_1) + '),';
|
|
735
|
-
}
|
|
736
|
-
// Inline function 'kotlin.let' call
|
|
737
|
-
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
738
|
-
return isBlank(it) ? '()' : '(\n' + it + '\n)';
|
|
739
|
-
}
|
|
740
|
-
function emitResponseUnion($this, _this__u8e3s4) {
|
|
741
|
-
return trimMargin('\n |Response = ' + joinToString(_this__u8e3s4.bq_1, ' | ', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitResponseUnion$lambda) + '\n |\n ');
|
|
742
|
-
}
|
|
743
|
-
function emitHandleClass($this, _this__u8e3s4) {
|
|
744
|
-
return trimMargin('\n |class Handler(Wirespec.Endpoint.Handler):\n |' + Spacer_instance.toString() + '@abstractmethod\n |' + Spacer_instance.toString() + 'def ' + _this__u8e3s4.vp_1.l1() + "(self, req: '" + $this.or(_this__u8e3s4.vp_1) + ".Request') -> '" + $this.or(_this__u8e3s4.vp_1) + ".Response': pass\n |\n ");
|
|
745
|
-
}
|
|
746
|
-
function emitConvertClass($this, _this__u8e3s4) {
|
|
747
|
-
return trimMargin('\n |class Convert(Wirespec.Endpoint.Convert[Request, Response]):\n |' + spacer(emitToRawRequest($this, first(_this__u8e3s4.aq_1), _this__u8e3s4), 1) + '\n |' + spacer(emitFromRawRequest($this, first(_this__u8e3s4.aq_1), _this__u8e3s4), 1) + '\n |' + spacer(emitToRawResponse($this, _this__u8e3s4), 1) + '\n |' + spacer(emitFromRawResponse($this, _this__u8e3s4), 1) + '\n |\n ');
|
|
748
|
-
}
|
|
749
|
-
function emit_16($this, _this__u8e3s4) {
|
|
750
|
-
return $this.or(_this__u8e3s4.ar_1) + ': ' + $this.oq(_this__u8e3s4.br_1);
|
|
751
|
-
}
|
|
752
|
-
function emitAssignSelf($this, _this__u8e3s4) {
|
|
753
|
-
return $this.or(_this__u8e3s4.ar_1) + ' = ' + $this.or(_this__u8e3s4.ar_1);
|
|
754
|
-
}
|
|
755
|
-
function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
756
|
-
var tmp = $this.or(endpoint.vp_1);
|
|
757
|
-
// Inline function 'kotlin.collections.filter' call
|
|
758
|
-
var tmp0 = paramList(_this__u8e3s4, endpoint);
|
|
759
|
-
// Inline function 'kotlin.collections.filterTo' call
|
|
760
|
-
var destination = ArrayList_init_$Create$();
|
|
761
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
762
|
-
while (_iterator__ex2g4s.u()) {
|
|
763
|
-
var element = _iterator__ex2g4s.v();
|
|
764
|
-
if (element.zq_1.equals(ParamType_PATH_getInstance())) {
|
|
765
|
-
destination.x(element);
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
var tmp_0 = destination;
|
|
769
|
-
var tmp_1 = joinToString(tmp_0, VOID, VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda($this));
|
|
770
|
-
var tmp_2 = $this.or(endpoint.vp_1);
|
|
771
|
-
// Inline function 'kotlin.collections.filter' call
|
|
772
|
-
var tmp0_0 = paramList(_this__u8e3s4, endpoint);
|
|
773
|
-
// Inline function 'kotlin.collections.filterTo' call
|
|
774
|
-
var destination_0 = ArrayList_init_$Create$();
|
|
775
|
-
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
776
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
777
|
-
var element_0 = _iterator__ex2g4s_0.v();
|
|
778
|
-
if (element_0.zq_1.equals(ParamType_QUERY_getInstance())) {
|
|
779
|
-
destination_0.x(element_0);
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
var tmp_3 = destination_0;
|
|
783
|
-
var tmp_4 = spacer(joinToString(tmp_3, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_0($this)), 1);
|
|
784
|
-
var tmp_5 = $this.or(endpoint.vp_1);
|
|
785
|
-
// Inline function 'kotlin.collections.filter' call
|
|
786
|
-
var tmp0_1 = paramList(_this__u8e3s4, endpoint);
|
|
787
|
-
// Inline function 'kotlin.collections.filterTo' call
|
|
788
|
-
var destination_1 = ArrayList_init_$Create$();
|
|
789
|
-
var _iterator__ex2g4s_1 = tmp0_1.t();
|
|
790
|
-
while (_iterator__ex2g4s_1.u()) {
|
|
791
|
-
var element_1 = _iterator__ex2g4s_1.v();
|
|
792
|
-
if (element_1.zq_1.equals(ParamType_HEADER_getInstance())) {
|
|
793
|
-
destination_1.x(element_1);
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
var tmp_6 = destination_1;
|
|
797
|
-
var tmp_7 = spacer(joinToString(tmp_6, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_1($this)), 1);
|
|
798
|
-
var tmp_8;
|
|
799
|
-
if (_this__u8e3s4.eq_1 == null) {
|
|
800
|
-
tmp_8 = null;
|
|
801
|
-
} else {
|
|
802
|
-
// Inline function 'kotlin.let' call
|
|
803
|
-
tmp_8 = 'body';
|
|
804
|
-
}
|
|
805
|
-
var tmp1_elvis_lhs = tmp_8;
|
|
806
|
-
return trimMargin('\n |self._path = ' + tmp + '.Request.Path(' + tmp_1 + ')\n |self._queries =' + tmp_2 + '.Request.Queries(' + tmp_4 + ')\n |self._headers = ' + tmp_5 + '.Request.Headers(' + tmp_7 + ')\n |self._body = ' + (tmp1_elvis_lhs == null ? 'None' : tmp1_elvis_lhs) + '\n ');
|
|
807
|
-
}
|
|
808
|
-
function emitAssignSelf_1($this, _this__u8e3s4, endpoint) {
|
|
809
|
-
var tmp = $this.or(endpoint.vp_1);
|
|
810
|
-
// Inline function 'kotlin.collections.filter' call
|
|
811
|
-
var tmp0 = paramList_0(_this__u8e3s4);
|
|
812
|
-
// Inline function 'kotlin.collections.filterTo' call
|
|
813
|
-
var destination = ArrayList_init_$Create$();
|
|
814
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
815
|
-
while (_iterator__ex2g4s.u()) {
|
|
816
|
-
var element = _iterator__ex2g4s.v();
|
|
817
|
-
if (element.zq_1.equals(ParamType_HEADER_getInstance())) {
|
|
818
|
-
destination.x(element);
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
var tmp_0 = destination;
|
|
822
|
-
var tmp_1 = spacer(joinToString(tmp_0, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_2($this)), 1);
|
|
823
|
-
var tmp_2;
|
|
824
|
-
if (_this__u8e3s4.jq_1 == null) {
|
|
825
|
-
tmp_2 = null;
|
|
826
|
-
} else {
|
|
827
|
-
// Inline function 'kotlin.let' call
|
|
828
|
-
tmp_2 = 'body';
|
|
829
|
-
}
|
|
830
|
-
var tmp1_elvis_lhs = tmp_2;
|
|
831
|
-
return trimMargin('\n |self._headers = ' + tmp + '.Response' + _this__u8e3s4.hq_1 + '.Headers(' + tmp_1 + ')\n |self._body = ' + (tmp1_elvis_lhs == null ? 'None' : tmp1_elvis_lhs) + '\n ');
|
|
832
|
-
}
|
|
833
|
-
function emitDeserialized($this, _this__u8e3s4) {
|
|
834
|
-
return Spacer_instance.is(3) + $this.or(_this__u8e3s4.ue_1.cq_1) + ' = serialization.deserialize(request.path[' + _this__u8e3s4.te_1 + '], ' + $this.d20(_this__u8e3s4.ue_1.dq_1) + ')';
|
|
835
|
-
}
|
|
836
|
-
function emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive) {
|
|
837
|
-
var tmp;
|
|
838
|
-
if (caseSensitive) {
|
|
839
|
-
tmp = Spacer_instance.is(spaces) + $this.or(_this__u8e3s4.rp_1) + ' = serialization.deserialize_param(' + type + '.' + fields + '.get("' + _this__u8e3s4.rp_1.l1() + '"), ' + $this.d20(_this__u8e3s4.sp_1) + ')';
|
|
840
|
-
} else {
|
|
841
|
-
var tmp_0 = Spacer_instance.is(spaces);
|
|
842
|
-
var tmp_1 = $this.or(_this__u8e3s4.rp_1);
|
|
843
|
-
// Inline function 'kotlin.text.lowercase' call
|
|
844
|
-
// Inline function 'kotlin.js.asDynamic' call
|
|
845
|
-
tmp = tmp_0 + tmp_1 + ' = serialization.deserialize_param(next((v for k, v in ' + type + '.' + fields + '.items() if k.lower() == "' + _this__u8e3s4.rp_1.l1().toLowerCase() + '"), None), ' + $this.d20(_this__u8e3s4.sp_1) + ')';
|
|
846
|
-
}
|
|
847
|
-
return tmp;
|
|
848
|
-
}
|
|
849
|
-
function emitDeserializedParams$default($this, _this__u8e3s4, type, fields, spaces, caseSensitive, $super) {
|
|
850
|
-
spaces = spaces === VOID ? 3 : spaces;
|
|
851
|
-
caseSensitive = caseSensitive === VOID ? true : caseSensitive;
|
|
852
|
-
return emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive);
|
|
853
|
-
}
|
|
854
|
-
function emitToRawResponse($this, _this__u8e3s4) {
|
|
855
|
-
var tmp = $this.or(_this__u8e3s4.vp_1);
|
|
856
|
-
var tmp_0 = Spacer_instance.toString();
|
|
857
|
-
var tmp_1 = distinctByStatus(_this__u8e3s4.bq_1);
|
|
858
|
-
return trimMargin("\n |@staticmethod\n |def to_raw_response(serialization: Wirespec.Serializer, response: '" + tmp + ".Response') -> Wirespec.RawResponse:\n |" + tmp_0 + 'match response:\n |' + spacer(joinToString(tmp_1, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawResponse$lambda($this, _this__u8e3s4)), 2) + '\n |' + Spacer_instance.toString() + Spacer_instance.toString() + 'case _:\n |' + Spacer_instance.toString() + Spacer_instance.toString() + Spacer_instance.toString() + 'raise Exception("Cannot match response with status: " + str(response.status))\n ');
|
|
859
|
-
}
|
|
860
|
-
function emitFromRawResponse($this, _this__u8e3s4) {
|
|
861
|
-
var tmp = $this.or(_this__u8e3s4.vp_1);
|
|
862
|
-
var tmp_0 = Spacer_instance.toString();
|
|
863
|
-
// Inline function 'kotlin.collections.filter' call
|
|
864
|
-
var tmp0 = distinctByStatus(_this__u8e3s4.bq_1);
|
|
865
|
-
// Inline function 'kotlin.collections.filterTo' call
|
|
866
|
-
var destination = ArrayList_init_$Create$();
|
|
867
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
868
|
-
while (_iterator__ex2g4s.u()) {
|
|
869
|
-
var element = _iterator__ex2g4s.v();
|
|
870
|
-
if (Companion_instance_1.jr(element.hq_1)) {
|
|
871
|
-
destination.x(element);
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
var tmp_1 = destination;
|
|
875
|
-
return trimMargin("\n |@staticmethod\n |def from_raw_response(serialization: Wirespec.Deserializer, response: Wirespec.RawResponse) -> '" + tmp + ".Response':\n |" + tmp_0 + 'match response.status_code:\n |' + spacer(joinToString(tmp_1, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitFromRawResponse$lambda($this, _this__u8e3s4)), 2) + '\n |' + Spacer_instance.is(2) + 'case _:\n |' + Spacer_instance.is(3) + 'raise Exception("Cannot match response with status: " + str(response.status_code))\n |\n ');
|
|
876
|
-
}
|
|
877
|
-
function emitDeserialized_0($this, _this__u8e3s4, endpoint) {
|
|
878
|
-
var tmp = 'case ' + _this__u8e3s4.hq_1 + ':';
|
|
879
|
-
var tmp_0 = Spacer_instance.toString() + 'return ' + $this.or(endpoint.vp_1) + '.Response' + _this__u8e3s4.hq_1 + '(';
|
|
880
|
-
var tmp_1 = Spacer_instance.is(2);
|
|
881
|
-
var tmp0_safe_receiver = _this__u8e3s4.jq_1;
|
|
882
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.gq_1;
|
|
883
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.d20(tmp1_safe_receiver);
|
|
884
|
-
var tmp_2 = tmp_1 + 'body = serialization.deserialize(response.body, ' + (tmp2_elvis_lhs == null ? 'type(None)' : tmp2_elvis_lhs) + '),';
|
|
885
|
-
return joinToString(listOfNotNull([tmp, tmp_0, tmp_2, orNull(joinToString(_this__u8e3s4.iq_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserialized$lambda($this))), Spacer_instance.toString() + ')']), '\n');
|
|
886
|
-
}
|
|
887
|
-
function emitSerialized($this, _this__u8e3s4, endpoint) {
|
|
888
|
-
var tmp = $this.or(endpoint.vp_1);
|
|
889
|
-
var tmp_0 = Spacer_instance.is(1);
|
|
890
|
-
var tmp_1 = Spacer_instance.is(2);
|
|
891
|
-
var tmp_2 = Spacer_instance.is(2);
|
|
892
|
-
var tmp_3;
|
|
893
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
894
|
-
if (!_this__u8e3s4.iq_1.r()) {
|
|
895
|
-
tmp_3 = joinToString(_this__u8e3s4.iq_1, ', ', '{', '}', VOID, VOID, PythonEndpointDefinitionEmitter$emitSerialized$lambda($this));
|
|
896
|
-
} else {
|
|
897
|
-
tmp_3 = '{}';
|
|
898
|
-
}
|
|
899
|
-
var tmp_4 = tmp_3;
|
|
900
|
-
var tmp_5 = Spacer_instance.is(2);
|
|
901
|
-
var tmp0_safe_receiver = _this__u8e3s4.jq_1;
|
|
902
|
-
var tmp_6;
|
|
903
|
-
if (tmp0_safe_receiver == null) {
|
|
904
|
-
tmp_6 = null;
|
|
905
|
-
} else {
|
|
906
|
-
// Inline function 'kotlin.let' call
|
|
907
|
-
tmp_6 = 'serialization.serialize(response.body, ' + $this.d20(tmp0_safe_receiver.gq_1) + ')';
|
|
908
|
-
}
|
|
909
|
-
var tmp1_elvis_lhs = tmp_6;
|
|
910
|
-
return trimMargin('\n |case ' + tmp + '.Response' + _this__u8e3s4.hq_1 + '():\n |' + tmp_0 + 'return Wirespec.RawResponse(\n |' + tmp_1 + 'status_code = response.status,\n |' + tmp_2 + 'headers = ' + tmp_4 + ',\n |' + tmp_5 + 'body = ' + (tmp1_elvis_lhs == null ? 'type(None)' : tmp1_elvis_lhs) + ',\n |' + Spacer_instance.is(1) + ')\n ');
|
|
911
|
-
}
|
|
912
|
-
function emitSerializedParams($this, _this__u8e3s4, type, fields) {
|
|
913
|
-
return '"' + _this__u8e3s4.rp_1.l1() + '": serialization.serialize_param(' + type + '.' + fields + '.' + $this.or(_this__u8e3s4.rp_1) + ', ' + $this.d20(_this__u8e3s4.sp_1) + ')';
|
|
914
|
-
}
|
|
915
|
-
function emitObject($this, _this__u8e3s4, name, extends_0, spaces, block) {
|
|
916
|
-
var tmp;
|
|
917
|
-
if (_this__u8e3s4.r()) {
|
|
918
|
-
tmp = trimMargin('\n |' + Spacer_instance.is(spaces) + '@dataclass\n |' + Spacer_instance.is(spaces) + 'class ' + name + ' (' + extends_0 + '): pass\n ');
|
|
919
|
-
} else {
|
|
920
|
-
var tmp_0 = Spacer_instance.is(spaces);
|
|
921
|
-
var tmp_1 = Spacer_instance.is(spaces);
|
|
922
|
-
tmp = trimMargin('\n |' + tmp_0 + '@dataclass\n |' + tmp_1 + 'class ' + name + ' (' + extends_0 + '):\n |' + joinToString(_this__u8e3s4, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitObject$lambda(spaces, block)) + '\n ');
|
|
923
|
-
}
|
|
924
|
-
return tmp;
|
|
925
|
-
}
|
|
926
|
-
function emitObject$default($this, _this__u8e3s4, name, extends_0, spaces, block, $super) {
|
|
927
|
-
spaces = spaces === VOID ? 1 : spaces;
|
|
928
|
-
return emitObject($this, _this__u8e3s4, name, extends_0, spaces, block);
|
|
929
|
-
}
|
|
930
|
-
function emit_17($this, _this__u8e3s4) {
|
|
931
|
-
return $this.or(_this__u8e3s4.cq_1) + ': ' + $this.oq(_this__u8e3s4.dq_1);
|
|
932
|
-
}
|
|
933
|
-
function emit_18($this, _this__u8e3s4) {
|
|
934
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.gq_1;
|
|
935
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.oq(tmp1_safe_receiver);
|
|
936
|
-
return tmp2_elvis_lhs == null ? 'None' : tmp2_elvis_lhs;
|
|
937
|
-
}
|
|
938
|
-
function PythonEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
939
|
-
return function (it) {
|
|
940
|
-
return this$0.e20(it);
|
|
941
|
-
};
|
|
942
|
-
}
|
|
943
|
-
function PythonEndpointDefinitionEmitter$emit$lambda_0(this$0, $endpoint) {
|
|
944
|
-
return function (it) {
|
|
945
|
-
return this$0.c20(it, $endpoint);
|
|
946
|
-
};
|
|
947
|
-
}
|
|
948
|
-
function PythonEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
949
|
-
return function (it) {
|
|
950
|
-
return emit_17(this$0, it);
|
|
951
|
-
};
|
|
952
|
-
}
|
|
953
|
-
function PythonEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
954
|
-
return function (it) {
|
|
955
|
-
return this$0.nq(it);
|
|
956
|
-
};
|
|
957
|
-
}
|
|
958
|
-
function PythonEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
959
|
-
return function (it) {
|
|
960
|
-
return this$0.nq(it);
|
|
961
|
-
};
|
|
962
|
-
}
|
|
963
|
-
function PythonEndpointDefinitionEmitter$emit$lambda_4(this$0) {
|
|
964
|
-
return function (it) {
|
|
965
|
-
return emit_16(this$0, it);
|
|
966
|
-
};
|
|
967
|
-
}
|
|
968
|
-
function PythonEndpointDefinitionEmitter$emitToRawRequest$lambda(this$0) {
|
|
969
|
-
return function (it) {
|
|
970
|
-
var tmp;
|
|
971
|
-
if (it instanceof Literal) {
|
|
972
|
-
tmp = '"' + it.yq_1 + '"';
|
|
973
|
-
} else {
|
|
974
|
-
if (it instanceof Param) {
|
|
975
|
-
tmp = 'str(request.path.' + this$0.or(it.cq_1) + ')';
|
|
976
|
-
} else {
|
|
977
|
-
noWhenBranchMatchedException();
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
return tmp;
|
|
981
|
-
};
|
|
982
|
-
}
|
|
983
|
-
function PythonEndpointDefinitionEmitter$emitToRawRequest$lambda_0(this$0) {
|
|
984
|
-
return function (it) {
|
|
985
|
-
return emitSerializedParams(this$0, it, 'request', 'queries');
|
|
986
|
-
};
|
|
987
|
-
}
|
|
988
|
-
function PythonEndpointDefinitionEmitter$emitToRawRequest$lambda_1(this$0) {
|
|
989
|
-
return function (it) {
|
|
990
|
-
return emitSerializedParams(this$0, it, 'request', 'headers');
|
|
991
|
-
};
|
|
992
|
-
}
|
|
993
|
-
function PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda(this$0) {
|
|
994
|
-
return function (it) {
|
|
995
|
-
return emitDeserialized(this$0, it);
|
|
996
|
-
};
|
|
997
|
-
}
|
|
998
|
-
function PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda_0(this$0) {
|
|
999
|
-
return function (it) {
|
|
1000
|
-
return emitDeserializedParams$default(this$0, it, 'request', 'queries');
|
|
1001
|
-
};
|
|
1002
|
-
}
|
|
1003
|
-
function PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda_1(this$0) {
|
|
1004
|
-
return function (it) {
|
|
1005
|
-
return emitDeserializedParams$default(this$0, it, 'request', 'headers', VOID, false);
|
|
1006
|
-
};
|
|
1007
|
-
}
|
|
1008
|
-
function PythonEndpointDefinitionEmitter$emitResponseUnion$lambda(it) {
|
|
1009
|
-
return 'Response' + it.hq_1;
|
|
1010
|
-
}
|
|
1011
|
-
function PythonEndpointDefinitionEmitter$emitAssignSelf$lambda(this$0) {
|
|
1012
|
-
return function (it) {
|
|
1013
|
-
return emitAssignSelf(this$0, it);
|
|
1014
|
-
};
|
|
1015
|
-
}
|
|
1016
|
-
function PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_0(this$0) {
|
|
1017
|
-
return function (it) {
|
|
1018
|
-
return emitAssignSelf(this$0, it);
|
|
1019
|
-
};
|
|
1020
|
-
}
|
|
1021
|
-
function PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_1(this$0) {
|
|
1022
|
-
return function (it) {
|
|
1023
|
-
return emitAssignSelf(this$0, it);
|
|
1024
|
-
};
|
|
1025
|
-
}
|
|
1026
|
-
function PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_2(this$0) {
|
|
1027
|
-
return function (it) {
|
|
1028
|
-
return emitAssignSelf(this$0, it);
|
|
1029
|
-
};
|
|
1030
|
-
}
|
|
1031
|
-
function PythonEndpointDefinitionEmitter$emit$lambda_5(this$0) {
|
|
1032
|
-
return function (it) {
|
|
1033
|
-
return this$0.nq(it);
|
|
1034
|
-
};
|
|
1035
|
-
}
|
|
1036
|
-
function PythonEndpointDefinitionEmitter$emit$lambda_6(this$0) {
|
|
1037
|
-
return function (it) {
|
|
1038
|
-
return emit_16(this$0, it);
|
|
1039
|
-
};
|
|
1040
|
-
}
|
|
1041
|
-
function PythonEndpointDefinitionEmitter$emitToRawResponse$lambda(this$0, $this_emitToRawResponse) {
|
|
1042
|
-
return function (it) {
|
|
1043
|
-
return emitSerialized(this$0, it, $this_emitToRawResponse);
|
|
1044
|
-
};
|
|
1045
|
-
}
|
|
1046
|
-
function PythonEndpointDefinitionEmitter$emitFromRawResponse$lambda(this$0, $this_emitFromRawResponse) {
|
|
1047
|
-
return function (it) {
|
|
1048
|
-
return emitDeserialized_0(this$0, it, $this_emitFromRawResponse);
|
|
1049
|
-
};
|
|
1050
|
-
}
|
|
1051
|
-
function PythonEndpointDefinitionEmitter$emitDeserialized$lambda(this$0) {
|
|
1052
|
-
return function (it) {
|
|
1053
|
-
return emitDeserializedParams_0(this$0, it, 'response', 'headers', 2, false);
|
|
1054
|
-
};
|
|
1055
|
-
}
|
|
1056
|
-
function PythonEndpointDefinitionEmitter$emitSerialized$lambda(this$0) {
|
|
1057
|
-
return function (it) {
|
|
1058
|
-
return emitSerializedParams(this$0, it, 'response', 'headers');
|
|
1059
|
-
};
|
|
1060
|
-
}
|
|
1061
|
-
function PythonEndpointDefinitionEmitter$emitObject$lambda($spaces, $block) {
|
|
1062
|
-
return function (it) {
|
|
1063
|
-
return Spacer_instance.is($spaces + 2 | 0) + $block(it);
|
|
1064
|
-
};
|
|
1065
|
-
}
|
|
1066
|
-
function PythonEndpointDefinitionEmitter() {
|
|
1067
|
-
}
|
|
1068
|
-
function sanitizeNegative($this, _this__u8e3s4) {
|
|
1069
|
-
return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
|
|
1070
|
-
}
|
|
1071
|
-
function sanitizeEnum($this, _this__u8e3s4) {
|
|
1072
|
-
// Inline function 'kotlin.let' call
|
|
1073
|
-
var it = joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_');
|
|
1074
|
-
var tmp;
|
|
1075
|
-
var tmp0_safe_receiver = firstOrNull(it);
|
|
1076
|
-
var tmp_0;
|
|
1077
|
-
var tmp_1 = tmp0_safe_receiver;
|
|
1078
|
-
if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
|
|
1079
|
-
tmp_0 = null;
|
|
1080
|
-
} else {
|
|
1081
|
-
tmp_0 = isDigit(tmp0_safe_receiver);
|
|
1082
|
-
}
|
|
1083
|
-
if (tmp_0 === true) {
|
|
1084
|
-
tmp = '_' + it;
|
|
1085
|
-
} else {
|
|
1086
|
-
tmp = it;
|
|
1087
|
-
}
|
|
1088
|
-
return tmp;
|
|
1089
|
-
}
|
|
1090
|
-
function PythonEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
1091
|
-
return function (it) {
|
|
1092
|
-
return Spacer_instance.toString() + this$0.l1y(sanitizeEnum(this$0, it)) + ' = "' + it + '"';
|
|
1093
|
-
};
|
|
1094
|
-
}
|
|
1095
|
-
function PythonEnumDefinitionEmitter() {
|
|
1096
|
-
}
|
|
1097
|
-
function Companion() {
|
|
1098
|
-
Companion_instance_2 = this;
|
|
1099
|
-
this.f20_1 = setOf(['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']);
|
|
1100
|
-
}
|
|
1101
|
-
var Companion_instance_2;
|
|
1102
|
-
function Companion_getInstance_0() {
|
|
1103
|
-
if (Companion_instance_2 == null)
|
|
1104
|
-
new Companion();
|
|
1105
|
-
return Companion_instance_2;
|
|
1106
|
-
}
|
|
1107
|
-
function PythonIdentifierEmitter() {
|
|
1108
|
-
}
|
|
2
|
+
KProperty1ca4yb4wlo496 as KProperty1,
|
|
3
|
+
getPropertyCallableRef3hckxc0xueiaj as getPropertyCallableRef,
|
|
4
|
+
split2bvyvnrlcifjv as split,
|
|
5
|
+
collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
|
|
6
|
+
ArrayList_init_$Create$3ivpeip4ouddx as ArrayList_init_$Create$,
|
|
7
|
+
checkIndexOverflow3frtmheghr0th as checkIndexOverflow,
|
|
8
|
+
Unit_instance28fytmsmm6r23 as Unit_instance,
|
|
9
|
+
joinToString1cxrrlmo0chqs as joinToString,
|
|
10
|
+
StringBuilder_init_$Create$322n630qt3r8c as StringBuilder_init_$Create$,
|
|
11
|
+
charSequenceLength3278n89t01tmv as charSequenceLength,
|
|
12
|
+
charSequenceGet1vxk1y5n17t1z as charSequenceGet,
|
|
13
|
+
isLetterOrDigit2kuxd9e198haf as isLetterOrDigit,
|
|
14
|
+
_Char___init__impl__6a9atx1csff5kwtduxl as _Char___init__impl__6a9atx,
|
|
15
|
+
firstOrNulltrxqttxfxqju as firstOrNull,
|
|
16
|
+
isDigit3mimrri4wkzop as isDigit,
|
|
17
|
+
Char19o2r8palgjof as Char,
|
|
18
|
+
listOf1jh22dvmctj1r as listOf,
|
|
19
|
+
protoOf180f3jzyo7rfj as protoOf,
|
|
20
|
+
initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
|
|
21
|
+
equals2au1ep9vhcato as equals,
|
|
22
|
+
FunctionAdapter3lcrrz3moet5b as FunctionAdapter,
|
|
23
|
+
isInterface3d6p8outrmvmk as isInterface,
|
|
24
|
+
Comparator2b3maoeh98xtg as Comparator,
|
|
25
|
+
hashCodeq5arwsb9dgti as hashCode,
|
|
26
|
+
initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
|
|
27
|
+
VOID3gxj6tk5isa35 as VOID,
|
|
28
|
+
listOfvhqybd2zx248 as listOf_0,
|
|
29
|
+
to2cs3ny02qtbcb as to,
|
|
30
|
+
toMap1vec9topfei08 as toMap,
|
|
31
|
+
compareValues1n2ayl87ihzfk as compareValues,
|
|
32
|
+
startsWith26w8qjqapeeq6 as startsWith,
|
|
33
|
+
substringBefore3n7kj60w69hju as substringBefore,
|
|
34
|
+
endsWith3cq61xxngobwh as endsWith,
|
|
35
|
+
lazy2hsh8ze7j6ikd as lazy,
|
|
36
|
+
sortedWith2csnbbb21k0lg as sortedWith,
|
|
37
|
+
ensureNotNull1e947j3ixpazm as ensureNotNull,
|
|
38
|
+
Collection1k04j3hzsbod0 as Collection,
|
|
39
|
+
ArrayList_init_$Create$1jemgvhi5v0js as ArrayList_init_$Create$_0,
|
|
40
|
+
emptyList1g2z5xcrvp2zy as emptyList,
|
|
41
|
+
dropLast1vpiyky649o34 as dropLast,
|
|
42
|
+
drop3na99dw9feawf as drop,
|
|
43
|
+
asSequence2phdjljfh9jhx as asSequence,
|
|
44
|
+
filterNot56uwv8hfomaa as filterNot,
|
|
45
|
+
mapsbvh18eqox7a as map,
|
|
46
|
+
distinct17vua5ffe1cfv as distinct,
|
|
47
|
+
toListx6x8nvfmvvht as toList,
|
|
48
|
+
LinkedHashSet_init_$Create$2lru2gvxodydo as LinkedHashSet_init_$Create$,
|
|
49
|
+
THROW_CCE2g6jy02ryeudk as THROW_CCE,
|
|
50
|
+
plus310ted5e4i90h as plus,
|
|
51
|
+
distinct10qe1scfdvu5k as distinct_0,
|
|
52
|
+
HashSet_init_$Create$33p49hmosnvr4 as HashSet_init_$Create$,
|
|
53
|
+
toSet2orjxp16sotqu as toSet,
|
|
54
|
+
addAll1k27qatfgp3k5 as addAll,
|
|
55
|
+
firstOrNull1982767dljvdy as firstOrNull_0,
|
|
56
|
+
Paire9pteg33gng7 as Pair,
|
|
57
|
+
plus20p0vtfmu0596 as plus_0,
|
|
58
|
+
emptySetcxexqki71qfa as emptySet,
|
|
59
|
+
removePrefix279df90bhrqqg as removePrefix,
|
|
60
|
+
contains3ue2qo8xhmpf1 as contains,
|
|
61
|
+
mapCapacity1h45rc3eh9p2l as mapCapacity,
|
|
62
|
+
LinkedHashMap_init_$Create$1s75e1k23v4xj as LinkedHashMap_init_$Create$,
|
|
63
|
+
} from './kotlin-kotlin-stdlib.mjs';
|
|
64
|
+
import {
|
|
65
|
+
Companion_instancebcq57hoyp8c2 as Companion_instance,
|
|
66
|
+
FieldIdentifier34k7iphndcnl0 as FieldIdentifier,
|
|
67
|
+
Companion_instance1a2xqc448tlhh as Companion_instance_0,
|
|
68
|
+
Companion_instance2ryk3262e300f as Companion_instance_1,
|
|
69
|
+
FileExtension_Python_getInstance36wtqnbvfrtmh as FileExtension_Python_getInstance,
|
|
70
|
+
Endpoint1jsq06yr3xdhp as Endpoint,
|
|
71
|
+
Model1nx3had6rojzt as Model,
|
|
72
|
+
Unionccsavx6nrdr2 as Union,
|
|
73
|
+
Refined1lkzc0dg6wey7 as Refined,
|
|
74
|
+
Enum3l2iuc342kle6 as Enum,
|
|
75
|
+
Type12n1gx16iqtcu as Type,
|
|
76
|
+
importReferencesy4xv7r53sjjs as importReferences,
|
|
77
|
+
plus14o24vdaiongg as plus_1,
|
|
78
|
+
String1czvr8pxnm6on as String_0,
|
|
79
|
+
} from './wirespec-src-compiler-core.mjs';
|
|
80
|
+
import {
|
|
81
|
+
import5uhkz67bd8tt as import_0,
|
|
82
|
+
PythonGenerator_getInstancek8q2vsn20wkr as PythonGenerator_getInstance,
|
|
83
|
+
Nameoqr8dt2fim9d as Name,
|
|
84
|
+
transformChildren2mszeagj5nq4c as transformChildren,
|
|
85
|
+
sanitizeFieldName1ptgy1kxy8u2m as sanitizeFieldName,
|
|
86
|
+
ConstructorStatement1x4n4sr59iy4n as ConstructorStatement,
|
|
87
|
+
SanitizationConfig11mmn3p2c03c1 as SanitizationConfig,
|
|
88
|
+
sortKey2uc13shubz5xy as sortKey,
|
|
89
|
+
RawExpression2bo7ldfrptjia as RawExpression,
|
|
90
|
+
transformChildren3n5cjwmxlhwx9 as transformChildren_0,
|
|
91
|
+
convertnty9x0e63d0u as convert,
|
|
92
|
+
Companion_getInstance3gvtuyxc9uhxj as Companion_getInstance,
|
|
93
|
+
rawttvqxl50flj9 as raw,
|
|
94
|
+
File3dimy4iqmuock as File,
|
|
95
|
+
emit3bzdcd0f6nwtj as emit,
|
|
96
|
+
emitn3eihixilqyh as emit_0,
|
|
97
|
+
prependImports32gcj3yb8voha as prependImports,
|
|
98
|
+
placeInModule10pilwex0h8tn as placeInModule,
|
|
99
|
+
convertToGenerator2wzjrmaavxhph as convertToGenerator,
|
|
100
|
+
convertToGeneratorkggw47cqose7 as convertToGenerator_0,
|
|
101
|
+
convertToGenerator3rjr3azp4vdsx as convertToGenerator_1,
|
|
102
|
+
convertToGenerator2msmr3acdd5nx as convertToGenerator_2,
|
|
103
|
+
sanitizeNames2wqmyf8vafp9x as sanitizeNames,
|
|
104
|
+
collectCustomTypeNames373f3lwl9sqd5 as collectCustomTypeNames,
|
|
105
|
+
TransformScopeyrd3lf4zrk76 as TransformScope,
|
|
106
|
+
Elementitq62jg6fid3 as Element,
|
|
107
|
+
placeInModuleewt2r4ic2m6a as placeInModule_0,
|
|
108
|
+
convertWithValidation3ar3nbcqsbkpn as convertWithValidation,
|
|
109
|
+
injectSelfReceiverToValidate4xgr9r5gl5n3 as injectSelfReceiverToValidate,
|
|
110
|
+
convert11ert2po54h1y as convert_0,
|
|
111
|
+
sanitizeEnumEntries3pphrvzq8r9fn as sanitizeEnumEntries,
|
|
112
|
+
convert37aabdzvtv9vg as convert_1,
|
|
113
|
+
convert17zcptkz4mhr4 as convert_2,
|
|
114
|
+
convert32tuiui3czihh as convert_3,
|
|
115
|
+
convert1cn4bolzoed8c as convert_4,
|
|
116
|
+
convert3ewo9inue7gua as convert_5,
|
|
117
|
+
emitEndpointClient1meajc90wf3el as emitEndpointClient,
|
|
118
|
+
emitClient32kfwzg2hm5vj as emitClient,
|
|
119
|
+
get_extensions31c4or738wbxz as get_extensions,
|
|
120
|
+
emit1oxjujel6f3jb as emit_1,
|
|
121
|
+
beforeGenerate3o8idb3hey1b0 as beforeGenerate,
|
|
122
|
+
IrEmitterh2m93ojzvkep as IrEmitter,
|
|
123
|
+
TransformerBuildera6a1gvlhjj9b as TransformerBuilder,
|
|
124
|
+
transform3eti8i2bqvifx as transform,
|
|
125
|
+
Namespace345pal554qu3j as Namespace,
|
|
126
|
+
Union38f3pecvfcpxh as Union_0,
|
|
127
|
+
Struct39wf79cwtn4ty as Struct,
|
|
128
|
+
fieldList3dg35dj9v5h4v as fieldList,
|
|
129
|
+
Dict22iqrhoo0g8et as Dict,
|
|
130
|
+
Array2goj74t0aak7b as Array_0,
|
|
131
|
+
Nullable3wjn6l6q3h6o as Nullable,
|
|
132
|
+
Any_instance2998xag3cdzh3 as Any_instance,
|
|
133
|
+
Custom_init_$Create$2enn7oyj71j1t as Custom_init_$Create$,
|
|
134
|
+
Reflect_instance3i17lxiopj78t as Reflect_instance,
|
|
135
|
+
Field354s1ceh5pvhf as Field,
|
|
136
|
+
transformChildrend9p91tpcqdkx as transformChildren_1,
|
|
137
|
+
Boolean_instance27opaqtiiiysz as Boolean_instance,
|
|
138
|
+
String_instance3uxvo48ki208u as String_instance,
|
|
139
|
+
Function21cuq8qizkin7 as Function,
|
|
140
|
+
function12vu2kapzno4w as function_0,
|
|
141
|
+
VariableReference2vlynnhaw1i64 as VariableReference,
|
|
142
|
+
FieldCall1iz7z2fx2xo4p as FieldCall,
|
|
143
|
+
convertConstraintkgpvomct0x0s as convertConstraint,
|
|
144
|
+
Interface3pn84xq686t2r as Interface,
|
|
145
|
+
Custom2si7lto3wompr as Custom,
|
|
146
|
+
Parameteruqoxd4rzw7ga as Parameter,
|
|
147
|
+
FunctionCall30872kpnbr7op as FunctionCall,
|
|
148
|
+
} from './wirespec-src-compiler-ir.mjs';
|
|
149
|
+
import {
|
|
150
|
+
NonEmptyList3ak25ihy2gcvs as NonEmptyList,
|
|
151
|
+
toNonEmptyListOrNull2ovnnazjb3msz as toNonEmptyListOrNull,
|
|
152
|
+
NonEmptyList__plus_impl_xqmb92tle8a7jcf2wm as NonEmptyList__plus_impl_xqmb9,
|
|
153
|
+
NonEmptyList__plus_impl_xqmb91y38uyofmba13 as NonEmptyList__plus_impl_xqmb9_0,
|
|
154
|
+
} from './arrow-arrow-core.mjs';
|
|
155
|
+
//region block: imports
|
|
156
|
+
//endregion
|
|
157
|
+
//region block: pre-declaration
|
|
158
|
+
initMetadataForCompanion(Companion);
|
|
159
|
+
initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
|
|
160
|
+
initMetadataForClass(PythonIrEmitter, 'PythonIrEmitter', PythonIrEmitter, VOID, [IrEmitter]);
|
|
161
|
+
//endregion
|
|
1109
162
|
function _get_sanitizationConfig__sns434($this) {
|
|
1110
|
-
var tmp0 = $this.
|
|
163
|
+
var tmp0 = $this.p1y_1;
|
|
1111
164
|
var tmp = KProperty1;
|
|
1112
165
|
// Inline function 'kotlin.getValue' call
|
|
1113
166
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, PythonIrEmitter$_get_sanitizationConfig_$ref_1q5eai(), null);
|
|
1114
|
-
return tmp0.
|
|
167
|
+
return tmp0.m1();
|
|
1115
168
|
}
|
|
1116
|
-
function
|
|
169
|
+
function sanitize($this, _this__u8e3s4) {
|
|
1117
170
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
1118
|
-
var this_0 = split(_this__u8e3s4.
|
|
171
|
+
var this_0 = split(_this__u8e3s4.m1(), ['.', ' ']);
|
|
1119
172
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
1120
|
-
var destination = ArrayList_init_$Create$
|
|
173
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1121
174
|
var index = 0;
|
|
1122
175
|
var _iterator__ex2g4s = this_0.t();
|
|
1123
176
|
while (_iterator__ex2g4s.u()) {
|
|
1124
177
|
var item = _iterator__ex2g4s.v();
|
|
1125
178
|
var _unary__edvuaz = index;
|
|
1126
179
|
index = _unary__edvuaz + 1 | 0;
|
|
1127
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ?
|
|
180
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance.dr(item) : item;
|
|
1128
181
|
destination.x(tmp$ret$0);
|
|
1129
182
|
}
|
|
1130
183
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1163,16 +216,16 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
1163
216
|
var it_0 = tmp;
|
|
1164
217
|
var tmp_2;
|
|
1165
218
|
if (_this__u8e3s4 instanceof FieldIdentifier) {
|
|
1166
|
-
tmp_2 =
|
|
219
|
+
tmp_2 = sanitizeKeywords($this, it_0);
|
|
1167
220
|
} else {
|
|
1168
221
|
tmp_2 = it_0;
|
|
1169
222
|
}
|
|
1170
223
|
return tmp_2;
|
|
1171
224
|
}
|
|
1172
|
-
function
|
|
1173
|
-
return
|
|
225
|
+
function sanitizeKeywords($this, _this__u8e3s4) {
|
|
226
|
+
return Companion_getInstance_0().v1x().v1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1174
227
|
}
|
|
1175
|
-
function
|
|
228
|
+
function sanitizeEnum($this, _this__u8e3s4) {
|
|
1176
229
|
// Inline function 'kotlin.let' call
|
|
1177
230
|
var it = joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_');
|
|
1178
231
|
var tmp;
|
|
@@ -1194,34 +247,37 @@ function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
|
1194
247
|
function buildImports($this, wirespecPath) {
|
|
1195
248
|
return listOf([import_0('__future__', 'annotations'), import_0('', 're'), import_0('abc', 'ABC'), import_0('abc', 'abstractmethod'), import_0('dataclasses', 'dataclass'), import_0('typing', 'Any'), import_0('typing', 'Generic'), import_0('typing', 'List'), import_0('typing', 'Optional'), import_0('', 'enum'), import_0(wirespecPath, 'T'), import_0(wirespecPath, 'Wirespec'), import_0(wirespecPath, '_raise')]);
|
|
1196
249
|
}
|
|
1197
|
-
function
|
|
1198
|
-
|
|
1199
|
-
this.
|
|
250
|
+
function Companion() {
|
|
251
|
+
Companion_instance_2 = this;
|
|
252
|
+
this.r1y_1 = PythonGenerator_getInstance();
|
|
1200
253
|
}
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
254
|
+
protoOf(Companion).v1x = function () {
|
|
255
|
+
return this.r1y_1.a1x_1;
|
|
256
|
+
};
|
|
257
|
+
var Companion_instance_2;
|
|
258
|
+
function Companion_getInstance_0() {
|
|
259
|
+
if (Companion_instance_2 == null)
|
|
260
|
+
new Companion();
|
|
261
|
+
return Companion_instance_2;
|
|
1206
262
|
}
|
|
1207
|
-
function sam$kotlin_Comparator$
|
|
1208
|
-
this.
|
|
263
|
+
function sam$kotlin_Comparator$0(function_0) {
|
|
264
|
+
this.s1y_1 = function_0;
|
|
1209
265
|
}
|
|
1210
|
-
protoOf(sam$kotlin_Comparator$
|
|
1211
|
-
return this.
|
|
266
|
+
protoOf(sam$kotlin_Comparator$0).ud = function (a, b) {
|
|
267
|
+
return this.s1y_1(a, b);
|
|
1212
268
|
};
|
|
1213
|
-
protoOf(sam$kotlin_Comparator$
|
|
1214
|
-
return this.
|
|
269
|
+
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
270
|
+
return this.ud(a, b);
|
|
1215
271
|
};
|
|
1216
|
-
protoOf(sam$kotlin_Comparator$
|
|
1217
|
-
return this.
|
|
272
|
+
protoOf(sam$kotlin_Comparator$0).m3 = function () {
|
|
273
|
+
return this.s1y_1;
|
|
1218
274
|
};
|
|
1219
|
-
protoOf(sam$kotlin_Comparator$
|
|
275
|
+
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
1220
276
|
var tmp;
|
|
1221
277
|
if (!(other == null) ? isInterface(other, Comparator) : false) {
|
|
1222
278
|
var tmp_0;
|
|
1223
279
|
if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
|
|
1224
|
-
tmp_0 = equals(this.
|
|
280
|
+
tmp_0 = equals(this.m3(), other.m3());
|
|
1225
281
|
} else {
|
|
1226
282
|
tmp_0 = false;
|
|
1227
283
|
}
|
|
@@ -1231,18 +287,18 @@ protoOf(sam$kotlin_Comparator$0_0).equals = function (other) {
|
|
|
1231
287
|
}
|
|
1232
288
|
return tmp;
|
|
1233
289
|
};
|
|
1234
|
-
protoOf(sam$kotlin_Comparator$
|
|
1235
|
-
return hashCode(this.
|
|
290
|
+
protoOf(sam$kotlin_Comparator$0).hashCode = function () {
|
|
291
|
+
return hashCode(this.m3());
|
|
1236
292
|
};
|
|
1237
293
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
1238
294
|
return '_' + it;
|
|
1239
295
|
}
|
|
1240
296
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(name) {
|
|
1241
|
-
var sanitized = name.
|
|
297
|
+
var sanitized = name.f1h_1.b1() > 1 ? name.t1m() : name.g1j();
|
|
1242
298
|
return new Name(listOf_0(sanitized));
|
|
1243
299
|
}
|
|
1244
300
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(name) {
|
|
1245
|
-
return new Name(listOf_0(name.
|
|
301
|
+
return new Name(listOf_0(name.t1m()));
|
|
1246
302
|
}
|
|
1247
303
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(it) {
|
|
1248
304
|
return it;
|
|
@@ -1251,20 +307,20 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1251
307
|
return function (stmt, tr) {
|
|
1252
308
|
var tmp;
|
|
1253
309
|
if (stmt instanceof ConstructorStatement) {
|
|
1254
|
-
var tmp_0 = tr.
|
|
310
|
+
var tmp_0 = tr.s1v(stmt.y1n_1);
|
|
1255
311
|
// Inline function 'kotlin.collections.map' call
|
|
1256
|
-
var this_0 = stmt.
|
|
312
|
+
var this_0 = stmt.z1n_1;
|
|
1257
313
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1258
|
-
var destination = ArrayList_init_$Create$
|
|
314
|
+
var destination = ArrayList_init_$Create$(this_0.b1());
|
|
1259
315
|
// Inline function 'kotlin.collections.iterator' call
|
|
1260
|
-
var _iterator__ex2g4s = this_0.
|
|
316
|
+
var _iterator__ex2g4s = this_0.k1().t();
|
|
1261
317
|
while (_iterator__ex2g4s.u()) {
|
|
1262
318
|
var item = _iterator__ex2g4s.v();
|
|
1263
319
|
// Inline function 'kotlin.collections.component1' call
|
|
1264
|
-
var k = item.
|
|
320
|
+
var k = item.l1();
|
|
1265
321
|
// Inline function 'kotlin.collections.component2' call
|
|
1266
|
-
var v = item.
|
|
1267
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.
|
|
322
|
+
var v = item.m1();
|
|
323
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.v1v(v));
|
|
1268
324
|
destination.x(tmp$ret$3);
|
|
1269
325
|
}
|
|
1270
326
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
@@ -1276,7 +332,7 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1276
332
|
}
|
|
1277
333
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1278
334
|
return function () {
|
|
1279
|
-
var tmp =
|
|
335
|
+
var tmp = Companion_getInstance_0().v1x();
|
|
1280
336
|
var tmp_0 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1281
337
|
var tmp_1 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0;
|
|
1282
338
|
var tmp_2 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1;
|
|
@@ -1296,7 +352,7 @@ function PythonIrEmitter$emit$lambda(a, b) {
|
|
|
1296
352
|
return compareValues(tmp, tmp$ret$1);
|
|
1297
353
|
}
|
|
1298
354
|
function emit$emitInitImport(this$0, def) {
|
|
1299
|
-
return import_0('.' +
|
|
355
|
+
return import_0('.' + sanitize(this$0, def.mr()), sanitize(this$0, def.mr()));
|
|
1300
356
|
}
|
|
1301
357
|
function PythonIrEmitter$emitGenerator$lambda(it) {
|
|
1302
358
|
return startsWith(it, 'Wirespec.') || it === 'Wirespec';
|
|
@@ -1315,17 +371,17 @@ function PythonIrEmitter$emitGenerator$lambda_2($generatorOwnName, $generatorRef
|
|
|
1315
371
|
var tmp_0;
|
|
1316
372
|
var tmp_1;
|
|
1317
373
|
if (expr instanceof RawExpression) {
|
|
1318
|
-
tmp_1 = endsWith(expr.
|
|
374
|
+
tmp_1 = endsWith(expr.r1q_1, 'Generator');
|
|
1319
375
|
} else {
|
|
1320
376
|
tmp_1 = false;
|
|
1321
377
|
}
|
|
1322
378
|
if (tmp_1) {
|
|
1323
|
-
tmp_0 = !(expr.
|
|
379
|
+
tmp_0 = !(expr.r1q_1 === $generatorOwnName);
|
|
1324
380
|
} else {
|
|
1325
381
|
tmp_0 = false;
|
|
1326
382
|
}
|
|
1327
383
|
if (tmp_0) {
|
|
1328
|
-
$generatorRefs.x(expr.
|
|
384
|
+
$generatorRefs.x(expr.r1q_1);
|
|
1329
385
|
tmp = Unit_instance;
|
|
1330
386
|
}
|
|
1331
387
|
return transformChildren_0(expr, t);
|
|
@@ -1333,48 +389,48 @@ function PythonIrEmitter$emitGenerator$lambda_2($generatorOwnName, $generatorRef
|
|
|
1333
389
|
}
|
|
1334
390
|
function PythonIrEmitter$emit$lambda_0(this$0) {
|
|
1335
391
|
return function (it) {
|
|
1336
|
-
return
|
|
392
|
+
return sanitizeKeywords(this$0, sanitizeEnum(this$0, it));
|
|
1337
393
|
};
|
|
1338
394
|
}
|
|
1339
395
|
function PythonIrEmitter(packageName, emitShared) {
|
|
1340
|
-
|
|
1341
|
-
packageName = packageName === VOID ?
|
|
1342
|
-
emitShared = emitShared === VOID ?
|
|
1343
|
-
this.
|
|
1344
|
-
this.
|
|
1345
|
-
this.
|
|
1346
|
-
this.
|
|
396
|
+
Companion_getInstance_0();
|
|
397
|
+
packageName = packageName === VOID ? Companion_instance_0.is('community.flock.wirespec.generated') : packageName;
|
|
398
|
+
emitShared = emitShared === VOID ? Companion_instance_1.fp() : emitShared;
|
|
399
|
+
this.l1y_1 = packageName;
|
|
400
|
+
this.m1y_1 = emitShared;
|
|
401
|
+
this.n1y_1 = PythonGenerator_getInstance();
|
|
402
|
+
this.o1y_1 = FileExtension_Python_getInstance();
|
|
1347
403
|
var tmp = this;
|
|
1348
|
-
tmp.
|
|
1349
|
-
this.
|
|
404
|
+
tmp.p1y_1 = lazy(PythonIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
405
|
+
this.q1y_1 = "from __future__ import annotations\n\nimport enum\nfrom abc import ABC, abstractmethod\nfrom dataclasses import dataclass\nfrom typing import Any, Callable, Generic, Optional, Type, TypeVar\n\nT = TypeVar('T')\nV = TypeVar('V')\n\n\ndef _raise(msg: str) -> Any:\n raise Exception(msg)\n\n";
|
|
1350
406
|
}
|
|
1351
|
-
protoOf(PythonIrEmitter).
|
|
1352
|
-
return this.
|
|
407
|
+
protoOf(PythonIrEmitter).n1w = function () {
|
|
408
|
+
return this.n1y_1;
|
|
1353
409
|
};
|
|
1354
|
-
protoOf(PythonIrEmitter).
|
|
1355
|
-
return this.
|
|
410
|
+
protoOf(PythonIrEmitter).kr = function () {
|
|
411
|
+
return this.o1y_1;
|
|
1356
412
|
};
|
|
1357
|
-
protoOf(PythonIrEmitter).
|
|
1358
|
-
var source = replaceReflectInNonGenericStructFields(convert(
|
|
413
|
+
protoOf(PythonIrEmitter).r1w = function () {
|
|
414
|
+
var source = replaceReflectInNonGenericStructFields(convert(Companion_instance_0.is('shared')));
|
|
1359
415
|
var tmp;
|
|
1360
|
-
if (this.
|
|
1361
|
-
tmp = new File(Companion_getInstance().
|
|
416
|
+
if (this.m1y_1.gp_1) {
|
|
417
|
+
tmp = new File(Companion_getInstance().h1h(this.l1y_1.ls() + 'wirespec'), listOf_0(raw(this.q1y_1 + PythonGenerator_getInstance().o1w(source))));
|
|
1362
418
|
} else {
|
|
1363
419
|
tmp = null;
|
|
1364
420
|
}
|
|
1365
421
|
return tmp;
|
|
1366
422
|
};
|
|
1367
|
-
protoOf(PythonIrEmitter).
|
|
423
|
+
protoOf(PythonIrEmitter).q1w = function (module_0, logger) {
|
|
1368
424
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
1369
|
-
var this_0 = new NonEmptyList(module_0.
|
|
425
|
+
var this_0 = new NonEmptyList(module_0.gr_1);
|
|
1370
426
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
1371
427
|
var tmp = PythonIrEmitter$emit$lambda;
|
|
1372
|
-
var tmp$ret$0 = new sam$kotlin_Comparator$
|
|
428
|
+
var tmp$ret$0 = new sam$kotlin_Comparator$0(tmp);
|
|
1373
429
|
var tmp$ret$1 = sortedWith(this_0, tmp$ret$0);
|
|
1374
430
|
var tmp_0 = toNonEmptyListOrNull(tmp$ret$1);
|
|
1375
|
-
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).
|
|
1376
|
-
var emitted = emit.call(this, module_0.
|
|
1377
|
-
var tmp0 = new NonEmptyList(module_0.
|
|
431
|
+
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).xm_1;
|
|
432
|
+
var emitted = emit.call(this, module_0.tv(VOID, statements), logger);
|
|
433
|
+
var tmp0 = new NonEmptyList(module_0.gr_1);
|
|
1378
434
|
var tmp$ret$2;
|
|
1379
435
|
$l$block_0: {
|
|
1380
436
|
// Inline function 'kotlin.collections.any' call
|
|
@@ -1399,24 +455,24 @@ protoOf(PythonIrEmitter).x1w = function (module_0, logger) {
|
|
|
1399
455
|
tmp$ret$2 = false;
|
|
1400
456
|
}
|
|
1401
457
|
var hasEndpoints = tmp$ret$2;
|
|
1402
|
-
var tmp_2 = Companion_getInstance().
|
|
458
|
+
var tmp_2 = Companion_getInstance().h1h(this.l1y_1.ls() + '__init__');
|
|
1403
459
|
// Inline function 'kotlin.collections.buildList' call
|
|
1404
460
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1405
461
|
// Inline function 'kotlin.apply' call
|
|
1406
|
-
var this_1 = ArrayList_init_$Create$();
|
|
462
|
+
var this_1 = ArrayList_init_$Create$_0();
|
|
1407
463
|
this_1.x(import_0('.', 'model'));
|
|
1408
464
|
this_1.x(import_0('.', 'endpoint'));
|
|
1409
465
|
if (hasEndpoints) {
|
|
1410
466
|
this_1.x(import_0('.', 'client'));
|
|
1411
467
|
}
|
|
1412
468
|
this_1.x(import_0('.', 'wirespec'));
|
|
1413
|
-
var tmp$ret$7 = this_1.
|
|
469
|
+
var tmp$ret$7 = this_1.p5();
|
|
1414
470
|
var init = new File(tmp_2, tmp$ret$7);
|
|
1415
|
-
var tmp_3 = Companion_getInstance().
|
|
471
|
+
var tmp_3 = Companion_getInstance().h1h(this.l1y_1.ls() + 'endpoint/' + '__init__');
|
|
1416
472
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1417
|
-
var tmp0_0 = new NonEmptyList(module_0.
|
|
473
|
+
var tmp0_0 = new NonEmptyList(module_0.gr_1);
|
|
1418
474
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1419
|
-
var destination = ArrayList_init_$Create$();
|
|
475
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1420
476
|
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
1421
477
|
while (_iterator__ex2g4s_0.u()) {
|
|
1422
478
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
@@ -1426,7 +482,7 @@ protoOf(PythonIrEmitter).x1w = function (module_0, logger) {
|
|
|
1426
482
|
}
|
|
1427
483
|
// Inline function 'kotlin.collections.map' call
|
|
1428
484
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1429
|
-
var destination_0 = ArrayList_init_$Create$
|
|
485
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(destination, 10));
|
|
1430
486
|
var _iterator__ex2g4s_1 = destination.t();
|
|
1431
487
|
while (_iterator__ex2g4s_1.u()) {
|
|
1432
488
|
var item = _iterator__ex2g4s_1.v();
|
|
@@ -1434,11 +490,11 @@ protoOf(PythonIrEmitter).x1w = function (module_0, logger) {
|
|
|
1434
490
|
destination_0.x(tmp$ret$10);
|
|
1435
491
|
}
|
|
1436
492
|
var initEndpoint = new File(tmp_3, destination_0);
|
|
1437
|
-
var tmp_4 = Companion_getInstance().
|
|
493
|
+
var tmp_4 = Companion_getInstance().h1h(this.l1y_1.ls() + 'model/' + '__init__');
|
|
1438
494
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1439
|
-
var tmp0_1 = new NonEmptyList(module_0.
|
|
495
|
+
var tmp0_1 = new NonEmptyList(module_0.gr_1);
|
|
1440
496
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1441
|
-
var destination_1 = ArrayList_init_$Create$();
|
|
497
|
+
var destination_1 = ArrayList_init_$Create$_0();
|
|
1442
498
|
var _iterator__ex2g4s_2 = tmp0_1.t();
|
|
1443
499
|
while (_iterator__ex2g4s_2.u()) {
|
|
1444
500
|
var element_1 = _iterator__ex2g4s_2.v();
|
|
@@ -1448,7 +504,7 @@ protoOf(PythonIrEmitter).x1w = function (module_0, logger) {
|
|
|
1448
504
|
}
|
|
1449
505
|
// Inline function 'kotlin.collections.map' call
|
|
1450
506
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1451
|
-
var destination_2 = ArrayList_init_$Create$
|
|
507
|
+
var destination_2 = ArrayList_init_$Create$(collectionSizeOrDefault(destination_1, 10));
|
|
1452
508
|
var _iterator__ex2g4s_3 = destination_1.t();
|
|
1453
509
|
while (_iterator__ex2g4s_3.u()) {
|
|
1454
510
|
var item_0 = _iterator__ex2g4s_3.v();
|
|
@@ -1456,8 +512,8 @@ protoOf(PythonIrEmitter).x1w = function (module_0, logger) {
|
|
|
1456
512
|
destination_2.x(tmp$ret$15);
|
|
1457
513
|
}
|
|
1458
514
|
var initModel = new File(tmp_4, destination_2);
|
|
1459
|
-
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().
|
|
1460
|
-
var tmp0_2 = dropLast(split(this.
|
|
515
|
+
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().h1h(this.l1y_1.ls() + 'client/' + '__init__'), emptyList())) : emptyList();
|
|
516
|
+
var tmp0_2 = dropLast(split(this.l1y_1.js_1, ['.']), 1);
|
|
1461
517
|
var tmp$ret$18;
|
|
1462
518
|
$l$block_1: {
|
|
1463
519
|
// Inline function 'kotlin.collections.runningFold' call
|
|
@@ -1467,7 +523,7 @@ protoOf(PythonIrEmitter).x1w = function (module_0, logger) {
|
|
|
1467
523
|
break $l$block_1;
|
|
1468
524
|
}
|
|
1469
525
|
// Inline function 'kotlin.apply' call
|
|
1470
|
-
var this_2 = ArrayList_init_$Create$
|
|
526
|
+
var this_2 = ArrayList_init_$Create$(estimatedSize + 1 | 0);
|
|
1471
527
|
this_2.x('');
|
|
1472
528
|
var result = this_2;
|
|
1473
529
|
var accumulator = '';
|
|
@@ -1490,21 +546,21 @@ protoOf(PythonIrEmitter).x1w = function (module_0, logger) {
|
|
|
1490
546
|
// Inline function 'kotlin.collections.map' call
|
|
1491
547
|
var this_3 = drop(tmp$ret$18, 1);
|
|
1492
548
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1493
|
-
var destination_3 = ArrayList_init_$Create$
|
|
549
|
+
var destination_3 = ArrayList_init_$Create$(collectionSizeOrDefault(this_3, 10));
|
|
1494
550
|
var _iterator__ex2g4s_5 = this_3.t();
|
|
1495
551
|
while (_iterator__ex2g4s_5.u()) {
|
|
1496
552
|
var item_1 = _iterator__ex2g4s_5.v();
|
|
1497
|
-
var tmp$ret$23 = new File(Companion_getInstance().
|
|
553
|
+
var tmp$ret$23 = new File(Companion_getInstance().h1h(item_1 + '/__init__'), emptyList());
|
|
1498
554
|
destination_3.x(tmp$ret$23);
|
|
1499
555
|
}
|
|
1500
556
|
var parentInits = destination_3;
|
|
1501
|
-
return this.
|
|
557
|
+
return this.m1y_1.gp_1 ? NonEmptyList__plus_impl_xqmb9_0(NonEmptyList__plus_impl_xqmb9_0(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(emitted, init), initEndpoint), initModel), initClient), parentInits) : NonEmptyList__plus_impl_xqmb9_0(NonEmptyList__plus_impl_xqmb9(emitted, init), parentInits);
|
|
1502
558
|
};
|
|
1503
|
-
protoOf(PythonIrEmitter).
|
|
559
|
+
protoOf(PythonIrEmitter).lr = function (definition, module_0, logger) {
|
|
1504
560
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1505
|
-
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.
|
|
561
|
+
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.l1y_1, definition);
|
|
1506
562
|
};
|
|
1507
|
-
protoOf(PythonIrEmitter).
|
|
563
|
+
protoOf(PythonIrEmitter).w1w = function (definition, module_0) {
|
|
1508
564
|
var tmp;
|
|
1509
565
|
if (definition instanceof Type) {
|
|
1510
566
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1525,7 +581,7 @@ protoOf(PythonIrEmitter).d1x = function (definition, module_0) {
|
|
|
1525
581
|
}
|
|
1526
582
|
var generatorFile = tmp;
|
|
1527
583
|
var sanitized = sanitizeNames(generatorFile, _get_sanitizationConfig__sns434(this));
|
|
1528
|
-
var generatorOwnName = definition.
|
|
584
|
+
var generatorOwnName = definition.mr().m1() + 'Generator';
|
|
1529
585
|
var tmp_0 = asSequence(collectCustomTypeNames(sanitized));
|
|
1530
586
|
var tmp_1 = filterNot(tmp_0, PythonIrEmitter$emitGenerator$lambda);
|
|
1531
587
|
var tmp_2 = filterNot(tmp_1, PythonIrEmitter$emitGenerator$lambda_0(generatorOwnName));
|
|
@@ -1534,12 +590,12 @@ protoOf(PythonIrEmitter).d1x = function (definition, module_0) {
|
|
|
1534
590
|
var generatorRefs = LinkedHashSet_init_$Create$();
|
|
1535
591
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1536
592
|
var scope = new TransformScope(sanitized);
|
|
1537
|
-
scope.
|
|
1538
|
-
var tmp_3 = scope.
|
|
593
|
+
scope.i1w(PythonIrEmitter$emitGenerator$lambda_2(generatorOwnName, generatorRefs));
|
|
594
|
+
var tmp_3 = scope.a1w_1;
|
|
1539
595
|
isInterface(tmp_3, Element) || THROW_CCE();
|
|
1540
596
|
// Inline function 'kotlin.collections.filter' call
|
|
1541
597
|
// Inline function 'kotlin.collections.filterTo' call
|
|
1542
|
-
var destination = ArrayList_init_$Create$();
|
|
598
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1543
599
|
var _iterator__ex2g4s = customNames.t();
|
|
1544
600
|
while (_iterator__ex2g4s.u()) {
|
|
1545
601
|
var element = _iterator__ex2g4s.v();
|
|
@@ -1550,7 +606,7 @@ protoOf(PythonIrEmitter).d1x = function (definition, module_0) {
|
|
|
1550
606
|
// Inline function 'kotlin.collections.map' call
|
|
1551
607
|
var this_0 = distinct_0(plus(destination, generatorRefs));
|
|
1552
608
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1553
|
-
var destination_0 = ArrayList_init_$Create$
|
|
609
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1554
610
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
1555
611
|
while (_iterator__ex2g4s_0.u()) {
|
|
1556
612
|
var item = _iterator__ex2g4s_0.v();
|
|
@@ -1560,7 +616,7 @@ protoOf(PythonIrEmitter).d1x = function (definition, module_0) {
|
|
|
1560
616
|
var generatorImports = destination_0;
|
|
1561
617
|
// Inline function 'kotlin.collections.filterNot' call
|
|
1562
618
|
// Inline function 'kotlin.collections.filterNotTo' call
|
|
1563
|
-
var destination_1 = ArrayList_init_$Create$();
|
|
619
|
+
var destination_1 = ArrayList_init_$Create$_0();
|
|
1564
620
|
var _iterator__ex2g4s_1 = customNames.t();
|
|
1565
621
|
while (_iterator__ex2g4s_1.u()) {
|
|
1566
622
|
var element_0 = _iterator__ex2g4s_1.v();
|
|
@@ -1570,7 +626,7 @@ protoOf(PythonIrEmitter).d1x = function (definition, module_0) {
|
|
|
1570
626
|
}
|
|
1571
627
|
// Inline function 'kotlin.collections.map' call
|
|
1572
628
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1573
|
-
var destination_2 = ArrayList_init_$Create$
|
|
629
|
+
var destination_2 = ArrayList_init_$Create$(collectionSizeOrDefault(destination_1, 10));
|
|
1574
630
|
var _iterator__ex2g4s_2 = destination_1.t();
|
|
1575
631
|
while (_iterator__ex2g4s_2.u()) {
|
|
1576
632
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
@@ -1578,39 +634,39 @@ protoOf(PythonIrEmitter).d1x = function (definition, module_0) {
|
|
|
1578
634
|
destination_2.x(tmp$ret$12);
|
|
1579
635
|
}
|
|
1580
636
|
var modelImports = destination_2;
|
|
1581
|
-
return placeInModule_0(prependImports(sanitized, plus(plus(buildImports(this, '..wirespec'), modelImports), generatorImports)), this.
|
|
637
|
+
return placeInModule_0(prependImports(sanitized, plus(plus(buildImports(this, '..wirespec'), modelImports), generatorImports)), this.l1y_1, 'generator');
|
|
1582
638
|
};
|
|
1583
|
-
protoOf(PythonIrEmitter).
|
|
639
|
+
protoOf(PythonIrEmitter).cs = function (type, module_0) {
|
|
1584
640
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1585
641
|
var this_0 = importReferences(type);
|
|
1586
642
|
var set = HashSet_init_$Create$();
|
|
1587
|
-
var list = ArrayList_init_$Create$();
|
|
643
|
+
var list = ArrayList_init_$Create$_0();
|
|
1588
644
|
var _iterator__ex2g4s = this_0.t();
|
|
1589
645
|
while (_iterator__ex2g4s.u()) {
|
|
1590
646
|
var e = _iterator__ex2g4s.v();
|
|
1591
|
-
var key = e.
|
|
647
|
+
var key = e.lv_1;
|
|
1592
648
|
if (set.x(key)) {
|
|
1593
649
|
list.x(e);
|
|
1594
650
|
}
|
|
1595
651
|
}
|
|
1596
652
|
// Inline function 'kotlin.collections.map' call
|
|
1597
653
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1598
|
-
var destination = ArrayList_init_$Create$
|
|
654
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(list, 10));
|
|
1599
655
|
var _iterator__ex2g4s_0 = list.t();
|
|
1600
656
|
while (_iterator__ex2g4s_0.u()) {
|
|
1601
657
|
var item = _iterator__ex2g4s_0.v();
|
|
1602
|
-
var tmp$ret$2 = import_0('.' + item.
|
|
658
|
+
var tmp$ret$2 = import_0('.' + item.lv_1, item.lv_1);
|
|
1603
659
|
destination.x(tmp$ret$2);
|
|
1604
660
|
}
|
|
1605
661
|
var typeImports = destination;
|
|
1606
662
|
// Inline function 'kotlin.collections.map' call
|
|
1607
|
-
var this_1 = type.
|
|
663
|
+
var this_1 = type.fq_1.kp_1;
|
|
1608
664
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1609
|
-
var destination_0 = ArrayList_init_$Create$
|
|
665
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
1610
666
|
var _iterator__ex2g4s_1 = this_1.t();
|
|
1611
667
|
while (_iterator__ex2g4s_1.u()) {
|
|
1612
668
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
1613
|
-
var tmp$ret$5 = item_0.
|
|
669
|
+
var tmp$ret$5 = item_0.sp_1.m1();
|
|
1614
670
|
destination_0.x(tmp$ret$5);
|
|
1615
671
|
}
|
|
1616
672
|
var fieldNames = toSet(destination_0);
|
|
@@ -1640,66 +696,94 @@ protoOf(PythonIrEmitter).bs = function (endpoint) {
|
|
|
1640
696
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1641
697
|
var this_0 = importReferences(endpoint);
|
|
1642
698
|
var set = HashSet_init_$Create$();
|
|
1643
|
-
var list = ArrayList_init_$Create$();
|
|
699
|
+
var list = ArrayList_init_$Create$_0();
|
|
1644
700
|
var _iterator__ex2g4s = this_0.t();
|
|
1645
701
|
while (_iterator__ex2g4s.u()) {
|
|
1646
702
|
var e = _iterator__ex2g4s.v();
|
|
1647
|
-
var key = e.
|
|
703
|
+
var key = e.lv_1;
|
|
1648
704
|
if (set.x(key)) {
|
|
1649
705
|
list.x(e);
|
|
1650
706
|
}
|
|
1651
707
|
}
|
|
1652
708
|
// Inline function 'kotlin.collections.map' call
|
|
1653
709
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1654
|
-
var destination = ArrayList_init_$Create$
|
|
710
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(list, 10));
|
|
1655
711
|
var _iterator__ex2g4s_0 = list.t();
|
|
1656
712
|
while (_iterator__ex2g4s_0.u()) {
|
|
1657
713
|
var item = _iterator__ex2g4s_0.v();
|
|
1658
|
-
var tmp$ret$2 = import_0('..model.' + item.
|
|
714
|
+
var tmp$ret$2 = import_0('..model.' + item.lv_1, item.lv_1);
|
|
1659
715
|
destination.x(tmp$ret$2);
|
|
1660
716
|
}
|
|
1661
717
|
var endpointImports = destination;
|
|
1662
718
|
// Inline function 'kotlin.let' call
|
|
1663
719
|
var it = splitEndpointStructsToModuleLevel(convert_3(endpoint));
|
|
1664
|
-
var tmp$ret$6 = it.
|
|
720
|
+
var tmp$ret$6 = it.g1o(VOID, plus(endpointImports, it.d1o_1));
|
|
1665
721
|
return sanitizeNames(snakeCaseHandlerAndCallMethods(tmp$ret$6), _get_sanitizationConfig__sns434(this));
|
|
1666
722
|
};
|
|
1667
723
|
protoOf(PythonIrEmitter).pr = function (channel) {
|
|
1668
724
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1669
725
|
};
|
|
1670
|
-
protoOf(PythonIrEmitter).
|
|
726
|
+
protoOf(PythonIrEmitter).or = function (rpc) {
|
|
727
|
+
// Inline function 'kotlin.collections.distinctBy' call
|
|
728
|
+
var this_0 = importReferences(rpc);
|
|
729
|
+
var set = HashSet_init_$Create$();
|
|
730
|
+
var list = ArrayList_init_$Create$_0();
|
|
731
|
+
var _iterator__ex2g4s = this_0.t();
|
|
732
|
+
while (_iterator__ex2g4s.u()) {
|
|
733
|
+
var e = _iterator__ex2g4s.v();
|
|
734
|
+
var key = e.lv_1;
|
|
735
|
+
if (set.x(key)) {
|
|
736
|
+
list.x(e);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
// Inline function 'kotlin.collections.map' call
|
|
740
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
741
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(list, 10));
|
|
742
|
+
var _iterator__ex2g4s_0 = list.t();
|
|
743
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
744
|
+
var item = _iterator__ex2g4s_0.v();
|
|
745
|
+
var tmp$ret$2 = import_0('..model.' + item.lv_1, item.lv_1);
|
|
746
|
+
destination.x(tmp$ret$2);
|
|
747
|
+
}
|
|
748
|
+
var rpcImports = destination;
|
|
749
|
+
// Inline function 'kotlin.let' call
|
|
750
|
+
var it = convert_5(rpc);
|
|
751
|
+
var tmp$ret$6 = it.g1o(VOID, plus(rpcImports, it.d1o_1));
|
|
752
|
+
return sanitizeNames(tmp$ret$6, _get_sanitizationConfig__sns434(this));
|
|
753
|
+
};
|
|
754
|
+
protoOf(PythonIrEmitter).v1w = function (endpoint) {
|
|
1671
755
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1672
756
|
var this_0 = importReferences(endpoint);
|
|
1673
757
|
var set = HashSet_init_$Create$();
|
|
1674
|
-
var list = ArrayList_init_$Create$();
|
|
758
|
+
var list = ArrayList_init_$Create$_0();
|
|
1675
759
|
var _iterator__ex2g4s = this_0.t();
|
|
1676
760
|
while (_iterator__ex2g4s.u()) {
|
|
1677
761
|
var e = _iterator__ex2g4s.v();
|
|
1678
|
-
var key = e.
|
|
762
|
+
var key = e.lv_1;
|
|
1679
763
|
if (set.x(key)) {
|
|
1680
764
|
list.x(e);
|
|
1681
765
|
}
|
|
1682
766
|
}
|
|
1683
767
|
// Inline function 'kotlin.collections.map' call
|
|
1684
768
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1685
|
-
var destination = ArrayList_init_$Create$
|
|
769
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(list, 10));
|
|
1686
770
|
var _iterator__ex2g4s_0 = list.t();
|
|
1687
771
|
while (_iterator__ex2g4s_0.u()) {
|
|
1688
772
|
var item = _iterator__ex2g4s_0.v();
|
|
1689
|
-
var tmp$ret$2 = import_0('..model.' + item.
|
|
773
|
+
var tmp$ret$2 = import_0('..model.' + item.lv_1, item.lv_1);
|
|
1690
774
|
destination.x(tmp$ret$2);
|
|
1691
775
|
}
|
|
1692
776
|
var modelImports = destination;
|
|
1693
|
-
var endpointImport = import_0('..endpoint.' + endpoint.
|
|
1694
|
-
var endpointName = endpoint.
|
|
777
|
+
var endpointImport = import_0('..endpoint.' + endpoint.kq_1.m1(), '*');
|
|
778
|
+
var endpointName = endpoint.kq_1.m1();
|
|
1695
779
|
var file = flattenEndpointTypeRefs(snakeCaseClientFunctions(addSelfReceiverToClientFields(sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this)))), endpointName);
|
|
1696
|
-
var subPackageName =
|
|
1697
|
-
return new File(Companion_getInstance().
|
|
780
|
+
var subPackageName = plus_1(this.l1y_1, 'client');
|
|
781
|
+
return new File(Companion_getInstance().h1h(subPackageName.ls() + file.c1o_1.i1h()), plus(plus(plus(buildImports(this, '..wirespec'), modelImports), listOf_0(endpointImport)), file.d1o_1));
|
|
1698
782
|
};
|
|
1699
|
-
protoOf(PythonIrEmitter).
|
|
783
|
+
protoOf(PythonIrEmitter).s1w = function (endpoints, logger) {
|
|
1700
784
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1701
785
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1702
|
-
var destination = ArrayList_init_$Create$();
|
|
786
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1703
787
|
var _iterator__ex2g4s = endpoints.t();
|
|
1704
788
|
while (_iterator__ex2g4s.u()) {
|
|
1705
789
|
var element = _iterator__ex2g4s.v();
|
|
@@ -1708,53 +792,53 @@ protoOf(PythonIrEmitter).z1w = function (endpoints, logger) {
|
|
|
1708
792
|
}
|
|
1709
793
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1710
794
|
var set = HashSet_init_$Create$();
|
|
1711
|
-
var list_0 = ArrayList_init_$Create$();
|
|
795
|
+
var list_0 = ArrayList_init_$Create$_0();
|
|
1712
796
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1713
797
|
while (_iterator__ex2g4s_0.u()) {
|
|
1714
798
|
var e = _iterator__ex2g4s_0.v();
|
|
1715
|
-
var key = e.
|
|
799
|
+
var key = e.lv_1;
|
|
1716
800
|
if (set.x(key)) {
|
|
1717
801
|
list_0.x(e);
|
|
1718
802
|
}
|
|
1719
803
|
}
|
|
1720
804
|
// Inline function 'kotlin.collections.map' call
|
|
1721
805
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1722
|
-
var destination_0 = ArrayList_init_$Create$
|
|
806
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(list_0, 10));
|
|
1723
807
|
var _iterator__ex2g4s_1 = list_0.t();
|
|
1724
808
|
while (_iterator__ex2g4s_1.u()) {
|
|
1725
809
|
var item = _iterator__ex2g4s_1.v();
|
|
1726
|
-
var tmp$ret$5 = import_0('.model.' + item.
|
|
810
|
+
var tmp$ret$5 = import_0('.model.' + item.lv_1, item.lv_1);
|
|
1727
811
|
destination_0.x(tmp$ret$5);
|
|
1728
812
|
}
|
|
1729
813
|
var modelImports = destination_0;
|
|
1730
814
|
// Inline function 'kotlin.collections.map' call
|
|
1731
815
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1732
|
-
var destination_1 = ArrayList_init_$Create$
|
|
816
|
+
var destination_1 = ArrayList_init_$Create$(collectionSizeOrDefault(endpoints, 10));
|
|
1733
817
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1734
818
|
while (_iterator__ex2g4s_2.u()) {
|
|
1735
819
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
1736
|
-
var tmp$ret$8 = import_0('.endpoint.' + item_0.
|
|
820
|
+
var tmp$ret$8 = import_0('.endpoint.' + item_0.kq_1.m1(), '*');
|
|
1737
821
|
destination_1.x(tmp$ret$8);
|
|
1738
822
|
}
|
|
1739
823
|
var endpointImports = destination_1;
|
|
1740
824
|
// Inline function 'kotlin.collections.map' call
|
|
1741
825
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1742
|
-
var destination_2 = ArrayList_init_$Create$
|
|
826
|
+
var destination_2 = ArrayList_init_$Create$(collectionSizeOrDefault(endpoints, 10));
|
|
1743
827
|
var _iterator__ex2g4s_3 = endpoints.t();
|
|
1744
828
|
while (_iterator__ex2g4s_3.u()) {
|
|
1745
829
|
var item_1 = _iterator__ex2g4s_3.v();
|
|
1746
|
-
var tmp$ret$11 = import_0('.client.' + item_1.
|
|
830
|
+
var tmp$ret$11 = import_0('.client.' + item_1.kq_1.m1() + 'Client', item_1.kq_1.m1() + 'Client');
|
|
1747
831
|
destination_2.x(tmp$ret$11);
|
|
1748
832
|
}
|
|
1749
833
|
var clientImports = destination_2;
|
|
1750
834
|
var allImports = plus(plus(modelImports, endpointImports), clientImports);
|
|
1751
835
|
// Inline function 'kotlin.collections.map' call
|
|
1752
836
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1753
|
-
var destination_3 = ArrayList_init_$Create$
|
|
837
|
+
var destination_3 = ArrayList_init_$Create$(collectionSizeOrDefault(endpoints, 10));
|
|
1754
838
|
var _iterator__ex2g4s_4 = endpoints.t();
|
|
1755
839
|
while (_iterator__ex2g4s_4.u()) {
|
|
1756
840
|
var item_2 = _iterator__ex2g4s_4.v();
|
|
1757
|
-
var tmp$ret$14 = item_2.
|
|
841
|
+
var tmp$ret$14 = item_2.kq_1.m1();
|
|
1758
842
|
destination_3.x(tmp$ret$14);
|
|
1759
843
|
}
|
|
1760
844
|
var endpointNames = destination_3;
|
|
@@ -1768,7 +852,7 @@ protoOf(PythonIrEmitter).z1w = function (endpoints, logger) {
|
|
|
1768
852
|
accumulator = flattenEndpointTypeRefs(acc, element_0);
|
|
1769
853
|
}
|
|
1770
854
|
var file = accumulator;
|
|
1771
|
-
return new File(Companion_getInstance().
|
|
855
|
+
return new File(Companion_getInstance().h1h(this.l1y_1.ls() + file.c1o_1.i1h()), plus(plus(buildImports(this, '.wirespec'), allImports), file.d1o_1));
|
|
1772
856
|
};
|
|
1773
857
|
function replaceReflectInNonGenericStructFields(_this__u8e3s4) {
|
|
1774
858
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -1776,14 +860,14 @@ function replaceReflectInNonGenericStructFields(_this__u8e3s4) {
|
|
|
1776
860
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1777
861
|
var tmp = scope;
|
|
1778
862
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1779
|
-
var this_0 = scope.
|
|
863
|
+
var this_0 = scope.a1w_1;
|
|
1780
864
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1781
865
|
// Inline function 'kotlin.apply' call
|
|
1782
866
|
var this_1 = new TransformerBuilder();
|
|
1783
|
-
this_1.
|
|
1784
|
-
var tmp$ret$2 = this_1.
|
|
1785
|
-
tmp.
|
|
1786
|
-
var tmp_0 = scope.
|
|
867
|
+
this_1.u1i(replaceReflectInNonGenericStructFields$lambda);
|
|
868
|
+
var tmp$ret$2 = this_1.v1i();
|
|
869
|
+
tmp.a1w_1 = transform(this_0, tmp$ret$2);
|
|
870
|
+
var tmp_0 = scope.a1w_1;
|
|
1787
871
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1788
872
|
}
|
|
1789
873
|
function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
@@ -1792,14 +876,14 @@ function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
|
1792
876
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1793
877
|
var tmp = scope;
|
|
1794
878
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1795
|
-
var this_0 = scope.
|
|
879
|
+
var this_0 = scope.a1w_1;
|
|
1796
880
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1797
881
|
// Inline function 'kotlin.apply' call
|
|
1798
882
|
var this_1 = new TransformerBuilder();
|
|
1799
|
-
this_1.
|
|
1800
|
-
var tmp$ret$2 = this_1.
|
|
1801
|
-
tmp.
|
|
1802
|
-
var tmp_0 = scope.
|
|
883
|
+
this_1.u1i(replaceRefinedFunctions$lambda(refined));
|
|
884
|
+
var tmp$ret$2 = this_1.v1i();
|
|
885
|
+
tmp.a1w_1 = transform(this_0, tmp$ret$2);
|
|
886
|
+
var tmp_0 = scope.a1w_1;
|
|
1803
887
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1804
888
|
}
|
|
1805
889
|
function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
@@ -1808,22 +892,22 @@ function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
|
1808
892
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1809
893
|
var tmp = scope;
|
|
1810
894
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1811
|
-
var this_0 = scope.
|
|
895
|
+
var this_0 = scope.a1w_1;
|
|
1812
896
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1813
897
|
// Inline function 'kotlin.apply' call
|
|
1814
898
|
var this_1 = new TransformerBuilder();
|
|
1815
|
-
this_1.
|
|
1816
|
-
var tmp$ret$2 = this_1.
|
|
1817
|
-
tmp.
|
|
1818
|
-
var tmp_0 = scope.
|
|
899
|
+
this_1.u1i(snakeCaseHandlerAndCallMethods$lambda);
|
|
900
|
+
var tmp$ret$2 = this_1.v1i();
|
|
901
|
+
tmp.a1w_1 = transform(this_0, tmp$ret$2);
|
|
902
|
+
var tmp_0 = scope.a1w_1;
|
|
1819
903
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1820
904
|
}
|
|
1821
905
|
function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
1822
906
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1823
907
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1824
|
-
var tmp0 = _this__u8e3s4.
|
|
908
|
+
var tmp0 = _this__u8e3s4.e1o();
|
|
1825
909
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1826
|
-
var destination = ArrayList_init_$Create$();
|
|
910
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1827
911
|
var _iterator__ex2g4s = tmp0.t();
|
|
1828
912
|
while (_iterator__ex2g4s.u()) {
|
|
1829
913
|
var element = _iterator__ex2g4s.v();
|
|
@@ -1834,9 +918,9 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1834
918
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1835
919
|
var namespace = ensureNotNull(tmp$ret$2);
|
|
1836
920
|
// Inline function 'kotlin.collections.partition' call
|
|
1837
|
-
var this_0 = namespace.
|
|
1838
|
-
var first = ArrayList_init_$Create$();
|
|
1839
|
-
var second = ArrayList_init_$Create$();
|
|
921
|
+
var this_0 = namespace.j1o_1;
|
|
922
|
+
var first = ArrayList_init_$Create$_0();
|
|
923
|
+
var second = ArrayList_init_$Create$_0();
|
|
1840
924
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
1841
925
|
while (_iterator__ex2g4s_0.u()) {
|
|
1842
926
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
@@ -1853,16 +937,16 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1853
937
|
}
|
|
1854
938
|
}
|
|
1855
939
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1856
|
-
var moduleElements = _destruct__k2r9zo.
|
|
1857
|
-
var classElements = _destruct__k2r9zo.
|
|
1858
|
-
var endpointClass = new Namespace(namespace.
|
|
1859
|
-
return new File(namespace.
|
|
940
|
+
var moduleElements = _destruct__k2r9zo.we();
|
|
941
|
+
var classElements = _destruct__k2r9zo.xe();
|
|
942
|
+
var endpointClass = new Namespace(namespace.i1o_1, classElements, namespace.k1o_1);
|
|
943
|
+
return new File(namespace.i1o_1, plus_0(moduleElements, endpointClass));
|
|
1860
944
|
}
|
|
1861
945
|
function flattenEndpointTypeRefs(_this__u8e3s4, endpointName) {
|
|
1862
946
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1863
947
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1864
|
-
scope.
|
|
1865
|
-
var tmp = scope.
|
|
948
|
+
scope.g1w(flattenEndpointTypeRefs$lambda(endpointName));
|
|
949
|
+
var tmp = scope.a1w_1;
|
|
1866
950
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1867
951
|
}
|
|
1868
952
|
function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
@@ -1871,15 +955,15 @@ function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
|
1871
955
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1872
956
|
var tmp = scope;
|
|
1873
957
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1874
|
-
var this_0 = scope.
|
|
958
|
+
var this_0 = scope.a1w_1;
|
|
1875
959
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1876
960
|
// Inline function 'kotlin.apply' call
|
|
1877
961
|
var this_1 = new TransformerBuilder();
|
|
1878
|
-
this_1.
|
|
1879
|
-
var tmp$ret$2 = this_1.
|
|
1880
|
-
tmp.
|
|
1881
|
-
scope.
|
|
1882
|
-
var tmp_0 = scope.
|
|
962
|
+
this_1.u1i(snakeCaseClientFunctions$lambda);
|
|
963
|
+
var tmp$ret$2 = this_1.v1i();
|
|
964
|
+
tmp.a1w_1 = transform(this_0, tmp$ret$2);
|
|
965
|
+
scope.j1w(snakeCaseClientFunctions$lambda_0);
|
|
966
|
+
var tmp_0 = scope.a1w_1;
|
|
1883
967
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1884
968
|
}
|
|
1885
969
|
function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
@@ -1890,9 +974,9 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1890
974
|
} else {
|
|
1891
975
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1892
976
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1893
|
-
var tmp0 = tmp0_safe_receiver.
|
|
977
|
+
var tmp0 = tmp0_safe_receiver.e1o();
|
|
1894
978
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1895
|
-
var destination = ArrayList_init_$Create$();
|
|
979
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1896
980
|
var _iterator__ex2g4s = tmp0.t();
|
|
1897
981
|
while (_iterator__ex2g4s.u()) {
|
|
1898
982
|
var element = _iterator__ex2g4s.v();
|
|
@@ -1910,11 +994,11 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1910
994
|
} else {
|
|
1911
995
|
// Inline function 'kotlin.collections.map' call
|
|
1912
996
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1913
|
-
var destination_0 = ArrayList_init_$Create$
|
|
997
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(tmp2_safe_receiver, 10));
|
|
1914
998
|
var _iterator__ex2g4s_0 = tmp2_safe_receiver.t();
|
|
1915
999
|
while (_iterator__ex2g4s_0.u()) {
|
|
1916
1000
|
var item = _iterator__ex2g4s_0.v();
|
|
1917
|
-
var tmp$ret$3 = item.
|
|
1001
|
+
var tmp$ret$3 = item.x1o_1.g1j();
|
|
1918
1002
|
destination_0.x(tmp$ret$3);
|
|
1919
1003
|
}
|
|
1920
1004
|
tmp_0 = destination_0;
|
|
@@ -1926,8 +1010,8 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1926
1010
|
return _this__u8e3s4;
|
|
1927
1011
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1928
1012
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1929
|
-
scope.
|
|
1930
|
-
var tmp_1 = scope.
|
|
1013
|
+
scope.j1w(addSelfReceiverToClientFields$lambda(fieldNames));
|
|
1014
|
+
var tmp_1 = scope.a1w_1;
|
|
1931
1015
|
return isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1932
1016
|
}
|
|
1933
1017
|
function replaceReflectAsTypeAny(_this__u8e3s4) {
|
|
@@ -1936,13 +1020,13 @@ function replaceReflectAsTypeAny(_this__u8e3s4) {
|
|
|
1936
1020
|
tmp = Custom_init_$Create$('type', listOf_0(Any_instance));
|
|
1937
1021
|
} else {
|
|
1938
1022
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
1939
|
-
tmp = _this__u8e3s4.
|
|
1023
|
+
tmp = _this__u8e3s4.k1n(replaceReflectAsTypeAny(_this__u8e3s4.c1j_1));
|
|
1940
1024
|
} else {
|
|
1941
1025
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
1942
|
-
tmp = _this__u8e3s4.
|
|
1026
|
+
tmp = _this__u8e3s4.k1n(replaceReflectAsTypeAny(_this__u8e3s4.d1j_1));
|
|
1943
1027
|
} else {
|
|
1944
|
-
if (_this__u8e3s4 instanceof
|
|
1945
|
-
tmp = _this__u8e3s4.
|
|
1028
|
+
if (_this__u8e3s4 instanceof Dict) {
|
|
1029
|
+
tmp = _this__u8e3s4.n1n(replaceReflectAsTypeAny(_this__u8e3s4.l1n_1), replaceReflectAsTypeAny(_this__u8e3s4.m1n_1));
|
|
1946
1030
|
} else {
|
|
1947
1031
|
tmp = _this__u8e3s4;
|
|
1948
1032
|
}
|
|
@@ -1957,27 +1041,27 @@ function replaceReflectInNonGenericStructFields$lambda(element, transformer) {
|
|
|
1957
1041
|
var tmp$ret$1;
|
|
1958
1042
|
$l$block: {
|
|
1959
1043
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1960
|
-
if (!element.
|
|
1044
|
+
if (!element.h1q_1.r()) {
|
|
1961
1045
|
tmp$ret$1 = element;
|
|
1962
1046
|
break $l$block;
|
|
1963
1047
|
}
|
|
1964
1048
|
// Inline function 'kotlin.collections.map' call
|
|
1965
|
-
var this_0 = element.
|
|
1049
|
+
var this_0 = element.d1q_1;
|
|
1966
1050
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1967
|
-
var destination = ArrayList_init_$Create$
|
|
1051
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1968
1052
|
var _iterator__ex2g4s = this_0.t();
|
|
1969
1053
|
while (_iterator__ex2g4s.u()) {
|
|
1970
1054
|
var item = _iterator__ex2g4s.v();
|
|
1971
1055
|
var tmp_0;
|
|
1972
1056
|
if (item instanceof Field) {
|
|
1973
|
-
tmp_0 = item.
|
|
1057
|
+
tmp_0 = item.h1p(VOID, replaceReflectAsTypeAny(item.y1o_1));
|
|
1974
1058
|
} else {
|
|
1975
1059
|
tmp_0 = item;
|
|
1976
1060
|
}
|
|
1977
1061
|
var tmp$ret$2 = tmp_0;
|
|
1978
1062
|
destination.x(tmp$ret$2);
|
|
1979
1063
|
}
|
|
1980
|
-
tmp$ret$1 = element.
|
|
1064
|
+
tmp$ret$1 = element.n1q(VOID, destination);
|
|
1981
1065
|
}
|
|
1982
1066
|
tmp = tmp$ret$1;
|
|
1983
1067
|
} else {
|
|
@@ -1988,17 +1072,17 @@ function replaceReflectInNonGenericStructFields$lambda(element, transformer) {
|
|
|
1988
1072
|
}
|
|
1989
1073
|
function replaceRefinedFunctions$lambda$lambda($constraintExpr) {
|
|
1990
1074
|
return function ($this$function) {
|
|
1991
|
-
$this$function.
|
|
1992
|
-
$this$function.
|
|
1993
|
-
$this$function.
|
|
1075
|
+
$this$function.v1h('self', Custom_init_$Create$(''));
|
|
1076
|
+
$this$function.y1h(Boolean_instance);
|
|
1077
|
+
$this$function.z1h($constraintExpr);
|
|
1994
1078
|
return Unit_instance;
|
|
1995
1079
|
};
|
|
1996
1080
|
}
|
|
1997
1081
|
function replaceRefinedFunctions$lambda$lambda_0($toStringExpr) {
|
|
1998
1082
|
return function ($this$function) {
|
|
1999
|
-
$this$function.
|
|
2000
|
-
$this$function.
|
|
2001
|
-
$this$function.
|
|
1083
|
+
$this$function.v1h('self', Custom_init_$Create$(''));
|
|
1084
|
+
$this$function.y1h(String_instance);
|
|
1085
|
+
$this$function.z1h(new RawExpression($toStringExpr));
|
|
2002
1086
|
return Unit_instance;
|
|
2003
1087
|
};
|
|
2004
1088
|
}
|
|
@@ -2006,34 +1090,33 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
2006
1090
|
return function (element, transformer) {
|
|
2007
1091
|
var tmp;
|
|
2008
1092
|
if (element instanceof Struct) {
|
|
2009
|
-
// Inline function 'kotlin.collections.
|
|
2010
|
-
var
|
|
2011
|
-
// Inline function 'kotlin.collections.
|
|
2012
|
-
var destination = ArrayList_init_$Create$();
|
|
2013
|
-
|
|
2014
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
1093
|
+
// Inline function 'kotlin.collections.map' call
|
|
1094
|
+
var this_0 = element.g1q_1;
|
|
1095
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1096
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1097
|
+
var _iterator__ex2g4s = this_0.t();
|
|
2015
1098
|
while (_iterator__ex2g4s.u()) {
|
|
2016
|
-
var
|
|
1099
|
+
var item = _iterator__ex2g4s.v();
|
|
2017
1100
|
var tmp_0;
|
|
2018
1101
|
var tmp_1;
|
|
2019
|
-
if (
|
|
2020
|
-
tmp_1 =
|
|
1102
|
+
if (item instanceof Function) {
|
|
1103
|
+
tmp_1 = item.e1l_1.equals(Companion_getInstance().h1h('validate'));
|
|
2021
1104
|
} else {
|
|
2022
1105
|
tmp_1 = false;
|
|
2023
1106
|
}
|
|
2024
1107
|
if (tmp_1) {
|
|
2025
|
-
var constraintExpr = convertConstraint($refined.ur_1, new FieldCall(new VariableReference(Companion_getInstance().
|
|
1108
|
+
var constraintExpr = convertConstraint($refined.ur_1, new FieldCall(new VariableReference(Companion_getInstance().h1h('self')), Companion_getInstance().h1h('value')));
|
|
2026
1109
|
tmp_0 = function_0('validate', VOID, VOID, replaceRefinedFunctions$lambda$lambda(constraintExpr));
|
|
2027
1110
|
} else {
|
|
2028
1111
|
var tmp_2;
|
|
2029
|
-
if (
|
|
2030
|
-
tmp_2 =
|
|
1112
|
+
if (item instanceof Function) {
|
|
1113
|
+
tmp_2 = item.e1l_1.equals(Companion_getInstance().h1h('toString'));
|
|
2031
1114
|
} else {
|
|
2032
1115
|
tmp_2 = false;
|
|
2033
1116
|
}
|
|
2034
1117
|
if (tmp_2) {
|
|
2035
1118
|
var tmp_3;
|
|
2036
|
-
if ($refined.ur_1.
|
|
1119
|
+
if ($refined.ur_1.wt_1 instanceof String_0) {
|
|
2037
1120
|
tmp_3 = 'self.value';
|
|
2038
1121
|
} else {
|
|
2039
1122
|
tmp_3 = 'str(self.value)';
|
|
@@ -2041,18 +1124,13 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
2041
1124
|
var toStringExpr = tmp_3;
|
|
2042
1125
|
tmp_0 = function_0('__str__', VOID, VOID, replaceRefinedFunctions$lambda$lambda_0(toStringExpr));
|
|
2043
1126
|
} else {
|
|
2044
|
-
tmp_0 =
|
|
1127
|
+
tmp_0 = item;
|
|
2045
1128
|
}
|
|
2046
1129
|
}
|
|
2047
|
-
var
|
|
2048
|
-
|
|
2049
|
-
null;
|
|
2050
|
-
else {
|
|
2051
|
-
// Inline function 'kotlin.let' call
|
|
2052
|
-
destination.x(tmp0_safe_receiver);
|
|
2053
|
-
}
|
|
1130
|
+
var tmp$ret$0 = tmp_0;
|
|
1131
|
+
destination.x(tmp$ret$0);
|
|
2054
1132
|
}
|
|
2055
|
-
tmp = element.
|
|
1133
|
+
tmp = element.n1q(VOID, VOID, VOID, VOID, destination);
|
|
2056
1134
|
} else {
|
|
2057
1135
|
tmp = element;
|
|
2058
1136
|
}
|
|
@@ -2065,23 +1143,23 @@ function snakeCaseHandlerAndCallMethods$lambda(element, transformer) {
|
|
|
2065
1143
|
if (element instanceof Interface) {
|
|
2066
1144
|
var tmp$ret$0;
|
|
2067
1145
|
$l$block: {
|
|
2068
|
-
if (!element.
|
|
1146
|
+
if (!element.o1o_1.equals(Companion_getInstance().h1h('Handler')) && !element.o1o_1.equals(Companion_getInstance().h1h('Call'))) {
|
|
2069
1147
|
tmp$ret$0 = element;
|
|
2070
1148
|
break $l$block;
|
|
2071
1149
|
}
|
|
2072
1150
|
// Inline function 'kotlin.collections.map' call
|
|
2073
|
-
var this_0 = element.
|
|
1151
|
+
var this_0 = element.p1o_1;
|
|
2074
1152
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2075
|
-
var destination = ArrayList_init_$Create$
|
|
1153
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2076
1154
|
var _iterator__ex2g4s = this_0.t();
|
|
2077
1155
|
while (_iterator__ex2g4s.u()) {
|
|
2078
1156
|
var item = _iterator__ex2g4s.v();
|
|
2079
1157
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
2080
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1158
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.p1l(Companion_getInstance().h1h(item.e1l_1.z1m()));
|
|
2081
1159
|
var tmp$ret$1 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
2082
1160
|
destination.x(tmp$ret$1);
|
|
2083
1161
|
}
|
|
2084
|
-
tmp$ret$0 = element.
|
|
1162
|
+
tmp$ret$0 = element.w1o(VOID, destination);
|
|
2085
1163
|
}
|
|
2086
1164
|
tmp = tmp$ret$0;
|
|
2087
1165
|
} else {
|
|
@@ -2093,20 +1171,20 @@ function snakeCaseHandlerAndCallMethods$lambda(element, transformer) {
|
|
|
2093
1171
|
function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
2094
1172
|
return function (type, _unused_var__etf5q3) {
|
|
2095
1173
|
var tmp;
|
|
2096
|
-
if (!(type instanceof
|
|
1174
|
+
if (!(type instanceof Custom)) {
|
|
2097
1175
|
tmp = type;
|
|
2098
1176
|
} else {
|
|
2099
|
-
if (!startsWith(type.
|
|
1177
|
+
if (!startsWith(type.e1j_1.i1h(), $endpointName + '.')) {
|
|
2100
1178
|
tmp = type;
|
|
2101
1179
|
} else {
|
|
2102
|
-
var suffix = removePrefix(type.
|
|
1180
|
+
var suffix = removePrefix(type.e1j_1.i1h(), $endpointName + '.');
|
|
2103
1181
|
switch (suffix) {
|
|
2104
1182
|
case 'Call':
|
|
2105
1183
|
case 'Handler':
|
|
2106
1184
|
tmp = type;
|
|
2107
1185
|
break;
|
|
2108
1186
|
default:
|
|
2109
|
-
tmp = type.
|
|
1187
|
+
tmp = type.p1n(Companion_getInstance().h1h(suffix));
|
|
2110
1188
|
break;
|
|
2111
1189
|
}
|
|
2112
1190
|
}
|
|
@@ -2117,7 +1195,7 @@ function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
|
2117
1195
|
function snakeCaseClientFunctions$lambda(element, transformer) {
|
|
2118
1196
|
var tmp;
|
|
2119
1197
|
if (element instanceof Function) {
|
|
2120
|
-
tmp = element.
|
|
1198
|
+
tmp = element.p1l(Companion_getInstance().h1h(element.e1l_1.z1m()), VOID, plus(listOf_0(new Parameter(Companion_getInstance().h1h('self'), Custom_init_$Create$(''))), element.g1l_1));
|
|
2121
1199
|
} else {
|
|
2122
1200
|
tmp = element;
|
|
2123
1201
|
}
|
|
@@ -2127,32 +1205,32 @@ function snakeCaseClientFunctions$lambda(element, transformer) {
|
|
|
2127
1205
|
function snakeCaseClientFunctions$lambda_0(stmt, tr) {
|
|
2128
1206
|
var tmp;
|
|
2129
1207
|
if (stmt instanceof FunctionCall) {
|
|
2130
|
-
var nameStr = stmt.
|
|
2131
|
-
var newName = contains(nameStr, '.') ? stmt.
|
|
2132
|
-
var tmp1_safe_receiver = stmt.
|
|
1208
|
+
var nameStr = stmt.d1n_1.g1j();
|
|
1209
|
+
var newName = contains(nameStr, '.') ? stmt.d1n_1 : Companion_getInstance().h1h(Companion_getInstance().h1h(nameStr).z1m());
|
|
1210
|
+
var tmp1_safe_receiver = stmt.b1n_1;
|
|
2133
1211
|
var tmp_0;
|
|
2134
1212
|
if (tmp1_safe_receiver == null) {
|
|
2135
1213
|
tmp_0 = null;
|
|
2136
1214
|
} else {
|
|
2137
1215
|
// Inline function 'kotlin.let' call
|
|
2138
|
-
tmp_0 = tr.
|
|
1216
|
+
tmp_0 = tr.v1v(tmp1_safe_receiver);
|
|
2139
1217
|
}
|
|
2140
1218
|
var tmp2_receiver = tmp_0;
|
|
2141
1219
|
// Inline function 'kotlin.collections.mapValues' call
|
|
2142
|
-
var this_0 = stmt.
|
|
1220
|
+
var this_0 = stmt.e1n_1;
|
|
2143
1221
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
2144
|
-
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.
|
|
1222
|
+
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.b1()));
|
|
2145
1223
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
2146
|
-
var _iterator__ex2g4s = this_0.
|
|
1224
|
+
var _iterator__ex2g4s = this_0.k1().t();
|
|
2147
1225
|
while (_iterator__ex2g4s.u()) {
|
|
2148
1226
|
var element = _iterator__ex2g4s.v();
|
|
2149
|
-
var tmp_1 = element.
|
|
1227
|
+
var tmp_1 = element.l1();
|
|
2150
1228
|
// Inline function 'kotlin.collections.component2' call
|
|
2151
|
-
var v = element.
|
|
2152
|
-
var tmp$ret$4 = tr.
|
|
2153
|
-
destination.
|
|
1229
|
+
var v = element.m1();
|
|
1230
|
+
var tmp$ret$4 = tr.v1v(v);
|
|
1231
|
+
destination.t2(tmp_1, tmp$ret$4);
|
|
2154
1232
|
}
|
|
2155
|
-
var tmp4_isAwait = !(stmt.
|
|
1233
|
+
var tmp4_isAwait = !(stmt.b1n_1 == null);
|
|
2156
1234
|
tmp = new FunctionCall(tmp2_receiver, VOID, newName, destination, tmp4_isAwait);
|
|
2157
1235
|
} else {
|
|
2158
1236
|
tmp = transformChildren(stmt, tr);
|
|
@@ -2163,30 +1241,24 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
2163
1241
|
return function (stmt, tr) {
|
|
2164
1242
|
var tmp;
|
|
2165
1243
|
var tmp_0;
|
|
2166
|
-
var tmp_1;
|
|
2167
1244
|
if (stmt instanceof FieldCall) {
|
|
2168
|
-
|
|
2169
|
-
} else {
|
|
2170
|
-
tmp_1 = false;
|
|
2171
|
-
}
|
|
2172
|
-
if (tmp_1) {
|
|
2173
|
-
tmp_0 = $fieldNames.u1(stmt.q1r_1.r1j());
|
|
1245
|
+
tmp_0 = (stmt.o1r_1 == null && $fieldNames.v1(stmt.p1r_1.g1j()));
|
|
2174
1246
|
} else {
|
|
2175
1247
|
tmp_0 = false;
|
|
2176
1248
|
}
|
|
2177
1249
|
if (tmp_0) {
|
|
2178
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().
|
|
1250
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().h1h('self')), stmt.p1r_1);
|
|
2179
1251
|
} else {
|
|
2180
1252
|
if (stmt instanceof FieldCall) {
|
|
2181
|
-
var
|
|
2182
|
-
var
|
|
2183
|
-
if (
|
|
2184
|
-
|
|
1253
|
+
var tmp1_safe_receiver = stmt.o1r_1;
|
|
1254
|
+
var tmp_1;
|
|
1255
|
+
if (tmp1_safe_receiver == null) {
|
|
1256
|
+
tmp_1 = null;
|
|
2185
1257
|
} else {
|
|
2186
1258
|
// Inline function 'kotlin.let' call
|
|
2187
|
-
|
|
1259
|
+
tmp_1 = tr.v1v(tmp1_safe_receiver);
|
|
2188
1260
|
}
|
|
2189
|
-
tmp = new FieldCall(
|
|
1261
|
+
tmp = new FieldCall(tmp_1, stmt.p1r_1);
|
|
2190
1262
|
} else {
|
|
2191
1263
|
tmp = transformChildren(stmt, tr);
|
|
2192
1264
|
}
|
|
@@ -2194,78 +1266,13 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
2194
1266
|
return tmp;
|
|
2195
1267
|
};
|
|
2196
1268
|
}
|
|
2197
|
-
function PythonRefinedTypeDefinitionEmitter() {
|
|
2198
|
-
}
|
|
2199
|
-
function PythonShared() {
|
|
2200
|
-
this.z1z_1 = 'shared';
|
|
2201
|
-
this.a20_1 = "from abc import ABC, abstractmethod\nfrom dataclasses import dataclass\nfrom enum import Enum\nfrom typing import Generic, List, Dict, Optional, TypeVar\n\nT = TypeVar('T')\nREQ = TypeVar('REQ')\nRES = TypeVar('RES')\n\nclass Wirespec:\n\n class Refined(ABC, Generic[T]):\n @property\n @abstractmethod\n def value(self) -> T: pass\n\n class Endpoint(ABC):\n\n class Handler(ABC):\n pass\n\n class Convert(ABC, Generic[REQ, RES]):\n @staticmethod\n @abstractmethod\n def to_raw_request(serializer: 'Wirespec.Serializer', req: REQ) -> 'Wirespec.RawRequest': pass\n\n @staticmethod\n @abstractmethod\n def from_raw_response(serializer: 'Wirespec.Deserializer', res: 'Wirespec.RawResponse') -> RES: pass\n\n @staticmethod\n @abstractmethod\n def to_raw_response(serializer: 'Wirespec.Serializer', res: RES) -> 'Wirespec.RawResponse': pass\n\n @staticmethod\n @abstractmethod\n def from_raw_request(serializer: 'Wirespec.Deserializer[T]', req: 'Wirespec.RawRequest') -> REQ: pass\n\n class Method(Enum):\n GET = \"GET\"\n PUT = \"PUT\"\n POST = \"POST\"\n DELETE = \"DELETE\"\n OPTIONS = \"OPTIONS\"\n HEAD = \"HEAD\"\n PATCH = \"PATCH\"\n TRACE = \"TRACE\"\n\n class Request(Generic[T], ABC):\n\n class Path(ABC): pass\n\n class Queries(ABC): pass\n\n class Headers(ABC): pass\n\n @property\n @abstractmethod\n def path(self) -> Path: pass\n\n @property\n @abstractmethod\n def method(self) -> 'Wirespec.Method': pass\n\n @property\n @abstractmethod\n def queries(self) -> Queries: pass\n\n @property\n @abstractmethod\n def headers(self) -> Headers: pass\n\n @property\n @abstractmethod\n def body(self) -> T: pass\n\n class Response(Generic[T], ABC):\n\n class Headers(ABC): pass\n\n @property\n @abstractmethod\n def status(self) -> int: pass\n\n @property\n @abstractmethod\n def headers(self) -> Headers: pass\n\n @property\n @abstractmethod\n def body(self) -> T: pass\n\n class Serializer(Generic[T], ABC):\n @abstractmethod\n def serialize(self, value: T, t: type[T]) -> str: pass\n @abstractmethod\n def serialize_param(self, value: T, t: type[T]) -> List[str]: pass\n\n class Deserializer(Generic[T], ABC):\n @abstractmethod\n def deserialize(self, value: str | None, t: type[T]) -> T: pass\n @abstractmethod\n def deserialize_param(self, value: List[str] | None, t: type[T]) -> T: pass\n\n class Serialization(Serializer, Deserializer):\n @abstractmethod\n def serialize(self, value: T, t: type[T]) -> str: pass\n @abstractmethod\n def serialize_param(self, value: T, t: type[T]) -> List[str]: pass\n @abstractmethod\n def deserialize(self, value: str | None, t: type[T]) -> T: pass\n @abstractmethod\n def deserialize_param(self, value: List[str] | None, t: type[T]) -> T: pass\n\n @dataclass\n class RawRequest:\n method: str\n path: List[str]\n queries: Dict[str, List[str]]\n headers: Dict[str, List[str]]\n body: Optional[str]\n\n\n @dataclass\n class RawResponse:\n status_code: int\n headers: Dict[str, List[str]]\n body: Optional[str]\n";
|
|
2202
|
-
}
|
|
2203
|
-
protoOf(PythonShared).toString = function () {
|
|
2204
|
-
return 'PythonShared';
|
|
2205
|
-
};
|
|
2206
|
-
protoOf(PythonShared).hashCode = function () {
|
|
2207
|
-
return 988605686;
|
|
2208
|
-
};
|
|
2209
|
-
protoOf(PythonShared).equals = function (other) {
|
|
2210
|
-
if (this === other)
|
|
2211
|
-
return true;
|
|
2212
|
-
if (!(other instanceof PythonShared))
|
|
2213
|
-
return false;
|
|
2214
|
-
return true;
|
|
2215
|
-
};
|
|
2216
|
-
var PythonShared_instance;
|
|
2217
|
-
function PythonShared_getInstance() {
|
|
2218
|
-
return PythonShared_instance;
|
|
2219
|
-
}
|
|
2220
|
-
function PythonTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
2221
|
-
return function (it) {
|
|
2222
|
-
return this$0.e20(it);
|
|
2223
|
-
};
|
|
2224
|
-
}
|
|
2225
|
-
function PythonTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2226
|
-
return function (it) {
|
|
2227
|
-
return this$0.e20(it);
|
|
2228
|
-
};
|
|
2229
|
-
}
|
|
2230
|
-
function PythonTypeDefinitionEmitter$emit$lambda_1(this$0) {
|
|
2231
|
-
return function (it) {
|
|
2232
|
-
return Spacer_instance.toString() + this$0.nq(it);
|
|
2233
|
-
};
|
|
2234
|
-
}
|
|
2235
|
-
function PythonTypeDefinitionEmitter() {
|
|
2236
|
-
}
|
|
2237
|
-
function PythonUnionDefinitionEmitter() {
|
|
2238
|
-
}
|
|
2239
1269
|
//region block: post-declaration
|
|
2240
|
-
protoOf(
|
|
2241
|
-
protoOf(
|
|
2242
|
-
protoOf(
|
|
2243
|
-
protoOf(PythonEmitter).oq = emit_7;
|
|
2244
|
-
protoOf(PythonEmitter).pq = emit_9;
|
|
2245
|
-
protoOf(PythonEmitter).as = emit_11;
|
|
2246
|
-
protoOf(PythonEmitter).vr = emit_10;
|
|
2247
|
-
protoOf(PythonEmitter).bs = emit_13;
|
|
2248
|
-
protoOf(PythonEmitter).qr = emit_12;
|
|
2249
|
-
protoOf(PythonEmitter).or = emit_3;
|
|
2250
|
-
protoOf(PythonEmitter).pr = emit_2;
|
|
2251
|
-
protoOf(PythonEmitter).b20 = emit_8;
|
|
2252
|
-
protoOf(PythonEmitter).i1y = emit_14;
|
|
2253
|
-
protoOf(PythonEmitter).c20 = emit_15;
|
|
2254
|
-
protoOf(PythonEmitter).cs = emitValidator;
|
|
2255
|
-
protoOf(PythonEmitter).v1y = sanitize;
|
|
2256
|
-
protoOf(PythonEmitter).l1y = sanitizeKeywords;
|
|
2257
|
-
protoOf(PythonEmitter).d20 = emitType;
|
|
2258
|
-
protoOf(PythonEmitter).e20 = emitReferenceCustomImports;
|
|
2259
|
-
protoOf(PythonIrEmitter).w1w = get_extensions;
|
|
2260
|
-
protoOf(PythonIrEmitter).eo = emit_1;
|
|
2261
|
-
protoOf(PythonIrEmitter).b1x = beforeGenerate;
|
|
2262
|
-
//endregion
|
|
2263
|
-
//region block: init
|
|
2264
|
-
PythonShared_instance = new PythonShared();
|
|
1270
|
+
protoOf(PythonIrEmitter).p1w = get_extensions;
|
|
1271
|
+
protoOf(PythonIrEmitter).no = emit_1;
|
|
1272
|
+
protoOf(PythonIrEmitter).u1w = beforeGenerate;
|
|
2265
1273
|
//endregion
|
|
2266
1274
|
//region block: exports
|
|
2267
1275
|
export {
|
|
2268
|
-
PythonEmitter as PythonEmitter2pjclp0u1gkmn,
|
|
2269
1276
|
PythonIrEmitter as PythonIrEmittergogj1wcisct7,
|
|
2270
1277
|
};
|
|
2271
1278
|
//endregion
|