@itwin/core-backend 3.4.0-dev.8 → 3.5.0-dev.4

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 (261) hide show
  1. package/CHANGELOG.md +41 -1
  2. package/lib/cjs/AliCloudStorageService.d.ts +23 -17
  3. package/lib/cjs/AliCloudStorageService.d.ts.map +1 -1
  4. package/lib/cjs/AliCloudStorageService.js +71 -68
  5. package/lib/cjs/AliCloudStorageService.js.map +1 -1
  6. package/lib/cjs/BackendHubAccess.d.ts +224 -224
  7. package/lib/cjs/BackendHubAccess.d.ts.map +1 -1
  8. package/lib/cjs/BackendHubAccess.js +41 -41
  9. package/lib/cjs/BackendHubAccess.js.map +1 -1
  10. package/lib/cjs/BackendLoggerCategory.d.ts +91 -87
  11. package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -1
  12. package/lib/cjs/BackendLoggerCategory.js +99 -95
  13. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  14. package/lib/cjs/BisCoreSchema.d.ts +21 -21
  15. package/lib/cjs/BisCoreSchema.js +60 -60
  16. package/lib/cjs/BisCoreSchema.js.map +1 -1
  17. package/lib/cjs/BriefcaseManager.d.ts +165 -165
  18. package/lib/cjs/BriefcaseManager.js +405 -405
  19. package/lib/cjs/BriefcaseManager.js.map +1 -1
  20. package/lib/cjs/Category.d.ts +153 -153
  21. package/lib/cjs/Category.js +243 -243
  22. package/lib/cjs/Category.js.map +1 -1
  23. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  24. package/lib/cjs/ChangeSummaryManager.js +445 -445
  25. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  26. package/lib/cjs/ChangedElementsDb.d.ts +99 -98
  27. package/lib/cjs/ChangedElementsDb.d.ts.map +1 -1
  28. package/lib/cjs/ChangedElementsDb.js +165 -165
  29. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  30. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  31. package/lib/cjs/ChangedElementsManager.js +88 -88
  32. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  33. package/lib/cjs/CheckpointManager.d.ts +120 -122
  34. package/lib/cjs/CheckpointManager.d.ts.map +1 -1
  35. package/lib/cjs/CheckpointManager.js +343 -354
  36. package/lib/cjs/CheckpointManager.js.map +1 -1
  37. package/lib/cjs/ClassRegistry.d.ts +71 -71
  38. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  39. package/lib/cjs/ClassRegistry.js +215 -213
  40. package/lib/cjs/ClassRegistry.js.map +1 -1
  41. package/lib/cjs/CloudSqlite.d.ts +350 -0
  42. package/lib/cjs/CloudSqlite.d.ts.map +1 -0
  43. package/lib/cjs/CloudSqlite.js +152 -0
  44. package/lib/cjs/CloudSqlite.js.map +1 -0
  45. package/lib/cjs/CloudStorageBackend.d.ts +58 -46
  46. package/lib/cjs/CloudStorageBackend.d.ts.map +1 -1
  47. package/lib/cjs/CloudStorageBackend.js +173 -164
  48. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  49. package/lib/cjs/CodeService.d.ts +397 -0
  50. package/lib/cjs/CodeService.d.ts.map +1 -0
  51. package/lib/cjs/CodeService.js +64 -0
  52. package/lib/cjs/CodeService.js.map +1 -0
  53. package/lib/cjs/CodeSpecs.d.ts +50 -50
  54. package/lib/cjs/CodeSpecs.js +112 -112
  55. package/lib/cjs/CodeSpecs.js.map +1 -1
  56. package/lib/cjs/ConcurrentQuery.d.ts +11 -11
  57. package/lib/cjs/ConcurrentQuery.js +30 -30
  58. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  59. package/lib/cjs/CustomViewState3dCreator.d.ts +32 -32
  60. package/lib/cjs/CustomViewState3dCreator.d.ts.map +1 -1
  61. package/lib/cjs/CustomViewState3dCreator.js +113 -98
  62. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  63. package/lib/cjs/DevTools.d.ts +71 -71
  64. package/lib/cjs/DevTools.d.ts.map +1 -1
  65. package/lib/cjs/DevTools.js +154 -154
  66. package/lib/cjs/DevTools.js.map +1 -1
  67. package/lib/cjs/DisplayStyle.d.ts +106 -106
  68. package/lib/cjs/DisplayStyle.js +256 -256
  69. package/lib/cjs/DisplayStyle.js.map +1 -1
  70. package/lib/cjs/ECDb.d.ts +191 -191
  71. package/lib/cjs/ECDb.js +350 -350
  72. package/lib/cjs/ECDb.js.map +1 -1
  73. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  74. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  75. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  76. package/lib/cjs/ECSqlStatement.d.ts +466 -466
  77. package/lib/cjs/ECSqlStatement.js +791 -791
  78. package/lib/cjs/ECSqlStatement.js.map +1 -1
  79. package/lib/cjs/Element.d.ts +1109 -1109
  80. package/lib/cjs/Element.d.ts.map +1 -1
  81. package/lib/cjs/Element.js +1420 -1417
  82. package/lib/cjs/Element.js.map +1 -1
  83. package/lib/cjs/ElementAspect.d.ts +156 -156
  84. package/lib/cjs/ElementAspect.js +178 -178
  85. package/lib/cjs/ElementAspect.js.map +1 -1
  86. package/lib/cjs/ElementGraphics.d.ts +9 -9
  87. package/lib/cjs/ElementGraphics.js +41 -41
  88. package/lib/cjs/ElementGraphics.js.map +1 -1
  89. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  90. package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
  91. package/lib/cjs/ElementTreeWalker.js +409 -409
  92. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  93. package/lib/cjs/Entity.d.ts +76 -76
  94. package/lib/cjs/Entity.js +82 -82
  95. package/lib/cjs/Entity.js.map +1 -1
  96. package/lib/cjs/ExportGraphics.d.ts +317 -317
  97. package/lib/cjs/ExportGraphics.d.ts.map +1 -1
  98. package/lib/cjs/ExportGraphics.js +208 -208
  99. package/lib/cjs/ExportGraphics.js.map +1 -1
  100. package/lib/cjs/ExternalSource.d.ts +94 -94
  101. package/lib/cjs/ExternalSource.d.ts.map +1 -1
  102. package/lib/cjs/ExternalSource.js +125 -125
  103. package/lib/cjs/ExternalSource.js.map +1 -1
  104. package/lib/cjs/GeoCoordConfig.d.ts +19 -13
  105. package/lib/cjs/GeoCoordConfig.d.ts.map +1 -1
  106. package/lib/cjs/GeoCoordConfig.js +82 -73
  107. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  108. package/lib/cjs/GeometrySummary.d.ts +4 -4
  109. package/lib/cjs/GeometrySummary.js +380 -380
  110. package/lib/cjs/GeometrySummary.js.map +1 -1
  111. package/lib/cjs/HubMock.d.ts +93 -93
  112. package/lib/cjs/HubMock.d.ts.map +1 -1
  113. package/lib/cjs/HubMock.js +190 -190
  114. package/lib/cjs/HubMock.js.map +1 -1
  115. package/lib/cjs/IModelCloneContext.d.ts +85 -85
  116. package/lib/cjs/IModelCloneContext.js +150 -150
  117. package/lib/cjs/IModelCloneContext.js.map +1 -1
  118. package/lib/cjs/IModelDb.d.ts +1164 -1151
  119. package/lib/cjs/IModelDb.d.ts.map +1 -1
  120. package/lib/cjs/IModelDb.js +2324 -2286
  121. package/lib/cjs/IModelDb.js.map +1 -1
  122. package/lib/cjs/IModelHost.d.ts +361 -347
  123. package/lib/cjs/IModelHost.d.ts.map +1 -1
  124. package/lib/cjs/IModelHost.js +489 -455
  125. package/lib/cjs/IModelHost.js.map +1 -1
  126. package/lib/cjs/IModelJsFs.d.ts +62 -62
  127. package/lib/cjs/IModelJsFs.d.ts.map +1 -1
  128. package/lib/cjs/IModelJsFs.js +140 -140
  129. package/lib/cjs/IModelJsFs.js.map +1 -1
  130. package/lib/cjs/IpcHost.d.ts +98 -98
  131. package/lib/cjs/IpcHost.js +234 -234
  132. package/lib/cjs/IpcHost.js.map +1 -1
  133. package/lib/cjs/LineStyle.d.ts +311 -311
  134. package/lib/cjs/LineStyle.js +295 -295
  135. package/lib/cjs/LineStyle.js.map +1 -1
  136. package/lib/cjs/LocalHub.d.ts +162 -162
  137. package/lib/cjs/LocalHub.js +587 -587
  138. package/lib/cjs/LocalHub.js.map +1 -1
  139. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  140. package/lib/cjs/LocalhostIpcHost.js +81 -81
  141. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  142. package/lib/cjs/Material.d.ts +103 -101
  143. package/lib/cjs/Material.d.ts.map +1 -1
  144. package/lib/cjs/Material.js +147 -145
  145. package/lib/cjs/Material.js.map +1 -1
  146. package/lib/cjs/Model.d.ts +386 -386
  147. package/lib/cjs/Model.d.ts.map +1 -1
  148. package/lib/cjs/Model.js +471 -468
  149. package/lib/cjs/Model.js.map +1 -1
  150. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  151. package/lib/cjs/NativeAppStorage.js +202 -202
  152. package/lib/cjs/NativeAppStorage.js.map +1 -1
  153. package/lib/cjs/NativeHost.d.ts +52 -52
  154. package/lib/cjs/NativeHost.js +168 -168
  155. package/lib/cjs/NativeHost.js.map +1 -1
  156. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  157. package/lib/cjs/NavigationRelationship.js +225 -225
  158. package/lib/cjs/NavigationRelationship.js.map +1 -1
  159. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  160. package/lib/cjs/PromiseMemoizer.d.ts.map +1 -1
  161. package/lib/cjs/PromiseMemoizer.js +101 -95
  162. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  163. package/lib/cjs/PropertyStore.d.ts +133 -0
  164. package/lib/cjs/PropertyStore.d.ts.map +1 -0
  165. package/lib/cjs/PropertyStore.js +12 -0
  166. package/lib/cjs/PropertyStore.js.map +1 -0
  167. package/lib/cjs/Relationship.d.ts +400 -400
  168. package/lib/cjs/Relationship.js +465 -465
  169. package/lib/cjs/Relationship.js.map +1 -1
  170. package/lib/cjs/RpcBackend.d.ts +28 -28
  171. package/lib/cjs/RpcBackend.js +126 -126
  172. package/lib/cjs/RpcBackend.js.map +1 -1
  173. package/lib/cjs/SQLiteDb.d.ts +219 -173
  174. package/lib/cjs/SQLiteDb.d.ts.map +1 -1
  175. package/lib/cjs/SQLiteDb.js +214 -211
  176. package/lib/cjs/SQLiteDb.js.map +1 -1
  177. package/lib/cjs/Schema.d.ts +55 -55
  178. package/lib/cjs/Schema.js +83 -83
  179. package/lib/cjs/Schema.js.map +1 -1
  180. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  181. package/lib/cjs/ServerBasedLocks.js +168 -168
  182. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  183. package/lib/cjs/SqliteStatement.d.ts +283 -271
  184. package/lib/cjs/SqliteStatement.d.ts.map +1 -1
  185. package/lib/cjs/SqliteStatement.js +448 -426
  186. package/lib/cjs/SqliteStatement.js.map +1 -1
  187. package/lib/cjs/Texture.d.ts +58 -58
  188. package/lib/cjs/Texture.js +82 -82
  189. package/lib/cjs/Texture.js.map +1 -1
  190. package/lib/cjs/TileStorage.d.ts +19 -0
  191. package/lib/cjs/TileStorage.d.ts.map +1 -0
  192. package/lib/cjs/TileStorage.js +91 -0
  193. package/lib/cjs/TileStorage.js.map +1 -0
  194. package/lib/cjs/TxnManager.d.ts +202 -202
  195. package/lib/cjs/TxnManager.d.ts.map +1 -1
  196. package/lib/cjs/TxnManager.js +356 -353
  197. package/lib/cjs/TxnManager.js.map +1 -1
  198. package/lib/cjs/ViewDefinition.d.ts +435 -435
  199. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  200. package/lib/cjs/ViewDefinition.js +635 -629
  201. package/lib/cjs/ViewDefinition.js.map +1 -1
  202. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  203. package/lib/cjs/ViewStateHydrator.js +103 -103
  204. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  205. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  206. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
  207. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -21
  208. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  209. package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
  210. package/lib/cjs/core-backend.d.ts +182 -175
  211. package/lib/cjs/core-backend.d.ts.map +1 -1
  212. package/lib/cjs/core-backend.js +202 -195
  213. package/lib/cjs/core-backend.js.map +1 -1
  214. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  215. package/lib/cjs/domains/FunctionalElements.js +145 -145
  216. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  217. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  218. package/lib/cjs/domains/FunctionalSchema.js +40 -40
  219. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  220. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  221. package/lib/cjs/domains/GenericElements.js +263 -263
  222. package/lib/cjs/domains/GenericElements.js.map +1 -1
  223. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  224. package/lib/cjs/domains/GenericSchema.js +28 -28
  225. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  226. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  227. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  228. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  229. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +45 -45
  230. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +262 -262
  231. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  232. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -20
  233. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -1
  234. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +204 -195
  235. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  236. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  237. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
  238. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +168 -165
  239. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  240. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  241. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +43 -43
  242. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  243. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  244. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  245. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  246. package/lib/cjs/workspace/Settings.d.ts +186 -186
  247. package/lib/cjs/workspace/Settings.d.ts.map +1 -1
  248. package/lib/cjs/workspace/Settings.js +155 -152
  249. package/lib/cjs/workspace/Settings.js.map +1 -1
  250. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  251. package/lib/cjs/workspace/SettingsSchemas.js +191 -191
  252. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  253. package/lib/cjs/workspace/Workspace.d.ts +414 -401
  254. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  255. package/lib/cjs/workspace/Workspace.js +543 -534
  256. package/lib/cjs/workspace/Workspace.js.map +1 -1
  257. package/package.json +19 -20
  258. package/lib/cjs/IModelSchemaLoader.d.ts +0 -26
  259. package/lib/cjs/IModelSchemaLoader.d.ts.map +0 -1
  260. package/lib/cjs/IModelSchemaLoader.js +0 -122
  261. package/lib/cjs/IModelSchemaLoader.js.map +0 -1
@@ -1,225 +1,225 @@
1
- /** @packageDocumentation
2
- * @module HubAccess
3
- */
4
- import { AccessToken, GuidString, Id64String } from "@itwin/core-bentley";
5
- import { BriefcaseId, ChangesetFileProps, ChangesetIdWithIndex, ChangesetIndex, ChangesetIndexAndId, ChangesetIndexOrId, ChangesetProps, ChangesetRange, IModelError, IModelVersion, LocalDirName, LocalFileName } from "@itwin/core-common";
6
- import { CheckpointProps, DownloadRequest, ProgressFunction } from "./CheckpointManager";
7
- import { TokenArg } from "./IModelDb";
8
- /** The state of a lock.
9
- * @public
10
- */
11
- export declare enum LockState {
12
- /** The element is not locked */
13
- None = 0,
14
- /** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */
15
- Shared = 1,
16
- /** A Lock that permits modifications to an element and blocks other users from making modifications to it.
17
- * Holding an exclusive lock on an "owner" (a model or a parent element), implicitly exclusively locks all its members.
18
- */
19
- Exclusive = 2
20
- }
21
- /** Exception thrown if lock cannot be acquired.
22
- * @beta
23
- */
24
- export declare class LockConflict extends IModelError {
25
- /** Id of Briefcase holding lock */
26
- readonly briefcaseId: BriefcaseId;
27
- /** Alias of Briefcase holding lock */
28
- readonly briefcaseAlias: string;
29
- constructor(
30
- /** Id of Briefcase holding lock */
31
- briefcaseId: BriefcaseId,
32
- /** Alias of Briefcase holding lock */
33
- briefcaseAlias: string, msg: "shared lock is held" | "exclusive lock is already held");
34
- }
35
- /**
36
- * The properties to access a V2 checkpoint through a daemon.
37
- * @internal
38
- */
39
- export interface V2CheckpointAccessProps {
40
- /** blob store account name. */
41
- readonly accountName: string;
42
- /** AccessToken that grants access to the container. */
43
- readonly sasToken: AccessToken;
44
- /** The name of the iModel's blob store container holding all checkpoints. */
45
- readonly containerId: string;
46
- /** The name of the virtual file within the container, used for the checkpoint */
47
- readonly dbName: string;
48
- /** blob storage module: e.g. "azure", "google", "aws". May also include URI style parameters. */
49
- readonly storageType: string;
50
- }
51
- /** @internal */
52
- export declare type LockMap = Map<Id64String, LockState>;
53
- /**
54
- * The properties of a lock that may be obtained from a lock server.
55
- * @beta
56
- */
57
- export interface LockProps {
58
- /** The elementId for the lock */
59
- readonly id: Id64String;
60
- /** the lock state */
61
- readonly state: LockState;
62
- }
63
- /**
64
- * Argument for cancelling and tracking download progress.
65
- * @beta
66
- */
67
- export interface DownloadProgressArg {
68
- /** Called to show progress during a download. If this function returns non-zero, the download is aborted. */
69
- progressCallback?: ProgressFunction;
70
- }
71
- /**
72
- * Argument for methods that must supply an iTwinId
73
- * @public
74
- */
75
- export interface ITwinIdArg {
76
- readonly iTwinId: GuidString;
77
- }
78
- /**
79
- * Argument for methods that must supply an IModelId
80
- * @public
81
- */
82
- export interface IModelIdArg extends TokenArg {
83
- readonly iModelId: GuidString;
84
- }
85
- /**
86
- * Argument for acquiring a new BriefcaseId
87
- * @public
88
- */
89
- export interface AcquireNewBriefcaseIdArg extends IModelIdArg {
90
- /** A string to be reported to other users to identify this briefcase, for example in the case of conflicts or lock collisions. */
91
- readonly briefcaseAlias?: string;
92
- }
93
- /** Argument for methods that must supply an IModel name and iTwinId
94
- * @public
95
- */
96
- export interface IModelNameArg extends TokenArg, ITwinIdArg {
97
- readonly iModelName: string;
98
- }
99
- /** Argument for methods that must supply an IModelId and a BriefcaseId
100
- * @public
101
- */
102
- export interface BriefcaseIdArg extends IModelIdArg {
103
- readonly briefcaseId: BriefcaseId;
104
- }
105
- /** Argument for methods that must supply a briefcaseId and a changeset
106
- * @public
107
- */
108
- export interface BriefcaseDbArg extends BriefcaseIdArg {
109
- readonly changeset: ChangesetIdWithIndex;
110
- }
111
- /** Argument for methods that must supply an IModelId and a changeset
112
- * @public
113
- */
114
- export interface ChangesetArg extends IModelIdArg {
115
- readonly changeset: ChangesetIndexOrId;
116
- }
117
- /** Argument for downloading a changeset.
118
- * @beta
119
- */
120
- export interface DownloadChangesetArg extends ChangesetArg, DownloadProgressArg {
121
- /** Directory where the changeset should be downloaded. */
122
- targetDir: LocalDirName;
123
- }
124
- /** @internal */
125
- export interface ChangesetIndexArg extends IModelIdArg {
126
- readonly changeset: ChangesetIdWithIndex;
127
- }
128
- /** Argument for methods that must supply an IModelId and a range of Changesets.
129
- * @public
130
- */
131
- export interface ChangesetRangeArg extends IModelIdArg {
132
- /** the range of changesets desired. If is undefined, *all* changesets are returned. */
133
- readonly range?: ChangesetRange;
134
- }
135
- /** Argument for downloading a changeset range.
136
- * @beta
137
- */
138
- export interface DownloadChangesetRangeArg extends ChangesetRangeArg, DownloadProgressArg {
139
- /** Directory where the changesets should be downloaded. */
140
- targetDir: LocalDirName;
141
- }
142
- /**
143
- * @deprecated
144
- * @internal
145
- */
146
- export declare type CheckpointArg = DownloadRequest;
147
- /**
148
- * Arguments to create a new iModel in iModelHub
149
- * @public
150
- */
151
- export interface CreateNewIModelProps extends IModelNameArg {
152
- readonly description?: string;
153
- readonly version0?: LocalFileName;
154
- readonly noLocks?: true;
155
- }
156
- /**
157
- * Methods for accessing services of IModelHub from an iTwin.js backend.
158
- * Generally direct access to these methods should not be required, since higher-level apis are provided.
159
- * @beta
160
- */
161
- export interface BackendHubAccess {
162
- /** Download all the changesets in the specified range. */
163
- downloadChangesets: (arg: DownloadChangesetRangeArg) => Promise<ChangesetFileProps[]>;
164
- /** Download a single changeset. */
165
- downloadChangeset: (arg: DownloadChangesetArg) => Promise<ChangesetFileProps>;
166
- /** Query the changeset properties given a ChangesetIndex */
167
- queryChangeset: (arg: ChangesetArg) => Promise<ChangesetProps>;
168
- /** Query an array of changeset properties given a range of ChangesetIndexes */
169
- queryChangesets: (arg: ChangesetRangeArg) => Promise<ChangesetProps[]>;
170
- /** Push a changeset to iModelHub. Returns the newly pushed changeset's index */
171
- pushChangeset: (arg: IModelIdArg & {
172
- changesetProps: ChangesetFileProps;
173
- }) => Promise<ChangesetIndex>;
174
- /** Get the ChangesetProps of the most recent changeset */
175
- getLatestChangeset: (arg: IModelIdArg) => Promise<ChangesetProps>;
176
- /** Get the ChangesetProps for an IModelVersion */
177
- getChangesetFromVersion: (arg: IModelIdArg & {
178
- version: IModelVersion;
179
- }) => Promise<ChangesetProps>;
180
- /** Get the ChangesetProps for a named version */
181
- getChangesetFromNamedVersion: (arg: IModelIdArg & {
182
- versionName: string;
183
- }) => Promise<ChangesetProps>;
184
- /** Acquire a new briefcaseId for the supplied iModelId
185
- * @note usually there should only be one briefcase per iModel per user.
186
- */
187
- acquireNewBriefcaseId: (arg: AcquireNewBriefcaseIdArg) => Promise<BriefcaseId>;
188
- /** Release a briefcaseId. After this call it is illegal to generate changesets for the released briefcaseId. */
189
- releaseBriefcase: (arg: BriefcaseIdArg) => Promise<void>;
190
- /** get an array of the briefcases assigned to a user. */
191
- getMyBriefcaseIds: (arg: IModelIdArg) => Promise<BriefcaseId[]>;
192
- /**
193
- * download a v1 checkpoint
194
- * @deprecated
195
- * @internal
196
- */
197
- downloadV1Checkpoint: (arg: CheckpointArg) => Promise<ChangesetIndexAndId>;
198
- /**
199
- * Get the access props for a V2 checkpoint. Returns undefined if no V2 checkpoint exists.
200
- * @internal
201
- */
202
- queryV2Checkpoint: (arg: CheckpointProps) => Promise<V2CheckpointAccessProps | undefined>;
203
- /**
204
- * acquire one or more locks. Throws if unsuccessful. If *any* lock cannot be obtained, no locks are acquired
205
- * @internal
206
- */
207
- acquireLocks: (arg: BriefcaseDbArg, locks: LockMap) => Promise<void>;
208
- /**
209
- * Get the list of all held locks for a briefcase. This can be very expensive and is currently used only for tests.
210
- * @internal
211
- */
212
- queryAllLocks: (arg: BriefcaseDbArg) => Promise<LockProps[]>;
213
- /**
214
- * Release all currently held locks
215
- * @internal
216
- */
217
- releaseAllLocks: (arg: BriefcaseDbArg) => Promise<void>;
218
- /** Get the iModelId of an iModel by name. Undefined if no iModel with that name exists. */
219
- queryIModelByName: (arg: IModelNameArg) => Promise<GuidString | undefined>;
220
- /** create a new iModel. Returns the Guid of the newly created iModel */
221
- createNewIModel: (arg: CreateNewIModelProps) => Promise<GuidString>;
222
- /** delete an iModel */
223
- deleteIModel: (arg: IModelIdArg & ITwinIdArg) => Promise<void>;
224
- }
1
+ /** @packageDocumentation
2
+ * @module HubAccess
3
+ */
4
+ import { AccessToken, GuidString, Id64String } from "@itwin/core-bentley";
5
+ import { BriefcaseId, ChangesetFileProps, ChangesetIdWithIndex, ChangesetIndex, ChangesetIndexAndId, ChangesetIndexOrId, ChangesetProps, ChangesetRange, IModelError, IModelVersion, LocalDirName, LocalFileName } from "@itwin/core-common";
6
+ import { CheckpointProps, DownloadRequest, ProgressFunction } from "./CheckpointManager";
7
+ import { TokenArg } from "./IModelDb";
8
+ /** The state of a lock.
9
+ * @public
10
+ */
11
+ export declare enum LockState {
12
+ /** The element is not locked */
13
+ None = 0,
14
+ /** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */
15
+ Shared = 1,
16
+ /** A Lock that permits modifications to an element and blocks other users from making modifications to it.
17
+ * Holding an exclusive lock on an "owner" (a model or a parent element), implicitly exclusively locks all its members.
18
+ */
19
+ Exclusive = 2
20
+ }
21
+ /** Exception thrown if lock cannot be acquired.
22
+ * @beta
23
+ */
24
+ export declare class LockConflict extends IModelError {
25
+ /** Id of Briefcase holding lock */
26
+ readonly briefcaseId: BriefcaseId;
27
+ /** Alias of Briefcase holding lock */
28
+ readonly briefcaseAlias: string;
29
+ constructor(
30
+ /** Id of Briefcase holding lock */
31
+ briefcaseId: BriefcaseId,
32
+ /** Alias of Briefcase holding lock */
33
+ briefcaseAlias: string, msg: "shared lock is held" | "exclusive lock is already held");
34
+ }
35
+ /**
36
+ * The properties to access a V2 checkpoint through a daemon.
37
+ * @internal
38
+ */
39
+ export interface V2CheckpointAccessProps {
40
+ /** blob store account name. */
41
+ readonly accountName: string;
42
+ /** AccessToken that grants access to the container. */
43
+ readonly sasToken: AccessToken;
44
+ /** The name of the iModel's blob store container holding all checkpoints. */
45
+ readonly containerId: string;
46
+ /** The name of the virtual file within the container, used for the checkpoint */
47
+ readonly dbName: string;
48
+ /** blob storage module: e.g. "azure", "google", "aws". May also include URI style parameters. */
49
+ readonly storageType: string;
50
+ }
51
+ /** @internal */
52
+ export declare type LockMap = Map<Id64String, LockState>;
53
+ /**
54
+ * The properties of a lock that may be obtained from a lock server.
55
+ * @beta
56
+ */
57
+ export interface LockProps {
58
+ /** The elementId for the lock */
59
+ readonly id: Id64String;
60
+ /** the lock state */
61
+ readonly state: LockState;
62
+ }
63
+ /**
64
+ * Argument for cancelling and tracking download progress.
65
+ * @beta
66
+ */
67
+ export interface DownloadProgressArg {
68
+ /** Called to show progress during a download. If this function returns non-zero, the download is aborted. */
69
+ progressCallback?: ProgressFunction;
70
+ }
71
+ /**
72
+ * Argument for methods that must supply an iTwinId
73
+ * @public
74
+ */
75
+ export interface ITwinIdArg {
76
+ readonly iTwinId: GuidString;
77
+ }
78
+ /**
79
+ * Argument for methods that must supply an IModelId
80
+ * @public
81
+ */
82
+ export interface IModelIdArg extends TokenArg {
83
+ readonly iModelId: GuidString;
84
+ }
85
+ /**
86
+ * Argument for acquiring a new BriefcaseId
87
+ * @public
88
+ */
89
+ export interface AcquireNewBriefcaseIdArg extends IModelIdArg {
90
+ /** A string to be reported to other users to identify this briefcase, for example in the case of conflicts or lock collisions. */
91
+ readonly briefcaseAlias?: string;
92
+ }
93
+ /** Argument for methods that must supply an IModel name and iTwinId
94
+ * @public
95
+ */
96
+ export interface IModelNameArg extends TokenArg, ITwinIdArg {
97
+ readonly iModelName: string;
98
+ }
99
+ /** Argument for methods that must supply an IModelId and a BriefcaseId
100
+ * @public
101
+ */
102
+ export interface BriefcaseIdArg extends IModelIdArg {
103
+ readonly briefcaseId: BriefcaseId;
104
+ }
105
+ /** Argument for methods that must supply a briefcaseId and a changeset
106
+ * @public
107
+ */
108
+ export interface BriefcaseDbArg extends BriefcaseIdArg {
109
+ readonly changeset: ChangesetIdWithIndex;
110
+ }
111
+ /** Argument for methods that must supply an IModelId and a changeset
112
+ * @public
113
+ */
114
+ export interface ChangesetArg extends IModelIdArg {
115
+ readonly changeset: ChangesetIndexOrId;
116
+ }
117
+ /** Argument for downloading a changeset.
118
+ * @beta
119
+ */
120
+ export interface DownloadChangesetArg extends ChangesetArg, DownloadProgressArg {
121
+ /** Directory where the changeset should be downloaded. */
122
+ targetDir: LocalDirName;
123
+ }
124
+ /** @internal */
125
+ export interface ChangesetIndexArg extends IModelIdArg {
126
+ readonly changeset: ChangesetIdWithIndex;
127
+ }
128
+ /** Argument for methods that must supply an IModelId and a range of Changesets.
129
+ * @public
130
+ */
131
+ export interface ChangesetRangeArg extends IModelIdArg {
132
+ /** the range of changesets desired. If is undefined, *all* changesets are returned. */
133
+ readonly range?: ChangesetRange;
134
+ }
135
+ /** Argument for downloading a changeset range.
136
+ * @beta
137
+ */
138
+ export interface DownloadChangesetRangeArg extends ChangesetRangeArg, DownloadProgressArg {
139
+ /** Directory where the changesets should be downloaded. */
140
+ targetDir: LocalDirName;
141
+ }
142
+ /**
143
+ * @deprecated
144
+ * @internal
145
+ */
146
+ export declare type CheckpointArg = DownloadRequest;
147
+ /**
148
+ * Arguments to create a new iModel in iModelHub
149
+ * @public
150
+ */
151
+ export interface CreateNewIModelProps extends IModelNameArg {
152
+ readonly description?: string;
153
+ readonly version0?: LocalFileName;
154
+ readonly noLocks?: true;
155
+ }
156
+ /**
157
+ * Methods for accessing services of IModelHub from an iTwin.js backend.
158
+ * Generally direct access to these methods should not be required, since higher-level apis are provided.
159
+ * @beta
160
+ */
161
+ export interface BackendHubAccess {
162
+ /** Download all the changesets in the specified range. */
163
+ downloadChangesets: (arg: DownloadChangesetRangeArg) => Promise<ChangesetFileProps[]>;
164
+ /** Download a single changeset. */
165
+ downloadChangeset: (arg: DownloadChangesetArg) => Promise<ChangesetFileProps>;
166
+ /** Query the changeset properties given a ChangesetIndex */
167
+ queryChangeset: (arg: ChangesetArg) => Promise<ChangesetProps>;
168
+ /** Query an array of changeset properties given a range of ChangesetIndexes */
169
+ queryChangesets: (arg: ChangesetRangeArg) => Promise<ChangesetProps[]>;
170
+ /** Push a changeset to iModelHub. Returns the newly pushed changeset's index */
171
+ pushChangeset: (arg: IModelIdArg & {
172
+ changesetProps: ChangesetFileProps;
173
+ }) => Promise<ChangesetIndex>;
174
+ /** Get the ChangesetProps of the most recent changeset */
175
+ getLatestChangeset: (arg: IModelIdArg) => Promise<ChangesetProps>;
176
+ /** Get the ChangesetProps for an IModelVersion */
177
+ getChangesetFromVersion: (arg: IModelIdArg & {
178
+ version: IModelVersion;
179
+ }) => Promise<ChangesetProps>;
180
+ /** Get the ChangesetProps for a named version */
181
+ getChangesetFromNamedVersion: (arg: IModelIdArg & {
182
+ versionName: string;
183
+ }) => Promise<ChangesetProps>;
184
+ /** Acquire a new briefcaseId for the supplied iModelId
185
+ * @note usually there should only be one briefcase per iModel per user.
186
+ */
187
+ acquireNewBriefcaseId: (arg: AcquireNewBriefcaseIdArg) => Promise<BriefcaseId>;
188
+ /** Release a briefcaseId. After this call it is illegal to generate changesets for the released briefcaseId. */
189
+ releaseBriefcase: (arg: BriefcaseIdArg) => Promise<void>;
190
+ /** get an array of the briefcases assigned to a user. */
191
+ getMyBriefcaseIds: (arg: IModelIdArg) => Promise<BriefcaseId[]>;
192
+ /**
193
+ * download a v1 checkpoint
194
+ * @deprecated
195
+ * @internal
196
+ */
197
+ downloadV1Checkpoint: (arg: CheckpointArg) => Promise<ChangesetIndexAndId>;
198
+ /**
199
+ * Get the access props for a V2 checkpoint. Returns undefined if no V2 checkpoint exists.
200
+ * @internal
201
+ */
202
+ queryV2Checkpoint: (arg: CheckpointProps) => Promise<V2CheckpointAccessProps | undefined>;
203
+ /**
204
+ * acquire one or more locks. Throws if unsuccessful. If *any* lock cannot be obtained, no locks are acquired
205
+ * @internal
206
+ */
207
+ acquireLocks: (arg: BriefcaseDbArg, locks: LockMap) => Promise<void>;
208
+ /**
209
+ * Get the list of all held locks for a briefcase. This can be very expensive and is currently used only for tests.
210
+ * @internal
211
+ */
212
+ queryAllLocks: (arg: BriefcaseDbArg) => Promise<LockProps[]>;
213
+ /**
214
+ * Release all currently held locks
215
+ * @internal
216
+ */
217
+ releaseAllLocks: (arg: BriefcaseDbArg) => Promise<void>;
218
+ /** Get the iModelId of an iModel by name. Undefined if no iModel with that name exists. */
219
+ queryIModelByName: (arg: IModelNameArg) => Promise<GuidString | undefined>;
220
+ /** create a new iModel. Returns the Guid of the newly created iModel */
221
+ createNewIModel: (arg: CreateNewIModelProps) => Promise<GuidString>;
222
+ /** delete an iModel */
223
+ deleteIModel: (arg: IModelIdArg & ITwinIdArg) => Promise<void>;
224
+ }
225
225
  //# sourceMappingURL=BackendHubAccess.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BackendHubAccess.d.ts","sourceRoot":"","sources":["../../src/BackendHubAccess.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAmB,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EACL,WAAW,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,cAAc,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAC3J,aAAa,EAAE,YAAY,EAAE,aAAa,EAC3C,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;GAEG;AACH,oBAAY,SAAS;IACnB,gCAAgC;IAChC,IAAI,IAAI;IACR,mJAAmJ;IACnJ,MAAM,IAAI;IACV;;OAEG;IACH,SAAS,IAAI;CACd;AAED;;EAEE;AACF,qBAAa,YAAa,SAAQ,WAAW;IAEzC,mCAAmC;aACnB,WAAW,EAAE,WAAW;IACxC,sCAAsC;aACtB,cAAc,EAAE,MAAM;;IAHtC,mCAAmC;IACnB,WAAW,EAAE,WAAW;IACxC,sCAAsC;IACtB,cAAc,EAAE,MAAM,EACtC,GAAG,EAAE,qBAAqB,GAAG,gCAAgC;CAIhE;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,+BAA+B;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,6EAA6E;IAC7E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,iFAAiF;IACjF,QAAQ,CAAC,MAAM,EAAE,MA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AE7D;;;OAGG;IACH,eAAe,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAExD,4FAA4F;IAC5F,iBAAiB,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;IAE3E,wEAAwE;IACxE,eAAe,EAAE,CAAC,GAAG,EAAE,oBAAoB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAEpE,uBAAuB;IACvB,YAAY,EAAE,CAAC,GAAG,EAAE,WAAW,GAAG,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChE"}
@@ -1,42 +1,42 @@
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 HubAccess
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.LockConflict = exports.LockState = void 0;
11
- const core_bentley_1 = require("@itwin/core-bentley");
12
- const core_common_1 = require("@itwin/core-common");
13
- /** The state of a lock.
14
- * @public
15
- */
16
- var LockState;
17
- (function (LockState) {
18
- /** The element is not locked */
19
- LockState[LockState["None"] = 0] = "None";
20
- /** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */
21
- LockState[LockState["Shared"] = 1] = "Shared";
22
- /** A Lock that permits modifications to an element and blocks other users from making modifications to it.
23
- * Holding an exclusive lock on an "owner" (a model or a parent element), implicitly exclusively locks all its members.
24
- */
25
- LockState[LockState["Exclusive"] = 2] = "Exclusive";
26
- })(LockState = exports.LockState || (exports.LockState = {}));
27
- /** Exception thrown if lock cannot be acquired.
28
- * @beta
29
- */
30
- class LockConflict extends core_common_1.IModelError {
31
- constructor(
32
- /** Id of Briefcase holding lock */
33
- briefcaseId,
34
- /** Alias of Briefcase holding lock */
35
- briefcaseAlias, msg) {
36
- super(core_bentley_1.IModelHubStatus.LockOwnedByAnotherBriefcase, msg);
37
- this.briefcaseId = briefcaseId;
38
- this.briefcaseAlias = briefcaseAlias;
39
- }
40
- }
41
- exports.LockConflict = LockConflict;
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 HubAccess
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.LockConflict = exports.LockState = void 0;
11
+ const core_bentley_1 = require("@itwin/core-bentley");
12
+ const core_common_1 = require("@itwin/core-common");
13
+ /** The state of a lock.
14
+ * @public
15
+ */
16
+ var LockState;
17
+ (function (LockState) {
18
+ /** The element is not locked */
19
+ LockState[LockState["None"] = 0] = "None";
20
+ /** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */
21
+ LockState[LockState["Shared"] = 1] = "Shared";
22
+ /** A Lock that permits modifications to an element and blocks other users from making modifications to it.
23
+ * Holding an exclusive lock on an "owner" (a model or a parent element), implicitly exclusively locks all its members.
24
+ */
25
+ LockState[LockState["Exclusive"] = 2] = "Exclusive";
26
+ })(LockState = exports.LockState || (exports.LockState = {}));
27
+ /** Exception thrown if lock cannot be acquired.
28
+ * @beta
29
+ */
30
+ class LockConflict extends core_common_1.IModelError {
31
+ constructor(
32
+ /** Id of Briefcase holding lock */
33
+ briefcaseId,
34
+ /** Alias of Briefcase holding lock */
35
+ briefcaseAlias, msg) {
36
+ super(core_bentley_1.IModelHubStatus.LockOwnedByAnotherBriefcase, msg);
37
+ this.briefcaseId = briefcaseId;
38
+ this.briefcaseAlias = briefcaseAlias;
39
+ }
40
+ }
41
+ exports.LockConflict = LockConflict;
42
42
  //# sourceMappingURL=BackendHubAccess.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BackendHubAccess.js","sourceRoot":"","sources":["../../src/BackendHubAccess.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA2F;AAC3F,oDAG4B;AAI5B;;GAEG;AACH,IAAY,SASX;AATD,WAAY,SAAS;IACnB,gCAAgC;IAChC,yCAAQ,CAAA;IACR,mJAAmJ;IACnJ,6CAAU,CAAA;IACV;;OAEG;IACH,mDAAa,CAAA;AACf,CAAC,EATW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QASpB;AAED;;EAEE;AACF,MAAa,YAAa,SAAQ,yBAAW;IAC3C;IACE,mCAAmC;IACnB,WAAwB;IACxC,sCAAsC;IACtB,cAAsB,EACtC,GAA6D;QAE7D,KAAK,CAAC,8BAAe,CAAC,2BAA2B,EAAE,GAAG,CAAC,CAAC;QALxC,gBAAW,GAAX,WAAW,CAAa;QAExB,mBAAc,GAAd,cAAc,CAAQ;IAIxC,CAAC;CACF;AAVD,oCAUC","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 HubAccess\r\n */\r\n\r\nimport { AccessToken, GuidString, Id64String, IModelHubStatus } from \"@itwin/core-bentley\";\r\nimport {\r\n BriefcaseId, ChangesetFileProps, ChangesetIdWithIndex, ChangesetIndex, ChangesetIndexAndId, ChangesetIndexOrId, ChangesetProps, ChangesetRange, IModelError,\r\n IModelVersion, LocalDirName, LocalFileName,\r\n} from \"@itwin/core-common\";\r\nimport { CheckpointProps, DownloadRequest, ProgressFunction } from \"./CheckpointManager\";\r\nimport { TokenArg } from \"./IModelDb\";\r\n\r\n/** The state of a lock.\r\n * @public\r\n */\r\nexport enum LockState {\r\n /** The element is not locked */\r\n None = 0,\r\n /** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */\r\n Shared = 1,\r\n /** A Lock that permits modifications to an element and blocks other users from making modifications to it.\r\n * Holding an exclusive lock on an \"owner\" (a model or a parent element), implicitly exclusively locks all its members.\r\n */\r\n Exclusive = 2,\r\n}\r\n\r\n/** Exception thrown if lock cannot be acquired.\r\n * @beta\r\n*/\r\nexport class LockConflict extends IModelError {\r\n public constructor(\r\n /** Id of Briefcase holding lock */\r\n public readonly briefcaseId: BriefcaseId,\r\n /** Alias of Briefcase holding lock */\r\n public readonly briefcaseAlias: string,\r\n msg: \"shared lock is held\" | \"exclusive lock is already held\"\r\n ) {\r\n super(IModelHubStatus.LockOwnedByAnotherBriefcase, msg);\r\n }\r\n}\r\n\r\n/**\r\n * The properties to access a V2 checkpoint through a daemon.\r\n * @internal\r\n */\r\nexport interface V2CheckpointAccessProps {\r\n /** blob store account name. */\r\n readonly accountName: string;\r\n /** AccessToken that grants access to the container. */\r\n readonly sasToken: AccessToken;\r\n /** The name of the iModel's blob store container holding all checkpoints. */\r\n readonly containerId: string;\r\n /** The name of the virtual file within the container, used for the checkpoint */\r\n readonly dbName: string;\r\n /** blob storage module: e.g. \"azure\", \"google\", \"aws\". May also include URI style parameters. */\r\n readonly storageType: string;\r\n}\r\n\r\n/** @internal */\r\nexport type LockMap = Map<Id64String, LockState>;\r\n\r\n/**\r\n * The properties of a lock that may be obtained from a lock server.\r\n * @beta\r\n */\r\nexport interface LockProps {\r\n /** The elementId for the lock */\r\n readonly id: Id64String;\r\n /** the lock state */\r\n readonly state: LockState;\r\n}\r\n\r\n/**\r\n * Argument for cancelling and tracking download progress.\r\n * @beta\r\n */\r\nexport interface DownloadProgressArg {\r\n /** Called to show progress during a download. If this function returns non-zero, the download is aborted. */\r\n progressCallback?: ProgressFunction;\r\n}\r\n\r\n/**\r\n * Argument for methods that must supply an iTwinId\r\n * @public\r\n */\r\nexport interface ITwinIdArg {\r\n readonly iTwinId: GuidString;\r\n}\r\n\r\n/**\r\n * Argument for methods that must supply an IModelId\r\n * @public\r\n */\r\nexport interface IModelIdArg extends TokenArg {\r\n readonly iModelId: GuidString;\r\n}\r\n\r\n/**\r\n * Argument for acquiring a new BriefcaseId\r\n * @public\r\n */\r\nexport interface AcquireNewBriefcaseIdArg extends IModelIdArg {\r\n /** A string to be reported to other users to identify this briefcase, for example in the case of conflicts or lock collisions. */\r\n readonly briefcaseAlias?: string;\r\n}\r\n\r\n/** Argument for methods that must supply an IModel name and iTwinId\r\n * @public\r\n */\r\nexport interface IModelNameArg extends TokenArg, ITwinIdArg {\r\n readonly iModelName: string;\r\n}\r\n\r\n/** Argument for methods that must supply an IModelId and a BriefcaseId\r\n * @public\r\n */\r\nexport interface BriefcaseIdArg extends IModelIdArg {\r\n readonly briefcaseId: BriefcaseId;\r\n}\r\n\r\n/** Argument for methods that must supply a briefcaseId and a changeset\r\n * @public\r\n */\r\nexport interface BriefcaseDbArg extends BriefcaseIdArg {\r\n readonly changeset: ChangesetIdWithIndex;\r\n}\r\n\r\n/** Argument for methods that must supply an IModelId and a changeset\r\n * @public\r\n */\r\nexport interface ChangesetArg extends IModelIdArg {\r\n readonly changeset: ChangesetIndexOrId;\r\n}\r\n\r\n/** Argument for downloading a changeset.\r\n * @beta\r\n */\r\nexport interface DownloadChangesetArg extends ChangesetArg, DownloadProgressArg {\r\n /** Directory where the changeset should be downloaded. */\r\n targetDir: LocalDirName;\r\n}\r\n\r\n/** @internal */\r\nexport interface ChangesetIndexArg extends IModelIdArg {\r\n readonly changeset: ChangesetIdWithIndex;\r\n}\r\n\r\n/** Argument for methods that must supply an IModelId and a range of Changesets.\r\n * @public\r\n */\r\nexport interface ChangesetRangeArg extends IModelIdArg {\r\n /** the range of changesets desired. If is undefined, *all* changesets are returned. */\r\n readonly range?: ChangesetRange;\r\n}\r\n\r\n/** Argument for downloading a changeset range.\r\n * @beta\r\n */\r\nexport interface DownloadChangesetRangeArg extends ChangesetRangeArg, DownloadProgressArg {\r\n /** Directory where the changesets should be downloaded. */\r\n targetDir: LocalDirName;\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * @internal\r\n */\r\nexport type CheckpointArg = DownloadRequest;\r\n\r\n/**\r\n * Arguments to create a new iModel in iModelHub\r\n * @public\r\n */\r\nexport interface CreateNewIModelProps extends IModelNameArg {\r\n readonly description?: string;\r\n readonly version0?: LocalFileName;\r\n readonly noLocks?: true;\r\n}\r\n\r\n/**\r\n * Methods for accessing services of IModelHub from an iTwin.js backend.\r\n * Generally direct access to these methods should not be required, since higher-level apis are provided.\r\n * @beta\r\n */\r\nexport interface BackendHubAccess {\r\n /** Download all the changesets in the specified range. */\r\n downloadChangesets: (arg: DownloadChangesetRangeArg) => Promise<ChangesetFileProps[]>;\r\n /** Download a single changeset. */\r\n downloadChangeset: (arg: DownloadChangesetArg) => Promise<ChangesetFileProps>;\r\n /** Query the changeset properties given a ChangesetIndex */\r\n queryChangeset: (arg: ChangesetArg) => Promise<ChangesetProps>;\r\n /** Query an array of changeset properties given a range of ChangesetIndexes */\r\n queryChangesets: (arg: ChangesetRangeArg) => Promise<ChangesetProps[]>;\r\n /** Push a changeset to iModelHub. Returns the newly pushed changeset's index */\r\n pushChangeset: (arg: IModelIdArg & { changesetProps: ChangesetFileProps }) => Promise<ChangesetIndex>;\r\n /** Get the ChangesetProps of the most recent changeset */\r\n getLatestChangeset: (arg: IModelIdArg) => Promise<ChangesetProps>;\r\n /** Get the ChangesetProps for an IModelVersion */\r\n getChangesetFromVersion: (arg: IModelIdArg & { version: IModelVersion }) => Promise<ChangesetProps>;\r\n /** Get the ChangesetProps for a named version */\r\n getChangesetFromNamedVersion: (arg: IModelIdArg & { versionName: string }) => Promise<ChangesetProps>;\r\n\r\n /** Acquire a new briefcaseId for the supplied iModelId\r\n * @note usually there should only be one briefcase per iModel per user.\r\n */\r\n acquireNewBriefcaseId: (arg: AcquireNewBriefcaseIdArg) => Promise<BriefcaseId>;\r\n /** Release a briefcaseId. After this call it is illegal to generate changesets for the released briefcaseId. */\r\n releaseBriefcase: (arg: BriefcaseIdArg) => Promise<void>;\r\n\r\n /** get an array of the briefcases assigned to a user. */\r\n getMyBriefcaseIds: (arg: IModelIdArg) => Promise<BriefcaseId[]>;\r\n\r\n /**\r\n * download a v1 checkpoint\r\n * @deprecated\r\n * @internal\r\n */\r\n downloadV1Checkpoint: (arg: CheckpointArg) => Promise<ChangesetIndexAndId>; // eslint-disable-line deprecation/deprecation\r\n\r\n /**\r\n * Get the access props for a V2 checkpoint. Returns undefined if no V2 checkpoint exists.\r\n * @internal\r\n */\r\n queryV2Checkpoint: (arg: CheckpointProps) => Promise<V2CheckpointAccessProps | undefined>;\r\n\r\n /**\r\n * acquire one or more locks. Throws if unsuccessful. If *any* lock cannot be obtained, no locks are acquired\r\n * @internal\r\n */\r\n acquireLocks: (arg: BriefcaseDbArg, locks: LockMap) => Promise<void>;\r\n\r\n /**\r\n * Get the list of all held locks for a briefcase. This can be very expensive and is currently used only for tests.\r\n * @internal\r\n */\r\n queryAllLocks: (arg: BriefcaseDbArg) => Promise<LockProps[]>;\r\n\r\n /**\r\n * Release all currently held locks\r\n * @internal\r\n */\r\n releaseAllLocks: (arg: BriefcaseDbArg) => Promise<void>;\r\n\r\n /** Get the iModelId of an iModel by name. Undefined if no iModel with that name exists. */\r\n queryIModelByName: (arg: IModelNameArg) => Promise<GuidString | undefined>;\r\n\r\n /** create a new iModel. Returns the Guid of the newly created iModel */\r\n createNewIModel: (arg: CreateNewIModelProps) => Promise<GuidString>;\r\n\r\n /** delete an iModel */\r\n deleteIModel: (arg: IModelIdArg & ITwinIdArg) => Promise<void>;\r\n}\r\n"]}
1
+ {"version":3,"file":"BackendHubAccess.js","sourceRoot":"","sources":["../../src/BackendHubAccess.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA2F;AAC3F,oDAG4B;AAI5B;;GAEG;AACH,IAAY,SASX;AATD,WAAY,SAAS;IACnB,gCAAgC;IAChC,yCAAQ,CAAA;IACR,mJAAmJ;IACnJ,6CAAU,CAAA;IACV;;OAEG;IACH,mDAAa,CAAA;AACf,CAAC,EATW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QASpB;AAED;;EAEE;AACF,MAAa,YAAa,SAAQ,yBAAW;IAC3C;IACE,mCAAmC;IACnB,WAAwB;IACxC,sCAAsC;IACtB,cAAsB,EACtC,GAA6D;QAE7D,KAAK,CAAC,8BAAe,CAAC,2BAA2B,EAAE,GAAG,CAAC,CAAC;QALxC,gBAAW,GAAX,WAAW,CAAa;QAExB,mBAAc,GAAd,cAAc,CAAQ;IAIxC,CAAC;CACF;AAVD,oCAUC","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 HubAccess\n */\n\nimport { AccessToken, GuidString, Id64String, IModelHubStatus } from \"@itwin/core-bentley\";\nimport {\n BriefcaseId, ChangesetFileProps, ChangesetIdWithIndex, ChangesetIndex, ChangesetIndexAndId, ChangesetIndexOrId, ChangesetProps, ChangesetRange,\n IModelError, IModelVersion, LocalDirName, LocalFileName,\n} from \"@itwin/core-common\";\nimport { CheckpointProps, DownloadRequest, ProgressFunction } from \"./CheckpointManager\";\nimport { TokenArg } from \"./IModelDb\";\n\n/** The state of a lock.\n * @public\n */\nexport enum LockState {\n /** The element is not locked */\n None = 0,\n /** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */\n Shared = 1,\n /** A Lock that permits modifications to an element and blocks other users from making modifications to it.\n * Holding an exclusive lock on an \"owner\" (a model or a parent element), implicitly exclusively locks all its members.\n */\n Exclusive = 2,\n}\n\n/** Exception thrown if lock cannot be acquired.\n * @beta\n*/\nexport class LockConflict extends IModelError {\n public constructor(\n /** Id of Briefcase holding lock */\n public readonly briefcaseId: BriefcaseId,\n /** Alias of Briefcase holding lock */\n public readonly briefcaseAlias: string,\n msg: \"shared lock is held\" | \"exclusive lock is already held\"\n ) {\n super(IModelHubStatus.LockOwnedByAnotherBriefcase, msg);\n }\n}\n\n/**\n * The properties to access a V2 checkpoint through a daemon.\n * @internal\n */\nexport interface V2CheckpointAccessProps {\n /** blob store account name. */\n readonly accountName: string;\n /** AccessToken that grants access to the container. */\n readonly sasToken: AccessToken;\n /** The name of the iModel's blob store container holding all checkpoints. */\n readonly containerId: string;\n /** The name of the virtual file within the container, used for the checkpoint */\n readonly dbName: string;\n /** blob storage module: e.g. \"azure\", \"google\", \"aws\". May also include URI style parameters. */\n readonly storageType: string;\n}\n\n/** @internal */\nexport type LockMap = Map<Id64String, LockState>;\n\n/**\n * The properties of a lock that may be obtained from a lock server.\n * @beta\n */\nexport interface LockProps {\n /** The elementId for the lock */\n readonly id: Id64String;\n /** the lock state */\n readonly state: LockState;\n}\n\n/**\n * Argument for cancelling and tracking download progress.\n * @beta\n */\nexport interface DownloadProgressArg {\n /** Called to show progress during a download. If this function returns non-zero, the download is aborted. */\n progressCallback?: ProgressFunction;\n}\n\n/**\n * Argument for methods that must supply an iTwinId\n * @public\n */\nexport interface ITwinIdArg {\n readonly iTwinId: GuidString;\n}\n\n/**\n * Argument for methods that must supply an IModelId\n * @public\n */\nexport interface IModelIdArg extends TokenArg {\n readonly iModelId: GuidString;\n}\n\n/**\n * Argument for acquiring a new BriefcaseId\n * @public\n */\nexport interface AcquireNewBriefcaseIdArg extends IModelIdArg {\n /** A string to be reported to other users to identify this briefcase, for example in the case of conflicts or lock collisions. */\n readonly briefcaseAlias?: string;\n}\n\n/** Argument for methods that must supply an IModel name and iTwinId\n * @public\n */\nexport interface IModelNameArg extends TokenArg, ITwinIdArg {\n readonly iModelName: string;\n}\n\n/** Argument for methods that must supply an IModelId and a BriefcaseId\n * @public\n */\nexport interface BriefcaseIdArg extends IModelIdArg {\n readonly briefcaseId: BriefcaseId;\n}\n\n/** Argument for methods that must supply a briefcaseId and a changeset\n * @public\n */\nexport interface BriefcaseDbArg extends BriefcaseIdArg {\n readonly changeset: ChangesetIdWithIndex;\n}\n\n/** Argument for methods that must supply an IModelId and a changeset\n * @public\n */\nexport interface ChangesetArg extends IModelIdArg {\n readonly changeset: ChangesetIndexOrId;\n}\n\n/** Argument for downloading a changeset.\n * @beta\n */\nexport interface DownloadChangesetArg extends ChangesetArg, DownloadProgressArg {\n /** Directory where the changeset should be downloaded. */\n targetDir: LocalDirName;\n}\n\n/** @internal */\nexport interface ChangesetIndexArg extends IModelIdArg {\n readonly changeset: ChangesetIdWithIndex;\n}\n\n/** Argument for methods that must supply an IModelId and a range of Changesets.\n * @public\n */\nexport interface ChangesetRangeArg extends IModelIdArg {\n /** the range of changesets desired. If is undefined, *all* changesets are returned. */\n readonly range?: ChangesetRange;\n}\n\n/** Argument for downloading a changeset range.\n * @beta\n */\nexport interface DownloadChangesetRangeArg extends ChangesetRangeArg, DownloadProgressArg {\n /** Directory where the changesets should be downloaded. */\n targetDir: LocalDirName;\n}\n\n/**\n * @deprecated\n * @internal\n */\nexport type CheckpointArg = DownloadRequest;\n\n/**\n * Arguments to create a new iModel in iModelHub\n * @public\n */\nexport interface CreateNewIModelProps extends IModelNameArg {\n readonly description?: string;\n readonly version0?: LocalFileName;\n readonly noLocks?: true;\n}\n\n/**\n * Methods for accessing services of IModelHub from an iTwin.js backend.\n * Generally direct access to these methods should not be required, since higher-level apis are provided.\n * @beta\n */\nexport interface BackendHubAccess {\n /** Download all the changesets in the specified range. */\n downloadChangesets: (arg: DownloadChangesetRangeArg) => Promise<ChangesetFileProps[]>;\n /** Download a single changeset. */\n downloadChangeset: (arg: DownloadChangesetArg) => Promise<ChangesetFileProps>;\n /** Query the changeset properties given a ChangesetIndex */\n queryChangeset: (arg: ChangesetArg) => Promise<ChangesetProps>;\n /** Query an array of changeset properties given a range of ChangesetIndexes */\n queryChangesets: (arg: ChangesetRangeArg) => Promise<ChangesetProps[]>;\n /** Push a changeset to iModelHub. Returns the newly pushed changeset's index */\n pushChangeset: (arg: IModelIdArg & { changesetProps: ChangesetFileProps }) => Promise<ChangesetIndex>;\n /** Get the ChangesetProps of the most recent changeset */\n getLatestChangeset: (arg: IModelIdArg) => Promise<ChangesetProps>;\n /** Get the ChangesetProps for an IModelVersion */\n getChangesetFromVersion: (arg: IModelIdArg & { version: IModelVersion }) => Promise<ChangesetProps>;\n /** Get the ChangesetProps for a named version */\n getChangesetFromNamedVersion: (arg: IModelIdArg & { versionName: string }) => Promise<ChangesetProps>;\n\n /** Acquire a new briefcaseId for the supplied iModelId\n * @note usually there should only be one briefcase per iModel per user.\n */\n acquireNewBriefcaseId: (arg: AcquireNewBriefcaseIdArg) => Promise<BriefcaseId>;\n /** Release a briefcaseId. After this call it is illegal to generate changesets for the released briefcaseId. */\n releaseBriefcase: (arg: BriefcaseIdArg) => Promise<void>;\n\n /** get an array of the briefcases assigned to a user. */\n getMyBriefcaseIds: (arg: IModelIdArg) => Promise<BriefcaseId[]>;\n\n /**\n * download a v1 checkpoint\n * @deprecated\n * @internal\n */\n downloadV1Checkpoint: (arg: CheckpointArg) => Promise<ChangesetIndexAndId>; // eslint-disable-line deprecation/deprecation\n\n /**\n * Get the access props for a V2 checkpoint. Returns undefined if no V2 checkpoint exists.\n * @internal\n */\n queryV2Checkpoint: (arg: CheckpointProps) => Promise<V2CheckpointAccessProps | undefined>;\n\n /**\n * acquire one or more locks. Throws if unsuccessful. If *any* lock cannot be obtained, no locks are acquired\n * @internal\n */\n acquireLocks: (arg: BriefcaseDbArg, locks: LockMap) => Promise<void>;\n\n /**\n * Get the list of all held locks for a briefcase. This can be very expensive and is currently used only for tests.\n * @internal\n */\n queryAllLocks: (arg: BriefcaseDbArg) => Promise<LockProps[]>;\n\n /**\n * Release all currently held locks\n * @internal\n */\n releaseAllLocks: (arg: BriefcaseDbArg) => Promise<void>;\n\n /** Get the iModelId of an iModel by name. Undefined if no iModel with that name exists. */\n queryIModelByName: (arg: IModelNameArg) => Promise<GuidString | undefined>;\n\n /** create a new iModel. Returns the Guid of the newly created iModel */\n createNewIModel: (arg: CreateNewIModelProps) => Promise<GuidString>;\n\n /** delete an iModel */\n deleteIModel: (arg: IModelIdArg & ITwinIdArg) => Promise<void>;\n}\n"]}