@meistrari/auth-nuxt 1.0.5 → 1.0.6
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,16 +1,15 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
2
|
import type { CreateTeamPayload, FullOrganization, Invitation, InviteUserToOrganizationOptions, ListMembersOptions, Member, RemoveUserFromOrganizationOptions, Team, TeamMember, UpdateMemberRoleOptions, UpdateOrganizationPayload, UpdateTeamPayload } from '@meistrari/auth-core';
|
|
3
|
-
import type { FullOrganizationWithRelations } from './state.js';
|
|
4
3
|
export interface UseTelaOrganizationReturn {
|
|
5
4
|
/** Reactive reference to the active organization with members, invitations, and teams. */
|
|
6
|
-
activeOrganization: Ref<
|
|
5
|
+
activeOrganization: Ref<FullOrganization | null>;
|
|
7
6
|
/** Reactive reference to the current user's membership in the active organization. */
|
|
8
7
|
activeMember: Ref<Member | null>;
|
|
9
8
|
/**
|
|
10
9
|
* Retrieves the active organization for the current user session and updates the active organization state.
|
|
11
10
|
* @returns The active organization with members, invitations, and teams
|
|
12
11
|
*/
|
|
13
|
-
getActiveOrganization: () => Promise<
|
|
12
|
+
getActiveOrganization: () => Promise<FullOrganization | undefined>;
|
|
14
13
|
/**
|
|
15
14
|
* Lists all organizations for the current user session.
|
|
16
15
|
* @returns A list of organizations
|
|
@@ -10,14 +10,7 @@ export function useTelaOrganization() {
|
|
|
10
10
|
if (!session.value?.activeOrganizationId) {
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
-
const organization = await authClient.organization.getOrganization(
|
|
14
|
-
session.value?.activeOrganizationId,
|
|
15
|
-
{
|
|
16
|
-
includeMembers: true,
|
|
17
|
-
includeInvitations: true,
|
|
18
|
-
includeTeams: true
|
|
19
|
-
}
|
|
20
|
-
);
|
|
13
|
+
const organization = await authClient.organization.getOrganization(session.value?.activeOrganizationId);
|
|
21
14
|
activeOrganization.value = organization;
|
|
22
15
|
return organization;
|
|
23
16
|
}
|
|
@@ -27,11 +20,7 @@ export function useTelaOrganization() {
|
|
|
27
20
|
async function setActiveOrganization(id) {
|
|
28
21
|
await authClient.organization.setActiveOrganization(id);
|
|
29
22
|
const [organization, { token }] = await Promise.all([
|
|
30
|
-
authClient.organization.getOrganization(id,
|
|
31
|
-
includeMembers: true,
|
|
32
|
-
includeInvitations: true,
|
|
33
|
-
includeTeams: true
|
|
34
|
-
}),
|
|
23
|
+
authClient.organization.getOrganization(id),
|
|
35
24
|
authClient.session.getToken()
|
|
36
25
|
]);
|
|
37
26
|
useCookie(jwtCookieName).value = token;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import type { FullOrganization,
|
|
2
|
-
export type FullOrganizationWithRelations = FullOrganization & {
|
|
3
|
-
members: Member[];
|
|
4
|
-
invitations: Invitation[];
|
|
5
|
-
teams: Team[];
|
|
6
|
-
};
|
|
1
|
+
import type { FullOrganization, Member } from '@meistrari/auth-core';
|
|
7
2
|
/**
|
|
8
3
|
* Shared state for session management.
|
|
9
4
|
* This module provides access to session-related state without creating circular dependencies.
|
|
@@ -69,6 +64,6 @@ export declare function useSessionState(): {
|
|
|
69
64
|
* This module provides access to organization-related state without creating circular dependencies.
|
|
70
65
|
*/
|
|
71
66
|
export declare function useOrganizationState(): {
|
|
72
|
-
activeOrganization: import("vue").Ref<
|
|
67
|
+
activeOrganization: import("vue").Ref<FullOrganization | null, FullOrganization | null>;
|
|
73
68
|
activeMember: import("vue").Ref<Member | null, Member | null>;
|
|
74
69
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meistrari/auth-nuxt",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"build": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@meistrari/auth-core": "1.5.
|
|
34
|
+
"@meistrari/auth-core": "1.5.2"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"nuxt": "^3.0.0 || ^4.0.0"
|