Skip to content

Commit

Permalink
Merge @bentley/imodeljs-native 3.3.3 into imodel02 (#3836)
Browse files Browse the repository at this point in the history
* Update changelog for 3.2.0 (#3613)

* grouping, TOC

* TOC, verbosity

* Add missing features.

* Update CI to test Node16 (#2987)

* Update CI to test Node16

* update doc references to Node 14
* update types/node version

* cleanup map-layers-auth
* Improved documentation in README.md

* get transformer cover to pass on windows, need to investigate more
* remove pretest script from transformer

Co-authored-by: Arun George <aruniverse@users.noreply.github.com>
Co-authored-by: Michel D'Astous <mdastous-bentley@users.noreply.github.com>

* 3.2.0-dev.73

* Multi-way viewport sync (#3614)

* multi-viewport sync.

* multi sync

* wip tests.

* wip more tests.

* finish tests.

* rename files.

* docs

* extract-api

* @extensions

* lint

* NextVersion

* clearer parameter name

* typo

* dta keyins can operate on more than 2 viewports.

* README

* inaccurate doc:

* 3.2.0-dev.74

* 3.3.0-dev.0

* close transformer state dumps even if overrides threw an error (#3612)

* close transformer state dumps even if producing them threw an error

Co-authored-by: Michael Belousov <MichaelBelousov@users.noreply.github.com>

* 3.3.0-dev.1

* 3.3.0-dev.2

* 3.3.0-dev.3

* Extensions: Avoid Webpack critical dependency warning using a FunctionConstructor (#3616)

* Avoid webpack critical dependency warning using FunctionConstructor

* rush change

* rush change (with changelog entry)

Co-authored-by: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com>

* Fix a display issue with background color's ColorPicker where part of the dialog was missing. (#3617)

* Set default color input type to rgb on ColorPickerDialog

* Change log

* 3.3.0-dev.4

* update extension codeowners (#3630)

Co-authored-by: Arun George <aruniverse@users.noreply.github.com>

* Correctly remove a widget in FLOATING_WIDGET_SEND_BACK (#3619)

* Remove a widget in FLOATING_WIDGET_SEND_BACK.

* Rush change.

* Typo.

* [Extension Api]: Stable auto generated api (#3627)

* try to clean up and sort the generation script

Co-authored-by: Arun George <aruniverse@users.noreply.github.com>
Co-authored-by: Paul Connelly <22944042+pmconne@users.noreply.github.com>

* Catch snap abandoned exception. (#3634)

* 3.3.0-dev.5

* Presentation: Fix hierarchy auto update (#3628)

* Set correct children count after update

* rush change

* extract-api

* Presentation: Fix excluding related properties without values (#3639)

* 3.3.0-dev.6

* Add learning snippets for property specification isReadOnly and priority attributes (#3640)

Co-authored-by: Alina Paliulionyte <Alina657@users.noreply.github.com>

* Fix sizing of color picker dialog (#3623)

* Remove hardcoded height from color dialog.

* rush change

* UI: TypeConverter improvements (#3589)

* Return default number value instead of NaN

* rush change

* Return undefined instead of NaN

* rush change

* add isolate elements feature to transformer test app (#3601)

* add isolateElements tool to the transformer test-app

* add geometry options

* add to README note about the new isolatedElements feature

* fix cloneUsingJsonGeometry option description

Co-authored-by: Michael Belousov <MichaelBelousov@users.noreply.github.com>

* Prevent duplicate logo cards. (#3648)

* 3.3.0-dev.7

* Remove cached fronstageDef went FrontstageProvider with same id is re-registered (#3647)

* Remove cached frontstageDef if frontstageProvider is re-registered.

* Add test and change log.

* 3.2.0 changelogs (#3654)

* 3.2.0

* rush change

Co-authored-by: imodeljs-admin <38288322+imodeljs-admin@users.noreply.github.com>
Co-authored-by: Arun George <aruniverse@users.noreply.github.com>

* Compression branch (#3658)

* added compression

* added changelog

* Omit auth in RPC communication between mobile frontend and backend (#3649)

* Omit access token when mobile frontend talks to backend

* Changelog entry for mobile RPC auth omit

* Do not add backport reviewers if they have already approved the PR (#3659)

* Make display-test-app env vars use current values (#3644)

* change for env vars

* added shutdown to FrontEndDevTools and EditTool

* Fix drag target processing and update panel background color (#3635)

* Update to only confine floating widget to ninezone area on drag end and get proper widget/panel-section id when docking.

* Fix line height of overflow widget tabs when only icons are shown.

* Updates to avoid svg-loader component from loading svg multiple times.

* update unit test

* update panel background to use same as buic-background-control so dispabled itwin ui components display properly

* rush change

* update buic-background-panel to match buic-background-dialog

* fix lint error

* extract api

* Convert negative ViewRect coordinates to zero. (#3653)

* Convert negative ViewRect coordinates to zero.

* silly C++ holdover.

* missing paren in doc.

* 3.3.0-dev.8

* Valgrind azure pipeline (#3602)

* valgrind yaml build configuration

* updated yaml for valgrind

* git config for rush requirement

* try different rush cover call for valgrind

* Update valgrind.yaml for Azure Pipelines

* Update valgrind.yaml for Azure Pipelines

* Update valgrind.yaml for Azure Pipelines

* Update valgrind.yaml for Azure Pipelines

* Update valgrind.yaml for Azure Pipelines

* add suppression file for valgrind

* updated path to suppressions file

* switch to hosted agent

* switch to apt-get

* Increase timeout for valgrind tests

* Update valgrind.yaml for Azure Pipelines

* Update valgrind.yaml for Azure Pipelines

* Update valgrind.yaml for Azure Pipelines

* 3.3.0-dev.9

* 3.3.0-dev.10

* Upgrade mocha to latest version (10.0.0) (#3651)

* set mocha version for all projects to 10.0.0

Co-authored-by: Anmol Shrestha <anmolshres98@users.noreply.github.com>

* 3.3.0-dev.11

* Fix background map base color transparency mix problem (#3668)

* Reality mesh shader needs to mix base color with any overrides even if textures are not specified (map base color, for example, can be specified).

* rush change

* Fix schedule timeline by clamping current duration to specified range - closes issue #75 (#3673)

* Ensure current duration does not go out of range.

* rush change

* [Extension Service Provider] add option to override access token (#3665)

* add option to override access token to support dual tokens
Co-authored-by: Arun George <aruniverse@users.noreply.github.com>

* move valgrind runs to be nightly instead of every pr (#3676)

Co-authored-by: Arun George <aruniverse@users.noreply.github.com>

* UI: Fix performance of getting subject models (#3666)

* 3.3.0-dev.12

* Do not create a Batch with an empty FeatureTable (#3684)

* test degenerate facets.

* Fix.

* remove spurious type assertion.

* mac build agents are slow.

* increase default timeout

* 3.3.0-dev.13

* Fix assertion on valid case in IModelExporter.exportElement. (#3688)

* 3.3.0-dev.14

* Close popup when the widget tab is clicked (#3685)

* Allow tippy.js to close the popup when the tab is clicked.

* Prevent browser drag interaction when dragging a tab.

* Allow tippy.js to close the popup when the widget is resized.

* Rush change.

* Tests.

* 3.3.0-dev.15

* 3.3.0-dev.16

* 3.3.0-dev.17

* 3.3.0-dev.18

* Add workarounds for Mali-G72 GPU. (#3701)

Co-authored-by: Arun George <aruniverse@users.noreply.github.com>

* 3.3.0-dev.19

* Presentation: Update IModelContent ruleset (#3698)

* Update the hierarchy

* Fix geometric elements under geometric models not being loaded

* UI: Clean up unused code in Models Tree (#3697)

* Update itwinui-react to 1.38.1 (#3694)

* Update valgrind.yaml for Azure Pipelines (#3683)

* Fix initial pending request always being treated as an error. (#3660)

* Add caching to some RPC Operations (#3594)

* Initial commit

* can't use break when not in a loop oops

* rush change

* add test

* 23 hours for getTileCachecONtainerUrl

* fix ocmment

* Use the decorator for responsecaching in a test

* bump tile and read rpc interface versions

* approach cache-control header in a different way

* extrac-tapi

* extract-api

* remove @todo and just keep it as TODO

* remove .only

* Revert "approach cache-control header in a different way"

This reverts commit 9246de939aa38d84970c1349c16dc30ae46510e5.

* extract-api

Co-authored-by: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com>

* Fix selection scope overrides (#3704)

* Ensure SelectionScope honor label overrides.

* rush change

* 3.3.0-dev.20

* Add OpenTelemetry tracing (#3548)

* add opentelemetry tracing

* rush update+change+extract

* fix dependencies

* remove unused import

* remove @opentelemetry/api dependency

* extract-api

* Refactor object flattening for OT span attributes.

* minor fixes

* WIP: Move OT support out of Logger.

* stop using deprecated types

* extract-api

* extract-api again

Co-authored-by: Bill Goehrig <33036725+wgoehrig@users.noreply.github.com>

* 3.3.0-dev.21

* 3.3.0-dev.22

* 3.3.0-dev.23

* 3.3.0-dev.24

* Add SchemaContext.getKnownSchemas method (#3734)

* Add SchemaContext.getKnkownSchemas method

* change log

* api extraction

* test fix

* api extract

* 3.3.0-dev.25

* 3.2.1 changelogs (#3757)

Co-authored-by: imodeljs-admin <38288322+imodeljs-admin@users.noreply.github.com>

* Ignore shader uniform errors by default (#3754)

* Ignore shader uniform errors by default

* Ignore shader uniform errors by default

* extract-api

* extract-api again

* Change to public

* enable logger for dta, doc new env

* Provide getter for active state (#3664)

* Provide getter for active state

Co-authored-by: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com>

* 3.3.0-dev.26

* Remove Android / iOS Distinction in core-mobile. Remove AuthStatus from BentleyError and StatusCategory. (#3622)

* Remove Android / iOS Distinction in core-mobile. Remove AuthStatus from BentleyError and StatusCategory.

* UI: Fix `useTreeModel` returning stale model for the given model source (#3761)

* 3.3.0-dev.27

* Move LocalHub to core-backend (#3763)

* move LocalHub to @internal in core-backend

* rush change

* Add addCustomAttribute to EC Class and Property method to editing API (#3744)

* Add ability to add CA to Property in editing API

* wip

* change log

* remove it.only

* PR review updates

* PR updates

* fix lint errors

* Presentation: Add support for nth level element selection scopes (#3767)

* Move HubMock to core-backend (#3770)

* move HubMock to core-backend

* rush change

* 3.3.0-dev.28

* Presentation: Add a way to get presentation backend's version by setting a flag in request params (#3756)

* 3.2.2 changelogs (#3799)

Co-authored-by: imodeljs-admin <38288322+imodeljs-admin@users.noreply.github.com>

* [Extensions] ExtensionAdmin registerHost should accept hostnames and urls (#3631)

* ExtensionAdmin should accept hostnames and urls

* Remove the "_exists" method from the remote and extension service providers
* make iTwinId default to public on Service Extensions
* remove any cast and just log the error msg as is
* remove 'ftp' since its something we don't expect as input
* documentation fixes
* ServiceExtension props should not require a version - defaults to the latest
* attempt to parse the text response if body is null (happened during testing)

* 3.3.0-dev.29

* 3.3.0-dev.30

* 3.3.0-dev.31

* Change setImmediate to setTimeout (#3798)

* Lock cheerio version down (enzyme depedency) (#3800)

* Lock cheerio version down (enzyme depedency)

* lock down enzyme verion to 3.10.0

Co-authored-by: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com>

* Presentation: Custom nodes (#3772)

* Add renderer for nodes with too many children

* Render custom nodes

* Update pnpm-lock.yaml

* pnpm conflict fix

* extract-api fix

* extract-api fix 2

* Imports fix

* Imports sorted

* Add option for user nodeRenderer

* indentation fix

* indentation fix 2

* Naming changes

* rush update

Co-authored-by: Saulius Skliutas <24278440+saskliutas@users.noreply.github.com>

* export brep geometry when requested in IModelExporter (#3801)

* add roundtrip brep geom test

* export brep data through IModelExporter when wantGeometry is true

Co-authored-by: Michael Belousov <MichaelBelousov@users.noreply.github.com>

* Create sphere and cylinder tools. Fixes for updateDynamics to supply adjusted point. (#3807)

* Create sphere and cylinder tools. Fixes for updateDynamics to supply ajusted point.

* Forgot to export new tool classes.

* 3.3.0-dev.32

* Clear drag state when button let up outside view. Don't send tools drag events if they didn't get button down event. (#3811)

* Fix tile display issues with ArcGIS map  layers (#3804)

* Make maplayers API public (#3745)

* Makes maplayers API public

* changelog

* Updated map-layers related API

* Promote more classes to public

* Added missing extract-api file.

* Expose MapLayerSource, MapLayerSourceProps, MapLayerSourceStatus, MapLayerSourceValidation

* Added MapLayerFormatId type.

* Replaced string enum with union type.

* Removed userName and password from MapLayerSourceProps

* Reverted formatId to string. Added MapLAyers group discussion. Use default parameters  in attachMapLayer and AttachMapLayerProps.

* Keep getMapLayerRange internal for now.

* Added change log.

* fix extract-api

* Use named parameters in DisplayTyleState.attachMapLayer and DisplayTyleState.attachMapLayerProps

* extract-api again

* 3.3.0-dev.33

* Use active tool name as tool settings label (#3814)

* Add useToolAsToolSettingsLabel option to UiFramework

* Extract api

* rush change

* 3.3.0-dev.34

* Presentation: Enable response compression for certain PresentationRpcInterface operations (#3818)

* 3.3.0-dev.35

* prevent Delaunay flipper from removing hole edges (#3731)

* Avoid slow keyin filtering when processing long keyins (#3830)

* Avoid doing slow filtering when not necessary

* revert change to filter

* rush change

* 3.3.0-dev.36

* how about we avoid running rush update on imodel02 branch.

* fix up core-backend

* fix CheckpointManager test.

* Delete core-transformer's HubMock

Temporarily comment out TileCache tests.

* unused imports.

* 3.3.0-dev.37

* fix TileCache.test.ts merge

* extract-api; doc TODOs

* lint

* invalid doc links.

* 3.3.0-dev.38

* Fix presentation-backend test

* Automated GitHub Releases (#3820)

* add python release script
* add release creation to version bump pipeline
* use gh action to create release

* remove unncessary dependencies from map-layers-auth

* re-remove merge-restored removed deepEqualWithFpTolerance impl

* Convert getModelProps RPC operation to a GET request from POST (#3835)

* change getModelProps to a GET request

* rush change

* Lock down ts-node to 10.8.0 for now because istanbuljs/nyc#1473

* fix slash direction

* Lock superagent down to 7.1.3 because 7.1.6 has core-full-stack-test integration test failures in electron.

* String.replaceAll no existe.

* Remove RPC preflight and InitializeInterface. (#3831)

* remove unnecessary pretest script that triggers an nyc bug

* 3.3.0-dev.39

* 3.3.0-dev.40

* fix test errors

* extract-api, lint

* remove temporary test setting for gcs

* fix lint error

Co-authored-by: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com>
Co-authored-by: Arun George <aruniverse@users.noreply.github.com>
Co-authored-by: Michel D'Astous <mdastous-bentley@users.noreply.github.com>
Co-authored-by: imodeljs-admin <38288322+imodeljs-admin@users.noreply.github.com>
Co-authored-by: Michael Belousov <mike.belousov@bentley.com>
Co-authored-by: Michael Belousov <MichaelBelousov@users.noreply.github.com>
Co-authored-by: John DiMatteo <19596966+johnnyd710@users.noreply.github.com>
Co-authored-by: Arun George <11051042+aruniverse@users.noreply.github.com>
Co-authored-by: GerardasB <10091419+GerardasB@users.noreply.github.com>
Co-authored-by: bbastings <65233531+bbastings@users.noreply.github.com>
Co-authored-by: Saulius Skliutas <24278440+saskliutas@users.noreply.github.com>
Co-authored-by: Grigas <35135765+grigasp@users.noreply.github.com>
Co-authored-by: Alina Paliulionytė <67429235+Alina657@users.noreply.github.com>
Co-authored-by: Alina Paliulionyte <Alina657@users.noreply.github.com>
Co-authored-by: Bill Steinbock <65047615+bsteinbk@users.noreply.github.com>
Co-authored-by: ekandy <105654158+ekandy@users.noreply.github.com>
Co-authored-by: Travis Cobbs <77415528+tcobbs-bentley@users.noreply.github.com>
Co-authored-by: Seamus Kirby <32379572+skirby1996@users.noreply.github.com>
Co-authored-by: DStradley <48810710+DStradley@users.noreply.github.com>
Co-authored-by: Robert Schili <rschili@users.noreply.github.com>
Co-authored-by: Anmol Shrestha <98850418+anmolshres98@users.noreply.github.com>
Co-authored-by: Anmol Shrestha <anmolshres98@users.noreply.github.com>
Co-authored-by: Mark Schlosser <47000437+markschlosseratbentley@users.noreply.github.com>
Co-authored-by: Gytis Čepkauskas <98940208+GytisCepk@users.noreply.github.com>
Co-authored-by: Vykis <81580355+veekeys@users.noreply.github.com>
Co-authored-by: Bill Goehrig <33036725+wgoehrig@users.noreply.github.com>
Co-authored-by: nick4598 <22119573+nick4598@users.noreply.github.com>
Co-authored-by: Paulius Valiūnas <66480813+paulius-valiunas@users.noreply.github.com>
Co-authored-by: christophermlawson <32881725+christophermlawson@users.noreply.github.com>
Co-authored-by: Joe Zbuchalski <17307464+JoeZman@users.noreply.github.com>
Co-authored-by: Daniel Toby <daniel.e.toby@gmail.com>
Co-authored-by: kabentley <33296803+kabentley@users.noreply.github.com>
Co-authored-by: NancyMcCallB <45079789+NancyMcCallB@users.noreply.github.com>
Co-authored-by: Martynas <43886789+MartynasStrazdas@users.noreply.github.com>
Co-authored-by: Raphaël LEMIEUX <1904889+raplemie@users.noreply.github.com>
Co-authored-by: Robert Lukasonok <70327485+roluk@users.noreply.github.com>
Co-authored-by: dassaf4 <68340676+dassaf4@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: kckst8 <6283674+kckst8@users.noreply.github.com>
Co-authored-by: AlainRobertAtBentley <73677355+AlainRobertAtBentley@users.noreply.github.com>
Co-authored-by: Daniel Toby <41296254+DanielToby@users.noreply.github.com>
Co-authored-by: naveedkhan8067 <38525837+naveedkhan8067@users.noreply.github.com>
  • Loading branch information
Show file tree
Hide file tree
Showing 14 changed files with 281 additions and 79 deletions.
7 changes: 7 additions & 0 deletions packages/test-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ A common strategy is to run with verbose logging on to find the problem element
Once the problem area has been identified, you can employ various strategies to set a conditional breakpoint.
One possibility is to edit the `onTransformElement` method in `Transformer.ts` to add a `if (sourceElement.getDisplayLabel() === "x")` or `if (sourceElement.id === "x")` conditional (using information from the log output) around a "hit problem area" log function call and then set a breakpoint on that log message.
After rebuilding, re-running, and hitting the breakpoint, you can then step into the core IModelTransformer methods to see what is really going on.

### isolating bad elements

You can pass a comma-separated list of element ids to the `--isolateElements` (such as `id1,id2`) to transform to the specified target
a filtered iModel containing only the path to the given elements/models specified by the given ids. This can be
useful to create smaller reproduction iModels with less data that still contain problematic elements. You can also isolate the entire subtrees
of these elements by using `--isolateTrees` instead of `--isolateElements`.
4 changes: 2 additions & 2 deletions packages/test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
"@types/chai": "4.3.1",
"@types/mocha": "^8.2.2",
"@types/fs-extra": "^4.0.7",
"@types/node": "14.14.31",
"@types/node": "16.11.7",
"@types/yargs": "^17.0.10",
"cross-env": "^5.1.4",
"eslint": "^7.11.0",
"internal-tools": "workspace:*",
"mocha": "^8.3.2",
"mocha": "^10.0.0",
"rimraf": "^3.0.2",
"typescript": "~4.4.0"
},
Expand Down
33 changes: 33 additions & 0 deletions packages/test-app/src/Main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,24 @@ void (async () => {
type: "boolean",
default: false,
},
isolateElements: {
desc: "transform filtering all element/models that aren't part of the logical path to a set of comma-separated element ids",
type: "string",
},
isolateTrees: {
desc: "transform filtering all element/models that aren't part of the logical path to a set of comma-separated element ids, or one of their children",
type: "string",
},
loadSourceGeometry: {
desc: "load geometry from the source as JSON while transforming, for easier (but not performant) transforming of geometry",
type: "boolean",
default: false,
},
cloneUsingJsonGeometry: {
desc: "sets cloneUsingBinaryGeometry in the transformer options to true, which is slower but allows simple editing of geometry in javascript.",
type: "boolean",
default: false,
},
})
.parseSync();

Expand Down Expand Up @@ -327,13 +345,28 @@ void (async () => {

const transformerOptions: TransformerOptions = {
...args,
cloneUsingBinaryGeometry: !args.cloneUsingJsonGeometry,
excludeSubCategories: args.excludeSubCategories?.split(","),
excludeCategories: args.excludeCategories?.split(","),
};

if (processChanges) {
assert(undefined !== args.sourceStartChangesetId);
await Transformer.transformChanges(await acquireAccessToken(), sourceDb, targetDb, args.sourceStartChangesetId, transformerOptions);
} else if (args.isolateElements !== undefined || args.isolateTrees !== undefined) {
const isolateTrees = args.isolateTrees !== undefined;
const isolateArg = args.isolateElements ?? args.isolateTrees;
assert(isolateArg !== undefined);
const isolateList = isolateArg.split(",");
const transformer = await Transformer.transformIsolated(sourceDb, targetDb, isolateList, isolateTrees, transformerOptions);
Logger.logInfo(
loggerCategory,
[
"remapped elements:",
isolateList.map((id) => `${id}=>${transformer.context.findTargetElementId(id)}`).join(", "),
].join("\n")
);
transformer.dispose();
} else {
await Transformer.transformAll(sourceDb, targetDb, transformerOptions);
}
Expand Down
36 changes: 36 additions & 0 deletions packages/test-app/src/Transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,42 @@ export class Transformer extends IModelTransformer {
transformer.logElapsedTime();
}

/**
* attempt to isolate a set of elements by transforming only them from the source to the target
* @note the transformer is returned, not disposed, you must dispose it yourself
*/
public static async transformIsolated(
sourceDb: IModelDb,
targetDb: IModelDb,
isolatedElementIds: Id64Array,
includeChildren = false,
options?: TransformerOptions
): Promise<IModelTransformer> {
class IsolateElementsTransformer extends Transformer {
public override shouldExportElement(sourceElement: Element) {
if (!includeChildren
&& (isolatedElementIds.some((id) => sourceElement.parent?.id === id)
|| isolatedElementIds.some((id) => sourceElement.model === id))
)
return false;
return super.shouldExportElement(sourceElement);
}
}
const transformer = new IsolateElementsTransformer(sourceDb, targetDb, options);
transformer.initialize(options);
await transformer.processSchemas();
await transformer.saveChanges("processSchemas");
for (const id of isolatedElementIds)
await transformer.processElement(id);
await transformer.saveChanges("process isolated elements");
if (options?.deleteUnusedGeometryParts) {
transformer.deleteUnusedGeometryParts();
await transformer.saveChanges("deleteUnusedGeometryParts");
}
transformer.logElapsedTime();
return transformer;
}

private constructor(sourceDb: IModelDb, targetDb: IModelDb, options?: TransformerOptions) {
super(sourceDb, new IModelImporter(targetDb, { simplifyElementGeometry: options?.simplifyElementGeometry }), options);
}
Expand Down
33 changes: 33 additions & 0 deletions packages/transformer/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
{
"name": "@itwin/core-transformer",
"entries": [
{
"version": "3.2.2",
"tag": "@itwin/core-transformer_v3.2.2",
"date": "Fri, 10 Jun 2022 16:11:36 GMT",
"comments": {}
},
{
"version": "3.2.1",
"tag": "@itwin/core-transformer_v3.2.1",
"date": "Tue, 07 Jun 2022 15:02:56 GMT",
"comments": {}
},
{
"version": "3.2.0",
"tag": "@itwin/core-transformer_v3.2.0",
"date": "Fri, 20 May 2022 13:10:54 GMT",
"comments": {
"none": [
{
"comment": "always close transformer resumption state db even on errors"
},
{
"comment": "Add an option to IModelImporter to optimize geometry by identifying geometry parts with only one reference and embedding the part's geometry directly into the referencing element's geometry stream."
},
{
"comment": "add transformer resumption API"
},
{
"comment": "use refactored internal extractChangedIdsFromChangesets"
}
]
}
},
{
"version": "3.1.3",
"tag": "@itwin/core-transformer_v3.1.3",
Expand Down
22 changes: 21 additions & 1 deletion packages/transformer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# Change Log - @itwin/core-transformer

This log was last generated on Fri, 15 Apr 2022 13:49:25 GMT and should not be manually modified.
This log was last generated on Fri, 10 Jun 2022 16:11:36 GMT and should not be manually modified.

## 3.2.2
Fri, 10 Jun 2022 16:11:36 GMT

_Version update only_

## 3.2.1
Tue, 07 Jun 2022 15:02:56 GMT

_Version update only_

## 3.2.0
Fri, 20 May 2022 13:10:54 GMT

### Updates

- always close transformer resumption state db even on errors
- Add an option to IModelImporter to optimize geometry by identifying geometry parts with only one reference and embedding the part's geometry directly into the referencing element's geometry stream.
- add transformer resumption API
- use refactored internal extractChangedIdsFromChangesets

## 3.1.3
Fri, 15 Apr 2022 13:49:25 GMT
Expand Down
17 changes: 8 additions & 9 deletions packages/transformer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@itwin/core-transformer",
"version": "3.2.0-dev.72",
"version": "3.3.0-dev.40",
"description": "API for exporting an iModel's parts and also importing them into another iModel",
"main": "lib/cjs/core-transformer.js",
"typings": "lib/cjs/core-transformer",
Expand All @@ -18,7 +18,6 @@
"cover": "nyc npm -s test",
"extract-api": "betools extract-api --entry=core-transformer",
"lint": "eslint -f visualstudio \"./src/**/*.ts\" 1>&2",
"pretest": "npm run copy:test-assets",
"test": "mocha"
},
"repository": {
Expand All @@ -37,11 +36,11 @@
"url": "http://www.bentley.com"
},
"peerDependencies": {
"@itwin/core-backend": "workspace:^3.2.0-dev.72",
"@itwin/core-bentley": "workspace:^3.2.0-dev.72",
"@itwin/core-common": "workspace:^3.2.0-dev.72",
"@itwin/core-geometry": "workspace:^3.2.0-dev.72",
"@itwin/ecschema-metadata": "workspace:^3.2.0-dev.72"
"@itwin/core-backend": "workspace:^3.3.0-dev.40",
"@itwin/core-bentley": "workspace:^3.3.0-dev.40",
"@itwin/core-common": "workspace:^3.3.0-dev.40",
"@itwin/core-geometry": "workspace:^3.3.0-dev.40",
"@itwin/ecschema-metadata": "workspace:^3.3.0-dev.40"
},
"//devDependencies": [
"NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install",
Expand All @@ -58,14 +57,14 @@
"@types/chai": "4.3.1",
"@types/chai-as-promised": "^7",
"@types/mocha": "^8.2.2",
"@types/node": "14.14.31",
"@types/node": "16.11.7",
"@types/semver": "^7.3.9",
"@types/sinon": "^9.0.0",
"chai": "^4.1.2",
"chai-as-promised": "^7",
"cpx2": "^3.0.0",
"eslint": "^7.11.0",
"mocha": "^8.3.2",
"mocha": "^10.0.0",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"rimraf": "^3.0.2",
Expand Down
6 changes: 4 additions & 2 deletions packages/transformer/src/IModelExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ export class IModelExporter {
public readonly sourceDb: IModelDb;
/** A flag that indicates whether element GeometryStreams are loaded or not.
* @note As an optimization, exporters that don't need geometry can set this flag to `false`. The default is `true`.
* @note The transformer by default sets this to `false` as an optimization.
* @note This implies the `wantBRepData` option when loading elements.
* @see [ElementLoadProps.wantGeometry]($common)
*/
public wantGeometry: boolean = true;
Expand Down Expand Up @@ -421,7 +423,7 @@ export class IModelExporter {
if (model.isTemplate && !this.wantTemplateModels) {
return;
}
const modeledElement: Element = this.sourceDb.elements.getElement({ id: modeledElementId, wantGeometry: this.wantGeometry });
const modeledElement: Element = this.sourceDb.elements.getElement({ id: modeledElementId, wantGeometry: this.wantGeometry, wantBRepData: this.wantGeometry });
Logger.logTrace(loggerCategory, `exportModel(${modeledElementId})`);
if (this.shouldExportElement(modeledElement)) {
await this.exportModelContainer(model);
Expand Down Expand Up @@ -568,7 +570,7 @@ export class IModelExporter {
return this.exportChildElements(elementId);
}
}
const element: Element = this.sourceDb.elements.getElement({ id: elementId, wantGeometry: this.wantGeometry });
const element: Element = this.sourceDb.elements.getElement({ id: elementId, wantGeometry: this.wantGeometry, wantBRepData: this.wantGeometry });
Logger.logTrace(loggerCategory, `exportElement(${element.id}, "${element.getDisplayLabel()}")${this.getChangeOpSuffix(isUpdate)}`);
// the order and `await`ing of calls beyond here is depended upon by the IModelTransformer for a current bug workaround
if (this.shouldExportElement(element)) {
Expand Down
22 changes: 16 additions & 6 deletions packages/transformer/src/IModelTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,23 @@ export interface IModelTransformOptions {
loadSourceGeometry?: boolean;

/** Flag that indicates whether or not the transformation process should clone using binary geometry.
* Only transformations that need to manipulate geometry should consider setting this flag as it impacts performance.
*
* Prefer to never to set this flag. If you need geometry changes, instead override [[IModelTransformer.onTransformElement]]
* and provide an [ElementGeometryBuilderParams]($backend) to the `elementGeometryBuilderParams`
* property of [ElementProps]($common) instead, it is much faster. You can read geometry during the transformation by setting the
* [[IModelTransformOptions.loadSourceGeometry]] property to `true`, and passing that to a [GeometryStreamIterator]($common)
* @note this flag will be deprecated when `elementGeometryBuilderParams` is no longer an alpha API
*
* @default true
*/
cloneUsingBinaryGeometry?: boolean;

/** Flag that indicates that ids should be preserved while copying elements to the target
* Intended only for pure-filter transforms, so you can keep parts of the source, while deleting others,
* and element ids are guaranteed to be the same, (other entity ids are not, however)
* @note the target must be empty
* @note it is invalid to insert elements during the transformation, do not use this with transformers that try to
* @note this does not preserve the ids of non-element entities such as link table relationships, or aspects, etc
* @note The target must be empty.
* @note It is invalid to insert elements during the transformation, do not use this with transformers that try to.
* @note This does not preserve the ids of non-element entities such as link table relationships, or aspects, etc.
* @default false
* @beta
*/
Expand All @@ -102,7 +108,7 @@ export interface IModelTransformOptions {
* It is possible to craft an iModel with dangling predecessors/invalidated relationships by, e.g., deleting certain
* elements without fixing up references.
*
* @note "reject" will throw an error and reject the transformation upon finding this case
* @note "reject" will throw an error and reject the transformation upon finding this case.
* @note "ignore" passes the issue down to consuming applications, iModels that have invalid element references
* like this can cause errors, and you should consider adding custom logic in your transformer to remove the
* reference depending on your use case.
Expand Down Expand Up @@ -186,7 +192,11 @@ function mapId64<R>(
idContainer: Id64String | { id: Id64String } | undefined,
func: (id: Id64String) => R
): R[] {
const isId64String = (arg: any): arg is Id64String => { assert(Id64.isValidId64(arg)); return typeof arg === "string"; };
const isId64String = (arg: any): arg is Id64String => {
const isString = typeof arg === "string";
assert(() => !isString || Id64.isValidId64(arg));
return isString;
};
const isRelatedElem = (arg: any): arg is RelatedElement =>
arg && typeof arg === "object" && "id" in arg;

Expand Down
10 changes: 0 additions & 10 deletions packages/transformer/src/test/HubMock.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/transformer/src/test/IModelTransformerUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Point3d, Transform, YawPitchRollAngles } from "@itwin/core-geometry";
import {
AuxCoordSystem, AuxCoordSystem2d, CategorySelector, DefinitionModel, DisplayStyle3d, DrawingCategory, DrawingGraphicRepresentsElement,
ECSqlStatement, Element, ElementAspect, ElementMultiAspect, ElementRefersToElements, ElementUniqueAspect, Entity, ExternalSourceAspect, FunctionalSchema,
GeometricElement3d, GeometryPart, IModelDb, IModelJsFs, InformationPartitionElement, InformationRecordModel, Model, ModelSelector,
GeometricElement3d, GeometryPart, HubMock, IModelDb, IModelJsFs, InformationPartitionElement, InformationRecordModel, Model, ModelSelector,
OrthographicViewDefinition, PhysicalElement, PhysicalModel, PhysicalObject, PhysicalPartition, Relationship, RelationshipProps,
RenderMaterialElement, SnapshotDb, SpatialCategory, SpatialLocationModel, SpatialViewDefinition, SubCategory, Subject, Texture,
} from "@itwin/core-backend";
Expand All @@ -23,7 +23,6 @@ import {
} from "@itwin/core-common";
import { IModelExporter, IModelExportHandler, IModelImporter, IModelTransformer } from "../core-transformer";
import { KnownTestLocations } from "./KnownTestLocations";
import { HubMock } from "./HubMock";

export class HubWrappers extends BackendTestUtils.HubWrappers {
protected static override get hubMock() { return HubMock; }
Expand Down

0 comments on commit 64b6e4c

Please sign in to comment.