summaryrefslogtreecommitdiff
path: root/share/server
AgeCommit message (Collapse)Author
2011-09-08Fix list-style send() API in show functions when using provides()Jan Lehnardt
Also fix ignoring the return value when the send() API isnused. Patch by Alexander Shorin. Closes COUCHDB-1272 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1166625 13f79535-47bb-0310-9956-ffa450edef68
2011-09-08Fix CouchJS compatibility with older SpiderMonkey.Paul Joseph Davis
This is a backport of the work to make CouchJS build against all of the major versions of SpiderMonkey. Thanks to Randall Leeds and Chris Coulson for the original patches. Backport based on r1137464 and r1164346 Fixes COUCHDB-1078 Fixes COUCHDB-1260 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1166525 13f79535-47bb-0310-9956-ffa450edef68
2011-05-11Fix circular imports in CommonJS modules.Paul Joseph Davis
Backport of 1102006 from trunk. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1102017 13f79535-47bb-0310-9956-ffa450edef68
2011-04-17Make this reference ddoc in provides() functionsJan Lehnardt
In show and list functions in the Javascript query server, the this member is a reference to the design doc object. The same should be true in the functions registered by Mime.provides(), for consistency. Closes COUCHDB-959 Patch by Tim Smith. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1094140 13f79535-47bb-0310-9956-ffa450edef68
2010-11-25Merged revision 1039118 from trunk:Filipe David Borba Manana
Even if sealing of an array is not allowed in the installed SpiderMonkey version, seal its members. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1039123 13f79535-47bb-0310-9956-ffa450edef68
2010-11-23Merged revision 1038193 from trunk:Filipe David Borba Manana
Seal documents before passing them to map functions (JavaScript view server only). This prevents one map function from modifying a document before it's passed to another map function. Has no effect on array fields for some Spidermonkey versions (see https://bugzilla.mozilla.org/show_bug.cgi?id=449657). Closes COUCHDB-925. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1038195 13f79535-47bb-0310-9956-ffa450edef68
2010-11-21Merged revision 1037448 from trunk:Filipe David Borba Manana
Proper verification of the roles property of a user document. Closes COUCHDB-790. Thanks Gabriel Farrell. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1037450 13f79535-47bb-0310-9956-ffa450edef68
2010-11-20Merged revision 1037245 from trunk:Filipe David Borba Manana
Fix recursive call: recursivelySeal is not defined within the body of the anonymous function declaration. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1037248 13f79535-47bb-0310-9956-ffa450edef68
2010-11-20Merged revision 1037213 from trunk:Filipe David Borba Manana
Bug fix: using undeclared identifier (doc). The function argument is named obj, not doc. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1037216 13f79535-47bb-0310-9956-ffa450edef68
2010-11-15Avoid lengthy stack traces for log(undefined);Jan Lehnardt
Improve log(<xml/>); Patch by Benjamin Young. Closes COUCHDB-895. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035104 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27CommonJS support in map functionsJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1001895 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12commonjs require no longer creates circular referencesJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@996266 13f79535-47bb-0310-9956-ffa450edef68
2010-07-23update json2.js to latest versionJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@966971 13f79535-47bb-0310-9956-ffa450edef68
2010-04-22fix erlang filter funs and normalize filter fun api. thanks fdmanana. closes ↵John Christopher Anderson
COUCHDB-740 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@936889 13f79535-47bb-0310-9956-ffa450edef68
2010-04-16upgrade CommonJS modules support to 1.1.1 - thanks Mikeal. closes COUCHDB-739John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@934652 13f79535-47bb-0310-9956-ffa450edef68
2010-02-25commonjs require for show list etc via Mikeal Rogers. closes COUCHDB-658John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@916076 13f79535-47bb-0310-9956-ffa450edef68
2010-02-18add JSON to the sandbox for older spidermonkey without native JSONJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@911602 13f79535-47bb-0310-9956-ffa450edef68
2010-02-05add list()-API cmompatible API to _show. Symmetry FTW.Jan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@906755 13f79535-47bb-0310-9956-ffa450edef68
2010-02-04re-enable 404 handling in show functions while retaining user-friendly error ↵Jan Lehnardt
behaviour git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@906721 13f79535-47bb-0310-9956-ffa450edef68
2010-01-26Replace the old JavaScript query server JSON library with json2.jsJohn Christopher Anderson
This change makes us interoperate better with other JSON implementations. It also means we can use the native JSON handlers in JavaScript runtimes that support them. Should be faster right away on new Spidermonkeys. There are some potential breaking changes for apps that depend on Couch blowing up on 'undefined'. json2.js serialized undefined as 'null' instead of crashing. This change will also affect people using E4X, as you can't just return an XML object and have it serialized to a string for you. Calling .toXMLString() on these is all you need to do. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@903023 13f79535-47bb-0310-9956-ffa450edef68
2009-12-23Follow RFC 2616 closer and use "verb" instead of "method"Jan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@893364 13f79535-47bb-0310-9956-ffa450edef68
2009-12-22move query server to a design-doc based protocol, closes COUCHDB-589John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@893249 13f79535-47bb-0310-9956-ffa450edef68
2009-12-12Create a new sandbox for each reset.Paul Joseph Davis
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@890008 13f79535-47bb-0310-9956-ffa450edef68
2009-12-06fix COUCHDB-593, thanks Roger Binns for reportingJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@887791 13f79535-47bb-0310-9956-ffa450edef68
2009-12-02removed add_fun optimization for filters, this provides better concurrency ↵John Christopher Anderson
at the cost of some function transfer/eval overhead, which will be optimized in a future patch. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@886334 13f79535-47bb-0310-9956-ffa450edef68
2009-08-11Initial commit of _update handler. Thanks to Paul Davis, Jason Davies for ↵John Christopher Anderson
code and others for discussion. The _update handler accepts POSTs to paths like: /db/_design/foo/_update/bar and PUTs which include docids, like: /db/_design/foo/_update/bar/docid The function signature: function(doc, req) { doc.a_new_field = req.query.something; return [doc, "<h1>added something to your doc</h1>"]; } The tests in update_documents.js are fairly complete and include examples of bumping a counter, changing only a single field, parsing from (and returning) XML, and creating new documents. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@803245 13f79535-47bb-0310-9956-ffa450edef68
2009-08-05proper handling of 406 Not Acceptable errors in list and show functionsJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@801345 13f79535-47bb-0310-9956-ffa450edef68
2009-08-05Upgraded JavaScript Accept header handling to make it useful.John Christopher Anderson
After user@ thread with Adam Jacob [1] http://tinyurl.com/kuhl2j I realized that giving users the option to set a server preference of mime-types was crucial. Without ordering, you see nasty side effects like a browser getting an Atom feed by default. With ordering, you can ensure that browsers get HTML, API clients see XML, and Ajax apps use JSON in a no-hassle way. Example new API: function(doc, req) { provides("html", function() { return "Hello " + doc.name + "."; }); provides("xml", function() { var xml = new XML('<xml></xml>'); xml.hello = doc.name; return xml; } }; If a client sends an Accept header like "application/xml, text/html" this will return html. If the client sends just "application/xml" they will get xml. respondsWith() has been removed. I don't think it's worth the cost to maintain a parallel implementation just to be deprecated as buggy. This patch also continues us on the path to a cleaner, more organized query server. Cheers and enjoy. [1] http://mail-archives.apache.org/mod_mbox/couchdb-user/200907.mbox/%3cb8602b350907241906l7c7f97fdg9d78facacd8605fd@mail.gmail.com%3e git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@801056 13f79535-47bb-0310-9956-ffa450edef68
2009-08-04Move mimeparse.js to it's own file, add to NOTICE as an external library.John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@801018 13f79535-47bb-0310-9956-ffa450edef68
2009-07-24speed up json encoding, patch by Brian Candler, closes COUCHDB-399Jan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@797548 13f79535-47bb-0310-9956-ffa450edef68
2009-07-20Initial checkin of _changes filters. The prime weak-spot for this approach ↵John Christopher Anderson
is that it maintains an OS-process per connected filtered _changes consumer. I'm pretty sure we'll be able to work around this without changing the API, but it'll involve a lot of OS-process bookkeeping. Those enhancements should generally improve show & list performance as well. Punting on them for now, first wanted to get _changes filters implemented so people could give feedback. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@795687 13f79535-47bb-0310-9956-ffa450edef68
2009-07-14wheeeeeeeeNoah Slater
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@794057 13f79535-47bb-0310-9956-ffa450edef68
2009-07-06trimmed trailing whitespaceNoah Slater
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@791350 13f79535-47bb-0310-9956-ffa450edef68
2009-07-04send utf-8 hearders with list and show responses. closes COUCHDB-392John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@791145 13f79535-47bb-0310-9956-ffa450edef68
2009-06-14merge list-iterator branch to trunk. changes JavaScript _list APIJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@784601 13f79535-47bb-0310-9956-ffa450edef68
2009-06-06truncate giant reduce overflow error outputJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@782290 13f79535-47bb-0310-9956-ffa450edef68
2009-05-04reduce_limit error is thrown when the reduce function output is not small ↵John Christopher Anderson
enough compared to the input. Errors can be switched off using the config API. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@771466 13f79535-47bb-0310-9956-ffa450edef68
2009-04-18move main.js generation to MakefileJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@766406 13f79535-47bb-0310-9956-ffa450edef68
2009-04-18add generation-noticeJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@766399 13f79535-47bb-0310-9956-ffa450edef68
2009-04-18integrate main.js split-up into build systemJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@766390 13f79535-47bb-0310-9956-ffa450edef68
2009-04-18refactor main.js into many files and improve show/list error handlingJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@766383 13f79535-47bb-0310-9956-ffa450edef68
2009-04-17output errors differently during chunked responses (view and list)John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@765819 13f79535-47bb-0310-9956-ffa450edef68
2009-04-16Baby steps toward better reporting of os_process errors (and JavaScript ↵John Christopher Anderson
syntax errors) git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@765479 13f79535-47bb-0310-9956-ffa450edef68
2009-03-05make row_info.prev_key available on 2nd rowJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@750683 13f79535-47bb-0310-9956-ffa450edef68
2009-02-09row_info object for _list pagination. Thanks benoitc.John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@742220 13f79535-47bb-0310-9956-ffa450edef68
2009-02-09allow format query param to override accept headers for _list and _showJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@742217 13f79535-47bb-0310-9956-ffa450edef68
2009-02-04create a separate mime registration for xhtmlJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@740925 13f79535-47bb-0310-9956-ffa450edef68
2009-02-02add iteration numbers to list row functions. closes COUCHDB-233. thanks ↵John Christopher Anderson
Benoit Chesneau. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@740094 13f79535-47bb-0310-9956-ffa450edef68
2009-01-27add toJSON to the sandboxJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@738295 13f79535-47bb-0310-9956-ffa450edef68
2009-01-27Improved etag handling for show funcs and db_doc requests; main.js cleanup ↵John Christopher Anderson
(baby steps); null doc allowed for show funcs git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@738237 13f79535-47bb-0310-9956-ffa450edef68