@equinor/roma-framework 5.0.0 → 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 +26 -1361
- 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 +26 -1361
- 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 +1401 -1252
- package/dev-portal/roma-framework.umd.js +0 -107649
- package/router-lZjM0_Ti.mjs +0 -6053
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,
|
|
10
|
-
import { QueryClient, QueryClientProvider, useQueryClient,
|
|
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";
|
|
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
|
};
|
|
@@ -1598,10 +957,20 @@ function promisifyRequest(request) {
|
|
|
1598
957
|
});
|
|
1599
958
|
}
|
|
1600
959
|
function createStore(dbName, storeName) {
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
960
|
+
let dbp;
|
|
961
|
+
const getDB = () => {
|
|
962
|
+
if (dbp)
|
|
963
|
+
return dbp;
|
|
964
|
+
const request = indexedDB.open(dbName);
|
|
965
|
+
request.onupgradeneeded = () => request.result.createObjectStore(storeName);
|
|
966
|
+
dbp = promisifyRequest(request);
|
|
967
|
+
dbp.then((db) => {
|
|
968
|
+
db.onclose = () => dbp = void 0;
|
|
969
|
+
}, () => {
|
|
970
|
+
});
|
|
971
|
+
return dbp;
|
|
972
|
+
};
|
|
973
|
+
return (txMode, callback) => getDB().then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));
|
|
1605
974
|
}
|
|
1606
975
|
let defaultGetStoreFunc;
|
|
1607
976
|
function defaultGetStore() {
|
|
@@ -1739,6 +1108,7 @@ class Connection {
|
|
|
1739
1108
|
}
|
|
1740
1109
|
class SseModuleProvider {
|
|
1741
1110
|
#config;
|
|
1111
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1742
1112
|
#connections = {};
|
|
1743
1113
|
constructor(config) {
|
|
1744
1114
|
this.#config = config;
|
|
@@ -1795,9 +1165,11 @@ class SseConfigurator {
|
|
|
1795
1165
|
return { endpoints: this.#endpoints };
|
|
1796
1166
|
}
|
|
1797
1167
|
}
|
|
1168
|
+
const version = "0.0.2";
|
|
1798
1169
|
const moduleKey = "sse";
|
|
1799
1170
|
const module$1 = {
|
|
1800
1171
|
name: moduleKey,
|
|
1172
|
+
version: new SemanticVersion(version),
|
|
1801
1173
|
configure: () => new SseConfigurator(),
|
|
1802
1174
|
initialize: async (init) => {
|
|
1803
1175
|
const config = await init.config.createConfig(init);
|
|
@@ -2090,29 +1462,18 @@ function printValue(value, quoteStrings) {
|
|
|
2090
1462
|
function toArray(value) {
|
|
2091
1463
|
return value == null ? [] : [].concat(value);
|
|
2092
1464
|
}
|
|
2093
|
-
let _Symbol$toStringTag;
|
|
1465
|
+
let _Symbol$toStringTag, _Symbol$hasInstance, _Symbol$toStringTag2;
|
|
2094
1466
|
let strReg = /\$\{\s*(\w+)\s*\}/g;
|
|
2095
1467
|
_Symbol$toStringTag = Symbol.toStringTag;
|
|
2096
|
-
class
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
path
|
|
2101
|
-
});
|
|
2102
|
-
if (typeof message === "string") return message.replace(strReg, (_, key) => printValue(params[key]));
|
|
2103
|
-
if (typeof message === "function") return message(params);
|
|
2104
|
-
return message;
|
|
2105
|
-
}
|
|
2106
|
-
static isError(err) {
|
|
2107
|
-
return err && err.name === "ValidationError";
|
|
2108
|
-
}
|
|
2109
|
-
constructor(errorOrErrors, value, field, type, disableStack) {
|
|
2110
|
-
super();
|
|
1468
|
+
class ValidationErrorNoStack {
|
|
1469
|
+
constructor(errorOrErrors, value, field, type) {
|
|
1470
|
+
this.name = void 0;
|
|
1471
|
+
this.message = void 0;
|
|
2111
1472
|
this.value = void 0;
|
|
2112
1473
|
this.path = void 0;
|
|
2113
1474
|
this.type = void 0;
|
|
2114
|
-
this.errors = void 0;
|
|
2115
1475
|
this.params = void 0;
|
|
1476
|
+
this.errors = void 0;
|
|
2116
1477
|
this.inner = void 0;
|
|
2117
1478
|
this[_Symbol$toStringTag] = "Error";
|
|
2118
1479
|
this.name = "ValidationError";
|
|
@@ -2131,7 +1492,50 @@ class ValidationError extends Error {
|
|
|
2131
1492
|
}
|
|
2132
1493
|
});
|
|
2133
1494
|
this.message = this.errors.length > 1 ? `${this.errors.length} errors occurred` : this.errors[0];
|
|
2134
|
-
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
_Symbol$hasInstance = Symbol.hasInstance;
|
|
1498
|
+
_Symbol$toStringTag2 = Symbol.toStringTag;
|
|
1499
|
+
class ValidationError extends Error {
|
|
1500
|
+
static formatError(message, params) {
|
|
1501
|
+
const path = params.label || params.path || "this";
|
|
1502
|
+
params = Object.assign({}, params, {
|
|
1503
|
+
path,
|
|
1504
|
+
originalPath: params.path
|
|
1505
|
+
});
|
|
1506
|
+
if (typeof message === "string") return message.replace(strReg, (_, key) => printValue(params[key]));
|
|
1507
|
+
if (typeof message === "function") return message(params);
|
|
1508
|
+
return message;
|
|
1509
|
+
}
|
|
1510
|
+
static isError(err) {
|
|
1511
|
+
return err && err.name === "ValidationError";
|
|
1512
|
+
}
|
|
1513
|
+
constructor(errorOrErrors, value, field, type, disableStack) {
|
|
1514
|
+
const errorNoStack = new ValidationErrorNoStack(errorOrErrors, value, field, type);
|
|
1515
|
+
if (disableStack) {
|
|
1516
|
+
return errorNoStack;
|
|
1517
|
+
}
|
|
1518
|
+
super();
|
|
1519
|
+
this.value = void 0;
|
|
1520
|
+
this.path = void 0;
|
|
1521
|
+
this.type = void 0;
|
|
1522
|
+
this.params = void 0;
|
|
1523
|
+
this.errors = [];
|
|
1524
|
+
this.inner = [];
|
|
1525
|
+
this[_Symbol$toStringTag2] = "Error";
|
|
1526
|
+
this.name = errorNoStack.name;
|
|
1527
|
+
this.message = errorNoStack.message;
|
|
1528
|
+
this.type = errorNoStack.type;
|
|
1529
|
+
this.value = errorNoStack.value;
|
|
1530
|
+
this.path = errorNoStack.path;
|
|
1531
|
+
this.errors = errorNoStack.errors;
|
|
1532
|
+
this.inner = errorNoStack.inner;
|
|
1533
|
+
if (Error.captureStackTrace) {
|
|
1534
|
+
Error.captureStackTrace(this, ValidationError);
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
static [_Symbol$hasInstance](inst) {
|
|
1538
|
+
return ValidationErrorNoStack[Symbol.hasInstance](inst) || super[Symbol.hasInstance](inst);
|
|
2135
1539
|
}
|
|
2136
1540
|
}
|
|
2137
1541
|
let mixed = {
|
|
@@ -2159,6 +1563,9 @@ let string = {
|
|
|
2159
1563
|
email: "${path} must be a valid email",
|
|
2160
1564
|
url: "${path} must be a valid URL",
|
|
2161
1565
|
uuid: "${path} must be a valid UUID",
|
|
1566
|
+
datetime: "${path} must be a valid ISO date-time",
|
|
1567
|
+
datetime_precision: "${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",
|
|
1568
|
+
datetime_offset: '${path} must be a valid ISO date-time with UTC "Z" timezone',
|
|
2162
1569
|
trim: "${path} must be a trimmed string",
|
|
2163
1570
|
lowercase: "${path} must be a lowercase string",
|
|
2164
1571
|
uppercase: "${path} must be a upper case string"
|
|
@@ -2180,7 +1587,8 @@ let boolean = {
|
|
|
2180
1587
|
isValue: "${path} field must be ${value}"
|
|
2181
1588
|
};
|
|
2182
1589
|
let object = {
|
|
2183
|
-
noUnknown: "${path} field has unspecified keys: ${unknown}"
|
|
1590
|
+
noUnknown: "${path} field has unspecified keys: ${unknown}",
|
|
1591
|
+
exact: "${path} object contains unknown properties: ${properties}"
|
|
2184
1592
|
};
|
|
2185
1593
|
let array = {
|
|
2186
1594
|
min: "${path} field must have at least ${min} items",
|
|
@@ -2327,20 +1735,21 @@ function createValidation(config) {
|
|
|
2327
1735
|
abortEarly = schema.spec.abortEarly,
|
|
2328
1736
|
disableStackTrace = schema.spec.disableStackTrace
|
|
2329
1737
|
} = options;
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
1738
|
+
const resolveOptions = {
|
|
1739
|
+
value,
|
|
1740
|
+
parent,
|
|
1741
|
+
context
|
|
1742
|
+
};
|
|
2333
1743
|
function createError(overrides = {}) {
|
|
2334
|
-
|
|
2335
|
-
const nextParams = Object.assign({
|
|
1744
|
+
const nextParams = resolveParams(Object.assign({
|
|
2336
1745
|
value,
|
|
2337
1746
|
originalValue,
|
|
2338
1747
|
label: schema.spec.label,
|
|
2339
1748
|
path: overrides.path || path,
|
|
2340
|
-
spec: schema.spec
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
const error = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name,
|
|
1749
|
+
spec: schema.spec,
|
|
1750
|
+
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
1751
|
+
}, params, overrides.params), resolveOptions);
|
|
1752
|
+
const error = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name, nextParams.disableStackTrace);
|
|
2344
1753
|
error.params = nextParams;
|
|
2345
1754
|
return error;
|
|
2346
1755
|
}
|
|
@@ -2351,7 +1760,9 @@ function createValidation(config) {
|
|
|
2351
1760
|
type: name,
|
|
2352
1761
|
from: options.from,
|
|
2353
1762
|
createError,
|
|
2354
|
-
resolve
|
|
1763
|
+
resolve(item) {
|
|
1764
|
+
return resolveMaybeRef(item, resolveOptions);
|
|
1765
|
+
},
|
|
2355
1766
|
options,
|
|
2356
1767
|
originalValue,
|
|
2357
1768
|
schema
|
|
@@ -2388,6 +1799,16 @@ function createValidation(config) {
|
|
|
2388
1799
|
validate.OPTIONS = config;
|
|
2389
1800
|
return validate;
|
|
2390
1801
|
}
|
|
1802
|
+
function resolveParams(params, options) {
|
|
1803
|
+
if (!params) return params;
|
|
1804
|
+
for (const key of Object.keys(params)) {
|
|
1805
|
+
params[key] = resolveMaybeRef(params[key], options);
|
|
1806
|
+
}
|
|
1807
|
+
return params;
|
|
1808
|
+
}
|
|
1809
|
+
function resolveMaybeRef(item, options) {
|
|
1810
|
+
return Reference.isRef(item) ? item.getValue(options.value, options.parent, options.context) : item;
|
|
1811
|
+
}
|
|
2391
1812
|
function getIn(schema, path, value, context = value) {
|
|
2392
1813
|
let parent, lastPart, lastPartDebug;
|
|
2393
1814
|
if (!path) return {
|
|
@@ -2484,6 +1905,69 @@ function clone(src, seen = /* @__PURE__ */ new Map()) {
|
|
|
2484
1905
|
}
|
|
2485
1906
|
return copy;
|
|
2486
1907
|
}
|
|
1908
|
+
function createStandardPath(path) {
|
|
1909
|
+
if (!(path != null && path.length)) {
|
|
1910
|
+
return void 0;
|
|
1911
|
+
}
|
|
1912
|
+
const segments = [];
|
|
1913
|
+
let currentSegment = "";
|
|
1914
|
+
let inBrackets = false;
|
|
1915
|
+
let inQuotes = false;
|
|
1916
|
+
for (let i = 0; i < path.length; i++) {
|
|
1917
|
+
const char = path[i];
|
|
1918
|
+
if (char === "[" && !inQuotes) {
|
|
1919
|
+
if (currentSegment) {
|
|
1920
|
+
segments.push(...currentSegment.split(".").filter(Boolean));
|
|
1921
|
+
currentSegment = "";
|
|
1922
|
+
}
|
|
1923
|
+
inBrackets = true;
|
|
1924
|
+
continue;
|
|
1925
|
+
}
|
|
1926
|
+
if (char === "]" && !inQuotes) {
|
|
1927
|
+
if (currentSegment) {
|
|
1928
|
+
if (/^\d+$/.test(currentSegment)) {
|
|
1929
|
+
segments.push(currentSegment);
|
|
1930
|
+
} else {
|
|
1931
|
+
segments.push(currentSegment.replace(/^"|"$/g, ""));
|
|
1932
|
+
}
|
|
1933
|
+
currentSegment = "";
|
|
1934
|
+
}
|
|
1935
|
+
inBrackets = false;
|
|
1936
|
+
continue;
|
|
1937
|
+
}
|
|
1938
|
+
if (char === '"') {
|
|
1939
|
+
inQuotes = !inQuotes;
|
|
1940
|
+
continue;
|
|
1941
|
+
}
|
|
1942
|
+
if (char === "." && !inBrackets && !inQuotes) {
|
|
1943
|
+
if (currentSegment) {
|
|
1944
|
+
segments.push(currentSegment);
|
|
1945
|
+
currentSegment = "";
|
|
1946
|
+
}
|
|
1947
|
+
continue;
|
|
1948
|
+
}
|
|
1949
|
+
currentSegment += char;
|
|
1950
|
+
}
|
|
1951
|
+
if (currentSegment) {
|
|
1952
|
+
segments.push(...currentSegment.split(".").filter(Boolean));
|
|
1953
|
+
}
|
|
1954
|
+
return segments;
|
|
1955
|
+
}
|
|
1956
|
+
function createStandardIssues(error, parentPath) {
|
|
1957
|
+
const path = parentPath ? `${parentPath}.${error.path}` : error.path;
|
|
1958
|
+
return error.errors.map((err) => ({
|
|
1959
|
+
message: err,
|
|
1960
|
+
path: createStandardPath(path)
|
|
1961
|
+
}));
|
|
1962
|
+
}
|
|
1963
|
+
function issuesFromValidationError(error, parentPath) {
|
|
1964
|
+
var _error$inner;
|
|
1965
|
+
if (!((_error$inner = error.inner) != null && _error$inner.length) && error.errors.length) {
|
|
1966
|
+
return createStandardIssues(error, parentPath);
|
|
1967
|
+
}
|
|
1968
|
+
const path = parentPath ? `${parentPath}.${error.path}` : error.path;
|
|
1969
|
+
return error.inner.flatMap((err) => issuesFromValidationError(err, path));
|
|
1970
|
+
}
|
|
2487
1971
|
class Schema {
|
|
2488
1972
|
constructor(options) {
|
|
2489
1973
|
this.type = void 0;
|
|
@@ -2613,9 +2097,11 @@ class Schema {
|
|
|
2613
2097
|
* Run the configured transform pipeline over an input value.
|
|
2614
2098
|
*/
|
|
2615
2099
|
cast(value, options = {}) {
|
|
2616
|
-
let resolvedSchema = this.resolve(Object.assign({
|
|
2100
|
+
let resolvedSchema = this.resolve(Object.assign({}, options, {
|
|
2617
2101
|
value
|
|
2618
|
-
|
|
2102
|
+
// parent: options.parent,
|
|
2103
|
+
// context: options.context,
|
|
2104
|
+
}));
|
|
2619
2105
|
let allowOptionality = options.assert === "ignore-optionality";
|
|
2620
2106
|
let result = resolvedSchema._cast(value, options);
|
|
2621
2107
|
if (options.assert !== false && !resolvedSchema.isType(result)) {
|
|
@@ -2632,7 +2118,7 @@ attempted value: ${formattedValue}
|
|
|
2632
2118
|
return result;
|
|
2633
2119
|
}
|
|
2634
2120
|
_cast(rawValue, options) {
|
|
2635
|
-
let value = rawValue === void 0 ? rawValue : this.transforms.reduce((prevValue, fn) => fn.call(this, prevValue, rawValue, this), rawValue);
|
|
2121
|
+
let value = rawValue === void 0 ? rawValue : this.transforms.reduce((prevValue, fn) => fn.call(this, prevValue, rawValue, this, options), rawValue);
|
|
2636
2122
|
if (value === void 0) {
|
|
2637
2123
|
value = this.getDefault(options);
|
|
2638
2124
|
}
|
|
@@ -2745,7 +2231,7 @@ attempted value: ${formattedValue}
|
|
|
2745
2231
|
key: void 0,
|
|
2746
2232
|
// index: undefined,
|
|
2747
2233
|
[isIndex ? "index" : "key"]: k,
|
|
2748
|
-
path: isIndex || k.includes(".") ? `${parentPath || ""}[${
|
|
2234
|
+
path: isIndex || k.includes(".") ? `${parentPath || ""}[${isIndex ? k : `"${k}"`}]` : (parentPath ? `${parentPath}.` : "") + key
|
|
2749
2235
|
});
|
|
2750
2236
|
return (_, panic, next) => this.resolve(testOptions)._validate(value, testOptions, panic, next);
|
|
2751
2237
|
}
|
|
@@ -3027,13 +2513,41 @@ attempted value: ${formattedValue}
|
|
|
3027
2513
|
type: next.type,
|
|
3028
2514
|
oneOf: next._whitelist.describe(),
|
|
3029
2515
|
notOneOf: next._blacklist.describe(),
|
|
3030
|
-
tests: next.tests.map((fn) =>
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
2516
|
+
tests: next.tests.filter((n, idx, list) => list.findIndex((c) => c.OPTIONS.name === n.OPTIONS.name) === idx).map((fn) => {
|
|
2517
|
+
const params = fn.OPTIONS.params && options ? resolveParams(Object.assign({}, fn.OPTIONS.params), options) : fn.OPTIONS.params;
|
|
2518
|
+
return {
|
|
2519
|
+
name: fn.OPTIONS.name,
|
|
2520
|
+
params
|
|
2521
|
+
};
|
|
2522
|
+
})
|
|
3034
2523
|
};
|
|
3035
2524
|
return description;
|
|
3036
2525
|
}
|
|
2526
|
+
get ["~standard"]() {
|
|
2527
|
+
const schema = this;
|
|
2528
|
+
const standard = {
|
|
2529
|
+
version: 1,
|
|
2530
|
+
vendor: "yup",
|
|
2531
|
+
async validate(value) {
|
|
2532
|
+
try {
|
|
2533
|
+
const result = await schema.validate(value, {
|
|
2534
|
+
abortEarly: false
|
|
2535
|
+
});
|
|
2536
|
+
return {
|
|
2537
|
+
value: result
|
|
2538
|
+
};
|
|
2539
|
+
} catch (err) {
|
|
2540
|
+
if (err instanceof ValidationError) {
|
|
2541
|
+
return {
|
|
2542
|
+
issues: issuesFromValidationError(err)
|
|
2543
|
+
};
|
|
2544
|
+
}
|
|
2545
|
+
throw err;
|
|
2546
|
+
}
|
|
2547
|
+
}
|
|
2548
|
+
};
|
|
2549
|
+
return standard;
|
|
2550
|
+
}
|
|
3037
2551
|
}
|
|
3038
2552
|
Schema.prototype.__isYupSchema__ = true;
|
|
3039
2553
|
for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At`] = function(path, value, options = {}) {
|
|
@@ -3062,8 +2576,8 @@ class BooleanSchema extends Schema {
|
|
|
3062
2576
|
}
|
|
3063
2577
|
});
|
|
3064
2578
|
this.withMutation(() => {
|
|
3065
|
-
this.transform((value, _raw
|
|
3066
|
-
if (
|
|
2579
|
+
this.transform((value, _raw) => {
|
|
2580
|
+
if (this.spec.coerce && !this.isType(value)) {
|
|
3067
2581
|
if (/^(true|1)$/i.test(String(value))) return true;
|
|
3068
2582
|
if (/^(false|0)$/i.test(String(value))) return false;
|
|
3069
2583
|
}
|
|
@@ -3123,6 +2637,45 @@ class BooleanSchema extends Schema {
|
|
|
3123
2637
|
}
|
|
3124
2638
|
}
|
|
3125
2639
|
create$7.prototype = BooleanSchema.prototype;
|
|
2640
|
+
const isoReg = /^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;
|
|
2641
|
+
function parseIsoDate(date2) {
|
|
2642
|
+
const struct = parseDateStruct(date2);
|
|
2643
|
+
if (!struct) return Date.parse ? Date.parse(date2) : Number.NaN;
|
|
2644
|
+
if (struct.z === void 0 && struct.plusMinus === void 0) {
|
|
2645
|
+
return new Date(struct.year, struct.month, struct.day, struct.hour, struct.minute, struct.second, struct.millisecond).valueOf();
|
|
2646
|
+
}
|
|
2647
|
+
let totalMinutesOffset = 0;
|
|
2648
|
+
if (struct.z !== "Z" && struct.plusMinus !== void 0) {
|
|
2649
|
+
totalMinutesOffset = struct.hourOffset * 60 + struct.minuteOffset;
|
|
2650
|
+
if (struct.plusMinus === "+") totalMinutesOffset = 0 - totalMinutesOffset;
|
|
2651
|
+
}
|
|
2652
|
+
return Date.UTC(struct.year, struct.month, struct.day, struct.hour, struct.minute + totalMinutesOffset, struct.second, struct.millisecond);
|
|
2653
|
+
}
|
|
2654
|
+
function parseDateStruct(date2) {
|
|
2655
|
+
var _regexResult$7$length, _regexResult$;
|
|
2656
|
+
const regexResult = isoReg.exec(date2);
|
|
2657
|
+
if (!regexResult) return null;
|
|
2658
|
+
return {
|
|
2659
|
+
year: toNumber(regexResult[1]),
|
|
2660
|
+
month: toNumber(regexResult[2], 1) - 1,
|
|
2661
|
+
day: toNumber(regexResult[3], 1),
|
|
2662
|
+
hour: toNumber(regexResult[4]),
|
|
2663
|
+
minute: toNumber(regexResult[5]),
|
|
2664
|
+
second: toNumber(regexResult[6]),
|
|
2665
|
+
millisecond: regexResult[7] ? (
|
|
2666
|
+
// allow arbitrary sub-second precision beyond milliseconds
|
|
2667
|
+
toNumber(regexResult[7].substring(0, 3))
|
|
2668
|
+
) : 0,
|
|
2669
|
+
precision: (_regexResult$7$length = (_regexResult$ = regexResult[7]) == null ? void 0 : _regexResult$.length) != null ? _regexResult$7$length : void 0,
|
|
2670
|
+
z: regexResult[8] || void 0,
|
|
2671
|
+
plusMinus: regexResult[9] || void 0,
|
|
2672
|
+
hourOffset: toNumber(regexResult[10]),
|
|
2673
|
+
minuteOffset: toNumber(regexResult[11])
|
|
2674
|
+
};
|
|
2675
|
+
}
|
|
2676
|
+
function toNumber(str, defaultValue = 0) {
|
|
2677
|
+
return Number(str) || defaultValue;
|
|
2678
|
+
}
|
|
3126
2679
|
let rEmail = (
|
|
3127
2680
|
// eslint-disable-next-line
|
|
3128
2681
|
/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
|
|
@@ -3132,6 +2685,10 @@ let rUrl = (
|
|
|
3132
2685
|
/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i
|
|
3133
2686
|
);
|
|
3134
2687
|
let rUUID = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
2688
|
+
let yearMonthDay = "^\\d{4}-\\d{2}-\\d{2}";
|
|
2689
|
+
let hourMinuteSecond = "\\d{2}:\\d{2}:\\d{2}";
|
|
2690
|
+
let zOrOffset = "(([+-]\\d{2}(:?\\d{2})?)|Z)";
|
|
2691
|
+
let rIsoDateTime = new RegExp(`${yearMonthDay}T${hourMinuteSecond}(\\.\\d+)?${zOrOffset}$`);
|
|
3135
2692
|
let isTrimmed = (value) => isAbsent(value) || value === value.trim();
|
|
3136
2693
|
let objStringTag = {}.toString();
|
|
3137
2694
|
function create$6() {
|
|
@@ -3147,8 +2704,8 @@ class StringSchema extends Schema {
|
|
|
3147
2704
|
}
|
|
3148
2705
|
});
|
|
3149
2706
|
this.withMutation(() => {
|
|
3150
|
-
this.transform((value, _raw
|
|
3151
|
-
if (!
|
|
2707
|
+
this.transform((value, _raw) => {
|
|
2708
|
+
if (!this.spec.coerce || this.isType(value)) return value;
|
|
3152
2709
|
if (Array.isArray(value)) return value;
|
|
3153
2710
|
const strValue = value != null && value.toString ? value.toString() : value;
|
|
3154
2711
|
if (strValue === objStringTag) return value;
|
|
@@ -3258,6 +2815,53 @@ class StringSchema extends Schema {
|
|
|
3258
2815
|
excludeEmptyString: false
|
|
3259
2816
|
});
|
|
3260
2817
|
}
|
|
2818
|
+
datetime(options) {
|
|
2819
|
+
let message = "";
|
|
2820
|
+
let allowOffset;
|
|
2821
|
+
let precision;
|
|
2822
|
+
if (options) {
|
|
2823
|
+
if (typeof options === "object") {
|
|
2824
|
+
({
|
|
2825
|
+
message = "",
|
|
2826
|
+
allowOffset = false,
|
|
2827
|
+
precision = void 0
|
|
2828
|
+
} = options);
|
|
2829
|
+
} else {
|
|
2830
|
+
message = options;
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
return this.matches(rIsoDateTime, {
|
|
2834
|
+
name: "datetime",
|
|
2835
|
+
message: message || string.datetime,
|
|
2836
|
+
excludeEmptyString: true
|
|
2837
|
+
}).test({
|
|
2838
|
+
name: "datetime_offset",
|
|
2839
|
+
message: message || string.datetime_offset,
|
|
2840
|
+
params: {
|
|
2841
|
+
allowOffset
|
|
2842
|
+
},
|
|
2843
|
+
skipAbsent: true,
|
|
2844
|
+
test: (value) => {
|
|
2845
|
+
if (!value || allowOffset) return true;
|
|
2846
|
+
const struct = parseDateStruct(value);
|
|
2847
|
+
if (!struct) return false;
|
|
2848
|
+
return !!struct.z;
|
|
2849
|
+
}
|
|
2850
|
+
}).test({
|
|
2851
|
+
name: "datetime_precision",
|
|
2852
|
+
message: message || string.datetime_precision,
|
|
2853
|
+
params: {
|
|
2854
|
+
precision
|
|
2855
|
+
},
|
|
2856
|
+
skipAbsent: true,
|
|
2857
|
+
test: (value) => {
|
|
2858
|
+
if (!value || precision == void 0) return true;
|
|
2859
|
+
const struct = parseDateStruct(value);
|
|
2860
|
+
if (!struct) return false;
|
|
2861
|
+
return struct.precision === precision;
|
|
2862
|
+
}
|
|
2863
|
+
});
|
|
2864
|
+
}
|
|
3261
2865
|
//-- transforms --
|
|
3262
2866
|
ensure() {
|
|
3263
2867
|
return this.default("").transform((val) => val === null ? "" : val);
|
|
@@ -3289,39 +2893,6 @@ class StringSchema extends Schema {
|
|
|
3289
2893
|
}
|
|
3290
2894
|
}
|
|
3291
2895
|
create$6.prototype = StringSchema.prototype;
|
|
3292
|
-
const isoReg = /^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;
|
|
3293
|
-
function toNumber(str, defaultValue = 0) {
|
|
3294
|
-
return Number(str) || defaultValue;
|
|
3295
|
-
}
|
|
3296
|
-
function parseIsoDate(date2) {
|
|
3297
|
-
const regexResult = isoReg.exec(date2);
|
|
3298
|
-
if (!regexResult) return Date.parse ? Date.parse(date2) : Number.NaN;
|
|
3299
|
-
const struct = {
|
|
3300
|
-
year: toNumber(regexResult[1]),
|
|
3301
|
-
month: toNumber(regexResult[2], 1) - 1,
|
|
3302
|
-
day: toNumber(regexResult[3], 1),
|
|
3303
|
-
hour: toNumber(regexResult[4]),
|
|
3304
|
-
minute: toNumber(regexResult[5]),
|
|
3305
|
-
second: toNumber(regexResult[6]),
|
|
3306
|
-
millisecond: regexResult[7] ? (
|
|
3307
|
-
// allow arbitrary sub-second precision beyond milliseconds
|
|
3308
|
-
toNumber(regexResult[7].substring(0, 3))
|
|
3309
|
-
) : 0,
|
|
3310
|
-
z: regexResult[8] || void 0,
|
|
3311
|
-
plusMinus: regexResult[9] || void 0,
|
|
3312
|
-
hourOffset: toNumber(regexResult[10]),
|
|
3313
|
-
minuteOffset: toNumber(regexResult[11])
|
|
3314
|
-
};
|
|
3315
|
-
if (struct.z === void 0 && struct.plusMinus === void 0) {
|
|
3316
|
-
return new Date(struct.year, struct.month, struct.day, struct.hour, struct.minute, struct.second, struct.millisecond).valueOf();
|
|
3317
|
-
}
|
|
3318
|
-
let totalMinutesOffset = 0;
|
|
3319
|
-
if (struct.z !== "Z" && struct.plusMinus !== void 0) {
|
|
3320
|
-
totalMinutesOffset = struct.hourOffset * 60 + struct.minuteOffset;
|
|
3321
|
-
if (struct.plusMinus === "+") totalMinutesOffset = 0 - totalMinutesOffset;
|
|
3322
|
-
}
|
|
3323
|
-
return Date.UTC(struct.year, struct.month, struct.day, struct.hour, struct.minute + totalMinutesOffset, struct.second, struct.millisecond);
|
|
3324
|
-
}
|
|
3325
2896
|
let invalidDate = /* @__PURE__ */ new Date("");
|
|
3326
2897
|
let isDate = (obj) => Object.prototype.toString.call(obj) === "[object Date]";
|
|
3327
2898
|
class DateSchema extends Schema {
|
|
@@ -3333,8 +2904,8 @@ class DateSchema extends Schema {
|
|
|
3333
2904
|
}
|
|
3334
2905
|
});
|
|
3335
2906
|
this.withMutation(() => {
|
|
3336
|
-
this.transform((value, _raw
|
|
3337
|
-
if (!
|
|
2907
|
+
this.transform((value, _raw) => {
|
|
2908
|
+
if (!this.spec.coerce || this.isType(value) || value === null) return value;
|
|
3338
2909
|
value = parseIsoDate(value);
|
|
3339
2910
|
return !isNaN(value) ? new Date(value) : DateSchema.INVALID_DATE;
|
|
3340
2911
|
});
|
|
@@ -3416,7 +2987,7 @@ function sortByKeyOrder(keys) {
|
|
|
3416
2987
|
return findIndex(keys, a) - findIndex(keys, b);
|
|
3417
2988
|
};
|
|
3418
2989
|
}
|
|
3419
|
-
const parseJson = (value, _,
|
|
2990
|
+
const parseJson = (value, _, schema) => {
|
|
3420
2991
|
if (typeof value !== "string") {
|
|
3421
2992
|
return value;
|
|
3422
2993
|
}
|
|
@@ -3425,7 +2996,7 @@ const parseJson = (value, _, ctx) => {
|
|
|
3425
2996
|
parsed = JSON.parse(value);
|
|
3426
2997
|
} catch (err) {
|
|
3427
2998
|
}
|
|
3428
|
-
return
|
|
2999
|
+
return schema.isType(parsed) ? parsed : value;
|
|
3429
3000
|
};
|
|
3430
3001
|
function deepPartial(schema) {
|
|
3431
3002
|
if ("fields" in schema) {
|
|
@@ -3501,9 +3072,9 @@ class ObjectSchema extends Schema {
|
|
|
3501
3072
|
for (const prop of props) {
|
|
3502
3073
|
let field = fields[prop];
|
|
3503
3074
|
let exists = prop in value;
|
|
3075
|
+
let inputValue = value[prop];
|
|
3504
3076
|
if (field) {
|
|
3505
3077
|
let fieldValue;
|
|
3506
|
-
let inputValue = value[prop];
|
|
3507
3078
|
innerOptions.path = (options.path ? `${options.path}.` : "") + prop;
|
|
3508
3079
|
field = field.resolve({
|
|
3509
3080
|
value: inputValue,
|
|
@@ -3516,17 +3087,14 @@ class ObjectSchema extends Schema {
|
|
|
3516
3087
|
isChanged = isChanged || prop in value;
|
|
3517
3088
|
continue;
|
|
3518
3089
|
}
|
|
3519
|
-
fieldValue = !options.__validating || !strict ? (
|
|
3520
|
-
// TODO: use _cast, this is double resolving
|
|
3521
|
-
field.cast(value[prop], innerOptions)
|
|
3522
|
-
) : value[prop];
|
|
3090
|
+
fieldValue = !options.__validating || !strict ? field.cast(inputValue, innerOptions) : inputValue;
|
|
3523
3091
|
if (fieldValue !== void 0) {
|
|
3524
3092
|
intermediateValue[prop] = fieldValue;
|
|
3525
3093
|
}
|
|
3526
3094
|
} else if (exists && !strip) {
|
|
3527
|
-
intermediateValue[prop] =
|
|
3095
|
+
intermediateValue[prop] = inputValue;
|
|
3528
3096
|
}
|
|
3529
|
-
if (exists !== prop in intermediateValue || intermediateValue[prop] !==
|
|
3097
|
+
if (exists !== prop in intermediateValue || intermediateValue[prop] !== inputValue) {
|
|
3530
3098
|
isChanged = true;
|
|
3531
3099
|
}
|
|
3532
3100
|
}
|
|
@@ -3677,6 +3245,30 @@ class ObjectSchema extends Schema {
|
|
|
3677
3245
|
json() {
|
|
3678
3246
|
return this.transform(parseJson);
|
|
3679
3247
|
}
|
|
3248
|
+
/**
|
|
3249
|
+
* Similar to `noUnknown` but only validates that an object is the right shape without stripping the unknown keys
|
|
3250
|
+
*/
|
|
3251
|
+
exact(message) {
|
|
3252
|
+
return this.test({
|
|
3253
|
+
name: "exact",
|
|
3254
|
+
exclusive: true,
|
|
3255
|
+
message: message || object.exact,
|
|
3256
|
+
test(value) {
|
|
3257
|
+
if (value == null) return true;
|
|
3258
|
+
const unknownKeys = unknown(this.schema, value);
|
|
3259
|
+
return unknownKeys.length === 0 || this.createError({
|
|
3260
|
+
params: {
|
|
3261
|
+
properties: unknownKeys.join(", ")
|
|
3262
|
+
}
|
|
3263
|
+
});
|
|
3264
|
+
}
|
|
3265
|
+
});
|
|
3266
|
+
}
|
|
3267
|
+
stripUnknown() {
|
|
3268
|
+
return this.clone({
|
|
3269
|
+
noUnknown: true
|
|
3270
|
+
});
|
|
3271
|
+
}
|
|
3680
3272
|
noUnknown(noAllow = true, message = object.noUnknown) {
|
|
3681
3273
|
if (typeof noAllow !== "boolean") {
|
|
3682
3274
|
message = noAllow;
|
|
@@ -3763,7 +3355,11 @@ class ArraySchema extends Schema {
|
|
|
3763
3355
|
let isChanged = false;
|
|
3764
3356
|
const castArray = value.map((v, idx) => {
|
|
3765
3357
|
const castElement = this.innerType.cast(v, Object.assign({}, _opts, {
|
|
3766
|
-
path: `${_opts.path || ""}[${idx}]
|
|
3358
|
+
path: `${_opts.path || ""}[${idx}]`,
|
|
3359
|
+
parent: value,
|
|
3360
|
+
originalValue: v,
|
|
3361
|
+
value: v,
|
|
3362
|
+
index: idx
|
|
3767
3363
|
}));
|
|
3768
3364
|
if (castElement !== v) {
|
|
3769
3365
|
isChanged = true;
|
|
@@ -4182,6 +3778,7 @@ ${error.join("\n")}`);
|
|
|
4182
3778
|
});
|
|
4183
3779
|
enableNavigation(config);
|
|
4184
3780
|
enableSse(config, "activity");
|
|
3781
|
+
enableSse(config, "roma-alarm");
|
|
4185
3782
|
config.onConfigured(() => {
|
|
4186
3783
|
console.info("Fusion config done");
|
|
4187
3784
|
});
|
|
@@ -4241,16 +3838,13 @@ const HttpErrorViewer = ({ error }) => {
|
|
|
4241
3838
|
};
|
|
4242
3839
|
const useCustomClient = () => {
|
|
4243
3840
|
const client = useHttpClient("portal");
|
|
4244
|
-
return async ({
|
|
4245
|
-
url,
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
data,
|
|
4250
|
-
signal
|
|
4251
|
-
}) => {
|
|
3841
|
+
return async (uriOrOptions, options) => {
|
|
3842
|
+
const { url, method, params, headers, signal, body } = {
|
|
3843
|
+
url: uriOrOptions,
|
|
3844
|
+
...options
|
|
3845
|
+
};
|
|
4252
3846
|
const response = await client.fetch(
|
|
4253
|
-
`${url}` + new URLSearchParams(params),
|
|
3847
|
+
`${url ?? uriOrOptions}` + new URLSearchParams(params),
|
|
4254
3848
|
{
|
|
4255
3849
|
method,
|
|
4256
3850
|
// Request method
|
|
@@ -4258,8 +3852,7 @@ const useCustomClient = () => {
|
|
|
4258
3852
|
// Abort signal
|
|
4259
3853
|
headers,
|
|
4260
3854
|
// Additional headers
|
|
4261
|
-
|
|
4262
|
-
// Add body if data is provided
|
|
3855
|
+
body
|
|
4263
3856
|
}
|
|
4264
3857
|
);
|
|
4265
3858
|
let value;
|
|
@@ -4292,13 +3885,15 @@ let HttpError$1 = class HttpError extends Error {
|
|
|
4292
3885
|
this.response = response;
|
|
4293
3886
|
}
|
|
4294
3887
|
};
|
|
3888
|
+
const getGetSettingByUserAndIdUrl = (userId, id) => {
|
|
3889
|
+
return `/api/settings/user/${userId}/id/${id}`;
|
|
3890
|
+
};
|
|
4295
3891
|
const useGetSettingByUserAndIdHook = () => {
|
|
4296
|
-
const
|
|
4297
|
-
return (userId, id,
|
|
4298
|
-
return
|
|
4299
|
-
|
|
4300
|
-
method: "
|
|
4301
|
-
signal
|
|
3892
|
+
const customFetcher = useCustomClient();
|
|
3893
|
+
return (userId, id, options) => {
|
|
3894
|
+
return customFetcher(getGetSettingByUserAndIdUrl(userId, id), {
|
|
3895
|
+
...options,
|
|
3896
|
+
method: "GET"
|
|
4302
3897
|
});
|
|
4303
3898
|
};
|
|
4304
3899
|
};
|
|
@@ -4306,10 +3901,10 @@ const getGetSettingByUserAndIdQueryKey = (userId, id) => {
|
|
|
4306
3901
|
return [`/api/settings/user/${userId}/id/${id}`];
|
|
4307
3902
|
};
|
|
4308
3903
|
const useGetSettingByUserAndIdQueryOptions = (userId, id, options) => {
|
|
4309
|
-
const { query: queryOptions } = options ?? {};
|
|
3904
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4310
3905
|
const queryKey = queryOptions?.queryKey ?? getGetSettingByUserAndIdQueryKey(userId, id);
|
|
4311
3906
|
const getSettingByUserAndId = useGetSettingByUserAndIdHook();
|
|
4312
|
-
const queryFn = ({ signal }) => getSettingByUserAndId(userId, id, signal);
|
|
3907
|
+
const queryFn = ({ signal }) => getSettingByUserAndId(userId, id, { signal, ...requestOptions });
|
|
4313
3908
|
return {
|
|
4314
3909
|
queryKey,
|
|
4315
3910
|
queryFn,
|
|
@@ -4317,69 +3912,82 @@ const useGetSettingByUserAndIdQueryOptions = (userId, id, options) => {
|
|
|
4317
3912
|
...queryOptions
|
|
4318
3913
|
};
|
|
4319
3914
|
};
|
|
4320
|
-
|
|
3915
|
+
function useGetSettingByUserAndId(userId, id, options, queryClient) {
|
|
4321
3916
|
const queryOptions = useGetSettingByUserAndIdQueryOptions(
|
|
4322
3917
|
userId,
|
|
4323
3918
|
id,
|
|
4324
3919
|
options
|
|
4325
3920
|
);
|
|
4326
|
-
const query = useQuery(queryOptions);
|
|
4327
|
-
query
|
|
4328
|
-
|
|
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}`;
|
|
4329
3926
|
};
|
|
4330
3927
|
const useUpdateByUserIdAndIdHook = () => {
|
|
4331
|
-
const
|
|
4332
|
-
return (userId, id, settingDto) => {
|
|
4333
|
-
return
|
|
4334
|
-
|
|
4335
|
-
method: "
|
|
4336
|
-
headers: { "Content-Type": "application/json" },
|
|
4337
|
-
|
|
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)
|
|
4338
3935
|
});
|
|
4339
3936
|
};
|
|
4340
3937
|
};
|
|
4341
3938
|
const useUpdateByUserIdAndIdMutationOptions = (options) => {
|
|
4342
|
-
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 };
|
|
4343
3941
|
const updateByUserIdAndId = useUpdateByUserIdAndIdHook();
|
|
4344
3942
|
const mutationFn = (props) => {
|
|
4345
3943
|
const { userId, id, data } = props ?? {};
|
|
4346
|
-
return updateByUserIdAndId(userId, id, data);
|
|
3944
|
+
return updateByUserIdAndId(userId, id, data, requestOptions);
|
|
4347
3945
|
};
|
|
4348
3946
|
return { mutationFn, ...mutationOptions };
|
|
4349
3947
|
};
|
|
4350
|
-
const useUpdateByUserIdAndId = (options) => {
|
|
4351
|
-
|
|
4352
|
-
|
|
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}`;
|
|
4353
3956
|
};
|
|
4354
3957
|
const useDeletePrivateSettingByIdHook = () => {
|
|
4355
|
-
const
|
|
4356
|
-
return (userId, id) => {
|
|
4357
|
-
return
|
|
4358
|
-
|
|
4359
|
-
method: "
|
|
3958
|
+
const customFetcher = useCustomClient();
|
|
3959
|
+
return (userId, id, options) => {
|
|
3960
|
+
return customFetcher(getDeletePrivateSettingByIdUrl(userId, id), {
|
|
3961
|
+
...options,
|
|
3962
|
+
method: "DELETE"
|
|
4360
3963
|
});
|
|
4361
3964
|
};
|
|
4362
3965
|
};
|
|
4363
3966
|
const useDeletePrivateSettingByIdMutationOptions = (options) => {
|
|
4364
|
-
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 };
|
|
4365
3969
|
const deletePrivateSettingById = useDeletePrivateSettingByIdHook();
|
|
4366
3970
|
const mutationFn = (props) => {
|
|
4367
3971
|
const { userId, id } = props ?? {};
|
|
4368
|
-
return deletePrivateSettingById(userId, id);
|
|
3972
|
+
return deletePrivateSettingById(userId, id, requestOptions);
|
|
4369
3973
|
};
|
|
4370
3974
|
return { mutationFn, ...mutationOptions };
|
|
4371
3975
|
};
|
|
4372
|
-
const useDeletePrivateSettingById = (options) => {
|
|
4373
|
-
|
|
4374
|
-
|
|
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}`;
|
|
4375
3984
|
};
|
|
4376
3985
|
const useGetPublicSettingByUserAndIdHook = () => {
|
|
4377
|
-
const
|
|
4378
|
-
return (appShortName, id,
|
|
4379
|
-
return
|
|
4380
|
-
|
|
4381
|
-
method: "
|
|
4382
|
-
signal
|
|
3986
|
+
const customFetcher = useCustomClient();
|
|
3987
|
+
return (appShortName, id, options) => {
|
|
3988
|
+
return customFetcher(getGetPublicSettingByUserAndIdUrl(appShortName, id), {
|
|
3989
|
+
...options,
|
|
3990
|
+
method: "GET"
|
|
4383
3991
|
});
|
|
4384
3992
|
};
|
|
4385
3993
|
};
|
|
@@ -4387,10 +3995,13 @@ const getGetPublicSettingByUserAndIdQueryKey = (appShortName, id) => {
|
|
|
4387
3995
|
return [`/api/settings/application/${appShortName}/id/${id}`];
|
|
4388
3996
|
};
|
|
4389
3997
|
const useGetPublicSettingByUserAndIdQueryOptions = (appShortName, id, options) => {
|
|
4390
|
-
const { query: queryOptions } = options ?? {};
|
|
3998
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4391
3999
|
const queryKey = queryOptions?.queryKey ?? getGetPublicSettingByUserAndIdQueryKey(appShortName, id);
|
|
4392
4000
|
const getPublicSettingByUserAndId = useGetPublicSettingByUserAndIdHook();
|
|
4393
|
-
const queryFn = ({ signal }) => getPublicSettingByUserAndId(appShortName, id,
|
|
4001
|
+
const queryFn = ({ signal }) => getPublicSettingByUserAndId(appShortName, id, {
|
|
4002
|
+
signal,
|
|
4003
|
+
...requestOptions
|
|
4004
|
+
});
|
|
4394
4005
|
return {
|
|
4395
4006
|
queryKey,
|
|
4396
4007
|
queryFn,
|
|
@@ -4398,69 +4009,90 @@ const useGetPublicSettingByUserAndIdQueryOptions = (appShortName, id, options) =
|
|
|
4398
4009
|
...queryOptions
|
|
4399
4010
|
};
|
|
4400
4011
|
};
|
|
4401
|
-
|
|
4012
|
+
function useGetPublicSettingByUserAndId(appShortName, id, options, queryClient) {
|
|
4402
4013
|
const queryOptions = useGetPublicSettingByUserAndIdQueryOptions(
|
|
4403
4014
|
appShortName,
|
|
4404
4015
|
id,
|
|
4405
4016
|
options
|
|
4406
4017
|
);
|
|
4407
|
-
const query = useQuery(queryOptions);
|
|
4408
|
-
query
|
|
4409
|
-
|
|
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}`;
|
|
4410
4023
|
};
|
|
4411
4024
|
const useUpdatePublicSettingByAppShortNameAndIdHook = () => {
|
|
4412
|
-
const
|
|
4413
|
-
return (appShortName, id, settingDto) => {
|
|
4414
|
-
return
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
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
|
+
);
|
|
4420
4036
|
};
|
|
4421
4037
|
};
|
|
4422
4038
|
const useUpdatePublicSettingByAppShortNameAndIdMutationOptions = (options) => {
|
|
4423
|
-
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 };
|
|
4424
4041
|
const updatePublicSettingByAppShortNameAndId = useUpdatePublicSettingByAppShortNameAndIdHook();
|
|
4425
4042
|
const mutationFn = (props) => {
|
|
4426
4043
|
const { appShortName, id, data } = props ?? {};
|
|
4427
|
-
return updatePublicSettingByAppShortNameAndId(
|
|
4044
|
+
return updatePublicSettingByAppShortNameAndId(
|
|
4045
|
+
appShortName,
|
|
4046
|
+
id,
|
|
4047
|
+
data,
|
|
4048
|
+
requestOptions
|
|
4049
|
+
);
|
|
4428
4050
|
};
|
|
4429
4051
|
return { mutationFn, ...mutationOptions };
|
|
4430
4052
|
};
|
|
4431
|
-
const useUpdatePublicSettingByAppShortNameAndId = (options) => {
|
|
4432
|
-
|
|
4433
|
-
|
|
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}`;
|
|
4434
4061
|
};
|
|
4435
4062
|
const useDeletePublicSettingByIdHook = () => {
|
|
4436
|
-
const
|
|
4437
|
-
return (appShortName, id) => {
|
|
4438
|
-
return
|
|
4439
|
-
|
|
4440
|
-
method: "
|
|
4063
|
+
const customFetcher = useCustomClient();
|
|
4064
|
+
return (appShortName, id, options) => {
|
|
4065
|
+
return customFetcher(getDeletePublicSettingByIdUrl(appShortName, id), {
|
|
4066
|
+
...options,
|
|
4067
|
+
method: "DELETE"
|
|
4441
4068
|
});
|
|
4442
4069
|
};
|
|
4443
4070
|
};
|
|
4444
4071
|
const useDeletePublicSettingByIdMutationOptions = (options) => {
|
|
4445
|
-
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 };
|
|
4446
4074
|
const deletePublicSettingById = useDeletePublicSettingByIdHook();
|
|
4447
4075
|
const mutationFn = (props) => {
|
|
4448
4076
|
const { appShortName, id } = props ?? {};
|
|
4449
|
-
return deletePublicSettingById(appShortName, id);
|
|
4077
|
+
return deletePublicSettingById(appShortName, id, requestOptions);
|
|
4450
4078
|
};
|
|
4451
4079
|
return { mutationFn, ...mutationOptions };
|
|
4452
4080
|
};
|
|
4453
|
-
const useDeletePublicSettingById = (options) => {
|
|
4454
|
-
|
|
4455
|
-
|
|
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}`;
|
|
4456
4089
|
};
|
|
4457
4090
|
const useGetSettingsByUserIdHook = () => {
|
|
4458
|
-
const
|
|
4459
|
-
return (userId,
|
|
4460
|
-
return
|
|
4461
|
-
|
|
4462
|
-
method: "
|
|
4463
|
-
signal
|
|
4091
|
+
const customFetcher = useCustomClient();
|
|
4092
|
+
return (userId, options) => {
|
|
4093
|
+
return customFetcher(getGetSettingsByUserIdUrl(userId), {
|
|
4094
|
+
...options,
|
|
4095
|
+
method: "GET"
|
|
4464
4096
|
});
|
|
4465
4097
|
};
|
|
4466
4098
|
};
|
|
@@ -4468,10 +4100,10 @@ const getGetSettingsByUserIdQueryKey = (userId) => {
|
|
|
4468
4100
|
return [`/api/settings/user/${userId}`];
|
|
4469
4101
|
};
|
|
4470
4102
|
const useGetSettingsByUserIdQueryOptions = (userId, options) => {
|
|
4471
|
-
const { query: queryOptions } = options ?? {};
|
|
4103
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4472
4104
|
const queryKey = queryOptions?.queryKey ?? getGetSettingsByUserIdQueryKey(userId);
|
|
4473
4105
|
const getSettingsByUserId = useGetSettingsByUserIdHook();
|
|
4474
|
-
const queryFn = ({ signal }) => getSettingsByUserId(userId, signal);
|
|
4106
|
+
const queryFn = ({ signal }) => getSettingsByUserId(userId, { signal, ...requestOptions });
|
|
4475
4107
|
return {
|
|
4476
4108
|
queryKey,
|
|
4477
4109
|
queryFn,
|
|
@@ -4479,43 +4111,50 @@ const useGetSettingsByUserIdQueryOptions = (userId, options) => {
|
|
|
4479
4111
|
...queryOptions
|
|
4480
4112
|
};
|
|
4481
4113
|
};
|
|
4482
|
-
|
|
4114
|
+
function useGetSettingsByUserId(userId, options, queryClient) {
|
|
4483
4115
|
const queryOptions = useGetSettingsByUserIdQueryOptions(userId, options);
|
|
4484
|
-
const query = useQuery(queryOptions);
|
|
4485
|
-
query
|
|
4486
|
-
|
|
4116
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4117
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4118
|
+
}
|
|
4119
|
+
const getCreateSettingByUserIdUrl = (userId) => {
|
|
4120
|
+
return `/api/settings/user/${userId}`;
|
|
4487
4121
|
};
|
|
4488
4122
|
const useCreateSettingByUserIdHook = () => {
|
|
4489
|
-
const
|
|
4490
|
-
return (userId, settingDto) => {
|
|
4491
|
-
return
|
|
4492
|
-
|
|
4493
|
-
method: "
|
|
4494
|
-
headers: { "Content-Type": "application/json" },
|
|
4495
|
-
|
|
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)
|
|
4496
4130
|
});
|
|
4497
4131
|
};
|
|
4498
4132
|
};
|
|
4499
4133
|
const useCreateSettingByUserIdMutationOptions = (options) => {
|
|
4500
|
-
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 };
|
|
4501
4136
|
const createSettingByUserId = useCreateSettingByUserIdHook();
|
|
4502
4137
|
const mutationFn = (props) => {
|
|
4503
4138
|
const { userId, data } = props ?? {};
|
|
4504
|
-
return createSettingByUserId(userId, data);
|
|
4139
|
+
return createSettingByUserId(userId, data, requestOptions);
|
|
4505
4140
|
};
|
|
4506
4141
|
return { mutationFn, ...mutationOptions };
|
|
4507
4142
|
};
|
|
4508
|
-
const useCreateSettingByUserId = (options) => {
|
|
4509
|
-
|
|
4510
|
-
|
|
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}`;
|
|
4511
4151
|
};
|
|
4512
4152
|
const useGetSettingsByAppShortNameHook = () => {
|
|
4513
|
-
const
|
|
4514
|
-
return (appShortName,
|
|
4515
|
-
return
|
|
4516
|
-
|
|
4517
|
-
method: "
|
|
4518
|
-
signal
|
|
4153
|
+
const customFetcher = useCustomClient();
|
|
4154
|
+
return (appShortName, options) => {
|
|
4155
|
+
return customFetcher(getGetSettingsByAppShortNameUrl(appShortName), {
|
|
4156
|
+
...options,
|
|
4157
|
+
method: "GET"
|
|
4519
4158
|
});
|
|
4520
4159
|
};
|
|
4521
4160
|
};
|
|
@@ -4523,10 +4162,10 @@ const getGetSettingsByAppShortNameQueryKey = (appShortName) => {
|
|
|
4523
4162
|
return [`/api/settings/application/${appShortName}`];
|
|
4524
4163
|
};
|
|
4525
4164
|
const useGetSettingsByAppShortNameQueryOptions = (appShortName, options) => {
|
|
4526
|
-
const { query: queryOptions } = options ?? {};
|
|
4165
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4527
4166
|
const queryKey = queryOptions?.queryKey ?? getGetSettingsByAppShortNameQueryKey(appShortName);
|
|
4528
4167
|
const getSettingsByAppShortName = useGetSettingsByAppShortNameHook();
|
|
4529
|
-
const queryFn = ({ signal }) => getSettingsByAppShortName(appShortName, signal);
|
|
4168
|
+
const queryFn = ({ signal }) => getSettingsByAppShortName(appShortName, { signal, ...requestOptions });
|
|
4530
4169
|
return {
|
|
4531
4170
|
queryKey,
|
|
4532
4171
|
queryFn,
|
|
@@ -4534,125 +4173,146 @@ const useGetSettingsByAppShortNameQueryOptions = (appShortName, options) => {
|
|
|
4534
4173
|
...queryOptions
|
|
4535
4174
|
};
|
|
4536
4175
|
};
|
|
4537
|
-
|
|
4176
|
+
function useGetSettingsByAppShortName(appShortName, options, queryClient) {
|
|
4538
4177
|
const queryOptions = useGetSettingsByAppShortNameQueryOptions(
|
|
4539
4178
|
appShortName,
|
|
4540
4179
|
options
|
|
4541
4180
|
);
|
|
4542
|
-
const query = useQuery(queryOptions);
|
|
4543
|
-
query
|
|
4544
|
-
|
|
4181
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4182
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4183
|
+
}
|
|
4184
|
+
const getCreatePublicSettingByUserIdUrl = (appShortName) => {
|
|
4185
|
+
return `/api/settings/application/${appShortName}`;
|
|
4545
4186
|
};
|
|
4546
4187
|
const useCreatePublicSettingByUserIdHook = () => {
|
|
4547
|
-
const
|
|
4548
|
-
return (appShortName, settingDto) => {
|
|
4549
|
-
return
|
|
4550
|
-
|
|
4551
|
-
method: "
|
|
4552
|
-
headers: { "Content-Type": "application/json" },
|
|
4553
|
-
|
|
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)
|
|
4554
4195
|
});
|
|
4555
4196
|
};
|
|
4556
4197
|
};
|
|
4557
4198
|
const useCreatePublicSettingByUserIdMutationOptions = (options) => {
|
|
4558
|
-
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 };
|
|
4559
4201
|
const createPublicSettingByUserId = useCreatePublicSettingByUserIdHook();
|
|
4560
4202
|
const mutationFn = (props) => {
|
|
4561
4203
|
const { appShortName, data } = props ?? {};
|
|
4562
|
-
return createPublicSettingByUserId(appShortName, data);
|
|
4204
|
+
return createPublicSettingByUserId(appShortName, data, requestOptions);
|
|
4563
4205
|
};
|
|
4564
4206
|
return { mutationFn, ...mutationOptions };
|
|
4565
4207
|
};
|
|
4566
|
-
const useCreatePublicSettingByUserId = (options) => {
|
|
4567
|
-
|
|
4568
|
-
|
|
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`;
|
|
4569
4216
|
};
|
|
4570
4217
|
const useUploadBundleHook = () => {
|
|
4571
|
-
const
|
|
4572
|
-
return (key, uploadBundleBody) => {
|
|
4218
|
+
const customFetcher = useCustomClient();
|
|
4219
|
+
return (key, uploadBundleBody, options) => {
|
|
4573
4220
|
const formData = new FormData();
|
|
4574
|
-
formData.append(
|
|
4575
|
-
return
|
|
4576
|
-
|
|
4577
|
-
method: "
|
|
4578
|
-
|
|
4579
|
-
data: formData
|
|
4221
|
+
formData.append(`bundleFile`, uploadBundleBody.bundleFile);
|
|
4222
|
+
return customFetcher(getUploadBundleUrl(key), {
|
|
4223
|
+
...options,
|
|
4224
|
+
method: "PUT",
|
|
4225
|
+
body: formData
|
|
4580
4226
|
});
|
|
4581
4227
|
};
|
|
4582
4228
|
};
|
|
4583
4229
|
const useUploadBundleMutationOptions = (options) => {
|
|
4584
|
-
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 };
|
|
4585
4232
|
const uploadBundle = useUploadBundleHook();
|
|
4586
4233
|
const mutationFn = (props) => {
|
|
4587
4234
|
const { key, data } = props ?? {};
|
|
4588
|
-
return uploadBundle(key, data);
|
|
4235
|
+
return uploadBundle(key, data, requestOptions);
|
|
4589
4236
|
};
|
|
4590
4237
|
return { mutationFn, ...mutationOptions };
|
|
4591
4238
|
};
|
|
4592
|
-
const useUploadBundle = (options) => {
|
|
4593
|
-
|
|
4594
|
-
|
|
4239
|
+
const useUploadBundle = (options, queryClient) => {
|
|
4240
|
+
return useMutation(useUploadBundleMutationOptions(options), queryClient);
|
|
4241
|
+
};
|
|
4242
|
+
const getGetAllAppsUrl = () => {
|
|
4243
|
+
return `/api/apps`;
|
|
4595
4244
|
};
|
|
4596
4245
|
const useGetAllAppsHook = () => {
|
|
4597
|
-
const
|
|
4598
|
-
return (
|
|
4599
|
-
return
|
|
4246
|
+
const customFetcher = useCustomClient();
|
|
4247
|
+
return (options) => {
|
|
4248
|
+
return customFetcher(getGetAllAppsUrl(), {
|
|
4249
|
+
...options,
|
|
4250
|
+
method: "GET"
|
|
4251
|
+
});
|
|
4600
4252
|
};
|
|
4601
4253
|
};
|
|
4602
4254
|
const getGetAllAppsQueryKey = () => {
|
|
4603
4255
|
return [`/api/apps`];
|
|
4604
4256
|
};
|
|
4605
4257
|
const useGetAllAppsQueryOptions = (options) => {
|
|
4606
|
-
const { query: queryOptions } = options ?? {};
|
|
4258
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4607
4259
|
const queryKey = queryOptions?.queryKey ?? getGetAllAppsQueryKey();
|
|
4608
4260
|
const getAllApps = useGetAllAppsHook();
|
|
4609
|
-
const queryFn = ({ signal }) => getAllApps(signal);
|
|
4261
|
+
const queryFn = ({ signal }) => getAllApps({ signal, ...requestOptions });
|
|
4610
4262
|
return { queryKey, queryFn, ...queryOptions };
|
|
4611
4263
|
};
|
|
4612
|
-
|
|
4264
|
+
function useGetAllApps(options, queryClient) {
|
|
4613
4265
|
const queryOptions = useGetAllAppsQueryOptions(options);
|
|
4614
|
-
const query = useQuery(queryOptions);
|
|
4615
|
-
query
|
|
4616
|
-
|
|
4266
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4267
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4268
|
+
}
|
|
4269
|
+
const getCreateOrUpdateAppUrl = () => {
|
|
4270
|
+
return `/api/apps`;
|
|
4617
4271
|
};
|
|
4618
4272
|
const useCreateOrUpdateAppHook = () => {
|
|
4619
|
-
const
|
|
4620
|
-
return (appDto) => {
|
|
4621
|
-
return
|
|
4622
|
-
|
|
4623
|
-
method: "
|
|
4624
|
-
headers: { "Content-Type": "application/json" },
|
|
4625
|
-
|
|
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)
|
|
4626
4280
|
});
|
|
4627
4281
|
};
|
|
4628
4282
|
};
|
|
4629
4283
|
const useCreateOrUpdateAppMutationOptions = (options) => {
|
|
4630
|
-
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 };
|
|
4631
4286
|
const createOrUpdateApp = useCreateOrUpdateAppHook();
|
|
4632
4287
|
const mutationFn = (props) => {
|
|
4633
4288
|
const { data } = props ?? {};
|
|
4634
|
-
return createOrUpdateApp(data);
|
|
4289
|
+
return createOrUpdateApp(data, requestOptions);
|
|
4635
4290
|
};
|
|
4636
4291
|
return { mutationFn, ...mutationOptions };
|
|
4637
4292
|
};
|
|
4638
|
-
const useCreateOrUpdateApp = (options) => {
|
|
4639
|
-
|
|
4640
|
-
|
|
4293
|
+
const useCreateOrUpdateApp = (options, queryClient) => {
|
|
4294
|
+
return useMutation(useCreateOrUpdateAppMutationOptions(options), queryClient);
|
|
4295
|
+
};
|
|
4296
|
+
const getGetAppByKeyUrl = (key) => {
|
|
4297
|
+
return `/api/apps/key/${key}`;
|
|
4641
4298
|
};
|
|
4642
4299
|
const useGetAppByKeyHook = () => {
|
|
4643
|
-
const
|
|
4644
|
-
return (key,
|
|
4645
|
-
return
|
|
4300
|
+
const customFetcher = useCustomClient();
|
|
4301
|
+
return (key, options) => {
|
|
4302
|
+
return customFetcher(getGetAppByKeyUrl(key), {
|
|
4303
|
+
...options,
|
|
4304
|
+
method: "GET"
|
|
4305
|
+
});
|
|
4646
4306
|
};
|
|
4647
4307
|
};
|
|
4648
4308
|
const getGetAppByKeyQueryKey = (key) => {
|
|
4649
4309
|
return [`/api/apps/key/${key}`];
|
|
4650
4310
|
};
|
|
4651
4311
|
const useGetAppByKeyQueryOptions = (key, options) => {
|
|
4652
|
-
const { query: queryOptions } = options ?? {};
|
|
4312
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4653
4313
|
const queryKey = queryOptions?.queryKey ?? getGetAppByKeyQueryKey(key);
|
|
4654
4314
|
const getAppByKey = useGetAppByKeyHook();
|
|
4655
|
-
const queryFn = ({ signal }) => getAppByKey(key, signal);
|
|
4315
|
+
const queryFn = ({ signal }) => getAppByKey(key, { signal, ...requestOptions });
|
|
4656
4316
|
return {
|
|
4657
4317
|
queryKey,
|
|
4658
4318
|
queryFn,
|
|
@@ -4660,84 +4320,102 @@ const useGetAppByKeyQueryOptions = (key, options) => {
|
|
|
4660
4320
|
...queryOptions
|
|
4661
4321
|
};
|
|
4662
4322
|
};
|
|
4663
|
-
|
|
4323
|
+
function useGetAppByKey(key, options, queryClient) {
|
|
4664
4324
|
const queryOptions = useGetAppByKeyQueryOptions(key, options);
|
|
4665
|
-
const query = useQuery(queryOptions);
|
|
4666
|
-
query
|
|
4667
|
-
|
|
4325
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4326
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4327
|
+
}
|
|
4328
|
+
const getDeleteAppByKeyUrl = (key) => {
|
|
4329
|
+
return `/api/apps/key/${key}`;
|
|
4668
4330
|
};
|
|
4669
4331
|
const useDeleteAppByKeyHook = () => {
|
|
4670
|
-
const
|
|
4671
|
-
return (key) => {
|
|
4672
|
-
return
|
|
4332
|
+
const customFetcher = useCustomClient();
|
|
4333
|
+
return (key, options) => {
|
|
4334
|
+
return customFetcher(getDeleteAppByKeyUrl(key), {
|
|
4335
|
+
...options,
|
|
4336
|
+
method: "DELETE"
|
|
4337
|
+
});
|
|
4673
4338
|
};
|
|
4674
4339
|
};
|
|
4675
4340
|
const useDeleteAppByKeyMutationOptions = (options) => {
|
|
4676
|
-
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 };
|
|
4677
4343
|
const deleteAppByKey = useDeleteAppByKeyHook();
|
|
4678
4344
|
const mutationFn = (props) => {
|
|
4679
4345
|
const { key } = props ?? {};
|
|
4680
|
-
return deleteAppByKey(key);
|
|
4346
|
+
return deleteAppByKey(key, requestOptions);
|
|
4681
4347
|
};
|
|
4682
4348
|
return { mutationFn, ...mutationOptions };
|
|
4683
4349
|
};
|
|
4684
|
-
const useDeleteAppByKey = (options) => {
|
|
4685
|
-
|
|
4686
|
-
|
|
4350
|
+
const useDeleteAppByKey = (options, queryClient) => {
|
|
4351
|
+
return useMutation(useDeleteAppByKeyMutationOptions(options), queryClient);
|
|
4352
|
+
};
|
|
4353
|
+
const getGetAllServicesUrl = () => {
|
|
4354
|
+
return `/api/apps/services`;
|
|
4687
4355
|
};
|
|
4688
4356
|
const useGetAllServicesHook = () => {
|
|
4689
|
-
const
|
|
4690
|
-
return (
|
|
4691
|
-
return
|
|
4357
|
+
const customFetcher = useCustomClient();
|
|
4358
|
+
return (options) => {
|
|
4359
|
+
return customFetcher(getGetAllServicesUrl(), {
|
|
4360
|
+
...options,
|
|
4361
|
+
method: "GET"
|
|
4362
|
+
});
|
|
4692
4363
|
};
|
|
4693
4364
|
};
|
|
4694
4365
|
const getGetAllServicesQueryKey = () => {
|
|
4695
4366
|
return [`/api/apps/services`];
|
|
4696
4367
|
};
|
|
4697
4368
|
const useGetAllServicesQueryOptions = (options) => {
|
|
4698
|
-
const { query: queryOptions } = options ?? {};
|
|
4369
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4699
4370
|
const queryKey = queryOptions?.queryKey ?? getGetAllServicesQueryKey();
|
|
4700
4371
|
const getAllServices = useGetAllServicesHook();
|
|
4701
|
-
const queryFn = ({ signal }) => getAllServices(signal);
|
|
4372
|
+
const queryFn = ({ signal }) => getAllServices({ signal, ...requestOptions });
|
|
4702
4373
|
return { queryKey, queryFn, ...queryOptions };
|
|
4703
4374
|
};
|
|
4704
|
-
|
|
4375
|
+
function useGetAllServices(options, queryClient) {
|
|
4705
4376
|
const queryOptions = useGetAllServicesQueryOptions(options);
|
|
4706
|
-
const query = useQuery(queryOptions);
|
|
4707
|
-
query
|
|
4708
|
-
|
|
4377
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4378
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4379
|
+
}
|
|
4380
|
+
const getCreateOrUpdateServiceUrl = () => {
|
|
4381
|
+
return `/api/apps/services`;
|
|
4709
4382
|
};
|
|
4710
4383
|
const useCreateOrUpdateServiceHook = () => {
|
|
4711
|
-
const
|
|
4712
|
-
return (serviceDto) => {
|
|
4713
|
-
return
|
|
4714
|
-
|
|
4715
|
-
method: "
|
|
4716
|
-
headers: { "Content-Type": "application/json" },
|
|
4717
|
-
|
|
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)
|
|
4718
4391
|
});
|
|
4719
4392
|
};
|
|
4720
4393
|
};
|
|
4721
4394
|
const useCreateOrUpdateServiceMutationOptions = (options) => {
|
|
4722
|
-
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 };
|
|
4723
4397
|
const createOrUpdateService = useCreateOrUpdateServiceHook();
|
|
4724
4398
|
const mutationFn = (props) => {
|
|
4725
4399
|
const { data } = props ?? {};
|
|
4726
|
-
return createOrUpdateService(data);
|
|
4400
|
+
return createOrUpdateService(data, requestOptions);
|
|
4727
4401
|
};
|
|
4728
4402
|
return { mutationFn, ...mutationOptions };
|
|
4729
4403
|
};
|
|
4730
|
-
const useCreateOrUpdateService = (options) => {
|
|
4731
|
-
|
|
4732
|
-
|
|
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}`;
|
|
4733
4412
|
};
|
|
4734
4413
|
const useGetServiceByKeyHook = () => {
|
|
4735
|
-
const
|
|
4736
|
-
return (key,
|
|
4737
|
-
return
|
|
4738
|
-
|
|
4739
|
-
method: "
|
|
4740
|
-
signal
|
|
4414
|
+
const customFetcher = useCustomClient();
|
|
4415
|
+
return (key, options) => {
|
|
4416
|
+
return customFetcher(getGetServiceByKeyUrl(key), {
|
|
4417
|
+
...options,
|
|
4418
|
+
method: "GET"
|
|
4741
4419
|
});
|
|
4742
4420
|
};
|
|
4743
4421
|
};
|
|
@@ -4745,10 +4423,10 @@ const getGetServiceByKeyQueryKey = (key) => {
|
|
|
4745
4423
|
return [`/api/apps/services/key/${key}`];
|
|
4746
4424
|
};
|
|
4747
4425
|
const useGetServiceByKeyQueryOptions = (key, options) => {
|
|
4748
|
-
const { query: queryOptions } = options ?? {};
|
|
4426
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4749
4427
|
const queryKey = queryOptions?.queryKey ?? getGetServiceByKeyQueryKey(key);
|
|
4750
4428
|
const getServiceByKey = useGetServiceByKeyHook();
|
|
4751
|
-
const queryFn = ({ signal }) => getServiceByKey(key, signal);
|
|
4429
|
+
const queryFn = ({ signal }) => getServiceByKey(key, { signal, ...requestOptions });
|
|
4752
4430
|
return {
|
|
4753
4431
|
queryKey,
|
|
4754
4432
|
queryFn,
|
|
@@ -4756,41 +4434,48 @@ const useGetServiceByKeyQueryOptions = (key, options) => {
|
|
|
4756
4434
|
...queryOptions
|
|
4757
4435
|
};
|
|
4758
4436
|
};
|
|
4759
|
-
|
|
4437
|
+
function useGetServiceByKey(key, options, queryClient) {
|
|
4760
4438
|
const queryOptions = useGetServiceByKeyQueryOptions(key, options);
|
|
4761
|
-
const query = useQuery(queryOptions);
|
|
4762
|
-
query
|
|
4763
|
-
|
|
4439
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4440
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4441
|
+
}
|
|
4442
|
+
const getDeleteServiceByKeyUrl = (key) => {
|
|
4443
|
+
return `/api/apps/services/key/${key}`;
|
|
4764
4444
|
};
|
|
4765
4445
|
const useDeleteServiceByKeyHook = () => {
|
|
4766
|
-
const
|
|
4767
|
-
return (key) => {
|
|
4768
|
-
return
|
|
4769
|
-
|
|
4770
|
-
method: "
|
|
4446
|
+
const customFetcher = useCustomClient();
|
|
4447
|
+
return (key, options) => {
|
|
4448
|
+
return customFetcher(getDeleteServiceByKeyUrl(key), {
|
|
4449
|
+
...options,
|
|
4450
|
+
method: "DELETE"
|
|
4771
4451
|
});
|
|
4772
4452
|
};
|
|
4773
4453
|
};
|
|
4774
4454
|
const useDeleteServiceByKeyMutationOptions = (options) => {
|
|
4775
|
-
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 };
|
|
4776
4457
|
const deleteServiceByKey = useDeleteServiceByKeyHook();
|
|
4777
4458
|
const mutationFn = (props) => {
|
|
4778
4459
|
const { key } = props ?? {};
|
|
4779
|
-
return deleteServiceByKey(key);
|
|
4460
|
+
return deleteServiceByKey(key, requestOptions);
|
|
4780
4461
|
};
|
|
4781
4462
|
return { mutationFn, ...mutationOptions };
|
|
4782
4463
|
};
|
|
4783
|
-
const useDeleteServiceByKey = (options) => {
|
|
4784
|
-
|
|
4785
|
-
|
|
4464
|
+
const useDeleteServiceByKey = (options, queryClient) => {
|
|
4465
|
+
return useMutation(
|
|
4466
|
+
useDeleteServiceByKeyMutationOptions(options),
|
|
4467
|
+
queryClient
|
|
4468
|
+
);
|
|
4469
|
+
};
|
|
4470
|
+
const getGetAllCategoriesUrl = () => {
|
|
4471
|
+
return `/api/apps/categories`;
|
|
4786
4472
|
};
|
|
4787
4473
|
const useGetAllCategoriesHook = () => {
|
|
4788
|
-
const
|
|
4789
|
-
return (
|
|
4790
|
-
return
|
|
4791
|
-
|
|
4792
|
-
method: "
|
|
4793
|
-
signal
|
|
4474
|
+
const customFetcher = useCustomClient();
|
|
4475
|
+
return (options) => {
|
|
4476
|
+
return customFetcher(getGetAllCategoriesUrl(), {
|
|
4477
|
+
...options,
|
|
4478
|
+
method: "GET"
|
|
4794
4479
|
});
|
|
4795
4480
|
};
|
|
4796
4481
|
};
|
|
@@ -4798,49 +4483,56 @@ const getGetAllCategoriesQueryKey = () => {
|
|
|
4798
4483
|
return [`/api/apps/categories`];
|
|
4799
4484
|
};
|
|
4800
4485
|
const useGetAllCategoriesQueryOptions = (options) => {
|
|
4801
|
-
const { query: queryOptions } = options ?? {};
|
|
4486
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4802
4487
|
const queryKey = queryOptions?.queryKey ?? getGetAllCategoriesQueryKey();
|
|
4803
4488
|
const getAllCategories = useGetAllCategoriesHook();
|
|
4804
|
-
const queryFn = ({ signal }) => getAllCategories(signal);
|
|
4489
|
+
const queryFn = ({ signal }) => getAllCategories({ signal, ...requestOptions });
|
|
4805
4490
|
return { queryKey, queryFn, ...queryOptions };
|
|
4806
4491
|
};
|
|
4807
|
-
|
|
4492
|
+
function useGetAllCategories(options, queryClient) {
|
|
4808
4493
|
const queryOptions = useGetAllCategoriesQueryOptions(options);
|
|
4809
|
-
const query = useQuery(queryOptions);
|
|
4810
|
-
query
|
|
4811
|
-
|
|
4494
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4495
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4496
|
+
}
|
|
4497
|
+
const getCreateOrUpdateCategoryUrl = () => {
|
|
4498
|
+
return `/api/apps/categories`;
|
|
4812
4499
|
};
|
|
4813
4500
|
const useCreateOrUpdateCategoryHook = () => {
|
|
4814
|
-
const
|
|
4815
|
-
return (categoryDto) => {
|
|
4816
|
-
return
|
|
4817
|
-
|
|
4818
|
-
method: "
|
|
4819
|
-
headers: { "Content-Type": "application/json" },
|
|
4820
|
-
|
|
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)
|
|
4821
4508
|
});
|
|
4822
4509
|
};
|
|
4823
4510
|
};
|
|
4824
4511
|
const useCreateOrUpdateCategoryMutationOptions = (options) => {
|
|
4825
|
-
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 };
|
|
4826
4514
|
const createOrUpdateCategory = useCreateOrUpdateCategoryHook();
|
|
4827
4515
|
const mutationFn = (props) => {
|
|
4828
4516
|
const { data } = props ?? {};
|
|
4829
|
-
return createOrUpdateCategory(data);
|
|
4517
|
+
return createOrUpdateCategory(data, requestOptions);
|
|
4830
4518
|
};
|
|
4831
4519
|
return { mutationFn, ...mutationOptions };
|
|
4832
4520
|
};
|
|
4833
|
-
const useCreateOrUpdateCategory = (options) => {
|
|
4834
|
-
|
|
4835
|
-
|
|
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}`;
|
|
4836
4529
|
};
|
|
4837
4530
|
const useGetCategoryByIdHook = () => {
|
|
4838
|
-
const
|
|
4839
|
-
return (id,
|
|
4840
|
-
return
|
|
4841
|
-
|
|
4842
|
-
method: "
|
|
4843
|
-
signal
|
|
4531
|
+
const customFetcher = useCustomClient();
|
|
4532
|
+
return (id, options) => {
|
|
4533
|
+
return customFetcher(getGetCategoryByIdUrl(id), {
|
|
4534
|
+
...options,
|
|
4535
|
+
method: "GET"
|
|
4844
4536
|
});
|
|
4845
4537
|
};
|
|
4846
4538
|
};
|
|
@@ -4848,10 +4540,10 @@ const getGetCategoryByIdQueryKey = (id) => {
|
|
|
4848
4540
|
return [`/api/apps/categories/id/${id}`];
|
|
4849
4541
|
};
|
|
4850
4542
|
const useGetCategoryByIdQueryOptions = (id, options) => {
|
|
4851
|
-
const { query: queryOptions } = options ?? {};
|
|
4543
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4852
4544
|
const queryKey = queryOptions?.queryKey ?? getGetCategoryByIdQueryKey(id);
|
|
4853
4545
|
const getCategoryById = useGetCategoryByIdHook();
|
|
4854
|
-
const queryFn = ({ signal }) => getCategoryById(id, signal);
|
|
4546
|
+
const queryFn = ({ signal }) => getCategoryById(id, { signal, ...requestOptions });
|
|
4855
4547
|
return {
|
|
4856
4548
|
queryKey,
|
|
4857
4549
|
queryFn,
|
|
@@ -4859,41 +4551,48 @@ const useGetCategoryByIdQueryOptions = (id, options) => {
|
|
|
4859
4551
|
...queryOptions
|
|
4860
4552
|
};
|
|
4861
4553
|
};
|
|
4862
|
-
|
|
4554
|
+
function useGetCategoryById(id, options, queryClient) {
|
|
4863
4555
|
const queryOptions = useGetCategoryByIdQueryOptions(id, options);
|
|
4864
|
-
const query = useQuery(queryOptions);
|
|
4865
|
-
query
|
|
4866
|
-
|
|
4556
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4557
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4558
|
+
}
|
|
4559
|
+
const getDeleteCategoryByIdUrl = (id) => {
|
|
4560
|
+
return `/api/apps/categories/id/${id}`;
|
|
4867
4561
|
};
|
|
4868
4562
|
const useDeleteCategoryByIdHook = () => {
|
|
4869
|
-
const
|
|
4870
|
-
return (id) => {
|
|
4871
|
-
return
|
|
4872
|
-
|
|
4873
|
-
method: "
|
|
4563
|
+
const customFetcher = useCustomClient();
|
|
4564
|
+
return (id, options) => {
|
|
4565
|
+
return customFetcher(getDeleteCategoryByIdUrl(id), {
|
|
4566
|
+
...options,
|
|
4567
|
+
method: "DELETE"
|
|
4874
4568
|
});
|
|
4875
4569
|
};
|
|
4876
4570
|
};
|
|
4877
4571
|
const useDeleteCategoryByIdMutationOptions = (options) => {
|
|
4878
|
-
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 };
|
|
4879
4574
|
const deleteCategoryById = useDeleteCategoryByIdHook();
|
|
4880
4575
|
const mutationFn = (props) => {
|
|
4881
4576
|
const { id } = props ?? {};
|
|
4882
|
-
return deleteCategoryById(id);
|
|
4577
|
+
return deleteCategoryById(id, requestOptions);
|
|
4883
4578
|
};
|
|
4884
4579
|
return { mutationFn, ...mutationOptions };
|
|
4885
4580
|
};
|
|
4886
|
-
const useDeleteCategoryById = (options) => {
|
|
4887
|
-
|
|
4888
|
-
|
|
4581
|
+
const useDeleteCategoryById = (options, queryClient) => {
|
|
4582
|
+
return useMutation(
|
|
4583
|
+
useDeleteCategoryByIdMutationOptions(options),
|
|
4584
|
+
queryClient
|
|
4585
|
+
);
|
|
4586
|
+
};
|
|
4587
|
+
const getStreamEventsUrl = () => {
|
|
4588
|
+
return `/eventstream/activitylog`;
|
|
4889
4589
|
};
|
|
4890
4590
|
const useStreamEventsHook = () => {
|
|
4891
|
-
const
|
|
4892
|
-
return (
|
|
4893
|
-
return
|
|
4894
|
-
|
|
4895
|
-
method: "
|
|
4896
|
-
signal
|
|
4591
|
+
const customFetcher = useCustomClient();
|
|
4592
|
+
return (options) => {
|
|
4593
|
+
return customFetcher(getStreamEventsUrl(), {
|
|
4594
|
+
...options,
|
|
4595
|
+
method: "GET"
|
|
4897
4596
|
});
|
|
4898
4597
|
};
|
|
4899
4598
|
};
|
|
@@ -4901,25 +4600,26 @@ const getStreamEventsQueryKey = () => {
|
|
|
4901
4600
|
return [`/eventstream/activitylog`];
|
|
4902
4601
|
};
|
|
4903
4602
|
const useStreamEventsQueryOptions = (options) => {
|
|
4904
|
-
const { query: queryOptions } = options ?? {};
|
|
4603
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4905
4604
|
const queryKey = queryOptions?.queryKey ?? getStreamEventsQueryKey();
|
|
4906
4605
|
const streamEvents = useStreamEventsHook();
|
|
4907
|
-
const queryFn = ({ signal }) => streamEvents(signal);
|
|
4606
|
+
const queryFn = ({ signal }) => streamEvents({ signal, ...requestOptions });
|
|
4908
4607
|
return { queryKey, queryFn, ...queryOptions };
|
|
4909
4608
|
};
|
|
4910
|
-
|
|
4609
|
+
function useStreamEvents(options, queryClient) {
|
|
4911
4610
|
const queryOptions = useStreamEventsQueryOptions(options);
|
|
4912
|
-
const query = useQuery(queryOptions);
|
|
4913
|
-
query
|
|
4914
|
-
|
|
4611
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4612
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4613
|
+
}
|
|
4614
|
+
const getGetCurrentEnvironmentUrl = () => {
|
|
4615
|
+
return `/_discovery/environments/current`;
|
|
4915
4616
|
};
|
|
4916
4617
|
const useGetCurrentEnvironmentHook = () => {
|
|
4917
|
-
const
|
|
4918
|
-
return (
|
|
4919
|
-
return
|
|
4920
|
-
|
|
4921
|
-
method: "
|
|
4922
|
-
signal
|
|
4618
|
+
const customFetcher = useCustomClient();
|
|
4619
|
+
return (options) => {
|
|
4620
|
+
return customFetcher(getGetCurrentEnvironmentUrl(), {
|
|
4621
|
+
...options,
|
|
4622
|
+
method: "GET"
|
|
4923
4623
|
});
|
|
4924
4624
|
};
|
|
4925
4625
|
};
|
|
@@ -4927,28 +4627,49 @@ const getGetCurrentEnvironmentQueryKey = () => {
|
|
|
4927
4627
|
return [`/_discovery/environments/current`];
|
|
4928
4628
|
};
|
|
4929
4629
|
const useGetCurrentEnvironmentQueryOptions = (options) => {
|
|
4930
|
-
const { query: queryOptions } = options ?? {};
|
|
4630
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4931
4631
|
const queryKey = queryOptions?.queryKey ?? getGetCurrentEnvironmentQueryKey();
|
|
4932
4632
|
const getCurrentEnvironment = useGetCurrentEnvironmentHook();
|
|
4933
|
-
const queryFn = ({ signal }) => getCurrentEnvironment(signal);
|
|
4633
|
+
const queryFn = ({ signal }) => getCurrentEnvironment({ signal, ...requestOptions });
|
|
4934
4634
|
return { queryKey, queryFn, ...queryOptions };
|
|
4935
4635
|
};
|
|
4936
|
-
|
|
4636
|
+
function useGetCurrentEnvironment(options, queryClient) {
|
|
4937
4637
|
const queryOptions = useGetCurrentEnvironmentQueryOptions(options);
|
|
4938
|
-
const query = useQuery(queryOptions);
|
|
4939
|
-
query
|
|
4940
|
-
|
|
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"
|
|
4941
4654
|
};
|
|
4942
4655
|
const GetAllRomaConfigurationTypes200Item = {
|
|
4943
4656
|
servicebus: "servicebus"
|
|
4944
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
|
+
};
|
|
4945
4667
|
const useGetRomaConfigurationByIdHook = () => {
|
|
4946
|
-
const
|
|
4947
|
-
return (id,
|
|
4948
|
-
return
|
|
4949
|
-
|
|
4950
|
-
method: "
|
|
4951
|
-
signal
|
|
4668
|
+
const customFetcher = useCustomClient();
|
|
4669
|
+
return (id, options) => {
|
|
4670
|
+
return customFetcher(getGetRomaConfigurationByIdUrl(id), {
|
|
4671
|
+
...options,
|
|
4672
|
+
method: "GET"
|
|
4952
4673
|
});
|
|
4953
4674
|
};
|
|
4954
4675
|
};
|
|
@@ -4956,10 +4677,10 @@ const getGetRomaConfigurationByIdQueryKey = (id) => {
|
|
|
4956
4677
|
return [`/api/configurations/id/${id}`];
|
|
4957
4678
|
};
|
|
4958
4679
|
const useGetRomaConfigurationByIdQueryOptions = (id, options) => {
|
|
4959
|
-
const { query: queryOptions } = options ?? {};
|
|
4680
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
4960
4681
|
const queryKey = queryOptions?.queryKey ?? getGetRomaConfigurationByIdQueryKey(id);
|
|
4961
4682
|
const getRomaConfigurationById = useGetRomaConfigurationByIdHook();
|
|
4962
|
-
const queryFn = ({ signal }) => getRomaConfigurationById(id, signal);
|
|
4683
|
+
const queryFn = ({ signal }) => getRomaConfigurationById(id, { signal, ...requestOptions });
|
|
4963
4684
|
return {
|
|
4964
4685
|
queryKey,
|
|
4965
4686
|
queryFn,
|
|
@@ -4967,65 +4688,78 @@ const useGetRomaConfigurationByIdQueryOptions = (id, options) => {
|
|
|
4967
4688
|
...queryOptions
|
|
4968
4689
|
};
|
|
4969
4690
|
};
|
|
4970
|
-
|
|
4691
|
+
function useGetRomaConfigurationById(id, options, queryClient) {
|
|
4971
4692
|
const queryOptions = useGetRomaConfigurationByIdQueryOptions(id, options);
|
|
4972
|
-
const query = useQuery(queryOptions);
|
|
4973
|
-
query
|
|
4974
|
-
|
|
4693
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4694
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4695
|
+
}
|
|
4696
|
+
const getUpdateRomaConfigurationUrl = (id) => {
|
|
4697
|
+
return `/api/configurations/id/${id}`;
|
|
4975
4698
|
};
|
|
4976
4699
|
const useUpdateRomaConfigurationHook = () => {
|
|
4977
|
-
const
|
|
4978
|
-
return (id, romaConfigurationDto) => {
|
|
4979
|
-
return
|
|
4980
|
-
|
|
4981
|
-
method: "
|
|
4982
|
-
headers: { "Content-Type": "application/json" },
|
|
4983
|
-
|
|
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)
|
|
4984
4707
|
});
|
|
4985
4708
|
};
|
|
4986
4709
|
};
|
|
4987
4710
|
const useUpdateRomaConfigurationMutationOptions = (options) => {
|
|
4988
|
-
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 };
|
|
4989
4713
|
const updateRomaConfiguration = useUpdateRomaConfigurationHook();
|
|
4990
4714
|
const mutationFn = (props) => {
|
|
4991
4715
|
const { id, data } = props ?? {};
|
|
4992
|
-
return updateRomaConfiguration(id, data);
|
|
4716
|
+
return updateRomaConfiguration(id, data, requestOptions);
|
|
4993
4717
|
};
|
|
4994
4718
|
return { mutationFn, ...mutationOptions };
|
|
4995
4719
|
};
|
|
4996
|
-
const useUpdateRomaConfiguration = (options) => {
|
|
4997
|
-
|
|
4998
|
-
|
|
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}`;
|
|
4999
4728
|
};
|
|
5000
4729
|
const useDeleteRomaConfigurationHook = () => {
|
|
5001
|
-
const
|
|
5002
|
-
return (id) => {
|
|
5003
|
-
return
|
|
5004
|
-
|
|
5005
|
-
method: "
|
|
4730
|
+
const customFetcher = useCustomClient();
|
|
4731
|
+
return (id, options) => {
|
|
4732
|
+
return customFetcher(getDeleteRomaConfigurationUrl(id), {
|
|
4733
|
+
...options,
|
|
4734
|
+
method: "DELETE"
|
|
5006
4735
|
});
|
|
5007
4736
|
};
|
|
5008
4737
|
};
|
|
5009
4738
|
const useDeleteRomaConfigurationMutationOptions = (options) => {
|
|
5010
|
-
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 };
|
|
5011
4741
|
const deleteRomaConfiguration = useDeleteRomaConfigurationHook();
|
|
5012
4742
|
const mutationFn = (props) => {
|
|
5013
4743
|
const { id } = props ?? {};
|
|
5014
|
-
return deleteRomaConfiguration(id);
|
|
4744
|
+
return deleteRomaConfiguration(id, requestOptions);
|
|
5015
4745
|
};
|
|
5016
4746
|
return { mutationFn, ...mutationOptions };
|
|
5017
4747
|
};
|
|
5018
|
-
const useDeleteRomaConfiguration = (options) => {
|
|
5019
|
-
|
|
5020
|
-
|
|
4748
|
+
const useDeleteRomaConfiguration = (options, queryClient) => {
|
|
4749
|
+
return useMutation(
|
|
4750
|
+
useDeleteRomaConfigurationMutationOptions(options),
|
|
4751
|
+
queryClient
|
|
4752
|
+
);
|
|
4753
|
+
};
|
|
4754
|
+
const getGetAllRomaConfigurationUrl = () => {
|
|
4755
|
+
return `/api/configurations`;
|
|
5021
4756
|
};
|
|
5022
4757
|
const useGetAllRomaConfigurationHook = () => {
|
|
5023
|
-
const
|
|
5024
|
-
return (
|
|
5025
|
-
return
|
|
5026
|
-
|
|
5027
|
-
method: "
|
|
5028
|
-
signal
|
|
4758
|
+
const customFetcher = useCustomClient();
|
|
4759
|
+
return (options) => {
|
|
4760
|
+
return customFetcher(getGetAllRomaConfigurationUrl(), {
|
|
4761
|
+
...options,
|
|
4762
|
+
method: "GET"
|
|
5029
4763
|
});
|
|
5030
4764
|
};
|
|
5031
4765
|
};
|
|
@@ -5033,49 +4767,56 @@ const getGetAllRomaConfigurationQueryKey = () => {
|
|
|
5033
4767
|
return [`/api/configurations`];
|
|
5034
4768
|
};
|
|
5035
4769
|
const useGetAllRomaConfigurationQueryOptions = (options) => {
|
|
5036
|
-
const { query: queryOptions } = options ?? {};
|
|
4770
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5037
4771
|
const queryKey = queryOptions?.queryKey ?? getGetAllRomaConfigurationQueryKey();
|
|
5038
4772
|
const getAllRomaConfiguration = useGetAllRomaConfigurationHook();
|
|
5039
|
-
const queryFn = ({ signal }) => getAllRomaConfiguration(signal);
|
|
4773
|
+
const queryFn = ({ signal }) => getAllRomaConfiguration({ signal, ...requestOptions });
|
|
5040
4774
|
return { queryKey, queryFn, ...queryOptions };
|
|
5041
4775
|
};
|
|
5042
|
-
|
|
4776
|
+
function useGetAllRomaConfiguration(options, queryClient) {
|
|
5043
4777
|
const queryOptions = useGetAllRomaConfigurationQueryOptions(options);
|
|
5044
|
-
const query = useQuery(queryOptions);
|
|
5045
|
-
query
|
|
5046
|
-
|
|
4778
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4779
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4780
|
+
}
|
|
4781
|
+
const getAddRomaConfigurationUrl = () => {
|
|
4782
|
+
return `/api/configurations`;
|
|
5047
4783
|
};
|
|
5048
4784
|
const useAddRomaConfigurationHook = () => {
|
|
5049
|
-
const
|
|
5050
|
-
return (romaConfigurationDto) => {
|
|
5051
|
-
return
|
|
5052
|
-
|
|
5053
|
-
method: "
|
|
5054
|
-
headers: { "Content-Type": "application/json" },
|
|
5055
|
-
|
|
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)
|
|
5056
4792
|
});
|
|
5057
4793
|
};
|
|
5058
4794
|
};
|
|
5059
4795
|
const useAddRomaConfigurationMutationOptions = (options) => {
|
|
5060
|
-
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 };
|
|
5061
4798
|
const addRomaConfiguration = useAddRomaConfigurationHook();
|
|
5062
4799
|
const mutationFn = (props) => {
|
|
5063
4800
|
const { data } = props ?? {};
|
|
5064
|
-
return addRomaConfiguration(data);
|
|
4801
|
+
return addRomaConfiguration(data, requestOptions);
|
|
5065
4802
|
};
|
|
5066
4803
|
return { mutationFn, ...mutationOptions };
|
|
5067
4804
|
};
|
|
5068
|
-
const useAddRomaConfiguration = (options) => {
|
|
5069
|
-
|
|
5070
|
-
|
|
4805
|
+
const useAddRomaConfiguration = (options, queryClient) => {
|
|
4806
|
+
return useMutation(
|
|
4807
|
+
useAddRomaConfigurationMutationOptions(options),
|
|
4808
|
+
queryClient
|
|
4809
|
+
);
|
|
4810
|
+
};
|
|
4811
|
+
const getGetAllRomaConfigurationTypesUrl = () => {
|
|
4812
|
+
return `/api/configurations/types`;
|
|
5071
4813
|
};
|
|
5072
4814
|
const useGetAllRomaConfigurationTypesHook = () => {
|
|
5073
|
-
const
|
|
5074
|
-
return (
|
|
5075
|
-
return
|
|
5076
|
-
|
|
5077
|
-
method: "
|
|
5078
|
-
signal
|
|
4815
|
+
const customFetcher = useCustomClient();
|
|
4816
|
+
return (options) => {
|
|
4817
|
+
return customFetcher(getGetAllRomaConfigurationTypesUrl(), {
|
|
4818
|
+
...options,
|
|
4819
|
+
method: "GET"
|
|
5079
4820
|
});
|
|
5080
4821
|
};
|
|
5081
4822
|
};
|
|
@@ -5083,25 +4824,26 @@ const getGetAllRomaConfigurationTypesQueryKey = () => {
|
|
|
5083
4824
|
return [`/api/configurations/types`];
|
|
5084
4825
|
};
|
|
5085
4826
|
const useGetAllRomaConfigurationTypesQueryOptions = (options) => {
|
|
5086
|
-
const { query: queryOptions } = options ?? {};
|
|
4827
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5087
4828
|
const queryKey = queryOptions?.queryKey ?? getGetAllRomaConfigurationTypesQueryKey();
|
|
5088
4829
|
const getAllRomaConfigurationTypes = useGetAllRomaConfigurationTypesHook();
|
|
5089
|
-
const queryFn = ({ signal }) => getAllRomaConfigurationTypes(signal);
|
|
4830
|
+
const queryFn = ({ signal }) => getAllRomaConfigurationTypes({ signal, ...requestOptions });
|
|
5090
4831
|
return { queryKey, queryFn, ...queryOptions };
|
|
5091
4832
|
};
|
|
5092
|
-
|
|
4833
|
+
function useGetAllRomaConfigurationTypes(options, queryClient) {
|
|
5093
4834
|
const queryOptions = useGetAllRomaConfigurationTypesQueryOptions(options);
|
|
5094
|
-
const query = useQuery(queryOptions);
|
|
5095
|
-
query
|
|
5096
|
-
|
|
4835
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4836
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4837
|
+
}
|
|
4838
|
+
const getGetAllRomaConfigurationByTypeUrl = (type) => {
|
|
4839
|
+
return `/api/configurations/types/type/${type}`;
|
|
5097
4840
|
};
|
|
5098
4841
|
const useGetAllRomaConfigurationByTypeHook = () => {
|
|
5099
|
-
const
|
|
5100
|
-
return (type,
|
|
5101
|
-
return
|
|
5102
|
-
|
|
5103
|
-
method: "
|
|
5104
|
-
signal
|
|
4842
|
+
const customFetcher = useCustomClient();
|
|
4843
|
+
return (type, options) => {
|
|
4844
|
+
return customFetcher(getGetAllRomaConfigurationByTypeUrl(type), {
|
|
4845
|
+
...options,
|
|
4846
|
+
method: "GET"
|
|
5105
4847
|
});
|
|
5106
4848
|
};
|
|
5107
4849
|
};
|
|
@@ -5109,10 +4851,10 @@ const getGetAllRomaConfigurationByTypeQueryKey = (type) => {
|
|
|
5109
4851
|
return [`/api/configurations/types/type/${type}`];
|
|
5110
4852
|
};
|
|
5111
4853
|
const useGetAllRomaConfigurationByTypeQueryOptions = (type, options) => {
|
|
5112
|
-
const { query: queryOptions } = options ?? {};
|
|
4854
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5113
4855
|
const queryKey = queryOptions?.queryKey ?? getGetAllRomaConfigurationByTypeQueryKey(type);
|
|
5114
4856
|
const getAllRomaConfigurationByType = useGetAllRomaConfigurationByTypeHook();
|
|
5115
|
-
const queryFn = ({ signal }) => getAllRomaConfigurationByType(type, signal);
|
|
4857
|
+
const queryFn = ({ signal }) => getAllRomaConfigurationByType(type, { signal, ...requestOptions });
|
|
5116
4858
|
return {
|
|
5117
4859
|
queryKey,
|
|
5118
4860
|
queryFn,
|
|
@@ -5120,47 +4862,57 @@ const useGetAllRomaConfigurationByTypeQueryOptions = (type, options) => {
|
|
|
5120
4862
|
...queryOptions
|
|
5121
4863
|
};
|
|
5122
4864
|
};
|
|
5123
|
-
|
|
4865
|
+
function useGetAllRomaConfigurationByType(type, options, queryClient) {
|
|
5124
4866
|
const queryOptions = useGetAllRomaConfigurationByTypeQueryOptions(
|
|
5125
4867
|
type,
|
|
5126
4868
|
options
|
|
5127
4869
|
);
|
|
5128
|
-
const query = useQuery(queryOptions);
|
|
5129
|
-
query
|
|
5130
|
-
|
|
4870
|
+
const query = useQuery(queryOptions, queryClient);
|
|
4871
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
4872
|
+
}
|
|
4873
|
+
const getCreateFeedbackUrl = () => {
|
|
4874
|
+
return `/api/feedbacks`;
|
|
5131
4875
|
};
|
|
5132
4876
|
const useCreateFeedbackHook = () => {
|
|
5133
|
-
const
|
|
5134
|
-
return (feedbackDto) => {
|
|
5135
|
-
return
|
|
5136
|
-
|
|
5137
|
-
method: "
|
|
5138
|
-
headers: { "Content-Type": "application/json" },
|
|
5139
|
-
|
|
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)
|
|
5140
4884
|
});
|
|
5141
4885
|
};
|
|
5142
4886
|
};
|
|
5143
4887
|
const useCreateFeedbackMutationOptions = (options) => {
|
|
5144
|
-
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 };
|
|
5145
4890
|
const createFeedback = useCreateFeedbackHook();
|
|
5146
4891
|
const mutationFn = (props) => {
|
|
5147
4892
|
const { data } = props ?? {};
|
|
5148
|
-
return createFeedback(data);
|
|
4893
|
+
return createFeedback(data, requestOptions);
|
|
5149
4894
|
};
|
|
5150
4895
|
return { mutationFn, ...mutationOptions };
|
|
5151
4896
|
};
|
|
5152
|
-
const useCreateFeedback = (options) => {
|
|
5153
|
-
|
|
5154
|
-
|
|
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`;
|
|
5155
4909
|
};
|
|
5156
4910
|
const useListFeedbacksByCurrentUserHook = () => {
|
|
5157
|
-
const
|
|
5158
|
-
return (params,
|
|
5159
|
-
return
|
|
5160
|
-
|
|
5161
|
-
method: "
|
|
5162
|
-
params,
|
|
5163
|
-
signal
|
|
4911
|
+
const customFetcher = useCustomClient();
|
|
4912
|
+
return (params, options) => {
|
|
4913
|
+
return customFetcher(getListFeedbacksByCurrentUserUrl(params), {
|
|
4914
|
+
...options,
|
|
4915
|
+
method: "GET"
|
|
5164
4916
|
});
|
|
5165
4917
|
};
|
|
5166
4918
|
};
|
|
@@ -5168,21 +4920,327 @@ const getListFeedbacksByCurrentUserQueryKey = (params) => {
|
|
|
5168
4920
|
return [`/api/feedbacks/mine`, ...params ? [params] : []];
|
|
5169
4921
|
};
|
|
5170
4922
|
const useListFeedbacksByCurrentUserQueryOptions = (params, options) => {
|
|
5171
|
-
const { query: queryOptions } = options ?? {};
|
|
4923
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
5172
4924
|
const queryKey = queryOptions?.queryKey ?? getListFeedbacksByCurrentUserQueryKey(params);
|
|
5173
4925
|
const listFeedbacksByCurrentUser = useListFeedbacksByCurrentUserHook();
|
|
5174
|
-
const queryFn = ({ signal }) => listFeedbacksByCurrentUser(params, signal);
|
|
4926
|
+
const queryFn = ({ signal }) => listFeedbacksByCurrentUser(params, { signal, ...requestOptions });
|
|
5175
4927
|
return { queryKey, queryFn, ...queryOptions };
|
|
5176
4928
|
};
|
|
5177
|
-
|
|
4929
|
+
function useListFeedbacksByCurrentUser(params, options, queryClient) {
|
|
5178
4930
|
const queryOptions = useListFeedbacksByCurrentUserQueryOptions(
|
|
5179
4931
|
params,
|
|
5180
4932
|
options
|
|
5181
4933
|
);
|
|
5182
|
-
const query = useQuery(queryOptions);
|
|
5183
|
-
query
|
|
5184
|
-
|
|
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 };
|
|
5185
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
|
+
};
|
|
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
|
+
}
|
|
5186
5244
|
const findGroupMembers = async (client, groupId, query) => {
|
|
5187
5245
|
const headers = {
|
|
5188
5246
|
ConsistencyLevel: "eventual"
|
|
@@ -5664,26 +5722,29 @@ const useWatchDefaults = {
|
|
|
5664
5722
|
}
|
|
5665
5723
|
};
|
|
5666
5724
|
const useManageWatchList = (system) => {
|
|
5667
|
-
const { data: setting } = useGetSettingsByAppShortName(
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
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
|
+
}
|
|
5684
5745
|
}
|
|
5685
5746
|
}
|
|
5686
|
-
|
|
5747
|
+
);
|
|
5687
5748
|
const framework = useFramework();
|
|
5688
5749
|
const user = framework.modules.auth.account;
|
|
5689
5750
|
const userId = user?.username.split("@")[0].toLowerCase() ?? "MISSINGUSER";
|
|
@@ -5764,6 +5825,9 @@ const useManageWatchList = (system) => {
|
|
|
5764
5825
|
};
|
|
5765
5826
|
};
|
|
5766
5827
|
export {
|
|
5828
|
+
AdminDtoAdminType,
|
|
5829
|
+
AlarmDtoSeverity,
|
|
5830
|
+
AlarmDtoState,
|
|
5767
5831
|
AppContext,
|
|
5768
5832
|
AppLoadError,
|
|
5769
5833
|
AppLoader,
|
|
@@ -5775,29 +5839,81 @@ export {
|
|
|
5775
5839
|
Header,
|
|
5776
5840
|
HttpError2 as HttpError,
|
|
5777
5841
|
HttpErrorViewer,
|
|
5842
|
+
RaiseAlarmRequestSeverity,
|
|
5778
5843
|
RomaErrorViewer,
|
|
5779
5844
|
StyleProvider,
|
|
5780
5845
|
configure,
|
|
5781
5846
|
createIDBPersister,
|
|
5782
5847
|
findUserById,
|
|
5783
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,
|
|
5784
5867
|
getGetAllAppsQueryKey,
|
|
5868
|
+
getGetAllAppsUrl,
|
|
5785
5869
|
getGetAllCategoriesQueryKey,
|
|
5870
|
+
getGetAllCategoriesUrl,
|
|
5871
|
+
getGetAllQueryKey,
|
|
5786
5872
|
getGetAllRomaConfigurationByTypeQueryKey,
|
|
5873
|
+
getGetAllRomaConfigurationByTypeUrl,
|
|
5787
5874
|
getGetAllRomaConfigurationQueryKey,
|
|
5788
5875
|
getGetAllRomaConfigurationTypesQueryKey,
|
|
5876
|
+
getGetAllRomaConfigurationTypesUrl,
|
|
5877
|
+
getGetAllRomaConfigurationUrl,
|
|
5789
5878
|
getGetAllServicesQueryKey,
|
|
5879
|
+
getGetAllServicesUrl,
|
|
5880
|
+
getGetAllUrl,
|
|
5790
5881
|
getGetAppByKeyQueryKey,
|
|
5882
|
+
getGetAppByKeyUrl,
|
|
5883
|
+
getGetByIdQueryKey,
|
|
5884
|
+
getGetByIdUrl,
|
|
5791
5885
|
getGetCategoryByIdQueryKey,
|
|
5886
|
+
getGetCategoryByIdUrl,
|
|
5792
5887
|
getGetCurrentEnvironmentQueryKey,
|
|
5888
|
+
getGetCurrentEnvironmentUrl,
|
|
5793
5889
|
getGetPublicSettingByUserAndIdQueryKey,
|
|
5890
|
+
getGetPublicSettingByUserAndIdUrl,
|
|
5794
5891
|
getGetRomaConfigurationByIdQueryKey,
|
|
5892
|
+
getGetRomaConfigurationByIdUrl,
|
|
5795
5893
|
getGetServiceByKeyQueryKey,
|
|
5894
|
+
getGetServiceByKeyUrl,
|
|
5796
5895
|
getGetSettingByUserAndIdQueryKey,
|
|
5896
|
+
getGetSettingByUserAndIdUrl,
|
|
5797
5897
|
getGetSettingsByAppShortNameQueryKey,
|
|
5898
|
+
getGetSettingsByAppShortNameUrl,
|
|
5798
5899
|
getGetSettingsByUserIdQueryKey,
|
|
5900
|
+
getGetSettingsByUserIdUrl,
|
|
5901
|
+
getGetStatusQueryKey,
|
|
5902
|
+
getGetStatusUrl,
|
|
5799
5903
|
getListFeedbacksByCurrentUserQueryKey,
|
|
5904
|
+
getListFeedbacksByCurrentUserUrl,
|
|
5905
|
+
getRaiseUrl,
|
|
5906
|
+
getReplaceMembersUrl,
|
|
5907
|
+
getStreamAlarmsQueryKey,
|
|
5908
|
+
getStreamAlarmsUrl,
|
|
5800
5909
|
getStreamEventsQueryKey,
|
|
5910
|
+
getStreamEventsUrl,
|
|
5911
|
+
getUpdateByUserIdAndIdUrl,
|
|
5912
|
+
getUpdatePublicSettingByAppShortNameAndIdUrl,
|
|
5913
|
+
getUpdateRomaConfigurationUrl,
|
|
5914
|
+
getUpdateUrl,
|
|
5915
|
+
getUploadBundleUrl,
|
|
5916
|
+
handle,
|
|
5801
5917
|
handleError,
|
|
5802
5918
|
makeComponent,
|
|
5803
5919
|
parseJwt,
|
|
@@ -5806,9 +5922,15 @@ export {
|
|
|
5806
5922
|
useAddRomaConfigurationHook,
|
|
5807
5923
|
useAddRomaConfigurationMutationOptions,
|
|
5808
5924
|
useApps,
|
|
5925
|
+
useClear,
|
|
5926
|
+
useClearHook,
|
|
5927
|
+
useClearMutationOptions,
|
|
5928
|
+
useCreate,
|
|
5809
5929
|
useCreateFeedback,
|
|
5810
5930
|
useCreateFeedbackHook,
|
|
5811
5931
|
useCreateFeedbackMutationOptions,
|
|
5932
|
+
useCreateHook,
|
|
5933
|
+
useCreateMutationOptions,
|
|
5812
5934
|
useCreateOrUpdateApp,
|
|
5813
5935
|
useCreateOrUpdateAppHook,
|
|
5814
5936
|
useCreateOrUpdateAppMutationOptions,
|
|
@@ -5824,12 +5946,14 @@ export {
|
|
|
5824
5946
|
useCreateSettingByUserId,
|
|
5825
5947
|
useCreateSettingByUserIdHook,
|
|
5826
5948
|
useCreateSettingByUserIdMutationOptions,
|
|
5949
|
+
useDelete,
|
|
5827
5950
|
useDeleteAppByKey,
|
|
5828
5951
|
useDeleteAppByKeyHook,
|
|
5829
5952
|
useDeleteAppByKeyMutationOptions,
|
|
5830
5953
|
useDeleteCategoryById,
|
|
5831
5954
|
useDeleteCategoryByIdHook,
|
|
5832
5955
|
useDeleteCategoryByIdMutationOptions,
|
|
5956
|
+
useDeleteMutationOptions,
|
|
5833
5957
|
useDeletePrivateSettingById,
|
|
5834
5958
|
useDeletePrivateSettingByIdHook,
|
|
5835
5959
|
useDeletePrivateSettingByIdMutationOptions,
|
|
@@ -5849,12 +5973,18 @@ export {
|
|
|
5849
5973
|
useFindUserById,
|
|
5850
5974
|
useFindUsersByMail,
|
|
5851
5975
|
useFindUsersByShortname,
|
|
5976
|
+
useGetAll,
|
|
5977
|
+
useGetAll1,
|
|
5978
|
+
useGetAll1Hook,
|
|
5979
|
+
useGetAll1QueryOptions,
|
|
5852
5980
|
useGetAllApps,
|
|
5853
5981
|
useGetAllAppsHook,
|
|
5854
5982
|
useGetAllAppsQueryOptions,
|
|
5855
5983
|
useGetAllCategories,
|
|
5856
5984
|
useGetAllCategoriesHook,
|
|
5857
5985
|
useGetAllCategoriesQueryOptions,
|
|
5986
|
+
useGetAllHook,
|
|
5987
|
+
useGetAllQueryOptions,
|
|
5858
5988
|
useGetAllRomaConfiguration,
|
|
5859
5989
|
useGetAllRomaConfigurationByType,
|
|
5860
5990
|
useGetAllRomaConfigurationByTypeHook,
|
|
@@ -5871,6 +6001,9 @@ export {
|
|
|
5871
6001
|
useGetAppByKey,
|
|
5872
6002
|
useGetAppByKeyHook,
|
|
5873
6003
|
useGetAppByKeyQueryOptions,
|
|
6004
|
+
useGetById,
|
|
6005
|
+
useGetByIdHook,
|
|
6006
|
+
useGetByIdQueryOptions,
|
|
5874
6007
|
useGetCategoryById,
|
|
5875
6008
|
useGetCategoryByIdHook,
|
|
5876
6009
|
useGetCategoryByIdQueryOptions,
|
|
@@ -5895,17 +6028,32 @@ export {
|
|
|
5895
6028
|
useGetSettingsByUserId,
|
|
5896
6029
|
useGetSettingsByUserIdHook,
|
|
5897
6030
|
useGetSettingsByUserIdQueryOptions,
|
|
6031
|
+
useGetStatus,
|
|
6032
|
+
useGetStatusHook,
|
|
6033
|
+
useGetStatusQueryOptions,
|
|
5898
6034
|
useHasApiRole,
|
|
5899
6035
|
useListFeedbacksByCurrentUser,
|
|
5900
6036
|
useListFeedbacksByCurrentUserHook,
|
|
5901
6037
|
useListFeedbacksByCurrentUserQueryOptions,
|
|
5902
6038
|
useManageWatchList,
|
|
6039
|
+
useRaise,
|
|
6040
|
+
useRaiseHook,
|
|
6041
|
+
useRaiseMutationOptions,
|
|
6042
|
+
useReplaceMembers,
|
|
6043
|
+
useReplaceMembersHook,
|
|
6044
|
+
useReplaceMembersMutationOptions,
|
|
6045
|
+
useStreamAlarms,
|
|
6046
|
+
useStreamAlarmsHook,
|
|
6047
|
+
useStreamAlarmsQueryOptions,
|
|
5903
6048
|
useStreamEvents,
|
|
5904
6049
|
useStreamEventsHook,
|
|
5905
6050
|
useStreamEventsQueryOptions,
|
|
6051
|
+
useUpdate,
|
|
5906
6052
|
useUpdateByUserIdAndId,
|
|
5907
6053
|
useUpdateByUserIdAndIdHook,
|
|
5908
6054
|
useUpdateByUserIdAndIdMutationOptions,
|
|
6055
|
+
useUpdateHook,
|
|
6056
|
+
useUpdateMutationOptions,
|
|
5909
6057
|
useUpdatePublicSettingByAppShortNameAndId,
|
|
5910
6058
|
useUpdatePublicSettingByAppShortNameAndIdHook,
|
|
5911
6059
|
useUpdatePublicSettingByAppShortNameAndIdMutationOptions,
|
|
@@ -5915,5 +6063,6 @@ export {
|
|
|
5915
6063
|
useUploadBundle,
|
|
5916
6064
|
useUploadBundleHook,
|
|
5917
6065
|
useUploadBundleMutationOptions,
|
|
6066
|
+
use_DeleteHook,
|
|
5918
6067
|
withStyleIsolation
|
|
5919
6068
|
};
|