@flock/wirespec 0.16.5 → 0.16.6
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.mjs +1148 -1148
- package/colormath-root-colormath.mjs +418 -418
- package/kotlin-kotlin-stdlib.mjs +13 -13
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1766 -1766
- package/kotlinx-io-kotlinx-io-core.mjs +373 -373
- package/markdown.mjs +1829 -1829
- package/mordant-mordant.mjs +1582 -1582
- package/package.json +5 -1
- package/wirespec-serialization.d.ts +3 -0
- package/wirespec-serialization.mjs +17 -0
- package/wirespec-src-compiler-core.mjs +2935 -2770
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +177 -177
- package/wirespec-src-compiler-emitters-kotlin.mjs +179 -179
- package/wirespec-src-compiler-emitters-python.mjs +186 -186
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +774 -628
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +65 -65
- package/wirespec-src-compiler-lib.mjs +312 -312
- package/wirespec-src-converter-avro.mjs +290 -290
- package/wirespec-src-converter-openapi.mjs +350 -350
- package/wirespec-src-plugin-arguments.mjs +287 -313
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +74 -74
- package/wirespec-src-plugin-npm.mjs +15 -15
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +25 -25
- package/fetch.ts +0 -0
|
@@ -81,13 +81,13 @@ function emitImports(_this__u8e3s4, $this) {
|
|
|
81
81
|
// Inline function 'kotlin.collections.map' call
|
|
82
82
|
// Inline function 'kotlin.collections.filter' call
|
|
83
83
|
// Inline function 'kotlin.collections.filterTo' call
|
|
84
|
-
var this_0 = $this.
|
|
84
|
+
var this_0 = $this.i26(_this__u8e3s4);
|
|
85
85
|
var destination = ArrayList_init_$Create$();
|
|
86
86
|
var tmp0_iterator = this_0.g();
|
|
87
87
|
while (tmp0_iterator.h()) {
|
|
88
88
|
var element = tmp0_iterator.i();
|
|
89
89
|
// Inline function 'community.flock.wirespec.emitters.kotlin.KotlinEmitter.emitImports.<anonymous>' call
|
|
90
|
-
if (!(_this__u8e3s4.
|
|
90
|
+
if (!(_this__u8e3s4.m24().b1() === element.h29_1)) {
|
|
91
91
|
destination.e(element);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
@@ -97,7 +97,7 @@ function emitImports(_this__u8e3s4, $this) {
|
|
|
97
97
|
while (tmp0_iterator_0.h()) {
|
|
98
98
|
var item = tmp0_iterator_0.i();
|
|
99
99
|
// Inline function 'community.flock.wirespec.emitters.kotlin.KotlinEmitter.emitImports.<anonymous>' call
|
|
100
|
-
var tmp$ret$3 = 'import ' + $this.
|
|
100
|
+
var tmp$ret$3 = 'import ' + $this.m2a_1.b27_1 + '.model.' + item.h29_1 + ';';
|
|
101
101
|
destination_0.e(tmp$ret$3);
|
|
102
102
|
}
|
|
103
103
|
var tmp = destination_0;
|
|
@@ -105,14 +105,14 @@ function emitImports(_this__u8e3s4, $this) {
|
|
|
105
105
|
}
|
|
106
106
|
function emitStatusInterfaces(_this__u8e3s4, $this) {
|
|
107
107
|
// Inline function 'kotlin.collections.map' call
|
|
108
|
-
var this_0 = _this__u8e3s4.
|
|
108
|
+
var this_0 = _this__u8e3s4.n25_1;
|
|
109
109
|
// Inline function 'kotlin.collections.mapTo' call
|
|
110
110
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
111
111
|
var tmp0_iterator = this_0.g();
|
|
112
112
|
while (tmp0_iterator.h()) {
|
|
113
113
|
var item = tmp0_iterator.i();
|
|
114
114
|
// Inline function 'community.flock.wirespec.emitters.kotlin.KotlinEmitter.emitStatusInterfaces.<anonymous>' call
|
|
115
|
-
var tmp$ret$0 = new Char(charSequenceGet(item.
|
|
115
|
+
var tmp$ret$0 = new Char(charSequenceGet(item.r26_1, 0));
|
|
116
116
|
destination.e(tmp$ret$0);
|
|
117
117
|
}
|
|
118
118
|
var tmp = distinct(destination);
|
|
@@ -120,14 +120,14 @@ function emitStatusInterfaces(_this__u8e3s4, $this) {
|
|
|
120
120
|
}
|
|
121
121
|
function emitResponseInterfaces(_this__u8e3s4, $this) {
|
|
122
122
|
// Inline function 'kotlin.collections.map' call
|
|
123
|
-
var this_0 = _this__u8e3s4.
|
|
123
|
+
var this_0 = _this__u8e3s4.n25_1;
|
|
124
124
|
// Inline function 'kotlin.collections.mapTo' call
|
|
125
125
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
126
126
|
var tmp0_iterator = this_0.g();
|
|
127
127
|
while (tmp0_iterator.h()) {
|
|
128
128
|
var item = tmp0_iterator.i();
|
|
129
129
|
// Inline function 'community.flock.wirespec.emitters.kotlin.KotlinEmitter.emitResponseInterfaces.<anonymous>' call
|
|
130
|
-
var tmp$ret$0 = emit(item.
|
|
130
|
+
var tmp$ret$0 = emit(item.t26_1, $this);
|
|
131
131
|
destination.e(tmp$ret$0);
|
|
132
132
|
}
|
|
133
133
|
var tmp = distinct(destination);
|
|
@@ -136,10 +136,10 @@ function emitResponseInterfaces(_this__u8e3s4, $this) {
|
|
|
136
136
|
function emitObject(_this__u8e3s4, $this, name, extends_0, spaces, block) {
|
|
137
137
|
var tmp;
|
|
138
138
|
if (_this__u8e3s4.l()) {
|
|
139
|
-
tmp = Spacer_instance.
|
|
139
|
+
tmp = Spacer_instance.i27(spaces) + 'data object ' + name + ' : ' + extends_0;
|
|
140
140
|
} else {
|
|
141
|
-
var tmp_0 = Spacer_instance.
|
|
142
|
-
tmp = trimMargin('\n |' + tmp_0 + 'data class ' + name + '(\n |' + joinToString(_this__u8e3s4, ',\n', VOID, VOID, VOID, VOID, KotlinEmitter$emitObject$lambda(spaces, block)) + ',\n |' + Spacer_instance.
|
|
141
|
+
var tmp_0 = Spacer_instance.i27(spaces);
|
|
142
|
+
tmp = trimMargin('\n |' + tmp_0 + 'data class ' + name + '(\n |' + joinToString(_this__u8e3s4, ',\n', VOID, VOID, VOID, VOID, KotlinEmitter$emitObject$lambda(spaces, block)) + ',\n |' + Spacer_instance.i27(spaces) + ') : ' + extends_0 + '\n ');
|
|
143
143
|
}
|
|
144
144
|
return tmp;
|
|
145
145
|
}
|
|
@@ -149,11 +149,11 @@ function emitObject$default(_this__u8e3s4, $this, name, extends_0, spaces, block
|
|
|
149
149
|
}
|
|
150
150
|
function emitConstructor(_this__u8e3s4, $this, endpoint) {
|
|
151
151
|
// Inline function 'kotlin.let' call
|
|
152
|
-
var tmp = $this.
|
|
152
|
+
var tmp = $this.d26(endpoint);
|
|
153
153
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, KotlinEmitter$emitConstructor$lambda($this)));
|
|
154
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
155
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
156
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
154
|
+
var tmp_1 = orNull(joinToString(endpoint.k25_1, VOID, VOID, VOID, VOID, VOID, KotlinEmitter$emitConstructor$lambda_0($this)));
|
|
155
|
+
var tmp_2 = orNull(joinToString(endpoint.l25_1, VOID, VOID, VOID, VOID, VOID, KotlinEmitter$emitConstructor$lambda_1($this)));
|
|
156
|
+
var tmp0_safe_receiver = _this__u8e3s4.x26_1;
|
|
157
157
|
var tmp_3;
|
|
158
158
|
if (tmp0_safe_receiver == null) {
|
|
159
159
|
tmp_3 = null;
|
|
@@ -161,20 +161,20 @@ function emitConstructor(_this__u8e3s4, $this, endpoint) {
|
|
|
161
161
|
// Inline function 'kotlin.let' call
|
|
162
162
|
// Inline function 'kotlin.contracts.contract' call
|
|
163
163
|
// Inline function 'community.flock.wirespec.emitters.kotlin.KotlinEmitter.emitConstructor.<anonymous>' call
|
|
164
|
-
tmp_3 = Spacer_instance.
|
|
164
|
+
tmp_3 = Spacer_instance.i27(2) + 'override val body: ' + emit(tmp0_safe_receiver, $this) + ',';
|
|
165
165
|
}
|
|
166
166
|
// Inline function 'kotlin.contracts.contract' call
|
|
167
167
|
// Inline function 'community.flock.wirespec.emitters.kotlin.KotlinEmitter.emitConstructor.<anonymous>' call
|
|
168
168
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
169
|
-
return isBlank(it) ? 'object Request : Wirespec.Request<' + emit(_this__u8e3s4.
|
|
169
|
+
return isBlank(it) ? 'object Request : Wirespec.Request<' + emit(_this__u8e3s4.x26_1, $this) + '> {' : 'class Request(\n' + it + '\n' + Spacer_instance.toString() + ') : Wirespec.Request<' + emit(_this__u8e3s4.x26_1, $this) + '> {';
|
|
170
170
|
}
|
|
171
171
|
function emitDeserializedParams(_this__u8e3s4, $this, endpoint) {
|
|
172
172
|
// Inline function 'kotlin.let' call
|
|
173
|
-
var tmp = $this.
|
|
173
|
+
var tmp = $this.j26(endpoint);
|
|
174
174
|
var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, KotlinEmitter$emitDeserializedParams$lambda($this)));
|
|
175
|
-
var tmp_1 = orNull(joinToString(endpoint.
|
|
176
|
-
var tmp_2 = orNull(joinToString(endpoint.
|
|
177
|
-
var tmp0_safe_receiver = _this__u8e3s4.
|
|
175
|
+
var tmp_1 = orNull(joinToString(endpoint.k25_1, VOID, VOID, VOID, VOID, VOID, KotlinEmitter$emitDeserializedParams$lambda_0($this)));
|
|
176
|
+
var tmp_2 = orNull(joinToString(endpoint.l25_1, VOID, VOID, VOID, VOID, VOID, KotlinEmitter$emitDeserializedParams$lambda_1($this)));
|
|
177
|
+
var tmp0_safe_receiver = _this__u8e3s4.x26_1;
|
|
178
178
|
var tmp_3;
|
|
179
179
|
if (tmp0_safe_receiver == null) {
|
|
180
180
|
tmp_3 = null;
|
|
@@ -182,61 +182,61 @@ function emitDeserializedParams(_this__u8e3s4, $this, endpoint) {
|
|
|
182
182
|
// Inline function 'kotlin.let' call
|
|
183
183
|
// Inline function 'kotlin.contracts.contract' call
|
|
184
184
|
// Inline function 'community.flock.wirespec.emitters.kotlin.KotlinEmitter.emitDeserializedParams.<anonymous>' call
|
|
185
|
-
tmp_3 = Spacer_instance.
|
|
185
|
+
tmp_3 = Spacer_instance.i27(3) + 'body = serialization.deserialize(requireNotNull(request.body) { "body is null" }, typeOf<' + emit(tmp0_safe_receiver, $this) + '>()),';
|
|
186
186
|
}
|
|
187
187
|
// Inline function 'kotlin.contracts.contract' call
|
|
188
188
|
// Inline function 'community.flock.wirespec.emitters.kotlin.KotlinEmitter.emitDeserializedParams.<anonymous>' call
|
|
189
189
|
var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
|
|
190
|
-
return isBlank(it) ? '' : '(\n' + it + '\n' + Spacer_instance.
|
|
190
|
+
return isBlank(it) ? '' : '(\n' + it + '\n' + Spacer_instance.i27(2) + ')';
|
|
191
191
|
}
|
|
192
192
|
function emitSerialized(_this__u8e3s4, $this) {
|
|
193
|
-
var tmp = Spacer_instance.
|
|
194
|
-
var tmp_0 = Spacer_instance.
|
|
195
|
-
var tmp_1 = Spacer_instance.
|
|
193
|
+
var tmp = Spacer_instance.i27(3);
|
|
194
|
+
var tmp_0 = Spacer_instance.i27(4);
|
|
195
|
+
var tmp_1 = Spacer_instance.i27(4);
|
|
196
196
|
var tmp_2;
|
|
197
197
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
198
|
-
if (!_this__u8e3s4.
|
|
199
|
-
tmp_2 = joinToString(_this__u8e3s4.
|
|
198
|
+
if (!_this__u8e3s4.s26_1.l()) {
|
|
199
|
+
tmp_2 = joinToString(_this__u8e3s4.s26_1, ' + ', VOID, VOID, VOID, VOID, KotlinEmitter$emitSerialized$lambda($this));
|
|
200
200
|
} else {
|
|
201
201
|
tmp_2 = 'emptyMap()';
|
|
202
202
|
}
|
|
203
|
-
return trimMargin('\n |' + tmp + 'is Response' + _this__u8e3s4.
|
|
203
|
+
return trimMargin('\n |' + tmp + 'is Response' + _this__u8e3s4.r26_1 + ' -> Wirespec.RawResponse(\n |' + tmp_0 + 'statusCode = response.status,\n |' + tmp_1 + 'headers = ' + tmp_2 + ',\n |' + Spacer_instance.i27(4) + 'body = ' + (!(_this__u8e3s4.t26_1 == null) ? 'serialization.serialize(response.body, typeOf<' + emit(_this__u8e3s4.t26_1, $this) + '>())' : 'null') + ',\n |' + Spacer_instance.i27(3) + ')\n ');
|
|
204
204
|
}
|
|
205
205
|
function emitDeserialized(_this__u8e3s4, $this) {
|
|
206
|
-
var tmp = Spacer_instance.
|
|
206
|
+
var tmp = Spacer_instance.i27(3) + _this__u8e3s4.r26_1 + ' -> Response' + _this__u8e3s4.r26_1 + '(';
|
|
207
207
|
var tmp_0;
|
|
208
|
-
if (!(_this__u8e3s4.
|
|
209
|
-
tmp_0 = Spacer_instance.
|
|
208
|
+
if (!(_this__u8e3s4.t26_1 == null)) {
|
|
209
|
+
tmp_0 = Spacer_instance.i27(4) + 'body = serialization.deserialize(requireNotNull(response.body) { "body is null" }, typeOf<' + emit(_this__u8e3s4.t26_1, $this) + '>()),';
|
|
210
210
|
} else {
|
|
211
|
-
tmp_0 = Spacer_instance.
|
|
211
|
+
tmp_0 = Spacer_instance.i27(4) + 'body = Unit,';
|
|
212
212
|
}
|
|
213
213
|
var tmp_1 = tmp_0;
|
|
214
|
-
return joinToString(listOfNotNull([tmp, tmp_1, orNull(joinToString(_this__u8e3s4.
|
|
214
|
+
return joinToString(listOfNotNull([tmp, tmp_1, orNull(joinToString(_this__u8e3s4.s26_1, ',\n', VOID, VOID, VOID, VOID, KotlinEmitter$emitDeserialized$lambda($this))), Spacer_instance.i27(3) + ')']), '\n');
|
|
215
215
|
}
|
|
216
216
|
function emitSerializedParams(_this__u8e3s4, $this, type, fields) {
|
|
217
|
-
return 'mapOf("' + _this__u8e3s4.
|
|
217
|
+
return 'mapOf("' + _this__u8e3s4.v26_1.b1() + '" to (' + type + '.' + fields + '.' + $this.s24(_this__u8e3s4.v26_1) + '?.let{ serialization.serializeParam(it, typeOf<' + $this.w25(_this__u8e3s4.w26_1) + '>()) } ?: emptyList()))';
|
|
218
218
|
}
|
|
219
219
|
function emitDeserialized_0(_this__u8e3s4, $this) {
|
|
220
|
-
return Spacer_instance.
|
|
220
|
+
return Spacer_instance.i27(3) + $this.s24(_this__u8e3s4.rd_1.o26_1) + ' = serialization.deserialize(request.path[' + _this__u8e3s4.qd_1 + '], typeOf<' + $this.w25(_this__u8e3s4.rd_1.p26_1) + '>())';
|
|
221
221
|
}
|
|
222
222
|
function emitDeserializedParams_0(_this__u8e3s4, $this, type, fields, spaces) {
|
|
223
|
-
return _this__u8e3s4.
|
|
223
|
+
return _this__u8e3s4.w26_1.hm() ? Spacer_instance.i27(spaces) + $this.s24(_this__u8e3s4.v26_1) + ' = ' + type + '.' + fields + '["' + _this__u8e3s4.v26_1.b1() + '"]?.let{ serialization.deserializeParam(it, typeOf<' + $this.w25(_this__u8e3s4.w26_1) + '>()) }' : Spacer_instance.i27(spaces) + $this.s24(_this__u8e3s4.v26_1) + ' = serialization.deserializeParam(requireNotNull(' + type + '.' + fields + '["' + _this__u8e3s4.v26_1.b1() + '"]) { "' + $this.s24(_this__u8e3s4.v26_1) + ' is null" }, typeOf<' + $this.w25(_this__u8e3s4.w26_1) + '>())';
|
|
224
224
|
}
|
|
225
225
|
function emitDeserializedParams$default(_this__u8e3s4, $this, type, fields, spaces, $super) {
|
|
226
226
|
spaces = spaces === VOID ? 3 : spaces;
|
|
227
227
|
return emitDeserializedParams_0(_this__u8e3s4, $this, type, fields, spaces);
|
|
228
228
|
}
|
|
229
229
|
function emitIdentifier(_this__u8e3s4, $this) {
|
|
230
|
-
return 'request.path.' + $this.
|
|
230
|
+
return 'request.path.' + $this.s24(_this__u8e3s4.o26_1) + '.let{serialization.serialize(it, typeOf<' + $this.w25(_this__u8e3s4.p26_1) + '>())}';
|
|
231
231
|
}
|
|
232
232
|
function emit(_this__u8e3s4, $this) {
|
|
233
|
-
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.
|
|
234
|
-
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : $this.
|
|
233
|
+
var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.z26_1;
|
|
234
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : $this.w25(tmp1_safe_receiver);
|
|
235
235
|
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : removeQuestionMark(tmp2_safe_receiver);
|
|
236
236
|
return tmp3_elvis_lhs == null ? 'Unit' : tmp3_elvis_lhs;
|
|
237
237
|
}
|
|
238
238
|
function emit_0(_this__u8e3s4, $this) {
|
|
239
|
-
return $this.
|
|
239
|
+
return $this.s24(_this__u8e3s4.o26_1) + ': ' + $this.w25(_this__u8e3s4.p26_1);
|
|
240
240
|
}
|
|
241
241
|
function brace(_this__u8e3s4, $this) {
|
|
242
242
|
return wrap(_this__u8e3s4, $this, '(', ')');
|
|
@@ -263,7 +263,7 @@ function sanitizeSymbol(_this__u8e3s4, $this) {
|
|
|
263
263
|
// Inline function 'community.flock.wirespec.emitters.kotlin.KotlinEmitter.sanitizeSymbol.<anonymous>' call
|
|
264
264
|
var tmp1 = index;
|
|
265
265
|
index = tmp1 + 1 | 0;
|
|
266
|
-
var tmp$ret$0 = checkIndexOverflow(tmp1) > 0 ? Companion_instance.
|
|
266
|
+
var tmp$ret$0 = checkIndexOverflow(tmp1) > 0 ? Companion_instance.z23(item) : item;
|
|
267
267
|
destination.e(tmp$ret$0);
|
|
268
268
|
}
|
|
269
269
|
var tmp = asSequence(joinToString(destination, ''));
|
|
@@ -288,8 +288,8 @@ function sanitizeFirstIsDigit(_this__u8e3s4, $this) {
|
|
|
288
288
|
}
|
|
289
289
|
function Companion() {
|
|
290
290
|
Companion_instance_2 = this;
|
|
291
|
-
this.
|
|
292
|
-
this.
|
|
291
|
+
this.s2a_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']);
|
|
292
|
+
this.t2a_1 = 'emptyMap()';
|
|
293
293
|
}
|
|
294
294
|
var Companion_instance_2;
|
|
295
295
|
function Companion_getInstance() {
|
|
@@ -299,17 +299,17 @@ function Companion_getInstance() {
|
|
|
299
299
|
}
|
|
300
300
|
function KotlinEmitter$emit$lambda(this$0) {
|
|
301
301
|
return function (it) {
|
|
302
|
-
return this$0.
|
|
302
|
+
return this$0.w25(it);
|
|
303
303
|
};
|
|
304
304
|
}
|
|
305
305
|
function KotlinEmitter$emit$lambda_0(this$0) {
|
|
306
306
|
return function (it) {
|
|
307
|
-
return Spacer_instance.toString() + 'val ' + this$0.
|
|
307
|
+
return Spacer_instance.toString() + 'val ' + this$0.v25(it) + ',';
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
310
|
function KotlinEmitter$emit$lambda_1(this$0) {
|
|
311
311
|
return function (it) {
|
|
312
|
-
return this$0.
|
|
312
|
+
return this$0.v2a(this$0.u2a(it)) + '("' + it + '")';
|
|
313
313
|
};
|
|
314
314
|
}
|
|
315
315
|
function KotlinEmitter$emitImports$lambda(it) {
|
|
@@ -327,17 +327,17 @@ function KotlinEmitter$emit$lambda_3(this$0) {
|
|
|
327
327
|
}
|
|
328
328
|
function KotlinEmitter$emit$lambda_4(this$0) {
|
|
329
329
|
return function (it) {
|
|
330
|
-
return this$0.
|
|
330
|
+
return this$0.v25(it);
|
|
331
331
|
};
|
|
332
332
|
}
|
|
333
333
|
function KotlinEmitter$emit$lambda_5(this$0) {
|
|
334
334
|
return function (it) {
|
|
335
|
-
return this$0.
|
|
335
|
+
return this$0.v25(it);
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
338
|
function KotlinEmitter$emit$lambda_6(this$0) {
|
|
339
339
|
return function (it) {
|
|
340
|
-
return this$0.
|
|
340
|
+
return this$0.w2a(it);
|
|
341
341
|
};
|
|
342
342
|
}
|
|
343
343
|
function KotlinEmitter$emit$lambda_7(this$0) {
|
|
@@ -352,7 +352,7 @@ function KotlinEmitter$emit$lambda_8(this$0) {
|
|
|
352
352
|
}
|
|
353
353
|
function KotlinEmitter$emit$lambda_9(this$0) {
|
|
354
354
|
return function (it) {
|
|
355
|
-
return this$0.
|
|
355
|
+
return this$0.y25(it);
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
358
|
function KotlinEmitter$emitStatusInterfaces$lambda(it) {
|
|
@@ -363,29 +363,29 @@ function KotlinEmitter$emitResponseInterfaces$lambda(it) {
|
|
|
363
363
|
}
|
|
364
364
|
function KotlinEmitter$emitObject$lambda($spaces, $block) {
|
|
365
365
|
return function (it) {
|
|
366
|
-
return Spacer_instance.
|
|
366
|
+
return Spacer_instance.i27($spaces + 1 | 0) + 'val ' + $block(it);
|
|
367
367
|
};
|
|
368
368
|
}
|
|
369
369
|
function KotlinEmitter$emit$lambda_10(this$0) {
|
|
370
370
|
return function (it) {
|
|
371
|
-
return this$0.
|
|
371
|
+
return this$0.s24(it.o26_1);
|
|
372
372
|
};
|
|
373
373
|
}
|
|
374
374
|
function KotlinEmitter$emit$lambda_11(this$0) {
|
|
375
375
|
return function (it) {
|
|
376
|
-
return this$0.
|
|
376
|
+
return this$0.s24(it.v26_1);
|
|
377
377
|
};
|
|
378
378
|
}
|
|
379
379
|
function KotlinEmitter$emit$lambda_12(this$0) {
|
|
380
380
|
return function (it) {
|
|
381
|
-
return this$0.
|
|
381
|
+
return this$0.s24(it.v26_1);
|
|
382
382
|
};
|
|
383
383
|
}
|
|
384
384
|
function KotlinEmitter$emit$lambda_13(this$0) {
|
|
385
385
|
return function (it) {
|
|
386
386
|
var tmp;
|
|
387
387
|
if (it instanceof Literal) {
|
|
388
|
-
tmp = '"' + it.
|
|
388
|
+
tmp = '"' + it.q26_1 + '"';
|
|
389
389
|
} else {
|
|
390
390
|
if (it instanceof Param) {
|
|
391
391
|
tmp = emitIdentifier(it, this$0);
|
|
@@ -408,32 +408,32 @@ function KotlinEmitter$emit$lambda_15(this$0) {
|
|
|
408
408
|
}
|
|
409
409
|
function KotlinEmitter$emit$lambda_16(this$0) {
|
|
410
410
|
return function (it) {
|
|
411
|
-
return 'val ' + this$0.
|
|
411
|
+
return 'val ' + this$0.v25(it);
|
|
412
412
|
};
|
|
413
413
|
}
|
|
414
414
|
function KotlinEmitter$emit$lambda_17(this$0) {
|
|
415
415
|
return function (it) {
|
|
416
|
-
return this$0.
|
|
416
|
+
return this$0.s24(it.v26_1);
|
|
417
417
|
};
|
|
418
418
|
}
|
|
419
419
|
function KotlinEmitter$emit$lambda_18(this$0) {
|
|
420
420
|
return function (it) {
|
|
421
|
-
return this$0.
|
|
421
|
+
return this$0.v25(it);
|
|
422
422
|
};
|
|
423
423
|
}
|
|
424
424
|
function KotlinEmitter$emitConstructor$lambda(this$0) {
|
|
425
425
|
return function (it) {
|
|
426
|
-
return Spacer_instance.
|
|
426
|
+
return Spacer_instance.i27(2) + emit_0(it, this$0);
|
|
427
427
|
};
|
|
428
428
|
}
|
|
429
429
|
function KotlinEmitter$emitConstructor$lambda_0(this$0) {
|
|
430
430
|
return function (it) {
|
|
431
|
-
return Spacer_instance.
|
|
431
|
+
return Spacer_instance.i27(2) + this$0.v25(it);
|
|
432
432
|
};
|
|
433
433
|
}
|
|
434
434
|
function KotlinEmitter$emitConstructor$lambda_1(this$0) {
|
|
435
435
|
return function (it) {
|
|
436
|
-
return Spacer_instance.
|
|
436
|
+
return Spacer_instance.i27(2) + this$0.v25(it);
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
439
|
function KotlinEmitter$emitDeserializedParams$lambda(this$0) {
|
|
@@ -466,55 +466,55 @@ function KotlinEmitter$sanitizeSymbol$lambda(it) {
|
|
|
466
466
|
}
|
|
467
467
|
function KotlinEmitter(packageName, emitShared) {
|
|
468
468
|
Companion_getInstance();
|
|
469
|
-
packageName = packageName === VOID ? Companion_instance_0.
|
|
470
|
-
emitShared = emitShared === VOID ? Companion_instance_1.
|
|
469
|
+
packageName = packageName === VOID ? Companion_instance_0.a27('community.flock.wirespec.generated') : packageName;
|
|
470
|
+
emitShared = emitShared === VOID ? Companion_instance_1.v23() : emitShared;
|
|
471
471
|
Emitter.call(this);
|
|
472
|
-
this.
|
|
473
|
-
this.
|
|
474
|
-
this.
|
|
475
|
-
this.
|
|
476
|
-
this.
|
|
477
|
-
this.
|
|
478
|
-
}
|
|
479
|
-
protoOf(KotlinEmitter).
|
|
480
|
-
return this.
|
|
472
|
+
this.m2a_1 = packageName;
|
|
473
|
+
this.n2a_1 = emitShared;
|
|
474
|
+
this.o2a_1 = '\nimport community.flock.wirespec.kotlin.Wirespec\nimport kotlin.reflect.typeOf\n';
|
|
475
|
+
this.p2a_1 = FileExtension_Kotlin_getInstance();
|
|
476
|
+
this.q2a_1 = KotlinShared_getInstance();
|
|
477
|
+
this.r2a_1 = '//';
|
|
478
|
+
}
|
|
479
|
+
protoOf(KotlinEmitter).k24 = function () {
|
|
480
|
+
return this.p2a_1;
|
|
481
481
|
};
|
|
482
|
-
protoOf(KotlinEmitter).
|
|
483
|
-
return this.
|
|
482
|
+
protoOf(KotlinEmitter).x2a = function () {
|
|
483
|
+
return this.q2a_1;
|
|
484
484
|
};
|
|
485
|
-
protoOf(KotlinEmitter).
|
|
486
|
-
return this.
|
|
485
|
+
protoOf(KotlinEmitter).b26 = function () {
|
|
486
|
+
return this.r2a_1;
|
|
487
487
|
};
|
|
488
|
-
protoOf(KotlinEmitter).
|
|
488
|
+
protoOf(KotlinEmitter).g24 = function (module_0, logger) {
|
|
489
489
|
// Inline function 'kotlin.let' call
|
|
490
490
|
// Inline function 'kotlin.contracts.contract' call
|
|
491
491
|
// Inline function 'community.flock.wirespec.emitters.kotlin.KotlinEmitter.emit.<anonymous>' call
|
|
492
|
-
var it = protoOf(Emitter).
|
|
493
|
-
return this.
|
|
492
|
+
var it = protoOf(Emitter).g24.call(this, module_0, logger);
|
|
493
|
+
return this.n2a_1.w23_1 ? it.pk(new Emitted(Companion_instance_0.a27('community.flock.wirespec.kotlin').d27() + 'Wirespec', this.x2a().z2a_1)) : it;
|
|
494
494
|
};
|
|
495
|
-
protoOf(KotlinEmitter).
|
|
495
|
+
protoOf(KotlinEmitter).l24 = function (definition, module_0, logger) {
|
|
496
496
|
// Inline function 'kotlin.let' call
|
|
497
497
|
// Inline function 'kotlin.contracts.contract' call
|
|
498
498
|
// Inline function 'community.flock.wirespec.emitters.kotlin.KotlinEmitter.emit.<anonymous>' call
|
|
499
|
-
var it = protoOf(Emitter).
|
|
500
|
-
var subPackageName = plus(this.
|
|
501
|
-
var tmp = subPackageName.
|
|
499
|
+
var it = protoOf(Emitter).l24.call(this, definition, module_0, logger);
|
|
500
|
+
var subPackageName = plus(this.m2a_1, definition);
|
|
501
|
+
var tmp = subPackageName.d27() + sanitizeSymbol(it.x23_1, this);
|
|
502
502
|
// Inline function 'kotlin.text.trimStart' call
|
|
503
|
-
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + '\n |' + (Companion_instance.
|
|
503
|
+
var this_0 = trimMargin('\n |package ' + subPackageName.toString() + '\n |' + (Companion_instance.b24(module_0) ? this.o2a_1 : '') + '\n |' + it.y23_1 + '\n ');
|
|
504
504
|
var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
505
505
|
return new Emitted(tmp, tmp$ret$0);
|
|
506
506
|
};
|
|
507
|
-
protoOf(KotlinEmitter).
|
|
507
|
+
protoOf(KotlinEmitter).t25 = function (type, module_0) {
|
|
508
508
|
var tmp;
|
|
509
|
-
if (type.
|
|
510
|
-
tmp = 'data object ' + this.
|
|
509
|
+
if (type.r25_1.u26_1.l()) {
|
|
510
|
+
tmp = 'data object ' + this.s24(type.q25_1);
|
|
511
511
|
} else {
|
|
512
|
-
var tmp_0 = this.
|
|
513
|
-
var tmp_1 = this.
|
|
512
|
+
var tmp_0 = this.s24(type.q25_1);
|
|
513
|
+
var tmp_1 = this.u25(type.r25_1);
|
|
514
514
|
// Inline function 'kotlin.run' call
|
|
515
515
|
// Inline function 'kotlin.contracts.contract' call
|
|
516
516
|
// Inline function 'community.flock.wirespec.emitters.kotlin.KotlinEmitter.emit.<anonymous>' call
|
|
517
|
-
var $this$run = type.
|
|
517
|
+
var $this$run = type.s25_1;
|
|
518
518
|
var tmp_2;
|
|
519
519
|
if ($this$run.l()) {
|
|
520
520
|
tmp_2 = '';
|
|
@@ -526,20 +526,20 @@ protoOf(KotlinEmitter).e26 = function (type, module_0) {
|
|
|
526
526
|
}
|
|
527
527
|
return tmp;
|
|
528
528
|
};
|
|
529
|
-
protoOf(KotlinEmitter).
|
|
529
|
+
protoOf(KotlinEmitter).u25 = function (_this__u8e3s4) {
|
|
530
530
|
return dropLast(joinToString(_this__u8e3s4.u26_1, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_0(this)), 1);
|
|
531
531
|
};
|
|
532
|
-
protoOf(KotlinEmitter).
|
|
533
|
-
return this.
|
|
532
|
+
protoOf(KotlinEmitter).v25 = function (_this__u8e3s4) {
|
|
533
|
+
return this.s24(_this__u8e3s4.v26_1) + ': ' + this.w25(_this__u8e3s4.w26_1);
|
|
534
534
|
};
|
|
535
|
-
protoOf(KotlinEmitter).
|
|
535
|
+
protoOf(KotlinEmitter).w25 = function (_this__u8e3s4) {
|
|
536
536
|
// Inline function 'kotlin.let' call
|
|
537
537
|
var tmp;
|
|
538
538
|
if (_this__u8e3s4 instanceof Dict) {
|
|
539
|
-
tmp = 'Map<String, ' + this.
|
|
539
|
+
tmp = 'Map<String, ' + this.w25(_this__u8e3s4.r23_1) + '>';
|
|
540
540
|
} else {
|
|
541
541
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
542
|
-
tmp = 'List<' + this.
|
|
542
|
+
tmp = 'List<' + this.w25(_this__u8e3s4.o23_1) + '>';
|
|
543
543
|
} else {
|
|
544
544
|
if (_this__u8e3s4 instanceof Unit) {
|
|
545
545
|
tmp = 'Unit';
|
|
@@ -548,17 +548,17 @@ protoOf(KotlinEmitter).n2a = function (_this__u8e3s4) {
|
|
|
548
548
|
tmp = 'Any';
|
|
549
549
|
} else {
|
|
550
550
|
if (_this__u8e3s4 instanceof Custom) {
|
|
551
|
-
tmp = _this__u8e3s4.
|
|
551
|
+
tmp = _this__u8e3s4.h29_1;
|
|
552
552
|
} else {
|
|
553
553
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
554
|
-
var t = _this__u8e3s4.
|
|
554
|
+
var t = _this__u8e3s4.l29_1;
|
|
555
555
|
var tmp_0;
|
|
556
556
|
if (t instanceof String_0) {
|
|
557
557
|
tmp_0 = 'String';
|
|
558
558
|
} else {
|
|
559
559
|
if (t instanceof Integer) {
|
|
560
560
|
var tmp_1;
|
|
561
|
-
switch (t.
|
|
561
|
+
switch (t.q28_1.r2_1) {
|
|
562
562
|
case 0:
|
|
563
563
|
tmp_1 = 'Int';
|
|
564
564
|
break;
|
|
@@ -573,7 +573,7 @@ protoOf(KotlinEmitter).n2a = function (_this__u8e3s4) {
|
|
|
573
573
|
} else {
|
|
574
574
|
if (t instanceof Number_0) {
|
|
575
575
|
var tmp_2;
|
|
576
|
-
switch (t.
|
|
576
|
+
switch (t.t28_1.r2_1) {
|
|
577
577
|
case 0:
|
|
578
578
|
tmp_2 = 'Float';
|
|
579
579
|
break;
|
|
@@ -612,44 +612,44 @@ protoOf(KotlinEmitter).n2a = function (_this__u8e3s4) {
|
|
|
612
612
|
var it = tmp;
|
|
613
613
|
return _this__u8e3s4.hm() ? it + '?' : it;
|
|
614
614
|
};
|
|
615
|
-
protoOf(KotlinEmitter).
|
|
615
|
+
protoOf(KotlinEmitter).s24 = function (identifier) {
|
|
616
616
|
var tmp;
|
|
617
617
|
if (identifier instanceof DefinitionIdentifier) {
|
|
618
618
|
tmp = sanitizeSymbol(identifier.b1(), this);
|
|
619
619
|
} else {
|
|
620
620
|
if (identifier instanceof FieldIdentifier) {
|
|
621
|
-
tmp = this.
|
|
621
|
+
tmp = this.v2a(sanitizeSymbol(identifier.b1(), this));
|
|
622
622
|
} else {
|
|
623
623
|
noWhenBranchMatchedException();
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
626
|
return tmp;
|
|
627
627
|
};
|
|
628
|
-
protoOf(KotlinEmitter).
|
|
629
|
-
return trimMargin('\n |data class ' + sanitizeSymbol(refined.
|
|
628
|
+
protoOf(KotlinEmitter).b25 = function (refined) {
|
|
629
|
+
return trimMargin('\n |data class ' + sanitizeSymbol(refined.z24_1.b1(), this) + '(override val value: String): Wirespec.Refined {\n |' + Spacer_instance.toString() + 'override fun toString() = value\n |}\n |\n |fun ' + refined.z24_1.b1() + '.validate() = ' + this.z25(refined) + '\n |\n ');
|
|
630
630
|
};
|
|
631
|
-
protoOf(KotlinEmitter).
|
|
631
|
+
protoOf(KotlinEmitter).z25 = function (_this__u8e3s4) {
|
|
632
632
|
var defaultReturn = 'true';
|
|
633
|
-
var type = _this__u8e3s4.
|
|
633
|
+
var type = _this__u8e3s4.a25_1.l29_1;
|
|
634
634
|
var tmp;
|
|
635
635
|
if (type instanceof Integer) {
|
|
636
|
-
var tmp0_safe_receiver = type.
|
|
637
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
636
|
+
var tmp0_safe_receiver = type.r28_1;
|
|
637
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.x25(tmp0_safe_receiver);
|
|
638
638
|
tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
|
|
639
639
|
} else {
|
|
640
640
|
if (type instanceof Number_0) {
|
|
641
|
-
var tmp2_safe_receiver = type.
|
|
642
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.
|
|
641
|
+
var tmp2_safe_receiver = type.u28_1;
|
|
642
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.x25(tmp2_safe_receiver);
|
|
643
643
|
tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
|
|
644
644
|
} else {
|
|
645
645
|
if (type instanceof String_0) {
|
|
646
|
-
var tmp4_safe_receiver = type.
|
|
646
|
+
var tmp4_safe_receiver = type.o28_1;
|
|
647
647
|
var tmp_0;
|
|
648
648
|
var tmp_1 = tmp4_safe_receiver;
|
|
649
649
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
650
650
|
tmp_0 = null;
|
|
651
651
|
} else {
|
|
652
|
-
tmp_0 = this.
|
|
652
|
+
tmp_0 = this.x25(new RegExp_0(tmp4_safe_receiver));
|
|
653
653
|
}
|
|
654
654
|
var tmp5_elvis_lhs = tmp_0;
|
|
655
655
|
tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
|
|
@@ -668,151 +668,151 @@ protoOf(KotlinEmitter).y2a = function (_this__u8e3s4) {
|
|
|
668
668
|
}
|
|
669
669
|
return tmp;
|
|
670
670
|
};
|
|
671
|
-
protoOf(KotlinEmitter).
|
|
671
|
+
protoOf(KotlinEmitter).x25 = function (_this__u8e3s4) {
|
|
672
672
|
var tmp;
|
|
673
673
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
674
|
-
tmp = 'Regex("""' + this.
|
|
674
|
+
tmp = 'Regex("""' + this.a26(_this__u8e3s4.l28_1) + '""").matches(value)';
|
|
675
675
|
} else {
|
|
676
676
|
if (_this__u8e3s4 instanceof Bound) {
|
|
677
|
-
tmp = Spacer_instance.toString() + _this__u8e3s4.
|
|
677
|
+
tmp = Spacer_instance.toString() + _this__u8e3s4.m28_1 + ' < record.value < ' + _this__u8e3s4.n28_1 + ';';
|
|
678
678
|
} else {
|
|
679
679
|
noWhenBranchMatchedException();
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
682
|
return tmp;
|
|
683
683
|
};
|
|
684
|
-
protoOf(KotlinEmitter).
|
|
685
|
-
var tmp = sanitizeSymbol(enum_0.
|
|
686
|
-
return trimMargin('\n |enum class ' + tmp + ' (override val label: String): Wirespec.Enum {\n |' + this.
|
|
684
|
+
protoOf(KotlinEmitter).f25 = function (enum_0, module_0) {
|
|
685
|
+
var tmp = sanitizeSymbol(enum_0.d25_1.b1(), this);
|
|
686
|
+
return trimMargin('\n |enum class ' + tmp + ' (override val label: String): Wirespec.Enum {\n |' + this.h26(joinToString(enum_0.e25_1, ',\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_1(this))) + ';\n |' + Spacer_instance.toString() + 'override fun toString(): String {\n |' + Spacer_instance.i27(2) + 'return label\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
687
687
|
};
|
|
688
|
-
protoOf(KotlinEmitter).
|
|
689
|
-
return trimMargin('\n |sealed interface ' + this.
|
|
688
|
+
protoOf(KotlinEmitter).x24 = function (union) {
|
|
689
|
+
return trimMargin('\n |sealed interface ' + this.s24(union.v24_1) + '\n |\n ');
|
|
690
690
|
};
|
|
691
|
-
protoOf(KotlinEmitter).
|
|
692
|
-
return trimMargin('\n |' + emitImports(channel, this) + '\n |\n |interface ' + this.
|
|
691
|
+
protoOf(KotlinEmitter).t24 = function (channel) {
|
|
692
|
+
return trimMargin('\n |' + emitImports(channel, this) + '\n |\n |interface ' + this.s24(channel.q24_1) + 'Channel {\n | operator fun invoke(message: ' + this.w25(channel.r24_1) + ')\n |}\n |\n ');
|
|
693
693
|
};
|
|
694
|
-
protoOf(KotlinEmitter).
|
|
694
|
+
protoOf(KotlinEmitter).o25 = function (endpoint) {
|
|
695
695
|
// Inline function 'kotlin.collections.map' call
|
|
696
|
-
var this_0 = this.
|
|
696
|
+
var this_0 = this.i26(endpoint);
|
|
697
697
|
// Inline function 'kotlin.collections.mapTo' call
|
|
698
698
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
699
699
|
var tmp0_iterator = this_0.g();
|
|
700
700
|
while (tmp0_iterator.h()) {
|
|
701
701
|
var item = tmp0_iterator.i();
|
|
702
702
|
// Inline function 'community.flock.wirespec.emitters.kotlin.KotlinEmitter.emit.<anonymous>' call
|
|
703
|
-
var tmp$ret$0 = 'import ' + this.
|
|
703
|
+
var tmp$ret$0 = 'import ' + this.m2a_1.b27_1 + '.model.' + item.h29_1;
|
|
704
704
|
destination.e(tmp$ret$0);
|
|
705
705
|
}
|
|
706
706
|
var tmp = destination;
|
|
707
707
|
var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_2);
|
|
708
|
-
var tmp_1 = this.
|
|
709
|
-
var tmp_2 = this.
|
|
708
|
+
var tmp_1 = this.s24(endpoint.h25_1);
|
|
709
|
+
var tmp_2 = this.d26(endpoint);
|
|
710
710
|
var tmp_3 = emitObject$default(tmp_2, this, 'Path', 'Wirespec.Path', VOID, KotlinEmitter$emit$lambda_3(this));
|
|
711
|
-
var tmp_4 = emitObject$default(endpoint.
|
|
712
|
-
var tmp_5 = emitObject$default(endpoint.
|
|
713
|
-
var tmp_6 = this.a2b(first(endpoint.
|
|
711
|
+
var tmp_4 = emitObject$default(endpoint.k25_1, this, 'Queries', 'Wirespec.Queries', VOID, KotlinEmitter$emit$lambda_4(this));
|
|
712
|
+
var tmp_5 = emitObject$default(endpoint.l25_1, this, 'Headers', 'Wirespec.Request.Headers', VOID, KotlinEmitter$emit$lambda_5(this));
|
|
713
|
+
var tmp_6 = this.a2b(first(endpoint.m25_1), endpoint);
|
|
714
714
|
var tmp_7 = Spacer_instance.toString();
|
|
715
715
|
var tmp_8 = emitStatusInterfaces(endpoint, this);
|
|
716
716
|
var tmp_9 = emitResponseInterfaces(endpoint, this);
|
|
717
|
-
var tmp_10 = this.
|
|
717
|
+
var tmp_10 = this.l26(endpoint.n25_1);
|
|
718
718
|
var tmp_11 = joinToString(tmp_10, '\n\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_6(this));
|
|
719
719
|
var tmp_12 = Spacer_instance.toString();
|
|
720
|
-
var tmp_13 = Spacer_instance.
|
|
721
|
-
var tmp_14 = this.
|
|
720
|
+
var tmp_13 = Spacer_instance.i27(2);
|
|
721
|
+
var tmp_14 = this.l26(endpoint.n25_1);
|
|
722
722
|
var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_7(this));
|
|
723
|
-
var tmp_16 = Spacer_instance.
|
|
723
|
+
var tmp_16 = Spacer_instance.i27(2);
|
|
724
724
|
var tmp_17 = Spacer_instance.toString();
|
|
725
|
-
var tmp_18 = Spacer_instance.
|
|
725
|
+
var tmp_18 = Spacer_instance.i27(2);
|
|
726
726
|
// Inline function 'kotlin.collections.filter' call
|
|
727
727
|
// Inline function 'kotlin.collections.filterTo' call
|
|
728
|
-
var this_1 = this.
|
|
728
|
+
var this_1 = this.l26(endpoint.n25_1);
|
|
729
729
|
var destination_0 = ArrayList_init_$Create$();
|
|
730
730
|
var tmp0_iterator_0 = this_1.g();
|
|
731
731
|
while (tmp0_iterator_0.h()) {
|
|
732
732
|
var element = tmp0_iterator_0.i();
|
|
733
733
|
// Inline function 'community.flock.wirespec.emitters.kotlin.KotlinEmitter.emit.<anonymous>' call
|
|
734
|
-
if (Companion_instance.
|
|
734
|
+
if (Companion_instance.e24(element.r26_1)) {
|
|
735
735
|
destination_0.e(element);
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
738
|
var tmp_19 = destination_0;
|
|
739
739
|
var tmp_20 = joinToString(tmp_19, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_8(this));
|
|
740
|
-
var tmp_21 = Spacer_instance.
|
|
741
|
-
var tmp_22 = Spacer_instance.
|
|
740
|
+
var tmp_21 = Spacer_instance.i27(3);
|
|
741
|
+
var tmp_22 = Spacer_instance.i27(2);
|
|
742
742
|
var tmp_23 = Spacer_instance.toString();
|
|
743
|
-
var tmp_24 = Spacer_instance.
|
|
743
|
+
var tmp_24 = Spacer_instance.i27(2);
|
|
744
744
|
var tmp_25 = this.b2b(endpoint);
|
|
745
|
-
var tmp_26 = Spacer_instance.
|
|
746
|
-
var tmp_27 = Spacer_instance.
|
|
747
|
-
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<String>, response: Response<*>): Wirespec.RawResponse =\n |' + tmp_13 + 'when(response) {\n |' + tmp_15 + '\n |' + tmp_16 + '}\n |\n |' + tmp_17 + 'fun fromResponse(serialization: Wirespec.Deserializer<String>, 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.
|
|
745
|
+
var tmp_26 = Spacer_instance.i27(2);
|
|
746
|
+
var tmp_27 = Spacer_instance.i27(3);
|
|
747
|
+
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<String>, response: Response<*>): Wirespec.RawResponse =\n |' + tmp_13 + 'when(response) {\n |' + tmp_15 + '\n |' + tmp_16 + '}\n |\n |' + tmp_17 + 'fun fromResponse(serialization: Wirespec.Deserializer<String>, 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.j25_1, '/', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_9(this)) + '"\n |' + Spacer_instance.i27(3) + 'override val method = "' + endpoint.i25_1.toString() + '"\n |' + Spacer_instance.i27(3) + 'override fun server(serialization: Wirespec.Serialization<String>) = object : Wirespec.ServerEdge<Request, Response<*>> {\n |' + Spacer_instance.i27(4) + 'override fun from(request: Wirespec.RawRequest) = fromRequest(serialization, request)\n |' + Spacer_instance.i27(4) + 'override fun to(response: Response<*>) = toResponse(serialization, response)\n |' + Spacer_instance.i27(3) + '}\n |' + Spacer_instance.i27(3) + 'override fun client(serialization: Wirespec.Serialization<String>) = object : Wirespec.ClientEdge<Request, Response<*>> {\n |' + Spacer_instance.i27(4) + 'override fun to(request: Request) = toRequest(serialization, request)\n |' + Spacer_instance.i27(4) + 'override fun from(response: Wirespec.RawResponse) = fromResponse(serialization, response)\n |' + Spacer_instance.i27(3) + '}\n |' + Spacer_instance.i27(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
|
|
748
748
|
};
|
|
749
749
|
protoOf(KotlinEmitter).b2b = function (endpoint) {
|
|
750
|
-
return 'suspend fun ' + Companion_instance.
|
|
750
|
+
return 'suspend fun ' + Companion_instance.a24(this.s24(endpoint.h25_1)) + '(request: Request): Response<*>';
|
|
751
751
|
};
|
|
752
752
|
protoOf(KotlinEmitter).a2b = function (_this__u8e3s4, endpoint) {
|
|
753
753
|
var tmp = Spacer_instance.toString();
|
|
754
754
|
var tmp_0 = emitConstructor(_this__u8e3s4, this, endpoint);
|
|
755
|
-
var tmp_1 = Spacer_instance.
|
|
756
|
-
var tmp_2 = this.
|
|
755
|
+
var tmp_1 = Spacer_instance.i27(2);
|
|
756
|
+
var tmp_2 = this.d26(endpoint);
|
|
757
757
|
var tmp_3 = brace(joinToString(tmp_2, VOID, VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_10(this)), this);
|
|
758
|
-
var tmp_4 = Spacer_instance.
|
|
759
|
-
var tmp_5 = Spacer_instance.
|
|
760
|
-
var tmp_6 = brace(joinToString(endpoint.
|
|
761
|
-
var tmp_7 = Spacer_instance.
|
|
762
|
-
var tmp_8 = brace(joinToString(endpoint.
|
|
763
|
-
var tmp_9 = _this__u8e3s4.
|
|
758
|
+
var tmp_4 = Spacer_instance.i27(2);
|
|
759
|
+
var tmp_5 = Spacer_instance.i27(2);
|
|
760
|
+
var tmp_6 = brace(joinToString(endpoint.k25_1, VOID, VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_11(this)), this);
|
|
761
|
+
var tmp_7 = Spacer_instance.i27(2);
|
|
762
|
+
var tmp_8 = brace(joinToString(endpoint.l25_1, VOID, VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_12(this)), this);
|
|
763
|
+
var tmp_9 = _this__u8e3s4.x26_1 == null ? '\n' + Spacer_instance.i27(2) + 'override val body = Unit' : '';
|
|
764
764
|
var tmp_10 = Spacer_instance.toString();
|
|
765
765
|
var tmp_11 = Spacer_instance.toString();
|
|
766
|
-
var tmp_12 = Spacer_instance.
|
|
767
|
-
var tmp_13 = Spacer_instance.
|
|
768
|
-
var tmp_14 = joinToString(endpoint.
|
|
769
|
-
var tmp_15 = Spacer_instance.
|
|
770
|
-
var tmp_16 = Spacer_instance.
|
|
766
|
+
var tmp_12 = Spacer_instance.i27(2);
|
|
767
|
+
var tmp_13 = Spacer_instance.i27(3);
|
|
768
|
+
var tmp_14 = joinToString(endpoint.j25_1, VOID, VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_13(this));
|
|
769
|
+
var tmp_15 = Spacer_instance.i27(3);
|
|
770
|
+
var tmp_16 = Spacer_instance.i27(3);
|
|
771
771
|
var tmp_17;
|
|
772
772
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
773
|
-
if (!endpoint.
|
|
774
|
-
tmp_17 = joinToString(endpoint.
|
|
773
|
+
if (!endpoint.k25_1.l()) {
|
|
774
|
+
tmp_17 = joinToString(endpoint.k25_1, ' + ', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_14(this));
|
|
775
775
|
} else {
|
|
776
776
|
tmp_17 = 'emptyMap()';
|
|
777
777
|
}
|
|
778
778
|
var tmp_18 = tmp_17;
|
|
779
|
-
var tmp_19 = Spacer_instance.
|
|
779
|
+
var tmp_19 = Spacer_instance.i27(3);
|
|
780
780
|
var tmp_20;
|
|
781
781
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
782
|
-
if (!endpoint.
|
|
783
|
-
tmp_20 = joinToString(endpoint.
|
|
782
|
+
if (!endpoint.l25_1.l()) {
|
|
783
|
+
tmp_20 = joinToString(endpoint.l25_1, ' + ', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_15(this));
|
|
784
784
|
} else {
|
|
785
785
|
tmp_20 = 'emptyMap()';
|
|
786
786
|
}
|
|
787
|
-
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.
|
|
787
|
+
return trimMargin('\n |' + tmp + tmp_0 + '\n |' + tmp_1 + 'override val path = Path' + tmp_3 + '\n |' + tmp_4 + 'override val method = Wirespec.Method.' + endpoint.i25_1.q2_1 + '\n |' + tmp_5 + 'override val queries = Queries' + tmp_6 + '\n |' + tmp_7 + 'override val headers = Headers' + tmp_8 + tmp_9 + '\n |' + tmp_10 + '}\n |\n |' + tmp_11 + 'fun toRequest(serialization: Wirespec.Serializer<String>, request: Request): Wirespec.RawRequest =\n |' + tmp_12 + 'Wirespec.RawRequest(\n |' + tmp_13 + 'path = listOf(' + tmp_14 + '),\n |' + tmp_15 + 'method = request.method.name,\n |' + tmp_16 + 'queries = ' + tmp_18 + ',\n |' + tmp_19 + 'headers = ' + tmp_20 + ',\n |' + Spacer_instance.i27(3) + 'body = serialization.serialize(request.body, typeOf<' + emit(_this__u8e3s4.x26_1, this) + '>()),\n |' + Spacer_instance.i27(2) + ')\n |\n |' + Spacer_instance.toString() + 'fun fromRequest(serialization: Wirespec.Deserializer<String>, request: Wirespec.RawRequest): Request =\n |' + Spacer_instance.i27(2) + 'Request' + emitDeserializedParams(_this__u8e3s4, this, endpoint) + '\n ');
|
|
788
788
|
};
|
|
789
|
-
protoOf(KotlinEmitter).
|
|
789
|
+
protoOf(KotlinEmitter).w2a = function (_this__u8e3s4) {
|
|
790
790
|
var tmp = Spacer_instance.toString();
|
|
791
|
-
var tmp_0 = emit(_this__u8e3s4.
|
|
791
|
+
var tmp_0 = emit(_this__u8e3s4.t26_1, this);
|
|
792
792
|
// Inline function 'kotlin.let' call
|
|
793
793
|
// Inline function 'kotlin.contracts.contract' call
|
|
794
794
|
// Inline function 'community.flock.wirespec.emitters.kotlin.KotlinEmitter.emit.<anonymous>' call
|
|
795
|
-
var it = joinToString(_this__u8e3s4.
|
|
795
|
+
var it = joinToString(_this__u8e3s4.s26_1, ', ', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_16(this));
|
|
796
796
|
var tmp_1 = isBlank(it) ? '' : ', ' + it;
|
|
797
|
-
var tmp_2 = toString_0(charSequenceGet(_this__u8e3s4.
|
|
798
|
-
var tmp_3 = emit(_this__u8e3s4.
|
|
799
|
-
var tmp_4 = concatGenerics(emit(_this__u8e3s4.
|
|
800
|
-
var tmp_5 = Spacer_instance.
|
|
801
|
-
var tmp_6 = this.
|
|
802
|
-
var tmp_7 = Spacer_instance.
|
|
803
|
-
var tmp_8 = brace(joinToString(_this__u8e3s4.
|
|
804
|
-
return trimMargin('\n |' + tmp + 'data class Response' + _this__u8e3s4.
|
|
797
|
+
var tmp_2 = toString_0(charSequenceGet(_this__u8e3s4.r26_1, 0));
|
|
798
|
+
var tmp_3 = emit(_this__u8e3s4.t26_1, this);
|
|
799
|
+
var tmp_4 = concatGenerics(emit(_this__u8e3s4.t26_1, this));
|
|
800
|
+
var tmp_5 = Spacer_instance.i27(2);
|
|
801
|
+
var tmp_6 = this.k26(_this__u8e3s4.r26_1);
|
|
802
|
+
var tmp_7 = Spacer_instance.i27(2);
|
|
803
|
+
var tmp_8 = brace(joinToString(_this__u8e3s4.s26_1, VOID, VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda_17(this)), this);
|
|
804
|
+
return trimMargin('\n |' + tmp + 'data class Response' + _this__u8e3s4.r26_1 + '(override val body: ' + tmp_0 + tmp_1 + ') : Response' + tmp_2 + 'XX<' + tmp_3 + '>, Response' + tmp_4 + ' {\n |' + tmp_5 + 'override val status = ' + tmp_6 + '\n |' + tmp_7 + 'override val headers = ResponseHeaders' + tmp_8 + '\n |' + emitObject(_this__u8e3s4.s26_1, this, 'ResponseHeaders', 'Wirespec.Response.Headers', 2, KotlinEmitter$emit$lambda_18(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
|
|
805
805
|
};
|
|
806
|
-
protoOf(KotlinEmitter).
|
|
806
|
+
protoOf(KotlinEmitter).u2a = function (_this__u8e3s4) {
|
|
807
807
|
return sanitizeFirstIsDigit(joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_'), this);
|
|
808
808
|
};
|
|
809
|
-
protoOf(KotlinEmitter).
|
|
810
|
-
return Companion_getInstance().
|
|
809
|
+
protoOf(KotlinEmitter).v2a = function (_this__u8e3s4) {
|
|
810
|
+
return Companion_getInstance().s2a_1.o1(_this__u8e3s4) ? addBackticks(_this__u8e3s4) : _this__u8e3s4;
|
|
811
811
|
};
|
|
812
812
|
function KotlinShared() {
|
|
813
813
|
KotlinShared_instance = this;
|
|
814
|
-
this.
|
|
815
|
-
this.
|
|
814
|
+
this.y2a_1 = 'community.flock.wirespec.kotlin';
|
|
815
|
+
this.z2a_1 = trimMargin('\n |package ' + this.y2a_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 { val value: String }\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.i27(2) + 'fun to(request: Req): RawRequest\n |' + Spacer_instance.i27(2) + 'fun from(response: RawResponse): Res\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req : Request<*>, Res : Response<*>> {\n |' + Spacer_instance.i27(2) + 'val pathTemplate: String\n |' + Spacer_instance.i27(2) + 'val method: String\n |' + Spacer_instance.i27(2) + 'fun client(serialization: Serialization<String>): ClientEdge<Req, Res>\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Server<Req : Request<*>, Res : Response<*>> {\n |' + Spacer_instance.i27(2) + 'val pathTemplate: String\n |' + Spacer_instance.i27(2) + 'val method: String\n |' + Spacer_instance.i27(2) + 'fun server(serialization: Serialization<String>): 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<RAW : Any> : Serializer<RAW>, Deserializer<RAW>, ParamSerialization\n |' + Spacer_instance.toString() + 'interface ParamSerialization: ParamSerializer, ParamDeserializer\n |' + Spacer_instance.toString() + 'interface ParamSerializer { fun <T> serializeParam(value: T, kType: KType): List<String> }\n |' + Spacer_instance.toString() + 'interface Serializer<RAW : Any> : ParamSerializer { fun <T> serialize(t: T, kType: KType): RAW }\n |' + Spacer_instance.toString() + 'interface Deserializer<RAW: Any>: ParamDeserializer { fun <T> deserialize(raw: RAW, kType: KType): T }\n |' + Spacer_instance.toString() + 'interface ParamDeserializer { fun <T> 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: String?) \n |' + Spacer_instance.toString() + 'data class RawResponse(val statusCode: Int, val headers: Map<String, List<String>>, val body: String?)\n |}\n ');
|
|
816
816
|
}
|
|
817
817
|
protoOf(KotlinShared).toString = function () {
|
|
818
818
|
return 'KotlinShared';
|