@itwin/core-backend 3.5.0-dev.66 → 3.5.0-dev.68

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 (243) hide show
  1. package/lib/cjs/AliCloudStorageService.d.ts +23 -23
  2. package/lib/cjs/AliCloudStorageService.js +71 -71
  3. package/lib/cjs/AliCloudStorageService.js.map +1 -1
  4. package/lib/cjs/BackendHubAccess.d.ts +224 -224
  5. package/lib/cjs/BackendHubAccess.js +41 -41
  6. package/lib/cjs/BackendHubAccess.js.map +1 -1
  7. package/lib/cjs/BackendLoggerCategory.d.ts +91 -91
  8. package/lib/cjs/BackendLoggerCategory.js +99 -99
  9. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  10. package/lib/cjs/BisCoreSchema.d.ts +21 -21
  11. package/lib/cjs/BisCoreSchema.js +60 -60
  12. package/lib/cjs/BisCoreSchema.js.map +1 -1
  13. package/lib/cjs/BriefcaseManager.d.ts +170 -170
  14. package/lib/cjs/BriefcaseManager.js +413 -413
  15. package/lib/cjs/BriefcaseManager.js.map +1 -1
  16. package/lib/cjs/Category.d.ts +153 -153
  17. package/lib/cjs/Category.js +243 -243
  18. package/lib/cjs/Category.js.map +1 -1
  19. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  20. package/lib/cjs/ChangeSummaryManager.js +447 -447
  21. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  22. package/lib/cjs/ChangedElementsDb.d.ts +99 -99
  23. package/lib/cjs/ChangedElementsDb.js +165 -165
  24. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  25. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  26. package/lib/cjs/ChangedElementsManager.js +88 -88
  27. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  28. package/lib/cjs/CheckpointManager.d.ts +120 -120
  29. package/lib/cjs/CheckpointManager.js +343 -343
  30. package/lib/cjs/CheckpointManager.js.map +1 -1
  31. package/lib/cjs/ClassRegistry.d.ts +79 -79
  32. package/lib/cjs/ClassRegistry.js +249 -249
  33. package/lib/cjs/ClassRegistry.js.map +1 -1
  34. package/lib/cjs/CloudSqlite.d.ts +350 -350
  35. package/lib/cjs/CloudSqlite.js +152 -152
  36. package/lib/cjs/CloudSqlite.js.map +1 -1
  37. package/lib/cjs/CloudStorageBackend.d.ts +58 -58
  38. package/lib/cjs/CloudStorageBackend.js +173 -173
  39. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  40. package/lib/cjs/CodeService.d.ts +396 -396
  41. package/lib/cjs/CodeService.js +63 -63
  42. package/lib/cjs/CodeService.js.map +1 -1
  43. package/lib/cjs/CodeSpecs.d.ts +50 -50
  44. package/lib/cjs/CodeSpecs.js +112 -112
  45. package/lib/cjs/CodeSpecs.js.map +1 -1
  46. package/lib/cjs/ConcurrentQuery.d.ts +13 -13
  47. package/lib/cjs/ConcurrentQuery.js +36 -36
  48. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  49. package/lib/cjs/CustomViewState3dCreator.d.ts +21 -21
  50. package/lib/cjs/CustomViewState3dCreator.js +81 -81
  51. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  52. package/lib/cjs/DevTools.d.ts +71 -71
  53. package/lib/cjs/DevTools.js +154 -154
  54. package/lib/cjs/DevTools.js.map +1 -1
  55. package/lib/cjs/DisplayStyle.d.ts +106 -106
  56. package/lib/cjs/DisplayStyle.js +256 -256
  57. package/lib/cjs/DisplayStyle.js.map +1 -1
  58. package/lib/cjs/ECDb.d.ts +191 -191
  59. package/lib/cjs/ECDb.js +350 -350
  60. package/lib/cjs/ECDb.js.map +1 -1
  61. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  62. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  63. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  64. package/lib/cjs/ECSqlStatement.d.ts +466 -466
  65. package/lib/cjs/ECSqlStatement.js +791 -791
  66. package/lib/cjs/ECSqlStatement.js.map +1 -1
  67. package/lib/cjs/Element.d.ts +1102 -1102
  68. package/lib/cjs/Element.js +1416 -1416
  69. package/lib/cjs/Element.js.map +1 -1
  70. package/lib/cjs/ElementAspect.d.ts +176 -176
  71. package/lib/cjs/ElementAspect.js +211 -211
  72. package/lib/cjs/ElementAspect.js.map +1 -1
  73. package/lib/cjs/ElementGraphics.d.ts +9 -9
  74. package/lib/cjs/ElementGraphics.js +41 -41
  75. package/lib/cjs/ElementGraphics.js.map +1 -1
  76. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  77. package/lib/cjs/ElementTreeWalker.js +409 -409
  78. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  79. package/lib/cjs/Entity.d.ts +106 -106
  80. package/lib/cjs/Entity.js +134 -134
  81. package/lib/cjs/Entity.js.map +1 -1
  82. package/lib/cjs/EntityReferences.d.ts +49 -49
  83. package/lib/cjs/EntityReferences.js +95 -95
  84. package/lib/cjs/EntityReferences.js.map +1 -1
  85. package/lib/cjs/ExportGraphics.d.ts +317 -317
  86. package/lib/cjs/ExportGraphics.js +208 -208
  87. package/lib/cjs/ExportGraphics.js.map +1 -1
  88. package/lib/cjs/ExternalSource.d.ts +96 -96
  89. package/lib/cjs/ExternalSource.js +131 -131
  90. package/lib/cjs/ExternalSource.js.map +1 -1
  91. package/lib/cjs/GeoCoordConfig.d.ts +19 -19
  92. package/lib/cjs/GeoCoordConfig.js +85 -85
  93. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  94. package/lib/cjs/GeometrySummary.d.ts +4 -4
  95. package/lib/cjs/GeometrySummary.js +380 -380
  96. package/lib/cjs/GeometrySummary.js.map +1 -1
  97. package/lib/cjs/HubMock.d.ts +94 -94
  98. package/lib/cjs/HubMock.js +222 -222
  99. package/lib/cjs/HubMock.js.map +1 -1
  100. package/lib/cjs/IModelCloneContext.d.ts +8 -8
  101. package/lib/cjs/IModelCloneContext.js +15 -15
  102. package/lib/cjs/IModelCloneContext.js.map +1 -1
  103. package/lib/cjs/IModelDb.d.ts +1183 -1183
  104. package/lib/cjs/IModelDb.js +2374 -2374
  105. package/lib/cjs/IModelDb.js.map +1 -1
  106. package/lib/cjs/IModelElementCloneContext.d.ts +89 -89
  107. package/lib/cjs/IModelElementCloneContext.js +159 -159
  108. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  109. package/lib/cjs/IModelHost.d.ts +370 -370
  110. package/lib/cjs/IModelHost.js +496 -496
  111. package/lib/cjs/IModelHost.js.map +1 -1
  112. package/lib/cjs/IModelJsFs.d.ts +62 -62
  113. package/lib/cjs/IModelJsFs.js +140 -140
  114. package/lib/cjs/IModelJsFs.js.map +1 -1
  115. package/lib/cjs/IpcHost.d.ts +104 -104
  116. package/lib/cjs/IpcHost.js +278 -278
  117. package/lib/cjs/IpcHost.js.map +1 -1
  118. package/lib/cjs/LineStyle.d.ts +311 -311
  119. package/lib/cjs/LineStyle.js +295 -295
  120. package/lib/cjs/LineStyle.js.map +1 -1
  121. package/lib/cjs/LocalHub.d.ts +162 -162
  122. package/lib/cjs/LocalHub.js +587 -587
  123. package/lib/cjs/LocalHub.js.map +1 -1
  124. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  125. package/lib/cjs/LocalhostIpcHost.js +81 -81
  126. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  127. package/lib/cjs/Material.d.ts +103 -103
  128. package/lib/cjs/Material.js +147 -147
  129. package/lib/cjs/Material.js.map +1 -1
  130. package/lib/cjs/Model.d.ts +392 -392
  131. package/lib/cjs/Model.js +485 -485
  132. package/lib/cjs/Model.js.map +1 -1
  133. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  134. package/lib/cjs/NativeAppStorage.js +202 -202
  135. package/lib/cjs/NativeAppStorage.js.map +1 -1
  136. package/lib/cjs/NativeHost.d.ts +52 -52
  137. package/lib/cjs/NativeHost.js +163 -163
  138. package/lib/cjs/NativeHost.js.map +1 -1
  139. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  140. package/lib/cjs/NavigationRelationship.js +225 -225
  141. package/lib/cjs/NavigationRelationship.js.map +1 -1
  142. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  143. package/lib/cjs/PromiseMemoizer.js +101 -101
  144. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  145. package/lib/cjs/PropertyStore.d.ts +132 -132
  146. package/lib/cjs/PropertyStore.js +11 -11
  147. package/lib/cjs/PropertyStore.js.map +1 -1
  148. package/lib/cjs/Relationship.d.ts +416 -416
  149. package/lib/cjs/Relationship.js +494 -494
  150. package/lib/cjs/Relationship.js.map +1 -1
  151. package/lib/cjs/RpcBackend.d.ts +5 -5
  152. package/lib/cjs/RpcBackend.js +31 -31
  153. package/lib/cjs/RpcBackend.js.map +1 -1
  154. package/lib/cjs/SQLiteDb.d.ts +219 -219
  155. package/lib/cjs/SQLiteDb.js +214 -214
  156. package/lib/cjs/SQLiteDb.js.map +1 -1
  157. package/lib/cjs/Schema.d.ts +55 -55
  158. package/lib/cjs/Schema.js +83 -83
  159. package/lib/cjs/Schema.js.map +1 -1
  160. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  161. package/lib/cjs/ServerBasedLocks.js +168 -168
  162. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  163. package/lib/cjs/SqliteStatement.d.ts +360 -360
  164. package/lib/cjs/SqliteStatement.js +586 -586
  165. package/lib/cjs/SqliteStatement.js.map +1 -1
  166. package/lib/cjs/Texture.d.ts +58 -58
  167. package/lib/cjs/Texture.js +82 -82
  168. package/lib/cjs/Texture.js.map +1 -1
  169. package/lib/cjs/TileStorage.d.ts +18 -18
  170. package/lib/cjs/TileStorage.js +90 -90
  171. package/lib/cjs/TileStorage.js.map +1 -1
  172. package/lib/cjs/TxnManager.d.ts +202 -202
  173. package/lib/cjs/TxnManager.js +356 -356
  174. package/lib/cjs/TxnManager.js.map +1 -1
  175. package/lib/cjs/ViewDefinition.d.ts +439 -439
  176. package/lib/cjs/ViewDefinition.js +646 -646
  177. package/lib/cjs/ViewDefinition.js.map +1 -1
  178. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  179. package/lib/cjs/ViewStateHydrator.js +103 -103
  180. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  181. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  182. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
  183. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
  184. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  185. package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
  186. package/lib/cjs/core-backend.d.ts +184 -184
  187. package/lib/cjs/core-backend.js +204 -204
  188. package/lib/cjs/core-backend.js.map +1 -1
  189. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  190. package/lib/cjs/domains/FunctionalElements.js +145 -145
  191. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  192. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  193. package/lib/cjs/domains/FunctionalSchema.js +40 -40
  194. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  195. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  196. package/lib/cjs/domains/GenericElements.js +263 -263
  197. package/lib/cjs/domains/GenericElements.js.map +1 -1
  198. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  199. package/lib/cjs/domains/GenericSchema.js +28 -28
  200. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  201. package/lib/cjs/rpc/multipart.d.ts +11 -11
  202. package/lib/cjs/rpc/multipart.js +70 -70
  203. package/lib/cjs/rpc/multipart.js.map +1 -1
  204. package/lib/cjs/rpc/tracing.d.ts +28 -28
  205. package/lib/cjs/rpc/tracing.js +73 -73
  206. package/lib/cjs/rpc/tracing.js.map +1 -1
  207. package/lib/cjs/rpc/web/logging.d.ts +9 -9
  208. package/lib/cjs/rpc/web/logging.js +42 -42
  209. package/lib/cjs/rpc/web/logging.js.map +1 -1
  210. package/lib/cjs/rpc/web/request.d.ts +6 -6
  211. package/lib/cjs/rpc/web/request.js +73 -73
  212. package/lib/cjs/rpc/web/request.js.map +1 -1
  213. package/lib/cjs/rpc/web/response.d.ts +6 -6
  214. package/lib/cjs/rpc/web/response.js +105 -105
  215. package/lib/cjs/rpc/web/response.js.map +1 -1
  216. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  217. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  218. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  219. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +47 -47
  220. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +291 -291
  221. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  222. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -22
  223. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +202 -202
  224. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  225. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  226. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +168 -168
  227. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  228. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  229. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +43 -43
  230. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  231. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  232. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  233. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  234. package/lib/cjs/workspace/Settings.d.ts +186 -186
  235. package/lib/cjs/workspace/Settings.js +155 -155
  236. package/lib/cjs/workspace/Settings.js.map +1 -1
  237. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  238. package/lib/cjs/workspace/SettingsSchemas.js +191 -191
  239. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  240. package/lib/cjs/workspace/Workspace.d.ts +414 -414
  241. package/lib/cjs/workspace/Workspace.js +543 -543
  242. package/lib/cjs/workspace/Workspace.js.map +1 -1
  243. package/package.json +11 -11
@@ -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,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":["/*---------------------------------------------------------------------------------------------\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"]}
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,\r\n IModelError, 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"]}