Add SOA generator

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-06-04 18:44:18 -07:00
parent 3d734a08cb
commit c41d7439d1
11 changed files with 1280 additions and 340 deletions

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<bc0fdc02fb8b596386e290ae0cf0b8b8>>
* @generated SignedSource<<e7dfc0de7524eaa22ca235ac0b6e3011>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -11,7 +11,7 @@
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type OrderDirection = "ASC" | "DESC";
export type PeopleOrderField = "CREATED_AT" | "FULL_NAME";
export type PeopleOrderField = "CREATED_AT" | "FULL_NAME" | "KIND";
export type PeopleOrder = {
direction: OrderDirection;
field: PeopleOrderField;

View File

@@ -26,8 +26,13 @@ import { Navigate, Outlet, useNavigate, useParams } from "react-router";
import { useOrganizationId } from "/hooks/useOrganizationId";
import type { FrameworkGraphNodeQuery } from "/hooks/graph/__generated__/FrameworkGraphNodeQuery.graphql";
import type { FrameworkDetailPageFragment$key } from "./__generated__/FrameworkDetailPageFragment.graphql";
import type {
FrameworkDetailPageGenerateFrameworkStateOfApplicabilityMutation,
FrameworkDetailPageGenerateFrameworkStateOfApplicabilityMutation$data,
} from "./__generated__/FrameworkDetailPageGenerateFrameworkStateOfApplicabilityMutation.graphql";
import { FrameworkFormDialog } from "./dialogs/FrameworkFormDialog";
import { FrameworkControlDialog } from "./dialogs/FrameworkControlDialog";
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
const frameworkDetailFragment = graphql`
fragment FrameworkDetailPageFragment on Framework {
@@ -47,6 +52,18 @@ const frameworkDetailFragment = graphql`
}
`;
const generateFrameworkStateOfApplicabilityMutation = graphql`
mutation FrameworkDetailPageGenerateFrameworkStateOfApplicabilityMutation(
$frameworkId: ID!
) {
generateFrameworkStateOfApplicability(
input: { frameworkId: $frameworkId }
) {
downloadUrl
}
}
`;
type Props = {
queryRef: PreloadedQuery<FrameworkGraphNodeQuery>;
};
@@ -71,6 +88,16 @@ export default function FrameworkDetailPage(props: Props) {
ConnectionHandler.getConnectionID(organizationId, connectionListKey)!
);
const [generateFrameworkStateOfApplicability] =
useMutationWithToasts<FrameworkDetailPageGenerateFrameworkStateOfApplicabilityMutation>(
generateFrameworkStateOfApplicabilityMutation,
{
errorMessage: "Failed to generate framework state of applicability",
successMessage:
"Framework state of applicability generated successfully",
}
);
usePageTitle(`${framework.name} | ${selectedControl?.sectionTitle}`);
const onDelete = () => {
deleteFramework({
@@ -107,6 +134,29 @@ export default function FrameworkDetailPage(props: Props) {
</Button>
</FrameworkFormDialog>
<ActionDropdown variant="secondary">
<DropdownItem
variant="primary"
onClick={() => {
generateFrameworkStateOfApplicability({
variables: { frameworkId: framework.id },
onCompleted: (
data: FrameworkDetailPageGenerateFrameworkStateOfApplicabilityMutation$data
) => {
if (data.generateFrameworkStateOfApplicability.downloadUrl) {
const link = document.createElement("a");
link.href =
data.generateFrameworkStateOfApplicability.downloadUrl;
link.download = `${framework.name}-SOA.pdf`; // You can adjust the filename as needed
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
},
});
}}
>
{__("Download SOA")}
</DropdownItem>
<DropdownItem icon={IconTrashCan} variant="danger" onClick={onDelete}>
{__("Delete")}
</DropdownItem>

View File

@@ -0,0 +1,95 @@
/**
* @generated SignedSource<<bcdaed0c84805f387ee7d1de8ece0068>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type FrameworkDetailPageGenerateFrameworkStateOfApplicabilityMutation$variables = {
frameworkId: string;
};
export type FrameworkDetailPageGenerateFrameworkStateOfApplicabilityMutation$data = {
readonly generateFrameworkStateOfApplicability: {
readonly downloadUrl: string;
};
};
export type FrameworkDetailPageGenerateFrameworkStateOfApplicabilityMutation = {
response: FrameworkDetailPageGenerateFrameworkStateOfApplicabilityMutation$data;
variables: FrameworkDetailPageGenerateFrameworkStateOfApplicabilityMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "frameworkId"
}
],
v1 = [
{
"alias": null,
"args": [
{
"fields": [
{
"kind": "Variable",
"name": "frameworkId",
"variableName": "frameworkId"
}
],
"kind": "ObjectValue",
"name": "input"
}
],
"concreteType": "GenerateFrameworkStateOfApplicabilityPayload",
"kind": "LinkedField",
"name": "generateFrameworkStateOfApplicability",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "downloadUrl",
"storageKey": null
}
],
"storageKey": null
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "FrameworkDetailPageGenerateFrameworkStateOfApplicabilityMutation",
"selections": (v1/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "FrameworkDetailPageGenerateFrameworkStateOfApplicabilityMutation",
"selections": (v1/*: any*/)
},
"params": {
"cacheID": "338cbffe84fb19cdf46c97b739216342",
"id": null,
"metadata": {},
"name": "FrameworkDetailPageGenerateFrameworkStateOfApplicabilityMutation",
"operationKind": "mutation",
"text": "mutation FrameworkDetailPageGenerateFrameworkStateOfApplicabilityMutation(\n $frameworkId: ID!\n) {\n generateFrameworkStateOfApplicability(input: {frameworkId: $frameworkId}) {\n downloadUrl\n }\n}\n"
}
};
})();
(node as any).hash = "f5c0a7d2bebedecc3de7d55d52f06cd8";
export default node;

6
go.mod
View File

@@ -18,6 +18,7 @@ require (
github.com/openai/openai-go v1.1.0
github.com/prometheus/client_golang v1.22.0
github.com/vektah/gqlparser/v2 v2.5.27
github.com/xuri/excelize/v2 v2.9.1
go.gearno.de/crypto/uuid v0.1.0
go.gearno.de/kit v0.0.0-20250623163305-45b4f6905899
go.gearno.de/x/ref v0.0.0-20240502200927-d74926fcb14c
@@ -61,6 +62,8 @@ require (
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.64.0 // indirect
github.com/prometheus/procfs v0.16.1 // indirect
github.com/richardlehane/mscfb v1.0.4 // indirect
github.com/richardlehane/msoleps v1.0.4 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sosodev/duration v1.3.1 // indirect
@@ -69,8 +72,11 @@ require (
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/sjson v1.2.5 // indirect
github.com/tiendc/go-deepcopy v1.6.0 // indirect
github.com/urfave/cli/v2 v2.27.6 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
github.com/xuri/efp v0.0.1 // indirect
github.com/xuri/nfp v0.0.1 // indirect
go.gearno.de/x/panicf v0.1.1 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 // indirect

15
go.sum
View File

@@ -120,6 +120,11 @@ github.com/prometheus/common v0.64.0 h1:pdZeA+g617P7oGv1CzdTzyeShxAGrTBsolKNOLQP
github.com/prometheus/common v0.64.0/go.mod h1:0gZns+BLRQ3V6NdaerOhMbwwRbNh9hkGINtQAsP5GS8=
github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg=
github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is=
github.com/richardlehane/mscfb v1.0.4 h1:WULscsljNPConisD5hR0+OyZjwK46Pfyr6mPu5ZawpM=
github.com/richardlehane/mscfb v1.0.4/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk=
github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
github.com/richardlehane/msoleps v1.0.4 h1:WuESlvhX3gH2IHcd8UqyCuFY5yiq/GR/yqaSM/9/g00=
github.com/richardlehane/msoleps v1.0.4/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
@@ -150,12 +155,20 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
github.com/tiendc/go-deepcopy v1.6.0 h1:0UtfV/imoCwlLxVsyfUd4hNHnB3drXsfle+wzSCA5Wo=
github.com/tiendc/go-deepcopy v1.6.0/go.mod h1:toXoeQoUqXOOS/X4sKuiAoSk6elIdqc0pN7MTgOOo2I=
github.com/urfave/cli/v2 v2.27.6 h1:VdRdS98FNhKZ8/Az8B7MTyGQmpIr36O1EHybx/LaZ4g=
github.com/urfave/cli/v2 v2.27.6/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
github.com/vektah/gqlparser/v2 v2.5.27 h1:RHPD3JOplpk5mP5JGX8RKZkt2/Vwj/PZv0HxTdwFp0s=
github.com/vektah/gqlparser/v2 v2.5.27/go.mod h1:D1/VCZtV3LPnQrcPBeR/q5jkSQIPti0uYCP/RI0gIeo=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
github.com/xuri/efp v0.0.1 h1:fws5Rv3myXyYni8uwj2qKjVaRP30PdjeYe2Y6FDsCL8=
github.com/xuri/efp v0.0.1/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
github.com/xuri/excelize/v2 v2.9.1 h1:VdSGk+rraGmgLHGFaGG9/9IWu1nj4ufjJ7uwMDtj8Qw=
github.com/xuri/excelize/v2 v2.9.1/go.mod h1:x7L6pKz2dvo9ejrRuD8Lnl98z4JLt0TGAwjhW+EiP8s=
github.com/xuri/nfp v0.0.1 h1:MDamSGatIvp8uOmDP8FnmjuQpu90NzdJxo7242ANR9Q=
github.com/xuri/nfp v0.0.1/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ=
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-20250623163305-45b4f6905899 h1:g44W/Fhm5bW7fhMqr874dJKOuHHsRhv6Tr3h6yHLcqY=
@@ -186,6 +199,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ=
golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs=
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=

File diff suppressed because it is too large Load Diff

View File

@@ -22,6 +22,7 @@ import (
"errors"
"fmt"
"net/http"
"runtime/debug"
"strings"
"time"
@@ -234,7 +235,7 @@ func graphqlHandler(logger *log.Logger, proboSvc *probo.Service, usrmgrSvc *usrm
srv.Use(tracingExtension{})
srv.SetRecoverFunc(func(ctx context.Context, err any) error {
logger := httpserver.LoggerFromContext(ctx)
logger.Error("resolver panic", log.Any("error", err))
logger.Error("resolver panic", log.Any("error", err), log.Any("stack", string(debug.Stack())))
return errors.New("internal server error")
})

View File

@@ -1289,6 +1289,9 @@ type Mutation {
updateFramework(input: UpdateFrameworkInput!): UpdateFrameworkPayload!
importFramework(input: ImportFrameworkInput!): ImportFrameworkPayload!
deleteFramework(input: DeleteFrameworkInput!): DeleteFrameworkPayload!
generateFrameworkStateOfApplicability(
input: GenerateFrameworkStateOfApplicabilityInput!
): GenerateFrameworkStateOfApplicabilityPayload!
# Control mutations
createControl(input: CreateControlInput!): CreateControlPayload!
@@ -1398,6 +1401,14 @@ type Mutation {
}
# Input Types
input GenerateFrameworkStateOfApplicabilityInput {
frameworkId: ID!
}
type GenerateFrameworkStateOfApplicabilityPayload {
downloadUrl: String!
}
input CreateOrganizationInput {
name: String!
}

View File

@@ -456,6 +456,10 @@ type ComplexityRoot struct {
Changelog func(childComplexity int) int
}
GenerateFrameworkStateOfApplicabilityPayload struct {
DownloadURL func(childComplexity int) int
}
ImportFrameworkPayload struct {
FrameworkEdge func(childComplexity int) int
}
@@ -494,69 +498,70 @@ type ComplexityRoot struct {
}
Mutation struct {
AssessVendor func(childComplexity int, input types.AssessVendorInput) int
AssignTask func(childComplexity int, input types.AssignTaskInput) int
ConfirmEmail func(childComplexity int, input types.ConfirmEmailInput) int
CreateAsset func(childComplexity int, input types.CreateAssetInput) int
CreateControl func(childComplexity int, input types.CreateControlInput) int
CreateControlDocumentMapping func(childComplexity int, input types.CreateControlDocumentMappingInput) int
CreateControlMeasureMapping func(childComplexity int, input types.CreateControlMeasureMappingInput) int
CreateDatum func(childComplexity int, input types.CreateDatumInput) int
CreateDocument func(childComplexity int, input types.CreateDocumentInput) int
CreateDraftDocumentVersion func(childComplexity int, input types.CreateDraftDocumentVersionInput) int
CreateFramework func(childComplexity int, input types.CreateFrameworkInput) int
CreateMeasure func(childComplexity int, input types.CreateMeasureInput) int
CreateOrganization func(childComplexity int, input types.CreateOrganizationInput) int
CreatePeople func(childComplexity int, input types.CreatePeopleInput) int
CreateRisk func(childComplexity int, input types.CreateRiskInput) int
CreateRiskDocumentMapping func(childComplexity int, input types.CreateRiskDocumentMappingInput) int
CreateRiskMeasureMapping func(childComplexity int, input types.CreateRiskMeasureMappingInput) int
CreateTask func(childComplexity int, input types.CreateTaskInput) int
CreateVendor func(childComplexity int, input types.CreateVendorInput) int
CreateVendorRiskAssessment func(childComplexity int, input types.CreateVendorRiskAssessmentInput) int
DeleteAsset func(childComplexity int, input types.DeleteAssetInput) int
DeleteControl func(childComplexity int, input types.DeleteControlInput) int
DeleteControlDocumentMapping func(childComplexity int, input types.DeleteControlDocumentMappingInput) int
DeleteControlMeasureMapping func(childComplexity int, input types.DeleteControlMeasureMappingInput) int
DeleteDatum func(childComplexity int, input types.DeleteDatumInput) int
DeleteDocument func(childComplexity int, input types.DeleteDocumentInput) int
DeleteEvidence func(childComplexity int, input types.DeleteEvidenceInput) int
DeleteFramework func(childComplexity int, input types.DeleteFrameworkInput) int
DeleteMeasure func(childComplexity int, input types.DeleteMeasureInput) int
DeletePeople func(childComplexity int, input types.DeletePeopleInput) int
DeleteRisk func(childComplexity int, input types.DeleteRiskInput) int
DeleteRiskDocumentMapping func(childComplexity int, input types.DeleteRiskDocumentMappingInput) int
DeleteRiskMeasureMapping func(childComplexity int, input types.DeleteRiskMeasureMappingInput) int
DeleteTask func(childComplexity int, input types.DeleteTaskInput) int
DeleteVendor func(childComplexity int, input types.DeleteVendorInput) int
DeleteVendorComplianceReport func(childComplexity int, input types.DeleteVendorComplianceReportInput) int
ExportAudit func(childComplexity int, input types.ExportAuditInput) int
FulfillEvidence func(childComplexity int, input types.FulfillEvidenceInput) int
GenerateDocumentChangelog func(childComplexity int, input types.GenerateDocumentChangelogInput) int
ImportFramework func(childComplexity int, input types.ImportFrameworkInput) int
ImportMeasure func(childComplexity int, input types.ImportMeasureInput) int
InviteUser func(childComplexity int, input types.InviteUserInput) int
PublishDocumentVersion func(childComplexity int, input types.PublishDocumentVersionInput) int
RemoveUser func(childComplexity int, input types.RemoveUserInput) int
RequestEvidence func(childComplexity int, input types.RequestEvidenceInput) int
RequestSignature func(childComplexity int, input types.RequestSignatureInput) int
SendSigningNotifications func(childComplexity int, input types.SendSigningNotificationsInput) int
UnassignTask func(childComplexity int, input types.UnassignTaskInput) int
UpdateAsset func(childComplexity int, input types.UpdateAssetInput) int
UpdateControl func(childComplexity int, input types.UpdateControlInput) int
UpdateDatum func(childComplexity int, input types.UpdateDatumInput) int
UpdateDocument func(childComplexity int, input types.UpdateDocumentInput) int
UpdateDocumentVersion func(childComplexity int, input types.UpdateDocumentVersionInput) int
UpdateFramework func(childComplexity int, input types.UpdateFrameworkInput) int
UpdateMeasure func(childComplexity int, input types.UpdateMeasureInput) int
UpdateOrganization func(childComplexity int, input types.UpdateOrganizationInput) int
UpdatePeople func(childComplexity int, input types.UpdatePeopleInput) int
UpdateRisk func(childComplexity int, input types.UpdateRiskInput) int
UpdateTask func(childComplexity int, input types.UpdateTaskInput) int
UpdateVendor func(childComplexity int, input types.UpdateVendorInput) int
UploadMeasureEvidence func(childComplexity int, input types.UploadMeasureEvidenceInput) int
UploadTaskEvidence func(childComplexity int, input types.UploadTaskEvidenceInput) int
UploadVendorComplianceReport func(childComplexity int, input types.UploadVendorComplianceReportInput) int
AssessVendor func(childComplexity int, input types.AssessVendorInput) int
AssignTask func(childComplexity int, input types.AssignTaskInput) int
ConfirmEmail func(childComplexity int, input types.ConfirmEmailInput) int
CreateAsset func(childComplexity int, input types.CreateAssetInput) int
CreateControl func(childComplexity int, input types.CreateControlInput) int
CreateControlDocumentMapping func(childComplexity int, input types.CreateControlDocumentMappingInput) int
CreateControlMeasureMapping func(childComplexity int, input types.CreateControlMeasureMappingInput) int
CreateDatum func(childComplexity int, input types.CreateDatumInput) int
CreateDocument func(childComplexity int, input types.CreateDocumentInput) int
CreateDraftDocumentVersion func(childComplexity int, input types.CreateDraftDocumentVersionInput) int
CreateFramework func(childComplexity int, input types.CreateFrameworkInput) int
CreateMeasure func(childComplexity int, input types.CreateMeasureInput) int
CreateOrganization func(childComplexity int, input types.CreateOrganizationInput) int
CreatePeople func(childComplexity int, input types.CreatePeopleInput) int
CreateRisk func(childComplexity int, input types.CreateRiskInput) int
CreateRiskDocumentMapping func(childComplexity int, input types.CreateRiskDocumentMappingInput) int
CreateRiskMeasureMapping func(childComplexity int, input types.CreateRiskMeasureMappingInput) int
CreateTask func(childComplexity int, input types.CreateTaskInput) int
CreateVendor func(childComplexity int, input types.CreateVendorInput) int
CreateVendorRiskAssessment func(childComplexity int, input types.CreateVendorRiskAssessmentInput) int
DeleteAsset func(childComplexity int, input types.DeleteAssetInput) int
DeleteControl func(childComplexity int, input types.DeleteControlInput) int
DeleteControlDocumentMapping func(childComplexity int, input types.DeleteControlDocumentMappingInput) int
DeleteControlMeasureMapping func(childComplexity int, input types.DeleteControlMeasureMappingInput) int
DeleteDatum func(childComplexity int, input types.DeleteDatumInput) int
DeleteDocument func(childComplexity int, input types.DeleteDocumentInput) int
DeleteEvidence func(childComplexity int, input types.DeleteEvidenceInput) int
DeleteFramework func(childComplexity int, input types.DeleteFrameworkInput) int
DeleteMeasure func(childComplexity int, input types.DeleteMeasureInput) int
DeletePeople func(childComplexity int, input types.DeletePeopleInput) int
DeleteRisk func(childComplexity int, input types.DeleteRiskInput) int
DeleteRiskDocumentMapping func(childComplexity int, input types.DeleteRiskDocumentMappingInput) int
DeleteRiskMeasureMapping func(childComplexity int, input types.DeleteRiskMeasureMappingInput) int
DeleteTask func(childComplexity int, input types.DeleteTaskInput) int
DeleteVendor func(childComplexity int, input types.DeleteVendorInput) int
DeleteVendorComplianceReport func(childComplexity int, input types.DeleteVendorComplianceReportInput) int
ExportAudit func(childComplexity int, input types.ExportAuditInput) int
FulfillEvidence func(childComplexity int, input types.FulfillEvidenceInput) int
GenerateDocumentChangelog func(childComplexity int, input types.GenerateDocumentChangelogInput) int
GenerateFrameworkStateOfApplicability func(childComplexity int, input types.GenerateFrameworkStateOfApplicabilityInput) int
ImportFramework func(childComplexity int, input types.ImportFrameworkInput) int
ImportMeasure func(childComplexity int, input types.ImportMeasureInput) int
InviteUser func(childComplexity int, input types.InviteUserInput) int
PublishDocumentVersion func(childComplexity int, input types.PublishDocumentVersionInput) int
RemoveUser func(childComplexity int, input types.RemoveUserInput) int
RequestEvidence func(childComplexity int, input types.RequestEvidenceInput) int
RequestSignature func(childComplexity int, input types.RequestSignatureInput) int
SendSigningNotifications func(childComplexity int, input types.SendSigningNotificationsInput) int
UnassignTask func(childComplexity int, input types.UnassignTaskInput) int
UpdateAsset func(childComplexity int, input types.UpdateAssetInput) int
UpdateControl func(childComplexity int, input types.UpdateControlInput) int
UpdateDatum func(childComplexity int, input types.UpdateDatumInput) int
UpdateDocument func(childComplexity int, input types.UpdateDocumentInput) int
UpdateDocumentVersion func(childComplexity int, input types.UpdateDocumentVersionInput) int
UpdateFramework func(childComplexity int, input types.UpdateFrameworkInput) int
UpdateMeasure func(childComplexity int, input types.UpdateMeasureInput) int
UpdateOrganization func(childComplexity int, input types.UpdateOrganizationInput) int
UpdatePeople func(childComplexity int, input types.UpdatePeopleInput) int
UpdateRisk func(childComplexity int, input types.UpdateRiskInput) int
UpdateTask func(childComplexity int, input types.UpdateTaskInput) int
UpdateVendor func(childComplexity int, input types.UpdateVendorInput) int
UploadMeasureEvidence func(childComplexity int, input types.UploadMeasureEvidenceInput) int
UploadTaskEvidence func(childComplexity int, input types.UploadTaskEvidenceInput) int
UploadVendorComplianceReport func(childComplexity int, input types.UploadVendorComplianceReportInput) int
}
Organization struct {
@@ -974,6 +979,7 @@ type MutationResolver interface {
UpdateFramework(ctx context.Context, input types.UpdateFrameworkInput) (*types.UpdateFrameworkPayload, error)
ImportFramework(ctx context.Context, input types.ImportFrameworkInput) (*types.ImportFrameworkPayload, error)
DeleteFramework(ctx context.Context, input types.DeleteFrameworkInput) (*types.DeleteFrameworkPayload, error)
GenerateFrameworkStateOfApplicability(ctx context.Context, input types.GenerateFrameworkStateOfApplicabilityInput) (*types.GenerateFrameworkStateOfApplicabilityPayload, error)
CreateControl(ctx context.Context, input types.CreateControlInput) (*types.CreateControlPayload, error)
UpdateControl(ctx context.Context, input types.UpdateControlInput) (*types.UpdateControlPayload, error)
DeleteControl(ctx context.Context, input types.DeleteControlInput) (*types.DeleteControlPayload, error)
@@ -2389,6 +2395,13 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin
return e.complexity.GenerateDocumentChangelogPayload.Changelog(childComplexity), true
case "GenerateFrameworkStateOfApplicabilityPayload.downloadUrl":
if e.complexity.GenerateFrameworkStateOfApplicabilityPayload.DownloadURL == nil {
break
}
return e.complexity.GenerateFrameworkStateOfApplicabilityPayload.DownloadURL(childComplexity), true
case "ImportFrameworkPayload.frameworkEdge":
if e.complexity.ImportFrameworkPayload.FrameworkEdge == nil {
break
@@ -3010,6 +3023,18 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin
return e.complexity.Mutation.GenerateDocumentChangelog(childComplexity, args["input"].(types.GenerateDocumentChangelogInput)), true
case "Mutation.generateFrameworkStateOfApplicability":
if e.complexity.Mutation.GenerateFrameworkStateOfApplicability == nil {
break
}
args, err := ec.field_Mutation_generateFrameworkStateOfApplicability_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.GenerateFrameworkStateOfApplicability(childComplexity, args["input"].(types.GenerateFrameworkStateOfApplicabilityInput)), true
case "Mutation.importFramework":
if e.complexity.Mutation.ImportFramework == nil {
break
@@ -4695,6 +4720,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler {
ec.unmarshalInputFrameworkOrder,
ec.unmarshalInputFulfillEvidenceInput,
ec.unmarshalInputGenerateDocumentChangelogInput,
ec.unmarshalInputGenerateFrameworkStateOfApplicabilityInput,
ec.unmarshalInputImportFrameworkInput,
ec.unmarshalInputImportMeasureInput,
ec.unmarshalInputInviteUserInput,
@@ -6118,6 +6144,9 @@ type Mutation {
updateFramework(input: UpdateFrameworkInput!): UpdateFrameworkPayload!
importFramework(input: ImportFrameworkInput!): ImportFrameworkPayload!
deleteFramework(input: DeleteFrameworkInput!): DeleteFrameworkPayload!
generateFrameworkStateOfApplicability(
input: GenerateFrameworkStateOfApplicabilityInput!
): GenerateFrameworkStateOfApplicabilityPayload!
# Control mutations
createControl(input: CreateControlInput!): CreateControlPayload!
@@ -6227,6 +6256,14 @@ type Mutation {
}
# Input Types
input GenerateFrameworkStateOfApplicabilityInput {
frameworkId: ID!
}
type GenerateFrameworkStateOfApplicabilityPayload {
downloadUrl: String!
}
input CreateOrganizationInput {
name: String!
}
@@ -9273,6 +9310,29 @@ func (ec *executionContext) field_Mutation_generateDocumentChangelog_argsInput(
return zeroVal, nil
}
func (ec *executionContext) field_Mutation_generateFrameworkStateOfApplicability_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := ec.field_Mutation_generateFrameworkStateOfApplicability_argsInput(ctx, rawArgs)
if err != nil {
return nil, err
}
args["input"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_generateFrameworkStateOfApplicability_argsInput(
ctx context.Context,
rawArgs map[string]any,
) (types.GenerateFrameworkStateOfApplicabilityInput, error) {
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
if tmp, ok := rawArgs["input"]; ok {
return ec.unmarshalNGenerateFrameworkStateOfApplicabilityInput2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐGenerateFrameworkStateOfApplicabilityInput(ctx, tmp)
}
var zeroVal types.GenerateFrameworkStateOfApplicabilityInput
return zeroVal, nil
}
func (ec *executionContext) field_Mutation_importFramework_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
@@ -20810,6 +20870,50 @@ func (ec *executionContext) fieldContext_GenerateDocumentChangelogPayload_change
return fc, nil
}
func (ec *executionContext) _GenerateFrameworkStateOfApplicabilityPayload_downloadUrl(ctx context.Context, field graphql.CollectedField, obj *types.GenerateFrameworkStateOfApplicabilityPayload) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_GenerateFrameworkStateOfApplicabilityPayload_downloadUrl(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.DownloadURL, 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_GenerateFrameworkStateOfApplicabilityPayload_downloadUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "GenerateFrameworkStateOfApplicabilityPayload",
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) _ImportFrameworkPayload_frameworkEdge(ctx context.Context, field graphql.CollectedField, obj *types.ImportFrameworkPayload) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_ImportFrameworkPayload_frameworkEdge(ctx, field)
if err != nil {
@@ -22659,6 +22763,65 @@ func (ec *executionContext) fieldContext_Mutation_deleteFramework(ctx context.Co
return fc, nil
}
func (ec *executionContext) _Mutation_generateFrameworkStateOfApplicability(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Mutation_generateFrameworkStateOfApplicability(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().GenerateFrameworkStateOfApplicability(rctx, fc.Args["input"].(types.GenerateFrameworkStateOfApplicabilityInput))
})
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.GenerateFrameworkStateOfApplicabilityPayload)
fc.Result = res
return ec.marshalNGenerateFrameworkStateOfApplicabilityPayload2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐGenerateFrameworkStateOfApplicabilityPayload(ctx, field.Selections, res)
}
func (ec *executionContext) fieldContext_Mutation_generateFrameworkStateOfApplicability(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "downloadUrl":
return ec.fieldContext_GenerateFrameworkStateOfApplicabilityPayload_downloadUrl(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type GenerateFrameworkStateOfApplicabilityPayload", 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_generateFrameworkStateOfApplicability_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
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)
if err != nil {
@@ -38883,6 +39046,33 @@ func (ec *executionContext) unmarshalInputGenerateDocumentChangelogInput(ctx con
return it, nil
}
func (ec *executionContext) unmarshalInputGenerateFrameworkStateOfApplicabilityInput(ctx context.Context, obj any) (types.GenerateFrameworkStateOfApplicabilityInput, error) {
var it types.GenerateFrameworkStateOfApplicabilityInput
asMap := map[string]any{}
for k, v := range obj.(map[string]any) {
asMap[k] = v
}
fieldsInOrder := [...]string{"frameworkId"}
for _, k := range fieldsInOrder {
v, ok := asMap[k]
if !ok {
continue
}
switch k {
case "frameworkId":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("frameworkId"))
data, err := ec.unmarshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, v)
if err != nil {
return it, err
}
it.FrameworkID = data
}
}
return it, nil
}
func (ec *executionContext) unmarshalInputImportFrameworkInput(ctx context.Context, obj any) (types.ImportFrameworkInput, error) {
var it types.ImportFrameworkInput
asMap := map[string]any{}
@@ -44756,6 +44946,45 @@ func (ec *executionContext) _GenerateDocumentChangelogPayload(ctx context.Contex
return out
}
var generateFrameworkStateOfApplicabilityPayloadImplementors = []string{"GenerateFrameworkStateOfApplicabilityPayload"}
func (ec *executionContext) _GenerateFrameworkStateOfApplicabilityPayload(ctx context.Context, sel ast.SelectionSet, obj *types.GenerateFrameworkStateOfApplicabilityPayload) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, generateFrameworkStateOfApplicabilityPayloadImplementors)
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("GenerateFrameworkStateOfApplicabilityPayload")
case "downloadUrl":
out.Values[i] = ec._GenerateFrameworkStateOfApplicabilityPayload_downloadUrl(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 importFrameworkPayloadImplementors = []string{"ImportFrameworkPayload"}
func (ec *executionContext) _ImportFrameworkPayload(ctx context.Context, sel ast.SelectionSet, obj *types.ImportFrameworkPayload) graphql.Marshaler {
@@ -45334,6 +45563,13 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "generateFrameworkStateOfApplicability":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_generateFrameworkStateOfApplicability(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "createControl":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_createControl(ctx, field)
@@ -51728,6 +51964,25 @@ func (ec *executionContext) marshalNGenerateDocumentChangelogPayload2ᚖgithub
return ec._GenerateDocumentChangelogPayload(ctx, sel, v)
}
func (ec *executionContext) unmarshalNGenerateFrameworkStateOfApplicabilityInput2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐGenerateFrameworkStateOfApplicabilityInput(ctx context.Context, v any) (types.GenerateFrameworkStateOfApplicabilityInput, error) {
res, err := ec.unmarshalInputGenerateFrameworkStateOfApplicabilityInput(ctx, v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalNGenerateFrameworkStateOfApplicabilityPayload2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐGenerateFrameworkStateOfApplicabilityPayload(ctx context.Context, sel ast.SelectionSet, v types.GenerateFrameworkStateOfApplicabilityPayload) graphql.Marshaler {
return ec._GenerateFrameworkStateOfApplicabilityPayload(ctx, sel, &v)
}
func (ec *executionContext) marshalNGenerateFrameworkStateOfApplicabilityPayload2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐGenerateFrameworkStateOfApplicabilityPayload(ctx context.Context, sel ast.SelectionSet, v *types.GenerateFrameworkStateOfApplicabilityPayload) 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._GenerateFrameworkStateOfApplicabilityPayload(ctx, sel, v)
}
func (ec *executionContext) unmarshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx context.Context, v any) (gid.GID, error) {
res, err := types.UnmarshalGIDScalar(v)
return res, graphql.ErrorOnPath(ctx, err)

View File

@@ -654,6 +654,14 @@ type GenerateDocumentChangelogPayload struct {
Changelog string `json:"changelog"`
}
type GenerateFrameworkStateOfApplicabilityInput struct {
FrameworkID gid.GID `json:"frameworkId"`
}
type GenerateFrameworkStateOfApplicabilityPayload struct {
DownloadURL string `json:"downloadUrl"`
}
type ImportFrameworkInput struct {
OrganizationID gid.GID `json:"organizationId"`
File graphql.Upload `json:"file"`

View File

@@ -1178,6 +1178,20 @@ func (r *mutationResolver) DeleteFramework(ctx context.Context, input types.Dele
}, nil
}
// GenerateFrameworkStateOfApplicability is the resolver for the generateFrameworkStateOfApplicability field.
func (r *mutationResolver) GenerateFrameworkStateOfApplicability(ctx context.Context, input types.GenerateFrameworkStateOfApplicabilityInput) (*types.GenerateFrameworkStateOfApplicabilityPayload, error) {
prb := r.ProboService(ctx, input.FrameworkID.TenantID())
soa, err := prb.Frameworks.StateOfApplicability(ctx, input.FrameworkID)
if err != nil {
return nil, fmt.Errorf("cannot generate framework SOA: %w", err)
}
return &types.GenerateFrameworkStateOfApplicabilityPayload{
DownloadURL: soa,
}, nil
}
// CreateControl is the resolver for the createControl field.
func (r *mutationResolver) CreateControl(ctx context.Context, input types.CreateControlInput) (*types.CreateControlPayload, error) {
prb := r.ProboService(ctx, input.FrameworkID.TenantID())