Stop tracking generated files
Run make generate in CI lint and test jobs since generated files are now gitignored. Also include Relay codegen for frontend apps in the generate target. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -30,13 +30,6 @@ import (
|
||||
"go.probo.inc/probo/pkg/gid"
|
||||
"go.probo.inc/probo/pkg/mail"
|
||||
"go.probo.inc/probo/pkg/page"
|
||||
"go.probo.inc/probo/pkg/validator"
|
||||
)
|
||||
|
||||
const (
|
||||
updateTitleMaxLength = 200
|
||||
updateBodyMaxLength = 50000
|
||||
subscriberFullNameMaxLength = 200
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -58,56 +51,6 @@ func NewService(pgClient *pg.Client, fm *filemanager.Service, tokenSecret string
|
||||
return &Service{pg: pgClient, fm: fm, tokenSecret: tokenSecret, apiBaseURL: apiBaseURL, bucket: bucket, encryptionKey: encryptionKey, logger: logger}
|
||||
}
|
||||
|
||||
type (
|
||||
CreateMailingListUpdateRequest struct {
|
||||
MailingListID gid.GID
|
||||
Title string
|
||||
Body string
|
||||
}
|
||||
|
||||
UpdateMailingListUpdateRequest struct {
|
||||
ID gid.GID
|
||||
Title *string
|
||||
Body *string
|
||||
}
|
||||
|
||||
CreateSubscriberRequest struct {
|
||||
MailingListID gid.GID
|
||||
Email mail.Addr
|
||||
FullName string
|
||||
}
|
||||
)
|
||||
|
||||
func (r *CreateMailingListUpdateRequest) Validate() error {
|
||||
v := validator.New()
|
||||
|
||||
v.Check(r.MailingListID, "mailing_list_id", validator.Required(), validator.GID(coredata.MailingListEntityType))
|
||||
v.Check(r.Title, "title", validator.Required(), validator.SafeText(updateTitleMaxLength))
|
||||
v.Check(r.Body, "body", validator.Required(), validator.SafeText(updateBodyMaxLength))
|
||||
|
||||
return v.Error()
|
||||
}
|
||||
|
||||
func (r *UpdateMailingListUpdateRequest) Validate() error {
|
||||
v := validator.New()
|
||||
|
||||
v.Check(r.ID, "id", validator.Required(), validator.GID(coredata.MailingListUpdateEntityType))
|
||||
v.Check(r.Title, "title", validator.SafeText(updateTitleMaxLength))
|
||||
v.Check(r.Body, "body", validator.SafeText(updateBodyMaxLength))
|
||||
|
||||
return v.Error()
|
||||
}
|
||||
|
||||
func (r *CreateSubscriberRequest) Validate() error {
|
||||
v := validator.New()
|
||||
|
||||
v.Check(r.MailingListID, "mailing_list_id", validator.Required(), validator.GID(coredata.MailingListEntityType))
|
||||
v.Check(r.Email, "email", validator.Required(), validator.NotEmpty())
|
||||
v.Check(r.FullName, "full_name", validator.Required(), validator.SafeText(subscriberFullNameMaxLength))
|
||||
|
||||
return v.Error()
|
||||
}
|
||||
|
||||
func (s *Service) UpdateMailingList(
|
||||
ctx context.Context,
|
||||
id gid.GID,
|
||||
@@ -173,16 +116,10 @@ func (s *Service) GetSubscriber(
|
||||
|
||||
func (s *Service) CreateSubscriber(
|
||||
ctx context.Context,
|
||||
req *CreateSubscriberRequest,
|
||||
mailingListID gid.GID,
|
||||
email mail.Addr,
|
||||
fullName string,
|
||||
) (*coredata.MailingListSubscriber, error) {
|
||||
if err := req.Validate(); err != nil {
|
||||
return nil, fmt.Errorf("invalid request: %w", err)
|
||||
}
|
||||
|
||||
mailingListID := req.MailingListID
|
||||
email := req.Email
|
||||
fullName := req.FullName
|
||||
|
||||
scope := coredata.NewScopeFromObjectID(mailingListID)
|
||||
emailRecord, err := s.buildConfirmationMail(ctx, mailingListID, email, fullName)
|
||||
if err != nil {
|
||||
@@ -397,21 +334,18 @@ func (s *Service) ListSubscribers(
|
||||
|
||||
func (s *Service) CreateMailingListUpdate(
|
||||
ctx context.Context,
|
||||
req *CreateMailingListUpdateRequest,
|
||||
mailingListID gid.GID,
|
||||
title string,
|
||||
body string,
|
||||
) (*coredata.MailingListUpdate, error) {
|
||||
if err := req.Validate(); err != nil {
|
||||
return nil, fmt.Errorf("invalid request: %w", err)
|
||||
}
|
||||
|
||||
mailingListID := req.MailingListID
|
||||
scope := coredata.NewScopeFromObjectID(mailingListID)
|
||||
now := time.Now()
|
||||
|
||||
mlu := &coredata.MailingListUpdate{
|
||||
ID: gid.New(scope.GetTenantID(), coredata.MailingListUpdateEntityType),
|
||||
MailingListID: mailingListID,
|
||||
Title: req.Title,
|
||||
Body: req.Body,
|
||||
Title: title,
|
||||
Body: body,
|
||||
Status: coredata.MailingListUpdateStatusDraft,
|
||||
CreatedAt: now,
|
||||
UpdatedAt: now,
|
||||
@@ -472,19 +406,17 @@ func (s *Service) GetMailingListUpdate(
|
||||
|
||||
func (s *Service) UpdateMailingListUpdate(
|
||||
ctx context.Context,
|
||||
req *UpdateMailingListUpdateRequest,
|
||||
id gid.GID,
|
||||
title string,
|
||||
body string,
|
||||
) (*coredata.MailingListUpdate, error) {
|
||||
if err := req.Validate(); err != nil {
|
||||
return nil, fmt.Errorf("invalid request: %w", err)
|
||||
}
|
||||
|
||||
scope := coredata.NewScopeFromObjectID(req.ID)
|
||||
scope := coredata.NewScopeFromObjectID(id)
|
||||
var mlu coredata.MailingListUpdate
|
||||
|
||||
err := s.pg.WithConn(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
if err := mlu.LoadByID(ctx, conn, scope, req.ID); err != nil {
|
||||
if err := mlu.LoadByID(ctx, conn, scope, id); err != nil {
|
||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||
return ErrMailingListUpdateNotFound
|
||||
}
|
||||
@@ -495,12 +427,8 @@ func (s *Service) UpdateMailingListUpdate(
|
||||
return ErrMailingListUpdateAlreadySent
|
||||
}
|
||||
|
||||
if req.Title != nil {
|
||||
mlu.Title = *req.Title
|
||||
}
|
||||
if req.Body != nil {
|
||||
mlu.Body = *req.Body
|
||||
}
|
||||
mlu.Title = title
|
||||
mlu.Body = body
|
||||
mlu.UpdatedAt = time.Now()
|
||||
|
||||
if err := mlu.Update(ctx, conn, scope); err != nil {
|
||||
|
||||
3
pkg/server/api/connect/v1/schema/.gitignore
vendored
Normal file
3
pkg/server/api/connect/v1/schema/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*
|
||||
!.gitignore
|
||||
!doc.go
|
||||
17
pkg/server/api/connect/v1/schema/doc.go
Normal file
17
pkg/server/api/connect/v1/schema/doc.go
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
// Package schema contains the generated GraphQL executable schema for the
|
||||
// Connect API.
|
||||
package schema
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,666 +0,0 @@
|
||||
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/99designs/gqlgen/graphql"
|
||||
"go.probo.inc/probo/pkg/coredata"
|
||||
"go.probo.inc/probo/pkg/gid"
|
||||
"go.probo.inc/probo/pkg/mail"
|
||||
"go.probo.inc/probo/pkg/page"
|
||||
)
|
||||
|
||||
type AssumeOrganizationSessionResult interface {
|
||||
IsAssumeOrganizationSessionResult()
|
||||
}
|
||||
|
||||
type Node interface {
|
||||
IsNode()
|
||||
GetID() gid.GID
|
||||
}
|
||||
|
||||
type ActivateAccountInput struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
type ActivateAccountPayload struct {
|
||||
CreatePasswordToken *string `json:"createPasswordToken,omitempty"`
|
||||
SsoLoginURL *string `json:"ssoLoginUrl,omitempty"`
|
||||
Profile *Profile `json:"profile,omitempty"`
|
||||
}
|
||||
|
||||
type ActivateUserInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
ProfileID gid.GID `json:"profileId"`
|
||||
}
|
||||
|
||||
type AssumeOrganizationSessionInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
Continue string `json:"continue"`
|
||||
}
|
||||
|
||||
type AssumeOrganizationSessionPayload struct {
|
||||
Result AssumeOrganizationSessionResult `json:"result"`
|
||||
}
|
||||
|
||||
type ChangeEmailInput struct {
|
||||
NewEmail mail.Addr `json:"newEmail"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type ChangeEmailPayload struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type ChangePasswordInput struct {
|
||||
CurrentPassword string `json:"currentPassword"`
|
||||
NewPassword string `json:"newPassword"`
|
||||
}
|
||||
|
||||
type ChangePasswordPayload struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type Connector struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Provider coredata.ConnectorProvider `json:"provider"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (Connector) IsNode() {}
|
||||
func (this Connector) GetID() gid.GID { return this.ID }
|
||||
|
||||
type CreateOrganizationInput struct {
|
||||
Name string `json:"name"`
|
||||
LogoFile *graphql.Upload `json:"logoFile,omitempty"`
|
||||
HorizontalLogoFile *graphql.Upload `json:"horizontalLogoFile,omitempty"`
|
||||
}
|
||||
|
||||
type CreateOrganizationPayload struct {
|
||||
Organization *Organization `json:"organization,omitempty"`
|
||||
Profile *Profile `json:"profile"`
|
||||
}
|
||||
|
||||
type CreatePersonalAPIKeyInput struct {
|
||||
Name string `json:"name"`
|
||||
ExpiresAt time.Time `json:"expiresAt"`
|
||||
}
|
||||
|
||||
type CreatePersonalAPIKeyPayload struct {
|
||||
PersonalAPIKeyEdge *PersonalAPIKeyEdge `json:"personalAPIKeyEdge"`
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
type CreateSAMLConfigurationInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
EmailDomain string `json:"emailDomain"`
|
||||
IdpEntityID string `json:"idpEntityId"`
|
||||
IdpSsoURL string `json:"idpSsoUrl"`
|
||||
IdpCertificate string `json:"idpCertificate"`
|
||||
AutoSignupEnabled bool `json:"autoSignupEnabled"`
|
||||
AttributeMappings *SAMLAttributeMappingsInput `json:"attributeMappings,omitempty"`
|
||||
}
|
||||
|
||||
type CreateSAMLConfigurationPayload struct {
|
||||
SamlConfigurationEdge *SAMLConfigurationEdge `json:"samlConfigurationEdge"`
|
||||
}
|
||||
|
||||
type CreateSCIMConfigurationInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
ConnectorID *gid.GID `json:"connectorId,omitempty"`
|
||||
}
|
||||
|
||||
type CreateSCIMConfigurationPayload struct {
|
||||
ScimConfiguration *SCIMConfiguration `json:"scimConfiguration"`
|
||||
ScimBridge *SCIMBridge `json:"scimBridge,omitempty"`
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
type CreateUserInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
FullName string `json:"fullName"`
|
||||
EmailAddress mail.Addr `json:"emailAddress"`
|
||||
Role coredata.MembershipRole `json:"role"`
|
||||
AdditionalEmailAddresses []mail.Addr `json:"additionalEmailAddresses,omitempty"`
|
||||
Kind *string `json:"kind,omitempty"`
|
||||
Position *string `json:"position,omitempty"`
|
||||
ContractStartDate graphql.Omittable[*time.Time] `json:"contractStartDate,omitempty"`
|
||||
ContractEndDate graphql.Omittable[*time.Time] `json:"contractEndDate,omitempty"`
|
||||
}
|
||||
|
||||
type CreateUserPayload struct {
|
||||
ProfileEdge *ProfileEdge `json:"profileEdge"`
|
||||
}
|
||||
|
||||
type DeactivateUserInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
ProfileID gid.GID `json:"profileId"`
|
||||
}
|
||||
|
||||
type DeactivateUserPayload struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type DeleteOrganizationHorizontalLogoInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
}
|
||||
|
||||
type DeleteOrganizationHorizontalLogoPayload struct {
|
||||
Organization *Organization `json:"organization"`
|
||||
}
|
||||
|
||||
type DeleteOrganizationInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
}
|
||||
|
||||
type DeleteOrganizationPayload struct {
|
||||
DeletedOrganizationID gid.GID `json:"deletedOrganizationId"`
|
||||
}
|
||||
|
||||
type DeleteSAMLConfigurationInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
SamlConfigurationID gid.GID `json:"samlConfigurationId"`
|
||||
}
|
||||
|
||||
type DeleteSAMLConfigurationPayload struct {
|
||||
DeletedSamlConfigurationID gid.GID `json:"deletedSamlConfigurationId"`
|
||||
}
|
||||
|
||||
type DeleteSCIMConfigurationInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
ScimConfigurationID gid.GID `json:"scimConfigurationId"`
|
||||
}
|
||||
|
||||
type DeleteSCIMConfigurationPayload struct {
|
||||
DeletedScimConfigurationID gid.GID `json:"deletedScimConfigurationId"`
|
||||
}
|
||||
|
||||
type ForgotPasswordInput struct {
|
||||
Email mail.Addr `json:"email"`
|
||||
}
|
||||
|
||||
type ForgotPasswordPayload struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type Identity struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Email mail.Addr `json:"email"`
|
||||
FullName string `json:"fullName"`
|
||||
EmailVerified bool `json:"emailVerified"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
Profiles *ProfileConnection `json:"profiles,omitempty"`
|
||||
Sessions *SessionConnection `json:"sessions,omitempty"`
|
||||
PersonalAPIKeys *PersonalAPIKeyConnection `json:"personalAPIKeys,omitempty"`
|
||||
SsoLoginURL *string `json:"ssoLoginURL,omitempty"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (Identity) IsNode() {}
|
||||
func (this Identity) GetID() gid.GID { return this.ID }
|
||||
|
||||
type Invitation struct {
|
||||
ID gid.GID `json:"id"`
|
||||
ExpiresAt time.Time `json:"expiresAt"`
|
||||
AcceptedAt *time.Time `json:"acceptedAt,omitempty"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
Status coredata.InvitationStatus `json:"status"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (Invitation) IsNode() {}
|
||||
func (this Invitation) GetID() gid.GID { return this.ID }
|
||||
|
||||
type InvitationEdge struct {
|
||||
Node *Invitation `json:"node"`
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
}
|
||||
|
||||
type InviteUserInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
ProfileID gid.GID `json:"profileId"`
|
||||
}
|
||||
|
||||
type InviteUserPayload struct {
|
||||
InvitationEdge *InvitationEdge `json:"invitationEdge"`
|
||||
}
|
||||
|
||||
type Membership struct {
|
||||
ID gid.GID `json:"id"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
Role coredata.MembershipRole `json:"role"`
|
||||
LastSession *Session `json:"lastSession,omitempty"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (Membership) IsNode() {}
|
||||
func (this Membership) GetID() gid.GID { return this.ID }
|
||||
|
||||
type Mutation struct {
|
||||
}
|
||||
|
||||
type Organization struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
LogoURL *string `json:"logoUrl,omitempty"`
|
||||
HorizontalLogoURL *string `json:"horizontalLogoUrl,omitempty"`
|
||||
Email *string `json:"email,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
WebsiteURL *string `json:"websiteUrl,omitempty"`
|
||||
HeadquarterAddress *string `json:"headquarterAddress,omitempty"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
Profiles *ProfileConnection `json:"profiles,omitempty"`
|
||||
SamlConfigurations *SAMLConfigurationConnection `json:"samlConfigurations,omitempty"`
|
||||
ScimConfiguration *SCIMConfiguration `json:"scimConfiguration,omitempty"`
|
||||
Viewer *Profile `json:"viewer,omitempty"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (Organization) IsNode() {}
|
||||
func (this Organization) GetID() gid.GID { return this.ID }
|
||||
|
||||
type OrganizationSessionCreated struct {
|
||||
Session *Session `json:"session"`
|
||||
Membership *Membership `json:"membership"`
|
||||
}
|
||||
|
||||
func (OrganizationSessionCreated) IsAssumeOrganizationSessionResult() {}
|
||||
|
||||
type PageInfo struct {
|
||||
HasNextPage bool `json:"hasNextPage"`
|
||||
HasPreviousPage bool `json:"hasPreviousPage"`
|
||||
StartCursor *page.CursorKey `json:"startCursor,omitempty"`
|
||||
EndCursor *page.CursorKey `json:"endCursor,omitempty"`
|
||||
}
|
||||
|
||||
type PasswordRequired struct {
|
||||
Reason ReauthenticationReason `json:"reason"`
|
||||
}
|
||||
|
||||
func (PasswordRequired) IsAssumeOrganizationSessionResult() {}
|
||||
|
||||
type PersonalAPIKey struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ExpiresAt time.Time `json:"expiresAt"`
|
||||
LastUsedAt *time.Time `json:"lastUsedAt,omitempty"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
Token *string `json:"token,omitempty"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (PersonalAPIKey) IsNode() {}
|
||||
func (this PersonalAPIKey) GetID() gid.GID { return this.ID }
|
||||
|
||||
type PersonalAPIKeyEdge struct {
|
||||
Node *PersonalAPIKey `json:"node"`
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
}
|
||||
|
||||
type Profile struct {
|
||||
ID gid.GID `json:"id"`
|
||||
FullName string `json:"fullName"`
|
||||
EmailAddress mail.Addr `json:"emailAddress"`
|
||||
Source string `json:"source"`
|
||||
State coredata.ProfileState `json:"state"`
|
||||
AdditionalEmailAddresses []mail.Addr `json:"additionalEmailAddresses"`
|
||||
Kind *string `json:"kind,omitempty"`
|
||||
Position *string `json:"position,omitempty"`
|
||||
ContractStartDate *time.Time `json:"contractStartDate,omitempty"`
|
||||
ContractEndDate *time.Time `json:"contractEndDate,omitempty"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
Identity *Identity `json:"identity,omitempty"`
|
||||
Organization *Organization `json:"organization,omitempty"`
|
||||
Membership *Membership `json:"membership,omitempty"`
|
||||
PendingInvitations *InvitationConnection `json:"pendingInvitations,omitempty"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (Profile) IsNode() {}
|
||||
func (this Profile) GetID() gid.GID { return this.ID }
|
||||
|
||||
type ProfileEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *Profile `json:"node"`
|
||||
}
|
||||
|
||||
type ProfileFilter struct {
|
||||
ExcludeContractEnded *bool `json:"excludeContractEnded,omitempty"`
|
||||
State *coredata.ProfileState `json:"state,omitempty"`
|
||||
}
|
||||
|
||||
type Query struct {
|
||||
}
|
||||
|
||||
type RegenerateSCIMTokenInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
ScimConfigurationID gid.GID `json:"scimConfigurationId"`
|
||||
}
|
||||
|
||||
type RegenerateSCIMTokenPayload struct {
|
||||
ScimConfiguration *SCIMConfiguration `json:"scimConfiguration"`
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
type RemoveUserInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
ProfileID gid.GID `json:"profileId"`
|
||||
}
|
||||
|
||||
type RemoveUserPayload struct {
|
||||
DeletedProfileID gid.GID `json:"deletedProfileId"`
|
||||
}
|
||||
|
||||
type ResetPasswordInput struct {
|
||||
Token string `json:"token"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type ResetPasswordPayload struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type RevokeAllSessionsPayload struct {
|
||||
RevokedCount int `json:"revokedCount"`
|
||||
}
|
||||
|
||||
type RevokePersonalAPIKeyInput struct {
|
||||
PersonalAPIKeyID gid.GID `json:"personalAPIKeyId"`
|
||||
}
|
||||
|
||||
type RevokePersonalAPIKeyPayload struct {
|
||||
PersonalAPIKeyID gid.GID `json:"personalAPIKeyId"`
|
||||
}
|
||||
|
||||
type RevokeSessionInput struct {
|
||||
SessionID gid.GID `json:"sessionId"`
|
||||
}
|
||||
|
||||
type RevokeSessionPayload struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type SAMLAttributeMappings struct {
|
||||
Email string `json:"email"`
|
||||
FirstName string `json:"firstName"`
|
||||
LastName string `json:"lastName"`
|
||||
Role string `json:"role"`
|
||||
}
|
||||
|
||||
type SAMLAttributeMappingsInput struct {
|
||||
Email *string `json:"email,omitempty"`
|
||||
FirstName *string `json:"firstName,omitempty"`
|
||||
LastName *string `json:"lastName,omitempty"`
|
||||
Role *string `json:"role,omitempty"`
|
||||
}
|
||||
|
||||
type SAMLAuthenticationRequired struct {
|
||||
Reason ReauthenticationReason `json:"reason"`
|
||||
}
|
||||
|
||||
func (SAMLAuthenticationRequired) IsAssumeOrganizationSessionResult() {}
|
||||
|
||||
type SAMLConfiguration struct {
|
||||
ID gid.GID `json:"id"`
|
||||
EmailDomain string `json:"emailDomain"`
|
||||
EnforcementPolicy coredata.SAMLEnforcementPolicy `json:"enforcementPolicy"`
|
||||
DomainVerifiedAt *time.Time `json:"domainVerifiedAt,omitempty"`
|
||||
DomainVerificationToken *string `json:"domainVerificationToken,omitempty"`
|
||||
IdpEntityID string `json:"idpEntityId"`
|
||||
IdpSsoURL string `json:"idpSsoUrl"`
|
||||
IdpCertificate string `json:"idpCertificate"`
|
||||
AutoSignupEnabled bool `json:"autoSignupEnabled"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
TestLoginURL string `json:"testLoginUrl"`
|
||||
AttributeMappings *SAMLAttributeMappings `json:"attributeMappings"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (SAMLConfiguration) IsNode() {}
|
||||
func (this SAMLConfiguration) GetID() gid.GID { return this.ID }
|
||||
|
||||
type SAMLConfigurationEdge struct {
|
||||
Node *SAMLConfiguration `json:"node"`
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
}
|
||||
|
||||
type SCIMBridge struct {
|
||||
ID gid.GID `json:"id"`
|
||||
State coredata.SCIMBridgeState `json:"state"`
|
||||
ScimConfiguration *SCIMConfiguration `json:"scimConfiguration,omitempty"`
|
||||
Connector *Connector `json:"connector,omitempty"`
|
||||
Type coredata.SCIMBridgeType `json:"type"`
|
||||
ExcludedUserNames []string `json:"excludedUserNames"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (SCIMBridge) IsNode() {}
|
||||
func (this SCIMBridge) GetID() gid.GID { return this.ID }
|
||||
|
||||
type SCIMConfiguration struct {
|
||||
ID gid.GID `json:"id"`
|
||||
EndpointURL string `json:"endpointUrl"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
Organization *Organization `json:"organization,omitempty"`
|
||||
Bridge *SCIMBridge `json:"bridge,omitempty"`
|
||||
Events *SCIMEventConnection `json:"events,omitempty"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (SCIMConfiguration) IsNode() {}
|
||||
func (this SCIMConfiguration) GetID() gid.GID { return this.ID }
|
||||
|
||||
type SCIMEvent struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Method string `json:"method"`
|
||||
Path string `json:"path"`
|
||||
StatusCode int `json:"statusCode"`
|
||||
RequestBody *string `json:"requestBody,omitempty"`
|
||||
ResponseBody *string `json:"responseBody,omitempty"`
|
||||
ErrorMessage *string `json:"errorMessage,omitempty"`
|
||||
UserName string `json:"userName"`
|
||||
IPAddress string `json:"ipAddress"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (SCIMEvent) IsNode() {}
|
||||
func (this SCIMEvent) GetID() gid.GID { return this.ID }
|
||||
|
||||
type SCIMEventEdge struct {
|
||||
Node *SCIMEvent `json:"node"`
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
}
|
||||
|
||||
type Session struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Identity *Identity `json:"identity,omitempty"`
|
||||
IPAddress string `json:"ipAddress"`
|
||||
UserAgent string `json:"userAgent"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
ExpiresAt time.Time `json:"expiresAt"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (Session) IsNode() {}
|
||||
func (this Session) GetID() gid.GID { return this.ID }
|
||||
|
||||
type SessionEdge struct {
|
||||
Node *Session `json:"node"`
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
}
|
||||
|
||||
type SessionOrder struct {
|
||||
Direction page.OrderDirection `json:"direction"`
|
||||
Field coredata.SessionOrderField `json:"field"`
|
||||
}
|
||||
|
||||
type SignInInput struct {
|
||||
OrganizationID *gid.GID `json:"organizationId,omitempty"`
|
||||
Email mail.Addr `json:"email"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type SignInPayload struct {
|
||||
Identity *Identity `json:"identity,omitempty"`
|
||||
Session *Session `json:"session,omitempty"`
|
||||
}
|
||||
|
||||
type SignOutPayload struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type SignUpInput struct {
|
||||
Email mail.Addr `json:"email"`
|
||||
Password string `json:"password"`
|
||||
FullName string `json:"fullName"`
|
||||
}
|
||||
|
||||
type SignUpPayload struct {
|
||||
Identity *Identity `json:"identity,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateMembershipInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
MembershipID gid.GID `json:"membershipId"`
|
||||
Role coredata.MembershipRole `json:"role"`
|
||||
}
|
||||
|
||||
type UpdateMembershipPayload struct {
|
||||
Membership *Membership `json:"membership"`
|
||||
}
|
||||
|
||||
type UpdateOrganizationInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
LogoFile *graphql.Upload `json:"logoFile,omitempty"`
|
||||
HorizontalLogoFile *graphql.Upload `json:"horizontalLogoFile,omitempty"`
|
||||
Description graphql.Omittable[*string] `json:"description,omitempty"`
|
||||
WebsiteURL graphql.Omittable[*string] `json:"websiteUrl,omitempty"`
|
||||
Email graphql.Omittable[*string] `json:"email,omitempty"`
|
||||
HeadquarterAddress graphql.Omittable[*string] `json:"headquarterAddress,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateOrganizationPayload struct {
|
||||
Organization *Organization `json:"organization,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateSAMLConfigurationInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
SamlConfigurationID gid.GID `json:"samlConfigurationId"`
|
||||
IdpEntityID *string `json:"idpEntityId,omitempty"`
|
||||
IdpSsoURL *string `json:"idpSsoUrl,omitempty"`
|
||||
IdpCertificate *string `json:"idpCertificate,omitempty"`
|
||||
AutoSignupEnabled *bool `json:"autoSignupEnabled,omitempty"`
|
||||
EnforcementPolicy coredata.SAMLEnforcementPolicy `json:"enforcementPolicy"`
|
||||
AttributeMappings *SAMLAttributeMappingsInput `json:"attributeMappings,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateSAMLConfigurationPayload struct {
|
||||
SamlConfiguration *SAMLConfiguration `json:"samlConfiguration,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateSCIMBridgeInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
ScimBridgeID gid.GID `json:"scimBridgeId"`
|
||||
ExcludedUserNames []string `json:"excludedUserNames"`
|
||||
}
|
||||
|
||||
type UpdateSCIMBridgePayload struct {
|
||||
ScimBridge *SCIMBridge `json:"scimBridge"`
|
||||
}
|
||||
|
||||
type UpdateUserInput struct {
|
||||
ID gid.GID `json:"id"`
|
||||
FullName string `json:"fullName"`
|
||||
AdditionalEmailAddresses []mail.Addr `json:"additionalEmailAddresses,omitempty"`
|
||||
Kind *string `json:"kind,omitempty"`
|
||||
Position *string `json:"position,omitempty"`
|
||||
ContractStartDate graphql.Omittable[*time.Time] `json:"contractStartDate,omitempty"`
|
||||
ContractEndDate graphql.Omittable[*time.Time] `json:"contractEndDate,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateUserPayload struct {
|
||||
Profile *Profile `json:"profile"`
|
||||
}
|
||||
|
||||
type VerifyEmailInput struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
type VerifyEmailPayload struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type ReauthenticationReason string
|
||||
|
||||
const (
|
||||
ReauthenticationReasonSessionExpired ReauthenticationReason = "SESSION_EXPIRED"
|
||||
ReauthenticationReasonSensitiveAction ReauthenticationReason = "SENSITIVE_ACTION"
|
||||
ReauthenticationReasonPolicyRequirement ReauthenticationReason = "POLICY_REQUIREMENT"
|
||||
)
|
||||
|
||||
var AllReauthenticationReason = []ReauthenticationReason{
|
||||
ReauthenticationReasonSessionExpired,
|
||||
ReauthenticationReasonSensitiveAction,
|
||||
ReauthenticationReasonPolicyRequirement,
|
||||
}
|
||||
|
||||
func (e ReauthenticationReason) IsValid() bool {
|
||||
switch e {
|
||||
case ReauthenticationReasonSessionExpired, ReauthenticationReasonSensitiveAction, ReauthenticationReasonPolicyRequirement:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (e ReauthenticationReason) String() string {
|
||||
return string(e)
|
||||
}
|
||||
|
||||
func (e *ReauthenticationReason) UnmarshalGQL(v any) error {
|
||||
str, ok := v.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("enums must be strings")
|
||||
}
|
||||
|
||||
*e = ReauthenticationReason(str)
|
||||
if !e.IsValid() {
|
||||
return fmt.Errorf("%s is not a valid ReauthenticationReason", str)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e ReauthenticationReason) MarshalGQL(w io.Writer) {
|
||||
fmt.Fprint(w, strconv.Quote(e.String()))
|
||||
}
|
||||
|
||||
func (e *ReauthenticationReason) UnmarshalJSON(b []byte) error {
|
||||
s, err := strconv.Unquote(string(b))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return e.UnmarshalGQL(s)
|
||||
}
|
||||
|
||||
func (e ReauthenticationReason) MarshalJSON() ([]byte, error) {
|
||||
var buf bytes.Buffer
|
||||
e.MarshalGQL(&buf)
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
@@ -3902,8 +3902,8 @@ input CreateMailingListUpdateInput {
|
||||
|
||||
input UpdateMailingListUpdateInput {
|
||||
id: ID!
|
||||
title: String
|
||||
body: String
|
||||
title: String!
|
||||
body: String!
|
||||
}
|
||||
|
||||
input SendMailingListUpdateInput {
|
||||
|
||||
3
pkg/server/api/console/v1/schema/.gitignore
vendored
Normal file
3
pkg/server/api/console/v1/schema/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*
|
||||
!.gitignore
|
||||
!doc.go
|
||||
17
pkg/server/api/console/v1/schema/doc.go
Normal file
17
pkg/server/api/console/v1/schema/doc.go
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
// Package schema contains the generated GraphQL executable schema for the
|
||||
// Console API.
|
||||
package schema
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,6 @@ import (
|
||||
"go.probo.inc/probo/pkg/server/api/console/v1/types"
|
||||
"go.probo.inc/probo/pkg/server/gqlutils"
|
||||
"go.probo.inc/probo/pkg/server/gqlutils/types/cursor"
|
||||
"go.probo.inc/probo/pkg/validator"
|
||||
)
|
||||
|
||||
// StateOfApplicability is the resolver for the stateOfApplicability field.
|
||||
@@ -2073,18 +2072,8 @@ func (r *mutationResolver) CreateMailingListUpdate(ctx context.Context, input ty
|
||||
return nil, err
|
||||
}
|
||||
|
||||
mlu, err := r.mailman.CreateMailingListUpdate(
|
||||
ctx,
|
||||
&mailman.CreateMailingListUpdateRequest{
|
||||
MailingListID: input.MailingListID,
|
||||
Title: input.Title,
|
||||
Body: input.Body,
|
||||
},
|
||||
)
|
||||
mlu, err := r.mailman.CreateMailingListUpdate(ctx, input.MailingListID, input.Title, input.Body)
|
||||
if err != nil {
|
||||
if validationErrors, ok := errors.AsType[validator.ValidationErrors](err); ok {
|
||||
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
||||
}
|
||||
r.logger.ErrorCtx(ctx, "cannot create mailing list update", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
}
|
||||
@@ -2100,18 +2089,8 @@ func (r *mutationResolver) UpdateMailingListUpdate(ctx context.Context, input ty
|
||||
return nil, err
|
||||
}
|
||||
|
||||
mlu, err := r.mailman.UpdateMailingListUpdate(
|
||||
ctx,
|
||||
&mailman.UpdateMailingListUpdateRequest{
|
||||
ID: input.ID,
|
||||
Title: input.Title,
|
||||
Body: input.Body,
|
||||
},
|
||||
)
|
||||
mlu, err := r.mailman.UpdateMailingListUpdate(ctx, input.ID, input.Title, input.Body)
|
||||
if err != nil {
|
||||
if validationErrors, ok := errors.AsType[validator.ValidationErrors](err); ok {
|
||||
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
||||
}
|
||||
if errors.Is(err, mailman.ErrMailingListUpdateAlreadySent) {
|
||||
return nil, gqlutils.Conflictf(ctx, "mailing list update can only be edited when in draft")
|
||||
}
|
||||
@@ -2194,16 +2173,11 @@ func (r *mutationResolver) CreateMailingListSubscriber(ctx context.Context, inpu
|
||||
|
||||
subscriber, err := r.mailman.CreateSubscriber(
|
||||
ctx,
|
||||
&mailman.CreateSubscriberRequest{
|
||||
MailingListID: input.MailingListID,
|
||||
Email: input.Email,
|
||||
FullName: input.FullName,
|
||||
},
|
||||
input.MailingListID,
|
||||
input.Email,
|
||||
input.FullName,
|
||||
)
|
||||
if err != nil {
|
||||
if validationErrors, ok := errors.AsType[validator.ValidationErrors](err); ok {
|
||||
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
||||
}
|
||||
if errors.Is(err, mailman.ErrSubscriberAlreadyExist) {
|
||||
return nil, gqlutils.Conflictf(ctx, "subscriber already exists in this mailing list")
|
||||
}
|
||||
|
||||
3
pkg/server/api/mcp/v1/server/.gitignore
vendored
Normal file
3
pkg/server/api/mcp/v1/server/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*
|
||||
!.gitignore
|
||||
!doc.go
|
||||
17
pkg/server/api/mcp/v1/server/doc.go
Normal file
17
pkg/server/api/mcp/v1/server/doc.go
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
// Package server contains the generated MCP server tool registration and
|
||||
// resolver interface.
|
||||
package server
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
3
pkg/server/api/trust/v1/schema/.gitignore
vendored
Normal file
3
pkg/server/api/trust/v1/schema/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*
|
||||
!.gitignore
|
||||
!doc.go
|
||||
17
pkg/server/api/trust/v1/schema/doc.go
Normal file
17
pkg/server/api/trust/v1/schema/doc.go
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
// Package schema contains the generated GraphQL executable schema for the
|
||||
// Trust API.
|
||||
package schema
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,379 +0,0 @@
|
||||
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"go.probo.inc/probo/pkg/coredata"
|
||||
"go.probo.inc/probo/pkg/gid"
|
||||
"go.probo.inc/probo/pkg/mail"
|
||||
"go.probo.inc/probo/pkg/page"
|
||||
)
|
||||
|
||||
type Node interface {
|
||||
IsNode()
|
||||
GetID() gid.GID
|
||||
}
|
||||
|
||||
type AcceptElectronicSignatureInput struct {
|
||||
SignatureID gid.GID `json:"signatureId"`
|
||||
}
|
||||
|
||||
type AcceptElectronicSignaturePayload struct {
|
||||
Signature *ElectronicSignature `json:"signature"`
|
||||
}
|
||||
|
||||
type Audit struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Framework *Framework `json:"framework"`
|
||||
Report *Report `json:"report,omitempty"`
|
||||
}
|
||||
|
||||
func (Audit) IsNode() {}
|
||||
func (this Audit) GetID() gid.GID { return this.ID }
|
||||
|
||||
type AuditConnection struct {
|
||||
Edges []*AuditEdge `json:"edges"`
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
}
|
||||
|
||||
type AuditEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *Audit `json:"node"`
|
||||
}
|
||||
|
||||
type ComplianceExternalURL struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
URL string `json:"url"`
|
||||
Rank int `json:"rank"`
|
||||
}
|
||||
|
||||
func (ComplianceExternalURL) IsNode() {}
|
||||
func (this ComplianceExternalURL) GetID() gid.GID { return this.ID }
|
||||
|
||||
type ComplianceExternalURLConnection struct {
|
||||
Edges []*ComplianceExternalURLEdge `json:"edges"`
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
}
|
||||
|
||||
type ComplianceExternalURLEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *ComplianceExternalURL `json:"node"`
|
||||
}
|
||||
|
||||
type Document struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Title string `json:"title"`
|
||||
DocumentType coredata.DocumentType `json:"documentType"`
|
||||
IsUserAuthorized bool `json:"isUserAuthorized"`
|
||||
Access *DocumentAccess `json:"access,omitempty"`
|
||||
}
|
||||
|
||||
func (Document) IsNode() {}
|
||||
func (this Document) GetID() gid.GID { return this.ID }
|
||||
|
||||
type DocumentAccess struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Status coredata.TrustCenterDocumentAccessStatus `json:"status"`
|
||||
}
|
||||
|
||||
func (DocumentAccess) IsNode() {}
|
||||
func (this DocumentAccess) GetID() gid.GID { return this.ID }
|
||||
|
||||
type DocumentConnection struct {
|
||||
Edges []*DocumentEdge `json:"edges"`
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
}
|
||||
|
||||
type DocumentEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *Document `json:"node"`
|
||||
}
|
||||
|
||||
type ElectronicSignature struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Status coredata.ElectronicSignatureStatus `json:"status"`
|
||||
DocumentType coredata.ElectronicSignatureDocumentType `json:"documentType"`
|
||||
ConsentText string `json:"consentText"`
|
||||
LastError *string `json:"lastError,omitempty"`
|
||||
SignedAt *time.Time `json:"signedAt,omitempty"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
func (ElectronicSignature) IsNode() {}
|
||||
func (this ElectronicSignature) GetID() gid.GID { return this.ID }
|
||||
|
||||
type ExportDocumentPDFInput struct {
|
||||
DocumentID gid.GID `json:"documentId"`
|
||||
}
|
||||
|
||||
type ExportDocumentPDFPayload struct {
|
||||
Data string `json:"data"`
|
||||
}
|
||||
|
||||
type ExportReportPDFInput struct {
|
||||
ReportID gid.GID `json:"reportId"`
|
||||
}
|
||||
|
||||
type ExportReportPDFPayload struct {
|
||||
Data string `json:"data"`
|
||||
}
|
||||
|
||||
type ExportTrustCenterFileInput struct {
|
||||
TrustCenterFileID gid.GID `json:"trustCenterFileId"`
|
||||
}
|
||||
|
||||
type ExportTrustCenterFilePayload struct {
|
||||
Data string `json:"data"`
|
||||
}
|
||||
|
||||
type Framework struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
LightLogoURL *string `json:"lightLogoURL,omitempty"`
|
||||
DarkLogoURL *string `json:"darkLogoURL,omitempty"`
|
||||
}
|
||||
|
||||
func (Framework) IsNode() {}
|
||||
func (this Framework) GetID() gid.GID { return this.ID }
|
||||
|
||||
type Identity struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Email mail.Addr `json:"email"`
|
||||
FullName string `json:"fullName"`
|
||||
EmailVerified bool `json:"emailVerified"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
func (Identity) IsNode() {}
|
||||
func (this Identity) GetID() gid.GID { return this.ID }
|
||||
|
||||
type MailingListUpdate struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Body string `json:"body"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
func (MailingListUpdate) IsNode() {}
|
||||
func (this MailingListUpdate) GetID() gid.GID { return this.ID }
|
||||
|
||||
type MailingListUpdateConnection struct {
|
||||
Edges []*MailingListUpdateEdge `json:"edges"`
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
}
|
||||
|
||||
type MailingListUpdateEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *MailingListUpdate `json:"node"`
|
||||
}
|
||||
|
||||
type Mutation struct {
|
||||
}
|
||||
|
||||
type NonDisclosureAgreement struct {
|
||||
FileName string `json:"fileName"`
|
||||
FileURL string `json:"fileUrl"`
|
||||
ViewerSignature *ElectronicSignature `json:"viewerSignature,omitempty"`
|
||||
}
|
||||
|
||||
type Organization struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
LogoURL *string `json:"logoUrl,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
WebsiteURL *string `json:"websiteUrl,omitempty"`
|
||||
Email *string `json:"email,omitempty"`
|
||||
HeadquarterAddress *string `json:"headquarterAddress,omitempty"`
|
||||
}
|
||||
|
||||
func (Organization) IsNode() {}
|
||||
func (this Organization) GetID() gid.GID { return this.ID }
|
||||
|
||||
type PageInfo struct {
|
||||
HasNextPage bool `json:"hasNextPage"`
|
||||
HasPreviousPage bool `json:"hasPreviousPage"`
|
||||
StartCursor *page.CursorKey `json:"startCursor,omitempty"`
|
||||
EndCursor *page.CursorKey `json:"endCursor,omitempty"`
|
||||
}
|
||||
|
||||
type Query struct {
|
||||
}
|
||||
|
||||
type RecordSigningEventInput struct {
|
||||
SignatureID gid.GID `json:"signatureId"`
|
||||
EventType coredata.ElectronicSignatureEventType `json:"eventType"`
|
||||
}
|
||||
|
||||
type RecordSigningEventPayload struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type Report struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Filename string `json:"filename"`
|
||||
IsUserAuthorized bool `json:"isUserAuthorized"`
|
||||
Access *DocumentAccess `json:"access,omitempty"`
|
||||
}
|
||||
|
||||
func (Report) IsNode() {}
|
||||
func (this Report) GetID() gid.GID { return this.ID }
|
||||
|
||||
type RequestAccessesPayload struct {
|
||||
TrustCenterAccess *TrustCenterAccess `json:"trustCenterAccess"`
|
||||
}
|
||||
|
||||
type RequestDocumentAccessInput struct {
|
||||
DocumentID gid.GID `json:"documentId"`
|
||||
}
|
||||
|
||||
type RequestDocumentAccessPayload struct {
|
||||
Document *Document `json:"document,omitempty"`
|
||||
}
|
||||
|
||||
type RequestFileAccessPayload struct {
|
||||
File *TrustCenterFile `json:"file,omitempty"`
|
||||
}
|
||||
|
||||
type RequestReportAccessInput struct {
|
||||
ReportID gid.GID `json:"reportId"`
|
||||
}
|
||||
|
||||
type RequestReportAccessPayload struct {
|
||||
Audit *Audit `json:"audit,omitempty"`
|
||||
}
|
||||
|
||||
type RequestTrustCenterFileAccessInput struct {
|
||||
TrustCenterFileID gid.GID `json:"trustCenterFileId"`
|
||||
}
|
||||
|
||||
type SendMagicLinkInput struct {
|
||||
Email mail.Addr `json:"email"`
|
||||
Continue *string `json:"continue,omitempty"`
|
||||
}
|
||||
|
||||
type SendMagicLinkPayload struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type SubscribeToMailingListPayload struct {
|
||||
Subscription *MailingListSubscriber `json:"subscription"`
|
||||
}
|
||||
|
||||
type TrustCenter struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Active bool `json:"active"`
|
||||
Slug string `json:"slug"`
|
||||
LogoFileURL *string `json:"logoFileUrl,omitempty"`
|
||||
DarkLogoFileURL *string `json:"darkLogoFileUrl,omitempty"`
|
||||
NonDisclosureAgreement *NonDisclosureAgreement `json:"nonDisclosureAgreement,omitempty"`
|
||||
ViewerSubscription *MailingListSubscriber `json:"viewerSubscription,omitempty"`
|
||||
Organization *Organization `json:"organization"`
|
||||
Documents *DocumentConnection `json:"documents"`
|
||||
Audits *AuditConnection `json:"audits"`
|
||||
Vendors *VendorConnection `json:"vendors"`
|
||||
References *TrustCenterReferenceConnection `json:"references"`
|
||||
TrustCenterFiles *TrustCenterFileConnection `json:"trustCenterFiles"`
|
||||
ComplianceFrameworks *ComplianceFrameworkConnection `json:"complianceFrameworks"`
|
||||
ExternalUrls *ComplianceExternalURLConnection `json:"externalUrls"`
|
||||
Updates *MailingListUpdateConnection `json:"updates"`
|
||||
}
|
||||
|
||||
func (TrustCenter) IsNode() {}
|
||||
func (this TrustCenter) GetID() gid.GID { return this.ID }
|
||||
|
||||
type TrustCenterAccess struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Email mail.Addr `json:"email"`
|
||||
Name string `json:"name"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
func (TrustCenterAccess) IsNode() {}
|
||||
func (this TrustCenterAccess) GetID() gid.GID { return this.ID }
|
||||
|
||||
type TrustCenterFile struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Category string `json:"category"`
|
||||
IsUserAuthorized bool `json:"isUserAuthorized"`
|
||||
Access *DocumentAccess `json:"access,omitempty"`
|
||||
}
|
||||
|
||||
func (TrustCenterFile) IsNode() {}
|
||||
func (this TrustCenterFile) GetID() gid.GID { return this.ID }
|
||||
|
||||
type TrustCenterFileConnection struct {
|
||||
Edges []*TrustCenterFileEdge `json:"edges"`
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
}
|
||||
|
||||
type TrustCenterFileEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *TrustCenterFile `json:"node"`
|
||||
}
|
||||
|
||||
type TrustCenterReference struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
WebsiteURL string `json:"websiteUrl"`
|
||||
LogoURL string `json:"logoUrl"`
|
||||
}
|
||||
|
||||
func (TrustCenterReference) IsNode() {}
|
||||
func (this TrustCenterReference) GetID() gid.GID { return this.ID }
|
||||
|
||||
type TrustCenterReferenceConnection struct {
|
||||
Edges []*TrustCenterReferenceEdge `json:"edges"`
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
}
|
||||
|
||||
type TrustCenterReferenceEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *TrustCenterReference `json:"node"`
|
||||
}
|
||||
|
||||
type UnsubscribeFromMailingListPayload struct {
|
||||
DeletedMailingListSubscriberID *gid.GID `json:"deletedMailingListSubscriberId,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateFullNameInput struct {
|
||||
FullName string `json:"fullName"`
|
||||
}
|
||||
|
||||
type UpdateFullNamePayload struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type Vendor struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Category coredata.VendorCategory `json:"category"`
|
||||
WebsiteURL *string `json:"websiteUrl,omitempty"`
|
||||
PrivacyPolicyURL *string `json:"privacyPolicyUrl,omitempty"`
|
||||
Countries []coredata.CountryCode `json:"countries"`
|
||||
}
|
||||
|
||||
func (Vendor) IsNode() {}
|
||||
func (this Vendor) GetID() gid.GID { return this.ID }
|
||||
|
||||
type VendorEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *Vendor `json:"node"`
|
||||
}
|
||||
|
||||
type VerifyMagicLinkInput struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
type VerifyMagicLinkPayload struct {
|
||||
Continue *string `json:"continue,omitempty"`
|
||||
}
|
||||
@@ -28,7 +28,6 @@ import (
|
||||
"go.probo.inc/probo/pkg/server/api/trust/v1/types"
|
||||
"go.probo.inc/probo/pkg/server/gqlutils"
|
||||
"go.probo.inc/probo/pkg/trust"
|
||||
"go.probo.inc/probo/pkg/validator"
|
||||
)
|
||||
|
||||
// Framework is the resolver for the framework field.
|
||||
@@ -707,16 +706,11 @@ func (r *mutationResolver) SubscribeToMailingList(ctx context.Context) (*types.S
|
||||
|
||||
subscriber, err := r.mailman.CreateSubscriber(
|
||||
ctx,
|
||||
&mailman.CreateSubscriberRequest{
|
||||
MailingListID: *trustCenter.MailingListID,
|
||||
Email: identity.EmailAddress,
|
||||
FullName: identity.FullName,
|
||||
},
|
||||
*trustCenter.MailingListID,
|
||||
identity.EmailAddress,
|
||||
identity.FullName,
|
||||
)
|
||||
if err != nil {
|
||||
if validationErrors, ok := errors.AsType[validator.ValidationErrors](err); ok {
|
||||
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
||||
}
|
||||
if errors.Is(err, mailman.ErrSubscriberAlreadyExist) {
|
||||
return nil, gqlutils.Conflictf(ctx, "already subscribed to this mailing list")
|
||||
}
|
||||
|
||||
@@ -170,14 +170,6 @@ func Invalidf(ctx context.Context, format string, a ...any) *gqlerror.Error {
|
||||
return Invalid(ctx, fmt.Errorf(format, a...))
|
||||
}
|
||||
|
||||
func InvalidValidationErrors(ctx context.Context, errs validator.ValidationErrors) gqlerror.List {
|
||||
gqlErrors := make(gqlerror.List, 0, len(errs))
|
||||
for _, ve := range errs {
|
||||
gqlErrors = append(gqlErrors, Invalid(ctx, ve))
|
||||
}
|
||||
return gqlErrors
|
||||
}
|
||||
|
||||
func Internal(ctx context.Context) *gqlerror.Error {
|
||||
return &gqlerror.Error{
|
||||
Message: "An internal server error occurred. Please try again later.",
|
||||
|
||||
Reference in New Issue
Block a user