types

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

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllSessionsMedia = ResultType("all-sessions", func() {
	Description("All of the sessions associated with a user")
	Attributes(func() {
		Attribute("currentSession", SessionMedia)
		Attribute("otherSessions", CollectionOf(SessionMedia))
	})

	View("default", func() {
		Attribute("currentSession")
		Attribute("otherSessions")
	})
})
View Source
var AuthMedia = ResultType("auth-status-media", func() {
	Description("If other Oauths or Auths exists on account.")
	ContentType("application/json")
	Attributes(func() {
		Attribute("google", Boolean, "True if user has google Oauth signin")
		Attribute("facebook", Boolean, "True if user has facebook Oauth signin")
		Attribute("twitter", Boolean, "True if user has twitter Oauth signin")
		Attribute("linkedin", Boolean, "True if user has linkedin Oauth signin")
		Attribute("instagram", Boolean, "True if user has microsoft Oauth signin")
		Attribute("standard", Boolean, "True if user has password signin")
		Required("google", "facebook", "twitter", "linkedin", "instagram", "standard")
	})
	View("default", func() {
		Attribute("google")
		Attribute("facebook")
		Attribute("twitter")
		Attribute("linkedin")
		Attribute("instagram")
		Attribute("standard")
	})
})
View Source
var ChangePasswordParams = Type("change-password-params", func() {
	Attribute("oldPassword", String, "The old password for the current user account", func() {
		Pattern(passwordPattern)
		MinLength(minPassLength)
		MaxLength(maxPassLength)
	})
	Attribute("newPassword", String, "The new password for the current user account", func() {
		Pattern(passwordPattern)
		MinLength(minPassLength)
		MaxLength(maxPassLength)
	})
	Token("Authorization")
	Token("X-Session")
	APIKey("api_key", "API-Key", String)
	Required("newPassword", "Authorization", "X-Session")
})
View Source
var LoginParams = Type("login-params", func() {
	Attribute("email", String, "The email address of the account to login to", func() {
		Format("email")
	})
	Attribute("password", String, "The password of the account to login to", func() {
		Pattern(passwordPattern)
		MinLength(minPassLength)
		MaxLength(maxPassLength)
	})
	Attribute("TwoFactor", String, "2 Factor Auth if user has enabled the feature", func() {
		MinLength(6)
		MaxLength(8)
	})
	Attribute("token", String)
	APIKey("api_key", "API-Key", String)
	Required("email", "password")
})
View Source
var RegisterParams = Type("register-params", func() {
	Attribute("email", String, "The email that will be attached to the account", func() {
		Format("email")
	})
	Attribute("firstName", String, "The user's given name", func() {
		MinLength(minNameLength)
		MaxLength(maxNameLength)
	})
	Attribute("lastName", String, "The user's family name", func() {
		MaxLength(maxNameLength)
	})
	Attribute("password", String, "The password associated with the new account", func() {
		Pattern(passwordPattern)
		MinLength(minPassLength)
		MaxLength(maxPassLength)
	})
	Attribute("phone", String, "The user's phone number")
	Attribute("gRecaptchaResponse", String, "The recaptcha response code")
	Attribute("Authorization", String)
	Attribute("X-Session", String)
	APIKey("api_key", "API-Key", String)
	Required("email", "password", "firstName", "lastName", "gRecaptchaResponse")
})
View Source
var ResetPasswordParams = Type("reset-password-params", func() {
	Attribute("resetCode", String, "The UUID of the password reset, send from the user's email")
	Attribute("userID", String, "The ID of the user to reset the password of")
	Attribute("newPassword", String, "The new password that will be used to login to the account", func() {
		Pattern(passwordPattern)
		MinLength(minPassLength)
		MaxLength(maxPassLength)
	})
	APIKey("api_key", "API-Key", String)
	Required("resetCode", "userID", "newPassword")
})
View Source
var SessionMedia = ResultType("session", func() {
	Description("A session for a user, associated with a specific browser")
	Attributes(func() {
		Attribute("id", String, "Unique unchanging session ID")
		Attribute("userId", String, "ID of the user this session is for")
		Attribute("lastUsed", String, "Time that this session was last used", func() {
			Format(FormatDateTime)
		})
		Attribute("browser", String, "The browser and browser version connected with this session")
		Attribute("os", String, "The OS of the system where this session was used")
		Attribute("ip", String, "The last IP address where this session was used")
		Attribute("location", String, "A humanReadable string describing the last known location of the session")
		Attribute("latitude", String, "The latitude of the last known location of the session")
		Attribute("longitude", String, "The longitude of the last known location of the session")
		Attribute("isMobile", Boolean, "Whether the session was from a mobile device")
		Attribute("mapUrl", String, "The URL of the Google map to show the location, suitable for using in an img tag")
		Required("id", "userId", "lastUsed", "browser", "os", "ip", "location", "latitude", "longitude", "isMobile", "mapUrl")
	})

	View("default", func() {
		Attribute("id")
		Attribute("userId")
		Attribute("lastUsed")
		Attribute("browser")
		Attribute("os")
		Attribute("ip")
		Attribute("location")
		Attribute("latitude")
		Attribute("longitude")
		Attribute("isMobile")
		Attribute("mapUrl")
	})
})
View Source
var UserMedia = ResultType("user-media", func() {
	Description("A user in the system")
	ContentType("application/json")
	Attributes(func() {
		Attribute("id", String, "Unique unchanging user ID")
		Attribute("firstName", String, "Given name for the user", func() {
			Example("Jeff")
		})
		Attribute("lastName", String, "Family name for the user", func() {
			Example("Newmann")
		})
		Attribute("email", String, "Email attached to the account of the user")
		Attribute("phone", String, "Phone Number Of the user")
		Attribute("changingEmail", String, "When the user attempts to change their email, this is what they will change it to after they verify that it belongs to them")
		Attribute("verifiedEmail", Boolean, "Whether the user has verified their email")
		Attribute("isAdmin", Boolean, "Whether the user is an administrator on the site")
		Attribute("updatedAt", String, func() {
			Format(FormatDateTime)
		})
		Attribute("isActive", Boolean)
		Attribute("createdAt", String, func() {
			Format(FormatDateTime)
		})
		Attribute("countryPhoneCode", String)
		Attribute("Authorization", String)
		Attribute("X-Session", String)

		Required("id", "email", "phone", "verifiedEmail", "firstName", "lastName", "Authorization", "X-Session")
	})
	View("default", func() {
		Attribute("id")
		Attribute("phone")
		Attribute("lastName")
		Attribute("updatedAt")
		Attribute("email")
		Attribute("createdAt")
		Attribute("firstName")
		Attribute("countryPhoneCode")
		Attribute("changingEmail")
		Attribute("isAdmin")
		Attribute("verifiedEmail")
		Attribute("Authorization")
		Attribute("X-Session")
	})
})
View Source
var UserUpdateParams = Type("user-update-params", func() {
	Attribute("firstName", String, "Given name for the user", func() {
		Example("Jeff")
	})
	Attribute("lastName", String, "Family name for the user", func() {
		Example("Newmann")
	})
	Attribute("email", String, "Email attached to the account of the user")
	Attribute("phone", String, "Phone Number Of the user")
	Attribute("changingEmail", String, "When the user attempts to change their email, this is what they will change it to after they verify that it belongs to them")
	Attribute("verifiedEmail", Boolean, "Whether the user has verified their email")
	Attribute("isAdmin", Boolean, "Whether the user is an administrator on the site")
	Attribute("countryPhoneCode", String)
	Token("Authorization")
	Token("X-Session")
	APIKey("api_key", "API-Key", String)
})

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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