@itwin/core-backend 5.0.0-dev.56 → 5.0.0-dev.57

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.
Files changed (145) hide show
  1. package/lib/cjs/BackendHubAccess.js +2 -0
  2. package/lib/cjs/BackendHubAccess.js.map +1 -1
  3. package/lib/cjs/BriefcaseManager.js +3 -1
  4. package/lib/cjs/BriefcaseManager.js.map +1 -1
  5. package/lib/cjs/Category.js +6 -1
  6. package/lib/cjs/Category.js.map +1 -1
  7. package/lib/cjs/ChangeSummaryManager.js +1 -1
  8. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  9. package/lib/cjs/ChangedElementsDb.js +1 -0
  10. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  11. package/lib/cjs/ChangesetECAdaptor.js +30 -18
  12. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  13. package/lib/cjs/CheckpointManager.js +6 -5
  14. package/lib/cjs/CheckpointManager.js.map +1 -1
  15. package/lib/cjs/ClassRegistry.js +4 -8
  16. package/lib/cjs/ClassRegistry.js.map +1 -1
  17. package/lib/cjs/CloudSqlite.js +15 -8
  18. package/lib/cjs/CloudSqlite.js.map +1 -1
  19. package/lib/cjs/CodeService.js +4 -0
  20. package/lib/cjs/CodeService.js.map +1 -1
  21. package/lib/cjs/CodeSpecs.js +3 -2
  22. package/lib/cjs/CodeSpecs.js.map +1 -1
  23. package/lib/cjs/CustomViewState3dCreator.js +7 -6
  24. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  25. package/lib/cjs/DevTools.js +6 -6
  26. package/lib/cjs/DevTools.js.map +1 -1
  27. package/lib/cjs/DisplayStyle.js +2 -0
  28. package/lib/cjs/DisplayStyle.js.map +1 -1
  29. package/lib/cjs/ECDb.js +3 -2
  30. package/lib/cjs/ECDb.js.map +1 -1
  31. package/lib/cjs/ECSchemaXmlContext.js +1 -0
  32. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  33. package/lib/cjs/ECSqlStatement.js +8 -3
  34. package/lib/cjs/ECSqlStatement.js.map +1 -1
  35. package/lib/cjs/Element.d.ts +1 -9
  36. package/lib/cjs/Element.d.ts.map +1 -1
  37. package/lib/cjs/Element.js +105 -12
  38. package/lib/cjs/Element.js.map +1 -1
  39. package/lib/cjs/ElementAspect.js +24 -0
  40. package/lib/cjs/ElementAspect.js.map +1 -1
  41. package/lib/cjs/ElementTreeWalker.js +13 -12
  42. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  43. package/lib/cjs/Entity.js +22 -16
  44. package/lib/cjs/Entity.js.map +1 -1
  45. package/lib/cjs/ExportGraphics.js +4 -0
  46. package/lib/cjs/ExportGraphics.js.map +1 -1
  47. package/lib/cjs/ExternalSource.js +22 -0
  48. package/lib/cjs/ExternalSource.js.map +1 -1
  49. package/lib/cjs/GeoCoordConfig.js +4 -4
  50. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  51. package/lib/cjs/GeometrySummary.js +6 -3
  52. package/lib/cjs/GeometrySummary.js.map +1 -1
  53. package/lib/cjs/HubMock.js +4 -1
  54. package/lib/cjs/HubMock.js.map +1 -1
  55. package/lib/cjs/IModelDb.js +65 -35
  56. package/lib/cjs/IModelDb.js.map +1 -1
  57. package/lib/cjs/IModelElementCloneContext.js +6 -0
  58. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  59. package/lib/cjs/IModelHost.js +49 -22
  60. package/lib/cjs/IModelHost.js.map +1 -1
  61. package/lib/cjs/IModelJsFs.js +9 -0
  62. package/lib/cjs/IModelJsFs.js.map +1 -1
  63. package/lib/cjs/IpcHost.js +3 -5
  64. package/lib/cjs/IpcHost.js.map +1 -1
  65. package/lib/cjs/LocalHub.js +8 -2
  66. package/lib/cjs/LocalHub.js.map +1 -1
  67. package/lib/cjs/LocalhostIpcHost.js +5 -6
  68. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  69. package/lib/cjs/Material.js +40 -0
  70. package/lib/cjs/Material.js.map +1 -1
  71. package/lib/cjs/Model.d.ts +1 -1
  72. package/lib/cjs/Model.d.ts.map +1 -1
  73. package/lib/cjs/Model.js +27 -2
  74. package/lib/cjs/Model.js.map +1 -1
  75. package/lib/cjs/NativeAppStorage.js +5 -3
  76. package/lib/cjs/NativeAppStorage.js.map +1 -1
  77. package/lib/cjs/NativeHost.js +5 -2
  78. package/lib/cjs/NativeHost.js.map +1 -1
  79. package/lib/cjs/NavigationRelationship.js +25 -25
  80. package/lib/cjs/NavigationRelationship.js.map +1 -1
  81. package/lib/cjs/PromiseMemoizer.js +11 -4
  82. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  83. package/lib/cjs/PropertyStore.js +1 -4
  84. package/lib/cjs/PropertyStore.js.map +1 -1
  85. package/lib/cjs/Relationship.js +12 -0
  86. package/lib/cjs/Relationship.js.map +1 -1
  87. package/lib/cjs/SQLiteDb.js +4 -8
  88. package/lib/cjs/SQLiteDb.js.map +1 -1
  89. package/lib/cjs/Schema.js +1 -1
  90. package/lib/cjs/Schema.js.map +1 -1
  91. package/lib/cjs/SchemaSync.js +1 -4
  92. package/lib/cjs/SchemaSync.js.map +1 -1
  93. package/lib/cjs/SheetIndex.js +6 -0
  94. package/lib/cjs/SheetIndex.js.map +1 -1
  95. package/lib/cjs/SqliteChangesetReader.js +5 -4
  96. package/lib/cjs/SqliteChangesetReader.js.map +1 -1
  97. package/lib/cjs/SqliteStatement.js +8 -0
  98. package/lib/cjs/SqliteStatement.js.map +1 -1
  99. package/lib/cjs/TextAnnotationLayout.js +25 -8
  100. package/lib/cjs/TextAnnotationLayout.js.map +1 -1
  101. package/lib/cjs/Texture.js +3 -0
  102. package/lib/cjs/Texture.js.map +1 -1
  103. package/lib/cjs/TileStorage.js +6 -1
  104. package/lib/cjs/TileStorage.js.map +1 -1
  105. package/lib/cjs/TxnManager.js +67 -58
  106. package/lib/cjs/TxnManager.js.map +1 -1
  107. package/lib/cjs/ViewDefinition.d.ts +6 -6
  108. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  109. package/lib/cjs/ViewDefinition.js +68 -10
  110. package/lib/cjs/ViewDefinition.js.map +1 -1
  111. package/lib/cjs/ViewStateHydrator.js +1 -0
  112. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  113. package/lib/cjs/ViewStore.js +3 -1
  114. package/lib/cjs/ViewStore.js.map +1 -1
  115. package/lib/cjs/domains/FunctionalElements.js +1 -1
  116. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  117. package/lib/cjs/internal/ChangesetConflictArgs.js +2 -0
  118. package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -1
  119. package/lib/cjs/internal/ChannelAdmin.js +7 -7
  120. package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
  121. package/lib/cjs/internal/FontFileImpl.js +4 -3
  122. package/lib/cjs/internal/FontFileImpl.js.map +1 -1
  123. package/lib/cjs/internal/IModelDbFontsImpl.js +1 -3
  124. package/lib/cjs/internal/IModelDbFontsImpl.js.map +1 -1
  125. package/lib/cjs/internal/NoLocks.js +2 -5
  126. package/lib/cjs/internal/NoLocks.js.map +1 -1
  127. package/lib/cjs/internal/ServerBasedLocks.js +4 -4
  128. package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
  129. package/lib/cjs/internal/workspace/SettingsImpl.js +6 -9
  130. package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
  131. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js +8 -12
  132. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  133. package/lib/cjs/internal/workspace/WorkspaceImpl.js +22 -17
  134. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
  135. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js +1 -4
  136. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  137. package/lib/cjs/rpc/tracing.js +1 -1
  138. package/lib/cjs/rpc/tracing.js.map +1 -1
  139. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +2 -0
  140. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  141. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +3 -1
  142. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  143. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +1 -1
  144. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  145. package/package.json +9 -9
@@ -13,7 +13,7 @@ const core_common_1 = require("@itwin/core-common");
13
13
  * @public
14
14
  */
15
15
  class ElementOwnsChildElements extends core_common_1.RelatedElement {
16
- static { this.classFullName = "BisCore:ElementOwnsChildElements"; }
16
+ static classFullName = "BisCore:ElementOwnsChildElements";
17
17
  constructor(parentId, relClassName = ElementOwnsChildElements.classFullName) {
18
18
  super({ id: parentId, relClassName });
19
19
  }
@@ -23,7 +23,7 @@ exports.ElementOwnsChildElements = ElementOwnsChildElements;
23
23
  * @public
24
24
  */
25
25
  class SubjectOwnsSubjects extends ElementOwnsChildElements {
26
- static { this.classFullName = "BisCore:SubjectOwnsSubjects"; }
26
+ static classFullName = "BisCore:SubjectOwnsSubjects";
27
27
  constructor(parentId, relClassName = SubjectOwnsSubjects.classFullName) {
28
28
  super(parentId, relClassName);
29
29
  }
@@ -33,7 +33,7 @@ exports.SubjectOwnsSubjects = SubjectOwnsSubjects;
33
33
  * @public
34
34
  */
35
35
  class SubjectOwnsPartitionElements extends ElementOwnsChildElements {
36
- static { this.classFullName = "BisCore:SubjectOwnsPartitionElements"; }
36
+ static classFullName = "BisCore:SubjectOwnsPartitionElements";
37
37
  constructor(parentId, relClassName = SubjectOwnsPartitionElements.classFullName) {
38
38
  super(parentId, relClassName);
39
39
  }
@@ -43,7 +43,7 @@ exports.SubjectOwnsPartitionElements = SubjectOwnsPartitionElements;
43
43
  * @public
44
44
  */
45
45
  class CategoryOwnsSubCategories extends ElementOwnsChildElements {
46
- static { this.classFullName = "BisCore:CategoryOwnsSubCategories"; }
46
+ static classFullName = "BisCore:CategoryOwnsSubCategories";
47
47
  constructor(parentId, relClassName = CategoryOwnsSubCategories.classFullName) {
48
48
  super(parentId, relClassName);
49
49
  }
@@ -53,7 +53,7 @@ exports.CategoryOwnsSubCategories = CategoryOwnsSubCategories;
53
53
  * @public
54
54
  */
55
55
  class RenderMaterialOwnsRenderMaterials extends ElementOwnsChildElements {
56
- static { this.classFullName = "BisCore:RenderMaterialOwnsRenderMaterials"; }
56
+ static classFullName = "BisCore:RenderMaterialOwnsRenderMaterials";
57
57
  constructor(parentId, relClassName = RenderMaterialOwnsRenderMaterials.classFullName) {
58
58
  super(parentId, relClassName);
59
59
  }
@@ -63,7 +63,7 @@ exports.RenderMaterialOwnsRenderMaterials = RenderMaterialOwnsRenderMaterials;
63
63
  * @public
64
64
  */
65
65
  class ElementEncapsulatesElements extends ElementOwnsChildElements {
66
- static { this.classFullName = "BisCore:ElementEncapsulatesElements"; }
66
+ static classFullName = "BisCore:ElementEncapsulatesElements";
67
67
  constructor(parentId, relClassName = ElementEncapsulatesElements.classFullName) {
68
68
  super(parentId, relClassName);
69
69
  }
@@ -73,7 +73,7 @@ exports.ElementEncapsulatesElements = ElementEncapsulatesElements;
73
73
  * @public
74
74
  */
75
75
  class PhysicalElementAssemblesElements extends ElementOwnsChildElements {
76
- static { this.classFullName = "BisCore:PhysicalElementAssemblesElements"; }
76
+ static classFullName = "BisCore:PhysicalElementAssemblesElements";
77
77
  constructor(parentId, relClassName = PhysicalElementAssemblesElements.classFullName) {
78
78
  super(parentId, relClassName);
79
79
  }
@@ -84,7 +84,7 @@ exports.PhysicalElementAssemblesElements = PhysicalElementAssemblesElements;
84
84
  * @beta
85
85
  */
86
86
  class ExternalSourceOwnsAttachments extends ElementOwnsChildElements {
87
- static { this.classFullName = "BisCore:ExternalSourceOwnsAttachments"; }
87
+ static classFullName = "BisCore:ExternalSourceOwnsAttachments";
88
88
  constructor(parentId, relClassName = ExternalSourceOwnsAttachments.classFullName) {
89
89
  super(parentId, relClassName);
90
90
  }
@@ -95,7 +95,7 @@ exports.ExternalSourceOwnsAttachments = ExternalSourceOwnsAttachments;
95
95
  * @beta
96
96
  */
97
97
  class FolderContainsRepositories extends ElementOwnsChildElements {
98
- static { this.classFullName = "BisCore:FolderContainsRepositories"; }
98
+ static classFullName = "BisCore:FolderContainsRepositories";
99
99
  constructor(parentId, relClassName = FolderContainsRepositories.classFullName) {
100
100
  super(parentId, relClassName);
101
101
  }
@@ -105,7 +105,7 @@ exports.FolderContainsRepositories = FolderContainsRepositories;
105
105
  * @beta
106
106
  */
107
107
  class SheetIndexFolderOwnsEntries extends ElementOwnsChildElements {
108
- static { this.classFullName = "BisCore:SheetIndexFolderOwnsEntries"; }
108
+ static classFullName = "BisCore:SheetIndexFolderOwnsEntries";
109
109
  constructor(parentId, relClassName = SheetIndexFolderOwnsEntries.classFullName) {
110
110
  super(parentId, relClassName);
111
111
  }
@@ -115,7 +115,7 @@ exports.SheetIndexFolderOwnsEntries = SheetIndexFolderOwnsEntries;
115
115
  * @beta
116
116
  */
117
117
  class SheetIndexOwnsEntries extends ElementOwnsChildElements {
118
- static { this.classFullName = "BisCore:SheetIndexOwnsEntries"; }
118
+ static classFullName = "BisCore:SheetIndexOwnsEntries";
119
119
  constructor(parentId, relClassName = SheetIndexOwnsEntries.classFullName) {
120
120
  super(parentId, relClassName);
121
121
  }
@@ -125,7 +125,7 @@ exports.SheetIndexOwnsEntries = SheetIndexOwnsEntries;
125
125
  * @public
126
126
  */
127
127
  class GeometricElement2dHasTypeDefinition extends core_common_1.TypeDefinition {
128
- static { this.classFullName = "BisCore:GeometricElement2dHasTypeDefinition"; }
128
+ static classFullName = "BisCore:GeometricElement2dHasTypeDefinition";
129
129
  constructor(id, relClassName = GeometricElement2dHasTypeDefinition.classFullName) {
130
130
  super({ id, relClassName });
131
131
  }
@@ -135,7 +135,7 @@ exports.GeometricElement2dHasTypeDefinition = GeometricElement2dHasTypeDefinitio
135
135
  * @public
136
136
  */
137
137
  class GraphicalElement2dIsOfType extends GeometricElement2dHasTypeDefinition {
138
- static { this.classFullName = "BisCore:GraphicalElement2dIsOfType"; }
138
+ static classFullName = "BisCore:GraphicalElement2dIsOfType";
139
139
  constructor(id, relClassName = GraphicalElement2dIsOfType.classFullName) {
140
140
  super(id, relClassName);
141
141
  }
@@ -145,7 +145,7 @@ exports.GraphicalElement2dIsOfType = GraphicalElement2dIsOfType;
145
145
  * @public
146
146
  */
147
147
  class GeometricElement3dHasTypeDefinition extends core_common_1.TypeDefinition {
148
- static { this.classFullName = "BisCore:GeometricElement3dHasTypeDefinition"; }
148
+ static classFullName = "BisCore:GeometricElement3dHasTypeDefinition";
149
149
  constructor(id, relClassName = GeometricElement3dHasTypeDefinition.classFullName) {
150
150
  super({ id, relClassName });
151
151
  }
@@ -155,7 +155,7 @@ exports.GeometricElement3dHasTypeDefinition = GeometricElement3dHasTypeDefinitio
155
155
  * @public
156
156
  */
157
157
  class SpatialLocationIsOfType extends GeometricElement3dHasTypeDefinition {
158
- static { this.classFullName = "BisCore:SpatialLocationIsOfType"; }
158
+ static classFullName = "BisCore:SpatialLocationIsOfType";
159
159
  constructor(id, relClassName = SpatialLocationIsOfType.classFullName) {
160
160
  super(id, relClassName);
161
161
  }
@@ -165,7 +165,7 @@ exports.SpatialLocationIsOfType = SpatialLocationIsOfType;
165
165
  * @public
166
166
  */
167
167
  class PhysicalElementIsOfType extends GeometricElement3dHasTypeDefinition {
168
- static { this.classFullName = "BisCore:PhysicalElementIsOfType"; }
168
+ static classFullName = "BisCore:PhysicalElementIsOfType";
169
169
  constructor(id, relClassName = PhysicalElementIsOfType.classFullName) {
170
170
  super(id, relClassName);
171
171
  }
@@ -175,7 +175,7 @@ exports.PhysicalElementIsOfType = PhysicalElementIsOfType;
175
175
  * @public
176
176
  */
177
177
  class PhysicalElementIsOfPhysicalMaterial extends core_common_1.RelatedElement {
178
- static { this.classFullName = "BisCore:PhysicalElementIsOfPhysicalMaterial"; }
178
+ static classFullName = "BisCore:PhysicalElementIsOfPhysicalMaterial";
179
179
  constructor(id) {
180
180
  super({ id });
181
181
  }
@@ -185,7 +185,7 @@ exports.PhysicalElementIsOfPhysicalMaterial = PhysicalElementIsOfPhysicalMateria
185
185
  * @public
186
186
  */
187
187
  class PhysicalTypeIsOfPhysicalMaterial extends core_common_1.RelatedElement {
188
- static { this.classFullName = "BisCore:PhysicalTypeIsOfPhysicalMaterial"; }
188
+ static classFullName = "BisCore:PhysicalTypeIsOfPhysicalMaterial";
189
189
  constructor(id) {
190
190
  super({ id });
191
191
  }
@@ -195,7 +195,7 @@ exports.PhysicalTypeIsOfPhysicalMaterial = PhysicalTypeIsOfPhysicalMaterial;
195
195
  * @public
196
196
  */
197
197
  class ElementOwnsUniqueAspect extends core_common_1.RelatedElement {
198
- static { this.classFullName = "BisCore:ElementOwnsUniqueAspect"; }
198
+ static classFullName = "BisCore:ElementOwnsUniqueAspect";
199
199
  constructor(elementId, relClassName = ElementOwnsUniqueAspect.classFullName) {
200
200
  super({ id: elementId, relClassName });
201
201
  }
@@ -205,7 +205,7 @@ exports.ElementOwnsUniqueAspect = ElementOwnsUniqueAspect;
205
205
  * @public
206
206
  */
207
207
  class ElementOwnsMultiAspects extends core_common_1.RelatedElement {
208
- static { this.classFullName = "BisCore:ElementOwnsMultiAspects"; }
208
+ static classFullName = "BisCore:ElementOwnsMultiAspects";
209
209
  constructor(elementId, relClassName = ElementOwnsMultiAspects.classFullName) {
210
210
  super({ id: elementId, relClassName });
211
211
  }
@@ -215,7 +215,7 @@ exports.ElementOwnsMultiAspects = ElementOwnsMultiAspects;
215
215
  * @public
216
216
  */
217
217
  class ElementOwnsExternalSourceAspects extends ElementOwnsMultiAspects {
218
- static { this.classFullName = "BisCore:ElementOwnsExternalSourceAspects"; }
218
+ static classFullName = "BisCore:ElementOwnsExternalSourceAspects";
219
219
  constructor(elementId, relClassName = ElementOwnsExternalSourceAspects.classFullName) {
220
220
  super(elementId, relClassName);
221
221
  }
@@ -226,7 +226,7 @@ exports.ElementOwnsExternalSourceAspects = ElementOwnsExternalSourceAspects;
226
226
  * @beta
227
227
  */
228
228
  class ExternalSourceIsInRepository extends core_common_1.RelatedElement {
229
- static { this.classFullName = "BisCore:ExternalSourceIsInRepository"; }
229
+ static classFullName = "BisCore:ExternalSourceIsInRepository";
230
230
  constructor(repositoryId, relClassName = ExternalSourceIsInRepository.classFullName) {
231
231
  super({ id: repositoryId, relClassName });
232
232
  }
@@ -237,7 +237,7 @@ exports.ExternalSourceIsInRepository = ExternalSourceIsInRepository;
237
237
  * @beta
238
238
  */
239
239
  class ExternalSourceAttachmentAttachesSource extends core_common_1.RelatedElement {
240
- static { this.classFullName = "BisCore:ExternalSourceAttachmentAttachesSource"; }
240
+ static classFullName = "BisCore:ExternalSourceAttachmentAttachesSource";
241
241
  constructor(externalSourceId, relClassName = ExternalSourceAttachmentAttachesSource.classFullName) {
242
242
  super({ id: externalSourceId, relClassName });
243
243
  }
@@ -247,7 +247,7 @@ exports.ExternalSourceAttachmentAttachesSource = ExternalSourceAttachmentAttache
247
247
  * @beta
248
248
  */
249
249
  class SheetReferenceRefersToSheet extends core_common_1.RelatedElement {
250
- static { this.classFullName = "BisCore:SheetReferenceRefersToSheet"; }
250
+ static classFullName = "BisCore:SheetReferenceRefersToSheet";
251
251
  constructor(sheetId, relClassName = SheetReferenceRefersToSheet.classFullName) {
252
252
  super({ id: sheetId, relClassName });
253
253
  }
@@ -257,7 +257,7 @@ exports.SheetReferenceRefersToSheet = SheetReferenceRefersToSheet;
257
257
  * @beta
258
258
  */
259
259
  class SheetIndexReferenceRefersToSheetIndex extends core_common_1.RelatedElement {
260
- static { this.classFullName = "BisCore:SheetIndexReferenceRefersToSheetIndex"; }
260
+ static classFullName = "BisCore:SheetIndexReferenceRefersToSheetIndex";
261
261
  constructor(sheetIndexId, relClassName = SheetIndexReferenceRefersToSheetIndex.classFullName) {
262
262
  super({ id: sheetIndexId, relClassName });
263
263
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationRelationship.js","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aAAa;QAC1H,KAAK,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,YAAY,EAAE,CAAC,CAAC;IAChD,CAAC;;AAJH,wFAKC;AAED;;GAEG;AACH,MAAa,2BAA4B,SAAQ,4BAAc;aAC/C,kBAAa,GAAG,qCAAqC,CAAC;IACpE,YAAmB,OAAmB,EAAE,eAAuB,2BAA2B,CAAC,aAAa;QACtG,KAAK,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;IACvC,CAAC;;AAJH,kEAKC;AAED;;GAEG;AACH,MAAa,qCAAsC,SAAQ,4BAAc;aACzD,kBAAa,GAAG,+CAA+C,CAAC;IAC9E,YAAmB,YAAwB,EAAE,eAAuB,qCAAqC,CAAC,aAAa;QACrH,KAAK,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC;IAC5C,CAAC;;AAJH,sFAKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Relationships\n */\n\n// NOTE: A NavigationRelationship is not an Entity, so is not registered in the ClassRegistry.\n// NOTE: It does, however, have a classFullName property for consistency with Entity subclasses.\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { RelatedElement, TypeDefinition } from \"@itwin/core-common\";\n\n/** Relates a parent Element to child Elements which represent parts of the Entity modeled by the parent Element.\n * @public\n */\nexport class ElementOwnsChildElements extends RelatedElement {\n public static classFullName = \"BisCore:ElementOwnsChildElements\";\n public constructor(parentId: Id64String, relClassName: string = ElementOwnsChildElements.classFullName) {\n super({ id: parentId, relClassName });\n }\n}\n\n/** Relates a parent [[Subject]] to [[Subject]] child elements.\n * @public\n */\nexport class SubjectOwnsSubjects extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:SubjectOwnsSubjects\";\n public constructor(parentId: Id64String, relClassName: string = SubjectOwnsSubjects.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[Subject]] to [[InformationPartitionElement]] child elements.\n * @public\n */\nexport class SubjectOwnsPartitionElements extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:SubjectOwnsPartitionElements\";\n public constructor(parentId: Id64String, relClassName: string = SubjectOwnsPartitionElements.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[Category]] to [[SubCategory]] child elements.\n * @public\n */\nexport class CategoryOwnsSubCategories extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:CategoryOwnsSubCategories\";\n public constructor(parentId: Id64String, relClassName: string = CategoryOwnsSubCategories.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[RenderMaterial]] to [[RenderMaterial]] child elements.\n * @public\n */\nexport class RenderMaterialOwnsRenderMaterials extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:RenderMaterialOwnsRenderMaterials\";\n public constructor(parentId: Id64String, relClassName: string = RenderMaterialOwnsRenderMaterials.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent Element to child Elements which represent **hidden** parts of the Entity.\n * @public\n */\nexport class ElementEncapsulatesElements extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:ElementEncapsulatesElements\";\n public constructor(parentId: Id64String, relClassName: string = ElementEncapsulatesElements.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[PhysicalElement]] to [[PhysicalElement]] children that it assembles.\n * @public\n */\nexport class PhysicalElementAssemblesElements extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:PhysicalElementAssemblesElements\";\n public constructor(parentId: Id64String, relClassName: string = PhysicalElementAssemblesElements.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[ExternalSource]] to its [[ExternalSourceAttachment]] children.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceOwnsAttachments extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:ExternalSourceOwnsAttachments\";\n public constructor(parentId: Id64String, relClassName: string = ExternalSourceOwnsAttachments.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[FolderLink]] to its [[RepositoryLink]] children.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class FolderContainsRepositories extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:FolderContainsRepositories\";\n public constructor(parentId: Id64String, relClassName: string = FolderContainsRepositories.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a [[SheetIndexFolder]] to the [[SheetIndexEntry]]'s that it contains.\n * @beta\n */\nexport class SheetIndexFolderOwnsEntries extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:SheetIndexFolderOwnsEntries\";\n public constructor(parentId: Id64String, relClassName: string = SheetIndexFolderOwnsEntries.classFullName) {\n super(parentId, relClassName );\n }\n}\n\n/** Relates a [[SheetIndex]] to the [SheetIndexEntry]]'s that it contains.\n * @beta\n */\nexport class SheetIndexOwnsEntries extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:SheetIndexOwnsEntries\";\n public constructor(parentId: Id64String, relClassName: string = SheetIndexOwnsEntries.classFullName) {\n super(parentId, relClassName );\n }\n}\n\n/** Relates a [[GeometricElement2d]] to its [[TypeDefinitionElement]]\n * @public\n */\nexport class GeometricElement2dHasTypeDefinition extends TypeDefinition {\n public static classFullName = \"BisCore:GeometricElement2dHasTypeDefinition\";\n public constructor(id: Id64String, relClassName: string = GeometricElement2dHasTypeDefinition.classFullName) {\n super({ id, relClassName });\n }\n}\n\n/** Relates a [[GraphicalElement2d]] to its [[GraphicalType2d]]\n * @public\n */\nexport class GraphicalElement2dIsOfType extends GeometricElement2dHasTypeDefinition {\n public static override classFullName = \"BisCore:GraphicalElement2dIsOfType\";\n public constructor(id: Id64String, relClassName: string = GraphicalElement2dIsOfType.classFullName) {\n super(id, relClassName);\n }\n}\n\n/** Relates a [[GeometricElement3d]] to its [[TypeDefinitionElement]]\n * @public\n */\nexport class GeometricElement3dHasTypeDefinition extends TypeDefinition {\n public static classFullName = \"BisCore:GeometricElement3dHasTypeDefinition\";\n public constructor(id: Id64String, relClassName: string = GeometricElement3dHasTypeDefinition.classFullName) {\n super({ id, relClassName });\n }\n}\n\n/** Relates a [[SpatialLocationElement]] to its [[SpatialLocationType]]\n * @public\n */\nexport class SpatialLocationIsOfType extends GeometricElement3dHasTypeDefinition {\n public static override classFullName = \"BisCore:SpatialLocationIsOfType\";\n public constructor(id: Id64String, relClassName: string = SpatialLocationIsOfType.classFullName) {\n super(id, relClassName);\n }\n}\n\n/** Relates a [[PhysicalElement]] to its [[PhysicalType]]\n * @public\n */\nexport class PhysicalElementIsOfType extends GeometricElement3dHasTypeDefinition {\n public static override classFullName = \"BisCore:PhysicalElementIsOfType\";\n public constructor(id: Id64String, relClassName: string = PhysicalElementIsOfType.classFullName) {\n super(id, relClassName);\n }\n}\n\n/** Relates a [[PhysicalElement]] to its [[PhysicalMaterial]]\n * @public\n */\nexport class PhysicalElementIsOfPhysicalMaterial extends RelatedElement {\n public static classFullName = \"BisCore:PhysicalElementIsOfPhysicalMaterial\";\n public constructor(id: Id64String) {\n super({ id });\n }\n}\n\n/** Relates a [[PhysicalType]] to its [[PhysicalMaterial]]\n * @public\n */\nexport class PhysicalTypeIsOfPhysicalMaterial extends RelatedElement {\n public static classFullName = \"BisCore:PhysicalTypeIsOfPhysicalMaterial\";\n public constructor(id: Id64String) {\n super({ id });\n }\n}\n\n/** Relates an [[Element]] and an [[ElementUniqueAspect]] that it owns.\n * @public\n */\nexport class ElementOwnsUniqueAspect extends RelatedElement {\n public static classFullName = \"BisCore:ElementOwnsUniqueAspect\";\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsUniqueAspect.classFullName) {\n super({ id: elementId, relClassName });\n }\n}\n\n/** Relates an [[Element]] and an [[ElementMultiAspect]] that it owns.\n * @public\n */\nexport class ElementOwnsMultiAspects extends RelatedElement {\n public static classFullName = \"BisCore:ElementOwnsMultiAspects\";\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsMultiAspects.classFullName) {\n super({ id: elementId, relClassName });\n }\n}\n\n/** Relates an [[Element]] and an [[ExternalSourceAspect]] that it owns.\n * @public\n */\nexport class ElementOwnsExternalSourceAspects extends ElementOwnsMultiAspects {\n public static override classFullName = \"BisCore:ElementOwnsExternalSourceAspects\";\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsExternalSourceAspects.classFullName) {\n super(elementId, relClassName);\n }\n}\n\n/** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceIsInRepository extends RelatedElement {\n public static classFullName = \"BisCore:ExternalSourceIsInRepository\";\n public constructor(repositoryId: Id64String, relClassName: string = ExternalSourceIsInRepository.classFullName) {\n super({ id: repositoryId, relClassName });\n }\n}\n\n/** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceAttachmentAttachesSource extends RelatedElement {\n public static classFullName = \"BisCore:ExternalSourceAttachmentAttachesSource\";\n public constructor(externalSourceId: Id64String, relClassName: string = ExternalSourceAttachmentAttachesSource.classFullName) {\n super({ id: externalSourceId, relClassName });\n }\n}\n\n/** Relates a [[SheetReference]] and [[Sheet]] that it refers.\n * @beta\n */\nexport class SheetReferenceRefersToSheet extends RelatedElement {\n public static classFullName = \"BisCore:SheetReferenceRefersToSheet\";\n public constructor(sheetId: Id64String, relClassName: string = SheetReferenceRefersToSheet.classFullName) {\n super({ id: sheetId, relClassName });\n }\n}\n\n/** Relates a [[SheetIndexReference]] to a [[SheetIndex]] it refers.\n * @beta\n */\nexport class SheetIndexReferenceRefersToSheetIndex extends RelatedElement {\n public static classFullName = \"BisCore:SheetIndexReferenceRefersToSheetIndex\";\n public constructor(sheetIndexId: Id64String, relClassName: string = SheetIndexReferenceRefersToSheetIndex.classFullName) {\n super({ id: sheetIndexId, relClassName });\n }\n}\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;IACnD,MAAM,CAAC,aAAa,GAAG,kCAAkC,CAAC;IACjE,YAAmB,QAAoB,EAAE,eAAuB,wBAAwB,CAAC,aAAa;QACpG,KAAK,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC;IACxC,CAAC;;AAJH,4DAKC;AAED;;GAEG;AACH,MAAa,mBAAoB,SAAQ,wBAAwB;IACxD,MAAM,CAAU,aAAa,GAAG,6BAA6B,CAAC;IACrE,YAAmB,QAAoB,EAAE,eAAuB,mBAAmB,CAAC,aAAa;QAC/F,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAChC,CAAC;;AAJH,kDAKC;AAED;;GAEG;AACH,MAAa,4BAA6B,SAAQ,wBAAwB;IACjE,MAAM,CAAU,aAAa,GAAG,sCAAsC,CAAC;IAC9E,YAAmB,QAAoB,EAAE,eAAuB,4BAA4B,CAAC,aAAa;QACxG,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAChC,CAAC;;AAJH,oEAKC;AAED;;GAEG;AACH,MAAa,yBAA0B,SAAQ,wBAAwB;IAC9D,MAAM,CAAU,aAAa,GAAG,mCAAmC,CAAC;IAC3E,YAAmB,QAAoB,EAAE,eAAuB,yBAAyB,CAAC,aAAa;QACrG,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAChC,CAAC;;AAJH,8DAKC;AAED;;GAEG;AACH,MAAa,iCAAkC,SAAQ,wBAAwB;IACtE,MAAM,CAAU,aAAa,GAAG,2CAA2C,CAAC;IACnF,YAAmB,Q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AA6B,SAAQ,4BAAc;IACvD,MAAM,CAAC,aAAa,GAAG,sCAAsC,CAAC;IACrE,YAAmB,YAAwB,EAAE,eAAuB,4BAA4B,CAAC,aAAa;QAC5G,KAAK,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC;IAC5C,CAAC;;AAJH,oEAKC;AAED;;;GAGG;AACH,MAAa,sCAAuC,SAAQ,4BAAc;IACjE,MAAM,CAAC,aAAa,GAAG,gDAAgD,CAAC;IAC/E,YAAmB,gBAA4B,EAAE,eAAuB,sCAAsC,CAAC,aAAa;QAC1H,KAAK,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,YAAY,EAAE,CAAC,CAAC;IAChD,CAAC;;AAJH,wFAKC;AAED;;GAEG;AACH,MAAa,2BAA4B,SAAQ,4BAAc;IACtD,MAAM,CAAC,aAAa,GAAG,qCAAqC,CAAC;IACpE,YAAmB,OAAmB,EAAE,eAAuB,2BAA2B,CAAC,aAAa;QACtG,KAAK,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;IACvC,CAAC;;AAJH,kEAKC;AAED;;GAEG;AACH,MAAa,qCAAsC,SAAQ,4BAAc;IAChE,MAAM,CAAC,aAAa,GAAG,+CAA+C,CAAC;IAC9E,YAAmB,YAAwB,EAAE,eAAuB,qCAAqC,CAAC,aAAa;QACrH,KAAK,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC;IAC5C,CAAC;;AAJH,sFAKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Relationships\n */\n\n// NOTE: A NavigationRelationship is not an Entity, so is not registered in the ClassRegistry.\n// NOTE: It does, however, have a classFullName property for consistency with Entity subclasses.\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { RelatedElement, TypeDefinition } from \"@itwin/core-common\";\n\n/** Relates a parent Element to child Elements which represent parts of the Entity modeled by the parent Element.\n * @public\n */\nexport class ElementOwnsChildElements extends RelatedElement {\n public static classFullName = \"BisCore:ElementOwnsChildElements\";\n public constructor(parentId: Id64String, relClassName: string = ElementOwnsChildElements.classFullName) {\n super({ id: parentId, relClassName });\n }\n}\n\n/** Relates a parent [[Subject]] to [[Subject]] child elements.\n * @public\n */\nexport class SubjectOwnsSubjects extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:SubjectOwnsSubjects\";\n public constructor(parentId: Id64String, relClassName: string = SubjectOwnsSubjects.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[Subject]] to [[InformationPartitionElement]] child elements.\n * @public\n */\nexport class SubjectOwnsPartitionElements extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:SubjectOwnsPartitionElements\";\n public constructor(parentId: Id64String, relClassName: string = SubjectOwnsPartitionElements.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[Category]] to [[SubCategory]] child elements.\n * @public\n */\nexport class CategoryOwnsSubCategories extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:CategoryOwnsSubCategories\";\n public constructor(parentId: Id64String, relClassName: string = CategoryOwnsSubCategories.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[RenderMaterial]] to [[RenderMaterial]] child elements.\n * @public\n */\nexport class RenderMaterialOwnsRenderMaterials extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:RenderMaterialOwnsRenderMaterials\";\n public constructor(parentId: Id64String, relClassName: string = RenderMaterialOwnsRenderMaterials.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent Element to child Elements which represent **hidden** parts of the Entity.\n * @public\n */\nexport class ElementEncapsulatesElements extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:ElementEncapsulatesElements\";\n public constructor(parentId: Id64String, relClassName: string = ElementEncapsulatesElements.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[PhysicalElement]] to [[PhysicalElement]] children that it assembles.\n * @public\n */\nexport class PhysicalElementAssemblesElements extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:PhysicalElementAssemblesElements\";\n public constructor(parentId: Id64String, relClassName: string = PhysicalElementAssemblesElements.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[ExternalSource]] to its [[ExternalSourceAttachment]] children.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceOwnsAttachments extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:ExternalSourceOwnsAttachments\";\n public constructor(parentId: Id64String, relClassName: string = ExternalSourceOwnsAttachments.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[FolderLink]] to its [[RepositoryLink]] children.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class FolderContainsRepositories extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:FolderContainsRepositories\";\n public constructor(parentId: Id64String, relClassName: string = FolderContainsRepositories.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a [[SheetIndexFolder]] to the [[SheetIndexEntry]]'s that it contains.\n * @beta\n */\nexport class SheetIndexFolderOwnsEntries extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:SheetIndexFolderOwnsEntries\";\n public constructor(parentId: Id64String, relClassName: string = SheetIndexFolderOwnsEntries.classFullName) {\n super(parentId, relClassName );\n }\n}\n\n/** Relates a [[SheetIndex]] to the [SheetIndexEntry]]'s that it contains.\n * @beta\n */\nexport class SheetIndexOwnsEntries extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:SheetIndexOwnsEntries\";\n public constructor(parentId: Id64String, relClassName: string = SheetIndexOwnsEntries.classFullName) {\n super(parentId, relClassName );\n }\n}\n\n/** Relates a [[GeometricElement2d]] to its [[TypeDefinitionElement]]\n * @public\n */\nexport class GeometricElement2dHasTypeDefinition extends TypeDefinition {\n public static classFullName = \"BisCore:GeometricElement2dHasTypeDefinition\";\n public constructor(id: Id64String, relClassName: string = GeometricElement2dHasTypeDefinition.classFullName) {\n super({ id, relClassName });\n }\n}\n\n/** Relates a [[GraphicalElement2d]] to its [[GraphicalType2d]]\n * @public\n */\nexport class GraphicalElement2dIsOfType extends GeometricElement2dHasTypeDefinition {\n public static override classFullName = \"BisCore:GraphicalElement2dIsOfType\";\n public constructor(id: Id64String, relClassName: string = GraphicalElement2dIsOfType.classFullName) {\n super(id, relClassName);\n }\n}\n\n/** Relates a [[GeometricElement3d]] to its [[TypeDefinitionElement]]\n * @public\n */\nexport class GeometricElement3dHasTypeDefinition extends TypeDefinition {\n public static classFullName = \"BisCore:GeometricElement3dHasTypeDefinition\";\n public constructor(id: Id64String, relClassName: string = GeometricElement3dHasTypeDefinition.classFullName) {\n super({ id, relClassName });\n }\n}\n\n/** Relates a [[SpatialLocationElement]] to its [[SpatialLocationType]]\n * @public\n */\nexport class SpatialLocationIsOfType extends GeometricElement3dHasTypeDefinition {\n public static override classFullName = \"BisCore:SpatialLocationIsOfType\";\n public constructor(id: Id64String, relClassName: string = SpatialLocationIsOfType.classFullName) {\n super(id, relClassName);\n }\n}\n\n/** Relates a [[PhysicalElement]] to its [[PhysicalType]]\n * @public\n */\nexport class PhysicalElementIsOfType extends GeometricElement3dHasTypeDefinition {\n public static override classFullName = \"BisCore:PhysicalElementIsOfType\";\n public constructor(id: Id64String, relClassName: string = PhysicalElementIsOfType.classFullName) {\n super(id, relClassName);\n }\n}\n\n/** Relates a [[PhysicalElement]] to its [[PhysicalMaterial]]\n * @public\n */\nexport class PhysicalElementIsOfPhysicalMaterial extends RelatedElement {\n public static classFullName = \"BisCore:PhysicalElementIsOfPhysicalMaterial\";\n public constructor(id: Id64String) {\n super({ id });\n }\n}\n\n/** Relates a [[PhysicalType]] to its [[PhysicalMaterial]]\n * @public\n */\nexport class PhysicalTypeIsOfPhysicalMaterial extends RelatedElement {\n public static classFullName = \"BisCore:PhysicalTypeIsOfPhysicalMaterial\";\n public constructor(id: Id64String) {\n super({ id });\n }\n}\n\n/** Relates an [[Element]] and an [[ElementUniqueAspect]] that it owns.\n * @public\n */\nexport class ElementOwnsUniqueAspect extends RelatedElement {\n public static classFullName = \"BisCore:ElementOwnsUniqueAspect\";\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsUniqueAspect.classFullName) {\n super({ id: elementId, relClassName });\n }\n}\n\n/** Relates an [[Element]] and an [[ElementMultiAspect]] that it owns.\n * @public\n */\nexport class ElementOwnsMultiAspects extends RelatedElement {\n public static classFullName = \"BisCore:ElementOwnsMultiAspects\";\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsMultiAspects.classFullName) {\n super({ id: elementId, relClassName });\n }\n}\n\n/** Relates an [[Element]] and an [[ExternalSourceAspect]] that it owns.\n * @public\n */\nexport class ElementOwnsExternalSourceAspects extends ElementOwnsMultiAspects {\n public static override classFullName = \"BisCore:ElementOwnsExternalSourceAspects\";\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsExternalSourceAspects.classFullName) {\n super(elementId, relClassName);\n }\n}\n\n/** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceIsInRepository extends RelatedElement {\n public static classFullName = \"BisCore:ExternalSourceIsInRepository\";\n public constructor(repositoryId: Id64String, relClassName: string = ExternalSourceIsInRepository.classFullName) {\n super({ id: repositoryId, relClassName });\n }\n}\n\n/** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceAttachmentAttachesSource extends RelatedElement {\n public static classFullName = \"BisCore:ExternalSourceAttachmentAttachesSource\";\n public constructor(externalSourceId: Id64String, relClassName: string = ExternalSourceAttachmentAttachesSource.classFullName) {\n super({ id: externalSourceId, relClassName });\n }\n}\n\n/** Relates a [[SheetReference]] and [[Sheet]] that it refers.\n * @beta\n */\nexport class SheetReferenceRefersToSheet extends RelatedElement {\n public static classFullName = \"BisCore:SheetReferenceRefersToSheet\";\n public constructor(sheetId: Id64String, relClassName: string = SheetReferenceRefersToSheet.classFullName) {\n super({ id: sheetId, relClassName });\n }\n}\n\n/** Relates a [[SheetIndexReference]] to a [[SheetIndex]] it refers.\n * @beta\n */\nexport class SheetIndexReferenceRefersToSheetIndex extends RelatedElement {\n public static classFullName = \"BisCore:SheetIndexReferenceRefersToSheetIndex\";\n public constructor(sheetIndexId: Id64String, relClassName: string = SheetIndexReferenceRefersToSheetIndex.classFullName) {\n super({ id: sheetIndexId, relClassName });\n }\n}\n"]}
@@ -11,13 +11,16 @@ const BackendLoggerCategory_1 = require("./BackendLoggerCategory");
11
11
  * @internal
12
12
  */
13
13
  class QueryablePromise {
14
+ promise;
15
+ result;
16
+ error;
17
+ _fulfilled = false;
18
+ _rejected = false;
14
19
  get isPending() { return !this.isFulfilled && !this.isRejected; }
15
20
  get isFulfilled() { return this._fulfilled; }
16
21
  get isRejected() { return this._rejected; }
17
22
  constructor(promise) {
18
23
  this.promise = promise;
19
- this._fulfilled = false;
20
- this._rejected = false;
21
24
  this.promise.then((res) => {
22
25
  this.result = res;
23
26
  this._fulfilled = true;
@@ -33,6 +36,12 @@ exports.QueryablePromise = QueryablePromise;
33
36
  * @internal
34
37
  */
35
38
  class PromiseMemoizer {
39
+ _cachedPromises = new Map();
40
+ _timers = new Map();
41
+ _memoizeFn;
42
+ _generateKeyFn;
43
+ _maxCacheSize;
44
+ _cacheTimeout;
36
45
  /**
37
46
  * Constructor
38
47
  * @param memoizeFn Function to memoize
@@ -43,8 +52,6 @@ class PromiseMemoizer {
43
52
  * threshold, the entire cache is then cleared.
44
53
  */
45
54
  constructor(memoizeFn, generateKeyFn, maxCacheSize = 500, cacheTimeout = 30000) {
46
- this._cachedPromises = new Map();
47
- this._timers = new Map();
48
55
  this._memoizeFn = memoizeFn;
49
56
  this._generateKeyFn = generateKeyFn;
50
57
  this._maxCacheSize = maxCacheSize;
@@ -1 +1 @@
1
- {"version":3,"file":"PromiseMemoizer.js","sourceRoot":"","sources":["../../src/PromiseMemoizer.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,sDAA6C;AAC7C,mEAAgE;AAEhE;;GAEG;AACH,MAAa,gBAAgB;IAO3B,IAAW,SAAS,KAAc,OAAO,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACjF,IAAW,WAAW,KAAc,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAC7D,IAAW,UAAU,KAAc,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAC3D,YAAmC,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;QAN9C,eAAU,GAAY,KAAK,CAAC;QAC5B,cAAS,GAAY,KAAK,CAAC;QAMjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAM,EAAE,EAAE;YAC3B,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;YAClB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACzB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAQ,EAAE,EAAE;YACpB,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;YACjB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAnBD,4CAmBC;AAOD;;;GAGG;AACH,MAAa,eAAe;IAQ1B;;;;;;;;OAQG;IACH,YAAmB,SAA2B,EAAE,aAAgC,EAAE,eAAuB,GAAG,EAAE,eAAuB,KAAK;QAhBzH,oBAAe,GAAqC,IAAI,GAAG,EAA+B,CAAC;QAC3F,YAAO,GAAgC,IAAI,GAAG,EAA0B,CAAC;QAgBxF,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QA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G,IAAI,gBAAgB,CAAI,CAAC,CAAC,CAAC;QAChC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAClC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,mCAAmC;IAC5B,cAAc,CAAC,GAAG,IAAW;QAClC,MAAM,GAAG,GAAW,IAAI,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,KAAK;YACP,YAAY,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,8CAA8C;IACvC,UAAU;QACf,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;IAEM,CAAC,MAAM,CAAC,OAAO,CAAC;QACrB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACvC,YAAY,CAAC,KAAK,CAAC,CAAC;QAEtB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;CACF;AA5ED,0CA4EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { Logger } from \"@itwin/core-bentley\";\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\n\n/** Wrapper around a promise that allows synchronous queries of it's state\n * @internal\n */\nexport class QueryablePromise<T> {\n public result?: T;\n public error?: any;\n\n private _fulfilled: boolean = false;\n private _rejected: boolean = false;\n\n public get isPending(): boolean { return !this.isFulfilled && !this.isRejected; }\n public get isFulfilled(): boolean { return this._fulfilled; }\n public get isRejected(): boolean { return this._rejected; }\n public constructor(public readonly promise: Promise<T>) {\n this.promise.then((res: T) => {\n this.result = res;\n this._fulfilled = true;\n }).catch((err: any) => {\n this.error = err;\n this._rejected = true;\n });\n }\n}\n\n/** @internal */\nexport type MemoizeFnType<T> = (...args: any[]) => Promise<T>;\n/** @internal */\nexport type GenerateKeyFnType = (...args: any[]) => string;\n\n/** Utility to cache and retrieve results of long running asynchronous functions.\n * The cache is keyed on the input arguments passed to these functions\n * @internal\n */\nexport class PromiseMemoizer<T> implements Disposable {\n private readonly _cachedPromises: Map<string, QueryablePromise<T>> = new Map<string, QueryablePromise<T>>();\n private readonly _timers: Map<string, NodeJS.Timeout> = new Map<string, NodeJS.Timeout>();\n private readonly _memoizeFn: MemoizeFnType<T>;\n private readonly _generateKeyFn: GenerateKeyFnType;\n private readonly _maxCacheSize: number;\n private readonly _cacheTimeout: number;\n\n /**\n * Constructor\n * @param memoizeFn Function to memoize\n * @param generateKeyFn Function to generate the key for the memoized function\n * @param maxCacheSize Maximum size of the memoizer cache.\n * If the maximum cache size is exceeded, fulfilled/rejected entries are first discarded - these\n * may have been unclaimed/orphaned promises. If the cache size is still above the maxCacheSize\n * threshold, the entire cache is then cleared.\n */\n public constructor(memoizeFn: MemoizeFnType<T>, generateKeyFn: GenerateKeyFnType, maxCacheSize: number = 500, cacheTimeout: number = 30000) {\n this._memoizeFn = memoizeFn;\n this._generateKeyFn = generateKeyFn;\n this._maxCacheSize = maxCacheSize;\n this._cacheTimeout = cacheTimeout;\n }\n\n /** Call the memoized function */\n public memoize(...args: any[]): QueryablePromise<T> {\n const key: string = this._generateKeyFn(...args);\n let qp: QueryablePromise<T> | undefined = this._cachedPromises.get(key);\n if (qp)\n return qp;\n\n if (this._cachedPromises.size >= this._maxCacheSize) {\n if (this._maxCacheSize > 1)\n Logger.logError(BackendLoggerCategory.PromiseMemoizer, \"Cleared too many unresolved entries in memoizer cache\");\n this.clearCache();\n }\n\n const removeCachedPromise = (v: T) => {\n const cleanUp = () => {\n this._cachedPromises.delete(key);\n this._timers.delete(key);\n };\n this._timers.set(key, setTimeout(cleanUp, this._cacheTimeout));\n return v;\n };\n\n const p = this._memoizeFn(...args).then(removeCachedPromise, (e) => {\n throw removeCachedPromise(e); // eslint-disable-line @typescript-eslint/only-throw-error\n });\n\n qp = new QueryablePromise<T>(p);\n this._cachedPromises.set(key, qp);\n return qp;\n }\n\n /** Delete the memoized function */\n public deleteMemoized(...args: any[]) {\n const key: string = this._generateKeyFn(...args);\n this._cachedPromises.delete(key);\n const timer = this._timers.get(key);\n if (timer)\n clearTimeout(timer);\n }\n\n /** Clear all entries in the memoizer cache */\n public clearCache() {\n this._cachedPromises.clear();\n }\n\n public [Symbol.dispose]() {\n for (const timer of this._timers.values())\n clearTimeout(timer);\n\n this._timers.clear();\n this.clearCache();\n }\n}\n"]}
1
+ {"version":3,"file":"PromiseMemoizer.js","sourceRoot":"","sources":["../../src/PromiseMemoizer.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,sDAA6C;AAC7C,mEAAgE;AAEhE;;GAEG;AACH,MAAa,gBAAgB;IAUQ;IAT5B,MAAM,CAAK;IACX,KAAK,CAAO;IAEX,UAAU,GAAY,KAAK,CAAC;IAC5B,SAAS,GAAY,KAAK,CAAC;IAEnC,IAAW,SAAS,KAAc,OAAO,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACjF,IAAW,WAAW,KAAc,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAC7D,IAAW,UAAU,KAAc,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAC3D,YAAmC,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;QACpD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAM,EAAE,EAAE;YAC3B,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;YAClB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACzB,CAAC,CAAC,CAA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AAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;CACF;AA5ED,0CA4EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { Logger } from \"@itwin/core-bentley\";\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\n\n/** Wrapper around a promise that allows synchronous queries of it's state\n * @internal\n */\nexport class QueryablePromise<T> {\n public result?: T;\n public error?: any;\n\n private _fulfilled: boolean = false;\n private _rejected: boolean = false;\n\n public get isPending(): boolean { return !this.isFulfilled && !this.isRejected; }\n public get isFulfilled(): boolean { return this._fulfilled; }\n public get isRejected(): boolean { return this._rejected; }\n public constructor(public readonly promise: Promise<T>) {\n this.promise.then((res: T) => {\n this.result = res;\n this._fulfilled = true;\n }).catch((err: any) => {\n this.error = err;\n this._rejected = true;\n });\n }\n}\n\n/** @internal */\nexport type MemoizeFnType<T> = (...args: any[]) => Promise<T>;\n/** @internal */\nexport type GenerateKeyFnType = (...args: any[]) => string;\n\n/** Utility to cache and retrieve results of long running asynchronous functions.\n * The cache is keyed on the input arguments passed to these functions\n * @internal\n */\nexport class PromiseMemoizer<T> implements Disposable {\n private readonly _cachedPromises: Map<string, QueryablePromise<T>> = new Map<string, QueryablePromise<T>>();\n private readonly _timers: Map<string, NodeJS.Timeout> = new Map<string, NodeJS.Timeout>();\n private readonly _memoizeFn: MemoizeFnType<T>;\n private readonly _generateKeyFn: GenerateKeyFnType;\n private readonly _maxCacheSize: number;\n private readonly _cacheTimeout: number;\n\n /**\n * Constructor\n * @param memoizeFn Function to memoize\n * @param generateKeyFn Function to generate the key for the memoized function\n * @param maxCacheSize Maximum size of the memoizer cache.\n * If the maximum cache size is exceeded, fulfilled/rejected entries are first discarded - these\n * may have been unclaimed/orphaned promises. If the cache size is still above the maxCacheSize\n * threshold, the entire cache is then cleared.\n */\n public constructor(memoizeFn: MemoizeFnType<T>, generateKeyFn: GenerateKeyFnType, maxCacheSize: number = 500, cacheTimeout: number = 30000) {\n this._memoizeFn = memoizeFn;\n this._generateKeyFn = generateKeyFn;\n this._maxCacheSize = maxCacheSize;\n this._cacheTimeout = cacheTimeout;\n }\n\n /** Call the memoized function */\n public memoize(...args: any[]): QueryablePromise<T> {\n const key: string = this._generateKeyFn(...args);\n let qp: QueryablePromise<T> | undefined = this._cachedPromises.get(key);\n if (qp)\n return qp;\n\n if (this._cachedPromises.size >= this._maxCacheSize) {\n if (this._maxCacheSize > 1)\n Logger.logError(BackendLoggerCategory.PromiseMemoizer, \"Cleared too many unresolved entries in memoizer cache\");\n this.clearCache();\n }\n\n const removeCachedPromise = (v: T) => {\n const cleanUp = () => {\n this._cachedPromises.delete(key);\n this._timers.delete(key);\n };\n this._timers.set(key, setTimeout(cleanUp, this._cacheTimeout));\n return v;\n };\n\n const p = this._memoizeFn(...args).then(removeCachedPromise, (e) => {\n throw removeCachedPromise(e); // eslint-disable-line @typescript-eslint/only-throw-error\n });\n\n qp = new QueryablePromise<T>(p);\n this._cachedPromises.set(key, qp);\n return qp;\n }\n\n /** Delete the memoized function */\n public deleteMemoized(...args: any[]) {\n const key: string = this._generateKeyFn(...args);\n this._cachedPromises.delete(key);\n const timer = this._timers.get(key);\n if (timer)\n clearTimeout(timer);\n }\n\n /** Clear all entries in the memoizer cache */\n public clearCache() {\n this._cachedPromises.clear();\n }\n\n public [Symbol.dispose]() {\n for (const timer of this._timers.values())\n clearTimeout(timer);\n\n this._timers.clear();\n this.clearCache();\n }\n}\n"]}
@@ -14,10 +14,7 @@ var PropertyStore;
14
14
  * A SQLite database for storing PropertyName/PropertyValue pairs.
15
15
  */
16
16
  class PropertyDb extends SQLiteDb_1.VersionedSqliteDb {
17
- constructor() {
18
- super(...arguments);
19
- this.myVersion = "3.0.0";
20
- }
17
+ myVersion = "3.0.0";
21
18
  createDDL() {
22
19
  this.createTable({ tableName: "properties", columns: "name TEXT NOT NULL PRIMARY KEY,type,value", addTimestamp: true });
23
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyStore.js","sourceRoot":"","sources":["../../src/PropertyStore.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAO/F,+CAA4C;AAC5C,yCAA+C;AAG/C,YAAY;AACZ,IAAiB,aAAa,CAuP7B;AAvPD,WAAiB,aAAa;IAyB5B;;OAEG;IACH,MAAa,UAAW,SAAQ,4BAAiB;QAAjD;;YAC2B,cAAS,GAAG,OAAO,CAAC;QAgL/C,CAAC;QA9KoB,SAAS;YAC1B,IAAI,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,2CAA2C,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1H,CAAC;QAED;;WAEG;QACI,WAAW,CAAC,IAAkB;YACnC,OAAO,IAAI,CAAC,2BAA2B,CAAC,gDAAgD,EAAE,CAAC,IAAI,EAAE,EAAE;gBACjG,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;gBACzB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;oBACjB,OAAO,SAAS,CAAC;gBACnB,QAAQ,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC/B,KAAK,QAAQ;wBACX,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;oBAChC,KAAK,SAAS;wBACZ,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;oBACvC,KAAK,MAAM;wBACT,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;oBAC9B,KAAK,QAAQ;wBACX,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;oBAChC,KAAK,QAAQ;wBACX,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAA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,EAvPgB,aAAa,6BAAb,aAAa,QAuP7B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module SQLiteDb\n */\n\nimport { BlobContainer } from \"./BlobContainerService\";\nimport { CloudSqlite } from \"./CloudSqlite\";\nimport { VersionedSqliteDb } from \"./SQLiteDb\";\nimport { SettingsContainer } from \"./workspace/Settings\";\n\n/** @beta */\nexport namespace PropertyStore {\n\n /** The set of valid types for properties in a PropertyStore. */\n export type PropertyType = string | number | boolean | Uint8Array | SettingsContainer;\n /** The case-sensitive name of a Property. May not have leading or trailing spaces, and must be between 3 and 2048 characters long. */\n export type PropertyName = string;\n /** An array of PropertyName/PropertyType pairs to be stored in a PropertyStore. */\n export type PropertyArray = { name: PropertyName, value: PropertyType }[];\n /** The return status of an iteration function. The value \"stop\" causes the iteration to terminate. */\n export type IterationReturn = void | \"stop\";\n /** An iteration function over Properties in a PropertyStore. It is called with the name of a each Property. */\n export type PropertyIteration = (name: string) => IterationReturn;\n\n /** A filter used to limit and/or sort the values returned by an iteration. */\n export interface PropertyFilter {\n /** A value filter. May include wild cards when used with `GLOB` or `LIKE` */\n readonly value?: string;\n /** The comparison operator for `value`. Default is `=` */\n readonly valueCompare?: \"GLOB\" | \"LIKE\" | \"NOT GLOB\" | \"NOT LIKE\" | \"=\" | \"!=\" | \"<\" | \">\";\n /** Order results ascending or descending. If not supplied, the results are unordered (random). */\n readonly orderBy?: \"ASC\" | \"DESC\";\n /** An SQL expression to further filter results. This string is appended to the `WHERE` clause with an `AND` (that should not be part of the sqlExpression) */\n readonly sqlExpression?: string;\n }\n\n /**\n * A SQLite database for storing PropertyName/PropertyValue pairs.\n */\n export class PropertyDb extends VersionedSqliteDb {\n public override readonly myVersion = \"3.0.0\";\n\n protected override createDDL() {\n this.createTable({ tableName: \"properties\", columns: \"name TEXT NOT NULL PRIMARY KEY,type,value\", addTimestamp: true });\n }\n\n /** get the value of a Property by name.\n * @returns the property's value if it exists, `undefined` otherwise.\n */\n public getProperty(name: PropertyName): PropertyType | undefined {\n return this.withPreparedSqliteStatement(\"SELECT type,value from properties WHERE name=?\", (stmt) => {\n stmt.bindString(1, name);\n if (!stmt.nextRow())\n return undefined;\n switch (stmt.getValueString(0)) {\n case \"string\":\n return stmt.getValueString(1);\n case \"boolean\":\n return stmt.getValueInteger(1) !== 0;\n case \"blob\":\n return stmt.getValueBlob(1);\n case \"number\":\n return stmt.getValueDouble(1);\n case \"object\":\n return JSON.parse(stmt.getValueString(1)) as SettingsContainer;\n }\n return undefined;\n });\n }\n /** Get the value of a string property by name.\n * @returns the property's value if it exists and is a string, `undefined` otherwise.\n */\n public getString(name: PropertyName, defaultValue: string): string;\n /** Get the value of a string property by name.\n * @returns the property's value if it exists and is a string, otherwise the supplied default value.\n */\n public getString(name: PropertyName): string | undefined;\n public getString(name: PropertyName, defaultValue?: string): string | undefined {\n const out = this.getProperty(name);\n return typeof out === \"string\" ? out : defaultValue;\n }\n /** Get the value of a boolean property by name.\n * @returns the property's value if it exists and is a boolean, `undefined` otherwise.\n */\n public getBoolean(name: PropertyName): boolean | undefined;\n /** Get the value of a boolean property by name.\n * @returns the property's value if it exists and is a boolean, otherwise the supplied default value.\n */\n public getBoolean(name: PropertyName, defaultValue: boolean): boolean;\n public getBoolean(name: PropertyName, defaultValue?: boolean): boolean | undefined {\n const out = this.getProperty(name);\n return typeof out === \"boolean\" ? out : defaultValue;\n }\n /** Get the value of a number property by name.\n * @returns the property's value if it exists and is a number, `undefined` otherwise.\n */\n public getNumber(name: PropertyName): number | undefined;\n /** Get the value of a number property by name.\n * @returns the property's value if it exists and is a number, otherwise the supplied default value.\n */\n public getNumber(name: PropertyName, defaultValue: number): number;\n public getNumber(name: PropertyName, defaultValue?: number): number | undefined {\n const out = this.getProperty(name);\n return typeof out === \"number\" ? out : defaultValue;\n }\n /** Get the value of a blob property by name.\n * @returns the property's value if it exists and is a blob, `undefined` otherwise.\n */\n public getBlob(name: PropertyName): Uint8Array | undefined;\n /** Get the value of a blob property by name.\n * @returns the property's value if it exists and is a blob, otherwise the supplied default value.\n */\n public getBlob(name: PropertyName, defaultValue: Uint8Array): Uint8Array;\n public getBlob(name: PropertyName, defaultValue?: Uint8Array): Uint8Array | undefined {\n const out = this.getProperty(name);\n return out instanceof Uint8Array ? out : defaultValue;\n }\n /** Get the value of an object property by name.\n * @returns the property's value if it exists and is an object, `undefined` otherwise.\n */\n public getObject(name: PropertyName): SettingsContainer | undefined;\n /** Get the value of an object property by name.\n * @returns the property's value if it exists and is an object, otherwise the supplied default value.\n */\n public getObject(name: PropertyName, defaultValue: SettingsContainer): SettingsContainer;\n public getObject(name: PropertyName, defaultValue?: SettingsContainer): SettingsContainer | undefined {\n const out = this.getProperty(name);\n return typeof out === \"object\" ? out as SettingsContainer : defaultValue;\n }\n\n /** call an iteration function for each property, optionally applying a filter */\n public forAllProperties(iter: PropertyIteration, filter?: PropertyFilter) {\n let sql = \"SELECT name FROM properties WHERE name IS NOT NULL\";\n if (filter?.sqlExpression)\n sql += ` AND ${filter.sqlExpression} `;\n if (filter?.value)\n sql += ` AND name ${filter.valueCompare ?? \"=\"} @val`;\n if (filter?.orderBy)\n sql += ` ORDER BY name ${filter.orderBy} `;\n\n this.withSqliteStatement(sql, (stmt) => {\n if (filter?.value)\n stmt.bindString(\"@val\", filter.value);\n\n while (stmt.nextRow()) {\n if (iter(stmt.getValueString(0)) === \"stop\")\n return;\n }\n });\n }\n\n /** Delete a single property from this PropertyDb. If the value does not exist, this method does nothing.\n * @note the database must be opened for write\n */\n public async deleteProperty(propName: PropertyName) {\n this.withSqliteStatement(\"DELETE from properties WHERE name=?\", (stmt) => {\n stmt.bindString(1, propName);\n stmt.stepForWrite();\n });\n }\n /** Delete an array of properties from this PropertyDb. Any value that does not exist is ignored.\n * @note the database must be opened for write\n */\n public async deleteProperties(propNames: PropertyName[]) {\n propNames.forEach(async (name) => this.deleteProperty(name));\n }\n\n private validateName(name: PropertyName) {\n if (typeof name !== \"string\" || name.trim() !== name || name.length > 2 * 1024 || name.length < 2)\n throw new Error(`illegal property name[${name}]`);\n }\n\n /** Save a single property in this PropertyDb. If the property already exists, its value is overwritten.\n * @note the database must be opened for write\n */\n public async saveProperty(name: PropertyName, value: PropertyType) {\n this.validateName(name);\n this.withSqliteStatement(\"INSERT OR REPLACE INTO properties(name,type,value) VALUES (?,?,?)\", (stmt) => {\n stmt.bindString(1, name);\n switch (typeof value) {\n case \"string\":\n stmt.bindString(2, \"string\");\n stmt.bindString(3, value);\n break;\n case \"boolean\":\n stmt.bindString(2, \"boolean\");\n stmt.bindInteger(3, value ? 1 : 0);\n break;\n case \"number\":\n stmt.bindString(2, \"number\");\n stmt.bindDouble(3, value);\n break;\n case \"object\":\n if (value instanceof Uint8Array) {\n stmt.bindString(2, \"blob\");\n stmt.bindBlob(3, value);\n } else {\n stmt.bindString(2, \"object\");\n stmt.bindString(3, JSON.stringify(value));\n }\n break;\n default:\n throw new Error(\"illegal property value type\");\n }\n\n stmt.stepForWrite();\n });\n }\n\n /** Save an array of properties in this PropertyDb. If a property already exists, its value is overwritten.\n * @note the database must be opened for write\n */\n public async saveProperties(props: PropertyArray) {\n for (const prop of props)\n await this.saveProperty(prop.name, prop.value);\n }\n }\n\n const defaultDbName = \"PropertyDb\";\n\n export interface CreateNewContainerProps {\n scope: BlobContainer.Scope;\n metadata: Omit<BlobContainer.Metadata, \"containerType\">;\n }\n\n /**\n * Provides access to a cloud-based `PropertyDb` to hold a set of values of type `PropertyType`, each with a unique `PropertyName`.\n * `PropertyStore.PropertyDb`s that are stored in cloud containers require an access token that grants permission to read and/or write them.\n * All write operations will fail without an access token that grants write permission.\n *\n * The database is cached on a local drive so reads are fast and inexpensive, and may even be done offline after a prefetch.\n * However, that means that callers are responsible for synchronizing the local cache to ensure it includes changes\n * made by others, as appropriate (see [[synchronizeWithCloud]]).\n */\n export class CloudAccess extends CloudSqlite.DbAccess<PropertyDb> {\n public constructor(props: CloudSqlite.ContainerAccessProps) {\n super({ dbType: PropertyDb, props, dbName: defaultDbName });\n }\n\n /**\n * Initialize a cloud container for use as a PropertyStore. This method is called by [[createNewContainer]].\n * It is only necessary to convert an existing container to a PropertyStore container.\n * @note this deletes any existing content in the container.\n * @internal\n */\n public static async initializeDb(args: { props: CloudSqlite.ContainerProps }) {\n return super._initializeDb({ ...args, dbType: PropertyDb, dbName: defaultDbName });\n }\n\n /** Create and initialize a new BlobContainer to hold a PropertyStore\n * @note the current user must have administrator rights to create containers.\n */\n public static async createNewContainer(args: CreateNewContainerProps): Promise<CloudSqlite.ContainerProps> {\n const props = await this.createBlobContainer({ scope: args.scope, metadata: { ...args.metadata, containerType: \"property-store\" } });\n await this.initializeDb({ props });\n return props;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"PropertyStore.js","sourceRoot":"","sources":["../../src/PropertyStore.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAO/F,+CAA4C;AAC5C,yCAA+C;AAG/C,YAAY;AACZ,IAAiB,aAAa,CAuP7B;AAvPD,WAAiB,aAAa;IAyB5B;;OAEG;IACH,MAAa,UAAW,SAAQ,4BAAiB;QACtB,SAAS,GAAG,OAAO,CAAC;QAE1B,SAAS;YAC1B,IAAI,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,2CAA2C,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1H,CAAC;QAED;;WAEG;QACI,WAAW,CAAC,IAAkB;YACnC,OAAO,IAAI,CAAC,2BAA2B,CAAC,gDAAgD,EAAE,CAAC,IAAI,EAAE,EAAE;gBACjG,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;gBACzB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;oBACjB,OAAO,SAAS,CAAC;gBACnB,QAAQ,IAAI,CAAC,cAAc,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,aAAa,EAAE,CAAC,CAAC;QACrF,CAAC;QAED;;WAEG;QACI,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAA6B;YAClE,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;YACrI,MAAM,IAAI,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;YACnC,OAAO,KAAK,CAAC;QACf,CAAC;KACF;IAvBY,yBAAW,cAuBvB,CAAA;AACH,CAAC,EAvPgB,aAAa,6BAAb,aAAa,QAuP7B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module SQLiteDb\n */\n\nimport { BlobContainer } from \"./BlobContainerService\";\nimport { CloudSqlite } from \"./CloudSqlite\";\nimport { VersionedSqliteDb } from \"./SQLiteDb\";\nimport { SettingsContainer } from \"./workspace/Settings\";\n\n/** @beta */\nexport namespace PropertyStore {\n\n /** The set of valid types for properties in a PropertyStore. */\n export type PropertyType = string | number | boolean | Uint8Array | SettingsContainer;\n /** The case-sensitive name of a Property. May not have leading or trailing spaces, and must be between 3 and 2048 characters long. */\n export type PropertyName = string;\n /** An array of PropertyName/PropertyType pairs to be stored in a PropertyStore. */\n export type PropertyArray = { name: PropertyName, value: PropertyType }[];\n /** The return status of an iteration function. The value \"stop\" causes the iteration to terminate. */\n export type IterationReturn = void | \"stop\";\n /** An iteration function over Properties in a PropertyStore. It is called with the name of a each Property. */\n export type PropertyIteration = (name: string) => IterationReturn;\n\n /** A filter used to limit and/or sort the values returned by an iteration. */\n export interface PropertyFilter {\n /** A value filter. May include wild cards when used with `GLOB` or `LIKE` */\n readonly value?: string;\n /** The comparison operator for `value`. Default is `=` */\n readonly valueCompare?: \"GLOB\" | \"LIKE\" | \"NOT GLOB\" | \"NOT LIKE\" | \"=\" | \"!=\" | \"<\" | \">\";\n /** Order results ascending or descending. If not supplied, the results are unordered (random). */\n readonly orderBy?: \"ASC\" | \"DESC\";\n /** An SQL expression to further filter results. This string is appended to the `WHERE` clause with an `AND` (that should not be part of the sqlExpression) */\n readonly sqlExpression?: string;\n }\n\n /**\n * A SQLite database for storing PropertyName/PropertyValue pairs.\n */\n export class PropertyDb extends VersionedSqliteDb {\n public override readonly myVersion = \"3.0.0\";\n\n protected override createDDL() {\n this.createTable({ tableName: \"properties\", columns: \"name TEXT NOT NULL PRIMARY KEY,type,value\", addTimestamp: true });\n }\n\n /** get the value of a Property by name.\n * @returns the property's value if it exists, `undefined` otherwise.\n */\n public getProperty(name: PropertyName): PropertyType | undefined {\n return this.withPreparedSqliteStatement(\"SELECT type,value from properties WHERE name=?\", (stmt) => {\n stmt.bindString(1, name);\n if (!stmt.nextRow())\n return undefined;\n switch (stmt.getValueString(0)) {\n case \"string\":\n return stmt.getValueString(1);\n case \"boolean\":\n return stmt.getValueInteger(1) !== 0;\n case \"blob\":\n return stmt.getValueBlob(1);\n case \"number\":\n return stmt.getValueDouble(1);\n case \"object\":\n return JSON.parse(stmt.getValueString(1)) as SettingsContainer;\n }\n return undefined;\n });\n }\n /** Get the value of a string property by name.\n * @returns the property's value if it exists and is a string, `undefined` otherwise.\n */\n public getString(name: PropertyName, defaultValue: string): string;\n /** Get the value of a string property by name.\n * @returns the property's value if it exists and is a string, otherwise the supplied default value.\n */\n public getString(name: PropertyName): string | undefined;\n public getString(name: PropertyName, defaultValue?: string): string | undefined {\n const out = this.getProperty(name);\n return typeof out === \"string\" ? out : defaultValue;\n }\n /** Get the value of a boolean property by name.\n * @returns the property's value if it exists and is a boolean, `undefined` otherwise.\n */\n public getBoolean(name: PropertyName): boolean | undefined;\n /** Get the value of a boolean property by name.\n * @returns the property's value if it exists and is a boolean, otherwise the supplied default value.\n */\n public getBoolean(name: PropertyName, defaultValue: boolean): boolean;\n public getBoolean(name: PropertyName, defaultValue?: boolean): boolean | undefined {\n const out = this.getProperty(name);\n return typeof out === \"boolean\" ? out : defaultValue;\n }\n /** Get the value of a number property by name.\n * @returns the property's value if it exists and is a number, `undefined` otherwise.\n */\n public getNumber(name: PropertyName): number | undefined;\n /** Get the value of a number property by name.\n * @returns the property's value if it exists and is a number, otherwise the supplied default value.\n */\n public getNumber(name: PropertyName, defaultValue: number): number;\n public getNumber(name: PropertyName, defaultValue?: number): number | undefined {\n const out = this.getProperty(name);\n return typeof out === \"number\" ? out : defaultValue;\n }\n /** Get the value of a blob property by name.\n * @returns the property's value if it exists and is a blob, `undefined` otherwise.\n */\n public getBlob(name: PropertyName): Uint8Array | undefined;\n /** Get the value of a blob property by name.\n * @returns the property's value if it exists and is a blob, otherwise the supplied default value.\n */\n public getBlob(name: PropertyName, defaultValue: Uint8Array): Uint8Array;\n public getBlob(name: PropertyName, defaultValue?: Uint8Array): Uint8Array | undefined {\n const out = this.getProperty(name);\n return out instanceof Uint8Array ? out : defaultValue;\n }\n /** Get the value of an object property by name.\n * @returns the property's value if it exists and is an object, `undefined` otherwise.\n */\n public getObject(name: PropertyName): SettingsContainer | undefined;\n /** Get the value of an object property by name.\n * @returns the property's value if it exists and is an object, otherwise the supplied default value.\n */\n public getObject(name: PropertyName, defaultValue: SettingsContainer): SettingsContainer;\n public getObject(name: PropertyName, defaultValue?: SettingsContainer): SettingsContainer | undefined {\n const out = this.getProperty(name);\n return typeof out === \"object\" ? out as SettingsContainer : defaultValue;\n }\n\n /** call an iteration function for each property, optionally applying a filter */\n public forAllProperties(iter: PropertyIteration, filter?: PropertyFilter) {\n let sql = \"SELECT name FROM properties WHERE name IS NOT NULL\";\n if (filter?.sqlExpression)\n sql += ` AND ${filter.sqlExpression} `;\n if (filter?.value)\n sql += ` AND name ${filter.valueCompare ?? \"=\"} @val`;\n if (filter?.orderBy)\n sql += ` ORDER BY name ${filter.orderBy} `;\n\n this.withSqliteStatement(sql, (stmt) => {\n if (filter?.value)\n stmt.bindString(\"@val\", filter.value);\n\n while (stmt.nextRow()) {\n if (iter(stmt.getValueString(0)) === \"stop\")\n return;\n }\n });\n }\n\n /** Delete a single property from this PropertyDb. If the value does not exist, this method does nothing.\n * @note the database must be opened for write\n */\n public async deleteProperty(propName: PropertyName) {\n this.withSqliteStatement(\"DELETE from properties WHERE name=?\", (stmt) => {\n stmt.bindString(1, propName);\n stmt.stepForWrite();\n });\n }\n /** Delete an array of properties from this PropertyDb. Any value that does not exist is ignored.\n * @note the database must be opened for write\n */\n public async deleteProperties(propNames: PropertyName[]) {\n propNames.forEach(async (name) => this.deleteProperty(name));\n }\n\n private validateName(name: PropertyName) {\n if (typeof name !== \"string\" || name.trim() !== name || name.length > 2 * 1024 || name.length < 2)\n throw new Error(`illegal property name[${name}]`);\n }\n\n /** Save a single property in this PropertyDb. If the property already exists, its value is overwritten.\n * @note the database must be opened for write\n */\n public async saveProperty(name: PropertyName, value: PropertyType) {\n this.validateName(name);\n this.withSqliteStatement(\"INSERT OR REPLACE INTO properties(name,type,value) VALUES (?,?,?)\", (stmt) => {\n stmt.bindString(1, name);\n switch (typeof value) {\n case \"string\":\n stmt.bindString(2, \"string\");\n stmt.bindString(3, value);\n break;\n case \"boolean\":\n stmt.bindString(2, \"boolean\");\n stmt.bindInteger(3, value ? 1 : 0);\n break;\n case \"number\":\n stmt.bindString(2, \"number\");\n stmt.bindDouble(3, value);\n break;\n case \"object\":\n if (value instanceof Uint8Array) {\n stmt.bindString(2, \"blob\");\n stmt.bindBlob(3, value);\n } else {\n stmt.bindString(2, \"object\");\n stmt.bindString(3, JSON.stringify(value));\n }\n break;\n default:\n throw new Error(\"illegal property value type\");\n }\n\n stmt.stepForWrite();\n });\n }\n\n /** Save an array of properties in this PropertyDb. If a property already exists, its value is overwritten.\n * @note the database must be opened for write\n */\n public async saveProperties(props: PropertyArray) {\n for (const prop of props)\n await this.saveProperty(prop.name, prop.value);\n }\n }\n\n const defaultDbName = \"PropertyDb\";\n\n export interface CreateNewContainerProps {\n scope: BlobContainer.Scope;\n metadata: Omit<BlobContainer.Metadata, \"containerType\">;\n }\n\n /**\n * Provides access to a cloud-based `PropertyDb` to hold a set of values of type `PropertyType`, each with a unique `PropertyName`.\n * `PropertyStore.PropertyDb`s that are stored in cloud containers require an access token that grants permission to read and/or write them.\n * All write operations will fail without an access token that grants write permission.\n *\n * The database is cached on a local drive so reads are fast and inexpensive, and may even be done offline after a prefetch.\n * However, that means that callers are responsible for synchronizing the local cache to ensure it includes changes\n * made by others, as appropriate (see [[synchronizeWithCloud]]).\n */\n export class CloudAccess extends CloudSqlite.DbAccess<PropertyDb> {\n public constructor(props: CloudSqlite.ContainerAccessProps) {\n super({ dbType: PropertyDb, props, dbName: defaultDbName });\n }\n\n /**\n * Initialize a cloud container for use as a PropertyStore. This method is called by [[createNewContainer]].\n * It is only necessary to convert an existing container to a PropertyStore container.\n * @note this deletes any existing content in the container.\n * @internal\n */\n public static async initializeDb(args: { props: CloudSqlite.ContainerProps }) {\n return super._initializeDb({ ...args, dbType: PropertyDb, dbName: defaultDbName });\n }\n\n /** Create and initialize a new BlobContainer to hold a PropertyStore\n * @note the current user must have administrator rights to create containers.\n */\n public static async createNewContainer(args: CreateNewContainerProps): Promise<CloudSqlite.ContainerProps> {\n const props = await this.createBlobContainer({ scope: args.scope, metadata: { ...args.metadata, containerType: \"property-store\" } });\n await this.initializeDb({ props });\n return props;\n }\n }\n}\n"]}
@@ -17,6 +17,8 @@ const Symbols_1 = require("./internal/Symbols");
17
17
  */
18
18
  class Relationship extends Entity_1.Entity {
19
19
  static get className() { return "Relationship"; }
20
+ sourceId;
21
+ targetId;
20
22
  constructor(props, iModel) {
21
23
  super(props, iModel);
22
24
  this.sourceId = core_bentley_1.Id64.fromJSON(props.sourceId);
@@ -119,6 +121,7 @@ exports.SynchronizationConfigSpecifiesRootSources = SynchronizationConfigSpecifi
119
121
  */
120
122
  class ElementGroupsMembers extends ElementRefersToElements {
121
123
  static get className() { return "ElementGroupsMembers"; }
124
+ memberPriority;
122
125
  constructor(props, iModel) {
123
126
  super(props, iModel);
124
127
  this.memberPriority = props.memberPriority;
@@ -340,6 +343,14 @@ exports.ExternalSourceGroupGroupsSources = ExternalSourceGroupGroupsSources;
340
343
  */
341
344
  class ElementDrivesElement extends Relationship {
342
345
  static get className() { return "ElementDrivesElement"; }
346
+ /** Relationship status
347
+ * * 0 indicates no errors. Set after a successful evaluation.
348
+ * * 1 indicates that this driving relationship could not be evaluated. The callback itself can set this to indicate that it failed to process the input changes. Also, it is set if the relationship is part of a circular dependency.
349
+ * * 0x80 The app or callback can set this to indicate to not propagate changes through this relationship.
350
+ */
351
+ status;
352
+ /** Affects the order in which relationships are processed in the case where two relationships have the same output. */
353
+ priority;
343
354
  constructor(props, iModel) {
344
355
  super(props, iModel);
345
356
  this.status = props.status;
@@ -381,6 +392,7 @@ exports.ModelSelectorRefersToModels = ModelSelectorRefersToModels;
381
392
  * @public
382
393
  */
383
394
  class Relationships {
395
+ _iModel;
384
396
  /** @internal */
385
397
  constructor(iModel) { this._iModel = iModel; }
386
398
  /** Create a new instance of a Relationship.