@equinor/roma-framework 0.0.5-ALPHA → 0.0.5-ALPHA.1

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
@@ -5,4 +5,6 @@ export * from './lib/dev-portal/AppLoader';
5
5
  export * from './lib/dev-portal/AppViewer';
6
6
  export * from './lib/sse/useSse';
7
7
  export * from './lib/style-provider';
8
+ export * from './lib/dev-portal/HttpErrorViewer';
8
9
  export * from './lib/api/trade-recap';
10
+ export * from './lib/api/roma';
@@ -0,0 +1,21 @@
1
+ export type HttpErrorServerResponse = {
2
+ timestamp: string;
3
+ status: number;
4
+ error: string;
5
+ message: string;
6
+ path: string;
7
+ };
8
+ export type HttpErrorResponse = {
9
+ status: number;
10
+ statusText: string;
11
+ message: HttpErrorServerResponse;
12
+ ok: boolean;
13
+ headers: Headers;
14
+ url: string;
15
+ };
16
+ export declare class HttpError extends Error {
17
+ readonly message: string;
18
+ readonly response: HttpErrorResponse;
19
+ constructor(message: string, response: HttpErrorResponse);
20
+ }
21
+ export declare const handleJsonRequest: <T>(req: Response) => Promise<T>;
@@ -0,0 +1,7 @@
1
+ import { HttpResponseError } from '@equinor/fusion-framework-module-http';
2
+ import { EnvironmentResponse } from '@equinor/fusion-framework-module-service-discovery';
3
+ type Params = {
4
+ environment: 'current';
5
+ };
6
+ export declare const useGetEnvironment: (params: Params) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<EnvironmentResponse, HttpResponseError>;
7
+ export {};
@@ -0,0 +1 @@
1
+ export * from './get-environment';
@@ -0,0 +1,6 @@
1
+ import { HttpResponseError } from '@equinor/fusion-framework-module-http';
2
+ type Params = Partial<{
3
+ dealId: number;
4
+ }>;
5
+ export declare const useDownloadRecap: (params: Params) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<Blob, HttpResponseError>;
6
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { Response } from './deal';
2
+ import { HttpError } from '../fetcher';
2
3
  type Params = {
3
4
  dsYears: Array<number>;
4
5
  pageSize: number;
@@ -10,5 +11,5 @@ type Params = {
10
11
  page: number;
11
12
  salesOffices: Array<string>;
12
13
  };
13
- export declare const useGetDeals: (params: Params) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<Response, Error>;
14
+ export declare const useGetDeals: (params: Params) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<Response, HttpError>;
14
15
  export {};
@@ -2,3 +2,4 @@ export * from './get-deals';
2
2
  export * from './deal';
3
3
  export * from './get-recap';
4
4
  export * from './recap';
5
+ export * from './download-recap';
@@ -0,0 +1,13 @@
1
+ import { HttpError } from '../api/fetcher';
2
+ /**
3
+ * Simple error display component.
4
+ * Does not create a pretty error, and should most likely be recreated for various error types (e.g. lack of access etc.)
5
+ * Reasonable to assume this will be a part of e.g. @equinor/roma-components in the future.
6
+ *
7
+ * @param error
8
+ * @constructor
9
+ */
10
+ export declare const HttpErrorViewer: ({ error }: {
11
+ readonly error: HttpError;
12
+ }) => import("react/jsx-runtime").JSX.Element;
13
+ export default HttpErrorViewer;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@equinor/roma-framework",
3
- "version": "0.0.5-ALPHA",
3
+ "version": "0.0.5-ALPHA.1",
4
4
  "repository": "https://github.com/equinor/tops-roma",
5
- "main": "./framework.js",
5
+ "main": "./roma-framework.js",
6
6
  "types": "./index.d.ts",
7
7
  "private": false,
8
8
  "dependencies": {
@@ -10,8 +10,8 @@
10
10
  },
11
11
  "exports": {
12
12
  ".": {
13
- "import": "./framework.mjs",
14
- "require": "./framework.js"
13
+ "import": "./roma-framework.mjs",
14
+ "require": "./roma-framework.js"
15
15
  }
16
16
  }
17
17
  }