@equinor/roma-framework 0.0.10 → 0.0.12

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 (84) hide show
  1. package/dev-portal/package.json +1 -1
  2. package/dev-portal/roma-framework.umd.js +30537 -18174
  3. package/index.d.ts +1 -1
  4. package/lib/api/roma/api/app-controller/app-controller.d.ts +14 -20
  5. package/lib/api/roma/api/category-controller/category-controller.d.ts +14 -20
  6. package/lib/api/roma/api/environment-controller/environment-controller.d.ts +6 -12
  7. package/lib/api/roma/api/roma-configuration-controller/roma-configuration-controller.d.ts +21 -27
  8. package/lib/api/roma/api/server-side-event-controller/server-side-event-controller.d.ts +6 -12
  9. package/lib/api/roma/api/service-controller/service-controller.d.ts +14 -20
  10. package/lib/api/roma/api/setting-controller/setting-controller.d.ts +30 -36
  11. package/lib/api/roma/model/appDto.d.ts +3 -9
  12. package/lib/api/roma/model/environmentDto.d.ts +2 -8
  13. package/lib/api/roma/model/romaConfigurationDto.d.ts +2 -8
  14. package/lib/api/roma/model/romaConfigurationDtoValue.d.ts +1 -3
  15. package/lib/api/roma/model/serverSentEventActivityLogDto.d.ts +1 -3
  16. package/lib/api/roma/model/serverSentEventStandardEventDto.d.ts +1 -3
  17. package/lib/api/roma/model/settingDto.d.ts +2 -8
  18. package/lib/api/roma/model/settingDtoValue.d.ts +1 -3
  19. package/lib/app-provider.d.ts +3 -2
  20. package/lib/dev-portal/AppLoader.d.ts +4 -1
  21. package/lib/dev-portal/EquinorLoader.d.ts +2 -1
  22. package/lib/dev-portal/ErrorViewer.d.ts +9 -0
  23. package/lib/dev-portal/HttpErrorViewer.d.ts +1 -0
  24. package/lib/eds-event-provider.d.ts +1 -0
  25. package/lib/make-component.d.ts +2 -1
  26. package/lib/query/persister.d.ts +7 -0
  27. package/lib/style-provider.d.ts +1 -0
  28. package/package.json +1 -1
  29. package/roma-framework.mjs +96 -106
  30. package/dev-portal/index.d.ts +0 -12
  31. package/dev-portal/lib/api/fetcher.d.ts +0 -21
  32. package/dev-portal/lib/api/roma/api/app-controller/app-controller.d.ts +0 -100
  33. package/dev-portal/lib/api/roma/api/category-controller/category-controller.d.ts +0 -100
  34. package/dev-portal/lib/api/roma/api/environment-controller/environment-controller.d.ts +0 -33
  35. package/dev-portal/lib/api/roma/api/roma-configuration-controller/roma-configuration-controller.d.ts +0 -168
  36. package/dev-portal/lib/api/roma/api/server-side-event-controller/server-side-event-controller.d.ts +0 -27
  37. package/dev-portal/lib/api/roma/api/service-controller/service-controller.d.ts +0 -100
  38. package/dev-portal/lib/api/roma/api/setting-controller/setting-controller.d.ts +0 -267
  39. package/dev-portal/lib/api/roma/index.d.ts +0 -8
  40. package/dev-portal/lib/api/roma/model/appDto.d.ts +0 -26
  41. package/dev-portal/lib/api/roma/model/categoryDto.d.ts +0 -13
  42. package/dev-portal/lib/api/roma/model/environmentDto.d.ts +0 -16
  43. package/dev-portal/lib/api/roma/model/getAllRomaConfigurationTypes200Item.d.ts +0 -11
  44. package/dev-portal/lib/api/roma/model/index.d.ts +0 -19
  45. package/dev-portal/lib/api/roma/model/romaConfigurationDto.d.ts +0 -14
  46. package/dev-portal/lib/api/roma/model/romaConfigurationDtoValue.d.ts +0 -10
  47. package/dev-portal/lib/api/roma/model/serverSentEventActivityLogDto.d.ts +0 -10
  48. package/dev-portal/lib/api/roma/model/serverSentEventStandardEventDto.d.ts +0 -10
  49. package/dev-portal/lib/api/roma/model/serviceDto.d.ts +0 -16
  50. package/dev-portal/lib/api/roma/model/settingDto.d.ts +0 -16
  51. package/dev-portal/lib/api/roma/model/settingDtoValue.d.ts +0 -10
  52. package/dev-portal/lib/api/roma/model/versionDto.d.ts +0 -12
  53. package/dev-portal/lib/api/roma/use-client.d.ts +0 -34
  54. package/dev-portal/lib/api/trade-recap/deal.d.ts +0 -160
  55. package/dev-portal/lib/api/trade-recap/download-recap.d.ts +0 -6
  56. package/dev-portal/lib/api/trade-recap/get-deals.d.ts +0 -15
  57. package/dev-portal/lib/api/trade-recap/get-recap.d.ts +0 -11
  58. package/dev-portal/lib/api/trade-recap/index.d.ts +0 -5
  59. package/dev-portal/lib/api/trade-recap/recap.d.ts +0 -22
  60. package/dev-portal/lib/api/util.d.ts +0 -1
  61. package/dev-portal/lib/app-provider.d.ts +0 -32
  62. package/dev-portal/lib/dev-portal/AppLoader.d.ts +0 -12
  63. package/dev-portal/lib/dev-portal/AppViewer.d.ts +0 -6
  64. package/dev-portal/lib/dev-portal/EquinorLoader.d.ts +0 -12
  65. package/dev-portal/lib/dev-portal/ErrorViewer.d.ts +0 -12
  66. package/dev-portal/lib/dev-portal/Header.d.ts +0 -2
  67. package/dev-portal/lib/dev-portal/HttpErrorViewer.d.ts +0 -13
  68. package/dev-portal/lib/dev-portal/Navigation.d.ts +0 -5
  69. package/dev-portal/lib/dev-portal/Root.d.ts +0 -5
  70. package/dev-portal/lib/dev-portal/config.d.ts +0 -3
  71. package/dev-portal/lib/dev-portal/index.d.ts +0 -13
  72. package/dev-portal/lib/eds-event-provider.d.ts +0 -6
  73. package/dev-portal/lib/hooks/use-get-api-roles.d.ts +0 -14
  74. package/dev-portal/lib/hooks/use-has-api-role.d.ts +0 -7
  75. package/dev-portal/lib/make-component.d.ts +0 -12
  76. package/dev-portal/lib/style-provider.d.ts +0 -7
  77. package/lib/api/fetcher.d.ts +0 -21
  78. package/lib/api/trade-recap/deal.d.ts +0 -160
  79. package/lib/api/trade-recap/download-recap.d.ts +0 -6
  80. package/lib/api/trade-recap/get-deals.d.ts +0 -15
  81. package/lib/api/trade-recap/get-recap.d.ts +0 -11
  82. package/lib/api/trade-recap/index.d.ts +0 -5
  83. package/lib/api/trade-recap/recap.d.ts +0 -22
  84. package/lib/api/util.d.ts +0 -1
@@ -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,
@@ -5032,11 +5054,12 @@ function getAppModule(app, framework) {
5032
5054
  }
5033
5055
  function AppLoader({
5034
5056
  app,
5035
- kind
5057
+ kind,
5058
+ props
5036
5059
  }) {
5037
5060
  const queryClient = useQueryClient();
5038
5061
  kind = kind ?? "widget";
5039
- const { setCurrentApp, clearCurrentApp, currentApp } = useCurrentApp();
5062
+ const { setCurrentApp, clearCurrentApp } = useCurrentApp();
5040
5063
  const framework = useFramework();
5041
5064
  const [error, setError] = useState(null);
5042
5065
  const [loading, setLoading] = useState(false);
@@ -5064,9 +5087,7 @@ function AppLoader({
5064
5087
  endpoints: {}
5065
5088
  },
5066
5089
  basename,
5067
- props: {
5068
- // Ways to reuse this? Could be particularly useful for widgets in a given context.
5069
- }
5090
+ props: props ?? {}
5070
5091
  }
5071
5092
  });
5072
5093
  if (kind === "app") {
@@ -5279,102 +5300,6 @@ const HttpErrorViewer = ({ error }) => {
5279
5300
  }
5280
5301
  );
5281
5302
  };
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
5303
  const useCustomClient = () => {
5379
5304
  const client = useHttpClient("portal");
5380
5305
  return async ({
@@ -5413,7 +5338,7 @@ const useCustomClient = () => {
5413
5338
  url: response.url,
5414
5339
  message: value
5415
5340
  };
5416
- throw new HttpError2(
5341
+ throw new HttpError(
5417
5342
  typeof value === "string" ? value : error.statusText,
5418
5343
  error
5419
5344
  );
@@ -5421,7 +5346,7 @@ const useCustomClient = () => {
5421
5346
  return value;
5422
5347
  };
5423
5348
  };
5424
- class HttpError2 extends Error {
5349
+ class HttpError extends Error {
5425
5350
  constructor(message, response) {
5426
5351
  super(message);
5427
5352
  this.message = message;
@@ -6239,6 +6164,72 @@ const useGetAllRomaConfigurationByType = (type, options) => {
6239
6164
  query.queryKey = queryOptions.queryKey;
6240
6165
  return query;
6241
6166
  };
6167
+ function promisifyRequest(request) {
6168
+ return new Promise((resolve, reject) => {
6169
+ request.oncomplete = request.onsuccess = () => resolve(request.result);
6170
+ request.onabort = request.onerror = () => reject(request.error);
6171
+ });
6172
+ }
6173
+ function createStore(dbName, storeName) {
6174
+ const request = indexedDB.open(dbName);
6175
+ request.onupgradeneeded = () => request.result.createObjectStore(storeName);
6176
+ const dbp = promisifyRequest(request);
6177
+ return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));
6178
+ }
6179
+ let defaultGetStoreFunc;
6180
+ function defaultGetStore() {
6181
+ if (!defaultGetStoreFunc) {
6182
+ defaultGetStoreFunc = createStore("keyval-store", "keyval");
6183
+ }
6184
+ return defaultGetStoreFunc;
6185
+ }
6186
+ function get(key, customStore = defaultGetStore()) {
6187
+ return customStore("readonly", (store) => promisifyRequest(store.get(key)));
6188
+ }
6189
+ function set(key, value, customStore = defaultGetStore()) {
6190
+ return customStore("readwrite", (store) => {
6191
+ store.put(value, key);
6192
+ return promisifyRequest(store.transaction);
6193
+ });
6194
+ }
6195
+ function del(key, customStore = defaultGetStore()) {
6196
+ return customStore("readwrite", (store) => {
6197
+ store.delete(key);
6198
+ return promisifyRequest(store.transaction);
6199
+ });
6200
+ }
6201
+ const checkRomaApi = (queryKey) => {
6202
+ const first = (queryKey ?? []).at(0);
6203
+ if (typeof first === "string") {
6204
+ return first.startsWith("/api/") || first.startsWith("/_discovery");
6205
+ }
6206
+ return false;
6207
+ };
6208
+ function createIDBPersister(idbValidKey = "reactQuery") {
6209
+ return {
6210
+ persistClient: async (persistedClient) => {
6211
+ const filteredClient = {
6212
+ ...persistedClient,
6213
+ clientState: {
6214
+ ...persistedClient.clientState,
6215
+ queries: persistedClient.clientState.queries.filter(
6216
+ (query) => {
6217
+ var _a2;
6218
+ return query.queryKey.includes("persist") || checkRomaApi(query.queryKey) || ((_a2 = query.meta) == null ? void 0 : _a2.persist);
6219
+ }
6220
+ )
6221
+ }
6222
+ };
6223
+ await set(idbValidKey, filteredClient);
6224
+ },
6225
+ restoreClient: async () => {
6226
+ return await get(idbValidKey);
6227
+ },
6228
+ removeClient: async () => {
6229
+ await del(idbValidKey);
6230
+ }
6231
+ };
6232
+ }
6242
6233
  function parseJwt(token) {
6243
6234
  const parts = token.split(".");
6244
6235
  if (parts.length !== 3) {
@@ -6292,7 +6283,9 @@ export {
6292
6283
  ErrorViewer,
6293
6284
  GetAllRomaConfigurationTypes200Item,
6294
6285
  HttpErrorViewer,
6286
+ RomaErrorViewer,
6295
6287
  StyleProvider,
6288
+ createIDBPersister,
6296
6289
  getGetAllAppsQueryKey,
6297
6290
  getGetAllCategoriesQueryKey,
6298
6291
  getGetAllRomaConfigurationByTypeQueryKey,
@@ -6348,7 +6341,6 @@ export {
6348
6341
  useDeleteServiceByKey,
6349
6342
  useDeleteServiceByKeyHook,
6350
6343
  useDeleteServiceByKeyMutationOptions,
6351
- useDownloadRecap,
6352
6344
  useGetAllApps,
6353
6345
  useGetAllAppsHook,
6354
6346
  useGetAllAppsQueryOptions,
@@ -6377,11 +6369,9 @@ export {
6377
6369
  useGetCurrentEnvironment,
6378
6370
  useGetCurrentEnvironmentHook,
6379
6371
  useGetCurrentEnvironmentQueryOptions,
6380
- useGetDeals,
6381
6372
  useGetPublicSettingByUserAndId,
6382
6373
  useGetPublicSettingByUserAndIdHook,
6383
6374
  useGetPublicSettingByUserAndIdQueryOptions,
6384
- useGetRecap,
6385
6375
  useGetRomaConfigurationById,
6386
6376
  useGetRomaConfigurationByIdHook,
6387
6377
  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,100 +0,0 @@
1
- /**
2
- * Generated by orval v6.20.0 🍺
3
- * Do not edit manually.
4
- * Tops Roma Rest API
5
- * Tops Roma Rest API
6
- * OpenAPI spec version: v1.0.0
7
- */
8
- import type { QueryKey, UseMutationOptions, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
9
- import type { AppDto } from '../../model';
10
- import type { BodyType, ErrorType } from '../../use-client';
11
- type AwaitedInput<T> = PromiseLike<T> | T;
12
- type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
13
- /**
14
- * @summary List apps
15
- */
16
- export declare const useGetAllAppsHook: () => (signal?: AbortSignal) => Promise<AppDto[]>;
17
- export declare const getGetAllAppsQueryKey: () => readonly ["/api/apps"];
18
- export declare const useGetAllAppsQueryOptions: <TData = AppDto[], TError = import("../../use-client").HttpError>(options?: {
19
- query?: Partial<UseQueryOptions<AppDto[], TError, TData, QueryKey>> | undefined;
20
- } | undefined) => UseQueryOptions<AppDto[], TError, TData, QueryKey> & {
21
- queryKey: QueryKey;
22
- };
23
- export type GetAllAppsQueryResult = NonNullable<Awaited<ReturnType<ReturnType<typeof useGetAllAppsHook>>>>;
24
- export type GetAllAppsQueryError = ErrorType<void>;
25
- /**
26
- * @summary List apps
27
- */
28
- export declare const useGetAllApps: <TData = AppDto[], TError = import("../../use-client").HttpError>(options?: {
29
- query?: Partial<UseQueryOptions<AppDto[], TError, TData, QueryKey>> | undefined;
30
- } | undefined) => UseQueryResult<TData, TError> & {
31
- queryKey: QueryKey;
32
- };
33
- /**
34
- * @summary Create or update App
35
- */
36
- export declare const useCreateOrUpdateAppHook: () => (appDto: BodyType<AppDto>) => Promise<AppDto>;
37
- export declare const useCreateOrUpdateAppMutationOptions: <TError = import("../../use-client").HttpError, TContext = unknown>(options?: {
38
- mutation?: UseMutationOptions<AppDto, TError, {
39
- data: BodyType<AppDto>;
40
- }, TContext> | undefined;
41
- } | undefined) => UseMutationOptions<AppDto, TError, {
42
- data: BodyType<AppDto>;
43
- }, TContext>;
44
- export type CreateOrUpdateAppMutationResult = NonNullable<Awaited<ReturnType<ReturnType<typeof useCreateOrUpdateAppHook>>>>;
45
- export type CreateOrUpdateAppMutationBody = BodyType<AppDto>;
46
- export type CreateOrUpdateAppMutationError = ErrorType<void>;
47
- /**
48
- * @summary Create or update App
49
- */
50
- export declare const useCreateOrUpdateApp: <TError = import("../../use-client").HttpError, TContext = unknown>(options?: {
51
- mutation?: UseMutationOptions<AppDto, TError, {
52
- data: BodyType<AppDto>;
53
- }, TContext> | undefined;
54
- } | undefined) => import("@tanstack/react-query/build/legacy/types").UseMutationResult<AppDto, TError, {
55
- data: BodyType<AppDto>;
56
- }, TContext>;
57
- /**
58
- * @summary Get app by key
59
- */
60
- export declare const useGetAppByKeyHook: () => (key: string, signal?: AbortSignal) => Promise<AppDto>;
61
- export declare const getGetAppByKeyQueryKey: (key: string) => readonly [`/api/apps/key/${string}`];
62
- export declare const useGetAppByKeyQueryOptions: <TData = AppDto, TError = import("../../use-client").HttpError>(key: string, options?: {
63
- query?: Partial<UseQueryOptions<AppDto, TError, TData, QueryKey>> | undefined;
64
- } | undefined) => UseQueryOptions<AppDto, TError, TData, QueryKey> & {
65
- queryKey: QueryKey;
66
- };
67
- export type GetAppByKeyQueryResult = NonNullable<Awaited<ReturnType<ReturnType<typeof useGetAppByKeyHook>>>>;
68
- export type GetAppByKeyQueryError = ErrorType<void>;
69
- /**
70
- * @summary Get app by key
71
- */
72
- export declare const useGetAppByKey: <TData = AppDto, TError = import("../../use-client").HttpError>(key: string, options?: {
73
- query?: Partial<UseQueryOptions<AppDto, TError, TData, QueryKey>> | undefined;
74
- } | undefined) => UseQueryResult<TData, TError> & {
75
- queryKey: QueryKey;
76
- };
77
- /**
78
- * @summary Delete app by key
79
- */
80
- export declare const useDeleteAppByKeyHook: () => (key: string) => Promise<void>;
81
- export declare const useDeleteAppByKeyMutationOptions: <TError = import("../../use-client").HttpError, TContext = unknown>(options?: {
82
- mutation?: UseMutationOptions<void, TError, {
83
- key: string;
84
- }, TContext> | undefined;
85
- } | undefined) => UseMutationOptions<void, TError, {
86
- key: string;
87
- }, TContext>;
88
- export type DeleteAppByKeyMutationResult = NonNullable<Awaited<ReturnType<ReturnType<typeof useDeleteAppByKeyHook>>>>;
89
- export type DeleteAppByKeyMutationError = ErrorType<unknown>;
90
- /**
91
- * @summary Delete app by key
92
- */
93
- export declare const useDeleteAppByKey: <TError = import("../../use-client").HttpError, TContext = unknown>(options?: {
94
- mutation?: UseMutationOptions<void, TError, {
95
- key: string;
96
- }, TContext> | undefined;
97
- } | undefined) => import("@tanstack/react-query/build/legacy/types").UseMutationResult<void, TError, {
98
- key: string;
99
- }, TContext>;
100
- export {};
@@ -1,100 +0,0 @@
1
- /**
2
- * Generated by orval v6.20.0 🍺
3
- * Do not edit manually.
4
- * Tops Roma Rest API
5
- * Tops Roma Rest API
6
- * OpenAPI spec version: v1.0.0
7
- */
8
- import type { QueryKey, UseMutationOptions, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
9
- import type { CategoryDto } from '../../model';
10
- import type { BodyType, ErrorType } from '../../use-client';
11
- type AwaitedInput<T> = PromiseLike<T> | T;
12
- type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
13
- /**
14
- * @summary List categories
15
- */
16
- export declare const useGetAllCategoriesHook: () => (signal?: AbortSignal) => Promise<CategoryDto[]>;
17
- export declare const getGetAllCategoriesQueryKey: () => readonly ["/api/apps/categories"];
18
- export declare const useGetAllCategoriesQueryOptions: <TData = CategoryDto[], TError = import("../../use-client").HttpError>(options?: {
19
- query?: Partial<UseQueryOptions<CategoryDto[], TError, TData, QueryKey>> | undefined;
20
- } | undefined) => UseQueryOptions<CategoryDto[], TError, TData, QueryKey> & {
21
- queryKey: QueryKey;
22
- };
23
- export type GetAllCategoriesQueryResult = NonNullable<Awaited<ReturnType<ReturnType<typeof useGetAllCategoriesHook>>>>;
24
- export type GetAllCategoriesQueryError = ErrorType<void>;
25
- /**
26
- * @summary List categories
27
- */
28
- export declare const useGetAllCategories: <TData = CategoryDto[], TError = import("../../use-client").HttpError>(options?: {
29
- query?: Partial<UseQueryOptions<CategoryDto[], TError, TData, QueryKey>> | undefined;
30
- } | undefined) => UseQueryResult<TData, TError> & {
31
- queryKey: QueryKey;
32
- };
33
- /**
34
- * @summary Create or update category
35
- */
36
- export declare const useCreateOrUpdateCategoryHook: () => (categoryDto: BodyType<CategoryDto>) => Promise<CategoryDto>;
37
- export declare const useCreateOrUpdateCategoryMutationOptions: <TError = import("../../use-client").HttpError, TContext = unknown>(options?: {
38
- mutation?: UseMutationOptions<CategoryDto, TError, {
39
- data: BodyType<CategoryDto>;
40
- }, TContext> | undefined;
41
- } | undefined) => UseMutationOptions<CategoryDto, TError, {
42
- data: BodyType<CategoryDto>;
43
- }, TContext>;
44
- export type CreateOrUpdateCategoryMutationResult = NonNullable<Awaited<ReturnType<ReturnType<typeof useCreateOrUpdateCategoryHook>>>>;
45
- export type CreateOrUpdateCategoryMutationBody = BodyType<CategoryDto>;
46
- export type CreateOrUpdateCategoryMutationError = ErrorType<void>;
47
- /**
48
- * @summary Create or update category
49
- */
50
- export declare const useCreateOrUpdateCategory: <TError = import("../../use-client").HttpError, TContext = unknown>(options?: {
51
- mutation?: UseMutationOptions<CategoryDto, TError, {
52
- data: BodyType<CategoryDto>;
53
- }, TContext> | undefined;
54
- } | undefined) => import("@tanstack/react-query/build/legacy/types").UseMutationResult<CategoryDto, TError, {
55
- data: BodyType<CategoryDto>;
56
- }, TContext>;
57
- /**
58
- * @summary Get category by id
59
- */
60
- export declare const useGetCategoryByIdHook: () => (id: string, signal?: AbortSignal) => Promise<CategoryDto>;
61
- export declare const getGetCategoryByIdQueryKey: (id: string) => readonly [`/api/apps/categories/id/${string}`];
62
- export declare const useGetCategoryByIdQueryOptions: <TData = CategoryDto, TError = import("../../use-client").HttpError>(id: string, options?: {
63
- query?: Partial<UseQueryOptions<CategoryDto, TError, TData, QueryKey>> | undefined;
64
- } | undefined) => UseQueryOptions<CategoryDto, TError, TData, QueryKey> & {
65
- queryKey: QueryKey;
66
- };
67
- export type GetCategoryByIdQueryResult = NonNullable<Awaited<ReturnType<ReturnType<typeof useGetCategoryByIdHook>>>>;
68
- export type GetCategoryByIdQueryError = ErrorType<void>;
69
- /**
70
- * @summary Get category by id
71
- */
72
- export declare const useGetCategoryById: <TData = CategoryDto, TError = import("../../use-client").HttpError>(id: string, options?: {
73
- query?: Partial<UseQueryOptions<CategoryDto, TError, TData, QueryKey>> | undefined;
74
- } | undefined) => UseQueryResult<TData, TError> & {
75
- queryKey: QueryKey;
76
- };
77
- /**
78
- * @summary Delete category by id
79
- */
80
- export declare const useDeleteCategoryByIdHook: () => (id: string) => Promise<void>;
81
- export declare const useDeleteCategoryByIdMutationOptions: <TError = import("../../use-client").HttpError, TContext = unknown>(options?: {
82
- mutation?: UseMutationOptions<void, TError, {
83
- id: string;
84
- }, TContext> | undefined;
85
- } | undefined) => UseMutationOptions<void, TError, {
86
- id: string;
87
- }, TContext>;
88
- export type DeleteCategoryByIdMutationResult = NonNullable<Awaited<ReturnType<ReturnType<typeof useDeleteCategoryByIdHook>>>>;
89
- export type DeleteCategoryByIdMutationError = ErrorType<unknown>;
90
- /**
91
- * @summary Delete category by id
92
- */
93
- export declare const useDeleteCategoryById: <TError = import("../../use-client").HttpError, TContext = unknown>(options?: {
94
- mutation?: UseMutationOptions<void, TError, {
95
- id: string;
96
- }, TContext> | undefined;
97
- } | undefined) => import("@tanstack/react-query/build/legacy/types").UseMutationResult<void, TError, {
98
- id: string;
99
- }, TContext>;
100
- export {};
@@ -1,33 +0,0 @@
1
- /**
2
- * Generated by orval v6.20.0 🍺
3
- * Do not edit manually.
4
- * Tops Roma Rest API
5
- * Tops Roma Rest API
6
- * OpenAPI spec version: v1.0.0
7
- */
8
- import type { QueryKey, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
9
- import type { EnvironmentDto } from '../../model';
10
- import type { ErrorType } from '../../use-client';
11
- type AwaitedInput<T> = PromiseLike<T> | T;
12
- type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
13
- /**
14
- * @summary Get current environment
15
- */
16
- export declare const useGetCurrentEnvironmentHook: () => (signal?: AbortSignal) => Promise<EnvironmentDto>;
17
- export declare const getGetCurrentEnvironmentQueryKey: () => readonly ["/_discovery/environments/current"];
18
- export declare const useGetCurrentEnvironmentQueryOptions: <TData = EnvironmentDto, TError = import("../../use-client").HttpError>(options?: {
19
- query?: Partial<UseQueryOptions<EnvironmentDto, TError, TData, QueryKey>> | undefined;
20
- } | undefined) => UseQueryOptions<EnvironmentDto, TError, TData, QueryKey> & {
21
- queryKey: QueryKey;
22
- };
23
- export type GetCurrentEnvironmentQueryResult = NonNullable<Awaited<ReturnType<ReturnType<typeof useGetCurrentEnvironmentHook>>>>;
24
- export type GetCurrentEnvironmentQueryError = ErrorType<void>;
25
- /**
26
- * @summary Get current environment
27
- */
28
- export declare const useGetCurrentEnvironment: <TData = EnvironmentDto, TError = import("../../use-client").HttpError>(options?: {
29
- query?: Partial<UseQueryOptions<EnvironmentDto, TError, TData, QueryKey>> | undefined;
30
- } | undefined) => UseQueryResult<TData, TError> & {
31
- queryKey: QueryKey;
32
- };
33
- export {};