@fluid-experimental/property-properties 0.58.1001 → 0.58.2000-58133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/containerSerializer.d.ts.map +1 -1
- package/dist/containerSerializer.js +4 -10
- package/dist/containerSerializer.js.map +1 -1
- package/dist/enableValidations.d.ts.map +1 -1
- package/dist/enableValidations.js +1 -1
- package/dist/enableValidations.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
- package/dist/properties/abstractStaticCollectionProperty.js +1 -28
- package/dist/properties/abstractStaticCollectionProperty.js.map +1 -1
- package/dist/properties/arrayProperty.d.ts.map +1 -1
- package/dist/properties/arrayProperty.js +26 -85
- package/dist/properties/arrayProperty.js.map +1 -1
- package/dist/properties/baseProperty.d.ts.map +1 -1
- package/dist/properties/baseProperty.js +9 -71
- package/dist/properties/baseProperty.js.map +1 -1
- package/dist/properties/boolProperty.d.ts.map +1 -1
- package/dist/properties/boolProperty.js +0 -1
- package/dist/properties/boolProperty.js.map +1 -1
- package/dist/properties/containerProperty.d.ts.map +1 -1
- package/dist/properties/containerProperty.js +4 -22
- package/dist/properties/containerProperty.js.map +1 -1
- package/dist/properties/enumArrayProperty.d.ts.map +1 -1
- package/dist/properties/enumArrayProperty.js +2 -14
- package/dist/properties/enumArrayProperty.js.map +1 -1
- package/dist/properties/enumProperty.d.ts.map +1 -1
- package/dist/properties/enumProperty.js +3 -10
- package/dist/properties/enumProperty.js.map +1 -1
- package/dist/properties/floatProperties.js +0 -2
- package/dist/properties/floatProperties.js.map +1 -1
- package/dist/properties/index.d.ts +7 -38
- package/dist/properties/index.d.ts.map +1 -1
- package/dist/properties/index.js +37 -68
- package/dist/properties/index.js.map +1 -1
- package/dist/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
- package/dist/properties/indexedCollectionBaseProperty.js +6 -18
- package/dist/properties/indexedCollectionBaseProperty.js.map +1 -1
- package/dist/properties/intProperties.d.ts.map +1 -1
- package/dist/properties/intProperties.js +3 -20
- package/dist/properties/intProperties.js.map +1 -1
- package/dist/properties/lazyLoadedProperties.js.map +1 -1
- package/dist/properties/mapProperty.d.ts.map +1 -1
- package/dist/properties/mapProperty.js +4 -23
- package/dist/properties/mapProperty.js.map +1 -1
- package/dist/properties/namedNodeProperty.d.ts.map +1 -1
- package/dist/properties/namedNodeProperty.js.map +1 -1
- package/dist/properties/namedProperty.d.ts.map +1 -1
- package/dist/properties/namedProperty.js +0 -3
- package/dist/properties/namedProperty.js.map +1 -1
- package/dist/properties/nodeProperty.d.ts.map +1 -1
- package/dist/properties/nodeProperty.js +0 -3
- package/dist/properties/nodeProperty.js.map +1 -1
- package/dist/properties/primitiveTypeCasts.d.ts.map +1 -1
- package/dist/properties/primitiveTypeCasts.js +2 -2
- package/dist/properties/primitiveTypeCasts.js.map +1 -1
- package/dist/properties/referenceArrayProperty.d.ts.map +1 -1
- package/dist/properties/referenceArrayProperty.js +3 -16
- package/dist/properties/referenceArrayProperty.js.map +1 -1
- package/dist/properties/referenceMapProperty.d.ts.map +1 -1
- package/dist/properties/referenceMapProperty.js +3 -13
- package/dist/properties/referenceMapProperty.js.map +1 -1
- package/dist/properties/referenceProperty.d.ts.map +1 -1
- package/dist/properties/referenceProperty.js +4 -12
- package/dist/properties/referenceProperty.js.map +1 -1
- package/dist/properties/setProperty.d.ts.map +1 -1
- package/dist/properties/setProperty.js +3 -22
- package/dist/properties/setProperty.js.map +1 -1
- package/dist/properties/stringProperty.d.ts.map +1 -1
- package/dist/properties/stringProperty.js +12 -48
- package/dist/properties/stringProperty.js.map +1 -1
- package/dist/properties/uintProperties.js +0 -3
- package/dist/properties/uintProperties.js.map +1 -1
- package/dist/properties/valueArrayProperty.d.ts.map +1 -1
- package/dist/properties/valueArrayProperty.js +3 -45
- package/dist/properties/valueArrayProperty.js.map +1 -1
- package/dist/properties/valueMapProperty.d.ts.map +1 -1
- package/dist/properties/valueMapProperty.js +4 -29
- package/dist/properties/valueMapProperty.js.map +1 -1
- package/dist/properties/valueProperty.d.ts.map +1 -1
- package/dist/properties/valueProperty.js +2 -14
- package/dist/properties/valueProperty.js.map +1 -1
- package/dist/propertyFactory.d.ts.map +1 -1
- package/dist/propertyFactory.js +35 -72
- package/dist/propertyFactory.js.map +1 -1
- package/dist/propertyTemplate.d.ts.map +1 -1
- package/dist/propertyTemplate.js +0 -14
- package/dist/propertyTemplate.js.map +1 -1
- package/dist/propertyTemplateWrapper.d.ts.map +1 -1
- package/dist/propertyTemplateWrapper.js +4 -12
- package/dist/propertyTemplateWrapper.js.map +1 -1
- package/dist/propertyUtils.d.ts.map +1 -1
- package/dist/propertyUtils.js.map +1 -1
- package/dist/test/properties/arrayProperty.spec.js +82 -82
- package/dist/test/properties/arrayProperty.spec.js.map +1 -1
- package/dist/test/properties/baseProperty.spec.js +53 -53
- package/dist/test/properties/baseProperty.spec.js.map +1 -1
- package/dist/test/properties/containerProperty.spec.js +25 -25
- package/dist/test/properties/containerProperty.spec.js.map +1 -1
- package/dist/test/properties/customArrayProperty.spec.js +35 -35
- package/dist/test/properties/customArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/enumArrayProperty.spec.js +6 -6
- package/dist/test/properties/enumArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/enumProperty.spec.js +26 -26
- package/dist/test/properties/enumProperty.spec.js.map +1 -1
- package/dist/test/properties/float32.spec.js.map +1 -1
- package/dist/test/properties/int64ArrayProperty.spec.js +22 -22
- package/dist/test/properties/int64ArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/int64MapProperty.spec.js +28 -28
- package/dist/test/properties/int64MapProperty.spec.js.map +1 -1
- package/dist/test/properties/int64Property.spec.js +11 -11
- package/dist/test/properties/int64Property.spec.js.map +1 -1
- package/dist/test/properties/isLeafNode.spec.js +25 -25
- package/dist/test/properties/isLeafNode.spec.js.map +1 -1
- package/dist/test/properties/mapProperty.spec.js +110 -110
- package/dist/test/properties/mapProperty.spec.js.map +1 -1
- package/dist/test/properties/namedNodeProperty.spec.js +5 -5
- package/dist/test/properties/namedNodeProperty.spec.js.map +1 -1
- package/dist/test/properties/nodeProperty.spec.js +160 -160
- package/dist/test/properties/nodeProperty.spec.js.map +1 -1
- package/dist/test/properties/referenceProperty.spec.js +21 -21
- package/dist/test/properties/referenceProperty.spec.js.map +1 -1
- package/dist/test/properties/relationshipProperty.spec.js +4 -4
- package/dist/test/properties/relationshipProperty.spec.js.map +1 -1
- package/dist/test/properties/setProperty.spec.js +32 -32
- package/dist/test/properties/setProperty.spec.js.map +1 -1
- package/dist/test/properties/stringProperty.spec.js +38 -38
- package/dist/test/properties/stringProperty.spec.js.map +1 -1
- package/dist/test/properties/uint64Property.spec.js +3 -3
- package/dist/test/properties/uint64Property.spec.js.map +1 -1
- package/dist/test/properties/valueMapProperty.spec.js +28 -28
- package/dist/test/properties/valueMapProperty.spec.js.map +1 -1
- package/dist/test/properties/valueProperty.spec.js +7 -7
- package/dist/test/properties/valueProperty.spec.js.map +1 -1
- package/dist/test/propertyFactory.spec.js +559 -560
- package/dist/test/propertyFactory.spec.js.map +1 -1
- package/dist/test/propertyTemplateWrapper.spec.js +38 -38
- package/dist/test/propertyTemplateWrapper.spec.js.map +1 -1
- package/dist/test/propertyUtils.spec.js +5 -5
- package/dist/test/propertyUtils.spec.js.map +1 -1
- package/dist/test/reversibleChangeset.spec.js +266 -266
- package/dist/test/reversibleChangeset.spec.js.map +1 -1
- package/dist/test/setup.js.map +1 -1
- package/dist/test/tsconfig.tsbuildinfo +145 -145
- package/dist/test/utils.spec.js +508 -517
- package/dist/test/utils.spec.js.map +1 -1
- package/dist/test/validation/badMissingSemverInTypeid.js +9 -9
- package/dist/test/validation/badMissingSemverInTypeid.js.map +1 -1
- package/dist/test/validation/badPrimitiveTypeid.js +5 -5
- package/dist/test/validation/badPrimitiveTypeid.js.map +1 -1
- package/dist/test/validation/goodColorId.js +42 -42
- package/dist/test/validation/goodColorId.js.map +1 -1
- package/dist/test/validation/goodColorPalette.js +2 -2
- package/dist/test/validation/goodColorPalette.js.map +1 -1
- package/dist/test/validation/goodPointId.js +9 -9
- package/dist/test/validation/goodPointId.js.map +1 -1
- package/dist/test/validation/reversibleChangeSetTestData.js +1 -1
- package/dist/test/validation/reversibleChangeSetTestData.js.map +1 -1
- package/lib/containerSerializer.js +4 -10
- package/lib/containerSerializer.js.map +1 -1
- package/lib/enableValidations.js +1 -1
- package/lib/enableValidations.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/properties/abstractStaticCollectionProperty.js +1 -28
- package/lib/properties/abstractStaticCollectionProperty.js.map +1 -1
- package/lib/properties/arrayProperty.js +26 -85
- package/lib/properties/arrayProperty.js.map +1 -1
- package/lib/properties/baseProperty.js +7 -69
- package/lib/properties/baseProperty.js.map +1 -1
- package/lib/properties/boolProperty.js +0 -1
- package/lib/properties/boolProperty.js.map +1 -1
- package/lib/properties/containerProperty.js +4 -22
- package/lib/properties/containerProperty.js.map +1 -1
- package/lib/properties/enumArrayProperty.js +2 -14
- package/lib/properties/enumArrayProperty.js.map +1 -1
- package/lib/properties/enumProperty.js +3 -10
- package/lib/properties/enumProperty.js.map +1 -1
- package/lib/properties/floatProperties.js +0 -2
- package/lib/properties/floatProperties.js.map +1 -1
- package/lib/properties/index.js +7 -38
- package/lib/properties/index.js.map +1 -1
- package/lib/properties/indexedCollectionBaseProperty.js +6 -18
- package/lib/properties/indexedCollectionBaseProperty.js.map +1 -1
- package/lib/properties/intProperties.js +3 -20
- package/lib/properties/intProperties.js.map +1 -1
- package/lib/properties/lazyLoadedProperties.js.map +1 -1
- package/lib/properties/mapProperty.js +4 -23
- package/lib/properties/mapProperty.js.map +1 -1
- package/lib/properties/namedNodeProperty.js.map +1 -1
- package/lib/properties/namedProperty.js +0 -3
- package/lib/properties/namedProperty.js.map +1 -1
- package/lib/properties/nodeProperty.js +0 -3
- package/lib/properties/nodeProperty.js.map +1 -1
- package/lib/properties/primitiveTypeCasts.js +2 -2
- package/lib/properties/primitiveTypeCasts.js.map +1 -1
- package/lib/properties/referenceArrayProperty.js +3 -16
- package/lib/properties/referenceArrayProperty.js.map +1 -1
- package/lib/properties/referenceMapProperty.js +3 -13
- package/lib/properties/referenceMapProperty.js.map +1 -1
- package/lib/properties/referenceProperty.js +4 -12
- package/lib/properties/referenceProperty.js.map +1 -1
- package/lib/properties/setProperty.js +3 -22
- package/lib/properties/setProperty.js.map +1 -1
- package/lib/properties/stringProperty.js +12 -48
- package/lib/properties/stringProperty.js.map +1 -1
- package/lib/properties/uintProperties.js +0 -3
- package/lib/properties/uintProperties.js.map +1 -1
- package/lib/properties/valueArrayProperty.js +3 -45
- package/lib/properties/valueArrayProperty.js.map +1 -1
- package/lib/properties/valueMapProperty.js +4 -29
- package/lib/properties/valueMapProperty.js.map +1 -1
- package/lib/properties/valueProperty.js +2 -14
- package/lib/properties/valueProperty.js.map +1 -1
- package/lib/propertyFactory.js +35 -72
- package/lib/propertyFactory.js.map +1 -1
- package/lib/propertyTemplate.js +0 -14
- package/lib/propertyTemplate.js.map +1 -1
- package/lib/propertyTemplateWrapper.js +4 -12
- package/lib/propertyTemplateWrapper.js.map +1 -1
- package/lib/propertyUtils.js.map +1 -1
- package/package.json +13 -6
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
/* globals expect*/
|
|
5
|
+
/* globals expect */
|
|
6
6
|
/**
|
|
7
7
|
* @fileoverview In this file, we will test the functions of the property factory.
|
|
8
8
|
*/
|
|
9
9
|
const _ = require('lodash');
|
|
10
|
-
const { PropertyFactory } = require('..');
|
|
11
10
|
const { ChangeSet } = require('@fluid-experimental/property-changeset');
|
|
12
11
|
const { Int64, Uint64 } = require('@fluid-experimental/property-common');
|
|
12
|
+
const { PropertyFactory } = require('..');
|
|
13
13
|
const deepCopy = _.cloneDeep;
|
|
14
14
|
describe('Reversible ChangeSets', function () {
|
|
15
15
|
var testRevAndInvCS = function (initialProperty, modificationFunction, expectedRevCS, expectedAfterCS, expectedInverseCS) {
|
|
@@ -65,24 +65,24 @@ describe('Reversible ChangeSets', function () {
|
|
|
65
65
|
{ id: 'directMember', typeid: 'autodesk.tests:ChangeSetApplyAfterTask.memberTemplate-1.0.0' },
|
|
66
66
|
{
|
|
67
67
|
id: 'nested', properties: [
|
|
68
|
-
{ id: 'member', typeid: 'autodesk.tests:ChangeSetApplyAfterTask.nestedTemplate-1.0.0' }
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
]
|
|
68
|
+
{ id: 'member', typeid: 'autodesk.tests:ChangeSetApplyAfterTask.nestedTemplate-1.0.0' },
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
72
|
};
|
|
73
73
|
var TaskSubjectMemberTemplate = {
|
|
74
74
|
typeid: 'autodesk.tests:ChangeSetApplyAfterTask.memberTemplate-1.0.0',
|
|
75
75
|
properties: [
|
|
76
76
|
{ id: 'progress', typeid: 'Uint32' },
|
|
77
|
-
{ id: 'timeRemaining', typeid: 'Uint32' }
|
|
78
|
-
]
|
|
77
|
+
{ id: 'timeRemaining', typeid: 'Uint32' },
|
|
78
|
+
],
|
|
79
79
|
};
|
|
80
80
|
var TaskSubjectTestTemplate = {
|
|
81
81
|
typeid: 'autodesk.tests:ChangeSetApplyAfterTask.nodeTemplate-1.0.0',
|
|
82
82
|
properties: [
|
|
83
83
|
{ id: 'result', typeid: 'NodeProperty' },
|
|
84
|
-
{ id: 'integer', typeid: 'Uint32' }
|
|
85
|
-
]
|
|
84
|
+
{ id: 'integer', typeid: 'Uint32' },
|
|
85
|
+
],
|
|
86
86
|
};
|
|
87
87
|
// Register the templates from the discussion document
|
|
88
88
|
var Vec3Template = {
|
|
@@ -90,8 +90,8 @@ describe('Reversible ChangeSets', function () {
|
|
|
90
90
|
properties: [
|
|
91
91
|
{ id: 'x', typeid: 'Float32' },
|
|
92
92
|
{ id: 'y', typeid: 'Float32' },
|
|
93
|
-
{ id: 'z', typeid: 'Float32' }
|
|
94
|
-
]
|
|
93
|
+
{ id: 'z', typeid: 'Float32' },
|
|
94
|
+
],
|
|
95
95
|
};
|
|
96
96
|
var Point2DTemplate = {
|
|
97
97
|
typeid: 'autodesk.test:point2d-1.0.0',
|
|
@@ -99,37 +99,37 @@ describe('Reversible ChangeSets', function () {
|
|
|
99
99
|
{
|
|
100
100
|
id: 'position', properties: [
|
|
101
101
|
{ id: 'x', typeid: 'Float32' },
|
|
102
|
-
{ id: 'y', typeid: 'Float32' }
|
|
103
|
-
]
|
|
102
|
+
{ id: 'y', typeid: 'Float32' },
|
|
103
|
+
],
|
|
104
104
|
},
|
|
105
105
|
{ id: 'normal', typeid: 'autodesk.test:vector3-1.0.0' },
|
|
106
106
|
{ id: 'neighbours', typeid: 'autodesk.test:vector3-1.0.0', context: 'map' },
|
|
107
|
-
{ id: 'temperature', typeid: 'Float32' }
|
|
108
|
-
]
|
|
107
|
+
{ id: 'temperature', typeid: 'Float32' },
|
|
108
|
+
],
|
|
109
109
|
};
|
|
110
110
|
var TestArrayFloat32 = {
|
|
111
111
|
typeid: 'autodesk.test:test.arrayfloat32-1.0.0',
|
|
112
112
|
properties: [
|
|
113
|
-
{ id: 'data', typeid: 'Float32', context: 'array' }
|
|
114
|
-
]
|
|
113
|
+
{ id: 'data', typeid: 'Float32', context: 'array' },
|
|
114
|
+
],
|
|
115
115
|
};
|
|
116
116
|
var SimpleStringTestPropertyTemplate = {
|
|
117
117
|
typeid: 'autodesk.tests:DataStringTestProperty-1.0.0',
|
|
118
118
|
properties: [
|
|
119
|
-
{ id: 'data', typeid: 'String' }
|
|
120
|
-
]
|
|
119
|
+
{ id: 'data', typeid: 'String' },
|
|
120
|
+
],
|
|
121
121
|
};
|
|
122
122
|
var SimpleRefTestPropertyTemplate = {
|
|
123
123
|
typeid: 'autodesk.tests:DataRefTestProperty-1.0.0',
|
|
124
124
|
properties: [
|
|
125
|
-
{ id: 'data', typeid: 'Reference' }
|
|
126
|
-
]
|
|
125
|
+
{ id: 'data', typeid: 'Reference' },
|
|
126
|
+
],
|
|
127
127
|
};
|
|
128
128
|
var SimpleMapTestPropertyTemplate = {
|
|
129
129
|
typeid: 'autodesk.tests:MapTestPropertyID-1.0.0',
|
|
130
130
|
properties: [
|
|
131
|
-
{ id: 'data', typeid: 'Float32', context: 'map' }
|
|
132
|
-
]
|
|
131
|
+
{ id: 'data', typeid: 'Float32', context: 'map' },
|
|
132
|
+
],
|
|
133
133
|
};
|
|
134
134
|
var TestPropertyTemplate = {
|
|
135
135
|
typeid: 'autodesk.tests:MapTestNamedPropertyID-1.0.0',
|
|
@@ -137,20 +137,20 @@ describe('Reversible ChangeSets', function () {
|
|
|
137
137
|
properties: [
|
|
138
138
|
{ id: 'stringProperty', typeid: 'String' },
|
|
139
139
|
{ id: 'stringProperty2', typeid: 'String' },
|
|
140
|
-
{ id: 'map', context: 'map', typeid: 'NamedProperty' }
|
|
141
|
-
]
|
|
140
|
+
{ id: 'map', context: 'map', typeid: 'NamedProperty' },
|
|
141
|
+
],
|
|
142
142
|
};
|
|
143
143
|
var AnonymousTestPropertyTemplate = {
|
|
144
144
|
typeid: 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0',
|
|
145
145
|
properties: [
|
|
146
|
-
{ id: 'stringProperty', typeid: 'String' }
|
|
147
|
-
]
|
|
146
|
+
{ id: 'stringProperty', typeid: 'String' },
|
|
147
|
+
],
|
|
148
148
|
};
|
|
149
149
|
var CuststomArrayTemplate = {
|
|
150
150
|
typeid: 'autodesk.tests:CustomArrayChangesetTestID-1.0.0',
|
|
151
151
|
properties: [
|
|
152
|
-
{ id: 'data', typeid: 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0', context: 'array' }
|
|
153
|
-
]
|
|
152
|
+
{ id: 'data', typeid: 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0', context: 'array' },
|
|
153
|
+
],
|
|
154
154
|
};
|
|
155
155
|
var TestEnumTemplate = {
|
|
156
156
|
typeid: 'autodesk.core:UnitsEnum-1.0.0',
|
|
@@ -159,19 +159,19 @@ describe('Reversible ChangeSets', function () {
|
|
|
159
159
|
properties: [
|
|
160
160
|
{ id: 'm', value: 1, annotation: { description: 'meter' } },
|
|
161
161
|
{ id: 'cm', value: 2, annotation: { description: 'centimeter' } },
|
|
162
|
-
{ id: 'mm', value: 3, annotation: { description: 'millimeter' } }
|
|
163
|
-
]
|
|
162
|
+
{ id: 'mm', value: 3, annotation: { description: 'millimeter' } },
|
|
163
|
+
],
|
|
164
164
|
};
|
|
165
165
|
PropertyFactory._reregister(TestEnumTemplate);
|
|
166
166
|
var TestBaseContainingEnumTemplate = {
|
|
167
167
|
typeid: 'autodesk.core:CustomWithEnumID-1.0.0',
|
|
168
168
|
properties: [{
|
|
169
|
-
id: 'data', typeid: 'autodesk.core:UnitsEnum-1.0.0'
|
|
170
|
-
}]
|
|
169
|
+
id: 'data', typeid: 'autodesk.core:UnitsEnum-1.0.0',
|
|
170
|
+
}],
|
|
171
171
|
};
|
|
172
172
|
var TestInheritsNodePropertyObject = {
|
|
173
173
|
inherits: ['NodeProperty'],
|
|
174
|
-
typeid: 'autodesk.tests:SimpleInheritsNodeProperty-1.0.0'
|
|
174
|
+
typeid: 'autodesk.tests:SimpleInheritsNodeProperty-1.0.0',
|
|
175
175
|
};
|
|
176
176
|
PropertyFactory._reregister(TestInheritsNodePropertyObject);
|
|
177
177
|
PropertyFactory._reregister(TestEnumTemplate);
|
|
@@ -515,7 +515,7 @@ describe('Reversible ChangeSets', function () {
|
|
|
515
515
|
expect(CS2).to.deep.equal(CS2_copy);
|
|
516
516
|
// CS2 should no longer contain the removal of A
|
|
517
517
|
expect(CS1.getSerializedChangeSet()).to.deep.equal({
|
|
518
|
-
'modify': { [in_typeid]: { 'arr': { [in_type]: outputArrayOperations } } }
|
|
518
|
+
'modify': { [in_typeid]: { 'arr': { [in_type]: outputArrayOperations } } },
|
|
519
519
|
});
|
|
520
520
|
};
|
|
521
521
|
it('on strings', function () {
|
|
@@ -584,10 +584,10 @@ describe('Reversible ChangeSets', function () {
|
|
|
584
584
|
'array<Float32>': {
|
|
585
585
|
'elements': {
|
|
586
586
|
'modify': [
|
|
587
|
-
[1, [1, 2, 3], [0, 1, 2]]
|
|
588
|
-
]
|
|
589
|
-
}
|
|
590
|
-
}
|
|
587
|
+
[1, [1, 2, 3], [0, 1, 2]],
|
|
588
|
+
],
|
|
589
|
+
},
|
|
590
|
+
},
|
|
591
591
|
});
|
|
592
592
|
var rebasedCS = CS._rebaseChangeSet({
|
|
593
593
|
'array<Float32>': {
|
|
@@ -596,11 +596,11 @@ describe('Reversible ChangeSets', function () {
|
|
|
596
596
|
[
|
|
597
597
|
0,
|
|
598
598
|
[0, 1, 2, 3],
|
|
599
|
-
[1, 2, 3, 4]
|
|
600
|
-
]
|
|
601
|
-
]
|
|
602
|
-
}
|
|
603
|
-
}
|
|
599
|
+
[1, 2, 3, 4],
|
|
600
|
+
],
|
|
601
|
+
],
|
|
602
|
+
},
|
|
603
|
+
},
|
|
604
604
|
}, []);
|
|
605
605
|
expect(rebasedCS['array<Float32>'].elements.modify[0].length).to.equal(3);
|
|
606
606
|
});
|
|
@@ -634,22 +634,22 @@ describe('Reversible ChangeSets', function () {
|
|
|
634
634
|
var CS = new ChangeSet({
|
|
635
635
|
remove: {
|
|
636
636
|
String: {
|
|
637
|
-
testString: 'abcde'
|
|
638
|
-
}
|
|
639
|
-
}
|
|
637
|
+
testString: 'abcde',
|
|
638
|
+
},
|
|
639
|
+
},
|
|
640
640
|
});
|
|
641
641
|
CS._stripReversibleChangeSet();
|
|
642
642
|
expect(CS.getSerializedChangeSet()).to.deep.equal({
|
|
643
|
-
remove: ['testString']
|
|
643
|
+
remove: ['testString'],
|
|
644
644
|
});
|
|
645
645
|
});
|
|
646
646
|
it('ignore the root when passing it a flag', function () {
|
|
647
647
|
var SCS = {
|
|
648
648
|
remove: {
|
|
649
649
|
String: {
|
|
650
|
-
testString: 'abcde'
|
|
651
|
-
}
|
|
652
|
-
}
|
|
650
|
+
testString: 'abcde',
|
|
651
|
+
},
|
|
652
|
+
},
|
|
653
653
|
};
|
|
654
654
|
var CS = new ChangeSet(SCS);
|
|
655
655
|
CS._stripReversibleChangeSet(true);
|
|
@@ -699,7 +699,7 @@ describe('Reversible ChangeSets', function () {
|
|
|
699
699
|
CS1.applyChangeSet(CS2);
|
|
700
700
|
expect(CS1.getSerializedChangeSet()).to.deep.equal({
|
|
701
701
|
remove: { 'RepositoryTest:Nametag-1.0.0': { name: 'A' } },
|
|
702
|
-
insert: { 'RepositoryTest:Nametag-1.0.0': { name: 'B' } }
|
|
702
|
+
insert: { 'RepositoryTest:Nametag-1.0.0': { name: 'B' } },
|
|
703
703
|
});
|
|
704
704
|
});
|
|
705
705
|
it('matching primitive type remove/insert operations in primitive type arrays', function () {
|
|
@@ -722,23 +722,23 @@ describe('Reversible ChangeSets', function () {
|
|
|
722
722
|
'data': {
|
|
723
723
|
'modify': [[1, [21, 22], [11, 12]]],
|
|
724
724
|
'remove': [[4, [14, 15, 16]]],
|
|
725
|
-
'insert': [[0, [9]]]
|
|
726
|
-
}
|
|
727
|
-
}
|
|
725
|
+
'insert': [[0, [9]]],
|
|
726
|
+
},
|
|
727
|
+
},
|
|
728
728
|
}, {
|
|
729
729
|
'array<Float32>': {
|
|
730
730
|
'data': {
|
|
731
|
-
'insert': [[0, [9, 10, 21, 22, 13]]]
|
|
732
|
-
}
|
|
733
|
-
}
|
|
731
|
+
'insert': [[0, [9, 10, 21, 22, 13]]],
|
|
732
|
+
},
|
|
733
|
+
},
|
|
734
734
|
}, {
|
|
735
735
|
'array<Float32>': {
|
|
736
736
|
'data': {
|
|
737
737
|
'modify': [[2, [11, 12], [21, 22]]],
|
|
738
738
|
'insert': [[5, [14, 15, 16]]],
|
|
739
|
-
'remove': [[0, [9]]]
|
|
740
|
-
}
|
|
741
|
-
}
|
|
739
|
+
'remove': [[0, [9]]],
|
|
740
|
+
},
|
|
741
|
+
},
|
|
742
742
|
});
|
|
743
743
|
});
|
|
744
744
|
it('should work for insertions into empty primitive array properties', function () {
|
|
@@ -748,21 +748,21 @@ describe('Reversible ChangeSets', function () {
|
|
|
748
748
|
}, {
|
|
749
749
|
'array<Float32>': {
|
|
750
750
|
'data': {
|
|
751
|
-
'insert': [[0, [1, 2, 3]]]
|
|
752
|
-
}
|
|
753
|
-
}
|
|
751
|
+
'insert': [[0, [1, 2, 3]]],
|
|
752
|
+
},
|
|
753
|
+
},
|
|
754
754
|
}, {
|
|
755
755
|
'array<Float32>': {
|
|
756
756
|
'data': {
|
|
757
|
-
'insert': [[0, [1, 2, 3]]]
|
|
758
|
-
}
|
|
759
|
-
}
|
|
757
|
+
'insert': [[0, [1, 2, 3]]],
|
|
758
|
+
},
|
|
759
|
+
},
|
|
760
760
|
}, {
|
|
761
761
|
'array<Float32>': {
|
|
762
762
|
'data': {
|
|
763
|
-
'remove': [[0, [1, 2, 3]]]
|
|
764
|
-
}
|
|
765
|
-
}
|
|
763
|
+
'remove': [[0, [1, 2, 3]]],
|
|
764
|
+
},
|
|
765
|
+
},
|
|
766
766
|
});
|
|
767
767
|
});
|
|
768
768
|
it('should not crash with an empty input if it is not needed in the actual CS', function () {
|
|
@@ -770,10 +770,10 @@ describe('Reversible ChangeSets', function () {
|
|
|
770
770
|
'NodeProperty': {
|
|
771
771
|
insert: {
|
|
772
772
|
NodeProperty: {
|
|
773
|
-
test2: {}
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
}
|
|
773
|
+
test2: {},
|
|
774
|
+
},
|
|
775
|
+
},
|
|
776
|
+
},
|
|
777
777
|
};
|
|
778
778
|
var CS = new ChangeSet(deepCopy(initialCS));
|
|
779
779
|
CS._toReversibleChangeSet({});
|
|
@@ -789,11 +789,11 @@ describe('Reversible ChangeSets', function () {
|
|
|
789
789
|
'test': {
|
|
790
790
|
insert: {
|
|
791
791
|
NodeProperty: {
|
|
792
|
-
test2: {}
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
}
|
|
792
|
+
test2: {},
|
|
793
|
+
},
|
|
794
|
+
},
|
|
795
|
+
},
|
|
796
|
+
},
|
|
797
797
|
};
|
|
798
798
|
var CS = new ChangeSet(deepCopy(initialCS));
|
|
799
799
|
CS._toReversibleChangeSet({});
|
|
@@ -803,16 +803,16 @@ describe('Reversible ChangeSets', function () {
|
|
|
803
803
|
var cs = new ChangeSet({
|
|
804
804
|
insert: {
|
|
805
805
|
'Float32': {
|
|
806
|
-
'myFloat': 23
|
|
807
|
-
}
|
|
808
|
-
}
|
|
806
|
+
'myFloat': 23,
|
|
807
|
+
},
|
|
808
|
+
},
|
|
809
809
|
});
|
|
810
810
|
var cs2 = new ChangeSet({
|
|
811
811
|
modify: {
|
|
812
812
|
'Float32': {
|
|
813
|
-
'myFloat': 42
|
|
814
|
-
}
|
|
815
|
-
}
|
|
813
|
+
'myFloat': 42,
|
|
814
|
+
},
|
|
815
|
+
},
|
|
816
816
|
});
|
|
817
817
|
var cs2Rev = cs2.clone();
|
|
818
818
|
cs2Rev._stripReversibleChangeSet();
|
|
@@ -842,27 +842,27 @@ describe('Reversible ChangeSets', function () {
|
|
|
842
842
|
}, {
|
|
843
843
|
'Float32': {
|
|
844
844
|
'position.x': { 'value': 2, 'oldValue': 0 },
|
|
845
|
-
'temperature': { 'value': 21, 'oldValue': 0 }
|
|
845
|
+
'temperature': { 'value': 21, 'oldValue': 0 },
|
|
846
846
|
},
|
|
847
847
|
'autodesk.test:vector3-1.0.0': {
|
|
848
|
-
'normal': { 'Float32': { 'y': { 'value': 4, 'oldValue': 0 } } }
|
|
849
|
-
}
|
|
848
|
+
'normal': { 'Float32': { 'y': { 'value': 4, 'oldValue': 0 } } },
|
|
849
|
+
},
|
|
850
850
|
}, {
|
|
851
851
|
'Float32': {
|
|
852
|
-
'position.x': 2, 'position.y': 0, 'temperature': 21
|
|
852
|
+
'position.x': 2, 'position.y': 0, 'temperature': 21,
|
|
853
853
|
},
|
|
854
854
|
'autodesk.test:vector3-1.0.0': {
|
|
855
|
-
'normal': { 'Float32': { 'x': 0, 'y': 4, 'z': 0 } }
|
|
855
|
+
'normal': { 'Float32': { 'x': 0, 'y': 4, 'z': 0 } },
|
|
856
856
|
},
|
|
857
|
-
'map<autodesk.test:vector3-1.0.0>': { 'neighbours': {} }
|
|
857
|
+
'map<autodesk.test:vector3-1.0.0>': { 'neighbours': {} },
|
|
858
858
|
}, {
|
|
859
859
|
'Float32': {
|
|
860
860
|
'position.x': { 'value': 0, 'oldValue': 2 },
|
|
861
|
-
'temperature': { 'value': 0, 'oldValue': 21 }
|
|
861
|
+
'temperature': { 'value': 0, 'oldValue': 21 },
|
|
862
862
|
},
|
|
863
863
|
'autodesk.test:vector3-1.0.0': {
|
|
864
|
-
'normal': { 'Float32': { 'y': { 'value': 0, 'oldValue': 4 } } }
|
|
865
|
-
}
|
|
864
|
+
'normal': { 'Float32': { 'y': { 'value': 0, 'oldValue': 4 } } },
|
|
865
|
+
},
|
|
866
866
|
});
|
|
867
867
|
});
|
|
868
868
|
it('should work for string properties initialized by set', function () {
|
|
@@ -901,23 +901,23 @@ describe('Reversible ChangeSets', function () {
|
|
|
901
901
|
'data': {
|
|
902
902
|
'remove': { 'B': 4, 'C': 5 },
|
|
903
903
|
'modify': { 'A': { 'value': 7, 'oldValue': 3 }, 'D': { 'value': 8, 'oldValue': 6 } },
|
|
904
|
-
'insert': { 'F': 9 }
|
|
905
|
-
}
|
|
906
|
-
}
|
|
904
|
+
'insert': { 'F': 9 },
|
|
905
|
+
},
|
|
906
|
+
},
|
|
907
907
|
}, {
|
|
908
908
|
'map<Float32>': {
|
|
909
909
|
'data': {
|
|
910
|
-
'insert': { 'A': 7, 'D': 8, 'F': 9 }
|
|
911
|
-
}
|
|
912
|
-
}
|
|
910
|
+
'insert': { 'A': 7, 'D': 8, 'F': 9 },
|
|
911
|
+
},
|
|
912
|
+
},
|
|
913
913
|
}, {
|
|
914
914
|
'map<Float32>': {
|
|
915
915
|
'data': {
|
|
916
916
|
'modify': { 'A': { 'value': 3, 'oldValue': 7 }, 'D': { 'value': 6, 'oldValue': 8 } },
|
|
917
917
|
'insert': { 'B': 4, 'C': 5 },
|
|
918
|
-
'remove': { 'F': 9 }
|
|
919
|
-
}
|
|
920
|
-
}
|
|
918
|
+
'remove': { 'F': 9 },
|
|
919
|
+
},
|
|
920
|
+
},
|
|
921
921
|
});
|
|
922
922
|
});
|
|
923
923
|
it('should work for custom map properties', function () {
|
|
@@ -941,132 +941,132 @@ describe('Reversible ChangeSets', function () {
|
|
|
941
941
|
'map': {
|
|
942
942
|
'insert': {
|
|
943
943
|
'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
|
|
944
|
-
'F': { 'String': { 'stringProperty': '' } }
|
|
945
|
-
}
|
|
944
|
+
'F': { 'String': { 'stringProperty': '' } },
|
|
945
|
+
},
|
|
946
946
|
},
|
|
947
947
|
'remove': {
|
|
948
948
|
'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
|
|
949
|
-
'B': { 'String': { 'stringProperty': '' } }, 'C': { 'String': { 'stringProperty': '' } }
|
|
950
|
-
}
|
|
949
|
+
'B': { 'String': { 'stringProperty': '' } }, 'C': { 'String': { 'stringProperty': '' } },
|
|
950
|
+
},
|
|
951
951
|
},
|
|
952
952
|
'modify': {
|
|
953
953
|
'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
|
|
954
|
-
'A': { 'String': { 'stringProperty': { 'value': 'hello', 'oldValue': '' } } }
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
}
|
|
954
|
+
'A': { 'String': { 'stringProperty': { 'value': 'hello', 'oldValue': '' } } },
|
|
955
|
+
},
|
|
956
|
+
},
|
|
957
|
+
},
|
|
958
|
+
},
|
|
959
959
|
}, undefined, {
|
|
960
960
|
'map<NamedProperty>': {
|
|
961
961
|
'map': {
|
|
962
962
|
'insert': {
|
|
963
963
|
'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
|
|
964
964
|
'B': { 'String': { 'stringProperty': '' } },
|
|
965
|
-
'C': { 'String': { 'stringProperty': '' } }
|
|
966
|
-
}
|
|
965
|
+
'C': { 'String': { 'stringProperty': '' } },
|
|
966
|
+
},
|
|
967
967
|
},
|
|
968
968
|
'modify': {
|
|
969
969
|
'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
|
|
970
|
-
'A': { 'String': { 'stringProperty': { 'value': '', 'oldValue': 'hello' } } }
|
|
971
|
-
}
|
|
970
|
+
'A': { 'String': { 'stringProperty': { 'value': '', 'oldValue': 'hello' } } },
|
|
971
|
+
},
|
|
972
972
|
},
|
|
973
973
|
'remove': {
|
|
974
974
|
'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
|
|
975
|
-
'F': { 'String': { 'stringProperty': '' } }
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
}
|
|
975
|
+
'F': { 'String': { 'stringProperty': '' } },
|
|
976
|
+
},
|
|
977
|
+
},
|
|
978
|
+
},
|
|
979
|
+
},
|
|
980
980
|
});
|
|
981
981
|
});
|
|
982
982
|
it('should test reversible changeset for a NodeProperty', function () {
|
|
983
983
|
var originalChangeSet = {
|
|
984
984
|
'insert': {
|
|
985
985
|
'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
|
|
986
|
-
'F': { 'String': { 'stringProperty': '' } }
|
|
987
|
-
}
|
|
986
|
+
'F': { 'String': { 'stringProperty': '' } },
|
|
987
|
+
},
|
|
988
988
|
},
|
|
989
989
|
'remove': ['B', 'C'],
|
|
990
990
|
'modify': {
|
|
991
991
|
'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
|
|
992
|
-
'A': { 'String': { 'stringProperty': 'hello' } }
|
|
993
|
-
}
|
|
994
|
-
}
|
|
992
|
+
'A': { 'String': { 'stringProperty': 'hello' } },
|
|
993
|
+
},
|
|
994
|
+
},
|
|
995
995
|
};
|
|
996
996
|
var parentChangeSet = {
|
|
997
997
|
'insert': {
|
|
998
998
|
'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
|
|
999
999
|
'A': { 'String': { 'stringProperty': '' } },
|
|
1000
1000
|
'B': { 'String': { 'stringProperty': '' } },
|
|
1001
|
-
'C': { 'String': { 'stringProperty': '' } }
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1001
|
+
'C': { 'String': { 'stringProperty': '' } },
|
|
1002
|
+
},
|
|
1003
|
+
},
|
|
1004
1004
|
};
|
|
1005
1005
|
var changeSet = new ChangeSet(originalChangeSet);
|
|
1006
1006
|
changeSet._toReversibleChangeSet(parentChangeSet);
|
|
1007
1007
|
expect(changeSet.getSerializedChangeSet()).to.eql({
|
|
1008
1008
|
'insert': {
|
|
1009
1009
|
'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
|
|
1010
|
-
'F': { 'String': { 'stringProperty': '' } }
|
|
1011
|
-
}
|
|
1010
|
+
'F': { 'String': { 'stringProperty': '' } },
|
|
1011
|
+
},
|
|
1012
1012
|
},
|
|
1013
1013
|
'remove': {
|
|
1014
1014
|
'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
|
|
1015
1015
|
'B': { 'String': { 'stringProperty': '' } },
|
|
1016
|
-
'C': { 'String': { 'stringProperty': '' } }
|
|
1017
|
-
}
|
|
1016
|
+
'C': { 'String': { 'stringProperty': '' } },
|
|
1017
|
+
},
|
|
1018
1018
|
}, 'modify': {
|
|
1019
1019
|
'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
|
|
1020
1020
|
'A': {
|
|
1021
1021
|
'String': {
|
|
1022
1022
|
'stringProperty': {
|
|
1023
1023
|
'value': 'hello',
|
|
1024
|
-
'oldValue': ''
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1024
|
+
'oldValue': '',
|
|
1025
|
+
},
|
|
1026
|
+
},
|
|
1027
|
+
},
|
|
1028
|
+
},
|
|
1029
|
+
},
|
|
1030
1030
|
});
|
|
1031
1031
|
changeSet.toInverseChangeSet();
|
|
1032
1032
|
expect(changeSet.getSerializedChangeSet()).to.eql({
|
|
1033
1033
|
'insert': {
|
|
1034
1034
|
'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
|
|
1035
1035
|
'B': { 'String': { 'stringProperty': '' } },
|
|
1036
|
-
'C': { 'String': { 'stringProperty': '' } }
|
|
1037
|
-
}
|
|
1036
|
+
'C': { 'String': { 'stringProperty': '' } },
|
|
1037
|
+
},
|
|
1038
1038
|
},
|
|
1039
1039
|
'remove': {
|
|
1040
1040
|
'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
|
|
1041
|
-
'F': { 'String': { 'stringProperty': '' } }
|
|
1042
|
-
}
|
|
1041
|
+
'F': { 'String': { 'stringProperty': '' } },
|
|
1042
|
+
},
|
|
1043
1043
|
}, 'modify': {
|
|
1044
1044
|
'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
|
|
1045
1045
|
'A': {
|
|
1046
1046
|
'String': {
|
|
1047
1047
|
'stringProperty': {
|
|
1048
1048
|
'value': '',
|
|
1049
|
-
'oldValue': 'hello'
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1049
|
+
'oldValue': 'hello',
|
|
1050
|
+
},
|
|
1051
|
+
},
|
|
1052
|
+
},
|
|
1053
|
+
},
|
|
1054
|
+
},
|
|
1055
1055
|
});
|
|
1056
1056
|
var originalChangeSet2 = {
|
|
1057
1057
|
'insert': {
|
|
1058
1058
|
'mysample:point2d-1.0.0': {
|
|
1059
1059
|
'7485af0e-c992-af6a-ef36-6a024eb4b4e5---2': {
|
|
1060
1060
|
'String': {
|
|
1061
|
-
'guid': 'fb5f062f-9f56-55c3-f868-06caa5d8ce26'
|
|
1061
|
+
'guid': 'fb5f062f-9f56-55c3-f868-06caa5d8ce26',
|
|
1062
1062
|
},
|
|
1063
1063
|
'Float64': {
|
|
1064
1064
|
'x': 0,
|
|
1065
|
-
'y': 0
|
|
1066
|
-
}
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1065
|
+
'y': 0,
|
|
1066
|
+
},
|
|
1067
|
+
},
|
|
1068
|
+
},
|
|
1069
|
+
},
|
|
1070
1070
|
};
|
|
1071
1071
|
var parentChangeSet2 = {};
|
|
1072
1072
|
var changeSet2 = new ChangeSet(originalChangeSet2);
|
|
@@ -1078,15 +1078,15 @@ describe('Reversible ChangeSets', function () {
|
|
|
1078
1078
|
'mysample:point2d-1.0.0': {
|
|
1079
1079
|
'7485af0e-c992-af6a-ef36-6a024eb4b4e5---2': {
|
|
1080
1080
|
'String': {
|
|
1081
|
-
'guid': 'fb5f062f-9f56-55c3-f868-06caa5d8ce26'
|
|
1081
|
+
'guid': 'fb5f062f-9f56-55c3-f868-06caa5d8ce26',
|
|
1082
1082
|
},
|
|
1083
1083
|
'Float64': {
|
|
1084
1084
|
'x': 0,
|
|
1085
|
-
'y': 0
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1085
|
+
'y': 0,
|
|
1086
|
+
},
|
|
1087
|
+
},
|
|
1088
|
+
},
|
|
1089
|
+
},
|
|
1090
1090
|
});
|
|
1091
1091
|
});
|
|
1092
1092
|
it('should test reversible changeset for an array of non primitive types', function () {
|
|
@@ -1100,29 +1100,29 @@ describe('Reversible ChangeSets', function () {
|
|
|
1100
1100
|
[
|
|
1101
1101
|
{
|
|
1102
1102
|
'Float64': {
|
|
1103
|
-
'x': 15.104284463262685
|
|
1103
|
+
'x': 15.104284463262685,
|
|
1104
1104
|
},
|
|
1105
|
-
'typeid': 'mysample:point2d-1.0.0'
|
|
1106
|
-
}
|
|
1107
|
-
]
|
|
1108
|
-
]
|
|
1109
|
-
]
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
}
|
|
1105
|
+
'typeid': 'mysample:point2d-1.0.0',
|
|
1106
|
+
},
|
|
1107
|
+
],
|
|
1108
|
+
],
|
|
1109
|
+
],
|
|
1110
|
+
},
|
|
1111
|
+
},
|
|
1112
|
+
},
|
|
1113
1113
|
};
|
|
1114
1114
|
var parentChangeSet = {
|
|
1115
1115
|
'insert': {
|
|
1116
1116
|
'mysample:point2d-1.0.0': {
|
|
1117
1117
|
'test': {
|
|
1118
1118
|
'String': {
|
|
1119
|
-
'guid': 'cd36cd32-0bd3-5c55-f94c-b95933fdc58b'
|
|
1119
|
+
'guid': 'cd36cd32-0bd3-5c55-f94c-b95933fdc58b',
|
|
1120
1120
|
},
|
|
1121
1121
|
'Float64': {
|
|
1122
1122
|
'x': 65.18242364168808,
|
|
1123
|
-
'y': 0
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1123
|
+
'y': 0,
|
|
1124
|
+
},
|
|
1125
|
+
},
|
|
1126
1126
|
},
|
|
1127
1127
|
'array<mysample:point2d-1.0.0>': {
|
|
1128
1128
|
'test2': {
|
|
@@ -1132,30 +1132,30 @@ describe('Reversible ChangeSets', function () {
|
|
|
1132
1132
|
[
|
|
1133
1133
|
{
|
|
1134
1134
|
'String': {
|
|
1135
|
-
'guid': 'e66540ff-9e5e-d599-033e-d3dd55efc2a3'
|
|
1135
|
+
'guid': 'e66540ff-9e5e-d599-033e-d3dd55efc2a3',
|
|
1136
1136
|
},
|
|
1137
1137
|
'Float64': {
|
|
1138
1138
|
'x': 0,
|
|
1139
|
-
'y': 0
|
|
1139
|
+
'y': 0,
|
|
1140
1140
|
},
|
|
1141
|
-
'typeid': 'mysample:point2d-1.0.0'
|
|
1141
|
+
'typeid': 'mysample:point2d-1.0.0',
|
|
1142
1142
|
},
|
|
1143
1143
|
{
|
|
1144
1144
|
'String': {
|
|
1145
|
-
'guid': 'daeb5439-baef-7986-f90a-6a3a2f082250'
|
|
1145
|
+
'guid': 'daeb5439-baef-7986-f90a-6a3a2f082250',
|
|
1146
1146
|
},
|
|
1147
1147
|
'Float64': {
|
|
1148
1148
|
'x': 0,
|
|
1149
|
-
'y': 0
|
|
1149
|
+
'y': 0,
|
|
1150
1150
|
},
|
|
1151
|
-
'typeid': 'mysample:point2d-1.0.0'
|
|
1152
|
-
}
|
|
1153
|
-
]
|
|
1154
|
-
]
|
|
1155
|
-
]
|
|
1151
|
+
'typeid': 'mysample:point2d-1.0.0',
|
|
1152
|
+
},
|
|
1153
|
+
],
|
|
1154
|
+
],
|
|
1155
|
+
],
|
|
1156
1156
|
},
|
|
1157
|
-
'test3': {}
|
|
1158
|
-
}
|
|
1157
|
+
'test3': {},
|
|
1158
|
+
},
|
|
1159
1159
|
},
|
|
1160
1160
|
'insertTemplates': {
|
|
1161
1161
|
'mysample:point2d-1.0.0': {
|
|
@@ -1164,15 +1164,15 @@ describe('Reversible ChangeSets', function () {
|
|
|
1164
1164
|
'properties': [
|
|
1165
1165
|
{
|
|
1166
1166
|
'id': 'x',
|
|
1167
|
-
'typeid': 'Float64'
|
|
1167
|
+
'typeid': 'Float64',
|
|
1168
1168
|
},
|
|
1169
1169
|
{
|
|
1170
1170
|
'id': 'y',
|
|
1171
|
-
'typeid': 'Float64'
|
|
1172
|
-
}
|
|
1173
|
-
]
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1171
|
+
'typeid': 'Float64',
|
|
1172
|
+
},
|
|
1173
|
+
],
|
|
1174
|
+
},
|
|
1175
|
+
},
|
|
1176
1176
|
};
|
|
1177
1177
|
var changeSet = new ChangeSet(originalChangeSet);
|
|
1178
1178
|
changeSet._toReversibleChangeSet(parentChangeSet);
|
|
@@ -1188,17 +1188,17 @@ describe('Reversible ChangeSets', function () {
|
|
|
1188
1188
|
'Float64': {
|
|
1189
1189
|
'x': {
|
|
1190
1190
|
value: 15.104284463262685,
|
|
1191
|
-
oldValue: 0
|
|
1192
|
-
}
|
|
1191
|
+
oldValue: 0,
|
|
1192
|
+
},
|
|
1193
1193
|
},
|
|
1194
|
-
'typeid': 'mysample:point2d-1.0.0'
|
|
1195
|
-
}
|
|
1196
|
-
]
|
|
1197
|
-
]
|
|
1198
|
-
]
|
|
1199
|
-
}
|
|
1200
|
-
}
|
|
1201
|
-
}
|
|
1194
|
+
'typeid': 'mysample:point2d-1.0.0',
|
|
1195
|
+
},
|
|
1196
|
+
],
|
|
1197
|
+
],
|
|
1198
|
+
],
|
|
1199
|
+
},
|
|
1200
|
+
},
|
|
1201
|
+
},
|
|
1202
1202
|
});
|
|
1203
1203
|
changeSet.toInverseChangeSet();
|
|
1204
1204
|
expect(changeSet.getSerializedChangeSet()).to.eql({
|
|
@@ -1213,34 +1213,34 @@ describe('Reversible ChangeSets', function () {
|
|
|
1213
1213
|
'Float64': {
|
|
1214
1214
|
'x': {
|
|
1215
1215
|
value: 0,
|
|
1216
|
-
oldValue: 15.104284463262685
|
|
1217
|
-
}
|
|
1216
|
+
oldValue: 15.104284463262685,
|
|
1217
|
+
},
|
|
1218
1218
|
},
|
|
1219
|
-
'typeid': 'mysample:point2d-1.0.0'
|
|
1220
|
-
}
|
|
1221
|
-
]
|
|
1222
|
-
]
|
|
1223
|
-
]
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1219
|
+
'typeid': 'mysample:point2d-1.0.0',
|
|
1220
|
+
},
|
|
1221
|
+
],
|
|
1222
|
+
],
|
|
1223
|
+
],
|
|
1224
|
+
},
|
|
1225
|
+
},
|
|
1226
|
+
},
|
|
1227
1227
|
});
|
|
1228
1228
|
});
|
|
1229
1229
|
it('should correctly reverse inserts of strings', function () {
|
|
1230
1230
|
let CS = new ChangeSet({
|
|
1231
1231
|
insert: {
|
|
1232
1232
|
'String': {
|
|
1233
|
-
'test': 'xxx'
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1233
|
+
'test': 'xxx',
|
|
1234
|
+
},
|
|
1235
|
+
},
|
|
1236
1236
|
});
|
|
1237
1237
|
CS.toInverseChangeSet();
|
|
1238
1238
|
expect(CS.getSerializedChangeSet()).to.deep.equal({
|
|
1239
1239
|
'remove': {
|
|
1240
1240
|
'String': {
|
|
1241
|
-
'test': 'xxx'
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1241
|
+
'test': 'xxx',
|
|
1242
|
+
},
|
|
1243
|
+
},
|
|
1244
1244
|
});
|
|
1245
1245
|
});
|
|
1246
1246
|
it('should correctly reverse inserts of literal strings within NodeProperties', function () {
|
|
@@ -1250,12 +1250,12 @@ describe('Reversible ChangeSets', function () {
|
|
|
1250
1250
|
'test': {
|
|
1251
1251
|
insert: {
|
|
1252
1252
|
'String': {
|
|
1253
|
-
'test': 'xxx'
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1253
|
+
'test': 'xxx',
|
|
1254
|
+
},
|
|
1255
|
+
},
|
|
1256
|
+
},
|
|
1257
|
+
},
|
|
1258
|
+
},
|
|
1259
1259
|
});
|
|
1260
1260
|
CS.toInverseChangeSet();
|
|
1261
1261
|
expect(CS.getSerializedChangeSet()).to.deep.equal({
|
|
@@ -1264,12 +1264,12 @@ describe('Reversible ChangeSets', function () {
|
|
|
1264
1264
|
'test': {
|
|
1265
1265
|
'remove': {
|
|
1266
1266
|
'String': {
|
|
1267
|
-
'test': 'xxx'
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
}
|
|
1271
|
-
}
|
|
1272
|
-
}
|
|
1267
|
+
'test': 'xxx',
|
|
1268
|
+
},
|
|
1269
|
+
},
|
|
1270
|
+
},
|
|
1271
|
+
},
|
|
1272
|
+
},
|
|
1273
1273
|
});
|
|
1274
1274
|
});
|
|
1275
1275
|
it('@regression should not fail when building reversible change sets', function () {
|
|
@@ -1289,7 +1289,7 @@ describe('Reversible ChangeSets', function () {
|
|
|
1289
1289
|
'autodesk.compute:fanOut-1.0.0': {
|
|
1290
1290
|
'a7e7d213-1202-9ee4-a3c1-8a33d6f36122': {
|
|
1291
1291
|
'autodesk.compute:context-1.0.0': {
|
|
1292
|
-
'computeContext': { 'Reference<autodesk.compute:resource-2.0.0>': { 'resource': '/8ce10fdd-b2b6-7152-21dc-c0e199b579e3' } }
|
|
1292
|
+
'computeContext': { 'Reference<autodesk.compute:resource-2.0.0>': { 'resource': '/8ce10fdd-b2b6-7152-21dc-c0e199b579e3' } },
|
|
1293
1293
|
},
|
|
1294
1294
|
'map<autodesk.compute:node-2.0.0>': {
|
|
1295
1295
|
'computeNodes': {
|
|
@@ -1299,26 +1299,26 @@ describe('Reversible ChangeSets', function () {
|
|
|
1299
1299
|
'enum<Enum>': { 'status': 1 }, 'autodesk.compute:context-1.0.0': {
|
|
1300
1300
|
'computeContext': {
|
|
1301
1301
|
'Reference<autodesk.compute:resource-2.0.0>': {
|
|
1302
|
-
'resource': '/c1a811ea-608e-5fcc-1487-c74ab6939dee'
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1302
|
+
'resource': '/c1a811ea-608e-5fcc-1487-c74ab6939dee',
|
|
1303
|
+
},
|
|
1304
|
+
},
|
|
1305
1305
|
}, 'Reference<autodesk.core:user-1.0.0>': {
|
|
1306
1306
|
'inputs.input': '/5eb6ebe1-92c8-52fa-984b-b0b65c46d2a7.computeNodes[a7e7d213-1202-9ee4-a3c1-8a33d6f36122]' +
|
|
1307
|
-
'.intermediateProperties[2c06da5c-8614-e9c2-3bd6-75ae739eba4f]'
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
}
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
}
|
|
1320
|
-
}
|
|
1321
|
-
}
|
|
1307
|
+
'.intermediateProperties[2c06da5c-8614-e9c2-3bd6-75ae739eba4f]',
|
|
1308
|
+
},
|
|
1309
|
+
},
|
|
1310
|
+
},
|
|
1311
|
+
},
|
|
1312
|
+
},
|
|
1313
|
+
},
|
|
1314
|
+
},
|
|
1315
|
+
},
|
|
1316
|
+
},
|
|
1317
|
+
},
|
|
1318
|
+
},
|
|
1319
|
+
},
|
|
1320
|
+
},
|
|
1321
|
+
},
|
|
1322
1322
|
};
|
|
1323
1323
|
var parent = {
|
|
1324
1324
|
'insert': {
|
|
@@ -1330,28 +1330,28 @@ describe('Reversible ChangeSets', function () {
|
|
|
1330
1330
|
'autodesk.compute:fanOut-1.0.0': {
|
|
1331
1331
|
'a7e7d213-1202-9ee4-a3c1-8a33d6f36122': {
|
|
1332
1332
|
'autodesk.compute:context-1.0.0': {
|
|
1333
|
-
'computeContext': { 'Reference<autodesk.compute:resource-2.0.0>': { 'resource': '' } }
|
|
1333
|
+
'computeContext': { 'Reference<autodesk.compute:resource-2.0.0>': { 'resource': '' } },
|
|
1334
1334
|
}, 'map<autodesk.compute:node-2.0.0>': {
|
|
1335
1335
|
'computeNodes': {
|
|
1336
1336
|
'insert': {
|
|
1337
1337
|
'autodesk.test:testCN-1.0.0': {
|
|
1338
1338
|
'1e924300-92ef-eaad-391f-53b77fe01099': {
|
|
1339
1339
|
'enum<Enum>': { 'status': 0 }, 'autodesk.compute:context-1.0.0': {
|
|
1340
|
-
'computeContext': { 'Reference<autodesk.compute:resource-2.0.0>': { 'resource': '' } }
|
|
1341
|
-
}, 'Reference<autodesk.core:user-1.0.0>': { 'inputs.input': '' }
|
|
1342
|
-
}
|
|
1343
|
-
}
|
|
1344
|
-
}
|
|
1345
|
-
}
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
}
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
1340
|
+
'computeContext': { 'Reference<autodesk.compute:resource-2.0.0>': { 'resource': '' } },
|
|
1341
|
+
}, 'Reference<autodesk.core:user-1.0.0>': { 'inputs.input': '' },
|
|
1342
|
+
},
|
|
1343
|
+
},
|
|
1344
|
+
},
|
|
1345
|
+
},
|
|
1346
|
+
},
|
|
1347
|
+
},
|
|
1348
|
+
},
|
|
1349
|
+
},
|
|
1350
|
+
},
|
|
1351
|
+
},
|
|
1352
|
+
},
|
|
1353
|
+
},
|
|
1354
|
+
},
|
|
1355
1355
|
};
|
|
1356
1356
|
var b = new ChangeSet(cs);
|
|
1357
1357
|
b._toReversibleChangeSet(parent);
|