Skip to content

Commit 7e125c6

Browse files
committed
Merge branch 'master' into saeed-torabi/spiral-close-approach
2 parents f308e58 + 7af82e0 commit 7e125c6

386 files changed

Lines changed: 13880 additions & 8598 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
paths:
9+
- .github/workflows/copilot-setup-steps.yml
10+
pull_request:
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
14+
jobs:
15+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
16+
copilot-setup-steps:
17+
runs-on: ubuntu-latest
18+
19+
# Set the permissions to the lowest permissions possible needed for your steps.
20+
# Copilot will be given its own token for its operations.
21+
permissions:
22+
contents: read
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: "24"
32+
33+
- name: Configure Git identity
34+
run: |
35+
git config --local user.name "imodeljs-admin"
36+
git config --local user.email "imodeljs-admin@users.noreply.github.com"
37+
38+
- name: Install Rush
39+
run: npm install -g @microsoft/rush@5.162.0
40+
41+
- name: Install dependencies
42+
run: rush install

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,4 @@ common/api/summary/summary.exports.csv
5858

5959
*.log
6060
*.error.log
61+
**/tsconfig.tsbuildinfo

common/api/core-backend.api.md

Lines changed: 319 additions & 18 deletions
Large diffs are not rendered by default.

common/api/core-common.api.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2986,6 +2986,30 @@ export interface EditingScopeNotifications {
29862986
notifyGeometryChanged: (modelProps: ModelGeometryChangesProps[]) => void;
29872987
}
29882988

2989+
// @beta
2990+
export interface EditTxnError extends ITwinError {
2991+
readonly description?: string;
2992+
readonly iModelKey?: string;
2993+
}
2994+
2995+
// @beta (undocumented)
2996+
export namespace EditTxnError {
2997+
const scope = "itwin-EditTxn";
2998+
export function isError(error: unknown, key?: Key): error is EditTxnError;
2999+
export type Key =
3000+
/** an attempt to start an EditTxn when one is already active */
3001+
"already-active" |
3002+
/** an attempt to modify an iModel through the implicit transaction when explicit transactions are enforced */
3003+
"implicit-txn-write-disallowed" |
3004+
/** an attempt to start an EditTxn when unsaved changes are already present */
3005+
"unsaved-changes" |
3006+
/** an attempt to perform an operation that requires an active EditTxn when none is active */
3007+
"not-active" |
3008+
/** an attempt to use an EditTxn with the wrong iModel */
3009+
"wrong-imodel";
3010+
export function throwError(key: Key, message: string, iModelKey?: string, description?: string): never;
3011+
}
3012+
29893013
// @public
29903014
export type ElementAlignedBox2d = Range2d;
29913015

@@ -5563,6 +5587,7 @@ export const ipcAppChannels: {
55635587

55645588
// @internal
55655589
export interface IpcAppFunctions {
5590+
// @deprecated (undocumented)
55665591
abandonChanges: (key: string) => Promise<void>;
55675592
cancelElementGraphicsRequests: (key: string, _requestIds: string[]) => Promise<void>;
55685593
cancelPullChangesRequest: (key: string) => Promise<void>;
@@ -5591,6 +5616,7 @@ export interface IpcAppFunctions {
55915616
reverseAllTxn: (key: string) => Promise<IModelStatus>;
55925617
// (undocumented)
55935618
reverseTxns: (key: string, numOperations: number) => Promise<IModelStatus>;
5619+
// @deprecated (undocumented)
55945620
saveChanges: (key: string, description?: string) => Promise<void>;
55955621
// (undocumented)
55965622
toggleGraphicalEditingScope: (key: string, _startSession: boolean) => Promise<boolean>;
@@ -9402,7 +9428,7 @@ export interface RunLayoutResult {
94029428
// @beta
94039429
export type RunProps = TextRunProps | FractionRunProps | TabRunProps | LineBreakRunProps | FieldRunProps;
94049430

9405-
// @alpha
9431+
// @beta
94069432
export interface SaveChangesArgs {
94079433
appData?: {
94089434
[key: string]: any;

common/api/core-frontend.api.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,6 +1728,7 @@ export interface BlankConnectionProps {
17281728
// @public
17291729
export class BriefcaseConnection extends IModelConnection {
17301730
protected constructor(props: BriefcaseConnectionProps, openMode: OpenMode);
1731+
// @deprecated
17311732
abandonChanges(): Promise<void>;
17321733
// @beta
17331734
readonly briefcaseId?: number;
@@ -1756,6 +1757,7 @@ export class BriefcaseConnection extends IModelConnection {
17561757
pushChanges(description: string): Promise<ChangesetIndexAndId>;
17571758
// (undocumented)
17581759
protected requireTimeline(): void;
1760+
// @deprecated
17591761
saveChanges(description?: string): Promise<void>;
17601762
supportsGraphicalEditing(): Promise<boolean>;
17611763
readonly txns: BriefcaseTxns;
@@ -2155,6 +2157,8 @@ export class ContextRealityModelState extends ContextRealityModel {
21552157
// @internal
21562158
constructor(props: ContextRealityModelProps, iModel: IModelConnection, displayStyle: DisplayStyleState);
21572159
get classifiers(): SpatialClassifiersState;
2160+
// @internal (undocumented)
2161+
detachLayerListeners(): void;
21582162
readonly iModel: IModelConnection;
21592163
get isGlobal(): boolean;
21602164
get modelId(): Id64String | undefined;
@@ -5652,6 +5656,8 @@ export class LayerTileTreeReferenceHandler {
56525656
// (undocumented)
56535657
clearLayers(): void;
56545658
// (undocumented)
5659+
detachFromDisplayStyle(): void;
5660+
// (undocumented)
56555661
discloseTileTrees(trees: DisclosedTileTreeSet): void;
56565662
// (undocumented)
56575663
initializeLayers(context: SceneContext): boolean;
@@ -7988,6 +7994,7 @@ export abstract class PrimitiveTool extends InteractiveTool {
79887994
redoPreviousStep(): Promise<boolean>;
79897995
requireWriteableTarget(): boolean;
79907996
run(..._args: any[]): Promise<boolean>;
7997+
// @deprecated
79917998
saveChanges(): Promise<void>;
79927999
// (undocumented)
79938000
targetIsLocked: boolean;

common/api/editor-backend.api.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { BasicManipulationCommandIpc } from '@itwin/editor-common';
88
import { CompressedId64Set } from '@itwin/core-bentley';
99
import { EcefLocationProps } from '@itwin/core-common';
1010
import { EditCommandIpc } from '@itwin/editor-common';
11+
import { EditTxn } from '@itwin/core-backend';
1112
import { ElementGeometryBuilderParams } from '@itwin/core-common';
1213
import { ElementGeometryInfo } from '@itwin/core-common';
1314
import { FlatBufferGeometryFilter } from '@itwin/editor-common';
@@ -18,6 +19,7 @@ import { IModelDb } from '@itwin/core-backend';
1819
import { IModelStatus } from '@itwin/core-bentley';
1920
import { Matrix3dProps } from '@itwin/core-geometry';
2021
import { Range3dProps } from '@itwin/core-geometry';
22+
import { SaveChangesArgs } from '@itwin/core-common';
2123
import { TransformProps } from '@itwin/core-geometry';
2224

2325
// @beta
@@ -56,10 +58,16 @@ export class BasicManipulationCommand extends EditCommand implements BasicManipu
5658
// @beta
5759
export class EditCommand implements EditCommandIpc {
5860
constructor(iModel: IModelDb, ..._args: any[]);
61+
abandonChanges(): Promise<void>;
62+
abandonEdits(): Promise<void>;
63+
protected appData?: SaveChangesArgs["appData"];
64+
protected beginEditing(): void;
5965
static commandId: string;
6066
// (undocumented)
6167
get ctor(): EditCommandType;
68+
endEdits(description?: string): Promise<void>;
6269
readonly iModel: IModelDb;
70+
get isTxnActive(): boolean;
6371
// (undocumented)
6472
onStart(): Promise<any>;
6573
// (undocumented)
@@ -69,6 +77,8 @@ export class EditCommand implements EditCommandIpc {
6977
[propName: string]: any;
7078
}>;
7179
requestFinish(): Promise<"done" | string>;
80+
saveChanges(description?: string): Promise<void>;
81+
protected readonly txn: EditTxn;
7282
// (undocumented)
7383
static version: string;
7484
}

common/api/editor-common.api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ export interface BasicManipulationCommandIpc extends EditCommandIpc {
3939

4040
// @beta
4141
export interface EditCommandIpc {
42+
abandonChanges: () => Promise<void>;
4243
ping: () => Promise<{
4344
commandId: string;
4445
version: string;
4546
[propName: string]: any;
4647
}>;
48+
saveChanges: (description?: string) => Promise<void>;
4749
}
4850

4951
// @beta

common/api/linear-referencing-backend.api.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
```ts
66

77
import { DistanceExpressionProps } from '@itwin/linear-referencing-common';
8+
import { EditTxn } from '@itwin/core-backend';
89
import { ElementMultiAspect } from '@itwin/core-backend';
910
import { ElementProps } from '@itwin/core-common';
1011
import { ElementRefersToElements } from '@itwin/core-backend';
@@ -85,13 +86,17 @@ export class LinearLocation extends LinearLocationElement implements LinearlyLoc
8586
static get className(): string;
8687
// (undocumented)
8788
static create(iModel: IModelDb, modelId: Id64String, categoryId: Id64String): LinearLocation;
88-
// (undocumented)
89+
static insertAt(txn: EditTxn, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String;
90+
// @deprecated
8991
static insertAt(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String;
90-
// (undocumented)
92+
insertAt(txn: EditTxn, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String;
93+
// @deprecated
9194
insertAt(iModel: IModelDb, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String;
92-
// (undocumented)
95+
static insertFromTo(txn: EditTxn, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String;
96+
// @deprecated
9397
static insertFromTo(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String;
94-
// (undocumented)
98+
insertFromTo(txn: EditTxn, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String;
99+
// @deprecated
95100
insertFromTo(iModel: IModelDb, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String;
96101
}
97102

@@ -111,10 +116,20 @@ export class LinearlyLocated {
111116
static getFromToLocation(iModel: IModelDb, linearlyLocatedElementId: Id64String): LinearlyReferencedFromToLocation | undefined;
112117
static getFromToLocations(iModel: IModelDb, linearlyLocatedElementId: Id64String): LinearlyReferencedFromToLocation[];
113118
static getLinearElementId(iModel: IModelDb, linearlyLocatedElementId: Id64String): Id64String | undefined;
119+
static insertAt(txn: EditTxn, elProps: ElementProps, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps): Id64String;
120+
// @deprecated
114121
static insertAt(iModel: IModelDb, elProps: ElementProps, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps): Id64String;
122+
static insertFromTo(txn: EditTxn, elProps: ElementProps, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps): Id64String;
123+
// @deprecated
115124
static insertFromTo(iModel: IModelDb, elProps: ElementProps, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps): Id64String;
125+
// @deprecated
116126
static updateAtLocation(iModel: IModelDb, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedAtLocationProps, aspectId?: Id64String): void;
127+
// (undocumented)
128+
static updateAtLocation(txn: EditTxn, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedAtLocationProps, aspectId?: Id64String): void;
129+
// @deprecated
117130
static updateFromToLocation(iModel: IModelDb, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedFromToLocationProps, aspectId?: Id64String): void;
131+
// (undocumented)
132+
static updateFromToLocation(txn: EditTxn, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedFromToLocationProps, aspectId?: Id64String): void;
118133
}
119134

120135
// @beta
@@ -177,7 +192,8 @@ export class LinearlyReferencedAtLocation extends LinearlyReferencedLocation {
177192
static create(iModel: IModelDb, locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): LinearlyReferencedAtLocation;
178193
// (undocumented)
179194
fromReferent?: LinearlyReferencedAtPositionRefersToReferent;
180-
// (undocumented)
195+
static insert(txn: EditTxn, locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): void;
196+
// @deprecated
181197
static insert(iModel: IModelDb, locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): void;
182198
}
183199

@@ -206,7 +222,8 @@ export class LinearlyReferencedFromToLocation extends LinearlyReferencedLocation
206222
fromPosition: DistanceExpression;
207223
// (undocumented)
208224
fromPositionFromReferent?: LinearlyReferencedFromPositionRefersToReferent;
209-
// (undocumented)
225+
static insert(txn: EditTxn, locatedElementId: Id64String, from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void;
226+
// @deprecated
210227
static insert(iModel: IModelDb, locatedElementId: Id64String, from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void;
211228
// (undocumented)
212229
toPosition: DistanceExpression;
@@ -250,9 +267,11 @@ export class Referent extends ReferentElement {
250267
static get className(): string;
251268
// (undocumented)
252269
static create(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, referencedElementId: Id64String): Referent;
253-
// (undocumented)
270+
static insertAt(txn: EditTxn, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, referencedElementId: Id64String): Id64String;
271+
// @deprecated
254272
static insertAt(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, referencedElementId: Id64String): Id64String;
255-
// (undocumented)
273+
insertAt(txn: EditTxn, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps): Id64String;
274+
// @deprecated
256275
insertAt(iModel: IModelDb, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps): Id64String;
257276
}
258277

common/api/summary/core-backend.exports.csv

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,14 @@ preview;class;DefinitionPartition
119119
public;class;DefinitionSet
120120
preview;class;DefinitionSet
121121
beta;function;deleteElementSubTrees
122+
beta;function;deleteElementSubTrees
123+
deprecated;function;deleteElementSubTrees
124+
beta;function;deleteElementTree
125+
beta;function;deleteElementTree
126+
deprecated;function;deleteElementTree
122127
beta;function;deleteElementTree
123128
beta;function;deleteElementTree
129+
deprecated;function;deleteElementTree
124130
beta;interface;DeleteElementTreeArgs
125131
beta;interface;DeserializeEntityArgs
126132
public;class;DetailCallout
@@ -188,6 +194,7 @@ public;class;ECSqlWriteStatement
188194
beta;interface;EditableCatalogDb
189195
beta;interface;EditableWorkspaceContainer
190196
beta;interface;EditableWorkspaceDb
197+
beta;class;EditTxn
191198
public;class;ElementAspect
192199
preview;class;ElementAspect
193200
beta;class;ElementDrivesElement
@@ -344,6 +351,7 @@ public;class;IModelJsFs
344351
public;class;IModelJsFsStats
345352
public;interface;IModelNameArg
346353
internal;class;IModelNative
354+
beta;type;ImplicitWriteEnforcement
347355
public;class;InformationContentElement
348356
preview;class;InformationContentElement
349357
public;class;InformationModel
@@ -415,7 +423,9 @@ beta;interface;OnAspectPropsArg
415423
beta;interface;OnChildElementArg
416424
beta;interface;OnChildElementIdArg
417425
beta;interface;OnChildElementPropsArg
426+
beta;interface;OnDependencyArg
418427
beta;interface;OnElementArg
428+
beta;interface;OnElementDependencyArg
419429
beta;interface;OnElementIdArg
420430
beta;interface;OnElementInModelIdArg
421431
beta;interface;OnElementInModelPropsArg
@@ -658,6 +668,10 @@ public;class;VolumeElement
658668
preview;class;VolumeElement
659669
public;class;WebMercatorModel
660670
preview;class;WebMercatorModel
671+
beta;function;withEditTxn
672+
beta;function;withEditTxn
673+
beta;function;withEditTxn
674+
beta;function;withEditTxn
661675
beta;interface;Workspace
662676
beta;namespace;Workspace
663677
beta;interface;WorkspaceContainer

common/api/summary/core-common.exports.csv

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ internal;interface;EdgeAppearanceOverrides
255255
internal;class;EdgeArgs
256256
internal;interface;EdgeOptions
257257
internal;interface;EditingScopeNotifications
258+
beta;interface;EditTxnError
259+
beta;namespace;EditTxnError
258260
public;type;ElementAlignedBox2d
259261
public;type;ElementAlignedBox3d
260262
public;interface;ElementAspectProps
@@ -849,7 +851,7 @@ beta;type;Run
849851
beta;namespace;Run
850852
beta;interface;RunLayoutResult
851853
beta;type;RunProps
852-
alpha;interface;SaveChangesArgs
854+
beta;interface;SaveChangesArgs
853855
public;enum;SchemaState
854856
public;interface;SectionDrawingLocationProps
855857
preview;interface;SectionDrawingLocationProps

0 commit comments

Comments
 (0)