plessmodels

package
v0.17.5 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 17

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, tenantId string, options APIOptions, userContext supertokens.UserContext) (CreateCodePOSTResponse, error)
	ResendCodePOST       *func(deviceID string, preAuthSessionID string, tenantId string, options APIOptions, userContext supertokens.UserContext) (ResendCodePOSTResponse, error)
	ConsumeCodePOST      *func(userInput *UserInputCodeWithDeviceID, linkCode *string, preAuthSessionID string, tenantId string, options APIOptions, userContext supertokens.UserContext) (ConsumeCodePOSTResponse, error)
	EmailExistsGET       *func(email string, tenantId string, options APIOptions, userContext supertokens.UserContext) (EmailExistsGETResponse, error)
	PhoneNumberExistsGET *func(phoneNumber string, tenantId 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{}, tenantId string) *string
}

type ContactMethodEmailOrPhoneConfig

type ContactMethodEmailOrPhoneConfig struct {
	Enabled              bool
	ValidateEmailAddress func(email interface{}, tenantId string) *string
	ValidatePhoneNumber  func(phoneNumber interface{}, tenantId string) *string
}

type ContactMethodPhoneConfig

type ContactMethodPhoneConfig struct {
	Enabled             bool
	ValidatePhoneNumber func(phoneNumber interface{}, tenantId string) *string
}

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, tenantId string, userContext supertokens.UserContext) (CreateCodeResponse, error)

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

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

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

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

	GetUserByPhoneNumber *func(phoneNumber string, tenantId 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, tenantId string, userContext supertokens.UserContext) error

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

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

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

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

	ListCodesByPreAuthSessionID *func(preAuthSessionID string, tenantId 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(tenantId string, 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(tenantId string, 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"`
	TenantIds   []string `json:"tenantIds"`
}

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