@mframework/layer-auth 0.0.2 → 0.0.4

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.
@@ -0,0 +1,8 @@
1
+ export interface MeeoviCustomerGroup {
2
+ id: string
3
+ name: string
4
+ description?: string | null
5
+ memberIds?: string[]
6
+ metadata?: Record<string, unknown>
7
+ }
8
+
@@ -0,0 +1,47 @@
1
+ export interface MeeoviUser {
2
+ instance_id?: string | null
3
+ id: string
4
+ aud?: string | null
5
+ role?: string | null
6
+ email?: string | null
7
+ encrypted_password?: string | null
8
+ email_confirmed_at?: string | null
9
+ invited_at?: string | null
10
+ confirmation_token?: string | null
11
+ confirmation_sent_at?: string | null
12
+ recovery_token?: string | null
13
+ recovery_sent_at?: string | null
14
+ email_change_token_new?: string | null
15
+ email_change?: string | null
16
+ email_change_sent_at?: string | null
17
+ last_sign_in_at?: string | null
18
+ raw_app_meta_data?: Record<string, unknown> | null
19
+ raw_user_meta_data?: Record<string, unknown> | null
20
+ is_super_admin?: boolean | null
21
+ created_at?: string | null
22
+ updated_at?: string | null
23
+ phone?: string | null
24
+ phone_confirmed_at?: string | null
25
+ phone_change?: string | null
26
+ phone_change_token?: string | null
27
+ phone_change_sent_at?: string | null
28
+ confirmed_at?: string | null
29
+ email_change_token_current?: string | null
30
+ email_change_confirm_status?: number | null
31
+ banned_until?: string | null
32
+ reauthentication_token?: string | null
33
+ reauthentication_sent_at?: string | null
34
+ is_sso_user?: boolean
35
+ deleted_at?: string | null
36
+ is_anonymous?: boolean
37
+ identities?: Record<string, unknown>[]
38
+ mfa_factors?: Record<string, unknown>[]
39
+ oauth_authorizations?: Record<string, unknown>[]
40
+ oauth_consents?: Record<string, unknown>[]
41
+ one_time_tokens?: Record<string, unknown>[]
42
+ sessions?: Record<string, unknown>[]
43
+ emoji_reactions?: Record<string, unknown>[]
44
+ profiles?: Record<string, unknown> | null
45
+ }
46
+
47
+
@@ -30,10 +30,11 @@
30
30
 
31
31
  <script setup>
32
32
  import { useHead, useRoute, useRuntimeConfig, navigateTo } from '#app'
33
- import { definePageMeta, useLocalePath, useI18n } from '#imports'
33
+ import { definePageMeta } from '#imports'
34
34
  import { z } from 'zod'
35
35
  import { reactive, ref } from 'vue'
36
36
  import { useAuth } from '../composables/useAuth'
37
+ import { useLocalePath, useI18n } from 'vue-i18n'
37
38
 
38
39
  definePageMeta({
39
40
  auth: {
@@ -0,0 +1,7 @@
1
+ import { AuthSession } from "./session"
2
+
3
+ export interface AuthAdapter {
4
+ getSession(): Promise<AuthSession | null>
5
+ signIn(email: string, password: string): Promise<AuthSession>
6
+ signOut(): Promise<void>
7
+ }
@@ -0,0 +1,7 @@
1
+ export interface User {
2
+ id?: string
3
+ first_name?: string
4
+ last_name?: string
5
+ email?: string
6
+ [key: string]: any
7
+ }
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod'
2
+
3
+ export const LoginInputSchema = z.object({
4
+ email: z.string().email(),
5
+ password: z.string().min(8)
6
+ })
7
+
8
+ export type LoginInput = z.infer<typeof LoginInputSchema>
9
+
10
+ export const RegisterInputSchema = z.object({
11
+ email: z.string().email(),
12
+ password: z.string().min(8),
13
+ confirmPassword: z.string().min(8)
14
+ }).refine((data) => data.password === data.confirmPassword, {
15
+ message: 'Passwords do not match',
16
+ path: ['confirmPassword']
17
+ })
18
+
19
+ export type RegisterInput = z.infer<typeof RegisterInputSchema>
20
+
21
+ export const ForgotPasswordInputSchema = z.object({
22
+ email: z.string().email()
23
+ })
24
+
25
+ export type ForgotPasswordInput = z.infer<typeof ForgotPasswordInputSchema>
26
+
27
+ export const ResetPasswordInputSchema = z.object({
28
+ token: z.string(),
29
+ password: z.string().min(8),
30
+ confirmPassword: z.string().min(8)
31
+ })
32
+
33
+ export type ResetPasswordInput = z.infer<typeof ResetPasswordInputSchema>
@@ -0,0 +1,6 @@
1
+ export interface OAuthProvider {
2
+ id: string
3
+ label: string
4
+ icon?: string
5
+ authUrl: string
6
+ }
@@ -0,0 +1,8 @@
1
+ import { AuthUser } from "./user"
2
+
3
+ export interface AuthSession {
4
+ user: AuthUser | null
5
+ accessToken: string | null
6
+ refreshToken?: string | null
7
+ expiresAt?: number
8
+ }
@@ -0,0 +1,9 @@
1
+ export interface AuthUser {
2
+ id: string
3
+ email: string
4
+ name?: string
5
+ avatarUrl?: string
6
+ emailVerified: boolean
7
+ createdAt: string
8
+ updatedAt: string
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mframework/layer-auth",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "The authentication layer for M Framework applications.",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",