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