@meistrari/auth-nuxt 3.26.0 → 3.27.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
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AcceptInvitationResult, 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, ListOrganizationsOptions, ListOrganizationsWithRoleOptions, Member, OrganizationWithRole, 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. */
|
|
@@ -14,7 +14,10 @@ export interface UseTelaOrganizationReturn {
|
|
|
14
14
|
* Lists all organizations for the current user session.
|
|
15
15
|
* @returns A list of organizations
|
|
16
16
|
*/
|
|
17
|
-
listOrganizations:
|
|
17
|
+
listOrganizations: {
|
|
18
|
+
(options: ListOrganizationsWithRoleOptions): Promise<Array<FullOrganization & OrganizationWithRole>>;
|
|
19
|
+
(options?: ListOrganizationsOptions): Promise<FullOrganization[]>;
|
|
20
|
+
};
|
|
18
21
|
/**
|
|
19
22
|
* Sets the active organization for the current user session and updates the active organization state.
|
|
20
23
|
* @param id - The ID of the organization to set as active
|
|
@@ -15,17 +15,25 @@ export function useTelaOrganization() {
|
|
|
15
15
|
activeOrganization.value = organization;
|
|
16
16
|
return organization;
|
|
17
17
|
}
|
|
18
|
-
async function listOrganizations() {
|
|
19
|
-
return await authClient.organization.listOrganizations();
|
|
18
|
+
async function listOrganizations(options) {
|
|
19
|
+
return await authClient.organization.listOrganizations(options);
|
|
20
20
|
}
|
|
21
21
|
async function setActiveOrganization(id) {
|
|
22
22
|
await authClient.organization.setActiveOrganization(id);
|
|
23
|
-
const [organization, { token }] = await Promise.all([
|
|
23
|
+
const [organization, member, { token }] = await Promise.all([
|
|
24
24
|
authClient.organization.getOrganization(id),
|
|
25
|
+
authClient.organization.getActiveMember(),
|
|
25
26
|
authClient.session.getToken()
|
|
26
27
|
]);
|
|
27
28
|
useCookie(jwtCookieName).value = token;
|
|
28
29
|
activeOrganization.value = organization;
|
|
30
|
+
activeMember.value = member;
|
|
31
|
+
if (session.value) {
|
|
32
|
+
session.value = {
|
|
33
|
+
...session.value,
|
|
34
|
+
activeOrganizationId: id
|
|
35
|
+
};
|
|
36
|
+
}
|
|
29
37
|
}
|
|
30
38
|
async function updateOrganization(payload) {
|
|
31
39
|
if (!activeOrganization.value) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meistrari/auth-nuxt",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.27.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.37.0",
|
|
40
40
|
"jose": "6.1.3"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|