@uipath/apollo-react 6.48.0 → 6.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/canvas/components/Guardrails/__fixtures__/catalog-coverage.d.ts +8 -0
  2. package/dist/canvas/components/Guardrails/__fixtures__/catalog-coverage.d.ts.map +1 -0
  3. package/dist/canvas/components/Guardrails/__fixtures__/definitions-wire.fixtures.d.ts +13 -0
  4. package/dist/canvas/components/Guardrails/__fixtures__/definitions-wire.fixtures.d.ts.map +1 -0
  5. package/dist/canvas/components/Guardrails/__fixtures__/dnd-geometry.d.ts +3 -0
  6. package/dist/canvas/components/Guardrails/__fixtures__/dnd-geometry.d.ts.map +1 -0
  7. package/dist/canvas/components/Guardrails/__fixtures__/guardrail-list.fixtures.d.ts +9 -0
  8. package/dist/canvas/components/Guardrails/__fixtures__/guardrail-list.fixtures.d.ts.map +1 -0
  9. package/dist/canvas/components/Guardrails/__fixtures__/host-copy-baselines.d.ts +4 -0
  10. package/dist/canvas/components/Guardrails/__fixtures__/host-copy-baselines.d.ts.map +1 -0
  11. package/dist/canvas/components/Guardrails/builder-types.d.ts.map +1 -1
  12. package/dist/canvas/components/Guardrails/components/guardrail-chip.cjs +5 -1
  13. package/dist/canvas/components/Guardrails/components/guardrail-chip.d.ts +1 -0
  14. package/dist/canvas/components/Guardrails/components/guardrail-chip.d.ts.map +1 -1
  15. package/dist/canvas/components/Guardrails/components/guardrail-chip.js +3 -2
  16. package/dist/canvas/components/Guardrails/components/guardrail-list-row.cjs +218 -0
  17. package/dist/canvas/components/Guardrails/components/guardrail-list-row.d.ts +26 -0
  18. package/dist/canvas/components/Guardrails/components/guardrail-list-row.d.ts.map +1 -0
  19. package/dist/canvas/components/Guardrails/components/guardrail-list-row.js +184 -0
  20. package/dist/canvas/components/Guardrails/components/guardrail-status-banner.cjs +2 -0
  21. package/dist/canvas/components/Guardrails/components/guardrail-status-banner.d.ts.map +1 -1
  22. package/dist/canvas/components/Guardrails/components/guardrail-status-banner.js +2 -0
  23. package/dist/canvas/components/Guardrails/components/guardrail-status-chip.cjs +60 -0
  24. package/dist/canvas/components/Guardrails/components/guardrail-status-chip.d.ts +7 -0
  25. package/dist/canvas/components/Guardrails/components/guardrail-status-chip.d.ts.map +1 -0
  26. package/dist/canvas/components/Guardrails/components/guardrail-status-chip.js +26 -0
  27. package/dist/canvas/components/Guardrails/components/mixed-scopes-banner.cjs +1 -0
  28. package/dist/canvas/components/Guardrails/components/mixed-scopes-banner.d.ts.map +1 -1
  29. package/dist/canvas/components/Guardrails/components/mixed-scopes-banner.js +1 -0
  30. package/dist/canvas/components/Guardrails/definitions-copy.cjs +369 -0
  31. package/dist/canvas/components/Guardrails/definitions-copy.d.ts +14 -0
  32. package/dist/canvas/components/Guardrails/definitions-copy.d.ts.map +1 -0
  33. package/dist/canvas/components/Guardrails/definitions-copy.js +326 -0
  34. package/dist/canvas/components/Guardrails/definitions-enrich.cjs +173 -0
  35. package/dist/canvas/components/Guardrails/definitions-enrich.d.ts +30 -0
  36. package/dist/canvas/components/Guardrails/definitions-enrich.d.ts.map +1 -0
  37. package/dist/canvas/components/Guardrails/definitions-enrich.js +130 -0
  38. package/dist/canvas/components/Guardrails/definitions-parse.cjs +199 -0
  39. package/dist/canvas/components/Guardrails/definitions-parse.d.ts +13 -0
  40. package/dist/canvas/components/Guardrails/definitions-parse.d.ts.map +1 -0
  41. package/dist/canvas/components/Guardrails/definitions-parse.js +165 -0
  42. package/dist/canvas/components/Guardrails/definitions-wire.cjs +18 -0
  43. package/dist/canvas/components/Guardrails/definitions-wire.d.ts +59 -0
  44. package/dist/canvas/components/Guardrails/definitions-wire.d.ts.map +1 -0
  45. package/dist/canvas/components/Guardrails/definitions-wire.js +0 -0
  46. package/dist/canvas/components/Guardrails/guardrail-list-utils.cjs +103 -0
  47. package/dist/canvas/components/Guardrails/guardrail-list-utils.d.ts +10 -0
  48. package/dist/canvas/components/Guardrails/guardrail-list-utils.d.ts.map +1 -0
  49. package/dist/canvas/components/Guardrails/guardrail-list-utils.js +60 -0
  50. package/dist/canvas/components/Guardrails/guardrail-list.cjs +214 -0
  51. package/dist/canvas/components/Guardrails/guardrail-list.d.ts +33 -0
  52. package/dist/canvas/components/Guardrails/guardrail-list.d.ts.map +1 -0
  53. package/dist/canvas/components/Guardrails/guardrail-list.js +180 -0
  54. package/dist/canvas/components/Guardrails/i18n.cjs +124 -16
  55. package/dist/canvas/components/Guardrails/i18n.d.ts +25 -0
  56. package/dist/canvas/components/Guardrails/i18n.d.ts.map +1 -1
  57. package/dist/canvas/components/Guardrails/i18n.js +110 -14
  58. package/dist/canvas/components/Guardrails/index.cjs +85 -7
  59. package/dist/canvas/components/Guardrails/index.d.ts +21 -2
  60. package/dist/canvas/components/Guardrails/index.d.ts.map +1 -1
  61. package/dist/canvas/components/Guardrails/index.js +11 -2
  62. package/dist/canvas/components/Guardrails/list-types.cjs +18 -0
  63. package/dist/canvas/components/Guardrails/list-types.d.ts +51 -0
  64. package/dist/canvas/components/Guardrails/list-types.d.ts.map +1 -0
  65. package/dist/canvas/components/Guardrails/list-types.js +0 -0
  66. package/dist/canvas/components/Guardrails/types.d.ts.map +1 -1
  67. package/dist/canvas/components/Guardrails/use-guardrail-definitions.cjs +158 -0
  68. package/dist/canvas/components/Guardrails/use-guardrail-definitions.d.ts +30 -0
  69. package/dist/canvas/components/Guardrails/use-guardrail-definitions.d.ts.map +1 -0
  70. package/dist/canvas/components/Guardrails/use-guardrail-definitions.js +121 -0
  71. package/dist/canvas/locales/en.cjs +1 -1
  72. package/dist/canvas/locales/en.d.ts.map +1 -1
  73. package/dist/canvas/locales/en.js +1 -1
  74. package/dist/canvas/styles/tailwind.canvas.css +1 -1
  75. package/package.json +4 -3
@@ -0,0 +1,199 @@
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
+ parseGuardrailDefinitions: ()=>parseGuardrailDefinitions
28
+ });
29
+ const external_zod_namespaceObject = require("zod");
30
+ const emptyToUndefined = external_zod_namespaceObject.z.string().transform((value)=>'' === value.trim() ? void 0 : value).optional();
31
+ const nonBlankString = external_zod_namespaceObject.z.string().refine((value)=>'' !== value.trim(), 'Expected a non-blank string');
32
+ const parameterDisplayFields = {
33
+ displayName: emptyToUndefined,
34
+ description: emptyToUndefined
35
+ };
36
+ const enumParameterSchema = external_zod_namespaceObject.z.object({
37
+ ...parameterDisplayFields,
38
+ id: nonBlankString,
39
+ type: external_zod_namespaceObject.z.literal('enum'),
40
+ defaultValue: external_zod_namespaceObject.z.string().nullish(),
41
+ required: external_zod_namespaceObject.z.boolean(),
42
+ options: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string()),
43
+ optionLabels: external_zod_namespaceObject.z.record(external_zod_namespaceObject.z.string(), external_zod_namespaceObject.z.string()).optional()
44
+ });
45
+ const enumListParameterSchema = external_zod_namespaceObject.z.object({
46
+ ...parameterDisplayFields,
47
+ id: nonBlankString,
48
+ type: external_zod_namespaceObject.z.literal('enum-list'),
49
+ defaultValue: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string()),
50
+ required: external_zod_namespaceObject.z.boolean(),
51
+ options: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string()),
52
+ optionLabels: external_zod_namespaceObject.z.record(external_zod_namespaceObject.z.string(), external_zod_namespaceObject.z.string()).optional()
53
+ });
54
+ const mapEnumParameterSchema = external_zod_namespaceObject.z.object({
55
+ ...parameterDisplayFields,
56
+ id: nonBlankString,
57
+ type: external_zod_namespaceObject.z.literal('map-enum'),
58
+ defaultValue: external_zod_namespaceObject.z.record(external_zod_namespaceObject.z.string(), external_zod_namespaceObject.z.number()),
59
+ required: external_zod_namespaceObject.z.boolean(),
60
+ keySource: nonBlankString,
61
+ min: external_zod_namespaceObject.z.number().nullish(),
62
+ max: external_zod_namespaceObject.z.number().nullish(),
63
+ step: external_zod_namespaceObject.z.number().nullish()
64
+ });
65
+ const numberParameterSchema = external_zod_namespaceObject.z.object({
66
+ ...parameterDisplayFields,
67
+ id: nonBlankString,
68
+ type: external_zod_namespaceObject.z.literal('number'),
69
+ defaultValue: external_zod_namespaceObject.z.number(),
70
+ required: external_zod_namespaceObject.z.boolean(),
71
+ min: external_zod_namespaceObject.z.number().nullish(),
72
+ max: external_zod_namespaceObject.z.number().nullish(),
73
+ step: external_zod_namespaceObject.z.number().nullish()
74
+ });
75
+ const textParameterSchema = external_zod_namespaceObject.z.object({
76
+ ...parameterDisplayFields,
77
+ id: nonBlankString,
78
+ type: external_zod_namespaceObject.z.literal('text'),
79
+ defaultValue: external_zod_namespaceObject.z.string().nullish(),
80
+ required: external_zod_namespaceObject.z.boolean(),
81
+ maxLength: external_zod_namespaceObject.z.number().nullish()
82
+ });
83
+ const textListParameterSchema = external_zod_namespaceObject.z.object({
84
+ ...parameterDisplayFields,
85
+ id: nonBlankString,
86
+ type: external_zod_namespaceObject.z.literal('text-list'),
87
+ defaultValue: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string()).nullish(),
88
+ required: external_zod_namespaceObject.z.boolean(),
89
+ maxItems: external_zod_namespaceObject.z.number().nullish(),
90
+ maxLength: external_zod_namespaceObject.z.number().nullish()
91
+ });
92
+ const booleanParameterSchema = external_zod_namespaceObject.z.object({
93
+ ...parameterDisplayFields,
94
+ id: nonBlankString,
95
+ type: external_zod_namespaceObject.z.literal('boolean'),
96
+ defaultValue: external_zod_namespaceObject.z.boolean(),
97
+ required: external_zod_namespaceObject.z.boolean()
98
+ });
99
+ const parameterSchema = external_zod_namespaceObject.z.discriminatedUnion('type', [
100
+ enumParameterSchema,
101
+ enumListParameterSchema,
102
+ mapEnumParameterSchema,
103
+ numberParameterSchema,
104
+ textParameterSchema,
105
+ textListParameterSchema,
106
+ booleanParameterSchema
107
+ ]);
108
+ const definitionSchema = external_zod_namespaceObject.z.object({
109
+ validator: nonBlankString,
110
+ allowedScopes: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z["enum"]([
111
+ 'Agent',
112
+ 'Llm',
113
+ 'Tool'
114
+ ])).min(1),
115
+ parameters: external_zod_namespaceObject.z.array(parameterSchema).default([]),
116
+ status: external_zod_namespaceObject.z["enum"]([
117
+ 'Available',
118
+ 'FeatureDisabled',
119
+ 'Unauthorised',
120
+ 'Disabled'
121
+ ]),
122
+ displayName: emptyToUndefined,
123
+ description: emptyToUndefined,
124
+ byoConnectorName: emptyToUndefined,
125
+ byoConnectorKey: emptyToUndefined,
126
+ byoValidatorName: nonBlankString.optional(),
127
+ byoGuardrailConnectionId: nonBlankString.optional(),
128
+ byoConfigurationId: emptyToUndefined,
129
+ folderPath: emptyToUndefined,
130
+ folderKey: emptyToUndefined
131
+ });
132
+ function toWireDefinition(parsed) {
133
+ const asWire = parsed;
134
+ const asSchemaOutput = asWire;
135
+ return asSchemaOutput;
136
+ }
137
+ function describeInput(input) {
138
+ if (null === input) return 'null';
139
+ if (Array.isArray(input)) return 'array';
140
+ return typeof input;
141
+ }
142
+ function readValidator(entry) {
143
+ if ('object' != typeof entry || null === entry) return;
144
+ const validator = entry.validator;
145
+ return 'string' == typeof validator && '' !== validator.trim() ? validator : void 0;
146
+ }
147
+ function describeIssues(error) {
148
+ return error.issues.slice(0, 5).map((issue)=>{
149
+ const path = issue.path.join('.');
150
+ return path ? `${path}: ${issue.message}` : issue.message;
151
+ }).join('; ');
152
+ }
153
+ function parseGuardrailDefinitions(input) {
154
+ if (!Array.isArray(input)) return {
155
+ definitions: [],
156
+ invalid: [],
157
+ inputError: `Expected an array of guardrail definitions, received ${describeInput(input)}.`
158
+ };
159
+ const definitions = [];
160
+ const invalid = [];
161
+ for(let index = 0; index < input.length; index += 1){
162
+ let message;
163
+ let validator;
164
+ let parsed = false;
165
+ try {
166
+ const entry = input[index];
167
+ const result = definitionSchema.safeParse(entry);
168
+ if (result.success) {
169
+ definitions.push(toWireDefinition(result.data));
170
+ parsed = true;
171
+ message = '';
172
+ } else {
173
+ message = describeIssues(result.error);
174
+ validator = readValidator(entry);
175
+ }
176
+ } catch (error) {
177
+ message = error instanceof Error ? error.message : String(error);
178
+ }
179
+ if (!parsed) invalid.push(void 0 === validator ? {
180
+ index,
181
+ message
182
+ } : {
183
+ index,
184
+ validator,
185
+ message
186
+ });
187
+ }
188
+ return {
189
+ definitions,
190
+ invalid
191
+ };
192
+ }
193
+ exports.parseGuardrailDefinitions = __webpack_exports__.parseGuardrailDefinitions;
194
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
195
+ "parseGuardrailDefinitions"
196
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
197
+ Object.defineProperty(exports, '__esModule', {
198
+ value: true
199
+ });
@@ -0,0 +1,13 @@
1
+ import type { GuardrailDefinitionWire } from './definitions-wire';
2
+ export interface GuardrailDefinitionParseIssue {
3
+ index: number;
4
+ validator?: string;
5
+ message: string;
6
+ }
7
+ export interface GuardrailDefinitionsParseResult {
8
+ definitions: GuardrailDefinitionWire[];
9
+ invalid: GuardrailDefinitionParseIssue[];
10
+ inputError?: string;
11
+ }
12
+ export declare function parseGuardrailDefinitions(input: unknown): GuardrailDefinitionsParseResult;
13
+ //# sourceMappingURL=definitions-parse.d.ts.map
@@ -0,0 +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;AAuJlE,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"}
@@ -0,0 +1,165 @@
1
+ import { z } from "zod";
2
+ const emptyToUndefined = z.string().transform((value)=>'' === value.trim() ? void 0 : value).optional();
3
+ const nonBlankString = z.string().refine((value)=>'' !== value.trim(), 'Expected a non-blank string');
4
+ const parameterDisplayFields = {
5
+ displayName: emptyToUndefined,
6
+ description: emptyToUndefined
7
+ };
8
+ const enumParameterSchema = z.object({
9
+ ...parameterDisplayFields,
10
+ id: nonBlankString,
11
+ type: z.literal('enum'),
12
+ defaultValue: z.string().nullish(),
13
+ required: z.boolean(),
14
+ options: z.array(z.string()),
15
+ optionLabels: z.record(z.string(), z.string()).optional()
16
+ });
17
+ const enumListParameterSchema = z.object({
18
+ ...parameterDisplayFields,
19
+ id: nonBlankString,
20
+ type: z.literal('enum-list'),
21
+ defaultValue: z.array(z.string()),
22
+ required: z.boolean(),
23
+ options: z.array(z.string()),
24
+ optionLabels: z.record(z.string(), z.string()).optional()
25
+ });
26
+ const mapEnumParameterSchema = z.object({
27
+ ...parameterDisplayFields,
28
+ id: nonBlankString,
29
+ type: z.literal('map-enum'),
30
+ defaultValue: z.record(z.string(), z.number()),
31
+ required: z.boolean(),
32
+ keySource: nonBlankString,
33
+ min: z.number().nullish(),
34
+ max: z.number().nullish(),
35
+ step: z.number().nullish()
36
+ });
37
+ const numberParameterSchema = z.object({
38
+ ...parameterDisplayFields,
39
+ id: nonBlankString,
40
+ type: z.literal('number'),
41
+ defaultValue: z.number(),
42
+ required: z.boolean(),
43
+ min: z.number().nullish(),
44
+ max: z.number().nullish(),
45
+ step: z.number().nullish()
46
+ });
47
+ const textParameterSchema = z.object({
48
+ ...parameterDisplayFields,
49
+ id: nonBlankString,
50
+ type: z.literal('text'),
51
+ defaultValue: z.string().nullish(),
52
+ required: z.boolean(),
53
+ maxLength: z.number().nullish()
54
+ });
55
+ const textListParameterSchema = z.object({
56
+ ...parameterDisplayFields,
57
+ id: nonBlankString,
58
+ type: z.literal('text-list'),
59
+ defaultValue: z.array(z.string()).nullish(),
60
+ required: z.boolean(),
61
+ maxItems: z.number().nullish(),
62
+ maxLength: z.number().nullish()
63
+ });
64
+ const booleanParameterSchema = z.object({
65
+ ...parameterDisplayFields,
66
+ id: nonBlankString,
67
+ type: z.literal('boolean'),
68
+ defaultValue: z.boolean(),
69
+ required: z.boolean()
70
+ });
71
+ const parameterSchema = z.discriminatedUnion('type', [
72
+ enumParameterSchema,
73
+ enumListParameterSchema,
74
+ mapEnumParameterSchema,
75
+ numberParameterSchema,
76
+ textParameterSchema,
77
+ textListParameterSchema,
78
+ booleanParameterSchema
79
+ ]);
80
+ const definitionSchema = z.object({
81
+ validator: nonBlankString,
82
+ allowedScopes: z.array(z["enum"]([
83
+ 'Agent',
84
+ 'Llm',
85
+ 'Tool'
86
+ ])).min(1),
87
+ parameters: z.array(parameterSchema).default([]),
88
+ status: z["enum"]([
89
+ 'Available',
90
+ 'FeatureDisabled',
91
+ 'Unauthorised',
92
+ 'Disabled'
93
+ ]),
94
+ displayName: emptyToUndefined,
95
+ description: emptyToUndefined,
96
+ byoConnectorName: emptyToUndefined,
97
+ byoConnectorKey: emptyToUndefined,
98
+ byoValidatorName: nonBlankString.optional(),
99
+ byoGuardrailConnectionId: nonBlankString.optional(),
100
+ byoConfigurationId: emptyToUndefined,
101
+ folderPath: emptyToUndefined,
102
+ folderKey: emptyToUndefined
103
+ });
104
+ function toWireDefinition(parsed) {
105
+ const asWire = parsed;
106
+ const asSchemaOutput = asWire;
107
+ return asSchemaOutput;
108
+ }
109
+ function describeInput(input) {
110
+ if (null === input) return 'null';
111
+ if (Array.isArray(input)) return 'array';
112
+ return typeof input;
113
+ }
114
+ function readValidator(entry) {
115
+ if ('object' != typeof entry || null === entry) return;
116
+ const validator = entry.validator;
117
+ return 'string' == typeof validator && '' !== validator.trim() ? validator : void 0;
118
+ }
119
+ function describeIssues(error) {
120
+ return error.issues.slice(0, 5).map((issue)=>{
121
+ const path = issue.path.join('.');
122
+ return path ? `${path}: ${issue.message}` : issue.message;
123
+ }).join('; ');
124
+ }
125
+ function parseGuardrailDefinitions(input) {
126
+ if (!Array.isArray(input)) return {
127
+ definitions: [],
128
+ invalid: [],
129
+ inputError: `Expected an array of guardrail definitions, received ${describeInput(input)}.`
130
+ };
131
+ const definitions = [];
132
+ const invalid = [];
133
+ for(let index = 0; index < input.length; index += 1){
134
+ let message;
135
+ let validator;
136
+ let parsed = false;
137
+ try {
138
+ const entry = input[index];
139
+ const result = definitionSchema.safeParse(entry);
140
+ if (result.success) {
141
+ definitions.push(toWireDefinition(result.data));
142
+ parsed = true;
143
+ message = '';
144
+ } else {
145
+ message = describeIssues(result.error);
146
+ validator = readValidator(entry);
147
+ }
148
+ } catch (error) {
149
+ message = error instanceof Error ? error.message : String(error);
150
+ }
151
+ if (!parsed) invalid.push(void 0 === validator ? {
152
+ index,
153
+ message
154
+ } : {
155
+ index,
156
+ validator,
157
+ message
158
+ });
159
+ }
160
+ return {
161
+ definitions,
162
+ invalid
163
+ };
164
+ }
165
+ export { parseGuardrailDefinitions };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.r = (exports1)=>{
5
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
6
+ value: 'Module'
7
+ });
8
+ Object.defineProperty(exports1, '__esModule', {
9
+ value: true
10
+ });
11
+ };
12
+ })();
13
+ var __webpack_exports__ = {};
14
+ __webpack_require__.r(__webpack_exports__);
15
+ for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
16
+ Object.defineProperty(exports, '__esModule', {
17
+ value: true
18
+ });
@@ -0,0 +1,59 @@
1
+ import type { GuardrailDefinitionStatus, GuardrailScope } from './builder-types';
2
+ export interface GuardrailParameterWireBase {
3
+ id: string;
4
+ required: boolean;
5
+ displayName?: string;
6
+ description?: string;
7
+ }
8
+ export type GuardrailParameterDefinitionWire = (GuardrailParameterWireBase & {
9
+ type: 'enum';
10
+ defaultValue?: string | null;
11
+ options: string[];
12
+ optionLabels?: Record<string, string>;
13
+ }) | (GuardrailParameterWireBase & {
14
+ type: 'enum-list';
15
+ defaultValue: string[];
16
+ options: string[];
17
+ optionLabels?: Record<string, string>;
18
+ }) | (GuardrailParameterWireBase & {
19
+ type: 'map-enum';
20
+ defaultValue: Record<string, number>;
21
+ keySource: string;
22
+ min?: number | null;
23
+ max?: number | null;
24
+ step?: number | null;
25
+ }) | (GuardrailParameterWireBase & {
26
+ type: 'number';
27
+ defaultValue: number;
28
+ min?: number | null;
29
+ max?: number | null;
30
+ step?: number | null;
31
+ }) | (GuardrailParameterWireBase & {
32
+ type: 'text';
33
+ defaultValue?: string | null;
34
+ maxLength?: number | null;
35
+ }) | (GuardrailParameterWireBase & {
36
+ type: 'text-list';
37
+ defaultValue?: string[] | null;
38
+ maxItems?: number | null;
39
+ maxLength?: number | null;
40
+ }) | (GuardrailParameterWireBase & {
41
+ type: 'boolean';
42
+ defaultValue: boolean;
43
+ });
44
+ export interface GuardrailDefinitionWire {
45
+ validator: string;
46
+ allowedScopes: GuardrailScope[];
47
+ parameters: GuardrailParameterDefinitionWire[];
48
+ status: GuardrailDefinitionStatus;
49
+ displayName?: string;
50
+ description?: string;
51
+ byoConnectorName?: string;
52
+ byoConnectorKey?: string;
53
+ byoValidatorName?: string;
54
+ byoGuardrailConnectionId?: string;
55
+ byoConfigurationId?: string;
56
+ folderPath?: string;
57
+ folderKey?: string;
58
+ }
59
+ //# sourceMappingURL=definitions-wire.d.ts.map
@@ -0,0 +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;CACvC,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;IAClC,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"}
@@ -0,0 +1,103 @@
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
+ getGuardrailListChips: ()=>getGuardrailListChips,
28
+ getGuardrailListItemId: ()=>getGuardrailListItemId,
29
+ matchesGuardrailListDefinition: ()=>matchesGuardrailListDefinition,
30
+ resolveGuardrailListItemState: ()=>resolveGuardrailListItemState
31
+ });
32
+ function getGuardrailListItemId(item) {
33
+ return item.id ?? item.name;
34
+ }
35
+ function matchesGuardrailListDefinition(definition, item) {
36
+ return void 0 === item.byoValidatorName ? void 0 === definition.byoValidatorName && definition.validator === item.validatorType : definition.byoValidatorName === item.byoValidatorName;
37
+ }
38
+ function resolveGuardrailListItemState(item, definitions = []) {
39
+ const isByo = void 0 !== item.byoValidatorName;
40
+ const definition = definitions.find((candidate)=>matchesGuardrailListDefinition(candidate, item));
41
+ const byoUnavailable = isByo && definitions.length > 0 && void 0 === definition;
42
+ const byoDisabled = isByo && definition?.status === 'Disabled';
43
+ return {
44
+ definition,
45
+ status: byoUnavailable ? 'Unavailable' : definition?.status,
46
+ isByo,
47
+ provider: definition?.byoConnectorName,
48
+ byoDisabled,
49
+ byoUnavailable
50
+ };
51
+ }
52
+ function getGuardrailListChips(input, labels) {
53
+ const chips = [];
54
+ const statusChip = (()=>{
55
+ switch(input.status){
56
+ case 'FeatureDisabled':
57
+ return {
58
+ tone: 'warning',
59
+ label: labels.statusFeatureDisabled
60
+ };
61
+ case 'Unauthorised':
62
+ return {
63
+ tone: 'warning',
64
+ label: labels.statusUnauthorized
65
+ };
66
+ case 'Disabled':
67
+ return {
68
+ tone: 'error',
69
+ label: labels.statusDisabled
70
+ };
71
+ case 'Unavailable':
72
+ return {
73
+ tone: 'error',
74
+ label: labels.statusUnavailable
75
+ };
76
+ default:
77
+ return;
78
+ }
79
+ })();
80
+ if (statusChip) chips.push({
81
+ id: 'status',
82
+ ...statusChip
83
+ });
84
+ if ('governance' === input.administration) chips.push({
85
+ id: 'administration',
86
+ tone: 'neutral',
87
+ label: labels.administrationGovernance
88
+ });
89
+ return chips;
90
+ }
91
+ exports.getGuardrailListChips = __webpack_exports__.getGuardrailListChips;
92
+ exports.getGuardrailListItemId = __webpack_exports__.getGuardrailListItemId;
93
+ exports.matchesGuardrailListDefinition = __webpack_exports__.matchesGuardrailListDefinition;
94
+ exports.resolveGuardrailListItemState = __webpack_exports__.resolveGuardrailListItemState;
95
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
96
+ "getGuardrailListChips",
97
+ "getGuardrailListItemId",
98
+ "matchesGuardrailListDefinition",
99
+ "resolveGuardrailListItemState"
100
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
101
+ Object.defineProperty(exports, '__esModule', {
102
+ value: true
103
+ });
@@ -0,0 +1,10 @@
1
+ import type { GuardrailListLabels } from './i18n';
2
+ import type { GuardrailListAdministration, GuardrailListChip, GuardrailListDefinition, GuardrailListItem, GuardrailListItemState } from './list-types';
3
+ export declare function getGuardrailListItemId(item: GuardrailListItem): string;
4
+ export declare function matchesGuardrailListDefinition(definition: GuardrailListDefinition, item: GuardrailListItem): boolean;
5
+ export declare function resolveGuardrailListItemState(item: GuardrailListItem, definitions?: readonly GuardrailListDefinition[]): GuardrailListItemState;
6
+ export declare function getGuardrailListChips(input: {
7
+ status?: GuardrailListItemState['status'];
8
+ administration?: GuardrailListAdministration;
9
+ }, labels: GuardrailListLabels): GuardrailListChip[];
10
+ //# sourceMappingURL=guardrail-list-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guardrail-list-utils.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Guardrails/guardrail-list-utils.ts"],"names":[],"mappings":"AAAA,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,CAiBxB;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"}
@@ -0,0 +1,60 @@
1
+ function getGuardrailListItemId(item) {
2
+ return item.id ?? item.name;
3
+ }
4
+ function matchesGuardrailListDefinition(definition, item) {
5
+ return void 0 === item.byoValidatorName ? void 0 === definition.byoValidatorName && definition.validator === item.validatorType : definition.byoValidatorName === item.byoValidatorName;
6
+ }
7
+ function resolveGuardrailListItemState(item, definitions = []) {
8
+ const isByo = void 0 !== item.byoValidatorName;
9
+ const definition = definitions.find((candidate)=>matchesGuardrailListDefinition(candidate, item));
10
+ const byoUnavailable = isByo && definitions.length > 0 && void 0 === definition;
11
+ const byoDisabled = isByo && definition?.status === 'Disabled';
12
+ return {
13
+ definition,
14
+ status: byoUnavailable ? 'Unavailable' : definition?.status,
15
+ isByo,
16
+ provider: definition?.byoConnectorName,
17
+ byoDisabled,
18
+ byoUnavailable
19
+ };
20
+ }
21
+ function getGuardrailListChips(input, labels) {
22
+ const chips = [];
23
+ const statusChip = (()=>{
24
+ switch(input.status){
25
+ case 'FeatureDisabled':
26
+ return {
27
+ tone: 'warning',
28
+ label: labels.statusFeatureDisabled
29
+ };
30
+ case 'Unauthorised':
31
+ return {
32
+ tone: 'warning',
33
+ label: labels.statusUnauthorized
34
+ };
35
+ case 'Disabled':
36
+ return {
37
+ tone: 'error',
38
+ label: labels.statusDisabled
39
+ };
40
+ case 'Unavailable':
41
+ return {
42
+ tone: 'error',
43
+ label: labels.statusUnavailable
44
+ };
45
+ default:
46
+ return;
47
+ }
48
+ })();
49
+ if (statusChip) chips.push({
50
+ id: 'status',
51
+ ...statusChip
52
+ });
53
+ if ('governance' === input.administration) chips.push({
54
+ id: 'administration',
55
+ tone: 'neutral',
56
+ label: labels.administrationGovernance
57
+ });
58
+ return chips;
59
+ }
60
+ export { getGuardrailListChips, getGuardrailListItemId, matchesGuardrailListDefinition, resolveGuardrailListItemState };