@haventech/semotus
Advanced tools
Comparing version 6.0.1 to 7.0.0-beta.1
@@ -21,7 +21,7 @@ "use strict"; | ||
function supertypeClass(objectTemplate, SupertypeModule, target) { | ||
var ret; | ||
var ObjectTemplate = SupertypeModule.default; | ||
var syncStates = []; // Default syncStates to empty array | ||
let ret; | ||
let ObjectTemplate = SupertypeModule.default; | ||
let syncStates = []; // Default syncStates to empty array | ||
// Decorator workerbee | ||
var decorator = function decorator(target) { | ||
const decorator = function decorator(target) { | ||
// second time we must call the function returned the first time because it has the | ||
@@ -42,13 +42,13 @@ // properties as a closure | ||
target.prototype.__amorphicprops__[propertyName] = defineProperty; | ||
var value_1 = defineProperty.value; | ||
const value = defineProperty.value; | ||
// The getter actually initializes the property | ||
defineProperty.get = function () { | ||
var nameSpacedProperty = "__" + propertyName; | ||
let nameSpacedProperty = `__${propertyName}`; | ||
if (!this[nameSpacedProperty]) { | ||
var cloneTemplate = defineProperty.of || defineProperty.type || null; | ||
this[nameSpacedProperty] = ObjectTemplate.clone(value_1, cloneTemplate); | ||
let cloneTemplate = defineProperty.of || defineProperty.type || null; | ||
this[nameSpacedProperty] = ObjectTemplate.clone(value, cloneTemplate); | ||
} | ||
return this[nameSpacedProperty]; | ||
}; | ||
var defineProperties = {}; | ||
const defineProperties = {}; | ||
objectTemplate._setupProperty(propertyName, defineProperty, undefined, defineProperties); | ||
@@ -72,3 +72,3 @@ Object.defineProperties(target.prototype, defineProperties); | ||
else if (target && target.syncStates) { | ||
console.warn("Semotus warning: " + target.syncStates + " is not an array value, so not setting up SyncStates for this target: " + target); | ||
console.warn(`Semotus warning: ${target.syncStates} is not an array value, so not setting up SyncStates for this target: ${target}`); | ||
} | ||
@@ -83,3 +83,3 @@ // Called first time with parameters (prop definition) rather than target (template) | ||
function Supertype(template, objectTemplate, Supertype) { | ||
return Supertype.call(template, objectTemplate); | ||
return Reflect.construct(Supertype, [objectTemplate], template.constructor); | ||
} | ||
@@ -91,6 +91,6 @@ exports.Supertype = Supertype; | ||
props.toServer = applyRuleSet(props.toServer, toServerRuleSet); | ||
var baseDecorator = SupertypeModule.property(props, objectTemplate); | ||
const baseDecorator = SupertypeModule.property(props, objectTemplate); | ||
return function (target, targetKey) { | ||
baseDecorator(target, targetKey); | ||
var defineProperties = {}; | ||
const defineProperties = {}; | ||
props.enumerable = true; | ||
@@ -113,4 +113,4 @@ props.writable = true; | ||
// function that we call to validate any changes for remote calls | ||
var remoteValidator = defineProperty.serverValidation; | ||
var isPublic = !!defineProperty.public; | ||
let remoteValidator = defineProperty.serverValidation; | ||
let isPublic = !!defineProperty.public; | ||
return function (target, propertyName, descriptor) { | ||
@@ -146,2 +146,2 @@ descriptor.value = objectTemplate._setupFunction(propertyName, descriptor.value, defineProperty.on, defineProperty.validate, remoteValidator, isPublic, defineProperty.target); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjb3JhdG9ycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWNvcmF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7Ozs7Ozs7O0dBU0c7OztBQUdIOztHQUVHO0FBRUgsd0JBQXdCO0FBQ3hCLDJFQUEyRTtBQUMzRSxnR0FBZ0c7QUFDaEcsU0FBZ0IsY0FBYyxDQUFDLGNBQWMsRUFBRSxlQUFlLEVBQUUsTUFBTTtJQUNsRSxJQUFJLEdBQUcsQ0FBQztJQUNSLElBQUksY0FBYyxHQUFHLGVBQWUsQ0FBQyxPQUFPLENBQUM7SUFDN0MsSUFBSSxVQUFVLEdBQWEsRUFBRSxDQUFDLENBQUUsb0NBQW9DO0lBRXBFLHNCQUFzQjtJQUN0QixJQUFNLFNBQVMsR0FBRyxTQUFTLFNBQVMsQ0FBQyxNQUFNO1FBQ3ZDLG1GQUFtRjtRQUNuRiwwQkFBMEI7UUFDMUIsSUFBSSxHQUFHLEVBQUU7WUFDTCx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ICAgIGRlZmluZVByb3BlcnR5Lm9uLFxuICAgICAgICAgICAgICAgICAgICBkZWZpbmVQcm9wZXJ0eS52YWxpZGF0ZVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRhcmdldC5wcm90b3R5cGUuX19hbW9ycGhpY3Byb3BzX19bcHJvcGVydHlOYW1lXSA9IGRlZmluZVByb3BlcnR5O1xuICAgICAgICAgICAgICAgIGNvbnN0IHZhbHVlID0gZGVmaW5lUHJvcGVydHkudmFsdWU7XG5cbiAgICAgICAgICAgICAgICAvLyBUaGUgZ2V0dGVyIGFjdHVhbGx5IGluaXRpYWxpemVzIHRoZSBwcm9wZXJ0eVxuICAgICAgICAgICAgICAgIGRlZmluZVByb3BlcnR5LmdldCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG5hbWVTcGFjZWRQcm9wZXJ0eSA9IGBfXyR7cHJvcGVydHlOYW1lfWA7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzW25hbWVTcGFjZWRQcm9wZXJ0eV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjbG9uZVRlbXBsYXRlID0gZGVmaW5lUHJvcGVydHkub2YgfHwgZGVmaW5lUHJvcGVydHkudHlwZSB8fCBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpc1tuYW1lU3BhY2VkUHJvcGVydHldID0gT2JqZWN0VGVtcGxhdGUuY2xvbmUodmFsdWUsIGNsb25lVGVtcGxhdGUpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzW25hbWVTcGFjZWRQcm9wZXJ0eV07XG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIGNvbnN0IGRlZmluZVByb3BlcnRpZXMgPSB7fTtcbiAgICAgICAgICAgICAgICBvYmplY3RUZW1wbGF0ZS5fc2V0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ocHJvcGVydHlOYW1lLCBkZWZpbmVQcm9wZXJ0eSkge1xuICAgICAgICAgICAgaWYgKGRlZmluZVByb3BlcnR5LmJvZHkpIHtcbiAgICAgICAgICAgICAgICB0YXJnZXQucHJvdG90eXBlW3Byb3BlcnR5TmFtZV0gPSBvYmplY3RUZW1wbGF0ZS5fc2V0dXBGdW5jdGlvbihcbiAgICAgICAgICAgICAgICAgICAgcHJvcGVydHlOYW1lLFxuICAgICAgICAgICAgICAgICAgICBkZWZpbmVQcm9wZXJ0eS5ib2R5LFxuICAgICAgICAgICAgICAgICAgICBkZWZpbmVQcm9wZXJ0eS5vbixcbiAgICAgICAgICAgICAgICAgICAgZGVmaW5lUHJvcGVydHkudmFsaWRhdGVcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0YXJnZXQucHJvdG90eXBlLl9fYW1vcnBoaWNwcm9wc19fW3Byb3BlcnR5TmFtZV0gPSBkZWZpbmVQcm9wZXJ0eTtcbiAgICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IGRlZmluZVByb3BlcnR5LnZhbHVlO1xuXG4gICAgICAgICAgICAgICAgLy8gVGhlIGdldHRlciBhY3R1YWxseSBpbml0aWFsaXplcyB0aGUgcHJvcGVydHlcbiAgICAgICAgICAgICAgICBkZWZpbmVQcm9wZXJ0eS5nZXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBuYW1lU3BhY2VkUHJvcGVydHkgPSBgX18ke3Byb3BlcnR5TmFtZX1gO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpc1tuYW1lU3BhY2VkUHJvcGVydHldKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgY2xvbmVUZW1wbGF0ZSA9IGRlZmluZVByb3BlcnR5Lm9mIHx8IGRlZmluZVByb3BlcnR5LnR5cGUgfHwgbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH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AgLypcbiAgICAgICAgICAgIHRoaXMgZnVuY3Rpb24gYmVlbiBtYXJrZWQgYXMgYSBzZXJ2ZXIgQVBJIGVpdGhlciBleHBsaWNpdGx5IG9yIGJ5IGRlZmF1bHQuXG4gICAgICAgICAgICBzZXQgdGhlIGFwcHJvcHJpYXRlIG1ldGFkYXRhLlxuICAgICAgICAgKi9cbiAgICAgICAgaWYgKGRlZmluZVByb3BlcnR5Lm9uID09PSAnc2VydmVyJykge1xuICAgICAgICAgICAgZGVzY3JpcHRvci52YWx1ZS5fX29uX18gPSAnc2VydmVyJztcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChkZWZpbmVQcm9wZXJ0eS50eXBlKSB7XG4gICAgICAgICAgICBkZXNjcmlwdG9yLnZhbHVlLl9fcmV0dXJuc19fID0gZGVmaW5lUHJvcGVydHkudHlwZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZGVmaW5lUHJvcGVydHkub2YpIHtcbiAgICAgICAgICAgIGRlc2NyaXB0b3IudmFsdWUuX19yZXR1cm5zX18gPSBkZWZpbmVQcm9wZXJ0eS5vZjtcbiAgICAgICAgICAgIGRlc2NyaXB0b3IudmFsdWUuX19yZXR1cm5zYXJyYXlfXyA9IHRydWU7XG4gICAgICAgIH1cbiAgICB9O1xufTtcblxuXG5mdW5jdGlvbiBhcHBseVJ1bGVTZXQocHJvcCwgcnVsZVNldCkge1xuICAgIGlmIChwcm9wIGluc3RhbmNlb2YgQXJyYXkgJiYgcnVsZVNldCBpbnN0YW5jZW9mIEFycmF5ICYmIHJ1bGVTZXQubGVuZ3RoID4gMCkge1xuICAgICAgICByZXR1cm4gcHJvcC5zb21lKGZ1bmN0aW9uIChyKSB7XG4gICAgICAgICAgICByZXR1cm4gcnVsZVNldC5pbmRleE9mKHIpID49IDA7XG4gICAgICAgIH0pO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHJldHVybiBwcm9wO1xuICAgIH1cbn0iXX0= |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.removeAll = exports.remove = exports.getArrayChangeGroup = exports.getPropChangeGroup = exports.get = void 0; | ||
var Types_1 = require("./Types"); | ||
var Subscriptions = require("./Subscriptions"); | ||
const Types_1 = require("./Types"); | ||
const Subscriptions = require("./Subscriptions"); | ||
function get(type, subscriptionId, semotus) { | ||
var subscription = Subscriptions.getSubscription(semotus, subscriptionId); | ||
const subscription = Subscriptions.getSubscription(semotus, subscriptionId); | ||
return subscription.log[type]; | ||
@@ -51,3 +51,3 @@ } | ||
function removeAll(type, semotus) { | ||
for (var subscription in Subscriptions.getSubscriptions(semotus)) { | ||
for (const subscription in Subscriptions.getSubscriptions(semotus)) { | ||
remove(type, subscription, semotus); | ||
@@ -57,2 +57,2 @@ } | ||
exports.removeAll = removeAll; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ2hhbmdlR3JvdXBzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2hlbHBlcnMvQ2hhbmdlR3JvdXBzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLGlDQUE2RTtBQUM3RSwrQ0FBaUQ7QUFFakQsU0FBZ0IsR0FBRyxDQUFDLElBQTJCLEVBQUUsY0FBYyxFQUFFLE9BQWdCO0lBQzdFLElBQU0sWUFBWSxHQUFHLGFBQWEsQ0FBQyxlQUFlLENBQUMsT0FBTyxFQUFFLGNBQWMsQ0FBQyxDQUFDO0lBQzVFLE9BQU8sWUFBWSxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUNsQyxDQUFDO0FBSEQsa0JBR0M7QUFFRDs7Ozs7R0FLRztBQUNILFNBQWdCLGtCQUFrQixDQUFDLGNBQWMsRUFBRSxPQUFnQjtJQUMvRCxPQUFPLEdBQUcsQ0FBQyxjQUFNLEVBQUUsY0FBYyxFQUFFLE9BQU8sQ0FBZ0IsQ0FBQzt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m91cDtcbn1cblxuXG4vKipcbiAqIFJlbW92ZSBhIGNoYW5nZSBncm91cCBmcm9tIGEgc3Vic2NyaXB0aW9uXG4gKlxuICogQHBhcmFtIHR5cGVcbiAqIEBwYXJhbSBzdWJzY3JpcHRpb25JZCB1bmtub3duXG4gKiBAcGFyYW0gc2Vtb3R1c1xuICovXG5leHBvcnQgZnVuY3Rpb24gcmVtb3ZlKHR5cGU6IHN0cmluZywgc3Vic2NyaXB0aW9uSWQsIHNlbW90dXM6IFNlbW90dXMpIHtcbiAgICBTdWJzY3JpcHRpb25zLmdldFN1YnNjcmlwdGlvbihzZW1vdHVzLCBzdWJzY3JpcHRpb25JZCkubG9nW3R5cGVdID0ge307XG59XG5cblxuLyoqXG4gKiBSZW1vdmUgYWxsIGNoYW5nZSBncm91cHMgZnJvbSBhIHN1YnNjcmlwdGlvbiB3aXRoIGdpdmVuIHR5cGVcbiAqIEBwYXJhbSB0eXBlXG4gKiBAcGFyYW0gc2Vtb3R1c1xuICpcbiAqIEBwcml2YXRlXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiByZW1vdmVBbGwodHlwZTogc3RyaW5nLCBzZW1vdHVzOiBTZW1vdHVzKSB7XG4gICAgZm9yIChjb25zdCBzdWJzY3JpcHRpb24gaW4gU3Vic2NyaXB0aW9ucy5nZXRTdWJzY3JpcHRpb25zKHNlbW90dXMpKSB7XG4gICAgICAgIHJlbW92ZSh0eXBlLCBzdWJzY3JpcHRpb24sIHNlbW90dXMpO1xuICAgIH1cbn0iXX0= |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.logChanges = exports.clearClientSession = exports.generate = exports.manage = exports.create = exports.accept = exports.doNotAccept = exports.doNotChange = exports.objectOnServerOnly = exports.objectOnClientOnly = exports.isIsolatedObject = void 0; | ||
var Sessions = require("./Sessions"); | ||
const Sessions = require("./Sessions"); | ||
/** | ||
@@ -66,4 +66,4 @@ * @TODO: Fill out with array change functions, etc. | ||
function filterSyncStates(semotusClass, semotus) { | ||
var _a = semotus.controller.syncState, scope = _a.scope, state = _a.state; | ||
var syncStates = semotusClass.syncStates; | ||
const { scope, state } = semotus.controller.syncState; | ||
const syncStates = semotusClass.syncStates; | ||
if (semotus.controller.__template__ === semotusClass) { // Don't filter out the controller | ||
@@ -184,4 +184,4 @@ return false; | ||
function manage(defineProperty) { | ||
var isLocal = defineProperty.isLocal === true; | ||
var isLocalAlt = defineProperty.toServer === false && defineProperty.toClient === false; | ||
const isLocal = defineProperty.isLocal === true; | ||
const isLocalAlt = defineProperty.toServer === false && defineProperty.toClient === false; | ||
return !(isLocal || isLocalAlt); | ||
@@ -196,4 +196,4 @@ } | ||
function generate(semotus) { | ||
var session = Sessions.get(semotus); | ||
for (var obj in session.objects) { | ||
const session = Sessions.get(semotus); | ||
for (const obj in session.objects) { | ||
logChanges(session.objects[obj], semotus); | ||
@@ -207,4 +207,4 @@ } | ||
function clearClientSession(semotus, controller) { | ||
var session = Sessions.get(semotus); | ||
for (var obj in session.objects) { | ||
const session = Sessions.get(semotus); | ||
for (const obj in session.objects) { | ||
if (obj !== controller.__id__) { | ||
@@ -231,11 +231,11 @@ delete session.objects[obj]; | ||
// Go through all the properties and transfer them to newly created object | ||
var props = obj.__template__.getProperties(); | ||
for (var prop in props) { | ||
var defineProperty = props[prop]; | ||
var type = defineProperty.type; | ||
const props = obj.__template__.getProperties(); | ||
for (const prop in props) { | ||
const defineProperty = props[prop]; | ||
const type = defineProperty.type; | ||
if (type && manage(defineProperty)) { | ||
var createChanges = create(defineProperty, obj.__template__, semotus); | ||
const createChanges = create(defineProperty, obj.__template__, semotus); | ||
if (type == Array) { | ||
if (createChanges) { | ||
if (obj["__" + prop] && !obj[prop]) { | ||
if (obj[`__${prop}`] && !obj[prop]) { | ||
// switch to null treated like a property change | ||
@@ -246,3 +246,3 @@ semotus._changedValue(obj, prop, obj[prop]); | ||
// switch from null like an array ref where array will be created | ||
if (!obj["__" + prop]) { | ||
if (!obj[`__${prop}`]) { | ||
if (obj[prop].length == 0) { | ||
@@ -252,5 +252,5 @@ // switch to empty array | ||
} | ||
obj["__" + prop] = []; // Start from scratch | ||
obj[`__${prop}`] = []; // Start from scratch | ||
} | ||
semotus._referencedArray(obj, prop, obj["__" + prop]); | ||
semotus._referencedArray(obj, prop, obj[`__${prop}`]); | ||
} | ||
@@ -260,8 +260,8 @@ } | ||
else { | ||
var currValue = semotus._convertValue(obj[prop]); | ||
var prevValue = semotus._convertValue(obj["__" + prop]); | ||
const currValue = semotus._convertValue(obj[prop]); | ||
const prevValue = semotus._convertValue(obj[`__${prop}`]); | ||
if (createChanges && currValue !== prevValue) { | ||
semotus._changedValue(obj, prop, obj[prop]); | ||
} | ||
obj["__" + prop] = obj[prop]; | ||
obj[`__${prop}`] = obj[prop]; | ||
} | ||
@@ -272,2 +272,2 @@ } | ||
exports.logChanges = logChanges; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ2hhbmdlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9oZWxwZXJzL0NoYW5nZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EscUNBQXVDO0FBRXZDOztHQUVHO0FBRUgsNkZBQTZGO0FBRTdGLFNBQVMsc0JBQXNCLENBQUMsT0FBZ0I7SUFDNUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsSUFBSSxLQUFLLFFBQVEsSUFBSSxPQUFPLENBQUMsVUFBVSxJQUFJLE9BQU8sQ0FBQyxVQUFVLENBQUMsU0FBUyxDQUFDLENBQUM7QUFDL0YsQ0FBQztBQUVELFNBQWdCLGdCQUFnQixDQUFDLE9BQWdCLEVBQUUsR0FBRztJQUNsRCxJQUFJLGtCQUFrQixDQUFDLE9BQU8sRUFBRSxHQUFHLENBQUMsRUFBRTtRQUNsQyxPQUFPLElBQUksQ0FBQztLQUNmO1NBQ0ksSU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JlYXRlQ2hhbmdlcykge1xuICAgICAgICAgICAgICAgICAgICBpZiAob2JqW2BfXyR7cHJvcH1gXSAmJiAhb2JqW3Byb3BdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzd2l0Y2ggdG8gbnVsbCB0cmVhdGVkIGxpa2UgYSBwcm9wZXJ0eSBjaGFuZ2VcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbW90dXMuX2NoYW5nZWRWYWx1ZShvYmosIHByb3AsIG9ialtwcm9wXSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob2JqW3Byb3BdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzd2l0Y2ggZnJvbSBudWxsIGxpa2UgYW4gYXJyYXkgcmVmIHdoZXJlIGFycmF5IHdpbGwgYmUgY3JlYXRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFvYmpbYF9fJHtwcm9wfWBdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9ialtwcm9wXS5sZW5ndGggPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzd2l0Y2ggdG8gZW1wdHkgYXJyYXlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vtb3R1cy5fY2hhbmdlZFZhbHVlKG9iaiwgcHJvcCwgb2JqW3Byb3BdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYmpbYF9fJHtwcm9wfWBdID0gW107IC8vIFN0YXJ0IGZyb20gc2NyYXRjaFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBzZW1vdHVzLl9yZWZlcmVuY2VkQXJyYXkob2JqLCBwcm9wLCBvYmpbYF9fJHtwcm9wfWBdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgIC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bmVQcm9wZXJ0eSwgb2JqLl9fdGVtcGxhdGVfXywgc2Vtb3R1cyk7XG5cbiAgICAgICAgICAgIGlmICh0eXBlID09IEFycmF5KSB7XG4gICAgICAgICAgICAgICAgaWYgKGNyZWF0ZUNoYW5nZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9ialtgX18ke3Byb3B9YF0gJiYgIW9ialtwcm9wXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3dpdGNoIHRvIG51bGwgdHJlYXRlZCBsaWtlIGEgcHJvcGVydHkgY2hhbmdlXG4gICAgICAgICAgICAgICAgICAgICAgICBzZW1vdHVzLl9jaGFuZ2VkVmFsdWUob2JqLCBwcm9wLCBvYmpbcHJvcF0pO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9ialtwcm9wXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3dpdGNoIGZyb20gbnVsbCBsaWtlIGFuIGFycmF5IHJlZiB3aGVyZSBhcnJheSB3aWxsIGJlIGNyZWF0ZWRcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghb2JqW2BfXyR7cHJvcH1gXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvYmpbcHJvcF0ubGVuZ3RoID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3dpdGNoIHRvIGVtcHR5IGFycmF5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbW90dXMuX2NoYW5nZWRWYWx1ZShvYmosIHByb3AsIG9ialtwcm9wXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb2JqW2BfXyR7cHJvcH1gXSA9IFtdOyAvLyBTdGFydCBmcm9tIHNjcmF0Y2hcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgc2Vtb3R1cy5fcmVmZXJlbmNlZEFycmF5KG9iaiwgcHJvcCwgb2JqW2BfXyR7cHJvcH1gXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbnN0IGN1cnJWYWx1ZSA9IHNlbW90dXMuX2NvbnZlcnRWYWx1ZShvYmpbcHJvcF0pO1xuICAgICAgICAgICAgICAgIGNvbnN0IHByZXZWYWx1ZSA9IHNlbW90dXMuX2NvbnZlcnRWYWx1ZShvYmpbYF9fJHtwcm9wfWBdKTtcblxuICAgICAgICAgICAgICAgIGlmIChjcmVhdGVDaGFuZ2VzICYmIGN1cnJWYWx1ZSAhPT0gcHJldlZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgIHNlbW90dXMuX2NoYW5nZWRWYWx1ZShvYmosIHByb3AsIG9ialtwcm9wXSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgb2JqW2BfXyR7cHJvcH1gXSA9IG9ialtwcm9wXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn1cbiJdfQ== |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.postCallErrorLog = exports.processCall = void 0; | ||
var Utilities_1 = require("./Utilities"); | ||
const Utilities_1 = require("./Utilities"); | ||
/** | ||
@@ -53,41 +17,15 @@ * We process the call the remote method in stages starting by letting the controller examine the | ||
*/ | ||
function processCall(payload, forceupdate) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var validation, result, err_1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
_a.trys.push([0, 8, , 10]); | ||
return [4 /*yield*/, Promise.resolve(forceupdate)]; | ||
case 1: | ||
forceupdate = _a.sent(); | ||
return [4 /*yield*/, preCallHook(payload, forceupdate)]; | ||
case 2: | ||
_a.sent(); | ||
return [4 /*yield*/, applyChangesAndValidateCall(payload)]; | ||
case 3: | ||
validation = _a.sent(); | ||
return [4 /*yield*/, customValidation(payload, validation)]; | ||
case 4: | ||
validation = _a.sent(); | ||
return [4 /*yield*/, callIfValid(payload, validation)]; | ||
case 5: | ||
result = _a.sent(); | ||
return [4 /*yield*/, postCallHook(payload, result)]; | ||
case 6: | ||
_a.sent(); | ||
return [4 /*yield*/, postCallSuccess(payload, result)]; | ||
case 7: | ||
_a.sent(); | ||
return [3 /*break*/, 10]; | ||
case 8: | ||
err_1 = _a.sent(); | ||
return [4 /*yield*/, postCallFailure(payload, err_1)]; | ||
case 9: | ||
_a.sent(); | ||
return [3 /*break*/, 10]; | ||
case 10: return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
async function processCall(payload, forceupdate) { | ||
try { | ||
forceupdate = await Promise.resolve(forceupdate); | ||
await preCallHook(payload, forceupdate); | ||
let validation = await applyChangesAndValidateCall(payload); | ||
validation = await customValidation(payload, validation); | ||
const result = await callIfValid(payload, validation); | ||
await postCallHook(payload, result); | ||
await postCallSuccess(payload, result); | ||
} | ||
catch (err) { | ||
await postCallFailure(payload, err); | ||
} | ||
} | ||
@@ -100,13 +38,8 @@ exports.processCall = processCall; | ||
*/ | ||
function retryCall(payload) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var semotus, remoteCall, callContext, session, subscriptionId, remoteCallId, restoreSessionCallback; | ||
return __generator(this, function (_a) { | ||
semotus = payload.semotus, remoteCall = payload.remoteCall, callContext = payload.callContext, session = payload.session, subscriptionId = payload.subscriptionId, remoteCallId = payload.remoteCallId, restoreSessionCallback = payload.restoreSessionCallback; | ||
if (restoreSessionCallback) { | ||
restoreSessionCallback(); | ||
} | ||
return [2 /*return*/, processCall(payload, true)]; | ||
}); | ||
}); | ||
async function retryCall(payload) { | ||
const { semotus, remoteCall, callContext, session, subscriptionId, remoteCallId, restoreSessionCallback } = payload; | ||
if (restoreSessionCallback) { | ||
restoreSessionCallback(); | ||
} | ||
return processCall(payload, true); | ||
} | ||
@@ -121,8 +54,31 @@ /** | ||
*/ | ||
function preCallHook(payload, forceupdate) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var semotus, remoteCall, session, callContext, HTTPObjs, changes, objId, remoteObject, remoteTemplate, isPublic; | ||
return __generator(this, function (_a) { | ||
semotus = payload.semotus, remoteCall = payload.remoteCall, session = payload.session, callContext = payload.callContext, HTTPObjs = payload.HTTPObjs; | ||
semotus.logger.info({ | ||
async function preCallHook(payload, forceupdate) { | ||
const { semotus, remoteCall, session, callContext, HTTPObjs } = payload; | ||
semotus.logger.info({ | ||
component: 'semotus', | ||
module: 'processCall', | ||
activity: 'preServerCall', | ||
data: { | ||
call: remoteCall.name, | ||
sequence: remoteCall.sequence | ||
} | ||
}, remoteCall.name); | ||
if (semotus.controller && semotus.controller.preServerCall) { | ||
let changes = {}; | ||
for (var objId in JSON.parse(remoteCall.changes)) { | ||
changes[semotus.__dictionary__[objId.replace(/[^-]*-/, '').replace(/-.*/, '')].__name__] = true; | ||
} | ||
let remoteObject = session.objects[remoteCall.id]; | ||
// Need to double check if not in session, what the template is. | ||
let remoteTemplate = semotus.__dictionary__[remoteCall.id.replace(/[^-]*-/, '').replace(/-.*/, '')]; | ||
let isPublic = false; | ||
if (remoteObject) { | ||
isPublic = semotus.role === 'server' && remoteObject[remoteCall.name] && remoteObject[remoteCall.name].remotePublic; | ||
} | ||
else if (remoteTemplate) { | ||
// If the class doesn't exist, we should get the remote function from the prototype | ||
isPublic = semotus.role === 'server' && remoteTemplate.prototype[remoteCall.name] && remoteTemplate.prototype[remoteCall.name].remotePublic; | ||
} | ||
else { | ||
semotus.logger.error({ | ||
component: 'semotus', | ||
@@ -135,37 +91,9 @@ module: 'processCall', | ||
} | ||
}, remoteCall.name); | ||
if (semotus.controller && semotus.controller.preServerCall) { | ||
changes = {}; | ||
for (objId in JSON.parse(remoteCall.changes)) { | ||
changes[semotus.__dictionary__[objId.replace(/[^-]*-/, '').replace(/-.*/, '')].__name__] = true; | ||
} | ||
remoteObject = session.objects[remoteCall.id]; | ||
remoteTemplate = semotus.__dictionary__[remoteCall.id.replace(/[^-]*-/, '').replace(/-.*/, '')]; | ||
isPublic = false; | ||
if (remoteObject) { | ||
isPublic = semotus.role === 'server' && remoteObject[remoteCall.name] && remoteObject[remoteCall.name].remotePublic; | ||
} | ||
else if (remoteTemplate) { | ||
// If the class doesn't exist, we should get the remote function from the prototype | ||
isPublic = semotus.role === 'server' && remoteTemplate.prototype[remoteCall.name] && remoteTemplate.prototype[remoteCall.name].remotePublic; | ||
} | ||
else { | ||
semotus.logger.error({ | ||
component: 'semotus', | ||
module: 'processCall', | ||
activity: 'preServerCall', | ||
data: { | ||
call: remoteCall.name, | ||
sequence: remoteCall.sequence | ||
} | ||
}, 'Could not find template for ' + objId); | ||
} | ||
return [2 /*return*/, semotus.controller.preServerCall.call(semotus.controller, remoteCall.changes.length > 2, changes, callContext, forceupdate, remoteCall.name, remoteCall, isPublic, HTTPObjs)]; | ||
} | ||
else { | ||
return [2 /*return*/, true]; | ||
} | ||
return [2 /*return*/]; | ||
}); | ||
}); | ||
}, 'Could not find template for ' + objId); | ||
} | ||
return semotus.controller.preServerCall.call(semotus.controller, remoteCall.changes.length > 2, changes, callContext, forceupdate, remoteCall.name, remoteCall, isPublic, HTTPObjs); | ||
} | ||
else { | ||
return true; | ||
} | ||
} | ||
@@ -178,3 +106,3 @@ /** | ||
function applyChangesAndValidateCall(payload) { | ||
var semotus = payload.semotus, remoteCall = payload.remoteCall, callContext = payload.callContext, session = payload.session, subscriptionId = payload.subscriptionId, remoteCallId = payload.remoteCallId, restoreSessionCallback = payload.restoreSessionCallback; | ||
const { semotus, remoteCall, callContext, session, subscriptionId, remoteCallId, restoreSessionCallback } = payload; | ||
semotus.logger.info({ | ||
@@ -190,8 +118,8 @@ component: 'semotus', | ||
}, remoteCall.name); | ||
var changes = JSON.parse(remoteCall.changes); | ||
var res = semotus._applyChanges(changes, semotus.role === 'client', subscriptionId, callContext); | ||
let changes = JSON.parse(remoteCall.changes); | ||
const res = semotus._applyChanges(changes, semotus.role === 'client', subscriptionId, callContext); | ||
if (res) { | ||
var obj = session.objects[remoteCall.id]; | ||
const obj = session.objects[remoteCall.id]; | ||
if (!obj) { | ||
throw new Error("Cannot find object for remote call " + remoteCall.id); | ||
throw new Error(`Cannot find object for remote call ${remoteCall.id}`); | ||
} | ||
@@ -221,4 +149,4 @@ // check to see if this function is supposed to be called directly from client | ||
function customValidation(payload, isValid) { | ||
var semotus = payload.semotus, remoteCall = payload.remoteCall, callContext = payload.callContext, session = payload.session, subscriptionId = payload.subscriptionId, remoteCallId = payload.remoteCallId, restoreSessionCallback = payload.restoreSessionCallback; | ||
var loggerObject = { | ||
const { semotus, remoteCall, callContext, session, subscriptionId, remoteCallId, restoreSessionCallback } = payload; | ||
let loggerObject = { | ||
component: 'semotus', | ||
@@ -233,3 +161,3 @@ module: 'processCall', | ||
}; | ||
var remoteObject = session.objects[remoteCall.id]; | ||
let remoteObject = session.objects[remoteCall.id]; | ||
semotus.logger.info(loggerObject, remoteCall.name); | ||
@@ -240,3 +168,3 @@ if (!isValid) { | ||
else if (semotus.role === 'server' && remoteObject[remoteCall.name].serverValidation) { | ||
var args = semotus._extractArguments(remoteCall); | ||
let args = semotus._extractArguments(remoteCall); | ||
args.unshift(remoteObject); | ||
@@ -260,29 +188,24 @@ return remoteObject[remoteCall.name].serverValidation.apply(null, args); | ||
*/ | ||
function callIfValid(payload, isValid) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var semotus, remoteCall, callContext, session, subscriptionId, remoteCallId, restoreSessionCallback, loggerObject, obj, args; | ||
return __generator(this, function (_a) { | ||
semotus = payload.semotus, remoteCall = payload.remoteCall, callContext = payload.callContext, session = payload.session, subscriptionId = payload.subscriptionId, remoteCallId = payload.remoteCallId, restoreSessionCallback = payload.restoreSessionCallback; | ||
loggerObject = { | ||
component: 'semotus', | ||
module: 'processCall', | ||
activity: 'callIfValid', | ||
data: { | ||
call: remoteCall.name, | ||
sequence: remoteCall.sequence, | ||
remoteCallId: remoteCall.id | ||
} | ||
}; | ||
semotus.logger.info(loggerObject, remoteCall.name); | ||
obj = session.objects[remoteCall.id]; | ||
if (!obj[remoteCall.name]) { | ||
throw new Error(remoteCall.name + ' function does not exist.'); | ||
} | ||
if (!isValid && remoteCall && remoteCall.name) { | ||
throw new Error(remoteCall.name + ' refused'); | ||
} | ||
args = semotus._extractArguments(remoteCall); | ||
return [2 /*return*/, obj[remoteCall.name].apply(obj, args)]; | ||
}); | ||
}); | ||
async function callIfValid(payload, isValid) { | ||
const { semotus, remoteCall, callContext, session, subscriptionId, remoteCallId, restoreSessionCallback } = payload; | ||
let loggerObject = { | ||
component: 'semotus', | ||
module: 'processCall', | ||
activity: 'callIfValid', | ||
data: { | ||
call: remoteCall.name, | ||
sequence: remoteCall.sequence, | ||
remoteCallId: remoteCall.id | ||
} | ||
}; | ||
semotus.logger.info(loggerObject, remoteCall.name); | ||
let obj = session.objects[remoteCall.id]; | ||
if (!obj[remoteCall.name]) { | ||
throw new Error(remoteCall.name + ' function does not exist.'); | ||
} | ||
if (!isValid && remoteCall && remoteCall.name) { | ||
throw new Error(remoteCall.name + ' refused'); | ||
} | ||
let args = semotus._extractArguments(remoteCall); | ||
return obj[remoteCall.name].apply(obj, args); | ||
} | ||
@@ -297,19 +220,9 @@ /** | ||
*/ | ||
function postCallHook(payload, returnValue) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var semotus, remoteCall, callContext, HTTPObjs, hasChanges; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
semotus = payload.semotus, remoteCall = payload.remoteCall, callContext = payload.callContext, HTTPObjs = payload.HTTPObjs; | ||
if (!(semotus.controller && semotus.controller.postServerCall)) return [3 /*break*/, 2]; | ||
hasChanges = remoteCall.changes.length > 2; | ||
return [4 /*yield*/, semotus.controller.postServerCall.call(semotus.controller, hasChanges, callContext, semotus.changeString, HTTPObjs)]; | ||
case 1: | ||
_a.sent(); | ||
_a.label = 2; | ||
case 2: return [2 /*return*/, returnValue]; | ||
} | ||
}); | ||
}); | ||
async function postCallHook(payload, returnValue) { | ||
const { semotus, remoteCall, callContext, HTTPObjs } = payload; | ||
if (semotus.controller && semotus.controller.postServerCall) { | ||
const hasChanges = remoteCall.changes.length > 2; | ||
await semotus.controller.postServerCall.call(semotus.controller, hasChanges, callContext, semotus.changeString, HTTPObjs); | ||
} | ||
return returnValue; | ||
} | ||
@@ -326,3 +239,3 @@ /** | ||
function postCallSuccess(payload, ret) { | ||
var semotus = payload.semotus, remoteCall = payload.remoteCall, callContext = payload.callContext, session = payload.session, remoteCallId = payload.remoteCallId; | ||
const { semotus, remoteCall, callContext, session, remoteCallId } = payload; | ||
semotus.logger.info({ | ||
@@ -358,46 +271,33 @@ component: 'semotus', | ||
*/ | ||
function resolveErrorHandler(logger, controller, type, remoteCall, remoteCallId, callContext, changeString, session) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var errorType, functionName, obj, logBody, error_1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!(controller && controller.postServerErrorHandler)) return [3 /*break*/, 4]; | ||
errorType = type; | ||
functionName = remoteCall.name; | ||
obj = undefined; | ||
if (session.objects[remoteCall.id]) { | ||
obj = session.objects[remoteCall.id]; | ||
} | ||
logBody = { | ||
component: 'semotus', | ||
module: 'processCall.failure', | ||
activity: 'postCall.resolveErrorHandler', | ||
data: { | ||
call: remoteCall.name, | ||
message: undefined | ||
} | ||
}; | ||
_a.label = 1; | ||
case 1: | ||
_a.trys.push([1, 3, , 4]); | ||
return [4 /*yield*/, controller.postServerErrorHandler.call(controller, errorType, remoteCallId, obj, functionName, callContext, changeString)]; | ||
case 2: | ||
_a.sent(); | ||
return [3 /*break*/, 4]; | ||
case 3: | ||
error_1 = _a.sent(); | ||
if (error_1.message) { | ||
logBody.data.message = error_1.message; | ||
logger.error(error_1.message); | ||
} | ||
else { | ||
logBody.data.message = JSON.stringify(error_1); | ||
} | ||
logger.error(logBody, 'User defined postServerErrorHandler threw an error'); | ||
return [3 /*break*/, 4]; | ||
case 4: return [2 /*return*/]; | ||
async function resolveErrorHandler(logger, controller, type, remoteCall, remoteCallId, callContext, changeString, session) { | ||
if (controller && controller.postServerErrorHandler) { | ||
let errorType = type; | ||
let functionName = remoteCall.name; | ||
let obj = undefined; | ||
if (session.objects[remoteCall.id]) { | ||
obj = session.objects[remoteCall.id]; | ||
} | ||
let logBody = { | ||
component: 'semotus', | ||
module: 'processCall.failure', | ||
activity: 'postCall.resolveErrorHandler', | ||
data: { | ||
call: remoteCall.name, | ||
message: undefined | ||
} | ||
}); | ||
}); | ||
}; | ||
try { | ||
await controller.postServerErrorHandler.call(controller, errorType, remoteCallId, obj, functionName, callContext, changeString); | ||
} | ||
catch (error) { | ||
if (error.message) { | ||
logBody.data.message = error.message; | ||
logger.error(error.message); | ||
} | ||
else { | ||
logBody.data.message = JSON.stringify(error); | ||
} | ||
logger.error(logBody, 'User defined postServerErrorHandler threw an error'); | ||
} | ||
} | ||
} | ||
@@ -415,74 +315,65 @@ /** | ||
*/ | ||
function postCallFailure(payload, err) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var semotus, remoteCall, callContext, session, subscriptionId, remoteCallId, restoreSessionCallback, logString, packageChangesPayload, updateConflictRetry; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
semotus = payload.semotus, remoteCall = payload.remoteCall, callContext = payload.callContext, session = payload.session, subscriptionId = payload.subscriptionId, remoteCallId = payload.remoteCallId, restoreSessionCallback = payload.restoreSessionCallback; | ||
logString = ''; | ||
packageChangesPayload = {}; | ||
updateConflictRetry = false; | ||
if (err === 'Sync Error') { | ||
postCallErrorLog(semotus.logger, 'postCall.syncError', undefined, 'error', remoteCall.name, remoteCall, callContext); | ||
packageChangesPayload = { | ||
type: 'response', | ||
sync: false, | ||
changes: '' | ||
}; | ||
} | ||
else if (err.message == 'Update Conflict') { | ||
// Not this may be caught in the transport (e.g. Amorphic) and retried) | ||
// increment callContext.retries after checking if < 3. Should retry 3 times. | ||
if (callContext.retries++ < 3) { | ||
postCallErrorLog(semotus.logger, 'postCall.updateConflict', undefined, 'warn', remoteCall.name, remoteCall, callContext); | ||
updateConflictRetry = true; | ||
// The following assignment is only used for the error handler | ||
packageChangesPayload = { | ||
type: 'retry' | ||
}; | ||
} | ||
else { | ||
postCallErrorLog(semotus.logger, 'postCall.updateConflict', undefined, 'error', remoteCall.name, remoteCall, callContext); | ||
packageChangesPayload = { | ||
type: 'retry', | ||
sync: false | ||
}; | ||
} | ||
} | ||
else { | ||
if (!(err instanceof Error)) { | ||
postCallErrorLog(semotus.logger, 'postCall.error', JSON.stringify(err), 'info', remoteCall.name, remoteCall, callContext); | ||
} | ||
else { | ||
if (err.stack) { | ||
logString = 'Exception in ' + remoteCall.name + ' - ' + err.message + (' ' + err.stack); | ||
} | ||
else { | ||
logString = 'Exception in ' + remoteCall.name + ' - ' + err.message; | ||
} | ||
postCallErrorLog(semotus.logger, 'postCall.exception', err.message, 'error', logString, remoteCall, callContext); | ||
} | ||
packageChangesPayload = { | ||
type: 'error', | ||
sync: true, | ||
value: Utilities_1.getError(err), | ||
name: remoteCall.name | ||
}; | ||
} | ||
Object.assign(packageChangesPayload, { remoteCallId: remoteCallId }); | ||
return [4 /*yield*/, resolveErrorHandler(semotus.logger, semotus.controller, | ||
// @ts-ignore | ||
packageChangesPayload.type, remoteCall, remoteCallId, callContext, semotus.changeString, session)]; | ||
case 1: | ||
_a.sent(); | ||
if (!updateConflictRetry) return [3 /*break*/, 3]; | ||
return [4 /*yield*/, Utilities_1.delay(callContext.retries * 1000)]; | ||
case 2: | ||
_a.sent(); | ||
return [2 /*return*/, retryCall(payload)]; | ||
case 3: return [2 /*return*/, packageChanges(semotus, session, packageChangesPayload)]; | ||
async function postCallFailure(payload, err) { | ||
const { semotus, remoteCall, callContext, session, subscriptionId, remoteCallId, restoreSessionCallback } = payload; | ||
let logString = ''; | ||
let packageChangesPayload = {}; | ||
let updateConflictRetry = false; | ||
if (err === 'Sync Error') { | ||
postCallErrorLog(semotus.logger, 'postCall.syncError', undefined, 'error', remoteCall.name, remoteCall, callContext); | ||
packageChangesPayload = { | ||
type: 'response', | ||
sync: false, | ||
changes: '' | ||
}; | ||
} | ||
else if (err.message == 'Update Conflict') { | ||
// Not this may be caught in the transport (e.g. Amorphic) and retried) | ||
// increment callContext.retries after checking if < 3. Should retry 3 times. | ||
if (callContext.retries++ < 3) { | ||
postCallErrorLog(semotus.logger, 'postCall.updateConflict', undefined, 'warn', remoteCall.name, remoteCall, callContext); | ||
updateConflictRetry = true; | ||
// The following assignment is only used for the error handler | ||
packageChangesPayload = { | ||
type: 'retry' | ||
}; | ||
} | ||
else { | ||
postCallErrorLog(semotus.logger, 'postCall.updateConflict', undefined, 'error', remoteCall.name, remoteCall, callContext); | ||
packageChangesPayload = { | ||
type: 'retry', | ||
sync: false | ||
}; | ||
} | ||
} | ||
else { | ||
if (!(err instanceof Error)) { | ||
postCallErrorLog(semotus.logger, 'postCall.error', JSON.stringify(err), 'info', remoteCall.name, remoteCall, callContext); | ||
} | ||
else { | ||
if (err.stack) { | ||
logString = 'Exception in ' + remoteCall.name + ' - ' + err.message + (' ' + err.stack); | ||
} | ||
}); | ||
}); | ||
else { | ||
logString = 'Exception in ' + remoteCall.name + ' - ' + err.message; | ||
} | ||
postCallErrorLog(semotus.logger, 'postCall.exception', err.message, 'error', logString, remoteCall, callContext); | ||
} | ||
packageChangesPayload = { | ||
type: 'error', | ||
sync: true, | ||
value: Utilities_1.getError(err), | ||
name: remoteCall.name | ||
}; | ||
} | ||
Object.assign(packageChangesPayload, { remoteCallId: remoteCallId }); | ||
await resolveErrorHandler(semotus.logger, semotus.controller, | ||
// @ts-ignore | ||
packageChangesPayload.type, remoteCall, remoteCallId, callContext, semotus.changeString, session); | ||
if (updateConflictRetry) { | ||
await Utilities_1.delay(callContext.retries * 1000); | ||
return retryCall(payload); | ||
} | ||
else { | ||
return packageChanges(semotus, session, packageChangesPayload); | ||
} | ||
} | ||
@@ -521,3 +412,3 @@ /** | ||
function postCallErrorLog(logger, activity, message, logType, logString, remoteCall, callContext) { | ||
var logBody = { | ||
let logBody = { | ||
component: 'semotus', | ||
@@ -540,2 +431,2 @@ module: 'processCall.failure', | ||
exports.postCallErrorLog = postCallErrorLog; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUHJvY2Vzc0NhbGwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaGVscGVycy9Qcm9jZXNzQ2FsbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSx5Q0FBcUQ7QUFHckQ7Ozs7Ozs7Ozs7O0dBV0c7QUFDSCxTQUFzQixXQUFXLENBQUMsT0FBMkIsRUFBRSxXQUFxQjs7Ozs7OztvQkFHOUQscUJBQU0sT0FBTyxDQUFDLE9BQU8sQ0FBQyxXQUFXLENBQUMsRUFBQTs7b0JBQWhELFdBQVcsR0FBRyxTQUFrQyxDQUFDO29CQUNqRCxxQkFBTSxXQUFXLENBQUMsT0FBTyxFQUFFLFdBQVcsQ0FBQyxFQUFBOztvQkFBdkMsU0FBdUMsQ0FBQztvQkFDdkIscUJBQU0sMkJBQTJCLENBQUMsT0FBTyxDQUFDLEVBQUE7O29CQUF2RCxVQUFVLEdBQUcsU0FBMEM7b0JBQzlDLHFCQUFNLGdCQUFnQixDQUFDLE9BQU8sRUFBRSxVQUFVLENBQUMsRUFBQTs7b0JBQXhELFVBQVUsR0FBRyxTQUEyQyxDQUFDO29CQUMxQyxxQkFBTSxXQUFXLENBQUMsT0FBTyxFQUFFLFVBQVUsQ0F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2FsbC5mYWlsdXJlJyxcbiAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgY2FsbDogcmVtb3RlQ2FsbC5uYW1lLFxuICAgICAgICAgICAgY2FsbFRpbWU6IGxvZ1RpbWUoY2FsbENvbnRleHQpLFxuICAgICAgICAgICAgc2VxdWVuY2U6IHJlbW90ZUNhbGwuc2VxdWVuY2UsXG4gICAgICAgICAgICBtZXNzYWdlOiB1bmRlZmluZWRcbiAgICAgICAgfSxcbiAgICAgICAgYWN0aXZpdHk6IHVuZGVmaW5lZFxuICAgIH07XG5cbiAgICBsb2dCb2R5LmFjdGl2aXR5ID0gYWN0aXZpdHk7XG5cbiAgICBpZiAobG9nZ2VyLmRhdGEpIHtcbiAgICAgICAgbG9nQm9keS5kYXRhLm1lc3NhZ2UgPSBtZXNzYWdlO1xuICAgIH1cblxuICAgIGxvZ2dlcltsb2dUeXBlXShsb2dCb2R5LCBsb2dTdHJpbmcpO1xufVxuIl19 |
@@ -58,3 +58,3 @@ "use strict"; | ||
function remove(semotus, sessionId) { | ||
var session = get(semotus, sessionId); | ||
let session = get(semotus, sessionId); | ||
for (var calls in session.remoteCalls) { | ||
@@ -109,3 +109,3 @@ session.remoteCalls[calls].deferred.reject({ code: 'reset', text: 'Session resynchronized' }); | ||
semotus.setSession(sessionId); | ||
var session = semotus.sessions[sessionId]; | ||
const session = semotus.sessions[sessionId]; | ||
semotus.logger.debug({ component: 'semotus', module: 'restore', activity: 'save' }); | ||
@@ -134,8 +134,8 @@ if (session) { | ||
function save(semotus, sessionId) { | ||
var session = get(semotus, sessionId); | ||
const session = get(semotus, sessionId); | ||
session.nextSaveSessionId = session.nextSaveSessionId + 1; | ||
session.savedSessionId = session.nextSaveSessionId; | ||
var objects = session.objects; | ||
const objects = session.objects; | ||
session.objects = {}; | ||
var savedSession = { | ||
const savedSession = { | ||
callCount: semotus.getPendingCallCount(sessionId), | ||
@@ -151,2 +151,2 @@ revision: session.savedSessionId, | ||
exports.save = save; | ||
//# sourceM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3QganVzdCByZXN0b3JlIG9uIGFub3RoZXIgc2VydmVyIGFuZCBjYXJyeSBvblxuICAgICAgICByZXZpc2lvbjogc2Vzc2lvbi5zYXZlZFNlc3Npb25JZCwgLy8gVXNlZCB0byBzZWUgaWYgb3VyIG1lbW9yeSBjb3B5IGdvb2QgZW5vdWdoXG4gICAgICAgIHJlZmVyZW5jZWQ6IG5ldyBEYXRlKCkuZ2V0VGltZSgpLCAvLyBVc2VkIGZvciByZWFwaW5nIG9sZCBzZXNzaW9uc1xuICAgICAgICBkYXRhOiBKU09OLnN0cmluZ2lmeShzZXNzaW9uKSAvLyBBbGwgdGhlIHNlc3Npb24gZGF0YVxuICAgIH07XG5cbiAgICBzZXNzaW9uLm9iamVjdHMgPSBvYmplY3RzO1xuICAgIHNlbW90dXMubG9nZ2VyLmRlYnVnKHtjb21wb25lbnQ6ICdzZW1vdHVzJywgbW9kdWxlOiAnc2F2ZScsIGFjdGl2aXR5OiAnc2F2ZSd9KTtcblxuICAgIHJldHVybiBzYXZlZFNlc3Npb247XG59XG4iXX0= |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.subscribe = exports.getSubscriptions = exports.getSubscription = void 0; | ||
var Sessions = require("./Sessions"); | ||
const Sessions = require("./Sessions"); | ||
/** | ||
@@ -30,3 +30,3 @@ * Purpose unknown | ||
function getSubscriptions(semotus, sessionId) { | ||
var session = Sessions.get(semotus, sessionId); | ||
const session = Sessions.get(semotus, sessionId); | ||
if (session) { | ||
@@ -51,4 +51,4 @@ return session.subscriptions; | ||
function subscribe(semotus, role) { | ||
var session = Sessions.get(semotus); | ||
var subscriptionId = session.nextSubscriptionId++; | ||
const session = Sessions.get(semotus); | ||
const subscriptionId = session.nextSubscriptionId++; | ||
session.subscriptions[subscriptionId] = { | ||
@@ -65,2 +65,2 @@ role: role, | ||
exports.subscribe = subscribe; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3Vic2Ny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AgICAgICByZXR1cm4gc2Vzc2lvbi5zdWJzY3JpcHRpb25zO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH1cbn1cblxuLyoqXG4gKiBTdWJzY3JpYmUgdG8gY2hhbmdlcyBhbmQgb3B0aW9uYWxseSBlc3RhYmxpc2ggc3Vic2NyaXB0aW9uIGFzIHRoZVxuICogc29sZSByZWNpcGllbnQgb2YgcmVtb3RlIGNhbGwgbWVzc2FnZXMuICBDaGFuZ2UgdHJhY2tpbmcgaXMgdGhlbiBtYW5hZ2VkXG4gKiBieSB0aGUgZnVuY3Rpb25zIHRoYXQgZm9sbG93LlxuICpcbiAqIEBwYXJhbSBzZW1vdHVzXG4gKiBAcGFyYW0ge3Vua25vd259IHJvbGUgdW5rbm93blxuICpcbiAqIEByZXR1cm5zIHsqfSB1bmtub3duXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBzdWJzY3JpYmUoc2Vtb3R1czogU2Vtb3R1cywgcm9sZSkge1xuICAgIGNvbnN0IHNlc3Npb24gPSBTZXNzaW9ucy5nZXQoc2Vtb3R1cyk7XG4gICAgY29uc3Qgc3Vic2NyaXB0aW9uSWQgPSBzZXNzaW9uLm5leHRTdWJzY3JpcHRpb25JZCsrO1xuXG4gICAgc2Vzc2lvbi5zdWJzY3JpcHRpb25zW3N1YnNjcmlwdGlvbklkXSA9IHtcbiAgICAgICAgcm9sZTogcm9sZSxcbiAgICAgICAgbG9nOiB7XG4gICAgICAgICAgICBhcnJheToge30sXG4gICAgICAgICAgICBjaGFuZ2U6IHt9LFxuICAgICAgICAgICAgYXJyYXlEaXJ0eToge31cbiAgICAgICAgfVxuICAgIH07XG5cbiAgICByZXR1cm4gc3Vic2NyaXB0aW9uSWQ7XG59Il19 |
@@ -6,7 +6,7 @@ "use strict"; | ||
function delay(ms) { | ||
return new Promise(function (_) { return setTimeout(_, ms); }); | ||
return new Promise(_ => setTimeout(_, ms)); | ||
} | ||
exports.delay = delay; | ||
function defer() { | ||
var result = {}; | ||
const result = {}; | ||
result.promise = new Promise(function (resolve, reject) { | ||
@@ -48,2 +48,2 @@ result.resolve = resolve; | ||
exports.logTime = logTime; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVXRpbGl0aWVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2hlbHBlcnMvVXRpbGl0aWVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSx3QkFBd0I7OztBQUl4QixTQUFnQixLQUFLLENBQUMsRUFBVTtJQUM1QixPQUFPLElBQUksT0FBTyxDQUFDLFVBQUEsQ0FBQyxJQUFJLE9BQUEsVUFBVSxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsRUFBakIsQ0FBaUIsQ0FBQyxDQUFDO0FBQy9DLENBQUM7QUFGRCxzQkFFQztBQUVELFNBQWdCLEtBQUs7SUFDakIsSUFBTSxNQUFNLEdBQW1ELEVBQUUsQ0FBQztJQUNsRSxNQUFNLENBQUMsT0FBTyxHQUFHLElBQUksT0FBTyxDQUFDLFVBQVUsT0FBTyxFQUFFLE1BQU07UUFDbEQsTUFBTSxDQUFDLE9BQU8sR0FBRyxPQUFPLENBQUM7UUFDekIsTUFBTSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUM7SUFDM0IsQ0FBQyxDQUFDLENBQUM7SUFDSCxPQUFPLE1BQU0sQ0FBQztBQUNsQixDQUFDO0FBUEQsc0JBT0M7QUFHRDs7Ozs7Ozs7O0dBU0c7QUFDSCxTQUFnQixRQUFRLENBQUMsR0FBRztJQUN4QixJQUFJLEdBQUcsWUFBWSxLQUFLLEVBQUU7UUFDdEIsT0FBTyxFQUFDLElBQUksRUFBRSxnQkFBZ0IsRUFBRSxJQUFJLEVBQUUsNEJBQTRCLEVBQUMsQ0FBQztLQUN2RTtTQUFNO1FBQ0gsSUFBSSxPQUFPLEdBQUcsS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JpbmcgdGhhdCB0aGUgYXBwbGljYXRpb24gbWF5XG4gKiB0aHJvdyB3aGljaCBpcyB0byBnZXQgcGlwZWQgYmFjayB0byB0aGUgY2FsbGVyLiAgRm9yIGFuIGFjdHVhbCBlcnJvciB3ZSB3YW50IHRvIGxvZyB0aGUgc3RhY2sgdHJhY2VcbiAqXG4gKiBAcGFyYW0gZXJyIHVua25vd25cbiAqXG4gKiBAcmV0dXJucyB7Kn0gdW5rbm93blxuICovXG5leHBvcnQgZnVuY3Rpb24gZ2V0RXJyb3IoZXJyKSB7XG4gICAgaWYgKGVyciBpbnN0YW5jZW9mIEVycm9yKSB7XG4gICAgICAgIHJldHVybiB7Y29kZTogJ2ludGVybmFsX2Vycm9yJywgdGV4dDogJ0FuIGludGVybmFsIGVycm9yIG9jY3VycmVkJ307XG4gICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKHR5cGVvZiBlcnIgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICByZXR1cm4ge21lc3NhZ2U6IGVycn07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gZXJyO1xuICAgICAgICB9XG4gICAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gbG9nVGltZShjYWxsQ29udGV4dDogQ2FsbENvbnRleHQpIHtcbiAgICByZXR1cm4gbmV3IERhdGUoKS5nZXRUaW1lKCkgLVxuICAgICAgICBjYWxsQ29udGV4dC5zdGFydFRpbWUuZ2V0VGltZSgpO1xufSJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVXRpbGl0aWVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2hlbHBlcnMvVXRpbGl0aWVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSx3QkFBd0I7OztBQUl4QixTQUFnQixLQUFLLENBQUMsRUFBVTtJQUM1QixPQUFPLElBQUksT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mFsX2Vycm9yJywgdGV4dDogJ0FuIGludGVybmFsIGVycm9yIG9jY3VycmVkJ307XG4gICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKHR5cGVvZiBlcnIgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICByZXR1cm4ge21lc3NhZ2U6IGVycn07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gZXJyO1xuICAgICAgICB9XG4gICAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gbG9nVGltZShjYWxsQ29udGV4dDogQ2FsbENvbnRleHQpIHtcbiAgICByZXR1cm4gbmV3IERhdGUoKS5nZXRUaW1lKCkgLVxuICAgICAgICBjYWxsQ29udGV4dC5zdGFydFRpbWUuZ2V0VGltZSgpO1xufSJdfQ== |
@@ -6,5 +6,5 @@ "use strict"; | ||
exports.Bindable = exports.Remoteable = exports.Persistable = void 0; | ||
var __extends = (this && this.__extends) || | ||
const __extends = (this && this.__extends) || | ||
(function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
const extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && | ||
@@ -59,2 +59,2 @@ function (d, b) { | ||
exports.Bindable = Bindable; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2V0dXBFeHRlbmRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL3NldHVwRXh0ZW5kcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsa0hBQWtIO0FBQ2xILCtFQUErRTs7O0FBRS9FLElBQU0sU0FBUyxHQUNYLENBQUMsSUFBSSxJQUFJLElBQUksQ0FBQyxTQUFTLENBQUM7SUFDeEIsQ0FBQztRQUNHLElBQU0sYUFBYSxHQUNmLE1BQU0sQ0FBQyxjQUFjO1lBQ3JCLENBQUMsRUFBQyxTQUFTLEVBQUUsRUFBRSxFQUFDLFlBQVksS0FBSztnQ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WQgYmVjYXVzZSBpbiB0aGUgYnJvd3NlciB3ZSBvbmx5IGluY2x1ZGUgc3VwZXJ0eXBlIGFuZCBzZW1vdHVzXG4vLyBhbmQgc2luY2UgY2xhc3NlcyB1c2UgdGhlc2UgaW4gdGhlaXIgZXh0ZW5kcyBoaWVyYXJjaHkgdGhleSBtdXN0IGJlIGRlZmluZWQuXG5cbmNvbnN0IF9fZXh0ZW5kcyA9XG4gICAgKHRoaXMgJiYgdGhpcy5fX2V4dGVuZHMpIHx8XG4gICAgKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgY29uc3QgZXh0ZW5kU3RhdGljcyA9XG4gICAgICAgICAgICBPYmplY3Quc2V0UHJvdG90eXBlT2YgfHxcbiAgICAgICAgICAgICh7X19wcm90b19fOiBbXX0gaW5zdGFuY2VvZiBBcnJheSAmJlxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIChkLCBiKSB7XG4gICAgICAgICAgICAgICAgICAgIGQuX19wcm90b19fID0gYjtcbiAgICAgICAgICAgICAgICB9KSB8fFxuICAgICAgICAgICAgZnVuY3Rpb24gKGQsIGIpIHtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBwIGluIGIpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGIuaGFzT3duUHJvcGVydHkocCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRbcF0gPSBiW3BdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIChkLCBiKSB7XG4gICAgICAgICAgICBleHRlbmRTdGF0aWNzKGQsIGIpO1xuXG4gICAgICAgICAgICBmdW5jdGlvbiBfXygpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbnN0cnVjdG9yID0gZDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZC5wcm90b3R5cGUgPSBiID09PSBudWxsID8gT2JqZWN0LmNyZWF0Z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gICAgICAgZnVuY3Rpb24gKGQsIGIpIHtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBwIGluIGIpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGIuaGFzT3duUHJvcGVydHkocCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRbcF0gPSBiW3BdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIChkLCBiKSB7XG4gICAgICAgICAgICBleHRlbmRTdGF0aWNzKGQsIGIpO1xuXG4gICAgICAgICAgICBmdW5jdGlvbiBfXygpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbnN0cnVjdG9yID0gZDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZC5wcm90b3R5cGUgPSBiID09PSBudWxsID8gT2JqZWN0LmNyZWF0ZShiKSA6ICgoX18ucHJvdG90eXBlID0gYi5wcm90b3R5cGUpLCBuZXcgX18oKSk7XG4gICAgICAgIH07XG4gICAgfSkoKTtcblxuZXhwb3J0IGZ1bmN0aW9uIFBlcnNpc3RhYmxlKEJhc2UpIHtcbiAgICByZXR1cm4gKGZ1bmN0aW9uIChfc3VwZXIpIHtcbiAgICAgICAgX19leHRlbmRzKGNsYXNzXzEsIF9zdXBlcik7XG5cbiAgICAgICAgZnVuY3Rpb24gY2xhc3NfMSgpIHtcbiAgICAgICAgICAgIHJldHVybiAoX3N1cGVyICE9PSBudWxsICYmIF9zdXBlci5hcHBseSh0aGlzLCBhcmd1bWVudHMpKSB8fCB0aGlzO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGNsYXNzXzE7XG4gICAgfSkoQmFzZSlcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIFJlbW90ZWFibGUoQmFzZSkge1xuICAgIHJldHVybiAoZnVuY3Rpb24gKF9zdXBlcikge1xuICAgICAgICBfX2V4dGVuZHMoY2xhc3NfMSwgX3N1cGVyKTtcblxuICAgICAgICBmdW5jdGlvbiBjbGFzc18xKCkge1xuICAgICAgICAgICAgcmV0dXJuIChfc3VwZXIgIT09IG51bGwgJiYgX3N1cGVyLmFwcGx5KHRoaXMsIGFyZ3VtZW50cykpIHx8IHRoaXM7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gY2xhc3NfMTtcbiAgICB9KShCYXNlKVxufVxuXG5leHBvcnQgZnVuY3Rpb24gQmluZGFibGUoQmFzZSkge1xuICAgIHJldHVybiAoZnVuY3Rpb24gKF9zdXBlcikge1xuICAgICAgICBfX2V4dGVuZHMoY2xhc3NfMSwgX3N1cGVyKTtcblxuICAgICAgICBmdW5jdGlvbiBjbGFzc18xKCkge1xuICAgICAgICAgICAgcmV0dXJuIChfc3VwZXIgIT09IG51bGwgJiYgX3N1cGVyLmFwcGx5KHRoaXMsIGFyZ3VtZW50cykpIHx8IHRoaXM7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gY2xhc3NfMTtcbiAgICB9KShCYXNlKVxufVxuXG5cbiJdfQ== |
@@ -0,1 +1,4 @@ | ||
## 7.0.0 | ||
* target es2020 | ||
* use supertype 6, remove emitDecoratorMetadata | ||
## 6.0.1 | ||
@@ -2,0 +5,0 @@ * bump nconf version due to security vulnerability. |
{ | ||
"name": "@haventech/semotus", | ||
"version": "6.0.1", | ||
"version": "7.0.0-beta.1", | ||
"description": "A subclass of supertype that synchronizes sets of objects.", | ||
@@ -30,3 +30,3 @@ "homepage": "https://github.com/haven-life/amorphic-framework", | ||
"setup": "npm install", | ||
"test": "mocha -- test/types.js test/javascript/semotus.js", | ||
"test": "mocha -- test/javascript/types.js test/javascript/semotus.js", | ||
"test:ts": "npm run test:ts:supertype && npm run test:ts:syncstates", | ||
@@ -41,3 +41,3 @@ "test:ts:compiled": "mocha test/supertype/semotus.js", | ||
"devDependencies": { | ||
"@haventech/supertype": "5.x", | ||
"@haventech/supertype": "6.0.0-beta.3", | ||
"@types/chai": "4.3.0", | ||
@@ -44,0 +44,0 @@ "@types/express": "4.17.13", |
@@ -90,3 +90,3 @@ /** | ||
export function Supertype(template, objectTemplate, Supertype) { | ||
return Supertype.call(template, objectTemplate); | ||
return Reflect.construct( Supertype, [objectTemplate], template.constructor ); | ||
} | ||
@@ -93,0 +93,0 @@ |
Sorry, the diff of this file is too big to display
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
557820
6536
1
1