@equinor/roma-framework 5.0.1 → 6.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/_commonjsHelpers-DKlypwS6.mjs +3277 -0
- package/cypress.mjs +31958 -49
- package/dev-portal/BAGVG3AX-CZ4YnljQ.mjs +37 -0
- package/dev-portal/KZB72KQG-Dk7Ih0xn.mjs +46 -0
- package/dev-portal/NITRNJ62-7tOtp9d-.mjs +12375 -0
- package/dev-portal/index-DYpA1xV-.mjs +102056 -0
- package/dev-portal/index.html +3 -2
- package/dev-portal/lib/api/roma/api/alarm-controller/alarm-controller.d.ts +97 -0
- package/dev-portal/lib/api/roma/api/alarm-group-controller/alarm-group-controller.d.ts +186 -0
- package/dev-portal/lib/api/roma/api/alarm-sse-controller/alarm-sse-controller.d.ts +36 -0
- package/dev-portal/lib/api/roma/api/app-controller/app-controller.d.ts +65 -31
- package/dev-portal/lib/api/roma/api/category-controller/category-controller.d.ts +57 -26
- package/dev-portal/lib/api/roma/api/environment-controller/environment-controller.d.ts +23 -10
- package/dev-portal/lib/api/roma/api/feedback-controller/feedback-controller.d.ts +29 -13
- package/dev-portal/lib/api/roma/api/health-controller/health-controller.d.ts +38 -0
- package/dev-portal/lib/api/roma/api/roma-configuration-controller/roma-configuration-controller.d.ts +99 -41
- package/dev-portal/lib/api/roma/api/server-side-event-controller/server-side-event-controller.d.ts +23 -7
- package/dev-portal/lib/api/roma/api/service-controller/service-controller.d.ts +57 -26
- package/dev-portal/lib/api/roma/api/setting-controller/setting-controller.d.ts +114 -47
- package/dev-portal/lib/api/roma/index.d.ts +4 -0
- package/dev-portal/lib/api/roma/model/adminDto.d.ts +6 -0
- package/dev-portal/lib/api/roma/model/adminDtoAdminType.d.ts +12 -0
- package/dev-portal/lib/api/roma/model/alarmDto.d.ts +19 -0
- package/dev-portal/lib/api/roma/model/alarmDtoPayload.d.ts +10 -0
- package/dev-portal/lib/api/roma/model/alarmDtoSeverity.d.ts +14 -0
- package/dev-portal/lib/api/roma/model/alarmDtoState.d.ts +12 -0
- package/dev-portal/lib/api/roma/model/alarmGroupDto.d.ts +16 -0
- package/dev-portal/lib/api/roma/model/appDto.d.ts +36 -11
- package/dev-portal/lib/api/roma/model/buildDto.d.ts +14 -0
- package/dev-portal/lib/api/roma/model/categoryDto.d.ts +4 -3
- package/dev-portal/lib/api/roma/model/clearAlarmRequest.d.ts +13 -0
- package/dev-portal/lib/api/roma/model/configDto.d.ts +6 -0
- package/dev-portal/lib/api/roma/model/environmentDto.d.ts +4 -4
- package/dev-portal/lib/api/roma/model/feedbackDetailsDto.d.ts +6 -3
- package/dev-portal/lib/api/roma/model/feedbackDto.d.ts +1 -1
- package/dev-portal/lib/api/roma/model/feedbackExpandedResponseDetailsDto.d.ts +7 -3
- package/dev-portal/lib/api/roma/model/feedbackExpandedResponseIssueDto.d.ts +3 -1
- package/dev-portal/lib/api/roma/model/feedbackPage.d.ts +7 -7
- package/dev-portal/lib/api/roma/model/feedbackResponseIssueDto.d.ts +3 -1
- package/dev-portal/lib/api/roma/model/feedbackSolutionDto.d.ts +2 -1
- package/dev-portal/lib/api/roma/model/getAllParams.d.ts +14 -0
- package/dev-portal/lib/api/roma/model/getAllRomaConfigurationTypes200Item.d.ts +1 -1
- package/dev-portal/lib/api/roma/model/index.d.ts +17 -1
- package/dev-portal/lib/api/roma/model/listFeedbacksByCurrentUserParams.d.ts +1 -1
- package/dev-portal/lib/api/roma/model/pageableObject.d.ts +2 -2
- package/dev-portal/lib/api/roma/model/raiseAlarmRequest.d.ts +15 -0
- package/dev-portal/lib/api/roma/model/raiseAlarmRequestPayload.d.ts +10 -0
- package/dev-portal/lib/api/roma/model/raiseAlarmRequestSeverity.d.ts +14 -0
- package/dev-portal/lib/api/roma/model/romaConfigurationDto.d.ts +10 -2
- package/dev-portal/lib/api/roma/model/serverSentEventAlarmDto.d.ts +9 -0
- package/dev-portal/lib/api/roma/model/serverSentEventStandardEventDto.d.ts +1 -2
- package/dev-portal/lib/api/roma/model/serviceDto.d.ts +13 -4
- package/dev-portal/lib/api/roma/model/settingDto.d.ts +10 -4
- package/dev-portal/lib/api/roma/model/sortObject.d.ts +3 -3
- package/dev-portal/lib/api/roma/model/uploadBundleBody.d.ts +1 -1
- package/dev-portal/lib/api/roma/model/versionDto.d.ts +4 -4
- package/dev-portal/lib/api/roma/model/visualizationDto.d.ts +12 -0
- package/dev-portal/lib/api/roma/use-client.d.ts +7 -7
- package/dev-portal/lib/dev-portal/AppLoader.d.ts +7 -1
- package/dev-portal/lib/dev-portal/AppViewer.d.ts +10 -0
- package/dev-portal/lib/dev-portal/EquinorLoader.d.ts +2 -2
- package/dev-portal/lib/dev-portal/PortalStyles.d.ts +8 -16
- package/dev-portal/lib/dev-portal/config/AppClient.d.ts +26 -16
- package/dev-portal/lib/style-provider.d.ts +2 -1
- package/dev-portal/package.json +41 -4
- package/dev-portal/roma-framework.css +478 -0
- package/lib/api/roma/api/alarm-controller/alarm-controller.d.ts +97 -0
- package/lib/api/roma/api/alarm-group-controller/alarm-group-controller.d.ts +186 -0
- package/lib/api/roma/api/alarm-sse-controller/alarm-sse-controller.d.ts +36 -0
- package/lib/api/roma/api/app-controller/app-controller.d.ts +65 -31
- package/lib/api/roma/api/category-controller/category-controller.d.ts +57 -26
- package/lib/api/roma/api/environment-controller/environment-controller.d.ts +23 -10
- package/lib/api/roma/api/feedback-controller/feedback-controller.d.ts +29 -13
- package/lib/api/roma/api/health-controller/health-controller.d.ts +38 -0
- package/lib/api/roma/api/roma-configuration-controller/roma-configuration-controller.d.ts +99 -41
- package/lib/api/roma/api/server-side-event-controller/server-side-event-controller.d.ts +23 -7
- package/lib/api/roma/api/service-controller/service-controller.d.ts +57 -26
- package/lib/api/roma/api/setting-controller/setting-controller.d.ts +114 -47
- package/lib/api/roma/index.d.ts +4 -0
- package/lib/api/roma/model/adminDto.d.ts +6 -0
- package/lib/api/roma/model/adminDtoAdminType.d.ts +12 -0
- package/lib/api/roma/model/alarmDto.d.ts +19 -0
- package/lib/api/roma/model/alarmDtoPayload.d.ts +10 -0
- package/lib/api/roma/model/alarmDtoSeverity.d.ts +14 -0
- package/lib/api/roma/model/alarmDtoState.d.ts +12 -0
- package/lib/api/roma/model/alarmGroupDto.d.ts +16 -0
- package/lib/api/roma/model/appDto.d.ts +36 -11
- package/lib/api/roma/model/buildDto.d.ts +14 -0
- package/lib/api/roma/model/categoryDto.d.ts +4 -3
- package/lib/api/roma/model/clearAlarmRequest.d.ts +13 -0
- package/lib/api/roma/model/configDto.d.ts +6 -0
- package/lib/api/roma/model/environmentDto.d.ts +4 -4
- package/lib/api/roma/model/feedbackDetailsDto.d.ts +6 -3
- package/lib/api/roma/model/feedbackDto.d.ts +1 -1
- package/lib/api/roma/model/feedbackExpandedResponseDetailsDto.d.ts +7 -3
- package/lib/api/roma/model/feedbackExpandedResponseIssueDto.d.ts +3 -1
- package/lib/api/roma/model/feedbackPage.d.ts +7 -7
- package/lib/api/roma/model/feedbackResponseIssueDto.d.ts +3 -1
- package/lib/api/roma/model/feedbackSolutionDto.d.ts +2 -1
- package/lib/api/roma/model/getAllParams.d.ts +14 -0
- package/lib/api/roma/model/getAllRomaConfigurationTypes200Item.d.ts +1 -1
- package/lib/api/roma/model/index.d.ts +17 -1
- package/lib/api/roma/model/listFeedbacksByCurrentUserParams.d.ts +1 -1
- package/lib/api/roma/model/pageableObject.d.ts +2 -2
- package/lib/api/roma/model/raiseAlarmRequest.d.ts +15 -0
- package/lib/api/roma/model/raiseAlarmRequestPayload.d.ts +10 -0
- package/lib/api/roma/model/raiseAlarmRequestSeverity.d.ts +14 -0
- package/lib/api/roma/model/romaConfigurationDto.d.ts +10 -2
- package/lib/api/roma/model/serverSentEventAlarmDto.d.ts +9 -0
- package/lib/api/roma/model/serverSentEventStandardEventDto.d.ts +1 -2
- package/lib/api/roma/model/serviceDto.d.ts +13 -4
- package/lib/api/roma/model/settingDto.d.ts +10 -4
- package/lib/api/roma/model/sortObject.d.ts +3 -3
- package/lib/api/roma/model/uploadBundleBody.d.ts +1 -1
- package/lib/api/roma/model/versionDto.d.ts +4 -4
- package/lib/api/roma/model/visualizationDto.d.ts +12 -0
- package/lib/api/roma/use-client.d.ts +7 -7
- package/lib/dev-portal/AppLoader.d.ts +7 -1
- package/lib/dev-portal/AppViewer.d.ts +10 -0
- package/lib/dev-portal/EquinorLoader.d.ts +2 -2
- package/lib/dev-portal/PortalStyles.d.ts +8 -16
- package/lib/dev-portal/config/AppClient.d.ts +26 -16
- package/lib/style-provider.d.ts +2 -1
- package/package.json +41 -4
- package/roma-framework.mjs +1076 -1161
- package/dev-portal/roma-framework.umd.js +0 -109513
- package/router-BRrTrnno.mjs +0 -6322
package/roma-framework.mjs
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useFramework, FrameworkProvider } from "@equinor/fusion-framework-react";
|
|
3
3
|
import { configureModules } from "@equinor/fusion-framework-app";
|
|
4
|
-
import * as React from "react";
|
|
5
4
|
import { useState, useEffect, lazy, useRef, createContext, useContext, useMemo } from "react";
|
|
6
5
|
import { ModuleProvider } from "@equinor/fusion-framework-react-module";
|
|
7
6
|
import styled, { StyleSheetManager, keyframes } from "styled-components";
|
|
8
7
|
import { EdsProvider, StarProgress, Typography, Card, Button, TopBar, Chip, SideSheet, Menu, Tooltip, Icon, List } from "@equinor/eds-core-react";
|
|
9
|
-
import { E as EmptyError, o as operate, c as createOperatorSubscriber, i as innerFrom, a as identity, b as isFunction,
|
|
8
|
+
import { E as EmptyError, o as operate, c as createOperatorSubscriber, i as innerFrom, a as identity, b as isFunction, u as useParams, L as Link, B as BehaviorSubject, f as firstValueFrom, g as getDefaultExportFromCjs, d as of, e as from } from "./_commonjsHelpers-DKlypwS6.mjs";
|
|
10
9
|
import { QueryClient, QueryClientProvider, useQueryClient, useMutation, useQuery } from "@tanstack/react-query";
|
|
10
|
+
import { IntlProvider } from "react-intl";
|
|
11
11
|
import { useCurrentApp, useApps as useApps$1 } from "@equinor/fusion-framework-react/app";
|
|
12
12
|
import { App } from "@equinor/fusion-framework-module-app/app";
|
|
13
13
|
import { tokens } from "@equinor/eds-tokens";
|
|
14
|
-
import "react-dom";
|
|
15
14
|
import { comment_more, accessible, account_circle, help_outline } from "@equinor/eds-icons";
|
|
16
15
|
import { enableAppModule } from "@equinor/fusion-framework-module-app";
|
|
17
16
|
import { enableContext } from "@equinor/fusion-framework-module-context";
|
|
18
17
|
import { enableNavigation } from "@equinor/fusion-framework-module-navigation";
|
|
19
|
-
import { ModuleConfigBuilder } from "@equinor/fusion-framework-module";
|
|
18
|
+
import { ModuleConfigBuilder, SemanticVersion } from "@equinor/fusion-framework-module";
|
|
20
19
|
import { enableServiceDiscovery } from "@equinor/fusion-framework-module-service-discovery";
|
|
21
20
|
import { useHttpClient } from "@equinor/fusion-framework-react-module-http";
|
|
22
21
|
const createExtraScopePlugin = (scope) => {
|
|
@@ -34,14 +33,14 @@ const createExtraScopePlugin = (scope) => {
|
|
|
34
33
|
};
|
|
35
34
|
return plugin;
|
|
36
35
|
};
|
|
37
|
-
const StyleProvider = ({ scope, children }) => {
|
|
36
|
+
const StyleProvider = ({ scope, children, version: version2 }) => {
|
|
38
37
|
const stylisPlugins = [];
|
|
39
38
|
if (scope) {
|
|
40
39
|
const plugin = createExtraScopePlugin(`#${scope}`);
|
|
41
40
|
Object.defineProperty(plugin, "name", { value: `style-scope-${scope}` });
|
|
42
41
|
stylisPlugins.push(plugin);
|
|
43
42
|
}
|
|
44
|
-
return /* @__PURE__ */ jsx(StyleSheetManager, { stylisPlugins, children: /* @__PURE__ */ jsx("div", { id: scope, children }) });
|
|
43
|
+
return /* @__PURE__ */ jsx(StyleSheetManager, { stylisPlugins, children: /* @__PURE__ */ jsx("div", { id: scope, "data-roma-version": version2, children }) });
|
|
45
44
|
};
|
|
46
45
|
function lastValueFrom(source, config) {
|
|
47
46
|
return new Promise(function(resolve, reject) {
|
|
@@ -198,8 +197,9 @@ const makeComponent = (Component, args, configure2) => lazy(async () => {
|
|
|
198
197
|
source: Component
|
|
199
198
|
});
|
|
200
199
|
const queryClient = args.query ?? new QueryClient();
|
|
200
|
+
const version2 = "6.0.0";
|
|
201
201
|
return {
|
|
202
|
-
default: () => /* @__PURE__ */ jsx(FrameworkProvider, { value: fusion, children: /* @__PURE__ */ jsx(IntlProvider, { locale: navigator.language, children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(StyleProvider, { scope: `roma-${appKey}`, children: /* @__PURE__ */ jsx(
|
|
202
|
+
default: () => /* @__PURE__ */ jsx(FrameworkProvider, { value: fusion, children: /* @__PURE__ */ jsx(IntlProvider, { locale: navigator.language, children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(StyleProvider, { scope: `roma-${appKey}`, version: version2, children: /* @__PURE__ */ jsx(
|
|
203
203
|
EdsEventProvider,
|
|
204
204
|
{
|
|
205
205
|
portalContainer: `roma-${appKey}`,
|
|
@@ -282,6 +282,44 @@ function getAppModule(app, framework) {
|
|
|
282
282
|
const appModuleScript = appModule.initialize();
|
|
283
283
|
return { appModule, appModuleScript };
|
|
284
284
|
}
|
|
285
|
+
async function loadCssAssets(app, container) {
|
|
286
|
+
const assets = app.metadata?.assets;
|
|
287
|
+
if (!assets || assets.length === 0)
|
|
288
|
+
return () => {
|
|
289
|
+
};
|
|
290
|
+
const cssAssets = assets.filter((url) => url.split("?")[0].endsWith(".css"));
|
|
291
|
+
const injectedStyles = [];
|
|
292
|
+
const results = await Promise.allSettled(
|
|
293
|
+
cssAssets.map(async (cssUrl) => {
|
|
294
|
+
const filename = cssUrl.split("?")[0].split("/").pop() ?? cssUrl;
|
|
295
|
+
const tag = `${app.appKey}-${filename}`;
|
|
296
|
+
if (container.querySelector(`style[data-asset="${tag}"]`)) return;
|
|
297
|
+
const response = await fetch(cssUrl);
|
|
298
|
+
if (!response.ok) {
|
|
299
|
+
console.warn(
|
|
300
|
+
`Failed to load CSS asset: ${cssUrl} (${response.status})`
|
|
301
|
+
);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
const cssText = await response.text();
|
|
305
|
+
const style = document.createElement("style");
|
|
306
|
+
style.setAttribute("data-asset", tag);
|
|
307
|
+
style.textContent = `@scope { ${cssText} }`;
|
|
308
|
+
container.appendChild(style);
|
|
309
|
+
injectedStyles.push(style);
|
|
310
|
+
})
|
|
311
|
+
);
|
|
312
|
+
for (const result of results) {
|
|
313
|
+
if (result.status === "rejected") {
|
|
314
|
+
console.warn("Failed to load CSS asset:", result.reason);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return () => {
|
|
318
|
+
for (const style of injectedStyles) {
|
|
319
|
+
style.remove();
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
}
|
|
285
323
|
function AppLoader({
|
|
286
324
|
app,
|
|
287
325
|
kind,
|
|
@@ -299,15 +337,15 @@ function AppLoader({
|
|
|
299
337
|
new CustomEvent(eventName, data)
|
|
300
338
|
);
|
|
301
339
|
};
|
|
302
|
-
function renderApplication(el) {
|
|
340
|
+
async function renderApplication(el) {
|
|
303
341
|
const { appModule, appModuleScript } = getAppModule(app, framework);
|
|
304
342
|
const [basename] = window.location.pathname.match(
|
|
305
343
|
/\/?apps\/[a-z|-]+(\/)?/g
|
|
306
344
|
) ?? [""];
|
|
307
|
-
lastValueFrom(appModuleScript).then((x) => {
|
|
345
|
+
const cleanup = await lastValueFrom(appModuleScript).then((x) => {
|
|
308
346
|
const script = x.script;
|
|
309
347
|
const render = script.renderApp ?? script.default;
|
|
310
|
-
render(el, {
|
|
348
|
+
const cleanup2 = render(el, {
|
|
311
349
|
query: queryClient,
|
|
312
350
|
fusion: framework,
|
|
313
351
|
env: {
|
|
@@ -323,8 +361,9 @@ function AppLoader({
|
|
|
323
361
|
if (kind === "app") {
|
|
324
362
|
setCurrentApp(app.appKey);
|
|
325
363
|
}
|
|
364
|
+
return cleanup2;
|
|
326
365
|
});
|
|
327
|
-
return appModule;
|
|
366
|
+
return { appModule, cleanup };
|
|
328
367
|
}
|
|
329
368
|
useEffect(() => {
|
|
330
369
|
setError(null);
|
|
@@ -336,15 +375,41 @@ function AppLoader({
|
|
|
336
375
|
setLoading(true);
|
|
337
376
|
const el = document.createElement("div");
|
|
338
377
|
ref.current?.appendChild(el);
|
|
339
|
-
|
|
378
|
+
let cleanupCss = () => {
|
|
379
|
+
ref.current?.removeChild(
|
|
380
|
+
document.querySelector("[data-asset]")
|
|
381
|
+
);
|
|
382
|
+
};
|
|
383
|
+
loadCssAssets(app, ref.current).then((cleanup2) => {
|
|
384
|
+
cleanupCss = cleanup2;
|
|
385
|
+
});
|
|
386
|
+
let appModule = null;
|
|
387
|
+
let cleanup = null;
|
|
388
|
+
let disposed = false;
|
|
389
|
+
renderApplication(el).then((r) => {
|
|
390
|
+
if (disposed) {
|
|
391
|
+
queueMicrotask(() => {
|
|
392
|
+
r.cleanup();
|
|
393
|
+
r.appModule.dispose();
|
|
394
|
+
});
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
appModule = r.appModule;
|
|
398
|
+
cleanup = r.cleanup;
|
|
399
|
+
});
|
|
340
400
|
setLoading(false);
|
|
341
401
|
const currentRef = ref.current;
|
|
342
402
|
return () => {
|
|
403
|
+
disposed = true;
|
|
404
|
+
cleanupCss?.();
|
|
343
405
|
try {
|
|
344
406
|
currentRef?.removeChild(el);
|
|
345
407
|
} catch {
|
|
346
408
|
}
|
|
347
|
-
|
|
409
|
+
queueMicrotask(() => {
|
|
410
|
+
if (appModule) appModule.dispose();
|
|
411
|
+
if (cleanup) cleanup();
|
|
412
|
+
});
|
|
348
413
|
if (kind === "app") clearCurrentApp();
|
|
349
414
|
};
|
|
350
415
|
}, [app]);
|
|
@@ -359,717 +424,6 @@ function AppLoader({
|
|
|
359
424
|
error && /* @__PURE__ */ jsx(ErrorViewer, { error })
|
|
360
425
|
] });
|
|
361
426
|
}
|
|
362
|
-
function _extends$1() {
|
|
363
|
-
_extends$1 = Object.assign ? Object.assign.bind() : function(target) {
|
|
364
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
365
|
-
var source = arguments[i];
|
|
366
|
-
for (var key in source) {
|
|
367
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
368
|
-
target[key] = source[key];
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
return target;
|
|
373
|
-
};
|
|
374
|
-
return _extends$1.apply(this, arguments);
|
|
375
|
-
}
|
|
376
|
-
const DataRouterContext = /* @__PURE__ */ React.createContext(null);
|
|
377
|
-
if (process.env.NODE_ENV !== "production") {
|
|
378
|
-
DataRouterContext.displayName = "DataRouter";
|
|
379
|
-
}
|
|
380
|
-
const DataRouterStateContext = /* @__PURE__ */ React.createContext(null);
|
|
381
|
-
if (process.env.NODE_ENV !== "production") {
|
|
382
|
-
DataRouterStateContext.displayName = "DataRouterState";
|
|
383
|
-
}
|
|
384
|
-
const AwaitContext = /* @__PURE__ */ React.createContext(null);
|
|
385
|
-
if (process.env.NODE_ENV !== "production") {
|
|
386
|
-
AwaitContext.displayName = "Await";
|
|
387
|
-
}
|
|
388
|
-
const NavigationContext = /* @__PURE__ */ React.createContext(null);
|
|
389
|
-
if (process.env.NODE_ENV !== "production") {
|
|
390
|
-
NavigationContext.displayName = "Navigation";
|
|
391
|
-
}
|
|
392
|
-
const LocationContext = /* @__PURE__ */ React.createContext(null);
|
|
393
|
-
if (process.env.NODE_ENV !== "production") {
|
|
394
|
-
LocationContext.displayName = "Location";
|
|
395
|
-
}
|
|
396
|
-
const RouteContext = /* @__PURE__ */ React.createContext({
|
|
397
|
-
outlet: null,
|
|
398
|
-
matches: [],
|
|
399
|
-
isDataRoute: false
|
|
400
|
-
});
|
|
401
|
-
if (process.env.NODE_ENV !== "production") {
|
|
402
|
-
RouteContext.displayName = "Route";
|
|
403
|
-
}
|
|
404
|
-
const RouteErrorContext = /* @__PURE__ */ React.createContext(null);
|
|
405
|
-
if (process.env.NODE_ENV !== "production") {
|
|
406
|
-
RouteErrorContext.displayName = "RouteError";
|
|
407
|
-
}
|
|
408
|
-
function useHref(to, _temp) {
|
|
409
|
-
let {
|
|
410
|
-
relative
|
|
411
|
-
} = _temp === void 0 ? {} : _temp;
|
|
412
|
-
!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
|
|
413
|
-
false,
|
|
414
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
415
|
-
// router loaded. We can help them understand how to avoid that.
|
|
416
|
-
"useHref() may be used only in the context of a <Router> component."
|
|
417
|
-
) : invariant(false) : void 0;
|
|
418
|
-
let {
|
|
419
|
-
basename,
|
|
420
|
-
navigator: navigator2
|
|
421
|
-
} = React.useContext(NavigationContext);
|
|
422
|
-
let {
|
|
423
|
-
hash,
|
|
424
|
-
pathname,
|
|
425
|
-
search
|
|
426
|
-
} = useResolvedPath(to, {
|
|
427
|
-
relative
|
|
428
|
-
});
|
|
429
|
-
let joinedPathname = pathname;
|
|
430
|
-
if (basename !== "/") {
|
|
431
|
-
joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname]);
|
|
432
|
-
}
|
|
433
|
-
return navigator2.createHref({
|
|
434
|
-
pathname: joinedPathname,
|
|
435
|
-
search,
|
|
436
|
-
hash
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
function useInRouterContext() {
|
|
440
|
-
return React.useContext(LocationContext) != null;
|
|
441
|
-
}
|
|
442
|
-
function useLocation() {
|
|
443
|
-
!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
|
|
444
|
-
false,
|
|
445
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
446
|
-
// router loaded. We can help them understand how to avoid that.
|
|
447
|
-
"useLocation() may be used only in the context of a <Router> component."
|
|
448
|
-
) : invariant(false) : void 0;
|
|
449
|
-
return React.useContext(LocationContext).location;
|
|
450
|
-
}
|
|
451
|
-
const navigateEffectWarning = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
452
|
-
function useIsomorphicLayoutEffect(cb) {
|
|
453
|
-
let isStatic = React.useContext(NavigationContext).static;
|
|
454
|
-
if (!isStatic) {
|
|
455
|
-
React.useLayoutEffect(cb);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
function useNavigate() {
|
|
459
|
-
let {
|
|
460
|
-
isDataRoute
|
|
461
|
-
} = React.useContext(RouteContext);
|
|
462
|
-
return isDataRoute ? useNavigateStable() : useNavigateUnstable();
|
|
463
|
-
}
|
|
464
|
-
function useNavigateUnstable() {
|
|
465
|
-
!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
|
|
466
|
-
false,
|
|
467
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
468
|
-
// router loaded. We can help them understand how to avoid that.
|
|
469
|
-
"useNavigate() may be used only in the context of a <Router> component."
|
|
470
|
-
) : invariant(false) : void 0;
|
|
471
|
-
let dataRouterContext = React.useContext(DataRouterContext);
|
|
472
|
-
let {
|
|
473
|
-
basename,
|
|
474
|
-
future,
|
|
475
|
-
navigator: navigator2
|
|
476
|
-
} = React.useContext(NavigationContext);
|
|
477
|
-
let {
|
|
478
|
-
matches
|
|
479
|
-
} = React.useContext(RouteContext);
|
|
480
|
-
let {
|
|
481
|
-
pathname: locationPathname
|
|
482
|
-
} = useLocation();
|
|
483
|
-
let routePathnamesJson = JSON.stringify(getResolveToMatches(matches, future.v7_relativeSplatPath));
|
|
484
|
-
let activeRef = React.useRef(false);
|
|
485
|
-
useIsomorphicLayoutEffect(() => {
|
|
486
|
-
activeRef.current = true;
|
|
487
|
-
});
|
|
488
|
-
let navigate = React.useCallback(function(to, options) {
|
|
489
|
-
if (options === void 0) {
|
|
490
|
-
options = {};
|
|
491
|
-
}
|
|
492
|
-
process.env.NODE_ENV !== "production" ? warning(activeRef.current, navigateEffectWarning) : void 0;
|
|
493
|
-
if (!activeRef.current) return;
|
|
494
|
-
if (typeof to === "number") {
|
|
495
|
-
navigator2.go(to);
|
|
496
|
-
return;
|
|
497
|
-
}
|
|
498
|
-
let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === "path");
|
|
499
|
-
if (dataRouterContext == null && basename !== "/") {
|
|
500
|
-
path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
|
|
501
|
-
}
|
|
502
|
-
(!!options.replace ? navigator2.replace : navigator2.push)(path, options.state, options);
|
|
503
|
-
}, [basename, navigator2, routePathnamesJson, locationPathname, dataRouterContext]);
|
|
504
|
-
return navigate;
|
|
505
|
-
}
|
|
506
|
-
function useParams() {
|
|
507
|
-
let {
|
|
508
|
-
matches
|
|
509
|
-
} = React.useContext(RouteContext);
|
|
510
|
-
let routeMatch = matches[matches.length - 1];
|
|
511
|
-
return routeMatch ? routeMatch.params : {};
|
|
512
|
-
}
|
|
513
|
-
function useResolvedPath(to, _temp2) {
|
|
514
|
-
let {
|
|
515
|
-
relative
|
|
516
|
-
} = _temp2 === void 0 ? {} : _temp2;
|
|
517
|
-
let {
|
|
518
|
-
future
|
|
519
|
-
} = React.useContext(NavigationContext);
|
|
520
|
-
let {
|
|
521
|
-
matches
|
|
522
|
-
} = React.useContext(RouteContext);
|
|
523
|
-
let {
|
|
524
|
-
pathname: locationPathname
|
|
525
|
-
} = useLocation();
|
|
526
|
-
let routePathnamesJson = JSON.stringify(getResolveToMatches(matches, future.v7_relativeSplatPath));
|
|
527
|
-
return React.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to, routePathnamesJson, locationPathname, relative]);
|
|
528
|
-
}
|
|
529
|
-
var DataRouterHook$1 = /* @__PURE__ */ (function(DataRouterHook2) {
|
|
530
|
-
DataRouterHook2["UseBlocker"] = "useBlocker";
|
|
531
|
-
DataRouterHook2["UseRevalidator"] = "useRevalidator";
|
|
532
|
-
DataRouterHook2["UseNavigateStable"] = "useNavigate";
|
|
533
|
-
return DataRouterHook2;
|
|
534
|
-
})(DataRouterHook$1 || {});
|
|
535
|
-
var DataRouterStateHook$1 = /* @__PURE__ */ (function(DataRouterStateHook2) {
|
|
536
|
-
DataRouterStateHook2["UseBlocker"] = "useBlocker";
|
|
537
|
-
DataRouterStateHook2["UseLoaderData"] = "useLoaderData";
|
|
538
|
-
DataRouterStateHook2["UseActionData"] = "useActionData";
|
|
539
|
-
DataRouterStateHook2["UseRouteError"] = "useRouteError";
|
|
540
|
-
DataRouterStateHook2["UseNavigation"] = "useNavigation";
|
|
541
|
-
DataRouterStateHook2["UseRouteLoaderData"] = "useRouteLoaderData";
|
|
542
|
-
DataRouterStateHook2["UseMatches"] = "useMatches";
|
|
543
|
-
DataRouterStateHook2["UseRevalidator"] = "useRevalidator";
|
|
544
|
-
DataRouterStateHook2["UseNavigateStable"] = "useNavigate";
|
|
545
|
-
DataRouterStateHook2["UseRouteId"] = "useRouteId";
|
|
546
|
-
return DataRouterStateHook2;
|
|
547
|
-
})(DataRouterStateHook$1 || {});
|
|
548
|
-
function getDataRouterConsoleError$1(hookName) {
|
|
549
|
-
return hookName + " must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.";
|
|
550
|
-
}
|
|
551
|
-
function useDataRouterContext$1(hookName) {
|
|
552
|
-
let ctx = React.useContext(DataRouterContext);
|
|
553
|
-
!ctx ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError$1(hookName)) : invariant(false) : void 0;
|
|
554
|
-
return ctx;
|
|
555
|
-
}
|
|
556
|
-
function useRouteContext(hookName) {
|
|
557
|
-
let route = React.useContext(RouteContext);
|
|
558
|
-
!route ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError$1(hookName)) : invariant(false) : void 0;
|
|
559
|
-
return route;
|
|
560
|
-
}
|
|
561
|
-
function useCurrentRouteId(hookName) {
|
|
562
|
-
let route = useRouteContext(hookName);
|
|
563
|
-
let thisRoute = route.matches[route.matches.length - 1];
|
|
564
|
-
!thisRoute.route.id ? process.env.NODE_ENV !== "production" ? invariant(false, hookName + ' can only be used on routes that contain a unique "id"') : invariant(false) : void 0;
|
|
565
|
-
return thisRoute.route.id;
|
|
566
|
-
}
|
|
567
|
-
function useRouteId() {
|
|
568
|
-
return useCurrentRouteId(DataRouterStateHook$1.UseRouteId);
|
|
569
|
-
}
|
|
570
|
-
function useNavigateStable() {
|
|
571
|
-
let {
|
|
572
|
-
router
|
|
573
|
-
} = useDataRouterContext$1(DataRouterHook$1.UseNavigateStable);
|
|
574
|
-
let id = useCurrentRouteId(DataRouterStateHook$1.UseNavigateStable);
|
|
575
|
-
let activeRef = React.useRef(false);
|
|
576
|
-
useIsomorphicLayoutEffect(() => {
|
|
577
|
-
activeRef.current = true;
|
|
578
|
-
});
|
|
579
|
-
let navigate = React.useCallback(function(to, options) {
|
|
580
|
-
if (options === void 0) {
|
|
581
|
-
options = {};
|
|
582
|
-
}
|
|
583
|
-
process.env.NODE_ENV !== "production" ? warning(activeRef.current, navigateEffectWarning) : void 0;
|
|
584
|
-
if (!activeRef.current) return;
|
|
585
|
-
if (typeof to === "number") {
|
|
586
|
-
router.navigate(to);
|
|
587
|
-
} else {
|
|
588
|
-
router.navigate(to, _extends$1({
|
|
589
|
-
fromRouteId: id
|
|
590
|
-
}, options));
|
|
591
|
-
}
|
|
592
|
-
}, [router, id]);
|
|
593
|
-
return navigate;
|
|
594
|
-
}
|
|
595
|
-
new Promise(() => {
|
|
596
|
-
});
|
|
597
|
-
function _extends() {
|
|
598
|
-
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
599
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
600
|
-
var source = arguments[i];
|
|
601
|
-
for (var key in source) {
|
|
602
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
603
|
-
target[key] = source[key];
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
return target;
|
|
608
|
-
};
|
|
609
|
-
return _extends.apply(this, arguments);
|
|
610
|
-
}
|
|
611
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
612
|
-
if (source == null) return {};
|
|
613
|
-
var target = {};
|
|
614
|
-
var sourceKeys = Object.keys(source);
|
|
615
|
-
var key, i;
|
|
616
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
617
|
-
key = sourceKeys[i];
|
|
618
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
619
|
-
target[key] = source[key];
|
|
620
|
-
}
|
|
621
|
-
return target;
|
|
622
|
-
}
|
|
623
|
-
const defaultMethod = "get";
|
|
624
|
-
const defaultEncType = "application/x-www-form-urlencoded";
|
|
625
|
-
function isHtmlElement(object2) {
|
|
626
|
-
return object2 != null && typeof object2.tagName === "string";
|
|
627
|
-
}
|
|
628
|
-
function isButtonElement(object2) {
|
|
629
|
-
return isHtmlElement(object2) && object2.tagName.toLowerCase() === "button";
|
|
630
|
-
}
|
|
631
|
-
function isFormElement(object2) {
|
|
632
|
-
return isHtmlElement(object2) && object2.tagName.toLowerCase() === "form";
|
|
633
|
-
}
|
|
634
|
-
function isInputElement(object2) {
|
|
635
|
-
return isHtmlElement(object2) && object2.tagName.toLowerCase() === "input";
|
|
636
|
-
}
|
|
637
|
-
function isModifiedEvent(event) {
|
|
638
|
-
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
|
|
639
|
-
}
|
|
640
|
-
function shouldProcessLinkClick(event, target) {
|
|
641
|
-
return event.button === 0 && // Ignore everything but left clicks
|
|
642
|
-
(!target || target === "_self") && // Let browser handle "target=_blank" etc.
|
|
643
|
-
!isModifiedEvent(event);
|
|
644
|
-
}
|
|
645
|
-
let _formDataSupportsSubmitter = null;
|
|
646
|
-
function isFormDataSubmitterSupported() {
|
|
647
|
-
if (_formDataSupportsSubmitter === null) {
|
|
648
|
-
try {
|
|
649
|
-
new FormData(
|
|
650
|
-
document.createElement("form"),
|
|
651
|
-
// @ts-expect-error if FormData supports the submitter parameter, this will throw
|
|
652
|
-
0
|
|
653
|
-
);
|
|
654
|
-
_formDataSupportsSubmitter = false;
|
|
655
|
-
} catch (e) {
|
|
656
|
-
_formDataSupportsSubmitter = true;
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
return _formDataSupportsSubmitter;
|
|
660
|
-
}
|
|
661
|
-
const supportedFormEncTypes = /* @__PURE__ */ new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
|
|
662
|
-
function getFormEncType(encType) {
|
|
663
|
-
if (encType != null && !supportedFormEncTypes.has(encType)) {
|
|
664
|
-
process.env.NODE_ENV !== "production" ? warning(false, '"' + encType + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' + defaultEncType + '"')) : void 0;
|
|
665
|
-
return null;
|
|
666
|
-
}
|
|
667
|
-
return encType;
|
|
668
|
-
}
|
|
669
|
-
function getFormSubmissionInfo(target, basename) {
|
|
670
|
-
let method;
|
|
671
|
-
let action;
|
|
672
|
-
let encType;
|
|
673
|
-
let formData;
|
|
674
|
-
let body;
|
|
675
|
-
if (isFormElement(target)) {
|
|
676
|
-
let attr = target.getAttribute("action");
|
|
677
|
-
action = attr ? stripBasename(attr, basename) : null;
|
|
678
|
-
method = target.getAttribute("method") || defaultMethod;
|
|
679
|
-
encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
|
|
680
|
-
formData = new FormData(target);
|
|
681
|
-
} else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) {
|
|
682
|
-
let form = target.form;
|
|
683
|
-
if (form == null) {
|
|
684
|
-
throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');
|
|
685
|
-
}
|
|
686
|
-
let attr = target.getAttribute("formaction") || form.getAttribute("action");
|
|
687
|
-
action = attr ? stripBasename(attr, basename) : null;
|
|
688
|
-
method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
|
|
689
|
-
encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
|
|
690
|
-
formData = new FormData(form, target);
|
|
691
|
-
if (!isFormDataSubmitterSupported()) {
|
|
692
|
-
let {
|
|
693
|
-
name,
|
|
694
|
-
type,
|
|
695
|
-
value
|
|
696
|
-
} = target;
|
|
697
|
-
if (type === "image") {
|
|
698
|
-
let prefix = name ? name + "." : "";
|
|
699
|
-
formData.append(prefix + "x", "0");
|
|
700
|
-
formData.append(prefix + "y", "0");
|
|
701
|
-
} else if (name) {
|
|
702
|
-
formData.append(name, value);
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
} else if (isHtmlElement(target)) {
|
|
706
|
-
throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');
|
|
707
|
-
} else {
|
|
708
|
-
method = defaultMethod;
|
|
709
|
-
action = null;
|
|
710
|
-
encType = defaultEncType;
|
|
711
|
-
body = target;
|
|
712
|
-
}
|
|
713
|
-
if (formData && encType === "text/plain") {
|
|
714
|
-
body = formData;
|
|
715
|
-
formData = void 0;
|
|
716
|
-
}
|
|
717
|
-
return {
|
|
718
|
-
action,
|
|
719
|
-
method: method.toLowerCase(),
|
|
720
|
-
encType,
|
|
721
|
-
formData,
|
|
722
|
-
body
|
|
723
|
-
};
|
|
724
|
-
}
|
|
725
|
-
const _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "viewTransition"], _excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "viewTransition", "children"], _excluded3 = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "viewTransition"];
|
|
726
|
-
const REACT_ROUTER_VERSION = "6";
|
|
727
|
-
try {
|
|
728
|
-
window.__reactRouterVersion = REACT_ROUTER_VERSION;
|
|
729
|
-
} catch (e) {
|
|
730
|
-
}
|
|
731
|
-
const ViewTransitionContext = /* @__PURE__ */ React.createContext({
|
|
732
|
-
isTransitioning: false
|
|
733
|
-
});
|
|
734
|
-
if (process.env.NODE_ENV !== "production") {
|
|
735
|
-
ViewTransitionContext.displayName = "ViewTransition";
|
|
736
|
-
}
|
|
737
|
-
const FetchersContext = /* @__PURE__ */ React.createContext(/* @__PURE__ */ new Map());
|
|
738
|
-
if (process.env.NODE_ENV !== "production") {
|
|
739
|
-
FetchersContext.displayName = "Fetchers";
|
|
740
|
-
}
|
|
741
|
-
if (process.env.NODE_ENV !== "production") ;
|
|
742
|
-
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
743
|
-
const ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
744
|
-
const Link = /* @__PURE__ */ React.forwardRef(function LinkWithRef(_ref7, ref) {
|
|
745
|
-
let {
|
|
746
|
-
onClick,
|
|
747
|
-
relative,
|
|
748
|
-
reloadDocument,
|
|
749
|
-
replace,
|
|
750
|
-
state,
|
|
751
|
-
target,
|
|
752
|
-
to,
|
|
753
|
-
preventScrollReset,
|
|
754
|
-
viewTransition
|
|
755
|
-
} = _ref7, rest = _objectWithoutPropertiesLoose(_ref7, _excluded);
|
|
756
|
-
let {
|
|
757
|
-
basename
|
|
758
|
-
} = React.useContext(NavigationContext);
|
|
759
|
-
let absoluteHref;
|
|
760
|
-
let isExternal = false;
|
|
761
|
-
if (typeof to === "string" && ABSOLUTE_URL_REGEX.test(to)) {
|
|
762
|
-
absoluteHref = to;
|
|
763
|
-
if (isBrowser) {
|
|
764
|
-
try {
|
|
765
|
-
let currentUrl = new URL(window.location.href);
|
|
766
|
-
let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);
|
|
767
|
-
let path = stripBasename(targetUrl.pathname, basename);
|
|
768
|
-
if (targetUrl.origin === currentUrl.origin && path != null) {
|
|
769
|
-
to = path + targetUrl.search + targetUrl.hash;
|
|
770
|
-
} else {
|
|
771
|
-
isExternal = true;
|
|
772
|
-
}
|
|
773
|
-
} catch (e) {
|
|
774
|
-
process.env.NODE_ENV !== "production" ? warning(false, '<Link to="' + to + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.') : void 0;
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
let href = useHref(to, {
|
|
779
|
-
relative
|
|
780
|
-
});
|
|
781
|
-
let internalOnClick = useLinkClickHandler(to, {
|
|
782
|
-
replace,
|
|
783
|
-
state,
|
|
784
|
-
target,
|
|
785
|
-
preventScrollReset,
|
|
786
|
-
relative,
|
|
787
|
-
viewTransition
|
|
788
|
-
});
|
|
789
|
-
function handleClick(event) {
|
|
790
|
-
if (onClick) onClick(event);
|
|
791
|
-
if (!event.defaultPrevented) {
|
|
792
|
-
internalOnClick(event);
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
return (
|
|
796
|
-
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
797
|
-
/* @__PURE__ */ React.createElement("a", _extends({}, rest, {
|
|
798
|
-
href: absoluteHref || href,
|
|
799
|
-
onClick: isExternal || reloadDocument ? onClick : handleClick,
|
|
800
|
-
ref,
|
|
801
|
-
target
|
|
802
|
-
}))
|
|
803
|
-
);
|
|
804
|
-
});
|
|
805
|
-
if (process.env.NODE_ENV !== "production") {
|
|
806
|
-
Link.displayName = "Link";
|
|
807
|
-
}
|
|
808
|
-
const NavLink = /* @__PURE__ */ React.forwardRef(function NavLinkWithRef(_ref8, ref) {
|
|
809
|
-
let {
|
|
810
|
-
"aria-current": ariaCurrentProp = "page",
|
|
811
|
-
caseSensitive = false,
|
|
812
|
-
className: classNameProp = "",
|
|
813
|
-
end = false,
|
|
814
|
-
style: styleProp,
|
|
815
|
-
to,
|
|
816
|
-
viewTransition,
|
|
817
|
-
children
|
|
818
|
-
} = _ref8, rest = _objectWithoutPropertiesLoose(_ref8, _excluded2);
|
|
819
|
-
let path = useResolvedPath(to, {
|
|
820
|
-
relative: rest.relative
|
|
821
|
-
});
|
|
822
|
-
let location = useLocation();
|
|
823
|
-
let routerState = React.useContext(DataRouterStateContext);
|
|
824
|
-
let {
|
|
825
|
-
navigator: navigator2,
|
|
826
|
-
basename
|
|
827
|
-
} = React.useContext(NavigationContext);
|
|
828
|
-
let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
|
|
829
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
830
|
-
useViewTransitionState(path) && viewTransition === true;
|
|
831
|
-
let toPathname = navigator2.encodeLocation ? navigator2.encodeLocation(path).pathname : path.pathname;
|
|
832
|
-
let locationPathname = location.pathname;
|
|
833
|
-
let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;
|
|
834
|
-
if (!caseSensitive) {
|
|
835
|
-
locationPathname = locationPathname.toLowerCase();
|
|
836
|
-
nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;
|
|
837
|
-
toPathname = toPathname.toLowerCase();
|
|
838
|
-
}
|
|
839
|
-
if (nextLocationPathname && basename) {
|
|
840
|
-
nextLocationPathname = stripBasename(nextLocationPathname, basename) || nextLocationPathname;
|
|
841
|
-
}
|
|
842
|
-
const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
|
|
843
|
-
let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
|
|
844
|
-
let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/");
|
|
845
|
-
let renderProps = {
|
|
846
|
-
isActive,
|
|
847
|
-
isPending,
|
|
848
|
-
isTransitioning
|
|
849
|
-
};
|
|
850
|
-
let ariaCurrent = isActive ? ariaCurrentProp : void 0;
|
|
851
|
-
let className;
|
|
852
|
-
if (typeof classNameProp === "function") {
|
|
853
|
-
className = classNameProp(renderProps);
|
|
854
|
-
} else {
|
|
855
|
-
className = [classNameProp, isActive ? "active" : null, isPending ? "pending" : null, isTransitioning ? "transitioning" : null].filter(Boolean).join(" ");
|
|
856
|
-
}
|
|
857
|
-
let style = typeof styleProp === "function" ? styleProp(renderProps) : styleProp;
|
|
858
|
-
return /* @__PURE__ */ React.createElement(Link, _extends({}, rest, {
|
|
859
|
-
"aria-current": ariaCurrent,
|
|
860
|
-
className,
|
|
861
|
-
ref,
|
|
862
|
-
style,
|
|
863
|
-
to,
|
|
864
|
-
viewTransition
|
|
865
|
-
}), typeof children === "function" ? children(renderProps) : children);
|
|
866
|
-
});
|
|
867
|
-
if (process.env.NODE_ENV !== "production") {
|
|
868
|
-
NavLink.displayName = "NavLink";
|
|
869
|
-
}
|
|
870
|
-
const Form = /* @__PURE__ */ React.forwardRef((_ref9, forwardedRef) => {
|
|
871
|
-
let {
|
|
872
|
-
fetcherKey,
|
|
873
|
-
navigate,
|
|
874
|
-
reloadDocument,
|
|
875
|
-
replace,
|
|
876
|
-
state,
|
|
877
|
-
method = defaultMethod,
|
|
878
|
-
action,
|
|
879
|
-
onSubmit,
|
|
880
|
-
relative,
|
|
881
|
-
preventScrollReset,
|
|
882
|
-
viewTransition
|
|
883
|
-
} = _ref9, props = _objectWithoutPropertiesLoose(_ref9, _excluded3);
|
|
884
|
-
let submit = useSubmit();
|
|
885
|
-
let formAction = useFormAction(action, {
|
|
886
|
-
relative
|
|
887
|
-
});
|
|
888
|
-
let formMethod = method.toLowerCase() === "get" ? "get" : "post";
|
|
889
|
-
let submitHandler = (event) => {
|
|
890
|
-
onSubmit && onSubmit(event);
|
|
891
|
-
if (event.defaultPrevented) return;
|
|
892
|
-
event.preventDefault();
|
|
893
|
-
let submitter = event.nativeEvent.submitter;
|
|
894
|
-
let submitMethod = (submitter == null ? void 0 : submitter.getAttribute("formmethod")) || method;
|
|
895
|
-
submit(submitter || event.currentTarget, {
|
|
896
|
-
fetcherKey,
|
|
897
|
-
method: submitMethod,
|
|
898
|
-
navigate,
|
|
899
|
-
replace,
|
|
900
|
-
state,
|
|
901
|
-
relative,
|
|
902
|
-
preventScrollReset,
|
|
903
|
-
viewTransition
|
|
904
|
-
});
|
|
905
|
-
};
|
|
906
|
-
return /* @__PURE__ */ React.createElement("form", _extends({
|
|
907
|
-
ref: forwardedRef,
|
|
908
|
-
method: formMethod,
|
|
909
|
-
action: formAction,
|
|
910
|
-
onSubmit: reloadDocument ? onSubmit : submitHandler
|
|
911
|
-
}, props));
|
|
912
|
-
});
|
|
913
|
-
if (process.env.NODE_ENV !== "production") {
|
|
914
|
-
Form.displayName = "Form";
|
|
915
|
-
}
|
|
916
|
-
if (process.env.NODE_ENV !== "production") ;
|
|
917
|
-
var DataRouterHook;
|
|
918
|
-
(function(DataRouterHook2) {
|
|
919
|
-
DataRouterHook2["UseScrollRestoration"] = "useScrollRestoration";
|
|
920
|
-
DataRouterHook2["UseSubmit"] = "useSubmit";
|
|
921
|
-
DataRouterHook2["UseSubmitFetcher"] = "useSubmitFetcher";
|
|
922
|
-
DataRouterHook2["UseFetcher"] = "useFetcher";
|
|
923
|
-
DataRouterHook2["useViewTransitionState"] = "useViewTransitionState";
|
|
924
|
-
})(DataRouterHook || (DataRouterHook = {}));
|
|
925
|
-
var DataRouterStateHook;
|
|
926
|
-
(function(DataRouterStateHook2) {
|
|
927
|
-
DataRouterStateHook2["UseFetcher"] = "useFetcher";
|
|
928
|
-
DataRouterStateHook2["UseFetchers"] = "useFetchers";
|
|
929
|
-
DataRouterStateHook2["UseScrollRestoration"] = "useScrollRestoration";
|
|
930
|
-
})(DataRouterStateHook || (DataRouterStateHook = {}));
|
|
931
|
-
function getDataRouterConsoleError(hookName) {
|
|
932
|
-
return hookName + " must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.";
|
|
933
|
-
}
|
|
934
|
-
function useDataRouterContext(hookName) {
|
|
935
|
-
let ctx = React.useContext(DataRouterContext);
|
|
936
|
-
!ctx ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
|
|
937
|
-
return ctx;
|
|
938
|
-
}
|
|
939
|
-
function useLinkClickHandler(to, _temp) {
|
|
940
|
-
let {
|
|
941
|
-
target,
|
|
942
|
-
replace: replaceProp,
|
|
943
|
-
state,
|
|
944
|
-
preventScrollReset,
|
|
945
|
-
relative,
|
|
946
|
-
viewTransition
|
|
947
|
-
} = _temp === void 0 ? {} : _temp;
|
|
948
|
-
let navigate = useNavigate();
|
|
949
|
-
let location = useLocation();
|
|
950
|
-
let path = useResolvedPath(to, {
|
|
951
|
-
relative
|
|
952
|
-
});
|
|
953
|
-
return React.useCallback((event) => {
|
|
954
|
-
if (shouldProcessLinkClick(event, target)) {
|
|
955
|
-
event.preventDefault();
|
|
956
|
-
let replace = replaceProp !== void 0 ? replaceProp : createPath(location) === createPath(path);
|
|
957
|
-
navigate(to, {
|
|
958
|
-
replace,
|
|
959
|
-
state,
|
|
960
|
-
preventScrollReset,
|
|
961
|
-
relative,
|
|
962
|
-
viewTransition
|
|
963
|
-
});
|
|
964
|
-
}
|
|
965
|
-
}, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative, viewTransition]);
|
|
966
|
-
}
|
|
967
|
-
function validateClientSideSubmission() {
|
|
968
|
-
if (typeof document === "undefined") {
|
|
969
|
-
throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
let fetcherId = 0;
|
|
973
|
-
let getUniqueFetcherId = () => "__" + String(++fetcherId) + "__";
|
|
974
|
-
function useSubmit() {
|
|
975
|
-
let {
|
|
976
|
-
router
|
|
977
|
-
} = useDataRouterContext(DataRouterHook.UseSubmit);
|
|
978
|
-
let {
|
|
979
|
-
basename
|
|
980
|
-
} = React.useContext(NavigationContext);
|
|
981
|
-
let currentRouteId = useRouteId();
|
|
982
|
-
return React.useCallback(function(target, options) {
|
|
983
|
-
if (options === void 0) {
|
|
984
|
-
options = {};
|
|
985
|
-
}
|
|
986
|
-
validateClientSideSubmission();
|
|
987
|
-
let {
|
|
988
|
-
action,
|
|
989
|
-
method,
|
|
990
|
-
encType,
|
|
991
|
-
formData,
|
|
992
|
-
body
|
|
993
|
-
} = getFormSubmissionInfo(target, basename);
|
|
994
|
-
if (options.navigate === false) {
|
|
995
|
-
let key = options.fetcherKey || getUniqueFetcherId();
|
|
996
|
-
router.fetch(key, currentRouteId, options.action || action, {
|
|
997
|
-
preventScrollReset: options.preventScrollReset,
|
|
998
|
-
formData,
|
|
999
|
-
body,
|
|
1000
|
-
formMethod: options.method || method,
|
|
1001
|
-
formEncType: options.encType || encType,
|
|
1002
|
-
flushSync: options.flushSync
|
|
1003
|
-
});
|
|
1004
|
-
} else {
|
|
1005
|
-
router.navigate(options.action || action, {
|
|
1006
|
-
preventScrollReset: options.preventScrollReset,
|
|
1007
|
-
formData,
|
|
1008
|
-
body,
|
|
1009
|
-
formMethod: options.method || method,
|
|
1010
|
-
formEncType: options.encType || encType,
|
|
1011
|
-
replace: options.replace,
|
|
1012
|
-
state: options.state,
|
|
1013
|
-
fromRouteId: currentRouteId,
|
|
1014
|
-
flushSync: options.flushSync,
|
|
1015
|
-
viewTransition: options.viewTransition
|
|
1016
|
-
});
|
|
1017
|
-
}
|
|
1018
|
-
}, [router, basename, currentRouteId]);
|
|
1019
|
-
}
|
|
1020
|
-
function useFormAction(action, _temp2) {
|
|
1021
|
-
let {
|
|
1022
|
-
relative
|
|
1023
|
-
} = _temp2 === void 0 ? {} : _temp2;
|
|
1024
|
-
let {
|
|
1025
|
-
basename
|
|
1026
|
-
} = React.useContext(NavigationContext);
|
|
1027
|
-
let routeContext = React.useContext(RouteContext);
|
|
1028
|
-
!routeContext ? process.env.NODE_ENV !== "production" ? invariant(false, "useFormAction must be used inside a RouteContext") : invariant(false) : void 0;
|
|
1029
|
-
let [match] = routeContext.matches.slice(-1);
|
|
1030
|
-
let path = _extends({}, useResolvedPath(action ? action : ".", {
|
|
1031
|
-
relative
|
|
1032
|
-
}));
|
|
1033
|
-
let location = useLocation();
|
|
1034
|
-
if (action == null) {
|
|
1035
|
-
path.search = location.search;
|
|
1036
|
-
let params = new URLSearchParams(path.search);
|
|
1037
|
-
let indexValues = params.getAll("index");
|
|
1038
|
-
let hasNakedIndexParam = indexValues.some((v) => v === "");
|
|
1039
|
-
if (hasNakedIndexParam) {
|
|
1040
|
-
params.delete("index");
|
|
1041
|
-
indexValues.filter((v) => v).forEach((v) => params.append("index", v));
|
|
1042
|
-
let qs = params.toString();
|
|
1043
|
-
path.search = qs ? "?" + qs : "";
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
if ((!action || action === ".") && match.route.index) {
|
|
1047
|
-
path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
|
|
1048
|
-
}
|
|
1049
|
-
if (basename !== "/") {
|
|
1050
|
-
path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
|
|
1051
|
-
}
|
|
1052
|
-
return createPath(path);
|
|
1053
|
-
}
|
|
1054
|
-
function useViewTransitionState(to, opts) {
|
|
1055
|
-
if (opts === void 0) {
|
|
1056
|
-
opts = {};
|
|
1057
|
-
}
|
|
1058
|
-
let vtContext = React.useContext(ViewTransitionContext);
|
|
1059
|
-
!(vtContext != null) ? process.env.NODE_ENV !== "production" ? invariant(false, "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?") : invariant(false) : void 0;
|
|
1060
|
-
let {
|
|
1061
|
-
basename
|
|
1062
|
-
} = useDataRouterContext(DataRouterHook.useViewTransitionState);
|
|
1063
|
-
let path = useResolvedPath(to, {
|
|
1064
|
-
relative: opts.relative
|
|
1065
|
-
});
|
|
1066
|
-
if (!vtContext.isTransitioning) {
|
|
1067
|
-
return false;
|
|
1068
|
-
}
|
|
1069
|
-
let currentPath = stripBasename(vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
|
|
1070
|
-
let nextPath = stripBasename(vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
|
|
1071
|
-
return matchPath(path.pathname, nextPath) != null || matchPath(path.pathname, currentPath) != null;
|
|
1072
|
-
}
|
|
1073
427
|
const AppContext = createContext({
|
|
1074
428
|
isLoading: false,
|
|
1075
429
|
apps: void 0
|
|
@@ -1122,6 +476,13 @@ const useApps = ({ includeHidden } = {}) => {
|
|
|
1122
476
|
return { isLoading, apps, error };
|
|
1123
477
|
}, [allApps, includeHidden, isLoading, error]);
|
|
1124
478
|
};
|
|
479
|
+
const handle = {
|
|
480
|
+
route: {
|
|
481
|
+
description: "App Viewer",
|
|
482
|
+
params: { appKey: "The key of the app to view" },
|
|
483
|
+
search: {}
|
|
484
|
+
}
|
|
485
|
+
};
|
|
1125
486
|
const AppViewer = () => {
|
|
1126
487
|
const { appKey } = useParams();
|
|
1127
488
|
const { apps } = useApps({ includeHidden: true });
|
|
@@ -1162,8 +523,9 @@ const slideLeft = keyframes`
|
|
|
1162
523
|
const TopBarFadeIn = styled(TopBar)`
|
|
1163
524
|
animation: ${fadeIn} 0.6s alternate ease-in-out;
|
|
1164
525
|
padding-left: 0;
|
|
1165
|
-
|
|
526
|
+
width: 100vw;
|
|
1166
527
|
left: 0;
|
|
528
|
+
position: fixed;
|
|
1167
529
|
`;
|
|
1168
530
|
const Styled = {
|
|
1169
531
|
Title: styled.div`
|
|
@@ -1234,7 +596,7 @@ const HeaderMenu = ({ menuState }) => {
|
|
|
1234
596
|
const user = useMemo(() => {
|
|
1235
597
|
return auth.account;
|
|
1236
598
|
}, [auth]);
|
|
1237
|
-
|
|
599
|
+
useMemo(() => {
|
|
1238
600
|
return user?.idTokenClaims?.roles ?? ["No access role"];
|
|
1239
601
|
}, [user]);
|
|
1240
602
|
const getFeedbackAreaFromTags = (currentApp2, applications2) => {
|
|
@@ -1317,27 +679,24 @@ const HeaderMenu = ({ menuState }) => {
|
|
|
1317
679
|
children: /* @__PURE__ */ jsx(Icon, { data: account_circle })
|
|
1318
680
|
}
|
|
1319
681
|
) }),
|
|
1320
|
-
/* @__PURE__ */
|
|
682
|
+
/* @__PURE__ */ jsx(
|
|
1321
683
|
StyledMenu,
|
|
1322
684
|
{
|
|
1323
685
|
onClose: () => menuState.setUserMenuOpen(false),
|
|
1324
686
|
anchorEl: userRef.current,
|
|
1325
687
|
open: menuState.userMenuOpen,
|
|
1326
|
-
children: [
|
|
1327
|
-
/* @__PURE__ */
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
{
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
] }),
|
|
1339
|
-
/* @__PURE__ */ jsx(Menu.Section, { title: "Roles", children: roles.map((r) => /* @__PURE__ */ jsx(Menu.Item, { children: r }, r)) })
|
|
1340
|
-
]
|
|
688
|
+
children: /* @__PURE__ */ jsxs(Menu.Section, { title: "Profile", children: [
|
|
689
|
+
/* @__PURE__ */ jsx(Menu.Item, { children: user.name }),
|
|
690
|
+
/* @__PURE__ */ jsx(
|
|
691
|
+
Menu.Item,
|
|
692
|
+
{
|
|
693
|
+
onClick: () => auth.logout({
|
|
694
|
+
redirectUri: window.location.origin
|
|
695
|
+
}),
|
|
696
|
+
children: "Sign out"
|
|
697
|
+
}
|
|
698
|
+
)
|
|
699
|
+
] })
|
|
1341
700
|
}
|
|
1342
701
|
),
|
|
1343
702
|
/* @__PURE__ */ jsx(Tooltip, { title: "Release notes", children: /* @__PURE__ */ jsx(
|
|
@@ -1382,7 +741,7 @@ const Header = () => {
|
|
|
1382
741
|
});
|
|
1383
742
|
}, []);
|
|
1384
743
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1385
|
-
/* @__PURE__ */ jsxs(
|
|
744
|
+
/* @__PURE__ */ jsx("div", { style: { width: "99vw", height: "64px" }, children: /* @__PURE__ */ jsxs(
|
|
1386
745
|
TopBarFadeIn,
|
|
1387
746
|
{
|
|
1388
747
|
id: "cli-top-bar",
|
|
@@ -1399,7 +758,7 @@ const Header = () => {
|
|
|
1399
758
|
/* @__PURE__ */ jsx(TopBar.Actions, { children: /* @__PURE__ */ jsx(HeaderMenu, { menuState: headerMenuState }) })
|
|
1400
759
|
]
|
|
1401
760
|
}
|
|
1402
|
-
),
|
|
761
|
+
) }),
|
|
1403
762
|
/* @__PURE__ */ jsx(SideSheets, { apps: allApps, menuState: headerMenuState })
|
|
1404
763
|
] });
|
|
1405
764
|
};
|
|
@@ -1749,6 +1108,7 @@ class Connection {
|
|
|
1749
1108
|
}
|
|
1750
1109
|
class SseModuleProvider {
|
|
1751
1110
|
#config;
|
|
1111
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1752
1112
|
#connections = {};
|
|
1753
1113
|
constructor(config) {
|
|
1754
1114
|
this.#config = config;
|
|
@@ -1805,9 +1165,11 @@ class SseConfigurator {
|
|
|
1805
1165
|
return { endpoints: this.#endpoints };
|
|
1806
1166
|
}
|
|
1807
1167
|
}
|
|
1168
|
+
const version = "0.0.2";
|
|
1808
1169
|
const moduleKey = "sse";
|
|
1809
1170
|
const module$1 = {
|
|
1810
1171
|
name: moduleKey,
|
|
1172
|
+
version: new SemanticVersion(version),
|
|
1811
1173
|
configure: () => new SseConfigurator(),
|
|
1812
1174
|
initialize: async (init) => {
|
|
1813
1175
|
const config = await init.config.createConfig(init);
|
|
@@ -4416,6 +3778,7 @@ ${error.join("\n")}`);
|
|
|
4416
3778
|
});
|
|
4417
3779
|
enableNavigation(config);
|
|
4418
3780
|
enableSse(config, "activity");
|
|
3781
|
+
enableSse(config, "roma-alarm");
|
|
4419
3782
|
config.onConfigured(() => {
|
|
4420
3783
|
console.info("Fusion config done");
|
|
4421
3784
|
});
|
|
@@ -4475,16 +3838,13 @@ const HttpErrorViewer = ({ error }) => {
|
|
|
4475
3838
|
};
|
|
4476
3839
|
const useCustomClient = () => {
|
|
4477
3840
|
const client = useHttpClient("portal");
|
|
4478
|
-
return async ({
|
|
4479
|
-
url,
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
data,
|
|
4484
|
-
signal
|
|
4485
|
-
}) => {
|
|
3841
|
+
return async (uriOrOptions, options) => {
|
|
3842
|
+
const { url, method, params, headers, signal, body } = {
|
|
3843
|
+
url: uriOrOptions,
|
|
3844
|
+
...options
|
|
3845
|
+
};
|
|
4486
3846
|
const response = await client.fetch(
|
|
4487
|
-
`${url}` + new URLSearchParams(params),
|
|
3847
|
+
`${url ?? uriOrOptions}` + new URLSearchParams(params),
|
|
4488
3848
|
{
|
|
4489
3849
|
method,
|
|
4490
3850
|
// Request method
|
|
@@ -4492,8 +3852,7 @@ const useCustomClient = () => {
|
|
|
4492
3852
|
// Abort signal
|
|
4493
3853
|
headers,
|
|
4494
3854
|
// Additional headers
|
|
4495
|
-
|
|
4496
|
-
// Add body if data is provided
|
|
3855
|
+
body
|
|
4497
3856
|
}
|
|
4498
3857
|
);
|
|
4499
3858
|
let value;
|
|
@@ -4526,13 +3885,15 @@ let HttpError$1 = class HttpError extends Error {
|
|
|
4526
3885
|
this.response = response;
|
|
4527
3886
|
}
|
|
4528
3887
|
};
|
|
3888
|
+
const getGetSettingByUserAndIdUrl = (userId, id) => {
|
|
3889
|
+
return `/api/settings/user/${userId}/id/${id}`;
|
|
3890
|
+
};
|
|
4529
3891
|
const useGetSettingByUserAndIdHook = () => {
|
|
4530
|
-
const
|
|
4531
|
-
return (userId, id,
|
|
4532
|
-
return
|
|
4533
|
-
|
|
4534
|
-
method: "
|
|
4535
|
-
signal
|
|
3892
|
+
const customFetcher = useCustomClient();
|
|
3893
|
+
return (userId, id, options) => {
|
|
3894
|
+
return customFetcher(getGetSettingByUserAndIdUrl(userId, id), {
|
|
3895
|
+
...options,
|
|
3896
|
+
method: "GET"
|
|
4536
3897
|
});
|
|
4537
3898
|
};
|
|
4538
3899
|
};
|
|
@@ -4540,10 +3901,10 @@ const getGetSettingByUserAndIdQueryKey = (userId, id) => {
|
|
|
4540
3901
|
return [`/api/settings/user/${userId}/id/${id}`];
|
|
4541
3902
|
};
|
|
4542
3903
|
const useGetSettingByUserAndIdQueryOptions = (userId, id, options) => {
|
|
4543
|
-
const { query: queryOptions } = options ?? {};
|
|
3904
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4544
3905
|
const queryKey = queryOptions?.queryKey ?? getGetSettingByUserAndIdQueryKey(userId, id);
|
|
4545
3906
|
const getSettingByUserAndId = useGetSettingByUserAndIdHook();
|
|
4546
|
-
const queryFn = ({ signal }) => getSettingByUserAndId(userId, id, signal);
|
|
3907
|
+
const queryFn = ({ signal }) => getSettingByUserAndId(userId, id, { signal, ...requestOptions });
|
|
4547
3908
|
return {
|
|
4548
3909
|
queryKey,
|
|
4549
3910
|
queryFn,
|
|
@@ -4551,69 +3912,82 @@ const useGetSettingByUserAndIdQueryOptions = (userId, id, options) => {
|
|
|
4551
3912
|
...queryOptions
|
|
4552
3913
|
};
|
|
4553
3914
|
};
|
|
4554
|
-
|
|
3915
|
+
function useGetSettingByUserAndId(userId, id, options, queryClient) {
|
|
4555
3916
|
const queryOptions = useGetSettingByUserAndIdQueryOptions(
|
|
4556
3917
|
userId,
|
|
4557
3918
|
id,
|
|
4558
3919
|
options
|
|
4559
3920
|
);
|
|
4560
|
-
const query = useQuery(queryOptions);
|
|
4561
|
-
query
|
|
4562
|
-
|
|
3921
|
+
const query = useQuery(queryOptions, queryClient);
|
|
3922
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
3923
|
+
}
|
|
3924
|
+
const getUpdateByUserIdAndIdUrl = (userId, id) => {
|
|
3925
|
+
return `/api/settings/user/${userId}/id/${id}`;
|
|
4563
3926
|
};
|
|
4564
3927
|
const useUpdateByUserIdAndIdHook = () => {
|
|
4565
|
-
const
|
|
4566
|
-
return (userId, id, settingDto) => {
|
|
4567
|
-
return
|
|
4568
|
-
|
|
4569
|
-
method: "
|
|
4570
|
-
headers: { "Content-Type": "application/json" },
|
|
4571
|
-
|
|
3928
|
+
const customFetcher = useCustomClient();
|
|
3929
|
+
return (userId, id, settingDto, options) => {
|
|
3930
|
+
return customFetcher(getUpdateByUserIdAndIdUrl(userId, id), {
|
|
3931
|
+
...options,
|
|
3932
|
+
method: "PUT",
|
|
3933
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
3934
|
+
body: JSON.stringify(settingDto)
|
|
4572
3935
|
});
|
|
4573
3936
|
};
|
|
4574
3937
|
};
|
|
4575
3938
|
const useUpdateByUserIdAndIdMutationOptions = (options) => {
|
|
4576
|
-
const
|
|
3939
|
+
const mutationKey = ["updateByUserIdAndId"];
|
|
3940
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
4577
3941
|
const updateByUserIdAndId = useUpdateByUserIdAndIdHook();
|
|
4578
3942
|
const mutationFn = (props) => {
|
|
4579
3943
|
const { userId, id, data } = props ?? {};
|
|
4580
|
-
return updateByUserIdAndId(userId, id, data);
|
|
3944
|
+
return updateByUserIdAndId(userId, id, data, requestOptions);
|
|
4581
3945
|
};
|
|
4582
3946
|
return { mutationFn, ...mutationOptions };
|
|
4583
3947
|
};
|
|
4584
|
-
const useUpdateByUserIdAndId = (options) => {
|
|
4585
|
-
|
|
4586
|
-
|
|
3948
|
+
const useUpdateByUserIdAndId = (options, queryClient) => {
|
|
3949
|
+
return useMutation(
|
|
3950
|
+
useUpdateByUserIdAndIdMutationOptions(options),
|
|
3951
|
+
queryClient
|
|
3952
|
+
);
|
|
3953
|
+
};
|
|
3954
|
+
const getDeletePrivateSettingByIdUrl = (userId, id) => {
|
|
3955
|
+
return `/api/settings/user/${userId}/id/${id}`;
|
|
4587
3956
|
};
|
|
4588
3957
|
const useDeletePrivateSettingByIdHook = () => {
|
|
4589
|
-
const
|
|
4590
|
-
return (userId, id) => {
|
|
4591
|
-
return
|
|
4592
|
-
|
|
4593
|
-
method: "
|
|
3958
|
+
const customFetcher = useCustomClient();
|
|
3959
|
+
return (userId, id, options) => {
|
|
3960
|
+
return customFetcher(getDeletePrivateSettingByIdUrl(userId, id), {
|
|
3961
|
+
...options,
|
|
3962
|
+
method: "DELETE"
|
|
4594
3963
|
});
|
|
4595
3964
|
};
|
|
4596
3965
|
};
|
|
4597
3966
|
const useDeletePrivateSettingByIdMutationOptions = (options) => {
|
|
4598
|
-
const
|
|
3967
|
+
const mutationKey = ["deletePrivateSettingById"];
|
|
3968
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
4599
3969
|
const deletePrivateSettingById = useDeletePrivateSettingByIdHook();
|
|
4600
3970
|
const mutationFn = (props) => {
|
|
4601
3971
|
const { userId, id } = props ?? {};
|
|
4602
|
-
return deletePrivateSettingById(userId, id);
|
|
3972
|
+
return deletePrivateSettingById(userId, id, requestOptions);
|
|
4603
3973
|
};
|
|
4604
3974
|
return { mutationFn, ...mutationOptions };
|
|
4605
3975
|
};
|
|
4606
|
-
const useDeletePrivateSettingById = (options) => {
|
|
4607
|
-
|
|
4608
|
-
|
|
3976
|
+
const useDeletePrivateSettingById = (options, queryClient) => {
|
|
3977
|
+
return useMutation(
|
|
3978
|
+
useDeletePrivateSettingByIdMutationOptions(options),
|
|
3979
|
+
queryClient
|
|
3980
|
+
);
|
|
3981
|
+
};
|
|
3982
|
+
const getGetPublicSettingByUserAndIdUrl = (appShortName, id) => {
|
|
3983
|
+
return `/api/settings/application/${appShortName}/id/${id}`;
|
|
4609
3984
|
};
|
|
4610
3985
|
const useGetPublicSettingByUserAndIdHook = () => {
|
|
4611
|
-
const
|
|
4612
|
-
return (appShortName, id,
|
|
4613
|
-
return
|
|
4614
|
-
|
|
4615
|
-
method: "
|
|
4616
|
-
signal
|
|
3986
|
+
const customFetcher = useCustomClient();
|
|
3987
|
+
return (appShortName, id, options) => {
|
|
3988
|
+
return customFetcher(getGetPublicSettingByUserAndIdUrl(appShortName, id), {
|
|
3989
|
+
...options,
|
|
3990
|
+
method: "GET"
|
|
4617
3991
|
});
|
|
4618
3992
|
};
|
|
4619
3993
|
};
|
|
@@ -4621,10 +3995,13 @@ const getGetPublicSettingByUserAndIdQueryKey = (appShortName, id) => {
|
|
|
4621
3995
|
return [`/api/settings/application/${appShortName}/id/${id}`];
|
|
4622
3996
|
};
|
|
4623
3997
|
const useGetPublicSettingByUserAndIdQueryOptions = (appShortName, id, options) => {
|
|
4624
|
-
const { query: queryOptions } = options ?? {};
|
|
3998
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4625
3999
|
const queryKey = queryOptions?.queryKey ?? getGetPublicSettingByUserAndIdQueryKey(appShortName, id);
|
|
4626
4000
|
const getPublicSettingByUserAndId = useGetPublicSettingByUserAndIdHook();
|
|
4627
|
-
const queryFn = ({ signal }) => getPublicSettingByUserAndId(appShortName, id,
|
|
4001
|
+
const queryFn = ({ signal }) => getPublicSettingByUserAndId(appShortName, id, {
|
|
4002
|
+
signal,
|
|
4003
|
+
...requestOptions
|
|
4004
|
+
});
|
|
4628
4005
|
return {
|
|
4629
4006
|
queryKey,
|
|
4630
4007
|
queryFn,
|
|
@@ -4632,69 +4009,90 @@ const useGetPublicSettingByUserAndIdQueryOptions = (appShortName, id, options) =
|
|
|
4632
4009
|
...queryOptions
|
|
4633
4010
|
};
|
|
4634
4011
|
};
|
|
4635
|
-
|
|
4012
|
+
function useGetPublicSettingByUserAndId(appShortName, id, options, queryClient) {
|
|
4636
4013
|
const queryOptions = useGetPublicSettingByUserAndIdQueryOptions(
|
|
4637
4014
|
appShortName,
|
|
4638
4015
|
id,
|
|
4639
4016
|
options
|
|
4640
4017
|
);
|
|
4641
|
-
const query = useQuery(queryOptions);
|
|
4642
|
-
query
|
|
4643
|
-
|
|
4018
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4019
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4020
|
+
}
|
|
4021
|
+
const getUpdatePublicSettingByAppShortNameAndIdUrl = (appShortName, id) => {
|
|
4022
|
+
return `/api/settings/application/${appShortName}/id/${id}`;
|
|
4644
4023
|
};
|
|
4645
4024
|
const useUpdatePublicSettingByAppShortNameAndIdHook = () => {
|
|
4646
|
-
const
|
|
4647
|
-
return (appShortName, id, settingDto) => {
|
|
4648
|
-
return
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4025
|
+
const customFetcher = useCustomClient();
|
|
4026
|
+
return (appShortName, id, settingDto, options) => {
|
|
4027
|
+
return customFetcher(
|
|
4028
|
+
getUpdatePublicSettingByAppShortNameAndIdUrl(appShortName, id),
|
|
4029
|
+
{
|
|
4030
|
+
...options,
|
|
4031
|
+
method: "PUT",
|
|
4032
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
4033
|
+
body: JSON.stringify(settingDto)
|
|
4034
|
+
}
|
|
4035
|
+
);
|
|
4654
4036
|
};
|
|
4655
4037
|
};
|
|
4656
4038
|
const useUpdatePublicSettingByAppShortNameAndIdMutationOptions = (options) => {
|
|
4657
|
-
const
|
|
4039
|
+
const mutationKey = ["updatePublicSettingByAppShortNameAndId"];
|
|
4040
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
4658
4041
|
const updatePublicSettingByAppShortNameAndId = useUpdatePublicSettingByAppShortNameAndIdHook();
|
|
4659
4042
|
const mutationFn = (props) => {
|
|
4660
4043
|
const { appShortName, id, data } = props ?? {};
|
|
4661
|
-
return updatePublicSettingByAppShortNameAndId(
|
|
4044
|
+
return updatePublicSettingByAppShortNameAndId(
|
|
4045
|
+
appShortName,
|
|
4046
|
+
id,
|
|
4047
|
+
data,
|
|
4048
|
+
requestOptions
|
|
4049
|
+
);
|
|
4662
4050
|
};
|
|
4663
4051
|
return { mutationFn, ...mutationOptions };
|
|
4664
4052
|
};
|
|
4665
|
-
const useUpdatePublicSettingByAppShortNameAndId = (options) => {
|
|
4666
|
-
|
|
4667
|
-
|
|
4053
|
+
const useUpdatePublicSettingByAppShortNameAndId = (options, queryClient) => {
|
|
4054
|
+
return useMutation(
|
|
4055
|
+
useUpdatePublicSettingByAppShortNameAndIdMutationOptions(options),
|
|
4056
|
+
queryClient
|
|
4057
|
+
);
|
|
4058
|
+
};
|
|
4059
|
+
const getDeletePublicSettingByIdUrl = (appShortName, id) => {
|
|
4060
|
+
return `/api/settings/application/${appShortName}/id/${id}`;
|
|
4668
4061
|
};
|
|
4669
4062
|
const useDeletePublicSettingByIdHook = () => {
|
|
4670
|
-
const
|
|
4671
|
-
return (appShortName, id) => {
|
|
4672
|
-
return
|
|
4673
|
-
|
|
4674
|
-
method: "
|
|
4063
|
+
const customFetcher = useCustomClient();
|
|
4064
|
+
return (appShortName, id, options) => {
|
|
4065
|
+
return customFetcher(getDeletePublicSettingByIdUrl(appShortName, id), {
|
|
4066
|
+
...options,
|
|
4067
|
+
method: "DELETE"
|
|
4675
4068
|
});
|
|
4676
4069
|
};
|
|
4677
4070
|
};
|
|
4678
4071
|
const useDeletePublicSettingByIdMutationOptions = (options) => {
|
|
4679
|
-
const
|
|
4072
|
+
const mutationKey = ["deletePublicSettingById"];
|
|
4073
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
4680
4074
|
const deletePublicSettingById = useDeletePublicSettingByIdHook();
|
|
4681
4075
|
const mutationFn = (props) => {
|
|
4682
4076
|
const { appShortName, id } = props ?? {};
|
|
4683
|
-
return deletePublicSettingById(appShortName, id);
|
|
4077
|
+
return deletePublicSettingById(appShortName, id, requestOptions);
|
|
4684
4078
|
};
|
|
4685
4079
|
return { mutationFn, ...mutationOptions };
|
|
4686
4080
|
};
|
|
4687
|
-
const useDeletePublicSettingById = (options) => {
|
|
4688
|
-
|
|
4689
|
-
|
|
4081
|
+
const useDeletePublicSettingById = (options, queryClient) => {
|
|
4082
|
+
return useMutation(
|
|
4083
|
+
useDeletePublicSettingByIdMutationOptions(options),
|
|
4084
|
+
queryClient
|
|
4085
|
+
);
|
|
4086
|
+
};
|
|
4087
|
+
const getGetSettingsByUserIdUrl = (userId) => {
|
|
4088
|
+
return `/api/settings/user/${userId}`;
|
|
4690
4089
|
};
|
|
4691
4090
|
const useGetSettingsByUserIdHook = () => {
|
|
4692
|
-
const
|
|
4693
|
-
return (userId,
|
|
4694
|
-
return
|
|
4695
|
-
|
|
4696
|
-
method: "
|
|
4697
|
-
signal
|
|
4091
|
+
const customFetcher = useCustomClient();
|
|
4092
|
+
return (userId, options) => {
|
|
4093
|
+
return customFetcher(getGetSettingsByUserIdUrl(userId), {
|
|
4094
|
+
...options,
|
|
4095
|
+
method: "GET"
|
|
4698
4096
|
});
|
|
4699
4097
|
};
|
|
4700
4098
|
};
|
|
@@ -4702,10 +4100,10 @@ const getGetSettingsByUserIdQueryKey = (userId) => {
|
|
|
4702
4100
|
return [`/api/settings/user/${userId}`];
|
|
4703
4101
|
};
|
|
4704
4102
|
const useGetSettingsByUserIdQueryOptions = (userId, options) => {
|
|
4705
|
-
const { query: queryOptions } = options ?? {};
|
|
4103
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4706
4104
|
const queryKey = queryOptions?.queryKey ?? getGetSettingsByUserIdQueryKey(userId);
|
|
4707
4105
|
const getSettingsByUserId = useGetSettingsByUserIdHook();
|
|
4708
|
-
const queryFn = ({ signal }) => getSettingsByUserId(userId, signal);
|
|
4106
|
+
const queryFn = ({ signal }) => getSettingsByUserId(userId, { signal, ...requestOptions });
|
|
4709
4107
|
return {
|
|
4710
4108
|
queryKey,
|
|
4711
4109
|
queryFn,
|
|
@@ -4713,43 +4111,50 @@ const useGetSettingsByUserIdQueryOptions = (userId, options) => {
|
|
|
4713
4111
|
...queryOptions
|
|
4714
4112
|
};
|
|
4715
4113
|
};
|
|
4716
|
-
|
|
4114
|
+
function useGetSettingsByUserId(userId, options, queryClient) {
|
|
4717
4115
|
const queryOptions = useGetSettingsByUserIdQueryOptions(userId, options);
|
|
4718
|
-
const query = useQuery(queryOptions);
|
|
4719
|
-
query
|
|
4720
|
-
|
|
4116
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4117
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4118
|
+
}
|
|
4119
|
+
const getCreateSettingByUserIdUrl = (userId) => {
|
|
4120
|
+
return `/api/settings/user/${userId}`;
|
|
4721
4121
|
};
|
|
4722
4122
|
const useCreateSettingByUserIdHook = () => {
|
|
4723
|
-
const
|
|
4724
|
-
return (userId, settingDto) => {
|
|
4725
|
-
return
|
|
4726
|
-
|
|
4727
|
-
method: "
|
|
4728
|
-
headers: { "Content-Type": "application/json" },
|
|
4729
|
-
|
|
4123
|
+
const customFetcher = useCustomClient();
|
|
4124
|
+
return (userId, settingDto, options) => {
|
|
4125
|
+
return customFetcher(getCreateSettingByUserIdUrl(userId), {
|
|
4126
|
+
...options,
|
|
4127
|
+
method: "POST",
|
|
4128
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
4129
|
+
body: JSON.stringify(settingDto)
|
|
4730
4130
|
});
|
|
4731
4131
|
};
|
|
4732
4132
|
};
|
|
4733
4133
|
const useCreateSettingByUserIdMutationOptions = (options) => {
|
|
4734
|
-
const
|
|
4134
|
+
const mutationKey = ["createSettingByUserId"];
|
|
4135
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
4735
4136
|
const createSettingByUserId = useCreateSettingByUserIdHook();
|
|
4736
4137
|
const mutationFn = (props) => {
|
|
4737
4138
|
const { userId, data } = props ?? {};
|
|
4738
|
-
return createSettingByUserId(userId, data);
|
|
4139
|
+
return createSettingByUserId(userId, data, requestOptions);
|
|
4739
4140
|
};
|
|
4740
4141
|
return { mutationFn, ...mutationOptions };
|
|
4741
4142
|
};
|
|
4742
|
-
const useCreateSettingByUserId = (options) => {
|
|
4743
|
-
|
|
4744
|
-
|
|
4143
|
+
const useCreateSettingByUserId = (options, queryClient) => {
|
|
4144
|
+
return useMutation(
|
|
4145
|
+
useCreateSettingByUserIdMutationOptions(options),
|
|
4146
|
+
queryClient
|
|
4147
|
+
);
|
|
4148
|
+
};
|
|
4149
|
+
const getGetSettingsByAppShortNameUrl = (appShortName) => {
|
|
4150
|
+
return `/api/settings/application/${appShortName}`;
|
|
4745
4151
|
};
|
|
4746
4152
|
const useGetSettingsByAppShortNameHook = () => {
|
|
4747
|
-
const
|
|
4748
|
-
return (appShortName,
|
|
4749
|
-
return
|
|
4750
|
-
|
|
4751
|
-
method: "
|
|
4752
|
-
signal
|
|
4153
|
+
const customFetcher = useCustomClient();
|
|
4154
|
+
return (appShortName, options) => {
|
|
4155
|
+
return customFetcher(getGetSettingsByAppShortNameUrl(appShortName), {
|
|
4156
|
+
...options,
|
|
4157
|
+
method: "GET"
|
|
4753
4158
|
});
|
|
4754
4159
|
};
|
|
4755
4160
|
};
|
|
@@ -4757,10 +4162,10 @@ const getGetSettingsByAppShortNameQueryKey = (appShortName) => {
|
|
|
4757
4162
|
return [`/api/settings/application/${appShortName}`];
|
|
4758
4163
|
};
|
|
4759
4164
|
const useGetSettingsByAppShortNameQueryOptions = (appShortName, options) => {
|
|
4760
|
-
const { query: queryOptions } = options ?? {};
|
|
4165
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4761
4166
|
const queryKey = queryOptions?.queryKey ?? getGetSettingsByAppShortNameQueryKey(appShortName);
|
|
4762
4167
|
const getSettingsByAppShortName = useGetSettingsByAppShortNameHook();
|
|
4763
|
-
const queryFn = ({ signal }) => getSettingsByAppShortName(appShortName, signal);
|
|
4168
|
+
const queryFn = ({ signal }) => getSettingsByAppShortName(appShortName, { signal, ...requestOptions });
|
|
4764
4169
|
return {
|
|
4765
4170
|
queryKey,
|
|
4766
4171
|
queryFn,
|
|
@@ -4768,125 +4173,146 @@ const useGetSettingsByAppShortNameQueryOptions = (appShortName, options) => {
|
|
|
4768
4173
|
...queryOptions
|
|
4769
4174
|
};
|
|
4770
4175
|
};
|
|
4771
|
-
|
|
4176
|
+
function useGetSettingsByAppShortName(appShortName, options, queryClient) {
|
|
4772
4177
|
const queryOptions = useGetSettingsByAppShortNameQueryOptions(
|
|
4773
4178
|
appShortName,
|
|
4774
4179
|
options
|
|
4775
4180
|
);
|
|
4776
|
-
const query = useQuery(queryOptions);
|
|
4777
|
-
query
|
|
4778
|
-
|
|
4181
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4182
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4183
|
+
}
|
|
4184
|
+
const getCreatePublicSettingByUserIdUrl = (appShortName) => {
|
|
4185
|
+
return `/api/settings/application/${appShortName}`;
|
|
4779
4186
|
};
|
|
4780
4187
|
const useCreatePublicSettingByUserIdHook = () => {
|
|
4781
|
-
const
|
|
4782
|
-
return (appShortName, settingDto) => {
|
|
4783
|
-
return
|
|
4784
|
-
|
|
4785
|
-
method: "
|
|
4786
|
-
headers: { "Content-Type": "application/json" },
|
|
4787
|
-
|
|
4188
|
+
const customFetcher = useCustomClient();
|
|
4189
|
+
return (appShortName, settingDto, options) => {
|
|
4190
|
+
return customFetcher(getCreatePublicSettingByUserIdUrl(appShortName), {
|
|
4191
|
+
...options,
|
|
4192
|
+
method: "POST",
|
|
4193
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
4194
|
+
body: JSON.stringify(settingDto)
|
|
4788
4195
|
});
|
|
4789
4196
|
};
|
|
4790
4197
|
};
|
|
4791
4198
|
const useCreatePublicSettingByUserIdMutationOptions = (options) => {
|
|
4792
|
-
const
|
|
4199
|
+
const mutationKey = ["createPublicSettingByUserId"];
|
|
4200
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
4793
4201
|
const createPublicSettingByUserId = useCreatePublicSettingByUserIdHook();
|
|
4794
4202
|
const mutationFn = (props) => {
|
|
4795
4203
|
const { appShortName, data } = props ?? {};
|
|
4796
|
-
return createPublicSettingByUserId(appShortName, data);
|
|
4204
|
+
return createPublicSettingByUserId(appShortName, data, requestOptions);
|
|
4797
4205
|
};
|
|
4798
4206
|
return { mutationFn, ...mutationOptions };
|
|
4799
4207
|
};
|
|
4800
|
-
const useCreatePublicSettingByUserId = (options) => {
|
|
4801
|
-
|
|
4802
|
-
|
|
4208
|
+
const useCreatePublicSettingByUserId = (options, queryClient) => {
|
|
4209
|
+
return useMutation(
|
|
4210
|
+
useCreatePublicSettingByUserIdMutationOptions(options),
|
|
4211
|
+
queryClient
|
|
4212
|
+
);
|
|
4213
|
+
};
|
|
4214
|
+
const getUploadBundleUrl = (key) => {
|
|
4215
|
+
return `/api/apps/key/${key}/bundle`;
|
|
4803
4216
|
};
|
|
4804
4217
|
const useUploadBundleHook = () => {
|
|
4805
|
-
const
|
|
4806
|
-
return (key, uploadBundleBody) => {
|
|
4218
|
+
const customFetcher = useCustomClient();
|
|
4219
|
+
return (key, uploadBundleBody, options) => {
|
|
4807
4220
|
const formData = new FormData();
|
|
4808
|
-
formData.append(
|
|
4809
|
-
return
|
|
4810
|
-
|
|
4811
|
-
method: "
|
|
4812
|
-
|
|
4813
|
-
data: formData
|
|
4221
|
+
formData.append(`bundleFile`, uploadBundleBody.bundleFile);
|
|
4222
|
+
return customFetcher(getUploadBundleUrl(key), {
|
|
4223
|
+
...options,
|
|
4224
|
+
method: "PUT",
|
|
4225
|
+
body: formData
|
|
4814
4226
|
});
|
|
4815
4227
|
};
|
|
4816
4228
|
};
|
|
4817
4229
|
const useUploadBundleMutationOptions = (options) => {
|
|
4818
|
-
const
|
|
4230
|
+
const mutationKey = ["uploadBundle"];
|
|
4231
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
4819
4232
|
const uploadBundle = useUploadBundleHook();
|
|
4820
4233
|
const mutationFn = (props) => {
|
|
4821
4234
|
const { key, data } = props ?? {};
|
|
4822
|
-
return uploadBundle(key, data);
|
|
4235
|
+
return uploadBundle(key, data, requestOptions);
|
|
4823
4236
|
};
|
|
4824
4237
|
return { mutationFn, ...mutationOptions };
|
|
4825
4238
|
};
|
|
4826
|
-
const useUploadBundle = (options) => {
|
|
4827
|
-
|
|
4828
|
-
|
|
4239
|
+
const useUploadBundle = (options, queryClient) => {
|
|
4240
|
+
return useMutation(useUploadBundleMutationOptions(options), queryClient);
|
|
4241
|
+
};
|
|
4242
|
+
const getGetAllAppsUrl = () => {
|
|
4243
|
+
return `/api/apps`;
|
|
4829
4244
|
};
|
|
4830
4245
|
const useGetAllAppsHook = () => {
|
|
4831
|
-
const
|
|
4832
|
-
return (
|
|
4833
|
-
return
|
|
4246
|
+
const customFetcher = useCustomClient();
|
|
4247
|
+
return (options) => {
|
|
4248
|
+
return customFetcher(getGetAllAppsUrl(), {
|
|
4249
|
+
...options,
|
|
4250
|
+
method: "GET"
|
|
4251
|
+
});
|
|
4834
4252
|
};
|
|
4835
4253
|
};
|
|
4836
4254
|
const getGetAllAppsQueryKey = () => {
|
|
4837
4255
|
return [`/api/apps`];
|
|
4838
4256
|
};
|
|
4839
4257
|
const useGetAllAppsQueryOptions = (options) => {
|
|
4840
|
-
const { query: queryOptions } = options ?? {};
|
|
4258
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4841
4259
|
const queryKey = queryOptions?.queryKey ?? getGetAllAppsQueryKey();
|
|
4842
4260
|
const getAllApps = useGetAllAppsHook();
|
|
4843
|
-
const queryFn = ({ signal }) => getAllApps(signal);
|
|
4261
|
+
const queryFn = ({ signal }) => getAllApps({ signal, ...requestOptions });
|
|
4844
4262
|
return { queryKey, queryFn, ...queryOptions };
|
|
4845
4263
|
};
|
|
4846
|
-
|
|
4264
|
+
function useGetAllApps(options, queryClient) {
|
|
4847
4265
|
const queryOptions = useGetAllAppsQueryOptions(options);
|
|
4848
|
-
const query = useQuery(queryOptions);
|
|
4849
|
-
query
|
|
4850
|
-
|
|
4266
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4267
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4268
|
+
}
|
|
4269
|
+
const getCreateOrUpdateAppUrl = () => {
|
|
4270
|
+
return `/api/apps`;
|
|
4851
4271
|
};
|
|
4852
4272
|
const useCreateOrUpdateAppHook = () => {
|
|
4853
|
-
const
|
|
4854
|
-
return (appDto) => {
|
|
4855
|
-
return
|
|
4856
|
-
|
|
4857
|
-
method: "
|
|
4858
|
-
headers: { "Content-Type": "application/json" },
|
|
4859
|
-
|
|
4273
|
+
const customFetcher = useCustomClient();
|
|
4274
|
+
return (appDto, options) => {
|
|
4275
|
+
return customFetcher(getCreateOrUpdateAppUrl(), {
|
|
4276
|
+
...options,
|
|
4277
|
+
method: "POST",
|
|
4278
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
4279
|
+
body: JSON.stringify(appDto)
|
|
4860
4280
|
});
|
|
4861
4281
|
};
|
|
4862
4282
|
};
|
|
4863
4283
|
const useCreateOrUpdateAppMutationOptions = (options) => {
|
|
4864
|
-
const
|
|
4284
|
+
const mutationKey = ["createOrUpdateApp"];
|
|
4285
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
4865
4286
|
const createOrUpdateApp = useCreateOrUpdateAppHook();
|
|
4866
4287
|
const mutationFn = (props) => {
|
|
4867
4288
|
const { data } = props ?? {};
|
|
4868
|
-
return createOrUpdateApp(data);
|
|
4289
|
+
return createOrUpdateApp(data, requestOptions);
|
|
4869
4290
|
};
|
|
4870
4291
|
return { mutationFn, ...mutationOptions };
|
|
4871
4292
|
};
|
|
4872
|
-
const useCreateOrUpdateApp = (options) => {
|
|
4873
|
-
|
|
4874
|
-
|
|
4293
|
+
const useCreateOrUpdateApp = (options, queryClient) => {
|
|
4294
|
+
return useMutation(useCreateOrUpdateAppMutationOptions(options), queryClient);
|
|
4295
|
+
};
|
|
4296
|
+
const getGetAppByKeyUrl = (key) => {
|
|
4297
|
+
return `/api/apps/key/${key}`;
|
|
4875
4298
|
};
|
|
4876
4299
|
const useGetAppByKeyHook = () => {
|
|
4877
|
-
const
|
|
4878
|
-
return (key,
|
|
4879
|
-
return
|
|
4300
|
+
const customFetcher = useCustomClient();
|
|
4301
|
+
return (key, options) => {
|
|
4302
|
+
return customFetcher(getGetAppByKeyUrl(key), {
|
|
4303
|
+
...options,
|
|
4304
|
+
method: "GET"
|
|
4305
|
+
});
|
|
4880
4306
|
};
|
|
4881
4307
|
};
|
|
4882
4308
|
const getGetAppByKeyQueryKey = (key) => {
|
|
4883
4309
|
return [`/api/apps/key/${key}`];
|
|
4884
4310
|
};
|
|
4885
4311
|
const useGetAppByKeyQueryOptions = (key, options) => {
|
|
4886
|
-
const { query: queryOptions } = options ?? {};
|
|
4312
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4887
4313
|
const queryKey = queryOptions?.queryKey ?? getGetAppByKeyQueryKey(key);
|
|
4888
4314
|
const getAppByKey = useGetAppByKeyHook();
|
|
4889
|
-
const queryFn = ({ signal }) => getAppByKey(key, signal);
|
|
4315
|
+
const queryFn = ({ signal }) => getAppByKey(key, { signal, ...requestOptions });
|
|
4890
4316
|
return {
|
|
4891
4317
|
queryKey,
|
|
4892
4318
|
queryFn,
|
|
@@ -4894,84 +4320,102 @@ const useGetAppByKeyQueryOptions = (key, options) => {
|
|
|
4894
4320
|
...queryOptions
|
|
4895
4321
|
};
|
|
4896
4322
|
};
|
|
4897
|
-
|
|
4323
|
+
function useGetAppByKey(key, options, queryClient) {
|
|
4898
4324
|
const queryOptions = useGetAppByKeyQueryOptions(key, options);
|
|
4899
|
-
const query = useQuery(queryOptions);
|
|
4900
|
-
query
|
|
4901
|
-
|
|
4325
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4326
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4327
|
+
}
|
|
4328
|
+
const getDeleteAppByKeyUrl = (key) => {
|
|
4329
|
+
return `/api/apps/key/${key}`;
|
|
4902
4330
|
};
|
|
4903
4331
|
const useDeleteAppByKeyHook = () => {
|
|
4904
|
-
const
|
|
4905
|
-
return (key) => {
|
|
4906
|
-
return
|
|
4332
|
+
const customFetcher = useCustomClient();
|
|
4333
|
+
return (key, options) => {
|
|
4334
|
+
return customFetcher(getDeleteAppByKeyUrl(key), {
|
|
4335
|
+
...options,
|
|
4336
|
+
method: "DELETE"
|
|
4337
|
+
});
|
|
4907
4338
|
};
|
|
4908
4339
|
};
|
|
4909
4340
|
const useDeleteAppByKeyMutationOptions = (options) => {
|
|
4910
|
-
const
|
|
4341
|
+
const mutationKey = ["deleteAppByKey"];
|
|
4342
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
4911
4343
|
const deleteAppByKey = useDeleteAppByKeyHook();
|
|
4912
4344
|
const mutationFn = (props) => {
|
|
4913
4345
|
const { key } = props ?? {};
|
|
4914
|
-
return deleteAppByKey(key);
|
|
4346
|
+
return deleteAppByKey(key, requestOptions);
|
|
4915
4347
|
};
|
|
4916
4348
|
return { mutationFn, ...mutationOptions };
|
|
4917
4349
|
};
|
|
4918
|
-
const useDeleteAppByKey = (options) => {
|
|
4919
|
-
|
|
4920
|
-
|
|
4350
|
+
const useDeleteAppByKey = (options, queryClient) => {
|
|
4351
|
+
return useMutation(useDeleteAppByKeyMutationOptions(options), queryClient);
|
|
4352
|
+
};
|
|
4353
|
+
const getGetAllServicesUrl = () => {
|
|
4354
|
+
return `/api/apps/services`;
|
|
4921
4355
|
};
|
|
4922
4356
|
const useGetAllServicesHook = () => {
|
|
4923
|
-
const
|
|
4924
|
-
return (
|
|
4925
|
-
return
|
|
4357
|
+
const customFetcher = useCustomClient();
|
|
4358
|
+
return (options) => {
|
|
4359
|
+
return customFetcher(getGetAllServicesUrl(), {
|
|
4360
|
+
...options,
|
|
4361
|
+
method: "GET"
|
|
4362
|
+
});
|
|
4926
4363
|
};
|
|
4927
4364
|
};
|
|
4928
4365
|
const getGetAllServicesQueryKey = () => {
|
|
4929
4366
|
return [`/api/apps/services`];
|
|
4930
4367
|
};
|
|
4931
4368
|
const useGetAllServicesQueryOptions = (options) => {
|
|
4932
|
-
const { query: queryOptions } = options ?? {};
|
|
4369
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4933
4370
|
const queryKey = queryOptions?.queryKey ?? getGetAllServicesQueryKey();
|
|
4934
4371
|
const getAllServices = useGetAllServicesHook();
|
|
4935
|
-
const queryFn = ({ signal }) => getAllServices(signal);
|
|
4372
|
+
const queryFn = ({ signal }) => getAllServices({ signal, ...requestOptions });
|
|
4936
4373
|
return { queryKey, queryFn, ...queryOptions };
|
|
4937
4374
|
};
|
|
4938
|
-
|
|
4375
|
+
function useGetAllServices(options, queryClient) {
|
|
4939
4376
|
const queryOptions = useGetAllServicesQueryOptions(options);
|
|
4940
|
-
const query = useQuery(queryOptions);
|
|
4941
|
-
query
|
|
4942
|
-
|
|
4377
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4378
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4379
|
+
}
|
|
4380
|
+
const getCreateOrUpdateServiceUrl = () => {
|
|
4381
|
+
return `/api/apps/services`;
|
|
4943
4382
|
};
|
|
4944
4383
|
const useCreateOrUpdateServiceHook = () => {
|
|
4945
|
-
const
|
|
4946
|
-
return (serviceDto) => {
|
|
4947
|
-
return
|
|
4948
|
-
|
|
4949
|
-
method: "
|
|
4950
|
-
headers: { "Content-Type": "application/json" },
|
|
4951
|
-
|
|
4384
|
+
const customFetcher = useCustomClient();
|
|
4385
|
+
return (serviceDto, options) => {
|
|
4386
|
+
return customFetcher(getCreateOrUpdateServiceUrl(), {
|
|
4387
|
+
...options,
|
|
4388
|
+
method: "POST",
|
|
4389
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
4390
|
+
body: JSON.stringify(serviceDto)
|
|
4952
4391
|
});
|
|
4953
4392
|
};
|
|
4954
4393
|
};
|
|
4955
4394
|
const useCreateOrUpdateServiceMutationOptions = (options) => {
|
|
4956
|
-
const
|
|
4395
|
+
const mutationKey = ["createOrUpdateService"];
|
|
4396
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
4957
4397
|
const createOrUpdateService = useCreateOrUpdateServiceHook();
|
|
4958
4398
|
const mutationFn = (props) => {
|
|
4959
4399
|
const { data } = props ?? {};
|
|
4960
|
-
return createOrUpdateService(data);
|
|
4400
|
+
return createOrUpdateService(data, requestOptions);
|
|
4961
4401
|
};
|
|
4962
4402
|
return { mutationFn, ...mutationOptions };
|
|
4963
4403
|
};
|
|
4964
|
-
const useCreateOrUpdateService = (options) => {
|
|
4965
|
-
|
|
4966
|
-
|
|
4404
|
+
const useCreateOrUpdateService = (options, queryClient) => {
|
|
4405
|
+
return useMutation(
|
|
4406
|
+
useCreateOrUpdateServiceMutationOptions(options),
|
|
4407
|
+
queryClient
|
|
4408
|
+
);
|
|
4409
|
+
};
|
|
4410
|
+
const getGetServiceByKeyUrl = (key) => {
|
|
4411
|
+
return `/api/apps/services/key/${key}`;
|
|
4967
4412
|
};
|
|
4968
4413
|
const useGetServiceByKeyHook = () => {
|
|
4969
|
-
const
|
|
4970
|
-
return (key,
|
|
4971
|
-
return
|
|
4972
|
-
|
|
4973
|
-
method: "
|
|
4974
|
-
signal
|
|
4414
|
+
const customFetcher = useCustomClient();
|
|
4415
|
+
return (key, options) => {
|
|
4416
|
+
return customFetcher(getGetServiceByKeyUrl(key), {
|
|
4417
|
+
...options,
|
|
4418
|
+
method: "GET"
|
|
4975
4419
|
});
|
|
4976
4420
|
};
|
|
4977
4421
|
};
|
|
@@ -4979,10 +4423,10 @@ const getGetServiceByKeyQueryKey = (key) => {
|
|
|
4979
4423
|
return [`/api/apps/services/key/${key}`];
|
|
4980
4424
|
};
|
|
4981
4425
|
const useGetServiceByKeyQueryOptions = (key, options) => {
|
|
4982
|
-
const { query: queryOptions } = options ?? {};
|
|
4426
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4983
4427
|
const queryKey = queryOptions?.queryKey ?? getGetServiceByKeyQueryKey(key);
|
|
4984
4428
|
const getServiceByKey = useGetServiceByKeyHook();
|
|
4985
|
-
const queryFn = ({ signal }) => getServiceByKey(key, signal);
|
|
4429
|
+
const queryFn = ({ signal }) => getServiceByKey(key, { signal, ...requestOptions });
|
|
4986
4430
|
return {
|
|
4987
4431
|
queryKey,
|
|
4988
4432
|
queryFn,
|
|
@@ -4990,41 +4434,48 @@ const useGetServiceByKeyQueryOptions = (key, options) => {
|
|
|
4990
4434
|
...queryOptions
|
|
4991
4435
|
};
|
|
4992
4436
|
};
|
|
4993
|
-
|
|
4437
|
+
function useGetServiceByKey(key, options, queryClient) {
|
|
4994
4438
|
const queryOptions = useGetServiceByKeyQueryOptions(key, options);
|
|
4995
|
-
const query = useQuery(queryOptions);
|
|
4996
|
-
query
|
|
4997
|
-
|
|
4439
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4440
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4441
|
+
}
|
|
4442
|
+
const getDeleteServiceByKeyUrl = (key) => {
|
|
4443
|
+
return `/api/apps/services/key/${key}`;
|
|
4998
4444
|
};
|
|
4999
4445
|
const useDeleteServiceByKeyHook = () => {
|
|
5000
|
-
const
|
|
5001
|
-
return (key) => {
|
|
5002
|
-
return
|
|
5003
|
-
|
|
5004
|
-
method: "
|
|
4446
|
+
const customFetcher = useCustomClient();
|
|
4447
|
+
return (key, options) => {
|
|
4448
|
+
return customFetcher(getDeleteServiceByKeyUrl(key), {
|
|
4449
|
+
...options,
|
|
4450
|
+
method: "DELETE"
|
|
5005
4451
|
});
|
|
5006
4452
|
};
|
|
5007
4453
|
};
|
|
5008
4454
|
const useDeleteServiceByKeyMutationOptions = (options) => {
|
|
5009
|
-
const
|
|
4455
|
+
const mutationKey = ["deleteServiceByKey"];
|
|
4456
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
5010
4457
|
const deleteServiceByKey = useDeleteServiceByKeyHook();
|
|
5011
4458
|
const mutationFn = (props) => {
|
|
5012
4459
|
const { key } = props ?? {};
|
|
5013
|
-
return deleteServiceByKey(key);
|
|
4460
|
+
return deleteServiceByKey(key, requestOptions);
|
|
5014
4461
|
};
|
|
5015
4462
|
return { mutationFn, ...mutationOptions };
|
|
5016
4463
|
};
|
|
5017
|
-
const useDeleteServiceByKey = (options) => {
|
|
5018
|
-
|
|
5019
|
-
|
|
4464
|
+
const useDeleteServiceByKey = (options, queryClient) => {
|
|
4465
|
+
return useMutation(
|
|
4466
|
+
useDeleteServiceByKeyMutationOptions(options),
|
|
4467
|
+
queryClient
|
|
4468
|
+
);
|
|
4469
|
+
};
|
|
4470
|
+
const getGetAllCategoriesUrl = () => {
|
|
4471
|
+
return `/api/apps/categories`;
|
|
5020
4472
|
};
|
|
5021
4473
|
const useGetAllCategoriesHook = () => {
|
|
5022
|
-
const
|
|
5023
|
-
return (
|
|
5024
|
-
return
|
|
5025
|
-
|
|
5026
|
-
method: "
|
|
5027
|
-
signal
|
|
4474
|
+
const customFetcher = useCustomClient();
|
|
4475
|
+
return (options) => {
|
|
4476
|
+
return customFetcher(getGetAllCategoriesUrl(), {
|
|
4477
|
+
...options,
|
|
4478
|
+
method: "GET"
|
|
5028
4479
|
});
|
|
5029
4480
|
};
|
|
5030
4481
|
};
|
|
@@ -5032,49 +4483,56 @@ const getGetAllCategoriesQueryKey = () => {
|
|
|
5032
4483
|
return [`/api/apps/categories`];
|
|
5033
4484
|
};
|
|
5034
4485
|
const useGetAllCategoriesQueryOptions = (options) => {
|
|
5035
|
-
const { query: queryOptions } = options ?? {};
|
|
4486
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5036
4487
|
const queryKey = queryOptions?.queryKey ?? getGetAllCategoriesQueryKey();
|
|
5037
4488
|
const getAllCategories = useGetAllCategoriesHook();
|
|
5038
|
-
const queryFn = ({ signal }) => getAllCategories(signal);
|
|
4489
|
+
const queryFn = ({ signal }) => getAllCategories({ signal, ...requestOptions });
|
|
5039
4490
|
return { queryKey, queryFn, ...queryOptions };
|
|
5040
4491
|
};
|
|
5041
|
-
|
|
4492
|
+
function useGetAllCategories(options, queryClient) {
|
|
5042
4493
|
const queryOptions = useGetAllCategoriesQueryOptions(options);
|
|
5043
|
-
const query = useQuery(queryOptions);
|
|
5044
|
-
query
|
|
5045
|
-
|
|
4494
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4495
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4496
|
+
}
|
|
4497
|
+
const getCreateOrUpdateCategoryUrl = () => {
|
|
4498
|
+
return `/api/apps/categories`;
|
|
5046
4499
|
};
|
|
5047
4500
|
const useCreateOrUpdateCategoryHook = () => {
|
|
5048
|
-
const
|
|
5049
|
-
return (categoryDto) => {
|
|
5050
|
-
return
|
|
5051
|
-
|
|
5052
|
-
method: "
|
|
5053
|
-
headers: { "Content-Type": "application/json" },
|
|
5054
|
-
|
|
4501
|
+
const customFetcher = useCustomClient();
|
|
4502
|
+
return (categoryDto, options) => {
|
|
4503
|
+
return customFetcher(getCreateOrUpdateCategoryUrl(), {
|
|
4504
|
+
...options,
|
|
4505
|
+
method: "POST",
|
|
4506
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
4507
|
+
body: JSON.stringify(categoryDto)
|
|
5055
4508
|
});
|
|
5056
4509
|
};
|
|
5057
4510
|
};
|
|
5058
4511
|
const useCreateOrUpdateCategoryMutationOptions = (options) => {
|
|
5059
|
-
const
|
|
4512
|
+
const mutationKey = ["createOrUpdateCategory"];
|
|
4513
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
5060
4514
|
const createOrUpdateCategory = useCreateOrUpdateCategoryHook();
|
|
5061
4515
|
const mutationFn = (props) => {
|
|
5062
4516
|
const { data } = props ?? {};
|
|
5063
|
-
return createOrUpdateCategory(data);
|
|
4517
|
+
return createOrUpdateCategory(data, requestOptions);
|
|
5064
4518
|
};
|
|
5065
4519
|
return { mutationFn, ...mutationOptions };
|
|
5066
4520
|
};
|
|
5067
|
-
const useCreateOrUpdateCategory = (options) => {
|
|
5068
|
-
|
|
5069
|
-
|
|
4521
|
+
const useCreateOrUpdateCategory = (options, queryClient) => {
|
|
4522
|
+
return useMutation(
|
|
4523
|
+
useCreateOrUpdateCategoryMutationOptions(options),
|
|
4524
|
+
queryClient
|
|
4525
|
+
);
|
|
4526
|
+
};
|
|
4527
|
+
const getGetCategoryByIdUrl = (id) => {
|
|
4528
|
+
return `/api/apps/categories/id/${id}`;
|
|
5070
4529
|
};
|
|
5071
4530
|
const useGetCategoryByIdHook = () => {
|
|
5072
|
-
const
|
|
5073
|
-
return (id,
|
|
5074
|
-
return
|
|
5075
|
-
|
|
5076
|
-
method: "
|
|
5077
|
-
signal
|
|
4531
|
+
const customFetcher = useCustomClient();
|
|
4532
|
+
return (id, options) => {
|
|
4533
|
+
return customFetcher(getGetCategoryByIdUrl(id), {
|
|
4534
|
+
...options,
|
|
4535
|
+
method: "GET"
|
|
5078
4536
|
});
|
|
5079
4537
|
};
|
|
5080
4538
|
};
|
|
@@ -5082,10 +4540,10 @@ const getGetCategoryByIdQueryKey = (id) => {
|
|
|
5082
4540
|
return [`/api/apps/categories/id/${id}`];
|
|
5083
4541
|
};
|
|
5084
4542
|
const useGetCategoryByIdQueryOptions = (id, options) => {
|
|
5085
|
-
const { query: queryOptions } = options ?? {};
|
|
4543
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5086
4544
|
const queryKey = queryOptions?.queryKey ?? getGetCategoryByIdQueryKey(id);
|
|
5087
4545
|
const getCategoryById = useGetCategoryByIdHook();
|
|
5088
|
-
const queryFn = ({ signal }) => getCategoryById(id, signal);
|
|
4546
|
+
const queryFn = ({ signal }) => getCategoryById(id, { signal, ...requestOptions });
|
|
5089
4547
|
return {
|
|
5090
4548
|
queryKey,
|
|
5091
4549
|
queryFn,
|
|
@@ -5093,41 +4551,48 @@ const useGetCategoryByIdQueryOptions = (id, options) => {
|
|
|
5093
4551
|
...queryOptions
|
|
5094
4552
|
};
|
|
5095
4553
|
};
|
|
5096
|
-
|
|
4554
|
+
function useGetCategoryById(id, options, queryClient) {
|
|
5097
4555
|
const queryOptions = useGetCategoryByIdQueryOptions(id, options);
|
|
5098
|
-
const query = useQuery(queryOptions);
|
|
5099
|
-
query
|
|
5100
|
-
|
|
4556
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4557
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4558
|
+
}
|
|
4559
|
+
const getDeleteCategoryByIdUrl = (id) => {
|
|
4560
|
+
return `/api/apps/categories/id/${id}`;
|
|
5101
4561
|
};
|
|
5102
4562
|
const useDeleteCategoryByIdHook = () => {
|
|
5103
|
-
const
|
|
5104
|
-
return (id) => {
|
|
5105
|
-
return
|
|
5106
|
-
|
|
5107
|
-
method: "
|
|
4563
|
+
const customFetcher = useCustomClient();
|
|
4564
|
+
return (id, options) => {
|
|
4565
|
+
return customFetcher(getDeleteCategoryByIdUrl(id), {
|
|
4566
|
+
...options,
|
|
4567
|
+
method: "DELETE"
|
|
5108
4568
|
});
|
|
5109
4569
|
};
|
|
5110
4570
|
};
|
|
5111
4571
|
const useDeleteCategoryByIdMutationOptions = (options) => {
|
|
5112
|
-
const
|
|
4572
|
+
const mutationKey = ["deleteCategoryById"];
|
|
4573
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
5113
4574
|
const deleteCategoryById = useDeleteCategoryByIdHook();
|
|
5114
4575
|
const mutationFn = (props) => {
|
|
5115
4576
|
const { id } = props ?? {};
|
|
5116
|
-
return deleteCategoryById(id);
|
|
4577
|
+
return deleteCategoryById(id, requestOptions);
|
|
5117
4578
|
};
|
|
5118
4579
|
return { mutationFn, ...mutationOptions };
|
|
5119
4580
|
};
|
|
5120
|
-
const useDeleteCategoryById = (options) => {
|
|
5121
|
-
|
|
5122
|
-
|
|
4581
|
+
const useDeleteCategoryById = (options, queryClient) => {
|
|
4582
|
+
return useMutation(
|
|
4583
|
+
useDeleteCategoryByIdMutationOptions(options),
|
|
4584
|
+
queryClient
|
|
4585
|
+
);
|
|
4586
|
+
};
|
|
4587
|
+
const getStreamEventsUrl = () => {
|
|
4588
|
+
return `/eventstream/activitylog`;
|
|
5123
4589
|
};
|
|
5124
4590
|
const useStreamEventsHook = () => {
|
|
5125
|
-
const
|
|
5126
|
-
return (
|
|
5127
|
-
return
|
|
5128
|
-
|
|
5129
|
-
method: "
|
|
5130
|
-
signal
|
|
4591
|
+
const customFetcher = useCustomClient();
|
|
4592
|
+
return (options) => {
|
|
4593
|
+
return customFetcher(getStreamEventsUrl(), {
|
|
4594
|
+
...options,
|
|
4595
|
+
method: "GET"
|
|
5131
4596
|
});
|
|
5132
4597
|
};
|
|
5133
4598
|
};
|
|
@@ -5135,25 +4600,26 @@ const getStreamEventsQueryKey = () => {
|
|
|
5135
4600
|
return [`/eventstream/activitylog`];
|
|
5136
4601
|
};
|
|
5137
4602
|
const useStreamEventsQueryOptions = (options) => {
|
|
5138
|
-
const { query: queryOptions } = options ?? {};
|
|
4603
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5139
4604
|
const queryKey = queryOptions?.queryKey ?? getStreamEventsQueryKey();
|
|
5140
4605
|
const streamEvents = useStreamEventsHook();
|
|
5141
|
-
const queryFn = ({ signal }) => streamEvents(signal);
|
|
4606
|
+
const queryFn = ({ signal }) => streamEvents({ signal, ...requestOptions });
|
|
5142
4607
|
return { queryKey, queryFn, ...queryOptions };
|
|
5143
4608
|
};
|
|
5144
|
-
|
|
4609
|
+
function useStreamEvents(options, queryClient) {
|
|
5145
4610
|
const queryOptions = useStreamEventsQueryOptions(options);
|
|
5146
|
-
const query = useQuery(queryOptions);
|
|
5147
|
-
query
|
|
5148
|
-
|
|
4611
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4612
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4613
|
+
}
|
|
4614
|
+
const getGetCurrentEnvironmentUrl = () => {
|
|
4615
|
+
return `/_discovery/environments/current`;
|
|
5149
4616
|
};
|
|
5150
4617
|
const useGetCurrentEnvironmentHook = () => {
|
|
5151
|
-
const
|
|
5152
|
-
return (
|
|
5153
|
-
return
|
|
5154
|
-
|
|
5155
|
-
method: "
|
|
5156
|
-
signal
|
|
4618
|
+
const customFetcher = useCustomClient();
|
|
4619
|
+
return (options) => {
|
|
4620
|
+
return customFetcher(getGetCurrentEnvironmentUrl(), {
|
|
4621
|
+
...options,
|
|
4622
|
+
method: "GET"
|
|
5157
4623
|
});
|
|
5158
4624
|
};
|
|
5159
4625
|
};
|
|
@@ -5161,28 +4627,49 @@ const getGetCurrentEnvironmentQueryKey = () => {
|
|
|
5161
4627
|
return [`/_discovery/environments/current`];
|
|
5162
4628
|
};
|
|
5163
4629
|
const useGetCurrentEnvironmentQueryOptions = (options) => {
|
|
5164
|
-
const { query: queryOptions } = options ?? {};
|
|
4630
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5165
4631
|
const queryKey = queryOptions?.queryKey ?? getGetCurrentEnvironmentQueryKey();
|
|
5166
4632
|
const getCurrentEnvironment = useGetCurrentEnvironmentHook();
|
|
5167
|
-
const queryFn = ({ signal }) => getCurrentEnvironment(signal);
|
|
4633
|
+
const queryFn = ({ signal }) => getCurrentEnvironment({ signal, ...requestOptions });
|
|
5168
4634
|
return { queryKey, queryFn, ...queryOptions };
|
|
5169
4635
|
};
|
|
5170
|
-
|
|
4636
|
+
function useGetCurrentEnvironment(options, queryClient) {
|
|
5171
4637
|
const queryOptions = useGetCurrentEnvironmentQueryOptions(options);
|
|
5172
|
-
const query = useQuery(queryOptions);
|
|
5173
|
-
query
|
|
5174
|
-
|
|
4638
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4639
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4640
|
+
}
|
|
4641
|
+
const AdminDtoAdminType = {
|
|
4642
|
+
ServicePrincipal: "ServicePrincipal",
|
|
4643
|
+
User: "User"
|
|
4644
|
+
};
|
|
4645
|
+
const AlarmDtoSeverity = {
|
|
4646
|
+
LOW: "LOW",
|
|
4647
|
+
MEDIUM: "MEDIUM",
|
|
4648
|
+
HIGH: "HIGH",
|
|
4649
|
+
CRITICAL: "CRITICAL"
|
|
4650
|
+
};
|
|
4651
|
+
const AlarmDtoState = {
|
|
4652
|
+
ACTIVE: "ACTIVE",
|
|
4653
|
+
CLEARED: "CLEARED"
|
|
5175
4654
|
};
|
|
5176
4655
|
const GetAllRomaConfigurationTypes200Item = {
|
|
5177
4656
|
servicebus: "servicebus"
|
|
5178
4657
|
};
|
|
4658
|
+
const RaiseAlarmRequestSeverity = {
|
|
4659
|
+
LOW: "LOW",
|
|
4660
|
+
MEDIUM: "MEDIUM",
|
|
4661
|
+
HIGH: "HIGH",
|
|
4662
|
+
CRITICAL: "CRITICAL"
|
|
4663
|
+
};
|
|
4664
|
+
const getGetRomaConfigurationByIdUrl = (id) => {
|
|
4665
|
+
return `/api/configurations/id/${id}`;
|
|
4666
|
+
};
|
|
5179
4667
|
const useGetRomaConfigurationByIdHook = () => {
|
|
5180
|
-
const
|
|
5181
|
-
return (id,
|
|
5182
|
-
return
|
|
5183
|
-
|
|
5184
|
-
method: "
|
|
5185
|
-
signal
|
|
4668
|
+
const customFetcher = useCustomClient();
|
|
4669
|
+
return (id, options) => {
|
|
4670
|
+
return customFetcher(getGetRomaConfigurationByIdUrl(id), {
|
|
4671
|
+
...options,
|
|
4672
|
+
method: "GET"
|
|
5186
4673
|
});
|
|
5187
4674
|
};
|
|
5188
4675
|
};
|
|
@@ -5190,10 +4677,10 @@ const getGetRomaConfigurationByIdQueryKey = (id) => {
|
|
|
5190
4677
|
return [`/api/configurations/id/${id}`];
|
|
5191
4678
|
};
|
|
5192
4679
|
const useGetRomaConfigurationByIdQueryOptions = (id, options) => {
|
|
5193
|
-
const { query: queryOptions } = options ?? {};
|
|
4680
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5194
4681
|
const queryKey = queryOptions?.queryKey ?? getGetRomaConfigurationByIdQueryKey(id);
|
|
5195
4682
|
const getRomaConfigurationById = useGetRomaConfigurationByIdHook();
|
|
5196
|
-
const queryFn = ({ signal }) => getRomaConfigurationById(id, signal);
|
|
4683
|
+
const queryFn = ({ signal }) => getRomaConfigurationById(id, { signal, ...requestOptions });
|
|
5197
4684
|
return {
|
|
5198
4685
|
queryKey,
|
|
5199
4686
|
queryFn,
|
|
@@ -5201,65 +4688,78 @@ const useGetRomaConfigurationByIdQueryOptions = (id, options) => {
|
|
|
5201
4688
|
...queryOptions
|
|
5202
4689
|
};
|
|
5203
4690
|
};
|
|
5204
|
-
|
|
4691
|
+
function useGetRomaConfigurationById(id, options, queryClient) {
|
|
5205
4692
|
const queryOptions = useGetRomaConfigurationByIdQueryOptions(id, options);
|
|
5206
|
-
const query = useQuery(queryOptions);
|
|
5207
|
-
query
|
|
5208
|
-
|
|
4693
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4694
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4695
|
+
}
|
|
4696
|
+
const getUpdateRomaConfigurationUrl = (id) => {
|
|
4697
|
+
return `/api/configurations/id/${id}`;
|
|
5209
4698
|
};
|
|
5210
4699
|
const useUpdateRomaConfigurationHook = () => {
|
|
5211
|
-
const
|
|
5212
|
-
return (id, romaConfigurationDto) => {
|
|
5213
|
-
return
|
|
5214
|
-
|
|
5215
|
-
method: "
|
|
5216
|
-
headers: { "Content-Type": "application/json" },
|
|
5217
|
-
|
|
4700
|
+
const customFetcher = useCustomClient();
|
|
4701
|
+
return (id, romaConfigurationDto, options) => {
|
|
4702
|
+
return customFetcher(getUpdateRomaConfigurationUrl(id), {
|
|
4703
|
+
...options,
|
|
4704
|
+
method: "PUT",
|
|
4705
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
4706
|
+
body: JSON.stringify(romaConfigurationDto)
|
|
5218
4707
|
});
|
|
5219
4708
|
};
|
|
5220
4709
|
};
|
|
5221
4710
|
const useUpdateRomaConfigurationMutationOptions = (options) => {
|
|
5222
|
-
const
|
|
4711
|
+
const mutationKey = ["updateRomaConfiguration"];
|
|
4712
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
5223
4713
|
const updateRomaConfiguration = useUpdateRomaConfigurationHook();
|
|
5224
4714
|
const mutationFn = (props) => {
|
|
5225
4715
|
const { id, data } = props ?? {};
|
|
5226
|
-
return updateRomaConfiguration(id, data);
|
|
4716
|
+
return updateRomaConfiguration(id, data, requestOptions);
|
|
5227
4717
|
};
|
|
5228
4718
|
return { mutationFn, ...mutationOptions };
|
|
5229
4719
|
};
|
|
5230
|
-
const useUpdateRomaConfiguration = (options) => {
|
|
5231
|
-
|
|
5232
|
-
|
|
4720
|
+
const useUpdateRomaConfiguration = (options, queryClient) => {
|
|
4721
|
+
return useMutation(
|
|
4722
|
+
useUpdateRomaConfigurationMutationOptions(options),
|
|
4723
|
+
queryClient
|
|
4724
|
+
);
|
|
4725
|
+
};
|
|
4726
|
+
const getDeleteRomaConfigurationUrl = (id) => {
|
|
4727
|
+
return `/api/configurations/id/${id}`;
|
|
5233
4728
|
};
|
|
5234
4729
|
const useDeleteRomaConfigurationHook = () => {
|
|
5235
|
-
const
|
|
5236
|
-
return (id) => {
|
|
5237
|
-
return
|
|
5238
|
-
|
|
5239
|
-
method: "
|
|
4730
|
+
const customFetcher = useCustomClient();
|
|
4731
|
+
return (id, options) => {
|
|
4732
|
+
return customFetcher(getDeleteRomaConfigurationUrl(id), {
|
|
4733
|
+
...options,
|
|
4734
|
+
method: "DELETE"
|
|
5240
4735
|
});
|
|
5241
4736
|
};
|
|
5242
4737
|
};
|
|
5243
4738
|
const useDeleteRomaConfigurationMutationOptions = (options) => {
|
|
5244
|
-
const
|
|
4739
|
+
const mutationKey = ["deleteRomaConfiguration"];
|
|
4740
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
5245
4741
|
const deleteRomaConfiguration = useDeleteRomaConfigurationHook();
|
|
5246
4742
|
const mutationFn = (props) => {
|
|
5247
4743
|
const { id } = props ?? {};
|
|
5248
|
-
return deleteRomaConfiguration(id);
|
|
4744
|
+
return deleteRomaConfiguration(id, requestOptions);
|
|
5249
4745
|
};
|
|
5250
4746
|
return { mutationFn, ...mutationOptions };
|
|
5251
4747
|
};
|
|
5252
|
-
const useDeleteRomaConfiguration = (options) => {
|
|
5253
|
-
|
|
5254
|
-
|
|
4748
|
+
const useDeleteRomaConfiguration = (options, queryClient) => {
|
|
4749
|
+
return useMutation(
|
|
4750
|
+
useDeleteRomaConfigurationMutationOptions(options),
|
|
4751
|
+
queryClient
|
|
4752
|
+
);
|
|
4753
|
+
};
|
|
4754
|
+
const getGetAllRomaConfigurationUrl = () => {
|
|
4755
|
+
return `/api/configurations`;
|
|
5255
4756
|
};
|
|
5256
4757
|
const useGetAllRomaConfigurationHook = () => {
|
|
5257
|
-
const
|
|
5258
|
-
return (
|
|
5259
|
-
return
|
|
5260
|
-
|
|
5261
|
-
method: "
|
|
5262
|
-
signal
|
|
4758
|
+
const customFetcher = useCustomClient();
|
|
4759
|
+
return (options) => {
|
|
4760
|
+
return customFetcher(getGetAllRomaConfigurationUrl(), {
|
|
4761
|
+
...options,
|
|
4762
|
+
method: "GET"
|
|
5263
4763
|
});
|
|
5264
4764
|
};
|
|
5265
4765
|
};
|
|
@@ -5267,49 +4767,56 @@ const getGetAllRomaConfigurationQueryKey = () => {
|
|
|
5267
4767
|
return [`/api/configurations`];
|
|
5268
4768
|
};
|
|
5269
4769
|
const useGetAllRomaConfigurationQueryOptions = (options) => {
|
|
5270
|
-
const { query: queryOptions } = options ?? {};
|
|
4770
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5271
4771
|
const queryKey = queryOptions?.queryKey ?? getGetAllRomaConfigurationQueryKey();
|
|
5272
4772
|
const getAllRomaConfiguration = useGetAllRomaConfigurationHook();
|
|
5273
|
-
const queryFn = ({ signal }) => getAllRomaConfiguration(signal);
|
|
4773
|
+
const queryFn = ({ signal }) => getAllRomaConfiguration({ signal, ...requestOptions });
|
|
5274
4774
|
return { queryKey, queryFn, ...queryOptions };
|
|
5275
4775
|
};
|
|
5276
|
-
|
|
4776
|
+
function useGetAllRomaConfiguration(options, queryClient) {
|
|
5277
4777
|
const queryOptions = useGetAllRomaConfigurationQueryOptions(options);
|
|
5278
|
-
const query = useQuery(queryOptions);
|
|
5279
|
-
query
|
|
5280
|
-
|
|
4778
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4779
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4780
|
+
}
|
|
4781
|
+
const getAddRomaConfigurationUrl = () => {
|
|
4782
|
+
return `/api/configurations`;
|
|
5281
4783
|
};
|
|
5282
4784
|
const useAddRomaConfigurationHook = () => {
|
|
5283
|
-
const
|
|
5284
|
-
return (romaConfigurationDto) => {
|
|
5285
|
-
return
|
|
5286
|
-
|
|
5287
|
-
method: "
|
|
5288
|
-
headers: { "Content-Type": "application/json" },
|
|
5289
|
-
|
|
4785
|
+
const customFetcher = useCustomClient();
|
|
4786
|
+
return (romaConfigurationDto, options) => {
|
|
4787
|
+
return customFetcher(getAddRomaConfigurationUrl(), {
|
|
4788
|
+
...options,
|
|
4789
|
+
method: "POST",
|
|
4790
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
4791
|
+
body: JSON.stringify(romaConfigurationDto)
|
|
5290
4792
|
});
|
|
5291
4793
|
};
|
|
5292
4794
|
};
|
|
5293
4795
|
const useAddRomaConfigurationMutationOptions = (options) => {
|
|
5294
|
-
const
|
|
4796
|
+
const mutationKey = ["addRomaConfiguration"];
|
|
4797
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
5295
4798
|
const addRomaConfiguration = useAddRomaConfigurationHook();
|
|
5296
4799
|
const mutationFn = (props) => {
|
|
5297
4800
|
const { data } = props ?? {};
|
|
5298
|
-
return addRomaConfiguration(data);
|
|
4801
|
+
return addRomaConfiguration(data, requestOptions);
|
|
5299
4802
|
};
|
|
5300
4803
|
return { mutationFn, ...mutationOptions };
|
|
5301
4804
|
};
|
|
5302
|
-
const useAddRomaConfiguration = (options) => {
|
|
5303
|
-
|
|
5304
|
-
|
|
4805
|
+
const useAddRomaConfiguration = (options, queryClient) => {
|
|
4806
|
+
return useMutation(
|
|
4807
|
+
useAddRomaConfigurationMutationOptions(options),
|
|
4808
|
+
queryClient
|
|
4809
|
+
);
|
|
4810
|
+
};
|
|
4811
|
+
const getGetAllRomaConfigurationTypesUrl = () => {
|
|
4812
|
+
return `/api/configurations/types`;
|
|
5305
4813
|
};
|
|
5306
4814
|
const useGetAllRomaConfigurationTypesHook = () => {
|
|
5307
|
-
const
|
|
5308
|
-
return (
|
|
5309
|
-
return
|
|
5310
|
-
|
|
5311
|
-
method: "
|
|
5312
|
-
signal
|
|
4815
|
+
const customFetcher = useCustomClient();
|
|
4816
|
+
return (options) => {
|
|
4817
|
+
return customFetcher(getGetAllRomaConfigurationTypesUrl(), {
|
|
4818
|
+
...options,
|
|
4819
|
+
method: "GET"
|
|
5313
4820
|
});
|
|
5314
4821
|
};
|
|
5315
4822
|
};
|
|
@@ -5317,25 +4824,26 @@ const getGetAllRomaConfigurationTypesQueryKey = () => {
|
|
|
5317
4824
|
return [`/api/configurations/types`];
|
|
5318
4825
|
};
|
|
5319
4826
|
const useGetAllRomaConfigurationTypesQueryOptions = (options) => {
|
|
5320
|
-
const { query: queryOptions } = options ?? {};
|
|
4827
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5321
4828
|
const queryKey = queryOptions?.queryKey ?? getGetAllRomaConfigurationTypesQueryKey();
|
|
5322
4829
|
const getAllRomaConfigurationTypes = useGetAllRomaConfigurationTypesHook();
|
|
5323
|
-
const queryFn = ({ signal }) => getAllRomaConfigurationTypes(signal);
|
|
4830
|
+
const queryFn = ({ signal }) => getAllRomaConfigurationTypes({ signal, ...requestOptions });
|
|
5324
4831
|
return { queryKey, queryFn, ...queryOptions };
|
|
5325
4832
|
};
|
|
5326
|
-
|
|
4833
|
+
function useGetAllRomaConfigurationTypes(options, queryClient) {
|
|
5327
4834
|
const queryOptions = useGetAllRomaConfigurationTypesQueryOptions(options);
|
|
5328
|
-
const query = useQuery(queryOptions);
|
|
5329
|
-
query
|
|
5330
|
-
|
|
4835
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4836
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4837
|
+
}
|
|
4838
|
+
const getGetAllRomaConfigurationByTypeUrl = (type) => {
|
|
4839
|
+
return `/api/configurations/types/type/${type}`;
|
|
5331
4840
|
};
|
|
5332
4841
|
const useGetAllRomaConfigurationByTypeHook = () => {
|
|
5333
|
-
const
|
|
5334
|
-
return (type,
|
|
5335
|
-
return
|
|
5336
|
-
|
|
5337
|
-
method: "
|
|
5338
|
-
signal
|
|
4842
|
+
const customFetcher = useCustomClient();
|
|
4843
|
+
return (type, options) => {
|
|
4844
|
+
return customFetcher(getGetAllRomaConfigurationByTypeUrl(type), {
|
|
4845
|
+
...options,
|
|
4846
|
+
method: "GET"
|
|
5339
4847
|
});
|
|
5340
4848
|
};
|
|
5341
4849
|
};
|
|
@@ -5343,10 +4851,10 @@ const getGetAllRomaConfigurationByTypeQueryKey = (type) => {
|
|
|
5343
4851
|
return [`/api/configurations/types/type/${type}`];
|
|
5344
4852
|
};
|
|
5345
4853
|
const useGetAllRomaConfigurationByTypeQueryOptions = (type, options) => {
|
|
5346
|
-
const { query: queryOptions } = options ?? {};
|
|
4854
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5347
4855
|
const queryKey = queryOptions?.queryKey ?? getGetAllRomaConfigurationByTypeQueryKey(type);
|
|
5348
4856
|
const getAllRomaConfigurationByType = useGetAllRomaConfigurationByTypeHook();
|
|
5349
|
-
const queryFn = ({ signal }) => getAllRomaConfigurationByType(type, signal);
|
|
4857
|
+
const queryFn = ({ signal }) => getAllRomaConfigurationByType(type, { signal, ...requestOptions });
|
|
5350
4858
|
return {
|
|
5351
4859
|
queryKey,
|
|
5352
4860
|
queryFn,
|
|
@@ -5354,47 +4862,57 @@ const useGetAllRomaConfigurationByTypeQueryOptions = (type, options) => {
|
|
|
5354
4862
|
...queryOptions
|
|
5355
4863
|
};
|
|
5356
4864
|
};
|
|
5357
|
-
|
|
4865
|
+
function useGetAllRomaConfigurationByType(type, options, queryClient) {
|
|
5358
4866
|
const queryOptions = useGetAllRomaConfigurationByTypeQueryOptions(
|
|
5359
4867
|
type,
|
|
5360
4868
|
options
|
|
5361
4869
|
);
|
|
5362
|
-
const query = useQuery(queryOptions);
|
|
5363
|
-
query
|
|
5364
|
-
|
|
4870
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4871
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4872
|
+
}
|
|
4873
|
+
const getCreateFeedbackUrl = () => {
|
|
4874
|
+
return `/api/feedbacks`;
|
|
5365
4875
|
};
|
|
5366
4876
|
const useCreateFeedbackHook = () => {
|
|
5367
|
-
const
|
|
5368
|
-
return (feedbackDto) => {
|
|
5369
|
-
return
|
|
5370
|
-
|
|
5371
|
-
method: "
|
|
5372
|
-
headers: { "Content-Type": "application/json" },
|
|
5373
|
-
|
|
4877
|
+
const customFetcher = useCustomClient();
|
|
4878
|
+
return (feedbackDto, options) => {
|
|
4879
|
+
return customFetcher(getCreateFeedbackUrl(), {
|
|
4880
|
+
...options,
|
|
4881
|
+
method: "POST",
|
|
4882
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
4883
|
+
body: JSON.stringify(feedbackDto)
|
|
5374
4884
|
});
|
|
5375
4885
|
};
|
|
5376
4886
|
};
|
|
5377
4887
|
const useCreateFeedbackMutationOptions = (options) => {
|
|
5378
|
-
const
|
|
4888
|
+
const mutationKey = ["createFeedback"];
|
|
4889
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
5379
4890
|
const createFeedback = useCreateFeedbackHook();
|
|
5380
4891
|
const mutationFn = (props) => {
|
|
5381
4892
|
const { data } = props ?? {};
|
|
5382
|
-
return createFeedback(data);
|
|
4893
|
+
return createFeedback(data, requestOptions);
|
|
5383
4894
|
};
|
|
5384
4895
|
return { mutationFn, ...mutationOptions };
|
|
5385
4896
|
};
|
|
5386
|
-
const useCreateFeedback = (options) => {
|
|
5387
|
-
|
|
5388
|
-
|
|
4897
|
+
const useCreateFeedback = (options, queryClient) => {
|
|
4898
|
+
return useMutation(useCreateFeedbackMutationOptions(options), queryClient);
|
|
4899
|
+
};
|
|
4900
|
+
const getListFeedbacksByCurrentUserUrl = (params) => {
|
|
4901
|
+
const normalizedParams = new URLSearchParams();
|
|
4902
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
4903
|
+
if (value !== void 0) {
|
|
4904
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
4905
|
+
}
|
|
4906
|
+
});
|
|
4907
|
+
const stringifiedParams = normalizedParams.toString();
|
|
4908
|
+
return stringifiedParams.length > 0 ? `/api/feedbacks/mine?${stringifiedParams}` : `/api/feedbacks/mine`;
|
|
5389
4909
|
};
|
|
5390
4910
|
const useListFeedbacksByCurrentUserHook = () => {
|
|
5391
|
-
const
|
|
5392
|
-
return (params,
|
|
5393
|
-
return
|
|
5394
|
-
|
|
5395
|
-
method: "
|
|
5396
|
-
params,
|
|
5397
|
-
signal
|
|
4911
|
+
const customFetcher = useCustomClient();
|
|
4912
|
+
return (params, options) => {
|
|
4913
|
+
return customFetcher(getListFeedbacksByCurrentUserUrl(params), {
|
|
4914
|
+
...options,
|
|
4915
|
+
method: "GET"
|
|
5398
4916
|
});
|
|
5399
4917
|
};
|
|
5400
4918
|
};
|
|
@@ -5402,21 +4920,327 @@ const getListFeedbacksByCurrentUserQueryKey = (params) => {
|
|
|
5402
4920
|
return [`/api/feedbacks/mine`, ...params ? [params] : []];
|
|
5403
4921
|
};
|
|
5404
4922
|
const useListFeedbacksByCurrentUserQueryOptions = (params, options) => {
|
|
5405
|
-
const { query: queryOptions } = options ?? {};
|
|
4923
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5406
4924
|
const queryKey = queryOptions?.queryKey ?? getListFeedbacksByCurrentUserQueryKey(params);
|
|
5407
4925
|
const listFeedbacksByCurrentUser = useListFeedbacksByCurrentUserHook();
|
|
5408
|
-
const queryFn = ({ signal }) => listFeedbacksByCurrentUser(params, signal);
|
|
4926
|
+
const queryFn = ({ signal }) => listFeedbacksByCurrentUser(params, { signal, ...requestOptions });
|
|
5409
4927
|
return { queryKey, queryFn, ...queryOptions };
|
|
5410
4928
|
};
|
|
5411
|
-
|
|
4929
|
+
function useListFeedbacksByCurrentUser(params, options, queryClient) {
|
|
5412
4930
|
const queryOptions = useListFeedbacksByCurrentUserQueryOptions(
|
|
5413
4931
|
params,
|
|
5414
4932
|
options
|
|
5415
4933
|
);
|
|
5416
|
-
const query = useQuery(queryOptions);
|
|
5417
|
-
query
|
|
5418
|
-
|
|
4934
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4935
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4936
|
+
}
|
|
4937
|
+
const getGetByIdUrl = (id) => {
|
|
4938
|
+
return `/api/alarm-groups/${id}`;
|
|
4939
|
+
};
|
|
4940
|
+
const useGetByIdHook = () => {
|
|
4941
|
+
const customFetcher = useCustomClient();
|
|
4942
|
+
return (id, options) => {
|
|
4943
|
+
return customFetcher(getGetByIdUrl(id), {
|
|
4944
|
+
...options,
|
|
4945
|
+
method: "GET"
|
|
4946
|
+
});
|
|
4947
|
+
};
|
|
4948
|
+
};
|
|
4949
|
+
const getGetByIdQueryKey = (id) => {
|
|
4950
|
+
return [`/api/alarm-groups/${id}`];
|
|
4951
|
+
};
|
|
4952
|
+
const useGetByIdQueryOptions = (id, options) => {
|
|
4953
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4954
|
+
const queryKey = queryOptions?.queryKey ?? getGetByIdQueryKey(id);
|
|
4955
|
+
const getById = useGetByIdHook();
|
|
4956
|
+
const queryFn = ({ signal }) => getById(id, { signal, ...requestOptions });
|
|
4957
|
+
return {
|
|
4958
|
+
queryKey,
|
|
4959
|
+
queryFn,
|
|
4960
|
+
enabled: !!id,
|
|
4961
|
+
...queryOptions
|
|
4962
|
+
};
|
|
4963
|
+
};
|
|
4964
|
+
function useGetById(id, options, queryClient) {
|
|
4965
|
+
const queryOptions = useGetByIdQueryOptions(id, options);
|
|
4966
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4967
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4968
|
+
}
|
|
4969
|
+
const getUpdateUrl = (id) => {
|
|
4970
|
+
return `/api/alarm-groups/${id}`;
|
|
4971
|
+
};
|
|
4972
|
+
const useUpdateHook = () => {
|
|
4973
|
+
const customFetcher = useCustomClient();
|
|
4974
|
+
return (id, alarmGroupDto, options) => {
|
|
4975
|
+
return customFetcher(getUpdateUrl(id), {
|
|
4976
|
+
...options,
|
|
4977
|
+
method: "PUT",
|
|
4978
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
4979
|
+
body: JSON.stringify(alarmGroupDto)
|
|
4980
|
+
});
|
|
4981
|
+
};
|
|
4982
|
+
};
|
|
4983
|
+
const useUpdateMutationOptions = (options) => {
|
|
4984
|
+
const mutationKey = ["update"];
|
|
4985
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
4986
|
+
const update = useUpdateHook();
|
|
4987
|
+
const mutationFn = (props) => {
|
|
4988
|
+
const { id, data } = props ?? {};
|
|
4989
|
+
return update(id, data, requestOptions);
|
|
4990
|
+
};
|
|
4991
|
+
return { mutationFn, ...mutationOptions };
|
|
4992
|
+
};
|
|
4993
|
+
const useUpdate = (options, queryClient) => {
|
|
4994
|
+
return useMutation(useUpdateMutationOptions(options), queryClient);
|
|
4995
|
+
};
|
|
4996
|
+
const getDeleteUrl = (id) => {
|
|
4997
|
+
return `/api/alarm-groups/${id}`;
|
|
4998
|
+
};
|
|
4999
|
+
const use_DeleteHook = () => {
|
|
5000
|
+
const customFetcher = useCustomClient();
|
|
5001
|
+
return (id, options) => {
|
|
5002
|
+
return customFetcher(getDeleteUrl(id), {
|
|
5003
|
+
...options,
|
|
5004
|
+
method: "DELETE"
|
|
5005
|
+
});
|
|
5006
|
+
};
|
|
5007
|
+
};
|
|
5008
|
+
const useDeleteMutationOptions = (options) => {
|
|
5009
|
+
const mutationKey = ["_delete"];
|
|
5010
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
5011
|
+
const _delete = use_DeleteHook();
|
|
5012
|
+
const mutationFn = (props) => {
|
|
5013
|
+
const { id } = props ?? {};
|
|
5014
|
+
return _delete(id, requestOptions);
|
|
5015
|
+
};
|
|
5016
|
+
return { mutationFn, ...mutationOptions };
|
|
5017
|
+
};
|
|
5018
|
+
const useDelete = (options, queryClient) => {
|
|
5019
|
+
return useMutation(useDeleteMutationOptions(options), queryClient);
|
|
5020
|
+
};
|
|
5021
|
+
const getReplaceMembersUrl = (id) => {
|
|
5022
|
+
return `/api/alarm-groups/${id}/members`;
|
|
5023
|
+
};
|
|
5024
|
+
const useReplaceMembersHook = () => {
|
|
5025
|
+
const customFetcher = useCustomClient();
|
|
5026
|
+
return (id, replaceMembersBody, options) => {
|
|
5027
|
+
return customFetcher(getReplaceMembersUrl(id), {
|
|
5028
|
+
...options,
|
|
5029
|
+
method: "PUT",
|
|
5030
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
5031
|
+
body: JSON.stringify(replaceMembersBody)
|
|
5032
|
+
});
|
|
5033
|
+
};
|
|
5034
|
+
};
|
|
5035
|
+
const useReplaceMembersMutationOptions = (options) => {
|
|
5036
|
+
const mutationKey = ["replaceMembers"];
|
|
5037
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
5038
|
+
const replaceMembers = useReplaceMembersHook();
|
|
5039
|
+
const mutationFn = (props) => {
|
|
5040
|
+
const { id, data } = props ?? {};
|
|
5041
|
+
return replaceMembers(id, data, requestOptions);
|
|
5042
|
+
};
|
|
5043
|
+
return { mutationFn, ...mutationOptions };
|
|
5044
|
+
};
|
|
5045
|
+
const useReplaceMembers = (options, queryClient) => {
|
|
5046
|
+
return useMutation(useReplaceMembersMutationOptions(options), queryClient);
|
|
5047
|
+
};
|
|
5048
|
+
const getGetAll1Url = () => {
|
|
5049
|
+
return `/api/alarm-groups`;
|
|
5050
|
+
};
|
|
5051
|
+
const useGetAll1Hook = () => {
|
|
5052
|
+
const customFetcher = useCustomClient();
|
|
5053
|
+
return (options) => {
|
|
5054
|
+
return customFetcher(getGetAll1Url(), {
|
|
5055
|
+
...options,
|
|
5056
|
+
method: "GET"
|
|
5057
|
+
});
|
|
5058
|
+
};
|
|
5059
|
+
};
|
|
5060
|
+
const getGetAll1QueryKey = () => {
|
|
5061
|
+
return [`/api/alarm-groups`];
|
|
5062
|
+
};
|
|
5063
|
+
const useGetAll1QueryOptions = (options) => {
|
|
5064
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5065
|
+
const queryKey = queryOptions?.queryKey ?? getGetAll1QueryKey();
|
|
5066
|
+
const getAll1 = useGetAll1Hook();
|
|
5067
|
+
const queryFn = ({ signal }) => getAll1({ signal, ...requestOptions });
|
|
5068
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
5069
|
+
};
|
|
5070
|
+
function useGetAll1(options, queryClient) {
|
|
5071
|
+
const queryOptions = useGetAll1QueryOptions(options);
|
|
5072
|
+
const query = useQuery(queryOptions, queryClient);
|
|
5073
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
5074
|
+
}
|
|
5075
|
+
const getCreateUrl = () => {
|
|
5076
|
+
return `/api/alarm-groups`;
|
|
5077
|
+
};
|
|
5078
|
+
const useCreateHook = () => {
|
|
5079
|
+
const customFetcher = useCustomClient();
|
|
5080
|
+
return (alarmGroupDto, options) => {
|
|
5081
|
+
return customFetcher(getCreateUrl(), {
|
|
5082
|
+
...options,
|
|
5083
|
+
method: "POST",
|
|
5084
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
5085
|
+
body: JSON.stringify(alarmGroupDto)
|
|
5086
|
+
});
|
|
5087
|
+
};
|
|
5088
|
+
};
|
|
5089
|
+
const useCreateMutationOptions = (options) => {
|
|
5090
|
+
const mutationKey = ["create"];
|
|
5091
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
5092
|
+
const create = useCreateHook();
|
|
5093
|
+
const mutationFn = (props) => {
|
|
5094
|
+
const { data } = props ?? {};
|
|
5095
|
+
return create(data, requestOptions);
|
|
5096
|
+
};
|
|
5097
|
+
return { mutationFn, ...mutationOptions };
|
|
5098
|
+
};
|
|
5099
|
+
const useCreate = (options, queryClient) => {
|
|
5100
|
+
return useMutation(useCreateMutationOptions(options), queryClient);
|
|
5101
|
+
};
|
|
5102
|
+
const getGetAllUrl = (params) => {
|
|
5103
|
+
const normalizedParams = new URLSearchParams();
|
|
5104
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
5105
|
+
if (value !== void 0) {
|
|
5106
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
5107
|
+
}
|
|
5108
|
+
});
|
|
5109
|
+
const stringifiedParams = normalizedParams.toString();
|
|
5110
|
+
return stringifiedParams.length > 0 ? `/api/alarms?${stringifiedParams}` : `/api/alarms`;
|
|
5111
|
+
};
|
|
5112
|
+
const useGetAllHook = () => {
|
|
5113
|
+
const customFetcher = useCustomClient();
|
|
5114
|
+
return (params, options) => {
|
|
5115
|
+
return customFetcher(getGetAllUrl(params), {
|
|
5116
|
+
...options,
|
|
5117
|
+
method: "GET"
|
|
5118
|
+
});
|
|
5119
|
+
};
|
|
5120
|
+
};
|
|
5121
|
+
const getGetAllQueryKey = (params) => {
|
|
5122
|
+
return [`/api/alarms`, ...params ? [params] : []];
|
|
5123
|
+
};
|
|
5124
|
+
const useGetAllQueryOptions = (params, options) => {
|
|
5125
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5126
|
+
const queryKey = queryOptions?.queryKey ?? getGetAllQueryKey(params);
|
|
5127
|
+
const getAll = useGetAllHook();
|
|
5128
|
+
const queryFn = ({ signal }) => getAll(params, { signal, ...requestOptions });
|
|
5129
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
5130
|
+
};
|
|
5131
|
+
function useGetAll(params, options, queryClient) {
|
|
5132
|
+
const queryOptions = useGetAllQueryOptions(params, options);
|
|
5133
|
+
const query = useQuery(queryOptions, queryClient);
|
|
5134
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
5135
|
+
}
|
|
5136
|
+
const getRaiseUrl = () => {
|
|
5137
|
+
return `/api/alarms`;
|
|
5138
|
+
};
|
|
5139
|
+
const useRaiseHook = () => {
|
|
5140
|
+
const customFetcher = useCustomClient();
|
|
5141
|
+
return (raiseAlarmRequest, options) => {
|
|
5142
|
+
return customFetcher(getRaiseUrl(), {
|
|
5143
|
+
...options,
|
|
5144
|
+
method: "POST",
|
|
5145
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
5146
|
+
body: JSON.stringify(raiseAlarmRequest)
|
|
5147
|
+
});
|
|
5148
|
+
};
|
|
5419
5149
|
};
|
|
5150
|
+
const useRaiseMutationOptions = (options) => {
|
|
5151
|
+
const mutationKey = ["raise"];
|
|
5152
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
5153
|
+
const raise = useRaiseHook();
|
|
5154
|
+
const mutationFn = (props) => {
|
|
5155
|
+
const { data } = props ?? {};
|
|
5156
|
+
return raise(data, requestOptions);
|
|
5157
|
+
};
|
|
5158
|
+
return { mutationFn, ...mutationOptions };
|
|
5159
|
+
};
|
|
5160
|
+
const useRaise = (options, queryClient) => {
|
|
5161
|
+
return useMutation(useRaiseMutationOptions(options), queryClient);
|
|
5162
|
+
};
|
|
5163
|
+
const getClearUrl = (id) => {
|
|
5164
|
+
return `/api/alarms/${id}/clear`;
|
|
5165
|
+
};
|
|
5166
|
+
const useClearHook = () => {
|
|
5167
|
+
const customFetcher = useCustomClient();
|
|
5168
|
+
return (id, clearAlarmRequest, options) => {
|
|
5169
|
+
return customFetcher(getClearUrl(id), {
|
|
5170
|
+
...options,
|
|
5171
|
+
method: "POST",
|
|
5172
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
5173
|
+
body: JSON.stringify(clearAlarmRequest)
|
|
5174
|
+
});
|
|
5175
|
+
};
|
|
5176
|
+
};
|
|
5177
|
+
const useClearMutationOptions = (options) => {
|
|
5178
|
+
const mutationKey = ["clear"];
|
|
5179
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
|
|
5180
|
+
const clear = useClearHook();
|
|
5181
|
+
const mutationFn = (props) => {
|
|
5182
|
+
const { id, data } = props ?? {};
|
|
5183
|
+
return clear(id, data, requestOptions);
|
|
5184
|
+
};
|
|
5185
|
+
return { mutationFn, ...mutationOptions };
|
|
5186
|
+
};
|
|
5187
|
+
const useClear = (options, queryClient) => {
|
|
5188
|
+
return useMutation(useClearMutationOptions(options), queryClient);
|
|
5189
|
+
};
|
|
5190
|
+
const getStreamAlarmsUrl = () => {
|
|
5191
|
+
return `/eventstream/alarm`;
|
|
5192
|
+
};
|
|
5193
|
+
const useStreamAlarmsHook = () => {
|
|
5194
|
+
const customFetcher = useCustomClient();
|
|
5195
|
+
return (options) => {
|
|
5196
|
+
return customFetcher(getStreamAlarmsUrl(), {
|
|
5197
|
+
...options,
|
|
5198
|
+
method: "GET"
|
|
5199
|
+
});
|
|
5200
|
+
};
|
|
5201
|
+
};
|
|
5202
|
+
const getStreamAlarmsQueryKey = () => {
|
|
5203
|
+
return [`/eventstream/alarm`];
|
|
5204
|
+
};
|
|
5205
|
+
const useStreamAlarmsQueryOptions = (options) => {
|
|
5206
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5207
|
+
const queryKey = queryOptions?.queryKey ?? getStreamAlarmsQueryKey();
|
|
5208
|
+
const streamAlarms = useStreamAlarmsHook();
|
|
5209
|
+
const queryFn = ({ signal }) => streamAlarms({ signal, ...requestOptions });
|
|
5210
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
5211
|
+
};
|
|
5212
|
+
function useStreamAlarms(options, queryClient) {
|
|
5213
|
+
const queryOptions = useStreamAlarmsQueryOptions(options);
|
|
5214
|
+
const query = useQuery(queryOptions, queryClient);
|
|
5215
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
5216
|
+
}
|
|
5217
|
+
const getGetStatusUrl = () => {
|
|
5218
|
+
return `/api/health/status`;
|
|
5219
|
+
};
|
|
5220
|
+
const useGetStatusHook = () => {
|
|
5221
|
+
const customFetcher = useCustomClient();
|
|
5222
|
+
return (options) => {
|
|
5223
|
+
return customFetcher(getGetStatusUrl(), {
|
|
5224
|
+
...options,
|
|
5225
|
+
method: "GET"
|
|
5226
|
+
});
|
|
5227
|
+
};
|
|
5228
|
+
};
|
|
5229
|
+
const getGetStatusQueryKey = () => {
|
|
5230
|
+
return [`/api/health/status`];
|
|
5231
|
+
};
|
|
5232
|
+
const useGetStatusQueryOptions = (options) => {
|
|
5233
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5234
|
+
const queryKey = queryOptions?.queryKey ?? getGetStatusQueryKey();
|
|
5235
|
+
const getStatus = useGetStatusHook();
|
|
5236
|
+
const queryFn = ({ signal }) => getStatus({ signal, ...requestOptions });
|
|
5237
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
5238
|
+
};
|
|
5239
|
+
function useGetStatus(options, queryClient) {
|
|
5240
|
+
const queryOptions = useGetStatusQueryOptions(options);
|
|
5241
|
+
const query = useQuery(queryOptions, queryClient);
|
|
5242
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
5243
|
+
}
|
|
5420
5244
|
const findGroupMembers = async (client, groupId, query) => {
|
|
5421
5245
|
const headers = {
|
|
5422
5246
|
ConsistencyLevel: "eventual"
|
|
@@ -5898,26 +5722,29 @@ const useWatchDefaults = {
|
|
|
5898
5722
|
}
|
|
5899
5723
|
};
|
|
5900
5724
|
const useManageWatchList = (system) => {
|
|
5901
|
-
const { data: setting } = useGetSettingsByAppShortName(
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5725
|
+
const { data: setting } = useGetSettingsByAppShortName(
|
|
5726
|
+
"notifications",
|
|
5727
|
+
{
|
|
5728
|
+
query: {
|
|
5729
|
+
meta: {
|
|
5730
|
+
persist: true
|
|
5731
|
+
},
|
|
5732
|
+
staleTime: 6e4 * 15,
|
|
5733
|
+
// Skip re-fetching if data is less than 15 minutes old
|
|
5734
|
+
select: (data) => {
|
|
5735
|
+
const setting2 = (data ?? []).filter(
|
|
5736
|
+
(f) => f.setting === "app-notifications"
|
|
5737
|
+
);
|
|
5738
|
+
return setting2 && setting2.length > 0 ? setting2[0] : {
|
|
5739
|
+
appShortName: "notifications",
|
|
5740
|
+
isPublic: false,
|
|
5741
|
+
setting: "app-notifications",
|
|
5742
|
+
value: rootSchema.cast(useWatchDefaults, { assert: false })
|
|
5743
|
+
};
|
|
5744
|
+
}
|
|
5918
5745
|
}
|
|
5919
5746
|
}
|
|
5920
|
-
|
|
5747
|
+
);
|
|
5921
5748
|
const framework = useFramework();
|
|
5922
5749
|
const user = framework.modules.auth.account;
|
|
5923
5750
|
const userId = user?.username.split("@")[0].toLowerCase() ?? "MISSINGUSER";
|
|
@@ -5998,6 +5825,9 @@ const useManageWatchList = (system) => {
|
|
|
5998
5825
|
};
|
|
5999
5826
|
};
|
|
6000
5827
|
export {
|
|
5828
|
+
AdminDtoAdminType,
|
|
5829
|
+
AlarmDtoSeverity,
|
|
5830
|
+
AlarmDtoState,
|
|
6001
5831
|
AppContext,
|
|
6002
5832
|
AppLoadError,
|
|
6003
5833
|
AppLoader,
|
|
@@ -6009,29 +5839,81 @@ export {
|
|
|
6009
5839
|
Header,
|
|
6010
5840
|
HttpError2 as HttpError,
|
|
6011
5841
|
HttpErrorViewer,
|
|
5842
|
+
RaiseAlarmRequestSeverity,
|
|
6012
5843
|
RomaErrorViewer,
|
|
6013
5844
|
StyleProvider,
|
|
6014
5845
|
configure,
|
|
6015
5846
|
createIDBPersister,
|
|
6016
5847
|
findUserById,
|
|
6017
5848
|
findUsersByMail,
|
|
5849
|
+
getAddRomaConfigurationUrl,
|
|
5850
|
+
getClearUrl,
|
|
5851
|
+
getCreateFeedbackUrl,
|
|
5852
|
+
getCreateOrUpdateAppUrl,
|
|
5853
|
+
getCreateOrUpdateCategoryUrl,
|
|
5854
|
+
getCreateOrUpdateServiceUrl,
|
|
5855
|
+
getCreatePublicSettingByUserIdUrl,
|
|
5856
|
+
getCreateSettingByUserIdUrl,
|
|
5857
|
+
getCreateUrl,
|
|
5858
|
+
getDeleteAppByKeyUrl,
|
|
5859
|
+
getDeleteCategoryByIdUrl,
|
|
5860
|
+
getDeletePrivateSettingByIdUrl,
|
|
5861
|
+
getDeletePublicSettingByIdUrl,
|
|
5862
|
+
getDeleteRomaConfigurationUrl,
|
|
5863
|
+
getDeleteServiceByKeyUrl,
|
|
5864
|
+
getDeleteUrl,
|
|
5865
|
+
getGetAll1QueryKey,
|
|
5866
|
+
getGetAll1Url,
|
|
6018
5867
|
getGetAllAppsQueryKey,
|
|
5868
|
+
getGetAllAppsUrl,
|
|
6019
5869
|
getGetAllCategoriesQueryKey,
|
|
5870
|
+
getGetAllCategoriesUrl,
|
|
5871
|
+
getGetAllQueryKey,
|
|
6020
5872
|
getGetAllRomaConfigurationByTypeQueryKey,
|
|
5873
|
+
getGetAllRomaConfigurationByTypeUrl,
|
|
6021
5874
|
getGetAllRomaConfigurationQueryKey,
|
|
6022
5875
|
getGetAllRomaConfigurationTypesQueryKey,
|
|
5876
|
+
getGetAllRomaConfigurationTypesUrl,
|
|
5877
|
+
getGetAllRomaConfigurationUrl,
|
|
6023
5878
|
getGetAllServicesQueryKey,
|
|
5879
|
+
getGetAllServicesUrl,
|
|
5880
|
+
getGetAllUrl,
|
|
6024
5881
|
getGetAppByKeyQueryKey,
|
|
5882
|
+
getGetAppByKeyUrl,
|
|
5883
|
+
getGetByIdQueryKey,
|
|
5884
|
+
getGetByIdUrl,
|
|
6025
5885
|
getGetCategoryByIdQueryKey,
|
|
5886
|
+
getGetCategoryByIdUrl,
|
|
6026
5887
|
getGetCurrentEnvironmentQueryKey,
|
|
5888
|
+
getGetCurrentEnvironmentUrl,
|
|
6027
5889
|
getGetPublicSettingByUserAndIdQueryKey,
|
|
5890
|
+
getGetPublicSettingByUserAndIdUrl,
|
|
6028
5891
|
getGetRomaConfigurationByIdQueryKey,
|
|
5892
|
+
getGetRomaConfigurationByIdUrl,
|
|
6029
5893
|
getGetServiceByKeyQueryKey,
|
|
5894
|
+
getGetServiceByKeyUrl,
|
|
6030
5895
|
getGetSettingByUserAndIdQueryKey,
|
|
5896
|
+
getGetSettingByUserAndIdUrl,
|
|
6031
5897
|
getGetSettingsByAppShortNameQueryKey,
|
|
5898
|
+
getGetSettingsByAppShortNameUrl,
|
|
6032
5899
|
getGetSettingsByUserIdQueryKey,
|
|
5900
|
+
getGetSettingsByUserIdUrl,
|
|
5901
|
+
getGetStatusQueryKey,
|
|
5902
|
+
getGetStatusUrl,
|
|
6033
5903
|
getListFeedbacksByCurrentUserQueryKey,
|
|
5904
|
+
getListFeedbacksByCurrentUserUrl,
|
|
5905
|
+
getRaiseUrl,
|
|
5906
|
+
getReplaceMembersUrl,
|
|
5907
|
+
getStreamAlarmsQueryKey,
|
|
5908
|
+
getStreamAlarmsUrl,
|
|
6034
5909
|
getStreamEventsQueryKey,
|
|
5910
|
+
getStreamEventsUrl,
|
|
5911
|
+
getUpdateByUserIdAndIdUrl,
|
|
5912
|
+
getUpdatePublicSettingByAppShortNameAndIdUrl,
|
|
5913
|
+
getUpdateRomaConfigurationUrl,
|
|
5914
|
+
getUpdateUrl,
|
|
5915
|
+
getUploadBundleUrl,
|
|
5916
|
+
handle,
|
|
6035
5917
|
handleError,
|
|
6036
5918
|
makeComponent,
|
|
6037
5919
|
parseJwt,
|
|
@@ -6040,9 +5922,15 @@ export {
|
|
|
6040
5922
|
useAddRomaConfigurationHook,
|
|
6041
5923
|
useAddRomaConfigurationMutationOptions,
|
|
6042
5924
|
useApps,
|
|
5925
|
+
useClear,
|
|
5926
|
+
useClearHook,
|
|
5927
|
+
useClearMutationOptions,
|
|
5928
|
+
useCreate,
|
|
6043
5929
|
useCreateFeedback,
|
|
6044
5930
|
useCreateFeedbackHook,
|
|
6045
5931
|
useCreateFeedbackMutationOptions,
|
|
5932
|
+
useCreateHook,
|
|
5933
|
+
useCreateMutationOptions,
|
|
6046
5934
|
useCreateOrUpdateApp,
|
|
6047
5935
|
useCreateOrUpdateAppHook,
|
|
6048
5936
|
useCreateOrUpdateAppMutationOptions,
|
|
@@ -6058,12 +5946,14 @@ export {
|
|
|
6058
5946
|
useCreateSettingByUserId,
|
|
6059
5947
|
useCreateSettingByUserIdHook,
|
|
6060
5948
|
useCreateSettingByUserIdMutationOptions,
|
|
5949
|
+
useDelete,
|
|
6061
5950
|
useDeleteAppByKey,
|
|
6062
5951
|
useDeleteAppByKeyHook,
|
|
6063
5952
|
useDeleteAppByKeyMutationOptions,
|
|
6064
5953
|
useDeleteCategoryById,
|
|
6065
5954
|
useDeleteCategoryByIdHook,
|
|
6066
5955
|
useDeleteCategoryByIdMutationOptions,
|
|
5956
|
+
useDeleteMutationOptions,
|
|
6067
5957
|
useDeletePrivateSettingById,
|
|
6068
5958
|
useDeletePrivateSettingByIdHook,
|
|
6069
5959
|
useDeletePrivateSettingByIdMutationOptions,
|
|
@@ -6083,12 +5973,18 @@ export {
|
|
|
6083
5973
|
useFindUserById,
|
|
6084
5974
|
useFindUsersByMail,
|
|
6085
5975
|
useFindUsersByShortname,
|
|
5976
|
+
useGetAll,
|
|
5977
|
+
useGetAll1,
|
|
5978
|
+
useGetAll1Hook,
|
|
5979
|
+
useGetAll1QueryOptions,
|
|
6086
5980
|
useGetAllApps,
|
|
6087
5981
|
useGetAllAppsHook,
|
|
6088
5982
|
useGetAllAppsQueryOptions,
|
|
6089
5983
|
useGetAllCategories,
|
|
6090
5984
|
useGetAllCategoriesHook,
|
|
6091
5985
|
useGetAllCategoriesQueryOptions,
|
|
5986
|
+
useGetAllHook,
|
|
5987
|
+
useGetAllQueryOptions,
|
|
6092
5988
|
useGetAllRomaConfiguration,
|
|
6093
5989
|
useGetAllRomaConfigurationByType,
|
|
6094
5990
|
useGetAllRomaConfigurationByTypeHook,
|
|
@@ -6105,6 +6001,9 @@ export {
|
|
|
6105
6001
|
useGetAppByKey,
|
|
6106
6002
|
useGetAppByKeyHook,
|
|
6107
6003
|
useGetAppByKeyQueryOptions,
|
|
6004
|
+
useGetById,
|
|
6005
|
+
useGetByIdHook,
|
|
6006
|
+
useGetByIdQueryOptions,
|
|
6108
6007
|
useGetCategoryById,
|
|
6109
6008
|
useGetCategoryByIdHook,
|
|
6110
6009
|
useGetCategoryByIdQueryOptions,
|
|
@@ -6129,17 +6028,32 @@ export {
|
|
|
6129
6028
|
useGetSettingsByUserId,
|
|
6130
6029
|
useGetSettingsByUserIdHook,
|
|
6131
6030
|
useGetSettingsByUserIdQueryOptions,
|
|
6031
|
+
useGetStatus,
|
|
6032
|
+
useGetStatusHook,
|
|
6033
|
+
useGetStatusQueryOptions,
|
|
6132
6034
|
useHasApiRole,
|
|
6133
6035
|
useListFeedbacksByCurrentUser,
|
|
6134
6036
|
useListFeedbacksByCurrentUserHook,
|
|
6135
6037
|
useListFeedbacksByCurrentUserQueryOptions,
|
|
6136
6038
|
useManageWatchList,
|
|
6039
|
+
useRaise,
|
|
6040
|
+
useRaiseHook,
|
|
6041
|
+
useRaiseMutationOptions,
|
|
6042
|
+
useReplaceMembers,
|
|
6043
|
+
useReplaceMembersHook,
|
|
6044
|
+
useReplaceMembersMutationOptions,
|
|
6045
|
+
useStreamAlarms,
|
|
6046
|
+
useStreamAlarmsHook,
|
|
6047
|
+
useStreamAlarmsQueryOptions,
|
|
6137
6048
|
useStreamEvents,
|
|
6138
6049
|
useStreamEventsHook,
|
|
6139
6050
|
useStreamEventsQueryOptions,
|
|
6051
|
+
useUpdate,
|
|
6140
6052
|
useUpdateByUserIdAndId,
|
|
6141
6053
|
useUpdateByUserIdAndIdHook,
|
|
6142
6054
|
useUpdateByUserIdAndIdMutationOptions,
|
|
6055
|
+
useUpdateHook,
|
|
6056
|
+
useUpdateMutationOptions,
|
|
6143
6057
|
useUpdatePublicSettingByAppShortNameAndId,
|
|
6144
6058
|
useUpdatePublicSettingByAppShortNameAndIdHook,
|
|
6145
6059
|
useUpdatePublicSettingByAppShortNameAndIdMutationOptions,
|
|
@@ -6149,5 +6063,6 @@ export {
|
|
|
6149
6063
|
useUploadBundle,
|
|
6150
6064
|
useUploadBundleHook,
|
|
6151
6065
|
useUploadBundleMutationOptions,
|
|
6066
|
+
use_DeleteHook,
|
|
6152
6067
|
withStyleIsolation
|
|
6153
6068
|
};
|