@itwin/core-backend 4.10.0-dev.0 → 4.10.0-dev.10
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/CHANGELOG.md +23 -1
- package/lib/cjs/BriefcaseManager.d.ts +16 -1
- package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
- package/lib/cjs/BriefcaseManager.js +46 -1
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/ChangedElementsManager.d.ts +4 -2
- package/lib/cjs/ChangedElementsManager.d.ts.map +1 -1
- package/lib/cjs/ChangedElementsManager.js +4 -2
- package/lib/cjs/ChangedElementsManager.js.map +1 -1
- package/lib/cjs/Element.d.ts +7 -0
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +10 -2
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +18 -3
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +78 -1
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelHost.js +1 -1
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/Model.d.ts +14 -0
- package/lib/cjs/Model.d.ts.map +1 -1
- package/lib/cjs/Model.js +28 -1
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/NavigationRelationship.d.ts +28 -0
- package/lib/cjs/NavigationRelationship.d.ts.map +1 -1
- package/lib/cjs/NavigationRelationship.js +41 -1
- package/lib/cjs/NavigationRelationship.js.map +1 -1
- package/lib/cjs/SchemaSync.d.ts +1 -0
- package/lib/cjs/SchemaSync.d.ts.map +1 -1
- package/lib/cjs/SchemaSync.js +3 -0
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/SheetIndex.d.ts +148 -0
- package/lib/cjs/SheetIndex.d.ts.map +1 -0
- package/lib/cjs/SheetIndex.js +230 -0
- package/lib/cjs/SheetIndex.js.map +1 -0
- package/lib/cjs/core-backend.d.ts +1 -0
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +1 -0
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +1 -0
- package/lib/cjs/rpc-impl/WipRpcImpl.d.ts.map +1 -1
- package/lib/cjs/rpc-impl/WipRpcImpl.js +2 -0
- package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
- package/package.json +12 -12
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module Relationships
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.ExternalSourceAttachmentAttachesSource = exports.ExternalSourceIsInRepository = exports.ElementOwnsExternalSourceAspects = exports.ElementOwnsMultiAspects = exports.ElementOwnsUniqueAspect = exports.PhysicalTypeIsOfPhysicalMaterial = exports.PhysicalElementIsOfPhysicalMaterial = exports.PhysicalElementIsOfType = exports.SpatialLocationIsOfType = exports.GeometricElement3dHasTypeDefinition = exports.GraphicalElement2dIsOfType = exports.GeometricElement2dHasTypeDefinition = exports.FolderContainsRepositories = exports.ExternalSourceOwnsAttachments = exports.PhysicalElementAssemblesElements = exports.ElementEncapsulatesElements = exports.RenderMaterialOwnsRenderMaterials = exports.CategoryOwnsSubCategories = exports.SubjectOwnsPartitionElements = exports.SubjectOwnsSubjects = exports.ElementOwnsChildElements = void 0;
|
|
10
|
+
exports.SheetIndexReferenceRefersToSheetIndex = exports.SheetReferenceRefersToSheet = exports.ExternalSourceAttachmentAttachesSource = exports.ExternalSourceIsInRepository = exports.ElementOwnsExternalSourceAspects = exports.ElementOwnsMultiAspects = exports.ElementOwnsUniqueAspect = exports.PhysicalTypeIsOfPhysicalMaterial = exports.PhysicalElementIsOfPhysicalMaterial = exports.PhysicalElementIsOfType = exports.SpatialLocationIsOfType = exports.GeometricElement3dHasTypeDefinition = exports.GraphicalElement2dIsOfType = exports.GeometricElement2dHasTypeDefinition = exports.SheetIndexOwnsEntries = exports.SheetIndexFolderOwnsEntries = exports.FolderContainsRepositories = exports.ExternalSourceOwnsAttachments = exports.PhysicalElementAssemblesElements = exports.ElementEncapsulatesElements = exports.RenderMaterialOwnsRenderMaterials = exports.CategoryOwnsSubCategories = exports.SubjectOwnsPartitionElements = exports.SubjectOwnsSubjects = exports.ElementOwnsChildElements = void 0;
|
|
11
11
|
const core_common_1 = require("@itwin/core-common");
|
|
12
12
|
/** Relates a parent Element to child Elements which represent parts of the Entity modeled by the parent Element.
|
|
13
13
|
* @public
|
|
@@ -101,6 +101,26 @@ class FolderContainsRepositories extends ElementOwnsChildElements {
|
|
|
101
101
|
}
|
|
102
102
|
exports.FolderContainsRepositories = FolderContainsRepositories;
|
|
103
103
|
FolderContainsRepositories.classFullName = "BisCore:FolderContainsRepositories";
|
|
104
|
+
/** Relates a [[SheetIndexFolder]] to the [[SheetIndexEntry]]'s that it contains.
|
|
105
|
+
* @beta
|
|
106
|
+
*/
|
|
107
|
+
class SheetIndexFolderOwnsEntries extends ElementOwnsChildElements {
|
|
108
|
+
constructor(parentId, relClassName = SheetIndexFolderOwnsEntries.classFullName) {
|
|
109
|
+
super(parentId, relClassName);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.SheetIndexFolderOwnsEntries = SheetIndexFolderOwnsEntries;
|
|
113
|
+
SheetIndexFolderOwnsEntries.classFullName = "BisCore:SheetIndexFolderOwnsEntries";
|
|
114
|
+
/** Relates a [[SheetIndex]] to the [SheetIndexEntry]]'s that it contains.
|
|
115
|
+
* @beta
|
|
116
|
+
*/
|
|
117
|
+
class SheetIndexOwnsEntries extends ElementOwnsChildElements {
|
|
118
|
+
constructor(parentId, relClassName = SheetIndexOwnsEntries.classFullName) {
|
|
119
|
+
super(parentId, relClassName);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.SheetIndexOwnsEntries = SheetIndexOwnsEntries;
|
|
123
|
+
SheetIndexOwnsEntries.classFullName = "BisCore:SheetIndexOwnsEntries";
|
|
104
124
|
/** Relates a [[GeometricElement2d]] to its [[TypeDefinitionElement]]
|
|
105
125
|
* @public
|
|
106
126
|
*/
|
|
@@ -223,4 +243,24 @@ class ExternalSourceAttachmentAttachesSource extends core_common_1.RelatedElemen
|
|
|
223
243
|
}
|
|
224
244
|
exports.ExternalSourceAttachmentAttachesSource = ExternalSourceAttachmentAttachesSource;
|
|
225
245
|
ExternalSourceAttachmentAttachesSource.classFullName = "BisCore:ExternalSourceAttachmentAttachesSource";
|
|
246
|
+
/** Relates a [[SheetReference]] and [[Sheet]] that it refers.
|
|
247
|
+
* @beta
|
|
248
|
+
*/
|
|
249
|
+
class SheetReferenceRefersToSheet extends core_common_1.RelatedElement {
|
|
250
|
+
constructor(sheetId, relClassName = SheetReferenceRefersToSheet.classFullName) {
|
|
251
|
+
super({ id: sheetId, relClassName });
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
exports.SheetReferenceRefersToSheet = SheetReferenceRefersToSheet;
|
|
255
|
+
SheetReferenceRefersToSheet.classFullName = "BisCore:SheetReferenceRefersToSheet";
|
|
256
|
+
/** Relates a [[SheetIndexReference]] to a [[SheetIndex]] it refers.
|
|
257
|
+
* @beta
|
|
258
|
+
*/
|
|
259
|
+
class SheetIndexReferenceRefersToSheetIndex extends core_common_1.RelatedElement {
|
|
260
|
+
constructor(sheetIndexId, relClassName = SheetIndexReferenceRefersToSheetIndex.classFullName) {
|
|
261
|
+
super({ id: sheetIndexId, relClassName });
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
exports.SheetIndexReferenceRefersToSheetIndex = SheetIndexReferenceRefersToSheetIndex;
|
|
265
|
+
SheetIndexReferenceRefersToSheetIndex.classFullName = "BisCore:SheetIndexReferenceRefersToSheetIndex";
|
|
226
266
|
//# sourceMappingURL=NavigationRelationship.js.map
|
|
@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,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC;IACzC,CAAC;;AAJH,0DAKC;AAJe,qCAAa,GAAG,iCAAiC,CAAC;AAMlE;;GAEG;AACH,MAAa,uBAAwB,SAAQ,4BAAc;IAEzD,YAAmB,SAAqB,EAAE,eAAuB,uBAAuB,CAAC,aAAa;QACpG,KAAK,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC;IACzC,CAAC;;AAJH,0DAKC;AAJe,qCAAa,GAAG,iCAAiC,CAAC;AAMlE;;GAEG;AACH,MAAa,gCAAiC,SAAQ,uBAAuB;IAE3E,YAAmB,SAAqB,EAAE,eAAuB,gCAAgC,CAAC,aAAa;QAC7G,KAAK,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IACjC,CAAC;;AAJH,4EAKC;AAJwB,8CAAa,GAAG,0CAA0C,CAAC;AAMpF;;;GAGG;AACH,MAAa,4BAA6B,SAAQ,4BAAc;IAE9D,YAAmB,YAAwB,EAAE,eAAuB,4BAA4B,CAAC,aAAa;QAC5G,KAAK,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC;IAC5C,CAAC;;AAJH,oEAKC;AAJe,0CAAa,GAAG,sCAAsC,CAAC;AAMvE;;;GAGG;AACH,MAAa,sCAAuC,SAAQ,4BAAc;IAExE,YAAmB,gBAA4B,EAAE,eAAuB,sCAAsC,CAAC,aAAa;QAC1H,KAAK,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,YAAY,EAAE,CAAC,CAAC;IAChD,CAAC;;AAJH,wFAKC;AAJe,oDAAa,GAAG,gDAAgD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Relationships\r\n */\r\n\r\n// NOTE: A NavigationRelationship is not an Entity, so is not registered in the ClassRegistry.\r\n// NOTE: It does, however, have a classFullName property for consistency with Entity subclasses.\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { RelatedElement, TypeDefinition } from \"@itwin/core-common\";\r\n\r\n/** Relates a parent Element to child Elements which represent parts of the Entity modeled by the parent Element.\r\n * @public\r\n */\r\nexport class ElementOwnsChildElements extends RelatedElement {\r\n public static classFullName = \"BisCore:ElementOwnsChildElements\";\r\n public constructor(parentId: Id64String, relClassName: string = ElementOwnsChildElements.classFullName) {\r\n super({ id: parentId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates a parent [[Subject]] to [[Subject]] child elements.\r\n * @public\r\n */\r\nexport class SubjectOwnsSubjects extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:SubjectOwnsSubjects\";\r\n public constructor(parentId: Id64String, relClassName: string = SubjectOwnsSubjects.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[Subject]] to [[InformationPartitionElement]] child elements.\r\n * @public\r\n */\r\nexport class SubjectOwnsPartitionElements extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:SubjectOwnsPartitionElements\";\r\n public constructor(parentId: Id64String, relClassName: string = SubjectOwnsPartitionElements.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[Category]] to [[SubCategory]] child elements.\r\n * @public\r\n */\r\nexport class CategoryOwnsSubCategories extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:CategoryOwnsSubCategories\";\r\n public constructor(parentId: Id64String, relClassName: string = CategoryOwnsSubCategories.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[RenderMaterial]] to [[RenderMaterial]] child elements.\r\n * @public\r\n */\r\nexport class RenderMaterialOwnsRenderMaterials extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:RenderMaterialOwnsRenderMaterials\";\r\n public constructor(parentId: Id64String, relClassName: string = RenderMaterialOwnsRenderMaterials.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent Element to child Elements which represent **hidden** parts of the Entity.\r\n * @public\r\n */\r\nexport class ElementEncapsulatesElements extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:ElementEncapsulatesElements\";\r\n public constructor(parentId: Id64String, relClassName: string = ElementEncapsulatesElements.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[PhysicalElement]] to [[PhysicalElement]] children that it assembles.\r\n * @public\r\n */\r\nexport class PhysicalElementAssemblesElements extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:PhysicalElementAssemblesElements\";\r\n public constructor(parentId: Id64String, relClassName: string = PhysicalElementAssemblesElements.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[ExternalSource]] to its [[ExternalSourceAttachment]] children.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceOwnsAttachments extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:ExternalSourceOwnsAttachments\";\r\n public constructor(parentId: Id64String, relClassName: string = ExternalSourceOwnsAttachments.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[FolderLink]] to its [[RepositoryLink]] children.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class FolderContainsRepositories extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:FolderContainsRepositories\";\r\n public constructor(parentId: Id64String, relClassName: string = FolderContainsRepositories.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a [[GeometricElement2d]] to its [[TypeDefinitionElement]]\r\n * @public\r\n */\r\nexport class GeometricElement2dHasTypeDefinition extends TypeDefinition {\r\n public static classFullName = \"BisCore:GeometricElement2dHasTypeDefinition\";\r\n public constructor(id: Id64String, relClassName: string = GeometricElement2dHasTypeDefinition.classFullName) {\r\n super({ id, relClassName });\r\n }\r\n}\r\n\r\n/** Relates a [[GraphicalElement2d]] to its [[GraphicalType2d]]\r\n * @public\r\n */\r\nexport class GraphicalElement2dIsOfType extends GeometricElement2dHasTypeDefinition {\r\n public static override classFullName = \"BisCore:GraphicalElement2dIsOfType\";\r\n public constructor(id: Id64String, relClassName: string = GraphicalElement2dIsOfType.classFullName) {\r\n super(id, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a [[GeometricElement3d]] to its [[TypeDefinitionElement]]\r\n * @public\r\n */\r\nexport class GeometricElement3dHasTypeDefinition extends TypeDefinition {\r\n public static classFullName = \"BisCore:GeometricElement3dHasTypeDefinition\";\r\n public constructor(id: Id64String, relClassName: string = GeometricElement3dHasTypeDefinition.classFullName) {\r\n super({ id, relClassName });\r\n }\r\n}\r\n\r\n/** Relates a [[SpatialLocationElement]] to its [[SpatialLocationType]]\r\n * @public\r\n */\r\nexport class SpatialLocationIsOfType extends GeometricElement3dHasTypeDefinition {\r\n public static override classFullName = \"BisCore:SpatialLocationIsOfType\";\r\n public constructor(id: Id64String, relClassName: string = SpatialLocationIsOfType.classFullName) {\r\n super(id, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a [[PhysicalElement]] to its [[PhysicalType]]\r\n * @public\r\n */\r\nexport class PhysicalElementIsOfType extends GeometricElement3dHasTypeDefinition {\r\n public static override classFullName = \"BisCore:PhysicalElementIsOfType\";\r\n public constructor(id: Id64String, relClassName: string = PhysicalElementIsOfType.classFullName) {\r\n super(id, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a [[PhysicalElement]] to its [[PhysicalMaterial]]\r\n * @public\r\n */\r\nexport class PhysicalElementIsOfPhysicalMaterial extends RelatedElement {\r\n public static classFullName = \"BisCore:PhysicalElementIsOfPhysicalMaterial\";\r\n public constructor(id: Id64String) {\r\n super({ id });\r\n }\r\n}\r\n\r\n/** Relates a [[PhysicalType]] to its [[PhysicalMaterial]]\r\n * @public\r\n */\r\nexport class PhysicalTypeIsOfPhysicalMaterial extends RelatedElement {\r\n public static classFullName = \"BisCore:PhysicalTypeIsOfPhysicalMaterial\";\r\n public constructor(id: Id64String) {\r\n super({ id });\r\n }\r\n}\r\n\r\n/** Relates an [[Element]] and an [[ElementUniqueAspect]] that it owns.\r\n * @public\r\n */\r\nexport class ElementOwnsUniqueAspect extends RelatedElement {\r\n public static classFullName = \"BisCore:ElementOwnsUniqueAspect\";\r\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsUniqueAspect.classFullName) {\r\n super({ id: elementId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates an [[Element]] and an [[ElementMultiAspect]] that it owns.\r\n * @public\r\n */\r\nexport class ElementOwnsMultiAspects extends RelatedElement {\r\n public static classFullName = \"BisCore:ElementOwnsMultiAspects\";\r\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsMultiAspects.classFullName) {\r\n super({ id: elementId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates an [[Element]] and an [[ExternalSourceAspect]] that it owns.\r\n * @public\r\n */\r\nexport class ElementOwnsExternalSourceAspects extends ElementOwnsMultiAspects {\r\n public static override classFullName = \"BisCore:ElementOwnsExternalSourceAspects\";\r\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsExternalSourceAspects.classFullName) {\r\n super(elementId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceIsInRepository extends RelatedElement {\r\n public static classFullName = \"BisCore:ExternalSourceIsInRepository\";\r\n public constructor(repositoryId: Id64String, relClassName: string = ExternalSourceIsInRepository.classFullName) {\r\n super({ id: repositoryId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceAttachmentAttachesSource extends RelatedElement {\r\n public static classFullName = \"BisCore:ExternalSourceAttachmentAttachesSource\";\r\n public constructor(externalSourceId: Id64String, relClassName: string = ExternalSourceAttachmentAttachesSource.classFullName) {\r\n super({ id: externalSourceId, relClassName });\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"NavigationRelationship.js","sourceRoot":"","sources":["../../src/NavigationRelationship.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAMH,oDAAoE;AAEpE;;GAEG;AACH,MAAa,wBAAyB,SAAQ,4BAAc;IAE1D,YAAmB,QAAoB,EAAE,eAAuB,wBAAwB,CAAC,aAAa;QACpG,KAAK,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC;IACxC,CAAC;;AAJH,4DAKC;AAJe,sCAAa,GAAG,kCAAkC,CAAC;AAMnE;;GAEG;AACH,MAAa,mBAAoB,SAAQ,wBAAwB;IAE/D,YAAmB,QAAoB,EAAE,eAAuB,mBAAmB,CAAC,aAAa;QAC/F,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAChC,CAAC;;AAJH,kDAKC;AAJwB,iCAAa,GAAG,6BAA6B,CAAC;AAMvE;;GAEG;AACH,MAAa,4BAA6B,SAAQ,wBAAwB;IAExE,YAAmB,QAAoB,EAAE,eAAuB,4BAA4B,CAAC,aAAa;QACxG,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAChC,CAAC;;AAJH,oEAKC;AAJwB,0CAAa,GAAG,sCAAsC,CAAC;AAMhF;;GAEG;AACH,MAAa,yBAA0B,SAAQ,wBAAwB;IAErE,YAAmB,QAAoB,EAAE,eAAuB,yBAAyB,CAAC,aAAa;QACrG,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAChC,CAAC;;AAJH,8DAKC;AAJwB,uCAAa,GAAG,mCAAmC,CAAC;AAM7E;;GAEG;AAC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,EAAE,eAAuB,4BAA4B,CAAC,aAAa;QAC5G,KAAK,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC;IAC5C,CAAC;;AAJH,oEAKC;AAJe,0CAAa,GAAG,sCAAsC,CAAC;AAMvE;;;GAGG;AACH,MAAa,sCAAuC,SAAQ,4BAAc;IAExE,YAAmB,gBAA4B,EAAE,eAAuB,sCAAsC,CAAC,aAAa;QAC1H,KAAK,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,YAAY,EAAE,CAAC,CAAC;IAChD,CAAC;;AAJH,wFAKC;AAJe,oDAAa,GAAG,gDAAgD,CAAC;AAMjF;;GAEG;AACH,MAAa,2BAA4B,SAAQ,4BAAc;IAE7D,YAAmB,OAAmB,EAAE,eAAuB,2BAA2B,CAAC,aAAa;QACtG,KAAK,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;IACvC,CAAC;;AAJH,kEAKC;AAJe,yCAAa,GAAG,qCAAqC,CAAC;AAMtE;;GAEG;AACH,MAAa,qCAAsC,SAAQ,4BAAc;IAEvE,YAAmB,YAAwB,EAAE,eAAuB,qCAAqC,CAAC,aAAa;QACrH,KAAK,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC;IAC5C,CAAC;;AAJH,sFAKC;AAJe,mDAAa,GAAG,+CAA+C,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Relationships\r\n */\r\n\r\n// NOTE: A NavigationRelationship is not an Entity, so is not registered in the ClassRegistry.\r\n// NOTE: It does, however, have a classFullName property for consistency with Entity subclasses.\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { RelatedElement, TypeDefinition } from \"@itwin/core-common\";\r\n\r\n/** Relates a parent Element to child Elements which represent parts of the Entity modeled by the parent Element.\r\n * @public\r\n */\r\nexport class ElementOwnsChildElements extends RelatedElement {\r\n public static classFullName = \"BisCore:ElementOwnsChildElements\";\r\n public constructor(parentId: Id64String, relClassName: string = ElementOwnsChildElements.classFullName) {\r\n super({ id: parentId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates a parent [[Subject]] to [[Subject]] child elements.\r\n * @public\r\n */\r\nexport class SubjectOwnsSubjects extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:SubjectOwnsSubjects\";\r\n public constructor(parentId: Id64String, relClassName: string = SubjectOwnsSubjects.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[Subject]] to [[InformationPartitionElement]] child elements.\r\n * @public\r\n */\r\nexport class SubjectOwnsPartitionElements extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:SubjectOwnsPartitionElements\";\r\n public constructor(parentId: Id64String, relClassName: string = SubjectOwnsPartitionElements.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[Category]] to [[SubCategory]] child elements.\r\n * @public\r\n */\r\nexport class CategoryOwnsSubCategories extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:CategoryOwnsSubCategories\";\r\n public constructor(parentId: Id64String, relClassName: string = CategoryOwnsSubCategories.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[RenderMaterial]] to [[RenderMaterial]] child elements.\r\n * @public\r\n */\r\nexport class RenderMaterialOwnsRenderMaterials extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:RenderMaterialOwnsRenderMaterials\";\r\n public constructor(parentId: Id64String, relClassName: string = RenderMaterialOwnsRenderMaterials.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent Element to child Elements which represent **hidden** parts of the Entity.\r\n * @public\r\n */\r\nexport class ElementEncapsulatesElements extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:ElementEncapsulatesElements\";\r\n public constructor(parentId: Id64String, relClassName: string = ElementEncapsulatesElements.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[PhysicalElement]] to [[PhysicalElement]] children that it assembles.\r\n * @public\r\n */\r\nexport class PhysicalElementAssemblesElements extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:PhysicalElementAssemblesElements\";\r\n public constructor(parentId: Id64String, relClassName: string = PhysicalElementAssemblesElements.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[ExternalSource]] to its [[ExternalSourceAttachment]] children.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceOwnsAttachments extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:ExternalSourceOwnsAttachments\";\r\n public constructor(parentId: Id64String, relClassName: string = ExternalSourceOwnsAttachments.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[FolderLink]] to its [[RepositoryLink]] children.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class FolderContainsRepositories extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:FolderContainsRepositories\";\r\n public constructor(parentId: Id64String, relClassName: string = FolderContainsRepositories.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a [[SheetIndexFolder]] to the [[SheetIndexEntry]]'s that it contains.\r\n * @beta\r\n */\r\nexport class SheetIndexFolderOwnsEntries extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:SheetIndexFolderOwnsEntries\";\r\n public constructor(parentId: Id64String, relClassName: string = SheetIndexFolderOwnsEntries.classFullName) {\r\n super(parentId, relClassName );\r\n }\r\n}\r\n\r\n/** Relates a [[SheetIndex]] to the [SheetIndexEntry]]'s that it contains.\r\n * @beta\r\n */\r\nexport class SheetIndexOwnsEntries extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:SheetIndexOwnsEntries\";\r\n public constructor(parentId: Id64String, relClassName: string = SheetIndexOwnsEntries.classFullName) {\r\n super(parentId, relClassName );\r\n }\r\n}\r\n\r\n/** Relates a [[GeometricElement2d]] to its [[TypeDefinitionElement]]\r\n * @public\r\n */\r\nexport class GeometricElement2dHasTypeDefinition extends TypeDefinition {\r\n public static classFullName = \"BisCore:GeometricElement2dHasTypeDefinition\";\r\n public constructor(id: Id64String, relClassName: string = GeometricElement2dHasTypeDefinition.classFullName) {\r\n super({ id, relClassName });\r\n }\r\n}\r\n\r\n/** Relates a [[GraphicalElement2d]] to its [[GraphicalType2d]]\r\n * @public\r\n */\r\nexport class GraphicalElement2dIsOfType extends GeometricElement2dHasTypeDefinition {\r\n public static override classFullName = \"BisCore:GraphicalElement2dIsOfType\";\r\n public constructor(id: Id64String, relClassName: string = GraphicalElement2dIsOfType.classFullName) {\r\n super(id, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a [[GeometricElement3d]] to its [[TypeDefinitionElement]]\r\n * @public\r\n */\r\nexport class GeometricElement3dHasTypeDefinition extends TypeDefinition {\r\n public static classFullName = \"BisCore:GeometricElement3dHasTypeDefinition\";\r\n public constructor(id: Id64String, relClassName: string = GeometricElement3dHasTypeDefinition.classFullName) {\r\n super({ id, relClassName });\r\n }\r\n}\r\n\r\n/** Relates a [[SpatialLocationElement]] to its [[SpatialLocationType]]\r\n * @public\r\n */\r\nexport class SpatialLocationIsOfType extends GeometricElement3dHasTypeDefinition {\r\n public static override classFullName = \"BisCore:SpatialLocationIsOfType\";\r\n public constructor(id: Id64String, relClassName: string = SpatialLocationIsOfType.classFullName) {\r\n super(id, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a [[PhysicalElement]] to its [[PhysicalType]]\r\n * @public\r\n */\r\nexport class PhysicalElementIsOfType extends GeometricElement3dHasTypeDefinition {\r\n public static override classFullName = \"BisCore:PhysicalElementIsOfType\";\r\n public constructor(id: Id64String, relClassName: string = PhysicalElementIsOfType.classFullName) {\r\n super(id, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a [[PhysicalElement]] to its [[PhysicalMaterial]]\r\n * @public\r\n */\r\nexport class PhysicalElementIsOfPhysicalMaterial extends RelatedElement {\r\n public static classFullName = \"BisCore:PhysicalElementIsOfPhysicalMaterial\";\r\n public constructor(id: Id64String) {\r\n super({ id });\r\n }\r\n}\r\n\r\n/** Relates a [[PhysicalType]] to its [[PhysicalMaterial]]\r\n * @public\r\n */\r\nexport class PhysicalTypeIsOfPhysicalMaterial extends RelatedElement {\r\n public static classFullName = \"BisCore:PhysicalTypeIsOfPhysicalMaterial\";\r\n public constructor(id: Id64String) {\r\n super({ id });\r\n }\r\n}\r\n\r\n/** Relates an [[Element]] and an [[ElementUniqueAspect]] that it owns.\r\n * @public\r\n */\r\nexport class ElementOwnsUniqueAspect extends RelatedElement {\r\n public static classFullName = \"BisCore:ElementOwnsUniqueAspect\";\r\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsUniqueAspect.classFullName) {\r\n super({ id: elementId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates an [[Element]] and an [[ElementMultiAspect]] that it owns.\r\n * @public\r\n */\r\nexport class ElementOwnsMultiAspects extends RelatedElement {\r\n public static classFullName = \"BisCore:ElementOwnsMultiAspects\";\r\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsMultiAspects.classFullName) {\r\n super({ id: elementId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates an [[Element]] and an [[ExternalSourceAspect]] that it owns.\r\n * @public\r\n */\r\nexport class ElementOwnsExternalSourceAspects extends ElementOwnsMultiAspects {\r\n public static override classFullName = \"BisCore:ElementOwnsExternalSourceAspects\";\r\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsExternalSourceAspects.classFullName) {\r\n super(elementId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceIsInRepository extends RelatedElement {\r\n public static classFullName = \"BisCore:ExternalSourceIsInRepository\";\r\n public constructor(repositoryId: Id64String, relClassName: string = ExternalSourceIsInRepository.classFullName) {\r\n super({ id: repositoryId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceAttachmentAttachesSource extends RelatedElement {\r\n public static classFullName = \"BisCore:ExternalSourceAttachmentAttachesSource\";\r\n public constructor(externalSourceId: Id64String, relClassName: string = ExternalSourceAttachmentAttachesSource.classFullName) {\r\n super({ id: externalSourceId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates a [[SheetReference]] and [[Sheet]] that it refers.\r\n * @beta\r\n */\r\nexport class SheetReferenceRefersToSheet extends RelatedElement {\r\n public static classFullName = \"BisCore:SheetReferenceRefersToSheet\";\r\n public constructor(sheetId: Id64String, relClassName: string = SheetReferenceRefersToSheet.classFullName) {\r\n super({ id: sheetId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates a [[SheetIndexReference]] to a [[SheetIndex]] it refers.\r\n * @beta\r\n */\r\nexport class SheetIndexReferenceRefersToSheetIndex extends RelatedElement {\r\n public static classFullName = \"BisCore:SheetIndexReferenceRefersToSheetIndex\";\r\n public constructor(sheetIndexId: Id64String, relClassName: string = SheetIndexReferenceRefersToSheetIndex.classFullName) {\r\n super({ id: sheetIndexId, relClassName });\r\n }\r\n}\r\n"]}
|
package/lib/cjs/SchemaSync.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export declare namespace SchemaSync {
|
|
|
24
24
|
const withReadonlyAccess: (iModel: IModelDb | {
|
|
25
25
|
readonly fileName: LocalFileName;
|
|
26
26
|
}, operation: (access: CloudAccess) => Promise<void>) => Promise<void>;
|
|
27
|
+
const isEnabled: (iModel: IModelDb) => boolean;
|
|
27
28
|
/** Synchronize local briefcase schemas with cloud container */
|
|
28
29
|
const pull: (iModel: IModelDb) => Promise<void>;
|
|
29
30
|
const initializeForIModel: (arg: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaSync.d.ts","sourceRoot":"","sources":["../../src/SchemaSync.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAe,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAY,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAe,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKhE,gBAAgB;AAChB,yBAAiB,UAAU,CAAC;IAG1B,kFAAkF;IAClF,MAAa,YAAa,SAAQ,iBAAiB;QACjD,SAAyB,SAAS,WAAW;kBAC1B,SAAS;KAC7B;IAMM,MAAM,YAAY,WAAY,QAAQ,cAAc,MAAM,SAKhE,CAAC;IA+BK,MAAM,gBAAgB,WAAkB,QAAQ,GAAG;QAAE,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAA;KAAE,QAAQ;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,sBAAsB,WAAW,KAAK,QAAQ,IAAI,CAAC,KAAG,QAAQ,IAAI,CAOpO,CAAC;IAEK,MAAM,kBAAkB,WAAkB,QAAQ,GAAG;QAAE,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAA;KAAE,sBAAsB,WAAW,KAAK,QAAQ,IAAI,CAAC,KAAG,QAAQ,IAAI,CASjK,CAAC;IAEF,+DAA+D;IACxD,MAAM,IAAI,WAAkB,QAAQ,kBAS1C,CAAC;IAEK,MAA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AQ,CAAC,QAAQ,EAAE,aAAa,CAAA;KAAE,sBAAsB,WAAW,KAAK,QAAQ,IAAI,CAAC,KAAG,QAAQ,IAAI,CASjK,CAAC;IAEK,MAAM,SAAS,WAAY,QAAQ,YAEzC,CAAC;IAEF,+DAA+D;IACxD,MAAM,IAAI,WAAkB,QAAQ,kBAS1C,CAAC;IAEK,MAAM,mBAAmB,QAAe;QAAE,MAAM,EAAE,QAAQ,CAAC;QAAC,cAAc,EAAE,YAAY,cAAc,CAAC;QAAC,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAAE,kBA6B3I,CAAC;IAEF,0EAA0E;IAC1E,MAAa,WAAY,SAAQ,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC;oBAC9C,KAAK,EAAE,WAAW,CAAC,oBAAoB;QAInD,MAAM;QAGb;;;;SAIC;eACmB,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,cAAc;KAGnE;CACF"}
|
package/lib/cjs/SchemaSync.js
CHANGED
|
@@ -87,6 +87,9 @@ var SchemaSync;
|
|
|
87
87
|
access.close();
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
|
+
SchemaSync.isEnabled = (iModel) => {
|
|
91
|
+
return iModel[Symbols_1._nativeDb].schemaSyncEnabled();
|
|
92
|
+
};
|
|
90
93
|
/** Synchronize local briefcase schemas with cloud container */
|
|
91
94
|
SchemaSync.pull = async (iModel) => {
|
|
92
95
|
if (iModel[Symbols_1._nativeDb].schemaSyncEnabled() && !iModel.isReadonly) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaSync.js","sourceRoot":"","sources":["../../src/SchemaSync.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,+CAA4C;AAC5C,yCAA+C;AAC/C,yCAAmD;AACnD,sDAAyD;AACzD,oDAAgE;AAEhE,8DAAyD;AACzD,gDAA+C;AAE/C,gBAAgB;AAChB,IAAiB,UAAU,CAkI1B;AAlID,WAAiB,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AE,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;QAChE,CAAC;QAEM,MAAM;YACX,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,mBAAS,CAAC,CAAC,WAAW,EAAE,QAAQ,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,aAAa,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1I,CAAC;QACD;;;;SAIC;QACM,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,KAAiC;YAChE,OAAO,KAAK,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;QACrF,CAAC;KACF;IAhBY,sBAAW,cAgBvB,CAAA;AACH,CAAC,EAlIgB,UAAU,0BAAV,UAAU,QAkI1B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module SQLiteDb\r\n */\r\n\r\nimport { CloudSqlite } from \"./CloudSqlite\";\r\nimport { VersionedSqliteDb } from \"./SQLiteDb\";\r\nimport { BriefcaseDb, IModelDb } from \"./IModelDb\";\r\nimport { DbResult, OpenMode } from \"@itwin/core-bentley\";\r\nimport { IModelError, LocalFileName } from \"@itwin/core-common\";\r\nimport { IModelJsNative } from \"@bentley/imodeljs-native\";\r\nimport { IModelNative } from \"./internal/NativePlatform\";\r\nimport { _nativeDb } from \"./internal/Symbols\";\r\n\r\n/** @internal */\r\nexport namespace SchemaSync {\r\n const lockParams: CloudSqlite.ObtainLockParams = { retryDelayMs: 1000, nRetries: 30 };\r\n\r\n /** A CloudSqlite database for synchronizing schema changes across briefcases. */\r\n export class SchemaSyncDb extends VersionedSqliteDb {\r\n public override readonly myVersion = \"4.0.0\";\r\n protected override createDDL() { }\r\n }\r\n\r\n const syncProperty = { namespace: \"itwinjs\", name: \"SchemaSync\" };\r\n const defaultDbName = \"SchemaSyncDb\" as const;\r\n const testSyncCachePropKey = \"test.schema_sync.cache_name\" as const;\r\n // for tests only\r\n export const setTestCache = (iModel: IModelDb, cacheName?: string) => {\r\n if (cacheName)\r\n iModel[_nativeDb].saveLocalValue(testSyncCachePropKey, cacheName);\r\n else\r\n iModel[_nativeDb].deleteLocalValue(testSyncCachePropKey);\r\n };\r\n\r\n const getCloudAccess = async (arg: IModelDb | { readonly fileName: LocalFileName }) => {\r\n let nativeDb: IModelJsNative.DgnDb | undefined;\r\n const argIsIModelDb = arg instanceof IModelDb;\r\n if (argIsIModelDb) {\r\n nativeDb = arg[_nativeDb];\r\n } else {\r\n nativeDb = new IModelNative.platform.DgnDb();\r\n nativeDb.openIModel(arg.fileName, OpenMode.Readonly);\r\n }\r\n\r\n const propsString = nativeDb.queryFileProperty(syncProperty, true) as string | undefined;\r\n if (!propsString)\r\n throw new Error(\"iModel does not have a SchemaSyncDb\");\r\n try {\r\n const props = JSON.parse(propsString) as CloudSqlite.ContainerProps;\r\n const accessToken = await CloudSqlite.requestToken(props);\r\n const access = new CloudAccess({ ...props, accessToken });\r\n Object.assign(access.lockParams, lockParams);\r\n const testSyncCache = nativeDb.queryLocalValue(testSyncCachePropKey);\r\n if (testSyncCache)\r\n access.setCache(CloudSqlite.CloudCaches.getCache({ cacheName: testSyncCache }));\r\n return access;\r\n } finally {\r\n if (!argIsIModelDb) {\r\n nativeDb.closeFile();\r\n }\r\n }\r\n };\r\n\r\n export const withLockedAccess = async (iModel: IModelDb | { readonly fileName: LocalFileName }, args: { operationName: string, openMode?: OpenMode, user?: string }, operation: (access: CloudAccess) => Promise<void>): Promise<void> => {\r\n const access = await getCloudAccess(iModel);\r\n try {\r\n await access.withLockedDb(args, async () => operation(access));\r\n } finally {\r\n access.close();\r\n }\r\n };\r\n\r\n export const withReadonlyAccess = async (iModel: IModelDb | { readonly fileName: LocalFileName }, operation: (access: CloudAccess) => Promise<void>): Promise<void> => {\r\n const access = await getCloudAccess(iModel);\r\n access.synchronizeWithCloud();\r\n access.openForRead();\r\n try {\r\n await operation(access);\r\n } finally {\r\n access.close();\r\n }\r\n };\r\n\r\n /** Synchronize local briefcase schemas with cloud container */\r\n export const pull = async (iModel: IModelDb) => {\r\n if (iModel[_nativeDb].schemaSyncEnabled() && !iModel.isReadonly) {\r\n await SchemaSync.withReadonlyAccess(iModel, async (syncAccess) => {\r\n const schemaSyncDbUri = syncAccess.getUri();\r\n iModel.clearCaches();\r\n iModel[_nativeDb].schemaSyncPull(schemaSyncDbUri);\r\n iModel.saveChanges(\"schema synchronized with cloud container\");\r\n });\r\n }\r\n };\r\n\r\n export const initializeForIModel = async (arg: { iModel: IModelDb, containerProps: CloudSqlite.ContainerProps, overrideContainer?: boolean }) => {\r\n const props = { baseUri: arg.containerProps.baseUri, containerId: arg.containerProps.containerId, storageType: arg.containerProps.storageType }; // sanitize to only known properties\r\n const iModel = arg.iModel;\r\n const briefcase = iModel instanceof BriefcaseDb ? iModel : undefined;\r\n await iModel.acquireSchemaLock();\r\n if (briefcase) {\r\n if (briefcase.txns.hasLocalChanges) {\r\n throw new IModelError(DbResult.BE_SQLITE_ERROR, \"Enabling SchemaSync for iModel failed. There are unsaved or un-pushed local changes.\");\r\n }\r\n await briefcase.pullChanges();\r\n }\r\n try {\r\n iModel.saveFileProperty(syncProperty, JSON.stringify(props));\r\n await withLockedAccess(arg.iModel, { operationName: \"initialize schemaSync\", openMode: OpenMode.Readonly }, async (syncAccess) => {\r\n iModel[_nativeDb].schemaSyncInit(syncAccess.getUri(), props.containerId, arg.overrideContainer ?? false);\r\n iModel.saveChanges(`Enable SchemaSync (container id: ${props.containerId})`);\r\n });\r\n } catch (err) {\r\n throw err;\r\n } finally {\r\n iModel.abandonChanges();\r\n }\r\n\r\n if (briefcase) {\r\n if (arg.overrideContainer)\r\n await briefcase.pushChanges({ description: `Overriding SchemaSync for iModel with container-id: ${props.containerId}` });\r\n else\r\n await briefcase.pushChanges({ description: `Enable SchemaSync for iModel with container-id: ${props.containerId}` });\r\n }\r\n };\r\n\r\n /** Provides access to a cloud-based `SchemaSyncDb` to hold ECSchemas. */\r\n export class CloudAccess extends CloudSqlite.DbAccess<SchemaSyncDb> {\r\n public constructor(props: CloudSqlite.ContainerAccessProps) {\r\n super({ dbType: SchemaSyncDb, props, dbName: defaultDbName });\r\n }\r\n\r\n public getUri() {\r\n return `${this.getCloudDb()[_nativeDb].getFilePath()}?vfs=${this.container.cache?.name}&writable=${this.container.isWriteable ? 1 : 0}`;\r\n }\r\n /**\r\n * Initialize a cloud container for use as a SchemaSync. The container must first be created via its storage supplier api (e.g. Azure, or AWS).\r\n * A valid sasToken that grants write access must be supplied. This function creates and uploads an empty ChannelDb into the container.\r\n * @note this deletes any existing content in the container.\r\n */\r\n public static async initializeDb(props: CloudSqlite.ContainerProps) {\r\n return super._initializeDb({ props, dbType: SchemaSyncDb, dbName: defaultDbName });\r\n }\r\n }\r\n}\r\n\r\n"]}
|
|
1
|
+
{"version":3,"file":"SchemaSync.js","sourceRoot":"","sources":["../../src/SchemaSync.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,+CAA4C;AAC5C,yCAA+C;AAC/C,yCAAmD;AACnD,sDAAyD;AACzD,oDAAgE;AAEhE,8DAAyD;AACzD,gDAA+C;AAE/C,gBAAgB;AAChB,IAAiB,UAAU,CAsI1B;AAtID,WAAiB,UAAU;IACzB,MAAM,UAAU,GAAiC,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAEtF,kFAAkF;IAClF,MAAa,YAAa,SAAQ,4BAAiB;QAAnD;;YAC2B,cAAS,GAAG,OAAO,CAAC;QAE/C,CAAC;QADoB,SAAS,KAAK,CAAC;KACnC;IAHY,uBAAY,eAGxB,CAAA;IAED,MAAM,YAAY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AE,QAAQ,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,aAAa,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1I,CAAC;QACD;;;;SAIC;QACM,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,KAAiC;YAChE,OAAO,KAAK,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;QACrF,CAAC;KACF;IAhBY,sBAAW,cAgBvB,CAAA;AACH,CAAC,EAtIgB,UAAU,0BAAV,UAAU,QAsI1B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module SQLiteDb\r\n */\r\n\r\nimport { CloudSqlite } from \"./CloudSqlite\";\r\nimport { VersionedSqliteDb } from \"./SQLiteDb\";\r\nimport { BriefcaseDb, IModelDb } from \"./IModelDb\";\r\nimport { DbResult, OpenMode } from \"@itwin/core-bentley\";\r\nimport { IModelError, LocalFileName } from \"@itwin/core-common\";\r\nimport { IModelJsNative } from \"@bentley/imodeljs-native\";\r\nimport { IModelNative } from \"./internal/NativePlatform\";\r\nimport { _nativeDb } from \"./internal/Symbols\";\r\n\r\n/** @internal */\r\nexport namespace SchemaSync {\r\n const lockParams: CloudSqlite.ObtainLockParams = { retryDelayMs: 1000, nRetries: 30 };\r\n\r\n /** A CloudSqlite database for synchronizing schema changes across briefcases. */\r\n export class SchemaSyncDb extends VersionedSqliteDb {\r\n public override readonly myVersion = \"4.0.0\";\r\n protected override createDDL() { }\r\n }\r\n\r\n const syncProperty = { namespace: \"itwinjs\", name: \"SchemaSync\" };\r\n const defaultDbName = \"SchemaSyncDb\" as const;\r\n const testSyncCachePropKey = \"test.schema_sync.cache_name\" as const;\r\n // for tests only\r\n export const setTestCache = (iModel: IModelDb, cacheName?: string) => {\r\n if (cacheName)\r\n iModel[_nativeDb].saveLocalValue(testSyncCachePropKey, cacheName);\r\n else\r\n iModel[_nativeDb].deleteLocalValue(testSyncCachePropKey);\r\n };\r\n\r\n const getCloudAccess = async (arg: IModelDb | { readonly fileName: LocalFileName }) => {\r\n let nativeDb: IModelJsNative.DgnDb | undefined;\r\n const argIsIModelDb = arg instanceof IModelDb;\r\n if (argIsIModelDb) {\r\n nativeDb = arg[_nativeDb];\r\n } else {\r\n nativeDb = new IModelNative.platform.DgnDb();\r\n nativeDb.openIModel(arg.fileName, OpenMode.Readonly);\r\n }\r\n\r\n const propsString = nativeDb.queryFileProperty(syncProperty, true) as string | undefined;\r\n if (!propsString)\r\n throw new Error(\"iModel does not have a SchemaSyncDb\");\r\n try {\r\n const props = JSON.parse(propsString) as CloudSqlite.ContainerProps;\r\n const accessToken = await CloudSqlite.requestToken(props);\r\n const access = new CloudAccess({ ...props, accessToken });\r\n Object.assign(access.lockParams, lockParams);\r\n const testSyncCache = nativeDb.queryLocalValue(testSyncCachePropKey);\r\n if (testSyncCache)\r\n access.setCache(CloudSqlite.CloudCaches.getCache({ cacheName: testSyncCache }));\r\n return access;\r\n } finally {\r\n if (!argIsIModelDb) {\r\n nativeDb.closeFile();\r\n }\r\n }\r\n };\r\n\r\n export const withLockedAccess = async (iModel: IModelDb | { readonly fileName: LocalFileName }, args: { operationName: string, openMode?: OpenMode, user?: string }, operation: (access: CloudAccess) => Promise<void>): Promise<void> => {\r\n const access = await getCloudAccess(iModel);\r\n try {\r\n await access.withLockedDb(args, async () => operation(access));\r\n } finally {\r\n access.close();\r\n }\r\n };\r\n\r\n export const withReadonlyAccess = async (iModel: IModelDb | { readonly fileName: LocalFileName }, operation: (access: CloudAccess) => Promise<void>): Promise<void> => {\r\n const access = await getCloudAccess(iModel);\r\n access.synchronizeWithCloud();\r\n access.openForRead();\r\n try {\r\n await operation(access);\r\n } finally {\r\n access.close();\r\n }\r\n };\r\n\r\n export const isEnabled = (iModel: IModelDb) => {\r\n return iModel[_nativeDb].schemaSyncEnabled();\r\n };\r\n\r\n /** Synchronize local briefcase schemas with cloud container */\r\n export const pull = async (iModel: IModelDb) => {\r\n if (iModel[_nativeDb].schemaSyncEnabled() && !iModel.isReadonly) {\r\n await SchemaSync.withReadonlyAccess(iModel, async (syncAccess) => {\r\n const schemaSyncDbUri = syncAccess.getUri();\r\n iModel.clearCaches();\r\n iModel[_nativeDb].schemaSyncPull(schemaSyncDbUri);\r\n iModel.saveChanges(\"schema synchronized with cloud container\");\r\n });\r\n }\r\n };\r\n\r\n export const initializeForIModel = async (arg: { iModel: IModelDb, containerProps: CloudSqlite.ContainerProps, overrideContainer?: boolean }) => {\r\n const props = { baseUri: arg.containerProps.baseUri, containerId: arg.containerProps.containerId, storageType: arg.containerProps.storageType }; // sanitize to only known properties\r\n const iModel = arg.iModel;\r\n const briefcase = iModel instanceof BriefcaseDb ? iModel : undefined;\r\n await iModel.acquireSchemaLock();\r\n if (briefcase) {\r\n if (briefcase.txns.hasLocalChanges) {\r\n throw new IModelError(DbResult.BE_SQLITE_ERROR, \"Enabling SchemaSync for iModel failed. There are unsaved or un-pushed local changes.\");\r\n }\r\n await briefcase.pullChanges();\r\n }\r\n try {\r\n iModel.saveFileProperty(syncProperty, JSON.stringify(props));\r\n await withLockedAccess(arg.iModel, { operationName: \"initialize schemaSync\", openMode: OpenMode.Readonly }, async (syncAccess) => {\r\n iModel[_nativeDb].schemaSyncInit(syncAccess.getUri(), props.containerId, arg.overrideContainer ?? false);\r\n iModel.saveChanges(`Enable SchemaSync (container id: ${props.containerId})`);\r\n });\r\n } catch (err) {\r\n throw err;\r\n } finally {\r\n iModel.abandonChanges();\r\n }\r\n\r\n if (briefcase) {\r\n if (arg.overrideContainer)\r\n await briefcase.pushChanges({ description: `Overriding SchemaSync for iModel with container-id: ${props.containerId}` });\r\n else\r\n await briefcase.pushChanges({ description: `Enable SchemaSync for iModel with container-id: ${props.containerId}` });\r\n }\r\n };\r\n\r\n /** Provides access to a cloud-based `SchemaSyncDb` to hold ECSchemas. */\r\n export class CloudAccess extends CloudSqlite.DbAccess<SchemaSyncDb> {\r\n public constructor(props: CloudSqlite.ContainerAccessProps) {\r\n super({ dbType: SchemaSyncDb, props, dbName: defaultDbName });\r\n }\r\n\r\n public getUri() {\r\n return `${this.getCloudDb()[_nativeDb].getFilePath()}?vfs=${this.container.cache?.name}&writable=${this.container.isWriteable ? 1 : 0}`;\r\n }\r\n /**\r\n * Initialize a cloud container for use as a SchemaSync. The container must first be created via its storage supplier api (e.g. Azure, or AWS).\r\n * A valid sasToken that grants write access must be supplied. This function creates and uploads an empty ChannelDb into the container.\r\n * @note this deletes any existing content in the container.\r\n */\r\n public static async initializeDb(props: CloudSqlite.ContainerProps) {\r\n return super._initializeDb({ props, dbType: SchemaSyncDb, dbName: defaultDbName });\r\n }\r\n }\r\n}\r\n\r\n"]}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Elements
|
|
3
|
+
*/
|
|
4
|
+
import { Code, CodeScopeProps, EntityReferenceSet, RelatedElementProps, SheetIndexEntryProps, SheetIndexReferenceProps, SheetReferenceProps } from "@itwin/core-common";
|
|
5
|
+
import { InformationReferenceElement } from "./Element";
|
|
6
|
+
import { IModelDb } from "./IModelDb";
|
|
7
|
+
import { Id64String } from "@itwin/core-bentley";
|
|
8
|
+
import { SheetIndexReferenceRefersToSheetIndex, SheetReferenceRefersToSheet } from "./NavigationRelationship";
|
|
9
|
+
/** Arguments used to create a [[SheetIndexEntry]].
|
|
10
|
+
* @beta
|
|
11
|
+
*/
|
|
12
|
+
export interface SheetIndexEntryCreateArgs {
|
|
13
|
+
/** The iModel that will contain the sheet index entry. */
|
|
14
|
+
iModelDb: IModelDb;
|
|
15
|
+
/** The Id of the [[SheetIndexModel]] that will contain the sheet index entry. */
|
|
16
|
+
sheetIndexModelId: Id64String;
|
|
17
|
+
/** The [[SheetIndex]] or [[SheetIndexFolder]] that is parent to this SheetIndexEntry */
|
|
18
|
+
parentId: Id64String;
|
|
19
|
+
/** The name of the SheetIndexEntry */
|
|
20
|
+
name: string;
|
|
21
|
+
/** The priority of the SheetIndexEntry */
|
|
22
|
+
priority: number;
|
|
23
|
+
}
|
|
24
|
+
/** Arguments supplied when creating a [[SheetIndexReference]].
|
|
25
|
+
* @beta
|
|
26
|
+
*/
|
|
27
|
+
export interface SheetIndexReferenceCreateArgs extends SheetIndexEntryCreateArgs {
|
|
28
|
+
/** The [[SheetIndex]] to which the reference refers. */
|
|
29
|
+
sheetIndexId?: Id64String;
|
|
30
|
+
}
|
|
31
|
+
/** Arguments supplied when creating a [[SheetReference]].
|
|
32
|
+
* @beta
|
|
33
|
+
*/
|
|
34
|
+
export interface SheetReferenceCreateArgs extends SheetIndexEntryCreateArgs {
|
|
35
|
+
/** The [[Sheet]] to which the reference refers. */
|
|
36
|
+
sheetId?: Id64String;
|
|
37
|
+
}
|
|
38
|
+
/** A [structured collection]($docs/bis/domains/drawings-sheets#sheet-index) of [[SheetIndexEntry]]s.
|
|
39
|
+
* The sheet index is a tree whose leaf nodes refer to [[Sheet]]s, optionally grouped by [[SheetIndexFolder]]s and/or incorporating
|
|
40
|
+
* sub-trees via [[SheetIndexReference]]s.
|
|
41
|
+
* @beta
|
|
42
|
+
*/
|
|
43
|
+
export declare class SheetIndex extends InformationReferenceElement {
|
|
44
|
+
static get className(): string;
|
|
45
|
+
/** Create a Code for a SheetIndex given a name that is meant to be unique within the scope of the specified SheetIndexModel.
|
|
46
|
+
* @param iModel The IModelDb
|
|
47
|
+
* @param scopeSheetIndexModelId The Id of the Model that contains the LinkElement and provides the scope for its name.
|
|
48
|
+
* @param codeValue The SheetIndex name
|
|
49
|
+
*/
|
|
50
|
+
static createCode(iModel: IModelDb, scopeSheetIndexModelId: CodeScopeProps, codeValue: string): Code;
|
|
51
|
+
/** Create a SheetIndex
|
|
52
|
+
* @param iModelDb The IModelDb
|
|
53
|
+
* @param modelId The Id of the Model that contains the SheetIndex and provides the scope for its name.
|
|
54
|
+
* @param name The name (codeValue) of the SheetIndex
|
|
55
|
+
* @returns The newly constructed SheetIndex
|
|
56
|
+
* @throws [[IModelError]] if there is a problem creating the SheetIndex
|
|
57
|
+
*/
|
|
58
|
+
static create(iModelDb: IModelDb, modelId: Id64String, name: string): SheetIndex;
|
|
59
|
+
/** Insert a SheetIndex
|
|
60
|
+
* @param iModelDb The IModelDb
|
|
61
|
+
* @param modelId The Id of the Model that contains the SheetIndex and provides the scope for its name.
|
|
62
|
+
* @param name The name (codeValue) of the SheetIndex
|
|
63
|
+
* @returns The Id of the newly inserted SheetIndex
|
|
64
|
+
* @throws [[IModelError]] if there is a problem inserting the SheetIndex
|
|
65
|
+
*/
|
|
66
|
+
static insert(iModelDb: IModelDb, modelId: Id64String, name: string): Id64String;
|
|
67
|
+
}
|
|
68
|
+
/** The base class for all elements that can participate in a [[SheetIndex]] hierarchy.
|
|
69
|
+
* @beta
|
|
70
|
+
*/
|
|
71
|
+
export declare abstract class SheetIndexEntry extends InformationReferenceElement {
|
|
72
|
+
static get className(): string;
|
|
73
|
+
/** Can be used to prioritize or order members within a SheetIndex or SheetIndexFolder. */
|
|
74
|
+
entryPriority: number;
|
|
75
|
+
protected constructor(props: SheetIndexEntryProps, iModel: IModelDb);
|
|
76
|
+
toJSON(): SheetIndexEntryProps;
|
|
77
|
+
/** Create a Code for a Sheet Index Entry given a name that is meant to be unique within the scope of the specified SheetIndexModel.
|
|
78
|
+
* @param iModel The IModel
|
|
79
|
+
* @param scopeModelId The Id of the [[SheetIndexModel]] that contains the [[SheetIndexEntry]] and provides the scope for its name.
|
|
80
|
+
* @param codeValue The name of the entry
|
|
81
|
+
*/
|
|
82
|
+
static createCode(iModelDb: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code;
|
|
83
|
+
protected static createParentRelationshipProps(iModelDb: IModelDb, id: Id64String): RelatedElementProps;
|
|
84
|
+
protected static createProps(arg: SheetIndexEntryCreateArgs): SheetIndexEntryProps;
|
|
85
|
+
}
|
|
86
|
+
/** A container used to group [[SheetIndexEntry]]s within a [[SheetIndex]].
|
|
87
|
+
* @beta
|
|
88
|
+
*/
|
|
89
|
+
export declare class SheetIndexFolder extends SheetIndexEntry {
|
|
90
|
+
static get className(): string;
|
|
91
|
+
/** Create a new SheetIndexFolder
|
|
92
|
+
* @returns The newly constructed SheetIndexFolder element.
|
|
93
|
+
* @throws [[IModelError]] if unable to create the element.
|
|
94
|
+
*/
|
|
95
|
+
static create(arg: SheetIndexEntryCreateArgs): SheetIndexFolder;
|
|
96
|
+
/** Create a new SheetIndexFolder
|
|
97
|
+
* @returns The Id of the newly inserted SheetIndexFolder element.
|
|
98
|
+
* @throws [[IModelError]] if unable to create the element.
|
|
99
|
+
*/
|
|
100
|
+
static insert(arg: SheetIndexEntryCreateArgs): Id64String;
|
|
101
|
+
}
|
|
102
|
+
/** A node within one [[SheetIndex]] that incorporates another [[SheetIndex]] as a sub-tree.
|
|
103
|
+
* @beta
|
|
104
|
+
*/
|
|
105
|
+
export declare class SheetIndexReference extends SheetIndexEntry {
|
|
106
|
+
static get className(): string;
|
|
107
|
+
/** The bis:SheetIndex that this bis:SheetIndexReference is pointing to. */
|
|
108
|
+
sheetIndex?: SheetIndexReferenceRefersToSheetIndex;
|
|
109
|
+
protected constructor(props: SheetIndexReferenceProps, iModel: IModelDb);
|
|
110
|
+
protected static createReferenceRelationshipProps(id: Id64String): RelatedElementProps;
|
|
111
|
+
toJSON(): SheetIndexReferenceProps;
|
|
112
|
+
/** Create a new SheetIndexReference
|
|
113
|
+
* @returns The newly constructed SheetIndexReference element.
|
|
114
|
+
* @throws [[IModelError]] if unable to create the element.
|
|
115
|
+
*/
|
|
116
|
+
static create(arg: SheetIndexReferenceCreateArgs): SheetIndexReference;
|
|
117
|
+
/** Create a new SheetIndexReference
|
|
118
|
+
* @returns The Id of the newly inserted SheetIndexReference element.
|
|
119
|
+
* @throws [[IModelError]] if unable to create the element.
|
|
120
|
+
*/
|
|
121
|
+
static insert(arg: SheetIndexReferenceCreateArgs): Id64String;
|
|
122
|
+
/** @alpha */
|
|
123
|
+
protected collectReferenceIds(referenceIds: EntityReferenceSet): void;
|
|
124
|
+
}
|
|
125
|
+
/** A leaf node in a [[SheetIndex]] that refers to a specific [[Sheet]].
|
|
126
|
+
* @beta
|
|
127
|
+
*/
|
|
128
|
+
export declare class SheetReference extends SheetIndexEntry {
|
|
129
|
+
static get className(): string;
|
|
130
|
+
/** The bis:Sheet that this bis:SheetReference is pointing to. */
|
|
131
|
+
sheet: SheetReferenceRefersToSheet | undefined;
|
|
132
|
+
protected constructor(props: SheetReferenceProps, iModel: IModelDb);
|
|
133
|
+
protected static createReferenceRelationshipProps(id: Id64String): RelatedElementProps;
|
|
134
|
+
toJSON(): SheetReferenceProps;
|
|
135
|
+
/** Create a new SheetReference
|
|
136
|
+
* @returns The newly constructed SheetReference element.
|
|
137
|
+
* @throws [[IModelError]] if unable to create the element.
|
|
138
|
+
*/
|
|
139
|
+
static create(arg: SheetReferenceCreateArgs): SheetReference;
|
|
140
|
+
/** Insert a new SheetReference
|
|
141
|
+
* @returns The Id of the newly inserted SheetReference element.
|
|
142
|
+
* @throws [[IModelError]] if unable to create the element.
|
|
143
|
+
*/
|
|
144
|
+
static insert(arg: SheetReferenceCreateArgs): Id64String;
|
|
145
|
+
/** @alpha */
|
|
146
|
+
protected collectReferenceIds(referenceIds: EntityReferenceSet): void;
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=SheetIndex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetIndex.d.ts","sourceRoot":"","sources":["../../src/SheetIndex.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAe,IAAI,EAAE,cAAc,EAA0B,kBAAkB,EAAe,mBAAmB,EAAE,oBAAoB,EAAyB,w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AAQ,eAAe;IACjD,WAA2B,SAAS,IAAI,MAAM,CAA6B;IAE3E,iEAAiE;IAC1D,KAAK,EAAE,2BAA2B,GAAG,SAAS,CAAC;IAEtD,SAAS,aAAa,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ;IAWlE,SAAS,CAAC,MAAM,CAAC,gCAAgC,CAAC,EAAE,EAAE,UAAU,GAAG,mBAAmB;IAItE,MAAM,IAAI,mBAAmB;IAO7C;;;OAGG;WACW,MAAM,CAAC,GAAG,EAAE,wBAAwB;IAQlD;;;OAGG;WACW,MAAM,CAAC,GAAG,EAAE,wBAAwB,GAAG,UAAU;IAO/D,aAAa;cACM,mBAAmB,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI;CAK/E"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Elements
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.SheetReference = exports.SheetIndexReference = exports.SheetIndexFolder = exports.SheetIndexEntry = exports.SheetIndex = void 0;
|
|
11
|
+
const core_common_1 = require("@itwin/core-common");
|
|
12
|
+
const Element_1 = require("./Element");
|
|
13
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
14
|
+
const NavigationRelationship_1 = require("./NavigationRelationship");
|
|
15
|
+
/** A [structured collection]($docs/bis/domains/drawings-sheets#sheet-index) of [[SheetIndexEntry]]s.
|
|
16
|
+
* The sheet index is a tree whose leaf nodes refer to [[Sheet]]s, optionally grouped by [[SheetIndexFolder]]s and/or incorporating
|
|
17
|
+
* sub-trees via [[SheetIndexReference]]s.
|
|
18
|
+
* @beta
|
|
19
|
+
*/
|
|
20
|
+
class SheetIndex extends Element_1.InformationReferenceElement {
|
|
21
|
+
static get className() { return "SheetIndex"; }
|
|
22
|
+
/** Create a Code for a SheetIndex given a name that is meant to be unique within the scope of the specified SheetIndexModel.
|
|
23
|
+
* @param iModel The IModelDb
|
|
24
|
+
* @param scopeSheetIndexModelId The Id of the Model that contains the LinkElement and provides the scope for its name.
|
|
25
|
+
* @param codeValue The SheetIndex name
|
|
26
|
+
*/
|
|
27
|
+
static createCode(iModel, scopeSheetIndexModelId, codeValue) {
|
|
28
|
+
const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.sheetIndex);
|
|
29
|
+
return new core_common_1.Code({ spec: codeSpec.id, scope: scopeSheetIndexModelId, value: codeValue });
|
|
30
|
+
}
|
|
31
|
+
/** Create a SheetIndex
|
|
32
|
+
* @param iModelDb The IModelDb
|
|
33
|
+
* @param modelId The Id of the Model that contains the SheetIndex and provides the scope for its name.
|
|
34
|
+
* @param name The name (codeValue) of the SheetIndex
|
|
35
|
+
* @returns The newly constructed SheetIndex
|
|
36
|
+
* @throws [[IModelError]] if there is a problem creating the SheetIndex
|
|
37
|
+
*/
|
|
38
|
+
static create(iModelDb, modelId, name) {
|
|
39
|
+
const props = {
|
|
40
|
+
classFullName: this.classFullName,
|
|
41
|
+
code: this.createCode(iModelDb, modelId, name).toJSON(),
|
|
42
|
+
model: modelId,
|
|
43
|
+
};
|
|
44
|
+
return new this(props, iModelDb);
|
|
45
|
+
}
|
|
46
|
+
/** Insert a SheetIndex
|
|
47
|
+
* @param iModelDb The IModelDb
|
|
48
|
+
* @param modelId The Id of the Model that contains the SheetIndex and provides the scope for its name.
|
|
49
|
+
* @param name The name (codeValue) of the SheetIndex
|
|
50
|
+
* @returns The Id of the newly inserted SheetIndex
|
|
51
|
+
* @throws [[IModelError]] if there is a problem inserting the SheetIndex
|
|
52
|
+
*/
|
|
53
|
+
static insert(iModelDb, modelId, name) {
|
|
54
|
+
const instance = this.create(iModelDb, modelId, name);
|
|
55
|
+
const elements = iModelDb.elements;
|
|
56
|
+
instance.id = elements.insertElement(instance.toJSON());
|
|
57
|
+
return instance.id;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.SheetIndex = SheetIndex;
|
|
61
|
+
/** The base class for all elements that can participate in a [[SheetIndex]] hierarchy.
|
|
62
|
+
* @beta
|
|
63
|
+
*/
|
|
64
|
+
class SheetIndexEntry extends Element_1.InformationReferenceElement {
|
|
65
|
+
static get className() { return "SheetIndexEntry"; }
|
|
66
|
+
constructor(props, iModel) {
|
|
67
|
+
super(props, iModel);
|
|
68
|
+
this.entryPriority = props.entryPriority;
|
|
69
|
+
}
|
|
70
|
+
toJSON() {
|
|
71
|
+
return { ...super.toJSON(), entryPriority: this.entryPriority };
|
|
72
|
+
}
|
|
73
|
+
/** Create a Code for a Sheet Index Entry given a name that is meant to be unique within the scope of the specified SheetIndexModel.
|
|
74
|
+
* @param iModel The IModel
|
|
75
|
+
* @param scopeModelId The Id of the [[SheetIndexModel]] that contains the [[SheetIndexEntry]] and provides the scope for its name.
|
|
76
|
+
* @param codeValue The name of the entry
|
|
77
|
+
*/
|
|
78
|
+
static createCode(iModelDb, scopeModelId, codeValue) {
|
|
79
|
+
const codeSpec = iModelDb.codeSpecs.getByName(core_common_1.BisCodeSpec.sheetIndexEntry);
|
|
80
|
+
return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
|
|
81
|
+
}
|
|
82
|
+
static createParentRelationshipProps(iModelDb, id) {
|
|
83
|
+
const parentElementProps = iModelDb.elements.getElementProps(id);
|
|
84
|
+
const isFolder = parentElementProps.classFullName === SheetIndexFolder.classFullName;
|
|
85
|
+
const relClass = isFolder ? NavigationRelationship_1.SheetIndexFolderOwnsEntries : NavigationRelationship_1.SheetIndexOwnsEntries;
|
|
86
|
+
return { id, relClassName: relClass.classFullName };
|
|
87
|
+
}
|
|
88
|
+
static createProps(arg) {
|
|
89
|
+
const parent = this.createParentRelationshipProps(arg.iModelDb, arg.parentId);
|
|
90
|
+
const props = {
|
|
91
|
+
classFullName: this.classFullName,
|
|
92
|
+
model: arg.sheetIndexModelId,
|
|
93
|
+
code: this.createCode(arg.iModelDb, arg.sheetIndexModelId, arg.name),
|
|
94
|
+
entryPriority: arg.priority,
|
|
95
|
+
parent,
|
|
96
|
+
};
|
|
97
|
+
return props;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.SheetIndexEntry = SheetIndexEntry;
|
|
101
|
+
/** A container used to group [[SheetIndexEntry]]s within a [[SheetIndex]].
|
|
102
|
+
* @beta
|
|
103
|
+
*/
|
|
104
|
+
class SheetIndexFolder extends SheetIndexEntry {
|
|
105
|
+
static get className() { return "SheetIndexFolder"; }
|
|
106
|
+
/** Create a new SheetIndexFolder
|
|
107
|
+
* @returns The newly constructed SheetIndexFolder element.
|
|
108
|
+
* @throws [[IModelError]] if unable to create the element.
|
|
109
|
+
*/
|
|
110
|
+
static create(arg) {
|
|
111
|
+
const props = this.createProps(arg);
|
|
112
|
+
return new this(props, arg.iModelDb);
|
|
113
|
+
}
|
|
114
|
+
/** Create a new SheetIndexFolder
|
|
115
|
+
* @returns The Id of the newly inserted SheetIndexFolder element.
|
|
116
|
+
* @throws [[IModelError]] if unable to create the element.
|
|
117
|
+
*/
|
|
118
|
+
static insert(arg) {
|
|
119
|
+
const instance = this.create(arg);
|
|
120
|
+
const elements = arg.iModelDb.elements;
|
|
121
|
+
instance.id = elements.insertElement(instance.toJSON());
|
|
122
|
+
return instance.id;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.SheetIndexFolder = SheetIndexFolder;
|
|
126
|
+
/** A node within one [[SheetIndex]] that incorporates another [[SheetIndex]] as a sub-tree.
|
|
127
|
+
* @beta
|
|
128
|
+
*/
|
|
129
|
+
class SheetIndexReference extends SheetIndexEntry {
|
|
130
|
+
static get className() { return "SheetIndexReference"; }
|
|
131
|
+
constructor(props, iModel) {
|
|
132
|
+
super(props, iModel);
|
|
133
|
+
if (props.sheetIndex) {
|
|
134
|
+
const sheetIndex = iModel.elements.tryGetElement(props.sheetIndex.id);
|
|
135
|
+
if (!sheetIndex)
|
|
136
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, "SheetIndex not found");
|
|
137
|
+
this.sheetIndex = new NavigationRelationship_1.SheetIndexReferenceRefersToSheetIndex(props.sheetIndex.id);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
static createReferenceRelationshipProps(id) {
|
|
141
|
+
return { id, relClassName: NavigationRelationship_1.SheetIndexReferenceRefersToSheetIndex.classFullName };
|
|
142
|
+
}
|
|
143
|
+
toJSON() {
|
|
144
|
+
return {
|
|
145
|
+
...super.toJSON(),
|
|
146
|
+
sheetIndex: this.sheetIndex ? this.sheetIndex.toJSON() : undefined,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/** Create a new SheetIndexReference
|
|
150
|
+
* @returns The newly constructed SheetIndexReference element.
|
|
151
|
+
* @throws [[IModelError]] if unable to create the element.
|
|
152
|
+
*/
|
|
153
|
+
static create(arg) {
|
|
154
|
+
const props = {
|
|
155
|
+
...this.createProps(arg),
|
|
156
|
+
sheetIndex: arg.sheetIndexId ? this.createReferenceRelationshipProps(arg.sheetIndexId) : undefined,
|
|
157
|
+
};
|
|
158
|
+
return new this(props, arg.iModelDb);
|
|
159
|
+
}
|
|
160
|
+
/** Create a new SheetIndexReference
|
|
161
|
+
* @returns The Id of the newly inserted SheetIndexReference element.
|
|
162
|
+
* @throws [[IModelError]] if unable to create the element.
|
|
163
|
+
*/
|
|
164
|
+
static insert(arg) {
|
|
165
|
+
const instance = this.create(arg);
|
|
166
|
+
const elements = arg.iModelDb.elements;
|
|
167
|
+
instance.id = elements.insertElement(instance.toJSON());
|
|
168
|
+
return instance.id;
|
|
169
|
+
}
|
|
170
|
+
/** @alpha */
|
|
171
|
+
collectReferenceIds(referenceIds) {
|
|
172
|
+
super.collectReferenceIds(referenceIds);
|
|
173
|
+
if (this.sheetIndex)
|
|
174
|
+
referenceIds.addElement(this.sheetIndex.id);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
exports.SheetIndexReference = SheetIndexReference;
|
|
178
|
+
/** A leaf node in a [[SheetIndex]] that refers to a specific [[Sheet]].
|
|
179
|
+
* @beta
|
|
180
|
+
*/
|
|
181
|
+
class SheetReference extends SheetIndexEntry {
|
|
182
|
+
static get className() { return "SheetReference"; }
|
|
183
|
+
constructor(props, iModel) {
|
|
184
|
+
super(props, iModel);
|
|
185
|
+
if (props.sheet) {
|
|
186
|
+
const sheet = iModel.elements.tryGetElement(props.sheet.id);
|
|
187
|
+
if (!sheet)
|
|
188
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, "Sheet not found");
|
|
189
|
+
this.sheet = new NavigationRelationship_1.SheetReferenceRefersToSheet(sheet.id);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
static createReferenceRelationshipProps(id) {
|
|
193
|
+
return { id, relClassName: NavigationRelationship_1.SheetIndexReferenceRefersToSheetIndex.classFullName };
|
|
194
|
+
}
|
|
195
|
+
toJSON() {
|
|
196
|
+
return {
|
|
197
|
+
...super.toJSON(),
|
|
198
|
+
sheet: this.sheet ? this.sheet.toJSON() : undefined,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
/** Create a new SheetReference
|
|
202
|
+
* @returns The newly constructed SheetReference element.
|
|
203
|
+
* @throws [[IModelError]] if unable to create the element.
|
|
204
|
+
*/
|
|
205
|
+
static create(arg) {
|
|
206
|
+
const props = {
|
|
207
|
+
...this.createProps(arg),
|
|
208
|
+
sheet: arg.sheetId ? this.createReferenceRelationshipProps(arg.sheetId) : undefined,
|
|
209
|
+
};
|
|
210
|
+
return new this(props, arg.iModelDb);
|
|
211
|
+
}
|
|
212
|
+
/** Insert a new SheetReference
|
|
213
|
+
* @returns The Id of the newly inserted SheetReference element.
|
|
214
|
+
* @throws [[IModelError]] if unable to create the element.
|
|
215
|
+
*/
|
|
216
|
+
static insert(arg) {
|
|
217
|
+
const instance = this.create(arg);
|
|
218
|
+
const elements = arg.iModelDb.elements;
|
|
219
|
+
instance.id = elements.insertElement(instance.toJSON());
|
|
220
|
+
return instance.id;
|
|
221
|
+
}
|
|
222
|
+
/** @alpha */
|
|
223
|
+
collectReferenceIds(referenceIds) {
|
|
224
|
+
super.collectReferenceIds(referenceIds);
|
|
225
|
+
if (this.sheet)
|
|
226
|
+
referenceIds.addModel(this.sheet.id);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
exports.SheetReference = SheetReference;
|
|
230
|
+
//# sourceMappingURL=SheetIndex.js.map
|