zapier

package
v0.0.0-...-69ce26b Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateZapierRoutes

func CreateZapierRoutes(r chi.Router, db *gorm.DB, store *ZapierResthookStore, rh *resthooks.Resthook)

func GenerateZapierAccessToken

func GenerateZapierAccessToken(projectId int) (string, error)

func RequireValidZapierAuth

func RequireValidZapierAuth(next http.Handler) http.Handler

func SetupZapierAuthContextMiddleware

func SetupZapierAuthContextMiddleware(db *gorm.DB) func(http.Handler) http.Handler

Types

type HookPayload

type HookPayload struct {
	// UserIdentifier is a required parameter for New User, Error, and SessionFeedback alerts
	UserIdentifier string `json:"user_identifier"`
	// UserObject is a required parameter for alerts that relate to a session
	UserObject model.JSONB `json:"user_object"`
	// Group is a required parameter for Error alerts
	Group *model.ErrorGroup `json:"group"`
	// URL is an optional parameter for Error alerts
	URL *string `json:"url"`
	// ErrorsCount is a required parameter for Error alerts
	ErrorsCount *int64 `json:"errors_count"`
	// MatchedFields is a required parameter for Track Properties and User Properties alerts
	MatchedFields []*model.Field `json:"matched_fields"`
	// RelatedFields is an optional parameter for Track Properties and User Properties alerts
	RelatedFields []*model.Field `json:"related_fields"`
	// UserProperties is a required parameter for User Properties alerts
	UserProperties map[string]string `json:"user_properties"`
	// CommentID is a required parameter for SessionFeedback alerts
	CommentID *int `json:"comment_id"`
	// CommentText is a required parameter for SessionFeedback alerts
	CommentText string `json:"comment_text"`
	// RageClicksCount is a required parameter for Rage Click Alerts
	RageClicksCount *int64 `json:"rage_clicks_count"`
	// MetricValue is a required parameter for MetricMonitor alerts
	MetricValue *float64 `json:"metric_value"`
	// MetricValue is a required parameter for MetricMonitor alerts
	MetricThreshold *float64 `json:"metric_threshold"`
	// Timestamp is an optional value for all session alerts.
	Timestamp *time.Time `json:"timestamp"`
}

type ParsedZapierToken

type ParsedZapierToken struct {
	Magic     string `json:"magic"`
	ProjectID int    `json:"project_id"`
}

func ParseZapierAccessToken

func ParseZapierAccessToken(token string) (*ParsedZapierToken, error)

type ZapierResthookStore

type ZapierResthookStore struct {
	DB *gorm.DB
}

func (*ZapierResthookStore) DeleteById

func (s *ZapierResthookStore) DeleteById(id int, r *http.Request) error

func (*ZapierResthookStore) FindById

func (s *ZapierResthookStore) FindById(id int) (*resthooks.Subscription, error)

func (*ZapierResthookStore) FindByUserId

func (s *ZapierResthookStore) FindByUserId(project_id int, event string) (*resthooks.Subscription, error)

func (*ZapierResthookStore) Save

Jump to

Keyboard shortcuts

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