graphql

package
v0.0.0-...-122f59b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccessDenied = apierrors.Forbidden.WithReason("AccessDenied")
View Source
var AppConfig = graphqlutil.NewJSONObjectScalar(
	"AppConfig",
	"The `AppConfig` scalar type represents an app config JSON object",
)
View Source
var DependencySet = wire.NewSet(
	NewLogger,
	wire.Struct(new(Context), "*"),
)
View Source
var FeatureConfig = graphqlutil.NewJSONObjectScalar(
	"FeatureConfig",
	"The `FeatureConfig` scalar type represents an feature config JSON object",
)
View Source
var QuotaExceeded = apierrors.Invalid.WithReason("QuotaExceeded")
View Source
var Schema *graphql.Schema
View Source
var StripeError = graphqlutil.NewJSONObjectScalar(
	"StripeError",
	"The `StripeError` scalar type represents Stripe error",
)
View Source
var TutorialStatusData = graphqlutil.NewJSONObjectScalar(
	"TutorialStatusData",
	"The `TutorialStatusData` scalar type represents tutorial status data",
)

Functions

func WithContext

func WithContext(ctx context.Context, gqlContext *Context) context.Context

Types

type AnalyticChartService

type AnalyticChartService interface {
	GetActiveUserChart(appID string, periodical string, rangeFrom time.Time, rangeTo time.Time) (*analytic.Chart, error)
	GetTotalUserCountChart(appID string, rangeFrom time.Time, rangeTo time.Time) (*analytic.Chart, error)
	GetSignupConversionRate(appID string, rangeFrom time.Time, rangeTo time.Time) (*analytic.SignupConversionRateData, error)
	GetSignupByMethodsChart(appID string, rangeFrom time.Time, rangeTo time.Time) (*analytic.Chart, error)
}

type AppLoader

type AppLoader interface {
	graphqlutil.DataLoaderInterface
}

type AppResourceManagerFactory

type AppResourceManagerFactory interface {
	NewManagerWithAppContext(appContext *config.AppContext) *appresource.Manager
}

type AppSecretKey

type AppSecretKey string
const (
	AppSecretKeyOauthSSOProviderClientSecrets AppSecretKey = "oauthSSOProviderClientSecrets" // nolint:gosec
	AppSecretKeyWebhookSecret                 AppSecretKey = "webhookSecret"
	AppSecretKeyAdminAPISecrets               AppSecretKey = "adminAPISecrets"
	AppSecretKeySmtpSecret                    AppSecretKey = "smtpSecret"
	AppSecretKeyOauthClientSecrets            AppSecretKey = "oauthClientSecrets" // nolint:gosec
)

type AppService

type AppService interface {
	Get(id string) (*model.App, error)
	GetAppList(userID string) ([]*model.AppListItem, error)
	Create(userID string, id string) (*model.App, error)
	UpdateResources(app *model.App, updates []appresource.Update) error
	GetProjectQuota(userID string) (int, error)
	LoadRawAppConfig(app *model.App) (*config.AppConfig, string, error)
	LoadAppSecretConfig(app *model.App, sessionInfo *apimodel.SessionInfo, token string) (*model.SecretConfig, string, error)
	GenerateSecretVisitToken(
		app *model.App,
		sessionInfo *apimodel.SessionInfo,
		visitingSecrets []config.SecretKey,
	) (*appsecret.AppSecretVisitToken, error)
	GenerateTesterToken(
		app *model.App,
		returnURI string,
	) (*tester.TesterToken, error)
}

type AuditService

type AuditService interface {
	Log(app *model.App, payload event.NonBlockingPayload) error
}

type AuthzService

type AuthzService interface {
	CheckAccessOfViewer(appID string) (userID string, err error)
}

type CollaboratorInvitationLoader

type CollaboratorInvitationLoader interface {
	graphqlutil.DataLoaderInterface
}

type CollaboratorLoader

type CollaboratorLoader interface {
	graphqlutil.DataLoaderInterface
}

type CollaboratorService

type CollaboratorService interface {
	GetCollaborator(id string) (*model.Collaborator, error)
	GetCollaboratorByAppAndUser(appID string, userID string) (*model.Collaborator, error)
	ListCollaborators(appID string) ([]*model.Collaborator, error)
	ListCollaboratorsByUser(userID string) ([]*model.Collaborator, error)
	DeleteCollaborator(c *model.Collaborator) error

	GetProjectOwnerCount(userID string) (int, error)

	GetInvitation(id string) (*model.CollaboratorInvitation, error)
	GetInvitationWithCode(id string) (*model.CollaboratorInvitation, error)
	ListInvitations(appID string) ([]*model.CollaboratorInvitation, error)
	DeleteInvitation(i *model.CollaboratorInvitation) error
	SendInvitation(appID string, inviteeEmail string) (*model.CollaboratorInvitation, error)
	AcceptInvitation(code string) (*model.Collaborator, error)
	CheckInviteeEmail(i *model.CollaboratorInvitation, actorID string) error
}

type Context

type Context struct {
	Request   *http.Request
	GQLLogger Logger

	TrustProxy              config.TrustProxy
	Users                   UserLoader
	Apps                    AppLoader
	Domains                 DomainLoader
	Collaborators           CollaboratorLoader
	CollaboratorInvitations CollaboratorInvitationLoader

	AuthzService         AuthzService
	AppService           AppService
	DomainService        DomainService
	CollaboratorService  CollaboratorService
	SMTPService          SMTPService
	AppResMgrFactory     AppResourceManagerFactory
	AnalyticChartService AnalyticChartService
	TutorialService      TutorialService
	StripeService        StripeService
	SubscriptionService  SubscriptionService
	NFTService           NFTService
	DenoService          DenoService
	AuditService         AuditService
	OnboardService       OnboardService
}

func GQLContext

func GQLContext(ctx context.Context) *Context

func (*Context) Logger

func (c *Context) Logger() *log.Logger

type DenoService

type DenoService interface {
	Check(ctx context.Context, snippet string) error
}

type DomainLoader

type DomainLoader interface {
	graphqlutil.DataLoaderInterface
}

type DomainService

type DomainService interface {
	ListDomains(appID string) ([]*apimodel.Domain, error)
	CreateCustomDomain(appID string, domain string) (*apimodel.Domain, error)
	DeleteDomain(appID string, id string) error
	VerifyDomain(appID string, id string) (*apimodel.Domain, error)
}

type Logger

type Logger struct{ *log.Logger }

func NewLogger

func NewLogger(lf *log.Factory) Logger

type NFTService

type NFTService interface {
	ProbeNFTCollection(contractID web3.ContractID) (*apimodel.ProbeCollectionResult, error)
	GetContractMetadata(contracts []web3.ContractID) ([]apimodel.NFTCollection, error)
}

type NodeResolver

type NodeResolver func(ctx context.Context, id string) (interface{}, error)

type OnboardService

type OnboardService interface {
	SubmitOnboardEntry(entry model.OnboardEntry, actorID string) error
}

type SMTPService

type SMTPService interface {
	SendTestEmail(app *model.App, options smtp.SendTestEmailOptions) (err error)
}

type StripeService

type StripeService interface {
	FetchSubscriptionPlans() ([]*model.SubscriptionPlan, error)
	CreateCheckoutSession(appID string, customerEmail string, subscriptionPlan *model.SubscriptionPlan) (*libstripe.CheckoutSession, error)
	FetchCheckoutSession(checkoutSessionID string) (*libstripe.CheckoutSession, error)
	GetSubscriptionPlan(planName string) (*model.SubscriptionPlan, error)
	GenerateCustomerPortalSession(appID string, customerID string) (*stripe.BillingPortalSession, error)
	UpdateSubscription(stripeSubscriptionID string, subscriptionPlan *model.SubscriptionPlan) error
	PreviewUpdateSubscription(stripeSubscriptionID string, subscriptionPlan *model.SubscriptionPlan) (*model.SubscriptionUpdatePreview, error)
	SetSubscriptionCancelAtPeriodEnd(stripeSubscriptionID string, cancelAtPeriodEnd bool) (*time.Time, error)
	GetLastPaymentError(stripeCustomerID string) (*stripe.Error, error)
	GetSubscription(stripeCustomerID string) (*stripe.Subscription, error)
	CancelSubscriptionImmediately(subscriptionID string) error
}

type SubscriptionService

type SubscriptionService interface {
	GetSubscription(appID string) (*model.Subscription, error)
	CreateSubscriptionCheckout(stripeCheckoutSession *libstripe.CheckoutSession) (*model.SubscriptionCheckout, error)
	MarkCheckoutCompleted(appID string, stripCheckoutSessionID string, customerID string) error
	GetSubscriptionUsage(
		appID string,
		planName string,
		date time.Time,
		subscriptionPlans []*model.SubscriptionPlan,
	) (*model.SubscriptionUsage, error)
	UpdateAppPlan(appID string, planName string) error
	SetSubscriptionCancelledStatus(id string, cancelled bool, endedAt *time.Time) error
	GetLastProcessingCustomerID(appID string) (*string, error)
	MarkCheckoutExpired(appID string, customerID string) error
}

type TutorialService

type TutorialService interface {
	Get(appID string) (*tutorial.Entry, error)
	RecordProgresses(appID string, ps []tutorial.Progress) (err error)
	Skip(appID string) (err error)
}

type UserLoader

type UserLoader interface {
	graphqlutil.DataLoaderInterface
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL