@flock/wirespec 0.18.5 → 0.19.0-RC.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/Kotlin-DateTime-library-kotlinx-datetime.mjs +4 -0
- package/Kotlin-DateTime-library-kotlinx-datetime.mjs.map +1 -0
- 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 +1574 -1574
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +444 -444
- package/kotest-kotest-assertions-kotest-assertions-core.mjs +4 -0
- package/kotest-kotest-assertions-kotest-assertions-core.mjs.map +1 -0
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs +4 -0
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs.map +1 -0
- package/kotest-kotest-common.mjs +56 -0
- package/kotest-kotest-common.mjs.map +1 -0
- package/kotest-kotest-framework-kotest-framework-engine.mjs +4 -0
- package/kotest-kotest-framework-kotest-framework-engine.mjs.map +1 -0
- package/kotest-kotest-property-kotest-property-datetime.mjs +4 -0
- package/kotest-kotest-property-kotest-property-datetime.mjs.map +1 -0
- package/kotest-kotest-property.mjs +3230 -0
- package/kotest-kotest-property.mjs.map +1 -0
- package/kotest-property-arbs.mjs +482 -0
- package/kotest-property-arbs.mjs.map +1 -0
- package/kotlin-kotlin-stdlib.mjs +5618 -2436
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +4931 -4931
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1819 -1819
- package/kotlinx-coroutines-test.mjs +4 -0
- package/kotlinx-coroutines-test.mjs.map +1 -0
- package/kotlinx-io-kotlinx-io-core.mjs +453 -453
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +2017 -1983
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1395 -1395
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1364 -1364
- package/package.json +9 -2
- package/wirespec-generator.d.ts +52 -0
- package/wirespec-generator.mjs +9 -0
- package/wirespec-src-compiler-core.mjs +1542 -1541
- package/wirespec-src-compiler-emitters-java.mjs +476 -413
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +359 -296
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +560 -362
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +754 -443
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +243 -164
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +709 -420
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +82 -82
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +6676 -4858
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +418 -418
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +512 -512
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +772 -772
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-integration-kotest.mjs +1537 -0
- package/wirespec-src-integration-kotest.mjs.map +1 -0
- package/wirespec-src-plugin-arguments.mjs +185 -185
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +106 -106
- package/wirespec-src-plugin-npm.d.mts +11 -0
- package/wirespec-src-plugin-npm.mjs +41 -41
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +53 -53
- package/wirespec-src-tools-generator.mjs.map +1 -1
- package/xmlutil-core.mjs +4 -0
- package/xmlutil-core.mjs.map +1 -0
- package/xmlutil-serialization.mjs +4 -0
- package/xmlutil-serialization.mjs.map +1 -0
|
@@ -46,14 +46,23 @@ import {
|
|
|
46
46
|
listOfvhqybd2zx248 as listOf_0,
|
|
47
47
|
to2cs3ny02qtbcb as to,
|
|
48
48
|
toMap1vec9topfei08 as toMap,
|
|
49
|
+
substringBefore3n7kj60w69hju as substringBefore,
|
|
50
|
+
endsWith3cq61xxngobwh as endsWith,
|
|
49
51
|
lazy2hsh8ze7j6ikd as lazy,
|
|
50
52
|
Collection1k04j3hzsbod0 as Collection,
|
|
51
53
|
emptyList1g2z5xcrvp2zy as emptyList,
|
|
52
54
|
dropLast1vpiyky649o34 as dropLast,
|
|
53
55
|
drop3na99dw9feawf as drop,
|
|
56
|
+
asSequence2phdjljfh9jhx as asSequence,
|
|
57
|
+
filterNot56uwv8hfomaa as filterNot,
|
|
58
|
+
mapsbvh18eqox7a as map,
|
|
59
|
+
distinct17vua5ffe1cfv as distinct,
|
|
60
|
+
toListx6x8nvfmvvht as toList,
|
|
61
|
+
LinkedHashSet_init_$Create$2lru2gvxodydo as LinkedHashSet_init_$Create$,
|
|
62
|
+
plus310ted5e4i90h as plus,
|
|
63
|
+
distinct10qe1scfdvu5k as distinct_0,
|
|
54
64
|
HashSet_init_$Create$33p49hmosnvr4 as HashSet_init_$Create$,
|
|
55
65
|
toSet2orjxp16sotqu as toSet,
|
|
56
|
-
plus310ted5e4i90h as plus,
|
|
57
66
|
addAll1k27qatfgp3k5 as addAll,
|
|
58
67
|
firstOrNull1982767dljvdy as firstOrNull_0,
|
|
59
68
|
Paire9pteg33gng7 as Pair,
|
|
@@ -129,6 +138,8 @@ import {
|
|
|
129
138
|
ConstructorStatement1x4n4sr59iy4n as ConstructorStatement,
|
|
130
139
|
SanitizationConfig11mmn3p2c03c1 as SanitizationConfig,
|
|
131
140
|
sortKey2uc13shubz5xy as sortKey,
|
|
141
|
+
RawExpression2bo7ldfrptjia as RawExpression,
|
|
142
|
+
transformChildren3n5cjwmxlhwx9 as transformChildren_0,
|
|
132
143
|
PythonGenerator_instance3bpw212sztsap as PythonGenerator_instance,
|
|
133
144
|
convertnty9x0e63d0u as convert,
|
|
134
145
|
Companion_getInstance3gvtuyxc9uhxj as Companion_getInstance,
|
|
@@ -138,9 +149,17 @@ import {
|
|
|
138
149
|
emitn3eihixilqyh as emit_0,
|
|
139
150
|
prependImports32gcj3yb8voha as prependImports,
|
|
140
151
|
placeInModule10pilwex0h8tn as placeInModule,
|
|
152
|
+
convertToGenerator2wzjrmaavxhph as convertToGenerator,
|
|
153
|
+
convertToGeneratorkggw47cqose7 as convertToGenerator_0,
|
|
154
|
+
convertToGenerator3rjr3azp4vdsx as convertToGenerator_1,
|
|
155
|
+
convertToGenerator2msmr3acdd5nx as convertToGenerator_2,
|
|
156
|
+
sanitizeNames2wqmyf8vafp9x as sanitizeNames,
|
|
157
|
+
collectCustomTypeNames373f3lwl9sqd5 as collectCustomTypeNames,
|
|
158
|
+
TransformScopeyrd3lf4zrk76 as TransformScope,
|
|
159
|
+
Elementitq62jg6fid3 as Element,
|
|
160
|
+
placeInModuleewt2r4ic2m6a as placeInModule_0,
|
|
141
161
|
convertWithValidation3ar3nbcqsbkpn as convertWithValidation,
|
|
142
162
|
injectSelfReceiverToValidate4xgr9r5gl5n3 as injectSelfReceiverToValidate,
|
|
143
|
-
sanitizeNames2wqmyf8vafp9x as sanitizeNames,
|
|
144
163
|
convert11ert2po54h1y as convert_0,
|
|
145
164
|
sanitizeEnumEntries3pphrvzq8r9fn as sanitizeEnumEntries,
|
|
146
165
|
convert37aabdzvtv9vg as convert_1,
|
|
@@ -150,25 +169,28 @@ import {
|
|
|
150
169
|
emitEndpointClient1meajc90wf3el as emitEndpointClient,
|
|
151
170
|
emitClient32kfwzg2hm5vj as emitClient,
|
|
152
171
|
emit1oxjujel6f3jb as emit_1,
|
|
172
|
+
beforeGenerate3o8idb3hey1b0 as beforeGenerate,
|
|
153
173
|
IrEmitterh2m93ojzvkep as IrEmitter,
|
|
154
|
-
TransformScopeyrd3lf4zrk76 as TransformScope,
|
|
155
174
|
TransformerBuildera6a1gvlhjj9b as TransformerBuilder,
|
|
156
175
|
transform3eti8i2bqvifx as transform,
|
|
157
|
-
Elementitq62jg6fid3 as Element,
|
|
158
176
|
Namespace345pal554qu3j as Namespace,
|
|
159
177
|
flattenNestedStructs2956rxx8q2zxl as flattenNestedStructs,
|
|
160
178
|
Union38f3pecvfcpxh as Union_0,
|
|
161
179
|
Struct39wf79cwtn4ty as Struct,
|
|
180
|
+
Dict22iqrhoo0g8et as Dict_0,
|
|
181
|
+
Array2goj74t0aak7b as Array_0,
|
|
182
|
+
Nullable3wjn6l6q3h6o as Nullable,
|
|
183
|
+
Any_instance2998xag3cdzh3 as Any_instance,
|
|
162
184
|
Custom2si7lto3wompr as Custom_0,
|
|
185
|
+
Reflect_instance3i17lxiopj78t as Reflect_instance,
|
|
186
|
+
transformChildrend9p91tpcqdkx as transformChildren_1,
|
|
163
187
|
Boolean_instance27opaqtiiiysz as Boolean_instance_0,
|
|
164
188
|
String_instance3uxvo48ki208u as String_instance,
|
|
165
|
-
RawExpression2bo7ldfrptjia as RawExpression,
|
|
166
189
|
Function21cuq8qizkin7 as Function,
|
|
167
190
|
function12vu2kapzno4w as function_0,
|
|
168
191
|
VariableReference2vlynnhaw1i64 as VariableReference,
|
|
169
192
|
FieldCall1iz7z2fx2xo4p as FieldCall,
|
|
170
193
|
convertConstraintkgpvomct0x0s as convertConstraint,
|
|
171
|
-
transformChildrend9p91tpcqdkx as transformChildren_0,
|
|
172
194
|
Interface3pn84xq686t2r as Interface,
|
|
173
195
|
Parameteruqoxd4rzw7ga as Parameter,
|
|
174
196
|
FunctionCall30872kpnbr7op as FunctionCall,
|
|
@@ -184,10 +206,10 @@ initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, V
|
|
|
184
206
|
function emit_3(identifier) {
|
|
185
207
|
var tmp;
|
|
186
208
|
if (identifier instanceof DefinitionIdentifier) {
|
|
187
|
-
tmp = this.
|
|
209
|
+
tmp = this.n21(identifier);
|
|
188
210
|
} else {
|
|
189
211
|
if (identifier instanceof FieldIdentifier) {
|
|
190
|
-
tmp = this.
|
|
212
|
+
tmp = this.d21(this.n21(identifier));
|
|
191
213
|
} else {
|
|
192
214
|
noWhenBranchMatchedException();
|
|
193
215
|
}
|
|
@@ -196,7 +218,7 @@ function emit_3(identifier) {
|
|
|
196
218
|
}
|
|
197
219
|
function sanitize(_this__u8e3s4) {
|
|
198
220
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
199
|
-
var this_0 = split(_this__u8e3s4.
|
|
221
|
+
var this_0 = split(_this__u8e3s4.n1(), ['.', ' ']);
|
|
200
222
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
201
223
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
202
224
|
var index = 0;
|
|
@@ -205,7 +227,7 @@ function sanitize(_this__u8e3s4) {
|
|
|
205
227
|
var item = _iterator__ex2g4s.v();
|
|
206
228
|
var _unary__edvuaz = index;
|
|
207
229
|
index = _unary__edvuaz + 1 | 0;
|
|
208
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
230
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.ev(item) : item;
|
|
209
231
|
destination.x(tmp$ret$0);
|
|
210
232
|
}
|
|
211
233
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -243,42 +265,42 @@ function sanitize(_this__u8e3s4) {
|
|
|
243
265
|
return tmp;
|
|
244
266
|
}
|
|
245
267
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
246
|
-
return Companion_getInstance_0().
|
|
268
|
+
return Companion_getInstance_0().w22_1.a2(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
247
269
|
}
|
|
248
270
|
initMetadataForInterface(PythonIdentifierEmitter, 'PythonIdentifierEmitter');
|
|
249
271
|
function emit_4(type, module_0) {
|
|
250
272
|
var tmp;
|
|
251
|
-
if (type.
|
|
252
|
-
var tmp_0 = this.
|
|
273
|
+
if (type.mt_1.it_1.r()) {
|
|
274
|
+
var tmp_0 = this.mv(type.lt_1);
|
|
253
275
|
var tmp_1 = Spacer_instance.toString();
|
|
254
276
|
var tmp_2 = importReferences(type);
|
|
255
277
|
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 ');
|
|
256
278
|
} else {
|
|
257
|
-
var tmp_3 = this.
|
|
258
|
-
var tmp_4 = this.
|
|
279
|
+
var tmp_3 = this.mv(type.lt_1);
|
|
280
|
+
var tmp_4 = this.lu(type.mt_1);
|
|
259
281
|
var tmp_5 = importReferences(type);
|
|
260
282
|
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 ');
|
|
261
283
|
}
|
|
262
284
|
return tmp;
|
|
263
285
|
}
|
|
264
286
|
function emit_5(_this__u8e3s4) {
|
|
265
|
-
return joinToString(_this__u8e3s4.
|
|
287
|
+
return joinToString(_this__u8e3s4.it_1, '\n', VOID, VOID, VOID, VOID, PythonTypeDefinitionEmitter$emit$lambda_1(this));
|
|
266
288
|
}
|
|
267
289
|
function emit_6(_this__u8e3s4) {
|
|
268
|
-
return this.
|
|
290
|
+
return this.mv(_this__u8e3s4.qt_1) + ": '" + this.nu(_this__u8e3s4.rt_1) + "'";
|
|
269
291
|
}
|
|
270
292
|
function emit_7(_this__u8e3s4) {
|
|
271
293
|
// Inline function 'kotlin.let' call
|
|
272
|
-
var it = this.
|
|
273
|
-
return _this__u8e3s4.
|
|
294
|
+
var it = this.u22(_this__u8e3s4);
|
|
295
|
+
return _this__u8e3s4.sy() ? 'Optional[' + it + ']' : it;
|
|
274
296
|
}
|
|
275
297
|
function emitType(_this__u8e3s4) {
|
|
276
298
|
var tmp;
|
|
277
299
|
if (_this__u8e3s4 instanceof Dict) {
|
|
278
|
-
tmp = 'Dict[str, ' + this.
|
|
300
|
+
tmp = 'Dict[str, ' + this.nu(_this__u8e3s4.ss_1) + ']';
|
|
279
301
|
} else {
|
|
280
302
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
281
|
-
tmp = 'List[' + this.
|
|
303
|
+
tmp = 'List[' + this.nu(_this__u8e3s4.ps_1) + ']';
|
|
282
304
|
} else {
|
|
283
305
|
if (_this__u8e3s4 instanceof Unit) {
|
|
284
306
|
tmp = 'None';
|
|
@@ -287,10 +309,10 @@ function emitType(_this__u8e3s4) {
|
|
|
287
309
|
tmp = 'Any';
|
|
288
310
|
} else {
|
|
289
311
|
if (_this__u8e3s4 instanceof Custom) {
|
|
290
|
-
tmp = _this__u8e3s4.
|
|
312
|
+
tmp = _this__u8e3s4.az_1;
|
|
291
313
|
} else {
|
|
292
314
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
293
|
-
tmp = this.
|
|
315
|
+
tmp = this.s22(_this__u8e3s4.ez_1);
|
|
294
316
|
} else {
|
|
295
317
|
noWhenBranchMatchedException();
|
|
296
318
|
}
|
|
@@ -329,10 +351,10 @@ function emit_8(_this__u8e3s4) {
|
|
|
329
351
|
function emit_9(_this__u8e3s4) {
|
|
330
352
|
var tmp;
|
|
331
353
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
332
|
-
tmp = 'bool(re.match(r"' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.
|
|
354
|
+
tmp = 'bool(re.match(r"' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.ox_1) + '", self.value))';
|
|
333
355
|
} else {
|
|
334
356
|
if (_this__u8e3s4 instanceof Bound) {
|
|
335
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
357
|
+
var tmp1_safe_receiver = _this__u8e3s4.ey_1;
|
|
336
358
|
var tmp_0;
|
|
337
359
|
if (tmp1_safe_receiver == null) {
|
|
338
360
|
tmp_0 = null;
|
|
@@ -341,7 +363,7 @@ function emit_9(_this__u8e3s4) {
|
|
|
341
363
|
tmp_0 = tmp1_safe_receiver + ' < self.value';
|
|
342
364
|
}
|
|
343
365
|
var minCheck = tmp_0;
|
|
344
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
366
|
+
var tmp2_safe_receiver = _this__u8e3s4.fy_1;
|
|
345
367
|
var tmp_1;
|
|
346
368
|
if (tmp2_safe_receiver == null) {
|
|
347
369
|
tmp_1 = null;
|
|
@@ -367,31 +389,26 @@ function emit_9(_this__u8e3s4) {
|
|
|
367
389
|
return tmp;
|
|
368
390
|
}
|
|
369
391
|
function emitReferenceCustomImports(_this__u8e3s4) {
|
|
370
|
-
return 'from ..model.' + _this__u8e3s4.
|
|
392
|
+
return 'from ..model.' + _this__u8e3s4.az_1 + ' import ' + _this__u8e3s4.az_1;
|
|
371
393
|
}
|
|
372
394
|
initMetadataForInterface(PythonTypeDefinitionEmitter, 'PythonTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
373
|
-
function emit_10(
|
|
374
|
-
var tmp = this.c1w(enum_0.gr_1);
|
|
375
|
-
return trimMargin('\n |class ' + tmp + '(str, Enum):\n |' + joinToString(enum_0.hr_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.qr(2) + 'return self.value\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.qr(2) + 'return self.value\n ');
|
|
376
|
-
}
|
|
377
|
-
initMetadataForInterface(PythonEnumDefinitionEmitter, 'PythonEnumDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
378
|
-
function emit_11(endpoint) {
|
|
395
|
+
function emit_10(endpoint) {
|
|
379
396
|
var tmp = importReferences(endpoint);
|
|
380
397
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emit$lambda(this));
|
|
381
|
-
var tmp_1 = this.
|
|
382
|
-
var tmp_2 = spacer(this.
|
|
383
|
-
var tmp_3 = distinctByStatus(endpoint.
|
|
398
|
+
var tmp_1 = this.mv(endpoint.ut_1);
|
|
399
|
+
var tmp_2 = spacer(this.a21(first(endpoint.zt_1), endpoint), 1);
|
|
400
|
+
var tmp_3 = distinctByStatus(endpoint.au_1);
|
|
384
401
|
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 ');
|
|
385
402
|
}
|
|
386
|
-
function
|
|
387
|
-
var tmp = emit_18(this, _this__u8e3s4.
|
|
403
|
+
function emit_11(_this__u8e3s4, endpoint) {
|
|
404
|
+
var tmp = emit_18(this, _this__u8e3s4.du_1);
|
|
388
405
|
var tmp_0 = get_pathParams(endpoint);
|
|
389
406
|
var tmp_1 = emitObject$default(this, tmp_0, 'Path', 'Wirespec.Request.Path', VOID, PythonEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
390
|
-
var tmp_2 = emitObject$default(this, endpoint.
|
|
391
|
-
var tmp_3 = emitObject$default(this, endpoint.
|
|
407
|
+
var tmp_2 = emitObject$default(this, endpoint.xt_1, 'Queries', 'Wirespec.Request.Queries', VOID, PythonEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
408
|
+
var tmp_3 = emitObject$default(this, endpoint.yt_1, 'Headers', 'Wirespec.Request.Headers', VOID, PythonEndpointDefinitionEmitter$emit$lambda_3(this));
|
|
392
409
|
var tmp_4 = Spacer_instance.toString();
|
|
393
410
|
var tmp_5 = Spacer_instance.toString();
|
|
394
|
-
var tmp_6 = emit_18(this, _this__u8e3s4.
|
|
411
|
+
var tmp_6 = emit_18(this, _this__u8e3s4.du_1);
|
|
395
412
|
var tmp_7 = Spacer_instance.toString();
|
|
396
413
|
var tmp_8 = Spacer_instance.toString();
|
|
397
414
|
var tmp_9 = Spacer_instance.toString();
|
|
@@ -407,61 +424,70 @@ function emit_12(_this__u8e3s4, endpoint) {
|
|
|
407
424
|
var tmp_19 = Spacer_instance.toString();
|
|
408
425
|
var tmp_20 = Spacer_instance.toString();
|
|
409
426
|
var tmp_21 = Spacer_instance.toString();
|
|
410
|
-
var tmp_22 = emit_18(this, _this__u8e3s4.
|
|
427
|
+
var tmp_22 = emit_18(this, _this__u8e3s4.du_1);
|
|
411
428
|
var tmp_23 = Spacer_instance.toString();
|
|
412
429
|
var tmp_24 = Spacer_instance.toString();
|
|
413
430
|
var tmp_25 = Spacer_instance.toString();
|
|
414
431
|
var tmp_26 = Spacer_instance.toString();
|
|
415
432
|
var tmp_27 = Spacer_instance.toString();
|
|
416
433
|
var tmp_28 = paramList(_this__u8e3s4, endpoint);
|
|
417
|
-
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.
|
|
434
|
+
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.vt_1.g3_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 ');
|
|
418
435
|
}
|
|
419
|
-
function
|
|
420
|
-
var tmp = emit_18(this, _this__u8e3s4.
|
|
421
|
-
var tmp_0 = emitObject$default(this, _this__u8e3s4.
|
|
436
|
+
function emit_12(_this__u8e3s4, endpoint) {
|
|
437
|
+
var tmp = emit_18(this, _this__u8e3s4.iu_1);
|
|
438
|
+
var tmp_0 = emitObject$default(this, _this__u8e3s4.hu_1, 'Headers', 'Wirespec.Response.Headers', VOID, PythonEndpointDefinitionEmitter$emit$lambda_5(this));
|
|
422
439
|
var tmp_1 = Spacer_instance.toString();
|
|
423
440
|
var tmp_2 = Spacer_instance.toString();
|
|
424
441
|
var tmp_3 = Spacer_instance.toString();
|
|
425
442
|
var tmp_4 = Spacer_instance.toString();
|
|
426
443
|
var tmp_5 = Spacer_instance.toString();
|
|
427
444
|
var tmp_6 = Spacer_instance.toString();
|
|
428
|
-
var tmp_7 = emit_18(this, _this__u8e3s4.
|
|
445
|
+
var tmp_7 = emit_18(this, _this__u8e3s4.iu_1);
|
|
429
446
|
var tmp_8 = Spacer_instance.toString();
|
|
430
447
|
var tmp_9 = Spacer_instance.toString();
|
|
431
448
|
var tmp_10 = Spacer_instance.toString();
|
|
432
|
-
var tmp_11 = emit_18(this, _this__u8e3s4.
|
|
449
|
+
var tmp_11 = emit_18(this, _this__u8e3s4.iu_1);
|
|
433
450
|
var tmp_12 = Spacer_instance.toString();
|
|
434
451
|
var tmp_13 = Spacer_instance.toString();
|
|
435
452
|
var tmp_14 = Spacer_instance.toString();
|
|
436
453
|
var tmp_15 = paramList_0(_this__u8e3s4);
|
|
437
|
-
return trimMargin('\n |@dataclass\n |class Response' + _this__u8e3s4.
|
|
454
|
+
return trimMargin('\n |@dataclass\n |class Response' + _this__u8e3s4.gu_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.gu_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 ');
|
|
438
455
|
}
|
|
439
456
|
initMetadataForInterface(PythonEndpointDefinitionEmitter, 'PythonEndpointDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter]);
|
|
440
|
-
function
|
|
441
|
-
return trimMargin('\n
|
|
457
|
+
function emit_13(union) {
|
|
458
|
+
return trimMargin('\n |class ' + this.mv(union.gt_1) + '(ABC):\n |' + Spacer_instance.toString() + 'pass\n ');
|
|
459
|
+
}
|
|
460
|
+
initMetadataForInterface(PythonUnionDefinitionEmitter, 'PythonUnionDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
461
|
+
function emit_14(enum_0, module_0) {
|
|
462
|
+
var tmp = this.n21(enum_0.wv_1);
|
|
463
|
+
return trimMargin('\n |class ' + tmp + '(str, Enum):\n |' + joinToString(enum_0.xv_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.gw(2) + 'return self.value\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.gw(2) + 'return self.value\n ');
|
|
464
|
+
}
|
|
465
|
+
initMetadataForInterface(PythonEnumDefinitionEmitter, 'PythonEnumDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
466
|
+
function emit_15(refined) {
|
|
467
|
+
return trimMargin('\n |@dataclass\n |class ' + this.n21(refined.rv_1) + '(Wirespec.Refined):\n |' + Spacer_instance.toString() + 'value: ' + this.u22(refined.sv_1) + '\n |\n |' + Spacer_instance.toString() + 'def validate(self) -> bool:\n |' + Spacer_instance.gw(2) + 'return ' + this.aw(refined) + '\n |\n |' + Spacer_instance.toString() + 'def __str__(self) -> str:\n |' + Spacer_instance.gw(2) + 'return str(self.value)\n |\n ');
|
|
442
468
|
}
|
|
443
469
|
function emitValidator(_this__u8e3s4) {
|
|
444
470
|
var defaultReturn = 'True';
|
|
445
|
-
var type = _this__u8e3s4.
|
|
471
|
+
var type = _this__u8e3s4.sv_1.ez_1;
|
|
446
472
|
var tmp;
|
|
447
473
|
if (type instanceof Integer) {
|
|
448
|
-
var tmp0_safe_receiver = type.
|
|
449
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
474
|
+
var tmp0_safe_receiver = type.jy_1;
|
|
475
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.ou(tmp0_safe_receiver);
|
|
450
476
|
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
451
477
|
} else {
|
|
452
478
|
if (type instanceof Number_0) {
|
|
453
|
-
var tmp2_safe_receiver = type.
|
|
454
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.
|
|
479
|
+
var tmp2_safe_receiver = type.my_1;
|
|
480
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.ou(tmp2_safe_receiver);
|
|
455
481
|
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
456
482
|
} else {
|
|
457
483
|
if (type instanceof String_0) {
|
|
458
|
-
var tmp4_safe_receiver = type.
|
|
484
|
+
var tmp4_safe_receiver = type.gy_1;
|
|
459
485
|
var tmp_0;
|
|
460
486
|
var tmp_1 = tmp4_safe_receiver;
|
|
461
487
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
462
488
|
tmp_0 = null;
|
|
463
489
|
} else {
|
|
464
|
-
tmp_0 = this.
|
|
490
|
+
tmp_0 = this.ou(new RegExp_0(tmp4_safe_receiver));
|
|
465
491
|
}
|
|
466
492
|
var tmp5_elvis_lhs = tmp_0;
|
|
467
493
|
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
@@ -481,11 +507,7 @@ function emitValidator(_this__u8e3s4) {
|
|
|
481
507
|
return tmp;
|
|
482
508
|
}
|
|
483
509
|
initMetadataForInterface(PythonRefinedTypeDefinitionEmitter, 'PythonRefinedTypeDefinitionEmitter', VOID, VOID, [PythonTypeDefinitionEmitter, PythonIdentifierEmitter]);
|
|
484
|
-
|
|
485
|
-
return trimMargin('\n |class ' + this.wq(union.qo_1) + '(ABC):\n |' + Spacer_instance.toString() + 'pass\n ');
|
|
486
|
-
}
|
|
487
|
-
initMetadataForInterface(PythonUnionDefinitionEmitter, 'PythonUnionDefinitionEmitter', VOID, VOID, [PythonIdentifierEmitter]);
|
|
488
|
-
initMetadataForClass(PythonEmitter, 'PythonEmitter', PythonEmitter, LanguageEmitter, [LanguageEmitter, PythonIdentifierEmitter, PythonTypeDefinitionEmitter, PythonEnumDefinitionEmitter, PythonEndpointDefinitionEmitter, PythonChannelDefinitionEmitter, PythonRefinedTypeDefinitionEmitter, PythonUnionDefinitionEmitter]);
|
|
510
|
+
initMetadataForClass(PythonEmitter, 'PythonEmitter', PythonEmitter, LanguageEmitter, [LanguageEmitter, PythonIdentifierEmitter, PythonEndpointDefinitionEmitter, PythonTypeDefinitionEmitter, PythonChannelDefinitionEmitter, PythonUnionDefinitionEmitter, PythonEnumDefinitionEmitter, PythonRefinedTypeDefinitionEmitter]);
|
|
489
511
|
initMetadataForCompanion(Companion);
|
|
490
512
|
initMetadataForCompanion(Companion_0);
|
|
491
513
|
initMetadataForClass(sam$kotlin_Comparator$0_0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
|
|
@@ -495,23 +517,23 @@ initMetadataForObject(PythonShared, 'PythonShared');
|
|
|
495
517
|
function PythonChannelDefinitionEmitter() {
|
|
496
518
|
}
|
|
497
519
|
function sam$kotlin_Comparator$0(function_0) {
|
|
498
|
-
this.
|
|
520
|
+
this.i22_1 = function_0;
|
|
499
521
|
}
|
|
500
|
-
protoOf(sam$kotlin_Comparator$0).
|
|
501
|
-
return this.
|
|
522
|
+
protoOf(sam$kotlin_Comparator$0).xd = function (a, b) {
|
|
523
|
+
return this.i22_1(a, b);
|
|
502
524
|
};
|
|
503
525
|
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
504
|
-
return this.
|
|
526
|
+
return this.xd(a, b);
|
|
505
527
|
};
|
|
506
|
-
protoOf(sam$kotlin_Comparator$0).
|
|
507
|
-
return this.
|
|
528
|
+
protoOf(sam$kotlin_Comparator$0).r3 = function () {
|
|
529
|
+
return this.i22_1;
|
|
508
530
|
};
|
|
509
531
|
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
510
532
|
var tmp;
|
|
511
533
|
if (!(other == null) ? isInterface(other, Comparator) : false) {
|
|
512
534
|
var tmp_0;
|
|
513
535
|
if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
|
|
514
|
-
tmp_0 = equals(this.
|
|
536
|
+
tmp_0 = equals(this.r3(), other.r3());
|
|
515
537
|
} else {
|
|
516
538
|
tmp_0 = false;
|
|
517
539
|
}
|
|
@@ -522,40 +544,40 @@ protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
|
522
544
|
return tmp;
|
|
523
545
|
};
|
|
524
546
|
protoOf(sam$kotlin_Comparator$0).hashCode = function () {
|
|
525
|
-
return hashCode(this.
|
|
547
|
+
return hashCode(this.r3());
|
|
526
548
|
};
|
|
527
549
|
function PythonEmitter$emit$lambda(this$0) {
|
|
528
550
|
return function (a, b) {
|
|
529
551
|
// Inline function 'kotlin.comparisons.compareValuesBy' call
|
|
530
|
-
var tmp = this$0.
|
|
531
|
-
var tmp$ret$1 = this$0.
|
|
552
|
+
var tmp = this$0.p22(a);
|
|
553
|
+
var tmp$ret$1 = this$0.p22(b);
|
|
532
554
|
return compareValues(tmp, tmp$ret$1);
|
|
533
555
|
};
|
|
534
556
|
}
|
|
535
557
|
function emit$emitInit(this$0, def) {
|
|
536
|
-
return 'from .' + this$0.
|
|
558
|
+
return 'from .' + this$0.mv(def.lv()) + ' import ' + this$0.mv(def.lv());
|
|
537
559
|
}
|
|
538
560
|
function PythonEmitter(packageName, emitShared) {
|
|
539
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
540
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
561
|
+
packageName = packageName === VOID ? Companion_instance.bw('community.flock.wirespec.generated') : packageName;
|
|
562
|
+
emitShared = emitShared === VOID ? Companion_instance_0.ws() : emitShared;
|
|
541
563
|
LanguageEmitter.call(this);
|
|
542
|
-
this.
|
|
543
|
-
this.
|
|
544
|
-
this.
|
|
545
|
-
this.
|
|
546
|
-
this.
|
|
547
|
-
this.
|
|
548
|
-
}
|
|
549
|
-
protoOf(PythonEmitter).
|
|
550
|
-
return this.
|
|
564
|
+
this.j22_1 = packageName;
|
|
565
|
+
this.k22_1 = emitShared;
|
|
566
|
+
this.l22_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';
|
|
567
|
+
this.m22_1 = FileExtension_Python_getInstance();
|
|
568
|
+
this.n22_1 = PythonShared_instance;
|
|
569
|
+
this.o22_1 = '#';
|
|
570
|
+
}
|
|
571
|
+
protoOf(PythonEmitter).uu = function () {
|
|
572
|
+
return this.m22_1;
|
|
551
573
|
};
|
|
552
|
-
protoOf(PythonEmitter).
|
|
553
|
-
return this.
|
|
574
|
+
protoOf(PythonEmitter).w20 = function () {
|
|
575
|
+
return this.n22_1;
|
|
554
576
|
};
|
|
555
|
-
protoOf(PythonEmitter).
|
|
556
|
-
return this.
|
|
577
|
+
protoOf(PythonEmitter).vu = function () {
|
|
578
|
+
return this.o22_1;
|
|
557
579
|
};
|
|
558
|
-
protoOf(PythonEmitter).
|
|
580
|
+
protoOf(PythonEmitter).p22 = function (definition) {
|
|
559
581
|
var tmp;
|
|
560
582
|
if (definition instanceof Enum) {
|
|
561
583
|
tmp = 1;
|
|
@@ -584,21 +606,21 @@ protoOf(PythonEmitter).e1x = function (definition) {
|
|
|
584
606
|
}
|
|
585
607
|
return tmp;
|
|
586
608
|
};
|
|
587
|
-
protoOf(PythonEmitter).
|
|
609
|
+
protoOf(PythonEmitter).jv = function (module_0, logger) {
|
|
588
610
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
589
|
-
var this_0 = new NonEmptyList(module_0.
|
|
611
|
+
var this_0 = new NonEmptyList(module_0.tu_1);
|
|
590
612
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
591
613
|
var tmp = PythonEmitter$emit$lambda(this);
|
|
592
614
|
var tmp$ret$0 = new sam$kotlin_Comparator$0(tmp);
|
|
593
615
|
var tmp$ret$1 = sortedWith(this_0, tmp$ret$0);
|
|
594
616
|
var tmp_0 = toNonEmptyListOrNull(tmp$ret$1);
|
|
595
|
-
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).
|
|
617
|
+
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).oq_1;
|
|
596
618
|
// Inline function 'kotlin.let' call
|
|
597
|
-
var it = protoOf(LanguageEmitter).
|
|
598
|
-
var init = new Emitted(this.
|
|
599
|
-
var tmp_1 = this.
|
|
619
|
+
var it = protoOf(LanguageEmitter).jv.call(this, module_0.lz(VOID, statements), logger);
|
|
620
|
+
var init = new Emitted(this.j22_1.ew() + '__init__', 'from . import model\nfrom . import endpoint\nfrom . import wirespec\n');
|
|
621
|
+
var tmp_1 = this.j22_1.ew() + 'endpoint/' + '__init__';
|
|
600
622
|
// Inline function 'kotlin.collections.filter' call
|
|
601
|
-
var tmp0 = new NonEmptyList(module_0.
|
|
623
|
+
var tmp0 = new NonEmptyList(module_0.tu_1);
|
|
602
624
|
// Inline function 'kotlin.collections.filterTo' call
|
|
603
625
|
var destination = ArrayList_init_$Create$();
|
|
604
626
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -618,9 +640,9 @@ protoOf(PythonEmitter).tq = function (module_0, logger) {
|
|
|
618
640
|
destination_0.x(tmp$ret$5);
|
|
619
641
|
}
|
|
620
642
|
var initEndpoint = new Emitted(tmp_1, joinToString(destination_0, '\n'));
|
|
621
|
-
var tmp_2 = this.
|
|
643
|
+
var tmp_2 = this.j22_1.ew() + 'model/' + '__init__';
|
|
622
644
|
// Inline function 'kotlin.collections.filter' call
|
|
623
|
-
var tmp0_0 = new NonEmptyList(module_0.
|
|
645
|
+
var tmp0_0 = new NonEmptyList(module_0.tu_1);
|
|
624
646
|
// Inline function 'kotlin.collections.filterTo' call
|
|
625
647
|
var destination_1 = ArrayList_init_$Create$();
|
|
626
648
|
var _iterator__ex2g4s_1 = tmp0_0.t();
|
|
@@ -640,33 +662,33 @@ protoOf(PythonEmitter).tq = function (module_0, logger) {
|
|
|
640
662
|
destination_2.x(tmp$ret$11);
|
|
641
663
|
}
|
|
642
664
|
var initModel = new Emitted(tmp_2, joinToString(destination_2, '\n'));
|
|
643
|
-
var shared = new Emitted(this.
|
|
644
|
-
return this.
|
|
665
|
+
var shared = new Emitted(this.j22_1.ew() + 'wirespec', this.w20().r22_1);
|
|
666
|
+
return this.k22_1.xs_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);
|
|
645
667
|
};
|
|
646
|
-
protoOf(PythonEmitter).
|
|
647
|
-
var subPackageName = plus_1(this.
|
|
668
|
+
protoOf(PythonEmitter).kv = function (definition, module_0, logger) {
|
|
669
|
+
var subPackageName = plus_1(this.j22_1, definition);
|
|
648
670
|
// Inline function 'kotlin.let' call
|
|
649
|
-
var it = protoOf(LanguageEmitter).
|
|
650
|
-
var tmp = subPackageName.
|
|
671
|
+
var it = protoOf(LanguageEmitter).kv.call(this, definition, module_0, logger);
|
|
672
|
+
var tmp = subPackageName.ew() + it.ys_1;
|
|
651
673
|
// Inline function 'kotlin.text.trimStart' call
|
|
652
|
-
var this_0 = trimMargin('\n |' + this.
|
|
674
|
+
var this_0 = trimMargin('\n |' + this.l22_1 + '\n |' + it.zs_1 + '\n ');
|
|
653
675
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
654
676
|
return new Emitted(tmp, tmp$ret$0);
|
|
655
677
|
};
|
|
656
678
|
function emitToRawRequest($this, _this__u8e3s4, endpoint) {
|
|
657
|
-
var tmp = $this.
|
|
679
|
+
var tmp = $this.mv(endpoint.ut_1);
|
|
658
680
|
var tmp_0 = Spacer_instance.toString();
|
|
659
681
|
var tmp_1 = Spacer_instance.toString();
|
|
660
682
|
var tmp_2 = Spacer_instance.toString();
|
|
661
|
-
var tmp_3 = joinToString(endpoint.
|
|
683
|
+
var tmp_3 = joinToString(endpoint.wt_1, VOID, VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawRequest$lambda($this));
|
|
662
684
|
var tmp_4 = Spacer_instance.toString();
|
|
663
685
|
var tmp_5 = Spacer_instance.toString();
|
|
664
686
|
var tmp_6 = Spacer_instance.toString();
|
|
665
687
|
var tmp_7 = Spacer_instance.toString();
|
|
666
688
|
var tmp_8;
|
|
667
689
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
668
|
-
if (!endpoint.
|
|
669
|
-
tmp_8 = prependIndent(joinToString(endpoint.
|
|
690
|
+
if (!endpoint.xt_1.r()) {
|
|
691
|
+
tmp_8 = prependIndent(joinToString(endpoint.xt_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawRequest$lambda_0($this)), Spacer_instance.gw(3));
|
|
670
692
|
} else {
|
|
671
693
|
tmp_8 = '';
|
|
672
694
|
}
|
|
@@ -677,8 +699,8 @@ function emitToRawRequest($this, _this__u8e3s4, endpoint) {
|
|
|
677
699
|
var tmp_13 = Spacer_instance.toString();
|
|
678
700
|
var tmp_14;
|
|
679
701
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
680
|
-
if (!endpoint.
|
|
681
|
-
tmp_14 = prependIndent(joinToString(endpoint.
|
|
702
|
+
if (!endpoint.yt_1.r()) {
|
|
703
|
+
tmp_14 = prependIndent(joinToString(endpoint.yt_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitToRawRequest$lambda_1($this)), Spacer_instance.gw(3));
|
|
682
704
|
} else {
|
|
683
705
|
tmp_14 = '';
|
|
684
706
|
}
|
|
@@ -687,48 +709,48 @@ function emitToRawRequest($this, _this__u8e3s4, endpoint) {
|
|
|
687
709
|
var tmp_17 = Spacer_instance.toString();
|
|
688
710
|
var tmp_18 = Spacer_instance.toString();
|
|
689
711
|
var tmp_19 = Spacer_instance.toString();
|
|
690
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
691
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
692
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
712
|
+
var tmp0_safe_receiver = _this__u8e3s4.du_1;
|
|
713
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.fu_1;
|
|
714
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.u22(tmp1_safe_receiver);
|
|
693
715
|
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 ');
|
|
694
716
|
}
|
|
695
717
|
function emitFromRawRequest($this, _this__u8e3s4, endpoint) {
|
|
696
|
-
return trimMargin("\n |@staticmethod\n |def from_raw_request(serialization: Wirespec.Deserializer, request: Wirespec.RawRequest) -> '" + $this.
|
|
718
|
+
return trimMargin("\n |@staticmethod\n |def from_raw_request(serialization: Wirespec.Deserializer, request: Wirespec.RawRequest) -> '" + $this.mv(endpoint.ut_1) + ".Request':\n |" + Spacer_instance.toString() + 'return ' + $this.mv(endpoint.ut_1) + '.Request' + emitDeserializedParams($this, _this__u8e3s4, endpoint) + '\n |\n ');
|
|
697
719
|
}
|
|
698
720
|
function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
699
721
|
var tmp = get_indexedPathParams(endpoint);
|
|
700
722
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
|
|
701
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
702
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
703
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
723
|
+
var tmp_1 = orNull(joinToString(endpoint.xt_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
|
|
724
|
+
var tmp_2 = orNull(joinToString(endpoint.yt_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
|
|
725
|
+
var tmp0_safe_receiver = _this__u8e3s4.du_1;
|
|
704
726
|
var tmp_3;
|
|
705
727
|
if (tmp0_safe_receiver == null) {
|
|
706
728
|
tmp_3 = null;
|
|
707
729
|
} else {
|
|
708
730
|
// Inline function 'kotlin.let' call
|
|
709
|
-
tmp_3 = Spacer_instance.
|
|
731
|
+
tmp_3 = Spacer_instance.gw(3) + 'body = serialization.deserialize(request.body, ' + $this.u22(tmp0_safe_receiver.fu_1) + '),';
|
|
710
732
|
}
|
|
711
733
|
// Inline function 'kotlin.let' call
|
|
712
734
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
713
735
|
return isBlank(it) ? '()' : '(\n' + it + '\n)';
|
|
714
736
|
}
|
|
715
737
|
function emitResponseUnion($this, _this__u8e3s4) {
|
|
716
|
-
return trimMargin('\n |Response = ' + joinToString(_this__u8e3s4.
|
|
738
|
+
return trimMargin('\n |Response = ' + joinToString(_this__u8e3s4.au_1, ' | ', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitResponseUnion$lambda) + '\n |\n ');
|
|
717
739
|
}
|
|
718
740
|
function emitHandleClass($this, _this__u8e3s4) {
|
|
719
|
-
return trimMargin('\n |class Handler(Wirespec.Endpoint.Handler):\n |' + Spacer_instance.toString() + '@abstractmethod\n |' + Spacer_instance.toString() + 'def ' + _this__u8e3s4.
|
|
741
|
+
return trimMargin('\n |class Handler(Wirespec.Endpoint.Handler):\n |' + Spacer_instance.toString() + '@abstractmethod\n |' + Spacer_instance.toString() + 'def ' + _this__u8e3s4.ut_1.n1() + "(self, req: '" + $this.mv(_this__u8e3s4.ut_1) + ".Request') -> '" + $this.mv(_this__u8e3s4.ut_1) + ".Response': pass\n |\n ");
|
|
720
742
|
}
|
|
721
743
|
function emitConvertClass($this, _this__u8e3s4) {
|
|
722
|
-
return trimMargin('\n |class Convert(Wirespec.Endpoint.Convert[Request, Response]):\n |' + spacer(emitToRawRequest($this, first(_this__u8e3s4.
|
|
744
|
+
return trimMargin('\n |class Convert(Wirespec.Endpoint.Convert[Request, Response]):\n |' + spacer(emitToRawRequest($this, first(_this__u8e3s4.zt_1), _this__u8e3s4), 1) + '\n |' + spacer(emitFromRawRequest($this, first(_this__u8e3s4.zt_1), _this__u8e3s4), 1) + '\n |' + spacer(emitToRawResponse($this, _this__u8e3s4), 1) + '\n |' + spacer(emitFromRawResponse($this, _this__u8e3s4), 1) + '\n |\n ');
|
|
723
745
|
}
|
|
724
746
|
function emit_16($this, _this__u8e3s4) {
|
|
725
|
-
return $this.
|
|
747
|
+
return $this.mv(_this__u8e3s4.zu_1) + ': ' + $this.nu(_this__u8e3s4.av_1);
|
|
726
748
|
}
|
|
727
749
|
function emitAssignSelf($this, _this__u8e3s4) {
|
|
728
|
-
return $this.
|
|
750
|
+
return $this.mv(_this__u8e3s4.zu_1) + ' = ' + $this.mv(_this__u8e3s4.zu_1);
|
|
729
751
|
}
|
|
730
752
|
function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
731
|
-
var tmp = $this.
|
|
753
|
+
var tmp = $this.mv(endpoint.ut_1);
|
|
732
754
|
// Inline function 'kotlin.collections.filter' call
|
|
733
755
|
var tmp0 = paramList(_this__u8e3s4, endpoint);
|
|
734
756
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -736,13 +758,13 @@ function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
|
736
758
|
var _iterator__ex2g4s = tmp0.t();
|
|
737
759
|
while (_iterator__ex2g4s.u()) {
|
|
738
760
|
var element = _iterator__ex2g4s.v();
|
|
739
|
-
if (element.
|
|
761
|
+
if (element.yu_1.equals(ParamType_PATH_getInstance())) {
|
|
740
762
|
destination.x(element);
|
|
741
763
|
}
|
|
742
764
|
}
|
|
743
765
|
var tmp_0 = destination;
|
|
744
766
|
var tmp_1 = joinToString(tmp_0, VOID, VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda($this));
|
|
745
|
-
var tmp_2 = $this.
|
|
767
|
+
var tmp_2 = $this.mv(endpoint.ut_1);
|
|
746
768
|
// Inline function 'kotlin.collections.filter' call
|
|
747
769
|
var tmp0_0 = paramList(_this__u8e3s4, endpoint);
|
|
748
770
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -750,13 +772,13 @@ function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
|
750
772
|
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
751
773
|
while (_iterator__ex2g4s_0.u()) {
|
|
752
774
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
753
|
-
if (element_0.
|
|
775
|
+
if (element_0.yu_1.equals(ParamType_QUERY_getInstance())) {
|
|
754
776
|
destination_0.x(element_0);
|
|
755
777
|
}
|
|
756
778
|
}
|
|
757
779
|
var tmp_3 = destination_0;
|
|
758
780
|
var tmp_4 = spacer(joinToString(tmp_3, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_0($this)), 1);
|
|
759
|
-
var tmp_5 = $this.
|
|
781
|
+
var tmp_5 = $this.mv(endpoint.ut_1);
|
|
760
782
|
// Inline function 'kotlin.collections.filter' call
|
|
761
783
|
var tmp0_1 = paramList(_this__u8e3s4, endpoint);
|
|
762
784
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -764,14 +786,14 @@ function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
|
764
786
|
var _iterator__ex2g4s_1 = tmp0_1.t();
|
|
765
787
|
while (_iterator__ex2g4s_1.u()) {
|
|
766
788
|
var element_1 = _iterator__ex2g4s_1.v();
|
|
767
|
-
if (element_1.
|
|
789
|
+
if (element_1.yu_1.equals(ParamType_HEADER_getInstance())) {
|
|
768
790
|
destination_1.x(element_1);
|
|
769
791
|
}
|
|
770
792
|
}
|
|
771
793
|
var tmp_6 = destination_1;
|
|
772
794
|
var tmp_7 = spacer(joinToString(tmp_6, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_1($this)), 1);
|
|
773
795
|
var tmp_8;
|
|
774
|
-
if (_this__u8e3s4.
|
|
796
|
+
if (_this__u8e3s4.du_1 == null) {
|
|
775
797
|
tmp_8 = null;
|
|
776
798
|
} else {
|
|
777
799
|
// Inline function 'kotlin.let' call
|
|
@@ -781,7 +803,7 @@ function emitAssignSelf_0($this, _this__u8e3s4, endpoint) {
|
|
|
781
803
|
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 ');
|
|
782
804
|
}
|
|
783
805
|
function emitAssignSelf_1($this, _this__u8e3s4, endpoint) {
|
|
784
|
-
var tmp = $this.
|
|
806
|
+
var tmp = $this.mv(endpoint.ut_1);
|
|
785
807
|
// Inline function 'kotlin.collections.filter' call
|
|
786
808
|
var tmp0 = paramList_0(_this__u8e3s4);
|
|
787
809
|
// Inline function 'kotlin.collections.filterTo' call
|
|
@@ -789,35 +811,35 @@ function emitAssignSelf_1($this, _this__u8e3s4, endpoint) {
|
|
|
789
811
|
var _iterator__ex2g4s = tmp0.t();
|
|
790
812
|
while (_iterator__ex2g4s.u()) {
|
|
791
813
|
var element = _iterator__ex2g4s.v();
|
|
792
|
-
if (element.
|
|
814
|
+
if (element.yu_1.equals(ParamType_HEADER_getInstance())) {
|
|
793
815
|
destination.x(element);
|
|
794
816
|
}
|
|
795
817
|
}
|
|
796
818
|
var tmp_0 = destination;
|
|
797
819
|
var tmp_1 = spacer(joinToString(tmp_0, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_2($this)), 1);
|
|
798
820
|
var tmp_2;
|
|
799
|
-
if (_this__u8e3s4.
|
|
821
|
+
if (_this__u8e3s4.iu_1 == null) {
|
|
800
822
|
tmp_2 = null;
|
|
801
823
|
} else {
|
|
802
824
|
// Inline function 'kotlin.let' call
|
|
803
825
|
tmp_2 = 'body';
|
|
804
826
|
}
|
|
805
827
|
var tmp1_elvis_lhs = tmp_2;
|
|
806
|
-
return trimMargin('\n |self._headers = ' + tmp + '.Response' + _this__u8e3s4.
|
|
828
|
+
return trimMargin('\n |self._headers = ' + tmp + '.Response' + _this__u8e3s4.gu_1 + '.Headers(' + tmp_1 + ')\n |self._body = ' + (tmp1_elvis_lhs == null ? 'None' : tmp1_elvis_lhs) + '\n ');
|
|
807
829
|
}
|
|
808
830
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
809
|
-
return Spacer_instance.
|
|
831
|
+
return Spacer_instance.gw(3) + $this.mv(_this__u8e3s4.of_1.bu_1) + ' = serialization.deserialize(request.path[' + _this__u8e3s4.nf_1 + '], ' + $this.u22(_this__u8e3s4.of_1.cu_1) + ')';
|
|
810
832
|
}
|
|
811
833
|
function emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive) {
|
|
812
834
|
var tmp;
|
|
813
835
|
if (caseSensitive) {
|
|
814
|
-
tmp = Spacer_instance.
|
|
836
|
+
tmp = Spacer_instance.gw(spaces) + $this.mv(_this__u8e3s4.qt_1) + ' = serialization.deserialize_param(' + type + '.' + fields + '.get("' + _this__u8e3s4.qt_1.n1() + '"), ' + $this.u22(_this__u8e3s4.rt_1) + ')';
|
|
815
837
|
} else {
|
|
816
|
-
var tmp_0 = Spacer_instance.
|
|
817
|
-
var tmp_1 = $this.
|
|
838
|
+
var tmp_0 = Spacer_instance.gw(spaces);
|
|
839
|
+
var tmp_1 = $this.mv(_this__u8e3s4.qt_1);
|
|
818
840
|
// Inline function 'kotlin.text.lowercase' call
|
|
819
841
|
// Inline function 'kotlin.js.asDynamic' call
|
|
820
|
-
tmp = tmp_0 + tmp_1 + ' = serialization.deserialize_param(next((v for k, v in ' + type + '.' + fields + '.items() if k.lower() == "' + _this__u8e3s4.
|
|
842
|
+
tmp = tmp_0 + tmp_1 + ' = serialization.deserialize_param(next((v for k, v in ' + type + '.' + fields + '.items() if k.lower() == "' + _this__u8e3s4.qt_1.n1().toLowerCase() + '"), None), ' + $this.u22(_this__u8e3s4.rt_1) + ')';
|
|
821
843
|
}
|
|
822
844
|
return tmp;
|
|
823
845
|
}
|
|
@@ -827,73 +849,73 @@ function emitDeserializedParams$default($this, _this__u8e3s4, type, fields, spac
|
|
|
827
849
|
return emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive);
|
|
828
850
|
}
|
|
829
851
|
function emitToRawResponse($this, _this__u8e3s4) {
|
|
830
|
-
var tmp = $this.
|
|
852
|
+
var tmp = $this.mv(_this__u8e3s4.ut_1);
|
|
831
853
|
var tmp_0 = Spacer_instance.toString();
|
|
832
|
-
var tmp_1 = distinctByStatus(_this__u8e3s4.
|
|
854
|
+
var tmp_1 = distinctByStatus(_this__u8e3s4.au_1);
|
|
833
855
|
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 ');
|
|
834
856
|
}
|
|
835
857
|
function emitFromRawResponse($this, _this__u8e3s4) {
|
|
836
|
-
var tmp = $this.
|
|
858
|
+
var tmp = $this.mv(_this__u8e3s4.ut_1);
|
|
837
859
|
var tmp_0 = Spacer_instance.toString();
|
|
838
860
|
// Inline function 'kotlin.collections.filter' call
|
|
839
|
-
var tmp0 = distinctByStatus(_this__u8e3s4.
|
|
861
|
+
var tmp0 = distinctByStatus(_this__u8e3s4.au_1);
|
|
840
862
|
// Inline function 'kotlin.collections.filterTo' call
|
|
841
863
|
var destination = ArrayList_init_$Create$();
|
|
842
864
|
var _iterator__ex2g4s = tmp0.t();
|
|
843
865
|
while (_iterator__ex2g4s.u()) {
|
|
844
866
|
var element = _iterator__ex2g4s.v();
|
|
845
|
-
if (Companion_instance_1.
|
|
867
|
+
if (Companion_instance_1.hv(element.gu_1)) {
|
|
846
868
|
destination.x(element);
|
|
847
869
|
}
|
|
848
870
|
}
|
|
849
871
|
var tmp_1 = destination;
|
|
850
|
-
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.
|
|
872
|
+
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.gw(2) + 'case _:\n |' + Spacer_instance.gw(3) + 'raise Exception("Cannot match response with status: " + str(response.status_code))\n |\n ');
|
|
851
873
|
}
|
|
852
874
|
function emitDeserialized_0($this, _this__u8e3s4, endpoint) {
|
|
853
|
-
var tmp = 'case ' + _this__u8e3s4.
|
|
854
|
-
var tmp_0 = Spacer_instance.toString() + 'return ' + $this.
|
|
855
|
-
var tmp_1 = Spacer_instance.
|
|
856
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
857
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
858
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
875
|
+
var tmp = 'case ' + _this__u8e3s4.gu_1 + ':';
|
|
876
|
+
var tmp_0 = Spacer_instance.toString() + 'return ' + $this.mv(endpoint.ut_1) + '.Response' + _this__u8e3s4.gu_1 + '(';
|
|
877
|
+
var tmp_1 = Spacer_instance.gw(2);
|
|
878
|
+
var tmp0_safe_receiver = _this__u8e3s4.iu_1;
|
|
879
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.fu_1;
|
|
880
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.u22(tmp1_safe_receiver);
|
|
859
881
|
var tmp_2 = tmp_1 + 'body = serialization.deserialize(response.body, ' + (tmp2_elvis_lhs == null ? 'type(None)' : tmp2_elvis_lhs) + '),';
|
|
860
|
-
return joinToString(listOfNotNull([tmp, tmp_0, tmp_2, orNull(joinToString(_this__u8e3s4.
|
|
882
|
+
return joinToString(listOfNotNull([tmp, tmp_0, tmp_2, orNull(joinToString(_this__u8e3s4.hu_1, ',\n', VOID, VOID, VOID, VOID, PythonEndpointDefinitionEmitter$emitDeserialized$lambda($this))), Spacer_instance.toString() + ')']), '\n');
|
|
861
883
|
}
|
|
862
884
|
function emitSerialized($this, _this__u8e3s4, endpoint) {
|
|
863
|
-
var tmp = $this.
|
|
864
|
-
var tmp_0 = Spacer_instance.
|
|
865
|
-
var tmp_1 = Spacer_instance.
|
|
866
|
-
var tmp_2 = Spacer_instance.
|
|
885
|
+
var tmp = $this.mv(endpoint.ut_1);
|
|
886
|
+
var tmp_0 = Spacer_instance.gw(1);
|
|
887
|
+
var tmp_1 = Spacer_instance.gw(2);
|
|
888
|
+
var tmp_2 = Spacer_instance.gw(2);
|
|
867
889
|
var tmp_3;
|
|
868
890
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
869
|
-
if (!_this__u8e3s4.
|
|
870
|
-
tmp_3 = joinToString(_this__u8e3s4.
|
|
891
|
+
if (!_this__u8e3s4.hu_1.r()) {
|
|
892
|
+
tmp_3 = joinToString(_this__u8e3s4.hu_1, ', ', '{', '}', VOID, VOID, PythonEndpointDefinitionEmitter$emitSerialized$lambda($this));
|
|
871
893
|
} else {
|
|
872
894
|
tmp_3 = '{}';
|
|
873
895
|
}
|
|
874
896
|
var tmp_4 = tmp_3;
|
|
875
|
-
var tmp_5 = Spacer_instance.
|
|
876
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
897
|
+
var tmp_5 = Spacer_instance.gw(2);
|
|
898
|
+
var tmp0_safe_receiver = _this__u8e3s4.iu_1;
|
|
877
899
|
var tmp_6;
|
|
878
900
|
if (tmp0_safe_receiver == null) {
|
|
879
901
|
tmp_6 = null;
|
|
880
902
|
} else {
|
|
881
903
|
// Inline function 'kotlin.let' call
|
|
882
|
-
tmp_6 = 'serialization.serialize(response.body, ' + $this.
|
|
904
|
+
tmp_6 = 'serialization.serialize(response.body, ' + $this.u22(tmp0_safe_receiver.fu_1) + ')';
|
|
883
905
|
}
|
|
884
906
|
var tmp1_elvis_lhs = tmp_6;
|
|
885
|
-
return trimMargin('\n |case ' + tmp + '.Response' + _this__u8e3s4.
|
|
907
|
+
return trimMargin('\n |case ' + tmp + '.Response' + _this__u8e3s4.gu_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.gw(1) + ')\n ');
|
|
886
908
|
}
|
|
887
909
|
function emitSerializedParams($this, _this__u8e3s4, type, fields) {
|
|
888
|
-
return '"' + _this__u8e3s4.
|
|
910
|
+
return '"' + _this__u8e3s4.qt_1.n1() + '": serialization.serialize_param(' + type + '.' + fields + '.' + $this.mv(_this__u8e3s4.qt_1) + ', ' + $this.u22(_this__u8e3s4.rt_1) + ')';
|
|
889
911
|
}
|
|
890
912
|
function emitObject($this, _this__u8e3s4, name, extends_0, spaces, block) {
|
|
891
913
|
var tmp;
|
|
892
914
|
if (_this__u8e3s4.r()) {
|
|
893
|
-
tmp = trimMargin('\n |' + Spacer_instance.
|
|
915
|
+
tmp = trimMargin('\n |' + Spacer_instance.gw(spaces) + '@dataclass\n |' + Spacer_instance.gw(spaces) + 'class ' + name + ' (' + extends_0 + '): pass\n ');
|
|
894
916
|
} else {
|
|
895
|
-
var tmp_0 = Spacer_instance.
|
|
896
|
-
var tmp_1 = Spacer_instance.
|
|
917
|
+
var tmp_0 = Spacer_instance.gw(spaces);
|
|
918
|
+
var tmp_1 = Spacer_instance.gw(spaces);
|
|
897
919
|
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 ');
|
|
898
920
|
}
|
|
899
921
|
return tmp;
|
|
@@ -903,21 +925,21 @@ function emitObject$default($this, _this__u8e3s4, name, extends_0, spaces, block
|
|
|
903
925
|
return emitObject($this, _this__u8e3s4, name, extends_0, spaces, block);
|
|
904
926
|
}
|
|
905
927
|
function emit_17($this, _this__u8e3s4) {
|
|
906
|
-
return $this.
|
|
928
|
+
return $this.mv(_this__u8e3s4.bu_1) + ': ' + $this.nu(_this__u8e3s4.cu_1);
|
|
907
929
|
}
|
|
908
930
|
function emit_18($this, _this__u8e3s4) {
|
|
909
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
910
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.
|
|
931
|
+
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.fu_1;
|
|
932
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.nu(tmp1_safe_receiver);
|
|
911
933
|
return tmp2_elvis_lhs == null ? 'None' : tmp2_elvis_lhs;
|
|
912
934
|
}
|
|
913
935
|
function PythonEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
914
936
|
return function (it) {
|
|
915
|
-
return this$0.
|
|
937
|
+
return this$0.v22(it);
|
|
916
938
|
};
|
|
917
939
|
}
|
|
918
940
|
function PythonEndpointDefinitionEmitter$emit$lambda_0(this$0, $endpoint) {
|
|
919
941
|
return function (it) {
|
|
920
|
-
return this$0.
|
|
942
|
+
return this$0.t22(it, $endpoint);
|
|
921
943
|
};
|
|
922
944
|
}
|
|
923
945
|
function PythonEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
@@ -927,12 +949,12 @@ function PythonEndpointDefinitionEmitter$emit$lambda_1(this$0) {
|
|
|
927
949
|
}
|
|
928
950
|
function PythonEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
929
951
|
return function (it) {
|
|
930
|
-
return this$0.
|
|
952
|
+
return this$0.mu(it);
|
|
931
953
|
};
|
|
932
954
|
}
|
|
933
955
|
function PythonEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
934
956
|
return function (it) {
|
|
935
|
-
return this$0.
|
|
957
|
+
return this$0.mu(it);
|
|
936
958
|
};
|
|
937
959
|
}
|
|
938
960
|
function PythonEndpointDefinitionEmitter$emit$lambda_4(this$0) {
|
|
@@ -944,10 +966,10 @@ function PythonEndpointDefinitionEmitter$emitToRawRequest$lambda(this$0) {
|
|
|
944
966
|
return function (it) {
|
|
945
967
|
var tmp;
|
|
946
968
|
if (it instanceof Literal) {
|
|
947
|
-
tmp = '"' + it.
|
|
969
|
+
tmp = '"' + it.xu_1 + '"';
|
|
948
970
|
} else {
|
|
949
971
|
if (it instanceof Param) {
|
|
950
|
-
tmp = 'str(request.path.' + this$0.
|
|
972
|
+
tmp = 'str(request.path.' + this$0.mv(it.bu_1) + ')';
|
|
951
973
|
} else {
|
|
952
974
|
noWhenBranchMatchedException();
|
|
953
975
|
}
|
|
@@ -981,7 +1003,7 @@ function PythonEndpointDefinitionEmitter$emitDeserializedParams$lambda_1(this$0)
|
|
|
981
1003
|
};
|
|
982
1004
|
}
|
|
983
1005
|
function PythonEndpointDefinitionEmitter$emitResponseUnion$lambda(it) {
|
|
984
|
-
return 'Response' + it.
|
|
1006
|
+
return 'Response' + it.gu_1;
|
|
985
1007
|
}
|
|
986
1008
|
function PythonEndpointDefinitionEmitter$emitAssignSelf$lambda(this$0) {
|
|
987
1009
|
return function (it) {
|
|
@@ -1005,7 +1027,7 @@ function PythonEndpointDefinitionEmitter$emitAssignSelf$lambda_2(this$0) {
|
|
|
1005
1027
|
}
|
|
1006
1028
|
function PythonEndpointDefinitionEmitter$emit$lambda_5(this$0) {
|
|
1007
1029
|
return function (it) {
|
|
1008
|
-
return this$0.
|
|
1030
|
+
return this$0.mu(it);
|
|
1009
1031
|
};
|
|
1010
1032
|
}
|
|
1011
1033
|
function PythonEndpointDefinitionEmitter$emit$lambda_6(this$0) {
|
|
@@ -1035,7 +1057,7 @@ function PythonEndpointDefinitionEmitter$emitSerialized$lambda(this$0) {
|
|
|
1035
1057
|
}
|
|
1036
1058
|
function PythonEndpointDefinitionEmitter$emitObject$lambda($spaces, $block) {
|
|
1037
1059
|
return function (it) {
|
|
1038
|
-
return Spacer_instance.
|
|
1060
|
+
return Spacer_instance.gw($spaces + 2 | 0) + $block(it);
|
|
1039
1061
|
};
|
|
1040
1062
|
}
|
|
1041
1063
|
function PythonEndpointDefinitionEmitter() {
|
|
@@ -1064,14 +1086,14 @@ function sanitizeEnum($this, _this__u8e3s4) {
|
|
|
1064
1086
|
}
|
|
1065
1087
|
function PythonEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
1066
1088
|
return function (it) {
|
|
1067
|
-
return Spacer_instance.toString() + this$0.
|
|
1089
|
+
return Spacer_instance.toString() + this$0.d21(sanitizeEnum(this$0, it)) + ' = "' + it + '"';
|
|
1068
1090
|
};
|
|
1069
1091
|
}
|
|
1070
1092
|
function PythonEnumDefinitionEmitter() {
|
|
1071
1093
|
}
|
|
1072
1094
|
function Companion() {
|
|
1073
1095
|
Companion_instance_2 = this;
|
|
1074
|
-
this.
|
|
1096
|
+
this.w22_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']);
|
|
1075
1097
|
}
|
|
1076
1098
|
var Companion_instance_2;
|
|
1077
1099
|
function Companion_getInstance_0() {
|
|
@@ -1082,15 +1104,15 @@ function Companion_getInstance_0() {
|
|
|
1082
1104
|
function PythonIdentifierEmitter() {
|
|
1083
1105
|
}
|
|
1084
1106
|
function _get_sanitizationConfig__sns434($this) {
|
|
1085
|
-
var tmp0 = $this.
|
|
1107
|
+
var tmp0 = $this.b23_1;
|
|
1086
1108
|
var tmp = KProperty1;
|
|
1087
1109
|
// Inline function 'kotlin.getValue' call
|
|
1088
1110
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, PythonIrEmitter$_get_sanitizationConfig_$ref_1q5eai(), null);
|
|
1089
|
-
return tmp0.
|
|
1111
|
+
return tmp0.n1();
|
|
1090
1112
|
}
|
|
1091
1113
|
function sanitize_0($this, _this__u8e3s4) {
|
|
1092
1114
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
1093
|
-
var this_0 = split(_this__u8e3s4.
|
|
1115
|
+
var this_0 = split(_this__u8e3s4.n1(), ['.', ' ']);
|
|
1094
1116
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
1095
1117
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1096
1118
|
var index = 0;
|
|
@@ -1099,7 +1121,7 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
1099
1121
|
var item = _iterator__ex2g4s.v();
|
|
1100
1122
|
var _unary__edvuaz = index;
|
|
1101
1123
|
index = _unary__edvuaz + 1 | 0;
|
|
1102
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.
|
|
1124
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.ev(item) : item;
|
|
1103
1125
|
destination.x(tmp$ret$0);
|
|
1104
1126
|
}
|
|
1105
1127
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -1145,7 +1167,7 @@ function sanitize_0($this, _this__u8e3s4) {
|
|
|
1145
1167
|
return tmp_2;
|
|
1146
1168
|
}
|
|
1147
1169
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1148
|
-
return Companion_getInstance_1().
|
|
1170
|
+
return Companion_getInstance_1().d23_1.a2(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
|
|
1149
1171
|
}
|
|
1150
1172
|
function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
1151
1173
|
// Inline function 'kotlin.let' call
|
|
@@ -1171,7 +1193,7 @@ function buildImports($this, wirespecPath) {
|
|
|
1171
1193
|
}
|
|
1172
1194
|
function Companion_0() {
|
|
1173
1195
|
Companion_instance_3 = this;
|
|
1174
|
-
this.
|
|
1196
|
+
this.d23_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']);
|
|
1175
1197
|
}
|
|
1176
1198
|
var Companion_instance_3;
|
|
1177
1199
|
function Companion_getInstance_1() {
|
|
@@ -1180,23 +1202,23 @@ function Companion_getInstance_1() {
|
|
|
1180
1202
|
return Companion_instance_3;
|
|
1181
1203
|
}
|
|
1182
1204
|
function sam$kotlin_Comparator$0_0(function_0) {
|
|
1183
|
-
this.
|
|
1205
|
+
this.e23_1 = function_0;
|
|
1184
1206
|
}
|
|
1185
|
-
protoOf(sam$kotlin_Comparator$0_0).
|
|
1186
|
-
return this.
|
|
1207
|
+
protoOf(sam$kotlin_Comparator$0_0).xd = function (a, b) {
|
|
1208
|
+
return this.e23_1(a, b);
|
|
1187
1209
|
};
|
|
1188
1210
|
protoOf(sam$kotlin_Comparator$0_0).compare = function (a, b) {
|
|
1189
|
-
return this.
|
|
1211
|
+
return this.xd(a, b);
|
|
1190
1212
|
};
|
|
1191
|
-
protoOf(sam$kotlin_Comparator$0_0).
|
|
1192
|
-
return this.
|
|
1213
|
+
protoOf(sam$kotlin_Comparator$0_0).r3 = function () {
|
|
1214
|
+
return this.e23_1;
|
|
1193
1215
|
};
|
|
1194
1216
|
protoOf(sam$kotlin_Comparator$0_0).equals = function (other) {
|
|
1195
1217
|
var tmp;
|
|
1196
1218
|
if (!(other == null) ? isInterface(other, Comparator) : false) {
|
|
1197
1219
|
var tmp_0;
|
|
1198
1220
|
if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
|
|
1199
|
-
tmp_0 = equals(this.
|
|
1221
|
+
tmp_0 = equals(this.r3(), other.r3());
|
|
1200
1222
|
} else {
|
|
1201
1223
|
tmp_0 = false;
|
|
1202
1224
|
}
|
|
@@ -1207,17 +1229,17 @@ protoOf(sam$kotlin_Comparator$0_0).equals = function (other) {
|
|
|
1207
1229
|
return tmp;
|
|
1208
1230
|
};
|
|
1209
1231
|
protoOf(sam$kotlin_Comparator$0_0).hashCode = function () {
|
|
1210
|
-
return hashCode(this.
|
|
1232
|
+
return hashCode(this.r3());
|
|
1211
1233
|
};
|
|
1212
1234
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
1213
1235
|
return '_' + it;
|
|
1214
1236
|
}
|
|
1215
1237
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(name) {
|
|
1216
|
-
var sanitized = name.
|
|
1238
|
+
var sanitized = name.k1l_1.b1() > 1 ? name.n1q() : name.h1n();
|
|
1217
1239
|
return new Name(listOf_0(sanitized));
|
|
1218
1240
|
}
|
|
1219
1241
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(name) {
|
|
1220
|
-
return new Name(listOf_0(name.
|
|
1242
|
+
return new Name(listOf_0(name.n1q()));
|
|
1221
1243
|
}
|
|
1222
1244
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(it) {
|
|
1223
1245
|
return it;
|
|
@@ -1226,20 +1248,20 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1226
1248
|
return function (stmt, tr) {
|
|
1227
1249
|
var tmp;
|
|
1228
1250
|
if (stmt instanceof ConstructorStatement) {
|
|
1229
|
-
var tmp_0 = tr.
|
|
1251
|
+
var tmp_0 = tr.v1y(stmt.p1r_1);
|
|
1230
1252
|
// Inline function 'kotlin.collections.map' call
|
|
1231
|
-
var this_0 = stmt.
|
|
1253
|
+
var this_0 = stmt.q1r_1;
|
|
1232
1254
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1233
|
-
var destination = ArrayList_init_$Create$_0(this_0.
|
|
1255
|
+
var destination = ArrayList_init_$Create$_0(this_0.b1());
|
|
1234
1256
|
// Inline function 'kotlin.collections.iterator' call
|
|
1235
|
-
var _iterator__ex2g4s = this_0.
|
|
1257
|
+
var _iterator__ex2g4s = this_0.l1().t();
|
|
1236
1258
|
while (_iterator__ex2g4s.u()) {
|
|
1237
1259
|
var item = _iterator__ex2g4s.v();
|
|
1238
1260
|
// Inline function 'kotlin.collections.component1' call
|
|
1239
|
-
var k = item.
|
|
1261
|
+
var k = item.m1();
|
|
1240
1262
|
// Inline function 'kotlin.collections.component2' call
|
|
1241
|
-
var v = item.
|
|
1242
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.
|
|
1263
|
+
var v = item.n1();
|
|
1264
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.y1y(v));
|
|
1243
1265
|
destination.x(tmp$ret$3);
|
|
1244
1266
|
}
|
|
1245
1267
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
@@ -1251,7 +1273,7 @@ function PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1251
1273
|
}
|
|
1252
1274
|
function PythonIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1253
1275
|
return function () {
|
|
1254
|
-
var tmp = Companion_getInstance_1().
|
|
1276
|
+
var tmp = Companion_getInstance_1().d23_1;
|
|
1255
1277
|
var tmp_0 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1256
1278
|
var tmp_1 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_0;
|
|
1257
1279
|
var tmp_2 = PythonIrEmitter$sanitizationConfig$delegate$lambda$lambda_1;
|
|
@@ -1271,7 +1293,40 @@ function PythonIrEmitter$emit$lambda(a, b) {
|
|
|
1271
1293
|
return compareValues(tmp, tmp$ret$1);
|
|
1272
1294
|
}
|
|
1273
1295
|
function emit$emitInitImport(this$0, def) {
|
|
1274
|
-
return import_0('.' + sanitize_0(this$0, def.
|
|
1296
|
+
return import_0('.' + sanitize_0(this$0, def.lv()), sanitize_0(this$0, def.lv()));
|
|
1297
|
+
}
|
|
1298
|
+
function PythonIrEmitter$emitGenerator$lambda(it) {
|
|
1299
|
+
return startsWith(it, 'Wirespec.') || it === 'Wirespec';
|
|
1300
|
+
}
|
|
1301
|
+
function PythonIrEmitter$emitGenerator$lambda_0($generatorOwnName) {
|
|
1302
|
+
return function (it) {
|
|
1303
|
+
return it === $generatorOwnName;
|
|
1304
|
+
};
|
|
1305
|
+
}
|
|
1306
|
+
function PythonIrEmitter$emitGenerator$lambda_1(it) {
|
|
1307
|
+
return substringBefore(it, _Char___init__impl__6a9atx(60));
|
|
1308
|
+
}
|
|
1309
|
+
function PythonIrEmitter$emitGenerator$lambda_2($generatorOwnName, $generatorRefs) {
|
|
1310
|
+
return function (expr, t) {
|
|
1311
|
+
var tmp;
|
|
1312
|
+
var tmp_0;
|
|
1313
|
+
var tmp_1;
|
|
1314
|
+
if (expr instanceof RawExpression) {
|
|
1315
|
+
tmp_1 = endsWith(expr.j1t_1, 'Generator');
|
|
1316
|
+
} else {
|
|
1317
|
+
tmp_1 = false;
|
|
1318
|
+
}
|
|
1319
|
+
if (tmp_1) {
|
|
1320
|
+
tmp_0 = !(expr.j1t_1 === $generatorOwnName);
|
|
1321
|
+
} else {
|
|
1322
|
+
tmp_0 = false;
|
|
1323
|
+
}
|
|
1324
|
+
if (tmp_0) {
|
|
1325
|
+
$generatorRefs.x(expr.j1t_1);
|
|
1326
|
+
tmp = Unit_instance;
|
|
1327
|
+
}
|
|
1328
|
+
return transformChildren_0(expr, t);
|
|
1329
|
+
};
|
|
1275
1330
|
}
|
|
1276
1331
|
function PythonIrEmitter$emit$lambda_0(this$0) {
|
|
1277
1332
|
return function (it) {
|
|
@@ -1280,43 +1335,43 @@ function PythonIrEmitter$emit$lambda_0(this$0) {
|
|
|
1280
1335
|
}
|
|
1281
1336
|
function PythonIrEmitter(packageName, emitShared) {
|
|
1282
1337
|
Companion_getInstance_1();
|
|
1283
|
-
packageName = packageName === VOID ? Companion_instance.
|
|
1284
|
-
emitShared = emitShared === VOID ? Companion_instance_0.
|
|
1285
|
-
this.
|
|
1286
|
-
this.
|
|
1287
|
-
this.
|
|
1288
|
-
this.
|
|
1338
|
+
packageName = packageName === VOID ? Companion_instance.bw('community.flock.wirespec.generated') : packageName;
|
|
1339
|
+
emitShared = emitShared === VOID ? Companion_instance_0.ws() : emitShared;
|
|
1340
|
+
this.x22_1 = packageName;
|
|
1341
|
+
this.y22_1 = emitShared;
|
|
1342
|
+
this.z22_1 = PythonGenerator_instance;
|
|
1343
|
+
this.a23_1 = FileExtension_Python_getInstance();
|
|
1289
1344
|
var tmp = this;
|
|
1290
|
-
tmp.
|
|
1291
|
-
this.
|
|
1345
|
+
tmp.b23_1 = lazy(PythonIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1346
|
+
this.c23_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";
|
|
1292
1347
|
}
|
|
1293
|
-
protoOf(PythonIrEmitter).
|
|
1294
|
-
return this.
|
|
1348
|
+
protoOf(PythonIrEmitter).q1z = function () {
|
|
1349
|
+
return this.z22_1;
|
|
1295
1350
|
};
|
|
1296
|
-
protoOf(PythonIrEmitter).
|
|
1297
|
-
return this.
|
|
1351
|
+
protoOf(PythonIrEmitter).uu = function () {
|
|
1352
|
+
return this.a23_1;
|
|
1298
1353
|
};
|
|
1299
|
-
protoOf(PythonIrEmitter).
|
|
1300
|
-
var source = convert(Companion_instance.
|
|
1354
|
+
protoOf(PythonIrEmitter).t1z = function () {
|
|
1355
|
+
var source = replaceReflectInNonGenericStructFields(convert(Companion_instance.bw('shared')));
|
|
1301
1356
|
var tmp;
|
|
1302
|
-
if (this.
|
|
1303
|
-
tmp = new File(Companion_getInstance().
|
|
1357
|
+
if (this.y22_1.xs_1) {
|
|
1358
|
+
tmp = new File(Companion_getInstance().m1l(this.x22_1.ew() + 'wirespec'), listOf_0(raw(this.c23_1 + PythonGenerator_instance.r1z(source))));
|
|
1304
1359
|
} else {
|
|
1305
1360
|
tmp = null;
|
|
1306
1361
|
}
|
|
1307
1362
|
return tmp;
|
|
1308
1363
|
};
|
|
1309
|
-
protoOf(PythonIrEmitter).
|
|
1364
|
+
protoOf(PythonIrEmitter).s1z = function (module_0, logger) {
|
|
1310
1365
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
1311
|
-
var this_0 = new NonEmptyList(module_0.
|
|
1366
|
+
var this_0 = new NonEmptyList(module_0.tu_1);
|
|
1312
1367
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
1313
1368
|
var tmp = PythonIrEmitter$emit$lambda;
|
|
1314
1369
|
var tmp$ret$0 = new sam$kotlin_Comparator$0_0(tmp);
|
|
1315
1370
|
var tmp$ret$1 = sortedWith(this_0, tmp$ret$0);
|
|
1316
1371
|
var tmp_0 = toNonEmptyListOrNull(tmp$ret$1);
|
|
1317
|
-
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).
|
|
1318
|
-
var emitted = emit.call(this, module_0.
|
|
1319
|
-
var tmp0 = new NonEmptyList(module_0.
|
|
1372
|
+
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).oq_1;
|
|
1373
|
+
var emitted = emit.call(this, module_0.lz(VOID, statements), logger);
|
|
1374
|
+
var tmp0 = new NonEmptyList(module_0.tu_1);
|
|
1320
1375
|
var tmp$ret$2;
|
|
1321
1376
|
$l$block_0: {
|
|
1322
1377
|
// Inline function 'kotlin.collections.any' call
|
|
@@ -1341,7 +1396,7 @@ protoOf(PythonIrEmitter).l1u = function (module_0, logger) {
|
|
|
1341
1396
|
tmp$ret$2 = false;
|
|
1342
1397
|
}
|
|
1343
1398
|
var hasEndpoints = tmp$ret$2;
|
|
1344
|
-
var tmp_2 = Companion_getInstance().
|
|
1399
|
+
var tmp_2 = Companion_getInstance().m1l(this.x22_1.ew() + '__init__');
|
|
1345
1400
|
// Inline function 'kotlin.collections.buildList' call
|
|
1346
1401
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1347
1402
|
// Inline function 'kotlin.apply' call
|
|
@@ -1352,11 +1407,11 @@ protoOf(PythonIrEmitter).l1u = function (module_0, logger) {
|
|
|
1352
1407
|
this_1.x(import_0('.', 'client'));
|
|
1353
1408
|
}
|
|
1354
1409
|
this_1.x(import_0('.', 'wirespec'));
|
|
1355
|
-
var tmp$ret$7 = this_1.
|
|
1410
|
+
var tmp$ret$7 = this_1.u5();
|
|
1356
1411
|
var init = new File(tmp_2, tmp$ret$7);
|
|
1357
|
-
var tmp_3 = Companion_getInstance().
|
|
1412
|
+
var tmp_3 = Companion_getInstance().m1l(this.x22_1.ew() + 'endpoint/' + '__init__');
|
|
1358
1413
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1359
|
-
var tmp0_0 = new NonEmptyList(module_0.
|
|
1414
|
+
var tmp0_0 = new NonEmptyList(module_0.tu_1);
|
|
1360
1415
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1361
1416
|
var destination = ArrayList_init_$Create$();
|
|
1362
1417
|
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
@@ -1376,9 +1431,9 @@ protoOf(PythonIrEmitter).l1u = function (module_0, logger) {
|
|
|
1376
1431
|
destination_0.x(tmp$ret$10);
|
|
1377
1432
|
}
|
|
1378
1433
|
var initEndpoint = new File(tmp_3, destination_0);
|
|
1379
|
-
var tmp_4 = Companion_getInstance().
|
|
1434
|
+
var tmp_4 = Companion_getInstance().m1l(this.x22_1.ew() + 'model/' + '__init__');
|
|
1380
1435
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1381
|
-
var tmp0_1 = new NonEmptyList(module_0.
|
|
1436
|
+
var tmp0_1 = new NonEmptyList(module_0.tu_1);
|
|
1382
1437
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1383
1438
|
var destination_1 = ArrayList_init_$Create$();
|
|
1384
1439
|
var _iterator__ex2g4s_2 = tmp0_1.t();
|
|
@@ -1398,8 +1453,8 @@ protoOf(PythonIrEmitter).l1u = function (module_0, logger) {
|
|
|
1398
1453
|
destination_2.x(tmp$ret$15);
|
|
1399
1454
|
}
|
|
1400
1455
|
var initModel = new File(tmp_4, destination_2);
|
|
1401
|
-
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().
|
|
1402
|
-
var tmp0_2 = dropLast(split(this.
|
|
1456
|
+
var initClient = hasEndpoints ? listOf_0(new File(Companion_getInstance().m1l(this.x22_1.ew() + 'client/' + '__init__'), emptyList())) : emptyList();
|
|
1457
|
+
var tmp0_2 = dropLast(split(this.x22_1.cw_1, ['.']), 1);
|
|
1403
1458
|
var tmp$ret$18;
|
|
1404
1459
|
$l$block_1: {
|
|
1405
1460
|
// Inline function 'kotlin.collections.runningFold' call
|
|
@@ -1436,17 +1491,93 @@ protoOf(PythonIrEmitter).l1u = function (module_0, logger) {
|
|
|
1436
1491
|
var _iterator__ex2g4s_5 = this_3.t();
|
|
1437
1492
|
while (_iterator__ex2g4s_5.u()) {
|
|
1438
1493
|
var item_1 = _iterator__ex2g4s_5.v();
|
|
1439
|
-
var tmp$ret$23 = new File(Companion_getInstance().
|
|
1494
|
+
var tmp$ret$23 = new File(Companion_getInstance().m1l(item_1 + '/__init__'), emptyList());
|
|
1440
1495
|
destination_3.x(tmp$ret$23);
|
|
1441
1496
|
}
|
|
1442
1497
|
var parentInits = destination_3;
|
|
1443
|
-
return this.
|
|
1498
|
+
return this.y22_1.xs_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);
|
|
1444
1499
|
};
|
|
1445
|
-
protoOf(PythonIrEmitter).
|
|
1500
|
+
protoOf(PythonIrEmitter).kv = function (definition, module_0, logger) {
|
|
1446
1501
|
var file = emit_0.call(this, definition, module_0, logger);
|
|
1447
|
-
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.
|
|
1502
|
+
return placeInModule(prependImports(file, buildImports(this, '..wirespec')), this.x22_1, definition);
|
|
1503
|
+
};
|
|
1504
|
+
protoOf(PythonIrEmitter).x1z = function (definition, module_0) {
|
|
1505
|
+
var tmp;
|
|
1506
|
+
if (definition instanceof Type) {
|
|
1507
|
+
tmp = convertToGenerator_2(definition, module_0);
|
|
1508
|
+
} else {
|
|
1509
|
+
if (definition instanceof Enum) {
|
|
1510
|
+
tmp = convertToGenerator_1(definition);
|
|
1511
|
+
} else {
|
|
1512
|
+
if (definition instanceof Refined) {
|
|
1513
|
+
tmp = convertToGenerator_0(definition);
|
|
1514
|
+
} else {
|
|
1515
|
+
if (definition instanceof Union) {
|
|
1516
|
+
tmp = convertToGenerator(definition);
|
|
1517
|
+
} else {
|
|
1518
|
+
return null;
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
var generatorFile = tmp;
|
|
1524
|
+
var sanitized = sanitizeNames(generatorFile, _get_sanitizationConfig__sns434(this));
|
|
1525
|
+
var generatorOwnName = definition.lv().n1() + 'Generator';
|
|
1526
|
+
var tmp_0 = asSequence(collectCustomTypeNames(sanitized));
|
|
1527
|
+
var tmp_1 = filterNot(tmp_0, PythonIrEmitter$emitGenerator$lambda);
|
|
1528
|
+
var tmp_2 = filterNot(tmp_1, PythonIrEmitter$emitGenerator$lambda_0(generatorOwnName));
|
|
1529
|
+
var customNames = toList(distinct(map(tmp_2, PythonIrEmitter$emitGenerator$lambda_1)));
|
|
1530
|
+
// Inline function 'kotlin.collections.mutableSetOf' call
|
|
1531
|
+
var generatorRefs = LinkedHashSet_init_$Create$();
|
|
1532
|
+
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1533
|
+
var scope = new TransformScope(sanitized);
|
|
1534
|
+
scope.l1z(PythonIrEmitter$emitGenerator$lambda_2(generatorOwnName, generatorRefs));
|
|
1535
|
+
var tmp_3 = scope.d1z_1;
|
|
1536
|
+
isInterface(tmp_3, Element) || THROW_CCE();
|
|
1537
|
+
// Inline function 'kotlin.collections.filter' call
|
|
1538
|
+
// Inline function 'kotlin.collections.filterTo' call
|
|
1539
|
+
var destination = ArrayList_init_$Create$();
|
|
1540
|
+
var _iterator__ex2g4s = customNames.t();
|
|
1541
|
+
while (_iterator__ex2g4s.u()) {
|
|
1542
|
+
var element = _iterator__ex2g4s.v();
|
|
1543
|
+
if (endsWith(element, 'Generator')) {
|
|
1544
|
+
destination.x(element);
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
// Inline function 'kotlin.collections.map' call
|
|
1548
|
+
var this_0 = distinct_0(plus(destination, generatorRefs));
|
|
1549
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1550
|
+
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1551
|
+
var _iterator__ex2g4s_0 = this_0.t();
|
|
1552
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
1553
|
+
var item = _iterator__ex2g4s_0.v();
|
|
1554
|
+
var tmp$ret$6 = import_0('.' + item, item);
|
|
1555
|
+
destination_0.x(tmp$ret$6);
|
|
1556
|
+
}
|
|
1557
|
+
var generatorImports = destination_0;
|
|
1558
|
+
// Inline function 'kotlin.collections.filterNot' call
|
|
1559
|
+
// Inline function 'kotlin.collections.filterNotTo' call
|
|
1560
|
+
var destination_1 = ArrayList_init_$Create$();
|
|
1561
|
+
var _iterator__ex2g4s_1 = customNames.t();
|
|
1562
|
+
while (_iterator__ex2g4s_1.u()) {
|
|
1563
|
+
var element_0 = _iterator__ex2g4s_1.v();
|
|
1564
|
+
if (!endsWith(element_0, 'Generator')) {
|
|
1565
|
+
destination_1.x(element_0);
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
// Inline function 'kotlin.collections.map' call
|
|
1569
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1570
|
+
var destination_2 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_1, 10));
|
|
1571
|
+
var _iterator__ex2g4s_2 = destination_1.t();
|
|
1572
|
+
while (_iterator__ex2g4s_2.u()) {
|
|
1573
|
+
var item_0 = _iterator__ex2g4s_2.v();
|
|
1574
|
+
var tmp$ret$12 = import_0('..model.' + item_0, item_0);
|
|
1575
|
+
destination_2.x(tmp$ret$12);
|
|
1576
|
+
}
|
|
1577
|
+
var modelImports = destination_2;
|
|
1578
|
+
return placeInModule_0(prependImports(sanitized, plus(plus(buildImports(this, '..wirespec'), modelImports), generatorImports)), this.x22_1, 'generator');
|
|
1448
1579
|
};
|
|
1449
|
-
protoOf(PythonIrEmitter).
|
|
1580
|
+
protoOf(PythonIrEmitter).ku = function (type, module_0) {
|
|
1450
1581
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1451
1582
|
var this_0 = importReferences(type);
|
|
1452
1583
|
var set = HashSet_init_$Create$();
|
|
@@ -1454,7 +1585,7 @@ protoOf(PythonIrEmitter).up = function (type, module_0) {
|
|
|
1454
1585
|
var _iterator__ex2g4s = this_0.t();
|
|
1455
1586
|
while (_iterator__ex2g4s.u()) {
|
|
1456
1587
|
var e = _iterator__ex2g4s.v();
|
|
1457
|
-
var key = e.
|
|
1588
|
+
var key = e.az_1;
|
|
1458
1589
|
if (set.x(key)) {
|
|
1459
1590
|
list.x(e);
|
|
1460
1591
|
}
|
|
@@ -1465,18 +1596,18 @@ protoOf(PythonIrEmitter).up = function (type, module_0) {
|
|
|
1465
1596
|
var _iterator__ex2g4s_0 = list.t();
|
|
1466
1597
|
while (_iterator__ex2g4s_0.u()) {
|
|
1467
1598
|
var item = _iterator__ex2g4s_0.v();
|
|
1468
|
-
var tmp$ret$2 = import_0('.' + item.
|
|
1599
|
+
var tmp$ret$2 = import_0('.' + item.az_1, item.az_1);
|
|
1469
1600
|
destination.x(tmp$ret$2);
|
|
1470
1601
|
}
|
|
1471
1602
|
var typeImports = destination;
|
|
1472
1603
|
// Inline function 'kotlin.collections.map' call
|
|
1473
|
-
var this_1 = type.
|
|
1604
|
+
var this_1 = type.mt_1.it_1;
|
|
1474
1605
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1475
1606
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1476
1607
|
var _iterator__ex2g4s_1 = this_1.t();
|
|
1477
1608
|
while (_iterator__ex2g4s_1.u()) {
|
|
1478
1609
|
var item_0 = _iterator__ex2g4s_1.v();
|
|
1479
|
-
var tmp$ret$5 = item_0.
|
|
1610
|
+
var tmp$ret$5 = item_0.qt_1.n1();
|
|
1480
1611
|
destination_0.x(tmp$ret$5);
|
|
1481
1612
|
}
|
|
1482
1613
|
var fieldNames = toSet(destination_0);
|
|
@@ -1492,17 +1623,17 @@ protoOf(PythonIrEmitter).up = function (type, module_0) {
|
|
|
1492
1623
|
var tmp$ret$10 = tmp_0;
|
|
1493
1624
|
return prependImports(tmp, tmp$ret$10);
|
|
1494
1625
|
};
|
|
1495
|
-
protoOf(PythonIrEmitter).
|
|
1626
|
+
protoOf(PythonIrEmitter).yv = function (enum_0, module_0) {
|
|
1496
1627
|
var tmp = convert_0(enum_0);
|
|
1497
1628
|
return sanitizeNames(sanitizeEnumEntries(tmp, PythonIrEmitter$emit$lambda_0(this)), _get_sanitizationConfig__sns434(this));
|
|
1498
1629
|
};
|
|
1499
|
-
protoOf(PythonIrEmitter).
|
|
1630
|
+
protoOf(PythonIrEmitter).ov = function (union) {
|
|
1500
1631
|
return sanitizeNames(convert_1(union), _get_sanitizationConfig__sns434(this));
|
|
1501
1632
|
};
|
|
1502
|
-
protoOf(PythonIrEmitter).
|
|
1633
|
+
protoOf(PythonIrEmitter).tv = function (refined) {
|
|
1503
1634
|
return sanitizeNames(replaceRefinedFunctions(convert_2(refined), refined), _get_sanitizationConfig__sns434(this));
|
|
1504
1635
|
};
|
|
1505
|
-
protoOf(PythonIrEmitter).
|
|
1636
|
+
protoOf(PythonIrEmitter).zv = function (endpoint) {
|
|
1506
1637
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1507
1638
|
var this_0 = importReferences(endpoint);
|
|
1508
1639
|
var set = HashSet_init_$Create$();
|
|
@@ -1510,7 +1641,7 @@ protoOf(PythonIrEmitter).jr = function (endpoint) {
|
|
|
1510
1641
|
var _iterator__ex2g4s = this_0.t();
|
|
1511
1642
|
while (_iterator__ex2g4s.u()) {
|
|
1512
1643
|
var e = _iterator__ex2g4s.v();
|
|
1513
|
-
var key = e.
|
|
1644
|
+
var key = e.az_1;
|
|
1514
1645
|
if (set.x(key)) {
|
|
1515
1646
|
list.x(e);
|
|
1516
1647
|
}
|
|
@@ -1521,19 +1652,19 @@ protoOf(PythonIrEmitter).jr = function (endpoint) {
|
|
|
1521
1652
|
var _iterator__ex2g4s_0 = list.t();
|
|
1522
1653
|
while (_iterator__ex2g4s_0.u()) {
|
|
1523
1654
|
var item = _iterator__ex2g4s_0.v();
|
|
1524
|
-
var tmp$ret$2 = import_0('..model.' + item.
|
|
1655
|
+
var tmp$ret$2 = import_0('..model.' + item.az_1, item.az_1);
|
|
1525
1656
|
destination.x(tmp$ret$2);
|
|
1526
1657
|
}
|
|
1527
1658
|
var endpointImports = destination;
|
|
1528
1659
|
// Inline function 'kotlin.let' call
|
|
1529
1660
|
var it = splitEndpointStructsToModuleLevel(convert_3(endpoint));
|
|
1530
|
-
var tmp$ret$6 = it.
|
|
1661
|
+
var tmp$ret$6 = it.w1r(VOID, plus(endpointImports, it.t1r_1));
|
|
1531
1662
|
return sanitizeNames(snakeCaseHandlerAndCallMethods(tmp$ret$6), _get_sanitizationConfig__sns434(this));
|
|
1532
1663
|
};
|
|
1533
|
-
protoOf(PythonIrEmitter).
|
|
1664
|
+
protoOf(PythonIrEmitter).nv = function (channel) {
|
|
1534
1665
|
return sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1535
1666
|
};
|
|
1536
|
-
protoOf(PythonIrEmitter).
|
|
1667
|
+
protoOf(PythonIrEmitter).w1z = function (endpoint) {
|
|
1537
1668
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
1538
1669
|
var this_0 = importReferences(endpoint);
|
|
1539
1670
|
var set = HashSet_init_$Create$();
|
|
@@ -1541,7 +1672,7 @@ protoOf(PythonIrEmitter).o1u = function (endpoint) {
|
|
|
1541
1672
|
var _iterator__ex2g4s = this_0.t();
|
|
1542
1673
|
while (_iterator__ex2g4s.u()) {
|
|
1543
1674
|
var e = _iterator__ex2g4s.v();
|
|
1544
|
-
var key = e.
|
|
1675
|
+
var key = e.az_1;
|
|
1545
1676
|
if (set.x(key)) {
|
|
1546
1677
|
list.x(e);
|
|
1547
1678
|
}
|
|
@@ -1552,17 +1683,17 @@ protoOf(PythonIrEmitter).o1u = function (endpoint) {
|
|
|
1552
1683
|
var _iterator__ex2g4s_0 = list.t();
|
|
1553
1684
|
while (_iterator__ex2g4s_0.u()) {
|
|
1554
1685
|
var item = _iterator__ex2g4s_0.v();
|
|
1555
|
-
var tmp$ret$2 = import_0('..model.' + item.
|
|
1686
|
+
var tmp$ret$2 = import_0('..model.' + item.az_1, item.az_1);
|
|
1556
1687
|
destination.x(tmp$ret$2);
|
|
1557
1688
|
}
|
|
1558
1689
|
var modelImports = destination;
|
|
1559
|
-
var endpointImport = import_0('..endpoint.' + endpoint.
|
|
1560
|
-
var endpointName = endpoint.
|
|
1690
|
+
var endpointImport = import_0('..endpoint.' + endpoint.ut_1.n1(), '*');
|
|
1691
|
+
var endpointName = endpoint.ut_1.n1();
|
|
1561
1692
|
var file = flattenEndpointTypeRefs(snakeCaseClientFunctions(addSelfReceiverToClientFields(sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this)))), endpointName);
|
|
1562
|
-
var subPackageName = plus_2(this.
|
|
1563
|
-
return new File(Companion_getInstance().
|
|
1693
|
+
var subPackageName = plus_2(this.x22_1, 'client');
|
|
1694
|
+
return new File(Companion_getInstance().m1l(subPackageName.ew() + file.s1r_1.t1q()), plus(plus(plus(buildImports(this, '..wirespec'), modelImports), listOf_0(endpointImport)), file.t1r_1));
|
|
1564
1695
|
};
|
|
1565
|
-
protoOf(PythonIrEmitter).
|
|
1696
|
+
protoOf(PythonIrEmitter).u1z = function (endpoints, logger) {
|
|
1566
1697
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1567
1698
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1568
1699
|
var destination = ArrayList_init_$Create$();
|
|
@@ -1578,7 +1709,7 @@ protoOf(PythonIrEmitter).n1u = function (endpoints, logger) {
|
|
|
1578
1709
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1579
1710
|
while (_iterator__ex2g4s_0.u()) {
|
|
1580
1711
|
var e = _iterator__ex2g4s_0.v();
|
|
1581
|
-
var key = e.
|
|
1712
|
+
var key = e.az_1;
|
|
1582
1713
|
if (set.x(key)) {
|
|
1583
1714
|
list_0.x(e);
|
|
1584
1715
|
}
|
|
@@ -1589,7 +1720,7 @@ protoOf(PythonIrEmitter).n1u = function (endpoints, logger) {
|
|
|
1589
1720
|
var _iterator__ex2g4s_1 = list_0.t();
|
|
1590
1721
|
while (_iterator__ex2g4s_1.u()) {
|
|
1591
1722
|
var item = _iterator__ex2g4s_1.v();
|
|
1592
|
-
var tmp$ret$5 = import_0('.model.' + item.
|
|
1723
|
+
var tmp$ret$5 = import_0('.model.' + item.az_1, item.az_1);
|
|
1593
1724
|
destination_0.x(tmp$ret$5);
|
|
1594
1725
|
}
|
|
1595
1726
|
var modelImports = destination_0;
|
|
@@ -1599,7 +1730,7 @@ protoOf(PythonIrEmitter).n1u = function (endpoints, logger) {
|
|
|
1599
1730
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1600
1731
|
while (_iterator__ex2g4s_2.u()) {
|
|
1601
1732
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
1602
|
-
var tmp$ret$8 = import_0('.endpoint.' + item_0.
|
|
1733
|
+
var tmp$ret$8 = import_0('.endpoint.' + item_0.ut_1.n1(), '*');
|
|
1603
1734
|
destination_1.x(tmp$ret$8);
|
|
1604
1735
|
}
|
|
1605
1736
|
var endpointImports = destination_1;
|
|
@@ -1609,7 +1740,7 @@ protoOf(PythonIrEmitter).n1u = function (endpoints, logger) {
|
|
|
1609
1740
|
var _iterator__ex2g4s_3 = endpoints.t();
|
|
1610
1741
|
while (_iterator__ex2g4s_3.u()) {
|
|
1611
1742
|
var item_1 = _iterator__ex2g4s_3.v();
|
|
1612
|
-
var tmp$ret$11 = import_0('.client.' + item_1.
|
|
1743
|
+
var tmp$ret$11 = import_0('.client.' + item_1.ut_1.n1() + 'Client', item_1.ut_1.n1() + 'Client');
|
|
1613
1744
|
destination_2.x(tmp$ret$11);
|
|
1614
1745
|
}
|
|
1615
1746
|
var clientImports = destination_2;
|
|
@@ -1620,7 +1751,7 @@ protoOf(PythonIrEmitter).n1u = function (endpoints, logger) {
|
|
|
1620
1751
|
var _iterator__ex2g4s_4 = endpoints.t();
|
|
1621
1752
|
while (_iterator__ex2g4s_4.u()) {
|
|
1622
1753
|
var item_2 = _iterator__ex2g4s_4.v();
|
|
1623
|
-
var tmp$ret$14 = item_2.
|
|
1754
|
+
var tmp$ret$14 = item_2.ut_1.n1();
|
|
1624
1755
|
destination_3.x(tmp$ret$14);
|
|
1625
1756
|
}
|
|
1626
1757
|
var endpointNames = destination_3;
|
|
@@ -1634,22 +1765,38 @@ protoOf(PythonIrEmitter).n1u = function (endpoints, logger) {
|
|
|
1634
1765
|
accumulator = flattenEndpointTypeRefs(acc, element_0);
|
|
1635
1766
|
}
|
|
1636
1767
|
var file = accumulator;
|
|
1637
|
-
return new File(Companion_getInstance().
|
|
1768
|
+
return new File(Companion_getInstance().m1l(this.x22_1.ew() + file.s1r_1.t1q()), plus(plus(buildImports(this, '.wirespec'), allImports), file.t1r_1));
|
|
1638
1769
|
};
|
|
1770
|
+
function replaceReflectInNonGenericStructFields(_this__u8e3s4) {
|
|
1771
|
+
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1772
|
+
var scope = new TransformScope(_this__u8e3s4);
|
|
1773
|
+
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1774
|
+
var tmp = scope;
|
|
1775
|
+
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1776
|
+
var this_0 = scope.d1z_1;
|
|
1777
|
+
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1778
|
+
// Inline function 'kotlin.apply' call
|
|
1779
|
+
var this_1 = new TransformerBuilder();
|
|
1780
|
+
this_1.v1m(replaceReflectInNonGenericStructFields$lambda);
|
|
1781
|
+
var tmp$ret$2 = this_1.w1m();
|
|
1782
|
+
tmp.d1z_1 = transform(this_0, tmp$ret$2);
|
|
1783
|
+
var tmp_0 = scope.d1z_1;
|
|
1784
|
+
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1785
|
+
}
|
|
1639
1786
|
function replaceRefinedFunctions(_this__u8e3s4, refined) {
|
|
1640
1787
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1641
1788
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1642
1789
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1643
1790
|
var tmp = scope;
|
|
1644
1791
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1645
|
-
var this_0 = scope.
|
|
1792
|
+
var this_0 = scope.d1z_1;
|
|
1646
1793
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1647
1794
|
// Inline function 'kotlin.apply' call
|
|
1648
1795
|
var this_1 = new TransformerBuilder();
|
|
1649
|
-
this_1.
|
|
1650
|
-
var tmp$ret$2 = this_1.
|
|
1651
|
-
tmp.
|
|
1652
|
-
var tmp_0 = scope.
|
|
1796
|
+
this_1.v1m(replaceRefinedFunctions$lambda(refined));
|
|
1797
|
+
var tmp$ret$2 = this_1.w1m();
|
|
1798
|
+
tmp.d1z_1 = transform(this_0, tmp$ret$2);
|
|
1799
|
+
var tmp_0 = scope.d1z_1;
|
|
1653
1800
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1654
1801
|
}
|
|
1655
1802
|
function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
@@ -1658,20 +1805,20 @@ function snakeCaseHandlerAndCallMethods(_this__u8e3s4) {
|
|
|
1658
1805
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1659
1806
|
var tmp = scope;
|
|
1660
1807
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1661
|
-
var this_0 = scope.
|
|
1808
|
+
var this_0 = scope.d1z_1;
|
|
1662
1809
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1663
1810
|
// Inline function 'kotlin.apply' call
|
|
1664
1811
|
var this_1 = new TransformerBuilder();
|
|
1665
|
-
this_1.
|
|
1666
|
-
var tmp$ret$2 = this_1.
|
|
1667
|
-
tmp.
|
|
1668
|
-
var tmp_0 = scope.
|
|
1812
|
+
this_1.v1m(snakeCaseHandlerAndCallMethods$lambda);
|
|
1813
|
+
var tmp$ret$2 = this_1.w1m();
|
|
1814
|
+
tmp.d1z_1 = transform(this_0, tmp$ret$2);
|
|
1815
|
+
var tmp_0 = scope.d1z_1;
|
|
1669
1816
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1670
1817
|
}
|
|
1671
1818
|
function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
1672
1819
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1673
1820
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1674
|
-
var tmp0 = _this__u8e3s4.
|
|
1821
|
+
var tmp0 = _this__u8e3s4.u1r();
|
|
1675
1822
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1676
1823
|
var destination = ArrayList_init_$Create$();
|
|
1677
1824
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1685,7 +1832,7 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1685
1832
|
var namespace = ensureNotNull(tmp$ret$2);
|
|
1686
1833
|
var flattened = flattenNestedStructs(namespace);
|
|
1687
1834
|
// Inline function 'kotlin.collections.partition' call
|
|
1688
|
-
var this_0 = flattened.
|
|
1835
|
+
var this_0 = flattened.z1r_1;
|
|
1689
1836
|
var first = ArrayList_init_$Create$();
|
|
1690
1837
|
var second = ArrayList_init_$Create$();
|
|
1691
1838
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
@@ -1704,16 +1851,16 @@ function splitEndpointStructsToModuleLevel(_this__u8e3s4) {
|
|
|
1704
1851
|
}
|
|
1705
1852
|
}
|
|
1706
1853
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
1707
|
-
var moduleElements = _destruct__k2r9zo.
|
|
1708
|
-
var classElements = _destruct__k2r9zo.
|
|
1709
|
-
var endpointClass = new Namespace(namespace.
|
|
1710
|
-
return new File(namespace.
|
|
1854
|
+
var moduleElements = _destruct__k2r9zo.pf();
|
|
1855
|
+
var classElements = _destruct__k2r9zo.qf();
|
|
1856
|
+
var endpointClass = new Namespace(namespace.y1r_1, classElements, namespace.a1s_1);
|
|
1857
|
+
return new File(namespace.y1r_1, plus_0(moduleElements, endpointClass));
|
|
1711
1858
|
}
|
|
1712
1859
|
function flattenEndpointTypeRefs(_this__u8e3s4, endpointName) {
|
|
1713
1860
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1714
1861
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1715
|
-
scope.
|
|
1716
|
-
var tmp = scope.
|
|
1862
|
+
scope.j1z(flattenEndpointTypeRefs$lambda(endpointName));
|
|
1863
|
+
var tmp = scope.d1z_1;
|
|
1717
1864
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1718
1865
|
}
|
|
1719
1866
|
function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
@@ -1722,15 +1869,15 @@ function snakeCaseClientFunctions(_this__u8e3s4) {
|
|
|
1722
1869
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1723
1870
|
var tmp = scope;
|
|
1724
1871
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1725
|
-
var this_0 = scope.
|
|
1872
|
+
var this_0 = scope.d1z_1;
|
|
1726
1873
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1727
1874
|
// Inline function 'kotlin.apply' call
|
|
1728
1875
|
var this_1 = new TransformerBuilder();
|
|
1729
|
-
this_1.
|
|
1730
|
-
var tmp$ret$2 = this_1.
|
|
1731
|
-
tmp.
|
|
1732
|
-
scope.
|
|
1733
|
-
var tmp_0 = scope.
|
|
1876
|
+
this_1.v1m(snakeCaseClientFunctions$lambda);
|
|
1877
|
+
var tmp$ret$2 = this_1.w1m();
|
|
1878
|
+
tmp.d1z_1 = transform(this_0, tmp$ret$2);
|
|
1879
|
+
scope.m1z(snakeCaseClientFunctions$lambda_0);
|
|
1880
|
+
var tmp_0 = scope.d1z_1;
|
|
1734
1881
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1735
1882
|
}
|
|
1736
1883
|
function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
@@ -1741,7 +1888,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1741
1888
|
} else {
|
|
1742
1889
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1743
1890
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1744
|
-
var tmp0 = tmp0_safe_receiver.
|
|
1891
|
+
var tmp0 = tmp0_safe_receiver.u1r();
|
|
1745
1892
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1746
1893
|
var destination = ArrayList_init_$Create$();
|
|
1747
1894
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1754,7 +1901,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1754
1901
|
tmp = firstOrNull_0(destination);
|
|
1755
1902
|
}
|
|
1756
1903
|
var struct = tmp;
|
|
1757
|
-
var tmp2_safe_receiver = struct == null ? null : struct.
|
|
1904
|
+
var tmp2_safe_receiver = struct == null ? null : struct.e1s_1;
|
|
1758
1905
|
var tmp_0;
|
|
1759
1906
|
if (tmp2_safe_receiver == null) {
|
|
1760
1907
|
tmp_0 = null;
|
|
@@ -1765,7 +1912,7 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1765
1912
|
var _iterator__ex2g4s_0 = tmp2_safe_receiver.t();
|
|
1766
1913
|
while (_iterator__ex2g4s_0.u()) {
|
|
1767
1914
|
var item = _iterator__ex2g4s_0.v();
|
|
1768
|
-
var tmp$ret$3 = item.
|
|
1915
|
+
var tmp$ret$3 = item.z1t_1.h1n();
|
|
1769
1916
|
destination_0.x(tmp$ret$3);
|
|
1770
1917
|
}
|
|
1771
1918
|
tmp_0 = destination_0;
|
|
@@ -1777,23 +1924,73 @@ function addSelfReceiverToClientFields(_this__u8e3s4) {
|
|
|
1777
1924
|
return _this__u8e3s4;
|
|
1778
1925
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1779
1926
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1780
|
-
scope.
|
|
1781
|
-
var tmp_1 = scope.
|
|
1927
|
+
scope.m1z(addSelfReceiverToClientFields$lambda(fieldNames));
|
|
1928
|
+
var tmp_1 = scope.d1z_1;
|
|
1782
1929
|
return isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1783
1930
|
}
|
|
1931
|
+
function replaceReflectAsTypeAny(_this__u8e3s4) {
|
|
1932
|
+
var tmp;
|
|
1933
|
+
if (equals(_this__u8e3s4, Reflect_instance)) {
|
|
1934
|
+
tmp = new Custom_0('type', listOf_0(Any_instance));
|
|
1935
|
+
} else {
|
|
1936
|
+
if (_this__u8e3s4 instanceof Nullable) {
|
|
1937
|
+
tmp = _this__u8e3s4.e1r(replaceReflectAsTypeAny(_this__u8e3s4.d1n_1));
|
|
1938
|
+
} else {
|
|
1939
|
+
if (_this__u8e3s4 instanceof Array_0) {
|
|
1940
|
+
tmp = _this__u8e3s4.e1r(replaceReflectAsTypeAny(_this__u8e3s4.e1n_1));
|
|
1941
|
+
} else {
|
|
1942
|
+
if (_this__u8e3s4 instanceof Dict_0) {
|
|
1943
|
+
tmp = _this__u8e3s4.h1r(replaceReflectAsTypeAny(_this__u8e3s4.f1r_1), replaceReflectAsTypeAny(_this__u8e3s4.g1r_1));
|
|
1944
|
+
} else {
|
|
1945
|
+
tmp = _this__u8e3s4;
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
return tmp;
|
|
1951
|
+
}
|
|
1952
|
+
function replaceReflectInNonGenericStructFields$lambda(element, transformer) {
|
|
1953
|
+
var tmp;
|
|
1954
|
+
if (element instanceof Struct) {
|
|
1955
|
+
var tmp$ret$1;
|
|
1956
|
+
$l$block: {
|
|
1957
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1958
|
+
if (!element.i1s_1.r()) {
|
|
1959
|
+
tmp$ret$1 = element;
|
|
1960
|
+
break $l$block;
|
|
1961
|
+
}
|
|
1962
|
+
// Inline function 'kotlin.collections.map' call
|
|
1963
|
+
var this_0 = element.e1s_1;
|
|
1964
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1965
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1966
|
+
var _iterator__ex2g4s = this_0.t();
|
|
1967
|
+
while (_iterator__ex2g4s.u()) {
|
|
1968
|
+
var item = _iterator__ex2g4s.v();
|
|
1969
|
+
var tmp$ret$2 = item.d1u(VOID, replaceReflectAsTypeAny(item.a1u_1));
|
|
1970
|
+
destination.x(tmp$ret$2);
|
|
1971
|
+
}
|
|
1972
|
+
tmp$ret$1 = element.k1s(VOID, destination);
|
|
1973
|
+
}
|
|
1974
|
+
tmp = tmp$ret$1;
|
|
1975
|
+
} else {
|
|
1976
|
+
tmp = element;
|
|
1977
|
+
}
|
|
1978
|
+
var transformed = tmp;
|
|
1979
|
+
return transformChildren_1(transformed, transformer);
|
|
1980
|
+
}
|
|
1784
1981
|
function replaceRefinedFunctions$lambda$lambda($constraintExpr) {
|
|
1785
1982
|
return function ($this$function) {
|
|
1786
|
-
$this$function.
|
|
1787
|
-
$this$function.
|
|
1788
|
-
$this$function.
|
|
1983
|
+
$this$function.w1l('self', new Custom_0(''));
|
|
1984
|
+
$this$function.z1l(Boolean_instance_0);
|
|
1985
|
+
$this$function.a1m($constraintExpr);
|
|
1789
1986
|
return Unit_instance;
|
|
1790
1987
|
};
|
|
1791
1988
|
}
|
|
1792
1989
|
function replaceRefinedFunctions$lambda$lambda_0($toStringExpr) {
|
|
1793
1990
|
return function ($this$function) {
|
|
1794
|
-
$this$function.
|
|
1795
|
-
$this$function.
|
|
1796
|
-
$this$function.
|
|
1991
|
+
$this$function.w1l('self', new Custom_0(''));
|
|
1992
|
+
$this$function.z1l(String_instance);
|
|
1993
|
+
$this$function.a1m(new RawExpression($toStringExpr));
|
|
1797
1994
|
return Unit_instance;
|
|
1798
1995
|
};
|
|
1799
1996
|
}
|
|
@@ -1802,7 +1999,7 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
1802
1999
|
var tmp;
|
|
1803
2000
|
if (element instanceof Struct) {
|
|
1804
2001
|
// Inline function 'kotlin.collections.mapNotNull' call
|
|
1805
|
-
var tmp0 = element.
|
|
2002
|
+
var tmp0 = element.h1s_1;
|
|
1806
2003
|
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
1807
2004
|
var destination = ArrayList_init_$Create$();
|
|
1808
2005
|
// Inline function 'kotlin.collections.forEach' call
|
|
@@ -1812,23 +2009,23 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
1812
2009
|
var tmp_0;
|
|
1813
2010
|
var tmp_1;
|
|
1814
2011
|
if (element_0 instanceof Function) {
|
|
1815
|
-
tmp_1 = element_0.
|
|
2012
|
+
tmp_1 = element_0.b1p_1.equals(Companion_getInstance().m1l('validate'));
|
|
1816
2013
|
} else {
|
|
1817
2014
|
tmp_1 = false;
|
|
1818
2015
|
}
|
|
1819
2016
|
if (tmp_1) {
|
|
1820
|
-
var constraintExpr = convertConstraint($refined.
|
|
2017
|
+
var constraintExpr = convertConstraint($refined.sv_1, new FieldCall(new VariableReference(Companion_getInstance().m1l('self')), Companion_getInstance().m1l('value')));
|
|
1821
2018
|
tmp_0 = function_0('validate', VOID, VOID, replaceRefinedFunctions$lambda$lambda(constraintExpr));
|
|
1822
2019
|
} else {
|
|
1823
2020
|
var tmp_2;
|
|
1824
2021
|
if (element_0 instanceof Function) {
|
|
1825
|
-
tmp_2 = element_0.
|
|
2022
|
+
tmp_2 = element_0.b1p_1.equals(Companion_getInstance().m1l('toString'));
|
|
1826
2023
|
} else {
|
|
1827
2024
|
tmp_2 = false;
|
|
1828
2025
|
}
|
|
1829
2026
|
if (tmp_2) {
|
|
1830
2027
|
var tmp_3;
|
|
1831
|
-
if ($refined.
|
|
2028
|
+
if ($refined.sv_1.ez_1 instanceof String_0) {
|
|
1832
2029
|
tmp_3 = 'self.value';
|
|
1833
2030
|
} else {
|
|
1834
2031
|
tmp_3 = 'str(self.value)';
|
|
@@ -1847,12 +2044,12 @@ function replaceRefinedFunctions$lambda($refined) {
|
|
|
1847
2044
|
destination.x(tmp0_safe_receiver);
|
|
1848
2045
|
}
|
|
1849
2046
|
}
|
|
1850
|
-
tmp = element.
|
|
2047
|
+
tmp = element.k1s(VOID, VOID, VOID, VOID, destination);
|
|
1851
2048
|
} else {
|
|
1852
2049
|
tmp = element;
|
|
1853
2050
|
}
|
|
1854
2051
|
var transformed = tmp;
|
|
1855
|
-
return
|
|
2052
|
+
return transformChildren_1(transformed, transformer);
|
|
1856
2053
|
};
|
|
1857
2054
|
}
|
|
1858
2055
|
function snakeCaseHandlerAndCallMethods$lambda(element, transformer) {
|
|
@@ -1860,30 +2057,30 @@ function snakeCaseHandlerAndCallMethods$lambda(element, transformer) {
|
|
|
1860
2057
|
if (element instanceof Interface) {
|
|
1861
2058
|
var tmp$ret$0;
|
|
1862
2059
|
$l$block: {
|
|
1863
|
-
if (!element.
|
|
2060
|
+
if (!element.l1s_1.equals(Companion_getInstance().m1l('Handler')) && !element.l1s_1.equals(Companion_getInstance().m1l('Call'))) {
|
|
1864
2061
|
tmp$ret$0 = element;
|
|
1865
2062
|
break $l$block;
|
|
1866
2063
|
}
|
|
1867
2064
|
// Inline function 'kotlin.collections.map' call
|
|
1868
|
-
var this_0 = element.
|
|
2065
|
+
var this_0 = element.m1s_1;
|
|
1869
2066
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1870
2067
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1871
2068
|
var _iterator__ex2g4s = this_0.t();
|
|
1872
2069
|
while (_iterator__ex2g4s.u()) {
|
|
1873
2070
|
var item = _iterator__ex2g4s.v();
|
|
1874
2071
|
var tmp0_safe_receiver = item instanceof Function ? item : null;
|
|
1875
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
2072
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.j1p(Companion_getInstance().m1l(item.b1p_1.u1q()));
|
|
1876
2073
|
var tmp$ret$1 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
|
|
1877
2074
|
destination.x(tmp$ret$1);
|
|
1878
2075
|
}
|
|
1879
|
-
tmp$ret$0 = element.
|
|
2076
|
+
tmp$ret$0 = element.s1s(VOID, destination);
|
|
1880
2077
|
}
|
|
1881
2078
|
tmp = tmp$ret$0;
|
|
1882
2079
|
} else {
|
|
1883
2080
|
tmp = element;
|
|
1884
2081
|
}
|
|
1885
2082
|
var transformed = tmp;
|
|
1886
|
-
return
|
|
2083
|
+
return transformChildren_1(transformed, transformer);
|
|
1887
2084
|
}
|
|
1888
2085
|
function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
1889
2086
|
return function (type, _unused_var__etf5q3) {
|
|
@@ -1891,17 +2088,17 @@ function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
|
1891
2088
|
if (!(type instanceof Custom_0)) {
|
|
1892
2089
|
tmp = type;
|
|
1893
2090
|
} else {
|
|
1894
|
-
if (!startsWith(type.
|
|
2091
|
+
if (!startsWith(type.f1n_1, $endpointName + '.')) {
|
|
1895
2092
|
tmp = type;
|
|
1896
2093
|
} else {
|
|
1897
|
-
var suffix = removePrefix(type.
|
|
2094
|
+
var suffix = removePrefix(type.f1n_1, $endpointName + '.');
|
|
1898
2095
|
switch (suffix) {
|
|
1899
2096
|
case 'Call':
|
|
1900
2097
|
case 'Handler':
|
|
1901
2098
|
tmp = type;
|
|
1902
2099
|
break;
|
|
1903
2100
|
default:
|
|
1904
|
-
tmp = type.
|
|
2101
|
+
tmp = type.j1r(suffix);
|
|
1905
2102
|
break;
|
|
1906
2103
|
}
|
|
1907
2104
|
}
|
|
@@ -1912,42 +2109,42 @@ function flattenEndpointTypeRefs$lambda($endpointName) {
|
|
|
1912
2109
|
function snakeCaseClientFunctions$lambda(element, transformer) {
|
|
1913
2110
|
var tmp;
|
|
1914
2111
|
if (element instanceof Function) {
|
|
1915
|
-
tmp = element.
|
|
2112
|
+
tmp = element.j1p(Companion_getInstance().m1l(element.b1p_1.u1q()), VOID, plus(listOf_0(new Parameter(Companion_getInstance().m1l('self'), new Custom_0(''))), element.d1p_1));
|
|
1916
2113
|
} else {
|
|
1917
2114
|
tmp = element;
|
|
1918
2115
|
}
|
|
1919
2116
|
var transformed = tmp;
|
|
1920
|
-
return
|
|
2117
|
+
return transformChildren_1(transformed, transformer);
|
|
1921
2118
|
}
|
|
1922
2119
|
function snakeCaseClientFunctions$lambda_0(stmt, tr) {
|
|
1923
2120
|
var tmp;
|
|
1924
2121
|
if (stmt instanceof FunctionCall) {
|
|
1925
|
-
var nameStr = stmt.
|
|
1926
|
-
var newName = contains(nameStr, '.') ? stmt.
|
|
1927
|
-
var tmp1_safe_receiver = stmt.
|
|
2122
|
+
var nameStr = stmt.x1q_1.h1n();
|
|
2123
|
+
var newName = contains(nameStr, '.') ? stmt.x1q_1 : Companion_getInstance().m1l(Companion_getInstance().m1l(nameStr).u1q());
|
|
2124
|
+
var tmp1_safe_receiver = stmt.v1q_1;
|
|
1928
2125
|
var tmp_0;
|
|
1929
2126
|
if (tmp1_safe_receiver == null) {
|
|
1930
2127
|
tmp_0 = null;
|
|
1931
2128
|
} else {
|
|
1932
2129
|
// Inline function 'kotlin.let' call
|
|
1933
|
-
tmp_0 = tr.
|
|
2130
|
+
tmp_0 = tr.y1y(tmp1_safe_receiver);
|
|
1934
2131
|
}
|
|
1935
2132
|
var tmp2_receiver = tmp_0;
|
|
1936
2133
|
// Inline function 'kotlin.collections.mapValues' call
|
|
1937
|
-
var this_0 = stmt.
|
|
2134
|
+
var this_0 = stmt.y1q_1;
|
|
1938
2135
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
1939
|
-
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.
|
|
2136
|
+
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.b1()));
|
|
1940
2137
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
1941
|
-
var _iterator__ex2g4s = this_0.
|
|
2138
|
+
var _iterator__ex2g4s = this_0.l1().t();
|
|
1942
2139
|
while (_iterator__ex2g4s.u()) {
|
|
1943
2140
|
var element = _iterator__ex2g4s.v();
|
|
1944
|
-
var tmp_1 = element.
|
|
2141
|
+
var tmp_1 = element.m1();
|
|
1945
2142
|
// Inline function 'kotlin.collections.component2' call
|
|
1946
|
-
var v = element.
|
|
1947
|
-
var tmp$ret$4 = tr.
|
|
1948
|
-
destination.
|
|
2143
|
+
var v = element.n1();
|
|
2144
|
+
var tmp$ret$4 = tr.y1y(v);
|
|
2145
|
+
destination.d3(tmp_1, tmp$ret$4);
|
|
1949
2146
|
}
|
|
1950
|
-
var tmp4_isAwait = !(stmt.
|
|
2147
|
+
var tmp4_isAwait = !(stmt.v1q_1 == null);
|
|
1951
2148
|
tmp = new FunctionCall(tmp2_receiver, VOID, newName, destination, tmp4_isAwait);
|
|
1952
2149
|
} else {
|
|
1953
2150
|
tmp = transformChildren(stmt, tr);
|
|
@@ -1960,28 +2157,28 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
1960
2157
|
var tmp_0;
|
|
1961
2158
|
var tmp_1;
|
|
1962
2159
|
if (stmt instanceof FieldCall) {
|
|
1963
|
-
tmp_1 = stmt.
|
|
2160
|
+
tmp_1 = stmt.p1u_1 == null;
|
|
1964
2161
|
} else {
|
|
1965
2162
|
tmp_1 = false;
|
|
1966
2163
|
}
|
|
1967
2164
|
if (tmp_1) {
|
|
1968
|
-
tmp_0 = $fieldNames.
|
|
2165
|
+
tmp_0 = $fieldNames.a2(stmt.q1u_1.h1n());
|
|
1969
2166
|
} else {
|
|
1970
2167
|
tmp_0 = false;
|
|
1971
2168
|
}
|
|
1972
2169
|
if (tmp_0) {
|
|
1973
|
-
tmp = new FieldCall(new VariableReference(Companion_getInstance().
|
|
2170
|
+
tmp = new FieldCall(new VariableReference(Companion_getInstance().m1l('self')), stmt.q1u_1);
|
|
1974
2171
|
} else {
|
|
1975
2172
|
if (stmt instanceof FieldCall) {
|
|
1976
|
-
var tmp0_safe_receiver = stmt.
|
|
2173
|
+
var tmp0_safe_receiver = stmt.p1u_1;
|
|
1977
2174
|
var tmp_2;
|
|
1978
2175
|
if (tmp0_safe_receiver == null) {
|
|
1979
2176
|
tmp_2 = null;
|
|
1980
2177
|
} else {
|
|
1981
2178
|
// Inline function 'kotlin.let' call
|
|
1982
|
-
tmp_2 = tr.
|
|
2179
|
+
tmp_2 = tr.y1y(tmp0_safe_receiver);
|
|
1983
2180
|
}
|
|
1984
|
-
tmp = new FieldCall(tmp_2, stmt.
|
|
2181
|
+
tmp = new FieldCall(tmp_2, stmt.q1u_1);
|
|
1985
2182
|
} else {
|
|
1986
2183
|
tmp = transformChildren(stmt, tr);
|
|
1987
2184
|
}
|
|
@@ -1992,8 +2189,8 @@ function addSelfReceiverToClientFields$lambda($fieldNames) {
|
|
|
1992
2189
|
function PythonRefinedTypeDefinitionEmitter() {
|
|
1993
2190
|
}
|
|
1994
2191
|
function PythonShared() {
|
|
1995
|
-
this.
|
|
1996
|
-
this.
|
|
2192
|
+
this.q22_1 = 'shared';
|
|
2193
|
+
this.r22_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";
|
|
1997
2194
|
}
|
|
1998
2195
|
protoOf(PythonShared).toString = function () {
|
|
1999
2196
|
return 'PythonShared';
|
|
@@ -2014,17 +2211,17 @@ function PythonShared_getInstance() {
|
|
|
2014
2211
|
}
|
|
2015
2212
|
function PythonTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
2016
2213
|
return function (it) {
|
|
2017
|
-
return this$0.
|
|
2214
|
+
return this$0.v22(it);
|
|
2018
2215
|
};
|
|
2019
2216
|
}
|
|
2020
2217
|
function PythonTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
2021
2218
|
return function (it) {
|
|
2022
|
-
return this$0.
|
|
2219
|
+
return this$0.v22(it);
|
|
2023
2220
|
};
|
|
2024
2221
|
}
|
|
2025
2222
|
function PythonTypeDefinitionEmitter$emit$lambda_1(this$0) {
|
|
2026
2223
|
return function (it) {
|
|
2027
|
-
return Spacer_instance.toString() + this$0.
|
|
2224
|
+
return Spacer_instance.toString() + this$0.mu(it);
|
|
2028
2225
|
};
|
|
2029
2226
|
}
|
|
2030
2227
|
function PythonTypeDefinitionEmitter() {
|
|
@@ -2032,26 +2229,27 @@ function PythonTypeDefinitionEmitter() {
|
|
|
2032
2229
|
function PythonUnionDefinitionEmitter() {
|
|
2033
2230
|
}
|
|
2034
2231
|
//region block: post-declaration
|
|
2035
|
-
protoOf(PythonEmitter).
|
|
2036
|
-
protoOf(PythonEmitter).
|
|
2037
|
-
protoOf(PythonEmitter).
|
|
2038
|
-
protoOf(PythonEmitter).
|
|
2039
|
-
protoOf(PythonEmitter).
|
|
2040
|
-
protoOf(PythonEmitter).
|
|
2041
|
-
protoOf(PythonEmitter).
|
|
2042
|
-
protoOf(PythonEmitter).
|
|
2043
|
-
protoOf(PythonEmitter).
|
|
2044
|
-
protoOf(PythonEmitter).
|
|
2045
|
-
protoOf(PythonEmitter).
|
|
2046
|
-
protoOf(PythonEmitter).
|
|
2047
|
-
protoOf(PythonEmitter).
|
|
2048
|
-
protoOf(PythonEmitter).
|
|
2049
|
-
protoOf(PythonEmitter).
|
|
2050
|
-
protoOf(PythonEmitter).
|
|
2051
|
-
protoOf(PythonEmitter).
|
|
2052
|
-
protoOf(PythonEmitter).
|
|
2053
|
-
protoOf(PythonEmitter).
|
|
2054
|
-
protoOf(PythonIrEmitter).
|
|
2232
|
+
protoOf(PythonEmitter).ku = emit_4;
|
|
2233
|
+
protoOf(PythonEmitter).lu = emit_5;
|
|
2234
|
+
protoOf(PythonEmitter).mu = emit_6;
|
|
2235
|
+
protoOf(PythonEmitter).nu = emit_7;
|
|
2236
|
+
protoOf(PythonEmitter).ou = emit_9;
|
|
2237
|
+
protoOf(PythonEmitter).yv = emit_14;
|
|
2238
|
+
protoOf(PythonEmitter).tv = emit_15;
|
|
2239
|
+
protoOf(PythonEmitter).zv = emit_10;
|
|
2240
|
+
protoOf(PythonEmitter).ov = emit_13;
|
|
2241
|
+
protoOf(PythonEmitter).mv = emit_3;
|
|
2242
|
+
protoOf(PythonEmitter).nv = emit_2;
|
|
2243
|
+
protoOf(PythonEmitter).s22 = emit_8;
|
|
2244
|
+
protoOf(PythonEmitter).a21 = emit_11;
|
|
2245
|
+
protoOf(PythonEmitter).t22 = emit_12;
|
|
2246
|
+
protoOf(PythonEmitter).aw = emitValidator;
|
|
2247
|
+
protoOf(PythonEmitter).n21 = sanitize;
|
|
2248
|
+
protoOf(PythonEmitter).d21 = sanitizeKeywords;
|
|
2249
|
+
protoOf(PythonEmitter).u22 = emitType;
|
|
2250
|
+
protoOf(PythonEmitter).v22 = emitReferenceCustomImports;
|
|
2251
|
+
protoOf(PythonIrEmitter).es = emit_1;
|
|
2252
|
+
protoOf(PythonIrEmitter).v1z = beforeGenerate;
|
|
2055
2253
|
//endregion
|
|
2056
2254
|
//region block: init
|
|
2057
2255
|
PythonShared_instance = new PythonShared();
|