native-pytech 1.0.211 → 1.0.213

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.
@@ -2,8 +2,6 @@ import { NativeStackNavigationOptions } from "expo-router/build/react-navigation
2
2
  export declare const deviceTier: "low" | "medium" | "high";
3
3
  export declare const isLowTier: boolean;
4
4
  type ExpoEnv = {
5
- SUPABASE_USERNAME_LOGIN: string;
6
- SUPABASE_PASSWORD_LOGIN: string;
7
5
  SUPABASE_URL: string;
8
6
  SUPABASE_KEY: string;
9
7
  SUPABASE_SERVICE_ROLE_KEY: string;
@@ -6,8 +6,6 @@ export const isLowTier = Platform.OS === 'android' && deviceTier === 'low';
6
6
  const getExpoEnv = () => {
7
7
  const expoEnv = Constants.expoConfig?.extra || {};
8
8
  return {
9
- SUPABASE_USERNAME_LOGIN: expoEnv.SUPABASE_USERNAME_LOGIN || process.env.SUPABASE_USERNAME_LOGIN,
10
- SUPABASE_PASSWORD_LOGIN: expoEnv.SUPABASE_PASSWORD_LOGIN || process.env.SUPABASE_PASSWORD_LOGIN,
11
9
  SUPABASE_URL: expoEnv.SUPABASE_URL || process.env.SUPABASE_URL,
12
10
  SUPABASE_KEY: expoEnv.SUPABASE_KEY || process.env.SUPABASE_KEY,
13
11
  SUPABASE_SERVICE_ROLE_KEY: expoEnv.SUPABASE_SERVICE_ROLE_KEY || process.env.SUPABASE_SERVICE_ROLE_KEY,
@@ -1,18 +1,10 @@
1
1
  import { useRouter } from 'expo-router';
2
- import { memo, useEffect } from 'react';
3
- import supabase from '../../../../../libs/supabase';
2
+ import { memo } from 'react';
4
3
  import Screen from '../../Screen';
5
4
  import { handleSubmitLogIn } from '../utils';
6
5
  import Link from '../../../../../libs/components/Link';
7
6
  export default memo(({ title = 'MiApp', subtitle = 'Inicia sesión con un correo electrónico o nombre de usuario para usar la aplicación.', iconPage = <Screen.SvgPytech />, textCreateAccount, enableCreateAccount = false, }) => {
8
7
  const router = useRouter();
9
- useEffect(() => {
10
- (async () => {
11
- const { error } = await supabase.logIn();
12
- if (!error)
13
- console.log('LogIn exitoso');
14
- })();
15
- }, []);
16
8
  return (<Screen iconPage={iconPage} title={title} subtitle={subtitle} bottomElements={<>
17
9
  <Screen.Input placeholder='Correo o nombre de usuario' keyboardType='email-address' autoComplete='email' handleSubmit={async ({ value }) => await handleSubmitLogIn({ username: value, router })}/>
18
10
  {enableCreateAccount && (<Link text={textCreateAccount || `Crear tu cuenta de ${title}`} onPress={({ router }) => router.push({ pathname: '/login/inicio/signIn' })}/>)}
@@ -1,7 +1,7 @@
1
1
  declare const supabase: {
2
- logIn: ({ email, password }?: {
3
- email?: string;
4
- password?: string;
2
+ logIn: ({ email, password }: {
3
+ email: string;
4
+ password: string;
5
5
  }) => Promise<import("@supabase/auth-js").AuthTokenResponsePassword>;
6
6
  logOut: () => Promise<{
7
7
  error: import("@supabase/auth-js").AuthError | null;
@@ -1,7 +1,7 @@
1
1
  import * as utils from '../../utils';
2
- export declare const logIn: ({ email, password }?: {
3
- email?: string;
4
- password?: string;
2
+ export declare const logIn: ({ email, password }: {
3
+ email: string;
4
+ password: string;
5
5
  }) => Promise<import("@supabase/auth-js").AuthTokenResponsePassword>;
6
6
  export declare const logOut: () => Promise<{
7
7
  error: import("@supabase/auth-js").AuthError | null;
@@ -1,8 +1,6 @@
1
1
  import supabase from './config';
2
2
  import * as utils from '../../utils';
3
- import { expoEnv } from '../../../../../libs/constants/consts';
4
- const { SUPABASE_USERNAME_LOGIN, SUPABASE_PASSWORD_LOGIN } = expoEnv;
5
- export const logIn = async ({ email = SUPABASE_USERNAME_LOGIN, password = SUPABASE_PASSWORD_LOGIN } = {}) => (await utils.logIn(supabase, { email, password }));
3
+ export const logIn = async ({ email, password }) => (await utils.logIn(supabase, { email, password }));
6
4
  export const logOut = async () => await utils.logOut(supabase);
7
5
  export const getUser = async () => await utils.getUser(supabase);
8
6
  export const execFunction = async (params) => (await utils.execFunction(supabase, params));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.211",
3
+ "version": "1.0.213",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",