bruce-models 7.1.95 → 7.1.97
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/dist/bruce-models.es5.js +155 -41
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +155 -41
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account-concept.js +29 -4
- package/dist/lib/account/account-concept.js.map +1 -1
- package/dist/lib/account/account-invite.js +96 -3
- package/dist/lib/account/account-invite.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/calculator/calculator.js +9 -8
- package/dist/lib/calculator/calculator.js.map +1 -1
- package/dist/lib/user/user.js +20 -25
- package/dist/lib/user/user.js.map +1 -1
- package/dist/types/account/account-concept.d.ts +5 -1
- package/dist/types/account/account-invite.d.ts +84 -2
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/user/user.d.ts +4 -5
- package/package.json +1 -1
|
@@ -23,10 +23,34 @@ export declare namespace AccountInvite {
|
|
|
23
23
|
IsClosed?: boolean;
|
|
24
24
|
Status: EStatus;
|
|
25
25
|
"UserGroup.ID"?: string[];
|
|
26
|
+
SentTo?: string;
|
|
27
|
+
RequiresIdentity?: boolean;
|
|
28
|
+
IdentityProof?: EIdentityProof;
|
|
26
29
|
InviteCode?: string;
|
|
27
30
|
"Invited.User": User.IUser;
|
|
28
31
|
"InvitedBy.User"?: User.IUser;
|
|
29
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* One invited user's invitations, as returned by the grouped list.
|
|
35
|
+
*/
|
|
36
|
+
interface IInviteGroup {
|
|
37
|
+
"Invited.User.ID": string;
|
|
38
|
+
"Invited.User"?: User.IUser;
|
|
39
|
+
"Invite.ID": number[];
|
|
40
|
+
OpenCount: number;
|
|
41
|
+
InviteMethod: EInviteMethod[];
|
|
42
|
+
"UserGroup.ID"?: string[];
|
|
43
|
+
"InviteCode.ExpiryTime"?: string;
|
|
44
|
+
SentTo?: string;
|
|
45
|
+
Items: IInvite[];
|
|
46
|
+
}
|
|
47
|
+
const ERROR_ALREADY_MEMBER = "AlreadyMember";
|
|
48
|
+
/**
|
|
49
|
+
* Returns whether a failed Create was refused because the user is already in the account.
|
|
50
|
+
* @param error the value thrown by Create.
|
|
51
|
+
* @returns
|
|
52
|
+
*/
|
|
53
|
+
function IsAlreadyMemberError(error: any): boolean;
|
|
30
54
|
/**
|
|
31
55
|
* Possible invite statuses.
|
|
32
56
|
*/
|
|
@@ -35,7 +59,8 @@ export declare namespace AccountInvite {
|
|
|
35
59
|
Cancelled = "Cancelled",
|
|
36
60
|
Sent = "Sent",
|
|
37
61
|
NotSent = "Not sent",
|
|
38
|
-
Accepted = "Accepted"
|
|
62
|
+
Accepted = "Accepted",
|
|
63
|
+
Superseded = "Superseded"
|
|
39
64
|
}
|
|
40
65
|
/**
|
|
41
66
|
* Returns whether an invite is still awaiting a response from its recipient.
|
|
@@ -44,6 +69,13 @@ export declare namespace AccountInvite {
|
|
|
44
69
|
* @returns
|
|
45
70
|
*/
|
|
46
71
|
function IsPending(invite: IInvite): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Ways an invited user can prove they are who the invitation was addressed to.
|
|
74
|
+
*/
|
|
75
|
+
enum EIdentityProof {
|
|
76
|
+
Password = "Password",
|
|
77
|
+
Session = "Session"
|
|
78
|
+
}
|
|
47
79
|
/**
|
|
48
80
|
* Possible invite methods.
|
|
49
81
|
*/
|
|
@@ -65,6 +97,54 @@ export declare namespace AccountInvite {
|
|
|
65
97
|
}): Promise<{
|
|
66
98
|
invite: IInvite;
|
|
67
99
|
}>;
|
|
100
|
+
/**
|
|
101
|
+
* Returns one invite by its ID. Requires the session to be an account owner or admin.
|
|
102
|
+
* @param params
|
|
103
|
+
* @returns
|
|
104
|
+
*/
|
|
105
|
+
function GetByID(params: {
|
|
106
|
+
api?: GuardianApi.Api;
|
|
107
|
+
id: number;
|
|
108
|
+
req?: Api.IReqParams;
|
|
109
|
+
}): Promise<{
|
|
110
|
+
invite: IInvite;
|
|
111
|
+
}>;
|
|
112
|
+
/**
|
|
113
|
+
* Returns a list of invites grouped by the invited user.
|
|
114
|
+
* Paging covers users rather than invites, so a user's invitations never straddle a page.
|
|
115
|
+
* @param params
|
|
116
|
+
* @returns
|
|
117
|
+
*/
|
|
118
|
+
function GetListByUser(params: {
|
|
119
|
+
api?: GuardianApi.Api;
|
|
120
|
+
accountId?: string;
|
|
121
|
+
userId?: string;
|
|
122
|
+
status?: EStatus[];
|
|
123
|
+
expired?: boolean;
|
|
124
|
+
expandUsers?: boolean;
|
|
125
|
+
expandGroups?: boolean;
|
|
126
|
+
pageSize?: number;
|
|
127
|
+
pageIndex?: number;
|
|
128
|
+
req?: Api.IReqParams;
|
|
129
|
+
}): Promise<{
|
|
130
|
+
users: IInviteGroup[];
|
|
131
|
+
totalCount?: number;
|
|
132
|
+
hasNextPage?: boolean;
|
|
133
|
+
userGroups?: UserGroup.IGroup[];
|
|
134
|
+
}>;
|
|
135
|
+
/**
|
|
136
|
+
* Re-delivers an invitation that is still open, renewing its code and expiry.
|
|
137
|
+
* @param params
|
|
138
|
+
* @returns
|
|
139
|
+
*/
|
|
140
|
+
function Resend(params: {
|
|
141
|
+
api?: GuardianApi.Api;
|
|
142
|
+
id: number;
|
|
143
|
+
emailTemplateKey?: string;
|
|
144
|
+
req?: Api.IReqParams;
|
|
145
|
+
}): Promise<{
|
|
146
|
+
invite: IInvite;
|
|
147
|
+
}>;
|
|
68
148
|
/**
|
|
69
149
|
* Returns a list of invites matching provided criteria.
|
|
70
150
|
* For example you can get a list of invites for a specific account or user (or both).
|
|
@@ -79,6 +159,7 @@ export declare namespace AccountInvite {
|
|
|
79
159
|
expired?: boolean;
|
|
80
160
|
expandUsers?: boolean;
|
|
81
161
|
expandGroups?: boolean;
|
|
162
|
+
groupByUser?: boolean;
|
|
82
163
|
pageSize?: number;
|
|
83
164
|
pageIndex?: number;
|
|
84
165
|
req?: Api.IReqParams;
|
|
@@ -111,9 +192,10 @@ export declare namespace AccountInvite {
|
|
|
111
192
|
api?: GuardianApi.Api;
|
|
112
193
|
code?: string;
|
|
113
194
|
id?: number;
|
|
114
|
-
status
|
|
195
|
+
status?: EStatus | string;
|
|
115
196
|
groupIds?: string[];
|
|
116
197
|
user?: User.IUser;
|
|
198
|
+
password?: string;
|
|
117
199
|
req?: Api.IReqParams;
|
|
118
200
|
}): Promise<{
|
|
119
201
|
invite: IInvite;
|
|
@@ -216,12 +216,10 @@ export declare namespace User {
|
|
|
216
216
|
*/
|
|
217
217
|
function ForgotPassword(params: {
|
|
218
218
|
api?: GuardianApi.Api;
|
|
219
|
-
accountId
|
|
219
|
+
accountId?: string;
|
|
220
220
|
email: string;
|
|
221
221
|
req?: Api.IReqParams;
|
|
222
|
-
}): Promise<
|
|
223
|
-
userId: string;
|
|
224
|
-
}>;
|
|
222
|
+
}): Promise<void>;
|
|
225
223
|
/**
|
|
226
224
|
* Completes password reset using a password reset code and new password.
|
|
227
225
|
* @param params
|
|
@@ -230,7 +228,8 @@ export declare namespace User {
|
|
|
230
228
|
function ForgotPasswordComplete(params: {
|
|
231
229
|
api?: GuardianApi.Api;
|
|
232
230
|
code: string;
|
|
233
|
-
|
|
231
|
+
email?: string;
|
|
232
|
+
userId?: string;
|
|
234
233
|
password: string;
|
|
235
234
|
req?: Api.IReqParams;
|
|
236
235
|
}): Promise<{
|