@flock/wirespec 0.18.1-RC.2 → 0.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/clikt-clikt-mordant.mjs +79 -79
- package/clikt-clikt.mjs +1265 -1265
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +433 -433
- package/kotlin-kotlin-stdlib.mjs +29 -23
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +5407 -5405
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1760 -1760
- package/kotlinx-io-kotlinx-io-core.mjs +404 -404
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1701 -1701
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1320 -1319
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1198 -1198
- package/package.json +1 -1
- package/wirespec-fetch.mjs +13 -19
- package/wirespec-src-compiler-core.mjs +193 -206
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +718 -784
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +357 -464
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +628 -757
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +1582 -1708
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +680 -635
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +627 -610
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +40 -40
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +5428 -6057
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +279 -279
- package/wirespec-src-converter-avro.mjs +559 -559
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +802 -404
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-plugin-arguments.mjs +144 -144
- package/wirespec-src-plugin-cli.mjs +87 -87
- package/wirespec-src-plugin-npm.mjs +44 -25
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +13 -13
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
FieldIdentifier34k7iphndcnl0 as FieldIdentifier,
|
|
23
23
|
DefinitionIdentifiervfasqdb33qef as DefinitionIdentifier,
|
|
24
24
|
addBackticks1di5q03fw4yhx as addBackticks,
|
|
25
|
-
Shared1uygqfbd22ukz as Shared,
|
|
26
25
|
plus14o24vdaiongg as plus_0,
|
|
27
26
|
Bytes_instance1o9u095wd3kx6 as Bytes_instance,
|
|
28
27
|
Boolean_instance237vwt01w3hs8 as Boolean_instance,
|
|
@@ -79,23 +78,24 @@ import {
|
|
|
79
78
|
joinToStringooja5rkatz3u as joinToString_0,
|
|
80
79
|
firstOrNulltrxqttxfxqju as firstOrNull,
|
|
81
80
|
isDigit3mimrri4wkzop as isDigit,
|
|
82
|
-
Paire9pteg33gng7 as Pair,
|
|
83
|
-
plus20p0vtfmu0596 as plus_1,
|
|
84
|
-
plus310ted5e4i90h as plus_2,
|
|
85
|
-
emptyList1g2z5xcrvp2zy as emptyList,
|
|
86
81
|
KProperty1ca4yb4wlo496 as KProperty1,
|
|
87
82
|
getPropertyCallableRef3hckxc0xueiaj as getPropertyCallableRef,
|
|
88
83
|
StringBuilder_init_$Create$322n630qt3r8c as StringBuilder_init_$Create$,
|
|
89
84
|
charSequenceGet1vxk1y5n17t1z as charSequenceGet,
|
|
90
|
-
HashSet_init_$Create$33p49hmosnvr4 as HashSet_init_$Create$,
|
|
91
|
-
isInterface3d6p8outrmvmk as isInterface,
|
|
92
85
|
to2cs3ny02qtbcb as to,
|
|
93
86
|
toMap1vec9topfei08 as toMap,
|
|
87
|
+
emptyList1g2z5xcrvp2zy as emptyList,
|
|
88
|
+
Paire9pteg33gng7 as Pair,
|
|
89
|
+
plus20p0vtfmu0596 as plus_1,
|
|
90
|
+
plus310ted5e4i90h as plus_2,
|
|
94
91
|
listOf1jh22dvmctj1r as listOf_0,
|
|
95
92
|
lazy2hsh8ze7j6ikd as lazy,
|
|
93
|
+
isInterface3d6p8outrmvmk as isInterface,
|
|
96
94
|
firstOrNull1982767dljvdy as firstOrNull_0,
|
|
95
|
+
listOfNotNull1v4ggfackvuny as listOfNotNull_0,
|
|
97
96
|
ensureNotNull1e947j3ixpazm as ensureNotNull,
|
|
98
97
|
addAll1k27qatfgp3k5 as addAll,
|
|
98
|
+
HashSet_init_$Create$33p49hmosnvr4 as HashSet_init_$Create$,
|
|
99
99
|
equals2au1ep9vhcato as equals,
|
|
100
100
|
initMetadataForObject1cxne3s9w65el as initMetadataForObject,
|
|
101
101
|
dropLastlqc2oyv04br0 as dropLast,
|
|
@@ -105,51 +105,47 @@ import {
|
|
|
105
105
|
NonEmptyList__plus_impl_xqmb92tle8a7jcf2wm as NonEmptyList__plus_impl_xqmb9,
|
|
106
106
|
} from './arrow-arrow-core.mjs';
|
|
107
107
|
import {
|
|
108
|
+
Nameoqr8dt2fim9d as Name,
|
|
109
|
+
FunctionCall30872kpnbr7op as FunctionCall,
|
|
110
|
+
transformChildren2mszeagj5nq4c as transformChildren,
|
|
111
|
+
sanitizeFieldName1ptgy1kxy8u2m as sanitizeFieldName,
|
|
112
|
+
ConstructorStatement1x4n4sr59iy4n as ConstructorStatement,
|
|
113
|
+
SanitizationConfig11mmn3p2c03c1 as SanitizationConfig,
|
|
108
114
|
Package2tniq694j1763 as Package,
|
|
109
115
|
import5uhkz67bd8tt as import_0,
|
|
110
116
|
File3dimy4iqmuock as File,
|
|
111
|
-
transformChildrend9p91tpcqdkx as
|
|
117
|
+
transformChildrend9p91tpcqdkx as transformChildren_0,
|
|
112
118
|
Companion_getInstance3gvtuyxc9uhxj as Companion_getInstance,
|
|
113
119
|
withElements2toq84v08e72 as withElements,
|
|
114
120
|
Namespace345pal554qu3j as Namespace,
|
|
121
|
+
KotlinGenerator_instance3iknxuxfla2k5 as KotlinGenerator_instance,
|
|
122
|
+
convertClientServer1w4pgeabrnbb9 as convertClientServer,
|
|
123
|
+
convertnty9x0e63d0u as convert,
|
|
115
124
|
TransformScopeyrd3lf4zrk76 as TransformScope,
|
|
116
125
|
TransformerBuildera6a1gvlhjj9b as TransformerBuilder,
|
|
117
126
|
transform3eti8i2bqvifx as transform,
|
|
118
127
|
Elementitq62jg6fid3 as Element,
|
|
119
|
-
|
|
120
|
-
Nameoqr8dt2fim9d as Name,
|
|
121
|
-
transformChildren2mszeagj5nq4c as transformChildren_0,
|
|
122
|
-
sanitizeFieldName1ptgy1kxy8u2m as sanitizeFieldName,
|
|
123
|
-
ConstructorStatement1x4n4sr59iy4n as ConstructorStatement,
|
|
124
|
-
FunctionCall30872kpnbr7op as FunctionCall,
|
|
125
|
-
SanitizationConfig11mmn3p2c03c1 as SanitizationConfig,
|
|
126
|
-
convertClientServer3s89ijty7q130 as convertClientServer,
|
|
127
|
-
convert13xvfhgrf57n5 as convert,
|
|
128
|
-
generateKotlin23t0psnmer03b as generateKotlin,
|
|
129
|
-
RawElement2yts1x2rbem1g as RawElement,
|
|
130
|
-
Constructor3io4sluuia3gk as Constructor,
|
|
131
|
-
Struct39wf79cwtn4ty as Struct,
|
|
132
|
-
withLabelField33ehya4zusm70 as withLabelField,
|
|
133
|
-
Enumlszg09mwd24f as Enum,
|
|
134
|
-
Interface3pn84xq686t2r as Interface,
|
|
135
|
-
KotlinGenerator_instance3iknxuxfla2k5 as KotlinGenerator_instance,
|
|
136
|
-
emit3bzdcd0f6nwtj as emit_0,
|
|
137
|
-
withSharedSource1qgrajaccojj3 as withSharedSource,
|
|
138
|
-
emitn3eihixilqyh as emit_1,
|
|
128
|
+
emitn3eihixilqyh as emit_0,
|
|
139
129
|
prependImports32gcj3yb8voha as prependImports,
|
|
140
130
|
placeInPackage1ffljbk9me4ug as placeInPackage,
|
|
141
131
|
convertWithValidation3ar3nbcqsbkpn as convertWithValidation,
|
|
142
132
|
sanitizeNames2wqmyf8vafp9x as sanitizeNames,
|
|
133
|
+
ensureEmptyStructHasConstructorfl467argh9dd as ensureEmptyStructHasConstructor,
|
|
143
134
|
convert11ert2po54h1y as convert_0,
|
|
135
|
+
injectEnumLabelFieldyfohidz6c88i as injectEnumLabelField,
|
|
144
136
|
convert37aabdzvtv9vg as convert_1,
|
|
145
137
|
convert17zcptkz4mhr4 as convert_2,
|
|
146
|
-
|
|
138
|
+
Struct39wf79cwtn4ty as Struct,
|
|
139
|
+
markMembersAsOverride3r1zpft8nbmxg as markMembersAsOverride,
|
|
147
140
|
convert32tuiui3czihh as convert_3,
|
|
148
141
|
convert1cn4bolzoed8c as convert_4,
|
|
149
142
|
emitEndpointClient1meajc90wf3el as emitEndpointClient,
|
|
150
143
|
emitClient32kfwzg2hm5vj as emitClient,
|
|
151
|
-
emit1oxjujel6f3jb as
|
|
144
|
+
emit1oxjujel6f3jb as emit_1,
|
|
145
|
+
emit3bzdcd0f6nwtj as emit_2,
|
|
152
146
|
IrEmitterh2m93ojzvkep as IrEmitter,
|
|
147
|
+
rawttvqxl50flj9 as raw,
|
|
148
|
+
Interface3pn84xq686t2r as Interface,
|
|
153
149
|
} from './wirespec-src-compiler-ir.mjs';
|
|
154
150
|
//region block: imports
|
|
155
151
|
//endregion
|
|
@@ -157,10 +153,10 @@ import {
|
|
|
157
153
|
function emit_3(identifier) {
|
|
158
154
|
var tmp;
|
|
159
155
|
if (identifier instanceof DefinitionIdentifier) {
|
|
160
|
-
tmp = this.
|
|
156
|
+
tmp = this.c1w(identifier);
|
|
161
157
|
} else {
|
|
162
158
|
if (identifier instanceof FieldIdentifier) {
|
|
163
|
-
tmp = this.
|
|
159
|
+
tmp = this.s1v(this.c1w(identifier));
|
|
164
160
|
} else {
|
|
165
161
|
noWhenBranchMatchedException();
|
|
166
162
|
}
|
|
@@ -182,7 +178,7 @@ function sanitize(_this__u8e3s4) {
|
|
|
182
178
|
destination.x(tmp$ret$0);
|
|
183
179
|
}
|
|
184
180
|
var tmp = asSequence(joinToString(destination, ''));
|
|
185
|
-
return this.
|
|
181
|
+
return this.r1v(joinToString_0(filter(tmp, KotlinIdentifierEmitter$sanitize$lambda), ''));
|
|
186
182
|
}
|
|
187
183
|
function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
188
184
|
var tmp;
|
|
@@ -202,7 +198,7 @@ function sanitizeFirstIsDigit(_this__u8e3s4) {
|
|
|
202
198
|
return tmp;
|
|
203
199
|
}
|
|
204
200
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
205
|
-
return Companion_getInstance_0().
|
|
201
|
+
return Companion_getInstance_0().p1w_1.u1(_this__u8e3s4) ? addBackticks(_this__u8e3s4) : _this__u8e3s4;
|
|
206
202
|
}
|
|
207
203
|
initMetadataForInterface(KotlinIdentifierEmitter, 'KotlinIdentifierEmitter');
|
|
208
204
|
function emit_4(type, module_0) {
|
|
@@ -246,17 +242,17 @@ function emit_7(_this__u8e3s4) {
|
|
|
246
242
|
tmp = 'Any';
|
|
247
243
|
} else {
|
|
248
244
|
if (_this__u8e3s4 instanceof Custom) {
|
|
249
|
-
tmp = _this__u8e3s4.
|
|
245
|
+
tmp = _this__u8e3s4.ku_1;
|
|
250
246
|
} else {
|
|
251
247
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
252
|
-
var t = _this__u8e3s4.
|
|
248
|
+
var t = _this__u8e3s4.ou_1;
|
|
253
249
|
var tmp_0;
|
|
254
250
|
if (t instanceof String_0) {
|
|
255
251
|
tmp_0 = 'String';
|
|
256
252
|
} else {
|
|
257
253
|
if (t instanceof Integer) {
|
|
258
254
|
var tmp_1;
|
|
259
|
-
switch (t.
|
|
255
|
+
switch (t.st_1.b3_1) {
|
|
260
256
|
case 0:
|
|
261
257
|
tmp_1 = 'Int';
|
|
262
258
|
break;
|
|
@@ -271,7 +267,7 @@ function emit_7(_this__u8e3s4) {
|
|
|
271
267
|
} else {
|
|
272
268
|
if (t instanceof Number_0) {
|
|
273
269
|
var tmp_2;
|
|
274
|
-
switch (t.
|
|
270
|
+
switch (t.vt_1.b3_1) {
|
|
275
271
|
case 0:
|
|
276
272
|
tmp_2 = 'Float';
|
|
277
273
|
break;
|
|
@@ -307,7 +303,7 @@ function emit_7(_this__u8e3s4) {
|
|
|
307
303
|
}
|
|
308
304
|
// Inline function 'kotlin.let' call
|
|
309
305
|
var it = tmp;
|
|
310
|
-
return _this__u8e3s4.
|
|
306
|
+
return _this__u8e3s4.cu() ? it + '?' : it;
|
|
311
307
|
}
|
|
312
308
|
function emit_8(_this__u8e3s4) {
|
|
313
309
|
var tmp;
|
|
@@ -315,7 +311,7 @@ function emit_8(_this__u8e3s4) {
|
|
|
315
311
|
tmp = 'Regex("""' + this.zp(_this__u8e3s4.ys_1) + '""").matches(value)';
|
|
316
312
|
} else {
|
|
317
313
|
if (_this__u8e3s4 instanceof Bound) {
|
|
318
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
314
|
+
var tmp1_safe_receiver = _this__u8e3s4.ot_1;
|
|
319
315
|
var tmp_0;
|
|
320
316
|
if (tmp1_safe_receiver == null) {
|
|
321
317
|
tmp_0 = null;
|
|
@@ -324,7 +320,7 @@ function emit_8(_this__u8e3s4) {
|
|
|
324
320
|
tmp_0 = tmp1_safe_receiver + ' < value';
|
|
325
321
|
}
|
|
326
322
|
var minCheck = tmp_0;
|
|
327
|
-
var tmp2_safe_receiver = _this__u8e3s4.
|
|
323
|
+
var tmp2_safe_receiver = _this__u8e3s4.pt_1;
|
|
328
324
|
var tmp_1;
|
|
329
325
|
if (tmp2_safe_receiver == null) {
|
|
330
326
|
tmp_1 = null;
|
|
@@ -355,7 +351,60 @@ function emit_9(channel) {
|
|
|
355
351
|
return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |fun interface ' + this.wq(channel.mo_1) + ' {\n | operator fun invoke(message: ' + this.xp(channel.no_1) + ')\n |}\n |\n ');
|
|
356
352
|
}
|
|
357
353
|
initMetadataForInterface(KotlinChannelDefinitionEmitter, 'KotlinChannelDefinitionEmitter', VOID, VOID, [KotlinTypeDefinitionEmitter]);
|
|
358
|
-
function emit_10(
|
|
354
|
+
function emit_10(union) {
|
|
355
|
+
return trimMargin('\n |sealed interface ' + this.wq(union.qo_1) + '\n |\n ');
|
|
356
|
+
}
|
|
357
|
+
initMetadataForInterface(KotlinUnionDefinitionEmitter, 'KotlinUnionDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
358
|
+
function emit_11(refined) {
|
|
359
|
+
return trimMargin('\n |data class ' + this.c1w(refined.br_1) + '(override val value: ' + this.xp(refined.cr_1) + '): Wirespec.Refined<' + this.xp(refined.cr_1) + '> {\n |' + Spacer_instance.toString() + 'override fun toString() = value.toString()\n |' + Spacer_instance.toString() + 'override fun validate() = ' + this.kr(refined) + '\n |}\n |\n ');
|
|
360
|
+
}
|
|
361
|
+
function emitValidator(_this__u8e3s4) {
|
|
362
|
+
var defaultReturn = 'true';
|
|
363
|
+
var type = _this__u8e3s4.cr_1.ou_1;
|
|
364
|
+
var tmp;
|
|
365
|
+
if (type instanceof Integer) {
|
|
366
|
+
var tmp0_safe_receiver = type.tt_1;
|
|
367
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.yp(tmp0_safe_receiver);
|
|
368
|
+
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
369
|
+
} else {
|
|
370
|
+
if (type instanceof Number_0) {
|
|
371
|
+
var tmp2_safe_receiver = type.wt_1;
|
|
372
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.yp(tmp2_safe_receiver);
|
|
373
|
+
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
374
|
+
} else {
|
|
375
|
+
if (type instanceof String_0) {
|
|
376
|
+
var tmp4_safe_receiver = type.qt_1;
|
|
377
|
+
var tmp_0;
|
|
378
|
+
var tmp_1 = tmp4_safe_receiver;
|
|
379
|
+
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
380
|
+
tmp_0 = null;
|
|
381
|
+
} else {
|
|
382
|
+
tmp_0 = this.yp(new RegExp_0(tmp4_safe_receiver));
|
|
383
|
+
}
|
|
384
|
+
var tmp5_elvis_lhs = tmp_0;
|
|
385
|
+
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
386
|
+
} else {
|
|
387
|
+
if (equals(type, Boolean_instance)) {
|
|
388
|
+
tmp = defaultReturn;
|
|
389
|
+
} else {
|
|
390
|
+
if (equals(type, Bytes_instance)) {
|
|
391
|
+
tmp = defaultReturn;
|
|
392
|
+
} else {
|
|
393
|
+
noWhenBranchMatchedException();
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return tmp;
|
|
400
|
+
}
|
|
401
|
+
initMetadataForInterface(KotlinRefinedTypeDefinitionEmitter, 'KotlinRefinedTypeDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter, KotlinTypeDefinitionEmitter]);
|
|
402
|
+
function emit_12(enum_0, module_0) {
|
|
403
|
+
var tmp = this.c1w(enum_0.gr_1);
|
|
404
|
+
return trimMargin('\n |enum class ' + tmp + ' (override val label: String): Wirespec.Enum {\n |' + spacer(joinToString(enum_0.hr_1, ',\n', VOID, VOID, VOID, VOID, KotlinEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'override fun toString(): String {\n |' + Spacer_instance.qr(2) + 'return label\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
405
|
+
}
|
|
406
|
+
initMetadataForInterface(KotlinEnumDefinitionEmitter, 'KotlinEnumDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
407
|
+
function emit_13(endpoint) {
|
|
359
408
|
// Inline function 'kotlin.collections.map' call
|
|
360
409
|
var this_0 = importReferences(endpoint);
|
|
361
410
|
// Inline function 'kotlin.collections.mapTo' call
|
|
@@ -363,7 +412,7 @@ function emit_10(endpoint) {
|
|
|
363
412
|
var _iterator__ex2g4s = this_0.t();
|
|
364
413
|
while (_iterator__ex2g4s.u()) {
|
|
365
414
|
var item = _iterator__ex2g4s.v();
|
|
366
|
-
var tmp$ret$0 = 'import ' + this.
|
|
415
|
+
var tmp$ret$0 = 'import ' + this.c1v().mr_1 + '.model.' + item.ku_1;
|
|
367
416
|
destination.x(tmp$ret$0);
|
|
368
417
|
}
|
|
369
418
|
var tmp = destination;
|
|
@@ -373,7 +422,7 @@ function emit_10(endpoint) {
|
|
|
373
422
|
var tmp_3 = emitObject$default(this, tmp_2, 'Path', 'Wirespec.Path', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_0(this));
|
|
374
423
|
var tmp_4 = emitObject$default(this, endpoint.hp_1, 'Queries', 'Wirespec.Queries', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_1(this));
|
|
375
424
|
var tmp_5 = emitObject$default(this, endpoint.ip_1, 'Headers', 'Wirespec.Request.Headers', VOID, KotlinEndpointDefinitionEmitter$emit$lambda_2(this));
|
|
376
|
-
var tmp_6 = this.
|
|
425
|
+
var tmp_6 = this.p1v(first(endpoint.jp_1), endpoint);
|
|
377
426
|
var tmp_7 = Spacer_instance.toString();
|
|
378
427
|
var tmp_8 = emitStatusInterfaces(this, endpoint);
|
|
379
428
|
var tmp_9 = emitResponseInterfaces(this, endpoint);
|
|
@@ -403,7 +452,7 @@ function emit_10(endpoint) {
|
|
|
403
452
|
var tmp_22 = Spacer_instance.qr(2);
|
|
404
453
|
var tmp_23 = Spacer_instance.toString();
|
|
405
454
|
var tmp_24 = Spacer_instance.qr(2);
|
|
406
|
-
var tmp_25 = this.
|
|
455
|
+
var tmp_25 = this.t1v(endpoint);
|
|
407
456
|
var tmp_26 = Spacer_instance.qr(2);
|
|
408
457
|
var tmp_27 = Spacer_instance.qr(3);
|
|
409
458
|
return trimMargin('\n |' + tmp_0 + '\n |\n |object ' + tmp_1 + ' : Wirespec.Endpoint {\n |' + tmp_3 + '\n |\n |' + tmp_4 + '\n |\n |' + tmp_5 + '\n |\n |' + tmp_6 + '\n |\n |' + tmp_7 + 'sealed interface Response<T: Any> : Wirespec.Response<T>\n |\n |' + tmp_8 + '\n |\n |' + tmp_9 + '\n |\n |' + tmp_11 + '\n |\n |' + tmp_12 + 'fun toResponse(serialization: Wirespec.Serializer, response: Response<*>): Wirespec.RawResponse =\n |' + tmp_13 + 'when(response) {\n |' + tmp_15 + '\n |' + tmp_16 + '}\n |\n |' + tmp_17 + 'fun fromResponse(serialization: Wirespec.Deserializer, response: Wirespec.RawResponse): Response<*> =\n |' + tmp_18 + 'when (response.statusCode) {\n |' + tmp_20 + '\n |' + tmp_21 + 'else -> error("Cannot match response with status: ${response.statusCode}")\n |' + tmp_22 + '}\n |\n |' + tmp_23 + 'interface Handler: Wirespec.Handler {\n |' + tmp_24 + tmp_25 + '\n |' + tmp_26 + 'companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n |' + tmp_27 + 'override val pathTemplate = "/' + joinToString(endpoint.gp_1, '/', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_6) + '"\n |' + Spacer_instance.qr(3) + 'override val method = "' + endpoint.fp_1.toString() + '"\n |' + Spacer_instance.qr(3) + 'override fun server(serialization: Wirespec.Serialization) = object : Wirespec.ServerEdge<Request, Response<*>> {\n |' + Spacer_instance.qr(4) + 'override fun from(request: Wirespec.RawRequest) = fromRequest(serialization, request)\n |' + Spacer_instance.qr(4) + 'override fun to(response: Response<*>) = toResponse(serialization, response)\n |' + Spacer_instance.qr(3) + '}\n |' + Spacer_instance.qr(3) + 'override fun client(serialization: Wirespec.Serialization) = object : Wirespec.ClientEdge<Request, Response<*>> {\n |' + Spacer_instance.qr(4) + 'override fun to(request: Request) = toRequest(serialization, request)\n |' + Spacer_instance.qr(4) + 'override fun from(response: Wirespec.RawResponse) = fromResponse(serialization, response)\n |' + Spacer_instance.qr(3) + '}\n |' + Spacer_instance.qr(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
@@ -411,7 +460,7 @@ function emit_10(endpoint) {
|
|
|
411
460
|
function emitHandleFunction(endpoint) {
|
|
412
461
|
return 'suspend fun ' + Companion_instance_1.pq(this.wq(endpoint.ep_1)) + '(request: Request): Response<*>';
|
|
413
462
|
}
|
|
414
|
-
function
|
|
463
|
+
function emit_14(_this__u8e3s4, endpoint) {
|
|
415
464
|
var tmp = Spacer_instance.toString();
|
|
416
465
|
var tmp_0 = emitConstructor(this, _this__u8e3s4, endpoint);
|
|
417
466
|
var tmp_1 = Spacer_instance.qr(2);
|
|
@@ -426,7 +475,7 @@ function emit_11(_this__u8e3s4, endpoint) {
|
|
|
426
475
|
var tmp_10 = Spacer_instance.toString();
|
|
427
476
|
var tmp_11 = Spacer_instance.qr(2);
|
|
428
477
|
var tmp_12 = Spacer_instance.qr(3);
|
|
429
|
-
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.fp_1.a3_1 + '\n |' + tmp_5 + 'override val queries = Queries' + tmp_6 + '\n |' + tmp_7 + 'override val headers = Headers' + tmp_8 + '\n |' + tmp_9 + '\n |\n |' + tmp_10 + 'fun toRequest(serialization: Wirespec.Serializer, request: Request): Wirespec.RawRequest =\n |' + tmp_11 + 'Wirespec.RawRequest(\n |' + tmp_12 + 'path = listOf(' + joinToString(endpoint.gp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_10(this)) + '),\n |' + Spacer_instance.qr(3) + 'method = request.method.name,\n |' + Spacer_instance.qr(3) + 'queries = ' + this.
|
|
478
|
+
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.fp_1.a3_1 + '\n |' + tmp_5 + 'override val queries = Queries' + tmp_6 + '\n |' + tmp_7 + 'override val headers = Headers' + tmp_8 + '\n |' + tmp_9 + '\n |\n |' + tmp_10 + 'fun toRequest(serialization: Wirespec.Serializer, request: Request): Wirespec.RawRequest =\n |' + tmp_11 + 'Wirespec.RawRequest(\n |' + tmp_12 + 'path = listOf(' + joinToString(endpoint.gp_1, VOID, VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_10(this)) + '),\n |' + Spacer_instance.qr(3) + 'method = request.method.name,\n |' + Spacer_instance.qr(3) + 'queries = ' + this.m1w(endpoint) + ',\n |' + Spacer_instance.qr(3) + 'headers = ' + this.l1w(endpoint) + ',\n |' + Spacer_instance.qr(3) + 'body = ' + (!(_this__u8e3s4.np_1 == null) ? 'serialization.serializeBody(request.body, typeOf<' + emit_16(this, _this__u8e3s4.np_1) + '>())' : 'null') + ',\n |' + Spacer_instance.qr(2) + ')\n |\n |' + Spacer_instance.toString() + 'fun fromRequest(serialization: Wirespec.Deserializer, request: Wirespec.RawRequest): Request =\n |' + Spacer_instance.qr(2) + 'Request' + emitDeserializedParams(this, _this__u8e3s4, endpoint) + '\n ');
|
|
430
479
|
}
|
|
431
480
|
function emitRequestHeaders(_this__u8e3s4) {
|
|
432
481
|
var tmp;
|
|
@@ -451,7 +500,7 @@ function emitQueries(endpoint) {
|
|
|
451
500
|
}
|
|
452
501
|
return tmp;
|
|
453
502
|
}
|
|
454
|
-
function
|
|
503
|
+
function emit_15(_this__u8e3s4) {
|
|
455
504
|
// Inline function 'kotlin.let' call
|
|
456
505
|
var it = joinToString(_this__u8e3s4.rp_1, ', ', VOID, VOID, VOID, VOID, KotlinEndpointDefinitionEmitter$emit$lambda_11(this));
|
|
457
506
|
var responseHeaderFields = isBlank(it) ? '' : ', ' + it;
|
|
@@ -481,63 +530,9 @@ function emitHeaders(_this__u8e3s4) {
|
|
|
481
530
|
return tmp;
|
|
482
531
|
}
|
|
483
532
|
initMetadataForInterface(KotlinEndpointDefinitionEmitter, 'KotlinEndpointDefinitionEmitter', VOID, VOID, [KotlinTypeDefinitionEmitter]);
|
|
484
|
-
|
|
485
|
-
return trimMargin('\n |sealed interface ' + this.wq(union.qo_1) + '\n |\n ');
|
|
486
|
-
}
|
|
487
|
-
initMetadataForInterface(KotlinUnionDefinitionEmitter, 'KotlinUnionDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
488
|
-
function emit_14(enum_0, module_0) {
|
|
489
|
-
var tmp = this.s1w(enum_0.gr_1);
|
|
490
|
-
return trimMargin('\n |enum class ' + tmp + ' (override val label: String): Wirespec.Enum {\n |' + spacer(joinToString(enum_0.hr_1, ',\n', VOID, VOID, VOID, VOID, KotlinEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'override fun toString(): String {\n |' + Spacer_instance.qr(2) + 'return label\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
491
|
-
}
|
|
492
|
-
initMetadataForInterface(KotlinEnumDefinitionEmitter, 'KotlinEnumDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter]);
|
|
493
|
-
function emit_15(refined) {
|
|
494
|
-
return trimMargin('\n |data class ' + this.s1w(refined.br_1) + '(override val value: ' + this.xp(refined.cr_1) + '): Wirespec.Refined<' + this.xp(refined.cr_1) + '> {\n |' + Spacer_instance.toString() + 'override fun toString() = value.toString()\n |' + Spacer_instance.toString() + 'override fun validate() = ' + this.kr(refined) + '\n |}\n |\n ');
|
|
495
|
-
}
|
|
496
|
-
function emitValidator(_this__u8e3s4) {
|
|
497
|
-
var defaultReturn = 'true';
|
|
498
|
-
var type = _this__u8e3s4.cr_1.pu_1;
|
|
499
|
-
var tmp;
|
|
500
|
-
if (type instanceof Integer) {
|
|
501
|
-
var tmp0_safe_receiver = type.ut_1;
|
|
502
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.yp(tmp0_safe_receiver);
|
|
503
|
-
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
504
|
-
} else {
|
|
505
|
-
if (type instanceof Number_0) {
|
|
506
|
-
var tmp2_safe_receiver = type.xt_1;
|
|
507
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.yp(tmp2_safe_receiver);
|
|
508
|
-
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
509
|
-
} else {
|
|
510
|
-
if (type instanceof String_0) {
|
|
511
|
-
var tmp4_safe_receiver = type.rt_1;
|
|
512
|
-
var tmp_0;
|
|
513
|
-
var tmp_1 = tmp4_safe_receiver;
|
|
514
|
-
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
515
|
-
tmp_0 = null;
|
|
516
|
-
} else {
|
|
517
|
-
tmp_0 = this.yp(new RegExp_0(tmp4_safe_receiver));
|
|
518
|
-
}
|
|
519
|
-
var tmp5_elvis_lhs = tmp_0;
|
|
520
|
-
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
521
|
-
} else {
|
|
522
|
-
if (equals(type, Boolean_instance)) {
|
|
523
|
-
tmp = defaultReturn;
|
|
524
|
-
} else {
|
|
525
|
-
if (equals(type, Bytes_instance)) {
|
|
526
|
-
tmp = defaultReturn;
|
|
527
|
-
} else {
|
|
528
|
-
noWhenBranchMatchedException();
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
return tmp;
|
|
535
|
-
}
|
|
536
|
-
initMetadataForInterface(KotlinRefinedTypeDefinitionEmitter, 'KotlinRefinedTypeDefinitionEmitter', VOID, VOID, [KotlinIdentifierEmitter, KotlinTypeDefinitionEmitter]);
|
|
537
|
-
initMetadataForClass(KotlinEmitter, 'KotlinEmitter', KotlinEmitter, LanguageEmitter, [LanguageEmitter, KotlinEndpointDefinitionEmitter, KotlinChannelDefinitionEmitter, KotlinUnionDefinitionEmitter, KotlinEnumDefinitionEmitter, KotlinIdentifierEmitter, KotlinTypeDefinitionEmitter, KotlinRefinedTypeDefinitionEmitter]);
|
|
533
|
+
initMetadataForClass(KotlinEmitter, 'KotlinEmitter', KotlinEmitter, LanguageEmitter, [LanguageEmitter, KotlinIdentifierEmitter, KotlinUnionDefinitionEmitter, KotlinRefinedTypeDefinitionEmitter, KotlinEnumDefinitionEmitter, KotlinEndpointDefinitionEmitter, KotlinChannelDefinitionEmitter, KotlinTypeDefinitionEmitter]);
|
|
538
534
|
initMetadataForCompanion(Companion);
|
|
539
535
|
initMetadataForCompanion(Companion_0);
|
|
540
|
-
initMetadataForClass(KotlinIrEmitter$shared$1);
|
|
541
536
|
initMetadataForClass(KotlinIrEmitter, 'KotlinIrEmitter', KotlinIrEmitter, VOID, [IrEmitter]);
|
|
542
537
|
initMetadataForObject(KotlinShared, 'KotlinShared');
|
|
543
538
|
//endregion
|
|
@@ -549,7 +544,7 @@ function emitImports($this, _this__u8e3s4) {
|
|
|
549
544
|
var _iterator__ex2g4s = this_0.t();
|
|
550
545
|
while (_iterator__ex2g4s.u()) {
|
|
551
546
|
var item = _iterator__ex2g4s.v();
|
|
552
|
-
var tmp$ret$0 = 'import ' + $this.
|
|
547
|
+
var tmp$ret$0 = 'import ' + $this.c1v().mr_1 + '.model.' + item.ku_1 + ';';
|
|
553
548
|
destination.x(tmp$ret$0);
|
|
554
549
|
}
|
|
555
550
|
var tmp = destination;
|
|
@@ -565,37 +560,37 @@ function KotlinEmitter(packageName, emitShared) {
|
|
|
565
560
|
packageName = packageName === VOID ? Companion_instance.lr('community.flock.wirespec.generated') : packageName;
|
|
566
561
|
emitShared = emitShared === VOID ? Companion_instance_0.go() : emitShared;
|
|
567
562
|
LanguageEmitter.call(this);
|
|
568
|
-
this.
|
|
569
|
-
this.
|
|
570
|
-
this.
|
|
571
|
-
this.
|
|
572
|
-
this.
|
|
573
|
-
this.
|
|
574
|
-
}
|
|
575
|
-
protoOf(KotlinEmitter).
|
|
576
|
-
return this.
|
|
563
|
+
this.d1w_1 = packageName;
|
|
564
|
+
this.e1w_1 = emitShared;
|
|
565
|
+
this.f1w_1 = '\nimport community.flock.wirespec.kotlin.Wirespec\nimport kotlin.reflect.typeOf\n';
|
|
566
|
+
this.g1w_1 = FileExtension_Kotlin_getInstance();
|
|
567
|
+
this.h1w_1 = KotlinShared_getInstance();
|
|
568
|
+
this.i1w_1 = '//';
|
|
569
|
+
}
|
|
570
|
+
protoOf(KotlinEmitter).c1v = function () {
|
|
571
|
+
return this.d1w_1;
|
|
577
572
|
};
|
|
578
573
|
protoOf(KotlinEmitter).eq = function () {
|
|
579
|
-
return this.
|
|
574
|
+
return this.g1w_1;
|
|
580
575
|
};
|
|
581
|
-
protoOf(KotlinEmitter).
|
|
582
|
-
return this.
|
|
576
|
+
protoOf(KotlinEmitter).l1v = function () {
|
|
577
|
+
return this.h1w_1;
|
|
583
578
|
};
|
|
584
579
|
protoOf(KotlinEmitter).fq = function () {
|
|
585
|
-
return this.
|
|
580
|
+
return this.i1w_1;
|
|
586
581
|
};
|
|
587
582
|
protoOf(KotlinEmitter).tq = function (module_0, logger) {
|
|
588
583
|
// Inline function 'kotlin.let' call
|
|
589
584
|
var it = protoOf(LanguageEmitter).tq.call(this, module_0, logger);
|
|
590
|
-
return this.
|
|
585
|
+
return this.e1w_1.ho_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.lr('community.flock.wirespec.kotlin').or() + 'Wirespec', this.l1v().k1w_1)) : it;
|
|
591
586
|
};
|
|
592
587
|
protoOf(KotlinEmitter).uq = function (definition, module_0, logger) {
|
|
593
588
|
// Inline function 'kotlin.let' call
|
|
594
589
|
var it = protoOf(LanguageEmitter).uq.call(this, definition, module_0, logger);
|
|
595
|
-
var subPackageName = plus(this.
|
|
590
|
+
var subPackageName = plus(this.c1v(), definition);
|
|
596
591
|
var tmp = subPackageName.or() + it.io_1;
|
|
597
592
|
// Inline function 'kotlin.text.trimStart' call
|
|
598
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + '\n |' + (Companion_instance_1.qq(module_0) ? this.
|
|
593
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + '\n |' + (Companion_instance_1.qq(module_0) ? this.f1w_1 : '') + '\n |' + it.jo_1 + '\n ');
|
|
599
594
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
600
595
|
return new Emitted(tmp, tmp$ret$0);
|
|
601
596
|
};
|
|
@@ -662,7 +657,7 @@ function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
|
|
|
662
657
|
return isBlank(it) ? '' : '(\n' + it + '\n' + Spacer_instance.qr(2) + ')';
|
|
663
658
|
}
|
|
664
659
|
function emitSerialized($this, _this__u8e3s4) {
|
|
665
|
-
return trimMargin('\n |' + Spacer_instance.qr(3) + 'is Response' + _this__u8e3s4.qp_1 + ' -> Wirespec.RawResponse(\n |' + Spacer_instance.qr(4) + 'statusCode = response.status,\n |' + Spacer_instance.qr(4) + 'headers = ' + $this.
|
|
660
|
+
return trimMargin('\n |' + Spacer_instance.qr(3) + 'is Response' + _this__u8e3s4.qp_1 + ' -> Wirespec.RawResponse(\n |' + Spacer_instance.qr(4) + 'statusCode = response.status,\n |' + Spacer_instance.qr(4) + 'headers = ' + $this.o1w(_this__u8e3s4) + ',\n |' + Spacer_instance.qr(4) + 'body = ' + (!(_this__u8e3s4.sp_1 == null) ? $this.n1w($this, _this__u8e3s4.sp_1) : 'null') + ',\n |' + Spacer_instance.qr(3) + ')\n ');
|
|
666
661
|
}
|
|
667
662
|
function emitDeserialized($this, _this__u8e3s4) {
|
|
668
663
|
var tmp = Spacer_instance.qr(3) + _this__u8e3s4.qp_1 + ' -> Response' + _this__u8e3s4.qp_1 + '(';
|
|
@@ -684,7 +679,7 @@ function emitDeserialized_0($this, _this__u8e3s4) {
|
|
|
684
679
|
function emitDeserializedParams_0($this, _this__u8e3s4, type, fields, spaces, caseSensitive) {
|
|
685
680
|
var trimMargin_0 = trimMargin('\n |' + Spacer_instance.qr(spaces) + $this.wq(_this__u8e3s4.ap_1) + ' =\n |' + Spacer_instance.qr(spaces + 1 | 0) + type + '.' + fields + '\n |' + Spacer_instance.qr(spaces + 2 | 0) + '.entries\n |' + Spacer_instance.qr(spaces + 2 | 0) + '.find { it.key.equals("' + _this__u8e3s4.ap_1.l1() + '", ignoreCase = ' + !caseSensitive + ') }\n |' + Spacer_instance.qr(spaces + 2 | 0) + '?.let { serialization.deserializeParam(it.value, typeOf<' + $this.xp(_this__u8e3s4.bp_1) + '>()) }\n ');
|
|
686
681
|
var tmp;
|
|
687
|
-
if (_this__u8e3s4.bp_1.
|
|
682
|
+
if (_this__u8e3s4.bp_1.cu()) {
|
|
688
683
|
tmp = trimMargin_0;
|
|
689
684
|
} else {
|
|
690
685
|
tmp = trimMargin_0 + '\n' + Spacer_instance.qr(spaces + 2 | 0) + '?: throw IllegalArgumentException("' + $this.wq(_this__u8e3s4.ap_1) + ' is null")';
|
|
@@ -756,7 +751,7 @@ function KotlinEndpointDefinitionEmitter$emit$lambda_2(this$0) {
|
|
|
756
751
|
}
|
|
757
752
|
function KotlinEndpointDefinitionEmitter$emit$lambda_3(this$0) {
|
|
758
753
|
return function (it) {
|
|
759
|
-
return this$0.
|
|
754
|
+
return this$0.q1v(it);
|
|
760
755
|
};
|
|
761
756
|
}
|
|
762
757
|
function KotlinEndpointDefinitionEmitter$emit$lambda_4(this$0) {
|
|
@@ -884,18 +879,18 @@ function sanitizeNegative($this, _this__u8e3s4) {
|
|
|
884
879
|
return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
|
|
885
880
|
}
|
|
886
881
|
function sanitizeEnum($this, _this__u8e3s4) {
|
|
887
|
-
return $this.
|
|
882
|
+
return $this.r1v(joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_'));
|
|
888
883
|
}
|
|
889
884
|
function KotlinEnumDefinitionEmitter$emit$lambda(this$0) {
|
|
890
885
|
return function (it) {
|
|
891
|
-
return this$0.
|
|
886
|
+
return this$0.s1v(sanitizeEnum(this$0, it)) + '("' + it + '")';
|
|
892
887
|
};
|
|
893
888
|
}
|
|
894
889
|
function KotlinEnumDefinitionEmitter() {
|
|
895
890
|
}
|
|
896
891
|
function Companion() {
|
|
897
892
|
Companion_instance_2 = this;
|
|
898
|
-
this.
|
|
893
|
+
this.p1w_1 = setOf(['as', 'break', 'class', 'continue', 'do', 'else', 'false', 'for', 'fun', 'if', 'in', 'interface', 'internal', 'is', 'null', 'object', 'open', 'package', 'return', 'super', 'this', 'throw', 'true', 'try', 'typealias', 'typeof', 'val', 'var', 'when', 'while', 'private', 'public']);
|
|
899
894
|
}
|
|
900
895
|
var Companion_instance_2;
|
|
901
896
|
function Companion_getInstance_0() {
|
|
@@ -908,54 +903,8 @@ function KotlinIdentifierEmitter$sanitize$lambda(it) {
|
|
|
908
903
|
}
|
|
909
904
|
function KotlinIdentifierEmitter() {
|
|
910
905
|
}
|
|
911
|
-
function KotlinIrEmitter$shared$o$source$lambda(element, transformer) {
|
|
912
|
-
var tmp;
|
|
913
|
-
if (element instanceof File) {
|
|
914
|
-
// Inline function 'kotlin.collections.partition' call
|
|
915
|
-
var this_0 = element.u1m_1;
|
|
916
|
-
var first = ArrayList_init_$Create$_0();
|
|
917
|
-
var second = ArrayList_init_$Create$_0();
|
|
918
|
-
var _iterator__ex2g4s = this_0.t();
|
|
919
|
-
while (_iterator__ex2g4s.u()) {
|
|
920
|
-
var element_0 = _iterator__ex2g4s.v();
|
|
921
|
-
if (element_0 instanceof Package) {
|
|
922
|
-
first.x(element_0);
|
|
923
|
-
} else {
|
|
924
|
-
second.x(element_0);
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
var _destruct__k2r9zo = new Pair(first, second);
|
|
928
|
-
var packageElements = _destruct__k2r9zo.ne();
|
|
929
|
-
var rest = _destruct__k2r9zo.oe();
|
|
930
|
-
tmp = element.x1m(VOID, plus_2(plus_1(packageElements, import_0('kotlin.reflect', 'KType')), rest));
|
|
931
|
-
} else {
|
|
932
|
-
tmp = element;
|
|
933
|
-
}
|
|
934
|
-
var transformed = tmp;
|
|
935
|
-
return transformChildren(transformed, transformer);
|
|
936
|
-
}
|
|
937
|
-
function KotlinIrEmitter$shared$o$source$lambda_0(this$0) {
|
|
938
|
-
return function (element, transformer) {
|
|
939
|
-
var tmp;
|
|
940
|
-
if (element instanceof Namespace) {
|
|
941
|
-
var injected = element.z1m_1.equals(Companion_getInstance().m1h('Wirespec')) ? this$0.h1x_1 : emptyList();
|
|
942
|
-
var tmp_0;
|
|
943
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
944
|
-
if (!injected.r()) {
|
|
945
|
-
tmp_0 = withElements(element, plus_2(element.v1m(), injected));
|
|
946
|
-
} else {
|
|
947
|
-
tmp_0 = element;
|
|
948
|
-
}
|
|
949
|
-
tmp = tmp_0;
|
|
950
|
-
} else {
|
|
951
|
-
tmp = element;
|
|
952
|
-
}
|
|
953
|
-
var transformed = tmp;
|
|
954
|
-
return transformChildren(transformed, transformer);
|
|
955
|
-
};
|
|
956
|
-
}
|
|
957
906
|
function _get_sanitizationConfig__sns434($this) {
|
|
958
|
-
var tmp0 = $this.
|
|
907
|
+
var tmp0 = $this.v1w_1;
|
|
959
908
|
var tmp = KProperty1;
|
|
960
909
|
// Inline function 'kotlin.getValue' call
|
|
961
910
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, KotlinIrEmitter$_get_sanitizationConfig_$ref_tnafwf(), null);
|
|
@@ -1020,7 +969,7 @@ function sanitizeFirstIsDigit_0($this, _this__u8e3s4) {
|
|
|
1020
969
|
return tmp;
|
|
1021
970
|
}
|
|
1022
971
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1023
|
-
return Companion_getInstance_1().
|
|
972
|
+
return Companion_getInstance_1().w1w_1.u1(_this__u8e3s4) ? addBackticks(_this__u8e3s4) : _this__u8e3s4;
|
|
1024
973
|
}
|
|
1025
974
|
function sanitizeSymbol($this, _this__u8e3s4) {
|
|
1026
975
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
@@ -1058,56 +1007,9 @@ function sanitizeSymbol($this, _this__u8e3s4) {
|
|
|
1058
1007
|
function sanitizeEnum_0($this, _this__u8e3s4) {
|
|
1059
1008
|
return sanitizeKeywords_0($this, sanitizeFirstIsDigit_0($this, joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_')));
|
|
1060
1009
|
}
|
|
1061
|
-
function buildImports($this, _this__u8e3s4) {
|
|
1062
|
-
// Inline function 'kotlin.collections.distinctBy' call
|
|
1063
|
-
var this_0 = importReferences(_this__u8e3s4);
|
|
1064
|
-
var set = HashSet_init_$Create$();
|
|
1065
|
-
var list = ArrayList_init_$Create$_0();
|
|
1066
|
-
var _iterator__ex2g4s = this_0.t();
|
|
1067
|
-
while (_iterator__ex2g4s.u()) {
|
|
1068
|
-
var e = _iterator__ex2g4s.v();
|
|
1069
|
-
var key = e.lu_1;
|
|
1070
|
-
if (set.x(key)) {
|
|
1071
|
-
list.x(e);
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
// Inline function 'kotlin.collections.map' call
|
|
1075
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
1076
|
-
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(list, 10));
|
|
1077
|
-
var _iterator__ex2g4s_0 = list.t();
|
|
1078
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
1079
|
-
var item = _iterator__ex2g4s_0.v();
|
|
1080
|
-
var tmp$ret$2 = import_0($this.k1v().mr_1 + '.model', item.lu_1);
|
|
1081
|
-
destination.x(tmp$ret$2);
|
|
1082
|
-
}
|
|
1083
|
-
return destination;
|
|
1084
|
-
}
|
|
1085
|
-
function injectCompanionObject($this, _this__u8e3s4, endpoint) {
|
|
1086
|
-
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1087
|
-
var scope = new TransformScope(_this__u8e3s4);
|
|
1088
|
-
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1089
|
-
var tmp = scope;
|
|
1090
|
-
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1091
|
-
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1092
|
-
var this_0 = scope.z1t_1;
|
|
1093
|
-
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1094
|
-
// Inline function 'kotlin.apply' call
|
|
1095
|
-
var this_1 = new TransformerBuilder();
|
|
1096
|
-
this_1.d1h(KotlinIrEmitter$injectCompanionObject$lambda($this, endpoint));
|
|
1097
|
-
var tmp$ret$2 = this_1.e1h();
|
|
1098
|
-
tmp.z1t_1 = transform(this_0, tmp$ret$2);
|
|
1099
|
-
var tmp_0 = scope.z1t_1;
|
|
1100
|
-
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1101
|
-
}
|
|
1102
|
-
function buildCompanionObject($this, endpoint) {
|
|
1103
|
-
var pathTemplate = '/' + joinToString(endpoint.gp_1, '/', VOID, VOID, VOID, VOID, KotlinIrEmitter$buildCompanionObject$lambda);
|
|
1104
|
-
// Inline function 'kotlin.let' call
|
|
1105
|
-
var p0 = trimMargin('\n |companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n | override val pathTemplate = "' + pathTemplate + '"\n | override val method = "' + endpoint.fp_1.toString() + '"\n | override fun server(serialization: Wirespec.Serialization) = object : Wirespec.ServerEdge<Request, Response<*>> {\n | override fun from(request: Wirespec.RawRequest) = fromRawRequest(serialization, request)\n | override fun to(response: Response<*>) = toRawResponse(serialization, response)\n | }\n | override fun client(serialization: Wirespec.Serialization) = object : Wirespec.ClientEdge<Request, Response<*>> {\n | override fun to(request: Request) = toRawRequest(serialization, request)\n | override fun from(response: Wirespec.RawResponse) = fromRawResponse(serialization, response)\n | }\n |}\n ');
|
|
1106
|
-
return raw(p0);
|
|
1107
|
-
}
|
|
1108
1010
|
function Companion_0() {
|
|
1109
1011
|
Companion_instance_3 = this;
|
|
1110
|
-
this.
|
|
1012
|
+
this.w1w_1 = setOf(['as', 'break', 'class', 'continue', 'do', 'else', 'false', 'for', 'fun', 'if', 'in', 'interface', 'internal', 'is', 'null', 'object', 'open', 'package', 'return', 'super', 'this', 'throw', 'true', 'try', 'typealias', 'typeof', 'val', 'var', 'when', 'while', 'private', 'public']);
|
|
1111
1013
|
}
|
|
1112
1014
|
var Companion_instance_3;
|
|
1113
1015
|
function Companion_getInstance_1() {
|
|
@@ -1120,13 +1022,13 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
1120
1022
|
}
|
|
1121
1023
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0) {
|
|
1122
1024
|
return function (name) {
|
|
1123
|
-
var sanitized = name.
|
|
1025
|
+
var sanitized = name.m1h_1.a1() > 1 ? name.q1l() : sanitizeSymbol(this$0, name.r1h());
|
|
1124
1026
|
return new Name(listOf(sanitized));
|
|
1125
1027
|
};
|
|
1126
1028
|
}
|
|
1127
1029
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0) {
|
|
1128
1030
|
return function (name) {
|
|
1129
|
-
return new Name(listOf(sanitizeSymbol(this$0, name.
|
|
1031
|
+
return new Name(listOf(sanitizeSymbol(this$0, name.q1l())));
|
|
1130
1032
|
};
|
|
1131
1033
|
}
|
|
1132
1034
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(this$0) {
|
|
@@ -1137,19 +1039,19 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(this$0) {
|
|
|
1137
1039
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
1138
1040
|
return function (stmt, tr) {
|
|
1139
1041
|
var tmp;
|
|
1042
|
+
var tmp_0;
|
|
1140
1043
|
if (stmt instanceof FunctionCall) {
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
tmp = tmp_0;
|
|
1044
|
+
tmp_0 = stmt.a1m_1.r1h() === 'validate';
|
|
1045
|
+
} else {
|
|
1046
|
+
tmp_0 = false;
|
|
1047
|
+
}
|
|
1048
|
+
if (tmp_0) {
|
|
1049
|
+
tmp = transformChildren(stmt.e1m(VOID, emptyList()), tr);
|
|
1148
1050
|
} else {
|
|
1149
1051
|
if (stmt instanceof ConstructorStatement) {
|
|
1150
|
-
var tmp_1 = tr.
|
|
1052
|
+
var tmp_1 = tr.o1t(stmt.o1m_1);
|
|
1151
1053
|
// Inline function 'kotlin.collections.map' call
|
|
1152
|
-
var this_0 = stmt.
|
|
1054
|
+
var this_0 = stmt.p1m_1;
|
|
1153
1055
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1154
1056
|
var destination = ArrayList_init_$Create$(this_0.a1());
|
|
1155
1057
|
// Inline function 'kotlin.collections.iterator' call
|
|
@@ -1160,12 +1062,12 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1160
1062
|
var name = item.k1();
|
|
1161
1063
|
// Inline function 'kotlin.collections.component2' call
|
|
1162
1064
|
var expr = item.l1();
|
|
1163
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), name), tr.
|
|
1065
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), name), tr.r1t(expr));
|
|
1164
1066
|
destination.x(tmp$ret$3);
|
|
1165
1067
|
}
|
|
1166
1068
|
tmp = new ConstructorStatement(tmp_1, toMap(destination));
|
|
1167
1069
|
} else {
|
|
1168
|
-
tmp =
|
|
1070
|
+
tmp = transformChildren(stmt, tr);
|
|
1169
1071
|
}
|
|
1170
1072
|
}
|
|
1171
1073
|
return tmp;
|
|
@@ -1173,7 +1075,7 @@ function KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
1173
1075
|
}
|
|
1174
1076
|
function KotlinIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
1175
1077
|
return function () {
|
|
1176
|
-
var tmp = Companion_getInstance_1().
|
|
1078
|
+
var tmp = Companion_getInstance_1().w1w_1;
|
|
1177
1079
|
var tmp_0 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
1178
1080
|
var tmp_1 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
|
|
1179
1081
|
var tmp_2 = KotlinIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
|
|
@@ -1186,82 +1088,41 @@ function KotlinIrEmitter$_get_sanitizationConfig_$ref_tnafwf() {
|
|
|
1186
1088
|
return _get_sanitizationConfig__sns434(p0);
|
|
1187
1089
|
};
|
|
1188
1090
|
}
|
|
1189
|
-
function KotlinIrEmitter$
|
|
1190
|
-
this.g1x_1 = 'community.flock.wirespec.kotlin';
|
|
1191
|
-
this.h1x_1 = convertClientServer(new Shared(this.g1x_1));
|
|
1192
|
-
var tmp = this;
|
|
1193
|
-
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1194
|
-
var this_0 = convert(new Shared(this.g1x_1));
|
|
1195
|
-
var scope = new TransformScope(this_0);
|
|
1196
|
-
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1197
|
-
var tmp_0 = scope;
|
|
1198
|
-
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1199
|
-
var this_1 = scope.z1t_1;
|
|
1200
|
-
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1201
|
-
// Inline function 'kotlin.apply' call
|
|
1202
|
-
var this_2 = new TransformerBuilder();
|
|
1203
|
-
this_2.d1h(KotlinIrEmitter$shared$o$source$lambda);
|
|
1204
|
-
var tmp$ret$2 = this_2.e1h();
|
|
1205
|
-
tmp_0.z1t_1 = transform(this_1, tmp$ret$2);
|
|
1206
|
-
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1207
|
-
var tmp_1 = scope;
|
|
1208
|
-
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1209
|
-
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1210
|
-
var this_3 = scope.z1t_1;
|
|
1211
|
-
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1212
|
-
// Inline function 'kotlin.apply' call
|
|
1213
|
-
var this_4 = new TransformerBuilder();
|
|
1214
|
-
this_4.d1h(KotlinIrEmitter$shared$o$source$lambda_0(this));
|
|
1215
|
-
var tmp$ret$7 = this_4.e1h();
|
|
1216
|
-
tmp_1.z1t_1 = transform(this_3, tmp$ret$7);
|
|
1217
|
-
var tmp_2 = scope.z1t_1;
|
|
1218
|
-
var tmp$ret$12 = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
1219
|
-
tmp.i1x_1 = generateKotlin(tmp$ret$12);
|
|
1220
|
-
}
|
|
1221
|
-
protoOf(KotlinIrEmitter$shared$1).r1w = function () {
|
|
1222
|
-
return this.i1x_1;
|
|
1223
|
-
};
|
|
1224
|
-
function KotlinIrEmitter$emit$lambda(this$0) {
|
|
1225
|
-
return function () {
|
|
1226
|
-
return new File(Companion_getInstance().m1h(Companion_instance.lr('community.flock.wirespec.kotlin').or() + 'Wirespec'), listOf(new RawElement(this$0.t1v().r1w())));
|
|
1227
|
-
};
|
|
1228
|
-
}
|
|
1229
|
-
function KotlinIrEmitter$emit$lambda_0(element, transformer) {
|
|
1091
|
+
function KotlinIrEmitter$emitShared$lambda(element, transformer) {
|
|
1230
1092
|
var tmp;
|
|
1231
|
-
if (element instanceof
|
|
1232
|
-
|
|
1093
|
+
if (element instanceof File) {
|
|
1094
|
+
// Inline function 'kotlin.collections.partition' call
|
|
1095
|
+
var this_0 = element.s1m_1;
|
|
1096
|
+
var first = ArrayList_init_$Create$_0();
|
|
1097
|
+
var second = ArrayList_init_$Create$_0();
|
|
1098
|
+
var _iterator__ex2g4s = this_0.t();
|
|
1099
|
+
while (_iterator__ex2g4s.u()) {
|
|
1100
|
+
var element_0 = _iterator__ex2g4s.v();
|
|
1101
|
+
if (element_0 instanceof Package) {
|
|
1102
|
+
first.x(element_0);
|
|
1103
|
+
} else {
|
|
1104
|
+
second.x(element_0);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
var _destruct__k2r9zo = new Pair(first, second);
|
|
1108
|
+
var packageElements = _destruct__k2r9zo.ne();
|
|
1109
|
+
var rest = _destruct__k2r9zo.oe();
|
|
1110
|
+
tmp = element.v1m(VOID, plus_2(plus_1(packageElements, import_0('kotlin.reflect', 'KType')), rest));
|
|
1233
1111
|
} else {
|
|
1234
1112
|
tmp = element;
|
|
1235
1113
|
}
|
|
1236
1114
|
var transformed = tmp;
|
|
1237
|
-
return
|
|
1238
|
-
}
|
|
1239
|
-
function KotlinIrEmitter$emit$lambda$lambda(this$0) {
|
|
1240
|
-
return function (it) {
|
|
1241
|
-
return sanitizeEnum_0(this$0, it);
|
|
1242
|
-
};
|
|
1243
|
-
}
|
|
1244
|
-
function KotlinIrEmitter$emit$lambda_1(this$0) {
|
|
1245
|
-
return function (element, transformer) {
|
|
1246
|
-
var tmp;
|
|
1247
|
-
if (element instanceof Enum) {
|
|
1248
|
-
tmp = withLabelField(element, KotlinIrEmitter$emit$lambda$lambda(this$0));
|
|
1249
|
-
} else {
|
|
1250
|
-
tmp = element;
|
|
1251
|
-
}
|
|
1252
|
-
var transformed = tmp;
|
|
1253
|
-
return transformChildren(transformed, transformer);
|
|
1254
|
-
};
|
|
1115
|
+
return transformChildren_0(transformed, transformer);
|
|
1255
1116
|
}
|
|
1256
|
-
function KotlinIrEmitter$
|
|
1117
|
+
function KotlinIrEmitter$emitShared$lambda_0($clientServer) {
|
|
1257
1118
|
return function (element, transformer) {
|
|
1258
1119
|
var tmp;
|
|
1259
|
-
if (element instanceof
|
|
1260
|
-
var injected = element.
|
|
1120
|
+
if (element instanceof Namespace) {
|
|
1121
|
+
var injected = element.x1m_1.equals(Companion_getInstance().l1h('Wirespec')) ? $clientServer : emptyList();
|
|
1261
1122
|
var tmp_0;
|
|
1262
1123
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1263
1124
|
if (!injected.r()) {
|
|
1264
|
-
tmp_0 = withElements(element, plus_2(element.
|
|
1125
|
+
tmp_0 = withElements(element, plus_2(element.t1m(), injected));
|
|
1265
1126
|
} else {
|
|
1266
1127
|
tmp_0 = element;
|
|
1267
1128
|
}
|
|
@@ -1270,56 +1131,76 @@ function KotlinIrEmitter$injectCompanionObject$lambda(this$0, $endpoint) {
|
|
|
1270
1131
|
tmp = element;
|
|
1271
1132
|
}
|
|
1272
1133
|
var transformed = tmp;
|
|
1273
|
-
return
|
|
1134
|
+
return transformChildren_0(transformed, transformer);
|
|
1274
1135
|
};
|
|
1275
1136
|
}
|
|
1276
|
-
function KotlinIrEmitter$
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
} else {
|
|
1281
|
-
if (it instanceof Param) {
|
|
1282
|
-
tmp = '{' + it.lp_1.l1() + '}';
|
|
1283
|
-
} else {
|
|
1284
|
-
noWhenBranchMatchedException();
|
|
1285
|
-
}
|
|
1286
|
-
}
|
|
1287
|
-
return tmp;
|
|
1137
|
+
function KotlinIrEmitter$emit$lambda(this$0) {
|
|
1138
|
+
return function (it) {
|
|
1139
|
+
return sanitizeEnum_0(this$0, it);
|
|
1140
|
+
};
|
|
1288
1141
|
}
|
|
1289
1142
|
function KotlinIrEmitter(packageName, emitShared) {
|
|
1290
1143
|
Companion_getInstance_1();
|
|
1291
1144
|
packageName = packageName === VOID ? Companion_instance.lr('community.flock.wirespec.generated') : packageName;
|
|
1292
1145
|
emitShared = emitShared === VOID ? Companion_instance_0.go() : emitShared;
|
|
1293
|
-
this.
|
|
1294
|
-
this.
|
|
1295
|
-
this.
|
|
1296
|
-
this.
|
|
1297
|
-
this.
|
|
1146
|
+
this.q1w_1 = packageName;
|
|
1147
|
+
this.r1w_1 = emitShared;
|
|
1148
|
+
this.s1w_1 = KotlinGenerator_instance;
|
|
1149
|
+
this.t1w_1 = FileExtension_Kotlin_getInstance();
|
|
1150
|
+
this.u1w_1 = listOf_0([import_0('community.flock.wirespec.kotlin', 'Wirespec'), import_0('kotlin.reflect', 'typeOf')]);
|
|
1298
1151
|
var tmp = this;
|
|
1299
|
-
tmp.
|
|
1300
|
-
var tmp_0 = this;
|
|
1301
|
-
tmp_0.p1x_1 = new KotlinIrEmitter$shared$1();
|
|
1152
|
+
tmp.v1w_1 = lazy(KotlinIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
1302
1153
|
}
|
|
1303
|
-
protoOf(KotlinIrEmitter).
|
|
1304
|
-
return this.
|
|
1154
|
+
protoOf(KotlinIrEmitter).c1v = function () {
|
|
1155
|
+
return this.q1w_1;
|
|
1305
1156
|
};
|
|
1306
|
-
protoOf(KotlinIrEmitter).
|
|
1307
|
-
return this.
|
|
1157
|
+
protoOf(KotlinIrEmitter).j1u = function () {
|
|
1158
|
+
return this.s1w_1;
|
|
1308
1159
|
};
|
|
1309
1160
|
protoOf(KotlinIrEmitter).eq = function () {
|
|
1310
|
-
return this.
|
|
1311
|
-
};
|
|
1312
|
-
protoOf(KotlinIrEmitter).t1v = function () {
|
|
1313
|
-
return this.p1x_1;
|
|
1161
|
+
return this.t1w_1;
|
|
1314
1162
|
};
|
|
1315
|
-
protoOf(KotlinIrEmitter).
|
|
1316
|
-
var
|
|
1317
|
-
|
|
1163
|
+
protoOf(KotlinIrEmitter).m1u = function () {
|
|
1164
|
+
var packageName = Companion_instance.lr('community.flock.wirespec.kotlin');
|
|
1165
|
+
var clientServer = convertClientServer(packageName);
|
|
1166
|
+
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1167
|
+
var this_0 = convert(packageName);
|
|
1168
|
+
var scope = new TransformScope(this_0);
|
|
1169
|
+
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1170
|
+
var tmp = scope;
|
|
1171
|
+
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1172
|
+
var this_1 = scope.w1t_1;
|
|
1173
|
+
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1174
|
+
// Inline function 'kotlin.apply' call
|
|
1175
|
+
var this_2 = new TransformerBuilder();
|
|
1176
|
+
this_2.c1h(KotlinIrEmitter$emitShared$lambda);
|
|
1177
|
+
var tmp$ret$2 = this_2.d1h();
|
|
1178
|
+
tmp.w1t_1 = transform(this_1, tmp$ret$2);
|
|
1179
|
+
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1180
|
+
var tmp_0 = scope;
|
|
1181
|
+
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1182
|
+
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1183
|
+
var this_3 = scope.w1t_1;
|
|
1184
|
+
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1185
|
+
// Inline function 'kotlin.apply' call
|
|
1186
|
+
var this_4 = new TransformerBuilder();
|
|
1187
|
+
this_4.c1h(KotlinIrEmitter$emitShared$lambda_0(clientServer));
|
|
1188
|
+
var tmp$ret$7 = this_4.d1h();
|
|
1189
|
+
tmp_0.w1t_1 = transform(this_3, tmp$ret$7);
|
|
1190
|
+
var tmp_1 = scope.w1t_1;
|
|
1191
|
+
var wirespecShared = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1192
|
+
var tmp_2;
|
|
1193
|
+
if (this.r1w_1.ho_1) {
|
|
1194
|
+
tmp_2 = wirespecShared;
|
|
1195
|
+
} else {
|
|
1196
|
+
tmp_2 = null;
|
|
1197
|
+
}
|
|
1198
|
+
return tmp_2;
|
|
1318
1199
|
};
|
|
1319
1200
|
protoOf(KotlinIrEmitter).uq = function (definition, module_0, logger) {
|
|
1320
|
-
var file =
|
|
1201
|
+
var file = emit_0.call(this, definition, module_0, logger);
|
|
1321
1202
|
// Inline function 'kotlin.takeIf' call
|
|
1322
|
-
var this_0 = this.
|
|
1203
|
+
var this_0 = this.u1w_1;
|
|
1323
1204
|
var tmp;
|
|
1324
1205
|
if (Companion_instance_1.qq(module_0)) {
|
|
1325
1206
|
tmp = this_0;
|
|
@@ -1327,41 +1208,14 @@ protoOf(KotlinIrEmitter).uq = function (definition, module_0, logger) {
|
|
|
1327
1208
|
tmp = null;
|
|
1328
1209
|
}
|
|
1329
1210
|
var tmp$ret$1 = tmp;
|
|
1330
|
-
return placeInPackage(prependImports(file, tmp$ret$1), this.
|
|
1211
|
+
return placeInPackage(prependImports(file, tmp$ret$1), this.c1v(), definition);
|
|
1331
1212
|
};
|
|
1332
1213
|
protoOf(KotlinIrEmitter).up = function (type, module_0) {
|
|
1333
|
-
|
|
1334
|
-
var this_0 = sanitizeNames(convertWithValidation(type, module_0), _get_sanitizationConfig__sns434(this));
|
|
1335
|
-
var scope = new TransformScope(this_0);
|
|
1336
|
-
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1337
|
-
var tmp = scope;
|
|
1338
|
-
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1339
|
-
var this_1 = scope.z1t_1;
|
|
1340
|
-
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1341
|
-
// Inline function 'kotlin.apply' call
|
|
1342
|
-
var this_2 = new TransformerBuilder();
|
|
1343
|
-
this_2.d1h(KotlinIrEmitter$emit$lambda_0);
|
|
1344
|
-
var tmp$ret$2 = this_2.e1h();
|
|
1345
|
-
tmp.z1t_1 = transform(this_1, tmp$ret$2);
|
|
1346
|
-
var tmp_0 = scope.z1t_1;
|
|
1347
|
-
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1214
|
+
return ensureEmptyStructHasConstructor(sanitizeNames(convertWithValidation(type, module_0), _get_sanitizationConfig__sns434(this)));
|
|
1348
1215
|
};
|
|
1349
1216
|
protoOf(KotlinIrEmitter).ir = function (enum_0, module_0) {
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
var scope = new TransformScope(this_0);
|
|
1353
|
-
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1354
|
-
var tmp = scope;
|
|
1355
|
-
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1356
|
-
var this_1 = scope.z1t_1;
|
|
1357
|
-
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1358
|
-
// Inline function 'kotlin.apply' call
|
|
1359
|
-
var this_2 = new TransformerBuilder();
|
|
1360
|
-
this_2.d1h(KotlinIrEmitter$emit$lambda_1(this));
|
|
1361
|
-
var tmp$ret$2 = this_2.e1h();
|
|
1362
|
-
tmp.z1t_1 = transform(this_1, tmp$ret$2);
|
|
1363
|
-
var tmp_0 = scope.z1t_1;
|
|
1364
|
-
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1217
|
+
var tmp = sanitizeNames(convert_0(enum_0), _get_sanitizationConfig__sns434(this));
|
|
1218
|
+
return injectEnumLabelField(tmp, KotlinIrEmitter$emit$lambda(this));
|
|
1365
1219
|
};
|
|
1366
1220
|
protoOf(KotlinIrEmitter).yq = function (union) {
|
|
1367
1221
|
return sanitizeNames(convert_1(union), _get_sanitizationConfig__sns434(this));
|
|
@@ -1370,7 +1224,7 @@ protoOf(KotlinIrEmitter).dr = function (refined) {
|
|
|
1370
1224
|
var file = sanitizeNames(convert_2(refined), _get_sanitizationConfig__sns434(this));
|
|
1371
1225
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1372
1226
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1373
|
-
var tmp0 = file.
|
|
1227
|
+
var tmp0 = file.t1m();
|
|
1374
1228
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1375
1229
|
var destination = ArrayList_init_$Create$_0();
|
|
1376
1230
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1380,58 +1234,15 @@ protoOf(KotlinIrEmitter).dr = function (refined) {
|
|
|
1380
1234
|
destination.x(element);
|
|
1381
1235
|
}
|
|
1382
1236
|
}
|
|
1383
|
-
var
|
|
1384
|
-
var
|
|
1385
|
-
|
|
1386
|
-
tmp = null;
|
|
1387
|
-
} else {
|
|
1388
|
-
// Inline function 'kotlin.collections.map' call
|
|
1389
|
-
var this_0 = struct.g1n_1;
|
|
1390
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
1391
|
-
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1392
|
-
var _iterator__ex2g4s_0 = this_0.t();
|
|
1393
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
1394
|
-
var item = _iterator__ex2g4s_0.v();
|
|
1395
|
-
var tmp$ret$3 = item.q1n(VOID, VOID, true);
|
|
1396
|
-
destination_0.x(tmp$ret$3);
|
|
1397
|
-
}
|
|
1398
|
-
var tmp_0 = destination_0;
|
|
1399
|
-
// Inline function 'kotlin.collections.map' call
|
|
1400
|
-
var this_1 = struct.j1n_1;
|
|
1401
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
1402
|
-
var destination_1 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
1403
|
-
var _iterator__ex2g4s_1 = this_1.t();
|
|
1404
|
-
while (_iterator__ex2g4s_1.u()) {
|
|
1405
|
-
var item_0 = _iterator__ex2g4s_1.v();
|
|
1406
|
-
var tmp_1;
|
|
1407
|
-
if (item_0 instanceof Function) {
|
|
1408
|
-
tmp_1 = item_0.b1k(VOID, VOID, VOID, VOID, VOID, VOID, VOID, true);
|
|
1409
|
-
} else {
|
|
1410
|
-
tmp_1 = item_0;
|
|
1411
|
-
}
|
|
1412
|
-
var tmp$ret$6 = tmp_1;
|
|
1413
|
-
destination_1.x(tmp$ret$6);
|
|
1414
|
-
}
|
|
1415
|
-
tmp = struct.l1n(VOID, tmp_0, VOID, VOID, destination_1);
|
|
1416
|
-
}
|
|
1417
|
-
var updatedStruct = tmp;
|
|
1418
|
-
var tmp_2 = Companion_getInstance().m1h(sanitize_0(this, refined.br_1));
|
|
1419
|
-
var tmp_3;
|
|
1420
|
-
if (updatedStruct == null) {
|
|
1421
|
-
tmp_3 = null;
|
|
1422
|
-
} else {
|
|
1423
|
-
// Inline function 'kotlin.let' call
|
|
1424
|
-
tmp_3 = listOf(updatedStruct);
|
|
1425
|
-
}
|
|
1426
|
-
var tmp2_elvis_lhs = tmp_3;
|
|
1427
|
-
return new File(tmp_2, tmp2_elvis_lhs == null ? emptyList() : tmp2_elvis_lhs);
|
|
1237
|
+
var tmp0_safe_receiver = firstOrNull_0(destination);
|
|
1238
|
+
var updatedStruct = tmp0_safe_receiver == null ? null : markMembersAsOverride(tmp0_safe_receiver);
|
|
1239
|
+
return new File(Companion_getInstance().l1h(sanitize_0(this, refined.br_1)), listOfNotNull_0(updatedStruct));
|
|
1428
1240
|
};
|
|
1429
1241
|
protoOf(KotlinIrEmitter).jr = function (endpoint) {
|
|
1430
|
-
var imports =
|
|
1431
|
-
var file = convert_3(endpoint);
|
|
1242
|
+
var imports = buildModelImports(endpoint, this.c1v());
|
|
1432
1243
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1433
1244
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1434
|
-
var tmp0 =
|
|
1245
|
+
var tmp0 = convert_3(endpoint).t1m();
|
|
1435
1246
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1436
1247
|
var destination = ArrayList_init_$Create$_0();
|
|
1437
1248
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1443,48 +1254,52 @@ protoOf(KotlinIrEmitter).jr = function (endpoint) {
|
|
|
1443
1254
|
}
|
|
1444
1255
|
var tmp$ret$2 = firstOrNull_0(destination);
|
|
1445
1256
|
var endpointNamespace = ensureNotNull(tmp$ret$2);
|
|
1446
|
-
var body = injectCompanionObject(
|
|
1447
|
-
var
|
|
1448
|
-
|
|
1257
|
+
var body = injectCompanionObject(endpointNamespace, endpoint);
|
|
1258
|
+
var tmp = sanitizeNames(new File(Companion_getInstance().l1h(sanitize_0(this, endpoint.ep_1)), listOf(body)), _get_sanitizationConfig__sns434(this));
|
|
1259
|
+
// Inline function 'kotlin.takeIf' call
|
|
1260
|
+
var tmp_0;
|
|
1449
1261
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1450
1262
|
if (!imports.r()) {
|
|
1451
|
-
|
|
1263
|
+
tmp_0 = imports;
|
|
1452
1264
|
} else {
|
|
1453
|
-
|
|
1265
|
+
tmp_0 = null;
|
|
1454
1266
|
}
|
|
1455
|
-
|
|
1267
|
+
var tmp$ret$5 = tmp_0;
|
|
1268
|
+
return prependImports(tmp, tmp$ret$5);
|
|
1456
1269
|
};
|
|
1457
1270
|
protoOf(KotlinIrEmitter).xq = function (channel) {
|
|
1458
|
-
var
|
|
1459
|
-
|
|
1460
|
-
var
|
|
1271
|
+
var tmp = sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
|
|
1272
|
+
// Inline function 'kotlin.takeIf' call
|
|
1273
|
+
var this_0 = buildModelImports(channel, this.c1v());
|
|
1274
|
+
var tmp_0;
|
|
1461
1275
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1462
|
-
if (!
|
|
1463
|
-
|
|
1276
|
+
if (!this_0.r()) {
|
|
1277
|
+
tmp_0 = this_0;
|
|
1464
1278
|
} else {
|
|
1465
|
-
|
|
1279
|
+
tmp_0 = null;
|
|
1466
1280
|
}
|
|
1467
|
-
|
|
1281
|
+
var tmp$ret$2 = tmp_0;
|
|
1282
|
+
return prependImports(tmp, tmp$ret$2);
|
|
1468
1283
|
};
|
|
1469
|
-
protoOf(KotlinIrEmitter).
|
|
1470
|
-
var imports =
|
|
1471
|
-
var endpointImport = import_0(this.
|
|
1284
|
+
protoOf(KotlinIrEmitter).o1u = function (endpoint) {
|
|
1285
|
+
var imports = buildModelImports(endpoint, this.c1v());
|
|
1286
|
+
var endpointImport = import_0(this.c1v().mr_1 + '.endpoint', endpoint.ep_1.l1());
|
|
1472
1287
|
var file = sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this));
|
|
1473
|
-
var subPackageName = plus_0(this.
|
|
1474
|
-
var tmp = Companion_getInstance().
|
|
1288
|
+
var subPackageName = plus_0(this.c1v(), 'client');
|
|
1289
|
+
var tmp = Companion_getInstance().l1h(subPackageName.or() + file.r1m_1.w1l());
|
|
1475
1290
|
// Inline function 'kotlin.collections.buildList' call
|
|
1476
1291
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1477
1292
|
// Inline function 'kotlin.apply' call
|
|
1478
1293
|
var this_0 = ArrayList_init_$Create$_0();
|
|
1479
1294
|
this_0.x(new Package(subPackageName.mr_1));
|
|
1480
|
-
this_0.e1(this.
|
|
1295
|
+
this_0.e1(this.u1w_1);
|
|
1481
1296
|
this_0.e1(imports);
|
|
1482
1297
|
this_0.x(endpointImport);
|
|
1483
|
-
this_0.e1(file.
|
|
1298
|
+
this_0.e1(file.s1m_1);
|
|
1484
1299
|
var tmp$ret$3 = this_0.o5();
|
|
1485
1300
|
return new File(tmp, tmp$ret$3);
|
|
1486
1301
|
};
|
|
1487
|
-
protoOf(KotlinIrEmitter).
|
|
1302
|
+
protoOf(KotlinIrEmitter).n1u = function (endpoints, logger) {
|
|
1488
1303
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1489
1304
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1490
1305
|
var destination = ArrayList_init_$Create$_0();
|
|
@@ -1500,7 +1315,7 @@ protoOf(KotlinIrEmitter).p1u = function (endpoints, logger) {
|
|
|
1500
1315
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1501
1316
|
while (_iterator__ex2g4s_0.u()) {
|
|
1502
1317
|
var e = _iterator__ex2g4s_0.v();
|
|
1503
|
-
var key = e.
|
|
1318
|
+
var key = e.ku_1;
|
|
1504
1319
|
if (set.x(key)) {
|
|
1505
1320
|
list_0.x(e);
|
|
1506
1321
|
}
|
|
@@ -1511,7 +1326,7 @@ protoOf(KotlinIrEmitter).p1u = function (endpoints, logger) {
|
|
|
1511
1326
|
var _iterator__ex2g4s_1 = list_0.t();
|
|
1512
1327
|
while (_iterator__ex2g4s_1.u()) {
|
|
1513
1328
|
var item = _iterator__ex2g4s_1.v();
|
|
1514
|
-
var tmp$ret$5 = import_0(this.
|
|
1329
|
+
var tmp$ret$5 = import_0(this.c1v().mr_1 + '.model', item.ku_1);
|
|
1515
1330
|
destination_0.x(tmp$ret$5);
|
|
1516
1331
|
}
|
|
1517
1332
|
var imports = destination_0;
|
|
@@ -1521,7 +1336,7 @@ protoOf(KotlinIrEmitter).p1u = function (endpoints, logger) {
|
|
|
1521
1336
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1522
1337
|
while (_iterator__ex2g4s_2.u()) {
|
|
1523
1338
|
var item_0 = _iterator__ex2g4s_2.v();
|
|
1524
|
-
var tmp$ret$8 = import_0(this.
|
|
1339
|
+
var tmp$ret$8 = import_0(this.c1v().mr_1 + '.endpoint', item_0.ep_1.l1());
|
|
1525
1340
|
destination_1.x(tmp$ret$8);
|
|
1526
1341
|
}
|
|
1527
1342
|
var endpointImports = destination_1;
|
|
@@ -1531,34 +1346,111 @@ protoOf(KotlinIrEmitter).p1u = function (endpoints, logger) {
|
|
|
1531
1346
|
var _iterator__ex2g4s_3 = endpoints.t();
|
|
1532
1347
|
while (_iterator__ex2g4s_3.u()) {
|
|
1533
1348
|
var item_1 = _iterator__ex2g4s_3.v();
|
|
1534
|
-
var tmp$ret$11 = import_0(this.
|
|
1349
|
+
var tmp$ret$11 = import_0(this.c1v().mr_1 + '.client', item_1.ep_1.l1() + 'Client');
|
|
1535
1350
|
destination_2.x(tmp$ret$11);
|
|
1536
1351
|
}
|
|
1537
1352
|
var clientImports = destination_2;
|
|
1538
1353
|
var allImports = plus_2(plus_2(imports, endpointImports), clientImports);
|
|
1539
1354
|
var file = sanitizeNames(emitClient.call(this, endpoints, logger), _get_sanitizationConfig__sns434(this));
|
|
1540
|
-
var tmp = Companion_getInstance().
|
|
1355
|
+
var tmp = Companion_getInstance().l1h(this.c1v().or() + file.r1m_1.w1l());
|
|
1541
1356
|
// Inline function 'kotlin.collections.buildList' call
|
|
1542
1357
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1543
1358
|
// Inline function 'kotlin.apply' call
|
|
1544
1359
|
var this_0 = ArrayList_init_$Create$_0();
|
|
1545
|
-
this_0.x(new Package(this.
|
|
1546
|
-
this_0.e1(this.
|
|
1360
|
+
this_0.x(new Package(this.c1v().mr_1));
|
|
1361
|
+
this_0.e1(this.u1w_1);
|
|
1547
1362
|
this_0.e1(allImports);
|
|
1548
|
-
this_0.e1(file.
|
|
1363
|
+
this_0.e1(file.s1m_1);
|
|
1549
1364
|
var tmp$ret$17 = this_0.o5();
|
|
1550
1365
|
return new File(tmp, tmp$ret$17);
|
|
1551
1366
|
};
|
|
1367
|
+
function buildModelImports(_this__u8e3s4, packageName) {
|
|
1368
|
+
// Inline function 'kotlin.collections.distinctBy' call
|
|
1369
|
+
var this_0 = importReferences(_this__u8e3s4);
|
|
1370
|
+
var set = HashSet_init_$Create$();
|
|
1371
|
+
var list = ArrayList_init_$Create$_0();
|
|
1372
|
+
var _iterator__ex2g4s = this_0.t();
|
|
1373
|
+
while (_iterator__ex2g4s.u()) {
|
|
1374
|
+
var e = _iterator__ex2g4s.v();
|
|
1375
|
+
var key = e.ku_1;
|
|
1376
|
+
if (set.x(key)) {
|
|
1377
|
+
list.x(e);
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
// Inline function 'kotlin.collections.map' call
|
|
1381
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1382
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(list, 10));
|
|
1383
|
+
var _iterator__ex2g4s_0 = list.t();
|
|
1384
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
1385
|
+
var item = _iterator__ex2g4s_0.v();
|
|
1386
|
+
var tmp$ret$2 = import_0(packageName.mr_1 + '.model', item.ku_1);
|
|
1387
|
+
destination.x(tmp$ret$2);
|
|
1388
|
+
}
|
|
1389
|
+
return destination;
|
|
1390
|
+
}
|
|
1391
|
+
function injectCompanionObject(_this__u8e3s4, endpoint) {
|
|
1392
|
+
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1393
|
+
var scope = new TransformScope(_this__u8e3s4);
|
|
1394
|
+
// Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
|
|
1395
|
+
var tmp = scope;
|
|
1396
|
+
// Inline function 'community.flock.wirespec.ir.core.injectAfter' call
|
|
1397
|
+
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1398
|
+
var this_0 = scope.w1t_1;
|
|
1399
|
+
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1400
|
+
// Inline function 'kotlin.apply' call
|
|
1401
|
+
var this_1 = new TransformerBuilder();
|
|
1402
|
+
this_1.c1h(injectCompanionObject$lambda(endpoint));
|
|
1403
|
+
var tmp$ret$2 = this_1.d1h();
|
|
1404
|
+
tmp.w1t_1 = transform(this_0, tmp$ret$2);
|
|
1405
|
+
var tmp_0 = scope.w1t_1;
|
|
1406
|
+
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1407
|
+
}
|
|
1408
|
+
function buildCompanionObject(endpoint) {
|
|
1409
|
+
var pathTemplate = '/' + joinToString(endpoint.gp_1, '/', VOID, VOID, VOID, VOID, buildCompanionObject$lambda);
|
|
1410
|
+
// Inline function 'kotlin.let' call
|
|
1411
|
+
var p0 = trimMargin('\n |companion object: Wirespec.Server<Request, Response<*>>, Wirespec.Client<Request, Response<*>> {\n | override val pathTemplate = "' + pathTemplate + '"\n | override val method = "' + endpoint.fp_1.toString() + '"\n | override fun server(serialization: Wirespec.Serialization) = object : Wirespec.ServerEdge<Request, Response<*>> {\n | override fun from(request: Wirespec.RawRequest) = fromRawRequest(serialization, request)\n | override fun to(response: Response<*>) = toRawResponse(serialization, response)\n | }\n | override fun client(serialization: Wirespec.Serialization) = object : Wirespec.ClientEdge<Request, Response<*>> {\n | override fun to(request: Request) = toRawRequest(serialization, request)\n | override fun from(response: Wirespec.RawResponse) = fromRawResponse(serialization, response)\n | }\n |}\n ');
|
|
1412
|
+
return raw(p0);
|
|
1413
|
+
}
|
|
1414
|
+
function injectCompanionObject$lambda($endpoint) {
|
|
1415
|
+
return function (element, transformer) {
|
|
1416
|
+
var tmp;
|
|
1417
|
+
if (element instanceof Interface) {
|
|
1418
|
+
var injected = element.j1n_1.equals(Companion_getInstance().l1h('Handler')) ? listOf(buildCompanionObject($endpoint)) : emptyList();
|
|
1419
|
+
var tmp_0;
|
|
1420
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1421
|
+
if (!injected.r()) {
|
|
1422
|
+
tmp_0 = withElements(element, plus_2(element.t1m(), injected));
|
|
1423
|
+
} else {
|
|
1424
|
+
tmp_0 = element;
|
|
1425
|
+
}
|
|
1426
|
+
tmp = tmp_0;
|
|
1427
|
+
} else {
|
|
1428
|
+
tmp = element;
|
|
1429
|
+
}
|
|
1430
|
+
var transformed = tmp;
|
|
1431
|
+
return transformChildren_0(transformed, transformer);
|
|
1432
|
+
};
|
|
1433
|
+
}
|
|
1434
|
+
function buildCompanionObject$lambda(it) {
|
|
1435
|
+
var tmp;
|
|
1436
|
+
if (it instanceof Literal) {
|
|
1437
|
+
tmp = it.hq_1;
|
|
1438
|
+
} else {
|
|
1439
|
+
if (it instanceof Param) {
|
|
1440
|
+
tmp = '{' + it.lp_1.l1() + '}';
|
|
1441
|
+
} else {
|
|
1442
|
+
noWhenBranchMatchedException();
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
return tmp;
|
|
1446
|
+
}
|
|
1552
1447
|
function KotlinRefinedTypeDefinitionEmitter() {
|
|
1553
1448
|
}
|
|
1554
1449
|
function KotlinShared() {
|
|
1555
1450
|
KotlinShared_instance = this;
|
|
1556
|
-
this.
|
|
1557
|
-
this.
|
|
1451
|
+
this.j1w_1 = 'community.flock.wirespec.kotlin';
|
|
1452
|
+
this.k1w_1 = trimMargin('\n |package ' + this.j1w_1 + '\n |\n |import kotlin.reflect.KType\n |\n |object Wirespec {\n |' + Spacer_instance.toString() + 'interface Enum { val label: String }\n |' + Spacer_instance.toString() + 'interface Endpoint\n |' + Spacer_instance.toString() + 'interface Refined<T> { val value: T }\n |' + Spacer_instance.toString() + 'interface Path\n |' + Spacer_instance.toString() + 'interface Queries\n |' + Spacer_instance.toString() + 'interface Headers\n |' + Spacer_instance.toString() + 'interface Handler\n |' + Spacer_instance.toString() + 'interface ServerEdge<Req: Request<*>, Res: Response<*>> { \n |' + Spacer_instance.toString() + 'fun from(request: RawRequest): Req \n |' + Spacer_instance.toString() + 'fun to(response: Res): RawResponse\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface ClientEdge<Req: Request<*>, Res: Response<*>> { \n |' + Spacer_instance.qr(2) + 'fun to(request: Req): RawRequest\n |' + Spacer_instance.qr(2) + 'fun from(response: RawResponse): Res\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req : Request<*>, Res : Response<*>> {\n |' + Spacer_instance.qr(2) + 'val pathTemplate: String\n |' + Spacer_instance.qr(2) + 'val method: String\n |' + Spacer_instance.qr(2) + 'fun client(serialization: Serialization): ClientEdge<Req, Res>\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Server<Req : Request<*>, Res : Response<*>> {\n |' + Spacer_instance.qr(2) + 'val pathTemplate: String\n |' + Spacer_instance.qr(2) + 'val method: String\n |' + Spacer_instance.qr(2) + 'fun server(serialization: Serialization): ServerEdge<Req, Res>\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'enum class Method { GET, PUT, POST, DELETE, OPTIONS, HEAD, PATCH, TRACE }\n |' + Spacer_instance.toString() + 'interface Request<T : Any> { val path: Path; val method: Method; val queries: Queries; val headers: Headers; val body: T; interface Headers : Wirespec.Headers }\n |' + Spacer_instance.toString() + 'interface Response<T : Any> { val status: Int; val headers: Headers; val body: T; interface Headers : Wirespec.Headers }\n |' + Spacer_instance.toString() + 'interface Serialization : Serializer, Deserializer\n |' + Spacer_instance.toString() + 'interface Serializer : BodySerializer, PathSerializer, ParamSerializer\n |' + Spacer_instance.toString() + 'interface Deserializer : BodyDeserializer, PathDeserializer, ParamDeserializer\n |' + Spacer_instance.toString() + 'interface BodySerialization : BodySerializer, BodyDeserializer\n |' + Spacer_instance.toString() + 'interface BodySerializer { fun <T : Any> serializeBody(t: T, kType: KType): ByteArray }\n |' + Spacer_instance.toString() + 'interface BodyDeserializer { fun <T : Any> deserializeBody(raw: ByteArray, kType: KType): T }\n |' + Spacer_instance.toString() + 'interface PathSerialization : PathSerializer, PathDeserializer\n |' + Spacer_instance.toString() + 'interface PathSerializer { fun <T : Any> serializePath(t: T, kType: KType): String }\n |' + Spacer_instance.toString() + 'interface PathDeserializer { fun <T : Any> deserializePath(raw: String, kType: KType): T }\n |' + Spacer_instance.toString() + 'interface ParamSerialization : ParamSerializer, ParamDeserializer\n |' + Spacer_instance.toString() + 'interface ParamSerializer { fun <T : Any> serializeParam(value: T, kType: KType): List<String> }\n |' + Spacer_instance.toString() + 'interface ParamDeserializer { fun <T : Any> deserializeParam(values: List<String>, kType: KType): T }\n |' + Spacer_instance.toString() + 'data class RawRequest(val method: String, val path: List<String>, val queries: Map<String, List<String>>, val headers: Map<String, List<String>>, val body: ByteArray?) \n |' + Spacer_instance.toString() + 'data class RawResponse(val statusCode: Int, val headers: Map<String, List<String>>, val body: ByteArray?)\n |}\n ');
|
|
1558
1453
|
}
|
|
1559
|
-
protoOf(KotlinShared).r1w = function () {
|
|
1560
|
-
return this.a1x_1;
|
|
1561
|
-
};
|
|
1562
1454
|
protoOf(KotlinShared).toString = function () {
|
|
1563
1455
|
return 'KotlinShared';
|
|
1564
1456
|
};
|
|
@@ -1598,24 +1490,25 @@ protoOf(KotlinEmitter).vp = emit_5;
|
|
|
1598
1490
|
protoOf(KotlinEmitter).wp = emit_6;
|
|
1599
1491
|
protoOf(KotlinEmitter).xp = emit_7;
|
|
1600
1492
|
protoOf(KotlinEmitter).yp = emit_8;
|
|
1601
|
-
protoOf(KotlinEmitter).ir =
|
|
1602
|
-
protoOf(KotlinEmitter).dr =
|
|
1603
|
-
protoOf(KotlinEmitter).jr =
|
|
1604
|
-
protoOf(KotlinEmitter).yq =
|
|
1493
|
+
protoOf(KotlinEmitter).ir = emit_12;
|
|
1494
|
+
protoOf(KotlinEmitter).dr = emit_11;
|
|
1495
|
+
protoOf(KotlinEmitter).jr = emit_13;
|
|
1496
|
+
protoOf(KotlinEmitter).yq = emit_10;
|
|
1605
1497
|
protoOf(KotlinEmitter).wq = emit_3;
|
|
1606
1498
|
protoOf(KotlinEmitter).xq = emit_9;
|
|
1607
|
-
protoOf(KotlinEmitter).
|
|
1608
|
-
protoOf(KotlinEmitter).
|
|
1499
|
+
protoOf(KotlinEmitter).p1v = emit_14;
|
|
1500
|
+
protoOf(KotlinEmitter).q1v = emit_15;
|
|
1609
1501
|
protoOf(KotlinEmitter).kr = emitValidator;
|
|
1610
|
-
protoOf(KotlinEmitter).
|
|
1611
|
-
protoOf(KotlinEmitter).
|
|
1612
|
-
protoOf(KotlinEmitter).
|
|
1613
|
-
protoOf(KotlinEmitter).
|
|
1614
|
-
protoOf(KotlinEmitter).
|
|
1615
|
-
protoOf(KotlinEmitter).
|
|
1616
|
-
protoOf(KotlinEmitter).
|
|
1617
|
-
protoOf(KotlinEmitter).
|
|
1618
|
-
protoOf(KotlinIrEmitter).on =
|
|
1502
|
+
protoOf(KotlinEmitter).c1w = sanitize;
|
|
1503
|
+
protoOf(KotlinEmitter).r1v = sanitizeFirstIsDigit;
|
|
1504
|
+
protoOf(KotlinEmitter).s1v = sanitizeKeywords;
|
|
1505
|
+
protoOf(KotlinEmitter).t1v = emitHandleFunction;
|
|
1506
|
+
protoOf(KotlinEmitter).l1w = emitRequestHeaders;
|
|
1507
|
+
protoOf(KotlinEmitter).m1w = emitQueries;
|
|
1508
|
+
protoOf(KotlinEmitter).n1w = emitBody;
|
|
1509
|
+
protoOf(KotlinEmitter).o1w = emitHeaders;
|
|
1510
|
+
protoOf(KotlinIrEmitter).on = emit_1;
|
|
1511
|
+
protoOf(KotlinIrEmitter).l1u = emit_2;
|
|
1619
1512
|
//endregion
|
|
1620
1513
|
//region block: exports
|
|
1621
1514
|
export {
|