@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/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,3 @@
1
+ import { FrameworkConfigurator } from '@equinor/fusion-framework';
2
+ export declare const configure: (config: FrameworkConfigurator) => Promise<void>;
3
+ export default configure;
@@ -0,0 +1,7 @@
1
+ export declare const useManageWatchList: (system: "cargo") => {
2
+ watch(id: string): void;
3
+ unwatch(id: string): void;
4
+ watched(): (string | undefined)[];
5
+ unwatched(): (string | undefined)[];
6
+ isSaving: boolean;
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
+ };
@@ -4,18 +4,18 @@ import { NavigationType } from 'react-router-dom';
4
4
  import { Action } from '@remix-run/router/history';
5
5
  import { AccountInfo } from '@equinor/fusion-framework-module-msal';
6
6
  import { AuthClient, AuthRequest } from '@equinor/fusion-framework-module-msal/client';
7
- import { Environment, Service } from '@equinor/fusion-framework-module-service-discovery';
7
+ import { Service } from '@equinor/fusion-framework-module-service-discovery';
8
8
  import { ServerSentEvent, SseConnection } from '../../../../modules/sse/src/index.ts';
9
9
  export declare class RomaMockedServiceDiscovery {
10
10
  readonly environment: {
11
11
  type: string;
12
12
  clientId: string;
13
- services: {};
13
+ services: never[];
14
14
  };
15
15
  configureClient: Cypress.Omit<import('cypress/types/sinon').SinonStub<any[], any>, "withArgs"> & Cypress.SinonSpyAgent<import('cypress/types/sinon').SinonStub<any[], any>> & import('cypress/types/sinon').SinonStub<any[], any>;
16
16
  createClient: Cypress.Omit<import('cypress/types/sinon').SinonStub<any[], any>, "withArgs"> & Cypress.SinonSpyAgent<import('cypress/types/sinon').SinonStub<any[], any>> & import('cypress/types/sinon').SinonStub<any[], any>;
17
17
  resolveService(key: string): Promise<Service>;
18
- resolveServices(): Promise<Environment>;
18
+ resolveServices(): Promise<Array<Service>>;
19
19
  }
20
20
  export declare class RomaMockedAuthModule {
21
21
  readonly defaultAccount: AccountInfo;
@@ -98,12 +98,16 @@ declare class Connection implements SseConnection {
98
98
  abort: AbortController;
99
99
  messageList: BehaviorSubject<Array<ServerSentEvent>>;
100
100
  private interval$;
101
- messageList$: Observable<ServerSentEvent[]>;
101
+ messageList$: any;
102
102
  setAllRead(): Promise<void>;
103
- setReadState(eventId: string, read: boolean): Promise<void>;
103
+ setReadState: Cypress.Omit<import('cypress/types/sinon').SinonStub<any[], any>, "withArgs"> & Cypress.SinonSpyAgent<import('cypress/types/sinon').SinonStub<any[], any>> & import('cypress/types/sinon').SinonStub<any[], any>;
104
+ constructor(messages?: Array<ServerSentEvent>);
104
105
  }
105
106
  export declare class RomaMockedSseModule {
107
+ messageList: Array<ServerSentEvent>;
108
+ connections: Record<string, any>;
106
109
  connect(name: string): Connection;
107
110
  private createConnection;
111
+ constructor(messageList?: Array<ServerSentEvent>);
108
112
  }
109
113
  export {};
@@ -1,3 +1,10 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { MountOptions } from 'cypress/react18';
3
- export declare const mount: (component: ReactNode, options?: MountOptions) => Cypress.Chainable<import('cypress/react18').MountReturn>;
3
+ import { ServerSentEvent } from '../../../../modules/sse/src/index.ts';
4
+ type RomaMountOptions = MountOptions & {
5
+ moduleConfig?: {
6
+ events?: Array<ServerSentEvent>;
7
+ };
8
+ };
9
+ export declare const mount: (component: ReactNode, options?: RomaMountOptions) => Cypress.Chainable<import('cypress/react18').MountReturn>;
10
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/roma-framework",
3
- "version": "1.1.0",
3
+ "version": "2.0.0",
4
4
  "repository": "https://github.com/equinor/tops-roma",
5
5
  "types": "./index.d.ts",
6
6
  "private": false,
@@ -13,8 +13,9 @@
13
13
  "require": "./roma-framework.js"
14
14
  },
15
15
  "./cypress": {
16
- "import": "./cypress/roma-framework.mjs",
17
- "require": "./cypress/roma-framework.js"
16
+ "import": "./cypress.mjs",
17
+ "require": "./cypress.js",
18
+ "types": "./lib/test-utils/roma-cypress-wrapper.d.ts"
18
19
  }
19
20
  }
20
- }
21
+ }