plessmodels

package
v0.12.10 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 5 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIInterface

type APIInterface struct {
	CreateCodePOST       *func(email *string, phoneNumber *string, options APIOptions, userContext supertokens.UserContext) (CreateCodePOSTResponse, error)
	ResendCodePOST       *func(deviceID string, preAuthSessionID string, options APIOptions, userContext supertokens.UserContext) (ResendCodePOSTResponse, error)
	ConsumeCodePOST      *func(userInput *UserInputCodeWithDeviceID, linkCode *string, preAuthSessionID string, options APIOptions, userContext supertokens.UserContext) (ConsumeCodePOSTResponse, error)
	EmailExistsGET       *func(email string, options APIOptions, userContext supertokens.UserContext) (EmailExistsGETResponse, error)
	PhoneNumberExistsGET *func(phoneNumber string, options APIOptions, userContext supertokens.UserContext) (PhoneNumberExistsGETResponse, error)
}

type APIOptions

type APIOptions struct {
	RecipeImplementation RecipeInterface
	AppInfo              supertokens.NormalisedAppinfo
	Config               TypeNormalisedInput
	RecipeID             string
	Req                  *http.Request
	Res                  http.ResponseWriter
	OtherHandler         http.HandlerFunc
	EmailDelivery        emaildelivery.Ingredient
	SmsDelivery          smsdelivery.Ingredient
}

type Code

type Code struct {
	CodeID       string
	TimeCreated  uint64
	CodeLifetime uint64
}

type ConsumeCodePOSTResponse

type ConsumeCodePOSTResponse struct {
	OK *struct {
		CreatedNewUser bool
		User           User
		Session        sessmodels.SessionContainer
	}
	IncorrectUserInputCodeError *struct {
		FailedCodeInputAttemptCount int
		MaximumCodeInputAttempts    int
	}
	ExpiredUserInputCodeError *struct {
		FailedCodeInputAttemptCount int
		MaximumCodeInputAttempts    int
	}
	RestartFlowError *struct{}
	GeneralError     *supertokens.GeneralErrorResponse
}

type ConsumeCodeResponse

type ConsumeCodeResponse struct {
	OK *struct {
		CreatedNewUser bool
		User           User
	}
	IncorrectUserInputCodeError *struct {
		FailedCodeInputAttemptCount int
		MaximumCodeInputAttempts    int
	}
	ExpiredUserInputCodeError *struct {
		FailedCodeInputAttemptCount int
		MaximumCodeInputAttempts    int
	}
	RestartFlowError *struct{}
}

type ContactMethodEmailConfig

type ContactMethodEmailConfig struct {
	Enabled                  bool
	ValidateEmailAddress     func(email interface{}) *string
	CreateAndSendCustomEmail func(email string, userInputCode *string, urlWithLinkCode *string, codeLifetime uint64, preAuthSessionId string, userContext supertokens.UserContext) error // Deprecated: Use EmailDelivery instead.
}

type ContactMethodEmailOrPhoneConfig

type ContactMethodEmailOrPhoneConfig struct {
	Enabled                        bool
	ValidateEmailAddress           func(email interface{}) *string
	CreateAndSendCustomEmail       func(email string, userInputCode *string, urlWithLinkCode *string, codeLifetime uint64, preAuthSessionId string, userContext supertokens.UserContext) error // Deprecated: Use EmailDelivery instead.
	ValidatePhoneNumber            func(phoneNumber interface{}) *string
	CreateAndSendCustomTextMessage func(phoneNumber string, userInputCode *string, urlWithLinkCode *string, codeLifetime uint64, preAuthSessionId string, userContext supertokens.UserContext) error // Deprecated: Use SmsDelivery instead.
}

type ContactMethodPhoneConfig

type ContactMethodPhoneConfig struct {
	Enabled                        bool
	ValidatePhoneNumber            func(phoneNumber interface{}) *string
	CreateAndSendCustomTextMessage func(phoneNumber string, userInputCode *string, urlWithLinkCode *string, codeLifetime uint64, preAuthSessionId string, userContext supertokens.UserContext) error // Deprecated: Use SmsDelivery instead.
}

type CreateCodePOSTResponse

type CreateCodePOSTResponse struct {
	OK *struct {
		DeviceID         string
		PreAuthSessionID string
		FlowType         string
	}
	GeneralError *supertokens.GeneralErrorResponse
}

type CreateCodeResponse

type CreateCodeResponse struct {
	OK *NewCode
}

type DeleteUserResponse added in v0.5.7

type DeleteUserResponse struct {
	OK                 *struct{}
	UnknownUserIdError *struct{}
}

type DeviceType

type DeviceType struct {
	PreAuthSessionID            string
	FailedCodeInputAttemptCount int
	Email                       *string
	PhoneNumber                 *string
	Codes                       []Code
}

type EmailExistsGETResponse

type EmailExistsGETResponse struct {
	OK           *struct{ Exists bool }
	GeneralError *supertokens.GeneralErrorResponse
}

type NewCode

type NewCode struct {
	PreAuthSessionID string
	CodeID           string
	DeviceID         string
	UserInputCode    string
	LinkCode         string
	CodeLifetime     uint64
	TimeCreated      uint64
}

type OverrideStruct

type OverrideStruct struct {
	Functions func(originalImplementation RecipeInterface) RecipeInterface
	APIs      func(originalImplementation APIInterface) APIInterface
}

type PhoneNumberExistsGETResponse

type PhoneNumberExistsGETResponse struct {
	OK           *struct{ Exists bool }
	GeneralError *supertokens.GeneralErrorResponse
}

type RecipeInterface

type RecipeInterface struct {
	CreateCode *func(email *string, phoneNumber *string, userInputCode *string, userContext supertokens.UserContext) (CreateCodeResponse, error)

	CreateNewCodeForDevice *func(deviceID string, userInputCode *string, userContext supertokens.UserContext) (ResendCodeResponse, error)

	ConsumeCode *func(userInput *UserInputCodeWithDeviceID, linkCode *string, preAuthSessionID string, userContext supertokens.UserContext) (ConsumeCodeResponse, error)

	GetUserByID *func(userID string, userContext supertokens.UserContext) (*User, error)

	GetUserByEmail *func(email string, userContext supertokens.UserContext) (*User, error)

	GetUserByPhoneNumber *func(phoneNumber string, userContext supertokens.UserContext) (*User, error)

	UpdateUser *func(userID string, email *string, phoneNumber *string, userContext supertokens.UserContext) (UpdateUserResponse, error)

	DeleteEmailForUser *func(userID string, userContext supertokens.UserContext) (DeleteUserResponse, error)

	DeletePhoneNumberForUser *func(userID string, userContext supertokens.UserContext) (DeleteUserResponse, error)

	RevokeAllCodes *func(email *string, phoneNumber *string, userContext supertokens.UserContext) error

	RevokeCode *func(codeID string, userContext supertokens.UserContext) error

	ListCodesByEmail *func(email string, userContext supertokens.UserContext) ([]DeviceType, error)

	ListCodesByPhoneNumber *func(phoneNumber string, userContext supertokens.UserContext) ([]DeviceType, error)

	ListCodesByDeviceID *func(deviceID string, userContext supertokens.UserContext) (*DeviceType, error)

	ListCodesByPreAuthSessionID *func(preAuthSessionID string, userContext supertokens.UserContext) (*DeviceType, error)
}

type ResendCodePOSTResponse

type ResendCodePOSTResponse struct {
	OK             *struct{}
	ResetFlowError *struct{}
	GeneralError   *supertokens.GeneralErrorResponse
}

type ResendCodeResponse

type ResendCodeResponse struct {
	OK                            *NewCode
	RestartFlowError              *struct{}
	UserInputCodeAlreadyUsedError *struct{}
}

type TypeInput

type TypeInput struct {
	ContactMethodPhone        ContactMethodPhoneConfig
	ContactMethodEmail        ContactMethodEmailConfig
	ContactMethodEmailOrPhone ContactMethodEmailOrPhoneConfig
	FlowType                  string
	GetCustomUserInputCode    func(userContext supertokens.UserContext) (string, error)
	Override                  *OverrideStruct
	EmailDelivery             *emaildelivery.TypeInput
	SmsDelivery               *smsdelivery.TypeInput
}

type TypeNormalisedInput

type TypeNormalisedInput struct {
	ContactMethodPhone        ContactMethodPhoneConfig
	ContactMethodEmail        ContactMethodEmailConfig
	ContactMethodEmailOrPhone ContactMethodEmailOrPhoneConfig
	FlowType                  string
	GetCustomUserInputCode    func(userContext supertokens.UserContext) (string, error)
	Override                  OverrideStruct
	GetEmailDeliveryConfig    func() emaildelivery.TypeInputWithService
	GetSmsDeliveryConfig      func() smsdelivery.TypeInputWithService
}

type UpdateUserResponse

type UpdateUserResponse struct {
	OK                            *struct{}
	UnknownUserIdError            *struct{}
	EmailAlreadyExistsError       *struct{}
	PhoneNumberAlreadyExistsError *struct{}
}

type User

type User struct {
	ID          string  `json:"id"`
	Email       *string `json:"email"`
	PhoneNumber *string `json:"phoneNumber"`
	TimeJoined  uint64  `json:"timejoined"`
}

type UserInputCodeWithDeviceID

type UserInputCodeWithDeviceID struct {
	Code     string
	DeviceID string
}

Jump to

Keyboard shortcuts

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