@ethisyscore/plugin-ui 1.100.3 → 1.100.5
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/dist/components/connectors/index.cjs +56 -10
- package/dist/components/connectors/index.cjs.map +1 -1
- package/dist/components/connectors/index.d.cts +2 -2
- package/dist/components/connectors/index.d.ts +2 -2
- package/dist/components/connectors/index.js +57 -12
- package/dist/components/connectors/index.js.map +1 -1
- package/dist/components/ui/index.cjs +4 -0
- package/dist/components/ui/index.d.cts +1 -1
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/components/ui/index.js +1 -1
- package/dist/connector-mappings/index.d.cts +2 -2
- package/dist/connector-mappings/index.d.ts +2 -2
- package/dist/{mappingQueryKeys-BcbA0TGy.d.cts → mappingQueryKeys-KONuceBb.d.cts} +22 -1
- package/dist/{mappingQueryKeys-BcbA0TGy.d.ts → mappingQueryKeys-KONuceBb.d.ts} +22 -1
- package/dist/platform-react/index.cjs +76 -24
- package/dist/platform-react/index.cjs.map +1 -1
- package/dist/platform-react/index.d.cts +46 -2
- package/dist/platform-react/index.d.ts +46 -2
- package/dist/platform-react/index.js +77 -26
- package/dist/platform-react/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -240,6 +240,10 @@ Object.defineProperty(exports, "CardHeader", {
|
|
|
240
240
|
enumerable: true,
|
|
241
241
|
get: function () { return material.CardHeader; }
|
|
242
242
|
});
|
|
243
|
+
Object.defineProperty(exports, "Checkbox", {
|
|
244
|
+
enumerable: true,
|
|
245
|
+
get: function () { return material.Checkbox; }
|
|
246
|
+
});
|
|
243
247
|
Object.defineProperty(exports, "Chip", {
|
|
244
248
|
enumerable: true,
|
|
245
249
|
get: function () { return material.Chip; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DialogProps, SxProps, Theme } from '@mui/material';
|
|
2
|
-
export { Alert, AlertTitle, Autocomplete, Box, Breadcrumbs, Button, Card, CardActions, CardContent, CardHeader, Chip, CircularProgress, Collapse, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, FilledInput, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, Grid, IconButton, Input, InputAdornment, InputLabel, LinearProgress, Link, ListItemIcon, ListItemText, Menu, MenuItem, OutlinedInput, Paper, Popover, Select, SelectChangeEvent, Skeleton, Stack, Switch, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableHead as TableHeader, TableRow, Tabs, TextField, TextareaAutosize, Tooltip, Typography } from '@mui/material';
|
|
2
|
+
export { Alert, AlertTitle, Autocomplete, Box, Breadcrumbs, Button, Card, CardActions, CardContent, CardHeader, Checkbox, Chip, CircularProgress, Collapse, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, FilledInput, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, Grid, IconButton, Input, InputAdornment, InputLabel, LinearProgress, Link, ListItemIcon, ListItemText, Menu, MenuItem, OutlinedInput, Paper, Popover, Select, SelectChangeEvent, Skeleton, Stack, Switch, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableHead as TableHeader, TableRow, Tabs, TextField, TextareaAutosize, Tooltip, Typography } from '@mui/material';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DialogProps, SxProps, Theme } from '@mui/material';
|
|
2
|
-
export { Alert, AlertTitle, Autocomplete, Box, Breadcrumbs, Button, Card, CardActions, CardContent, CardHeader, Chip, CircularProgress, Collapse, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, FilledInput, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, Grid, IconButton, Input, InputAdornment, InputLabel, LinearProgress, Link, ListItemIcon, ListItemText, Menu, MenuItem, OutlinedInput, Paper, Popover, Select, SelectChangeEvent, Skeleton, Stack, Switch, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableHead as TableHeader, TableRow, Tabs, TextField, TextareaAutosize, Tooltip, Typography } from '@mui/material';
|
|
2
|
+
export { Alert, AlertTitle, Autocomplete, Box, Breadcrumbs, Button, Card, CardActions, CardContent, CardHeader, Checkbox, Chip, CircularProgress, Collapse, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, FilledInput, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, Grid, IconButton, Input, InputAdornment, InputLabel, LinearProgress, Link, ListItemIcon, ListItemText, Menu, MenuItem, OutlinedInput, Paper, Popover, Select, SelectChangeEvent, Skeleton, Stack, Switch, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableHead as TableHeader, TableRow, Tabs, TextField, TextareaAutosize, Tooltip, Typography } from '@mui/material';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormControl, InputLabel, FilledInput, InputAdornment, IconButton, Dialog as Dialog$1, LinearProgress } from '@mui/material';
|
|
2
|
-
export { Alert, AlertTitle, Autocomplete, Box, Breadcrumbs, Button, Card, CardActions, CardContent, CardHeader, Chip, CircularProgress, Collapse, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, FilledInput, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, Grid, IconButton, Input, InputAdornment, InputLabel, LinearProgress, Link, ListItemIcon, ListItemText, Menu, MenuItem, OutlinedInput, Paper, Popover, Select, Skeleton, Stack, Switch, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableHead as TableHeader, TableRow, Tabs, TextField, TextareaAutosize, Tooltip, Typography } from '@mui/material';
|
|
2
|
+
export { Alert, AlertTitle, Autocomplete, Box, Breadcrumbs, Button, Card, CardActions, CardContent, CardHeader, Checkbox, Chip, CircularProgress, Collapse, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, FilledInput, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, Grid, IconButton, Input, InputAdornment, InputLabel, LinearProgress, Link, ListItemIcon, ListItemText, Menu, MenuItem, OutlinedInput, Paper, Popover, Select, Skeleton, Stack, Switch, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableHead as TableHeader, TableRow, Tabs, TextField, TextareaAutosize, Tooltip, Typography } from '@mui/material';
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { memo, useState, useId, useRef, useEffect, useCallback } from 'react';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { T as ToolInvoker } from '../mcpService-4h3sKDpW.cjs';
|
|
2
|
-
import { C as ConnectorCanonicalField, h as MappingCompletenessResult, c as ConnectorMappingSuggestionResult, m as TestToolMappingResult, i as MappingReadiness, g as MappingCompletenessItem, d as ConnectorMappingTranslationEditorProps, f as MappingCompletenessBannerProps } from '../mappingQueryKeys-
|
|
3
|
-
export { a as CONNECTOR_CONTROL_LABEL, b as ConnectorCanonicalFieldKind, P as PLUGIN_PROVIDER_CONTROL_LABEL, j as PROVIDER_CONTROL_LABEL, k as PROVIDER_OPTION_LABEL, T as TestToolMappingExtractedField, l as TestToolMappingRequest, n as connectorMappingCompletenessQueryKey, o as connectorMappingsQueryKey, p as connectorMappingsRootQueryKey, q as pluginTargetMappingsQueryKey, s as selectIncompleteOperations, r as selectMappingReadiness, t as selectOptionalIncompleteOperations, u as selectRequiredIncompleteOperations } from '../mappingQueryKeys-
|
|
2
|
+
import { C as ConnectorCanonicalField, h as MappingCompletenessResult, c as ConnectorMappingSuggestionResult, m as TestToolMappingResult, i as MappingReadiness, g as MappingCompletenessItem, d as ConnectorMappingTranslationEditorProps, f as MappingCompletenessBannerProps } from '../mappingQueryKeys-KONuceBb.cjs';
|
|
3
|
+
export { a as CONNECTOR_CONTROL_LABEL, b as ConnectorCanonicalFieldKind, P as PLUGIN_PROVIDER_CONTROL_LABEL, j as PROVIDER_CONTROL_LABEL, k as PROVIDER_OPTION_LABEL, T as TestToolMappingExtractedField, l as TestToolMappingRequest, n as connectorMappingCompletenessQueryKey, o as connectorMappingsQueryKey, p as connectorMappingsRootQueryKey, q as pluginTargetMappingsQueryKey, s as selectIncompleteOperations, r as selectMappingReadiness, t as selectOptionalIncompleteOperations, u as selectRequiredIncompleteOperations } from '../mappingQueryKeys-KONuceBb.cjs';
|
|
4
4
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
5
5
|
import 'react';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { T as ToolInvoker } from '../mcpService-4h3sKDpW.js';
|
|
2
|
-
import { C as ConnectorCanonicalField, h as MappingCompletenessResult, c as ConnectorMappingSuggestionResult, m as TestToolMappingResult, i as MappingReadiness, g as MappingCompletenessItem, d as ConnectorMappingTranslationEditorProps, f as MappingCompletenessBannerProps } from '../mappingQueryKeys-
|
|
3
|
-
export { a as CONNECTOR_CONTROL_LABEL, b as ConnectorCanonicalFieldKind, P as PLUGIN_PROVIDER_CONTROL_LABEL, j as PROVIDER_CONTROL_LABEL, k as PROVIDER_OPTION_LABEL, T as TestToolMappingExtractedField, l as TestToolMappingRequest, n as connectorMappingCompletenessQueryKey, o as connectorMappingsQueryKey, p as connectorMappingsRootQueryKey, q as pluginTargetMappingsQueryKey, s as selectIncompleteOperations, r as selectMappingReadiness, t as selectOptionalIncompleteOperations, u as selectRequiredIncompleteOperations } from '../mappingQueryKeys-
|
|
2
|
+
import { C as ConnectorCanonicalField, h as MappingCompletenessResult, c as ConnectorMappingSuggestionResult, m as TestToolMappingResult, i as MappingReadiness, g as MappingCompletenessItem, d as ConnectorMappingTranslationEditorProps, f as MappingCompletenessBannerProps } from '../mappingQueryKeys-KONuceBb.js';
|
|
3
|
+
export { a as CONNECTOR_CONTROL_LABEL, b as ConnectorCanonicalFieldKind, P as PLUGIN_PROVIDER_CONTROL_LABEL, j as PROVIDER_CONTROL_LABEL, k as PROVIDER_OPTION_LABEL, T as TestToolMappingExtractedField, l as TestToolMappingRequest, n as connectorMappingCompletenessQueryKey, o as connectorMappingsQueryKey, p as connectorMappingsRootQueryKey, q as pluginTargetMappingsQueryKey, s as selectIncompleteOperations, r as selectMappingReadiness, t as selectOptionalIncompleteOperations, u as selectRequiredIncompleteOperations } from '../mappingQueryKeys-KONuceBb.js';
|
|
4
4
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
5
5
|
import 'react';
|
|
6
6
|
|
|
@@ -266,6 +266,27 @@ declare const PLUGIN_PROVIDER_CONTROL_LABEL = "App";
|
|
|
266
266
|
/** Label of the control that picks WHICH connector, once "external system" is chosen. */
|
|
267
267
|
declare const CONNECTOR_CONTROL_LABEL = "Connector";
|
|
268
268
|
|
|
269
|
+
/**
|
|
270
|
+
* The reserved request-field-map value meaning "do not send this canonical field to the tool at
|
|
271
|
+
* all". The host reads it in `ConnectorRequestFieldSuppression` (CoreConnect.Application.Common);
|
|
272
|
+
* this is the editor's copy of the same literal, exported so consumers and tests name it rather
|
|
273
|
+
* than retyping it.
|
|
274
|
+
*
|
|
275
|
+
* <p><b>Why an operator needs it.</b> A blank input means "identity - send this field under its
|
|
276
|
+
* canonical name", and until the host learned this sentinel that was the ONLY thing the request
|
|
277
|
+
* side could say besides a rename. So an operation pointed at a tool with no property for one of
|
|
278
|
+
* its canonical inputs sent it anyway, and a tool whose input schema is
|
|
279
|
+
* <code>additionalProperties: false</code> rejects the entire call for the unknown key - not the
|
|
280
|
+
* field, the call. Ticking "Do not send" writes this value; the host's translator then omits the
|
|
281
|
+
* field from the request.</p>
|
|
282
|
+
*
|
|
283
|
+
* <p><b>Why this literal.</b> It has to be a value no tool could declare as an input property name,
|
|
284
|
+
* or a genuine rename onto that name would be swallowed. Parentheses are the discriminator: they
|
|
285
|
+
* are not valid in an identifier in any mainstream language, and across the tool inventory the
|
|
286
|
+
* platform has discovered, no input property name contains one. They also make the row read as an
|
|
287
|
+
* instruction rather than a name.</p>
|
|
288
|
+
*/
|
|
289
|
+
declare const SUPPRESS_REQUEST_FIELD_VALUE = "(suppress)";
|
|
269
290
|
interface ConnectorMappingTranslationEditorProps {
|
|
270
291
|
open: boolean;
|
|
271
292
|
/**
|
|
@@ -470,4 +491,4 @@ declare function pluginTargetMappingsQueryKey(moduleKey: string): readonly ["con
|
|
|
470
491
|
*/
|
|
471
492
|
declare function connectorMappingCompletenessQueryKey(connectorId: string | undefined, moduleKey: string): readonly ["connector-mappings", string | undefined, string, "completeness"];
|
|
472
493
|
|
|
473
|
-
export { type ConnectorCanonicalField as C, MappingCompletenessBanner as M, PLUGIN_PROVIDER_CONTROL_LABEL as P, type TestToolMappingExtractedField as T, CONNECTOR_CONTROL_LABEL as a, type ConnectorCanonicalFieldKind as b, type ConnectorMappingSuggestionResult as c, type ConnectorMappingTranslationEditorProps as d, ConnectorMappingTranslationEditorView as e, type MappingCompletenessBannerProps as f, type MappingCompletenessItem as g, type MappingCompletenessResult as h, type MappingReadiness as i, PROVIDER_CONTROL_LABEL as j, PROVIDER_OPTION_LABEL as k, type TestToolMappingRequest as l, type TestToolMappingResult as m, connectorMappingCompletenessQueryKey as n, connectorMappingsQueryKey as o, connectorMappingsRootQueryKey as p, pluginTargetMappingsQueryKey as q, selectMappingReadiness as r, selectIncompleteOperations as s, selectOptionalIncompleteOperations as t, selectRequiredIncompleteOperations as u };
|
|
494
|
+
export { type ConnectorCanonicalField as C, MappingCompletenessBanner as M, PLUGIN_PROVIDER_CONTROL_LABEL as P, SUPPRESS_REQUEST_FIELD_VALUE as S, type TestToolMappingExtractedField as T, CONNECTOR_CONTROL_LABEL as a, type ConnectorCanonicalFieldKind as b, type ConnectorMappingSuggestionResult as c, type ConnectorMappingTranslationEditorProps as d, ConnectorMappingTranslationEditorView as e, type MappingCompletenessBannerProps as f, type MappingCompletenessItem as g, type MappingCompletenessResult as h, type MappingReadiness as i, PROVIDER_CONTROL_LABEL as j, PROVIDER_OPTION_LABEL as k, type TestToolMappingRequest as l, type TestToolMappingResult as m, connectorMappingCompletenessQueryKey as n, connectorMappingsQueryKey as o, connectorMappingsRootQueryKey as p, pluginTargetMappingsQueryKey as q, selectMappingReadiness as r, selectIncompleteOperations as s, selectOptionalIncompleteOperations as t, selectRequiredIncompleteOperations as u };
|
|
@@ -266,6 +266,27 @@ declare const PLUGIN_PROVIDER_CONTROL_LABEL = "App";
|
|
|
266
266
|
/** Label of the control that picks WHICH connector, once "external system" is chosen. */
|
|
267
267
|
declare const CONNECTOR_CONTROL_LABEL = "Connector";
|
|
268
268
|
|
|
269
|
+
/**
|
|
270
|
+
* The reserved request-field-map value meaning "do not send this canonical field to the tool at
|
|
271
|
+
* all". The host reads it in `ConnectorRequestFieldSuppression` (CoreConnect.Application.Common);
|
|
272
|
+
* this is the editor's copy of the same literal, exported so consumers and tests name it rather
|
|
273
|
+
* than retyping it.
|
|
274
|
+
*
|
|
275
|
+
* <p><b>Why an operator needs it.</b> A blank input means "identity - send this field under its
|
|
276
|
+
* canonical name", and until the host learned this sentinel that was the ONLY thing the request
|
|
277
|
+
* side could say besides a rename. So an operation pointed at a tool with no property for one of
|
|
278
|
+
* its canonical inputs sent it anyway, and a tool whose input schema is
|
|
279
|
+
* <code>additionalProperties: false</code> rejects the entire call for the unknown key - not the
|
|
280
|
+
* field, the call. Ticking "Do not send" writes this value; the host's translator then omits the
|
|
281
|
+
* field from the request.</p>
|
|
282
|
+
*
|
|
283
|
+
* <p><b>Why this literal.</b> It has to be a value no tool could declare as an input property name,
|
|
284
|
+
* or a genuine rename onto that name would be swallowed. Parentheses are the discriminator: they
|
|
285
|
+
* are not valid in an identifier in any mainstream language, and across the tool inventory the
|
|
286
|
+
* platform has discovered, no input property name contains one. They also make the row read as an
|
|
287
|
+
* instruction rather than a name.</p>
|
|
288
|
+
*/
|
|
289
|
+
declare const SUPPRESS_REQUEST_FIELD_VALUE = "(suppress)";
|
|
269
290
|
interface ConnectorMappingTranslationEditorProps {
|
|
270
291
|
open: boolean;
|
|
271
292
|
/**
|
|
@@ -470,4 +491,4 @@ declare function pluginTargetMappingsQueryKey(moduleKey: string): readonly ["con
|
|
|
470
491
|
*/
|
|
471
492
|
declare function connectorMappingCompletenessQueryKey(connectorId: string | undefined, moduleKey: string): readonly ["connector-mappings", string | undefined, string, "completeness"];
|
|
472
493
|
|
|
473
|
-
export { type ConnectorCanonicalField as C, MappingCompletenessBanner as M, PLUGIN_PROVIDER_CONTROL_LABEL as P, type TestToolMappingExtractedField as T, CONNECTOR_CONTROL_LABEL as a, type ConnectorCanonicalFieldKind as b, type ConnectorMappingSuggestionResult as c, type ConnectorMappingTranslationEditorProps as d, ConnectorMappingTranslationEditorView as e, type MappingCompletenessBannerProps as f, type MappingCompletenessItem as g, type MappingCompletenessResult as h, type MappingReadiness as i, PROVIDER_CONTROL_LABEL as j, PROVIDER_OPTION_LABEL as k, type TestToolMappingRequest as l, type TestToolMappingResult as m, connectorMappingCompletenessQueryKey as n, connectorMappingsQueryKey as o, connectorMappingsRootQueryKey as p, pluginTargetMappingsQueryKey as q, selectMappingReadiness as r, selectIncompleteOperations as s, selectOptionalIncompleteOperations as t, selectRequiredIncompleteOperations as u };
|
|
494
|
+
export { type ConnectorCanonicalField as C, MappingCompletenessBanner as M, PLUGIN_PROVIDER_CONTROL_LABEL as P, SUPPRESS_REQUEST_FIELD_VALUE as S, type TestToolMappingExtractedField as T, CONNECTOR_CONTROL_LABEL as a, type ConnectorCanonicalFieldKind as b, type ConnectorMappingSuggestionResult as c, type ConnectorMappingTranslationEditorProps as d, ConnectorMappingTranslationEditorView as e, type MappingCompletenessBannerProps as f, type MappingCompletenessItem as g, type MappingCompletenessResult as h, type MappingReadiness as i, PROVIDER_CONTROL_LABEL as j, PROVIDER_OPTION_LABEL as k, type TestToolMappingRequest as l, type TestToolMappingResult as m, connectorMappingCompletenessQueryKey as n, connectorMappingsQueryKey as o, connectorMappingsRootQueryKey as p, pluginTargetMappingsQueryKey as q, selectMappingReadiness as r, selectIncompleteOperations as s, selectOptionalIncompleteOperations as t, selectRequiredIncompleteOperations as u };
|
|
@@ -30,6 +30,79 @@ function _interopNamespace(e) {
|
|
|
30
30
|
var extensionRuntime__namespace = /*#__PURE__*/_interopNamespace(extensionRuntime);
|
|
31
31
|
|
|
32
32
|
// src/platform-react/definePlatformReactPluginPage.tsx
|
|
33
|
+
|
|
34
|
+
// src/components/shared/toast.ts
|
|
35
|
+
function dispatchToast(title, description, variant) {
|
|
36
|
+
if (typeof window === "undefined" || title.length === 0) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
window.dispatchEvent(new CustomEvent("ethisys:toast", { detail: { title, description, variant } }));
|
|
40
|
+
}
|
|
41
|
+
function showErrorToast(title, description) {
|
|
42
|
+
dispatchToast(title, description, "error");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// src/platform-react/pluginQueryClient.ts
|
|
46
|
+
var STATUS_TITLES = /* @__PURE__ */ new Map([
|
|
47
|
+
["NotFound", "Not Found"],
|
|
48
|
+
["Unauthorized", "Authentication Error"],
|
|
49
|
+
["Forbidden", "Access Denied"],
|
|
50
|
+
["Conflict", "Conflict"]
|
|
51
|
+
]);
|
|
52
|
+
var UNTITLED_STATUSES = /* @__PURE__ */ new Set(["Invalid", "Error", "CriticalError", "Unavailable", "Accepted"]);
|
|
53
|
+
var GENERIC_TITLE = "Error";
|
|
54
|
+
function isKnownStatus(status) {
|
|
55
|
+
return STATUS_TITLES.has(status) || UNTITLED_STATUSES.has(status);
|
|
56
|
+
}
|
|
57
|
+
function splitStatusPrefix(message) {
|
|
58
|
+
const match = /^\[([A-Za-z]+)\]\s*(.*)$/s.exec(message);
|
|
59
|
+
if (match === null) {
|
|
60
|
+
return { status: null, body: message };
|
|
61
|
+
}
|
|
62
|
+
const [, status, body] = match;
|
|
63
|
+
if (!isKnownStatus(status)) {
|
|
64
|
+
return { status: null, body: message };
|
|
65
|
+
}
|
|
66
|
+
return body.length > 0 ? { status, body } : { status: null, body: message };
|
|
67
|
+
}
|
|
68
|
+
var ErrorCodePrefix = new RegExp(String.raw`^\[[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+\]\s*`);
|
|
69
|
+
function stripErrorCodePrefix(body) {
|
|
70
|
+
const stripped = body.replace(ErrorCodePrefix, "");
|
|
71
|
+
return stripped.length > 0 ? stripped : body;
|
|
72
|
+
}
|
|
73
|
+
function surfaceError(error, meta) {
|
|
74
|
+
if (meta?.suppressErrorToast === true) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const raw = error instanceof Error && error.message.length > 0 ? error.message : "An unexpected error occurred";
|
|
78
|
+
const { status, body } = splitStatusPrefix(raw);
|
|
79
|
+
const reason = stripErrorCodePrefix(body);
|
|
80
|
+
const title = meta?.errorTitle ?? (status !== null ? STATUS_TITLES.get(status) ?? GENERIC_TITLE : GENERIC_TITLE);
|
|
81
|
+
showErrorToast(title, reason);
|
|
82
|
+
}
|
|
83
|
+
function createPluginQueryClient(config) {
|
|
84
|
+
return new reactQuery.QueryClient({
|
|
85
|
+
queryCache: new reactQuery.QueryCache({
|
|
86
|
+
onError: (error, query) => surfaceError(error, query.meta)
|
|
87
|
+
}),
|
|
88
|
+
mutationCache: new reactQuery.MutationCache({
|
|
89
|
+
onError: (error, _variables, _context, mutation) => surfaceError(error, mutation.meta)
|
|
90
|
+
}),
|
|
91
|
+
...config,
|
|
92
|
+
defaultOptions: {
|
|
93
|
+
// Spread first so `mutations`, `dehydrate`, `hydrate` and anything else react-query
|
|
94
|
+
// adds to `DefaultOptions` survive. Rebuilding this object from named keys instead
|
|
95
|
+
// silently dropped them, which contradicted the merge promised just above.
|
|
96
|
+
...config?.defaultOptions,
|
|
97
|
+
queries: {
|
|
98
|
+
retry: 1,
|
|
99
|
+
refetchOnWindowFocus: false,
|
|
100
|
+
staleTime: 3e4,
|
|
101
|
+
...config?.defaultOptions?.queries
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
33
106
|
var TemplateContext = react.createContext(null);
|
|
34
107
|
function injectPluginStyles(id, css) {
|
|
35
108
|
if (typeof document === "undefined") return;
|
|
@@ -249,18 +322,7 @@ function useReportingCurrencySync() {
|
|
|
249
322
|
}
|
|
250
323
|
|
|
251
324
|
// src/platform-react/definePlatformReactPluginPage.tsx
|
|
252
|
-
|
|
253
|
-
return new reactQuery.QueryClient({
|
|
254
|
-
defaultOptions: {
|
|
255
|
-
queries: {
|
|
256
|
-
retry: 1,
|
|
257
|
-
refetchOnWindowFocus: false,
|
|
258
|
-
staleTime: 3e4
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
var defaultQueryClient = makeDefaultQueryClient();
|
|
325
|
+
var defaultQueryClient = createPluginQueryClient();
|
|
264
326
|
var EHX_PLUGIN_ROOT_CLASS = "ehx-plugin-root";
|
|
265
327
|
function definePlatformReactPluginPage(Page, options) {
|
|
266
328
|
const {
|
|
@@ -751,18 +813,7 @@ function useOverlayHost() {
|
|
|
751
813
|
}
|
|
752
814
|
return api;
|
|
753
815
|
}
|
|
754
|
-
|
|
755
|
-
return new reactQuery.QueryClient({
|
|
756
|
-
defaultOptions: {
|
|
757
|
-
queries: {
|
|
758
|
-
retry: 1,
|
|
759
|
-
refetchOnWindowFocus: false,
|
|
760
|
-
staleTime: 3e4
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
});
|
|
764
|
-
}
|
|
765
|
-
var defaultQueryClient2 = makeDefaultQueryClient2();
|
|
816
|
+
var defaultQueryClient2 = createPluginQueryClient();
|
|
766
817
|
function definePlatformReactPluginOverlay(Overlay, options) {
|
|
767
818
|
const { rootClassName, styleId, css, manifest = {}, queryClient = defaultQueryClient2, wrapOverlay } = options;
|
|
768
819
|
return function MountedOverlay(props) {
|
|
@@ -1203,6 +1254,7 @@ exports.TypedMcpService = TypedMcpService;
|
|
|
1203
1254
|
exports.buildSurfaceUrl = buildSurfaceUrl;
|
|
1204
1255
|
exports.createPluginOverlayDefiner = createPluginOverlayDefiner;
|
|
1205
1256
|
exports.createPluginPageDefiner = createPluginPageDefiner;
|
|
1257
|
+
exports.createPluginQueryClient = createPluginQueryClient;
|
|
1206
1258
|
exports.createReactRouterShim = createReactRouterShim;
|
|
1207
1259
|
exports.createUseView = createUseView;
|
|
1208
1260
|
exports.definePlatformReactPluginOverlay = definePlatformReactPluginOverlay;
|