@pageproof/sdk-pr 343.0.1621910843755 → 344.0.1622150707409
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.
|
@@ -31,9 +31,9 @@ declare class TeamUsers extends API {
|
|
|
31
31
|
* const invitations = await admin.team.users.getInvitations();
|
|
32
32
|
*
|
|
33
33
|
* @since v2.0.0-beta.169
|
|
34
|
-
* @returns {Promise<Array<
|
|
34
|
+
* @returns {Promise<Array<TeamInvitedUser>>}
|
|
35
35
|
*/
|
|
36
|
-
getInvitations(): Promise<
|
|
36
|
+
getInvitations(): Promise<TeamInvitedUser[]>;
|
|
37
37
|
/** @private */
|
|
38
38
|
_setEnabled(email: any, enabled: any): any;
|
|
39
39
|
/**
|
|
@@ -86,13 +86,15 @@ declare class TeamUsers extends API {
|
|
|
86
86
|
* const admin = await client.admin();
|
|
87
87
|
* await admin.team.users.revokeInvitation({
|
|
88
88
|
* email: 'newuser@domain.com',
|
|
89
|
+
* invitationId: '1TM56KTBFOYR0WKV',
|
|
89
90
|
* });
|
|
90
91
|
*
|
|
91
92
|
* @since v2.0.0-beta.169
|
|
92
93
|
* @param {string} email The email of the user to revoke the invitation for
|
|
94
|
+
* @param {string} invitationId The invitation id
|
|
93
95
|
* @returns {Promise}
|
|
94
96
|
*/
|
|
95
|
-
revokeInvitation({ email }: string): Promise<any>;
|
|
97
|
+
revokeInvitation({ email, invitationId }: string): Promise<any>;
|
|
96
98
|
/**
|
|
97
99
|
* Removes a user from the team.
|
|
98
100
|
*
|
|
@@ -160,3 +162,4 @@ declare class TeamUsers extends API {
|
|
|
160
162
|
}
|
|
161
163
|
import API from "../API";
|
|
162
164
|
import User from "../../models/User";
|
|
165
|
+
import TeamInvitedUser from "../../models/TeamInvitedUser";
|
|
@@ -14,6 +14,10 @@ var _User = require('../../models/User');
|
|
|
14
14
|
|
|
15
15
|
var _User2 = _interopRequireDefault(_User);
|
|
16
16
|
|
|
17
|
+
var _TeamInvitedUser = require('../../models/TeamInvitedUser');
|
|
18
|
+
|
|
19
|
+
var _TeamInvitedUser2 = _interopRequireDefault(_TeamInvitedUser);
|
|
20
|
+
|
|
17
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
22
|
|
|
19
23
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -33,6 +37,13 @@ function transformResponseUsers(response) {
|
|
|
33
37
|
});
|
|
34
38
|
}
|
|
35
39
|
|
|
40
|
+
/** @private */
|
|
41
|
+
function transformResponseTeamInvitedUsers(response) {
|
|
42
|
+
return response.data.map(function (teamInvitedUser) {
|
|
43
|
+
return new _TeamInvitedUser2.default().fromTeamInvitedUsers(teamInvitedUser);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
36
47
|
var TeamUsers = function (_API) {
|
|
37
48
|
_inherits(TeamUsers, _API);
|
|
38
49
|
|
|
@@ -80,12 +91,12 @@ var TeamUsers = function (_API) {
|
|
|
80
91
|
* const invitations = await admin.team.users.getInvitations();
|
|
81
92
|
*
|
|
82
93
|
* @since v2.0.0-beta.169
|
|
83
|
-
* @returns {Promise<Array<
|
|
94
|
+
* @returns {Promise<Array<TeamInvitedUser>>}
|
|
84
95
|
*/
|
|
85
96
|
|
|
86
97
|
|
|
87
98
|
TeamUsers.prototype.getInvitations = function getInvitations() {
|
|
88
|
-
return this.client.request('admin.team.users.invitations').then(
|
|
99
|
+
return this.client.request('admin.team.users.invitations').then(transformResponseTeamInvitedUsers);
|
|
89
100
|
};
|
|
90
101
|
|
|
91
102
|
/** @private */
|
|
@@ -165,19 +176,23 @@ var TeamUsers = function (_API) {
|
|
|
165
176
|
* const admin = await client.admin();
|
|
166
177
|
* await admin.team.users.revokeInvitation({
|
|
167
178
|
* email: 'newuser@domain.com',
|
|
179
|
+
* invitationId: '1TM56KTBFOYR0WKV',
|
|
168
180
|
* });
|
|
169
181
|
*
|
|
170
182
|
* @since v2.0.0-beta.169
|
|
171
183
|
* @param {string} email The email of the user to revoke the invitation for
|
|
184
|
+
* @param {string} invitationId The invitation id
|
|
172
185
|
* @returns {Promise}
|
|
173
186
|
*/
|
|
174
187
|
|
|
175
188
|
|
|
176
189
|
TeamUsers.prototype.revokeInvitation = function revokeInvitation(_ref) {
|
|
177
|
-
var email = _ref.email
|
|
190
|
+
var email = _ref.email,
|
|
191
|
+
invitationId = _ref.invitationId;
|
|
178
192
|
|
|
179
193
|
return this.client.request('admin.team.users.revoke-invitation', {
|
|
180
|
-
email: email
|
|
194
|
+
email: email,
|
|
195
|
+
invitationId: invitationId
|
|
181
196
|
});
|
|
182
197
|
};
|
|
183
198
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default TeamInvitedUser;
|
|
2
|
+
declare class TeamInvitedUser {
|
|
3
|
+
/**
|
|
4
|
+
* The invitation ID.
|
|
5
|
+
*
|
|
6
|
+
* @type {string}
|
|
7
|
+
*/
|
|
8
|
+
invitationId: string;
|
|
9
|
+
/**
|
|
10
|
+
* The user who is pending invited to the team.
|
|
11
|
+
*
|
|
12
|
+
* @type {User}
|
|
13
|
+
*/
|
|
14
|
+
user: User;
|
|
15
|
+
/**
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
18
|
+
fromTeamInvitedUsers(teamUserInvitedData: any): TeamInvitedUser;
|
|
19
|
+
}
|
|
20
|
+
import User from "./User";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.__esModule=true;var _transform=require("./transform");var _transform2=_interopRequireDefault(_transform);var _User=require("./User");var _User2=_interopRequireDefault(_User);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var teamInvitedUserSchema={invitationId:"Id",user:function user(data){return(new _User2.default).fromUser(data.User)}};var TeamInvitedUser=function(){function TeamInvitedUser(){_classCallCheck(this,TeamInvitedUser)}TeamInvitedUser.prototype.fromTeamInvitedUsers=function fromTeamInvitedUsers(teamUserInvitedData){(0,_transform2.default)(this,teamInvitedUserSchema,teamUserInvitedData);return this};return TeamInvitedUser}();exports.default=TeamInvitedUser;
|