@equinor/roma-framework 0.0.11 → 0.1.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.
Files changed (81) hide show
  1. package/dev-portal/package.json +1 -1
  2. package/dev-portal/roma-framework.umd.js +29562 -12939
  3. package/index.d.ts +1 -0
  4. package/lib/api/ms-graph/api/group/find-group-members.d.ts +3 -0
  5. package/lib/api/ms-graph/api/user/find-user-by-shortname.d.ts +1 -0
  6. package/lib/api/ms-graph/api/user/find-users-by-mail.d.ts +3 -0
  7. package/lib/api/ms-graph/index.d.ts +11 -0
  8. package/lib/api/ms-graph/model/group-membership.d.ts +8 -0
  9. package/lib/api/ms-graph/model/user.d.ts +18 -0
  10. package/lib/api/roma/api/app-controller/app-controller.d.ts +46 -24
  11. package/lib/api/roma/api/category-controller/category-controller.d.ts +18 -24
  12. package/lib/api/roma/api/environment-controller/environment-controller.d.ts +6 -12
  13. package/lib/api/roma/api/feedback-controller/feedback-controller.d.ts +31 -0
  14. package/lib/api/roma/api/roma-configuration-controller/roma-configuration-controller.d.ts +21 -27
  15. package/lib/api/roma/api/server-side-event-controller/server-side-event-controller.d.ts +6 -12
  16. package/lib/api/roma/api/service-controller/service-controller.d.ts +18 -24
  17. package/lib/api/roma/api/setting-controller/setting-controller.d.ts +56 -62
  18. package/lib/api/roma/index.d.ts +1 -0
  19. package/lib/api/roma/model/appDto.d.ts +3 -9
  20. package/lib/api/roma/model/environmentDto.d.ts +3 -8
  21. package/{dev-portal/lib/api/roma/model/categoryDto.d.ts → lib/api/roma/model/feedbackDetailsDto.d.ts} +5 -5
  22. package/lib/api/roma/model/feedbackDto.d.ts +7 -0
  23. package/{dev-portal/lib/api/roma/model/versionDto.d.ts → lib/api/roma/model/feedbackFeedbackDto.d.ts} +5 -4
  24. package/lib/api/roma/model/feedbackResponseDto.d.ts +5 -0
  25. package/lib/api/roma/model/feedbackResponseIssueDto.d.ts +11 -0
  26. package/{dev-portal/lib/api/roma/model/romaConfigurationDtoValue.d.ts → lib/api/roma/model/feedbackSolutionDto.d.ts} +3 -1
  27. package/{dev-portal/lib/api/roma/model/settingDtoValue.d.ts → lib/api/roma/model/getAllApps200.d.ts} +3 -1
  28. package/{dev-portal/lib/api/roma/model/serverSentEventActivityLogDto.d.ts → lib/api/roma/model/getAllCategories200.d.ts} +3 -1
  29. package/{dev-portal/lib/api/roma/model/serverSentEventStandardEventDto.d.ts → lib/api/roma/model/getAllServices200.d.ts} +3 -1
  30. package/lib/api/roma/model/getSettingsByAppShortName200.d.ts +10 -0
  31. package/lib/api/roma/model/getSettingsByUserId200.d.ts +10 -0
  32. package/lib/api/roma/model/index.d.ts +12 -0
  33. package/lib/api/roma/model/romaConfigurationDto.d.ts +2 -8
  34. package/lib/api/roma/model/romaConfigurationDtoValue.d.ts +3 -1
  35. package/lib/api/roma/model/serverSentEventStandardEventDto.d.ts +3 -1
  36. package/lib/api/roma/model/settingDto.d.ts +2 -8
  37. package/lib/api/roma/model/settingDtoValue.d.ts +3 -1
  38. package/lib/api/roma/model/uploadBundleBody.d.ts +10 -0
  39. package/lib/api/roma/use-client.d.ts +1 -1
  40. package/lib/app-provider.d.ts +3 -2
  41. package/lib/dev-portal/AppLoader.d.ts +4 -1
  42. package/lib/dev-portal/EquinorLoader.d.ts +2 -1
  43. package/lib/dev-portal/ErrorViewer.d.ts +1 -0
  44. package/lib/dev-portal/HttpErrorViewer.d.ts +1 -0
  45. package/lib/eds-event-provider.d.ts +1 -0
  46. package/lib/make-component.d.ts +2 -1
  47. package/lib/query/persister.d.ts +1 -0
  48. package/lib/style-provider.d.ts +1 -0
  49. package/package.json +1 -1
  50. package/roma-framework.mjs +135 -5
  51. package/dev-portal/lib/api/roma/api/app-controller/app-controller.d.ts +0 -100
  52. package/dev-portal/lib/api/roma/api/category-controller/category-controller.d.ts +0 -100
  53. package/dev-portal/lib/api/roma/api/environment-controller/environment-controller.d.ts +0 -33
  54. package/dev-portal/lib/api/roma/api/roma-configuration-controller/roma-configuration-controller.d.ts +0 -168
  55. package/dev-portal/lib/api/roma/api/server-side-event-controller/server-side-event-controller.d.ts +0 -27
  56. package/dev-portal/lib/api/roma/api/service-controller/service-controller.d.ts +0 -100
  57. package/dev-portal/lib/api/roma/api/setting-controller/setting-controller.d.ts +0 -267
  58. package/dev-portal/lib/api/roma/index.d.ts +0 -8
  59. package/dev-portal/lib/api/roma/model/appDto.d.ts +0 -26
  60. package/dev-portal/lib/api/roma/model/environmentDto.d.ts +0 -16
  61. package/dev-portal/lib/api/roma/model/getAllRomaConfigurationTypes200Item.d.ts +0 -11
  62. package/dev-portal/lib/api/roma/model/index.d.ts +0 -19
  63. package/dev-portal/lib/api/roma/model/romaConfigurationDto.d.ts +0 -14
  64. package/dev-portal/lib/api/roma/model/serviceDto.d.ts +0 -16
  65. package/dev-portal/lib/api/roma/model/settingDto.d.ts +0 -16
  66. package/dev-portal/lib/api/roma/use-client.d.ts +0 -34
  67. package/dev-portal/lib/app-provider.d.ts +0 -32
  68. package/dev-portal/lib/dev-portal/AppLoader.d.ts +0 -12
  69. package/dev-portal/lib/dev-portal/AppViewer.d.ts +0 -6
  70. package/dev-portal/lib/dev-portal/EquinorLoader.d.ts +0 -12
  71. package/dev-portal/lib/dev-portal/ErrorViewer.d.ts +0 -20
  72. package/dev-portal/lib/dev-portal/Header.d.ts +0 -2
  73. package/dev-portal/lib/dev-portal/Navigation.d.ts +0 -5
  74. package/dev-portal/lib/dev-portal/Root.d.ts +0 -5
  75. package/dev-portal/lib/dev-portal/config.d.ts +0 -3
  76. package/dev-portal/lib/dev-portal/index.d.ts +0 -13
  77. package/dev-portal/lib/eds-event-provider.d.ts +0 -6
  78. package/dev-portal/lib/make-component.d.ts +0 -12
  79. package/dev-portal/lib/query/persister.d.ts +0 -6
  80. package/dev-portal/lib/style-provider.d.ts +0 -7
  81. package/lib/api/fetcher.d.ts +0 -21
@@ -5,4 +5,6 @@
5
5
  * Tops Roma Rest API
6
6
  * OpenAPI spec version: v1.0.0
7
7
  */
8
- export type SettingDtoValue = Record<string, any>;
8
+ export type SettingDtoValue = {
9
+ [key: string]: any;
10
+ };
@@ -0,0 +1,10 @@
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
+ export type UploadBundleBody = {
9
+ bundleFile: Blob;
10
+ };
@@ -3,7 +3,7 @@ type CustomClient<T> = (data: {
3
3
  method: 'get' | 'post' | 'put' | 'delete' | 'patch';
4
4
  params?: Record<string, any>;
5
5
  headers?: Record<string, any>;
6
- data?: BodyType<unknown>;
6
+ data?: any;
7
7
  signal?: AbortSignal;
8
8
  }) => Promise<T>;
9
9
  export declare const useCustomClient: <T>() => CustomClient<T>;
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { AppManifest } from '@equinor/fusion-framework-module-app';
3
- import type { QueryClientError } from '@equinor/fusion-query/client';
3
+ import { QueryClientError } from '@equinor/fusion-query/client';
4
+
4
5
  type AppLoadError = QueryClientError & {
5
6
  cause: {
6
7
  data: unknown;
@@ -8,7 +9,7 @@ type AppLoadError = QueryClientError & {
8
9
  response: Response;
9
10
  };
10
11
  };
11
- export declare const AppContext: import("react").Context<{
12
+ export declare const AppContext: import('react').Context<{
12
13
  isLoading: boolean;
13
14
  apps?: AppManifest[] | undefined;
14
15
  error?: AppLoadError | undefined;
@@ -1,12 +1,15 @@
1
1
  import { AppManifest } from '@equinor/fusion-framework-module-app';
2
+
2
3
  /**
3
4
  * Component that will render a Fusion application
4
5
  *
5
6
  * @param app the AppManifest for the application to render
6
7
  * @param kind whether the app is a widget or an application
8
+ * @param props any props to pass to the loaded application
7
9
  * @constructor
8
10
  */
9
- export declare function AppLoader({ app, kind, }: {
11
+ export declare function AppLoader({ app, kind, props, }: {
10
12
  app: AppManifest | null;
11
13
  kind?: 'app' | 'widget';
14
+ props?: Record<string | number, any>;
12
15
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
- import React from 'react';
1
+ import { default as React } from 'react';
2
+
2
3
  /**
3
4
  * Simple in-place loader for fusion apps
4
5
  *
@@ -1,4 +1,5 @@
1
1
  import { ReactElement, CSSProperties } from 'react';
2
+
2
3
  /**
3
4
  * Simple error display component.
4
5
  * Does not create a pretty error, and should most likely be recreated for various error types (e.g. lack of access etc.)
@@ -1,4 +1,5 @@
1
1
  import { HttpError } from '../api/fetcher';
2
+
2
3
  /**
3
4
  * Simple error display component.
4
5
  * Does not create a pretty error, and should most likely be recreated for various error types (e.g. lack of access etc.)
@@ -1,5 +1,6 @@
1
1
  import { IEventModuleProvider } from '@equinor/fusion-framework-module-event';
2
2
  import { ReactNode } from 'react';
3
+
3
4
  export declare const EdsEventProvider: ({ event, children }: {
4
5
  event: IEventModuleProvider;
5
6
  children: ReactNode;
@@ -1,9 +1,10 @@
1
1
  import { AnyModule } from '@equinor/fusion-framework-module';
2
2
  import { Fusion } from '@equinor/fusion-framework-react';
3
3
  import { AppEnv, AppModuleInitiator } from '@equinor/fusion-framework-app';
4
- import React, { ReactNode } from 'react';
4
+ import { default as React, ReactNode } from 'react';
5
5
  import { ComponentRenderArgs as FusionComponentRenderArgs } from '@equinor/fusion-framework-react-app';
6
6
  import { QueryClient } from '@tanstack/react-query';
7
+
7
8
  export type RomaComponentRenderArgs<TRef extends Fusion = Fusion, TEnv = AppEnv> = FusionComponentRenderArgs<TRef, TEnv> & {
8
9
  query?: QueryClient;
9
10
  };
@@ -1,4 +1,5 @@
1
1
  import { Persister } from '@tanstack/react-query-persist-client';
2
+
2
3
  /**
3
4
  * Creates an Indexed DB persister
4
5
  * @see https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+
2
3
  type Props = {
3
4
  scope: string;
4
5
  children: ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/roma-framework",
3
- "version": "0.0.11",
3
+ "version": "0.1.0",
4
4
  "repository": "https://github.com/equinor/tops-roma",
5
5
  "types": "./index.d.ts",
6
6
  "private": false,
@@ -5054,7 +5054,8 @@ function getAppModule(app, framework) {
5054
5054
  }
5055
5055
  function AppLoader({
5056
5056
  app,
5057
- kind
5057
+ kind,
5058
+ props
5058
5059
  }) {
5059
5060
  const queryClient = useQueryClient();
5060
5061
  kind = kind ?? "widget";
@@ -5086,9 +5087,7 @@ function AppLoader({
5086
5087
  endpoints: {}
5087
5088
  },
5088
5089
  basename,
5089
- props: {
5090
- // Ways to reuse this? Could be particularly useful for widgets in a given context.
5091
- }
5090
+ props: props ?? {}
5092
5091
  }
5093
5092
  });
5094
5093
  if (kind === "app") {
@@ -5629,6 +5628,32 @@ const useCreatePublicSettingByUserId = (options) => {
5629
5628
  const mutationOptions = useCreatePublicSettingByUserIdMutationOptions(options);
5630
5629
  return useMutation(mutationOptions);
5631
5630
  };
5631
+ const useUploadBundleHook = () => {
5632
+ const uploadBundle = useCustomClient();
5633
+ return (key, uploadBundleBody) => {
5634
+ const formData = new FormData();
5635
+ formData.append("bundleFile", uploadBundleBody.bundleFile);
5636
+ return uploadBundle({
5637
+ url: `/api/apps/key/${key}/bundle`,
5638
+ method: "put",
5639
+ headers: { "Content-Type": "multipart/form-data" },
5640
+ data: formData
5641
+ });
5642
+ };
5643
+ };
5644
+ const useUploadBundleMutationOptions = (options) => {
5645
+ const { mutation: mutationOptions } = options ?? {};
5646
+ const uploadBundle = useUploadBundleHook();
5647
+ const mutationFn = (props) => {
5648
+ const { key, data } = props ?? {};
5649
+ return uploadBundle(key, data);
5650
+ };
5651
+ return { mutationFn, ...mutationOptions };
5652
+ };
5653
+ const useUploadBundle = (options) => {
5654
+ const mutationOptions = useUploadBundleMutationOptions(options);
5655
+ return useMutation(mutationOptions);
5656
+ };
5632
5657
  const useGetAllAppsHook = () => {
5633
5658
  const getAllApps = useCustomClient();
5634
5659
  return (signal) => {
@@ -6165,6 +6190,102 @@ const useGetAllRomaConfigurationByType = (type, options) => {
6165
6190
  query.queryKey = queryOptions.queryKey;
6166
6191
  return query;
6167
6192
  };
6193
+ const useCreateFeedbackHook = () => {
6194
+ const createFeedback = useCustomClient();
6195
+ return (feedbackDto) => {
6196
+ return createFeedback({
6197
+ url: `/api/feedbacks`,
6198
+ method: "post",
6199
+ headers: { "Content-Type": "application/json" },
6200
+ data: feedbackDto
6201
+ });
6202
+ };
6203
+ };
6204
+ const useCreateFeedbackMutationOptions = (options) => {
6205
+ const { mutation: mutationOptions } = options ?? {};
6206
+ const createFeedback = useCreateFeedbackHook();
6207
+ const mutationFn = (props) => {
6208
+ const { data } = props ?? {};
6209
+ return createFeedback(data);
6210
+ };
6211
+ return { mutationFn, ...mutationOptions };
6212
+ };
6213
+ const useCreateFeedback = (options) => {
6214
+ const mutationOptions = useCreateFeedbackMutationOptions(options);
6215
+ return useMutation(mutationOptions);
6216
+ };
6217
+ const findGroupMembers = async (client, groupId, query) => {
6218
+ const headers = {
6219
+ ConsistencyLevel: "eventual"
6220
+ // Required to search by name
6221
+ };
6222
+ const params = new URLSearchParams();
6223
+ params.set("$count", "true");
6224
+ params.set("$orderby", "displayName");
6225
+ params.set("$select", "displayName,id");
6226
+ if (query) {
6227
+ params.set("$search", `"displayName:${query}"`);
6228
+ }
6229
+ const req = await client.fetch(
6230
+ `v1.0/groups/${groupId}/members/microsoft.graph.user?${params.toString()}`,
6231
+ { headers }
6232
+ );
6233
+ if (req.status === 504) {
6234
+ throw new Error(`Application took to long to respond`);
6235
+ }
6236
+ const res = await req.json();
6237
+ if (req.status >= 400) {
6238
+ throw new Error(res.error.message);
6239
+ } else {
6240
+ return res;
6241
+ }
6242
+ };
6243
+ const useFindGroupMembers = (groupId, query) => {
6244
+ const client = useHttpClient("graph");
6245
+ return useQuery({
6246
+ queryKey: ["graph", "group", "members", groupId],
6247
+ queryFn: () => findGroupMembers(client, groupId, query)
6248
+ });
6249
+ };
6250
+ const findUsersByMail = async (client, email, fields) => {
6251
+ const headers = {
6252
+ ConsistencyLevel: "eventual"
6253
+ // Required to search by name
6254
+ };
6255
+ const params = new URLSearchParams();
6256
+ params.set("$count", "true");
6257
+ params.set("$filter", `mail in ('${email.join("', '")}')`);
6258
+ params.set("$select", fields.join(","));
6259
+ const req = await client.fetch(`v1.0/users?${params.toString()}`, {
6260
+ headers
6261
+ });
6262
+ if (req.status === 504) {
6263
+ throw new Error(`Application took to long to respond`);
6264
+ }
6265
+ const res = await req.json();
6266
+ if (req.status >= 400) {
6267
+ throw new Error(res.error.message);
6268
+ } else {
6269
+ return res;
6270
+ }
6271
+ };
6272
+ const useFindUsersByMail = (email, fields = ["displayName", "mail", "givenName"]) => {
6273
+ if (typeof email === "string") {
6274
+ email = [email];
6275
+ }
6276
+ const client = useHttpClient("graph");
6277
+ return useQuery({
6278
+ queryKey: ["graph", "user", "mail", email],
6279
+ queryFn: () => findUsersByMail(client, email, fields)
6280
+ });
6281
+ };
6282
+ const useFindUsersByShortname = (shortnames, fields = ["displayName", "mail", "givenName"]) => {
6283
+ if (typeof shortnames === "string") {
6284
+ shortnames = [shortnames];
6285
+ }
6286
+ const emails = shortnames.map((name) => `${name}@equinor.com`);
6287
+ return useFindUsersByMail(emails, fields);
6288
+ };
6168
6289
  function promisifyRequest(request) {
6169
6290
  return new Promise((resolve, reject) => {
6170
6291
  request.oncomplete = request.onsuccess = () => resolve(request.result);
@@ -6266,7 +6387,7 @@ const useGetApiRoles = (api) => {
6266
6387
  }
6267
6388
  const token = parseJwt(jwt);
6268
6389
  if (roles.length === 0)
6269
- setRoles(token.roles);
6390
+ setRoles((token == null ? void 0 : token.roles) ?? []);
6270
6391
  });
6271
6392
  return roles;
6272
6393
  };
@@ -6309,6 +6430,9 @@ export {
6309
6430
  useAddRomaConfigurationHook,
6310
6431
  useAddRomaConfigurationMutationOptions,
6311
6432
  useApps,
6433
+ useCreateFeedback,
6434
+ useCreateFeedbackHook,
6435
+ useCreateFeedbackMutationOptions,
6312
6436
  useCreateOrUpdateApp,
6313
6437
  useCreateOrUpdateAppHook,
6314
6438
  useCreateOrUpdateAppMutationOptions,
@@ -6342,6 +6466,9 @@ export {
6342
6466
  useDeleteServiceByKey,
6343
6467
  useDeleteServiceByKeyHook,
6344
6468
  useDeleteServiceByKeyMutationOptions,
6469
+ useFindGroupMembers,
6470
+ useFindUsersByMail,
6471
+ useFindUsersByShortname,
6345
6472
  useGetAllApps,
6346
6473
  useGetAllAppsHook,
6347
6474
  useGetAllAppsQueryOptions,
@@ -6401,5 +6528,8 @@ export {
6401
6528
  useUpdateRomaConfiguration,
6402
6529
  useUpdateRomaConfigurationHook,
6403
6530
  useUpdateRomaConfigurationMutationOptions,
6531
+ useUploadBundle,
6532
+ useUploadBundleHook,
6533
+ useUploadBundleMutationOptions,
6404
6534
  withStyleIsolation
6405
6535
  };
@@ -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 {};