@flock/wirespec 0.11.9 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/arrow-arrow-annotations.mjs +4 -0
  2. package/{kotlinx-io-kotlinx-io-bytestring.js.map → arrow-arrow-annotations.mjs.map} +1 -1
  3. package/arrow-arrow-atomic.mjs +43 -0
  4. package/arrow-arrow-atomic.mjs.map +1 -0
  5. package/arrow-arrow-continuations.mjs +18 -0
  6. package/{kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map → arrow-arrow-continuations.mjs.map} +1 -1
  7. package/arrow-arrow-core.mjs +532 -0
  8. package/arrow-arrow-core.mjs.map +1 -0
  9. package/clikt-clikt.mjs +6648 -0
  10. package/clikt-clikt.mjs.map +1 -0
  11. package/colormath-root-colormath.mjs +1696 -0
  12. package/colormath-root-colormath.mjs.map +1 -0
  13. package/kotlin-kotlin-stdlib.mjs +13106 -0
  14. package/kotlin-kotlin-stdlib.mjs.map +1 -0
  15. package/kotlin-openapi-bindings.mjs +13769 -0
  16. package/kotlin-openapi-bindings.mjs.map +1 -0
  17. package/kotlin-rgxgen.mjs +4298 -0
  18. package/kotlin-rgxgen.mjs.map +1 -0
  19. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs +4 -0
  20. package/{arrow-arrow-annotations.js.map → kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs.map} +1 -1
  21. package/kotlinx-io-kotlinx-io-bytestring.mjs +4 -0
  22. package/{kotlin-kotlin-test.js.map → kotlinx-io-kotlinx-io-bytestring.mjs.map} +1 -1
  23. package/kotlinx-io-kotlinx-io-core.mjs +2201 -0
  24. package/kotlinx-io-kotlinx-io-core.mjs.map +1 -0
  25. package/kotlinx-serialization-kotlinx-serialization-core.mjs +5880 -0
  26. package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -0
  27. package/kotlinx-serialization-kotlinx-serialization-json.mjs +5109 -0
  28. package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  29. package/markdown.mjs +6753 -0
  30. package/markdown.mjs.map +1 -0
  31. package/mordant-mordant.mjs +11839 -0
  32. package/mordant-mordant.mjs.map +1 -0
  33. package/package.json +4 -6
  34. package/wirespec-bin.mjs +18 -0
  35. package/wirespec-src-compiler-core.mjs +8313 -0
  36. package/wirespec-src-compiler-core.mjs.map +1 -0
  37. package/wirespec-src-compiler-lib.mjs +2565 -0
  38. package/wirespec-src-compiler-lib.mjs.map +1 -0
  39. package/wirespec-src-converter-avro.mjs +1933 -0
  40. package/wirespec-src-converter-avro.mjs.map +1 -0
  41. package/wirespec-src-converter-openapi.mjs +5301 -0
  42. package/wirespec-src-converter-openapi.mjs.map +1 -0
  43. package/wirespec-src-plugin-arguments.mjs +587 -0
  44. package/wirespec-src-plugin-arguments.mjs.map +1 -0
  45. package/wirespec-src-plugin-cli.mjs +1487 -0
  46. package/wirespec-src-plugin-cli.mjs.map +1 -0
  47. package/wirespec-src-plugin-npm.d.ts +485 -466
  48. package/wirespec-src-plugin-npm.mjs +622 -0
  49. package/wirespec-src-plugin-npm.mjs.map +1 -0
  50. package/wirespec-src-tools-generator.mjs +284 -0
  51. package/wirespec-src-tools-generator.mjs.map +1 -0
  52. package/arrow-arrow-annotations.js +0 -15
  53. package/arrow-arrow-atomic.js +0 -55
  54. package/arrow-arrow-atomic.js.map +0 -1
  55. package/arrow-arrow-continuations.js +0 -30
  56. package/arrow-arrow-continuations.js.map +0 -1
  57. package/arrow-arrow-core.js +0 -410
  58. package/arrow-arrow-core.js.map +0 -1
  59. package/clikt-clikt.js +0 -6713
  60. package/clikt-clikt.js.map +0 -1
  61. package/colormath-root-colormath.js +0 -1727
  62. package/colormath-root-colormath.js.map +0 -1
  63. package/kotlin-kotlin-stdlib.js +0 -13263
  64. package/kotlin-kotlin-stdlib.js.map +0 -1
  65. package/kotlin-kotlin-test.js +0 -15
  66. package/kotlin-openapi-bindings.js +0 -13787
  67. package/kotlin-openapi-bindings.js.map +0 -1
  68. package/kotlin-rgxgen.js +0 -4315
  69. package/kotlin-rgxgen.js.map +0 -1
  70. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +0 -15
  71. package/kotlinx-io-kotlinx-io-bytestring.js +0 -15
  72. package/kotlinx-io-kotlinx-io-core.js +0 -2219
  73. package/kotlinx-io-kotlinx-io-core.js.map +0 -1
  74. package/kotlinx-serialization-kotlinx-serialization-core.js +0 -5914
  75. package/kotlinx-serialization-kotlinx-serialization-core.js.map +0 -1
  76. package/kotlinx-serialization-kotlinx-serialization-json.js +0 -5126
  77. package/kotlinx-serialization-kotlinx-serialization-json.js.map +0 -1
  78. package/markdown.js +0 -6768
  79. package/markdown.js.map +0 -1
  80. package/mordant-mordant.js +0 -11981
  81. package/mordant-mordant.js.map +0 -1
  82. package/resources-library.js +0 -15
  83. package/resources-library.js.map +0 -1
  84. package/wirespec-bin.js +0 -3
  85. package/wirespec-src-compiler-core.js +0 -7894
  86. package/wirespec-src-compiler-core.js.map +0 -1
  87. package/wirespec-src-compiler-lib.js +0 -2603
  88. package/wirespec-src-compiler-lib.js.map +0 -1
  89. package/wirespec-src-converter-avro.js +0 -1650
  90. package/wirespec-src-converter-avro.js.map +0 -1
  91. package/wirespec-src-converter-openapi.js +0 -5366
  92. package/wirespec-src-converter-openapi.js.map +0 -1
  93. package/wirespec-src-plugin-arguments.js +0 -640
  94. package/wirespec-src-plugin-arguments.js.map +0 -1
  95. package/wirespec-src-plugin-cli.js +0 -1222
  96. package/wirespec-src-plugin-cli.js.map +0 -1
  97. package/wirespec-src-plugin-npm.js +0 -480
  98. package/wirespec-src-plugin-npm.js.map +0 -1
  99. package/wirespec-src-tools-generator.js +0 -306
  100. package/wirespec-src-tools-generator.js.map +0 -1
@@ -1,1222 +0,0 @@
1
- (function (factory) {
2
- if (typeof define === 'function' && define.amd)
3
- define(['exports', './kotlin-kotlin-stdlib.js', './clikt-clikt.js', './wirespec-src-plugin-arguments.js', './arrow-arrow-core.js', './wirespec-src-compiler-core.js', './kotlinx-io-kotlinx-io-core.js', './wirespec-src-converter-openapi.js', './wirespec-src-converter-avro.js', './wirespec-src-compiler-lib.js'], factory);
4
- else if (typeof exports === 'object')
5
- factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./clikt-clikt.js'), require('./wirespec-src-plugin-arguments.js'), require('./arrow-arrow-core.js'), require('./wirespec-src-compiler-core.js'), require('./kotlinx-io-kotlinx-io-core.js'), require('./wirespec-src-converter-openapi.js'), require('./wirespec-src-converter-avro.js'), require('./wirespec-src-compiler-lib.js'));
6
- else {
7
- if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
8
- throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'wirespec-src-plugin-cli'.");
9
- }
10
- if (typeof globalThis['clikt-clikt'] === 'undefined') {
11
- throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'clikt-clikt' was not found. Please, check whether 'clikt-clikt' is loaded prior to 'wirespec-src-plugin-cli'.");
12
- }
13
- if (typeof globalThis['wirespec-src-plugin-arguments'] === 'undefined') {
14
- throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'wirespec-src-plugin-arguments' was not found. Please, check whether 'wirespec-src-plugin-arguments' is loaded prior to 'wirespec-src-plugin-cli'.");
15
- }
16
- if (typeof globalThis['arrow-arrow-core'] === 'undefined') {
17
- throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'arrow-arrow-core' was not found. Please, check whether 'arrow-arrow-core' is loaded prior to 'wirespec-src-plugin-cli'.");
18
- }
19
- if (typeof globalThis['wirespec-src-compiler-core'] === 'undefined') {
20
- throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'wirespec-src-compiler-core' was not found. Please, check whether 'wirespec-src-compiler-core' is loaded prior to 'wirespec-src-plugin-cli'.");
21
- }
22
- if (typeof globalThis['kotlinx-io-kotlinx-io-core'] === 'undefined') {
23
- throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'kotlinx-io-kotlinx-io-core' was not found. Please, check whether 'kotlinx-io-kotlinx-io-core' is loaded prior to 'wirespec-src-plugin-cli'.");
24
- }
25
- if (typeof globalThis['wirespec-src-converter-openapi'] === 'undefined') {
26
- throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'wirespec-src-converter-openapi' was not found. Please, check whether 'wirespec-src-converter-openapi' is loaded prior to 'wirespec-src-plugin-cli'.");
27
- }
28
- if (typeof globalThis['wirespec-src-converter-avro'] === 'undefined') {
29
- throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'wirespec-src-converter-avro' was not found. Please, check whether 'wirespec-src-converter-avro' is loaded prior to 'wirespec-src-plugin-cli'.");
30
- }
31
- if (typeof globalThis['wirespec-src-compiler-lib'] === 'undefined') {
32
- throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'wirespec-src-compiler-lib' was not found. Please, check whether 'wirespec-src-compiler-lib' is loaded prior to 'wirespec-src-plugin-cli'.");
33
- }
34
- globalThis['wirespec-src-plugin-cli'] = factory(typeof globalThis['wirespec-src-plugin-cli'] === 'undefined' ? {} : globalThis['wirespec-src-plugin-cli'], globalThis['kotlin-kotlin-stdlib'], globalThis['clikt-clikt'], globalThis['wirespec-src-plugin-arguments'], globalThis['arrow-arrow-core'], globalThis['wirespec-src-compiler-core'], globalThis['kotlinx-io-kotlinx-io-core'], globalThis['wirespec-src-converter-openapi'], globalThis['wirespec-src-converter-avro'], globalThis['wirespec-src-compiler-lib']);
35
- }
36
- }(function (_, kotlin_kotlin, kotlin_clikt_clikt, kotlin_community_flock_wirespec_plugin_arguments_arguments, kotlin_io_arrow_kt_arrow_core, kotlin_community_flock_wirespec_compiler_core, kotlin_org_jetbrains_kotlinx_kotlinx_io_core, kotlin_community_flock_wirespec_converter_openapi, kotlin_community_flock_wirespec_converter_avro, kotlin_community_flock_wirespec_compiler_lib) {
37
- 'use strict';
38
- //region block: imports
39
- var Unit_instance = kotlin_kotlin.$_$.l4;
40
- var subcommands = kotlin_clikt_clikt.$_$.d;
41
- var protoOf = kotlin_kotlin.$_$.cb;
42
- var initMetadataForCompanion = kotlin_kotlin.$_$.ea;
43
- var NoOpCliktCommand = kotlin_clikt_clikt.$_$.c;
44
- var VOID = kotlin_kotlin.$_$.g;
45
- var initMetadataForClass = kotlin_kotlin.$_$.da;
46
- var option = kotlin_clikt_clikt.$_$.i;
47
- var Companion_instance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.x;
48
- var choice = kotlin_clikt_clikt.$_$.k;
49
- var multiple = kotlin_clikt_clikt.$_$.h;
50
- var Compile_instance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.y;
51
- var Companion_instance_0 = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.z;
52
- var toSet = kotlin_kotlin.$_$.v8;
53
- var _PackageName___init__impl__s13tbs = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.t;
54
- var CompilerArguments = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.a;
55
- var noWhenBranchMatchedException = kotlin_kotlin.$_$.kg;
56
- var joinToString = kotlin_kotlin.$_$.x6;
57
- var CliktError = kotlin_clikt_clikt.$_$.b;
58
- var Left = kotlin_io_arrow_kt_arrow_core.$_$.d;
59
- var Right = kotlin_io_arrow_kt_arrow_core.$_$.e;
60
- var argument = kotlin_clikt_clikt.$_$.e;
61
- var values = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.c;
62
- var mapCapacity = kotlin_kotlin.$_$.n7;
63
- var coerceAtLeast = kotlin_kotlin.$_$.nb;
64
- var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.t;
65
- var choice_0 = kotlin_clikt_clikt.$_$.j;
66
- var Language_Wirespec_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.p;
67
- var listOf = kotlin_kotlin.$_$.l7;
68
- var FullDirPath = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.d;
69
- var Convert = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.g;
70
- var setOf = kotlin_kotlin.$_$.a8;
71
- var CliktCommand = kotlin_clikt_clikt.$_$.a;
72
- var default_0 = kotlin_clikt_clikt.$_$.f;
73
- var Companion_instance_1 = kotlin_community_flock_wirespec_compiler_core.$_$.q2;
74
- var Level_ERROR_getInstance = kotlin_community_flock_wirespec_compiler_core.$_$.g2;
75
- var flag = kotlin_clikt_clikt.$_$.g;
76
- var Path = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.a;
77
- var get_SystemFileSystem = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.b;
78
- var Companion_instance_2 = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.w;
79
- var Console_instance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.v;
80
- var THROW_CCE = kotlin_kotlin.$_$.of;
81
- var isCharSequence = kotlin_kotlin.$_$.na;
82
- var trim = kotlin_kotlin.$_$.ve;
83
- var toString = kotlin_kotlin.$_$.gb;
84
- var Level_DEBUG_getInstance = kotlin_community_flock_wirespec_compiler_core.$_$.f2;
85
- var Level_INFO_getInstance = kotlin_community_flock_wirespec_compiler_core.$_$.h2;
86
- var Level_WARN_getInstance = kotlin_community_flock_wirespec_compiler_core.$_$.i2;
87
- var Enum = kotlin_kotlin.$_$.ef;
88
- var KProperty1 = kotlin_kotlin.$_$.yb;
89
- var getPropertyCallableRef = kotlin_kotlin.$_$.aa;
90
- var numberRangeToNumber = kotlin_kotlin.$_$.wa;
91
- var ArrayList_init_$Create$ = kotlin_kotlin.$_$.l;
92
- var copyToArray = kotlin_kotlin.$_$.c6;
93
- var Logger = kotlin_community_flock_wirespec_compiler_core.$_$.t1;
94
- var FileReadException = kotlin_community_flock_wirespec_compiler_core.$_$.h;
95
- var nonEmptyListOf = kotlin_io_arrow_kt_arrow_core.$_$.i;
96
- var left = kotlin_io_arrow_kt_arrow_core.$_$.h;
97
- var FileExtension_Wirespec_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.o;
98
- var FullFilePath = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.e;
99
- var addAll = kotlin_kotlin.$_$.c5;
100
- var Console = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.b;
101
- var Compile = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.f;
102
- var OpenApiV2Parser_instance = kotlin_community_flock_wirespec_converter_openapi.$_$.b;
103
- var OpenApiV3Parser_instance = kotlin_community_flock_wirespec_converter_openapi.$_$.d;
104
- var AvroParser_instance = kotlin_community_flock_wirespec_converter_avro.$_$.a;
105
- var collectionSizeOrDefault = kotlin_kotlin.$_$.n5;
106
- var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.k;
107
- var to = kotlin_kotlin.$_$.ng;
108
- var _FileName___get_value__impl__3u4cz6 = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.r;
109
- var charSequenceLength = kotlin_kotlin.$_$.s9;
110
- var charSequenceGet = kotlin_kotlin.$_$.r9;
111
- var toString_0 = kotlin_kotlin.$_$.e2;
112
- var first = kotlin_kotlin.$_$.m6;
113
- var Emitted = kotlin_community_flock_wirespec_compiler_core.$_$.a;
114
- var right = kotlin_io_arrow_kt_arrow_core.$_$.k;
115
- var _FileName___init__impl__nzn12e = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.q;
116
- var print = kotlin_kotlin.$_$.j9;
117
- var PackageName = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.i;
118
- var component1 = kotlin_community_flock_wirespec_compiler_core.$_$.r1;
119
- var JavaEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.c;
120
- var FileExtension_Java_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.j;
121
- var KotlinEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.d;
122
- var FileExtension_Kotlin_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.l;
123
- var ScalaEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.e;
124
- var FileExtension_Scala_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.m;
125
- var TypeScriptEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.f;
126
- var FileExtension_TypeScript_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.n;
127
- var WirespecEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.g;
128
- var OpenApiV2Emitter_getInstance = kotlin_community_flock_wirespec_converter_openapi.$_$.a;
129
- var FileExtension_Json_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.k;
130
- var OpenApiV3Emitter_getInstance = kotlin_community_flock_wirespec_converter_openapi.$_$.c;
131
- var compile = kotlin_community_flock_wirespec_compiler_core.$_$.q1;
132
- var Companion_getInstance = kotlin_community_flock_wirespec_compiler_core.$_$.k2;
133
- var Output = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.h;
134
- var ensureNotNull = kotlin_kotlin.$_$.eg;
135
- var _Output___get_value__impl__a8kw1g = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.s;
136
- var _PackageName___get_value__impl__2zr98c = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.u;
137
- var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.a2;
138
- var charArrayOf = kotlin_kotlin.$_$.p9;
139
- var split = kotlin_kotlin.$_$.sd;
140
- var get_spec = kotlin_community_flock_wirespec_compiler_core.$_$.o1;
141
- var HasLanguageSpec = kotlin_community_flock_wirespec_compiler_core.$_$.p1;
142
- var dropLast = kotlin_kotlin.$_$.pc;
143
- var asSequence = kotlin_kotlin.$_$.i5;
144
- var filter = kotlin_kotlin.$_$.ac;
145
- var map = kotlin_kotlin.$_$.ec;
146
- var toSet_0 = kotlin_kotlin.$_$.gc;
147
- var substringAfterLast = kotlin_kotlin.$_$.wd;
148
- var buffered = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.d;
149
- var readString = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.e;
150
- var buffered_0 = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.c;
151
- var writeString = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.f;
152
- var parse = kotlin_community_flock_wirespec_compiler_core.$_$.s1;
153
- var Definition = kotlin_community_flock_wirespec_compiler_core.$_$.l;
154
- var isInterface = kotlin_kotlin.$_$.ra;
155
- var produce = kotlin_community_flock_wirespec_compiler_lib.$_$.e;
156
- var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.p1;
157
- var get_noLogger = kotlin_community_flock_wirespec_compiler_core.$_$.u1;
158
- var Companion_instance_3 = kotlin_kotlin.$_$.g4;
159
- var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.f2;
160
- var createFailure = kotlin_kotlin.$_$.dg;
161
- var _Result___get_value__impl__bjfvqg = kotlin_kotlin.$_$.i2;
162
- var _Result___get_isFailure__impl__jpiriv = kotlin_kotlin.$_$.g2;
163
- var isArray = kotlin_kotlin.$_$.ja;
164
- //endregion
165
- //region block: pre-declaration
166
- initMetadataForCompanion(Companion);
167
- initMetadataForClass(WirespecCli, 'WirespecCli', WirespecCli, NoOpCliktCommand);
168
- initMetadataForClass(CommonOptions, 'CommonOptions', VOID, CliktCommand);
169
- initMetadataForClass(Compile_0, 'Compile', VOID, CommonOptions);
170
- initMetadataForClass(Convert_0, 'Convert', VOID, CommonOptions);
171
- initMetadataForClass(Options, 'Options', VOID, Enum);
172
- initMetadataForClass(wirespec$this$1, VOID, VOID, VOID, [HasLanguageSpec]);
173
- initMetadataForClass(Directory, 'Directory');
174
- initMetadataForClass(File, 'File');
175
- initMetadataForClass(JavaFile, 'JavaFile', VOID, File);
176
- initMetadataForClass(JsonFile, 'JsonFile', VOID, File);
177
- initMetadataForClass(KotlinFile, 'KotlinFile', VOID, File);
178
- initMetadataForClass(ScalaFile, 'ScalaFile', VOID, File);
179
- initMetadataForClass(TypeScriptFile, 'TypeScriptFile', VOID, File);
180
- initMetadataForClass(WirespecFile, 'WirespecFile', VOID, File);
181
- initMetadataForClass(parser$1, VOID, VOID, VOID, [HasLanguageSpec]);
182
- //endregion
183
- function WirespecCli$main$ref($boundThis) {
184
- var l = function (p0) {
185
- $boundThis.v3s(p0);
186
- return Unit_instance;
187
- };
188
- l.callableName = 'main';
189
- return l;
190
- }
191
- function Companion() {
192
- }
193
- protoOf(Companion).c48 = function (compile, convert, write) {
194
- return WirespecCli$main$ref(subcommands(new WirespecCli(), [new Compile_0(compile, write), new Convert_0(convert, write)]));
195
- };
196
- var Companion_instance_4;
197
- function Companion_getInstance_0() {
198
- return Companion_instance_4;
199
- }
200
- function WirespecCli() {
201
- NoOpCliktCommand.call(this, VOID, VOID, 'wirespec');
202
- }
203
- function _get_languages__ojonze($this) {
204
- return $this.c49_1.h42($this, languages$factory_0());
205
- }
206
- function Compile$run$lambda(e) {
207
- var tmp0_elvis_lhs = e.message;
208
- return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
209
- }
210
- function Compile_0(block, write) {
211
- CommonOptions.call(this);
212
- this.a49_1 = block;
213
- this.b49_1 = write;
214
- this.c49_1 = multiple(choice(option(this, Options_Language_getInstance().f49_1.slice(), 'Language'), Companion_instance.j2c()), VOID, true).s42(this, languages$factory());
215
- }
216
- protoOf(Compile_0).w3s = function () {
217
- // Inline function 'kotlin.collections.forEach' call
218
- // Inline function 'kotlin.let' call
219
- var this_0 = new CompilerArguments(Compile_instance, this.e4a(this.d4a()), Companion_instance_0.k2c(this.f4a()), toSet(_get_languages__ojonze(this)), _PackageName___init__impl__s13tbs(this.g4a()), this.i4a(this.h4a()), this.u46(), this.j4a());
220
- // Inline function 'kotlin.contracts.contract' call
221
- var tmp0_iterator = this.a49_1(this_0).g();
222
- while (tmp0_iterator.h()) {
223
- var element = tmp0_iterator.i();
224
- // Inline function 'community.flock.wirespec.plugin.cli.Compile.run.<anonymous>' call
225
- if (element instanceof Right) {
226
- // Inline function 'kotlin.let' call
227
- // Inline function 'kotlin.contracts.contract' call
228
- var destruct = element.zj_1;
229
- var result = destruct.qd();
230
- var file = destruct.rd();
231
- this.b49_1(result, file);
232
- } else {
233
- if (element instanceof Left) {
234
- throw new CliktError(joinToString(element.tj_1, VOID, VOID, VOID, VOID, VOID, Compile$run$lambda));
235
- } else {
236
- noWhenBranchMatchedException();
237
- }
238
- }
239
- }
240
- };
241
- function _get_format__qlarck($this) {
242
- return $this.j4b_1.h42($this, format$factory_0());
243
- }
244
- function _get_languages__ojonze_0($this) {
245
- return $this.k4b_1.h42($this, languages$factory_2());
246
- }
247
- function Convert_0(block, write) {
248
- CommonOptions.call(this);
249
- this.h4b_1 = block;
250
- this.i4b_1 = write;
251
- var tmp = this;
252
- // Inline function 'com.github.ajalt.clikt.parameters.types.enum' call
253
- var this_0 = argument(this, VOID, 'Input format');
254
- // Inline function 'kotlin.collections.associateBy' call
255
- // Inline function 'kotlin.enumValues' call
256
- var this_1 = values();
257
- var capacity = coerceAtLeast(mapCapacity(this_1.length), 16);
258
- // Inline function 'kotlin.collections.associateByTo' call
259
- var destination = LinkedHashMap_init_$Create$(capacity);
260
- var inductionVariable = 0;
261
- var last = this_1.length;
262
- while (inductionVariable < last) {
263
- var element = this_1[inductionVariable];
264
- inductionVariable = inductionVariable + 1 | 0;
265
- // Inline function 'com.github.ajalt.clikt.parameters.types.enum.<anonymous>' call
266
- // Inline function 'com.github.ajalt.clikt.parameters.types.enum.<anonymous>' call
267
- var tmp$ret$2 = element.p2_1;
268
- destination.m2(tmp$ret$2, element);
269
- }
270
- tmp.j4b_1 = choice_0(this_0, destination, true).n41(this, format$factory());
271
- this.k4b_1 = multiple(choice(option(this, Options_Language_getInstance().f49_1.slice(), 'Language'), Companion_instance.j2c(), VOID, true), listOf(Language_Wirespec_getInstance())).s42(this, languages$factory_1());
272
- }
273
- protoOf(Convert_0).w3s = function () {
274
- var inp = this.e4a(this.d4a());
275
- if (inp instanceof FullDirPath) {
276
- this.p3s('To convert, please specify a file', VOID, true);
277
- }
278
- // Inline function 'kotlin.collections.forEach' call
279
- // Inline function 'kotlin.let' call
280
- var tmp = new Convert(_get_format__qlarck(this));
281
- var tmp_0 = Companion_instance_0.k2c(this.f4a());
282
- // Inline function 'kotlin.collections.ifEmpty' call
283
- var this_0 = toSet(_get_languages__ojonze_0(this));
284
- // Inline function 'kotlin.contracts.contract' call
285
- var tmp_1;
286
- if (this_0.l()) {
287
- // Inline function 'community.flock.wirespec.plugin.cli.Convert.run.<anonymous>' call
288
- tmp_1 = setOf(Language_Wirespec_getInstance());
289
- } else {
290
- tmp_1 = this_0;
291
- }
292
- var tmp$ret$1 = tmp_1;
293
- var this_1 = new CompilerArguments(tmp, inp, tmp_0, tmp$ret$1, _PackageName___init__impl__s13tbs(this.g4a()), this.i4a(this.h4a()), this.u46(), this.j4a());
294
- // Inline function 'kotlin.contracts.contract' call
295
- var tmp0_iterator = this.h4b_1(this_1).g();
296
- while (tmp0_iterator.h()) {
297
- var element = tmp0_iterator.i();
298
- // Inline function 'community.flock.wirespec.plugin.cli.Convert.run.<anonymous>' call
299
- if (element instanceof Right) {
300
- // Inline function 'kotlin.let' call
301
- // Inline function 'kotlin.contracts.contract' call
302
- var destruct = element.zj_1;
303
- var result = destruct.qd();
304
- var file = destruct.rd();
305
- this.i4b_1(result, file);
306
- } else {
307
- if (element instanceof Left) {
308
- this.p3s(element.tj_1, VOID, true);
309
- } else {
310
- noWhenBranchMatchedException();
311
- }
312
- }
313
- }
314
- };
315
- function CommonOptions() {
316
- CliktCommand.call(this);
317
- this.x49_1 = option(this, Options_Input_getInstance().f49_1.slice(), 'Input').s42(this, input$factory());
318
- this.y49_1 = option(this, Options_Output_getInstance().f49_1.slice(), 'Output').s42(this, output$factory());
319
- this.z49_1 = default_0(option(this, Options_PackageName_getInstance().f49_1.slice(), 'Package name'), 'community.flock.wirespec.generated').s42(this, packageName$factory());
320
- this.a4a_1 = default_0(option(this, Options_LogLevel_getInstance().f49_1.slice(), 'Log level: ' + Companion_instance_1.toString()), Level_ERROR_getInstance().toString()).s42(this, logLevel$factory());
321
- this.b4a_1 = flag(option(this, Options_Shared_getInstance().f49_1.slice(), 'Generate shared wirespec code'), [], false).s42(this, shared$factory());
322
- this.c4a_1 = flag(option(this, Options_Strict_getInstance().f49_1.slice(), 'Strict mode'), []).s42(this, strict$factory());
323
- }
324
- protoOf(CommonOptions).d4a = function () {
325
- return this.x49_1.h42(this, input$factory_0());
326
- };
327
- protoOf(CommonOptions).f4a = function () {
328
- return this.y49_1.h42(this, output$factory_0());
329
- };
330
- protoOf(CommonOptions).g4a = function () {
331
- return this.z49_1.h42(this, packageName$factory_0());
332
- };
333
- protoOf(CommonOptions).h4a = function () {
334
- return this.a4a_1.h42(this, logLevel$factory_0());
335
- };
336
- protoOf(CommonOptions).u46 = function () {
337
- return this.b4a_1.h42(this, shared$factory_0());
338
- };
339
- protoOf(CommonOptions).j4a = function () {
340
- return this.c4a_1.h42(this, strict$factory_0());
341
- };
342
- protoOf(CommonOptions).e4a = function (input) {
343
- if (!(input == null)) {
344
- var path = Path(input);
345
- var tmp0_elvis_lhs = get_SystemFileSystem().o47(path);
346
- var tmp;
347
- if (tmp0_elvis_lhs == null) {
348
- throw new CliktError('Cannot access file or directory: ' + input);
349
- } else {
350
- tmp = tmp0_elvis_lhs;
351
- }
352
- var meta = tmp;
353
- if (meta.r47_1)
354
- return new FullDirPath(input);
355
- if (meta.q47_1)
356
- return Companion_instance_2.y2b(input);
357
- }
358
- return Console_instance;
359
- };
360
- protoOf(CommonOptions).i4a = function (_this__u8e3s4) {
361
- // Inline function 'kotlin.text.uppercase' call
362
- // Inline function 'kotlin.text.trim' call
363
- // Inline function 'kotlin.js.asDynamic' call
364
- var tmp;
365
- switch (toString(trim(isCharSequence(_this__u8e3s4) ? _this__u8e3s4 : THROW_CCE())).toUpperCase()) {
366
- case 'DEBUG':
367
- tmp = Level_DEBUG_getInstance();
368
- break;
369
- case 'INFO':
370
- tmp = Level_INFO_getInstance();
371
- break;
372
- case 'WARN':
373
- tmp = Level_WARN_getInstance();
374
- break;
375
- case 'ERROR':
376
- tmp = Level_ERROR_getInstance();
377
- break;
378
- default:
379
- throw new CliktError('Choose one of these log levels: ' + Companion_instance_1.toString());
380
- }
381
- return tmp;
382
- };
383
- var Options_Input_instance;
384
- var Options_Output_instance;
385
- var Options_Language_instance;
386
- var Options_PackageName_instance;
387
- var Options_LogLevel_instance;
388
- var Options_Shared_instance;
389
- var Options_Strict_instance;
390
- var Options_entriesInitialized;
391
- function Options_initEntries() {
392
- if (Options_entriesInitialized)
393
- return Unit_instance;
394
- Options_entriesInitialized = true;
395
- Options_Input_instance = new Options('Input', 0, ['-i', '--input']);
396
- Options_Output_instance = new Options('Output', 1, ['-o', '--output']);
397
- Options_Language_instance = new Options('Language', 2, ['-l', '--language']);
398
- Options_PackageName_instance = new Options('PackageName', 3, ['-p', '--package']);
399
- Options_LogLevel_instance = new Options('LogLevel', 4, ['--log-level']);
400
- Options_Shared_instance = new Options('Shared', 5, ['--shared']);
401
- Options_Strict_instance = new Options('Strict', 6, ['--strict']);
402
- }
403
- function Options(name, ordinal, flags) {
404
- Enum.call(this, name, ordinal);
405
- this.f49_1 = flags;
406
- }
407
- function Options_Input_getInstance() {
408
- Options_initEntries();
409
- return Options_Input_instance;
410
- }
411
- function Options_Output_getInstance() {
412
- Options_initEntries();
413
- return Options_Output_instance;
414
- }
415
- function Options_Language_getInstance() {
416
- Options_initEntries();
417
- return Options_Language_instance;
418
- }
419
- function Options_PackageName_getInstance() {
420
- Options_initEntries();
421
- return Options_PackageName_instance;
422
- }
423
- function Options_LogLevel_getInstance() {
424
- Options_initEntries();
425
- return Options_LogLevel_instance;
426
- }
427
- function Options_Shared_getInstance() {
428
- Options_initEntries();
429
- return Options_Shared_instance;
430
- }
431
- function Options_Strict_getInstance() {
432
- Options_initEntries();
433
- return Options_Strict_instance;
434
- }
435
- function languages$factory() {
436
- return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
437
- return _get_languages__ojonze(receiver);
438
- }, null);
439
- }
440
- function languages$factory_0() {
441
- return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
442
- return _get_languages__ojonze(receiver);
443
- }, null);
444
- }
445
- function format$factory() {
446
- return getPropertyCallableRef('format', 1, KProperty1, function (receiver) {
447
- return _get_format__qlarck(receiver);
448
- }, null);
449
- }
450
- function languages$factory_1() {
451
- return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
452
- return _get_languages__ojonze_0(receiver);
453
- }, null);
454
- }
455
- function format$factory_0() {
456
- return getPropertyCallableRef('format', 1, KProperty1, function (receiver) {
457
- return _get_format__qlarck(receiver);
458
- }, null);
459
- }
460
- function languages$factory_2() {
461
- return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
462
- return _get_languages__ojonze_0(receiver);
463
- }, null);
464
- }
465
- function input$factory() {
466
- return getPropertyCallableRef('input', 1, KProperty1, function (receiver) {
467
- return receiver.d4a();
468
- }, null);
469
- }
470
- function output$factory() {
471
- return getPropertyCallableRef('output', 1, KProperty1, function (receiver) {
472
- return receiver.f4a();
473
- }, null);
474
- }
475
- function packageName$factory() {
476
- return getPropertyCallableRef('packageName', 1, KProperty1, function (receiver) {
477
- return receiver.g4a();
478
- }, null);
479
- }
480
- function logLevel$factory() {
481
- return getPropertyCallableRef('logLevel', 1, KProperty1, function (receiver) {
482
- return receiver.h4a();
483
- }, null);
484
- }
485
- function shared$factory() {
486
- return getPropertyCallableRef('shared', 1, KProperty1, function (receiver) {
487
- return receiver.u46();
488
- }, null);
489
- }
490
- function strict$factory() {
491
- return getPropertyCallableRef('strict', 1, KProperty1, function (receiver) {
492
- return receiver.j4a();
493
- }, null);
494
- }
495
- function input$factory_0() {
496
- return getPropertyCallableRef('input', 1, KProperty1, function (receiver) {
497
- return receiver.d4a();
498
- }, null);
499
- }
500
- function output$factory_0() {
501
- return getPropertyCallableRef('output', 1, KProperty1, function (receiver) {
502
- return receiver.f4a();
503
- }, null);
504
- }
505
- function packageName$factory_0() {
506
- return getPropertyCallableRef('packageName', 1, KProperty1, function (receiver) {
507
- return receiver.g4a();
508
- }, null);
509
- }
510
- function logLevel$factory_0() {
511
- return getPropertyCallableRef('logLevel', 1, KProperty1, function (receiver) {
512
- return receiver.h4a();
513
- }, null);
514
- }
515
- function shared$factory_0() {
516
- return getPropertyCallableRef('shared', 1, KProperty1, function (receiver) {
517
- return receiver.u46();
518
- }, null);
519
- }
520
- function strict$factory_0() {
521
- return getPropertyCallableRef('strict', 1, KProperty1, function (receiver) {
522
- return receiver.j4a();
523
- }, null);
524
- }
525
- function main(args) {
526
- // Inline function 'kotlin.let' call
527
- // Inline function 'kotlin.collections.toTypedArray' call
528
- // Inline function 'kotlin.collections.mapNotNull' call
529
- // Inline function 'kotlin.collections.mapNotNullTo' call
530
- var this_0 = numberRangeToNumber(0, 20);
531
- var destination = ArrayList_init_$Create$();
532
- // Inline function 'kotlin.collections.forEach' call
533
- var inductionVariable = this_0.d1_1;
534
- var last = this_0.e1_1;
535
- if (inductionVariable <= last)
536
- do {
537
- var element = inductionVariable;
538
- inductionVariable = inductionVariable + 1 | 0;
539
- // Inline function 'kotlin.collections.mapNotNullTo.<anonymous>' call
540
- var p0 = element;
541
- var tmp0_safe_receiver = orNull(args, p0);
542
- if (tmp0_safe_receiver == null)
543
- null;
544
- else {
545
- // Inline function 'kotlin.let' call
546
- // Inline function 'kotlin.contracts.contract' call
547
- destination.e(tmp0_safe_receiver);
548
- }
549
- }
550
- while (!(element === last));
551
- var this_1 = copyToArray(destination);
552
- var tmp = Companion_instance_4;
553
- var tmp_0 = compile$ref();
554
- var tmp_1 = convert$ref();
555
- // Inline function 'kotlin.contracts.contract' call
556
- tmp.c48(tmp_0, tmp_1, write$ref())(this_1);
557
- }
558
- function compile_0(arguments_0) {
559
- var input = arguments_0.p2b_1;
560
- var output = arguments_0.q2b_1;
561
- var languages = arguments_0.r2b_1;
562
- var packageName = arguments_0.s2b_1;
563
- var logger = new Logger(arguments_0.t2b_1);
564
- var operation = arguments_0.o2b_1;
565
- var tmp;
566
- if (operation instanceof Convert) {
567
- var fullPath = input instanceof FullFilePath ? input : THROW_CCE();
568
- var file = new JsonFile(fullPath);
569
- var strict = arguments_0.v2b_1;
570
- var format = operation.x2b_1;
571
- var tmp_0;
572
- switch (format.q2_1) {
573
- case 0:
574
- tmp_0 = OpenApiV2Parser_instance.t2a(file.y1a(), !strict);
575
- break;
576
- case 1:
577
- tmp_0 = OpenApiV3Parser_instance.t2a(file.y1a(), !strict);
578
- break;
579
- case 2:
580
- tmp_0 = AvroParser_instance.l2e(file.y1a());
581
- break;
582
- default:
583
- noWhenBranchMatchedException();
584
- break;
585
- }
586
- var ast = tmp_0;
587
- var path = out(fullPath, packageName, output);
588
- // Inline function 'kotlin.collections.map' call
589
- // Inline function 'kotlin.collections.map' call
590
- var this_0 = emitters(languages, packageName, path, logger);
591
- // Inline function 'kotlin.collections.mapTo' call
592
- var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
593
- var tmp0_iterator = this_0.g();
594
- while (tmp0_iterator.h()) {
595
- var item = tmp0_iterator.i();
596
- // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>' call
597
- var emitter = item.qd();
598
- var file_0 = item.rd();
599
- var results = emitter.j22(ast);
600
- var tmp_1;
601
- if (!emitter.i22_1) {
602
- // Inline function 'kotlin.text.replaceFirstChar' call
603
- var this_1 = _FileName___get_value__impl__3u4cz6(fullPath.d2c_1);
604
- var tmp_2;
605
- // Inline function 'kotlin.text.isNotEmpty' call
606
- if (charSequenceLength(this_1) > 0) {
607
- // Inline function 'kotlin.text.uppercase' call
608
- // Inline function 'kotlin.text.uppercase' call
609
- var this_2 = charSequenceGet(this_1, 0);
610
- // Inline function 'kotlin.js.unsafeCast' call
611
- // Inline function 'kotlin.js.asDynamic' call
612
- var tmp$ret$4 = toString_0(this_2).toUpperCase();
613
- var tmp_3 = toString(tmp$ret$4);
614
- // Inline function 'kotlin.text.substring' call
615
- // Inline function 'kotlin.js.asDynamic' call
616
- tmp_2 = tmp_3 + this_1.substring(1);
617
- } else {
618
- tmp_2 = this_1;
619
- }
620
- var tmp$ret$7 = tmp_2;
621
- tmp_1 = to(listOf(new Emitted(tmp$ret$7, first(results).r25_1)), file_0);
622
- } else {
623
- tmp_1 = to(results, file_0);
624
- }
625
- var tmp$ret$8 = tmp_1;
626
- destination.e(tmp$ret$8);
627
- }
628
- // Inline function 'kotlin.collections.mapTo' call
629
- var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
630
- var tmp0_iterator_0 = destination.g();
631
- while (tmp0_iterator_0.h()) {
632
- var item_0 = tmp0_iterator_0.i();
633
- // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>' call
634
- var tmp$ret$11 = right(item_0);
635
- destination_0.e(tmp$ret$11);
636
- }
637
- tmp = destination_0;
638
- } else {
639
- if (operation instanceof Compile) {
640
- var tmp_4;
641
- if (input instanceof Console) {
642
- tmp_4 = wirespec(input, languages, packageName, compile$lambda(output), logger);
643
- } else {
644
- if (input instanceof FullDirPath) {
645
- // Inline function 'kotlin.collections.flatMap' call
646
- // Inline function 'kotlin.collections.flatMapTo' call
647
- var this_3 = (new Directory(input.i2c_1)).n4b();
648
- var destination_1 = ArrayList_init_$Create$();
649
- var tmp0_iterator_1 = this_3.g();
650
- while (tmp0_iterator_1.h()) {
651
- var element = tmp0_iterator_1.i();
652
- // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>' call
653
- var list = wirespec(element, languages, packageName, out(element.l4b_1, packageName, output), logger);
654
- addAll(destination_1, list);
655
- }
656
- tmp_4 = destination_1;
657
- } else {
658
- if (input instanceof FullFilePath) {
659
- var tmp_5;
660
- if (input.e2c_1.equals(FileExtension_Wirespec_getInstance())) {
661
- // Inline function 'kotlin.let' call
662
- // Inline function 'kotlin.contracts.contract' call
663
- // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>' call
664
- var it = new WirespecFile(input);
665
- tmp_5 = wirespec(it, languages, packageName, out(it.l4b_1, packageName, output), logger);
666
- } else {
667
- // Inline function 'arrow.core.nel' call
668
- // Inline function 'arrow.core.nel' call
669
- var this_4 = new FileReadException('Path ' + input.toString() + ' is not a Wirespec file');
670
- var tmp$ret$19 = nonEmptyListOf(this_4, []);
671
- var this_5 = left(tmp$ret$19);
672
- tmp_5 = nonEmptyListOf(this_5, []);
673
- }
674
- tmp_4 = tmp_5;
675
- } else {
676
- noWhenBranchMatchedException();
677
- }
678
- }
679
- }
680
- tmp = tmp_4;
681
- } else {
682
- noWhenBranchMatchedException();
683
- }
684
- }
685
- return tmp;
686
- }
687
- function convert(arguments_0) {
688
- return compile_0(arguments_0);
689
- }
690
- function write(output, file) {
691
- // Inline function 'kotlin.collections.forEach' call
692
- var tmp0_iterator = output.g();
693
- while (tmp0_iterator.h()) {
694
- var element = tmp0_iterator.i();
695
- // Inline function 'community.flock.wirespec.plugin.cli.write.<anonymous>' call
696
- var name = element.qd();
697
- var result = element.rd();
698
- var tmp1_safe_receiver = file == null ? null : file.o4b(_FileName___init__impl__nzn12e(name));
699
- var tmp;
700
- if (tmp1_safe_receiver == null) {
701
- tmp = null;
702
- } else {
703
- tmp1_safe_receiver.s18(result);
704
- tmp = Unit_instance;
705
- }
706
- if (tmp == null) {
707
- print(result);
708
- }
709
- }
710
- }
711
- function out(_this__u8e3s4, packageName, output) {
712
- return out$lambda(output, _this__u8e3s4, packageName);
713
- }
714
- function emitters(_this__u8e3s4, packageName, path, logger) {
715
- // Inline function 'kotlin.collections.map' call
716
- // Inline function 'kotlin.collections.mapTo' call
717
- var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(_this__u8e3s4, 10));
718
- var tmp0_iterator = _this__u8e3s4.g();
719
- while (tmp0_iterator.h()) {
720
- var item = tmp0_iterator.i();
721
- // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>' call
722
- var packageString = component1(new PackageName(packageName));
723
- var tmp;
724
- switch (item.q2_1) {
725
- case 0:
726
- var tmp_0 = new JavaEmitter(packageString, logger);
727
- var tmp_1;
728
- if (path == null) {
729
- tmp_1 = null;
730
- } else {
731
- // Inline function 'kotlin.let' call
732
- // Inline function 'kotlin.contracts.contract' call
733
- // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
734
- tmp_1 = new JavaFile(path(FileExtension_Java_getInstance()));
735
- }
736
-
737
- tmp = to(tmp_0, tmp_1);
738
- break;
739
- case 1:
740
- var tmp_2 = new KotlinEmitter(packageString, logger);
741
- var tmp_3;
742
- if (path == null) {
743
- tmp_3 = null;
744
- } else {
745
- // Inline function 'kotlin.let' call
746
- // Inline function 'kotlin.contracts.contract' call
747
- // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
748
- tmp_3 = new KotlinFile(path(FileExtension_Kotlin_getInstance()));
749
- }
750
-
751
- tmp = to(tmp_2, tmp_3);
752
- break;
753
- case 2:
754
- var tmp_4 = new ScalaEmitter(packageString, logger);
755
- var tmp_5;
756
- if (path == null) {
757
- tmp_5 = null;
758
- } else {
759
- // Inline function 'kotlin.let' call
760
- // Inline function 'kotlin.contracts.contract' call
761
- // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
762
- tmp_5 = new ScalaFile(path(FileExtension_Scala_getInstance()));
763
- }
764
-
765
- tmp = to(tmp_4, tmp_5);
766
- break;
767
- case 3:
768
- var tmp_6 = new TypeScriptEmitter(logger);
769
- var tmp_7;
770
- if (path == null) {
771
- tmp_7 = null;
772
- } else {
773
- // Inline function 'kotlin.let' call
774
- // Inline function 'kotlin.contracts.contract' call
775
- // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
776
- tmp_7 = new TypeScriptFile(path(FileExtension_TypeScript_getInstance()));
777
- }
778
-
779
- tmp = to(tmp_6, tmp_7);
780
- break;
781
- case 4:
782
- var tmp_8 = new WirespecEmitter(logger);
783
- var tmp_9;
784
- if (path == null) {
785
- tmp_9 = null;
786
- } else {
787
- // Inline function 'kotlin.let' call
788
- // Inline function 'kotlin.contracts.contract' call
789
- // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
790
- tmp_9 = new WirespecFile(path(FileExtension_Wirespec_getInstance()));
791
- }
792
-
793
- tmp = to(tmp_8, tmp_9);
794
- break;
795
- case 5:
796
- var tmp_10 = OpenApiV2Emitter_getInstance();
797
- var tmp_11;
798
- if (path == null) {
799
- tmp_11 = null;
800
- } else {
801
- // Inline function 'kotlin.let' call
802
- // Inline function 'kotlin.contracts.contract' call
803
- // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
804
- tmp_11 = new JsonFile(path(FileExtension_Json_getInstance()));
805
- }
806
-
807
- tmp = to(tmp_10, tmp_11);
808
- break;
809
- case 6:
810
- var tmp_12 = OpenApiV3Emitter_getInstance();
811
- var tmp_13;
812
- if (path == null) {
813
- tmp_13 = null;
814
- } else {
815
- // Inline function 'kotlin.let' call
816
- // Inline function 'kotlin.contracts.contract' call
817
- // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
818
- tmp_13 = new JsonFile(path(FileExtension_Json_getInstance()));
819
- }
820
-
821
- tmp = to(tmp_12, tmp_13);
822
- break;
823
- default:
824
- noWhenBranchMatchedException();
825
- break;
826
- }
827
- var tmp$ret$14 = tmp;
828
- destination.e(tmp$ret$14);
829
- }
830
- return destination;
831
- }
832
- function wirespec(_this__u8e3s4, languages, packageName, path, logger) {
833
- // Inline function 'kotlin.collections.map' call
834
- // Inline function 'kotlin.let' call
835
- // Inline function 'kotlin.contracts.contract' call
836
- // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>' call
837
- var source = _this__u8e3s4.y1a();
838
- // Inline function 'kotlin.collections.map' call
839
- var this_0 = emitters(languages, packageName, path, logger);
840
- // Inline function 'kotlin.collections.mapTo' call
841
- var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
842
- var tmp0_iterator = this_0.g();
843
- while (tmp0_iterator.h()) {
844
- var item = tmp0_iterator.i();
845
- // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>.<anonymous>' call
846
- var emitter = item.qd();
847
- var file = item.rd();
848
- var results = compile(new wirespec$this$1(logger, emitter), source);
849
- var tmp;
850
- if (!emitter.i22_1) {
851
- // Inline function 'arrow.core.Either.map' call
852
- // Inline function 'kotlin.contracts.contract' call
853
- // Inline function 'arrow.core.flatMap' call
854
- // Inline function 'kotlin.contracts.contract' call
855
- var tmp_0;
856
- if (results instanceof Right) {
857
- // Inline function 'arrow.core.Either.map.<anonymous>' call
858
- // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>.<anonymous>.<anonymous>' call
859
- var it = results.zj_1;
860
- var tmp$ret$0 = listOf(new Emitted(Companion_getInstance().g24(_FileName___get_value__impl__3u4cz6(path(FileExtension_Wirespec_getInstance()).d2c_1)), first(it).r25_1));
861
- tmp_0 = new Right(tmp$ret$0);
862
- } else {
863
- if (results instanceof Left) {
864
- tmp_0 = results;
865
- } else {
866
- noWhenBranchMatchedException();
867
- }
868
- }
869
- var tmp$ret$3 = tmp_0;
870
- tmp = to(tmp$ret$3, file);
871
- } else {
872
- tmp = to(results, file);
873
- }
874
- var tmp$ret$4 = tmp;
875
- destination.e(tmp$ret$4);
876
- }
877
- // Inline function 'kotlin.collections.mapTo' call
878
- var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
879
- var tmp0_iterator_0 = destination.g();
880
- while (tmp0_iterator_0.h()) {
881
- var item_0 = tmp0_iterator_0.i();
882
- // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>' call
883
- var results_0 = item_0.qd();
884
- var file_0 = item_0.rd();
885
- // Inline function 'arrow.core.Either.map' call
886
- // Inline function 'kotlin.contracts.contract' call
887
- // Inline function 'arrow.core.flatMap' call
888
- // Inline function 'kotlin.contracts.contract' call
889
- var tmp_1;
890
- if (results_0 instanceof Right) {
891
- // Inline function 'arrow.core.Either.map.<anonymous>' call
892
- // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>.<anonymous>' call
893
- var it_0 = results_0.zj_1;
894
- var tmp$ret$9 = to(it_0, file_0);
895
- tmp_1 = new Right(tmp$ret$9);
896
- } else {
897
- if (results_0 instanceof Left) {
898
- tmp_1 = results_0;
899
- } else {
900
- noWhenBranchMatchedException();
901
- }
902
- }
903
- var tmp$ret$13 = tmp_1;
904
- destination_0.e(tmp$ret$13);
905
- }
906
- return destination_0;
907
- }
908
- function compile$ref() {
909
- var l = function (p0) {
910
- return compile_0(p0);
911
- };
912
- l.callableName = 'compile';
913
- return l;
914
- }
915
- function convert$ref() {
916
- var l = function (p0) {
917
- return convert(p0);
918
- };
919
- l.callableName = 'convert';
920
- return l;
921
- }
922
- function write$ref() {
923
- var l = function (p0, p1) {
924
- write(p0, p1);
925
- return Unit_instance;
926
- };
927
- l.callableName = 'write';
928
- return l;
929
- }
930
- function compile$lambda($output) {
931
- return function (it) {
932
- var tmp = $output;
933
- return new FullFilePath(_Output___get_value__impl__a8kw1g(ensureNotNull(tmp == null ? null : new Output(tmp)).l2c_1), _FileName___init__impl__nzn12e('console'), it);
934
- };
935
- }
936
- function out$lambda($output, $this_out, $packageName) {
937
- return function (extension) {
938
- var tmp0_elvis_lhs = $output;
939
- var tmp;
940
- var tmp_0 = tmp0_elvis_lhs;
941
- if ((tmp_0 == null ? null : new Output(tmp_0)) == null) {
942
- // Inline function 'kotlin.text.lowercase' call
943
- // Inline function 'kotlin.js.asDynamic' call
944
- var tmp$ret$1 = extension.p2_1.toLowerCase();
945
- tmp = $this_out.c2c_1 + '/out/' + tmp$ret$1;
946
- } else {
947
- tmp = new Output(tmp0_elvis_lhs);
948
- }
949
- var dir = tmp;
950
- return $this_out.g2c(toString(dir) + '/' + joinToString(split(_PackageName___get_value__impl__2zr98c($packageName), charArrayOf([_Char___init__impl__6a9atx(46)])), '/'), VOID, extension);
951
- };
952
- }
953
- function wirespec$this$1($logger, $emitter) {
954
- this.p4b_1 = $logger;
955
- this.q4b_1 = $emitter;
956
- }
957
- protoOf(wirespec$this$1).z21 = function () {
958
- return this.p4b_1;
959
- };
960
- protoOf(wirespec$this$1).g22 = function () {
961
- return this.q4b_1;
962
- };
963
- function Directory$wirespecFiles$lambda(it) {
964
- var tmp0_safe_receiver = get_SystemFileSystem().o47(it);
965
- var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.q47_1;
966
- return tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs;
967
- }
968
- function Directory$wirespecFiles$lambda_0(it) {
969
- return get_extension(it) === FileExtension_Wirespec_getInstance().b2c_1;
970
- }
971
- function Directory$wirespecFiles$lambda_1(it) {
972
- return it.r2();
973
- }
974
- function Directory$wirespecFiles$lambda_2(it) {
975
- return dropLast(it, FileExtension_Wirespec_getInstance().b2c_1.length + 1 | 0);
976
- }
977
- function Directory$wirespecFiles$lambda_3(this$0) {
978
- return function (it) {
979
- return new FullFilePath(this$0.m4b_1, _FileName___init__impl__nzn12e(it));
980
- };
981
- }
982
- function WirespecFile$_init_$ref_cj1n5j() {
983
- var l = function (p0) {
984
- return new WirespecFile(p0);
985
- };
986
- l.callableName = '<init>';
987
- return l;
988
- }
989
- function Directory(path) {
990
- this.m4b_1 = path;
991
- }
992
- protoOf(Directory).n4b = function () {
993
- // Inline function 'kotlin.let' call
994
- // Inline function 'kotlin.contracts.contract' call
995
- // Inline function 'community.flock.wirespec.plugin.cli.io.Directory.wirespecFiles.<anonymous>' call
996
- var it = Path(this.m4b_1);
997
- var tmp$ret$1 = get_SystemFileSystem().p47(it);
998
- var tmp = asSequence(tmp$ret$1);
999
- var tmp_0 = filter(tmp, Directory$wirespecFiles$lambda);
1000
- var tmp_1 = filter(tmp_0, Directory$wirespecFiles$lambda_0);
1001
- var tmp_2 = map(tmp_1, Directory$wirespecFiles$lambda_1);
1002
- var tmp_3 = map(tmp_2, Directory$wirespecFiles$lambda_2);
1003
- var tmp_4 = map(tmp_3, Directory$wirespecFiles$lambda_3(this));
1004
- return toSet_0(map(tmp_4, WirespecFile$_init_$ref_cj1n5j()));
1005
- };
1006
- function get_extension(_this__u8e3s4) {
1007
- return substringAfterLast(_this__u8e3s4.r2(), _Char___init__impl__6a9atx(46), '');
1008
- }
1009
- function File(path) {
1010
- this.l4b_1 = path;
1011
- }
1012
- protoOf(File).y1a = function () {
1013
- // Inline function 'kotlin.let' call
1014
- // Inline function 'kotlin.contracts.contract' call
1015
- // Inline function 'community.flock.wirespec.plugin.cli.io.File.read.<anonymous>' call
1016
- var it = Path(this.l4b_1.toString());
1017
- return readString(buffered(get_SystemFileSystem().l47(it)));
1018
- };
1019
- protoOf(File).s18 = function (string) {
1020
- // Inline function 'kotlin.let' call
1021
- // Inline function 'kotlin.contracts.contract' call
1022
- var path = Path(this.l4b_1.toString());
1023
- var tmp0_safe_receiver = path.u47();
1024
- var tmp;
1025
- if (tmp0_safe_receiver == null) {
1026
- tmp = null;
1027
- } else {
1028
- // Inline function 'kotlin.takeIf' call
1029
- // Inline function 'kotlin.contracts.contract' call
1030
- var tmp_0;
1031
- // Inline function 'community.flock.wirespec.plugin.cli.io.File.write.<anonymous>.<anonymous>' call
1032
- if (!get_SystemFileSystem().j47(tmp0_safe_receiver)) {
1033
- tmp_0 = tmp0_safe_receiver;
1034
- } else {
1035
- tmp_0 = null;
1036
- }
1037
- tmp = tmp_0;
1038
- }
1039
- var tmp1_safe_receiver = tmp;
1040
- if (tmp1_safe_receiver == null)
1041
- null;
1042
- else {
1043
- // Inline function 'kotlin.let' call
1044
- // Inline function 'kotlin.contracts.contract' call
1045
- get_SystemFileSystem().k47(tmp1_safe_receiver, true);
1046
- }
1047
- // Inline function 'kotlin.apply' call
1048
- var this_0 = buffered_0(get_SystemFileSystem().n47(path));
1049
- // Inline function 'kotlin.contracts.contract' call
1050
- // Inline function 'community.flock.wirespec.plugin.cli.io.File.write.<anonymous>.<anonymous>' call
1051
- writeString(this_0, string);
1052
- this_0.o8();
1053
- return Unit_instance;
1054
- };
1055
- function JavaFile(path) {
1056
- File.call(this, path.g2c(VOID, VOID, FileExtension_Java_getInstance()));
1057
- }
1058
- protoOf(JavaFile).o4b = function (fileName) {
1059
- return new JavaFile(this.l4b_1.g2c(VOID, fileName));
1060
- };
1061
- function JsonFile(path) {
1062
- File.call(this, path.g2c(VOID, VOID, FileExtension_Json_getInstance()));
1063
- }
1064
- protoOf(JsonFile).o4b = function (fileName) {
1065
- return new JsonFile(this.l4b_1.g2c(VOID, fileName));
1066
- };
1067
- function KotlinFile(path) {
1068
- File.call(this, path.g2c(VOID, VOID, FileExtension_Kotlin_getInstance()));
1069
- }
1070
- protoOf(KotlinFile).o4b = function (fileName) {
1071
- return new KotlinFile(this.l4b_1.g2c(VOID, fileName));
1072
- };
1073
- function ScalaFile(path) {
1074
- File.call(this, path.g2c(VOID, VOID, FileExtension_Scala_getInstance()));
1075
- }
1076
- protoOf(ScalaFile).o4b = function (fileName) {
1077
- return new ScalaFile(this.l4b_1.g2c(VOID, fileName));
1078
- };
1079
- function TypeScriptFile(path) {
1080
- File.call(this, path.g2c(VOID, VOID, FileExtension_TypeScript_getInstance()));
1081
- }
1082
- protoOf(TypeScriptFile).o4b = function (fileName) {
1083
- return new TypeScriptFile(this.l4b_1.g2c(VOID, fileName));
1084
- };
1085
- function WirespecFile(path) {
1086
- File.call(this, path.g2c(VOID, VOID, FileExtension_Wirespec_getInstance()));
1087
- }
1088
- protoOf(WirespecFile).o4b = function (fileName) {
1089
- return new WirespecFile(this.l4b_1.g2c(VOID, fileName));
1090
- };
1091
- function cli(args) {
1092
- main(args);
1093
- }
1094
- function parser(source) {
1095
- var tmp0_safe_receiver = parse(new parser$1(), source).yj();
1096
- var tmp;
1097
- if (tmp0_safe_receiver == null) {
1098
- tmp = null;
1099
- } else {
1100
- // Inline function 'kotlin.collections.filterIsInstance' call
1101
- // Inline function 'kotlin.collections.filterIsInstanceTo' call
1102
- var destination = ArrayList_init_$Create$();
1103
- var tmp0_iterator = tmp0_safe_receiver.g();
1104
- while (tmp0_iterator.h()) {
1105
- var element = tmp0_iterator.i();
1106
- if (!(element == null) ? isInterface(element, Definition) : false) {
1107
- destination.e(element);
1108
- }
1109
- }
1110
- tmp = destination;
1111
- }
1112
- var tmp1_safe_receiver = tmp;
1113
- var tmp_0;
1114
- if (tmp1_safe_receiver == null) {
1115
- tmp_0 = null;
1116
- } else {
1117
- // Inline function 'kotlin.collections.map' call
1118
- // Inline function 'kotlin.collections.mapTo' call
1119
- var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_safe_receiver, 10));
1120
- var tmp0_iterator_0 = tmp1_safe_receiver.g();
1121
- while (tmp0_iterator_0.h()) {
1122
- var item = tmp0_iterator_0.i();
1123
- // Inline function 'community.flock.wirespec.plugin.cli.parser.<anonymous>' call
1124
- var tmp$ret$2 = produce(item);
1125
- destination_0.e(tmp$ret$2);
1126
- }
1127
- tmp_0 = destination_0;
1128
- }
1129
- var tmp2_safe_receiver = tmp_0;
1130
- var tmp_1;
1131
- if (tmp2_safe_receiver == null) {
1132
- tmp_1 = null;
1133
- } else {
1134
- // Inline function 'kotlin.collections.toTypedArray' call
1135
- tmp_1 = copyToArray(tmp2_safe_receiver);
1136
- }
1137
- var tmp3_elvis_lhs = tmp_1;
1138
- var tmp_2;
1139
- if (tmp3_elvis_lhs == null) {
1140
- var message = 'Cannot parse source';
1141
- throw IllegalStateException_init_$Create$(toString(message));
1142
- } else {
1143
- tmp_2 = tmp3_elvis_lhs;
1144
- }
1145
- return tmp_2;
1146
- }
1147
- function parser$1() {
1148
- this.x4b_1 = get_noLogger();
1149
- }
1150
- protoOf(parser$1).z21 = function () {
1151
- return this.x4b_1;
1152
- };
1153
- function get_nodeArgs() {
1154
- _init_properties_CommandLineArguments_kt__b5v7hl();
1155
- return nodeArgs;
1156
- }
1157
- var nodeArgs;
1158
- function orNull(_this__u8e3s4, idx) {
1159
- _init_properties_CommandLineArguments_kt__b5v7hl();
1160
- // Inline function 'kotlin.Result.getOrNull' call
1161
- // Inline function 'kotlin.runCatching' call
1162
- var tmp;
1163
- try {
1164
- // Inline function 'kotlin.Companion.success' call
1165
- // Inline function 'community.flock.wirespec.plugin.utils.orNull.<anonymous>' call
1166
- var value = get_nodeArgs()[idx];
1167
- tmp = _Result___init__impl__xyqfz8(value);
1168
- } catch ($p) {
1169
- var tmp_0;
1170
- if ($p instanceof Error) {
1171
- var e = $p;
1172
- // Inline function 'kotlin.Companion.failure' call
1173
- tmp_0 = _Result___init__impl__xyqfz8(createFailure(e));
1174
- } else {
1175
- throw $p;
1176
- }
1177
- tmp = tmp_0;
1178
- }
1179
- var this_0 = tmp;
1180
- var tmp_1;
1181
- if (_Result___get_isFailure__impl__jpiriv(this_0)) {
1182
- tmp_1 = null;
1183
- } else {
1184
- var tmp_2 = _Result___get_value__impl__bjfvqg(this_0);
1185
- tmp_1 = (tmp_2 == null ? true : !(tmp_2 == null)) ? tmp_2 : THROW_CCE();
1186
- }
1187
- return tmp_1;
1188
- }
1189
- var properties_initialized_CommandLineArguments_kt_ekn5uh;
1190
- function _init_properties_CommandLineArguments_kt__b5v7hl() {
1191
- if (!properties_initialized_CommandLineArguments_kt_ekn5uh) {
1192
- properties_initialized_CommandLineArguments_kt_ekn5uh = true;
1193
- var tmp = process.argv.slice(2);
1194
- nodeArgs = (!(tmp == null) ? isArray(tmp) : false) ? tmp : THROW_CCE();
1195
- }
1196
- }
1197
- //region block: post-declaration
1198
- protoOf(wirespec$this$1).y21 = get_spec;
1199
- protoOf(parser$1).y21 = get_spec;
1200
- //endregion
1201
- //region block: init
1202
- Companion_instance_4 = new Companion();
1203
- //endregion
1204
- //region block: exports
1205
- function $jsExportAll$(_) {
1206
- var $community = _.community || (_.community = {});
1207
- var $community$flock = $community.flock || ($community.flock = {});
1208
- var $community$flock$wirespec = $community$flock.wirespec || ($community$flock.wirespec = {});
1209
- var $community$flock$wirespec$plugin = $community$flock$wirespec.plugin || ($community$flock$wirespec.plugin = {});
1210
- var $community$flock$wirespec$plugin$cli = $community$flock$wirespec$plugin.cli || ($community$flock$wirespec$plugin.cli = {});
1211
- $community$flock$wirespec$plugin$cli.cli = cli;
1212
- $community$flock$wirespec$plugin$cli.parser = parser;
1213
- }
1214
- $jsExportAll$(_);
1215
- _.$jsExportAll$ = $jsExportAll$;
1216
- _.$_$ = _.$_$ || {};
1217
- _.$_$.a = main;
1218
- //endregion
1219
- return _;
1220
- }));
1221
-
1222
- //# sourceMappingURL=wirespec-src-plugin-cli.js.map