@@ -1227,6 +1227,20 @@ enum TrustCenterReferenceOrderField
|
||||
)
|
||||
}
|
||||
|
||||
enum ComplianceExternalURLOrderField
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/coredata.ComplianceExternalURLOrderField"
|
||||
) {
|
||||
CREATED_AT
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.ComplianceExternalURLOrderFieldCreatedAt"
|
||||
)
|
||||
RANK
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.ComplianceExternalURLOrderFieldRank"
|
||||
)
|
||||
}
|
||||
|
||||
enum ComplianceFrameworkOrderField
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/coredata.ComplianceFrameworkOrderField"
|
||||
@@ -1491,6 +1505,14 @@ input TrustCenterFileOrder
|
||||
field: TrustCenterFileOrderField!
|
||||
}
|
||||
|
||||
input ComplianceExternalURLOrder
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.ComplianceExternalURLOrderBy"
|
||||
) {
|
||||
direction: OrderDirection!
|
||||
field: ComplianceExternalURLOrderField!
|
||||
}
|
||||
|
||||
input ComplianceFrameworkOrder
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.ComplianceFrameworkOrderBy"
|
||||
@@ -1658,6 +1680,14 @@ type TrustCenter implements Node {
|
||||
orderBy: ComplianceFrameworkOrder
|
||||
): ComplianceFrameworkConnection! @goField(forceResolver: true)
|
||||
|
||||
externalUrls(
|
||||
first: Int
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: ComplianceExternalURLOrder
|
||||
): ComplianceExternalURLConnection! @goField(forceResolver: true)
|
||||
|
||||
permission(action: String!): Boolean! @goField(forceResolver: true)
|
||||
}
|
||||
|
||||
@@ -2882,6 +2912,30 @@ type ComplianceFrameworkEdge {
|
||||
node: ComplianceFramework!
|
||||
}
|
||||
|
||||
type ComplianceExternalURL implements Node {
|
||||
id: ID!
|
||||
name: String!
|
||||
url: String!
|
||||
rank: Int!
|
||||
createdAt: Datetime!
|
||||
updatedAt: Datetime!
|
||||
|
||||
permission(action: String!): Boolean! @goField(forceResolver: true)
|
||||
}
|
||||
|
||||
type ComplianceExternalURLConnection
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.ComplianceExternalURLConnection"
|
||||
) {
|
||||
edges: [ComplianceExternalURLEdge!]!
|
||||
pageInfo: PageInfo!
|
||||
}
|
||||
|
||||
type ComplianceExternalURLEdge {
|
||||
cursor: CursorKey!
|
||||
node: ComplianceExternalURL!
|
||||
}
|
||||
|
||||
type TrustCenterFile implements Node {
|
||||
id: ID!
|
||||
name: String!
|
||||
@@ -3330,6 +3384,15 @@ type Mutation {
|
||||
deleteComplianceFramework(
|
||||
input: DeleteComplianceFrameworkInput!
|
||||
): DeleteComplianceFrameworkPayload!
|
||||
createComplianceExternalURL(
|
||||
input: CreateComplianceExternalURLInput!
|
||||
): CreateComplianceExternalURLPayload!
|
||||
updateComplianceExternalURL(
|
||||
input: UpdateComplianceExternalURLInput!
|
||||
): UpdateComplianceExternalURLPayload!
|
||||
deleteComplianceExternalURL(
|
||||
input: DeleteComplianceExternalURLInput!
|
||||
): DeleteComplianceExternalURLPayload!
|
||||
# Trust Center File mutations
|
||||
createTrustCenterFile(
|
||||
input: CreateTrustCenterFileInput!
|
||||
@@ -3738,6 +3801,23 @@ input DeleteComplianceFrameworkInput {
|
||||
id: ID!
|
||||
}
|
||||
|
||||
input CreateComplianceExternalURLInput {
|
||||
trustCenterId: ID!
|
||||
name: String!
|
||||
url: String!
|
||||
}
|
||||
|
||||
input UpdateComplianceExternalURLInput {
|
||||
id: ID!
|
||||
name: String!
|
||||
url: String!
|
||||
rank: Int
|
||||
}
|
||||
|
||||
input DeleteComplianceExternalURLInput {
|
||||
id: ID!
|
||||
}
|
||||
|
||||
input CreateTrustCenterFileInput {
|
||||
organizationId: ID!
|
||||
name: String!
|
||||
@@ -4561,6 +4641,18 @@ type DeleteComplianceFrameworkPayload {
|
||||
deletedComplianceFrameworkId: ID!
|
||||
}
|
||||
|
||||
type CreateComplianceExternalURLPayload {
|
||||
complianceExternalUrlEdge: ComplianceExternalURLEdge!
|
||||
}
|
||||
|
||||
type UpdateComplianceExternalURLPayload {
|
||||
complianceExternalUrl: ComplianceExternalURL!
|
||||
}
|
||||
|
||||
type DeleteComplianceExternalURLPayload {
|
||||
deletedComplianceExternalUrlId: ID!
|
||||
}
|
||||
|
||||
type CreateTrustCenterFilePayload {
|
||||
trustCenterFileEdge: TrustCenterFileEdge!
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
44
pkg/server/api/console/v1/types/compliance_external_url.go
Normal file
44
pkg/server/api/console/v1/types/compliance_external_url.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"go.probo.inc/probo/pkg/coredata"
|
||||
"go.probo.inc/probo/pkg/page"
|
||||
)
|
||||
|
||||
type ComplianceExternalURLOrderBy = OrderBy[coredata.ComplianceExternalURLOrderField]
|
||||
|
||||
type ComplianceExternalURLConnection struct {
|
||||
Edges []*ComplianceExternalURLEdge `json:"edges"`
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
}
|
||||
|
||||
func NewComplianceExternalURL(c *coredata.ComplianceExternalURL) *ComplianceExternalURL {
|
||||
return &ComplianceExternalURL{
|
||||
ID: c.ID,
|
||||
Name: c.Name,
|
||||
URL: c.URL,
|
||||
Rank: c.Rank,
|
||||
CreatedAt: c.CreatedAt,
|
||||
UpdatedAt: c.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func NewComplianceExternalURLConnection(
|
||||
p *page.Page[*coredata.ComplianceExternalURL, coredata.ComplianceExternalURLOrderField],
|
||||
) *ComplianceExternalURLConnection {
|
||||
edges := make([]*ComplianceExternalURLEdge, len(p.Data))
|
||||
for i := range edges {
|
||||
edges[i] = NewComplianceExternalURLEdge(p.Data[i], p.Cursor.OrderBy.Field)
|
||||
}
|
||||
return &ComplianceExternalURLConnection{
|
||||
Edges: edges,
|
||||
PageInfo: NewPageInfo(p),
|
||||
}
|
||||
}
|
||||
|
||||
func NewComplianceExternalURLEdge(c *coredata.ComplianceExternalURL, orderBy coredata.ComplianceExternalURLOrderField) *ComplianceExternalURLEdge {
|
||||
return &ComplianceExternalURLEdge{
|
||||
Cursor: c.CursorKey(orderBy),
|
||||
Node: NewComplianceExternalURL(c),
|
||||
}
|
||||
}
|
||||
@@ -149,6 +149,24 @@ type CancelSignatureRequestPayload struct {
|
||||
DeletedDocumentVersionSignatureID gid.GID `json:"deletedDocumentVersionSignatureId"`
|
||||
}
|
||||
|
||||
type ComplianceExternalURL struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
URL string `json:"url"`
|
||||
Rank int `json:"rank"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (ComplianceExternalURL) IsNode() {}
|
||||
func (this ComplianceExternalURL) GetID() gid.GID { return this.ID }
|
||||
|
||||
type ComplianceExternalURLEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *ComplianceExternalURL `json:"node"`
|
||||
}
|
||||
|
||||
type ComplianceFrameworkEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *ComplianceFramework `json:"node"`
|
||||
@@ -255,6 +273,16 @@ type CreateAuditPayload struct {
|
||||
AuditEdge *AuditEdge `json:"auditEdge"`
|
||||
}
|
||||
|
||||
type CreateComplianceExternalURLInput struct {
|
||||
TrustCenterID gid.GID `json:"trustCenterId"`
|
||||
Name string `json:"name"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
type CreateComplianceExternalURLPayload struct {
|
||||
ComplianceExternalURLEdge *ComplianceExternalURLEdge `json:"complianceExternalUrlEdge"`
|
||||
}
|
||||
|
||||
type CreateComplianceFrameworkInput struct {
|
||||
TrustCenterID gid.GID `json:"trustCenterId"`
|
||||
FrameworkID gid.GID `json:"frameworkId"`
|
||||
@@ -793,6 +821,14 @@ type DeleteAuditReportPayload struct {
|
||||
Audit *Audit `json:"audit"`
|
||||
}
|
||||
|
||||
type DeleteComplianceExternalURLInput struct {
|
||||
ID gid.GID `json:"id"`
|
||||
}
|
||||
|
||||
type DeleteComplianceExternalURLPayload struct {
|
||||
DeletedComplianceExternalURLID gid.GID `json:"deletedComplianceExternalUrlId"`
|
||||
}
|
||||
|
||||
type DeleteComplianceFrameworkInput struct {
|
||||
ID gid.GID `json:"id"`
|
||||
}
|
||||
@@ -1864,19 +1900,20 @@ type TransferImpactAssessmentFilter struct {
|
||||
}
|
||||
|
||||
type TrustCenter struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Active bool `json:"active"`
|
||||
LogoFileURL *string `json:"logoFileUrl,omitempty"`
|
||||
DarkLogoFileURL *string `json:"darkLogoFileUrl,omitempty"`
|
||||
NdaFileName *string `json:"ndaFileName,omitempty"`
|
||||
NdaFileURL *string `json:"ndaFileUrl,omitempty"`
|
||||
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"`
|
||||
Permission bool `json:"permission"`
|
||||
ID gid.GID `json:"id"`
|
||||
Active bool `json:"active"`
|
||||
LogoFileURL *string `json:"logoFileUrl,omitempty"`
|
||||
DarkLogoFileURL *string `json:"darkLogoFileUrl,omitempty"`
|
||||
NdaFileName *string `json:"ndaFileName,omitempty"`
|
||||
NdaFileURL *string `json:"ndaFileUrl,omitempty"`
|
||||
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"`
|
||||
ExternalUrls *ComplianceExternalURLConnection `json:"externalUrls"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (TrustCenter) IsNode() {}
|
||||
@@ -2006,6 +2043,17 @@ type UpdateAuditPayload struct {
|
||||
Audit *Audit `json:"audit"`
|
||||
}
|
||||
|
||||
type UpdateComplianceExternalURLInput struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
URL string `json:"url"`
|
||||
Rank *int `json:"rank,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateComplianceExternalURLPayload struct {
|
||||
ComplianceExternalURL *ComplianceExternalURL `json:"complianceExternalUrl"`
|
||||
}
|
||||
|
||||
type UpdateComplianceFrameworkInput struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Rank int `json:"rank"`
|
||||
|
||||
@@ -324,6 +324,11 @@ func (r *auditConnectionResolver) TotalCount(ctx context.Context, obj *types.Aud
|
||||
return count, nil
|
||||
}
|
||||
|
||||
// Permission is the resolver for the permission field.
|
||||
func (r *complianceExternalURLResolver) Permission(ctx context.Context, obj *types.ComplianceExternalURL, action string) (bool, error) {
|
||||
return r.Resolver.Permission(ctx, obj, action)
|
||||
}
|
||||
|
||||
// Framework is the resolver for the framework field.
|
||||
func (r *complianceFrameworkResolver) Framework(ctx context.Context, obj *types.ComplianceFramework) (*types.Framework, error) {
|
||||
if err := r.authorize(ctx, obj.FrameworkID, probo.ActionFrameworkGet); err != nil {
|
||||
@@ -2141,6 +2146,74 @@ func (r *mutationResolver) DeleteComplianceFramework(ctx context.Context, input
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CreateComplianceExternalURL is the resolver for the createComplianceExternalURL field.
|
||||
func (r *mutationResolver) CreateComplianceExternalURL(ctx context.Context, input types.CreateComplianceExternalURLInput) (*types.CreateComplianceExternalURLPayload, error) {
|
||||
if err := r.authorize(ctx, input.TrustCenterID, probo.ActionComplianceExternalURLCreate); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.ProboService(ctx, input.TrustCenterID.TenantID())
|
||||
|
||||
item, err := prb.ComplianceExternalURLs.Create(
|
||||
ctx,
|
||||
&probo.CreateComplianceExternalURLRequest{
|
||||
TrustCenterID: input.TrustCenterID,
|
||||
Name: input.Name,
|
||||
URL: input.URL,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot create compliance external URL", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
}
|
||||
|
||||
return &types.CreateComplianceExternalURLPayload{
|
||||
ComplianceExternalURLEdge: types.NewComplianceExternalURLEdge(item, coredata.ComplianceExternalURLOrderFieldRank),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// UpdateComplianceExternalURL is the resolver for the updateComplianceExternalURL field.
|
||||
func (r *mutationResolver) UpdateComplianceExternalURL(ctx context.Context, input types.UpdateComplianceExternalURLInput) (*types.UpdateComplianceExternalURLPayload, error) {
|
||||
if err := r.authorize(ctx, input.ID, probo.ActionComplianceExternalURLUpdate); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.ProboService(ctx, input.ID.TenantID())
|
||||
|
||||
item, err := prb.ComplianceExternalURLs.Update(ctx, &probo.UpdateComplianceExternalURLRequest{
|
||||
ID: input.ID,
|
||||
Name: input.Name,
|
||||
URL: input.URL,
|
||||
Rank: input.Rank,
|
||||
})
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot update compliance external URL", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
}
|
||||
|
||||
return &types.UpdateComplianceExternalURLPayload{
|
||||
ComplianceExternalURL: types.NewComplianceExternalURL(item),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// DeleteComplianceExternalURL is the resolver for the deleteComplianceExternalURL field.
|
||||
func (r *mutationResolver) DeleteComplianceExternalURL(ctx context.Context, input types.DeleteComplianceExternalURLInput) (*types.DeleteComplianceExternalURLPayload, error) {
|
||||
if err := r.authorize(ctx, input.ID, probo.ActionComplianceExternalURLDelete); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.ProboService(ctx, input.ID.TenantID())
|
||||
|
||||
if err := prb.ComplianceExternalURLs.Delete(ctx, &probo.DeleteComplianceExternalURLRequest{ID: input.ID}); err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot delete compliance external URL", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
}
|
||||
|
||||
return &types.DeleteComplianceExternalURLPayload{
|
||||
DeletedComplianceExternalURLID: input.ID,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CreateTrustCenterFile is the resolver for the createTrustCenterFile field.
|
||||
func (r *mutationResolver) CreateTrustCenterFile(ctx context.Context, input types.CreateTrustCenterFileInput) (*types.CreateTrustCenterFilePayload, error) {
|
||||
if err := r.authorize(ctx, input.OrganizationID, probo.ActionTrustCenterFileCreate); err != nil {
|
||||
@@ -7887,6 +7960,36 @@ func (r *trustCenterResolver) ComplianceFrameworks(ctx context.Context, obj *typ
|
||||
return types.NewComplianceFrameworkConnection(result), nil
|
||||
}
|
||||
|
||||
// ExternalUrls is the resolver for the externalUrls field.
|
||||
func (r *trustCenterResolver) ExternalUrls(ctx context.Context, obj *types.TrustCenter, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.ComplianceExternalURLOrderField]) (*types.ComplianceExternalURLConnection, error) {
|
||||
if err := r.authorize(ctx, obj.ID, probo.ActionComplianceExternalURLList); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.ComplianceExternalURLOrderField]{
|
||||
Field: coredata.ComplianceExternalURLOrderFieldRank,
|
||||
Direction: page.OrderDirectionAsc,
|
||||
}
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ComplianceExternalURLOrderField]{
|
||||
Field: orderBy.Field,
|
||||
Direction: orderBy.Direction,
|
||||
}
|
||||
}
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
result, err := prb.ComplianceExternalURLs.List(ctx, obj.ID, cursor)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list compliance external URLs", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
}
|
||||
|
||||
return types.NewComplianceExternalURLConnection(result), nil
|
||||
}
|
||||
|
||||
// Permission is the resolver for the permission field.
|
||||
func (r *trustCenterResolver) Permission(ctx context.Context, obj *types.TrustCenter, action string) (bool, error) {
|
||||
return r.Resolver.Permission(ctx, obj, action)
|
||||
@@ -8868,6 +8971,11 @@ func (r *Resolver) AuditConnection() schema.AuditConnectionResolver {
|
||||
return &auditConnectionResolver{r}
|
||||
}
|
||||
|
||||
// ComplianceExternalURL returns schema.ComplianceExternalURLResolver implementation.
|
||||
func (r *Resolver) ComplianceExternalURL() schema.ComplianceExternalURLResolver {
|
||||
return &complianceExternalURLResolver{r}
|
||||
}
|
||||
|
||||
// ComplianceFramework returns schema.ComplianceFrameworkResolver implementation.
|
||||
func (r *Resolver) ComplianceFramework() schema.ComplianceFrameworkResolver {
|
||||
return &complianceFrameworkResolver{r}
|
||||
@@ -9175,6 +9283,7 @@ type assetResolver struct{ *Resolver }
|
||||
type assetConnectionResolver struct{ *Resolver }
|
||||
type auditResolver struct{ *Resolver }
|
||||
type auditConnectionResolver struct{ *Resolver }
|
||||
type complianceExternalURLResolver struct{ *Resolver }
|
||||
type complianceFrameworkResolver struct{ *Resolver }
|
||||
type continualImprovementResolver struct{ *Resolver }
|
||||
type continualImprovementConnectionResolver struct{ *Resolver }
|
||||
|
||||
Reference in New Issue
Block a user