@kizahasi/flocon-core
Advanced tools
Comparing version 0.13.0 to 0.13.1
@@ -22,3 +22,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.clientTransform = exports.serverTransform = exports.diff = exports.restore = exports.composeDownOperation = exports.composeUpOperation = exports.applyBack = exports.apply = exports.toUpOperation = exports.toDownOperation = exports.toClientOperation = exports.toClientState = exports.upOperation = exports.downOperation = exports.state = void 0; | ||
exports.clientTransform = exports.serverTransform = exports.diff = exports.restore = exports.composeDownOperation = exports.applyBack = exports.apply = exports.toUpOperation = exports.toDownOperation = exports.toClientOperation = exports.toClientState = exports.upOperation = exports.downOperation = exports.state = void 0; | ||
const t = __importStar(require("io-ts")); | ||
@@ -29,10 +29,14 @@ const TextOperation = __importStar(require("../../../util/textOperation")); | ||
const result_1 = require("@kizahasi/result"); | ||
const ReplaceOperation = __importStar(require("../../../util/replaceOperation")); | ||
exports.state = t.type({ | ||
$version: t.literal(1), | ||
name: t.string, | ||
value: t.string, | ||
}); | ||
exports.downOperation = createOperation_1.createOperation(1, { | ||
name: t.type({ oldValue: t.string }), | ||
value: TextOperation.downOperation, | ||
}); | ||
exports.upOperation = createOperation_1.createOperation(1, { | ||
name: t.type({ newValue: t.string }), | ||
value: TextOperation.upOperation, | ||
@@ -67,2 +71,5 @@ }); | ||
const result = { ...state }; | ||
if (operation.name != null) { | ||
result.name = operation.name.newValue; | ||
} | ||
if (operation.value != null) { | ||
@@ -80,2 +87,5 @@ const valueResult = TextOperation.apply(state.value, operation.value); | ||
const result = { ...state }; | ||
if (operation.name != null) { | ||
result.name = operation.name.oldValue; | ||
} | ||
if (operation.value !== undefined) { | ||
@@ -91,14 +101,2 @@ const prevValue = TextOperation.applyBack(state.value, operation.value); | ||
exports.applyBack = applyBack; | ||
const composeUpOperation = ({ first, second }) => { | ||
const value = TextOperation.composeUpOperation(first.value, second.value); | ||
if (value.isError) { | ||
return value; | ||
} | ||
const valueProps = { | ||
$version: 1, | ||
value: value.value, | ||
}; | ||
return result_1.Result.ok(valueProps); | ||
}; | ||
exports.composeUpOperation = composeUpOperation; | ||
const composeDownOperation = ({ first, second }) => { | ||
@@ -111,2 +109,3 @@ const value = TextOperation.composeDownOperation(first.value, second.value); | ||
$version: 1, | ||
name: ReplaceOperation.composeDownOperation(first.name, second.name), | ||
value: value.value, | ||
@@ -118,3 +117,3 @@ }; | ||
const restore = ({ nextState, downOperation, }) => { | ||
if (downOperation === undefined) { | ||
if (downOperation == null) { | ||
return result_1.Result.ok({ | ||
@@ -128,3 +127,10 @@ prevState: nextState, | ||
const twoWayOperation = { $version: 1 }; | ||
if (downOperation.value !== undefined) { | ||
if (downOperation.name != null) { | ||
prevState.name = downOperation.name.oldValue; | ||
twoWayOperation.name = { | ||
oldValue: downOperation.name.oldValue, | ||
newValue: nextState.name, | ||
}; | ||
} | ||
if (downOperation.value != null) { | ||
const restored = TextOperation.restore({ | ||
@@ -145,2 +151,8 @@ nextState: nextState.value, | ||
const resultType = { $version: 1 }; | ||
if (prevState.name !== nextState.name) { | ||
resultType.name = { | ||
oldValue: prevState.name, | ||
newValue: nextState.name, | ||
}; | ||
} | ||
if (prevState.value !== nextState.value) { | ||
@@ -159,4 +171,11 @@ resultType.value = TextOperation.diff({ | ||
const serverTransform = ({ prevState, currentState, clientOperation, serverOperation, }) => { | ||
const twoWayOperation = { $version: 1 }; | ||
const transformed = TextOperation.serverTransform({ | ||
const twoWayOperation = { | ||
$version: 1, | ||
name: ReplaceOperation.serverTransform({ | ||
first: serverOperation === null || serverOperation === void 0 ? void 0 : serverOperation.name, | ||
second: clientOperation.name, | ||
prevState: prevState.name, | ||
}), | ||
}; | ||
const value = TextOperation.serverTransform({ | ||
first: serverOperation === null || serverOperation === void 0 ? void 0 : serverOperation.value, | ||
@@ -166,6 +185,6 @@ second: clientOperation.value, | ||
}); | ||
if (transformed.isError) { | ||
return transformed; | ||
if (value.isError) { | ||
return value; | ||
} | ||
twoWayOperation.value = transformed.value.secondPrime; | ||
twoWayOperation.value = value.value.secondPrime; | ||
if (record_1.isIdRecord(twoWayOperation)) { | ||
@@ -178,2 +197,3 @@ return result_1.Result.ok(undefined); | ||
const clientTransform = ({ first, second }) => { | ||
const name = ReplaceOperation.clientTransform({ first: first.name, second: second.name }); | ||
const value = TextOperation.clientTransform({ | ||
@@ -188,2 +208,3 @@ first: first.value, | ||
$version: 1, | ||
name: name.firstPrime, | ||
value: value.value.firstPrime, | ||
@@ -193,2 +214,3 @@ }; | ||
$version: 1, | ||
name: name.secondPrime, | ||
value: value.value.secondPrime, | ||
@@ -202,2 +224,2 @@ }; | ||
exports.clientTransform = clientTransform; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidjEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvaW50ZXJuYWwvb3Qvcm9vbS9jaGFyYWN0ZXIvY29tbWFuZC92MS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEseUNBQTJCO0FBQzNCLDJFQUE2RDtBQVU3RCxtRUFBZ0U7QUFDaEUsaURBQWtEO0FBQ2xELDZDQUEwQztBQUU3QixRQUFBLEtBQUssR0FBRyxDQUFDLENBQUMsSUFBSSxDQUFDO0lBQ3hCLFFBQVEsRUFBRSxDQUFDLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQztJQUV0QixLQUFLLEVBQUUsQ0FBQyxDQUFDLE1BQU07Q0FDbEIsQ0FBQyxDQUFDO0FBSVUsUUFBQSxhQUFhLEdBQUcsaUNBQWUsQ0FBQyxDQUFDLEVBQUU7SUFDNUMsS0FBSyxFQUFFLGFBQWEsQ0FBQyxhQUFhO0NBQ3JDLENBQUMsQ0FBQztBQUlVLFFBQUEsV0FBVyxHQUFHLGlDQUFlLENBQUMsQ0FBQyxFQUFFO0lBQzFDLEtBQUssRUFBRSx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5hbWUgfSk7XHJcblxyXG4gICAgY29uc3QgdmFsdWUgPSBUZXh0T3BlcmF0aW9uLmNsaWVudFRyYW5zZm9ybSh7XHJcbiAgICAgICAgZmlyc3Q6IGZpcnN0LnZhbHVlLFxyXG4gICAgICAgIHNlY29uZDogc2Vjb25kLnZhbHVlLFxyXG4gICAgfSk7XHJcbiAgICBpZiAodmFsdWUuaXNFcnJvcikge1xyXG4gICAgICAgIHJldHVybiB2YWx1ZTtcclxuICAgIH1cclxuXHJcbiAgICBjb25zdCBmaXJzdFByaW1lOiBVcE9wZXJhdGlvbiA9IHtcclxuICAgICAgICAkdmVyc2lvbjogMSxcclxuICAgICAgICBuYW1lOiBuYW1lLmZpcnN0UHJpbWUsXHJcbiAgICAgICAgdmFsdWU6IHZhbHVlLnZhbHVlLmZpcnN0UHJpbWUsXHJcbiAgICB9O1xyXG5cclxuICAgIGNvbnN0IHNlY29uZFByaW1lOiBVcE9wZXJhdGlvbiA9IHtcclxuICAgICAgICAkdmVyc2lvbjogMSxcclxuICAgICAgICBuYW1lOiBuYW1lLnNlY29uZFByaW1lLFxyXG4gICAgICAgIHZhbHVlOiB2YWx1ZS52YWx1ZS5zZWNvbmRQcmltZSxcclxuICAgIH07XHJcblxyXG4gICAgcmV0dXJuIFJlc3VsdC5vayh7XHJcbiAgICAgICAgZmlyc3RQcmltZTogaXNJZFJlY29yZChmaXJzdFByaW1lKSA/IHVuZGVmaW5lZCA6IGZpcnN0UHJpbWUsXHJcbiAgICAgICAgc2Vjb25kUHJpbWU6IGlzSWRSZWNvcmQoc2Vjb25kUHJpbWUpID8gdW5kZWZpbmVkIDogc2Vjb25kUHJpbWUsXHJcbiAgICB9KTtcclxufTtcclxuIl19 |
@@ -6,10 +6,14 @@ import * as t from 'io-ts'; | ||
import { Result } from '@kizahasi/result'; | ||
import * as ReplaceOperation from '../../../util/replaceOperation'; | ||
export const state = t.type({ | ||
$version: t.literal(1), | ||
name: t.string, | ||
value: t.string, | ||
}); | ||
export const downOperation = createOperation(1, { | ||
name: t.type({ oldValue: t.string }), | ||
value: TextOperation.downOperation, | ||
}); | ||
export const upOperation = createOperation(1, { | ||
name: t.type({ newValue: t.string }), | ||
value: TextOperation.upOperation, | ||
@@ -40,2 +44,5 @@ }); | ||
const result = { ...state }; | ||
if (operation.name != null) { | ||
result.name = operation.name.newValue; | ||
} | ||
if (operation.value != null) { | ||
@@ -52,2 +59,5 @@ const valueResult = TextOperation.apply(state.value, operation.value); | ||
const result = { ...state }; | ||
if (operation.name != null) { | ||
result.name = operation.name.oldValue; | ||
} | ||
if (operation.value !== undefined) { | ||
@@ -62,13 +72,2 @@ const prevValue = TextOperation.applyBack(state.value, operation.value); | ||
}; | ||
export const composeUpOperation = ({ first, second }) => { | ||
const value = TextOperation.composeUpOperation(first.value, second.value); | ||
if (value.isError) { | ||
return value; | ||
} | ||
const valueProps = { | ||
$version: 1, | ||
value: value.value, | ||
}; | ||
return Result.ok(valueProps); | ||
}; | ||
export const composeDownOperation = ({ first, second }) => { | ||
@@ -81,2 +80,3 @@ const value = TextOperation.composeDownOperation(first.value, second.value); | ||
$version: 1, | ||
name: ReplaceOperation.composeDownOperation(first.name, second.name), | ||
value: value.value, | ||
@@ -87,3 +87,3 @@ }; | ||
export const restore = ({ nextState, downOperation, }) => { | ||
if (downOperation === undefined) { | ||
if (downOperation == null) { | ||
return Result.ok({ | ||
@@ -97,3 +97,10 @@ prevState: nextState, | ||
const twoWayOperation = { $version: 1 }; | ||
if (downOperation.value !== undefined) { | ||
if (downOperation.name != null) { | ||
prevState.name = downOperation.name.oldValue; | ||
twoWayOperation.name = { | ||
oldValue: downOperation.name.oldValue, | ||
newValue: nextState.name, | ||
}; | ||
} | ||
if (downOperation.value != null) { | ||
const restored = TextOperation.restore({ | ||
@@ -113,2 +120,8 @@ nextState: nextState.value, | ||
const resultType = { $version: 1 }; | ||
if (prevState.name !== nextState.name) { | ||
resultType.name = { | ||
oldValue: prevState.name, | ||
newValue: nextState.name, | ||
}; | ||
} | ||
if (prevState.value !== nextState.value) { | ||
@@ -126,4 +139,11 @@ resultType.value = TextOperation.diff({ | ||
export const serverTransform = ({ prevState, currentState, clientOperation, serverOperation, }) => { | ||
const twoWayOperation = { $version: 1 }; | ||
const transformed = TextOperation.serverTransform({ | ||
const twoWayOperation = { | ||
$version: 1, | ||
name: ReplaceOperation.serverTransform({ | ||
first: serverOperation === null || serverOperation === void 0 ? void 0 : serverOperation.name, | ||
second: clientOperation.name, | ||
prevState: prevState.name, | ||
}), | ||
}; | ||
const value = TextOperation.serverTransform({ | ||
first: serverOperation === null || serverOperation === void 0 ? void 0 : serverOperation.value, | ||
@@ -133,6 +153,6 @@ second: clientOperation.value, | ||
}); | ||
if (transformed.isError) { | ||
return transformed; | ||
if (value.isError) { | ||
return value; | ||
} | ||
twoWayOperation.value = transformed.value.secondPrime; | ||
twoWayOperation.value = value.value.secondPrime; | ||
if (isIdRecord(twoWayOperation)) { | ||
@@ -144,2 +164,3 @@ return Result.ok(undefined); | ||
export const clientTransform = ({ first, second }) => { | ||
const name = ReplaceOperation.clientTransform({ first: first.name, second: second.name }); | ||
const value = TextOperation.clientTransform({ | ||
@@ -154,2 +175,3 @@ first: first.value, | ||
$version: 1, | ||
name: name.firstPrime, | ||
value: value.value.firstPrime, | ||
@@ -159,2 +181,3 @@ }; | ||
$version: 1, | ||
name: name.secondPrime, | ||
value: value.value.secondPrime, | ||
@@ -167,2 +190,2 @@ }; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidjEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvaW50ZXJuYWwvb3Qvcm9vbS9jaGFyYWN0ZXIvY29tbWFuZC92MS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssQ0FBQyxNQUFNLE9BQU8sQ0FBQztBQUMzQixPQUFPLEtBQUssY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dGUsIERvd25PcGVyYXRpb24sIFR3b1dheU9wZXJhdGlvbj4gPSAoe1xyXG4gICAgbmV4dFN0YXRlLFxyXG4gICAgZG93bk9wZXJhdGlvbixcclxufSkgPT4ge1xyXG4gICAgaWYgKGRvd25PcGVyYXRpb24gPT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgIHJldHVybiBSZXN1bHQub2soe1xyXG4gICAgICAgICAgICBwcmV2U3RhdGU6IG5leHRTdGF0ZSxcclxuICAgICAgICAgICAgbmV4dFN0YXRlLFxyXG4gICAgICAgICAgICB0d29XYXlPcGVyYXRpb246IHVuZGVmaW5lZCxcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuXHJcbiAgICBjb25zdCBwcmV2U3RhdGU6IFN0YXRlID0geyAuLi5uZXh0U3RhdGUgfTtcclxuICAgIGNvbnN0IHR3b1dheU9wZXJhdGlvbjogVHdvV2F5T3BlcmF0aW9uID0geyAkdmVyc2lvbjogMSB9O1xyXG5cclxuICAgIGlmIChkb3duT3BlcmF0aW9uLnZhbHVlICE9PSB1bmRlZmluZWQpIHtcclxuICAgICAgICBjb25zdCByZXN0b3JlZCA9IFRleHRPcGVyYXRpb24ucmVzdG9yZSh7XHJcbiAgICAgICAgICAgIG5leHRTdGF0ZTogbmV4dFN0YXRlLnZhbHVlLFxyXG4gICAgICAgICAgICBkb3duT3BlcmF0aW9uOiBkb3duT3BlcmF0aW9uLnZhbHVlLFxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGlmIChyZXN0b3JlZC5pc0Vycm9yKSB7XHJcbiAgICAgICAgICAgIHJldHVybiByZXN0b3JlZDtcclxuICAgICAgICB9XHJcbiAgICAgICAgcHJldlN0YXRlLnZhbHVlID0gcmVzdG9yZWQudmFsdWUucHJldlN0YXRlO1xyXG4gICAgICAgIHR3b1dheU9wZXJhdGlvbi52YWx1ZSA9IHJlc3RvcmVkLnZhbHVlLnR3b1dheU9wZXJhdGlvbjtcclxuICAgIH1cclxuXHJcbiAgICByZX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Aoe1xyXG4gICAgbmV4dFN0YXRlLFxyXG4gICAgZG93bk9wZXJhdGlvbixcclxufSkgPT4ge1xyXG4gICAgaWYgKGRvd25PcGVyYXRpb24gPT0gbnVsbCkge1xyXG4gICAgICAgIHJldHVybiBSZXN1bHQub2soe1xyXG4gICAgICAgICAgICBwcmV2U3RhdGU6IG5leHRTdGF0ZSxcclxuICAgICAgICAgICAgbmV4dFN0YXRlLFxyXG4gICAgICAgICAgICB0d29XYXlPcGVyYXRpb246IHVuZGVmaW5lZCxcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuXHJcbiAgICBjb25zdCBwcmV2U3RhdGU6IFN0YXRlID0geyAuLi5uZXh0U3RhdGUgfTtcclxuICAgIGNvbnN0IHR3b1dheU9wZXJhdGlvbjogVHdvV2F5T3BlcmF0aW9uID0geyAkdmVyc2lvbjogMSB9O1xyXG5cclxuICAgIGlmIChkb3duT3BlcmF0aW9uLm5hbWUgIT0gbnVsbCkge1xyXG4gICAgICAgIHByZXZTdGF0ZS5uYW1lID0gZG93bk9wZXJhdGlvbi5uYW1lLm9sZFZhbHVlO1xyXG4gICAgICAgIHR3b1dheU9wZXJhdGlvbi5uYW1lID0ge1xyXG4gICAgICAgICAgICBvbGRWYWx1ZTogZG93bk9wZXJhdGlvbi5uYW1lLm9sZFZhbHVlLFxyXG4gICAgICAgICAgICBuZXdWYWx1ZTogbmV4dFN0YXRlLm5hbWUsXHJcbiAgICAgICAgfTtcclxuICAgIH1cclxuXHJcbiAgICBpZiAoZG93bk9wZXJhdGlvbi52YWx1ZSAhPSBudWxsKSB7XHJcbiAgICAgICAgY29uc3QgcmVzdG9yZWQgPSBUZXh0T3BlcmF0aW9uLnJlc3RvcmUoe1xyXG4gICAgICAgICAgICBuZXh0U3RhdGU6IG5leHRTdGF0ZS52YWx1ZSxcclxuICAgICAgICAgICAgZG93bk9wZXJhdGlvbjogZG93bk9wZXJhdGlvbi52YWx1ZSxcclxuICAgICAgICB9KTtcclxuICAgICAgICBpZ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ZS5zZWNvbmRQcmltZSxcclxuICAgICAgICB2YWx1ZTogdmFsdWUudmFsdWUuc2Vjb25kUHJpbWUsXHJcbiAgICB9O1xyXG5cclxuICAgIHJldHVybiBSZXN1bHQub2soe1xyXG4gICAgICAgIGZpcnN0UHJpbWU6IGlzSWRSZWNvcmQoZmlyc3RQcmltZSkgPyB1bmRlZmluZWQgOiBmaXJzdFByaW1lLFxyXG4gICAgICAgIHNlY29uZFByaW1lOiBpc0lkUmVjb3JkKHNlY29uZFByaW1lKSA/IHVuZGVmaW5lZCA6IHNlY29uZFByaW1lLFxyXG4gICAgfSk7XHJcbn07XHJcbiJdfQ== |
import * as t from 'io-ts'; | ||
import * as TextOperation from '../../../util/textOperation'; | ||
import { Apply, ClientTransform, Compose, Diff, Restore, ServerTransform, ToClientOperationParams } from '../../../util/type'; | ||
import * as ReplaceOperation from '../../../util/replaceOperation'; | ||
export declare const state: t.TypeC<{ | ||
$version: t.LiteralC<1>; | ||
name: t.StringC; | ||
value: t.StringC; | ||
@@ -12,2 +14,5 @@ }>; | ||
}>, t.PartialC<{ | ||
name: t.TypeC<{ | ||
oldValue: t.StringC; | ||
}>; | ||
value: t.ArrayC<t.UnionC<[t.TypeC<{ | ||
@@ -28,2 +33,5 @@ t: t.LiteralC<"r">; | ||
}>, t.PartialC<{ | ||
name: t.TypeC<{ | ||
newValue: t.StringC; | ||
}>; | ||
value: t.ArrayC<t.UnionC<[t.TypeC<{ | ||
@@ -43,2 +51,3 @@ t: t.LiteralC<"r">; | ||
$version: 1; | ||
name?: ReplaceOperation.ReplaceValueTwoWayOperation<string>; | ||
value?: TextOperation.TwoWayOperation; | ||
@@ -52,3 +61,2 @@ }; | ||
export declare const applyBack: Apply<State, DownOperation>; | ||
export declare const composeUpOperation: Compose<UpOperation>; | ||
export declare const composeDownOperation: Compose<DownOperation>; | ||
@@ -55,0 +63,0 @@ export declare const restore: Restore<State, DownOperation, TwoWayOperation>; |
@@ -71,2 +71,3 @@ import * as t from 'io-ts'; | ||
$version: t.LiteralC<1>; | ||
name: t.StringC; | ||
value: t.StringC; | ||
@@ -283,2 +284,3 @@ }>, t.UndefinedC]>>; | ||
$version: t.LiteralC<1>; | ||
name: t.StringC; | ||
value: t.StringC; | ||
@@ -292,2 +294,5 @@ }>; | ||
}>, t.PartialC<{ | ||
name: t.TypeC<{ | ||
oldValue: t.StringC; | ||
}>; | ||
value: t.ArrayC<t.UnionC<[t.TypeC<{ | ||
@@ -702,2 +707,3 @@ t: t.LiteralC<"r">; | ||
$version: t.LiteralC<1>; | ||
name: t.StringC; | ||
value: t.StringC; | ||
@@ -711,2 +717,5 @@ }>; | ||
}>, t.PartialC<{ | ||
name: t.TypeC<{ | ||
newValue: t.StringC; | ||
}>; | ||
value: t.ArrayC<t.UnionC<[t.TypeC<{ | ||
@@ -713,0 +722,0 @@ t: t.LiteralC<"r">; |
{ | ||
"version": "0.13.0", | ||
"version": "0.13.1", | ||
"license": "MIT", | ||
@@ -4,0 +4,0 @@ "main": "dist/cjs/index.js", |
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
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
2819245
23338