@itwin/core-backend 5.1.0-dev.27 → 5.1.0-dev.29
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/lib/cjs/Category.d.ts +4 -4
- package/lib/cjs/Category.js +4 -4
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/CodeSpecs.d.ts +1 -1
- package/lib/cjs/CodeSpecs.js +1 -1
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +4 -4
- package/lib/cjs/DisplayStyle.js +3 -3
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/Element.d.ts +50 -50
- package/lib/cjs/Element.js +50 -50
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +7 -7
- package/lib/cjs/ElementAspect.d.ts.map +1 -1
- package/lib/cjs/ElementAspect.js +7 -7
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/Entity.d.ts +2 -2
- package/lib/cjs/Entity.js +1 -1
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +6 -6
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +27 -15
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/Model.d.ts +22 -22
- package/lib/cjs/Model.js +22 -22
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/TextAnnotationElement.d.ts +2 -2
- package/lib/cjs/TextAnnotationElement.js +2 -2
- package/lib/cjs/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/Texture.d.ts +1 -1
- package/lib/cjs/Texture.js +1 -1
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +4 -4
- package/lib/cjs/TxnManager.js +1 -1
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +14 -14
- package/lib/cjs/ViewDefinition.js +14 -14
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/esm/Category.d.ts +4 -4
- package/lib/esm/Category.js +4 -4
- package/lib/esm/Category.js.map +1 -1
- package/lib/esm/CodeSpecs.d.ts +1 -1
- package/lib/esm/CodeSpecs.js +1 -1
- package/lib/esm/CodeSpecs.js.map +1 -1
- package/lib/esm/DisplayStyle.d.ts +4 -4
- package/lib/esm/DisplayStyle.js +3 -3
- package/lib/esm/DisplayStyle.js.map +1 -1
- package/lib/esm/Element.d.ts +50 -50
- package/lib/esm/Element.js +50 -50
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementAspect.d.ts +7 -7
- package/lib/esm/ElementAspect.d.ts.map +1 -1
- package/lib/esm/ElementAspect.js +7 -7
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/Entity.d.ts +2 -2
- package/lib/esm/Entity.js +1 -1
- package/lib/esm/Entity.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +6 -6
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +28 -16
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/Model.d.ts +22 -22
- package/lib/esm/Model.js +22 -22
- package/lib/esm/Model.js.map +1 -1
- package/lib/esm/TextAnnotationElement.d.ts +2 -2
- package/lib/esm/TextAnnotationElement.js +2 -2
- package/lib/esm/TextAnnotationElement.js.map +1 -1
- package/lib/esm/Texture.d.ts +1 -1
- package/lib/esm/Texture.js +1 -1
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +4 -4
- package/lib/esm/TxnManager.js +1 -1
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts +14 -14
- package/lib/esm/ViewDefinition.js +14 -14
- package/lib/esm/ViewDefinition.js.map +1 -1
- package/lib/esm/test/imodel/IModel.test.js +32 -3
- package/lib/esm/test/imodel/IModel.test.js.map +1 -1
- package/package.json +12 -12
package/lib/cjs/IModelDb.js
CHANGED
|
@@ -1481,7 +1481,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1481
1481
|
/** @public */
|
|
1482
1482
|
(function (IModelDb) {
|
|
1483
1483
|
/** The collection of models in an [[IModelDb]].
|
|
1484
|
-
* @public
|
|
1484
|
+
* @public @preview
|
|
1485
1485
|
*/
|
|
1486
1486
|
class Models {
|
|
1487
1487
|
_iModel;
|
|
@@ -1635,7 +1635,9 @@ function processSchemaWriteStatus(status) {
|
|
|
1635
1635
|
return props.id = this._iModel[Symbols_1._nativeDb].insertModel(props);
|
|
1636
1636
|
}
|
|
1637
1637
|
catch (err) {
|
|
1638
|
-
|
|
1638
|
+
const error = new core_common_1.IModelError(err.errorNumber, `Error inserting model [${err.message}], class=${props.classFullName}`);
|
|
1639
|
+
error.cause = err;
|
|
1640
|
+
throw error;
|
|
1639
1641
|
}
|
|
1640
1642
|
}
|
|
1641
1643
|
/** Update an existing model.
|
|
@@ -1649,7 +1651,9 @@ function processSchemaWriteStatus(status) {
|
|
|
1649
1651
|
this._iModel[Symbols_1._nativeDb].updateModel(props);
|
|
1650
1652
|
}
|
|
1651
1653
|
catch (err) {
|
|
1652
|
-
|
|
1654
|
+
const error = new core_common_1.IModelError(err.errorNumber, `Error updating model [${err.message}], id: ${props.id}`);
|
|
1655
|
+
error.cause = err;
|
|
1656
|
+
throw error;
|
|
1653
1657
|
}
|
|
1654
1658
|
}
|
|
1655
1659
|
/** Mark the geometry of [[GeometricModel]] as having changed, by recording an indirect change to its GeometryGuid property.
|
|
@@ -1665,7 +1669,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1665
1669
|
this._iModel.models[Symbols_1._cache].delete(modelId);
|
|
1666
1670
|
const error = this._iModel[Symbols_1._nativeDb].updateModelGeometryGuid(modelId);
|
|
1667
1671
|
if (error !== core_bentley_1.IModelStatus.Success)
|
|
1668
|
-
throw new core_common_1.IModelError(error, `updating geometry guid for model ${modelId}`);
|
|
1672
|
+
throw new core_common_1.IModelError(error, `Error updating geometry guid for model ${modelId}`);
|
|
1669
1673
|
}
|
|
1670
1674
|
/** Delete one or more existing models.
|
|
1671
1675
|
* @param ids The Ids of the models to be deleted
|
|
@@ -1678,7 +1682,9 @@ function processSchemaWriteStatus(status) {
|
|
|
1678
1682
|
this._iModel[Symbols_1._nativeDb].deleteModel(id);
|
|
1679
1683
|
}
|
|
1680
1684
|
catch (err) {
|
|
1681
|
-
|
|
1685
|
+
const error = new core_common_1.IModelError(err.errorNumber, `Error deleting model [${err.message}], id: ${id}`);
|
|
1686
|
+
error.cause = err;
|
|
1687
|
+
throw error;
|
|
1682
1688
|
}
|
|
1683
1689
|
});
|
|
1684
1690
|
}
|
|
@@ -1708,7 +1714,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1708
1714
|
}
|
|
1709
1715
|
IModelDb.Models = Models;
|
|
1710
1716
|
/** The collection of elements in an [[IModelDb]].
|
|
1711
|
-
* @public
|
|
1717
|
+
* @public @preview
|
|
1712
1718
|
*/
|
|
1713
1719
|
class Elements {
|
|
1714
1720
|
_iModel;
|
|
@@ -1886,7 +1892,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1886
1892
|
/** Insert a new element into the iModel.
|
|
1887
1893
|
* @param elProps The properties of the new element.
|
|
1888
1894
|
* @returns The newly inserted element's Id.
|
|
1889
|
-
* @throws [[
|
|
1895
|
+
* @throws [[ITwinError]] if unable to insert the element.
|
|
1890
1896
|
* @note For convenience, the value of `elProps.id` is updated to reflect the resultant element's id.
|
|
1891
1897
|
* However when `elProps.federationGuid` is not present or undefined, a new Guid will be generated and stored on the resultant element. But
|
|
1892
1898
|
* the value of `elProps.federationGuid` is *not* updated. Generally, it is best to re-read the element after inserting (e.g. via [[getElementProps]])
|
|
@@ -1916,7 +1922,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1916
1922
|
* @param elProps the properties of the element to update.
|
|
1917
1923
|
* @note The values of `classFullName` and `model` *may not be changed* by this method. Further, it will permute the `elProps` object by adding or
|
|
1918
1924
|
* overwriting their values to the correct values.
|
|
1919
|
-
* @throws [[
|
|
1925
|
+
* @throws [[ITwinError]] if unable to update the element.
|
|
1920
1926
|
*/
|
|
1921
1927
|
updateElement(elProps) {
|
|
1922
1928
|
try {
|
|
@@ -1935,7 +1941,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1935
1941
|
}
|
|
1936
1942
|
/** Delete one or more elements from this iModel.
|
|
1937
1943
|
* @param ids The set of Ids of the element(s) to be deleted
|
|
1938
|
-
* @throws [[
|
|
1944
|
+
* @throws [[ITwinError]]
|
|
1939
1945
|
* @see deleteDefinitionElements
|
|
1940
1946
|
*/
|
|
1941
1947
|
deleteElement(ids) {
|
|
@@ -2222,7 +2228,9 @@ function processSchemaWriteStatus(status) {
|
|
|
2222
2228
|
return this._iModel[Symbols_1._nativeDb].insertElementAspect(aspectProps);
|
|
2223
2229
|
}
|
|
2224
2230
|
catch (err) {
|
|
2225
|
-
|
|
2231
|
+
const error = new core_common_1.IModelError(err.errorNumber, `Error inserting ElementAspect [${err.message}], class: ${aspectProps.classFullName}`, aspectProps);
|
|
2232
|
+
error.cause = err;
|
|
2233
|
+
throw error;
|
|
2226
2234
|
}
|
|
2227
2235
|
}
|
|
2228
2236
|
/** Update an exist ElementAspect within the iModel.
|
|
@@ -2234,7 +2242,9 @@ function processSchemaWriteStatus(status) {
|
|
|
2234
2242
|
this._iModel[Symbols_1._nativeDb].updateElementAspect(aspectProps);
|
|
2235
2243
|
}
|
|
2236
2244
|
catch (err) {
|
|
2237
|
-
|
|
2245
|
+
const error = new core_common_1.IModelError(err.errorNumber, `Error updating ElementAspect [${err.message}], id: ${aspectProps.id}`, aspectProps);
|
|
2246
|
+
error.cause = err;
|
|
2247
|
+
throw error;
|
|
2238
2248
|
}
|
|
2239
2249
|
}
|
|
2240
2250
|
/** Delete one or more ElementAspects from this iModel.
|
|
@@ -2248,14 +2258,16 @@ function processSchemaWriteStatus(status) {
|
|
|
2248
2258
|
iModel[Symbols_1._nativeDb].deleteElementAspect(aspectInstanceId);
|
|
2249
2259
|
}
|
|
2250
2260
|
catch (err) {
|
|
2251
|
-
|
|
2261
|
+
const error = new core_common_1.IModelError(err.errorNumber, `Error deleting ElementAspect [${err.message}], id: ${aspectInstanceId}`);
|
|
2262
|
+
error.cause = err;
|
|
2263
|
+
throw error;
|
|
2252
2264
|
}
|
|
2253
2265
|
});
|
|
2254
2266
|
}
|
|
2255
2267
|
}
|
|
2256
2268
|
IModelDb.Elements = Elements;
|
|
2257
2269
|
/** The collection of views in an [[IModelDb]].
|
|
2258
|
-
* @public
|
|
2270
|
+
* @public @preview
|
|
2259
2271
|
*/
|
|
2260
2272
|
class Views {
|
|
2261
2273
|
_iModel;
|
|
@@ -2281,7 +2293,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2281
2293
|
if (undefined === props) {
|
|
2282
2294
|
const propsString = this._iModel.queryFilePropertyString(Views.viewStoreProperty);
|
|
2283
2295
|
if (!propsString)
|
|
2284
|
-
|
|
2296
|
+
core_common_1.ViewStoreError.throwError("no-viewstore", { message: "iModel does not have a default ViewStore" });
|
|
2285
2297
|
props = JSON.parse(propsString);
|
|
2286
2298
|
}
|
|
2287
2299
|
const accessToken = await CloudSqlite_1.CloudSqlite.requestToken({
|
|
@@ -2402,7 +2414,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2402
2414
|
}
|
|
2403
2415
|
getViewThumbnailArg(viewDefinitionId) {
|
|
2404
2416
|
if (!core_bentley_1.Id64.isValid(viewDefinitionId))
|
|
2405
|
-
throw new
|
|
2417
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadArg, "illegal thumbnail id");
|
|
2406
2418
|
return { namespace: "dgn_View", name: "Thumbnail", id: viewDefinitionId };
|
|
2407
2419
|
}
|
|
2408
2420
|
/** Get the thumbnail for a view.
|