tplmodels

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIInterface

type APIInterface struct {
	AuthorisationUrlGET      *func(provider *tpmodels.TypeProvider, redirectURIOnProviderDashboard string, tenantId string, options tpmodels.APIOptions, userContext supertokens.UserContext) (tpmodels.AuthorisationUrlGETResponse, error)
	AppleRedirectHandlerPOST *func(formPostInfoFromProvider map[string]interface{}, options tpmodels.APIOptions, userContext supertokens.UserContext) error
	ThirdPartySignInUpPOST   *func(provider *tpmodels.TypeProvider, input tpmodels.TypeSignInUpInput, tenantId string, options tpmodels.APIOptions, userContext supertokens.UserContext) (ThirdPartySignInUpPOSTResponse, error)

	CreateCodePOST                   *func(email *string, phoneNumber *string, tenantId string, options plessmodels.APIOptions, userContext supertokens.UserContext) (plessmodels.CreateCodePOSTResponse, error)
	ResendCodePOST                   *func(deviceID string, preAuthSessionID string, tenantId string, options plessmodels.APIOptions, userContext supertokens.UserContext) (plessmodels.ResendCodePOSTResponse, error)
	ConsumeCodePOST                  *func(userInput *plessmodels.UserInputCodeWithDeviceID, linkCode *string, preAuthSessionID string, tenantId string, options plessmodels.APIOptions, userContext supertokens.UserContext) (ConsumeCodePOSTResponse, error)
	PasswordlessEmailExistsGET       *func(email string, tenantId string, options plessmodels.APIOptions, userContext supertokens.UserContext) (plessmodels.EmailExistsGETResponse, error)
	PasswordlessPhoneNumberExistsGET *func(email string, tenantId string, options plessmodels.APIOptions, userContext supertokens.UserContext) (plessmodels.PhoneNumberExistsGETResponse, error)
}

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 EmailStruct

type EmailStruct struct {
	ID         string `json:"id"`
	IsVerified bool   `json:"isVerified"`
}

type ManuallyCreateOrUpdateUserResponse added in v0.13.0

type ManuallyCreateOrUpdateUserResponse struct {
	OK *struct {
		CreatedNewUser bool
		User           User
	}
}

type OverrideStruct

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

type RecipeInterface

type RecipeInterface struct {
	GetUserByID             *func(userID string, userContext supertokens.UserContext) (*User, error)
	GetUsersByEmail         *func(email string, tenantId string, userContext supertokens.UserContext) ([]User, error)
	GetUserByPhoneNumber    *func(phoneNumber string, tenantId string, userContext supertokens.UserContext) (*User, error)
	GetUserByThirdPartyInfo *func(thirdPartyID string, thirdPartyUserID string, tenantId string, userContext supertokens.UserContext) (*User, error)

	ThirdPartySignInUp                   *func(thirdPartyID string, thirdPartyUserID string, email string, oAuthTokens tpmodels.TypeOAuthTokens, rawUserInfoFromProvider tpmodels.TypeRawUserInfoFromProvider, tenantId string, userContext supertokens.UserContext) (ThirdPartySignInUp, error)
	ThirdPartyManuallyCreateOrUpdateUser *func(thirdPartyID string, thirdPartyUserID string, email string, tenantId string, userContext supertokens.UserContext) (ManuallyCreateOrUpdateUserResponse, error)
	ThirdPartyGetProvider                *func(thirdPartyID string, clientType *string, tenantId string, userContext supertokens.UserContext) (*tpmodels.TypeProvider, error)

	CreateCode                     *func(email *string, phoneNumber *string, userInputCode *string, tenantId string, userContext supertokens.UserContext) (plessmodels.CreateCodeResponse, error)
	CreateNewCodeForDevice         *func(deviceID string, userInputCode *string, tenantId string, userContext supertokens.UserContext) (plessmodels.ResendCodeResponse, error)
	ConsumeCode                    *func(userInput *plessmodels.UserInputCodeWithDeviceID, linkCode *string, preAuthSessionID string, tenantId string, userContext supertokens.UserContext) (ConsumeCodeResponse, error)
	UpdatePasswordlessUser         *func(userID string, email *string, phoneNumber *string, userContext supertokens.UserContext) (plessmodels.UpdateUserResponse, error)
	DeleteEmailForPasswordlessUser *func(userID string, userContext supertokens.UserContext) (plessmodels.DeleteUserResponse, error)
	DeletePhoneNumberForUser       *func(userID string, userContext supertokens.UserContext) (plessmodels.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) ([]plessmodels.DeviceType, error)
	ListCodesByPhoneNumber         *func(phoneNumber string, tenantId string, userContext supertokens.UserContext) ([]plessmodels.DeviceType, error)
	ListCodesByDeviceID            *func(deviceID string, tenantId string, userContext supertokens.UserContext) (*plessmodels.DeviceType, error)
	ListCodesByPreAuthSessionID    *func(preAuthSessionID string, tenantId string, userContext supertokens.UserContext) (*plessmodels.DeviceType, error)
}

type SignInResponse

type SignInResponse struct {
	OK *struct {
		User User
	}
	WrongCredentialsError *struct{}
}

type SignUpResponse

type SignUpResponse struct {
	OK *struct {
		User User
	}
	EmailAlreadyExistsError *struct{}
}

type ThirdPartySignInUp

type ThirdPartySignInUp struct {
	OK *struct {
		CreatedNewUser          bool
		User                    User
		OAuthTokens             map[string]interface{}
		RawUserInfoFromProvider tpmodels.TypeRawUserInfoFromProvider
	}
}

type ThirdPartySignInUpPOSTResponse added in v0.13.0

type ThirdPartySignInUpPOSTResponse struct {
	OK *struct {
		CreatedNewUser          bool
		User                    User
		Session                 sessmodels.SessionContainer
		OAuthTokens             tpmodels.TypeOAuthTokens
		RawUserInfoFromProvider tpmodels.TypeRawUserInfoFromProvider
	}
	NoEmailGivenByProviderError *struct{}
	GeneralError                *supertokens.GeneralErrorResponse
}

type TypeInput

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

type TypeNormalisedInput

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

type User

type User struct {
	ID          string  `json:"id"`
	TimeJoined  uint64  `json:"timeJoined"`
	Email       *string `json:"email"`
	PhoneNumber *string `json:"phoneNumber"`
	ThirdParty  *struct {
		ID     string `json:"id"`
		UserID string `json:"userId"`
	} `json:"thirdParty"`
	TenantIds []string `json:"tenantIds"`
}

Jump to

Keyboard shortcuts

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