From 255712663bc1315fc322ccbeb1281e3c63144818 Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Mon, 9 May 2016 16:28:07 -0700 Subject: [PATCH] Removed docs, pointed people at new repo --- Contributing.md | 4 + docs/.meteor/.finished-upgraders | 13 - docs/.meteor/.gitignore | 1 - docs/.meteor/.id | 7 - docs/.meteor/cordova-plugins | 0 docs/.meteor/packages | 28 - docs/.meteor/platforms | 3 - docs/.meteor/release | 1 - docs/.meteor/versions | 76 - docs/canonically_diff_docs.sh | 31 - docs/client/api-box.html | 91 - docs/client/api-box.js | 202 - docs/client/basic/introduction.html | 69 - docs/client/basic/toc.js | 155 - docs/client/common/quick-start.md | 32 - docs/client/data.js | 8591 ----------------- docs/client/docs.less | 759 -- docs/client/full-api/api.md | 31 - docs/client/full-api/api/accounts.md | 477 - docs/client/full-api/api/assets.md | 22 - docs/client/full-api/api/blaze.md | 308 - docs/client/full-api/api/check.md | 154 - docs/client/full-api/api/collections.md | 865 -- docs/client/full-api/api/connections.md | 168 - docs/client/full-api/api/core.md | 53 - docs/client/full-api/api/ejson.md | 90 - docs/client/full-api/api/email.md | 57 - docs/client/full-api/api/http.md | 107 - docs/client/full-api/api/methods.md | 219 - docs/client/full-api/api/mobile-config.md | 60 - docs/client/full-api/api/packagejs.md | 132 - docs/client/full-api/api/passwords.md | 188 - docs/client/full-api/api/pubsub.md | 227 - docs/client/full-api/api/reactive-var.md | 45 - docs/client/full-api/api/session.md | 132 - docs/client/full-api/api/templates.md | 511 - docs/client/full-api/api/timers.md | 25 - docs/client/full-api/api/tracker.md | 311 - docs/client/full-api/commandline.html | 370 - docs/client/full-api/concepts.html | 588 -- docs/client/full-api/docs.html | 37 - docs/client/full-api/docs.js | 73 - docs/client/full-api/introduction.html | 14 - docs/client/full-api/nameToId.js | 183 - docs/client/full-api/packages.html | 40 - docs/client/full-api/packages/accounts-ui.md | 31 - docs/client/full-api/packages/appcache.md | 82 - .../packages/audit-argument-checks.md | 16 - docs/client/full-api/packages/coffeescript.md | 50 - docs/client/full-api/packages/ecmascript.md | 313 - docs/client/full-api/packages/jquery.md | 19 - docs/client/full-api/packages/less.md | 17 - docs/client/full-api/packages/markdown.md | 19 - docs/client/full-api/packages/modules.md | 199 - .../full-api/packages/oauth-encryption.md | 81 - docs/client/full-api/packages/random.md | 39 - docs/client/full-api/packages/spacebars.md | 582 -- docs/client/full-api/packages/underscore.md | 32 - docs/client/full-api/packages/webapp.md | 45 - docs/client/full-api/tableOfContents.html | 42 - docs/client/full-api/tableOfContents.js | 430 - docs/client/full-api/toc.less | 64 - docs/client/helpers.js | 19 - docs/client/layout.html | 72 - docs/client/lib/navigate.js | 3 - docs/client/link-redirect.js | 145 - docs/client/links.js | 155 - docs/client/names.json | 294 - docs/client/responsive.js | 14 - docs/client/search.html | 20 - docs/client/search.js | 195 - docs/client/splash.less | 126 - docs/lib/appcache-config.js | 12 - docs/private/canonicalize.js | 115 - docs/public/favicon.png | Bin 6312 -> 0 bytes docs/public/forkme_right_red_aa0000.png | Bin 7927 -> 0 bytes docs/public/logo.png | Bin 6160 -> 0 bytes docs/public/robots.txt | 2 - 78 files changed, 4 insertions(+), 18779 deletions(-) delete mode 100644 docs/.meteor/.finished-upgraders delete mode 100644 docs/.meteor/.gitignore delete mode 100644 docs/.meteor/.id delete mode 100644 docs/.meteor/cordova-plugins delete mode 100644 docs/.meteor/packages delete mode 100644 docs/.meteor/platforms delete mode 100644 docs/.meteor/release delete mode 100644 docs/.meteor/versions delete mode 100755 docs/canonically_diff_docs.sh delete mode 100644 docs/client/api-box.html delete mode 100644 docs/client/api-box.js delete mode 100644 docs/client/basic/introduction.html delete mode 100644 docs/client/basic/toc.js delete mode 100644 docs/client/common/quick-start.md delete mode 100644 docs/client/data.js delete mode 100644 docs/client/docs.less delete mode 100644 docs/client/full-api/api.md delete mode 100644 docs/client/full-api/api/accounts.md delete mode 100644 docs/client/full-api/api/assets.md delete mode 100644 docs/client/full-api/api/blaze.md delete mode 100644 docs/client/full-api/api/check.md delete mode 100644 docs/client/full-api/api/collections.md delete mode 100644 docs/client/full-api/api/connections.md delete mode 100644 docs/client/full-api/api/core.md delete mode 100644 docs/client/full-api/api/ejson.md delete mode 100644 docs/client/full-api/api/email.md delete mode 100644 docs/client/full-api/api/http.md delete mode 100644 docs/client/full-api/api/methods.md delete mode 100644 docs/client/full-api/api/mobile-config.md delete mode 100644 docs/client/full-api/api/packagejs.md delete mode 100644 docs/client/full-api/api/passwords.md delete mode 100644 docs/client/full-api/api/pubsub.md delete mode 100644 docs/client/full-api/api/reactive-var.md delete mode 100644 docs/client/full-api/api/session.md delete mode 100644 docs/client/full-api/api/templates.md delete mode 100644 docs/client/full-api/api/timers.md delete mode 100644 docs/client/full-api/api/tracker.md delete mode 100644 docs/client/full-api/commandline.html delete mode 100644 docs/client/full-api/concepts.html delete mode 100644 docs/client/full-api/docs.html delete mode 100644 docs/client/full-api/docs.js delete mode 100644 docs/client/full-api/introduction.html delete mode 100644 docs/client/full-api/nameToId.js delete mode 100644 docs/client/full-api/packages.html delete mode 100644 docs/client/full-api/packages/accounts-ui.md delete mode 100644 docs/client/full-api/packages/appcache.md delete mode 100644 docs/client/full-api/packages/audit-argument-checks.md delete mode 100644 docs/client/full-api/packages/coffeescript.md delete mode 100644 docs/client/full-api/packages/ecmascript.md delete mode 100644 docs/client/full-api/packages/jquery.md delete mode 100644 docs/client/full-api/packages/less.md delete mode 100644 docs/client/full-api/packages/markdown.md delete mode 100644 docs/client/full-api/packages/modules.md delete mode 100644 docs/client/full-api/packages/oauth-encryption.md delete mode 100644 docs/client/full-api/packages/random.md delete mode 100644 docs/client/full-api/packages/spacebars.md delete mode 100644 docs/client/full-api/packages/underscore.md delete mode 100644 docs/client/full-api/packages/webapp.md delete mode 100644 docs/client/full-api/tableOfContents.html delete mode 100644 docs/client/full-api/tableOfContents.js delete mode 100644 docs/client/full-api/toc.less delete mode 100644 docs/client/helpers.js delete mode 100644 docs/client/layout.html delete mode 100644 docs/client/lib/navigate.js delete mode 100644 docs/client/link-redirect.js delete mode 100644 docs/client/links.js delete mode 100644 docs/client/names.json delete mode 100644 docs/client/responsive.js delete mode 100644 docs/client/search.html delete mode 100644 docs/client/search.js delete mode 100644 docs/client/splash.less delete mode 100644 docs/lib/appcache-config.js delete mode 100644 docs/private/canonicalize.js delete mode 100644 docs/public/favicon.png delete mode 100644 docs/public/forkme_right_red_aa0000.png delete mode 100644 docs/public/logo.png delete mode 100644 docs/public/robots.txt diff --git a/Contributing.md b/Contributing.md index 18b3a2bd36..72db06d21f 100644 --- a/Contributing.md +++ b/Contributing.md @@ -85,6 +85,10 @@ Finally, you can show your support for features you would like by commenting wit A great way to contribute to Meteor is by helping keep the issues in the repository clean and well organized. This process is called 'issue triage' and the steps are described [here](IssueTriage.md). +## Documentation + +If you'd like to contribution to Meteor's documentation, head over to https://github.com/meteor/docs and create issues or pull requests there. + ## Making changes to Meteor core Eventually you may want to change something in a core Meteor package, or diff --git a/docs/.meteor/.finished-upgraders b/docs/.meteor/.finished-upgraders deleted file mode 100644 index dacc2c0d7a..0000000000 --- a/docs/.meteor/.finished-upgraders +++ /dev/null @@ -1,13 +0,0 @@ -# This file contains information which helps Meteor properly upgrade your -# app when you run 'meteor update'. You should check it into version control -# with your project. - -notices-for-0.9.0 -notices-for-0.9.1 -0.9.4-platform-file -notices-for-facebook-graph-api-2 -1.2.0-standard-minifiers-package -1.2.0-meteor-platform-split -1.2.0-cordova-changes -1.2.0-breaking-changes -1.3.0-split-minifiers-package diff --git a/docs/.meteor/.gitignore b/docs/.meteor/.gitignore deleted file mode 100644 index 4083037423..0000000000 --- a/docs/.meteor/.gitignore +++ /dev/null @@ -1 +0,0 @@ -local diff --git a/docs/.meteor/.id b/docs/.meteor/.id deleted file mode 100644 index 494b5a63db..0000000000 --- a/docs/.meteor/.id +++ /dev/null @@ -1,7 +0,0 @@ -# This file contains a token that is unique to your project. -# Check it into your repository along with the rest of this directory. -# It can be used for purposes such as: -# - ensuring you don't accidentally deploy one app on top of another -# - providing package authors with aggregated statistics - -tqr1dmhdrd0990n71v diff --git a/docs/.meteor/cordova-plugins b/docs/.meteor/cordova-plugins deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/docs/.meteor/packages b/docs/.meteor/packages deleted file mode 100644 index 25cf7584fd..0000000000 --- a/docs/.meteor/packages +++ /dev/null @@ -1,28 +0,0 @@ -# Meteor packages used by this project, one per line. -# -# 'meteor add' and 'meteor remove' will edit this file for you, -# but you can also edit it by hand. - -jquery -underscore -showdown -spiderable -appcache -reload-safetybelt -simple:markdown-templating -simple:highlight.js -less -meteor-base -mobile-experience -mongo -blaze-html-templates -session -tracker -logging -reload -random -ejson -spacebars -check -standard-minifier-css -standard-minifier-js diff --git a/docs/.meteor/platforms b/docs/.meteor/platforms deleted file mode 100644 index cc0f96a84f..0000000000 --- a/docs/.meteor/platforms +++ /dev/null @@ -1,3 +0,0 @@ -server -browser -ios diff --git a/docs/.meteor/release b/docs/.meteor/release deleted file mode 100644 index 4fd7a9346d..0000000000 --- a/docs/.meteor/release +++ /dev/null @@ -1 +0,0 @@ -METEOR@1.3 diff --git a/docs/.meteor/versions b/docs/.meteor/versions deleted file mode 100644 index 0bd32f6b6a..0000000000 --- a/docs/.meteor/versions +++ /dev/null @@ -1,76 +0,0 @@ -allow-deny@1.0.2 -appcache@1.0.8 -autoupdate@1.2.6 -babel-compiler@6.5.2 -babel-runtime@0.1.6 -base64@1.0.6 -binary-heap@1.0.6 -blaze@2.1.5 -blaze-html-templates@1.0.2 -blaze-tools@1.0.6 -boilerplate-generator@1.0.6 -caching-compiler@1.0.2 -caching-html-compiler@1.0.4 -callback-hook@1.0.6 -check@1.1.2 -ddp@1.2.3 -ddp-client@1.2.3 -ddp-common@1.2.3 -ddp-server@1.2.4 -deps@1.0.10 -diff-sequence@1.0.3 -ecmascript@0.4.1 -ecmascript-runtime@0.2.8 -ejson@1.0.9 -fastclick@1.0.9 -geojson-utils@1.0.6 -hot-code-push@1.0.2 -html-tools@1.0.7 -htmljs@1.0.7 -http@1.1.3 -id-map@1.0.5 -jquery@1.11.6 -launch-screen@1.0.8 -less@2.5.6 -livedata@1.0.16 -logging@1.0.10 -markdown@1.0.7 -meteor@1.1.12 -meteor-base@1.0.2 -minifier-css@1.1.9 -minifier-js@1.1.9 -minimongo@1.0.12 -mobile-experience@1.0.2 -mobile-status-bar@1.0.10 -modules@0.5.1 -modules-runtime@0.6.1 -mongo@1.1.5 -mongo-id@1.0.2 -npm-mongo@1.4.41 -observe-sequence@1.0.9 -ordered-dict@1.0.5 -promise@0.6.5 -random@1.0.7 -reactive-dict@1.1.5 -reactive-var@1.0.7 -reload@1.1.6 -reload-safetybelt@1.0.7 -retry@1.0.5 -routepolicy@1.0.8 -session@1.1.3 -showdown@1.0.6 -simple:highlight.js@1.2.0 -simple:markdown-templating@1.2.7 -spacebars@1.0.9 -spacebars-compiler@1.0.9 -spiderable@1.0.11 -standard-minifier-css@1.0.4 -standard-minifier-js@1.0.4 -templating@1.1.7 -templating-tools@1.0.2 -tracker@1.0.11 -ui@1.0.9 -underscore@1.0.6 -url@1.0.7 -webapp@1.2.6 -webapp-hashing@1.0.7 diff --git a/docs/canonically_diff_docs.sh b/docs/canonically_diff_docs.sh deleted file mode 100755 index 6c514184ad..0000000000 --- a/docs/canonically_diff_docs.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -echo "Please run this script from the docs app folder." -echo "Make sure you have phantomjs installed!" - -DOCS_FOLDER=$(pwd); -METEOR_FOLDER=$(dirname ${DOCS_FOLDER}); - -# make temporary folder -mkdir /tmp/docsdiff -cd /tmp/docsdiff - -# trigger phantomjs to give us actual HTML -curl "localhost:3000/?_escaped_fragment_=key1=value1" > new -curl "docs.meteor.com/?_escaped_fragment_=key1=value1" > old - -# use our handy canonicalize script copy-pasted from the test-helpers package -# maybe there is a way to use the actual package? -${METEOR_FOLDER}/scripts/node.sh "${DOCS_FOLDER}/private/canonicalize.js" new > new1 -${METEOR_FOLDER}/scripts/node.sh "${DOCS_FOLDER}/private/canonicalize.js" old > old1 - -# remove some of the things we want to ignore, you might want to change these -cat new1 | sed "s/new-api-box//g" | sed "s/ class=\"api-title\"//g" > new2 -cat new2 | sed "s/

<\/p>//g" > new3 -cat new3 | sed "s/i>/em>/g" > new4 - -cat old1 | sed "s/new-api-box//g" | sed "s/ class=\"api-title\"//g" > old2 -cat old2 | sed "s/

<\/p>//g" > old3 -cat old3 | sed "s/i>/em>/g" > old4 - -# git diff is more colorful than regular diff -/usr/bin/git diff -U10 --no-index --ignore-blank-lines -w old4 new4 \ No newline at end of file diff --git a/docs/client/api-box.html b/docs/client/api-box.html deleted file mode 100644 index 1fa1590ecf..0000000000 --- a/docs/client/api-box.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - diff --git a/docs/client/api-box.js b/docs/client/api-box.js deleted file mode 100644 index fab01c075e..0000000000 --- a/docs/client/api-box.js +++ /dev/null @@ -1,202 +0,0 @@ -var apiData = function (options) { - options = options || {}; - if (typeof options === "string") { - options = {name: options}; - } - - var root = DocsData[options.name]; - - if (! root) { - console.log("API Data not found: " + options.name); - } - - if (_.has(options, 'options')) { - root = _.clone(root); - var includedOptions = options.options.split(';'); - root.options = _.filter(root.options, function (option) { - return _.contains(includedOptions, option.name); - }); - } - - return root; -}; - -var typeLink = function (displayName, url) { - return "" + displayName + ""; -}; - -var toOrSentence = function (array) { - if (array.length === 1) { - return array[0]; - } else if (array.length === 2) { - return array.join(" or "); - } - - return _.initial(array).join(", ") + ", or " + _.last(array); -}; - -var typeNameTranslation = { - "function": "Function", - EJSON: typeLink("EJSON-able Object", "#ejson"), - EJSONable: typeLink("EJSON-able Object", "#ejson"), - "Tracker.Computation": typeLink("Tracker.Computation", "#tracker_computation"), - MongoSelector: [ - typeLink("Mongo Selector", "#selectors"), - typeLink("Object ID", "#mongo_object_id"), - "String" - ], - MongoModifier: typeLink("Mongo Modifier", "#modifiers"), - MongoSortSpecifier: typeLink("Mongo Sort Specifier", "#sortspecifiers"), - MongoFieldSpecifier: typeLink("Mongo Field Specifier", "#fieldspecifiers"), - JSONCompatible: "JSON-compatible Object", - EventMap: typeLink("Event Map", "#eventmaps"), - DOMNode: typeLink("DOM Node", "https://developer.mozilla.org/en-US/docs/Web/API/Node"), - "Blaze.View": typeLink("Blaze.View", "#blaze_view"), - Template: typeLink("Blaze.Template", "#blaze_template"), - DOMElement: typeLink("DOM Element", "https://developer.mozilla.org/en-US/docs/Web/API/element"), - MatchPattern: typeLink("Match Pattern", "#matchpatterns"), - "DDP.Connection": typeLink("DDP Connection", "#ddp_connect") -}; - -Template.autoApiBox.helpers({ - apiData: apiData, - typeNames: function typeNames (nameList) { - // change names if necessary - nameList = _.map(nameList, function (name) { - // decode the "Array." syntax - if (name.slice(0, 7) === "Array.<") { - // get the part inside angle brackets like in Array - name = name.match(/<([^>]+)>/)[1]; - - if (name && typeNameTranslation.hasOwnProperty(name)) { - return "Array of " + typeNameTranslation[name] + "s"; - } - - if (name) { - return "Array of " + name + "s"; - } - - console.log("no array type defined"); - return "Array"; - } - - if (typeNameTranslation.hasOwnProperty(name)) { - return typeNameTranslation[name]; - } - - if (DocsData[name]) { - return typeNames(DocsData[name].type); - } - - return name; - }); - - nameList = _.flatten(nameList); - - return toOrSentence(nameList); - }, - signature: function () { - var signature; - var escapedLongname = _.escape(this.longname); - - if (this.istemplate || this.ishelper) { - if (this.istemplate) { - signature = "{{> "; - } else { - signature = "{{ "; - } - - signature += escapedLongname; - - var params = this.params; - - var paramNames = _.map(params, function (param) { - var name = param.name; - - name = name + "=" + name; - - if (param.optional) { - return "[" + name + "]"; - } - - return name; - }); - - signature += " " + paramNames.join(" "); - - signature += " }}"; - } else { - var beforeParens; - if (this.scope === "instance") { - beforeParens = "" + apiData(this.memberof).instancename + "." + this.name; - } else if (this.kind === "class") { - beforeParens = "new " + escapedLongname; - } else { - beforeParens = escapedLongname; - } - - signature = beforeParens; - - // if it is a function, and therefore has arguments - if (_.contains(["function", "class"], this.kind)) { - var params = this.params; - - var paramNames = _.map(params, function (param) { - if (param.optional) { - return "[" + param.name + "]"; - } - - return param.name; - }); - - signature += "(" + paramNames.join(", ") + ")"; - } - } - - return signature; - }, - importName: function () { - const noImportNeeded = !this.module - || this.scope === 'instance' - || this.ishelper - || this.istemplate; - - // override the above we've explicitly decided to (i.e. Template.foo.X) - if (!noImportNeeded || this.importfrompackage) { - if (this.memberof) { - return this.memberof.split('.')[0]; - } else { - return this.name; - } - } - }, - id: function () { - if (Session.get("fullApi") && nameToId[this.longname]) { - return nameToId[this.longname]; - } - - // fallback - return this.longname.replace(/[.#]/g, "-"); - }, - paramsNoOptions: function () { - return _.reject(this.params, function (param) { - return param.name === "options"; - }); - }, - fullApi: function () { - return Session.get("fullApi"); - } -}); - -Template.apiBoxTitle.helpers({ - link: function () { - return '#/' + (Session.get("fullApi") ? 'full' : 'basic') + '/' + this.id; - } -}); - -Template.autoApiBox.onRendered(function () { - this.$('pre code').each(function(i, block) { - hljs.highlightBlock(block); - }); -}); - diff --git a/docs/client/basic/introduction.html b/docs/client/basic/introduction.html deleted file mode 100644 index 73b86d8887..0000000000 --- a/docs/client/basic/introduction.html +++ /dev/null @@ -1,69 +0,0 @@ - diff --git a/docs/client/basic/toc.js b/docs/client/basic/toc.js deleted file mode 100644 index a119048b09..0000000000 --- a/docs/client/basic/toc.js +++ /dev/null @@ -1,155 +0,0 @@ -var section = function (title, options) { - return _.extend({}, { - type: "section", - title: title, - }, options); -}; - -var item = function (name, options) { - if (! options) { - options = { - longname: name - }; - } - - return _.extend({}, { - type: "item", - name: name - }, options); -}; - -var sections = [ - section("", { - subsections: [ - section("Quick Start", { - id: "quickstart" - }), - section("Learning Resources", { - id: "learning-resources" - }), - section("Command Line Tool", { - id: "command-line" - }), - section("File Structure", { - id: "filestructure" - }), - section("Building Mobile Apps", { - id: "buildingmobileapps" - }) - ] - }), - section("Templates", { - id: "templates", - subtitle: "Create views that update automatically when data changes", - items: [ - item("Defining templates in HTML", {id: "defining-templates"}), - item("Template.name.helpers", {longname: "Template#helpers"}), - item("Template.name.events", {longname: "Template#events"}), - item("Template.name.onRendered", {longname: "Template#onRendered"}), - item("template.findAll", {longname: "Blaze.TemplateInstance#findAll"}), - item("template.find", {longname: "Blaze.TemplateInstance#find"}) - ] - }), - section("Session", { - id: "session", - subtitle: "Store temporary data for the user interface", - items: [ - item("Session.set"), - item("Session.get") - ] - }), - section("Tracker", { - id: "tracker", - subtitle: "Re-run functions when data changes", - items: [ - item("Tracker.autorun") - ] - }), - section("Collections", { - id: "collections", - subtitle: "Store persistent data", - items: [ - item("Mongo.Collection"), - item("collection.findOne", {longname: "Mongo.Collection#findOne"}), - item("collection.find", {longname: "Mongo.Collection#find"}), - item("collection.insert", {longname: "Mongo.Collection#insert"}), - item("collection.update", {longname: "Mongo.Collection#update"}), - item("collection.remove", {longname: "Mongo.Collection#remove"}), - item("collection.allow", {longname: "Mongo.Collection#allow"}), - item("collection.deny", {longname: "Mongo.Collection#deny"}), - ] - }), - section("Accounts", { - id: "accounts", - subtitle: "Let users log in with passwords, Facebook, Google, GitHub, etc.", - items: [ - item("{{> loginButtons}}", {id: "loginButtons"}), - item("Meteor.user"), - item("Meteor.userId"), - item("Meteor.users"), - item("{{currentUser}}", {longname: "currentUser"}) - ] - }), - section("Methods", { - id: "methods", - subtitle: "Call server functions from the client", - items: [ - item("Meteor.methods"), - item("Meteor.call"), - item("Meteor.Error") - ] - }), - section("Publish / Subscribe", { - id: "pubsub", - subtitle: "Sync part of your data to the client", - items: [ - item("Meteor.publish"), - item("Meteor.subscribe") - ] - }), - section("Environment", { - id: "environment", - subtitle: "Control when and where your code runs", - items: [ - item("Meteor.isClient"), - item("Meteor.isServer"), - item("Meteor.startup") - ] - }), - section("Packages", { - id: "packages", - subtitle: "Choose from thousands of community packages", - items: [ - item("Searching for packages", {id: "searchingforpackages"}), - item("accounts-ui", {id: "accountsui"}), - item("coffeescript"), - item("email"), - item("jade"), - item("jquery"), - item("http"), - item("less"), - item("markdown"), - item("underscore"), - item("spiderable") - ] - }) -]; - -var linkPrefix = "#/basic/"; -var linkFromIdLongname = function (id, longname) { - if (id) { - return linkPrefix + id; - } else if (longname) { - return linkPrefix + longname.replace(/[#.]/g, "-"); - } -}; -Template.basicTableOfContents.helpers({ - sections: sections, - linkForItem: function () { - return linkFromIdLongname(this.id, this.longname); - }, - maybeCurrent: function () { - return Session.get('urlHash') === linkFromIdLongname(this.id, this.longname) - ? 'current' : ''; - } -}); diff --git a/docs/client/common/quick-start.md b/docs/client/common/quick-start.md deleted file mode 100644 index 7fe8e06a6c..0000000000 --- a/docs/client/common/quick-start.md +++ /dev/null @@ -1,32 +0,0 @@ -{{#template name="quickStart"}} -## Quick start! - -Meteor supports [OS X, Windows, and Linux](https://github.com/meteor/meteor/wiki/Supported-Platforms). - -On Windows? [Download the official Meteor installer here](https://install.meteor.com/windows). - -On OS X or Linux? Install the latest official Meteor release from your terminal: - -```bash -$ curl https://install.meteor.com/ | sh -``` - -The Windows installer supports Windows 7, Windows 8.1, Windows Server -2008, and Windows Server 2012. The command line installer supports Mac OS X -10.7 (Lion) and above, and Linux on x86 and x86_64 architectures. - -Once you've installed Meteor, create a project: - -```bash -meteor create myapp -``` - -Run it locally: - -```bash -cd myapp -meteor -# Meteor server running on: http://localhost:3000/ -``` - -{{/template}} diff --git a/docs/client/data.js b/docs/client/data.js deleted file mode 100644 index ab7f4f5f1c..0000000000 --- a/docs/client/data.js +++ /dev/null @@ -1,8591 +0,0 @@ -// This file is automatically generated by JSDoc; regenerate it with scripts/admin/jsdoc/jsdoc.sh -DocsData = { - "Accounts": { - "filepath": "accounts-base/server_main.js", - "kind": "namespace", - "lineno": 5, - "longname": "Accounts", - "module": "accounts-base", - "name": "Accounts", - "scope": "global", - "summary": "The namespace for all server-side accounts-related methods." - }, - "Accounts.addEmail": { - "filepath": "accounts-password/password_server.js", - "importfrompackage": "accounts-base", - "kind": "function", - "lineno": 864, - "locus": "Server", - "longname": "Accounts.addEmail", - "memberof": "Accounts", - "module": "accounts-base", - "name": "addEmail", - "options": [], - "params": [ - { - "description": "

The ID of the user to update.

", - "name": "userId", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

A new email address for the user.

", - "name": "newEmail", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional - whether the new email address should\nbe marked as verified. Defaults to false.

", - "name": "verified", - "optional": true, - "type": { - "names": [ - "Boolean" - ] - } - } - ], - "scope": "static", - "summary": "Add an email address for a user. Use this instead of directly\nupdating the database. The operation will fail if there is a different user\nwith an email only differing in case. If the specified user has an existing\nemail only differing in case however, we replace it." - }, - "Accounts.changePassword": { - "filepath": "accounts-password/password_client.js", - "importfrompackage": "accounts-base", - "kind": "function", - "lineno": 151, - "locus": "Client", - "longname": "Accounts.changePassword", - "memberof": "Accounts", - "module": "accounts-base", - "name": "changePassword", - "options": [], - "params": [ - { - "description": "

The user's current password. This is not sent in plain text over the wire.

", - "name": "oldPassword", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

A new password for the user. This is not sent in plain text over the wire.

", - "name": "newPassword", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional callback. Called with no arguments on success, or with a single Error argument on failure.

", - "name": "callback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Change the current user's password. Must be logged in." - }, - "Accounts.createUser": { - "filepath": "accounts-password/password_client.js", - "importfrompackage": "accounts-base", - "kind": "function", - "lineno": 115, - "locus": "Anywhere", - "longname": "Accounts.createUser", - "memberof": "Accounts", - "module": "accounts-base", - "name": "createUser", - "options": [ - { - "description": "

A unique name for this user.

", - "name": "username", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The user's email address.

", - "name": "email", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The user's password. This is not sent in plain text over the wire.

", - "name": "password", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The user's profile, typically including the name field.

", - "name": "profile", - "type": { - "names": [ - "Object" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Client only, optional callback. Called with no arguments on success, or with a single Error argument on failure.

", - "name": "callback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Create a new user." - }, - "Accounts.emailTemplates": { - "filepath": "accounts-password/email_templates.js", - "importfrompackage": "accounts-base", - "kind": "member", - "lineno": 21, - "locus": "Server", - "longname": "Accounts.emailTemplates", - "memberof": "Accounts", - "module": "accounts-base", - "name": "emailTemplates", - "scope": "static", - "summary": "Options to customize emails sent from the Accounts system." - }, - "Accounts.findUserByEmail": { - "filepath": "accounts-password/password_server.js", - "importfrompackage": "accounts-base", - "kind": "function", - "lineno": 140, - "locus": "Server", - "longname": "Accounts.findUserByEmail", - "memberof": "Accounts", - "module": "accounts-base", - "name": "findUserByEmail", - "options": [], - "params": [ - { - "description": "

The email address to look for

", - "name": "email", - "type": { - "names": [ - "String" - ] - } - } - ], - "returns": [ - { - "description": "

A user if found, else null

", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Finds the user with the specified email.\nFirst tries to match email case sensitively; if that fails, it\ntries case insensitively; but if more than one user matches the case\ninsensitive search, it returns null." - }, - "Accounts.findUserByUsername": { - "filepath": "accounts-password/password_server.js", - "importfrompackage": "accounts-base", - "kind": "function", - "lineno": 124, - "locus": "Server", - "longname": "Accounts.findUserByUsername", - "memberof": "Accounts", - "module": "accounts-base", - "name": "findUserByUsername", - "options": [], - "params": [ - { - "description": "

The username to look for

", - "name": "username", - "type": { - "names": [ - "String" - ] - } - } - ], - "returns": [ - { - "description": "

A user if found, else null

", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Finds the user with the specified username.\nFirst tries to match username case sensitively; if that fails, it\ntries case insensitively; but if more than one user matches the case\ninsensitive search, it returns null." - }, - "Accounts.forgotPassword": { - "filepath": "accounts-password/password_client.js", - "importfrompackage": "accounts-base", - "kind": "function", - "lineno": 214, - "locus": "Client", - "longname": "Accounts.forgotPassword", - "memberof": "Accounts", - "module": "accounts-base", - "name": "forgotPassword", - "options": [ - { - "description": "

The email address to send a password reset link.

", - "name": "email", - "type": { - "names": [ - "String" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Optional callback. Called with no arguments on success, or with a single Error argument on failure.

", - "name": "callback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Request a forgot password email." - }, - "Accounts.onEmailVerificationLink": { - "filepath": "accounts-base/url_client.js", - "forceMemberof": true, - "kind": "member", - "lineno": 117, - "locus": "Client", - "longname": "Accounts.onEmailVerificationLink", - "memberof": "Accounts", - "module": "accounts-base", - "name": ".onEmailVerificationLink", - "params": [ - { - "description": "

The function to call. It is given two arguments:

\n
    \n
  1. token: An email verification token that can be passed to\nAccounts.verifyEmail.
  2. \n
  3. done: A function to call when the email verification UI flow is complete.\nThe normal login process is suspended until this function is called, so\nthat the user can be notified that they are verifying their email before\nbeing logged in.
  4. \n
", - "name": "callback", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Register a function to call when an email verification link is\nclicked in an email sent by\n[`Accounts.sendVerificationEmail`](#accounts_sendverificationemail).\nThis function should be called in top-level code, not inside\n`Meteor.startup()`." - }, - "Accounts.onEnrollmentLink": { - "filepath": "accounts-base/url_client.js", - "forceMemberof": true, - "kind": "member", - "lineno": 144, - "locus": "Client", - "longname": "Accounts.onEnrollmentLink", - "memberof": "Accounts", - "module": "accounts-base", - "name": ".onEnrollmentLink", - "params": [ - { - "description": "

The function to call. It is given two arguments:

\n
    \n
  1. token: A password reset token that can be passed to\nAccounts.resetPassword to give the newly\nenrolled account a password.
  2. \n
  3. done: A function to call when the enrollment UI flow is complete.\nThe normal login process is suspended until this function is called, so that\nuser A can be enrolled even if user B was logged in.
  4. \n
", - "name": "callback", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Register a function to call when an account enrollment link is\nclicked in an email sent by\n[`Accounts.sendEnrollmentEmail`](#accounts_sendenrollmentemail).\nThis function should be called in top-level code, not inside\n`Meteor.startup()`." - }, - "Accounts.onResetPasswordLink": { - "filepath": "accounts-base/url_client.js", - "forceMemberof": true, - "kind": "member", - "lineno": 91, - "locus": "Client", - "longname": "Accounts.onResetPasswordLink", - "memberof": "Accounts", - "module": "accounts-base", - "name": ".onResetPasswordLink", - "params": [ - { - "description": "

The function to call. It is given two arguments:

\n
    \n
  1. token: A password reset token that can be passed to\nAccounts.resetPassword.
  2. \n
  3. done: A function to call when the password reset UI flow is complete. The normal\nlogin process is suspended until this function is called, so that the\npassword for user A can be reset even if user B was logged in.
  4. \n
", - "name": "callback", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Register a function to call when a reset password link is clicked\nin an email sent by\n[`Accounts.sendResetPasswordEmail`](#accounts_sendresetpasswordemail).\nThis function should be called in top-level code, not inside\n`Meteor.startup()`." - }, - "Accounts.removeEmail": { - "filepath": "accounts-password/password_server.js", - "importfrompackage": "accounts-base", - "kind": "function", - "lineno": 948, - "locus": "Server", - "longname": "Accounts.removeEmail", - "memberof": "Accounts", - "module": "accounts-base", - "name": "removeEmail", - "options": [], - "params": [ - { - "description": "

The ID of the user to update.

", - "name": "userId", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The email address to remove.

", - "name": "email", - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "static", - "summary": "Remove an email address for a user. Use this instead of updating\nthe database directly." - }, - "Accounts.resetPassword": { - "filepath": "accounts-password/password_client.js", - "importfrompackage": "accounts-base", - "kind": "function", - "lineno": 235, - "locus": "Client", - "longname": "Accounts.resetPassword", - "memberof": "Accounts", - "module": "accounts-base", - "name": "resetPassword", - "options": [], - "params": [ - { - "description": "

The token retrieved from the reset password URL.

", - "name": "token", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

A new password for the user. This is not sent in plain text over the wire.

", - "name": "newPassword", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional callback. Called with no arguments on success, or with a single Error argument on failure.

", - "name": "callback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Reset the password for a user using a token received in email. Logs the user in afterwards." - }, - "Accounts.sendEnrollmentEmail": { - "filepath": "accounts-password/password_server.js", - "importfrompackage": "accounts-base", - "kind": "function", - "lineno": 595, - "locus": "Server", - "longname": "Accounts.sendEnrollmentEmail", - "memberof": "Accounts", - "module": "accounts-base", - "name": "sendEnrollmentEmail", - "options": [], - "params": [ - { - "description": "

The id of the user to send email to.

", - "name": "userId", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional. Which address of the user's to send the email to. This address must be in the user's emails list. Defaults to the first email in the list.

", - "name": "email", - "optional": true, - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "static", - "summary": "Send an email with a link the user can use to set their initial password." - }, - "Accounts.sendResetPasswordEmail": { - "filepath": "accounts-password/password_server.js", - "importfrompackage": "accounts-base", - "kind": "function", - "lineno": 529, - "locus": "Server", - "longname": "Accounts.sendResetPasswordEmail", - "memberof": "Accounts", - "module": "accounts-base", - "name": "sendResetPasswordEmail", - "options": [], - "params": [ - { - "description": "

The id of the user to send email to.

", - "name": "userId", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional. Which address of the user's to send the email to. This address must be in the user's emails list. Defaults to the first email in the list.

", - "name": "email", - "optional": true, - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "static", - "summary": "Send an email with a link the user can use to reset their password." - }, - "Accounts.sendVerificationEmail": { - "filepath": "accounts-password/password_server.js", - "importfrompackage": "accounts-base", - "kind": "function", - "lineno": 735, - "locus": "Server", - "longname": "Accounts.sendVerificationEmail", - "memberof": "Accounts", - "module": "accounts-base", - "name": "sendVerificationEmail", - "options": [], - "params": [ - { - "description": "

The id of the user to send email to.

", - "name": "userId", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional. Which address of the user's to send the email to. This address must be in the user's emails list. Defaults to the first unverified email in the list.

", - "name": "email", - "optional": true, - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "static", - "summary": "Send an email with a link the user can use verify their email address." - }, - "Accounts.setPassword": { - "filepath": "accounts-password/password_server.js", - "importfrompackage": "accounts-base", - "kind": "function", - "lineno": 475, - "locus": "Server", - "longname": "Accounts.setPassword", - "memberof": "Accounts", - "module": "accounts-base", - "name": "setPassword", - "options": [ - { - "description": "

Logout all current connections with this userId (default: true)

", - "name": "logout", - "type": { - "names": [ - "Object" - ] - } - } - ], - "params": [ - { - "description": "

The id of the user to update.

", - "name": "userId", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

A new password for the user.

", - "name": "newPassword", - "type": { - "names": [ - "String" - ] - } - }, - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Forcibly change the password for a user." - }, - "Accounts.setUsername": { - "filepath": "accounts-password/password_server.js", - "importfrompackage": "accounts-base", - "kind": "function", - "lineno": 375, - "locus": "Server", - "longname": "Accounts.setUsername", - "memberof": "Accounts", - "module": "accounts-base", - "name": "setUsername", - "options": [], - "params": [ - { - "description": "

The ID of the user to update.

", - "name": "userId", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

A new username for the user.

", - "name": "newUsername", - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "static", - "summary": "Change a user's username. Use this instead of updating the\ndatabase directly. The operation will fail if there is an existing user\nwith a username only differing in case." - }, - "Accounts.ui": { - "filepath": "accounts-ui-unstyled/accounts_ui.js", - "importfrompackage": "accounts-base", - "kind": "namespace", - "lineno": 7, - "longname": "Accounts.ui", - "memberof": "Accounts", - "module": "accounts-base", - "name": "ui", - "scope": "static", - "summary": "Accounts UI" - }, - "Accounts.ui.config": { - "filepath": "accounts-ui-unstyled/accounts_ui.js", - "importfrompackage": "accounts-base", - "kind": "function", - "lineno": 27, - "locus": "Client", - "longname": "Accounts.ui.config", - "memberof": "Accounts.ui", - "module": "accounts-base", - "name": "config", - "options": [ - { - "description": "

Which permissions to request from the user for each external service.

", - "name": "requestPermissions", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

To ask the user for permission to act on their behalf when offline, map the relevant external service to true. Currently only supported with Google. See Meteor.loginWithExternalService for more details.

", - "name": "requestOfflineToken", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

If true, forces the user to approve the app's permissions, even if previously approved. Currently only supported with Google.

", - "name": "forceApprovalPrompt", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Which fields to display in the user creation form. One of 'USERNAME_AND_EMAIL', 'USERNAME_AND_OPTIONAL_EMAIL', 'USERNAME_ONLY', or 'EMAIL_ONLY' (default).

", - "name": "passwordSignupFields", - "type": { - "names": [ - "String" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Configure the behavior of [`{{> loginButtons}}`](#accountsui)." - }, - "Accounts.verifyEmail": { - "filepath": "accounts-password/password_client.js", - "importfrompackage": "accounts-base", - "kind": "function", - "lineno": 263, - "locus": "Client", - "longname": "Accounts.verifyEmail", - "memberof": "Accounts", - "module": "accounts-base", - "name": "verifyEmail", - "options": [], - "params": [ - { - "description": "

The token retrieved from the verification URL.

", - "name": "token", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional callback. Called with no arguments on success, or with a single Error argument on failure.

", - "name": "callback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Marks the user's email address as verified. Logs the user in afterwards." - }, - "AccountsClient": { - "augments": [ - "AccountsCommon" - ], - "filepath": "accounts-base/accounts_client.js", - "instancename": "accountsClient", - "kind": "class", - "lineno": 3, - "locus": "Client", - "longname": "AccountsClient", - "module": "accounts-base", - "name": "AccountsClient", - "options": [ - { - "description": "

Optional DDP connection to reuse.

", - "name": "connection", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Optional URL for creating a new DDP connection.

", - "name": "ddpUrl", - "type": { - "names": [ - "String" - ] - } - } - ], - "params": [ - { - "description": "

an object with fields:

", - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "global", - "summary": "Constructor for the `Accounts` object on the client." - }, - "AccountsClient#config": { - "filepath": "accounts-base/accounts_common.js", - "inherited": true, - "inherits": "AccountsCommon#config", - "kind": "function", - "lineno": 92, - "locus": "Anywhere", - "longname": "AccountsClient#config", - "memberof": "AccountsClient", - "module": "accounts-base", - "name": "config", - "options": [ - { - "description": "

New users with an email address will receive an address verification email.

", - "name": "sendVerificationEmail", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

Calls to createUser from the client will be rejected. In addition, if you are using accounts-ui, the "Create account" link will not be available.

", - "name": "forbidClientAccountCreation", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

If set to a string, only allows new users if the domain part of their email address matches the string. If set to a function, only allows new users if the function returns true. The function is passed the full email address of the proposed new user. Works with password-based sign-in and external services that expose email addresses (Google, Facebook, GitHub). All existing users still can log in after enabling this option. Example: Accounts.config({ restrictCreationByEmailDomain: 'school.edu' }).

", - "name": "restrictCreationByEmailDomain", - "type": { - "names": [ - "String", - "function" - ] - } - }, - { - "description": "

The number of days from when a user logs in until their token expires and they are logged out. Defaults to 90. Set to null to disable login expiration.

", - "name": "loginExpirationInDays", - "type": { - "names": [ - "Number" - ] - } - }, - { - "description": "

When using the oauth-encryption package, the 16 byte key using to encrypt sensitive account credentials in the database, encoded in base64. This option may only be specifed on the server. See packages/oauth-encryption/README.md for details.

", - "name": "oauthSecretKey", - "type": { - "names": [ - "String" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Set global accounts options." - }, - "AccountsClient#loggingIn": { - "filepath": "accounts-base/accounts_client.js", - "kind": "function", - "lineno": 56, - "locus": "Client", - "longname": "AccountsClient#loggingIn", - "memberof": "AccountsClient", - "module": "accounts-base", - "name": "loggingIn", - "options": [], - "params": [], - "scope": "instance", - "summary": "True if a login method (such as `Meteor.loginWithPassword`, `Meteor.loginWithFacebook`, or `Accounts.createUser`) is currently in progress. A reactive data source." - }, - "AccountsClient#logout": { - "filepath": "accounts-base/accounts_client.js", - "kind": "function", - "lineno": 66, - "locus": "Client", - "longname": "AccountsClient#logout", - "memberof": "AccountsClient", - "module": "accounts-base", - "name": "logout", - "options": [], - "params": [ - { - "description": "

Optional callback. Called with no arguments on success, or with a single Error argument on failure.

", - "name": "callback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Log the user out." - }, - "AccountsClient#logoutOtherClients": { - "filepath": "accounts-base/accounts_client.js", - "kind": "function", - "lineno": 85, - "locus": "Client", - "longname": "AccountsClient#logoutOtherClients", - "memberof": "AccountsClient", - "module": "accounts-base", - "name": "logoutOtherClients", - "options": [], - "params": [ - { - "description": "

Optional callback. Called with no arguments on success, or with a single Error argument on failure.

", - "name": "callback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Log out other clients logged in as the current user, but does not log out the client that calls this function." - }, - "AccountsClient#onLogin": { - "filepath": "accounts-base/accounts_common.js", - "inherited": true, - "inherits": "AccountsCommon#onLogin", - "kind": "function", - "lineno": 146, - "locus": "Anywhere", - "longname": "AccountsClient#onLogin", - "memberof": "AccountsClient", - "module": "accounts-base", - "name": "onLogin", - "options": [], - "params": [ - { - "description": "

The callback to be called when login is successful.

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Register a callback to be called after a login attempt succeeds." - }, - "AccountsClient#onLoginFailure": { - "filepath": "accounts-base/accounts_common.js", - "inherited": true, - "inherits": "AccountsCommon#onLoginFailure", - "kind": "function", - "lineno": 155, - "locus": "Anywhere", - "longname": "AccountsClient#onLoginFailure", - "memberof": "AccountsClient", - "module": "accounts-base", - "name": "onLoginFailure", - "options": [], - "params": [ - { - "description": "

The callback to be called after the login has failed.

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Register a callback to be called after a login attempt fails." - }, - "AccountsClient#user": { - "filepath": "accounts-base/accounts_common.js", - "inherited": true, - "inherits": "AccountsCommon#user", - "kind": "function", - "lineno": 52, - "locus": "Anywhere but publish functions", - "longname": "AccountsClient#user", - "memberof": "AccountsClient", - "module": "accounts-base", - "name": "user", - "options": [], - "params": [], - "scope": "instance", - "summary": "Get the current user record, or `null` if no user is logged in. A reactive data source." - }, - "AccountsClient#userId": { - "filepath": "accounts-base/accounts_common.js", - "inherited": true, - "inherits": "AccountsCommon#userId", - "kind": "function", - "lineno": 44, - "locus": "Anywhere but publish functions", - "longname": "AccountsClient#userId", - "memberof": "AccountsClient", - "module": "accounts-base", - "name": "userId", - "options": [], - "overrides": "AccountsCommon#userId", - "params": [], - "scope": "instance", - "summary": "Get the current user id, or `null` if no user is logged in. A reactive data source." - }, - "AccountsCommon": { - "filepath": "accounts-base/accounts_common.js", - "instancename": "accountsClientOrServer", - "kind": "class", - "lineno": 1, - "locus": "Anywhere", - "longname": "AccountsCommon", - "module": "accounts-base", - "name": "AccountsCommon", - "options": [], - "params": [ - { - "description": "

an object with fields:

\n", - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "global", - "summary": "Super-constructor for AccountsClient and AccountsServer." - }, - "AccountsCommon#config": { - "filepath": "accounts-base/accounts_common.js", - "kind": "function", - "lineno": 92, - "locus": "Anywhere", - "longname": "AccountsCommon#config", - "memberof": "AccountsCommon", - "module": "accounts-base", - "name": "config", - "options": [ - { - "description": "

New users with an email address will receive an address verification email.

", - "name": "sendVerificationEmail", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

Calls to createUser from the client will be rejected. In addition, if you are using accounts-ui, the "Create account" link will not be available.

", - "name": "forbidClientAccountCreation", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

If set to a string, only allows new users if the domain part of their email address matches the string. If set to a function, only allows new users if the function returns true. The function is passed the full email address of the proposed new user. Works with password-based sign-in and external services that expose email addresses (Google, Facebook, GitHub). All existing users still can log in after enabling this option. Example: Accounts.config({ restrictCreationByEmailDomain: 'school.edu' }).

", - "name": "restrictCreationByEmailDomain", - "type": { - "names": [ - "String", - "function" - ] - } - }, - { - "description": "

The number of days from when a user logs in until their token expires and they are logged out. Defaults to 90. Set to null to disable login expiration.

", - "name": "loginExpirationInDays", - "type": { - "names": [ - "Number" - ] - } - }, - { - "description": "

When using the oauth-encryption package, the 16 byte key using to encrypt sensitive account credentials in the database, encoded in base64. This option may only be specifed on the server. See packages/oauth-encryption/README.md for details.

", - "name": "oauthSecretKey", - "type": { - "names": [ - "String" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Set global accounts options." - }, - "AccountsCommon#onLogin": { - "filepath": "accounts-base/accounts_common.js", - "kind": "function", - "lineno": 146, - "locus": "Anywhere", - "longname": "AccountsCommon#onLogin", - "memberof": "AccountsCommon", - "module": "accounts-base", - "name": "onLogin", - "options": [], - "params": [ - { - "description": "

The callback to be called when login is successful.

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Register a callback to be called after a login attempt succeeds." - }, - "AccountsCommon#onLoginFailure": { - "filepath": "accounts-base/accounts_common.js", - "kind": "function", - "lineno": 155, - "locus": "Anywhere", - "longname": "AccountsCommon#onLoginFailure", - "memberof": "AccountsCommon", - "module": "accounts-base", - "name": "onLoginFailure", - "options": [], - "params": [ - { - "description": "

The callback to be called after the login has failed.

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Register a callback to be called after a login attempt fails." - }, - "AccountsCommon#user": { - "filepath": "accounts-base/accounts_common.js", - "kind": "function", - "lineno": 52, - "locus": "Anywhere but publish functions", - "longname": "AccountsCommon#user", - "memberof": "AccountsCommon", - "module": "accounts-base", - "name": "user", - "options": [], - "params": [], - "scope": "instance", - "summary": "Get the current user record, or `null` if no user is logged in. A reactive data source." - }, - "AccountsCommon#userId": { - "filepath": "accounts-base/accounts_common.js", - "kind": "function", - "lineno": 44, - "locus": "Anywhere but publish functions", - "longname": "AccountsCommon#userId", - "memberof": "AccountsCommon", - "module": "accounts-base", - "name": "userId", - "options": [], - "params": [], - "scope": "instance", - "summary": "Get the current user id, or `null` if no user is logged in. A reactive data source." - }, - "AccountsServer": { - "augments": [ - "AccountsCommon" - ], - "filepath": "accounts-base/accounts_server.js", - "instancename": "accountsServer", - "kind": "class", - "lineno": 5, - "locus": "Server", - "longname": "AccountsServer", - "module": "accounts-base", - "name": "AccountsServer", - "options": [], - "params": [ - { - "description": "

A server object such as Meteor.server.

", - "name": "server", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "global", - "summary": "Constructor for the `Accounts` namespace on the server." - }, - "AccountsServer#config": { - "filepath": "accounts-base/accounts_common.js", - "inherited": true, - "inherits": "AccountsCommon#config", - "kind": "function", - "lineno": 92, - "locus": "Anywhere", - "longname": "AccountsServer#config", - "memberof": "AccountsServer", - "module": "accounts-base", - "name": "config", - "options": [ - { - "description": "

New users with an email address will receive an address verification email.

", - "name": "sendVerificationEmail", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

Calls to createUser from the client will be rejected. In addition, if you are using accounts-ui, the "Create account" link will not be available.

", - "name": "forbidClientAccountCreation", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

If set to a string, only allows new users if the domain part of their email address matches the string. If set to a function, only allows new users if the function returns true. The function is passed the full email address of the proposed new user. Works with password-based sign-in and external services that expose email addresses (Google, Facebook, GitHub). All existing users still can log in after enabling this option. Example: Accounts.config({ restrictCreationByEmailDomain: 'school.edu' }).

", - "name": "restrictCreationByEmailDomain", - "type": { - "names": [ - "String", - "function" - ] - } - }, - { - "description": "

The number of days from when a user logs in until their token expires and they are logged out. Defaults to 90. Set to null to disable login expiration.

", - "name": "loginExpirationInDays", - "type": { - "names": [ - "Number" - ] - } - }, - { - "description": "

When using the oauth-encryption package, the 16 byte key using to encrypt sensitive account credentials in the database, encoded in base64. This option may only be specifed on the server. See packages/oauth-encryption/README.md for details.

", - "name": "oauthSecretKey", - "type": { - "names": [ - "String" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Set global accounts options." - }, - "AccountsServer#onCreateUser": { - "filepath": "accounts-base/accounts_server.js", - "kind": "function", - "lineno": 118, - "locus": "Server", - "longname": "AccountsServer#onCreateUser", - "memberof": "AccountsServer", - "module": "accounts-base", - "name": "onCreateUser", - "options": [], - "params": [ - { - "description": "

Called whenever a new user is created. Return the new user object, or throw an Error to abort the creation.

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Customize new user creation." - }, - "AccountsServer#onLogin": { - "filepath": "accounts-base/accounts_common.js", - "inherited": true, - "inherits": "AccountsCommon#onLogin", - "kind": "function", - "lineno": 146, - "locus": "Anywhere", - "longname": "AccountsServer#onLogin", - "memberof": "AccountsServer", - "module": "accounts-base", - "name": "onLogin", - "options": [], - "params": [ - { - "description": "

The callback to be called when login is successful.

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Register a callback to be called after a login attempt succeeds." - }, - "AccountsServer#onLoginFailure": { - "filepath": "accounts-base/accounts_common.js", - "inherited": true, - "inherits": "AccountsCommon#onLoginFailure", - "kind": "function", - "lineno": 155, - "locus": "Anywhere", - "longname": "AccountsServer#onLoginFailure", - "memberof": "AccountsServer", - "module": "accounts-base", - "name": "onLoginFailure", - "options": [], - "params": [ - { - "description": "

The callback to be called after the login has failed.

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Register a callback to be called after a login attempt fails." - }, - "AccountsServer#user": { - "filepath": "accounts-base/accounts_common.js", - "inherited": true, - "inherits": "AccountsCommon#user", - "kind": "function", - "lineno": 52, - "locus": "Anywhere but publish functions", - "longname": "AccountsServer#user", - "memberof": "AccountsServer", - "module": "accounts-base", - "name": "user", - "options": [], - "params": [], - "scope": "instance", - "summary": "Get the current user record, or `null` if no user is logged in. A reactive data source." - }, - "AccountsServer#userId": { - "filepath": "accounts-base/accounts_common.js", - "inherited": true, - "inherits": "AccountsCommon#userId", - "kind": "function", - "lineno": 44, - "locus": "Anywhere but publish functions", - "longname": "AccountsServer#userId", - "memberof": "AccountsServer", - "module": "accounts-base", - "name": "userId", - "options": [], - "overrides": "AccountsCommon#userId", - "params": [], - "scope": "instance", - "summary": "Get the current user id, or `null` if no user is logged in. A reactive data source." - }, - "AccountsServer#validateLoginAttempt": { - "filepath": "accounts-base/accounts_server.js", - "kind": "function", - "lineno": 95, - "locus": "Server", - "longname": "AccountsServer#validateLoginAttempt", - "memberof": "AccountsServer", - "module": "accounts-base", - "name": "validateLoginAttempt", - "options": [], - "params": [ - { - "description": "

Called whenever a login is attempted (either successful or unsuccessful). A login can be aborted by returning a falsy value or throwing an exception.

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Validate login attempts." - }, - "AccountsServer#validateNewUser": { - "filepath": "accounts-base/accounts_server.js", - "kind": "function", - "lineno": 105, - "locus": "Server", - "longname": "AccountsServer#validateNewUser", - "memberof": "AccountsServer", - "module": "accounts-base", - "name": "validateNewUser", - "options": [], - "params": [ - { - "description": "

Called whenever a new user is created. Takes the new user object, and returns true to allow the creation or false to abort.

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Set restrictions on new user creation." - }, - "App": { - "kind": "namespace", - "longname": "App", - "name": "App", - "scope": "global", - "summary": "The App configuration object in mobile-config.js" - }, - "App.accessRule": { - "kind": "function", - "longname": "App.accessRule", - "memberof": "App", - "name": "accessRule", - "options": [ - { - "description": "

Possible values:

\n", - "name": "type", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

(Deprecated, use type: 'intent' instead.)

", - "name": "launchExternal", - "type": { - "names": [ - "Boolean" - ] - } - } - ], - "params": [ - { - "description": "

The pattern defining affected domains or URLs.

", - "name": "pattern", - "type": { - "names": [ - "String" - ] - } - }, - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Set a new access rule based on origin domain for your app.\nBy default your application has a limited list of servers it can contact.\nUse this method to extend this list.\n\nDefault access rules:\n\n- `tel:*`, `geo:*`, `mailto:*`, `sms:*`, `market:*` are allowed and\n are handled by the system (e.g. opened in the phone app or an email client)\n- `http://localhost:*` is used to serve the app's assets from.\n- The domain or address of the Meteor server to connect to for DDP and\n hot code push of new versions.\n\nRead more about domain patterns in [Cordova\ndocs](http://cordova.apache.org/docs/en/6.0.0/guide_appdev_whitelist_index.md.html).\n\nStarting with Meteor 1.0.4 access rule for all domains and protocols\n(``) is no longer set by default due to\n[certain kind of possible\nattacks](http://cordova.apache.org/announcements/2014/08/04/android-351.html)." - }, - "App.configurePlugin": { - "kind": "function", - "longname": "App.configurePlugin", - "memberof": "App", - "name": "configurePlugin", - "options": [], - "params": [ - { - "description": "

The identifier of the plugin you want to\nconfigure.

", - "name": "id", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

A set of key-value pairs which will be passed\nat build-time to configure the specified plugin.

", - "name": "config", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Set the build-time configuration for a Cordova plugin." - }, - "App.icons": { - "kind": "function", - "longname": "App.icons", - "memberof": "App", - "name": "icons", - "options": [], - "params": [ - { - "description": "

An Object where the keys are different\ndevices and screen sizes, and values are image paths\nrelative to the project root directory.

\n

Valid key values:

\n", - "name": "icons", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Set the icons for your mobile app." - }, - "App.info": { - "kind": "function", - "longname": "App.info", - "memberof": "App", - "name": "info", - "options": [ - { - "description": "

Each of the options correspond to a key in the app's core configuration\nas described in the Cordova documentation.

", - "name": "id, version, name, description, author, email, website", - "optional": true, - "type": { - "names": [ - "String" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Set your mobile app's core configuration information." - }, - "App.launchScreens": { - "kind": "function", - "longname": "App.launchScreens", - "memberof": "App", - "name": "launchScreens", - "options": [], - "params": [ - { - "description": "

A dictionary where keys are different\ndevices, screen sizes, and orientations, and the values are image paths\nrelative to the project root directory.

\n

For Android, launch screen images should\nbe special "Nine-patch" image files that specify how they should be\nstretched. See the Android docs.

\n

Valid key values:

\n", - "name": "launchScreens", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Set the launch screen images for your mobile app." - }, - "App.setPreference": { - "kind": "function", - "longname": "App.setPreference", - "memberof": "App", - "name": "setPreference", - "options": [], - "params": [ - { - "description": "

A preference name supported by Cordova's\nconfig.xml.

", - "name": "name", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The value for that preference.

", - "name": "value", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional. A platform name (either ios or android) to add a platform-specific preference.

", - "name": "platform", - "optional": true, - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "static", - "summary": "Add a preference for your build as described in the\n[Cordova documentation](http://cordova.apache.org/docs/en/5.1.1/config_ref_index.md.html#The%20config.xml%20File_global_preferences)." - }, - "Assets": { - "kind": "namespace", - "longname": "Assets", - "name": "Assets", - "scope": "global", - "summary": "The namespace for Assets functions, lives in the bundler." - }, - "Assets.getBinary": { - "kind": "function", - "locus": "Server", - "longname": "Assets.getBinary", - "memberof": "Assets", - "name": "getBinary", - "options": [], - "params": [ - { - "description": "

The path of the asset, relative to the application's private subdirectory.

", - "name": "assetPath", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional callback, which is called asynchronously with the error or result after the function is complete. If not provided, the function runs synchronously.

", - "name": "asyncCallback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Retrieve the contents of the static server asset as an [EJSON Binary](#ejson_new_binary)." - }, - "Assets.getText": { - "kind": "function", - "locus": "Server", - "longname": "Assets.getText", - "memberof": "Assets", - "name": "getText", - "options": [], - "params": [ - { - "description": "

The path of the asset, relative to the application's private subdirectory.

", - "name": "assetPath", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional callback, which is called asynchronously with the error or result after the function is complete. If not provided, the function runs synchronously.

", - "name": "asyncCallback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Retrieve the contents of the static server asset as a UTF8-encoded string." - }, - "Blaze": { - "filepath": "blaze/preamble.js", - "kind": "namespace", - "lineno": 1, - "longname": "Blaze", - "module": "blaze", - "name": "Blaze", - "scope": "global", - "summary": "The namespace for all Blaze-related methods and classes." - }, - "Blaze.Each": { - "filepath": "blaze/builtins.js", - "kind": "function", - "lineno": 122, - "locus": "Client", - "longname": "Blaze.Each", - "memberof": "Blaze", - "module": "blaze", - "name": "Each", - "options": [], - "params": [ - { - "description": "

A function to reactively re-run. The function can\nreturn one of two options:

\n
    \n
  1. An object with two fields: '_variable' and '_sequence'. Each iterates over\n'_sequence', it may be a Cursor, an array, null, or undefined. Inside the\nEach body you will be able to get the current item from the sequence using\nthe name specified in the '_variable' field.

    \n
  2. \n
  3. Just a sequence (Cursor, array, null, or undefined) not wrapped into an\nobject. Inside the Each body, the current item will be set as the data\ncontext.

    \n
  4. \n
", - "name": "argFunc", - "type": { - "names": [ - "function" - ] - } - }, - { - "description": "

A Function that returns renderable\ncontent.

", - "name": "contentFunc", - "type": { - "names": [ - "function" - ] - } - }, - { - "description": "

A Function that returns renderable\ncontent to display in the case when there are no items\nin the sequence.

", - "name": "elseFunc", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Constructs a View that renders `contentFunc` for each item in a sequence." - }, - "Blaze.If": { - "filepath": "blaze/builtins.js", - "kind": "function", - "lineno": 73, - "locus": "Client", - "longname": "Blaze.If", - "memberof": "Blaze", - "module": "blaze", - "name": "If", - "options": [], - "params": [ - { - "description": "

A function to reactively re-run. Whether the result is truthy or falsy determines whether contentFunc or elseFunc is shown. An empty array is considered falsy.

", - "name": "conditionFunc", - "type": { - "names": [ - "function" - ] - } - }, - { - "description": "

A Function that returns renderable content.

", - "name": "contentFunc", - "type": { - "names": [ - "function" - ] - } - }, - { - "description": "

Optional. A Function that returns renderable content. If no elseFunc is supplied, no content is shown in the "else" case.

", - "name": "elseFunc", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Constructs a View that renders content conditionally." - }, - "Blaze.Let": { - "filepath": "blaze/builtins.js", - "kind": "function", - "lineno": 59, - "longname": "Blaze.Let", - "memberof": "Blaze", - "module": "blaze", - "name": "Let", - "options": [], - "params": [ - { - "description": "

Dictionary mapping names of bindings to\nvalues or computations to reactively re-run.

", - "name": "bindings", - "type": { - "names": [ - "function" - ] - } - }, - { - "description": "

A Function that returns renderable content.

", - "name": "contentFunc", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Constructs a View setting the local lexical scope in the block." - }, - "Blaze.Template": { - "filepath": "blaze/template.js", - "kind": "class", - "lineno": 16, - "locus": "Client", - "longname": "Blaze.Template", - "memberof": "Blaze", - "module": "blaze", - "name": "Template", - "options": [], - "params": [ - { - "description": "

Optional. A name for Views constructed by this Template. See view.name.

", - "name": "viewName", - "optional": true, - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

A function that returns renderable content. This function is used as the renderFunction for Views constructed by this Template.

", - "name": "renderFunction", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Constructor for a Template, which is used to construct Views with particular name and content." - }, - "Blaze.TemplateInstance": { - "filepath": "blaze/template.js", - "instancename": "template", - "kind": "class", - "lineno": 233, - "longname": "Blaze.TemplateInstance", - "memberof": "Blaze", - "module": "blaze", - "name": "TemplateInstance", - "options": [], - "params": [ - { - "name": "view", - "type": { - "names": [ - "Blaze.View" - ] - } - } - ], - "scope": "static", - "summary": "The class for template instances" - }, - "Blaze.TemplateInstance#$": { - "filepath": "blaze/template.js", - "kind": "function", - "lineno": 291, - "locus": "Client", - "longname": "Blaze.TemplateInstance#$", - "memberof": "Blaze.TemplateInstance", - "module": "blaze", - "name": "$", - "options": [], - "params": [ - { - "description": "

The CSS selector to match, scoped to the template contents.

", - "name": "selector", - "type": { - "names": [ - "String" - ] - } - } - ], - "returns": [ - { - "type": { - "names": [ - "Array." - ] - } - } - ], - "scope": "instance", - "summary": "Find all elements matching `selector` in this template instance, and return them as a JQuery object." - }, - "Blaze.TemplateInstance#autorun": { - "filepath": "blaze/template.js", - "kind": "function", - "lineno": 324, - "locus": "Client", - "longname": "Blaze.TemplateInstance#autorun", - "memberof": "Blaze.TemplateInstance", - "module": "blaze", - "name": "autorun", - "options": [], - "params": [ - { - "description": "

The function to run. It receives one argument: a Tracker.Computation object.

", - "name": "runFunc", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "A version of [Tracker.autorun](#tracker_autorun) that is stopped when the template is destroyed." - }, - "Blaze.TemplateInstance#data": { - "filepath": "blaze/template.js", - "kind": "member", - "lineno": 161, - "locus": "Client", - "longname": "Blaze.TemplateInstance#data", - "memberof": "Blaze.TemplateInstance", - "module": "blaze", - "name": "data", - "scope": "instance", - "summary": "The data context of this instance's latest invocation." - }, - "Blaze.TemplateInstance#find": { - "filepath": "blaze/template.js", - "kind": "function", - "lineno": 314, - "locus": "Client", - "longname": "Blaze.TemplateInstance#find", - "memberof": "Blaze.TemplateInstance", - "module": "blaze", - "name": "find", - "options": [], - "params": [ - { - "description": "

The CSS selector to match, scoped to the template contents.

", - "name": "selector", - "type": { - "names": [ - "String" - ] - } - } - ], - "returns": [ - { - "type": { - "names": [ - "DOMElement" - ] - } - } - ], - "scope": "instance", - "summary": "Find one element matching `selector` in this template instance." - }, - "Blaze.TemplateInstance#findAll": { - "filepath": "blaze/template.js", - "kind": "function", - "lineno": 304, - "locus": "Client", - "longname": "Blaze.TemplateInstance#findAll", - "memberof": "Blaze.TemplateInstance", - "module": "blaze", - "name": "findAll", - "options": [], - "params": [ - { - "description": "

The CSS selector to match, scoped to the template contents.

", - "name": "selector", - "type": { - "names": [ - "String" - ] - } - } - ], - "returns": [ - { - "type": { - "names": [ - "Array." - ] - } - } - ], - "scope": "instance", - "summary": "Find all elements matching `selector` in this template instance." - }, - "Blaze.TemplateInstance#firstNode": { - "filepath": "blaze/template.js", - "kind": "member", - "lineno": 254, - "locus": "Client", - "longname": "Blaze.TemplateInstance#firstNode", - "memberof": "Blaze.TemplateInstance", - "module": "blaze", - "name": "firstNode", - "scope": "instance", - "summary": "The first top-level DOM node in this template instance.", - "type": { - "names": [ - "DOMNode" - ] - } - }, - "Blaze.TemplateInstance#lastNode": { - "filepath": "blaze/template.js", - "kind": "member", - "lineno": 264, - "locus": "Client", - "longname": "Blaze.TemplateInstance#lastNode", - "memberof": "Blaze.TemplateInstance", - "module": "blaze", - "name": "lastNode", - "scope": "instance", - "summary": "The last top-level DOM node in this template instance.", - "type": { - "names": [ - "DOMNode" - ] - } - }, - "Blaze.TemplateInstance#subscribe": { - "filepath": "blaze/template.js", - "kind": "function", - "lineno": 347, - "locus": "Client", - "longname": "Blaze.TemplateInstance#subscribe", - "memberof": "Blaze.TemplateInstance", - "module": "blaze", - "name": "subscribe", - "options": [ - { - "description": "

Passed to Meteor.subscribe.

", - "name": "onReady", - "optional": true, - "type": { - "names": [ - "function" - ] - } - }, - { - "description": "

Passed to Meteor.subscribe.

", - "name": "onStop", - "optional": true, - "type": { - "names": [ - "function" - ] - } - }, - { - "description": "

The connection on which to make the\nsubscription.

", - "name": "connection", - "optional": true, - "type": { - "names": [ - "DDP.Connection" - ] - } - } - ], - "params": [ - { - "description": "

Name of the subscription. Matches the name of the\nserver's publish() call.

", - "name": "name", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional arguments passed to publisher function\non server.

", - "name": "arg1, arg2...", - "optional": true, - "type": { - "names": [ - "Any" - ] - } - }, - { - "description": "

If a function is passed instead of an\nobject, it is interpreted as an onReady callback.

", - "name": "options", - "optional": true, - "type": { - "names": [ - "function", - "Object" - ] - } - } - ], - "returns": [ - { - "description": "

The subscription handle to the newly made\nsubscription. Call handle.stop() to manually stop the subscription, or\nhandle.ready() to find out if this particular subscription has loaded all\nof its inital data.

", - "type": { - "names": [ - "SubscriptionHandle" - ] - } - } - ], - "scope": "instance", - "summary": "A version of [Meteor.subscribe](#meteor_subscribe) that is stopped\nwhen the template is destroyed." - }, - "Blaze.TemplateInstance#subscriptionsReady": { - "filepath": "blaze/template.js", - "kind": "function", - "lineno": 427, - "longname": "Blaze.TemplateInstance#subscriptionsReady", - "memberof": "Blaze.TemplateInstance", - "module": "blaze", - "name": "subscriptionsReady", - "options": [], - "params": [], - "returns": [ - { - "description": "

True if all subscriptions on this template instance are\nready.

", - "type": { - "names": [ - "Boolean" - ] - } - } - ], - "scope": "instance", - "summary": "A reactive function that returns true when all of the subscriptions\ncalled with [this.subscribe](#TemplateInstance-subscribe) are ready." - }, - "Blaze.TemplateInstance#view": { - "filepath": "blaze/template.js", - "kind": "member", - "lineno": 243, - "locus": "Client", - "longname": "Blaze.TemplateInstance#view", - "memberof": "Blaze.TemplateInstance", - "module": "blaze", - "name": "view", - "scope": "instance", - "summary": "The [View](#blaze_view) object for this invocation of the template.", - "type": { - "names": [ - "Blaze.View" - ] - } - }, - "Blaze.Unless": { - "filepath": "blaze/builtins.js", - "kind": "function", - "lineno": 98, - "locus": "Client", - "longname": "Blaze.Unless", - "memberof": "Blaze", - "module": "blaze", - "name": "Unless", - "options": [], - "params": [ - { - "description": "

A function to reactively re-run. If the result is falsy, contentFunc is shown, otherwise elseFunc is shown. An empty array is considered falsy.

", - "name": "conditionFunc", - "type": { - "names": [ - "function" - ] - } - }, - { - "description": "

A Function that returns renderable content.

", - "name": "contentFunc", - "type": { - "names": [ - "function" - ] - } - }, - { - "description": "

Optional. A Function that returns renderable content. If no elseFunc is supplied, no content is shown in the "else" case.

", - "name": "elseFunc", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "An inverted [`Blaze.If`](#blaze_if)." - }, - "Blaze.View": { - "filepath": "blaze/view.js", - "kind": "class", - "lineno": 43, - "locus": "Client", - "longname": "Blaze.View", - "memberof": "Blaze", - "module": "blaze", - "name": "View", - "options": [], - "params": [ - { - "description": "

Optional. A name for this type of View. See view.name.

", - "name": "name", - "optional": true, - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

A function that returns renderable content. In this function, this is bound to the View.

", - "name": "renderFunction", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Constructor for a View, which represents a reactive region of DOM." - }, - "Blaze.With": { - "filepath": "blaze/builtins.js", - "kind": "function", - "lineno": 13, - "locus": "Client", - "longname": "Blaze.With", - "memberof": "Blaze", - "module": "blaze", - "name": "With", - "options": [], - "params": [ - { - "description": "

An object to use as the data context, or a function returning such an object. If a function is provided, it will be reactively re-run.

", - "name": "data", - "type": { - "names": [ - "Object", - "function" - ] - } - }, - { - "description": "

A Function that returns renderable content.

", - "name": "contentFunc", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Constructs a View that renders content with a data context." - }, - "Blaze.currentView": { - "filepath": "blaze/view.js", - "kind": "member", - "lineno": 532, - "locus": "Client", - "longname": "Blaze.currentView", - "memberof": "Blaze", - "module": "blaze", - "name": "currentView", - "scope": "static", - "summary": "The View corresponding to the current template helper, event handler, callback, or autorun. If there isn't one, `null`.", - "type": { - "names": [ - "Blaze.View" - ] - } - }, - "Blaze.getData": { - "filepath": "blaze/view.js", - "kind": "function", - "lineno": 743, - "locus": "Client", - "longname": "Blaze.getData", - "memberof": "Blaze", - "module": "blaze", - "name": "getData", - "options": [], - "params": [ - { - "description": "

Optional. An element that was rendered by a Meteor, or a View.

", - "name": "elementOrView", - "optional": true, - "type": { - "names": [ - "DOMElement", - "Blaze.View" - ] - } - } - ], - "scope": "static", - "summary": "Returns the current data context, or the data context that was used when rendering a particular DOM element or View from a Meteor template." - }, - "Blaze.getView": { - "filepath": "blaze/view.js", - "kind": "function", - "lineno": 781, - "locus": "Client", - "longname": "Blaze.getView", - "memberof": "Blaze", - "module": "blaze", - "name": "getView", - "options": [], - "params": [ - { - "description": "

Optional. If specified, the View enclosing element is returned.

", - "name": "element", - "optional": true, - "type": { - "names": [ - "DOMElement" - ] - } - } - ], - "scope": "static", - "summary": "Gets either the current View, or the View enclosing the given DOM element." - }, - "Blaze.isTemplate": { - "filepath": "blaze/template.js", - "kind": "function", - "lineno": 61, - "locus": "Client", - "longname": "Blaze.isTemplate", - "memberof": "Blaze", - "module": "blaze", - "name": "isTemplate", - "options": [], - "params": [ - { - "description": "

The value to test.

", - "name": "value", - "type": { - "names": [ - "Any" - ] - } - } - ], - "scope": "static", - "summary": "Returns true if `value` is a template object like `Template.myTemplate`." - }, - "Blaze.remove": { - "filepath": "blaze/view.js", - "kind": "function", - "lineno": 677, - "locus": "Client", - "longname": "Blaze.remove", - "memberof": "Blaze", - "module": "blaze", - "name": "remove", - "options": [], - "params": [ - { - "description": "

The return value from Blaze.render or Blaze.renderWithData, or the view property of a Blaze.Template instance. Calling Blaze.remove(Template.instance().view) from within a template event handler will destroy the view as well as that template and trigger the template's onDestroyed handlers.

", - "name": "renderedView", - "type": { - "names": [ - "Blaze.View" - ] - } - } - ], - "scope": "static", - "summary": "Removes a rendered View from the DOM, stopping all reactive updates and event listeners on it. Also destroys the Blaze.Template instance associated with the view." - }, - "Blaze.render": { - "filepath": "blaze/view.js", - "kind": "function", - "lineno": 614, - "locus": "Client", - "longname": "Blaze.render", - "memberof": "Blaze", - "module": "blaze", - "name": "render", - "options": [], - "params": [ - { - "description": "

The template (e.g. Template.myTemplate) or View object to render. If a template, a View object is constructed. If a View, it must be an unrendered View, which becomes a rendered View and is returned.

", - "name": "templateOrView", - "type": { - "names": [ - "Template", - "Blaze.View" - ] - } - }, - { - "description": "

The node that will be the parent of the rendered template. It must be an Element node.

", - "name": "parentNode", - "type": { - "names": [ - "DOMNode" - ] - } - }, - { - "description": "

Optional. If provided, must be a child of parentNode; the template will be inserted before this node. If not provided, the template will be inserted as the last child of parentNode.

", - "name": "nextNode", - "optional": true, - "type": { - "names": [ - "DOMNode" - ] - } - }, - { - "description": "

Optional. If provided, it will be set as the rendered View's parentView.

", - "name": "parentView", - "optional": true, - "type": { - "names": [ - "Blaze.View" - ] - } - } - ], - "scope": "static", - "summary": "Renders a template or View to DOM nodes and inserts it into the DOM, returning a rendered [View](#blaze_view) which can be passed to [`Blaze.remove`](#blaze_remove)." - }, - "Blaze.renderWithData": { - "filepath": "blaze/view.js", - "kind": "function", - "lineno": 665, - "locus": "Client", - "longname": "Blaze.renderWithData", - "memberof": "Blaze", - "module": "blaze", - "name": "renderWithData", - "options": [], - "params": [ - { - "description": "

The template (e.g. Template.myTemplate) or View object to render.

", - "name": "templateOrView", - "type": { - "names": [ - "Template", - "Blaze.View" - ] - } - }, - { - "description": "

The data context to use, or a function returning a data context. If a function is provided, it will be reactively re-run.

", - "name": "data", - "type": { - "names": [ - "Object", - "function" - ] - } - }, - { - "description": "

The node that will be the parent of the rendered template. It must be an Element node.

", - "name": "parentNode", - "type": { - "names": [ - "DOMNode" - ] - } - }, - { - "description": "

Optional. If provided, must be a child of parentNode; the template will be inserted before this node. If not provided, the template will be inserted as the last child of parentNode.

", - "name": "nextNode", - "optional": true, - "type": { - "names": [ - "DOMNode" - ] - } - }, - { - "description": "

Optional. If provided, it will be set as the rendered View's parentView.

", - "name": "parentView", - "optional": true, - "type": { - "names": [ - "Blaze.View" - ] - } - } - ], - "scope": "static", - "summary": "Renders a template or View to DOM nodes with a data context. Otherwise identical to `Blaze.render`." - }, - "Blaze.toHTML": { - "filepath": "blaze/view.js", - "kind": "function", - "lineno": 698, - "locus": "Client", - "longname": "Blaze.toHTML", - "memberof": "Blaze", - "module": "blaze", - "name": "toHTML", - "options": [], - "params": [ - { - "description": "

The template (e.g. Template.myTemplate) or View object from which to generate HTML.

", - "name": "templateOrView", - "type": { - "names": [ - "Template", - "Blaze.View" - ] - } - } - ], - "scope": "static", - "summary": "Renders a template or View to a string of HTML." - }, - "Blaze.toHTMLWithData": { - "filepath": "blaze/view.js", - "kind": "function", - "lineno": 710, - "locus": "Client", - "longname": "Blaze.toHTMLWithData", - "memberof": "Blaze", - "module": "blaze", - "name": "toHTMLWithData", - "options": [], - "params": [ - { - "description": "

The template (e.g. Template.myTemplate) or View object from which to generate HTML.

", - "name": "templateOrView", - "type": { - "names": [ - "Template", - "Blaze.View" - ] - } - }, - { - "description": "

The data context to use, or a function returning a data context.

", - "name": "data", - "type": { - "names": [ - "Object", - "function" - ] - } - } - ], - "scope": "static", - "summary": "Renders a template or View to HTML with a data context. Otherwise identical to `Blaze.toHTML`." - }, - "CompileStep": { - "description": "

The comments for this class aren't used to generate docs right now.\nThe docs live in the GitHub Wiki at: https://github.com/meteor/meteor/wiki/CompileStep-API-for-Build-Plugin-Source-Handlers

", - "kind": "class", - "longname": "CompileStep", - "name": "CompileStep", - "options": [], - "params": [], - "scope": "global", - "summary": "The object passed into Plugin.registerSourceHandler" - }, - "CompileStep#addAsset": { - "kind": "function", - "longname": "CompileStep#addAsset", - "memberof": "CompileStep", - "name": "addAsset", - "options": [], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

The path at which to serve the asset.

", - "name": "path", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The data that should be placed in\nthe file.

", - "name": "data", - "type": { - "names": [ - "Buffer", - "String" - ] - } - } - ], - "scope": "instance", - "summary": "Add a file to serve as-is to the browser or to include on\nthe browser, depending on the target. On the web, it will be served\nat the exact path requested. For server targets, it can be retrieved\nusing `Assets.getText` or `Assets.getBinary`." - }, - "CompileStep#addHtml": { - "kind": "function", - "longname": "CompileStep#addHtml", - "memberof": "CompileStep", - "name": "addHtml", - "options": [ - { - "description": "

Which section of the document should\nbe appended to. Can only be "head" or "body".

", - "name": "section", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The content to append.

", - "name": "data", - "type": { - "names": [ - "String" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Works in web targets only. Add markup to the `head` or `body`\nsection of the document." - }, - "CompileStep#addJavaScript": { - "kind": "function", - "longname": "CompileStep#addJavaScript", - "memberof": "CompileStep", - "name": "addJavaScript", - "options": [ - { - "description": "

The path at which the JavaScript file\nshould be inserted, may not be honored in case of path conflicts.

", - "name": "path", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The code to be added.

", - "name": "data", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The path that will be used in\nany error messages generated by this file, e.g. foo.js:4:1: error.

", - "name": "sourcePath", - "type": { - "names": [ - "String" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Add JavaScript code. The code added will only see the\nnamespaces imported by this package as runtime dependencies using\n['api.use'](#PackageAPI-use). If the file being compiled was added\nwith the bare flag, the resulting JavaScript won't be wrapped in a\nclosure." - }, - "CompileStep#addStylesheet": { - "kind": "function", - "longname": "CompileStep#addStylesheet", - "memberof": "CompileStep", - "name": "addStylesheet", - "options": [], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

The requested path for the added CSS, may not be\nsatisfied if there are path conflicts.

", - "name": "path", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The content of the stylesheet that should be\nadded.

", - "name": "data", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

A stringified JSON sourcemap, in case the\nstylesheet was generated from a different file.

", - "name": "sourceMap", - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "instance", - "summary": "Web targets only. Add a stylesheet to the document." - }, - "CompileStep#arch": { - "kind": "member", - "longname": "CompileStep#arch", - "memberof": "CompileStep", - "name": "arch", - "scope": "instance", - "summary": "The architecture for which we are building. Can be \"os\",\n\"web.browser\", or \"web.cordova\".", - "type": { - "names": [ - "String" - ] - } - }, - "CompileStep#declaredExports": { - "kind": "member", - "longname": "CompileStep#declaredExports", - "memberof": "CompileStep", - "name": "declaredExports", - "scope": "instance", - "summary": "The list of exports that the current package has defined.\nCan be used to treat those symbols differently during compilation.", - "type": { - "names": [ - "Object" - ] - } - }, - "CompileStep#error": { - "kind": "function", - "longname": "CompileStep#error", - "memberof": "CompileStep", - "name": "error", - "options": [], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

The error message to display.

", - "name": "message", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The path to display in the error message.

", - "name": "sourcePath", - "optional": true, - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The line number to display in the error message.

", - "name": "line", - "type": { - "names": [ - "Integer" - ] - } - }, - { - "description": "

The function name to display in the error message.

", - "name": "func", - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "instance", - "summary": "Display a build error." - }, - "CompileStep#fileOptions": { - "kind": "member", - "longname": "CompileStep#fileOptions", - "memberof": "CompileStep", - "name": "fileOptions", - "scope": "instance", - "summary": "Any options passed to \"api.addFiles\".", - "type": { - "names": [ - "Object" - ] - } - }, - "CompileStep#fullInputPath": { - "kind": "member", - "longname": "CompileStep#fullInputPath", - "memberof": "CompileStep", - "name": "fullInputPath", - "scope": "instance", - "summary": "The filename and absolute path of the input file.\nPlease don't use this filename to read the file from disk, instead\nuse [compileStep.read](CompileStep-read).", - "type": { - "names": [ - "String" - ] - } - }, - "CompileStep#inputPath": { - "kind": "member", - "longname": "CompileStep#inputPath", - "memberof": "CompileStep", - "name": "inputPath", - "scope": "instance", - "summary": "The filename and relative path of the input file.\nPlease don't use this filename to read the file from disk, instead\nuse [compileStep.read](CompileStep-read).", - "type": { - "names": [ - "String" - ] - } - }, - "CompileStep#inputSize": { - "kind": "member", - "longname": "CompileStep#inputSize", - "memberof": "CompileStep", - "name": "inputSize", - "scope": "instance", - "summary": "The total number of bytes in the input file.", - "type": { - "names": [ - "Integer" - ] - } - }, - "CompileStep#packageName": { - "kind": "member", - "longname": "CompileStep#packageName", - "memberof": "CompileStep", - "name": "packageName", - "scope": "instance", - "summary": "The name of the package in which the file being built exists.", - "type": { - "names": [ - "String" - ] - } - }, - "CompileStep#pathForSourceMap": { - "kind": "member", - "longname": "CompileStep#pathForSourceMap", - "memberof": "CompileStep", - "name": "pathForSourceMap", - "scope": "instance", - "summary": "If you are generating a sourcemap for the compiled file, use\nthis path for the original file in the sourcemap.", - "type": { - "names": [ - "String" - ] - } - }, - "CompileStep#read": { - "kind": "function", - "longname": "CompileStep#read", - "memberof": "CompileStep", - "name": "read", - "options": [], - "params": [ - { - "description": "

The number of bytes to return.

", - "name": "n", - "optional": true, - "type": { - "names": [ - "Integer" - ] - } - } - ], - "returns": [ - { - "type": { - "names": [ - "Buffer" - ] - } - } - ], - "scope": "instance", - "summary": "Read from the input file. If `n` is specified, returns the\nnext `n` bytes of the file as a Buffer. XXX not sure if this actually\nreturns a String sometimes..." - }, - "CompileStep#rootOutputPath": { - "kind": "member", - "longname": "CompileStep#rootOutputPath", - "memberof": "CompileStep", - "name": "rootOutputPath", - "scope": "instance", - "summary": "On web targets, this will be the root URL prepended\nto the paths you pick for your output files. For example,\nit could be \"/packages/my-package\".", - "type": { - "names": [ - "String" - ] - } - }, - "Cordova": { - "kind": "namespace", - "longname": "Cordova", - "name": "Cordova", - "scope": "global", - "summary": "The Cordova object in package.js." - }, - "Cordova.depends": { - "kind": "function", - "locus": "package.js", - "longname": "Cordova.depends", - "memberof": "Cordova", - "name": "depends", - "options": [], - "params": [ - { - "description": "

An object where the keys are plugin\nnames and the values are version numbers or GitHub tarball URLs\nin string form.\nExample:

\n
Cordova.depends({\n  "org.apache.cordova.camera": "0.3.0"\n});

Alternatively, with a GitHub URL:

\n
Cordova.depends({\n  "org.apache.cordova.camera":\n    "https://github.com/apache/cordova-plugin-camera/tarball/d84b875c449d68937520a1b352e09f6d39044fbf"\n});
", - "name": "dependencies", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Specify which [Cordova / PhoneGap](http://cordova.apache.org/)\nplugins your Meteor package depends on.\n\nPlugins are installed from\n[plugins.cordova.io](http://plugins.cordova.io/), so the plugins and\nversions specified must exist there. Alternatively, the version\ncan be replaced with a GitHub tarball URL as described in the\n[Cordova](https://github.com/meteor/meteor/wiki/Meteor-Cordova-integration#meteor-packages-with-cordova-dependencies)\npage of the Meteor wiki on GitHub." - }, - "DDP": { - "filepath": "ddp-client/namespace.js", - "kind": "namespace", - "lineno": 1, - "longname": "DDP", - "module": "ddp-client", - "name": "DDP", - "scope": "global", - "summary": "Namespace for DDP-related methods/classes." - }, - "DDP.connect": { - "filepath": "ddp-client/livedata_connection.js", - "kind": "function", - "lineno": 1689, - "locus": "Anywhere", - "longname": "DDP.connect", - "memberof": "DDP", - "module": "ddp-client", - "name": "connect", - "options": [], - "params": [ - { - "description": "

The URL of another Meteor application.

", - "name": "url", - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "static", - "summary": "Connect to the server of a different Meteor application to subscribe to its document sets and invoke its remote methods." - }, - "DDPCommon": { - "filepath": "ddp-common/namespace.js", - "kind": "namespace", - "lineno": 1, - "longname": "DDPCommon", - "module": "ddp-common", - "name": "DDPCommon", - "scope": "global", - "summary": "Namespace for DDPCommon-related methods/classes. Shared between \n`ddp-client` and `ddp-server`, where the ddp-client is the implementation\nof a ddp client for both client AND server; and the ddp server is the\nimplementation of the livedata server and stream server. Common \nfunctionality shared between both can be shared under this namespace" - }, - "DDPCommon.MethodInvocation": { - "filepath": "ddp-common/method_invocation.js", - "instancename": "this", - "kind": "function", - "lineno": 9, - "longname": "DDPCommon.MethodInvocation", - "memberof": "DDPCommon", - "module": "ddp-common", - "name": "MethodInvocation", - "options": [], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "The state for a single invocation of a method, referenced by this\ninside a method definition." - }, - "DDPCommon.MethodInvocation#connection": { - "filepath": "ddp-common/method_invocation.js", - "kind": "member", - "lineno": 53, - "locus": "Server", - "longname": "DDPCommon.MethodInvocation#connection", - "memberof": "DDPCommon.MethodInvocation", - "module": "ddp-common", - "name": "connection", - "scope": "instance", - "summary": "Access inside a method invocation. The [connection](#meteor_onconnection) that this method was received on. `null` if the method is not associated with a connection, eg. a server initiated method call." - }, - "DDPCommon.MethodInvocation#isSimulation": { - "filepath": "ddp-common/method_invocation.js", - "kind": "member", - "lineno": 20, - "locus": "Anywhere", - "longname": "DDPCommon.MethodInvocation#isSimulation", - "memberof": "DDPCommon.MethodInvocation", - "module": "ddp-common", - "name": "isSimulation", - "scope": "instance", - "summary": "Access inside a method invocation. Boolean value, true if this invocation is a stub.", - "type": { - "names": [ - "Boolean" - ] - } - }, - "DDPCommon.MethodInvocation#setUserId": { - "filepath": "ddp-common/method_invocation.js", - "kind": "function", - "lineno": 89, - "locus": "Server", - "longname": "DDPCommon.MethodInvocation#setUserId", - "memberof": "DDPCommon.MethodInvocation", - "module": "ddp-common", - "name": "setUserId", - "options": [], - "params": [ - { - "description": "

The value that should be returned by userId on this connection.

", - "name": "userId", - "type": { - "names": [ - "String", - "null" - ] - } - } - ], - "scope": "instance", - "summary": "Set the logged in user." - }, - "DDPCommon.MethodInvocation#unblock": { - "filepath": "ddp-common/method_invocation.js", - "kind": "function", - "lineno": 76, - "locus": "Server", - "longname": "DDPCommon.MethodInvocation#unblock", - "memberof": "DDPCommon.MethodInvocation", - "module": "ddp-common", - "name": "unblock", - "options": [], - "params": [], - "scope": "instance", - "summary": "Call inside a method invocation. Allow subsequent method from this client to begin running in a new fiber." - }, - "DDPCommon.MethodInvocation#userId": { - "filepath": "ddp-common/method_invocation.js", - "kind": "member", - "lineno": 38, - "locus": "Anywhere", - "longname": "DDPCommon.MethodInvocation#userId", - "memberof": "DDPCommon.MethodInvocation", - "module": "ddp-common", - "name": "userId", - "scope": "instance", - "summary": "The id of the user that made this method call, or `null` if no user was logged in." - }, - "DDPRateLimiter.addRule": { - "filepath": "ddp-rate-limiter/ddp-rate-limiter.js", - "kind": "function", - "lineno": 69, - "locus": "Server", - "longname": "DDPRateLimiter.addRule", - "memberof": "DDPRateLimiter", - "module": "ddp-rate-limiter", - "name": "addRule", - "options": [], - "params": [ - { - "description": "

Matchers specify which events are counted towards a rate limit. A matcher\n is an object that has a subset of the same properties as the event objects\n described above. Each value in a matcher object is one of the following:

\n
    \n
  • a string: for the event to satisfy the matcher, this value must be equal\nto the value of the same property in the event object

    \n
  • \n
  • a function: for the event to satisfy the matcher, the function must\nevaluate to true when passed the value of the same property\nin the event object

    \n
  • \n
\n

Here's how events are counted: Each event that satisfies the matcher's\nfilter is mapped to a bucket. Buckets are uniquely determined by the\nevent object's values for all properties present in both the matcher and\nevent objects.

", - "name": "matcher", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

number of requests allowed per time interval.\nDefault = 10.

", - "name": "numRequests", - "type": { - "names": [ - "number" - ] - } - }, - { - "description": "

time interval in milliseconds after which\nrule's counters are reset. Default = 1000.

", - "name": "timeInterval", - "type": { - "names": [ - "number" - ] - } - } - ], - "scope": "static", - "summary": "Add a rule that matches against a stream of events describing method or\nsubscription attempts. Each event is an object with the following\nproperties:\n\n- `type`: Either \"method\" or \"subscription\"\n- `name`: The name of the method or subscription being called\n- `userId`: The user ID attempting the method or subscription\n- `connectionId`: A string representing the user's DDP connection\n- `clientAddress`: The IP address of the user\n\nReturns unique `ruleId` that can be passed to `removeRule`." - }, - "DDPRateLimiter.removeRule": { - "filepath": "ddp-rate-limiter/ddp-rate-limiter.js", - "kind": "function", - "lineno": 84, - "locus": "Server", - "longname": "DDPRateLimiter.removeRule", - "memberof": "DDPRateLimiter", - "module": "ddp-rate-limiter", - "name": "removeRule", - "options": [], - "params": [ - { - "description": "

'ruleId' returned from addRule

", - "name": "id", - "type": { - "names": [ - "string" - ] - } - } - ], - "returns": [ - { - "description": "

True if a rule was removed.

", - "type": { - "names": [ - "boolean" - ] - } - } - ], - "scope": "static", - "summary": "Removes the specified rule from the rate limiter. If rule had\nhit a rate limit, that limit is removed as well." - }, - "DDPRateLimiter.setErrorMessage": { - "filepath": "ddp-rate-limiter/ddp-rate-limiter.js", - "kind": "function", - "lineno": 28, - "locus": "Server", - "longname": "DDPRateLimiter.setErrorMessage", - "memberof": "DDPRateLimiter", - "module": "ddp-rate-limiter", - "name": "setErrorMessage", - "options": [], - "params": [ - { - "description": "

Functions are passed in an object with a\ntimeToReset field that specifies the number of milliseconds until the next\nmethod or subscription is allowed to run. The function must return a string\nof the error message.

", - "name": "message", - "type": { - "names": [ - "string", - "function" - ] - } - } - ], - "scope": "static", - "summary": "Set error message text when method or subscription rate limit\nexceeded." - }, - "EJSON": { - "filepath": "ejson/ejson.js", - "kind": "namespace", - "lineno": 5, - "longname": "EJSON", - "module": "ejson", - "name": "EJSON", - "scope": "global", - "summary": "Namespace for EJSON functions" - }, - "EJSON.CustomType": { - "filepath": "ejson/ejson.js", - "instancename": "customType", - "kind": "class", - "lineno": 11, - "longname": "EJSON.CustomType", - "memberof": "EJSON", - "module": "ejson", - "name": "CustomType", - "options": [], - "params": [], - "scope": "static", - "summary": "The interface that a class must satisfy to be able to become an\nEJSON custom type via EJSON.addType." - }, - "EJSON.CustomType#clone": { - "filepath": "ejson/ejson.js", - "kind": "function", - "lineno": 35, - "locus": "Anywhere", - "longname": "EJSON.CustomType#clone", - "memberof": "EJSON.CustomType", - "module": "ejson", - "name": "clone", - "options": [], - "params": [], - "scope": "instance", - "summary": "Return a value `r` such that `this.equals(r)` is true, and modifications to `r` do not affect `this` and vice versa." - }, - "EJSON.CustomType#equals": { - "filepath": "ejson/ejson.js", - "kind": "function", - "lineno": 43, - "locus": "Anywhere", - "longname": "EJSON.CustomType#equals", - "memberof": "EJSON.CustomType", - "module": "ejson", - "name": "equals", - "options": [], - "params": [ - { - "description": "

Another object to compare this to.

", - "name": "other", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Return `true` if `other` has a value equal to `this`; `false` otherwise." - }, - "EJSON.CustomType#toJSONValue": { - "filepath": "ejson/ejson.js", - "kind": "function", - "lineno": 27, - "locus": "Anywhere", - "longname": "EJSON.CustomType#toJSONValue", - "memberof": "EJSON.CustomType", - "module": "ejson", - "name": "toJSONValue", - "options": [], - "params": [], - "scope": "instance", - "summary": "Serialize this instance into a JSON-compatible value." - }, - "EJSON.CustomType#typeName": { - "filepath": "ejson/ejson.js", - "kind": "function", - "lineno": 19, - "locus": "Anywhere", - "longname": "EJSON.CustomType#typeName", - "memberof": "EJSON.CustomType", - "module": "ejson", - "name": "typeName", - "options": [], - "params": [], - "scope": "instance", - "summary": "Return the tag used to identify this type. This must match the tag used to register this type with [`EJSON.addType`](#ejson_add_type)." - }, - "EJSON.addType": { - "filepath": "ejson/ejson.js", - "kind": "function", - "lineno": 72, - "locus": "Anywhere", - "longname": "EJSON.addType", - "memberof": "EJSON", - "module": "ejson", - "name": "addType", - "options": [], - "params": [ - { - "description": "

A tag for your custom type; must be unique among custom data types defined in your project, and must match the result of your type's typeName method.

", - "name": "name", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

A function that deserializes a JSON-compatible value into an instance of your type. This should match the serialization performed by your type's toJSONValue method.

", - "name": "factory", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Add a custom datatype to EJSON." - }, - "EJSON.clone": { - "filepath": "ejson/ejson.js", - "kind": "function", - "lineno": 462, - "locus": "Anywhere", - "longname": "EJSON.clone", - "memberof": "EJSON", - "module": "ejson", - "name": "clone", - "options": [], - "params": [ - { - "description": "

A value to copy.

", - "name": "val", - "type": { - "names": [ - "EJSON" - ] - } - } - ], - "scope": "static", - "summary": "Return a deep copy of `val`." - }, - "EJSON.equals": { - "filepath": "ejson/ejson.js", - "kind": "function", - "lineno": 376, - "locus": "Anywhere", - "longname": "EJSON.equals", - "memberof": "EJSON", - "module": "ejson", - "name": "equals", - "options": [ - { - "description": "

Compare in key sensitive order, if supported by the JavaScript implementation. For example, {a: 1, b: 2} is equal to {b: 2, a: 1} only when keyOrderSensitive is false. The default is false.

", - "name": "keyOrderSensitive", - "type": { - "names": [ - "Boolean" - ] - } - } - ], - "params": [ - { - "name": "a", - "type": { - "names": [ - "EJSON" - ] - } - }, - { - "name": "b", - "type": { - "names": [ - "EJSON" - ] - } - }, - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Return true if `a` and `b` are equal to each other. Return false otherwise. Uses the `equals` method on `a` if present, otherwise performs a deep comparison." - }, - "EJSON.fromJSONValue": { - "filepath": "ejson/ejson.js", - "kind": "function", - "lineno": 317, - "locus": "Anywhere", - "longname": "EJSON.fromJSONValue", - "memberof": "EJSON", - "module": "ejson", - "name": "fromJSONValue", - "options": [], - "params": [ - { - "description": "

A value to deserialize into EJSON.

", - "name": "val", - "type": { - "names": [ - "JSONCompatible" - ] - } - } - ], - "scope": "static", - "summary": "Deserialize an EJSON value from its plain JSON representation." - }, - "EJSON.isBinary": { - "filepath": "ejson/ejson.js", - "kind": "function", - "lineno": 363, - "locus": "Anywhere", - "longname": "EJSON.isBinary", - "memberof": "EJSON", - "module": "ejson", - "name": "isBinary", - "options": [], - "params": [ - { - "description": "

The variable to check.

", - "name": "x", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Returns true if `x` is a buffer of binary data, as returned from [`EJSON.newBinary`](#ejson_new_binary)." - }, - "EJSON.newBinary": { - "filepath": "ejson/ejson.js", - "kind": "member", - "lineno": 516, - "locus": "Anywhere", - "longname": "EJSON.newBinary", - "memberof": "EJSON", - "module": "ejson", - "name": "newBinary", - "params": [ - { - "description": "

The number of bytes of binary data to allocate.

", - "name": "size", - "type": { - "names": [ - "Number" - ] - } - } - ], - "scope": "static", - "summary": "Allocate a new buffer of binary data that EJSON can serialize." - }, - "EJSON.parse": { - "filepath": "ejson/ejson.js", - "kind": "function", - "lineno": 352, - "locus": "Anywhere", - "longname": "EJSON.parse", - "memberof": "EJSON", - "module": "ejson", - "name": "parse", - "options": [], - "params": [ - { - "description": "

A string to parse into an EJSON value.

", - "name": "str", - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "static", - "summary": "Parse a string into an EJSON value. Throws an error if the string is not valid EJSON." - }, - "EJSON.stringify": { - "filepath": "ejson/ejson.js", - "kind": "function", - "lineno": 338, - "locus": "Anywhere", - "longname": "EJSON.stringify", - "memberof": "EJSON", - "module": "ejson", - "name": "stringify", - "options": [ - { - "description": "

Indents objects and arrays for easy readability. When true, indents by 2 spaces; when an integer, indents by that number of spaces; and when a string, uses the string as the indentation pattern.

", - "name": "indent", - "type": { - "names": [ - "Boolean", - "Integer", - "String" - ] - } - }, - { - "description": "

When true, stringifies keys in an object in sorted order.

", - "name": "canonical", - "type": { - "names": [ - "Boolean" - ] - } - } - ], - "params": [ - { - "description": "

A value to stringify.

", - "name": "val", - "type": { - "names": [ - "EJSON" - ] - } - }, - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Serialize a value to a string.\n\nFor EJSON values, the serialization fully represents the value. For non-EJSON values, serializes the same way as `JSON.stringify`." - }, - "EJSON.toJSONValue": { - "filepath": "ejson/ejson.js", - "kind": "function", - "lineno": 248, - "locus": "Anywhere", - "longname": "EJSON.toJSONValue", - "memberof": "EJSON", - "module": "ejson", - "name": "toJSONValue", - "options": [], - "params": [ - { - "description": "

A value to serialize to plain JSON.

", - "name": "val", - "type": { - "names": [ - "EJSON" - ] - } - } - ], - "scope": "static", - "summary": "Serialize an EJSON-compatible value into its plain JSON representation." - }, - "Email.send": { - "filepath": "email/email.js", - "kind": "function", - "lineno": 154, - "locus": "Server", - "longname": "Email.send", - "memberof": "Email", - "module": "email", - "name": "send", - "options": [ - { - "description": "

"From:" address (required)

", - "name": "from", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

"To:", "Cc:", "Bcc:", and "Reply-To:" addresses

", - "name": "to, cc, bcc, replyTo", - "type": { - "names": [ - "String", - "Array." - ] - } - }, - { - "description": "

"Subject:" line

", - "name": "subject", - "optional": true, - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Mail body (in plain text and/or HTML)

", - "name": "text, html", - "optional": true, - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Dictionary of custom headers

", - "name": "headers", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Array of attachment objects, as\ndescribed in the mailcomposer documentation.

", - "name": "attachments", - "optional": true, - "type": { - "names": [ - "Array." - ] - } - }, - { - "description": "

A MailComposer\nobject representing the message to be sent. Overrides all other options. You\ncan access the mailcomposer npm module at\nEmailInternals.NpmModules.mailcomposer.module.

", - "name": "mailComposer", - "optional": true, - "type": { - "names": [ - "MailComposer" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Send an email. Throws an `Error` on failure to contact mail server\nor if mail server returns an error. All fields should match\n[RFC5322](http://tools.ietf.org/html/rfc5322) specification.\n\nIf the `MAIL_URL` environment variable is set, actually sends the email.\nOtherwise, prints the contents of the email to standard out.\n\nNote that this package is based on mailcomposer version `0.1.15`, so make\nsure to refer to the documentation for that version if using the\n`attachments` or `mailComposer` options.\n[Click here to read the mailcomposer 0.1.15 docs](https://github.com/andris9/mailcomposer/blob/7c0422b2de2dc61a60ba27cfa3353472f662aeb5/README.md)." - }, - "HTTP.call": { - "filepath": "http/httpcall_client.js", - "kind": "function", - "lineno": 19, - "locus": "Anywhere", - "longname": "HTTP.call", - "memberof": "HTTP", - "module": "http", - "name": "call", - "options": [ - { - "description": "

String to use as the HTTP request body.

", - "name": "content", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

JSON-able object to stringify and use as the HTTP request body. Overwrites content.

", - "name": "data", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Query string to go in the URL. Overwrites any query string in url.

", - "name": "query", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Dictionary of request parameters to be encoded and placed in the URL (for GETs) or request body (for POSTs). If content or data is specified, params will always be placed in the URL.

", - "name": "params", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

HTTP basic authentication string of the form "username:password"

", - "name": "auth", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Dictionary of strings, headers to add to the HTTP request.

", - "name": "headers", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Maximum time in milliseconds to wait for the request before failing. There is no timeout by default.

", - "name": "timeout", - "type": { - "names": [ - "Number" - ] - } - }, - { - "description": "

If true, transparently follow HTTP redirects. Cannot be set to false on the client. Default true.

", - "name": "followRedirects", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

On the server, HTTP.call is implemented by using the npm request module. Any options in this object will be passed directly to the request invocation.

", - "name": "npmRequestOptions", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

On the client, this will be called before the request is sent to allow for more direct manipulation of the underlying XMLHttpRequest object, which will be passed as the first argument. If the callback returns false, the request will be not be send.

", - "name": "beforeSend", - "type": { - "names": [ - "function" - ] - } - } - ], - "params": [ - { - "description": "

The HTTP method to use, such as "GET", "POST", or "HEAD".

", - "name": "method", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The URL to retrieve.

", - "name": "url", - "type": { - "names": [ - "String" - ] - } - }, - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Optional callback. If passed, the method runs asynchronously, instead of synchronously, and calls asyncCallback. On the client, this callback is required.

", - "name": "asyncCallback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Perform an outbound HTTP request." - }, - "HTTP.del": { - "filepath": "http/httpcall_common.js", - "kind": "function", - "lineno": 82, - "locus": "Anywhere", - "longname": "HTTP.del", - "memberof": "HTTP", - "module": "http", - "name": "del", - "options": [], - "params": [ - { - "description": "

The URL to which the request should be sent.

", - "name": "url", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Options passed on to HTTP.call.

", - "name": "callOptions", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Callback that is called when the request is completed. Required on the client.

", - "name": "asyncCallback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Send an HTTP `DELETE` request. Equivalent to calling [`HTTP.call`](#http_call) with \"DELETE\" as the first argument. (Named `del` to avoid conflict with the Javascript keyword `delete`)" - }, - "HTTP.get": { - "filepath": "http/httpcall_common.js", - "kind": "function", - "lineno": 49, - "locus": "Anywhere", - "longname": "HTTP.get", - "memberof": "HTTP", - "module": "http", - "name": "get", - "options": [], - "params": [ - { - "description": "

The URL to which the request should be sent.

", - "name": "url", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Options passed on to HTTP.call.

", - "name": "callOptions", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Callback that is called when the request is completed. Required on the client.

", - "name": "asyncCallback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Send an HTTP `GET` request. Equivalent to calling [`HTTP.call`](#http_call) with \"GET\" as the first argument." - }, - "HTTP.patch": { - "filepath": "http/httpcall_common.js", - "kind": "function", - "lineno": 93, - "locus": "Anywhere", - "longname": "HTTP.patch", - "memberof": "HTTP", - "module": "http", - "name": "patch", - "options": [], - "params": [ - { - "description": "

The URL to which the request should be sent.

", - "name": "url", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Options passed on to HTTP.call.

", - "name": "callOptions", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Callback that is called when the request is completed. Required on the client.

", - "name": "asyncCallback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Send an HTTP `PATCH` request. Equivalent to calling [`HTTP.call`](#http_call) with \"PATCH\" as the first argument." - }, - "HTTP.post": { - "filepath": "http/httpcall_common.js", - "kind": "function", - "lineno": 60, - "locus": "Anywhere", - "longname": "HTTP.post", - "memberof": "HTTP", - "module": "http", - "name": "post", - "options": [], - "params": [ - { - "description": "

The URL to which the request should be sent.

", - "name": "url", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Options passed on to HTTP.call.

", - "name": "callOptions", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Callback that is called when the request is completed. Required on the client.

", - "name": "asyncCallback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Send an HTTP `POST` request. Equivalent to calling [`HTTP.call`](#http_call) with \"POST\" as the first argument." - }, - "HTTP.put": { - "filepath": "http/httpcall_common.js", - "kind": "function", - "lineno": 71, - "locus": "Anywhere", - "longname": "HTTP.put", - "memberof": "HTTP", - "module": "http", - "name": "put", - "options": [], - "params": [ - { - "description": "

The URL to which the request should be sent.

", - "name": "url", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Options passed on to HTTP.call.

", - "name": "callOptions", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Callback that is called when the request is completed. Required on the client.

", - "name": "asyncCallback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Send an HTTP `PUT` request. Equivalent to calling [`HTTP.call`](#http_call) with \"PUT\" as the first argument." - }, - "InputFile#addAsset": { - "kind": "function", - "longname": "InputFile#addAsset", - "memberof": "InputFile", - "name": "addAsset", - "options": [ - { - "description": "

The path at which to serve the asset.

", - "name": "path", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The data that should be placed in the\nfile.

", - "name": "data", - "type": { - "names": [ - "Buffer", - "String" - ] - } - }, - { - "description": "

Optionally, supply a hash for the output\nfile.

", - "name": "hash", - "optional": true, - "type": { - "names": [ - "String" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Add a file to serve as-is to the browser or to include on\nthe browser, depending on the target. On the web, it will be served\nat the exact path requested. For server targets, it can be retrieved\nusing `Assets.getText` or `Assets.getBinary`." - }, - "InputFile#addHtml": { - "kind": "function", - "longname": "InputFile#addHtml", - "memberof": "InputFile", - "name": "addHtml", - "options": [ - { - "description": "

Which section of the document should\nbe appended to. Can only be "head" or "body".

", - "name": "section", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The content to append.

", - "name": "data", - "type": { - "names": [ - "String" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Works in web targets only. Add markup to the `head` or `body`\nsection of the document." - }, - "InputFile#addJavaScript": { - "kind": "function", - "longname": "InputFile#addJavaScript", - "memberof": "InputFile", - "name": "addJavaScript", - "options": [ - { - "description": "

The path at which the JavaScript file\nshould be inserted, may not be honored in case of path conflicts.

", - "name": "path", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The code to be added.

", - "name": "data", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

A stringified JSON\nsourcemap, in case the JavaScript file was generated from a\ndifferent file.

", - "name": "sourceMap", - "type": { - "names": [ - "String", - "Object" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Add JavaScript code. The code added will only see the\nnamespaces imported by this package as runtime dependencies using\n['api.use'](#PackageAPI-use). If the file being compiled was added\nwith the bare flag, the resulting JavaScript won't be wrapped in a\nclosure." - }, - "InputFile#addStylesheet": { - "kind": "function", - "longname": "InputFile#addStylesheet", - "memberof": "InputFile", - "name": "addStylesheet", - "options": [ - { - "description": "

The requested path for the added CSS, may not\nbe satisfied if there are path conflicts.

", - "name": "path", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The content of the stylesheet that should be\nadded.

", - "name": "data", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

A stringified JSON\nsourcemap, in case the stylesheet was generated from a different\nfile.

", - "name": "sourceMap", - "type": { - "names": [ - "String", - "Object" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Web targets only. Add a stylesheet to the document. Not available\nfor linter build plugins." - }, - "InputFile#error": { - "kind": "function", - "longname": "InputFile#error", - "memberof": "InputFile", - "name": "error", - "options": [ - { - "description": "

The error message to display.

", - "name": "message", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The path to display in the error message.

", - "name": "sourcePath", - "optional": true, - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The line number to display in the error message.

", - "name": "line", - "type": { - "names": [ - "Integer" - ] - } - }, - { - "description": "

The function name to display in the error message.

", - "name": "func", - "type": { - "names": [ - "String" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Call this method to raise a compilation or linting error for the\nfile." - }, - "InputFile#getArch": { - "kind": "function", - "longname": "InputFile#getArch", - "memberof": "InputFile", - "name": "getArch", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "instance", - "summary": "Returns the architecture that is targeted while processing this\nfile." - }, - "InputFile#getBasename": { - "kind": "function", - "longname": "InputFile#getBasename", - "memberof": "InputFile", - "name": "getBasename", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "instance", - "summary": "Returns the filename of the file." - }, - "InputFile#getContentsAsBuffer": { - "kind": "function", - "longname": "InputFile#getContentsAsBuffer", - "memberof": "InputFile", - "name": "getContentsAsBuffer", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "Buffer" - ] - } - } - ], - "scope": "instance", - "summary": "Returns the full contents of the file as a buffer." - }, - "InputFile#getContentsAsString": { - "kind": "function", - "longname": "InputFile#getContentsAsString", - "memberof": "InputFile", - "name": "getContentsAsString", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "instance", - "summary": "Returns the full contents of the file as a string." - }, - "InputFile#getDeclaredExports": { - "kind": "function", - "longname": "InputFile#getDeclaredExports", - "memberof": "InputFile", - "name": "getDeclaredExports", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "Array." - ] - } - } - ], - "scope": "instance", - "summary": "Returns a list of symbols declared as exports in this target. The\nresult of `api.export('symbol')` calls in target's control file such as\npackage.js." - }, - "InputFile#getDirname": { - "kind": "function", - "longname": "InputFile#getDirname", - "memberof": "InputFile", - "name": "getDirname", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "instance", - "summary": "Returns the directory path relative to the package or app root.\nThe returned path always uses forward slashes." - }, - "InputFile#getDisplayPath": { - "kind": "function", - "longname": "InputFile#getDisplayPath", - "memberof": "InputFile", - "name": "getDisplayPath", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "instance", - "summary": "Returns a relative path that can be used to form error messages or\nother display properties. Can be used as an input to a source map." - }, - "InputFile#getExtension": { - "kind": "function", - "longname": "InputFile#getExtension", - "memberof": "InputFile", - "name": "getExtension", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "instance", - "summary": "Returns the extension that matched the compiler plugin.\nThe longest prefix is preferred." - }, - "InputFile#getFileOptions": { - "kind": "function", - "longname": "InputFile#getFileOptions", - "memberof": "InputFile", - "name": "getFileOptions", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Returns an object of file options such as those passed as the\n third argument to api.addFiles." - }, - "InputFile#getPackageName": { - "kind": "function", - "longname": "InputFile#getPackageName", - "memberof": "InputFile", - "name": "getPackageName", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "instance", - "summary": "Returns the name of the package or `null` if the file is not in a\npackage." - }, - "InputFile#getPathInBundle": { - "kind": "function", - "longname": "InputFile#getPathInBundle", - "memberof": "InputFile", - "name": "getPathInBundle", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "instance", - "summary": "Returns the path of the compiled file in the bundle." - }, - "InputFile#getPathInPackage": { - "kind": "function", - "longname": "InputFile#getPathInPackage", - "memberof": "InputFile", - "name": "getPathInPackage", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "instance", - "summary": "Returns the relative path of file to the package or app root\ndirectory. The returned path always uses forward slashes." - }, - "InputFile#getSourceHash": { - "kind": "function", - "longname": "InputFile#getSourceHash", - "memberof": "InputFile", - "name": "getSourceHash", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "instance", - "summary": "Returns a hash string for the file that can be used to implement\ncaching." - }, - "InputFile#getSourceMap": { - "kind": "function", - "longname": "InputFile#getSourceMap", - "memberof": "InputFile", - "name": "getSourceMap", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "instance", - "summary": "Returns the source-map associated with the file." - }, - "IterationCallback": { - "filepath": "minimongo/minimongo.js", - "kind": "typedef", - "lineno": 140, - "longname": "IterationCallback", - "module": "minimongo", - "name": "IterationCallback", - "params": [ - { - "name": "doc", - "type": { - "names": [ - "Object" - ] - } - }, - { - "name": "index", - "type": { - "names": [ - "Number" - ] - } - } - ], - "scope": "global", - "type": { - "names": [ - "function" - ] - } - }, - "Match": { - "filepath": "check/match.js", - "kind": "namespace", - "lineno": 42, - "longname": "Match", - "module": "check", - "name": "Match", - "scope": "global", - "summary": "The namespace for all Match types and methods." - }, - "Match.test": { - "filepath": "check/match.js", - "kind": "function", - "lineno": 95, - "locus": "Anywhere", - "longname": "Match.test", - "memberof": "Match", - "module": "check", - "name": "test", - "options": [], - "params": [ - { - "description": "

The value to check

", - "name": "value", - "type": { - "names": [ - "Any" - ] - } - }, - { - "description": "

The pattern to match value against

", - "name": "pattern", - "type": { - "names": [ - "MatchPattern" - ] - } - } - ], - "scope": "static", - "summary": "Returns true if the value matches the pattern." - }, - "Meteor": { - "filepath": "meteor/client_environment.js", - "kind": "namespace", - "lineno": 3, - "longname": "Meteor", - "module": "meteor", - "name": "Meteor", - "scope": "global", - "summary": "The Meteor namespace" - }, - "Meteor.Error": { - "filepath": "meteor/errors.js", - "kind": "class", - "lineno": 71, - "locus": "Anywhere", - "longname": "Meteor.Error", - "memberof": "Meteor", - "module": "meteor", - "name": "Error", - "options": [], - "params": [ - { - "description": "

A string code uniquely identifying this kind of error.\nThis string should be used by callers of the method to determine the\nappropriate action to take, instead of attempting to parse the reason\nor details fields. For example:

\n
// on the server, pick a code unique to this error\n// the reason field should be a useful debug message\nthrow new Meteor.Error("logged-out", \n  "The user must be logged in to post a comment.");\n\n// on the client\nMeteor.call("methodName", function (error) {\n  // identify the error\n  if (error && error.error === "logged-out") {\n    // show a nice error message\n    Session.set("errorMessage", "Please log in to post a comment.");\n  }\n});

For legacy reasons, some built-in Meteor functions such as check throw\nerrors with a number in this field.

", - "name": "error", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional. A short human-readable summary of the\nerror, like 'Not Found'.

", - "name": "reason", - "optional": true, - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional. Additional information about the error,\nlike a textual stack trace.

", - "name": "details", - "optional": true, - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "static", - "summary": "This class represents a symbolic error thrown by a method." - }, - "Meteor.absoluteUrl": { - "filepath": "meteor/url_common.js", - "kind": "function", - "lineno": 10, - "locus": "Anywhere", - "longname": "Meteor.absoluteUrl", - "memberof": "Meteor", - "module": "meteor", - "name": "absoluteUrl", - "options": [ - { - "description": "

Create an HTTPS URL.

", - "name": "secure", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

Replace localhost with 127.0.0.1. Useful for services that don't recognize localhost as a domain name.

", - "name": "replaceLocalhost", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

Override the default ROOT_URL from the server environment. For example: "http://foo.example.com"

", - "name": "rootUrl", - "type": { - "names": [ - "String" - ] - } - } - ], - "params": [ - { - "description": "

A path to append to the root URL. Do not include a leading "/".

", - "name": "path", - "optional": true, - "type": { - "names": [ - "String" - ] - } - }, - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Generate an absolute URL pointing to the application. The server reads from the `ROOT_URL` environment variable to determine where it is running. This is taken care of automatically for apps deployed to Galaxy, but must be provided when using `meteor build`." - }, - "Meteor.apply": { - "filepath": "ddp-client/livedata_connection.js", - "importfrompackage": "meteor", - "kind": "function", - "lineno": 750, - "locus": "Anywhere", - "longname": "Meteor.apply", - "memberof": "Meteor", - "module": "meteor", - "name": "apply", - "options": [ - { - "description": "

(Client only) If true, don't send this method until all previous method calls have completed, and don't send any subsequent method calls until this one is completed.

", - "name": "wait", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

(Client only) This callback is invoked with the error or result of the method (just like asyncCallback) as soon as the error or result is available. The local cache may not yet reflect the writes performed by the method.

", - "name": "onResultReceived", - "type": { - "names": [ - "function" - ] - } - } - ], - "params": [ - { - "description": "

Name of method to invoke

", - "name": "name", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Method arguments

", - "name": "args", - "type": { - "names": [ - "Array." - ] - } - }, - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

options.noRetry (Client only) if true, don't send this method again on reload, simply call the callback an error with the error code 'invocation-failed'.

", - "name": "(Boolean)" - }, - { - "description": "

Optional callback; same semantics as in Meteor.call.

", - "name": "asyncCallback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Invoke a method passing an array of arguments." - }, - "Meteor.call": { - "filepath": "ddp-client/livedata_connection.js", - "importfrompackage": "meteor", - "kind": "function", - "lineno": 707, - "locus": "Anywhere", - "longname": "Meteor.call", - "memberof": "Meteor", - "module": "meteor", - "name": "call", - "options": [], - "params": [ - { - "description": "

Name of method to invoke

", - "name": "name", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional method arguments

", - "name": "arg1, arg2...", - "optional": true, - "type": { - "names": [ - "EJSONable" - ] - } - }, - { - "description": "

Optional callback, which is called asynchronously with the error or result after the method is complete. If not provided, the method runs synchronously if possible (see below).

", - "name": "asyncCallback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Invokes a method passing any number of arguments." - }, - "Meteor.clearInterval": { - "filepath": "meteor/timers.js", - "kind": "function", - "lineno": 49, - "locus": "Anywhere", - "longname": "Meteor.clearInterval", - "memberof": "Meteor", - "module": "meteor", - "name": "clearInterval", - "options": [], - "params": [ - { - "description": "

The handle returned by Meteor.setInterval

", - "name": "id", - "type": { - "names": [ - "Number" - ] - } - } - ], - "scope": "static", - "summary": "Cancel a repeating function call scheduled by `Meteor.setInterval`." - }, - "Meteor.clearTimeout": { - "filepath": "meteor/timers.js", - "kind": "function", - "lineno": 59, - "locus": "Anywhere", - "longname": "Meteor.clearTimeout", - "memberof": "Meteor", - "module": "meteor", - "name": "clearTimeout", - "options": [], - "params": [ - { - "description": "

The handle returned by Meteor.setTimeout

", - "name": "id", - "type": { - "names": [ - "Number" - ] - } - } - ], - "scope": "static", - "summary": "Cancel a function call scheduled by `Meteor.setTimeout`." - }, - "Meteor.defer": { - "filepath": "meteor/timers.js", - "kind": "function", - "lineno": 74, - "locus": "Anywhere", - "longname": "Meteor.defer", - "memberof": "Meteor", - "module": "meteor", - "name": "defer", - "options": [], - "params": [ - { - "description": "

The function to run

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Defer execution of a function to run asynchronously in the background (similar to `Meteor.setTimeout(func, 0)`." - }, - "Meteor.disconnect": { - "filepath": "ddp-client/livedata_connection.js", - "importfrompackage": "meteor", - "kind": "function", - "lineno": 1066, - "locus": "Client", - "longname": "Meteor.disconnect", - "memberof": "Meteor", - "module": "meteor", - "name": "disconnect", - "options": [], - "params": [], - "scope": "static", - "summary": "Disconnect the client from the server." - }, - "Meteor.isClient": { - "filepath": "meteor/client_environment.js", - "kind": "member", - "lineno": 30, - "locus": "Anywhere", - "longname": "Meteor.isClient", - "memberof": "Meteor", - "module": "meteor", - "name": "isClient", - "scope": "static", - "summary": "Boolean variable. True if running in client environment.", - "type": { - "names": [ - "Boolean" - ] - } - }, - "Meteor.isCordova": { - "filepath": "meteor/cordova_environment.js", - "kind": "member", - "lineno": 7, - "locus": "Anywhere", - "longname": "Meteor.isCordova", - "memberof": "Meteor", - "module": "meteor", - "name": "isCordova", - "scope": "static", - "summary": "Boolean variable. True if running in a Cordova mobile environment.", - "type": { - "names": [ - "Boolean" - ] - } - }, - "Meteor.isDevelopment": { - "filepath": "meteor/client_environment.js", - "kind": "member", - "lineno": 22, - "locus": "Anywhere", - "longname": "Meteor.isDevelopment", - "memberof": "Meteor", - "module": "meteor", - "name": "isDevelopment", - "scope": "static", - "summary": "Boolean variable. True if running in development environment.", - "type": { - "names": [ - "Boolean" - ] - } - }, - "Meteor.isProduction": { - "filepath": "meteor/client_environment.js", - "kind": "member", - "lineno": 14, - "locus": "Anywhere", - "longname": "Meteor.isProduction", - "memberof": "Meteor", - "module": "meteor", - "name": "isProduction", - "scope": "static", - "summary": "Boolean variable. True if running in production environment.", - "type": { - "names": [ - "Boolean" - ] - } - }, - "Meteor.isServer": { - "filepath": "meteor/client_environment.js", - "kind": "member", - "lineno": 38, - "locus": "Anywhere", - "longname": "Meteor.isServer", - "memberof": "Meteor", - "module": "meteor", - "name": "isServer", - "scope": "static", - "summary": "Boolean variable. True if running in server environment.", - "type": { - "names": [ - "Boolean" - ] - } - }, - "Meteor.loggingIn": { - "filepath": "accounts-base/accounts_client.js", - "importfrompackage": "meteor", - "kind": "function", - "lineno": 137, - "locus": "Client", - "longname": "Meteor.loggingIn", - "memberof": "Meteor", - "module": "meteor", - "name": "loggingIn", - "options": [], - "params": [], - "scope": "static", - "summary": "True if a login method (such as `Meteor.loginWithPassword`, `Meteor.loginWithFacebook`, or `Accounts.createUser`) is currently in progress. A reactive data source." - }, - "Meteor.loginWith": { - "filepath": "accounts-oauth/oauth_client.js", - "importfrompackage": "meteor", - "kind": "function", - "lineno": 3, - "locus": "Client", - "longname": "Meteor.loginWith", - "memberof": "Meteor", - "module": "meteor", - "name": "loginWith", - "options": [ - { - "description": "

A list of permissions to request from the user.

", - "name": "requestPermissions", - "type": { - "names": [ - "Array." - ] - } - }, - { - "description": "

If true, asks the user for permission to act on their behalf when offline. This stores an additional offline token in the services field of the user document. Currently only supported with Google.

", - "name": "requestOfflineToken", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

Provide additional parameters to the authentication uri. Currently only supported with Google {@url https://developers.google.com/identity/protocols/OpenIDConnect#authenticationuriparameters}.

", - "name": "loginUrlParameters", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

An email address that the external service will use to pre-fill the login prompt. Currently only supported with Meteor developer accounts and Google accounts. If used with Google, the Google User ID can also be passed.

", - "name": "loginHint", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Login style ("popup" or "redirect", defaults to the login service configuration). The "popup" style opens the login page in a separate popup window, which is generally preferred because the Meteor application doesn't need to be reloaded. The "redirect" style redirects the Meteor application's window to the login page, and the login service provider redirects back to the Meteor application which is then reloaded. The "redirect" style can be used in situations where a popup window can't be opened, such as in a mobile UIWebView. The "redirect" style however relies on session storage which isn't available in Safari private mode, so the "popup" style will be forced if session storage can't be used.

", - "name": "loginStyle", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

If using "redirect" login style, the user will be returned to this URL after authorisation has been completed.

", - "name": "redirectUrl", - "type": { - "names": [ - "String" - ] - } - } - ], - "params": [ - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Optional callback. Called with no arguments on success, or with a single Error argument on failure. The callback cannot be called if you are using the "redirect" loginStyle, because the app will have reloaded in the meantime; try using client-side login hooks instead.

", - "name": "callback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Log the user in using an external service." - }, - "Meteor.loginWithPassword": { - "filepath": "accounts-password/password_client.js", - "importfrompackage": "meteor", - "kind": "function", - "lineno": 24, - "locus": "Client", - "longname": "Meteor.loginWithPassword", - "memberof": "Meteor", - "module": "meteor", - "name": "loginWithPassword", - "options": [], - "params": [ - { - "description": "

Either a string interpreted as a username or an email; or an object with a\n single key: email, username or id. Username or email match in a case\n insensitive manner.

", - "name": "user", - "type": { - "names": [ - "Object", - "String" - ] - } - }, - { - "description": "

The user's password.

", - "name": "password", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional callback.\n Called with no arguments on success, or with a single Error argument\n on failure.

", - "name": "callback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Log the user in with a password." - }, - "Meteor.logout": { - "filepath": "accounts-base/accounts_client.js", - "importfrompackage": "meteor", - "kind": "function", - "lineno": 338, - "locus": "Client", - "longname": "Meteor.logout", - "memberof": "Meteor", - "module": "meteor", - "name": "logout", - "options": [], - "params": [ - { - "description": "

Optional callback. Called with no arguments on success, or with a single Error argument on failure.

", - "name": "callback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Log the user out." - }, - "Meteor.logoutOtherClients": { - "filepath": "accounts-base/accounts_client.js", - "importfrompackage": "meteor", - "kind": "function", - "lineno": 348, - "locus": "Client", - "longname": "Meteor.logoutOtherClients", - "memberof": "Meteor", - "module": "meteor", - "name": "logoutOtherClients", - "options": [], - "params": [ - { - "description": "

Optional callback. Called with no arguments on success, or with a single Error argument on failure.

", - "name": "callback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Log out other clients logged in as the current user, but does not log out the client that calls this function." - }, - "Meteor.methods": { - "filepath": "ddp-server/livedata_server.js", - "importfrompackage": "meteor", - "kind": "function", - "lineno": 1542, - "locus": "Anywhere", - "longname": "Meteor.methods", - "memberof": "Meteor", - "module": "meteor", - "name": "methods", - "options": [], - "params": [ - { - "description": "

Dictionary whose keys are method names and values are functions.

", - "name": "methods", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Defines functions that can be invoked over the network by clients." - }, - "Meteor.onConnection": { - "filepath": "ddp-server/livedata_server.js", - "importfrompackage": "meteor", - "kind": "function", - "lineno": 1401, - "locus": "Server", - "longname": "Meteor.onConnection", - "memberof": "Meteor", - "module": "meteor", - "name": "onConnection", - "options": [], - "params": [ - { - "description": "

The function to call when a new DDP connection is established.

", - "name": "callback", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Register a callback to be called when a new DDP connection is made to the server." - }, - "Meteor.publish": { - "filepath": "ddp-server/livedata_server.js", - "importfrompackage": "meteor", - "kind": "function", - "lineno": 1476, - "locus": "Server", - "longname": "Meteor.publish", - "memberof": "Meteor", - "module": "meteor", - "name": "publish", - "options": [], - "params": [ - { - "description": "

Name of the record set. If null, the set has no name, and the record set is automatically sent to all connected clients.

", - "name": "name", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Function called on the server each time a client subscribes. Inside the function, this is the publish handler object, described below. If the client passed arguments to subscribe, the function is called with the same arguments.

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Publish a record set." - }, - "Meteor.reconnect": { - "filepath": "ddp-client/livedata_connection.js", - "importfrompackage": "meteor", - "kind": "function", - "lineno": 1055, - "locus": "Client", - "longname": "Meteor.reconnect", - "memberof": "Meteor", - "module": "meteor", - "name": "reconnect", - "options": [], - "params": [], - "scope": "static", - "summary": "Force an immediate reconnection attempt if the client is not connected to the server.\n\n This method does nothing if the client is already connected." - }, - "Meteor.release": { - "filepath": "meteor/helpers.js", - "kind": "member", - "lineno": 11, - "locus": "Anywhere", - "longname": "Meteor.release", - "memberof": "Meteor", - "module": "meteor", - "name": "release", - "scope": "static", - "summary": "`Meteor.release` is a string containing the name of the [release](#meteorupdate) with which the project was built (for example, `\"1.2.3\"`). It is `undefined` if the project was built using a git checkout of Meteor.", - "type": { - "names": [ - "String" - ] - } - }, - "Meteor.setInterval": { - "filepath": "meteor/timers.js", - "kind": "function", - "lineno": 39, - "locus": "Anywhere", - "longname": "Meteor.setInterval", - "memberof": "Meteor", - "module": "meteor", - "name": "setInterval", - "options": [], - "params": [ - { - "description": "

The function to run

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - }, - { - "description": "

Number of milliseconds to wait between each function call.

", - "name": "delay", - "type": { - "names": [ - "Number" - ] - } - } - ], - "scope": "static", - "summary": "Call a function repeatedly, with a time delay between calls." - }, - "Meteor.setTimeout": { - "filepath": "meteor/timers.js", - "kind": "function", - "lineno": 28, - "locus": "Anywhere", - "longname": "Meteor.setTimeout", - "memberof": "Meteor", - "module": "meteor", - "name": "setTimeout", - "options": [], - "params": [ - { - "description": "

The function to run

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - }, - { - "description": "

Number of milliseconds to wait before calling function

", - "name": "delay", - "type": { - "names": [ - "Number" - ] - } - } - ], - "scope": "static", - "summary": "Call a function in the future after waiting for a specified delay." - }, - "Meteor.settings": { - "filepath": "meteor/client_environment.js", - "kind": "member", - "lineno": 49, - "locus": "Anywhere", - "longname": "Meteor.settings", - "memberof": "Meteor", - "module": "meteor", - "name": "settings", - "scope": "static", - "summary": "`Meteor.settings` contains deployment-specific configuration options. You can initialize settings by passing the `--settings` option (which takes the name of a file containing JSON data) to `meteor run` or `meteor deploy`. When running your server directly (e.g. from a bundle), you instead specify settings by putting the JSON directly into the `METEOR_SETTINGS` environment variable. If the settings object contains a key named `public`, then `Meteor.settings.public` will be available on the client as well as the server. All other properties of `Meteor.settings` are only defined on the server. You can rely on `Meteor.settings` and `Meteor.settings.public` being defined objects (not undefined) on both client and server even if there are no settings specified. Changes to `Meteor.settings.public` at runtime will be picked up by new client connections.", - "type": { - "names": [ - "Object" - ] - } - }, - "Meteor.startup": { - "filepath": "meteor/startup_client.js", - "kind": "function", - "lineno": 70, - "locus": "Anywhere", - "longname": "Meteor.startup", - "memberof": "Meteor", - "module": "meteor", - "name": "startup", - "options": [], - "params": [ - { - "description": "

A function to run on startup.

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Run code when a client or a server starts." - }, - "Meteor.status": { - "filepath": "ddp-client/livedata_connection.js", - "importfrompackage": "meteor", - "kind": "function", - "lineno": 1042, - "locus": "Client", - "longname": "Meteor.status", - "memberof": "Meteor", - "module": "meteor", - "name": "status", - "options": [], - "params": [], - "scope": "static", - "summary": "Get the current connection status. A reactive data source." - }, - "Meteor.subscribe": { - "filepath": "ddp-client/livedata_connection.js", - "importfrompackage": "meteor", - "kind": "function", - "lineno": 521, - "locus": "Client", - "longname": "Meteor.subscribe", - "memberof": "Meteor", - "module": "meteor", - "name": "subscribe", - "options": [], - "params": [ - { - "description": "

Name of the subscription. Matches the name of the\nserver's publish() call.

", - "name": "name", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional arguments passed to publisher\nfunction on server.

", - "name": "arg1, arg2...", - "optional": true, - "type": { - "names": [ - "EJSONable" - ] - } - }, - { - "description": "

Optional. May include onStop\nand onReady callbacks. If there is an error, it is passed as an\nargument to onStop. If a function is passed instead of an object, it\nis interpreted as an onReady callback.

", - "name": "callbacks", - "optional": true, - "type": { - "names": [ - "function", - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Subscribe to a record set. Returns a handle that provides\n`stop()` and `ready()` methods." - }, - "Meteor.user": { - "filepath": "accounts-base/accounts_common.js", - "importfrompackage": "meteor", - "kind": "function", - "lineno": 231, - "locus": "Anywhere but publish functions", - "longname": "Meteor.user", - "memberof": "Meteor", - "module": "meteor", - "name": "user", - "options": [], - "params": [], - "scope": "static", - "summary": "Get the current user record, or `null` if no user is logged in. A reactive data source." - }, - "Meteor.userId": { - "filepath": "accounts-base/accounts_common.js", - "importfrompackage": "meteor", - "kind": "function", - "lineno": 222, - "locus": "Anywhere but publish functions", - "longname": "Meteor.userId", - "memberof": "Meteor", - "module": "meteor", - "name": "userId", - "options": [], - "params": [], - "scope": "static", - "summary": "Get the current user id, or `null` if no user is logged in. A reactive data source." - }, - "Meteor.users": { - "filepath": "accounts-base/server_main.js", - "importfrompackage": "meteor", - "kind": "member", - "lineno": 21, - "locus": "Anywhere", - "longname": "Meteor.users", - "memberof": "Meteor", - "module": "meteor", - "name": "users", - "scope": "static", - "summary": "A [Mongo.Collection](#collections) containing user documents.", - "type": { - "names": [ - "Mongo.Collection" - ] - } - }, - "Meteor.wrapAsync": { - "filepath": "meteor/helpers.js", - "kind": "function", - "lineno": 90, - "locus": "Anywhere", - "longname": "Meteor.wrapAsync", - "memberof": "Meteor", - "module": "meteor", - "name": "wrapAsync", - "options": [], - "params": [ - { - "description": "

A function that takes a callback as its final parameter

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - }, - { - "description": "

Optional this object against which the original function will be invoked

", - "name": "context", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Wrap a function that takes a callback function as its final parameter. The signature of the callback of the wrapped function should be `function(error, result){}`. On the server, the wrapped function can be used either synchronously (without passing a callback) or asynchronously (when a callback is passed). On the client, a callback is always required; errors will be logged if there is no callback. If a callback is provided, the environment captured when the original function was called will be restored in the callback." - }, - "Mongo": { - "filepath": "mongo/collection.js", - "kind": "namespace", - "lineno": 8, - "longname": "Mongo", - "module": "mongo", - "name": "Mongo", - "scope": "global", - "summary": "Namespace for MongoDB-related items" - }, - "Mongo.Collection": { - "filepath": "mongo/collection.js", - "instancename": "collection", - "kind": "class", - "lineno": 26, - "locus": "Anywhere", - "longname": "Mongo.Collection", - "memberof": "Mongo", - "module": "mongo", - "name": "Collection", - "options": [ - { - "description": "

The server connection that will manage this collection. Uses the default connection if not specified. Pass the return value of calling DDP.connect to specify a different server. Pass null to specify no connection. Unmanaged (name is null) collections cannot specify a connection.

", - "name": "connection", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

The method of generating the _id fields of new documents in this collection. Possible values:

\n\n

The default id generation technique is 'STRING'.

", - "name": "idGeneration", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

An optional transformation function. Documents will be passed through this function before being returned from fetch or findOne, and before being passed to callbacks of observe, map, forEach, allow, and deny. Transforms are not applied for the callbacks of observeChanges or to cursors returned from publish functions.

", - "name": "transform", - "type": { - "names": [ - "function" - ] - } - } - ], - "params": [ - { - "description": "

The name of the collection. If null, creates an unmanaged (unsynchronized) local collection.

", - "name": "name", - "type": { - "names": [ - "String" - ] - } - }, - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Constructor for a Collection" - }, - "Mongo.Collection#allow": { - "filepath": "allow-deny/allow-deny.js", - "kind": "function", - "lineno": 43, - "locus": "Server", - "longname": "Mongo.Collection#allow", - "memberof": "Mongo.Collection", - "module": "allow-deny", - "name": "allow", - "options": [ - { - "description": "

Functions that look at a proposed modification to the database and return true if it should be allowed.

", - "name": "insert, update, remove", - "type": { - "names": [ - "function" - ] - } - }, - { - "description": "

Optional performance enhancement. Limits the fields that will be fetched from the database for inspection by your update and remove functions.

", - "name": "fetch", - "type": { - "names": [ - "Array." - ] - } - }, - { - "description": "

Overrides transform on the Collection. Pass null to disable transformation.

", - "name": "transform", - "type": { - "names": [ - "function" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Allow users to write directly to this collection from client code, subject to limitations you define." - }, - "Mongo.Collection#deny": { - "filepath": "allow-deny/allow-deny.js", - "kind": "function", - "lineno": 58, - "locus": "Server", - "longname": "Mongo.Collection#deny", - "memberof": "Mongo.Collection", - "module": "allow-deny", - "name": "deny", - "options": [ - { - "description": "

Functions that look at a proposed modification to the database and return true if it should be denied, even if an allow rule says otherwise.

", - "name": "insert, update, remove", - "type": { - "names": [ - "function" - ] - } - }, - { - "description": "

Optional performance enhancement. Limits the fields that will be fetched from the database for inspection by your update and remove functions.

", - "name": "fetch", - "type": { - "names": [ - "Array." - ] - } - }, - { - "description": "

Overrides transform on the Collection. Pass null to disable transformation.

", - "name": "transform", - "type": { - "names": [ - "function" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Override `allow` rules." - }, - "Mongo.Collection#find": { - "filepath": "mongo/collection.js", - "kind": "function", - "lineno": 269, - "locus": "Anywhere", - "longname": "Mongo.Collection#find", - "memberof": "Mongo.Collection", - "module": "mongo", - "name": "find", - "options": [ - { - "description": "

Sort order (default: natural order)

", - "name": "sort", - "type": { - "names": [ - "MongoSortSpecifier" - ] - } - }, - { - "description": "

Number of results to skip at the beginning

", - "name": "skip", - "type": { - "names": [ - "Number" - ] - } - }, - { - "description": "

Maximum number of results to return

", - "name": "limit", - "type": { - "names": [ - "Number" - ] - } - }, - { - "description": "

Dictionary of fields to return or exclude.

", - "name": "fields", - "type": { - "names": [ - "MongoFieldSpecifier" - ] - } - }, - { - "description": "

(Client only) Default true; pass false to disable reactivity

", - "name": "reactive", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

Overrides transform on the Collection for this cursor. Pass null to disable transformation.

", - "name": "transform", - "type": { - "names": [ - "function" - ] - } - }, - { - "description": "

(Server only) Pass true to disable oplog-tailing on this query. This affects the way server processes calls to observe on this query. Disabling the oplog can be useful when working with data that updates in large batches.

", - "name": "disableOplog", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

(Server only) How often to poll this query when observing on the server. In milliseconds. Defaults to 10 seconds.

", - "name": "pollingIntervalMs", - "type": { - "names": [ - "Number" - ] - } - }, - { - "description": "

(Server only) Minimum time to allow between re-polling. Increasing this will save CPU and mongo load at the expense of slower updates to users. Decreasing this is not recommended. In milliseconds. Defaults to 50 milliseconds.

", - "name": "pollingThrottleMs", - "type": { - "names": [ - "Number" - ] - } - } - ], - "params": [ - { - "description": "

A query describing the documents to find

", - "name": "selector", - "optional": true, - "type": { - "names": [ - "MongoSelector" - ] - } - }, - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - } - ], - "returns": [ - { - "type": { - "names": [ - "Mongo.Cursor" - ] - } - } - ], - "scope": "instance", - "summary": "Find the documents in a collection that match the selector." - }, - "Mongo.Collection#findOne": { - "filepath": "mongo/collection.js", - "kind": "function", - "lineno": 298, - "locus": "Anywhere", - "longname": "Mongo.Collection#findOne", - "memberof": "Mongo.Collection", - "module": "mongo", - "name": "findOne", - "options": [ - { - "description": "

Sort order (default: natural order)

", - "name": "sort", - "type": { - "names": [ - "MongoSortSpecifier" - ] - } - }, - { - "description": "

Number of results to skip at the beginning

", - "name": "skip", - "type": { - "names": [ - "Number" - ] - } - }, - { - "description": "

Dictionary of fields to return or exclude.

", - "name": "fields", - "type": { - "names": [ - "MongoFieldSpecifier" - ] - } - }, - { - "description": "

(Client only) Default true; pass false to disable reactivity

", - "name": "reactive", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

Overrides transform on the Collection for this cursor. Pass null to disable transformation.

", - "name": "transform", - "type": { - "names": [ - "function" - ] - } - } - ], - "params": [ - { - "description": "

A query describing the documents to find

", - "name": "selector", - "optional": true, - "type": { - "names": [ - "MongoSelector" - ] - } - }, - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - } - ], - "returns": [ - { - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Finds the first document that matches the selector, as ordered by sort and skip options." - }, - "Mongo.Collection#insert": { - "filepath": "mongo/collection.js", - "kind": "function", - "lineno": 437, - "locus": "Anywhere", - "longname": "Mongo.Collection#insert", - "memberof": "Mongo.Collection", - "module": "mongo", - "name": "insert", - "options": [], - "params": [ - { - "description": "

The document to insert. May not yet have an _id attribute, in which case Meteor will generate one for you.

", - "name": "doc", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Optional. If present, called with an error object as the first argument and, if no error, the _id as the second.

", - "name": "callback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Insert a document in the collection. Returns its unique _id." - }, - "Mongo.Collection#rawCollection": { - "filepath": "mongo/collection.js", - "kind": "function", - "lineno": 689, - "locus": "Server", - "longname": "Mongo.Collection#rawCollection", - "memberof": "Mongo.Collection", - "module": "mongo", - "name": "rawCollection", - "options": [], - "params": [], - "scope": "instance", - "summary": "Returns the [`Collection`](http://mongodb.github.io/node-mongodb-native/1.4/api-generated/collection.html) object corresponding to this collection from the [npm `mongodb` driver module](https://www.npmjs.com/package/mongodb) which is wrapped by `Mongo.Collection`." - }, - "Mongo.Collection#rawDatabase": { - "filepath": "mongo/collection.js", - "kind": "function", - "lineno": 701, - "locus": "Server", - "longname": "Mongo.Collection#rawDatabase", - "memberof": "Mongo.Collection", - "module": "mongo", - "name": "rawDatabase", - "options": [], - "params": [], - "scope": "instance", - "summary": "Returns the [`Db`](http://mongodb.github.io/node-mongodb-native/1.4/api-generated/db.html) object corresponding to this collection's database connection from the [npm `mongodb` driver module](https://www.npmjs.com/package/mongodb) which is wrapped by `Mongo.Collection`." - }, - "Mongo.Collection#remove": { - "filepath": "mongo/collection.js", - "kind": "function", - "lineno": 579, - "locus": "Anywhere", - "longname": "Mongo.Collection#remove", - "memberof": "Mongo.Collection", - "module": "mongo", - "name": "remove", - "options": [], - "params": [ - { - "description": "

Specifies which documents to remove

", - "name": "selector", - "type": { - "names": [ - "MongoSelector" - ] - } - }, - { - "description": "

Optional. If present, called with an error object as its argument.

", - "name": "callback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Remove documents from the collection" - }, - "Mongo.Collection#update": { - "filepath": "mongo/collection.js", - "kind": "function", - "lineno": 518, - "locus": "Anywhere", - "longname": "Mongo.Collection#update", - "memberof": "Mongo.Collection", - "module": "mongo", - "name": "update", - "options": [ - { - "description": "

True to modify all matching documents; false to only modify one of the matching documents (the default).

", - "name": "multi", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

True to insert a document if no matching documents are found.

", - "name": "upsert", - "type": { - "names": [ - "Boolean" - ] - } - } - ], - "params": [ - { - "description": "

Specifies which documents to modify

", - "name": "selector", - "type": { - "names": [ - "MongoSelector" - ] - } - }, - { - "description": "

Specifies how to modify the documents

", - "name": "modifier", - "type": { - "names": [ - "MongoModifier" - ] - } - }, - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Optional. If present, called with an error object as the first argument and, if no error, the number of affected documents as the second.

", - "name": "callback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Modify one or more documents in the collection. Returns the number of affected documents." - }, - "Mongo.Collection#upsert": { - "filepath": "mongo/collection.js", - "kind": "function", - "lineno": 643, - "locus": "Anywhere", - "longname": "Mongo.Collection#upsert", - "memberof": "Mongo.Collection", - "module": "mongo", - "name": "upsert", - "options": [ - { - "description": "

True to modify all matching documents; false to only modify one of the matching documents (the default).

", - "name": "multi", - "type": { - "names": [ - "Boolean" - ] - } - } - ], - "params": [ - { - "description": "

Specifies which documents to modify

", - "name": "selector", - "type": { - "names": [ - "MongoSelector" - ] - } - }, - { - "description": "

Specifies how to modify the documents

", - "name": "modifier", - "type": { - "names": [ - "MongoModifier" - ] - } - }, - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Optional. If present, called with an error object as the first argument and, if no error, the number of affected documents as the second.

", - "name": "callback", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Modify one or more documents in the collection, or insert one if no matching documents were found. Returns an object with keys `numberAffected` (the number of documents modified) and `insertedId` (the unique _id of the document that was inserted, if any)." - }, - "Mongo.Cursor": { - "filepath": "mongo/collection.js", - "instancename": "cursor", - "kind": "class", - "lineno": 723, - "longname": "Mongo.Cursor", - "memberof": "Mongo", - "module": "mongo", - "name": "Cursor", - "options": [], - "params": [], - "scope": "static", - "summary": "To create a cursor, use find. To access the documents in a cursor, use forEach, map, or fetch." - }, - "Mongo.Cursor#count": { - "filepath": "minimongo/minimongo.js", - "kind": "function", - "lineno": 216, - "locus": "Anywhere", - "longname": "Mongo.Cursor#count", - "memberof": "Mongo.Cursor", - "module": "minimongo", - "name": "count", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "Number" - ] - } - } - ], - "scope": "instance", - "summary": "Returns the number of documents that match a query." - }, - "Mongo.Cursor#fetch": { - "filepath": "minimongo/minimongo.js", - "kind": "function", - "lineno": 199, - "locus": "Anywhere", - "longname": "Mongo.Cursor#fetch", - "memberof": "Mongo.Cursor", - "module": "minimongo", - "name": "fetch", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "Array." - ] - } - } - ], - "scope": "instance", - "summary": "Return all matching documents as an Array." - }, - "Mongo.Cursor#forEach": { - "filepath": "minimongo/minimongo.js", - "kind": "function", - "lineno": 145, - "locus": "Anywhere", - "longname": "Mongo.Cursor#forEach", - "memberof": "Mongo.Cursor", - "module": "minimongo", - "name": "forEach", - "options": [], - "params": [ - { - "description": "

Function to call. It will be called with three arguments: the document, a 0-based index, and cursor itself.

", - "name": "callback", - "type": { - "names": [ - "IterationCallback" - ] - } - }, - { - "description": "

An object which will be the value of this inside callback.

", - "name": "thisArg", - "optional": true, - "type": { - "names": [ - "Any" - ] - } - } - ], - "scope": "instance", - "summary": "Call `callback` once for each matching document, sequentially and synchronously." - }, - "Mongo.Cursor#map": { - "filepath": "minimongo/minimongo.js", - "kind": "function", - "lineno": 181, - "locus": "Anywhere", - "longname": "Mongo.Cursor#map", - "memberof": "Mongo.Cursor", - "module": "minimongo", - "name": "map", - "options": [], - "params": [ - { - "description": "

Function to call. It will be called with three arguments: the document, a 0-based index, and cursor itself.

", - "name": "callback", - "type": { - "names": [ - "IterationCallback" - ] - } - }, - { - "description": "

An object which will be the value of this inside callback.

", - "name": "thisArg", - "optional": true, - "type": { - "names": [ - "Any" - ] - } - } - ], - "scope": "instance", - "summary": "Map callback over all matching documents. Returns an Array." - }, - "Mongo.Cursor#observe": { - "filepath": "minimongo/minimongo.js", - "kind": "function", - "lineno": 303, - "locus": "Anywhere", - "longname": "Mongo.Cursor#observe", - "memberof": "Mongo.Cursor", - "module": "minimongo", - "name": "observe", - "options": [], - "params": [ - { - "description": "

Functions to call to deliver the result set as it changes

", - "name": "callbacks", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Watch a query. Receive callbacks as the result set changes." - }, - "Mongo.Cursor#observeChanges": { - "filepath": "minimongo/minimongo.js", - "kind": "function", - "lineno": 315, - "locus": "Anywhere", - "longname": "Mongo.Cursor#observeChanges", - "memberof": "Mongo.Cursor", - "module": "minimongo", - "name": "observeChanges", - "options": [], - "params": [ - { - "description": "

Functions to call to deliver the result set as it changes

", - "name": "callbacks", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Watch a query. Receive callbacks as the result set changes. Only the differences between the old and new documents are passed to the callbacks." - }, - "Mongo.ObjectID": { - "filepath": "mongo/collection.js", - "kind": "class", - "lineno": 716, - "locus": "Anywhere", - "longname": "Mongo.ObjectID", - "memberof": "Mongo", - "module": "mongo", - "name": "ObjectID", - "options": [], - "params": [ - { - "description": "

Optional. The 24-character hexadecimal contents of the ObjectID to create

", - "name": "hexString", - "optional": true, - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "static", - "summary": "Create a Mongo-style `ObjectID`. If you don't specify a `hexString`, the `ObjectID` will generated randomly (not using MongoDB's ID construction rules)." - }, - "Npm": { - "kind": "namespace", - "longname": "Npm", - "name": "Npm", - "scope": "global", - "summary": "The Npm object in package.js and package source files." - }, - "Npm.depends": { - "kind": "function", - "locus": "package.js", - "longname": "Npm.depends", - "memberof": "Npm", - "name": "depends", - "options": [], - "params": [ - { - "description": "

An object where the keys are package\nnames and the values are one of:

\n
    \n
  1. Version numbers in string form
  2. \n
  3. Http(s) URLs to a git commit by SHA.
  4. \n
  5. Git URLs in the format described here
  6. \n
\n

Https URL example:

\n
Npm.depends({\n  moment: "2.8.3",\n  async: "https://github.com/caolan/async/archive/71fa2638973dafd8761fa5457c472a312cc820fe.tar.gz"\n});

Git URL example:

\n
Npm.depends({\n  moment: "2.8.3",\n  async: "git+https://github.com/caolan/async#master"\n});
", - "name": "dependencies", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Specify which [NPM](https://www.npmjs.org/) packages\nyour Meteor package depends on." - }, - "Npm.require": { - "kind": "function", - "locus": "Server", - "longname": "Npm.require", - "memberof": "Npm", - "name": "require", - "options": [], - "params": [ - { - "description": "

The name of the package to require.

", - "name": "name", - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "static", - "summary": "Require a package that was specified using\n`Npm.depends()`." - }, - "Package": { - "kind": "namespace", - "locus": "package.js", - "longname": "Package", - "name": "Package", - "scope": "global", - "summary": "The Package object in package.js" - }, - "Package.describe": { - "kind": "function", - "locus": "package.js", - "longname": "Package.describe", - "memberof": "Package", - "name": "describe", - "options": [ - { - "description": "

A concise 1-2 sentence description of\nthe package, required for publication.

", - "name": "summary", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The (extended)\nsemver version for your package. Additionally,\nMeteor allows a wrap number: a positive integer that follows the\nversion number. If you are porting another package that uses semver\nversioning, you may want to use the original version, postfixed with\n_wrapnumber. For example, 1.2.3_1 or 2.4.5-rc1_4. Wrap numbers\nsort after the original numbers: 1.2.3 < 1.2.3_1 < 1.2.3_2 <\n1.2.4-rc.0. If no version is specified, this field defaults to\n0.0.0. If you want to publish your package to the package server, you\nmust specify a version.

", - "name": "version", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional name override. By default, the\npackage name comes from the name of its directory.

", - "name": "name", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional Git URL to the source repository.

", - "name": "git", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional Filepath to\ndocumentation. Set to 'README.md' by default. Set this to null to submit\nno documentation.

", - "name": "documentation", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

A package with this flag set to true\nwill not be bundled into production builds. This is useful for packages\nmeant to be used in development only.

", - "name": "debugOnly", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

A package with this flag set to true\nwill ONLY be bundled into production builds.

", - "name": "prodOnly", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

A package with this flag set to true\nwill ONLY be bundled as part of meteor test.

", - "name": "testOnly", - "type": { - "names": [ - "Boolean" - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Provide basic package information." - }, - "Package.onTest": { - "kind": "function", - "locus": "package.js", - "longname": "Package.onTest", - "memberof": "Package", - "name": "onTest", - "options": [], - "params": [ - { - "description": "

A function that takes in the package control 'api' object, which keeps track of dependencies and exports.

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Define dependencies and expose package methods for unit tests." - }, - "Package.onUse": { - "kind": "function", - "locus": "package.js", - "longname": "Package.onUse", - "memberof": "Package", - "name": "onUse", - "options": [], - "params": [ - { - "description": "

A function that takes in the package control api object, which keeps track of dependencies and exports.

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Define package dependencies and expose package methods." - }, - "Package.registerBuildPlugin": { - "kind": "function", - "locus": "package.js", - "longname": "Package.registerBuildPlugin", - "memberof": "Package", - "name": "registerBuildPlugin", - "options": [ - { - "description": "

A cosmetic name, must be unique in the\npackage.

", - "name": "name", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Meteor packages that this\nplugin uses, independent of the packages specified in\napi.onUse.

", - "name": "use", - "type": { - "names": [ - "String", - "Array." - ] - } - }, - { - "description": "

The source files that make up the\nbuild plugin, independent from api.addFiles.

", - "name": "sources", - "type": { - "names": [ - "Array." - ] - } - }, - { - "description": "

An object where the keys\nare NPM package names, and the values are the version numbers of\nrequired NPM packages, just like in Npm.depends.

", - "name": "npmDependencies", - "type": { - "names": [ - "Object" - ] - } - } - ], - "params": [ - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Define a build plugin. A build plugin extends the build\nprocess for apps and packages that use this package. For example,\nthe `coffeescript` package uses a build plugin to compile CoffeeScript\nsource files into JavaScript." - }, - "PackageAPI": { - "instancename": "api", - "kind": "class", - "longname": "PackageAPI", - "name": "PackageAPI", - "options": [], - "params": [], - "scope": "global", - "summary": "Type of the API object passed into the `Package.onUse` function." - }, - "PackageAPI#addAssets": { - "kind": "function", - "locus": "package.js", - "longname": "PackageAPI#addAssets", - "memberof": "PackageAPI", - "name": "addAssets", - "options": [], - "params": [ - { - "description": "

Paths to the asset files.

", - "name": "filenames", - "type": { - "names": [ - "String", - "Array." - ] - } - }, - { - "description": "

Specify where this asset should be\navailable (e.g., 'server', 'client', 'web.browser', 'web.cordova'). You can\nspecify multiple architectures by passing in an array, for example\n['web.cordova', 'os.linux'].

", - "name": "architecture", - "type": { - "names": [ - "String", - "Array." - ] - } - } - ], - "scope": "instance", - "summary": "Specify asset files for your package. They can be accessed via\nthe [Assets API](#assets) from the server, or at the URL\n`/packages/username_package-name/file-name` from the client, depending on the\narchitecture passed." - }, - "PackageAPI#addFiles": { - "kind": "function", - "locus": "package.js", - "longname": "PackageAPI#addFiles", - "memberof": "PackageAPI", - "name": "addFiles", - "options": [ - { - "description": "

If this file is JavaScript code or will\nbe compiled into JavaScript code by a build plugin, don't wrap the\nresulting file in a closure. Has the same effect as putting a file into the\nclient/compatibility directory in an app.

", - "name": "bare", - "optional": true, - "type": { - "names": [ - "Boolean" - ] - } - } - ], - "params": [ - { - "description": "

Paths to the source files.

", - "name": "filenames", - "type": { - "names": [ - "String", - "Array." - ] - } - }, - { - "description": "

If you only want to use the file\non the server (or the client), you can pass this argument\n(e.g., 'server', 'client', 'web.browser', 'web.cordova') to specify\nwhat architecture the file is used with. You can specify multiple\narchitectures by passing in an array, for example\n['web.cordova', 'os.linux']. By default, the file will be loaded on both\nserver and client.

", - "name": "architecture", - "optional": true, - "type": { - "names": [ - "String", - "Array." - ] - } - }, - { - "description": "

Options that will be passed to build\nplugins.

", - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Specify source code files for your package." - }, - "PackageAPI#export": { - "kind": "function", - "locus": "package.js", - "longname": "PackageAPI#export", - "memberof": "PackageAPI", - "name": "export", - "options": [], - "params": [ - { - "description": "

Name of the object to export, or\nan array of object names.

", - "name": "exportedObjects", - "type": { - "names": [ - "String", - "Array." - ] - } - }, - { - "description": "

If you only want to export the\nobject on the server (or the client), you can pass in the second argument\n(e.g., 'server', 'client', 'web.browser', 'web.cordova') to specify what\narchitecture the export is used with. You can specify multiple\narchitectures by passing in an array, for example ['web.cordova',\n'os.linux'].

", - "name": "architecture", - "optional": true, - "type": { - "names": [ - "String", - "Array." - ] - } - }, - { - "name": "exportOptions", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

If true, this symbol will only be\nexported when running tests for this package.

", - "name": "exportOptions.testOnly", - "type": { - "names": [ - "Boolean" - ] - } - } - ], - "scope": "instance", - "summary": "Export package-level variables in your package. The specified\nvariables (declared without `var` in the source code) will be available\nto packages that use your package. If your package sets the `debugOnly`,\n`prodOnly` or `testOnly` options to `true` when it calls\n`Package.describe()`, then packages that use your package will need to use\n`Package[\"package-name\"].ExportedVariableName` to access the value of an\nexported variable." - }, - "PackageAPI#imply": { - "kind": "function", - "locus": "package.js", - "longname": "PackageAPI#imply", - "memberof": "PackageAPI", - "name": "imply", - "options": [], - "params": [ - { - "description": "

Name of a package, or array of\npackage names, with an optional @version component for each.

", - "name": "packageNames", - "type": { - "names": [ - "String", - "Array." - ] - } - }, - { - "description": "

If you only use the package on\nthe server (or the client), you can pass in the second argument (e.g.,\n'server', 'client', 'web.browser', 'web.cordova') to specify what\narchitecture the package is used with. You can specify multiple\narchitectures by passing in an array, for example ['web.cordova',\n'os.linux'].

", - "name": "architecture", - "optional": true, - "type": { - "names": [ - "String", - "Array." - ] - } - } - ], - "scope": "instance", - "summary": "Give users of this package access to another package (by passing\nin the string `packagename`) or a collection of packages (by passing in\nan array of strings [`packagename1`, `packagename2`]" - }, - "PackageAPI#use": { - "kind": "function", - "locus": "package.js", - "longname": "PackageAPI#use", - "memberof": "PackageAPI", - "name": "use", - "options": [ - { - "description": "

Establish a weak dependency on a\npackage. If package A has a weak dependency on package B, it means\nthat including A in an app does not force B to be included too — but,\nif B is included or by another package, then B will load before A.\nYou can use this to make packages that optionally integrate with or\nenhance other packages if those packages are present.\nWhen you weakly depend on a package you don't see its exports.\nYou can detect if the possibly-present weakly-depended-on package\nis there by seeing if Package.foo exists, and get its exports\nfrom the same place.

", - "name": "weak", - "type": { - "names": [ - "Boolean" - ] - } - }, - { - "description": "

It's okay to load this dependency\nafter your package. (In general, dependencies specified by api.use\nare loaded before your package.) You can use this option to break\ncircular dependencies.

", - "name": "unordered", - "type": { - "names": [ - "Boolean" - ] - } - } - ], - "params": [ - { - "description": "

Packages being depended on.\nPackage names may be suffixed with an @version tag.

\n

In general, you must specify a package's version (e.g.,\n'accounts@1.0.0' to use version 1.0.0 or a higher\ncompatible version (ex: 1.0.1, 1.5.0, etc.) of the\naccounts package). If you are sourcing core\npackages from a Meteor release with versionsFrom, you may leave\noff version names for core packages. You may also specify constraints,\nsuch as my:forms@=1.0.0 (this package demands my:forms at 1.0.0 exactly),\nor my:forms@1.0.0 || =2.0.1 (my:forms at 1.x.y, or exactly 2.0.1).

", - "name": "packageNames", - "type": { - "names": [ - "String", - "Array." - ] - } - }, - { - "description": "

If you only use the package on the\nserver (or the client), you can pass in the second argument (e.g.,\n'server', 'client', 'web.browser', 'web.cordova') to specify\nwhat architecture the package is used with. You can specify multiple\narchitectures by passing in an array, for example ['web.cordova', 'os.linux'].

", - "name": "architecture", - "optional": true, - "type": { - "names": [ - "String", - "Array." - ] - } - }, - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Depend on package `packagename`." - }, - "PackageAPI#versionsFrom": { - "kind": "function", - "locus": "package.js", - "longname": "PackageAPI#versionsFrom", - "memberof": "PackageAPI", - "name": "versionsFrom", - "options": [], - "params": [ - { - "description": "

Specification of a release:\ntrack@version. Just 'version' (e.g. "0.9.0") is sufficient if using the\ndefault release track METEOR. Can be an array of specifications.

", - "name": "meteorRelease", - "type": { - "names": [ - "String", - "Array." - ] - } - } - ], - "scope": "instance", - "summary": "Use versions of core packages from a release. Unless provided,\nall packages will default to the versions released along with\n`meteorRelease`. This will save you from having to figure out the exact\nversions of the core packages you want to use. For example, if the newest\nrelease of meteor is `METEOR@0.9.0` and it includes `jquery@1.0.0`, you\ncan write `api.versionsFrom('METEOR@0.9.0')` in your package, and when you\nlater write `api.use('jquery')`, it will be equivalent to\n`api.use('jquery@1.0.0')`. You may specify an array of multiple releases,\nin which case the default value for constraints will be the \"or\" of the\nversions from each release: `api.versionsFrom(['METEOR@0.9.0',\n'METEOR@0.9.5'])` may cause `api.use('jquery')` to be interpreted as\n`api.use('jquery@1.0.0 || 2.0.0')`." - }, - "Plugin": { - "kind": "namespace", - "longname": "Plugin", - "name": "Plugin", - "scope": "global", - "summary": "The namespace that is exposed inside build plugin files." - }, - "Plugin.registerCompiler": { - "kind": "function", - "locus": "Build Plugin", - "longname": "Plugin.registerCompiler", - "memberof": "Plugin", - "name": "registerCompiler", - "options": [ - { - "description": "

The file extensions that this\nplugin should handle, without the first dot.\nExamples: ["coffee", "coffee.md"].

", - "name": "extensions", - "type": { - "names": [ - "Array." - ] - } - }, - { - "description": "

The list of filenames\nthat this plugin should handle. Examples: ["config.json"].

", - "name": "filenames", - "type": { - "names": [ - "Array." - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

A function that returns an instance\nof a compiler class.

\n

More detailed documentation for build plugins is available on the GitHub Wiki.

", - "name": "factory", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Inside a build plugin source file specified in\n[Package.registerBuildPlugin](#Package-registerBuildPlugin),\nadd a compiler that will handle files with certain extensions or\nfilenames." - }, - "Plugin.registerLinter": { - "kind": "function", - "locus": "Build Plugin", - "longname": "Plugin.registerLinter", - "memberof": "Plugin", - "name": "registerLinter", - "options": [ - { - "description": "

The file extensions that this\nplugin should handle, without the first dot.\nExamples: ["js", "es6", "jsx"].

", - "name": "extensions", - "type": { - "names": [ - "Array." - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

A function that returns an instance\nof a linter class.

\n

More detailed documentation for build plugins is available on the GitHub Wiki.

", - "name": "factory", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Inside a build plugin source file specified in\n[Package.registerBuildPlugin](#Package-registerBuildPlugin),\nadd a linter that will handle files with certain extensions or\nfilenames." - }, - "Plugin.registerMinifier": { - "kind": "function", - "locus": "Build Plugin", - "longname": "Plugin.registerMinifier", - "memberof": "Plugin", - "name": "registerMinifier", - "options": [ - { - "description": "

The file extensions that this\nplugin should handle, without the first dot. Can only be "js" or "css".\nExamples: ["js", "css"].

", - "name": "extensions", - "type": { - "names": [ - "Array." - ] - } - }, - { - "description": "

The list of filenames\nthat this plugin should handle. Examples: ["config.json"].

", - "name": "filenames", - "type": { - "names": [ - "Array." - ] - } - } - ], - "params": [ - { - "name": "options", - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

A function that returns an instance\nof a minifier class.

\n

More detailed documentation for build plugins is available on the GitHub Wiki.

", - "name": "factory", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Inside a build plugin source file specified in\n[Package.registerBuildPlugin](#Package-registerBuildPlugin),\nadd a linter that will handle files with certain extensions or\nfilenames." - }, - "Plugin.registerSourceHandler": { - "deprecated": "since 1.2\nXXX COMPAT WITH 1.1", - "kind": "function", - "locus": "Build Plugin", - "longname": "Plugin.registerSourceHandler", - "memberof": "Plugin", - "name": "registerSourceHandler", - "options": [], - "params": [ - { - "description": "

The file extension that this plugin\nshould handle, without the first dot.\nExamples: "coffee", "coffee.md".

", - "name": "fileExtension", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

A function that takes one argument,\na CompileStep object.

\n

Documentation for CompileStep is available on the GitHub Wiki.

", - "name": "handler", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Inside a build plugin source file specified in\n[Package.registerBuildPlugin](#Package-registerBuildPlugin),\nadd a handler to compile files with a certain file extension." - }, - "ReactiveVar": { - "filepath": "reactive-var/reactive-var.js", - "instancename": "reactiveVar", - "kind": "class", - "lineno": 37, - "locus": "Client", - "longname": "ReactiveVar", - "module": "reactive-var", - "name": "ReactiveVar", - "options": [], - "params": [ - { - "description": "

The initial value to set. equalsFunc is ignored when setting the initial value.

", - "name": "initialValue", - "type": { - "names": [ - "Any" - ] - } - }, - { - "description": "

Optional. A function of two arguments, called on the old value and the new value whenever the ReactiveVar is set. If it returns true, no set is performed. If omitted, the default equalsFunc returns true if its arguments are === and are of type number, boolean, string, undefined, or null.

", - "name": "equalsFunc", - "optional": true, - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "global", - "summary": "Constructor for a ReactiveVar, which represents a single reactive variable." - }, - "ReactiveVar#get": { - "filepath": "reactive-var/reactive-var.js", - "kind": "function", - "lineno": 62, - "locus": "Client", - "longname": "ReactiveVar#get", - "memberof": "ReactiveVar", - "module": "reactive-var", - "name": "get", - "options": [], - "params": [], - "scope": "instance", - "summary": "Returns the current value of the ReactiveVar, establishing a reactive dependency." - }, - "ReactiveVar#set": { - "filepath": "reactive-var/reactive-var.js", - "kind": "function", - "lineno": 74, - "locus": "Client", - "longname": "ReactiveVar#set", - "memberof": "ReactiveVar", - "module": "reactive-var", - "name": "set", - "options": [], - "params": [ - { - "name": "newValue", - "type": { - "names": [ - "Any" - ] - } - } - ], - "scope": "instance", - "summary": "Sets the current value of the ReactiveVar, invalidating the Computations that called `get` if `newValue` is different from the old value." - }, - "Session.equals": { - "filepath": "session/session.js", - "kind": "function", - "lineno": 41, - "locus": "Client", - "longname": "Session.equals", - "memberof": "Session", - "module": "session", - "name": "equals", - "options": [], - "params": [ - { - "description": "

The name of the session variable to test

", - "name": "key", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The value to\ntest against

", - "name": "value", - "type": { - "names": [ - "String", - "Number", - "Boolean", - "null", - "undefined" - ] - } - } - ], - "scope": "static", - "summary": "Test if a session variable is equal to a value. If inside a\n[reactive computation](#reactivity), invalidate the computation the next\ntime the variable changes to or from the value." - }, - "Session.get": { - "filepath": "session/session.js", - "kind": "function", - "lineno": 28, - "locus": "Client", - "longname": "Session.get", - "memberof": "Session", - "module": "session", - "name": "get", - "options": [], - "params": [ - { - "description": "

The name of the session variable to return

", - "name": "key", - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "static", - "summary": "Get the value of a session variable. If inside a [reactive\ncomputation](#reactivity), invalidate the computation the next time the\nvalue of the variable is changed by [`Session.set`](#session_set). This\nreturns a clone of the session value, so if it's an object or an array,\nmutating the returned value has no effect on the value stored in the\nsession." - }, - "Session.set": { - "filepath": "session/session.js", - "kind": "function", - "lineno": 6, - "locus": "Client", - "longname": "Session.set", - "memberof": "Session", - "module": "session", - "name": "set", - "options": [], - "params": [ - { - "description": "

The key to set, eg, selectedItem

", - "name": "key", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The new value for key

", - "name": "value", - "type": { - "names": [ - "EJSONable", - "undefined" - ] - } - } - ], - "scope": "static", - "summary": "Set a variable in the session. Notify any listeners that the value\nhas changed (eg: redraw templates, and rerun any\n[`Tracker.autorun`](#tracker_autorun) computations, that called\n[`Session.get`](#session_get) on this `key`.)" - }, - "Session.setDefault": { - "filepath": "session/session.js", - "kind": "function", - "lineno": 18, - "locus": "Client", - "longname": "Session.setDefault", - "memberof": "Session", - "module": "session", - "name": "setDefault", - "options": [], - "params": [ - { - "description": "

The key to set, eg, selectedItem

", - "name": "key", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The new value for key

", - "name": "value", - "type": { - "names": [ - "EJSONable", - "undefined" - ] - } - } - ], - "scope": "static", - "summary": "Set a variable in the session if it hasn't been set before.\nOtherwise works exactly the same as [`Session.set`](#session_set)." - }, - "Subscription": { - "filepath": "ddp-server/livedata_server.js", - "instancename": "this", - "kind": "class", - "lineno": 936, - "longname": "Subscription", - "module": "ddp-server", - "name": "Subscription", - "options": [], - "params": [], - "scope": "global", - "summary": "The server's side of a subscription" - }, - "Subscription#added": { - "filepath": "ddp-server/livedata_server.js", - "kind": "function", - "lineno": 1230, - "locus": "Server", - "longname": "Subscription#added", - "memberof": "Subscription", - "module": "ddp-server", - "name": "added", - "options": [], - "params": [ - { - "description": "

The name of the collection that contains the new document.

", - "name": "collection", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The new document's ID.

", - "name": "id", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The fields in the new document. If _id is present it is ignored.

", - "name": "fields", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Call inside the publish function. Informs the subscriber that a document has been added to the record set." - }, - "Subscription#changed": { - "filepath": "ddp-server/livedata_server.js", - "kind": "function", - "lineno": 1248, - "locus": "Server", - "longname": "Subscription#changed", - "memberof": "Subscription", - "module": "ddp-server", - "name": "changed", - "options": [], - "params": [ - { - "description": "

The name of the collection that contains the changed document.

", - "name": "collection", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The changed document's ID.

", - "name": "id", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The fields in the document that have changed, together with their new values. If a field is not present in fields it was left unchanged; if it is present in fields and has a value of undefined it was removed from the document. If _id is present it is ignored.

", - "name": "fields", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Call inside the publish function. Informs the subscriber that a document in the record set has been modified." - }, - "Subscription#connection": { - "filepath": "ddp-server/livedata_server.js", - "kind": "member", - "lineno": 946, - "locus": "Server", - "longname": "Subscription#connection", - "memberof": "Subscription", - "module": "ddp-server", - "name": "connection", - "scope": "instance", - "summary": "Access inside the publish function. The incoming [connection](#meteor_onconnection) for this subscription." - }, - "Subscription#error": { - "filepath": "ddp-server/livedata_server.js", - "kind": "function", - "lineno": 1173, - "locus": "Server", - "longname": "Subscription#error", - "memberof": "Subscription", - "module": "ddp-server", - "name": "error", - "options": [], - "params": [ - { - "description": "

The error to pass to the client.

", - "name": "error", - "type": { - "names": [ - "Error" - ] - } - } - ], - "scope": "instance", - "summary": "Call inside the publish function. Stops this client's subscription, triggering a call on the client to the `onStop` callback passed to [`Meteor.subscribe`](#meteor_subscribe), if any. If `error` is not a [`Meteor.Error`](#meteor_error), it will be [sanitized](#meteor_error)." - }, - "Subscription#onStop": { - "filepath": "ddp-server/livedata_server.js", - "kind": "function", - "lineno": 1205, - "locus": "Server", - "longname": "Subscription#onStop", - "memberof": "Subscription", - "module": "ddp-server", - "name": "onStop", - "options": [], - "params": [ - { - "description": "

The callback function

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Call inside the publish function. Registers a callback function to run when the subscription is stopped." - }, - "Subscription#ready": { - "filepath": "ddp-server/livedata_server.js", - "kind": "function", - "lineno": 1281, - "locus": "Server", - "longname": "Subscription#ready", - "memberof": "Subscription", - "module": "ddp-server", - "name": "ready", - "options": [], - "params": [], - "scope": "instance", - "summary": "Call inside the publish function. Informs the subscriber that an initial, complete snapshot of the record set has been sent. This will trigger a call on the client to the `onReady` callback passed to [`Meteor.subscribe`](#meteor_subscribe), if any." - }, - "Subscription#removed": { - "filepath": "ddp-server/livedata_server.js", - "kind": "function", - "lineno": 1264, - "locus": "Server", - "longname": "Subscription#removed", - "memberof": "Subscription", - "module": "ddp-server", - "name": "removed", - "options": [], - "params": [ - { - "description": "

The name of the collection that the document has been removed from.

", - "name": "collection", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The ID of the document that has been removed.

", - "name": "id", - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "instance", - "summary": "Call inside the publish function. Informs the subscriber that a document has been removed from the record set." - }, - "Subscription#stop": { - "filepath": "ddp-server/livedata_server.js", - "kind": "function", - "lineno": 1191, - "locus": "Server", - "longname": "Subscription#stop", - "memberof": "Subscription", - "module": "ddp-server", - "name": "stop", - "options": [], - "params": [], - "scope": "instance", - "summary": "Call inside the publish function. Stops this client's subscription and invokes the client's `onStop` callback with no error." - }, - "Subscription#userId": { - "filepath": "ddp-server/livedata_server.js", - "kind": "member", - "lineno": 988, - "locus": "Server", - "longname": "Subscription#userId", - "memberof": "Subscription", - "module": "ddp-server", - "name": "userId", - "scope": "instance", - "summary": "Access inside the publish function. The id of the logged-in user, or `null` if no user is logged in." - }, - "Template": { - "filepath": "templating/templating.js", - "instancename": "Template.myTemplate", - "kind": "class", - "lineno": 9, - "longname": "Template", - "module": "templating", - "name": "Template", - "options": [], - "params": [], - "scope": "global", - "summary": "The class for defining templates" - }, - "Template#created": { - "deprecated": "in 1.1", - "filepath": "blaze/template.js", - "kind": "member", - "lineno": 182, - "locus": "Client", - "longname": "Template#created", - "memberof": "Template", - "module": "blaze", - "name": "created", - "scope": "instance", - "summary": "Provide a callback when an instance of a template is created." - }, - "Template#destroyed": { - "deprecated": "in 1.1", - "filepath": "blaze/template.js", - "kind": "member", - "lineno": 211, - "locus": "Client", - "longname": "Template#destroyed", - "memberof": "Template", - "module": "blaze", - "name": "destroyed", - "scope": "instance", - "summary": "Provide a callback when an instance of a template is destroyed." - }, - "Template#events": { - "filepath": "blaze/template.js", - "importfrompackage": "templating", - "kind": "function", - "lineno": 477, - "locus": "Client", - "longname": "Template#events", - "memberof": "Template", - "module": "templating", - "name": "events", - "options": [], - "params": [ - { - "description": "

Event handlers to associate with this template.

", - "name": "eventMap", - "type": { - "names": [ - "EventMap" - ] - } - } - ], - "scope": "instance", - "summary": "Specify event handlers for this template." - }, - "Template#helpers": { - "filepath": "blaze/template.js", - "importfrompackage": "templating", - "kind": "function", - "lineno": 443, - "locus": "Client", - "longname": "Template#helpers", - "memberof": "Template", - "module": "templating", - "name": "helpers", - "options": [], - "params": [ - { - "description": "

Dictionary of helper functions by name.

", - "name": "helpers", - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "instance", - "summary": "Specify template helpers available to this template." - }, - "Template#onCreated": { - "filepath": "blaze/template.js", - "importfrompackage": "templating", - "kind": "member", - "lineno": 65, - "locus": "Client", - "longname": "Template#onCreated", - "memberof": "Template", - "module": "templating", - "name": "onCreated", - "params": [ - { - "description": "

A function to be added as a callback.

", - "name": "callback", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Register a function to be called when an instance of this template is created." - }, - "Template#onDestroyed": { - "filepath": "blaze/template.js", - "importfrompackage": "templating", - "kind": "member", - "lineno": 91, - "locus": "Client", - "longname": "Template#onDestroyed", - "memberof": "Template", - "module": "templating", - "name": "onDestroyed", - "params": [ - { - "description": "

A function to be added as a callback.

", - "name": "callback", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Register a function to be called when an instance of this template is removed from the DOM and destroyed." - }, - "Template#onRendered": { - "filepath": "blaze/template.js", - "importfrompackage": "templating", - "kind": "member", - "lineno": 78, - "locus": "Client", - "longname": "Template#onRendered", - "memberof": "Template", - "module": "templating", - "name": "onRendered", - "params": [ - { - "description": "

A function to be added as a callback.

", - "name": "callback", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Register a function to be called when an instance of this template is inserted into the DOM." - }, - "Template#rendered": { - "deprecated": "in 1.1", - "filepath": "blaze/template.js", - "kind": "member", - "lineno": 198, - "locus": "Client", - "longname": "Template#rendered", - "memberof": "Template", - "module": "blaze", - "name": "rendered", - "scope": "instance", - "summary": "Provide a callback when an instance of a template is rendered." - }, - "Template.body": { - "filepath": "templating/templating.js", - "kind": "member", - "lineno": 47, - "locus": "Client", - "longname": "Template.body", - "memberof": "Template", - "module": "templating", - "name": "body", - "scope": "static", - "summary": "The [template object](#templates_api) representing your ``\ntag." - }, - "Template.currentData": { - "filepath": "blaze/template.js", - "importfrompackage": "templating", - "kind": "function", - "lineno": 537, - "locus": "Client", - "longname": "Template.currentData", - "memberof": "Template", - "module": "templating", - "name": "currentData", - "options": [], - "params": [], - "scope": "static", - "summary": "- Inside an `onCreated`, `onRendered`, or `onDestroyed` callback, returns\nthe data context of the template.\n- Inside an event handler, returns the data context of the template on which\nthis event handler was defined.\n- Inside a helper, returns the data context of the DOM node where the helper\nwas used.\n\nEstablishes a reactive dependency on the result." - }, - "Template.deregisterHelper": { - "filepath": "blaze/template.js", - "importfrompackage": "templating", - "kind": "function", - "lineno": 565, - "locus": "Client", - "longname": "Template.deregisterHelper", - "memberof": "Template", - "module": "templating", - "name": "deregisterHelper", - "options": [], - "params": [ - { - "description": "

The name of the helper function you are defining.

", - "name": "name", - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "static", - "summary": "Removes a global [helper function](#template_helpers)." - }, - "Template.dynamic": { - "filepath": "templating/dynamic.js", - "istemplate": "true", - "kind": "function", - "lineno": 3, - "locus": "Templates", - "longname": "Template.dynamic", - "memberof": "Template", - "module": "templating", - "name": "dynamic", - "options": [], - "params": [ - { - "description": "

The name of the template to include.

", - "name": "template", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

Optional. The data context in which to include the\ntemplate.

", - "name": "data", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - } - ], - "scope": "static", - "summary": "Choose a template to include dynamically, by name." - }, - "Template.instance": { - "filepath": "blaze/template.js", - "importfrompackage": "templating", - "kind": "function", - "lineno": 505, - "locus": "Client", - "longname": "Template.instance", - "memberof": "Template", - "module": "templating", - "name": "instance", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "Blaze.TemplateInstance" - ] - } - } - ], - "scope": "static", - "summary": "The [template instance](#template_inst) corresponding to the current template helper, event handler, callback, or autorun. If there isn't one, `null`." - }, - "Template.parentData": { - "filepath": "blaze/template.js", - "importfrompackage": "templating", - "kind": "function", - "lineno": 546, - "locus": "Client", - "longname": "Template.parentData", - "memberof": "Template", - "module": "templating", - "name": "parentData", - "options": [], - "params": [ - { - "description": "

The number of levels beyond the current data context to look. Defaults to 1.

", - "name": "numLevels", - "optional": true, - "type": { - "names": [ - "Integer" - ] - } - } - ], - "scope": "static", - "summary": "Accesses other data contexts that enclose the current data context." - }, - "Template.registerHelper": { - "filepath": "blaze/template.js", - "importfrompackage": "templating", - "kind": "function", - "lineno": 556, - "locus": "Client", - "longname": "Template.registerHelper", - "memberof": "Template", - "module": "templating", - "name": "registerHelper", - "options": [], - "params": [ - { - "description": "

The name of the helper function you are defining.

", - "name": "name", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

The helper function itself.

", - "name": "function", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Defines a [helper function](#template_helpers) which can be used from all templates." - }, - "Tracker": { - "filepath": "tracker/tracker.js", - "kind": "namespace", - "lineno": 5, - "longname": "Tracker", - "module": "tracker", - "name": "Tracker", - "scope": "global", - "summary": "The namespace for Tracker-related methods." - }, - "Tracker.Computation": { - "filepath": "tracker/tracker.js", - "instancename": "computation", - "kind": "function", - "lineno": 153, - "longname": "Tracker.Computation", - "memberof": "Tracker", - "module": "tracker", - "name": "Computation", - "options": [], - "params": [], - "scope": "static", - "summary": "A Computation object represents code that is repeatedly rerun\nin response to\nreactive data changes. Computations don't have return values; they just\nperform actions, such as rerendering a template on the screen. Computations\nare created using Tracker.autorun. Use stop to prevent further rerunning of a\ncomputation." - }, - "Tracker.Computation#firstRun": { - "filepath": "tracker/tracker.js", - "kind": "member", - "lineno": 186, - "locus": "Client", - "longname": "Tracker.Computation#firstRun", - "memberof": "Tracker.Computation", - "module": "tracker", - "name": "firstRun", - "scope": "instance", - "summary": "True during the initial run of the computation at the time `Tracker.autorun` is called, and false on subsequent reruns and at other times.", - "type": { - "names": [ - "Boolean" - ] - } - }, - "Tracker.Computation#invalidate": { - "filepath": "tracker/tracker.js", - "kind": "function", - "lineno": 268, - "locus": "Client", - "longname": "Tracker.Computation#invalidate", - "memberof": "Tracker.Computation", - "module": "tracker", - "name": "invalidate", - "options": [], - "params": [], - "scope": "instance", - "summary": "Invalidates this computation so that it will be rerun." - }, - "Tracker.Computation#invalidated": { - "filepath": "tracker/tracker.js", - "kind": "member", - "lineno": 174, - "locus": "Client", - "longname": "Tracker.Computation#invalidated", - "memberof": "Tracker.Computation", - "module": "tracker", - "name": "invalidated", - "scope": "instance", - "summary": "True if this computation has been invalidated (and not yet rerun), or if it has been stopped.", - "type": { - "names": [ - "Boolean" - ] - } - }, - "Tracker.Computation#onInvalidate": { - "filepath": "tracker/tracker.js", - "kind": "function", - "lineno": 227, - "locus": "Client", - "longname": "Tracker.Computation#onInvalidate", - "memberof": "Tracker.Computation", - "module": "tracker", - "name": "onInvalidate", - "options": [], - "params": [ - { - "description": "

Function to be called on invalidation. Receives one argument, the computation that was invalidated.

", - "name": "callback", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Registers `callback` to run when this computation is next invalidated, or runs it immediately if the computation is already invalidated. The callback is run exactly once and not upon future invalidations unless `onInvalidate` is called again after the computation becomes valid again." - }, - "Tracker.Computation#onStop": { - "filepath": "tracker/tracker.js", - "kind": "function", - "lineno": 247, - "locus": "Client", - "longname": "Tracker.Computation#onStop", - "memberof": "Tracker.Computation", - "module": "tracker", - "name": "onStop", - "options": [], - "params": [ - { - "description": "

Function to be called on stop. Receives one argument, the computation that was stopped.

", - "name": "callback", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "instance", - "summary": "Registers `callback` to run when this computation is stopped, or runs it immediately if the computation is already stopped. The callback is run after any `onInvalidate` callbacks." - }, - "Tracker.Computation#stop": { - "filepath": "tracker/tracker.js", - "kind": "function", - "lineno": 297, - "locus": "Client", - "longname": "Tracker.Computation#stop", - "memberof": "Tracker.Computation", - "module": "tracker", - "name": "stop", - "options": [], - "params": [], - "scope": "instance", - "summary": "Prevents this computation from rerunning." - }, - "Tracker.Computation#stopped": { - "filepath": "tracker/tracker.js", - "kind": "member", - "lineno": 163, - "locus": "Client", - "longname": "Tracker.Computation#stopped", - "memberof": "Tracker.Computation", - "module": "tracker", - "name": "stopped", - "scope": "instance", - "summary": "True if this computation has been stopped." - }, - "Tracker.ComputationFunction": { - "filepath": "tracker/tracker.js", - "kind": "typedef", - "lineno": 538, - "longname": "Tracker.ComputationFunction", - "memberof": "Tracker", - "module": "tracker", - "name": "ComputationFunction", - "params": [ - { - "type": { - "names": [ - "Tracker.Computation" - ] - } - } - ], - "scope": "static", - "type": { - "names": [ - "function" - ] - } - }, - "Tracker.Dependency": { - "filepath": "tracker/tracker.js", - "instancename": "dependency", - "kind": "class", - "lineno": 368, - "longname": "Tracker.Dependency", - "memberof": "Tracker", - "module": "tracker", - "name": "Dependency", - "options": [], - "params": [], - "scope": "static", - "summary": "A Dependency represents an atomic unit of reactive data that a\ncomputation might depend on. Reactive data sources such as Session or\nMinimongo internally create different Dependency objects for different\npieces of data, each of which may be depended on by multiple computations.\nWhen the data changes, the computations are invalidated." - }, - "Tracker.Dependency#changed": { - "filepath": "tracker/tracker.js", - "kind": "function", - "lineno": 414, - "locus": "Client", - "longname": "Tracker.Dependency#changed", - "memberof": "Tracker.Dependency", - "module": "tracker", - "name": "changed", - "options": [], - "params": [], - "scope": "instance", - "summary": "Invalidate all dependent computations immediately and remove them as dependents." - }, - "Tracker.Dependency#depend": { - "filepath": "tracker/tracker.js", - "kind": "function", - "lineno": 389, - "locus": "Client", - "longname": "Tracker.Dependency#depend", - "memberof": "Tracker.Dependency", - "module": "tracker", - "name": "depend", - "options": [], - "params": [ - { - "description": "

An optional computation declared to depend on dependency instead of the current computation.

", - "name": "fromComputation", - "optional": true, - "type": { - "names": [ - "Tracker.Computation" - ] - } - } - ], - "returns": [ - { - "type": { - "names": [ - "Boolean" - ] - } - } - ], - "scope": "instance", - "summary": "Declares that the current computation (or `fromComputation` if given) depends on `dependency`. The computation will be invalidated the next time `dependency` changes.\n\nIf there is no current computation and `depend()` is called with no arguments, it does nothing and returns false.\n\nReturns true if the computation is a new dependent of `dependency` rather than an existing one." - }, - "Tracker.Dependency#hasDependents": { - "filepath": "tracker/tracker.js", - "kind": "function", - "lineno": 427, - "locus": "Client", - "longname": "Tracker.Dependency#hasDependents", - "memberof": "Tracker.Dependency", - "module": "tracker", - "name": "hasDependents", - "options": [], - "params": [], - "returns": [ - { - "type": { - "names": [ - "Boolean" - ] - } - } - ], - "scope": "instance", - "summary": "True if this Dependency has one or more dependent Computations, which would be invalidated if this Dependency were to change." - }, - "Tracker.active": { - "filepath": "tracker/tracker.js", - "kind": "member", - "lineno": 18, - "locus": "Client", - "longname": "Tracker.active", - "memberof": "Tracker", - "module": "tracker", - "name": "active", - "scope": "static", - "summary": "True if there is a current computation, meaning that dependencies on reactive data sources will be tracked and potentially cause the current computation to be rerun.", - "type": { - "names": [ - "Boolean" - ] - } - }, - "Tracker.afterFlush": { - "filepath": "tracker/tracker.js", - "kind": "function", - "lineno": 616, - "locus": "Client", - "longname": "Tracker.afterFlush", - "memberof": "Tracker", - "module": "tracker", - "name": "afterFlush", - "options": [], - "params": [ - { - "description": "

A function to call at flush time.

", - "name": "callback", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Schedules a function to be called during the next flush, or later in the current flush if one is in progress, after all invalidated computations have been rerun. The function will be run once and not on subsequent flushes unless `afterFlush` is called again." - }, - "Tracker.autorun": { - "filepath": "tracker/tracker.js", - "kind": "function", - "lineno": 555, - "locus": "Client", - "longname": "Tracker.autorun", - "memberof": "Tracker", - "module": "tracker", - "name": "autorun", - "options": [ - { - "description": "

Optional. The function to run when an error\nhappens in the Computation. The only argument it recieves is the Error\nthrown. Defaults to the error being logged to the console.

", - "name": "onError", - "type": { - "names": [ - "function" - ] - } - } - ], - "params": [ - { - "description": "

The function to run. It receives\none argument: the Computation object that will be returned.

", - "name": "runFunc", - "type": { - "names": [ - "Tracker.ComputationFunction" - ] - } - }, - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - } - ], - "returns": [ - { - "type": { - "names": [ - "Tracker.Computation" - ] - } - } - ], - "scope": "static", - "summary": "Run a function now and rerun it later whenever its dependencies\nchange. Returns a Computation object that can be used to stop or observe the\nrerunning." - }, - "Tracker.currentComputation": { - "filepath": "tracker/tracker.js", - "kind": "member", - "lineno": 27, - "locus": "Client", - "longname": "Tracker.currentComputation", - "memberof": "Tracker", - "module": "tracker", - "name": "currentComputation", - "scope": "static", - "summary": "The current computation, or `null` if there isn't one. The current computation is the [`Tracker.Computation`](#tracker_computation) object created by the innermost active call to `Tracker.autorun`, and it's the computation that gains dependencies when reactive data sources are accessed.", - "type": { - "names": [ - "Tracker.Computation" - ] - } - }, - "Tracker.flush": { - "filepath": "tracker/tracker.js", - "kind": "function", - "lineno": 440, - "locus": "Client", - "longname": "Tracker.flush", - "memberof": "Tracker", - "module": "tracker", - "name": "flush", - "options": [], - "params": [], - "scope": "static", - "summary": "Process all reactive updates immediately and ensure that all invalidated computations are rerun." - }, - "Tracker.nonreactive": { - "filepath": "tracker/tracker.js", - "kind": "function", - "lineno": 585, - "locus": "Client", - "longname": "Tracker.nonreactive", - "memberof": "Tracker", - "module": "tracker", - "name": "nonreactive", - "options": [], - "params": [ - { - "description": "

A function to call immediately.

", - "name": "func", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Run a function without tracking dependencies." - }, - "Tracker.onInvalidate": { - "filepath": "tracker/tracker.js", - "kind": "function", - "lineno": 602, - "locus": "Client", - "longname": "Tracker.onInvalidate", - "memberof": "Tracker", - "module": "tracker", - "name": "onInvalidate", - "options": [], - "params": [ - { - "description": "

A callback function that will be invoked as func(c), where c is the computation on which the callback is registered.

", - "name": "callback", - "type": { - "names": [ - "function" - ] - } - } - ], - "scope": "static", - "summary": "Registers a new [`onInvalidate`](#computation_oninvalidate) callback on the current computation (which must exist), to be called immediately when the current computation is invalidated or stopped." - }, - "check": { - "filepath": "check/match.js", - "kind": "function", - "lineno": 19, - "locus": "Anywhere", - "longname": "check", - "module": "check", - "name": "check", - "options": [], - "params": [ - { - "description": "

The value to check

", - "name": "value", - "type": { - "names": [ - "Any" - ] - } - }, - { - "description": "

The pattern to match\nvalue against

", - "name": "pattern", - "type": { - "names": [ - "MatchPattern" - ] - } - } - ], - "scope": "global", - "summary": "Check that a value matches a [pattern](#matchpatterns).\nIf the value does not match the pattern, throw a `Match.Error`.\n\nParticularly useful to assert that arguments to a function have the right\ntypes and structure." - }, - "currentUser": { - "filepath": "accounts-base/accounts_client.js", - "ishelper": "true", - "kind": "member", - "lineno": 415, - "longname": "currentUser", - "module": "accounts-base", - "name": "currentUser", - "scope": "global", - "summary": "Calls [Meteor.user()](#meteor_user). Use `{{#if currentUser}}` to check whether the user is logged in." - }, - "execFileAsync": { - "kind": "function", - "longname": "execFileAsync", - "name": "execFileAsync", - "options": [ - { - "description": "

Current working directory of the child process

", - "name": "cwd", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Environment key-value pairs

", - "name": "env", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Child's stdio configuration.\n(Default: 'pipe') Specifying anything else than 'pipe' will disallow\ncapture.

", - "name": "stdio", - "optional": true, - "type": { - "names": [ - "Array", - "String" - ] - } - }, - { - "description": "

If specified, instead of capturing\nthe output, the child process stdout will be piped to the destination stream.

", - "name": "destination", - "optional": true, - "type": { - "names": [ - "Writable" - ] - } - }, - { - "description": "

Whether to wait for the child process\nstreams to close or to resolve the promise when the child process exits.

", - "name": "waitForClose", - "optional": true, - "type": { - "names": [ - "String" - ] - } - } - ], - "params": [ - { - "description": "

The command to run

", - "name": "command", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

List of string arguments

", - "name": "args", - "optional": true, - "type": { - "names": [ - "Array" - ] - } - }, - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - } - ], - "returns": [ - { - "type": { - "names": [ - "Promise." - ] - } - } - ], - "scope": "global", - "summary": "Executes a command asynchronously, returning a promise that will\neither be resolved to the captured stdout output or be rejected with an\nerror containing the stderr output as part of the message. In addition,\nthe error will contain fields pid, stderr, stdout, status and signal." - }, - "execFileSync": { - "kind": "function", - "longname": "execFileSync", - "name": "execFileSync", - "options": [ - { - "description": "

Current working directory of the child process

", - "name": "cwd", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Environment key-value pairs

", - "name": "env", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - }, - { - "description": "

Child's stdio configuration.\n(Default: 'pipe') Specifying anything else than 'pipe' will disallow\ncapture.

", - "name": "stdio", - "optional": true, - "type": { - "names": [ - "Array", - "String" - ] - } - }, - { - "description": "

If specified, instead of capturing\nthe output, the child process stdout will be piped to the destination stream.

", - "name": "destination", - "optional": true, - "type": { - "names": [ - "Writable" - ] - } - }, - { - "description": "

Whether to wait for the child process\nstreams to close or to resolve the promise when the child process exits.

", - "name": "waitForClose", - "optional": true, - "type": { - "names": [ - "String" - ] - } - } - ], - "params": [ - { - "description": "

The command to run

", - "name": "command", - "type": { - "names": [ - "String" - ] - } - }, - { - "description": "

List of string arguments

", - "name": "args", - "optional": true, - "type": { - "names": [ - "Array" - ] - } - }, - { - "name": "options", - "optional": true, - "type": { - "names": [ - "Object" - ] - } - } - ], - "returns": [ - { - "description": "

The stdout from the command

", - "type": { - "names": [ - "String" - ] - } - } - ], - "scope": "global", - "summary": "Executes a command synchronously, returning either the captured\nstdout output or throwing an error containing the stderr output as part of\nthe message. In addition, the error will contain fields pid, stderr, stdout,\nstatus and signal." - }, - "loggingIn": { - "filepath": "accounts-base/accounts_client.js", - "ishelper": "true", - "kind": "member", - "lineno": 425, - "longname": "loggingIn", - "module": "accounts-base", - "name": "loggingIn", - "scope": "global", - "summary": "Calls [Meteor.loggingIn()](#meteor_loggingin)." - } -}; \ No newline at end of file diff --git a/docs/client/docs.less b/docs/client/docs.less deleted file mode 100644 index 576e91c4f2..0000000000 --- a/docs/client/docs.less +++ /dev/null @@ -1,759 +0,0 @@ -/** CSS reset **/ - -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, font, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td { - margin: 0; - padding: 0; - border: 0; - outline: 0; - font-weight: inherit; - font-style: inherit; - font-family: inherit; - font-size: 100%; - vertical-align: baseline; -} -body { - line-height: 1; - color: black; - background: white; -} -ol, ul { - list-style: none; -} -a img { - border: none; -} - -/** Basics **/ - -body { - font-family: 'Helvetica Neue', Helvetica, Arial; -} - -pre { - font-family: monospace; -} - -code { - font-family: monospace; - white-space: pre; - font-size: 1.2em; -} - -pre code { - font-size: 1.1em; -} - -ul { - list-style-type: disc; - margin-top: 1em; - margin-bottom: 1em; - padding-left: 40px; -} - -dl { - margin-top: 1em; - margin-bottom: 1em; -} - -dd { - margin-left: 40px; -} - -h1, h2, h3, h4 { - color: black; - font-weight: bold; -} - -h1 { - font-size: 2em; -} - -h1 { - margin: 1.5em 0 .67em 0; -} - -h2 { - font-size: 1.5em; - margin: 1.25em 0 .5em 0; -} - -h3 { - font-size: 1.17em; - margin: 1em 0 1em 0; -} - -h4 { -} - -p { - margin-bottom: 1em; -} - -em { - font-style: italic; -} - -a:hover { - background-color: yellow; -} - -/** Main pane **/ - -#main { - margin: 10px; - line-height: 1.3; - color: #333333; -} - -#main strong { - font-weight: bold; -} - -#main h1 { - border-style: solid none none none; - border-color: #999; - border-width: 2px; -} - -#main h2 span { - background-color: yellow; - margin: 0px -5px 0px -5px; - padding: 2px 5px 2px 5px; -} - -#main a:link, #main a:visited { - text-decoration: none; - border-bottom: 1px dashed #000; - color: inherit; -} - -#main code a:link, #main code a:visited { - border: none; -} - -dl.involved { - padding-left: 10px; -} - -dl.involved dt { - text-transform: uppercase; - font-weight: bold; -} - -dl.involved dt span { - background-color: yellow; -} - -dl.involved dd { - margin-left: 20px; - margin-bottom: 1em; -} - -dl.involved a { - font-weight: bold; -} - -dl.involved code { - font-weight: bold; -} - -dl.example dt { - font-weight: bold; - margin-left: 10px; -} - -dl.example dd { - margin-bottom: 10px; -} - -dl.objdesc dt { - margin-top: 1em; - margin-left: 1.5em; -} - -dl.objdesc dt .name { - font-weight: bold; -} - -dl.objdesc dt .type { - margin-left: 15px; - font-size: .9em; - font-weight: 200; - color: black; -} - -dl.objdesc dd { - margin-bottom: 1em; - margin-left: 1.5em; -} - -dl.callbacks dt .name, dl.methods dt .name { - /* like code tag */ - font-family: monospace; - font-size: 1.1em; -} - -dl.callbacks { - margin-left: 1.5em; -} - -#main dd p { - margin-top: 0.5em; -} - - - -/** API **/ - -.warning { - border-width: 0px 0px 0px 3px; - border-style: solid; - border-color: red; - margin: 21px 0px 21px 10px; - padding-left: 15px; - font-weight: bold; - color: red; -} - -.note { - border-width: 0px 0px 0px 2px; - border-style: solid; - border-color: black; - margin: 21px 0px 21px 10px; - padding-left: 15px; - font-style: italic; - color: black; -} - -.api { - border: 1px solid #ddd; - margin-bottom: 1em; - margin-top: 2em; -} - -.bareapi { - border-width: 0; -} - -.api h3, h3.api-title { - background: #eee; - padding: 5px 10px; -} - -h3.api-title { - margin-top: 2em; -} - -.api h3.api-title { - margin: 0; - overflow : auto; -} - -.api h4 { - font-weight: normal; - font-style: italic; - margin-bottom: .25em; - text-decoration: underline; - margin-left: 20px; -} - -.api dl { - margin-top: .25em; -} - -.api dl.args { - margin-left: 40px; -} - -.api dl.constants { - margin-left: 20px; -} - -.api dt { - margin-top: 1em; -} - -.api dt .name { - font-weight: bold; -} - -.api dt .type { - margin-left: 15px; - font-size: .9em; - font-weight: 200; - color: black; -} - -.api dd { - margin-bottom: 1em; - margin-left: 0; -} - -.api .desc { - margin: 1em; -} - -.api pre { - margin-right: 10px; -} - -ol { - list-style: decimal; - padding-left: 30px; - margin-bottom: 1em; -} - -.api-title .locus { - float: right; - font-weight: normal; - padding-right: 5px; - font-style: italic; -} - -.api-title .subtext { - font-size: 11px; - text-align: left; - clear: both; - display: block; - font-weight: normal; -} - -.api-title .subtext > code { - font-size: 11px; - margin-right: 12px; -} - -.api-title .src-code { - color: #20338A !important; - border-bottom: none !important; -} - -.or { - font-size: .9em; - text-decoration: underline; - font-style: italic; -} - -#main pre { - margin: 1em 0; -} - -#main a.selflink:link, #main a.selflink:visited, #main a.selflink:hover { - text-decoration: none; - border: none; - color: inherit; - background: none; -} - -/** layout control **/ - -#menu-ico { - font-size: 30px; - float: right; - position: fixed; - top: 3px; - left: 6px; -} - -#menu-ico.hidden { - display: none; -} - - -/** layout control **/ - -#menu-ico { - font-size: 30px; - float: right; - position: fixed; - top: 3px; - left: 6px; -} - -#menu-ico.hidden { - display: none; -} - -@nav-width: 270px; -@top-bar-height: 50px; - -/* default to no sidebar */ -.hidden { - display: none; -} - -#nav { - display: block; - position: fixed; - width: @nav-width; - height: 100%; - top: 0; - overflow-y: scroll; - -webkit-overflow-scrolling: touch; -} - -.main-content { - position: absolute; - width: 100%; - top: @top-bar-height; - bottom: 0; - z-index: 1; - background: white; - overflow-y: scroll; - -webkit-overflow-scrolling: touch; - overflow-x: hidden; - margin-left: 0; - transition: margin-left 300ms ease-out; -} - -.overlay { - margin-left: 0; - transition: margin-left 300ms ease-out, opacity 300ms ease-out; - opacity: 0; - background-color: rgba(0, 0, 0, 0.3); -} - -#nav.show { - left: 0; - overflow: auto; -} - -.github-ribbon { - display: none; -} -pre { - white-space: pre-wrap; -} - -#main { - padding: 10px; - max-width: 700px; -} - -.basic-or-full { - font-size: 1em; - margin: 10px 0; -} - -#nav { - h1 { - margin-top: 1em; - font-size: 1.3em; - - a { - text-decoration: none; - color: black; - - &:hover { - background: none; - text-decoration: underline; - } - } - } - - .logo { - width: 180px; - margin-bottom: 10px; - } -} - - -.top-bar { - position: absolute; - background: white; - width: 100%; - top: 0; - left: 0; - height: @top-bar-height; - box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); - z-index: 2; - margin-left: 0; - transition: margin-left 300ms ease-out, opacity 300ms ease-out; - border-bottom: 1px solid #aaa; - - .fa-bars { - font-size: 25px; - margin: 13px 10px 13px 20px; - } - - h1 { - margin: 13px auto; - text-align: center; - font-size: 25px; - padding: 0; - margin-top: 8px; - - .logo { - display: inline; - height: 1.1em; - vertical-align: baseline; - margin-bottom: 1px; - margin-right: 3px; - } - } -} - -.sidebar-open { - overflow: hidden; - width: 100%; - position: absolute; - height: 100%; - - .main-content { - margin-left: @nav-width; - } - - .top-bar { - margin-left: @nav-width; - } - - .overlay { - position: absolute; - margin-left: @nav-width; - width: 100%; - height: 100%; - z-index: 3; - opacity: 1; - } -} - -@media (min-width: 768px) { - /* ipad portrait or better */ - .main-content { - height: 100%; - margin-left: 0; /* nav width + padding */ - padding-top: 0; - left: @nav-width; - right: 0; - width: auto; - border-left: 1px solid #ccc; - top: 0; - } - - #nav { - display: block; - width: @nav-width; - position: fixed; - overflow: auto; - height: 100%; - top: 0; - left: 0; - } - .main-headline { - display: none; - } - - #menu-ico { - display: none; - } - - .overlay { - display: none; - } - - .top-bar { - display: none; - } - - #main { - padding: 30px; - } - - .sidebar-open { - overflow: hidden; - width: 100%; - position: absolute; - height: 100%; - - .main-content { - margin-left: 0; - } - - .top-bar { - margin-left: 0; - } - - .overlay { - display: none; - } - } -} - -.complete-link { - font-size: 0.9em; - text-decoration: underline !important; -} - -@media print { - body { - font-size: 10pt; - } - - code, pre { - font-size: 8pt; - } - - #nav { - display: none; - } - - .main-content { - position: relative; - height: auto; - margin: 0; - left: 0; - top: 0; - } - - .top-bar { - display: none; - } -} - -.search-overlay { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 3; - background: white; - - overflow: hidden; - - .close-search { - float: right; - font-size: 2em; - - .hotkey { - font-size: 0.6em; - color: #777; - vertical-align: middle; - } - - text-decoration: none; - - &:hover { - text-decoration: none; - background: none; - } - } - - .search-box { - margin: 40px; - - h3 { - font-size: 2em; - } - - input { - font-size: 2em; - padding: 0.5em 0; - background: transparent; - border: none; - border-bottom: 2px solid #777; - width: 80%; - - &:focus { - outline: 0; - } - } - } - - .search-results { - margin: 40px; - - position: absolute; - bottom: 0; - left: 0; - right: 0; - top: 170px; - - overflow-y: scroll; - list-style: none; - - padding: 0; - - li { - font-size: 1em; - margin-bottom: 0.5em; - padding: 10px; - white-space: nowrap; - - p { - margin: 0; - display: inline; - } - - strong { - font-weight: bold; - } - - &.selected { - background: yellow; - } - } - } -} - -// This menu icon is inspired by -// http://www.codesynthesis.co.uk/code-snippets/create-a-hamburger-icon-with-css -@hamburger-icon-size: 18px; - -// Make the target larger than the icon -.hamburger-menu-target { - height: @hamburger-icon-size; - width: @hamburger-icon-size; - padding: 19px 10px; - display: inline-block; - position: absolute; - top: 0; - left: 0; -} - -.hamburger-menu, .hamburger-menu:after, .hamburger-menu:before { - height: @hamburger-icon-size / 6; - width: @hamburger-icon-size; - background-color: #111; - border-radius: 10px; - position: relative; -} - -.hamburger-menu:after, .hamburger-menu:before { - content: ''; - position: absolute; -} - -.hamburger-menu:after { - top: @hamburger-icon-size / 3; -} - -.hamburger-menu:before { - top: @hamburger-icon-size / 1.5; -} - -table { - border-collapse: collapse; - border-spacing: 0; -} - -table th, table td { - border: 1px solid #ddd; - padding: 5px 10px; -} - -table th { - font-weight: bold; - text-align: left; -} - -table tr:nth-child(even) { - background-color: #f8f8f8; -} \ No newline at end of file diff --git a/docs/client/full-api/api.md b/docs/client/full-api/api.md deleted file mode 100644 index 5426fc664a..0000000000 --- a/docs/client/full-api/api.md +++ /dev/null @@ -1,31 +0,0 @@ -{{#template name="api"}} - -

The Meteor API

- -Your JavaScript code can run in two environments: the *client* (browser), and -the *server* (a [Node.js](http://nodejs.org/) container on a server). For each -function in this API reference, we'll indicate if the function is available just -on the client, just on the server, or *Anywhere*. - -{{> apiCore}} -{{> apiPubsub}} -{{> apiMethods}} -{{> apiCheck}} -{{> apiConnections}} -{{> apiCollections}} -{{> apiSession}} -{{> apiAccounts}} -{{> apiPasswords}} -{{> apiTemplates}} -{{> apiBlaze}} -{{> apiTimers}} -{{> apiTracker}} -{{> apiReactiveVar}} -{{> apiEjson}} -{{> apiHttp}} -{{> apiEmail}} -{{> apiAssets}} -{{> apiPackagejs}} -{{> apiMobileConfig}} - -{{/template}} diff --git a/docs/client/full-api/api/accounts.md b/docs/client/full-api/api/accounts.md deleted file mode 100644 index d38055d623..0000000000 --- a/docs/client/full-api/api/accounts.md +++ /dev/null @@ -1,477 +0,0 @@ -{{#template name="apiAccounts"}} - -

Accounts

- -The Meteor Accounts system builds on top of the `userId` support in -[`publish`](#publish_userId) and [`methods`](#method_userId). The core -packages add the concept of user documents stored in the database, and -additional packages add [secure password -authentication](#accounts_passwords), [integration with third party -login services](#meteor_loginwithexternalservice), and a [pre-built user -interface](#accountsui). - -The basic Accounts system is in the `accounts-base` package, but -applications typically include this automatically by adding one of the -login provider packages: `accounts-password`, `accounts-facebook`, -`accounts-github`, `accounts-google`, `accounts-meetup`, -`accounts-twitter`, or `accounts-weibo`. - -Read more about customizing user accounts in the [Accounts](http://guide.meteor.com/accounts.html) article in the Meteor Guide. - -{{> autoApiBox "Meteor.user"}} - -Retrieves the user record for the current user from -the [`Meteor.users`](#meteor_users) collection. - -On the client, this will be the subset of the fields in the document that -are published from the server (other fields won't be available on the -client). By default the server publishes `username`, `emails`, and -`profile` (writable by user). See [`Meteor.users`](#meteor_users) for more on -the fields used in user documents. - -{{> autoApiBox "Meteor.userId"}} - -{{> autoApiBox "Meteor.users"}} - -This collection contains one document per registered user. Here's an example -user document: - - { - _id: "bbca5d6a-2156-41c4-89da-0329e8c99a4f", // Meteor.userId() - username: "cool_kid_13", // unique name - emails: [ - // each email address can only belong to one user. - { address: "cool@example.com", verified: true }, - { address: "another@different.com", verified: false } - ], - createdAt: Wed Aug 21 2013 15:16:52 GMT-0700 (PDT), - profile: { - // The profile is writable by the user by default. - name: "Joe Schmoe" - }, - services: { - facebook: { - id: "709050", // facebook id - accessToken: "AAACCgdX7G2...AbV9AZDZD" - }, - resume: { - loginTokens: [ - { token: "97e8c205-c7e4-47c9-9bea-8e2ccc0694cd", - when: 1349761684048 } - ] - } - } - } - -A user document can contain any data you want to store about a user. Meteor -treats the following fields specially: - -- `username`: a unique String identifying the user. -- `emails`: an Array of Objects with keys `address` and `verified`; - an email address may belong to at most one user. `verified` is - a Boolean which is true if the user has [verified the - address](#accounts_verifyemail) with a token sent over email. -- `createdAt`: the Date at which the user document was created. -- `profile`: an Object which the user can create and update with any data. - Do not store anything on `profile` that you wouldn't want the user to edit - unless you have a deny rule on the `Meteor.users` collection. -- `services`: an Object containing data used by particular - login services. For example, its `reset` field contains - tokens used by [forgot password](#accounts_forgotpassword) links, - and its `resume` field contains tokens used to keep you - logged in between sessions. - -Like all [Mongo.Collection](#collections)s, you can access all -documents on the server, but only those specifically published by the server are -available on the client. - -By default, the current user's `username`, `emails` and `profile` are -published to the client. You can publish additional fields for the -current user with: - - // server - Meteor.publish("userData", function () { - if (this.userId) { - return Meteor.users.find({_id: this.userId}, - {fields: {'other': 1, 'things': 1}}); - } else { - this.ready(); - } - }); - - // client - Meteor.subscribe("userData"); - -If the autopublish package is installed, information about all users -on the system is published to all clients. This includes `username`, -`profile`, and any fields in `services` that are meant to be public -(eg `services.facebook.id`, -`services.twitter.screenName`). Additionally, when using autopublish -more information is published for the currently logged in user, -including access tokens. This allows making API calls directly from -the client for services that allow this. - -Users are by default allowed to specify their own `profile` field with -[`Accounts.createUser`](#accounts_createuser) and modify it with -`Meteor.users.update`. To allow users to edit additional fields, use -[`Meteor.users.allow`](#allow). To forbid users from making any modifications to -their user document: - - Meteor.users.deny({update: function () { return true; }}); - -{{> autoApiBox "Meteor.loggingIn"}} - -For example, [the `accounts-ui` package](#accountsui) uses this to display an -animation while the login request is being processed. - -{{> autoApiBox "Meteor.logout"}} - -{{> autoApiBox "Meteor.logoutOtherClients"}} - -For example, when called in a user's browser, connections in that browser -remain logged in, but any other browsers or DDP clients logged in as that user -will be logged out. - -{{> autoApiBox "Meteor.loginWithPassword"}} - -If there are multiple users with a username or email only differing in case, a case sensitive match is required. Although `createUser` won't let you create users with ambiguous usernames or emails, this could happen with existing databases or if you modify the users collection directly. - -This function is provided by the `accounts-password` package. See the -[Passwords](#accounts_passwords) section below. - - -{{> autoApiBox "Meteor.loginWith"}} - -Available functions are: - -* `Meteor.loginWithMeteorDeveloperAccount` -* `Meteor.loginWithFacebook` -* `Meteor.loginWithGithub` -* `Meteor.loginWithGoogle` -* `Meteor.loginWithMeetup` -* `Meteor.loginWithTwitter` -* `Meteor.loginWithWeibo` - -These functions initiate the login process with an external -service (eg: Facebook, Google, etc), using OAuth. When called they open a new pop-up -window that loads the provider's login page. Once the user has logged in -with the provider, the pop-up window is closed and the Meteor client -logs in to the Meteor server with the information provided by the external -service. - - - -In addition to identifying the user to your application, some services -have APIs that allow you to take action on behalf of the user. To -request specific permissions from the user, pass the -`requestPermissions` option the login function. This will cause the user -to be presented with an additional page in the pop-up dialog to permit -access to their data. The user's `accessToken` — with permissions -to access the service's API — is stored in the `services` field of -the user document. The supported values for `requestPermissions` differ -for each login service and are documented on their respective developer -sites: - -- Facebook: -- GitHub: -- Google: -- Meetup: -- Twitter, Weibo, Meteor developer accounts: `requestPermissions` currently not supported - -External login services typically require registering and configuring -your application before use. The easiest way to do this is with the -[`accounts-ui` package](#accountsui) which presents a step-by-step guide -to configuring each service. However, the data can be also be entered -manually in the `ServiceConfiguration.configurations` collection, which -is exported by the `service-configuration` package. - -First, add the service configuration package: - -```bash -meteor add service-configuration -``` - -Then, in your app: - -```js -ServiceConfiguration.configurations.upsert( - { service: "weibo" }, - { - $set: { - clientId: "1292962797", - loginStyle: "popup", - secret: "75a730b58f5691de5522789070c319bc" - } - } -); -``` - -Each external service has its own login provider package and login function. For -example, to support GitHub login, run in your terminal: - -```bash -meteor add accounts-github -``` - -and use the `Meteor.loginWithGithub` function: - -```javascript -Meteor.loginWithGithub({ - requestPermissions: ['user', 'public_repo'] -}, function (err) { - if (err) - Session.set('errorMessage', err.reason || 'Unknown error'); -}); -``` - -Login service configuration is sent from the server to the client over DDP when -your app starts up; you may not call the login function until the configuration -is loaded. The function `Accounts.loginServicesConfigured()` is a reactive data -source that will return true once the login service is configured; you should -not make login buttons visible or active until it is true. - -Ensure that your [`$ROOT_URL`](#meteor_absoluteurl) matches the authorized -domain and callback URL that you configure with the external service (for -instance, if you are running Meteor behind a proxy server, `$ROOT_URL` should be -the externally-accessible URL, not the URL inside your proxy). - -{{> autoApiBox "currentUser"}} - -{{> autoApiBox "loggingIn"}} - -{{> autoApiBox "Accounts.ui.config"}} - -Example: - - Accounts.ui.config({ - requestPermissions: { - facebook: ['user_likes'], - github: ['user', 'repo'] - }, - requestOfflineToken: { - google: true - }, - passwordSignupFields: 'USERNAME_AND_OPTIONAL_EMAIL' - }); - -

Accounts (multi-server)

- -The `accounts-base` package exports two constructors, called -`AccountsClient` and `AccountsServer`, which are used to create the -`Accounts` object that is available on the client and the server, -respectively. - -This predefined `Accounts` object (along with similar convenience methods -of `Meteor`, such as [`Meteor.logout`](#meteor_logout)) is sufficient to -implement most accounts-related logic in Meteor apps. Nevertheless, these -two constructors can be instantiated more than once, to create multiple -independent connections between different accounts servers and their -clients, in more complicated authentication situations. - -{{> autoApiBox "AccountsClient" }} - -At most one of `options.connection` and `options.ddpUrl` should be -provided in any instantiation of `AccountsClient`. If neither is provided, -`Meteor.connection` will be used as the `.connection` property of the -`AccountsClient` instance. - -Note that `AccountsClient` is currently available only on the client, due -to its use of browser APIs such as `window.localStorage`. In principle, -though, it might make sense to establish a client connection from one -server to another remote accounts server. Please [let us -know](https://github.com/meteor/meteor/wiki/Contributing-to-Meteor#feature-requests) -if you find yourself needing this server-to-server functionality. - -{{> autoApiBox "AccountsServer" }} - -The `AccountsClient` and `AccountsServer` classes share a common -superclass, `AccountsCommon`. Methods defined on -`AccountsCommon.prototype` will be available on both the client and the -server, via the predefined `Accounts` object (most common) or any custom -`accountsClientOrServer` object created using the `AccountsClient` or -`AccountsServer` constructors (less common). - -Here are a few of those methods: - -{{> autoApiBox "AccountsCommon#userId" }} - -{{> autoApiBox "AccountsCommon#user" }} - -{{> autoApiBox "AccountsCommon#config"}} - -These methods are defined on `AccountsClient.prototype`, and are thus -available only on the client: - -{{> autoApiBox "AccountsClient#loggingIn"}} - -{{> autoApiBox "AccountsClient#logout"}} - -{{> autoApiBox "AccountsClient#logoutOtherClients"}} - -These methods are defined on `AccountsServer.prototype`, and are thus -available only on the server: - -{{> autoApiBox "AccountsServer#validateNewUser"}} - -This can be called multiple times. If any of the functions return `false` or -throw an error, the new user creation is aborted. To set a specific error -message (which will be displayed by [`accounts-ui`](#accountsui)), throw a new -[`Meteor.Error`](#meteor_error). - -Example: - - // Validate username, sending a specific error message on failure. - Accounts.validateNewUser(function (user) { - if (user.username && user.username.length >= 3) - return true; - throw new Meteor.Error(403, "Username must have at least 3 characters"); - }); - // Validate username, without a specific error message. - Accounts.validateNewUser(function (user) { - return user.username !== "root"; - }); - -If the user is being created as part of a login attempt from a client (eg, -calling [`Accounts.createUser`](#accounts_createuser) from the client, or -[logging in for the first time with an external -service](#meteor_loginwithexternalservice)), these callbacks are called *before* -the [`Accounts.validateLoginAttempt`](#accounts_validateloginattempt) -callbacks. If these callbacks succeed but those fail, the user will still be -created but the connection will not be logged in as that user. - -{{> autoApiBox "AccountsServer#onCreateUser"}} - -Use this when you need to do more than simply accept or reject new user -creation. With this function you can programatically control the -contents of new user documents. - -The function you pass will be called with two arguments: `options` and -`user`. The `options` argument comes -from [`Accounts.createUser`](#accounts_createuser) for -password-based users or from an external service login flow. `options` may come -from an untrusted client so make sure to validate any values you read from -it. The `user` argument is created on the server and contains a -proposed user object with all the automatically generated fields -required for the user to log in, including the `_id`. - -The function should return the user document (either the one passed in or a -newly-created object) with whatever modifications are desired. The returned -document is inserted directly into the [`Meteor.users`](#meteor_users) collection. - -The default create user function simply copies `options.profile` into -the new user document. Calling `onCreateUser` overrides the default -hook. This can only be called once. - -Example: - - - - // Support for playing D&D: Roll 3d6 for dexterity - Accounts.onCreateUser(function(options, user) { - var d6 = function () { return Math.floor(Random.fraction() * 6) + 1; }; - user.dexterity = d6() + d6() + d6(); - // We still want the default hook's 'profile' behavior. - if (options.profile) - user.profile = options.profile; - return user; - }); - - -{{> autoApiBox "AccountsServer#validateLoginAttempt"}} - -Call `validateLoginAttempt` with a callback to be called on login -attempts. It returns an object with a single method, `stop`. Calling -`stop()` unregisters the callback. - -When a login attempt is made, the registered validate login callbacks -are called with a single argument, the attempt info object: - -
-{{#dtdd name="type" type="String"}} - The service name, such as "password" or "twitter". -{{/dtdd}} - -{{#dtdd name="allowed" type="Boolean"}} - Whether this login is allowed and will be successful (if not aborted - by any of the validateLoginAttempt callbacks). False if the login - will not succeed (for example, an invalid password or the login was - aborted by a previous validateLoginAttempt callback). -{{/dtdd}} - -{{#dtdd name="error" type="Exception"}} - When `allowed` is false, the exception describing why the login - failed. It will be a `Meteor.Error` for failures reported to the - user (such as invalid password), and can be a another kind of - exception for internal errors. -{{/dtdd}} - -{{#dtdd name="user" type="Object"}} - When it is known which user was attempting to login, the Meteor user object. - This will always be present for successful logins. -{{/dtdd}} - -{{#dtdd name="connection" type="Object"}} - The `connection` object the request came in on. See - [`Meteor.onConnection`](#meteor_onconnection) for details. -{{/dtdd}} - -{{#dtdd name="methodName" type="String"}} - The name of the Meteor method being used to login. -{{/dtdd}} - -{{#dtdd name="methodArguments" type="Array"}} - An array of the arguments passed to the login method. -{{/dtdd}} -
- -A validate login callback must return a truthy value for the login to -proceed. If the callback returns a falsy value or throws an -exception, the login is aborted. Throwing a `Meteor.Error` will -report the error reason to the user. - -All registered validate login callbacks are called, even if one of the callbacks -aborts the login. The later callbacks will see the `allowed` field set to -`false` since the login will now not be successful. This allows later callbacks -to override an error from a previous callback; for example, you could override -the "Incorrect password" error with a different message. - -Validate login callbacks that aren't explicitly trying to override a previous -error generally have no need to run if the attempt has already been determined -to fail, and should start with - - if (!attempt.allowed) - return false; - - -{{> autoApiBox "AccountsCommon#onLogin"}} - -See description of [AccountsCommon#onLoginFailure](#accounts_onloginfailure) -for details. - -{{> autoApiBox "AccountsCommon#onLoginFailure"}} - -Either the `onLogin` or the `onLoginFailure` callbacks will be called -for each login attempt. The `onLogin` callbacks are called after the -user has been successfully logged in. The `onLoginFailure` callbacks are -called after a login attempt is denied. - -These functions return an object with a single method, `stop`. Calling -`stop()` unregisters the callback. - -On the server, the callbacks get a single argument, the same attempt info -object as [`validateLoginAttempt`](#accounts_validateloginattempt). On the -client, no arguments are passed. - -

Rate Limiting

- -By default, there are rules added to the [`DDPRateLimiter`](#ddpratelimiter) -that rate limit logins, new user registration and password reset calls to a -limit of 5 requests per 10 seconds per session. These are a basic solution -to dictionary attacks where a malicious user attempts to guess the passwords -of legitimate users by attempting all possible passwords. - -These rate limiting rules can be removed by calling -`Accounts.removeDefaultRateLimit()`. Please see the -[`DDPRateLimiter`](#ddpratelimiter) docs for more information. - -{{/template}} diff --git a/docs/client/full-api/api/assets.md b/docs/client/full-api/api/assets.md deleted file mode 100644 index a8c8819e67..0000000000 --- a/docs/client/full-api/api/assets.md +++ /dev/null @@ -1,22 +0,0 @@ -{{#template name="apiAssets"}} - -

Assets

- -`Assets` allows server code in a Meteor application to access static server -assets, which are located in the `private` subdirectory of an application's -tree. Assets are not processed as source files and are copied directly -into your application's bundle. - -{{> autoApiBox "Assets.getText"}} -{{> autoApiBox "Assets.getBinary"}} -{{> autoApiBox "Assets.absoluteFilePath"}} - -Static server assets are included by placing them in the application's `private` -subdirectory. For example, if an application's `private` subdirectory includes a -directory called `nested` with a file called `data.txt` inside it, then server -code can read `data.txt` by running: - - var data = Assets.getText('nested/data.txt'); - -Note: Packages can only access their own assets. If you need to read the assets of a different package, or of the enclosing app, you need to get a reference to that package's `Assets` object. -{{/template}} diff --git a/docs/client/full-api/api/blaze.md b/docs/client/full-api/api/blaze.md deleted file mode 100644 index c2a32e8d80..0000000000 --- a/docs/client/full-api/api/blaze.md +++ /dev/null @@ -1,308 +0,0 @@ -{{#template name="apiBlaze"}} - -

Blaze

- -Blaze is the package that makes reactive templates possible. -You can use the Blaze API directly in order to render templates programmatically -and manipulate "Views," the building blocks of reactive templates. For more -information, check out the [Blaze project page](https://www.meteor.com/blaze). - -{{> autoApiBox "Blaze.render"}} - -When you render a template, the callbacks added with -[`onCreated`](#template_onCreated) are invoked immediately, before evaluating -the content of the template. The callbacks added with -[`onRendered`](#template_onRendered) are invoked after the View is rendered and -inserted into the DOM. - -The rendered template -will update reactively in response to data changes until the View is -removed using [`Blaze.remove`](#blaze_remove) or the View's -parent element is removed by Meteor or jQuery. - -{{#warning}} -If the View is removed by some other mechanism -besides Meteor or jQuery (which Meteor integrates with by default), -the View may continue to update indefinitely. Most users will not need to -manually render templates and insert them into the DOM, but if you do, -be mindful to always call [`Blaze.remove`](#blaze_remove) when the View is -no longer needed. -{{/warning}} - -{{> autoApiBox "Blaze.renderWithData"}} - -`Blaze.renderWithData(Template.myTemplate, data)` is essentially the same as -`Blaze.render(Blaze.With(data, function () { return Template.myTemplate; }))`. - -{{> autoApiBox "Blaze.remove"}} - -Use `Blaze.remove` to remove a template or View previously inserted with -`Blaze.render`, in such a way that any behaviors attached to the DOM by -Meteor are cleaned up. The rendered template or View is now considered -["destroyed"](#template_onDestroyed), along with all nested templates and -Views. In addition, any data assigned via -jQuery to the DOM nodes is removed, as if the nodes were passed to -jQuery's `$(...).remove()`. - -As mentioned in [`Blaze.render`](#blaze_render), it is important to "remove" -all content rendered via `Blaze.render` using `Blaze.remove`, unless the -parent node of `renderedView` is removed by a Meteor reactive -update or with jQuery. - -`Blaze.remove` can be used even if the DOM nodes in question have already -been removed from the document, to tell Blaze to stop tracking and -updating these nodes. - -{{> autoApiBox "Blaze.getData"}} - -{{> autoApiBox "Blaze.toHTML"}} - -Rendering a template to HTML loses all fine-grained reactivity. The -normal way to render a template is to either include it from another -template (`{{dstache}}> myTemplate}}`) or render and insert it -programmatically using `Blaze.render`. Only occasionally -is generating HTML useful. - -Because `Blaze.toHTML` returns a string, it is not able to update the DOM -in response to reactive data changes. Instead, any reactive data -changes will invalidate the current Computation if there is one -(for example, an autorun that is the caller of `Blaze.toHTML`). - -{{> autoApiBox "Blaze.toHTMLWithData"}} - -{{> autoApiBox "Blaze.View"}} - -Behind every template or part of a template — a template tag, say, like `{{dstache}}foo}}` or `{{dstache}}#if}}` — is -a View object, which is a reactively updating region of DOM. - -Most applications do not need to be aware of these Views, but they offer a -way to understand and customize Meteor's rendering behavior for more -advanced applications and packages. - -You can obtain a View object by calling [`Blaze.render`](#blaze_render) on a -template, or by accessing [`template.view`](#template_view) on a template -instance. - -At the heart of a View is an [autorun](#tracker_autorun) that calls the View's -`renderFunction`, uses the result to create DOM nodes, and replaces the -contents of the View with these new DOM nodes. A View's content may consist -of any number of consecutive DOM nodes (though if it is zero, a placeholder -node such as a comment or an empty text node is automatically supplied). Any -reactive dependency established by `renderFunction` causes a full recalculation -of the View's contents when the dependency is invalidated. Templates, however, -are compiled in such a way that they do not have top-level dependencies and so -will only ever render once, while their parts may re-render many times. - -When a `Blaze.View` is constructed by calling the constructor, no hooks -are fired and no rendering is performed. In particular, the View is -not yet considered to be "created." Only when the View is actually -used, by a call to `Blaze.render` or `Blaze.toHTML` or by inclusion in -another View, is it "created," right before it is rendered for the -first time. When a View is created, its `.parentView` is set if -appropriate, and then the `onViewCreated` hook is fired. The term -"unrendered View" means a newly constructed View that has not been -"created" or rendered. - -The "current View" is kept in [`Blaze.currentView`](#blaze_currentview) and -is set during View rendering, callbacks, autoruns, and template event -handlers. It affects calls such as [`Template.currentData()`](#template_currentdata). - -The following properties and methods are available on Blaze.View: - -
-{{#dtdd name="name" type="String" id="view_name"}} - The name of this type of View. View names may be used to identify -particular kinds of Views in code, but more often they simply aid in -debugging and comprehensibility of the View tree. Views generated -by Meteor have names like "Template.foo" and "if". -{{/dtdd}} - -{{#dtdd name="parentView" type="View or null" id="view_parentview"}} - The enclosing View that caused this View to be rendered, if any. -{{/dtdd}} - -{{#dtdd name="isCreated" type="Boolean" id="view_iscreated"}} - True if this View has been called on to be rendered by `Blaze.render` - or `Blaze.toHTML` or another View. Once it becomes true, never - becomes false again. A "created" View's `.parentView` has been - set to its final value. `isCreated` is set to true before - `onViewCreated` hooks are called. -{{/dtdd}} - -{{#dtdd name="isRendered" type="Boolean" id="view_isrendered"}} - True if this View has been rendered to DOM by `Blaze.render` or - by the rendering of an enclosing View. Conversion to HTML by - `Blaze.toHTML` doesn't count. Once true, never becomes false. -{{/dtdd}} - -{{#dtdd name="isDestroyed" type="Boolean" id="view_isdestroyed"}} - True if this View has been destroyed, such as by `Blaze.remove()` or - by a reactive update that removes it. A destroyed View's autoruns - have been stopped, and its DOM nodes have generally been cleaned - of all Meteor reactivity and possibly dismantled. -{{/dtdd}} - -{{#dtdd name="renderCount" type="Integer" id="view_rendercount"}} - The number of times the View has been rendered, including the - current time if the View is in the process of being rendered - or re-rendered. -{{/dtdd}} - -{{#dtdd name="autorun(runFunc)" id="view_autorun"}} - Like [`Tracker.autorun`](#tracker_autorun), except that the autorun is - automatically stopped when the View is destroyed, and the - [current View](#blaze_currentview) is always set when running `runFunc`. - There is no relationship to the View's internal autorun or render - cycle. In `runFunc`, the View is bound to `this`. -{{/dtdd}} - -{{#dtdd name="onViewCreated(func)" id="view_onviewcreated"}} - If the View hasn't been created yet, calls `func` when the View - is created. In `func`, the View is bound to `this`. - - This hook is the basis for the [`created`](#template_created) - template callback. -{{/dtdd}} - -{{#dtdd name="onViewReady(func)" id="view_onviewready"}} - Calls `func` when the View is rendered and inserted into the DOM, - after waiting for the end of - [flush time](#tracker_afterflush). Does not fire if the View - is destroyed at any point before it would fire. - May fire multiple times (if the View re-renders). - In `func`, the View is bound to `this`. - - This hook is the basis for the [`rendered`](#template_rendered) - template callback. -{{/dtdd}} - -{{#dtdd name="onViewDestroyed(func)" id="view_onviewdestroyed"}} - If the View hasn't been destroyed yet, calls `func` when the - View is destroyed. A View may be destroyed without ever becoming - "ready." In `func`, the View is bound to `this`. - - This hook is the basis for the [`destroyed`](#template_destroyed) - template callback. -{{/dtdd}} - -{{#dtdd name="firstNode()" type="DOM node" id="view_firstnode"}} -The first node of the View's rendered content. Note that this may -be a text node. Requires that the View be rendered. -If the View rendered to zero DOM nodes, it may be a placeholder -node (comment or text node). The DOM extent of a View consists -of the nodes between `view.firstNode()` and `view.lastNode()`, -inclusive. -{{/dtdd}} - -{{#dtdd name="lastNode()" type="DOM node" id="view_lastnode"}} -The last node of the View's rendered content. - -See [`firstNode()`](#view_firstnode). -{{/dtdd}} - -{{#dtdd name="template" type="Template" id="view_template"}} -For Views created by invoking templates, the original Template -object. For example, `Blaze.render(Template.foo).template === Template.foo`. -{{/dtdd}} - -{{#dtdd name="templateInstance()" type="Template instance" -id="view_templateinstance"}} For Views created by invoking templates, -returns the [template instance](#template_inst) object for this -particular View. For example, in a [`created`](#template_created) -callback, `this.view.templateInstance() === this`. - -Template instance objects have fields like `data`, `firstNode`, and -`lastNode` which are not reactive and which are also not automatically -kept up to date. Calling `templateInstance()` causes these fields to -be updated. - -{{/dtdd}} - -
- -{{> autoApiBox "Blaze.currentView"}} - -The "current view" is used by [`Template.currentData()`](#template_currentdata) and -[`Template.instance()`](#template_instance) to determine -the contextually relevant data context and template instance. - -{{> autoApiBox "Blaze.getView"}} - -If you don't specify an `element`, there must be a current View or an -error will be thrown. This is in contrast to -[`Blaze.currentView`](#blaze_currentview). - -{{> autoApiBox "Blaze.With"}} - -Returns an unrendered View object you can pass to `Blaze.render`. - -Unlike `{{dstache}}#with}}` (as used in templates), `Blaze.With` has no "else" case, and -a falsy value for the data context will not prevent the content from -rendering. - -{{> autoApiBox "Blaze.If"}} - -Returns an unrendered View object you can pass to `Blaze.render`. - -Matches the behavior of `{{dstache}}#if}}` in templates. - -{{> autoApiBox "Blaze.Unless"}} - -Returns an unrendered View object you can pass to `Blaze.render`. - -Matches the behavior of `{{dstache}}#unless}}` in templates. - -{{> autoApiBox "Blaze.Each"}} - -Returns an unrendered View object you can pass to `Blaze.render`. - -Matches the behavior of `{{dstache}}#each}}` in templates. - -{{> autoApiBox "Blaze.Template"}} - -Templates defined by the template compiler, such as `Template.myTemplate`, -are objects of type `Blaze.Template` (aliased as `Template`). - -In addition to methods like `events` and `helpers`, documented as part of -the [Template API](#templates_api), the following fields and methods are -present on template objects: - -
- -{{#dtdd name="viewName" type="String" id="template_viewname"}} - Same as the constructor argument. -{{/dtdd}} - -{{#dtdd name="renderFunction" type="Function" id="template_renderfunction"}} - Same as the constructor argument. -{{/dtdd}} - -{{#dtdd name="constructView()" id="template_constructview"}} - Constructs and returns an unrendered View object. This method is invoked - by Meteor whenever the template is used, such as by `Blaze.render` or by - `{{dstache}}> foo}}` where `foo` resolves to a Template object. - - `constructView()` constructs a View using `viewName` and `renderFunction` - as constructor arguments, and then configures it as a template - View, setting up `view.template`, `view.templateInstance()`, event maps, and so on. -{{/dtdd}} - -
- -{{> autoApiBox "Blaze.isTemplate"}} - -{{> apiBoxTitle name="Renderable Content" id="renderable_content"}} - -A value is *renderable content* if it is one of the following: - -* A [template object](#templates_api) like `Template.myTemplate` -* An unrendered [View](#blaze_view) object, like the return value of `Blaze.With` -* `null` or `undefined` - -{{#note}} -Internally, renderable content includes objects representing HTML tags -as well, but these objects are not yet part of the officially-supported, -public API. -{{/note}} - -{{/template}} diff --git a/docs/client/full-api/api/check.md b/docs/client/full-api/api/check.md deleted file mode 100644 index b509323830..0000000000 --- a/docs/client/full-api/api/check.md +++ /dev/null @@ -1,154 +0,0 @@ -{{#template name="apiCheck"}} - -

Check

- -The `check` package includes pattern checking functions useful for checking the types and structure -of variables and an [extensible library of patterns](#matchpatterns) to specify which types you are -expecting. - -{{> autoApiBox "check"}} - -Meteor methods and publish functions can take arbitrary [EJSON](#ejson) types as arguments, but most -functions expect their arguments to be of a particular type. `check` is a lightweight function for -checking that arguments and other values are of the expected type. For example: - -```js -Meteor.publish("chats-in-room", function (roomId) { - // Make sure roomId is a string, not an arbitrary mongo selector object. - check(roomId, String); - return Chats.find({room: roomId}); -}); - -Meteor.methods({addChat: function (roomId, message) { - check(roomId, String); - check(message, { - text: String, - timestamp: Date, - // Optional, but if present must be an array of strings. - tags: Match.Maybe([String]) - }); - - // ... do something with the message ... -}}); -``` - -If the match fails, `check` throws a `Match.Error` describing how it failed. If -this error gets sent over the wire to the client, it will appear only as -`Meteor.Error(400, "Match Failed")`. The failure details will be written to the -server logs but not revealed to the client. - -{{> autoApiBox "Match.test"}} - -`Match.test` can be used to identify if a variable has a certain structure. - -```js -// will return true for {foo: 1, bar: "hello"} or similar -Match.test(value, {foo: Match.Integer, bar: String}); - -// will return true if value is a string -Match.test(value, String); - -// will return true if value is a String or an array of Numbers -Match.test(value, Match.OneOf(String, [Number])); -``` - -This can be useful if you have a function that accepts several different kinds -of objects, and you want to determine which was passed in. - -{{> apiBoxTitle name="Match Patterns" id="matchpatterns"}} - -The following patterns can be used as pattern arguments to -[`check`](#check) and `Match.test`: - - -
-{{#dtdd "Match.Any"}} -Matches any value. -{{/dtdd}} - -{{#dtdd "String, Number, Boolean, undefined, null"}} -Matches a primitive of the given type. -{{/dtdd}} - -{{#dtdd "Match.Integer"}} -Matches a signed 32-bit integer. Doesn't match `Infinity`, `-Infinity`, or `NaN`. -{{/dtdd}} - -{{#dtdd "[pattern]"}} -A one-element array matches an array of elements, each of which match -*pattern*. For example, `[Number]` matches a (possibly empty) array of numbers; -`[Match.Any]` matches any array. -{{/dtdd}} - -{{#dtdd "{key1: pattern1, key2: pattern2, ...}"}} -Matches an Object with the given keys, with values matching the given patterns. -If any *pattern* is a `Match.Maybe` or `Match.Optional`, that key does not need to exist -in the object. The value may not contain any keys not listed in the pattern. -The value must be a plain Object with no special prototype. -{{/dtdd}} - -{{#dtdd "Match.ObjectIncluding({key1: pattern1, key2: pattern2, ...})"}} -Matches an Object with the given keys; the value may also have other keys -with arbitrary values. -{{/dtdd}} - -{{#dtdd "Object"}} -Matches any plain Object with any keys; equivalent to -`Match.ObjectIncluding({})`. -{{/dtdd}} - - - -{{#dtdd "Match.Maybe(pattern)"}} - -Matches either `undefined`, `null`, or _pattern_. If used in an object, matches only if the key is -not set as opposed to the value being set to `undefined` or `null`. This set of conditions was -chosen because `undefined` arguments to Meteor Methods are converted to `null` when sent over the -wire. - -```js -// In an object -var pattern = { name: Match.Maybe(String) }; -check({ name: "something" }, pattern) // OK -check({}, pattern) // OK -check({ name: undefined }, pattern) // Throws an exception -check({ name: null }, pattern) // Throws an exception - -// Outside an object -check(null, Match.Maybe(String)); // OK -check(undefined, Match.Maybe(String)); // OK -``` -{{/dtdd}} - -{{#dtdd "Match.Optional(pattern)"}} - -Behaves like `Match.Maybe` except it doesn't accept `null`. If used in an object, the behavior is -identical to `Match.Maybe`. - -{{/dtdd}} - -{{#dtdd "Match.OneOf(pattern1, pattern2, ...)"}} -Matches any value that matches at least one of the provided patterns. -{{/dtdd}} - -{{#dtdd "Any constructor function (eg, Date)"}} -Matches any element that is an instance of that type. -{{/dtdd}} - -{{#dtdd "Match.Where(condition)"}} -Calls the function *condition* with the value as the argument. If *condition* -returns true, this matches. If *condition* throws a `Match.Error` or returns -false, this fails. If *condition* throws any other error, that error is thrown -from the call to `check` or `Match.test`. Examples: - - check(buffer, Match.Where(EJSON.isBinary)); - - NonEmptyString = Match.Where(function (x) { - check(x, String); - return x.length > 0; - }); - check(arg, NonEmptyString); -{{/dtdd}} -
- -{{/template}} diff --git a/docs/client/full-api/api/collections.md b/docs/client/full-api/api/collections.md deleted file mode 100644 index 60cb9736a7..0000000000 --- a/docs/client/full-api/api/collections.md +++ /dev/null @@ -1,865 +0,0 @@ -{{#template name="apiCollections"}} - - -

Collections

- -Meteor stores data in *collections*. To get started, declare a -collection with `new Mongo.Collection`. - -{{> autoApiBox "Mongo.Collection"}} - -Calling this function is analogous to declaring a model in a traditional ORM -(Object-Relation Mapper)-centric framework. It sets up a *collection* (a storage -space for records, or "documents") that can be used to store a particular type -of information, like users, posts, scores, todo items, or whatever matters to -your application. Each document is a EJSON object. It includes an `_id` -property whose value is unique in the collection, which Meteor will set when you -first create the document. - - // common code on client and server declares a DDP-managed mongo - // collection. - Chatrooms = new Mongo.Collection("chatrooms"); - Messages = new Mongo.Collection("messages"); - -The function returns an object with methods to [`insert`](#insert) -documents in the collection, [`update`](#update) their properties, and -[`remove`](#remove) them, and to [`find`](#find) the documents in the -collection that match arbitrary criteria. The way these methods work is -compatible with the popular Mongo database API. The same database API -works on both the client and the server (see below). - - // return array of my messages - var myMessages = Messages.find({userId: Session.get('myUserId')}).fetch(); - - // create a new message - Messages.insert({text: "Hello, world!"}); - - // mark my first message as "important" - Messages.update(myMessages[0]._id, {$set: {important: true}}); - -If you pass a `name` when you create the collection, then you are -declaring a persistent collection — one that is stored on the -server and seen by all users. Client code and server code can both -access the same collection using the same API. - -Specifically, when you pass a `name`, here's what happens: - -* On the server (if you do not specify a `connection`), a collection with that -name is created on a backend Mongo server. When you call methods on that -collection on the server, they translate directly into normal Mongo operations -(after checking that they match your [access control rules](#allow)). - -* On the client (and on the server if you specify a `connection`), a Minimongo -instance is created. Minimongo is essentially an in-memory, non-persistent -implementation of Mongo in pure JavaScript. It serves as a local cache that -stores just the subset of the database that this client is working with. Queries -([`find`](#find)) on these collections are served directly out of this cache, -without talking to the server. - -* When you write to the database on the client ([`insert`](#insert), -[`update`](#update), [`remove`](#remove)), the command is executed locally -immediately, and, simultaneously, it's sent to the server and executed -there too. This happens via [stubs](#meteor_methods), because writes are -implemented as methods. - -{{#note}} -When, on the server, you write to a collection which has a specified -`connection` to another server, it sends the corresponding method to the other -server and receives the changed values back from it over DDP. Unlike on the -client, it does not execute the write locally first. -{{/note}} - -If you pass `null` as the `name`, then you're creating a local -collection. It's not synchronized anywhere; it's just a local scratchpad -that supports Mongo-style [`find`](#find), [`insert`](#insert), -[`update`](#update), and [`remove`](#remove) operations. (On both the -client and the server, this scratchpad is implemented using Minimongo.) - -By default, Meteor automatically publishes every document in your -collection to each connected client. To turn this behavior off, remove -the `autopublish` package, in your terminal: - -```bash -meteor remove autopublish -``` - -and instead call [`Meteor.publish`](#meteor_publish) to specify which parts of -your collection should be published to which users. - -```js -// Create a collection called Posts and put a document in it. The -// document will be immediately visible in the local copy of the -// collection. It will be written to the server-side database -// a fraction of a second later, and a fraction of a second -// after that, it will be synchronized down to any other clients -// that are subscribed to a query that includes it (see -// Meteor.subscribe and autopublish) -Posts = new Mongo.Collection("posts"); -Posts.insert({title: "Hello world", body: "First post"}); - -// Changes are visible immediately -- no waiting for a round trip to -// the server. -assert(Posts.find().count() === 1); - -// Create a temporary, local collection. It works just like any other -// collection, but it doesn't send changes to the server, and it -// can't receive any data from subscriptions. -Scratchpad = new Mongo.Collection; -for (var i = 0; i < 10; i++) - Scratchpad.insert({number: i * 2}); -assert(Scratchpad.find({number: {$lt: 9}}).count() === 5); -``` - -Generally, you'll assign `Mongo.Collection` objects in your app to global -variables. You can only create one `Mongo.Collection` object for each -underlying Mongo collection. - -If you specify a `transform` option to the `Collection` or any of its retrieval -methods, documents are passed through the `transform` function before being -returned or passed to callbacks. This allows you to add methods or otherwise -modify the contents of your collection from their database representation. You -can also specify `transform` on a particular `find`, `findOne`, `allow`, or -`deny` call. Transform functions must return an object and they may not change -the value of the document's `_id` field (though it's OK to leave it out). - - // An Animal class that takes a document in its constructor - Animal = function (doc) { - _.extend(this, doc); - }; - _.extend(Animal.prototype, { - makeNoise: function () { - console.log(this.sound); - } - }); - - // Define a Collection that uses Animal as its document - Animals = new Mongo.Collection("Animals", { - transform: function (doc) { return new Animal(doc); } - }); - - // Create an Animal and call its makeNoise method - Animals.insert({name: "raptor", sound: "roar"}); - Animals.findOne({name: "raptor"}).makeNoise(); // prints "roar" - -`transform` functions are not called reactively. If you want to add a -dynamically changing attribute to an object, do it with a function that computes -the value at the time it's called, not by computing the attribute at `transform` -time. - -{{#warning}} -In this release, Minimongo has some limitations: - -* `$pull` in modifiers can only accept certain kinds -of selectors. -* `findAndModify`, aggregate functions, and -map/reduce aren't supported. - -All of these will be addressed in a future release. For full -Minimongo release notes, see packages/minimongo/NOTES -in the repository. -{{/warning}} - -{{#warning}} -Minimongo doesn't currently have indexes. It's rare for this to be an -issue, since it's unusual for a client to have enough data that an -index is worthwhile. -{{/warning}} - -Read more about collections and how to use them in the [Collections](http://guide.meteor.com/collections.html) article in the Meteor Guide. - -{{> autoApiBox "Mongo.Collection#find"}} - -`find` returns a cursor. It does not immediately access the database or return -documents. Cursors provide `fetch` to return all matching documents, `map` and -`forEach` to iterate over all matching documents, and `observe` and -`observeChanges` to register callbacks when the set of matching documents -changes. - -{{#warning}} -Collection cursors are not query snapshots. If the database changes -between calling `Collection.find` and fetching the -results of the cursor, or while fetching results from the cursor, -those changes may or may not appear in the result set. -{{/warning}} - -Cursors are a reactive data source. On the client, the first time you retrieve a -cursor's documents with `fetch`, `map`, or `forEach` inside a -reactive computation (eg, a template or -[`autorun`](#tracker_autorun)), Meteor will register a -dependency on the underlying data. Any change to the collection that -changes the documents in a cursor will trigger a recomputation. To -disable this behavior, pass `{reactive: false}` as an option to -`find`. - -Note that when `fields` are specified, only changes to the included -fields will trigger callbacks in `observe`, `observeChanges` and -invalidations in reactive computations using this cursor. Careful use -of `fields` allows for more fine-grained reactivity for computations -that don't depend on an entire document. - -{{> autoApiBox "Mongo.Collection#findOne"}} - -Equivalent to `find(selector, options).fetch()[0]` with -`options.limit = 1`. - -{{> autoApiBox "Mongo.Collection#insert"}} - -Add a document to the collection. A document is just an object, and -its fields can contain any combination of EJSON-compatible datatypes -(arrays, objects, numbers, strings, `null`, true, and false). - -`insert` will generate a unique ID for the object you pass, insert it -in the database, and return the ID. When `insert` is called from -untrusted client code, it will be allowed only if passes any -applicable [`allow`](#allow) and [`deny`](#deny) rules. - -On the server, if you don't provide a callback, then `insert` blocks -until the database acknowledges the write, or throws an exception if -something went wrong. If you do provide a callback, `insert` still -returns the ID immediately. Once the insert completes (or fails), the -callback is called with error and result arguments. In an error case, -`result` is undefined. If the insert is successful, `error` is -undefined and `result` is the new document ID. - -On the client, `insert` never blocks. If you do not provide a callback -and the insert fails on the server, then Meteor will log a warning to -the console. If you provide a callback, Meteor will call that function -with `error` and `result` arguments. In an error case, `result` is -undefined. If the insert is successful, `error` is undefined and -`result` is the new document ID. - -Example: - - var groceriesId = Lists.insert({name: "Groceries"}); - Items.insert({list: groceriesId, name: "Watercress"}); - Items.insert({list: groceriesId, name: "Persimmons"}); - -{{> autoApiBox "Mongo.Collection#update"}} - -Modify documents that match `selector` according to `modifier` (see -[modifier documentation](#modifiers)). - -The behavior of `update` differs depending on whether it is called by -trusted or untrusted code. Trusted code includes server code and -method code. Untrusted code includes client-side code such as event -handlers and a browser's JavaScript console. - -- Trusted code can modify multiple documents at once by setting - `multi` to true, and can use an arbitrary [Mongo - selector](#selectors) to find the documents to modify. It bypasses - any access control rules set up by [`allow`](#allow) and - [`deny`](#deny). The number of affected documents will be returned - from the `update` call if you don't pass a callback. - -- Untrusted code can only modify a single document at once, specified - by its `_id`. The modification is allowed only after checking any - applicable [`allow`](#allow) and [`deny`](#deny) rules. The number - of affected documents will be returned to the callback. Untrusted - code cannot perform upserts, except in insecure mode. - -On the server, if you don't provide a callback, then `update` blocks -until the database acknowledges the write, or throws an exception if -something went wrong. If you do provide a callback, `update` returns -immediately. Once the update completes, the callback is called with a -single error argument in the case of failure, or a second argument -indicating the number of affected documents if the update was successful. - -On the client, `update` never blocks. If you do not provide a callback -and the update fails on the server, then Meteor will log a warning to -the console. If you provide a callback, Meteor will call that function -with an error argument if there was an error, or a second argument -indicating the number of affected documents if the update was successful. - -Client example: - - // When the givePoints button in the admin dashboard is pressed, - // give 5 points to the current player. The new score will be - // immediately visible on everyone's screens. - Template.adminDashboard.events({ - 'click .givePoints': function () { - Players.update(Session.get("currentPlayer"), {$inc: {score: 5}}); - } - }); - -Server example: - - // Give the "Winner" badge to each user with a score greater than - // 10. If they are logged in and their badge list is visible on the - // screen, it will update automatically as they watch. - Meteor.methods({ - declareWinners: function () { - Players.update({score: {$gt: 10}}, - {$addToSet: {badges: "Winner"}}, - {multi: true}); - } - }); - -You can use `update` to perform a Mongo upsert by setting the `upsert` -option to true. You can also use the [`upsert`](#upsert) method to perform an -upsert that returns the _id of the document that was inserted (if there was one) -in addition to the number of affected documents. - -{{> autoApiBox "Mongo.Collection#upsert"}} - -Modify documents that match `selector` according to `modifier`, or insert -a document if no documents were modified. `upsert` is the same as calling -`update` with the `upsert` option set to true, except that the return -value of `upsert` is an object that contain the keys `numberAffected` -and `insertedId`. (`update` returns only the number of affected documents.) - -{{> autoApiBox "Mongo.Collection#remove"}} - -Find all of the documents that match `selector` and delete them from -the collection. - -The behavior of `remove` differs depending on whether it is called by -trusted or untrusted code. Trusted code includes server code and -method code. Untrusted code includes client-side code such as event -handlers and a browser's JavaScript console. - -- Trusted code can use an arbitrary [Mongo selector](#selectors) to - find the documents to remove, and can remove more than one document - at once by passing a selector that matches multiple documents. It - bypasses any access control rules set up by [`allow`](#allow) and - [`deny`](#deny). The number of removed documents will be returned - from `remove` if you don't pass a callback. - - As a safety measure, if `selector` is omitted (or is `undefined`), - no documents will be removed. Set `selector` to `{}` if you really - want to remove all documents from your collection. - -- Untrusted code can only remove a single document at a time, - specified by its `_id`. The document is removed only after checking - any applicable [`allow`](#allow) and [`deny`](#deny) rules. The - number of removed documents will be returned to the callback. - -On the server, if you don't provide a callback, then `remove` blocks -until the database acknowledges the write and then returns the number -of removed documents, or throws an exception if -something went wrong. If you do provide a callback, `remove` returns -immediately. Once the remove completes, the callback is called with a -single error argument in the case of failure, or a second argument -indicating the number of removed documents if the remove was successful. - -On the client, `remove` never blocks. If you do not provide a callback -and the remove fails on the server, then Meteor will log a warning to the -console. If you provide a callback, Meteor will call that function with an -error argument if there was an error, or a second argument indicating the number -of removed documents if the remove was successful. - -Client example: - - // When the remove button is clicked on a chat message, delete - // that message. - Template.chat.events({ - 'click .remove': function () { - Messages.remove(this._id); - } - }); - -Server example: - - // When the server starts, clear the log, and delete all players - // with a karma of less than -2. - Meteor.startup(function () { - if (Meteor.isServer) { - Logs.remove({}); - Players.remove({karma: {$lt: -2}}); - } - }); - -{{> autoApiBox "Mongo.Collection#allow"}} - -When a client calls `insert`, `update`, or `remove` on a collection, the -collection's `allow` and [`deny`](#deny) callbacks are called -on the server to determine if the write should be allowed. If at least -one `allow` callback allows the write, and no `deny` callbacks deny the -write, then the write is allowed to proceed. - -These checks are run only when a client tries to write to the database -directly, for example by calling `update` from inside an event -handler. Server code is trusted and isn't subject to `allow` and `deny` -restrictions. That includes methods that are called with `Meteor.call` -— they are expected to do their own access checking rather than -relying on `allow` and `deny`. - -You can call `allow` as many times as you like, and each call can -include any combination of `insert`, `update`, and `remove` -functions. The functions should return `true` if they think the -operation should be allowed. Otherwise they should return `false`, or -nothing at all (`undefined`). In that case Meteor will continue -searching through any other `allow` rules on the collection. - -The available callbacks are: - -
-{{#dtdd "insert(userId, doc)"}} -The user `userId` wants to insert the document `doc` into the -collection. Return `true` if this should be allowed. - -`doc` will contain the `_id` field if one was explicitly set by the client, or -if there is an active `transform`. You can use this to prevent users from -specifying arbitrary `_id` fields. -{{/dtdd}} - -{{#dtdd "update(userId, doc, fieldNames, modifier)"}} - -The user `userId` wants to update a document `doc`. (`doc` is the -current version of the document from the database, without the -proposed update.) Return `true` to permit the change. - -`fieldNames` is an array of the (top-level) fields in `doc` that the -client wants to modify, for example -`['name',` `'score']`. - -`modifier` is the raw Mongo modifier that -the client wants to execute; for example, -`{$set: {'name.first': "Alice"}, $inc: {score: 1}}`. - -Only Mongo modifiers are supported (operations like `$set` and `$push`). -If the user tries to replace the entire document rather than use -$-modifiers, the request will be denied without checking the `allow` -functions. - -{{/dtdd}} - -{{#dtdd "remove(userId, doc)"}} - -The user `userId` wants to remove `doc` from the database. Return -`true` to permit this. - -{{/dtdd}} - -
- -When calling `update` or `remove` Meteor will by default fetch the -entire document `doc` from the database. If you have large documents -you may wish to fetch only the fields that are actually used by your -functions. Accomplish this by setting `fetch` to an array of field -names to retrieve. - -Example: - -```js -// Create a collection where users can only modify documents that -// they own. Ownership is tracked by an 'owner' field on each -// document. All documents must be owned by the user that created -// them and ownership can't be changed. Only a document's owner -// is allowed to delete it, and the 'locked' attribute can be -// set on a document to prevent its accidental deletion. - -Posts = new Mongo.Collection("posts"); - -Posts.allow({ - insert: function (userId, doc) { - // the user must be logged in, and the document must be owned by the user - return (userId && doc.owner === userId); - }, - update: function (userId, doc, fields, modifier) { - // can only change your own documents - return doc.owner === userId; - }, - remove: function (userId, doc) { - // can only remove your own documents - return doc.owner === userId; - }, - fetch: ['owner'] -}); - -Posts.deny({ - update: function (userId, doc, fields, modifier) { - // can't change owners - return _.contains(fields, 'owner'); - }, - remove: function (userId, doc) { - // can't remove locked documents - return doc.locked; - }, - fetch: ['locked'] // no need to fetch 'owner' -}); -``` - -If you never set up any `allow` rules on a collection then all client -writes to the collection will be denied, and it will only be possible to -write to the collection from server-side code. In this case you will -have to create a method for each possible write that clients are allowed -to do. You'll then call these methods with `Meteor.call` rather than -having the clients call `insert`, `update`, and `remove` directly on the -collection. - -Meteor also has a special "insecure mode" for quickly prototyping new -applications. In insecure mode, if you haven't set up any `allow` or `deny` -rules on a collection, then all users have full write access to the -collection. This is the only effect of insecure mode. If you call `allow` or -`deny` at all on a collection, even `Posts.allow({})`, then access is checked -just like normal on that collection. __New Meteor projects start in insecure -mode by default.__ To turn it off just run in your terminal: - -```bash -meteor remove insecure -``` - -{{> autoApiBox "Mongo.Collection#deny"}} - -This works just like [`allow`](#allow), except it lets you -make sure that certain writes are definitely denied, even if there is an -`allow` rule that says that they should be permitted. - -When a client tries to write to a collection, the Meteor server first -checks the collection's `deny` rules. If none of them return true then -it checks the collection's `allow` rules. Meteor allows the write only -if no `deny` rules return `true` and at least one `allow` rule returns -`true`. - -{{> autoApiBox "Mongo.Collection#rawCollection"}} - -{{> autoApiBox "Mongo.Collection#rawDatabase"}} - -

Cursors

- -To create a cursor, use [`find`](#find). To access the documents in a -cursor, use [`forEach`](#foreach), [`map`](#map), or [`fetch`](#fetch). - -{{> autoApiBox "Mongo.Cursor#forEach"}} - -This interface is compatible with [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach). - -When called from a reactive computation, `forEach` registers dependencies on -the matching documents. - -Examples: - - // Print the titles of the five top-scoring posts - var topPosts = Posts.find({}, {sort: {score: -1}, limit: 5}); - var count = 0; - topPosts.forEach(function (post) { - console.log("Title of post " + count + ": " + post.title); - count += 1; - }); - -{{> autoApiBox "Mongo.Cursor#map"}} - -This interface is compatible with [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map). - -When called from a reactive computation, `map` registers dependencies on -the matching documents. - - -On the server, if `callback` yields, other calls to `callback` may occur while -the first call is waiting. If strict sequential execution is necessary, use -`forEach` instead. - -{{> autoApiBox "Mongo.Cursor#fetch"}} - -When called from a reactive computation, `fetch` registers dependencies on -the matching documents. - -{{> autoApiBox "Mongo.Cursor#count"}} - -Unlike the other functions, `count` registers a dependency only on the -number of matching documents. (Updates that just change or reorder the -documents in the result set will not trigger a recomputation.) - -{{> autoApiBox "Mongo.Cursor#observe"}} - -Establishes a *live query* that invokes callbacks when the result of -the query changes. The callbacks receive the entire contents of the -document that was affected, as well as its old contents, if -applicable. If you only need to receive the fields that changed, see -[`observeChanges`](#observe_changes). - -`callbacks` may have the following functions as properties: - -
-
added(document) or
-
addedAt(document, atIndex, before)
-
-{{#markdown}} -A new document `document` entered the result set. The new document -appears at position `atIndex`. It is immediately before the document -whose `_id` is `before`. `before` will be `null` if the new document -is at the end of the results. -{{/markdown}} -
- -
changed(newDocument, oldDocument) - or
-
changedAt(newDocument, oldDocument, atIndex)
-
-{{#markdown}} -The contents of a document were previously `oldDocument` and are now -`newDocument`. The position of the changed document is `atIndex`. -{{/markdown}} -
- -
removed(oldDocument) - or
-
removedAt(oldDocument, atIndex)
-
-{{#markdown}} -The document `oldDocument` is no longer in the result set. It used to be at position `atIndex`. -{{/markdown}} -
- -{{#dtdd "movedTo(document, fromIndex, toIndex, before)"}} -A document changed its position in the result set, from `fromIndex` to `toIndex` -(which is before the document with id `before`). Its current contents is -`document`. -{{/dtdd}} -
- -Use `added`, `changed`, and `removed` when you don't care about the -order of the documents in the result set. They are more efficient than -`addedAt`, `changedAt`, and `removedAt`. - -Before `observe` returns, `added` (or `addedAt`) will be called zero -or more times to deliver the initial results of the query. - -`observe` returns a live query handle, which is an object with a `stop` method. -Call `stop` with no arguments to stop calling the callback functions and tear -down the query. **The query will run forever until you call this.** If -`observe` is called from a `Tracker.autorun` computation, it is automatically -stopped when the computation is rerun or stopped. -(If the cursor was created with the option `reactive` set to false, it will -only deliver the initial results and will not call any further callbacks; -it is not necessary to call `stop` on the handle.) - - -{{> autoApiBox "Mongo.Cursor#observeChanges"}} - -Establishes a *live query* that invokes callbacks when the result of -the query changes. In contrast to [`observe`](#observe), -`observeChanges` provides only the difference between the old and new -result set, not the entire contents of the document that changed. - -`callbacks` may have the following functions as properties: - -
-
added(id, fields) - or
-
addedBefore(id, fields, before)
-
-{{#markdown}} -A new document entered the result set. It has the `id` and `fields` -specified. `fields` contains all fields of the document excluding the -`_id` field. The new document is before the document identified by -`before`, or at the end if `before` is `null`. -{{/markdown}} -
- -{{#dtdd "changed(id, fields)"}} -The document identified by `id` has changed. `fields` contains the -changed fields with their new values. If a field was removed from the -document then it will be present in `fields` with a value of -`undefined`. -{{/dtdd}} - -{{#dtdd "movedBefore(id, before)"}} -The document identified by `id` changed its position in the ordered result set, -and now appears before the document identified by `before`. -{{/dtdd}} - -{{#dtdd "removed(id)"}} -The document identified by `id` was removed from the result set. -{{/dtdd}} -
- -`observeChanges` is significantly more efficient if you do not use -`addedBefore` or `movedBefore`. - -Before `observeChanges` returns, `added` (or `addedBefore`) will be called -zero or more times to deliver the initial results of the query. - -`observeChanges` returns a live query handle, which is an object with a `stop` -method. Call `stop` with no arguments to stop calling the callback functions -and tear down the query. **The query will run forever until you call this.** -If -`observeChanges` is called from a `Tracker.autorun` computation, it is automatically -stopped when the computation is rerun or stopped. -(If the cursor was created with the option `reactive` set to false, it will -only deliver the initial results and will not call any further callbacks; -it is not necessary to call `stop` on the handle.) - -{{#note}} -Unlike `observe`, `observeChanges` does not provide absolute position -information (that is, `atIndex` positions rather than `before` -positions.) This is for efficiency. -{{/note}} - -Example: - -```js -// Keep track of how many administrators are online. -var count = 0; -var query = Users.find({admin: true, onlineNow: true}); -var handle = query.observeChanges({ - added: function (id, user) { - count++; - console.log(user.name + " brings the total to " + count + " admins."); - }, - removed: function () { - count--; - console.log("Lost one. We're now down to " + count + " admins."); - } -}); - -// After five seconds, stop keeping the count. -setTimeout(function () {handle.stop();}, 5000); -``` - -{{> autoApiBox "Mongo.ObjectID"}} - -`Mongo.ObjectID` follows the same API as the [Node MongoDB driver -`ObjectID`](http://mongodb.github.com/node-mongodb-native/api-bson-generated/objectid.html) -class. Note that you must use the `equals` method (or [`EJSON.equals`](#ejson_equals)) to -compare them; the `===` operator will not work. If you are writing generic code -that needs to deal with `_id` fields that may be either strings or `ObjectID`s, use -[`EJSON.equals`](#ejson_equals) instead of `===` to compare them. - -{{#note}} - `ObjectID` values created by Meteor will not have meaningful answers to their `getTimestamp` - method, since Meteor currently constructs them fully randomly. -{{/note}} - - - -{{> apiBoxTitle name="Mongo-Style Selectors" id="selectors"}} - -The simplest selectors are just a string or -[`Mongo.ObjectID`](#mongo_object_id). These selectors match the -document with that value in its `_id` field. - -A slightly more complex form of selector is an object containing a set of keys -that must match in a document: - -```js -// Matches all documents where deleted is false -{deleted: false} - -// Matches all documents where the name and cognomen are as given -{name: "Rhialto", cognomen: "the Marvelous"} - -// Matches every document -{} -``` - -But they can also contain more complicated tests: - -```js -// Matches documents where age is greater than 18 -{age: {$gt: 18}} - -// Also matches documents where tags is an array containing "popular" -{tags: "popular"} - -// Matches documents where fruit is one of three possibilities -{fruit: {$in: ["peach", "plum", "pear"]}} -``` - -See the [complete -documentation](http://docs.mongodb.org/manual/reference/operator/). - -{{> apiBoxTitle name="Mongo-Style Modifiers" id="modifiers"}} - -A modifier is an object that describes how to update a document in -place by changing some of its fields. Some examples: - -```js -// Set the 'admin' property on the document to true -{$set: {admin: true}} - -// Add 2 to the 'votes' property, and add "Traz" -// to the end of the 'supporters' array -{$inc: {votes: 2}, $push: {supporters: "Traz"}} -``` - -But if a modifier doesn't contain any $-operators, then it is instead -interpreted as a literal document, and completely replaces whatever was -previously in the database. (Literal document modifiers are not currently -supported by [validated updates](#allow).) - -``` -// Find the document with id "123", and completely replace it. -Users.update({_id: "123"}, {name: "Alice", friends: ["Bob"]}); -``` - -See the [full list of -modifiers](http://docs.mongodb.org/manual/reference/operator/update/). - - -{{> apiBoxTitle name="Sort Specifiers" id="sortspecifiers"}} - -Sorts may be specified using your choice of several syntaxes: - -``` -// All of these do the same thing (sort in ascending order by -// key "a", breaking ties in descending order of key "b") - -[["a", "asc"], ["b", "desc"]] -["a", ["b", "desc"]] -{a: 1, b: -1} -``` - -The last form will only work if your JavaScript implementation -preserves the order of keys in objects. Most do, most of the time, but -it's up to you to be sure. - -For local collections you can pass a comparator function which receives two -document objects, and returns -1 if the first document comes first in order, -1 if the second document comes first, or 0 if neither document comes before -the other. This is a Minimongo extension to MongoDB. - - -{{> apiBoxTitle name="Field Specifiers" id="fieldspecifiers"}} - -Queries can specify a particular set of fields to include or exclude from the -result object. - -To exclude specific fields from the result objects, the field specifier is a -dictionary whose keys are field names and whose values are `0`. All unspecified -fields are included. - -```js -Users.find({}, {fields: {password: 0, hash: 0}}) -``` - -To include only specific fields in the result documents, use `1` as -the value. The `_id` field is still included in the result. - -```js -Users.find({}, {fields: {firstname: 1, lastname: 1}}) -``` - -With one exception, it is not possible to mix inclusion and exclusion styles: -the keys must either be all 1 or all 0. The exception is that you may specify -`_id: 0` in an inclusion specifier, which will leave `_id` out of the result -object as well. However, such field specifiers can not be used with -[`observeChanges`](#observe_changes), [`observe`](#observe), cursors returned -from a [publish function](#meteor_publish), or cursors used in -`{{dstache}}#each}}` in a template. They may be used with [`fetch`](#fetch), -[`findOne`](#findone), [`forEach`](#foreach), and [`map`](#map). - - -Field -operators such as `$` and `$elemMatch` are not available on the client side -yet. - -A more advanced example: - -```js -Users.insert({ alterEgos: [{ name: "Kira", alliance: "murderer" }, - { name: "L", alliance: "police" }], - name: "Yagami Light" }); - -Users.findOne({}, { fields: { 'alterEgos.name': 1, _id: 0 } }); - -// returns { alterEgos: [{ name: "Kira" }, { name: "L" }] } -``` - -See -the MongoDB docs for details of the nested field rules and array behavior. - - - -{{/template}} diff --git a/docs/client/full-api/api/connections.md b/docs/client/full-api/api/connections.md deleted file mode 100644 index a4c6dd7547..0000000000 --- a/docs/client/full-api/api/connections.md +++ /dev/null @@ -1,168 +0,0 @@ -{{#template name="apiConnections"}} - -

Server connections

- -These functions manage and inspect the network connection between the -Meteor client and server. - -{{> autoApiBox "Meteor.status"}} - -This method returns the status of the connection between the client and -the server. The return value is an object with the following fields: - -
-{{#dtdd name="connected" type="Boolean"}} - True if currently connected to the server. If false, changes and - method invocations will be queued up until the connection is - reestablished. -{{/dtdd}} - -{{#dtdd name="status" type="String"}} - Describes the current reconnection status. The possible - values are `connected` (the connection is up and - running), `connecting` (disconnected and trying to open a - new connection), `failed` (permanently failed to connect; e.g., the client - and server support different versions of DDP), `waiting` (failed - to connect and waiting to try to reconnect) and `offline` (user has disconnected the connection). -{{/dtdd}} - -{{#dtdd name="retryCount" type="Number"}} - The number of times the client has tried to reconnect since the - connection was lost. 0 when connected. -{{/dtdd}} - -{{#dtdd name="retryTime" type="Number or undefined"}} - The estimated time of the next reconnection attempt. To turn this - into an interval until the next reconnection, use - `retryTime - (new Date()).getTime()`. This key will - be set only when `status` is `waiting`. -{{/dtdd}} - -{{#dtdd name="reason" type="String or undefined"}} - If `status` is `failed`, a description of why the connection failed. -{{/dtdd}} -
- -Instead of using callbacks to notify you on changes, this is -a [reactive](#reactivity) data source. You can use it in a -[template](#livehtmltemplates) or [computation](#tracker_autorun) -to get realtime updates. - -{{> autoApiBox "Meteor.reconnect"}} - -{{> autoApiBox "Meteor.disconnect"}} - -Call this method to disconnect from the server and stop all -live data updates. While the client is disconnected it will not receive -updates to collections, method calls will be queued until the -connection is reestablished, and hot code push will be disabled. - -Call [Meteor.reconnect](#meteor_reconnect) to reestablish the connection -and resume data transfer. - -This can be used to save battery on mobile devices when real time -updates are not required. - - -{{> autoApiBox "Meteor.onConnection"}} - -`onConnection` returns an object with a single method `stop`. Calling -`stop` unregisters the callback, so that this callback will no longer -be called on new connections. - -The callback is called with a single argument, the server-side -`connection` representing the connection from the client. This object -contains the following fields: - -
-{{#dtdd name="id" type="String"}} -A globally unique id for this connection. -{{/dtdd}} - -{{#dtdd name="close" type="Function"}} -Close this DDP connection. The client is free to reconnect, but will -receive a different connection with a new `id` if it does. -{{/dtdd}} - -{{#dtdd name="onClose" type="Function"}} -Register a callback to be called when the connection is closed. If the -connection is already closed, the callback will be called immediately. -{{/dtdd}} - -{{#dtdd name="clientAddress" type="String"}} - The IP address of the client in dotted form (such as `"127.0.0.1"`). - - If you're running your Meteor server behind a proxy (so that clients - are connecting to the proxy instead of to your server directly), - you'll need to set the `HTTP_FORWARDED_COUNT` environment variable - for the correct IP address to be reported by `clientAddress`. - - Set `HTTP_FORWARDED_COUNT` to an integer representing the number of - proxies in front of your server. For example, you'd set it to `"1"` - when your server was behind one proxy. -{{/dtdd}} - -{{#dtdd name="httpHeaders" type="Object"}} - When the connection came in over an HTTP transport (such as with - Meteor's default SockJS implementation), this field contains - whitelisted HTTP headers. - - Cookies are deliberately excluded from the headers as they are a - security risk for this transport. For details and alternatives, see - the [SockJS - documentation](https://github.com/sockjs/sockjs-node#authorisation). -{{/dtdd}} -
- -{{#note}} - -Currently when a client reconnects to the server (such as after -temporarily losing its Internet connection), it will get a new -connection each time. The `onConnection` callbacks will be called -again, and the new connection will have a new connection `id`. - -In the future, when client reconnection is fully implemented, -reconnecting from the client will reconnect to the same connection on -the server: the `onConnection` callback won't be called for that -connection again, and the connection will still have the same -connection `id`. - -{{/note}} - - -{{> autoApiBox "DDP.connect"}} - -To call methods on another Meteor application or subscribe to its data -sets, call `DDP.connect` with the URL of the application. -`DDP.connect` returns an object which provides: - -* `subscribe` - - Subscribe to a record set. See - [Meteor.subscribe](#meteor_subscribe). -* `call` - - Invoke a method. See [Meteor.call](#meteor_call). -* `apply` - - Invoke a method with an argument array. See - [Meteor.apply](#meteor_apply). -* `methods` - - Define client-only stubs for methods defined on the remote server. See - [Meteor.methods](#meteor_methods). -* `status` - - Get the current connection status. See - [Meteor.status](#meteor_status). -* `reconnect` - - See [Meteor.reconnect](#meteor_reconnect). -* `disconnect` - - See [Meteor.disconnect](#meteor_disconnect). -* `onReconnect` - Set this to a function to be called as the first step of - reconnecting. This function can call methods which will be executed before - any other outstanding methods. For example, this can be used to re-establish - the appropriate authentication context on the new connection. - -By default, clients open a connection to the server from which they're loaded. -When you call `Meteor.subscribe`, `Meteor.status`, `Meteor.call`, and -`Meteor.apply`, you are using a connection back to that default -server. - - -{{/template}} \ No newline at end of file diff --git a/docs/client/full-api/api/core.md b/docs/client/full-api/api/core.md deleted file mode 100644 index 89ded14605..0000000000 --- a/docs/client/full-api/api/core.md +++ /dev/null @@ -1,53 +0,0 @@ -{{#template name="apiCore"}} - -

Meteor Core

- -{{> autoApiBox "Meteor.isClient"}} -{{> autoApiBox "Meteor.isServer"}} - -{{#note}} -`Meteor.isServer` can be used to limit where code runs, but it does not -prevent code from being sent to the client. Any sensitive code that you -don't want served to the client, such as code containing passwords or -authentication mechanisms, should be kept in the `server` directory. -{{/note}} - -{{> autoApiBox "Meteor.isCordova"}} -{{> autoApiBox "Meteor.isDevelopment"}} -{{> autoApiBox "Meteor.isProduction"}} - -{{> autoApiBox "Meteor.startup"}} - -On a server, the function will run as soon as the server process is -finished starting. On a client, the function will run as soon as the DOM -is ready. Code wrapped in `Meteor.startup` always runs after all app -files have loaded, so you should put code here if you want to access -shared variables from other files. - -The `startup` callbacks are called in the same order as the calls to -`Meteor.startup` were made. - -On a client, `startup` callbacks from packages will be called -first, followed by `` templates from your `.html` files, -followed by your application code. - - // On server startup, if the database is empty, create some initial data. - if (Meteor.isServer) { - Meteor.startup(function () { - if (Rooms.find().count() === 0) { - Rooms.insert({name: "Initial room"}); - } - }); - } - -{{> autoApiBox "Meteor.wrapAsync"}} - -{{> autoApiBox "Meteor.defer"}} - -{{> autoApiBox "Meteor.absoluteUrl"}} - -{{> autoApiBox "Meteor.settings"}} - -{{> autoApiBox "Meteor.release"}} - -{{/template}} diff --git a/docs/client/full-api/api/ejson.md b/docs/client/full-api/api/ejson.md deleted file mode 100644 index ad308b52ba..0000000000 --- a/docs/client/full-api/api/ejson.md +++ /dev/null @@ -1,90 +0,0 @@ -{{#template name="apiEjson"}} - -

EJSON

- -EJSON is an extension of JSON to support more types. It supports all JSON-safe -types, as well as: - - - **Date** (JavaScript `Date`) - - **Binary** (JavaScript `Uint8Array` or the - result of [`EJSON.newBinary`](#ejson_new_binary)) - - **User-defined types** (see [`EJSON.addType`](#ejson_add_type). For example, - [`Mongo.ObjectID`](#mongo_object_id) is implemented this way.) - -All EJSON serializations are also valid JSON. For example an object with a date -and a binary buffer would be serialized in EJSON as: - - { - "d": {"$date": 1358205756553}, - "b": {"$binary": "c3VyZS4="} - } - -Meteor supports all built-in EJSON data types in publishers, method arguments -and results, Mongo databases, and [`Session`](#session) variables. - -{{> autoApiBox "EJSON.parse"}} - -{{> autoApiBox "EJSON.stringify"}} - -{{> autoApiBox "EJSON.fromJSONValue"}} - -{{> autoApiBox "EJSON.toJSONValue"}} - -{{> autoApiBox "EJSON.equals"}} - -{{> autoApiBox "EJSON.clone"}} - -{{> autoApiBox "EJSON.newBinary"}} - -Buffers of binary data are represented by `Uint8Array` instances on JavaScript -platforms that support them. On implementations of JavaScript that do not -support `Uint8Array`, binary data buffers are represented by standard arrays -containing numbers ranging from 0 to 255, and the `$Uint8ArrayPolyfill` key -set to `true`. - -{{> autoApiBox "EJSON.isBinary"}} - -{{> autoApiBox "EJSON.addType"}} - -When you add a type to EJSON, Meteor will be able to use that type in: - - - publishing objects of your type if you pass them to publish handlers. - - allowing your type in the return values or arguments to - [methods](#methods_header). - - storing your type client-side in Minimongo. - - allowing your type in [`Session`](#session) variables. - -Instances of your type must implement [`typeName`](#ejson_type_typeName) and -[`toJSONValue`](#ejson_type_toJSONValue) methods, and may implement -[`clone`](#ejson_type_clone) and [`equals`](#ejson_type_equals) methods if the -default implementations are not sufficient. - -{{> autoApiBox "EJSON.CustomType#typeName"}} -{{> autoApiBox "EJSON.CustomType#toJSONValue"}} - -For example, the `toJSONValue` method for -[`Mongo.ObjectID`](#mongo_object_id) could be: - - function () { - return this.toHexString(); - }; - -{{> autoApiBox "EJSON.CustomType#clone"}} - -If your type does not have a `clone` method, `EJSON.clone` will use -[`toJSONValue`](#ejson_type_toJSONValue) and the factory instead. - -{{> autoApiBox "EJSON.CustomType#equals"}} - -The `equals` method should define an [equivalence -relation](http://en.wikipedia.org/wiki/Equivalence_relation). It should have -the following properties: - - - *Reflexivity* - for any instance `a`: `a.equals(a)` must be true. - - *Symmetry* - for any two instances `a` and `b`: `a.equals(b)` if and only if `b.equals(a)`. - - *Transitivity* - for any three instances `a`, `b`, and `c`: `a.equals(b)` and `b.equals(c)` implies `a.equals(c)`. - -If your type does not have an `equals` method, `EJSON.equals` will compare the -result of calling [`toJSONValue`](#ejson_type_toJSONValue) instead. - -{{/template}} \ No newline at end of file diff --git a/docs/client/full-api/api/email.md b/docs/client/full-api/api/email.md deleted file mode 100644 index 76c94ffefc..0000000000 --- a/docs/client/full-api/api/email.md +++ /dev/null @@ -1,57 +0,0 @@ -{{#template name="apiEmail"}} - -

Email

- -The `email` package allows sending email from a Meteor app. To use it, add the -package to your project by running in your terminal: - -```bash -meteor add email -``` - -The server reads from the `MAIL_URL` environment variable to determine how to -send mail. Currently, Meteor supports sending mail over SMTP; the `MAIL_URL` -environment variable should be of the form -`smtp://USERNAME:PASSWORD@HOST:PORT/`. - -If `MAIL_URL` is not set, `Email.send` outputs the message to standard output -instead. - -{{> autoApiBox "Email.send"}} - -You must provide the `from` option and at least one of `to`, `cc`, and `bcc`; -all other options are optional. - -`Email.send` only works on the server. Here is an example of how a -client could use a server method call to send an email. (In an actual -application, you'd need to be careful to limit the emails that a -client could send, to prevent your server from being used as a relay -by spammers.) - - // In your server code: define a method that the client can call - Meteor.methods({ - sendEmail: function (to, from, subject, text) { - check([to, from, subject, text], [String]); - - // Let other method calls from the same client start running, - // without waiting for the email sending to complete. - this.unblock(); - - Email.send({ - to: to, - from: from, - subject: subject, - text: text - }); - } - }); - - // In your client code: asynchronously send an email - Meteor.call('sendEmail', - 'alice@example.com', - 'bob@example.com', - 'Hello from Meteor!', - 'This is a test of Email.send.'); - - -{{/template}} diff --git a/docs/client/full-api/api/http.md b/docs/client/full-api/api/http.md deleted file mode 100644 index 379fba1da5..0000000000 --- a/docs/client/full-api/api/http.md +++ /dev/null @@ -1,107 +0,0 @@ -{{#template name="apiHttp"}} - -

HTTP

- -`HTTP` provides an HTTP request API on the client and server. To use -these functions, add the HTTP package to your project by running in your -terminal: - -```bash -meteor add http -``` - -{{> autoApiBox "HTTP.call"}} - -This function initiates an HTTP request to a remote server. - -On the server, this function can be run either synchronously or -asynchronously. If the callback is omitted, it runs synchronously -and the results are returned once the request completes successfully. -If the request was not successful, an error is thrown. -This is -useful when making server-to-server HTTP API calls from within Meteor -methods, as the method can succeed or fail based on the results of the -synchronous HTTP call. In this case, consider using -[`this.unblock()`](#method_unblock) to allow other methods on the same -connection to run in -the mean time. On the client, this function must be used -asynchronously by passing a callback. - -Both HTTP and HTTPS protocols are supported. The `url` argument must be -an absolute URL including protocol and host name on the server, but may be -relative to the current host on the client. The `query` option -replaces the query string of `url`. Parameters specified in `params` -that are put in the URL are appended to any query string. -For example, with a `url` of `"/path?query"` and -`params` of `{foo:"bar"}`, the final URL will be `"/path?query&foo=bar"`. - -The `params` are put in the URL or the request body, depending on the -type of request. In the case of request with no bodies, like GET and -HEAD, the parameters will always go in the URL. For a POST or other -type of request, the parameters will be encoded into the body with a -standard `x-www-form-urlencoded` content type, unless the `content` -or `data` option is used to specify a body, in which case the -parameters will be appended to the URL instead. - -When run in asynchronous mode, the callback receives two arguments, -`error` and `result`. The -`error` argument will contain an Error if the request fails in any -way, including a network error, time-out, or an HTTP status code in -the 400 or 500 range. In case of a 4xx/5xx HTTP status code, the -`response` property on `error` matches the contents of the result -object. When run in synchronous mode, either `result` is returned -from the function, or `error` is thrown. - -Contents of the result object: - -
- -
statusCode - Number
-
Numeric HTTP result status code, or null on error.
- -
content - String
-
The body of the HTTP response as a string.
- -
data - Object or null
-
If the response headers indicate JSON content, this contains the body of the document parsed as a JSON object.
- -
headers - Object
-
A dictionary of HTTP headers from the response.
- -
- -Example server method: - - Meteor.methods({checkTwitter: function (userId) { - check(userId, String); - this.unblock(); - try { - var result = HTTP.call("GET", "http://api.twitter.com/xyz", - {params: {user: userId}}); - return true; - } catch (e) { - // Got a network error, time-out or HTTP error in the 400 or 500 range. - return false; - } - }}); - -Example asynchronous HTTP call: - - HTTP.call("POST", "http://api.twitter.com/xyz", - {data: {some: "json", stuff: 1}}, - function (error, result) { - if (!error) { - Session.set("twizzled", true); - } - }); - - -{{> autoApiBox "HTTP.get"}} -{{> autoApiBox "HTTP.post"}} -{{> autoApiBox "HTTP.put"}} -{{> autoApiBox "HTTP.del"}} -{{/template}} diff --git a/docs/client/full-api/api/methods.md b/docs/client/full-api/api/methods.md deleted file mode 100644 index 12b3ef62eb..0000000000 --- a/docs/client/full-api/api/methods.md +++ /dev/null @@ -1,219 +0,0 @@ -{{#template name="apiMethods"}} - -

Methods

- -Methods are remote functions that Meteor clients can invoke. - -{{> autoApiBox "Meteor.methods"}} - -Example: - -```js -Meteor.methods({ - foo: function (arg1, arg2) { - check(arg1, String); - check(arg2, [Number]); - - // .. do stuff .. - - if (/* you want to throw an error */) { - throw new Meteor.Error("pants-not-found", "Can't find my pants"); - } - - return "some return value"; - }, - - bar: function () { - // .. do other stuff .. - return "baz"; - } -}); -``` - -Calling `methods` on the server defines functions that can be called remotely by -clients. They should return an [EJSON](#ejson)-able value or throw an -exception. Inside your method invocation, `this` is bound to a method -invocation object, which provides the following: - -* `isSimulation`: a boolean value, true if this invocation is a stub. -* `unblock`: when called, allows the next method from this client to -begin running. -* `userId`: the id of the current user. -* `setUserId`: a function that associates the current client with a user. -* `connection`: on the server, the [connection](#meteor_onconnection) this method call was received on. - -Calling `methods` on the client defines *stub* functions associated with -server methods of the same name. You don't have to define a stub for -your method if you don't want to. In that case, method calls are just -like remote procedure calls in other systems, and you'll have to wait -for the results from the server. - -If you do define a stub, when a client invokes a server method it will -also run its stub in parallel. On the client, the return value of a -stub is ignored. Stubs are run for their side-effects: they are -intended to *simulate* the result of what the server's method will do, -but without waiting for the round trip delay. If a stub throws an -exception it will be logged to the console. - -You use methods all the time, because the database mutators -([`insert`](#insert), [`update`](#update), [`remove`](#remove)) are implemented -as methods. When you call any of these functions on the client, you're invoking -their stub version that update the local cache, and sending the same write -request to the server. When the server responds, the client updates the local -cache with the writes that actually occurred on the server. - -You don't have to put all your method definitions into a single `Meteor.methods` -call; you may call it multiple times, as long as each method has a unique name. - -If a client calls a method and is disconnected before it receives a response, -it will re-call the method when it reconnects. This means that a client may -call a method multiple times when it only means to call it once. If this -behavior is problematic for your method, consider attaching a unique ID -to each method call on the client, and checking on the server whether a call -with this ID has already been made. Alternatively, you can use -[`Meteor.apply`](#meteor_apply) with the noRetry option set to true. - -Read more about methods and how to use them in the [Methods](http://guide.meteor.com/methods.html) article in the Meteor Guide. - -{{> autoApiBox "DDPCommon.MethodInvocation#userId"}} - -The user id is an arbitrary string — typically the id of the user record -in the database. You can set it with the `setUserId` function. If you're using -the [Meteor accounts system](#accounts_api) then this is handled for you. - -{{> autoApiBox "DDPCommon.MethodInvocation#setUserId"}} - -Call this function to change the currently logged in user on the -connection that made this method call. This simply sets the value of -`userId` for future method calls received on this connection. Pass -`null` to log out the connection. - -If you are using the [built-in Meteor accounts system](#accounts_api) then this -should correspond to the `_id` field of a document in the -[`Meteor.users`](#meteor_users) collection. - -`setUserId` is not retroactive. It affects the current method call and -any future method calls on the connection. Any previous method calls on -this connection will still see the value of `userId` that was in effect -when they started. - -{{> autoApiBox "DDPCommon.MethodInvocation#isSimulation"}} - -{{> autoApiBox "DDPCommon.MethodInvocation#unblock"}} - -On the server, methods from a given client run one at a time. The N+1th -invocation from a client won't start until the Nth invocation -returns. However, you can change this by calling `this.unblock`. This -will allow the N+1th invocation to start running in a new fiber. - -{{> autoApiBox "DDPCommon.MethodInvocation#connection"}} - -{{> autoApiBox "Meteor.Error"}} - -If you want to return an error from a method, throw an exception. Methods can -throw any kind of exception. But `Meteor.Error` is the only kind of error that -a server will send to the client. If a method function throws a different -exception, then it will be mapped to a sanitized version on the -wire. Specifically, if the `sanitizedError` field on the thrown error is set to -a `Meteor.Error`, then that error will be sent to the client. Otherwise, if no -sanitized version is available, the client gets -`Meteor.Error(500, 'Internal server error')`. - -{{> autoApiBox "Meteor.call"}} - -This is how to invoke a method. It will run the method on the server. If a -stub is available, it will also run the stub on the client. (See also -[`Meteor.apply`](#meteor_apply), which is identical to `Meteor.call` except that -you specify the parameters as an array instead of as separate arguments and you -can specify a few options controlling how the method is executed.) - -If you include a callback function as the last argument (which can't be -an argument to the method, since functions aren't serializable), the -method will run asynchronously: it will return nothing in particular and -will not throw an exception. When the method is complete (which may or -may not happen before `Meteor.call` returns), the callback will be -called with two arguments: `error` and `result`. If an error was thrown, -then `error` will be the exception object. Otherwise, `error` will be -undefined and the return value (possibly undefined) will be in `result`. - - // async call - Meteor.call('foo', 1, 2, function (error, result) { ... } ); - -If you do not pass a callback on the server, the method invocation will -block until the method is complete. It will eventually return the -return value of the method, or it will throw an exception if the method -threw an exception. (Possibly mapped to 500 Server Error if the -exception happened remotely and it was not a `Meteor.Error` exception.) - - // sync call - var result = Meteor.call('foo', 1, 2); - -On the client, if you do not pass a callback and you are not inside a -stub, `call` will return `undefined`, and you will have no way to get -the return value of the method. That is because the client doesn't have -fibers, so there is not actually any way it can block on the remote -execution of a method. - -Finally, if you are inside a stub on the client and call another -method, the other method is not executed (no RPC is generated, nothing -"real" happens). If that other method has a stub, that stub stands in -for the method and is executed. The method call's return value is the -return value of the stub function. The client has no problem executing -a stub synchronously, and that is why it's okay for the client to use -the synchronous `Meteor.call` form from inside a method body, as -described earlier. - -Meteor tracks the database writes performed by methods, both on the client and -the server, and does not invoke `asyncCallback` until all of the server's writes -replace the stub's writes in the local cache. In some cases, there can be a lag -between the method's return value being available and the writes being visible: -for example, if another method still outstanding wrote to the same document, the -local cache may not be up to date until the other method finishes as well. If -you want to process the method's result as soon as it arrives from the server, -even if the method's writes are not available yet, you can specify an -`onResultReceived` callback to [`Meteor.apply`](#meteor_apply). - -{{> autoApiBox "Meteor.apply"}} - -`Meteor.apply` is just like `Meteor.call`, except that the method arguments are -passed as an array rather than directly as arguments, and you can specify -options about how the client executes the method. - -

DDPRateLimiter

- -Customize rate limiting for methods and subscriptions. - -By default, `DDPRateLimiter` is configured with a single rule. This rule -limits login attempts, new user creation, and password resets to 5 attempts -every 10 seconds per connection. It can be removed by calling -`Accounts.removeDefaultRateLimit()`. - -{{> autoApiBox "DDPRateLimiter.addRule"}} - -Custom rules can be added by calling `DDPRateLimiter.addRule`. The rate -limiter is called on every method and subscription invocation. - -A rate limit is reached when a bucket has surpassed the rule's predefined -capactiy, at which point errors will be returned for that input until the -buckets are reset. Buckets are regularly reset after the end of a time -interval. - - -Here's example of defining a rule and adding it into the `DDPRateLimiter`: -```javascript -// Define a rule that matches login attempts by non-admin users -var loginRule = { - userId: function (userId) { - return Meteor.users.findOne(userId).type !== 'Admin'; - }, - type: 'method', - name: 'login' -} -// Add the rule, allowing up to 5 messages every 1000 milliseconds. -DDPRateLimiter.addRule(loginRule, 5, 1000); -``` -{{> autoApiBox "DDPRateLimiter.removeRule"}} -{{> autoApiBox "DDPRateLimiter.setErrorMessage"}} -{{/template}} - -{{> auto}} diff --git a/docs/client/full-api/api/mobile-config.md b/docs/client/full-api/api/mobile-config.md deleted file mode 100644 index 064b1a6b0a..0000000000 --- a/docs/client/full-api/api/mobile-config.md +++ /dev/null @@ -1,60 +0,0 @@ -{{#template name="apiMobileConfig"}} - - -

Mobile Config File

- -If your Meteor application targets mobile platforms such as iOS or -Android, you can configure your app's metadata and build process -in a special top-level file called -`mobile-config.js` which is *not* included in your application and is used only -for this configuration. - -The code snippet below is an example `mobile-config.js` file. The rest of this -section will explain the specific API commands in greater detail. - -```javascript -// This section sets up some basic app metadata, -// the entire section is optional. -App.info({ - id: 'com.example.matt.uber', - name: 'über', - description: 'Get über power in one button click', - author: 'Matt Development Group', - email: 'contact@example.com', - website: 'http://example.com' -}); - -// Set up resources such as icons and launch screens. -App.icons({ - 'iphone': 'icons/icon-60.png', - 'iphone_2x': 'icons/icon-60@2x.png', - // ... more screen sizes and platforms ... -}); - -App.launchScreens({ - 'iphone': 'splash/Default~iphone.png', - 'iphone_2x': 'splash/Default@2x~iphone.png', - // ... more screen sizes and platforms ... -}); - -// Set PhoneGap/Cordova preferences -App.setPreference('BackgroundColor', '0xff0000ff'); -App.setPreference('HideKeyboardFormAccessoryBar', true); -App.setPreference('Orientation', 'default'); -App.setPreference('Orientation', 'all', 'ios'); - -// Pass preferences for a particular PhoneGap/Cordova plugin -App.configurePlugin('com.phonegap.plugins.facebookconnect', { - APP_ID: '1234567890', - API_KEY: 'supersecretapikey' -}); -``` - - -{{> autoApiBox "App.info"}} -{{> autoApiBox "App.setPreference"}} -{{> autoApiBox "App.accessRule"}} -{{> autoApiBox "App.configurePlugin"}} -{{> autoApiBox "App.icons"}} -{{> autoApiBox "App.launchScreens"}} -{{/template}} diff --git a/docs/client/full-api/api/packagejs.md b/docs/client/full-api/api/packagejs.md deleted file mode 100644 index 55f22e6b6e..0000000000 --- a/docs/client/full-api/api/packagejs.md +++ /dev/null @@ -1,132 +0,0 @@ -{{#template name="apiPackagejs"}} - -

Package.js

- -{{#markdown}} A package is a directory containing a package.js file, which -contains roughly three major sections: a basic description, a package -definition, and a test definition. By default, the directory name is the name of -the package. - -The `package.js` file below is an example of how to use the packaging API. The -rest of this section will explain the specific API commands in greater detail. - - - /* Information about this package */ - Package.describe({ - // Short two-sentence summary. - summary: "What this does", - // Version number. - version: "1.0.0", - // Optional. Default is package directory name. - name: "username:package-name", - // Optional github URL to your source repository. - git: "https://github.com/something/something.git", - }); - - /* This defines your actual package */ - Package.onUse(function (api) { - // If no version is specified for an 'api.use' dependency, use the - // one defined in Meteor 0.9.0. - api.versionsFrom('0.9.0'); - // Use Underscore package, but only on the server. - // Version not specified, so it will be as of Meteor 0.9.0. - api.use('underscore', 'server'); - // Use iron:router package, version 1.0.0 or newer. - api.use('iron:router@1.0.0'); - // Give users of this package access to the Templating package. - api.imply('templating') - // Export the object 'Email' to packages or apps that use this package. - api.export('Email', 'server'); - // Specify the source code for the package. - api.addFiles('email.js', 'server'); - }); - - /* This defines the tests for the package */ - Package.onTest(function (api) { - // Sets up a dependency on this package - api.use('username:package-name'); - // Allows you to use the 'tinytest' framework - api.use('tinytest@1.0.0'); - // Specify the source code for the package tests - api.addFiles('email_tests.js', 'server'); - }); - - /* This lets you use npm packages in your package*/ - Npm.depends({ - simplesmtp: "0.3.10", - "stream-buffers": "0.2.5"}); - -Build plugins are created with -[`Package.registerBuildPlugin`](#Package-registerBuildPlugin). See the -coffeescript package for an example. Build plugins are fully-fledged Meteor -programs in their own right and have their own namespace, package dependencies, -source files and npm requirements. - -{{#note}} -You can use [local packages](#writingpackages) to define custom build plugins -for your app, with one caveat. In published packages, build plugins are already -bundled with their transitive dependencies. So if you want a dependency of a -build plugin to be satisfied by a local package, you must use a local copy of -the package that defines the plugin (even if you make no changes to that -package) so that Meteor will pick up the local dependency. -{{/note}} - -

Package Description

- -Provide basic package information with `Package.describe(options)`. To publish a -package, you must define `summary` and `version`. - -{{/markdown}} - -{{> autoApiBox "Package.describe"}} - - -

Package Definition

- -{{#markdown}} -Define dependencies and expose package methods with the -`Package.onUse` handler. This section lets you define what packages your package -depends on, what packages are implied by your package, and what object your -package is exported to. -{{/markdown}} - -{{> autoApiBox "Package.onUse"}} - -{{> autoApiBox "PackageAPI#versionsFrom" }} -{{> autoApiBox "PackageAPI#use" }} -{{> autoApiBox "PackageAPI#imply" }} -{{> autoApiBox "PackageAPI#export" }} -{{> autoApiBox "PackageAPI#addFiles" }} -{{> autoApiBox "PackageAPI#addAssets" }} - -

Unit Tests

- -{{#markdown}} -Set up your tests with the `Package.onTest` handler, which has an interface -that's parallel to that of the `onUse` handler. The tests will need to depend on -the package that you have just created. For example, if your package is the -`email` package, you have to call `api.use('email')` in order to test the -package. - -If you used `meteor create` to set up your package, Meteor will create the -required scaffolding in `package.js`, and you'll only need to add unit test code -in the `_test.js` file that was created. -{{/markdown}} - -{{> autoApiBox "Package.onTest"}} - - -

External Packages and Plugins

- -{{#markdown}} -Meteor packages can include NPM packages and Cordova plugins by using -`Npm.depends` and `Cordova.depends` in the `package.js` file. -{{/markdown}} - -{{> autoApiBox "Npm.depends"}} -{{> autoApiBox "Npm.require"}} -{{> autoApiBox "Cordova.depends"}} -{{> autoApiBox "Package.registerBuildPlugin"}} -{{> autoApiBox "Plugin.registerSourceHandler"}} - -{{/template}} diff --git a/docs/client/full-api/api/passwords.md b/docs/client/full-api/api/passwords.md deleted file mode 100644 index 0a6326b686..0000000000 --- a/docs/client/full-api/api/passwords.md +++ /dev/null @@ -1,188 +0,0 @@ -{{#template name="apiPasswords"}} - -

Passwords

- -The `accounts-password` package contains a full system for password-based -authentication. In addition to the basic username and password-based -sign-in process, it also supports email-based sign-in including -address verification and password recovery emails. - -The Meteor server stores passwords using the -[bcrypt](http://en.wikipedia.org/wiki/Bcrypt) algorithm. This helps -protect against embarrassing password leaks if the server's database is -compromised. - -To add password support to your application, run this command in your terminal: - -```bash -meteor add accounts-password -``` - -You can construct your own user interface using the -functions below, or use the [`accounts-ui` package](#accountsui) to -include a turn-key user interface for password-based sign-in. - - -{{> autoApiBox "Accounts.createUser"}} - -On the client, this function logs in as the newly created user on -successful completion. On the server, it returns the newly created user -id. - -On the client, you must pass `password` and at least one of `username` or -`email` — enough information for the user to be able to log in again -later. If there are existing users with a username or email only differing in -case, `createUser` will fail. On the server, you do not need to specify -`password`, but the user will not be able to log in until it has a password (eg, -set with [`Accounts.setPassword`](#accounts_setpassword)). - -To create an account without a password on the server and still let the -user pick their own password, call `createUser` with the `email` option -and then -call [`Accounts.sendEnrollmentEmail`](#accounts_sendenrollmentemail). This -will send the user an email with a link to set their initial password. - -By default the `profile` option is added directly to the new user document. To -override this behavior, use [`Accounts.onCreateUser`](#accounts_oncreateuser). - -This function is only used for creating users with passwords. The external -service login flows do not use this function. - -### Managing usernames and emails - -Instead of modifying documents in the [`Meteor.users`](#meteor_users) collection -directly, use these convenience functions which correctly check for case -insensitive duplicates before updates. - -{{> autoApiBox "Accounts.setUsername"}} - -{{> autoApiBox "Accounts.addEmail"}} - -By default, an email address is added with `{ verified: false }`. Use -[`Accounts.sendVerificationEmail`](#Accounts-sendVerificationEmail) to send an -email with a link the user can use verify their email address. - -{{> autoApiBox "Accounts.removeEmail"}} - -{{> autoApiBox "Accounts.verifyEmail"}} - -This function accepts tokens passed into the callback registered with -[`Accounts.onEmailVerificationLink`](#Accounts-onEmailVerificationLink). - -{{> autoApiBox "Accounts.findUserByUsername"}} - -{{> autoApiBox "Accounts.findUserByEmail"}} - -### Managing passwords - -Use the below functions to initiate password changes or resets from the server -or the client. - -{{> autoApiBox "Accounts.changePassword"}} - -{{> autoApiBox "Accounts.forgotPassword"}} - -This triggers a call -to [`Accounts.sendResetPasswordEmail`](#accounts_sendresetpasswordemail) -on the server. When the user visits the link in this email, the callback -registered with [`Accounts.onResetPasswordLink`](#Accounts-onResetPasswordLink) -will be called. - -If you are using the [`accounts-ui` package](#accountsui), this is handled -automatically. Otherwise, it is your responsibility to prompt the user for the -new password and call `resetPassword`. - -{{> autoApiBox "Accounts.resetPassword"}} - -This function accepts tokens passed into the callbacks registered with -[`AccountsClient#onResetPasswordLink`](#Accounts-onResetPasswordLink) and -[`Accounts.onEnrollmentLink`](#Accounts-onEnrollmentLink). - -{{> autoApiBox "Accounts.setPassword"}} - - - -

Sending emails

- -{{> autoApiBox "Accounts.sendResetPasswordEmail"}} - -When the user visits the link in this email, the callback registered with -[`AccountsClient#onResetPasswordLink`](#Accounts-onResetPasswordLink) will be called. - -To customize the contents of the email, see -[`Accounts.emailTemplates`](#accounts_emailtemplates). - -{{> autoApiBox "Accounts.sendEnrollmentEmail"}} - -When the user visits the link in this email, the callback registered with -[`Accounts.onEnrollmentLink`](#Accounts-onEnrollmentLink) will be called. - -To customize the contents of the email, see -[`Accounts.emailTemplates`](#accounts_emailtemplates). - -{{> autoApiBox "Accounts.sendVerificationEmail"}} - -When the user visits the link in this email, the callback registered with -[`Accounts.onEmailVerificationLink`](#Accounts-onEmailVerificationLink) will -be called. - -To customize the contents of the email, see -[`Accounts.emailTemplates`](#accounts_emailtemplates). - - -{{> autoApiBox "Accounts.onResetPasswordLink"}} - -{{> autoApiBox "Accounts.onEnrollmentLink"}} - -{{> autoApiBox "Accounts.onEmailVerificationLink"}} - - - - -{{> autoApiBox "Accounts.emailTemplates"}} - -This is an `Object` with several fields that are used to generate text/html -for the emails sent by `sendResetPasswordEmail`, `sendEnrollmentEmail`, -and `sendVerificationEmail`. - -Override fields of the object by assigning to them: - -- `from`: A `String` with an [RFC5322](http://tools.ietf.org/html/rfc5322) From - address. By default, the email is sent from `no-reply@meteor.com`. If you - wish to receive email from users asking for help with their account, be sure - to set this to an email address that you can receive email at. -- `siteName`: The public name of your application. Defaults to the DNS name of - the application (eg: `awesome.meteor.com`). -- `headers`: An `Object` for custom email headers as described in - [`Email.send`](#email_send). -- `resetPassword`: An `Object` with the fields: - - `from`: A `Function` used to override the `from` address defined - by the `emailTemplates.from` field. - - `subject`: A `Function` that takes a user object and returns - a `String` for the subject line of a reset password email. - - `text`: An optional `Function` that takes a user object and a url, and - returns the body text for a reset password email. - - `html`: An optional `Function` that takes a user object and a - url, and returns the body html for a reset password email. -- `enrollAccount`: Same as `resetPassword`, but for initial password setup for - new accounts. -- `verifyEmail`: Same as `resetPassword`, but for verifying the users email - address. - - -Example: - -```js -Accounts.emailTemplates.siteName = "AwesomeSite"; -Accounts.emailTemplates.from = "AwesomeSite Admin "; -Accounts.emailTemplates.enrollAccount.subject = function (user) { - return "Welcome to Awesome Town, " + user.profile.name; -}; -Accounts.emailTemplates.enrollAccount.text = function (user, url) { - return "You have been selected to participate in building a better future!" - + " To activate your account, simply click the link below:\n\n" - + url; -}; -``` - -{{/template}} diff --git a/docs/client/full-api/api/pubsub.md b/docs/client/full-api/api/pubsub.md deleted file mode 100644 index 39e3651eaa..0000000000 --- a/docs/client/full-api/api/pubsub.md +++ /dev/null @@ -1,227 +0,0 @@ -{{#template name="apiPubsub"}} - -

Publish and subscribe

- -These functions control how Meteor servers publish sets of records and -how clients can subscribe to those sets. - -{{> autoApiBox "Meteor.publish"}} - -To publish records to clients, call `Meteor.publish` on the server with -two parameters: the name of the record set, and a *publish function* -that Meteor will call each time a client subscribes to the name. - -Publish functions can return a -[`Collection.Cursor`](#mongo_cursor), in which case Meteor -will publish that cursor's documents to each subscribed client. You can -also return an array of `Collection.Cursor`s, in which case Meteor will -publish all of the cursors. - -{{#warning}} -If you return multiple cursors in an array, they currently must all be from -different collections. We hope to lift this restriction in a future release. -{{/warning}} - - // server: publish the rooms collection, minus secret info. - Meteor.publish("rooms", function () { - return Rooms.find({}, {fields: {secretInfo: 0}}); - }); - - // ... and publish secret info for rooms where the logged-in user - // is an admin. If the client subscribes to both streams, the records - // are merged together into the same documents in the Rooms collection. - Meteor.publish("adminSecretInfo", function () { - return Rooms.find({admin: this.userId}, {fields: {secretInfo: 1}}); - }); - - // publish dependent documents and simulate joins - Meteor.publish("roomAndMessages", function (roomId) { - check(roomId, String); - return [ - Rooms.find({_id: roomId}, {fields: {secretInfo: 0}}), - Messages.find({roomId: roomId}) - ]; - }); - -Alternatively, a publish function can directly control its published record set -by calling the functions [`added`](#publish_added) (to add a new document to the -published record set), [`changed`](#publish_changed) (to change or clear some -fields on a document already in the published record set), and -[`removed`](#publish_removed) (to remove documents from the published record -set). These methods are provided by `this` in your publish function. - -If a publish function does not return a cursor or array of cursors, it is -assumed to be using the low-level `added`/`changed`/`removed` interface, and it -**must also call [`ready`](#publish_ready) once the initial record set is -complete**. - -Example: - - // server: publish the current size of a collection - Meteor.publish("counts-by-room", function (roomId) { - var self = this; - check(roomId, String); - var count = 0; - var initializing = true; - - // observeChanges only returns after the initial `added` callbacks - // have run. Until then, we don't want to send a lot of - // `self.changed()` messages - hence tracking the - // `initializing` state. - var handle = Messages.find({roomId: roomId}).observeChanges({ - added: function (id) { - count++; - if (!initializing) - self.changed("counts", roomId, {count: count}); - }, - removed: function (id) { - count--; - self.changed("counts", roomId, {count: count}); - } - // don't care about changed - }); - - // Instead, we'll send one `self.added()` message right after - // observeChanges has returned, and mark the subscription as - // ready. - initializing = false; - self.added("counts", roomId, {count: count}); - self.ready(); - - // Stop observing the cursor when client unsubs. - // Stopping a subscription automatically takes - // care of sending the client any removed messages. - self.onStop(function () { - handle.stop(); - }); - }); - - // client: declare collection to hold count object - Counts = new Mongo.Collection("counts"); - - // client: subscribe to the count for the current room - Tracker.autorun(function () { - Meteor.subscribe("counts-by-room", Session.get("roomId")); - }); - - // client: use the new collection - console.log("Current room has " + - Counts.findOne(Session.get("roomId")).count + - " messages."); - - // server: sometimes publish a query, sometimes publish nothing - Meteor.publish("secretData", function () { - if (this.userId === 'superuser') { - return SecretData.find(); - } else { - // Declare that no data is being published. If you leave this line - // out, Meteor will never consider the subscription ready because - // it thinks you're using the added/changed/removed interface where - // you have to explicitly call this.ready(). - return []; - } - }); - -{{#warning}} -Meteor will emit a warning message if you call `Meteor.publish` in a -project that includes the `autopublish` package. Your publish function -will still work. -{{/warning}} - -Read more about publications and how to use them in the [Data Loading](http://guide.meteor.com/data-loading.html) article in the Meteor Guide. - -{{> autoApiBox "Subscription#userId"}} - -This is constant. However, if the logged-in user changes, the publish -function is rerun with the new value. - -{{> autoApiBox "Subscription#added"}} -{{> autoApiBox "Subscription#changed"}} -{{> autoApiBox "Subscription#removed"}} -{{> autoApiBox "Subscription#ready"}} -{{> autoApiBox "Subscription#onStop"}} - -If you call [`observe`](#observe) or [`observeChanges`](#observe_changes) in your -publish handler, this is the place to stop the observes. - -{{> autoApiBox "Subscription#error"}} -{{> autoApiBox "Subscription#stop"}} -{{> autoApiBox "Subscription#connection"}} - -{{> autoApiBox "Meteor.subscribe"}} - -When you subscribe to a record set, it tells the server to send records to the -client. The client stores these records in local [Minimongo -collections](#mongo_collection), with the same name as the `collection` -argument used in the publish handler's [`added`](#publish_added), -[`changed`](#publish_changed), and [`removed`](#publish_removed) -callbacks. Meteor will queue incoming records until you declare the -[`Mongo.Collection`](#mongo_collection) on the client with the matching -collection name. - - // okay to subscribe (and possibly receive data) before declaring - // the client collection that will hold it. assume "allplayers" - // publishes data from server's "players" collection. - Meteor.subscribe("allplayers"); - ... - // client queues incoming players records until ... - ... - Players = new Mongo.Collection("players"); - -The client will see a document if the document is currently in the published -record set of any of its subscriptions. - -The `onReady` callback is called with no arguments when the server [marks the -subscription as ready](#publish_ready). The `onStop` callback is called with -a [`Meteor.Error`](#meteor_error) if the subscription fails or is terminated by -the server. If the subscription is stopped by calling `stop` on the subscription -handle or inside the publication, `onStop` is called with no arguments. - -`Meteor.subscribe` returns a subscription handle, which is an object with the -following properties: - -
-{{#dtdd "stop()"}} -Cancel the subscription. This will typically result in the server directing the -client to remove the subscription's data from the client's cache. -{{/dtdd}} - -{{#dtdd "ready()"}} -True if the server has [marked the subscription as ready](#publish_ready). A -reactive data source. -{{/dtdd}} - -{{#dtdd "subscriptionId"}} -The `id` of the subscription this handle is for. When you run `Meteor.subscribe` -inside of `Tracker.autorun`, the handles you get will always have the same -`subscriptionId` field. You can use this to deduplicate subscription handles -if you are storing them in some data structure. -{{/dtdd}} -
- -If you call `Meteor.subscribe` within a [reactive computation](#reactivity), -for example using -[`Tracker.autorun`](#tracker_autorun), the subscription will automatically be -cancelled when the computation is invalidated or stopped; it's not necessary -to call `stop` on -subscriptions made from inside `autorun`. However, if the next iteration -of your run function subscribes to the same record set (same name and -parameters), Meteor is smart enough to skip a wasteful -unsubscribe/resubscribe. For example: - - Tracker.autorun(function () { - Meteor.subscribe("chat", {room: Session.get("current-room")}); - Meteor.subscribe("privateMessages"); - }); - -This subscribes you to the chat messages in the current room and to your private -messages. When you change rooms by calling `Session.set("current-room", -"new-room")`, Meteor will subscribe to the new room's chat messages, -unsubscribe from the original room's chat messages, and continue to -stay subscribed to your private messages. - -If more than one subscription sends conflicting values for a field (same -collection name, document ID, and field name), then the value on the client will -be one of the published values, chosen arbitrarily. - -{{/template}} \ No newline at end of file diff --git a/docs/client/full-api/api/reactive-var.md b/docs/client/full-api/api/reactive-var.md deleted file mode 100644 index 925ae2bf41..0000000000 --- a/docs/client/full-api/api/reactive-var.md +++ /dev/null @@ -1,45 +0,0 @@ -{{#template name="apiReactiveVar"}} - - -

ReactiveVar

- -To use `ReactiveVar`, add the `reactive-var` package to your project by running -in your terminal: - -```bash -meteor add reactive-var -``` - -{{> autoApiBox "ReactiveVar"}} - -A ReactiveVar holds a single value that can be get and set, such that calling -`set` will invalidate any Computations that called `get`, according to the -usual contract for reactive data sources. - -A ReactiveVar is similar to a Session variable, with a few differences: - -* ReactiveVars don't have global names, like the "foo" in `Session.get("foo")`. - Instead, they may be created and used locally, for example attached to a - template instance, as in: `this.foo.get()`. - -* ReactiveVars are not automatically migrated across hot code pushes, - whereas Session state is. - -* ReactiveVars can hold any value, while Session variables are limited to - JSON or EJSON. - -An important property of ReactiveVars — which is sometimes a -reason for using one — is that setting the value to the same -value as before has no effect; it does not trigger any invalidations. -So if one autorun sets a ReactiveVar, and another autorun gets the -ReactiveVar, a re-run of the first autorun won't necessarily trigger -the second. By default, only primitive values are compared this way, -while calling `set` on an argument that is an *object* (not a -primitive) always counts as a change. You can configure this behavior -using the `equalsFunc` argument. - -{{> autoApiBox "ReactiveVar#get"}} - -{{> autoApiBox "ReactiveVar#set"}} - -{{/template}} diff --git a/docs/client/full-api/api/session.md b/docs/client/full-api/api/session.md deleted file mode 100644 index 9fbb0f6158..0000000000 --- a/docs/client/full-api/api/session.md +++ /dev/null @@ -1,132 +0,0 @@ -{{#template name="apiSession"}} - - -

Session

- -`Session` provides a global object on the client that you can use to -store an arbitrary set of key-value pairs. Use it to store things like -the currently selected item in a list. - -What's special about `Session` is that it's reactive. If -you call [`Session.get`](#session_get)`("currentList")` -from inside a template, the template will automatically be rerendered -whenever [`Session.set`](#session_set)`("currentList", x)` is called. - -{{> autoApiBox "Session.set"}} - -Example: - -```js -Tracker.autorun(function () { - Meteor.subscribe("chat-history", {room: Session.get("currentRoomId")}); -}); - -// Causes the function passed to Tracker.autorun to be re-run, so -// that the chat-history subscription is moved to the room "home". -Session.set("currentRoomId", "home"); -``` - -`Session.set` can also be called with an object of keys and values, which is -equivalent to calling `Session.set` individually on each key/value pair. - -```js -Session.set({ - a: "foo", - b: "bar" -}); -``` - -{{> autoApiBox "Session.setDefault"}} - -This is useful in initialization code, to avoid re-initializing a session -variable every time a new version of your app is loaded. - -{{> autoApiBox "Session.get"}} - -Example: - -```html - -