globals.js

/**
 * Inserts the content of the JSS script file at the given path into the 
 * script file that calls the function.  The scope of the script is the
 * same as the scope from which the function was called.
 * 
 * @function include
 * @param {String} scriptPath path of JSS script file.
 */
function include(scriptPath) { }

/**
 * Adds the given object (usually a function) to the global scope using the given name.
 * If the published object is a function then it will be made available via RPC 
 * unless 'serverOnly' is supplied in the instructions argument.
 * 
 * Functions declared in the global scope and those referenced by `publish`
 * (without the `serverOnly` flag) are automatically made available via RPC
 * when the URL of the `.jss` file in which they're defined are referenced by allowed
 * `<script>` tag in HTML.  The Javascript code required to call them is automatically
 * generated by CompleteFTP.  Refer to [JSS Web-App Basics](../html/jssfeatures.html#6)
 * for more information.
 * 
 * The following example illustrates some usages:
 * ```
 * function globalFunction() {
 * }
 * 
 * (function () {
 *     function publishedFunction() {
 *     }
 * 
 *     function serverOnlyFunction() {
 *     }
 * 
 *     function internalFunction() {
 *     }
 * 
 *     publish("publishedFunction", publishedFunction);
 *     publish("serverOnlyFunction", serverOnlyFunction, { serverOnly: true });
 * }());
 * ```
 * Both `globalFunction()` and `publishedFunction()` are available for RPC, the former
 * because it's a global function and the latter because it's published using the `publish`
 * function.
 * Neither `internalFunction()` and `serverOnlyFunction()` are not available via RPC, 
 * but `serverOnlyFunction()` may be called by any other `.jss` file that includes it 
 * using the {@link include} function because it's published with the `serverSide` flag.
 * 
 * @function publish
 * @param {String} name Name via which the object is to be referenced
 * @param {FunctionOrObject} funcOrObj Object or function to be published
 * @param {Object} [instructions] Specifies how the object is to be published.
 * @param {Object} [instructions.serverOnly] If this property is true then the function will not be made
 *   available via RPC.  
 * @param {Object} [instructions.maxCallsPerMinute] Maximum number of 
 * RPC invocations allowed per minute (default is 100).  
 */
function publish(name, funcOrObj, instructions) { }