@flock/wirespec 0.22.8 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/clikt-clikt-mordant.mjs +39 -39
- package/colormath-root-colormath.mjs +433 -433
- package/kotlin-kotlin-stdlib.mjs +113 -80
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +6384 -6384
- package/kotlin-rgxgen.mjs +1756 -1756
- package/kotlinx-io-kotlinx-io-core.mjs +404 -404
- package/mordant-mordant.mjs +1202 -1202
- package/package.json +1 -1
- package/wirespec-src-compiler-core.mjs +552 -543
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +45 -45
- package/wirespec-src-compiler-emitters-kotlin.mjs +39 -39
- package/wirespec-src-compiler-emitters-python.mjs +29 -29
- package/wirespec-src-compiler-emitters-rust.mjs +25 -25
- package/wirespec-src-compiler-emitters-scala.mjs +523 -37
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +26 -26
- package/wirespec-src-compiler-emitters-wirespec.mjs +43 -43
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-converter-asyncapi.mjs +447 -447
- package/wirespec-src-converter-graphql.mjs +1500 -986
- package/wirespec-src-converter-graphql.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +332 -332
- package/wirespec-src-ide-lsp.mjs +767 -767
- package/wirespec-src-plugin-arguments.mjs +165 -154
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +87 -87
- package/wirespec-src-plugin-extensions.mjs +2603 -694
- package/wirespec-src-plugin-extensions.mjs.map +1 -1
- package/wirespec-src-plugin-npm.d.mts +13 -9
- package/wirespec-src-plugin-npm.mjs +24 -14
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +2 -2
|
@@ -208,7 +208,7 @@ function get_sharedClientAndServer() {
|
|
|
208
208
|
}
|
|
209
209
|
var sharedClientAndServer;
|
|
210
210
|
function _get_sanitizationConfig__sns434($this) {
|
|
211
|
-
var tmp0 = $this.
|
|
211
|
+
var tmp0 = $this.j3k_1;
|
|
212
212
|
var tmp = KProperty1;
|
|
213
213
|
// Inline function 'kotlin.getValue' call
|
|
214
214
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, RustEmitter$_get_sanitizationConfig_$ref_1dtj2x(), null);
|
|
@@ -296,7 +296,7 @@ function sharedFile($this) {
|
|
|
296
296
|
return new File(Companion_getInstance().au('Wirespec'), plus(plus(get_sharedImports(), destination_0), get_sharedClientAndServer()));
|
|
297
297
|
}
|
|
298
298
|
function modFile($this, directory, definitions) {
|
|
299
|
-
var tmp = Companion_getInstance().au($this.
|
|
299
|
+
var tmp = Companion_getInstance().au($this.f3k_1.dt() + directory + 'mod');
|
|
300
300
|
return new File(tmp, listOf(new RawElement(joinToString(definitions, '\n', VOID, VOID, VOID, VOID, RustEmitter$modFile$lambda))));
|
|
301
301
|
}
|
|
302
302
|
function _get_clientName__yc59yj($this, $receiver) {
|
|
@@ -321,10 +321,10 @@ function clientParameters($this, $receiver) {
|
|
|
321
321
|
}
|
|
322
322
|
function Companion() {
|
|
323
323
|
Companion_instance_2 = this;
|
|
324
|
-
this.
|
|
324
|
+
this.k3k_1 = RustGenerator_getInstance();
|
|
325
325
|
}
|
|
326
|
-
protoOf(Companion).
|
|
327
|
-
return this.
|
|
326
|
+
protoOf(Companion).g3j = function () {
|
|
327
|
+
return this.k3k_1.r1c_1;
|
|
328
328
|
};
|
|
329
329
|
var Companion_instance_2;
|
|
330
330
|
function Companion_getInstance_0() {
|
|
@@ -333,16 +333,16 @@ function Companion_getInstance_0() {
|
|
|
333
333
|
return Companion_instance_2;
|
|
334
334
|
}
|
|
335
335
|
function sam$kotlin_Comparator$0(function_0) {
|
|
336
|
-
this.
|
|
336
|
+
this.l3k_1 = function_0;
|
|
337
337
|
}
|
|
338
338
|
protoOf(sam$kotlin_Comparator$0).zd = function (a, b) {
|
|
339
|
-
return this.
|
|
339
|
+
return this.l3k_1(a, b);
|
|
340
340
|
};
|
|
341
341
|
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
342
342
|
return this.zd(a, b);
|
|
343
343
|
};
|
|
344
344
|
protoOf(sam$kotlin_Comparator$0).p3 = function () {
|
|
345
|
-
return this.
|
|
345
|
+
return this.l3k_1;
|
|
346
346
|
};
|
|
347
347
|
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
348
348
|
var tmp;
|
|
@@ -424,7 +424,7 @@ function RustEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
424
424
|
}
|
|
425
425
|
function RustEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
426
426
|
return function () {
|
|
427
|
-
var tmp0_reservedKeywords = minus(Companion_getInstance_0().
|
|
427
|
+
var tmp0_reservedKeywords = minus(Companion_getInstance_0().g3j(), setOf(['self', 'Self']));
|
|
428
428
|
var tmp = RustEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
429
429
|
var tmp_0 = RustEmitter$sanitizationConfig$delegate$lambda$lambda_0;
|
|
430
430
|
var tmp_1 = RustEmitter$sanitizationConfig$delegate$lambda$lambda_1;
|
|
@@ -491,23 +491,23 @@ function RustEmitter(packageName, emitShared) {
|
|
|
491
491
|
Companion_getInstance_0();
|
|
492
492
|
packageName = packageName === VOID ? Companion_instance.at('community.flock.wirespec.generated') : packageName;
|
|
493
493
|
emitShared = emitShared === VOID ? Companion_instance_0.gq() : emitShared;
|
|
494
|
-
this.
|
|
495
|
-
this.
|
|
496
|
-
this.
|
|
497
|
-
this.
|
|
494
|
+
this.f3k_1 = packageName;
|
|
495
|
+
this.g3k_1 = emitShared;
|
|
496
|
+
this.h3k_1 = RustGenerator_getInstance();
|
|
497
|
+
this.i3k_1 = FileExtension_Rust_getInstance();
|
|
498
498
|
var tmp = this;
|
|
499
|
-
tmp.
|
|
499
|
+
tmp.j3k_1 = lazy(RustEmitter$sanitizationConfig$delegate$lambda(this));
|
|
500
500
|
}
|
|
501
501
|
protoOf(RustEmitter).l1b = function () {
|
|
502
|
-
return this.
|
|
502
|
+
return this.h3k_1;
|
|
503
503
|
};
|
|
504
504
|
protoOf(RustEmitter).xp = function () {
|
|
505
|
-
return this.
|
|
505
|
+
return this.i3k_1;
|
|
506
506
|
};
|
|
507
507
|
protoOf(RustEmitter).g1b = function () {
|
|
508
508
|
var tmp;
|
|
509
|
-
if (this.
|
|
510
|
-
tmp = new File(Companion_getInstance().au(this.
|
|
509
|
+
if (this.g3k_1.hq_1) {
|
|
510
|
+
tmp = new File(Companion_getInstance().au(this.f3k_1.dt() + 'wirespec'), listOf(new RawElement(this.l1b().m1b(sharedFile(this)))));
|
|
511
511
|
} else {
|
|
512
512
|
tmp = null;
|
|
513
513
|
}
|
|
@@ -542,9 +542,9 @@ protoOf(RustEmitter).f1b = function (module_0, logger) {
|
|
|
542
542
|
tmp_1 = '';
|
|
543
543
|
}
|
|
544
544
|
var clientMod = tmp_1;
|
|
545
|
-
var modRs = new File(Companion_getInstance().au(this.
|
|
545
|
+
var modRs = new File(Companion_getInstance().au(this.f3k_1.dt() + 'mod'), listOf(new RawElement('#![allow(warnings)]\npub mod model;\npub mod endpoint;' + clientMod + '\npub mod wirespec;')));
|
|
546
546
|
var tmp_2;
|
|
547
|
-
if (this.
|
|
547
|
+
if (this.g3k_1.hq_1) {
|
|
548
548
|
var tmp_3 = NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(files, modRs), modFile(this, 'endpoint/', endpoints));
|
|
549
549
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
550
550
|
var tmp0_0 = new NonEmptyList(module_0.hp_1);
|
|
@@ -565,7 +565,7 @@ protoOf(RustEmitter).f1b = function (module_0, logger) {
|
|
|
565
565
|
};
|
|
566
566
|
protoOf(RustEmitter).ds = function (definition, module_0, logger) {
|
|
567
567
|
var file = applyBorrowRules(emit_0.call(this, definition, module_0, logger));
|
|
568
|
-
return new File(Companion_getInstance().au(plus_1(this.
|
|
568
|
+
return new File(Companion_getInstance().au(plus_1(this.f3k_1, definition).dt() + toSnakeCase(file.fv_1.du())), plus(get_wirespecImports(), withStructDerives(file.gv_1)));
|
|
569
569
|
};
|
|
570
570
|
protoOf(RustEmitter).o1b = function (definition, module_0) {
|
|
571
571
|
var tmp;
|
|
@@ -671,7 +671,7 @@ protoOf(RustEmitter).o1b = function (definition, module_0) {
|
|
|
671
671
|
var _destruct__k2r9zo = new Pair(first, second);
|
|
672
672
|
var generators = _destruct__k2r9zo.af();
|
|
673
673
|
var types = _destruct__k2r9zo.bf();
|
|
674
|
-
var tmp_5 = Companion_getInstance().au(plus_2(this.
|
|
674
|
+
var tmp_5 = Companion_getInstance().au(plus_2(this.f3k_1, 'generator').dt() + toSnakeCase(tmp2_safe_receiver.fv_1.du()));
|
|
675
675
|
var tmp_6 = get_wirespecImports();
|
|
676
676
|
// Inline function 'kotlin.collections.map' call
|
|
677
677
|
// Inline function 'kotlin.collections.mapTo' call
|
|
@@ -751,7 +751,7 @@ protoOf(RustEmitter).n1b = function (endpoint) {
|
|
|
751
751
|
var params = _destruct__k2r9zo.af();
|
|
752
752
|
var args = _destruct__k2r9zo.bf();
|
|
753
753
|
var code = trimIndent('\n pub struct ' + _get_clientName__yc59yj(this, endpoint) + "<'a, S: Serialization, T: Transportation> {\n pub serialization: &'a S,\n pub transportation: &'a T,\n }\n impl<'a, S: Serialization, T: Transportation> " + namespace + '::Call for ' + _get_clientName__yc59yj(this, endpoint) + "<'a, S, T> {\n async fn " + module_0 + '(&self' + params + ') -> ' + module_0 + '::Response {\n let request = ' + module_0 + '::Request::new(' + args + ');\n let raw_request = ' + namespace + '::to_raw_request(self.serialization, request);\n let raw_response = self.transportation.transport(&raw_request).await;\n ' + namespace + '::from_raw_response(self.serialization, raw_response)\n }\n }\n ');
|
|
754
|
-
return new File(Companion_getInstance().au(plus_2(this.
|
|
754
|
+
return new File(Companion_getInstance().au(plus_2(this.f3k_1, 'client').dt() + toSnakeCase(_get_clientName__yc59yj(this, endpoint))), plus_0(plus(listOf_0([import_0('super::super::wirespec', '*'), import_0('super::super::endpoint', module_0)]), toImports(importReferences(endpoint), 'super::super::model::')), new RawElement(code)));
|
|
755
755
|
};
|
|
756
756
|
protoOf(RustEmitter).h1b = function (endpoints, logger) {
|
|
757
757
|
logger.bs('Emitting main Client for ' + endpoints.c1() + ' endpoints');
|
|
@@ -811,7 +811,7 @@ protoOf(RustEmitter).h1b = function (endpoints, logger) {
|
|
|
811
811
|
var endpointAndClientImports = destination_1;
|
|
812
812
|
var implementations = joinToString(endpoints, '\n', VOID, VOID, VOID, VOID, RustEmitter$emitClient$lambda_0(this));
|
|
813
813
|
var code = 'pub struct Client<S: Serialization, T: Transportation> {\n pub serialization: S,\n pub transportation: T,\n}\n' + implementations;
|
|
814
|
-
return new File(Companion_getInstance().au(this.
|
|
814
|
+
return new File(Companion_getInstance().au(this.f3k_1.dt() + 'client'), plus_0(plus(plus(listOf_0([new RawElement(modDeclarations), import_0('super::wirespec', '*')]), modelImports), endpointAndClientImports), new RawElement(code)));
|
|
815
815
|
};
|
|
816
816
|
function isDerivable(_this__u8e3s4) {
|
|
817
817
|
_init_properties_RustEmitter_kt__ix9brc();
|
|
@@ -1142,7 +1142,7 @@ function toSnakeCase(_this__u8e3s4) {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
function sanitizeKeywords(_this__u8e3s4) {
|
|
1144
1144
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1145
|
-
return Companion_getInstance_0().
|
|
1145
|
+
return Companion_getInstance_0().g3j().i1(_this__u8e3s4) ? 'r#' + _this__u8e3s4 : _this__u8e3s4;
|
|
1146
1146
|
}
|
|
1147
1147
|
function replaceStructWithRefinedFunctions(_this__u8e3s4, refined) {
|
|
1148
1148
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|