@uipath/apollo-react 7.1.1 → 7.2.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/dist/canvas/components/Guardrails/builder-types.d.ts +1 -0
- package/dist/canvas/components/Guardrails/builder-types.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/centralized-guardrails-section.cjs +6 -9
- package/dist/canvas/components/Guardrails/centralized-guardrails-section.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/centralized-guardrails-section.js +6 -9
- package/dist/canvas/components/Guardrails/components/guardrail-list-row.cjs +13 -1
- package/dist/canvas/components/Guardrails/components/guardrail-list-row.d.ts +2 -1
- package/dist/canvas/components/Guardrails/components/guardrail-list-row.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/guardrail-list-row.js +13 -1
- package/dist/canvas/components/Guardrails/components/guardrail-status-banner.d.ts +2 -1
- package/dist/canvas/components/Guardrails/components/guardrail-status-banner.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/policy-name-text.cjs +55 -0
- package/dist/canvas/components/Guardrails/components/policy-name-text.d.ts +7 -0
- package/dist/canvas/components/Guardrails/components/policy-name-text.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/policy-name-text.js +18 -0
- package/dist/canvas/components/Guardrails/definitions-enrich.cjs +7 -0
- package/dist/canvas/components/Guardrails/definitions-enrich.d.ts +5 -0
- package/dist/canvas/components/Guardrails/definitions-enrich.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/definitions-enrich.js +5 -1
- package/dist/canvas/components/Guardrails/definitions-parse.cjs +1 -0
- package/dist/canvas/components/Guardrails/definitions-parse.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/definitions-parse.js +1 -0
- package/dist/canvas/components/Guardrails/definitions-wire.d.ts +1 -0
- package/dist/canvas/components/Guardrails/definitions-wire.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/guardrail-builder.cjs +10 -1
- package/dist/canvas/components/Guardrails/guardrail-builder.d.ts +2 -1
- package/dist/canvas/components/Guardrails/guardrail-builder.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/guardrail-builder.js +10 -1
- package/dist/canvas/components/Guardrails/guardrail-list-utils.cjs +6 -3
- package/dist/canvas/components/Guardrails/guardrail-list-utils.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/guardrail-list-utils.js +4 -1
- package/dist/canvas/components/Guardrails/guardrail-list.cjs +2 -1
- package/dist/canvas/components/Guardrails/guardrail-list.d.ts +2 -1
- package/dist/canvas/components/Guardrails/guardrail-list.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/guardrail-list.js +2 -1
- package/dist/canvas/components/Guardrails/i18n.cjs +20 -0
- package/dist/canvas/components/Guardrails/i18n.d.ts +7 -3
- package/dist/canvas/components/Guardrails/i18n.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/i18n.js +20 -0
- package/dist/canvas/components/Guardrails/list-types.d.ts +2 -0
- package/dist/canvas/components/Guardrails/list-types.d.ts.map +1 -1
- package/dist/canvas/locales/en.cjs +1 -1
- package/dist/canvas/locales/en.d.ts.map +1 -1
- package/dist/canvas/locales/en.js +1 -1
- package/package.json +2 -2
|
@@ -81,6 +81,7 @@ export interface GuardrailDefinition {
|
|
|
81
81
|
allowedScopes: GuardrailScope[];
|
|
82
82
|
parameters: GuardrailParameterDefinition[];
|
|
83
83
|
status: GuardrailDefinitionStatus;
|
|
84
|
+
disabledReason?: string;
|
|
84
85
|
usageNote?: React.ReactNode;
|
|
85
86
|
fileSupport?: GuardrailFileSupport;
|
|
86
87
|
byoValidatorName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder-types.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/builder-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,SA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AK,KAAK,CAAC,SAAS,CAAC;IAMlF,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,+BAA+B,KAAK,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IAE9F,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,yBAAyB,KAAK,KAAK,CAAC,SAAS,CAAC;IAEtE,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAChC"}
|
|
@@ -31,20 +31,17 @@ const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
|
31
31
|
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
32
32
|
const external_centralized_guardrail_utils_cjs_namespaceObject = require("./centralized-guardrail-utils.cjs");
|
|
33
33
|
const centralized_guardrail_row_cjs_namespaceObject = require("./components/centralized-guardrail-row.cjs");
|
|
34
|
+
const policy_name_text_cjs_namespaceObject = require("./components/policy-name-text.cjs");
|
|
34
35
|
const external_definitions_copy_cjs_namespaceObject = require("./definitions-copy.cjs");
|
|
35
36
|
const external_i18n_cjs_namespaceObject = require("./i18n.cjs");
|
|
36
37
|
function PolicyCaption({ template, policyName }) {
|
|
37
|
-
|
|
38
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("p", {
|
|
38
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
|
|
39
39
|
className: "pl-6 text-xs text-muted-foreground",
|
|
40
40
|
"data-slot": "centralized-guardrails-policy",
|
|
41
|
-
children:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}),
|
|
46
|
-
after
|
|
47
|
-
]
|
|
41
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(policy_name_text_cjs_namespaceObject.PolicyNameText, {
|
|
42
|
+
template: template,
|
|
43
|
+
policyName: policyName
|
|
44
|
+
})
|
|
48
45
|
});
|
|
49
46
|
}
|
|
50
47
|
function CentralizedGuardrailsSection({ guardrails, policyName, definitions, onSelect, docsHref, formatScope, emptyState, unstyled = false, hideHeader = false, labels: labelOverrides, className }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"centralized-guardrails-section.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/centralized-guardrails-section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"centralized-guardrails-section.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/centralized-guardrails-section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AAIhG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAG1D,MAAM,WAAW,iCAAiC,CAChD,WAAW,SAAS,8BAA8B,GAAG,8BAA8B;IAGnF,UAAU,EAAE,oBAAoB,EAAE,CAAC;IAEnC,UAAU,EAAE,MAAM,CAAC;IAEnB,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;IAE5B,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAErD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,MAAM,CAAC;IAEhD,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAWD,wBAAgB,4BAA4B,CAC1C,WAAW,SAAS,8BAA8B,GAAG,8BAA8B,EACnF,EACA,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,UAAU,EACV,QAAgB,EAChB,UAAkB,EAClB,MAAM,EAAE,cAAc,EACtB,SAAS,GACV,EAAE,iCAAiC,CAAC,WAAW,CAAC,kDA2EhD"}
|
|
@@ -3,20 +3,17 @@ import { Button, HoverCard, HoverCardContent, HoverCardTrigger, cn } from "@uipa
|
|
|
3
3
|
import { Info, ShieldCheck } from "lucide-react";
|
|
4
4
|
import { findCentralizedByoDefinition, formatCentralizedScope, getCentralizedGuardrailDisplay, getCentralizedGuardrailItemId, isCentralizedGuardrailConfigMissing } from "./centralized-guardrail-utils.js";
|
|
5
5
|
import { CentralizedGuardrailRow } from "./components/centralized-guardrail-row.js";
|
|
6
|
+
import { PolicyNameText } from "./components/policy-name-text.js";
|
|
6
7
|
import { useGuardrailDefinitionCopy } from "./definitions-copy.js";
|
|
7
8
|
import { useCentralizedGuardrailsLabels } from "./i18n.js";
|
|
8
9
|
function PolicyCaption({ template, policyName }) {
|
|
9
|
-
|
|
10
|
-
return /*#__PURE__*/ jsxs("p", {
|
|
10
|
+
return /*#__PURE__*/ jsx("p", {
|
|
11
11
|
className: "pl-6 text-xs text-muted-foreground",
|
|
12
12
|
"data-slot": "centralized-guardrails-policy",
|
|
13
|
-
children:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}),
|
|
18
|
-
after
|
|
19
|
-
]
|
|
13
|
+
children: /*#__PURE__*/ jsx(PolicyNameText, {
|
|
14
|
+
template: template,
|
|
15
|
+
policyName: policyName
|
|
16
|
+
})
|
|
20
17
|
});
|
|
21
18
|
}
|
|
22
19
|
function CentralizedGuardrailsSection({ guardrails, policyName, definitions, onSelect, docsHref, formatScope, emptyState, unstyled = false, hideHeader = false, labels: labelOverrides, className }) {
|
|
@@ -33,7 +33,8 @@ const external_react_namespaceObject = require("react");
|
|
|
33
33
|
const external_guardrail_list_utils_cjs_namespaceObject = require("../guardrail-list-utils.cjs");
|
|
34
34
|
const external_i18n_cjs_namespaceObject = require("../i18n.cjs");
|
|
35
35
|
const external_guardrail_status_chip_cjs_namespaceObject = require("./guardrail-status-chip.cjs");
|
|
36
|
-
const
|
|
36
|
+
const external_policy_name_text_cjs_namespaceObject = require("./policy-name-text.cjs");
|
|
37
|
+
const GuardrailListRow = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ item, id, index, state, labels, disabled = false, handle, administration, statusChips = false, previewChip = false, byoChip = false, policyName, rowActivatesEdit = false, onEdit, onRemove, renderItemActions, renderRowTooltip, formatScopes, formatAction, className, ...props }, ref)=>{
|
|
37
38
|
const handleEdit = onEdit && !disabled ? ()=>onEdit(item) : void 0;
|
|
38
39
|
const handleRemove = onRemove && !disabled ? ()=>onRemove(item) : void 0;
|
|
39
40
|
const chips = statusChips ? (0, external_guardrail_list_utils_cjs_namespaceObject.getGuardrailListChips)({
|
|
@@ -41,6 +42,7 @@ const GuardrailListRow = /*#__PURE__*/ external_react_namespaceObject.forwardRef
|
|
|
41
42
|
administration
|
|
42
43
|
}, labels) : [];
|
|
43
44
|
const isBuiltInValidator = 'builtInValidator' === item.$guardrailType;
|
|
45
|
+
const namedPolicy = (0, external_policy_name_text_cjs_namespaceObject.nonBlankPolicyName)(policyName);
|
|
44
46
|
const rowName = item.name.trim();
|
|
45
47
|
const nameRow = (template, generic)=>rowName ? (0, external_i18n_cjs_namespaceObject.formatGuardrailFormMessage)(template, {
|
|
46
48
|
name: rowName
|
|
@@ -88,11 +90,13 @@ const GuardrailListRow = /*#__PURE__*/ external_react_namespaceObject.forwardRef
|
|
|
88
90
|
const chipId = (chip)=>`${bodyId}-chip-${chip}`;
|
|
89
91
|
const byoDisabledId = `${bodyId}-byo-disabled`;
|
|
90
92
|
const byoUnavailableId = `${bodyId}-byo-unavailable`;
|
|
93
|
+
const policyDisabledId = `${bodyId}-policy-disabled`;
|
|
91
94
|
const descriptionId = `${bodyId}-description`;
|
|
92
95
|
const describedBy = activatable ? [
|
|
93
96
|
...chips.map((chip)=>chipId(chip.id)),
|
|
94
97
|
state.byoDisabled ? byoDisabledId : void 0,
|
|
95
98
|
state.byoUnavailable ? byoUnavailableId : void 0,
|
|
99
|
+
state.policyDisabled ? policyDisabledId : void 0,
|
|
96
100
|
item.description ? descriptionId : void 0
|
|
97
101
|
].filter(Boolean).join(' ') : '';
|
|
98
102
|
const bodyProps = activatable ? {
|
|
@@ -150,6 +154,14 @@ const GuardrailListRow = /*#__PURE__*/ external_react_namespaceObject.forwardRef
|
|
|
150
154
|
role: "alert",
|
|
151
155
|
children: labels.byoUnavailableNotice
|
|
152
156
|
}),
|
|
157
|
+
state.policyDisabled && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
158
|
+
id: policyDisabledId,
|
|
159
|
+
className: "whitespace-normal break-words text-xs text-warning",
|
|
160
|
+
children: void 0 === namedPolicy ? labels.policyDisabledNotice : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_policy_name_text_cjs_namespaceObject.PolicyNameText, {
|
|
161
|
+
template: labels.policyDisabledNamedNotice,
|
|
162
|
+
policyName: namedPolicy
|
|
163
|
+
})
|
|
164
|
+
}),
|
|
153
165
|
item.description && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
154
166
|
id: descriptionId,
|
|
155
167
|
className: "truncate text-xs text-muted-foreground",
|
|
@@ -6,13 +6,14 @@ export interface GuardrailListRowProps extends Omit<React.ComponentPropsWithoutR
|
|
|
6
6
|
id: string;
|
|
7
7
|
index: number;
|
|
8
8
|
state: GuardrailListItemState;
|
|
9
|
-
labels: GuardrailListLabels
|
|
9
|
+
labels: Required<GuardrailListLabels>;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
handle?: React.ReactNode;
|
|
12
12
|
administration?: GuardrailListAdministration;
|
|
13
13
|
statusChips?: boolean;
|
|
14
14
|
previewChip?: boolean;
|
|
15
15
|
byoChip?: boolean;
|
|
16
|
+
policyName?: string;
|
|
16
17
|
rowActivatesEdit?: boolean;
|
|
17
18
|
onEdit?: (item: GuardrailListItem) => void;
|
|
18
19
|
onRemove?: (item: GuardrailListItem) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guardrail-list-row.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/guardrail-list-row.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA8B,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,KAAK,EACV,2BAA2B,EAC3B,iBAAiB,EACjB,+BAA+B,EAC/B,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"guardrail-list-row.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/guardrail-list-row.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA8B,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,KAAK,EACV,2BAA2B,EAC3B,iBAAiB,EACjB,+BAA+B,EAC/B,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC/D,IAAI,EAAE,iBAAiB,CAAC;IAExB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IAEd,KAAK,EAAE,sBAAsB,CAAC;IAC9B,MAAM,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IAEtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,cAAc,CAAC,EAAE,2BAA2B,CAAC;IAC7C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7C,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,+BAA+B,KAAK,KAAK,CAAC,SAAS,CAAC;IAE9E,gBAAgB,CAAC,EAAE,2BAA2B,CAAC;IAC/C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,KAAK,CAAC,SAAS,CAAC;IAC5D,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,KAAK,CAAC,SAAS,CAAC;CAC7D;AASD,QAAA,MAAM,gBAAgB,8FA2RrB,CAAC;AAGF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -5,7 +5,8 @@ import { forwardRef, useId } from "react";
|
|
|
5
5
|
import { getGuardrailListChips } from "../guardrail-list-utils.js";
|
|
6
6
|
import { formatGuardrailFormMessage } from "../i18n.js";
|
|
7
7
|
import { GuardrailStatusChip } from "./guardrail-status-chip.js";
|
|
8
|
-
|
|
8
|
+
import { PolicyNameText, nonBlankPolicyName } from "./policy-name-text.js";
|
|
9
|
+
const GuardrailListRow = /*#__PURE__*/ forwardRef(({ item, id, index, state, labels, disabled = false, handle, administration, statusChips = false, previewChip = false, byoChip = false, policyName, rowActivatesEdit = false, onEdit, onRemove, renderItemActions, renderRowTooltip, formatScopes, formatAction, className, ...props }, ref)=>{
|
|
9
10
|
const handleEdit = onEdit && !disabled ? ()=>onEdit(item) : void 0;
|
|
10
11
|
const handleRemove = onRemove && !disabled ? ()=>onRemove(item) : void 0;
|
|
11
12
|
const chips = statusChips ? getGuardrailListChips({
|
|
@@ -13,6 +14,7 @@ const GuardrailListRow = /*#__PURE__*/ forwardRef(({ item, id, index, state, lab
|
|
|
13
14
|
administration
|
|
14
15
|
}, labels) : [];
|
|
15
16
|
const isBuiltInValidator = 'builtInValidator' === item.$guardrailType;
|
|
17
|
+
const namedPolicy = nonBlankPolicyName(policyName);
|
|
16
18
|
const rowName = item.name.trim();
|
|
17
19
|
const nameRow = (template, generic)=>rowName ? formatGuardrailFormMessage(template, {
|
|
18
20
|
name: rowName
|
|
@@ -60,11 +62,13 @@ const GuardrailListRow = /*#__PURE__*/ forwardRef(({ item, id, index, state, lab
|
|
|
60
62
|
const chipId = (chip)=>`${bodyId}-chip-${chip}`;
|
|
61
63
|
const byoDisabledId = `${bodyId}-byo-disabled`;
|
|
62
64
|
const byoUnavailableId = `${bodyId}-byo-unavailable`;
|
|
65
|
+
const policyDisabledId = `${bodyId}-policy-disabled`;
|
|
63
66
|
const descriptionId = `${bodyId}-description`;
|
|
64
67
|
const describedBy = activatable ? [
|
|
65
68
|
...chips.map((chip)=>chipId(chip.id)),
|
|
66
69
|
state.byoDisabled ? byoDisabledId : void 0,
|
|
67
70
|
state.byoUnavailable ? byoUnavailableId : void 0,
|
|
71
|
+
state.policyDisabled ? policyDisabledId : void 0,
|
|
68
72
|
item.description ? descriptionId : void 0
|
|
69
73
|
].filter(Boolean).join(' ') : '';
|
|
70
74
|
const bodyProps = activatable ? {
|
|
@@ -122,6 +126,14 @@ const GuardrailListRow = /*#__PURE__*/ forwardRef(({ item, id, index, state, lab
|
|
|
122
126
|
role: "alert",
|
|
123
127
|
children: labels.byoUnavailableNotice
|
|
124
128
|
}),
|
|
129
|
+
state.policyDisabled && /*#__PURE__*/ jsx("div", {
|
|
130
|
+
id: policyDisabledId,
|
|
131
|
+
className: "whitespace-normal break-words text-xs text-warning",
|
|
132
|
+
children: void 0 === namedPolicy ? labels.policyDisabledNotice : /*#__PURE__*/ jsx(PolicyNameText, {
|
|
133
|
+
template: labels.policyDisabledNamedNotice,
|
|
134
|
+
policyName: namedPolicy
|
|
135
|
+
})
|
|
136
|
+
}),
|
|
125
137
|
item.description && /*#__PURE__*/ jsx("div", {
|
|
126
138
|
id: descriptionId,
|
|
127
139
|
className: "truncate text-xs text-muted-foreground",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
export interface GuardrailStatusBannerProps {
|
|
2
3
|
tone: 'error' | 'warning';
|
|
3
|
-
message:
|
|
4
|
+
message: ReactNode;
|
|
4
5
|
}
|
|
5
6
|
export declare function GuardrailStatusBanner({ tone, message }: GuardrailStatusBannerProps): import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
//# sourceMappingURL=guardrail-status-banner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guardrail-status-banner.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/guardrail-status-banner.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"guardrail-status-banner.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/guardrail-status-banner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAE1B,OAAO,EAAE,SAAS,CAAC;CACpB;AASD,wBAAgB,qBAAqB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,0BAA0B,2CAiBlF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
nonBlankPolicyName: ()=>nonBlankPolicyName,
|
|
28
|
+
PolicyNameText: ()=>PolicyNameText
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const POLICY_NAME_TOKEN = '{{policyName}}';
|
|
32
|
+
function nonBlankPolicyName(policyName) {
|
|
33
|
+
return void 0 !== policyName && '' !== policyName.trim() ? policyName : void 0;
|
|
34
|
+
}
|
|
35
|
+
function PolicyNameText({ template, policyName }) {
|
|
36
|
+
const [before, after] = template.split(POLICY_NAME_TOKEN);
|
|
37
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
38
|
+
children: [
|
|
39
|
+
before,
|
|
40
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("em", {
|
|
41
|
+
children: policyName
|
|
42
|
+
}),
|
|
43
|
+
after
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
exports.PolicyNameText = __webpack_exports__.PolicyNameText;
|
|
48
|
+
exports.nonBlankPolicyName = __webpack_exports__.nonBlankPolicyName;
|
|
49
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
50
|
+
"PolicyNameText",
|
|
51
|
+
"nonBlankPolicyName"
|
|
52
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
53
|
+
Object.defineProperty(exports, '__esModule', {
|
|
54
|
+
value: true
|
|
55
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface PolicyNameTextProps {
|
|
2
|
+
template: string;
|
|
3
|
+
policyName: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function nonBlankPolicyName(policyName: string | undefined): string | undefined;
|
|
6
|
+
export declare function PolicyNameText({ template, policyName }: PolicyNameTextProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=policy-name-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-name-text.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/policy-name-text.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAElC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAMD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAErF;AAOD,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,mBAAmB,2CAU3E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
const POLICY_NAME_TOKEN = '{{policyName}}';
|
|
3
|
+
function nonBlankPolicyName(policyName) {
|
|
4
|
+
return void 0 !== policyName && '' !== policyName.trim() ? policyName : void 0;
|
|
5
|
+
}
|
|
6
|
+
function PolicyNameText({ template, policyName }) {
|
|
7
|
+
const [before, after] = template.split(POLICY_NAME_TOKEN);
|
|
8
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
9
|
+
children: [
|
|
10
|
+
before,
|
|
11
|
+
/*#__PURE__*/ jsx("em", {
|
|
12
|
+
children: policyName
|
|
13
|
+
}),
|
|
14
|
+
after
|
|
15
|
+
]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export { PolicyNameText, nonBlankPolicyName };
|
|
@@ -26,6 +26,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
27
|
enrichGuardrailDefinitions: ()=>enrichGuardrailDefinitions,
|
|
28
28
|
withGuardrailFolderMetadata: ()=>withGuardrailFolderMetadata,
|
|
29
|
+
isPolicyDisabledGuardrailDefinition: ()=>isPolicyDisabledGuardrailDefinition,
|
|
29
30
|
humanizeGuardrailParameterId: ()=>humanizeGuardrailParameterId,
|
|
30
31
|
isByoGuardrailDefinition: ()=>isByoGuardrailDefinition
|
|
31
32
|
});
|
|
@@ -33,6 +34,9 @@ const external_definitions_copy_cjs_namespaceObject = require("./definitions-cop
|
|
|
33
34
|
function isByoGuardrailDefinition(definition) {
|
|
34
35
|
return void 0 !== definition.byoValidatorName;
|
|
35
36
|
}
|
|
37
|
+
function isPolicyDisabledGuardrailDefinition(definition) {
|
|
38
|
+
return 'Disabled' === definition.status && 'Policy' === definition.disabledReason && !isByoGuardrailDefinition(definition);
|
|
39
|
+
}
|
|
36
40
|
function humanizeGuardrailParameterId(id) {
|
|
37
41
|
const words = [];
|
|
38
42
|
let word = '';
|
|
@@ -130,6 +134,7 @@ function enrichOne(wire, copy) {
|
|
|
130
134
|
parameters: wire.parameters.map((param)=>toParameterDefinition(param, curated)),
|
|
131
135
|
status: wire.status
|
|
132
136
|
};
|
|
137
|
+
if (void 0 !== wire.disabledReason) enriched.disabledReason = wire.disabledReason;
|
|
133
138
|
if (curated?.usageNote !== void 0) enriched.usageNote = curated.usageNote;
|
|
134
139
|
if (void 0 !== wire.byoValidatorName) enriched.byoValidatorName = wire.byoValidatorName;
|
|
135
140
|
if (void 0 !== wire.byoConnectorName) enriched.byoConnectorName = wire.byoConnectorName;
|
|
@@ -164,11 +169,13 @@ function withGuardrailFolderMetadata(definitions, resolve) {
|
|
|
164
169
|
exports.enrichGuardrailDefinitions = __webpack_exports__.enrichGuardrailDefinitions;
|
|
165
170
|
exports.humanizeGuardrailParameterId = __webpack_exports__.humanizeGuardrailParameterId;
|
|
166
171
|
exports.isByoGuardrailDefinition = __webpack_exports__.isByoGuardrailDefinition;
|
|
172
|
+
exports.isPolicyDisabledGuardrailDefinition = __webpack_exports__.isPolicyDisabledGuardrailDefinition;
|
|
167
173
|
exports.withGuardrailFolderMetadata = __webpack_exports__.withGuardrailFolderMetadata;
|
|
168
174
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
169
175
|
"enrichGuardrailDefinitions",
|
|
170
176
|
"humanizeGuardrailParameterId",
|
|
171
177
|
"isByoGuardrailDefinition",
|
|
178
|
+
"isPolicyDisabledGuardrailDefinition",
|
|
172
179
|
"withGuardrailFolderMetadata"
|
|
173
180
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
174
181
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -20,6 +20,11 @@ export declare function isByoGuardrailDefinition<T extends {
|
|
|
20
20
|
}>(definition: T): definition is T & {
|
|
21
21
|
byoValidatorName: string;
|
|
22
22
|
};
|
|
23
|
+
export declare function isPolicyDisabledGuardrailDefinition(definition: {
|
|
24
|
+
status: GuardrailDefinitionWire['status'];
|
|
25
|
+
disabledReason?: string;
|
|
26
|
+
byoValidatorName?: string;
|
|
27
|
+
}): boolean;
|
|
23
28
|
export declare function humanizeGuardrailParameterId(id: string): string;
|
|
24
29
|
export declare function enrichGuardrailDefinitions(definitions: readonly GuardrailDefinitionWire[], options?: EnrichGuardrailDefinitionsOptions): EnrichedGuardrailDefinition[];
|
|
25
30
|
export interface GuardrailFolderMetadata {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions-enrich.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/definitions-enrich.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,uBAAuB,EAAoC,MAAM,oBAAoB,CAAC;AAcpG,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IAEtE,WAAW,EAAE,MAAM,CAAC;IAEpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iCAAiC;IAKhD,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAM1B,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAGD,wBAAgB,wBAAwB,CAAC,CAAC,SAAS;IAAE,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,EAC9E,UAAU,EAAE,CAAC,GACZ,UAAU,IAAI,CAAC,GAAG;IAAE,gBAAgB,EAAE,MAAM,CAAA;CAAE,CAEhD;AAOD,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CA4C/D;
|
|
1
|
+
{"version":3,"file":"definitions-enrich.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/definitions-enrich.ts"],"names":[],"mappings":"AA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BAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAOD,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,2BAA2B,EAC/E,WAAW,EAAE,SAAS,CAAC,EAAE,EACzB,OAAO,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,uBAAuB,GAAG,SAAS,GACrE,CAAC,EAAE,CAWL"}
|
|
@@ -2,6 +2,9 @@ import { GUARDRAIL_COPY_EN } from "./definitions-copy.js";
|
|
|
2
2
|
function isByoGuardrailDefinition(definition) {
|
|
3
3
|
return void 0 !== definition.byoValidatorName;
|
|
4
4
|
}
|
|
5
|
+
function isPolicyDisabledGuardrailDefinition(definition) {
|
|
6
|
+
return 'Disabled' === definition.status && 'Policy' === definition.disabledReason && !isByoGuardrailDefinition(definition);
|
|
7
|
+
}
|
|
5
8
|
function humanizeGuardrailParameterId(id) {
|
|
6
9
|
const words = [];
|
|
7
10
|
let word = '';
|
|
@@ -99,6 +102,7 @@ function enrichOne(wire, copy) {
|
|
|
99
102
|
parameters: wire.parameters.map((param)=>toParameterDefinition(param, curated)),
|
|
100
103
|
status: wire.status
|
|
101
104
|
};
|
|
105
|
+
if (void 0 !== wire.disabledReason) enriched.disabledReason = wire.disabledReason;
|
|
102
106
|
if (curated?.usageNote !== void 0) enriched.usageNote = curated.usageNote;
|
|
103
107
|
if (void 0 !== wire.byoValidatorName) enriched.byoValidatorName = wire.byoValidatorName;
|
|
104
108
|
if (void 0 !== wire.byoConnectorName) enriched.byoConnectorName = wire.byoConnectorName;
|
|
@@ -130,4 +134,4 @@ function withGuardrailFolderMetadata(definitions, resolve) {
|
|
|
130
134
|
return next;
|
|
131
135
|
});
|
|
132
136
|
}
|
|
133
|
-
export { enrichGuardrailDefinitions, humanizeGuardrailParameterId, isByoGuardrailDefinition, withGuardrailFolderMetadata };
|
|
137
|
+
export { enrichGuardrailDefinitions, humanizeGuardrailParameterId, isByoGuardrailDefinition, isPolicyDisabledGuardrailDefinition, withGuardrailFolderMetadata };
|
|
@@ -120,6 +120,7 @@ const definitionSchema = external_zod_namespaceObject.z.object({
|
|
|
120
120
|
'Unauthorised',
|
|
121
121
|
'Disabled'
|
|
122
122
|
]),
|
|
123
|
+
disabledReason: external_zod_namespaceObject.z.string().optional(),
|
|
123
124
|
displayName: emptyToUndefined,
|
|
124
125
|
description: emptyToUndefined,
|
|
125
126
|
byoConnectorName: emptyToUndefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions-parse.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/definitions-parse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"definitions-parse.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/definitions-parse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AA2JlE,MAAM,WAAW,6BAA6B;IAE5C,KAAK,EAAE,MAAM,CAAC;IAEd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,+BAA+B;IAE9C,WAAW,EAAE,uBAAuB,EAAE,CAAC;IAEvC,OAAO,EAAE,6BAA6B,EAAE,CAAC;IAEzC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAyCD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,+BAA+B,CA2CzF"}
|
|
@@ -47,6 +47,7 @@ export interface GuardrailDefinitionWire {
|
|
|
47
47
|
allowedScopes: GuardrailScope[];
|
|
48
48
|
parameters: GuardrailParameterDefinitionWire[];
|
|
49
49
|
status: GuardrailDefinitionStatus;
|
|
50
|
+
disabledReason?: string;
|
|
50
51
|
displayName?: string;
|
|
51
52
|
description?: string;
|
|
52
53
|
byoConnectorName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions-wire.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/definitions-wire.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAejF,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,CAAC;IAElB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAGD,MAAM,MAAM,gCAAgC,GACxC,CAAC,0BAA0B,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC,CAAC,GACF,CAAC,0BAA0B,GAAG;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEtC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC,GACF,CAAC,0BAA0B,GAAG;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAErC,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC,GACF,CAAC,0BAA0B,GAAG;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC,GACF,CAAC,0BAA0B,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC,GACF,CAAC,0BAA0B,GAAG;IAC5B,IAAI,EAAE,WAAW,CAAC;IAElB,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC,GACF,CAAC,0BAA0B,GAAG;IAC5B,IAAI,EAAE,SAAS,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC,CAAC;AAGP,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,cAAc,EAAE,CAAC;IAChC,UAAU,EAAE,gCAAgC,EAAE,CAAC;IAC/C,MAAM,EAAE,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"definitions-wire.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/definitions-wire.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAejF,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,CAAC;IAElB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAGD,MAAM,MAAM,gCAAgC,GACxC,CAAC,0BAA0B,GAAG;IAC5B,IAAI,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AAE,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC,GACF,CAAC,0BAA0B,GAAG;IAC5B,IAAI,EAAE,SAAS,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC,CAAC;AAGP,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,cAAc,EAAE,CAAC;IAChC,UAAU,EAAE,gCAAgC,EAAE,CAAC;IAC/C,MAAM,EAAE,yBAAyB,CAAC;IAElC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAM5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -39,6 +39,8 @@ const guardrail_name_fields_cjs_namespaceObject = require("./components/guardrai
|
|
|
39
39
|
const guardrail_scope_selector_cjs_namespaceObject = require("./components/guardrail-scope-selector.cjs");
|
|
40
40
|
const guardrail_status_banner_cjs_namespaceObject = require("./components/guardrail-status-banner.cjs");
|
|
41
41
|
const mixed_scopes_banner_cjs_namespaceObject = require("./components/mixed-scopes-banner.cjs");
|
|
42
|
+
const policy_name_text_cjs_namespaceObject = require("./components/policy-name-text.cjs");
|
|
43
|
+
const external_definitions_enrich_cjs_namespaceObject = require("./definitions-enrich.cjs");
|
|
42
44
|
const external_guardrail_form_layout_cjs_namespaceObject = require("./guardrail-form-layout.cjs");
|
|
43
45
|
const external_guardrail_validator_form_cjs_namespaceObject = require("./guardrail-validator-form.cjs");
|
|
44
46
|
const external_i18n_cjs_namespaceObject = require("./i18n.cjs");
|
|
@@ -54,7 +56,7 @@ const BUILDER_ERROR_MERGES = {
|
|
|
54
56
|
})
|
|
55
57
|
}
|
|
56
58
|
};
|
|
57
|
-
function GuardrailBuilder({ open, definition, scope, guardrail, defaultName, existingNames, toolName, availableToolNames, lockSingleScope, onSave, onCancel, onSaveAsNew, otherAppliedScopes = null, inline = false, hideHeader = false, dialogMaxWidth, title, byoDisplay = false, providerField = false, evalsTogglePlacement = 'form', allowedActionTypes, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp, recipientTypeDisabled, errors: hostErrors, renderParameter, overrideParameterIds, saveDisabled: hostSaveDisabled = false, labels: labelOverrides, className }) {
|
|
59
|
+
function GuardrailBuilder({ open, definition, scope, guardrail, defaultName, existingNames, toolName, availableToolNames, lockSingleScope, onSave, onCancel, onSaveAsNew, otherAppliedScopes = null, inline = false, hideHeader = false, dialogMaxWidth, title, byoDisplay = false, providerField = false, policyName, evalsTogglePlacement = 'form', allowedActionTypes, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp, recipientTypeDisabled, errors: hostErrors, renderParameter, overrideParameterIds, saveDisabled: hostSaveDisabled = false, labels: labelOverrides, className }) {
|
|
58
60
|
const labels = (0, external_i18n_cjs_namespaceObject.useGuardrailBuilderLabels)(labelOverrides);
|
|
59
61
|
const uid = (0, external_react_namespaceObject.useId)();
|
|
60
62
|
const [formData, setFormData] = (0, external_react_namespaceObject.useState)(()=>{
|
|
@@ -179,9 +181,16 @@ function GuardrailBuilder({ open, definition, scope, guardrail, defaultName, exi
|
|
|
179
181
|
const computedTitle = (0, external_i18n_cjs_namespaceObject.formatGuardrailFormMessage)(guardrail ? labels.editTitle : labels.addTitle, {
|
|
180
182
|
name: titleName
|
|
181
183
|
});
|
|
184
|
+
const namedPolicy = (0, policy_name_text_cjs_namespaceObject.nonBlankPolicyName)(policyName);
|
|
182
185
|
const statusBanner = isByoConfigurationDisabled ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(guardrail_status_banner_cjs_namespaceObject.GuardrailStatusBanner, {
|
|
183
186
|
tone: "error",
|
|
184
187
|
message: labels.byoDisabledMessage
|
|
188
|
+
}) : (0, external_definitions_enrich_cjs_namespaceObject.isPolicyDisabledGuardrailDefinition)(definition) ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(guardrail_status_banner_cjs_namespaceObject.GuardrailStatusBanner, {
|
|
189
|
+
tone: "warning",
|
|
190
|
+
message: void 0 === namedPolicy ? labels.policyDisabledMessage : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(policy_name_text_cjs_namespaceObject.PolicyNameText, {
|
|
191
|
+
template: labels.policyDisabledNamedMessage,
|
|
192
|
+
policyName: namedPolicy
|
|
193
|
+
})
|
|
185
194
|
}) : 'Unauthorised' === definition.status ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(guardrail_status_banner_cjs_namespaceObject.GuardrailStatusBanner, {
|
|
186
195
|
tone: "warning",
|
|
187
196
|
message: labels.unauthorizedMessage
|
|
@@ -25,6 +25,7 @@ export interface GuardrailBuilderProps {
|
|
|
25
25
|
title?: ReactNode;
|
|
26
26
|
byoDisplay?: boolean;
|
|
27
27
|
providerField?: boolean;
|
|
28
|
+
policyName?: string;
|
|
28
29
|
evalsTogglePlacement?: 'form' | 'footer';
|
|
29
30
|
allowedActionTypes?: ReadonlyArray<Exclude<GuardrailAction['$actionType'], 'filter'>>;
|
|
30
31
|
renderRecipientSearch?: (ctx: GuardrailRecipientSearchContext) => ReactNode;
|
|
@@ -39,7 +40,7 @@ export interface GuardrailBuilderProps {
|
|
|
39
40
|
labels?: Partial<GuardrailBuilderLabels>;
|
|
40
41
|
className?: string;
|
|
41
42
|
}
|
|
42
|
-
export declare function GuardrailBuilder({ open, definition, scope, guardrail, defaultName, existingNames, toolName, availableToolNames, lockSingleScope, onSave, onCancel, onSaveAsNew, otherAppliedScopes, inline, hideHeader, dialogMaxWidth, title, byoDisplay, providerField, evalsTogglePlacement, allowedActionTypes, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp, recipientTypeDisabled, errors: hostErrors, renderParameter, overrideParameterIds, saveDisabled: hostSaveDisabled, labels: labelOverrides, className, }: GuardrailBuilderProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export declare function GuardrailBuilder({ open, definition, scope, guardrail, defaultName, existingNames, toolName, availableToolNames, lockSingleScope, onSave, onCancel, onSaveAsNew, otherAppliedScopes, inline, hideHeader, dialogMaxWidth, title, byoDisplay, providerField, policyName, evalsTogglePlacement, allowedActionTypes, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp, recipientTypeDisabled, errors: hostErrors, renderParameter, overrideParameterIds, saveDisabled: hostSaveDisabled, labels: labelOverrides, className, }: GuardrailBuilderProps): import("react/jsx-runtime").JSX.Element;
|
|
43
44
|
export declare namespace GuardrailBuilder {
|
|
44
45
|
var displayName: string;
|
|
45
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guardrail-builder.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/guardrail-builder.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,SAAS,EAA4D,MAAM,OAAO,CAAC;AACjG,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,KAAK,cAAc,EAEnB,KAAK,+BAA+B,EACrC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"guardrail-builder.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/guardrail-builder.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,SAAS,EAA4D,MAAM,OAAO,CAAC;AACjG,OAAO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,SAAS,GACV,EAAE,qBAAqB,2CAgYvB;yBAlae,gBAAgB"}
|
|
@@ -11,6 +11,8 @@ import { GuardrailNameFields } from "./components/guardrail-name-fields.js";
|
|
|
11
11
|
import { GuardrailScopeSelector } from "./components/guardrail-scope-selector.js";
|
|
12
12
|
import { GuardrailStatusBanner } from "./components/guardrail-status-banner.js";
|
|
13
13
|
import { MixedScopesBanner } from "./components/mixed-scopes-banner.js";
|
|
14
|
+
import { PolicyNameText, nonBlankPolicyName } from "./components/policy-name-text.js";
|
|
15
|
+
import { isPolicyDisabledGuardrailDefinition } from "./definitions-enrich.js";
|
|
14
16
|
import { GuardrailFormLayout } from "./guardrail-form-layout.js";
|
|
15
17
|
import { GuardrailValidatorForm } from "./guardrail-validator-form.js";
|
|
16
18
|
import { formatGuardrailFormMessage, useGuardrailBuilderLabels } from "./i18n.js";
|
|
@@ -26,7 +28,7 @@ const BUILDER_ERROR_MERGES = {
|
|
|
26
28
|
})
|
|
27
29
|
}
|
|
28
30
|
};
|
|
29
|
-
function GuardrailBuilder({ open, definition, scope, guardrail, defaultName, existingNames, toolName, availableToolNames, lockSingleScope, onSave, onCancel, onSaveAsNew, otherAppliedScopes = null, inline = false, hideHeader = false, dialogMaxWidth, title, byoDisplay = false, providerField = false, evalsTogglePlacement = 'form', allowedActionTypes, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp, recipientTypeDisabled, errors: hostErrors, renderParameter, overrideParameterIds, saveDisabled: hostSaveDisabled = false, labels: labelOverrides, className }) {
|
|
31
|
+
function GuardrailBuilder({ open, definition, scope, guardrail, defaultName, existingNames, toolName, availableToolNames, lockSingleScope, onSave, onCancel, onSaveAsNew, otherAppliedScopes = null, inline = false, hideHeader = false, dialogMaxWidth, title, byoDisplay = false, providerField = false, policyName, evalsTogglePlacement = 'form', allowedActionTypes, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp, recipientTypeDisabled, errors: hostErrors, renderParameter, overrideParameterIds, saveDisabled: hostSaveDisabled = false, labels: labelOverrides, className }) {
|
|
30
32
|
const labels = useGuardrailBuilderLabels(labelOverrides);
|
|
31
33
|
const uid = useId();
|
|
32
34
|
const [formData, setFormData] = useState(()=>{
|
|
@@ -151,9 +153,16 @@ function GuardrailBuilder({ open, definition, scope, guardrail, defaultName, exi
|
|
|
151
153
|
const computedTitle = formatGuardrailFormMessage(guardrail ? labels.editTitle : labels.addTitle, {
|
|
152
154
|
name: titleName
|
|
153
155
|
});
|
|
156
|
+
const namedPolicy = nonBlankPolicyName(policyName);
|
|
154
157
|
const statusBanner = isByoConfigurationDisabled ? /*#__PURE__*/ jsx(GuardrailStatusBanner, {
|
|
155
158
|
tone: "error",
|
|
156
159
|
message: labels.byoDisabledMessage
|
|
160
|
+
}) : isPolicyDisabledGuardrailDefinition(definition) ? /*#__PURE__*/ jsx(GuardrailStatusBanner, {
|
|
161
|
+
tone: "warning",
|
|
162
|
+
message: void 0 === namedPolicy ? labels.policyDisabledMessage : /*#__PURE__*/ jsx(PolicyNameText, {
|
|
163
|
+
template: labels.policyDisabledNamedMessage,
|
|
164
|
+
policyName: namedPolicy
|
|
165
|
+
})
|
|
157
166
|
}) : 'Unauthorised' === definition.status ? /*#__PURE__*/ jsx(GuardrailStatusBanner, {
|
|
158
167
|
tone: "warning",
|
|
159
168
|
message: labels.unauthorizedMessage
|
|
@@ -24,11 +24,12 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
getGuardrailListChips: ()=>getGuardrailListChips,
|
|
28
|
-
getGuardrailListItemId: ()=>getGuardrailListItemId,
|
|
29
27
|
matchesGuardrailListDefinition: ()=>matchesGuardrailListDefinition,
|
|
28
|
+
getGuardrailListItemId: ()=>getGuardrailListItemId,
|
|
29
|
+
getGuardrailListChips: ()=>getGuardrailListChips,
|
|
30
30
|
resolveGuardrailListItemState: ()=>resolveGuardrailListItemState
|
|
31
31
|
});
|
|
32
|
+
const external_definitions_enrich_cjs_namespaceObject = require("./definitions-enrich.cjs");
|
|
32
33
|
function getGuardrailListItemId(item) {
|
|
33
34
|
return item.id ?? item.name;
|
|
34
35
|
}
|
|
@@ -40,13 +41,15 @@ function resolveGuardrailListItemState(item, definitions = []) {
|
|
|
40
41
|
const definition = definitions.find((candidate)=>matchesGuardrailListDefinition(candidate, item));
|
|
41
42
|
const byoUnavailable = isByo && definitions.length > 0 && void 0 === definition;
|
|
42
43
|
const byoDisabled = isByo && definition?.status === 'Disabled';
|
|
44
|
+
const policyDisabled = void 0 !== definition && (0, external_definitions_enrich_cjs_namespaceObject.isPolicyDisabledGuardrailDefinition)(definition);
|
|
43
45
|
return {
|
|
44
46
|
definition,
|
|
45
47
|
status: byoUnavailable ? 'Unavailable' : definition?.status,
|
|
46
48
|
isByo,
|
|
47
49
|
provider: definition?.byoConnectorName,
|
|
48
50
|
byoDisabled,
|
|
49
|
-
byoUnavailable
|
|
51
|
+
byoUnavailable,
|
|
52
|
+
policyDisabled
|
|
50
53
|
};
|
|
51
54
|
}
|
|
52
55
|
function getGuardrailListChips(input, labels) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guardrail-list-utils.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/guardrail-list-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"guardrail-list-utils.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/guardrail-list-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,KAAK,EACV,2BAA2B,EAC3B,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,cAAc,CAAC;AAMtB,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAEtE;AAMD,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,uBAAuB,EACnC,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAIT;AAOD,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,iBAAiB,EACvB,WAAW,GAAE,SAAS,uBAAuB,EAAO,GACnD,sBAAsB,CAoBxB;AAMD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE;IACL,MAAM,CAAC,EAAE,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAC1C,cAAc,CAAC,EAAE,2BAA2B,CAAC;CAC9C,EACD,MAAM,EAAE,mBAAmB,GAC1B,iBAAiB,EAAE,CAwBrB"}
|