@meistrari/auth-nuxt 3.19.0 → 3.20.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/module.json +1 -1
- package/dist/runtime/composables/application/organization.d.ts +3 -5
- package/dist/runtime/composables/application/organization.js +2 -2
- package/dist/runtime/composables/organization.d.ts +4 -6
- package/dist/runtime/composables/organization.js +2 -2
- package/package.json +2 -2
package/dist/module.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CreateTeamPayload, FullOrganization, Invitation, InviteUserToOrganizationOptions, ListMembersOptions, Member, RemoveUserFromOrganizationOptions, Team, TeamMember, UpdateMemberRoleOptions, UpdateTeamPayload } from '@meistrari/auth-core';
|
|
1
|
+
import type { AcceptInvitationResult, CreateTeamPayload, FullOrganization, Invitation, InviteUserToOrganizationOptions, ListMembersOptions, Member, RemoveUserFromOrganizationOptions, Team, TeamMember, UpdateMemberRoleOptions, UpdateTeamPayload } from '@meistrari/auth-core';
|
|
2
2
|
import type { Ref } from 'vue';
|
|
3
3
|
export interface UseTelaApplicationOrganizationReturn {
|
|
4
4
|
/** Reactive reference to the active organization with members, invitations, and teams. */
|
|
@@ -84,11 +84,9 @@ export interface UseTelaApplicationOrganizationReturn {
|
|
|
84
84
|
* afterwards.
|
|
85
85
|
*
|
|
86
86
|
* @param id - The invitation id to accept.
|
|
87
|
-
* @returns
|
|
87
|
+
* @returns The accepted member and the application's home URL, or `null`.
|
|
88
88
|
*/
|
|
89
|
-
acceptInvitation: (id: string) => Promise<
|
|
90
|
-
homeUrl: string | null;
|
|
91
|
-
}>;
|
|
89
|
+
acceptInvitation: (id: string) => Promise<AcceptInvitationResult>;
|
|
92
90
|
/**
|
|
93
91
|
* Cancels a pending invitation before it is accepted, revoking it so the link
|
|
94
92
|
* can no longer be used, and removes it from `activeOrganization.invitations`
|
|
@@ -49,7 +49,7 @@ export function useTelaOrganization() {
|
|
|
49
49
|
return invitation;
|
|
50
50
|
}
|
|
51
51
|
async function acceptInvitation(id) {
|
|
52
|
-
const
|
|
52
|
+
const result = await authClient.organization.acceptInvitation(id);
|
|
53
53
|
const members = await authClient.organization.listMembers();
|
|
54
54
|
if (activeOrganization.value) {
|
|
55
55
|
activeOrganization.value = {
|
|
@@ -57,7 +57,7 @@ export function useTelaOrganization() {
|
|
|
57
57
|
members
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
return
|
|
60
|
+
return result;
|
|
61
61
|
}
|
|
62
62
|
async function cancelInvitation(id) {
|
|
63
63
|
await authClient.organization.cancelInvitation(id);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CreateTeamPayload, FullOrganization, Invitation, InviteUserToOrganizationOptions, ListMembersOptions, Member, RemoveUserFromOrganizationOptions, Team, TeamMember, UpdateMemberRoleOptions, UpdateOrganizationPayload, UpdateTeamPayload } from '@meistrari/auth-core';
|
|
1
|
+
import type { AcceptInvitationResult, CreateTeamPayload, FullOrganization, Invitation, InviteUserToOrganizationOptions, ListMembersOptions, Member, RemoveUserFromOrganizationOptions, Team, TeamMember, UpdateMemberRoleOptions, UpdateOrganizationPayload, UpdateTeamPayload } from '@meistrari/auth-core';
|
|
2
2
|
import type { Ref } from 'vue';
|
|
3
3
|
export interface UseTelaOrganizationReturn {
|
|
4
4
|
/** Reactive reference to the active organization with members, invitations, and teams. */
|
|
@@ -46,12 +46,10 @@ export interface UseTelaOrganizationReturn {
|
|
|
46
46
|
/**
|
|
47
47
|
* Accepts an organization invitation and updates the active organization state.
|
|
48
48
|
* @param id - The invitation ID to accept
|
|
49
|
-
* @returns
|
|
50
|
-
* scoped to an application that defines one; otherwise `null`.
|
|
49
|
+
* @returns The accepted member and the application's `homeUrl` when the invitation
|
|
50
|
+
* is scoped to an application that defines one; otherwise `null`.
|
|
51
51
|
*/
|
|
52
|
-
acceptInvitation: (id: string) => Promise<
|
|
53
|
-
homeUrl: string | null;
|
|
54
|
-
}>;
|
|
52
|
+
acceptInvitation: (id: string) => Promise<AcceptInvitationResult>;
|
|
55
53
|
/**
|
|
56
54
|
* Cancels a pending organization invitation and updates the active organization state.
|
|
57
55
|
* @param id - The invitation ID to cancel
|
|
@@ -58,7 +58,7 @@ export function useTelaOrganization() {
|
|
|
58
58
|
return invitation;
|
|
59
59
|
}
|
|
60
60
|
async function acceptInvitation(id) {
|
|
61
|
-
const
|
|
61
|
+
const result = await authClient.organization.acceptInvitation(id);
|
|
62
62
|
const members = await authClient.organization.listMembers();
|
|
63
63
|
if (activeOrganization.value) {
|
|
64
64
|
activeOrganization.value = {
|
|
@@ -66,7 +66,7 @@ export function useTelaOrganization() {
|
|
|
66
66
|
members
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
return
|
|
69
|
+
return result;
|
|
70
70
|
}
|
|
71
71
|
async function cancelInvitation(id) {
|
|
72
72
|
await authClient.organization.cancelInvitation(id);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meistrari/auth-nuxt",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.20.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"docs": "nuxt-module-build prepare && typedoc"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@meistrari/auth-core": "1.
|
|
39
|
+
"@meistrari/auth-core": "1.30.0",
|
|
40
40
|
"jose": "6.1.3"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|