From 3e32c786fd63db4b3baa7e00f0a0ecb995436802 Mon Sep 17 00:00:00 2001 From: Erin Ingram <47707444+eringram@users.noreply.github.com> Date: Thu, 26 Dec 2024 17:29:31 -0500 Subject: [PATCH 1/4] Update GraphicRepresentation types --- .../src/GraphicsProvider/GraphicRepresentationProvider.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/frontend-tiles/src/GraphicsProvider/GraphicRepresentationProvider.ts b/extensions/frontend-tiles/src/GraphicsProvider/GraphicRepresentationProvider.ts index 979469f2d2c3..c07996426dce 100644 --- a/extensions/frontend-tiles/src/GraphicsProvider/GraphicRepresentationProvider.ts +++ b/extensions/frontend-tiles/src/GraphicsProvider/GraphicRepresentationProvider.ts @@ -11,7 +11,7 @@ import { IModelApp, ITWINJS_CORE_VERSION } from "@itwin/core-frontend"; * @beta */ /* eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents */ -export type GraphicRepresentationFormat = "IMDL" | "3DTILES" | string; +export type GraphicRepresentationFormat = "IMODEL" | "3DTiles" | "CESIUM" | string; /** Graphic representations are generated from Data Sources. * The status of a Graphic Representation indicates the progress of that generation process. @@ -19,10 +19,10 @@ export type GraphicRepresentationFormat = "IMDL" | "3DTILES" | string; */ // ###TODO this needs to be expanded to include more statuses, and/or "failed" needs to be replaced with "invalid". export enum GraphicRepresentationStatus { - InProgress = "In progress", + InProgress = "InProgress", Complete = "Complete", - NotStarted = "Not started", - Failed = "Failed", + NotStarted = "NotStarted", + Invalid = "Invalid", } /** From fb522b4892938ca3c2ae4f6205c41d2b8f29feb6 Mon Sep 17 00:00:00 2001 From: Erin Ingram <47707444+eringram@users.noreply.github.com> Date: Thu, 16 Jan 2025 18:11:47 -0500 Subject: [PATCH 2/4] extract-api, fix format type, fix tests --- common/api/frontend-tiles.api.md | 8 ++++---- extensions/frontend-tiles/src/FrontendTiles.ts | 4 ++-- .../src/GraphicsProvider/GraphicRepresentationProvider.ts | 4 +--- .../src/GraphicsProvider/GraphicsProvider.ts | 4 ++-- .../GraphicRepresentationProvider.test.ts | 6 +++--- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/common/api/frontend-tiles.api.md b/common/api/frontend-tiles.api.md index 995303fddaee..347c8d11d0bd 100644 --- a/common/api/frontend-tiles.api.md +++ b/common/api/frontend-tiles.api.md @@ -88,18 +88,18 @@ export type GraphicRepresentation = { }); // @beta -export type GraphicRepresentationFormat = "IMDL" | "3DTILES" | string; +export type GraphicRepresentationFormat = "IMODEL" | "3DTiles" | "CESIUM"; // @beta export enum GraphicRepresentationStatus { // (undocumented) Complete = "Complete", // (undocumented) - Failed = "Failed", + InProgress = "InProgress", // (undocumented) - InProgress = "In progress", + Invalid = "Invalid", // (undocumented) - NotStarted = "Not started" + NotStarted = "NotStarted" } // @beta diff --git a/extensions/frontend-tiles/src/FrontendTiles.ts b/extensions/frontend-tiles/src/FrontendTiles.ts index 1e90d575d594..2ac9e9c3a48c 100644 --- a/extensions/frontend-tiles/src/FrontendTiles.ts +++ b/extensions/frontend-tiles/src/FrontendTiles.ts @@ -5,7 +5,7 @@ import { IModelApp, IModelConnection, SpatialTileTreeReferences, SpatialViewState } from "@itwin/core-frontend"; import { createBatchedSpatialTileTreeReferences } from "./BatchedSpatialTileTreeRefs"; -import { queryGraphicRepresentations } from "./GraphicsProvider/GraphicRepresentationProvider"; +import { GraphicRepresentationFormat, queryGraphicRepresentations } from "./GraphicsProvider/GraphicRepresentationProvider"; import { AccessToken } from "@itwin/core-bentley"; import { obtainIModelTilesetUrl, ObtainIModelTilesetUrlArgs } from "./GraphicsProvider/GraphicsProvider"; @@ -92,7 +92,7 @@ export async function* queryMeshExports(args: QueryMeshExportsArgs): AsyncIterab changeId: args.changesetId, type: "IMODEL", }, - format: "IMDL", + format: "IMODEL" as GraphicRepresentationFormat, urlPrefix: args.urlPrefix, includeIncomplete: args.includeIncomplete, enableCDN: args.enableCDN, diff --git a/extensions/frontend-tiles/src/GraphicsProvider/GraphicRepresentationProvider.ts b/extensions/frontend-tiles/src/GraphicsProvider/GraphicRepresentationProvider.ts index c07996426dce..e2daf0a7e065 100644 --- a/extensions/frontend-tiles/src/GraphicsProvider/GraphicRepresentationProvider.ts +++ b/extensions/frontend-tiles/src/GraphicsProvider/GraphicRepresentationProvider.ts @@ -10,14 +10,12 @@ import { IModelApp, ITWINJS_CORE_VERSION } from "@itwin/core-frontend"; /** The expected format of the Graphic Representation * @beta */ -/* eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents */ -export type GraphicRepresentationFormat = "IMODEL" | "3DTiles" | "CESIUM" | string; +export type GraphicRepresentationFormat = "IMODEL" | "3DTiles" | "CESIUM"; /** Graphic representations are generated from Data Sources. * The status of a Graphic Representation indicates the progress of that generation process. * @beta */ -// ###TODO this needs to be expanded to include more statuses, and/or "failed" needs to be replaced with "invalid". export enum GraphicRepresentationStatus { InProgress = "InProgress", Complete = "Complete", diff --git a/extensions/frontend-tiles/src/GraphicsProvider/GraphicsProvider.ts b/extensions/frontend-tiles/src/GraphicsProvider/GraphicsProvider.ts index d706b162abd1..e7d4d4fcc2b6 100644 --- a/extensions/frontend-tiles/src/GraphicsProvider/GraphicsProvider.ts +++ b/extensions/frontend-tiles/src/GraphicsProvider/GraphicsProvider.ts @@ -5,7 +5,7 @@ import { AccessToken, Logger } from "@itwin/core-bentley"; import { IModelApp } from "@itwin/core-frontend"; -import { obtainGraphicRepresentationUrl } from "./GraphicRepresentationProvider"; +import { GraphicRepresentationFormat, obtainGraphicRepresentationUrl } from "./GraphicRepresentationProvider"; import { loggerCategory } from "../LoggerCategory"; /** Arguments supplied to [[obtainIModelTilesetUrl]]. @@ -57,7 +57,7 @@ export async function obtainIModelTilesetUrl(args: ObtainIModelTilesetUrlArgs): changeId: args.changesetId, type: "IMODEL", }, - format: "IMDL", + format: "IMODEL" as GraphicRepresentationFormat, urlPrefix: args.urlPrefix, requireExactVersion: args.requireExactChangeset, enableCDN: args.enableCDN, diff --git a/extensions/frontend-tiles/src/test/GraphicsProvider/GraphicRepresentationProvider.test.ts b/extensions/frontend-tiles/src/test/GraphicsProvider/GraphicRepresentationProvider.test.ts index e0bdeaf215de..86356c1be37a 100644 --- a/extensions/frontend-tiles/src/test/GraphicsProvider/GraphicRepresentationProvider.test.ts +++ b/extensions/frontend-tiles/src/test/GraphicsProvider/GraphicRepresentationProvider.test.ts @@ -7,7 +7,7 @@ import { expect, use } from "chai"; import * as chaiAsPromised from "chai-as-promised"; import * as sinon from "sinon"; import { IModelApp } from "@itwin/core-frontend"; -import { createGraphicRepresentationsQueryUrl, obtainGraphicRepresentationUrl, queryGraphicRepresentations, QueryGraphicRepresentationsArgs } from "../../GraphicsProvider/GraphicRepresentationProvider"; +import { createGraphicRepresentationsQueryUrl, GraphicRepresentationFormat, obtainGraphicRepresentationUrl, queryGraphicRepresentations, QueryGraphicRepresentationsArgs } from "../../GraphicsProvider/GraphicRepresentationProvider"; use(chaiAsPromised); @@ -122,7 +122,7 @@ const testArgs = { changeId: undefined, type: "srcType", }, - format: "IMDL", + format: "IMODEL" as GraphicRepresentationFormat, }; describe("queryGraphicRepresentations", () => { @@ -216,7 +216,7 @@ describe("obtainGraphicRepresentationUrl", () => { changeId: args.versionId, type: "srcType", }, - format: "IMDL", + format: "IMODEL" as GraphicRepresentationFormat, requireExactVersion: args.exact, }); From 67f0bb275a5db51ce7c818fe0a8090c5839c41fb Mon Sep 17 00:00:00 2001 From: Erin Ingram <47707444+eringram@users.noreply.github.com> Date: Tue, 21 Jan 2025 10:51:36 -0500 Subject: [PATCH 3/4] Remove old MES props --- .../src/GraphicsProvider/GraphicRepresentationProvider.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/extensions/frontend-tiles/src/GraphicsProvider/GraphicRepresentationProvider.ts b/extensions/frontend-tiles/src/GraphicsProvider/GraphicRepresentationProvider.ts index e2daf0a7e065..3bb1e7e033f2 100644 --- a/extensions/frontend-tiles/src/GraphicsProvider/GraphicRepresentationProvider.ts +++ b/extensions/frontend-tiles/src/GraphicsProvider/GraphicRepresentationProvider.ts @@ -136,8 +136,6 @@ export async function* queryGraphicRepresentations(args: QueryGraphicRepresentat iModelId: string; changesetId: string; exportType: string; - geometryOptions: any; - viewDefinitionFilter: any; }; /* eslint-disable-next-line @typescript-eslint/naming-convention */ From c5c03d679fa4349b1f0d86e55119c7e8dc8e780d Mon Sep 17 00:00:00 2001 From: Erin Ingram <47707444+eringram@users.noreply.github.com> Date: Tue, 21 Jan 2025 12:59:33 -0500 Subject: [PATCH 4/4] Rush change --- ...ram-graphicrepresentation-fix_2025-01-21-17-59.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@itwin/frontend-tiles/eringram-graphicrepresentation-fix_2025-01-21-17-59.json diff --git a/common/changes/@itwin/frontend-tiles/eringram-graphicrepresentation-fix_2025-01-21-17-59.json b/common/changes/@itwin/frontend-tiles/eringram-graphicrepresentation-fix_2025-01-21-17-59.json new file mode 100644 index 000000000000..6d15d255c44e --- /dev/null +++ b/common/changes/@itwin/frontend-tiles/eringram-graphicrepresentation-fix_2025-01-21-17-59.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/frontend-tiles", + "comment": "Update GraphicRepresentationFormat type and GraphicRepresentationStatus enum to reflect the latest Mesh Export Service docs.", + "type": "none" + } + ], + "packageName": "@itwin/frontend-tiles" +} \ No newline at end of file