Liking cljdoc? Tell your friends :D

hub.user.service

Service implementation details.

Service implementation details.
raw docstring

create!clj

(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.
raw docstring

delete-by-id!clj

(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.
raw docstring

email-and-username-ok?clj

(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.
raw docstring

fulluser-tableclj

(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.
raw docstring

generate-usercljmultimethod

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.
raw docstring

generate-usernameclj

(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 :)
raw docstring

GenOptionsclj

Options for username generation.

Options for username generation.
raw docstring

get-all-full-usersclj

(get-all-full-users)

Inputs: [] Returns: [us/FullUser]

Inputs: []
Returns: [us/FullUser]
raw docstring

get-all-pending-usersclj

(get-all-pending-users)

Inputs: [] Returns: [us/PendingUser]

Inputs: []
Returns: [us/PendingUser]
raw docstring

get-user-by-emailclj

(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.
raw docstring

get-user-by-fb-idclj

(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.
raw docstring

get-user-by-idclj

(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.
raw docstring

get-user-by-reset-codeclj

(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)
raw docstring

get-users-by-emailsclj

(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.
raw docstring

get-users-by-idsclj

(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.
raw docstring

get-users-by-namesclj

(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.
raw docstring

get-users-by-usernamesclj

(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.
raw docstring

LookupValueclj


map-byclj

(map-by key-func val-func coll)

map-valuesclj

(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!
raw docstring

merge-users!clj

(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.
raw docstring

OpErrorclj

raw docstring

OpStatusclj

raw docstring

OpSuccessclj

raw docstring

pendinguser-tableclj

(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.
raw docstring

put!clj

(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.
raw docstring

put-bulk!clj

(put-bulk! docs)

Inputs: [docs :- [us/User]]

Inputs: [docs :- [us/User]]
raw docstring

run-fulluserclj/smacro

(run-fulluser & commands)

Runs a command on the user table.

Runs a command on the user table.
raw docstring

run-pendinguserclj/smacro

(run-pendinguser & commands)

Runs a command on the user table.

Runs a command on the user table.
raw docstring

search-fullclj

(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.
raw docstring

search-pendingclj

(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.
raw docstring

try-lower-caseclj

(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)
raw docstring

try-remove-spacesclj

(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)
raw docstring

update!clj

(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.
raw docstring

user-typeclj

(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.
raw docstring

UserTypeclj

raw docstring

winnerclj

(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.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close