@equinor/roma-framework 1.1.0 → 2.0.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/cypress.mjs +29 -355
- package/dev-portal/index.d.ts +2 -0
- package/dev-portal/lib/api/ms-graph/api/user/find-users-by-mail.d.ts +2 -0
- package/dev-portal/lib/app-provider.d.ts +7 -11
- package/dev-portal/lib/dev-portal/config/AppClient.d.ts +19 -0
- package/dev-portal/lib/dev-portal/config/ServiceDiscoveryClient.d.ts +7 -0
- package/dev-portal/lib/dev-portal/config/config.d.ts +3 -0
- package/dev-portal/lib/hooks/use-manage-watch-list.d.ts +7 -0
- package/dev-portal/lib/hooks/use-watch-defaults.d.ts +100 -0
- package/dev-portal/lib/test-utils/modules.d.ts +9 -5
- package/dev-portal/lib/test-utils/roma-cypress-wrapper.d.ts +8 -1
- package/dev-portal/package.json +4 -3
- package/dev-portal/roma-framework.umd.js +28334 -21103
- package/index.d.ts +2 -0
- package/lib/api/ms-graph/api/user/find-users-by-mail.d.ts +2 -0
- package/lib/app-provider.d.ts +7 -11
- package/lib/dev-portal/config/AppClient.d.ts +19 -0
- package/lib/dev-portal/config/ServiceDiscoveryClient.d.ts +7 -0
- package/lib/dev-portal/config/config.d.ts +3 -0
- package/lib/hooks/use-manage-watch-list.d.ts +7 -0
- package/lib/hooks/use-watch-defaults.d.ts +100 -0
- package/lib/test-utils/modules.d.ts +9 -5
- package/lib/test-utils/roma-cypress-wrapper.d.ts +8 -1
- package/package.json +5 -4
- package/roma-framework.mjs +3068 -348
- package/{router-CrMzSazo.mjs → router-CD1QGwNJ.mjs} +210 -44
package/cypress.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { FrameworkProvider } from "@equinor/fusion-framework-react";
|
|
3
3
|
import { ModuleProvider } from "@equinor/fusion-framework-react-module";
|
|
4
4
|
import { QueryClientProvider, QueryClient } from "@tanstack/react-query";
|
|
5
|
-
import { _ as __extends,
|
|
5
|
+
import { _ as __extends, S as Subscription, l as __spreadArray, m as __read, n as arrRemove, p as isScheduler, O as Observable, h as of, A as Action$2, k as from, B as BehaviorSubject, f as firstValueFrom, I as IntlProvider } from "./router-CD1QGwNJ.mjs";
|
|
6
6
|
import require$$0 from "react-dom";
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
var dateTimestampProvider = {
|
|
@@ -175,189 +175,6 @@ var AsyncScheduler = function(_super) {
|
|
|
175
175
|
}(Scheduler);
|
|
176
176
|
var asyncScheduler = new AsyncScheduler(AsyncAction);
|
|
177
177
|
var async = asyncScheduler;
|
|
178
|
-
var EMPTY = new Observable(function(subscriber) {
|
|
179
|
-
return subscriber.complete();
|
|
180
|
-
});
|
|
181
|
-
function isScheduler(value) {
|
|
182
|
-
return value && isFunction(value.schedule);
|
|
183
|
-
}
|
|
184
|
-
function last(arr) {
|
|
185
|
-
return arr[arr.length - 1];
|
|
186
|
-
}
|
|
187
|
-
function popScheduler(args) {
|
|
188
|
-
return isScheduler(last(args)) ? args.pop() : void 0;
|
|
189
|
-
}
|
|
190
|
-
function executeSchedule(parentSubscription, scheduler, work, delay, repeat) {
|
|
191
|
-
if (delay === void 0) {
|
|
192
|
-
delay = 0;
|
|
193
|
-
}
|
|
194
|
-
if (repeat === void 0) {
|
|
195
|
-
repeat = false;
|
|
196
|
-
}
|
|
197
|
-
var scheduleSubscription = scheduler.schedule(function() {
|
|
198
|
-
work();
|
|
199
|
-
if (repeat) {
|
|
200
|
-
parentSubscription.add(this.schedule(null, delay));
|
|
201
|
-
} else {
|
|
202
|
-
this.unsubscribe();
|
|
203
|
-
}
|
|
204
|
-
}, delay);
|
|
205
|
-
parentSubscription.add(scheduleSubscription);
|
|
206
|
-
if (!repeat) {
|
|
207
|
-
return scheduleSubscription;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
function observeOn(scheduler, delay) {
|
|
211
|
-
if (delay === void 0) {
|
|
212
|
-
delay = 0;
|
|
213
|
-
}
|
|
214
|
-
return operate(function(source, subscriber) {
|
|
215
|
-
source.subscribe(createOperatorSubscriber(subscriber, function(value) {
|
|
216
|
-
return executeSchedule(subscriber, scheduler, function() {
|
|
217
|
-
return subscriber.next(value);
|
|
218
|
-
}, delay);
|
|
219
|
-
}, function() {
|
|
220
|
-
return executeSchedule(subscriber, scheduler, function() {
|
|
221
|
-
return subscriber.complete();
|
|
222
|
-
}, delay);
|
|
223
|
-
}, function(err) {
|
|
224
|
-
return executeSchedule(subscriber, scheduler, function() {
|
|
225
|
-
return subscriber.error(err);
|
|
226
|
-
}, delay);
|
|
227
|
-
}));
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
function subscribeOn(scheduler, delay) {
|
|
231
|
-
if (delay === void 0) {
|
|
232
|
-
delay = 0;
|
|
233
|
-
}
|
|
234
|
-
return operate(function(source, subscriber) {
|
|
235
|
-
subscriber.add(scheduler.schedule(function() {
|
|
236
|
-
return source.subscribe(subscriber);
|
|
237
|
-
}, delay));
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
function scheduleObservable(input, scheduler) {
|
|
241
|
-
return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));
|
|
242
|
-
}
|
|
243
|
-
function schedulePromise(input, scheduler) {
|
|
244
|
-
return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));
|
|
245
|
-
}
|
|
246
|
-
function scheduleArray(input, scheduler) {
|
|
247
|
-
return new Observable(function(subscriber) {
|
|
248
|
-
var i = 0;
|
|
249
|
-
return scheduler.schedule(function() {
|
|
250
|
-
if (i === input.length) {
|
|
251
|
-
subscriber.complete();
|
|
252
|
-
} else {
|
|
253
|
-
subscriber.next(input[i++]);
|
|
254
|
-
if (!subscriber.closed) {
|
|
255
|
-
this.schedule();
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
function scheduleIterable(input, scheduler) {
|
|
262
|
-
return new Observable(function(subscriber) {
|
|
263
|
-
var iterator$1;
|
|
264
|
-
executeSchedule(subscriber, scheduler, function() {
|
|
265
|
-
iterator$1 = input[iterator]();
|
|
266
|
-
executeSchedule(subscriber, scheduler, function() {
|
|
267
|
-
var _a;
|
|
268
|
-
var value;
|
|
269
|
-
var done;
|
|
270
|
-
try {
|
|
271
|
-
_a = iterator$1.next(), value = _a.value, done = _a.done;
|
|
272
|
-
} catch (err) {
|
|
273
|
-
subscriber.error(err);
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
if (done) {
|
|
277
|
-
subscriber.complete();
|
|
278
|
-
} else {
|
|
279
|
-
subscriber.next(value);
|
|
280
|
-
}
|
|
281
|
-
}, 0, true);
|
|
282
|
-
});
|
|
283
|
-
return function() {
|
|
284
|
-
return isFunction(iterator$1 === null || iterator$1 === void 0 ? void 0 : iterator$1.return) && iterator$1.return();
|
|
285
|
-
};
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
function scheduleAsyncIterable(input, scheduler) {
|
|
289
|
-
if (!input) {
|
|
290
|
-
throw new Error("Iterable cannot be null");
|
|
291
|
-
}
|
|
292
|
-
return new Observable(function(subscriber) {
|
|
293
|
-
executeSchedule(subscriber, scheduler, function() {
|
|
294
|
-
var iterator2 = input[Symbol.asyncIterator]();
|
|
295
|
-
executeSchedule(subscriber, scheduler, function() {
|
|
296
|
-
iterator2.next().then(function(result) {
|
|
297
|
-
if (result.done) {
|
|
298
|
-
subscriber.complete();
|
|
299
|
-
} else {
|
|
300
|
-
subscriber.next(result.value);
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
|
-
}, 0, true);
|
|
304
|
-
});
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
function scheduleReadableStreamLike(input, scheduler) {
|
|
308
|
-
return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input), scheduler);
|
|
309
|
-
}
|
|
310
|
-
function scheduled(input, scheduler) {
|
|
311
|
-
if (input != null) {
|
|
312
|
-
if (isInteropObservable(input)) {
|
|
313
|
-
return scheduleObservable(input, scheduler);
|
|
314
|
-
}
|
|
315
|
-
if (isArrayLike(input)) {
|
|
316
|
-
return scheduleArray(input, scheduler);
|
|
317
|
-
}
|
|
318
|
-
if (isPromise(input)) {
|
|
319
|
-
return schedulePromise(input, scheduler);
|
|
320
|
-
}
|
|
321
|
-
if (isAsyncIterable(input)) {
|
|
322
|
-
return scheduleAsyncIterable(input, scheduler);
|
|
323
|
-
}
|
|
324
|
-
if (isIterable(input)) {
|
|
325
|
-
return scheduleIterable(input, scheduler);
|
|
326
|
-
}
|
|
327
|
-
if (isReadableStreamLike(input)) {
|
|
328
|
-
return scheduleReadableStreamLike(input, scheduler);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
throw createInvalidObservableTypeError(input);
|
|
332
|
-
}
|
|
333
|
-
function from(input, scheduler) {
|
|
334
|
-
return scheduler ? scheduled(input, scheduler) : innerFrom(input);
|
|
335
|
-
}
|
|
336
|
-
function of() {
|
|
337
|
-
var args = [];
|
|
338
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
339
|
-
args[_i] = arguments[_i];
|
|
340
|
-
}
|
|
341
|
-
var scheduler = popScheduler(args);
|
|
342
|
-
return from(args, scheduler);
|
|
343
|
-
}
|
|
344
|
-
function firstValueFrom(source, config) {
|
|
345
|
-
return new Promise(function(resolve, reject) {
|
|
346
|
-
var subscriber = new SafeSubscriber({
|
|
347
|
-
next: function(value) {
|
|
348
|
-
resolve(value);
|
|
349
|
-
subscriber.unsubscribe();
|
|
350
|
-
},
|
|
351
|
-
error: reject,
|
|
352
|
-
complete: function() {
|
|
353
|
-
{
|
|
354
|
-
reject(new EmptyError());
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
});
|
|
358
|
-
source.subscribe(subscriber);
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
178
|
function isValidDate(value) {
|
|
362
179
|
return value instanceof Date && !isNaN(value);
|
|
363
180
|
}
|
|
@@ -397,42 +214,6 @@ function interval(period, scheduler) {
|
|
|
397
214
|
}
|
|
398
215
|
return timer(period, period, scheduler);
|
|
399
216
|
}
|
|
400
|
-
function take(count) {
|
|
401
|
-
return count <= 0 ? function() {
|
|
402
|
-
return EMPTY;
|
|
403
|
-
} : operate(function(source, subscriber) {
|
|
404
|
-
var seen = 0;
|
|
405
|
-
source.subscribe(createOperatorSubscriber(subscriber, function(value) {
|
|
406
|
-
if (++seen <= count) {
|
|
407
|
-
subscriber.next(value);
|
|
408
|
-
if (count <= seen) {
|
|
409
|
-
subscriber.complete();
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
}));
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
function timeInterval(scheduler) {
|
|
416
|
-
if (scheduler === void 0) {
|
|
417
|
-
scheduler = asyncScheduler;
|
|
418
|
-
}
|
|
419
|
-
return operate(function(source, subscriber) {
|
|
420
|
-
var last2 = scheduler.now();
|
|
421
|
-
source.subscribe(createOperatorSubscriber(subscriber, function(value) {
|
|
422
|
-
var now = scheduler.now();
|
|
423
|
-
var interval2 = now - last2;
|
|
424
|
-
last2 = now;
|
|
425
|
-
subscriber.next(new TimeInterval(value, interval2));
|
|
426
|
-
}));
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
var TimeInterval = /* @__PURE__ */ function() {
|
|
430
|
-
function TimeInterval2(value, interval2) {
|
|
431
|
-
this.value = value;
|
|
432
|
-
this.interval = interval2;
|
|
433
|
-
}
|
|
434
|
-
return TimeInterval2;
|
|
435
|
-
}();
|
|
436
217
|
var client = {};
|
|
437
218
|
var m = require$$0;
|
|
438
219
|
if (process.env.NODE_ENV === "production") {
|
|
@@ -747,7 +528,7 @@ class RomaMockedServiceDiscovery {
|
|
|
747
528
|
this.environment = {
|
|
748
529
|
type: "",
|
|
749
530
|
clientId: "",
|
|
750
|
-
services:
|
|
531
|
+
services: []
|
|
751
532
|
};
|
|
752
533
|
this.configureClient = cy.stub().as("configureClient");
|
|
753
534
|
this.createClient = cy.stub().as("createClient.sd");
|
|
@@ -764,7 +545,7 @@ class RomaMockedServiceDiscovery {
|
|
|
764
545
|
});
|
|
765
546
|
}
|
|
766
547
|
async resolveServices() {
|
|
767
|
-
return this.environment;
|
|
548
|
+
return this.environment.services;
|
|
768
549
|
}
|
|
769
550
|
}
|
|
770
551
|
const _logger = {
|
|
@@ -820,7 +601,7 @@ class RomaMockedAuthModule {
|
|
|
820
601
|
}
|
|
821
602
|
acquireAccessToken(req) {
|
|
822
603
|
return Promise.resolve(
|
|
823
|
-
"part1." + window.btoa('{"roles": ["role1", "role2"]}') + ".part3"
|
|
604
|
+
"part1." + window.btoa('{"roles": ["role1", "role2", "TRADE_ASSISTANCE_READ"]}') + ".part3"
|
|
824
605
|
);
|
|
825
606
|
}
|
|
826
607
|
acquireToken(req) {
|
|
@@ -928,156 +709,45 @@ class RomaMockedHttpClient {
|
|
|
928
709
|
return this.createClient();
|
|
929
710
|
}
|
|
930
711
|
}
|
|
931
|
-
const mockMessages = [
|
|
932
|
-
{
|
|
933
|
-
id: "fe96f880-220d-4b4e-b30d-eabc9b9d2101",
|
|
934
|
-
subject: "Price.Curve.Built",
|
|
935
|
-
created: "2023-11-10T13:45:01.8148405Z",
|
|
936
|
-
correlationId: "0613b3b1-d74a-4818-8b34-dc63157fb6bd",
|
|
937
|
-
sourceApplication: "Morningstar",
|
|
938
|
-
payloadScheme: "https://schemas.mss.equinor.com/morningstar/v1/curvebuilt",
|
|
939
|
-
message: "Delivery 12345/6 updated",
|
|
940
|
-
payload: {
|
|
941
|
-
curve: "CRUDE_MARS-ARGUS-VS-WTI-AYV_ARGUS-CME_BBL_USD",
|
|
942
|
-
deliveryDates: 62,
|
|
943
|
-
pubDate: "2023-11-10",
|
|
944
|
-
feed: "Equinor_CrudeCurves"
|
|
945
|
-
},
|
|
946
|
-
environment: "prod",
|
|
947
|
-
version: "1.0"
|
|
948
|
-
},
|
|
949
|
-
{
|
|
950
|
-
id: "a1b2c3d4-5678-90ab-cdef-1234567890ab",
|
|
951
|
-
subject: "Trade.Confirmed",
|
|
952
|
-
created: "2023-11-11T09:30:00.000Z",
|
|
953
|
-
correlationId: "1234abcd-5678-efgh-ijkl-1234567890mn",
|
|
954
|
-
sourceApplication: "TradeApp",
|
|
955
|
-
payloadScheme: "https://schemas.mss.equinor.com/trade/v1/confirmed",
|
|
956
|
-
message: "Trade 98765 confirmed",
|
|
957
|
-
payload: {
|
|
958
|
-
tradeId: "98765",
|
|
959
|
-
product: "Brent Crude",
|
|
960
|
-
quantity: 1e3,
|
|
961
|
-
price: 75.5,
|
|
962
|
-
tradeDate: "2023-11-11"
|
|
963
|
-
},
|
|
964
|
-
environment: "prod",
|
|
965
|
-
version: "1.0"
|
|
966
|
-
},
|
|
967
|
-
{
|
|
968
|
-
id: "b2c3d4e5-6789-01ab-cdef-2345678901bc",
|
|
969
|
-
subject: "Cargo.Arrived",
|
|
970
|
-
created: "2023-11-12T14:15:00.000Z",
|
|
971
|
-
correlationId: "2345bcde-6789-fghi-jklm-2345678901op",
|
|
972
|
-
sourceApplication: "CargoApp",
|
|
973
|
-
payloadScheme: "https://schemas.mss.equinor.com/cargo/v1/arrived",
|
|
974
|
-
message: "Cargo 54321 arrived at destination",
|
|
975
|
-
payload: {
|
|
976
|
-
cargoId: "54321",
|
|
977
|
-
destination: "Rotterdam",
|
|
978
|
-
arrivalDate: "2023-11-12"
|
|
979
|
-
},
|
|
980
|
-
environment: "prod",
|
|
981
|
-
version: "1.0"
|
|
982
|
-
},
|
|
983
|
-
{
|
|
984
|
-
id: "c3d4e5f6-7890-12ab-cdef-3456789012cd",
|
|
985
|
-
subject: "Inspection.Completed",
|
|
986
|
-
created: "2023-11-13T11:00:00.000Z",
|
|
987
|
-
correlationId: "3456cdef-7890-ghij-klmn-3456789012qr",
|
|
988
|
-
sourceApplication: "InspectionApp",
|
|
989
|
-
payloadScheme: "https://schemas.mss.equinor.com/inspection/v1/completed",
|
|
990
|
-
message: "Inspection 67890 completed",
|
|
991
|
-
payload: {
|
|
992
|
-
inspectionId: "67890",
|
|
993
|
-
result: "Passed",
|
|
994
|
-
inspector: "John Doe",
|
|
995
|
-
inspectionDate: "2023-11-13"
|
|
996
|
-
},
|
|
997
|
-
environment: "prod",
|
|
998
|
-
version: "1.0"
|
|
999
|
-
},
|
|
1000
|
-
{
|
|
1001
|
-
id: "d4e5f6g7-8901-23ab-cdef-4567890123de",
|
|
1002
|
-
subject: "Maintenance.Scheduled",
|
|
1003
|
-
created: "2023-11-14T08:45:00.000Z",
|
|
1004
|
-
correlationId: "4567defg-8901-hijk-lmno-4567890123st",
|
|
1005
|
-
sourceApplication: "MaintenanceApp",
|
|
1006
|
-
payloadScheme: "https://schemas.mss.equinor.com/maintenance/v1/scheduled",
|
|
1007
|
-
message: "Maintenance for equipment 12345 scheduled",
|
|
1008
|
-
payload: {
|
|
1009
|
-
equipmentId: "12345",
|
|
1010
|
-
maintenanceDate: "2023-11-20",
|
|
1011
|
-
technician: "Jane Smith"
|
|
1012
|
-
},
|
|
1013
|
-
environment: "prod",
|
|
1014
|
-
version: "1.0"
|
|
1015
|
-
}
|
|
1016
|
-
];
|
|
1017
712
|
class Connection {
|
|
1018
|
-
constructor() {
|
|
1019
|
-
this.messageList = new BehaviorSubject([
|
|
1020
|
-
{
|
|
1021
|
-
id: "fe96f880-220d-4b4e-b30d-eabc9b9d2101",
|
|
1022
|
-
subject: "Price. Curve. Built",
|
|
1023
|
-
created: "2023-11-10T13:45:01.8148405Z",
|
|
1024
|
-
correlationId: "0613b3b1-d74a-4818-8b34-dc63157fb6bd",
|
|
1025
|
-
sourceApplication: "Morningstar",
|
|
1026
|
-
payloadScheme: "https:// schemas. mss. equinor. com/ morningstar/ v1/ curvebuilt",
|
|
1027
|
-
message: "Delivery 12345/ 6 updated",
|
|
1028
|
-
payload: {
|
|
1029
|
-
curve: "CRUDE_MARS-ARGUS-VS-WTI-AYV_ARGUS-CME_BBL_USD",
|
|
1030
|
-
deliveryDates: 62,
|
|
1031
|
-
pubDate: "2023-11-10",
|
|
1032
|
-
feed: "Equinor_CrudeCurves"
|
|
1033
|
-
},
|
|
1034
|
-
environment: "prod",
|
|
1035
|
-
version: "1.0"
|
|
1036
|
-
}
|
|
1037
|
-
]);
|
|
713
|
+
constructor(messages = []) {
|
|
1038
714
|
this.interval$ = interval(50);
|
|
1039
|
-
this.
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
map((v) => mockMessages.slice(0, v.value + 1))
|
|
1043
|
-
);
|
|
715
|
+
this.setReadState = cy.stub().as("setReadState");
|
|
716
|
+
this.messageList = new BehaviorSubject(messages);
|
|
717
|
+
this.messageList$ = this.messageList;
|
|
1044
718
|
}
|
|
1045
719
|
async setAllRead() {
|
|
1046
720
|
const currentValues = await firstValueFrom(this.messageList);
|
|
1047
721
|
const newValues = [...currentValues].map((v) => ({ ...v, read: true }));
|
|
1048
722
|
this.messageList.next(newValues);
|
|
1049
723
|
}
|
|
1050
|
-
async setReadState(eventId, read) {
|
|
1051
|
-
const currentValues = await firstValueFrom(this.messageList);
|
|
1052
|
-
const newValues = [...currentValues];
|
|
1053
|
-
const currentEventIndex = newValues.findIndex((e) => e.id === eventId);
|
|
1054
|
-
if (currentEventIndex >= 0) {
|
|
1055
|
-
newValues[currentEventIndex] = {
|
|
1056
|
-
...newValues[currentEventIndex],
|
|
1057
|
-
read
|
|
1058
|
-
};
|
|
1059
|
-
} else {
|
|
1060
|
-
newValues.push({
|
|
1061
|
-
...newValues[currentEventIndex],
|
|
1062
|
-
read
|
|
1063
|
-
});
|
|
1064
|
-
}
|
|
1065
|
-
this.messageList.next(newValues);
|
|
1066
|
-
}
|
|
1067
724
|
}
|
|
1068
725
|
class RomaMockedSseModule {
|
|
726
|
+
constructor(messageList = []) {
|
|
727
|
+
this.messageList = messageList;
|
|
728
|
+
const connection = this.connect("activity");
|
|
729
|
+
this.connections = new Proxy(
|
|
730
|
+
{},
|
|
731
|
+
{
|
|
732
|
+
get: () => connection
|
|
733
|
+
}
|
|
734
|
+
);
|
|
735
|
+
}
|
|
1069
736
|
connect(name) {
|
|
1070
|
-
return new Connection();
|
|
737
|
+
return new Connection(this.messageList ?? []);
|
|
1071
738
|
}
|
|
1072
739
|
createConnection(name, options) {
|
|
1073
740
|
}
|
|
1074
741
|
}
|
|
1075
|
-
const RomaCypressWrapper = ({
|
|
742
|
+
const RomaCypressWrapper = ({
|
|
743
|
+
children,
|
|
744
|
+
events
|
|
745
|
+
}) => {
|
|
1076
746
|
const navigation = new RomaMockedNavigationModule();
|
|
1077
747
|
const http = new RomaMockedHttpClient();
|
|
1078
748
|
const auth = new RomaMockedAuthModule();
|
|
1079
749
|
const serviceDiscovery = new RomaMockedServiceDiscovery();
|
|
1080
|
-
const sse = new RomaMockedSseModule();
|
|
750
|
+
const sse = new RomaMockedSseModule(events ?? []);
|
|
1081
751
|
return /* @__PURE__ */ jsx(
|
|
1082
752
|
FrameworkProvider,
|
|
1083
753
|
{
|
|
@@ -1125,7 +795,11 @@ const RomaCypressWrapper = ({ children }) => {
|
|
|
1125
795
|
);
|
|
1126
796
|
};
|
|
1127
797
|
const mount = (component, options = {}) => {
|
|
1128
|
-
|
|
798
|
+
var _a;
|
|
799
|
+
return mount$1(
|
|
800
|
+
/* @__PURE__ */ jsx(RomaCypressWrapper, { events: (_a = options.moduleConfig) == null ? void 0 : _a.events, children: component }),
|
|
801
|
+
options
|
|
802
|
+
);
|
|
1129
803
|
};
|
|
1130
804
|
export {
|
|
1131
805
|
mount
|
package/dev-portal/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './lib/dev-portal/ErrorViewer';
|
|
|
4
4
|
export * from './lib/dev-portal/AppLoader';
|
|
5
5
|
export * from './lib/dev-portal/AppViewer';
|
|
6
6
|
export * from './lib/dev-portal/Header';
|
|
7
|
+
export * from './lib/dev-portal/config/config';
|
|
7
8
|
export * from './lib/style-provider';
|
|
8
9
|
export * from './lib/dev-portal/HttpErrorViewer';
|
|
9
10
|
export * from './lib/api/roma';
|
|
@@ -13,3 +14,4 @@ export * from './lib/query/persister';
|
|
|
13
14
|
export * from './lib/hooks/use-get-api-roles';
|
|
14
15
|
export * from './lib/hooks/use-has-api-role';
|
|
15
16
|
export * from './lib/error-handlers/http-error-handler';
|
|
17
|
+
export * from './lib/hooks/use-manage-watch-list';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { IHttpClient } from '@equinor/fusion-framework-react-module-http';
|
|
1
2
|
import { AzureResponse } from '../../model/azure-response';
|
|
3
|
+
export declare const findUsersByMail: <T extends string>(client: IHttpClient, email: Array<string>, fields: ReadonlyArray<T>) => Promise<AzureResponse<readonly T[]>>;
|
|
2
4
|
export declare const useFindUsersByMail: (email: Array<string> | string, fields?: readonly ["displayName", "mail", "givenName"]) => import('@tanstack/react-query').UseQueryResult<AzureResponse<readonly ("displayName" | "mail" | "givenName")[]>, Error>;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { AppManifest } from '@equinor/fusion-framework-module-app';
|
|
3
|
-
import { QueryClientError } from '@equinor/fusion-query/client';
|
|
4
|
-
type AppLoadError = QueryClientError & {
|
|
5
|
-
cause: {
|
|
6
|
-
data: unknown;
|
|
7
|
-
name: string;
|
|
8
|
-
response: Response;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
3
|
export declare const AppContext: import('react').Context<{
|
|
12
4
|
isLoading: boolean;
|
|
13
|
-
apps?: Array<AppManifest
|
|
5
|
+
apps?: Array<AppManifest & {
|
|
6
|
+
entry: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}>;
|
|
14
10
|
error?: AppLoadError;
|
|
15
11
|
}>;
|
|
16
12
|
type ErrorPageProps = {
|
|
@@ -22,11 +18,11 @@ export declare function AppLoadError({ errorCode, explanation, solution, }: Erro
|
|
|
22
18
|
export declare const AppProvider: ({ children }: {
|
|
23
19
|
children: ReactNode;
|
|
24
20
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export declare const useApps: ({ includeHidden
|
|
21
|
+
export declare const useApps: ({ includeHidden }?: {
|
|
26
22
|
includeHidden?: boolean;
|
|
27
23
|
}) => {
|
|
28
24
|
isLoading: boolean;
|
|
29
|
-
apps: AppManifest[];
|
|
30
25
|
error: AppLoadError | undefined;
|
|
26
|
+
apps: Array<AppManifest>;
|
|
31
27
|
};
|
|
32
28
|
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AppConfig, AppManifest, IAppClient } from '@equinor/fusion-framework-module-app';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { IHttpClient } from '@equinor/fusion-framework-module-http';
|
|
4
|
+
import { FetchRequest } from '@equinor/fusion-framework-module-http/client';
|
|
5
|
+
export declare class CustomAppClient implements IAppClient {
|
|
6
|
+
#private;
|
|
7
|
+
private client;
|
|
8
|
+
getAppConfig({}: {
|
|
9
|
+
appKey: string;
|
|
10
|
+
tag?: string;
|
|
11
|
+
}): Observable<AppConfig<any>>;
|
|
12
|
+
getAppManifest({ appKey }: {
|
|
13
|
+
appKey: string;
|
|
14
|
+
}): Observable<AppManifest>;
|
|
15
|
+
getAppManifests(): Observable<never[] | AppManifest[]>;
|
|
16
|
+
getAppSettings(): Observable<{}>;
|
|
17
|
+
updateAppSettings(): Observable<{}>;
|
|
18
|
+
constructor(client: IHttpClient<FetchRequest, Response>);
|
|
19
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Service } from '@equinor/fusion-framework-module-service-discovery';
|
|
2
|
+
export declare class ServiceDiscoveryClient {
|
|
3
|
+
private cache;
|
|
4
|
+
private cacheTime;
|
|
5
|
+
resolveService(key: string, allow_cache?: boolean): Promise<Service>;
|
|
6
|
+
resolveServices(allow_cache?: boolean): Promise<Array<Service>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export declare const useWatchDefaults: {
|
|
2
|
+
notificationSettings: {
|
|
3
|
+
cargo: {
|
|
4
|
+
fields: {
|
|
5
|
+
contractual: {
|
|
6
|
+
product: {
|
|
7
|
+
fieldName: string;
|
|
8
|
+
fieldLabel: string;
|
|
9
|
+
fieldEnabled: boolean;
|
|
10
|
+
};
|
|
11
|
+
quality: {
|
|
12
|
+
fieldName: string;
|
|
13
|
+
fieldLabel: string;
|
|
14
|
+
fieldEnabled: boolean;
|
|
15
|
+
};
|
|
16
|
+
contrquantity: {
|
|
17
|
+
fieldName: string;
|
|
18
|
+
fieldLabel: string;
|
|
19
|
+
fieldEnabled: boolean;
|
|
20
|
+
};
|
|
21
|
+
buyer: {
|
|
22
|
+
fieldName: string;
|
|
23
|
+
fieldLabel: string;
|
|
24
|
+
fieldEnabled: boolean;
|
|
25
|
+
};
|
|
26
|
+
seller: {
|
|
27
|
+
fieldName: string;
|
|
28
|
+
fieldLabel: string;
|
|
29
|
+
fieldEnabled: boolean;
|
|
30
|
+
};
|
|
31
|
+
incoterm: {
|
|
32
|
+
fieldName: string;
|
|
33
|
+
fieldLabel: string;
|
|
34
|
+
fieldEnabled: boolean;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
operational: {
|
|
38
|
+
status: {
|
|
39
|
+
fieldName: string;
|
|
40
|
+
fieldLabel: string;
|
|
41
|
+
fieldEnabled: boolean;
|
|
42
|
+
};
|
|
43
|
+
loadingrange: {
|
|
44
|
+
fieldName: string;
|
|
45
|
+
fieldLabel: string;
|
|
46
|
+
fieldEnabled: boolean;
|
|
47
|
+
};
|
|
48
|
+
dischargerange: {
|
|
49
|
+
fieldName: string;
|
|
50
|
+
fieldLabel: string;
|
|
51
|
+
fieldEnabled: boolean;
|
|
52
|
+
};
|
|
53
|
+
loadport: {
|
|
54
|
+
fieldName: string;
|
|
55
|
+
fieldLabel: string;
|
|
56
|
+
fieldEnabled: boolean;
|
|
57
|
+
};
|
|
58
|
+
dischargeport: {
|
|
59
|
+
fieldName: string;
|
|
60
|
+
fieldLabel: string;
|
|
61
|
+
fieldEnabled: boolean;
|
|
62
|
+
};
|
|
63
|
+
qty: {
|
|
64
|
+
fieldName: string;
|
|
65
|
+
fieldLabel: string;
|
|
66
|
+
fieldEnabled: boolean;
|
|
67
|
+
};
|
|
68
|
+
remarks: {
|
|
69
|
+
fieldName: string;
|
|
70
|
+
fieldLabel: string;
|
|
71
|
+
fieldEnabled: boolean;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
vessel: {
|
|
75
|
+
vesselname: {
|
|
76
|
+
fieldName: string;
|
|
77
|
+
fieldLabel: string;
|
|
78
|
+
fieldEnabled: boolean;
|
|
79
|
+
};
|
|
80
|
+
eta: {
|
|
81
|
+
fieldName: string;
|
|
82
|
+
fieldLabel: string;
|
|
83
|
+
fieldEnabled: boolean;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
settings: {
|
|
88
|
+
autowatch: {
|
|
89
|
+
opsResponsible: boolean;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
watchListSettings: {
|
|
95
|
+
cargo: {
|
|
96
|
+
watched: never[];
|
|
97
|
+
unwatched: never[];
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|