@equinor/roma-framework 0.0.10 → 0.0.11

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.
Files changed (38) hide show
  1. package/dev-portal/lib/api/roma/model/romaConfigurationDtoValue.d.ts +1 -3
  2. package/dev-portal/lib/api/roma/model/serverSentEventActivityLogDto.d.ts +1 -3
  3. package/dev-portal/lib/api/roma/model/serverSentEventStandardEventDto.d.ts +1 -3
  4. package/dev-portal/lib/api/roma/model/settingDtoValue.d.ts +1 -3
  5. package/dev-portal/lib/dev-portal/ErrorViewer.d.ts +8 -0
  6. package/dev-portal/lib/dev-portal/Navigation.d.ts +1 -1
  7. package/dev-portal/lib/query/persister.d.ts +6 -0
  8. package/dev-portal/package.json +1 -1
  9. package/dev-portal/roma-framework.umd.js +1186 -5361
  10. package/index.d.ts +1 -1
  11. package/lib/api/fetcher.d.ts +4 -4
  12. package/lib/api/roma/model/romaConfigurationDtoValue.d.ts +1 -3
  13. package/lib/api/roma/model/serverSentEventActivityLogDto.d.ts +1 -3
  14. package/lib/api/roma/model/serverSentEventStandardEventDto.d.ts +1 -3
  15. package/lib/api/roma/model/settingDtoValue.d.ts +1 -3
  16. package/lib/dev-portal/ErrorViewer.d.ts +8 -0
  17. package/lib/query/persister.d.ts +6 -0
  18. package/package.json +1 -1
  19. package/roma-framework.mjs +93 -102
  20. package/dev-portal/index.d.ts +0 -12
  21. package/dev-portal/lib/api/fetcher.d.ts +0 -21
  22. package/dev-portal/lib/api/trade-recap/deal.d.ts +0 -160
  23. package/dev-portal/lib/api/trade-recap/download-recap.d.ts +0 -6
  24. package/dev-portal/lib/api/trade-recap/get-deals.d.ts +0 -15
  25. package/dev-portal/lib/api/trade-recap/get-recap.d.ts +0 -11
  26. package/dev-portal/lib/api/trade-recap/index.d.ts +0 -5
  27. package/dev-portal/lib/api/trade-recap/recap.d.ts +0 -22
  28. package/dev-portal/lib/api/util.d.ts +0 -1
  29. package/dev-portal/lib/dev-portal/HttpErrorViewer.d.ts +0 -13
  30. package/dev-portal/lib/hooks/use-get-api-roles.d.ts +0 -14
  31. package/dev-portal/lib/hooks/use-has-api-role.d.ts +0 -7
  32. package/lib/api/trade-recap/deal.d.ts +0 -160
  33. package/lib/api/trade-recap/download-recap.d.ts +0 -6
  34. package/lib/api/trade-recap/get-deals.d.ts +0 -15
  35. package/lib/api/trade-recap/get-recap.d.ts +0 -11
  36. package/lib/api/trade-recap/index.d.ts +0 -5
  37. package/lib/api/trade-recap/recap.d.ts +0 -22
  38. package/lib/api/util.d.ts +0 -1
package/index.d.ts CHANGED
@@ -5,8 +5,8 @@ export * from './lib/dev-portal/AppLoader';
5
5
  export * from './lib/dev-portal/AppViewer';
6
6
  export * from './lib/style-provider';
7
7
  export * from './lib/dev-portal/HttpErrorViewer';
8
- export * from './lib/api/trade-recap';
9
8
  export * from './lib/api/roma';
10
9
  export * from './lib/app-provider';
10
+ export * from './lib/query/persister';
11
11
  export * from './lib/hooks/use-get-api-roles';
12
12
  export * from './lib/hooks/use-has-api-role';
@@ -1,18 +1,18 @@
1
- export type HttpErrorServerResponse = {
1
+ export interface HttpErrorServerResponse {
2
2
  timestamp: string;
3
3
  status: number;
4
4
  error: string;
5
5
  message: string;
6
6
  path: string;
7
- };
8
- export type HttpErrorResponse = {
7
+ }
8
+ export interface HttpErrorResponse {
9
9
  status: number;
10
10
  statusText: string;
11
11
  message: HttpErrorServerResponse;
12
12
  ok: boolean;
13
13
  headers: Headers;
14
14
  url: string;
15
- };
15
+ }
16
16
  export declare class HttpError extends Error {
17
17
  readonly message: string;
18
18
  readonly response: HttpErrorResponse;
@@ -5,6 +5,4 @@
5
5
  * Tops Roma Rest API
6
6
  * OpenAPI spec version: v1.0.0
7
7
  */
8
- export type RomaConfigurationDtoValue = {
9
- [key: string]: any;
10
- };
8
+ export type RomaConfigurationDtoValue = Record<string, any>;
@@ -5,6 +5,4 @@
5
5
  * Tops Roma Rest API
6
6
  * OpenAPI spec version: v1.0.0
7
7
  */
8
- export interface ServerSentEventActivityLogDto {
9
- [key: string]: any;
10
- }
8
+ export type ServerSentEventActivityLogDto = Record<string, any>;
@@ -5,6 +5,4 @@
5
5
  * Tops Roma Rest API
6
6
  * OpenAPI spec version: v1.0.0
7
7
  */
8
- export interface ServerSentEventStandardEventDto {
9
- [key: string]: any;
10
- }
8
+ export type ServerSentEventStandardEventDto = Record<string, any>;
@@ -5,6 +5,4 @@
5
5
  * Tops Roma Rest API
6
6
  * OpenAPI spec version: v1.0.0
7
7
  */
8
- export type SettingDtoValue = {
9
- [key: string]: any;
10
- };
8
+ export type SettingDtoValue = Record<string, any>;
@@ -1,3 +1,4 @@
1
+ import { ReactElement, CSSProperties } from 'react';
1
2
  /**
2
3
  * Simple error display component.
3
4
  * Does not create a pretty error, and should most likely be recreated for various error types (e.g. lack of access etc.)
@@ -9,4 +10,11 @@
9
10
  export declare const ErrorViewer: ({ error }: {
10
11
  readonly error: Error;
11
12
  }) => import("react/jsx-runtime").JSX.Element;
13
+ type ErrorProps = {
14
+ title?: string;
15
+ message: string;
16
+ style?: CSSProperties;
17
+ actions?: ReactElement;
18
+ };
19
+ export declare const RomaErrorViewer: ({ style, title, message, actions, }: ErrorProps) => import("react/jsx-runtime").JSX.Element;
12
20
  export default ErrorViewer;
@@ -0,0 +1,6 @@
1
+ import { Persister } from '@tanstack/react-query-persist-client';
2
+ /**
3
+ * Creates an Indexed DB persister
4
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
5
+ */
6
+ export declare function createIDBPersister(idbValidKey?: IDBValidKey): Persister;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/roma-framework",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "repository": "https://github.com/equinor/tops-roma",
5
5
  "types": "./index.d.ts",
6
6
  "private": false,
@@ -5014,6 +5014,28 @@ const ErrorViewer = ({ error }) => {
5014
5014
  /* @__PURE__ */ jsx(Card.Content, { children: /* @__PURE__ */ jsx("pre", { style: { whiteSpace: "pre-wrap" }, children: error.stack ?? "Error" }) })
5015
5015
  ] });
5016
5016
  };
5017
+ const RomaErrorViewer = ({
5018
+ style,
5019
+ title,
5020
+ message,
5021
+ actions
5022
+ }) => {
5023
+ return /* @__PURE__ */ jsxs(
5024
+ Card,
5025
+ {
5026
+ variant: "danger",
5027
+ style: {
5028
+ width: 600,
5029
+ ...style ?? {}
5030
+ },
5031
+ children: [
5032
+ title && /* @__PURE__ */ jsx(Card.Header, { children: /* @__PURE__ */ jsx(Card.HeaderTitle, { children: /* @__PURE__ */ jsx(Typography, { variant: "h4", children: title }) }) }),
5033
+ /* @__PURE__ */ jsx(Card.Content, { style: { paddingTop: title ? 0 : 16, paddingBottom: 16 }, children: /* @__PURE__ */ jsx(Typography, { variant: "body_long", style: { whiteSpace: "pre-line" }, children: message }) }),
5034
+ actions && /* @__PURE__ */ jsx(Card.Actions, { children: actions })
5035
+ ]
5036
+ }
5037
+ );
5038
+ };
5017
5039
  function getAppModule(app, framework) {
5018
5040
  const initializeData = {
5019
5041
  appKey: app.key,
@@ -5036,7 +5058,7 @@ function AppLoader({
5036
5058
  }) {
5037
5059
  const queryClient = useQueryClient();
5038
5060
  kind = kind ?? "widget";
5039
- const { setCurrentApp, clearCurrentApp, currentApp } = useCurrentApp();
5061
+ const { setCurrentApp, clearCurrentApp } = useCurrentApp();
5040
5062
  const framework = useFramework();
5041
5063
  const [error, setError] = useState(null);
5042
5064
  const [loading, setLoading] = useState(false);
@@ -5279,102 +5301,6 @@ const HttpErrorViewer = ({ error }) => {
5279
5301
  }
5280
5302
  );
5281
5303
  };
5282
- const createUrlParamsFromObject = (obj) => {
5283
- const params = new URLSearchParams();
5284
- Object.keys(obj).forEach((key) => {
5285
- if (obj[key] === null || typeof obj[key] === "undefined")
5286
- return;
5287
- if (Array.isArray(obj[key])) {
5288
- obj[key].forEach((v) => {
5289
- params.append(key, v.toString());
5290
- });
5291
- } else if (typeof obj[key] === "string") {
5292
- params.append(key, obj[key]);
5293
- } else if (typeof obj[key] === "number" || typeof obj[key] === "boolean") {
5294
- params.append(key, obj[key].toString());
5295
- } else
5296
- ;
5297
- });
5298
- return params;
5299
- };
5300
- let HttpError$1 = class HttpError extends Error {
5301
- constructor(message, response) {
5302
- super(message);
5303
- this.message = message;
5304
- this.response = response;
5305
- }
5306
- };
5307
- const handleJsonRequest = async (req) => {
5308
- if (req.status >= 400) {
5309
- let msg;
5310
- try {
5311
- msg = await req.json();
5312
- } catch {
5313
- msg = {
5314
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
5315
- status: 0,
5316
- error: req.statusText,
5317
- message: req.statusText,
5318
- path: req.url
5319
- };
5320
- }
5321
- const error = {
5322
- status: req.status,
5323
- statusText: req.statusText,
5324
- message: msg,
5325
- ok: false,
5326
- headers: req.headers,
5327
- url: req.url
5328
- };
5329
- throw new HttpError$1(req.statusText, error);
5330
- }
5331
- return await req.json();
5332
- };
5333
- const fetchDeals = async (params, client) => {
5334
- const query = createUrlParamsFromObject(params);
5335
- const req = await client.fetch(`deal?${query.toString()}`);
5336
- return await handleJsonRequest(req);
5337
- };
5338
- const useGetDeals = (params) => {
5339
- const queryKey = ["deal-list", "recap-list", params];
5340
- const client = useHttpClient("ratscore");
5341
- return useQuery({
5342
- queryKey,
5343
- retry: (attempts, err) => attempts < 2 && err.response.status < 500,
5344
- queryFn: () => fetchDeals(params, client)
5345
- });
5346
- };
5347
- const fetchRecap = async (params, client) => {
5348
- const { companyId, so, dsYear, dsId, dsNo } = params;
5349
- return client.json(
5350
- `deal/${companyId}/${so}/${dsYear}/${dsId}/${dsNo}`
5351
- );
5352
- };
5353
- const useGetRecap = (params) => {
5354
- const client = useHttpClient("ratscore");
5355
- const queryKeys = ["recap", params];
5356
- return useQuery({
5357
- queryKey: queryKeys,
5358
- queryFn: () => fetchRecap(params, client)
5359
- });
5360
- };
5361
- const downloadRecap = async (params, client) => {
5362
- const { dealId } = params;
5363
- const headers = new Headers();
5364
- headers.append("Accept", "application/pdf");
5365
- return client.blob(`deal/${dealId}/external`, {
5366
- headers
5367
- });
5368
- };
5369
- const useDownloadRecap = (params) => {
5370
- const client = useHttpClient("ratscore");
5371
- const queryKeys = ["recap", params];
5372
- return useQuery({
5373
- queryKey: queryKeys,
5374
- queryFn: () => downloadRecap(params, client),
5375
- enabled: !!params.dealId
5376
- });
5377
- };
5378
5304
  const useCustomClient = () => {
5379
5305
  const client = useHttpClient("portal");
5380
5306
  return async ({
@@ -5413,7 +5339,7 @@ const useCustomClient = () => {
5413
5339
  url: response.url,
5414
5340
  message: value
5415
5341
  };
5416
- throw new HttpError2(
5342
+ throw new HttpError(
5417
5343
  typeof value === "string" ? value : error.statusText,
5418
5344
  error
5419
5345
  );
@@ -5421,7 +5347,7 @@ const useCustomClient = () => {
5421
5347
  return value;
5422
5348
  };
5423
5349
  };
5424
- class HttpError2 extends Error {
5350
+ class HttpError extends Error {
5425
5351
  constructor(message, response) {
5426
5352
  super(message);
5427
5353
  this.message = message;
@@ -6239,6 +6165,72 @@ const useGetAllRomaConfigurationByType = (type, options) => {
6239
6165
  query.queryKey = queryOptions.queryKey;
6240
6166
  return query;
6241
6167
  };
6168
+ function promisifyRequest(request) {
6169
+ return new Promise((resolve, reject) => {
6170
+ request.oncomplete = request.onsuccess = () => resolve(request.result);
6171
+ request.onabort = request.onerror = () => reject(request.error);
6172
+ });
6173
+ }
6174
+ function createStore(dbName, storeName) {
6175
+ const request = indexedDB.open(dbName);
6176
+ request.onupgradeneeded = () => request.result.createObjectStore(storeName);
6177
+ const dbp = promisifyRequest(request);
6178
+ return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));
6179
+ }
6180
+ let defaultGetStoreFunc;
6181
+ function defaultGetStore() {
6182
+ if (!defaultGetStoreFunc) {
6183
+ defaultGetStoreFunc = createStore("keyval-store", "keyval");
6184
+ }
6185
+ return defaultGetStoreFunc;
6186
+ }
6187
+ function get(key, customStore = defaultGetStore()) {
6188
+ return customStore("readonly", (store) => promisifyRequest(store.get(key)));
6189
+ }
6190
+ function set(key, value, customStore = defaultGetStore()) {
6191
+ return customStore("readwrite", (store) => {
6192
+ store.put(value, key);
6193
+ return promisifyRequest(store.transaction);
6194
+ });
6195
+ }
6196
+ function del(key, customStore = defaultGetStore()) {
6197
+ return customStore("readwrite", (store) => {
6198
+ store.delete(key);
6199
+ return promisifyRequest(store.transaction);
6200
+ });
6201
+ }
6202
+ const checkRomaApi = (queryKey) => {
6203
+ const first = (queryKey ?? []).at(0);
6204
+ if (typeof first === "string") {
6205
+ return first.startsWith("/api/") || first.startsWith("/_discovery");
6206
+ }
6207
+ return false;
6208
+ };
6209
+ function createIDBPersister(idbValidKey = "reactQuery") {
6210
+ return {
6211
+ persistClient: async (persistedClient) => {
6212
+ const filteredClient = {
6213
+ ...persistedClient,
6214
+ clientState: {
6215
+ ...persistedClient.clientState,
6216
+ queries: persistedClient.clientState.queries.filter(
6217
+ (query) => {
6218
+ var _a2;
6219
+ return query.queryKey.includes("persist") || checkRomaApi(query.queryKey) || ((_a2 = query.meta) == null ? void 0 : _a2.persist);
6220
+ }
6221
+ )
6222
+ }
6223
+ };
6224
+ await set(idbValidKey, filteredClient);
6225
+ },
6226
+ restoreClient: async () => {
6227
+ return await get(idbValidKey);
6228
+ },
6229
+ removeClient: async () => {
6230
+ await del(idbValidKey);
6231
+ }
6232
+ };
6233
+ }
6242
6234
  function parseJwt(token) {
6243
6235
  const parts = token.split(".");
6244
6236
  if (parts.length !== 3) {
@@ -6292,7 +6284,9 @@ export {
6292
6284
  ErrorViewer,
6293
6285
  GetAllRomaConfigurationTypes200Item,
6294
6286
  HttpErrorViewer,
6287
+ RomaErrorViewer,
6295
6288
  StyleProvider,
6289
+ createIDBPersister,
6296
6290
  getGetAllAppsQueryKey,
6297
6291
  getGetAllCategoriesQueryKey,
6298
6292
  getGetAllRomaConfigurationByTypeQueryKey,
@@ -6348,7 +6342,6 @@ export {
6348
6342
  useDeleteServiceByKey,
6349
6343
  useDeleteServiceByKeyHook,
6350
6344
  useDeleteServiceByKeyMutationOptions,
6351
- useDownloadRecap,
6352
6345
  useGetAllApps,
6353
6346
  useGetAllAppsHook,
6354
6347
  useGetAllAppsQueryOptions,
@@ -6377,11 +6370,9 @@ export {
6377
6370
  useGetCurrentEnvironment,
6378
6371
  useGetCurrentEnvironmentHook,
6379
6372
  useGetCurrentEnvironmentQueryOptions,
6380
- useGetDeals,
6381
6373
  useGetPublicSettingByUserAndId,
6382
6374
  useGetPublicSettingByUserAndIdHook,
6383
6375
  useGetPublicSettingByUserAndIdQueryOptions,
6384
- useGetRecap,
6385
6376
  useGetRomaConfigurationById,
6386
6377
  useGetRomaConfigurationByIdHook,
6387
6378
  useGetRomaConfigurationByIdQueryOptions,
@@ -1,12 +0,0 @@
1
- export * from './lib/make-component';
2
- export * from './lib/dev-portal/EquinorLoader';
3
- export * from './lib/dev-portal/ErrorViewer';
4
- export * from './lib/dev-portal/AppLoader';
5
- export * from './lib/dev-portal/AppViewer';
6
- export * from './lib/style-provider';
7
- export * from './lib/dev-portal/HttpErrorViewer';
8
- export * from './lib/api/trade-recap';
9
- export * from './lib/api/roma';
10
- export * from './lib/app-provider';
11
- export * from './lib/hooks/use-get-api-roles';
12
- export * from './lib/hooks/use-has-api-role';
@@ -1,21 +0,0 @@
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>;
@@ -1,160 +0,0 @@
1
- type Nullable<T> = T | null | undefined;
2
- export type Response = {
3
- items: Item[];
4
- salesOfficeContext: string[];
5
- page: number;
6
- currentPage: number;
7
- previousPage: Nullable<number>;
8
- nextPage: Nullable<number>;
9
- totalCount: number;
10
- pageSize: number;
11
- maxDeepSearch: number;
12
- searchSuccessful: boolean;
13
- errorMessage: Nullable<string>;
14
- onRecapDataEnrichmentDisabledMessage: string;
15
- last: boolean;
16
- recapDataEnrichmentEnabled: boolean;
17
- };
18
- export type Item = {
19
- dealId: number;
20
- dealKey: DealKey;
21
- salePurchaseInd: string;
22
- typeOfTrade: string;
23
- customer: Customer;
24
- strategy: Strategy;
25
- generalTermsAndConditions?: string;
26
- tradeDate: string;
27
- buyer: string;
28
- buyerShortName?: string;
29
- seller: string;
30
- sellerShortName?: string;
31
- law?: string;
32
- arbitration: boolean;
33
- inspectionCost?: string;
34
- deliveryType: string;
35
- deliveryYear: number;
36
- deliveryMth: number;
37
- creditTerms?: string;
38
- location?: string;
39
- grade: string;
40
- quality: string;
41
- vesselName?: string;
42
- dealStatus: string;
43
- cargoNo?: string;
44
- sportNo?: string;
45
- lastModifiedDate: string;
46
- createdBy: string;
47
- spotTermIndicator: string;
48
- transportType?: string;
49
- lcNumberExt?: string;
50
- lcNumberInt: any;
51
- blDate: string;
52
- blDateIsActual: boolean;
53
- norDate?: string;
54
- norDateIsActual: boolean;
55
- codDate?: string;
56
- codDateIsActual: boolean;
57
- blVolume?: number;
58
- outturnVolume?: number;
59
- contractualVolume: number;
60
- volumeUnit: string;
61
- gainLossPercentage?: number;
62
- acceptUpdateFromSport: boolean;
63
- titlePoint: string;
64
- dischargePort?: string;
65
- paymentDueDate?: string;
66
- tolerance: string;
67
- demurrage?: string;
68
- laytime?: string;
69
- contractualDateType: string;
70
- contractualStartDate: string;
71
- contractualEndDate: string;
72
- volumeFrom: string;
73
- status?: Status;
74
- attentionRequired: boolean;
75
- cargoStatusRats?: string;
76
- bookoutSequence: any;
77
- titleTransferDate: string;
78
- broker?: Broker;
79
- responsibleOps?: string;
80
- mailSent: boolean;
81
- pricingStartDate?: string;
82
- pricingEndDate?: string;
83
- priceDifferential: string;
84
- typeOfPricing: string;
85
- priceText: string;
86
- priceIndicator: string;
87
- counterpartyReferenceNumber: any;
88
- counterpartyReferenceDate: any;
89
- reference1?: string;
90
- reference2?: string;
91
- termDsYear?: number;
92
- termDsNo?: number;
93
- officialLoadingRangeFrom?: string;
94
- officialLoadingRangeTo?: string;
95
- pricingPeriodDescription?: string;
96
- finalVolume: number;
97
- paymentTerm?: string;
98
- sportRemarks?: string;
99
- imosVesselCode?: string;
100
- imosVoyageNo?: string;
101
- imosVoyageStatus?: string;
102
- priceEscalated: boolean;
103
- loadingPort?: string;
104
- cargoStatusSport?: string;
105
- priceBasis: string;
106
- deliveryPeriod: string;
107
- };
108
- export type DealKey = {
109
- companyId: string;
110
- salesOffice: string;
111
- dsYear: number;
112
- dsNo: number;
113
- dealNo: number;
114
- lineItemNo: number;
115
- dealKeyShort: string;
116
- dealKeyFull: string;
117
- };
118
- export type Customer = {
119
- custNo: string;
120
- custName: string;
121
- custFullName: string;
122
- };
123
- export type Strategy = {
124
- id: number;
125
- year: number;
126
- no: number;
127
- description: string;
128
- reportingMonth: number;
129
- strategyKey: string;
130
- closed: boolean;
131
- class1: string;
132
- class2: string;
133
- class3: string;
134
- class4: string;
135
- dateClosed: any;
136
- dateOpened: string;
137
- };
138
- export type Status = {
139
- statusLines: StatusLine[];
140
- message: string;
141
- statusType: string;
142
- };
143
- export type StatusLine = {
144
- statusType: string;
145
- propertyName: string;
146
- propertyType: any;
147
- displayName: string;
148
- message: string;
149
- source1: any;
150
- value1: any;
151
- source2: any;
152
- value2: any;
153
- };
154
- export type Broker = {
155
- brokerNo: string;
156
- name: string;
157
- fullName: string;
158
- active: boolean;
159
- };
160
- export {};
@@ -1,6 +0,0 @@
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<Response>>;
6
- export {};
@@ -1,15 +0,0 @@
1
- import { Response } from './deal';
2
- import { HttpError } from '../fetcher';
3
- type Params = {
4
- dsYears: Array<number>;
5
- pageSize: number;
6
- bolDateFrom: string;
7
- bolDateTo: string;
8
- typeOfTrade: string;
9
- traders: Array<string>;
10
- sort: string;
11
- page: number;
12
- salesOffices: Array<string>;
13
- };
14
- export declare const useGetDeals: (params: Params) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<Response, HttpError>;
15
- export {};
@@ -1,11 +0,0 @@
1
- import { HttpResponseError } from '@equinor/fusion-framework-module-http';
2
- import { TradeRecap } from './recap';
3
- type Params = Partial<{
4
- companyId: string;
5
- so: string;
6
- dsYear: string;
7
- dsId: string;
8
- dsNo: string;
9
- }>;
10
- export declare const useGetRecap: (params: Params) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<TradeRecap, HttpResponseError<Response>>;
11
- export {};
@@ -1,5 +0,0 @@
1
- export * from './get-deals';
2
- export * from './deal';
3
- export * from './get-recap';
4
- export * from './recap';
5
- export * from './download-recap';
@@ -1,22 +0,0 @@
1
- import { DealKey } from './deal';
2
- export interface TradeRecap {
3
- dealKey: DealKey;
4
- strategy: string;
5
- typeOfTrade: string;
6
- priceIndicator: string;
7
- dealDate: string;
8
- trader: string;
9
- brokerName: string;
10
- seller: string;
11
- buyer: string;
12
- generalTermsAndConditions: string;
13
- law: string;
14
- arbitration: boolean;
15
- inspectionCost: string;
16
- operational: Operational;
17
- salePurchaseIndicator: string;
18
- dealId: number;
19
- }
20
- export interface Operational {
21
- lastUpdate: string;
22
- }
@@ -1 +0,0 @@
1
- export declare const createUrlParamsFromObject: (obj: Record<string, unknown>) => URLSearchParams;
@@ -1,13 +0,0 @@
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;
@@ -1,14 +0,0 @@
1
- /**
2
- * Parses a JWT token and returns an object with the roles contained in the token.
3
- * @param token The JWT token to parse.
4
- * @returns An object with the roles contained in the token.
5
- */
6
- export declare function parseJwt(token: string): {
7
- roles: Array<string>;
8
- };
9
- /**
10
- * Retrieves the roles associated with a specified API from fusion's service discovery module.
11
- * @param api The name of the API to retrieve roles for.
12
- * @returns An array of roles associated with the specified API.
13
- */
14
- export declare const useGetApiRoles: (api: string) => string[];
@@ -1,7 +0,0 @@
1
- /**
2
- * Checks if the current user has a specified role associated with a specified API using the `useGetApiRoles` hook.
3
- * @param api The name of the API to check for the specified role.
4
- * @param role The name of the role to check for.
5
- * @returns True if the current user has the specified role associated with the specified API, false otherwise.
6
- */
7
- export declare const useHasApiRole: (api: string, role: string) => boolean;