@sddsjs/design-system-builder-cli 0.0.0-stage → 0.2.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.
Files changed (63) hide show
  1. package/LICENSE +4 -0
  2. package/README.md +969 -2
  3. package/bin/dsbuilder.js +2 -0
  4. package/dist/kotlin/Kotlin-Immutable-Collections-kotlinx-collections-immutable.js +3170 -0
  5. package/dist/kotlin/Stately-stately-concurrency.js +32 -0
  6. package/dist/kotlin/Stately-stately-concurrent-collections.js +302 -0
  7. package/dist/kotlin/Stately-stately-strict.js +12 -0
  8. package/dist/kotlin/clikt-clikt-mordant.js +304 -0
  9. package/dist/kotlin/clikt-clikt.js +6960 -0
  10. package/dist/kotlin/colormath-root-colormath.js +1653 -0
  11. package/dist/kotlin/design-system-builder-frontend-analytics-metrica.js +1026 -0
  12. package/dist/kotlin/design-system-builder-frontend-cli.js +10690 -0
  13. package/dist/kotlin/design-system-builder-frontend-core-analytics.js +128 -0
  14. package/dist/kotlin/design-system-builder-frontend-core-application.js +3634 -0
  15. package/dist/kotlin/design-system-builder-frontend-core-auth.js +1772 -0
  16. package/dist/kotlin/design-system-builder-frontend-core-domain.js +501 -0
  17. package/dist/kotlin/design-system-builder-frontend-core-network.js +3318 -0
  18. package/dist/kotlin/design-system-builder-frontend-core-platform.js +972 -0
  19. package/dist/kotlin/design-system-builder-frontend-core-process.js +236 -0
  20. package/dist/kotlin/design-system-builder-frontend-core-workspace.js +1058 -0
  21. package/dist/kotlin/design-system-builder-frontend-feature-auth.js +1664 -0
  22. package/dist/kotlin/design-system-builder-frontend-feature-components.js +24819 -0
  23. package/dist/kotlin/design-system-builder-frontend-feature-docs.js +7625 -0
  24. package/dist/kotlin/design-system-builder-frontend-feature-ds.js +2219 -0
  25. package/dist/kotlin/design-system-builder-frontend-feature-init.js +318 -0
  26. package/dist/kotlin/design-system-builder-frontend-feature-projects.js +624 -0
  27. package/dist/kotlin/design-system-builder-frontend-feature-status.js +984 -0
  28. package/dist/kotlin/design-system-builder-frontend-feature-theme.js +10456 -0
  29. package/dist/kotlin/design-system-builder-frontend-feature-toolchain.js +586 -0
  30. package/dist/kotlin/design-system-builder-frontend-mcp-server-core.js +6878 -0
  31. package/dist/kotlin/design-system-builder-frontend-platform-android.js +451 -0
  32. package/dist/kotlin/design-system-builder-frontend-platform-ios.js +1858 -0
  33. package/dist/kotlin/design-system-builder-frontend-platform-web.js +1555 -0
  34. package/dist/kotlin/design-system-builder-frontend-runtime-node.js +1763 -0
  35. package/dist/kotlin/kotlin-kotlin-stdlib.js +17881 -0
  36. package/dist/kotlin/kotlin-logging.js +440 -0
  37. package/dist/kotlin/kotlin-sdk-kotlin-sdk-core.js +20228 -0
  38. package/dist/kotlin/kotlin-sdk-kotlin-sdk-server.js +2771 -0
  39. package/dist/kotlin/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +8 -0
  40. package/dist/kotlin/kotlinx-atomicfu.js +252 -0
  41. package/dist/kotlin/kotlinx-coroutines-core.js +10822 -0
  42. package/dist/kotlin/kotlinx-io-kotlinx-io-bytestring.js +203 -0
  43. package/dist/kotlin/kotlinx-io-kotlinx-io-core.js +2032 -0
  44. package/dist/kotlin/kotlinx-serialization-kotlinx-serialization-core.js +6171 -0
  45. package/dist/kotlin/kotlinx-serialization-kotlinx-serialization-json.js +5690 -0
  46. package/dist/kotlin/ktor-ktor-client-core.js +8382 -0
  47. package/dist/kotlin/ktor-ktor-events.js +80 -0
  48. package/dist/kotlin/ktor-ktor-http-cio.js +2252 -0
  49. package/dist/kotlin/ktor-ktor-http.js +3320 -0
  50. package/dist/kotlin/ktor-ktor-io.js +3328 -0
  51. package/dist/kotlin/ktor-ktor-serialization.js +8 -0
  52. package/dist/kotlin/ktor-ktor-server-core.js +12 -0
  53. package/dist/kotlin/ktor-ktor-server-sse.js +8 -0
  54. package/dist/kotlin/ktor-ktor-server-websockets.js +8 -0
  55. package/dist/kotlin/ktor-ktor-sse.js +8 -0
  56. package/dist/kotlin/ktor-ktor-utils.js +2524 -0
  57. package/dist/kotlin/ktor-ktor-websocket-serialization.js +8 -0
  58. package/dist/kotlin/ktor-ktor-websockets.js +433 -0
  59. package/dist/kotlin/mordant-mordant-omnibus.js +8 -0
  60. package/dist/kotlin/mordant-mordant.js +12111 -0
  61. package/dist/kotlin/okio-parent-okio.js +2335 -0
  62. package/dist/kotlin/projects-core-koin-core.js +1285 -0
  63. package/package.json +26 -5
@@ -0,0 +1,624 @@
1
+ (function (_, kotlin_kotlin, kotlin_io_insert_koin_koin_core, kotlin_design_system_builder_frontend_core_network, kotlin_design_system_builder_frontend_core_application, kotlin_design_system_builder_frontend_core_auth, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json) {
2
+ 'use strict';
3
+ //region block: imports
4
+ var imul = Math.imul;
5
+ var VOID = kotlin_kotlin.$_$.c;
6
+ var module_0 = kotlin_io_insert_koin_koin_core.$_$.g;
7
+ var Companion_getInstance = kotlin_io_insert_koin_koin_core.$_$.b;
8
+ var Kind_Singleton_getInstance = kotlin_io_insert_koin_koin_core.$_$.a;
9
+ var emptyList = kotlin_kotlin.$_$.y7;
10
+ var getKClass = kotlin_kotlin.$_$.qf;
11
+ var BeanDefinition = kotlin_io_insert_koin_koin_core.$_$.c;
12
+ var SingleInstanceFactory = kotlin_io_insert_koin_koin_core.$_$.e;
13
+ var Unit_instance = kotlin_kotlin.$_$.r5;
14
+ var KoinDefinition = kotlin_io_insert_koin_koin_core.$_$.d;
15
+ var AuthenticatedHttpClientFactory = kotlin_design_system_builder_frontend_core_network.$_$.b;
16
+ var ApiUrlResolver = kotlin_design_system_builder_frontend_core_network.$_$.a;
17
+ var UserSessionAccess = kotlin_design_system_builder_frontend_core_application.$_$.u;
18
+ var CoroutineImpl = kotlin_kotlin.$_$.tb;
19
+ var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.db;
20
+ var noWhenBranchMatchedException = kotlin_kotlin.$_$.vl;
21
+ var AuthErrorCode_AUTH_REQUIRED_getInstance = kotlin_design_system_builder_frontend_core_auth.$_$.w;
22
+ var Failed = kotlin_design_system_builder_frontend_core_application.$_$.g;
23
+ var Selected = kotlin_design_system_builder_frontend_core_application.$_$.h;
24
+ var protoOf = kotlin_kotlin.$_$.te;
25
+ var initMetadataForCoroutine = kotlin_kotlin.$_$.sd;
26
+ var initMetadataForClass = kotlin_kotlin.$_$.qd;
27
+ var AuthErrorCode_PAT_INVALID_getInstance = kotlin_design_system_builder_frontend_core_auth.$_$.a1;
28
+ var to = kotlin_kotlin.$_$.cm;
29
+ var AuthErrorCode_FORBIDDEN_getInstance = kotlin_design_system_builder_frontend_core_auth.$_$.y;
30
+ var mapOf = kotlin_kotlin.$_$.i9;
31
+ var Enum = kotlin_kotlin.$_$.kk;
32
+ var toString = kotlin_kotlin.$_$.we;
33
+ var hashCode = kotlin_kotlin.$_$.pd;
34
+ var equals = kotlin_kotlin.$_$.jd;
35
+ var getStringHashCode = kotlin_kotlin.$_$.od;
36
+ var initMetadataForInterface = kotlin_kotlin.$_$.ud;
37
+ var KtList = kotlin_kotlin.$_$.f6;
38
+ var arrayOf = kotlin_kotlin.$_$.jl;
39
+ var createKType = kotlin_kotlin.$_$.of;
40
+ var createInvariantKTypeProjection = kotlin_kotlin.$_$.mf;
41
+ var serializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.s2;
42
+ var THROW_CCE = kotlin_kotlin.$_$.wk;
43
+ var KSerializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.k2;
44
+ var isInterface = kotlin_kotlin.$_$.fe;
45
+ var SerializationException = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.n2;
46
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.y6;
47
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.l;
48
+ var PersonalAccessToken = kotlin_design_system_builder_frontend_core_auth.$_$.e;
49
+ var KtMap = kotlin_kotlin.$_$.h6;
50
+ var Failure = kotlin_design_system_builder_frontend_core_network.$_$.e;
51
+ var Success = kotlin_design_system_builder_frontend_core_network.$_$.f;
52
+ var Json = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.r;
53
+ var initMetadataForCompanion = kotlin_kotlin.$_$.rd;
54
+ var PluginGeneratedSerialDescriptor = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.a2;
55
+ var StringSerializer_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.r;
56
+ var UnknownFieldException_init_$Create$ = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.e;
57
+ var get_nullable = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.u;
58
+ var typeParametersSerializers = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.t1;
59
+ var GeneratedSerializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.u1;
60
+ var initMetadataForObject = kotlin_kotlin.$_$.wd;
61
+ var throwMissingFieldException = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.f2;
62
+ var objectCreate = kotlin_kotlin.$_$.se;
63
+ //endregion
64
+ //region block: pre-declaration
65
+ initMetadataForCoroutine($executeCOROUTINE$, CoroutineImpl);
66
+ initMetadataForClass(ListProjectsUseCase, 'ListProjectsUseCase', VOID, VOID, VOID, [2]);
67
+ initMetadataForClass(ProjectsReadErrorCode, 'ProjectsReadErrorCode', VOID, Enum);
68
+ initMetadataForClass(Success_0, 'Success');
69
+ initMetadataForClass(Failed_0, 'Failed');
70
+ initMetadataForClass(Project, 'Project');
71
+ initMetadataForInterface(ProjectsClient, 'ProjectsClient', VOID, VOID, VOID, [2]);
72
+ initMetadataForCoroutine($listProjectsCOROUTINE$, CoroutineImpl);
73
+ initMetadataForClass(HttpProjectsClient, 'HttpProjectsClient', VOID, VOID, [ProjectsClient], [2]);
74
+ initMetadataForCompanion(Companion);
75
+ initMetadataForObject($serializer, '$serializer', VOID, VOID, [GeneratedSerializer]);
76
+ initMetadataForClass(ProjectDto, 'ProjectDto', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance});
77
+ //endregion
78
+ function projectsApplicationModule() {
79
+ return module_0(VOID, projectsApplicationModule$lambda);
80
+ }
81
+ function projectsApplicationModule$lambda($this$module) {
82
+ // Inline function 'org.koin.core.module.Module.single' call
83
+ // Inline function 'org.koin.core.module._singleInstanceFactory' call
84
+ var definition = projectsApplicationModule$lambda$lambda;
85
+ var scopeQualifier = Companion_getInstance().u56_1;
86
+ // Inline function 'org.koin.core.definition._createDefinition' call
87
+ var kind = Kind_Singleton_getInstance();
88
+ var secondaryTypes = emptyList();
89
+ var def = new BeanDefinition(scopeQualifier, getKClass(ProjectsClient), null, definition, kind, secondaryTypes);
90
+ var factory = new SingleInstanceFactory(def);
91
+ $this$module.k58(factory);
92
+ if (false || $this$module.e58_1) {
93
+ $this$module.m58(factory);
94
+ }
95
+ new KoinDefinition($this$module, factory);
96
+ // Inline function 'org.koin.core.module.Module.single' call
97
+ // Inline function 'org.koin.core.module._singleInstanceFactory' call
98
+ var definition_0 = projectsApplicationModule$lambda$lambda_0;
99
+ var scopeQualifier_0 = Companion_getInstance().u56_1;
100
+ // Inline function 'org.koin.core.definition._createDefinition' call
101
+ var kind_0 = Kind_Singleton_getInstance();
102
+ var secondaryTypes_0 = emptyList();
103
+ var def_0 = new BeanDefinition(scopeQualifier_0, getKClass(ListProjectsUseCase), null, definition_0, kind_0, secondaryTypes_0);
104
+ var factory_0 = new SingleInstanceFactory(def_0);
105
+ $this$module.k58(factory_0);
106
+ if (false || $this$module.e58_1) {
107
+ $this$module.m58(factory_0);
108
+ }
109
+ new KoinDefinition($this$module, factory_0);
110
+ return Unit_instance;
111
+ }
112
+ function projectsApplicationModule$lambda$lambda($this$single, it) {
113
+ // Inline function 'org.koin.core.scope.Scope.get' call
114
+ var tmp$ret$0 = $this$single.j59(getKClass(AuthenticatedHttpClientFactory), null, null);
115
+ return new HttpProjectsClient(tmp$ret$0);
116
+ }
117
+ function projectsApplicationModule$lambda$lambda_0($this$single, it) {
118
+ // Inline function 'org.koin.core.scope.Scope.get' call
119
+ var tmp = $this$single.j59(getKClass(ApiUrlResolver), null, null);
120
+ // Inline function 'org.koin.core.scope.Scope.get' call
121
+ var tmp_0 = $this$single.j59(getKClass(UserSessionAccess), null, null);
122
+ // Inline function 'org.koin.core.scope.Scope.get' call
123
+ var tmp$ret$2 = $this$single.j59(getKClass(ProjectsClient), null, null);
124
+ return new ListProjectsUseCase(tmp, tmp_0, tmp$ret$2);
125
+ }
126
+ function get_PROJECT_SESSION_FAILURES() {
127
+ _init_properties_ListProjectsUseCase_kt__cgc631();
128
+ return PROJECT_SESSION_FAILURES;
129
+ }
130
+ var PROJECT_SESSION_FAILURES;
131
+ function $executeCOROUTINE$(_this__u8e3s4, apiUrlOverride, credentialEnvName, resultContinuation) {
132
+ CoroutineImpl.call(this, resultContinuation);
133
+ this.t8f_1 = _this__u8e3s4;
134
+ this.u8f_1 = apiUrlOverride;
135
+ this.v8f_1 = credentialEnvName;
136
+ }
137
+ protoOf($executeCOROUTINE$).e9 = function () {
138
+ var suspendResult = this.y8_1;
139
+ $sm: do
140
+ try {
141
+ var tmp = this.w8_1;
142
+ switch (tmp) {
143
+ case 0:
144
+ this.x8_1 = 4;
145
+ this.x8f_1 = this.t8f_1.y8f_1.s59(this.u8f_1).m59_1;
146
+ this.w8_1 = 1;
147
+ suspendResult = this.t8f_1.z8f_1.g64(this.x8f_1, this.v8f_1, this);
148
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
149
+ return suspendResult;
150
+ }
151
+
152
+ continue $sm;
153
+ case 1:
154
+ var access = suspendResult;
155
+ if (access instanceof Selected) {
156
+ this.w8_1 = 2;
157
+ suspendResult = this.t8f_1.a8g_1.b8g(this.x8f_1, access.w5t_1, this);
158
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
159
+ return suspendResult;
160
+ }
161
+ continue $sm;
162
+ } else {
163
+ if (access instanceof Failed) {
164
+ var tmp_0 = this;
165
+ var tmp0_elvis_lhs = get_PROJECT_SESSION_FAILURES().c2(access.y5t_1);
166
+ var tmp_1 = tmp0_elvis_lhs == null ? ProjectsReadErrorCode_BACKEND_UNAVAILABLE_getInstance() : tmp0_elvis_lhs;
167
+ var tmp_2;
168
+ if (access.y5t_1.equals(AuthErrorCode_AUTH_REQUIRED_getInstance())) {
169
+ tmp_2 = 'Cannot authorize discovery. Run dsbuilder auth login and retry.';
170
+ } else {
171
+ tmp_2 = 'Cannot authorize discovery: ' + access.y5t_1.toString() + '.';
172
+ }
173
+ tmp_0.w8f_1 = new Failed_0(tmp_1, tmp_2);
174
+ this.w8_1 = 3;
175
+ continue $sm;
176
+ } else {
177
+ var tmp_3 = this;
178
+ noWhenBranchMatchedException();
179
+ }
180
+ }
181
+
182
+ break;
183
+ case 2:
184
+ this.w8f_1 = suspendResult;
185
+ this.w8_1 = 3;
186
+ continue $sm;
187
+ case 3:
188
+ return this.w8f_1;
189
+ case 4:
190
+ throw this.z8_1;
191
+ }
192
+ } catch ($p) {
193
+ var e = $p;
194
+ if (this.x8_1 === 4) {
195
+ throw e;
196
+ } else {
197
+ this.w8_1 = this.x8_1;
198
+ this.z8_1 = e;
199
+ }
200
+ }
201
+ while (true);
202
+ };
203
+ function ListProjectsUseCase(apiUrlResolver, sessionResolver, projectsClient) {
204
+ this.y8f_1 = apiUrlResolver;
205
+ this.z8f_1 = sessionResolver;
206
+ this.a8g_1 = projectsClient;
207
+ }
208
+ protoOf(ListProjectsUseCase).c8g = function (apiUrlOverride, credentialEnvName, $completion) {
209
+ var tmp = new $executeCOROUTINE$(this, apiUrlOverride, credentialEnvName, $completion);
210
+ tmp.y8_1 = Unit_instance;
211
+ tmp.z8_1 = null;
212
+ return tmp.e9();
213
+ };
214
+ protoOf(ListProjectsUseCase).d8g = function (apiUrlOverride, credentialEnvName, $completion, $super) {
215
+ apiUrlOverride = apiUrlOverride === VOID ? null : apiUrlOverride;
216
+ credentialEnvName = credentialEnvName === VOID ? null : credentialEnvName;
217
+ return $super === VOID ? this.c8g(apiUrlOverride, credentialEnvName, $completion) : $super.c8g.call(this, apiUrlOverride, credentialEnvName, $completion);
218
+ };
219
+ var properties_initialized_ListProjectsUseCase_kt_6yqoc1;
220
+ function _init_properties_ListProjectsUseCase_kt__cgc631() {
221
+ if (!properties_initialized_ListProjectsUseCase_kt_6yqoc1) {
222
+ properties_initialized_ListProjectsUseCase_kt_6yqoc1 = true;
223
+ PROJECT_SESSION_FAILURES = mapOf([to(AuthErrorCode_PAT_INVALID_getInstance(), ProjectsReadErrorCode_PAT_INVALID_getInstance()), to(AuthErrorCode_AUTH_REQUIRED_getInstance(), ProjectsReadErrorCode_AUTH_REQUIRED_getInstance()), to(AuthErrorCode_FORBIDDEN_getInstance(), ProjectsReadErrorCode_FORBIDDEN_getInstance())]);
224
+ }
225
+ }
226
+ var ProjectsReadErrorCode_AUTH_REQUIRED_instance;
227
+ var ProjectsReadErrorCode_PAT_INVALID_instance;
228
+ var ProjectsReadErrorCode_BACKEND_UNAVAILABLE_instance;
229
+ var ProjectsReadErrorCode_FORBIDDEN_instance;
230
+ var ProjectsReadErrorCode_NOT_FOUND_instance;
231
+ var ProjectsReadErrorCode_INVALID_BACKEND_RESPONSE_instance;
232
+ var ProjectsReadErrorCode_entriesInitialized;
233
+ function ProjectsReadErrorCode_initEntries() {
234
+ if (ProjectsReadErrorCode_entriesInitialized)
235
+ return Unit_instance;
236
+ ProjectsReadErrorCode_entriesInitialized = true;
237
+ ProjectsReadErrorCode_AUTH_REQUIRED_instance = new ProjectsReadErrorCode('AUTH_REQUIRED', 0);
238
+ ProjectsReadErrorCode_PAT_INVALID_instance = new ProjectsReadErrorCode('PAT_INVALID', 1);
239
+ ProjectsReadErrorCode_BACKEND_UNAVAILABLE_instance = new ProjectsReadErrorCode('BACKEND_UNAVAILABLE', 2);
240
+ ProjectsReadErrorCode_FORBIDDEN_instance = new ProjectsReadErrorCode('FORBIDDEN', 3);
241
+ ProjectsReadErrorCode_NOT_FOUND_instance = new ProjectsReadErrorCode('NOT_FOUND', 4);
242
+ ProjectsReadErrorCode_INVALID_BACKEND_RESPONSE_instance = new ProjectsReadErrorCode('INVALID_BACKEND_RESPONSE', 5);
243
+ }
244
+ function ProjectsReadErrorCode(name, ordinal) {
245
+ Enum.call(this, name, ordinal);
246
+ }
247
+ function Success_0(projects) {
248
+ this.e8g_1 = projects;
249
+ }
250
+ protoOf(Success_0).toString = function () {
251
+ return 'Success(projects=' + toString(this.e8g_1) + ')';
252
+ };
253
+ protoOf(Success_0).hashCode = function () {
254
+ return hashCode(this.e8g_1);
255
+ };
256
+ protoOf(Success_0).equals = function (other) {
257
+ if (this === other)
258
+ return true;
259
+ if (!(other instanceof Success_0))
260
+ return false;
261
+ if (!equals(this.e8g_1, other.e8g_1))
262
+ return false;
263
+ return true;
264
+ };
265
+ function Failed_0(code, message) {
266
+ this.f8g_1 = code;
267
+ this.g8g_1 = message;
268
+ }
269
+ protoOf(Failed_0).toString = function () {
270
+ return 'Failed(code=' + this.f8g_1.toString() + ', message=' + this.g8g_1 + ')';
271
+ };
272
+ protoOf(Failed_0).hashCode = function () {
273
+ var result = this.f8g_1.hashCode();
274
+ result = imul(result, 31) + getStringHashCode(this.g8g_1) | 0;
275
+ return result;
276
+ };
277
+ protoOf(Failed_0).equals = function (other) {
278
+ if (this === other)
279
+ return true;
280
+ if (!(other instanceof Failed_0))
281
+ return false;
282
+ if (!this.f8g_1.equals(other.f8g_1))
283
+ return false;
284
+ if (!(this.g8g_1 === other.g8g_1))
285
+ return false;
286
+ return true;
287
+ };
288
+ function Project(id, name, description) {
289
+ this.h8g_1 = id;
290
+ this.i8g_1 = name;
291
+ this.j8g_1 = description;
292
+ }
293
+ protoOf(Project).toString = function () {
294
+ return 'Project(id=' + this.h8g_1 + ', name=' + this.i8g_1 + ', description=' + this.j8g_1 + ')';
295
+ };
296
+ protoOf(Project).hashCode = function () {
297
+ var result = getStringHashCode(this.h8g_1);
298
+ result = imul(result, 31) + getStringHashCode(this.i8g_1) | 0;
299
+ result = imul(result, 31) + (this.j8g_1 == null ? 0 : getStringHashCode(this.j8g_1)) | 0;
300
+ return result;
301
+ };
302
+ protoOf(Project).equals = function (other) {
303
+ if (this === other)
304
+ return true;
305
+ if (!(other instanceof Project))
306
+ return false;
307
+ if (!(this.h8g_1 === other.h8g_1))
308
+ return false;
309
+ if (!(this.i8g_1 === other.i8g_1))
310
+ return false;
311
+ if (!(this.j8g_1 == other.j8g_1))
312
+ return false;
313
+ return true;
314
+ };
315
+ function ProjectsClient() {
316
+ }
317
+ function ProjectsReadErrorCode_AUTH_REQUIRED_getInstance() {
318
+ ProjectsReadErrorCode_initEntries();
319
+ return ProjectsReadErrorCode_AUTH_REQUIRED_instance;
320
+ }
321
+ function ProjectsReadErrorCode_PAT_INVALID_getInstance() {
322
+ ProjectsReadErrorCode_initEntries();
323
+ return ProjectsReadErrorCode_PAT_INVALID_instance;
324
+ }
325
+ function ProjectsReadErrorCode_BACKEND_UNAVAILABLE_getInstance() {
326
+ ProjectsReadErrorCode_initEntries();
327
+ return ProjectsReadErrorCode_BACKEND_UNAVAILABLE_instance;
328
+ }
329
+ function ProjectsReadErrorCode_FORBIDDEN_getInstance() {
330
+ ProjectsReadErrorCode_initEntries();
331
+ return ProjectsReadErrorCode_FORBIDDEN_instance;
332
+ }
333
+ function ProjectsReadErrorCode_NOT_FOUND_getInstance() {
334
+ ProjectsReadErrorCode_initEntries();
335
+ return ProjectsReadErrorCode_NOT_FOUND_instance;
336
+ }
337
+ function ProjectsReadErrorCode_INVALID_BACKEND_RESPONSE_getInstance() {
338
+ ProjectsReadErrorCode_initEntries();
339
+ return ProjectsReadErrorCode_INVALID_BACKEND_RESPONSE_instance;
340
+ }
341
+ function get_PROJECT_HTTP_FAILURES() {
342
+ _init_properties_HttpProjectsClient_kt__phwh77();
343
+ return PROJECT_HTTP_FAILURES;
344
+ }
345
+ var PROJECT_HTTP_FAILURES;
346
+ function decode($this, body) {
347
+ var tmp;
348
+ try {
349
+ // Inline function 'kotlinx.serialization.json.Json.decodeFromString' call
350
+ var this_0 = $this.l8g_1;
351
+ // Inline function 'kotlinx.serialization.serializer' call
352
+ var this_1 = this_0.h24();
353
+ // Inline function 'kotlinx.serialization.internal.cast' call
354
+ var this_2 = serializer(this_1, createKType(getKClass(KtList), arrayOf([createInvariantKTypeProjection(createKType(getKClass(ProjectDto), arrayOf([]), false))]), false));
355
+ var tmp$ret$1 = isInterface(this_2, KSerializer) ? this_2 : THROW_CCE();
356
+ tmp = this_0.p35(tmp$ret$1, body);
357
+ } catch ($p) {
358
+ var tmp_0;
359
+ if ($p instanceof SerializationException) {
360
+ var exception = $p;
361
+ return new Failed_0(ProjectsReadErrorCode_INVALID_BACKEND_RESPONSE_getInstance(), 'Error: failed to parse project list.');
362
+ } else {
363
+ throw $p;
364
+ }
365
+ }
366
+ var dtos = tmp;
367
+ // Inline function 'kotlin.collections.map' call
368
+ // Inline function 'kotlin.collections.mapTo' call
369
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(dtos, 10));
370
+ var _iterator__ex2g4s = dtos.l();
371
+ while (_iterator__ex2g4s.m()) {
372
+ var item = _iterator__ex2g4s.n();
373
+ var tmp$ret$3 = new Project(item.m8g_1, item.n8g_1, item.o8g_1);
374
+ destination.j(tmp$ret$3);
375
+ }
376
+ return new Success_0(destination);
377
+ }
378
+ function HttpProjectsClient$json$lambda($this$Json) {
379
+ $this$Json.j36_1 = true;
380
+ return Unit_instance;
381
+ }
382
+ function $listProjectsCOROUTINE$(_this__u8e3s4, apiUrl, credential, resultContinuation) {
383
+ CoroutineImpl.call(this, resultContinuation);
384
+ this.x8g_1 = _this__u8e3s4;
385
+ this.y8g_1 = apiUrl;
386
+ this.z8g_1 = credential;
387
+ }
388
+ protoOf($listProjectsCOROUTINE$).e9 = function () {
389
+ var suspendResult = this.y8_1;
390
+ $sm: do
391
+ try {
392
+ var tmp = this.w8_1;
393
+ switch (tmp) {
394
+ case 0:
395
+ this.x8_1 = 2;
396
+ var client = this.x8g_1.k8g_1.y59(this.y8g_1, this.z8g_1);
397
+ this.w8_1 = 1;
398
+ suspendResult = client.z59('/api/projects', this);
399
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
400
+ return suspendResult;
401
+ }
402
+
403
+ continue $sm;
404
+ case 1:
405
+ var result = suspendResult;
406
+ var tmp_0;
407
+ if (result instanceof Success) {
408
+ tmp_0 = decode(this.x8g_1, result.f5a_1);
409
+ } else {
410
+ if (result instanceof Failure) {
411
+ var tmp_1;
412
+ var tmp_2;
413
+ if (result.j5a_1 === 401) {
414
+ var tmp_3 = this.z8g_1;
415
+ tmp_2 = tmp_3 instanceof PersonalAccessToken;
416
+ } else {
417
+ tmp_2 = false;
418
+ }
419
+ if (tmp_2) {
420
+ tmp_1 = new Failed_0(ProjectsReadErrorCode_PAT_INVALID_getInstance(), 'PAT is invalid or expired.');
421
+ } else {
422
+ var tmp0 = get_PROJECT_HTTP_FAILURES();
423
+ var key = result.j5a_1;
424
+ var tmp0_elvis_lhs = (isInterface(tmp0, KtMap) ? tmp0 : THROW_CCE()).c2(key);
425
+ var tmp_4;
426
+ if (tmp0_elvis_lhs == null) {
427
+ var tmp_5 = ProjectsReadErrorCode_BACKEND_UNAVAILABLE_getInstance();
428
+ var tmp1_safe_receiver = result.j5a_1;
429
+ var tmp_6;
430
+ if (tmp1_safe_receiver == null) {
431
+ tmp_6 = null;
432
+ } else {
433
+ tmp_6 = 'Cannot read projects: backend returned HTTP ' + tmp1_safe_receiver + '.';
434
+ }
435
+ var tmp2_elvis_lhs = tmp_6;
436
+ tmp_4 = new Failed_0(tmp_5, tmp2_elvis_lhs == null ? result.i5a_1 : tmp2_elvis_lhs);
437
+ } else {
438
+ tmp_4 = tmp0_elvis_lhs;
439
+ }
440
+ tmp_1 = tmp_4;
441
+ }
442
+ tmp_0 = tmp_1;
443
+ } else {
444
+ noWhenBranchMatchedException();
445
+ }
446
+ }
447
+
448
+ return tmp_0;
449
+ case 2:
450
+ throw this.z8_1;
451
+ }
452
+ } catch ($p) {
453
+ var e = $p;
454
+ if (this.x8_1 === 2) {
455
+ throw e;
456
+ } else {
457
+ this.w8_1 = this.x8_1;
458
+ this.z8_1 = e;
459
+ }
460
+ }
461
+ while (true);
462
+ };
463
+ function HttpProjectsClient(httpClientFactory) {
464
+ this.k8g_1 = httpClientFactory;
465
+ var tmp = this;
466
+ tmp.l8g_1 = Json(VOID, HttpProjectsClient$json$lambda);
467
+ }
468
+ protoOf(HttpProjectsClient).b8g = function (apiUrl, credential, $completion) {
469
+ var tmp = new $listProjectsCOROUTINE$(this, apiUrl, credential, $completion);
470
+ tmp.y8_1 = Unit_instance;
471
+ tmp.z8_1 = null;
472
+ return tmp.e9();
473
+ };
474
+ function Companion() {
475
+ }
476
+ var Companion_instance;
477
+ function Companion_getInstance_0() {
478
+ return Companion_instance;
479
+ }
480
+ function $serializer() {
481
+ $serializer_instance = this;
482
+ var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('com.dsbuilder.frontend.feature.projects.data.ProjectDto', this, 3);
483
+ tmp0_serialDesc.k2b('id', false);
484
+ tmp0_serialDesc.k2b('name', false);
485
+ tmp0_serialDesc.k2b('description', true);
486
+ this.a8h_1 = tmp0_serialDesc;
487
+ }
488
+ protoOf($serializer).b8h = function (encoder, value) {
489
+ var tmp0_desc = this.a8h_1;
490
+ var tmp1_output = encoder.s23(tmp0_desc);
491
+ tmp1_output.h25(tmp0_desc, 0, value.m8g_1);
492
+ tmp1_output.h25(tmp0_desc, 1, value.n8g_1);
493
+ if (tmp1_output.p25(tmp0_desc, 2) ? true : !(value.o8g_1 == null)) {
494
+ tmp1_output.l25(tmp0_desc, 2, StringSerializer_getInstance(), value.o8g_1);
495
+ }
496
+ tmp1_output.t23(tmp0_desc);
497
+ };
498
+ protoOf($serializer).m20 = function (encoder, value) {
499
+ return this.b8h(encoder, value instanceof ProjectDto ? value : THROW_CCE());
500
+ };
501
+ protoOf($serializer).n20 = function (decoder) {
502
+ var tmp0_desc = this.a8h_1;
503
+ var tmp1_flag = true;
504
+ var tmp2_index = 0;
505
+ var tmp3_bitMask0 = 0;
506
+ var tmp4_local0 = null;
507
+ var tmp5_local1 = null;
508
+ var tmp6_local2 = null;
509
+ var tmp7_input = decoder.s23(tmp0_desc);
510
+ if (tmp7_input.i24()) {
511
+ tmp4_local0 = tmp7_input.c24(tmp0_desc, 0);
512
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
513
+ tmp5_local1 = tmp7_input.c24(tmp0_desc, 1);
514
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
515
+ tmp6_local2 = tmp7_input.g24(tmp0_desc, 2, StringSerializer_getInstance(), tmp6_local2);
516
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
517
+ } else
518
+ while (tmp1_flag) {
519
+ tmp2_index = tmp7_input.j24(tmp0_desc);
520
+ switch (tmp2_index) {
521
+ case -1:
522
+ tmp1_flag = false;
523
+ break;
524
+ case 0:
525
+ tmp4_local0 = tmp7_input.c24(tmp0_desc, 0);
526
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
527
+ break;
528
+ case 1:
529
+ tmp5_local1 = tmp7_input.c24(tmp0_desc, 1);
530
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
531
+ break;
532
+ case 2:
533
+ tmp6_local2 = tmp7_input.g24(tmp0_desc, 2, StringSerializer_getInstance(), tmp6_local2);
534
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
535
+ break;
536
+ default:
537
+ throw UnknownFieldException_init_$Create$(tmp2_index);
538
+ }
539
+ }
540
+ tmp7_input.t23(tmp0_desc);
541
+ return ProjectDto_init_$Create$(tmp3_bitMask0, tmp4_local0, tmp5_local1, tmp6_local2, null);
542
+ };
543
+ protoOf($serializer).l20 = function () {
544
+ return this.a8h_1;
545
+ };
546
+ protoOf($serializer).z2b = function () {
547
+ // Inline function 'kotlin.arrayOf' call
548
+ // Inline function 'kotlin.js.unsafeCast' call
549
+ // Inline function 'kotlin.js.asDynamic' call
550
+ return [StringSerializer_getInstance(), StringSerializer_getInstance(), get_nullable(StringSerializer_getInstance())];
551
+ };
552
+ var $serializer_instance;
553
+ function $serializer_getInstance() {
554
+ if ($serializer_instance == null)
555
+ new $serializer();
556
+ return $serializer_instance;
557
+ }
558
+ function ProjectDto_init_$Init$(seen0, id, name, description, serializationConstructorMarker, $this) {
559
+ if (!(3 === (3 & seen0))) {
560
+ throwMissingFieldException(seen0, 3, $serializer_getInstance().a8h_1);
561
+ }
562
+ $this.m8g_1 = id;
563
+ $this.n8g_1 = name;
564
+ if (0 === (seen0 & 4))
565
+ $this.o8g_1 = null;
566
+ else
567
+ $this.o8g_1 = description;
568
+ return $this;
569
+ }
570
+ function ProjectDto_init_$Create$(seen0, id, name, description, serializationConstructorMarker) {
571
+ return ProjectDto_init_$Init$(seen0, id, name, description, serializationConstructorMarker, objectCreate(protoOf(ProjectDto)));
572
+ }
573
+ function ProjectDto(id, name, description) {
574
+ description = description === VOID ? null : description;
575
+ this.m8g_1 = id;
576
+ this.n8g_1 = name;
577
+ this.o8g_1 = description;
578
+ }
579
+ protoOf(ProjectDto).toString = function () {
580
+ return 'ProjectDto(id=' + this.m8g_1 + ', name=' + this.n8g_1 + ', description=' + this.o8g_1 + ')';
581
+ };
582
+ protoOf(ProjectDto).hashCode = function () {
583
+ var result = getStringHashCode(this.m8g_1);
584
+ result = imul(result, 31) + getStringHashCode(this.n8g_1) | 0;
585
+ result = imul(result, 31) + (this.o8g_1 == null ? 0 : getStringHashCode(this.o8g_1)) | 0;
586
+ return result;
587
+ };
588
+ protoOf(ProjectDto).equals = function (other) {
589
+ if (this === other)
590
+ return true;
591
+ if (!(other instanceof ProjectDto))
592
+ return false;
593
+ if (!(this.m8g_1 === other.m8g_1))
594
+ return false;
595
+ if (!(this.n8g_1 === other.n8g_1))
596
+ return false;
597
+ if (!(this.o8g_1 == other.o8g_1))
598
+ return false;
599
+ return true;
600
+ };
601
+ var properties_initialized_HttpProjectsClient_kt_oldhld;
602
+ function _init_properties_HttpProjectsClient_kt__phwh77() {
603
+ if (!properties_initialized_HttpProjectsClient_kt_oldhld) {
604
+ properties_initialized_HttpProjectsClient_kt_oldhld = true;
605
+ PROJECT_HTTP_FAILURES = mapOf([to(401, new Failed_0(ProjectsReadErrorCode_AUTH_REQUIRED_getInstance(), 'Run dsbuilder auth login and retry.')), to(403, new Failed_0(ProjectsReadErrorCode_FORBIDDEN_getInstance(), 'Cannot read projects.')), to(404, new Failed_0(ProjectsReadErrorCode_NOT_FOUND_getInstance(), 'Cannot read projects.'))]);
606
+ }
607
+ }
608
+ //region block: post-declaration
609
+ protoOf($serializer).a2c = typeParametersSerializers;
610
+ //endregion
611
+ //region block: init
612
+ Companion_instance = new Companion();
613
+ //endregion
614
+ //region block: exports
615
+ _.$_$ = _.$_$ || {};
616
+ _.$_$.a = ListProjectsUseCase;
617
+ _.$_$.b = Failed_0;
618
+ _.$_$.c = Success_0;
619
+ _.$_$.d = projectsApplicationModule;
620
+ //endregion
621
+ return _;
622
+ }(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./projects-core-koin-core.js'), require('./design-system-builder-frontend-core-network.js'), require('./design-system-builder-frontend-core-application.js'), require('./design-system-builder-frontend-core-auth.js'), require('./kotlinx-serialization-kotlinx-serialization-core.js'), require('./kotlinx-serialization-kotlinx-serialization-json.js')));
623
+
624
+ //# sourceMappingURL=design-system-builder-frontend-feature-projects.js.map