seatsio 71.0.0 → 71.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seatsio",
3
- "version": "71.0.0",
3
+ "version": "71.1.0",
4
4
  "main": "index.js",
5
5
  "description": "Official JavaScript and Node.JS client library for the Seats.io REST API",
6
6
  "license": "MIT",
@@ -1,6 +1,7 @@
1
1
  const Page = require('../Page.js')
2
2
  const Lister = require('../Lister.js')
3
3
  const User = require('./User.js')
4
+ const Invitation = require('../Invitations/Invitation')
4
5
 
5
6
  class Users {
6
7
  /**
@@ -20,6 +21,7 @@ class Users {
20
21
  const requestParameters = { email, role, workspaces }
21
22
 
22
23
  return this.client.post('/users/actions/invite', requestParameters)
24
+ .then(res => new Invitation(res.data))
23
25
  }
24
26
 
25
27
  /**
@@ -4,11 +4,11 @@ test('invite users', async () => {
4
4
  const { client } = await testUtils.createTestUserAndClient()
5
5
  const email = testUtils.getRandomEmail()
6
6
 
7
- await client.users.invite(email, 'COMPANY_ADMIN')
7
+ const invitation = await client.users.invite(email, 'COMPANY_ADMIN')
8
8
 
9
9
  const invitations = await client.invitations.listAll()
10
10
  expect(invitations.length).toBe(1)
11
- expect(invitations[0].email).toBe(email)
11
+ expect(invitation.email).toBe(email)
12
12
  })
13
13
 
14
14
  test('invite non admin users', async () => {
@@ -17,9 +17,9 @@ test('invite non admin users', async () => {
17
17
  const workspace = await client.workspaces.create('a workspace')
18
18
  const workspace2 = await client.workspaces.create('another workspace')
19
19
 
20
- await client.users.invite(email, 'NON_ADMIN', [workspace.key, workspace2.key])
20
+ const invitation = await client.users.invite(email, 'NON_ADMIN', [workspace.key, workspace2.key])
21
21
 
22
22
  const invitations = await client.invitations.listAll()
23
23
  expect(invitations.length).toBe(1)
24
- expect(invitations[0].email).toBe(email)
24
+ expect(invitation.email).toBe(email)
25
25
  })