@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.
- package/LICENSE +4 -0
- package/README.md +969 -2
- package/bin/dsbuilder.js +2 -0
- package/dist/kotlin/Kotlin-Immutable-Collections-kotlinx-collections-immutable.js +3170 -0
- package/dist/kotlin/Stately-stately-concurrency.js +32 -0
- package/dist/kotlin/Stately-stately-concurrent-collections.js +302 -0
- package/dist/kotlin/Stately-stately-strict.js +12 -0
- package/dist/kotlin/clikt-clikt-mordant.js +304 -0
- package/dist/kotlin/clikt-clikt.js +6960 -0
- package/dist/kotlin/colormath-root-colormath.js +1653 -0
- package/dist/kotlin/design-system-builder-frontend-analytics-metrica.js +1026 -0
- package/dist/kotlin/design-system-builder-frontend-cli.js +10690 -0
- package/dist/kotlin/design-system-builder-frontend-core-analytics.js +128 -0
- package/dist/kotlin/design-system-builder-frontend-core-application.js +3634 -0
- package/dist/kotlin/design-system-builder-frontend-core-auth.js +1772 -0
- package/dist/kotlin/design-system-builder-frontend-core-domain.js +501 -0
- package/dist/kotlin/design-system-builder-frontend-core-network.js +3318 -0
- package/dist/kotlin/design-system-builder-frontend-core-platform.js +972 -0
- package/dist/kotlin/design-system-builder-frontend-core-process.js +236 -0
- package/dist/kotlin/design-system-builder-frontend-core-workspace.js +1058 -0
- package/dist/kotlin/design-system-builder-frontend-feature-auth.js +1664 -0
- package/dist/kotlin/design-system-builder-frontend-feature-components.js +24819 -0
- package/dist/kotlin/design-system-builder-frontend-feature-docs.js +7625 -0
- package/dist/kotlin/design-system-builder-frontend-feature-ds.js +2219 -0
- package/dist/kotlin/design-system-builder-frontend-feature-init.js +318 -0
- package/dist/kotlin/design-system-builder-frontend-feature-projects.js +624 -0
- package/dist/kotlin/design-system-builder-frontend-feature-status.js +984 -0
- package/dist/kotlin/design-system-builder-frontend-feature-theme.js +10456 -0
- package/dist/kotlin/design-system-builder-frontend-feature-toolchain.js +586 -0
- package/dist/kotlin/design-system-builder-frontend-mcp-server-core.js +6878 -0
- package/dist/kotlin/design-system-builder-frontend-platform-android.js +451 -0
- package/dist/kotlin/design-system-builder-frontend-platform-ios.js +1858 -0
- package/dist/kotlin/design-system-builder-frontend-platform-web.js +1555 -0
- package/dist/kotlin/design-system-builder-frontend-runtime-node.js +1763 -0
- package/dist/kotlin/kotlin-kotlin-stdlib.js +17881 -0
- package/dist/kotlin/kotlin-logging.js +440 -0
- package/dist/kotlin/kotlin-sdk-kotlin-sdk-core.js +20228 -0
- package/dist/kotlin/kotlin-sdk-kotlin-sdk-server.js +2771 -0
- package/dist/kotlin/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +8 -0
- package/dist/kotlin/kotlinx-atomicfu.js +252 -0
- package/dist/kotlin/kotlinx-coroutines-core.js +10822 -0
- package/dist/kotlin/kotlinx-io-kotlinx-io-bytestring.js +203 -0
- package/dist/kotlin/kotlinx-io-kotlinx-io-core.js +2032 -0
- package/dist/kotlin/kotlinx-serialization-kotlinx-serialization-core.js +6171 -0
- package/dist/kotlin/kotlinx-serialization-kotlinx-serialization-json.js +5690 -0
- package/dist/kotlin/ktor-ktor-client-core.js +8382 -0
- package/dist/kotlin/ktor-ktor-events.js +80 -0
- package/dist/kotlin/ktor-ktor-http-cio.js +2252 -0
- package/dist/kotlin/ktor-ktor-http.js +3320 -0
- package/dist/kotlin/ktor-ktor-io.js +3328 -0
- package/dist/kotlin/ktor-ktor-serialization.js +8 -0
- package/dist/kotlin/ktor-ktor-server-core.js +12 -0
- package/dist/kotlin/ktor-ktor-server-sse.js +8 -0
- package/dist/kotlin/ktor-ktor-server-websockets.js +8 -0
- package/dist/kotlin/ktor-ktor-sse.js +8 -0
- package/dist/kotlin/ktor-ktor-utils.js +2524 -0
- package/dist/kotlin/ktor-ktor-websocket-serialization.js +8 -0
- package/dist/kotlin/ktor-ktor-websockets.js +433 -0
- package/dist/kotlin/mordant-mordant-omnibus.js +8 -0
- package/dist/kotlin/mordant-mordant.js +12111 -0
- package/dist/kotlin/okio-parent-okio.js +2335 -0
- package/dist/kotlin/projects-core-koin-core.js +1285 -0
- package/package.json +26 -5
|
@@ -0,0 +1,2219 @@
|
|
|
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_platform, kotlin_design_system_builder_frontend_core_auth, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json, kotlin_design_system_builder_frontend_core_domain) {
|
|
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 ContextResolver = kotlin_design_system_builder_frontend_core_application.$_$.b;
|
|
19
|
+
var CredentialProvider = kotlin_design_system_builder_frontend_core_application.$_$.e;
|
|
20
|
+
var RuntimeRequestResolver = kotlin_design_system_builder_frontend_core_application.$_$.q;
|
|
21
|
+
var PlatformCapabilityRunner = kotlin_design_system_builder_frontend_core_platform.$_$.f;
|
|
22
|
+
var Enum = kotlin_kotlin.$_$.kk;
|
|
23
|
+
var protoOf = kotlin_kotlin.$_$.te;
|
|
24
|
+
var initMetadataForClass = kotlin_kotlin.$_$.qd;
|
|
25
|
+
var toString = kotlin_kotlin.$_$.we;
|
|
26
|
+
var hashCode = kotlin_kotlin.$_$.pd;
|
|
27
|
+
var equals = kotlin_kotlin.$_$.jd;
|
|
28
|
+
var getStringHashCode = kotlin_kotlin.$_$.od;
|
|
29
|
+
var CoroutineImpl = kotlin_kotlin.$_$.tb;
|
|
30
|
+
var isBlank = kotlin_kotlin.$_$.gh;
|
|
31
|
+
var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.db;
|
|
32
|
+
var noWhenBranchMatchedException = kotlin_kotlin.$_$.vl;
|
|
33
|
+
var AuthErrorCode_AUTH_REQUIRED_getInstance = kotlin_design_system_builder_frontend_core_auth.$_$.w;
|
|
34
|
+
var Failed = kotlin_design_system_builder_frontend_core_application.$_$.g;
|
|
35
|
+
var Selected = kotlin_design_system_builder_frontend_core_application.$_$.h;
|
|
36
|
+
var initMetadataForCoroutine = kotlin_kotlin.$_$.sd;
|
|
37
|
+
var initMetadataForInterface = kotlin_kotlin.$_$.ud;
|
|
38
|
+
var AuthErrorCode_PAT_INVALID_getInstance = kotlin_design_system_builder_frontend_core_auth.$_$.a1;
|
|
39
|
+
var to = kotlin_kotlin.$_$.cm;
|
|
40
|
+
var AuthErrorCode_FORBIDDEN_getInstance = kotlin_design_system_builder_frontend_core_auth.$_$.y;
|
|
41
|
+
var mapOf = kotlin_kotlin.$_$.i9;
|
|
42
|
+
var Companion_instance = kotlin_kotlin.$_$.m5;
|
|
43
|
+
var THROW_CCE = kotlin_kotlin.$_$.wk;
|
|
44
|
+
var JsonObject = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.n;
|
|
45
|
+
var getValue = kotlin_kotlin.$_$.l8;
|
|
46
|
+
var JsonPrimitive = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.q;
|
|
47
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.v1;
|
|
48
|
+
var JsonArray = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.j;
|
|
49
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.y6;
|
|
50
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.l;
|
|
51
|
+
var _ProjectId___init__impl__b1fobp = kotlin_design_system_builder_frontend_core_domain.$_$.d1;
|
|
52
|
+
var _DesignSystemId___init__impl__6op7ax = kotlin_design_system_builder_frontend_core_domain.$_$.v;
|
|
53
|
+
var DesignSystemSelection = kotlin_design_system_builder_frontend_core_domain.$_$.a;
|
|
54
|
+
var DesignSystemLink_getInstance = kotlin_design_system_builder_frontend_core_application.$_$.w;
|
|
55
|
+
var JsonPrimitive_0 = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.o;
|
|
56
|
+
var plus = kotlin_kotlin.$_$.r9;
|
|
57
|
+
var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.e3;
|
|
58
|
+
var createFailure = kotlin_kotlin.$_$.nl;
|
|
59
|
+
var Result__exceptionOrNull_impl_p6xea9 = kotlin_kotlin.$_$.f3;
|
|
60
|
+
var _Result___get_value__impl__bjfvqg = kotlin_kotlin.$_$.i3;
|
|
61
|
+
var Regex_init_$Create$ = kotlin_kotlin.$_$.e1;
|
|
62
|
+
var initMetadataForCompanion = kotlin_kotlin.$_$.rd;
|
|
63
|
+
var Capability_DESIGN_SYSTEM_getInstance = kotlin_design_system_builder_frontend_core_platform.$_$.w;
|
|
64
|
+
var PlatformRunCommand = kotlin_design_system_builder_frontend_core_platform.$_$.j;
|
|
65
|
+
var toString_0 = kotlin_kotlin.$_$.bm;
|
|
66
|
+
var emptyMap = kotlin_kotlin.$_$.z7;
|
|
67
|
+
var charSequenceLength = kotlin_kotlin.$_$.fd;
|
|
68
|
+
var JsonNull_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.f;
|
|
69
|
+
var singleOrNull = kotlin_kotlin.$_$.aa;
|
|
70
|
+
var _ProjectId___get_value__impl__lfubnr = kotlin_design_system_builder_frontend_core_domain.$_$.g1;
|
|
71
|
+
var _ProjectApiUrl___get_value__impl__ub99up = kotlin_design_system_builder_frontend_core_domain.$_$.c1;
|
|
72
|
+
var ServiceToken = kotlin_design_system_builder_frontend_core_auth.$_$.f;
|
|
73
|
+
var Bearer = kotlin_design_system_builder_frontend_core_auth.$_$.d;
|
|
74
|
+
var PersonalAccessToken = kotlin_design_system_builder_frontend_core_auth.$_$.e;
|
|
75
|
+
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.w2;
|
|
76
|
+
var replace = kotlin_kotlin.$_$.bi;
|
|
77
|
+
var plus_0 = kotlin_kotlin.$_$.o9;
|
|
78
|
+
var Resolved = kotlin_design_system_builder_frontend_core_application.$_$.t;
|
|
79
|
+
var Failed_0 = kotlin_design_system_builder_frontend_core_application.$_$.s;
|
|
80
|
+
var Success = kotlin_design_system_builder_frontend_core_network.$_$.f;
|
|
81
|
+
var Failure = kotlin_design_system_builder_frontend_core_network.$_$.e;
|
|
82
|
+
var Default_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.b;
|
|
83
|
+
var KtMap = kotlin_kotlin.$_$.h6;
|
|
84
|
+
var isInterface = kotlin_kotlin.$_$.fe;
|
|
85
|
+
var _DesignSystemId___get_value__impl__wgtkjx = kotlin_design_system_builder_frontend_core_domain.$_$.y;
|
|
86
|
+
var listOf = kotlin_kotlin.$_$.f9;
|
|
87
|
+
var get_longOrNull = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.y;
|
|
88
|
+
var Long = kotlin_kotlin.$_$.qk;
|
|
89
|
+
var compare = kotlin_kotlin.$_$.fc;
|
|
90
|
+
var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.v;
|
|
91
|
+
var mapOf_0 = kotlin_kotlin.$_$.h9;
|
|
92
|
+
var initMetadataForObject = kotlin_kotlin.$_$.wd;
|
|
93
|
+
var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.g1;
|
|
94
|
+
var encodeToByteArray = kotlin_kotlin.$_$.xg;
|
|
95
|
+
var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.c3;
|
|
96
|
+
var numberToChar = kotlin_kotlin.$_$.pe;
|
|
97
|
+
var contains = kotlin_kotlin.$_$.sg;
|
|
98
|
+
var toString_1 = kotlin_kotlin.$_$.ej;
|
|
99
|
+
var padStart = kotlin_kotlin.$_$.uh;
|
|
100
|
+
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.b2;
|
|
101
|
+
var toMutableMap = kotlin_kotlin.$_$.ra;
|
|
102
|
+
var setOf = kotlin_kotlin.$_$.z9;
|
|
103
|
+
var joinToString = kotlin_kotlin.$_$.r8;
|
|
104
|
+
var getBooleanHashCode = kotlin_kotlin.$_$.ld;
|
|
105
|
+
var JsonObjectBuilder = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.m;
|
|
106
|
+
var put = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.a1;
|
|
107
|
+
var toIntOrNull = kotlin_kotlin.$_$.zi;
|
|
108
|
+
//endregion
|
|
109
|
+
//region block: pre-declaration
|
|
110
|
+
initMetadataForClass(DesignSystemsReadErrorCode, 'DesignSystemsReadErrorCode', VOID, Enum);
|
|
111
|
+
initMetadataForClass(Success_0, 'Success');
|
|
112
|
+
initMetadataForClass(Failed_1, 'Failed');
|
|
113
|
+
initMetadataForClass(DesignSystemSummary, 'DesignSystemSummary');
|
|
114
|
+
initMetadataForCoroutine($executeCOROUTINE$, CoroutineImpl);
|
|
115
|
+
initMetadataForClass(ListDesignSystemsUseCase, 'ListDesignSystemsUseCase', VOID, VOID, VOID, [3]);
|
|
116
|
+
initMetadataForInterface(DesignSystemsClient, 'DesignSystemsClient', VOID, VOID, VOID, [3]);
|
|
117
|
+
initMetadataForCompanion(Companion);
|
|
118
|
+
initMetadataForCoroutine($executeCOROUTINE$_0, CoroutineImpl);
|
|
119
|
+
initMetadataForClass(DiscoverDesignSystemVersionsUseCase, 'DiscoverDesignSystemVersionsUseCase', VOID, VOID, VOID, [2]);
|
|
120
|
+
initMetadataForClass(DiscoverDesignSystemVersionsCommand, 'DiscoverDesignSystemVersionsCommand');
|
|
121
|
+
initMetadataForInterface(DesignSystemVersionsSource, 'DesignSystemVersionsSource', VOID, VOID, VOID, [3]);
|
|
122
|
+
initMetadataForClass(GenerateDesignSystemUseCase, 'GenerateDesignSystemUseCase', VOID, VOID, VOID, [2]);
|
|
123
|
+
initMetadataForClass(GenerateDesignSystemCommand, 'GenerateDesignSystemCommand', GenerateDesignSystemCommand);
|
|
124
|
+
initMetadataForClass(ModelReadCommand, 'ModelReadCommand');
|
|
125
|
+
initMetadataForClass(ModelReadOperation, 'ModelReadOperation', VOID, Enum);
|
|
126
|
+
initMetadataForClass(Success_1, 'Success');
|
|
127
|
+
initMetadataForClass(Failed_2, 'Failed');
|
|
128
|
+
initMetadataForCompanion(Companion_0);
|
|
129
|
+
initMetadataForCoroutine($executeCOROUTINE$_1, CoroutineImpl);
|
|
130
|
+
initMetadataForCoroutine($readResolvedCOROUTINE$, CoroutineImpl);
|
|
131
|
+
initMetadataForClass(ReadDesignSystemModelUseCase, 'ReadDesignSystemModelUseCase', VOID, VOID, VOID, [2]);
|
|
132
|
+
initMetadataForInterface(ModelReadRemoteSource, 'ModelReadRemoteSource', VOID, VOID, VOID, [2]);
|
|
133
|
+
initMetadataForClass(ModelReadRuntime, 'ModelReadRuntime');
|
|
134
|
+
initMetadataForCoroutine($readCOROUTINE$, CoroutineImpl);
|
|
135
|
+
initMetadataForClass(HttpDesignSystemVersionsSource, 'HttpDesignSystemVersionsSource', VOID, VOID, [DesignSystemVersionsSource], [3]);
|
|
136
|
+
initMetadataForCoroutine($listCOROUTINE$, CoroutineImpl);
|
|
137
|
+
initMetadataForClass(HttpDesignSystemsClient, 'HttpDesignSystemsClient', VOID, VOID, [DesignSystemsClient], [3]);
|
|
138
|
+
initMetadataForCoroutine($readCOROUTINE$_0, CoroutineImpl);
|
|
139
|
+
initMetadataForClass(HttpModelReadRemoteSource, 'HttpModelReadRemoteSource', VOID, VOID, [ModelReadRemoteSource], [2]);
|
|
140
|
+
initMetadataForObject(ModelReadContextDecoder, 'ModelReadContextDecoder');
|
|
141
|
+
initMetadataForCompanion(Companion_1);
|
|
142
|
+
initMetadataForClass(ModelReadHttpRequest, 'ModelReadHttpRequest');
|
|
143
|
+
initMetadataForObject(ModelReadResponseDecoder, 'ModelReadResponseDecoder');
|
|
144
|
+
//endregion
|
|
145
|
+
function dsApplicationModule() {
|
|
146
|
+
return module_0(VOID, dsApplicationModule$lambda);
|
|
147
|
+
}
|
|
148
|
+
function dsApplicationModule$lambda($this$module) {
|
|
149
|
+
// Inline function 'org.koin.core.module.Module.single' call
|
|
150
|
+
// Inline function 'org.koin.core.module._singleInstanceFactory' call
|
|
151
|
+
var definition = dsApplicationModule$lambda$lambda;
|
|
152
|
+
var scopeQualifier = Companion_getInstance().u56_1;
|
|
153
|
+
// Inline function 'org.koin.core.definition._createDefinition' call
|
|
154
|
+
var kind = Kind_Singleton_getInstance();
|
|
155
|
+
var secondaryTypes = emptyList();
|
|
156
|
+
var def = new BeanDefinition(scopeQualifier, getKClass(DesignSystemsClient), null, definition, kind, secondaryTypes);
|
|
157
|
+
var factory = new SingleInstanceFactory(def);
|
|
158
|
+
$this$module.k58(factory);
|
|
159
|
+
if (false || $this$module.e58_1) {
|
|
160
|
+
$this$module.m58(factory);
|
|
161
|
+
}
|
|
162
|
+
new KoinDefinition($this$module, factory);
|
|
163
|
+
// Inline function 'org.koin.core.module.Module.single' call
|
|
164
|
+
// Inline function 'org.koin.core.module._singleInstanceFactory' call
|
|
165
|
+
var definition_0 = dsApplicationModule$lambda$lambda_0;
|
|
166
|
+
var scopeQualifier_0 = Companion_getInstance().u56_1;
|
|
167
|
+
// Inline function 'org.koin.core.definition._createDefinition' call
|
|
168
|
+
var kind_0 = Kind_Singleton_getInstance();
|
|
169
|
+
var secondaryTypes_0 = emptyList();
|
|
170
|
+
var def_0 = new BeanDefinition(scopeQualifier_0, getKClass(ListDesignSystemsUseCase), null, definition_0, kind_0, secondaryTypes_0);
|
|
171
|
+
var factory_0 = new SingleInstanceFactory(def_0);
|
|
172
|
+
$this$module.k58(factory_0);
|
|
173
|
+
if (false || $this$module.e58_1) {
|
|
174
|
+
$this$module.m58(factory_0);
|
|
175
|
+
}
|
|
176
|
+
new KoinDefinition($this$module, factory_0);
|
|
177
|
+
// Inline function 'org.koin.core.module.Module.single' call
|
|
178
|
+
// Inline function 'org.koin.core.module._singleInstanceFactory' call
|
|
179
|
+
var definition_1 = dsApplicationModule$lambda$lambda_1;
|
|
180
|
+
var scopeQualifier_1 = Companion_getInstance().u56_1;
|
|
181
|
+
// Inline function 'org.koin.core.definition._createDefinition' call
|
|
182
|
+
var kind_1 = Kind_Singleton_getInstance();
|
|
183
|
+
var secondaryTypes_1 = emptyList();
|
|
184
|
+
var def_1 = new BeanDefinition(scopeQualifier_1, getKClass(DesignSystemVersionsSource), null, definition_1, kind_1, secondaryTypes_1);
|
|
185
|
+
var factory_1 = new SingleInstanceFactory(def_1);
|
|
186
|
+
$this$module.k58(factory_1);
|
|
187
|
+
if (false || $this$module.e58_1) {
|
|
188
|
+
$this$module.m58(factory_1);
|
|
189
|
+
}
|
|
190
|
+
new KoinDefinition($this$module, factory_1);
|
|
191
|
+
// Inline function 'org.koin.core.module.Module.single' call
|
|
192
|
+
// Inline function 'org.koin.core.module._singleInstanceFactory' call
|
|
193
|
+
var definition_2 = dsApplicationModule$lambda$lambda_2;
|
|
194
|
+
var scopeQualifier_2 = Companion_getInstance().u56_1;
|
|
195
|
+
// Inline function 'org.koin.core.definition._createDefinition' call
|
|
196
|
+
var kind_2 = Kind_Singleton_getInstance();
|
|
197
|
+
var secondaryTypes_2 = emptyList();
|
|
198
|
+
var def_2 = new BeanDefinition(scopeQualifier_2, getKClass(DiscoverDesignSystemVersionsUseCase), null, definition_2, kind_2, secondaryTypes_2);
|
|
199
|
+
var factory_2 = new SingleInstanceFactory(def_2);
|
|
200
|
+
$this$module.k58(factory_2);
|
|
201
|
+
if (false || $this$module.e58_1) {
|
|
202
|
+
$this$module.m58(factory_2);
|
|
203
|
+
}
|
|
204
|
+
new KoinDefinition($this$module, factory_2);
|
|
205
|
+
// Inline function 'org.koin.core.module.Module.single' call
|
|
206
|
+
// Inline function 'org.koin.core.module._singleInstanceFactory' call
|
|
207
|
+
var definition_3 = dsApplicationModule$lambda$lambda_3;
|
|
208
|
+
var scopeQualifier_3 = Companion_getInstance().u56_1;
|
|
209
|
+
// Inline function 'org.koin.core.definition._createDefinition' call
|
|
210
|
+
var kind_3 = Kind_Singleton_getInstance();
|
|
211
|
+
var secondaryTypes_3 = emptyList();
|
|
212
|
+
var def_3 = new BeanDefinition(scopeQualifier_3, getKClass(ModelReadRemoteSource), null, definition_3, kind_3, secondaryTypes_3);
|
|
213
|
+
var factory_3 = new SingleInstanceFactory(def_3);
|
|
214
|
+
$this$module.k58(factory_3);
|
|
215
|
+
if (false || $this$module.e58_1) {
|
|
216
|
+
$this$module.m58(factory_3);
|
|
217
|
+
}
|
|
218
|
+
new KoinDefinition($this$module, factory_3);
|
|
219
|
+
// Inline function 'org.koin.core.module.Module.single' call
|
|
220
|
+
// Inline function 'org.koin.core.module._singleInstanceFactory' call
|
|
221
|
+
var definition_4 = dsApplicationModule$lambda$lambda_4;
|
|
222
|
+
var scopeQualifier_4 = Companion_getInstance().u56_1;
|
|
223
|
+
// Inline function 'org.koin.core.definition._createDefinition' call
|
|
224
|
+
var kind_4 = Kind_Singleton_getInstance();
|
|
225
|
+
var secondaryTypes_4 = emptyList();
|
|
226
|
+
var def_4 = new BeanDefinition(scopeQualifier_4, getKClass(ReadDesignSystemModelUseCase), null, definition_4, kind_4, secondaryTypes_4);
|
|
227
|
+
var factory_4 = new SingleInstanceFactory(def_4);
|
|
228
|
+
$this$module.k58(factory_4);
|
|
229
|
+
if (false || $this$module.e58_1) {
|
|
230
|
+
$this$module.m58(factory_4);
|
|
231
|
+
}
|
|
232
|
+
new KoinDefinition($this$module, factory_4);
|
|
233
|
+
// Inline function 'org.koin.core.module.Module.single' call
|
|
234
|
+
// Inline function 'org.koin.core.module._singleInstanceFactory' call
|
|
235
|
+
var definition_5 = dsApplicationModule$lambda$lambda_5;
|
|
236
|
+
var scopeQualifier_5 = Companion_getInstance().u56_1;
|
|
237
|
+
// Inline function 'org.koin.core.definition._createDefinition' call
|
|
238
|
+
var kind_5 = Kind_Singleton_getInstance();
|
|
239
|
+
var secondaryTypes_5 = emptyList();
|
|
240
|
+
var def_5 = new BeanDefinition(scopeQualifier_5, getKClass(GenerateDesignSystemUseCase), null, definition_5, kind_5, secondaryTypes_5);
|
|
241
|
+
var factory_5 = new SingleInstanceFactory(def_5);
|
|
242
|
+
$this$module.k58(factory_5);
|
|
243
|
+
if (false || $this$module.e58_1) {
|
|
244
|
+
$this$module.m58(factory_5);
|
|
245
|
+
}
|
|
246
|
+
new KoinDefinition($this$module, factory_5);
|
|
247
|
+
return Unit_instance;
|
|
248
|
+
}
|
|
249
|
+
function dsApplicationModule$lambda$lambda($this$single, it) {
|
|
250
|
+
// Inline function 'org.koin.core.scope.Scope.get' call
|
|
251
|
+
var tmp$ret$0 = $this$single.j59(getKClass(AuthenticatedHttpClientFactory), null, null);
|
|
252
|
+
return new HttpDesignSystemsClient(tmp$ret$0);
|
|
253
|
+
}
|
|
254
|
+
function dsApplicationModule$lambda$lambda_0($this$single, it) {
|
|
255
|
+
// Inline function 'org.koin.core.scope.Scope.get' call
|
|
256
|
+
var tmp = $this$single.j59(getKClass(ApiUrlResolver), null, null);
|
|
257
|
+
// Inline function 'org.koin.core.scope.Scope.get' call
|
|
258
|
+
var tmp_0 = $this$single.j59(getKClass(UserSessionAccess), null, null);
|
|
259
|
+
// Inline function 'org.koin.core.scope.Scope.get' call
|
|
260
|
+
var tmp$ret$2 = $this$single.j59(getKClass(DesignSystemsClient), null, null);
|
|
261
|
+
return new ListDesignSystemsUseCase(tmp, tmp_0, tmp$ret$2);
|
|
262
|
+
}
|
|
263
|
+
function dsApplicationModule$lambda$lambda_1($this$single, it) {
|
|
264
|
+
// Inline function 'org.koin.core.scope.Scope.get' call
|
|
265
|
+
var tmp$ret$0 = $this$single.j59(getKClass(AuthenticatedHttpClientFactory), null, null);
|
|
266
|
+
return new HttpDesignSystemVersionsSource(tmp$ret$0);
|
|
267
|
+
}
|
|
268
|
+
function dsApplicationModule$lambda$lambda_2($this$single, it) {
|
|
269
|
+
// Inline function 'org.koin.core.scope.Scope.get' call
|
|
270
|
+
var tmp = $this$single.j59(getKClass(ApiUrlResolver), null, null);
|
|
271
|
+
// Inline function 'org.koin.core.scope.Scope.get' call
|
|
272
|
+
var tmp_0 = $this$single.j59(getKClass(UserSessionAccess), null, null);
|
|
273
|
+
// Inline function 'org.koin.core.scope.Scope.get' call
|
|
274
|
+
var tmp$ret$2 = $this$single.j59(getKClass(DesignSystemVersionsSource), null, null);
|
|
275
|
+
return new DiscoverDesignSystemVersionsUseCase(tmp, tmp_0, tmp$ret$2);
|
|
276
|
+
}
|
|
277
|
+
function dsApplicationModule$lambda$lambda_3($this$single, it) {
|
|
278
|
+
// Inline function 'org.koin.core.scope.Scope.get' call
|
|
279
|
+
var tmp$ret$0 = $this$single.j59(getKClass(AuthenticatedHttpClientFactory), null, null);
|
|
280
|
+
return new HttpModelReadRemoteSource(tmp$ret$0);
|
|
281
|
+
}
|
|
282
|
+
function dsApplicationModule$lambda$lambda_4($this$single, it) {
|
|
283
|
+
// Inline function 'org.koin.core.scope.Scope.get' call
|
|
284
|
+
var tmp = $this$single.j59(getKClass(ContextResolver), null, null);
|
|
285
|
+
// Inline function 'org.koin.core.scope.Scope.get' call
|
|
286
|
+
var tmp_0 = $this$single.j59(getKClass(ApiUrlResolver), null, null);
|
|
287
|
+
// Inline function 'org.koin.core.scope.Scope.get' call
|
|
288
|
+
var tmp$ret$2 = $this$single.j59(getKClass(CredentialProvider), null, null);
|
|
289
|
+
var tmp_1 = new RuntimeRequestResolver(tmp, tmp_0, tmp$ret$2);
|
|
290
|
+
// Inline function 'org.koin.core.scope.Scope.get' call
|
|
291
|
+
var tmp$ret$3 = $this$single.j59(getKClass(ModelReadRemoteSource), null, null);
|
|
292
|
+
return new ReadDesignSystemModelUseCase(tmp_1, tmp$ret$3);
|
|
293
|
+
}
|
|
294
|
+
function dsApplicationModule$lambda$lambda_5($this$single, it) {
|
|
295
|
+
// Inline function 'org.koin.core.scope.Scope.get' call
|
|
296
|
+
var tmp$ret$0 = $this$single.j59(getKClass(PlatformCapabilityRunner), null, null);
|
|
297
|
+
return new GenerateDesignSystemUseCase(tmp$ret$0);
|
|
298
|
+
}
|
|
299
|
+
function get_SYSTEM_SESSION_FAILURES() {
|
|
300
|
+
_init_properties_DesignSystemsCatalog_kt__o5nger();
|
|
301
|
+
return SYSTEM_SESSION_FAILURES;
|
|
302
|
+
}
|
|
303
|
+
var SYSTEM_SESSION_FAILURES;
|
|
304
|
+
var DesignSystemsReadErrorCode_AUTH_REQUIRED_instance;
|
|
305
|
+
var DesignSystemsReadErrorCode_PAT_INVALID_instance;
|
|
306
|
+
var DesignSystemsReadErrorCode_FORBIDDEN_instance;
|
|
307
|
+
var DesignSystemsReadErrorCode_NOT_FOUND_instance;
|
|
308
|
+
var DesignSystemsReadErrorCode_BACKEND_UNAVAILABLE_instance;
|
|
309
|
+
var DesignSystemsReadErrorCode_INVALID_BACKEND_RESPONSE_instance;
|
|
310
|
+
var DesignSystemsReadErrorCode_INVALID_QUERY_instance;
|
|
311
|
+
var DesignSystemsReadErrorCode_entriesInitialized;
|
|
312
|
+
function DesignSystemsReadErrorCode_initEntries() {
|
|
313
|
+
if (DesignSystemsReadErrorCode_entriesInitialized)
|
|
314
|
+
return Unit_instance;
|
|
315
|
+
DesignSystemsReadErrorCode_entriesInitialized = true;
|
|
316
|
+
DesignSystemsReadErrorCode_AUTH_REQUIRED_instance = new DesignSystemsReadErrorCode('AUTH_REQUIRED', 0);
|
|
317
|
+
DesignSystemsReadErrorCode_PAT_INVALID_instance = new DesignSystemsReadErrorCode('PAT_INVALID', 1);
|
|
318
|
+
DesignSystemsReadErrorCode_FORBIDDEN_instance = new DesignSystemsReadErrorCode('FORBIDDEN', 2);
|
|
319
|
+
DesignSystemsReadErrorCode_NOT_FOUND_instance = new DesignSystemsReadErrorCode('NOT_FOUND', 3);
|
|
320
|
+
DesignSystemsReadErrorCode_BACKEND_UNAVAILABLE_instance = new DesignSystemsReadErrorCode('BACKEND_UNAVAILABLE', 4);
|
|
321
|
+
DesignSystemsReadErrorCode_INVALID_BACKEND_RESPONSE_instance = new DesignSystemsReadErrorCode('INVALID_BACKEND_RESPONSE', 5);
|
|
322
|
+
DesignSystemsReadErrorCode_INVALID_QUERY_instance = new DesignSystemsReadErrorCode('INVALID_QUERY', 6);
|
|
323
|
+
}
|
|
324
|
+
function DesignSystemsReadErrorCode(name, ordinal) {
|
|
325
|
+
Enum.call(this, name, ordinal);
|
|
326
|
+
}
|
|
327
|
+
function Success_0(items) {
|
|
328
|
+
this.g67_1 = items;
|
|
329
|
+
}
|
|
330
|
+
protoOf(Success_0).toString = function () {
|
|
331
|
+
return 'Success(items=' + toString(this.g67_1) + ')';
|
|
332
|
+
};
|
|
333
|
+
protoOf(Success_0).hashCode = function () {
|
|
334
|
+
return hashCode(this.g67_1);
|
|
335
|
+
};
|
|
336
|
+
protoOf(Success_0).equals = function (other) {
|
|
337
|
+
if (this === other)
|
|
338
|
+
return true;
|
|
339
|
+
if (!(other instanceof Success_0))
|
|
340
|
+
return false;
|
|
341
|
+
if (!equals(this.g67_1, other.g67_1))
|
|
342
|
+
return false;
|
|
343
|
+
return true;
|
|
344
|
+
};
|
|
345
|
+
function Failed_1(code, message) {
|
|
346
|
+
this.h67_1 = code;
|
|
347
|
+
this.i67_1 = message;
|
|
348
|
+
}
|
|
349
|
+
protoOf(Failed_1).toString = function () {
|
|
350
|
+
return 'Failed(code=' + this.h67_1.toString() + ', message=' + this.i67_1 + ')';
|
|
351
|
+
};
|
|
352
|
+
protoOf(Failed_1).hashCode = function () {
|
|
353
|
+
var result = this.h67_1.hashCode();
|
|
354
|
+
result = imul(result, 31) + getStringHashCode(this.i67_1) | 0;
|
|
355
|
+
return result;
|
|
356
|
+
};
|
|
357
|
+
protoOf(Failed_1).equals = function (other) {
|
|
358
|
+
if (this === other)
|
|
359
|
+
return true;
|
|
360
|
+
if (!(other instanceof Failed_1))
|
|
361
|
+
return false;
|
|
362
|
+
if (!this.h67_1.equals(other.h67_1))
|
|
363
|
+
return false;
|
|
364
|
+
if (!(this.i67_1 === other.i67_1))
|
|
365
|
+
return false;
|
|
366
|
+
return true;
|
|
367
|
+
};
|
|
368
|
+
function DesignSystemSummary(id, name, description) {
|
|
369
|
+
this.j67_1 = id;
|
|
370
|
+
this.k67_1 = name;
|
|
371
|
+
this.l67_1 = description;
|
|
372
|
+
}
|
|
373
|
+
protoOf(DesignSystemSummary).toString = function () {
|
|
374
|
+
return 'DesignSystemSummary(id=' + this.j67_1 + ', name=' + this.k67_1 + ', description=' + this.l67_1 + ')';
|
|
375
|
+
};
|
|
376
|
+
protoOf(DesignSystemSummary).hashCode = function () {
|
|
377
|
+
var result = getStringHashCode(this.j67_1);
|
|
378
|
+
result = imul(result, 31) + getStringHashCode(this.k67_1) | 0;
|
|
379
|
+
result = imul(result, 31) + (this.l67_1 == null ? 0 : getStringHashCode(this.l67_1)) | 0;
|
|
380
|
+
return result;
|
|
381
|
+
};
|
|
382
|
+
protoOf(DesignSystemSummary).equals = function (other) {
|
|
383
|
+
if (this === other)
|
|
384
|
+
return true;
|
|
385
|
+
if (!(other instanceof DesignSystemSummary))
|
|
386
|
+
return false;
|
|
387
|
+
if (!(this.j67_1 === other.j67_1))
|
|
388
|
+
return false;
|
|
389
|
+
if (!(this.k67_1 === other.k67_1))
|
|
390
|
+
return false;
|
|
391
|
+
if (!(this.l67_1 == other.l67_1))
|
|
392
|
+
return false;
|
|
393
|
+
return true;
|
|
394
|
+
};
|
|
395
|
+
function $executeCOROUTINE$(_this__u8e3s4, projectId, apiUrlOverride, credentialEnvName, resultContinuation) {
|
|
396
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
397
|
+
this.u67_1 = _this__u8e3s4;
|
|
398
|
+
this.v67_1 = projectId;
|
|
399
|
+
this.w67_1 = apiUrlOverride;
|
|
400
|
+
this.x67_1 = credentialEnvName;
|
|
401
|
+
}
|
|
402
|
+
protoOf($executeCOROUTINE$).e9 = function () {
|
|
403
|
+
var suspendResult = this.y8_1;
|
|
404
|
+
$sm: do
|
|
405
|
+
try {
|
|
406
|
+
var tmp = this.w8_1;
|
|
407
|
+
switch (tmp) {
|
|
408
|
+
case 0:
|
|
409
|
+
this.x8_1 = 4;
|
|
410
|
+
if (isBlank(this.v67_1)) {
|
|
411
|
+
return new Failed_1(DesignSystemsReadErrorCode_INVALID_QUERY_getInstance(), 'projectId is required.');
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
this.z67_1 = this.u67_1.a68_1.s59(this.w67_1).m59_1;
|
|
415
|
+
this.w8_1 = 1;
|
|
416
|
+
suspendResult = this.u67_1.b68_1.g64(this.z67_1, this.x67_1, this);
|
|
417
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
418
|
+
return suspendResult;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
continue $sm;
|
|
422
|
+
case 1:
|
|
423
|
+
var access = suspendResult;
|
|
424
|
+
if (access instanceof Selected) {
|
|
425
|
+
this.w8_1 = 2;
|
|
426
|
+
suspendResult = this.u67_1.c68_1.d68(this.z67_1, access.w5t_1, this.v67_1, this);
|
|
427
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
428
|
+
return suspendResult;
|
|
429
|
+
}
|
|
430
|
+
continue $sm;
|
|
431
|
+
} else {
|
|
432
|
+
if (access instanceof Failed) {
|
|
433
|
+
var tmp_0 = this;
|
|
434
|
+
var tmp0_elvis_lhs = get_SYSTEM_SESSION_FAILURES().c2(access.y5t_1);
|
|
435
|
+
var tmp_1 = tmp0_elvis_lhs == null ? DesignSystemsReadErrorCode_BACKEND_UNAVAILABLE_getInstance() : tmp0_elvis_lhs;
|
|
436
|
+
var tmp_2;
|
|
437
|
+
if (access.y5t_1.equals(AuthErrorCode_AUTH_REQUIRED_getInstance())) {
|
|
438
|
+
tmp_2 = 'Cannot authorize discovery. Run dsbuilder auth login and retry.';
|
|
439
|
+
} else {
|
|
440
|
+
tmp_2 = 'Cannot authorize discovery: ' + access.y5t_1.toString() + '.';
|
|
441
|
+
}
|
|
442
|
+
tmp_0.y67_1 = new Failed_1(tmp_1, tmp_2);
|
|
443
|
+
this.w8_1 = 3;
|
|
444
|
+
continue $sm;
|
|
445
|
+
} else {
|
|
446
|
+
var tmp_3 = this;
|
|
447
|
+
noWhenBranchMatchedException();
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
break;
|
|
452
|
+
case 2:
|
|
453
|
+
this.y67_1 = suspendResult;
|
|
454
|
+
this.w8_1 = 3;
|
|
455
|
+
continue $sm;
|
|
456
|
+
case 3:
|
|
457
|
+
return this.y67_1;
|
|
458
|
+
case 4:
|
|
459
|
+
throw this.z8_1;
|
|
460
|
+
}
|
|
461
|
+
} catch ($p) {
|
|
462
|
+
var e = $p;
|
|
463
|
+
if (this.x8_1 === 4) {
|
|
464
|
+
throw e;
|
|
465
|
+
} else {
|
|
466
|
+
this.w8_1 = this.x8_1;
|
|
467
|
+
this.z8_1 = e;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
while (true);
|
|
471
|
+
};
|
|
472
|
+
function ListDesignSystemsUseCase(apiUrlResolver, sessionResolver, client) {
|
|
473
|
+
this.a68_1 = apiUrlResolver;
|
|
474
|
+
this.b68_1 = sessionResolver;
|
|
475
|
+
this.c68_1 = client;
|
|
476
|
+
}
|
|
477
|
+
protoOf(ListDesignSystemsUseCase).e68 = function (projectId, apiUrlOverride, credentialEnvName, $completion) {
|
|
478
|
+
var tmp = new $executeCOROUTINE$(this, projectId, apiUrlOverride, credentialEnvName, $completion);
|
|
479
|
+
tmp.y8_1 = Unit_instance;
|
|
480
|
+
tmp.z8_1 = null;
|
|
481
|
+
return tmp.e9();
|
|
482
|
+
};
|
|
483
|
+
protoOf(ListDesignSystemsUseCase).f68 = function (projectId, apiUrlOverride, credentialEnvName, $completion, $super) {
|
|
484
|
+
apiUrlOverride = apiUrlOverride === VOID ? null : apiUrlOverride;
|
|
485
|
+
credentialEnvName = credentialEnvName === VOID ? null : credentialEnvName;
|
|
486
|
+
return $super === VOID ? this.e68(projectId, apiUrlOverride, credentialEnvName, $completion) : $super.e68.call(this, projectId, apiUrlOverride, credentialEnvName, $completion);
|
|
487
|
+
};
|
|
488
|
+
function DesignSystemsClient() {
|
|
489
|
+
}
|
|
490
|
+
function DesignSystemsReadErrorCode_AUTH_REQUIRED_getInstance() {
|
|
491
|
+
DesignSystemsReadErrorCode_initEntries();
|
|
492
|
+
return DesignSystemsReadErrorCode_AUTH_REQUIRED_instance;
|
|
493
|
+
}
|
|
494
|
+
function DesignSystemsReadErrorCode_PAT_INVALID_getInstance() {
|
|
495
|
+
DesignSystemsReadErrorCode_initEntries();
|
|
496
|
+
return DesignSystemsReadErrorCode_PAT_INVALID_instance;
|
|
497
|
+
}
|
|
498
|
+
function DesignSystemsReadErrorCode_FORBIDDEN_getInstance() {
|
|
499
|
+
DesignSystemsReadErrorCode_initEntries();
|
|
500
|
+
return DesignSystemsReadErrorCode_FORBIDDEN_instance;
|
|
501
|
+
}
|
|
502
|
+
function DesignSystemsReadErrorCode_NOT_FOUND_getInstance() {
|
|
503
|
+
DesignSystemsReadErrorCode_initEntries();
|
|
504
|
+
return DesignSystemsReadErrorCode_NOT_FOUND_instance;
|
|
505
|
+
}
|
|
506
|
+
function DesignSystemsReadErrorCode_BACKEND_UNAVAILABLE_getInstance() {
|
|
507
|
+
DesignSystemsReadErrorCode_initEntries();
|
|
508
|
+
return DesignSystemsReadErrorCode_BACKEND_UNAVAILABLE_instance;
|
|
509
|
+
}
|
|
510
|
+
function DesignSystemsReadErrorCode_INVALID_BACKEND_RESPONSE_getInstance() {
|
|
511
|
+
DesignSystemsReadErrorCode_initEntries();
|
|
512
|
+
return DesignSystemsReadErrorCode_INVALID_BACKEND_RESPONSE_instance;
|
|
513
|
+
}
|
|
514
|
+
function DesignSystemsReadErrorCode_INVALID_QUERY_getInstance() {
|
|
515
|
+
DesignSystemsReadErrorCode_initEntries();
|
|
516
|
+
return DesignSystemsReadErrorCode_INVALID_QUERY_instance;
|
|
517
|
+
}
|
|
518
|
+
var properties_initialized_DesignSystemsCatalog_kt_rt5cbv;
|
|
519
|
+
function _init_properties_DesignSystemsCatalog_kt__o5nger() {
|
|
520
|
+
if (!properties_initialized_DesignSystemsCatalog_kt_rt5cbv) {
|
|
521
|
+
properties_initialized_DesignSystemsCatalog_kt_rt5cbv = true;
|
|
522
|
+
SYSTEM_SESSION_FAILURES = mapOf([to(AuthErrorCode_PAT_INVALID_getInstance(), DesignSystemsReadErrorCode_PAT_INVALID_getInstance()), to(AuthErrorCode_AUTH_REQUIRED_getInstance(), DesignSystemsReadErrorCode_AUTH_REQUIRED_getInstance()), to(AuthErrorCode_FORBIDDEN_getInstance(), DesignSystemsReadErrorCode_FORBIDDEN_getInstance())]);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
function addLinks($this, result, command) {
|
|
526
|
+
if (!(result instanceof Success_1))
|
|
527
|
+
return result;
|
|
528
|
+
// Inline function 'kotlin.runCatching' call
|
|
529
|
+
var tmp;
|
|
530
|
+
try {
|
|
531
|
+
var tmp_0 = result.g68_1;
|
|
532
|
+
var envelope = tmp_0 instanceof JsonObject ? tmp_0 : THROW_CCE();
|
|
533
|
+
var tmp_1 = getValue(envelope, 'context');
|
|
534
|
+
var context = tmp_1 instanceof JsonObject ? tmp_1 : THROW_CCE();
|
|
535
|
+
var tmp_2 = getValue(context, 'designSystemId');
|
|
536
|
+
// Inline function 'kotlin.require' call
|
|
537
|
+
// Inline function 'kotlin.require' call
|
|
538
|
+
if (!((tmp_2 instanceof JsonPrimitive ? tmp_2 : THROW_CCE()).d38() === command.i68_1)) {
|
|
539
|
+
var message = 'Failed requirement.';
|
|
540
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
541
|
+
}
|
|
542
|
+
var tmp_3 = getValue(envelope, 'items');
|
|
543
|
+
var items = tmp_3 instanceof JsonArray ? tmp_3 : THROW_CCE();
|
|
544
|
+
// Inline function 'kotlin.collections.map' call
|
|
545
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
546
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(items, 10));
|
|
547
|
+
var _iterator__ex2g4s = items.l();
|
|
548
|
+
while (_iterator__ex2g4s.m()) {
|
|
549
|
+
var item = _iterator__ex2g4s.n();
|
|
550
|
+
var item_0 = item instanceof JsonObject ? item : THROW_CCE();
|
|
551
|
+
var tmp_4 = getValue(item_0, 'version');
|
|
552
|
+
// Inline function 'kotlin.also' call
|
|
553
|
+
var this_0 = tmp_4 instanceof JsonPrimitive ? tmp_4 : THROW_CCE();
|
|
554
|
+
// Inline function 'kotlin.require' call
|
|
555
|
+
// Inline function 'kotlin.require' call
|
|
556
|
+
if (!(this_0.c38() && Companion_getInstance_0().m68_1.ld(this_0.d38()))) {
|
|
557
|
+
var message_0 = 'Failed requirement.';
|
|
558
|
+
throw IllegalArgumentException_init_$Create$(toString(message_0));
|
|
559
|
+
}
|
|
560
|
+
var version = this_0.d38();
|
|
561
|
+
var tmp_5 = getValue(item_0, 'designSystemId');
|
|
562
|
+
// Inline function 'kotlin.require' call
|
|
563
|
+
// Inline function 'kotlin.require' call
|
|
564
|
+
if (!((tmp_5 instanceof JsonPrimitive ? tmp_5 : THROW_CCE()).d38() === command.i68_1)) {
|
|
565
|
+
var message_1 = 'Failed requirement.';
|
|
566
|
+
throw IllegalArgumentException_init_$Create$(toString(message_1));
|
|
567
|
+
}
|
|
568
|
+
var selection = new DesignSystemSelection(_ProjectId___init__impl__b1fobp(command.h68_1), _DesignSystemId___init__impl__6op7ax(command.i68_1), version);
|
|
569
|
+
var tmp$ret$11 = new JsonObject(plus(item_0, to('designSystem', JsonPrimitive_0(DesignSystemLink_getInstance().w5q(selection)))));
|
|
570
|
+
destination.j(tmp$ret$11);
|
|
571
|
+
}
|
|
572
|
+
var linked = destination;
|
|
573
|
+
// Inline function 'kotlin.Companion.success' call
|
|
574
|
+
var value = new Success_1(new JsonObject(plus(envelope, to('items', new JsonArray(linked)))));
|
|
575
|
+
tmp = _Result___init__impl__xyqfz8(value);
|
|
576
|
+
} catch ($p) {
|
|
577
|
+
var tmp_6;
|
|
578
|
+
if ($p instanceof Error) {
|
|
579
|
+
var e = $p;
|
|
580
|
+
// Inline function 'kotlin.Companion.failure' call
|
|
581
|
+
tmp_6 = _Result___init__impl__xyqfz8(createFailure(e));
|
|
582
|
+
} else {
|
|
583
|
+
throw $p;
|
|
584
|
+
}
|
|
585
|
+
tmp = tmp_6;
|
|
586
|
+
}
|
|
587
|
+
// Inline function 'kotlin.getOrElse' call
|
|
588
|
+
var this_1 = tmp;
|
|
589
|
+
var exception = Result__exceptionOrNull_impl_p6xea9(this_1);
|
|
590
|
+
var tmp_7;
|
|
591
|
+
if (exception == null) {
|
|
592
|
+
var tmp_8 = _Result___get_value__impl__bjfvqg(this_1);
|
|
593
|
+
tmp_7 = (tmp_8 == null ? true : !(tmp_8 == null)) ? tmp_8 : THROW_CCE();
|
|
594
|
+
} else {
|
|
595
|
+
tmp_7 = new Failed_2('INVALID_BACKEND_RESPONSE', 'Backend returned invalid published versions.');
|
|
596
|
+
}
|
|
597
|
+
return tmp_7;
|
|
598
|
+
}
|
|
599
|
+
function Companion() {
|
|
600
|
+
Companion_instance_0 = this;
|
|
601
|
+
this.l68_1 = Regex_init_$Create$('[A-Za-z0-9][A-Za-z0-9_-]*');
|
|
602
|
+
this.m68_1 = Regex_init_$Create$('(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)');
|
|
603
|
+
}
|
|
604
|
+
var Companion_instance_0;
|
|
605
|
+
function Companion_getInstance_0() {
|
|
606
|
+
if (Companion_instance_0 == null)
|
|
607
|
+
new Companion();
|
|
608
|
+
return Companion_instance_0;
|
|
609
|
+
}
|
|
610
|
+
function $executeCOROUTINE$_0(_this__u8e3s4, command, apiUrlOverride, resultContinuation) {
|
|
611
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
612
|
+
this.v68_1 = _this__u8e3s4;
|
|
613
|
+
this.w68_1 = command;
|
|
614
|
+
this.x68_1 = apiUrlOverride;
|
|
615
|
+
}
|
|
616
|
+
protoOf($executeCOROUTINE$_0).e9 = function () {
|
|
617
|
+
var suspendResult = this.y8_1;
|
|
618
|
+
$sm: do
|
|
619
|
+
try {
|
|
620
|
+
var tmp = this.w8_1;
|
|
621
|
+
switch (tmp) {
|
|
622
|
+
case 0:
|
|
623
|
+
this.x8_1 = 3;
|
|
624
|
+
var validIds = Companion_getInstance_0().l68_1.ld(this.w68_1.h68_1) && Companion_getInstance_0().l68_1.ld(this.w68_1.i68_1);
|
|
625
|
+
var tmp_0;
|
|
626
|
+
if (this.w68_1.j68_1 == null) {
|
|
627
|
+
tmp_0 = true;
|
|
628
|
+
} else {
|
|
629
|
+
var containsArg = this.w68_1.j68_1;
|
|
630
|
+
tmp_0 = 1 <= containsArg ? containsArg <= 200 : false;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
var validLimit = tmp_0;
|
|
634
|
+
if (!validIds || !validLimit) {
|
|
635
|
+
return new Failed_2('INVALID_QUERY', 'Valid projectId, designSystemId and limit 1..200 are required.');
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
this.y68_1 = this.v68_1.z68_1.s59(this.x68_1).m59_1;
|
|
639
|
+
this.w8_1 = 1;
|
|
640
|
+
suspendResult = this.v68_1.a69_1.h64(this.y68_1, VOID, this);
|
|
641
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
642
|
+
return suspendResult;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
continue $sm;
|
|
646
|
+
case 1:
|
|
647
|
+
var access = suspendResult;
|
|
648
|
+
if (access instanceof Failed) {
|
|
649
|
+
return new Failed_2(access.y5t_1.n2_1, 'Run dsbuilder auth login and retry.');
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
this.w8_1 = 2;
|
|
653
|
+
suspendResult = this.v68_1.b69_1.c69(this.y68_1, (access instanceof Selected ? access : THROW_CCE()).w5t_1, this.w68_1, this);
|
|
654
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
655
|
+
return suspendResult;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
continue $sm;
|
|
659
|
+
case 2:
|
|
660
|
+
var result = suspendResult;
|
|
661
|
+
return addLinks(this.v68_1, result, this.w68_1);
|
|
662
|
+
case 3:
|
|
663
|
+
throw this.z8_1;
|
|
664
|
+
}
|
|
665
|
+
} catch ($p) {
|
|
666
|
+
var e = $p;
|
|
667
|
+
if (this.x8_1 === 3) {
|
|
668
|
+
throw e;
|
|
669
|
+
} else {
|
|
670
|
+
this.w8_1 = this.x8_1;
|
|
671
|
+
this.z8_1 = e;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
while (true);
|
|
675
|
+
};
|
|
676
|
+
function DiscoverDesignSystemVersionsUseCase(apiUrlResolver, sessionResolver, source) {
|
|
677
|
+
Companion_getInstance_0();
|
|
678
|
+
this.z68_1 = apiUrlResolver;
|
|
679
|
+
this.a69_1 = sessionResolver;
|
|
680
|
+
this.b69_1 = source;
|
|
681
|
+
}
|
|
682
|
+
protoOf(DiscoverDesignSystemVersionsUseCase).d69 = function (command, apiUrlOverride, $completion) {
|
|
683
|
+
var tmp = new $executeCOROUTINE$_0(this, command, apiUrlOverride, $completion);
|
|
684
|
+
tmp.y8_1 = Unit_instance;
|
|
685
|
+
tmp.z8_1 = null;
|
|
686
|
+
return tmp.e9();
|
|
687
|
+
};
|
|
688
|
+
function DiscoverDesignSystemVersionsCommand(projectId, designSystemId, limit, cursor) {
|
|
689
|
+
limit = limit === VOID ? null : limit;
|
|
690
|
+
cursor = cursor === VOID ? null : cursor;
|
|
691
|
+
this.h68_1 = projectId;
|
|
692
|
+
this.i68_1 = designSystemId;
|
|
693
|
+
this.j68_1 = limit;
|
|
694
|
+
this.k68_1 = cursor;
|
|
695
|
+
}
|
|
696
|
+
protoOf(DiscoverDesignSystemVersionsCommand).toString = function () {
|
|
697
|
+
return 'DiscoverDesignSystemVersionsCommand(projectId=' + this.h68_1 + ', designSystemId=' + this.i68_1 + ', limit=' + this.j68_1 + ', cursor=' + this.k68_1 + ')';
|
|
698
|
+
};
|
|
699
|
+
protoOf(DiscoverDesignSystemVersionsCommand).hashCode = function () {
|
|
700
|
+
var result = getStringHashCode(this.h68_1);
|
|
701
|
+
result = imul(result, 31) + getStringHashCode(this.i68_1) | 0;
|
|
702
|
+
result = imul(result, 31) + (this.j68_1 == null ? 0 : this.j68_1) | 0;
|
|
703
|
+
result = imul(result, 31) + (this.k68_1 == null ? 0 : getStringHashCode(this.k68_1)) | 0;
|
|
704
|
+
return result;
|
|
705
|
+
};
|
|
706
|
+
protoOf(DiscoverDesignSystemVersionsCommand).equals = function (other) {
|
|
707
|
+
if (this === other)
|
|
708
|
+
return true;
|
|
709
|
+
if (!(other instanceof DiscoverDesignSystemVersionsCommand))
|
|
710
|
+
return false;
|
|
711
|
+
if (!(this.h68_1 === other.h68_1))
|
|
712
|
+
return false;
|
|
713
|
+
if (!(this.i68_1 === other.i68_1))
|
|
714
|
+
return false;
|
|
715
|
+
if (!(this.j68_1 == other.j68_1))
|
|
716
|
+
return false;
|
|
717
|
+
if (!(this.k68_1 == other.k68_1))
|
|
718
|
+
return false;
|
|
719
|
+
return true;
|
|
720
|
+
};
|
|
721
|
+
function DesignSystemVersionsSource() {
|
|
722
|
+
}
|
|
723
|
+
function GenerateDesignSystemUseCase(platformCapabilityRunner) {
|
|
724
|
+
this.e69_1 = platformCapabilityRunner;
|
|
725
|
+
}
|
|
726
|
+
protoOf(GenerateDesignSystemUseCase).f69 = function (command, onPlan, $completion) {
|
|
727
|
+
return this.e69_1.i66(new PlatformRunCommand(Capability_DESIGN_SYSTEM_getInstance(), command.g69_1, command.h69_1, command.i69_1, command.j69_1), onPlan, $completion);
|
|
728
|
+
};
|
|
729
|
+
function GenerateDesignSystemCommand(platform, output, passthrough, toolOverride) {
|
|
730
|
+
platform = platform === VOID ? null : platform;
|
|
731
|
+
output = output === VOID ? null : output;
|
|
732
|
+
passthrough = passthrough === VOID ? emptyList() : passthrough;
|
|
733
|
+
toolOverride = toolOverride === VOID ? null : toolOverride;
|
|
734
|
+
this.g69_1 = platform;
|
|
735
|
+
this.h69_1 = output;
|
|
736
|
+
this.i69_1 = passthrough;
|
|
737
|
+
this.j69_1 = toolOverride;
|
|
738
|
+
}
|
|
739
|
+
protoOf(GenerateDesignSystemCommand).toString = function () {
|
|
740
|
+
return 'GenerateDesignSystemCommand(platform=' + toString_0(this.g69_1) + ', output=' + this.h69_1 + ', passthrough=' + toString(this.i69_1) + ', toolOverride=' + this.j69_1 + ')';
|
|
741
|
+
};
|
|
742
|
+
protoOf(GenerateDesignSystemCommand).hashCode = function () {
|
|
743
|
+
var result = this.g69_1 == null ? 0 : this.g69_1.hashCode();
|
|
744
|
+
result = imul(result, 31) + (this.h69_1 == null ? 0 : getStringHashCode(this.h69_1)) | 0;
|
|
745
|
+
result = imul(result, 31) + hashCode(this.i69_1) | 0;
|
|
746
|
+
result = imul(result, 31) + (this.j69_1 == null ? 0 : getStringHashCode(this.j69_1)) | 0;
|
|
747
|
+
return result;
|
|
748
|
+
};
|
|
749
|
+
protoOf(GenerateDesignSystemCommand).equals = function (other) {
|
|
750
|
+
if (this === other)
|
|
751
|
+
return true;
|
|
752
|
+
if (!(other instanceof GenerateDesignSystemCommand))
|
|
753
|
+
return false;
|
|
754
|
+
if (!equals(this.g69_1, other.g69_1))
|
|
755
|
+
return false;
|
|
756
|
+
if (!(this.h69_1 == other.h69_1))
|
|
757
|
+
return false;
|
|
758
|
+
if (!equals(this.i69_1, other.i69_1))
|
|
759
|
+
return false;
|
|
760
|
+
if (!(this.j69_1 == other.j69_1))
|
|
761
|
+
return false;
|
|
762
|
+
return true;
|
|
763
|
+
};
|
|
764
|
+
function ModelReadCommand(operation, resourceId, version, filters, limit, cursor) {
|
|
765
|
+
resourceId = resourceId === VOID ? null : resourceId;
|
|
766
|
+
version = version === VOID ? null : version;
|
|
767
|
+
filters = filters === VOID ? emptyMap() : filters;
|
|
768
|
+
limit = limit === VOID ? null : limit;
|
|
769
|
+
cursor = cursor === VOID ? null : cursor;
|
|
770
|
+
this.k69_1 = operation;
|
|
771
|
+
this.l69_1 = resourceId;
|
|
772
|
+
this.m69_1 = version;
|
|
773
|
+
this.n69_1 = filters;
|
|
774
|
+
this.o69_1 = limit;
|
|
775
|
+
this.p69_1 = cursor;
|
|
776
|
+
}
|
|
777
|
+
protoOf(ModelReadCommand).q69 = function (operation, resourceId, version, filters, limit, cursor) {
|
|
778
|
+
return new ModelReadCommand(operation, resourceId, version, filters, limit, cursor);
|
|
779
|
+
};
|
|
780
|
+
protoOf(ModelReadCommand).r69 = function (operation, resourceId, version, filters, limit, cursor, $super) {
|
|
781
|
+
operation = operation === VOID ? this.k69_1 : operation;
|
|
782
|
+
resourceId = resourceId === VOID ? this.l69_1 : resourceId;
|
|
783
|
+
version = version === VOID ? this.m69_1 : version;
|
|
784
|
+
filters = filters === VOID ? this.n69_1 : filters;
|
|
785
|
+
limit = limit === VOID ? this.o69_1 : limit;
|
|
786
|
+
cursor = cursor === VOID ? this.p69_1 : cursor;
|
|
787
|
+
return $super === VOID ? this.q69(operation, resourceId, version, filters, limit, cursor) : $super.q69.call(this, operation, resourceId, version, filters, limit, cursor);
|
|
788
|
+
};
|
|
789
|
+
protoOf(ModelReadCommand).toString = function () {
|
|
790
|
+
return 'ModelReadCommand(operation=' + this.k69_1.toString() + ', resourceId=' + this.l69_1 + ', version=' + this.m69_1 + ', filters=' + toString(this.n69_1) + ', limit=' + this.o69_1 + ', cursor=' + this.p69_1 + ')';
|
|
791
|
+
};
|
|
792
|
+
protoOf(ModelReadCommand).hashCode = function () {
|
|
793
|
+
var result = this.k69_1.hashCode();
|
|
794
|
+
result = imul(result, 31) + (this.l69_1 == null ? 0 : getStringHashCode(this.l69_1)) | 0;
|
|
795
|
+
result = imul(result, 31) + (this.m69_1 == null ? 0 : getStringHashCode(this.m69_1)) | 0;
|
|
796
|
+
result = imul(result, 31) + hashCode(this.n69_1) | 0;
|
|
797
|
+
result = imul(result, 31) + (this.o69_1 == null ? 0 : this.o69_1) | 0;
|
|
798
|
+
result = imul(result, 31) + (this.p69_1 == null ? 0 : getStringHashCode(this.p69_1)) | 0;
|
|
799
|
+
return result;
|
|
800
|
+
};
|
|
801
|
+
protoOf(ModelReadCommand).equals = function (other) {
|
|
802
|
+
if (this === other)
|
|
803
|
+
return true;
|
|
804
|
+
if (!(other instanceof ModelReadCommand))
|
|
805
|
+
return false;
|
|
806
|
+
if (!this.k69_1.equals(other.k69_1))
|
|
807
|
+
return false;
|
|
808
|
+
if (!(this.l69_1 == other.l69_1))
|
|
809
|
+
return false;
|
|
810
|
+
if (!(this.m69_1 == other.m69_1))
|
|
811
|
+
return false;
|
|
812
|
+
if (!equals(this.n69_1, other.n69_1))
|
|
813
|
+
return false;
|
|
814
|
+
if (!(this.o69_1 == other.o69_1))
|
|
815
|
+
return false;
|
|
816
|
+
if (!(this.p69_1 == other.p69_1))
|
|
817
|
+
return false;
|
|
818
|
+
return true;
|
|
819
|
+
};
|
|
820
|
+
var ModelReadOperation_CONTEXT_instance;
|
|
821
|
+
var ModelReadOperation_VERSIONS_instance;
|
|
822
|
+
var ModelReadOperation_VERSION_instance;
|
|
823
|
+
var ModelReadOperation_CHANGES_instance;
|
|
824
|
+
var ModelReadOperation_TENANTS_instance;
|
|
825
|
+
var ModelReadOperation_TOKENS_instance;
|
|
826
|
+
var ModelReadOperation_TOKEN_instance;
|
|
827
|
+
var ModelReadOperation_TOKEN_VALUES_instance;
|
|
828
|
+
var ModelReadOperation_TOKEN_GROUPS_instance;
|
|
829
|
+
var ModelReadOperation_PALETTE_instance;
|
|
830
|
+
var ModelReadOperation_COMPONENTS_instance;
|
|
831
|
+
var ModelReadOperation_COMPONENT_instance;
|
|
832
|
+
var ModelReadOperation_COMPONENT_STYLES_instance;
|
|
833
|
+
var ModelReadOperation_APPEARANCE_VARIATIONS_instance;
|
|
834
|
+
var ModelReadOperation_COMPONENT_PROPERTIES_instance;
|
|
835
|
+
var ModelReadOperation_COMPONENT_DEPENDENCIES_instance;
|
|
836
|
+
var ModelReadOperation_entriesInitialized;
|
|
837
|
+
function ModelReadOperation_initEntries() {
|
|
838
|
+
if (ModelReadOperation_entriesInitialized)
|
|
839
|
+
return Unit_instance;
|
|
840
|
+
ModelReadOperation_entriesInitialized = true;
|
|
841
|
+
ModelReadOperation_CONTEXT_instance = new ModelReadOperation('CONTEXT', 0);
|
|
842
|
+
ModelReadOperation_VERSIONS_instance = new ModelReadOperation('VERSIONS', 1);
|
|
843
|
+
ModelReadOperation_VERSION_instance = new ModelReadOperation('VERSION', 2);
|
|
844
|
+
ModelReadOperation_CHANGES_instance = new ModelReadOperation('CHANGES', 3);
|
|
845
|
+
ModelReadOperation_TENANTS_instance = new ModelReadOperation('TENANTS', 4);
|
|
846
|
+
ModelReadOperation_TOKENS_instance = new ModelReadOperation('TOKENS', 5);
|
|
847
|
+
ModelReadOperation_TOKEN_instance = new ModelReadOperation('TOKEN', 6);
|
|
848
|
+
ModelReadOperation_TOKEN_VALUES_instance = new ModelReadOperation('TOKEN_VALUES', 7);
|
|
849
|
+
ModelReadOperation_TOKEN_GROUPS_instance = new ModelReadOperation('TOKEN_GROUPS', 8);
|
|
850
|
+
ModelReadOperation_PALETTE_instance = new ModelReadOperation('PALETTE', 9);
|
|
851
|
+
ModelReadOperation_COMPONENTS_instance = new ModelReadOperation('COMPONENTS', 10);
|
|
852
|
+
ModelReadOperation_COMPONENT_instance = new ModelReadOperation('COMPONENT', 11);
|
|
853
|
+
ModelReadOperation_COMPONENT_STYLES_instance = new ModelReadOperation('COMPONENT_STYLES', 12);
|
|
854
|
+
ModelReadOperation_APPEARANCE_VARIATIONS_instance = new ModelReadOperation('APPEARANCE_VARIATIONS', 13);
|
|
855
|
+
ModelReadOperation_COMPONENT_PROPERTIES_instance = new ModelReadOperation('COMPONENT_PROPERTIES', 14);
|
|
856
|
+
ModelReadOperation_COMPONENT_DEPENDENCIES_instance = new ModelReadOperation('COMPONENT_DEPENDENCIES', 15);
|
|
857
|
+
}
|
|
858
|
+
function ModelReadOperation(name, ordinal) {
|
|
859
|
+
Enum.call(this, name, ordinal);
|
|
860
|
+
}
|
|
861
|
+
function ModelReadOperation_CONTEXT_getInstance() {
|
|
862
|
+
ModelReadOperation_initEntries();
|
|
863
|
+
return ModelReadOperation_CONTEXT_instance;
|
|
864
|
+
}
|
|
865
|
+
function ModelReadOperation_VERSIONS_getInstance() {
|
|
866
|
+
ModelReadOperation_initEntries();
|
|
867
|
+
return ModelReadOperation_VERSIONS_instance;
|
|
868
|
+
}
|
|
869
|
+
function ModelReadOperation_VERSION_getInstance() {
|
|
870
|
+
ModelReadOperation_initEntries();
|
|
871
|
+
return ModelReadOperation_VERSION_instance;
|
|
872
|
+
}
|
|
873
|
+
function ModelReadOperation_CHANGES_getInstance() {
|
|
874
|
+
ModelReadOperation_initEntries();
|
|
875
|
+
return ModelReadOperation_CHANGES_instance;
|
|
876
|
+
}
|
|
877
|
+
function ModelReadOperation_TENANTS_getInstance() {
|
|
878
|
+
ModelReadOperation_initEntries();
|
|
879
|
+
return ModelReadOperation_TENANTS_instance;
|
|
880
|
+
}
|
|
881
|
+
function ModelReadOperation_TOKENS_getInstance() {
|
|
882
|
+
ModelReadOperation_initEntries();
|
|
883
|
+
return ModelReadOperation_TOKENS_instance;
|
|
884
|
+
}
|
|
885
|
+
function ModelReadOperation_TOKEN_getInstance() {
|
|
886
|
+
ModelReadOperation_initEntries();
|
|
887
|
+
return ModelReadOperation_TOKEN_instance;
|
|
888
|
+
}
|
|
889
|
+
function ModelReadOperation_TOKEN_VALUES_getInstance() {
|
|
890
|
+
ModelReadOperation_initEntries();
|
|
891
|
+
return ModelReadOperation_TOKEN_VALUES_instance;
|
|
892
|
+
}
|
|
893
|
+
function ModelReadOperation_TOKEN_GROUPS_getInstance() {
|
|
894
|
+
ModelReadOperation_initEntries();
|
|
895
|
+
return ModelReadOperation_TOKEN_GROUPS_instance;
|
|
896
|
+
}
|
|
897
|
+
function ModelReadOperation_PALETTE_getInstance() {
|
|
898
|
+
ModelReadOperation_initEntries();
|
|
899
|
+
return ModelReadOperation_PALETTE_instance;
|
|
900
|
+
}
|
|
901
|
+
function ModelReadOperation_COMPONENTS_getInstance() {
|
|
902
|
+
ModelReadOperation_initEntries();
|
|
903
|
+
return ModelReadOperation_COMPONENTS_instance;
|
|
904
|
+
}
|
|
905
|
+
function ModelReadOperation_COMPONENT_getInstance() {
|
|
906
|
+
ModelReadOperation_initEntries();
|
|
907
|
+
return ModelReadOperation_COMPONENT_instance;
|
|
908
|
+
}
|
|
909
|
+
function ModelReadOperation_COMPONENT_STYLES_getInstance() {
|
|
910
|
+
ModelReadOperation_initEntries();
|
|
911
|
+
return ModelReadOperation_COMPONENT_STYLES_instance;
|
|
912
|
+
}
|
|
913
|
+
function ModelReadOperation_APPEARANCE_VARIATIONS_getInstance() {
|
|
914
|
+
ModelReadOperation_initEntries();
|
|
915
|
+
return ModelReadOperation_APPEARANCE_VARIATIONS_instance;
|
|
916
|
+
}
|
|
917
|
+
function ModelReadOperation_COMPONENT_PROPERTIES_getInstance() {
|
|
918
|
+
ModelReadOperation_initEntries();
|
|
919
|
+
return ModelReadOperation_COMPONENT_PROPERTIES_instance;
|
|
920
|
+
}
|
|
921
|
+
function ModelReadOperation_COMPONENT_DEPENDENCIES_getInstance() {
|
|
922
|
+
ModelReadOperation_initEntries();
|
|
923
|
+
return ModelReadOperation_COMPONENT_DEPENDENCIES_instance;
|
|
924
|
+
}
|
|
925
|
+
function Success_1(value) {
|
|
926
|
+
this.g68_1 = value;
|
|
927
|
+
}
|
|
928
|
+
protoOf(Success_1).toString = function () {
|
|
929
|
+
return 'Success(value=' + toString(this.g68_1) + ')';
|
|
930
|
+
};
|
|
931
|
+
protoOf(Success_1).hashCode = function () {
|
|
932
|
+
return hashCode(this.g68_1);
|
|
933
|
+
};
|
|
934
|
+
protoOf(Success_1).equals = function (other) {
|
|
935
|
+
if (this === other)
|
|
936
|
+
return true;
|
|
937
|
+
if (!(other instanceof Success_1))
|
|
938
|
+
return false;
|
|
939
|
+
if (!equals(this.g68_1, other.g68_1))
|
|
940
|
+
return false;
|
|
941
|
+
return true;
|
|
942
|
+
};
|
|
943
|
+
function Failed_2(code, message) {
|
|
944
|
+
this.s69_1 = code;
|
|
945
|
+
this.t69_1 = message;
|
|
946
|
+
}
|
|
947
|
+
protoOf(Failed_2).toString = function () {
|
|
948
|
+
return 'Failed(code=' + this.s69_1 + ', message=' + this.t69_1 + ')';
|
|
949
|
+
};
|
|
950
|
+
protoOf(Failed_2).hashCode = function () {
|
|
951
|
+
var result = getStringHashCode(this.s69_1);
|
|
952
|
+
result = imul(result, 31) + getStringHashCode(this.t69_1) | 0;
|
|
953
|
+
return result;
|
|
954
|
+
};
|
|
955
|
+
protoOf(Failed_2).equals = function (other) {
|
|
956
|
+
if (this === other)
|
|
957
|
+
return true;
|
|
958
|
+
if (!(other instanceof Failed_2))
|
|
959
|
+
return false;
|
|
960
|
+
if (!(this.s69_1 === other.s69_1))
|
|
961
|
+
return false;
|
|
962
|
+
if (!(this.t69_1 === other.t69_1))
|
|
963
|
+
return false;
|
|
964
|
+
return true;
|
|
965
|
+
};
|
|
966
|
+
function readResolved($this, command, runtime, $completion) {
|
|
967
|
+
var tmp = new $readResolvedCOROUTINE$($this, command, runtime, $completion);
|
|
968
|
+
tmp.y8_1 = Unit_instance;
|
|
969
|
+
tmp.z8_1 = null;
|
|
970
|
+
return tmp.e9();
|
|
971
|
+
}
|
|
972
|
+
function contextResult($this, runtime, result) {
|
|
973
|
+
var tmp = result.g68_1;
|
|
974
|
+
var tmp0_elvis_lhs = tmp instanceof JsonObject ? tmp : null;
|
|
975
|
+
var tmp_0;
|
|
976
|
+
if (tmp0_elvis_lhs == null) {
|
|
977
|
+
return new Failed_2('BACKEND_UNAVAILABLE', 'Invalid context response.');
|
|
978
|
+
} else {
|
|
979
|
+
tmp_0 = tmp0_elvis_lhs;
|
|
980
|
+
}
|
|
981
|
+
var payload = tmp_0;
|
|
982
|
+
var tmp_1 = payload.xd('context');
|
|
983
|
+
var tmp1_elvis_lhs = tmp_1 instanceof JsonObject ? tmp_1 : null;
|
|
984
|
+
var tmp_2;
|
|
985
|
+
if (tmp1_elvis_lhs == null) {
|
|
986
|
+
return new Failed_2('BACKEND_UNAVAILABLE', 'Invalid context metadata.');
|
|
987
|
+
} else {
|
|
988
|
+
tmp_2 = tmp1_elvis_lhs;
|
|
989
|
+
}
|
|
990
|
+
var actual = tmp_2;
|
|
991
|
+
// Inline function 'kotlin.takeIf' call
|
|
992
|
+
var this_0 = runtime.b5s_1.a5p_1;
|
|
993
|
+
var tmp_3;
|
|
994
|
+
// Inline function 'kotlin.text.isNotEmpty' call
|
|
995
|
+
if (charSequenceLength(this_0) > 0) {
|
|
996
|
+
tmp_3 = this_0;
|
|
997
|
+
} else {
|
|
998
|
+
tmp_3 = null;
|
|
999
|
+
}
|
|
1000
|
+
var tmp2_safe_receiver = tmp_3;
|
|
1001
|
+
var tmp_4;
|
|
1002
|
+
if (tmp2_safe_receiver == null) {
|
|
1003
|
+
tmp_4 = null;
|
|
1004
|
+
} else {
|
|
1005
|
+
// Inline function 'kotlin.let' call
|
|
1006
|
+
tmp_4 = JsonPrimitive_0(tmp2_safe_receiver);
|
|
1007
|
+
}
|
|
1008
|
+
var tmp3_elvis_lhs = tmp_4;
|
|
1009
|
+
var configPath = tmp3_elvis_lhs == null ? JsonNull_getInstance() : tmp3_elvis_lhs;
|
|
1010
|
+
var tmp4_safe_receiver = singleOrNull(runtime.b5s_1.b5p_1);
|
|
1011
|
+
var tmp5_safe_receiver = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.m5p_1;
|
|
1012
|
+
var tmp_5;
|
|
1013
|
+
if (tmp5_safe_receiver == null) {
|
|
1014
|
+
tmp_5 = null;
|
|
1015
|
+
} else {
|
|
1016
|
+
// Inline function 'kotlin.let' call
|
|
1017
|
+
tmp_5 = JsonPrimitive_0(tmp5_safe_receiver);
|
|
1018
|
+
}
|
|
1019
|
+
var tmp6_elvis_lhs = tmp_5;
|
|
1020
|
+
var platform = tmp6_elvis_lhs == null ? JsonNull_getInstance() : tmp6_elvis_lhs;
|
|
1021
|
+
var tmp_6 = to('projectId', JsonPrimitive_0(_ProjectId___get_value__impl__lfubnr(runtime.b5s_1.x5o_1)));
|
|
1022
|
+
var tmp_7 = to('designSystemId', getValue(actual, 'designSystemId'));
|
|
1023
|
+
var tmp_8 = to('version', getValue(actual, 'version'));
|
|
1024
|
+
var tmp_9 = to('configPath', configPath);
|
|
1025
|
+
var tmp_10 = to('apiUrl', JsonPrimitive_0(_ProjectApiUrl___get_value__impl__ub99up(runtime.c5s_1)));
|
|
1026
|
+
var tmp7_subject = runtime.d5s_1;
|
|
1027
|
+
var tmp_11;
|
|
1028
|
+
if (tmp7_subject instanceof PersonalAccessToken) {
|
|
1029
|
+
tmp_11 = 'PERSONAL_ACCESS_TOKEN';
|
|
1030
|
+
} else {
|
|
1031
|
+
if (tmp7_subject instanceof Bearer) {
|
|
1032
|
+
tmp_11 = 'USER_SESSION';
|
|
1033
|
+
} else {
|
|
1034
|
+
if (tmp7_subject instanceof ServiceToken) {
|
|
1035
|
+
tmp_11 = 'SERVICE_TOKEN';
|
|
1036
|
+
} else {
|
|
1037
|
+
noWhenBranchMatchedException();
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
var tmp_12 = to('credentialType', JsonPrimitive_0(tmp_11));
|
|
1042
|
+
// Inline function 'kotlin.text.lowercase' call
|
|
1043
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
1044
|
+
var tmp$ret$8 = runtime.b5s_1.d5p_1.n2_1.toLowerCase();
|
|
1045
|
+
return new Success_1(new JsonObject(plus_0(payload, mapOf([tmp_6, tmp_7, tmp_8, tmp_9, tmp_10, tmp_12, to('provenance', JsonPrimitive_0(replace(tmp$ret$8, _Char___init__impl__6a9atx(95), _Char___init__impl__6a9atx(45)))), to('platform', platform)]))));
|
|
1046
|
+
}
|
|
1047
|
+
function Companion_0() {
|
|
1048
|
+
Companion_instance_1 = this;
|
|
1049
|
+
this.f6a_1 = Regex_init_$Create$('(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)');
|
|
1050
|
+
}
|
|
1051
|
+
var Companion_instance_1;
|
|
1052
|
+
function Companion_getInstance_1() {
|
|
1053
|
+
if (Companion_instance_1 == null)
|
|
1054
|
+
new Companion_0();
|
|
1055
|
+
return Companion_instance_1;
|
|
1056
|
+
}
|
|
1057
|
+
function $executeCOROUTINE$_1(_this__u8e3s4, command, request, resultContinuation) {
|
|
1058
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
1059
|
+
this.o6a_1 = _this__u8e3s4;
|
|
1060
|
+
this.p6a_1 = command;
|
|
1061
|
+
this.q6a_1 = request;
|
|
1062
|
+
}
|
|
1063
|
+
protoOf($executeCOROUTINE$_1).e9 = function () {
|
|
1064
|
+
var suspendResult = this.y8_1;
|
|
1065
|
+
$sm: do
|
|
1066
|
+
try {
|
|
1067
|
+
var tmp = this.w8_1;
|
|
1068
|
+
switch (tmp) {
|
|
1069
|
+
case 0:
|
|
1070
|
+
this.x8_1 = 4;
|
|
1071
|
+
var tmp_0;
|
|
1072
|
+
if (!(this.p6a_1.o69_1 == null)) {
|
|
1073
|
+
var containsArg = this.p6a_1.o69_1;
|
|
1074
|
+
tmp_0 = !(1 <= containsArg ? containsArg <= 200 : false);
|
|
1075
|
+
} else {
|
|
1076
|
+
tmp_0 = false;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
var invalidLimit = tmp_0;
|
|
1080
|
+
var conflictingNames = !(this.p6a_1.n69_1.c2('name') == null) && !(this.p6a_1.n69_1.c2('query') == null);
|
|
1081
|
+
if (invalidLimit || conflictingNames) {
|
|
1082
|
+
return new Failed_2('INVALID_QUERY', 'Invalid model read parameters.');
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
this.w8_1 = 1;
|
|
1086
|
+
suspendResult = this.o6a_1.s6a_1.a5s(this.q6a_1, this);
|
|
1087
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1088
|
+
return suspendResult;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
continue $sm;
|
|
1092
|
+
case 1:
|
|
1093
|
+
var runtime = suspendResult;
|
|
1094
|
+
if (runtime instanceof Failed_0) {
|
|
1095
|
+
this.r6a_1 = new Failed_2(runtime.e5s_1.n2_1, runtime.f5s_1);
|
|
1096
|
+
this.w8_1 = 3;
|
|
1097
|
+
continue $sm;
|
|
1098
|
+
} else {
|
|
1099
|
+
if (runtime instanceof Resolved) {
|
|
1100
|
+
this.w8_1 = 2;
|
|
1101
|
+
suspendResult = readResolved(this.o6a_1, this.p6a_1, runtime, this);
|
|
1102
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1103
|
+
return suspendResult;
|
|
1104
|
+
}
|
|
1105
|
+
continue $sm;
|
|
1106
|
+
} else {
|
|
1107
|
+
var tmp_1 = this;
|
|
1108
|
+
noWhenBranchMatchedException();
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
break;
|
|
1113
|
+
case 2:
|
|
1114
|
+
this.r6a_1 = suspendResult;
|
|
1115
|
+
this.w8_1 = 3;
|
|
1116
|
+
continue $sm;
|
|
1117
|
+
case 3:
|
|
1118
|
+
return this.r6a_1;
|
|
1119
|
+
case 4:
|
|
1120
|
+
throw this.z8_1;
|
|
1121
|
+
}
|
|
1122
|
+
} catch ($p) {
|
|
1123
|
+
var e = $p;
|
|
1124
|
+
if (this.x8_1 === 4) {
|
|
1125
|
+
throw e;
|
|
1126
|
+
} else {
|
|
1127
|
+
this.w8_1 = this.x8_1;
|
|
1128
|
+
this.z8_1 = e;
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
while (true);
|
|
1132
|
+
};
|
|
1133
|
+
function $readResolvedCOROUTINE$(_this__u8e3s4, command, runtime, resultContinuation) {
|
|
1134
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
1135
|
+
this.c6a_1 = _this__u8e3s4;
|
|
1136
|
+
this.d6a_1 = command;
|
|
1137
|
+
this.e6a_1 = runtime;
|
|
1138
|
+
}
|
|
1139
|
+
protoOf($readResolvedCOROUTINE$).e9 = function () {
|
|
1140
|
+
var suspendResult = this.y8_1;
|
|
1141
|
+
$sm: do
|
|
1142
|
+
try {
|
|
1143
|
+
var tmp = this.w8_1;
|
|
1144
|
+
switch (tmp) {
|
|
1145
|
+
case 0:
|
|
1146
|
+
this.x8_1 = 2;
|
|
1147
|
+
var tmp_0;
|
|
1148
|
+
switch (this.d6a_1.k69_1.o2_1) {
|
|
1149
|
+
case 11:
|
|
1150
|
+
case 1:
|
|
1151
|
+
tmp_0 = this.d6a_1.m69_1;
|
|
1152
|
+
break;
|
|
1153
|
+
default:
|
|
1154
|
+
var tmp1_elvis_lhs = this.d6a_1.m69_1;
|
|
1155
|
+
var tmp2_elvis_lhs = tmp1_elvis_lhs == null ? this.e6a_1.b5s_1.e5p_1 : tmp1_elvis_lhs;
|
|
1156
|
+
tmp_0 = tmp2_elvis_lhs == null ? 'draft' : tmp2_elvis_lhs;
|
|
1157
|
+
break;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
var version = tmp_0;
|
|
1161
|
+
if (!(version == null) && !(version === 'draft') && !Companion_getInstance_1().f6a_1.ld(version)) {
|
|
1162
|
+
return new Failed_2('INVALID_QUERY', 'An exact model version or draft is required.');
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
this.w8_1 = 1;
|
|
1166
|
+
suspendResult = this.c6a_1.t6a_1.u6a(new ModelReadRuntime(this.e6a_1.b5s_1, _ProjectApiUrl___get_value__impl__ub99up(this.e6a_1.c5s_1), this.e6a_1.d5s_1), this.d6a_1.r69(VOID, VOID, version), this);
|
|
1167
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1168
|
+
return suspendResult;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
continue $sm;
|
|
1172
|
+
case 1:
|
|
1173
|
+
var result = suspendResult;
|
|
1174
|
+
var tmp_1;
|
|
1175
|
+
var tmp_2;
|
|
1176
|
+
if (this.d6a_1.k69_1.equals(ModelReadOperation_CONTEXT_getInstance())) {
|
|
1177
|
+
tmp_2 = result instanceof Success_1;
|
|
1178
|
+
} else {
|
|
1179
|
+
tmp_2 = false;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
if (tmp_2) {
|
|
1183
|
+
tmp_1 = contextResult(this.c6a_1, this.e6a_1, result);
|
|
1184
|
+
} else {
|
|
1185
|
+
tmp_1 = result;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
return tmp_1;
|
|
1189
|
+
case 2:
|
|
1190
|
+
throw this.z8_1;
|
|
1191
|
+
}
|
|
1192
|
+
} catch ($p) {
|
|
1193
|
+
var e = $p;
|
|
1194
|
+
if (this.x8_1 === 2) {
|
|
1195
|
+
throw e;
|
|
1196
|
+
} else {
|
|
1197
|
+
this.w8_1 = this.x8_1;
|
|
1198
|
+
this.z8_1 = e;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
while (true);
|
|
1202
|
+
};
|
|
1203
|
+
function ReadDesignSystemModelUseCase(runtimeResolver, remote) {
|
|
1204
|
+
Companion_getInstance_1();
|
|
1205
|
+
this.s6a_1 = runtimeResolver;
|
|
1206
|
+
this.t6a_1 = remote;
|
|
1207
|
+
}
|
|
1208
|
+
protoOf(ReadDesignSystemModelUseCase).v6a = function (command, request, $completion) {
|
|
1209
|
+
var tmp = new $executeCOROUTINE$_1(this, command, request, $completion);
|
|
1210
|
+
tmp.y8_1 = Unit_instance;
|
|
1211
|
+
tmp.z8_1 = null;
|
|
1212
|
+
return tmp.e9();
|
|
1213
|
+
};
|
|
1214
|
+
function ModelReadRemoteSource() {
|
|
1215
|
+
}
|
|
1216
|
+
function ModelReadRuntime(context, apiUrl, credential) {
|
|
1217
|
+
this.w6a_1 = context;
|
|
1218
|
+
this.x6a_1 = apiUrl;
|
|
1219
|
+
this.y6a_1 = credential;
|
|
1220
|
+
}
|
|
1221
|
+
protoOf(ModelReadRuntime).toString = function () {
|
|
1222
|
+
return 'ModelReadRuntime(context=' + this.w6a_1.toString() + ', apiUrl=' + this.x6a_1 + ', credential=' + toString(this.y6a_1) + ')';
|
|
1223
|
+
};
|
|
1224
|
+
protoOf(ModelReadRuntime).hashCode = function () {
|
|
1225
|
+
var result = this.w6a_1.hashCode();
|
|
1226
|
+
result = imul(result, 31) + getStringHashCode(this.x6a_1) | 0;
|
|
1227
|
+
result = imul(result, 31) + hashCode(this.y6a_1) | 0;
|
|
1228
|
+
return result;
|
|
1229
|
+
};
|
|
1230
|
+
protoOf(ModelReadRuntime).equals = function (other) {
|
|
1231
|
+
if (this === other)
|
|
1232
|
+
return true;
|
|
1233
|
+
if (!(other instanceof ModelReadRuntime))
|
|
1234
|
+
return false;
|
|
1235
|
+
if (!this.w6a_1.equals(other.w6a_1))
|
|
1236
|
+
return false;
|
|
1237
|
+
if (!(this.x6a_1 === other.x6a_1))
|
|
1238
|
+
return false;
|
|
1239
|
+
if (!equals(this.y6a_1, other.y6a_1))
|
|
1240
|
+
return false;
|
|
1241
|
+
return true;
|
|
1242
|
+
};
|
|
1243
|
+
function $readCOROUTINE$(_this__u8e3s4, apiUrl, credential, command, resultContinuation) {
|
|
1244
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
1245
|
+
this.h6b_1 = _this__u8e3s4;
|
|
1246
|
+
this.i6b_1 = apiUrl;
|
|
1247
|
+
this.j6b_1 = credential;
|
|
1248
|
+
this.k6b_1 = command;
|
|
1249
|
+
}
|
|
1250
|
+
protoOf($readCOROUTINE$).e9 = function () {
|
|
1251
|
+
var suspendResult = this.y8_1;
|
|
1252
|
+
$sm: do
|
|
1253
|
+
try {
|
|
1254
|
+
var tmp = this.w8_1;
|
|
1255
|
+
switch (tmp) {
|
|
1256
|
+
case 0:
|
|
1257
|
+
this.x8_1 = 2;
|
|
1258
|
+
this.m6b_1 = new ModelReadCommand(ModelReadOperation_VERSIONS_getInstance(), VOID, VOID, VOID, this.k6b_1.j68_1, this.k6b_1.k68_1);
|
|
1259
|
+
this.l6b_1 = Companion_getInstance_2().o6b(this.k6b_1.h68_1, this.k6b_1.i68_1, this.m6b_1);
|
|
1260
|
+
this.w8_1 = 1;
|
|
1261
|
+
suspendResult = this.h6b_1.p6b_1.y59(this.i6b_1, this.j6b_1).z59(this.l6b_1.q6b_1, this);
|
|
1262
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1263
|
+
return suspendResult;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
continue $sm;
|
|
1267
|
+
case 1:
|
|
1268
|
+
var response = suspendResult;
|
|
1269
|
+
var tmp_0;
|
|
1270
|
+
if (response instanceof Failure) {
|
|
1271
|
+
tmp_0 = modelReadFailure(response.j5a_1, this.j6b_1);
|
|
1272
|
+
} else {
|
|
1273
|
+
if (response instanceof Success) {
|
|
1274
|
+
tmp_0 = ModelReadResponseDecoder_getInstance().v6b(response, this.m6b_1, this.l6b_1.r6b_1, this.l6b_1.s6b_1);
|
|
1275
|
+
} else {
|
|
1276
|
+
noWhenBranchMatchedException();
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
return tmp_0;
|
|
1281
|
+
case 2:
|
|
1282
|
+
throw this.z8_1;
|
|
1283
|
+
}
|
|
1284
|
+
} catch ($p) {
|
|
1285
|
+
var e = $p;
|
|
1286
|
+
if (this.x8_1 === 2) {
|
|
1287
|
+
throw e;
|
|
1288
|
+
} else {
|
|
1289
|
+
this.w8_1 = this.x8_1;
|
|
1290
|
+
this.z8_1 = e;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
while (true);
|
|
1294
|
+
};
|
|
1295
|
+
function HttpDesignSystemVersionsSource(clients) {
|
|
1296
|
+
this.p6b_1 = clients;
|
|
1297
|
+
}
|
|
1298
|
+
protoOf(HttpDesignSystemVersionsSource).c69 = function (apiUrl, credential, command, $completion) {
|
|
1299
|
+
var tmp = new $readCOROUTINE$(this, apiUrl, credential, command, $completion);
|
|
1300
|
+
tmp.y8_1 = Unit_instance;
|
|
1301
|
+
tmp.z8_1 = null;
|
|
1302
|
+
return tmp.e9();
|
|
1303
|
+
};
|
|
1304
|
+
function get_SYSTEM_BACKEND_FAILURE() {
|
|
1305
|
+
_init_properties_HttpDesignSystemsClient_kt__zi7vxl();
|
|
1306
|
+
return SYSTEM_BACKEND_FAILURE;
|
|
1307
|
+
}
|
|
1308
|
+
var SYSTEM_BACKEND_FAILURE;
|
|
1309
|
+
function get_SYSTEM_HTTP_FAILURES() {
|
|
1310
|
+
_init_properties_HttpDesignSystemsClient_kt__zi7vxl();
|
|
1311
|
+
return SYSTEM_HTTP_FAILURES;
|
|
1312
|
+
}
|
|
1313
|
+
var SYSTEM_HTTP_FAILURES;
|
|
1314
|
+
function decode($this, body) {
|
|
1315
|
+
// Inline function 'kotlin.runCatching' call
|
|
1316
|
+
var tmp;
|
|
1317
|
+
try {
|
|
1318
|
+
var tmp_0 = Default_getInstance().s35(body);
|
|
1319
|
+
var array = tmp_0 instanceof JsonArray ? tmp_0 : THROW_CCE();
|
|
1320
|
+
// Inline function 'kotlin.collections.map' call
|
|
1321
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1322
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(array, 10));
|
|
1323
|
+
var _iterator__ex2g4s = array.l();
|
|
1324
|
+
while (_iterator__ex2g4s.m()) {
|
|
1325
|
+
var item = _iterator__ex2g4s.n();
|
|
1326
|
+
var item_0 = item instanceof JsonObject ? item : THROW_CCE();
|
|
1327
|
+
var tmp0_safe_receiver = item_0.xd('description');
|
|
1328
|
+
var tmp_1;
|
|
1329
|
+
if (tmp0_safe_receiver == null) {
|
|
1330
|
+
tmp_1 = null;
|
|
1331
|
+
} else {
|
|
1332
|
+
// Inline function 'kotlin.takeUnless' call
|
|
1333
|
+
var tmp_2;
|
|
1334
|
+
if (!equals(tmp0_safe_receiver, JsonNull_getInstance())) {
|
|
1335
|
+
tmp_2 = tmp0_safe_receiver;
|
|
1336
|
+
} else {
|
|
1337
|
+
tmp_2 = null;
|
|
1338
|
+
}
|
|
1339
|
+
tmp_1 = tmp_2;
|
|
1340
|
+
}
|
|
1341
|
+
var tmp1_safe_receiver = tmp_1;
|
|
1342
|
+
var tmp_3;
|
|
1343
|
+
if (tmp1_safe_receiver == null) {
|
|
1344
|
+
tmp_3 = null;
|
|
1345
|
+
} else {
|
|
1346
|
+
// Inline function 'kotlin.let' call
|
|
1347
|
+
// Inline function 'kotlin.also' call
|
|
1348
|
+
var this_0 = tmp1_safe_receiver instanceof JsonPrimitive ? tmp1_safe_receiver : THROW_CCE();
|
|
1349
|
+
// Inline function 'kotlin.require' call
|
|
1350
|
+
// Inline function 'kotlin.require' call
|
|
1351
|
+
if (!this_0.c38()) {
|
|
1352
|
+
var message = 'Failed requirement.';
|
|
1353
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1354
|
+
}
|
|
1355
|
+
tmp_3 = this_0.d38();
|
|
1356
|
+
}
|
|
1357
|
+
var description = tmp_3;
|
|
1358
|
+
var tmp$ret$9 = new DesignSystemSummary(decode$_anonymous_$_anonymous_$string_xh8ofp(item_0, 'id'), decode$_anonymous_$_anonymous_$string_xh8ofp(item_0, 'name'), description);
|
|
1359
|
+
destination.j(tmp$ret$9);
|
|
1360
|
+
}
|
|
1361
|
+
// Inline function 'kotlin.Companion.success' call
|
|
1362
|
+
var value = new Success_0(destination);
|
|
1363
|
+
tmp = _Result___init__impl__xyqfz8(value);
|
|
1364
|
+
} catch ($p) {
|
|
1365
|
+
var tmp_4;
|
|
1366
|
+
if ($p instanceof Error) {
|
|
1367
|
+
var e = $p;
|
|
1368
|
+
// Inline function 'kotlin.Companion.failure' call
|
|
1369
|
+
tmp_4 = _Result___init__impl__xyqfz8(createFailure(e));
|
|
1370
|
+
} else {
|
|
1371
|
+
throw $p;
|
|
1372
|
+
}
|
|
1373
|
+
tmp = tmp_4;
|
|
1374
|
+
}
|
|
1375
|
+
// Inline function 'kotlin.getOrElse' call
|
|
1376
|
+
var this_1 = tmp;
|
|
1377
|
+
var exception = Result__exceptionOrNull_impl_p6xea9(this_1);
|
|
1378
|
+
var tmp_5;
|
|
1379
|
+
if (exception == null) {
|
|
1380
|
+
var tmp_6 = _Result___get_value__impl__bjfvqg(this_1);
|
|
1381
|
+
tmp_5 = (tmp_6 == null ? true : !(tmp_6 == null)) ? tmp_6 : THROW_CCE();
|
|
1382
|
+
} else {
|
|
1383
|
+
tmp_5 = new Failed_1(DesignSystemsReadErrorCode_INVALID_BACKEND_RESPONSE_getInstance(), 'Backend returned an invalid design-system list.');
|
|
1384
|
+
}
|
|
1385
|
+
return tmp_5;
|
|
1386
|
+
}
|
|
1387
|
+
function decode$_anonymous_$_anonymous_$string_xh8ofp(item, key) {
|
|
1388
|
+
var tmp = getValue(item, key);
|
|
1389
|
+
// Inline function 'kotlin.also' call
|
|
1390
|
+
var this_0 = tmp instanceof JsonPrimitive ? tmp : THROW_CCE();
|
|
1391
|
+
var tmp_0;
|
|
1392
|
+
if (this_0.c38()) {
|
|
1393
|
+
// Inline function 'kotlin.text.isNotBlank' call
|
|
1394
|
+
var this_1 = this_0.d38();
|
|
1395
|
+
tmp_0 = !isBlank(this_1);
|
|
1396
|
+
} else {
|
|
1397
|
+
tmp_0 = false;
|
|
1398
|
+
}
|
|
1399
|
+
// Inline function 'kotlin.require' call
|
|
1400
|
+
// Inline function 'kotlin.require' call
|
|
1401
|
+
if (!tmp_0) {
|
|
1402
|
+
var message = 'Failed requirement.';
|
|
1403
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1404
|
+
}
|
|
1405
|
+
return this_0.d38();
|
|
1406
|
+
}
|
|
1407
|
+
function $listCOROUTINE$(_this__u8e3s4, apiUrl, credential, projectId, resultContinuation) {
|
|
1408
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
1409
|
+
this.e6c_1 = _this__u8e3s4;
|
|
1410
|
+
this.f6c_1 = apiUrl;
|
|
1411
|
+
this.g6c_1 = credential;
|
|
1412
|
+
this.h6c_1 = projectId;
|
|
1413
|
+
}
|
|
1414
|
+
protoOf($listCOROUTINE$).e9 = function () {
|
|
1415
|
+
var suspendResult = this.y8_1;
|
|
1416
|
+
$sm: do
|
|
1417
|
+
try {
|
|
1418
|
+
var tmp = this.w8_1;
|
|
1419
|
+
switch (tmp) {
|
|
1420
|
+
case 0:
|
|
1421
|
+
this.x8_1 = 2;
|
|
1422
|
+
this.w8_1 = 1;
|
|
1423
|
+
suspendResult = this.e6c_1.i6c_1.y59(this.f6c_1, this.g6c_1).z59('/api/projects/' + encodeModelSegment(this.h6c_1) + '/design-systems', this);
|
|
1424
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1425
|
+
return suspendResult;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
continue $sm;
|
|
1429
|
+
case 1:
|
|
1430
|
+
var response = suspendResult;
|
|
1431
|
+
var tmp_0;
|
|
1432
|
+
if (response instanceof Success) {
|
|
1433
|
+
tmp_0 = decode(this.e6c_1, response.f5a_1);
|
|
1434
|
+
} else {
|
|
1435
|
+
if (response instanceof Failure) {
|
|
1436
|
+
var tmp_1;
|
|
1437
|
+
var tmp_2;
|
|
1438
|
+
if (response.j5a_1 === 401) {
|
|
1439
|
+
var tmp_3 = this.g6c_1;
|
|
1440
|
+
tmp_2 = tmp_3 instanceof PersonalAccessToken;
|
|
1441
|
+
} else {
|
|
1442
|
+
tmp_2 = false;
|
|
1443
|
+
}
|
|
1444
|
+
if (tmp_2) {
|
|
1445
|
+
tmp_1 = new Failed_1(DesignSystemsReadErrorCode_PAT_INVALID_getInstance(), 'PAT is invalid or expired.');
|
|
1446
|
+
} else {
|
|
1447
|
+
var tmp0 = get_SYSTEM_HTTP_FAILURES();
|
|
1448
|
+
var key = response.j5a_1;
|
|
1449
|
+
var tmp0_elvis_lhs = (isInterface(tmp0, KtMap) ? tmp0 : THROW_CCE()).c2(key);
|
|
1450
|
+
tmp_1 = tmp0_elvis_lhs == null ? get_SYSTEM_BACKEND_FAILURE() : tmp0_elvis_lhs;
|
|
1451
|
+
}
|
|
1452
|
+
tmp_0 = tmp_1;
|
|
1453
|
+
} else {
|
|
1454
|
+
noWhenBranchMatchedException();
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
return tmp_0;
|
|
1459
|
+
case 2:
|
|
1460
|
+
throw this.z8_1;
|
|
1461
|
+
}
|
|
1462
|
+
} catch ($p) {
|
|
1463
|
+
var e = $p;
|
|
1464
|
+
if (this.x8_1 === 2) {
|
|
1465
|
+
throw e;
|
|
1466
|
+
} else {
|
|
1467
|
+
this.w8_1 = this.x8_1;
|
|
1468
|
+
this.z8_1 = e;
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
while (true);
|
|
1472
|
+
};
|
|
1473
|
+
function HttpDesignSystemsClient(clients) {
|
|
1474
|
+
this.i6c_1 = clients;
|
|
1475
|
+
}
|
|
1476
|
+
protoOf(HttpDesignSystemsClient).d68 = function (apiUrl, credential, projectId, $completion) {
|
|
1477
|
+
var tmp = new $listCOROUTINE$(this, apiUrl, credential, projectId, $completion);
|
|
1478
|
+
tmp.y8_1 = Unit_instance;
|
|
1479
|
+
tmp.z8_1 = null;
|
|
1480
|
+
return tmp.e9();
|
|
1481
|
+
};
|
|
1482
|
+
var properties_initialized_HttpDesignSystemsClient_kt_qqnza1;
|
|
1483
|
+
function _init_properties_HttpDesignSystemsClient_kt__zi7vxl() {
|
|
1484
|
+
if (!properties_initialized_HttpDesignSystemsClient_kt_qqnza1) {
|
|
1485
|
+
properties_initialized_HttpDesignSystemsClient_kt_qqnza1 = true;
|
|
1486
|
+
SYSTEM_BACKEND_FAILURE = new Failed_1(DesignSystemsReadErrorCode_BACKEND_UNAVAILABLE_getInstance(), 'Cannot read design systems.');
|
|
1487
|
+
SYSTEM_HTTP_FAILURES = mapOf([to(401, new Failed_1(DesignSystemsReadErrorCode_AUTH_REQUIRED_getInstance(), 'Run dsbuilder auth login and retry.')), to(403, new Failed_1(DesignSystemsReadErrorCode_FORBIDDEN_getInstance(), 'Cannot read design systems.')), to(404, new Failed_1(DesignSystemsReadErrorCode_NOT_FOUND_getInstance(), 'Cannot read design systems.'))]);
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
function $readCOROUTINE$_0(_this__u8e3s4, runtime, command, resultContinuation) {
|
|
1491
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
1492
|
+
this.r6c_1 = _this__u8e3s4;
|
|
1493
|
+
this.s6c_1 = runtime;
|
|
1494
|
+
this.t6c_1 = command;
|
|
1495
|
+
}
|
|
1496
|
+
protoOf($readCOROUTINE$_0).e9 = function () {
|
|
1497
|
+
var suspendResult = this.y8_1;
|
|
1498
|
+
$sm: do
|
|
1499
|
+
try {
|
|
1500
|
+
var tmp = this.w8_1;
|
|
1501
|
+
switch (tmp) {
|
|
1502
|
+
case 0:
|
|
1503
|
+
this.x8_1 = 2;
|
|
1504
|
+
this.u6c_1 = Companion_getInstance_2().o6b(_ProjectId___get_value__impl__lfubnr(this.s6c_1.w6a_1.x5o_1), _DesignSystemId___get_value__impl__wgtkjx(this.s6c_1.w6a_1.y5o_1), this.t6c_1);
|
|
1505
|
+
this.w8_1 = 1;
|
|
1506
|
+
suspendResult = this.r6c_1.v6c_1.y59(this.s6c_1.x6a_1, this.s6c_1.y6a_1).z59(this.u6c_1.q6b_1, this);
|
|
1507
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1508
|
+
return suspendResult;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
continue $sm;
|
|
1512
|
+
case 1:
|
|
1513
|
+
var response = suspendResult;
|
|
1514
|
+
var tmp_0;
|
|
1515
|
+
if (response instanceof Failure) {
|
|
1516
|
+
tmp_0 = modelReadFailure(response.j5a_1, this.s6c_1.y6a_1);
|
|
1517
|
+
} else {
|
|
1518
|
+
if (response instanceof Success) {
|
|
1519
|
+
tmp_0 = ModelReadResponseDecoder_getInstance().v6b(response, this.t6c_1, this.u6c_1.r6b_1, this.u6c_1.s6b_1);
|
|
1520
|
+
} else {
|
|
1521
|
+
noWhenBranchMatchedException();
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
return tmp_0;
|
|
1526
|
+
case 2:
|
|
1527
|
+
throw this.z8_1;
|
|
1528
|
+
}
|
|
1529
|
+
} catch ($p) {
|
|
1530
|
+
var e = $p;
|
|
1531
|
+
if (this.x8_1 === 2) {
|
|
1532
|
+
throw e;
|
|
1533
|
+
} else {
|
|
1534
|
+
this.w8_1 = this.x8_1;
|
|
1535
|
+
this.z8_1 = e;
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
while (true);
|
|
1539
|
+
};
|
|
1540
|
+
function HttpModelReadRemoteSource(clients) {
|
|
1541
|
+
this.v6c_1 = clients;
|
|
1542
|
+
}
|
|
1543
|
+
protoOf(HttpModelReadRemoteSource).u6a = function (runtime, command, $completion) {
|
|
1544
|
+
var tmp = new $readCOROUTINE$_0(this, runtime, command, $completion);
|
|
1545
|
+
tmp.y8_1 = Unit_instance;
|
|
1546
|
+
tmp.z8_1 = null;
|
|
1547
|
+
return tmp.e9();
|
|
1548
|
+
};
|
|
1549
|
+
function modelReadFailure(status, credential) {
|
|
1550
|
+
var tmp;
|
|
1551
|
+
switch (status) {
|
|
1552
|
+
case 400:
|
|
1553
|
+
tmp = 'INVALID_QUERY';
|
|
1554
|
+
break;
|
|
1555
|
+
case 401:
|
|
1556
|
+
var tmp_0;
|
|
1557
|
+
if (credential instanceof PersonalAccessToken) {
|
|
1558
|
+
tmp_0 = 'PAT_INVALID';
|
|
1559
|
+
} else {
|
|
1560
|
+
tmp_0 = 'AUTH_REQUIRED';
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
tmp = tmp_0;
|
|
1564
|
+
break;
|
|
1565
|
+
case 403:
|
|
1566
|
+
tmp = 'FORBIDDEN';
|
|
1567
|
+
break;
|
|
1568
|
+
case 404:
|
|
1569
|
+
tmp = 'NOT_FOUND';
|
|
1570
|
+
break;
|
|
1571
|
+
default:
|
|
1572
|
+
tmp = 'BACKEND_UNAVAILABLE';
|
|
1573
|
+
break;
|
|
1574
|
+
}
|
|
1575
|
+
var tmp_1 = tmp;
|
|
1576
|
+
var tmp_2;
|
|
1577
|
+
var tmp_3;
|
|
1578
|
+
if (status === 401) {
|
|
1579
|
+
tmp_3 = credential instanceof PersonalAccessToken;
|
|
1580
|
+
} else {
|
|
1581
|
+
tmp_3 = false;
|
|
1582
|
+
}
|
|
1583
|
+
if (tmp_3) {
|
|
1584
|
+
tmp_2 = 'PAT is invalid or expired (HTTP 401).';
|
|
1585
|
+
} else {
|
|
1586
|
+
if (status === 401) {
|
|
1587
|
+
tmp_2 = 'Authentication required (HTTP 401). Run dsbuilder auth login and retry.';
|
|
1588
|
+
} else {
|
|
1589
|
+
var tmp_4;
|
|
1590
|
+
if (status == null) {
|
|
1591
|
+
tmp_4 = null;
|
|
1592
|
+
} else {
|
|
1593
|
+
// Inline function 'kotlin.let' call
|
|
1594
|
+
tmp_4 = ' (HTTP ' + status + ')';
|
|
1595
|
+
}
|
|
1596
|
+
// Inline function 'kotlin.text.orEmpty' call
|
|
1597
|
+
var tmp0_elvis_lhs = tmp_4;
|
|
1598
|
+
tmp_2 = 'Model read failed' + (tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs) + '.';
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
return new Failed_2(tmp_1, tmp_2);
|
|
1602
|
+
}
|
|
1603
|
+
function boundaryContext($this, value) {
|
|
1604
|
+
var tmp = value.xd('version');
|
|
1605
|
+
var version = tmp instanceof JsonPrimitive ? tmp : THROW_CCE();
|
|
1606
|
+
// Inline function 'kotlin.require' call
|
|
1607
|
+
// Inline function 'kotlin.require' call
|
|
1608
|
+
if (!version.c38()) {
|
|
1609
|
+
var message = 'Failed requirement.';
|
|
1610
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1611
|
+
}
|
|
1612
|
+
var tmp_0;
|
|
1613
|
+
if (version.d38() === 'draft') {
|
|
1614
|
+
var tmp_1 = value.xd('draftRevision');
|
|
1615
|
+
var revision = tmp_1 instanceof JsonPrimitive ? tmp_1 : THROW_CCE();
|
|
1616
|
+
// Inline function 'kotlin.require' call
|
|
1617
|
+
// Inline function 'kotlin.require' call
|
|
1618
|
+
if (!!revision.c38()) {
|
|
1619
|
+
var message_0 = 'Failed requirement.';
|
|
1620
|
+
throw IllegalArgumentException_init_$Create$(toString(message_0));
|
|
1621
|
+
}
|
|
1622
|
+
var tmp0_safe_receiver = get_longOrNull(revision);
|
|
1623
|
+
var tmp_2;
|
|
1624
|
+
if (tmp0_safe_receiver == null) {
|
|
1625
|
+
tmp_2 = null;
|
|
1626
|
+
} else {
|
|
1627
|
+
// Inline function 'kotlin.let' call
|
|
1628
|
+
tmp_2 = compare(new Long(0, 0), tmp0_safe_receiver) <= 0 ? compare(tmp0_safe_receiver, new Long(-1, 2097151)) <= 0 : false;
|
|
1629
|
+
}
|
|
1630
|
+
// Inline function 'kotlin.require' call
|
|
1631
|
+
// Inline function 'kotlin.require' call
|
|
1632
|
+
if (!(tmp_2 === true)) {
|
|
1633
|
+
var message_1 = 'Failed requirement.';
|
|
1634
|
+
throw IllegalArgumentException_init_$Create$(toString(message_1));
|
|
1635
|
+
}
|
|
1636
|
+
tmp_0 = listOf(['designSystemId', 'version', 'draftId', 'draftRevision']);
|
|
1637
|
+
} else {
|
|
1638
|
+
// Inline function 'kotlin.require' call
|
|
1639
|
+
// Inline function 'kotlin.require' call
|
|
1640
|
+
if (!$this.y6c_1.ld(version.d38())) {
|
|
1641
|
+
var message_2 = 'Failed requirement.';
|
|
1642
|
+
throw IllegalArgumentException_init_$Create$(toString(message_2));
|
|
1643
|
+
}
|
|
1644
|
+
tmp_0 = listOf(['designSystemId', 'version', 'versionId']);
|
|
1645
|
+
}
|
|
1646
|
+
var names = tmp_0;
|
|
1647
|
+
var idName = version.d38() === 'draft' ? 'draftId' : 'versionId';
|
|
1648
|
+
var tmp_3 = value.xd(idName);
|
|
1649
|
+
var id = tmp_3 instanceof JsonPrimitive ? tmp_3 : THROW_CCE();
|
|
1650
|
+
// Inline function 'kotlin.require' call
|
|
1651
|
+
// Inline function 'kotlin.require' call
|
|
1652
|
+
if (!(id.c38() && $this.x6c_1.ld(id.d38()))) {
|
|
1653
|
+
var message_3 = 'Failed requirement.';
|
|
1654
|
+
throw IllegalArgumentException_init_$Create$(toString(message_3));
|
|
1655
|
+
}
|
|
1656
|
+
// Inline function 'kotlin.collections.filterKeys' call
|
|
1657
|
+
var result = LinkedHashMap_init_$Create$();
|
|
1658
|
+
// Inline function 'kotlin.collections.iterator' call
|
|
1659
|
+
var _iterator__ex2g4s = value.w().l();
|
|
1660
|
+
while (_iterator__ex2g4s.m()) {
|
|
1661
|
+
var entry = _iterator__ex2g4s.n();
|
|
1662
|
+
var it = entry.x();
|
|
1663
|
+
if (names.t(it)) {
|
|
1664
|
+
result.f2(entry.x(), entry.y());
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
return new JsonObject(result);
|
|
1668
|
+
}
|
|
1669
|
+
function ModelReadContextDecoder() {
|
|
1670
|
+
ModelReadContextDecoder_instance = this;
|
|
1671
|
+
this.w6c_1 = new Long(-1, 2097151);
|
|
1672
|
+
this.x6c_1 = Regex_init_$Create$('[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}');
|
|
1673
|
+
this.y6c_1 = Regex_init_$Create$('(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)');
|
|
1674
|
+
}
|
|
1675
|
+
protoOf(ModelReadContextDecoder).z6c = function (raw, history) {
|
|
1676
|
+
var tmp = Default_getInstance();
|
|
1677
|
+
// Inline function 'kotlin.requireNotNull' call
|
|
1678
|
+
var tmp$ret$1;
|
|
1679
|
+
$l$block: {
|
|
1680
|
+
// Inline function 'kotlin.requireNotNull' call
|
|
1681
|
+
if (raw == null) {
|
|
1682
|
+
var message = 'Required value was null.';
|
|
1683
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1684
|
+
} else {
|
|
1685
|
+
tmp$ret$1 = raw;
|
|
1686
|
+
break $l$block;
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
var tmp$ret$2 = tmp$ret$1;
|
|
1690
|
+
var tmp_0 = tmp.s35(tmp$ret$2);
|
|
1691
|
+
var value = tmp_0 instanceof JsonObject ? tmp_0 : THROW_CCE();
|
|
1692
|
+
var tmp_1 = value.xd('designSystemId');
|
|
1693
|
+
var ds = tmp_1 instanceof JsonPrimitive ? tmp_1 : THROW_CCE();
|
|
1694
|
+
// Inline function 'kotlin.require' call
|
|
1695
|
+
// Inline function 'kotlin.require' call
|
|
1696
|
+
if (!(ds.c38() && this.x6c_1.ld(ds.d38()))) {
|
|
1697
|
+
var message_0 = 'Failed requirement.';
|
|
1698
|
+
throw IllegalArgumentException_init_$Create$(toString(message_0));
|
|
1699
|
+
}
|
|
1700
|
+
return history ? new JsonObject(mapOf_0(to('designSystemId', ds))) : boundaryContext(this, value);
|
|
1701
|
+
};
|
|
1702
|
+
var ModelReadContextDecoder_instance;
|
|
1703
|
+
function ModelReadContextDecoder_getInstance() {
|
|
1704
|
+
if (ModelReadContextDecoder_instance == null)
|
|
1705
|
+
new ModelReadContextDecoder();
|
|
1706
|
+
return ModelReadContextDecoder_instance;
|
|
1707
|
+
}
|
|
1708
|
+
function encodeModelSegment(value) {
|
|
1709
|
+
// Inline function 'kotlin.text.buildString' call
|
|
1710
|
+
// Inline function 'kotlin.apply' call
|
|
1711
|
+
var this_0 = StringBuilder_init_$Create$();
|
|
1712
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
1713
|
+
var indexedObject = encodeToByteArray(value);
|
|
1714
|
+
var inductionVariable = 0;
|
|
1715
|
+
var last = indexedObject.length;
|
|
1716
|
+
while (inductionVariable < last) {
|
|
1717
|
+
var element = indexedObject[inductionVariable];
|
|
1718
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
1719
|
+
var byte = element & 255;
|
|
1720
|
+
var tmp;
|
|
1721
|
+
// Inline function 'kotlin.code' call
|
|
1722
|
+
var this_1 = _Char___init__impl__6a9atx(97);
|
|
1723
|
+
var containsLower = Char__toInt_impl_vasixd(this_1);
|
|
1724
|
+
var tmp_0;
|
|
1725
|
+
// Inline function 'kotlin.code' call
|
|
1726
|
+
var this_2 = _Char___init__impl__6a9atx(122);
|
|
1727
|
+
if (byte <= Char__toInt_impl_vasixd(this_2)) {
|
|
1728
|
+
tmp_0 = containsLower <= byte;
|
|
1729
|
+
} else {
|
|
1730
|
+
tmp_0 = false;
|
|
1731
|
+
}
|
|
1732
|
+
if (tmp_0) {
|
|
1733
|
+
tmp = true;
|
|
1734
|
+
} else {
|
|
1735
|
+
// Inline function 'kotlin.code' call
|
|
1736
|
+
var this_3 = _Char___init__impl__6a9atx(65);
|
|
1737
|
+
var containsLower_0 = Char__toInt_impl_vasixd(this_3);
|
|
1738
|
+
var tmp_1;
|
|
1739
|
+
// Inline function 'kotlin.code' call
|
|
1740
|
+
var this_4 = _Char___init__impl__6a9atx(90);
|
|
1741
|
+
if (byte <= Char__toInt_impl_vasixd(this_4)) {
|
|
1742
|
+
tmp_1 = containsLower_0 <= byte;
|
|
1743
|
+
} else {
|
|
1744
|
+
tmp_1 = false;
|
|
1745
|
+
}
|
|
1746
|
+
tmp = tmp_1;
|
|
1747
|
+
}
|
|
1748
|
+
var letter = tmp;
|
|
1749
|
+
var tmp_2;
|
|
1750
|
+
var tmp_3;
|
|
1751
|
+
if (letter) {
|
|
1752
|
+
tmp_3 = true;
|
|
1753
|
+
} else {
|
|
1754
|
+
// Inline function 'kotlin.code' call
|
|
1755
|
+
var this_5 = _Char___init__impl__6a9atx(48);
|
|
1756
|
+
var containsLower_1 = Char__toInt_impl_vasixd(this_5);
|
|
1757
|
+
var tmp_4;
|
|
1758
|
+
// Inline function 'kotlin.code' call
|
|
1759
|
+
var this_6 = _Char___init__impl__6a9atx(57);
|
|
1760
|
+
if (byte <= Char__toInt_impl_vasixd(this_6)) {
|
|
1761
|
+
tmp_4 = containsLower_1 <= byte;
|
|
1762
|
+
} else {
|
|
1763
|
+
tmp_4 = false;
|
|
1764
|
+
}
|
|
1765
|
+
tmp_3 = tmp_4;
|
|
1766
|
+
}
|
|
1767
|
+
if (tmp_3) {
|
|
1768
|
+
tmp_2 = true;
|
|
1769
|
+
} else {
|
|
1770
|
+
tmp_2 = contains('-._~', numberToChar(byte));
|
|
1771
|
+
}
|
|
1772
|
+
if (tmp_2) {
|
|
1773
|
+
this_0.a8(numberToChar(byte));
|
|
1774
|
+
} else {
|
|
1775
|
+
// Inline function 'kotlin.text.uppercase' call
|
|
1776
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
1777
|
+
var tmp$ret$7 = toString_1(byte, 16).toUpperCase();
|
|
1778
|
+
this_0.z7('%' + padStart(tmp$ret$7, 2, _Char___init__impl__6a9atx(48)));
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
return this_0.toString();
|
|
1782
|
+
}
|
|
1783
|
+
function path($this, command, designSystemId) {
|
|
1784
|
+
// Inline function 'kotlin.text.orEmpty' call
|
|
1785
|
+
var tmp0_elvis_lhs = command.l69_1;
|
|
1786
|
+
var tmp$ret$0 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
1787
|
+
var id = encodeModelSegment(tmp$ret$0);
|
|
1788
|
+
var ds = 'design-systems/' + encodeModelSegment(designSystemId);
|
|
1789
|
+
switch (command.k69_1.o2_1) {
|
|
1790
|
+
case 0:
|
|
1791
|
+
return ds;
|
|
1792
|
+
case 1:
|
|
1793
|
+
return ds + '/versions';
|
|
1794
|
+
case 2:
|
|
1795
|
+
return versionPath($this, command, ds);
|
|
1796
|
+
case 3:
|
|
1797
|
+
return ds + '/changes';
|
|
1798
|
+
case 4:
|
|
1799
|
+
return ds + '/tenants';
|
|
1800
|
+
case 5:
|
|
1801
|
+
return ds + '/tokens';
|
|
1802
|
+
case 8:
|
|
1803
|
+
return ds + '/token-groups';
|
|
1804
|
+
case 10:
|
|
1805
|
+
return ds + '/components';
|
|
1806
|
+
case 12:
|
|
1807
|
+
return ds + '/components/' + id + '/styles';
|
|
1808
|
+
case 11:
|
|
1809
|
+
return 'design-systems/catalog/components/' + id;
|
|
1810
|
+
default:
|
|
1811
|
+
return ds + '/' + resourcePath($this, command, id);
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
function resourcePath($this, command, id) {
|
|
1815
|
+
var tmp;
|
|
1816
|
+
switch (command.k69_1.o2_1) {
|
|
1817
|
+
case 6:
|
|
1818
|
+
tmp = 'tokens/' + id;
|
|
1819
|
+
break;
|
|
1820
|
+
case 7:
|
|
1821
|
+
tmp = 'tokens/' + id + '/values';
|
|
1822
|
+
break;
|
|
1823
|
+
case 9:
|
|
1824
|
+
tmp = 'tenants/' + id + '/palette';
|
|
1825
|
+
break;
|
|
1826
|
+
case 11:
|
|
1827
|
+
tmp = 'components/' + id;
|
|
1828
|
+
break;
|
|
1829
|
+
case 13:
|
|
1830
|
+
tmp = 'appearances/' + id + '/variations';
|
|
1831
|
+
break;
|
|
1832
|
+
case 14:
|
|
1833
|
+
tmp = 'components/' + id + '/properties';
|
|
1834
|
+
break;
|
|
1835
|
+
case 15:
|
|
1836
|
+
tmp = 'components/' + id + '/deps';
|
|
1837
|
+
break;
|
|
1838
|
+
default:
|
|
1839
|
+
var message = 'Unsupported resource operation';
|
|
1840
|
+
throw IllegalStateException_init_$Create$(toString(message));
|
|
1841
|
+
}
|
|
1842
|
+
return tmp;
|
|
1843
|
+
}
|
|
1844
|
+
function versionPath($this, command, ds) {
|
|
1845
|
+
var tmp;
|
|
1846
|
+
if (command.m69_1 === 'draft') {
|
|
1847
|
+
tmp = ds;
|
|
1848
|
+
} else {
|
|
1849
|
+
tmp = ds + '/versions';
|
|
1850
|
+
}
|
|
1851
|
+
return tmp;
|
|
1852
|
+
}
|
|
1853
|
+
function parameters($this, command, page, limit) {
|
|
1854
|
+
var parameters = toMutableMap(command.n69_1);
|
|
1855
|
+
if (command.k69_1.equals(ModelReadOperation_COMPONENT_PROPERTIES_getInstance())) {
|
|
1856
|
+
// Inline function 'kotlin.collections.set' call
|
|
1857
|
+
var value = 'platformParams';
|
|
1858
|
+
parameters.f2('include', value);
|
|
1859
|
+
}
|
|
1860
|
+
if (command.k69_1.equals(ModelReadOperation_COMPONENT_DEPENDENCIES_getInstance())) {
|
|
1861
|
+
// Inline function 'kotlin.collections.set' call
|
|
1862
|
+
var value_0 = 'reuseConfig';
|
|
1863
|
+
parameters.f2('include', value_0);
|
|
1864
|
+
}
|
|
1865
|
+
if (!command.k69_1.equals(ModelReadOperation_COMPONENT_getInstance()) && !command.k69_1.equals(ModelReadOperation_VERSIONS_getInstance())) {
|
|
1866
|
+
var tmp0_elvis_lhs = command.m69_1;
|
|
1867
|
+
// Inline function 'kotlin.collections.set' call
|
|
1868
|
+
var value_1 = tmp0_elvis_lhs == null ? 'draft' : tmp0_elvis_lhs;
|
|
1869
|
+
parameters.f2('version', value_1);
|
|
1870
|
+
}
|
|
1871
|
+
if (command.k69_1.equals(ModelReadOperation_VERSIONS_getInstance())) {
|
|
1872
|
+
var tmp1_safe_receiver = command.m69_1;
|
|
1873
|
+
if (tmp1_safe_receiver == null)
|
|
1874
|
+
null;
|
|
1875
|
+
else {
|
|
1876
|
+
// Inline function 'kotlin.let' call
|
|
1877
|
+
// Inline function 'kotlin.collections.set' call
|
|
1878
|
+
parameters.f2('version', tmp1_safe_receiver);
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
if (page) {
|
|
1882
|
+
// Inline function 'kotlin.collections.set' call
|
|
1883
|
+
var value_2 = limit.toString();
|
|
1884
|
+
parameters.f2('limit', value_2);
|
|
1885
|
+
var tmp2_safe_receiver = command.p69_1;
|
|
1886
|
+
if (tmp2_safe_receiver == null)
|
|
1887
|
+
null;
|
|
1888
|
+
else {
|
|
1889
|
+
// Inline function 'kotlin.let' call
|
|
1890
|
+
// Inline function 'kotlin.collections.set' call
|
|
1891
|
+
parameters.f2('cursor', tmp2_safe_receiver);
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
return parameters;
|
|
1895
|
+
}
|
|
1896
|
+
function ModelReadHttpRequest$Companion$create$lambda(it) {
|
|
1897
|
+
return encodeModelSegment(it.x()) + '=' + encodeModelSegment(it.y());
|
|
1898
|
+
}
|
|
1899
|
+
function Companion_1() {
|
|
1900
|
+
Companion_instance_2 = this;
|
|
1901
|
+
this.n6b_1 = setOf([ModelReadOperation_VERSIONS_getInstance(), ModelReadOperation_CHANGES_getInstance(), ModelReadOperation_TENANTS_getInstance(), ModelReadOperation_TOKENS_getInstance(), ModelReadOperation_TOKEN_GROUPS_getInstance(), ModelReadOperation_COMPONENTS_getInstance(), ModelReadOperation_COMPONENT_STYLES_getInstance()]);
|
|
1902
|
+
}
|
|
1903
|
+
protoOf(Companion_1).o6b = function (projectId, designSystemId, command) {
|
|
1904
|
+
var page = this.n6b_1.t(command.k69_1) || isPublishedVersion(command);
|
|
1905
|
+
var tmp;
|
|
1906
|
+
if (command.k69_1.equals(ModelReadOperation_VERSION_getInstance()) && page) {
|
|
1907
|
+
tmp = 1;
|
|
1908
|
+
} else {
|
|
1909
|
+
var tmp0_elvis_lhs = command.o69_1;
|
|
1910
|
+
tmp = tmp0_elvis_lhs == null ? 50 : tmp0_elvis_lhs;
|
|
1911
|
+
}
|
|
1912
|
+
var limit = tmp;
|
|
1913
|
+
var tmp_0 = parameters(this, command, page, limit).w();
|
|
1914
|
+
var query = joinToString(tmp_0, '&', VOID, VOID, VOID, VOID, ModelReadHttpRequest$Companion$create$lambda);
|
|
1915
|
+
var tmp_1 = '/api/projects/' + encodeModelSegment(projectId) + '/' + path(this, command, designSystemId);
|
|
1916
|
+
var tmp_2;
|
|
1917
|
+
// Inline function 'kotlin.text.isEmpty' call
|
|
1918
|
+
if (charSequenceLength(query) === 0) {
|
|
1919
|
+
tmp_2 = '';
|
|
1920
|
+
} else {
|
|
1921
|
+
tmp_2 = '?' + query;
|
|
1922
|
+
}
|
|
1923
|
+
var url = tmp_1 + tmp_2;
|
|
1924
|
+
return new ModelReadHttpRequest(url, page, limit);
|
|
1925
|
+
};
|
|
1926
|
+
var Companion_instance_2;
|
|
1927
|
+
function Companion_getInstance_2() {
|
|
1928
|
+
if (Companion_instance_2 == null)
|
|
1929
|
+
new Companion_1();
|
|
1930
|
+
return Companion_instance_2;
|
|
1931
|
+
}
|
|
1932
|
+
function ModelReadHttpRequest(url, paged, limit) {
|
|
1933
|
+
Companion_getInstance_2();
|
|
1934
|
+
this.q6b_1 = url;
|
|
1935
|
+
this.r6b_1 = paged;
|
|
1936
|
+
this.s6b_1 = limit;
|
|
1937
|
+
}
|
|
1938
|
+
protoOf(ModelReadHttpRequest).toString = function () {
|
|
1939
|
+
return 'ModelReadHttpRequest(url=' + this.q6b_1 + ', paged=' + this.r6b_1 + ', limit=' + this.s6b_1 + ')';
|
|
1940
|
+
};
|
|
1941
|
+
protoOf(ModelReadHttpRequest).hashCode = function () {
|
|
1942
|
+
var result = getStringHashCode(this.q6b_1);
|
|
1943
|
+
result = imul(result, 31) + getBooleanHashCode(this.r6b_1) | 0;
|
|
1944
|
+
result = imul(result, 31) + this.s6b_1 | 0;
|
|
1945
|
+
return result;
|
|
1946
|
+
};
|
|
1947
|
+
protoOf(ModelReadHttpRequest).equals = function (other) {
|
|
1948
|
+
if (this === other)
|
|
1949
|
+
return true;
|
|
1950
|
+
if (!(other instanceof ModelReadHttpRequest))
|
|
1951
|
+
return false;
|
|
1952
|
+
if (!(this.q6b_1 === other.q6b_1))
|
|
1953
|
+
return false;
|
|
1954
|
+
if (!(this.r6b_1 === other.r6b_1))
|
|
1955
|
+
return false;
|
|
1956
|
+
if (!(this.s6b_1 === other.s6b_1))
|
|
1957
|
+
return false;
|
|
1958
|
+
return true;
|
|
1959
|
+
};
|
|
1960
|
+
function isPublishedVersion(command) {
|
|
1961
|
+
return command.k69_1.equals(ModelReadOperation_VERSION_getInstance()) && !(command.m69_1 === 'draft');
|
|
1962
|
+
}
|
|
1963
|
+
function decodeVersioned($this, response, command, data, page, limit) {
|
|
1964
|
+
var history = command.k69_1.equals(ModelReadOperation_VERSIONS_getInstance()) || isPublishedVersion(command);
|
|
1965
|
+
var context = ModelReadContextDecoder_getInstance().z6c(response.g5a_1.c2('x-ds-read-context'), history);
|
|
1966
|
+
var tmp;
|
|
1967
|
+
if (history) {
|
|
1968
|
+
tmp = true;
|
|
1969
|
+
} else {
|
|
1970
|
+
var tmp_0 = context.xd('version');
|
|
1971
|
+
var tmp0_safe_receiver = tmp_0 instanceof JsonPrimitive ? tmp_0 : null;
|
|
1972
|
+
tmp = (tmp0_safe_receiver == null ? null : tmp0_safe_receiver.d38()) == command.m69_1;
|
|
1973
|
+
}
|
|
1974
|
+
// Inline function 'kotlin.require' call
|
|
1975
|
+
// Inline function 'kotlin.require' call
|
|
1976
|
+
if (!tmp) {
|
|
1977
|
+
var message = 'Failed requirement.';
|
|
1978
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1979
|
+
}
|
|
1980
|
+
var cursor = response.g5a_1.c2('x-ds-next-cursor');
|
|
1981
|
+
if (page) {
|
|
1982
|
+
validatePage($this, response, data, limit, cursor);
|
|
1983
|
+
}
|
|
1984
|
+
var tmp_1;
|
|
1985
|
+
if (isPublishedVersion(command)) {
|
|
1986
|
+
tmp_1 = publishedResult($this, data instanceof JsonArray ? data : THROW_CCE(), context, command);
|
|
1987
|
+
} else {
|
|
1988
|
+
// Inline function 'kotlinx.serialization.json.buildJsonObject' call
|
|
1989
|
+
var builder = new JsonObjectBuilder();
|
|
1990
|
+
put(builder, 'source', 'design-system-model-api');
|
|
1991
|
+
builder.k38('context', context);
|
|
1992
|
+
builder.k38(page ? 'items' : 'data', compactItems(ModelReadResponseDecoder_getInstance(), data, command.k69_1));
|
|
1993
|
+
if (page && !(cursor == null)) {
|
|
1994
|
+
put(builder, 'nextCursor', cursor);
|
|
1995
|
+
}
|
|
1996
|
+
var tmp$ret$4 = builder.z36();
|
|
1997
|
+
tmp_1 = new Success_1(tmp$ret$4);
|
|
1998
|
+
}
|
|
1999
|
+
return tmp_1;
|
|
2000
|
+
}
|
|
2001
|
+
function validatePage($this, response, data, limit, cursor) {
|
|
2002
|
+
var tmp0_safe_receiver = response.g5a_1.c2('x-ds-page-limit');
|
|
2003
|
+
// Inline function 'kotlin.require' call
|
|
2004
|
+
// Inline function 'kotlin.require' call
|
|
2005
|
+
if (!((tmp0_safe_receiver == null ? null : toIntOrNull(tmp0_safe_receiver)) === limit)) {
|
|
2006
|
+
var message = 'Failed requirement.';
|
|
2007
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
2008
|
+
}
|
|
2009
|
+
var tmp;
|
|
2010
|
+
if (data instanceof JsonArray) {
|
|
2011
|
+
tmp = data.o() <= limit;
|
|
2012
|
+
} else {
|
|
2013
|
+
tmp = false;
|
|
2014
|
+
}
|
|
2015
|
+
// Inline function 'kotlin.require' call
|
|
2016
|
+
// Inline function 'kotlin.require' call
|
|
2017
|
+
if (!tmp) {
|
|
2018
|
+
var message_0 = 'Failed requirement.';
|
|
2019
|
+
throw IllegalArgumentException_init_$Create$(toString(message_0));
|
|
2020
|
+
}
|
|
2021
|
+
if (!(cursor == null)) {
|
|
2022
|
+
var tmp_0;
|
|
2023
|
+
if ($this.u6b_1.ld(cursor)) {
|
|
2024
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
2025
|
+
tmp_0 = !data.r();
|
|
2026
|
+
} else {
|
|
2027
|
+
tmp_0 = false;
|
|
2028
|
+
}
|
|
2029
|
+
// Inline function 'kotlin.require' call
|
|
2030
|
+
// Inline function 'kotlin.require' call
|
|
2031
|
+
if (!tmp_0) {
|
|
2032
|
+
var message_1 = 'Failed requirement.';
|
|
2033
|
+
throw IllegalArgumentException_init_$Create$(toString(message_1));
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
function publishedResult($this, data, context, command) {
|
|
2038
|
+
var tmp = singleOrNull(data);
|
|
2039
|
+
var tmp0_elvis_lhs = tmp instanceof JsonObject ? tmp : null;
|
|
2040
|
+
var tmp_0;
|
|
2041
|
+
if (tmp0_elvis_lhs == null) {
|
|
2042
|
+
return new Failed_2('NOT_FOUND', 'Model version was not found.');
|
|
2043
|
+
} else {
|
|
2044
|
+
tmp_0 = tmp0_elvis_lhs;
|
|
2045
|
+
}
|
|
2046
|
+
var item = tmp_0;
|
|
2047
|
+
var tmp_1 = item.xd('version');
|
|
2048
|
+
var actualVersion = tmp_1 instanceof JsonPrimitive ? tmp_1 : THROW_CCE();
|
|
2049
|
+
var tmp_2 = item.xd('id');
|
|
2050
|
+
var actualId = tmp_2 instanceof JsonPrimitive ? tmp_2 : THROW_CCE();
|
|
2051
|
+
// Inline function 'kotlin.require' call
|
|
2052
|
+
// Inline function 'kotlin.require' call
|
|
2053
|
+
if (!(actualVersion.d38() === command.m69_1)) {
|
|
2054
|
+
var message = 'Failed requirement.';
|
|
2055
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
2056
|
+
}
|
|
2057
|
+
// Inline function 'kotlin.require' call
|
|
2058
|
+
// Inline function 'kotlin.require' call
|
|
2059
|
+
if (!$this.t6b_1.ld(actualId.d38())) {
|
|
2060
|
+
var message_0 = 'Failed requirement.';
|
|
2061
|
+
throw IllegalArgumentException_init_$Create$(toString(message_0));
|
|
2062
|
+
}
|
|
2063
|
+
// Inline function 'kotlin.require' call
|
|
2064
|
+
// Inline function 'kotlin.require' call
|
|
2065
|
+
if (!equals(item.xd('designSystemId'), context.xd('designSystemId'))) {
|
|
2066
|
+
var message_1 = 'Failed requirement.';
|
|
2067
|
+
throw IllegalArgumentException_init_$Create$(toString(message_1));
|
|
2068
|
+
}
|
|
2069
|
+
// Inline function 'kotlinx.serialization.json.buildJsonObject' call
|
|
2070
|
+
var builder = new JsonObjectBuilder();
|
|
2071
|
+
builder.k38('context', new JsonObject(plus_0(context, mapOf([to('version', actualVersion), to('versionId', actualId)]))));
|
|
2072
|
+
builder.k38('data', item);
|
|
2073
|
+
var tmp$ret$10 = builder.z36();
|
|
2074
|
+
return new Success_1(tmp$ret$10);
|
|
2075
|
+
}
|
|
2076
|
+
function compactItems($this, data, operation) {
|
|
2077
|
+
var tmp;
|
|
2078
|
+
switch (operation.o2_1) {
|
|
2079
|
+
case 5:
|
|
2080
|
+
tmp = setOf(['id', 'name', 'type', 'displayName', 'description']);
|
|
2081
|
+
break;
|
|
2082
|
+
case 10:
|
|
2083
|
+
tmp = setOf(['id', 'name', 'platform', 'description']);
|
|
2084
|
+
break;
|
|
2085
|
+
default:
|
|
2086
|
+
return data;
|
|
2087
|
+
}
|
|
2088
|
+
var fields = tmp;
|
|
2089
|
+
// Inline function 'kotlin.collections.map' call
|
|
2090
|
+
var this_0 = data instanceof JsonArray ? data : THROW_CCE();
|
|
2091
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2092
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2093
|
+
var _iterator__ex2g4s = this_0.l();
|
|
2094
|
+
while (_iterator__ex2g4s.m()) {
|
|
2095
|
+
var item = _iterator__ex2g4s.n();
|
|
2096
|
+
var tmp_0;
|
|
2097
|
+
if (item instanceof JsonObject) {
|
|
2098
|
+
// Inline function 'kotlin.collections.filterKeys' call
|
|
2099
|
+
var result = LinkedHashMap_init_$Create$();
|
|
2100
|
+
// Inline function 'kotlin.collections.iterator' call
|
|
2101
|
+
var _iterator__ex2g4s_0 = item.w().l();
|
|
2102
|
+
while (_iterator__ex2g4s_0.m()) {
|
|
2103
|
+
var entry = _iterator__ex2g4s_0.n();
|
|
2104
|
+
var it = entry.x();
|
|
2105
|
+
if (fields.t(it)) {
|
|
2106
|
+
result.f2(entry.x(), entry.y());
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
tmp_0 = new JsonObject(result);
|
|
2110
|
+
} else {
|
|
2111
|
+
tmp_0 = item;
|
|
2112
|
+
}
|
|
2113
|
+
var tmp$ret$3 = tmp_0;
|
|
2114
|
+
destination.j(tmp$ret$3);
|
|
2115
|
+
}
|
|
2116
|
+
return new JsonArray(destination);
|
|
2117
|
+
}
|
|
2118
|
+
function unreadable($this) {
|
|
2119
|
+
return new Failed_2('INVALID_BACKEND_RESPONSE', 'Backend returned invalid model read data or metadata.');
|
|
2120
|
+
}
|
|
2121
|
+
function ModelReadResponseDecoder() {
|
|
2122
|
+
ModelReadResponseDecoder_instance = this;
|
|
2123
|
+
this.t6b_1 = Regex_init_$Create$('[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}');
|
|
2124
|
+
this.u6b_1 = Regex_init_$Create$('[A-Za-z0-9_-]{1,8192}');
|
|
2125
|
+
}
|
|
2126
|
+
protoOf(ModelReadResponseDecoder).v6b = function (response, command, page, limit) {
|
|
2127
|
+
// Inline function 'kotlin.runCatching' call
|
|
2128
|
+
var tmp;
|
|
2129
|
+
try {
|
|
2130
|
+
// Inline function 'kotlin.require' call
|
|
2131
|
+
// Inline function 'kotlin.require' call
|
|
2132
|
+
if (!response.h5a_1) {
|
|
2133
|
+
var message = 'Failed requirement.';
|
|
2134
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
2135
|
+
}
|
|
2136
|
+
var data = Default_getInstance().s35(response.f5a_1);
|
|
2137
|
+
var tmp_0;
|
|
2138
|
+
if (command.k69_1.equals(ModelReadOperation_COMPONENT_getInstance())) {
|
|
2139
|
+
// Inline function 'kotlin.require' call
|
|
2140
|
+
// Inline function 'kotlin.require' call
|
|
2141
|
+
if (!(data instanceof JsonObject)) {
|
|
2142
|
+
var message_0 = 'Failed requirement.';
|
|
2143
|
+
throw IllegalArgumentException_init_$Create$(toString(message_0));
|
|
2144
|
+
}
|
|
2145
|
+
// Inline function 'kotlinx.serialization.json.buildJsonObject' call
|
|
2146
|
+
var builder = new JsonObjectBuilder();
|
|
2147
|
+
builder.k38('data', data);
|
|
2148
|
+
var tmp$ret$7 = builder.z36();
|
|
2149
|
+
tmp_0 = new Success_1(tmp$ret$7);
|
|
2150
|
+
} else {
|
|
2151
|
+
tmp_0 = decodeVersioned(this, response, command, data, page, limit);
|
|
2152
|
+
}
|
|
2153
|
+
// Inline function 'kotlin.Companion.success' call
|
|
2154
|
+
var value = tmp_0;
|
|
2155
|
+
tmp = _Result___init__impl__xyqfz8(value);
|
|
2156
|
+
} catch ($p) {
|
|
2157
|
+
var tmp_1;
|
|
2158
|
+
if ($p instanceof Error) {
|
|
2159
|
+
var e = $p;
|
|
2160
|
+
// Inline function 'kotlin.Companion.failure' call
|
|
2161
|
+
tmp_1 = _Result___init__impl__xyqfz8(createFailure(e));
|
|
2162
|
+
} else {
|
|
2163
|
+
throw $p;
|
|
2164
|
+
}
|
|
2165
|
+
tmp = tmp_1;
|
|
2166
|
+
}
|
|
2167
|
+
// Inline function 'kotlin.getOrElse' call
|
|
2168
|
+
var this_0 = tmp;
|
|
2169
|
+
var exception = Result__exceptionOrNull_impl_p6xea9(this_0);
|
|
2170
|
+
var tmp_2;
|
|
2171
|
+
if (exception == null) {
|
|
2172
|
+
var tmp_3 = _Result___get_value__impl__bjfvqg(this_0);
|
|
2173
|
+
tmp_2 = (tmp_3 == null ? true : !(tmp_3 == null)) ? tmp_3 : THROW_CCE();
|
|
2174
|
+
} else {
|
|
2175
|
+
tmp_2 = unreadable(ModelReadResponseDecoder_getInstance());
|
|
2176
|
+
}
|
|
2177
|
+
return tmp_2;
|
|
2178
|
+
};
|
|
2179
|
+
var ModelReadResponseDecoder_instance;
|
|
2180
|
+
function ModelReadResponseDecoder_getInstance() {
|
|
2181
|
+
if (ModelReadResponseDecoder_instance == null)
|
|
2182
|
+
new ModelReadResponseDecoder();
|
|
2183
|
+
return ModelReadResponseDecoder_instance;
|
|
2184
|
+
}
|
|
2185
|
+
//region block: exports
|
|
2186
|
+
_.$_$ = _.$_$ || {};
|
|
2187
|
+
_.$_$.a = Failed_1;
|
|
2188
|
+
_.$_$.b = Success_0;
|
|
2189
|
+
_.$_$.c = DiscoverDesignSystemVersionsCommand;
|
|
2190
|
+
_.$_$.d = DiscoverDesignSystemVersionsUseCase;
|
|
2191
|
+
_.$_$.e = GenerateDesignSystemCommand;
|
|
2192
|
+
_.$_$.f = GenerateDesignSystemUseCase;
|
|
2193
|
+
_.$_$.g = ListDesignSystemsUseCase;
|
|
2194
|
+
_.$_$.h = ModelReadCommand;
|
|
2195
|
+
_.$_$.i = Failed_2;
|
|
2196
|
+
_.$_$.j = Success_1;
|
|
2197
|
+
_.$_$.k = ReadDesignSystemModelUseCase;
|
|
2198
|
+
_.$_$.l = dsApplicationModule;
|
|
2199
|
+
_.$_$.m = ModelReadOperation_APPEARANCE_VARIATIONS_getInstance;
|
|
2200
|
+
_.$_$.n = ModelReadOperation_CHANGES_getInstance;
|
|
2201
|
+
_.$_$.o = ModelReadOperation_COMPONENTS_getInstance;
|
|
2202
|
+
_.$_$.p = ModelReadOperation_COMPONENT_DEPENDENCIES_getInstance;
|
|
2203
|
+
_.$_$.q = ModelReadOperation_COMPONENT_PROPERTIES_getInstance;
|
|
2204
|
+
_.$_$.r = ModelReadOperation_COMPONENT_STYLES_getInstance;
|
|
2205
|
+
_.$_$.s = ModelReadOperation_COMPONENT_getInstance;
|
|
2206
|
+
_.$_$.t = ModelReadOperation_CONTEXT_getInstance;
|
|
2207
|
+
_.$_$.u = ModelReadOperation_PALETTE_getInstance;
|
|
2208
|
+
_.$_$.v = ModelReadOperation_TENANTS_getInstance;
|
|
2209
|
+
_.$_$.w = ModelReadOperation_TOKENS_getInstance;
|
|
2210
|
+
_.$_$.x = ModelReadOperation_TOKEN_GROUPS_getInstance;
|
|
2211
|
+
_.$_$.y = ModelReadOperation_TOKEN_VALUES_getInstance;
|
|
2212
|
+
_.$_$.z = ModelReadOperation_TOKEN_getInstance;
|
|
2213
|
+
_.$_$.a1 = ModelReadOperation_VERSIONS_getInstance;
|
|
2214
|
+
_.$_$.b1 = ModelReadOperation_VERSION_getInstance;
|
|
2215
|
+
//endregion
|
|
2216
|
+
return _;
|
|
2217
|
+
}(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-platform.js'), require('./design-system-builder-frontend-core-auth.js'), require('./kotlinx-serialization-kotlinx-serialization-json.js'), require('./design-system-builder-frontend-core-domain.js')));
|
|
2218
|
+
|
|
2219
|
+
//# sourceMappingURL=design-system-builder-frontend-feature-ds.js.map
|