Service implementation details.
Service implementation details.
(create! data)
(create! type data)
Inputs: ([data :- us/CreateInput] [type :- us/SignupType data :- us/CreateInput]) Returns: (s/either us/User OpError)
Creates a full user document using the supplied method; returns the created FullUser or PendingUser. For non-pending users, given email and username (if specified) must be unique.
Inputs: ([data :- us/CreateInput] [type :- us/SignupType data :- us/CreateInput]) Returns: (s/either us/User OpError) Creates a full user document using the supplied method; returns the created FullUser or PendingUser. For non-pending users, given email and username (if specified) must be unique.
(delete-by-id! user-id)
Inputs: [user-id :- us/UserID] Returns: s/Bool
Deletes the given FullUser or PendingUser, returns true if the id was deleted, or false if not.
Inputs: [user-id :- us/UserID] Returns: s/Bool Deletes the given FullUser or PendingUser, returns true if the id was deleted, or false if not.
(email-and-username-ok? prev-user type updates)
Inputs: [prev-user :- (s/named s/Any "previous user fragment.") type :- UserType updates :- (s/named s/Any "user fragment")] Returns: OpStatus
If the email or username is different in the proposed updates, it will check to see if they are allowed (for FullUsers). Email here is an EmailMap.
Inputs: [prev-user :- (s/named s/Any "previous user fragment.") type :- UserType updates :- (s/named s/Any "user fragment")] Returns: OpStatus If the email or username is different in the proposed updates, it will check to see if they are allowed (for FullUsers). Email here is an EmailMap.
(fulluser-table)
Returns a command for the full user table, suitable for chaining with other commands.
Returns a command for the full user table, suitable for chaining with other commands.
Generates a user document off of the information provided for the supplied type. Signup gives username and password only, for example. Facebook gives a bit more.
Generates a user document off of the information provided for the supplied type. Signup gives username and password only, for example. Facebook gives a bit more.
(generate-username {:keys [email first-name last-name]})
Inputs: [{:keys [email first-name last-name]} :- GenOptions] Returns: s/Str
Generates a random username for the supplied GenOptions map of seeding options. Tries concatenating the first and last names, taking just the first initial and last name, and the email prefix (before the @ sign). After that, attempts to generate a username. NOT guaranteed to terminate, but extremely likely :)
Inputs: [{:keys [email first-name last-name]} :- GenOptions] Returns: s/Str Generates a random username for the supplied GenOptions map of seeding options. Tries concatenating the first and last names, taking just the first initial and last name, and the email prefix (before the @ sign). After that, attempts to generate a username. NOT guaranteed to terminate, but extremely likely :)
(get-all-full-users)
Inputs: [] Returns: [us/FullUser]
Inputs: [] Returns: [us/FullUser]
(get-all-pending-users)
Inputs: [] Returns: [us/PendingUser]
Inputs: [] Returns: [us/PendingUser]
(get-user-by-email email-address)
Inputs: [email-address :- s/Str] Returns: {:fulluser (s/maybe us/FullUser), :pending [us/PendingUser]}
Returns all matching full users and pending users for the given email.
Inputs: [email-address :- s/Str] Returns: {:fulluser (s/maybe us/FullUser), :pending [us/PendingUser]} Returns all matching full users and pending users for the given email.
(get-user-by-fb-id fb-id)
Inputs: [fb-id :- s/Str] Returns: (s/maybe us/FullUser)
Does a lookup for a FullUser by facebook id.
Inputs: [fb-id :- s/Str] Returns: (s/maybe us/FullUser) Does a lookup for a FullUser by facebook id.
(get-user-by-id id)
Inputs: [id :- us/UserID] Returns: (s/maybe us/User)
Returns the user for the given id. Could be a full user or pending user.
Inputs: [id :- us/UserID] Returns: (s/maybe us/User) Returns the user for the given id. Could be a full user or pending user.
(get-user-by-reset-code reset-code)
Inputs: [reset-code :- s/Str] Returns: (s/maybe us/FullUser)
Inputs: [reset-code :- s/Str] Returns: (s/maybe us/FullUser)
(get-users-by-emails emails)
Inputs: [emails :- [us/EMailAddress]] Returns: {:full {us/EMailAddress us/FullUser}, :pending {us/EMailAddress [us/PendingUser]}}
Returns all users that match the given emails, lower cased. Checks FullUsers (one match per email) and PendingUsers (might be multiple matches). Returns lowercased emails to Users.
Inputs: [emails :- [us/EMailAddress]] Returns: {:full {us/EMailAddress us/FullUser}, :pending {us/EMailAddress [us/PendingUser]}} Returns all users that match the given emails, lower cased. Checks FullUsers (one match per email) and PendingUsers (might be multiple matches). Returns lowercased emails to Users.
(get-users-by-ids ids)
Inputs: [ids :- [us/UserID]] Returns: {:full {us/UserID us/FullUser}, :pending {us/UserID us/PendingUser}}
Returns all users that match the given ids. Checks FullUsers and PendingUsers. Only one match per ID.
Inputs: [ids :- [us/UserID]] Returns: {:full {us/UserID us/FullUser}, :pending {us/UserID us/PendingUser}} Returns all users that match the given ids. Checks FullUsers and PendingUsers. Only one match per ID.
(get-users-by-names names)
Inputs: [names :- [us/FullName]] Returns: {:full {us/FullName [us/FullUser]}, :pending {us/FullName [us/PendingUser]}}
Returns those users (full and pending) that match the given name query with whitespace removed, and lowercased. We return downcased FullName to matches.
Inputs: [names :- [us/FullName]] Returns: {:full {us/FullName [us/FullUser]}, :pending {us/FullName [us/PendingUser]}} Returns those users (full and pending) that match the given name query with whitespace removed, and lowercased. We return downcased FullName to matches.
(get-users-by-usernames usernames)
Inputs: [usernames :- [us/UserName]] Returns: {:full {us/UserName us/FullUser}}
Returns the usernames for the given users. No pending users, each username only matches to one fulluser. Does a lowercase= match. Returns lowercased usernames to FullUser.
Inputs: [usernames :- [us/UserName]] Returns: {:full {us/UserName us/FullUser}} Returns the usernames for the given users. No pending users, each username only matches to one fulluser. Does a lowercase= match. Returns lowercased usernames to FullUser.
(map-by key-func val-func coll)
(map-values f m)
Maps the keyspace using the supplied function. Any duplicate keys will get knocked out in a nondeterministic order, so be careful!
Maps the keyspace using the supplied function. Any duplicate keys will get knocked out in a nondeterministic order, so be careful!
(merge-users! {:keys [profile] :as primary-user-id} absorbed-user-id)
Inputs: [{:keys [profile], :as primary-user-id} :- us/UserID absorbed-user-id :- us/UserID] Returns: (s/maybe us/User)
Merges absorbed user into primary user. Returns the primary with the newly merged fields. You can merge pending into pending, full into full, pending into full, but NOT full into pending.
Inputs: [{:keys [profile], :as primary-user-id} :- us/UserID absorbed-user-id :- us/UserID] Returns: (s/maybe us/User) Merges absorbed user into primary user. Returns the primary with the newly merged fields. You can merge pending into pending, full into full, pending into full, but NOT full into pending.
(pendinguser-table)
Returns a command for the pending user table, suitable for chaining with other commands.
Returns a command for the pending user table, suitable for chaining with other commands.
(put! {:keys [id] :as new-user})
Inputs: [{:keys [id], :as new-user} :- us/User] Returns: (s/either us/User OpError)
Puts the user-doc with the desired changes. Cant change id. Email and username must be unique for FullUsers. Works for FullUsers and PendingUsers. Returns the newly put user, if the id was valid.
Inputs: [{:keys [id], :as new-user} :- us/User] Returns: (s/either us/User OpError) Puts the user-doc with the desired changes. Cant change id. Email and username must be unique for FullUsers. Works for FullUsers and PendingUsers. Returns the newly put user, if the id was valid.
(run-fulluser & commands)
Runs a command on the user table.
Runs a command on the user table.
(run-pendinguser & commands)
Runs a command on the user table.
Runs a command on the user table.
(search-full query)
Inputs: [query :- s/Str]
Searches first name, last name, full name, email address, and username.
Inputs: [query :- s/Str] Searches first name, last name, full name, email address, and username.
(search-pending query)
Inputs: [query :- s/Str]
Searches name (or fragment) and email address.
Inputs: [query :- s/Str] Searches name (or fragment) and email address.
(try-lower-case s)
Inputs: [s :- (s/maybe s/Str)] Returns: (s/maybe s/Str)
Inputs: [s :- (s/maybe s/Str)] Returns: (s/maybe s/Str)
(try-remove-spaces s)
Inputs: [s :- (s/maybe s/Str)] Returns: (s/maybe s/Str)
Inputs: [s :- (s/maybe s/Str)] Returns: (s/maybe s/Str)
(update! user updates)
Inputs: [user :- (s/either us/UserID us/User) updates :- {s/Any s/Any}] Returns: (s/either us/User OpError)
Updates the user with the given id by merging it with the new map. Can't update id. Works for FullUsers and PendingUsers. Returns the record for the updated user, or nil if the user-id was invalid. Note that this is a deep merge - nested fields get merged in, other keys in the nested field are unaffected.
Inputs: [user :- (s/either us/UserID us/User) updates :- {s/Any s/Any}] Returns: (s/either us/User OpError) Updates the user with the given id by merging it with the new map. Can't update id. Works for FullUsers and PendingUsers. Returns the record for the updated user, or nil if the user-id was invalid. Note that this is a deep merge - nested fields get merged in, other keys in the nested field are unaffected.
(user-type user)
Inputs: [user :- us/User] Returns: UserType
Returns the user type, depending on whether or not a :username is present.
Inputs: [user :- us/User] Returns: UserType Returns the user type, depending on whether or not a :username is present.
(winner candidates)
Inputs: [candidates :- [(s/maybe s/Str)]] Returns: (s/maybe s/Str)
Queries the database for all supplied username candidates. Returns the first candidate that doesn't already exist in the database, or nil if they all do.
Inputs: [candidates :- [(s/maybe s/Str)]] Returns: (s/maybe s/Str) Queries the database for all supplied username candidates. Returns the first candidate that doesn't already exist in the database, or nil if they all do.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close