@operational-transformation/state-machine
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -1,2 +0,2 @@ | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["@operational-transformation/state-machine"]=n():t["@operational-transformation/state-machine"]=n()}(self,(function(){return function(){"use strict";var t={d:function(n,e){for(var r in e)t.o(e,r)&&!t.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:e[r]})},o:function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};t.r(n),t.d(n,{StateMachine:function(){return c}});var e,r,o=(e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),i=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.name="Assertion Failed",n}return o(n,t),n}(Error),p=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.name="No-op Encountered",n.message="This method should not have been called!",n}return o(n,t),n}(Error);function s(t,n){if(null==t||!1===t)throw"string"==typeof n?new i(n):n}r=Error,o((function(){var t=null!==r&&r.apply(this,arguments)||this;return t.name="Invalid Assignment to Readonly Property",t.message="This property is read only, and can not be overwritten!",t}),r);var a=function(){function t(t,n){this._outstanding=t,this._buffer=n}return t.prototype.isSynchronized=function(){return!1},t.prototype.isAwaitingConfirm=function(){return!1},t.prototype.isAwaitingWithBuffer=function(){return!0},t.prototype.applyClient=function(n,e){var r=this._buffer.compose(e);return new t(this._outstanding,r)},t.prototype.applyServer=function(n,e){var r=this._outstanding.transform(e),o=this._buffer.transform(r[1]);return n.applyOperation(o[1]),new t(r[0],o[0])},t.prototype.serverAck=function(t){return t.sendOperation(this._buffer),new u(this._buffer)},t.prototype.serverRetry=function(t){var n=this._outstanding.compose(this._buffer);return t.sendOperation(n),new u(n)},t}(),u=function(){function t(t){this._outstanding=t}return t.prototype.isSynchronized=function(){return!1},t.prototype.isAwaitingConfirm=function(){return!0},t.prototype.isAwaitingWithBuffer=function(){return!1},t.prototype.applyClient=function(t,n){return new a(this._outstanding,n)},t.prototype.applyServer=function(n,e){var r=this._outstanding.transform(e);return n.applyOperation(r[1]),new t(r[0])},t.prototype.serverAck=function(t){return f},t.prototype.serverRetry=function(t){return t.sendOperation(this._outstanding),this},t}(),f=new(function(){function t(){}return t.prototype.isSynchronized=function(){return!0},t.prototype.isAwaitingConfirm=function(){return!1},t.prototype.isAwaitingWithBuffer=function(){return!1},t.prototype.applyClient=function(t,n){return t.sendOperation(n),new u(n)},t.prototype.applyServer=function(t,n){return t.applyOperation(n),this},t.prototype.serverAck=function(t){throw new p},t.prototype.serverRetry=function(t){throw new p},t}()),c=function(){function t(t){this._state=f,this._handler=t}return t.prototype.dispose=function(){this._handler=null},t.prototype.isSynchronized=function(){return this._state.isSynchronized()},t.prototype.isAwaitingConfirm=function(){return this._state.isAwaitingConfirm()},t.prototype.isAwaitingWithBuffer=function(){return this._state.isAwaitingWithBuffer()},t.prototype._setState=function(t){this._state=t},t.prototype.applyClient=function(t){this._setState(this._state.applyClient(this,t))},t.prototype.applyServer=function(t){this._setState(this._state.applyServer(this,t))},t.prototype.serverAck=function(){this._setState(this._state.serverAck(this))},t.prototype.serverRetry=function(){this._setState(this._state.serverRetry(this))},t.prototype.applyOperation=function(t){s(null!=this._handler,new p("Can not call `applyOperation` after state machine have been disposed!")),this._handler.applyOperation(t)},t.prototype.sendOperation=function(t){s(null!=this._handler,new p("Can not call `sendOperation` after state machine have been disposed!")),this._handler.sendOperation(t)},t}();return n}()})); | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["@operational-transformation/state-machine"]=n():t["@operational-transformation/state-machine"]=n()}(this,(function(){return function(){"use strict";var t={d:function(n,e){for(var r in e)t.o(e,r)&&!t.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:e[r]})},o:function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};t.r(n),t.d(n,{StateMachine:function(){return c}});var e,r,o=(e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),i=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.name="Assertion Failed",n}return o(n,t),n}(Error),p=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.name="No-op Encountered",n.message="This method should not have been called!",n}return o(n,t),n}(Error);function s(t,n){if(null==t||!1===t)throw"string"==typeof n?new i(n):n}r=Error,o((function(){var t=null!==r&&r.apply(this,arguments)||this;return t.name="Invalid Assignment to Readonly Property",t.message="This property is read only, and can not be overwritten!",t}),r);var a=function(){function t(t,n){this._outstanding=t,this._buffer=n}return t.prototype.isSynchronized=function(){return!1},t.prototype.isAwaitingConfirm=function(){return!1},t.prototype.isAwaitingWithBuffer=function(){return!0},t.prototype.applyClient=function(n,e){var r=this._buffer.compose(e);return new t(this._outstanding,r)},t.prototype.applyServer=function(n,e){var r=this._outstanding.transform(e),o=this._buffer.transform(r[1]);return n.applyOperation(o[1]),new t(r[0],o[0])},t.prototype.serverAck=function(t){return t.sendOperation(this._buffer),new u(this._buffer)},t.prototype.serverRetry=function(t){var n=this._outstanding.compose(this._buffer);return t.sendOperation(n),new u(n)},t}(),u=function(){function t(t){this._outstanding=t}return t.prototype.isSynchronized=function(){return!1},t.prototype.isAwaitingConfirm=function(){return!0},t.prototype.isAwaitingWithBuffer=function(){return!1},t.prototype.applyClient=function(t,n){return new a(this._outstanding,n)},t.prototype.applyServer=function(n,e){var r=this._outstanding.transform(e);return n.applyOperation(r[1]),new t(r[0])},t.prototype.serverAck=function(t){return f},t.prototype.serverRetry=function(t){return t.sendOperation(this._outstanding),this},t}(),f=new(function(){function t(){}return t.prototype.isSynchronized=function(){return!0},t.prototype.isAwaitingConfirm=function(){return!1},t.prototype.isAwaitingWithBuffer=function(){return!1},t.prototype.applyClient=function(t,n){return t.sendOperation(n),new u(n)},t.prototype.applyServer=function(t,n){return t.applyOperation(n),this},t.prototype.serverAck=function(t){throw new p},t.prototype.serverRetry=function(t){throw new p},t}()),c=function(){function t(t){this._state=f,this._handler=t}return t.prototype.dispose=function(){this._handler=null},t.prototype.isSynchronized=function(){return this._state.isSynchronized()},t.prototype.isAwaitingConfirm=function(){return this._state.isAwaitingConfirm()},t.prototype.isAwaitingWithBuffer=function(){return this._state.isAwaitingWithBuffer()},t.prototype._setState=function(t){this._state=t},t.prototype.applyClient=function(t){this._setState(this._state.applyClient(this,t))},t.prototype.applyServer=function(t){this._setState(this._state.applyServer(this,t))},t.prototype.serverAck=function(){this._setState(this._state.serverAck(this))},t.prototype.serverRetry=function(){this._setState(this._state.serverRetry(this))},t.prototype.applyOperation=function(t){s(null!=this._handler,new p("Can not call `applyOperation` after state machine have been disposed!")),this._handler.applyOperation(t)},t.prototype.sendOperation=function(t){s(null!=this._handler,new p("Can not call `sendOperation` after state machine have been disposed!")),this._handler.sendOperation(t)},t}();return n}()})); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@operational-transformation/state-machine", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "State machine to manage Consistency of Operations across multiple clients.", | ||
"author": "Progyan Bhattacharya <bprogyan@gmail.com>", | ||
"homepage": "https://github.com/Progyan1997/Operational-Transformation#readme", | ||
"homepage": "https://github.com/Progyan1997/Operational-Transformation/tree/main/packages/state-machine#readme", | ||
"license": "MIT", | ||
@@ -27,3 +27,3 @@ "main": "lib/index.js", | ||
"bugs": { | ||
"url": "https://github.com/Progyan1997/Operational-Transformation/issues" | ||
"url": "https://github.com/Progyan1997/Operational-Transformation/discussions" | ||
}, | ||
@@ -39,3 +39,3 @@ "scripts": { | ||
}, | ||
"gitHead": "219316c433bad032f7bd807dc40b16bf6f9d4f76" | ||
"gitHead": "598146c539b4cbec914ed9b8af97c807e5339398" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41291