@flock/wirespec 0.20.0-RC.8 → 0.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.mjs +12 -12
- package/arrow-arrow-core.mjs +163 -163
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt-mordant.mjs.map +1 -1
- package/clikt-clikt.mjs +1575 -1575
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +444 -444
- package/kotlin-kotlin-stdlib.mjs +2001 -1948
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10254 -10254
- package/kotlin-rgxgen.mjs +1815 -1815
- 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 +1768 -2207
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +384 -1254
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +366 -1065
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +400 -1422
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +424 -422
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +214 -189
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +529 -1409
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +92 -86
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +4476 -4329
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +250 -1120
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +512 -512
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +756 -756
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +1408 -1393
- package/wirespec-src-ide-lsp.mjs.map +1 -1
- package/wirespec-src-plugin-arguments.mjs +185 -245
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +102 -128
- package/wirespec-src-plugin-cli.mjs.map +1 -1
- package/wirespec-src-plugin-npm.d.mts +0 -104
- package/wirespec-src-plugin-npm.mjs +40 -40
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +34 -34
- package/wirespec-src-tools-generator.mjs.map +1 -1
|
@@ -1,1130 +1,182 @@
|
|
|
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
|
-
convertWithValidation3ar3nbcqsbkpn as convertWithValidation,
|
|
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.x1x(identifier);
|
|
213
|
-
} else {
|
|
214
|
-
if (identifier instanceof FieldIdentifier) {
|
|
215
|
-
tmp = this.n1x(this.x1x(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().h1z_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.f1z(_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.d1z(_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(endpoint) {
|
|
399
|
-
var tmp = importReferences(endpoint);
|
|
400
|
-
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda(this));
|
|
401
|
-
var tmp_1 = this.or(endpoint.vp_1);
|
|
402
|
-
var tmp_2 = spacer(this.k1x(first(endpoint.aq_1), endpoint), 1);
|
|
403
|
-
var tmp_3 = distinctByStatus(endpoint.bq_1);
|
|
404
|
-
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 ');
|
|
405
|
-
}
|
|
406
|
-
function emit_11(_this__u8e3s4, endpoint) {
|
|
407
|
-
var tmp = emit_18(this, _this__u8e3s4.eq_1);
|
|
408
|
-
var tmp_0 = get_pathParams(endpoint);
|
|
409
|
-
var tmp_1 = emitObject$default(this, tmp_0, 'Path', 'Wirespec.Request.Path', VOID, PythonEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
410
|
-
var tmp_2 = emitObject$default(this, endpoint.yp_1, 'Queries', 'Wirespec.Request.Queries', VOID, PythonEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
411
|
-
var tmp_3 = emitObject$default(this, endpoint.zp_1, 'Headers', 'Wirespec.Request.Headers', VOID, PythonEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
412
|
-
var tmp_4 = Spacer_instance.toString();
|
|
413
|
-
var tmp_5 = Spacer_instance.toString();
|
|
414
|
-
var tmp_6 = emit_18(this, _this__u8e3s4.eq_1);
|
|
415
|
-
var tmp_7 = Spacer_instance.toString();
|
|
416
|
-
var tmp_8 = Spacer_instance.toString();
|
|
417
|
-
var tmp_9 = Spacer_instance.toString();
|
|
418
|
-
var tmp_10 = Spacer_instance.toString();
|
|
419
|
-
var tmp_11 = Spacer_instance.toString();
|
|
420
|
-
var tmp_12 = Spacer_instance.toString();
|
|
421
|
-
var tmp_13 = Spacer_instance.toString();
|
|
422
|
-
var tmp_14 = Spacer_instance.toString();
|
|
423
|
-
var tmp_15 = Spacer_instance.toString();
|
|
424
|
-
var tmp_16 = Spacer_instance.toString();
|
|
425
|
-
var tmp_17 = Spacer_instance.toString();
|
|
426
|
-
var tmp_18 = Spacer_instance.toString();
|
|
427
|
-
var tmp_19 = Spacer_instance.toString();
|
|
428
|
-
var tmp_20 = Spacer_instance.toString();
|
|
429
|
-
var tmp_21 = Spacer_instance.toString();
|
|
430
|
-
var tmp_22 = emit_18(this, _this__u8e3s4.eq_1);
|
|
431
|
-
var tmp_23 = Spacer_instance.toString();
|
|
432
|
-
var tmp_24 = Spacer_instance.toString();
|
|
433
|
-
var tmp_25 = Spacer_instance.toString();
|
|
434
|
-
var tmp_26 = Spacer_instance.toString();
|
|
435
|
-
var tmp_27 = Spacer_instance.toString();
|
|
436
|
-
var tmp_28 = paramList(_this__u8e3s4, endpoint);
|
|
437
|
-
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 ');
|
|
438
|
-
}
|
|
439
|
-
function emit_12(_this__u8e3s4, endpoint) {
|
|
440
|
-
var tmp = emit_18(this, _this__u8e3s4.jq_1);
|
|
441
|
-
var tmp_0 = emitObject$default(this, _this__u8e3s4.iq_1, 'Headers', 'Wirespec.Response.Headers', VOID, PythonEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
442
|
-
var tmp_1 = Spacer_instance.toString();
|
|
443
|
-
var tmp_2 = Spacer_instance.toString();
|
|
444
|
-
var tmp_3 = Spacer_instance.toString();
|
|
445
|
-
var tmp_4 = Spacer_instance.toString();
|
|
446
|
-
var tmp_5 = Spacer_instance.toString();
|
|
447
|
-
var tmp_6 = Spacer_instance.toString();
|
|
448
|
-
var tmp_7 = emit_18(this, _this__u8e3s4.jq_1);
|
|
449
|
-
var tmp_8 = Spacer_instance.toString();
|
|
450
|
-
var tmp_9 = Spacer_instance.toString();
|
|
451
|
-
var tmp_10 = Spacer_instance.toString();
|
|
452
|
-
var tmp_11 = emit_18(this, _this__u8e3s4.jq_1);
|
|
453
|
-
var tmp_12 = Spacer_instance.toString();
|
|
454
|
-
var tmp_13 = Spacer_instance.toString();
|
|
455
|
-
var tmp_14 = Spacer_instance.toString();
|
|
456
|
-
var tmp_15 = paramList_0(_this__u8e3s4);
|
|
457
|
-
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 ');
|
|
458
|
-
}
|
|
459
|
-
initMetadataForInterface(PythonEndpointDefinitionEmitter, 'PythonEndpointDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter]);
|
|
460
|
-
function emit_13(enum_0, module_0) {
|
|
461
|
-
var tmp = this.x1x(enum_0.yr_1);
|
|
462
|
-
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 ');
|
|
463
|
-
}
|
|
464
|
-
initMetadataForInterface(PythonEnumDefinitionEmitter, 'PythonEnumDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
465
|
-
function emit_14(union) {
|
|
466
|
-
return trimMargin('\n |class ' + this.or(union.hp_1) + '(ABC):\n |' + Spacer_instance.toString() + 'pass\n ');
|
|
467
|
-
}
|
|
468
|
-
initMetadataForInterface(PythonUnionDefinitionEmitter, 'PythonUnionDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
469
|
-
function emit_15(refined) {
|
|
470
|
-
return trimMargin('\n |@dataclass\n |class ' + this.x1x(refined.tr_1) + '(Wirespec.Refined):\n |' + Spacer_instance.toString() + 'value: ' + this.f1z(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 ');
|
|
471
|
-
}
|
|
472
|
-
function emitValidator(_this__u8e3s4) {
|
|
473
|
-
var defaultReturn = 'True';
|
|
474
|
-
var type = _this__u8e3s4.ur_1.gv_1;
|
|
475
|
-
var tmp;
|
|
476
|
-
if (type instanceof Integer) {
|
|
477
|
-
var tmp0_safe_receiver = type.lu_1;
|
|
478
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.pq(tmp0_safe_receiver);
|
|
479
|
-
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
480
|
-
} else {
|
|
481
|
-
if (type instanceof Number_0) {
|
|
482
|
-
var tmp2_safe_receiver = type.ou_1;
|
|
483
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.pq(tmp2_safe_receiver);
|
|
484
|
-
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
485
|
-
} else {
|
|
486
|
-
if (type instanceof String_0) {
|
|
487
|
-
var tmp4_safe_receiver = type.iu_1;
|
|
488
|
-
var tmp_0;
|
|
489
|
-
var tmp_1 = tmp4_safe_receiver;
|
|
490
|
-
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
491
|
-
tmp_0 = null;
|
|
492
|
-
} else {
|
|
493
|
-
tmp_0 = this.pq(new RegExp_0(tmp4_safe_receiver));
|
|
494
|
-
}
|
|
495
|
-
var tmp5_elvis_lhs = tmp_0;
|
|
496
|
-
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
497
|
-
} else {
|
|
498
|
-
if (equals(type, Boolean_instance)) {
|
|
499
|
-
tmp = defaultReturn;
|
|
500
|
-
} else {
|
|
501
|
-
if (equals(type, Bytes_instance)) {
|
|
502
|
-
tmp = defaultReturn;
|
|
503
|
-
} else {
|
|
504
|
-
noWhenBranchMatchedException();
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
return tmp;
|
|
511
|
-
}
|
|
512
|
-
initMetadataForInterface(PythonRefinedTypeDefinitionEmitter, 'PythonRefinedTypeDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
513
|
-
initMetadataForClass(PythonEmitter, 'PythonEmitter', PythonEmitter, LanguageEmitter, [LanguageEmitter, PythonIdentifierEmitter, PythonEndpointDefinitionEmitter, PythonChannelDefinitionEmitter, PythonEnumDefinitionEmitter, PythonTypeDefinitionEmitter, PythonUnionDefinitionEmitter, PythonRefinedTypeDefinitionEmitter]);
|
|
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.t1y_1 = function_0;
|
|
524
|
-
}
|
|
525
|
-
protoOf(sam$kotlin_Comparator$0).td = function (a, b) {
|
|
526
|
-
return this.t1y_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.t1y_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.a1z(a);
|
|
556
|
-
var tmp$ret$1 = this$0.a1z(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.u1y_1 = packageName;
|
|
568
|
-
this.v1y_1 = emitShared;
|
|
569
|
-
this.w1y_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.x1y_1 = FileExtension_Python_getInstance();
|
|
571
|
-
this.y1y_1 = PythonShared_instance;
|
|
572
|
-
this.z1y_1 = '#';
|
|
573
|
-
}
|
|
574
|
-
protoOf(PythonEmitter).vq = function () {
|
|
575
|
-
return this.x1y_1;
|
|
576
|
-
};
|
|
577
|
-
protoOf(PythonEmitter).g1x = function () {
|
|
578
|
-
return this.y1y_1;
|
|
579
|
-
};
|
|
580
|
-
protoOf(PythonEmitter).wq = function () {
|
|
581
|
-
return this.z1y_1;
|
|
582
|
-
};
|
|
583
|
-
protoOf(PythonEmitter).a1z = 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.u1y_1.gs() + '__init__', 'from . import model\nfrom . import endpoint\nfrom . import wirespec\n');
|
|
624
|
-
var tmp_1 = this.u1y_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.u1y_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.u1y_1.gs() + 'wirespec', this.g1x().c1z_1);
|
|
669
|
-
return this.v1y_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.u1y_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.w1y_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.f1z(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.f1z(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.f1z(_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.f1z(_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.f1z(_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.f1z(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.f1z(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.f1z(_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.g1z(it);
|
|
941
|
-
};
|
|
942
|
-
}
|
|
943
|
-
function PythonEndpointDefinitionEmitter$emit$lambda_0(this$0, $endpoint) {
|
|
944
|
-
return function (it) {
|
|
945
|
-
return this$0.e1z(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.n1x(sanitizeEnum(this$0, it)) + ' = "' + it + '"';
|
|
1093
|
-
};
|
|
1094
|
-
}
|
|
1095
|
-
function PythonEnumDefinitionEmitter() {
|
|
1096
|
-
}
|
|
1097
|
-
function Companion() {
|
|
1098
|
-
Companion_instance_2 = this;
|
|
1099
|
-
this.h1z_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
|
+
emitEndpointClient1meajc90wf3el as emitEndpointClient,
|
|
117
|
+
emitClient32kfwzg2hm5vj as emitClient,
|
|
118
|
+
get_extensions31c4or738wbxz as get_extensions,
|
|
119
|
+
emit1oxjujel6f3jb as emit_1,
|
|
120
|
+
beforeGenerate3o8idb3hey1b0 as beforeGenerate,
|
|
121
|
+
IrEmitterh2m93ojzvkep as IrEmitter,
|
|
122
|
+
TransformerBuildera6a1gvlhjj9b as TransformerBuilder,
|
|
123
|
+
transform3eti8i2bqvifx as transform,
|
|
124
|
+
Namespace345pal554qu3j as Namespace,
|
|
125
|
+
Union38f3pecvfcpxh as Union_0,
|
|
126
|
+
Struct39wf79cwtn4ty as Struct,
|
|
127
|
+
fieldList3dg35dj9v5h4v as fieldList,
|
|
128
|
+
Dict22iqrhoo0g8et as Dict,
|
|
129
|
+
Array2goj74t0aak7b as Array_0,
|
|
130
|
+
Nullable3wjn6l6q3h6o as Nullable,
|
|
131
|
+
Any_instance2998xag3cdzh3 as Any_instance,
|
|
132
|
+
Custom_init_$Create$2enn7oyj71j1t as Custom_init_$Create$,
|
|
133
|
+
Reflect_instance3i17lxiopj78t as Reflect_instance,
|
|
134
|
+
Field354s1ceh5pvhf as Field,
|
|
135
|
+
transformChildrend9p91tpcqdkx as transformChildren_1,
|
|
136
|
+
Boolean_instance27opaqtiiiysz as Boolean_instance,
|
|
137
|
+
String_instance3uxvo48ki208u as String_instance,
|
|
138
|
+
Function21cuq8qizkin7 as Function,
|
|
139
|
+
function12vu2kapzno4w as function_0,
|
|
140
|
+
VariableReference2vlynnhaw1i64 as VariableReference,
|
|
141
|
+
FieldCall1iz7z2fx2xo4p as FieldCall,
|
|
142
|
+
convertConstraintkgpvomct0x0s as convertConstraint,
|
|
143
|
+
Interface3pn84xq686t2r as Interface,
|
|
144
|
+
Custom2si7lto3wompr as Custom,
|
|
145
|
+
Parameteruqoxd4rzw7ga as Parameter,
|
|
146
|
+
FunctionCall30872kpnbr7op as FunctionCall,
|
|
147
|
+
} from './wirespec-src-compiler-ir.mjs';
|
|
148
|
+
import {
|
|
149
|
+
NonEmptyList3ak25ihy2gcvs as NonEmptyList,
|
|
150
|
+
toNonEmptyListOrNull2ovnnazjb3msz as toNonEmptyListOrNull,
|
|
151
|
+
NonEmptyList__plus_impl_xqmb92tle8a7jcf2wm as NonEmptyList__plus_impl_xqmb9,
|
|
152
|
+
NonEmptyList__plus_impl_xqmb91y38uyofmba13 as NonEmptyList__plus_impl_xqmb9_0,
|
|
153
|
+
} from './arrow-arrow-core.mjs';
|
|
154
|
+
//region block: imports
|
|
155
|
+
//endregion
|
|
156
|
+
//region block: pre-declaration
|
|
157
|
+
initMetadataForCompanion(Companion);
|
|
158
|
+
initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
|
|
159
|
+
initMetadataForClass(PythonIrEmitter, 'PythonIrEmitter', PythonIrEmitter, VOID, [IrEmitter]);
|
|
160
|
+
//endregion
|
|
1109
161
|
function _get_sanitizationConfig__sns434($this) {
|
|
1110
|
-
var tmp0 = $this.
|
|
162
|
+
var tmp0 = $this.f1y_1;
|
|
1111
163
|
var tmp = KProperty1;
|
|
1112
164
|
// Inline function 'kotlin.getValue' call
|
|
1113
165
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, PythonIrEmitter$_get_sanitizationConfig_$ref_1q5eai(), null);
|
|
1114
|
-
return tmp0.
|
|
166
|
+
return tmp0.m1();
|
|
1115
167
|
}
|
|
1116
|
-
function
|
|
168
|
+
function sanitize($this, _this__u8e3s4) {
|
|
1117
169
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
1118
|
-
var this_0 = split(_this__u8e3s4.
|
|
170
|
+
var this_0 = split(_this__u8e3s4.m1(), ['.', ' ']);
|
|
1119
171
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
1120
|
-
var destination = ArrayList_init_$Create$
|
|
172
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1121
173
|
var index = 0;
|
|
1122
174
|
var _iterator__ex2g4s = this_0.t();
|
|
1123
175
|
while (_iterator__ex2g4s.u()) {
|
|
1124
176
|
var item = _iterator__ex2g4s.v();
|
|
1125
177
|
var _unary__edvuaz = index;
|
|
1126
178
|
index = _unary__edvuaz + 1 | 0;
|
|
1127
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ?
|
|
179
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance.xq(item) : item;
|
|
1128
180
|
destination.x(tmp$ret$0);
|
|
1129
181
|
}
|
|
1130
182
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1163,16 +215,16 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
1163
215
|
var it_0 = tmp;
|
|
1164
216
|
var tmp_2;
|
|
1165
217
|
if (_this__u8e3s4 instanceof FieldIdentifier) {
|
|
1166
|
-
tmp_2 =
|
|
218
|
+
tmp_2 = sanitizeKeywords($this, it_0);
|
|
1167
219
|
} else {
|
|
1168
220
|
tmp_2 = it_0;
|
|
1169
221
|
}
|
|
1170
222
|
return tmp_2;
|
|
1171
223
|
}
|
|
1172
|
-
function
|
|
1173
|
-
return
|
|
224
|
+
function sanitizeKeywords($this, _this__u8e3s4) {
|
|
225
|
+
return Companion_getInstance_0().l1x().v1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1174
226
|
}
|
|
1175
|
-
function
|
|
227
|
+
function sanitizeEnum($this, _this__u8e3s4) {
|
|
1176
228
|
// Inline function 'kotlin.let' call
|
|
1177
229
|
var it = joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_');
|
|
1178
230
|
var tmp;
|
|
@@ -1194,34 +246,37 @@ function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
|
1194
246
|
function buildImports($this, wirespecPath) {
|
|
1195
247
|
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
248
|
}
|
|
1197
|
-
function
|
|
1198
|
-
|
|
1199
|
-
this.
|
|
249
|
+
function Companion() {
|
|
250
|
+
Companion_instance_2 = this;
|
|
251
|
+
this.h1y_1 = PythonGenerator_getInstance();
|
|
1200
252
|
}
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
253
|
+
protoOf(Companion).l1x = function () {
|
|
254
|
+
return this.h1y_1.q1w_1;
|
|
255
|
+
};
|
|
256
|
+
var Companion_instance_2;
|
|
257
|
+
function Companion_getInstance_0() {
|
|
258
|
+
if (Companion_instance_2 == null)
|
|
259
|
+
new Companion();
|
|
260
|
+
return Companion_instance_2;
|
|
1206
261
|
}
|
|
1207
|
-
function sam$kotlin_Comparator$
|
|
1208
|
-
this.
|
|
262
|
+
function sam$kotlin_Comparator$0(function_0) {
|
|
263
|
+
this.i1y_1 = function_0;
|
|
1209
264
|
}
|
|
1210
|
-
protoOf(sam$kotlin_Comparator$
|
|
1211
|
-
return this.
|
|
265
|
+
protoOf(sam$kotlin_Comparator$0).ud = function (a, b) {
|
|
266
|
+
return this.i1y_1(a, b);
|
|
1212
267
|
};
|
|
1213
|
-
protoOf(sam$kotlin_Comparator$
|
|
1214
|
-
return this.
|
|
268
|
+
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
269
|
+
return this.ud(a, b);
|
|
1215
270
|
};
|
|
1216
|
-
protoOf(sam$kotlin_Comparator$
|
|
1217
|
-
return this.
|
|
271
|
+
protoOf(sam$kotlin_Comparator$0).m3 = function () {
|
|
272
|
+
return this.i1y_1;
|
|
1218
273
|
};
|
|
1219
|
-
protoOf(sam$kotlin_Comparator$
|
|
274
|
+
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
1220
275
|
var tmp;
|
|
1221
276
|
if (!(other == null) ? isInterface(other, Comparator) : false) {
|
|
1222
277
|
var tmp_0;
|
|
1223
278
|
if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
|
|
1224
|
-
tmp_0 = equals(this.
|
|
279
|
+
tmp_0 = equals(this.m3(), other.m3());
|
|
1225
280
|
} else {
|
|
1226
281
|
tmp_0 = false;
|
|
1227
282
|
}
|
|
@@ -1231,18 +286,18 @@ protoOf(sam$kotlin_Comparator$0_0).equals = function (other) {
|
|
|
1231
286
|
}
|
|
1232
287
|
return tmp;
|
|
1233
288
|
};
|
|
1234
|
-
protoOf(sam$kotlin_Comparator$
|
|
1235
|
-
return hashCode(this.
|
|
289
|
+
protoOf(sam$kotlin_Comparator$0).hashCode = function () {
|
|
290
|
+
return hashCode(this.m3());
|
|
1236
291
|
};
|
|
1237
292
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
1238
293
|
return '_' + it;
|
|
1239
294
|
}
|
|
1240
295
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(name) {
|
|
1241
|
-
var sanitized = name.
|
|
296
|
+
var sanitized = name.v1g_1.b1() > 1 ? name.j1m() : name.w1i();
|
|
1242
297
|
return new Name(listOf_0(sanitized));
|
|
1243
298
|
}
|
|
1244
299
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(name) {
|
|
1245
|
-
return new Name(listOf_0(name.
|
|
300
|
+
return new Name(listOf_0(name.j1m()));
|
|
1246
301
|
}
|
|
1247
302
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(it) {
|
|
1248
303
|
return it;
|
|
@@ -1251,20 +306,20 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1251
306
|
return function (stmt, tr) {
|
|
1252
307
|
var tmp;
|
|
1253
308
|
if (stmt instanceof ConstructorStatement) {
|
|
1254
|
-
var tmp_0 = tr.
|
|
309
|
+
var tmp_0 = tr.i1v(stmt.o1n_1);
|
|
1255
310
|
// Inline function 'kotlin.collections.map' call
|
|
1256
|
-
var this_0 = stmt.
|
|
311
|
+
var this_0 = stmt.p1n_1;
|
|
1257
312
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1258
|
-
var destination = ArrayList_init_$Create$
|
|
313
|
+
var destination = ArrayList_init_$Create$(this_0.b1());
|
|
1259
314
|
// Inline function 'kotlin.collections.iterator' call
|
|
1260
|
-
var _iterator__ex2g4s = this_0.
|
|
315
|
+
var _iterator__ex2g4s = this_0.k1().t();
|
|
1261
316
|
while (_iterator__ex2g4s.u()) {
|
|
1262
317
|
var item = _iterator__ex2g4s.v();
|
|
1263
318
|
// Inline function 'kotlin.collections.component1' call
|
|
1264
|
-
var k = item.
|
|
319
|
+
var k = item.l1();
|
|
1265
320
|
// Inline function 'kotlin.collections.component2' call
|
|
1266
|
-
var v = item.
|
|
1267
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.
|
|
321
|
+
var v = item.m1();
|
|
322
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.l1v(v));
|
|
1268
323
|
destination.x(tmp$ret$3);
|
|
1269
324
|
}
|
|
1270
325
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
@@ -1276,7 +331,7 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1276
331
|
}
|
|
1277
332
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1278
333
|
return function () {
|
|
1279
|
-
var tmp =
|
|
334
|
+
var tmp = Companion_getInstance_0().l1x();
|
|
1280
335
|
var tmp_0 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1281
336
|
var tmp_1 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0;
|
|
1282
337
|
var tmp_2 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1;
|
|
@@ -1296,7 +351,7 @@ function PythonIrEmitter$emit$lambda(a, b) {
|
|
|
1296
351
|
return compareValues(tmp, tmp$ret$1);
|
|
1297
352
|
}
|
|
1298
353
|
function emit$emitInitImport(this$0, def) {
|
|
1299
|
-
return import_0('.' +
|
|
354
|
+
return import_0('.' + sanitize(this$0, def.gr()), sanitize(this$0, def.gr()));
|
|
1300
355
|
}
|
|
1301
356
|
function PythonIrEmitter$emitGenerator$lambda(it) {
|
|
1302
357
|
return startsWith(it, 'Wirespec.') || it === 'Wirespec';
|
|
@@ -1315,17 +370,17 @@ function PythonIrEmitter$emitGenerator$lambda_2($generatorOwnName, $generatorRef
|
|
|
1315
370
|
var tmp_0;
|
|
1316
371
|
var tmp_1;
|
|
1317
372
|
if (expr instanceof RawExpression) {
|
|
1318
|
-
tmp_1 = endsWith(expr.
|
|
373
|
+
tmp_1 = endsWith(expr.h1q_1, 'Generator');
|
|
1319
374
|
} else {
|
|
1320
375
|
tmp_1 = false;
|
|
1321
376
|
}
|
|
1322
377
|
if (tmp_1) {
|
|
1323
|
-
tmp_0 = !(expr.
|
|
378
|
+
tmp_0 = !(expr.h1q_1 === $generatorOwnName);
|
|
1324
379
|
} else {
|
|
1325
380
|
tmp_0 = false;
|
|
1326
381
|
}
|
|
1327
382
|
if (tmp_0) {
|
|
1328
|
-
$generatorRefs.x(expr.
|
|
383
|
+
$generatorRefs.x(expr.h1q_1);
|
|
1329
384
|
tmp = Unit_instance;
|
|
1330
385
|
}
|
|
1331
386
|
return transformChildren_0(expr, t);
|
|
@@ -1333,48 +388,48 @@ function PythonIrEmitter$emitGenerator$lambda_2($generatorOwnName, $generatorRef
|
|
|
1333
388
|
}
|
|
1334
389
|
function PythonIrEmitter$emit$lambda_0(this$0) {
|
|
1335
390
|
return function (it) {
|
|
1336
|
-
return
|
|
391
|
+
return sanitizeKeywords(this$0, sanitizeEnum(this$0, it));
|
|
1337
392
|
};
|
|
1338
393
|
}
|
|
1339
394
|
function PythonIrEmitter(packageName, emitShared) {
|
|
1340
|
-
|
|
1341
|
-
packageName = packageName === VOID ?
|
|
1342
|
-
emitShared = emitShared === VOID ?
|
|
1343
|
-
this.
|
|
1344
|
-
this.
|
|
1345
|
-
this.
|
|
1346
|
-
this.
|
|
395
|
+
Companion_getInstance_0();
|
|
396
|
+
packageName = packageName === VOID ? Companion_instance_0.bs('community.flock.wirespec.generated') : packageName;
|
|
397
|
+
emitShared = emitShared === VOID ? Companion_instance_1.fp() : emitShared;
|
|
398
|
+
this.b1y_1 = packageName;
|
|
399
|
+
this.c1y_1 = emitShared;
|
|
400
|
+
this.d1y_1 = PythonGenerator_getInstance();
|
|
401
|
+
this.e1y_1 = FileExtension_Python_getInstance();
|
|
1347
402
|
var tmp = this;
|
|
1348
|
-
tmp.
|
|
1349
|
-
this.
|
|
403
|
+
tmp.f1y_1 = lazy(PythonIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
404
|
+
this.g1y_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
405
|
}
|
|
1351
|
-
protoOf(PythonIrEmitter).
|
|
1352
|
-
return this.
|
|
406
|
+
protoOf(PythonIrEmitter).d1w = function () {
|
|
407
|
+
return this.d1y_1;
|
|
1353
408
|
};
|
|
1354
|
-
protoOf(PythonIrEmitter).
|
|
1355
|
-
return this.
|
|
409
|
+
protoOf(PythonIrEmitter).er = function () {
|
|
410
|
+
return this.e1y_1;
|
|
1356
411
|
};
|
|
1357
|
-
protoOf(PythonIrEmitter).
|
|
1358
|
-
var source = replaceReflectInNonGenericStructFields(convert(
|
|
412
|
+
protoOf(PythonIrEmitter).h1w = function () {
|
|
413
|
+
var source = replaceReflectInNonGenericStructFields(convert(Companion_instance_0.bs('shared')));
|
|
1359
414
|
var tmp;
|
|
1360
|
-
if (this.
|
|
1361
|
-
tmp = new File(Companion_getInstance().
|
|
415
|
+
if (this.c1y_1.gp_1) {
|
|
416
|
+
tmp = new File(Companion_getInstance().x1g(this.b1y_1.es() + 'wirespec'), listOf_0(raw(this.g1y_1 + PythonGenerator_getInstance().e1w(source))));
|
|
1362
417
|
} else {
|
|
1363
418
|
tmp = null;
|
|
1364
419
|
}
|
|
1365
420
|
return tmp;
|
|
1366
421
|
};
|
|
1367
|
-
protoOf(PythonIrEmitter).
|
|
422
|
+
protoOf(PythonIrEmitter).g1w = function (module_0, logger) {
|
|
1368
423
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
1369
|
-
var this_0 = new NonEmptyList(module_0.
|
|
424
|
+
var this_0 = new NonEmptyList(module_0.ar_1);
|
|
1370
425
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
1371
426
|
var tmp = PythonIrEmitter$emit$lambda;
|
|
1372
|
-
var tmp$ret$0 = new sam$kotlin_Comparator$
|
|
427
|
+
var tmp$ret$0 = new sam$kotlin_Comparator$0(tmp);
|
|
1373
428
|
var tmp$ret$1 = sortedWith(this_0, tmp$ret$0);
|
|
1374
429
|
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.
|
|
430
|
+
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).xm_1;
|
|
431
|
+
var emitted = emit.call(this, module_0.lv(VOID, statements), logger);
|
|
432
|
+
var tmp0 = new NonEmptyList(module_0.ar_1);
|
|
1378
433
|
var tmp$ret$2;
|
|
1379
434
|
$l$block_0: {
|
|
1380
435
|
// Inline function 'kotlin.collections.any' call
|
|
@@ -1399,24 +454,24 @@ protoOf(PythonIrEmitter).z1v = function (module_0, logger) {
|
|
|
1399
454
|
tmp$ret$2 = false;
|
|
1400
455
|
}
|
|
1401
456
|
var hasEndpoints = tmp$ret$2;
|
|
1402
|
-
var tmp_2 = Companion_getInstance().
|
|
457
|
+
var tmp_2 = Companion_getInstance().x1g(this.b1y_1.es() + '__init__');
|
|
1403
458
|
// Inline function 'kotlin.collections.buildList' call
|
|
1404
459
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1405
460
|
// Inline function 'kotlin.apply' call
|
|
1406
|
-
var this_1 = ArrayList_init_$Create$();
|
|
461
|
+
var this_1 = ArrayList_init_$Create$_0();
|
|
1407
462
|
this_1.x(import_0('.', 'model'));
|
|
1408
463
|
this_1.x(import_0('.', 'endpoint'));
|
|
1409
464
|
if (hasEndpoints) {
|
|
1410
465
|
this_1.x(import_0('.', 'client'));
|
|
1411
466
|
}
|
|
1412
467
|
this_1.x(import_0('.', 'wirespec'));
|
|
1413
|
-
var tmp$ret$7 = this_1.
|
|
468
|
+
var tmp$ret$7 = this_1.p5();
|
|
1414
469
|
var init = new File(tmp_2, tmp$ret$7);
|
|
1415
|
-
var tmp_3 = Companion_getInstance().
|
|
470
|
+
var tmp_3 = Companion_getInstance().x1g(this.b1y_1.es() + 'endpoint/' + '__init__');
|
|
1416
471
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1417
|
-
var tmp0_0 = new NonEmptyList(module_0.
|
|
472
|
+
var tmp0_0 = new NonEmptyList(module_0.ar_1);
|
|
1418
473
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1419
|
-
var destination = ArrayList_init_$Create$();
|
|
474
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1420
475
|
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
1421
476
|
while (_iterator__ex2g4s_0.u()) {
|
|
1422
477
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
@@ -1426,7 +481,7 @@ protoOf(PythonIrEmitter).z1v = function (module_0, logger) {
|
|
|
1426
481
|
}
|
|
1427
482
|
// Inline function 'kotlin.collections.map' call
|
|
1428
483
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1429
|
-
var destination_0 = ArrayList_init_$Create$
|
|
484
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(destination, 10));
|
|
1430
485
|
var _iterator__ex2g4s_1 = destination.t();
|
|
1431
486
|
while (_iterator__ex2g4s_1.u()) {
|
|
1432
487
|
var item = _iterator__ex2g4s_1.v();
|
|
@@ -1434,11 +489,11 @@ protoOf(PythonIrEmitter).z1v = function (module_0, logger) {
|
|
|
1434
489
|
destination_0.x(tmp$ret$10);
|
|
1435
490
|
}
|
|
1436
491
|
var initEndpoint = new File(tmp_3, destination_0);
|
|
1437
|
-
var tmp_4 = Companion_getInstance().
|
|
492
|
+
var tmp_4 = Companion_getInstance().x1g(this.b1y_1.es() + 'model/' + '__init__');
|
|
1438
493
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1439
|
-
var tmp0_1 = new NonEmptyList(module_0.
|
|
494
|
+
var tmp0_1 = new NonEmptyList(module_0.ar_1);
|
|
1440
495
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1441
|
-
var destination_1 = ArrayList_init_$Create$();
|
|
496
|
+
var destination_1 = ArrayList_init_$Create$_0();
|
|
1442
497
|
var _iterator__ex2g4s_2 = tmp0_1.t();
|
|
1443
498
|
while (_iterator__ex2g4s_2.u()) {
|
|
1444
499
|
var element_1 = _iterator__ex2g4s_2.v();
|
|
@@ -1448,7 +503,7 @@ protoOf(PythonIrEmitter).z1v = function (module_0, logger) {
|
|
|
1448
503
|
}
|
|
1449
504
|
// Inline function 'kotlin.collections.map' call
|
|
1450
505
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1451
|
-
var destination_2 = ArrayList_init_$Create$
|
|
506
|
+
var destination_2 = ArrayList_init_$Create$(collectionSizeOrDefault(destination_1, 10));
|
|
1452
507
|
var _iterator__ex2g4s_3 = destination_1.t();
|
|
1453
508
|
while (_iterator__ex2g4s_3.u()) {
|
|
1454
509
|
var item_0 = _iterator__ex2g4s_3.v();
|
|
@@ -1456,8 +511,8 @@ protoOf(PythonIrEmitter).z1v = function (module_0, logger) {
|
|
|
1456
511
|
destination_2.x(tmp$ret$15);
|
|
1457
512
|
}
|
|
1458
513
|
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.
|
|
514
|
+
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().x1g(this.b1y_1.es() + 'client/' + '__init__'), emptyList())) : emptyList();
|
|
515
|
+
var tmp0_2 = dropLast(split(this.b1y_1.cs_1, ['.']), 1);
|
|
1461
516
|
var tmp$ret$18;
|
|
1462
517
|
$l$block_1: {
|
|
1463
518
|
// Inline function 'kotlin.collections.runningFold' call
|
|
@@ -1467,7 +522,7 @@ protoOf(PythonIrEmitter).z1v = function (module_0, logger) {
|
|
|
1467
522
|
break $l$block_1;
|
|
1468
523
|
}
|
|
1469
524
|
// Inline function 'kotlin.apply' call
|
|
1470
|
-
var this_2 = ArrayList_init_$Create$
|
|
525
|
+
var this_2 = ArrayList_init_$Create$(estimatedSize + 1 | 0);
|
|
1471
526
|
this_2.x('');
|
|
1472
527
|
var result = this_2;
|
|
1473
528
|
var accumulator = '';
|
|
@@ -1490,21 +545,21 @@ protoOf(PythonIrEmitter).z1v = function (module_0, logger) {
|
|
|
1490
545
|
// Inline function 'kotlin.collections.map' call
|
|
1491
546
|
var this_3 = drop(tmp$ret$18, 1);
|
|
1492
547
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1493
|
-
var destination_3 = ArrayList_init_$Create$
|
|
548
|
+
var destination_3 = ArrayList_init_$Create$(collectionSizeOrDefault(this_3, 10));
|
|
1494
549
|
var _iterator__ex2g4s_5 = this_3.t();
|
|
1495
550
|
while (_iterator__ex2g4s_5.u()) {
|
|
1496
551
|
var item_1 = _iterator__ex2g4s_5.v();
|
|
1497
|
-
var tmp$ret$23 = new File(Companion_getInstance().
|
|
552
|
+
var tmp$ret$23 = new File(Companion_getInstance().x1g(item_1 + '/__init__'), emptyList());
|
|
1498
553
|
destination_3.x(tmp$ret$23);
|
|
1499
554
|
}
|
|
1500
555
|
var parentInits = destination_3;
|
|
1501
|
-
return this.
|
|
556
|
+
return this.c1y_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
557
|
};
|
|
1503
|
-
protoOf(PythonIrEmitter).
|
|
558
|
+
protoOf(PythonIrEmitter).fr = function (definition, module_0, logger) {
|
|
1504
559
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1505
|
-
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.
|
|
560
|
+
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.b1y_1, definition);
|
|
1506
561
|
};
|
|
1507
|
-
protoOf(PythonIrEmitter).
|
|
562
|
+
protoOf(PythonIrEmitter).m1w = function (definition, module_0) {
|
|
1508
563
|
var tmp;
|
|
1509
564
|
if (definition instanceof Type) {
|
|
1510
565
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1525,7 +580,7 @@ protoOf(PythonIrEmitter).f1w = function (definition, module_0) {
|
|
|
1525
580
|
}
|
|
1526
581
|
var generatorFile = tmp;
|
|
1527
582
|
var sanitized = sanitizeNames(generatorFile, _get_sanitizationConfig__sns434(this));
|
|
1528
|
-
var generatorOwnName = definition.
|
|
583
|
+
var generatorOwnName = definition.gr().m1() + 'Generator';
|
|
1529
584
|
var tmp_0 = asSequence(collectCustomTypeNames(sanitized));
|
|
1530
585
|
var tmp_1 = filterNot(tmp_0, PythonIrEmitter$emitGenerator$lambda);
|
|
1531
586
|
var tmp_2 = filterNot(tmp_1, PythonIrEmitter$emitGenerator$lambda_0(generatorOwnName));
|
|
@@ -1534,12 +589,12 @@ protoOf(PythonIrEmitter).f1w = function (definition, module_0) {
|
|
|
1534
589
|
var generatorRefs = LinkedHashSet_init_$Create$();
|
|
1535
590
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1536
591
|
var scope = new TransformScope(sanitized);
|
|
1537
|
-
scope.
|
|
1538
|
-
var tmp_3 = scope.
|
|
592
|
+
scope.y1v(PythonIrEmitter$emitGenerator$lambda_2(generatorOwnName, generatorRefs));
|
|
593
|
+
var tmp_3 = scope.q1v_1;
|
|
1539
594
|
isInterface(tmp_3, Element) || THROW_CCE();
|
|
1540
595
|
// Inline function 'kotlin.collections.filter' call
|
|
1541
596
|
// Inline function 'kotlin.collections.filterTo' call
|
|
1542
|
-
var destination = ArrayList_init_$Create$();
|
|
597
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1543
598
|
var _iterator__ex2g4s = customNames.t();
|
|
1544
599
|
while (_iterator__ex2g4s.u()) {
|
|
1545
600
|
var element = _iterator__ex2g4s.v();
|
|
@@ -1550,7 +605,7 @@ protoOf(PythonIrEmitter).f1w = function (definition, module_0) {
|
|
|
1550
605
|
// Inline function 'kotlin.collections.map' call
|
|
1551
606
|
var this_0 = distinct_0(plus(destination, generatorRefs));
|
|
1552
607
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1553
|
-
var destination_0 = ArrayList_init_$Create$
|
|
608
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1554
609
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
1555
610
|
while (_iterator__ex2g4s_0.u()) {
|
|
1556
611
|
var item = _iterator__ex2g4s_0.v();
|
|
@@ -1560,7 +615,7 @@ protoOf(PythonIrEmitter).f1w = function (definition, module_0) {
|
|
|
1560
615
|
var generatorImports = destination_0;
|
|
1561
616
|
// Inline function 'kotlin.collections.filterNot' call
|
|
1562
617
|
// Inline function 'kotlin.collections.filterNotTo' call
|
|
1563
|
-
var destination_1 = ArrayList_init_$Create$();
|
|
618
|
+
var destination_1 = ArrayList_init_$Create$_0();
|
|
1564
619
|
var _iterator__ex2g4s_1 = customNames.t();
|
|
1565
620
|
while (_iterator__ex2g4s_1.u()) {
|
|
1566
621
|
var element_0 = _iterator__ex2g4s_1.v();
|
|
@@ -1570,7 +625,7 @@ protoOf(PythonIrEmitter).f1w = function (definition, module_0) {
|
|
|
1570
625
|
}
|
|
1571
626
|
// Inline function 'kotlin.collections.map' call
|
|
1572
627
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1573
|
-
var destination_2 = ArrayList_init_$Create$
|
|
628
|
+
var destination_2 = ArrayList_init_$Create$(collectionSizeOrDefault(destination_1, 10));
|
|
1574
629
|
var _iterator__ex2g4s_2 = destination_1.t();
|
|
1575
630
|
while (_iterator__ex2g4s_2.u()) {
|
|
1576
631
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
@@ -1578,39 +633,39 @@ protoOf(PythonIrEmitter).f1w = function (definition, module_0) {
|
|
|
1578
633
|
destination_2.x(tmp$ret$12);
|
|
1579
634
|
}
|
|
1580
635
|
var modelImports = destination_2;
|
|
1581
|
-
return placeInModule_0(prependImports(sanitized, plus(plus(buildImports(this, '..wirespec'), modelImports), generatorImports)), this.
|
|
636
|
+
return placeInModule_0(prependImports(sanitized, plus(plus(buildImports(this, '..wirespec'), modelImports), generatorImports)), this.b1y_1, 'generator');
|
|
1582
637
|
};
|
|
1583
|
-
protoOf(PythonIrEmitter).
|
|
638
|
+
protoOf(PythonIrEmitter).vr = function (type, module_0) {
|
|
1584
639
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1585
640
|
var this_0 = importReferences(type);
|
|
1586
641
|
var set = HashSet_init_$Create$();
|
|
1587
|
-
var list = ArrayList_init_$Create$();
|
|
642
|
+
var list = ArrayList_init_$Create$_0();
|
|
1588
643
|
var _iterator__ex2g4s = this_0.t();
|
|
1589
644
|
while (_iterator__ex2g4s.u()) {
|
|
1590
645
|
var e = _iterator__ex2g4s.v();
|
|
1591
|
-
var key = e.
|
|
646
|
+
var key = e.dv_1;
|
|
1592
647
|
if (set.x(key)) {
|
|
1593
648
|
list.x(e);
|
|
1594
649
|
}
|
|
1595
650
|
}
|
|
1596
651
|
// Inline function 'kotlin.collections.map' call
|
|
1597
652
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1598
|
-
var destination = ArrayList_init_$Create$
|
|
653
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(list, 10));
|
|
1599
654
|
var _iterator__ex2g4s_0 = list.t();
|
|
1600
655
|
while (_iterator__ex2g4s_0.u()) {
|
|
1601
656
|
var item = _iterator__ex2g4s_0.v();
|
|
1602
|
-
var tmp$ret$2 = import_0('.' + item.
|
|
657
|
+
var tmp$ret$2 = import_0('.' + item.dv_1, item.dv_1);
|
|
1603
658
|
destination.x(tmp$ret$2);
|
|
1604
659
|
}
|
|
1605
660
|
var typeImports = destination;
|
|
1606
661
|
// Inline function 'kotlin.collections.map' call
|
|
1607
|
-
var this_1 = type.
|
|
662
|
+
var this_1 = type.wp_1.sp_1;
|
|
1608
663
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1609
|
-
var destination_0 = ArrayList_init_$Create$
|
|
664
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
1610
665
|
var _iterator__ex2g4s_1 = this_1.t();
|
|
1611
666
|
while (_iterator__ex2g4s_1.u()) {
|
|
1612
667
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
1613
|
-
var tmp$ret$5 = item_0.
|
|
668
|
+
var tmp$ret$5 = item_0.aq_1.m1();
|
|
1614
669
|
destination_0.x(tmp$ret$5);
|
|
1615
670
|
}
|
|
1616
671
|
var fieldNames = toSet(destination_0);
|
|
@@ -1626,80 +681,80 @@ protoOf(PythonIrEmitter).lq = function (type, module_0) {
|
|
|
1626
681
|
var tmp$ret$10 = tmp_0;
|
|
1627
682
|
return prependImports(tmp, tmp$ret$10);
|
|
1628
683
|
};
|
|
1629
|
-
protoOf(PythonIrEmitter).
|
|
684
|
+
protoOf(PythonIrEmitter).tr = function (enum_0, module_0) {
|
|
1630
685
|
var tmp = convert_0(enum_0);
|
|
1631
686
|
return sanitizeNames(sanitizeEnumEntries(tmp, PythonIrEmitter$emit$lambda_0(this)), _get_sanitizationConfig__sns434(this));
|
|
1632
687
|
};
|
|
1633
|
-
protoOf(PythonIrEmitter).
|
|
688
|
+
protoOf(PythonIrEmitter).jr = function (union) {
|
|
1634
689
|
return sanitizeNames(convert_1(union), _get_sanitizationConfig__sns434(this));
|
|
1635
690
|
};
|
|
1636
|
-
protoOf(PythonIrEmitter).
|
|
691
|
+
protoOf(PythonIrEmitter).or = function (refined) {
|
|
1637
692
|
return sanitizeNames(replaceRefinedFunctions(convert_2(refined), refined), _get_sanitizationConfig__sns434(this));
|
|
1638
693
|
};
|
|
1639
|
-
protoOf(PythonIrEmitter).
|
|
694
|
+
protoOf(PythonIrEmitter).ur = function (endpoint) {
|
|
1640
695
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1641
696
|
var this_0 = importReferences(endpoint);
|
|
1642
697
|
var set = HashSet_init_$Create$();
|
|
1643
|
-
var list = ArrayList_init_$Create$();
|
|
698
|
+
var list = ArrayList_init_$Create$_0();
|
|
1644
699
|
var _iterator__ex2g4s = this_0.t();
|
|
1645
700
|
while (_iterator__ex2g4s.u()) {
|
|
1646
701
|
var e = _iterator__ex2g4s.v();
|
|
1647
|
-
var key = e.
|
|
702
|
+
var key = e.dv_1;
|
|
1648
703
|
if (set.x(key)) {
|
|
1649
704
|
list.x(e);
|
|
1650
705
|
}
|
|
1651
706
|
}
|
|
1652
707
|
// Inline function 'kotlin.collections.map' call
|
|
1653
708
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1654
|
-
var destination = ArrayList_init_$Create$
|
|
709
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(list, 10));
|
|
1655
710
|
var _iterator__ex2g4s_0 = list.t();
|
|
1656
711
|
while (_iterator__ex2g4s_0.u()) {
|
|
1657
712
|
var item = _iterator__ex2g4s_0.v();
|
|
1658
|
-
var tmp$ret$2 = import_0('..model.' + item.
|
|
713
|
+
var tmp$ret$2 = import_0('..model.' + item.dv_1, item.dv_1);
|
|
1659
714
|
destination.x(tmp$ret$2);
|
|
1660
715
|
}
|
|
1661
716
|
var endpointImports = destination;
|
|
1662
717
|
// Inline function 'kotlin.let' call
|
|
1663
718
|
var it = splitEndpointStructsToModuleLevel(convert_3(endpoint));
|
|
1664
|
-
var tmp$ret$6 = it.
|
|
719
|
+
var tmp$ret$6 = it.w1n(VOID, plus(endpointImports, it.t1n_1));
|
|
1665
720
|
return sanitizeNames(snakeCaseHandlerAndCallMethods(tmp$ret$6), _get_sanitizationConfig__sns434(this));
|
|
1666
721
|
};
|
|
1667
|
-
protoOf(PythonIrEmitter).
|
|
722
|
+
protoOf(PythonIrEmitter).ir = function (channel) {
|
|
1668
723
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1669
724
|
};
|
|
1670
|
-
protoOf(PythonIrEmitter).
|
|
725
|
+
protoOf(PythonIrEmitter).l1w = function (endpoint) {
|
|
1671
726
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1672
727
|
var this_0 = importReferences(endpoint);
|
|
1673
728
|
var set = HashSet_init_$Create$();
|
|
1674
|
-
var list = ArrayList_init_$Create$();
|
|
729
|
+
var list = ArrayList_init_$Create$_0();
|
|
1675
730
|
var _iterator__ex2g4s = this_0.t();
|
|
1676
731
|
while (_iterator__ex2g4s.u()) {
|
|
1677
732
|
var e = _iterator__ex2g4s.v();
|
|
1678
|
-
var key = e.
|
|
733
|
+
var key = e.dv_1;
|
|
1679
734
|
if (set.x(key)) {
|
|
1680
735
|
list.x(e);
|
|
1681
736
|
}
|
|
1682
737
|
}
|
|
1683
738
|
// Inline function 'kotlin.collections.map' call
|
|
1684
739
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1685
|
-
var destination = ArrayList_init_$Create$
|
|
740
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(list, 10));
|
|
1686
741
|
var _iterator__ex2g4s_0 = list.t();
|
|
1687
742
|
while (_iterator__ex2g4s_0.u()) {
|
|
1688
743
|
var item = _iterator__ex2g4s_0.v();
|
|
1689
|
-
var tmp$ret$2 = import_0('..model.' + item.
|
|
744
|
+
var tmp$ret$2 = import_0('..model.' + item.dv_1, item.dv_1);
|
|
1690
745
|
destination.x(tmp$ret$2);
|
|
1691
746
|
}
|
|
1692
747
|
var modelImports = destination;
|
|
1693
|
-
var endpointImport = import_0('..endpoint.' + endpoint.
|
|
1694
|
-
var endpointName = endpoint.
|
|
748
|
+
var endpointImport = import_0('..endpoint.' + endpoint.eq_1.m1(), '*');
|
|
749
|
+
var endpointName = endpoint.eq_1.m1();
|
|
1695
750
|
var file = flattenEndpointTypeRefs(snakeCaseClientFunctions(addSelfReceiverToClientFields(sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this)))), endpointName);
|
|
1696
|
-
var subPackageName =
|
|
1697
|
-
return new File(Companion_getInstance().
|
|
751
|
+
var subPackageName = plus_1(this.b1y_1, 'client');
|
|
752
|
+
return new File(Companion_getInstance().x1g(subPackageName.es() + file.s1n_1.y1g()), plus(plus(plus(buildImports(this, '..wirespec'), modelImports), listOf_0(endpointImport)), file.t1n_1));
|
|
1698
753
|
};
|
|
1699
|
-
protoOf(PythonIrEmitter).
|
|
754
|
+
protoOf(PythonIrEmitter).i1w = function (endpoints, logger) {
|
|
1700
755
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1701
756
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1702
|
-
var destination = ArrayList_init_$Create$();
|
|
757
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1703
758
|
var _iterator__ex2g4s = endpoints.t();
|
|
1704
759
|
while (_iterator__ex2g4s.u()) {
|
|
1705
760
|
var element = _iterator__ex2g4s.v();
|
|
@@ -1708,53 +763,53 @@ protoOf(PythonIrEmitter).b1w = function (endpoints, logger) {
|
|
|
1708
763
|
}
|
|
1709
764
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1710
765
|
var set = HashSet_init_$Create$();
|
|
1711
|
-
var list_0 = ArrayList_init_$Create$();
|
|
766
|
+
var list_0 = ArrayList_init_$Create$_0();
|
|
1712
767
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1713
768
|
while (_iterator__ex2g4s_0.u()) {
|
|
1714
769
|
var e = _iterator__ex2g4s_0.v();
|
|
1715
|
-
var key = e.
|
|
770
|
+
var key = e.dv_1;
|
|
1716
771
|
if (set.x(key)) {
|
|
1717
772
|
list_0.x(e);
|
|
1718
773
|
}
|
|
1719
774
|
}
|
|
1720
775
|
// Inline function 'kotlin.collections.map' call
|
|
1721
776
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1722
|
-
var destination_0 = ArrayList_init_$Create$
|
|
777
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(list_0, 10));
|
|
1723
778
|
var _iterator__ex2g4s_1 = list_0.t();
|
|
1724
779
|
while (_iterator__ex2g4s_1.u()) {
|
|
1725
780
|
var item = _iterator__ex2g4s_1.v();
|
|
1726
|
-
var tmp$ret$5 = import_0('.model.' + item.
|
|
781
|
+
var tmp$ret$5 = import_0('.model.' + item.dv_1, item.dv_1);
|
|
1727
782
|
destination_0.x(tmp$ret$5);
|
|
1728
783
|
}
|
|
1729
784
|
var modelImports = destination_0;
|
|
1730
785
|
// Inline function 'kotlin.collections.map' call
|
|
1731
786
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1732
|
-
var destination_1 = ArrayList_init_$Create$
|
|
787
|
+
var destination_1 = ArrayList_init_$Create$(collectionSizeOrDefault(endpoints, 10));
|
|
1733
788
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1734
789
|
while (_iterator__ex2g4s_2.u()) {
|
|
1735
790
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
1736
|
-
var tmp$ret$8 = import_0('.endpoint.' + item_0.
|
|
791
|
+
var tmp$ret$8 = import_0('.endpoint.' + item_0.eq_1.m1(), '*');
|
|
1737
792
|
destination_1.x(tmp$ret$8);
|
|
1738
793
|
}
|
|
1739
794
|
var endpointImports = destination_1;
|
|
1740
795
|
// Inline function 'kotlin.collections.map' call
|
|
1741
796
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1742
|
-
var destination_2 = ArrayList_init_$Create$
|
|
797
|
+
var destination_2 = ArrayList_init_$Create$(collectionSizeOrDefault(endpoints, 10));
|
|
1743
798
|
var _iterator__ex2g4s_3 = endpoints.t();
|
|
1744
799
|
while (_iterator__ex2g4s_3.u()) {
|
|
1745
800
|
var item_1 = _iterator__ex2g4s_3.v();
|
|
1746
|
-
var tmp$ret$11 = import_0('.client.' + item_1.
|
|
801
|
+
var tmp$ret$11 = import_0('.client.' + item_1.eq_1.m1() + 'Client', item_1.eq_1.m1() + 'Client');
|
|
1747
802
|
destination_2.x(tmp$ret$11);
|
|
1748
803
|
}
|
|
1749
804
|
var clientImports = destination_2;
|
|
1750
805
|
var allImports = plus(plus(modelImports, endpointImports), clientImports);
|
|
1751
806
|
// Inline function 'kotlin.collections.map' call
|
|
1752
807
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1753
|
-
var destination_3 = ArrayList_init_$Create$
|
|
808
|
+
var destination_3 = ArrayList_init_$Create$(collectionSizeOrDefault(endpoints, 10));
|
|
1754
809
|
var _iterator__ex2g4s_4 = endpoints.t();
|
|
1755
810
|
while (_iterator__ex2g4s_4.u()) {
|
|
1756
811
|
var item_2 = _iterator__ex2g4s_4.v();
|
|
1757
|
-
var tmp$ret$14 = item_2.
|
|
812
|
+
var tmp$ret$14 = item_2.eq_1.m1();
|
|
1758
813
|
destination_3.x(tmp$ret$14);
|
|
1759
814
|
}
|
|
1760
815
|
var endpointNames = destination_3;
|
|
@@ -1768,7 +823,7 @@ protoOf(PythonIrEmitter).b1w = function (endpoints, logger) {
|
|
|
1768
823
|
accumulator = flattenEndpointTypeRefs(acc, element_0);
|
|
1769
824
|
}
|
|
1770
825
|
var file = accumulator;
|
|
1771
|
-
return new File(Companion_getInstance().
|
|
826
|
+
return new File(Companion_getInstance().x1g(this.b1y_1.es() + file.s1n_1.y1g()), plus(plus(buildImports(this, '.wirespec'), allImports), file.t1n_1));
|
|
1772
827
|
};
|
|
1773
828
|
function replaceReflectInNonGenericStructFields(_this__u8e3s4) {
|
|
1774
829
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
@@ -1776,14 +831,14 @@ function replaceReflectInNonGenericStructFields(_this__u8e3s4) {
|
|
|
1776
831
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1777
832
|
var tmp = scope;
|
|
1778
833
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1779
|
-
var this_0 = scope.
|
|
834
|
+
var this_0 = scope.q1v_1;
|
|
1780
835
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1781
836
|
// Inline function 'kotlin.apply' call
|
|
1782
837
|
var this_1 = new TransformerBuilder();
|
|
1783
|
-
this_1.
|
|
1784
|
-
var tmp$ret$2 = this_1.
|
|
1785
|
-
tmp.
|
|
1786
|
-
var tmp_0 = scope.
|
|
838
|
+
this_1.k1i(replaceReflectInNonGenericStructFields$lambda);
|
|
839
|
+
var tmp$ret$2 = this_1.l1i();
|
|
840
|
+
tmp.q1v_1 = transform(this_0, tmp$ret$2);
|
|
841
|
+
var tmp_0 = scope.q1v_1;
|
|
1787
842
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1788
843
|
}
|
|
1789
844
|
function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
@@ -1792,14 +847,14 @@ function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
|
1792
847
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1793
848
|
var tmp = scope;
|
|
1794
849
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1795
|
-
var this_0 = scope.
|
|
850
|
+
var this_0 = scope.q1v_1;
|
|
1796
851
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1797
852
|
// Inline function 'kotlin.apply' call
|
|
1798
853
|
var this_1 = new TransformerBuilder();
|
|
1799
|
-
this_1.
|
|
1800
|
-
var tmp$ret$2 = this_1.
|
|
1801
|
-
tmp.
|
|
1802
|
-
var tmp_0 = scope.
|
|
854
|
+
this_1.k1i(replaceRefinedFunctions$lambda(refined));
|
|
855
|
+
var tmp$ret$2 = this_1.l1i();
|
|
856
|
+
tmp.q1v_1 = transform(this_0, tmp$ret$2);
|
|
857
|
+
var tmp_0 = scope.q1v_1;
|
|
1803
858
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1804
859
|
}
|
|
1805
860
|
function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
@@ -1808,22 +863,22 @@ function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
|
1808
863
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1809
864
|
var tmp = scope;
|
|
1810
865
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1811
|
-
var this_0 = scope.
|
|
866
|
+
var this_0 = scope.q1v_1;
|
|
1812
867
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1813
868
|
// Inline function 'kotlin.apply' call
|
|
1814
869
|
var this_1 = new TransformerBuilder();
|
|
1815
|
-
this_1.
|
|
1816
|
-
var tmp$ret$2 = this_1.
|
|
1817
|
-
tmp.
|
|
1818
|
-
var tmp_0 = scope.
|
|
870
|
+
this_1.k1i(snakeCaseHandlerAndCallMethods$lambda);
|
|
871
|
+
var tmp$ret$2 = this_1.l1i();
|
|
872
|
+
tmp.q1v_1 = transform(this_0, tmp$ret$2);
|
|
873
|
+
var tmp_0 = scope.q1v_1;
|
|
1819
874
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1820
875
|
}
|
|
1821
876
|
function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
1822
877
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1823
878
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1824
|
-
var tmp0 = _this__u8e3s4.
|
|
879
|
+
var tmp0 = _this__u8e3s4.u1n();
|
|
1825
880
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1826
|
-
var destination = ArrayList_init_$Create$();
|
|
881
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1827
882
|
var _iterator__ex2g4s = tmp0.t();
|
|
1828
883
|
while (_iterator__ex2g4s.u()) {
|
|
1829
884
|
var element = _iterator__ex2g4s.v();
|
|
@@ -1834,9 +889,9 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1834
889
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1835
890
|
var namespace = ensureNotNull(tmp$ret$2);
|
|
1836
891
|
// Inline function 'kotlin.collections.partition' call
|
|
1837
|
-
var this_0 = namespace.
|
|
1838
|
-
var first = ArrayList_init_$Create$();
|
|
1839
|
-
var second = ArrayList_init_$Create$();
|
|
892
|
+
var this_0 = namespace.z1n_1;
|
|
893
|
+
var first = ArrayList_init_$Create$_0();
|
|
894
|
+
var second = ArrayList_init_$Create$_0();
|
|
1840
895
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
1841
896
|
while (_iterator__ex2g4s_0.u()) {
|
|
1842
897
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
@@ -1853,16 +908,16 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1853
908
|
}
|
|
1854
909
|
}
|
|
1855
910
|
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.
|
|
911
|
+
var moduleElements = _destruct__k2r9zo.we();
|
|
912
|
+
var classElements = _destruct__k2r9zo.xe();
|
|
913
|
+
var endpointClass = new Namespace(namespace.y1n_1, classElements, namespace.a1o_1);
|
|
914
|
+
return new File(namespace.y1n_1, plus_0(moduleElements, endpointClass));
|
|
1860
915
|
}
|
|
1861
916
|
function flattenEndpointTypeRefs(_this__u8e3s4, endpointName) {
|
|
1862
917
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1863
918
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1864
|
-
scope.
|
|
1865
|
-
var tmp = scope.
|
|
919
|
+
scope.w1v(flattenEndpointTypeRefs$lambda(endpointName));
|
|
920
|
+
var tmp = scope.q1v_1;
|
|
1866
921
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1867
922
|
}
|
|
1868
923
|
function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
@@ -1871,15 +926,15 @@ function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
|
1871
926
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1872
927
|
var tmp = scope;
|
|
1873
928
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1874
|
-
var this_0 = scope.
|
|
929
|
+
var this_0 = scope.q1v_1;
|
|
1875
930
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1876
931
|
// Inline function 'kotlin.apply' call
|
|
1877
932
|
var this_1 = new TransformerBuilder();
|
|
1878
|
-
this_1.
|
|
1879
|
-
var tmp$ret$2 = this_1.
|
|
1880
|
-
tmp.
|
|
1881
|
-
scope.
|
|
1882
|
-
var tmp_0 = scope.
|
|
933
|
+
this_1.k1i(snakeCaseClientFunctions$lambda);
|
|
934
|
+
var tmp$ret$2 = this_1.l1i();
|
|
935
|
+
tmp.q1v_1 = transform(this_0, tmp$ret$2);
|
|
936
|
+
scope.z1v(snakeCaseClientFunctions$lambda_0);
|
|
937
|
+
var tmp_0 = scope.q1v_1;
|
|
1883
938
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1884
939
|
}
|
|
1885
940
|
function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
@@ -1890,9 +945,9 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1890
945
|
} else {
|
|
1891
946
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1892
947
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1893
|
-
var tmp0 = tmp0_safe_receiver.
|
|
948
|
+
var tmp0 = tmp0_safe_receiver.u1n();
|
|
1894
949
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1895
|
-
var destination = ArrayList_init_$Create$();
|
|
950
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1896
951
|
var _iterator__ex2g4s = tmp0.t();
|
|
1897
952
|
while (_iterator__ex2g4s.u()) {
|
|
1898
953
|
var element = _iterator__ex2g4s.v();
|
|
@@ -1910,11 +965,11 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1910
965
|
} else {
|
|
1911
966
|
// Inline function 'kotlin.collections.map' call
|
|
1912
967
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1913
|
-
var destination_0 = ArrayList_init_$Create$
|
|
968
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(tmp2_safe_receiver, 10));
|
|
1914
969
|
var _iterator__ex2g4s_0 = tmp2_safe_receiver.t();
|
|
1915
970
|
while (_iterator__ex2g4s_0.u()) {
|
|
1916
971
|
var item = _iterator__ex2g4s_0.v();
|
|
1917
|
-
var tmp$ret$3 = item.
|
|
972
|
+
var tmp$ret$3 = item.n1o_1.w1i();
|
|
1918
973
|
destination_0.x(tmp$ret$3);
|
|
1919
974
|
}
|
|
1920
975
|
tmp_0 = destination_0;
|
|
@@ -1926,8 +981,8 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1926
981
|
return _this__u8e3s4;
|
|
1927
982
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1928
983
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1929
|
-
scope.
|
|
1930
|
-
var tmp_1 = scope.
|
|
984
|
+
scope.z1v(addSelfReceiverToClientFields$lambda(fieldNames));
|
|
985
|
+
var tmp_1 = scope.q1v_1;
|
|
1931
986
|
return isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1932
987
|
}
|
|
1933
988
|
function replaceReflectAsTypeAny(_this__u8e3s4) {
|
|
@@ -1936,13 +991,13 @@ function replaceReflectAsTypeAny(_this__u8e3s4) {
|
|
|
1936
991
|
tmp = Custom_init_$Create$('type', listOf_0(Any_instance));
|
|
1937
992
|
} else {
|
|
1938
993
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
1939
|
-
tmp = _this__u8e3s4.
|
|
994
|
+
tmp = _this__u8e3s4.a1n(replaceReflectAsTypeAny(_this__u8e3s4.s1i_1));
|
|
1940
995
|
} else {
|
|
1941
996
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
1942
|
-
tmp = _this__u8e3s4.
|
|
997
|
+
tmp = _this__u8e3s4.a1n(replaceReflectAsTypeAny(_this__u8e3s4.t1i_1));
|
|
1943
998
|
} else {
|
|
1944
|
-
if (_this__u8e3s4 instanceof
|
|
1945
|
-
tmp = _this__u8e3s4.
|
|
999
|
+
if (_this__u8e3s4 instanceof Dict) {
|
|
1000
|
+
tmp = _this__u8e3s4.d1n(replaceReflectAsTypeAny(_this__u8e3s4.b1n_1), replaceReflectAsTypeAny(_this__u8e3s4.c1n_1));
|
|
1946
1001
|
} else {
|
|
1947
1002
|
tmp = _this__u8e3s4;
|
|
1948
1003
|
}
|
|
@@ -1957,27 +1012,27 @@ function replaceReflectInNonGenericStructFields$lambda(element, transformer) {
|
|
|
1957
1012
|
var tmp$ret$1;
|
|
1958
1013
|
$l$block: {
|
|
1959
1014
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1960
|
-
if (!element.
|
|
1015
|
+
if (!element.x1p_1.r()) {
|
|
1961
1016
|
tmp$ret$1 = element;
|
|
1962
1017
|
break $l$block;
|
|
1963
1018
|
}
|
|
1964
1019
|
// Inline function 'kotlin.collections.map' call
|
|
1965
|
-
var this_0 = element.
|
|
1020
|
+
var this_0 = element.t1p_1;
|
|
1966
1021
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1967
|
-
var destination = ArrayList_init_$Create$
|
|
1022
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1968
1023
|
var _iterator__ex2g4s = this_0.t();
|
|
1969
1024
|
while (_iterator__ex2g4s.u()) {
|
|
1970
1025
|
var item = _iterator__ex2g4s.v();
|
|
1971
1026
|
var tmp_0;
|
|
1972
1027
|
if (item instanceof Field) {
|
|
1973
|
-
tmp_0 = item.
|
|
1028
|
+
tmp_0 = item.x1o(VOID, replaceReflectAsTypeAny(item.o1o_1));
|
|
1974
1029
|
} else {
|
|
1975
1030
|
tmp_0 = item;
|
|
1976
1031
|
}
|
|
1977
1032
|
var tmp$ret$2 = tmp_0;
|
|
1978
1033
|
destination.x(tmp$ret$2);
|
|
1979
1034
|
}
|
|
1980
|
-
tmp$ret$1 = element.
|
|
1035
|
+
tmp$ret$1 = element.d1q(VOID, destination);
|
|
1981
1036
|
}
|
|
1982
1037
|
tmp = tmp$ret$1;
|
|
1983
1038
|
} else {
|
|
@@ -1988,17 +1043,17 @@ function replaceReflectInNonGenericStructFields$lambda(element, transformer) {
|
|
|
1988
1043
|
}
|
|
1989
1044
|
function replaceRefinedFunctions$lambda$lambda($constraintExpr) {
|
|
1990
1045
|
return function ($this$function) {
|
|
1991
|
-
$this$function.
|
|
1992
|
-
$this$function.
|
|
1993
|
-
$this$function.
|
|
1046
|
+
$this$function.l1h('self', Custom_init_$Create$(''));
|
|
1047
|
+
$this$function.o1h(Boolean_instance);
|
|
1048
|
+
$this$function.p1h($constraintExpr);
|
|
1994
1049
|
return Unit_instance;
|
|
1995
1050
|
};
|
|
1996
1051
|
}
|
|
1997
1052
|
function replaceRefinedFunctions$lambda$lambda_0($toStringExpr) {
|
|
1998
1053
|
return function ($this$function) {
|
|
1999
|
-
$this$function.
|
|
2000
|
-
$this$function.
|
|
2001
|
-
$this$function.
|
|
1054
|
+
$this$function.l1h('self', Custom_init_$Create$(''));
|
|
1055
|
+
$this$function.o1h(String_instance);
|
|
1056
|
+
$this$function.p1h(new RawExpression($toStringExpr));
|
|
2002
1057
|
return Unit_instance;
|
|
2003
1058
|
};
|
|
2004
1059
|
}
|
|
@@ -2006,34 +1061,33 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
2006
1061
|
return function (element, transformer) {
|
|
2007
1062
|
var tmp;
|
|
2008
1063
|
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();
|
|
1064
|
+
// Inline function 'kotlin.collections.map' call
|
|
1065
|
+
var this_0 = element.w1p_1;
|
|
1066
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1067
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1068
|
+
var _iterator__ex2g4s = this_0.t();
|
|
2015
1069
|
while (_iterator__ex2g4s.u()) {
|
|
2016
|
-
var
|
|
1070
|
+
var item = _iterator__ex2g4s.v();
|
|
2017
1071
|
var tmp_0;
|
|
2018
1072
|
var tmp_1;
|
|
2019
|
-
if (
|
|
2020
|
-
tmp_1 =
|
|
1073
|
+
if (item instanceof Function) {
|
|
1074
|
+
tmp_1 = item.u1k_1.equals(Companion_getInstance().x1g('validate'));
|
|
2021
1075
|
} else {
|
|
2022
1076
|
tmp_1 = false;
|
|
2023
1077
|
}
|
|
2024
1078
|
if (tmp_1) {
|
|
2025
|
-
var constraintExpr = convertConstraint($refined.
|
|
1079
|
+
var constraintExpr = convertConstraint($refined.nr_1, new FieldCall(new VariableReference(Companion_getInstance().x1g('self')), Companion_getInstance().x1g('value')));
|
|
2026
1080
|
tmp_0 = function_0('validate', VOID, VOID, replaceRefinedFunctions$lambda$lambda(constraintExpr));
|
|
2027
1081
|
} else {
|
|
2028
1082
|
var tmp_2;
|
|
2029
|
-
if (
|
|
2030
|
-
tmp_2 =
|
|
1083
|
+
if (item instanceof Function) {
|
|
1084
|
+
tmp_2 = item.u1k_1.equals(Companion_getInstance().x1g('toString'));
|
|
2031
1085
|
} else {
|
|
2032
1086
|
tmp_2 = false;
|
|
2033
1087
|
}
|
|
2034
1088
|
if (tmp_2) {
|
|
2035
1089
|
var tmp_3;
|
|
2036
|
-
if ($refined.
|
|
1090
|
+
if ($refined.nr_1.ot_1 instanceof String_0) {
|
|
2037
1091
|
tmp_3 = 'self.value';
|
|
2038
1092
|
} else {
|
|
2039
1093
|
tmp_3 = 'str(self.value)';
|
|
@@ -2041,18 +1095,13 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
2041
1095
|
var toStringExpr = tmp_3;
|
|
2042
1096
|
tmp_0 = function_0('__str__', VOID, VOID, replaceRefinedFunctions$lambda$lambda_0(toStringExpr));
|
|
2043
1097
|
} else {
|
|
2044
|
-
tmp_0 =
|
|
1098
|
+
tmp_0 = item;
|
|
2045
1099
|
}
|
|
2046
1100
|
}
|
|
2047
|
-
var
|
|
2048
|
-
|
|
2049
|
-
null;
|
|
2050
|
-
else {
|
|
2051
|
-
// Inline function 'kotlin.let' call
|
|
2052
|
-
destination.x(tmp0_safe_receiver);
|
|
2053
|
-
}
|
|
1101
|
+
var tmp$ret$0 = tmp_0;
|
|
1102
|
+
destination.x(tmp$ret$0);
|
|
2054
1103
|
}
|
|
2055
|
-
tmp = element.
|
|
1104
|
+
tmp = element.d1q(VOID, VOID, VOID, VOID, destination);
|
|
2056
1105
|
} else {
|
|
2057
1106
|
tmp = element;
|
|
2058
1107
|
}
|
|
@@ -2065,23 +1114,23 @@ function snakeCaseHandlerAndCallMethods$lambda(element, transformer) {
|
|
|
2065
1114
|
if (element instanceof Interface) {
|
|
2066
1115
|
var tmp$ret$0;
|
|
2067
1116
|
$l$block: {
|
|
2068
|
-
if (!element.
|
|
1117
|
+
if (!element.e1o_1.equals(Companion_getInstance().x1g('Handler')) && !element.e1o_1.equals(Companion_getInstance().x1g('Call'))) {
|
|
2069
1118
|
tmp$ret$0 = element;
|
|
2070
1119
|
break $l$block;
|
|
2071
1120
|
}
|
|
2072
1121
|
// Inline function 'kotlin.collections.map' call
|
|
2073
|
-
var this_0 = element.
|
|
1122
|
+
var this_0 = element.f1o_1;
|
|
2074
1123
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2075
|
-
var destination = ArrayList_init_$Create$
|
|
1124
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2076
1125
|
var _iterator__ex2g4s = this_0.t();
|
|
2077
1126
|
while (_iterator__ex2g4s.u()) {
|
|
2078
1127
|
var item = _iterator__ex2g4s.v();
|
|
2079
1128
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
2080
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1129
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.f1l(Companion_getInstance().x1g(item.u1k_1.p1m()));
|
|
2081
1130
|
var tmp$ret$1 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
2082
1131
|
destination.x(tmp$ret$1);
|
|
2083
1132
|
}
|
|
2084
|
-
tmp$ret$0 = element.
|
|
1133
|
+
tmp$ret$0 = element.m1o(VOID, destination);
|
|
2085
1134
|
}
|
|
2086
1135
|
tmp = tmp$ret$0;
|
|
2087
1136
|
} else {
|
|
@@ -2093,20 +1142,20 @@ function snakeCaseHandlerAndCallMethods$lambda(element, transformer) {
|
|
|
2093
1142
|
function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
2094
1143
|
return function (type, _unused_var__etf5q3) {
|
|
2095
1144
|
var tmp;
|
|
2096
|
-
if (!(type instanceof
|
|
1145
|
+
if (!(type instanceof Custom)) {
|
|
2097
1146
|
tmp = type;
|
|
2098
1147
|
} else {
|
|
2099
|
-
if (!startsWith(type.
|
|
1148
|
+
if (!startsWith(type.u1i_1.y1g(), $endpointName + '.')) {
|
|
2100
1149
|
tmp = type;
|
|
2101
1150
|
} else {
|
|
2102
|
-
var suffix = removePrefix(type.
|
|
1151
|
+
var suffix = removePrefix(type.u1i_1.y1g(), $endpointName + '.');
|
|
2103
1152
|
switch (suffix) {
|
|
2104
1153
|
case 'Call':
|
|
2105
1154
|
case 'Handler':
|
|
2106
1155
|
tmp = type;
|
|
2107
1156
|
break;
|
|
2108
1157
|
default:
|
|
2109
|
-
tmp = type.
|
|
1158
|
+
tmp = type.f1n(Companion_getInstance().x1g(suffix));
|
|
2110
1159
|
break;
|
|
2111
1160
|
}
|
|
2112
1161
|
}
|
|
@@ -2117,7 +1166,7 @@ function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
|
2117
1166
|
function snakeCaseClientFunctions$lambda(element, transformer) {
|
|
2118
1167
|
var tmp;
|
|
2119
1168
|
if (element instanceof Function) {
|
|
2120
|
-
tmp = element.
|
|
1169
|
+
tmp = element.f1l(Companion_getInstance().x1g(element.u1k_1.p1m()), VOID, plus(listOf_0(new Parameter(Companion_getInstance().x1g('self'), Custom_init_$Create$(''))), element.w1k_1));
|
|
2121
1170
|
} else {
|
|
2122
1171
|
tmp = element;
|
|
2123
1172
|
}
|
|
@@ -2127,32 +1176,32 @@ function snakeCaseClientFunctions$lambda(element, transformer) {
|
|
|
2127
1176
|
function snakeCaseClientFunctions$lambda_0(stmt, tr) {
|
|
2128
1177
|
var tmp;
|
|
2129
1178
|
if (stmt instanceof FunctionCall) {
|
|
2130
|
-
var nameStr = stmt.
|
|
2131
|
-
var newName = contains(nameStr, '.') ? stmt.
|
|
2132
|
-
var tmp1_safe_receiver = stmt.
|
|
1179
|
+
var nameStr = stmt.t1m_1.w1i();
|
|
1180
|
+
var newName = contains(nameStr, '.') ? stmt.t1m_1 : Companion_getInstance().x1g(Companion_getInstance().x1g(nameStr).p1m());
|
|
1181
|
+
var tmp1_safe_receiver = stmt.r1m_1;
|
|
2133
1182
|
var tmp_0;
|
|
2134
1183
|
if (tmp1_safe_receiver == null) {
|
|
2135
1184
|
tmp_0 = null;
|
|
2136
1185
|
} else {
|
|
2137
1186
|
// Inline function 'kotlin.let' call
|
|
2138
|
-
tmp_0 = tr.
|
|
1187
|
+
tmp_0 = tr.l1v(tmp1_safe_receiver);
|
|
2139
1188
|
}
|
|
2140
1189
|
var tmp2_receiver = tmp_0;
|
|
2141
1190
|
// Inline function 'kotlin.collections.mapValues' call
|
|
2142
|
-
var this_0 = stmt.
|
|
1191
|
+
var this_0 = stmt.u1m_1;
|
|
2143
1192
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
2144
|
-
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.
|
|
1193
|
+
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.b1()));
|
|
2145
1194
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
2146
|
-
var _iterator__ex2g4s = this_0.
|
|
1195
|
+
var _iterator__ex2g4s = this_0.k1().t();
|
|
2147
1196
|
while (_iterator__ex2g4s.u()) {
|
|
2148
1197
|
var element = _iterator__ex2g4s.v();
|
|
2149
|
-
var tmp_1 = element.
|
|
1198
|
+
var tmp_1 = element.l1();
|
|
2150
1199
|
// Inline function 'kotlin.collections.component2' call
|
|
2151
|
-
var v = element.
|
|
2152
|
-
var tmp$ret$4 = tr.
|
|
2153
|
-
destination.
|
|
1200
|
+
var v = element.m1();
|
|
1201
|
+
var tmp$ret$4 = tr.l1v(v);
|
|
1202
|
+
destination.t2(tmp_1, tmp$ret$4);
|
|
2154
1203
|
}
|
|
2155
|
-
var tmp4_isAwait = !(stmt.
|
|
1204
|
+
var tmp4_isAwait = !(stmt.r1m_1 == null);
|
|
2156
1205
|
tmp = new FunctionCall(tmp2_receiver, VOID, newName, destination, tmp4_isAwait);
|
|
2157
1206
|
} else {
|
|
2158
1207
|
tmp = transformChildren(stmt, tr);
|
|
@@ -2163,30 +1212,24 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
2163
1212
|
return function (stmt, tr) {
|
|
2164
1213
|
var tmp;
|
|
2165
1214
|
var tmp_0;
|
|
2166
|
-
var tmp_1;
|
|
2167
1215
|
if (stmt instanceof FieldCall) {
|
|
2168
|
-
|
|
2169
|
-
} else {
|
|
2170
|
-
tmp_1 = false;
|
|
2171
|
-
}
|
|
2172
|
-
if (tmp_1) {
|
|
2173
|
-
tmp_0 = $fieldNames.u1(stmt.t1q_1.o1j());
|
|
1216
|
+
tmp_0 = (stmt.e1r_1 == null && $fieldNames.v1(stmt.f1r_1.w1i()));
|
|
2174
1217
|
} else {
|
|
2175
1218
|
tmp_0 = false;
|
|
2176
1219
|
}
|
|
2177
1220
|
if (tmp_0) {
|
|
2178
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().
|
|
1221
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().x1g('self')), stmt.f1r_1);
|
|
2179
1222
|
} else {
|
|
2180
1223
|
if (stmt instanceof FieldCall) {
|
|
2181
|
-
var
|
|
2182
|
-
var
|
|
2183
|
-
if (
|
|
2184
|
-
|
|
1224
|
+
var tmp1_safe_receiver = stmt.e1r_1;
|
|
1225
|
+
var tmp_1;
|
|
1226
|
+
if (tmp1_safe_receiver == null) {
|
|
1227
|
+
tmp_1 = null;
|
|
2185
1228
|
} else {
|
|
2186
1229
|
// Inline function 'kotlin.let' call
|
|
2187
|
-
|
|
1230
|
+
tmp_1 = tr.l1v(tmp1_safe_receiver);
|
|
2188
1231
|
}
|
|
2189
|
-
tmp = new FieldCall(
|
|
1232
|
+
tmp = new FieldCall(tmp_1, stmt.f1r_1);
|
|
2190
1233
|
} else {
|
|
2191
1234
|
tmp = transformChildren(stmt, tr);
|
|
2192
1235
|
}
|
|
@@ -2194,78 +1237,13 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
2194
1237
|
return tmp;
|
|
2195
1238
|
};
|
|
2196
1239
|
}
|
|
2197
|
-
function PythonRefinedTypeDefinitionEmitter() {
|
|
2198
|
-
}
|
|
2199
|
-
function PythonShared() {
|
|
2200
|
-
this.b1z_1 = 'shared';
|
|
2201
|
-
this.c1z_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.g1z(it);
|
|
2223
|
-
};
|
|
2224
|
-
}
|
|
2225
|
-
function PythonTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2226
|
-
return function (it) {
|
|
2227
|
-
return this$0.g1z(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
1240
|
//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_13;
|
|
2246
|
-
protoOf(PythonEmitter).vr = emit_15;
|
|
2247
|
-
protoOf(PythonEmitter).bs = emit_10;
|
|
2248
|
-
protoOf(PythonEmitter).qr = emit_14;
|
|
2249
|
-
protoOf(PythonEmitter).or = emit_3;
|
|
2250
|
-
protoOf(PythonEmitter).pr = emit_2;
|
|
2251
|
-
protoOf(PythonEmitter).d1z = emit_8;
|
|
2252
|
-
protoOf(PythonEmitter).k1x = emit_11;
|
|
2253
|
-
protoOf(PythonEmitter).e1z = emit_12;
|
|
2254
|
-
protoOf(PythonEmitter).cs = emitValidator;
|
|
2255
|
-
protoOf(PythonEmitter).x1x = sanitize;
|
|
2256
|
-
protoOf(PythonEmitter).n1x = sanitizeKeywords;
|
|
2257
|
-
protoOf(PythonEmitter).f1z = emitType;
|
|
2258
|
-
protoOf(PythonEmitter).g1z = emitReferenceCustomImports;
|
|
2259
|
-
protoOf(PythonIrEmitter).y1v = get_extensions;
|
|
2260
|
-
protoOf(PythonIrEmitter).eo = emit_1;
|
|
2261
|
-
protoOf(PythonIrEmitter).d1w = beforeGenerate;
|
|
2262
|
-
//endregion
|
|
2263
|
-
//region block: init
|
|
2264
|
-
PythonShared_instance = new PythonShared();
|
|
1241
|
+
protoOf(PythonIrEmitter).f1w = get_extensions;
|
|
1242
|
+
protoOf(PythonIrEmitter).no = emit_1;
|
|
1243
|
+
protoOf(PythonIrEmitter).k1w = beforeGenerate;
|
|
2265
1244
|
//endregion
|
|
2266
1245
|
//region block: exports
|
|
2267
1246
|
export {
|
|
2268
|
-
PythonEmitter as PythonEmitter2pjclp0u1gkmn,
|
|
2269
1247
|
PythonIrEmitter as PythonIrEmittergogj1wcisct7,
|
|
2270
1248
|
};
|
|
2271
1249
|
//endregion
|