Skip to content

Commit 45ee490

Browse files
authored
Updated repository interface and GetRepositoryResourceRepresentationResponse Interface (#80)
* ✨ Update Repository interface to make subClass optional and improve response structure * Added changeset * updated package to fix audit issues
1 parent 6e6c234 commit 45ee490

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

.changeset/wide-ends-attack.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@itwin/itwins-client": patch
3+
---
4+
5+
Updated repository interface to make subclass optional and move properties into resource object for GetRepositoryResourceRepresentationResponse

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/types/Repository.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface Repository {
1515
/** Main classification of the repository */
1616
class: RepositoryClass;
1717
/** Sub-classification providing more specific categorization */
18-
subClass: RepositorySubClass;
18+
subClass?: RepositorySubClass;
1919
/** Human-readable name for the repository */
2020
displayName: string;
2121
/** The URI or endpoint URL for accessing the repository data */
@@ -105,8 +105,10 @@ export type RepositorySubClass =
105105
* Repository classes that support creating new repositories.
106106
* @beta
107107
*/
108-
export type CreatableRepositoryClass = Extract<RepositoryClass, "GeographicInformationSystem" | "Construction" | "Subsurface">;
109-
108+
export type CreatableRepositoryClass = Extract<
109+
RepositoryClass,
110+
"GeographicInformationSystem" | "Construction" | "Subsurface"
111+
>;
110112

111113
/**
112114
* Response interface for single repository operations (create, get, update)
@@ -167,14 +169,16 @@ export interface GetRepositoryResourceMinimalResponse {
167169

168170
/**
169171
* Response interface for getting a repository resource in representation mode.
170-
* Extends the minimal response with additional detailed properties.
171172
* @beta
172173
*/
173-
export interface GetRepositoryResourceRepresentationResponse extends GetRepositoryResourceMinimalResponse {
174-
/** Additional properties providing detailed information about the resource */
175-
properties?: {
176-
/** Dynamic properties specific to the resource type */
177-
[key: string]: unknown;
174+
export interface GetRepositoryResourceRepresentationResponse {
175+
/** The repository resource with detailed information including properties */
176+
resource: GetRepositoryResourceMinimalResponse["resource"] & {
177+
/** Additional properties providing detailed information about the resource */
178+
properties?: {
179+
/** Dynamic properties specific to the resource type */
180+
[key: string]: unknown;
181+
};
178182
};
179183
}
180184

0 commit comments

Comments
 (0)