From 483a620fe72021df3ab559ae68ac5c99f01e3b0c Mon Sep 17 00:00:00 2001 From: gearnode Date: Thu, 27 Mar 2025 13:07:27 +0100 Subject: [PATCH] Rename control to mitigation Signed-off-by: gearnode --- CHANGELOG.md | 4 + apps/console/dist/.keep | 0 apps/console/src/components/ui/sidebar.tsx | 2 +- .../organizations/OrganizationLayout.tsx | 40 +- .../src/pages/organizations/Routes.tsx | 18 +- ...adcrumbMitigationOverviewQuery.graphql.ts} | 38 +- .../frameworks/CreateFrameworkPage.tsx | 2 +- .../frameworks/CreateFrameworkView.tsx | 2 +- .../frameworks/FrameworkListView.tsx | 10 +- .../frameworks/FrameworkView.tsx | 79 +- ...ListViewImportFrameworkMutation.graphql.ts | 36 +- .../FrameworkListViewQuery.graphql.ts | 36 +- .../FrameworkViewQuery.graphql.ts | 44 +- .../CreateMitigationPage.tsx} | 23 +- .../CreateMitigationView.tsx} | 52 +- .../MitigationPage.tsx} | 10 +- .../MitigationView.tsx} | 183 +- .../UpdateMitigationPage.tsx} | 21 +- .../UpdateMitigationView.tsx} | 82 +- ...onViewCreateMitigationMutation.graphql.ts} | 56 +- ...tigationViewAssignTaskMutation.graphql.ts} | 24 +- ...tigationViewCreateTaskMutation.graphql.ts} | 26 +- ...tionViewDeleteEvidenceMutation.graphql.ts} | 24 +- ...tigationViewDeleteTaskMutation.graphql.ts} | 24 +- ...ionViewGetEvidenceFileUrlQuery.graphql.ts} | 24 +- ...itigationViewOrganizationQuery.graphql.ts} | 30 +- .../MitigationViewQuery.graphql.ts} | 58 +- ...gationViewUnassignTaskMutation.graphql.ts} | 24 +- ...wUpdateMitigationStateMutation.graphql.ts} | 50 +- ...ionViewUpdateTaskStateMutation.graphql.ts} | 24 +- ...tionViewUploadEvidenceMutation.graphql.ts} | 24 +- .../UpdateMitigationViewQuery.graphql.ts} | 42 +- ...onViewUpdateMitigationMutation.graphql.ts} | 52 +- .../organizations/policies/PolicyListPage.tsx | 2 +- .../organizations/policies/PolicyListView.tsx | 2 +- ...dorListPageCreateVendorMutation.graphql.ts | 209 - ...dorListPageDeleteVendorMutation.graphql.ts | 132 - .../VendorListPagePaginationQuery.graphql.ts | 335 -- .../VendorListPageQuery.graphql.ts | 337 -- .../VendorListPage_vendors.graphql.ts | 262 - go.sum | 2 - pkg/coredata/control.go | 120 +- pkg/coredata/control_importance.go | 48 +- pkg/coredata/control_order_field.go | 14 +- pkg/coredata/control_state.go | 48 +- pkg/coredata/entity_type_reg.go | 2 +- pkg/coredata/migrations/20250327T093314Z.sql | 97 + pkg/coredata/task.go | 358 +- pkg/probo/framework_service.go | 47 +- ...ntrol_service.go => mitigation_service.go} | 76 +- pkg/probo/organization_service.go | 2 +- pkg/probo/service.go | 27 +- pkg/probo/task_service.go | 312 +- pkg/server/api/console/v1/schema.graphql | 80 +- pkg/server/api/console/v1/schema/schema.go | 5241 +++++++++++------ .../v1/types/{control.go => mitigation.go} | 20 +- pkg/server/api/console/v1/types/types.go | 120 +- pkg/server/api/console/v1/v1_resolver.go | 115 +- 58 files changed, 4972 insertions(+), 4200 deletions(-) delete mode 100644 apps/console/dist/.keep rename apps/console/src/pages/organizations/__generated__/{OrganizationLayoutBreadcrumbControlOverviewQuery.graphql.ts => OrganizationLayoutBreadcrumbMitigationOverviewQuery.graphql.ts} (61%) rename apps/console/src/pages/organizations/frameworks/{controls/UpdateControlPage.tsx => mitigations/CreateMitigationPage.tsx} (58%) rename apps/console/src/pages/organizations/frameworks/{controls/CreateControlView.tsx => mitigations/CreateMitigationView.tsx} (81%) rename apps/console/src/pages/organizations/frameworks/{controls/ControlPage.tsx => mitigations/MitigationPage.tsx} (83%) rename apps/console/src/pages/organizations/frameworks/{controls/ControlView.tsx => mitigations/MitigationView.tsx} (94%) rename apps/console/src/pages/organizations/frameworks/{controls/CreateControlPage.tsx => mitigations/UpdateMitigationPage.tsx} (59%) rename apps/console/src/pages/organizations/frameworks/{controls/UpdateControlView.tsx => mitigations/UpdateMitigationView.tsx} (81%) rename apps/console/src/pages/organizations/frameworks/{controls/__generated__/CreateControlViewCreateControlMutation.graphql.ts => mitigations/__generated__/CreateMitigationViewCreateMitigationMutation.graphql.ts} (65%) rename apps/console/src/pages/organizations/frameworks/{controls/__generated__/ControlViewAssignTaskMutation.graphql.ts => mitigations/__generated__/MitigationViewAssignTaskMutation.graphql.ts} (76%) rename apps/console/src/pages/organizations/frameworks/{controls/__generated__/ControlViewCreateTaskMutation.graphql.ts => mitigations/__generated__/MitigationViewCreateTaskMutation.graphql.ts} (82%) rename apps/console/src/pages/organizations/frameworks/{controls/__generated__/ControlViewDeleteEvidenceMutation.graphql.ts => mitigations/__generated__/MitigationViewDeleteEvidenceMutation.graphql.ts} (74%) rename apps/console/src/pages/organizations/frameworks/{controls/__generated__/ControlViewDeleteTaskMutation.graphql.ts => mitigations/__generated__/MitigationViewDeleteTaskMutation.graphql.ts} (75%) rename apps/console/src/pages/organizations/frameworks/{controls/__generated__/ControlViewGetEvidenceFileUrlQuery.graphql.ts => mitigations/__generated__/MitigationViewGetEvidenceFileUrlQuery.graphql.ts} (73%) rename apps/console/src/pages/organizations/frameworks/{controls/__generated__/ControlViewOrganizationQuery.graphql.ts => mitigations/__generated__/MitigationViewOrganizationQuery.graphql.ts} (79%) rename apps/console/src/pages/organizations/frameworks/{controls/__generated__/ControlViewQuery.graphql.ts => mitigations/__generated__/MitigationViewQuery.graphql.ts} (83%) rename apps/console/src/pages/organizations/frameworks/{controls/__generated__/ControlViewUnassignTaskMutation.graphql.ts => mitigations/__generated__/MitigationViewUnassignTaskMutation.graphql.ts} (75%) rename apps/console/src/pages/organizations/frameworks/{controls/__generated__/ControlViewUpdateControlStateMutation.graphql.ts => mitigations/__generated__/MitigationViewUpdateMitigationStateMutation.graphql.ts} (56%) rename apps/console/src/pages/organizations/frameworks/{controls/__generated__/ControlViewUpdateTaskStateMutation.graphql.ts => mitigations/__generated__/MitigationViewUpdateTaskStateMutation.graphql.ts} (75%) rename apps/console/src/pages/organizations/frameworks/{controls/__generated__/ControlViewUploadEvidenceMutation.graphql.ts => mitigations/__generated__/MitigationViewUploadEvidenceMutation.graphql.ts} (83%) rename apps/console/src/pages/organizations/frameworks/{controls/__generated__/UpdateControlViewQuery.graphql.ts => mitigations/__generated__/UpdateMitigationViewQuery.graphql.ts} (71%) rename apps/console/src/pages/organizations/frameworks/{controls/__generated__/UpdateControlViewUpdateControlMutation.graphql.ts => mitigations/__generated__/UpdateMitigationViewUpdateMitigationMutation.graphql.ts} (63%) delete mode 100644 apps/console/src/pages/organizations/vendors/__generated__/VendorListPageCreateVendorMutation.graphql.ts delete mode 100644 apps/console/src/pages/organizations/vendors/__generated__/VendorListPageDeleteVendorMutation.graphql.ts delete mode 100644 apps/console/src/pages/organizations/vendors/__generated__/VendorListPagePaginationQuery.graphql.ts delete mode 100644 apps/console/src/pages/organizations/vendors/__generated__/VendorListPageQuery.graphql.ts delete mode 100644 apps/console/src/pages/organizations/vendors/__generated__/VendorListPage_vendors.graphql.ts create mode 100644 pkg/coredata/migrations/20250327T093314Z.sql rename pkg/probo/{control_service.go => mitigation_service.go} (62%) rename pkg/server/api/console/v1/types/{control.go => mitigation.go} (69%) diff --git a/CHANGELOG.md b/CHANGELOG.md index e47187d36..6a311a848 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ All notable changes to this project will be documented in this file. - Add sidebar to show a task. - Add task estimate edition. +### Changed + +- Rename control in mitigation. + ### Fixed - Fix panic in GraphQL resolver are not reported. diff --git a/apps/console/dist/.keep b/apps/console/dist/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/apps/console/src/components/ui/sidebar.tsx b/apps/console/src/components/ui/sidebar.tsx index 74b229a89..9bcb7f299 100644 --- a/apps/console/src/components/ui/sidebar.tsx +++ b/apps/console/src/components/ui/sidebar.tsx @@ -69,7 +69,7 @@ const SidebarProvider = React.forwardRef< const [openMobile, setOpenMobile] = React.useState(false); // This is the internal state of the sidebar. - // We use openProp and setOpenProp for control from outside the component. + // We use openProp and setOpenProp for mitigation from outside the component. const [_open, _setOpen] = React.useState(defaultOpen); const open = openProp ?? _open; const setOpen = React.useCallback( diff --git a/apps/console/src/pages/organizations/OrganizationLayout.tsx b/apps/console/src/pages/organizations/OrganizationLayout.tsx index dd2b8a2fd..b9ecbb8d8 100644 --- a/apps/console/src/pages/organizations/OrganizationLayout.tsx +++ b/apps/console/src/pages/organizations/OrganizationLayout.tsx @@ -14,7 +14,7 @@ import { Toaster } from "@/components/ui/toaster"; import { graphql, useLazyLoadQuery } from "react-relay"; import { cn } from "@/lib/utils"; import { OrganizationLayoutOrganizationQuery } from "./__generated__/OrganizationLayoutOrganizationQuery.graphql"; -import { OrganizationLayoutBreadcrumbControlOverviewQuery } from "./__generated__/OrganizationLayoutBreadcrumbControlOverviewQuery.graphql"; +import { OrganizationLayoutBreadcrumbMitigationOverviewQuery } from "./__generated__/OrganizationLayoutBreadcrumbMitigationOverviewQuery.graphql"; import { OrganizationLayoutBreadcrumbFrameworkOverviewQuery } from "./__generated__/OrganizationLayoutBreadcrumbFrameworkOverviewQuery.graphql"; import { OrganizationLayoutBreadcrumbPeopleOverviewQuery } from "./__generated__/OrganizationLayoutBreadcrumbPeopleOverviewQuery.graphql"; import { OrganizationLayoutBreadcrumbPolicyOverviewQuery } from "./__generated__/OrganizationLayoutBreadcrumbPolicyOverviewQuery.graphql"; @@ -270,23 +270,23 @@ function BreadcrumbPeopleOverview() { ); } -function BreadcrumbControlOverview() { - const { organizationId, frameworkId, controlId } = useParams(); +function BreadcrumbMitigationOverview() { + const { organizationId, frameworkId, mitigationId } = useParams(); const data = - useLazyLoadQuery( + useLazyLoadQuery( graphql` - query OrganizationLayoutBreadcrumbControlOverviewQuery( - $controlId: ID! + query OrganizationLayoutBreadcrumbMitigationOverviewQuery( + $mitigationId: ID! ) { - control: node(id: $controlId) { + mitigation: node(id: $mitigationId) { id - ... on Control { + ... on Mitigation { name } } } `, - { controlId: controlId! } + { mitigationId: mitigationId! } ); return ( @@ -294,9 +294,9 @@ function BreadcrumbControlOverview() { - {data.control?.name} + {data.mitigation?.name} @@ -304,23 +304,23 @@ function BreadcrumbControlOverview() { ); } -function BreadcrumbCreateControl() { +function BreadcrumbCreateMitigation() { return ( <> - Create Control + Create Mitigation ); } -function BreadcrumbUpdateControl() { +function BreadcrumbUpdateMitigation() { return ( <> - Update Control + Update Mitigation ); @@ -423,20 +423,20 @@ export default function OrganizationLayout() { } > } + path="mitigations/create" + element={} /> - + } > } + element={} /> } /> } + path="frameworks/:frameworkId/mitigations/create" + element={} /> } + path="frameworks/:frameworkId/mitigations/:mitigationId" + element={} /> } + path="frameworks/:frameworkId/mitigations/:mitigationId/update" + element={} /> } /> } /> diff --git a/apps/console/src/pages/organizations/__generated__/OrganizationLayoutBreadcrumbControlOverviewQuery.graphql.ts b/apps/console/src/pages/organizations/__generated__/OrganizationLayoutBreadcrumbMitigationOverviewQuery.graphql.ts similarity index 61% rename from apps/console/src/pages/organizations/__generated__/OrganizationLayoutBreadcrumbControlOverviewQuery.graphql.ts rename to apps/console/src/pages/organizations/__generated__/OrganizationLayoutBreadcrumbMitigationOverviewQuery.graphql.ts index 32bef6b46..6a6c0a7b1 100644 --- a/apps/console/src/pages/organizations/__generated__/OrganizationLayoutBreadcrumbControlOverviewQuery.graphql.ts +++ b/apps/console/src/pages/organizations/__generated__/OrganizationLayoutBreadcrumbMitigationOverviewQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -9,18 +9,18 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type OrganizationLayoutBreadcrumbControlOverviewQuery$variables = { - controlId: string; +export type OrganizationLayoutBreadcrumbMitigationOverviewQuery$variables = { + mitigationId: string; }; -export type OrganizationLayoutBreadcrumbControlOverviewQuery$data = { - readonly control: { +export type OrganizationLayoutBreadcrumbMitigationOverviewQuery$data = { + readonly mitigation: { readonly id: string; readonly name?: string; }; }; -export type OrganizationLayoutBreadcrumbControlOverviewQuery = { - response: OrganizationLayoutBreadcrumbControlOverviewQuery$data; - variables: OrganizationLayoutBreadcrumbControlOverviewQuery$variables; +export type OrganizationLayoutBreadcrumbMitigationOverviewQuery = { + response: OrganizationLayoutBreadcrumbMitigationOverviewQuery$data; + variables: OrganizationLayoutBreadcrumbMitigationOverviewQuery$variables; }; const node: ConcreteRequest = (function(){ @@ -28,14 +28,14 @@ var v0 = [ { "defaultValue": null, "kind": "LocalArgument", - "name": "controlId" + "name": "mitigationId" } ], v1 = [ { "kind": "Variable", "name": "id", - "variableName": "controlId" + "variableName": "mitigationId" } ], v2 = { @@ -56,7 +56,7 @@ v3 = { "storageKey": null } ], - "type": "Control", + "type": "Mitigation", "abstractKey": null }; return { @@ -64,10 +64,10 @@ return { "argumentDefinitions": (v0/*: any*/), "kind": "Fragment", "metadata": null, - "name": "OrganizationLayoutBreadcrumbControlOverviewQuery", + "name": "OrganizationLayoutBreadcrumbMitigationOverviewQuery", "selections": [ { - "alias": "control", + "alias": "mitigation", "args": (v1/*: any*/), "concreteType": null, "kind": "LinkedField", @@ -87,10 +87,10 @@ return { "operation": { "argumentDefinitions": (v0/*: any*/), "kind": "Operation", - "name": "OrganizationLayoutBreadcrumbControlOverviewQuery", + "name": "OrganizationLayoutBreadcrumbMitigationOverviewQuery", "selections": [ { - "alias": "control", + "alias": "mitigation", "args": (v1/*: any*/), "concreteType": null, "kind": "LinkedField", @@ -112,16 +112,16 @@ return { ] }, "params": { - "cacheID": "2fa16d62f29015853c425704e3de3fd4", + "cacheID": "12d02036b7f66c280ddd621941750d00", "id": null, "metadata": {}, - "name": "OrganizationLayoutBreadcrumbControlOverviewQuery", + "name": "OrganizationLayoutBreadcrumbMitigationOverviewQuery", "operationKind": "query", - "text": "query OrganizationLayoutBreadcrumbControlOverviewQuery(\n $controlId: ID!\n) {\n control: node(id: $controlId) {\n __typename\n id\n ... on Control {\n name\n }\n }\n}\n" + "text": "query OrganizationLayoutBreadcrumbMitigationOverviewQuery(\n $mitigationId: ID!\n) {\n mitigation: node(id: $mitigationId) {\n __typename\n id\n ... on Mitigation {\n name\n }\n }\n}\n" } }; })(); -(node as any).hash = "202e114f9b94e9c0bf805b0ae8f69fcd"; +(node as any).hash = "cd0a93d3c44467278a33729c4a46b0bf"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/CreateFrameworkPage.tsx b/apps/console/src/pages/organizations/frameworks/CreateFrameworkPage.tsx index a462447f8..8ede37a9d 100644 --- a/apps/console/src/pages/organizations/frameworks/CreateFrameworkPage.tsx +++ b/apps/console/src/pages/organizations/frameworks/CreateFrameworkPage.tsx @@ -10,7 +10,7 @@ export function CreateFrameworkViewSkeleton() { return (
diff --git a/apps/console/src/pages/organizations/frameworks/CreateFrameworkView.tsx b/apps/console/src/pages/organizations/frameworks/CreateFrameworkView.tsx index 6e6bd833f..da50f6fd6 100644 --- a/apps/console/src/pages/organizations/frameworks/CreateFrameworkView.tsx +++ b/apps/console/src/pages/organizations/frameworks/CreateFrameworkView.tsx @@ -170,7 +170,7 @@ function CreateFrameworkViewContent() { return (
diff --git a/apps/console/src/pages/organizations/frameworks/FrameworkListView.tsx b/apps/console/src/pages/organizations/frameworks/FrameworkListView.tsx index ac0fbcf9d..8a1ec9fe1 100644 --- a/apps/console/src/pages/organizations/frameworks/FrameworkListView.tsx +++ b/apps/console/src/pages/organizations/frameworks/FrameworkListView.tsx @@ -37,7 +37,7 @@ const FrameworkListViewQuery = graphql` id name description - controls(first: 100) { + mitigations(first: 100) { edges { node { id @@ -66,7 +66,7 @@ const FrameworkListViewImportFrameworkMutation = graphql` id name description - controls(first: 100) { + mitigations(first: 100) { edges { node { id @@ -240,10 +240,10 @@ function FrameworkListViewContent({
{frameworks.map((framework) => { - const validatedControls = framework.controls.edges.filter( + const validatedControls = framework.mitigations.edges.filter( (edge) => edge?.node?.state === "IMPLEMENTED" ).length; - const totalControls = framework.controls.edges.length; + const totalControls = framework.mitigations.edges.length; return ( diff --git a/apps/console/src/pages/organizations/frameworks/FrameworkView.tsx b/apps/console/src/pages/organizations/frameworks/FrameworkView.tsx index de58fbae2..fa3867a9b 100644 --- a/apps/console/src/pages/organizations/frameworks/FrameworkView.tsx +++ b/apps/console/src/pages/organizations/frameworks/FrameworkView.tsx @@ -29,7 +29,7 @@ const FrameworkViewQuery = graphql` ... on Framework { name description - controls(first: 100) @connection(key: "FrameworkView_controls") { + mitigations(first: 100) @connection(key: "FrameworkView_mitigations") { edges { node { id @@ -46,7 +46,7 @@ const FrameworkViewQuery = graphql` } `; -interface Control { +interface Mitigation { id?: string; name?: string; description?: string; @@ -61,7 +61,7 @@ interface Category { name: string; description: string; progress: number; - controls: Control[]; + mitigations: Mitigation[]; doneCount: number; totalCount: number; } @@ -73,14 +73,15 @@ function FrameworkViewContent({ }) { const data = usePreloadedQuery(FrameworkViewQuery, queryRef); const framework = data.node; - const controls = framework.controls?.edges.map((edge) => edge?.node) ?? []; + const mitigations = + framework.mitigations?.edges.map((edge) => edge?.node) ?? []; const navigate = useNavigate(); const { organizationId } = useParams(); // Monitor URL hash for changes and update state accordingly const [hashValue, setHashValue] = useState(window.location.hash); - // Get the active category from the hash (used when returning from a control) + // Get the active category from the hash (used when returning from a mitigation) const hashCategory = hashValue.substring(1) ? decodeURIComponent(hashValue.substring(1)) : ""; @@ -110,7 +111,7 @@ function FrameworkViewContent({ }; }, []); - // Map control state to status for the new design + // Map mitigation state to status for the new design const mapStateToStatus = (state?: string): string => { if (!state) return "incomplete"; switch (state) { @@ -125,17 +126,17 @@ function FrameworkViewContent({ } }; - const processedControls = controls.map((control) => ({ - ...control, - status: mapStateToStatus(control.state), + const processedControls = mitigations.map((mitigation) => ({ + ...mitigation, + status: mapStateToStatus(mitigation.state), })); // Calculate global progress const implementedCount = processedControls.filter( - (control) => control.status === "complete" + (mitigation) => mitigation.status === "complete" ).length; const notApplicableCount = processedControls.filter( - (control) => control.status === "not-applicable" + (mitigation) => mitigation.status === "not-applicable" ).length; const totalControls = processedControls.length; @@ -146,22 +147,22 @@ function FrameworkViewContent({ : 0; // Get global status counts - const globalStatusCounts = processedControls.reduce((acc, control) => { - if (control.status) { - acc[control.status] = (acc[control.status] || 0) + 1; + const globalStatusCounts = processedControls.reduce((acc, mitigation) => { + if (mitigation.status) { + acc[mitigation.status] = (acc[mitigation.status] || 0) + 1; } return acc; }, {} as Record); - // Group controls by category - const controlsByCategory = processedControls.reduce((acc, control) => { - if (!control?.category) return acc; - if (!acc[control.category]) { - acc[control.category] = []; + // Group mitigations by category + const controlsByCategory = processedControls.reduce((acc, mitigation) => { + if (!mitigation?.category) return acc; + if (!acc[mitigation.category]) { + acc[mitigation.category] = []; } - acc[control.category].push(control); + acc[mitigation.category].push(mitigation); return acc; - }, {} as Record); + }, {} as Record); // Function to toggle a category's expanded state - now supports multiple expanded categories const toggleCategory = (categoryId: string) => { @@ -177,10 +178,10 @@ function FrameworkViewContent({ const categories: Category[] = Object.entries(controlsByCategory) .map(([categoryName, categoryControls]) => { const catImplementedCount = categoryControls.filter( - (control) => control.status === "complete" + (mitigation) => mitigation.status === "complete" ).length; const catNotApplicableCount = categoryControls.filter( - (control) => control.status === "not-applicable" + (mitigation) => mitigation.status === "not-applicable" ).length; // Consider both "complete" and "not-applicable" as done for category progress const catDoneCount = catImplementedCount + catNotApplicableCount; @@ -194,14 +195,14 @@ function FrameworkViewContent({ name: categoryName, description: `Controls related to ${categoryName.toLowerCase()}`, progress: progress, - controls: categoryControls.sort((a, b) => + mitigations: categoryControls.sort((a, b) => (a.name || "").localeCompare(b.name || "") ), doneCount: catDoneCount, totalCount: catTotalCount, }; }) - .filter((category) => category.controls.length > 0) + .filter((category) => category.mitigations.length > 0) .sort((a, b) => a.name.localeCompare(b.name)); const getStatusIcon = (status: string) => { @@ -235,10 +236,10 @@ function FrameworkViewContent({
@@ -385,7 +386,7 @@ function FrameworkViewContent({ {isExpanded && ( - {category.controls.length > 0 ? ( + {category.mitigations.length > 0 ? (
@@ -396,16 +397,18 @@ function FrameworkViewContent({ - + - {category.controls.map((control) => ( + {category.mitigations.map((mitigation) => ( { - if (control?.id) { + if (mitigation?.id) { // Always store just this category in the hash // This is what will be expanded when returning const encoded = encodeURIComponent( @@ -427,7 +430,7 @@ function FrameworkViewContent({ // Use a small timeout to ensure the hash change is processed by the browser setTimeout(() => { navigate( - `/organizations/${organizationId}/frameworks/${framework.id}/controls/${control.id}` + `/organizations/${organizationId}/frameworks/${framework.id}/mitigations/${mitigation.id}` ); }, 100); } @@ -435,19 +438,19 @@ function FrameworkViewContent({ > @@ -457,7 +460,7 @@ function FrameworkViewContent({ ) : (
- No controls in this category + No mitigations in this category
)} diff --git a/apps/console/src/pages/organizations/frameworks/__generated__/FrameworkListViewImportFrameworkMutation.graphql.ts b/apps/console/src/pages/organizations/frameworks/__generated__/FrameworkListViewImportFrameworkMutation.graphql.ts index 036b2820f..d5f774ea5 100644 --- a/apps/console/src/pages/organizations/frameworks/__generated__/FrameworkListViewImportFrameworkMutation.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/__generated__/FrameworkListViewImportFrameworkMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<0d36f3f459adaca2f0abab59d9208bf9>> + * @generated SignedSource<<11936aad3da2565a509b1566774e0ecf>> * @lightSyntaxTransform * @nogrep */ @@ -9,7 +9,7 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type ControlState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; +export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; export type ImportFrameworkInput = { file: any; organizationId: string; @@ -22,17 +22,17 @@ export type FrameworkListViewImportFrameworkMutation$data = { readonly importFramework: { readonly frameworkEdge: { readonly node: { - readonly controls: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string; - readonly state: ControlState; - }; - }>; - }; readonly createdAt: string; readonly description: string; readonly id: string; + readonly mitigations: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly id: string; + readonly state: MitigationState; + }; + }>; + }; readonly name: string; readonly updatedAt: string; }; @@ -109,15 +109,15 @@ v4 = { "value": 100 } ], - "concreteType": "ControlConnection", + "concreteType": "MitigationConnection", "kind": "LinkedField", - "name": "controls", + "name": "mitigations", "plural": false, "selections": [ { "alias": null, "args": null, - "concreteType": "ControlEdge", + "concreteType": "MitigationEdge", "kind": "LinkedField", "name": "edges", "plural": true, @@ -125,7 +125,7 @@ v4 = { { "alias": null, "args": null, - "concreteType": "Control", + "concreteType": "Mitigation", "kind": "LinkedField", "name": "node", "plural": false, @@ -145,7 +145,7 @@ v4 = { "storageKey": null } ], - "storageKey": "controls(first:100)" + "storageKey": "mitigations(first:100)" }, { "alias": null, @@ -233,16 +233,16 @@ return { ] }, "params": { - "cacheID": "b225cace8b9956333d0175a7e0a4c04d", + "cacheID": "d2d34f8e054d753d956120ea14791f79", "id": null, "metadata": {}, "name": "FrameworkListViewImportFrameworkMutation", "operationKind": "mutation", - "text": "mutation FrameworkListViewImportFrameworkMutation(\n $input: ImportFrameworkInput!\n) {\n importFramework(input: $input) {\n frameworkEdge {\n node {\n id\n name\n description\n controls(first: 100) {\n edges {\n node {\n id\n state\n }\n }\n }\n createdAt\n updatedAt\n }\n }\n }\n}\n" + "text": "mutation FrameworkListViewImportFrameworkMutation(\n $input: ImportFrameworkInput!\n) {\n importFramework(input: $input) {\n frameworkEdge {\n node {\n id\n name\n description\n mitigations(first: 100) {\n edges {\n node {\n id\n state\n }\n }\n }\n createdAt\n updatedAt\n }\n }\n }\n}\n" } }; })(); -(node as any).hash = "fa1a8aa9d16bc50eac99392d3de59f6c"; +(node as any).hash = "a812db41b10d16c25959a5a733fe6088"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/__generated__/FrameworkListViewQuery.graphql.ts b/apps/console/src/pages/organizations/frameworks/__generated__/FrameworkListViewQuery.graphql.ts index 625d2c9ba..bdc45c71f 100644 --- a/apps/console/src/pages/organizations/frameworks/__generated__/FrameworkListViewQuery.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/__generated__/FrameworkListViewQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<6b6bb27f3ae9e9cf720be1c3655c595e>> * @lightSyntaxTransform * @nogrep */ @@ -9,7 +9,7 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type ControlState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; +export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; export type FrameworkListViewQuery$variables = { organizationId: string; }; @@ -18,17 +18,17 @@ export type FrameworkListViewQuery$data = { readonly frameworks?: { readonly edges: ReadonlyArray<{ readonly node: { - readonly controls: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string; - readonly state: ControlState; - }; - }>; - }; readonly createdAt: string; readonly description: string; readonly id: string; + readonly mitigations: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly id: string; + readonly state: MitigationState; + }; + }>; + }; readonly name: string; readonly updatedAt: string; }; @@ -112,15 +112,15 @@ v5 = [ { "alias": null, "args": (v3/*: any*/), - "concreteType": "ControlConnection", + "concreteType": "MitigationConnection", "kind": "LinkedField", - "name": "controls", + "name": "mitigations", "plural": false, "selections": [ { "alias": null, "args": null, - "concreteType": "ControlEdge", + "concreteType": "MitigationEdge", "kind": "LinkedField", "name": "edges", "plural": true, @@ -128,7 +128,7 @@ v5 = [ { "alias": null, "args": null, - "concreteType": "Control", + "concreteType": "Mitigation", "kind": "LinkedField", "name": "node", "plural": false, @@ -148,7 +148,7 @@ v5 = [ "storageKey": null } ], - "storageKey": "controls(first:100)" + "storageKey": "mitigations(first:100)" }, { "alias": null, @@ -291,7 +291,7 @@ return { ] }, "params": { - "cacheID": "88bb77e2d10398380353d5a90ba5d6d6", + "cacheID": "e5d4da21773770d146fb7d91e435caef", "id": null, "metadata": { "connection": [ @@ -308,11 +308,11 @@ return { }, "name": "FrameworkListViewQuery", "operationKind": "query", - "text": "query FrameworkListViewQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n frameworks(first: 100) {\n edges {\n node {\n id\n name\n description\n controls(first: 100) {\n edges {\n node {\n id\n state\n }\n }\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n id\n }\n}\n" + "text": "query FrameworkListViewQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n frameworks(first: 100) {\n edges {\n node {\n id\n name\n description\n mitigations(first: 100) {\n edges {\n node {\n id\n state\n }\n }\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n id\n }\n}\n" } }; })(); -(node as any).hash = "e5d315fb00e4fee74b53685b6441ed54"; +(node as any).hash = "8da147529de5e229e38b836bd584e484"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/__generated__/FrameworkViewQuery.graphql.ts b/apps/console/src/pages/organizations/frameworks/__generated__/FrameworkViewQuery.graphql.ts index 3db6952b5..178230c8e 100644 --- a/apps/console/src/pages/organizations/frameworks/__generated__/FrameworkViewQuery.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/__generated__/FrameworkViewQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<1abc57788d51404af0931c7e120c01a7>> * @lightSyntaxTransform * @nogrep */ @@ -9,27 +9,27 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type ControlImportance = "ADVANCED" | "MANDATORY" | "PREFERRED"; -export type ControlState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; +export type MitigationImportance = "ADVANCED" | "MANDATORY" | "PREFERRED"; +export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; export type FrameworkViewQuery$variables = { frameworkId: string; }; export type FrameworkViewQuery$data = { readonly node: { - readonly controls?: { + readonly description?: string; + readonly id: string; + readonly mitigations?: { readonly edges: ReadonlyArray<{ readonly node: { readonly category: string; readonly description: string; readonly id: string; - readonly importance: ControlImportance; + readonly importance: MitigationImportance; readonly name: string; - readonly state: ControlState; + readonly state: MitigationState; }; }>; }; - readonly description?: string; - readonly id: string; readonly name?: string; }; }; @@ -85,7 +85,7 @@ v6 = [ { "alias": null, "args": null, - "concreteType": "ControlEdge", + "concreteType": "MitigationEdge", "kind": "LinkedField", "name": "edges", "plural": true, @@ -93,7 +93,7 @@ v6 = [ { "alias": null, "args": null, - "concreteType": "Control", + "concreteType": "Mitigation", "kind": "LinkedField", "name": "node", "plural": false, @@ -191,11 +191,11 @@ return { (v3/*: any*/), (v4/*: any*/), { - "alias": "controls", + "alias": "mitigations", "args": null, - "concreteType": "ControlConnection", + "concreteType": "MitigationConnection", "kind": "LinkedField", - "name": "__FrameworkView_controls_connection", + "name": "__FrameworkView_mitigations_connection", "plural": false, "selections": (v6/*: any*/), "storageKey": null @@ -235,21 +235,21 @@ return { { "alias": null, "args": (v7/*: any*/), - "concreteType": "ControlConnection", + "concreteType": "MitigationConnection", "kind": "LinkedField", - "name": "controls", + "name": "mitigations", "plural": false, "selections": (v6/*: any*/), - "storageKey": "controls(first:100)" + "storageKey": "mitigations(first:100)" }, { "alias": null, "args": (v7/*: any*/), "filters": null, "handle": "connection", - "key": "FrameworkView_controls", + "key": "FrameworkView_mitigations", "kind": "LinkedHandle", - "name": "controls" + "name": "mitigations" } ], "type": "Framework", @@ -261,7 +261,7 @@ return { ] }, "params": { - "cacheID": "f8edefde219c5fa1a5c7c85e287d846a", + "cacheID": "c60a352d14662dd43ab93b9a4dcebee8", "id": null, "metadata": { "connection": [ @@ -271,18 +271,18 @@ return { "direction": "forward", "path": [ "node", - "controls" + "mitigations" ] } ] }, "name": "FrameworkViewQuery", "operationKind": "query", - "text": "query FrameworkViewQuery(\n $frameworkId: ID!\n) {\n node(id: $frameworkId) {\n __typename\n id\n ... on Framework {\n name\n description\n controls(first: 100) {\n edges {\n node {\n id\n name\n description\n state\n category\n importance\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n" + "text": "query FrameworkViewQuery(\n $frameworkId: ID!\n) {\n node(id: $frameworkId) {\n __typename\n id\n ... on Framework {\n name\n description\n mitigations(first: 100) {\n edges {\n node {\n id\n name\n description\n state\n category\n importance\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n" } }; })(); -(node as any).hash = "9e8a9b37d956ec4c9dfba88e7b1120f3"; +(node as any).hash = "f65af17f461e1c112573c0d14d08479d"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/controls/UpdateControlPage.tsx b/apps/console/src/pages/organizations/frameworks/mitigations/CreateMitigationPage.tsx similarity index 58% rename from apps/console/src/pages/organizations/frameworks/controls/UpdateControlPage.tsx rename to apps/console/src/pages/organizations/frameworks/mitigations/CreateMitigationPage.tsx index f3e38b29d..39f05dd52 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/UpdateControlPage.tsx +++ b/apps/console/src/pages/organizations/frameworks/mitigations/CreateMitigationPage.tsx @@ -1,29 +1,32 @@ import { PageTemplateSkeleton } from "@/components/PageTemplate"; -import { Suspense } from "react"; -import { lazy } from "@probo/react-lazy"; -import { useLocation } from "react-router"; import { ErrorBoundaryWithLocation } from "../../ErrorBoundary"; +import { Suspense } from "react"; +import { useLocation } from "react-router"; +import { lazy } from "@probo/react-lazy"; -const UpdateControlView = lazy(() => import("./UpdateControlView")); +const CreateMitigationView = lazy(() => import("./CreateMitigationView")); -export function UpdateControlViewSkeleton() { +export function CreateMitigationViewSkeleton() { return (
); } -export function UpdateControlPage() { +export function CreateMitigationPage() { const location = useLocation(); return ( - }> + } + > - + ); diff --git a/apps/console/src/pages/organizations/frameworks/controls/CreateControlView.tsx b/apps/console/src/pages/organizations/frameworks/mitigations/CreateMitigationView.tsx similarity index 81% rename from apps/console/src/pages/organizations/frameworks/controls/CreateControlView.tsx rename to apps/console/src/pages/organizations/frameworks/mitigations/CreateMitigationView.tsx index e2c68520d..3b597325d 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/CreateControlView.tsx +++ b/apps/console/src/pages/organizations/frameworks/mitigations/CreateMitigationView.tsx @@ -17,19 +17,19 @@ import { SelectValue, } from "@/components/ui/select"; import { - CreateControlViewCreateControlMutation, - ControlImportance, -} from "./__generated__/CreateControlViewCreateControlMutation.graphql"; + CreateMitigationViewCreateMitigationMutation, + MitigationImportance, +} from "./__generated__/CreateMitigationViewCreateMitigationMutation.graphql"; import { PageTemplate } from "@/components/PageTemplate"; -import { CreateControlViewSkeleton } from "./CreateControlPage"; +import { CreateMitigationViewSkeleton } from "./CreateMitigationPage"; -const createControlMutation = graphql` - mutation CreateControlViewCreateControlMutation( - $input: CreateControlInput! +const createMitigationMutation = graphql` + mutation CreateMitigationViewCreateMitigationMutation( + $input: CreateMitigationInput! $connections: [ID!]! ) { - createControl(input: $input) { - controlEdge @prependEdge(connections: $connections) { + createMitigation(input: $input) { + mitigationEdge @prependEdge(connections: $connections) { node { id name @@ -103,7 +103,7 @@ function EditableField({ ); } -function CreateControlViewContent() { +function CreateMitigationViewContent() { const { organizationId, frameworkId } = useParams(); const navigate = useNavigate(); const { toast } = useToast(); @@ -111,11 +111,13 @@ function CreateControlViewContent() { name: "", description: "", category: "", - importance: "MANDATORY" as ControlImportance, + importance: "MANDATORY" as MitigationImportance, }); const [commit, isInFlight] = - useMutation(createControlMutation); + useMutation( + createMitigationMutation + ); const handleFieldChange = (field: keyof typeof formData, value: unknown) => { setFormData((prev) => ({ @@ -138,7 +140,7 @@ function CreateControlViewContent() { const connectionId = ConnectionHandler.getConnectionID( frameworkId!, - "FrameworkOverviewPage_controls" + "FrameworkOverviewPage_mitigations" ); commit({ @@ -156,7 +158,7 @@ function CreateControlViewContent() { if (errors) { toast({ title: "Error", - description: errors[0]?.message || "Failed to create control", + description: errors[0]?.message || "Failed to create mitigation", variant: "destructive", }); return; @@ -164,17 +166,17 @@ function CreateControlViewContent() { toast({ title: "Success", - description: "Control created successfully", + description: "Mitigation created successfully", }); navigate( - `/organizations/${organizationId}/frameworks/${frameworkId}/controls/${data.createControl.controlEdge.node.id}` + `/organizations/${organizationId}/frameworks/${frameworkId}/mitigations/${data.createMitigation.mitigationEdge.node.id}` ); }, onError(error) { toast({ title: "Error", - description: error.message || "Failed to create control", + description: error.message || "Failed to create mitigation", variant: "destructive", }); }, @@ -183,8 +185,8 @@ function CreateControlViewContent() { return ( @@ -200,7 +202,7 @@ function CreateControlViewContent() { value={formData.category} onChange={(value) => handleFieldChange("category", value)} required - helpText="The category this control belongs to" + helpText="The category this mitigation belongs to" /> handleFieldChange("description", value)} required multiline - helpText="Provide a detailed description of the control" + helpText="Provide a detailed description of the mitigation" />
@@ -219,7 +221,7 @@ function CreateControlViewContent() {
- {formatState(data.control.state)} + {formatState(data.mitigation.state)}
@@ -1283,10 +1288,10 @@ function ControlViewContent({
- {formatImportance(data.control.importance)} + {formatImportance(data.mitigation.importance)}
} @@ -1295,7 +1300,7 @@ function ControlViewContent({
- {data.control.description} + {data.mitigation.description}
@@ -1320,8 +1325,8 @@ function ControlViewContent({ Create New Task - Add a new task to this control. Click save when you're - done. + Add a new task to this mitigation. Click save when + you're done.
@@ -2530,24 +2535,24 @@ function ControlViewContent({ ); } -export default function ControlView() { - const { controlId } = useParams(); +export default function MitigationView() { + const { mitigationId } = useParams(); const [queryRef, loadQuery] = - useQueryLoader(controlViewQuery); + useQueryLoader(mitigationViewQuery); useEffect(() => { - if (controlId) { - loadQuery({ controlId }); + if (mitigationId) { + loadQuery({ mitigationId }); } - }, [controlId, loadQuery]); + }, [mitigationId, loadQuery]); if (!queryRef) { - return ; + return ; } return ( - }> - + }> + ); } diff --git a/apps/console/src/pages/organizations/frameworks/controls/CreateControlPage.tsx b/apps/console/src/pages/organizations/frameworks/mitigations/UpdateMitigationPage.tsx similarity index 59% rename from apps/console/src/pages/organizations/frameworks/controls/CreateControlPage.tsx rename to apps/console/src/pages/organizations/frameworks/mitigations/UpdateMitigationPage.tsx index dc4139dae..eccc68a18 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/CreateControlPage.tsx +++ b/apps/console/src/pages/organizations/frameworks/mitigations/UpdateMitigationPage.tsx @@ -1,29 +1,32 @@ import { PageTemplateSkeleton } from "@/components/PageTemplate"; -import { ErrorBoundaryWithLocation } from "../../ErrorBoundary"; import { Suspense } from "react"; -import { useLocation } from "react-router"; import { lazy } from "@probo/react-lazy"; +import { useLocation } from "react-router"; +import { ErrorBoundaryWithLocation } from "../../ErrorBoundary"; -const CreateControlView = lazy(() => import("./CreateControlView")); +const UpdateMitigationView = lazy(() => import("./UpdateMitigationView")); -export function CreateControlViewSkeleton() { +export function UpdateMitigationViewSkeleton() { return (
); } -export function CreateControlPage() { +export function UpdateMitigationPage() { const location = useLocation(); return ( - }> + } + > - + ); diff --git a/apps/console/src/pages/organizations/frameworks/controls/UpdateControlView.tsx b/apps/console/src/pages/organizations/frameworks/mitigations/UpdateMitigationView.tsx similarity index 81% rename from apps/console/src/pages/organizations/frameworks/controls/UpdateControlView.tsx rename to apps/console/src/pages/organizations/frameworks/mitigations/UpdateMitigationView.tsx index 8b183cfd0..36cded475 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/UpdateControlView.tsx +++ b/apps/console/src/pages/organizations/frameworks/mitigations/UpdateMitigationView.tsx @@ -22,18 +22,20 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; -import type { UpdateControlViewUpdateControlMutation as UpdateControlViewUpdateControlMutationType } from "./__generated__/UpdateControlViewUpdateControlMutation.graphql"; import type { - ControlState, - ControlImportance, -} from "./__generated__/UpdateControlViewUpdateControlMutation.graphql"; + MitigationState, + MitigationImportance, + UpdateMitigationViewUpdateMitigationMutation, +} from "./__generated__/UpdateMitigationViewUpdateMitigationMutation.graphql"; import { PageTemplate } from "@/components/PageTemplate"; -import { UpdateControlViewSkeleton } from "./UpdateControlPage"; +import { MitigationViewSkeleton } from "./MitigationPage"; -const updateControlMutation = graphql` - mutation UpdateControlViewUpdateControlMutation($input: UpdateControlInput!) { - updateControl(input: $input) { - control { +const updateMitigationMutation = graphql` + mutation UpdateMitigationViewUpdateMitigationMutation( + $input: UpdateMitigationInput! + ) { + updateMitigation(input: $input) { + mitigation { id name description @@ -46,10 +48,10 @@ const updateControlMutation = graphql` } `; -const updateControlQuery = graphql` - query UpdateControlViewQuery($controlId: ID!) { - node(id: $controlId) { - ... on Control { +const updateMitigationQuery = graphql` + query UpdateMitigationViewQuery($mitigationId: ID!) { + node(id: $mitigationId) { + ... on Mitigation { id name description @@ -123,16 +125,16 @@ function EditableField({ ); } -function UpdateControlViewContent({ +function UpdateMitigationViewContent({ queryRef, }: { // eslint-disable-next-line @typescript-eslint/no-explicit-any queryRef: PreloadedQuery; }) { - const { organizationId, frameworkId, controlId } = useParams(); + const { organizationId, frameworkId, mitigationId } = useParams(); const navigate = useNavigate(); const { toast } = useToast(); - const data = usePreloadedQuery(updateControlQuery, queryRef); + const data = usePreloadedQuery(updateMitigationQuery, queryRef); const [editedFields, setEditedFields] = useState>(new Set()); const [formData, setFormData] = useState({ name: "", @@ -155,8 +157,8 @@ function UpdateControlViewContent({ }, [data.node]); const [commit, isInFlight] = - useMutation( - updateControlMutation + useMutation( + updateMitigationMutation ); const handleFieldChange = (field: keyof typeof formData, value: string) => { @@ -169,7 +171,7 @@ function UpdateControlViewContent({ const handleCancel = () => { navigate( - `/organizations/${organizationId}/frameworks/${frameworkId}/controls/${controlId}` + `/organizations/${organizationId}/frameworks/${frameworkId}/mitigations/${mitigationId}` ); }; @@ -193,10 +195,10 @@ function UpdateControlViewContent({ name?: string; description?: string; category?: string; - state?: ControlState; - importance?: ControlImportance; + state?: MitigationState; + importance?: MitigationImportance; } = { - id: controlId!, + id: mitigationId!, expectedVersion: data.node.version, }; @@ -210,10 +212,10 @@ function UpdateControlViewContent({ input.category = formData.category; } if (editedFields.has("state")) { - input.state = formData.state as ControlState; + input.state = formData.state as MitigationState; } if (editedFields.has("importance")) { - input.importance = formData.importance as ControlImportance; + input.importance = formData.importance as MitigationImportance; } commit({ @@ -224,7 +226,7 @@ function UpdateControlViewContent({ if (errors) { toast({ title: "Error", - description: errors[0]?.message || "Failed to update control", + description: errors[0]?.message || "Failed to update mitigation", variant: "destructive", }); return; @@ -232,17 +234,17 @@ function UpdateControlViewContent({ toast({ title: "Success", - description: "Control updated successfully", + description: "Mitigation updated successfully", }); navigate( - `/organizations/${organizationId}/frameworks/${frameworkId}/controls/${controlId}` + `/organizations/${organizationId}/frameworks/${frameworkId}/mitigations/${mitigationId}` ); }, onError(error) { toast({ title: "Error", - description: error.message || "Failed to update control", + description: error.message || "Failed to update mitigation", variant: "destructive", }); }, @@ -251,8 +253,8 @@ function UpdateControlViewContent({ return ( @@ -269,7 +271,7 @@ function UpdateControlViewContent({ onChange={(value) => handleFieldChange("description", value)} required multiline - helpText="Provide a detailed description of the control" + helpText="Provide a detailed description of the mitigation" />
@@ -333,23 +335,23 @@ function UpdateControlViewContent({ } export default function UpdateControlView() { - const { controlId } = useParams(); + const { mitigationId } = useParams(); // eslint-disable-next-line @typescript-eslint/no-explicit-any - const [queryRef, loadQuery] = useQueryLoader(updateControlQuery); + const [queryRef, loadQuery] = useQueryLoader(updateMitigationQuery); useEffect(() => { - if (controlId) { - loadQuery({ controlId }); + if (mitigationId) { + loadQuery({ mitigationId }); } - }, [controlId, loadQuery]); + }, [mitigationId, loadQuery]); if (!queryRef) { - return ; + return ; } return ( - }> - + }> + ); } diff --git a/apps/console/src/pages/organizations/frameworks/controls/__generated__/CreateControlViewCreateControlMutation.graphql.ts b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/CreateMitigationViewCreateMitigationMutation.graphql.ts similarity index 65% rename from apps/console/src/pages/organizations/frameworks/controls/__generated__/CreateControlViewCreateControlMutation.graphql.ts rename to apps/console/src/pages/organizations/frameworks/mitigations/__generated__/CreateMitigationViewCreateMitigationMutation.graphql.ts index 0f07761e3..63c02a2c3 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/__generated__/CreateControlViewCreateControlMutation.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/CreateMitigationViewCreateMitigationMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<22a6faa89009d6784bc9a89c2456f12e>> * @lightSyntaxTransform * @nogrep */ @@ -9,35 +9,35 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type ControlImportance = "ADVANCED" | "MANDATORY" | "PREFERRED"; -export type ControlState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; -export type CreateControlInput = { +export type MitigationImportance = "ADVANCED" | "MANDATORY" | "PREFERRED"; +export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; +export type CreateMitigationInput = { category: string; description: string; frameworkId: string; - importance: ControlImportance; + importance: MitigationImportance; name: string; }; -export type CreateControlViewCreateControlMutation$variables = { +export type CreateMitigationViewCreateMitigationMutation$variables = { connections: ReadonlyArray; - input: CreateControlInput; + input: CreateMitigationInput; }; -export type CreateControlViewCreateControlMutation$data = { - readonly createControl: { - readonly controlEdge: { +export type CreateMitigationViewCreateMitigationMutation$data = { + readonly createMitigation: { + readonly mitigationEdge: { readonly node: { readonly category: string; readonly description: string; readonly id: string; readonly name: string; - readonly state: ControlState; + readonly state: MitigationState; }; }; }; }; -export type CreateControlViewCreateControlMutation = { - response: CreateControlViewCreateControlMutation$data; - variables: CreateControlViewCreateControlMutation$variables; +export type CreateMitigationViewCreateMitigationMutation = { + response: CreateMitigationViewCreateMitigationMutation$data; + variables: CreateMitigationViewCreateMitigationMutation$variables; }; const node: ConcreteRequest = (function(){ @@ -61,15 +61,15 @@ v2 = [ v3 = { "alias": null, "args": null, - "concreteType": "ControlEdge", + "concreteType": "MitigationEdge", "kind": "LinkedField", - "name": "controlEdge", + "name": "mitigationEdge", "plural": false, "selections": [ { "alias": null, "args": null, - "concreteType": "Control", + "concreteType": "Mitigation", "kind": "LinkedField", "name": "node", "plural": false, @@ -123,14 +123,14 @@ return { ], "kind": "Fragment", "metadata": null, - "name": "CreateControlViewCreateControlMutation", + "name": "CreateMitigationViewCreateMitigationMutation", "selections": [ { "alias": null, "args": (v2/*: any*/), - "concreteType": "CreateControlPayload", + "concreteType": "CreateMitigationPayload", "kind": "LinkedField", - "name": "createControl", + "name": "createMitigation", "plural": false, "selections": [ (v3/*: any*/) @@ -148,14 +148,14 @@ return { (v0/*: any*/) ], "kind": "Operation", - "name": "CreateControlViewCreateControlMutation", + "name": "CreateMitigationViewCreateMitigationMutation", "selections": [ { "alias": null, "args": (v2/*: any*/), - "concreteType": "CreateControlPayload", + "concreteType": "CreateMitigationPayload", "kind": "LinkedField", - "name": "createControl", + "name": "createMitigation", "plural": false, "selections": [ (v3/*: any*/), @@ -166,7 +166,7 @@ return { "handle": "prependEdge", "key": "", "kind": "LinkedHandle", - "name": "controlEdge", + "name": "mitigationEdge", "handleArgs": [ { "kind": "Variable", @@ -181,16 +181,16 @@ return { ] }, "params": { - "cacheID": "f0f7112f1eb67ed8e7f0fe38b427b0c5", + "cacheID": "09c15768681bc81e7035ff20e90e81a0", "id": null, "metadata": {}, - "name": "CreateControlViewCreateControlMutation", + "name": "CreateMitigationViewCreateMitigationMutation", "operationKind": "mutation", - "text": "mutation CreateControlViewCreateControlMutation(\n $input: CreateControlInput!\n) {\n createControl(input: $input) {\n controlEdge {\n node {\n id\n name\n description\n category\n state\n }\n }\n }\n}\n" + "text": "mutation CreateMitigationViewCreateMitigationMutation(\n $input: CreateMitigationInput!\n) {\n createMitigation(input: $input) {\n mitigationEdge {\n node {\n id\n name\n description\n category\n state\n }\n }\n }\n}\n" } }; })(); -(node as any).hash = "b9b19ec5600f99a2a8e75e0bd9f86355"; +(node as any).hash = "42db1acd8c6e92678c9e6355a77e1eb6"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewAssignTaskMutation.graphql.ts b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewAssignTaskMutation.graphql.ts similarity index 76% rename from apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewAssignTaskMutation.graphql.ts rename to apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewAssignTaskMutation.graphql.ts index 623a9ac9d..ee7a65050 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewAssignTaskMutation.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewAssignTaskMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<18bc7a503d34d2bcb4cdfb6b4cfc1912>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -13,10 +13,10 @@ export type AssignTaskInput = { assignedToId: string; taskId: string; }; -export type ControlViewAssignTaskMutation$variables = { +export type MitigationViewAssignTaskMutation$variables = { input: AssignTaskInput; }; -export type ControlViewAssignTaskMutation$data = { +export type MitigationViewAssignTaskMutation$data = { readonly assignTask: { readonly task: { readonly assignedTo: { @@ -29,9 +29,9 @@ export type ControlViewAssignTaskMutation$data = { }; }; }; -export type ControlViewAssignTaskMutation = { - response: ControlViewAssignTaskMutation$data; - variables: ControlViewAssignTaskMutation$variables; +export type MitigationViewAssignTaskMutation = { + response: MitigationViewAssignTaskMutation$data; + variables: MitigationViewAssignTaskMutation$variables; }; const node: ConcreteRequest = (function(){ @@ -118,7 +118,7 @@ return { "argumentDefinitions": (v0/*: any*/), "kind": "Fragment", "metadata": null, - "name": "ControlViewAssignTaskMutation", + "name": "MitigationViewAssignTaskMutation", "selections": (v2/*: any*/), "type": "Mutation", "abstractKey": null @@ -127,20 +127,20 @@ return { "operation": { "argumentDefinitions": (v0/*: any*/), "kind": "Operation", - "name": "ControlViewAssignTaskMutation", + "name": "MitigationViewAssignTaskMutation", "selections": (v2/*: any*/) }, "params": { - "cacheID": "0a406c0e166607d86896adc0dfb5618e", + "cacheID": "b336b45b0dad20968af93b52cd0aac48", "id": null, "metadata": {}, - "name": "ControlViewAssignTaskMutation", + "name": "MitigationViewAssignTaskMutation", "operationKind": "mutation", - "text": "mutation ControlViewAssignTaskMutation(\n $input: AssignTaskInput!\n) {\n assignTask(input: $input) {\n task {\n id\n version\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n }\n }\n}\n" + "text": "mutation MitigationViewAssignTaskMutation(\n $input: AssignTaskInput!\n) {\n assignTask(input: $input) {\n task {\n id\n version\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n }\n }\n}\n" } }; })(); -(node as any).hash = "1a9a18038c2f6ad39d3efe61d2d0e33d"; +(node as any).hash = "6446830361465b47f185c50b2886a422"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewCreateTaskMutation.graphql.ts b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewCreateTaskMutation.graphql.ts similarity index 82% rename from apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewCreateTaskMutation.graphql.ts rename to apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewCreateTaskMutation.graphql.ts index 8ecffdc17..83b7d8446 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewCreateTaskMutation.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewCreateTaskMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<93ac47858fbd7c339faac83f193cb21b>> + * @generated SignedSource<<958545e211155678a1a43d8ef1717071>> * @lightSyntaxTransform * @nogrep */ @@ -12,16 +12,16 @@ import { ConcreteRequest } from 'relay-runtime'; export type TaskState = "DONE" | "TODO"; export type CreateTaskInput = { assignedToId?: string | null | undefined; - controlId: string; description: string; + mitigationId: string; name: string; timeEstimate?: any | null | undefined; }; -export type ControlViewCreateTaskMutation$variables = { +export type MitigationViewCreateTaskMutation$variables = { connections: ReadonlyArray; input: CreateTaskInput; }; -export type ControlViewCreateTaskMutation$data = { +export type MitigationViewCreateTaskMutation$data = { readonly createTask: { readonly taskEdge: { readonly node: { @@ -40,9 +40,9 @@ export type ControlViewCreateTaskMutation$data = { }; }; }; -export type ControlViewCreateTaskMutation = { - response: ControlViewCreateTaskMutation$data; - variables: ControlViewCreateTaskMutation$variables; +export type MitigationViewCreateTaskMutation = { + response: MitigationViewCreateTaskMutation$data; + variables: MitigationViewCreateTaskMutation$variables; }; const node: ConcreteRequest = (function(){ @@ -162,7 +162,7 @@ return { ], "kind": "Fragment", "metadata": null, - "name": "ControlViewCreateTaskMutation", + "name": "MitigationViewCreateTaskMutation", "selections": [ { "alias": null, @@ -187,7 +187,7 @@ return { (v0/*: any*/) ], "kind": "Operation", - "name": "ControlViewCreateTaskMutation", + "name": "MitigationViewCreateTaskMutation", "selections": [ { "alias": null, @@ -220,16 +220,16 @@ return { ] }, "params": { - "cacheID": "f823a58c96ee652fd522df58de3710a1", + "cacheID": "dedf546da903060c79209ab7695bde12", "id": null, "metadata": {}, - "name": "ControlViewCreateTaskMutation", + "name": "MitigationViewCreateTaskMutation", "operationKind": "mutation", - "text": "mutation ControlViewCreateTaskMutation(\n $input: CreateTaskInput!\n) {\n createTask(input: $input) {\n taskEdge {\n node {\n id\n name\n description\n timeEstimate\n state\n version\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n }\n }\n }\n}\n" + "text": "mutation MitigationViewCreateTaskMutation(\n $input: CreateTaskInput!\n) {\n createTask(input: $input) {\n taskEdge {\n node {\n id\n name\n description\n timeEstimate\n state\n version\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n }\n }\n }\n}\n" } }; })(); -(node as any).hash = "5d50a685dad17446a0cab1891dc00374"; +(node as any).hash = "683fe4d2a3d33e989a8b5593f99799a5"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewDeleteEvidenceMutation.graphql.ts b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewDeleteEvidenceMutation.graphql.ts similarity index 74% rename from apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewDeleteEvidenceMutation.graphql.ts rename to apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewDeleteEvidenceMutation.graphql.ts index 8f71657a3..21fa8147d 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewDeleteEvidenceMutation.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewDeleteEvidenceMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<5cc5a8fcb02623e685586d2f3510fb4a>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -12,18 +12,18 @@ import { ConcreteRequest } from 'relay-runtime'; export type DeleteEvidenceInput = { evidenceId: string; }; -export type ControlViewDeleteEvidenceMutation$variables = { +export type MitigationViewDeleteEvidenceMutation$variables = { connections: ReadonlyArray; input: DeleteEvidenceInput; }; -export type ControlViewDeleteEvidenceMutation$data = { +export type MitigationViewDeleteEvidenceMutation$data = { readonly deleteEvidence: { readonly deletedEvidenceId: string; }; }; -export type ControlViewDeleteEvidenceMutation = { - response: ControlViewDeleteEvidenceMutation$data; - variables: ControlViewDeleteEvidenceMutation$variables; +export type MitigationViewDeleteEvidenceMutation = { + response: MitigationViewDeleteEvidenceMutation$data; + variables: MitigationViewDeleteEvidenceMutation$variables; }; const node: ConcreteRequest = (function(){ @@ -59,7 +59,7 @@ return { ], "kind": "Fragment", "metadata": null, - "name": "ControlViewDeleteEvidenceMutation", + "name": "MitigationViewDeleteEvidenceMutation", "selections": [ { "alias": null, @@ -84,7 +84,7 @@ return { (v0/*: any*/) ], "kind": "Operation", - "name": "ControlViewDeleteEvidenceMutation", + "name": "MitigationViewDeleteEvidenceMutation", "selections": [ { "alias": null, @@ -117,16 +117,16 @@ return { ] }, "params": { - "cacheID": "594da4829274c817424f9b84ba99a5a6", + "cacheID": "4770e84f6f87fb95b9f102cf8e572f44", "id": null, "metadata": {}, - "name": "ControlViewDeleteEvidenceMutation", + "name": "MitigationViewDeleteEvidenceMutation", "operationKind": "mutation", - "text": "mutation ControlViewDeleteEvidenceMutation(\n $input: DeleteEvidenceInput!\n) {\n deleteEvidence(input: $input) {\n deletedEvidenceId\n }\n}\n" + "text": "mutation MitigationViewDeleteEvidenceMutation(\n $input: DeleteEvidenceInput!\n) {\n deleteEvidence(input: $input) {\n deletedEvidenceId\n }\n}\n" } }; })(); -(node as any).hash = "a6b5e90e931adf04f45be9403b291ad9"; +(node as any).hash = "993f84f2e310e888a78200abb9b79ae0"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewDeleteTaskMutation.graphql.ts b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewDeleteTaskMutation.graphql.ts similarity index 75% rename from apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewDeleteTaskMutation.graphql.ts rename to apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewDeleteTaskMutation.graphql.ts index c08df0303..dc4e43713 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewDeleteTaskMutation.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewDeleteTaskMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -12,18 +12,18 @@ import { ConcreteRequest } from 'relay-runtime'; export type DeleteTaskInput = { taskId: string; }; -export type ControlViewDeleteTaskMutation$variables = { +export type MitigationViewDeleteTaskMutation$variables = { connections: ReadonlyArray; input: DeleteTaskInput; }; -export type ControlViewDeleteTaskMutation$data = { +export type MitigationViewDeleteTaskMutation$data = { readonly deleteTask: { readonly deletedTaskId: string; }; }; -export type ControlViewDeleteTaskMutation = { - response: ControlViewDeleteTaskMutation$data; - variables: ControlViewDeleteTaskMutation$variables; +export type MitigationViewDeleteTaskMutation = { + response: MitigationViewDeleteTaskMutation$data; + variables: MitigationViewDeleteTaskMutation$variables; }; const node: ConcreteRequest = (function(){ @@ -59,7 +59,7 @@ return { ], "kind": "Fragment", "metadata": null, - "name": "ControlViewDeleteTaskMutation", + "name": "MitigationViewDeleteTaskMutation", "selections": [ { "alias": null, @@ -84,7 +84,7 @@ return { (v0/*: any*/) ], "kind": "Operation", - "name": "ControlViewDeleteTaskMutation", + "name": "MitigationViewDeleteTaskMutation", "selections": [ { "alias": null, @@ -117,16 +117,16 @@ return { ] }, "params": { - "cacheID": "36b910121f02343b2e920adda58d7032", + "cacheID": "f586e9c07d233eb31a72c2564c448fe4", "id": null, "metadata": {}, - "name": "ControlViewDeleteTaskMutation", + "name": "MitigationViewDeleteTaskMutation", "operationKind": "mutation", - "text": "mutation ControlViewDeleteTaskMutation(\n $input: DeleteTaskInput!\n) {\n deleteTask(input: $input) {\n deletedTaskId\n }\n}\n" + "text": "mutation MitigationViewDeleteTaskMutation(\n $input: DeleteTaskInput!\n) {\n deleteTask(input: $input) {\n deletedTaskId\n }\n}\n" } }; })(); -(node as any).hash = "3aa9ea0eca32df8e6fe0258ee1140e56"; +(node as any).hash = "2d6cfcb4704b95bc89f9f4715488d133"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewGetEvidenceFileUrlQuery.graphql.ts b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewGetEvidenceFileUrlQuery.graphql.ts similarity index 73% rename from apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewGetEvidenceFileUrlQuery.graphql.ts rename to apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewGetEvidenceFileUrlQuery.graphql.ts index bc3bc976e..d3570928e 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewGetEvidenceFileUrlQuery.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewGetEvidenceFileUrlQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<6097cb76bff61c342c2b6389a8e7f618>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -9,18 +9,18 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type ControlViewGetEvidenceFileUrlQuery$variables = { +export type MitigationViewGetEvidenceFileUrlQuery$variables = { evidenceId: string; }; -export type ControlViewGetEvidenceFileUrlQuery$data = { +export type MitigationViewGetEvidenceFileUrlQuery$data = { readonly node: { readonly fileUrl?: string | null | undefined; readonly id?: string; }; }; -export type ControlViewGetEvidenceFileUrlQuery = { - response: ControlViewGetEvidenceFileUrlQuery$data; - variables: ControlViewGetEvidenceFileUrlQuery$variables; +export type MitigationViewGetEvidenceFileUrlQuery = { + response: MitigationViewGetEvidenceFileUrlQuery$data; + variables: MitigationViewGetEvidenceFileUrlQuery$variables; }; const node: ConcreteRequest = (function(){ @@ -57,7 +57,7 @@ return { "argumentDefinitions": (v0/*: any*/), "kind": "Fragment", "metadata": null, - "name": "ControlViewGetEvidenceFileUrlQuery", + "name": "MitigationViewGetEvidenceFileUrlQuery", "selections": [ { "alias": null, @@ -87,7 +87,7 @@ return { "operation": { "argumentDefinitions": (v0/*: any*/), "kind": "Operation", - "name": "ControlViewGetEvidenceFileUrlQuery", + "name": "MitigationViewGetEvidenceFileUrlQuery", "selections": [ { "alias": null, @@ -119,16 +119,16 @@ return { ] }, "params": { - "cacheID": "b656f027db1774647bcd0eefad36f66f", + "cacheID": "1dc81a5d665b9141b5cd62ef893ff0e1", "id": null, "metadata": {}, - "name": "ControlViewGetEvidenceFileUrlQuery", + "name": "MitigationViewGetEvidenceFileUrlQuery", "operationKind": "query", - "text": "query ControlViewGetEvidenceFileUrlQuery(\n $evidenceId: ID!\n) {\n node(id: $evidenceId) {\n __typename\n ... on Evidence {\n id\n fileUrl\n }\n id\n }\n}\n" + "text": "query MitigationViewGetEvidenceFileUrlQuery(\n $evidenceId: ID!\n) {\n node(id: $evidenceId) {\n __typename\n ... on Evidence {\n id\n fileUrl\n }\n id\n }\n}\n" } }; })(); -(node as any).hash = "a06f8279b87274b3cec4a11f44a53f49"; +(node as any).hash = "9d7bbfc81ce73246b671989102da3192"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewOrganizationQuery.graphql.ts b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewOrganizationQuery.graphql.ts similarity index 79% rename from apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewOrganizationQuery.graphql.ts rename to apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewOrganizationQuery.graphql.ts index aa7b76a68..0de8bbaa1 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewOrganizationQuery.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewOrganizationQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<780c10208a633b2ce7cd34ccc580cf25>> * @lightSyntaxTransform * @nogrep */ @@ -9,10 +9,10 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type ControlViewOrganizationQuery$variables = { +export type MitigationViewOrganizationQuery$variables = { organizationId: string; }; -export type ControlViewOrganizationQuery$data = { +export type MitigationViewOrganizationQuery$data = { readonly organization: { readonly id: string; readonly peoples?: { @@ -26,9 +26,9 @@ export type ControlViewOrganizationQuery$data = { }; }; }; -export type ControlViewOrganizationQuery = { - response: ControlViewOrganizationQuery$data; - variables: ControlViewOrganizationQuery$variables; +export type MitigationViewOrganizationQuery = { + response: MitigationViewOrganizationQuery$data; + variables: MitigationViewOrganizationQuery$variables; }; const node: ConcreteRequest = (function(){ @@ -153,7 +153,7 @@ return { "argumentDefinitions": (v0/*: any*/), "kind": "Fragment", "metadata": null, - "name": "ControlViewOrganizationQuery", + "name": "MitigationViewOrganizationQuery", "selections": [ { "alias": "organization", @@ -174,10 +174,10 @@ return { ], "concreteType": "PeopleConnection", "kind": "LinkedField", - "name": "__ControlView_peoples_connection", + "name": "__MitigationView_peoples_connection", "plural": false, "selections": (v5/*: any*/), - "storageKey": "__ControlView_peoples_connection(orderBy:{\"direction\":\"ASC\",\"field\":\"FULL_NAME\"})" + "storageKey": "__MitigationView_peoples_connection(orderBy:{\"direction\":\"ASC\",\"field\":\"FULL_NAME\"})" } ], "type": "Organization", @@ -194,7 +194,7 @@ return { "operation": { "argumentDefinitions": (v0/*: any*/), "kind": "Operation", - "name": "ControlViewOrganizationQuery", + "name": "MitigationViewOrganizationQuery", "selections": [ { "alias": "organization", @@ -226,7 +226,7 @@ return { "orderBy" ], "handle": "connection", - "key": "ControlView_peoples", + "key": "MitigationView_peoples", "kind": "LinkedHandle", "name": "peoples" } @@ -240,7 +240,7 @@ return { ] }, "params": { - "cacheID": "9a339515a618cf48b77e74890b016272", + "cacheID": "3d1fc2d02bc6eea68edcabc6fc6f0b56", "id": null, "metadata": { "connection": [ @@ -255,13 +255,13 @@ return { } ] }, - "name": "ControlViewOrganizationQuery", + "name": "MitigationViewOrganizationQuery", "operationKind": "query", - "text": "query ControlViewOrganizationQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ... on Organization {\n peoples(first: 100, orderBy: {direction: ASC, field: FULL_NAME}) {\n edges {\n node {\n id\n fullName\n primaryEmailAddress\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n" + "text": "query MitigationViewOrganizationQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ... on Organization {\n peoples(first: 100, orderBy: {direction: ASC, field: FULL_NAME}) {\n edges {\n node {\n id\n fullName\n primaryEmailAddress\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n" } }; })(); -(node as any).hash = "22507c997964e19a663c819b750e50c9"; +(node as any).hash = "73abf70f60b6f5a07b25f3c83676e02f"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewQuery.graphql.ts b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewQuery.graphql.ts similarity index 83% rename from apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewQuery.graphql.ts rename to apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewQuery.graphql.ts index 4f7157ecb..ac0269c81 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewQuery.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -9,22 +9,22 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type ControlImportance = "ADVANCED" | "MANDATORY" | "PREFERRED"; -export type ControlState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; export type EvidenceState = "EXPIRED" | "INVALID" | "VALID"; export type EvidenceType = "FILE" | "LINK"; +export type MitigationImportance = "ADVANCED" | "MANDATORY" | "PREFERRED"; +export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; export type TaskState = "DONE" | "TODO"; -export type ControlViewQuery$variables = { - controlId: string; +export type MitigationViewQuery$variables = { + mitigationId: string; }; -export type ControlViewQuery$data = { - readonly control: { +export type MitigationViewQuery$data = { + readonly mitigation: { readonly category?: string; readonly description?: string; readonly id: string; - readonly importance?: ControlImportance; + readonly importance?: MitigationImportance; readonly name?: string; - readonly state?: ControlState; + readonly state?: MitigationState; readonly tasks?: { readonly __id: string; readonly edges: ReadonlyArray<{ @@ -61,9 +61,9 @@ export type ControlViewQuery$data = { readonly version?: number; }; }; -export type ControlViewQuery = { - response: ControlViewQuery$data; - variables: ControlViewQuery$variables; +export type MitigationViewQuery = { + response: MitigationViewQuery$data; + variables: MitigationViewQuery$variables; }; const node: ConcreteRequest = (function(){ @@ -71,14 +71,14 @@ var v0 = [ { "defaultValue": null, "kind": "LocalArgument", - "name": "controlId" + "name": "mitigationId" } ], v1 = [ { "kind": "Variable", "name": "id", - "variableName": "controlId" + "variableName": "mitigationId" } ], v2 = { @@ -305,10 +305,10 @@ return { "argumentDefinitions": (v0/*: any*/), "kind": "Fragment", "metadata": null, - "name": "ControlViewQuery", + "name": "MitigationViewQuery", "selections": [ { - "alias": "control", + "alias": "mitigation", "args": (v1/*: any*/), "concreteType": null, "kind": "LinkedField", @@ -330,7 +330,7 @@ return { "args": null, "concreteType": "TaskConnection", "kind": "LinkedField", - "name": "__ControlView_tasks_connection", + "name": "__MitigationView_tasks_connection", "plural": false, "selections": [ { @@ -361,7 +361,7 @@ return { "args": null, "concreteType": "EvidenceConnection", "kind": "LinkedField", - "name": "__ControlView_evidences_connection", + "name": "__MitigationView_evidences_connection", "plural": false, "selections": (v15/*: any*/), "storageKey": null @@ -380,7 +380,7 @@ return { "storageKey": null } ], - "type": "Control", + "type": "Mitigation", "abstractKey": null } ], @@ -394,10 +394,10 @@ return { "operation": { "argumentDefinitions": (v0/*: any*/), "kind": "Operation", - "name": "ControlViewQuery", + "name": "MitigationViewQuery", "selections": [ { - "alias": "control", + "alias": "mitigation", "args": (v1/*: any*/), "concreteType": null, "kind": "LinkedField", @@ -461,7 +461,7 @@ return { "args": (v17/*: any*/), "filters": null, "handle": "connection", - "key": "ControlView_evidences", + "key": "MitigationView_evidences", "kind": "LinkedHandle", "name": "evidences" }, @@ -483,12 +483,12 @@ return { "args": (v16/*: any*/), "filters": null, "handle": "connection", - "key": "ControlView_tasks", + "key": "MitigationView_tasks", "kind": "LinkedHandle", "name": "tasks" } ], - "type": "Control", + "type": "Mitigation", "abstractKey": null } ], @@ -497,7 +497,7 @@ return { ] }, "params": { - "cacheID": "35556c446c544e8b281b572272daae6b", + "cacheID": "8e9c3cef43daff0bdbfff4e33d7c70ad", "id": null, "metadata": { "connection": [ @@ -512,19 +512,19 @@ return { "cursor": null, "direction": "forward", "path": [ - "control", + "mitigation", "tasks" ] } ] }, - "name": "ControlViewQuery", + "name": "MitigationViewQuery", "operationKind": "query", - "text": "query ControlViewQuery(\n $controlId: ID!\n) {\n control: node(id: $controlId) {\n __typename\n id\n ... on Control {\n name\n description\n state\n importance\n category\n version\n tasks(first: 100) {\n edges {\n node {\n id\n name\n description\n state\n timeEstimate\n version\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n evidences(first: 50) {\n edges {\n node {\n id\n mimeType\n filename\n size\n state\n type\n url\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n" + "text": "query MitigationViewQuery(\n $mitigationId: ID!\n) {\n mitigation: node(id: $mitigationId) {\n __typename\n id\n ... on Mitigation {\n name\n description\n state\n importance\n category\n version\n tasks(first: 100) {\n edges {\n node {\n id\n name\n description\n state\n timeEstimate\n version\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n evidences(first: 50) {\n edges {\n node {\n id\n mimeType\n filename\n size\n state\n type\n url\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n" } }; })(); -(node as any).hash = "cf9ee1fdc5e0e09c6b883299af7ffa37"; +(node as any).hash = "f0baeab367be46290f2f15df836ed153"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewUnassignTaskMutation.graphql.ts b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewUnassignTaskMutation.graphql.ts similarity index 75% rename from apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewUnassignTaskMutation.graphql.ts rename to apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewUnassignTaskMutation.graphql.ts index 924f22d5c..ff8ff8ece 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewUnassignTaskMutation.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewUnassignTaskMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<9cb5a3f1c6f0c2a3265ecdc6ececd13d>> * @lightSyntaxTransform * @nogrep */ @@ -12,10 +12,10 @@ import { ConcreteRequest } from 'relay-runtime'; export type UnassignTaskInput = { taskId: string; }; -export type ControlViewUnassignTaskMutation$variables = { +export type MitigationViewUnassignTaskMutation$variables = { input: UnassignTaskInput; }; -export type ControlViewUnassignTaskMutation$data = { +export type MitigationViewUnassignTaskMutation$data = { readonly unassignTask: { readonly task: { readonly assignedTo: { @@ -28,9 +28,9 @@ export type ControlViewUnassignTaskMutation$data = { }; }; }; -export type ControlViewUnassignTaskMutation = { - response: ControlViewUnassignTaskMutation$data; - variables: ControlViewUnassignTaskMutation$variables; +export type MitigationViewUnassignTaskMutation = { + response: MitigationViewUnassignTaskMutation$data; + variables: MitigationViewUnassignTaskMutation$variables; }; const node: ConcreteRequest = (function(){ @@ -117,7 +117,7 @@ return { "argumentDefinitions": (v0/*: any*/), "kind": "Fragment", "metadata": null, - "name": "ControlViewUnassignTaskMutation", + "name": "MitigationViewUnassignTaskMutation", "selections": (v2/*: any*/), "type": "Mutation", "abstractKey": null @@ -126,20 +126,20 @@ return { "operation": { "argumentDefinitions": (v0/*: any*/), "kind": "Operation", - "name": "ControlViewUnassignTaskMutation", + "name": "MitigationViewUnassignTaskMutation", "selections": (v2/*: any*/) }, "params": { - "cacheID": "15ebb533fa8c9ef25aba306106a198eb", + "cacheID": "e493ae65ba1e53627dd3f260e8814e41", "id": null, "metadata": {}, - "name": "ControlViewUnassignTaskMutation", + "name": "MitigationViewUnassignTaskMutation", "operationKind": "mutation", - "text": "mutation ControlViewUnassignTaskMutation(\n $input: UnassignTaskInput!\n) {\n unassignTask(input: $input) {\n task {\n id\n version\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n }\n }\n}\n" + "text": "mutation MitigationViewUnassignTaskMutation(\n $input: UnassignTaskInput!\n) {\n unassignTask(input: $input) {\n task {\n id\n version\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n }\n }\n}\n" } }; })(); -(node as any).hash = "b0956d42397dc015e2ece4ff37a83857"; +(node as any).hash = "3f5a0d2b753d0a759e3004c0b557c505"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewUpdateControlStateMutation.graphql.ts b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewUpdateMitigationStateMutation.graphql.ts similarity index 56% rename from apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewUpdateControlStateMutation.graphql.ts rename to apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewUpdateMitigationStateMutation.graphql.ts index 7e7f1cb7e..3ed2dbae8 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewUpdateControlStateMutation.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewUpdateMitigationStateMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<42dcc8ca7d9ad288321e73fa5175db44>> + * @generated SignedSource<<3aa56a1042b1f9492cfc5bd5d5f55d9d>> * @lightSyntaxTransform * @nogrep */ @@ -9,32 +9,32 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type ControlImportance = "ADVANCED" | "MANDATORY" | "PREFERRED"; -export type ControlState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; -export type UpdateControlInput = { +export type MitigationImportance = "ADVANCED" | "MANDATORY" | "PREFERRED"; +export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; +export type UpdateMitigationInput = { category?: string | null | undefined; description?: string | null | undefined; expectedVersion: number; id: string; - importance?: ControlImportance | null | undefined; + importance?: MitigationImportance | null | undefined; name?: string | null | undefined; - state?: ControlState | null | undefined; + state?: MitigationState | null | undefined; }; -export type ControlViewUpdateControlStateMutation$variables = { - input: UpdateControlInput; +export type MitigationViewUpdateMitigationStateMutation$variables = { + input: UpdateMitigationInput; }; -export type ControlViewUpdateControlStateMutation$data = { - readonly updateControl: { - readonly control: { +export type MitigationViewUpdateMitigationStateMutation$data = { + readonly updateMitigation: { + readonly mitigation: { readonly id: string; - readonly state: ControlState; + readonly state: MitigationState; readonly version: number; }; }; }; -export type ControlViewUpdateControlStateMutation = { - response: ControlViewUpdateControlStateMutation$data; - variables: ControlViewUpdateControlStateMutation$variables; +export type MitigationViewUpdateMitigationStateMutation = { + response: MitigationViewUpdateMitigationStateMutation$data; + variables: MitigationViewUpdateMitigationStateMutation$variables; }; const node: ConcreteRequest = (function(){ @@ -55,17 +55,17 @@ v1 = [ "variableName": "input" } ], - "concreteType": "UpdateControlPayload", + "concreteType": "UpdateMitigationPayload", "kind": "LinkedField", - "name": "updateControl", + "name": "updateMitigation", "plural": false, "selections": [ { "alias": null, "args": null, - "concreteType": "Control", + "concreteType": "Mitigation", "kind": "LinkedField", - "name": "control", + "name": "mitigation", "plural": false, "selections": [ { @@ -101,7 +101,7 @@ return { "argumentDefinitions": (v0/*: any*/), "kind": "Fragment", "metadata": null, - "name": "ControlViewUpdateControlStateMutation", + "name": "MitigationViewUpdateMitigationStateMutation", "selections": (v1/*: any*/), "type": "Mutation", "abstractKey": null @@ -110,20 +110,20 @@ return { "operation": { "argumentDefinitions": (v0/*: any*/), "kind": "Operation", - "name": "ControlViewUpdateControlStateMutation", + "name": "MitigationViewUpdateMitigationStateMutation", "selections": (v1/*: any*/) }, "params": { - "cacheID": "b34b9c0ddec55d16efcc2f38e8334773", + "cacheID": "4a85c6e15d6ff91ccaa7976f9b0a0c6f", "id": null, "metadata": {}, - "name": "ControlViewUpdateControlStateMutation", + "name": "MitigationViewUpdateMitigationStateMutation", "operationKind": "mutation", - "text": "mutation ControlViewUpdateControlStateMutation(\n $input: UpdateControlInput!\n) {\n updateControl(input: $input) {\n control {\n id\n state\n version\n }\n }\n}\n" + "text": "mutation MitigationViewUpdateMitigationStateMutation(\n $input: UpdateMitigationInput!\n) {\n updateMitigation(input: $input) {\n mitigation {\n id\n state\n version\n }\n }\n}\n" } }; })(); -(node as any).hash = "3eaaab55403bfaf343d4a740ad0128e1"; +(node as any).hash = "2eb2c1f791262f502df22ca0c16682a7"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewUpdateTaskStateMutation.graphql.ts b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewUpdateTaskStateMutation.graphql.ts similarity index 75% rename from apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewUpdateTaskStateMutation.graphql.ts rename to apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewUpdateTaskStateMutation.graphql.ts index 225593897..81127d344 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewUpdateTaskStateMutation.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewUpdateTaskStateMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<4aed09b28d5d1ec083abfeeb874b9ce3>> * @lightSyntaxTransform * @nogrep */ @@ -18,10 +18,10 @@ export type UpdateTaskInput = { taskId: string; timeEstimate?: any | null | undefined; }; -export type ControlViewUpdateTaskStateMutation$variables = { +export type MitigationViewUpdateTaskStateMutation$variables = { input: UpdateTaskInput; }; -export type ControlViewUpdateTaskStateMutation$data = { +export type MitigationViewUpdateTaskStateMutation$data = { readonly updateTask: { readonly task: { readonly id: string; @@ -31,9 +31,9 @@ export type ControlViewUpdateTaskStateMutation$data = { }; }; }; -export type ControlViewUpdateTaskStateMutation = { - response: ControlViewUpdateTaskStateMutation$data; - variables: ControlViewUpdateTaskStateMutation$variables; +export type MitigationViewUpdateTaskStateMutation = { + response: MitigationViewUpdateTaskStateMutation$data; + variables: MitigationViewUpdateTaskStateMutation$variables; }; const node: ConcreteRequest = (function(){ @@ -107,7 +107,7 @@ return { "argumentDefinitions": (v0/*: any*/), "kind": "Fragment", "metadata": null, - "name": "ControlViewUpdateTaskStateMutation", + "name": "MitigationViewUpdateTaskStateMutation", "selections": (v1/*: any*/), "type": "Mutation", "abstractKey": null @@ -116,20 +116,20 @@ return { "operation": { "argumentDefinitions": (v0/*: any*/), "kind": "Operation", - "name": "ControlViewUpdateTaskStateMutation", + "name": "MitigationViewUpdateTaskStateMutation", "selections": (v1/*: any*/) }, "params": { - "cacheID": "f8f00bd63de4f5eac131954a8039b40e", + "cacheID": "8de0d061237d4ebcbb366b8eefff6d94", "id": null, "metadata": {}, - "name": "ControlViewUpdateTaskStateMutation", + "name": "MitigationViewUpdateTaskStateMutation", "operationKind": "mutation", - "text": "mutation ControlViewUpdateTaskStateMutation(\n $input: UpdateTaskInput!\n) {\n updateTask(input: $input) {\n task {\n id\n state\n timeEstimate\n version\n }\n }\n}\n" + "text": "mutation MitigationViewUpdateTaskStateMutation(\n $input: UpdateTaskInput!\n) {\n updateTask(input: $input) {\n task {\n id\n state\n timeEstimate\n version\n }\n }\n}\n" } }; })(); -(node as any).hash = "f53df99b24c2f5f233f8d865885718ea"; +(node as any).hash = "81dca6c475859526370ef60b4757428b"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewUploadEvidenceMutation.graphql.ts b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewUploadEvidenceMutation.graphql.ts similarity index 83% rename from apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewUploadEvidenceMutation.graphql.ts rename to apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewUploadEvidenceMutation.graphql.ts index cd8b72d74..3da7919e6 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/__generated__/ControlViewUploadEvidenceMutation.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/MitigationViewUploadEvidenceMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<9d4db1a6dc5ce7a35be41b6f42bc91d2>> * @lightSyntaxTransform * @nogrep */ @@ -19,11 +19,11 @@ export type UploadEvidenceInput = { type: EvidenceType; url?: string | null | undefined; }; -export type ControlViewUploadEvidenceMutation$variables = { +export type MitigationViewUploadEvidenceMutation$variables = { connections: ReadonlyArray; input: UploadEvidenceInput; }; -export type ControlViewUploadEvidenceMutation$data = { +export type MitigationViewUploadEvidenceMutation$data = { readonly uploadEvidence: { readonly evidenceEdge: { readonly node: { @@ -40,9 +40,9 @@ export type ControlViewUploadEvidenceMutation$data = { }; }; }; -export type ControlViewUploadEvidenceMutation = { - response: ControlViewUploadEvidenceMutation$data; - variables: ControlViewUploadEvidenceMutation$variables; +export type MitigationViewUploadEvidenceMutation = { + response: MitigationViewUploadEvidenceMutation$data; + variables: MitigationViewUploadEvidenceMutation$variables; }; const node: ConcreteRequest = (function(){ @@ -156,7 +156,7 @@ return { ], "kind": "Fragment", "metadata": null, - "name": "ControlViewUploadEvidenceMutation", + "name": "MitigationViewUploadEvidenceMutation", "selections": [ { "alias": null, @@ -181,7 +181,7 @@ return { (v0/*: any*/) ], "kind": "Operation", - "name": "ControlViewUploadEvidenceMutation", + "name": "MitigationViewUploadEvidenceMutation", "selections": [ { "alias": null, @@ -214,16 +214,16 @@ return { ] }, "params": { - "cacheID": "62fbef44afc988cdedc94c7a0292a432", + "cacheID": "30a6915055d3f6b63d96836b26f05a45", "id": null, "metadata": {}, - "name": "ControlViewUploadEvidenceMutation", + "name": "MitigationViewUploadEvidenceMutation", "operationKind": "mutation", - "text": "mutation ControlViewUploadEvidenceMutation(\n $input: UploadEvidenceInput!\n) {\n uploadEvidence(input: $input) {\n evidenceEdge {\n node {\n id\n filename\n fileUrl\n mimeType\n type\n url\n size\n state\n createdAt\n }\n }\n }\n}\n" + "text": "mutation MitigationViewUploadEvidenceMutation(\n $input: UploadEvidenceInput!\n) {\n uploadEvidence(input: $input) {\n evidenceEdge {\n node {\n id\n filename\n fileUrl\n mimeType\n type\n url\n size\n state\n createdAt\n }\n }\n }\n}\n" } }; })(); -(node as any).hash = "1e2b47702f9a03efdca7fdfd44ebbccf"; +(node as any).hash = "4cf5430a0971ba1ddf476765df614e30"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/controls/__generated__/UpdateControlViewQuery.graphql.ts b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/UpdateMitigationViewQuery.graphql.ts similarity index 71% rename from apps/console/src/pages/organizations/frameworks/controls/__generated__/UpdateControlViewQuery.graphql.ts rename to apps/console/src/pages/organizations/frameworks/mitigations/__generated__/UpdateMitigationViewQuery.graphql.ts index 3cccfdc13..a4bf0899d 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/__generated__/UpdateControlViewQuery.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/UpdateMitigationViewQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<839284c6c29a5727d0ca521b1d804c5f>> + * @generated SignedSource<<338c4c7afa073c41eacac21a2996d1f9>> * @lightSyntaxTransform * @nogrep */ @@ -9,25 +9,25 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type ControlImportance = "ADVANCED" | "MANDATORY" | "PREFERRED"; -export type ControlState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; -export type UpdateControlViewQuery$variables = { - controlId: string; +export type MitigationImportance = "ADVANCED" | "MANDATORY" | "PREFERRED"; +export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; +export type UpdateMitigationViewQuery$variables = { + mitigationId: string; }; -export type UpdateControlViewQuery$data = { +export type UpdateMitigationViewQuery$data = { readonly node: { readonly category?: string; readonly description?: string; readonly id?: string; - readonly importance?: ControlImportance; + readonly importance?: MitigationImportance; readonly name?: string; - readonly state?: ControlState; + readonly state?: MitigationState; readonly version?: number; }; }; -export type UpdateControlViewQuery = { - response: UpdateControlViewQuery$data; - variables: UpdateControlViewQuery$variables; +export type UpdateMitigationViewQuery = { + response: UpdateMitigationViewQuery$data; + variables: UpdateMitigationViewQuery$variables; }; const node: ConcreteRequest = (function(){ @@ -35,14 +35,14 @@ var v0 = [ { "defaultValue": null, "kind": "LocalArgument", - "name": "controlId" + "name": "mitigationId" } ], v1 = [ { "kind": "Variable", "name": "id", - "variableName": "controlId" + "variableName": "mitigationId" } ], v2 = { @@ -99,7 +99,7 @@ return { "argumentDefinitions": (v0/*: any*/), "kind": "Fragment", "metadata": null, - "name": "UpdateControlViewQuery", + "name": "UpdateMitigationViewQuery", "selections": [ { "alias": null, @@ -120,7 +120,7 @@ return { (v7/*: any*/), (v8/*: any*/) ], - "type": "Control", + "type": "Mitigation", "abstractKey": null } ], @@ -134,7 +134,7 @@ return { "operation": { "argumentDefinitions": (v0/*: any*/), "kind": "Operation", - "name": "UpdateControlViewQuery", + "name": "UpdateMitigationViewQuery", "selections": [ { "alias": null, @@ -162,7 +162,7 @@ return { (v7/*: any*/), (v8/*: any*/) ], - "type": "Control", + "type": "Mitigation", "abstractKey": null } ], @@ -171,16 +171,16 @@ return { ] }, "params": { - "cacheID": "d578024453f1901119a772154524070d", + "cacheID": "c2e9133d77f3e090267b19f4ab270c72", "id": null, "metadata": {}, - "name": "UpdateControlViewQuery", + "name": "UpdateMitigationViewQuery", "operationKind": "query", - "text": "query UpdateControlViewQuery(\n $controlId: ID!\n) {\n node(id: $controlId) {\n __typename\n ... on Control {\n id\n name\n description\n category\n importance\n state\n version\n }\n id\n }\n}\n" + "text": "query UpdateMitigationViewQuery(\n $mitigationId: ID!\n) {\n node(id: $mitigationId) {\n __typename\n ... on Mitigation {\n id\n name\n description\n category\n importance\n state\n version\n }\n id\n }\n}\n" } }; })(); -(node as any).hash = "e6a997a27a8e45c01ad415e73b794cae"; +(node as any).hash = "3e977744beb9c403aa8be232c8112a9b"; export default node; diff --git a/apps/console/src/pages/organizations/frameworks/controls/__generated__/UpdateControlViewUpdateControlMutation.graphql.ts b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/UpdateMitigationViewUpdateMitigationMutation.graphql.ts similarity index 63% rename from apps/console/src/pages/organizations/frameworks/controls/__generated__/UpdateControlViewUpdateControlMutation.graphql.ts rename to apps/console/src/pages/organizations/frameworks/mitigations/__generated__/UpdateMitigationViewUpdateMitigationMutation.graphql.ts index 9a45eb5b3..4f38e0846 100644 --- a/apps/console/src/pages/organizations/frameworks/controls/__generated__/UpdateControlViewUpdateControlMutation.graphql.ts +++ b/apps/console/src/pages/organizations/frameworks/mitigations/__generated__/UpdateMitigationViewUpdateMitigationMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<5223ef96f75ea5f5d4b124d190dfd455>> + * @generated SignedSource<<39cfe3277c49d7a0ff2099d6ad579e7d>> * @lightSyntaxTransform * @nogrep */ @@ -9,36 +9,36 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type ControlImportance = "ADVANCED" | "MANDATORY" | "PREFERRED"; -export type ControlState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; -export type UpdateControlInput = { +export type MitigationImportance = "ADVANCED" | "MANDATORY" | "PREFERRED"; +export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; +export type UpdateMitigationInput = { category?: string | null | undefined; description?: string | null | undefined; expectedVersion: number; id: string; - importance?: ControlImportance | null | undefined; + importance?: MitigationImportance | null | undefined; name?: string | null | undefined; - state?: ControlState | null | undefined; + state?: MitigationState | null | undefined; }; -export type UpdateControlViewUpdateControlMutation$variables = { - input: UpdateControlInput; +export type UpdateMitigationViewUpdateMitigationMutation$variables = { + input: UpdateMitigationInput; }; -export type UpdateControlViewUpdateControlMutation$data = { - readonly updateControl: { - readonly control: { +export type UpdateMitigationViewUpdateMitigationMutation$data = { + readonly updateMitigation: { + readonly mitigation: { readonly category: string; readonly description: string; readonly id: string; - readonly importance: ControlImportance; + readonly importance: MitigationImportance; readonly name: string; - readonly state: ControlState; + readonly state: MitigationState; readonly version: number; }; }; }; -export type UpdateControlViewUpdateControlMutation = { - response: UpdateControlViewUpdateControlMutation$data; - variables: UpdateControlViewUpdateControlMutation$variables; +export type UpdateMitigationViewUpdateMitigationMutation = { + response: UpdateMitigationViewUpdateMitigationMutation$data; + variables: UpdateMitigationViewUpdateMitigationMutation$variables; }; const node: ConcreteRequest = (function(){ @@ -59,17 +59,17 @@ v1 = [ "variableName": "input" } ], - "concreteType": "UpdateControlPayload", + "concreteType": "UpdateMitigationPayload", "kind": "LinkedField", - "name": "updateControl", + "name": "updateMitigation", "plural": false, "selections": [ { "alias": null, "args": null, - "concreteType": "Control", + "concreteType": "Mitigation", "kind": "LinkedField", - "name": "control", + "name": "mitigation", "plural": false, "selections": [ { @@ -133,7 +133,7 @@ return { "argumentDefinitions": (v0/*: any*/), "kind": "Fragment", "metadata": null, - "name": "UpdateControlViewUpdateControlMutation", + "name": "UpdateMitigationViewUpdateMitigationMutation", "selections": (v1/*: any*/), "type": "Mutation", "abstractKey": null @@ -142,20 +142,20 @@ return { "operation": { "argumentDefinitions": (v0/*: any*/), "kind": "Operation", - "name": "UpdateControlViewUpdateControlMutation", + "name": "UpdateMitigationViewUpdateMitigationMutation", "selections": (v1/*: any*/) }, "params": { - "cacheID": "1702f16b6cc6452422c0f72acee25359", + "cacheID": "5ebe3d38712b444c98c08661b7431da3", "id": null, "metadata": {}, - "name": "UpdateControlViewUpdateControlMutation", + "name": "UpdateMitigationViewUpdateMitigationMutation", "operationKind": "mutation", - "text": "mutation UpdateControlViewUpdateControlMutation(\n $input: UpdateControlInput!\n) {\n updateControl(input: $input) {\n control {\n id\n name\n description\n category\n importance\n state\n version\n }\n }\n}\n" + "text": "mutation UpdateMitigationViewUpdateMitigationMutation(\n $input: UpdateMitigationInput!\n) {\n updateMitigation(input: $input) {\n mitigation {\n id\n name\n description\n category\n importance\n state\n version\n }\n }\n}\n" } }; })(); -(node as any).hash = "e0f0940fe564406ef95473420b336128"; +(node as any).hash = "c68d76d527359d182749b309d2d8d6dd"; export default node; diff --git a/apps/console/src/pages/organizations/policies/PolicyListPage.tsx b/apps/console/src/pages/organizations/policies/PolicyListPage.tsx index b1a8fb7e7..12db1ef3f 100644 --- a/apps/console/src/pages/organizations/policies/PolicyListPage.tsx +++ b/apps/console/src/pages/organizations/policies/PolicyListPage.tsx @@ -14,7 +14,7 @@ export function PolicyListViewSkeleton() { description="Manage your organization's policies" actions={
} > - {/* Search and filter controls skeleton */} + {/* Search and filter mitigations skeleton */}
diff --git a/apps/console/src/pages/organizations/policies/PolicyListView.tsx b/apps/console/src/pages/organizations/policies/PolicyListView.tsx index 8ed7962a8..8e2d43053 100644 --- a/apps/console/src/pages/organizations/policies/PolicyListView.tsx +++ b/apps/console/src/pages/organizations/policies/PolicyListView.tsx @@ -232,7 +232,7 @@ function PolicyListViewContent({ } > - {/* Search and filter controls */} + {/* Search and filter mitigations */}
diff --git a/apps/console/src/pages/organizations/vendors/__generated__/VendorListPageCreateVendorMutation.graphql.ts b/apps/console/src/pages/organizations/vendors/__generated__/VendorListPageCreateVendorMutation.graphql.ts deleted file mode 100644 index 48aeb7e69..000000000 --- a/apps/console/src/pages/organizations/vendors/__generated__/VendorListPageCreateVendorMutation.graphql.ts +++ /dev/null @@ -1,209 +0,0 @@ -/** - * @generated SignedSource<<1e5aa858fdcd0179ebfd8ffba00b6bd7>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -export type RiskTier = "CRITICAL" | "GENERAL" | "SIGNIFICANT"; -export type ServiceCriticality = "HIGH" | "LOW" | "MEDIUM"; -export type CreateVendorInput = { - description: string; - name: string; - organizationId: string; - privacyPolicyUrl?: string | null | undefined; - riskTier: RiskTier; - serviceCriticality: ServiceCriticality; - serviceStartAt: string; - serviceTerminationAt?: string | null | undefined; - statusPageUrl?: string | null | undefined; - termsOfServiceUrl?: string | null | undefined; -}; -export type VendorListPageCreateVendorMutation$variables = { - connections: ReadonlyArray; - input: CreateVendorInput; -}; -export type VendorListPageCreateVendorMutation$data = { - readonly createVendor: { - readonly vendorEdge: { - readonly node: { - readonly createdAt: string; - readonly description: string; - readonly id: string; - readonly name: string; - readonly riskTier: RiskTier; - readonly updatedAt: string; - }; - }; - }; -}; -export type VendorListPageCreateVendorMutation = { - response: VendorListPageCreateVendorMutation$data; - variables: VendorListPageCreateVendorMutation$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "connections" -}, -v1 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "input" -}, -v2 = [ - { - "kind": "Variable", - "name": "input", - "variableName": "input" - } -], -v3 = { - "alias": null, - "args": null, - "concreteType": "VendorEdge", - "kind": "LinkedField", - "name": "vendorEdge", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Vendor", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "name", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "description", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "updatedAt", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "riskTier", - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": null -}; -return { - "fragment": { - "argumentDefinitions": [ - (v0/*: any*/), - (v1/*: any*/) - ], - "kind": "Fragment", - "metadata": null, - "name": "VendorListPageCreateVendorMutation", - "selections": [ - { - "alias": null, - "args": (v2/*: any*/), - "concreteType": "CreateVendorPayload", - "kind": "LinkedField", - "name": "createVendor", - "plural": false, - "selections": [ - (v3/*: any*/) - ], - "storageKey": null - } - ], - "type": "Mutation", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": [ - (v1/*: any*/), - (v0/*: any*/) - ], - "kind": "Operation", - "name": "VendorListPageCreateVendorMutation", - "selections": [ - { - "alias": null, - "args": (v2/*: any*/), - "concreteType": "CreateVendorPayload", - "kind": "LinkedField", - "name": "createVendor", - "plural": false, - "selections": [ - (v3/*: any*/), - { - "alias": null, - "args": null, - "filters": null, - "handle": "prependEdge", - "key": "", - "kind": "LinkedHandle", - "name": "vendorEdge", - "handleArgs": [ - { - "kind": "Variable", - "name": "connections", - "variableName": "connections" - } - ] - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "7ab96ef77e598ee748273b37bb9b42d2", - "id": null, - "metadata": {}, - "name": "VendorListPageCreateVendorMutation", - "operationKind": "mutation", - "text": "mutation VendorListPageCreateVendorMutation(\n $input: CreateVendorInput!\n) {\n createVendor(input: $input) {\n vendorEdge {\n node {\n id\n name\n description\n createdAt\n updatedAt\n riskTier\n }\n }\n }\n}\n" - } -}; -})(); - -(node as any).hash = "603ba3f92a342a8e1fb20057612b7c79"; - -export default node; diff --git a/apps/console/src/pages/organizations/vendors/__generated__/VendorListPageDeleteVendorMutation.graphql.ts b/apps/console/src/pages/organizations/vendors/__generated__/VendorListPageDeleteVendorMutation.graphql.ts deleted file mode 100644 index 6e495f7fe..000000000 --- a/apps/console/src/pages/organizations/vendors/__generated__/VendorListPageDeleteVendorMutation.graphql.ts +++ /dev/null @@ -1,132 +0,0 @@ -/** - * @generated SignedSource<> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -export type DeleteVendorInput = { - vendorId: string; -}; -export type VendorListPageDeleteVendorMutation$variables = { - connections: ReadonlyArray; - input: DeleteVendorInput; -}; -export type VendorListPageDeleteVendorMutation$data = { - readonly deleteVendor: { - readonly deletedVendorId: string; - }; -}; -export type VendorListPageDeleteVendorMutation = { - response: VendorListPageDeleteVendorMutation$data; - variables: VendorListPageDeleteVendorMutation$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "connections" -}, -v1 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "input" -}, -v2 = [ - { - "kind": "Variable", - "name": "input", - "variableName": "input" - } -], -v3 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "deletedVendorId", - "storageKey": null -}; -return { - "fragment": { - "argumentDefinitions": [ - (v0/*: any*/), - (v1/*: any*/) - ], - "kind": "Fragment", - "metadata": null, - "name": "VendorListPageDeleteVendorMutation", - "selections": [ - { - "alias": null, - "args": (v2/*: any*/), - "concreteType": "DeleteVendorPayload", - "kind": "LinkedField", - "name": "deleteVendor", - "plural": false, - "selections": [ - (v3/*: any*/) - ], - "storageKey": null - } - ], - "type": "Mutation", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": [ - (v1/*: any*/), - (v0/*: any*/) - ], - "kind": "Operation", - "name": "VendorListPageDeleteVendorMutation", - "selections": [ - { - "alias": null, - "args": (v2/*: any*/), - "concreteType": "DeleteVendorPayload", - "kind": "LinkedField", - "name": "deleteVendor", - "plural": false, - "selections": [ - (v3/*: any*/), - { - "alias": null, - "args": null, - "filters": null, - "handle": "deleteEdge", - "key": "", - "kind": "ScalarHandle", - "name": "deletedVendorId", - "handleArgs": [ - { - "kind": "Variable", - "name": "connections", - "variableName": "connections" - } - ] - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "278e42c6c988a64d4c863198f02df901", - "id": null, - "metadata": {}, - "name": "VendorListPageDeleteVendorMutation", - "operationKind": "mutation", - "text": "mutation VendorListPageDeleteVendorMutation(\n $input: DeleteVendorInput!\n) {\n deleteVendor(input: $input) {\n deletedVendorId\n }\n}\n" - } -}; -})(); - -(node as any).hash = "20a320191535706246ae00aa05df991e"; - -export default node; diff --git a/apps/console/src/pages/organizations/vendors/__generated__/VendorListPagePaginationQuery.graphql.ts b/apps/console/src/pages/organizations/vendors/__generated__/VendorListPagePaginationQuery.graphql.ts deleted file mode 100644 index 88742b4f4..000000000 --- a/apps/console/src/pages/organizations/vendors/__generated__/VendorListPagePaginationQuery.graphql.ts +++ /dev/null @@ -1,335 +0,0 @@ -/** - * @generated SignedSource<<167c602f1fa3a3720523424c44c8b734>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -import { FragmentRefs } from "relay-runtime"; -export type VendorListPagePaginationQuery$variables = { - after?: string | null | undefined; - before?: string | null | undefined; - first?: number | null | undefined; - id: string; - last?: number | null | undefined; -}; -export type VendorListPagePaginationQuery$data = { - readonly node: { - readonly " $fragmentSpreads": FragmentRefs<"VendorListPage_vendors">; - }; -}; -export type VendorListPagePaginationQuery = { - response: VendorListPagePaginationQuery$data; - variables: VendorListPagePaginationQuery$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "after" -}, -v1 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "before" -}, -v2 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "first" -}, -v3 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "id" -}, -v4 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "last" -}, -v5 = [ - { - "kind": "Variable", - "name": "id", - "variableName": "id" - } -], -v6 = { - "kind": "Variable", - "name": "after", - "variableName": "after" -}, -v7 = { - "kind": "Variable", - "name": "before", - "variableName": "before" -}, -v8 = { - "kind": "Variable", - "name": "first", - "variableName": "first" -}, -v9 = { - "kind": "Variable", - "name": "last", - "variableName": "last" -}, -v10 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "__typename", - "storageKey": null -}, -v11 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null -}, -v12 = [ - (v6/*: any*/), - (v7/*: any*/), - (v8/*: any*/), - (v9/*: any*/), - { - "kind": "Literal", - "name": "orderBy", - "value": { - "direction": "ASC", - "field": "NAME" - } - } -]; -return { - "fragment": { - "argumentDefinitions": [ - (v0/*: any*/), - (v1/*: any*/), - (v2/*: any*/), - (v3/*: any*/), - (v4/*: any*/) - ], - "kind": "Fragment", - "metadata": null, - "name": "VendorListPagePaginationQuery", - "selections": [ - { - "alias": null, - "args": (v5/*: any*/), - "concreteType": null, - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - { - "args": [ - (v6/*: any*/), - (v7/*: any*/), - (v8/*: any*/), - (v9/*: any*/) - ], - "kind": "FragmentSpread", - "name": "VendorListPage_vendors" - } - ], - "storageKey": null - } - ], - "type": "Query", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": [ - (v0/*: any*/), - (v1/*: any*/), - (v2/*: any*/), - (v4/*: any*/), - (v3/*: any*/) - ], - "kind": "Operation", - "name": "VendorListPagePaginationQuery", - "selections": [ - { - "alias": null, - "args": (v5/*: any*/), - "concreteType": null, - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v10/*: any*/), - (v11/*: any*/), - { - "kind": "InlineFragment", - "selections": [ - { - "alias": null, - "args": (v12/*: any*/), - "concreteType": "VendorConnection", - "kind": "LinkedField", - "name": "vendors", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "VendorEdge", - "kind": "LinkedField", - "name": "edges", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Vendor", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v11/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "name", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "description", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "updatedAt", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "riskTier", - "storageKey": null - }, - (v10/*: any*/) - ], - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "cursor", - "storageKey": null - } - ], - "storageKey": null - }, - { - "alias": null, - "args": null, - "concreteType": "PageInfo", - "kind": "LinkedField", - "name": "pageInfo", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "hasNextPage", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "hasPreviousPage", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "startCursor", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "endCursor", - "storageKey": null - } - ], - "storageKey": null - }, - { - "kind": "ClientExtension", - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "__id", - "storageKey": null - } - ] - } - ], - "storageKey": null - }, - { - "alias": null, - "args": (v12/*: any*/), - "filters": [ - "orderBy" - ], - "handle": "connection", - "key": "VendorListPage_vendors", - "kind": "LinkedHandle", - "name": "vendors" - } - ], - "type": "Organization", - "abstractKey": null - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "72074f9c6435d35453cfd0effbbd6add", - "id": null, - "metadata": {}, - "name": "VendorListPagePaginationQuery", - "operationKind": "query", - "text": "query VendorListPagePaginationQuery(\n $after: CursorKey\n $before: CursorKey\n $first: Int\n $last: Int\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...VendorListPage_vendors_pbnwq\n id\n }\n}\n\nfragment VendorListPage_vendors_pbnwq on Organization {\n vendors(first: $first, after: $after, last: $last, before: $before, orderBy: {direction: ASC, field: NAME}) {\n edges {\n node {\n id\n name\n description\n createdAt\n updatedAt\n riskTier\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n id\n}\n" - } -}; -})(); - -(node as any).hash = "beaab1664bed1fa776659595b1ef3c30"; - -export default node; diff --git a/apps/console/src/pages/organizations/vendors/__generated__/VendorListPageQuery.graphql.ts b/apps/console/src/pages/organizations/vendors/__generated__/VendorListPageQuery.graphql.ts deleted file mode 100644 index 6338bbea2..000000000 --- a/apps/console/src/pages/organizations/vendors/__generated__/VendorListPageQuery.graphql.ts +++ /dev/null @@ -1,337 +0,0 @@ -/** - * @generated SignedSource<<3e49ccb0b233e4d7495387ecf23f2316>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -import { FragmentRefs } from "relay-runtime"; -export type VendorListPageQuery$variables = { - after?: string | null | undefined; - before?: string | null | undefined; - first?: number | null | undefined; - last?: number | null | undefined; - organizationId: string; -}; -export type VendorListPageQuery$data = { - readonly organization: { - readonly id: string; - readonly " $fragmentSpreads": FragmentRefs<"VendorListPage_vendors">; - }; -}; -export type VendorListPageQuery = { - response: VendorListPageQuery$data; - variables: VendorListPageQuery$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "after" -}, -v1 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "before" -}, -v2 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "first" -}, -v3 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "last" -}, -v4 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "organizationId" -}, -v5 = [ - { - "kind": "Variable", - "name": "id", - "variableName": "organizationId" - } -], -v6 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null -}, -v7 = { - "kind": "Variable", - "name": "after", - "variableName": "after" -}, -v8 = { - "kind": "Variable", - "name": "before", - "variableName": "before" -}, -v9 = { - "kind": "Variable", - "name": "first", - "variableName": "first" -}, -v10 = { - "kind": "Variable", - "name": "last", - "variableName": "last" -}, -v11 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "__typename", - "storageKey": null -}, -v12 = [ - (v7/*: any*/), - (v8/*: any*/), - (v9/*: any*/), - (v10/*: any*/), - { - "kind": "Literal", - "name": "orderBy", - "value": { - "direction": "ASC", - "field": "NAME" - } - } -]; -return { - "fragment": { - "argumentDefinitions": [ - (v0/*: any*/), - (v1/*: any*/), - (v2/*: any*/), - (v3/*: any*/), - (v4/*: any*/) - ], - "kind": "Fragment", - "metadata": null, - "name": "VendorListPageQuery", - "selections": [ - { - "alias": "organization", - "args": (v5/*: any*/), - "concreteType": null, - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v6/*: any*/), - { - "args": [ - (v7/*: any*/), - (v8/*: any*/), - (v9/*: any*/), - (v10/*: any*/) - ], - "kind": "FragmentSpread", - "name": "VendorListPage_vendors" - } - ], - "storageKey": null - } - ], - "type": "Query", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": [ - (v4/*: any*/), - (v2/*: any*/), - (v0/*: any*/), - (v3/*: any*/), - (v1/*: any*/) - ], - "kind": "Operation", - "name": "VendorListPageQuery", - "selections": [ - { - "alias": "organization", - "args": (v5/*: any*/), - "concreteType": null, - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v11/*: any*/), - (v6/*: any*/), - { - "kind": "InlineFragment", - "selections": [ - { - "alias": null, - "args": (v12/*: any*/), - "concreteType": "VendorConnection", - "kind": "LinkedField", - "name": "vendors", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "VendorEdge", - "kind": "LinkedField", - "name": "edges", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Vendor", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v6/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "name", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "description", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "updatedAt", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "riskTier", - "storageKey": null - }, - (v11/*: any*/) - ], - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "cursor", - "storageKey": null - } - ], - "storageKey": null - }, - { - "alias": null, - "args": null, - "concreteType": "PageInfo", - "kind": "LinkedField", - "name": "pageInfo", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "hasNextPage", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "hasPreviousPage", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "startCursor", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "endCursor", - "storageKey": null - } - ], - "storageKey": null - }, - { - "kind": "ClientExtension", - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "__id", - "storageKey": null - } - ] - } - ], - "storageKey": null - }, - { - "alias": null, - "args": (v12/*: any*/), - "filters": [ - "orderBy" - ], - "handle": "connection", - "key": "VendorListPage_vendors", - "kind": "LinkedHandle", - "name": "vendors" - } - ], - "type": "Organization", - "abstractKey": null - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "c2e401b2e573156b913d60ade59ea4ff", - "id": null, - "metadata": {}, - "name": "VendorListPageQuery", - "operationKind": "query", - "text": "query VendorListPageQuery(\n $organizationId: ID!\n $first: Int\n $after: CursorKey\n $last: Int\n $before: CursorKey\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ...VendorListPage_vendors_pbnwq\n }\n}\n\nfragment VendorListPage_vendors_pbnwq on Organization {\n vendors(first: $first, after: $after, last: $last, before: $before, orderBy: {direction: ASC, field: NAME}) {\n edges {\n node {\n id\n name\n description\n createdAt\n updatedAt\n riskTier\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n id\n}\n" - } -}; -})(); - -(node as any).hash = "1dc54deae9707bee0ab9beba6d844df3"; - -export default node; diff --git a/apps/console/src/pages/organizations/vendors/__generated__/VendorListPage_vendors.graphql.ts b/apps/console/src/pages/organizations/vendors/__generated__/VendorListPage_vendors.graphql.ts deleted file mode 100644 index eaabe42b3..000000000 --- a/apps/console/src/pages/organizations/vendors/__generated__/VendorListPage_vendors.graphql.ts +++ /dev/null @@ -1,262 +0,0 @@ -/** - * @generated SignedSource<<07023a3f17c448fc24762c05b3a7ff87>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ReaderFragment } from 'relay-runtime'; -export type RiskTier = "CRITICAL" | "GENERAL" | "SIGNIFICANT"; -import { FragmentRefs } from "relay-runtime"; -export type VendorListPage_vendors$data = { - readonly id: string; - readonly vendors: { - readonly __id: string; - readonly edges: ReadonlyArray<{ - readonly node: { - readonly createdAt: string; - readonly description: string; - readonly id: string; - readonly name: string; - readonly riskTier: RiskTier; - readonly updatedAt: string; - }; - }>; - readonly pageInfo: { - readonly endCursor: string | null | undefined; - readonly hasNextPage: boolean; - readonly hasPreviousPage: boolean; - readonly startCursor: string | null | undefined; - }; - }; - readonly " $fragmentType": "VendorListPage_vendors"; -}; -export type VendorListPage_vendors$key = { - readonly " $data"?: VendorListPage_vendors$data; - readonly " $fragmentSpreads": FragmentRefs<"VendorListPage_vendors">; -}; - -const node: ReaderFragment = (function(){ -var v0 = [ - "vendors" -], -v1 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null -}; -return { - "argumentDefinitions": [ - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "after" - }, - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "before" - }, - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "first" - }, - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "last" - } - ], - "kind": "Fragment", - "metadata": { - "connection": [ - { - "count": null, - "cursor": null, - "direction": "bidirectional", - "path": (v0/*: any*/) - } - ], - "refetch": { - "connection": { - "forward": { - "count": "first", - "cursor": "after" - }, - "backward": { - "count": "last", - "cursor": "before" - }, - "path": (v0/*: any*/) - }, - "fragmentPathInResult": [ - "node" - ], - "operation": require('./VendorListPagePaginationQuery.graphql'), - "identifierInfo": { - "identifierField": "id", - "identifierQueryVariableName": "id" - } - } - }, - "name": "VendorListPage_vendors", - "selections": [ - { - "alias": "vendors", - "args": [ - { - "kind": "Literal", - "name": "orderBy", - "value": { - "direction": "ASC", - "field": "NAME" - } - } - ], - "concreteType": "VendorConnection", - "kind": "LinkedField", - "name": "__VendorListPage_vendors_connection", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "VendorEdge", - "kind": "LinkedField", - "name": "edges", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Vendor", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v1/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "name", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "description", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "updatedAt", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "riskTier", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "__typename", - "storageKey": null - } - ], - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "cursor", - "storageKey": null - } - ], - "storageKey": null - }, - { - "alias": null, - "args": null, - "concreteType": "PageInfo", - "kind": "LinkedField", - "name": "pageInfo", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "hasNextPage", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "hasPreviousPage", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "startCursor", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "endCursor", - "storageKey": null - } - ], - "storageKey": null - }, - { - "kind": "ClientExtension", - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "__id", - "storageKey": null - } - ] - } - ], - "storageKey": "__VendorListPage_vendors_connection(orderBy:{\"direction\":\"ASC\",\"field\":\"NAME\"})" - }, - (v1/*: any*/) - ], - "type": "Organization", - "abstractKey": null -}; -})(); - -(node as any).hash = "beaab1664bed1fa776659595b1ef3c30"; - -export default node; diff --git a/go.sum b/go.sum index 88f7f8361..8d06b1a35 100644 --- a/go.sum +++ b/go.sum @@ -148,8 +148,6 @@ github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGC github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= go.gearno.de/crypto/uuid v0.1.0 h1:94BYg7GYItJ6yYZ1GJayb3VYhI9/FjxuR1nFaduR4hE= go.gearno.de/crypto/uuid v0.1.0/go.mod h1:fnIIvKO9QnsyLO3ZJLJT3r8KZv/p0FOeT5eZKilYWXg= -go.gearno.de/kit v0.0.0-20250324091140-5078a54c3c53 h1:4dKq7+vYcc6/+dYlZ0GSsvPKL6u/CHy9Fl6IY+0nv18= -go.gearno.de/kit v0.0.0-20250324091140-5078a54c3c53/go.mod h1:cEDPOR+WVloqrYmGBoSpHlLqSmTCBjW1j02ntm0Yk9U= go.gearno.de/kit v0.0.0-20250325104916-a9c1391b79f0 h1:X6TgcxxGPV0zbjgrLRgnqhqqzI9TQR1LraZl3VIiWd0= go.gearno.de/kit v0.0.0-20250325104916-a9c1391b79f0/go.mod h1:cEDPOR+WVloqrYmGBoSpHlLqSmTCBjW1j02ntm0Yk9U= go.gearno.de/x/panicf v0.1.1 h1:E3Cr9NB8Ry2EsvEG/1eHr7kplP3tEjTf5d56dTX64VQ= diff --git a/pkg/coredata/control.go b/pkg/coredata/control.go index d8dcee1ec..c7b32fb33 100644 --- a/pkg/coredata/control.go +++ b/pkg/coredata/control.go @@ -28,47 +28,47 @@ import ( ) type ( - Control struct { - ID gid.GID `db:"id"` - FrameworkID gid.GID `db:"framework_id"` - Category string `db:"category"` - Name string `db:"name"` - Description string `db:"description"` - Importance ControlImportance `db:"importance"` - State ControlState `db:"state"` - ContentRef string `db:"content_ref"` - CreatedAt time.Time `db:"created_at"` - UpdatedAt time.Time `db:"updated_at"` - Version int `db:"version"` - Standards []string `db:"standards"` + Mitigation struct { + ID gid.GID `db:"id"` + FrameworkID gid.GID `db:"framework_id"` + Category string `db:"category"` + Name string `db:"name"` + Description string `db:"description"` + Importance MitigationImportance `db:"importance"` + State MitigationState `db:"state"` + ContentRef string `db:"content_ref"` + CreatedAt time.Time `db:"created_at"` + UpdatedAt time.Time `db:"updated_at"` + Version int `db:"version"` + Standards []string `db:"standards"` } - Controls []*Control + Mitigations []*Mitigation - UpdateControlParams struct { + UpdateMitigationParams struct { ExpectedVersion int Name *string Description *string Category *string - State *ControlState - Importance *ControlImportance + State *MitigationState + Importance *MitigationImportance } ) -func (c Control) CursorKey(orderBy ControlOrderField) page.CursorKey { +func (c Mitigation) CursorKey(orderBy MitigationOrderField) page.CursorKey { switch orderBy { - case ControlOrderFieldCreatedAt: + case MitigationOrderFieldCreatedAt: return page.NewCursorKey(c.ID, c.CreatedAt) } panic(fmt.Sprintf("unsupported order by: %s", orderBy)) } -func (c *Control) LoadByID( +func (c *Mitigation) LoadByID( ctx context.Context, conn pg.Conn, scope Scoper, - controlID gid.GID, + mitigationID gid.GID, ) error { q := ` SELECT @@ -85,41 +85,41 @@ SELECT standards, version FROM - controls + mitigations WHERE %s - AND id = @control_id + AND id = @mitigation_id LIMIT 1; ` q = fmt.Sprintf(q, scope.SQLFragment()) - args := pgx.StrictNamedArgs{"control_id": controlID} + args := pgx.StrictNamedArgs{"mitigation_id": mitigationID} maps.Copy(args, scope.SQLArguments()) rows, err := conn.Query(ctx, q, args) if err != nil { - return fmt.Errorf("cannot query controls: %w", err) + return fmt.Errorf("cannot query mitigations: %w", err) } - control, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[Control]) + mitigation, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[Mitigation]) if err != nil { - return fmt.Errorf("cannot collect controls: %w", err) + return fmt.Errorf("cannot collect mitigations: %w", err) } - *c = control + *c = mitigation return nil } -func (c Control) Insert( +func (c Mitigation) Insert( ctx context.Context, conn pg.Conn, scope Scoper, ) error { q := ` INSERT INTO - controls ( + mitigations ( tenant_id, id, framework_id, @@ -136,7 +136,7 @@ INSERT INTO ) VALUES ( @tenant_id, - @control_id, + @mitigation_id, @framework_id, @category, @name, @@ -152,30 +152,30 @@ VALUES ( ` args := pgx.StrictNamedArgs{ - "tenant_id": scope.GetTenantID(), - "control_id": c.ID, - "framework_id": c.FrameworkID, - "category": c.Category, - "name": c.Name, - "version": 0, - "description": c.Description, - "content_ref": c.ContentRef, - "created_at": c.CreatedAt, - "updated_at": c.UpdatedAt, - "state": c.State, - "importance": c.Importance, - "standards": c.Standards, + "tenant_id": scope.GetTenantID(), + "mitigation_id": c.ID, + "framework_id": c.FrameworkID, + "category": c.Category, + "name": c.Name, + "version": 0, + "description": c.Description, + "content_ref": c.ContentRef, + "created_at": c.CreatedAt, + "updated_at": c.UpdatedAt, + "state": c.State, + "importance": c.Importance, + "standards": c.Standards, } _, err := conn.Exec(ctx, q, args) return err } -func (c *Controls) LoadByFrameworkID( +func (c *Mitigations) LoadByFrameworkID( ctx context.Context, conn pg.Conn, scope Scoper, frameworkID gid.GID, - cursor *page.Cursor[ControlOrderField], + cursor *page.Cursor[MitigationOrderField], ) error { q := ` SELECT @@ -192,7 +192,7 @@ SELECT standards, version FROM - controls + mitigations WHERE %s AND framework_id = @framework_id @@ -206,27 +206,27 @@ WHERE rows, err := conn.Query(ctx, q, args) if err != nil { - return fmt.Errorf("cannot query controls: %w", err) + return fmt.Errorf("cannot query mitigations: %w", err) } - controls, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[Control]) + mitigations, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[Mitigation]) if err != nil { - return fmt.Errorf("cannot collect controls: %w", err) + return fmt.Errorf("cannot collect mitigations: %w", err) } - *c = controls + *c = mitigations return nil } -func (c *Control) Update( +func (c *Mitigation) Update( ctx context.Context, conn pg.Conn, scope Scoper, - params UpdateControlParams, + params UpdateMitigationParams, ) error { q := ` -UPDATE controls SET +UPDATE mitigations SET name = COALESCE(@name, name), description = COALESCE(@description, description), category = COALESCE(@category, category), @@ -235,7 +235,7 @@ UPDATE controls SET updated_at = @updated_at, version = version + 1 WHERE %s - AND id = @control_id + AND id = @mitigation_id AND version = @expected_version RETURNING id, @@ -254,7 +254,7 @@ RETURNING q = fmt.Sprintf(q, scope.SQLFragment()) args := pgx.NamedArgs{ - "control_id": c.ID, + "mitigation_id": c.ID, "expected_version": params.ExpectedVersion, "name": params.Name, "description": params.Description, @@ -268,15 +268,15 @@ RETURNING rows, err := conn.Query(ctx, q, args) if err != nil { - return fmt.Errorf("cannot query controls: %w", err) + return fmt.Errorf("cannot query mitigations: %w", err) } - control, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[Control]) + mitigation, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[Mitigation]) if err != nil { - return fmt.Errorf("cannot collect controls: %w", err) + return fmt.Errorf("cannot collect mitigations: %w", err) } - *c = control + *c = mitigation return nil } diff --git a/pkg/coredata/control_importance.go b/pkg/coredata/control_importance.go index 213cf9215..355ec2e8b 100644 --- a/pkg/coredata/control_importance.go +++ b/pkg/coredata/control_importance.go @@ -20,48 +20,48 @@ import ( "fmt" ) -type ControlImportance uint8 +type MitigationImportance uint8 const ( - ControlImportanceMandatory ControlImportance = iota - ControlImportancePreferred - ControlImportanceAdvanced + MitigationImportanceMandatory MitigationImportance = iota + MitigationImportancePreferred + MitigationImportanceAdvanced ) -func (i ControlImportance) String() string { +func (i MitigationImportance) String() string { return []string{"MANDATORY", "PREFERRED", "ADVANCED"}[i] } -func (i *ControlImportance) Scan(value interface{}) error { +func (i *MitigationImportance) Scan(value interface{}) error { switch v := value.(type) { case uint8: - *i = ControlImportance(v) + *i = MitigationImportance(v) case string: switch v { case "MANDATORY": - *i = ControlImportanceMandatory + *i = MitigationImportanceMandatory case "PREFERRED": - *i = ControlImportancePreferred + *i = MitigationImportancePreferred case "ADVANCED": - *i = ControlImportanceAdvanced + *i = MitigationImportanceAdvanced default: - return fmt.Errorf("invalid ControlImportance value: %q", v) + return fmt.Errorf("invalid MitigationImportance value: %q", v) } default: - return fmt.Errorf("unsupported type for ControlImportance: %T", value) + return fmt.Errorf("unsupported type for MitigationImportance: %T", value) } return nil } -func (i ControlImportance) Value() (driver.Value, error) { +func (i MitigationImportance) Value() (driver.Value, error) { return i.String(), nil } -func (i ControlImportance) MarshalJSON() ([]byte, error) { +func (i MitigationImportance) MarshalJSON() ([]byte, error) { return json.Marshal(i.String()) } -func (i *ControlImportance) UnmarshalJSON(data []byte) error { +func (i *MitigationImportance) UnmarshalJSON(data []byte) error { var s string if err := json.Unmarshal(data, &s); err != nil { return err @@ -69,18 +69,18 @@ func (i *ControlImportance) UnmarshalJSON(data []byte) error { switch s { case "MANDATORY": - *i = ControlImportanceMandatory + *i = MitigationImportanceMandatory case "PREFERRED": - *i = ControlImportancePreferred + *i = MitigationImportancePreferred case "ADVANCED": - *i = ControlImportanceAdvanced + *i = MitigationImportanceAdvanced default: - return fmt.Errorf("invalid ControlImportance value: %q", s) + return fmt.Errorf("invalid MitigationImportance value: %q", s) } return nil } -func (i *ControlImportance) UnmarshalText(text []byte) error { +func (i *MitigationImportance) UnmarshalText(text []byte) error { var s string if err := json.Unmarshal(text, &s); err != nil { return err @@ -88,13 +88,13 @@ func (i *ControlImportance) UnmarshalText(text []byte) error { switch s { case "MANDATORY": - *i = ControlImportanceMandatory + *i = MitigationImportanceMandatory case "PREFERRED": - *i = ControlImportancePreferred + *i = MitigationImportancePreferred case "ADVANCED": - *i = ControlImportanceAdvanced + *i = MitigationImportanceAdvanced default: - return fmt.Errorf("invalid ControlImportance value: %q", s) + return fmt.Errorf("invalid MitigationImportance value: %q", s) } return nil } diff --git a/pkg/coredata/control_order_field.go b/pkg/coredata/control_order_field.go index 8004efe45..8eabc0e7b 100644 --- a/pkg/coredata/control_order_field.go +++ b/pkg/coredata/control_order_field.go @@ -15,26 +15,26 @@ package coredata type ( - ControlOrderField string + MitigationOrderField string ) const ( - ControlOrderFieldCreatedAt ControlOrderField = "CREATED_AT" + MitigationOrderFieldCreatedAt MitigationOrderField = "CREATED_AT" ) -func (p ControlOrderField) Column() string { +func (p MitigationOrderField) Column() string { return string(p) } -func (p ControlOrderField) String() string { +func (p MitigationOrderField) String() string { return string(p) } -func (p ControlOrderField) MarshalText() ([]byte, error) { +func (p MitigationOrderField) MarshalText() ([]byte, error) { return []byte(p.String()), nil } -func (p *ControlOrderField) UnmarshalText(text []byte) error { - *p = ControlOrderField(text) +func (p *MitigationOrderField) UnmarshalText(text []byte) error { + *p = MitigationOrderField(text) return nil } diff --git a/pkg/coredata/control_state.go b/pkg/coredata/control_state.go index 60dc7ea9e..aa60449e9 100644 --- a/pkg/coredata/control_state.go +++ b/pkg/coredata/control_state.go @@ -20,65 +20,65 @@ import ( ) type ( - ControlState uint8 + MitigationState uint8 ) const ( - ControlStateNotStarted ControlState = iota - ControlStateInProgress - ControlStateNotApplicable - ControlStateImplemented + MitigationStateNotStarted MitigationState = iota + MitigationStateInProgress + MitigationStateNotApplicable + MitigationStateImplemented ) -func (cs ControlState) MarshalText() ([]byte, error) { +func (cs MitigationState) MarshalText() ([]byte, error) { return []byte(cs.String()), nil } -func (cs *ControlState) UnmarshalText(data []byte) error { +func (cs *MitigationState) UnmarshalText(data []byte) error { val := string(data) switch val { - case ControlStateNotStarted.String(): - *cs = ControlStateNotStarted - case ControlStateInProgress.String(): - *cs = ControlStateInProgress - case ControlStateNotApplicable.String(): - *cs = ControlStateNotApplicable - case ControlStateImplemented.String(): - *cs = ControlStateImplemented + case MitigationStateNotStarted.String(): + *cs = MitigationStateNotStarted + case MitigationStateInProgress.String(): + *cs = MitigationStateInProgress + case MitigationStateNotApplicable.String(): + *cs = MitigationStateNotApplicable + case MitigationStateImplemented.String(): + *cs = MitigationStateImplemented default: - return fmt.Errorf("invalid ControlState value: %q", val) + return fmt.Errorf("invalid MitigationState value: %q", val) } return nil } -func (cs ControlState) String() string { +func (cs MitigationState) String() string { var val string switch cs { - case ControlStateNotStarted: + case MitigationStateNotStarted: val = "NOT_STARTED" - case ControlStateInProgress: + case MitigationStateInProgress: val = "IN_PROGRESS" - case ControlStateNotApplicable: + case MitigationStateNotApplicable: val = "NOT_APPLICABLE" - case ControlStateImplemented: + case MitigationStateImplemented: val = "IMPLEMENTED" } return val } -func (cs *ControlState) Scan(value any) error { +func (cs *MitigationState) Scan(value any) error { val, ok := value.(string) if !ok { - return fmt.Errorf("invalid scan source for ControlState, expected string got %T", value) + return fmt.Errorf("invalid scan source for MitigationState, expected string got %T", value) } return cs.UnmarshalText([]byte(val)) } -func (cs ControlState) Value() (driver.Value, error) { +func (cs MitigationState) Value() (driver.Value, error) { return cs.String(), nil } diff --git a/pkg/coredata/entity_type_reg.go b/pkg/coredata/entity_type_reg.go index b6e1b76a0..fb4c14578 100644 --- a/pkg/coredata/entity_type_reg.go +++ b/pkg/coredata/entity_type_reg.go @@ -17,7 +17,7 @@ package coredata const ( OrganizationEntityType uint16 = iota FrameworkEntityType - ControlEntityType + MitigationEntityType TaskEntityType EvidenceEntityType ControlStateTransitionEntityType diff --git a/pkg/coredata/migrations/20250327T093314Z.sql b/pkg/coredata/migrations/20250327T093314Z.sql new file mode 100644 index 000000000..3812429fd --- /dev/null +++ b/pkg/coredata/migrations/20250327T093314Z.sql @@ -0,0 +1,97 @@ +-- Rename control_state ENUM to mitigation_state +-- We need to create a new type and update all references since +-- PostgreSQL doesn't support renaming enum types directly +CREATE TYPE mitigation_state AS ENUM ( + 'NOT_STARTED', + 'IN_PROGRESS', + 'NOT_APPLICABLE', + 'IMPLEMENTED' +); + +-- Create new mitigation_importance type +CREATE TYPE mitigation_importance AS ENUM ( + 'MANDATORY', + 'PREFERRED', + 'ADVANCED' +); + +-- Rename controls table to mitigations, adding the new columns with the new types +CREATE TABLE mitigations ( + id TEXT PRIMARY KEY, + tenant_id TEXT NOT NULL, + framework_id TEXT NOT NULL, + name TEXT NOT NULL, + description TEXT NOT NULL, + content_ref TEXT NOT NULL, + category TEXT NOT NULL, + state mitigation_state NOT NULL, + importance mitigation_importance NOT NULL, + version INTEGER NOT NULL, + standards TEXT[] NOT NULL, + created_at TIMESTAMP WITH TIME ZONE NOT NULL, + updated_at TIMESTAMP WITH TIME ZONE NOT NULL +); + +-- Copy data from controls to mitigations table +INSERT INTO mitigations ( + id, + tenant_id, + framework_id, + name, + description, + content_ref, + category, + state, + importance, + version, + standards, + created_at, + updated_at +) +SELECT + id, + tenant_id, + framework_id, + name, + description, + content_ref, + category, + (state::TEXT)::mitigation_state, + (importance::TEXT)::mitigation_importance, + version, + standards, + created_at, + updated_at +FROM controls; + +-- Update tasks to reference mitigations instead of controls +ALTER TABLE tasks RENAME COLUMN control_id TO mitigation_id; + +-- Update foreign key constraint +ALTER TABLE tasks DROP CONSTRAINT fk_tasks_control_id; +ALTER TABLE tasks ADD CONSTRAINT fk_tasks_mitigation_id + FOREIGN KEY (mitigation_id) REFERENCES mitigations(id) ON DELETE CASCADE; + +-- If we have any control_state_transitions table, rename it +-- Since the original migration file 20250310T161900Z.sql dropped it, this might not be necessary, +-- but including for completeness +DO $$ +BEGIN + IF EXISTS ( + SELECT FROM information_schema.tables + WHERE table_name = 'control_state_transitions' + ) THEN + ALTER TABLE control_state_transitions RENAME TO mitigation_state_transitions; + ALTER TABLE mitigation_state_transitions RENAME COLUMN control_id TO mitigation_id; + ALTER TABLE mitigation_state_transitions + DROP CONSTRAINT IF EXISTS control_state_transitions_control_id_fkey; + ALTER TABLE mitigation_state_transitions + ADD CONSTRAINT mitigation_state_transitions_mitigation_id_fkey + FOREIGN KEY (mitigation_id) REFERENCES mitigations(id); + END IF; +END $$; + +-- Drop old controls table and enum types after migration is complete +DROP TABLE controls; +DROP TYPE control_state; +DROP TYPE control_importance; \ No newline at end of file diff --git a/pkg/coredata/task.go b/pkg/coredata/task.go index 417619819..992f03f05 100644 --- a/pkg/coredata/task.go +++ b/pkg/coredata/task.go @@ -30,16 +30,15 @@ import ( type ( Task struct { ID gid.GID `db:"id"` - ControlID gid.GID `db:"control_id"` + MitigationID gid.GID `db:"mitigation_id"` Name string `db:"name"` Description string `db:"description"` State TaskState `db:"state"` - ContentRef string `db:"content_ref"` + TimeEstimate *time.Duration `db:"time_estimate"` + AssignedToID *gid.GID `db:"assigned_to"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` Version int `db:"version"` - AssignedTo *gid.GID `db:"assigned_to"` - TimeEstimate *time.Duration `db:"time_estimate"` } Tasks []*Task @@ -53,16 +52,16 @@ type ( } ) -func (t Task) CursorKey(orderBy TaskOrderField) page.CursorKey { +func (c Task) CursorKey(orderBy TaskOrderField) page.CursorKey { switch orderBy { case TaskOrderFieldCreatedAt: - return page.NewCursorKey(t.ID, t.CreatedAt) + return page.NewCursorKey(c.ID, c.CreatedAt) } panic(fmt.Sprintf("unsupported order by: %s", orderBy)) } -func (t *Task) LoadByID( +func (c *Task) LoadByID( ctx context.Context, conn pg.Conn, scope Scoper, @@ -71,13 +70,12 @@ func (t *Task) LoadByID( q := ` SELECT id, - control_id, + mitigation_id, name, description, - time_estimate, state, - assigned_to, - content_ref, + time_estimate, + assigned_to, created_at, updated_at, version @@ -96,104 +94,100 @@ LIMIT 1; rows, err := conn.Query(ctx, q, args) if err != nil { - return fmt.Errorf("cannot query task: %w", err) + return fmt.Errorf("cannot query tasks: %w", err) } task, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[Task]) if err != nil { - return fmt.Errorf("cannot collect task: %w", err) + return fmt.Errorf("cannot collect tasks: %w", err) } - *t = task + *c = task return nil } -func (t Task) Insert( +func (c Task) Insert( ctx context.Context, conn pg.Conn, scope Scoper, ) error { q := ` -INSERT INTO tasks ( - tenant_id, - id, - name, - control_id, - description, - content_ref, - created_at, - updated_at, - version, - state, - time_estimate, - assigned_to -) +INSERT INTO + tasks ( + tenant_id, + id, + mitigation_id, + name, + description, + state, + time_estimate, + assigned_to, + created_at, + updated_at, + version + ) VALUES ( @tenant_id, @task_id, + @mitigation_id, @name, - @control_id, @description, - @content_ref, + @state, + @time_estimate, + @assigned_to, @created_at, @updated_at, - @version, - @state, - @time_estimate, - @assigned_to + @version ); ` args := pgx.StrictNamedArgs{ "tenant_id": scope.GetTenantID(), - "task_id": t.ID, - "control_id": t.ControlID, - "name": t.Name, - "description": t.Description, - "content_ref": t.ContentRef, - "created_at": t.CreatedAt, - "updated_at": t.UpdatedAt, - "version": t.Version, - "state": t.State, - "time_estimate": t.TimeEstimate, - "assigned_to": t.AssignedTo, + "task_id": c.ID, + "mitigation_id": c.MitigationID, + "name": c.Name, + "description": c.Description, + "state": c.State, + "time_estimate": c.TimeEstimate, + "assigned_to": c.AssignedToID, + "created_at": c.CreatedAt, + "updated_at": c.UpdatedAt, + "version": 0, } _, err := conn.Exec(ctx, q, args) return err } -func (t *Tasks) LoadByControlID( +func (c *Tasks) LoadByMitigationID( ctx context.Context, conn pg.Conn, scope Scoper, - controlID gid.GID, + mitigationID gid.GID, cursor *page.Cursor[TaskOrderField], ) error { q := ` SELECT id, - control_id, + mitigation_id, name, description, state, - time_estimate, - content_ref, + time_estimate, + assigned_to, created_at, updated_at, - version, - assigned_to + version FROM tasks WHERE %s - AND control_id = @control_id + AND mitigation_id = @mitigation_id AND %s ` - q = fmt.Sprintf(q, scope.SQLFragment(), cursor.SQLFragment()) - args := pgx.StrictNamedArgs{"control_id": controlID} + args := pgx.StrictNamedArgs{"mitigation_id": mitigationID} maps.Copy(args, scope.SQLArguments()) maps.Copy(args, cursor.SQLArguments()) @@ -207,40 +201,44 @@ WHERE return fmt.Errorf("cannot collect tasks: %w", err) } - *t = tasks + *c = tasks return nil } -func (t *Task) Update( +func (c *Task) Update( ctx context.Context, conn pg.Conn, scope Scoper, params UpdateTaskParams, ) error { q := ` -UPDATE tasks -SET +UPDATE tasks SET name = COALESCE(@name, name), description = COALESCE(@description, description), state = COALESCE(@state, state), - time_estimate = COALESCE(@time_estimate, time_estimate), + time_estimate = COALESCE(@time_estimate, time_estimate), updated_at = @updated_at, version = version + 1 -WHERE - %s +WHERE %s AND id = @task_id AND version = @expected_version -RETURNING - state, - time_estimate, - updated_at, - version; +RETURNING + id, + mitigation_id, + name, + description, + state, + time_estimate, + assigned_to, + created_at, + updated_at, + version ` q = fmt.Sprintf(q, scope.SQLFragment()) - args := pgx.StrictNamedArgs{ - "task_id": t.ID, + args := pgx.NamedArgs{ + "task_id": c.ID, "expected_version": params.ExpectedVersion, "name": params.Name, "description": params.Description, @@ -248,75 +246,235 @@ RETURNING "time_estimate": params.TimeEstimate, "updated_at": time.Now(), } + maps.Copy(args, scope.SQLArguments()) - err := conn.QueryRow(ctx, q, args).Scan(&t.State, &t.TimeEstimate, &t.UpdatedAt, &t.Version) - return err + rows, err := conn.Query(ctx, q, args) + if err != nil { + return fmt.Errorf("cannot query tasks: %w", err) + } + + task, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[Task]) + if err != nil { + return fmt.Errorf("cannot collect tasks: %w", err) + } + + *c = task + + return nil } -func (t *Task) AssignTo( +func (c *Task) AssignTo( ctx context.Context, conn pg.Conn, scope Scoper, - assignedTo gid.GID, + assignTo gid.GID, ) error { q := ` -UPDATE tasks -SET - assigned_to = @assigned_to -WHERE - %s +UPDATE tasks SET + assigned_to = @assigned_to, + updated_at = @updated_at, + version = version + 1 +WHERE %s AND id = @task_id +RETURNING + id, + mitigation_id, + name, + description, + state, + time_estimate, + assigned_to, + created_at, + updated_at, + version ` - q = fmt.Sprintf(q, scope.SQLFragment()) - args := pgx.StrictNamedArgs{ - "task_id": t.ID, - "assigned_to": assignedTo, + args := pgx.NamedArgs{ + "task_id": c.ID, + "assigned_to": assignTo, + "updated_at": time.Now(), } + maps.Copy(args, scope.SQLArguments()) - _, err := conn.Exec(ctx, q, args) - return err + rows, err := conn.Query(ctx, q, args) + if err != nil { + return fmt.Errorf("cannot query tasks: %w", err) + } + + task, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[Task]) + if err != nil { + return fmt.Errorf("cannot collect tasks: %w", err) + } + + *c = task + + return nil } -func (t *Task) Unassign( +func (c *Task) Unassign( ctx context.Context, conn pg.Conn, scope Scoper, ) error { q := ` -UPDATE tasks -SET - assigned_to = NULL -WHERE - %s +UPDATE tasks SET + assigned_to = NULL, + updated_at = @updated_at, + version = version + 1 +WHERE %s AND id = @task_id +RETURNING + id, + mitigation_id, + name, + description, + state, + time_estimate, + assigned_to, + created_at, + updated_at, + version ` - q = fmt.Sprintf(q, scope.SQLFragment()) - args := pgx.StrictNamedArgs{ - "task_id": t.ID, + args := pgx.NamedArgs{ + "task_id": c.ID, + "updated_at": time.Now(), } + maps.Copy(args, scope.SQLArguments()) - _, err := conn.Exec(ctx, q, args) - return err + rows, err := conn.Query(ctx, q, args) + if err != nil { + return fmt.Errorf("cannot query tasks: %w", err) + } + + task, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[Task]) + if err != nil { + return fmt.Errorf("cannot collect tasks: %w", err) + } + + *c = task + + return nil } -func (t *Task) Delete( +func (c *Task) Delete( ctx context.Context, conn pg.Conn, scope Scoper, ) error { - q := `DELETE FROM tasks WHERE %s AND id = @task_id` + q := ` +DELETE FROM tasks +WHERE %s + AND id = @task_id +` q = fmt.Sprintf(q, scope.SQLFragment()) - args := pgx.StrictNamedArgs{"task_id": t.ID} + args := pgx.NamedArgs{ + "task_id": c.ID, + } + maps.Copy(args, scope.SQLArguments()) _, err := conn.Exec(ctx, q, args) - return err + if err != nil { + return fmt.Errorf("cannot delete task: %w", err) + } + + return nil +} + +// Helper functions for task management + +var ( + ErrAssignTaskFailed = fmt.Errorf("failed to assign task") + ErrUnassignTaskFailed = fmt.Errorf("failed to unassign task") + ErrUpdateTaskFailed = fmt.Errorf("failed to update task") + ErrDeleteTaskFailed = fmt.Errorf("failed to delete task") +) + +type TaskUpdate struct { + Name *string + Description *string + State *TaskState + TimeEstimate *time.Duration +} + +func AssignTask( + ctx context.Context, + conn pg.Conn, + scope Scoper, + taskID gid.GID, + assignedToID gid.GID, +) (*Task, error) { + task := &Task{ID: taskID} + if err := task.LoadByID(ctx, conn, scope, taskID); err != nil { + return nil, ErrAssignTaskFailed + } + + if err := task.AssignTo(ctx, conn, scope, assignedToID); err != nil { + return nil, ErrAssignTaskFailed + } + + return task, nil +} + +func UnassignTask( + ctx context.Context, + conn pg.Conn, + scope Scoper, + taskID gid.GID, +) (*Task, error) { + task := &Task{ID: taskID} + if err := task.LoadByID(ctx, conn, scope, taskID); err != nil { + return nil, ErrUnassignTaskFailed + } + + if err := task.Unassign(ctx, conn, scope); err != nil { + return nil, ErrUnassignTaskFailed + } + + return task, nil +} + +func UpdateTask( + ctx context.Context, + conn pg.Conn, + scope Scoper, + taskID gid.GID, + expectedVersion int, + updates *TaskUpdate, +) (*Task, error) { + task := &Task{ID: taskID} + + if err := task.Update(ctx, conn, scope, UpdateTaskParams{ + ExpectedVersion: expectedVersion, + Name: updates.Name, + Description: updates.Description, + State: updates.State, + TimeEstimate: updates.TimeEstimate, + }); err != nil { + return nil, ErrUpdateTaskFailed + } + + return task, nil +} + +func DeleteTask( + ctx context.Context, + conn pg.Conn, + scope Scoper, + taskID gid.GID, +) error { + task := &Task{ID: taskID} + + if err := task.Delete(ctx, conn, scope); err != nil { + return ErrDeleteTaskFailed + } + + return nil } diff --git a/pkg/probo/framework_service.go b/pkg/probo/framework_service.go index 0bbb63244..66db80c7d 100644 --- a/pkg/probo/framework_service.go +++ b/pkg/probo/framework_service.go @@ -53,12 +53,12 @@ type ( Description string `json:"description"` Version string `json:"version"` Controls []struct { - ContentRef string `json:"content-ref"` - Category string `json:"category"` - Importance coredata.ControlImportance `json:"importance"` - Standards []string `json:"standards"` - Name string `json:"name"` - Description string `json:"description"` + ContentRef string `json:"content-ref"` + Category string `json:"category"` + Importance coredata.MitigationImportance `json:"importance"` + Standards []string `json:"standards"` + Name string `json:"name"` + Description string `json:"description"` Tasks []struct { Name string `json:"name"` Description string `json:"description"` @@ -212,31 +212,31 @@ func (s FrameworkService) Import( UpdatedAt: now, } - importedControls := coredata.Controls{} + importedMitigations := coredata.Mitigations{} importedTasks := coredata.Tasks{} - for _, control := range req.Data.Framework.Controls { - controlID, err := gid.NewGID(organizationID.TenantID(), coredata.ControlEntityType) + for _, mitigation := range req.Data.Framework.Controls { + controlID, err := gid.NewGID(organizationID.TenantID(), coredata.MitigationEntityType) if err != nil { return nil, fmt.Errorf("cannot create global id: %w", err) } - importedControl := &coredata.Control{ + importedControl := &coredata.Mitigation{ ID: controlID, FrameworkID: frameworkID, - Category: control.Category, - Importance: coredata.ControlImportance(control.Importance), - Name: control.Name, - Description: control.Description, - State: coredata.ControlStateNotStarted, - ContentRef: control.ContentRef, + Category: mitigation.Category, + Importance: coredata.MitigationImportance(mitigation.Importance), + Name: mitigation.Name, + Description: mitigation.Description, + State: coredata.MitigationStateNotStarted, + ContentRef: mitigation.ContentRef, CreatedAt: now, UpdatedAt: now, - Standards: control.Standards, + Standards: mitigation.Standards, } - importedControls = append(importedControls, importedControl) + importedMitigations = append(importedMitigations, importedControl) - for _, task := range control.Tasks { + for _, task := range mitigation.Tasks { taskID, err := gid.NewGID(organizationID.TenantID(), coredata.TaskEntityType) if err != nil { return nil, fmt.Errorf("cannot create global id: %w", err) @@ -249,11 +249,10 @@ func (s FrameworkService) Import( importedTasks = append(importedTasks, &coredata.Task{ ID: taskID, - ControlID: controlID, + MitigationID: controlID, Name: task.Name, State: coredata.TaskStateTodo, Description: task.Description, - ContentRef: "", CreatedAt: now, UpdatedAt: now, TimeEstimate: timeEstimate, @@ -270,9 +269,9 @@ func (s FrameworkService) Import( return fmt.Errorf("cannot insert framework: %w", err) } - for _, importedControl := range importedControls { - if err := importedControl.Insert(ctx, tx, s.svc.scope); err != nil { - return fmt.Errorf("cannot insert control: %w", err) + for _, importedMitigation := range importedMitigations { + if err := importedMitigation.Insert(ctx, tx, s.svc.scope); err != nil { + return fmt.Errorf("cannot insert mitigation: %w", err) } } diff --git a/pkg/probo/control_service.go b/pkg/probo/mitigation_service.go similarity index 62% rename from pkg/probo/control_service.go rename to pkg/probo/mitigation_service.go index aca61b27b..5820e64fc 100644 --- a/pkg/probo/control_service.go +++ b/pkg/probo/mitigation_service.go @@ -26,40 +26,39 @@ import ( ) type ( - ControlService struct { + MitigationService struct { svc *TenantService } - CreateControlRequest struct { + CreateMitigationRequest struct { FrameworkID gid.GID Name string Description string - ContentRef string Category string - Importance coredata.ControlImportance + Importance coredata.MitigationImportance } - UpdateControlRequest struct { + UpdateMitigationRequest struct { ID gid.GID ExpectedVersion int Name *string Description *string Category *string - State *coredata.ControlState - Importance *coredata.ControlImportance + State *coredata.MitigationState + Importance *coredata.MitigationImportance } ) -func (s ControlService) Get( +func (s MitigationService) Get( ctx context.Context, - controlID gid.GID, -) (*coredata.Control, error) { - control := &coredata.Control{} + mitigationID gid.GID, +) (*coredata.Mitigation, error) { + mitigation := &coredata.Mitigation{} err := s.svc.pg.WithConn( ctx, func(conn pg.Conn) error { - return control.LoadByID(ctx, conn, s.svc.scope, controlID) + return mitigation.LoadByID(ctx, conn, s.svc.scope, mitigationID) }, ) @@ -67,14 +66,14 @@ func (s ControlService) Get( return nil, err } - return control, nil + return mitigation, nil } -func (s ControlService) Update( +func (s MitigationService) Update( ctx context.Context, - req UpdateControlRequest, -) (*coredata.Control, error) { - params := coredata.UpdateControlParams{ + req UpdateMitigationRequest, +) (*coredata.Mitigation, error) { + params := coredata.UpdateMitigationParams{ ExpectedVersion: req.ExpectedVersion, Name: req.Name, Description: req.Description, @@ -83,31 +82,31 @@ func (s ControlService) Update( Importance: req.Importance, } - control := &coredata.Control{ID: req.ID} + mitigation := &coredata.Mitigation{ID: req.ID} err := s.svc.pg.WithTx( ctx, func(conn pg.Conn) error { - return control.Update(ctx, conn, s.svc.scope, params) + return mitigation.Update(ctx, conn, s.svc.scope, params) }) if err != nil { return nil, err } - return control, nil + return mitigation, nil } -func (s ControlService) ListForFrameworkID( +func (s MitigationService) ListForFrameworkID( ctx context.Context, frameworkID gid.GID, - cursor *page.Cursor[coredata.ControlOrderField], -) (*page.Page[*coredata.Control, coredata.ControlOrderField], error) { - var controls coredata.Controls + cursor *page.Cursor[coredata.MitigationOrderField], +) (*page.Page[*coredata.Mitigation, coredata.MitigationOrderField], error) { + var mitigations coredata.Mitigations err := s.svc.pg.WithConn( ctx, func(conn pg.Conn) error { - return controls.LoadByFrameworkID( + return mitigations.LoadByFrameworkID( ctx, conn, s.svc.scope, @@ -121,30 +120,29 @@ func (s ControlService) ListForFrameworkID( return nil, err } - return page.NewPage(controls, cursor), nil + return page.NewPage(mitigations, cursor), nil } -func (s ControlService) Create( +func (s MitigationService) Create( ctx context.Context, - req CreateControlRequest, -) (*coredata.Control, error) { + req CreateMitigationRequest, +) (*coredata.Mitigation, error) { now := time.Now() - controlID, err := gid.NewGID(s.svc.scope.GetTenantID(), coredata.ControlEntityType) + mitigationID, err := gid.NewGID(s.svc.scope.GetTenantID(), coredata.MitigationEntityType) if err != nil { - return nil, fmt.Errorf("cannot create control global id: %w", err) + return nil, fmt.Errorf("cannot create mitigation global id: %w", err) } framework := &coredata.Framework{} - control := &coredata.Control{ - ID: controlID, + mitigation := &coredata.Mitigation{ + ID: mitigationID, FrameworkID: req.FrameworkID, Name: req.Name, Description: req.Description, Category: req.Category, - State: coredata.ControlStateNotStarted, - Importance: req.Importance, - ContentRef: req.ContentRef, + State: coredata.MitigationStateNotStarted, Standards: []string{}, + Importance: req.Importance, CreatedAt: now, UpdatedAt: now, } @@ -156,8 +154,8 @@ func (s ControlService) Create( return fmt.Errorf("cannot load framework %q: %w", req.FrameworkID, err) } - if err := control.Insert(ctx, conn, s.svc.scope); err != nil { - return fmt.Errorf("cannot insert control: %w", err) + if err := mitigation.Insert(ctx, conn, s.svc.scope); err != nil { + return fmt.Errorf("cannot insert mitigation: %w", err) } return nil @@ -168,5 +166,5 @@ func (s ControlService) Create( return nil, err } - return control, nil + return mitigation, nil } diff --git a/pkg/probo/organization_service.go b/pkg/probo/organization_service.go index e16c742ea..00718f326 100644 --- a/pkg/probo/organization_service.go +++ b/pkg/probo/organization_service.go @@ -66,7 +66,7 @@ func (s OrganizationService) Create( ctx, func(conn pg.Conn) error { if err := organization.Insert(ctx, conn); err != nil { - return fmt.Errorf("cannot insert control: %w", err) + return fmt.Errorf("cannot insert mitigation: %w", err) } return nil diff --git a/pkg/probo/service.go b/pkg/probo/service.go index f09c2f96c..cf6e1d6bd 100644 --- a/pkg/probo/service.go +++ b/pkg/probo/service.go @@ -32,20 +32,18 @@ type ( } TenantService struct { - pg *pg.Client - s3 *s3.Client - bucket string - - scope coredata.Scoper - - Policies *PolicyService - Controls *ControlService - Evidences *EvidenceService + pg *pg.Client + s3 *s3.Client + bucket string + scope coredata.Scoper Frameworks *FrameworkService + Mitigations *MitigationService Tasks *TaskService + Evidences *EvidenceService Peoples *PeopleService - Organizations *OrganizationService Vendors *VendorService + Policies *PolicyService + Organizations *OrganizationService } ) @@ -76,14 +74,13 @@ func (s *Service) WithTenant(tenantID gid.TenantID) *TenantService { scope: coredata.NewScope(tenantID), } - tenantService.Policies = &PolicyService{svc: tenantService} - tenantService.Controls = &ControlService{svc: tenantService} - tenantService.Evidences = &EvidenceService{svc: tenantService} tenantService.Frameworks = &FrameworkService{svc: tenantService} + tenantService.Mitigations = &MitigationService{svc: tenantService} tenantService.Tasks = &TaskService{svc: tenantService} + tenantService.Evidences = &EvidenceService{svc: tenantService} tenantService.Peoples = &PeopleService{svc: tenantService} - tenantService.Organizations = &OrganizationService{svc: tenantService} tenantService.Vendors = &VendorService{svc: tenantService} - + tenantService.Policies = &PolicyService{svc: tenantService} + tenantService.Organizations = &OrganizationService{svc: tenantService} return tenantService } diff --git a/pkg/probo/task_service.go b/pkg/probo/task_service.go index 9bebdcd25..0d58803c6 100644 --- a/pkg/probo/task_service.go +++ b/pkg/probo/task_service.go @@ -16,6 +16,7 @@ package probo import ( "context" + "errors" "fmt" "time" @@ -31,16 +32,15 @@ type ( } CreateTaskRequest struct { - ControlID gid.GID + MitigationID gid.GID Name string - ContentRef string Description string TimeEstimate *time.Duration - AssignedTo *gid.GID + AssignedToID *gid.GID } UpdateTaskRequest struct { - ID gid.GID + TaskID gid.GID ExpectedVersion int Name *string Description *string @@ -53,173 +53,41 @@ func (s TaskService) Create( ctx context.Context, req CreateTaskRequest, ) (*coredata.Task, error) { - now := time.Now() - taskID, err := gid.NewGID(s.svc.scope.GetTenantID(), coredata.TaskEntityType) - if err != nil { - return nil, fmt.Errorf("cannot create task global id: %w", err) - } - - control := &coredata.Control{} - task := &coredata.Task{ - ID: taskID, - ControlID: req.ControlID, - Name: req.Name, - ContentRef: req.ContentRef, - State: coredata.TaskStateTodo, - Description: req.Description, - TimeEstimate: req.TimeEstimate, - AssignedTo: req.AssignedTo, - CreatedAt: now, - UpdatedAt: now, - } - - err = s.svc.pg.WithTx( - ctx, - func(conn pg.Conn) error { - if err := control.LoadByID(ctx, conn, s.svc.scope, req.ControlID); err != nil { - return fmt.Errorf("cannot laod control %q: %w", req.ControlID, err) - } - - if err := task.Insert(ctx, conn, s.svc.scope); err != nil { - return fmt.Errorf("cannot insert task: %w", err) - } - - return nil - }, - ) - - if err != nil { - return nil, err - } - - return task, nil -} - -func (s TaskService) Assign( - ctx context.Context, - taskID gid.GID, - assignedTo gid.GID, -) (*coredata.Task, error) { - task := &coredata.Task{ID: taskID} + mitigation := &coredata.Mitigation{} err := s.svc.pg.WithTx( ctx, func(conn pg.Conn) error { - if err := task.LoadByID(ctx, conn, s.svc.scope, taskID); err != nil { - return fmt.Errorf("cannot load task %q: %w", taskID, err) + if err := mitigation.LoadByID(ctx, conn, s.svc.scope, req.MitigationID); err != nil { + return fmt.Errorf("cannot load mitigation %q: %w", req.MitigationID, err) } - task.AssignedTo = &assignedTo - - if err := task.AssignTo(ctx, conn, s.svc.scope, assignedTo); err != nil { - return fmt.Errorf("cannot assign task %q to %q: %w", taskID, assignedTo, err) + now := time.Now() + taskID, err := gid.NewGID(s.svc.scope.GetTenantID(), coredata.TaskEntityType) + if err != nil { + return fmt.Errorf("cannot generate id: %w", err) } - return nil - }, - ) - - if err != nil { - return nil, err - } - - return task, nil -} - -func (s TaskService) Unassign( - ctx context.Context, - taskID gid.GID, -) (*coredata.Task, error) { - task := &coredata.Task{ID: taskID} - - err := s.svc.pg.WithTx( - ctx, - func(conn pg.Conn) error { - if err := task.LoadByID(ctx, conn, s.svc.scope, taskID); err != nil { - return fmt.Errorf("cannot load task %q: %w", taskID, err) + task := &coredata.Task{ + ID: taskID, + MitigationID: req.MitigationID, + Name: req.Name, + Description: req.Description, + TimeEstimate: req.TimeEstimate, + AssignedToID: req.AssignedToID, + State: coredata.TaskStateTodo, + CreatedAt: now, + UpdatedAt: now, } - task.AssignedTo = nil - - if err := task.Unassign(ctx, conn, s.svc.scope); err != nil { - return fmt.Errorf("cannot unassign task %q: %w", taskID, err) - } - - return nil + return task.Insert(ctx, conn, s.svc.scope) }, ) - if err != nil { - return nil, err + return nil, fmt.Errorf("cannot create task: %w", err) } - return task, nil -} - -func (s TaskService) Update( - ctx context.Context, - req UpdateTaskRequest, -) (*coredata.Task, error) { - params := coredata.UpdateTaskParams{ - ExpectedVersion: req.ExpectedVersion, - Name: req.Name, - Description: req.Description, - State: req.State, - TimeEstimate: req.TimeEstimate, - } - - task := &coredata.Task{ID: req.ID} - - err := s.svc.pg.WithTx( - ctx, - func(conn pg.Conn) error { - return task.Update(ctx, conn, s.svc.scope, params) - }) - if err != nil { - return nil, err - } - - return task, nil -} - -func (s TaskService) ListForControlID( - ctx context.Context, - controlID gid.GID, - cursor *page.Cursor[coredata.TaskOrderField], -) (*page.Page[*coredata.Task, coredata.TaskOrderField], error) { - var tasks coredata.Tasks - - err := s.svc.pg.WithConn( - ctx, - func(conn pg.Conn) error { - return tasks.LoadByControlID( - ctx, - conn, - s.svc.scope, - controlID, - cursor, - ) - }, - ) - - if err != nil { - return nil, err - } - - return page.NewPage(tasks, cursor), nil -} - -func (s TaskService) Delete( - ctx context.Context, - taskID gid.GID, -) error { - task := coredata.Task{ID: taskID} - return s.svc.pg.WithConn( - ctx, - func(conn pg.Conn) error { - return task.Delete(ctx, conn, s.svc.scope) - }, - ) + return s.Get(ctx, req.MitigationID) } func (s TaskService) Get( @@ -234,10 +102,140 @@ func (s TaskService) Get( return task.LoadByID(ctx, conn, s.svc.scope, taskID) }, ) - if err != nil { return nil, err } return task, nil } + +func (s TaskService) Assign( + ctx context.Context, + taskID gid.GID, + assignedToID gid.GID, +) (*coredata.Task, error) { + task := &coredata.Task{} + + err := s.svc.pg.WithTx( + ctx, + func(conn pg.Conn) error { + var assignErr error + task, assignErr = coredata.AssignTask(ctx, conn, s.svc.scope, taskID, assignedToID) + return assignErr + }, + ) + if err != nil { + if errors.Is(err, coredata.ErrAssignTaskFailed) { + return nil, errors.New("failed to assign task, please try again") + } + return nil, err + } + + return task, nil +} + +func (s TaskService) Unassign( + ctx context.Context, + taskID gid.GID, +) (*coredata.Task, error) { + task := &coredata.Task{} + + err := s.svc.pg.WithTx( + ctx, + func(conn pg.Conn) error { + var unassignErr error + task, unassignErr = coredata.UnassignTask(ctx, conn, s.svc.scope, taskID) + return unassignErr + }, + ) + if err != nil { + if errors.Is(err, coredata.ErrUnassignTaskFailed) { + return nil, errors.New("failed to unassign task, please try again") + } + return nil, err + } + + return task, nil +} + +func (s TaskService) Update( + ctx context.Context, + req UpdateTaskRequest, +) (*coredata.Task, error) { + task := &coredata.Task{} + + err := s.svc.pg.WithTx( + ctx, + func(conn pg.Conn) error { + var updateErr error + task, updateErr = coredata.UpdateTask( + ctx, + conn, + s.svc.scope, + req.TaskID, + req.ExpectedVersion, + &coredata.TaskUpdate{ + Name: req.Name, + Description: req.Description, + State: req.State, + TimeEstimate: req.TimeEstimate, + }, + ) + return updateErr + }, + ) + if err != nil { + if errors.Is(err, coredata.ErrUpdateTaskFailed) { + return nil, errors.New("failed to update task, please try again") + } + return nil, err + } + + return task, nil +} + +func (s TaskService) Delete( + ctx context.Context, + taskID gid.GID, +) error { + err := s.svc.pg.WithTx( + ctx, + func(conn pg.Conn) error { + return coredata.DeleteTask(ctx, conn, s.svc.scope, taskID) + }, + ) + if err != nil { + if errors.Is(err, coredata.ErrDeleteTaskFailed) { + return errors.New("failed to delete task, please try again") + } + return err + } + + return nil +} + +func (s TaskService) ListForMitigationID( + ctx context.Context, + mitigationID gid.GID, + cursor *page.Cursor[coredata.TaskOrderField], +) (*page.Page[*coredata.Task, coredata.TaskOrderField], error) { + var tasks coredata.Tasks + + err := s.svc.pg.WithConn( + ctx, + func(conn pg.Conn) error { + return tasks.LoadByMitigationID( + ctx, + conn, + s.svc.scope, + mitigationID, + cursor, + ) + }, + ) + if err != nil { + return nil, err + } + + return page.NewPage(tasks, cursor), nil +} diff --git a/pkg/server/api/console/v1/schema.graphql b/pkg/server/api/console/v1/schema.graphql index b283b3d0e..f95d595c9 100644 --- a/pkg/server/api/console/v1/schema.graphql +++ b/pkg/server/api/console/v1/schema.graphql @@ -21,23 +21,23 @@ interface Node { id: ID! } -enum ControlState - @goModel(model: "github.com/getprobo/probo/pkg/coredata.ControlState") { +enum MitigationState + @goModel(model: "github.com/getprobo/probo/pkg/coredata.MitigationState") { NOT_STARTED @goEnum( - value: "github.com/getprobo/probo/pkg/coredata.ControlStateNotStarted" + value: "github.com/getprobo/probo/pkg/coredata.MitigationStateNotStarted" ) IN_PROGRESS @goEnum( - value: "github.com/getprobo/probo/pkg/coredata.ControlStateInProgress" + value: "github.com/getprobo/probo/pkg/coredata.MitigationStateInProgress" ) NOT_APPLICABLE @goEnum( - value: "github.com/getprobo/probo/pkg/coredata.ControlStateNotApplicable" + value: "github.com/getprobo/probo/pkg/coredata.MitigationStateNotApplicable" ) IMPLEMENTED @goEnum( - value: "github.com/getprobo/probo/pkg/coredata.ControlStateImplemented" + value: "github.com/getprobo/probo/pkg/coredata.MitigationStateImplemented" ) } @@ -75,19 +75,21 @@ enum PeopleKind ) } -enum ControlImportance - @goModel(model: "github.com/getprobo/probo/pkg/coredata.ControlImportance") { +enum MitigationImportance + @goModel( + model: "github.com/getprobo/probo/pkg/coredata.MitigationImportance" + ) { MANDATORY @goEnum( - value: "github.com/getprobo/probo/pkg/coredata.ControlImportanceMandatory" + value: "github.com/getprobo/probo/pkg/coredata.MitigationImportanceMandatory" ) PREFERRED @goEnum( - value: "github.com/getprobo/probo/pkg/coredata.ControlImportancePreferred" + value: "github.com/getprobo/probo/pkg/coredata.MitigationImportancePreferred" ) ADVANCED @goEnum( - value: "github.com/getprobo/probo/pkg/coredata.ControlImportanceAdvanced" + value: "github.com/getprobo/probo/pkg/coredata.MitigationImportanceAdvanced" ) } @@ -187,8 +189,10 @@ enum FrameworkOrderField NAME } -enum ControlOrderField - @goModel(model: "github.com/getprobo/probo/pkg/coredata.ControlOrderField") { +enum MitigationOrderField + @goModel( + model: "github.com/getprobo/probo/pkg/coredata.MitigationOrderField" + ) { NAME } @@ -231,12 +235,12 @@ input FrameworkOrder field: FrameworkOrderField! } -input ControlOrder +input MitigationOrder @goModel( - model: "github.com/getprobo/probo/pkg/server/api/console/v1/types.ControlOrderBy" + model: "github.com/getprobo/probo/pkg/server/api/console/v1/types.MitigationOrderBy" ) { direction: OrderDirection! - field: ControlOrderField! + field: MitigationOrderField! } input TaskOrder @@ -327,36 +331,36 @@ type Framework implements Node { name: String! description: String! - controls( + mitigations( first: Int after: CursorKey last: Int before: CursorKey - orderBy: ControlOrder - ): ControlConnection! @goField(forceResolver: true) + orderBy: MitigationOrder + ): MitigationConnection! @goField(forceResolver: true) createdAt: Datetime! updatedAt: Datetime! } -type ControlConnection { - edges: [ControlEdge!]! +type MitigationConnection { + edges: [MitigationEdge!]! pageInfo: PageInfo! } -type ControlEdge { +type MitigationEdge { cursor: CursorKey! - node: Control! + node: Mitigation! } -type Control implements Node { +type Mitigation implements Node { id: ID! version: Int! category: String! name: String! description: String! - state: ControlState! - importance: ControlImportance! + state: MitigationState! + importance: MitigationImportance! tasks( first: Int @@ -503,8 +507,8 @@ type Mutation { updateFramework(input: UpdateFrameworkInput!): UpdateFrameworkPayload! importFramework(input: ImportFrameworkInput!): ImportFrameworkPayload! - createControl(input: CreateControlInput!): CreateControlPayload! - updateControl(input: UpdateControlInput!): UpdateControlPayload! + createMitigation(input: CreateMitigationInput!): CreateMitigationPayload! + updateMitigation(input: UpdateMitigationInput!): UpdateMitigationPayload! uploadEvidence(input: UploadEvidenceInput!): UploadEvidencePayload! deleteEvidence(input: DeleteEvidenceInput!): DeleteEvidencePayload! @@ -639,7 +643,7 @@ type DeleteOrganizationPayload { } input CreateTaskInput { - controlId: ID! + mitigationId: ID! name: String! description: String! timeEstimate: Duration @@ -675,16 +679,16 @@ type CreateFrameworkPayload { frameworkEdge: FrameworkEdge! } -input CreateControlInput { +input CreateMitigationInput { frameworkId: ID! name: String! description: String! category: String! - importance: ControlImportance! + importance: MitigationImportance! } -type CreateControlPayload { - controlEdge: ControlEdge! +type CreateMitigationPayload { + mitigationEdge: MitigationEdge! } type UpdateFrameworkPayload { @@ -699,18 +703,18 @@ type UpdatePeoplePayload { people: People! } -input UpdateControlInput { +input UpdateMitigationInput { id: ID! expectedVersion: Int! name: String description: String category: String - state: ControlState - importance: ControlImportance + state: MitigationState + importance: MitigationImportance } -type UpdateControlPayload { - control: Control! +type UpdateMitigationPayload { + mitigation: Mitigation! } input UploadEvidenceInput { diff --git a/pkg/server/api/console/v1/schema/schema.go b/pkg/server/api/console/v1/schema/schema.go index 4adfc8abf..4c782c0a5 100644 --- a/pkg/server/api/console/v1/schema/schema.go +++ b/pkg/server/api/console/v1/schema/schema.go @@ -42,9 +42,9 @@ type Config struct { } type ResolverRoot interface { - Control() ControlResolver Evidence() EvidenceResolver Framework() FrameworkResolver + Mitigation() MitigationResolver Mutation() MutationResolver Organization() OrganizationResolver Policy() PolicyResolver @@ -65,37 +65,14 @@ type ComplexityRoot struct { Success func(childComplexity int) int } - Control struct { - Category func(childComplexity int) int - CreatedAt func(childComplexity int) int - Description func(childComplexity int) int - ID func(childComplexity int) int - Importance func(childComplexity int) int - Name func(childComplexity int) int - State func(childComplexity int) int - Tasks func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.TaskOrderBy) int - UpdatedAt func(childComplexity int) int - Version func(childComplexity int) int - } - - ControlConnection struct { - Edges func(childComplexity int) int - PageInfo func(childComplexity int) int - } - - ControlEdge struct { - Cursor func(childComplexity int) int - Node func(childComplexity int) int - } - - CreateControlPayload struct { - ControlEdge func(childComplexity int) int - } - CreateFrameworkPayload struct { FrameworkEdge func(childComplexity int) int } + CreateMitigationPayload struct { + MitigationEdge func(childComplexity int) int + } + CreateOrganizationPayload struct { OrganizationEdge func(childComplexity int) int } @@ -165,10 +142,10 @@ type ComplexityRoot struct { } Framework struct { - Controls func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ControlOrderBy) int CreatedAt func(childComplexity int) int Description func(childComplexity int) int ID func(childComplexity int) int + Mitigations func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MitigationOrderBy) int Name func(childComplexity int) int UpdatedAt func(childComplexity int) int Version func(childComplexity int) int @@ -192,11 +169,34 @@ type ComplexityRoot struct { Success func(childComplexity int) int } + Mitigation struct { + Category func(childComplexity int) int + CreatedAt func(childComplexity int) int + Description func(childComplexity int) int + ID func(childComplexity int) int + Importance func(childComplexity int) int + Name func(childComplexity int) int + State func(childComplexity int) int + Tasks func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.TaskOrderBy) int + UpdatedAt func(childComplexity int) int + Version func(childComplexity int) int + } + + MitigationConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + } + + MitigationEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + Mutation struct { AssignTask func(childComplexity int, input types.AssignTaskInput) int ConfirmEmail func(childComplexity int, input types.ConfirmEmailInput) int - CreateControl func(childComplexity int, input types.CreateControlInput) int CreateFramework func(childComplexity int, input types.CreateFrameworkInput) int + CreateMitigation func(childComplexity int, input types.CreateMitigationInput) int CreateOrganization func(childComplexity int, input types.CreateOrganizationInput) int CreatePeople func(childComplexity int, input types.CreatePeopleInput) int CreatePolicy func(childComplexity int, input types.CreatePolicyInput) int @@ -212,8 +212,8 @@ type ComplexityRoot struct { InviteUser func(childComplexity int, input types.InviteUserInput) int RemoveUser func(childComplexity int, input types.RemoveUserInput) int UnassignTask func(childComplexity int, input types.UnassignTaskInput) int - UpdateControl func(childComplexity int, input types.UpdateControlInput) int UpdateFramework func(childComplexity int, input types.UpdateFrameworkInput) int + UpdateMitigation func(childComplexity int, input types.UpdateMitigationInput) int UpdateOrganization func(childComplexity int, input types.UpdateOrganizationInput) int UpdatePeople func(childComplexity int, input types.UpdatePeopleInput) int UpdatePolicy func(childComplexity int, input types.UpdatePolicyInput) int @@ -336,14 +336,14 @@ type ComplexityRoot struct { Task func(childComplexity int) int } - UpdateControlPayload struct { - Control func(childComplexity int) int - } - UpdateFrameworkPayload struct { Framework func(childComplexity int) int } + UpdateMitigationPayload struct { + Mitigation func(childComplexity int) int + } + UpdateOrganizationPayload struct { Organization func(childComplexity int) int } @@ -419,14 +419,14 @@ type ComplexityRoot struct { } } -type ControlResolver interface { - Tasks(ctx context.Context, obj *types.Control, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.TaskOrderBy) (*types.TaskConnection, error) -} type EvidenceResolver interface { FileURL(ctx context.Context, obj *types.Evidence) (*string, error) } type FrameworkResolver interface { - Controls(ctx context.Context, obj *types.Framework, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ControlOrderBy) (*types.ControlConnection, error) + Mitigations(ctx context.Context, obj *types.Framework, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MitigationOrderBy) (*types.MitigationConnection, error) +} +type MitigationResolver interface { + Tasks(ctx context.Context, obj *types.Mitigation, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.TaskOrderBy) (*types.TaskConnection, error) } type MutationResolver interface { CreateVendor(ctx context.Context, input types.CreateVendorInput) (*types.CreateVendorPayload, error) @@ -446,8 +446,8 @@ type MutationResolver interface { CreateFramework(ctx context.Context, input types.CreateFrameworkInput) (*types.CreateFrameworkPayload, error) UpdateFramework(ctx context.Context, input types.UpdateFrameworkInput) (*types.UpdateFrameworkPayload, error) ImportFramework(ctx context.Context, input types.ImportFrameworkInput) (*types.ImportFrameworkPayload, error) - CreateControl(ctx context.Context, input types.CreateControlInput) (*types.CreateControlPayload, error) - UpdateControl(ctx context.Context, input types.UpdateControlInput) (*types.UpdateControlPayload, error) + CreateMitigation(ctx context.Context, input types.CreateMitigationInput) (*types.CreateMitigationPayload, error) + UpdateMitigation(ctx context.Context, input types.UpdateMitigationInput) (*types.UpdateMitigationPayload, error) UploadEvidence(ctx context.Context, input types.UploadEvidenceInput) (*types.UploadEvidencePayload, error) DeleteEvidence(ctx context.Context, input types.DeleteEvidenceInput) (*types.DeleteEvidencePayload, error) CreatePolicy(ctx context.Context, input types.CreatePolicyInput) (*types.CreatePolicyPayload, error) @@ -513,116 +513,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ConfirmEmailPayload.Success(childComplexity), true - case "Control.category": - if e.complexity.Control.Category == nil { - break - } - - return e.complexity.Control.Category(childComplexity), true - - case "Control.createdAt": - if e.complexity.Control.CreatedAt == nil { - break - } - - return e.complexity.Control.CreatedAt(childComplexity), true - - case "Control.description": - if e.complexity.Control.Description == nil { - break - } - - return e.complexity.Control.Description(childComplexity), true - - case "Control.id": - if e.complexity.Control.ID == nil { - break - } - - return e.complexity.Control.ID(childComplexity), true - - case "Control.importance": - if e.complexity.Control.Importance == nil { - break - } - - return e.complexity.Control.Importance(childComplexity), true - - case "Control.name": - if e.complexity.Control.Name == nil { - break - } - - return e.complexity.Control.Name(childComplexity), true - - case "Control.state": - if e.complexity.Control.State == nil { - break - } - - return e.complexity.Control.State(childComplexity), true - - case "Control.tasks": - if e.complexity.Control.Tasks == nil { - break - } - - args, err := ec.field_Control_tasks_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Control.Tasks(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.TaskOrderBy)), true - - case "Control.updatedAt": - if e.complexity.Control.UpdatedAt == nil { - break - } - - return e.complexity.Control.UpdatedAt(childComplexity), true - - case "Control.version": - if e.complexity.Control.Version == nil { - break - } - - return e.complexity.Control.Version(childComplexity), true - - case "ControlConnection.edges": - if e.complexity.ControlConnection.Edges == nil { - break - } - - return e.complexity.ControlConnection.Edges(childComplexity), true - - case "ControlConnection.pageInfo": - if e.complexity.ControlConnection.PageInfo == nil { - break - } - - return e.complexity.ControlConnection.PageInfo(childComplexity), true - - case "ControlEdge.cursor": - if e.complexity.ControlEdge.Cursor == nil { - break - } - - return e.complexity.ControlEdge.Cursor(childComplexity), true - - case "ControlEdge.node": - if e.complexity.ControlEdge.Node == nil { - break - } - - return e.complexity.ControlEdge.Node(childComplexity), true - - case "CreateControlPayload.controlEdge": - if e.complexity.CreateControlPayload.ControlEdge == nil { - break - } - - return e.complexity.CreateControlPayload.ControlEdge(childComplexity), true - case "CreateFrameworkPayload.frameworkEdge": if e.complexity.CreateFrameworkPayload.FrameworkEdge == nil { break @@ -630,6 +520,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.CreateFrameworkPayload.FrameworkEdge(childComplexity), true + case "CreateMitigationPayload.mitigationEdge": + if e.complexity.CreateMitigationPayload.MitigationEdge == nil { + break + } + + return e.complexity.CreateMitigationPayload.MitigationEdge(childComplexity), true + case "CreateOrganizationPayload.organizationEdge": if e.complexity.CreateOrganizationPayload.OrganizationEdge == nil { break @@ -812,18 +709,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.EvidenceEdge.Node(childComplexity), true - case "Framework.controls": - if e.complexity.Framework.Controls == nil { - break - } - - args, err := ec.field_Framework_controls_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Framework.Controls(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.ControlOrderBy)), true - case "Framework.createdAt": if e.complexity.Framework.CreatedAt == nil { break @@ -845,6 +730,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Framework.ID(childComplexity), true + case "Framework.mitigations": + if e.complexity.Framework.Mitigations == nil { + break + } + + args, err := ec.field_Framework_mitigations_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Framework.Mitigations(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.MitigationOrderBy)), true + case "Framework.name": if e.complexity.Framework.Name == nil { break @@ -908,6 +805,109 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.InviteUserPayload.Success(childComplexity), true + case "Mitigation.category": + if e.complexity.Mitigation.Category == nil { + break + } + + return e.complexity.Mitigation.Category(childComplexity), true + + case "Mitigation.createdAt": + if e.complexity.Mitigation.CreatedAt == nil { + break + } + + return e.complexity.Mitigation.CreatedAt(childComplexity), true + + case "Mitigation.description": + if e.complexity.Mitigation.Description == nil { + break + } + + return e.complexity.Mitigation.Description(childComplexity), true + + case "Mitigation.id": + if e.complexity.Mitigation.ID == nil { + break + } + + return e.complexity.Mitigation.ID(childComplexity), true + + case "Mitigation.importance": + if e.complexity.Mitigation.Importance == nil { + break + } + + return e.complexity.Mitigation.Importance(childComplexity), true + + case "Mitigation.name": + if e.complexity.Mitigation.Name == nil { + break + } + + return e.complexity.Mitigation.Name(childComplexity), true + + case "Mitigation.state": + if e.complexity.Mitigation.State == nil { + break + } + + return e.complexity.Mitigation.State(childComplexity), true + + case "Mitigation.tasks": + if e.complexity.Mitigation.Tasks == nil { + break + } + + args, err := ec.field_Mitigation_tasks_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mitigation.Tasks(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.TaskOrderBy)), true + + case "Mitigation.updatedAt": + if e.complexity.Mitigation.UpdatedAt == nil { + break + } + + return e.complexity.Mitigation.UpdatedAt(childComplexity), true + + case "Mitigation.version": + if e.complexity.Mitigation.Version == nil { + break + } + + return e.complexity.Mitigation.Version(childComplexity), true + + case "MitigationConnection.edges": + if e.complexity.MitigationConnection.Edges == nil { + break + } + + return e.complexity.MitigationConnection.Edges(childComplexity), true + + case "MitigationConnection.pageInfo": + if e.complexity.MitigationConnection.PageInfo == nil { + break + } + + return e.complexity.MitigationConnection.PageInfo(childComplexity), true + + case "MitigationEdge.cursor": + if e.complexity.MitigationEdge.Cursor == nil { + break + } + + return e.complexity.MitigationEdge.Cursor(childComplexity), true + + case "MitigationEdge.node": + if e.complexity.MitigationEdge.Node == nil { + break + } + + return e.complexity.MitigationEdge.Node(childComplexity), true + case "Mutation.assignTask": if e.complexity.Mutation.AssignTask == nil { break @@ -932,18 +932,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.ConfirmEmail(childComplexity, args["input"].(types.ConfirmEmailInput)), true - case "Mutation.createControl": - if e.complexity.Mutation.CreateControl == nil { - break - } - - args, err := ec.field_Mutation_createControl_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.CreateControl(childComplexity, args["input"].(types.CreateControlInput)), true - case "Mutation.createFramework": if e.complexity.Mutation.CreateFramework == nil { break @@ -956,6 +944,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.CreateFramework(childComplexity, args["input"].(types.CreateFrameworkInput)), true + case "Mutation.createMitigation": + if e.complexity.Mutation.CreateMitigation == nil { + break + } + + args, err := ec.field_Mutation_createMitigation_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateMitigation(childComplexity, args["input"].(types.CreateMitigationInput)), true + case "Mutation.createOrganization": if e.complexity.Mutation.CreateOrganization == nil { break @@ -1136,18 +1136,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.UnassignTask(childComplexity, args["input"].(types.UnassignTaskInput)), true - case "Mutation.updateControl": - if e.complexity.Mutation.UpdateControl == nil { - break - } - - args, err := ec.field_Mutation_updateControl_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.UpdateControl(childComplexity, args["input"].(types.UpdateControlInput)), true - case "Mutation.updateFramework": if e.complexity.Mutation.UpdateFramework == nil { break @@ -1160,6 +1148,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.UpdateFramework(childComplexity, args["input"].(types.UpdateFrameworkInput)), true + case "Mutation.updateMitigation": + if e.complexity.Mutation.UpdateMitigation == nil { + break + } + + args, err := ec.field_Mutation_updateMitigation_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateMitigation(childComplexity, args["input"].(types.UpdateMitigationInput)), true + case "Mutation.updateOrganization": if e.complexity.Mutation.UpdateOrganization == nil { break @@ -1708,13 +1708,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.UnassignTaskPayload.Task(childComplexity), true - case "UpdateControlPayload.control": - if e.complexity.UpdateControlPayload.Control == nil { - break - } - - return e.complexity.UpdateControlPayload.Control(childComplexity), true - case "UpdateFrameworkPayload.framework": if e.complexity.UpdateFrameworkPayload.Framework == nil { break @@ -1722,6 +1715,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.UpdateFrameworkPayload.Framework(childComplexity), true + case "UpdateMitigationPayload.mitigation": + if e.complexity.UpdateMitigationPayload.Mitigation == nil { + break + } + + return e.complexity.UpdateMitigationPayload.Mitigation(childComplexity), true + case "UpdateOrganizationPayload.organization": if e.complexity.UpdateOrganizationPayload.Organization == nil { break @@ -1982,9 +1982,8 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { inputUnmarshalMap := graphql.BuildUnmarshalerMap( ec.unmarshalInputAssignTaskInput, ec.unmarshalInputConfirmEmailInput, - ec.unmarshalInputControlOrder, - ec.unmarshalInputCreateControlInput, ec.unmarshalInputCreateFrameworkInput, + ec.unmarshalInputCreateMitigationInput, ec.unmarshalInputCreateOrganizationInput, ec.unmarshalInputCreatePeopleInput, ec.unmarshalInputCreatePolicyInput, @@ -2000,14 +1999,15 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputFrameworkOrder, ec.unmarshalInputImportFrameworkInput, ec.unmarshalInputInviteUserInput, + ec.unmarshalInputMitigationOrder, ec.unmarshalInputOrganizationOrder, ec.unmarshalInputPeopleOrder, ec.unmarshalInputPolicyOrder, ec.unmarshalInputRemoveUserInput, ec.unmarshalInputTaskOrder, ec.unmarshalInputUnassignTaskInput, - ec.unmarshalInputUpdateControlInput, ec.unmarshalInputUpdateFrameworkInput, + ec.unmarshalInputUpdateMitigationInput, ec.unmarshalInputUpdateOrganizationInput, ec.unmarshalInputUpdatePeopleInput, ec.unmarshalInputUpdatePolicyInput, @@ -2136,23 +2136,23 @@ interface Node { id: ID! } -enum ControlState - @goModel(model: "github.com/getprobo/probo/pkg/coredata.ControlState") { +enum MitigationState + @goModel(model: "github.com/getprobo/probo/pkg/coredata.MitigationState") { NOT_STARTED @goEnum( - value: "github.com/getprobo/probo/pkg/coredata.ControlStateNotStarted" + value: "github.com/getprobo/probo/pkg/coredata.MitigationStateNotStarted" ) IN_PROGRESS @goEnum( - value: "github.com/getprobo/probo/pkg/coredata.ControlStateInProgress" + value: "github.com/getprobo/probo/pkg/coredata.MitigationStateInProgress" ) NOT_APPLICABLE @goEnum( - value: "github.com/getprobo/probo/pkg/coredata.ControlStateNotApplicable" + value: "github.com/getprobo/probo/pkg/coredata.MitigationStateNotApplicable" ) IMPLEMENTED @goEnum( - value: "github.com/getprobo/probo/pkg/coredata.ControlStateImplemented" + value: "github.com/getprobo/probo/pkg/coredata.MitigationStateImplemented" ) } @@ -2190,19 +2190,21 @@ enum PeopleKind ) } -enum ControlImportance - @goModel(model: "github.com/getprobo/probo/pkg/coredata.ControlImportance") { +enum MitigationImportance + @goModel( + model: "github.com/getprobo/probo/pkg/coredata.MitigationImportance" + ) { MANDATORY @goEnum( - value: "github.com/getprobo/probo/pkg/coredata.ControlImportanceMandatory" + value: "github.com/getprobo/probo/pkg/coredata.MitigationImportanceMandatory" ) PREFERRED @goEnum( - value: "github.com/getprobo/probo/pkg/coredata.ControlImportancePreferred" + value: "github.com/getprobo/probo/pkg/coredata.MitigationImportancePreferred" ) ADVANCED @goEnum( - value: "github.com/getprobo/probo/pkg/coredata.ControlImportanceAdvanced" + value: "github.com/getprobo/probo/pkg/coredata.MitigationImportanceAdvanced" ) } @@ -2302,8 +2304,10 @@ enum FrameworkOrderField NAME } -enum ControlOrderField - @goModel(model: "github.com/getprobo/probo/pkg/coredata.ControlOrderField") { +enum MitigationOrderField + @goModel( + model: "github.com/getprobo/probo/pkg/coredata.MitigationOrderField" + ) { NAME } @@ -2346,12 +2350,12 @@ input FrameworkOrder field: FrameworkOrderField! } -input ControlOrder +input MitigationOrder @goModel( - model: "github.com/getprobo/probo/pkg/server/api/console/v1/types.ControlOrderBy" + model: "github.com/getprobo/probo/pkg/server/api/console/v1/types.MitigationOrderBy" ) { direction: OrderDirection! - field: ControlOrderField! + field: MitigationOrderField! } input TaskOrder @@ -2442,36 +2446,36 @@ type Framework implements Node { name: String! description: String! - controls( + mitigations( first: Int after: CursorKey last: Int before: CursorKey - orderBy: ControlOrder - ): ControlConnection! @goField(forceResolver: true) + orderBy: MitigationOrder + ): MitigationConnection! @goField(forceResolver: true) createdAt: Datetime! updatedAt: Datetime! } -type ControlConnection { - edges: [ControlEdge!]! +type MitigationConnection { + edges: [MitigationEdge!]! pageInfo: PageInfo! } -type ControlEdge { +type MitigationEdge { cursor: CursorKey! - node: Control! + node: Mitigation! } -type Control implements Node { +type Mitigation implements Node { id: ID! version: Int! category: String! name: String! description: String! - state: ControlState! - importance: ControlImportance! + state: MitigationState! + importance: MitigationImportance! tasks( first: Int @@ -2618,8 +2622,8 @@ type Mutation { updateFramework(input: UpdateFrameworkInput!): UpdateFrameworkPayload! importFramework(input: ImportFrameworkInput!): ImportFrameworkPayload! - createControl(input: CreateControlInput!): CreateControlPayload! - updateControl(input: UpdateControlInput!): UpdateControlPayload! + createMitigation(input: CreateMitigationInput!): CreateMitigationPayload! + updateMitigation(input: UpdateMitigationInput!): UpdateMitigationPayload! uploadEvidence(input: UploadEvidenceInput!): UploadEvidencePayload! deleteEvidence(input: DeleteEvidenceInput!): DeleteEvidencePayload! @@ -2754,7 +2758,7 @@ type DeleteOrganizationPayload { } input CreateTaskInput { - controlId: ID! + mitigationId: ID! name: String! description: String! timeEstimate: Duration @@ -2790,16 +2794,16 @@ type CreateFrameworkPayload { frameworkEdge: FrameworkEdge! } -input CreateControlInput { +input CreateMitigationInput { frameworkId: ID! name: String! description: String! category: String! - importance: ControlImportance! + importance: MitigationImportance! } -type CreateControlPayload { - controlEdge: ControlEdge! +type CreateMitigationPayload { + mitigationEdge: MitigationEdge! } type UpdateFrameworkPayload { @@ -2814,18 +2818,18 @@ type UpdatePeoplePayload { people: People! } -input UpdateControlInput { +input UpdateMitigationInput { id: ID! expectedVersion: Int! name: String description: String category: String - state: ControlState - importance: ControlImportance + state: MitigationState + importance: MitigationImportance } -type UpdateControlPayload { - control: Control! +type UpdateMitigationPayload { + mitigation: Mitigation! } input UploadEvidenceInput { @@ -3014,37 +3018,37 @@ var parsedSchema = gqlparser.MustLoadSchema(sources...) // region ***************************** args.gotpl ***************************** -func (ec *executionContext) field_Control_tasks_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { +func (ec *executionContext) field_Framework_mitigations_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} - arg0, err := ec.field_Control_tasks_argsFirst(ctx, rawArgs) + arg0, err := ec.field_Framework_mitigations_argsFirst(ctx, rawArgs) if err != nil { return nil, err } args["first"] = arg0 - arg1, err := ec.field_Control_tasks_argsAfter(ctx, rawArgs) + arg1, err := ec.field_Framework_mitigations_argsAfter(ctx, rawArgs) if err != nil { return nil, err } args["after"] = arg1 - arg2, err := ec.field_Control_tasks_argsLast(ctx, rawArgs) + arg2, err := ec.field_Framework_mitigations_argsLast(ctx, rawArgs) if err != nil { return nil, err } args["last"] = arg2 - arg3, err := ec.field_Control_tasks_argsBefore(ctx, rawArgs) + arg3, err := ec.field_Framework_mitigations_argsBefore(ctx, rawArgs) if err != nil { return nil, err } args["before"] = arg3 - arg4, err := ec.field_Control_tasks_argsOrderBy(ctx, rawArgs) + arg4, err := ec.field_Framework_mitigations_argsOrderBy(ctx, rawArgs) if err != nil { return nil, err } args["orderBy"] = arg4 return args, nil } -func (ec *executionContext) field_Control_tasks_argsFirst( +func (ec *executionContext) field_Framework_mitigations_argsFirst( ctx context.Context, rawArgs map[string]any, ) (*int, error) { @@ -3057,7 +3061,7 @@ func (ec *executionContext) field_Control_tasks_argsFirst( return zeroVal, nil } -func (ec *executionContext) field_Control_tasks_argsAfter( +func (ec *executionContext) field_Framework_mitigations_argsAfter( ctx context.Context, rawArgs map[string]any, ) (*page.CursorKey, error) { @@ -3070,7 +3074,7 @@ func (ec *executionContext) field_Control_tasks_argsAfter( return zeroVal, nil } -func (ec *executionContext) field_Control_tasks_argsLast( +func (ec *executionContext) field_Framework_mitigations_argsLast( ctx context.Context, rawArgs map[string]any, ) (*int, error) { @@ -3083,7 +3087,7 @@ func (ec *executionContext) field_Control_tasks_argsLast( return zeroVal, nil } -func (ec *executionContext) field_Control_tasks_argsBefore( +func (ec *executionContext) field_Framework_mitigations_argsBefore( ctx context.Context, rawArgs map[string]any, ) (*page.CursorKey, error) { @@ -3096,7 +3100,102 @@ func (ec *executionContext) field_Control_tasks_argsBefore( return zeroVal, nil } -func (ec *executionContext) field_Control_tasks_argsOrderBy( +func (ec *executionContext) field_Framework_mitigations_argsOrderBy( + ctx context.Context, + rawArgs map[string]any, +) (*types.MitigationOrderBy, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + if tmp, ok := rawArgs["orderBy"]; ok { + return ec.unmarshalOMitigationOrder2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐMitigationOrderBy(ctx, tmp) + } + + var zeroVal *types.MitigationOrderBy + return zeroVal, nil +} + +func (ec *executionContext) field_Mitigation_tasks_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Mitigation_tasks_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err + } + args["first"] = arg0 + arg1, err := ec.field_Mitigation_tasks_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["after"] = arg1 + arg2, err := ec.field_Mitigation_tasks_argsLast(ctx, rawArgs) + if err != nil { + return nil, err + } + args["last"] = arg2 + arg3, err := ec.field_Mitigation_tasks_argsBefore(ctx, rawArgs) + if err != nil { + return nil, err + } + args["before"] = arg3 + arg4, err := ec.field_Mitigation_tasks_argsOrderBy(ctx, rawArgs) + if err != nil { + return nil, err + } + args["orderBy"] = arg4 + return args, nil +} +func (ec *executionContext) field_Mitigation_tasks_argsFirst( + ctx context.Context, + rawArgs map[string]any, +) (*int, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Mitigation_tasks_argsAfter( + ctx context.Context, + rawArgs map[string]any, +) (*page.CursorKey, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOCursorKey2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋpageᚐCursorKey(ctx, tmp) + } + + var zeroVal *page.CursorKey + return zeroVal, nil +} + +func (ec *executionContext) field_Mitigation_tasks_argsLast( + ctx context.Context, + rawArgs map[string]any, +) (*int, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + if tmp, ok := rawArgs["last"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Mitigation_tasks_argsBefore( + ctx context.Context, + rawArgs map[string]any, +) (*page.CursorKey, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + if tmp, ok := rawArgs["before"]; ok { + return ec.unmarshalOCursorKey2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋpageᚐCursorKey(ctx, tmp) + } + + var zeroVal *page.CursorKey + return zeroVal, nil +} + +func (ec *executionContext) field_Mitigation_tasks_argsOrderBy( ctx context.Context, rawArgs map[string]any, ) (*types.TaskOrderBy, error) { @@ -3109,101 +3208,6 @@ func (ec *executionContext) field_Control_tasks_argsOrderBy( return zeroVal, nil } -func (ec *executionContext) field_Framework_controls_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { - var err error - args := map[string]any{} - arg0, err := ec.field_Framework_controls_argsFirst(ctx, rawArgs) - if err != nil { - return nil, err - } - args["first"] = arg0 - arg1, err := ec.field_Framework_controls_argsAfter(ctx, rawArgs) - if err != nil { - return nil, err - } - args["after"] = arg1 - arg2, err := ec.field_Framework_controls_argsLast(ctx, rawArgs) - if err != nil { - return nil, err - } - args["last"] = arg2 - arg3, err := ec.field_Framework_controls_argsBefore(ctx, rawArgs) - if err != nil { - return nil, err - } - args["before"] = arg3 - arg4, err := ec.field_Framework_controls_argsOrderBy(ctx, rawArgs) - if err != nil { - return nil, err - } - args["orderBy"] = arg4 - return args, nil -} -func (ec *executionContext) field_Framework_controls_argsFirst( - ctx context.Context, - rawArgs map[string]any, -) (*int, error) { - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - if tmp, ok := rawArgs["first"]; ok { - return ec.unmarshalOInt2ᚖint(ctx, tmp) - } - - var zeroVal *int - return zeroVal, nil -} - -func (ec *executionContext) field_Framework_controls_argsAfter( - ctx context.Context, - rawArgs map[string]any, -) (*page.CursorKey, error) { - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - if tmp, ok := rawArgs["after"]; ok { - return ec.unmarshalOCursorKey2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋpageᚐCursorKey(ctx, tmp) - } - - var zeroVal *page.CursorKey - return zeroVal, nil -} - -func (ec *executionContext) field_Framework_controls_argsLast( - ctx context.Context, - rawArgs map[string]any, -) (*int, error) { - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) - if tmp, ok := rawArgs["last"]; ok { - return ec.unmarshalOInt2ᚖint(ctx, tmp) - } - - var zeroVal *int - return zeroVal, nil -} - -func (ec *executionContext) field_Framework_controls_argsBefore( - ctx context.Context, - rawArgs map[string]any, -) (*page.CursorKey, error) { - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) - if tmp, ok := rawArgs["before"]; ok { - return ec.unmarshalOCursorKey2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋpageᚐCursorKey(ctx, tmp) - } - - var zeroVal *page.CursorKey - return zeroVal, nil -} - -func (ec *executionContext) field_Framework_controls_argsOrderBy( - ctx context.Context, - rawArgs map[string]any, -) (*types.ControlOrderBy, error) { - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) - if tmp, ok := rawArgs["orderBy"]; ok { - return ec.unmarshalOControlOrder2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐControlOrderBy(ctx, tmp) - } - - var zeroVal *types.ControlOrderBy - return zeroVal, nil -} - func (ec *executionContext) field_Mutation_assignTask_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -3250,29 +3254,6 @@ func (ec *executionContext) field_Mutation_confirmEmail_argsInput( return zeroVal, nil } -func (ec *executionContext) field_Mutation_createControl_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { - var err error - args := map[string]any{} - arg0, err := ec.field_Mutation_createControl_argsInput(ctx, rawArgs) - if err != nil { - return nil, err - } - args["input"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_createControl_argsInput( - ctx context.Context, - rawArgs map[string]any, -) (types.CreateControlInput, error) { - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - if tmp, ok := rawArgs["input"]; ok { - return ec.unmarshalNCreateControlInput2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateControlInput(ctx, tmp) - } - - var zeroVal types.CreateControlInput - return zeroVal, nil -} - func (ec *executionContext) field_Mutation_createFramework_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -3296,6 +3277,29 @@ func (ec *executionContext) field_Mutation_createFramework_argsInput( return zeroVal, nil } +func (ec *executionContext) field_Mutation_createMitigation_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Mutation_createMitigation_argsInput(ctx, rawArgs) + if err != nil { + return nil, err + } + args["input"] = arg0 + return args, nil +} +func (ec *executionContext) field_Mutation_createMitigation_argsInput( + ctx context.Context, + rawArgs map[string]any, +) (types.CreateMitigationInput, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNCreateMitigationInput2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateMitigationInput(ctx, tmp) + } + + var zeroVal types.CreateMitigationInput + return zeroVal, nil +} + func (ec *executionContext) field_Mutation_createOrganization_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -3641,29 +3645,6 @@ func (ec *executionContext) field_Mutation_unassignTask_argsInput( return zeroVal, nil } -func (ec *executionContext) field_Mutation_updateControl_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { - var err error - args := map[string]any{} - arg0, err := ec.field_Mutation_updateControl_argsInput(ctx, rawArgs) - if err != nil { - return nil, err - } - args["input"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_updateControl_argsInput( - ctx context.Context, - rawArgs map[string]any, -) (types.UpdateControlInput, error) { - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - if tmp, ok := rawArgs["input"]; ok { - return ec.unmarshalNUpdateControlInput2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateControlInput(ctx, tmp) - } - - var zeroVal types.UpdateControlInput - return zeroVal, nil -} - func (ec *executionContext) field_Mutation_updateFramework_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -3687,6 +3668,29 @@ func (ec *executionContext) field_Mutation_updateFramework_argsInput( return zeroVal, nil } +func (ec *executionContext) field_Mutation_updateMitigation_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Mutation_updateMitigation_argsInput(ctx, rawArgs) + if err != nil { + return nil, err + } + args["input"] = arg0 + return args, nil +} +func (ec *executionContext) field_Mutation_updateMitigation_argsInput( + ctx context.Context, + rawArgs map[string]any, +) (types.UpdateMitigationInput, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNUpdateMitigationInput2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateMitigationInput(ctx, tmp) + } + + var zeroVal types.UpdateMitigationInput + return zeroVal, nil +} + func (ec *executionContext) field_Mutation_updateOrganization_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -4642,6 +4646,12 @@ func (ec *executionContext) _AssignTaskPayload_task(ctx context.Context, field g return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Task, nil @@ -4702,6 +4712,12 @@ func (ec *executionContext) _ConfirmEmailPayload_success(ctx context.Context, fi return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Success, nil @@ -4734,637 +4750,18 @@ func (ec *executionContext) fieldContext_ConfirmEmailPayload_success(_ context.C return fc, nil } -func (ec *executionContext) _Control_id(ctx context.Context, field graphql.CollectedField, obj *types.Control) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Control_id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(gid.GID) - fc.Result = res - return ec.marshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Control_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Control", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Control_version(ctx context.Context, field graphql.CollectedField, obj *types.Control) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Control_version(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Version, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Control_version(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Control", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Control_category(ctx context.Context, field graphql.CollectedField, obj *types.Control) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Control_category(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Category, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Control_category(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Control", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Control_name(ctx context.Context, field graphql.CollectedField, obj *types.Control) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Control_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Control_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Control", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Control_description(ctx context.Context, field graphql.CollectedField, obj *types.Control) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Control_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Control_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Control", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Control_state(ctx context.Context, field graphql.CollectedField, obj *types.Control) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Control_state(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.State, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(coredata.ControlState) - fc.Result = res - return ec.marshalNControlState2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlState(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Control_state(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Control", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ControlState does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Control_importance(ctx context.Context, field graphql.CollectedField, obj *types.Control) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Control_importance(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Importance, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(coredata.ControlImportance) - fc.Result = res - return ec.marshalNControlImportance2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlImportance(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Control_importance(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Control", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ControlImportance does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Control_tasks(ctx context.Context, field graphql.CollectedField, obj *types.Control) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Control_tasks(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Control().Tasks(rctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.TaskOrderBy)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*types.TaskConnection) - fc.Result = res - return ec.marshalNTaskConnection2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐTaskConnection(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Control_tasks(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Control", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_TaskConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_TaskConnection_pageInfo(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TaskConnection", field.Name) - }, - } - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Control_tasks_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Control_createdAt(ctx context.Context, field graphql.CollectedField, obj *types.Control) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Control_createdAt(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.CreatedAt, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(time.Time) - fc.Result = res - return ec.marshalNDatetime2timeᚐTime(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Control_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Control", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Datetime does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Control_updatedAt(ctx context.Context, field graphql.CollectedField, obj *types.Control) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Control_updatedAt(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.UpdatedAt, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(time.Time) - fc.Result = res - return ec.marshalNDatetime2timeᚐTime(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Control_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Control", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Datetime does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ControlConnection_edges(ctx context.Context, field graphql.CollectedField, obj *types.ControlConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ControlConnection_edges(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Edges, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*types.ControlEdge) - fc.Result = res - return ec.marshalNControlEdge2ᚕᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐControlEdgeᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ControlConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ControlConnection", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "cursor": - return ec.fieldContext_ControlEdge_cursor(ctx, field) - case "node": - return ec.fieldContext_ControlEdge_node(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ControlEdge", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _ControlConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *types.ControlConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ControlConnection_pageInfo(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*types.PageInfo) - fc.Result = res - return ec.marshalNPageInfo2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐPageInfo(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ControlConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ControlConnection", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "hasNextPage": - return ec.fieldContext_PageInfo_hasNextPage(ctx, field) - case "hasPreviousPage": - return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) - case "startCursor": - return ec.fieldContext_PageInfo_startCursor(ctx, field) - case "endCursor": - return ec.fieldContext_PageInfo_endCursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _ControlEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *types.ControlEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ControlEdge_cursor(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(page.CursorKey) - fc.Result = res - return ec.marshalNCursorKey2githubᚗcomᚋgetproboᚋproboᚋpkgᚋpageᚐCursorKey(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ControlEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ControlEdge", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type CursorKey does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ControlEdge_node(ctx context.Context, field graphql.CollectedField, obj *types.ControlEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ControlEdge_node(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Node, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*types.Control) - fc.Result = res - return ec.marshalNControl2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐControl(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ControlEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ControlEdge", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Control_id(ctx, field) - case "version": - return ec.fieldContext_Control_version(ctx, field) - case "category": - return ec.fieldContext_Control_category(ctx, field) - case "name": - return ec.fieldContext_Control_name(ctx, field) - case "description": - return ec.fieldContext_Control_description(ctx, field) - case "state": - return ec.fieldContext_Control_state(ctx, field) - case "importance": - return ec.fieldContext_Control_importance(ctx, field) - case "tasks": - return ec.fieldContext_Control_tasks(ctx, field) - case "createdAt": - return ec.fieldContext_Control_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_Control_updatedAt(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Control", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _CreateControlPayload_controlEdge(ctx context.Context, field graphql.CollectedField, obj *types.CreateControlPayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CreateControlPayload_controlEdge(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.ControlEdge, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*types.ControlEdge) - fc.Result = res - return ec.marshalNControlEdge2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐControlEdge(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_CreateControlPayload_controlEdge(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CreateControlPayload", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "cursor": - return ec.fieldContext_ControlEdge_cursor(ctx, field) - case "node": - return ec.fieldContext_ControlEdge_node(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ControlEdge", field.Name) - }, - } - return fc, nil -} - func (ec *executionContext) _CreateFrameworkPayload_frameworkEdge(ctx context.Context, field graphql.CollectedField, obj *types.CreateFrameworkPayload) (ret graphql.Marshaler) { fc, err := ec.fieldContext_CreateFrameworkPayload_frameworkEdge(ctx, field) if err != nil { return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.FrameworkEdge, nil @@ -5403,12 +4800,68 @@ func (ec *executionContext) fieldContext_CreateFrameworkPayload_frameworkEdge(_ return fc, nil } +func (ec *executionContext) _CreateMitigationPayload_mitigationEdge(ctx context.Context, field graphql.CollectedField, obj *types.CreateMitigationPayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CreateMitigationPayload_mitigationEdge(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.MitigationEdge, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*types.MitigationEdge) + fc.Result = res + return ec.marshalNMitigationEdge2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐMitigationEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CreateMitigationPayload_mitigationEdge(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CreateMitigationPayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_MitigationEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_MitigationEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type MitigationEdge", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _CreateOrganizationPayload_organizationEdge(ctx context.Context, field graphql.CollectedField, obj *types.CreateOrganizationPayload) (ret graphql.Marshaler) { fc, err := ec.fieldContext_CreateOrganizationPayload_organizationEdge(ctx, field) if err != nil { return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.OrganizationEdge, nil @@ -5453,6 +4906,12 @@ func (ec *executionContext) _CreatePeoplePayload_peopleEdge(ctx context.Context, return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.PeopleEdge, nil @@ -5497,6 +4956,12 @@ func (ec *executionContext) _CreatePolicyPayload_policyEdge(ctx context.Context, return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.PolicyEdge, nil @@ -5541,6 +5006,12 @@ func (ec *executionContext) _CreateTaskPayload_taskEdge(ctx context.Context, fie return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.TaskEdge, nil @@ -5585,6 +5056,12 @@ func (ec *executionContext) _CreateVendorPayload_vendorEdge(ctx context.Context, return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.VendorEdge, nil @@ -5629,6 +5106,12 @@ func (ec *executionContext) _DeleteEvidencePayload_deletedEvidenceId(ctx context return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.DeletedEvidenceID, nil @@ -5667,6 +5150,12 @@ func (ec *executionContext) _DeleteOrganizationPayload_deletedOrganizationId(ctx return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.DeletedOrganizationID, nil @@ -5705,6 +5194,12 @@ func (ec *executionContext) _DeletePeoplePayload_deletedPeopleId(ctx context.Con return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.DeletedPeopleID, nil @@ -5743,6 +5238,12 @@ func (ec *executionContext) _DeletePolicyPayload_deletedPolicyId(ctx context.Con return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.DeletedPolicyID, nil @@ -5781,6 +5282,12 @@ func (ec *executionContext) _DeleteTaskPayload_deletedTaskId(ctx context.Context return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.DeletedTaskID, nil @@ -5819,6 +5326,12 @@ func (ec *executionContext) _DeleteVendorPayload_deletedVendorId(ctx context.Con return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.DeletedVendorID, nil @@ -5857,6 +5370,12 @@ func (ec *executionContext) _Evidence_id(ctx context.Context, field graphql.Coll return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -5895,6 +5414,12 @@ func (ec *executionContext) _Evidence_fileUrl(ctx context.Context, field graphql return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Evidence().FileURL(rctx, obj) @@ -5930,6 +5455,12 @@ func (ec *executionContext) _Evidence_mimeType(ctx context.Context, field graphq return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.MimeType, nil @@ -5968,6 +5499,12 @@ func (ec *executionContext) _Evidence_size(ctx context.Context, field graphql.Co return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Size, nil @@ -6006,6 +5543,12 @@ func (ec *executionContext) _Evidence_state(ctx context.Context, field graphql.C return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.State, nil @@ -6044,6 +5587,12 @@ func (ec *executionContext) _Evidence_type(ctx context.Context, field graphql.Co return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -6082,6 +5631,12 @@ func (ec *executionContext) _Evidence_filename(ctx context.Context, field graphq return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Filename, nil @@ -6120,6 +5675,12 @@ func (ec *executionContext) _Evidence_url(ctx context.Context, field graphql.Col return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.URL, nil @@ -6155,6 +5716,12 @@ func (ec *executionContext) _Evidence_description(ctx context.Context, field gra return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -6193,6 +5760,12 @@ func (ec *executionContext) _Evidence_createdAt(ctx context.Context, field graph return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.CreatedAt, nil @@ -6231,6 +5804,12 @@ func (ec *executionContext) _Evidence_updatedAt(ctx context.Context, field graph return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.UpdatedAt, nil @@ -6269,6 +5848,12 @@ func (ec *executionContext) _EvidenceConnection_edges(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Edges, nil @@ -6313,6 +5898,12 @@ func (ec *executionContext) _EvidenceConnection_pageInfo(ctx context.Context, fi return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.PageInfo, nil @@ -6361,6 +5952,12 @@ func (ec *executionContext) _EvidenceEdge_cursor(ctx context.Context, field grap return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Cursor, nil @@ -6399,6 +5996,12 @@ func (ec *executionContext) _EvidenceEdge_node(ctx context.Context, field graphq return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Node, nil @@ -6461,6 +6064,12 @@ func (ec *executionContext) _Framework_id(ctx context.Context, field graphql.Col return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -6499,6 +6108,12 @@ func (ec *executionContext) _Framework_version(ctx context.Context, field graphq return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Version, nil @@ -6537,6 +6152,12 @@ func (ec *executionContext) _Framework_name(ctx context.Context, field graphql.C return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -6575,6 +6196,12 @@ func (ec *executionContext) _Framework_description(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -6607,15 +6234,21 @@ func (ec *executionContext) fieldContext_Framework_description(_ context.Context return fc, nil } -func (ec *executionContext) _Framework_controls(ctx context.Context, field graphql.CollectedField, obj *types.Framework) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Framework_controls(ctx, field) +func (ec *executionContext) _Framework_mitigations(ctx context.Context, field graphql.CollectedField, obj *types.Framework) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Framework_mitigations(ctx, field) if err != nil { return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Framework().Controls(rctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.ControlOrderBy)) + return ec.resolvers.Framework().Mitigations(rctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.MitigationOrderBy)) }) if err != nil { ec.Error(ctx, err) @@ -6627,12 +6260,12 @@ func (ec *executionContext) _Framework_controls(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(*types.ControlConnection) + res := resTmp.(*types.MitigationConnection) fc.Result = res - return ec.marshalNControlConnection2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐControlConnection(ctx, field.Selections, res) + return ec.marshalNMitigationConnection2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐMitigationConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Framework_controls(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Framework_mitigations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Framework", Field: field, @@ -6641,15 +6274,21 @@ func (ec *executionContext) fieldContext_Framework_controls(ctx context.Context, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "edges": - return ec.fieldContext_ControlConnection_edges(ctx, field) + return ec.fieldContext_MitigationConnection_edges(ctx, field) case "pageInfo": - return ec.fieldContext_ControlConnection_pageInfo(ctx, field) + return ec.fieldContext_MitigationConnection_pageInfo(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ControlConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type MitigationConnection", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Framework_controls_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Framework_mitigations_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } @@ -6662,6 +6301,12 @@ func (ec *executionContext) _Framework_createdAt(ctx context.Context, field grap return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.CreatedAt, nil @@ -6700,6 +6345,12 @@ func (ec *executionContext) _Framework_updatedAt(ctx context.Context, field grap return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.UpdatedAt, nil @@ -6738,6 +6389,12 @@ func (ec *executionContext) _FrameworkConnection_edges(ctx context.Context, fiel return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Edges, nil @@ -6782,6 +6439,12 @@ func (ec *executionContext) _FrameworkConnection_pageInfo(ctx context.Context, f return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.PageInfo, nil @@ -6830,6 +6493,12 @@ func (ec *executionContext) _FrameworkEdge_cursor(ctx context.Context, field gra return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Cursor, nil @@ -6868,6 +6537,12 @@ func (ec *executionContext) _FrameworkEdge_node(ctx context.Context, field graph return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Node, nil @@ -6903,8 +6578,8 @@ func (ec *executionContext) fieldContext_FrameworkEdge_node(_ context.Context, f return ec.fieldContext_Framework_name(ctx, field) case "description": return ec.fieldContext_Framework_description(ctx, field) - case "controls": - return ec.fieldContext_Framework_controls(ctx, field) + case "mitigations": + return ec.fieldContext_Framework_mitigations(ctx, field) case "createdAt": return ec.fieldContext_Framework_createdAt(ctx, field) case "updatedAt": @@ -6922,6 +6597,12 @@ func (ec *executionContext) _ImportFrameworkPayload_frameworkEdge(ctx context.Co return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.FrameworkEdge, nil @@ -6966,6 +6647,12 @@ func (ec *executionContext) _InviteUserPayload_success(ctx context.Context, fiel return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Success, nil @@ -6998,12 +6685,689 @@ func (ec *executionContext) fieldContext_InviteUserPayload_success(_ context.Con return fc, nil } +func (ec *executionContext) _Mitigation_id(ctx context.Context, field graphql.CollectedField, obj *types.Mitigation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mitigation_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(gid.GID) + fc.Result = res + return ec.marshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mitigation_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mitigation", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Mitigation_version(ctx context.Context, field graphql.CollectedField, obj *types.Mitigation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mitigation_version(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Version, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mitigation_version(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mitigation", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Mitigation_category(ctx context.Context, field graphql.CollectedField, obj *types.Mitigation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mitigation_category(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Category, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mitigation_category(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mitigation", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Mitigation_name(ctx context.Context, field graphql.CollectedField, obj *types.Mitigation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mitigation_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mitigation_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mitigation", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Mitigation_description(ctx context.Context, field graphql.CollectedField, obj *types.Mitigation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mitigation_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mitigation_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mitigation", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Mitigation_state(ctx context.Context, field graphql.CollectedField, obj *types.Mitigation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mitigation_state(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.State, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(coredata.MitigationState) + fc.Result = res + return ec.marshalNMitigationState2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationState(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mitigation_state(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mitigation", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type MitigationState does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Mitigation_importance(ctx context.Context, field graphql.CollectedField, obj *types.Mitigation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mitigation_importance(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Importance, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(coredata.MitigationImportance) + fc.Result = res + return ec.marshalNMitigationImportance2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationImportance(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mitigation_importance(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mitigation", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type MitigationImportance does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Mitigation_tasks(ctx context.Context, field graphql.CollectedField, obj *types.Mitigation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mitigation_tasks(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mitigation().Tasks(rctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.TaskOrderBy)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*types.TaskConnection) + fc.Result = res + return ec.marshalNTaskConnection2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐTaskConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mitigation_tasks(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mitigation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_TaskConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_TaskConnection_pageInfo(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TaskConnection", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mitigation_tasks_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mitigation_createdAt(ctx context.Context, field graphql.CollectedField, obj *types.Mitigation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mitigation_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNDatetime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mitigation_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mitigation", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Datetime does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Mitigation_updatedAt(ctx context.Context, field graphql.CollectedField, obj *types.Mitigation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mitigation_updatedAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNDatetime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mitigation_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mitigation", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Datetime does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MitigationConnection_edges(ctx context.Context, field graphql.CollectedField, obj *types.MitigationConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MitigationConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*types.MitigationEdge) + fc.Result = res + return ec.marshalNMitigationEdge2ᚕᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐMitigationEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MitigationConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MitigationConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_MitigationEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_MitigationEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type MitigationEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _MitigationConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *types.MitigationConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MitigationConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*types.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MitigationConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MitigationConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _MitigationEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *types.MitigationEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MitigationEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(page.CursorKey) + fc.Result = res + return ec.marshalNCursorKey2githubᚗcomᚋgetproboᚋproboᚋpkgᚋpageᚐCursorKey(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MitigationEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MitigationEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type CursorKey does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MitigationEdge_node(ctx context.Context, field graphql.CollectedField, obj *types.MitigationEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MitigationEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*types.Mitigation) + fc.Result = res + return ec.marshalNMitigation2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐMitigation(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MitigationEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MitigationEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Mitigation_id(ctx, field) + case "version": + return ec.fieldContext_Mitigation_version(ctx, field) + case "category": + return ec.fieldContext_Mitigation_category(ctx, field) + case "name": + return ec.fieldContext_Mitigation_name(ctx, field) + case "description": + return ec.fieldContext_Mitigation_description(ctx, field) + case "state": + return ec.fieldContext_Mitigation_state(ctx, field) + case "importance": + return ec.fieldContext_Mitigation_importance(ctx, field) + case "tasks": + return ec.fieldContext_Mitigation_tasks(ctx, field) + case "createdAt": + return ec.fieldContext_Mitigation_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Mitigation_updatedAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Mitigation", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _Mutation_createVendor(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Mutation_createVendor(ctx, field) if err != nil { return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().CreateVendor(rctx, fc.Args["input"].(types.CreateVendorInput)) @@ -7037,6 +7401,12 @@ func (ec *executionContext) fieldContext_Mutation_createVendor(ctx context.Conte return nil, fmt.Errorf("no field named %q was found under type CreateVendorPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_createVendor_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7051,6 +7421,12 @@ func (ec *executionContext) _Mutation_updateVendor(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().UpdateVendor(rctx, fc.Args["input"].(types.UpdateVendorInput)) @@ -7084,6 +7460,12 @@ func (ec *executionContext) fieldContext_Mutation_updateVendor(ctx context.Conte return nil, fmt.Errorf("no field named %q was found under type UpdateVendorPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_updateVendor_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7098,6 +7480,12 @@ func (ec *executionContext) _Mutation_deleteVendor(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().DeleteVendor(rctx, fc.Args["input"].(types.DeleteVendorInput)) @@ -7131,6 +7519,12 @@ func (ec *executionContext) fieldContext_Mutation_deleteVendor(ctx context.Conte return nil, fmt.Errorf("no field named %q was found under type DeleteVendorPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_deleteVendor_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7145,6 +7539,12 @@ func (ec *executionContext) _Mutation_createPeople(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().CreatePeople(rctx, fc.Args["input"].(types.CreatePeopleInput)) @@ -7178,6 +7578,12 @@ func (ec *executionContext) fieldContext_Mutation_createPeople(ctx context.Conte return nil, fmt.Errorf("no field named %q was found under type CreatePeoplePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_createPeople_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7192,6 +7598,12 @@ func (ec *executionContext) _Mutation_updatePeople(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().UpdatePeople(rctx, fc.Args["input"].(types.UpdatePeopleInput)) @@ -7225,6 +7637,12 @@ func (ec *executionContext) fieldContext_Mutation_updatePeople(ctx context.Conte return nil, fmt.Errorf("no field named %q was found under type UpdatePeoplePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_updatePeople_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7239,6 +7657,12 @@ func (ec *executionContext) _Mutation_deletePeople(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().DeletePeople(rctx, fc.Args["input"].(types.DeletePeopleInput)) @@ -7272,6 +7696,12 @@ func (ec *executionContext) fieldContext_Mutation_deletePeople(ctx context.Conte return nil, fmt.Errorf("no field named %q was found under type DeletePeoplePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_deletePeople_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7286,6 +7716,12 @@ func (ec *executionContext) _Mutation_createOrganization(ctx context.Context, fi return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().CreateOrganization(rctx, fc.Args["input"].(types.CreateOrganizationInput)) @@ -7319,6 +7755,12 @@ func (ec *executionContext) fieldContext_Mutation_createOrganization(ctx context return nil, fmt.Errorf("no field named %q was found under type CreateOrganizationPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_createOrganization_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7333,6 +7775,12 @@ func (ec *executionContext) _Mutation_updateOrganization(ctx context.Context, fi return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().UpdateOrganization(rctx, fc.Args["input"].(types.UpdateOrganizationInput)) @@ -7366,6 +7814,12 @@ func (ec *executionContext) fieldContext_Mutation_updateOrganization(ctx context return nil, fmt.Errorf("no field named %q was found under type UpdateOrganizationPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_updateOrganization_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7380,6 +7834,12 @@ func (ec *executionContext) _Mutation_deleteOrganization(ctx context.Context, fi return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().DeleteOrganization(rctx, fc.Args["input"].(types.DeleteOrganizationInput)) @@ -7413,6 +7873,12 @@ func (ec *executionContext) fieldContext_Mutation_deleteOrganization(ctx context return nil, fmt.Errorf("no field named %q was found under type DeleteOrganizationPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_deleteOrganization_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7427,6 +7893,12 @@ func (ec *executionContext) _Mutation_createTask(ctx context.Context, field grap return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().CreateTask(rctx, fc.Args["input"].(types.CreateTaskInput)) @@ -7460,6 +7932,12 @@ func (ec *executionContext) fieldContext_Mutation_createTask(ctx context.Context return nil, fmt.Errorf("no field named %q was found under type CreateTaskPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_createTask_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7474,6 +7952,12 @@ func (ec *executionContext) _Mutation_updateTask(ctx context.Context, field grap return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().UpdateTask(rctx, fc.Args["input"].(types.UpdateTaskInput)) @@ -7507,6 +7991,12 @@ func (ec *executionContext) fieldContext_Mutation_updateTask(ctx context.Context return nil, fmt.Errorf("no field named %q was found under type UpdateTaskPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_updateTask_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7521,6 +8011,12 @@ func (ec *executionContext) _Mutation_deleteTask(ctx context.Context, field grap return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().DeleteTask(rctx, fc.Args["input"].(types.DeleteTaskInput)) @@ -7554,6 +8050,12 @@ func (ec *executionContext) fieldContext_Mutation_deleteTask(ctx context.Context return nil, fmt.Errorf("no field named %q was found under type DeleteTaskPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_deleteTask_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7568,6 +8070,12 @@ func (ec *executionContext) _Mutation_assignTask(ctx context.Context, field grap return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().AssignTask(rctx, fc.Args["input"].(types.AssignTaskInput)) @@ -7601,6 +8109,12 @@ func (ec *executionContext) fieldContext_Mutation_assignTask(ctx context.Context return nil, fmt.Errorf("no field named %q was found under type AssignTaskPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_assignTask_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7615,6 +8129,12 @@ func (ec *executionContext) _Mutation_unassignTask(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().UnassignTask(rctx, fc.Args["input"].(types.UnassignTaskInput)) @@ -7648,6 +8168,12 @@ func (ec *executionContext) fieldContext_Mutation_unassignTask(ctx context.Conte return nil, fmt.Errorf("no field named %q was found under type UnassignTaskPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_unassignTask_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7662,6 +8188,12 @@ func (ec *executionContext) _Mutation_createFramework(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().CreateFramework(rctx, fc.Args["input"].(types.CreateFrameworkInput)) @@ -7695,6 +8227,12 @@ func (ec *executionContext) fieldContext_Mutation_createFramework(ctx context.Co return nil, fmt.Errorf("no field named %q was found under type CreateFrameworkPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_createFramework_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7709,6 +8247,12 @@ func (ec *executionContext) _Mutation_updateFramework(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().UpdateFramework(rctx, fc.Args["input"].(types.UpdateFrameworkInput)) @@ -7742,6 +8286,12 @@ func (ec *executionContext) fieldContext_Mutation_updateFramework(ctx context.Co return nil, fmt.Errorf("no field named %q was found under type UpdateFrameworkPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_updateFramework_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7756,6 +8306,12 @@ func (ec *executionContext) _Mutation_importFramework(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().ImportFramework(rctx, fc.Args["input"].(types.ImportFrameworkInput)) @@ -7789,6 +8345,12 @@ func (ec *executionContext) fieldContext_Mutation_importFramework(ctx context.Co return nil, fmt.Errorf("no field named %q was found under type ImportFrameworkPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_importFramework_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7797,15 +8359,21 @@ func (ec *executionContext) fieldContext_Mutation_importFramework(ctx context.Co return fc, nil } -func (ec *executionContext) _Mutation_createControl(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_createControl(ctx, field) +func (ec *executionContext) _Mutation_createMitigation(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createMitigation(ctx, field) if err != nil { return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateControl(rctx, fc.Args["input"].(types.CreateControlInput)) + return ec.resolvers.Mutation().CreateMitigation(rctx, fc.Args["input"].(types.CreateMitigationInput)) }) if err != nil { ec.Error(ctx, err) @@ -7817,12 +8385,12 @@ func (ec *executionContext) _Mutation_createControl(ctx context.Context, field g } return graphql.Null } - res := resTmp.(*types.CreateControlPayload) + res := resTmp.(*types.CreateMitigationPayload) fc.Result = res - return ec.marshalNCreateControlPayload2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateControlPayload(ctx, field.Selections, res) + return ec.marshalNCreateMitigationPayload2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateMitigationPayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_createControl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_createMitigation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -7830,29 +8398,41 @@ func (ec *executionContext) fieldContext_Mutation_createControl(ctx context.Cont IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "controlEdge": - return ec.fieldContext_CreateControlPayload_controlEdge(ctx, field) + case "mitigationEdge": + return ec.fieldContext_CreateMitigationPayload_mitigationEdge(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type CreateControlPayload", field.Name) + return nil, fmt.Errorf("no field named %q was found under type CreateMitigationPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_createControl_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_createMitigation_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_updateControl(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_updateControl(ctx, field) +func (ec *executionContext) _Mutation_updateMitigation(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateMitigation(ctx, field) if err != nil { return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateControl(rctx, fc.Args["input"].(types.UpdateControlInput)) + return ec.resolvers.Mutation().UpdateMitigation(rctx, fc.Args["input"].(types.UpdateMitigationInput)) }) if err != nil { ec.Error(ctx, err) @@ -7864,12 +8444,12 @@ func (ec *executionContext) _Mutation_updateControl(ctx context.Context, field g } return graphql.Null } - res := resTmp.(*types.UpdateControlPayload) + res := resTmp.(*types.UpdateMitigationPayload) fc.Result = res - return ec.marshalNUpdateControlPayload2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateControlPayload(ctx, field.Selections, res) + return ec.marshalNUpdateMitigationPayload2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateMitigationPayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_updateControl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_updateMitigation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -7877,14 +8457,20 @@ func (ec *executionContext) fieldContext_Mutation_updateControl(ctx context.Cont IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "control": - return ec.fieldContext_UpdateControlPayload_control(ctx, field) + case "mitigation": + return ec.fieldContext_UpdateMitigationPayload_mitigation(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type UpdateControlPayload", field.Name) + return nil, fmt.Errorf("no field named %q was found under type UpdateMitigationPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_updateControl_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_updateMitigation_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } @@ -7897,6 +8483,12 @@ func (ec *executionContext) _Mutation_uploadEvidence(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().UploadEvidence(rctx, fc.Args["input"].(types.UploadEvidenceInput)) @@ -7930,6 +8522,12 @@ func (ec *executionContext) fieldContext_Mutation_uploadEvidence(ctx context.Con return nil, fmt.Errorf("no field named %q was found under type UploadEvidencePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_uploadEvidence_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7944,6 +8542,12 @@ func (ec *executionContext) _Mutation_deleteEvidence(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().DeleteEvidence(rctx, fc.Args["input"].(types.DeleteEvidenceInput)) @@ -7977,6 +8581,12 @@ func (ec *executionContext) fieldContext_Mutation_deleteEvidence(ctx context.Con return nil, fmt.Errorf("no field named %q was found under type DeleteEvidencePayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_deleteEvidence_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -7991,6 +8601,12 @@ func (ec *executionContext) _Mutation_createPolicy(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().CreatePolicy(rctx, fc.Args["input"].(types.CreatePolicyInput)) @@ -8024,6 +8640,12 @@ func (ec *executionContext) fieldContext_Mutation_createPolicy(ctx context.Conte return nil, fmt.Errorf("no field named %q was found under type CreatePolicyPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_createPolicy_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -8038,6 +8660,12 @@ func (ec *executionContext) _Mutation_updatePolicy(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().UpdatePolicy(rctx, fc.Args["input"].(types.UpdatePolicyInput)) @@ -8071,6 +8699,12 @@ func (ec *executionContext) fieldContext_Mutation_updatePolicy(ctx context.Conte return nil, fmt.Errorf("no field named %q was found under type UpdatePolicyPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_updatePolicy_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -8085,6 +8719,12 @@ func (ec *executionContext) _Mutation_deletePolicy(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().DeletePolicy(rctx, fc.Args["input"].(types.DeletePolicyInput)) @@ -8118,6 +8758,12 @@ func (ec *executionContext) fieldContext_Mutation_deletePolicy(ctx context.Conte return nil, fmt.Errorf("no field named %q was found under type DeletePolicyPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_deletePolicy_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -8132,6 +8778,12 @@ func (ec *executionContext) _Mutation_confirmEmail(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().ConfirmEmail(rctx, fc.Args["input"].(types.ConfirmEmailInput)) @@ -8165,6 +8817,12 @@ func (ec *executionContext) fieldContext_Mutation_confirmEmail(ctx context.Conte return nil, fmt.Errorf("no field named %q was found under type ConfirmEmailPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_confirmEmail_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -8179,6 +8837,12 @@ func (ec *executionContext) _Mutation_inviteUser(ctx context.Context, field grap return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().InviteUser(rctx, fc.Args["input"].(types.InviteUserInput)) @@ -8212,6 +8876,12 @@ func (ec *executionContext) fieldContext_Mutation_inviteUser(ctx context.Context return nil, fmt.Errorf("no field named %q was found under type InviteUserPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_inviteUser_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -8226,6 +8896,12 @@ func (ec *executionContext) _Mutation_removeUser(ctx context.Context, field grap return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().RemoveUser(rctx, fc.Args["input"].(types.RemoveUserInput)) @@ -8259,6 +8935,12 @@ func (ec *executionContext) fieldContext_Mutation_removeUser(ctx context.Context return nil, fmt.Errorf("no field named %q was found under type RemoveUserPayload", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Mutation_removeUser_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -8273,6 +8955,12 @@ func (ec *executionContext) _Organization_id(ctx context.Context, field graphql. return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -8311,6 +8999,12 @@ func (ec *executionContext) _Organization_name(ctx context.Context, field graphq return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -8349,6 +9043,12 @@ func (ec *executionContext) _Organization_logoUrl(ctx context.Context, field gra return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Organization().LogoURL(rctx, obj) @@ -8384,6 +9084,12 @@ func (ec *executionContext) _Organization_users(ctx context.Context, field graph return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Organization().Users(rctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.UserOrderBy)) @@ -8419,6 +9125,12 @@ func (ec *executionContext) fieldContext_Organization_users(ctx context.Context, return nil, fmt.Errorf("no field named %q was found under type UserConnection", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Organization_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -8433,6 +9145,12 @@ func (ec *executionContext) _Organization_frameworks(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Organization().Frameworks(rctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.FrameworkOrderBy)) @@ -8468,6 +9186,12 @@ func (ec *executionContext) fieldContext_Organization_frameworks(ctx context.Con return nil, fmt.Errorf("no field named %q was found under type FrameworkConnection", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Organization_frameworks_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -8482,6 +9206,12 @@ func (ec *executionContext) _Organization_vendors(ctx context.Context, field gra return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Organization().Vendors(rctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.VendorOrderBy)) @@ -8517,6 +9247,12 @@ func (ec *executionContext) fieldContext_Organization_vendors(ctx context.Contex return nil, fmt.Errorf("no field named %q was found under type VendorConnection", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Organization_vendors_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -8531,6 +9267,12 @@ func (ec *executionContext) _Organization_peoples(ctx context.Context, field gra return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Organization().Peoples(rctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.PeopleOrderBy)) @@ -8566,6 +9308,12 @@ func (ec *executionContext) fieldContext_Organization_peoples(ctx context.Contex return nil, fmt.Errorf("no field named %q was found under type PeopleConnection", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Organization_peoples_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -8580,6 +9328,12 @@ func (ec *executionContext) _Organization_policies(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Organization().Policies(rctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.PolicyOrderBy)) @@ -8615,6 +9369,12 @@ func (ec *executionContext) fieldContext_Organization_policies(ctx context.Conte return nil, fmt.Errorf("no field named %q was found under type PolicyConnection", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Organization_policies_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -8629,6 +9389,12 @@ func (ec *executionContext) _Organization_createdAt(ctx context.Context, field g return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.CreatedAt, nil @@ -8667,6 +9433,12 @@ func (ec *executionContext) _Organization_updatedAt(ctx context.Context, field g return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.UpdatedAt, nil @@ -8705,6 +9477,12 @@ func (ec *executionContext) _OrganizationConnection_edges(ctx context.Context, f return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Edges, nil @@ -8749,6 +9527,12 @@ func (ec *executionContext) _OrganizationConnection_pageInfo(ctx context.Context return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.PageInfo, nil @@ -8797,6 +9581,12 @@ func (ec *executionContext) _OrganizationEdge_cursor(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Cursor, nil @@ -8835,6 +9625,12 @@ func (ec *executionContext) _OrganizationEdge_node(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Node, nil @@ -8895,6 +9691,12 @@ func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field gra return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.HasNextPage, nil @@ -8933,6 +9735,12 @@ func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.HasPreviousPage, nil @@ -8971,6 +9779,12 @@ func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field gra return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.StartCursor, nil @@ -9006,6 +9820,12 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.EndCursor, nil @@ -9041,6 +9861,12 @@ func (ec *executionContext) _People_id(ctx context.Context, field graphql.Collec return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -9079,6 +9905,12 @@ func (ec *executionContext) _People_fullName(ctx context.Context, field graphql. return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.FullName, nil @@ -9117,6 +9949,12 @@ func (ec *executionContext) _People_primaryEmailAddress(ctx context.Context, fie return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.PrimaryEmailAddress, nil @@ -9155,6 +9993,12 @@ func (ec *executionContext) _People_additionalEmailAddresses(ctx context.Context return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.AdditionalEmailAddresses, nil @@ -9193,6 +10037,12 @@ func (ec *executionContext) _People_kind(ctx context.Context, field graphql.Coll return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Kind, nil @@ -9231,6 +10081,12 @@ func (ec *executionContext) _People_createdAt(ctx context.Context, field graphql return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.CreatedAt, nil @@ -9269,6 +10125,12 @@ func (ec *executionContext) _People_updatedAt(ctx context.Context, field graphql return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.UpdatedAt, nil @@ -9307,6 +10169,12 @@ func (ec *executionContext) _People_version(ctx context.Context, field graphql.C return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Version, nil @@ -9345,6 +10213,12 @@ func (ec *executionContext) _PeopleConnection_edges(ctx context.Context, field g return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Edges, nil @@ -9389,6 +10263,12 @@ func (ec *executionContext) _PeopleConnection_pageInfo(ctx context.Context, fiel return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.PageInfo, nil @@ -9437,6 +10317,12 @@ func (ec *executionContext) _PeopleEdge_cursor(ctx context.Context, field graphq return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Cursor, nil @@ -9475,6 +10361,12 @@ func (ec *executionContext) _PeopleEdge_node(ctx context.Context, field graphql. return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Node, nil @@ -9531,6 +10423,12 @@ func (ec *executionContext) _Policy_id(ctx context.Context, field graphql.Collec return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -9569,6 +10467,12 @@ func (ec *executionContext) _Policy_version(ctx context.Context, field graphql.C return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Version, nil @@ -9607,6 +10511,12 @@ func (ec *executionContext) _Policy_name(ctx context.Context, field graphql.Coll return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -9645,6 +10555,12 @@ func (ec *executionContext) _Policy_status(ctx context.Context, field graphql.Co return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Status, nil @@ -9683,6 +10599,12 @@ func (ec *executionContext) _Policy_content(ctx context.Context, field graphql.C return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Content, nil @@ -9721,6 +10643,12 @@ func (ec *executionContext) _Policy_reviewDate(ctx context.Context, field graphq return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.ReviewDate, nil @@ -9756,6 +10684,12 @@ func (ec *executionContext) _Policy_owner(ctx context.Context, field graphql.Col return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Policy().Owner(rctx, obj) @@ -9812,6 +10746,12 @@ func (ec *executionContext) _Policy_createdAt(ctx context.Context, field graphql return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.CreatedAt, nil @@ -9850,6 +10790,12 @@ func (ec *executionContext) _Policy_updatedAt(ctx context.Context, field graphql return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.UpdatedAt, nil @@ -9888,6 +10834,12 @@ func (ec *executionContext) _PolicyConnection_edges(ctx context.Context, field g return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Edges, nil @@ -9932,6 +10884,12 @@ func (ec *executionContext) _PolicyConnection_pageInfo(ctx context.Context, fiel return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.PageInfo, nil @@ -9980,6 +10938,12 @@ func (ec *executionContext) _PolicyEdge_cursor(ctx context.Context, field graphq return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Cursor, nil @@ -10018,6 +10982,12 @@ func (ec *executionContext) _PolicyEdge_node(ctx context.Context, field graphql. return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Node, nil @@ -10076,6 +11046,12 @@ func (ec *executionContext) _Query_node(ctx context.Context, field graphql.Colle return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Node(rctx, fc.Args["id"].(gid.GID)) @@ -10105,6 +11081,12 @@ func (ec *executionContext) fieldContext_Query_node(ctx context.Context, field g return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Query_node_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -10119,6 +11101,12 @@ func (ec *executionContext) _Query_viewer(ctx context.Context, field graphql.Col return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Viewer(rctx) @@ -10165,6 +11153,12 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.introspectType(fc.Args["name"].(string)) @@ -10215,6 +11209,12 @@ func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -10229,6 +11229,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.introspectSchema() @@ -10278,6 +11284,12 @@ func (ec *executionContext) _RemoveUserPayload_success(ctx context.Context, fiel return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Success, nil @@ -10316,6 +11328,12 @@ func (ec *executionContext) _Session_id(ctx context.Context, field graphql.Colle return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -10354,6 +11372,12 @@ func (ec *executionContext) _Session_expiresAt(ctx context.Context, field graphq return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.ExpiresAt, nil @@ -10392,6 +11416,12 @@ func (ec *executionContext) _Task_id(ctx context.Context, field graphql.Collecte return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -10430,6 +11460,12 @@ func (ec *executionContext) _Task_version(ctx context.Context, field graphql.Col return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Version, nil @@ -10468,6 +11504,12 @@ func (ec *executionContext) _Task_name(ctx context.Context, field graphql.Collec return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -10506,6 +11548,12 @@ func (ec *executionContext) _Task_description(ctx context.Context, field graphql return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -10544,6 +11592,12 @@ func (ec *executionContext) _Task_state(ctx context.Context, field graphql.Colle return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.State, nil @@ -10582,6 +11636,12 @@ func (ec *executionContext) _Task_timeEstimate(ctx context.Context, field graphq return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.TimeEstimate, nil @@ -10617,6 +11677,12 @@ func (ec *executionContext) _Task_assignedTo(ctx context.Context, field graphql. return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Task().AssignedTo(rctx, obj) @@ -10670,6 +11736,12 @@ func (ec *executionContext) _Task_evidences(ctx context.Context, field graphql.C return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Task().Evidences(rctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.EvidenceOrderBy)) @@ -10705,6 +11777,12 @@ func (ec *executionContext) fieldContext_Task_evidences(ctx context.Context, fie return nil, fmt.Errorf("no field named %q was found under type EvidenceConnection", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Task_evidences_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -10719,6 +11797,12 @@ func (ec *executionContext) _Task_createdAt(ctx context.Context, field graphql.C return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.CreatedAt, nil @@ -10757,6 +11841,12 @@ func (ec *executionContext) _Task_updatedAt(ctx context.Context, field graphql.C return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.UpdatedAt, nil @@ -10795,6 +11885,12 @@ func (ec *executionContext) _TaskConnection_edges(ctx context.Context, field gra return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Edges, nil @@ -10839,6 +11935,12 @@ func (ec *executionContext) _TaskConnection_pageInfo(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.PageInfo, nil @@ -10887,6 +11989,12 @@ func (ec *executionContext) _TaskEdge_cursor(ctx context.Context, field graphql. return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Cursor, nil @@ -10925,6 +12033,12 @@ func (ec *executionContext) _TaskEdge_node(ctx context.Context, field graphql.Co return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Node, nil @@ -10985,6 +12099,12 @@ func (ec *executionContext) _UnassignTaskPayload_task(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Task, nil @@ -11039,72 +12159,18 @@ func (ec *executionContext) fieldContext_UnassignTaskPayload_task(_ context.Cont return fc, nil } -func (ec *executionContext) _UpdateControlPayload_control(ctx context.Context, field graphql.CollectedField, obj *types.UpdateControlPayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UpdateControlPayload_control(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Control, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*types.Control) - fc.Result = res - return ec.marshalNControl2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐControl(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_UpdateControlPayload_control(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "UpdateControlPayload", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Control_id(ctx, field) - case "version": - return ec.fieldContext_Control_version(ctx, field) - case "category": - return ec.fieldContext_Control_category(ctx, field) - case "name": - return ec.fieldContext_Control_name(ctx, field) - case "description": - return ec.fieldContext_Control_description(ctx, field) - case "state": - return ec.fieldContext_Control_state(ctx, field) - case "importance": - return ec.fieldContext_Control_importance(ctx, field) - case "tasks": - return ec.fieldContext_Control_tasks(ctx, field) - case "createdAt": - return ec.fieldContext_Control_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_Control_updatedAt(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Control", field.Name) - }, - } - return fc, nil -} - func (ec *executionContext) _UpdateFrameworkPayload_framework(ctx context.Context, field graphql.CollectedField, obj *types.UpdateFrameworkPayload) (ret graphql.Marshaler) { fc, err := ec.fieldContext_UpdateFrameworkPayload_framework(ctx, field) if err != nil { return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Framework, nil @@ -11140,8 +12206,8 @@ func (ec *executionContext) fieldContext_UpdateFrameworkPayload_framework(_ cont return ec.fieldContext_Framework_name(ctx, field) case "description": return ec.fieldContext_Framework_description(ctx, field) - case "controls": - return ec.fieldContext_Framework_controls(ctx, field) + case "mitigations": + return ec.fieldContext_Framework_mitigations(ctx, field) case "createdAt": return ec.fieldContext_Framework_createdAt(ctx, field) case "updatedAt": @@ -11153,12 +12219,84 @@ func (ec *executionContext) fieldContext_UpdateFrameworkPayload_framework(_ cont return fc, nil } +func (ec *executionContext) _UpdateMitigationPayload_mitigation(ctx context.Context, field graphql.CollectedField, obj *types.UpdateMitigationPayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UpdateMitigationPayload_mitigation(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Mitigation, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*types.Mitigation) + fc.Result = res + return ec.marshalNMitigation2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐMitigation(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UpdateMitigationPayload_mitigation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UpdateMitigationPayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Mitigation_id(ctx, field) + case "version": + return ec.fieldContext_Mitigation_version(ctx, field) + case "category": + return ec.fieldContext_Mitigation_category(ctx, field) + case "name": + return ec.fieldContext_Mitigation_name(ctx, field) + case "description": + return ec.fieldContext_Mitigation_description(ctx, field) + case "state": + return ec.fieldContext_Mitigation_state(ctx, field) + case "importance": + return ec.fieldContext_Mitigation_importance(ctx, field) + case "tasks": + return ec.fieldContext_Mitigation_tasks(ctx, field) + case "createdAt": + return ec.fieldContext_Mitigation_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Mitigation_updatedAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Mitigation", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _UpdateOrganizationPayload_organization(ctx context.Context, field graphql.CollectedField, obj *types.UpdateOrganizationPayload) (ret graphql.Marshaler) { fc, err := ec.fieldContext_UpdateOrganizationPayload_organization(ctx, field) if err != nil { return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Organization, nil @@ -11219,6 +12357,12 @@ func (ec *executionContext) _UpdatePeoplePayload_people(ctx context.Context, fie return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.People, nil @@ -11275,6 +12419,12 @@ func (ec *executionContext) _UpdatePolicyPayload_policy(ctx context.Context, fie return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Policy, nil @@ -11333,6 +12483,12 @@ func (ec *executionContext) _UpdateTaskPayload_task(ctx context.Context, field g return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Task, nil @@ -11393,6 +12549,12 @@ func (ec *executionContext) _UpdateVendorPayload_vendor(ctx context.Context, fie return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Vendor, nil @@ -11459,6 +12621,12 @@ func (ec *executionContext) _UploadEvidencePayload_evidenceEdge(ctx context.Cont return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.EvidenceEdge, nil @@ -11503,6 +12671,12 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -11541,6 +12715,12 @@ func (ec *executionContext) _User_fullName(ctx context.Context, field graphql.Co return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.FullName, nil @@ -11579,6 +12759,12 @@ func (ec *executionContext) _User_email(ctx context.Context, field graphql.Colle return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Email, nil @@ -11617,6 +12803,12 @@ func (ec *executionContext) _User_createdAt(ctx context.Context, field graphql.C return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.CreatedAt, nil @@ -11655,6 +12847,12 @@ func (ec *executionContext) _User_updatedAt(ctx context.Context, field graphql.C return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.UpdatedAt, nil @@ -11693,6 +12891,12 @@ func (ec *executionContext) _UserConnection_edges(ctx context.Context, field gra return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Edges, nil @@ -11737,6 +12941,12 @@ func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.PageInfo, nil @@ -11785,6 +12995,12 @@ func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql. return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Cursor, nil @@ -11823,6 +13039,12 @@ func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.Co return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Node, nil @@ -11873,6 +13095,12 @@ func (ec *executionContext) _Vendor_id(ctx context.Context, field graphql.Collec return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -11911,6 +13139,12 @@ func (ec *executionContext) _Vendor_name(ctx context.Context, field graphql.Coll return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -11949,6 +13183,12 @@ func (ec *executionContext) _Vendor_description(ctx context.Context, field graph return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -11987,6 +13227,12 @@ func (ec *executionContext) _Vendor_serviceStartAt(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.ServiceStartAt, nil @@ -12025,6 +13271,12 @@ func (ec *executionContext) _Vendor_serviceTerminationAt(ctx context.Context, fi return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.ServiceTerminationAt, nil @@ -12060,6 +13312,12 @@ func (ec *executionContext) _Vendor_serviceCriticality(ctx context.Context, fiel return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.ServiceCriticality, nil @@ -12098,6 +13356,12 @@ func (ec *executionContext) _Vendor_riskTier(ctx context.Context, field graphql. return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.RiskTier, nil @@ -12136,6 +13400,12 @@ func (ec *executionContext) _Vendor_statusPageUrl(ctx context.Context, field gra return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.StatusPageURL, nil @@ -12171,6 +13441,12 @@ func (ec *executionContext) _Vendor_termsOfServiceUrl(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.TermsOfServiceURL, nil @@ -12206,6 +13482,12 @@ func (ec *executionContext) _Vendor_privacyPolicyUrl(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.PrivacyPolicyURL, nil @@ -12241,6 +13523,12 @@ func (ec *executionContext) _Vendor_createdAt(ctx context.Context, field graphql return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.CreatedAt, nil @@ -12279,6 +13567,12 @@ func (ec *executionContext) _Vendor_updatedAt(ctx context.Context, field graphql return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.UpdatedAt, nil @@ -12317,6 +13611,12 @@ func (ec *executionContext) _Vendor_version(ctx context.Context, field graphql.C return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Version, nil @@ -12355,6 +13655,12 @@ func (ec *executionContext) _VendorConnection_edges(ctx context.Context, field g return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Edges, nil @@ -12399,6 +13705,12 @@ func (ec *executionContext) _VendorConnection_pageInfo(ctx context.Context, fiel return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.PageInfo, nil @@ -12447,6 +13759,12 @@ func (ec *executionContext) _VendorEdge_cursor(ctx context.Context, field graphq return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Cursor, nil @@ -12485,6 +13803,12 @@ func (ec *executionContext) _VendorEdge_node(ctx context.Context, field graphql. return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Node, nil @@ -12551,6 +13875,12 @@ func (ec *executionContext) _Viewer_id(ctx context.Context, field graphql.Collec return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -12589,6 +13919,12 @@ func (ec *executionContext) _Viewer_user(ctx context.Context, field graphql.Coll return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.User, nil @@ -12639,6 +13975,12 @@ func (ec *executionContext) _Viewer_organizations(ctx context.Context, field gra return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Viewer().Organizations(rctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.OrganizationOrder)) @@ -12674,6 +14016,12 @@ func (ec *executionContext) fieldContext_Viewer_organizations(ctx context.Contex return nil, fmt.Errorf("no field named %q was found under type OrganizationConnection", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field_Viewer_organizations_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -12688,6 +14036,12 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -12726,6 +14080,12 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -12761,6 +14121,12 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.IsRepeatable, nil @@ -12799,6 +14165,12 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Locations, nil @@ -12837,6 +14209,12 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -12880,6 +14258,12 @@ func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, f return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field___Directive_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -12894,6 +14278,12 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -12932,6 +14322,12 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -12967,6 +14363,12 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated(), nil @@ -13005,6 +14407,12 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason(), nil @@ -13040,6 +14448,12 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -13078,6 +14492,12 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -13113,6 +14533,12 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -13156,6 +14582,12 @@ func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field___Field_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -13170,6 +14602,12 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -13232,6 +14670,12 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated(), nil @@ -13270,6 +14714,12 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason(), nil @@ -13305,6 +14755,12 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -13343,6 +14799,12 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -13378,6 +14840,12 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -13440,6 +14908,12 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.DefaultValue, nil @@ -13475,6 +14949,12 @@ func (ec *executionContext) ___InputValue_isDeprecated(ctx context.Context, fiel return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated(), nil @@ -13513,6 +14993,12 @@ func (ec *executionContext) ___InputValue_deprecationReason(ctx context.Context, return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason(), nil @@ -13548,6 +15034,12 @@ func (ec *executionContext) ___Schema_description(ctx context.Context, field gra return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -13583,6 +15075,12 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Types(), nil @@ -13645,6 +15143,12 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.QueryType(), nil @@ -13707,6 +15211,12 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.MutationType(), nil @@ -13766,6 +15276,12 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.SubscriptionType(), nil @@ -13825,6 +15341,12 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Directives(), nil @@ -13875,6 +15397,12 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Kind(), nil @@ -13913,6 +15441,12 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Name(), nil @@ -13948,6 +15482,12 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -13983,6 +15523,12 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.SpecifiedByURL(), nil @@ -14018,6 +15564,12 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil @@ -14058,6 +15610,12 @@ func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, fiel return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -14072,6 +15630,12 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.Interfaces(), nil @@ -14131,6 +15695,12 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.PossibleTypes(), nil @@ -14190,6 +15760,12 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil @@ -14226,6 +15802,12 @@ func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) @@ -14240,6 +15822,12 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.InputFields(), nil @@ -14289,6 +15877,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.OfType(), nil @@ -14348,6 +15942,12 @@ func (ec *executionContext) ___Type_isOneOf(ctx context.Context, field graphql.C return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children return obj.IsOneOf(), nil @@ -14442,42 +16042,49 @@ func (ec *executionContext) unmarshalInputConfirmEmailInput(ctx context.Context, return it, nil } -func (ec *executionContext) unmarshalInputControlOrder(ctx context.Context, obj any) (types.ControlOrderBy, error) { - var it types.ControlOrderBy +func (ec *executionContext) unmarshalInputCreateFrameworkInput(ctx context.Context, obj any) (types.CreateFrameworkInput, error) { + var it types.CreateFrameworkInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v } - fieldsInOrder := [...]string{"direction", "field"} + fieldsInOrder := [...]string{"organizationId", "name", "description"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "direction": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) - data, err := ec.unmarshalNOrderDirection2githubᚗcomᚋgetproboᚋproboᚋpkgᚋpageᚐOrderDirection(ctx, v) + case "organizationId": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationId")) + data, err := ec.unmarshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, v) if err != nil { return it, err } - it.Direction = data - case "field": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) - data, err := ec.unmarshalNControlOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlOrderField(ctx, v) + it.OrganizationID = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - it.Field = data + it.Name = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Description = data } } return it, nil } -func (ec *executionContext) unmarshalInputCreateControlInput(ctx context.Context, obj any) (types.CreateControlInput, error) { - var it types.CreateControlInput +func (ec *executionContext) unmarshalInputCreateMitigationInput(ctx context.Context, obj any) (types.CreateMitigationInput, error) { + var it types.CreateMitigationInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v @@ -14520,7 +16127,7 @@ func (ec *executionContext) unmarshalInputCreateControlInput(ctx context.Context it.Category = data case "importance": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("importance")) - data, err := ec.unmarshalNControlImportance2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlImportance(ctx, v) + data, err := ec.unmarshalNMitigationImportance2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationImportance(ctx, v) if err != nil { return it, err } @@ -14531,47 +16138,6 @@ func (ec *executionContext) unmarshalInputCreateControlInput(ctx context.Context return it, nil } -func (ec *executionContext) unmarshalInputCreateFrameworkInput(ctx context.Context, obj any) (types.CreateFrameworkInput, error) { - var it types.CreateFrameworkInput - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"organizationId", "name", "description"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "organizationId": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationId")) - data, err := ec.unmarshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, v) - if err != nil { - return it, err - } - it.OrganizationID = data - case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.Name = data - case "description": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.Description = data - } - } - - return it, nil -} - func (ec *executionContext) unmarshalInputCreateOrganizationInput(ctx context.Context, obj any) (types.CreateOrganizationInput, error) { var it types.CreateOrganizationInput asMap := map[string]any{} @@ -14723,20 +16289,20 @@ func (ec *executionContext) unmarshalInputCreateTaskInput(ctx context.Context, o asMap[k] = v } - fieldsInOrder := [...]string{"controlId", "name", "description", "timeEstimate", "assignedToId"} + fieldsInOrder := [...]string{"mitigationId", "name", "description", "timeEstimate", "assignedToId"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "controlId": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("controlId")) + case "mitigationId": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mitigationId")) data, err := ec.unmarshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, v) if err != nil { return it, err } - it.ControlID = data + it.MitigationID = data case "name": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) data, err := ec.unmarshalNString2string(ctx, v) @@ -15166,6 +16732,40 @@ func (ec *executionContext) unmarshalInputInviteUserInput(ctx context.Context, o return it, nil } +func (ec *executionContext) unmarshalInputMitigationOrder(ctx context.Context, obj any) (types.MitigationOrderBy, error) { + var it types.MitigationOrderBy + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2githubᚗcomᚋgetproboᚋproboᚋpkgᚋpageᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNMitigationOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputOrganizationOrder(ctx context.Context, obj any) (types.OrganizationOrder, error) { var it types.OrganizationOrder asMap := map[string]any{} @@ -15363,8 +16963,56 @@ func (ec *executionContext) unmarshalInputUnassignTaskInput(ctx context.Context, return it, nil } -func (ec *executionContext) unmarshalInputUpdateControlInput(ctx context.Context, obj any) (types.UpdateControlInput, error) { - var it types.UpdateControlInput +func (ec *executionContext) unmarshalInputUpdateFrameworkInput(ctx context.Context, obj any) (types.UpdateFrameworkInput, error) { + var it types.UpdateFrameworkInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"id", "expectedVersion", "name", "description"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, v) + if err != nil { + return it, err + } + it.ID = data + case "expectedVersion": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expectedVersion")) + data, err := ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + it.ExpectedVersion = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateMitigationInput(ctx context.Context, obj any) (types.UpdateMitigationInput, error) { + var it types.UpdateMitigationInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v @@ -15414,14 +17062,14 @@ func (ec *executionContext) unmarshalInputUpdateControlInput(ctx context.Context it.Category = data case "state": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("state")) - data, err := ec.unmarshalOControlState2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlState(ctx, v) + data, err := ec.unmarshalOMitigationState2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationState(ctx, v) if err != nil { return it, err } it.State = data case "importance": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("importance")) - data, err := ec.unmarshalOControlImportance2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlImportance(ctx, v) + data, err := ec.unmarshalOMitigationImportance2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationImportance(ctx, v) if err != nil { return it, err } @@ -15432,54 +17080,6 @@ func (ec *executionContext) unmarshalInputUpdateControlInput(ctx context.Context return it, nil } -func (ec *executionContext) unmarshalInputUpdateFrameworkInput(ctx context.Context, obj any) (types.UpdateFrameworkInput, error) { - var it types.UpdateFrameworkInput - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"id", "expectedVersion", "name", "description"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "id": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - data, err := ec.unmarshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, v) - if err != nil { - return it, err - } - it.ID = data - case "expectedVersion": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expectedVersion")) - data, err := ec.unmarshalNInt2int(ctx, v) - if err != nil { - return it, err - } - it.ExpectedVersion = data - case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.Name = data - case "description": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.Description = data - } - } - - return it, nil -} - func (ec *executionContext) unmarshalInputUpdateOrganizationInput(ctx context.Context, obj any) (types.UpdateOrganizationInput, error) { var it types.UpdateOrganizationInput asMap := map[string]any{} @@ -15977,13 +17577,13 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj return graphql.Null } return ec._Framework(ctx, sel, obj) - case types.Control: - return ec._Control(ctx, sel, &obj) - case *types.Control: + case types.Mitigation: + return ec._Mitigation(ctx, sel, &obj) + case *types.Mitigation: if obj == nil { return graphql.Null } - return ec._Control(ctx, sel, obj) + return ec._Mitigation(ctx, sel, obj) case types.Task: return ec._Task(ctx, sel, &obj) case *types.Task: @@ -16099,243 +17699,6 @@ func (ec *executionContext) _ConfirmEmailPayload(ctx context.Context, sel ast.Se return out } -var controlImplementors = []string{"Control", "Node"} - -func (ec *executionContext) _Control(ctx context.Context, sel ast.SelectionSet, obj *types.Control) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, controlImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Control") - case "id": - out.Values[i] = ec._Control_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "version": - out.Values[i] = ec._Control_version(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "category": - out.Values[i] = ec._Control_category(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "name": - out.Values[i] = ec._Control_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "description": - out.Values[i] = ec._Control_description(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "state": - out.Values[i] = ec._Control_state(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "importance": - out.Values[i] = ec._Control_importance(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "tasks": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - res = ec._Control_tasks(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "createdAt": - out.Values[i] = ec._Control_createdAt(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "updatedAt": - out.Values[i] = ec._Control_updatedAt(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var controlConnectionImplementors = []string{"ControlConnection"} - -func (ec *executionContext) _ControlConnection(ctx context.Context, sel ast.SelectionSet, obj *types.ControlConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, controlConnectionImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ControlConnection") - case "edges": - out.Values[i] = ec._ControlConnection_edges(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "pageInfo": - out.Values[i] = ec._ControlConnection_pageInfo(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var controlEdgeImplementors = []string{"ControlEdge"} - -func (ec *executionContext) _ControlEdge(ctx context.Context, sel ast.SelectionSet, obj *types.ControlEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, controlEdgeImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ControlEdge") - case "cursor": - out.Values[i] = ec._ControlEdge_cursor(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "node": - out.Values[i] = ec._ControlEdge_node(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var createControlPayloadImplementors = []string{"CreateControlPayload"} - -func (ec *executionContext) _CreateControlPayload(ctx context.Context, sel ast.SelectionSet, obj *types.CreateControlPayload) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, createControlPayloadImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("CreateControlPayload") - case "controlEdge": - out.Values[i] = ec._CreateControlPayload_controlEdge(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - var createFrameworkPayloadImplementors = []string{"CreateFrameworkPayload"} func (ec *executionContext) _CreateFrameworkPayload(ctx context.Context, sel ast.SelectionSet, obj *types.CreateFrameworkPayload) graphql.Marshaler { @@ -16375,6 +17738,45 @@ func (ec *executionContext) _CreateFrameworkPayload(ctx context.Context, sel ast return out } +var createMitigationPayloadImplementors = []string{"CreateMitigationPayload"} + +func (ec *executionContext) _CreateMitigationPayload(ctx context.Context, sel ast.SelectionSet, obj *types.CreateMitigationPayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, createMitigationPayloadImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CreateMitigationPayload") + case "mitigationEdge": + out.Values[i] = ec._CreateMitigationPayload_mitigationEdge(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + var createOrganizationPayloadImplementors = []string{"CreateOrganizationPayload"} func (ec *executionContext) _CreateOrganizationPayload(ctx context.Context, sel ast.SelectionSet, obj *types.CreateOrganizationPayload) graphql.Marshaler { @@ -16824,6 +18226,11 @@ func (ec *executionContext) _Evidence(ctx context.Context, sel ast.SelectionSet, field := field innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() res = ec._Evidence_fileUrl(ctx, field, obj) return res } @@ -17032,11 +18439,16 @@ func (ec *executionContext) _Framework(ctx context.Context, sel ast.SelectionSet if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "controls": + case "mitigations": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - res = ec._Framework_controls(ctx, field, obj) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Framework_mitigations(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -17262,6 +18674,209 @@ func (ec *executionContext) _InviteUserPayload(ctx context.Context, sel ast.Sele return out } +var mitigationImplementors = []string{"Mitigation", "Node"} + +func (ec *executionContext) _Mitigation(ctx context.Context, sel ast.SelectionSet, obj *types.Mitigation) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, mitigationImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Mitigation") + case "id": + out.Values[i] = ec._Mitigation_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "version": + out.Values[i] = ec._Mitigation_version(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "category": + out.Values[i] = ec._Mitigation_category(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "name": + out.Values[i] = ec._Mitigation_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "description": + out.Values[i] = ec._Mitigation_description(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "state": + out.Values[i] = ec._Mitigation_state(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "importance": + out.Values[i] = ec._Mitigation_importance(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "tasks": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Mitigation_tasks(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "createdAt": + out.Values[i] = ec._Mitigation_createdAt(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "updatedAt": + out.Values[i] = ec._Mitigation_updatedAt(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var mitigationConnectionImplementors = []string{"MitigationConnection"} + +func (ec *executionContext) _MitigationConnection(ctx context.Context, sel ast.SelectionSet, obj *types.MitigationConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, mitigationConnectionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("MitigationConnection") + case "edges": + out.Values[i] = ec._MitigationConnection_edges(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "pageInfo": + out.Values[i] = ec._MitigationConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var mitigationEdgeImplementors = []string{"MitigationEdge"} + +func (ec *executionContext) _MitigationEdge(ctx context.Context, sel ast.SelectionSet, obj *types.MitigationEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, mitigationEdgeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("MitigationEdge") + case "cursor": + out.Values[i] = ec._MitigationEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "node": + out.Values[i] = ec._MitigationEdge_node(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + var mutationImplementors = []string{"Mutation"} func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { @@ -17400,16 +19015,16 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) if out.Values[i] == graphql.Null { out.Invalids++ } - case "createControl": + case "createMitigation": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_createControl(ctx, field) + return ec._Mutation_createMitigation(ctx, field) }) if out.Values[i] == graphql.Null { out.Invalids++ } - case "updateControl": + case "updateMitigation": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_updateControl(ctx, field) + return ec._Mutation_updateMitigation(ctx, field) }) if out.Values[i] == graphql.Null { out.Invalids++ @@ -17518,6 +19133,11 @@ func (ec *executionContext) _Organization(ctx context.Context, sel ast.Selection field := field innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() res = ec._Organization_logoUrl(ctx, field, obj) return res } @@ -17546,6 +19166,11 @@ func (ec *executionContext) _Organization(ctx context.Context, sel ast.Selection field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() res = ec._Organization_users(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) @@ -17577,6 +19202,11 @@ func (ec *executionContext) _Organization(ctx context.Context, sel ast.Selection field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() res = ec._Organization_frameworks(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) @@ -17608,6 +19238,11 @@ func (ec *executionContext) _Organization(ctx context.Context, sel ast.Selection field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() res = ec._Organization_vendors(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) @@ -17639,6 +19274,11 @@ func (ec *executionContext) _Organization(ctx context.Context, sel ast.Selection field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() res = ec._Organization_peoples(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) @@ -17670,6 +19310,11 @@ func (ec *executionContext) _Organization(ctx context.Context, sel ast.Selection field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() res = ec._Organization_policies(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) @@ -18070,6 +19715,11 @@ func (ec *executionContext) _Policy(ctx context.Context, sel ast.SelectionSet, o field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() res = ec._Policy_owner(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) @@ -18241,6 +19891,11 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() res = ec._Query_node(ctx, field) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) @@ -18258,6 +19913,11 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() res = ec._Query_viewer(ctx, field) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) @@ -18427,6 +20087,11 @@ func (ec *executionContext) _Task(ctx context.Context, sel ast.SelectionSet, obj field := field innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() res = ec._Task_assignedTo(ctx, field, obj) return res } @@ -18455,6 +20120,11 @@ func (ec *executionContext) _Task(ctx context.Context, sel ast.SelectionSet, obj field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() res = ec._Task_evidences(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) @@ -18642,19 +20312,19 @@ func (ec *executionContext) _UnassignTaskPayload(ctx context.Context, sel ast.Se return out } -var updateControlPayloadImplementors = []string{"UpdateControlPayload"} +var updateFrameworkPayloadImplementors = []string{"UpdateFrameworkPayload"} -func (ec *executionContext) _UpdateControlPayload(ctx context.Context, sel ast.SelectionSet, obj *types.UpdateControlPayload) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, updateControlPayloadImplementors) +func (ec *executionContext) _UpdateFrameworkPayload(ctx context.Context, sel ast.SelectionSet, obj *types.UpdateFrameworkPayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, updateFrameworkPayloadImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("UpdateControlPayload") - case "control": - out.Values[i] = ec._UpdateControlPayload_control(ctx, field, obj) + out.Values[i] = graphql.MarshalString("UpdateFrameworkPayload") + case "framework": + out.Values[i] = ec._UpdateFrameworkPayload_framework(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -18681,19 +20351,19 @@ func (ec *executionContext) _UpdateControlPayload(ctx context.Context, sel ast.S return out } -var updateFrameworkPayloadImplementors = []string{"UpdateFrameworkPayload"} +var updateMitigationPayloadImplementors = []string{"UpdateMitigationPayload"} -func (ec *executionContext) _UpdateFrameworkPayload(ctx context.Context, sel ast.SelectionSet, obj *types.UpdateFrameworkPayload) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, updateFrameworkPayloadImplementors) +func (ec *executionContext) _UpdateMitigationPayload(ctx context.Context, sel ast.SelectionSet, obj *types.UpdateMitigationPayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, updateMitigationPayloadImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("UpdateFrameworkPayload") - case "framework": - out.Values[i] = ec._UpdateFrameworkPayload_framework(ctx, field, obj) + out.Values[i] = graphql.MarshalString("UpdateMitigationPayload") + case "mitigation": + out.Values[i] = ec._UpdateMitigationPayload_mitigation(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -19301,6 +20971,11 @@ func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, o field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() res = ec._Viewer_organizations(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) @@ -19739,173 +21414,6 @@ func (ec *executionContext) marshalNConfirmEmailPayload2ᚖgithubᚗcomᚋgetpro return ec._ConfirmEmailPayload(ctx, sel, v) } -func (ec *executionContext) marshalNControl2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐControl(ctx context.Context, sel ast.SelectionSet, v *types.Control) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Control(ctx, sel, v) -} - -func (ec *executionContext) marshalNControlConnection2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐControlConnection(ctx context.Context, sel ast.SelectionSet, v types.ControlConnection) graphql.Marshaler { - return ec._ControlConnection(ctx, sel, &v) -} - -func (ec *executionContext) marshalNControlConnection2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐControlConnection(ctx context.Context, sel ast.SelectionSet, v *types.ControlConnection) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._ControlConnection(ctx, sel, v) -} - -func (ec *executionContext) marshalNControlEdge2ᚕᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐControlEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*types.ControlEdge) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNControlEdge2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐControlEdge(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNControlEdge2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐControlEdge(ctx context.Context, sel ast.SelectionSet, v *types.ControlEdge) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._ControlEdge(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNControlImportance2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlImportance(ctx context.Context, v any) (coredata.ControlImportance, error) { - tmp, err := graphql.UnmarshalString(v) - res := unmarshalNControlImportance2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlImportance[tmp] - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNControlImportance2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlImportance(ctx context.Context, sel ast.SelectionSet, v coredata.ControlImportance) graphql.Marshaler { - res := graphql.MarshalString(marshalNControlImportance2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlImportance[v]) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -var ( - unmarshalNControlImportance2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlImportance = map[string]coredata.ControlImportance{ - "MANDATORY": coredata.ControlImportanceMandatory, - "PREFERRED": coredata.ControlImportancePreferred, - "ADVANCED": coredata.ControlImportanceAdvanced, - } - marshalNControlImportance2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlImportance = map[coredata.ControlImportance]string{ - coredata.ControlImportanceMandatory: "MANDATORY", - coredata.ControlImportancePreferred: "PREFERRED", - coredata.ControlImportanceAdvanced: "ADVANCED", - } -) - -func (ec *executionContext) unmarshalNControlOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlOrderField(ctx context.Context, v any) (coredata.ControlOrderField, error) { - tmp, err := graphql.UnmarshalString(v) - res := coredata.ControlOrderField(tmp) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNControlOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlOrderField(ctx context.Context, sel ast.SelectionSet, v coredata.ControlOrderField) graphql.Marshaler { - res := graphql.MarshalString(string(v)) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) unmarshalNControlState2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlState(ctx context.Context, v any) (coredata.ControlState, error) { - tmp, err := graphql.UnmarshalString(v) - res := unmarshalNControlState2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlState[tmp] - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNControlState2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlState(ctx context.Context, sel ast.SelectionSet, v coredata.ControlState) graphql.Marshaler { - res := graphql.MarshalString(marshalNControlState2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlState[v]) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -var ( - unmarshalNControlState2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlState = map[string]coredata.ControlState{ - "NOT_STARTED": coredata.ControlStateNotStarted, - "IN_PROGRESS": coredata.ControlStateInProgress, - "NOT_APPLICABLE": coredata.ControlStateNotApplicable, - "IMPLEMENTED": coredata.ControlStateImplemented, - } - marshalNControlState2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlState = map[coredata.ControlState]string{ - coredata.ControlStateNotStarted: "NOT_STARTED", - coredata.ControlStateInProgress: "IN_PROGRESS", - coredata.ControlStateNotApplicable: "NOT_APPLICABLE", - coredata.ControlStateImplemented: "IMPLEMENTED", - } -) - -func (ec *executionContext) unmarshalNCreateControlInput2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateControlInput(ctx context.Context, v any) (types.CreateControlInput, error) { - res, err := ec.unmarshalInputCreateControlInput(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNCreateControlPayload2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateControlPayload(ctx context.Context, sel ast.SelectionSet, v types.CreateControlPayload) graphql.Marshaler { - return ec._CreateControlPayload(ctx, sel, &v) -} - -func (ec *executionContext) marshalNCreateControlPayload2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateControlPayload(ctx context.Context, sel ast.SelectionSet, v *types.CreateControlPayload) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._CreateControlPayload(ctx, sel, v) -} - func (ec *executionContext) unmarshalNCreateFrameworkInput2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateFrameworkInput(ctx context.Context, v any) (types.CreateFrameworkInput, error) { res, err := ec.unmarshalInputCreateFrameworkInput(ctx, v) return res, graphql.ErrorOnPath(ctx, err) @@ -19925,6 +21433,25 @@ func (ec *executionContext) marshalNCreateFrameworkPayload2ᚖgithubᚗcomᚋget return ec._CreateFrameworkPayload(ctx, sel, v) } +func (ec *executionContext) unmarshalNCreateMitigationInput2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateMitigationInput(ctx context.Context, v any) (types.CreateMitigationInput, error) { + res, err := ec.unmarshalInputCreateMitigationInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNCreateMitigationPayload2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateMitigationPayload(ctx context.Context, sel ast.SelectionSet, v types.CreateMitigationPayload) graphql.Marshaler { + return ec._CreateMitigationPayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNCreateMitigationPayload2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateMitigationPayload(ctx context.Context, sel ast.SelectionSet, v *types.CreateMitigationPayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._CreateMitigationPayload(ctx, sel, v) +} + func (ec *executionContext) unmarshalNCreateOrganizationInput2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateOrganizationInput(ctx context.Context, v any) (types.CreateOrganizationInput, error) { res, err := ec.unmarshalInputCreateOrganizationInput(ctx, v) return res, graphql.ErrorOnPath(ctx, err) @@ -20203,6 +21730,12 @@ func (ec *executionContext) marshalNEvidenceEdge2ᚕᚖgithubᚗcomᚋgetprobo } ctx := graphql.WithFieldContext(ctx, fc) f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() if !isLen1 { defer wg.Done() } @@ -20347,6 +21880,12 @@ func (ec *executionContext) marshalNFrameworkEdge2ᚕᚖgithubᚗcomᚋgetprobo } ctx := graphql.WithFieldContext(ctx, fc) f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() if !isLen1 { defer wg.Done() } @@ -20464,6 +22003,160 @@ func (ec *executionContext) marshalNInviteUserPayload2ᚖgithubᚗcomᚋgetprobo return ec._InviteUserPayload(ctx, sel, v) } +func (ec *executionContext) marshalNMitigation2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐMitigation(ctx context.Context, sel ast.SelectionSet, v *types.Mitigation) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Mitigation(ctx, sel, v) +} + +func (ec *executionContext) marshalNMitigationConnection2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐMitigationConnection(ctx context.Context, sel ast.SelectionSet, v types.MitigationConnection) graphql.Marshaler { + return ec._MitigationConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNMitigationConnection2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐMitigationConnection(ctx context.Context, sel ast.SelectionSet, v *types.MitigationConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._MitigationConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNMitigationEdge2ᚕᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐMitigationEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*types.MitigationEdge) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMitigationEdge2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐMitigationEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNMitigationEdge2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐMitigationEdge(ctx context.Context, sel ast.SelectionSet, v *types.MitigationEdge) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._MitigationEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMitigationImportance2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationImportance(ctx context.Context, v any) (coredata.MitigationImportance, error) { + tmp, err := graphql.UnmarshalString(v) + res := unmarshalNMitigationImportance2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationImportance[tmp] + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMitigationImportance2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationImportance(ctx context.Context, sel ast.SelectionSet, v coredata.MitigationImportance) graphql.Marshaler { + res := graphql.MarshalString(marshalNMitigationImportance2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationImportance[v]) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +var ( + unmarshalNMitigationImportance2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationImportance = map[string]coredata.MitigationImportance{ + "MANDATORY": coredata.MitigationImportanceMandatory, + "PREFERRED": coredata.MitigationImportancePreferred, + "ADVANCED": coredata.MitigationImportanceAdvanced, + } + marshalNMitigationImportance2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationImportance = map[coredata.MitigationImportance]string{ + coredata.MitigationImportanceMandatory: "MANDATORY", + coredata.MitigationImportancePreferred: "PREFERRED", + coredata.MitigationImportanceAdvanced: "ADVANCED", + } +) + +func (ec *executionContext) unmarshalNMitigationOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationOrderField(ctx context.Context, v any) (coredata.MitigationOrderField, error) { + tmp, err := graphql.UnmarshalString(v) + res := coredata.MitigationOrderField(tmp) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMitigationOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationOrderField(ctx context.Context, sel ast.SelectionSet, v coredata.MitigationOrderField) graphql.Marshaler { + res := graphql.MarshalString(string(v)) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNMitigationState2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationState(ctx context.Context, v any) (coredata.MitigationState, error) { + tmp, err := graphql.UnmarshalString(v) + res := unmarshalNMitigationState2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationState[tmp] + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMitigationState2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationState(ctx context.Context, sel ast.SelectionSet, v coredata.MitigationState) graphql.Marshaler { + res := graphql.MarshalString(marshalNMitigationState2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationState[v]) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +var ( + unmarshalNMitigationState2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationState = map[string]coredata.MitigationState{ + "NOT_STARTED": coredata.MitigationStateNotStarted, + "IN_PROGRESS": coredata.MitigationStateInProgress, + "NOT_APPLICABLE": coredata.MitigationStateNotApplicable, + "IMPLEMENTED": coredata.MitigationStateImplemented, + } + marshalNMitigationState2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationState = map[coredata.MitigationState]string{ + coredata.MitigationStateNotStarted: "NOT_STARTED", + coredata.MitigationStateInProgress: "IN_PROGRESS", + coredata.MitigationStateNotApplicable: "NOT_APPLICABLE", + coredata.MitigationStateImplemented: "IMPLEMENTED", + } +) + func (ec *executionContext) marshalNNode2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐNode(ctx context.Context, sel ast.SelectionSet, v types.Node) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -20540,6 +22233,12 @@ func (ec *executionContext) marshalNOrganizationEdge2ᚕᚖgithubᚗcomᚋgetpro } ctx := graphql.WithFieldContext(ctx, fc) f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() if !isLen1 { defer wg.Done() } @@ -20636,6 +22335,12 @@ func (ec *executionContext) marshalNPeopleEdge2ᚕᚖgithubᚗcomᚋgetproboᚋp } ctx := graphql.WithFieldContext(ctx, fc) f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() if !isLen1 { defer wg.Done() } @@ -20764,6 +22469,12 @@ func (ec *executionContext) marshalNPolicyEdge2ᚕᚖgithubᚗcomᚋgetproboᚋp } ctx := graphql.WithFieldContext(ctx, fc) f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() if !isLen1 { defer wg.Done() } @@ -21003,6 +22714,12 @@ func (ec *executionContext) marshalNTaskEdge2ᚕᚖgithubᚗcomᚋgetproboᚋpro } ctx := graphql.WithFieldContext(ctx, fc) f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() if !isLen1 { defer wg.Done() } @@ -21098,25 +22815,6 @@ func (ec *executionContext) marshalNUnassignTaskPayload2ᚖgithubᚗcomᚋgetpro return ec._UnassignTaskPayload(ctx, sel, v) } -func (ec *executionContext) unmarshalNUpdateControlInput2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateControlInput(ctx context.Context, v any) (types.UpdateControlInput, error) { - res, err := ec.unmarshalInputUpdateControlInput(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNUpdateControlPayload2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateControlPayload(ctx context.Context, sel ast.SelectionSet, v types.UpdateControlPayload) graphql.Marshaler { - return ec._UpdateControlPayload(ctx, sel, &v) -} - -func (ec *executionContext) marshalNUpdateControlPayload2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateControlPayload(ctx context.Context, sel ast.SelectionSet, v *types.UpdateControlPayload) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._UpdateControlPayload(ctx, sel, v) -} - func (ec *executionContext) unmarshalNUpdateFrameworkInput2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateFrameworkInput(ctx context.Context, v any) (types.UpdateFrameworkInput, error) { res, err := ec.unmarshalInputUpdateFrameworkInput(ctx, v) return res, graphql.ErrorOnPath(ctx, err) @@ -21136,6 +22834,25 @@ func (ec *executionContext) marshalNUpdateFrameworkPayload2ᚖgithubᚗcomᚋget return ec._UpdateFrameworkPayload(ctx, sel, v) } +func (ec *executionContext) unmarshalNUpdateMitigationInput2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateMitigationInput(ctx context.Context, v any) (types.UpdateMitigationInput, error) { + res, err := ec.unmarshalInputUpdateMitigationInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNUpdateMitigationPayload2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateMitigationPayload(ctx context.Context, sel ast.SelectionSet, v types.UpdateMitigationPayload) graphql.Marshaler { + return ec._UpdateMitigationPayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNUpdateMitigationPayload2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateMitigationPayload(ctx context.Context, sel ast.SelectionSet, v *types.UpdateMitigationPayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._UpdateMitigationPayload(ctx, sel, v) +} + func (ec *executionContext) unmarshalNUpdateOrganizationInput2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateOrganizationInput(ctx context.Context, v any) (types.UpdateOrganizationInput, error) { res, err := ec.unmarshalInputUpdateOrganizationInput(ctx, v) return res, graphql.ErrorOnPath(ctx, err) @@ -21304,6 +23021,12 @@ func (ec *executionContext) marshalNUserEdge2ᚕᚖgithubᚗcomᚋgetproboᚋpro } ctx := graphql.WithFieldContext(ctx, fc) f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() if !isLen1 { defer wg.Done() } @@ -21401,6 +23124,12 @@ func (ec *executionContext) marshalNVendorEdge2ᚕᚖgithubᚗcomᚋgetproboᚋp } ctx := graphql.WithFieldContext(ctx, fc) f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() if !isLen1 { defer wg.Done() } @@ -21483,6 +23212,12 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq } ctx := graphql.WithFieldContext(ctx, fc) f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() if !isLen1 { defer wg.Done() } @@ -21553,6 +23288,12 @@ func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context } ctx := graphql.WithFieldContext(ctx, fc) f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() if !isLen1 { defer wg.Done() } @@ -21603,6 +23344,12 @@ func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋg } ctx := graphql.WithFieldContext(ctx, fc) f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() if !isLen1 { defer wg.Done() } @@ -21645,6 +23392,12 @@ func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgen } ctx := graphql.WithFieldContext(ctx, fc) f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() if !isLen1 { defer wg.Done() } @@ -21719,76 +23472,6 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast return res } -func (ec *executionContext) unmarshalOControlImportance2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlImportance(ctx context.Context, v any) (*coredata.ControlImportance, error) { - if v == nil { - return nil, nil - } - tmp, err := graphql.UnmarshalString(v) - res := unmarshalOControlImportance2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlImportance[tmp] - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOControlImportance2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlImportance(ctx context.Context, sel ast.SelectionSet, v *coredata.ControlImportance) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalString(marshalOControlImportance2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlImportance[*v]) - return res -} - -var ( - unmarshalOControlImportance2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlImportance = map[string]coredata.ControlImportance{ - "MANDATORY": coredata.ControlImportanceMandatory, - "PREFERRED": coredata.ControlImportancePreferred, - "ADVANCED": coredata.ControlImportanceAdvanced, - } - marshalOControlImportance2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlImportance = map[coredata.ControlImportance]string{ - coredata.ControlImportanceMandatory: "MANDATORY", - coredata.ControlImportancePreferred: "PREFERRED", - coredata.ControlImportanceAdvanced: "ADVANCED", - } -) - -func (ec *executionContext) unmarshalOControlOrder2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐControlOrderBy(ctx context.Context, v any) (*types.ControlOrderBy, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputControlOrder(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) unmarshalOControlState2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlState(ctx context.Context, v any) (*coredata.ControlState, error) { - if v == nil { - return nil, nil - } - tmp, err := graphql.UnmarshalString(v) - res := unmarshalOControlState2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlState[tmp] - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOControlState2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlState(ctx context.Context, sel ast.SelectionSet, v *coredata.ControlState) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalString(marshalOControlState2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlState[*v]) - return res -} - -var ( - unmarshalOControlState2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlState = map[string]coredata.ControlState{ - "NOT_STARTED": coredata.ControlStateNotStarted, - "IN_PROGRESS": coredata.ControlStateInProgress, - "NOT_APPLICABLE": coredata.ControlStateNotApplicable, - "IMPLEMENTED": coredata.ControlStateImplemented, - } - marshalOControlState2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlState = map[coredata.ControlState]string{ - coredata.ControlStateNotStarted: "NOT_STARTED", - coredata.ControlStateInProgress: "IN_PROGRESS", - coredata.ControlStateNotApplicable: "NOT_APPLICABLE", - coredata.ControlStateImplemented: "IMPLEMENTED", - } -) - func (ec *executionContext) unmarshalOCursorKey2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋpageᚐCursorKey(ctx context.Context, v any) (*page.CursorKey, error) { if v == nil { return nil, nil @@ -21885,6 +23568,76 @@ func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.Sele return res } +func (ec *executionContext) unmarshalOMitigationImportance2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationImportance(ctx context.Context, v any) (*coredata.MitigationImportance, error) { + if v == nil { + return nil, nil + } + tmp, err := graphql.UnmarshalString(v) + res := unmarshalOMitigationImportance2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationImportance[tmp] + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOMitigationImportance2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationImportance(ctx context.Context, sel ast.SelectionSet, v *coredata.MitigationImportance) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalString(marshalOMitigationImportance2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationImportance[*v]) + return res +} + +var ( + unmarshalOMitigationImportance2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationImportance = map[string]coredata.MitigationImportance{ + "MANDATORY": coredata.MitigationImportanceMandatory, + "PREFERRED": coredata.MitigationImportancePreferred, + "ADVANCED": coredata.MitigationImportanceAdvanced, + } + marshalOMitigationImportance2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationImportance = map[coredata.MitigationImportance]string{ + coredata.MitigationImportanceMandatory: "MANDATORY", + coredata.MitigationImportancePreferred: "PREFERRED", + coredata.MitigationImportanceAdvanced: "ADVANCED", + } +) + +func (ec *executionContext) unmarshalOMitigationOrder2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐMitigationOrderBy(ctx context.Context, v any) (*types.MitigationOrderBy, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputMitigationOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOMitigationState2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationState(ctx context.Context, v any) (*coredata.MitigationState, error) { + if v == nil { + return nil, nil + } + tmp, err := graphql.UnmarshalString(v) + res := unmarshalOMitigationState2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationState[tmp] + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOMitigationState2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationState(ctx context.Context, sel ast.SelectionSet, v *coredata.MitigationState) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalString(marshalOMitigationState2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationState[*v]) + return res +} + +var ( + unmarshalOMitigationState2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationState = map[string]coredata.MitigationState{ + "NOT_STARTED": coredata.MitigationStateNotStarted, + "IN_PROGRESS": coredata.MitigationStateInProgress, + "NOT_APPLICABLE": coredata.MitigationStateNotApplicable, + "IMPLEMENTED": coredata.MitigationStateImplemented, + } + marshalOMitigationState2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐMitigationState = map[coredata.MitigationState]string{ + coredata.MitigationStateNotStarted: "NOT_STARTED", + coredata.MitigationStateInProgress: "IN_PROGRESS", + coredata.MitigationStateNotApplicable: "NOT_APPLICABLE", + coredata.MitigationStateImplemented: "IMPLEMENTED", + } +) + func (ec *executionContext) unmarshalOOrganizationOrder2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐOrganizationOrder(ctx context.Context, v any) (*types.OrganizationOrder, error) { if v == nil { return nil, nil @@ -22174,6 +23927,12 @@ func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgq } ctx := graphql.WithFieldContext(ctx, fc) f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() if !isLen1 { defer wg.Done() } @@ -22215,6 +23974,12 @@ func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgen } ctx := graphql.WithFieldContext(ctx, fc) f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() if !isLen1 { defer wg.Done() } @@ -22256,6 +24021,12 @@ func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋg } ctx := graphql.WithFieldContext(ctx, fc) f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() if !isLen1 { defer wg.Done() } @@ -22304,6 +24075,12 @@ func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgen } ctx := graphql.WithFieldContext(ctx, fc) f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() if !isLen1 { defer wg.Done() } diff --git a/pkg/server/api/console/v1/types/control.go b/pkg/server/api/console/v1/types/mitigation.go similarity index 69% rename from pkg/server/api/console/v1/types/control.go rename to pkg/server/api/console/v1/types/mitigation.go index f518fd8e7..f57b3baa8 100644 --- a/pkg/server/api/console/v1/types/control.go +++ b/pkg/server/api/console/v1/types/mitigation.go @@ -20,31 +20,31 @@ import ( ) type ( - ControlOrderBy OrderBy[coredata.ControlOrderField] + MitigationOrderBy OrderBy[coredata.MitigationOrderField] ) -func NewControlConnection(p *page.Page[*coredata.Control, coredata.ControlOrderField]) *ControlConnection { - var edges = make([]*ControlEdge, len(p.Data)) +func NewMitigationConnection(p *page.Page[*coredata.Mitigation, coredata.MitigationOrderField]) *MitigationConnection { + var edges = make([]*MitigationEdge, len(p.Data)) for i := range edges { - edges[i] = NewControlEdge(p.Data[i], p.Cursor.OrderBy.Field) + edges[i] = NewMitigationEdge(p.Data[i], p.Cursor.OrderBy.Field) } - return &ControlConnection{ + return &MitigationConnection{ Edges: edges, PageInfo: NewPageInfo(p), } } -func NewControlEdge(c *coredata.Control, orderBy coredata.ControlOrderField) *ControlEdge { - return &ControlEdge{ +func NewMitigationEdge(c *coredata.Mitigation, orderBy coredata.MitigationOrderField) *MitigationEdge { + return &MitigationEdge{ Cursor: c.CursorKey(orderBy), - Node: NewControl(c), + Node: NewMitigation(c), } } -func NewControl(c *coredata.Control) *Control { - return &Control{ +func NewMitigation(c *coredata.Mitigation) *Mitigation { + return &Mitigation{ ID: c.ID, Version: c.Version, Category: c.Category, diff --git a/pkg/server/api/console/v1/types/types.go b/pkg/server/api/console/v1/types/types.go index 30e4b8a86..4630348a8 100644 --- a/pkg/server/api/console/v1/types/types.go +++ b/pkg/server/api/console/v1/types/types.go @@ -36,44 +36,6 @@ type ConfirmEmailPayload struct { Success bool `json:"success"` } -type Control struct { - ID gid.GID `json:"id"` - Version int `json:"version"` - Category string `json:"category"` - Name string `json:"name"` - Description string `json:"description"` - State coredata.ControlState `json:"state"` - Importance coredata.ControlImportance `json:"importance"` - Tasks *TaskConnection `json:"tasks"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` -} - -func (Control) IsNode() {} -func (this Control) GetID() gid.GID { return this.ID } - -type ControlConnection struct { - Edges []*ControlEdge `json:"edges"` - PageInfo *PageInfo `json:"pageInfo"` -} - -type ControlEdge struct { - Cursor page.CursorKey `json:"cursor"` - Node *Control `json:"node"` -} - -type CreateControlInput struct { - FrameworkID gid.GID `json:"frameworkId"` - Name string `json:"name"` - Description string `json:"description"` - Category string `json:"category"` - Importance coredata.ControlImportance `json:"importance"` -} - -type CreateControlPayload struct { - ControlEdge *ControlEdge `json:"controlEdge"` -} - type CreateFrameworkInput struct { OrganizationID gid.GID `json:"organizationId"` Name string `json:"name"` @@ -84,6 +46,18 @@ type CreateFrameworkPayload struct { FrameworkEdge *FrameworkEdge `json:"frameworkEdge"` } +type CreateMitigationInput struct { + FrameworkID gid.GID `json:"frameworkId"` + Name string `json:"name"` + Description string `json:"description"` + Category string `json:"category"` + Importance coredata.MitigationImportance `json:"importance"` +} + +type CreateMitigationPayload struct { + MitigationEdge *MitigationEdge `json:"mitigationEdge"` +} + type CreateOrganizationInput struct { Name string `json:"name"` } @@ -118,7 +92,7 @@ type CreatePolicyPayload struct { } type CreateTaskInput struct { - ControlID gid.GID `json:"controlId"` + MitigationID gid.GID `json:"mitigationId"` Name string `json:"name"` Description string `json:"description"` TimeEstimate *time.Duration `json:"timeEstimate,omitempty"` @@ -222,13 +196,13 @@ type EvidenceEdge struct { } type Framework struct { - ID gid.GID `json:"id"` - Version int `json:"version"` - Name string `json:"name"` - Description string `json:"description"` - Controls *ControlConnection `json:"controls"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` + ID gid.GID `json:"id"` + Version int `json:"version"` + Name string `json:"name"` + Description string `json:"description"` + Mitigations *MitigationConnection `json:"mitigations"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` } func (Framework) IsNode() {} @@ -263,6 +237,32 @@ type InviteUserPayload struct { Success bool `json:"success"` } +type Mitigation struct { + ID gid.GID `json:"id"` + Version int `json:"version"` + Category string `json:"category"` + Name string `json:"name"` + Description string `json:"description"` + State coredata.MitigationState `json:"state"` + Importance coredata.MitigationImportance `json:"importance"` + Tasks *TaskConnection `json:"tasks"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` +} + +func (Mitigation) IsNode() {} +func (this Mitigation) GetID() gid.GID { return this.ID } + +type MitigationConnection struct { + Edges []*MitigationEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` +} + +type MitigationEdge struct { + Cursor page.CursorKey `json:"cursor"` + Node *Mitigation `json:"node"` +} + type Mutation struct { } @@ -404,20 +404,6 @@ type UnassignTaskPayload struct { Task *Task `json:"task"` } -type UpdateControlInput struct { - ID gid.GID `json:"id"` - ExpectedVersion int `json:"expectedVersion"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - Category *string `json:"category,omitempty"` - State *coredata.ControlState `json:"state,omitempty"` - Importance *coredata.ControlImportance `json:"importance,omitempty"` -} - -type UpdateControlPayload struct { - Control *Control `json:"control"` -} - type UpdateFrameworkInput struct { ID gid.GID `json:"id"` ExpectedVersion int `json:"expectedVersion"` @@ -429,6 +415,20 @@ type UpdateFrameworkPayload struct { Framework *Framework `json:"framework"` } +type UpdateMitigationInput struct { + ID gid.GID `json:"id"` + ExpectedVersion int `json:"expectedVersion"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Category *string `json:"category,omitempty"` + State *coredata.MitigationState `json:"state,omitempty"` + Importance *coredata.MitigationImportance `json:"importance,omitempty"` +} + +type UpdateMitigationPayload struct { + Mitigation *Mitigation `json:"mitigation"` +} + type UpdateOrganizationInput struct { OrganizationID gid.GID `json:"organizationId"` Name *string `json:"name,omitempty"` diff --git a/pkg/server/api/console/v1/v1_resolver.go b/pkg/server/api/console/v1/v1_resolver.go index e3041104d..619d2a44d 100644 --- a/pkg/server/api/console/v1/v1_resolver.go +++ b/pkg/server/api/console/v1/v1_resolver.go @@ -19,31 +19,6 @@ import ( "github.com/vektah/gqlparser/v2/gqlerror" ) -// Tasks is the resolver for the tasks field. -func (r *controlResolver) Tasks(ctx context.Context, obj *types.Control, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.TaskOrderBy) (*types.TaskConnection, error) { - svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID()) - - pageOrderBy := page.OrderBy[coredata.TaskOrderField]{ - Field: coredata.TaskOrderFieldCreatedAt, - Direction: page.OrderDirectionDesc, - } - if orderBy != nil { - pageOrderBy = page.OrderBy[coredata.TaskOrderField]{ - Field: orderBy.Field, - Direction: orderBy.Direction, - } - } - - cursor := types.NewCursor(first, after, last, before, pageOrderBy) - - page, err := svc.Tasks.ListForControlID(ctx, obj.ID, cursor) - if err != nil { - return nil, fmt.Errorf("cannot list control tasks: %w", err) - } - - return types.NewTaskConnection(page), nil -} - // FileURL is the resolver for the fileUrl field. func (r *evidenceResolver) FileURL(ctx context.Context, obj *types.Evidence) (*string, error) { svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID()) @@ -61,16 +36,40 @@ func (r *evidenceResolver) FileURL(ctx context.Context, obj *types.Evidence) (*s return &result, nil } -// Controls is the resolver for the controls field. -func (r *frameworkResolver) Controls(ctx context.Context, obj *types.Framework, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ControlOrderBy) (*types.ControlConnection, error) { +// Mitigations is the resolver for the mitigations field. +func (r *frameworkResolver) Mitigations(ctx context.Context, obj *types.Framework, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MitigationOrderBy) (*types.MitigationConnection, error) { svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID()) - pageOrderBy := page.OrderBy[coredata.ControlOrderField]{ - Field: coredata.ControlOrderFieldCreatedAt, + pageOrderBy := page.OrderBy[coredata.MitigationOrderField]{ + Field: coredata.MitigationOrderFieldCreatedAt, Direction: page.OrderDirectionDesc, } if orderBy != nil { - pageOrderBy = page.OrderBy[coredata.ControlOrderField]{ + pageOrderBy = page.OrderBy[coredata.MitigationOrderField]{ + Field: orderBy.Field, + Direction: orderBy.Direction, + } + } + + cursor := types.NewCursor(first, after, last, before, pageOrderBy) + page, err := svc.Mitigations.ListForFrameworkID(ctx, obj.ID, cursor) + if err != nil { + return nil, fmt.Errorf("cannot list framework mitigations: %w", err) + } + + return types.NewMitigationConnection(page), nil +} + +// Tasks is the resolver for the tasks field. +func (r *mitigationResolver) Tasks(ctx context.Context, obj *types.Mitigation, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.TaskOrderBy) (*types.TaskConnection, error) { + svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID()) + + pageOrderBy := page.OrderBy[coredata.TaskOrderField]{ + Field: coredata.TaskOrderFieldCreatedAt, + Direction: page.OrderDirectionDesc, + } + if orderBy != nil { + pageOrderBy = page.OrderBy[coredata.TaskOrderField]{ Field: orderBy.Field, Direction: orderBy.Direction, } @@ -78,12 +77,12 @@ func (r *frameworkResolver) Controls(ctx context.Context, obj *types.Framework, cursor := types.NewCursor(first, after, last, before, pageOrderBy) - page, err := svc.Controls.ListForFrameworkID(ctx, obj.ID, cursor) + page, err := svc.Tasks.ListForMitigationID(ctx, obj.ID, cursor) if err != nil { - return nil, fmt.Errorf("cannot list framework controls: %w", err) + return nil, fmt.Errorf("cannot list mitigation tasks: %w", err) } - return types.NewControlConnection(page), nil + return types.NewTaskConnection(page), nil } // CreateVendor is the resolver for the createVendor field. @@ -260,10 +259,10 @@ func (r *mutationResolver) DeleteOrganization(ctx context.Context, input types.D // CreateTask is the resolver for the createTask field. func (r *mutationResolver) CreateTask(ctx context.Context, input types.CreateTaskInput) (*types.CreateTaskPayload, error) { - svc := r.GetTenantServiceIfAuthorized(ctx, input.ControlID.TenantID()) + svc := r.GetTenantServiceIfAuthorized(ctx, input.MitigationID.TenantID()) task, err := svc.Tasks.Create(ctx, probo.CreateTaskRequest{ - ControlID: input.ControlID, + MitigationID: input.MitigationID, Name: input.Name, Description: input.Description, TimeEstimate: input.TimeEstimate, @@ -282,7 +281,7 @@ func (r *mutationResolver) UpdateTask(ctx context.Context, input types.UpdateTas svc := r.GetTenantServiceIfAuthorized(ctx, input.TaskID.TenantID()) task, err := svc.Tasks.Update(ctx, probo.UpdateTaskRequest{ - ID: input.TaskID, + TaskID: input.TaskID, ExpectedVersion: input.ExpectedVersion, Name: input.Name, Description: input.Description, @@ -396,11 +395,11 @@ func (r *mutationResolver) ImportFramework(ctx context.Context, input types.Impo }, nil } -// CreateControl is the resolver for the createControl field. -func (r *mutationResolver) CreateControl(ctx context.Context, input types.CreateControlInput) (*types.CreateControlPayload, error) { +// CreateMitigation is the resolver for the createMitigation field. +func (r *mutationResolver) CreateMitigation(ctx context.Context, input types.CreateMitigationInput) (*types.CreateMitigationPayload, error) { svc := r.GetTenantServiceIfAuthorized(ctx, input.FrameworkID.TenantID()) - control, err := svc.Controls.Create(ctx, probo.CreateControlRequest{ + mitigation, err := svc.Mitigations.Create(ctx, probo.CreateMitigationRequest{ FrameworkID: input.FrameworkID, Name: input.Name, Description: input.Description, @@ -408,33 +407,33 @@ func (r *mutationResolver) CreateControl(ctx context.Context, input types.Create Importance: input.Importance, }) if err != nil { - return nil, fmt.Errorf("cannot create control: %w", err) + panic(fmt.Errorf("cannot create mitigation: %w", err)) } - return &types.CreateControlPayload{ - ControlEdge: types.NewControlEdge(control, coredata.ControlOrderFieldCreatedAt), + return &types.CreateMitigationPayload{ + MitigationEdge: types.NewMitigationEdge(mitigation, coredata.MitigationOrderFieldCreatedAt), }, nil } -// UpdateControl is the resolver for the updateControl field. -func (r *mutationResolver) UpdateControl(ctx context.Context, input types.UpdateControlInput) (*types.UpdateControlPayload, error) { +// UpdateMitigation is the resolver for the updateMitigation field. +func (r *mutationResolver) UpdateMitigation(ctx context.Context, input types.UpdateMitigationInput) (*types.UpdateMitigationPayload, error) { svc := r.GetTenantServiceIfAuthorized(ctx, input.ID.TenantID()) - control, err := svc.Controls.Update(ctx, probo.UpdateControlRequest{ + mitigation, err := svc.Mitigations.Update(ctx, probo.UpdateMitigationRequest{ ID: input.ID, ExpectedVersion: input.ExpectedVersion, Name: input.Name, Description: input.Description, Category: input.Category, - State: input.State, Importance: input.Importance, + State: input.State, }) if err != nil { - return nil, fmt.Errorf("cannot update control: %w", err) + panic(fmt.Errorf("cannot update mitigation: %w", err)) } - return &types.UpdateControlPayload{ - Control: types.NewControl(control), + return &types.UpdateMitigationPayload{ + Mitigation: types.NewMitigation(mitigation), }, nil } @@ -785,13 +784,13 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error } return types.NewFramework(framework), nil - case coredata.ControlEntityType: - control, err := svc.Controls.Get(ctx, id) + case coredata.MitigationEntityType: + mitigation, err := svc.Mitigations.Get(ctx, id) if err != nil { return nil, err } - return types.NewControl(control), nil + return types.NewMitigation(mitigation), nil case coredata.TaskEntityType: task, err := svc.Tasks.Get(ctx, id) if err != nil { @@ -838,11 +837,11 @@ func (r *taskResolver) AssignedTo(ctx context.Context, obj *types.Task) (*types. return nil, fmt.Errorf("cannot get task: %w", err) } - if task.AssignedTo == nil { + if task.AssignedToID == nil { return nil, nil } - people, err := svc.Peoples.Get(ctx, *task.AssignedTo) + people, err := svc.Peoples.Get(ctx, *task.AssignedToID) if err != nil { return nil, fmt.Errorf("cannot get assigned to: %w", err) } @@ -899,15 +898,15 @@ func (r *viewerResolver) Organizations(ctx context.Context, obj *types.Viewer, f }, nil } -// Control returns schema.ControlResolver implementation. -func (r *Resolver) Control() schema.ControlResolver { return &controlResolver{r} } - // Evidence returns schema.EvidenceResolver implementation. func (r *Resolver) Evidence() schema.EvidenceResolver { return &evidenceResolver{r} } // Framework returns schema.FrameworkResolver implementation. func (r *Resolver) Framework() schema.FrameworkResolver { return &frameworkResolver{r} } +// Mitigation returns schema.MitigationResolver implementation. +func (r *Resolver) Mitigation() schema.MitigationResolver { return &mitigationResolver{r} } + // Mutation returns schema.MutationResolver implementation. func (r *Resolver) Mutation() schema.MutationResolver { return &mutationResolver{r} } @@ -926,9 +925,9 @@ func (r *Resolver) Task() schema.TaskResolver { return &taskResolver{r} } // Viewer returns schema.ViewerResolver implementation. func (r *Resolver) Viewer() schema.ViewerResolver { return &viewerResolver{r} } -type controlResolver struct{ *Resolver } type evidenceResolver struct{ *Resolver } type frameworkResolver struct{ *Resolver } +type mitigationResolver struct{ *Resolver } type mutationResolver struct{ *Resolver } type organizationResolver struct{ *Resolver } type policyResolver struct{ *Resolver }
Status Control + Mitigation +
- {control.importance} + {mitigation.importance}
- {control.status - ? getStatusIcon(control.status) + {mitigation.status + ? getStatusIcon(mitigation.status) : null}
- {control.name} + {mitigation.name}