From 877456d76a3bf8bf85a75fec16306c1199a6c4a9 Mon Sep 17 00:00:00 2001 From: Nam Le <50554904+hl662@users.noreply.github.com> Date: Wed, 22 Jan 2025 10:01:50 -0500 Subject: [PATCH 1/4] remove transformer related apis --- core/backend/src/Element.ts | 17 ----------------- core/backend/src/Entity.ts | 13 ------------- 2 files changed, 30 deletions(-) diff --git a/core/backend/src/Element.ts b/core/backend/src/Element.ts index 426127137e4b..df20fa48aef4 100644 --- a/core/backend/src/Element.ts +++ b/core/backend/src/Element.ts @@ -355,14 +355,6 @@ export class Element extends Entity { return val; } - /** Collect the Ids of this element's *references* at this level of the class hierarchy. - * @deprecated in 3.x. use [[collectReferenceIds]] instead, the use of the term *predecessors* was confusing and became inaccurate when the transformer could handle cycles - * @beta - */ - protected collectPredecessorIds(predecessorIds: EntityReferenceSet): void { - return this.collectReferenceIds(predecessorIds); - } - protected override collectReferenceIds(referenceIds: EntityReferenceSet): void { super.collectReferenceIds(referenceIds); referenceIds.addModel(this.model); // The modeledElement is a reference @@ -372,15 +364,6 @@ export class Element extends Entity { referenceIds.addElement(this.parent.id); // A parent element is a reference } - /** Get the Ids of this element's *references*. A *reference* is any element whose id is stored in the EC data of this element - * This is important for cloning operations but can be useful in other situations as well. - * @beta - * @deprecated in 3.x. use [[getReferenceIds]] instead, the use of the term *predecessors* was confusing and became inaccurate when the transformer could handle cycles - */ - public getPredecessorIds(): Id64Set { - return this.getReferenceIds(); - } - /** A *required reference* is an element that had to be inserted before this element could have been inserted. * This is the list of property keys on this element that store references to those elements * @note This should be overridden (with `super` called) at each level of the class hierarchy that introduces required references. diff --git a/core/backend/src/Entity.ts b/core/backend/src/Entity.ts index ab6a2e2348c9..cec2634c63c2 100644 --- a/core/backend/src/Entity.ts +++ b/core/backend/src/Entity.ts @@ -124,13 +124,6 @@ export class Entity { return referenceIds; } - /** kept rename for older transformer versions - * @deprecated in 3.x . Use [[getReferenceIds]] instead - * @internal - */ - // eslint-disable-next-line @typescript-eslint/unbound-method - public getReferenceConcreteIds = this.getReferenceIds; - /** Collect the Ids of this entity's *references* at this level of the class hierarchy. * A *reference* is any entity referenced by this entity's EC Data, including json fields. * This is important for cloning operations but can be useful in other situations as well. @@ -143,12 +136,6 @@ export class Entity { return; // no references by default } - /** kept rename for older transformer versions - * @deprecated in 3.x . Use [[collectReferenceIds]] instead - * @internal - */ - // eslint-disable-next-line @typescript-eslint/unbound-method - protected collectReferenceConcreteIds = this.collectReferenceIds; } /** Parameter type that can accept both abstract constructor types and non-abstract constructor types for `instanceof` to test. From 8994b1f993cd731a470a4bc32d022caf0277e571 Mon Sep 17 00:00:00 2001 From: Nam Le <50554904+hl662@users.noreply.github.com> Date: Wed, 22 Jan 2025 10:44:42 -0500 Subject: [PATCH 2/4] Elevate BackendHubAccess, IModelHost.hubAccess to public --- core/backend/src/BackendHubAccess.ts | 10 ++-------- core/backend/src/IModelHost.ts | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/core/backend/src/BackendHubAccess.ts b/core/backend/src/BackendHubAccess.ts index 614f6025b2fe..db4efbd9f7c2 100644 --- a/core/backend/src/BackendHubAccess.ts +++ b/core/backend/src/BackendHubAccess.ts @@ -167,12 +167,6 @@ export interface DownloadChangesetRangeArg extends ChangesetRangeArg, DownloadPr targetDir: LocalDirName; } -/** - * @deprecated in 3.x. Use [[DownloadRequest]]. - * @internal - */ -export type CheckpointArg = DownloadRequest; - /** * Arguments to create a new iModel in iModelHub * @public @@ -188,7 +182,7 @@ export interface CreateNewIModelProps extends IModelNameArg { * Generally direct access to these methods should not be required, since higher-level apis are provided. * @note This interface is implemented in another repository. Any changes made to this interface must be validated against * the implementation found here: https://github.com/iTwin/imodels-clients/blob/main/itwin-platform-access/imodels-access-backend/src/BackendIModelsAccess.ts - * @internal + * @public */ export interface BackendHubAccess { /** Download all the changesets in the specified range. */ @@ -223,7 +217,7 @@ export interface BackendHubAccess { * @deprecated in 3.x. V1 checkpoints are deprecated. Download V2 checkpoint using [[V2CheckpointManager.downloadCheckpoint]]. * @internal */ - downloadV1Checkpoint: (arg: CheckpointArg) => Promise; // eslint-disable-line @typescript-eslint/no-deprecated + downloadV1Checkpoint: (arg: DownloadRequest) => Promise; // eslint-disable-line @typescript-eslint/no-deprecated /** * Get the access props for a V2 checkpoint. Returns undefined if no V2 checkpoint exists. diff --git a/core/backend/src/IModelHost.ts b/core/backend/src/IModelHost.ts index 6e46981d2c8d..801f45592220 100644 --- a/core/backend/src/IModelHost.ts +++ b/core/backend/src/IModelHost.ts @@ -121,7 +121,7 @@ export interface IModelHostOptions { /** * The kind of iModel hub server to use. - * @internal + * @public */ hubAccess?: BackendHubAccess; From 3c1e378504dd4db1aa506112be0535ff82b9e772 Mon Sep 17 00:00:00 2001 From: Nam Le <50554904+hl662@users.noreply.github.com> Date: Wed, 22 Jan 2025 10:44:56 -0500 Subject: [PATCH 3/4] remove deprecated APIs in core-backend --- core/backend/src/ECDb.ts | 65 --------------- core/backend/src/ElementAspect.ts | 17 ---- core/backend/src/HubMock.ts | 6 +- core/backend/src/IModelCloneContext.ts | 18 ----- core/backend/src/IModelDb.ts | 81 +------------------ core/backend/src/Material.ts | 52 +++++------- core/backend/src/core-backend.ts | 1 - .../backend/src/rpc-impl/IModelReadRpcImpl.ts | 1 + 8 files changed, 23 insertions(+), 218 deletions(-) delete mode 100644 core/backend/src/IModelCloneContext.ts diff --git a/core/backend/src/ECDb.ts b/core/backend/src/ECDb.ts index 70e7374c8f3d..151ff580721a 100644 --- a/core/backend/src/ECDb.ts +++ b/core/backend/src/ECDb.ts @@ -314,69 +314,4 @@ export class ECDb implements IDisposable { return new ECSqlReader(executor, ecsql, params, config); } - /** Execute a query and stream its results - * The result of the query is async iterator over the rows. The iterator will get next page automatically once rows in current page has been read. - * [ECSQL row]($docs/learning/ECSQLRowFormat). - * - * See also: - * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL) - * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) - * - * @param ecsql The ECSQL statement to execute - * @param params The values to bind to the parameters (if the ECSQL has any). - * @param options Allow to specify certain flags which control how query is executed. - * @returns Returns the query result as an *AsyncIterableIterator* which lazy load result as needed. The row format is determined by *rowFormat* parameter. - * See [ECSQL row format]($docs/learning/ECSQLRowFormat) for details about the format of the returned rows. - * @throws [IModelError]($common) If there was any error while submitting, preparing or stepping into query - * @deprecated in 3.7. Use [[createQueryReader]] instead; it accepts the same parameters. - */ - public async * query(ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator { - const builder = new QueryOptionsBuilder(options); - const reader = this.createQueryReader(ecsql, params, builder.getOptions()); - while (await reader.step()) - yield reader.formatCurrentRow(); - } - /** Compute number of rows that would be returned by the ECSQL. - * - * See also: - * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL) - * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) - * - * @param ecsql The ECSQL statement to execute - * @param params The values to bind to the parameters (if the ECSQL has any). - * See "[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)" for details. - * @returns Return row count. - * @throws [IModelError]($common) If the statement is invalid - * @deprecated in 3.7. Count the number of results using `count(*)` where the original query is a subquery instead. E.g., `SELECT count(*) FROM ()`. - */ - public async queryRowCount(ecsql: string, params?: QueryBinder): Promise { - for await (const row of this.createQueryReader(`SELECT count(*) FROM (${ecsql})`, params)) { - return row[0] as number; - } - throw new IModelError(DbResult.BE_SQLITE_ERROR, "Failed to get row count"); - } - - /** Cancel any previous query with same token and run execute the current specified query. - * The result of the query is async iterator over the rows. The iterator will get next page automatically once rows in current page has been read. - * [ECSQL row]($docs/learning/ECSQLRowFormat). - * - * See also: - * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL) - * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) - * - * @param ecsql The ECSQL statement to execute - * @param token None empty restart token. The previous query with same token would be cancelled. This would cause - * exception which user code must handle. - * @param params The values to bind to the parameters (if the ECSQL has any). - * @param options Allow to specify certain flags which control how query is executed. - * @returns Returns the query result as an *AsyncIterableIterator* which lazy load result as needed. The row format is determined by *rowFormat* parameter. - * See [ECSQL row format]($docs/learning/ECSQLRowFormat) for details about the format of the returned rows. - * @throws [IModelError]($common) If there was any error while submitting, preparing or stepping into query - * @deprecated in 3.7. Use [[createQueryReader]] instead. Pass in the restart token as part of the `config` argument; e.g., `{ restartToken: myToken }` or `new QueryOptionsBuilder().setRestartToken(myToken).getOptions()`. - */ - public async * restartQuery(token: string, ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator { - for await (const row of this.createQueryReader(ecsql, params, new QueryOptionsBuilder(options).setRestartToken(token).getOptions())) { - yield row; - } - } } diff --git a/core/backend/src/ElementAspect.ts b/core/backend/src/ElementAspect.ts index abbe6244818b..ad8fc83b1419 100644 --- a/core/backend/src/ElementAspect.ts +++ b/core/backend/src/ElementAspect.ts @@ -181,23 +181,6 @@ export class ExternalSourceAspect extends ElementMultiAspect { this.jsonProperties = props.jsonProperties; } - /** @deprecated in 3.x. findAllBySource */ - public static findBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): { elementId?: Id64String, aspectId?: Id64String } { - const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`; - let elementId: Id64String | undefined; - let aspectId: Id64String | undefined; - iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => { - statement.bindId("scope", scope); - statement.bindString("kind", kind); - statement.bindString("identifier", identifier); - if (DbResult.BE_SQLITE_ROW === statement.step()) { - elementId = statement.getValue(0).getId(); - aspectId = statement.getValue(1).getId(); - } - }); - return { elementId, aspectId }; - } - /** Look up the elements that contain one or more ExternalSourceAspect with the specified Scope, Kind, and Identifier. * The result of this function is an array of all of the ExternalSourceAspects that were found, each associated with the owning element. * A given element could have more than one ExternalSourceAspect with the given scope, kind, and identifier. diff --git a/core/backend/src/HubMock.ts b/core/backend/src/HubMock.ts index 67b366cb2278..4ffd6e6e03d1 100644 --- a/core/backend/src/HubMock.ts +++ b/core/backend/src/HubMock.ts @@ -10,10 +10,10 @@ import { } from "@itwin/core-common"; import { AcquireNewBriefcaseIdArg, - BackendHubAccess, BriefcaseDbArg, BriefcaseIdArg, ChangesetArg, CheckpointArg, CreateNewIModelProps, DownloadChangesetArg, DownloadChangesetRangeArg, IModelIdArg, IModelNameArg, + BackendHubAccess, BriefcaseDbArg, BriefcaseIdArg, ChangesetArg, CreateNewIModelProps, DownloadChangesetArg, DownloadChangesetRangeArg, IModelIdArg, IModelNameArg, LockMap, LockProps, V2CheckpointAccessProps, } from "./BackendHubAccess"; -import { CheckpointProps, ProgressFunction, ProgressStatus } from "./CheckpointManager"; +import { CheckpointProps, DownloadRequest, ProgressFunction, ProgressStatus } from "./CheckpointManager"; import { IModelHost } from "./IModelHost"; import { IModelJsFs } from "./IModelJsFs"; import { LocalHub } from "./LocalHub"; @@ -218,7 +218,7 @@ export class HubMock { } // eslint-disable-next-line @typescript-eslint/no-deprecated - public static async downloadV1Checkpoint(arg: CheckpointArg): Promise { + public static async downloadV1Checkpoint(arg: DownloadRequest): Promise { return this.findLocalHub(arg.checkpoint.iModelId).downloadCheckpoint({ changeset: arg.checkpoint.changeset, targetFile: arg.localFile }); } diff --git a/core/backend/src/IModelCloneContext.ts b/core/backend/src/IModelCloneContext.ts deleted file mode 100644 index 9a6c459fc54a..000000000000 --- a/core/backend/src/IModelCloneContext.ts +++ /dev/null @@ -1,18 +0,0 @@ -/*--------------------------------------------------------------------------------------------- -* Copyright (c) Bentley Systems, Incorporated. All rights reserved. -* See LICENSE.md in the project root for license terms and full copyright notice. -*--------------------------------------------------------------------------------------------*/ -/** @packageDocumentation - * @module iModels - */ - -import { IModelElementCloneContext } from "./IModelElementCloneContext"; - -// re-export both the type and the value of the class, and deprecate both - -/** @deprecated in 3.x. use [[IModelElementCloneContext]] instead, @beta */ -// eslint-disable-next-line @typescript-eslint/naming-convention -export const IModelCloneContext = IModelElementCloneContext; -/** @deprecated in 3.x. use [[IModelElementCloneContext]] instead, @beta */ -// eslint-disable-next-line @typescript-eslint/no-redeclare -export type IModelCloneContext = IModelElementCloneContext; diff --git a/core/backend/src/IModelDb.ts b/core/backend/src/IModelDb.ts index f47aec2c55fc..2b945479932f 100644 --- a/core/backend/src/IModelDb.ts +++ b/core/backend/src/IModelDb.ts @@ -22,7 +22,7 @@ import { GeoCoordinatesRequestProps, GeoCoordinatesResponseProps, GeometryContainmentRequestProps, GeometryContainmentResponseProps, IModel, IModelCoordinatesRequestProps, IModelCoordinatesResponseProps, IModelError, IModelNotFoundResponse, IModelTileTreeProps, LocalFileName, MassPropertiesRequestProps, MassPropertiesResponseProps, ModelExtentsProps, ModelLoadProps, ModelProps, ModelSelectorProps, OpenBriefcaseProps, - OpenCheckpointArgs, OpenSqliteArgs, ProfileOptions, PropertyCallback, QueryBinder, QueryOptions, QueryOptionsBuilder, QueryRowFormat, SchemaState, + OpenCheckpointArgs, OpenSqliteArgs, ProfileOptions, PropertyCallback, QueryBinder, QueryOptions, QueryRowFormat, SchemaState, SheetProps, SnapRequestProps, SnapResponseProps, SnapshotOpenOptions, SpatialViewDefinitionProps, SubCategoryResultRow, TextureData, TextureLoadProps, ThumbnailProps, UpgradeOptions, ViewDefinition2dProps, ViewDefinitionProps, ViewIdString, ViewQueryParams, ViewStateLoadProps, ViewStateProps, ViewStoreRpc, @@ -527,73 +527,6 @@ export abstract class IModelDb extends IModel { }; return new ECSqlReader(executor, ecsql, params, config); } - /** Execute a query and stream its results - * The result of the query is async iterator over the rows. The iterator will get next page automatically once rows in current page has been read. - * [ECSQL row]($docs/learning/ECSQLRowFormat). - * - * See also: - * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL) - * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) - * - * @param ecsql The ECSQL statement to execute - * @param params The values to bind to the parameters (if the ECSQL has any). - * @param options Allow to specify certain flags which control how query is executed. - * @returns Returns the query result as an *AsyncIterableIterator* which lazy load result as needed. The row format is determined by *rowFormat* parameter. - * See [ECSQL row format]($docs/learning/ECSQLRowFormat) for details about the format of the returned rows. - * @throws [IModelError]($common) If there was any error while submitting, preparing or stepping into query - * @deprecated in 3.7. Use [[createQueryReader]] instead; it accepts the same parameters. - */ - public async * query(ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator { - const builder = new QueryOptionsBuilder(options); - const reader = this.createQueryReader(ecsql, params, builder.getOptions()); - while (await reader.step()) - yield reader.formatCurrentRow(); - - } - - /** Compute number of rows that would be returned by the ECSQL. - * - * See also: - * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL) - * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) - * - * @param ecsql The ECSQL statement to execute - * @param params The values to bind to the parameters (if the ECSQL has any). - * See "[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)" for details. - * @returns Return row count. - * @throws [IModelError]($common) If the statement is invalid - * @deprecated in 3.7. Count the number of results using `count(*)` where the original query is a subquery instead. E.g., `SELECT count(*) FROM ()`. - */ - public async queryRowCount(ecsql: string, params?: QueryBinder): Promise { - for await (const row of this.createQueryReader(`SELECT count(*) FROM (${ecsql})`, params)) { - return row[0] as number; - } - throw new IModelError(DbResult.BE_SQLITE_ERROR, "Failed to get row count"); - } - - /** Cancel any previous query with same token and run execute the current specified query. - * The result of the query is async iterator over the rows. The iterator will get next page automatically once rows in current page has been read. - * [ECSQL row]($docs/learning/ECSQLRowFormat). - * - * See also: - * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL) - * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) - * - * @param ecsql The ECSQL statement to execute - * @param token None empty restart token. The previous query with same token would be cancelled. This would cause - * exception which user code must handle. - * @param params The values to bind to the parameters (if the ECSQL has any). - * @param options Allow to specify certain flags which control how query is executed. - * @returns Returns the query result as an *AsyncIterableIterator* which lazy load result as needed. The row format is determined by *rowFormat* parameter. - * See [ECSQL row format]($docs/learning/ECSQLRowFormat) for details about the format of the returned rows. - * @throws [IModelError]($common) If there was any error while submitting, preparing or stepping into query - * @deprecated in 3.7. Use [[createQueryReader]] instead. Pass in the restart token as part of the `config` argument; e.g., `{ restartToken: myToken }` or `new QueryOptionsBuilder().setRestartToken(myToken).getOptions()`. - */ - public async * restartQuery(token: string, ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator { - for await (const row of this.createQueryReader(ecsql, params, new QueryOptionsBuilder(options).setRestartToken(token).getOptions())) { - yield row; - } - } /** * Use a prepared SQL statement, potentially from the statement cache. If the requested statement doesn't exist @@ -2490,18 +2423,6 @@ export namespace IModelDb { return props; } - /** @deprecated in 3.x. use [[getViewStateProps]]. */ - public getViewStateData(viewDefinitionId: ViewIdString, options?: ViewStateLoadProps): ViewStateProps { - const viewStateData = this.loadViewData(viewDefinitionId, options); - const baseModelId = (viewStateData.viewDefinitionProps as ViewDefinition2dProps).baseModelId; - if (baseModelId) { - const drawingExtents = Range3d.fromJSON(this._iModel[_nativeDb].queryModelExtents({ id: baseModelId }).modelExtents); - if (!drawingExtents.isNull) - viewStateData.modelExtents = drawingExtents.toJSON(); - } - return viewStateData; - } - /** Obtain a [ViewStateProps]($common) for a [[ViewDefinition]] specified by ViewIdString. */ public async getViewStateProps(viewDefinitionId: ViewIdString, options?: ViewStateLoadProps): Promise { const viewStateData = this.loadViewData(viewDefinitionId, options); diff --git a/core/backend/src/Material.ts b/core/backend/src/Material.ts index 6b5543fe7554..9aab3ed12170 100644 --- a/core/backend/src/Material.ts +++ b/core/backend/src/Material.ts @@ -203,67 +203,51 @@ export class RenderMaterialElement extends DefinitionElement { } } -/** @public */ -export namespace RenderMaterialElement { - /** Parameters used to construct a [[RenderMaterial]]. - * The persistent JSON representation - [RenderMaterialAssetProps]($common) - is quite verbose and unwieldy. This representation simplifies it somewhat. - * @see [[RenderMaterialElement.create]] and [[RenderMaterialElement.insert]] to create a [[RenderMaterial]] from parameters of this type. - * @deprecated in 3.6 because it is not useful to use a `class` - just use [[RenderMaterialElementParams]] directly instead. - */ - export class Params { +/** Parameters used to create a [[RenderMaterial]] element. + * The persistent JSON representation - [RenderMaterialAssetProps]($common) - is quite verbose and unwieldy. This representation simplifies it somewhat. + * @see [[RenderMaterialElement.create]] and [[RenderMaterialElement.insert]] to create a [[RenderMaterial]] from parameters of this type. + * @public + */ +export interface RenderMaterialElementParams { /** A required palette name that categorizes this RenderMaterial */ - public paletteName: string; + paletteName: string; /** An optional description of this RenderMaterial */ - public description?: string; + description?: string; /** If defined, the color to use for surface fill or diffuse illumination, overriding the surface's own color. */ - public color?: RgbFactorProps; + color?: RgbFactorProps; /** The color to use for specular illumination. Default: black. */ - public specularColor?: RgbFactorProps; + specularColor?: RgbFactorProps; /** The specular exponent describing the surface's shininess, in the range 0 through 128. * Default: 0. */ - public finish?: number; + finish?: number; /** A transparency to be applied to the surface, ranging from 0 (fully opaque) to 1 (fully transparent). * The surface's own transparency will be multiplied by `(1 - transmit)`. permitting the material to increase but not decrease the surface transparency. * Default: 13.5. */ - public transmit?: number; + transmit?: number; /** The surface's diffuse reflectivity from 0.0 to 1.0. Default: 0.6. */ - public diffuse?: number; + diffuse?: number; /** The surface's specular reflectivity from 0.0 to 1.0. Default: 0.0. */ - public specular?: number; + specular?: number; /** Currently unused. */ - public reflect?: number; + reflect?: number; /** Currently unused. */ - public reflectColor?: number[]; + reflectColor?: number[]; /** Specifies a texture image to map onto the surface, replacing or mixing with the surface's own color and transparency. * @note With the exception of `TextureId`, the [TextureMapProps]($common) of [[patternMap]] and [[normalMap]] are expected to be identical. If a property is defined in both * [[patternMap]]] and [[normalMap]], the value in [[patternMap]] takes precedence. */ - public patternMap?: TextureMapProps; + patternMap?: TextureMapProps; /** Specifies a [normal map](https://en.wikipedia.org/wiki/Normal_mapping) to apply to the surface to simulate more surface detail than is present in the * surface's geometry. * @note With the exception of `TextureId`, the [TextureMapProps]($common) of [[patternMap]] and [[normalMap]] are expected to be identical. If a property is defined in both * [[patternMap]]] and [[normalMap]], the value in [[patternMap]] takes precedence. */ - public normalMap?: NormalMapProps & { + normalMap?: NormalMapProps & { /** A factor by which to multiply the components of the normal vectors read from the texture. * Default: 1. */ scale?: number; }; - - /** Construct a new RenderMaterial.Params object with the specified paletteName. Alter the public members on that object to specify settings. */ - public constructor(paletteName: string) { - this.paletteName = paletteName; - } - } -} - -/** Parameters used to create a [[RenderMaterial]] element. - * The persistent JSON representation - [RenderMaterialAssetProps]($common) - is quite verbose and unwieldy. This representation simplifies it somewhat. - * @see [[RenderMaterialElement.create]] and [[RenderMaterialElement.insert]] to create a [[RenderMaterial]] from parameters of this type. - * @public - */ -export interface RenderMaterialElementParams extends RenderMaterialElement.Params { // eslint-disable-line @typescript-eslint/no-deprecated, @typescript-eslint/no-empty-object-type } diff --git a/core/backend/src/core-backend.ts b/core/backend/src/core-backend.ts index 328559f09ccd..b75e67fab335 100644 --- a/core/backend/src/core-backend.ts +++ b/core/backend/src/core-backend.ts @@ -38,7 +38,6 @@ export * from "./FontFile"; export * from "./GeoCoordConfig"; export * from "./GeographicCRSServices"; export * from "./HubMock"; -export * from "./IModelCloneContext"; export * from "./IModelDb"; export * from "./IModelDbFonts"; export * from "./IModelElementCloneContext"; diff --git a/core/backend/src/rpc-impl/IModelReadRpcImpl.ts b/core/backend/src/rpc-impl/IModelReadRpcImpl.ts index 8591c8c39356..611033dbe37f 100644 --- a/core/backend/src/rpc-impl/IModelReadRpcImpl.ts +++ b/core/backend/src/rpc-impl/IModelReadRpcImpl.ts @@ -329,6 +329,7 @@ export class IModelReadRpcImpl extends RpcInterface implements IModelReadRpcInte * @deprecated in 3.x - Use queryViewThumbnail instead */ public async getViewThumbnail(tokenProps: IModelRpcProps, viewId: string): Promise { + // TODO: Remove this method as part of a repo wide RPC cleanup later in 5.x const iModelDb = await getIModelForRpc(tokenProps); const thumbnail = iModelDb.views.getThumbnail(viewId); if (undefined === thumbnail || 0 === thumbnail.image.length) From a28ebae20cbde964d86b0ca1528a452e3918243f Mon Sep 17 00:00:00 2001 From: Nam Le <50554904+hl662@users.noreply.github.com> Date: Wed, 22 Jan 2025 11:03:30 -0500 Subject: [PATCH 4/4] rush change, rush lint, rush extract api --- common/api/core-backend.api.md | 87 +++++-------------- common/api/summary/core-backend.exports.csv | 9 +- ...precate-core-backend_2025-01-22-16-02.json | 10 +++ core/backend/src/BackendHubAccess.ts | 2 +- core/backend/src/ECDb.ts | 2 +- core/backend/src/Element.ts | 2 +- core/backend/src/HubMock.ts | 1 - 7 files changed, 37 insertions(+), 76 deletions(-) create mode 100644 common/changes/@itwin/core-backend/nam-deprecate-core-backend_2025-01-22-16-02.json diff --git a/common/api/core-backend.api.md b/common/api/core-backend.api.md index e221a6f69556..9fdd82bfbed4 100644 --- a/common/api/core-backend.api.md +++ b/common/api/core-backend.api.md @@ -346,16 +346,17 @@ export interface AzureBlobStorageCredentials { baseUrl?: string; } -// @internal +// @public export interface BackendHubAccess { + // @internal acquireLocks: (arg: BriefcaseDbArg, locks: LockMap) => Promise; acquireNewBriefcaseId: (arg: AcquireNewBriefcaseIdArg) => Promise; createNewIModel: (arg: CreateNewIModelProps) => Promise; deleteIModel: (arg: IModelIdArg & ITwinIdArg) => Promise; downloadChangeset: (arg: DownloadChangesetArg) => Promise; downloadChangesets: (arg: DownloadChangesetRangeArg) => Promise; - // @deprecated - downloadV1Checkpoint: (arg: CheckpointArg) => Promise; + // @internal @deprecated + downloadV1Checkpoint: (arg: DownloadRequest) => Promise; getChangesetFromNamedVersion: (arg: IModelIdArg & { versionName: string; }) => Promise; @@ -367,11 +368,14 @@ export interface BackendHubAccess { pushChangeset: (arg: IModelIdArg & { changesetProps: ChangesetFileProps; }) => Promise; + // @internal queryAllLocks: (arg: BriefcaseDbArg) => Promise; queryChangeset: (arg: ChangesetArg) => Promise; queryChangesets: (arg: ChangesetRangeArg) => Promise; queryIModelByName: (arg: IModelNameArg) => Promise; + // @internal queryV2Checkpoint: (arg: CheckpointProps) => Promise; + // @internal releaseAllLocks: (arg: BriefcaseDbArg) => Promise; releaseBriefcase: (arg: BriefcaseIdArg) => Promise; } @@ -824,9 +828,6 @@ export class ChannelRootAspect extends ElementUniqueAspect { static insert(iModel: IModelDb, ownerId: Id64String, channelName: string): void; } -// @internal @deprecated (undocumented) -export type CheckpointArg = DownloadRequest; - // @internal (undocumented) export class CheckpointManager { static downloadCheckpoint(request: DownloadRequest): Promise; @@ -1802,14 +1803,8 @@ export class ECDb implements IDisposable { // @internal prepareSqliteStatement(sql: string, logErrors?: boolean): SqliteStatement; prepareStatement(ecsql: string, logErrors?: boolean): ECSqlStatement; - // @deprecated - query(ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator; - // @deprecated - queryRowCount(ecsql: string, params?: QueryBinder): Promise; // @internal resetSqliteCache(size: number): void; - // @deprecated - restartQuery(token: string, ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator; saveChanges(changesetName?: string): void; withPreparedSqliteStatement(sql: string, callback: (stmt: SqliteStatement) => T, logErrors?: boolean): T; withPreparedStatement(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors?: boolean): T; @@ -2034,8 +2029,6 @@ class Element_2 extends Entity { // (undocumented) static get className(): string; code: Code; - // @beta @deprecated - protected collectPredecessorIds(predecessorIds: EntityReferenceSet): void; // (undocumented) protected collectReferenceIds(referenceIds: EntityReferenceSet): void; delete(): void; @@ -2043,8 +2036,6 @@ class Element_2 extends Entity { getClassMetaData(): EntityMetaData | undefined; getDisplayLabel(): string; getJsonProperty(nameSpace: string): any; - // @beta @deprecated - getPredecessorIds(): Id64Set; getToolTipMessage(): string[]; getUserProperties(namespace: string): any; insert(): string; @@ -2336,13 +2327,9 @@ export class Entity { get classFullName(): string; static get className(): string; get className(): string; - // @internal @deprecated - protected collectReferenceConcreteIds: (_referenceIds: EntityReferenceSet) => void; // @beta protected collectReferenceIds(_referenceIds: EntityReferenceSet): void; forEachProperty(func: PropertyCallback, includeCustom?: boolean): void; - // @internal @deprecated - getReferenceConcreteIds: () => EntityReferenceSet; // @beta getReferenceIds(): EntityReferenceSet; id: Id64String; @@ -2565,11 +2552,6 @@ export class ExternalSourceAspect extends ElementMultiAspect { elementId: Id64String; aspectId: Id64String; }>; - // @deprecated (undocumented) - static findBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): { - elementId?: Id64String; - aspectId?: Id64String; - }; identifier: string; jsonProperties?: string; kind: string; @@ -3081,7 +3063,7 @@ export class HubMock { // (undocumented) static downloadChangesets(arg: DownloadChangesetRangeArg): Promise; // (undocumented) - static downloadV1Checkpoint(arg: CheckpointArg): Promise; + static downloadV1Checkpoint(arg: DownloadRequest): Promise; // (undocumented) static findLocalHub(iModelId: GuidString): LocalHub; static getChangesetFromNamedVersion(arg: IModelIdArg & { @@ -3121,12 +3103,6 @@ export class HubMock { static startup(mockName: LocalDirName, outputDir: string): void; } -// @beta @deprecated (undocumented) -export const IModelCloneContext: typeof IModelElementCloneContext; - -// @beta @deprecated (undocumented) -export type IModelCloneContext = IModelElementCloneContext; - // @public export abstract class IModelDb extends IModel { // @internal (undocumented) @@ -3245,16 +3221,12 @@ export abstract class IModelDb extends IModel { // @internal prepareSqliteStatement(sql: string, logErrors?: boolean): SqliteStatement; prepareStatement(sql: string, logErrors?: boolean): ECSqlStatement; - // @deprecated - query(ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator; // @internal queryAllUsedSpatialSubCategories(): Promise; queryEntityIds(params: EntityQueryParams): Id64Set; queryFilePropertyBlob(prop: FilePropertyProps): Uint8Array | undefined; queryFilePropertyString(prop: FilePropertyProps): string | undefined; queryNextAvailableFileProperty(prop: FilePropertyProps): number; - // @deprecated - queryRowCount(ecsql: string, params?: QueryBinder): Promise; querySchemaVersion(schemaName: string): string | undefined; // @internal querySubCategories(categoryIds: Iterable): Promise; @@ -3269,8 +3241,6 @@ export abstract class IModelDb extends IModel { requestSnap(sessionId: string, props: SnapRequestProps): Promise; // @internal (undocumented) restartDefaultTxn(): void; - // @deprecated - restartQuery(token: string, ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator; // @internal (undocumented) restartTxnSession(): void; // @internal @deprecated (undocumented) @@ -3395,8 +3365,6 @@ export namespace IModelDb { }): Promise; static readonly defaultQueryParams: ViewQueryParams; getThumbnail(viewDefinitionId: Id64String): ThumbnailProps | undefined; - // @deprecated (undocumented) - getViewStateData(viewDefinitionId: ViewIdString, options?: ViewStateLoadProps): ViewStateProps; getViewStateProps(viewDefinitionId: ViewIdString, options?: ViewStateLoadProps): Promise; // (undocumented) get hasViewStore(): boolean; @@ -3573,7 +3541,6 @@ export interface IModelHostOptions { // @internal crashReportingConfig?: CrashReportingConfig; enableOpenTelemetry?: boolean; - // @internal hubAccess?: BackendHubAccess; // @internal logTileLoadTimeThreshold?: number; @@ -4746,30 +4713,22 @@ export class RenderMaterialElement extends DefinitionElement { toJSON(): RenderMaterialProps; } -// @public (undocumented) -export namespace RenderMaterialElement { - // @deprecated - export class Params { - constructor(paletteName: string); - color?: RgbFactorProps; - description?: string; - diffuse?: number; - finish?: number; - normalMap?: NormalMapProps & { - scale?: number; - }; - paletteName: string; - patternMap?: TextureMapProps; - reflect?: number; - reflectColor?: number[]; - specular?: number; - specularColor?: RgbFactorProps; - transmit?: number; - } -} - // @public -export interface RenderMaterialElementParams extends RenderMaterialElement.Params { +export interface RenderMaterialElementParams { + color?: RgbFactorProps; + description?: string; + diffuse?: number; + finish?: number; + normalMap?: NormalMapProps & { + scale?: number; + }; + paletteName: string; + patternMap?: TextureMapProps; + reflect?: number; + reflectColor?: number[]; + specular?: number; + specularColor?: RgbFactorProps; + transmit?: number; } // @public diff --git a/common/api/summary/core-backend.exports.csv b/common/api/summary/core-backend.exports.csv index 295ec0334a02..5d6f4a3ebcaa 100644 --- a/common/api/summary/core-backend.exports.csv +++ b/common/api/summary/core-backend.exports.csv @@ -9,7 +9,7 @@ public;class;AuxCoordSystem3d public;class;AuxCoordSystemSpatial beta;interface;AvailableCoordinateReferenceSystemProps beta;interface;AzureBlobStorageCredentials -internal;interface;BackendHubAccess +public;interface;BackendHubAccess public;enum;BackendLoggerCategory public;type;BindParameter public;class;BisCoreSchema @@ -39,8 +39,6 @@ beta;interface;ChannelControl beta;namespace;ChannelControl beta;type;ChannelKey public;class;ChannelRootAspect -internal;type;CheckpointArg -deprecated;type;CheckpointArg internal;class;CheckpointManager public;interface;CheckpointProps public;class;ClassRegistry @@ -233,10 +231,6 @@ public;class;GroupInformationModel public;class;GroupInformationPartition public;class;GroupModel internal;class;HubMock -beta;const;IModelCloneContext -deprecated;const;IModelCloneContext -beta;type;IModelCloneContext -deprecated;type;IModelCloneContext public;class;IModelDb public;namespace;IModelDb internal;enum;TileContentState @@ -341,7 +335,6 @@ beta;class;RecipeDefinitionElement public;class;Relationship public;class;Relationships public;class;RenderMaterialElement -public;namespace;RenderMaterialElement public;interface;RenderMaterialElementParams public;class;RenderMaterialOwnsRenderMaterials public;class;RenderTimeline diff --git a/common/changes/@itwin/core-backend/nam-deprecate-core-backend_2025-01-22-16-02.json b/common/changes/@itwin/core-backend/nam-deprecate-core-backend_2025-01-22-16-02.json new file mode 100644 index 000000000000..30dca01248c4 --- /dev/null +++ b/common/changes/@itwin/core-backend/nam-deprecate-core-backend_2025-01-22-16-02.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/core-backend", + "comment": "Elevate BackendHubAccess to public, remove deprecated 3.x APIs in core-backend", + "type": "none" + } + ], + "packageName": "@itwin/core-backend" +} \ No newline at end of file diff --git a/core/backend/src/BackendHubAccess.ts b/core/backend/src/BackendHubAccess.ts index db4efbd9f7c2..c3d0a1660c96 100644 --- a/core/backend/src/BackendHubAccess.ts +++ b/core/backend/src/BackendHubAccess.ts @@ -217,7 +217,7 @@ export interface BackendHubAccess { * @deprecated in 3.x. V1 checkpoints are deprecated. Download V2 checkpoint using [[V2CheckpointManager.downloadCheckpoint]]. * @internal */ - downloadV1Checkpoint: (arg: DownloadRequest) => Promise; // eslint-disable-line @typescript-eslint/no-deprecated + downloadV1Checkpoint: (arg: DownloadRequest) => Promise; /** * Get the access props for a V2 checkpoint. Returns undefined if no V2 checkpoint exists. diff --git a/core/backend/src/ECDb.ts b/core/backend/src/ECDb.ts index 151ff580721a..ff850e57984a 100644 --- a/core/backend/src/ECDb.ts +++ b/core/backend/src/ECDb.ts @@ -7,7 +7,7 @@ */ import { assert, DbResult, IDisposable, Logger, OpenMode } from "@itwin/core-bentley"; import { IModelJsNative } from "@bentley/imodeljs-native"; -import { DbQueryRequest, ECSchemaProps, ECSqlReader, IModelError, QueryBinder, QueryOptions, QueryOptionsBuilder } from "@itwin/core-common"; +import { DbQueryRequest, ECSchemaProps, ECSqlReader, IModelError, QueryBinder, QueryOptions } from "@itwin/core-common"; import { BackendLoggerCategory } from "./BackendLoggerCategory"; import { ConcurrentQuery } from "./ConcurrentQuery"; import { ECSqlStatement } from "./ECSqlStatement"; diff --git a/core/backend/src/Element.ts b/core/backend/src/Element.ts index df20fa48aef4..78118abdbeea 100644 --- a/core/backend/src/Element.ts +++ b/core/backend/src/Element.ts @@ -6,7 +6,7 @@ * @module Elements */ -import { CompressedId64Set, GuidString, Id64, Id64Set, Id64String, JsonUtils, OrderedId64Array } from "@itwin/core-bentley"; +import { CompressedId64Set, GuidString, Id64, Id64String, JsonUtils, OrderedId64Array } from "@itwin/core-bentley"; import { AxisAlignedBox3d, BisCodeSpec, Code, CodeScopeProps, CodeSpec, ConcreteEntityTypes, DefinitionElementProps, ElementAlignedBox3d, ElementGeometryBuilderParams, ElementGeometryBuilderParamsForPart, ElementProps, EntityMetaData, EntityReferenceSet, GeometricElement2dProps, GeometricElement3dProps, GeometricElementProps, diff --git a/core/backend/src/HubMock.ts b/core/backend/src/HubMock.ts index 4ffd6e6e03d1..dfcacb8e5e7b 100644 --- a/core/backend/src/HubMock.ts +++ b/core/backend/src/HubMock.ts @@ -217,7 +217,6 @@ export class HubMock { return undefined; } - // eslint-disable-next-line @typescript-eslint/no-deprecated public static async downloadV1Checkpoint(arg: DownloadRequest): Promise { return this.findLocalHub(arg.checkpoint.iModelId).downloadCheckpoint({ changeset: arg.checkpoint.changeset, targetFile: arg.localFile }); }