@meistrari/auth-nuxt 1.0.1 → 1.0.3
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/api-key.js +5 -5
- package/dist/runtime/composables/organization.d.ts +1 -1
- package/dist/runtime/composables/organization.js +5 -5
- package/dist/runtime/composables/state.d.ts +56 -4
- package/dist/runtime/shared.d.ts +2 -1
- package/dist/runtime/shared.js +1 -1
- package/package.json +2 -2
package/dist/module.json
CHANGED
|
@@ -5,19 +5,19 @@ export function useTelaApiKey() {
|
|
|
5
5
|
const tokenCookie = useCookie(jwtCookieName);
|
|
6
6
|
const authClient = createNuxtAuthClient(apiUrl, () => tokenCookie.value ?? null);
|
|
7
7
|
async function createApiKey(payload) {
|
|
8
|
-
return authClient.apiKey.createApiKey(payload);
|
|
8
|
+
return await authClient.apiKey.createApiKey(payload);
|
|
9
9
|
}
|
|
10
10
|
async function updateApiKey(payload) {
|
|
11
|
-
return authClient.apiKey.updateApiKey(payload);
|
|
11
|
+
return await authClient.apiKey.updateApiKey(payload);
|
|
12
12
|
}
|
|
13
13
|
async function deleteApiKey(id) {
|
|
14
|
-
return authClient.apiKey.deleteApiKey(id);
|
|
14
|
+
return await authClient.apiKey.deleteApiKey(id);
|
|
15
15
|
}
|
|
16
16
|
async function listApiKeys() {
|
|
17
|
-
return authClient.apiKey.listApiKeys();
|
|
17
|
+
return await authClient.apiKey.listApiKeys();
|
|
18
18
|
}
|
|
19
19
|
async function getApiKey(id) {
|
|
20
|
-
return authClient.apiKey.getApiKey(id);
|
|
20
|
+
return await authClient.apiKey.getApiKey(id);
|
|
21
21
|
}
|
|
22
22
|
return {
|
|
23
23
|
createApiKey,
|
|
@@ -1,6 +1,6 @@
|
|
|
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 {
|
|
3
|
+
import type { FullOrganizationWithRelations } from './state.js';
|
|
4
4
|
export interface UseTelaOrganizationReturn {
|
|
5
5
|
/** Reactive reference to the active organization with members, invitations, and teams. */
|
|
6
6
|
activeOrganization: Ref<FullOrganizationWithRelations | null>;
|
|
@@ -23,7 +23,7 @@ export function useTelaOrganization() {
|
|
|
23
23
|
return organization;
|
|
24
24
|
}
|
|
25
25
|
async function listOrganizations() {
|
|
26
|
-
return authClient.organization.listOrganizations();
|
|
26
|
+
return await authClient.organization.listOrganizations();
|
|
27
27
|
}
|
|
28
28
|
async function setActiveOrganization(id) {
|
|
29
29
|
await authClient.organization.setActiveOrganization(id);
|
|
@@ -43,7 +43,7 @@ export function useTelaOrganization() {
|
|
|
43
43
|
return organization;
|
|
44
44
|
}
|
|
45
45
|
async function listMembers(options) {
|
|
46
|
-
return authClient.organization.listMembers(options);
|
|
46
|
+
return await authClient.organization.listMembers(options);
|
|
47
47
|
}
|
|
48
48
|
async function getActiveMember() {
|
|
49
49
|
const member = await authClient.organization.getActiveMember();
|
|
@@ -128,13 +128,13 @@ export function useTelaOrganization() {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
async function listTeams() {
|
|
131
|
-
return authClient.organization.listTeams();
|
|
131
|
+
return await authClient.organization.listTeams();
|
|
132
132
|
}
|
|
133
133
|
async function listTeamMembers(id) {
|
|
134
|
-
return authClient.organization.listTeamMembers(id);
|
|
134
|
+
return await authClient.organization.listTeamMembers(id);
|
|
135
135
|
}
|
|
136
136
|
async function addTeamMember(teamId, userId) {
|
|
137
|
-
return authClient.organization.addTeamMember(teamId, userId);
|
|
137
|
+
return await authClient.organization.addTeamMember(teamId, userId);
|
|
138
138
|
}
|
|
139
139
|
async function removeTeamMember(teamId, userId) {
|
|
140
140
|
await authClient.organization.removeTeamMember(teamId, userId);
|
|
@@ -9,14 +9,66 @@ export type FullOrganizationWithRelations = FullOrganization & {
|
|
|
9
9
|
* This module provides access to session-related state without creating circular dependencies.
|
|
10
10
|
*/
|
|
11
11
|
export declare function useSessionState(): {
|
|
12
|
-
user: import("vue").Ref<
|
|
13
|
-
|
|
12
|
+
user: import("vue").Ref<{
|
|
13
|
+
id: string;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
email: string;
|
|
17
|
+
emailVerified: boolean;
|
|
18
|
+
name: string;
|
|
19
|
+
image?: string | null | undefined;
|
|
20
|
+
twoFactorEnabled: boolean | null | undefined;
|
|
21
|
+
banned: boolean | null | undefined;
|
|
22
|
+
role?: string | null | undefined;
|
|
23
|
+
banReason?: string | null | undefined;
|
|
24
|
+
banExpires?: Date | null | undefined;
|
|
25
|
+
lastActiveAt?: Date | null | undefined;
|
|
26
|
+
} | null, {
|
|
27
|
+
id: string;
|
|
28
|
+
createdAt: Date;
|
|
29
|
+
updatedAt: Date;
|
|
30
|
+
email: string;
|
|
31
|
+
emailVerified: boolean;
|
|
32
|
+
name: string;
|
|
33
|
+
image?: string | null | undefined;
|
|
34
|
+
twoFactorEnabled: boolean | null | undefined;
|
|
35
|
+
banned: boolean | null | undefined;
|
|
36
|
+
role?: string | null | undefined;
|
|
37
|
+
banReason?: string | null | undefined;
|
|
38
|
+
banExpires?: Date | null | undefined;
|
|
39
|
+
lastActiveAt?: Date | null | undefined;
|
|
40
|
+
} | null>;
|
|
41
|
+
session: import("vue").Ref<{
|
|
42
|
+
id: string;
|
|
43
|
+
createdAt: Date;
|
|
44
|
+
updatedAt: Date;
|
|
45
|
+
userId: string;
|
|
46
|
+
expiresAt: Date;
|
|
47
|
+
token: string;
|
|
48
|
+
ipAddress?: string | null | undefined;
|
|
49
|
+
userAgent?: string | null | undefined;
|
|
50
|
+
activeOrganizationId?: string | null | undefined;
|
|
51
|
+
activeTeamId?: string | null | undefined;
|
|
52
|
+
impersonatedBy?: string | null | undefined;
|
|
53
|
+
} | null, {
|
|
54
|
+
id: string;
|
|
55
|
+
createdAt: Date;
|
|
56
|
+
updatedAt: Date;
|
|
57
|
+
userId: string;
|
|
58
|
+
expiresAt: Date;
|
|
59
|
+
token: string;
|
|
60
|
+
ipAddress?: string | null | undefined;
|
|
61
|
+
userAgent?: string | null | undefined;
|
|
62
|
+
activeOrganizationId?: string | null | undefined;
|
|
63
|
+
activeTeamId?: string | null | undefined;
|
|
64
|
+
impersonatedBy?: string | null | undefined;
|
|
65
|
+
} | null>;
|
|
14
66
|
};
|
|
15
67
|
/**
|
|
16
68
|
* Shared state for organization management.
|
|
17
69
|
* This module provides access to organization-related state without creating circular dependencies.
|
|
18
70
|
*/
|
|
19
71
|
export declare function useOrganizationState(): {
|
|
20
|
-
activeOrganization: import("vue").Ref<
|
|
21
|
-
activeMember: import("vue").Ref<
|
|
72
|
+
activeOrganization: import("vue").Ref<FullOrganizationWithRelations | null, FullOrganizationWithRelations | null>;
|
|
73
|
+
activeMember: import("vue").Ref<Member | null, Member | null>;
|
|
22
74
|
};
|
package/dist/runtime/shared.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { AuthClient } from '@meistrari/auth-core';
|
|
2
|
+
export declare function createNuxtAuthClient(apiUrl: string, getAuthToken: () => string | null): AuthClient;
|
package/dist/runtime/shared.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AuthClient } from "@meistrari/auth-core";
|
|
2
|
-
|
|
2
|
+
import { version } from "../../package.json";
|
|
3
3
|
export function createNuxtAuthClient(apiUrl, getAuthToken) {
|
|
4
4
|
const serviceName = typeof process !== "undefined" ? process.env.SERVICE_NAME : "";
|
|
5
5
|
const userAgent = `auth-sdk:nuxt:${version}${serviceName ? `@${serviceName}` : ""}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meistrari/auth-nuxt",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
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.4.
|
|
34
|
+
"@meistrari/auth-core": "1.4.7"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"nuxt": "^3.0.0 || ^4.0.0"
|