@itwin/core-backend 3.4.0-dev.50 → 3.4.0-dev.55

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 (76) hide show
  1. package/lib/cjs/AliCloudStorageService.d.ts +8 -2
  2. package/lib/cjs/AliCloudStorageService.d.ts.map +1 -1
  3. package/lib/cjs/AliCloudStorageService.js +4 -1
  4. package/lib/cjs/AliCloudStorageService.js.map +1 -1
  5. package/lib/cjs/BackendLoggerCategory.d.ts +4 -0
  6. package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -1
  7. package/lib/cjs/BackendLoggerCategory.js +4 -0
  8. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  9. package/lib/cjs/CheckpointManager.d.ts +0 -2
  10. package/lib/cjs/CheckpointManager.d.ts.map +1 -1
  11. package/lib/cjs/CheckpointManager.js +1 -12
  12. package/lib/cjs/CheckpointManager.js.map +1 -1
  13. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  14. package/lib/cjs/ClassRegistry.js +3 -1
  15. package/lib/cjs/ClassRegistry.js.map +1 -1
  16. package/lib/cjs/CloudStorageBackend.d.ts +16 -4
  17. package/lib/cjs/CloudStorageBackend.d.ts.map +1 -1
  18. package/lib/cjs/CloudStorageBackend.js +12 -3
  19. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  20. package/lib/cjs/CodeService.d.ts.map +1 -1
  21. package/lib/cjs/CodeService.js +3 -1
  22. package/lib/cjs/CodeService.js.map +1 -1
  23. package/lib/cjs/CustomViewState3dCreator.d.ts.map +1 -1
  24. package/lib/cjs/CustomViewState3dCreator.js +8 -2
  25. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  26. package/lib/cjs/DevTools.d.ts.map +1 -1
  27. package/lib/cjs/DevTools.js.map +1 -1
  28. package/lib/cjs/Element.d.ts.map +1 -1
  29. package/lib/cjs/Element.js +16 -17
  30. package/lib/cjs/Element.js.map +1 -1
  31. package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
  32. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  33. package/lib/cjs/ExportGraphics.d.ts.map +1 -1
  34. package/lib/cjs/ExportGraphics.js.map +1 -1
  35. package/lib/cjs/ExternalSource.d.ts.map +1 -1
  36. package/lib/cjs/ExternalSource.js.map +1 -1
  37. package/lib/cjs/GeometrySummary.js +1 -1
  38. package/lib/cjs/GeometrySummary.js.map +1 -1
  39. package/lib/cjs/IModelDb.d.ts.map +1 -1
  40. package/lib/cjs/IModelDb.js +17 -14
  41. package/lib/cjs/IModelDb.js.map +1 -1
  42. package/lib/cjs/IModelHost.d.ts +17 -3
  43. package/lib/cjs/IModelHost.d.ts.map +1 -1
  44. package/lib/cjs/IModelHost.js +46 -12
  45. package/lib/cjs/IModelHost.js.map +1 -1
  46. package/lib/cjs/Model.d.ts.map +1 -1
  47. package/lib/cjs/Model.js +5 -2
  48. package/lib/cjs/Model.js.map +1 -1
  49. package/lib/cjs/PromiseMemoizer.d.ts.map +1 -1
  50. package/lib/cjs/PromiseMemoizer.js +10 -4
  51. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  52. package/lib/cjs/TileStorage.d.ts +19 -0
  53. package/lib/cjs/TileStorage.d.ts.map +1 -0
  54. package/lib/cjs/TileStorage.js +91 -0
  55. package/lib/cjs/TileStorage.js.map +1 -0
  56. package/lib/cjs/TxnManager.d.ts.map +1 -1
  57. package/lib/cjs/TxnManager.js +4 -1
  58. package/lib/cjs/TxnManager.js.map +1 -1
  59. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  60. package/lib/cjs/ViewDefinition.js +8 -2
  61. package/lib/cjs/ViewDefinition.js.map +1 -1
  62. package/lib/cjs/core-backend.d.ts +4 -0
  63. package/lib/cjs/core-backend.d.ts.map +1 -1
  64. package/lib/cjs/core-backend.js +4 -0
  65. package/lib/cjs/core-backend.js.map +1 -1
  66. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +2 -0
  67. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -1
  68. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +11 -2
  69. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  70. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
  71. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +3 -0
  72. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  73. package/lib/cjs/workspace/Settings.d.ts.map +1 -1
  74. package/lib/cjs/workspace/Settings.js +4 -1
  75. package/lib/cjs/workspace/Settings.js.map +1 -1
  76. package/package.json +17 -13
@@ -1 +1 @@
1
- {"version":3,"file":"CloudStorageBackend.js","sourceRoot":"","sources":["../../src/CloudStorageBackend.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,mCAA+C;AAC/C,6BAA6B;AAC7B,6CAA6C;AAC7C,sDAAyD;AACzD,oDAG4B;AAC5B,mEAAgE;AAChE,6CAA0C;AAgB1C,YAAY;AACZ,MAAsB,mBAAmB;IAChC,UAAU,KAAW,CAAC;IACtB,SAAS,KAAW,CAAC;IAIrB,KAAK,CAAC,QAAQ,CAAC,KAAa,IAAmC,OAAO,SAAS,CAAC,CAAC,CAAC;IAE/E,cAAc,CAAC,EAAmC;QAC1D,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC;IAC9C,CAAC;CACF;AAXD,kDAWC;AAED,YAAY;AACZ,MAAa,gBAAiB,SAAQ,mBAAmB;IAKvD,YAAmB,WAAwC;;QACzD,KAAK,EAAE,CAAC;QAcM,OAAE,GAAG,kCAAoB,CAAC,KAAK,CAAC;QAZ9C,IAAI,CAAC,WAAW,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE;YAClD,MAAM,IAAI,yBAAW,CAAC,2BAAa,CAAC,KAAK,EAAE,6CAA6C,CAAC,CAAC;S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AC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;SACxH;QAED,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,YAAY,GAAG,WAAW,CAAC,CAAC;IACzD,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,UAA0B,EAAE,MAAc,EAAE,SAAiB,EAAE,OAAmB,EAAE,IAAwB,EAAE,QAAiB;QACpJ,MAAM,EAAE,GAA0B,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAE1E,MAAM,KAAK,GAAG,mCAAqB,CAAC,QAAQ,EAAE,CAAC;QAC/C,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;QACjD,MAAM,WAAW,GAAG,KAAK,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;QAC/C,MAAM,GAAG,GAAG,YAAY,GAAG,WAAW,CAAC;QAEvC,IAAI,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC;YAC9B,OAAO;QAET,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;QACrF,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACtC,MAAM,OAAO,CAAC;IAChB,CAAC;CACF;AA1CD,4DA0CC","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\nimport { PassThrough, Readable } from \"stream\";\r\nimport * as zlib from \"zlib\";\r\nimport * as Azure from \"@azure/storage-blob\";\r\nimport { Logger, PerfLogger } from \"@itwin/core-bentley\";\r\nimport {\r\n BentleyStatus, CloudStorageContainerDescriptor, CloudStorageContainerUrl, CloudStorageProvider, CloudStorageTileCache, IModelError, IModelRpcProps,\r\n TileContentIdentifier,\r\n} from \"@itwin/core-common\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { IModelHost } from \"./IModelHost\";\r\n\r\n/** @beta */\r\nexport interface AzureBlobStorageCredentials {\r\n account: string;\r\n accessKey: string;\r\n baseUrl?: string;\r\n}\r\n\r\n/** @beta */\r\nexport interface CloudStorageUploadOptions {\r\n type?: string;\r\n cacheControl?: string;\r\n contentEncoding?: \"gzip\";\r\n}\r\n\r\n/** @beta */\r\nexport abstract class CloudStorageService {\r\n public initialize(): void { }\r\n public terminate(): void { }\r\n public abstract id: CloudStorageProvider;\r\n public abstract obtainContainerUrl(id: CloudStorageContainerDescriptor, expiry: Date, clientIp?: string): CloudStorageContainerUrl;\r\n public abstract upload(container: string, name: string, data: Uint8Array, options?: CloudStorageUploadOptions, metadata?: object): Promise<string>;\r\n public async download(_name: string): Promise<Readable | undefined> { return undefined; }\r\n\r\n protected makeDescriptor(id: CloudStorageContainerDescriptor) {\r\n return { name: id.name, provider: this.id };\r\n }\r\n}\r\n\r\n/** @beta */\r\nexport class AzureBlobStorage extends CloudStorageService {\r\n private _service: Azure.BlobServiceClient;\r\n private _credential: Azure.StorageSharedKeyCredential;\r\n private _baseUrl: string;\r\n\r\n public constructor(credentials: AzureBlobStorageCredentials) {\r\n super();\r\n\r\n if (!credentials.account || !credentials.accessKey) {\r\n throw new IModelError(BentleyStatus.ERROR, \"Invalid credentials for Azure blob storage.\");\r\n }\r\n\r\n this._baseUrl = credentials.baseUrl ?? `https://${credentials.account}.blob.core.windows.net`;\r\n\r\n this._credential = new Azure.StorageSharedKeyCredential(credentials.account, credentials.accessKey);\r\n const options: Azure.StoragePipelineOptions = {};\r\n const pipeline = Azure.newPipeline(this._credential, options);\r\n this._service = new Azure.BlobServiceClient(this._baseUrl, pipeline);\r\n }\r\n\r\n public readonly id = CloudStorageProvider.Azure;\r\n\r\n public obtainContainerUrl(id: CloudStorageContainerDescriptor, expiry: Date, clientIp?: string): CloudStorageContainerUrl {\r\n const policy: Azure.BlobSASSignatureValues = {\r\n containerName: id.name,\r\n permissions: Azure.ContainerSASPermissions.parse(\"rl\"),\r\n expiresOn: expiry,\r\n };\r\n\r\n if (clientIp && clientIp !== \"localhost\" && clientIp !== \"127.0.0.1\" && clientIp !== \"::1\") {\r\n policy.ipRange = { start: clientIp };\r\n }\r\n\r\n const token = Azure.generateBlobSASQueryParameters(policy, this._credential);\r\n const url = new URL(this._baseUrl);\r\n url.pathname = `${url.pathname.replace(/\\/*$/, \"\")}/${id.name}`;\r\n url.search = token.toString();\r\n\r\n const urlObject: CloudStorageContainerUrl = {\r\n descriptor: this.makeDescriptor(id),\r\n valid: 0,\r\n expires: expiry.getTime(),\r\n url: url.toString(),\r\n };\r\n\r\n return urlObject;\r\n }\r\n\r\n public async ensureContainer(name: string): Promise<void> {\r\n try {\r\n const container = this._service.getContainerClient(name);\r\n await container.create();\r\n return;\r\n } catch (maybeErr) {\r\n try {\r\n const err = maybeErr as Azure.RestError;\r\n if (err.statusCode === 409 && err.code === \"ContainerAlreadyExists\") {\r\n return;\r\n }\r\n } catch { }\r\n\r\n if (typeof (maybeErr) !== \"undefined\" && maybeErr) {\r\n throw maybeErr;\r\n }\r\n\r\n throw new IModelError(BentleyStatus.ERROR, `Unable to create container \"${name}\".`);\r\n }\r\n }\r\n\r\n public async upload(container: string, name: string, data: Uint8Array, options?: CloudStorageUploadOptions, metadata?: object): Promise<string> {\r\n try {\r\n await this.ensureContainer(container);\r\n\r\n const containerClient = this._service.getContainerClient(container);\r\n const blocks = containerClient.getBlockBlobClient(name);\r\n const blobHTTPHeaders = {\r\n blobContentType: options?.type ?? \"application/octet-stream\",\r\n blobCacheControl: options?.cacheControl ?? \"private, max-age=31536000, immutable\",\r\n };\r\n\r\n const blobOptions: Azure.BlockBlobUploadStreamOptions = metadata ?\r\n {\r\n blobHTTPHeaders,\r\n metadata: { ...metadata },\r\n } : {\r\n blobHTTPHeaders,\r\n };\r\n\r\n const dataStream = new PassThrough();\r\n dataStream.end(data);\r\n\r\n let source: Readable;\r\n\r\n if (options && options.contentEncoding === \"gzip\") {\r\n if (undefined === blobOptions.blobHTTPHeaders)\r\n throw new IModelError(BentleyStatus.ERROR, \"Blob HTTP headers object is undefined.\");\r\n\r\n blobOptions.blobHTTPHeaders.blobContentEncoding = options.contentEncoding;\r\n const compressor = zlib.createGzip();\r\n source = dataStream.pipe(compressor);\r\n } else {\r\n source = dataStream;\r\n }\r\n\r\n const blockSize = 100 * 1024 * 1024;\r\n const concurrency = 1;\r\n const result = await blocks.uploadStream(source, blockSize, concurrency, blobOptions);\r\n return result.etag ?? \"\";\r\n } catch (maybeErr) {\r\n if (typeof (maybeErr) !== \"undefined\" && maybeErr) {\r\n throw maybeErr;\r\n }\r\n\r\n throw new IModelError(BentleyStatus.ERROR, `Unable to upload \"${name}\".`);\r\n }\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class CloudStorageTileUploader {\r\n private _activeUploads: Map<string, Promise<void>> = new Map();\r\n\r\n public get activeUploads(): Iterable<Promise<void>> {\r\n return this._activeUploads.values();\r\n }\r\n\r\n private async uploadToCache(id: TileContentIdentifier, content: Uint8Array, containerKey: string, resourceKey: string, metadata?: object,) {\r\n await new Promise((resolve) => setTimeout(resolve));\r\n\r\n try {\r\n const options: CloudStorageUploadOptions = {};\r\n if (IModelHost.compressCachedTiles) {\r\n options.contentEncoding = \"gzip\";\r\n }\r\n\r\n const perfInfo = { ...id.tokenProps, treeId: id.treeId, contentId: id.contentId, size: content.byteLength, compress: IModelHost.compressCachedTiles };\r\n const perfLogger = new PerfLogger(\"Uploading tile to external tile cache\", () => perfInfo);\r\n await IModelHost.tileCacheService?.upload(containerKey, resourceKey, content, options, metadata);\r\n perfLogger.dispose();\r\n } catch (err) {\r\n Logger.logError(BackendLoggerCategory.IModelTileUpload, (err instanceof Error) ? err.toString() : JSON.stringify(err));\r\n }\r\n\r\n this._activeUploads.delete(containerKey + resourceKey);\r\n }\r\n\r\n public async cacheTile(tokenProps: IModelRpcProps, treeId: string, contentId: string, content: Uint8Array, guid: string | undefined, metadata?: object): Promise<void> {\r\n const id: TileContentIdentifier = { tokenProps, treeId, contentId, guid };\r\n\r\n const cache = CloudStorageTileCache.getCache();\r\n const containerKey = cache.formContainerName(id);\r\n const resourceKey = cache.formResourceName(id);\r\n const key = containerKey + resourceKey;\r\n\r\n if (this._activeUploads.has(key))\r\n return;\r\n\r\n const promise = this.uploadToCache(id, content, containerKey, resourceKey, metadata);\r\n this._activeUploads.set(key, promise);\r\n await promise;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CloudStorageBackend.js","sourceRoot":"","sources":["../../src/CloudStorageBackend.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,mCAA+C;AAC/C,6BAA6B;AAC7B,6CAA6C;AAC7C,sDAAyD;AACzD,oDAG4B;AAC5B,mEAAgE;AAChE,6CAA0C;AAqB1C;;;GAGG;AACH,MAAsB,mBAAmB;IAChC,UAAU,KAAW,CAAC;IACtB,SAAS,KAAW,CAAC;IAIrB,KAAK,CAAC,QAAQ,CAAC,KAAa,IAAmC,OAAO,SAAS,CAAC,CAAC,CAAC;IAE/E,cAAc,CAAC,EAAmC;QAC1D,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC;IAC9C,CAAC;CACF;AAXD,kDAWC;AAED;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,mBAAmB;IAKvD,YAAmB,WAAwC;;QACzD,KAAK,EAAE,CAAC;QAcM,OAAE,GAAG,kCAAoB,CAAC,KAAK,CAAC;QAZ9C,IAAI,CAAC,WAAW,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE;YAClD,MAAM,IAAI,yBAAW,CAAC,2BAAa,CAAC,KAAK,EAAE,6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AAY,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;SACxH;QAED,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,YAAY,GAAG,WAAW,CAAC,CAAC;IACzD,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,UAA0B,EAAE,MAAc,EAAE,SAAiB,EAAE,OAAmB,EAAE,IAAwB,EAAE,QAAiB;QACpJ,MAAM,EAAE,GAA0B,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAE1E,MAAM,KAAK,GAAG,mCAAqB,CAAC,QAAQ,EAAE,CAAC;QAC/C,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;QACjD,MAAM,WAAW,GAAG,KAAK,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;QAC/C,MAAM,GAAG,GAAG,YAAY,GAAG,WAAW,CAAC;QAEvC,IAAI,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC;YAC9B,OAAO;QAET,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;QACrF,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACtC,MAAM,OAAO,CAAC;IAChB,CAAC;CACF;AA1CD,4DA0CC","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\nimport { PassThrough, Readable } from \"stream\";\r\nimport * as zlib from \"zlib\";\r\nimport * as Azure from \"@azure/storage-blob\";\r\nimport { Logger, PerfLogger } from \"@itwin/core-bentley\";\r\nimport {\r\n BentleyStatus, CloudStorageContainerDescriptor, CloudStorageContainerUrl, CloudStorageProvider, CloudStorageTileCache, IModelError, IModelRpcProps,\r\n TileContentIdentifier,\r\n} from \"@itwin/core-common\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { IModelHost } from \"./IModelHost\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\n/** @beta */\r\nexport interface AzureBlobStorageCredentials {\r\n account: string;\r\n accessKey: string;\r\n baseUrl?: string;\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated\r\n */\r\nexport interface CloudStorageUploadOptions {\r\n type?: string;\r\n cacheControl?: string;\r\n contentEncoding?: \"gzip\";\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated\r\n */\r\nexport abstract class CloudStorageService {\r\n public initialize(): void { }\r\n public terminate(): void { }\r\n public abstract id: CloudStorageProvider;\r\n public abstract obtainContainerUrl(id: CloudStorageContainerDescriptor, expiry: Date, clientIp?: string): CloudStorageContainerUrl;\r\n public abstract upload(container: string, name: string, data: Uint8Array, options?: CloudStorageUploadOptions, metadata?: object): Promise<string>;\r\n public async download(_name: string): Promise<Readable | undefined> { return undefined; }\r\n\r\n protected makeDescriptor(id: CloudStorageContainerDescriptor) {\r\n return { name: id.name, provider: this.id };\r\n }\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated\r\n */\r\nexport class AzureBlobStorage extends CloudStorageService {\r\n private _service: Azure.BlobServiceClient;\r\n private _credential: Azure.StorageSharedKeyCredential;\r\n private _baseUrl: string;\r\n\r\n public constructor(credentials: AzureBlobStorageCredentials) {\r\n super();\r\n\r\n if (!credentials.account || !credentials.accessKey) {\r\n throw new IModelError(BentleyStatus.ERROR, \"Invalid credentials for Azure blob storage.\");\r\n }\r\n\r\n this._baseUrl = credentials.baseUrl ?? `https://${credentials.account}.blob.core.windows.net`;\r\n\r\n this._credential = new Azure.StorageSharedKeyCredential(credentials.account, credentials.accessKey);\r\n const options: Azure.StoragePipelineOptions = {};\r\n const pipeline = Azure.newPipeline(this._credential, options);\r\n this._service = new Azure.BlobServiceClient(this._baseUrl, pipeline);\r\n }\r\n\r\n public readonly id = CloudStorageProvider.Azure;\r\n\r\n public obtainContainerUrl(id: CloudStorageContainerDescriptor, expiry: Date, clientIp?: string): CloudStorageContainerUrl {\r\n const policy: Azure.BlobSASSignatureValues = {\r\n containerName: id.name,\r\n permissions: Azure.ContainerSASPermissions.parse(\"rl\"),\r\n expiresOn: expiry,\r\n };\r\n\r\n if (clientIp && clientIp !== \"localhost\" && clientIp !== \"127.0.0.1\" && clientIp !== \"::1\") {\r\n policy.ipRange = { start: clientIp };\r\n }\r\n\r\n const token = Azure.generateBlobSASQueryParameters(policy, this._credential);\r\n const url = new URL(this._baseUrl);\r\n url.pathname = `${url.pathname.replace(/\\/*$/, \"\")}/${id.name}`;\r\n url.search = token.toString();\r\n\r\n const urlObject: CloudStorageContainerUrl = {\r\n descriptor: this.makeDescriptor(id),\r\n valid: 0,\r\n expires: expiry.getTime(),\r\n url: url.toString(),\r\n };\r\n\r\n return urlObject;\r\n }\r\n\r\n public async ensureContainer(name: string): Promise<void> {\r\n try {\r\n const container = this._service.getContainerClient(name);\r\n await container.create();\r\n return;\r\n } catch (maybeErr) {\r\n try {\r\n const err = maybeErr as Azure.RestError;\r\n if (err.statusCode === 409 && err.code === \"ContainerAlreadyExists\") {\r\n return;\r\n }\r\n } catch { }\r\n\r\n if (typeof (maybeErr) !== \"undefined\" && maybeErr) {\r\n throw maybeErr;\r\n }\r\n\r\n throw new IModelError(BentleyStatus.ERROR, `Unable to create container \"${name}\".`);\r\n }\r\n }\r\n\r\n public async upload(container: string, name: string, data: Uint8Array, options?: CloudStorageUploadOptions, metadata?: object): Promise<string> {\r\n try {\r\n await this.ensureContainer(container);\r\n\r\n const containerClient = this._service.getContainerClient(container);\r\n const blocks = containerClient.getBlockBlobClient(name);\r\n const blobHTTPHeaders = {\r\n blobContentType: options?.type ?? \"application/octet-stream\",\r\n blobCacheControl: options?.cacheControl ?? \"private, max-age=31536000, immutable\",\r\n };\r\n\r\n const blobOptions: Azure.BlockBlobUploadStreamOptions = metadata ?\r\n {\r\n blobHTTPHeaders,\r\n metadata: { ...metadata },\r\n } : {\r\n blobHTTPHeaders,\r\n };\r\n\r\n const dataStream = new PassThrough();\r\n dataStream.end(data);\r\n\r\n let source: Readable;\r\n\r\n if (options && options.contentEncoding === \"gzip\") {\r\n if (undefined === blobOptions.blobHTTPHeaders)\r\n throw new IModelError(BentleyStatus.ERROR, \"Blob HTTP headers object is undefined.\");\r\n\r\n blobOptions.blobHTTPHeaders.blobContentEncoding = options.contentEncoding;\r\n const compressor = zlib.createGzip();\r\n source = dataStream.pipe(compressor);\r\n } else {\r\n source = dataStream;\r\n }\r\n\r\n const blockSize = 100 * 1024 * 1024;\r\n const concurrency = 1;\r\n const result = await blocks.uploadStream(source, blockSize, concurrency, blobOptions);\r\n return result.etag ?? \"\";\r\n } catch (maybeErr) {\r\n if (typeof (maybeErr) !== \"undefined\" && maybeErr) {\r\n throw maybeErr;\r\n }\r\n\r\n throw new IModelError(BentleyStatus.ERROR, `Unable to upload \"${name}\".`);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated\r\n */\r\nexport class CloudStorageTileUploader {\r\n private _activeUploads: Map<string, Promise<void>> = new Map();\r\n\r\n public get activeUploads(): Iterable<Promise<void>> {\r\n return this._activeUploads.values();\r\n }\r\n\r\n private async uploadToCache(id: TileContentIdentifier, content: Uint8Array, containerKey: string, resourceKey: string, metadata?: object,) {\r\n await new Promise((resolve) => setTimeout(resolve));\r\n\r\n try {\r\n const options: CloudStorageUploadOptions = {};\r\n if (IModelHost.compressCachedTiles) {\r\n options.contentEncoding = \"gzip\";\r\n }\r\n\r\n const perfInfo = { ...id.tokenProps, treeId: id.treeId, contentId: id.contentId, size: content.byteLength, compress: IModelHost.compressCachedTiles };\r\n const perfLogger = new PerfLogger(\"Uploading tile to external tile cache\", () => perfInfo);\r\n await IModelHost.tileCacheService?.upload(containerKey, resourceKey, content, options, metadata);\r\n perfLogger.dispose();\r\n } catch (err) {\r\n Logger.logError(BackendLoggerCategory.IModelTileUpload, (err instanceof Error) ? err.toString() : JSON.stringify(err));\r\n }\r\n\r\n this._activeUploads.delete(containerKey + resourceKey);\r\n }\r\n\r\n public async cacheTile(tokenProps: IModelRpcProps, treeId: string, contentId: string, content: Uint8Array, guid: string | undefined, metadata?: object): Promise<void> {\r\n const id: TileContentIdentifier = { tokenProps, treeId, contentId, guid };\r\n\r\n const cache = CloudStorageTileCache.getCache();\r\n const containerKey = cache.formContainerName(id);\r\n const resourceKey = cache.formResourceName(id);\r\n const key = containerKey + resourceKey;\r\n\r\n if (this._activeUploads.has(key))\r\n return;\r\n\r\n const promise = this.uploadToCache(id, content, containerKey, resourceKey, metadata);\r\n this._activeUploads.set(key, promise);\r\n await promise;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CodeService.d.ts","sourceRoot":"","sources":["../../src/CodeService.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAgB,YAAY,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACjH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;OAKG;IACH,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,aAAa,GAAG,WAAW,CAAC,SAAS,CAAC;IAE1E;;;;OAIG;IACH,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,aAAa,GAAG,WAAW,CAAC,SAAS,GAAG,SAAS,CAAC;IAEpF,yEAAyE;IACzE,aAAa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,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;QAC1B,mEAAmE;QACnE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;KAC1B;IAED;;;;OAIG;IACH,UAAiB,YAAY;QAC3B,qCAAqC;QACrC,IAAI,YAAY,IAAI,MAAM,CAAC;QAC3B,sDAAsD;QACtD,aAAa,IAAI,SAAS,CAAC;QAC3B,qDAAqD;QACrD,YAAY,IAAI,SAAS,CAAC;QAC1B;;;WAGG;QACH,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;QACzC,wEAAwE;QACxE,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;KACvC;IAED,uDAAuD;IACvD,MAAa,KAAM,SAAQ,YAAY;QACrC,6EAA6E;QAC7E,SAAgB,OAAO,EAAE,OAAO,CAAC;QACjC,uGAAuG;QACvG,SAAgB,QAAQ,CAAC,EAAE,cAAc,EAAE,GAAG,aAAa,EAAE,CAAC;QAE9D,gBAAgB;oBACJ,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,cAAc,EAAE,GAAG,aAAa,EAAE;KAK7G;IAED;;OAEG;IACH,KAAY,OAAO,GACjB,eAAe,GACf,eAAe,GACf,cAAc,GACd,gBAAgB,GAChB,aAAa,GACb,cAAc,GACd,cAAc,GACd,eAAe,GACf,kBAAkB,GAClB,aAAa,GACb,iBAAiB,GACjB,aAAa,GACb,aAAa,GACb,cAAc,GACd,aAAa,GACb,aAAa,GACb,cAAc,GACd,eAAe,GACf,kBAAkB,GAClB,eAAe,GACf,cAAc,GACd,cAAc,GACd,cAAc,CAAC;CAElB"}
@@ -12,7 +12,9 @@ var CodeService;
12
12
  /** @internal */
13
13
  const codeSequences = new Map();
14
14
  /** Register an instance of a`CodeSequence` so it can be looked up by name. */
15
- function registerSequence(seq) { codeSequences.set(seq.sequenceName, seq); }
15
+ function registerSequence(seq) {
16
+ codeSequences.set(seq.sequenceName, seq);
17
+ }
16
18
  CodeService.registerSequence = registerSequence;
17
19
  /** Get a previously registered `CodeSequence` by its name.
18
20
  * @throws if no sequence by that name was registered.
@@ -1 +1 @@
1
- {"version":3,"file":"CodeService.js","sourceRoot":"","sources":["../../src/CodeService.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAAiH;AAyKjH,aAAa;AACb,IAAiB,WAAW,CA2U3B;AA3UD,WAAiB,WAAW;IAC1B,gBAAgB;IAChB,MAAM,aAAa,GAAG,IAAI,GAAG,EAAwB,CAAC;IAKtD,8EAA8E;IAC9E,SAAgB,gBAAgB,CAAC,GAAiB,IAAI,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAAjF,4BAAgB,mBAAiE,CAAA;IAEjG;;MAEE;IACF,SAAgB,WAAW,CAAC,IAAY;QACtC,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,GAAG;YACN,MAAM,IAAI,KAAK,CAAC,kBAAkB,EAAE,CAAC,CAAC,EAAE,iBAAiB,IAAI,YAAY,CAAC,CAAC;QAC7E,OAAO,GAAG,CAAC;IACb,CAAC;IALe,uBAAW,cAK1B,CAAA;IAED;;;;;OAKG;IACH,SAAgB,gBAAgB,CAAC,MAAgB,EAAE,IAAe;QAChE,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC,cAAc,CAAC;QAC3G,IAAI,SAAS,KAAK,KAAK;YACrB,MAAM,IAAI,WAAW,CAAC,KAAK,CAAC,aAAa,EAAE,2BAAY,CAAC,WAAW,EAAE,0CAA0C,CAAC,CAAC;QAEnH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IACnE,CAAC;IANe,4BAAgB,mBAM/B,CAAA;IAED;;OAEG;IACH,SAAgB,gBAAgB,CAAC,GAAqC;QACpE,OAAO;YACL,GAAG,GAAG,CAAC,KAAK;YACZ,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK;YACrB,GAAG,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC;SAC1C,CAAC;IACJ,CAAC;IANe,4BAAgB,mBAM/B,CAAA;IAqPD,uDAAuD;IACvD,MAAa,KAAM,SAAQ,2BAAY;QAMrC,gBAAgB;QAChB,YAAY,OAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,QAA6C;YAC1G,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC3B,CAAC;KACF;IAZY,iBAAK,QAYjB,CAAA;AA8BH,CAAC,EA3UgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QA2U3B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { AccessToken, BentleyError, GuidString, IModelStatus, MarkRequired, Mutable } from \"@itwin/core-bentley\";\r\nimport { CodeProps } from \"@itwin/core-common\";\r\nimport { CloudSqlite } from \"./CloudSqlite\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { SettingObject } from \"./workspace/Settings\";\r\n\r\n/**\r\n * A readonly index of all known Codes for an iTwin. The CodeIndex may be slightly out-of-date\r\n * with the master copy in the cloud, but it should be periodically synchronized. Whenever codes are reserved/updated/deleted\r\n * locally, this copy is always up-to-date as of those changes.\r\n * @alpha\r\n */\r\nexport interface CodeIndex {\r\n /**\r\n * Find the next available value for the supplied `SequenceScope`.\r\n * If the sequence is full (there are no available values), this will throw an exception with `errorId=\"SequenceFull\"`\r\n * @param from the sequence and scope to search\r\n * @returns the next available CodeValue in the sequence.\r\n */\r\n findNextAvailable(from: CodeService.SequenceScope): CodeService.CodeValue;\r\n\r\n /**\r\n * Find the highest currently used value for the supplied `SequenceScope`\r\n * @param from the sequence and scope to search\r\n * @returns the highest used value, or undefined if no values have been used.\r\n */\r\n findHighestUsed(from: CodeService.SequenceScope): CodeService.CodeValue | undefined;\r\n\r\n /** Determine whether a code is present in this CodeIndex by its Guid. */\r\n isCodePresent(guid: CodeService.CodeGuid): boolean;\r\n\r\n /** Get the data for a code in this CodeIndex by its Guid.\r\n * @returns the data for the code or undefined if no code is present for the supplied Guid.\r\n */\r\n getCode(guid: CodeService.CodeGuid): CodeService.CodeEntry | undefined;\r\n\r\n /** Look up a code by its Scope, Spec, and Value.\r\n * @returns the Guid of the code, or undefined if not present.\r\n */\r\n findCode(code: CodeService.ScopeSpecAndValue): CodeService.CodeGuid | undefined;\r\n\r\n /** Look up a code spec by its name\r\n * @throws if the spec is not present.\r\n */\r\n getCodeSpec(props: CodeService.CodeSpecName): CodeService.NameAndJson;\r\n\r\n /** Call a `CodeIteration` function for all codes in this index, optionally filtered by a `CodeFilter ` */\r\n forAllCodes(iter: CodeService.CodeIteration, filter?: CodeService.CodeFilter): void;\r\n\r\n /** Call an iteration function for all code specs in this index, optionally filtered by a `ValueFilter ` */\r\n forAllCodeSpecs(iter: CodeService.NameAndJsonIteration, filter?: CodeService.ValueFilter): void;\r\n}\r\n\r\n/**\r\n * The services for querying, reserving, updating, and deleting codes for a BriefcaseDb (available via `BriefcaseDb.codeService`) whenever it is opened for write access.\r\n * @alpha\r\n */\r\nexport interface CodeService {\r\n /** @internal */\r\n close: () => void;\r\n\r\n /** @internal */\r\n addAllCodeSpecs(iModel: IModelDb): Promise<void>;\r\n\r\n /** the code index for this CodeService */\r\n readonly codeIndex: CodeIndex;\r\n\r\n /**\r\n * Application-supplied parameters for obtaining the write lock on the container and for reserving new codes.\r\n * Applications should set these parameters by adding a listener for `BriefcaseDb.onCodeServiceCreated`\r\n * that is called every time a BriefcaseDb that uses code services is opened for write access.\r\n */\r\n readonly appParams: CloudSqlite.ObtainLockParams & CodeService.AuthorAndOrigin;\r\n\r\n /**\r\n * The token that grants access to the cloud container for this CodeService.\r\n * It should be established in a listener for `BriefcaseDb.onCodeServiceCreated`, and should be refreshed (via a\r\n * timer) before it expires.\r\n */\r\n sasToken: AccessToken;\r\n\r\n /**\r\n * Synchronize the local index with any changes by made by others.\r\n * @note This is called automatically whenever any write operation is performed on the code index. It is only necessary to\r\n * call this directly if you have not changed the code index recently, but wish to perform a readonly operation and want to\r\n * ensure it is up-to-date as of now.\r\n * @note There is no guarantee that a readonly index is up-to-date even immediately after calling this method, since others\r\n * may be modifying it at any time.\r\n */\r\n synchronizeWithCloud(): void;\r\n\r\n /**\r\n * Verify that the Code of a to-be-inserted or to-be-updated Element:\r\n * 1. has already been reserved,\r\n * 2. if the element has a `federationGuid`, it must match the reserved value. If the federationGuid is undefined,\r\n * the value from the code index is returned.\r\n *\r\n * If not, throw an exception. Elements with no CodeValue are ignored.\r\n * @note this method is automatically called whenever elements are added or updated by a BriefcaseDb with a CodeService.\r\n */\r\n verifyCode(props: CodeService.ElementCodeProps): void;\r\n\r\n /** Add a new code spec to this code service.\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n */\r\n addCodeSpec(val: CodeService.NameAndJson): Promise<void>;\r\n\r\n /**\r\n * Add all of the codes and code specs from this CodeService's BriefcaseDb into the code index.\r\n * @returns the number of codes actually added.\r\n * @note It is not necessary to call this method unless the BriefcaseDb somehow becomes out of sync with its CodeService,\r\n * for example when migrating iModels to a new code service. It is safe (but relatively expensive) to call this method multiple times, since\r\n * any codes or code specs that are already in the index are ignored.\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n */\r\n addAllCodes(iModel: IModelDb): Promise<number>;\r\n\r\n /**\r\n * Attempt to reserve a single proposed code.\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n * @throws `CodeService.Error` if the proposed code cannot be reserved.\r\n */\r\n reserveCode(code: CodeService.ProposedCode): Promise<void>;\r\n\r\n /**\r\n * Attempt to reserve an array of proposed codes.\r\n * @returns number of codes actually reserved.\r\n * @see the `problems` member of the `CodeService.Error` exception\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n * @note If you have a set of codes to reserve, it is considerably more efficient to do them as an array rather than one at a time.\r\n * @throws `CodeService.Error` if any of the proposed code cannot be reserved. The details for each failed code are in the `problems` member.\r\n */\r\n reserveCodes(arg: CodeService.ReserveCodesArgs): Promise<number>;\r\n\r\n /**\r\n * Attempt to reserve the next available code for a code sequence and scope.\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n */\r\n reserveNextAvailableCode(arg: CodeService.ReserveNextArgs): Promise<void>;\r\n\r\n /**\r\n * Attempt to reserve an array of the next available codes for a code sequence and scope.\r\n * The length of the array determines the number of codes requested. The values for the new codes are returned\r\n * in the array, so they can be associated with the supplied GUIDs.\r\n * @returns number of codes actually reserved.\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n */\r\n reserveNextAvailableCodes(arg: CodeService.ReserveNextArrayArgs): Promise<number>;\r\n\r\n /**\r\n * Update the properties of a single code.\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n */\r\n updateCode(props: CodeService.UpdatedCode): Promise<void>;\r\n\r\n /**\r\n * Update the properties of an array codes.\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n * @note If you have a set of codes to update, it is considerably more efficient to do them as an array rather than one at a time.\r\n * @returns number of codes actually updated.\r\n */\r\n updateCodes(arg: CodeService.UpdateCodesArgs): Promise<number>;\r\n\r\n /** Delete an array of codes by their guids.\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n */\r\n deleteCodes(guid: CodeService.CodeGuid[]): Promise<void>;\r\n}\r\n\r\n/** @alpha */\r\nexport namespace CodeService {\r\n /** @internal */\r\n const codeSequences = new Map<string, CodeSequence>();\r\n\r\n /** @internal */\r\n export let createForIModel: ((db: IModelDb) => CodeService) | undefined;\r\n\r\n /** Register an instance of a`CodeSequence` so it can be looked up by name. */\r\n export function registerSequence(seq: CodeSequence) { codeSequences.set(seq.sequenceName, seq); }\r\n\r\n /** Get a previously registered `CodeSequence` by its name.\r\n * @throws if no sequence by that name was registered.\r\n */\r\n export function getSequence(name: string): CodeSequence {\r\n const seq = codeSequences.get(name);\r\n if (!seq)\r\n throw new Error(\"SequenceNotFound\", -1, `code sequence ${name} not found`);\r\n return seq;\r\n }\r\n\r\n /**\r\n * Turn a `CodePops` for the briefcase of this CodeService into a `ScopeAndSpec` object for use with a CodeService.\r\n * This is necessary because the `spec` member of `CodeProps` refers to the id of a code spec in the iModel, and\r\n * the `scope` member refers to the element Id of the scope element in the iModel. This helper function\r\n * converts the spec Id to the spec name and looks up the `FederationGuid` of the scope element.\r\n */\r\n export function makeScopeAndSpec(iModel: IModelDb, code: CodeProps): CodeService.ScopeAndSpec {\r\n const scope = iModel.elements.getElementProps({ id: code.scope, onlyBaseProperties: true }).federationGuid;\r\n if (undefined === scope)\r\n throw new CodeService.Error(\"MissingGuid\", IModelStatus.InvalidCode, \"code scope element has no federationGuid\");\r\n\r\n return { scope, spec: iModel.codeSpecs.getById(code.spec).name };\r\n }\r\n\r\n /** Turn a `CodeProps` and `ProposedCodeProps` into a `ProposedCode` for use with a CodeService.\r\n * @see [[makeScopeAndSpec]] for explanation of why this is necessary.\r\n */\r\n export function makeProposedCode(arg: CodeService.MakeProposedCodeArgs): CodeService.ProposedCode {\r\n return {\r\n ...arg.props,\r\n value: arg.code.value,\r\n ...makeScopeAndSpec(arg.iModel, arg.code),\r\n };\r\n }\r\n\r\n /** The name of a code spec */\r\n export type CodeSpecName = string;\r\n\r\n /** The name that identifies the \"originator\" of a code. Usually this is the Guid of the iModel from which a code was added,\r\n * but can also be used to identify a system or type from an external code service. */\r\n export type CodeOriginName = string;\r\n\r\n /** The name that identifies the \"author\" of a code. Generally, this is intended to be the name of a person or group that helps identify the purpose of the code. */\r\n export type AuthorName = string;\r\n\r\n /** The value for a code. */\r\n export type CodeValue = string;\r\n\r\n /** The guid for a code. This identifies the real-world entity associated with the code. */\r\n export type CodeGuid = GuidString;\r\n\r\n /** The guid of the scope for a code. This identifies the real-world entity that provides the uniqueness scope for code values. */\r\n export type ScopeGuid = GuidString;\r\n\r\n /** An optional number associated with a code that may be used for \"status\" information. Values must be defined by applications. */\r\n export type CodeState = number;\r\n\r\n /** The return status of an iteration function. The value \"stop\" causes the iteration to terminate. */\r\n export type IterationReturn = void | \"stop\";\r\n\r\n /** An iteration function over codes in a code index. It is called with the Guid of a each code. */\r\n export type CodeIteration = (guid: GuidString) => IterationReturn;\r\n\r\n /** An iteration function over code specs in a code index. It is called with the name and json of a each code spec. */\r\n export type NameAndJsonIteration = (nameAndJson: NameAndJson) => IterationReturn;\r\n\r\n /** Argument for reserving an array of new codes. */\r\n export interface ReserveCodesArgs {\r\n /** an array of proposed codes to reserve.\r\n * @note the guid of each proposed code must be supplied by the caller.\r\n */\r\n readonly codes: CodeService.ProposedCode[];\r\n /** If true, unless all codes are available, don't reserve any codes. Otherwise reserve all available codes. */\r\n readonly allOrNothing?: true;\r\n }\r\n\r\n /** Argument for reserving a code from a code sequence. */\r\n export interface ReserveNextArgs {\r\n /** the properties of the new code */\r\n readonly code: CodeService.ProposedCodeProps;\r\n /** The code sequence and scope for the new code. */\r\n readonly from: SequenceScope;\r\n }\r\n\r\n /** Argument for reserving an array of codes from a code sequence. */\r\n export interface ReserveNextArrayArgs {\r\n /** an array of proposed codes to reserve. */\r\n readonly codes: CodeService.ProposedCodeProps[];\r\n /** The code sequence and scope for the new codes. */\r\n readonly from: CodeService.SequenceScope;\r\n /** If true, and in the event that the code sequence does not have enough available codes to fulfill all the entries in `codes`,\r\n * return as many as possible. Otherwise no codes are reserved. The `problems` member of the exception can be used to determine how many codes were available.\r\n * @note if `asManyAsPossible` is true, no error is thrown if the sequence becomes full. You must check the return value to see how many\r\n * were actually available. The `value` member will be undefined for any proposed codes that were not reserved.\r\n */\r\n readonly asManyAsPossible?: true;\r\n }\r\n\r\n /** Argument for updating an array of codes. */\r\n export interface UpdateCodesArgs {\r\n /** Properties of the codes to update */\r\n readonly props: CodeService.UpdatedCode[];\r\n /** If true, unless all codes are updated, don't update any codes. Otherwise update all possible codes. */\r\n readonly allOrNothing?: true;\r\n }\r\n\r\n /** Arguments for CodeService.makeProposedCode */\r\n export interface MakeProposedCodeArgs {\r\n readonly iModel: IModelDb;\r\n readonly code: Required<CodeProps>;\r\n readonly props: CodeService.CodeGuidStateJson;\r\n }\r\n\r\n /** The properties of an Element to be checked against the code index.\r\n * @see CodeService.verifyCode\r\n */\r\n export interface ElementCodeProps {\r\n /** iModel from which the code is being inserted/updated. */\r\n readonly iModel: IModelDb;\r\n /** Properties of the code */\r\n readonly props: {\r\n /** The imodel-specific code properties. */\r\n readonly code: CodeProps;\r\n /**\r\n * The federationGuid of the element being inserted or updated.\r\n * If federationGuid is defined, it is must match the value in the code index or an error is thrown.\r\n * If it is undefined, the value from the code index is returned here.\r\n */\r\n federationGuid?: GuidString;\r\n };\r\n }\r\n\r\n /** a name and a json object. Used for code specs, authors and origins. */\r\n export interface NameAndJson {\r\n readonly name: string;\r\n readonly json?: SettingObject;\r\n }\r\n\r\n /** A code Scope guid, and code spec name. */\r\n export interface ScopeAndSpec {\r\n readonly spec: CodeSpecName;\r\n readonly scope: ScopeGuid;\r\n }\r\n\r\n /** A code Scope guid, code spec, and code value. */\r\n export interface ScopeSpecAndValue extends ScopeAndSpec {\r\n readonly value: CodeValue;\r\n }\r\n\r\n /** The data held in a code index for a single code. */\r\n export interface CodeEntry {\r\n /** The name of the code spec for this code. */\r\n readonly spec: CodeSpecName;\r\n /** The guid of the entity that provides the scope for this code. */\r\n readonly scope: ScopeGuid;\r\n /** The value of this code. */\r\n readonly value: CodeValue;\r\n /** The guid of the entity this code identifies. */\r\n readonly guid: CodeGuid;\r\n /** the state of the code. May be undefined. */\r\n readonly state?: CodeState;\r\n /** The name of the originating source of this code (usually an iModel Guid). May be undefined. */\r\n readonly origin: CodeOriginName;\r\n /** The name of the author of this code. May be undefined. */\r\n readonly author?: AuthorName;\r\n /** Option json properties associated with this code. May be undefined. */\r\n readonly json?: SettingObject;\r\n }\r\n\r\n /** A filter used to limit and/or sort the values returned by an iteration. */\r\n export interface ValueFilter {\r\n /** A value filter. May include wild cards when used with `GLOB` or `LIKE` */\r\n readonly value?: string;\r\n /** The comparison operator for `value`. Default is `=` */\r\n readonly valueCompare?: \"GLOB\" | \"LIKE\" | \"NOT GLOB\" | \"NOT LIKE\" | \"=\" | \"<\" | \">\";\r\n /** Order results ascending or descending. If not supplied, the results are unordered (random). */\r\n readonly orderBy?: \"ASC\" | \"DESC\";\r\n /** An SQL expression to further filter results. This string is appended to the `WHERE` clause with an `AND` (that should not be part of the sqlExpression) */\r\n readonly sqlExpression?: string;\r\n }\r\n\r\n /** A filter to limit and/or sort the values for the [[CodeIndex.forAllCodes]] iteration. */\r\n export interface CodeFilter extends ValueFilter {\r\n /** If supplied, limit results to only those with this spec */\r\n readonly spec?: CodeSpecName;\r\n /** If supplied, limit results to only those with this scope Guid */\r\n readonly scope?: ScopeGuid;\r\n /** If supplied, limit results to only those with this origin */\r\n readonly origin?: CodeOriginName;\r\n }\r\n\r\n /** Author and origin information supplied when codes are reserved. */\r\n export interface AuthorAndOrigin {\r\n /** The name of the individual or group for whom the code was reserved. */\r\n readonly author: Mutable<NameAndJson>;\r\n /** The identity of the \"originator\" of the code. This is usually a guid of an iModel, but can be any unique string. */\r\n readonly origin: Mutable<NameAndJson>;\r\n }\r\n\r\n /** The Guid, state, and json properties of a code. */\r\n export interface CodeGuidStateJson {\r\n /** The Guid of the new code. This must be always be supplied by the application. */\r\n readonly guid: CodeGuid;\r\n /** An optional value for the state of the code. */\r\n readonly state?: CodeState;\r\n /** An optional json object to be stored with the code. */\r\n readonly json?: SettingObject;\r\n }\r\n\r\n /** Properties of a \"proposed\" new code to be reserved.\r\n * @note the Guid of the entity identified by this code *must* be supplied, but `value` is optional, since\r\n * this may be used to reserve codes from a sequence where the value is generated.\r\n */\r\n export interface ProposedCodeProps extends CodeGuidStateJson {\r\n /** The value for the proposed code.\r\n * @note For code sequence operations, this value is ignored on input and is set with a new value from the sequence on successful return.\r\n */\r\n value?: CodeValue;\r\n }\r\n\r\n /** Properties of a proposed new code that is not from a code sequence (its `value` is required). */\r\n export type ProposedCode = ProposedCodeProps & ScopeSpecAndValue;\r\n\r\n /** Properties that describe a code sequence and a scope and spec for a proposed code or array of codes from a sequence. */\r\n export interface SequenceScope extends ScopeAndSpec {\r\n /** The code sequence. */\r\n readonly seq: CodeSequence;\r\n /** A valid current value. If supplied, the returned value will always be later in the sequence than this. */\r\n readonly start?: CodeValue;\r\n }\r\n\r\n /** Properties of a code to be updated.\r\n * @note The `guid` member identifies the code to be updated and is required.\r\n * All other properties are optional - if `undefined`, its value is not changed.\r\n */\r\n export type UpdatedCode = MarkRequired<Partial<ProposedCode>, \"guid\">;\r\n\r\n /** A proposed code that could not be reserved due to some error. */\r\n export interface ReserveProblem {\r\n /** the proposed code that failed. */\r\n readonly code: ProposedCode;\r\n /** the reason for the failure */\r\n readonly errorId: ErrorId;\r\n /** the error message from the exception for this proposed code. */\r\n readonly message: string;\r\n }\r\n\r\n /** A update to a code that failed for some error. */\r\n export interface UpdateProblem {\r\n /** The properties of the code that was to be updated */\r\n readonly prop: UpdatedCode;\r\n /** the reason for the failure */\r\n readonly errorId: ErrorId;\r\n /** the error message from the exception for the update request. */\r\n readonly message: string;\r\n }\r\n\r\n /**\r\n * A sequence of code values following a increasing pattern. Valid code sequences must have a first value, a last value, and\r\n * a way to get the next valid value from an existing valid value.\r\n * Code sequences have a `sequenceName` so they can be registered using `CodeService.registerSequence`.\r\n */\r\n export interface CodeSequence {\r\n /** the name of this CodeSequence. */\r\n get sequenceName(): string;\r\n /** Get the first valid value for this CodeSequence */\r\n getFirstValue(): CodeValue;\r\n /** Get the last valid value for this CodeSequence */\r\n getLastValue(): CodeValue;\r\n /** Get the next valid value for this CodeSequence from the supplied value.\r\n * If the sequence is full (that is, the next value is greater than the last value, this method should throw with errorId=\"SequenceFull\".\r\n * @return the next valid value according to the rules of this CodeSequence.\r\n */\r\n getNextValue(code: CodeValue): CodeValue;\r\n /** Determine whether this supplied value is valid for this sequence. */\r\n isValidCode(code: CodeValue): boolean;\r\n }\r\n\r\n /** Exception class thrown by `CodeService` methods. */\r\n export class Error extends BentleyError {\r\n /** A string that indicates the type of problem that caused the exception. */\r\n public readonly errorId: ErrorId;\r\n /** For [[CodeService.reserveCodes]] and [[CodeService.updateCodes]], a list of the problem details. */\r\n public readonly problems?: ReserveProblem[] | UpdateProblem[];\r\n\r\n /** @internal */\r\n constructor(errorId: ErrorId, errNum: number, message: string, problems?: ReserveProblem[] | UpdateProblem[]) {\r\n super(errNum, message);\r\n this.errorId = errorId;\r\n this.problems = problems;\r\n }\r\n }\r\n\r\n /** Identifiers for exceptions thrown by `CodeService` methods.\r\n * @see [[CodeService.Error.errorId]]\r\n */\r\n export type ErrorId =\r\n \"BadIndexProps\" |\r\n \"CorruptIModel\" |\r\n \"CorruptIndex\" |\r\n \"DuplicateValue\" |\r\n \"GuidIsInUse\" |\r\n \"GuidMismatch\" |\r\n \"IllegalValue\" |\r\n \"IndexReadonly\" |\r\n \"InvalidCodeScope\" |\r\n \"InvalidGuid\" |\r\n \"InvalidSequence\" |\r\n \"MissingCode\" |\r\n \"MissingGuid\" |\r\n \"MissingInput\" |\r\n \"MissingSpec\" |\r\n \"NoCodeIndex\" |\r\n \"SequenceFull\" |\r\n \"ReserveErrors\" |\r\n \"SequenceNotFound\" |\r\n \"SqlLogicError\" |\r\n \"UpdateErrors\" |\r\n \"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B,mBAM/B,CAAA;IAED;;OAEG;IACH,SAAgB,gBAAgB,CAAC,GAAqC;QACpE,OAAO;YACL,GAAG,GAAG,CAAC,KAAK;YACZ,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK;YACrB,GAAG,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC;SAC1C,CAAC;IACJ,CAAC;IANe,4BAAgB,mBAM/B,CAAA;IAqPD,uDAAuD;IACvD,MAAa,KAAM,SAAQ,2BAAY;QAMrC,gBAAgB;QAChB,YAAY,OAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,QAA6C;YAC1G,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC3B,CAAC;KACF;IAZY,iBAAK,QAYjB,CAAA;AA8BH,CAAC,EA7UgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QA6U3B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { AccessToken, BentleyError, GuidString, IModelStatus, MarkRequired, Mutable } from \"@itwin/core-bentley\";\r\nimport { CodeProps } from \"@itwin/core-common\";\r\nimport { CloudSqlite } from \"./CloudSqlite\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { SettingObject } from \"./workspace/Settings\";\r\n\r\n/**\r\n * A readonly index of all known Codes for an iTwin. The CodeIndex may be slightly out-of-date\r\n * with the master copy in the cloud, but it should be periodically synchronized. Whenever codes are reserved/updated/deleted\r\n * locally, this copy is always up-to-date as of those changes.\r\n * @alpha\r\n */\r\nexport interface CodeIndex {\r\n /**\r\n * Find the next available value for the supplied `SequenceScope`.\r\n * If the sequence is full (there are no available values), this will throw an exception with `errorId=\"SequenceFull\"`\r\n * @param from the sequence and scope to search\r\n * @returns the next available CodeValue in the sequence.\r\n */\r\n findNextAvailable(from: CodeService.SequenceScope): CodeService.CodeValue;\r\n\r\n /**\r\n * Find the highest currently used value for the supplied `SequenceScope`\r\n * @param from the sequence and scope to search\r\n * @returns the highest used value, or undefined if no values have been used.\r\n */\r\n findHighestUsed(from: CodeService.SequenceScope): CodeService.CodeValue | undefined;\r\n\r\n /** Determine whether a code is present in this CodeIndex by its Guid. */\r\n isCodePresent(guid: CodeService.CodeGuid): boolean;\r\n\r\n /** Get the data for a code in this CodeIndex by its Guid.\r\n * @returns the data for the code or undefined if no code is present for the supplied Guid.\r\n */\r\n getCode(guid: CodeService.CodeGuid): CodeService.CodeEntry | undefined;\r\n\r\n /** Look up a code by its Scope, Spec, and Value.\r\n * @returns the Guid of the code, or undefined if not present.\r\n */\r\n findCode(code: CodeService.ScopeSpecAndValue): CodeService.CodeGuid | undefined;\r\n\r\n /** Look up a code spec by its name\r\n * @throws if the spec is not present.\r\n */\r\n getCodeSpec(props: CodeService.CodeSpecName): CodeService.NameAndJson;\r\n\r\n /** Call a `CodeIteration` function for all codes in this index, optionally filtered by a `CodeFilter ` */\r\n forAllCodes(iter: CodeService.CodeIteration, filter?: CodeService.CodeFilter): void;\r\n\r\n /** Call an iteration function for all code specs in this index, optionally filtered by a `ValueFilter ` */\r\n forAllCodeSpecs(iter: CodeService.NameAndJsonIteration, filter?: CodeService.ValueFilter): void;\r\n}\r\n\r\n/**\r\n * The services for querying, reserving, updating, and deleting codes for a BriefcaseDb (available via `BriefcaseDb.codeService`) whenever it is opened for write access.\r\n * @alpha\r\n */\r\nexport interface CodeService {\r\n /** @internal */\r\n close: () => void;\r\n\r\n /** @internal */\r\n addAllCodeSpecs(iModel: IModelDb): Promise<void>;\r\n\r\n /** the code index for this CodeService */\r\n readonly codeIndex: CodeIndex;\r\n\r\n /**\r\n * Application-supplied parameters for obtaining the write lock on the container and for reserving new codes.\r\n * Applications should set these parameters by adding a listener for `BriefcaseDb.onCodeServiceCreated`\r\n * that is called every time a BriefcaseDb that uses code services is opened for write access.\r\n */\r\n readonly appParams: CloudSqlite.ObtainLockParams & CodeService.AuthorAndOrigin;\r\n\r\n /**\r\n * The token that grants access to the cloud container for this CodeService.\r\n * It should be established in a listener for `BriefcaseDb.onCodeServiceCreated`, and should be refreshed (via a\r\n * timer) before it expires.\r\n */\r\n sasToken: AccessToken;\r\n\r\n /**\r\n * Synchronize the local index with any changes by made by others.\r\n * @note This is called automatically whenever any write operation is performed on the code index. It is only necessary to\r\n * call this directly if you have not changed the code index recently, but wish to perform a readonly operation and want to\r\n * ensure it is up-to-date as of now.\r\n * @note There is no guarantee that a readonly index is up-to-date even immediately after calling this method, since others\r\n * may be modifying it at any time.\r\n */\r\n synchronizeWithCloud(): void;\r\n\r\n /**\r\n * Verify that the Code of a to-be-inserted or to-be-updated Element:\r\n * 1. has already been reserved,\r\n * 2. if the element has a `federationGuid`, it must match the reserved value. If the federationGuid is undefined,\r\n * the value from the code index is returned.\r\n *\r\n * If not, throw an exception. Elements with no CodeValue are ignored.\r\n * @note this method is automatically called whenever elements are added or updated by a BriefcaseDb with a CodeService.\r\n */\r\n verifyCode(props: CodeService.ElementCodeProps): void;\r\n\r\n /** Add a new code spec to this code service.\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n */\r\n addCodeSpec(val: CodeService.NameAndJson): Promise<void>;\r\n\r\n /**\r\n * Add all of the codes and code specs from this CodeService's BriefcaseDb into the code index.\r\n * @returns the number of codes actually added.\r\n * @note It is not necessary to call this method unless the BriefcaseDb somehow becomes out of sync with its CodeService,\r\n * for example when migrating iModels to a new code service. It is safe (but relatively expensive) to call this method multiple times, since\r\n * any codes or code specs that are already in the index are ignored.\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n */\r\n addAllCodes(iModel: IModelDb): Promise<number>;\r\n\r\n /**\r\n * Attempt to reserve a single proposed code.\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n * @throws `CodeService.Error` if the proposed code cannot be reserved.\r\n */\r\n reserveCode(code: CodeService.ProposedCode): Promise<void>;\r\n\r\n /**\r\n * Attempt to reserve an array of proposed codes.\r\n * @returns number of codes actually reserved.\r\n * @see the `problems` member of the `CodeService.Error` exception\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n * @note If you have a set of codes to reserve, it is considerably more efficient to do them as an array rather than one at a time.\r\n * @throws `CodeService.Error` if any of the proposed code cannot be reserved. The details for each failed code are in the `problems` member.\r\n */\r\n reserveCodes(arg: CodeService.ReserveCodesArgs): Promise<number>;\r\n\r\n /**\r\n * Attempt to reserve the next available code for a code sequence and scope.\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n */\r\n reserveNextAvailableCode(arg: CodeService.ReserveNextArgs): Promise<void>;\r\n\r\n /**\r\n * Attempt to reserve an array of the next available codes for a code sequence and scope.\r\n * The length of the array determines the number of codes requested. The values for the new codes are returned\r\n * in the array, so they can be associated with the supplied GUIDs.\r\n * @returns number of codes actually reserved.\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n */\r\n reserveNextAvailableCodes(arg: CodeService.ReserveNextArrayArgs): Promise<number>;\r\n\r\n /**\r\n * Update the properties of a single code.\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n */\r\n updateCode(props: CodeService.UpdatedCode): Promise<void>;\r\n\r\n /**\r\n * Update the properties of an array codes.\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n * @note If you have a set of codes to update, it is considerably more efficient to do them as an array rather than one at a time.\r\n * @returns number of codes actually updated.\r\n */\r\n updateCodes(arg: CodeService.UpdateCodesArgs): Promise<number>;\r\n\r\n /** Delete an array of codes by their guids.\r\n * @note This will automatically attempt to obtain, perform the operation, and then release the write lock.\r\n */\r\n deleteCodes(guid: CodeService.CodeGuid[]): Promise<void>;\r\n}\r\n\r\n/** @alpha */\r\nexport namespace CodeService {\r\n /** @internal */\r\n const codeSequences = new Map<string, CodeSequence>();\r\n\r\n /** @internal */\r\n export let createForIModel: ((db: IModelDb) => CodeService) | undefined;\r\n\r\n /** Register an instance of a`CodeSequence` so it can be looked up by name. */\r\n export function registerSequence(seq: CodeSequence) {\r\n codeSequences.set(seq.sequenceName, seq);\r\n }\r\n\r\n /** Get a previously registered `CodeSequence` by its name.\r\n * @throws if no sequence by that name was registered.\r\n */\r\n export function getSequence(name: string): CodeSequence {\r\n const seq = codeSequences.get(name);\r\n if (!seq)\r\n throw new Error(\"SequenceNotFound\", -1, `code sequence ${name} not found`);\r\n return seq;\r\n }\r\n\r\n /**\r\n * Turn a `CodePops` for the briefcase of this CodeService into a `ScopeAndSpec` object for use with a CodeService.\r\n * This is necessary because the `spec` member of `CodeProps` refers to the id of a code spec in the iModel, and\r\n * the `scope` member refers to the element Id of the scope element in the iModel. This helper function\r\n * converts the spec Id to the spec name and looks up the `FederationGuid` of the scope element.\r\n */\r\n export function makeScopeAndSpec(iModel: IModelDb, code: CodeProps): CodeService.ScopeAndSpec {\r\n const scope = iModel.elements.getElementProps({ id: code.scope, onlyBaseProperties: true }).federationGuid;\r\n if (undefined === scope)\r\n throw new CodeService.Error(\"MissingGuid\", IModelStatus.InvalidCode, \"code scope element has no federationGuid\");\r\n\r\n return { scope, spec: iModel.codeSpecs.getById(code.spec).name };\r\n }\r\n\r\n /** Turn a `CodeProps` and `ProposedCodeProps` into a `ProposedCode` for use with a CodeService.\r\n * @see [[makeScopeAndSpec]] for explanation of why this is necessary.\r\n */\r\n export function makeProposedCode(arg: CodeService.MakeProposedCodeArgs): CodeService.ProposedCode {\r\n return {\r\n ...arg.props,\r\n value: arg.code.value,\r\n ...makeScopeAndSpec(arg.iModel, arg.code),\r\n };\r\n }\r\n\r\n /** The name of a code spec */\r\n export type CodeSpecName = string;\r\n\r\n /** The name that identifies the \"originator\" of a code. Usually this is the Guid of the iModel from which a code was added,\r\n * but can also be used to identify a system or type from an external code service. */\r\n export type CodeOriginName = string;\r\n\r\n /** The name that identifies the \"author\" of a code. Generally, this is intended to be the name of a person or group that helps identify the purpose of the code. */\r\n export type AuthorName = string;\r\n\r\n /** The value for a code. */\r\n export type CodeValue = string;\r\n\r\n /** The guid for a code. This identifies the real-world entity associated with the code. */\r\n export type CodeGuid = GuidString;\r\n\r\n /** The guid of the scope for a code. This identifies the real-world entity that provides the uniqueness scope for code values. */\r\n export type ScopeGuid = GuidString;\r\n\r\n /** An optional number associated with a code that may be used for \"status\" information. Values must be defined by applications. */\r\n export type CodeState = number;\r\n\r\n /** The return status of an iteration function. The value \"stop\" causes the iteration to terminate. */\r\n export type IterationReturn = void | \"stop\";\r\n\r\n /** An iteration function over codes in a code index. It is called with the Guid of a each code. */\r\n export type CodeIteration = (guid: GuidString) => IterationReturn;\r\n\r\n /** An iteration function over code specs in a code index. It is called with the name and json of a each code spec. */\r\n export type NameAndJsonIteration = (nameAndJson: NameAndJson) => IterationReturn;\r\n\r\n /** Argument for reserving an array of new codes. */\r\n export interface ReserveCodesArgs {\r\n /** an array of proposed codes to reserve.\r\n * @note the guid of each proposed code must be supplied by the caller.\r\n */\r\n readonly codes: CodeService.ProposedCode[];\r\n /** If true, unless all codes are available, don't reserve any codes. Otherwise reserve all available codes. */\r\n readonly allOrNothing?: true;\r\n }\r\n\r\n /** Argument for reserving a code from a code sequence. */\r\n export interface ReserveNextArgs {\r\n /** the properties of the new code */\r\n readonly code: CodeService.ProposedCodeProps;\r\n /** The code sequence and scope for the new code. */\r\n readonly from: SequenceScope;\r\n }\r\n\r\n /** Argument for reserving an array of codes from a code sequence. */\r\n export interface ReserveNextArrayArgs {\r\n /** an array of proposed codes to reserve. */\r\n readonly codes: CodeService.ProposedCodeProps[];\r\n /** The code sequence and scope for the new codes. */\r\n readonly from: CodeService.SequenceScope;\r\n /** If true, and in the event that the code sequence does not have enough available codes to fulfill all the entries in `codes`,\r\n * return as many as possible. Otherwise no codes are reserved. The `problems` member of the exception can be used to determine how many codes were available.\r\n * @note if `asManyAsPossible` is true, no error is thrown if the sequence becomes full. You must check the return value to see how many\r\n * were actually available. The `value` member will be undefined for any proposed codes that were not reserved.\r\n */\r\n readonly asManyAsPossible?: true;\r\n }\r\n\r\n /** Argument for updating an array of codes. */\r\n export interface UpdateCodesArgs {\r\n /** Properties of the codes to update */\r\n readonly props: CodeService.UpdatedCode[];\r\n /** If true, unless all codes are updated, don't update any codes. Otherwise update all possible codes. */\r\n readonly allOrNothing?: true;\r\n }\r\n\r\n /** Arguments for CodeService.makeProposedCode */\r\n export interface MakeProposedCodeArgs {\r\n readonly iModel: IModelDb;\r\n readonly code: Required<CodeProps>;\r\n readonly props: CodeService.CodeGuidStateJson;\r\n }\r\n\r\n /** The properties of an Element to be checked against the code index.\r\n * @see CodeService.verifyCode\r\n */\r\n export interface ElementCodeProps {\r\n /** iModel from which the code is being inserted/updated. */\r\n readonly iModel: IModelDb;\r\n /** Properties of the code */\r\n readonly props: {\r\n /** The imodel-specific code properties. */\r\n readonly code: CodeProps;\r\n /**\r\n * The federationGuid of the element being inserted or updated.\r\n * If federationGuid is defined, it is must match the value in the code index or an error is thrown.\r\n * If it is undefined, the value from the code index is returned here.\r\n */\r\n federationGuid?: GuidString;\r\n };\r\n }\r\n\r\n /** a name and a json object. Used for code specs, authors and origins. */\r\n export interface NameAndJson {\r\n readonly name: string;\r\n readonly json?: SettingObject;\r\n }\r\n\r\n /** A code Scope guid, and code spec name. */\r\n export interface ScopeAndSpec {\r\n readonly spec: CodeSpecName;\r\n readonly scope: ScopeGuid;\r\n }\r\n\r\n /** A code Scope guid, code spec, and code value. */\r\n export interface ScopeSpecAndValue extends ScopeAndSpec {\r\n readonly value: CodeValue;\r\n }\r\n\r\n /** The data held in a code index for a single code. */\r\n export interface CodeEntry {\r\n /** The name of the code spec for this code. */\r\n readonly spec: CodeSpecName;\r\n /** The guid of the entity that provides the scope for this code. */\r\n readonly scope: ScopeGuid;\r\n /** The value of this code. */\r\n readonly value: CodeValue;\r\n /** The guid of the entity this code identifies. */\r\n readonly guid: CodeGuid;\r\n /** the state of the code. May be undefined. */\r\n readonly state?: CodeState;\r\n /** The name of the originating source of this code (usually an iModel Guid). May be undefined. */\r\n readonly origin: CodeOriginName;\r\n /** The name of the author of this code. May be undefined. */\r\n readonly author?: AuthorName;\r\n /** Option json properties associated with this code. May be undefined. */\r\n readonly json?: SettingObject;\r\n }\r\n\r\n /** A filter used to limit and/or sort the values returned by an iteration. */\r\n export interface ValueFilter {\r\n /** A value filter. May include wild cards when used with `GLOB` or `LIKE` */\r\n readonly value?: string;\r\n /** The comparison operator for `value`. Default is `=` */\r\n readonly valueCompare?: \"GLOB\" | \"LIKE\" | \"NOT GLOB\" | \"NOT LIKE\" | \"=\" | \"<\" | \">\";\r\n /** Order results ascending or descending. If not supplied, the results are unordered (random). */\r\n readonly orderBy?: \"ASC\" | \"DESC\";\r\n /** An SQL expression to further filter results. This string is appended to the `WHERE` clause with an `AND` (that should not be part of the sqlExpression) */\r\n readonly sqlExpression?: string;\r\n }\r\n\r\n /** A filter to limit and/or sort the values for the [[CodeIndex.forAllCodes]] iteration. */\r\n export interface CodeFilter extends ValueFilter {\r\n /** If supplied, limit results to only those with this spec */\r\n readonly spec?: CodeSpecName;\r\n /** If supplied, limit results to only those with this scope Guid */\r\n readonly scope?: ScopeGuid;\r\n /** If supplied, limit results to only those with this origin */\r\n readonly origin?: CodeOriginName;\r\n }\r\n\r\n /** Author and origin information supplied when codes are reserved. */\r\n export interface AuthorAndOrigin {\r\n /** The name of the individual or group for whom the code was reserved. */\r\n readonly author: Mutable<NameAndJson>;\r\n /** The identity of the \"originator\" of the code. This is usually a guid of an iModel, but can be any unique string. */\r\n readonly origin: Mutable<NameAndJson>;\r\n }\r\n\r\n /** The Guid, state, and json properties of a code. */\r\n export interface CodeGuidStateJson {\r\n /** The Guid of the new code. This must be always be supplied by the application. */\r\n readonly guid: CodeGuid;\r\n /** An optional value for the state of the code. */\r\n readonly state?: CodeState;\r\n /** An optional json object to be stored with the code. */\r\n readonly json?: SettingObject;\r\n }\r\n\r\n /** Properties of a \"proposed\" new code to be reserved.\r\n * @note the Guid of the entity identified by this code *must* be supplied, but `value` is optional, since\r\n * this may be used to reserve codes from a sequence where the value is generated.\r\n */\r\n export interface ProposedCodeProps extends CodeGuidStateJson {\r\n /** The value for the proposed code.\r\n * @note For code sequence operations, this value is ignored on input and is set with a new value from the sequence on successful return.\r\n */\r\n value?: CodeValue;\r\n }\r\n\r\n /** Properties of a proposed new code that is not from a code sequence (its `value` is required). */\r\n export type ProposedCode = ProposedCodeProps & ScopeSpecAndValue;\r\n\r\n /** Properties that describe a code sequence and a scope and spec for a proposed code or array of codes from a sequence. */\r\n export interface SequenceScope extends ScopeAndSpec {\r\n /** The code sequence. */\r\n readonly seq: CodeSequence;\r\n /** A valid current value. If supplied, the returned value will always be later in the sequence than this. */\r\n readonly start?: CodeValue;\r\n }\r\n\r\n /** Properties of a code to be updated.\r\n * @note The `guid` member identifies the code to be updated and is required.\r\n * All other properties are optional - if `undefined`, its value is not changed.\r\n */\r\n export type UpdatedCode = MarkRequired<Partial<ProposedCode>, \"guid\">;\r\n\r\n /** A proposed code that could not be reserved due to some error. */\r\n export interface ReserveProblem {\r\n /** the proposed code that failed. */\r\n readonly code: ProposedCode;\r\n /** the reason for the failure */\r\n readonly errorId: ErrorId;\r\n /** the error message from the exception for this proposed code. */\r\n readonly message: string;\r\n }\r\n\r\n /** A update to a code that failed for some error. */\r\n export interface UpdateProblem {\r\n /** The properties of the code that was to be updated */\r\n readonly prop: UpdatedCode;\r\n /** the reason for the failure */\r\n readonly errorId: ErrorId;\r\n /** the error message from the exception for the update request. */\r\n readonly message: string;\r\n }\r\n\r\n /**\r\n * A sequence of code values following a increasing pattern. Valid code sequences must have a first value, a last value, and\r\n * a way to get the next valid value from an existing valid value.\r\n * Code sequences have a `sequenceName` so they can be registered using `CodeService.registerSequence`.\r\n */\r\n export interface CodeSequence {\r\n /** the name of this CodeSequence. */\r\n get sequenceName(): string;\r\n /** Get the first valid value for this CodeSequence */\r\n getFirstValue(): CodeValue;\r\n /** Get the last valid value for this CodeSequence */\r\n getLastValue(): CodeValue;\r\n /** Get the next valid value for this CodeSequence from the supplied value.\r\n * If the sequence is full (that is, the next value is greater than the last value, this method should throw with errorId=\"SequenceFull\".\r\n * @return the next valid value according to the rules of this CodeSequence.\r\n */\r\n getNextValue(code: CodeValue): CodeValue;\r\n /** Determine whether this supplied value is valid for this sequence. */\r\n isValidCode(code: CodeValue): boolean;\r\n }\r\n\r\n /** Exception class thrown by `CodeService` methods. */\r\n export class Error extends BentleyError {\r\n /** A string that indicates the type of problem that caused the exception. */\r\n public readonly errorId: ErrorId;\r\n /** For [[CodeService.reserveCodes]] and [[CodeService.updateCodes]], a list of the problem details. */\r\n public readonly problems?: ReserveProblem[] | UpdateProblem[];\r\n\r\n /** @internal */\r\n constructor(errorId: ErrorId, errNum: number, message: string, problems?: ReserveProblem[] | UpdateProblem[]) {\r\n super(errNum, message);\r\n this.errorId = errorId;\r\n this.problems = problems;\r\n }\r\n }\r\n\r\n /** Identifiers for exceptions thrown by `CodeService` methods.\r\n * @see [[CodeService.Error.errorId]]\r\n */\r\n export type ErrorId =\r\n \"BadIndexProps\" |\r\n \"CorruptIModel\" |\r\n \"CorruptIndex\" |\r\n \"DuplicateValue\" |\r\n \"GuidIsInUse\" |\r\n \"GuidMismatch\" |\r\n \"IllegalValue\" |\r\n \"IndexReadonly\" |\r\n \"InvalidCodeScope\" |\r\n \"InvalidGuid\" |\r\n \"InvalidSequence\" |\r\n \"MissingCode\" |\r\n \"MissingGuid\" |\r\n \"MissingInput\" |\r\n \"MissingSpec\" |\r\n \"NoCodeIndex\" |\r\n \"SequenceFull\" |\r\n \"ReserveErrors\" |\r\n \"SequenceNotFound\" |\r\n \"SqlLogicError\" |\r\n \"UpdateErrors\" |\r\n \"ValueIsInUse\" |\r\n \"WrongVersion\";\r\n\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CustomViewState3dCreator.d.ts","sourceRoot":"","sources":["../../src/CustomViewState3dCreator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,+BAA+B,EAAE,sBAAsB,EAA6C,MAAM,oBAAoB,CAAC;AAGxI,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC;;;GAGG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,OAAO,CAAW;gBACP,MAAM,EAAE,QAAQ;IAGnC;;;;;OAKG;IACU,wBAAwB,CAAC,OAAO,EAAE,+BAA+B,GAAG,OAAO,CAAC,sBAAsB,CAAC;YAclG,iBAAiB;IAS/B;;;;OAIG;YACW,gBAAgB;IAwB9B;;OAEG;YACW,aAAa;IAgB3B;;OAEG;IACH,OAAO,CAAC,aAAa,CAMnB;CACH"}
1
+ {"version":3,"file":"CustomViewState3dCreator.d.ts","sourceRoot":"","sources":["../../src/CustomViewState3dCreator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,+BAA+B,EAAE,sBAAsB,EAA6C,MAAM,oBAAoB,CAAC;AAGxI,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC;;;GAGG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,OAAO,CAAW;gBACP,MAAM,EAAE,QAAQ;IAGnC;;;;;OAKG;IACU,wBAAwB,CAAC,OAAO,EAAE,+BAA+B,GAAG,OAAO,CAAC,sBAAsB,CAAC;YAclG,iBAAiB;IAS/B;;;;OAIG;YACW,gBAAgB;IA+B9B;;OAEG;YACW,aAAa;IAgB3B;;OAEG;IACH,OAAO,CAAC,aAAa,CAMnB;CACH"}
@@ -64,23 +64,29 @@ class CustomViewState3dCreator {
64
64
  if (modelIdsList.length === 0)
65
65
  return modelExtents;
66
66
  const modelIds = new Set(modelIdsList);
67
- core_bentley_1.Logger.logInfo(loggerCategory, "Starting getModelExtents query.");
68
67
  for (const id of modelIds) {
68
+ const modelExtentsStopWatch = new core_bentley_1.StopWatch("getModelExtents query", false);
69
69
  try {
70
70
  await new Promise((resolve) => setImmediate(resolve)); // Free up main thread temporarily. Ideally we get queryModelExtents off the main thread and do not need to do this.
71
+ core_bentley_1.Logger.logInfo(loggerCategory, "Starting getModelExtents query.", { modelId: id });
72
+ modelExtentsStopWatch.start();
71
73
  const props = this._imodel.nativeDb.queryModelExtents({ id }).modelExtents;
74
+ modelExtentsStopWatch.stop();
75
+ core_bentley_1.Logger.logInfo(loggerCategory, "Finished getModelExtents query.", { timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id });
72
76
  modelExtents.union(core_geometry_1.Range3d.fromJSON(props), modelExtents);
73
77
  }
74
78
  catch (err) {
79
+ modelExtentsStopWatch.stop();
75
80
  if (err.errorNumber === core_common_1.IModelStatus.NoGeometry) { // if there was no geometry, just return null range
81
+ core_bentley_1.Logger.logInfo(loggerCategory, "Finished getModelExtents query with NoGeometry error.", { timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id });
76
82
  continue;
77
83
  }
84
+ core_bentley_1.Logger.logInfo(loggerCategory, "Finished getModelExtents query with error.", { timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id, errorMessage: err === null || err === void 0 ? void 0 : err.message, errorNumber: err === null || err === void 0 ? void 0 : err.errorNumber });
78
85
  if (modelIds.size === 1)
79
86
  throw err; // if they're asking for more than one model, don't throw on error.
80
87
  continue;
81
88
  }
82
89
  }
83
- core_bentley_1.Logger.logInfo(loggerCategory, "Finished getModelExtents query.");
84
90
  return modelExtents;
85
91
  }
86
92
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CustomViewState3dCreator.js","sourceRoot":"","sources":["../../src/CustomViewState3dCreator.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAAuF;AACvF,oDAAwI;AACxI,wDAA+C;AAC/C,mEAAgE;AAGhE,MAAM,cAAc,GAAG,6CAAqB,CAAC,wBAAwB,CAAC;AAEtE;;;GAGG;AACH,MAAa,wBAAwB;IAEnC,YAAmB,MAAg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AyF;QACzF,sGAAsG;QACtG,6JAA6J;QAC7J,MAAM,MAAM,GAAG,8FAA8F,CAAC;QAC9G,MAAM,gBAAgB,GAAG,sEAAsE,CAAC;QAChG,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,8BAA8B,CAAC,CAAC;QAC/D,IAAI;YACF,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,MAAM,IAAI,gBAAgB,EAAE,CAAC,CAAC;SACpE;QAAC,MAAM;YACN,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;SAC3C;QACD,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,8BAA8B,CAAC,CAAC;QAC/D,OAAO,MAAM,CAAC;IAChB,CAAC;CAWF;AA5FD,4DA4FC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { CompressedId64Set, Id64Array, Id64String, Logger } from \"@itwin/core-bentley\";\r\nimport { CustomViewState3dCreatorOptions, CustomViewState3dProps, IModelError, IModelStatus, QueryRowFormat } from \"@itwin/core-common\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { IModelDb } from \"./IModelDb\";\r\n\r\nconst loggerCategory = BackendLoggerCategory.CustomViewState3dCreator;\r\n\r\n/**\r\n * Class which helps to generate a custom ViewState3d.\r\n * @internal\r\n */\r\nexport class CustomViewState3dCreator {\r\n private _imodel: IModelDb;\r\n public constructor(iModel: IModelDb) {\r\n this._imodel = iModel;\r\n }\r\n /**\r\n * Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.\r\n * @param [modelIds] Ids of models to display in the view.\r\n * @throws [IModelError]($common) If no 3d models are found in the iModel.\r\n * @returns CustomViewState3dProps\r\n */\r\n public async getCustomViewState3dData(options: CustomViewState3dCreatorOptions): Promise<CustomViewState3dProps> {\r\n let decompressedModelIds;\r\n if (options?.modelIds !== undefined)\r\n decompressedModelIds = CompressedId64Set.decompressArray(options.modelIds);\r\n const models: Id64Array = decompressedModelIds ?? await this._getAllModels();\r\n const categories: Id64Array = await this._getAllCategories();\r\n const modelExtents: Range3d = await this._getModelExtents(models);\r\n return {\r\n modelIds: CompressedId64Set.sortAndCompress(models),\r\n categoryIds: CompressedId64Set.sortAndCompress(categories),\r\n modelExtents: modelExtents.toJSON(),\r\n };\r\n }\r\n\r\n private async _getAllCategories(): Promise<Id64Array> {\r\n // Only use categories with elements in them\r\n Logger.logInfo(loggerCategory, \"Starting getAllCategories query.\");\r\n const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;\r\n const categories: Id64Array = await this._executeQuery(query);\r\n Logger.logInfo(loggerCategory, \"Finished getAllCategories query.\");\r\n return categories;\r\n }\r\n\r\n /**\r\n * Gets the union of the extents of each model id passed in. Can return null range if no ids are passed, or no geometry found for the models.\r\n * @param modelIdsList array of modelIds to get extents for\r\n * @returns Range3d, the union of the extents of each model id\r\n */\r\n private async _getModelExtents(modelIdsList: Id64String[]): Promise<Range3d> {\r\n const modelExtents = new Range3d();\r\n if (modelIdsList.length === 0)\r\n return modelExtents;\r\n const modelIds = new Set(modelIdsList);\r\n Logger.logInfo(loggerCategory, \"Starting getModelExtents query.\");\r\n for (const id of modelIds) {\r\n try {\r\n await new Promise((resolve) => setImmediate(resolve)); // Free up main thread temporarily. Ideally we get queryModelExtents off the main thread and do not need to do this.\r\n const props = this._imodel.nativeDb.queryModelExtents({ id }).modelExtents;\r\n modelExtents.union(Range3d.fromJSON(props), modelExtents);\r\n } catch (err: any) {\r\n if ((err as IModelError).errorNumber === IModelStatus.NoGeometry) { // if there was no geometry, just return null range\r\n continue;\r\n }\r\n if (modelIds.size === 1)\r\n throw err; // if they're asking for more than one model, don't throw on error.\r\n continue;\r\n }\r\n }\r\n Logger.logInfo(loggerCategory, \"Finished getModelExtents query.\");\r\n return modelExtents;\r\n }\r\n\r\n /**\r\n * Get all PhysicalModel ids in the iModel\r\n */\r\n private async _getAllModels(): Promise<Id64Array> {\r\n // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.\r\n // If the iModel has an earlier version, the statement will throw because the property does not exist.\r\n // If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.\r\n const select = \"SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false\";\r\n const spatialCriterion = \"AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)\";\r\n let models = [];\r\n Logger.logInfo(loggerCategory, \"Starting getAllModels query.\");\r\n try {\r\n models = await this._executeQuery(`${select} ${spatialCriterion}`);\r\n } catch {\r\n models = await this._executeQuery(select);\r\n }\r\n Logger.logInfo(loggerCategory, \"Finished getAllModels query.\");\r\n return models;\r\n }\r\n /**\r\n * Helper function to execute ECSql queries.\r\n */\r\n private _executeQuery = async (query: string) => {\r\n const rows = [];\r\n for await (const row of this._imodel.query(query, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames }))\r\n rows.push(row.id);\r\n\r\n return rows;\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"CustomViewState3dCreator.js","sourceRoot":"","sources":["../../src/CustomViewState3dCreator.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAAkG;AAClG,oDAAwI;AACxI,wDAA+C;AAC/C,mEAAgE;AAGhE,MAAM,cAAc,GAAG,6CAAqB,CAAC,wBAAwB,CAAC;AAEtE;;;GAGG;AACH,MAAa,wBAAwB;IAEnC,YAAmB,MAAgB;QAuFnC;;WAEG;QACK,kBAAa,GAAG,KAAK,EAAE,KAAa,EAAE,EAAE;YAC9C,MAAM,IA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AC,UAAU,EAAE,EAAE,mDAAmD;oBACrH,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,uDAAuD,EAAE,EAAC,aAAa,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAC,CAAC,CAAC;oBACrJ,SAAS;iBACV;gBACD,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,4CAA4C,EAAE,EAAC,aAAa,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,EAAE,WAAW,EAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,WAAW,EAAC,CAAC,CAAC;gBAErM,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC;oBACrB,MAAM,GAAG,CAAC,CAAC,mEAAmE;gBAChF,SAAS;aACV;SACF;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,aAAa;QACzB,yFAAyF;QACzF,sGAAsG;QACtG,6JAA6J;QAC7J,MAAM,MAAM,GAAG,8FAA8F,CAAC;QAC9G,MAAM,gBAAgB,GAAG,sEAAsE,CAAC;QAChG,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,8BAA8B,CAAC,CAAC;QAC/D,IAAI;YACF,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,MAAM,IAAI,gBAAgB,EAAE,CAAC,CAAC;SACpE;QAAC,MAAM;YACN,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;SAC3C;QACD,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,8BAA8B,CAAC,CAAC;QAC/D,OAAO,MAAM,CAAC;IAChB,CAAC;CAWF;AAnGD,4DAmGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { CompressedId64Set, Id64Array, Id64String, Logger, StopWatch } from \"@itwin/core-bentley\";\r\nimport { CustomViewState3dCreatorOptions, CustomViewState3dProps, IModelError, IModelStatus, QueryRowFormat } from \"@itwin/core-common\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { IModelDb } from \"./IModelDb\";\r\n\r\nconst loggerCategory = BackendLoggerCategory.CustomViewState3dCreator;\r\n\r\n/**\r\n * Class which helps to generate a custom ViewState3d.\r\n * @internal\r\n */\r\nexport class CustomViewState3dCreator {\r\n private _imodel: IModelDb;\r\n public constructor(iModel: IModelDb) {\r\n this._imodel = iModel;\r\n }\r\n /**\r\n * Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.\r\n * @param [modelIds] Ids of models to display in the view.\r\n * @throws [IModelError]($common) If no 3d models are found in the iModel.\r\n * @returns CustomViewState3dProps\r\n */\r\n public async getCustomViewState3dData(options: CustomViewState3dCreatorOptions): Promise<CustomViewState3dProps> {\r\n let decompressedModelIds;\r\n if (options?.modelIds !== undefined)\r\n decompressedModelIds = CompressedId64Set.decompressArray(options.modelIds);\r\n const models: Id64Array = decompressedModelIds ?? await this._getAllModels();\r\n const categories: Id64Array = await this._getAllCategories();\r\n const modelExtents: Range3d = await this._getModelExtents(models);\r\n return {\r\n modelIds: CompressedId64Set.sortAndCompress(models),\r\n categoryIds: CompressedId64Set.sortAndCompress(categories),\r\n modelExtents: modelExtents.toJSON(),\r\n };\r\n }\r\n\r\n private async _getAllCategories(): Promise<Id64Array> {\r\n // Only use categories with elements in them\r\n Logger.logInfo(loggerCategory, \"Starting getAllCategories query.\");\r\n const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;\r\n const categories: Id64Array = await this._executeQuery(query);\r\n Logger.logInfo(loggerCategory, \"Finished getAllCategories query.\");\r\n return categories;\r\n }\r\n\r\n /**\r\n * Gets the union of the extents of each model id passed in. Can return null range if no ids are passed, or no geometry found for the models.\r\n * @param modelIdsList array of modelIds to get extents for\r\n * @returns Range3d, the union of the extents of each model id\r\n */\r\n private async _getModelExtents(modelIdsList: Id64String[]): Promise<Range3d> {\r\n const modelExtents = new Range3d();\r\n if (modelIdsList.length === 0)\r\n return modelExtents;\r\n const modelIds = new Set(modelIdsList);\r\n for (const id of modelIds) {\r\n const modelExtentsStopWatch = new StopWatch(\"getModelExtents query\", false);\r\n try {\r\n await new Promise((resolve) => setImmediate(resolve)); // Free up main thread temporarily. Ideally we get queryModelExtents off the main thread and do not need to do this.\r\n Logger.logInfo(loggerCategory, \"Starting getModelExtents query.\", {modelId: id});\r\n modelExtentsStopWatch.start();\r\n const props = this._imodel.nativeDb.queryModelExtents({ id }).modelExtents;\r\n modelExtentsStopWatch.stop();\r\n Logger.logInfo(loggerCategory, \"Finished getModelExtents query.\", {timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id});\r\n modelExtents.union(Range3d.fromJSON(props), modelExtents);\r\n } catch (err: any) {\r\n modelExtentsStopWatch.stop();\r\n if ((err as IModelError).errorNumber === IModelStatus.NoGeometry) { // if there was no geometry, just return null range\r\n Logger.logInfo(loggerCategory, \"Finished getModelExtents query with NoGeometry error.\", {timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id});\r\n continue;\r\n }\r\n Logger.logInfo(loggerCategory, \"Finished getModelExtents query with error.\", {timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id, errorMessage: err?.message, errorNumber: err?.errorNumber});\r\n\r\n if (modelIds.size === 1)\r\n throw err; // if they're asking for more than one model, don't throw on error.\r\n continue;\r\n }\r\n }\r\n return modelExtents;\r\n }\r\n\r\n /**\r\n * Get all PhysicalModel ids in the iModel\r\n */\r\n private async _getAllModels(): Promise<Id64Array> {\r\n // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.\r\n // If the iModel has an earlier version, the statement will throw because the property does not exist.\r\n // If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.\r\n const select = \"SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false\";\r\n const spatialCriterion = \"AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)\";\r\n let models = [];\r\n Logger.logInfo(loggerCategory, \"Starting getAllModels query.\");\r\n try {\r\n models = await this._executeQuery(`${select} ${spatialCriterion}`);\r\n } catch {\r\n models = await this._executeQuery(select);\r\n }\r\n Logger.logInfo(loggerCategory, \"Finished getAllModels query.\");\r\n return models;\r\n }\r\n /**\r\n * Helper function to execute ECSql queries.\r\n */\r\n private _executeQuery = async (query: string) => {\r\n const rows = [];\r\n for await (const row of this._imodel.query(query, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames }))\r\n rows.push(row.id);\r\n\r\n return rows;\r\n };\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DevTools.d.ts","sourceRoot":"","sources":["../../src/DevTools.ts"],"names":[],"mappings":";AAKA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,OAAO,EAAU,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAYvD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,eAAe,CAAC;IACpB,OAAO,EAAE,oBAAoB,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,CA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AC,MAAM,EAAE;YACnB,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;YACzB,QAAQ,EAAE,IAAI,CAAC,gBAAgB,EAAE;SACf,CAAC;IACvB,CAAC;IAED,kDAAkD;IAC3C,MAAM,CAAC,KAAK;QACjB,IAAI;YACF,MAAM,KAAK,GAAG;gBACZ,EAAE,EAAE,IAAI,CAAC,eAAe,EAAE;gBAC1B,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE;aACpB,CAAC;YACnB,OAAO,KAAK,CAAC;SACd;QAAC,OAAO,KAAK,EAAE;YACd,qBAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,kCAAkC,CAAC,CAAC;YACpE,MAAM,KAAK,CAAC;SACb;IACH,CAAC;IAED,uEAAuE;IAChE,MAAM,CAAC,WAAW,CAAC,gBAAwB,EAAE,QAAkB;QACpE,MAAM,QAAQ,GAAG,qBAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QACnD,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;QACtH,qBAAM,CAAC,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QAC5C,uBAAU,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC;QACzC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,iEAAiE;IAC1D,MAAM,CAAC,QAAQ;QACpB,OAAO;YACL,WAAW,EAAE,uBAAU,CAAC,kBAAkB;YAC1C,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,EAAE,yDAAyD;SAC1G,CAAC;IACJ,CAAC;CACF;AAxHD,4BAwHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as os from \"os\";\r\nimport * as process from \"process\";\r\nimport { Logger, LogLevel } from \"@itwin/core-bentley\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { IModelHost } from \"./IModelHost\";\r\n\r\n// cspell:ignore ppid elap\r\n\r\nconst loggerCategory: string = BackendLoggerCategory.DevTools;\r\n\r\ninterface StringIndexedObject<T> {\r\n [index: string]: T;\r\n}\r\n\r\n/**\r\n * Performance and Memory statistics of backend\r\n * @internal\r\n */\r\nexport interface DevToolsStats {\r\n os: DevToolsOsStats;\r\n process: DevToolsProcessStats;\r\n}\r\n\r\n/**\r\n * OS stats of backend\r\n * @internal\r\n */\r\nexport interface DevToolsOsStats {\r\n platform: NodeJS.Platform;\r\n hostname: string;\r\n totalmem: number;\r\n freemem: number;\r\n uptime: number;\r\n cpus: os.CpuInfo[];\r\n cpuUsage: number;\r\n}\r\n\r\n/**\r\n * Process stats of backend\r\n * @internal\r\n */\r\nexport interface DevToolsProcessStats {\r\n uptime: number;\r\n pid: number;\r\n ppid: number;\r\n memoryUsage: NodeJS.MemoryUsage;\r\n}\r\n\r\n/** Utility to format the JSON created by DevTools.stats() to include the appropriate units\r\n * @internal\r\n */\r\nexport class DevToolsStatsFormatter {\r\n private static readonly _megaByteProps = [\"totalmem\", \"freemem\", \"rss\", \"heapTotal\", \"heapUsed\", \"external\"];\r\n private static readonly _percentProps = [\"user\", \"nice\", \"sys\", \"idle\", \"irq\", \"cpuUsage\"];\r\n private static readonly _mHzProps = [\"speed\"];\r\n private static readonly _secondsProps = [\"uptime\"];\r\n\r\n /** Replacer that includes units - can be used with JSON.stringify() */\r\n private static _replacer = (key: string, value: any) => {\r\n if (DevToolsStatsFormatter._megaByteProps.includes(key))\r\n return `${value.toFixed()} MB`;\r\n if (DevToolsStatsFormatter._percentProps.includes(key))\r\n return `${value.toFixed()}%`;\r\n if (DevToolsStatsFormatter._mHzProps.includes(key))\r\n return `${value.toString()} MHz`;\r\n if (DevToolsStatsFormatter._secondsProps.includes(key))\r\n return `${value.toFixed()} secs`;\r\n return value;\r\n };\r\n\r\n /** Converts the input stats to another JSON object with the appropriate units setup for various fields */\r\n public static toFormattedJson(stats: any) {\r\n // Serialize the stats to a string with a replacer that sets up units during the serialization\r\n const statsStr = JSON.stringify(stats, DevToolsStatsFormatter._replacer);\r\n\r\n // Deserialize back to JSON\r\n return JSON.parse(statsStr);\r\n }\r\n}\r\n\r\n/**\r\n * Internal diagnostic utility\r\n * @internal\r\n */\r\nexport class DevTools {\r\n\r\n /** Receives a ping and returns true */\r\n public static ping(): boolean {\r\n Logger.logInfo(loggerCategory, \"Received ping at backend\");\r\n return true;\r\n }\r\n\r\n private static hrtimeToMS(hrtime: any) {\r\n return hrtime[0] * 1000 + hrtime[1] / 1000000;\r\n }\r\n\r\n private static bytesToMegaBytes(bytes: number): number {\r\n const megaBytes = bytes / Math.pow(1024, 2);\r\n return Math.round(megaBytes * 100) / 100;\r\n }\r\n\r\n private static evaluateCpuUsage(): number {\r\n const NUMBER_OF_CPUS = os.cpus().length;\r\n const startTime = process.hrtime();\r\n const startUsage = process.cpuUsage();\r\n\r\n // spin the CPU for 500 milliseconds\r\n const now = Date.now();\r\n while (Date.now() - now < 500);\r\n\r\n const elapTime = process.hrtime(startTime);\r\n const elapUsage = process.cpuUsage(startUsage);\r\n\r\n const elapTimeMS = this.hrtimeToMS(elapTime);\r\n\r\n const elapUserMS = elapUsage.user / 1000; // microseconds to milliseconds\r\n const elapSystMS = elapUsage.system / 1000;\r\n const cpuPercent = Math.round((100 * (elapUserMS + elapSystMS) / elapTimeMS / NUMBER_OF_CPUS));\r\n\r\n return cpuPercent;\r\n }\r\n\r\n private static evaluateCpus(): os.CpuInfo[] {\r\n // Create a clone\r\n const srcCpus = os.cpus();\r\n const cpus = new Array<os.CpuInfo>(srcCpus.length);\r\n let ii = 0;\r\n for (const srcCpu of srcCpus)\r\n cpus[ii++] = { ...srcCpu };\r\n\r\n // Evaluate cpu usage as percentages\r\n for (const cpu of Object.values(cpus)) {\r\n const total = Object.values(cpu.times).reduce((_total: number, currValue) => _total += currValue, 0);\r\n const cpuTimes = cpu.times as StringIndexedObject<number>;\r\n for (const type of Object.keys(cpuTimes)) {\r\n const cpuPercent = Math.round(100 * cpuTimes[type] / total);\r\n cpuTimes[type] = cpuPercent;\r\n }\r\n }\r\n return cpus;\r\n }\r\n\r\n private static evaluateMemoryUsage() {\r\n // Create a clone\r\n const memUsage = { ...process.memoryUsage() } as NodeJS.MemoryUsage;\r\n const memUsageObj = (memUsage as any) as StringIndexedObject<number>;\r\n // Evaluate memory usage as mega bytes\r\n for (const type of Object.keys(memUsageObj)) {\r\n memUsageObj[type] = this.bytesToMegaBytes(memUsageObj[type]);\r\n }\r\n return memUsage;\r\n }\r\n\r\n private static evaluateProcessStats(): DevToolsProcessStats {\r\n return {\r\n uptime: process.uptime(),\r\n pid: process.pid,\r\n ppid: process.ppid,\r\n memoryUsage: this.evaluateMemoryUsage(),\r\n } as DevToolsProcessStats;\r\n }\r\n\r\n private static evaluateOsStats(): DevToolsOsStats {\r\n return {\r\n platform: os.platform(),\r\n hostname: os.hostname(),\r\n totalmem: this.bytesToMegaBytes(os.totalmem()),\r\n freemem: this.bytesToMegaBytes(os.freemem()),\r\n uptime: os.uptime(),\r\n cpus: this.evaluateCpus(),\r\n cpuUsage: this.evaluateCpuUsage(),\r\n } as DevToolsOsStats;\r\n }\r\n\r\n /** Returns JSON object with backend statistics */\r\n public static stats(): DevToolsStats {\r\n try {\r\n const stats = {\r\n os: this.evaluateOsStats(),\r\n process: this.evaluateProcessStats(),\r\n } as DevToolsStats;\r\n return stats;\r\n } catch (error) {\r\n Logger.logError(loggerCategory, \"Could not fetch stats at backend\");\r\n throw error;\r\n }\r\n }\r\n\r\n /** Sets up a log level at the backend and returns the old log level */\r\n public static setLogLevel(inLoggerCategory: string, newLevel: LogLevel): LogLevel | undefined {\r\n const oldLevel = Logger.getLevel(inLoggerCategory);\r\n Logger.logInfo(loggerCategory, `Setting log level`, () => ({ loggerCategory: inLoggerCategory, oldLevel, newLevel }));\r\n Logger.setLevel(inLoggerCategory, newLevel);\r\n IModelHost.platform.clearLogLevelCache();\r\n return oldLevel;\r\n }\r\n\r\n /** Obtains the backend application and iTwin.js Core versions */\r\n public static versions() {\r\n return {\r\n application: IModelHost.applicationVersion,\r\n iTwinJs: require(\"../../package.json\").version, // eslint-disable-line @typescript-eslint/no-var-requires\r\n };\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"DevTools.js","sourceRoot":"","sources":["../../src/DevTools.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,yBAAyB;AACzB,mCAAmC;AACnC,sDAAuD;AACvD,mEAAgE;AAChE,6CAA0C;AAE1C,0BAA0B;AAE1B,MAAM,cAAc,GAAW,6CAAqB,CAAC,QAAQ,CAAC;AAwC9D;;GAEG;AACH,MAAa,sBAAsB;IAmBjC,0GAA0G;IACnG,MAAM,CAAC,eAAe,CAAC,KAAU;QACtC,8FAA8F;QAC9F,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC;QAEzE,2BAA2B;QAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;;AA1BH,wDA2BC;AA1ByB,qCAAc,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACrF,oCAAa,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;AACnE,gCAAS,GAAG,CAAC,OAAO,CAAC,CAAC;AACtB,oCAAa,GAAG,CAAC,QAAQ,CAAC,CAAC;AAEnD,wEAAwE;AACzD,gCAAS,GAAG,CAAC,GAAW,EAAE,KAAU,EAAE,EAAE;IACrD,IAAI,sB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5C,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE;YACnB,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;YACzB,QAAQ,EAAE,IAAI,CAAC,gBAAgB,EAAE;SACf,CAAC;IACvB,CAAC;IAED,kDAAkD;IAC3C,MAAM,CAAC,KAAK;QACjB,IAAI;YACF,MAAM,KAAK,GAAG;gBACZ,EAAE,EAAE,IAAI,CAAC,eAAe,EAAE;gBAC1B,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE;aACpB,CAAC;YACnB,OAAO,KAAK,CAAC;SACd;QAAC,OAAO,KAAK,EAAE;YACd,qBAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,kCAAkC,CAAC,CAAC;YACpE,MAAM,KAAK,CAAC;SACb;IACH,CAAC;IAED,uEAAuE;IAChE,MAAM,CAAC,WAAW,CAAC,gBAAwB,EAAE,QAAkB;QACpE,MAAM,QAAQ,GAAG,qBAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QACnD,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;QACtH,qBAAM,CAAC,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QAC5C,uBAAU,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC;QACzC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,iEAAiE;IAC1D,MAAM,CAAC,QAAQ;QACpB,OAAO;YACL,WAAW,EAAE,uBAAU,CAAC,kBAAkB;YAC1C,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,EAAE,yDAAyD;SAC1G,CAAC;IACJ,CAAC;CACF;AAzHD,4BAyHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as os from \"os\";\r\nimport * as process from \"process\";\r\nimport { Logger, LogLevel } from \"@itwin/core-bentley\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { IModelHost } from \"./IModelHost\";\r\n\r\n// cspell:ignore ppid elap\r\n\r\nconst loggerCategory: string = BackendLoggerCategory.DevTools;\r\n\r\ninterface StringIndexedObject<T> {\r\n [index: string]: T;\r\n}\r\n\r\n/**\r\n * Performance and Memory statistics of backend\r\n * @internal\r\n */\r\nexport interface DevToolsStats {\r\n os: DevToolsOsStats;\r\n process: DevToolsProcessStats;\r\n}\r\n\r\n/**\r\n * OS stats of backend\r\n * @internal\r\n */\r\nexport interface DevToolsOsStats {\r\n platform: NodeJS.Platform;\r\n hostname: string;\r\n totalmem: number;\r\n freemem: number;\r\n uptime: number;\r\n cpus: os.CpuInfo[];\r\n cpuUsage: number;\r\n}\r\n\r\n/**\r\n * Process stats of backend\r\n * @internal\r\n */\r\nexport interface DevToolsProcessStats {\r\n uptime: number;\r\n pid: number;\r\n ppid: number;\r\n memoryUsage: NodeJS.MemoryUsage;\r\n}\r\n\r\n/** Utility to format the JSON created by DevTools.stats() to include the appropriate units\r\n * @internal\r\n */\r\nexport class DevToolsStatsFormatter {\r\n private static readonly _megaByteProps = [\"totalmem\", \"freemem\", \"rss\", \"heapTotal\", \"heapUsed\", \"external\"];\r\n private static readonly _percentProps = [\"user\", \"nice\", \"sys\", \"idle\", \"irq\", \"cpuUsage\"];\r\n private static readonly _mHzProps = [\"speed\"];\r\n private static readonly _secondsProps = [\"uptime\"];\r\n\r\n /** Replacer that includes units - can be used with JSON.stringify() */\r\n private static _replacer = (key: string, value: any) => {\r\n if (DevToolsStatsFormatter._megaByteProps.includes(key))\r\n return `${value.toFixed()} MB`;\r\n if (DevToolsStatsFormatter._percentProps.includes(key))\r\n return `${value.toFixed()}%`;\r\n if (DevToolsStatsFormatter._mHzProps.includes(key))\r\n return `${value.toString()} MHz`;\r\n if (DevToolsStatsFormatter._secondsProps.includes(key))\r\n return `${value.toFixed()} secs`;\r\n return value;\r\n };\r\n\r\n /** Converts the input stats to another JSON object with the appropriate units setup for various fields */\r\n public static toFormattedJson(stats: any) {\r\n // Serialize the stats to a string with a replacer that sets up units during the serialization\r\n const statsStr = JSON.stringify(stats, DevToolsStatsFormatter._replacer);\r\n\r\n // Deserialize back to JSON\r\n return JSON.parse(statsStr);\r\n }\r\n}\r\n\r\n/**\r\n * Internal diagnostic utility\r\n * @internal\r\n */\r\nexport class DevTools {\r\n\r\n /** Receives a ping and returns true */\r\n public static ping(): boolean {\r\n Logger.logInfo(loggerCategory, \"Received ping at backend\");\r\n return true;\r\n }\r\n\r\n private static hrtimeToMS(hrtime: any) {\r\n return hrtime[0] * 1000 + hrtime[1] / 1000000;\r\n }\r\n\r\n private static bytesToMegaBytes(bytes: number): number {\r\n const megaBytes = bytes / Math.pow(1024, 2);\r\n return Math.round(megaBytes * 100) / 100;\r\n }\r\n\r\n private static evaluateCpuUsage(): number {\r\n const NUMBER_OF_CPUS = os.cpus().length;\r\n const startTime = process.hrtime();\r\n const startUsage = process.cpuUsage();\r\n\r\n // spin the CPU for 500 milliseconds\r\n const now = Date.now();\r\n while (Date.now() - now < 500)\r\n ;\r\n\r\n const elapTime = process.hrtime(startTime);\r\n const elapUsage = process.cpuUsage(startUsage);\r\n\r\n const elapTimeMS = this.hrtimeToMS(elapTime);\r\n\r\n const elapUserMS = elapUsage.user / 1000; // microseconds to milliseconds\r\n const elapSystMS = elapUsage.system / 1000;\r\n const cpuPercent = Math.round((100 * (elapUserMS + elapSystMS) / elapTimeMS / NUMBER_OF_CPUS));\r\n\r\n return cpuPercent;\r\n }\r\n\r\n private static evaluateCpus(): os.CpuInfo[] {\r\n // Create a clone\r\n const srcCpus = os.cpus();\r\n const cpus = new Array<os.CpuInfo>(srcCpus.length);\r\n let ii = 0;\r\n for (const srcCpu of srcCpus)\r\n cpus[ii++] = { ...srcCpu };\r\n\r\n // Evaluate cpu usage as percentages\r\n for (const cpu of Object.values(cpus)) {\r\n const total = Object.values(cpu.times).reduce((_total: number, currValue) => _total += currValue, 0);\r\n const cpuTimes = cpu.times as StringIndexedObject<number>;\r\n for (const type of Object.keys(cpuTimes)) {\r\n const cpuPercent = Math.round(100 * cpuTimes[type] / total);\r\n cpuTimes[type] = cpuPercent;\r\n }\r\n }\r\n return cpus;\r\n }\r\n\r\n private static evaluateMemoryUsage() {\r\n // Create a clone\r\n const memUsage = { ...process.memoryUsage() } as NodeJS.MemoryUsage;\r\n const memUsageObj = (memUsage as any) as StringIndexedObject<number>;\r\n // Evaluate memory usage as mega bytes\r\n for (const type of Object.keys(memUsageObj)) {\r\n memUsageObj[type] = this.bytesToMegaBytes(memUsageObj[type]);\r\n }\r\n return memUsage;\r\n }\r\n\r\n private static evaluateProcessStats(): DevToolsProcessStats {\r\n return {\r\n uptime: process.uptime(),\r\n pid: process.pid,\r\n ppid: process.ppid,\r\n memoryUsage: this.evaluateMemoryUsage(),\r\n } as DevToolsProcessStats;\r\n }\r\n\r\n private static evaluateOsStats(): DevToolsOsStats {\r\n return {\r\n platform: os.platform(),\r\n hostname: os.hostname(),\r\n totalmem: this.bytesToMegaBytes(os.totalmem()),\r\n freemem: this.bytesToMegaBytes(os.freemem()),\r\n uptime: os.uptime(),\r\n cpus: this.evaluateCpus(),\r\n cpuUsage: this.evaluateCpuUsage(),\r\n } as DevToolsOsStats;\r\n }\r\n\r\n /** Returns JSON object with backend statistics */\r\n public static stats(): DevToolsStats {\r\n try {\r\n const stats = {\r\n os: this.evaluateOsStats(),\r\n process: this.evaluateProcessStats(),\r\n } as DevToolsStats;\r\n return stats;\r\n } catch (error) {\r\n Logger.logError(loggerCategory, \"Could not fetch stats at backend\");\r\n throw error;\r\n }\r\n }\r\n\r\n /** Sets up a log level at the backend and returns the old log level */\r\n public static setLogLevel(inLoggerCategory: string, newLevel: LogLevel): LogLevel | undefined {\r\n const oldLevel = Logger.getLevel(inLoggerCategory);\r\n Logger.logInfo(loggerCategory, `Setting log level`, () => ({ loggerCategory: inLoggerCategory, oldLevel, newLevel }));\r\n Logger.setLevel(inLoggerCategory, newLevel);\r\n IModelHost.platform.clearLogLevelCache();\r\n return oldLevel;\r\n }\r\n\r\n /** Obtains the backend application and iTwin.js Core versions */\r\n public static versions() {\r\n return {\r\n application: IModelHost.applicationVersion,\r\n iTwinJs: require(\"../../package.json\").version, // eslint-disable-line @typescript-eslint/no-var-requires\r\n };\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Element.d.ts","sourceRoot":"","sources":["../../src/Element.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAqB,UAAU,EAAQ,OAAO,EAAE,UAAU,EAA+B,MAAM,qBAAqB,CAAC;AAC5H,OAAO,EACL,gBAAgB,EAAe,IAAI,EAAE,cAAc,EAAY,sBAAsB,EAAE,mBAAmB,EAAE,4BAA4B,EACxI,mCAAmC,EAAE,YAAY,EAAE,cAAc,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,qBAAqB,EAC5F,iBAAiB,EAAE,mBAAmB,EAAU,gCAAgC,EAAE,cAAc,EAC9I,UAAU,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAClI,mBAAmB,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,WAAW,EAAE,wBAAwB,EAAE,UAAU,EAAE,kBAAkB,EAC5I,YAAY,EAAE,cAAc,EAAE,0BAA0B,EAAE,YAAY,EACvE,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAW,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,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SAAS,EAAE,MAAM,GAAG,IAAI;CAIlG;AAED;;GAEG;AACH,qBAAa,SAAU,SAAQ,iBAAiB;IAC9C,gBAAgB;IAChB,WAA2B,SAAS,IAAI,MAAM,CAAwB;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAG,MAAM,CAAC;IACrB,gBAAgB;gBACJ,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ;IAEnD;;;;;OAKG;WACW,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;CAGlG;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,wBAAwB;IAC1D,gBAAgB;IAChB,WAA2B,SAAS,IAAI,MAAM,CAA6B;IAC3E,kFAAkF;IAC3E,WAAW,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACI,WAAW,EAAE,cAAc,CAAC,WAAW,CAAC;IAE/C,gBAAgB;IAChB,SAAS,aAAa,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ;WAMpD,QAAQ,CAAC,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,GAAG,cAAc;IAIpE,MAAM,IAAI,mBAAmB;IAS7C,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAQ/B,aAAa;cACM,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;IAM1D,aAAa;qBACa,QAAQ,CAAC,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,mBAAmB,EAAE,WAAW,EAAE,mBAAmB,GAAG,IAAI;IAMzI;;OAEG;WACW,WAAW,CAAC,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,cAAc,CAAC,WAAW,GAAG,cAAc,CAAC,WAAW;CA2BtH"}
@@ -272,8 +272,11 @@ class Element extends Entity_1.Entity {
272
272
  }
273
273
  /** Get the class metadata for this element. */
274
274
  getClassMetaData() { return this.iModel.classMetaDataRegistry.find(this.classFullName); }
275
- getAllUserProperties() { if (!this.jsonProperties.UserProps)
276
- this.jsonProperties.UserProps = new Object(); return this.jsonProperties.UserProps; }
275
+ getAllUserProperties() {
276
+ if (!this.jsonProperties.UserProps)
277
+ this.jsonProperties.UserProps = new Object();
278
+ return this.jsonProperties.UserProps;
279
+ }
277
280
  /** Get a set of JSON user properties by namespace */
278
281
  getUserProperties(namespace) { return this.getAllUserProperties()[namespace]; }
279
282
  /** Change a set of user JSON properties of this Element by namespace. */
@@ -369,17 +372,15 @@ class GeometricElement3d extends GeometricElement {
369
372
  toJSON() {
370
373
  const val = super.toJSON();
371
374
  val.placement = this.placement;
372
- if (undefined !== this.typeDefinition) {
375
+ if (undefined !== this.typeDefinition)
373
376
  val.typeDefinition = this.typeDefinition;
374
- }
375
377
  return val;
376
378
  }
377
379
  /** @internal */
378
380
  collectReferenceIds(referenceIds) {
379
381
  super.collectReferenceIds(referenceIds);
380
- if (undefined !== this.typeDefinition) {
382
+ if (undefined !== this.typeDefinition)
381
383
  referenceIds.add(this.typeDefinition.id);
382
- }
383
384
  }
384
385
  }
385
386
  exports.GeometricElement3d = GeometricElement3d;
@@ -410,17 +411,15 @@ class GeometricElement2d extends GeometricElement {
410
411
  toJSON() {
411
412
  const val = super.toJSON();
412
413
  val.placement = this.placement;
413
- if (undefined !== this.typeDefinition) {
414
+ if (undefined !== this.typeDefinition)
414
415
  val.typeDefinition = this.typeDefinition;
415
- }
416
416
  return val;
417
417
  }
418
418
  /** @internal */
419
419
  collectReferenceIds(referenceIds) {
420
420
  super.collectReferenceIds(referenceIds);
421
- if (undefined !== this.typeDefinition) {
421
+ if (undefined !== this.typeDefinition)
422
422
  referenceIds.add(this.typeDefinition.id);
423
- }
424
423
  }
425
424
  }
426
425
  exports.GeometricElement2d = GeometricElement2d;
@@ -750,9 +749,8 @@ class SheetTemplate extends Document {
750
749
  /** @internal */
751
750
  collectReferenceIds(referenceIds) {
752
751
  super.collectReferenceIds(referenceIds);
753
- if (undefined !== this.border) {
752
+ if (undefined !== this.border)
754
753
  referenceIds.add(this.border);
755
- }
756
754
  }
757
755
  }
758
756
  exports.SheetTemplate = SheetTemplate;
@@ -773,9 +771,8 @@ class Sheet extends Document {
773
771
  /** @internal */
774
772
  collectReferenceIds(referenceIds) {
775
773
  super.collectReferenceIds(referenceIds);
776
- if (undefined !== this.sheetTemplate) {
774
+ if (undefined !== this.sheetTemplate)
777
775
  referenceIds.add(this.sheetTemplate);
778
- }
779
776
  }
780
777
  /** Create a Code for a Sheet given a name that is meant to be unique within the scope of the specified DocumentListModel.
781
778
  * @param iModel The IModelDb
@@ -804,7 +801,10 @@ exports.InformationRecordElement = InformationRecordElement;
804
801
  */
805
802
  class DefinitionElement extends InformationContentElement {
806
803
  /** @internal */
807
- constructor(props, iModel) { super(props, iModel); this.isPrivate = true === props.isPrivate; }
804
+ constructor(props, iModel) {
805
+ super(props, iModel);
806
+ this.isPrivate = true === props.isPrivate;
807
+ }
808
808
  /** @internal */
809
809
  static get className() { return "DefinitionElement"; }
810
810
  /** @internal */
@@ -909,9 +909,8 @@ class TypeDefinitionElement extends DefinitionElement {
909
909
  /** @internal */
910
910
  collectReferenceIds(referenceIds) {
911
911
  super.collectReferenceIds(referenceIds);
912
- if (undefined !== this.recipe) {
912
+ if (undefined !== this.recipe)
913
913
  referenceIds.add(this.recipe.id);
914
- }
915
914
  }
916
915
  }
917
916
  exports.TypeDefinitionElement = TypeDefinitionElement;