diff --git a/docs/client/api.html b/docs/client/api.html index 28ea2dbe83..a5b2fc662a 100644 --- a/docs/client/api.html +++ b/docs/client/api.html @@ -3587,6 +3587,9 @@ package is exported to. {{> autoApiBox "PackageAPI#export" }} {{> autoApiBox "PackageAPI#addFiles" }} +{{> autoApiBox "Package.registerBuildPlugin"}} +{{> autoApiBox "Plugin.registerSourceHandler"}} +
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.
If true, forces the user to approve the app's permissions, even if previously approved. Currently only supported with Google.
","name":"forceApprovalPrompt"},{"type":{"names":["String"]},"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).
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.
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' }).
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.
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.
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"}],"longname":"Accounts.validateLoginAttempt","kind":"function","memberof":"Accounts","options":[],"locus":"Server"},"onLogin":{"summary":"Register a callback to be called after a login attempt succeeds.","params":[{"type":{"names":["function"]},"description":"The callback to be called when login is successful.
","name":"func"}],"longname":"Accounts.onLogin","kind":"function","memberof":"Accounts","options":[],"locus":"Server"},"onLoginFailure":{"summary":"Register a callback to be called after a login attempt fails.","params":[{"type":{"names":["function"]},"description":"The callback to be called after the login has failed.
","name":"func"}],"longname":"Accounts.onLoginFailure","kind":"function","memberof":"Accounts","options":[],"locus":"Server"},"onCreateUser":{"summary":"Customize new user creation.","params":[{"type":{"names":["function"]},"description":"Called whenever a new user is created. Return the new user object, or throw an Error to abort the creation.
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"}],"longname":"Accounts.validateNewUser","kind":"function","memberof":"Accounts","options":[],"locus":"Server"},"onResetPasswordLink":{"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()`.","params":[{"type":{"names":["function"]},"description":"The function to call. It is given two arguments:
\ntoken: A password reset token that can be passed to\nAccounts.resetPassword.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.The function to call. It is given two arguments:
\ntoken: An email verification token that can be passed to\nAccounts.verifyEmail.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.The function to call. It is given two arguments:
\ntoken: A password reset token that can be passed to\nAccounts.resetPassword to give the newly\nenrolled account a password.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.Client only, optional callback. Called with no arguments on success, or with a single Error argument on failure.
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":["Object"]},"description":"The user's profile, typically including the name field.
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":["function"]},"optional":true,"description":"Optional callback. Called with no arguments on success, or with a single Error argument on failure.
Optional callback. Called with no arguments on success, or with a single Error argument on failure.
The email address to send a password reset link.
","name":"email"}],"locus":"Client"},"resetPassword":{"summary":"Reset the password for a user using a token received in email. Logs the user in afterwards.","params":[{"type":{"names":["String"]},"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":["function"]},"optional":true,"description":"Optional callback. Called with no arguments on success, or with a single Error argument on failure.
The token retrieved from the verification URL.
","name":"token"},{"type":{"names":["function"]},"optional":true,"description":"Optional callback. Called with no arguments on success, or with a single Error argument on failure.
The id of the user to update.
","name":"userId"},{"type":{"names":["String"]},"description":"A new password for the user.
","name":"newPassword"}],"longname":"Accounts.setPassword","kind":"function","memberof":"Accounts","options":[],"locus":"Server"},"sendResetPasswordEmail":{"summary":"Send an email with a link the user can use to reset their password.","params":[{"type":{"names":["String"]},"description":"The id of the user to send email to.
","name":"userId"},{"type":{"names":["String"]},"optional":true,"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.
The id of the user to send email to.
","name":"userId"},{"type":{"names":["String"]},"optional":true,"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.
The id of the user to send email to.
","name":"userId"},{"type":{"names":["String"]},"optional":true,"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.
The number of bytes of binary data to allocate.
","name":"size"}],"longname":"EJSON.newBinary","kind":"member","memberof":"EJSON","locus":"Anywhere"},"CustomType#typeName":{"kind":"function","memberof":"EJSON.CustomType","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).","longname":"EJSON.CustomType#typeName","options":[],"params":[],"locus":"Anywhere"},"CustomType#toJSONValue":{"kind":"function","memberof":"EJSON.CustomType","summary":"Serialize this instance into a JSON-compatible value.","longname":"EJSON.CustomType#toJSONValue","options":[],"params":[],"locus":"Anywhere"},"CustomType#clone":{"kind":"function","memberof":"EJSON.CustomType","summary":"Return a value `r` such that `this.equals(r)` is true, and modifications to `r` do not affect `this` and vice versa.","longname":"EJSON.CustomType#clone","options":[],"params":[],"locus":"Anywhere"},"CustomType#equals":{"kind":"function","memberof":"EJSON.CustomType","summary":"Return `true` if `other` has a value equal to `this`; `false` otherwise.","params":[{"type":{"names":["Object"]},"description":"Another object to compare this to.
","name":"other"}],"longname":"EJSON.CustomType#equals","options":[],"locus":"Anywhere"},"addType":{"summary":"Add a custom datatype to EJSON.","params":[{"type":{"names":["String"]},"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.
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.
A value to serialize to plain JSON.
","name":"val"}],"longname":"EJSON.toJSONValue","kind":"function","memberof":"EJSON","options":[],"locus":"Anywhere"},"fromJSONValue":{"summary":"Deserialize an EJSON value from its plain JSON representation.","params":[{"type":{"names":["JSONCompatible"]},"description":"A value to deserialize into EJSON.
","name":"val"}],"longname":"EJSON.fromJSONValue","kind":"function","memberof":"EJSON","options":[],"locus":"Anywhere"},"stringify":{"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`.","params":[{"type":{"names":["EJSON"]},"description":"A value to stringify.
","name":"val"},{"type":{"names":["Object"]},"optional":true,"name":"options"}],"longname":"EJSON.stringify","kind":"function","memberof":"EJSON","options":[{"type":{"names":["Boolean","Integer","String"]},"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.
When true, stringifies keys in an object in sorted order.
A string to parse into an EJSON value.
","name":"str"}],"longname":"EJSON.parse","kind":"function","memberof":"EJSON","options":[],"locus":"Anywhere"},"isBinary":{"summary":"Returns true if `x` is a buffer of binary data, as returned from [`EJSON.newBinary`](#ejson_new_binary).","params":[{"type":{"names":["Object"]},"description":"The variable to check.
","name":"x"}],"longname":"EJSON.isBinary","kind":"function","memberof":"EJSON","options":[],"locus":"Anywhere"},"equals":{"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.","params":[{"type":{"names":["EJSON"]},"name":"a"},{"type":{"names":["EJSON"]},"name":"b"},{"type":{"names":["Object"]},"optional":true,"name":"options"}],"longname":"EJSON.equals","kind":"function","memberof":"EJSON","options":[{"type":{"names":["Boolean"]},"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.
A value to copy.
","name":"val"}],"longname":"EJSON.clone","kind":"function","memberof":"EJSON","options":[],"locus":"Anywhere"},"CustomType":{"kind":"class","memberof":"EJSON","summary":"The interface that a class must satisfy to be able to become an\nEJSON custom type via EJSON.addType.","longname":"EJSON.CustomType","options":[],"params":[],"instancename":"customType"}},"Meteor":{"summary":"The Meteor namespace","kind":"namespace","longname":"Meteor","users":{"summary":"A [Mongo.Collection](#collections) containing user documents.","longname":"Meteor.users","kind":"member","memberof":"Meteor","locus":"Anywhere"},"isClient":{"summary":"Boolean variable. True if running in client environment.","longname":"Meteor.isClient","kind":"member","memberof":"Meteor","locus":"Anywhere"},"isServer":{"summary":"Boolean variable. True if running in server environment.","longname":"Meteor.isServer","kind":"member","memberof":"Meteor","locus":"Anywhere"},"settings":{"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 you don't provide any settings, `Meteor.settings` will be an empty object. 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.","longname":"Meteor.settings","kind":"member","memberof":"Meteor","locus":"Anywhere"},"isCordova":{"summary":"Boolean variable. True if running in a Cordova mobile environment.","longname":"Meteor.isCordova","kind":"member","memberof":"Meteor","locus":"Anywhere"},"release":{"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.","longname":"Meteor.release","kind":"member","memberof":"Meteor","locus":"Anywhere"},"userId":{"summary":"Get the current user id, or `null` if no user is logged in. A reactive data source.","longname":"Meteor.userId","kind":"function","memberof":"Meteor","options":[],"params":[],"locus":"Anywhere but publish functions"},"loggingIn":{"summary":"True if a login method (such as `Meteor.loginWithPassword`, `Meteor.loginWithFacebook`, or `Accounts.createUser`) is currently in progress. A reactive data source.","longname":"Meteor.loggingIn","kind":"function","memberof":"Meteor","options":[],"params":[],"locus":"Client"},"user":{"summary":"Get the current user record, or `null` if no user is logged in. A reactive data source.","longname":"Meteor.user","kind":"function","memberof":"Meteor","options":[],"params":[],"locus":"Anywhere but publish functions"},"logout":{"summary":"Log the user out.","params":[{"type":{"names":["function"]},"optional":true,"description":"Optional callback. Called with no arguments on success, or with a single Error argument on failure.
Optional callback. Called with no arguments on success, or with a single Error argument on failure.
Optional callback. Called with no arguments on success, or with a single Error argument on failure.
A list of permissions to request from the user.
","name":"requestPermissions"},{"type":{"names":["Boolean"]},"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.
If true, forces the user to approve the app's permissions, even if previously approved. Currently only supported with Google.
","name":"forceApprovalPrompt"},{"type":{"names":["String"]},"description":"An email address that the external service will use to pre-fill the login prompt. Currently only supported with Meteor developer accounts.
","name":"userEmail"},{"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"}],"locus":"Client"},"loginWithPassword":{"summary":"Log the user in with a password.","params":[{"type":{"names":["Object","String"]},"description":"Either a string interpreted as a username or an email; or an object with a single key: email, username or id.
The user's password.
","name":"password"},{"type":{"names":["function"]},"optional":true,"description":"Optional callback. Called with no arguments on success, or with a single Error argument on failure.
Name of the subscription. Matches the name of the server's publish() call.
Optional arguments passed to publisher function on server.
","name":"arg1, arg2..."},{"type":{"names":["function","Object"]},"optional":true,"description":"Optional. May include onError and onReady callbacks. If a function is passed instead of an object, it is interpreted as an onReady callback.
Name of method to invoke
","name":"name"},{"type":{"names":["EJSONable"]},"optional":true,"description":"Optional method arguments
","name":"arg1, arg2..."},{"type":{"names":["function"]},"optional":true,"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"}],"longname":"Meteor.call","kind":"function","options":[],"locus":"Anywhere"},"apply":{"memberof":"Meteor","summary":"Invoke a method passing an array of arguments.","params":[{"type":{"names":["String"]},"description":"Name of method to invoke
","name":"name"},{"type":{"names":["Array.Method arguments
","name":"args"},{"type":{"names":["Object"]},"optional":true,"name":"options"},{"type":{"names":["function"]},"optional":true,"description":"Optional callback; same semantics as in Meteor.call.
(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":["function"]},"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.
The function to call when a new DDP connection is established.
","name":"callback"}],"memberof":"Meteor","longname":"Meteor.onConnection","kind":"function","options":[],"locus":"Server"},"publish":{"summary":"Publish a record set.","memberof":"Meteor","params":[{"type":{"names":["String"]},"description":"Name of the record set. If null, the set has no name, and the record set is automatically sent to all connected clients.
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.
Dictionary whose keys are method names and values are functions.
","name":"methods"}],"memberof":"Meteor","longname":"Meteor.methods","kind":"function","options":[],"locus":"Anywhere"},"wrapAsync":{"memberof":"Meteor","summary":"Wrap a function that takes a callback function as its final parameter so that the wrapper function can be used either synchronously (without passing a callback) or asynchronously (when a callback is passed). If a callback is provided, the environment captured when the original function was called will be restored in the callback.","params":[{"type":{"names":["function"]},"description":"A function that takes a callback as its final parameter
","name":"func"},{"type":{"names":["Object"]},"optional":true,"description":"Optional this object against which the original function will be invoked
A function to run on startup.
","name":"func"}],"longname":"Meteor.startup","kind":"function","memberof":"Meteor","options":[],"locus":"Anywhere"},"setTimeout":{"memberof":"Meteor","summary":"Call a function in the future after waiting for a specified delay.","params":[{"type":{"names":["function"]},"description":"The function to run
","name":"func"},{"type":{"names":["Number"]},"description":"Number of milliseconds to wait before calling function
","name":"delay"}],"longname":"Meteor.setTimeout","kind":"function","options":[],"locus":"Anywhere"},"setInterval":{"memberof":"Meteor","summary":"Call a function repeatedly, with a time delay between calls.","params":[{"type":{"names":["function"]},"description":"The function to run
","name":"func"},{"type":{"names":["Number"]},"description":"Number of milliseconds to wait between each function call.
","name":"delay"}],"longname":"Meteor.setInterval","kind":"function","options":[],"locus":"Anywhere"},"clearInterval":{"memberof":"Meteor","summary":"Cancel a repeating function call scheduled by `Meteor.setInterval`.","params":[{"type":{"names":["Number"]},"description":"The handle returned by Meteor.setInterval
The handle returned by Meteor.setTimeout
A path to append to the root URL. Do not include a leading "/".
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":["String"]},"description":"Override the default ROOT_URL from the server environment. For example: "http://foo.example.com"
A numeric error code, likely similar to an HTTP code (eg, 404, 500).
","name":"error"},{"type":{"names":["String"]},"optional":true,"description":"Optional. A short human-readable summary of the error, like 'Not Found'.
","name":"reason"},{"type":{"names":["String"]},"optional":true,"description":"Optional. Additional information about the error, like a textual stack trace.
","name":"details"}],"longname":"Meteor.Error","memberof":"Meteor","options":[],"locus":"Anywhere"}},"Mongo":{"summary":"Namespace for MongoDB-related items","kind":"namespace","longname":"Mongo","Cursor#forEach":{"summary":"Call `callback` once for each matching document, sequentially and synchronously.","kind":"function","memberof":"Mongo.Cursor","params":[{"type":{"names":["function"]},"description":"Function to call. It will be called with three arguments: the document, a 0-based index, and cursor itself.
","name":"callback"},{"type":{"names":["Any"]},"optional":true,"description":"An object which will be the value of this inside callback.
Function to call. It will be called with three arguments: the document, a 0-based index, and cursor itself.
","name":"callback"},{"type":{"names":["Any"]},"optional":true,"description":"An object which will be the value of this inside callback.
Functions to call to deliver the result set as it changes
","name":"callbacks"}],"longname":"Mongo.Cursor#observe","kind":"function","options":[],"locus":"Anywhere"},"Cursor#observeChanges":{"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.","memberof":"Mongo.Cursor","params":[{"type":{"names":["Object"]},"description":"Functions to call to deliver the result set as it changes
","name":"callbacks"}],"longname":"Mongo.Cursor#observeChanges","kind":"function","options":[],"locus":"Anywhere"},"Collection#insert":{"summary":"Insert a document in the collection. Returns its unique _id.","kind":"function","memberof":"Mongo.Collection","params":[{"type":{"names":["Object"]},"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":["function"]},"optional":true,"description":"Optional. If present, called with an error object as the first argument and, if no error, the _id as the second.
","name":"callback"}],"longname":"Mongo.Collection#insert","options":[],"locus":"Anywhere"},"Collection#update":{"summary":"Modify one or more documents in the collection. Returns the number of affected documents.","kind":"function","memberof":"Mongo.Collection","params":[{"type":{"names":["MongoSelector"]},"description":"Specifies which documents to modify
","name":"selector"},{"type":{"names":["MongoModifier"]},"description":"Specifies how to modify the documents
","name":"modifier"},{"type":{"names":["Object"]},"optional":true,"name":"options"},{"type":{"names":["function"]},"optional":true,"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"}],"longname":"Mongo.Collection#update","options":[{"type":{"names":["Boolean"]},"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"}],"locus":"Anywhere"},"Collection#find":{"summary":"Find the documents in a collection that match the selector.","kind":"function","memberof":"Mongo.Collection","params":[{"type":{"names":["MongoSelector"]},"optional":true,"description":"A query describing the documents to find
","name":"selector"},{"type":{"names":["Object"]},"optional":true,"name":"options"}],"longname":"Mongo.Collection#find","options":[{"type":{"names":["MongoSortSpecifier"]},"description":"Sort order (default: natural order)
","name":"sort"},{"type":{"names":["Number"]},"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":["MongoFieldSpecifier"]},"description":"Dictionary of fields to return or exclude.
","name":"fields"},{"type":{"names":["Boolean"]},"description":"(Client only) Default true; pass false to disable reactivity
Overrides transform on the Collection for this cursor. Pass null to disable transformation.
A query describing the documents to find
","name":"selector"},{"type":{"names":["Object"]},"optional":true,"name":"options"}],"longname":"Mongo.Collection#findOne","options":[{"type":{"names":["MongoSortSpecifier"]},"description":"Sort order (default: natural order)
","name":"sort"},{"type":{"names":["Number"]},"description":"Number of results to skip at the beginning
","name":"skip"},{"type":{"names":["MongoFieldSpecifier"]},"description":"Dictionary of fields to return or exclude.
","name":"fields"},{"type":{"names":["Boolean"]},"description":"(Client only) Default true; pass false to disable reactivity
","name":"reactive"},{"type":{"names":["function"]},"description":"Overrides transform on the Collection for this cursor. Pass null to disable transformation.
Specifies which documents to remove
","name":"selector"},{"type":{"names":["function"]},"optional":true,"description":"Optional. If present, called with an error object as its argument.
","name":"callback"}],"longname":"Mongo.Collection#remove","options":[],"locus":"Anywhere"},"Collection#upsert":{"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).","params":[{"type":{"names":["MongoSelector"]},"description":"Specifies which documents to modify
","name":"selector"},{"type":{"names":["MongoModifier"]},"description":"Specifies how to modify the documents
","name":"modifier"},{"type":{"names":["Object"]},"optional":true,"name":"options"},{"type":{"names":["function"]},"optional":true,"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"}],"longname":"Mongo.Collection#upsert","kind":"function","memberof":"Mongo.Collection","options":[{"type":{"names":["Boolean"]},"description":"True to modify all matching documents; false to only modify one of the matching documents (the default).
","name":"multi"}],"locus":"Anywhere"},"Collection#allow":{"summary":"Allow users to write directly to this collection from client code, subject to limitations you define.","params":[{"type":{"names":["Object"]},"name":"options"}],"longname":"Mongo.Collection#allow","kind":"function","memberof":"Mongo.Collection","options":[{"type":{"names":["function"]},"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":["Array.Optional performance enhancement. Limits the fields that will be fetched from the database for inspection by your update and remove functions.
Overrides transform on the Collection. Pass null to disable transformation.
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":["Array.Optional performance enhancement. Limits the fields that will be fetched from the database for inspection by your update and remove functions.
Overrides transform on the Collection. Pass null to disable transformation.
The name of the collection. If null, creates an unmanaged (unsynchronized) local collection.
","name":"name"},{"type":{"names":["Object"]},"optional":true,"name":"options"}],"longname":"Mongo.Collection","memberof":"Mongo","options":[{"type":{"names":["Object"]},"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.
The method of generating the _id fields of new documents in this collection. Possible values:
'STRING': random strings'MONGO': random Mongo.ObjectID valuesThe default id generation technique is 'STRING'.
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.
Optional. The 24-character hexadecimal contents of the ObjectID to create
","name":"hexString"}],"longname":"Mongo.ObjectID","memberof":"Mongo","options":[],"locus":"Anywhere"},"Cursor":{"summary":"To create a cursor, use find. To access the documents in a cursor, use forEach, map, or fetch.","kind":"class","longname":"Mongo.Cursor","memberof":"Mongo","options":[],"params":[],"instancename":"cursor"}},"Assets":{"summary":"The namespace for Assets functions, lives in the bundler.","kind":"namespace","longname":"Assets","getText":{"summary":"Retrieve the contents of the static server asset as a UTF8-encoded string.","memberof":"Assets","params":[{"type":{"names":["String"]},"description":"The path of the asset, relative to the application's private subdirectory.
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"}],"longname":"Assets.getText","kind":"function","options":[],"locus":"Server"},"getBinary":{"summary":"Retrieve the contents of the static server asset as an [EJSON Binary](#ejson_new_binary).","memberof":"Assets","params":[{"type":{"names":["String"]},"description":"The path of the asset, relative to the application's private subdirectory.
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"}],"longname":"Assets.getBinary","kind":"function","options":[],"locus":"Server"}},"Package":{"summary":"The Package object in package.js","kind":"namespace","longname":"Package","locus":"package.js","describe":{"summary":"Provide basic package information.","memberof":"Package","params":[{"type":{"names":["Object"]},"name":"options"}],"longname":"Package.describe","kind":"function","options":[{"type":{"names":["String"]},"description":"A concise 1-2 sentence description of the package, required for publication.
","name":"summary"},{"type":{"names":["String"]},"description":"The semver version for your package. If no version is specified, defaults to 0.0.0. You need to specify a version to publish to the package server.
Optional name override. By default, the package name comes from the name of its directory.
","name":"name"},{"type":{"names":["String"]},"description":"Optional Git URL to the source repository.
","name":"git"}],"locus":"package.js"},"onUse":{"summary":"Define package dependencies and expose package methods.","memberof":"Package","params":[{"type":{"names":["function"]},"description":"A function that takes in the package control 'api' object, which keeps track of dependencies and exports.
","name":"func"}],"longname":"Package.onUse","kind":"function","options":[],"locus":"package.js"},"onTest":{"summary":"Define dependencies and expose package methods for unit tests.","memberof":"Package","params":[{"type":{"names":["function"]},"description":"A function that takes in the package control 'api' object, which keeps track of dependencies and exports.
","name":"func"}],"longname":"Package.onTest","kind":"function","options":[],"locus":"package.js"}},"Npm":{"kind":"namespace","summary":"The Npm object in package.js and package source files.","longname":"Npm","depends":{"summary":"Specify which [NPM](https://www.npmjs.org/) packages\nyour Meteor package depends on.","params":[{"type":{"names":["Object"]},"description":"An object where the keys are package\nnames and the values are version numbers in string form.\nYou can only depend on exact versions of NPM packages. Example:
\nNpm.depends({moment: "2.8.3"});","name":"dependencies"}],"memberof":"Npm","longname":"Npm.depends","kind":"function","options":[],"locus":"package.js"},"require":{"summary":"Require a package that was specified using\n`Npm.depends()`.","params":[{"type":{"names":["String"]},"description":"The name of the package to require.
","name":"name"}],"memberof":"Npm","longname":"Npm.require","kind":"function","options":[],"locus":"Server"}},"Cordova":{"kind":"namespace","summary":"The Cordova object in package.js.","longname":"Cordova","depends":{"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 / PhoneGap](https://github.com/meteor/meteor/wiki/Meteor-Cordova-Phonegap-integration#meteor-packages-with-cordovaphonegap-dependencies)\npage of the Meteor wiki on GitHub.","params":[{"type":{"names":["Object"]},"description":"An object where the keys are plugin\nnames and the values are version numbers or GitHub tarball URLs\nin string form.\nExample:
\nCordova.depends({\n "org.apache.cordova.camera": "0.3.0"\n});Alternatively, with a GitHub URL:
\nCordova.depends({\n "org.apache.cordova.camera":\n "https://github.com/apache/cordova-plugin-camera/tarball/d84b875c"\n});","name":"dependencies"}],"memberof":"Cordova","longname":"Cordova.depends","kind":"function","options":[],"locus":"package.js"}},"currentUser":{"summary":"Calls [Meteor.user()](#meteor_user). Use `{{#if currentUser}}` to check whether the user is logged in.","longname":"currentUser","kind":"member","ishelper":"true"},"loggingIn":{"summary":"Calls [Meteor.loggingIn()](#meteor_loggingin).","longname":"loggingIn","kind":"member","ishelper":"true"},"Template#created":{"memberof":"Template","summary":"Provide a callback when an instance of a template is created.","longname":"Template#created","kind":"member","locus":"Client"},"Template#rendered":{"memberof":"Template","summary":"Provide a callback when an instance of a template is rendered.","longname":"Template#rendered","kind":"member","locus":"Client"},"Template#destroyed":{"memberof":"Template","summary":"Provide a callback when an instance of a template is destroyed.","longname":"Template#destroyed","kind":"member","locus":"Client"},"Blaze":{"TemplateInstance#data":{"memberof":"Blaze.TemplateInstance","summary":"The data context of this instance's latest invocation.","longname":"Blaze.TemplateInstance#data","kind":"member","locus":"Client"},"TemplateInstance#view":{"memberof":"Blaze.TemplateInstance","summary":"The [View](#blaze_view) object for this invocation of the template.","longname":"Blaze.TemplateInstance#view","kind":"member","locus":"Client"},"TemplateInstance#firstNode":{"memberof":"Blaze.TemplateInstance","summary":"The first top-level DOM node in this template instance.","longname":"Blaze.TemplateInstance#firstNode","kind":"member","locus":"Client"},"TemplateInstance#lastNode":{"memberof":"Blaze.TemplateInstance","summary":"The last top-level DOM node in this template instance.","longname":"Blaze.TemplateInstance#lastNode","kind":"member","locus":"Client"},"currentView":{"summary":"The View corresponding to the current template helper, event handler, callback, or autorun. If there isn't one, `null`.","longname":"Blaze.currentView","kind":"member","memberof":"Blaze","locus":"Client"},"With":{"summary":"Constructs a View that renders content with a data context.","params":[{"type":{"names":["Object","function"]},"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":["function"]},"description":"A Function that returns renderable content.
","name":"contentFunc"}],"longname":"Blaze.With","kind":"function","memberof":"Blaze","options":[],"locus":"Client"},"If":{"summary":"Constructs a View that renders content conditionally.","params":[{"type":{"names":["function"]},"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.
A Function that returns renderable content.
","name":"contentFunc"},{"type":{"names":["function"]},"optional":true,"description":"Optional. A Function that returns renderable content. If no elseFunc is supplied, no content is shown in the "else" case.
A function to reactively re-run. If the result is falsy, contentFunc is shown, otherwise elseFunc is shown. An empty array is considered falsy.
A Function that returns renderable content.
","name":"contentFunc"},{"type":{"names":["function"]},"optional":true,"description":"Optional. A Function that returns renderable content. If no elseFunc is supplied, no content is shown in the "else" case.
A function to reactively re-run. The function may return a Cursor, an array, null, or undefined.
","name":"argFunc"},{"type":{"names":["function"]},"description":"A Function that returns renderable content.
","name":"contentFunc"},{"type":{"names":["function"]},"optional":true,"description":"Optional. A Function that returns renderable content to display in the case when there are no items to display.
","name":"elseFunc"}],"longname":"Blaze.Each","kind":"function","memberof":"Blaze","options":[],"locus":"Client"},"isTemplate":{"summary":"Returns true if `value` is a template object like `Template.myTemplate`.","params":[{"type":{"names":["Any"]},"description":"The value to test.
","name":"value"}],"longname":"Blaze.isTemplate","kind":"function","memberof":"Blaze","options":[],"locus":"Client"},"TemplateInstance#$":{"summary":"Find all elements matching `selector` in this template instance, and return them as a JQuery object.","params":[{"type":{"names":["String"]},"description":"The CSS selector to match, scoped to the template contents.
","name":"selector"}],"longname":"Blaze.TemplateInstance#$","kind":"function","memberof":"Blaze.TemplateInstance","options":[],"locus":"Client"},"TemplateInstance#findAll":{"summary":"Find all elements matching `selector` in this template instance.","params":[{"type":{"names":["String"]},"description":"The CSS selector to match, scoped to the template contents.
","name":"selector"}],"longname":"Blaze.TemplateInstance#findAll","kind":"function","memberof":"Blaze.TemplateInstance","options":[],"locus":"Client"},"TemplateInstance#find":{"summary":"Find one element matching `selector` in this template instance.","params":[{"type":{"names":["String"]},"description":"The CSS selector to match, scoped to the template contents.
","name":"selector"}],"longname":"Blaze.TemplateInstance#find","kind":"function","memberof":"Blaze.TemplateInstance","options":[],"locus":"Client"},"TemplateInstance#autorun":{"summary":"A version of [Tracker.autorun](#tracker_autorun) that is stopped when the template is destroyed.","params":[{"type":{"names":["function"]},"description":"The function to run. It receives one argument: a Tracker.Computation object.
","name":"runFunc"}],"longname":"Blaze.TemplateInstance#autorun","kind":"function","memberof":"Blaze.TemplateInstance","options":[],"locus":"Client"},"render":{"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).","params":[{"type":{"names":["Template","Blaze.View"]},"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.
The node that will be the parent of the rendered template. It must be an Element node.
","name":"parentNode"},{"type":{"names":["DOMNode"]},"optional":true,"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"},{"type":{"names":["Blaze.View"]},"optional":true,"description":"Optional. If provided, it will be set as the rendered View's parentView.
The template (e.g. Template.myTemplate) or View object to render.
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":["DOMNode"]},"description":"The node that will be the parent of the rendered template. It must be an Element node.
","name":"parentNode"},{"type":{"names":["DOMNode"]},"optional":true,"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"},{"type":{"names":["Blaze.View"]},"optional":true,"description":"Optional. If provided, it will be set as the rendered View's parentView.
The return value from Blaze.render or Blaze.renderWithData.
The template (e.g. Template.myTemplate) or View object from which to generate HTML.
The template (e.g. Template.myTemplate) or View object from which to generate HTML.
The data context to use, or a function returning a data context.
","name":"data"}],"longname":"Blaze.toHTMLWithData","kind":"function","memberof":"Blaze","options":[],"locus":"Client"},"getData":{"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.","params":[{"type":{"names":["DOMElement","Blaze.View"]},"optional":true,"description":"Optional. An element that was rendered by a Meteor, or a View.
","name":"elementOrView"}],"longname":"Blaze.getData","kind":"function","memberof":"Blaze","options":[],"locus":"Client"},"getView":{"summary":"Gets either the current View, or the View enclosing the given DOM element.","params":[{"type":{"names":["DOMElement"]},"optional":true,"description":"Optional. If specified, the View enclosing element is returned.
Optional. A name for Views constructed by this Template. See view.name.
A function that returns renderable content. This function is used as the renderFunction for Views constructed by this Template.
Optional. A name for this type of View. See view.name.
A function that returns renderable content. In this function, this is bound to the View.
The number of levels beyond the current data context to look.
","name":"numLevels"}],"longname":"Template.parentData","memberof":"Template","options":[],"locus":"Client"},"registerHelper":{"summary":"Defines a [helper function](#template_helpers) which can be used from all templates.","kind":"function","params":[{"type":{"names":["String"]},"description":"The name of the helper function you are defining.
","name":"name"},{"type":{"names":["function"]},"description":"The helper function itself.
","name":"function"}],"longname":"Template.registerHelper","memberof":"Template","options":[],"locus":"Client"},"dynamic":{"memberof":"Template","kind":"function","summary":"Choose a template to include dynamically, by name.","params":[{"type":{"names":["String"]},"description":"The name of the template to include.
","name":"template"},{"type":{"names":["Object"]},"optional":true,"description":"Optional. The data context in which to include the template.
","name":"data"}],"longname":"Template.dynamic","options":[],"istemplate":"true","locus":"Templates"},"summary":"The class for defining templates","kind":"class","longname":"Template","options":[],"params":[],"instancename":"Template.myTemplate"},"Tracker":{"active":{"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.","longname":"Tracker.active","kind":"member","memberof":"Tracker","locus":"Client"},"currentComputation":{"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.","longname":"Tracker.currentComputation","kind":"member","memberof":"Tracker","locus":"Client"},"Computation#stopped":{"summary":"True if this computation has been stopped.","memberof":"Tracker.Computation","longname":"Tracker.Computation#stopped","kind":"member","locus":"Client"},"Computation#invalidated":{"summary":"True if this computation has been invalidated (and not yet rerun), or if it has been stopped.","memberof":"Tracker.Computation","longname":"Tracker.Computation#invalidated","kind":"member","locus":"Client"},"Computation#firstRun":{"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.","memberof":"Tracker.Computation","longname":"Tracker.Computation#firstRun","kind":"member","locus":"Client"},"Computation":{"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.","longname":"Tracker.Computation","kind":"function","memberof":"Tracker","options":[],"params":[],"instancename":"computation"},"Computation#onInvalidate":{"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.","params":[{"type":{"names":["function"]},"description":"Function to be called on invalidation. Receives one argument, the computation that was invalidated.
","name":"callback"}],"longname":"Tracker.Computation#onInvalidate","kind":"function","memberof":"Tracker.Computation","options":[],"locus":"Client"},"Computation#invalidate":{"summary":"Invalidates this computation so that it will be rerun.","longname":"Tracker.Computation#invalidate","kind":"function","memberof":"Tracker.Computation","options":[],"params":[],"locus":"Client"},"Computation#stop":{"summary":"Prevents this computation from rerunning.","longname":"Tracker.Computation#stop","kind":"function","memberof":"Tracker.Computation","options":[],"params":[],"locus":"Client"},"Dependency#depend":{"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.","params":[{"type":{"names":["Tracker.Computation"]},"optional":true,"description":"An optional computation declared to depend on dependency instead of the current computation.
The function to run. It receives one argument: the Computation object that will be returned.
","name":"runFunc"}],"longname":"Tracker.autorun","kind":"function","memberof":"Tracker","options":[],"locus":"Client"},"nonreactive":{"summary":"Run a function without tracking dependencies.","params":[{"type":{"names":["function"]},"description":"A function to call immediately.
","name":"func"}],"longname":"Tracker.nonreactive","kind":"function","memberof":"Tracker","options":[],"locus":"Client"},"onInvalidate":{"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.","params":[{"type":{"names":["function"]},"description":"A callback function that will be invoked as func(c), where c is the computation on which the callback is registered.
A function to call at flush time.
","name":"callback"}],"longname":"Tracker.afterFlush","kind":"function","memberof":"Tracker","options":[],"locus":"Client"},"Dependency":{"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.","kind":"class","longname":"Tracker.Dependency","memberof":"Tracker","options":[],"params":[],"instancename":"dependency"}},"Template#helpers":{"summary":"Specify template helpers available to this template.","params":[{"type":{"names":["Object"]},"description":"Dictionary of helper functions by name.
","name":"helpers"}],"longname":"Template#helpers","kind":"function","memberof":"Template","options":[],"locus":"Client"},"Template#events":{"summary":"Specify event handlers for this template.","params":[{"type":{"names":["EventMap"]},"description":"Event handlers to associate with this template.
","name":"eventMap"}],"longname":"Template#events","kind":"function","memberof":"Template","options":[],"locus":"Client"},"check":{"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.","params":[{"type":{"names":["Any"]},"description":"The value to check
","name":"value"},{"type":{"names":["MatchPattern"]},"description":"The pattern to match\nvalue against
The value to check
","name":"value"},{"type":{"names":["MatchPattern"]},"description":"The pattern to match value against
The value that should be returned by userId on this connection.
The URL of another Meteor application.
","name":"url"}],"longname":"DDP.connect","kind":"function","memberof":"DDP","options":[],"locus":"Anywhere"}},"Subscription#error":{"summary":"Call inside the publish function. Stops this client's subscription, triggering a call on the client to the `onError` callback passed to [`Meteor.subscribe`](#meteor_subscribe), if any. If `error` is not a [`Meteor.Error`](#meteor_error), it will be [sanitized](#meteor_error).","params":[{"type":{"names":["Error"]},"description":"The error to pass to the client.
","name":"error"}],"memberof":"Subscription","longname":"Subscription#error","kind":"function","options":[],"locus":"Server"},"Subscription#stop":{"summary":"Call inside the publish function. Stops this client's subscription; the `onError` callback is *not* invoked on the client.","memberof":"Subscription","longname":"Subscription#stop","kind":"function","options":[],"params":[],"locus":"Server"},"Subscription#onStop":{"summary":"Call inside the publish function. Registers a callback function to run when the subscription is stopped.","memberof":"Subscription","params":[{"type":{"names":["function"]},"description":"The callback function
","name":"func"}],"longname":"Subscription#onStop","kind":"function","options":[],"locus":"Server"},"Subscription#added":{"summary":"Call inside the publish function. Informs the subscriber that a document has been added to the record set.","memberof":"Subscription","params":[{"type":{"names":["String"]},"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":["Object"]},"description":"The fields in the new document. If _id is present it is ignored.
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":["Object"]},"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.
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"}],"longname":"Subscription#removed","kind":"function","options":[],"locus":"Server"},"Subscription#ready":{"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.","memberof":"Subscription","longname":"Subscription#ready","kind":"function","options":[],"params":[],"locus":"Server"},"Email":{"send":{"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.","params":[{"type":{"names":["Object"]},"name":"options"}],"longname":"Email.send","kind":"function","memberof":"Email","options":[{"type":{"names":["String"]},"description":""From:" address (required)
","name":"from"},{"type":{"names":["String","Array."To:", "Cc:", "Bcc:", and "Reply-To:" addresses
","name":"to, cc, bcc, replyTo"},{"type":{"names":["String"]},"optional":true,"description":""Subject:" line
","name":"subject"},{"type":{"names":["String"]},"optional":true,"description":"Mail body (in plain text or HTML)
","name":"text, html"},{"type":{"names":["Object"]},"optional":true,"description":"Dictionary of custom headers
","name":"headers"}],"locus":"Server"}},"HTTP":{"call":{"summary":"Perform an outbound HTTP request.","params":[{"type":{"names":["String"]},"description":"The HTTP method to use, such as "GET", "POST", or "HEAD".
The URL to retrieve.
","name":"url"},{"type":{"names":["Object"]},"optional":true,"name":"options"},{"type":{"names":["function"]},"optional":true,"description":"Optional callback. If passed, the method runs asynchronously, instead of synchronously, and calls asyncCallback. On the client, this callback is required.
","name":"asyncCallback"}],"longname":"HTTP.call","kind":"function","memberof":"HTTP","options":[{"type":{"names":["String"]},"description":"String to use as the HTTP request body.
","name":"content"},{"type":{"names":["Object"]},"description":"JSON-able object to stringify and use as the HTTP request body. Overwrites content.
Query string to go in the URL. Overwrites any query string in url.
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.
HTTP basic authentication string of the form "username:password"
Dictionary of strings, headers to add to the HTTP request.
","name":"headers"},{"type":{"names":["Number"]},"description":"Maximum time in milliseconds to wait for the request before failing. There is no timeout by default.
","name":"timeout"},{"type":{"names":["Boolean"]},"description":"If true, transparently follow HTTP redirects. Cannot be set to false on the client. Default true.
The URL to which the request should be sent.
","name":"url"},{"type":{"names":["Object"]},"optional":true,"description":"Options passed on to HTTP.call.
Callback that is called when the request is completed. Required on the client.
","name":"asyncCallback"}],"longname":"HTTP.get","kind":"function","memberof":"HTTP","options":[],"locus":"Anywhere"},"post":{"summary":"Send an HTTP `POST` request. Equivalent to calling [`HTTP.call`](#http_call) with \"POST\" as the first argument.","params":[{"type":{"names":["String"]},"description":"The URL to which the request should be sent.
","name":"url"},{"type":{"names":["Object"]},"optional":true,"description":"Options passed on to HTTP.call.
Callback that is called when the request is completed. Required on the client.
","name":"asyncCallback"}],"longname":"HTTP.post","kind":"function","memberof":"HTTP","options":[],"locus":"Anywhere"},"put":{"summary":"Send an HTTP `PUT` request. Equivalent to calling [`HTTP.call`](#http_call) with \"PUT\" as the first argument.","params":[{"type":{"names":["String"]},"description":"The URL to which the request should be sent.
","name":"url"},{"type":{"names":["Object"]},"optional":true,"description":"Options passed on to HTTP.call.
Callback that is called when the request is completed. Required on the client.
","name":"asyncCallback"}],"longname":"HTTP.put","kind":"function","memberof":"HTTP","options":[],"locus":"Anywhere"},"del":{"summary":"Send an HTTP `DELETE` request. Equivalent to calling [`HTTP.call`](#http_call) with \"DELETE\" as the first argument. (Named `del` to avoid conflic with the Javascript keyword `delete`)","params":[{"type":{"names":["String"]},"description":"The URL to which the request should be sent.
","name":"url"},{"type":{"names":["Object"]},"optional":true,"description":"Options passed on to HTTP.call.
Callback that is called when the request is completed. Required on the client.
","name":"asyncCallback"}],"longname":"HTTP.del","kind":"function","memberof":"HTTP","options":[],"locus":"Anywhere"}},"ReactiveVar#get":{"summary":"Returns the current value of the ReactiveVar, establishing a reactive dependency.","longname":"ReactiveVar#get","kind":"function","memberof":"ReactiveVar","options":[],"params":[],"locus":"Client"},"ReactiveVar#set":{"summary":"Sets the current value of the ReactiveVar, invalidating the Computations that called `get` if `newValue` is different from the old value.","params":[{"type":{"names":["Any"]},"name":"newValue"}],"longname":"ReactiveVar#set","kind":"function","memberof":"ReactiveVar","options":[],"locus":"Client"},"Session":{"set":{"memberof":"Session","kind":"function","summary":"Set a variable in the session. Notify any listeners that the value has changed (eg: redraw templates, and rerun any [`Tracker.autorun`](#tracker_autorun) computations, that called [`Session.get`](#session_get) on this `key`.)","params":[{"type":{"names":["String"]},"description":"The key to set, eg, selectedItem
The new value for key
The key to set, eg, selectedItem
The new value for key
The name of the session variable to return
","name":"key"}],"longname":"Session.get","options":[],"locus":"Client"},"equals":{"memberof":"Session","kind":"function","summary":"Test if a session variable is equal to a value. If inside a [reactive computation](#reactivity), invalidate the computation the next time the variable changes to or from the value.","params":[{"type":{"names":["String"]},"description":"The name of the session variable to test
","name":"key"},{"type":{"names":["String","Number","Boolean","null","undefined"]},"description":"The value to test against
","name":"value"}],"longname":"Session.equals","options":[],"locus":"Client"}},"PackageAPI#use":{"memberof":"PackageAPI","summary":"Depend on package `packagename`.","params":[{"type":{"names":["String","Array.Packages being depended on.\nPackage names may be suffixed with an @version tag.
\nIn 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.
If you only use the package on the\nserver (or the client), you can pass in the second argument (e.g.,\n'server' or 'client') to specify what architecture the package is\nused with.
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.
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 of a package, or array of package names, with an optional @version component for each.
","name":"packageSpecs"}],"longname":"PackageAPI#imply","kind":"function","options":[],"locus":"package.js"},"PackageAPI#addFiles":{"memberof":"PackageAPI","summary":"Specify the source code for your package.","params":[{"type":{"names":["String","Array.Name of the source file, or array of strings of source file names.
","name":"filename"},{"type":{"names":["String"]},"optional":true,"description":"If you only want to export the file on the server (or the client), you can pass in the second argument (e.g., 'server' or 'client') to specify what architecture the file is used with.
","name":"architecture"}],"longname":"PackageAPI#addFiles","kind":"function","options":[],"locus":"package.js"},"PackageAPI#versionsFrom":{"memberof":"PackageAPI","summary":"Use versions of core packages from a release. Unless provided, all packages will default to the versions released along with `meteorversion`. This will save you from having to figure out the exact versions of the core packages you want to use. For example, if the newest release of meteor is METEOR@0.9.0 and it uses jquery@1.0.0, you can use `api.versionsFrom('METEOR@0.9.0')`. If your package uses jQuery, it will automatically depend on jQuery 1.0.0 when it is published.","params":[{"type":{"names":["String"]},"description":"Specification of a release: track@version. Just 'version' (ex: "0.9.0") is sufficient if using the default release track
Name of the object.
","name":"exportedObject"},{"type":{"names":["String"]},"optional":true,"description":"If you only want to export the object on the server (or the client), you can pass in the second argument (e.g., 'server' or 'client') to specify what architecture the export is used with.
","name":"architecture"}],"longname":"PackageAPI#export","kind":"function","options":[],"locus":"package.js"},"Subscription":{"summary":"The server's side of a subscription","kind":"class","longname":"Subscription","options":[],"params":[],"instancename":"this"},"ReactiveVar":{"kind":"class","summary":"Constructor for a ReactiveVar, which represents a single reactive variable.","params":[{"type":{"names":["Any"]},"description":"The initial value to set. equalsFunc is ignored when setting the initial value.
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.
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.
If true, forces the user to approve the app's permissions, even if previously approved. Currently only supported with Google.
","name":"forceApprovalPrompt"},{"type":{"names":["String"]},"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).
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.
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' }).
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.
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.
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"}],"longname":"Accounts.validateLoginAttempt","kind":"function","memberof":"Accounts","options":[],"locus":"Server"},"onLogin":{"summary":"Register a callback to be called after a login attempt succeeds.","params":[{"type":{"names":["function"]},"description":"The callback to be called when login is successful.
","name":"func"}],"longname":"Accounts.onLogin","kind":"function","memberof":"Accounts","options":[],"locus":"Server"},"onLoginFailure":{"summary":"Register a callback to be called after a login attempt fails.","params":[{"type":{"names":["function"]},"description":"The callback to be called after the login has failed.
","name":"func"}],"longname":"Accounts.onLoginFailure","kind":"function","memberof":"Accounts","options":[],"locus":"Server"},"onCreateUser":{"summary":"Customize new user creation.","params":[{"type":{"names":["function"]},"description":"Called whenever a new user is created. Return the new user object, or throw an Error to abort the creation.
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"}],"longname":"Accounts.validateNewUser","kind":"function","memberof":"Accounts","options":[],"locus":"Server"},"onResetPasswordLink":{"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()`.","params":[{"type":{"names":["function"]},"description":"The function to call. It is given two arguments:
\ntoken: A password reset token that can be passed to\nAccounts.resetPassword.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.The function to call. It is given two arguments:
\ntoken: An email verification token that can be passed to\nAccounts.verifyEmail.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.The function to call. It is given two arguments:
\ntoken: A password reset token that can be passed to\nAccounts.resetPassword to give the newly\nenrolled account a password.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.Client only, optional callback. Called with no arguments on success, or with a single Error argument on failure.
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":["Object"]},"description":"The user's profile, typically including the name field.
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":["function"]},"optional":true,"description":"Optional callback. Called with no arguments on success, or with a single Error argument on failure.
Optional callback. Called with no arguments on success, or with a single Error argument on failure.
The email address to send a password reset link.
","name":"email"}],"locus":"Client"},"resetPassword":{"summary":"Reset the password for a user using a token received in email. Logs the user in afterwards.","params":[{"type":{"names":["String"]},"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":["function"]},"optional":true,"description":"Optional callback. Called with no arguments on success, or with a single Error argument on failure.
The token retrieved from the verification URL.
","name":"token"},{"type":{"names":["function"]},"optional":true,"description":"Optional callback. Called with no arguments on success, or with a single Error argument on failure.
The id of the user to update.
","name":"userId"},{"type":{"names":["String"]},"description":"A new password for the user.
","name":"newPassword"}],"longname":"Accounts.setPassword","kind":"function","memberof":"Accounts","options":[],"locus":"Server"},"sendResetPasswordEmail":{"summary":"Send an email with a link the user can use to reset their password.","params":[{"type":{"names":["String"]},"description":"The id of the user to send email to.
","name":"userId"},{"type":{"names":["String"]},"optional":true,"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.
The id of the user to send email to.
","name":"userId"},{"type":{"names":["String"]},"optional":true,"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.
The id of the user to send email to.
","name":"userId"},{"type":{"names":["String"]},"optional":true,"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.
The number of bytes of binary data to allocate.
","name":"size"}],"longname":"EJSON.newBinary","kind":"member","memberof":"EJSON","locus":"Anywhere"},"CustomType#typeName":{"kind":"function","memberof":"EJSON.CustomType","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).","longname":"EJSON.CustomType#typeName","options":[],"params":[],"locus":"Anywhere"},"CustomType#toJSONValue":{"kind":"function","memberof":"EJSON.CustomType","summary":"Serialize this instance into a JSON-compatible value.","longname":"EJSON.CustomType#toJSONValue","options":[],"params":[],"locus":"Anywhere"},"CustomType#clone":{"kind":"function","memberof":"EJSON.CustomType","summary":"Return a value `r` such that `this.equals(r)` is true, and modifications to `r` do not affect `this` and vice versa.","longname":"EJSON.CustomType#clone","options":[],"params":[],"locus":"Anywhere"},"CustomType#equals":{"kind":"function","memberof":"EJSON.CustomType","summary":"Return `true` if `other` has a value equal to `this`; `false` otherwise.","params":[{"type":{"names":["Object"]},"description":"Another object to compare this to.
","name":"other"}],"longname":"EJSON.CustomType#equals","options":[],"locus":"Anywhere"},"addType":{"summary":"Add a custom datatype to EJSON.","params":[{"type":{"names":["String"]},"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.
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.
A value to serialize to plain JSON.
","name":"val"}],"longname":"EJSON.toJSONValue","kind":"function","memberof":"EJSON","options":[],"locus":"Anywhere"},"fromJSONValue":{"summary":"Deserialize an EJSON value from its plain JSON representation.","params":[{"type":{"names":["JSONCompatible"]},"description":"A value to deserialize into EJSON.
","name":"val"}],"longname":"EJSON.fromJSONValue","kind":"function","memberof":"EJSON","options":[],"locus":"Anywhere"},"stringify":{"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`.","params":[{"type":{"names":["EJSON"]},"description":"A value to stringify.
","name":"val"},{"type":{"names":["Object"]},"optional":true,"name":"options"}],"longname":"EJSON.stringify","kind":"function","memberof":"EJSON","options":[{"type":{"names":["Boolean","Integer","String"]},"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.
When true, stringifies keys in an object in sorted order.
A string to parse into an EJSON value.
","name":"str"}],"longname":"EJSON.parse","kind":"function","memberof":"EJSON","options":[],"locus":"Anywhere"},"isBinary":{"summary":"Returns true if `x` is a buffer of binary data, as returned from [`EJSON.newBinary`](#ejson_new_binary).","params":[{"type":{"names":["Object"]},"description":"The variable to check.
","name":"x"}],"longname":"EJSON.isBinary","kind":"function","memberof":"EJSON","options":[],"locus":"Anywhere"},"equals":{"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.","params":[{"type":{"names":["EJSON"]},"name":"a"},{"type":{"names":["EJSON"]},"name":"b"},{"type":{"names":["Object"]},"optional":true,"name":"options"}],"longname":"EJSON.equals","kind":"function","memberof":"EJSON","options":[{"type":{"names":["Boolean"]},"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.
A value to copy.
","name":"val"}],"longname":"EJSON.clone","kind":"function","memberof":"EJSON","options":[],"locus":"Anywhere"},"CustomType":{"kind":"class","memberof":"EJSON","summary":"The interface that a class must satisfy to be able to become an\nEJSON custom type via EJSON.addType.","longname":"EJSON.CustomType","options":[],"params":[],"instancename":"customType"}},"Meteor":{"summary":"The Meteor namespace","kind":"namespace","longname":"Meteor","users":{"summary":"A [Mongo.Collection](#collections) containing user documents.","longname":"Meteor.users","kind":"member","memberof":"Meteor","locus":"Anywhere"},"isClient":{"summary":"Boolean variable. True if running in client environment.","longname":"Meteor.isClient","kind":"member","memberof":"Meteor","locus":"Anywhere"},"isServer":{"summary":"Boolean variable. True if running in server environment.","longname":"Meteor.isServer","kind":"member","memberof":"Meteor","locus":"Anywhere"},"settings":{"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 you don't provide any settings, `Meteor.settings` will be an empty object. 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.","longname":"Meteor.settings","kind":"member","memberof":"Meteor","locus":"Anywhere"},"isCordova":{"summary":"Boolean variable. True if running in a Cordova mobile environment.","longname":"Meteor.isCordova","kind":"member","memberof":"Meteor","locus":"Anywhere"},"release":{"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.","longname":"Meteor.release","kind":"member","memberof":"Meteor","locus":"Anywhere"},"userId":{"summary":"Get the current user id, or `null` if no user is logged in. A reactive data source.","longname":"Meteor.userId","kind":"function","memberof":"Meteor","options":[],"params":[],"locus":"Anywhere but publish functions"},"loggingIn":{"summary":"True if a login method (such as `Meteor.loginWithPassword`, `Meteor.loginWithFacebook`, or `Accounts.createUser`) is currently in progress. A reactive data source.","longname":"Meteor.loggingIn","kind":"function","memberof":"Meteor","options":[],"params":[],"locus":"Client"},"user":{"summary":"Get the current user record, or `null` if no user is logged in. A reactive data source.","longname":"Meteor.user","kind":"function","memberof":"Meteor","options":[],"params":[],"locus":"Anywhere but publish functions"},"logout":{"summary":"Log the user out.","params":[{"type":{"names":["function"]},"optional":true,"description":"Optional callback. Called with no arguments on success, or with a single Error argument on failure.
Optional callback. Called with no arguments on success, or with a single Error argument on failure.
Optional callback. Called with no arguments on success, or with a single Error argument on failure.
A list of permissions to request from the user.
","name":"requestPermissions"},{"type":{"names":["Boolean"]},"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.
If true, forces the user to approve the app's permissions, even if previously approved. Currently only supported with Google.
","name":"forceApprovalPrompt"},{"type":{"names":["String"]},"description":"An email address that the external service will use to pre-fill the login prompt. Currently only supported with Meteor developer accounts.
","name":"userEmail"},{"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"}],"locus":"Client"},"loginWithPassword":{"summary":"Log the user in with a password.","params":[{"type":{"names":["Object","String"]},"description":"Either a string interpreted as a username or an email; or an object with a single key: email, username or id.
The user's password.
","name":"password"},{"type":{"names":["function"]},"optional":true,"description":"Optional callback. Called with no arguments on success, or with a single Error argument on failure.
Name of the subscription. Matches the name of the server's publish() call.
Optional arguments passed to publisher function on server.
","name":"arg1, arg2..."},{"type":{"names":["function","Object"]},"optional":true,"description":"Optional. May include onError and onReady callbacks. If a function is passed instead of an object, it is interpreted as an onReady callback.
Name of method to invoke
","name":"name"},{"type":{"names":["EJSONable"]},"optional":true,"description":"Optional method arguments
","name":"arg1, arg2..."},{"type":{"names":["function"]},"optional":true,"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"}],"longname":"Meteor.call","kind":"function","options":[],"locus":"Anywhere"},"apply":{"memberof":"Meteor","summary":"Invoke a method passing an array of arguments.","params":[{"type":{"names":["String"]},"description":"Name of method to invoke
","name":"name"},{"type":{"names":["Array.Method arguments
","name":"args"},{"type":{"names":["Object"]},"optional":true,"name":"options"},{"type":{"names":["function"]},"optional":true,"description":"Optional callback; same semantics as in Meteor.call.
(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":["function"]},"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.
The function to call when a new DDP connection is established.
","name":"callback"}],"memberof":"Meteor","longname":"Meteor.onConnection","kind":"function","options":[],"locus":"Server"},"publish":{"summary":"Publish a record set.","memberof":"Meteor","params":[{"type":{"names":["String"]},"description":"Name of the record set. If null, the set has no name, and the record set is automatically sent to all connected clients.
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.
Dictionary whose keys are method names and values are functions.
","name":"methods"}],"memberof":"Meteor","longname":"Meteor.methods","kind":"function","options":[],"locus":"Anywhere"},"wrapAsync":{"memberof":"Meteor","summary":"Wrap a function that takes a callback function as its final parameter so that the wrapper function can be used either synchronously (without passing a callback) or asynchronously (when a callback is passed). If a callback is provided, the environment captured when the original function was called will be restored in the callback.","params":[{"type":{"names":["function"]},"description":"A function that takes a callback as its final parameter
","name":"func"},{"type":{"names":["Object"]},"optional":true,"description":"Optional this object against which the original function will be invoked
A function to run on startup.
","name":"func"}],"longname":"Meteor.startup","kind":"function","memberof":"Meteor","options":[],"locus":"Anywhere"},"setTimeout":{"memberof":"Meteor","summary":"Call a function in the future after waiting for a specified delay.","params":[{"type":{"names":["function"]},"description":"The function to run
","name":"func"},{"type":{"names":["Number"]},"description":"Number of milliseconds to wait before calling function
","name":"delay"}],"longname":"Meteor.setTimeout","kind":"function","options":[],"locus":"Anywhere"},"setInterval":{"memberof":"Meteor","summary":"Call a function repeatedly, with a time delay between calls.","params":[{"type":{"names":["function"]},"description":"The function to run
","name":"func"},{"type":{"names":["Number"]},"description":"Number of milliseconds to wait between each function call.
","name":"delay"}],"longname":"Meteor.setInterval","kind":"function","options":[],"locus":"Anywhere"},"clearInterval":{"memberof":"Meteor","summary":"Cancel a repeating function call scheduled by `Meteor.setInterval`.","params":[{"type":{"names":["Number"]},"description":"The handle returned by Meteor.setInterval
The handle returned by Meteor.setTimeout
A path to append to the root URL. Do not include a leading "/".
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":["String"]},"description":"Override the default ROOT_URL from the server environment. For example: "http://foo.example.com"
A numeric error code, likely similar to an HTTP code (eg, 404, 500).
","name":"error"},{"type":{"names":["String"]},"optional":true,"description":"Optional. A short human-readable summary of the error, like 'Not Found'.
","name":"reason"},{"type":{"names":["String"]},"optional":true,"description":"Optional. Additional information about the error, like a textual stack trace.
","name":"details"}],"longname":"Meteor.Error","memberof":"Meteor","options":[],"locus":"Anywhere"}},"Mongo":{"summary":"Namespace for MongoDB-related items","kind":"namespace","longname":"Mongo","Cursor#forEach":{"summary":"Call `callback` once for each matching document, sequentially and synchronously.","kind":"function","memberof":"Mongo.Cursor","params":[{"type":{"names":["function"]},"description":"Function to call. It will be called with three arguments: the document, a 0-based index, and cursor itself.
","name":"callback"},{"type":{"names":["Any"]},"optional":true,"description":"An object which will be the value of this inside callback.
Function to call. It will be called with three arguments: the document, a 0-based index, and cursor itself.
","name":"callback"},{"type":{"names":["Any"]},"optional":true,"description":"An object which will be the value of this inside callback.
Functions to call to deliver the result set as it changes
","name":"callbacks"}],"longname":"Mongo.Cursor#observe","kind":"function","options":[],"locus":"Anywhere"},"Cursor#observeChanges":{"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.","memberof":"Mongo.Cursor","params":[{"type":{"names":["Object"]},"description":"Functions to call to deliver the result set as it changes
","name":"callbacks"}],"longname":"Mongo.Cursor#observeChanges","kind":"function","options":[],"locus":"Anywhere"},"Collection#insert":{"summary":"Insert a document in the collection. Returns its unique _id.","kind":"function","memberof":"Mongo.Collection","params":[{"type":{"names":["Object"]},"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":["function"]},"optional":true,"description":"Optional. If present, called with an error object as the first argument and, if no error, the _id as the second.
","name":"callback"}],"longname":"Mongo.Collection#insert","options":[],"locus":"Anywhere"},"Collection#update":{"summary":"Modify one or more documents in the collection. Returns the number of affected documents.","kind":"function","memberof":"Mongo.Collection","params":[{"type":{"names":["MongoSelector"]},"description":"Specifies which documents to modify
","name":"selector"},{"type":{"names":["MongoModifier"]},"description":"Specifies how to modify the documents
","name":"modifier"},{"type":{"names":["Object"]},"optional":true,"name":"options"},{"type":{"names":["function"]},"optional":true,"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"}],"longname":"Mongo.Collection#update","options":[{"type":{"names":["Boolean"]},"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"}],"locus":"Anywhere"},"Collection#find":{"summary":"Find the documents in a collection that match the selector.","kind":"function","memberof":"Mongo.Collection","params":[{"type":{"names":["MongoSelector"]},"optional":true,"description":"A query describing the documents to find
","name":"selector"},{"type":{"names":["Object"]},"optional":true,"name":"options"}],"longname":"Mongo.Collection#find","options":[{"type":{"names":["MongoSortSpecifier"]},"description":"Sort order (default: natural order)
","name":"sort"},{"type":{"names":["Number"]},"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":["MongoFieldSpecifier"]},"description":"Dictionary of fields to return or exclude.
","name":"fields"},{"type":{"names":["Boolean"]},"description":"(Client only) Default true; pass false to disable reactivity
Overrides transform on the Collection for this cursor. Pass null to disable transformation.
A query describing the documents to find
","name":"selector"},{"type":{"names":["Object"]},"optional":true,"name":"options"}],"longname":"Mongo.Collection#findOne","options":[{"type":{"names":["MongoSortSpecifier"]},"description":"Sort order (default: natural order)
","name":"sort"},{"type":{"names":["Number"]},"description":"Number of results to skip at the beginning
","name":"skip"},{"type":{"names":["MongoFieldSpecifier"]},"description":"Dictionary of fields to return or exclude.
","name":"fields"},{"type":{"names":["Boolean"]},"description":"(Client only) Default true; pass false to disable reactivity
","name":"reactive"},{"type":{"names":["function"]},"description":"Overrides transform on the Collection for this cursor. Pass null to disable transformation.
Specifies which documents to remove
","name":"selector"},{"type":{"names":["function"]},"optional":true,"description":"Optional. If present, called with an error object as its argument.
","name":"callback"}],"longname":"Mongo.Collection#remove","options":[],"locus":"Anywhere"},"Collection#upsert":{"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).","params":[{"type":{"names":["MongoSelector"]},"description":"Specifies which documents to modify
","name":"selector"},{"type":{"names":["MongoModifier"]},"description":"Specifies how to modify the documents
","name":"modifier"},{"type":{"names":["Object"]},"optional":true,"name":"options"},{"type":{"names":["function"]},"optional":true,"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"}],"longname":"Mongo.Collection#upsert","kind":"function","memberof":"Mongo.Collection","options":[{"type":{"names":["Boolean"]},"description":"True to modify all matching documents; false to only modify one of the matching documents (the default).
","name":"multi"}],"locus":"Anywhere"},"Collection#allow":{"summary":"Allow users to write directly to this collection from client code, subject to limitations you define.","params":[{"type":{"names":["Object"]},"name":"options"}],"longname":"Mongo.Collection#allow","kind":"function","memberof":"Mongo.Collection","options":[{"type":{"names":["function"]},"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":["Array.Optional performance enhancement. Limits the fields that will be fetched from the database for inspection by your update and remove functions.
Overrides transform on the Collection. Pass null to disable transformation.
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":["Array.Optional performance enhancement. Limits the fields that will be fetched from the database for inspection by your update and remove functions.
Overrides transform on the Collection. Pass null to disable transformation.
The name of the collection. If null, creates an unmanaged (unsynchronized) local collection.
","name":"name"},{"type":{"names":["Object"]},"optional":true,"name":"options"}],"longname":"Mongo.Collection","memberof":"Mongo","options":[{"type":{"names":["Object"]},"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.
The method of generating the _id fields of new documents in this collection. Possible values:
'STRING': random strings'MONGO': random Mongo.ObjectID valuesThe default id generation technique is 'STRING'.
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.
Optional. The 24-character hexadecimal contents of the ObjectID to create
","name":"hexString"}],"longname":"Mongo.ObjectID","memberof":"Mongo","options":[],"locus":"Anywhere"},"Cursor":{"summary":"To create a cursor, use find. To access the documents in a cursor, use forEach, map, or fetch.","kind":"class","longname":"Mongo.Cursor","memberof":"Mongo","options":[],"params":[],"instancename":"cursor"}},"Assets":{"summary":"The namespace for Assets functions, lives in the bundler.","kind":"namespace","longname":"Assets","getText":{"summary":"Retrieve the contents of the static server asset as a UTF8-encoded string.","memberof":"Assets","params":[{"type":{"names":["String"]},"description":"The path of the asset, relative to the application's private subdirectory.
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"}],"longname":"Assets.getText","kind":"function","options":[],"locus":"Server"},"getBinary":{"summary":"Retrieve the contents of the static server asset as an [EJSON Binary](#ejson_new_binary).","memberof":"Assets","params":[{"type":{"names":["String"]},"description":"The path of the asset, relative to the application's private subdirectory.
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"}],"longname":"Assets.getBinary","kind":"function","options":[],"locus":"Server"}},"Package":{"summary":"The Package object in package.js","kind":"namespace","longname":"Package","locus":"package.js","describe":{"summary":"Provide basic package information.","memberof":"Package","params":[{"type":{"names":["Object"]},"name":"options"}],"longname":"Package.describe","kind":"function","options":[{"type":{"names":["String"]},"description":"A concise 1-2 sentence description of the package, required for publication.
","name":"summary"},{"type":{"names":["String"]},"description":"The semver version for your package. If no version is specified, defaults to 0.0.0. You need to specify a version to publish to the package server.
Optional name override. By default, the package name comes from the name of its directory.
","name":"name"},{"type":{"names":["String"]},"description":"Optional Git URL to the source repository.
","name":"git"}],"locus":"package.js"},"onUse":{"summary":"Define package dependencies and expose package methods.","memberof":"Package","params":[{"type":{"names":["function"]},"description":"A function that takes in the package control 'api' object, which keeps track of dependencies and exports.
","name":"func"}],"longname":"Package.onUse","kind":"function","options":[],"locus":"package.js"},"onTest":{"summary":"Define dependencies and expose package methods for unit tests.","memberof":"Package","params":[{"type":{"names":["function"]},"description":"A function that takes in the package control 'api' object, which keeps track of dependencies and exports.
","name":"func"}],"longname":"Package.onTest","kind":"function","options":[],"locus":"package.js"},"registerBuildPlugin":{"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.","params":[{"type":{"names":["Object"]},"optional":true,"name":"options"}],"memberof":"Package","longname":"Package.registerBuildPlugin","kind":"function","options":[{"type":{"names":["String"]},"description":"A cosmetic name, must be unique in the\npackage.
","name":"name"},{"type":{"names":["String","Array.Meteor packages that this\nplugin uses, independent of the packages specified in\napi.onUse.
","name":"use"},{"type":{"names":["Array.The source files that make up the\nbuild plugin, independent from api.addFiles.
","name":"sources"},{"type":{"names":["Object"]},"description":"An object where the keys\nare NPM package names, and the keys are the version numbers of\nrequired NPM packages, just like in Npm.depends.
","name":"npmDependencies"}],"locus":"package.js"}},"Npm":{"kind":"namespace","summary":"The Npm object in package.js and package source files.","longname":"Npm","depends":{"summary":"Specify which [NPM](https://www.npmjs.org/) packages\nyour Meteor package depends on.","params":[{"type":{"names":["Object"]},"description":"An object where the keys are package\nnames and the values are version numbers in string form.\nYou can only depend on exact versions of NPM packages. Example:
\nNpm.depends({moment: "2.8.3"});","name":"dependencies"}],"memberof":"Npm","longname":"Npm.depends","kind":"function","options":[],"locus":"package.js"},"require":{"summary":"Require a package that was specified using\n`Npm.depends()`.","params":[{"type":{"names":["String"]},"description":"The name of the package to require.
","name":"name"}],"memberof":"Npm","longname":"Npm.require","kind":"function","options":[],"locus":"Server"}},"Cordova":{"kind":"namespace","summary":"The Cordova object in package.js.","longname":"Cordova","depends":{"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 / PhoneGap](https://github.com/meteor/meteor/wiki/Meteor-Cordova-Phonegap-integration#meteor-packages-with-cordovaphonegap-dependencies)\npage of the Meteor wiki on GitHub.","params":[{"type":{"names":["Object"]},"description":"An object where the keys are plugin\nnames and the values are version numbers or GitHub tarball URLs\nin string form.\nExample:
\nCordova.depends({\n "org.apache.cordova.camera": "0.3.0"\n});Alternatively, with a GitHub URL:
\nCordova.depends({\n "org.apache.cordova.camera":\n "https://github.com/apache/cordova-plugin-camera/tarball/d84b875c"\n});","name":"dependencies"}],"memberof":"Cordova","longname":"Cordova.depends","kind":"function","options":[],"locus":"package.js"}},"Plugin":{"kind":"namespace","summary":"The namespace that is exposed inside build plugin files.","longname":"Plugin","registerSourceHandler":{"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.","params":[{"type":{"names":["String"]},"description":"The file extension that this plugin\nshould handle, without the first dot.\nExamples: "coffee", "coffee.md".
A function that takes one argument,\na CompileStep object.
\nDocumentation for CompileStep is available on the GitHub Wiki.
","name":"handler"}],"memberof":"Plugin","longname":"Plugin.registerSourceHandler","kind":"function","options":[],"locus":"Build Plugin"}},"currentUser":{"summary":"Calls [Meteor.user()](#meteor_user). Use `{{#if currentUser}}` to check whether the user is logged in.","longname":"currentUser","kind":"member","ishelper":"true"},"loggingIn":{"summary":"Calls [Meteor.loggingIn()](#meteor_loggingin).","longname":"loggingIn","kind":"member","ishelper":"true"},"Template#created":{"memberof":"Template","summary":"Provide a callback when an instance of a template is created.","longname":"Template#created","kind":"member","locus":"Client"},"Template#rendered":{"memberof":"Template","summary":"Provide a callback when an instance of a template is rendered.","longname":"Template#rendered","kind":"member","locus":"Client"},"Template#destroyed":{"memberof":"Template","summary":"Provide a callback when an instance of a template is destroyed.","longname":"Template#destroyed","kind":"member","locus":"Client"},"Blaze":{"TemplateInstance#data":{"memberof":"Blaze.TemplateInstance","summary":"The data context of this instance's latest invocation.","longname":"Blaze.TemplateInstance#data","kind":"member","locus":"Client"},"TemplateInstance#view":{"memberof":"Blaze.TemplateInstance","summary":"The [View](#blaze_view) object for this invocation of the template.","longname":"Blaze.TemplateInstance#view","kind":"member","locus":"Client"},"TemplateInstance#firstNode":{"memberof":"Blaze.TemplateInstance","summary":"The first top-level DOM node in this template instance.","longname":"Blaze.TemplateInstance#firstNode","kind":"member","locus":"Client"},"TemplateInstance#lastNode":{"memberof":"Blaze.TemplateInstance","summary":"The last top-level DOM node in this template instance.","longname":"Blaze.TemplateInstance#lastNode","kind":"member","locus":"Client"},"currentView":{"summary":"The View corresponding to the current template helper, event handler, callback, or autorun. If there isn't one, `null`.","longname":"Blaze.currentView","kind":"member","memberof":"Blaze","locus":"Client"},"With":{"summary":"Constructs a View that renders content with a data context.","params":[{"type":{"names":["Object","function"]},"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":["function"]},"description":"A Function that returns renderable content.
","name":"contentFunc"}],"longname":"Blaze.With","kind":"function","memberof":"Blaze","options":[],"locus":"Client"},"If":{"summary":"Constructs a View that renders content conditionally.","params":[{"type":{"names":["function"]},"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.
A Function that returns renderable content.
","name":"contentFunc"},{"type":{"names":["function"]},"optional":true,"description":"Optional. A Function that returns renderable content. If no elseFunc is supplied, no content is shown in the "else" case.
A function to reactively re-run. If the result is falsy, contentFunc is shown, otherwise elseFunc is shown. An empty array is considered falsy.
A Function that returns renderable content.
","name":"contentFunc"},{"type":{"names":["function"]},"optional":true,"description":"Optional. A Function that returns renderable content. If no elseFunc is supplied, no content is shown in the "else" case.
A function to reactively re-run. The function may return a Cursor, an array, null, or undefined.
","name":"argFunc"},{"type":{"names":["function"]},"description":"A Function that returns renderable content.
","name":"contentFunc"},{"type":{"names":["function"]},"optional":true,"description":"Optional. A Function that returns renderable content to display in the case when there are no items to display.
","name":"elseFunc"}],"longname":"Blaze.Each","kind":"function","memberof":"Blaze","options":[],"locus":"Client"},"isTemplate":{"summary":"Returns true if `value` is a template object like `Template.myTemplate`.","params":[{"type":{"names":["Any"]},"description":"The value to test.
","name":"value"}],"longname":"Blaze.isTemplate","kind":"function","memberof":"Blaze","options":[],"locus":"Client"},"TemplateInstance#$":{"summary":"Find all elements matching `selector` in this template instance, and return them as a JQuery object.","params":[{"type":{"names":["String"]},"description":"The CSS selector to match, scoped to the template contents.
","name":"selector"}],"longname":"Blaze.TemplateInstance#$","kind":"function","memberof":"Blaze.TemplateInstance","options":[],"locus":"Client"},"TemplateInstance#findAll":{"summary":"Find all elements matching `selector` in this template instance.","params":[{"type":{"names":["String"]},"description":"The CSS selector to match, scoped to the template contents.
","name":"selector"}],"longname":"Blaze.TemplateInstance#findAll","kind":"function","memberof":"Blaze.TemplateInstance","options":[],"locus":"Client"},"TemplateInstance#find":{"summary":"Find one element matching `selector` in this template instance.","params":[{"type":{"names":["String"]},"description":"The CSS selector to match, scoped to the template contents.
","name":"selector"}],"longname":"Blaze.TemplateInstance#find","kind":"function","memberof":"Blaze.TemplateInstance","options":[],"locus":"Client"},"TemplateInstance#autorun":{"summary":"A version of [Tracker.autorun](#tracker_autorun) that is stopped when the template is destroyed.","params":[{"type":{"names":["function"]},"description":"The function to run. It receives one argument: a Tracker.Computation object.
","name":"runFunc"}],"longname":"Blaze.TemplateInstance#autorun","kind":"function","memberof":"Blaze.TemplateInstance","options":[],"locus":"Client"},"render":{"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).","params":[{"type":{"names":["Template","Blaze.View"]},"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.
The node that will be the parent of the rendered template. It must be an Element node.
","name":"parentNode"},{"type":{"names":["DOMNode"]},"optional":true,"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"},{"type":{"names":["Blaze.View"]},"optional":true,"description":"Optional. If provided, it will be set as the rendered View's parentView.
The template (e.g. Template.myTemplate) or View object to render.
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":["DOMNode"]},"description":"The node that will be the parent of the rendered template. It must be an Element node.
","name":"parentNode"},{"type":{"names":["DOMNode"]},"optional":true,"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"},{"type":{"names":["Blaze.View"]},"optional":true,"description":"Optional. If provided, it will be set as the rendered View's parentView.
The return value from Blaze.render or Blaze.renderWithData.
The template (e.g. Template.myTemplate) or View object from which to generate HTML.
The template (e.g. Template.myTemplate) or View object from which to generate HTML.
The data context to use, or a function returning a data context.
","name":"data"}],"longname":"Blaze.toHTMLWithData","kind":"function","memberof":"Blaze","options":[],"locus":"Client"},"getData":{"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.","params":[{"type":{"names":["DOMElement","Blaze.View"]},"optional":true,"description":"Optional. An element that was rendered by a Meteor, or a View.
","name":"elementOrView"}],"longname":"Blaze.getData","kind":"function","memberof":"Blaze","options":[],"locus":"Client"},"getView":{"summary":"Gets either the current View, or the View enclosing the given DOM element.","params":[{"type":{"names":["DOMElement"]},"optional":true,"description":"Optional. If specified, the View enclosing element is returned.
Optional. A name for Views constructed by this Template. See view.name.
A function that returns renderable content. This function is used as the renderFunction for Views constructed by this Template.
Optional. A name for this type of View. See view.name.
A function that returns renderable content. In this function, this is bound to the View.
The number of levels beyond the current data context to look.
","name":"numLevels"}],"longname":"Template.parentData","memberof":"Template","options":[],"locus":"Client"},"registerHelper":{"summary":"Defines a [helper function](#template_helpers) which can be used from all templates.","kind":"function","params":[{"type":{"names":["String"]},"description":"The name of the helper function you are defining.
","name":"name"},{"type":{"names":["function"]},"description":"The helper function itself.
","name":"function"}],"longname":"Template.registerHelper","memberof":"Template","options":[],"locus":"Client"},"dynamic":{"memberof":"Template","kind":"function","summary":"Choose a template to include dynamically, by name.","params":[{"type":{"names":["String"]},"description":"The name of the template to include.
","name":"template"},{"type":{"names":["Object"]},"optional":true,"description":"Optional. The data context in which to include the template.
","name":"data"}],"longname":"Template.dynamic","options":[],"istemplate":"true","locus":"Templates"},"summary":"The class for defining templates","kind":"class","longname":"Template","options":[],"params":[],"instancename":"Template.myTemplate"},"Tracker":{"active":{"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.","longname":"Tracker.active","kind":"member","memberof":"Tracker","locus":"Client"},"currentComputation":{"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.","longname":"Tracker.currentComputation","kind":"member","memberof":"Tracker","locus":"Client"},"Computation#stopped":{"summary":"True if this computation has been stopped.","memberof":"Tracker.Computation","longname":"Tracker.Computation#stopped","kind":"member","locus":"Client"},"Computation#invalidated":{"summary":"True if this computation has been invalidated (and not yet rerun), or if it has been stopped.","memberof":"Tracker.Computation","longname":"Tracker.Computation#invalidated","kind":"member","locus":"Client"},"Computation#firstRun":{"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.","memberof":"Tracker.Computation","longname":"Tracker.Computation#firstRun","kind":"member","locus":"Client"},"Computation":{"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.","longname":"Tracker.Computation","kind":"function","memberof":"Tracker","options":[],"params":[],"instancename":"computation"},"Computation#onInvalidate":{"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.","params":[{"type":{"names":["function"]},"description":"Function to be called on invalidation. Receives one argument, the computation that was invalidated.
","name":"callback"}],"longname":"Tracker.Computation#onInvalidate","kind":"function","memberof":"Tracker.Computation","options":[],"locus":"Client"},"Computation#invalidate":{"summary":"Invalidates this computation so that it will be rerun.","longname":"Tracker.Computation#invalidate","kind":"function","memberof":"Tracker.Computation","options":[],"params":[],"locus":"Client"},"Computation#stop":{"summary":"Prevents this computation from rerunning.","longname":"Tracker.Computation#stop","kind":"function","memberof":"Tracker.Computation","options":[],"params":[],"locus":"Client"},"Dependency#depend":{"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.","params":[{"type":{"names":["Tracker.Computation"]},"optional":true,"description":"An optional computation declared to depend on dependency instead of the current computation.
The function to run. It receives one argument: the Computation object that will be returned.
","name":"runFunc"}],"longname":"Tracker.autorun","kind":"function","memberof":"Tracker","options":[],"locus":"Client"},"nonreactive":{"summary":"Run a function without tracking dependencies.","params":[{"type":{"names":["function"]},"description":"A function to call immediately.
","name":"func"}],"longname":"Tracker.nonreactive","kind":"function","memberof":"Tracker","options":[],"locus":"Client"},"onInvalidate":{"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.","params":[{"type":{"names":["function"]},"description":"A callback function that will be invoked as func(c), where c is the computation on which the callback is registered.
A function to call at flush time.
","name":"callback"}],"longname":"Tracker.afterFlush","kind":"function","memberof":"Tracker","options":[],"locus":"Client"},"Dependency":{"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.","kind":"class","longname":"Tracker.Dependency","memberof":"Tracker","options":[],"params":[],"instancename":"dependency"}},"CompileStep#inputSize":{"summary":"The total number of bytes in the input file.","memberof":"CompileStep","type":{"names":["Integer"]},"longname":"CompileStep#inputSize","kind":"member"},"CompileStep#inputPath":{"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"]},"memberof":"CompileStep","longname":"CompileStep#inputPath","kind":"member"},"CompileStep#fullInputPath":{"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"]},"memberof":"CompileStep","longname":"CompileStep#fullInputPath","kind":"member"},"CompileStep#pathForSourceMap":{"summary":"If you are generating a sourcemap for the compiled file, use\nthis path for the original file in the sourcemap.","type":{"names":["String"]},"memberof":"CompileStep","longname":"CompileStep#pathForSourceMap","kind":"member"},"CompileStep#packageName":{"summary":"The name of the package in which the file being built exists.","type":{"names":["String"]},"memberof":"CompileStep","longname":"CompileStep#packageName","kind":"member"},"CompileStep#rootOutputPath":{"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"]},"memberof":"CompileStep","longname":"CompileStep#rootOutputPath","kind":"member"},"CompileStep#arch":{"summary":"The architecture for which we are building. Can be \"os\",\n\"web.browser\", or \"web.cordova\".","type":{"names":["String"]},"memberof":"CompileStep","longname":"CompileStep#arch","kind":"member"},"CompileStep#fileOptions":{"summary":"Any options passed to \"api.addFiles\".","type":{"names":["Object"]},"memberof":"CompileStep","longname":"CompileStep#fileOptions","kind":"member"},"CompileStep#declaredExports":{"summary":"The list of exports that the current package has defined.\nCan be used to treat those symbols differently during compilation.","type":{"names":["Object"]},"memberof":"CompileStep","longname":"CompileStep#declaredExports","kind":"member"},"Template#helpers":{"summary":"Specify template helpers available to this template.","params":[{"type":{"names":["Object"]},"description":"Dictionary of helper functions by name.
","name":"helpers"}],"longname":"Template#helpers","kind":"function","memberof":"Template","options":[],"locus":"Client"},"Template#events":{"summary":"Specify event handlers for this template.","params":[{"type":{"names":["EventMap"]},"description":"Event handlers to associate with this template.
","name":"eventMap"}],"longname":"Template#events","kind":"function","memberof":"Template","options":[],"locus":"Client"},"check":{"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.","params":[{"type":{"names":["Any"]},"description":"The value to check
","name":"value"},{"type":{"names":["MatchPattern"]},"description":"The pattern to match\nvalue against
The value to check
","name":"value"},{"type":{"names":["MatchPattern"]},"description":"The pattern to match value against
The value that should be returned by userId on this connection.
The URL of another Meteor application.
","name":"url"}],"longname":"DDP.connect","kind":"function","memberof":"DDP","options":[],"locus":"Anywhere"}},"Subscription#error":{"summary":"Call inside the publish function. Stops this client's subscription, triggering a call on the client to the `onError` callback passed to [`Meteor.subscribe`](#meteor_subscribe), if any. If `error` is not a [`Meteor.Error`](#meteor_error), it will be [sanitized](#meteor_error).","params":[{"type":{"names":["Error"]},"description":"The error to pass to the client.
","name":"error"}],"memberof":"Subscription","longname":"Subscription#error","kind":"function","options":[],"locus":"Server"},"Subscription#stop":{"summary":"Call inside the publish function. Stops this client's subscription; the `onError` callback is *not* invoked on the client.","memberof":"Subscription","longname":"Subscription#stop","kind":"function","options":[],"params":[],"locus":"Server"},"Subscription#onStop":{"summary":"Call inside the publish function. Registers a callback function to run when the subscription is stopped.","memberof":"Subscription","params":[{"type":{"names":["function"]},"description":"The callback function
","name":"func"}],"longname":"Subscription#onStop","kind":"function","options":[],"locus":"Server"},"Subscription#added":{"summary":"Call inside the publish function. Informs the subscriber that a document has been added to the record set.","memberof":"Subscription","params":[{"type":{"names":["String"]},"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":["Object"]},"description":"The fields in the new document. If _id is present it is ignored.
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":["Object"]},"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.
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"}],"longname":"Subscription#removed","kind":"function","options":[],"locus":"Server"},"Subscription#ready":{"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.","memberof":"Subscription","longname":"Subscription#ready","kind":"function","options":[],"params":[],"locus":"Server"},"Email":{"send":{"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.","params":[{"type":{"names":["Object"]},"name":"options"}],"longname":"Email.send","kind":"function","memberof":"Email","options":[{"type":{"names":["String"]},"description":""From:" address (required)
","name":"from"},{"type":{"names":["String","Array."To:", "Cc:", "Bcc:", and "Reply-To:" addresses
","name":"to, cc, bcc, replyTo"},{"type":{"names":["String"]},"optional":true,"description":""Subject:" line
","name":"subject"},{"type":{"names":["String"]},"optional":true,"description":"Mail body (in plain text or HTML)
","name":"text, html"},{"type":{"names":["Object"]},"optional":true,"description":"Dictionary of custom headers
","name":"headers"}],"locus":"Server"}},"HTTP":{"call":{"summary":"Perform an outbound HTTP request.","params":[{"type":{"names":["String"]},"description":"The HTTP method to use, such as "GET", "POST", or "HEAD".
The URL to retrieve.
","name":"url"},{"type":{"names":["Object"]},"optional":true,"name":"options"},{"type":{"names":["function"]},"optional":true,"description":"Optional callback. If passed, the method runs asynchronously, instead of synchronously, and calls asyncCallback. On the client, this callback is required.
","name":"asyncCallback"}],"longname":"HTTP.call","kind":"function","memberof":"HTTP","options":[{"type":{"names":["String"]},"description":"String to use as the HTTP request body.
","name":"content"},{"type":{"names":["Object"]},"description":"JSON-able object to stringify and use as the HTTP request body. Overwrites content.
Query string to go in the URL. Overwrites any query string in url.
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.
HTTP basic authentication string of the form "username:password"
Dictionary of strings, headers to add to the HTTP request.
","name":"headers"},{"type":{"names":["Number"]},"description":"Maximum time in milliseconds to wait for the request before failing. There is no timeout by default.
","name":"timeout"},{"type":{"names":["Boolean"]},"description":"If true, transparently follow HTTP redirects. Cannot be set to false on the client. Default true.
The URL to which the request should be sent.
","name":"url"},{"type":{"names":["Object"]},"optional":true,"description":"Options passed on to HTTP.call.
Callback that is called when the request is completed. Required on the client.
","name":"asyncCallback"}],"longname":"HTTP.get","kind":"function","memberof":"HTTP","options":[],"locus":"Anywhere"},"post":{"summary":"Send an HTTP `POST` request. Equivalent to calling [`HTTP.call`](#http_call) with \"POST\" as the first argument.","params":[{"type":{"names":["String"]},"description":"The URL to which the request should be sent.
","name":"url"},{"type":{"names":["Object"]},"optional":true,"description":"Options passed on to HTTP.call.
Callback that is called when the request is completed. Required on the client.
","name":"asyncCallback"}],"longname":"HTTP.post","kind":"function","memberof":"HTTP","options":[],"locus":"Anywhere"},"put":{"summary":"Send an HTTP `PUT` request. Equivalent to calling [`HTTP.call`](#http_call) with \"PUT\" as the first argument.","params":[{"type":{"names":["String"]},"description":"The URL to which the request should be sent.
","name":"url"},{"type":{"names":["Object"]},"optional":true,"description":"Options passed on to HTTP.call.
Callback that is called when the request is completed. Required on the client.
","name":"asyncCallback"}],"longname":"HTTP.put","kind":"function","memberof":"HTTP","options":[],"locus":"Anywhere"},"del":{"summary":"Send an HTTP `DELETE` request. Equivalent to calling [`HTTP.call`](#http_call) with \"DELETE\" as the first argument. (Named `del` to avoid conflic with the Javascript keyword `delete`)","params":[{"type":{"names":["String"]},"description":"The URL to which the request should be sent.
","name":"url"},{"type":{"names":["Object"]},"optional":true,"description":"Options passed on to HTTP.call.
Callback that is called when the request is completed. Required on the client.
","name":"asyncCallback"}],"longname":"HTTP.del","kind":"function","memberof":"HTTP","options":[],"locus":"Anywhere"}},"ReactiveVar#get":{"summary":"Returns the current value of the ReactiveVar, establishing a reactive dependency.","longname":"ReactiveVar#get","kind":"function","memberof":"ReactiveVar","options":[],"params":[],"locus":"Client"},"ReactiveVar#set":{"summary":"Sets the current value of the ReactiveVar, invalidating the Computations that called `get` if `newValue` is different from the old value.","params":[{"type":{"names":["Any"]},"name":"newValue"}],"longname":"ReactiveVar#set","kind":"function","memberof":"ReactiveVar","options":[],"locus":"Client"},"Session":{"set":{"memberof":"Session","kind":"function","summary":"Set a variable in the session. Notify any listeners that the value has changed (eg: redraw templates, and rerun any [`Tracker.autorun`](#tracker_autorun) computations, that called [`Session.get`](#session_get) on this `key`.)","params":[{"type":{"names":["String"]},"description":"The key to set, eg, selectedItem
The new value for key
The key to set, eg, selectedItem
The new value for key
The name of the session variable to return
","name":"key"}],"longname":"Session.get","options":[],"locus":"Client"},"equals":{"memberof":"Session","kind":"function","summary":"Test if a session variable is equal to a value. If inside a [reactive computation](#reactivity), invalidate the computation the next time the variable changes to or from the value.","params":[{"type":{"names":["String"]},"description":"The name of the session variable to test
","name":"key"},{"type":{"names":["String","Number","Boolean","null","undefined"]},"description":"The value to test against
","name":"value"}],"longname":"Session.equals","options":[],"locus":"Client"}},"CompileStep#read":{"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...","params":[{"type":{"names":["Integer"]},"optional":true,"description":"The number of bytes to return.
","name":"n"}],"memberof":"CompileStep","longname":"CompileStep#read","kind":"function","options":[]},"CompileStep#addHtml":{"summary":"Works in web targets only. Add markup to the `head` or `body`\nsection of the document.","params":[{"type":{"names":["Object"]},"name":"options"}],"memberof":"CompileStep","longname":"CompileStep#addHtml","kind":"function","options":[{"type":{"names":["String"]},"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"}]},"CompileStep#addStylesheet":{"summary":"Web targets only. Add a stylesheet to the document.","params":[{"type":{"names":["Object"]},"name":"options"},{"type":{"names":["String"]},"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"}],"memberof":"CompileStep","longname":"CompileStep#addStylesheet","kind":"function","options":[]},"CompileStep#addJavaScript":{"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.","params":[{"type":{"names":["Object"]},"name":"options"}],"memberof":"CompileStep","longname":"CompileStep#addJavaScript","kind":"function","options":[{"type":{"names":["String"]},"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.
The path at which to serve the asset.
","name":"path"},{"type":{"names":["Buffer","String"]},"description":"The data that should be placed in\nthe file.
","name":"data"}],"memberof":"CompileStep","longname":"CompileStep#addAsset","kind":"function","options":[]},"CompileStep#error":{"summary":"Display a build error.","params":[{"type":{"names":["Object"]},"name":"options"},{"type":{"names":["String"]},"description":"The error message to display.
","name":"message"},{"type":{"names":["String"]},"optional":true,"description":"The path to display in the error message.
","name":"sourcePath"},{"type":{"names":["Integer"]},"description":"The line number to display in the error message.
","name":"line"},{"type":{"names":["String"]},"description":"The function name to display in the error message.
","name":"func"}],"memberof":"CompileStep","longname":"CompileStep#error","kind":"function","options":[]},"PackageAPI#use":{"memberof":"PackageAPI","summary":"Depend on package `packagename`.","params":[{"type":{"names":["String","Array.Packages being depended on.\nPackage names may be suffixed with an @version tag.
\nIn 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.
If you only use the package on the\nserver (or the client), you can pass in the second argument (e.g.,\n'server' or 'client') to specify what architecture the package is\nused with.
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.
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 of a package, or array of package names, with an optional @version component for each.
","name":"packageSpecs"}],"longname":"PackageAPI#imply","kind":"function","options":[],"locus":"package.js"},"PackageAPI#addFiles":{"memberof":"PackageAPI","summary":"Specify the source code for your package.","params":[{"type":{"names":["String","Array.Name of the source file, or array of strings of source file names.
","name":"filename"},{"type":{"names":["String"]},"optional":true,"description":"If you only want to export the file on the server (or the client), you can pass in the second argument (e.g., 'server' or 'client') to specify what architecture the file is used with.
","name":"architecture"}],"longname":"PackageAPI#addFiles","kind":"function","options":[],"locus":"package.js"},"PackageAPI#versionsFrom":{"memberof":"PackageAPI","summary":"Use versions of core packages from a release. Unless provided, all packages will default to the versions released along with `meteorversion`. This will save you from having to figure out the exact versions of the core packages you want to use. For example, if the newest release of meteor is METEOR@0.9.0 and it uses jquery@1.0.0, you can use `api.versionsFrom('METEOR@0.9.0')`. If your package uses jQuery, it will automatically depend on jQuery 1.0.0 when it is published.","params":[{"type":{"names":["String"]},"description":"Specification of a release: track@version. Just 'version' (ex: "0.9.0") is sufficient if using the default release track
Name of the object.
","name":"exportedObject"},{"type":{"names":["String"]},"optional":true,"description":"If you only want to export the object on the server (or the client), you can pass in the second argument (e.g., 'server' or 'client') to specify what architecture the export is used with.
","name":"architecture"}],"longname":"PackageAPI#export","kind":"function","options":[],"locus":"package.js"},"Subscription":{"summary":"The server's side of a subscription","kind":"class","longname":"Subscription","options":[],"params":[],"instancename":"this"},"ReactiveVar":{"kind":"class","summary":"Constructor for a ReactiveVar, which represents a single reactive variable.","params":[{"type":{"names":["Any"]},"description":"The initial value to set. equalsFunc is ignored when setting the initial value.
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.
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","summary":"The object passed into Plugin.registerSourceHandler","longname":"CompileStep","options":[],"params":[]},"PackageAPI":{"kind":"class","summary":"The API object passed into the Packages.onUse function.","longname":"PackageAPI","options":[],"params":[],"instancename":"api"}}; \ No newline at end of file diff --git a/docs/client/docs.js b/docs/client/docs.js index 782e46c6b0..797a5d3e88 100644 --- a/docs/client/docs.js +++ b/docs/client/docs.js @@ -392,7 +392,10 @@ var toc = [ {name: "Package.onTest", id: "packagetests"}, {name: "Npm.depends", id: "Npm-depends"}, {name: "Npm.require", id: "Npm-require"}, - {name: "Cordova.depends", id: "Cordova-depends"} + {name: "Cordova.depends", id: "Cordova-depends"}, + {name: "Package.registerBuildPlugin", id: "Package-registerBuildPlugin"}, [ + {name: "Plugin.registerSourceHandler", id: "Plugin-registerSourceHandler"} + ] ] ], diff --git a/docs/client/names.json b/docs/client/names.json index 7e3de3cda7..3dc6241f8a 100644 --- a/docs/client/names.json +++ b/docs/client/names.json @@ -48,6 +48,22 @@ "Blaze.renderWithData", "Blaze.toHTML", "Blaze.toHTMLWithData", + "CompileStep", + "CompileStep#addAsset", + "CompileStep#addHtml", + "CompileStep#addJavaScript", + "CompileStep#addStylesheet", + "CompileStep#arch", + "CompileStep#declaredExports", + "CompileStep#error", + "CompileStep#fileOptions", + "CompileStep#fullInputPath", + "CompileStep#inputPath", + "CompileStep#inputSize", + "CompileStep#packageName", + "CompileStep#pathForSourceMap", + "CompileStep#read", + "CompileStep#rootOutputPath", "Cordova", "Cordova.depends", "DDP.connect", @@ -135,12 +151,15 @@ "Package.describe", "Package.onTest", "Package.onUse", + "Package.registerBuildPlugin", "PackageAPI", "PackageAPI#addFiles", "PackageAPI#export", "PackageAPI#imply", "PackageAPI#use", "PackageAPI#versionsFrom", + "Plugin", + "Plugin.registerSourceHandler", "ReactiveVar", "ReactiveVar#get", "ReactiveVar#set", diff --git a/meteor b/meteor index c4edf115f4..76874b08fb 100755 --- a/meteor +++ b/meteor @@ -1,6 +1,6 @@ #!/bin/bash -BUNDLE_VERSION=0.3.55 +BUNDLE_VERSION=0.3.55 # XXX: 0.3.56 is used on the cordova-0.9.4 branch # OS Check. Put here because here is where we download the precompiled # bundles that are arch specific. diff --git a/packages/blaze/lookup.js b/packages/blaze/lookup.js index 2d0ffc0a88..1032d5a691 100644 --- a/packages/blaze/lookup.js +++ b/packages/blaze/lookup.js @@ -64,7 +64,7 @@ Blaze.View.prototype.lookup = function (name, _options) { } else if (lookupTemplate && (name in Blaze.Template) && (Blaze.Template[name] instanceof Blaze.Template)) { return Blaze.Template[name]; - } else if (Blaze._globalHelpers[name]) { + } else if (Blaze._globalHelpers[name] != null) { return wrapHelper(bindDataContext(Blaze._globalHelpers[name])); } else { return function () { diff --git a/packages/meteor/helpers.js b/packages/meteor/helpers.js index ae620ab9bf..f172ec13f0 100644 --- a/packages/meteor/helpers.js +++ b/packages/meteor/helpers.js @@ -147,7 +147,7 @@ _.extend(Meteor, { var warnedAboutWrapAsync = false; /** - * @deprecated in 1.0.0 + * @deprecated in 0.9.3 */ Meteor._wrapAsync = function(fn, context) { if (! warnedAboutWrapAsync) { diff --git a/packages/minifiers/minifiers.js b/packages/minifiers/minifiers.js index 8e3df8f70b..37aa40d85b 100644 --- a/packages/minifiers/minifiers.js +++ b/packages/minifiers/minifiers.js @@ -1,9 +1,9 @@ -UglifyJSMinify = Npm.require('uglify-js').minify; - var cssParse = Npm.require('css-parse'); var cssStringify = Npm.require('css-stringify'); var path = Npm.require('path'); var url = Npm.require('url'); +UglifyJS = Npm.require('uglify-js'); +UglifyJSMinify = UglifyJS.minify; CssTools = { parseCss: cssParse, diff --git a/packages/minifiers/package.js b/packages/minifiers/package.js index 894e57c6a2..276aaf620d 100644 --- a/packages/minifiers/package.js +++ b/packages/minifiers/package.js @@ -11,7 +11,7 @@ Npm.depends({ Package.on_use(function (api) { api.use('underscore', 'server'); - api.export(['CssTools', 'UglifyJSMinify']); + api.export(['CssTools', 'UglifyJSMinify', 'UglifyJS']); api.add_files(['minification.js', 'minifiers.js'], 'server'); }); diff --git a/packages/spacebars-tests/old_templates_tests.js b/packages/spacebars-tests/old_templates_tests.js index c6ecd90225..72044edb66 100644 --- a/packages/spacebars-tests/old_templates_tests.js +++ b/packages/spacebars-tests/old_templates_tests.js @@ -1610,28 +1610,28 @@ var runOneTwoTest = function (test, subTemplateName, optionsData) { }; Tinytest.add('spacebars-tests - old - template_tests - with stops without re-running helper', function (test) { - runOneTwoTest(test, 'spacebars_test_helpers_stop_with'); + runOneTwoTest(test, 'old_spacebars_test_helpers_stop_with'); }); Tinytest.add('spacebars-tests - old - template_tests - each stops without re-running helper', function (test) { - runOneTwoTest(test, 'spacebars_test_helpers_stop_each'); + runOneTwoTest(test, 'old_spacebars_test_helpers_stop_each'); }); Tinytest.add('spacebars-tests - old - template_tests - each inside with stops without re-running helper', function (test) { - runOneTwoTest(test, 'spacebars_test_helpers_stop_with_each'); + runOneTwoTest(test, 'old_spacebars_test_helpers_stop_with_each'); }); Tinytest.add('spacebars-tests - old - template_tests - if stops without re-running helper', function (test) { - runOneTwoTest(test, 'spacebars_test_helpers_stop_if', ['a', 'b', 'a']); + runOneTwoTest(test, 'old_spacebars_test_helpers_stop_if', ['a', 'b', 'a']); }); Tinytest.add('spacebars-tests - old - template_tests - unless stops without re-running helper', function (test) { - runOneTwoTest(test, 'spacebars_test_helpers_stop_unless', ['a', 'b', 'a']); + runOneTwoTest(test, 'old_spacebars_test_helpers_stop_unless', ['a', 'b', 'a']); }); Tinytest.add('spacebars-tests - old - template_tests - inclusion stops without re-running function', function (test) { var t = Template.old_spacebars_test_helpers_stop_inclusion3; - runOneTwoTest(test, 'spacebars_test_helpers_stop_inclusion', [t, t, t]); + runOneTwoTest(test, 'old_spacebars_test_helpers_stop_inclusion', [t, t, t]); }); Tinytest.add('spacebars-tests - old - template_tests - template with callbacks inside with stops without recalculating data', function (test) { @@ -1639,7 +1639,7 @@ Tinytest.add('spacebars-tests - old - template_tests - template with callbacks i tmpl.created = function () {}; tmpl.rendered = function () {}; tmpl.destroyed = function () {}; - runOneTwoTest(test, 'spacebars_test_helpers_stop_with_callbacks'); + runOneTwoTest(test, 'old_spacebars_test_helpers_stop_with_callbacks'); }); Tinytest.add('spacebars-tests - old - template_tests - no data context is seen as an empty object', function (test) { diff --git a/packages/spacebars-tests/template_tests.html b/packages/spacebars-tests/template_tests.html index 0295b86ddb..c3faed9d51 100644 --- a/packages/spacebars-tests/template_tests.html +++ b/packages/spacebars-tests/template_tests.html @@ -992,3 +992,7 @@ Hi there! {{/with}} {{/with}} + + + foo:{{foo}} GLOBAL_ZERO:{{GLOBAL_ZERO}} + diff --git a/packages/spacebars-tests/template_tests.js b/packages/spacebars-tests/template_tests.js index 609c15fe67..1b0fc75974 100644 --- a/packages/spacebars-tests/template_tests.js +++ b/packages/spacebars-tests/template_tests.js @@ -669,7 +669,6 @@ Tinytest.add("spacebars-tests - template_tests - select tags", function (test) { options.update({}, {$set: {selected: false}}, {multi: true}); Tracker.flush(); options.update({}, {$set: {selected: true}}, {multi: true}); - window.avital = true; Tracker.flush(); test.equal($(selectEl).find('option')[0].selected, true); test.equal($(selectEl).find('option')[1].selected, true); @@ -2903,3 +2902,12 @@ Tinytest.add("spacebars-tests - template_tests - content context back-compat", f Tracker.flush(); test.equal(canonicalizeHtml(div.innerHTML), 'FA'); }); + +Tinytest.add("spacebars-tests - template_tests - falsy helper", function (test) { + var tmpl = Template.spacebars_template_test_falsy_helper; + tmpl.foo = 0; + Template.registerHelper('GLOBAL_ZERO', 0); + + var div = renderToDiv(tmpl); + test.equal(canonicalizeHtml(div.innerHTML), 'foo:0 GLOBAL_ZERO:0'); +}); diff --git a/tools/buildmessage.js b/tools/buildmessage.js index a3312126eb..f84a2eaba0 100644 --- a/tools/buildmessage.js +++ b/tools/buildmessage.js @@ -191,6 +191,9 @@ var getCurrentProgressTracker = function () { return progress ? progress : rootProgress; }; +var nudge = function () { + getCurrentProgressTracker().nudge(); +}; var addChildTracker = function (title) { var options = {}; @@ -299,10 +302,20 @@ var enterJob = function (options, f) { return currentProgress.withValue(progress, function () { if (!currentMessageSet.get()) { + var nestingLevel = currentNestingLevel.get(); + var start; + if (debugBuild) { + start = Date.now(); + console.log("START", nestingLevel, options.title); + } try { return f(); } finally { progress.reportProgressDone(); + if (debugBuild) { + var end = Date.now(); + console.log("DONE", nestingLevel, options.title, "took " + (end - start)); + } } } @@ -549,5 +562,6 @@ _.extend(exports, { reportProgress: reportProgress, reportProgressDone: reportProgressDone, getCurrentProgressTracker: getCurrentProgressTracker, - addChildTracker: addChildTracker + addChildTracker: addChildTracker, + nudge: nudge }); diff --git a/tools/bundler.js b/tools/bundler.js index ef1da24b0d..fd5337a59f 100644 --- a/tools/bundler.js +++ b/tools/bundler.js @@ -236,6 +236,8 @@ var File = function (options) { // disk). self.sourcePath = options.sourcePath; + self.info = options.info || '?'; + // If this file was generated, a sourceMap (as a string) with debugging // information, as well as the "root" that paths in it should be resolved // against. Set with setSourceMap. @@ -270,6 +272,11 @@ var File = function (options) { }; _.extend(File.prototype, { + toString: function() { + var self = this; + return "File: [info=" + self.info + "]"; + }, + hash: function () { var self = this; if (! self._hash) @@ -430,6 +437,15 @@ var Target = function (options) { // A mapping from Cordova plugin name to Cordova plugin version number. self.cordovaDependencies = {}; + + // For the todos sample app: + // false: 99.6 KB / 316 KB + // vs + // true: 99 KB / 315 KB + + // METEOR_MINIFY_LEGACY is an undocumented safety-valve environment variable, + // in case people hit trouble + self._minifyTogether = !!process.env.METEOR_MINIFY_LEGACY; }; _.extend(Target.prototype, { @@ -625,6 +641,7 @@ _.extend(Target.prototype, { return; var f = new File({ + info: 'unbuild ' + resource, data: resource.data, cacheable: false, hash: resource.hash @@ -659,7 +676,7 @@ _.extend(Target.prototype, { // meteor.js? return; - var f = new File({data: resource.data, cacheable: false}); + var f = new File({ info: 'resource ' + resource.servePath, data: resource.data, cacheable: false}); var relPath = stripLeadingSlash(resource.servePath); f.setTargetPathFromRelPath(relPath); @@ -726,16 +743,32 @@ _.extend(Target.prototype, { minifyJs: function (minifiers) { var self = this; - var allJs = _.map(self.js, function (file) { - return file.contents('utf8'); - }).join('\n;\n'); + var allJs; - allJs = minifiers.UglifyJSMinify(allJs, { + var minifyOptions = { fromString: true, - compress: {drop_debugger: false} - }).code; + compress: {drop_debugger: false } + }; - self.js = [new File({ data: new Buffer(allJs, 'utf8') })]; + if (self._minifyTogether) { + var sources = _.map(self.js, function (file) { + return file.contents('utf8'); + }); + + buildmessage.enterJob({title: "Minifying"}, function () { + allJs = _minify(minifiers.UglifyJS, '', sources, minifyOptions).code; + }); + } else { + minifyOptions.compress.unused = false; + minifyOptions.compress.dead_code = false; + + allJs = buildmessage.forkJoin({title: "Minifying" }, self.js, function (file) { + var source = file.contents('utf8'); + return _minify(minifiers.UglifyJS, file.info, source, minifyOptions).code; + }).join("\n\n"); + } + + self.js = [new File({ info: 'minified js', data: new Buffer(allJs, 'utf8') })]; self.js[0].setUrlToHash(".js"); }, @@ -771,6 +804,127 @@ _.extend(Target.prototype, { } }); +// This code should mirror the minify function in UglifyJs2, +_minify = function(UglifyJS, key, files, options) { + options = UglifyJS.defaults(options, { + spidermonkey : false, + outSourceMap : null, + sourceRoot : null, + inSourceMap : null, + fromString : false, + warnings : false, + mangle : {}, + output : null, + compress : {} + }); + UglifyJS.base54.reset(); + + var totalFileSize = 0; + _.forEach(files, function (file) { + totalFileSize += file.length; + }); + + var phases = 2; + if (options.compress) phases++; + if (options.mangle) phases++; + if (options.output) phases++; + + var progress = {current: 0, end: totalFileSize * phases, done: false}; + var progressTracker = buildmessage.getCurrentProgressTracker(); + + // 1. parse + var toplevel = null, + sourcesContent = {}; + + if (options.spidermonkey) { + toplevel = UglifyJS.AST_Node.from_mozilla_ast(files); + } else { + if (typeof files == "string") + files = [ files ]; + buildmessage.forkJoin({title: 'Minifying: parsing ' + key}, files, function (file) { + var code = options.fromString + ? file + : fs.readFileSync(file, "utf8"); + sourcesContent[file] = code; + toplevel = UglifyJS.parse(code, { + filename: options.fromString ? "?" : file, + toplevel: toplevel + }); + + progress.current += code.length; + progressTracker.reportProgress(progress); + }); + } + + // 2. compress + var compress; + if (options.compress) buildmessage.enterJob({title: "Minify: compress 1 " + key}, function () { + compress = { warnings: options.warnings }; + UglifyJS.merge(compress, options.compress); + toplevel.figure_out_scope(); + }); + if (options.compress) buildmessage.enterJob({title: "Minify: compress 2 " + key}, function () { + var sq = UglifyJS.Compressor(compress); + toplevel = toplevel.transform(sq); + + progress.current += totalFileSize; + progressTracker.reportProgress(progress); + }); + + // 3. mangle + if (options.mangle) buildmessage.enterJob({title: "Minify: mangling " + key}, function () { + toplevel.figure_out_scope(); + toplevel.compute_char_frequency(); + toplevel.mangle_names(options.mangle); + + progress.current += totalFileSize; + progressTracker.reportProgress(progress); + }); + + // 4. output + var inMap = options.inSourceMap; + var output = {}; + if (typeof options.inSourceMap == "string") { + inMap = fs.readFileSync(options.inSourceMap, "utf8"); + } + if (options.outSourceMap) { + output.source_map = UglifyJS.SourceMap({ + file: options.outSourceMap, + orig: inMap, + root: options.sourceRoot + }); + if (options.sourceMapIncludeSources) { + for (var file in sourcesContent) { + if (sourcesContent.hasOwnProperty(file)) { + options.source_map.get().setSourceContent(file, sourcesContent[file]); + } + } + } + } + if (options.output) buildmessage.enterJob({title: "Minify: merging " + key}, function () { + UglifyJS.merge(output, options.output); + + progress.current += totalFileSize; + progressTracker.reportProgress(progress); + }); + + + var stream; + buildmessage.enterJob({title: "Minify: printing " + key}, function () { + stream = UglifyJS.OutputStream(output); + toplevel.print(stream); + + progress.current += totalFileSize; + progressTracker.reportProgress(progress); + }); + + return { + code : stream + "", + map : output.source_map + "" + }; +}; + + //////////////////// ClientTarget //////////////////// @@ -842,7 +996,7 @@ _.extend(ClientTarget.prototype, { if (! stringifiedCss.code) return; - self.css = [new File({ data: new Buffer(stringifiedCss.code, 'utf8') })]; + self.css = [new File({ info: 'combined css', data: new Buffer(stringifiedCss.code, 'utf8') })]; // Add the contents of the input files to the source map of the new file stringifiedCss.map.sourcesContent = @@ -890,7 +1044,7 @@ _.extend(ClientTarget.prototype, { minifiedCss = minifiers.CssTools.minifyCss(allCss); } if (!! minifiedCss) { - self.css = [new File({ data: new Buffer(minifiedCss, 'utf8') })]; + self.css = [new File({ info: 'minified css', data: new Buffer(minifiedCss, 'utf8') })]; self.css[0].setUrlToHash(".css", "?meteor_css_resource=true"); } }, diff --git a/tools/catalog.js b/tools/catalog.js index eb558a11cd..ade20b5f52 100644 --- a/tools/catalog.js +++ b/tools/catalog.js @@ -528,19 +528,13 @@ _.extend(CompleteCatalog.prototype, { constr.push(utils.parseConstraint(name + "@=" + packageSource.version)); }); - var patience = new utils.Patience({ - messageAfterMs: 1000, - message: "Figuring out the best package versions to use. This may take a moment." - }); - - var ret; - try { + var ret = buildmessage.enterJob({ title: "Figuring out the best package versions to use." }, function () { // Then, call the constraint solver, to get the valid transitive subset of // those versions to record for our solution. (We don't just return the // original version lock because we want to record the correct transitive // dependencies) try { - ret = self.resolver.resolve(deps, constr, resolverOpts); + return self.resolver.resolve(deps, constr, resolverOpts); } catch (e) { // Maybe we only failed because we need to refresh. Try to refresh // (unless we already are) and retry. @@ -550,11 +544,10 @@ _.extend(CompleteCatalog.prototype, { } catalog.official.refresh(); self.resolver || self._initializeResolver(); - ret = self.resolver.resolve(deps, constr, resolverOpts); + return self.resolver.resolve(deps, constr, resolverOpts); } - } finally { - patience.stop(); - } + }); + if (ret["usedRCs"]) { var expPackages = []; _.each(ret.answer, function(version, package) { @@ -692,6 +685,7 @@ _.extend(CompleteCatalog.prototype, { // This may be a singleton, but the resolver is in a package so it // doesn't have access to it. utils.Patience.nudge(); + buildmessage.nudge(); } }); }, diff --git a/tools/commands.js b/tools/commands.js index 605393097c..d1895df568 100644 --- a/tools/commands.js +++ b/tools/commands.js @@ -152,6 +152,7 @@ main.registerCommand({ main.registerCommand({ name: 'run', + pretty: true, requiresApp: true, maxArgs: Infinity, options: { diff --git a/tools/compiler.js b/tools/compiler.js index 91855c478a..bfc5dac0e7 100644 --- a/tools/compiler.js +++ b/tools/compiler.js @@ -578,25 +578,121 @@ var compileUnibuild = function (unipkg, inputSourceArch, packageLoader, // way to return errors (that could go in an overall list of // errors experienced across all files) var readOffset = 0; + + /** + * The comments for this class aren't used to generate docs right now. + * The docs live in the GitHub Wiki at: https://github.com/meteor/meteor/wiki/CompileStep-API-for-Build-Plugin-Source-Handlers + * @class CompileStep + * @summary The object passed into Plugin.registerSourceHandler + * @global + */ var compileStep = { + + /** + * @summary The total number of bytes in the input file. + * @memberOf CompileStep + * @instance + * @type {Integer} + */ inputSize: contents.length, + + /** + * @summary The filename and relative path of the input file. + * Please don't use this filename to read the file from disk, instead + * use [compileStep.read](CompileStep-read). + * @type {String} + * @instance + * @memberOf CompileStep + */ inputPath: relPath, + + /** + * @summary The filename and absolute path of the input file. + * Please don't use this filename to read the file from disk, instead + * use [compileStep.read](CompileStep-read). + * @type {String} + * @instance + * @memberOf CompileStep + */ + fullInputPath: absPath, + + // The below is used in the less and stylus packages... so it should be + // public API. _fullInputPath: absPath, // avoid, see above.. + // XXX duplicates _pathForSourceMap() in linker - pathForSourceMap: ( - inputSourceArch.pkg.name - ? inputSourceArch.pkg.name + "/" + relPath - : path.basename(relPath)), + /** + * @summary If you are generating a sourcemap for the compiled file, use + * this path for the original file in the sourcemap. + * @type {String} + * @memberOf CompileStep + * @instance + */ + pathForSourceMap: (inputSourceArch.pkg.name ? + inputSourceArch.pkg.name + "/" + relPath : path.basename(relPath)), + // null if this is an app. intended to be used for the sources // dictionary for source maps. + /** + * @summary The name of the package in which the file being built exists. + * @type {String} + * @memberOf CompileStep + * @instance + */ packageName: inputSourceArch.pkg.name, + + /** + * @summary On web targets, this will be the root URL prepended + * to the paths you pick for your output files. For example, + * it could be "/packages/my-package". + * @type {String} + * @memberOf CompileStep + * @instance + */ rootOutputPath: inputSourceArch.pkg.serveRoot, - arch: inputSourceArch.arch, // XXX: what is the story with arch? + + /** + * @summary The architecture for which we are building. Can be "os", + * "web.browser", or "web.cordova". + * @type {String} + * @memberOf CompileStep + * @instance + */ + arch: inputSourceArch.arch, + + /** + * @deprecated in 0.9.4 + * This is a duplicate API of the above, we don't need it. + */ archMatches: function (pattern) { return archinfo.matches(inputSourceArch.arch, pattern); }, + + /** + * @summary Any options passed to "api.addFiles". + * @type {Object} + * @memberOf CompileStep + * @instance + */ fileOptions: fileOptions, + + /** + * @summary The list of exports that the current package has defined. + * Can be used to treat those symbols differently during compilation. + * @type {Object} + * @memberOf CompileStep + * @instance + */ declaredExports: _.pluck(inputSourceArch.declaredExports, 'name'), + + /** + * @summary Read from the input file. If `n` is specified, returns the + * next `n` bytes of the file as a Buffer. XXX not sure if this actually + * returns a String sometimes... + * @param {Integer} [n] The number of bytes to return. + * @instance + * @memberOf CompileStep + */ read: function (n) { if (n === undefined || readOffset + n > contents.length) n = contents.length - readOffset; @@ -604,7 +700,18 @@ var compileUnibuild = function (unipkg, inputSourceArch, packageLoader, readOffset += n; return ret; }, - appendDocument: function (options) { + + /** + * @summary Works in web targets only. Add markup to the `head` or `body` + * section of the document. + * @param {Object} options + * @param {String} options.section Which section of the document should + * be appended to. Can only be "head" or "body". + * @param {String} options.data The content to append. + * @memberOf CompileStep + * @instance + */ + addHtml: function (options) { if (! archinfo.matches(inputSourceArch.arch, "web")) throw new Error("Document sections can only be emitted to " + "web targets"); @@ -617,6 +724,26 @@ var compileUnibuild = function (unipkg, inputSourceArch, packageLoader, data: new Buffer(options.data, 'utf8') }); }, + + /** + * @deprecated in 0.9.4 + */ + appendDocument: function (options) { + this.addHtml(options); + }, + + /** + * @summary Web targets only. Add a stylesheet to the document. + * @param {Object} options + * @param {String} path The requested path for the added CSS, may not be + * satisfied if there are path conflicts. + * @param {String} data The content of the stylesheet that should be + * added. + * @param {String} sourceMap A stringified JSON sourcemap, in case the + * stylesheet was generated from a different file. + * @memberOf CompileStep + * @instance + */ addStylesheet: function (options) { if (! archinfo.matches(inputSourceArch.arch, "web")) throw new Error("Stylesheets can only be emitted to " + @@ -631,6 +758,22 @@ var compileUnibuild = function (unipkg, inputSourceArch, packageLoader, sourceMap: options.sourceMap }); }, + + /** + * @summary Add JavaScript code. The code added will only see the + * namespaces imported by this package as runtime dependencies using + * ['api.use'](#PackageAPI-use). If the file being compiled was added + * with the bare flag, the resulting JavaScript won't be wrapped in a + * closure. + * @param {Object} options + * @param {String} options.path The path at which the JavaScript file + * should be inserted, may not be honored in case of path conflicts. + * @param {String} options.data The code to be added. + * @param {String} options.sourcePath The path that will be used in + * any error messages generated by this file, e.g. `foo.js:4:1: error`. + * @memberOf CompileStep + * @instance + */ addJavaScript: function (options) { if (typeof options.data !== "string") throw new Error("'data' option to addJavaScript must be a string"); @@ -642,15 +785,45 @@ var compileUnibuild = function (unipkg, inputSourceArch, packageLoader, source: options.data, sourcePath: options.sourcePath, servePath: path.join(inputSourceArch.pkg.serveRoot, options.path), - bare: !! options.bare, + bare: !! fileOptions.bare, sourceMap: options.sourceMap }); }, + + /** + * @summary Add a file to serve as-is to the browser or to include on + * the browser, depending on the target. On the web, it will be served + * at the exact path requested. For server targets, it can be retrieved + * using `Assets.getText` or `Assets.getBinary`. + * @param {Object} options + * @param {String} path The path at which to serve the asset. + * @param {Buffer|String} data The data that should be placed in + * the file. + * @memberOf CompileStep + * @instance + */ addAsset: function (options) { - if (! (options.data instanceof Buffer)) - throw new Error("'data' option to addAsset must be a Buffer"); + if (! (options.data instanceof Buffer)) { + if (_.isString(options.data)) { + options.data = new Buffer(options.data); + } else { + throw new Error("'data' option to addAsset must be a Buffer or String."); + } + } + addAsset(options.data, options.path); }, + + /** + * @summary Display a build error. + * @param {Object} options + * @param {String} message The error message to display. + * @param {String} [sourcePath] The path to display in the error message. + * @param {Integer} line The line number to display in the error message. + * @param {String} func The function name to display in the error message. + * @memberOf CompileStep + * @instance + */ error: function (options) { buildmessage.error(options.message || ("error building " + relPath), { file: options.sourcePath, diff --git a/tools/package-client.js b/tools/package-client.js index 59cf1911cf..fffc0ffe01 100644 --- a/tools/package-client.js +++ b/tools/package-client.js @@ -45,7 +45,7 @@ var emptyCachedServerDataJson = function () { }; // Given a connection, makes a call to the package server. (Checks to see if -// the connection is connected, and reconnectes if needed -- a workaround for +// the connection is connected, and reconnects if needed -- a workaround for // the fact that connections in the tool do not reconnect) exports.callPackageServer = function (conn) { if (!conn.connected) { diff --git a/tools/package-source.js b/tools/package-source.js index 2844eb5dd3..884bb6712b 100644 --- a/tools/package-source.js +++ b/tools/package-source.js @@ -587,7 +587,27 @@ _.extend(PackageSource.prototype, { // - sources: sources for the plugin (array of string) // - npmDependencies: map from npm package name to required // version (string) - _transitional_registerBuildPlugin: function (options) { + + /** + * @summary Define a build plugin. A build plugin extends the build + * process for apps and packages that use this package. For example, + * the `coffeescript` package uses a build plugin to compile CoffeeScript + * source files into JavaScript. + * @param {Object} [options] + * @param {String} options.name A cosmetic name, must be unique in the + * package. + * @param {String|String[]} options.use Meteor packages that this + * plugin uses, independent of the packages specified in + * [api.onUse](#PackageAPI-onUse). + * @param {String[]} options.sources The source files that make up the + * build plugin, independent from [api.addFiles](#PackageAPI-addFiles). + * @param {Object} options.npmDependencies An object where the keys + * are NPM package names, and the keys are the version numbers of + * required NPM packages, just like in [Npm.depends](#Npm-depends). + * @memberOf Package + * @locus package.js + */ + registerBuildPlugin: function (options) { // Tests don't have plugins; plugins initialized in the control file // belong to the package and not to the test. (This will be less // confusing in the new control file format). @@ -620,6 +640,13 @@ _.extend(PackageSource.prototype, { self.pluginInfo[options.name] = options; }, + /** + * @deprecated in 0.9.4 + */ + _transitional_registerBuildPlugin: function (options) { + this.registerBuildPlugin(options); + }, + includeTool: function () { if (!files.inCheckout()) { buildmessage.error("Package.includeTool() can only be used with a " + diff --git a/tools/progress.js b/tools/progress.js index 8123013308..538585978d 100644 --- a/tools/progress.js +++ b/tools/progress.js @@ -42,6 +42,10 @@ var Progress = function (options) { self._isDone = false; self._selfActive = false; + + // If we're faking progress using the exponential trick, the counter + // stores the number of actual ticks + self._exponentialCounter = undefined; }; _.extend(Progress.prototype, { @@ -64,6 +68,30 @@ _.extend(Progress.prototype, { self.reportProgress(state); }, + // For when we don't have a clear idea how long something will take, + // (i.e. no end estimate), just call nudge occasionally. We'll build + // an exponential progress bar for the task. + nudge: function () { + var self = this; + + var halfLife = 25; + + var state = _.clone(self._selfState); + + if (!self._exponentialCounter) { + self._exponentialCounter = 1; + // Arbitrary endpoint + state.end = 100; + } else { + self._exponentialCounter++; + } + + var fractionLeft = Math.pow(0.5, self._exponentialCounter / halfLife); + state.current = state.end * (1 - fractionLeft); + + self.reportProgress(state); + }, + // Tries to determine which is the 'current' job in the tree // This is very heuristical... we use some hints, like: // don't descend into fork-join jobs; we know these execute concurrently, diff --git a/tools/run-all.js b/tools/run-all.js index e2af680dd1..42bbf76f52 100644 --- a/tools/run-all.js +++ b/tools/run-all.js @@ -1,9 +1,14 @@ var _ = require('underscore'); var Future = require('fibers/future'); + var files = require('./files.js'); var release = require('./release.js'); - +var buildmessage = require('./buildmessage.js'); +var fiberHelpers = require('./fiber-helpers.js'); var runLog = require('./run-log.js'); + +var Console = require('./console.js').Console; + var Proxy = require('./run-proxy.js').Proxy; var Selenium = require('./run-selenium.js').Selenium; var HttpProxy = require('./run-httpproxy.js').HttpProxy; @@ -106,6 +111,7 @@ _.extend(Runner.prototype, { // XXX leave a pidfile and check if we are already running start: function () { var self = this; + self.proxy.start(); // print the banner only once we've successfully bound the port @@ -145,16 +151,19 @@ _.extend(Runner.prototype, { // but all of the ones I tried look terrible in the terminal. if (! self.quiet) { var animationFrame = 0; - var printUpdate = function () { - runLog.logTemporary("=> Starting MongoDB... " + - spinner[animationFrame]); + var printUpdate = fiberHelpers.bindEnvironment(function () { + //runLog.logTemporary("=> Starting MongoDB... " + + // spinner[animationFrame]); + buildmessage.nudge(); animationFrame = (animationFrame + 1) % spinner.length; - }; + }); printUpdate(); var mongoProgressTimer = setInterval(printUpdate, 200); } - self.mongoRunner.start(); + buildmessage.enterJob({ title: 'Starting MongoDB' }, function () { + self.mongoRunner.start(); + }); if (! self.quiet) { clearInterval(mongoProgressTimer); @@ -324,6 +333,7 @@ exports.run = function (appDir, options) { var runner = new Runner(appDir, runOptions); runner.start(); + Console.enableProgressBar(false); var result = fut.wait(); runner.stop(); diff --git a/tools/run-log.js b/tools/run-log.js index f638a2f7f9..fca1721044 100644 --- a/tools/run-log.js +++ b/tools/run-log.js @@ -1,6 +1,7 @@ var _ = require('underscore'); var uniload = require('./uniload.js'); var release = require('./release.js'); +var Console = require('./console.js').Console; // runLog is primarily used by the parts of the tool which run apps locally. It // writes to standard output (and standard error, if rawLogs is set), and allows @@ -64,12 +65,12 @@ _.extend(RunLog.prototype, { if (self.consecutiveRestartMessages) { self.consecutiveRestartMessages = null; - process.stdout.write("\n"); + Console.stdout.write("\n"); } if (self.consecutiveClientRestartMessages) { self.consecutiveClientRestartMessages = null; - process.stdout.write("\n"); + Console.stdout.write("\n"); } if (self.temporaryMessageLength) { @@ -95,9 +96,9 @@ _.extend(RunLog.prototype, { self._clearSpecial(); if (self.rawLogs) - process[isStderr ? "stderr" : "stdout"].write(line + "\n"); + Console[isStderr ? "stderr" : "stdout"].write(line + "\n"); else - process.stdout.write(Log.format(obj, { color: true }) + "\n"); + Console.stdout.write(Log.format(obj, { color: true }) + "\n"); // XXX deal with test server logging differently?! }, @@ -115,7 +116,7 @@ _.extend(RunLog.prototype, { self._record(obj); self._clearSpecial(); - process.stdout.write(msg + "\n"); + Console.stdout.write(msg + "\n"); }, // Write a message to the terminal that will get overwritten by the diff --git a/tools/unipackage.js b/tools/unipackage.js index 8ef1527c60..a4919221a5 100644 --- a/tools/unipackage.js +++ b/tools/unipackage.js @@ -391,6 +391,11 @@ _.extend(Unipackage.prototype, { if (self._pluginsInitialized) return; + /** + * @global + * @namespace Plugin + * @summary The namespace that is exposed inside build plugin files. + */ var Plugin = { // 'extension' is a file extension without the separation dot // (eg 'js', 'coffee', 'coffee.md') @@ -401,6 +406,21 @@ _.extend(Unipackage.prototype, { // // 'handler' is a function that takes a single argument, a // CompileStep (#CompileStep) + + /** + * @summary Inside a build plugin source file specified in + * [Package.registerBuildPlugin](#Package-registerBuildPlugin), + * add a handler to compile files with a certain file extension. + * @param {String} fileExtension The file extension that this plugin + * should handle, without the first dot. + * Examples: `"coffee"`, `"coffee.md"`. + * @param {Function} handler A function that takes one argument, + * a CompileStep object. + * + * Documentation for CompileStep is available [on the GitHub Wiki](https://github.com/meteor/meteor/wiki/CompileStep-API-for-Build-Plugin-Source-Handlers). + * @memberOf Plugin + * @locus Build Plugin + */ registerSourceHandler: function (extension, options, handler) { if (!handler) { handler = options;