2014-02-12 10:40:42 +00:00
|
|
|
RedisManager = require "./RedisManager"
|
2014-02-28 18:29:05 +00:00
|
|
|
TrackChangesManager = require "./TrackChangesManager"
|
2014-02-12 10:40:42 +00:00
|
|
|
|
|
|
|
module.exports = DocOpsManager =
|
2014-02-10 15:17:08 +00:00
|
|
|
getPreviousDocOps: (project_id, doc_id, start, end, callback = (error, ops) ->) ->
|
|
|
|
RedisManager.getPreviousDocOps doc_id, start, end, (error, ops) ->
|
2014-02-12 10:40:42 +00:00
|
|
|
return callback(error) if error?
|
2014-02-10 15:17:08 +00:00
|
|
|
callback null, ops
|
2014-02-12 10:40:42 +00:00
|
|
|
|
|
|
|
pushDocOp: (project_id, doc_id, op, callback = (error) ->) ->
|
2014-02-26 14:49:52 +00:00
|
|
|
RedisManager.pushDocOp doc_id, op, (error, version) ->
|
2014-02-24 16:52:12 +00:00
|
|
|
return callback(error) if error?
|
2014-03-19 15:56:44 +00:00
|
|
|
TrackChangesManager.pushUncompressedHistoryOp project_id, doc_id, op, (error) ->
|
2014-02-26 14:49:52 +00:00
|
|
|
return callback(error) if error?
|
|
|
|
callback null, version
|
2014-02-12 10:40:42 +00:00
|
|
|
|
2014-05-14 12:28:17 +00:00
|
|
|
|