diff --git a/package.json b/package.json index 2c579fc..c27920b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@internxt/sdk", - "version": "1.5.5", + "version": "1.5.6", "description": "An sdk for interacting with Internxt's services", "repository": { "type": "git", diff --git a/src/workspaces/index.test.ts b/src/workspaces/index.test.ts index edfa9e3..4e0f211 100644 --- a/src/workspaces/index.test.ts +++ b/src/workspaces/index.test.ts @@ -284,14 +284,13 @@ describe('Workspaces service tests', () => { describe('getWorkspacesTeamMembers', () => { it('should return the members of a team when getWorkspacesTeamMembers is called', async () => { - const workspaceId = 'workspaceId'; const teamId = 'teamId'; const { client, headers } = clientAndHeaders(); const getCall = sinon.stub(httpClient, 'get').resolves(); - await client.getWorkspacesTeamMembers(workspaceId, teamId); + await client.getWorkspacesTeamMembers(teamId); - expect(getCall.firstCall.args).toEqual([`workspaces/${workspaceId}/teams/${teamId}/members`, headers]); + expect(getCall.firstCall.args).toEqual([`workspaces/teams/${teamId}/members`, headers]); }); }); diff --git a/src/workspaces/index.ts b/src/workspaces/index.ts index 304b466..9d9dc20 100644 --- a/src/workspaces/index.ts +++ b/src/workspaces/index.ts @@ -27,6 +27,7 @@ import { WorkspaceSetupInfo, WorkspacesResponse, WorkspaceTeamResponse, + TeamMembers, } from './types'; export class Workspaces { @@ -173,8 +174,8 @@ export class Workspaces { return this.client.delete(`workspaces/teams/${teamId}`, this.headers()); } - public getWorkspacesTeamMembers(workspaceId: string, teamId: string): Promise { - return this.client.get(`workspaces/${workspaceId}/teams/${teamId}/members`, this.headers()); + public getWorkspacesTeamMembers(teamId: string): Promise { + return this.client.get(`workspaces/teams/${teamId}/members`, this.headers()); } public addTeamUser(teamId: string, userUuid: string): Promise { diff --git a/src/workspaces/types.ts b/src/workspaces/types.ts index 69292d6..bf76512 100644 --- a/src/workspaces/types.ts +++ b/src/workspaces/types.ts @@ -86,6 +86,15 @@ export type WorkspaceMembers = { disabledUsers: WorkspaceUser[]; }; +export type TeamMembers = { + name: string; + lastname: string; + email: string; + id: number; + uuid: string; + avatar: string | null; +}[]; + export type Member = { avatar: string | null; backupsBucket: string | null;