├── dev_dependencies.edn ├── boot.properties ├── version.properties ├── .gitignore ├── src └── firebase_cljs │ ├── auth │ ├── error.cljs │ └── provider.cljs │ ├── app.cljs │ ├── error.cljs │ ├── core.cljs │ ├── storage.cljs │ ├── database │ ├── datasnapshot.cljs │ ├── query.cljs │ └── reference.cljs │ ├── promise.cljs │ ├── user.cljs │ ├── auth.cljs │ └── database.cljs ├── dependencies.edn ├── README.md ├── circle.yml ├── LICENSE └── doc └── api ├── firebase-cljs.auth.error.html ├── firebase-cljs.app.html ├── firebase-cljs.error.html ├── firebase-cljs.core.html ├── firebase-cljs.auth.provider.html ├── firebase-cljs.promise.html ├── firebase-cljs.storage.html ├── firebase-cljs.database.datasnapshot.html ├── firebase-cljs.database.query.html ├── firebase-cljs.database.reference.html ├── firebase-cljs.database.html ├── index.html ├── css └── default.css ├── firebase-cljs.auth.html └── firebase-cljs.user.html /dev_dependencies.edn: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /boot.properties: -------------------------------------------------------------------------------- 1 | BOOT_VERSION=2.6.0 2 | BOOT_EMIT_TARGET=no 3 | -------------------------------------------------------------------------------- /version.properties: -------------------------------------------------------------------------------- 1 | #Mon Aug 29 11:30:44 MDT 2016 2 | VERSION=1.3.0 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | pom.xml 2 | pom.xml.asc 3 | *jar 4 | /lib/ 5 | /classes/ 6 | /dist/ 7 | /target/ 8 | /checkouts/ 9 | .lein-deps-sum 10 | .lein-repl-history 11 | .lein-plugins/ 12 | .lein-failures 13 | .nrepl-port 14 | .nrepl-history 15 | -------------------------------------------------------------------------------- /src/firebase_cljs/auth/error.cljs: -------------------------------------------------------------------------------- 1 | (ns firebase-cljs.auth.error 2 | (:require [cljsjs.firebase])) 3 | 4 | (defprotocol FirebaseAuthError 5 | 6 | (code [_] "Unique error code.") 7 | 8 | (message [_] "Complete error message.")) 9 | 10 | (extend-type firebase.auth.Error 11 | 12 | FirebaseAuthError 13 | (code [err] (aget err "code")) 14 | 15 | (message [err] (aget err "message"))) 16 | -------------------------------------------------------------------------------- /dependencies.edn: -------------------------------------------------------------------------------- 1 | [[org.clojure/clojure "1.7.0" :scope "provided"] 2 | [org.clojure/clojurescript "1.7.228" :scope "provided"] 3 | [degree9/bootlaces "0.1.13" :scope "test"] 4 | [degree9/boot-semver "1.2.1" :scope "test"] 5 | [tolitius/boot-check "0.1.1" :scope "test"] 6 | [funcool/boot-codeina "0.1.0-SNAPSHOT" :scope "test"] 7 | [cljsjs/firebase "3.2.1-0"] 8 | ] 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # firebase-cljs 2 | Cljs bindings for Firebase v3 API. 3 | 4 | [![Clojars Project](https://img.shields.io/clojars/v/degree9/firebase-cljs.svg)](https://clojars.org/degree9/firebase-cljs) 5 | [![CircleCI](https://img.shields.io/circleci/project/degree9/firebase-cljs.svg?maxAge=3600000&label=circle-ci)](https://circleci.com/gh/degree9/firebase-cljs) 6 | 7 | [Current API Docs](https://degree9.github.io/firebase-cljs/) 8 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | java: 3 | version: oraclejdk8 4 | environment: 5 | BOOT_JAVA_OPTIONS: "-Xms512m -Xmx2048m" 6 | 7 | dependencies: 8 | pre: 9 | - curl -L https://github.com/boot-clj/boot-bin/releases/download/latest/boot.sh -o ~/bin/boot 10 | - chmod +x ~/bin/boot 11 | - ~/bin/boot ci-deps 12 | cache_directories: 13 | - "~/bin" 14 | - "~/.m2" 15 | - "~/.boot/cache/bin" 16 | - "~/.boot/cache/lib" 17 | 18 | test: 19 | override: 20 | - ~/bin/boot tests 21 | -------------------------------------------------------------------------------- /src/firebase_cljs/app.cljs: -------------------------------------------------------------------------------- 1 | (ns firebase-cljs.app 2 | (:refer-clojure :exclude [name]) 3 | (:require [cljsjs.firebase])) 4 | 5 | (defprotocol FirebaseApp 6 | 7 | (name [_] "Get app name.") 8 | 9 | (options [_] "Get app options.") 10 | 11 | (get-auth [_] "Get app auth object.") 12 | 13 | (get-db [_] "Get app database object.") 14 | 15 | (get-storage [_] "Get app storage object.")) 16 | 17 | 18 | (extend-type firebase.app.App 19 | 20 | FirebaseApp 21 | (name [app] (.. app -name)) 22 | 23 | (options [app] (.. app -options)) 24 | 25 | (get-auth [app] (.. app auth)) 26 | 27 | (get-db [app] (.. app database)) 28 | 29 | (get-storage [app] (.. app storage))) 30 | -------------------------------------------------------------------------------- /src/firebase_cljs/error.cljs: -------------------------------------------------------------------------------- 1 | (ns firebase-cljs.error 2 | (:require [cljsjs.firebase])) 3 | 4 | (defprotocol FirebaseError 5 | 6 | (get-code [_] "Error codes are strings using the following format: 'service/string-code'") 7 | 8 | (get-message [_] "An explanatory message for the error that just occurred.") 9 | 10 | (get-name [_] "The name of the class of Errors.") 11 | 12 | (get-stack [_] "A string value containing the execution backtrace when the error originally occured.")) 13 | 14 | 15 | (extend-type object 16 | 17 | FirebaseError 18 | (get-code [app] (aget app "code")) 19 | 20 | (get-message [app] (aget app "message")) 21 | 22 | (get-name [app] (aget app "name")) 23 | 24 | (get-stack [app] (aget app "stack"))) 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Degree9 Solutions Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/firebase_cljs/core.cljs: -------------------------------------------------------------------------------- 1 | (ns firebase-cljs.core 2 | (:require [cljsjs.firebase] 3 | [firebase-cljs.app] 4 | [firebase-cljs.auth] 5 | [firebase-cljs.database] 6 | [firebase-cljs.error] 7 | [firebase-cljs.promise] 8 | [firebase-cljs.user] 9 | [firebase-cljs.storage] 10 | )) 11 | 12 | (def fb js/firebase) 13 | 14 | ;; Helpers 15 | (def ->cljs #(js->clj % :keywordize-keys true)) 16 | 17 | ;; Functions 18 | (defn init 19 | ([opts] (.. fb (initializeApp (clj->js opts)))) 20 | ([opts aname] (.. fb (initializeApp (clj->js opts) aname)))) 21 | 22 | (defn get-app 23 | ([] (.. fb app)) 24 | ([aname] (.. fb (app aname)))) 25 | 26 | (defn get-auth 27 | ([] (.. fb auth)) 28 | ([app] (.. fb (auth app)))) 29 | 30 | (defn get-db 31 | ([] (.. fb database)) 32 | ([app] (.. fb (database app)))) 33 | 34 | (defn get-storage 35 | ([] (.. fb storage)) 36 | ([app] (.. fb (storage app)))) 37 | 38 | ;; Firebase Properties 39 | (defn get-apps [] 40 | (->cljs (goog.object/get fb "apps"))) 41 | 42 | (defn get-version [] 43 | (->cljs (goog.object/get fb "SDK_VERSION"))) 44 | -------------------------------------------------------------------------------- /src/firebase_cljs/storage.cljs: -------------------------------------------------------------------------------- 1 | (ns firebase-cljs.storage 2 | (:refer-clojure :exclude [name time]) 3 | (:require [cljsjs.firebase])) 4 | 5 | (defprotocol FirebaseStorage 6 | 7 | (get-app [_] "The app associated with this service.") 8 | 9 | (get-operation-time [_] "The maximum time to retry operations other than uploads or downloads in milliseconds.") 10 | 11 | (get-upload-time [_] "The maximum time to retry uploads in milliseconds.") 12 | 13 | (get-ref [_ path] "Returns a reference for the given path in the default bucket.") 14 | 15 | (get-ref-url [_ path] "Returns a reference for the given absolute URL.") 16 | 17 | (set-operation-time [_ time] "Set maximum operation retry time in milliseconds.") 18 | 19 | (set-upload-time [_ time] "Set maximum upload retry time in milliseconds.")) 20 | 21 | 22 | (extend-type firebase.storage.Storage 23 | 24 | FirebaseStorage 25 | (get-app [stor] (.. stor -app)) 26 | 27 | (get-operation-time [stor] (.. stor -maxOperationRetryTime)) 28 | 29 | (get-upload-time [stor] (.. stor -maxUploadRetryTime)) 30 | 31 | (get-ref [stor path] (.. stor (ref path))) 32 | 33 | (get-ref-url [stor path] (.. stor (refFromURL path))) 34 | 35 | (set-operation-time [stor time] (.. stor (setMaxOperationRetryTime time))) 36 | 37 | (set-upload-time [stor time] (.. stor (setMaxUploadRetryTime time)))) 38 | 39 | -------------------------------------------------------------------------------- /src/firebase_cljs/auth/provider.cljs: -------------------------------------------------------------------------------- 1 | (ns firebase-cljs.auth.provider 2 | (:require [cljsjs.firebase])) 3 | 4 | (defn email 5 | "Email and password auth provider implementation." 6 | [] 7 | (new js/firebase.auth.EmailAuthProvider)) 8 | 9 | (defn facebook 10 | "Facebook auth provider." 11 | [] 12 | (new js/firebase.auth.FacebookAuthProvider)) 13 | 14 | (defn github 15 | "Github auth provider." 16 | [] 17 | (new js/firebase.auth.GithubAuthProvider)) 18 | 19 | (defn google 20 | "Google auth provider." 21 | [] 22 | (new js/firebase.auth.GoogleAuthProvider)) 23 | 24 | (defn twitter 25 | "Twitter auth provider." 26 | [] 27 | (new js/firebase.auth.TwitterAuthProvider)) 28 | 29 | (defn scope 30 | "Add scope to auth provider." 31 | [provider scope] 32 | (.. provider (addScope scope))) 33 | 34 | (defn scope-email 35 | "Add email scope to auth provider." 36 | [auth provider] 37 | (case provider 38 | :google (scope auth "https://www.googleapis.com/auth/userinfo.email") 39 | :facebook (scope auth "email") 40 | :github (scope auth "user:email"))) 41 | 42 | (defn scope-profile 43 | "Add profile scope to auth provider." 44 | [auth provider] 45 | (case provider 46 | :google (scope auth "https://www.googleapis.com/auth/userinfo.profile") 47 | :facebook (scope auth "public_profile") 48 | :github (scope auth ""))) 49 | -------------------------------------------------------------------------------- /src/firebase_cljs/database/datasnapshot.cljs: -------------------------------------------------------------------------------- 1 | (ns firebase-cljs.database.datasnapshot 2 | (:refer-clojure :exclude [ref key val sort-by remove set take take-last]) 3 | (:require [cljsjs.firebase])) 4 | 5 | (defprotocol FirebaseDatabaseDataSnapshot 6 | 7 | (key [_] "Get DataSnapshot key.") 8 | 9 | (ref [_] "Get DataSnapshot ref.") 10 | 11 | (child [_ child] "Get child DataSnapshot from DataSnapshot.") 12 | 13 | (exists [_] "Returns True if val != Null.") 14 | 15 | (for-each [_ action] "Enumerate the top-level children in the DataSnapshot.") 16 | 17 | (get-priority [_] "Returns priority value as String, Number or Null.") 18 | 19 | (child? [_ child] "Returns True if DataSnapshot has child.") 20 | 21 | (children? [_] "Returns True if DataSnapshot has children.") 22 | 23 | (count-children [_] "Returns children count.") 24 | 25 | (val [_] "Convert the DataSnapshot to a Javascript value (number, boolean, string, Object, Array or null).")) 26 | 27 | (extend-type object 28 | 29 | FirebaseDatabaseDataSnapshot 30 | (key [snap] (aget snap "key")) 31 | 32 | (ref [snap] (aget snap "ref")) 33 | 34 | (child [snap path] (.. snap (child path))) 35 | 36 | (exists [snap] (.. snap exists)) 37 | 38 | (for-each [snap action] (.. snap (forEach action))) 39 | 40 | (get-priority [snap] (.. snap getPriority)) 41 | 42 | (child? [snap path] (.. snap (hasChild path))) 43 | 44 | (children? [snap] (.. snap hasChildren)) 45 | 46 | (count-children [snap] (.. snap numChildren)) 47 | 48 | (val [snap] (.val snap))) 49 | -------------------------------------------------------------------------------- /src/firebase_cljs/promise.cljs: -------------------------------------------------------------------------------- 1 | (ns firebase-cljs.promise 2 | (:refer-clojure :exclude [catch resolve promise]) 3 | (:require [cljsjs.firebase])) 4 | 5 | (defn promise 6 | ([] (.Promise js/firebase)) 7 | ([val] (.Promise js/firebase val))) 8 | 9 | (defprotocol FirebaseThenable 10 | 11 | (catch [_ callback] "Assign a callback when the Thenable rejects.") 12 | 13 | (then [_ callback] 14 | [_ callback failure] 15 | "Assign callback functions called when the Thenable value either resolves, or is rejected.")) 16 | 17 | (defprotocol FirebasePromise 18 | 19 | (all [_ values] "Convert an array of Promises, to a single array of values. Promise.all() resolves only after all the Promises in the array have resolved.") 20 | 21 | (reject [_ failure] "Return (an immediately) rejected Promise.") 22 | 23 | (resolve [_ value] "Return (an immediately) resolved Promise.")) 24 | 25 | (extend-type firebase.Promise 26 | 27 | FirebaseThenable 28 | (catch [prom callback] (.catch prom callback)) 29 | 30 | (then 31 | ([prom callback] 32 | (.then prom callback)) 33 | ([prom callback failure] 34 | (.then prom callback failure))) 35 | 36 | FirebasePromise 37 | (all [prom values] (.all prom values)) 38 | 39 | (reject [prom failure] (.reject prom failure)) 40 | 41 | (resolve [prom value] (.resolve prom value))) 42 | 43 | (extend-type object 44 | 45 | FirebaseThenable 46 | (catch [prom callback] (.catch prom callback)) 47 | 48 | (then 49 | ([prom callback] 50 | (.then prom callback)) 51 | ([prom callback failure] 52 | (.then prom callback failure))) 53 | 54 | FirebasePromise 55 | (all [prom values] (.all prom values)) 56 | 57 | (reject [prom failure] (.reject prom failure)) 58 | 59 | (resolve [prom value] (.resolve prom value))) 60 | -------------------------------------------------------------------------------- /src/firebase_cljs/user.cljs: -------------------------------------------------------------------------------- 1 | (ns firebase-cljs.user 2 | (:refer-clojure :exclude [name remove]) 3 | (:require [cljsjs.firebase])) 4 | 5 | (defprotocol FirebaseUser 6 | 7 | (verified? [_] "True if the user's email address has been verified.") 8 | 9 | (anonymous? [_] "True if user is anonymous.") 10 | 11 | (get-providerdata [_] "Additional provider-specific information about the user.") 12 | 13 | (get-refreshtoken [_] "A refresh token for the user account. Use only for advanced scenarios that require explicitly refreshing tokens.") 14 | 15 | (remove [_] "Deletes and signs out the user.") 16 | 17 | (get-token [_] [_ refresh] "Returns a JWT token used to identify the user to a Firebase service.") 18 | 19 | (link [_ cred] "Links the user account with the given credentials.") 20 | 21 | (link-popup [_ provider] "Links the authenticated provider to the user account using a pop-up based OAuth flow.") 22 | 23 | (link-redirect [_ provider] "Links the authenticated provider to the user account using a full-page redirect flow.") 24 | 25 | (reauthenticate [_ cred] "Re-authenticates a user using a fresh credential. ") 26 | 27 | (reload [_] "Refreshes the current user, if signed in.") 28 | 29 | (send-verification [_] "Sends a verification email to a user.") 30 | 31 | (unlink [_ provider] "Unlinks a provider from a user account.") 32 | 33 | (update-email [_ email] "Updates the user's email address.") 34 | 35 | (update-password [_ pass] "Updates the user's password.") 36 | 37 | (update-profile [_ profile] "Updates a user's profile data.")) 38 | 39 | (defprotocol FirebaseUserInfo 40 | 41 | (name [_] "The user's display name (if available).") 42 | 43 | (email [_] "The user's email address (if available).") 44 | 45 | (photo-url [_] "The URL of the user's profile picture (if available).") 46 | 47 | (providerid [_] "The authentication provider ID for the current user. For example, 'facebook.com', or 'google.com'.") 48 | 49 | (uid [_] "The user's unique ID.")) 50 | 51 | (extend-type firebase.User 52 | 53 | FirebaseUserInfo 54 | (name [user] (aget user "displayName")) 55 | 56 | (email [user] (aget user "email")) 57 | 58 | (photo-url [user] (aget user "photoURL")) 59 | 60 | (providerid [user] (aget user "providerId")) 61 | 62 | (uid [user] (aget user "uid")) 63 | 64 | FirebaseUser 65 | (verified? [user] (aget user "emailVerified")) 66 | 67 | (anonymous? [user] (aget user "isAnonymous")) 68 | 69 | (get-providerdata [user] (aget user "providerData")) 70 | 71 | (get-refreshtoken [user] (aget user "refreshToken")) 72 | 73 | (remove [user] (.. user delete)) 74 | 75 | (get-token 76 | ([user] (.. user getToken)) 77 | ([user refresh] (.. user (getToken refresh)))) 78 | 79 | (link [user cred] (.. user (link cred))) 80 | 81 | (link-popup [user provider] (.. user (linkWithPopup provider))) 82 | 83 | (link-redirect [user provider] (.. user (linkWithRedirect provider))) 84 | 85 | (reauthenticate [user cred] (.. user (reauthenticate cred))) 86 | 87 | (reload [user] (.. user reload)) 88 | 89 | (send-verification [user] (.. user sendEmailVerification)) 90 | 91 | (unlink [user provider] (.. user (unlink provider))) 92 | 93 | (update-email [user email] (.. user (updateEmail email))) 94 | 95 | (update-password [user pass] (.. user (updatePassword pass))) 96 | 97 | (update-profile [user profile] (.. user (updateProfile profile)))) 98 | -------------------------------------------------------------------------------- /src/firebase_cljs/database/query.cljs: -------------------------------------------------------------------------------- 1 | (ns firebase-cljs.database.query 2 | (:refer-clojure :exclude [ref key val sort-by remove set take take-last]) 3 | (:require [cljsjs.firebase])) 4 | 5 | (defprotocol FirebaseDatabaseQuery 6 | 7 | (get-ref [_] "Get Query ref.") 8 | 9 | (end-at 10 | [_ val] 11 | [_ val key] 12 | "Creates a Query with the specified ending point. The generated Query includes children which match the specified ending point.") 13 | 14 | (equal-to 15 | [_ val] 16 | [_ val key] 17 | "Creates a Query which includes children which match the specified value.") 18 | 19 | (take 20 | [_ limit] 21 | "Generates a new Query object limited to the first limit number of children.") 22 | 23 | (take-last 24 | [_ limit] 25 | "Generates a new Query object limited to the last limit number of children.") 26 | 27 | (off 28 | [_] 29 | [_ event] 30 | [_ event callback] 31 | [_ event callback failure] 32 | "Detaches a callback previously attached with on.") 33 | 34 | (on 35 | [_ event] 36 | [_ event callback] 37 | [_ event callback failure] 38 | "Listens for data changes at a particular location.") 39 | 40 | (once 41 | [_ event] 42 | [_ event callback] 43 | [_ event callback failure] 44 | "Listens for exactly one event of the specified event type, and then stops listening.") 45 | 46 | (sort-by 47 | [_ sort] 48 | [_ sort val] 49 | "Generates a new Query object ordered by the specified type.") 50 | 51 | (start-at 52 | [_ val] 53 | [_ val key] 54 | "Creates a Query with the specified starting point. The generated Query includes children which match the specified starting point.") 55 | 56 | (to-str 57 | [_] 58 | "Returns string URL for this location.")) 59 | 60 | (extend-type firebase.database.Query 61 | 62 | FirebaseDatabaseQuery 63 | (get-ref [query] (.. query -ref)) 64 | 65 | (end-at 66 | ([query val] 67 | (.. query (endAt val))) 68 | ([query val key] 69 | (.. query (endAt val key)))) 70 | 71 | (equal-to 72 | ([query val] 73 | (.. query (equalTo val))) 74 | ([query val key] 75 | (.. query (equalTo val key)))) 76 | 77 | (take [query limit] (.. query (limitToFirst limit))) 78 | 79 | (take-last [query limit] (.. query (limitToLast limit))) 80 | 81 | (off 82 | ([query] 83 | (.. query off)) 84 | ([query event] 85 | (.. query (off event))) 86 | ([query event callback] 87 | (.. query (off event callback))) 88 | ([query event callback failure] 89 | (.. query (off event callback failure)))) 90 | 91 | (on 92 | ([query event callback] 93 | (.. query (on event callback))) 94 | ([query event callback failure] 95 | (.. query (on event callback failure)))) 96 | 97 | (once 98 | ([query event] 99 | (.. query (once event))) 100 | ([query event callback] 101 | (.. query (once event callback))) 102 | ([query event callback failure] 103 | (.. query (once event callback failure)))) 104 | 105 | (sort-by 106 | ([query sort] 107 | (sort-by query sort nil)) 108 | ([query sort val] 109 | (case sort 110 | :child (.. query (orderByChild val)) 111 | :key (.. query orderByKey) 112 | :priority (.. query orderByPriority) 113 | :value (.. query orderByValue)))) 114 | 115 | (start-at 116 | ([query val] 117 | (.. query (startAt val))) 118 | ([query val key] 119 | (.. query (startAt val key)))) 120 | 121 | (to-str [query] (.. query toString))) 122 | -------------------------------------------------------------------------------- /doc/api/firebase-cljs.auth.error.html: -------------------------------------------------------------------------------- 1 | 2 | firebase-cljs.auth.error documentation

firebase-cljs Api Documentation

Version: 1.1.0

firebase-cljs.auth.error

FirebaseAuthError

protocol

members

code

(code _)

Unique error code.

message

(message _)

Complete error message.

-------------------------------------------------------------------------------- /doc/api/firebase-cljs.app.html: -------------------------------------------------------------------------------- 1 | 2 | firebase-cljs.app documentation

firebase-cljs Api Documentation

Version: 1.1.0

firebase-cljs.app

FirebaseApp

protocol

members

name

(name _)

Get app name.

options

(options _)

Get app options.

get-auth

(get-auth _)

Get app auth object.

get-db

(get-db _)

Get app database object.

get-storage

(get-storage _)

Get app storage object.

-------------------------------------------------------------------------------- /doc/api/firebase-cljs.error.html: -------------------------------------------------------------------------------- 1 | 2 | firebase-cljs.error documentation

firebase-cljs Api Documentation

Version: 1.1.0

firebase-cljs.error

FirebaseError

protocol

members

get-code

(get-code _)

Error codes are strings using the following format: ‘service/string-code’

get-message

(get-message _)

An explanatory message for the error that just occurred.

get-name

(get-name _)

The name of the class of Errors.

get-stack

(get-stack _)

A string value containing the execution backtrace when the error originally occured.

-------------------------------------------------------------------------------- /src/firebase_cljs/database/reference.cljs: -------------------------------------------------------------------------------- 1 | (ns firebase-cljs.database.reference 2 | (:refer-clojure :exclude [ref key val sort-by remove set take take-last]) 3 | (:require [cljsjs.firebase] 4 | [firebase-cljs.database.query :as query])) 5 | 6 | (defprotocol FirebaseDatabaseReference 7 | 8 | (get-key [_] "The key of a given reference.") 9 | 10 | (get-parent [_] "The parent reference of a given reference.") 11 | 12 | (get-root [_] "The root of a given reference.") 13 | 14 | (get-child [_ child] "Returns the child as a Reference.") 15 | 16 | (on-disconnect [_] "Returns onDisconnect object.") 17 | 18 | (push! 19 | [_] 20 | [_ val] 21 | [_ val callback] 22 | "Generates a new child location using a unique key and returns a Firebase reference to it.") 23 | 24 | (remove! 25 | [_] 26 | [_ callback] 27 | "Removes the data at this Firebase location.") 28 | 29 | (set! 30 | [_ val] 31 | [_ val callback] 32 | "Writes data to this Firebase location.") 33 | 34 | (set-priority! 35 | [_ priority] 36 | [_ priority callback] 37 | "Sets a priority for the data at this Firebase location.") 38 | 39 | (set-with-priority! 40 | [_ val priority] 41 | [_ val priority callback] 42 | "Writes data to this Firebase location. Like set() but also specifies the priority for that data.") 43 | 44 | (transaction 45 | [_ update] 46 | [_ update callback] 47 | [_ update callback locally] 48 | "Atomically modifies the data at this location.") 49 | 50 | (update! 51 | [_ obj] 52 | [_ obj callback] 53 | "Writes the enumerated children to this Firebase location.")) 54 | 55 | (extend-type firebase.database.Reference 56 | 57 | query/FirebaseDatabaseQuery 58 | (get-ref [query] (.. query -ref)) 59 | 60 | (end-at 61 | ([query val] 62 | (.. query (endAt val))) 63 | ([query val key] 64 | (.. query (endAt val key)))) 65 | 66 | (equal-to 67 | ([query val] 68 | (.. query (equalTo val))) 69 | ([query val key] 70 | (.. query (equalTo val key)))) 71 | 72 | (take [query limit] (.. query (limitToFirst limit))) 73 | 74 | (take-last [query limit] (.. query (limitToLast limit))) 75 | 76 | (off 77 | ([query] 78 | (.. query off)) 79 | ([query event] 80 | (.. query (off event))) 81 | ([query event callback] 82 | (.. query (off event callback))) 83 | ([query event callback failure] 84 | (.. query (off event callback failure)))) 85 | 86 | (on 87 | ([query event callback] 88 | (.. query (on event callback))) 89 | ([query event callback failure] 90 | (.. query (on event callback failure)))) 91 | 92 | (once 93 | ([query event] 94 | (.. query (once event))) 95 | ([query event callback] 96 | (.. query (once event callback))) 97 | ([query event callback failure] 98 | (.. query (once event callback failure)))) 99 | 100 | (sort-by 101 | ([query sort] 102 | (query/sort-by query sort nil)) 103 | ([query sort val] 104 | (case sort 105 | :child (.. query (orderByChild val)) 106 | :key (.. query orderByKey) 107 | :priority (.. query orderByPriority) 108 | :value (.. query orderByValue)))) 109 | 110 | (start-at 111 | ([query val] 112 | (.. query (startAt val))) 113 | ([query val key] 114 | (.. query (startAt val key)))) 115 | 116 | (to-str [query] (.. query toString)) 117 | 118 | FirebaseDatabaseReference 119 | (get-key [ref] (.. ref -key)) 120 | 121 | (get-parent [ref] (.. ref -parent)) 122 | 123 | (get-root [ref] ( .. ref -root)) 124 | 125 | (get-child [ref path] (.. ref (child path))) 126 | 127 | (on-disconnect [ref] (.. ref onDisconnect)) 128 | 129 | (push! 130 | ([ref] (.. ref push)) 131 | ([ref val] (.. ref (push val))) 132 | ([ref val callback] (.. ref (push val callback)))) 133 | 134 | (remove! 135 | ([ref] (.. ref remove)) 136 | ([ref callback] (.. ref (remove callback)))) 137 | 138 | (set! 139 | ([ref val] (.. ref (set val))) 140 | ([ref val callback] (.. ref (set val callback)))) 141 | 142 | (set-priority! 143 | ([ref priority] (.. ref (setPriority priority))) 144 | ([ref priority callback] (.. ref (setPriority priority callback)))) 145 | 146 | (set-with-priority! 147 | ([ref val priority] (.. ref (setWithPriority val priority))) 148 | ([ref val priority callback] (.. ref (setWithPriority val priority callback)))) 149 | 150 | (transaction 151 | ([ref update] (.. ref (transaction update))) 152 | ([ref update callback] (.. ref (transaction update callback))) 153 | ([ref update callback locally] (.. ref (transaction update callback locally)))) 154 | 155 | (update! 156 | ([ref obj] (.. ref (update obj))) 157 | ([ref obj callback] (.. ref (update obj callback))))) 158 | -------------------------------------------------------------------------------- /doc/api/firebase-cljs.core.html: -------------------------------------------------------------------------------- 1 | 2 | firebase-cljs.core documentation

firebase-cljs Api Documentation

Version: 1.1.0

firebase-cljs.core

get-app

(get-app)(get-app aname)

get-apps

(get-apps)

get-auth

(get-auth)(get-auth app)

get-db

(get-db)(get-db app)

get-storage

(get-storage)(get-storage app)

get-version

(get-version)

init

(init opts)(init opts aname)
-------------------------------------------------------------------------------- /doc/api/firebase-cljs.auth.provider.html: -------------------------------------------------------------------------------- 1 | 2 | firebase-cljs.auth.provider documentation

firebase-cljs Api Documentation

Version: 1.1.0

firebase-cljs.auth.provider

email

(email)

Email and password auth provider implementation.

facebook

(facebook)

Facebook auth provider.

github

(github)

Github auth provider.

google

(google)

Google auth provider.

scope

(scope provider scope)

Add scope to auth provider.

scope-email

(scope-email auth provider)

Add email scope to auth provider.

scope-profile

(scope-profile auth provider)

Add profile scope to auth provider.

twitter

(twitter)

Twitter auth provider.

-------------------------------------------------------------------------------- /src/firebase_cljs/auth.cljs: -------------------------------------------------------------------------------- 1 | (ns firebase-cljs.auth 2 | (:refer-clojure :exclude [name]) 3 | (:require [cljsjs.firebase])) 4 | 5 | (defprotocol FirebaseAuth 6 | 7 | (get-app 8 | [_] 9 | "The App associated with the Auth service instance.") 10 | 11 | (current-user 12 | [_] 13 | "The currently signed-in user (or null).") 14 | 15 | (apply-actioncode 16 | [_ code] 17 | "Applies a verification code sent to the user by email or other out-of-band mechanism.") 18 | 19 | (check-actioncode 20 | [_ code] 21 | "Checks a verification code sent to the user by email or other out-of-band mechanism.") 22 | 23 | (confirm-pass-reset 24 | [_ code pass] 25 | "Completes the password reset process, given a confirmation code and new password.") 26 | 27 | (create-user 28 | [_ email pass] 29 | "Creates a new user account associated with the specified email address and password.") 30 | 31 | (providers-by-email 32 | [_ email] 33 | "Gets the list of provider IDs that can be used to sign in for the given email address. Useful for an 'identifier-first' sign-in flow.") 34 | 35 | (redirect-result 36 | [_] 37 | "Returns a UserCredential from the redirect-based sign-in flow. 38 | If sign-in succeeded, returns the signed in user. If sign-in was unsuccessful, fails with an error. If no redirect operation was called, returns a UserCredential with a null User.") 39 | 40 | (auth-changed 41 | [_ observer] 42 | [_ observer failure] 43 | [_ observer failure complete] 44 | "Adds an observer for auth state changes.") 45 | 46 | (send-pass-reset 47 | [_ email] 48 | "Sends a password reset email to the given email address.") 49 | 50 | (login-anon 51 | [_] 52 | "Asynchronously signs in as an anonymous user. 53 | If there is already an anonymous user signed in, that user will be returned; otherwise, a new anonymous user identity will be created and returned.") 54 | 55 | (login-cred 56 | [_ cred] 57 | "Asynchronously signs in with the given credentials.") 58 | 59 | (login-token 60 | [_ token] 61 | "Asynchronously signs in using a custom token. 62 | Custom tokens are used to integrate Firebase Auth with existing auth systems, and must be generated by the auth backend.") 63 | 64 | (login-userpass 65 | [_ email pass] 66 | "Asynchronously signs in using an email and password.") 67 | 68 | (login-popup 69 | [_ provider] 70 | "Authenticates a Firebase client using a popup-based OAuth authentication flow.") 71 | 72 | (login-redirect 73 | [_ provider] 74 | "Authenticates a Firebase client using a full-page redirect flow.") 75 | 76 | (logout 77 | [_] 78 | "Signs out the current user.") 79 | 80 | (verify-pass-reset 81 | [_ code] 82 | "Checks a password reset code sent to the user by email or other out-of-band mechanism.")) 83 | 84 | ;(defprotocol FirebaseAuthCredential 85 | 86 | ; (get-provider 87 | ; [_] 88 | ; "The authentication provider ID for the credential. For example, 'facebook.com', or 'google.com'.")) 89 | 90 | ;(defprotocol FirebaseAuthProvider 91 | 92 | ; (get-provider 93 | ; [_] 94 | ; "The authentication provider ID for the provider.")) 95 | 96 | (extend-type firebase.auth.Auth 97 | 98 | FirebaseAuth 99 | (get-app [auth] (.. auth -app)) 100 | 101 | (current-user [auth] (.. auth -currentUser)) 102 | 103 | (apply-actioncode [auth code] (.. auth (applyActionCode code))) 104 | 105 | (check-actioncode [auth code] (.. auth (checkActionCode code))) 106 | 107 | (confirm-pass-reset [auth code pass] (.. auth (confirmPasswordReset code pass))) 108 | 109 | (create-user [auth email pass] (.. auth (createUserWithEmailAndPassword email pass))) 110 | 111 | (providers-by-email [auth email] (.. auth (fetchProvidersForEmail email))) 112 | 113 | (redirect-result [auth] (.. auth getRedirectResult)) 114 | 115 | (auth-changed 116 | ([auth observer] 117 | (.. auth (onAuthStateChanged observer))) 118 | ([auth observer failure] 119 | (.. auth (onAuthStateChanged observer failure))) 120 | ([auth observer failure complete] 121 | (.. auth (onAuthStateChanged observer failure complete)))) 122 | 123 | (send-pass-reset [auth email] (.. auth (sendPasswordResetEmail email))) 124 | 125 | (login-anon [auth] (.. auth signInAnonymously)) 126 | 127 | (login-cred [auth cred] (.. auth (signInWithCredential cred))) 128 | 129 | (login-token [auth token] (.. auth (signInWithCustomToken token))) 130 | 131 | (login-userpass [auth email pass] (.. auth (signInWithEmailAndPassword email pass))) 132 | 133 | (login-popup [auth provider] (.. auth (signInWithPopup provider))) 134 | 135 | (login-redirect [auth provider] (.. auth (signInWithRedirect provider))) 136 | 137 | (logout [auth] (.. auth signOut)) 138 | 139 | (verify-pass-reset [auth code] (.. auth (verifyPasswordResetCode code)))) 140 | 141 | ;(extend-type js/firebase.auth.AuthCredential 142 | 143 | ; FirebaseAuthCredential 144 | ; (get-provider [cred] (.. cred -provider))) 145 | 146 | ;(extend-type js/firebase.auth.AuthProvider 147 | 148 | ; FirebaseAuthProvider 149 | ; (get-provider [prov] (.. prov -providerId))) 150 | -------------------------------------------------------------------------------- /doc/api/firebase-cljs.promise.html: -------------------------------------------------------------------------------- 1 | 2 | firebase-cljs.promise documentation

firebase-cljs Api Documentation

Version: 1.1.0

firebase-cljs.promise

FirebasePromise

protocol

members

all

(all _ values)

Convert an array of Promises, to a single array of values. Promise.all() resolves only after all the Promises in the array have resolved.

reject

(reject _ failure)

Return (an immediately) rejected Promise.

resolve

(resolve _ value)

Return (an immediately) resolved Promise.

FirebaseThenable

protocol

members

catch

(catch _ callback)

Assign a callback when the Thenable rejects.

then

(then _ callback)(then _ callback failure)

Assign callback functions called when the Thenable value either resolves, or is rejected.

promise

(promise)(promise val)
-------------------------------------------------------------------------------- /doc/api/firebase-cljs.storage.html: -------------------------------------------------------------------------------- 1 | 2 | firebase-cljs.storage documentation

firebase-cljs Api Documentation

Version: 1.1.0

firebase-cljs.storage

FirebaseStorage

protocol

members

get-app

(get-app _)

The app associated with this service.

get-operation-time

(get-operation-time _)

The maximum time to retry operations other than uploads or downloads in milliseconds.

get-upload-time

(get-upload-time _)

The maximum time to retry uploads in milliseconds.

get-ref

(get-ref _ path)

Returns a reference for the given path in the default bucket.

get-ref-url

(get-ref-url _ path)

Returns a reference for the given absolute URL.

set-operation-time

(set-operation-time _ time)

Set maximum operation retry time in milliseconds.

set-upload-time

(set-upload-time _ time)

Set maximum upload retry time in milliseconds.

-------------------------------------------------------------------------------- /doc/api/firebase-cljs.database.datasnapshot.html: -------------------------------------------------------------------------------- 1 | 2 | firebase-cljs.database.datasnapshot documentation

firebase-cljs Api Documentation

Version: 1.1.0

firebase-cljs.database.datasnapshot

FirebaseDatabaseDataSnapshot

protocol

members

child

(child _ child)

Get child DataSnapshot from DataSnapshot.

for-each

(for-each _ action)

Enumerate the top-level children in the DataSnapshot.

exists

(exists _)

Returns True if val != Null.

children?

(children? _)

Returns True if DataSnapshot has children.

key

(key _)

Get DataSnapshot key.

ref

(ref _)

Get DataSnapshot ref.

val

(val _)

Convert the DataSnapshot to a Javascript value (number, boolean, string, Object, Array or null).

get-priority

(get-priority _)

Returns priority value as String, Number or Null.

count-children

(count-children _)

Returns children count.

child?

(child? _ child)

Returns True if DataSnapshot has child.

-------------------------------------------------------------------------------- /src/firebase_cljs/database.cljs: -------------------------------------------------------------------------------- 1 | (ns firebase-cljs.database 2 | (:refer-clojure :exclude [reset! swap! conj! get-in]) 3 | (:require [clojure.string :as s] 4 | [cljsjs.firebase] 5 | [firebase-cljs.promise :as fbprom] 6 | [firebase-cljs.database.datasnapshot] 7 | [firebase-cljs.database.query :as fbquery] 8 | [firebase-cljs.database.reference :as fbref])) 9 | 10 | (defprotocol FirebaseDatabase 11 | 12 | (get-app [_] "The App associated with the Database service instance.") 13 | 14 | (offline [_] "Disconnect from the server (all database operations will be completed offline).") 15 | 16 | (online [_] "(Re)connect to the server and synchronize the offline database state with the server state.") 17 | 18 | (get-ref 19 | [_] 20 | [_ path] 21 | "Returns a reference to the root or the specified path.") 22 | 23 | (get-ref-url 24 | [_] 25 | [_ url] 26 | "Returns a reference to the root or the path specified in url. An exception is thrown if the url is not in the same domain as the current database.")) 27 | 28 | (extend-type firebase.database.Database 29 | 30 | FirebaseDatabase 31 | (get-app [db] (.. db -app)) 32 | 33 | (offline [db] (.. db goOffline)) 34 | 35 | (online [db] (.. db goOnline)) 36 | 37 | (get-ref 38 | ([db] (.. db ref)) 39 | ([db path] (.. db (ref path)))) 40 | 41 | (get-ref-url 42 | ([db] (.. db refFromURL)) 43 | ([db url] (.. db (refFromURL url))))) 44 | 45 | ;; Matchbox Inspired API 46 | 47 | (defprotocol MatchboxDatabase 48 | 49 | (get-in [_ korks] "Get child reference as input type.") 50 | 51 | (reset! 52 | [_ val] 53 | [_ val callback] 54 | "Set a reference value. Accepts reference and promises.") 55 | 56 | (swap! 57 | [_ fn] 58 | [_ fn callback] 59 | "Swap a reference value. Accepts reference and promises.") 60 | 61 | (merge! 62 | [_ obj] 63 | [_ obj callback] 64 | "Merge object into reference.") 65 | 66 | (conj! 67 | [_ val] 68 | [_ val callback] 69 | "Conjoin value onto reference.") 70 | 71 | (remove! 72 | [_] 73 | [_ callback] 74 | "Remove reference.") 75 | 76 | (listen 77 | [_ type callback] 78 | [_ korks type callback] 79 | [_ korks type callback failure] 80 | "Listen to reference by event 'type'.") 81 | 82 | (listen-promise 83 | [_ type callback] 84 | [_ korks type callback] 85 | "Listen to a promise reference by event 'type'.") 86 | 87 | (listen-once 88 | [_ type callback] 89 | [_ korks type callback] 90 | "Listen to reference event 'type' once.") 91 | 92 | (disable-listener! 93 | [_ event] 94 | [_ event callback] 95 | "Disable listener by event (or event and callback).")) 96 | 97 | ;; Matchbox API Helpers 98 | (defn korks->path [korks] 99 | (if (vector? korks) 100 | (s/join "/" (mapv #(-> % name str) korks)) 101 | korks)) 102 | 103 | (extend-protocol MatchboxDatabase 104 | 105 | firebase.database.Database 106 | (get-in [db korks] (get-ref db (korks->path korks))) 107 | 108 | (reset! 109 | ([db val] 110 | (reset! (get-ref db) val)) 111 | ([db val callback] 112 | (reset! (get-ref db) val callback))) 113 | 114 | (swap! 115 | ([db fn] 116 | (reset! (get-ref db) fn)) 117 | ([db fn callback] 118 | (reset! (get-ref db) fn callback))) 119 | 120 | (merge! 121 | ([db obj] 122 | (merge! (get-ref db) obj)) 123 | ([db obj callback] 124 | (merge! (get-ref db) obj callback))) 125 | 126 | (conj! 127 | ([db val] 128 | (conj! (get-ref db) val)) 129 | ([db val callback] 130 | (conj! (get-ref db) val callback))) 131 | 132 | (remove! 133 | ([db] 134 | (remove! (get-ref db))) 135 | ([db callback] 136 | (remove! (get-ref db) callback))) 137 | 138 | (listen 139 | ([db type callback] 140 | (listen (get-ref db) type callback)) 141 | ([db korks type callback] 142 | (listen (get-ref db) korks type callback)) 143 | ([db korks type callback failure] 144 | (listen (get-ref db) korks type callback failure))) 145 | 146 | (listen-promise 147 | ([db type callback] 148 | (-> db get-ref (fbquery/once type) (fbprom/then callback))) 149 | ([db korks type callback] 150 | (-> db (get-in korks) (fbquery/once type) (fbprom/then callback)))) 151 | 152 | (listen-once 153 | ([db type callback] 154 | (-> db get-ref (listen-once type callback))) 155 | ([db korks type callback] 156 | (-> db get-ref (get-in korks) (listen-once type callback)))) 157 | 158 | (disable-listener! 159 | ([db event] 160 | (disable-listener! (get-ref db) event)) 161 | ([db event callback] 162 | (disable-listener! (get-ref db) event callback))) 163 | 164 | object 165 | (get-in [ref korks] (fbref/get-child ref (korks->path korks))) 166 | 167 | (reset! 168 | ([ref val] 169 | (fbref/set! ref (clj->js val))) 170 | ([ref val callback] 171 | (fbref/set! ref (clj->js val) callback))) 172 | 173 | (swap! 174 | ([ref fn] 175 | (fbref/transaction ref fn)) 176 | ([ref fn callback] 177 | (fbref/transaction ref fn callback))) 178 | 179 | (merge! 180 | ([ref obj] 181 | (fbref/update! ref (clj->js obj))) 182 | ([ref obj callback] 183 | (fbref/update! ref (clj->js obj) callback))) 184 | 185 | (conj! 186 | ([ref val] 187 | (fbref/push! ref (clj->js val))) 188 | ([ref val callback] 189 | (fbref/push! ref (clj->js val) callback))) 190 | 191 | (remove! 192 | ([ref] 193 | (fbref/remove! ref)) 194 | ([ref callback] 195 | (fbref/remove! ref callback))) 196 | 197 | (listen 198 | ([ref type callback] 199 | (fbquery/on ref type callback)) 200 | ([ref korks type callback] 201 | (fbquery/on (get-in ref korks) type callback)) 202 | ([ref korks type callback failure] 203 | (fbquery/on (get-in ref korks) type callback failure))) 204 | 205 | (listen-promise 206 | ([ref type callback] 207 | (-> ref (fbquery/once type) (fbprom/then callback))) 208 | ([ref korks type callback] 209 | (fbprom/then (fbquery/once (get-in ref korks) type) callback))) 210 | 211 | (listen-once 212 | ([ref type callback] 213 | (fbquery/once ref type callback)) 214 | ([ref korks type callback] 215 | (fbquery/once (get-in ref korks) type callback))) 216 | 217 | (disable-listener! 218 | ([ref event] 219 | (fbquery/off ref event)) 220 | ([ref event callback] 221 | (fbquery/off ref event callback)))) 222 | -------------------------------------------------------------------------------- /doc/api/firebase-cljs.database.query.html: -------------------------------------------------------------------------------- 1 | 2 | firebase-cljs.database.query documentation

firebase-cljs Api Documentation

Version: 1.1.0

firebase-cljs.database.query

FirebaseDatabaseQuery

protocol

members

sort-by

(sort-by _ sort)(sort-by _ sort val)

Generates a new Query object ordered by the specified type.

take-last

(take-last _ limit)

Generates a new Query object limited to the last limit number of children.

take

(take _ limit)

Generates a new Query object limited to the first limit number of children.

to-str

(to-str _)

Returns string URL for this location.

start-at

(start-at _ val)(start-at _ val key)

Creates a Query with the specified starting point. The generated Query includes children which match the specified starting point.

equal-to

(equal-to _ val)(equal-to _ val key)

Creates a Query which includes children which match the specified value.

get-ref

(get-ref _)

Get Query ref.

end-at

(end-at _ val)(end-at _ val key)

Creates a Query with the specified ending point. The generated Query includes children which match the specified ending point.

off

(off _)(off _ event)(off _ event callback)(off _ event callback failure)

Detaches a callback previously attached with on.

once

(once _ event)(once _ event callback)(once _ event callback failure)

Listens for exactly one event of the specified event type, and then stops listening.

on

(on _ event)(on _ event callback)(on _ event callback failure)

Listens for data changes at a particular location.

-------------------------------------------------------------------------------- /doc/api/firebase-cljs.database.reference.html: -------------------------------------------------------------------------------- 1 | 2 | firebase-cljs.database.reference documentation

firebase-cljs Api Documentation

Version: 1.1.0

firebase-cljs.database.reference

FirebaseDatabaseReference

protocol

members

remove!

(remove! _)(remove! _ callback)

Removes the data at this Firebase location.

get-key

(get-key _)

The key of a given reference.

set-with-priority!

(set-with-priority! _ val priority)(set-with-priority! _ val priority callback)

Writes data to this Firebase location. Like set() but also specifies the priority for that data.

get-parent

(get-parent _)

The parent reference of a given reference.

on-disconnect

(on-disconnect _)

Returns onDisconnect object.

transaction

(transaction _ update)(transaction _ update callback)(transaction _ update callback locally)

Atomically modifies the data at this location.

get-root

(get-root _)

The root of a given reference.

set!

(set! _ val)(set! _ val callback)

Writes data to this Firebase location.

push!

(push! _)(push! _ val)(push! _ val callback)

Generates a new child location using a unique key and returns a Firebase reference to it.

set-priority!

(set-priority! _ priority)(set-priority! _ priority callback)

Sets a priority for the data at this Firebase location.

get-child

(get-child _ child)

Returns the child as a Reference.

update!

(update! _ obj)(update! _ obj callback)

Writes the enumerated children to this Firebase location.

-------------------------------------------------------------------------------- /doc/api/firebase-cljs.database.html: -------------------------------------------------------------------------------- 1 | 2 | firebase-cljs.database documentation

firebase-cljs Api Documentation

Version: 1.1.0

firebase-cljs.database

FirebaseDatabase

protocol

members

offline

(offline _)

Disconnect from the server (all database operations will be completed offline).

online

(online _)

(Re)connect to the server and synchronize the offline database state with the server state.

get-ref

(get-ref _)(get-ref _ path)

Returns a reference to the root or the specified path.

get-app

(get-app _)

The App associated with the Database service instance.

get-ref-url

(get-ref-url _)(get-ref-url _ url)

Returns a reference to the root or the path specified in url. An exception is thrown if the url is not in the same domain as the current database.

korks->path

(korks->path korks)

MatchboxDatabase

protocol

members

listen-once

(listen-once _ type callback)(listen-once _ korks type callback)

Listen to reference event ‘type’ once.

remove!

(remove! _)(remove! _ callback)

Remove reference.

listen-promise

(listen-promise _ type callback)(listen-promise _ korks type callback)

Listen to a promise reference by event ‘type’.

merge!

(merge! _ obj)(merge! _ obj callback)

Merge object into reference.

conj!

(conj! _ val)(conj! _ val callback)

Conjoin value onto reference.

reset!

(reset! _ val)(reset! _ val callback)

Set a reference value. Accepts reference and promises.

swap!

(swap! _ fn)(swap! _ fn callback)

Swap a reference value. Accepts reference and promises.

disable-listener!

(disable-listener! _ event)(disable-listener! _ event callback)

Disable listener by event (or event and callback).

listen

(listen _ type callback)(listen _ korks type callback)(listen _ korks type callback failure)

Listen to reference by event ‘type’.

get-in

(get-in _ korks)

Get child reference as input type.

-------------------------------------------------------------------------------- /doc/api/index.html: -------------------------------------------------------------------------------- 1 | 2 | firebase-cljs 1.1.0 API documentation

firebase-cljs Api Documentation

Version: 1.1.0

firebase-cljs

Cljs bindings for Firebase API v3.

firebase-cljs.app

Public variables and functions:

firebase-cljs.auth

Public variables and functions:

firebase-cljs.auth.error

Public variables and functions:

firebase-cljs.database.query

Public variables and functions:

firebase-cljs.error

Public variables and functions:

firebase-cljs.storage

Public variables and functions:

firebase-cljs.user

Public variables and functions:

-------------------------------------------------------------------------------- /doc/api/css/default.css: -------------------------------------------------------------------------------- 1 | @import url(http://fonts.googleapis.com/css?family=Droid+Sans+Mono:200,300,400); 2 | @import url(http://fonts.googleapis.com/css?family=Lato:light,regular); 3 | @import url(http://fonts.googleapis.com/css?family=Ubuntu:300,400,500); 4 | 5 | body { 6 | font-family: "Lato", Helvetica, Arial, sans-serif; 7 | font-weight: 300; 8 | color:#585858; 9 | font-size: 100%; 10 | margin: 0px; 11 | } 12 | 13 | pre, code { 14 | font-family: "Droid Sans Mono","DejaVu Sans Mono","Monospace",monospace; 15 | font-weight: 300; 16 | } 17 | 18 | section.container { 19 | display: flex; 20 | font-size: 100%; 21 | } 22 | 23 | h2 { 24 | font-weight: normal; 25 | font-size: 3em; 26 | padding: 10px 0 2px 0; 27 | margin: 0; 28 | } 29 | 30 | header { 31 | color: #333; 32 | padding: 10px; 33 | } 34 | 35 | header small { 36 | font-style: italic; 37 | } 38 | 39 | header h1 { 40 | margin: 0; 41 | padding: 0; 42 | /* font-size: 12pt; */ 43 | font-weight: lighter; 44 | /* text-shadow: -1px -1px 0px #333; */ 45 | } 46 | 47 | header h1 a { 48 | color: #333; 49 | /* font-size: 32px; */ 50 | font-weight: 400; 51 | text-decoration: none; 52 | } 53 | 54 | #content { 55 | overflow: auto; 56 | background: #fff; 57 | color: #333; 58 | padding: 0 18px; 59 | font-size: 1.3em; 60 | } 61 | 62 | #namespaces { 63 | border-right: solid 1px #cccccc; 64 | min-width: 200px; 65 | padding-right: 15px; 66 | } 67 | 68 | #vars { 69 | border-right: solid 1px #cccccc; 70 | width: 200px; 71 | } 72 | 73 | .sidebar { 74 | overflow: auto; 75 | } 76 | 77 | .sidebar a { 78 | color: #333; 79 | display: block; 80 | text-decoration: none; 81 | } 82 | 83 | .sidebar h3 { 84 | margin: 0; 85 | padding: 10px 10px 0 10px; 86 | font-size: 19px; 87 | font-weight: normal; 88 | } 89 | 90 | .sidebar ul { 91 | padding: 0.5em 0em; 92 | margin: 0; 93 | } 94 | 95 | .sidebar li { 96 | display: block; 97 | vertical-align: middle; 98 | } 99 | 100 | .sidebar li a, .sidebar li .no-link { 101 | border-left: 3px solid transparent; 102 | padding: 0 15px; 103 | white-space: nowrap; 104 | } 105 | 106 | .sidebar li .no-link { 107 | display: block; 108 | color: #777; 109 | font-style: italic; 110 | } 111 | 112 | .sidebar li .inner { 113 | display: inline-block; 114 | padding-top: 7px; 115 | height: 24px; 116 | } 117 | 118 | .sidebar li a, .sidebar li .tree { 119 | height: 31px; 120 | /* height: 25px; */ 121 | } 122 | 123 | .depth-1 .inner { padding-left: 2px; } 124 | .depth-2 .inner { padding-left: 6px; } 125 | .depth-3 .inner { padding-left: 20px; } 126 | .depth-4 .inner { padding-left: 34px; } 127 | .depth-5 .inner { padding-left: 48px; } 128 | .depth-6 .inner { padding-left: 62px; } 129 | 130 | .sidebar li .tree { 131 | display: block; 132 | float: left; 133 | position: relative; 134 | top: -10px; 135 | margin: 0 4px 0 0; 136 | padding: 0; 137 | } 138 | 139 | .sidebar li.depth-1 .tree { 140 | display: none; 141 | } 142 | 143 | .sidebar li .tree .top, .sidebar li .tree .bottom { 144 | display: block; 145 | margin: 0; 146 | padding: 0; 147 | width: 7px; 148 | } 149 | 150 | .sidebar li .tree .top { 151 | border-left: 1px solid #aaa; 152 | border-bottom: 1px solid #aaa; 153 | height: 19px; 154 | } 155 | 156 | .sidebar li .tree .bottom { 157 | height: 22px; 158 | } 159 | 160 | .sidebar li.branch .tree .bottom { 161 | border-left: 1px solid #aaa; 162 | } 163 | 164 | #namespaces li.current a { 165 | border-left: 3px solid #a33; 166 | border-left: 3px solid #7a2518; 167 | color: #a33; 168 | color: #7a2518; 169 | 170 | } 171 | 172 | #vars li.current a { 173 | border-left: 3px solid #33a; 174 | color: #33a; 175 | } 176 | 177 | .namespace-docs h2 { 178 | color: #7a2518; 179 | } 180 | 181 | .namespace-docs h3 a { 182 | color: #ba3925; 183 | font-family: "Droid Sans Mono","DejaVu Sans Mono","Monospace",monospace; 184 | font-weight: 400; 185 | text-decoration: none; 186 | } 187 | 188 | .namespace-docs .usage code { 189 | display: block; 190 | color: #777; 191 | margin: 2px 0; 192 | font-size: 0.6em; 193 | } 194 | 195 | /* .usage code:first-child { */ 196 | /* padding-top: 10px; */ 197 | /* } */ 198 | 199 | 200 | 201 | .namespace-index h3 a { 202 | text-decoration: none; 203 | color: #ba3925; 204 | font-family: "Droid Sans Mono","DejaVu Sans Mono","Monospace",monospace; 205 | font-weight: 300; 206 | } 207 | 208 | .public h3 { 209 | margin: 0; 210 | } 211 | 212 | .public { 213 | margin: 0; 214 | border-top: 1px solid #efefef; 215 | padding-top: 14px; 216 | padding-bottom: 6px; 217 | } 218 | 219 | .public:last-child { 220 | margin-bottom: 20%; 221 | } 222 | 223 | .members .public:last-child { 224 | margin-bottom: 0; 225 | } 226 | 227 | .members { 228 | margin: 15px 0; 229 | } 230 | 231 | .members h4 { 232 | color: #555; 233 | font-weight: normal; 234 | font-variant: small-caps; 235 | margin: 0 0 5px 0; 236 | } 237 | 238 | .members .inner { 239 | padding-top: 5px; 240 | padding-left: 12px; 241 | margin-top: 2px; 242 | margin-left: 7px; 243 | border-left: 1px solid #bbb; 244 | } 245 | 246 | #content .members .inner h3 { 247 | /* font-size: 12pt; */ 248 | } 249 | 250 | .members .public { 251 | border-top: none; 252 | margin-top: 0; 253 | padding-top: 6px; 254 | padding-bottom: 0; 255 | } 256 | 257 | .members .public:first-child { 258 | padding-top: 0; 259 | } 260 | 261 | h4.type, 262 | h4.dynamic, 263 | h4.added, 264 | h4.deprecated { 265 | margin: 3px 10px 10spx 0; 266 | font-weight: bold; 267 | font-variant: small-caps; 268 | } 269 | 270 | .public h4.type, 271 | .public h4.dynamic, 272 | .public h4.added, 273 | .public h4.deprecated { 274 | font-weight: bold; 275 | /* margin: 3px 0 0 10px; */ 276 | font-size: 0.7em; 277 | } 278 | 279 | .members h4.type, 280 | .members h4.added, 281 | .members h4.deprecated { 282 | margin-top: 1px; 283 | } 284 | 285 | h4.type { 286 | color: #717171; 287 | } 288 | 289 | h4.dynamic { 290 | color: #9933aa; 291 | } 292 | 293 | h4.added { 294 | color: #508820; 295 | } 296 | 297 | h4.deprecated { 298 | color: #880000; 299 | } 300 | 301 | .namespace { 302 | margin-bottom: 40px; 303 | } 304 | 305 | .namespace:last-child { 306 | margin-bottom: 10%; 307 | } 308 | 309 | .index { 310 | padding: 0; 311 | margin: 15px 0; 312 | } 313 | 314 | .index * { 315 | display: inline; 316 | } 317 | 318 | .index p { 319 | padding-right: 3px; 320 | } 321 | 322 | .index li { 323 | padding-right: 5px; 324 | } 325 | 326 | .index li a { 327 | color: #333; 328 | font-family: "Droid Sans Mono","DejaVu Sans Mono","Monospace",monospace; 329 | font-size: 0.8em; 330 | text-decoration: none; 331 | font-weight: 300; 332 | } 333 | 334 | .index ul { 335 | padding-left: 0; 336 | } 337 | 338 | p { 339 | margin: 15px 0; 340 | } 341 | 342 | .public p:first-child, .public pre.plaintext { 343 | margin-top: 12px; 344 | } 345 | 346 | .doc { 347 | margin: 0 0 26px 0; 348 | clear: both; 349 | } 350 | 351 | .public .doc { 352 | margin: 0; 353 | } 354 | 355 | .namespace-index .doc { 356 | margin-bottom: 20px; 357 | } 358 | 359 | .namespace-index .namespace .doc { 360 | margin-bottom: 10px; 361 | } 362 | 363 | .markdown { 364 | /* line-height: 18px; */ 365 | /* font-size: 16px; */ 366 | } 367 | 368 | .doc, .public, .namespace .index { 369 | max-width: 780px; 370 | overflow-x: visible; 371 | } 372 | 373 | .markdown code, .src-link a { 374 | border-radius: 2px; 375 | font-size: 0.8em; 376 | color: #444; 377 | } 378 | 379 | .markdown pre { 380 | background: #f4f4f4; 381 | border: 1px solid #e0e0e0; 382 | /* border-radius: 2px; */ 383 | padding: 5px 5px; 384 | border-top: 1px solid #e0e0e0; 385 | border-bottom: 1px solid #e0e0e0; 386 | } 387 | 388 | .markdown pre code { 389 | background: transparent; 390 | border: none; 391 | } 392 | 393 | .doc ul, .doc ol { 394 | padding-left: 30px; 395 | } 396 | 397 | .doc table { 398 | border-collapse: collapse; 399 | margin: 0 10px; 400 | } 401 | 402 | .doc table td, .doc table th { 403 | border: 1px solid #dddddd; 404 | padding: 4px 6px; 405 | } 406 | 407 | .doc table th { 408 | background: #f2f2f2; 409 | } 410 | 411 | .doc dl { 412 | margin: 0 10px 20px 10px; 413 | } 414 | 415 | .doc dl dt { 416 | font-weight: bold; 417 | margin: 0; 418 | padding: 3px 0; 419 | border-bottom: 1px solid #ddd; 420 | } 421 | 422 | .doc dl dd { 423 | padding: 5px 0; 424 | margin: 0 0 5px 10px; 425 | } 426 | 427 | .doc abbr { 428 | border-bottom: 1px dotted #333; 429 | font-variant: none 430 | cursor: help; 431 | } 432 | 433 | .src-link { 434 | margin-bottom: 15px; 435 | } 436 | 437 | .src-link a { 438 | /* font-size: 70%; */ 439 | padding: 1px 4px; 440 | text-decoration: none; 441 | color: #5555bb; 442 | } -------------------------------------------------------------------------------- /doc/api/firebase-cljs.auth.html: -------------------------------------------------------------------------------- 1 | 2 | firebase-cljs.auth documentation

firebase-cljs Api Documentation

Version: 1.1.0

firebase-cljs.auth

FirebaseAuth

protocol

members

redirect-result

(redirect-result _)

Returns a UserCredential from the redirect-based sign-in flow. If sign-in succeeded, returns the signed in user. If sign-in was unsuccessful, fails with an error. If no redirect operation was called, returns a UserCredential with a null User.

check-actioncode

(check-actioncode _ code)

Checks a verification code sent to the user by email or other out-of-band mechanism.

auth-changed

(auth-changed _ observer)(auth-changed _ observer failure)(auth-changed _ observer failure complete)

Adds an observer for auth state changes.

login-popup

(login-popup _ provider)

Authenticates a Firebase client using a popup-based OAuth authentication flow.

create-user

(create-user _ email pass)

Creates a new user account associated with the specified email address and password.

current-user

(current-user _)

The currently signed-in user (or null).

providers-by-email

(providers-by-email _ email)

Gets the list of provider IDs that can be used to sign in for the given email address. Useful for an ‘identifier-first’ sign-in flow.

login-token

(login-token _ token)

Asynchronously signs in using a custom token. Custom tokens are used to integrate Firebase Auth with existing auth systems, and must be generated by the auth backend.

logout

(logout _)

Signs out the current user.

login-redirect

(login-redirect _ provider)

Authenticates a Firebase client using a full-page redirect flow.

login-userpass

(login-userpass _ email pass)

Asynchronously signs in using an email and password.

apply-actioncode

(apply-actioncode _ code)

Applies a verification code sent to the user by email or other out-of-band mechanism.

login-cred

(login-cred _ cred)

Asynchronously signs in with the given credentials.

confirm-pass-reset

(confirm-pass-reset _ code pass)

Completes the password reset process, given a confirmation code and new password.

send-pass-reset

(send-pass-reset _ email)

Sends a password reset email to the given email address.

get-app

(get-app _)

The App associated with the Auth service instance.

login-anon

(login-anon _)

Asynchronously signs in as an anonymous user. If there is already an anonymous user signed in, that user will be returned; otherwise, a new anonymous user identity will be created and returned.

verify-pass-reset

(verify-pass-reset _ code)

Checks a password reset code sent to the user by email or other out-of-band mechanism.

-------------------------------------------------------------------------------- /doc/api/firebase-cljs.user.html: -------------------------------------------------------------------------------- 1 | 2 | firebase-cljs.user documentation

firebase-cljs Api Documentation

Version: 1.1.0

firebase-cljs.user

FirebaseUser

protocol

members

get-refreshtoken

(get-refreshtoken _)

A refresh token for the user account. Use only for advanced scenarios that require explicitly refreshing tokens.

get-token

(get-token _)(get-token _ refresh)

Returns a JWT token used to identify the user to a Firebase service.

send-verification

(send-verification _)

Sends a verification email to a user.

remove

(remove _)

Deletes and signs out the user.

reauthenticate

(reauthenticate _ cred)

Re-authenticates a user using a fresh credential.

update-email

(update-email _ email)

Updates the user’s email address.

get-providerdata

(get-providerdata _)

Additional provider-specific information about the user.

update-password

(update-password _ pass)

Updates the user’s password.

update-profile

(update-profile _ profile)

Updates a user’s profile data.

verified?

(verified? _)

True if the user’s email address has been verified.

anonymous?

(anonymous? _)

True if user is anonymous.

reload

(reload _)

Refreshes the current user, if signed in.

FirebaseUserInfo

protocol

members

email

(email _)

The user’s email address (if available).

photo-url

(photo-url _)

The URL of the user’s profile picture (if available).

uid

(uid _)

The user’s unique ID.

name

(name _)

The user’s display name (if available).

providerid

(providerid _)

The authentication provider ID for the current user. For example, ‘facebook.com’, or ‘google.com’.

--------------------------------------------------------------------------------