@platform-mesh/portal-server-lib 0.5.46 → 0.6.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/dist/portal-options/service-providers/content-configuration-service-providers.service.js +2 -2
- package/dist/portal-options/service-providers/content-configuration-service-providers.service.js.map +1 -1
- package/dist/portal-options/service-providers/contentconfigurations-query.js +14 -12
- package/dist/portal-options/service-providers/contentconfigurations-query.js.map +1 -1
- package/dist/portal-options/service-providers/models/contentconfigurations.d.ts +3 -1
- package/package.json +1 -1
- package/src/portal-options/service-providers/content-configuration-service-providers.service.spec.ts +135 -115
- package/src/portal-options/service-providers/content-configuration-service-providers.service.ts +2 -2
- package/src/portal-options/service-providers/contentconfigurations-query.ts +14 -12
- package/src/portal-options/service-providers/models/contentconfigurations.ts +1 -1
package/dist/portal-options/service-providers/content-configuration-service-providers.service.js
CHANGED
|
@@ -33,11 +33,11 @@ let ContentConfigurationServiceProvidersService = class ContentConfigurationServ
|
|
|
33
33
|
});
|
|
34
34
|
try {
|
|
35
35
|
const response = await client.request(contentConfigurationsQuery, {});
|
|
36
|
-
if (!response?.ui_platform_mesh_io?.ContentConfigurations) {
|
|
36
|
+
if (!response?.ui_platform_mesh_io?.v1alpha1?.ContentConfigurations) {
|
|
37
37
|
throw new Error('Invalid response structure: missing ContentConfigurations');
|
|
38
38
|
}
|
|
39
39
|
const entity = !entities || !entities.length ? 'main' : entities[0];
|
|
40
|
-
const contentConfigurations = response.ui_platform_mesh_io.ContentConfigurations.items
|
|
40
|
+
const contentConfigurations = response.ui_platform_mesh_io.v1alpha1.ContentConfigurations.items
|
|
41
41
|
.filter((item) => item.metadata.labels?.['ui.platform-mesh.io/entity'] === entity)
|
|
42
42
|
.map((item) => {
|
|
43
43
|
try {
|
package/dist/portal-options/service-providers/content-configuration-service-providers.service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-configuration-service-providers.service.js","sourceRoot":"","sources":["../../../src/portal-options/service-providers/content-configuration-service-providers.service.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,8CAA8C,EAAE,MAAM,wCAAwC,CAAC;AACxG,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAM5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGzC,IAAM,2CAA2C,GAAjD,MAAM,2CAA2C;IACtD,KAAK,CAAC,mBAAmB,CACvB,KAAa,EACb,QAAkB,EAClB,OAAuB;QAGvB,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QACvC,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YACzB,OAAO,iBAAiB,CAAC;QAC3B,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QAED,IAAI,GAAG,GAAG,OAAO,CAAC,gBAAgB,CAAC,OAAO,CACxC,iCAAiC,EACjC,yEAAyE,CAC1E,CAAC;QAEF,MAAM,WAAW,GACf,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,CAAC,+BAA+B,CAAC,CAAC;QACrE,IAAI,WAAW,EAAE,CAAC;YAChB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,WAAW,UAAU,CAAC,CAAC;QAC3D,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,mCAAmC,GAAG,EAAE,CAAC,CAAC;QACtD,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,GAAG,EAAE;YACpC,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,KAAK,EAAE;aACjC;SACF,CAAC,CAAC;QAEH,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CACnC,0BAA0B,EAC1B,EAAE,CACH,CAAC;YAGF,IAAI,CAAC,QAAQ,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"content-configuration-service-providers.service.js","sourceRoot":"","sources":["../../../src/portal-options/service-providers/content-configuration-service-providers.service.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,8CAA8C,EAAE,MAAM,wCAAwC,CAAC;AACxG,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAM5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGzC,IAAM,2CAA2C,GAAjD,MAAM,2CAA2C;IACtD,KAAK,CAAC,mBAAmB,CACvB,KAAa,EACb,QAAkB,EAClB,OAAuB;QAGvB,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QACvC,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YACzB,OAAO,iBAAiB,CAAC;QAC3B,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QAED,IAAI,GAAG,GAAG,OAAO,CAAC,gBAAgB,CAAC,OAAO,CACxC,iCAAiC,EACjC,yEAAyE,CAC1E,CAAC;QAEF,MAAM,WAAW,GACf,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,CAAC,+BAA+B,CAAC,CAAC;QACrE,IAAI,WAAW,EAAE,CAAC;YAChB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,WAAW,UAAU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|
|
@@ -2,19 +2,21 @@ import { gql } from 'graphql-request';
|
|
|
2
2
|
export const contentConfigurationsQuery = gql `
|
|
3
3
|
query {
|
|
4
4
|
ui_platform_mesh_io {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
v1alpha1 {
|
|
6
|
+
ContentConfigurations {
|
|
7
|
+
items {
|
|
8
|
+
metadata {
|
|
9
|
+
name
|
|
10
|
+
labels
|
|
11
|
+
}
|
|
12
|
+
spec {
|
|
13
|
+
remoteConfiguration {
|
|
14
|
+
url
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
status {
|
|
18
|
+
configurationResult
|
|
14
19
|
}
|
|
15
|
-
}
|
|
16
|
-
status {
|
|
17
|
-
configurationResult
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentconfigurations-query.js","sourceRoot":"","sources":["../../../src/portal-options/service-providers/contentconfigurations-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"contentconfigurations-query.js","sourceRoot":"","sources":["../../../src/portal-options/service-providers/contentconfigurations-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;CAuB5C,CAAC"}
|
package/package.json
CHANGED
package/src/portal-options/service-providers/content-configuration-service-providers.service.spec.ts
CHANGED
|
@@ -70,19 +70,21 @@ describe('ContentConfigurationServiceProvidersService', () => {
|
|
|
70
70
|
it('returns parsed content configurations', async () => {
|
|
71
71
|
mockClient.request.mockResolvedValue({
|
|
72
72
|
ui_platform_mesh_io: {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
v1alpha1: {
|
|
74
|
+
ContentConfigurations: {
|
|
75
|
+
items: [
|
|
76
|
+
{
|
|
77
|
+
metadata: {
|
|
78
|
+
name: 'conf1',
|
|
79
|
+
labels: { 'ui.platform-mesh.io/entity': 'entity' },
|
|
80
|
+
},
|
|
81
|
+
spec: { remoteConfiguration: { url: 'http://remote' } },
|
|
82
|
+
status: {
|
|
83
|
+
configurationResult: JSON.stringify({ url: 'http://parsed' }),
|
|
84
|
+
},
|
|
79
85
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
configurationResult: JSON.stringify({ url: 'http://parsed' }),
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
+
],
|
|
87
|
+
},
|
|
86
88
|
},
|
|
87
89
|
},
|
|
88
90
|
});
|
|
@@ -99,17 +101,19 @@ describe('ContentConfigurationServiceProvidersService', () => {
|
|
|
99
101
|
it('falls back to spec.remoteConfiguration.url if missing in parsed config', async () => {
|
|
100
102
|
mockClient.request.mockResolvedValue({
|
|
101
103
|
ui_platform_mesh_io: {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
v1alpha1: {
|
|
105
|
+
ContentConfigurations: {
|
|
106
|
+
items: [
|
|
107
|
+
{
|
|
108
|
+
metadata: {
|
|
109
|
+
name: 'conf1',
|
|
110
|
+
labels: { 'ui.platform-mesh.io/entity': 'entity' },
|
|
111
|
+
},
|
|
112
|
+
spec: { remoteConfiguration: { url: 'http://remote' } },
|
|
113
|
+
status: { configurationResult: JSON.stringify({}) },
|
|
108
114
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
],
|
|
115
|
+
],
|
|
116
|
+
},
|
|
113
117
|
},
|
|
114
118
|
},
|
|
115
119
|
});
|
|
@@ -126,17 +130,19 @@ describe('ContentConfigurationServiceProvidersService', () => {
|
|
|
126
130
|
it('throws on missing configurationResult', async () => {
|
|
127
131
|
mockClient.request.mockResolvedValue({
|
|
128
132
|
ui_platform_mesh_io: {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
v1alpha1: {
|
|
134
|
+
ContentConfigurations: {
|
|
135
|
+
items: [
|
|
136
|
+
{
|
|
137
|
+
metadata: {
|
|
138
|
+
name: 'conf1',
|
|
139
|
+
labels: { 'ui.platform-mesh.io/entity': 'entity' },
|
|
140
|
+
},
|
|
141
|
+
spec: { remoteConfiguration: { url: 'http://remote' } },
|
|
142
|
+
status: {},
|
|
135
143
|
},
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
],
|
|
144
|
+
],
|
|
145
|
+
},
|
|
140
146
|
},
|
|
141
147
|
},
|
|
142
148
|
});
|
|
@@ -165,26 +171,30 @@ describe('ContentConfigurationServiceProvidersService', () => {
|
|
|
165
171
|
context.accountPath = 'acc1';
|
|
166
172
|
mockClient.request.mockResolvedValue({
|
|
167
173
|
ui_platform_mesh_io: {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
174
|
+
v1alpha1: {
|
|
175
|
+
ContentConfigurations: {
|
|
176
|
+
items: [
|
|
177
|
+
{
|
|
178
|
+
metadata: {
|
|
179
|
+
name: 'conf1',
|
|
180
|
+
labels: { 'ui.platform-mesh.io/entity': 'entity' },
|
|
181
|
+
},
|
|
182
|
+
spec: { remoteConfiguration: { url: 'http://remote' } },
|
|
183
|
+
status: {
|
|
184
|
+
configurationResult: JSON.stringify({
|
|
185
|
+
name: 'test-config',
|
|
186
|
+
luigiConfigFragment: {
|
|
187
|
+
data: {
|
|
188
|
+
nodes: [
|
|
189
|
+
{ entityType: 'core_platform-mesh_io_account' },
|
|
190
|
+
],
|
|
191
|
+
},
|
|
182
192
|
},
|
|
183
|
-
},
|
|
184
|
-
}
|
|
193
|
+
}),
|
|
194
|
+
},
|
|
185
195
|
},
|
|
186
|
-
|
|
187
|
-
|
|
196
|
+
],
|
|
197
|
+
},
|
|
188
198
|
},
|
|
189
199
|
},
|
|
190
200
|
});
|
|
@@ -205,26 +215,30 @@ describe('ContentConfigurationServiceProvidersService', () => {
|
|
|
205
215
|
context.accountPath = 'acc1:acc2:acc3';
|
|
206
216
|
mockClient.request.mockResolvedValue({
|
|
207
217
|
ui_platform_mesh_io: {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
218
|
+
v1alpha1: {
|
|
219
|
+
ContentConfigurations: {
|
|
220
|
+
items: [
|
|
221
|
+
{
|
|
222
|
+
metadata: {
|
|
223
|
+
name: 'conf1',
|
|
224
|
+
labels: { 'ui.platform-mesh.io/entity': 'entity' },
|
|
225
|
+
},
|
|
226
|
+
spec: { remoteConfiguration: { url: 'http://remote' } },
|
|
227
|
+
status: {
|
|
228
|
+
configurationResult: JSON.stringify({
|
|
229
|
+
name: 'test-config',
|
|
230
|
+
luigiConfigFragment: {
|
|
231
|
+
data: {
|
|
232
|
+
nodes: [
|
|
233
|
+
{ entityType: 'core_platform-mesh_io_account' },
|
|
234
|
+
],
|
|
235
|
+
},
|
|
222
236
|
},
|
|
223
|
-
},
|
|
224
|
-
}
|
|
237
|
+
}),
|
|
238
|
+
},
|
|
225
239
|
},
|
|
226
|
-
|
|
227
|
-
|
|
240
|
+
],
|
|
241
|
+
},
|
|
228
242
|
},
|
|
229
243
|
},
|
|
230
244
|
});
|
|
@@ -247,37 +261,39 @@ describe('ContentConfigurationServiceProvidersService', () => {
|
|
|
247
261
|
context.accountPath = 'acc1';
|
|
248
262
|
mockClient.request.mockResolvedValue({
|
|
249
263
|
ui_platform_mesh_io: {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
264
|
+
v1alpha1: {
|
|
265
|
+
ContentConfigurations: {
|
|
266
|
+
items: [
|
|
267
|
+
{
|
|
268
|
+
metadata: {
|
|
269
|
+
name: 'accounts-config',
|
|
270
|
+
labels: { 'ui.platform-mesh.io/entity': 'entity' },
|
|
271
|
+
},
|
|
272
|
+
spec: { remoteConfiguration: { url: 'http://remote' } },
|
|
273
|
+
status: {
|
|
274
|
+
configurationResult: JSON.stringify({
|
|
275
|
+
name: 'accounts',
|
|
276
|
+
luigiConfigFragment: {
|
|
277
|
+
data: {
|
|
278
|
+
nodes: [
|
|
279
|
+
{
|
|
280
|
+
entityType: 'core_platform-mesh_io_account',
|
|
281
|
+
children: [
|
|
282
|
+
{
|
|
283
|
+
defineEntity: { id: 'old-id' },
|
|
284
|
+
context: {},
|
|
285
|
+
pathSegment: 'old-path',
|
|
286
|
+
},
|
|
287
|
+
],
|
|
288
|
+
},
|
|
289
|
+
],
|
|
290
|
+
},
|
|
275
291
|
},
|
|
276
|
-
},
|
|
277
|
-
}
|
|
292
|
+
}),
|
|
293
|
+
},
|
|
278
294
|
},
|
|
279
|
-
|
|
280
|
-
|
|
295
|
+
],
|
|
296
|
+
},
|
|
281
297
|
},
|
|
282
298
|
},
|
|
283
299
|
});
|
|
@@ -299,26 +315,30 @@ describe('ContentConfigurationServiceProvidersService', () => {
|
|
|
299
315
|
it('does not apply processContentConfigurationForAccountHierarchy when accountPath is not provided', async () => {
|
|
300
316
|
mockClient.request.mockResolvedValue({
|
|
301
317
|
ui_platform_mesh_io: {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
318
|
+
v1alpha1: {
|
|
319
|
+
ContentConfigurations: {
|
|
320
|
+
items: [
|
|
321
|
+
{
|
|
322
|
+
metadata: {
|
|
323
|
+
name: 'conf1',
|
|
324
|
+
labels: { 'ui.platform-mesh.io/entity': 'entity' },
|
|
325
|
+
},
|
|
326
|
+
spec: { remoteConfiguration: { url: 'http://remote' } },
|
|
327
|
+
status: {
|
|
328
|
+
configurationResult: JSON.stringify({
|
|
329
|
+
name: 'test-config',
|
|
330
|
+
luigiConfigFragment: {
|
|
331
|
+
data: {
|
|
332
|
+
nodes: [
|
|
333
|
+
{ entityType: 'core_platform-mesh_io_account' },
|
|
334
|
+
],
|
|
335
|
+
},
|
|
316
336
|
},
|
|
317
|
-
},
|
|
318
|
-
}
|
|
337
|
+
}),
|
|
338
|
+
},
|
|
319
339
|
},
|
|
320
|
-
|
|
321
|
-
|
|
340
|
+
],
|
|
341
|
+
},
|
|
322
342
|
},
|
|
323
343
|
},
|
|
324
344
|
});
|
package/src/portal-options/service-providers/content-configuration-service-providers.service.ts
CHANGED
|
@@ -56,7 +56,7 @@ export class ContentConfigurationServiceProvidersService implements ServiceProvi
|
|
|
56
56
|
);
|
|
57
57
|
|
|
58
58
|
// Validate response structure
|
|
59
|
-
if (!response?.ui_platform_mesh_io?.ContentConfigurations) {
|
|
59
|
+
if (!response?.ui_platform_mesh_io?.v1alpha1?.ContentConfigurations) {
|
|
60
60
|
throw new Error(
|
|
61
61
|
'Invalid response structure: missing ContentConfigurations',
|
|
62
62
|
);
|
|
@@ -64,7 +64,7 @@ export class ContentConfigurationServiceProvidersService implements ServiceProvi
|
|
|
64
64
|
|
|
65
65
|
const entity = !entities || !entities.length ? 'main' : entities[0];
|
|
66
66
|
const contentConfigurations =
|
|
67
|
-
response.ui_platform_mesh_io.ContentConfigurations.items
|
|
67
|
+
response.ui_platform_mesh_io.v1alpha1.ContentConfigurations.items
|
|
68
68
|
.filter(
|
|
69
69
|
(item) =>
|
|
70
70
|
item.metadata.labels?.['ui.platform-mesh.io/entity'] === entity,
|
|
@@ -3,19 +3,21 @@ import { gql } from 'graphql-request';
|
|
|
3
3
|
export const contentConfigurationsQuery = gql`
|
|
4
4
|
query {
|
|
5
5
|
ui_platform_mesh_io {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
v1alpha1 {
|
|
7
|
+
ContentConfigurations {
|
|
8
|
+
items {
|
|
9
|
+
metadata {
|
|
10
|
+
name
|
|
11
|
+
labels
|
|
12
|
+
}
|
|
13
|
+
spec {
|
|
14
|
+
remoteConfiguration {
|
|
15
|
+
url
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
status {
|
|
19
|
+
configurationResult
|
|
15
20
|
}
|
|
16
|
-
}
|
|
17
|
-
status {
|
|
18
|
-
configurationResult
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
}
|