Rename GraphQL APIs to compliance portal

Update console, visitor, MCP, and Slack API
surfaces so schemas and resolvers use the
Compliance Portal naming consistently.

Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
Bryan Frimin
2026-07-20 18:08:21 +02:00
parent 0f0f6643ad
commit 8773a54396
57 changed files with 1830 additions and 1833 deletions

View File

@@ -379,13 +379,13 @@ func (r *mutationResolver) CreateAudit(ctx context.Context, input types.CreateAu
}
req := probo.CreateAuditRequest{
OrganizationID: input.OrganizationID,
FrameworkID: input.FrameworkID,
Name: input.Name,
ValidFrom: input.ValidFrom,
ValidUntil: input.ValidUntil,
State: input.State,
TrustCenterVisibility: input.TrustCenterVisibility,
OrganizationID: input.OrganizationID,
FrameworkID: input.FrameworkID,
Name: input.Name,
ValidFrom: input.ValidFrom,
ValidUntil: input.ValidUntil,
State: input.State,
CompliancePortalVisibility: input.CompliancePortalVisibility,
}
audit, err := r.probo.Audits.Create(ctx, scope, &req)
@@ -435,12 +435,12 @@ func (r *mutationResolver) UpdateAudit(ctx context.Context, input types.UpdateAu
}
req := probo.UpdateAuditRequest{
ID: input.ID,
Name: gqlutils.UnwrapOmittable(input.Name),
ValidFrom: input.ValidFrom,
ValidUntil: input.ValidUntil,
State: input.State,
TrustCenterVisibility: input.TrustCenterVisibility,
ID: input.ID,
Name: gqlutils.UnwrapOmittable(input.Name),
ValidFrom: input.ValidFrom,
ValidUntil: input.ValidUntil,
State: input.State,
CompliancePortalVisibility: input.CompliancePortalVisibility,
}
audit, err := r.probo.Audits.Update(ctx, scope, &req)

View File

@@ -334,25 +334,25 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error
return types.NewTransferImpactAssessment(tia), nil
}
case coredata.TrustCenterEntityType:
case coredata.CompliancePortalEntityType:
action = management.ActionCompliancePortalGet
loadNode = func(ctx context.Context, scope *coredata.Scope, id gid.GID) (types.Node, error) {
trustCenter, err := r.management.Get(ctx, scope, id)
compliancePortal, err := r.management.Get(ctx, scope, id)
if err != nil {
return nil, err
}
return types.NewTrustCenter(trustCenter), nil
return types.NewCompliancePortal(compliancePortal), nil
}
case coredata.TrustCenterAccessEntityType:
case coredata.CompliancePortalAccessEntityType:
action = management.ActionCompliancePortalAccessGet
loadNode = func(ctx context.Context, scope *coredata.Scope, id gid.GID) (types.Node, error) {
trustCenterAccess, err := r.management.GetAccess(ctx, scope, id)
compliancePortalAccess, err := r.management.GetAccess(ctx, scope, id)
if err != nil {
return nil, err
}
return types.NewTrustCenterAccess(trustCenterAccess), nil
return types.NewCompliancePortalAccess(compliancePortalAccess), nil
}
case coredata.RightsRequestEntityType:
action = probo.ActionRightsRequestGet

View File

@@ -154,17 +154,17 @@ func (r *customDomainResolver) Permission(ctx context.Context, obj *types.Custom
return r.Resolver.Permission(ctx, obj, action)
}
// UpdateTrustCenter is the resolver for the updateTrustCenter field.
func (r *mutationResolver) UpdateTrustCenter(ctx context.Context, input types.UpdateTrustCenterInput) (*types.UpdateTrustCenterPayload, error) {
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalUpdate)
// UpdateCompliancePortal is the resolver for the updateCompliancePortal field.
func (r *mutationResolver) UpdateCompliancePortal(ctx context.Context, input types.UpdateCompliancePortalInput) (*types.UpdateCompliancePortalPayload, error) {
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalUpdate)
if err != nil {
return nil, err
}
trustCenter, _, err := r.management.Update(
compliancePortal, _, err := r.management.Update(
ctx, scope,
&management.UpdateRequest{
ID: input.TrustCenterID,
ID: input.CompliancePortalID,
Active: input.Active,
SearchEngineIndexing: input.SearchEngineIndexing,
Description: gqlutils.UnwrapOmittable(input.Description),
@@ -179,29 +179,29 @@ func (r *mutationResolver) UpdateTrustCenter(ctx context.Context, input types.Up
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
}
r.logger.ErrorCtx(ctx, "cannot update trust center", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot update compliance portal", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return &types.UpdateTrustCenterPayload{
TrustCenter: types.NewTrustCenter(trustCenter),
return &types.UpdateCompliancePortalPayload{
CompliancePortal: types.NewCompliancePortal(compliancePortal),
}, nil
}
// UploadTrustCenterNda is the resolver for the uploadTrustCenterNDA field.
func (r *mutationResolver) UploadTrustCenterNda(ctx context.Context, input types.UploadTrustCenterNDAInput) (*types.UploadTrustCenterNDAPayload, error) {
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalNonDisclosureAgreementUpload)
// UploadCompliancePortalNda is the resolver for the uploadCompliancePortalNDA field.
func (r *mutationResolver) UploadCompliancePortalNda(ctx context.Context, input types.UploadCompliancePortalNDAInput) (*types.UploadCompliancePortalNDAPayload, error) {
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalNonDisclosureAgreementUpload)
if err != nil {
return nil, err
}
trustCenter, _, err := r.management.UploadNDA(
compliancePortal, _, err := r.management.UploadNDA(
ctx, scope,
&management.UploadNDARequest{
TrustCenterID: input.TrustCenterID,
File: input.File.File,
FileName: input.FileName,
CompliancePortalID: input.CompliancePortalID,
File: input.File.File,
FileName: input.FileName,
},
)
if err != nil {
@@ -209,43 +209,43 @@ func (r *mutationResolver) UploadTrustCenterNda(ctx context.Context, input types
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
}
r.logger.ErrorCtx(ctx, "cannot upload trust center NDA", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot upload compliance portal NDA", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return &types.UploadTrustCenterNDAPayload{
TrustCenter: types.NewTrustCenter(trustCenter),
return &types.UploadCompliancePortalNDAPayload{
CompliancePortal: types.NewCompliancePortal(compliancePortal),
}, nil
}
// DeleteTrustCenterNda is the resolver for the deleteTrustCenterNDA field.
func (r *mutationResolver) DeleteTrustCenterNda(ctx context.Context, input types.DeleteTrustCenterNDAInput) (*types.DeleteTrustCenterNDAPayload, error) {
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalNonDisclosureAgreementDelete)
// DeleteCompliancePortalNda is the resolver for the deleteCompliancePortalNDA field.
func (r *mutationResolver) DeleteCompliancePortalNda(ctx context.Context, input types.DeleteCompliancePortalNDAInput) (*types.DeleteCompliancePortalNDAPayload, error) {
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalNonDisclosureAgreementDelete)
if err != nil {
return nil, err
}
trustCenter, _, err := r.management.DeleteNDA(ctx, scope, input.TrustCenterID)
compliancePortal, _, err := r.management.DeleteNDA(ctx, scope, input.CompliancePortalID)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot delete trust center NDA", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot delete compliance portal NDA", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return &types.DeleteTrustCenterNDAPayload{
TrustCenter: types.NewTrustCenter(trustCenter),
return &types.DeleteCompliancePortalNDAPayload{
CompliancePortal: types.NewCompliancePortal(compliancePortal),
}, nil
}
// UpdateTrustCenterBrand is the resolver for the updateTrustCenterBrand field.
func (r *mutationResolver) UpdateTrustCenterBrand(ctx context.Context, input types.UpdateTrustCenterBrandInput) (*types.UpdateTrustCenterBrandPayload, error) {
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalUpdate)
// UpdateCompliancePortalBrand is the resolver for the updateCompliancePortalBrand field.
func (r *mutationResolver) UpdateCompliancePortalBrand(ctx context.Context, input types.UpdateCompliancePortalBrandInput) (*types.UpdateCompliancePortalBrandPayload, error) {
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalUpdate)
if err != nil {
return nil, err
}
req := &management.UpdateBrandRequest{
TrustCenterID: input.TrustCenterID,
CompliancePortalID: input.CompliancePortalID,
}
if input.LogoFile.IsSet() {
@@ -282,24 +282,24 @@ func (r *mutationResolver) UpdateTrustCenterBrand(ctx context.Context, input typ
}
}
trustCenter, _, err := r.management.UpdateBrand(ctx, scope, req)
compliancePortal, _, err := r.management.UpdateBrand(ctx, scope, req)
if err != nil {
if validationErrors, ok := errors.AsType[validator.ValidationErrors](err); ok {
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
}
r.logger.ErrorCtx(ctx, "cannot update trust center brand", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot update compliance portal brand", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return &types.UpdateTrustCenterBrandPayload{
TrustCenter: types.NewTrustCenter(trustCenter),
return &types.UpdateCompliancePortalBrandPayload{
CompliancePortal: types.NewCompliancePortal(compliancePortal),
}, nil
}
// UpdateTrustCenterAccess is the resolver for the updateTrustCenterAccess field.
func (r *mutationResolver) UpdateTrustCenterAccess(ctx context.Context, input types.UpdateTrustCenterAccessInput) (*types.UpdateTrustCenterAccessPayload, error) {
// UpdateCompliancePortalAccess is the resolver for the updateCompliancePortalAccess field.
func (r *mutationResolver) UpdateCompliancePortalAccess(ctx context.Context, input types.UpdateCompliancePortalAccessInput) (*types.UpdateCompliancePortalAccessPayload, error) {
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalAccessUpdate)
if err != nil {
return nil, err
@@ -325,7 +325,7 @@ func (r *mutationResolver) UpdateTrustCenterAccess(ctx context.Context, input ty
})
}
for _, fileAccess := range input.TrustCenterFiles {
for _, fileAccess := range input.CompliancePortalFiles {
fileAccesses = append(fileAccesses, management.UpdateDocumentAccessRequest{
ID: fileAccess.ID,
Status: fileAccess.Status,
@@ -335,10 +335,10 @@ func (r *mutationResolver) UpdateTrustCenterAccess(ctx context.Context, input ty
access, err := r.management.UpdateAccess(
ctx, scope,
&management.UpdateAccessRequest{
ID: input.ID,
DocumentAccesses: documentAccesses,
ReportAccesses: reportAccesses,
TrustCenterFileAccesses: fileAccesses,
ID: input.ID,
DocumentAccesses: documentAccesses,
ReportAccesses: reportAccesses,
CompliancePortalFileAccesses: fileAccesses,
},
)
if err != nil {
@@ -346,36 +346,36 @@ func (r *mutationResolver) UpdateTrustCenterAccess(ctx context.Context, input ty
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
}
r.logger.ErrorCtx(ctx, "cannot update trust center access", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot update compliance portal access", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return &types.UpdateTrustCenterAccessPayload{
TrustCenterAccess: types.NewTrustCenterAccess(access),
return &types.UpdateCompliancePortalAccessPayload{
CompliancePortalAccess: types.NewCompliancePortalAccess(access),
}, nil
}
// DeleteTrustCenterAccess is the resolver for the deleteTrustCenterAccess field.
func (r *mutationResolver) DeleteTrustCenterAccess(ctx context.Context, input types.DeleteTrustCenterAccessInput) (*types.DeleteTrustCenterAccessPayload, error) {
// DeleteCompliancePortalAccess is the resolver for the deleteCompliancePortalAccess field.
func (r *mutationResolver) DeleteCompliancePortalAccess(ctx context.Context, input types.DeleteCompliancePortalAccessInput) (*types.DeleteCompliancePortalAccessPayload, error) {
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalAccessDelete)
if err != nil {
return nil, err
}
if err := r.management.DeleteAccess(ctx, scope, input.ID); err != nil {
r.logger.ErrorCtx(ctx, "cannot delete trust center access", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot delete compliance portal access", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return &types.DeleteTrustCenterAccessPayload{
DeletedTrustCenterAccessID: input.ID,
return &types.DeleteCompliancePortalAccessPayload{
DeletedCompliancePortalAccessID: input.ID,
}, nil
}
// CreateTrustCenterReference is the resolver for the createTrustCenterReference field.
func (r *mutationResolver) CreateTrustCenterReference(ctx context.Context, input types.CreateTrustCenterReferenceInput) (*types.CreateTrustCenterReferencePayload, error) {
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalReferenceCreate)
// CreateCompliancePortalReference is the resolver for the createCompliancePortalReference field.
func (r *mutationResolver) CreateCompliancePortalReference(ctx context.Context, input types.CreateCompliancePortalReferenceInput) (*types.CreateCompliancePortalReferencePayload, error) {
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalReferenceCreate)
if err != nil {
return nil, err
}
@@ -383,10 +383,10 @@ func (r *mutationResolver) CreateTrustCenterReference(ctx context.Context, input
reference, err := r.management.CreateReference(
ctx, scope,
&management.CreateReferenceRequest{
TrustCenterID: input.TrustCenterID,
Name: input.Name,
Description: input.Description,
WebsiteURL: input.WebsiteURL,
CompliancePortalID: input.CompliancePortalID,
Name: input.Name,
Description: input.Description,
WebsiteURL: input.WebsiteURL,
LogoFile: management.File{
Content: input.LogoFile.File,
Filename: input.LogoFile.Filename,
@@ -400,18 +400,18 @@ func (r *mutationResolver) CreateTrustCenterReference(ctx context.Context, input
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
}
r.logger.ErrorCtx(ctx, "cannot create trust center reference", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot create compliance portal reference", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return &types.CreateTrustCenterReferencePayload{
TrustCenterReferenceEdge: types.NewTrustCenterReferenceEdge(reference, coredata.TrustCenterReferenceOrderFieldRank),
return &types.CreateCompliancePortalReferencePayload{
CompliancePortalReferenceEdge: types.NewCompliancePortalReferenceEdge(reference, coredata.CompliancePortalReferenceOrderFieldRank),
}, nil
}
// UpdateTrustCenterReference is the resolver for the updateTrustCenterReference field.
func (r *mutationResolver) UpdateTrustCenterReference(ctx context.Context, input types.UpdateTrustCenterReferenceInput) (*types.UpdateTrustCenterReferencePayload, error) {
// UpdateCompliancePortalReference is the resolver for the updateCompliancePortalReference field.
func (r *mutationResolver) UpdateCompliancePortalReference(ctx context.Context, input types.UpdateCompliancePortalReferenceInput) (*types.UpdateCompliancePortalReferencePayload, error) {
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalReferenceUpdate)
if err != nil {
return nil, err
@@ -440,36 +440,36 @@ func (r *mutationResolver) UpdateTrustCenterReference(ctx context.Context, input
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
}
r.logger.ErrorCtx(ctx, "cannot update trust center reference", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot update compliance portal reference", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return &types.UpdateTrustCenterReferencePayload{
TrustCenterReference: types.NewTrustCenterReference(reference),
return &types.UpdateCompliancePortalReferencePayload{
CompliancePortalReference: types.NewCompliancePortalReference(reference),
}, nil
}
// DeleteTrustCenterReference is the resolver for the deleteTrustCenterReference field.
func (r *mutationResolver) DeleteTrustCenterReference(ctx context.Context, input types.DeleteTrustCenterReferenceInput) (*types.DeleteTrustCenterReferencePayload, error) {
// DeleteCompliancePortalReference is the resolver for the deleteCompliancePortalReference field.
func (r *mutationResolver) DeleteCompliancePortalReference(ctx context.Context, input types.DeleteCompliancePortalReferenceInput) (*types.DeleteCompliancePortalReferencePayload, error) {
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalReferenceDelete)
if err != nil {
return nil, err
}
if err := r.management.DeleteReference(ctx, scope, input.ID); err != nil {
r.logger.ErrorCtx(ctx, "cannot delete trust center reference", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot delete compliance portal reference", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return &types.DeleteTrustCenterReferencePayload{
DeletedTrustCenterReferenceID: input.ID,
return &types.DeleteCompliancePortalReferencePayload{
DeletedCompliancePortalReferenceID: input.ID,
}, nil
}
// CreateCompliancePortalCommitmentGroup is the resolver for the createCompliancePortalCommitmentGroup field.
func (r *mutationResolver) CreateCompliancePortalCommitmentGroup(ctx context.Context, input types.CreateCompliancePortalCommitmentGroupInput) (*types.CreateCompliancePortalCommitmentGroupPayload, error) {
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalCommitmentGroupCreate)
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalCommitmentGroupCreate)
if err != nil {
return nil, err
}
@@ -477,9 +477,9 @@ func (r *mutationResolver) CreateCompliancePortalCommitmentGroup(ctx context.Con
group, err := r.management.CreateCommitmentGroup(
ctx, scope,
&management.CreateCompliancePortalCommitmentGroupRequest{
TrustCenterID: input.TrustCenterID,
Title: input.Title,
Description: input.Description,
CompliancePortalID: input.CompliancePortalID,
Title: input.Title,
Description: input.Description,
},
)
if err != nil {
@@ -629,7 +629,7 @@ func (r *mutationResolver) DeleteCompliancePortalCommitment(ctx context.Context,
// CreateComplianceFramework is the resolver for the createComplianceFramework field.
func (r *mutationResolver) CreateComplianceFramework(ctx context.Context, input types.CreateComplianceFrameworkInput) (*types.CreateComplianceFrameworkPayload, error) {
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionComplianceFrameworkCreate)
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionComplianceFrameworkCreate)
if err != nil {
return nil, err
}
@@ -637,8 +637,8 @@ func (r *mutationResolver) CreateComplianceFramework(ctx context.Context, input
cf, err := r.management.CreateFramework(
ctx, scope,
&management.CreateFrameworkRequest{
TrustCenterID: input.TrustCenterID,
FrameworkID: input.FrameworkID,
CompliancePortalID: input.CompliancePortalID,
FrameworkID: input.FrameworkID,
},
)
if err != nil {
@@ -711,7 +711,7 @@ func (r *mutationResolver) DeleteComplianceFramework(ctx context.Context, input
// CreateComplianceCustomLink is the resolver for the createComplianceCustomLink field.
func (r *mutationResolver) CreateComplianceCustomLink(ctx context.Context, input types.CreateComplianceCustomLinkInput) (*types.CreateComplianceCustomLinkPayload, error) {
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionComplianceCustomLinkCreate)
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionComplianceCustomLinkCreate)
if err != nil {
return nil, err
}
@@ -719,9 +719,9 @@ func (r *mutationResolver) CreateComplianceCustomLink(ctx context.Context, input
item, err := r.management.CreateCustomLink(
ctx, scope,
&management.CreateCustomLinkRequest{
TrustCenterID: input.TrustCenterID,
Name: input.Name,
URL: input.URL,
CompliancePortalID: input.CompliancePortalID,
Name: input.Name,
URL: input.URL,
},
)
if err != nil {
@@ -789,8 +789,8 @@ func (r *mutationResolver) DeleteComplianceCustomLink(ctx context.Context, input
}, nil
}
// CreateTrustCenterFile is the resolver for the createTrustCenterFile field.
func (r *mutationResolver) CreateTrustCenterFile(ctx context.Context, input types.CreateTrustCenterFileInput) (*types.CreateTrustCenterFilePayload, error) {
// CreateCompliancePortalFile is the resolver for the createCompliancePortalFile field.
func (r *mutationResolver) CreateCompliancePortalFile(ctx context.Context, input types.CreateCompliancePortalFileInput) (*types.CreateCompliancePortalFilePayload, error) {
scope, err := r.authorize(ctx, input.OrganizationID, management.ActionCompliancePortalFileCreate)
if err != nil {
return nil, err
@@ -808,7 +808,7 @@ func (r *mutationResolver) CreateTrustCenterFile(ctx context.Context, input type
Size: input.File.Size,
ContentType: input.File.ContentType,
},
TrustCenterVisibility: input.TrustCenterVisibility,
CompliancePortalVisibility: input.CompliancePortalVisibility,
},
)
if err != nil {
@@ -816,18 +816,18 @@ func (r *mutationResolver) CreateTrustCenterFile(ctx context.Context, input type
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
}
r.logger.ErrorCtx(ctx, "cannot create trust center file", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot create compliance portal file", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return &types.CreateTrustCenterFilePayload{
TrustCenterFileEdge: types.NewTrustCenterFileEdge(file, coredata.TrustCenterFileOrderFieldCreatedAt),
return &types.CreateCompliancePortalFilePayload{
CompliancePortalFileEdge: types.NewCompliancePortalFileEdge(file, coredata.CompliancePortalFileOrderFieldCreatedAt),
}, nil
}
// UpdateTrustCenterFile is the resolver for the updateTrustCenterFile field.
func (r *mutationResolver) UpdateTrustCenterFile(ctx context.Context, input types.UpdateTrustCenterFileInput) (*types.UpdateTrustCenterFilePayload, error) {
// UpdateCompliancePortalFile is the resolver for the updateCompliancePortalFile field.
func (r *mutationResolver) UpdateCompliancePortalFile(ctx context.Context, input types.UpdateCompliancePortalFileInput) (*types.UpdateCompliancePortalFilePayload, error) {
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalFileUpdate)
if err != nil {
return nil, err
@@ -836,10 +836,10 @@ func (r *mutationResolver) UpdateTrustCenterFile(ctx context.Context, input type
file, err := r.management.UpdateFile(
ctx, scope,
&management.UpdateFileRequest{
ID: input.ID,
Name: input.Name,
Category: input.Category,
TrustCenterVisibility: input.TrustCenterVisibility,
ID: input.ID,
Name: input.Name,
Category: input.Category,
CompliancePortalVisibility: input.CompliancePortalVisibility,
},
)
if err != nil {
@@ -847,18 +847,18 @@ func (r *mutationResolver) UpdateTrustCenterFile(ctx context.Context, input type
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
}
r.logger.ErrorCtx(ctx, "cannot update trust center file", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot update compliance portal file", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return &types.UpdateTrustCenterFilePayload{
TrustCenterFile: types.NewTrustCenterFile(file),
return &types.UpdateCompliancePortalFilePayload{
CompliancePortalFile: types.NewCompliancePortalFile(file),
}, nil
}
// GetTrustCenterFile is the resolver for the getTrustCenterFile field.
func (r *mutationResolver) GetTrustCenterFile(ctx context.Context, input types.GetTrustCenterFileInput) (*types.GetTrustCenterFilePayload, error) {
// GetCompliancePortalFile is the resolver for the getCompliancePortalFile field.
func (r *mutationResolver) GetCompliancePortalFile(ctx context.Context, input types.GetCompliancePortalFileInput) (*types.GetCompliancePortalFilePayload, error) {
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalFileGet)
if err != nil {
return nil, err
@@ -866,42 +866,42 @@ func (r *mutationResolver) GetTrustCenterFile(ctx context.Context, input types.G
file, err := r.management.GetFile(ctx, scope, input.ID)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot get trust center file", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot get compliance portal file", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return &types.GetTrustCenterFilePayload{
TrustCenterFile: types.NewTrustCenterFile(file),
return &types.GetCompliancePortalFilePayload{
CompliancePortalFile: types.NewCompliancePortalFile(file),
}, nil
}
// DeleteTrustCenterFile is the resolver for the deleteTrustCenterFile field.
func (r *mutationResolver) DeleteTrustCenterFile(ctx context.Context, input types.DeleteTrustCenterFileInput) (*types.DeleteTrustCenterFilePayload, error) {
// DeleteCompliancePortalFile is the resolver for the deleteCompliancePortalFile field.
func (r *mutationResolver) DeleteCompliancePortalFile(ctx context.Context, input types.DeleteCompliancePortalFileInput) (*types.DeleteCompliancePortalFilePayload, error) {
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalFileDelete)
if err != nil {
return nil, err
}
if err := r.management.DeleteFile(ctx, scope, input.ID); err != nil {
r.logger.ErrorCtx(ctx, "cannot delete trust center file", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot delete compliance portal file", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return &types.DeleteTrustCenterFilePayload{
DeletedTrustCenterFileID: input.ID,
return &types.DeleteCompliancePortalFilePayload{
DeletedCompliancePortalFileID: input.ID,
}, nil
}
// CreateCustomDomain is the resolver for the createCustomDomain field.
func (r *mutationResolver) CreateCustomDomain(ctx context.Context, input types.CreateCustomDomainInput) (*types.CreateCustomDomainPayload, error) {
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCustomDomainCreate)
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCustomDomainCreate)
if err != nil {
return nil, err
}
domain, err := r.management.AddCustomDomain(
ctx, scope,
input.TrustCenterID,
input.CompliancePortalID,
input.Domain,
)
if err != nil {
@@ -946,7 +946,7 @@ func (r *mutationResolver) DeleteCustomDomain(ctx context.Context, input types.D
}
// Logo is the resolver for the logo field.
func (r *trustCenterResolver) Logo(ctx context.Context, obj *types.TrustCenter) (*types.File, error) {
func (r *compliancePortalResolver) Logo(ctx context.Context, obj *types.CompliancePortal) (*types.File, error) {
if _, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalGet); err != nil {
return nil, err
}
@@ -959,7 +959,7 @@ func (r *trustCenterResolver) Logo(ctx context.Context, obj *types.TrustCenter)
}
// DarkLogo is the resolver for the darkLogo field.
func (r *trustCenterResolver) DarkLogo(ctx context.Context, obj *types.TrustCenter) (*types.File, error) {
func (r *compliancePortalResolver) DarkLogo(ctx context.Context, obj *types.CompliancePortal) (*types.File, error) {
if _, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalGet); err != nil {
return nil, err
}
@@ -972,7 +972,7 @@ func (r *trustCenterResolver) DarkLogo(ctx context.Context, obj *types.TrustCent
}
// Nda is the resolver for the nda field.
func (r *trustCenterResolver) Nda(ctx context.Context, obj *types.TrustCenter) (*types.File, error) {
func (r *compliancePortalResolver) Nda(ctx context.Context, obj *types.CompliancePortal) (*types.File, error) {
hasPermission, err := r.Resolver.Permission(ctx, obj, management.ActionCompliancePortalGetNda)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot authorize", log.Error(err))
@@ -987,19 +987,19 @@ func (r *trustCenterResolver) Nda(ctx context.Context, obj *types.TrustCenter) (
}
// Organization is the resolver for the organization field.
func (r *trustCenterResolver) Organization(ctx context.Context, obj *types.TrustCenter) (*types.Organization, error) {
func (r *compliancePortalResolver) Organization(ctx context.Context, obj *types.CompliancePortal) (*types.Organization, error) {
scope, err := r.authorize(ctx, obj.ID, probo.ActionOrganizationGet)
if err != nil {
return nil, err
}
trustCenter, err := r.management.Get(ctx, scope, obj.ID)
compliancePortal, err := r.management.Get(ctx, scope, obj.ID)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot get trust center", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot get compliance portal", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
organization, err := r.probo.Organizations.Get(ctx, scope, trustCenter.OrganizationID)
organization, err := r.probo.Organizations.Get(ctx, scope, compliancePortal.OrganizationID)
if err != nil {
if errors.Is(err, coredata.ErrResourceNotFound) {
return nil, gqlutils.NotFound(ctx, err)
@@ -1014,19 +1014,19 @@ func (r *trustCenterResolver) Organization(ctx context.Context, obj *types.Trust
}
// Accesses is the resolver for the accesses field.
func (r *trustCenterResolver) Accesses(ctx context.Context, obj *types.TrustCenter, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.TrustCenterAccessOrderField]) (*types.TrustCenterAccessConnection, error) {
func (r *compliancePortalResolver) Accesses(ctx context.Context, obj *types.CompliancePortal, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.CompliancePortalAccessOrderField]) (*types.CompliancePortalAccessConnection, error) {
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalAccessList)
if err != nil {
return nil, err
}
pageOrderBy := page.OrderBy[coredata.TrustCenterAccessOrderField]{
Field: coredata.TrustCenterAccessOrderFieldCreatedAt,
pageOrderBy := page.OrderBy[coredata.CompliancePortalAccessOrderField]{
Field: coredata.CompliancePortalAccessOrderFieldCreatedAt,
Direction: page.OrderDirectionDesc,
}
if orderBy != nil {
pageOrderBy = page.OrderBy[coredata.TrustCenterAccessOrderField]{
pageOrderBy = page.OrderBy[coredata.CompliancePortalAccessOrderField]{
Field: orderBy.Field,
Direction: orderBy.Direction,
}
@@ -1036,27 +1036,27 @@ func (r *trustCenterResolver) Accesses(ctx context.Context, obj *types.TrustCent
result, err := r.management.ListAccesses(ctx, scope, obj.ID, cursor)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot list trust center accesses", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot list compliance portal accesses", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return types.NewTrustCenterAccessConnection(result), nil
return types.NewCompliancePortalAccessConnection(result), nil
}
// References is the resolver for the references field.
func (r *trustCenterResolver) References(ctx context.Context, obj *types.TrustCenter, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.TrustCenterReferenceOrderField]) (*types.TrustCenterReferenceConnection, error) {
func (r *compliancePortalResolver) References(ctx context.Context, obj *types.CompliancePortal, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.CompliancePortalReferenceOrderField]) (*types.CompliancePortalReferenceConnection, error) {
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalReferenceList)
if err != nil {
return nil, err
}
pageOrderBy := page.OrderBy[coredata.TrustCenterReferenceOrderField]{
Field: coredata.TrustCenterReferenceOrderFieldRank,
pageOrderBy := page.OrderBy[coredata.CompliancePortalReferenceOrderField]{
Field: coredata.CompliancePortalReferenceOrderFieldRank,
Direction: page.OrderDirectionAsc,
}
if orderBy != nil {
pageOrderBy = page.OrderBy[coredata.TrustCenterReferenceOrderField]{
pageOrderBy = page.OrderBy[coredata.CompliancePortalReferenceOrderField]{
Field: orderBy.Field,
Direction: orderBy.Direction,
}
@@ -1066,15 +1066,15 @@ func (r *trustCenterResolver) References(ctx context.Context, obj *types.TrustCe
result, err := r.management.ListReferences(ctx, scope, obj.ID, cursor)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot list trust center references", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot list compliance portal references", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return types.NewTrustCenterReferenceConnection(result, obj.ID), nil
return types.NewCompliancePortalReferenceConnection(result, obj.ID), nil
}
// CommitmentGroups is the resolver for the commitmentGroups field.
func (r *trustCenterResolver) CommitmentGroups(ctx context.Context, obj *types.TrustCenter, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.CompliancePortalCommitmentGroupOrderField]) (*types.CompliancePortalCommitmentGroupConnection, error) {
func (r *compliancePortalResolver) CommitmentGroups(ctx context.Context, obj *types.CompliancePortal, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.CompliancePortalCommitmentGroupOrderField]) (*types.CompliancePortalCommitmentGroupConnection, error) {
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalCommitmentGroupList)
if err != nil {
return nil, err
@@ -1104,7 +1104,7 @@ func (r *trustCenterResolver) CommitmentGroups(ctx context.Context, obj *types.T
}
// ComplianceFrameworks is the resolver for the complianceFrameworks field.
func (r *trustCenterResolver) ComplianceFrameworks(ctx context.Context, obj *types.TrustCenter, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.ComplianceFrameworkOrderField]) (*types.ComplianceFrameworkConnection, error) {
func (r *compliancePortalResolver) ComplianceFrameworks(ctx context.Context, obj *types.CompliancePortal, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.ComplianceFrameworkOrderField]) (*types.ComplianceFrameworkConnection, error) {
scope, err := r.authorize(ctx, obj.ID, management.ActionComplianceFrameworkList)
if err != nil {
return nil, err
@@ -1134,7 +1134,7 @@ func (r *trustCenterResolver) ComplianceFrameworks(ctx context.Context, obj *typ
}
// CustomLinks is the resolver for the customLinks field.
func (r *trustCenterResolver) CustomLinks(ctx context.Context, obj *types.TrustCenter, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.ComplianceCustomLinkOrderField]) (*types.ComplianceCustomLinkConnection, error) {
func (r *compliancePortalResolver) CustomLinks(ctx context.Context, obj *types.CompliancePortal, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.ComplianceCustomLinkOrderField]) (*types.ComplianceCustomLinkConnection, error) {
scope, err := r.authorize(ctx, obj.ID, management.ActionComplianceCustomLinkList)
if err != nil {
return nil, err
@@ -1164,7 +1164,7 @@ func (r *trustCenterResolver) CustomLinks(ctx context.Context, obj *types.TrustC
}
// MailingList is the resolver for the mailingList field.
func (r *trustCenterResolver) MailingList(ctx context.Context, obj *types.TrustCenter) (*types.MailingList, error) {
func (r *compliancePortalResolver) MailingList(ctx context.Context, obj *types.CompliancePortal) (*types.MailingList, error) {
scope, err := r.authorize(ctx, obj.ID, management.ActionMailingListSubscriberList)
if err != nil {
return nil, err
@@ -1176,7 +1176,7 @@ func (r *trustCenterResolver) MailingList(ctx context.Context, obj *types.TrustC
ml, err := r.management.GetMailingList(ctx, scope, obj.ID)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot get mailing list for trust center", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot get mailing list for compliance portal", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
@@ -1188,7 +1188,7 @@ func (r *trustCenterResolver) MailingList(ctx context.Context, obj *types.TrustC
}
// DefaultDomain is the resolver for the defaultDomain field.
func (r *trustCenterResolver) DefaultDomain(ctx context.Context, obj *types.TrustCenter) (*types.CustomDomain, error) {
func (r *compliancePortalResolver) DefaultDomain(ctx context.Context, obj *types.CompliancePortal) (*types.CustomDomain, error) {
if obj.DefaultDomain == nil {
return nil, nil
}
@@ -1213,7 +1213,7 @@ func (r *trustCenterResolver) DefaultDomain(ctx context.Context, obj *types.Trus
}
// CustomDomain is the resolver for the customDomain field.
func (r *trustCenterResolver) CustomDomain(ctx context.Context, obj *types.TrustCenter) (*types.CustomDomain, error) {
func (r *compliancePortalResolver) CustomDomain(ctx context.Context, obj *types.CompliancePortal) (*types.CustomDomain, error) {
if obj.CustomDomain == nil {
return nil, nil
}
@@ -1238,7 +1238,7 @@ func (r *trustCenterResolver) CustomDomain(ctx context.Context, obj *types.Trust
}
// PublicURL is the resolver for the publicUrl field.
func (r *trustCenterResolver) PublicURL(ctx context.Context, obj *types.TrustCenter) (string, error) {
func (r *compliancePortalResolver) PublicURL(ctx context.Context, obj *types.CompliancePortal) (string, error) {
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalGet)
if err != nil {
return "", err
@@ -1246,7 +1246,7 @@ func (r *trustCenterResolver) PublicURL(ctx context.Context, obj *types.TrustCen
publicURL, err := r.management.PublicURL(ctx, scope, obj.ID)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot resolve trust center public url", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot resolve compliance portal public url", log.Error(err))
return "", gqlutils.Internal(ctx)
}
@@ -1254,12 +1254,12 @@ func (r *trustCenterResolver) PublicURL(ctx context.Context, obj *types.TrustCen
}
// Permission is the resolver for the permission field.
func (r *trustCenterResolver) Permission(ctx context.Context, obj *types.TrustCenter, action string) (bool, error) {
func (r *compliancePortalResolver) Permission(ctx context.Context, obj *types.CompliancePortal, action string) (bool, error) {
return r.Resolver.Permission(ctx, obj, action)
}
// NdaSignature is the resolver for the ndaSignature field.
func (r *trustCenterAccessResolver) NdaSignature(ctx context.Context, obj *types.TrustCenterAccess) (*types.ElectronicSignature, error) {
func (r *compliancePortalAccessResolver) NdaSignature(ctx context.Context, obj *types.CompliancePortalAccess) (*types.ElectronicSignature, error) {
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalAccessGet)
if err != nil {
return nil, err
@@ -1267,7 +1267,7 @@ func (r *trustCenterAccessResolver) NdaSignature(ctx context.Context, obj *types
access, err := r.management.GetAccess(ctx, scope, obj.ID)
if err != nil {
return nil, fmt.Errorf("cannot load trust center access: %w", err)
return nil, fmt.Errorf("cannot load compliance portal access: %w", err)
}
if access.ElectronicSignatureID == nil {
@@ -1283,7 +1283,7 @@ func (r *trustCenterAccessResolver) NdaSignature(ctx context.Context, obj *types
}
// PendingRequestCount is the resolver for the pendingRequestCount field.
func (r *trustCenterAccessResolver) PendingRequestCount(ctx context.Context, obj *types.TrustCenterAccess) (int, error) {
func (r *compliancePortalAccessResolver) PendingRequestCount(ctx context.Context, obj *types.CompliancePortalAccess) (int, error) {
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalAccessGet)
if err != nil {
return 0, err
@@ -1299,7 +1299,7 @@ func (r *trustCenterAccessResolver) PendingRequestCount(ctx context.Context, obj
}
// ActiveCount is the resolver for the activeCount field.
func (r *trustCenterAccessResolver) ActiveCount(ctx context.Context, obj *types.TrustCenterAccess) (int, error) {
func (r *compliancePortalAccessResolver) ActiveCount(ctx context.Context, obj *types.CompliancePortalAccess) (int, error) {
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalAccessGet)
if err != nil {
return 0, err
@@ -1315,7 +1315,7 @@ func (r *trustCenterAccessResolver) ActiveCount(ctx context.Context, obj *types.
}
// Profile is the resolver for the profile field.
func (r *trustCenterAccessResolver) Profile(ctx context.Context, obj *types.TrustCenterAccess) (*types.Profile, error) {
func (r *compliancePortalAccessResolver) Profile(ctx context.Context, obj *types.CompliancePortalAccess) (*types.Profile, error) {
if _, err := r.authorize(ctx, obj.ID, iam.ActionMembershipProfileGet); err != nil {
return nil, err
}
@@ -1335,19 +1335,19 @@ func (r *trustCenterAccessResolver) Profile(ctx context.Context, obj *types.Trus
}
// AvailableDocumentAccesses is the resolver for the availableDocumentAccesses field.
func (r *trustCenterAccessResolver) AvailableDocumentAccesses(ctx context.Context, obj *types.TrustCenterAccess, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.TrustCenterDocumentAccessOrderField]) (*types.TrustCenterDocumentAccessConnection, error) {
func (r *compliancePortalAccessResolver) AvailableDocumentAccesses(ctx context.Context, obj *types.CompliancePortalAccess, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.CompliancePortalDocumentAccessOrderField]) (*types.CompliancePortalDocumentAccessConnection, error) {
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalAccessGet)
if err != nil {
return nil, err
}
pageOrderBy := page.OrderBy[coredata.TrustCenterDocumentAccessOrderField]{
Field: coredata.TrustCenterDocumentAccessOrderFieldCreatedAt,
pageOrderBy := page.OrderBy[coredata.CompliancePortalDocumentAccessOrderField]{
Field: coredata.CompliancePortalDocumentAccessOrderFieldCreatedAt,
Direction: page.OrderDirectionDesc,
}
if orderBy != nil {
pageOrderBy = page.OrderBy[coredata.TrustCenterDocumentAccessOrderField]{
pageOrderBy = page.OrderBy[coredata.CompliancePortalDocumentAccessOrderField]{
Field: orderBy.Field,
Direction: orderBy.Direction,
}
@@ -1357,20 +1357,20 @@ func (r *trustCenterAccessResolver) AvailableDocumentAccesses(ctx context.Contex
result, err := r.management.ListAvailableDocumentAccesses(ctx, scope, obj.ID, cursor)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot list trust center document accesses", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot list compliance portal document accesses", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return types.NewTrustCenterDocumentAccessConnection(result, obj, obj.ID), nil
return types.NewCompliancePortalDocumentAccessConnection(result, obj, obj.ID), nil
}
// Permission is the resolver for the permission field.
func (r *trustCenterAccessResolver) Permission(ctx context.Context, obj *types.TrustCenterAccess, action string) (bool, error) {
func (r *compliancePortalAccessResolver) Permission(ctx context.Context, obj *types.CompliancePortalAccess, action string) (bool, error) {
return r.Resolver.Permission(ctx, obj, action)
}
// Document is the resolver for the document field.
func (r *trustCenterDocumentAccessResolver) Document(ctx context.Context, obj *types.TrustCenterDocumentAccess) (*types.Document, error) {
func (r *compliancePortalDocumentAccessResolver) Document(ctx context.Context, obj *types.CompliancePortalDocumentAccess) (*types.Document, error) {
scope, err := r.authorize(ctx, obj.ID, probo.ActionDocumentGet)
if err != nil {
return nil, err
@@ -1395,7 +1395,7 @@ func (r *trustCenterDocumentAccessResolver) Document(ctx context.Context, obj *t
}
// ReportFile is the resolver for the reportFile field.
func (r *trustCenterDocumentAccessResolver) ReportFile(ctx context.Context, obj *types.TrustCenterDocumentAccess) (*types.File, error) {
func (r *compliancePortalDocumentAccessResolver) ReportFile(ctx context.Context, obj *types.CompliancePortalDocumentAccess) (*types.File, error) {
if obj.ReportFile == nil {
return nil, nil
}
@@ -1421,7 +1421,7 @@ func (r *trustCenterDocumentAccessResolver) ReportFile(ctx context.Context, obj
}
// Audit is the resolver for the audit field.
func (r *trustCenterDocumentAccessResolver) Audit(ctx context.Context, obj *types.TrustCenterDocumentAccess) (*types.Audit, error) {
func (r *compliancePortalDocumentAccessResolver) Audit(ctx context.Context, obj *types.CompliancePortalDocumentAccess) (*types.Audit, error) {
scope, err := r.authorize(ctx, obj.ID, probo.ActionAuditGet)
if err != nil {
return nil, err
@@ -1445,28 +1445,28 @@ func (r *trustCenterDocumentAccessResolver) Audit(ctx context.Context, obj *type
return types.NewAudit(audit), nil
}
// TrustCenterFile is the resolver for the trustCenterFile field.
func (r *trustCenterDocumentAccessResolver) TrustCenterFile(ctx context.Context, obj *types.TrustCenterDocumentAccess) (*types.TrustCenterFile, error) {
scope, err := r.authorize(ctx, obj.TrustCenterAccessID, management.ActionCompliancePortalFileGet)
// CompliancePortalFile is the resolver for the compliancePortalFile field.
func (r *compliancePortalDocumentAccessResolver) CompliancePortalFile(ctx context.Context, obj *types.CompliancePortalDocumentAccess) (*types.CompliancePortalFile, error) {
scope, err := r.authorize(ctx, obj.CompliancePortalAccessID, management.ActionCompliancePortalFileGet)
if err != nil {
return nil, err
}
if obj.TrustCenterFileID == nil {
if obj.CompliancePortalFileID == nil {
return nil, nil
}
trustCenterFile, err := r.management.GetFile(ctx, scope, *obj.TrustCenterFileID)
compliancePortalFile, err := r.management.GetFile(ctx, scope, *obj.CompliancePortalFileID)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot load trust center file", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot load compliance portal file", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return types.NewTrustCenterFile(trustCenterFile), nil
return types.NewCompliancePortalFile(compliancePortalFile), nil
}
// TotalCount is the resolver for the totalCount field.
func (r *trustCenterDocumentAccessConnectionResolver) TotalCount(ctx context.Context, obj *types.TrustCenterDocumentAccessConnection) (int, error) {
func (r *compliancePortalDocumentAccessConnectionResolver) TotalCount(ctx context.Context, obj *types.CompliancePortalDocumentAccessConnection) (int, error) {
scope, err := r.authorize(ctx, obj.ParentID, management.ActionCompliancePortalDocumentAccessList)
if err != nil {
return 0, err
@@ -1474,7 +1474,7 @@ func (r *trustCenterDocumentAccessConnectionResolver) TotalCount(ctx context.Con
count, err := r.management.CountDocumentAccesses(ctx, scope, obj.ParentID)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot count trust center document accesses", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot count compliance portal document accesses", log.Error(err))
return 0, gqlutils.Internal(ctx)
}
@@ -1482,7 +1482,7 @@ func (r *trustCenterDocumentAccessConnectionResolver) TotalCount(ctx context.Con
}
// File is the resolver for the file field.
func (r *trustCenterFileResolver) File(ctx context.Context, obj *types.TrustCenterFile) (*types.File, error) {
func (r *compliancePortalFileResolver) File(ctx context.Context, obj *types.CompliancePortalFile) (*types.File, error) {
if _, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalFileGetFileUrl); err != nil {
return nil, err
}
@@ -1491,7 +1491,7 @@ func (r *trustCenterFileResolver) File(ctx context.Context, obj *types.TrustCent
}
// Alias is the resolver for the alias field.
func (r *trustCenterFileResolver) Alias(ctx context.Context, obj *types.TrustCenterFile) (*string, error) {
func (r *compliancePortalFileResolver) Alias(ctx context.Context, obj *types.CompliancePortalFile) (*string, error) {
scope, err := r.authorize(ctx, obj.ID, resourcealias.ActionAliasGet)
if err != nil {
return nil, err
@@ -1501,19 +1501,19 @@ func (r *trustCenterFileResolver) Alias(ctx context.Context, obj *types.TrustCen
}
// Organization is the resolver for the organization field.
func (r *trustCenterFileResolver) Organization(ctx context.Context, obj *types.TrustCenterFile) (*types.Organization, error) {
func (r *compliancePortalFileResolver) Organization(ctx context.Context, obj *types.CompliancePortalFile) (*types.Organization, error) {
scope, err := r.authorize(ctx, obj.ID, probo.ActionOrganizationGet)
if err != nil {
return nil, err
}
trustCenterFile, err := r.management.GetFile(ctx, scope, obj.ID)
compliancePortalFile, err := r.management.GetFile(ctx, scope, obj.ID)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot get trust center file", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot get compliance portal file", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
organization, err := r.probo.Organizations.Get(ctx, scope, trustCenterFile.OrganizationID)
organization, err := r.probo.Organizations.Get(ctx, scope, compliancePortalFile.OrganizationID)
if err != nil {
if errors.Is(err, coredata.ErrResourceNotFound) {
return nil, gqlutils.NotFound(ctx, err)
@@ -1528,12 +1528,12 @@ func (r *trustCenterFileResolver) Organization(ctx context.Context, obj *types.T
}
// Permission is the resolver for the permission field.
func (r *trustCenterFileResolver) Permission(ctx context.Context, obj *types.TrustCenterFile, action string) (bool, error) {
func (r *compliancePortalFileResolver) Permission(ctx context.Context, obj *types.CompliancePortalFile, action string) (bool, error) {
return r.Resolver.Permission(ctx, obj, action)
}
// TotalCount is the resolver for the totalCount field.
func (r *trustCenterFileConnectionResolver) TotalCount(ctx context.Context, obj *types.TrustCenterFileConnection) (int, error) {
func (r *compliancePortalFileConnectionResolver) TotalCount(ctx context.Context, obj *types.CompliancePortalFileConnection) (int, error) {
scope, err := r.authorize(ctx, obj.ParentID, management.ActionCompliancePortalFileList)
if err != nil {
return 0, err
@@ -1541,7 +1541,7 @@ func (r *trustCenterFileConnectionResolver) TotalCount(ctx context.Context, obj
count, err := r.management.CountFilesForOrganizationID(ctx, scope, obj.ParentID)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot count trust center files", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot count compliance portal files", log.Error(err))
return 0, gqlutils.Internal(ctx)
}
@@ -1549,7 +1549,7 @@ func (r *trustCenterFileConnectionResolver) TotalCount(ctx context.Context, obj
}
// Logo is the resolver for the logo field.
func (r *trustCenterReferenceResolver) Logo(ctx context.Context, obj *types.TrustCenterReference) (*types.File, error) {
func (r *compliancePortalReferenceResolver) Logo(ctx context.Context, obj *types.CompliancePortalReference) (*types.File, error) {
if _, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalReferenceGetLogoUrl); err != nil {
return nil, err
}
@@ -1558,12 +1558,12 @@ func (r *trustCenterReferenceResolver) Logo(ctx context.Context, obj *types.Trus
}
// Permission is the resolver for the permission field.
func (r *trustCenterReferenceResolver) Permission(ctx context.Context, obj *types.TrustCenterReference, action string) (bool, error) {
func (r *compliancePortalReferenceResolver) Permission(ctx context.Context, obj *types.CompliancePortalReference, action string) (bool, error) {
return r.Resolver.Permission(ctx, obj, action)
}
// TotalCount is the resolver for the totalCount field.
func (r *trustCenterReferenceConnectionResolver) TotalCount(ctx context.Context, obj *types.TrustCenterReferenceConnection) (int, error) {
func (r *compliancePortalReferenceConnectionResolver) TotalCount(ctx context.Context, obj *types.CompliancePortalReferenceConnection) (int, error) {
scope, err := r.authorize(ctx, obj.ParentID, management.ActionCompliancePortalReferenceList)
if err != nil {
return 0, err
@@ -1571,7 +1571,7 @@ func (r *trustCenterReferenceConnectionResolver) TotalCount(ctx context.Context,
count, err := r.management.CountReferences(ctx, scope, obj.ParentID)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot count trust center references", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot count compliance portal references", log.Error(err))
return 0, gqlutils.Internal(ctx)
}
@@ -1611,42 +1611,44 @@ func (r *Resolver) CompliancePortalCommitmentGroupConnection() schema.Compliance
// CustomDomain returns schema.CustomDomainResolver implementation.
func (r *Resolver) CustomDomain() schema.CustomDomainResolver { return &customDomainResolver{r} }
// TrustCenter returns schema.TrustCenterResolver implementation.
func (r *Resolver) TrustCenter() schema.TrustCenterResolver { return &trustCenterResolver{r} }
// TrustCenterAccess returns schema.TrustCenterAccessResolver implementation.
func (r *Resolver) TrustCenterAccess() schema.TrustCenterAccessResolver {
return &trustCenterAccessResolver{r}
// CompliancePortal returns schema.CompliancePortalResolver implementation.
func (r *Resolver) CompliancePortal() schema.CompliancePortalResolver {
return &compliancePortalResolver{r}
}
// TrustCenterDocumentAccess returns schema.TrustCenterDocumentAccessResolver implementation.
func (r *Resolver) TrustCenterDocumentAccess() schema.TrustCenterDocumentAccessResolver {
return &trustCenterDocumentAccessResolver{r}
// CompliancePortalAccess returns schema.CompliancePortalAccessResolver implementation.
func (r *Resolver) CompliancePortalAccess() schema.CompliancePortalAccessResolver {
return &compliancePortalAccessResolver{r}
}
// TrustCenterDocumentAccessConnection returns schema.TrustCenterDocumentAccessConnectionResolver implementation.
func (r *Resolver) TrustCenterDocumentAccessConnection() schema.TrustCenterDocumentAccessConnectionResolver {
return &trustCenterDocumentAccessConnectionResolver{r}
// CompliancePortalDocumentAccess returns schema.CompliancePortalDocumentAccessResolver implementation.
func (r *Resolver) CompliancePortalDocumentAccess() schema.CompliancePortalDocumentAccessResolver {
return &compliancePortalDocumentAccessResolver{r}
}
// TrustCenterFile returns schema.TrustCenterFileResolver implementation.
func (r *Resolver) TrustCenterFile() schema.TrustCenterFileResolver {
return &trustCenterFileResolver{r}
// CompliancePortalDocumentAccessConnection returns schema.CompliancePortalDocumentAccessConnectionResolver implementation.
func (r *Resolver) CompliancePortalDocumentAccessConnection() schema.CompliancePortalDocumentAccessConnectionResolver {
return &compliancePortalDocumentAccessConnectionResolver{r}
}
// TrustCenterFileConnection returns schema.TrustCenterFileConnectionResolver implementation.
func (r *Resolver) TrustCenterFileConnection() schema.TrustCenterFileConnectionResolver {
return &trustCenterFileConnectionResolver{r}
// CompliancePortalFile returns schema.CompliancePortalFileResolver implementation.
func (r *Resolver) CompliancePortalFile() schema.CompliancePortalFileResolver {
return &compliancePortalFileResolver{r}
}
// TrustCenterReference returns schema.TrustCenterReferenceResolver implementation.
func (r *Resolver) TrustCenterReference() schema.TrustCenterReferenceResolver {
return &trustCenterReferenceResolver{r}
// CompliancePortalFileConnection returns schema.CompliancePortalFileConnectionResolver implementation.
func (r *Resolver) CompliancePortalFileConnection() schema.CompliancePortalFileConnectionResolver {
return &compliancePortalFileConnectionResolver{r}
}
// TrustCenterReferenceConnection returns schema.TrustCenterReferenceConnectionResolver implementation.
func (r *Resolver) TrustCenterReferenceConnection() schema.TrustCenterReferenceConnectionResolver {
return &trustCenterReferenceConnectionResolver{r}
// CompliancePortalReference returns schema.CompliancePortalReferenceResolver implementation.
func (r *Resolver) CompliancePortalReference() schema.CompliancePortalReferenceResolver {
return &compliancePortalReferenceResolver{r}
}
// CompliancePortalReferenceConnection returns schema.CompliancePortalReferenceConnectionResolver implementation.
func (r *Resolver) CompliancePortalReferenceConnection() schema.CompliancePortalReferenceConnectionResolver {
return &compliancePortalReferenceConnectionResolver{r}
}
type (
@@ -1657,12 +1659,12 @@ type (
compliancePortalCommitmentGroupResolver struct{ *Resolver }
compliancePortalCommitmentGroupConnectionResolver struct{ *Resolver }
customDomainResolver struct{ *Resolver }
trustCenterResolver struct{ *Resolver }
trustCenterAccessResolver struct{ *Resolver }
trustCenterDocumentAccessResolver struct{ *Resolver }
trustCenterDocumentAccessConnectionResolver struct{ *Resolver }
trustCenterFileResolver struct{ *Resolver }
trustCenterFileConnectionResolver struct{ *Resolver }
trustCenterReferenceResolver struct{ *Resolver }
trustCenterReferenceConnectionResolver struct{ *Resolver }
compliancePortalResolver struct{ *Resolver }
compliancePortalAccessResolver struct{ *Resolver }
compliancePortalDocumentAccessResolver struct{ *Resolver }
compliancePortalDocumentAccessConnectionResolver struct{ *Resolver }
compliancePortalFileResolver struct{ *Resolver }
compliancePortalFileConnectionResolver struct{ *Resolver }
compliancePortalReferenceResolver struct{ *Resolver }
compliancePortalReferenceConnectionResolver struct{ *Resolver }
)

View File

@@ -847,13 +847,13 @@ func (r *mutationResolver) CreateDocument(ctx context.Context, input types.Creat
document, documentVersion, err := r.probo.Documents.Create(
ctx, scope,
probo.CreateDocumentRequest{
OrganizationID: input.OrganizationID,
Title: input.Title,
Content: content,
Classification: input.Classification,
DocumentType: input.DocumentType,
TrustCenterVisibility: input.TrustCenterVisibility,
DefaultApproverIDs: input.DefaultApproverIds,
OrganizationID: input.OrganizationID,
Title: input.Title,
Content: content,
Classification: input.Classification,
DocumentType: input.DocumentType,
CompliancePortalVisibility: input.CompliancePortalVisibility,
DefaultApproverIDs: input.DefaultApproverIds,
},
)
if err != nil {
@@ -891,13 +891,13 @@ func (r *mutationResolver) UpdateDocument(ctx context.Context, input types.Updat
document, documentVersion, draftCreated, err := r.probo.Documents.Update(
ctx, scope,
probo.UpdateDocumentRequest{
DocumentID: input.ID,
Title: input.Title,
Content: input.Content,
Classification: input.Classification,
DocumentType: input.DocumentType,
TrustCenterVisibility: input.TrustCenterVisibility,
DefaultApproverIDs: defaultApproverIDs,
DocumentID: input.ID,
Title: input.Title,
Content: input.Content,
Classification: input.Classification,
DocumentType: input.DocumentType,
CompliancePortalVisibility: input.CompliancePortalVisibility,
DefaultApproverIDs: defaultApproverIDs,
},
)
if err != nil {

View File

@@ -172,7 +172,7 @@ type Audit implements Node {
filter: FindingFilter
): FindingConnection @goField(forceResolver: true)
trustCenterVisibility: TrustCenterVisibility!
compliancePortalVisibility: CompliancePortalVisibility!
createdAt: Datetime!
updatedAt: Datetime!
@@ -276,7 +276,7 @@ input CreateAuditInput {
validFrom: Datetime
validUntil: Datetime
state: AuditState
trustCenterVisibility: TrustCenterVisibility
compliancePortalVisibility: CompliancePortalVisibility
file: Upload
}
@@ -286,7 +286,7 @@ input UpdateAuditInput {
validFrom: Datetime
validUntil: Datetime
state: AuditState
trustCenterVisibility: TrustCenterVisibility
compliancePortalVisibility: CompliancePortalVisibility
}
input DeleteAuditInput {

View File

@@ -1,16 +1,16 @@
enum TrustCenterVisibility
@goModel(model: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibility") {
enum CompliancePortalVisibility
@goModel(model: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibility") {
NONE
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibilityNone"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibilityNone"
)
PRIVATE
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibilityPrivate"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibilityPrivate"
)
PUBLIC
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibilityPublic"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibilityPublic"
)
}
@@ -28,81 +28,81 @@ enum SearchEngineIndexing
)
}
enum TrustCenterDocumentAccessStatus
enum CompliancePortalDocumentAccessStatus
@goModel(
model: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatus"
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatus"
) {
REQUESTED
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusRequested"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusRequested"
)
GRANTED
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusGranted"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusGranted"
)
REJECTED
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusRejected"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusRejected"
)
REVOKED
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusRevoked"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusRevoked"
)
}
enum TrustCenterAccessOrderField
enum CompliancePortalAccessOrderField
@goModel(
model: "go.probo.inc/probo/pkg/coredata.TrustCenterAccessOrderField"
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalAccessOrderField"
) {
CREATED_AT
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterAccessOrderFieldCreatedAt"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalAccessOrderFieldCreatedAt"
)
}
enum TrustCenterAccessState
enum CompliancePortalAccessState
@goModel(
model: "go.probo.inc/probo/pkg/coredata.TrustCenterAccessState"
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalAccessState"
) {
ACTIVE
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterAccessStateActive"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalAccessStateActive"
)
INACTIVE
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterAccessStateInactive"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalAccessStateInactive"
)
}
enum TrustCenterDocumentAccessOrderField
enum CompliancePortalDocumentAccessOrderField
@goModel(
model: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessOrderField"
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessOrderField"
) {
CREATED_AT
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessOrderFieldCreatedAt"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessOrderFieldCreatedAt"
)
}
enum TrustCenterReferenceOrderField
enum CompliancePortalReferenceOrderField
@goModel(
model: "go.probo.inc/probo/pkg/coredata.TrustCenterReferenceOrderField"
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalReferenceOrderField"
) {
RANK
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterReferenceOrderFieldRank"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalReferenceOrderFieldRank"
)
NAME
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterReferenceOrderFieldName"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalReferenceOrderFieldName"
)
CREATED_AT
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterReferenceOrderFieldCreatedAt"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalReferenceOrderFieldCreatedAt"
)
UPDATED_AT
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterReferenceOrderFieldUpdatedAt"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalReferenceOrderFieldUpdatedAt"
)
}
@@ -230,21 +230,21 @@ enum ComplianceFrameworkVisibility
)
}
enum TrustCenterFileOrderField
enum CompliancePortalFileOrderField
@goModel(
model: "go.probo.inc/probo/pkg/coredata.TrustCenterFileOrderField"
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalFileOrderField"
) {
NAME
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterFileOrderFieldName"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalFileOrderFieldName"
)
CREATED_AT
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterFileOrderFieldCreatedAt"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalFileOrderFieldCreatedAt"
)
UPDATED_AT
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrustCenterFileOrderFieldUpdatedAt"
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalFileOrderFieldUpdatedAt"
)
}
@@ -266,28 +266,28 @@ enum SSLStatus
@goEnum(value: "go.probo.inc/probo/pkg/coredata.CertificateStatusFailed")
}
input TrustCenterAccessOrder
input CompliancePortalAccessOrder
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterAccessOrderBy"
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortalAccessOrderBy"
) {
direction: OrderDirection!
field: TrustCenterAccessOrderField!
field: CompliancePortalAccessOrderField!
}
input TrustCenterDocumentAccessOrder
input CompliancePortalDocumentAccessOrder
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterDocumentAccessOrderBy"
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortalDocumentAccessOrderBy"
) {
direction: OrderDirection!
field: TrustCenterDocumentAccessOrderField!
field: CompliancePortalDocumentAccessOrderField!
}
input TrustCenterReferenceOrder
input CompliancePortalReferenceOrder
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterReferenceOrderBy"
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortalReferenceOrderBy"
) {
direction: OrderDirection!
field: TrustCenterReferenceOrderField!
field: CompliancePortalReferenceOrderField!
}
input CompliancePortalCommitmentGroupOrder
@@ -306,12 +306,12 @@ input CompliancePortalCommitmentOrder
field: CompliancePortalCommitmentOrderField!
}
input TrustCenterFileOrder
input CompliancePortalFileOrder
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterFileOrderBy"
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortalFileOrderBy"
) {
direction: OrderDirection!
field: TrustCenterFileOrderField!
field: CompliancePortalFileOrderField!
}
input ComplianceCustomLinkOrder
@@ -330,9 +330,9 @@ input ComplianceFrameworkOrder
field: ComplianceFrameworkOrderField!
}
type TrustCenter implements Node
type CompliancePortal implements Node
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenter"
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortal"
) {
id: ID!
active: Boolean!
@@ -354,16 +354,16 @@ type TrustCenter implements Node
after: CursorKey
last: Int
before: CursorKey
orderBy: TrustCenterAccessOrder
): TrustCenterAccessConnection! @goField(forceResolver: true)
orderBy: CompliancePortalAccessOrder
): CompliancePortalAccessConnection! @goField(forceResolver: true)
references(
first: Int
after: CursorKey
last: Int
before: CursorKey
orderBy: TrustCenterReferenceOrder
): TrustCenterReferenceConnection! @goField(forceResolver: true)
orderBy: CompliancePortalReferenceOrder
): CompliancePortalReferenceConnection! @goField(forceResolver: true)
commitmentGroups(
first: Int
@@ -400,17 +400,17 @@ type TrustCenter implements Node
permission(action: String!): Boolean! @goField(forceResolver: true)
}
type TrustCenterConnection {
edges: [TrustCenterEdge!]!
type CompliancePortalConnection {
edges: [CompliancePortalEdge!]!
pageInfo: PageInfo!
}
type TrustCenterEdge {
type CompliancePortalEdge {
cursor: CursorKey!
node: TrustCenter!
node: CompliancePortal!
}
type TrustCenterAccess implements Node {
type CompliancePortalAccess implements Node {
id: ID!
ndaSignature: ElectronicSignature @goField(forceResolver: true)
createdAt: Datetime!
@@ -427,49 +427,49 @@ type TrustCenterAccess implements Node {
after: CursorKey
last: Int
before: CursorKey
orderBy: TrustCenterDocumentAccessOrder
): TrustCenterDocumentAccessConnection! @goField(forceResolver: true)
orderBy: CompliancePortalDocumentAccessOrder
): CompliancePortalDocumentAccessConnection! @goField(forceResolver: true)
permission(action: String!): Boolean! @goField(forceResolver: true)
}
type TrustCenterDocumentAccess
type CompliancePortalDocumentAccess
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterDocumentAccess"
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortalDocumentAccess"
) {
id: ID!
status: TrustCenterDocumentAccessStatus!
status: CompliancePortalDocumentAccessStatus!
document: Document @goField(forceResolver: true)
reportFile: File @goField(forceResolver: true)
audit: Audit @goField(forceResolver: true)
trustCenterFile: TrustCenterFile @goField(forceResolver: true)
compliancePortalFile: CompliancePortalFile @goField(forceResolver: true)
}
type TrustCenterDocumentAccessConnection
type CompliancePortalDocumentAccessConnection
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterDocumentAccessConnection"
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortalDocumentAccessConnection"
) {
totalCount: Int! @goField(forceResolver: true)
edges: [TrustCenterDocumentAccessEdge!]!
edges: [CompliancePortalDocumentAccessEdge!]!
pageInfo: PageInfo!
}
type TrustCenterDocumentAccessEdge {
type CompliancePortalDocumentAccessEdge {
cursor: CursorKey!
node: TrustCenterDocumentAccess!
node: CompliancePortalDocumentAccess!
}
type TrustCenterAccessConnection {
edges: [TrustCenterAccessEdge!]!
type CompliancePortalAccessConnection {
edges: [CompliancePortalAccessEdge!]!
pageInfo: PageInfo!
}
type TrustCenterAccessEdge {
type CompliancePortalAccessEdge {
cursor: CursorKey!
node: TrustCenterAccess!
node: CompliancePortalAccess!
}
type TrustCenterReference implements Node {
type CompliancePortalReference implements Node {
id: ID!
name: String!
description: String
@@ -482,18 +482,18 @@ type TrustCenterReference implements Node {
permission(action: String!): Boolean! @goField(forceResolver: true)
}
type TrustCenterReferenceConnection
type CompliancePortalReferenceConnection
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterReferenceConnection"
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortalReferenceConnection"
) {
totalCount: Int! @goField(forceResolver: true)
edges: [TrustCenterReferenceEdge!]!
edges: [CompliancePortalReferenceEdge!]!
pageInfo: PageInfo!
}
type TrustCenterReferenceEdge {
type CompliancePortalReferenceEdge {
cursor: CursorKey!
node: TrustCenterReference!
node: CompliancePortalReference!
}
type CompliancePortalCommitmentGroup implements Node {
@@ -605,12 +605,12 @@ type ComplianceCustomLinkEdge {
node: ComplianceCustomLink!
}
type TrustCenterFile implements Node {
type CompliancePortalFile implements Node {
id: ID!
name: String!
category: String!
file: File! @goField(forceResolver: true)
trustCenterVisibility: TrustCenterVisibility!
compliancePortalVisibility: CompliancePortalVisibility!
alias: String @goField(forceResolver: true)
createdAt: Datetime!
updatedAt: Datetime!
@@ -619,18 +619,18 @@ type TrustCenterFile implements Node {
permission(action: String!): Boolean! @goField(forceResolver: true)
}
type TrustCenterFileConnection
type CompliancePortalFileConnection
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterFileConnection"
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortalFileConnection"
) {
totalCount: Int! @goField(forceResolver: true)
edges: [TrustCenterFileEdge!]!
edges: [CompliancePortalFileEdge!]!
pageInfo: PageInfo!
}
type TrustCenterFileEdge {
type CompliancePortalFileEdge {
cursor: CursorKey!
node: TrustCenterFile!
node: CompliancePortalFile!
}
type CustomDomain implements Node {
@@ -662,31 +662,31 @@ type DNSRecordInstruction {
}
extend type Mutation {
updateTrustCenter(input: UpdateTrustCenterInput!): UpdateTrustCenterPayload!
uploadTrustCenterNDA(
input: UploadTrustCenterNDAInput!
): UploadTrustCenterNDAPayload!
deleteTrustCenterNDA(
input: DeleteTrustCenterNDAInput!
): DeleteTrustCenterNDAPayload!
updateTrustCenterBrand(
input: UpdateTrustCenterBrandInput!
): UpdateTrustCenterBrandPayload!
updateTrustCenterAccess(
input: UpdateTrustCenterAccessInput!
): UpdateTrustCenterAccessPayload!
deleteTrustCenterAccess(
input: DeleteTrustCenterAccessInput!
): DeleteTrustCenterAccessPayload!
createTrustCenterReference(
input: CreateTrustCenterReferenceInput!
): CreateTrustCenterReferencePayload!
updateTrustCenterReference(
input: UpdateTrustCenterReferenceInput!
): UpdateTrustCenterReferencePayload!
deleteTrustCenterReference(
input: DeleteTrustCenterReferenceInput!
): DeleteTrustCenterReferencePayload!
updateCompliancePortal(input: UpdateCompliancePortalInput!): UpdateCompliancePortalPayload!
uploadCompliancePortalNDA(
input: UploadCompliancePortalNDAInput!
): UploadCompliancePortalNDAPayload!
deleteCompliancePortalNDA(
input: DeleteCompliancePortalNDAInput!
): DeleteCompliancePortalNDAPayload!
updateCompliancePortalBrand(
input: UpdateCompliancePortalBrandInput!
): UpdateCompliancePortalBrandPayload!
updateCompliancePortalAccess(
input: UpdateCompliancePortalAccessInput!
): UpdateCompliancePortalAccessPayload!
deleteCompliancePortalAccess(
input: DeleteCompliancePortalAccessInput!
): DeleteCompliancePortalAccessPayload!
createCompliancePortalReference(
input: CreateCompliancePortalReferenceInput!
): CreateCompliancePortalReferencePayload!
updateCompliancePortalReference(
input: UpdateCompliancePortalReferenceInput!
): UpdateCompliancePortalReferencePayload!
deleteCompliancePortalReference(
input: DeleteCompliancePortalReferenceInput!
): DeleteCompliancePortalReferencePayload!
createCompliancePortalCommitmentGroup(
input: CreateCompliancePortalCommitmentGroupInput!
): CreateCompliancePortalCommitmentGroupPayload!
@@ -723,18 +723,18 @@ extend type Mutation {
deleteComplianceCustomLink(
input: DeleteComplianceCustomLinkInput!
): DeleteComplianceCustomLinkPayload!
createTrustCenterFile(
input: CreateTrustCenterFileInput!
): CreateTrustCenterFilePayload!
updateTrustCenterFile(
input: UpdateTrustCenterFileInput!
): UpdateTrustCenterFilePayload!
getTrustCenterFile(
input: GetTrustCenterFileInput!
): GetTrustCenterFilePayload!
deleteTrustCenterFile(
input: DeleteTrustCenterFileInput!
): DeleteTrustCenterFilePayload!
createCompliancePortalFile(
input: CreateCompliancePortalFileInput!
): CreateCompliancePortalFilePayload!
updateCompliancePortalFile(
input: UpdateCompliancePortalFileInput!
): UpdateCompliancePortalFilePayload!
getCompliancePortalFile(
input: GetCompliancePortalFileInput!
): GetCompliancePortalFilePayload!
deleteCompliancePortalFile(
input: DeleteCompliancePortalFileInput!
): DeleteCompliancePortalFilePayload!
createCustomDomain(
input: CreateCustomDomainInput!
): CreateCustomDomainPayload!
@@ -743,8 +743,8 @@ extend type Mutation {
): DeleteCustomDomainPayload!
}
input UpdateTrustCenterInput {
trustCenterId: ID!
input UpdateCompliancePortalInput {
compliancePortalId: ID!
active: Boolean
searchEngineIndexing: SearchEngineIndexing
title: String
@@ -754,49 +754,49 @@ input UpdateTrustCenterInput {
headquarterAddress: String @goField(omittable: true)
}
input UploadTrustCenterNDAInput {
trustCenterId: ID!
input UploadCompliancePortalNDAInput {
compliancePortalId: ID!
fileName: String!
file: Upload!
}
input DeleteTrustCenterNDAInput {
trustCenterId: ID!
input DeleteCompliancePortalNDAInput {
compliancePortalId: ID!
}
input UpdateTrustCenterBrandInput {
trustCenterId: ID!
input UpdateCompliancePortalBrandInput {
compliancePortalId: ID!
logoFile: Upload @goField(omittable: true)
darkLogoFile: Upload @goField(omittable: true)
}
input TrustCenterDocumentAccessInput {
input CompliancePortalDocumentAccessInput {
id: ID!
status: TrustCenterDocumentAccessStatus!
status: CompliancePortalDocumentAccessStatus!
}
input UpdateTrustCenterAccessInput {
input UpdateCompliancePortalAccessInput {
id: ID!
name: String
state: TrustCenterAccessState
documents: [TrustCenterDocumentAccessInput!]
reports: [TrustCenterDocumentAccessInput!]
trustCenterFiles: [TrustCenterDocumentAccessInput!]
state: CompliancePortalAccessState
documents: [CompliancePortalDocumentAccessInput!]
reports: [CompliancePortalDocumentAccessInput!]
compliancePortalFiles: [CompliancePortalDocumentAccessInput!]
}
input DeleteTrustCenterAccessInput {
input DeleteCompliancePortalAccessInput {
id: ID!
}
input CreateTrustCenterReferenceInput {
trustCenterId: ID!
input CreateCompliancePortalReferenceInput {
compliancePortalId: ID!
name: String!
description: String
websiteUrl: String!
logoFile: Upload!
}
input UpdateTrustCenterReferenceInput {
input UpdateCompliancePortalReferenceInput {
id: ID!
name: String
description: String @goField(omittable: true)
@@ -805,12 +805,12 @@ input UpdateTrustCenterReferenceInput {
rank: Int
}
input DeleteTrustCenterReferenceInput {
input DeleteCompliancePortalReferenceInput {
id: ID!
}
input CreateCompliancePortalCommitmentGroupInput {
trustCenterId: ID!
compliancePortalId: ID!
title: String!
description: String!
}
@@ -848,7 +848,7 @@ input DeleteCompliancePortalCommitmentInput {
}
input CreateComplianceFrameworkInput {
trustCenterId: ID!
compliancePortalId: ID!
frameworkId: ID!
}
@@ -862,7 +862,7 @@ input DeleteComplianceFrameworkInput {
}
input CreateComplianceCustomLinkInput {
trustCenterId: ID!
compliancePortalId: ID!
name: String!
url: String!
}
@@ -878,31 +878,31 @@ input DeleteComplianceCustomLinkInput {
id: ID!
}
input CreateTrustCenterFileInput {
input CreateCompliancePortalFileInput {
organizationId: ID!
name: String!
category: String!
file: Upload!
trustCenterVisibility: TrustCenterVisibility!
compliancePortalVisibility: CompliancePortalVisibility!
}
input UpdateTrustCenterFileInput {
input UpdateCompliancePortalFileInput {
id: ID!
name: String
category: String
trustCenterVisibility: TrustCenterVisibility
compliancePortalVisibility: CompliancePortalVisibility
}
input GetTrustCenterFileInput {
input GetCompliancePortalFileInput {
id: ID!
}
input DeleteTrustCenterFileInput {
input DeleteCompliancePortalFileInput {
id: ID!
}
input CreateCustomDomainInput {
trustCenterId: ID!
compliancePortalId: ID!
domain: String!
}
@@ -910,40 +910,40 @@ input DeleteCustomDomainInput {
customDomainId: ID!
}
type UpdateTrustCenterPayload {
trustCenter: TrustCenter!
type UpdateCompliancePortalPayload {
compliancePortal: CompliancePortal!
}
type UploadTrustCenterNDAPayload {
trustCenter: TrustCenter!
type UploadCompliancePortalNDAPayload {
compliancePortal: CompliancePortal!
}
type DeleteTrustCenterNDAPayload {
trustCenter: TrustCenter!
type DeleteCompliancePortalNDAPayload {
compliancePortal: CompliancePortal!
}
type UpdateTrustCenterBrandPayload {
trustCenter: TrustCenter!
type UpdateCompliancePortalBrandPayload {
compliancePortal: CompliancePortal!
}
type UpdateTrustCenterAccessPayload {
trustCenterAccess: TrustCenterAccess!
type UpdateCompliancePortalAccessPayload {
compliancePortalAccess: CompliancePortalAccess!
}
type DeleteTrustCenterAccessPayload {
deletedTrustCenterAccessId: ID!
type DeleteCompliancePortalAccessPayload {
deletedCompliancePortalAccessId: ID!
}
type CreateTrustCenterReferencePayload {
trustCenterReferenceEdge: TrustCenterReferenceEdge!
type CreateCompliancePortalReferencePayload {
compliancePortalReferenceEdge: CompliancePortalReferenceEdge!
}
type UpdateTrustCenterReferencePayload {
trustCenterReference: TrustCenterReference!
type UpdateCompliancePortalReferencePayload {
compliancePortalReference: CompliancePortalReference!
}
type DeleteTrustCenterReferencePayload {
deletedTrustCenterReferenceId: ID!
type DeleteCompliancePortalReferencePayload {
deletedCompliancePortalReferenceId: ID!
}
type CreateCompliancePortalCommitmentGroupPayload {
@@ -994,20 +994,20 @@ type DeleteComplianceCustomLinkPayload {
deletedComplianceCustomLinkId: ID!
}
type CreateTrustCenterFilePayload {
trustCenterFileEdge: TrustCenterFileEdge!
type CreateCompliancePortalFilePayload {
compliancePortalFileEdge: CompliancePortalFileEdge!
}
type UpdateTrustCenterFilePayload {
trustCenterFile: TrustCenterFile!
type UpdateCompliancePortalFilePayload {
compliancePortalFile: CompliancePortalFile!
}
type GetTrustCenterFilePayload {
trustCenterFile: TrustCenterFile!
type GetCompliancePortalFilePayload {
compliancePortalFile: CompliancePortalFile!
}
type DeleteTrustCenterFilePayload {
deletedTrustCenterFileId: ID!
type DeleteCompliancePortalFilePayload {
deletedCompliancePortalFileId: ID!
}
type CreateCustomDomainPayload {

View File

@@ -268,7 +268,7 @@ type Document implements Node {
id: ID!
currentPublishedMajor: Int
currentPublishedMinor: Int
trustCenterVisibility: TrustCenterVisibility!
compliancePortalVisibility: CompliancePortalVisibility!
alias: String @goField(forceResolver: true)
organization: Organization! @goField(forceResolver: true)
@@ -592,7 +592,7 @@ input CreateDocumentInput {
content: String
documentType: DocumentType!
classification: DocumentClassification!
trustCenterVisibility: TrustCenterVisibility
compliancePortalVisibility: CompliancePortalVisibility
defaultApproverIds: [ID!]
}
@@ -602,7 +602,7 @@ input UpdateDocumentInput {
content: String
classification: DocumentClassification
documentType: DocumentType
trustCenterVisibility: TrustCenterVisibility
compliancePortalVisibility: CompliancePortalVisibility
defaultApproverIds: [ID!]
}

View File

@@ -314,14 +314,14 @@ type Organization implements Node {
orderBy: AgentRunOrder
): AgentRunConnection! @goField(forceResolver: true)
trustCenter: TrustCenter @goField(forceResolver: true)
trustCenterFiles(
compliancePortal: CompliancePortal @goField(forceResolver: true)
compliancePortalFiles(
first: Int
after: CursorKey
last: Int
before: CursorKey
orderBy: TrustCenterFileOrder
): TrustCenterFileConnection! @goField(forceResolver: true)
orderBy: CompliancePortalFileOrder
): CompliancePortalFileConnection! @goField(forceResolver: true)
cookieBanners(
first: Int

View File

@@ -302,7 +302,7 @@ type ThirdParty implements Node {
headquarterAddress: String
legalName: String
websiteUrl: String
showOnTrustCenter: Boolean!
showOnCompliancePortal: Boolean!
level: Int!
parentThirdParty: ThirdParty @goField(forceResolver: true)
@@ -566,7 +566,7 @@ input UpdateThirdPartyInput {
trustPageUrl: String @goField(omittable: true)
businessOwnerId: ID @goField(omittable: true)
securityOwnerId: ID @goField(omittable: true)
showOnTrustCenter: Boolean
showOnCompliancePortal: Boolean
}
input DeleteThirdPartyInput {

View File

@@ -1157,36 +1157,36 @@ func (r *organizationResolver) AgentRuns(ctx context.Context, obj *types.Organiz
return types.NewAgentRunConnection(page, r, obj.ID), nil
}
// TrustCenter is the resolver for the trustCenter field.
func (r *organizationResolver) TrustCenter(ctx context.Context, obj *types.Organization) (*types.TrustCenter, error) {
// CompliancePortal is the resolver for the compliancePortal field.
func (r *organizationResolver) CompliancePortal(ctx context.Context, obj *types.Organization) (*types.CompliancePortal, error) {
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalGet)
if err != nil {
return nil, err
}
trustCenter, err := r.management.GetByOrganizationID(ctx, scope, obj.ID)
compliancePortal, err := r.management.GetByOrganizationID(ctx, scope, obj.ID)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot get trust center", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot get compliance portal", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return types.NewTrustCenter(trustCenter), nil
return types.NewCompliancePortal(compliancePortal), nil
}
// TrustCenterFiles is the resolver for the trustCenterFiles field.
func (r *organizationResolver) TrustCenterFiles(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.TrustCenterFileOrderField]) (*types.TrustCenterFileConnection, error) {
// CompliancePortalFiles is the resolver for the compliancePortalFiles field.
func (r *organizationResolver) CompliancePortalFiles(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.CompliancePortalFileOrderField]) (*types.CompliancePortalFileConnection, error) {
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalFileList)
if err != nil {
return nil, err
}
pageOrderBy := page.OrderBy[coredata.TrustCenterFileOrderField]{
Field: coredata.TrustCenterFileOrderFieldCreatedAt,
pageOrderBy := page.OrderBy[coredata.CompliancePortalFileOrderField]{
Field: coredata.CompliancePortalFileOrderFieldCreatedAt,
Direction: page.OrderDirectionDesc,
}
if orderBy != nil {
pageOrderBy = page.OrderBy[coredata.TrustCenterFileOrderField]{
pageOrderBy = page.OrderBy[coredata.CompliancePortalFileOrderField]{
Field: orderBy.Field,
Direction: orderBy.Direction,
}
@@ -1194,13 +1194,13 @@ func (r *organizationResolver) TrustCenterFiles(ctx context.Context, obj *types.
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
pageResult, err := r.management.ListFilesForOrganizationID(ctx, scope, obj.ID, cursor, &coredata.TrustCenterFileFilter{})
pageResult, err := r.management.ListFilesForOrganizationID(ctx, scope, obj.ID, cursor, &coredata.CompliancePortalFileFilter{})
if err != nil {
r.logger.ErrorCtx(ctx, "cannot list organization trust center files", log.Error(err))
r.logger.ErrorCtx(ctx, "cannot list organization compliance portal files", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return types.NewTrustCenterFileConnection(pageResult, obj.ID), nil
return types.NewCompliancePortalFileConnection(pageResult, obj.ID), nil
}
// CookieBanners is the resolver for the cookieBanners field.

View File

@@ -142,7 +142,7 @@ func (r *mutationResolver) UpdateThirdParty(ctx context.Context, input types.Upd
Certifications: input.Certifications,
BusinessOwnerID: gqlutils.UnwrapOmittable(input.BusinessOwnerID),
SecurityOwnerID: gqlutils.UnwrapOmittable(input.SecurityOwnerID),
ShowOnTrustCenter: input.ShowOnTrustCenter,
ShowOnCompliancePortal: input.ShowOnCompliancePortal,
Countries: input.Countries,
},
)

View File

@@ -74,13 +74,13 @@ func NewAudit(a *coredata.Audit) *Audit {
Framework: &Framework{
ID: a.FrameworkID,
},
ValidFrom: a.ValidFrom,
ValidUntil: a.ValidUntil,
State: a.State,
Name: a.Name,
TrustCenterVisibility: a.TrustCenterVisibility,
CreatedAt: a.CreatedAt,
UpdatedAt: a.UpdatedAt,
ValidFrom: a.ValidFrom,
ValidUntil: a.ValidUntil,
State: a.State,
Name: a.Name,
CompliancePortalVisibility: a.CompliancePortalVisibility,
CreatedAt: a.CreatedAt,
UpdatedAt: a.UpdatedAt,
}
if a.ReportFileID != nil {

View File

@@ -0,0 +1,96 @@
// Copyright (c) 2025-2026 Probo Inc <hello@probo.com>.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
package types
import (
"time"
"go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/gid"
)
type CompliancePortal struct {
ID gid.GID `json:"id"`
Active bool `json:"active"`
SearchEngineIndexing coredata.SearchEngineIndexing `json:"searchEngineIndexing"`
Logo *File `json:"logo,omitempty"`
DarkLogo *File `json:"darkLogo,omitempty"`
Nda *File `json:"nda,omitempty"`
Description *string `json:"description,omitempty"`
WebsiteURL *string `json:"websiteUrl,omitempty"`
Email *string `json:"email,omitempty"`
HeadquarterAddress *string `json:"headquarterAddress,omitempty"`
Title string `json:"title"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Organization *Organization `json:"organization"`
Accesses *CompliancePortalAccessConnection `json:"accesses"`
References *CompliancePortalReferenceConnection `json:"references"`
ComplianceFrameworks *ComplianceFrameworkConnection `json:"complianceFrameworks"`
CustomLinks *ComplianceCustomLinkConnection `json:"customLinks"`
MailingList *MailingList `json:"mailingList,omitempty"`
DefaultDomain *CustomDomain `json:"defaultDomain,omitempty"`
CustomDomain *CustomDomain `json:"customDomain,omitempty"`
Permission bool `json:"permission"`
}
func (CompliancePortal) IsNode() {}
func (t CompliancePortal) GetID() gid.GID { return t.ID }
func NewCompliancePortal(tc *coredata.CompliancePortal) *CompliancePortal {
compliancePortal := &CompliancePortal{
ID: tc.ID,
Organization: &Organization{
ID: tc.OrganizationID,
},
Active: tc.Active,
SearchEngineIndexing: tc.SearchEngineIndexing,
Description: tc.Description,
WebsiteURL: tc.WebsiteURL,
Email: tc.Email,
HeadquarterAddress: tc.HeadquarterAddress,
Title: tc.Title,
CreatedAt: tc.CreatedAt,
UpdatedAt: tc.UpdatedAt,
}
if tc.LogoFileID != nil {
compliancePortal.Logo = &File{ID: *tc.LogoFileID}
}
if tc.DarkLogoFileID != nil {
compliancePortal.DarkLogo = &File{ID: *tc.DarkLogoFileID}
}
if tc.NonDisclosureAgreementFileID != nil {
compliancePortal.Nda = &File{ID: *tc.NonDisclosureAgreementFileID}
}
if tc.DefaultDomainID != nil {
compliancePortal.DefaultDomain = &CustomDomain{ID: *tc.DefaultDomainID}
}
if tc.CustomDomainID != nil {
compliancePortal.CustomDomain = &CustomDomain{ID: *tc.CustomDomainID}
}
return compliancePortal
}

View File

@@ -25,32 +25,32 @@ import (
"go.probo.inc/probo/pkg/page"
)
type TrustCenterAccessOrderBy = OrderBy[coredata.TrustCenterAccessOrderField]
type CompliancePortalAccessOrderBy = OrderBy[coredata.CompliancePortalAccessOrderField]
func NewTrustCenterAccessConnection(
page *page.Page[*coredata.TrustCenterAccess, coredata.TrustCenterAccessOrderField],
) *TrustCenterAccessConnection {
var edges = make([]*TrustCenterAccessEdge, len(page.Data))
func NewCompliancePortalAccessConnection(
page *page.Page[*coredata.CompliancePortalAccess, coredata.CompliancePortalAccessOrderField],
) *CompliancePortalAccessConnection {
var edges = make([]*CompliancePortalAccessEdge, len(page.Data))
for i := range edges {
edges[i] = NewTrustCenterAccessEdge(page.Data[i], page.Cursor.OrderBy.Field)
edges[i] = NewCompliancePortalAccessEdge(page.Data[i], page.Cursor.OrderBy.Field)
}
return &TrustCenterAccessConnection{
return &CompliancePortalAccessConnection{
Edges: edges,
PageInfo: NewPageInfo(page),
}
}
func NewTrustCenterAccessEdge(tca *coredata.TrustCenterAccess, orderBy coredata.TrustCenterAccessOrderField) *TrustCenterAccessEdge {
return &TrustCenterAccessEdge{
func NewCompliancePortalAccessEdge(tca *coredata.CompliancePortalAccess, orderBy coredata.CompliancePortalAccessOrderField) *CompliancePortalAccessEdge {
return &CompliancePortalAccessEdge{
Cursor: tca.CursorKey(orderBy),
Node: NewTrustCenterAccess(tca),
Node: NewCompliancePortalAccess(tca),
}
}
func NewTrustCenterAccess(tca *coredata.TrustCenterAccess) *TrustCenterAccess {
return &TrustCenterAccess{
func NewCompliancePortalAccess(tca *coredata.CompliancePortalAccess) *CompliancePortalAccess {
return &CompliancePortalAccess{
ID: tca.ID,
OrganizationID: tca.OrganizationID,
IdentityID: tca.IdentityID,

View File

@@ -0,0 +1,121 @@
// Copyright (c) 2025-2026 Probo Inc <hello@probo.com>.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
package types
import (
"time"
"go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/page"
)
type (
CompliancePortalDocumentAccessOrderBy = OrderBy[coredata.CompliancePortalDocumentAccessOrderField]
CompliancePortalDocumentAccessConnection struct {
TotalCount int
Edges []*CompliancePortalDocumentAccessEdge
PageInfo PageInfo
Resolver any
ParentID gid.GID
}
CompliancePortalDocumentAccess struct {
ID gid.GID `json:"id"`
OrganizationID gid.GID `json:"-"`
Status coredata.CompliancePortalDocumentAccessStatus `json:"status"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
CompliancePortalAccess *CompliancePortalAccess `json:"compliancePortalAccess"`
Document *Document `json:"document,omitempty"`
ReportFile *File `json:"reportFile,omitempty"`
CompliancePortalFile *CompliancePortalFile `json:"compliancePortalFile,omitempty"`
// Internal fields used by resolvers
CompliancePortalAccessID gid.GID `json:"-"`
DocumentID *gid.GID `json:"-"`
ReportFileID *gid.GID `json:"-"`
CompliancePortalFileID *gid.GID `json:"-"`
}
)
func NewCompliancePortalDocumentAccess(tcda *coredata.CompliancePortalDocumentAccess) *CompliancePortalDocumentAccess {
object := &CompliancePortalDocumentAccess{
ID: tcda.ID,
OrganizationID: tcda.OrganizationID,
Status: tcda.Status,
CreatedAt: tcda.CreatedAt,
UpdatedAt: tcda.UpdatedAt,
CompliancePortalAccessID: tcda.CompliancePortalAccessID,
DocumentID: tcda.DocumentID,
ReportFileID: tcda.ReportFileID,
CompliancePortalFileID: tcda.CompliancePortalFileID,
}
if tcda.DocumentID != nil {
object.Document = &Document{
ID: *tcda.DocumentID,
}
}
if tcda.ReportFileID != nil {
object.ReportFile = &File{
ID: *tcda.ReportFileID,
}
}
if tcda.CompliancePortalFileID != nil {
object.CompliancePortalFile = &CompliancePortalFile{
ID: *tcda.CompliancePortalFileID,
}
}
return object
}
func NewCompliancePortalDocumentAccessConnection(
p *page.Page[*coredata.CompliancePortalDocumentAccess, coredata.CompliancePortalDocumentAccessOrderField],
parentType any,
parentID gid.GID,
) *CompliancePortalDocumentAccessConnection {
var edges = make([]*CompliancePortalDocumentAccessEdge, len(p.Data))
for i := range edges {
edges[i] = NewCompliancePortalDocumentAccessEdge(p.Data[i], p.Cursor.OrderBy.Field)
}
return &CompliancePortalDocumentAccessConnection{
Edges: edges,
PageInfo: *NewPageInfo(p),
Resolver: parentType,
ParentID: parentID,
}
}
func NewCompliancePortalDocumentAccessEdge(access *coredata.CompliancePortalDocumentAccess, orderBy coredata.CompliancePortalDocumentAccessOrderField) *CompliancePortalDocumentAccessEdge {
return &CompliancePortalDocumentAccessEdge{
Cursor: access.CursorKey(orderBy),
Node: NewCompliancePortalDocumentAccess(access),
}
}

View File

@@ -26,50 +26,50 @@ import (
"go.probo.inc/probo/pkg/page"
)
type TrustCenterFileOrderBy = OrderBy[coredata.TrustCenterFileOrderField]
type CompliancePortalFileOrderBy = OrderBy[coredata.CompliancePortalFileOrderField]
type TrustCenterFileConnection struct {
TotalCount int `json:"totalCount"`
Edges []*TrustCenterFileEdge `json:"edges"`
PageInfo *PageInfo `json:"pageInfo"`
ParentID gid.GID `json:"-"`
type CompliancePortalFileConnection struct {
TotalCount int `json:"totalCount"`
Edges []*CompliancePortalFileEdge `json:"edges"`
PageInfo *PageInfo `json:"pageInfo"`
ParentID gid.GID `json:"-"`
}
func NewTrustCenterFile(tcf *coredata.TrustCenterFile) *TrustCenterFile {
return &TrustCenterFile{
ID: tcf.ID,
Name: tcf.Name,
Category: tcf.Category,
File: &File{ID: tcf.FileID},
TrustCenterVisibility: tcf.TrustCenterVisibility,
CreatedAt: tcf.CreatedAt,
UpdatedAt: tcf.UpdatedAt,
func NewCompliancePortalFile(tcf *coredata.CompliancePortalFile) *CompliancePortalFile {
return &CompliancePortalFile{
ID: tcf.ID,
Name: tcf.Name,
Category: tcf.Category,
File: &File{ID: tcf.FileID},
CompliancePortalVisibility: tcf.CompliancePortalVisibility,
CreatedAt: tcf.CreatedAt,
UpdatedAt: tcf.UpdatedAt,
Organization: &Organization{
ID: tcf.OrganizationID,
},
}
}
func NewTrustCenterFileConnection(
p *page.Page[*coredata.TrustCenterFile, coredata.TrustCenterFileOrderField],
func NewCompliancePortalFileConnection(
p *page.Page[*coredata.CompliancePortalFile, coredata.CompliancePortalFileOrderField],
parentID gid.GID,
) *TrustCenterFileConnection {
var edges = make([]*TrustCenterFileEdge, len(p.Data))
) *CompliancePortalFileConnection {
var edges = make([]*CompliancePortalFileEdge, len(p.Data))
for i := range edges {
edges[i] = NewTrustCenterFileEdge(p.Data[i], p.Cursor.OrderBy.Field)
edges[i] = NewCompliancePortalFileEdge(p.Data[i], p.Cursor.OrderBy.Field)
}
return &TrustCenterFileConnection{
return &CompliancePortalFileConnection{
Edges: edges,
PageInfo: NewPageInfo(p),
ParentID: parentID,
}
}
func NewTrustCenterFileEdge(tcf *coredata.TrustCenterFile, orderBy coredata.TrustCenterFileOrderField) *TrustCenterFileEdge {
return &TrustCenterFileEdge{
func NewCompliancePortalFileEdge(tcf *coredata.CompliancePortalFile, orderBy coredata.CompliancePortalFileOrderField) *CompliancePortalFileEdge {
return &CompliancePortalFileEdge{
Cursor: tcf.CursorKey(orderBy),
Node: NewTrustCenterFile(tcf),
Node: NewCompliancePortalFile(tcf),
}
}

View File

@@ -26,17 +26,17 @@ import (
"go.probo.inc/probo/pkg/page"
)
type TrustCenterReferenceOrderBy = OrderBy[coredata.TrustCenterReferenceOrderField]
type CompliancePortalReferenceOrderBy = OrderBy[coredata.CompliancePortalReferenceOrderField]
type TrustCenterReferenceConnection struct {
TotalCount int `json:"totalCount"`
Edges []*TrustCenterReferenceEdge `json:"edges"`
PageInfo *PageInfo `json:"pageInfo"`
ParentID gid.GID `json:"-"`
type CompliancePortalReferenceConnection struct {
TotalCount int `json:"totalCount"`
Edges []*CompliancePortalReferenceEdge `json:"edges"`
PageInfo *PageInfo `json:"pageInfo"`
ParentID gid.GID `json:"-"`
}
func NewTrustCenterReference(tcc *coredata.TrustCenterReference) *TrustCenterReference {
return &TrustCenterReference{
func NewCompliancePortalReference(tcc *coredata.CompliancePortalReference) *CompliancePortalReference {
return &CompliancePortalReference{
ID: tcc.ID,
Name: tcc.Name,
Description: tcc.Description,
@@ -48,26 +48,26 @@ func NewTrustCenterReference(tcc *coredata.TrustCenterReference) *TrustCenterRef
}
}
func NewTrustCenterReferenceConnection(
p *page.Page[*coredata.TrustCenterReference, coredata.TrustCenterReferenceOrderField],
func NewCompliancePortalReferenceConnection(
p *page.Page[*coredata.CompliancePortalReference, coredata.CompliancePortalReferenceOrderField],
parentID gid.GID,
) *TrustCenterReferenceConnection {
var edges = make([]*TrustCenterReferenceEdge, len(p.Data))
) *CompliancePortalReferenceConnection {
var edges = make([]*CompliancePortalReferenceEdge, len(p.Data))
for i := range edges {
edges[i] = NewTrustCenterReferenceEdge(p.Data[i], p.Cursor.OrderBy.Field)
edges[i] = NewCompliancePortalReferenceEdge(p.Data[i], p.Cursor.OrderBy.Field)
}
return &TrustCenterReferenceConnection{
return &CompliancePortalReferenceConnection{
Edges: edges,
PageInfo: NewPageInfo(p),
ParentID: parentID,
}
}
func NewTrustCenterReferenceEdge(tcc *coredata.TrustCenterReference, orderBy coredata.TrustCenterReferenceOrderField) *TrustCenterReferenceEdge {
return &TrustCenterReferenceEdge{
func NewCompliancePortalReferenceEdge(tcc *coredata.CompliancePortalReference, orderBy coredata.CompliancePortalReferenceOrderField) *CompliancePortalReferenceEdge {
return &CompliancePortalReferenceEdge{
Cursor: tcc.CursorKey(orderBy),
Node: NewTrustCenterReference(tcc),
Node: NewCompliancePortalReference(tcc),
}
}

View File

@@ -85,13 +85,13 @@ func NewDocument(document *coredata.Document) *Document {
Organization: &Organization{
ID: document.OrganizationID,
},
CurrentPublishedMajor: document.CurrentPublishedMajor,
CurrentPublishedMinor: document.CurrentPublishedMinor,
WriteMode: document.WriteMode,
TrustCenterVisibility: document.TrustCenterVisibility,
Status: document.Status,
ArchivedAt: document.ArchivedAt,
CreatedAt: document.CreatedAt,
UpdatedAt: document.UpdatedAt,
CurrentPublishedMajor: document.CurrentPublishedMajor,
CurrentPublishedMinor: document.CurrentPublishedMinor,
WriteMode: document.WriteMode,
CompliancePortalVisibility: document.CompliancePortalVisibility,
Status: document.Status,
ArchivedAt: document.ArchivedAt,
CreatedAt: document.CreatedAt,
UpdatedAt: document.UpdatedAt,
}
}

View File

@@ -91,7 +91,7 @@ func NewThirdParty(v *coredata.ThirdParty) *ThirdParty {
LegalName: v.LegalName,
WebsiteURL: v.WebsiteURL,
Category: v.Category,
ShowOnTrustCenter: v.ShowOnTrustCenter,
ShowOnCompliancePortal: v.ShowOnCompliancePortal,
Level: v.Level,
Countries: v.Countries,
UpdatedAt: v.UpdatedAt,

View File

@@ -1,96 +0,0 @@
// Copyright (c) 2025-2026 Probo Inc <hello@probo.com>.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
package types
import (
"time"
"go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/gid"
)
type TrustCenter struct {
ID gid.GID `json:"id"`
Active bool `json:"active"`
SearchEngineIndexing coredata.SearchEngineIndexing `json:"searchEngineIndexing"`
Logo *File `json:"logo,omitempty"`
DarkLogo *File `json:"darkLogo,omitempty"`
Nda *File `json:"nda,omitempty"`
Description *string `json:"description,omitempty"`
WebsiteURL *string `json:"websiteUrl,omitempty"`
Email *string `json:"email,omitempty"`
HeadquarterAddress *string `json:"headquarterAddress,omitempty"`
Title string `json:"title"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Organization *Organization `json:"organization"`
Accesses *TrustCenterAccessConnection `json:"accesses"`
References *TrustCenterReferenceConnection `json:"references"`
ComplianceFrameworks *ComplianceFrameworkConnection `json:"complianceFrameworks"`
CustomLinks *ComplianceCustomLinkConnection `json:"customLinks"`
MailingList *MailingList `json:"mailingList,omitempty"`
DefaultDomain *CustomDomain `json:"defaultDomain,omitempty"`
CustomDomain *CustomDomain `json:"customDomain,omitempty"`
Permission bool `json:"permission"`
}
func (TrustCenter) IsNode() {}
func (t TrustCenter) GetID() gid.GID { return t.ID }
func NewTrustCenter(tc *coredata.TrustCenter) *TrustCenter {
trustCenter := &TrustCenter{
ID: tc.ID,
Organization: &Organization{
ID: tc.OrganizationID,
},
Active: tc.Active,
SearchEngineIndexing: tc.SearchEngineIndexing,
Description: tc.Description,
WebsiteURL: tc.WebsiteURL,
Email: tc.Email,
HeadquarterAddress: tc.HeadquarterAddress,
Title: tc.Title,
CreatedAt: tc.CreatedAt,
UpdatedAt: tc.UpdatedAt,
}
if tc.LogoFileID != nil {
trustCenter.Logo = &File{ID: *tc.LogoFileID}
}
if tc.DarkLogoFileID != nil {
trustCenter.DarkLogo = &File{ID: *tc.DarkLogoFileID}
}
if tc.NonDisclosureAgreementFileID != nil {
trustCenter.Nda = &File{ID: *tc.NonDisclosureAgreementFileID}
}
if tc.DefaultDomainID != nil {
trustCenter.DefaultDomain = &CustomDomain{ID: *tc.DefaultDomainID}
}
if tc.CustomDomainID != nil {
trustCenter.CustomDomain = &CustomDomain{ID: *tc.CustomDomainID}
}
return trustCenter
}

View File

@@ -1,121 +0,0 @@
// Copyright (c) 2025-2026 Probo Inc <hello@probo.com>.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
package types
import (
"time"
"go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/page"
)
type (
TrustCenterDocumentAccessOrderBy = OrderBy[coredata.TrustCenterDocumentAccessOrderField]
TrustCenterDocumentAccessConnection struct {
TotalCount int
Edges []*TrustCenterDocumentAccessEdge
PageInfo PageInfo
Resolver any
ParentID gid.GID
}
TrustCenterDocumentAccess struct {
ID gid.GID `json:"id"`
OrganizationID gid.GID `json:"-"`
Status coredata.TrustCenterDocumentAccessStatus `json:"status"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
TrustCenterAccess *TrustCenterAccess `json:"trustCenterAccess"`
Document *Document `json:"document,omitempty"`
ReportFile *File `json:"reportFile,omitempty"`
TrustCenterFile *TrustCenterFile `json:"trustCenterFile,omitempty"`
// Internal fields used by resolvers
TrustCenterAccessID gid.GID `json:"-"`
DocumentID *gid.GID `json:"-"`
ReportFileID *gid.GID `json:"-"`
TrustCenterFileID *gid.GID `json:"-"`
}
)
func NewTrustCenterDocumentAccess(tcda *coredata.TrustCenterDocumentAccess) *TrustCenterDocumentAccess {
object := &TrustCenterDocumentAccess{
ID: tcda.ID,
OrganizationID: tcda.OrganizationID,
Status: tcda.Status,
CreatedAt: tcda.CreatedAt,
UpdatedAt: tcda.UpdatedAt,
TrustCenterAccessID: tcda.TrustCenterAccessID,
DocumentID: tcda.DocumentID,
ReportFileID: tcda.ReportFileID,
TrustCenterFileID: tcda.TrustCenterFileID,
}
if tcda.DocumentID != nil {
object.Document = &Document{
ID: *tcda.DocumentID,
}
}
if tcda.ReportFileID != nil {
object.ReportFile = &File{
ID: *tcda.ReportFileID,
}
}
if tcda.TrustCenterFileID != nil {
object.TrustCenterFile = &TrustCenterFile{
ID: *tcda.TrustCenterFileID,
}
}
return object
}
func NewTrustCenterDocumentAccessConnection(
p *page.Page[*coredata.TrustCenterDocumentAccess, coredata.TrustCenterDocumentAccessOrderField],
parentType any,
parentID gid.GID,
) *TrustCenterDocumentAccessConnection {
var edges = make([]*TrustCenterDocumentAccessEdge, len(p.Data))
for i := range edges {
edges[i] = NewTrustCenterDocumentAccessEdge(p.Data[i], p.Cursor.OrderBy.Field)
}
return &TrustCenterDocumentAccessConnection{
Edges: edges,
PageInfo: *NewPageInfo(p),
Resolver: parentType,
ParentID: parentID,
}
}
func NewTrustCenterDocumentAccessEdge(access *coredata.TrustCenterDocumentAccess, orderBy coredata.TrustCenterDocumentAccessOrderField) *TrustCenterDocumentAccessEdge {
return &TrustCenterDocumentAccessEdge{
Cursor: access.CursorKey(orderBy),
Node: NewTrustCenterDocumentAccess(access),
}
}