diff --git a/.couchapprc b/.couchapprc new file mode 100644 index 0000000..ae68038 --- /dev/null +++ b/.couchapprc @@ -0,0 +1,3 @@ +{ + "env": {} +} diff --git a/_id b/_id new file mode 100644 index 0000000..bcafd0c --- /dev/null +++ b/_id @@ -0,0 +1 @@ +_design/acra-storage \ No newline at end of file diff --git a/language b/language new file mode 100644 index 0000000..f504a95 --- /dev/null +++ b/language @@ -0,0 +1 @@ +javascript \ No newline at end of file diff --git a/validate_doc_upddate.js b/validate_doc_upddate.js new file mode 100644 index 0000000..b17731b --- /dev/null +++ b/validate_doc_upddate.js @@ -0,0 +1,5 @@ +function(newDoc, oldDoc, userCtx) { + if(userCtx.roles.indexOf("reporter") < 0) { + throw({"forbidden": "You may only update documents with reporter role "}); + } +} \ No newline at end of file diff --git a/views/recent-items/map.js b/views/recent-items/map.js new file mode 100644 index 0000000..6c5ec8d --- /dev/null +++ b/views/recent-items/map.js @@ -0,0 +1,9 @@ +function(doc) { + if (doc.USER_CRASH_DATE) { + emit(new Date(doc.USER_CRASH_DATE), { + user_crash_date: doc.USER_CRASH_DATE, + stack_trace:doc.STACK_TRACE, + android_version : doc.ANDROID_VERSION + }); + } +}; \ No newline at end of file diff --git a/views/reports-per-day/map.js b/views/reports-per-day/map.js new file mode 100644 index 0000000..f52f33f --- /dev/null +++ b/views/reports-per-day/map.js @@ -0,0 +1,8 @@ +function(doc) { + if(doc.USER_CRASH_DATE) { + var crashDate = new Date(doc.USER_CRASH_DATE); + if(crashDate.getFullYear() > 2000) { + emit([crashDate.getFullYear(), crashDate.getMonth() , crashDate.getDate()], 1); + } + } +} \ No newline at end of file diff --git a/views/reports-per-day/reduce.js b/views/reports-per-day/reduce.js new file mode 100644 index 0000000..ff7bd5b --- /dev/null +++ b/views/reports-per-day/reduce.js @@ -0,0 +1,3 @@ +function(keys, values, rereduce) { + return sum(values); +} \ No newline at end of file