@itwin/core-backend 4.8.0-dev.9 → 4.9.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -1
- package/lib/cjs/BackendHubAccess.d.ts +18 -16
- package/lib/cjs/BackendHubAccess.d.ts.map +1 -1
- package/lib/cjs/BackendHubAccess.js +16 -15
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BlobContainerService.js.map +1 -1
- package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
- package/lib/cjs/BriefcaseManager.js +19 -11
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/Category.d.ts +0 -6
- package/lib/cjs/Category.d.ts.map +1 -1
- package/lib/cjs/Category.js +0 -6
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -1
- package/lib/cjs/ChangeSummaryManager.js +13 -11
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangedElementsDb.d.ts.map +1 -1
- package/lib/cjs/ChangedElementsDb.js +5 -3
- package/lib/cjs/ChangedElementsDb.js.map +1 -1
- package/lib/cjs/ChangedElementsManager.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +242 -237
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ChannelControl.d.ts +4 -26
- package/lib/cjs/ChannelControl.d.ts.map +1 -1
- package/lib/cjs/ChannelControl.js +2 -101
- package/lib/cjs/ChannelControl.js.map +1 -1
- package/lib/cjs/CheckpointManager.d.ts.map +1 -1
- package/lib/cjs/CheckpointManager.js +5 -3
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.d.ts.map +1 -1
- package/lib/cjs/ClassRegistry.js +8 -7
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.d.ts +1 -1
- package/lib/cjs/CloudSqlite.d.ts.map +1 -1
- package/lib/cjs/CloudSqlite.js +2 -2
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeService.js.map +1 -1
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
- package/lib/cjs/DevTools.d.ts.map +1 -1
- package/lib/cjs/DevTools.js +2 -1
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +0 -3
- package/lib/cjs/DisplayStyle.d.ts.map +1 -1
- package/lib/cjs/DisplayStyle.js +0 -3
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.d.ts +6 -1
- package/lib/cjs/ECDb.d.ts.map +1 -1
- package/lib/cjs/ECDb.js +19 -14
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.js +2 -2
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts +6 -3
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
- package/lib/cjs/ECSqlStatement.js +3 -3
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +2 -59
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +7 -63
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +0 -5
- package/lib/cjs/ElementAspect.d.ts.map +1 -1
- package/lib/cjs/ElementAspect.js +4 -8
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.d.ts.map +1 -1
- package/lib/cjs/ElementGraphics.js +2 -1
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.d.ts +19 -0
- package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
- package/lib/cjs/ElementTreeWalker.js +23 -9
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/EntityReferences.js.map +1 -1
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/GeoCoordConfig.d.ts.map +1 -1
- package/lib/cjs/GeoCoordConfig.js +2 -1
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/GeographicCRSServices.js +2 -2
- package/lib/cjs/GeographicCRSServices.js.map +1 -1
- package/lib/cjs/GeometrySummary.d.ts.map +1 -1
- package/lib/cjs/GeometrySummary.js +49 -48
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/HubMock.js.map +1 -1
- package/lib/cjs/IModelCloneContext.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +24 -94
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +196 -151
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js +5 -4
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +5 -3
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +16 -18
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/IpcHost.d.ts.map +1 -1
- package/lib/cjs/IpcHost.js +15 -13
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/LocalHub.d.ts +2 -2
- package/lib/cjs/LocalHub.d.ts.map +1 -1
- package/lib/cjs/LocalHub.js +18 -18
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/LockControl.d.ts +73 -0
- package/lib/cjs/LockControl.d.ts.map +1 -0
- package/lib/cjs/LockControl.js +11 -0
- package/lib/cjs/LockControl.js.map +1 -0
- package/lib/cjs/Material.d.ts +2 -5
- package/lib/cjs/Material.d.ts.map +1 -1
- package/lib/cjs/Material.js +1 -4
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +0 -22
- package/lib/cjs/Model.d.ts.map +1 -1
- package/lib/cjs/Model.js +5 -26
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/NativeAppStorage.js.map +1 -1
- package/lib/cjs/NativeHost.js.map +1 -1
- package/lib/cjs/NavigationRelationship.js.map +1 -1
- package/lib/cjs/PromiseMemoizer.js.map +1 -1
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/Relationship.d.ts +0 -12
- package/lib/cjs/Relationship.d.ts.map +1 -1
- package/lib/cjs/Relationship.js +5 -16
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/RpcBackend.js.map +1 -1
- package/lib/cjs/SQLiteDb.d.ts +6 -1
- package/lib/cjs/SQLiteDb.d.ts.map +1 -1
- package/lib/cjs/SQLiteDb.js +23 -16
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/SchemaSync.d.ts +3 -0
- package/lib/cjs/SchemaSync.d.ts.map +1 -1
- package/lib/cjs/SchemaSync.js +24 -11
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/SchemaUtils.js +3 -3
- package/lib/cjs/SchemaUtils.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.d.ts.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js +2 -2
- package/lib/cjs/SqliteChangesetReader.js.map +1 -1
- package/lib/cjs/SqliteStatement.js +2 -2
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/TextAnnotationGeometry.js.map +1 -1
- package/lib/cjs/TextAnnotationLayout.js.map +1 -1
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +2 -1
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +4 -2
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +1 -18
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js +1 -18
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/ViewStore.d.ts.map +1 -1
- package/lib/cjs/ViewStore.js +6 -5
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
- package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +32 -32
- package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
- package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
- package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
- package/lib/cjs/core-backend.d.ts +2 -1
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +3 -5
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.d.ts +0 -10
- package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -1
- package/lib/cjs/domains/FunctionalElements.js +0 -10
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.d.ts.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.js +2 -1
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
- package/lib/cjs/domains/GenericElements.d.ts +0 -18
- package/lib/cjs/domains/GenericElements.d.ts.map +1 -1
- package/lib/cjs/domains/GenericElements.js +0 -18
- package/lib/cjs/domains/GenericElements.js.map +1 -1
- package/lib/cjs/domains/GenericSchema.js.map +1 -1
- package/lib/cjs/internal/ChangesetConflictArgs.d.ts +24 -0
- package/lib/cjs/internal/ChangesetConflictArgs.d.ts.map +1 -0
- package/lib/cjs/internal/ChangesetConflictArgs.js +7 -0
- package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -0
- package/lib/cjs/internal/ChannelAdmin.d.ts +34 -0
- package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -0
- package/lib/cjs/internal/ChannelAdmin.js +117 -0
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -0
- package/lib/cjs/internal/NativePlatform.d.ts +15 -0
- package/lib/cjs/internal/NativePlatform.d.ts.map +1 -0
- package/lib/cjs/internal/NativePlatform.js +49 -0
- package/lib/cjs/internal/NativePlatform.js.map +1 -0
- package/lib/cjs/internal/NoLocks.d.ts +6 -0
- package/lib/cjs/internal/NoLocks.d.ts.map +1 -0
- package/lib/cjs/internal/NoLocks.js +31 -0
- package/lib/cjs/internal/NoLocks.js.map +1 -0
- package/lib/cjs/{ServerBasedLocks.d.ts → internal/ServerBasedLocks.d.ts} +10 -16
- package/lib/cjs/internal/ServerBasedLocks.d.ts.map +1 -0
- package/lib/cjs/{ServerBasedLocks.js → internal/ServerBasedLocks.js} +29 -18
- package/lib/cjs/internal/ServerBasedLocks.js.map +1 -0
- package/lib/cjs/internal/Symbols.d.ts +11 -0
- package/lib/cjs/internal/Symbols.d.ts.map +1 -0
- package/lib/cjs/internal/Symbols.js +21 -0
- package/lib/cjs/internal/Symbols.js.map +1 -0
- package/lib/cjs/internal/cross-package.d.ts +4 -0
- package/lib/cjs/internal/cross-package.d.ts.map +1 -0
- package/lib/cjs/internal/cross-package.js +16 -0
- package/lib/cjs/internal/cross-package.js.map +1 -0
- package/lib/cjs/internal/workspace/SettingsImpl.d.ts +2 -2
- package/lib/cjs/internal/workspace/SettingsImpl.d.ts.map +1 -1
- package/lib/cjs/internal/workspace/SettingsImpl.js +3 -3
- package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js +2 -2
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.js +31 -27
- package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.d.ts.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js +2 -1
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/cjs/rpc/multipart.js.map +1 -1
- package/lib/cjs/rpc/tracing.d.ts.map +1 -1
- package/lib/cjs/rpc/tracing.js +5 -2
- package/lib/cjs/rpc/tracing.js.map +1 -1
- package/lib/cjs/rpc/web/logging.js.map +1 -1
- package/lib/cjs/rpc/web/request.js.map +1 -1
- package/lib/cjs/rpc/web/response.js.map +1 -1
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +1 -0
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +9 -4
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +5 -3
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
- package/lib/cjs/workspace/Settings.d.ts +3 -3
- package/lib/cjs/workspace/Settings.d.ts.map +1 -1
- package/lib/cjs/workspace/Settings.js +1 -1
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.d.ts +2 -2
- package/lib/cjs/workspace/SettingsSchemas.d.ts.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.d.ts +4 -4
- package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
- package/lib/cjs/workspace/Workspace.js +1 -1
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.d.ts +2 -2
- package/lib/cjs/workspace/WorkspaceEditor.d.ts.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
- package/package.json +13 -13
- package/lib/cjs/ServerBasedLocks.d.ts.map +0 -1
- package/lib/cjs/ServerBasedLocks.js.map +0 -1
- package/lib/cjs/internal/ImplementationProhibited.d.ts +0 -44
- package/lib/cjs/internal/ImplementationProhibited.d.ts.map +0 -1
- package/lib/cjs/internal/ImplementationProhibited.js +0 -51
- package/lib/cjs/internal/ImplementationProhibited.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeHost.js","sourceRoot":"","sources":["../../src/NativeHost.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+BAA4B;AAC5B,sDAA+E;AAC/E,oDAG4B;AAC5B,yDAA8E;AAC9E,2DAAkF;AAClF,6CAA0C;AAC1C,uCAAuF;AACvF,yDAAsD;AAEtD;;GAEG;AACH,MAAM,gBAAiB,SAAQ,oBAAU;IACvC,IAAW,WAAW,KAAK,OAAO,iCAAmB,CAAC,WAAW,CAAC,CAAC,CAAC;IAE7D,KAAK,CAAC,cAAc;QACzB,OAAO,uBAAU,CAAC,mBAAmB,EAAE,cAAc,EAAE,CAAC;IAC1D,CAAC;IAEM,KAAK,CAAC,yBAAyB;QACpC,OAAO,UAAU,CAAC,yBA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AnEH,gCAoEC;AA/DC,qEAAqE;AAC9C,wCAA6B,GAAG,IAAI,sBAAO,EAAgD,CAAC;AAcpG,mBAAQ,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module NativeApp\n */\n\nimport { join } from \"path\";\nimport { AccessToken, assert, BeEvent, GuidString } from \"@itwin/core-bentley\";\nimport {\n BriefcaseProps, InternetConnectivityStatus, LocalBriefcaseProps, NativeAppFunctions, nativeAppIpcStrings, NativeAppNotifications,\n OverriddenBy, RequestNewBriefcaseProps, StorageValue,\n} from \"@itwin/core-common\";\nimport { BriefcaseManager, RequestNewBriefcaseArg } from \"./BriefcaseManager\";\nimport { Downloads, ProgressFunction, ProgressStatus } from \"./CheckpointManager\";\nimport { IModelHost } from \"./IModelHost\";\nimport { IpcHandler, IpcHost, IpcHostOpts, throttleProgressCallback } from \"./IpcHost\";\nimport { NativeAppStorage } from \"./NativeAppStorage\";\n\n/**\n * Implementation of NativeAppFunctions\n */\nclass NativeAppHandler extends IpcHandler implements NativeAppFunctions {\n public get channelName() { return nativeAppIpcStrings.channelName; }\n\n public async getAccessToken(): Promise<AccessToken | undefined> {\n return IModelHost.authorizationClient?.getAccessToken();\n }\n\n public async checkInternetConnectivity(): Promise<InternetConnectivityStatus> {\n return NativeHost.checkInternetConnectivity();\n }\n public async overrideInternetConnectivity(by: OverriddenBy, status: InternetConnectivityStatus): Promise<void> {\n NativeHost.overrideInternetConnectivity(by, status);\n }\n public async acquireNewBriefcaseId(iModelId: GuidString): Promise<number> {\n return BriefcaseManager.acquireNewBriefcaseId({ iModelId });\n }\n public async getBriefcaseFileName(props: BriefcaseProps): Promise<string> {\n return BriefcaseManager.getFileName(props);\n }\n public async downloadBriefcase(request: RequestNewBriefcaseProps, reportProgress: boolean, progressInterval?: number): Promise<LocalBriefcaseProps> {\n const args: RequestNewBriefcaseArg = {\n ...request,\n accessToken: await this.getAccessToken(),\n onProgress: (_a: number, _b: number) => checkAbort(),\n };\n\n const checkAbort = () => {\n assert(undefined !== args.fileName);\n const job = Downloads.isInProgress(args.fileName);\n return (job && (job.request as any).abort === 1) ? ProgressStatus.Abort : ProgressStatus.Continue;\n };\n\n if (reportProgress) {\n const progressCallback: ProgressFunction = (loaded, total) => {\n IpcHost.send(`nativeApp.progress-${request.iModelId}`, { loaded, total });\n return checkAbort();\n };\n args.onProgress = throttleProgressCallback(progressCallback, checkAbort, progressInterval);\n }\n\n return BriefcaseManager.downloadBriefcase(args);\n }\n\n public async requestCancelDownloadBriefcase(fileName: string): Promise<boolean> {\n const job = Downloads.isInProgress(fileName);\n if (job)\n (job.request as any).abort = 1;\n return job !== undefined;\n }\n\n public async deleteBriefcaseFiles(fileName: string): Promise<void> {\n await BriefcaseManager.deleteBriefcaseFiles(fileName, await IModelHost.getAccessToken());\n }\n\n public async getCachedBriefcases(iModelId?: GuidString): Promise<LocalBriefcaseProps[]> {\n return BriefcaseManager.getCachedBriefcases(iModelId);\n }\n\n public async storageMgrOpen(storageId: string): Promise<string> {\n return NativeAppStorage.open(storageId).id;\n }\n\n public async storageMgrClose(storageId: string, deleteIt: boolean): Promise<void> {\n NativeAppStorage.find(storageId).close(deleteIt);\n }\n\n public async storageMgrNames(): Promise<string[]> {\n return NativeAppStorage.getStorageNames();\n }\n\n public async storageGetValueType(storageId: string, key: string): Promise<\"number\" | \"string\" | \"boolean\" | \"Uint8Array\" | \"null\" | undefined> {\n return NativeAppStorage.find(storageId).getValueType(key);\n }\n\n public async storageGet(storageId: string, key: string): Promise<StorageValue | undefined> {\n return NativeAppStorage.find(storageId).getData(key);\n }\n\n public async storageSet(storageId: string, key: string, value: StorageValue): Promise<void> {\n NativeAppStorage.find(storageId).setData(key, value);\n }\n\n public async storageRemove(storageId: string, key: string): Promise<void> {\n NativeAppStorage.find(storageId).removeData(key);\n }\n\n public async storageKeys(storageId: string): Promise<string[]> {\n return NativeAppStorage.find(storageId).getKeys();\n }\n\n public async storageRemoveAll(storageId: string): Promise<void> {\n NativeAppStorage.find(storageId).removeAll();\n }\n}\n\n/** Options for [[NativeHost.startup]]\n * @public\n */\nexport interface NativeHostOpts extends IpcHostOpts {\n nativeHost?: {\n /** Application name. Used, for example, to name the settings file. If not supplied, defaults to \"iTwinApp\". */\n applicationName?: string;\n };\n}\n\n/**\n * Backend for desktop/mobile native applications\n * @public\n */\nexport class NativeHost {\n private static _reachability?: InternetConnectivityStatus;\n private static _applicationName: string;\n private constructor() { } // no instances - static methods only\n\n /** Event called when the internet connectivity changes, if known. */\n public static readonly onInternetConnectivityChanged = new BeEvent<(status: InternetConnectivityStatus) => void>();\n\n private static _appSettingsCacheDir?: string;\n\n /** Get the local cache folder for application settings */\n public static get appSettingsCacheDir(): string {\n return this._appSettingsCacheDir ??= join(IModelHost.cacheDir, \"appSettings\");\n }\n\n /** Send a notification to the NativeApp connected to this NativeHost. */\n public static notifyNativeFrontend<T extends keyof NativeAppNotifications>(methodName: T, ...args: Parameters<NativeAppNotifications[T]>) {\n return IpcHost.send(nativeAppIpcStrings.notifyChannel, methodName, ...args);\n }\n\n private static _isValid = false;\n public static get isValid(): boolean { return this._isValid; }\n public static get applicationName() { return this._applicationName; }\n /** Get the settings store for this NativeHost. */\n public static get settingsStore() {\n return NativeAppStorage.open(this.applicationName);\n }\n\n /**\n * Start the backend of a native app.\n * @note this method calls [[IpcHost.startup]] internally.\n */\n public static async startup(opt?: NativeHostOpts): Promise<void> {\n if (!this.isValid) {\n this._isValid = true;\n this.onInternetConnectivityChanged.addListener((status: InternetConnectivityStatus) =>\n NativeHost.notifyNativeFrontend(\"notifyInternetConnectivityChanged\", status));\n this._applicationName = opt?.nativeHost?.applicationName ?? \"iTwinApp\";\n }\n\n await IpcHost.startup(opt);\n if (IpcHost.isValid) // for tests, we use NativeHost but don't have a frontend\n NativeAppHandler.register();\n }\n\n /** Shutdown native app backend. Also calls [[IpcHost.shutdown]] */\n public static async shutdown(): Promise<void> {\n this._isValid = false;\n this.onInternetConnectivityChanged.clear();\n await IpcHost.shutdown();\n }\n\n /** get current value of internet connectivity */\n public static checkInternetConnectivity(): InternetConnectivityStatus {\n return this._reachability ?? InternetConnectivityStatus.Online;\n }\n\n /**\n * Override internet connectivity state\n * @param _overridenBy who overrode the value.\n * @internal\n */\n public static overrideInternetConnectivity(_overridenBy: OverriddenBy, status: InternetConnectivityStatus): void {\n if (this._reachability !== status) {\n this._reachability = status;\n this.onInternetConnectivityChanged.raiseEvent(status);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"NativeHost.js","sourceRoot":"","sources":["../../src/NativeHost.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+BAA4B;AAC5B,sDAA+E;AAC/E,oDAG4B;AAC5B,yDAA8E;AAC9E,2DAAkF;AAClF,6CAA0C;AAC1C,uCAAuF;AACvF,yDAAsD;AAEtD;;GAEG;AACH,MAAM,gBAAiB,SAAQ,oBAAU;IACvC,IAAW,WAAW,KAAK,OAAO,iCAAmB,CAAC,WAAW,CAAC,CAAC,CAAC;IAE7D,KAAK,CAAC,cAAc;QACzB,OAAO,uBAAU,CAAC,mBAAmB,EAAE,cAAc,EAAE,CAAC;IAC1D,CAAC;IAEM,KAAK,CAAC,yBAAyB;QACpC,OAAO,UAAU,CAAC,yBAAyB,EAAE,CAAC;IAChD,CAAC;IACM,KAAK,CAAC,4BAA4B,CAAC,EAAgB,EAAE,MAAkC;QAC5F,UAAU,CAAC,4BAA4B,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACtD,CAAC;IACM,KAAK,CAAC,qBAAqB,CAAC,QAAoB;QACrD,OAAO,mCAAgB,CAAC,qBAAqB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC9D,CAAC;IACM,KAAK,CAAC,oBAAoB,CAAC,KAAqB;QACrD,OAAO,mCAAgB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AE,CACpF,UAAU,CAAC,oBAAoB,CAAC,mCAAmC,EAAE,MAAM,CAAC,CAAC,CAAC;YAChF,IAAI,CAAC,gBAAgB,GAAG,GAAG,EAAE,UAAU,EAAE,eAAe,IAAI,UAAU,CAAC;QACzE,CAAC;QAED,MAAM,iBAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC3B,IAAI,iBAAO,CAAC,OAAO,EAAG,yDAAyD;YAC7E,gBAAgB,CAAC,QAAQ,EAAE,CAAC;IAChC,CAAC;IAED,mEAAmE;IAC5D,MAAM,CAAC,KAAK,CAAC,QAAQ;QAC1B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,6BAA6B,CAAC,KAAK,EAAE,CAAC;QAC3C,MAAM,iBAAO,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,iDAAiD;IAC1C,MAAM,CAAC,yBAAyB;QACrC,OAAO,IAAI,CAAC,aAAa,IAAI,wCAA0B,CAAC,MAAM,CAAC;IACjE,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,4BAA4B,CAAC,YAA0B,EAAE,MAAkC;QACvG,IAAI,IAAI,CAAC,aAAa,KAAK,MAAM,EAAE,CAAC;YAClC,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;YAC5B,IAAI,CAAC,6BAA6B,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;;AAnEH,gCAoEC;AA/DC,qEAAqE;AAC9C,wCAA6B,GAAG,IAAI,sBAAO,EAAgD,CAAC;AAcpG,mBAAQ,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module NativeApp\r\n */\r\n\r\nimport { join } from \"path\";\r\nimport { AccessToken, assert, BeEvent, GuidString } from \"@itwin/core-bentley\";\r\nimport {\r\n BriefcaseProps, InternetConnectivityStatus, LocalBriefcaseProps, NativeAppFunctions, nativeAppIpcStrings, NativeAppNotifications,\r\n OverriddenBy, RequestNewBriefcaseProps, StorageValue,\r\n} from \"@itwin/core-common\";\r\nimport { BriefcaseManager, RequestNewBriefcaseArg } from \"./BriefcaseManager\";\r\nimport { Downloads, ProgressFunction, ProgressStatus } from \"./CheckpointManager\";\r\nimport { IModelHost } from \"./IModelHost\";\r\nimport { IpcHandler, IpcHost, IpcHostOpts, throttleProgressCallback } from \"./IpcHost\";\r\nimport { NativeAppStorage } from \"./NativeAppStorage\";\r\n\r\n/**\r\n * Implementation of NativeAppFunctions\r\n */\r\nclass NativeAppHandler extends IpcHandler implements NativeAppFunctions {\r\n public get channelName() { return nativeAppIpcStrings.channelName; }\r\n\r\n public async getAccessToken(): Promise<AccessToken | undefined> {\r\n return IModelHost.authorizationClient?.getAccessToken();\r\n }\r\n\r\n public async checkInternetConnectivity(): Promise<InternetConnectivityStatus> {\r\n return NativeHost.checkInternetConnectivity();\r\n }\r\n public async overrideInternetConnectivity(by: OverriddenBy, status: InternetConnectivityStatus): Promise<void> {\r\n NativeHost.overrideInternetConnectivity(by, status);\r\n }\r\n public async acquireNewBriefcaseId(iModelId: GuidString): Promise<number> {\r\n return BriefcaseManager.acquireNewBriefcaseId({ iModelId });\r\n }\r\n public async getBriefcaseFileName(props: BriefcaseProps): Promise<string> {\r\n return BriefcaseManager.getFileName(props);\r\n }\r\n public async downloadBriefcase(request: RequestNewBriefcaseProps, reportProgress: boolean, progressInterval?: number): Promise<LocalBriefcaseProps> {\r\n const args: RequestNewBriefcaseArg = {\r\n ...request,\r\n accessToken: await this.getAccessToken(),\r\n onProgress: (_a: number, _b: number) => checkAbort(),\r\n };\r\n\r\n const checkAbort = () => {\r\n assert(undefined !== args.fileName);\r\n const job = Downloads.isInProgress(args.fileName);\r\n return (job && (job.request as any).abort === 1) ? ProgressStatus.Abort : ProgressStatus.Continue;\r\n };\r\n\r\n if (reportProgress) {\r\n const progressCallback: ProgressFunction = (loaded, total) => {\r\n IpcHost.send(`nativeApp.progress-${request.iModelId}`, { loaded, total });\r\n return checkAbort();\r\n };\r\n args.onProgress = throttleProgressCallback(progressCallback, checkAbort, progressInterval);\r\n }\r\n\r\n return BriefcaseManager.downloadBriefcase(args);\r\n }\r\n\r\n public async requestCancelDownloadBriefcase(fileName: string): Promise<boolean> {\r\n const job = Downloads.isInProgress(fileName);\r\n if (job)\r\n (job.request as any).abort = 1;\r\n return job !== undefined;\r\n }\r\n\r\n public async deleteBriefcaseFiles(fileName: string): Promise<void> {\r\n await BriefcaseManager.deleteBriefcaseFiles(fileName, await IModelHost.getAccessToken());\r\n }\r\n\r\n public async getCachedBriefcases(iModelId?: GuidString): Promise<LocalBriefcaseProps[]> {\r\n return BriefcaseManager.getCachedBriefcases(iModelId);\r\n }\r\n\r\n public async storageMgrOpen(storageId: string): Promise<string> {\r\n return NativeAppStorage.open(storageId).id;\r\n }\r\n\r\n public async storageMgrClose(storageId: string, deleteIt: boolean): Promise<void> {\r\n NativeAppStorage.find(storageId).close(deleteIt);\r\n }\r\n\r\n public async storageMgrNames(): Promise<string[]> {\r\n return NativeAppStorage.getStorageNames();\r\n }\r\n\r\n public async storageGetValueType(storageId: string, key: string): Promise<\"number\" | \"string\" | \"boolean\" | \"Uint8Array\" | \"null\" | undefined> {\r\n return NativeAppStorage.find(storageId).getValueType(key);\r\n }\r\n\r\n public async storageGet(storageId: string, key: string): Promise<StorageValue | undefined> {\r\n return NativeAppStorage.find(storageId).getData(key);\r\n }\r\n\r\n public async storageSet(storageId: string, key: string, value: StorageValue): Promise<void> {\r\n NativeAppStorage.find(storageId).setData(key, value);\r\n }\r\n\r\n public async storageRemove(storageId: string, key: string): Promise<void> {\r\n NativeAppStorage.find(storageId).removeData(key);\r\n }\r\n\r\n public async storageKeys(storageId: string): Promise<string[]> {\r\n return NativeAppStorage.find(storageId).getKeys();\r\n }\r\n\r\n public async storageRemoveAll(storageId: string): Promise<void> {\r\n NativeAppStorage.find(storageId).removeAll();\r\n }\r\n}\r\n\r\n/** Options for [[NativeHost.startup]]\r\n * @public\r\n */\r\nexport interface NativeHostOpts extends IpcHostOpts {\r\n nativeHost?: {\r\n /** Application name. Used, for example, to name the settings file. If not supplied, defaults to \"iTwinApp\". */\r\n applicationName?: string;\r\n };\r\n}\r\n\r\n/**\r\n * Backend for desktop/mobile native applications\r\n * @public\r\n */\r\nexport class NativeHost {\r\n private static _reachability?: InternetConnectivityStatus;\r\n private static _applicationName: string;\r\n private constructor() { } // no instances - static methods only\r\n\r\n /** Event called when the internet connectivity changes, if known. */\r\n public static readonly onInternetConnectivityChanged = new BeEvent<(status: InternetConnectivityStatus) => void>();\r\n\r\n private static _appSettingsCacheDir?: string;\r\n\r\n /** Get the local cache folder for application settings */\r\n public static get appSettingsCacheDir(): string {\r\n return this._appSettingsCacheDir ??= join(IModelHost.cacheDir, \"appSettings\");\r\n }\r\n\r\n /** Send a notification to the NativeApp connected to this NativeHost. */\r\n public static notifyNativeFrontend<T extends keyof NativeAppNotifications>(methodName: T, ...args: Parameters<NativeAppNotifications[T]>) {\r\n return IpcHost.send(nativeAppIpcStrings.notifyChannel, methodName, ...args);\r\n }\r\n\r\n private static _isValid = false;\r\n public static get isValid(): boolean { return this._isValid; }\r\n public static get applicationName() { return this._applicationName; }\r\n /** Get the settings store for this NativeHost. */\r\n public static get settingsStore() {\r\n return NativeAppStorage.open(this.applicationName);\r\n }\r\n\r\n /**\r\n * Start the backend of a native app.\r\n * @note this method calls [[IpcHost.startup]] internally.\r\n */\r\n public static async startup(opt?: NativeHostOpts): Promise<void> {\r\n if (!this.isValid) {\r\n this._isValid = true;\r\n this.onInternetConnectivityChanged.addListener((status: InternetConnectivityStatus) =>\r\n NativeHost.notifyNativeFrontend(\"notifyInternetConnectivityChanged\", status));\r\n this._applicationName = opt?.nativeHost?.applicationName ?? \"iTwinApp\";\r\n }\r\n\r\n await IpcHost.startup(opt);\r\n if (IpcHost.isValid) // for tests, we use NativeHost but don't have a frontend\r\n NativeAppHandler.register();\r\n }\r\n\r\n /** Shutdown native app backend. Also calls [[IpcHost.shutdown]] */\r\n public static async shutdown(): Promise<void> {\r\n this._isValid = false;\r\n this.onInternetConnectivityChanged.clear();\r\n await IpcHost.shutdown();\r\n }\r\n\r\n /** get current value of internet connectivity */\r\n public static checkInternetConnectivity(): InternetConnectivityStatus {\r\n return this._reachability ?? InternetConnectivityStatus.Online;\r\n }\r\n\r\n /**\r\n * Override internet connectivity state\r\n * @param _overridenBy who overrode the value.\r\n * @internal\r\n */\r\n public static overrideInternetConnectivity(_overridenBy: OverriddenBy, status: InternetConnectivityStatus): void {\r\n if (this._reachability !== status) {\r\n this._reachability = status;\r\n this.onInternetConnectivityChanged.raiseEvent(status);\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationRelationship.js","sourceRoot":"","sources":["../../src/NavigationRelationship.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAMH,oDAAoE;AAEpE;;GAEG;AACH,MAAa,wBAAyB,SAAQ,4BAAc;IAE1D,YAAmB,QAAoB,EAAE,eAAuB,wBAAwB,CAAC,aAAa;QACpG,KAAK,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC;IACxC,CAAC;;AAJH,4DAKC;AAJe,sCAAa,GAAG,kCAAkC,CAAC;AAMnE;;GAEG;AACH,MAAa,mBAAoB,SAAQ,wBAAwB;IAE/D,YAAmB,QAAoB,EAAE,eAAuB,mBAAmB,CAAC,aAAa;QAC/F,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAChC,CAAC;;AAJH,kDAKC;AAJwB,iCAAa,GAAG,6BAA6B,CAAC;AAMvE;;GAEG;AACH,MAAa,4BAA6B,SAAQ,wBAAwB;IAExE,YAAmB,QAAoB,EAAE,eAAuB,4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E,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC;IAC5C,CAAC;;AAJH,oEAKC;AAJe,0CAAa,GAAG,sCAAsC,CAAC;AAMvE;;;GAGG;AACH,MAAa,sCAAuC,SAAQ,4BAAc;IAExE,YAAmB,gBAA4B,EAAE,eAAuB,sCAAsC,CAAC,aAAa;QAC1H,KAAK,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,YAAY,EAAE,CAAC,CAAC;IAChD,CAAC;;AAJH,wFAKC;AAJe,oDAAa,GAAG,gDAAgD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Relationships\n */\n\n// NOTE: A NavigationRelationship is not an Entity, so is not registered in the ClassRegistry.\n// NOTE: It does, however, have a classFullName property for consistency with Entity subclasses.\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { RelatedElement, TypeDefinition } from \"@itwin/core-common\";\n\n/** Relates a parent Element to child Elements which represent parts of the Entity modeled by the parent Element.\n * @public\n */\nexport class ElementOwnsChildElements extends RelatedElement {\n public static classFullName = \"BisCore:ElementOwnsChildElements\";\n public constructor(parentId: Id64String, relClassName: string = ElementOwnsChildElements.classFullName) {\n super({ id: parentId, relClassName });\n }\n}\n\n/** Relates a parent [[Subject]] to [[Subject]] child elements.\n * @public\n */\nexport class SubjectOwnsSubjects extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:SubjectOwnsSubjects\";\n public constructor(parentId: Id64String, relClassName: string = SubjectOwnsSubjects.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[Subject]] to [[InformationPartitionElement]] child elements.\n * @public\n */\nexport class SubjectOwnsPartitionElements extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:SubjectOwnsPartitionElements\";\n public constructor(parentId: Id64String, relClassName: string = SubjectOwnsPartitionElements.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[Category]] to [[SubCategory]] child elements.\n * @public\n */\nexport class CategoryOwnsSubCategories extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:CategoryOwnsSubCategories\";\n public constructor(parentId: Id64String, relClassName: string = CategoryOwnsSubCategories.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[RenderMaterial]] to [[RenderMaterial]] child elements.\n * @public\n */\nexport class RenderMaterialOwnsRenderMaterials extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:RenderMaterialOwnsRenderMaterials\";\n public constructor(parentId: Id64String, relClassName: string = RenderMaterialOwnsRenderMaterials.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent Element to child Elements which represent **hidden** parts of the Entity.\n * @public\n */\nexport class ElementEncapsulatesElements extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:ElementEncapsulatesElements\";\n public constructor(parentId: Id64String, relClassName: string = ElementEncapsulatesElements.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[PhysicalElement]] to [[PhysicalElement]] children that it assembles.\n * @public\n */\nexport class PhysicalElementAssemblesElements extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:PhysicalElementAssemblesElements\";\n public constructor(parentId: Id64String, relClassName: string = PhysicalElementAssemblesElements.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[ExternalSource]] to its [[ExternalSourceAttachment]] children.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceOwnsAttachments extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:ExternalSourceOwnsAttachments\";\n public constructor(parentId: Id64String, relClassName: string = ExternalSourceOwnsAttachments.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[FolderLink]] to its [[RepositoryLink]] children.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class FolderContainsRepositories extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:FolderContainsRepositories\";\n public constructor(parentId: Id64String, relClassName: string = FolderContainsRepositories.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a [[GeometricElement2d]] to its [[TypeDefinitionElement]]\n * @public\n */\nexport class GeometricElement2dHasTypeDefinition extends TypeDefinition {\n public static classFullName = \"BisCore:GeometricElement2dHasTypeDefinition\";\n public constructor(id: Id64String, relClassName: string = GeometricElement2dHasTypeDefinition.classFullName) {\n super({ id, relClassName });\n }\n}\n\n/** Relates a [[GraphicalElement2d]] to its [[GraphicalType2d]]\n * @public\n */\nexport class GraphicalElement2dIsOfType extends GeometricElement2dHasTypeDefinition {\n public static override classFullName = \"BisCore:GraphicalElement2dIsOfType\";\n public constructor(id: Id64String, relClassName: string = GraphicalElement2dIsOfType.classFullName) {\n super(id, relClassName);\n }\n}\n\n/** Relates a [[GeometricElement3d]] to its [[TypeDefinitionElement]]\n * @public\n */\nexport class GeometricElement3dHasTypeDefinition extends TypeDefinition {\n public static classFullName = \"BisCore:GeometricElement3dHasTypeDefinition\";\n public constructor(id: Id64String, relClassName: string = GeometricElement3dHasTypeDefinition.classFullName) {\n super({ id, relClassName });\n }\n}\n\n/** Relates a [[SpatialLocationElement]] to its [[SpatialLocationType]]\n * @public\n */\nexport class SpatialLocationIsOfType extends GeometricElement3dHasTypeDefinition {\n public static override classFullName = \"BisCore:SpatialLocationIsOfType\";\n public constructor(id: Id64String, relClassName: string = SpatialLocationIsOfType.classFullName) {\n super(id, relClassName);\n }\n}\n\n/** Relates a [[PhysicalElement]] to its [[PhysicalType]]\n * @public\n */\nexport class PhysicalElementIsOfType extends GeometricElement3dHasTypeDefinition {\n public static override classFullName = \"BisCore:PhysicalElementIsOfType\";\n public constructor(id: Id64String, relClassName: string = PhysicalElementIsOfType.classFullName) {\n super(id, relClassName);\n }\n}\n\n/** Relates a [[PhysicalElement]] to its [[PhysicalMaterial]]\n * @public\n */\nexport class PhysicalElementIsOfPhysicalMaterial extends RelatedElement {\n public static classFullName = \"BisCore:PhysicalElementIsOfPhysicalMaterial\";\n public constructor(id: Id64String) {\n super({ id });\n }\n}\n\n/** Relates a [[PhysicalType]] to its [[PhysicalMaterial]]\n * @public\n */\nexport class PhysicalTypeIsOfPhysicalMaterial extends RelatedElement {\n public static classFullName = \"BisCore:PhysicalTypeIsOfPhysicalMaterial\";\n public constructor(id: Id64String) {\n super({ id });\n }\n}\n\n/** Relates an [[Element]] and an [[ElementUniqueAspect]] that it owns.\n * @public\n */\nexport class ElementOwnsUniqueAspect extends RelatedElement {\n public static classFullName = \"BisCore:ElementOwnsUniqueAspect\";\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsUniqueAspect.classFullName) {\n super({ id: elementId, relClassName });\n }\n}\n\n/** Relates an [[Element]] and an [[ElementMultiAspect]] that it owns.\n * @public\n */\nexport class ElementOwnsMultiAspects extends RelatedElement {\n public static classFullName = \"BisCore:ElementOwnsMultiAspects\";\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsMultiAspects.classFullName) {\n super({ id: elementId, relClassName });\n }\n}\n\n/** Relates an [[Element]] and an [[ExternalSourceAspect]] that it owns.\n * @public\n */\nexport class ElementOwnsExternalSourceAspects extends ElementOwnsMultiAspects {\n public static override classFullName = \"BisCore:ElementOwnsExternalSourceAspects\";\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsExternalSourceAspects.classFullName) {\n super(elementId, relClassName);\n }\n}\n\n/** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceIsInRepository extends RelatedElement {\n public static classFullName = \"BisCore:ExternalSourceIsInRepository\";\n public constructor(repositoryId: Id64String, relClassName: string = ExternalSourceIsInRepository.classFullName) {\n super({ id: repositoryId, relClassName });\n }\n}\n\n/** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceAttachmentAttachesSource extends RelatedElement {\n public static classFullName = \"BisCore:ExternalSourceAttachmentAttachesSource\";\n public constructor(externalSourceId: Id64String, relClassName: string = ExternalSourceAttachmentAttachesSource.classFullName) {\n super({ id: externalSourceId, relClassName });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"NavigationRelationship.js","sourceRoot":"","sources":["../../src/NavigationRelationship.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAMH,oDAAoE;AAEpE;;GAEG;AACH,MAAa,wBAAyB,SAAQ,4BAAc;IAE1D,YAAmB,QAAoB,EAAE,eAAuB,wBAAwB,CAAC,aAAa;QACpG,KAAK,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC;IACxC,CAAC;;AAJH,4DAKC;AAJe,sCAAa,GAAG,kCAAkC,CAAC;AAMnE;;GAEG;AACH,MAAa,mBAAoB,SAAQ,wBAAwB;IAE/D,YAAmB,QAAoB,EAAE,eAAuB,mBAAmB,CAAC,aAAa;QAC/F,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAChC,CAAC;;AAJH,kDAKC;AAJwB,iCAAa,GAAG,6BAA6B,CAAC;AAMvE;;GAEG;AACH,MAAa,4BAA6B,SAAQ,wBAAwB;IAExE,YAAmB,QAAoB,EAAE,eAAuB,4BAA4B,CAAC,aAAa;QACxG,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAChC,CAAC;;AAJH,oEAKC;AAJwB,0CAAa,GAAG,sCAAsC,CAAC;AAMhF;;GAEG;AACH,MAAa,yBAA0B,SAAQ,wBAAwB;IAErE,YAAmB,QAAoB,EAAE,eAAuB,yBAAyB,CAAC,aAAa;QACrG,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAChC,CAAC;;AAJH,8DAKC;AAJwB,uCAAa,GAAG,mCAAmC,CAAC;AAM7E;;GAEG;AACH,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------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Relationships\r\n */\r\n\r\n// NOTE: A NavigationRelationship is not an Entity, so is not registered in the ClassRegistry.\r\n// NOTE: It does, however, have a classFullName property for consistency with Entity subclasses.\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { RelatedElement, TypeDefinition } from \"@itwin/core-common\";\r\n\r\n/** Relates a parent Element to child Elements which represent parts of the Entity modeled by the parent Element.\r\n * @public\r\n */\r\nexport class ElementOwnsChildElements extends RelatedElement {\r\n public static classFullName = \"BisCore:ElementOwnsChildElements\";\r\n public constructor(parentId: Id64String, relClassName: string = ElementOwnsChildElements.classFullName) {\r\n super({ id: parentId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates a parent [[Subject]] to [[Subject]] child elements.\r\n * @public\r\n */\r\nexport class SubjectOwnsSubjects extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:SubjectOwnsSubjects\";\r\n public constructor(parentId: Id64String, relClassName: string = SubjectOwnsSubjects.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[Subject]] to [[InformationPartitionElement]] child elements.\r\n * @public\r\n */\r\nexport class SubjectOwnsPartitionElements extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:SubjectOwnsPartitionElements\";\r\n public constructor(parentId: Id64String, relClassName: string = SubjectOwnsPartitionElements.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[Category]] to [[SubCategory]] child elements.\r\n * @public\r\n */\r\nexport class CategoryOwnsSubCategories extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:CategoryOwnsSubCategories\";\r\n public constructor(parentId: Id64String, relClassName: string = CategoryOwnsSubCategories.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[RenderMaterial]] to [[RenderMaterial]] child elements.\r\n * @public\r\n */\r\nexport class RenderMaterialOwnsRenderMaterials extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:RenderMaterialOwnsRenderMaterials\";\r\n public constructor(parentId: Id64String, relClassName: string = RenderMaterialOwnsRenderMaterials.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent Element to child Elements which represent **hidden** parts of the Entity.\r\n * @public\r\n */\r\nexport class ElementEncapsulatesElements extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:ElementEncapsulatesElements\";\r\n public constructor(parentId: Id64String, relClassName: string = ElementEncapsulatesElements.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[PhysicalElement]] to [[PhysicalElement]] children that it assembles.\r\n * @public\r\n */\r\nexport class PhysicalElementAssemblesElements extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:PhysicalElementAssemblesElements\";\r\n public constructor(parentId: Id64String, relClassName: string = PhysicalElementAssemblesElements.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[ExternalSource]] to its [[ExternalSourceAttachment]] children.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceOwnsAttachments extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:ExternalSourceOwnsAttachments\";\r\n public constructor(parentId: Id64String, relClassName: string = ExternalSourceOwnsAttachments.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[FolderLink]] to its [[RepositoryLink]] children.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class FolderContainsRepositories extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:FolderContainsRepositories\";\r\n public constructor(parentId: Id64String, relClassName: string = FolderContainsRepositories.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a [[GeometricElement2d]] to its [[TypeDefinitionElement]]\r\n * @public\r\n */\r\nexport class GeometricElement2dHasTypeDefinition extends TypeDefinition {\r\n public static classFullName = \"BisCore:GeometricElement2dHasTypeDefinition\";\r\n public constructor(id: Id64String, relClassName: string = GeometricElement2dHasTypeDefinition.classFullName) {\r\n super({ id, relClassName });\r\n }\r\n}\r\n\r\n/** Relates a [[GraphicalElement2d]] to its [[GraphicalType2d]]\r\n * @public\r\n */\r\nexport class GraphicalElement2dIsOfType extends GeometricElement2dHasTypeDefinition {\r\n public static override classFullName = \"BisCore:GraphicalElement2dIsOfType\";\r\n public constructor(id: Id64String, relClassName: string = GraphicalElement2dIsOfType.classFullName) {\r\n super(id, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a [[GeometricElement3d]] to its [[TypeDefinitionElement]]\r\n * @public\r\n */\r\nexport class GeometricElement3dHasTypeDefinition extends TypeDefinition {\r\n public static classFullName = \"BisCore:GeometricElement3dHasTypeDefinition\";\r\n public constructor(id: Id64String, relClassName: string = GeometricElement3dHasTypeDefinition.classFullName) {\r\n super({ id, relClassName });\r\n }\r\n}\r\n\r\n/** Relates a [[SpatialLocationElement]] to its [[SpatialLocationType]]\r\n * @public\r\n */\r\nexport class SpatialLocationIsOfType extends GeometricElement3dHasTypeDefinition {\r\n public static override classFullName = \"BisCore:SpatialLocationIsOfType\";\r\n public constructor(id: Id64String, relClassName: string = SpatialLocationIsOfType.classFullName) {\r\n super(id, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a [[PhysicalElement]] to its [[PhysicalType]]\r\n * @public\r\n */\r\nexport class PhysicalElementIsOfType extends GeometricElement3dHasTypeDefinition {\r\n public static override classFullName = \"BisCore:PhysicalElementIsOfType\";\r\n public constructor(id: Id64String, relClassName: string = PhysicalElementIsOfType.classFullName) {\r\n super(id, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a [[PhysicalElement]] to its [[PhysicalMaterial]]\r\n * @public\r\n */\r\nexport class PhysicalElementIsOfPhysicalMaterial extends RelatedElement {\r\n public static classFullName = \"BisCore:PhysicalElementIsOfPhysicalMaterial\";\r\n public constructor(id: Id64String) {\r\n super({ id });\r\n }\r\n}\r\n\r\n/** Relates a [[PhysicalType]] to its [[PhysicalMaterial]]\r\n * @public\r\n */\r\nexport class PhysicalTypeIsOfPhysicalMaterial extends RelatedElement {\r\n public static classFullName = \"BisCore:PhysicalTypeIsOfPhysicalMaterial\";\r\n public constructor(id: Id64String) {\r\n super({ id });\r\n }\r\n}\r\n\r\n/** Relates an [[Element]] and an [[ElementUniqueAspect]] that it owns.\r\n * @public\r\n */\r\nexport class ElementOwnsUniqueAspect extends RelatedElement {\r\n public static classFullName = \"BisCore:ElementOwnsUniqueAspect\";\r\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsUniqueAspect.classFullName) {\r\n super({ id: elementId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates an [[Element]] and an [[ElementMultiAspect]] that it owns.\r\n * @public\r\n */\r\nexport class ElementOwnsMultiAspects extends RelatedElement {\r\n public static classFullName = \"BisCore:ElementOwnsMultiAspects\";\r\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsMultiAspects.classFullName) {\r\n super({ id: elementId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates an [[Element]] and an [[ExternalSourceAspect]] that it owns.\r\n * @public\r\n */\r\nexport class ElementOwnsExternalSourceAspects extends ElementOwnsMultiAspects {\r\n public static override classFullName = \"BisCore:ElementOwnsExternalSourceAspects\";\r\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsExternalSourceAspects.classFullName) {\r\n super(elementId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceIsInRepository extends RelatedElement {\r\n public static classFullName = \"BisCore:ExternalSourceIsInRepository\";\r\n public constructor(repositoryId: Id64String, relClassName: string = ExternalSourceIsInRepository.classFullName) {\r\n super({ id: repositoryId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceAttachmentAttachesSource extends RelatedElement {\r\n public static classFullName = \"BisCore:ExternalSourceAttachmentAttachesSource\";\r\n public constructor(externalSourceId: Id64String, relClassName: string = ExternalSourceAttachmentAttachesSource.classFullName) {\r\n super({ id: externalSourceId, relClassName });\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromiseMemoizer.js","sourceRoot":"","sources":["../../src/PromiseMemoizer.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,sDAA0D;AAC1D,mEAAgE;AAEhE;;GAEG;AACH,MAAa,gBAAgB;IAO3B,IAAW,SAAS,KAAc,OAAO,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACjF,IAAW,WAAW,KAAc,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAC7D,IAAW,UAAU,KAAc,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAC3D,YAAmC,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;QAN9C,eAAU,GAAY,KAAK,CAAC;QAC5B,cAAS,GAAY,KAAK,CAAC;QAMjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAM,EAAE,EAAE;YAC3B,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;YAClB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACzB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAQ,EAAE,EAAE;YACpB,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;YACjB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACxB,C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,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;YAC/D,OAAO,CAAC,CAAC;QACX,CAAC,CAAC;QAEF,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC,EAAE,EAAE;YACjE,MAAM,mBAAmB,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,EAAE,GAAG,IAAI,gBAAgB,CAAI,CAAC,CAAC,CAAC;QAChC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAClC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,mCAAmC;IAC5B,cAAc,CAAC,GAAG,IAAW;QAClC,MAAM,GAAG,GAAW,IAAI,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,KAAK;YACP,YAAY,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,8CAA8C;IACvC,UAAU;QACf,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;IAEM,OAAO;QACZ,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACvC,YAAY,CAAC,KAAK,CAAC,CAAC;QAEtB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;CACF;AA5ED,0CA4EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { IDisposable, Logger } from \"@itwin/core-bentley\";\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\n\n/** Wrapper around a promise that allows synchronous queries of it's state\n * @internal\n */\nexport class QueryablePromise<T> {\n public result?: T;\n public error?: any;\n\n private _fulfilled: boolean = false;\n private _rejected: boolean = false;\n\n public get isPending(): boolean { return !this.isFulfilled && !this.isRejected; }\n public get isFulfilled(): boolean { return this._fulfilled; }\n public get isRejected(): boolean { return this._rejected; }\n public constructor(public readonly promise: Promise<T>) {\n this.promise.then((res: T) => {\n this.result = res;\n this._fulfilled = true;\n }).catch((err: any) => {\n this.error = err;\n this._rejected = true;\n });\n }\n}\n\n/** @internal */\nexport type MemoizeFnType<T> = (...args: any[]) => Promise<T>;\n/** @internal */\nexport type GenerateKeyFnType = (...args: any[]) => string;\n\n/** Utility to cache and retrieve results of long running asynchronous functions.\n * The cache is keyed on the input arguments passed to these functions\n * @internal\n */\nexport class PromiseMemoizer<T> implements IDisposable {\n private readonly _cachedPromises: Map<string, QueryablePromise<T>> = new Map<string, QueryablePromise<T>>();\n private readonly _timers: Map<string, NodeJS.Timeout> = new Map<string, NodeJS.Timeout>();\n private readonly _memoizeFn: MemoizeFnType<T>;\n private readonly _generateKeyFn: GenerateKeyFnType;\n private readonly _maxCacheSize: number;\n private readonly _cacheTimeout: number;\n\n /**\n * Constructor\n * @param memoizeFn Function to memoize\n * @param generateKeyFn Function to generate the key for the memoized function\n * @param maxCacheSize Maximum size of the memoizer cache.\n * If the maximum cache size is exceeded, fulfilled/rejected entries are first discarded - these\n * may have been unclaimed/orphaned promises. If the cache size is still above the maxCacheSize\n * threshold, the entire cache is then cleared.\n */\n public constructor(memoizeFn: MemoizeFnType<T>, generateKeyFn: GenerateKeyFnType, maxCacheSize: number = 500, cacheTimeout: number = 30000) {\n this._memoizeFn = memoizeFn;\n this._generateKeyFn = generateKeyFn;\n this._maxCacheSize = maxCacheSize;\n this._cacheTimeout = cacheTimeout;\n }\n\n /** Call the memoized function */\n public memoize(...args: any[]): QueryablePromise<T> {\n const key: string = this._generateKeyFn(...args);\n let qp: QueryablePromise<T> | undefined = this._cachedPromises.get(key);\n if (qp)\n return qp;\n\n if (this._cachedPromises.size >= this._maxCacheSize) {\n if (this._maxCacheSize > 1)\n Logger.logError(BackendLoggerCategory.PromiseMemoizer, \"Cleared too many unresolved entries in memoizer cache\");\n this.clearCache();\n }\n\n const removeCachedPromise = (v: T) => {\n const cleanUp = () => {\n this._cachedPromises.delete(key);\n this._timers.delete(key);\n };\n this._timers.set(key, setTimeout(cleanUp, this._cacheTimeout));\n return v;\n };\n\n const p = this._memoizeFn(...args).then(removeCachedPromise, (e) => {\n throw removeCachedPromise(e);\n });\n\n qp = new QueryablePromise<T>(p);\n this._cachedPromises.set(key, qp);\n return qp;\n }\n\n /** Delete the memoized function */\n public deleteMemoized(...args: any[]) {\n const key: string = this._generateKeyFn(...args);\n this._cachedPromises.delete(key);\n const timer = this._timers.get(key);\n if (timer)\n clearTimeout(timer);\n }\n\n /** Clear all entries in the memoizer cache */\n public clearCache() {\n this._cachedPromises.clear();\n }\n\n public dispose() {\n for (const timer of this._timers.values())\n clearTimeout(timer);\n\n this._timers.clear();\n this.clearCache();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PromiseMemoizer.js","sourceRoot":"","sources":["../../src/PromiseMemoizer.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,sDAA0D;AAC1D,mEAAgE;AAEhE;;GAEG;AACH,MAAa,gBAAgB;IAO3B,IAAW,SAAS,KAAc,OAAO,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACjF,IAAW,WAAW,KAAc,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAC7D,IAAW,UAAU,KAAc,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAC3D,YAAmC,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;QAN9C,eAAU,GAAY,KAAK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K,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACvC,YAAY,CAAC,KAAK,CAAC,CAAC;QAEtB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;CACF;AA5ED,0CA4EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\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 { IDisposable, Logger } from \"@itwin/core-bentley\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\n\r\n/** Wrapper around a promise that allows synchronous queries of it's state\r\n * @internal\r\n */\r\nexport class QueryablePromise<T> {\r\n public result?: T;\r\n public error?: any;\r\n\r\n private _fulfilled: boolean = false;\r\n private _rejected: boolean = false;\r\n\r\n public get isPending(): boolean { return !this.isFulfilled && !this.isRejected; }\r\n public get isFulfilled(): boolean { return this._fulfilled; }\r\n public get isRejected(): boolean { return this._rejected; }\r\n public constructor(public readonly promise: Promise<T>) {\r\n this.promise.then((res: T) => {\r\n this.result = res;\r\n this._fulfilled = true;\r\n }).catch((err: any) => {\r\n this.error = err;\r\n this._rejected = true;\r\n });\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport type MemoizeFnType<T> = (...args: any[]) => Promise<T>;\r\n/** @internal */\r\nexport type GenerateKeyFnType = (...args: any[]) => string;\r\n\r\n/** Utility to cache and retrieve results of long running asynchronous functions.\r\n * The cache is keyed on the input arguments passed to these functions\r\n * @internal\r\n */\r\nexport class PromiseMemoizer<T> implements IDisposable {\r\n private readonly _cachedPromises: Map<string, QueryablePromise<T>> = new Map<string, QueryablePromise<T>>();\r\n private readonly _timers: Map<string, NodeJS.Timeout> = new Map<string, NodeJS.Timeout>();\r\n private readonly _memoizeFn: MemoizeFnType<T>;\r\n private readonly _generateKeyFn: GenerateKeyFnType;\r\n private readonly _maxCacheSize: number;\r\n private readonly _cacheTimeout: number;\r\n\r\n /**\r\n * Constructor\r\n * @param memoizeFn Function to memoize\r\n * @param generateKeyFn Function to generate the key for the memoized function\r\n * @param maxCacheSize Maximum size of the memoizer cache.\r\n * If the maximum cache size is exceeded, fulfilled/rejected entries are first discarded - these\r\n * may have been unclaimed/orphaned promises. If the cache size is still above the maxCacheSize\r\n * threshold, the entire cache is then cleared.\r\n */\r\n public constructor(memoizeFn: MemoizeFnType<T>, generateKeyFn: GenerateKeyFnType, maxCacheSize: number = 500, cacheTimeout: number = 30000) {\r\n this._memoizeFn = memoizeFn;\r\n this._generateKeyFn = generateKeyFn;\r\n this._maxCacheSize = maxCacheSize;\r\n this._cacheTimeout = cacheTimeout;\r\n }\r\n\r\n /** Call the memoized function */\r\n public memoize(...args: any[]): QueryablePromise<T> {\r\n const key: string = this._generateKeyFn(...args);\r\n let qp: QueryablePromise<T> | undefined = this._cachedPromises.get(key);\r\n if (qp)\r\n return qp;\r\n\r\n if (this._cachedPromises.size >= this._maxCacheSize) {\r\n if (this._maxCacheSize > 1)\r\n Logger.logError(BackendLoggerCategory.PromiseMemoizer, \"Cleared too many unresolved entries in memoizer cache\");\r\n this.clearCache();\r\n }\r\n\r\n const removeCachedPromise = (v: T) => {\r\n const cleanUp = () => {\r\n this._cachedPromises.delete(key);\r\n this._timers.delete(key);\r\n };\r\n this._timers.set(key, setTimeout(cleanUp, this._cacheTimeout));\r\n return v;\r\n };\r\n\r\n const p = this._memoizeFn(...args).then(removeCachedPromise, (e) => {\r\n throw removeCachedPromise(e);\r\n });\r\n\r\n qp = new QueryablePromise<T>(p);\r\n this._cachedPromises.set(key, qp);\r\n return qp;\r\n }\r\n\r\n /** Delete the memoized function */\r\n public deleteMemoized(...args: any[]) {\r\n const key: string = this._generateKeyFn(...args);\r\n this._cachedPromises.delete(key);\r\n const timer = this._timers.get(key);\r\n if (timer)\r\n clearTimeout(timer);\r\n }\r\n\r\n /** Clear all entries in the memoizer cache */\r\n public clearCache() {\r\n this._cachedPromises.clear();\r\n }\r\n\r\n public dispose() {\r\n for (const timer of this._timers.values())\r\n clearTimeout(timer);\r\n\r\n this._timers.clear();\r\n this.clearCache();\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyStore.js","sourceRoot":"","sources":["../../src/PropertyStore.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAO/F,+CAA4C;AAC5C,yCAA+C;AAG/C,YAAY;AACZ,IAAiB,aAAa,CAuP7B;AAvPD,WAAiB,aAAa;IAyB5B;;OAEG;IACH,MAAa,UAAW,SAAQ,4BAAiB;QAAjD;;YAC2B,cAAS,GAAG,OAAO,CAAC;QAgL/C,CAAC;QA9KoB,SAAS;YAC1B,IAAI,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,2CAA2C,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1H,CAAC;QAED;;WAEG;QACI,WAAW,CAAC,IAAkB;YACnC,OAAO,IAAI,CAAC,2BAA2B,CAAC,gDAAgD,EAAE,CAAC,IAAI,EAAE,EAAE;gBACjG,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;gBACzB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;oBACjB,OAAO,SAAS,CAAC;gBACnB,QAAQ,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC/B,KAAK,QAAQ;wBACX,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;oBAChC,KAAK,SAAS;wBACZ,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;oBACvC,KAAK,MAAM;wBACT,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;oBAC9B,KAAK,QAAQ;wBACX,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;oBAChC,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CAAC,CAAC;YACnC,OAAO,KAAK,CAAC;QACf,CAAC;KACF;IAvBY,yBAAW,cAuBvB,CAAA;AACH,CAAC,EAvPgB,aAAa,6BAAb,aAAa,QAuP7B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module SQLiteDb\n */\n\nimport { BlobContainer } from \"./BlobContainerService\";\nimport { CloudSqlite } from \"./CloudSqlite\";\nimport { VersionedSqliteDb } from \"./SQLiteDb\";\nimport { SettingsContainer } from \"./workspace/Settings\";\n\n/** @beta */\nexport namespace PropertyStore {\n\n /** The set of valid types for properties in a PropertyStore. */\n export type PropertyType = string | number | boolean | Uint8Array | SettingsContainer;\n /** The case-sensitive name of a Property. May not have leading or trailing spaces, and must be between 3 and 2048 characters long. */\n export type PropertyName = string;\n /** An array of PropertyName/PropertyType pairs to be stored in a PropertyStore. */\n export type PropertyArray = { name: PropertyName, value: PropertyType }[];\n /** The return status of an iteration function. The value \"stop\" causes the iteration to terminate. */\n export type IterationReturn = void | \"stop\";\n /** An iteration function over Properties in a PropertyStore. It is called with the name of a each Property. */\n export type PropertyIteration = (name: string) => IterationReturn;\n\n /** A filter used to limit and/or sort the values returned by an iteration. */\n export interface PropertyFilter {\n /** A value filter. May include wild cards when used with `GLOB` or `LIKE` */\n readonly value?: string;\n /** The comparison operator for `value`. Default is `=` */\n readonly valueCompare?: \"GLOB\" | \"LIKE\" | \"NOT GLOB\" | \"NOT LIKE\" | \"=\" | \"!=\" | \"<\" | \">\";\n /** Order results ascending or descending. If not supplied, the results are unordered (random). */\n readonly orderBy?: \"ASC\" | \"DESC\";\n /** An SQL expression to further filter results. This string is appended to the `WHERE` clause with an `AND` (that should not be part of the sqlExpression) */\n readonly sqlExpression?: string;\n }\n\n /**\n * A SQLite database for storing PropertyName/PropertyValue pairs.\n */\n export class PropertyDb extends VersionedSqliteDb {\n public override readonly myVersion = \"3.0.0\";\n\n protected override createDDL() {\n this.createTable({ tableName: \"properties\", columns: \"name TEXT NOT NULL PRIMARY KEY,type,value\", addTimestamp: true });\n }\n\n /** get the value of a Property by name.\n * @returns the property's value if it exists, `undefined` otherwise.\n */\n public getProperty(name: PropertyName): PropertyType | undefined {\n return this.withPreparedSqliteStatement(\"SELECT type,value from properties WHERE name=?\", (stmt) => {\n stmt.bindString(1, name);\n if (!stmt.nextRow())\n return undefined;\n switch (stmt.getValueString(0)) {\n case \"string\":\n return stmt.getValueString(1);\n case \"boolean\":\n return stmt.getValueInteger(1) !== 0;\n case \"blob\":\n return stmt.getValueBlob(1);\n case \"number\":\n return stmt.getValueDouble(1);\n case \"object\":\n return JSON.parse(stmt.getValueString(1)) as SettingsContainer;\n }\n return undefined;\n });\n }\n /** Get the value of a string property by name.\n * @returns the property's value if it exists and is a string, `undefined` otherwise.\n */\n public getString(name: PropertyName, defaultValue: string): string;\n /** Get the value of a string property by name.\n * @returns the property's value if it exists and is a string, otherwise the supplied default value.\n */\n public getString(name: PropertyName): string | undefined;\n public getString(name: PropertyName, defaultValue?: string): string | undefined {\n const out = this.getProperty(name);\n return typeof out === \"string\" ? out : defaultValue;\n }\n /** Get the value of a boolean property by name.\n * @returns the property's value if it exists and is a boolean, `undefined` otherwise.\n */\n public getBoolean(name: PropertyName): boolean | undefined;\n /** Get the value of a boolean property by name.\n * @returns the property's value if it exists and is a boolean, otherwise the supplied default value.\n */\n public getBoolean(name: PropertyName, defaultValue: boolean): boolean;\n public getBoolean(name: PropertyName, defaultValue?: boolean): boolean | undefined {\n const out = this.getProperty(name);\n return typeof out === \"boolean\" ? out : defaultValue;\n }\n /** Get the value of a number property by name.\n * @returns the property's value if it exists and is a number, `undefined` otherwise.\n */\n public getNumber(name: PropertyName): number | undefined;\n /** Get the value of a number property by name.\n * @returns the property's value if it exists and is a number, otherwise the supplied default value.\n */\n public getNumber(name: PropertyName, defaultValue: number): number;\n public getNumber(name: PropertyName, defaultValue?: number): number | undefined {\n const out = this.getProperty(name);\n return typeof out === \"number\" ? out : defaultValue;\n }\n /** Get the value of a blob property by name.\n * @returns the property's value if it exists and is a blob, `undefined` otherwise.\n */\n public getBlob(name: PropertyName): Uint8Array | undefined;\n /** Get the value of a blob property by name.\n * @returns the property's value if it exists and is a blob, otherwise the supplied default value.\n */\n public getBlob(name: PropertyName, defaultValue: Uint8Array): Uint8Array;\n public getBlob(name: PropertyName, defaultValue?: Uint8Array): Uint8Array | undefined {\n const out = this.getProperty(name);\n return out instanceof Uint8Array ? out : defaultValue;\n }\n /** Get the value of an object property by name.\n * @returns the property's value if it exists and is an object, `undefined` otherwise.\n */\n public getObject(name: PropertyName): SettingsContainer | undefined;\n /** Get the value of an object property by name.\n * @returns the property's value if it exists and is an object, otherwise the supplied default value.\n */\n public getObject(name: PropertyName, defaultValue: SettingsContainer): SettingsContainer;\n public getObject(name: PropertyName, defaultValue?: SettingsContainer): SettingsContainer | undefined {\n const out = this.getProperty(name);\n return typeof out === \"object\" ? out as SettingsContainer : defaultValue;\n }\n\n /** call an iteration function for each property, optionally applying a filter */\n public forAllProperties(iter: PropertyIteration, filter?: PropertyFilter) {\n let sql = \"SELECT name FROM properties WHERE name IS NOT NULL\";\n if (filter?.sqlExpression)\n sql += ` AND ${filter.sqlExpression} `;\n if (filter?.value)\n sql += ` AND name ${filter.valueCompare ?? \"=\"} @val`;\n if (filter?.orderBy)\n sql += ` ORDER BY name ${filter.orderBy} `;\n\n this.withSqliteStatement(sql, (stmt) => {\n if (filter?.value)\n stmt.bindString(\"@val\", filter.value);\n\n while (stmt.nextRow()) {\n if (iter(stmt.getValueString(0)) === \"stop\")\n return;\n }\n });\n }\n\n /** Delete a single property from this PropertyDb. If the value does not exist, this method does nothing.\n * @note the database must be opened for write\n */\n public async deleteProperty(propName: PropertyName) {\n this.withSqliteStatement(\"DELETE from properties WHERE name=?\", (stmt) => {\n stmt.bindString(1, propName);\n stmt.stepForWrite();\n });\n }\n /** Delete an array of properties from this PropertyDb. Any value that does not exist is ignored.\n * @note the database must be opened for write\n */\n public async deleteProperties(propNames: PropertyName[]) {\n propNames.forEach(async (name) => this.deleteProperty(name));\n }\n\n private validateName(name: PropertyName) {\n if (typeof name !== \"string\" || name.trim() !== name || name.length > 2 * 1024 || name.length < 2)\n throw new Error(`illegal property name[${name}]`);\n }\n\n /** Save a single property in this PropertyDb. If the property already exists, its value is overwritten.\n * @note the database must be opened for write\n */\n public async saveProperty(name: PropertyName, value: PropertyType) {\n this.validateName(name);\n this.withSqliteStatement(\"INSERT OR REPLACE INTO properties(name,type,value) VALUES (?,?,?)\", (stmt) => {\n stmt.bindString(1, name);\n switch (typeof value) {\n case \"string\":\n stmt.bindString(2, \"string\");\n stmt.bindString(3, value);\n break;\n case \"boolean\":\n stmt.bindString(2, \"boolean\");\n stmt.bindInteger(3, value ? 1 : 0);\n break;\n case \"number\":\n stmt.bindString(2, \"number\");\n stmt.bindDouble(3, value);\n break;\n case \"object\":\n if (value instanceof Uint8Array) {\n stmt.bindString(2, \"blob\");\n stmt.bindBlob(3, value);\n } else {\n stmt.bindString(2, \"object\");\n stmt.bindString(3, JSON.stringify(value));\n }\n break;\n default:\n throw new Error(\"illegal property value type\");\n }\n\n stmt.stepForWrite();\n });\n }\n\n /** Save an array of properties in this PropertyDb. If a property already exists, its value is overwritten.\n * @note the database must be opened for write\n */\n public async saveProperties(props: PropertyArray) {\n for (const prop of props)\n await this.saveProperty(prop.name, prop.value);\n }\n }\n\n const defaultDbName = \"PropertyDb\" as const;\n\n export interface CreateNewContainerProps {\n scope: BlobContainer.Scope;\n metadata: Omit<BlobContainer.Metadata, \"containerType\">;\n }\n\n /**\n * Provides access to a cloud-based `PropertyDb` to hold a set of values of type `PropertyType`, each with a unique `PropertyName`.\n * `PropertyStore.PropertyDb`s that are stored in cloud containers require an access token that grants permission to read and/or write them.\n * All write operations will fail without an access token that grants write permission.\n *\n * The database is cached on a local drive so reads are fast and inexpensive, and may even be done offline after a prefetch.\n * However, that means that callers are responsible for synchronizing the local cache to ensure it includes changes\n * made by others, as appropriate (see [[synchronizeWithCloud]]).\n */\n export class CloudAccess extends CloudSqlite.DbAccess<PropertyDb> {\n public constructor(props: CloudSqlite.ContainerAccessProps) {\n super({ dbType: PropertyDb, props, dbName: defaultDbName });\n }\n\n /**\n * Initialize a cloud container for use as a PropertyStore. This method is called by [[createNewContainer]].\n * It is only necessary to convert an existing container to a PropertyStore container.\n * @note this deletes any existing content in the container.\n * @internal\n */\n public static async initializeDb(args: { props: CloudSqlite.ContainerProps }) {\n return super._initializeDb({ ...args, dbType: PropertyDb, dbName: defaultDbName });\n }\n\n /** Create and initialize a new BlobContainer to hold a PropertyStore\n * @note the current user must have administrator rights to create containers.\n */\n public static async createNewContainer(args: CreateNewContainerProps): Promise<CloudSqlite.ContainerProps> {\n const props = await this.createBlobContainer({ scope: args.scope, metadata: { ...args.metadata, containerType: \"property-store\" } });\n await this.initializeDb({ props });\n return props;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PropertyStore.js","sourceRoot":"","sources":["../../src/PropertyStore.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAO/F,+CAA4C;AAC5C,yCAA+C;AAG/C,YAAY;AACZ,IAAiB,aAAa,CAuP7B;AAvPD,WAAiB,aAAa;IAyB5B;;OAEG;IACH,MAAa,UAAW,SAAQ,4BAAiB;QAAjD;;YAC2B,cAAS,GAAG,OAAO,CAAC;QAgL/C,CAAC;QA9KoB,SAAS;YAC1B,IAAI,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,2CAA2C,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1H,CAAC;QAED;;WAEG;QACI,WAAW,CAAC,IAAkB;YACnC,OAAO,IAAI,CAAC,2BAA2B,CAAC,gDAAgD,EAAE,CAAC,IAAI,EAAE,EAAE;gBACjG,IAAI,CAAC,UAAU,CAAC,CAAC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KAAK,CAAC,YAAY,CAAC,IAA2C;YAC1E,OAAO,KAAK,CAAC,aAAa,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;QACrF,CAAC;QAED;;WAEG;QACI,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAA6B;YAClE,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;YACrI,MAAM,IAAI,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;YACnC,OAAO,KAAK,CAAC;QACf,CAAC;KACF;IAvBY,yBAAW,cAuBvB,CAAA;AACH,CAAC,EAvPgB,aAAa,6BAAb,aAAa,QAuP7B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module SQLiteDb\r\n */\r\n\r\nimport { BlobContainer } from \"./BlobContainerService\";\r\nimport { CloudSqlite } from \"./CloudSqlite\";\r\nimport { VersionedSqliteDb } from \"./SQLiteDb\";\r\nimport { SettingsContainer } from \"./workspace/Settings\";\r\n\r\n/** @beta */\r\nexport namespace PropertyStore {\r\n\r\n /** The set of valid types for properties in a PropertyStore. */\r\n export type PropertyType = string | number | boolean | Uint8Array | SettingsContainer;\r\n /** The case-sensitive name of a Property. May not have leading or trailing spaces, and must be between 3 and 2048 characters long. */\r\n export type PropertyName = string;\r\n /** An array of PropertyName/PropertyType pairs to be stored in a PropertyStore. */\r\n export type PropertyArray = { name: PropertyName, value: PropertyType }[];\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 /** An iteration function over Properties in a PropertyStore. It is called with the name of a each Property. */\r\n export type PropertyIteration = (name: string) => IterationReturn;\r\n\r\n /** A filter used to limit and/or sort the values returned by an iteration. */\r\n export interface PropertyFilter {\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 /**\r\n * A SQLite database for storing PropertyName/PropertyValue pairs.\r\n */\r\n export class PropertyDb extends VersionedSqliteDb {\r\n public override readonly myVersion = \"3.0.0\";\r\n\r\n protected override createDDL() {\r\n this.createTable({ tableName: \"properties\", columns: \"name TEXT NOT NULL PRIMARY KEY,type,value\", addTimestamp: true });\r\n }\r\n\r\n /** get the value of a Property by name.\r\n * @returns the property's value if it exists, `undefined` otherwise.\r\n */\r\n public getProperty(name: PropertyName): PropertyType | undefined {\r\n return this.withPreparedSqliteStatement(\"SELECT type,value from properties WHERE name=?\", (stmt) => {\r\n stmt.bindString(1, name);\r\n if (!stmt.nextRow())\r\n return undefined;\r\n switch (stmt.getValueString(0)) {\r\n case \"string\":\r\n return stmt.getValueString(1);\r\n case \"boolean\":\r\n return stmt.getValueInteger(1) !== 0;\r\n case \"blob\":\r\n return stmt.getValueBlob(1);\r\n case \"number\":\r\n return stmt.getValueDouble(1);\r\n case \"object\":\r\n return JSON.parse(stmt.getValueString(1)) as SettingsContainer;\r\n }\r\n return undefined;\r\n });\r\n }\r\n /** Get the value of a string property by name.\r\n * @returns the property's value if it exists and is a string, `undefined` otherwise.\r\n */\r\n public getString(name: PropertyName, defaultValue: string): string;\r\n /** Get the value of a string property by name.\r\n * @returns the property's value if it exists and is a string, otherwise the supplied default value.\r\n */\r\n public getString(name: PropertyName): string | undefined;\r\n public getString(name: PropertyName, defaultValue?: string): string | undefined {\r\n const out = this.getProperty(name);\r\n return typeof out === \"string\" ? out : defaultValue;\r\n }\r\n /** Get the value of a boolean property by name.\r\n * @returns the property's value if it exists and is a boolean, `undefined` otherwise.\r\n */\r\n public getBoolean(name: PropertyName): boolean | undefined;\r\n /** Get the value of a boolean property by name.\r\n * @returns the property's value if it exists and is a boolean, otherwise the supplied default value.\r\n */\r\n public getBoolean(name: PropertyName, defaultValue: boolean): boolean;\r\n public getBoolean(name: PropertyName, defaultValue?: boolean): boolean | undefined {\r\n const out = this.getProperty(name);\r\n return typeof out === \"boolean\" ? out : defaultValue;\r\n }\r\n /** Get the value of a number property by name.\r\n * @returns the property's value if it exists and is a number, `undefined` otherwise.\r\n */\r\n public getNumber(name: PropertyName): number | undefined;\r\n /** Get the value of a number property by name.\r\n * @returns the property's value if it exists and is a number, otherwise the supplied default value.\r\n */\r\n public getNumber(name: PropertyName, defaultValue: number): number;\r\n public getNumber(name: PropertyName, defaultValue?: number): number | undefined {\r\n const out = this.getProperty(name);\r\n return typeof out === \"number\" ? out : defaultValue;\r\n }\r\n /** Get the value of a blob property by name.\r\n * @returns the property's value if it exists and is a blob, `undefined` otherwise.\r\n */\r\n public getBlob(name: PropertyName): Uint8Array | undefined;\r\n /** Get the value of a blob property by name.\r\n * @returns the property's value if it exists and is a blob, otherwise the supplied default value.\r\n */\r\n public getBlob(name: PropertyName, defaultValue: Uint8Array): Uint8Array;\r\n public getBlob(name: PropertyName, defaultValue?: Uint8Array): Uint8Array | undefined {\r\n const out = this.getProperty(name);\r\n return out instanceof Uint8Array ? out : defaultValue;\r\n }\r\n /** Get the value of an object property by name.\r\n * @returns the property's value if it exists and is an object, `undefined` otherwise.\r\n */\r\n public getObject(name: PropertyName): SettingsContainer | undefined;\r\n /** Get the value of an object property by name.\r\n * @returns the property's value if it exists and is an object, otherwise the supplied default value.\r\n */\r\n public getObject(name: PropertyName, defaultValue: SettingsContainer): SettingsContainer;\r\n public getObject(name: PropertyName, defaultValue?: SettingsContainer): SettingsContainer | undefined {\r\n const out = this.getProperty(name);\r\n return typeof out === \"object\" ? out as SettingsContainer : defaultValue;\r\n }\r\n\r\n /** call an iteration function for each property, optionally applying a filter */\r\n public forAllProperties(iter: PropertyIteration, filter?: PropertyFilter) {\r\n let sql = \"SELECT name FROM properties WHERE name IS NOT NULL\";\r\n if (filter?.sqlExpression)\r\n sql += ` AND ${filter.sqlExpression} `;\r\n if (filter?.value)\r\n sql += ` AND name ${filter.valueCompare ?? \"=\"} @val`;\r\n if (filter?.orderBy)\r\n sql += ` ORDER BY name ${filter.orderBy} `;\r\n\r\n this.withSqliteStatement(sql, (stmt) => {\r\n if (filter?.value)\r\n stmt.bindString(\"@val\", filter.value);\r\n\r\n while (stmt.nextRow()) {\r\n if (iter(stmt.getValueString(0)) === \"stop\")\r\n return;\r\n }\r\n });\r\n }\r\n\r\n /** Delete a single property from this PropertyDb. If the value does not exist, this method does nothing.\r\n * @note the database must be opened for write\r\n */\r\n public async deleteProperty(propName: PropertyName) {\r\n this.withSqliteStatement(\"DELETE from properties WHERE name=?\", (stmt) => {\r\n stmt.bindString(1, propName);\r\n stmt.stepForWrite();\r\n });\r\n }\r\n /** Delete an array of properties from this PropertyDb. Any value that does not exist is ignored.\r\n * @note the database must be opened for write\r\n */\r\n public async deleteProperties(propNames: PropertyName[]) {\r\n propNames.forEach(async (name) => this.deleteProperty(name));\r\n }\r\n\r\n private validateName(name: PropertyName) {\r\n if (typeof name !== \"string\" || name.trim() !== name || name.length > 2 * 1024 || name.length < 2)\r\n throw new Error(`illegal property name[${name}]`);\r\n }\r\n\r\n /** Save a single property in this PropertyDb. If the property already exists, its value is overwritten.\r\n * @note the database must be opened for write\r\n */\r\n public async saveProperty(name: PropertyName, value: PropertyType) {\r\n this.validateName(name);\r\n this.withSqliteStatement(\"INSERT OR REPLACE INTO properties(name,type,value) VALUES (?,?,?)\", (stmt) => {\r\n stmt.bindString(1, name);\r\n switch (typeof value) {\r\n case \"string\":\r\n stmt.bindString(2, \"string\");\r\n stmt.bindString(3, value);\r\n break;\r\n case \"boolean\":\r\n stmt.bindString(2, \"boolean\");\r\n stmt.bindInteger(3, value ? 1 : 0);\r\n break;\r\n case \"number\":\r\n stmt.bindString(2, \"number\");\r\n stmt.bindDouble(3, value);\r\n break;\r\n case \"object\":\r\n if (value instanceof Uint8Array) {\r\n stmt.bindString(2, \"blob\");\r\n stmt.bindBlob(3, value);\r\n } else {\r\n stmt.bindString(2, \"object\");\r\n stmt.bindString(3, JSON.stringify(value));\r\n }\r\n break;\r\n default:\r\n throw new Error(\"illegal property value type\");\r\n }\r\n\r\n stmt.stepForWrite();\r\n });\r\n }\r\n\r\n /** Save an array of properties in this PropertyDb. If a property already exists, its value is overwritten.\r\n * @note the database must be opened for write\r\n */\r\n public async saveProperties(props: PropertyArray) {\r\n for (const prop of props)\r\n await this.saveProperty(prop.name, prop.value);\r\n }\r\n }\r\n\r\n const defaultDbName = \"PropertyDb\" as const;\r\n\r\n export interface CreateNewContainerProps {\r\n scope: BlobContainer.Scope;\r\n metadata: Omit<BlobContainer.Metadata, \"containerType\">;\r\n }\r\n\r\n /**\r\n * Provides access to a cloud-based `PropertyDb` to hold a set of values of type `PropertyType`, each with a unique `PropertyName`.\r\n * `PropertyStore.PropertyDb`s that are stored in cloud containers require an access token that grants permission to read and/or write them.\r\n * All write operations will fail without an access token that grants write permission.\r\n *\r\n * The database is cached on a local drive so reads are fast and inexpensive, and may even be done offline after a prefetch.\r\n * However, that means that callers are responsible for synchronizing the local cache to ensure it includes changes\r\n * made by others, as appropriate (see [[synchronizeWithCloud]]).\r\n */\r\n export class CloudAccess extends CloudSqlite.DbAccess<PropertyDb> {\r\n public constructor(props: CloudSqlite.ContainerAccessProps) {\r\n super({ dbType: PropertyDb, props, dbName: defaultDbName });\r\n }\r\n\r\n /**\r\n * Initialize a cloud container for use as a PropertyStore. This method is called by [[createNewContainer]].\r\n * It is only necessary to convert an existing container to a PropertyStore container.\r\n * @note this deletes any existing content in the container.\r\n * @internal\r\n */\r\n public static async initializeDb(args: { props: CloudSqlite.ContainerProps }) {\r\n return super._initializeDb({ ...args, dbType: PropertyDb, dbName: defaultDbName });\r\n }\r\n\r\n /** Create and initialize a new BlobContainer to hold a PropertyStore\r\n * @note the current user must have administrator rights to create containers.\r\n */\r\n public static async createNewContainer(args: CreateNewContainerProps): Promise<CloudSqlite.ContainerProps> {\r\n const props = await this.createBlobContainer({ scope: args.scope, metadata: { ...args.metadata, containerType: \"property-store\" } });\r\n await this.initializeDb({ props });\r\n return props;\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -10,7 +10,6 @@ export type { SourceAndTarget, RelationshipProps } from "@itwin/core-common";
|
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
12
|
export declare class Relationship extends Entity {
|
|
13
|
-
/** @internal */
|
|
14
13
|
static get className(): string;
|
|
15
14
|
readonly sourceId: Id64String;
|
|
16
15
|
readonly targetId: Id64String;
|
|
@@ -43,7 +42,6 @@ export declare class Relationship extends Entity {
|
|
|
43
42
|
* @public
|
|
44
43
|
*/
|
|
45
44
|
export declare class ElementRefersToElements extends Relationship {
|
|
46
|
-
/** @internal */
|
|
47
45
|
static get className(): string;
|
|
48
46
|
/** Create an instance of the Relationship.
|
|
49
47
|
* @param iModel The iModel that will contain the relationship
|
|
@@ -65,14 +63,12 @@ export declare class ElementRefersToElements extends Relationship {
|
|
|
65
63
|
* @public
|
|
66
64
|
*/
|
|
67
65
|
export declare class DrawingGraphicRepresentsElement extends ElementRefersToElements {
|
|
68
|
-
/** @internal */
|
|
69
66
|
static get className(): string;
|
|
70
67
|
}
|
|
71
68
|
/** Relates a [[GraphicalElement3d]] to the [[Element]] that it represents
|
|
72
69
|
* @public
|
|
73
70
|
*/
|
|
74
71
|
export declare class GraphicalElement3dRepresentsElement extends ElementRefersToElements {
|
|
75
|
-
/** @internal */
|
|
76
72
|
static get className(): string;
|
|
77
73
|
}
|
|
78
74
|
/** Relates a [[SynchronizationConfigLink]] to N [[ExternalSource]] instances.
|
|
@@ -81,7 +77,6 @@ export declare class GraphicalElement3dRepresentsElement extends ElementRefersTo
|
|
|
81
77
|
* @beta
|
|
82
78
|
*/
|
|
83
79
|
export declare class SynchronizationConfigProcessesSources extends ElementRefersToElements {
|
|
84
|
-
/** @internal */
|
|
85
80
|
static get className(): string;
|
|
86
81
|
}
|
|
87
82
|
/** Relates a [[SynchronizationConfigLink]] to *root* [[ExternalSource]] instances.
|
|
@@ -89,7 +84,6 @@ export declare class SynchronizationConfigProcessesSources extends ElementRefers
|
|
|
89
84
|
* @beta
|
|
90
85
|
*/
|
|
91
86
|
export declare class SynchronizationConfigSpecifiesRootSources extends SynchronizationConfigProcessesSources {
|
|
92
|
-
/** @internal */
|
|
93
87
|
static get className(): string;
|
|
94
88
|
}
|
|
95
89
|
/** Properties that are common to all types of link table ECRelationships
|
|
@@ -102,7 +96,6 @@ export interface ElementGroupsMembersProps extends RelationshipProps {
|
|
|
102
96
|
* @public
|
|
103
97
|
*/
|
|
104
98
|
export declare class ElementGroupsMembers extends ElementRefersToElements {
|
|
105
|
-
/** @internal */
|
|
106
99
|
static get className(): string;
|
|
107
100
|
memberPriority: number;
|
|
108
101
|
constructor(props: ElementGroupsMembersProps, iModel: IModelDb);
|
|
@@ -113,7 +106,6 @@ export declare class ElementGroupsMembers extends ElementRefersToElements {
|
|
|
113
106
|
* @public
|
|
114
107
|
*/
|
|
115
108
|
export declare class DefinitionGroupGroupsDefinitions extends ElementGroupsMembers {
|
|
116
|
-
/** @internal */
|
|
117
109
|
static get className(): string;
|
|
118
110
|
}
|
|
119
111
|
/** Represents group membership where the group Element (and its properties) impart information about the member Elements above mere membership.
|
|
@@ -122,7 +114,6 @@ export declare class DefinitionGroupGroupsDefinitions extends ElementGroupsMembe
|
|
|
122
114
|
* @public
|
|
123
115
|
*/
|
|
124
116
|
export declare class GroupImpartsToMembers extends ElementGroupsMembers {
|
|
125
|
-
/** @internal */
|
|
126
117
|
static get className(): string;
|
|
127
118
|
}
|
|
128
119
|
/** Relates an [[ExternalSourceGroup]] to its [[ExternalSource]] members.
|
|
@@ -130,7 +121,6 @@ export declare class GroupImpartsToMembers extends ElementGroupsMembers {
|
|
|
130
121
|
* @beta
|
|
131
122
|
*/
|
|
132
123
|
export declare class ExternalSourceGroupGroupsSources extends ElementGroupsMembers {
|
|
133
|
-
/** @internal */
|
|
134
124
|
static get className(): string;
|
|
135
125
|
}
|
|
136
126
|
/** Properties that are common to all types of ElementDrivesElements
|
|
@@ -325,7 +315,6 @@ export interface ElementDrivesElementProps extends RelationshipProps {
|
|
|
325
315
|
* @beta
|
|
326
316
|
*/
|
|
327
317
|
export declare class ElementDrivesElement extends Relationship {
|
|
328
|
-
/** @internal */
|
|
329
318
|
static get className(): string;
|
|
330
319
|
/** Relationship status
|
|
331
320
|
* * 0 indicates no errors. Set after a successful evaluation.
|
|
@@ -347,7 +336,6 @@ export declare class ElementDrivesElement extends Relationship {
|
|
|
347
336
|
* @internal
|
|
348
337
|
*/
|
|
349
338
|
export declare class ModelSelectorRefersToModels extends Relationship {
|
|
350
|
-
/** @internal */
|
|
351
339
|
static get className(): string;
|
|
352
340
|
protected collectReferenceIds(referenceIds: EntityReferenceSet): void;
|
|
353
341
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Relationship.d.ts","sourceRoot":"","sources":["../../src/Relationship.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAkB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAA6B,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEvH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,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EAAE,iBAAiB,GAAG,YAAY;IAE7D,2EAA2E;IAC3E,OAAO,CAAC,sBAAsB;IAM9B;;;;OAIG;IACI,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,UAAU;IAK3D;;OAEG;IACI,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI;IAIrD,wDAAwD;IACjD,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI;IAIrD;;;;;OAKG;IACI,gBAAgB,CAAC,CAAC,SAAS,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,eAAe,GAAG,CAAC;IAQzH;;;;;;OAMG;IACI,mBAAmB,CAAC,CAAC,SAAS,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,eAAe,GAAG,CAAC,GAAG,SAAS;IAoBxI;;;;;OAKG;IACI,WAAW,CAAC,CAAC,SAAS,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,eAAe,GAAG,CAAC;IAI9G;;;;;;OAMG;IACI,cAAc,CAAC,CAAC,SAAS,YAAY,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,eAAe,GAAG,CAAC,GAAG,SAAS;CAI/H"}
|
package/lib/cjs/Relationship.js
CHANGED
|
@@ -11,11 +11,11 @@ exports.Relationships = exports.ModelSelectorRefersToModels = exports.ElementDri
|
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
12
|
const core_common_1 = require("@itwin/core-common");
|
|
13
13
|
const Entity_1 = require("./Entity");
|
|
14
|
+
const Symbols_1 = require("./internal/Symbols");
|
|
14
15
|
/** Base class for all link table ECRelationships
|
|
15
16
|
* @public
|
|
16
17
|
*/
|
|
17
18
|
class Relationship extends Entity_1.Entity {
|
|
18
|
-
/** @internal */
|
|
19
19
|
static get className() { return "Relationship"; }
|
|
20
20
|
constructor(props, iModel) {
|
|
21
21
|
super(props, iModel);
|
|
@@ -56,7 +56,6 @@ exports.Relationship = Relationship;
|
|
|
56
56
|
* @public
|
|
57
57
|
*/
|
|
58
58
|
class ElementRefersToElements extends Relationship {
|
|
59
|
-
/** @internal */
|
|
60
59
|
static get className() { return "ElementRefersToElements"; }
|
|
61
60
|
/** Create an instance of the Relationship.
|
|
62
61
|
* @param iModel The iModel that will contain the relationship
|
|
@@ -88,7 +87,6 @@ exports.ElementRefersToElements = ElementRefersToElements;
|
|
|
88
87
|
* @public
|
|
89
88
|
*/
|
|
90
89
|
class DrawingGraphicRepresentsElement extends ElementRefersToElements {
|
|
91
|
-
/** @internal */
|
|
92
90
|
static get className() { return "DrawingGraphicRepresentsElement"; }
|
|
93
91
|
}
|
|
94
92
|
exports.DrawingGraphicRepresentsElement = DrawingGraphicRepresentsElement;
|
|
@@ -96,7 +94,6 @@ exports.DrawingGraphicRepresentsElement = DrawingGraphicRepresentsElement;
|
|
|
96
94
|
* @public
|
|
97
95
|
*/
|
|
98
96
|
class GraphicalElement3dRepresentsElement extends ElementRefersToElements {
|
|
99
|
-
/** @internal */
|
|
100
97
|
static get className() { return "GraphicalElement3dRepresentsElement"; }
|
|
101
98
|
}
|
|
102
99
|
exports.GraphicalElement3dRepresentsElement = GraphicalElement3dRepresentsElement;
|
|
@@ -106,7 +103,6 @@ exports.GraphicalElement3dRepresentsElement = GraphicalElement3dRepresentsElemen
|
|
|
106
103
|
* @beta
|
|
107
104
|
*/
|
|
108
105
|
class SynchronizationConfigProcessesSources extends ElementRefersToElements {
|
|
109
|
-
/** @internal */
|
|
110
106
|
static get className() { return "SynchronizationConfigProcessesSources"; }
|
|
111
107
|
}
|
|
112
108
|
exports.SynchronizationConfigProcessesSources = SynchronizationConfigProcessesSources;
|
|
@@ -115,7 +111,6 @@ exports.SynchronizationConfigProcessesSources = SynchronizationConfigProcessesSo
|
|
|
115
111
|
* @beta
|
|
116
112
|
*/
|
|
117
113
|
class SynchronizationConfigSpecifiesRootSources extends SynchronizationConfigProcessesSources {
|
|
118
|
-
/** @internal */
|
|
119
114
|
static get className() { return "SynchronizationConfigSpecifiesRootSources"; }
|
|
120
115
|
}
|
|
121
116
|
exports.SynchronizationConfigSpecifiesRootSources = SynchronizationConfigSpecifiesRootSources;
|
|
@@ -123,7 +118,6 @@ exports.SynchronizationConfigSpecifiesRootSources = SynchronizationConfigSpecifi
|
|
|
123
118
|
* @public
|
|
124
119
|
*/
|
|
125
120
|
class ElementGroupsMembers extends ElementRefersToElements {
|
|
126
|
-
/** @internal */
|
|
127
121
|
static get className() { return "ElementGroupsMembers"; }
|
|
128
122
|
constructor(props, iModel) {
|
|
129
123
|
super(props, iModel);
|
|
@@ -140,7 +134,6 @@ exports.ElementGroupsMembers = ElementGroupsMembers;
|
|
|
140
134
|
* @public
|
|
141
135
|
*/
|
|
142
136
|
class DefinitionGroupGroupsDefinitions extends ElementGroupsMembers {
|
|
143
|
-
/** @internal */
|
|
144
137
|
static get className() { return "DefinitionGroupGroupsDefinitions"; }
|
|
145
138
|
}
|
|
146
139
|
exports.DefinitionGroupGroupsDefinitions = DefinitionGroupGroupsDefinitions;
|
|
@@ -150,7 +143,6 @@ exports.DefinitionGroupGroupsDefinitions = DefinitionGroupGroupsDefinitions;
|
|
|
150
143
|
* @public
|
|
151
144
|
*/
|
|
152
145
|
class GroupImpartsToMembers extends ElementGroupsMembers {
|
|
153
|
-
/** @internal */
|
|
154
146
|
static get className() { return "GroupImpartsToMembers"; }
|
|
155
147
|
}
|
|
156
148
|
exports.GroupImpartsToMembers = GroupImpartsToMembers;
|
|
@@ -159,7 +151,6 @@ exports.GroupImpartsToMembers = GroupImpartsToMembers;
|
|
|
159
151
|
* @beta
|
|
160
152
|
*/
|
|
161
153
|
class ExternalSourceGroupGroupsSources extends ElementGroupsMembers {
|
|
162
|
-
/** @internal */
|
|
163
154
|
static get className() { return "ExternalSourceGroupGroupsSources"; }
|
|
164
155
|
}
|
|
165
156
|
exports.ExternalSourceGroupGroupsSources = ExternalSourceGroupGroupsSources;
|
|
@@ -348,7 +339,6 @@ exports.ExternalSourceGroupGroupsSources = ExternalSourceGroupGroupsSources;
|
|
|
348
339
|
* @beta
|
|
349
340
|
*/
|
|
350
341
|
class ElementDrivesElement extends Relationship {
|
|
351
|
-
/** @internal */
|
|
352
342
|
static get className() { return "ElementDrivesElement"; }
|
|
353
343
|
constructor(props, iModel) {
|
|
354
344
|
super(props, iModel);
|
|
@@ -379,7 +369,6 @@ exports.ElementDrivesElement = ElementDrivesElement;
|
|
|
379
369
|
* @internal
|
|
380
370
|
*/
|
|
381
371
|
class ModelSelectorRefersToModels extends Relationship {
|
|
382
|
-
/** @internal */
|
|
383
372
|
static get className() { return "ModelSelectorRefersToModels"; }
|
|
384
373
|
collectReferenceIds(referenceIds) {
|
|
385
374
|
super.collectReferenceIds(referenceIds);
|
|
@@ -401,7 +390,7 @@ class Relationships {
|
|
|
401
390
|
createInstance(props) { return this._iModel.constructEntity(props); }
|
|
402
391
|
/** Check classFullName to ensure it is a link table relationship class. */
|
|
403
392
|
checkRelationshipClass(classFullName) {
|
|
404
|
-
if (!this._iModel.
|
|
393
|
+
if (!this._iModel[Symbols_1._nativeDb].isLinkTableRelationship(classFullName.replace(".", ":"))) {
|
|
405
394
|
throw new core_common_1.IModelError(core_bentley_1.DbResult.BE_SQLITE_ERROR, `Class '${classFullName}' must be a relationship class and it should be subclass of BisCore:ElementRefersToElements or BisCore:ElementDrivesElement.`);
|
|
406
395
|
}
|
|
407
396
|
}
|
|
@@ -412,17 +401,17 @@ class Relationships {
|
|
|
412
401
|
*/
|
|
413
402
|
insertInstance(props) {
|
|
414
403
|
this.checkRelationshipClass(props.classFullName);
|
|
415
|
-
return props.id = this._iModel.
|
|
404
|
+
return props.id = this._iModel[Symbols_1._nativeDb].insertLinkTableRelationship(props);
|
|
416
405
|
}
|
|
417
406
|
/** Update the properties of an existing relationship instance in the iModel.
|
|
418
407
|
* @param props the properties of the relationship instance to update. Any properties that are not present will be left unchanged.
|
|
419
408
|
*/
|
|
420
409
|
updateInstance(props) {
|
|
421
|
-
this._iModel.
|
|
410
|
+
this._iModel[Symbols_1._nativeDb].updateLinkTableRelationship(props);
|
|
422
411
|
}
|
|
423
412
|
/** Delete an Relationship instance from this iModel. */
|
|
424
413
|
deleteInstance(props) {
|
|
425
|
-
this._iModel.
|
|
414
|
+
this._iModel[Symbols_1._nativeDb].deleteLinkTableRelationship(props);
|
|
426
415
|
}
|
|
427
416
|
/** Get the props of a Relationship instance
|
|
428
417
|
* @param relClassFullName The full class name of the relationship in the form of "schema:class"
|