Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/true-pens-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@itwin/scenes-client": patch
---

Add `lastModifiedById` to `Scene`, `SceneObject`, and `Tag` response interfaces. Tracks the id of the user who last made changes.
3 changes: 3 additions & 0 deletions packages/scenes-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ console.log(sceneResponse.scene);
displayName: "My Scene",
iTwinId: "<itwin_id>",
createdById: "<creator_id>",
lastModifiedById: "<editor_id>",
creationTime: "2025-01-01T10:00:00.000Z",
lastModified: "2025-01-01T10:01:00.000Z",
sceneData: { objects: [...] },
Expand Down Expand Up @@ -176,6 +177,7 @@ console.log(objectResponse.object);
version: "1.0.0",
data: { ... },
createdById: "<creator_id>",
lastModifiedById: "<editor_id>",
creationTime: "2025-01-01T10:00:00.000Z",
lastModified: "2025-01-01T10:01:00.000Z"
}
Expand Down Expand Up @@ -470,6 +472,7 @@ console.log(tagResponse.tag);
displayName: "Structural",
iTwinId: "<itwin_id>",
createdById: "<creator_id>",
lastModifiedById: "<editor_id>",
creationTime: "2025-01-01T10:00:00.000Z",
lastModified: "2025-01-01T10:01:00.000Z"
}
Expand Down
3 changes: 3 additions & 0 deletions packages/scenes-client/src/models/object/sceneObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ interface SceneObjectResponseMetadata {
sceneId: string;
/** Id of the user who created the scene object (UUID). */
createdById: string;
/** Id of the user who last modified the scene object (UUID). */
lastModifiedById: string;
/** Time the scene object was created as an ISO8601 string, 'YYYY-MM-DDTHH:mm:ss.sssZ'. */
creationTime: string;
/** Time the scene object was last modified as an ISO8601 string, 'YYYY-MM-DDTHH:mm:ss.sssZ'. */
Expand Down Expand Up @@ -65,6 +67,7 @@ export function isSceneObject(v: unknown): v is SceneObject {
typeof v.id === "string" &&
typeof v.sceneId === "string" &&
typeof v.createdById === "string" &&
typeof v.lastModifiedById === "string" &&
typeof v.creationTime === "string" &&
typeof v.lastModified === "string" &&
isSceneObjectCreate(v)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { isSceneObjectCreate } from "./sceneObjectCreate.js";

export type SceneObjectMinimal = UnionOmit<
SceneObject,
"sceneId" | "createdById" | "creationTime" | "lastModified"
"sceneId" | "createdById" | "lastModifiedById" | "creationTime" | "lastModified"
>;

export function isSceneObjectMinimal(v: unknown): v is SceneObjectMinimal {
Expand Down
3 changes: 3 additions & 0 deletions packages/scenes-client/src/models/scene/sceneMinimal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export interface SceneMinimal {
description?: string;
/** Id of the user who created the scene (UUID). */
createdById: string;
/** Id of the user who last modified the scene (UUID). */
lastModifiedById: string;
/** iTwin Id associated with the scene (UUID). */
iTwinId: string;
/** Time the scene was created as an ISO8601 string, 'YYYY-MM-DDTHH:mm:ss.sssZ'. */
Expand All @@ -32,6 +34,7 @@ export function isSceneMinimal(v: unknown): v is SceneMinimal {
typeof v.id === "string" &&
typeof v.displayName === "string" &&
typeof v.createdById === "string" &&
typeof v.lastModifiedById === "string" &&
typeof v.iTwinId === "string" &&
typeof v.creationTime === "string" &&
typeof v.lastModified === "string" &&
Expand Down
3 changes: 3 additions & 0 deletions packages/scenes-client/src/models/tag/tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export interface Tag extends TagMinimal {
iTwinId: string;
/** Id of the user who created the tag (UUID). */
createdById: string;
/** Id of the user who last modified the tag (UUID). */
lastModifiedById: string;
/** Time the tag was created as an ISO8601 string, 'YYYY-MM-DDTHH:mm:ss.sssZ'. */
creationTime: string;
/** Time the tag was last modified as an ISO8601 string, 'YYYY-MM-DDTHH:mm:ss.sssZ'. */
Expand All @@ -23,6 +25,7 @@ export function isTag(v: unknown): v is Tag {
isTagMinimal(v) &&
typeof v.iTwinId === "string" &&
typeof v.createdById === "string" &&
typeof v.lastModifiedById === "string" &&
typeof v.creationTime === "string" &&
typeof v.lastModified === "string"
);
Expand Down
5 changes: 5 additions & 0 deletions packages/scenes-client/tests/unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ const exampleSceneResponse: SceneResponse = {
description: "Some Description XYZ123",
iTwinId: "itwin-1",
createdById: "user-1",
lastModifiedById: "user-1",
creationTime: "2025-07-16T15:00:00.000Z",
lastModified: "2025-07-16T15:00:00.000Z",
tags: [{ id: "tag-1", displayName: "Tag 1" }],
Expand All @@ -788,6 +789,7 @@ const exampleSceneMetadataResponse: SceneMetadataResponse = {
description: "Some Description XYZ123",
iTwinId: "itwin-1",
createdById: "user-1",
lastModifiedById: "user-1",
creationTime: "2025-07-16T15:00:00.000Z",
lastModified: "2025-07-16T15:00:00.000Z",
tags: [{ id: "tag-1", displayName: "Tag 1" }],
Expand All @@ -807,6 +809,7 @@ const exampleSceneListResponse: SceneListResponse = {
description: "Some Description XYZ123",
iTwinId: "itwin-1",
createdById: "user-1",
lastModifiedById: "user-1",
creationTime: "2025-07-16T15:00:00.000Z",
lastModified: "2025-07-16T15:00:00.000Z",
tags: [{ id: "tag-1", displayName: "Tag 1" }],
Expand All @@ -821,6 +824,7 @@ const exampleTagResponse: TagResponse = {
displayName: "Tag 1",
iTwinId: "itwin-1",
createdById: "user-1",
lastModifiedById: "user-1",
creationTime: "2025-07-16T15:00:00.000Z",
lastModified: "2025-07-16T15:00:00.000Z",
},
Expand All @@ -840,6 +844,7 @@ const exampleSceneObjectResponse: SceneObjectResponse = {
data: {},
sceneId: "scene-1",
createdById: "user-1",
lastModifiedById: "user-1",
creationTime: "2025-07-16T15:00:00.000Z",
lastModified: "2025-07-16T15:00:00.000Z",
},
Expand Down
Loading