@meistrari/auth-core 3.3.0 → 3.4.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/dist/index.d.mts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.mjs +10 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -5778,8 +5778,13 @@ type InviteUserToOrganizationOptions = {
|
|
|
5778
5778
|
role: Role;
|
|
5779
5779
|
/** Application role granted on acceptance. Required with an application-scoped session. */
|
|
5780
5780
|
applicationRole?: string;
|
|
5781
|
-
/**
|
|
5781
|
+
/**
|
|
5782
|
+
* Optional team to add the user to upon acceptance. Sent as `teamIds: [teamId]`.
|
|
5783
|
+
* @deprecated Use `teamIds`. Passing both throws.
|
|
5784
|
+
*/
|
|
5782
5785
|
teamId?: string;
|
|
5786
|
+
/** Teams to add the user to upon acceptance. */
|
|
5787
|
+
teamIds?: string[];
|
|
5783
5788
|
/** Whether to resend the invitation if one already exists for this email. */
|
|
5784
5789
|
resend?: boolean;
|
|
5785
5790
|
};
|
|
@@ -5990,11 +5995,12 @@ declare class OrganizationService {
|
|
|
5990
5995
|
* @param options.userEmail - Email address of the user to invite
|
|
5991
5996
|
* @param options.role - Role to assign to the invited user
|
|
5992
5997
|
* @param options.applicationRole - Application role granted on acceptance; required with an application-scoped session
|
|
5993
|
-
* @param options.teamId -
|
|
5998
|
+
* @param options.teamId - Deprecated: team ID to add the user to, sent as `teamIds: [teamId]`
|
|
5999
|
+
* @param options.teamIds - Team IDs to add the user to
|
|
5994
6000
|
* @param options.resend - Whether to resend if invitation already exists
|
|
5995
6001
|
* @returns The created invitation
|
|
5996
6002
|
*/
|
|
5997
|
-
inviteUserToOrganization({ userEmail, role, applicationRole, teamId, resend }: InviteUserToOrganizationOptions): Promise<NonNullable<{
|
|
6003
|
+
inviteUserToOrganization({ userEmail, role, applicationRole, teamId, teamIds, resend }: InviteUserToOrganizationOptions): Promise<NonNullable<{
|
|
5998
6004
|
id: string;
|
|
5999
6005
|
organizationId: string;
|
|
6000
6006
|
email: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -5778,8 +5778,13 @@ type InviteUserToOrganizationOptions = {
|
|
|
5778
5778
|
role: Role;
|
|
5779
5779
|
/** Application role granted on acceptance. Required with an application-scoped session. */
|
|
5780
5780
|
applicationRole?: string;
|
|
5781
|
-
/**
|
|
5781
|
+
/**
|
|
5782
|
+
* Optional team to add the user to upon acceptance. Sent as `teamIds: [teamId]`.
|
|
5783
|
+
* @deprecated Use `teamIds`. Passing both throws.
|
|
5784
|
+
*/
|
|
5782
5785
|
teamId?: string;
|
|
5786
|
+
/** Teams to add the user to upon acceptance. */
|
|
5787
|
+
teamIds?: string[];
|
|
5783
5788
|
/** Whether to resend the invitation if one already exists for this email. */
|
|
5784
5789
|
resend?: boolean;
|
|
5785
5790
|
};
|
|
@@ -5990,11 +5995,12 @@ declare class OrganizationService {
|
|
|
5990
5995
|
* @param options.userEmail - Email address of the user to invite
|
|
5991
5996
|
* @param options.role - Role to assign to the invited user
|
|
5992
5997
|
* @param options.applicationRole - Application role granted on acceptance; required with an application-scoped session
|
|
5993
|
-
* @param options.teamId -
|
|
5998
|
+
* @param options.teamId - Deprecated: team ID to add the user to, sent as `teamIds: [teamId]`
|
|
5999
|
+
* @param options.teamIds - Team IDs to add the user to
|
|
5994
6000
|
* @param options.resend - Whether to resend if invitation already exists
|
|
5995
6001
|
* @returns The created invitation
|
|
5996
6002
|
*/
|
|
5997
|
-
inviteUserToOrganization({ userEmail, role, applicationRole, teamId, resend }: InviteUserToOrganizationOptions): Promise<NonNullable<{
|
|
6003
|
+
inviteUserToOrganization({ userEmail, role, applicationRole, teamId, teamIds, resend }: InviteUserToOrganizationOptions): Promise<NonNullable<{
|
|
5998
6004
|
id: string;
|
|
5999
6005
|
organizationId: string;
|
|
6000
6006
|
email: string;
|
package/dist/index.mjs
CHANGED
|
@@ -21,7 +21,7 @@ function isTokenExpired(token, expiresInMs) {
|
|
|
21
21
|
return nowInSeconds > expirationTime;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
const version = "3.
|
|
24
|
+
const version = "3.4.0";
|
|
25
25
|
|
|
26
26
|
function parsedEnumValues(schema) {
|
|
27
27
|
return Object.fromEntries(
|
|
@@ -1984,17 +1984,22 @@ class OrganizationService {
|
|
|
1984
1984
|
* @param options.userEmail - Email address of the user to invite
|
|
1985
1985
|
* @param options.role - Role to assign to the invited user
|
|
1986
1986
|
* @param options.applicationRole - Application role granted on acceptance; required with an application-scoped session
|
|
1987
|
-
* @param options.teamId -
|
|
1987
|
+
* @param options.teamId - Deprecated: team ID to add the user to, sent as `teamIds: [teamId]`
|
|
1988
|
+
* @param options.teamIds - Team IDs to add the user to
|
|
1988
1989
|
* @param options.resend - Whether to resend if invitation already exists
|
|
1989
1990
|
* @returns The created invitation
|
|
1990
1991
|
*/
|
|
1991
|
-
async inviteUserToOrganization({ userEmail, role, applicationRole, teamId, resend }) {
|
|
1992
|
+
async inviteUserToOrganization({ userEmail, role, applicationRole, teamId, teamIds, resend }) {
|
|
1993
|
+
if (teamId !== void 0 && teamIds !== void 0) {
|
|
1994
|
+
throw new Error("Pass either teamId or teamIds, not both");
|
|
1995
|
+
}
|
|
1996
|
+
const requestedTeamIds = teamIds ?? (teamId !== void 0 ? [teamId] : void 0);
|
|
1992
1997
|
return await this.client.organization.inviteMember({
|
|
1993
1998
|
email: userEmail,
|
|
1994
1999
|
role,
|
|
1995
|
-
teamId,
|
|
1996
2000
|
resend: resend ?? false,
|
|
1997
|
-
...applicationRole ? { applicationRole } : {}
|
|
2001
|
+
...applicationRole ? { applicationRole } : {},
|
|
2002
|
+
...requestedTeamIds !== void 0 ? { teamIds: requestedTeamIds } : {}
|
|
1998
2003
|
});
|
|
1999
2004
|
}
|
|
2000
2005
|
/**
|