@@ -5,8 +5,10 @@ interface SpaceParams {
55 id : string
66 isDefault : boolean
77 name : string
8+ slug ?: string
89 teamId : string
910 teamName : string
11+ teamSlug ?: string
1012}
1113
1214/**
@@ -17,8 +19,10 @@ export class Space {
1719 public readonly id : string
1820 public readonly isDefault : boolean
1921 public readonly name : string
22+ public readonly slug : string
2023 public readonly teamId : string
2124 public readonly teamName : string
25+ public readonly teamSlug : string
2226
2327 public constructor ( params : SpaceParams ) {
2428 if ( params . id . trim ( ) . length === 0 ) {
@@ -40,8 +44,10 @@ export class Space {
4044 this . id = params . id
4145 this . isDefault = params . isDefault
4246 this . name = params . name
47+ this . slug = params . slug ?? params . name
4348 this . teamId = params . teamId
4449 this . teamName = params . teamName
50+ this . teamSlug = params . teamSlug ?? params . teamName
4551 }
4652
4753 /**
@@ -72,8 +78,10 @@ export class Space {
7278 id : json . id ,
7379 isDefault : json . is_default ,
7480 name : json . name ,
81+ slug : typeof json . slug === 'string' ? json . slug : json . name ,
7582 teamId : json . team_id ,
7683 teamName : json . team_name ,
84+ teamSlug : typeof json . team_slug === 'string' ? json . team_slug : json . team_name ,
7785 } )
7886 }
7987
@@ -93,8 +101,10 @@ export class Space {
93101 id : this . id ,
94102 isDefault : this . isDefault ,
95103 name : this . name ,
104+ slug : this . slug ,
96105 teamId : this . teamId ,
97106 teamName : this . teamName ,
107+ teamSlug : this . teamSlug ,
98108 }
99109 }
100110}
0 commit comments