@chem-po/firebase-native 0.0.16 → 0.0.17
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/lib/commonjs/adapter/auth.js +221 -0
- package/lib/commonjs/adapter/auth.js.map +1 -0
- package/lib/commonjs/adapter/db.js +103 -0
- package/lib/commonjs/adapter/db.js.map +1 -0
- package/lib/commonjs/adapter/index.js +16 -0
- package/lib/commonjs/adapter/index.js.map +1 -0
- package/lib/commonjs/adapter/storage.js +52 -0
- package/lib/commonjs/adapter/storage.js.map +1 -0
- package/lib/commonjs/auth/functions.js +11 -0
- package/lib/commonjs/auth/functions.js.map +1 -0
- package/lib/commonjs/auth/index.js +17 -0
- package/lib/commonjs/auth/index.js.map +1 -0
- package/lib/commonjs/components/AuthenticatorVerify.js +90 -0
- package/lib/commonjs/components/AuthenticatorVerify.js.map +1 -0
- package/lib/commonjs/components/FirebaseSignIn.js +196 -0
- package/lib/commonjs/components/FirebaseSignIn.js.map +1 -0
- package/lib/commonjs/components/PhoneVerify.js +123 -0
- package/lib/commonjs/components/PhoneVerify.js.map +1 -0
- package/lib/commonjs/components/TwoFactorAuthModal.js +118 -0
- package/lib/commonjs/components/TwoFactorAuthModal.js.map +1 -0
- package/lib/commonjs/components/index.js +28 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/contexts/FirebaseContext.js +48 -0
- package/lib/commonjs/contexts/FirebaseContext.js.map +1 -0
- package/lib/commonjs/contexts/index.js +17 -0
- package/lib/commonjs/contexts/index.js.map +1 -0
- package/lib/commonjs/db/index.js +17 -0
- package/lib/commonjs/db/index.js.map +1 -0
- package/lib/commonjs/db/utils.js +120 -0
- package/lib/commonjs/db/utils.js.map +1 -0
- package/lib/commonjs/hooks/backend.js +12 -0
- package/lib/commonjs/hooks/backend.js.map +1 -0
- package/lib/commonjs/hooks/index.js +17 -0
- package/lib/commonjs/hooks/index.js.map +1 -0
- package/lib/commonjs/hooks/useAuthenticatorVerify.js +52 -0
- package/lib/commonjs/hooks/useAuthenticatorVerify.js.map +1 -0
- package/lib/commonjs/hooks/usePhoneVerify.js +83 -0
- package/lib/commonjs/hooks/usePhoneVerify.js.map +1 -0
- package/lib/commonjs/icons/Google.js +29 -0
- package/lib/commonjs/icons/Google.js.map +1 -0
- package/lib/commonjs/index.js +94 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/storage/index.js +17 -0
- package/lib/commonjs/storage/index.js.map +1 -0
- package/lib/commonjs/storage/utils.js +37 -0
- package/lib/commonjs/storage/utils.js.map +1 -0
- package/lib/commonjs/types/adapter.js +6 -0
- package/lib/commonjs/types/adapter.js.map +1 -0
- package/lib/commonjs/types/auth.js +6 -0
- package/lib/commonjs/types/auth.js.map +1 -0
- package/lib/commonjs/types/db.js +6 -0
- package/lib/commonjs/types/db.js.map +1 -0
- package/lib/commonjs/types/functions.js +6 -0
- package/lib/commonjs/types/functions.js.map +1 -0
- package/lib/commonjs/types/index.js +6 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/types/storage.js +6 -0
- package/lib/commonjs/types/storage.js.map +1 -0
- package/lib/module/adapter/auth.js +214 -0
- package/lib/module/adapter/auth.js.map +1 -0
- package/lib/module/adapter/db.js +96 -0
- package/lib/module/adapter/db.js.map +1 -0
- package/lib/module/adapter/index.js +9 -0
- package/lib/module/adapter/index.js.map +1 -0
- package/lib/module/adapter/storage.js +45 -0
- package/lib/module/adapter/storage.js.map +1 -0
- package/lib/module/auth/functions.js +3 -0
- package/lib/module/auth/functions.js.map +1 -0
- package/lib/module/auth/index.js +2 -0
- package/lib/module/auth/index.js.map +1 -0
- package/lib/module/components/AuthenticatorVerify.js +82 -0
- package/lib/module/components/AuthenticatorVerify.js.map +1 -0
- package/lib/module/components/FirebaseSignIn.js +187 -0
- package/lib/module/components/FirebaseSignIn.js.map +1 -0
- package/lib/module/components/PhoneVerify.js +116 -0
- package/lib/module/components/PhoneVerify.js.map +1 -0
- package/lib/module/components/TwoFactorAuthModal.js +110 -0
- package/lib/module/components/TwoFactorAuthModal.js.map +1 -0
- package/lib/module/components/index.js +3 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/contexts/FirebaseContext.js +39 -0
- package/lib/module/contexts/FirebaseContext.js.map +1 -0
- package/lib/module/contexts/index.js +2 -0
- package/lib/module/contexts/index.js.map +1 -0
- package/lib/module/db/index.js +2 -0
- package/lib/module/db/index.js.map +1 -0
- package/lib/module/db/utils.js +111 -0
- package/lib/module/db/utils.js.map +1 -0
- package/lib/module/hooks/backend.js +5 -0
- package/lib/module/hooks/backend.js.map +1 -0
- package/lib/module/hooks/index.js +2 -0
- package/lib/module/hooks/index.js.map +1 -0
- package/lib/module/hooks/useAuthenticatorVerify.js +45 -0
- package/lib/module/hooks/useAuthenticatorVerify.js.map +1 -0
- package/lib/module/hooks/usePhoneVerify.js +76 -0
- package/lib/module/hooks/usePhoneVerify.js.map +1 -0
- package/lib/module/icons/Google.js +22 -0
- package/lib/module/icons/Google.js.map +1 -0
- package/lib/module/index.js +9 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/storage/index.js +2 -0
- package/lib/module/storage/index.js.map +1 -0
- package/lib/module/storage/utils.js +30 -0
- package/lib/module/storage/utils.js.map +1 -0
- package/lib/module/types/adapter.js +2 -0
- package/lib/module/types/adapter.js.map +1 -0
- package/lib/module/types/auth.js +2 -0
- package/lib/module/types/auth.js.map +1 -0
- package/lib/module/types/db.js +2 -0
- package/lib/module/types/db.js.map +1 -0
- package/lib/module/types/functions.js +2 -0
- package/lib/module/types/functions.js.map +1 -0
- package/lib/module/types/index.js +2 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/storage.js +2 -0
- package/lib/module/types/storage.js.map +1 -0
- package/lib/typescript/adapter/auth.d.ts +7 -0
- package/lib/typescript/adapter/auth.d.ts.map +1 -0
- package/lib/typescript/adapter/db.d.ts +5 -0
- package/lib/typescript/adapter/db.d.ts.map +1 -0
- package/lib/typescript/adapter/index.d.ts +9 -0
- package/lib/typescript/adapter/index.d.ts.map +1 -0
- package/lib/typescript/adapter/storage.d.ts +4 -0
- package/lib/typescript/adapter/storage.d.ts.map +1 -0
- package/lib/typescript/auth/functions.d.ts +4 -0
- package/lib/typescript/auth/functions.d.ts.map +1 -0
- package/lib/typescript/auth/index.d.ts +2 -0
- package/lib/typescript/auth/index.d.ts.map +1 -0
- package/lib/typescript/components/AuthenticatorVerify.d.ts +3 -0
- package/lib/typescript/components/AuthenticatorVerify.d.ts.map +1 -0
- package/lib/typescript/components/FirebaseSignIn.d.ts +6 -0
- package/lib/typescript/components/FirebaseSignIn.d.ts.map +1 -0
- package/lib/typescript/components/PhoneVerify.d.ts +6 -0
- package/lib/typescript/components/PhoneVerify.d.ts.map +1 -0
- package/lib/typescript/components/TwoFactorAuthModal.d.ts +3 -0
- package/lib/typescript/components/TwoFactorAuthModal.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +3 -0
- package/lib/typescript/components/index.d.ts.map +1 -0
- package/lib/typescript/contexts/FirebaseContext.d.ts +9 -0
- package/lib/typescript/contexts/FirebaseContext.d.ts.map +1 -0
- package/lib/typescript/contexts/index.d.ts +2 -0
- package/lib/typescript/contexts/index.d.ts.map +1 -0
- package/lib/typescript/db/index.d.ts +2 -0
- package/lib/typescript/db/index.d.ts.map +1 -0
- package/lib/typescript/db/utils.d.ts +6 -0
- package/lib/typescript/db/utils.d.ts.map +1 -0
- package/lib/typescript/hooks/backend.d.ts +2 -0
- package/lib/typescript/hooks/backend.d.ts.map +1 -0
- package/lib/typescript/hooks/index.d.ts +2 -0
- package/lib/typescript/hooks/index.d.ts.map +1 -0
- package/lib/typescript/hooks/useAuthenticatorVerify.d.ts +8 -0
- package/lib/typescript/hooks/useAuthenticatorVerify.d.ts.map +1 -0
- package/lib/typescript/hooks/usePhoneVerify.d.ts +9 -0
- package/lib/typescript/hooks/usePhoneVerify.d.ts.map +1 -0
- package/lib/typescript/icons/Google.d.ts +5 -0
- package/lib/typescript/icons/Google.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +9 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/storage/index.d.ts +2 -0
- package/lib/typescript/storage/index.d.ts.map +1 -0
- package/lib/typescript/storage/utils.d.ts +4 -0
- package/lib/typescript/storage/utils.d.ts.map +1 -0
- package/lib/typescript/types/adapter.d.ts +6 -0
- package/lib/typescript/types/adapter.d.ts.map +1 -0
- package/lib/typescript/types/auth.d.ts +12 -0
- package/lib/typescript/types/auth.d.ts.map +1 -0
- package/lib/typescript/types/db.d.ts +8 -0
- package/lib/typescript/types/db.d.ts.map +1 -0
- package/lib/typescript/types/functions.d.ts +3 -0
- package/lib/typescript/types/functions.d.ts.map +1 -0
- package/lib/typescript/types/index.d.ts +24 -0
- package/lib/typescript/types/index.d.ts.map +1 -0
- package/lib/typescript/types/storage.d.ts +3 -0
- package/lib/typescript/types/storage.d.ts.map +1 -0
- package/package.json +29 -12
- package/src/adapter/auth.ts +281 -0
- package/src/adapter/db.ts +146 -0
- package/src/adapter/index.ts +30 -0
- package/src/adapter/storage.ts +58 -0
- package/src/auth/functions.ts +7 -0
- package/src/auth/index.ts +1 -0
- package/src/components/AuthenticatorVerify.tsx +75 -0
- package/src/components/FirebaseSignIn.tsx +187 -0
- package/src/components/PhoneVerify.tsx +102 -0
- package/src/components/TwoFactorAuthModal.tsx +133 -0
- package/src/components/index.ts +2 -0
- package/src/contexts/FirebaseContext.tsx +54 -0
- package/src/contexts/index.ts +1 -0
- package/src/db/index.ts +1 -0
- package/src/db/utils.ts +142 -0
- package/src/hooks/backend.ts +4 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useAuthenticatorVerify.ts +45 -0
- package/src/hooks/usePhoneVerify.ts +76 -0
- package/src/icons/Google.tsx +24 -0
- package/src/index.ts +8 -0
- package/src/storage/index.ts +1 -0
- package/src/storage/utils.ts +29 -0
- package/src/types/adapter.ts +13 -0
- package/src/types/auth.ts +13 -0
- package/src/types/db.ts +10 -0
- package/src/types/functions.ts +3 -0
- package/src/types/index.ts +26 -0
- package/src/types/storage.ts +3 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useAuth } from '@chem-po/react';
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
3
|
+
import { useBackend } from './backend';
|
|
4
|
+
export const useAuthenticatorVerify = () => {
|
|
5
|
+
const [code, setCode] = useState('');
|
|
6
|
+
const [verifying, setVerifying] = useState(false);
|
|
7
|
+
const [error, setError] = useState('');
|
|
8
|
+
const twoFactorVerification = useAuth(s => s.multiFactorVerification);
|
|
9
|
+
const {
|
|
10
|
+
auth
|
|
11
|
+
} = useBackend();
|
|
12
|
+
// const { showSuccess, showError, showInfo } = useToast()
|
|
13
|
+
|
|
14
|
+
const handleVerify = useCallback(async () => {
|
|
15
|
+
const verify = auth.verifyMultiFactor;
|
|
16
|
+
if (!verify) {
|
|
17
|
+
setError('Error - Two factor verification is not supported');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (!code) return;
|
|
21
|
+
if (!twoFactorVerification) {
|
|
22
|
+
setError('Error - No session found');
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const resolver = twoFactorVerification.resolver;
|
|
26
|
+
if (!resolver) {
|
|
27
|
+
setError('Error - No session found');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
setVerifying(true);
|
|
31
|
+
try {
|
|
32
|
+
await verify(twoFactorVerification, code);
|
|
33
|
+
} catch (error) {
|
|
34
|
+
setError(error instanceof Error ? error.message : 'An unknown error occurred');
|
|
35
|
+
}
|
|
36
|
+
}, [code, auth, twoFactorVerification]);
|
|
37
|
+
return {
|
|
38
|
+
code,
|
|
39
|
+
setCode,
|
|
40
|
+
verifying,
|
|
41
|
+
error,
|
|
42
|
+
handleVerify
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=useAuthenticatorVerify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useAuth","useCallback","useState","useBackend","useAuthenticatorVerify","code","setCode","verifying","setVerifying","error","setError","twoFactorVerification","s","multiFactorVerification","auth","handleVerify","verify","verifyMultiFactor","resolver","Error","message"],"sourceRoot":"..\\..\\..\\src","sources":["hooks/useAuthenticatorVerify.ts"],"mappings":"AAAA,SAASA,OAAO,QAAQ,gBAAgB;AAExC,SAASC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAC7C,SAASC,UAAU,QAAQ,WAAW;AAEtC,OAAO,MAAMC,sBAAsB,GAAGA,CAAA,KAAM;EAC1C,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGJ,QAAQ,CAAC,EAAE,CAAC;EACpC,MAAM,CAACK,SAAS,EAAEC,YAAY,CAAC,GAAGN,QAAQ,CAAC,KAAK,CAAC;EACjD,MAAM,CAACO,KAAK,EAAEC,QAAQ,CAAC,GAAGR,QAAQ,CAAC,EAAE,CAAC;EACtC,MAAMS,qBAAqB,GAAGX,OAAO,CAACY,CAAC,IAAIA,CAAC,CAACC,uBAAuB,CAAC;EACrE,MAAM;IAAEC;EAAK,CAAC,GAAGX,UAAU,CAAC,CAAC;EAC7B;;EAEA,MAAMY,YAAY,GAAGd,WAAW,CAAC,YAAY;IAC3C,MAAMe,MAAM,GAAGF,IAAI,CAACG,iBAAiB;IACrC,IAAI,CAACD,MAAM,EAAE;MACXN,QAAQ,CAAC,kDAAkD,CAAC;MAC5D;IACF;IACA,IAAI,CAACL,IAAI,EAAE;IACX,IAAI,CAACM,qBAAqB,EAAE;MAC1BD,QAAQ,CAAC,0BAA0B,CAAC;MACpC;IACF;IACA,MAAMQ,QAAQ,GAAGP,qBAAqB,CAACO,QAAiD;IACxF,IAAI,CAACA,QAAQ,EAAE;MACbR,QAAQ,CAAC,0BAA0B,CAAC;MACpC;IACF;IACAF,YAAY,CAAC,IAAI,CAAC;IAClB,IAAI;MACF,MAAMQ,MAAM,CAACL,qBAAqB,EAAEN,IAAI,CAAC;IAC3C,CAAC,CAAC,OAAOI,KAAK,EAAE;MACdC,QAAQ,CAACD,KAAK,YAAYU,KAAK,GAAGV,KAAK,CAACW,OAAO,GAAG,2BAA2B,CAAC;IAChF;EACF,CAAC,EAAE,CAACf,IAAI,EAAES,IAAI,EAAEH,qBAAqB,CAAC,CAAC;EAEvC,OAAO;IACLN,IAAI;IACJC,OAAO;IACPC,SAAS;IACTE,KAAK;IACLM;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { useAuth, useToast } from '@chem-po/react';
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { useBackend } from './backend';
|
|
4
|
+
export const usePhoneVerify = (factor, automaticallySendSmsCode) => {
|
|
5
|
+
const [code, setCode] = useState('');
|
|
6
|
+
const [verifying, setVerifying] = useState(false);
|
|
7
|
+
const [error, setError] = useState('');
|
|
8
|
+
const {
|
|
9
|
+
auth
|
|
10
|
+
} = useBackend();
|
|
11
|
+
const {
|
|
12
|
+
multiFactorVerification: twoFactorVerification,
|
|
13
|
+
enrollmentFactors
|
|
14
|
+
} = useAuth();
|
|
15
|
+
|
|
16
|
+
// const [{ automaticallySendSmsCode }, setCookie] = useCookies(['automaticallySendSmsCode'])
|
|
17
|
+
|
|
18
|
+
const initSendCode = useRef(!!automaticallySendSmsCode);
|
|
19
|
+
const {
|
|
20
|
+
showSuccess,
|
|
21
|
+
showError,
|
|
22
|
+
showInfo
|
|
23
|
+
} = useToast();
|
|
24
|
+
const sendCode = useCallback(async () => {
|
|
25
|
+
if (!enrollmentFactors) {
|
|
26
|
+
showError('Error - No session found');
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
await auth.sendMultiFactorCode(factor, enrollmentFactors.multiFactorResolver);
|
|
30
|
+
}, [auth, factor, twoFactorVerification, showError]);
|
|
31
|
+
const initSendCodeFunc = useRef(sendCode);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (initSendCode.current) {
|
|
34
|
+
initSendCodeFunc.current();
|
|
35
|
+
}
|
|
36
|
+
}, []);
|
|
37
|
+
const handleVerify = useCallback(() => {
|
|
38
|
+
setVerifying(true);
|
|
39
|
+
setError('');
|
|
40
|
+
if (!twoFactorVerification) {
|
|
41
|
+
showError('Error - No session found');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const resolver = twoFactorVerification.resolver;
|
|
45
|
+
if (!resolver) {
|
|
46
|
+
showError('Error - No resolver found');
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const verificationId = twoFactorVerification.verificationId;
|
|
50
|
+
if (!verificationId) {
|
|
51
|
+
showError('Error - No verification ID found');
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const verify = auth.verifyMultiFactor;
|
|
55
|
+
if (!verify) {
|
|
56
|
+
showError('Error - Two factor verification is not supported');
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
verify(twoFactorVerification, code).then(() => {
|
|
60
|
+
setVerifying(false);
|
|
61
|
+
setCode('');
|
|
62
|
+
showSuccess('Verification successful');
|
|
63
|
+
}).catch(e => {
|
|
64
|
+
setVerifying(false);
|
|
65
|
+
setError(e.message || 'An error occurred');
|
|
66
|
+
});
|
|
67
|
+
}, [code, auth, showSuccess, showError]);
|
|
68
|
+
return {
|
|
69
|
+
code,
|
|
70
|
+
setCode,
|
|
71
|
+
verifying,
|
|
72
|
+
error,
|
|
73
|
+
handleVerify
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=usePhoneVerify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useAuth","useToast","useCallback","useEffect","useRef","useState","useBackend","usePhoneVerify","factor","automaticallySendSmsCode","code","setCode","verifying","setVerifying","error","setError","auth","multiFactorVerification","twoFactorVerification","enrollmentFactors","initSendCode","showSuccess","showError","showInfo","sendCode","sendMultiFactorCode","multiFactorResolver","initSendCodeFunc","current","handleVerify","resolver","verificationId","verify","verifyMultiFactor","then","catch","e","message"],"sourceRoot":"..\\..\\..\\src","sources":["hooks/usePhoneVerify.ts"],"mappings":"AACA,SAASA,OAAO,EAAEC,QAAQ,QAAQ,gBAAgB;AAClD,SAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAChE,SAASC,UAAU,QAAQ,WAAW;AAEtC,OAAO,MAAMC,cAAc,GAAGA,CAACC,MAA6B,EAAEC,wBAAiC,KAAK;EAClG,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGN,QAAQ,CAAC,EAAE,CAAC;EACpC,MAAM,CAACO,SAAS,EAAEC,YAAY,CAAC,GAAGR,QAAQ,CAAC,KAAK,CAAC;EACjD,MAAM,CAACS,KAAK,EAAEC,QAAQ,CAAC,GAAGV,QAAQ,CAAC,EAAE,CAAC;EAEtC,MAAM;IAAEW;EAAK,CAAC,GAAGV,UAAU,CAAC,CAAC;EAC7B,MAAM;IAACW,uBAAuB,EAAEC,qBAAqB;IAAEC;EAAiB,CAAC,GAAGnB,OAAO,CAAC,CAAC;;EAErF;;EAEA,MAAMoB,YAAY,GAAGhB,MAAM,CAAC,CAAC,CAACK,wBAAwB,CAAC;EAEvD,MAAM;IAAEY,WAAW;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAGtB,QAAQ,CAAC,CAAC;EAEvD,MAAMuB,QAAQ,GAAGtB,WAAW,CAAC,YAAY;IACvC,IAAI,CAACiB,iBAAiB,EAAE;MACtBG,SAAS,CAAC,0BAA0B,CAAC;MACrC;IACF;IACA,MAAMN,IAAI,CAACS,mBAAmB,CAACjB,MAAM,EAAEW,iBAAiB,CAACO,mBAAmB,CAAC;EAC/E,CAAC,EAAE,CAACV,IAAI,EAAER,MAAM,EAAEU,qBAAqB,EAAEI,SAAS,CAAC,CAAC;EAEpD,MAAMK,gBAAgB,GAAGvB,MAAM,CAACoB,QAAQ,CAAC;EACzCrB,SAAS,CAAC,MAAM;IACd,IAAIiB,YAAY,CAACQ,OAAO,EAAE;MACxBD,gBAAgB,CAACC,OAAO,CAAC,CAAC;IAC5B;EACF,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMC,YAAY,GAAG3B,WAAW,CAAC,MAAM;IACrCW,YAAY,CAAC,IAAI,CAAC;IAClBE,QAAQ,CAAC,EAAE,CAAC;IACZ,IAAI,CAACG,qBAAqB,EAAE;MAC1BI,SAAS,CAAC,0BAA0B,CAAC;MACrC;IACF;IACA,MAAMQ,QAAQ,GAAGZ,qBAAqB,CAACY,QAAQ;IAC/C,IAAI,CAACA,QAAQ,EAAE;MACbR,SAAS,CAAC,2BAA2B,CAAC;MACtC;IACF;IACA,MAAMS,cAAc,GAAGb,qBAAqB,CAACa,cAAc;IAC3D,IAAI,CAACA,cAAc,EAAE;MACnBT,SAAS,CAAC,kCAAkC,CAAC;MAC7C;IACF;IACA,MAAMU,MAAM,GAAGhB,IAAI,CAACiB,iBAAiB;IACrC,IAAI,CAACD,MAAM,EAAE;MACXV,SAAS,CAAC,kDAAkD,CAAC;MAC7D;IACF;IACAU,MAAM,CAACd,qBAAqB,EAAER,IAAI,CAAC,CAChCwB,IAAI,CAAC,MAAM;MACVrB,YAAY,CAAC,KAAK,CAAC;MACnBF,OAAO,CAAC,EAAE,CAAC;MACXU,WAAW,CAAC,yBAAyB,CAAC;IACxC,CAAC,CAAC,CACDc,KAAK,CAACC,CAAC,IAAI;MACVvB,YAAY,CAAC,KAAK,CAAC;MACnBE,QAAQ,CAACqB,CAAC,CAACC,OAAO,IAAI,mBAAmB,CAAC;IAC5C,CAAC,CAAC;EACN,CAAC,EAAE,CAAC3B,IAAI,EAAEM,IAAI,EAAEK,WAAW,EAAEC,SAAS,CAAC,CAAC;EAExC,OAAO;IACLZ,IAAI;IACJC,OAAO;IACPC,SAAS;IACTE,KAAK;IACLe;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import Svg, { Path } from 'react-native-svg';
|
|
4
|
+
const SvgGoogle = props => /*#__PURE__*/React.createElement(Svg, _extends({
|
|
5
|
+
width: 24,
|
|
6
|
+
height: 24,
|
|
7
|
+
viewBox: "0 0 24 24"
|
|
8
|
+
}, props), /*#__PURE__*/React.createElement(Path, {
|
|
9
|
+
fill: "#4285F4",
|
|
10
|
+
d: "M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
|
|
11
|
+
}), /*#__PURE__*/React.createElement(Path, {
|
|
12
|
+
fill: "#34A853",
|
|
13
|
+
d: "M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
|
|
14
|
+
}), /*#__PURE__*/React.createElement(Path, {
|
|
15
|
+
fill: "#FBBC05",
|
|
16
|
+
d: "M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"
|
|
17
|
+
}), /*#__PURE__*/React.createElement(Path, {
|
|
18
|
+
fill: "#EA4335",
|
|
19
|
+
d: "M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
|
|
20
|
+
}));
|
|
21
|
+
export default SvgGoogle;
|
|
22
|
+
//# sourceMappingURL=Google.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Svg","Path","SvgGoogle","props","createElement","_extends","width","height","viewBox","fill","d"],"sourceRoot":"..\\..\\..\\src","sources":["icons/Google.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,GAAG,IAAIC,IAAI,QAAkB,kBAAkB;AAEtD,MAAMC,SAAS,GAAIC,KAAe,iBAChCJ,KAAA,CAAAK,aAAA,CAACJ,GAAG,EAAAK,QAAA;EAACC,KAAK,EAAE,EAAG;EAACC,MAAM,EAAE,EAAG;EAACC,OAAO,EAAC;AAAW,GAAKL,KAAK,gBACvDJ,KAAA,CAAAK,aAAA,CAACH,IAAI;EACHQ,IAAI,EAAC,SAAS;EACdC,CAAC,EAAC;AAAyH,CAC5H,CAAC,eACFX,KAAA,CAAAK,aAAA,CAACH,IAAI;EACHQ,IAAI,EAAC,SAAS;EACdC,CAAC,EAAC;AAAuI,CAC1I,CAAC,eACFX,KAAA,CAAAK,aAAA,CAACH,IAAI;EACHQ,IAAI,EAAC,SAAS;EACdC,CAAC,EAAC;AAA+H,CAClI,CAAC,eACFX,KAAA,CAAAK,aAAA,CAACH,IAAI;EACHQ,IAAI,EAAC,SAAS;EACdC,CAAC,EAAC;AAAqI,CACxI,CACE,CACN;AACD,eAAeR,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\src","sources":["index.ts"],"mappings":"AAAA,cAAc,WAAW;AACzB,cAAc,QAAQ;AACtB,cAAc,cAAc;AAC5B,cAAc,YAAY;AAC1B,cAAc,MAAM;AACpB,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["storage/index.ts"],"mappings":"AAAA,cAAc,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ref, uploadString } from '@react-native-firebase/storage';
|
|
2
|
+
export const uploadFileValue = async (storage, path, file, onUploadProgress) => {
|
|
3
|
+
if (!file) return null;
|
|
4
|
+
const {
|
|
5
|
+
dataUrl,
|
|
6
|
+
type,
|
|
7
|
+
filename
|
|
8
|
+
} = file;
|
|
9
|
+
if (!dataUrl) return file;
|
|
10
|
+
const storageRef = ref(storage, path);
|
|
11
|
+
const uploadTask = uploadString(storageRef, dataUrl, 'data_url');
|
|
12
|
+
uploadTask.on('state_changed', snapshot => {
|
|
13
|
+
const percent = snapshot.bytesTransferred / snapshot.totalBytes;
|
|
14
|
+
onUploadProgress({
|
|
15
|
+
total: snapshot.totalBytes,
|
|
16
|
+
loaded: snapshot.bytesTransferred,
|
|
17
|
+
percent
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
uploadTask.then(() => {
|
|
22
|
+
resolve({
|
|
23
|
+
storagePath: path,
|
|
24
|
+
type,
|
|
25
|
+
filename
|
|
26
|
+
});
|
|
27
|
+
}).catch(reject);
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ref","uploadString","uploadFileValue","storage","path","file","onUploadProgress","dataUrl","type","filename","storageRef","uploadTask","on","snapshot","percent","bytesTransferred","totalBytes","total","loaded","Promise","resolve","reject","then","storagePath","catch"],"sourceRoot":"..\\..\\..\\src","sources":["storage/utils.ts"],"mappings":"AACA,SAA+BA,GAAG,EAAEC,YAAY,QAAQ,gCAAgC;AAExF,OAAO,MAAMC,eAAe,GAAG,MAAAA,CAC7BC,OAAoC,EACpCC,IAAY,EACZC,IAAmD,EACnDC,gBAAkC,KACJ;EAC9B,IAAI,CAACD,IAAI,EAAE,OAAO,IAAI;EACtB,MAAM;IAAEE,OAAO;IAAEC,IAAI;IAAEC;EAAS,CAAC,GAAGJ,IAAsB;EAC1D,IAAI,CAACE,OAAO,EAAE,OAAOF,IAAI;EAEzB,MAAMK,UAAU,GAAGV,GAAG,CAACG,OAAO,EAAEC,IAAI,CAAC;EACrC,MAAMO,UAAU,GAAGV,YAAY,CAACS,UAAU,EAAEH,OAAO,EAAE,UAAU,CAAC;EAEhEI,UAAU,CAACC,EAAE,CAAC,eAAe,EAAEC,QAAQ,IAAI;IACzC,MAAMC,OAAO,GAAGD,QAAQ,CAACE,gBAAgB,GAAGF,QAAQ,CAACG,UAAU;IAC/DV,gBAAgB,CAAC;MAAEW,KAAK,EAAEJ,QAAQ,CAACG,UAAU;MAAEE,MAAM,EAAEL,QAAQ,CAACE,gBAAgB;MAAED;IAAQ,CAAC,CAAC;EAC9F,CAAC,CAAC;EAEF,OAAO,IAAIK,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;IACtCV,UAAU,CACPW,IAAI,CAAC,MAAM;MACVF,OAAO,CAAC;QAAEG,WAAW,EAAEnB,IAAI;QAAEI,IAAI;QAAEC;MAAS,CAAC,CAAC;IAChD,CAAC,CAAC,CACDe,KAAK,CAACH,MAAM,CAAC;EAClB,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["types/adapter.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["types/auth.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["types/db.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["types/functions.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["types/index.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["types/storage.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AuthAdapter, BaseAuthProvider } from '@chem-po/core';
|
|
2
|
+
import { Auth, User } from '../types/auth';
|
|
3
|
+
export declare const getFirebaseAuthAdapter: (auth: Auth, twoFactorRequired: boolean) => AuthAdapter<BaseAuthProvider, User, {
|
|
4
|
+
email: string;
|
|
5
|
+
password: string;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/adapter/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAQjB,MAAM,eAAe,CAAA;AAiBtB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAwN1C,eAAO,MAAM,sBAAsB,GACjC,MAAM,IAAI,EACV,mBAAmB,OAAO,KACzB,WAAW,CAAC,gBAAgB,EAAE,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAkCxE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DatabaseAdapter } from '@chem-po/core';
|
|
2
|
+
import { Firestore, FirestoreCursor } from '../types/db';
|
|
3
|
+
import { Functions } from '../types/functions';
|
|
4
|
+
export declare const getFirebaseDatabaseAdapter: (db: Firestore, functions: Functions) => DatabaseAdapter<FirestoreCursor>;
|
|
5
|
+
//# sourceMappingURL=db.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../../src/adapter/db.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,eAAe,EAMhB,MAAM,eAAe,CAAA;AAatB,OAAO,EAAE,SAAS,EAAsB,eAAe,EAAwB,MAAM,aAAa,CAAA;AAClG,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AA4G9C,eAAO,MAAM,0BAA0B,GACrC,IAAI,SAAS,EACb,WAAW,SAAS,KACnB,eAAe,CAAC,eAAe,CAUhC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BackendAdapter, BaseAuthProvider } from '@chem-po/core';
|
|
2
|
+
import { FirebaseStorageTypes } from '@react-native-firebase/storage';
|
|
3
|
+
import { Auth, EmailPasswordLogin, User } from '../types/auth';
|
|
4
|
+
import { Firestore, FirestoreCursor } from '../types/db';
|
|
5
|
+
import { Functions } from '../types/functions';
|
|
6
|
+
import { Storage } from '../types/storage';
|
|
7
|
+
export type FirebaseAdapter<AuthProvider extends BaseAuthProvider> = BackendAdapter<AuthProvider, User, EmailPasswordLogin, FirestoreCursor, Blob, FirebaseStorageTypes.FullMetadata>;
|
|
8
|
+
export declare const getFirebaseAdapter: <AuthProvider extends BaseAuthProvider>(auth: Auth, db: Firestore, storage: Storage, functions: Functions, twoFactorRequired: boolean) => FirebaseAdapter<AuthProvider>;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAA;AACrE,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAK1C,MAAM,MAAM,eAAe,CAAC,YAAY,SAAS,gBAAgB,IAAI,cAAc,CACjF,YAAY,EACZ,IAAI,EACJ,kBAAkB,EAClB,eAAe,EACf,IAAI,EACJ,oBAAoB,CAAC,YAAY,CAClC,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,YAAY,SAAS,gBAAgB,EACtE,MAAM,IAAI,EACV,IAAI,SAAS,EACb,SAAS,OAAO,EAChB,WAAW,SAAS,EACpB,mBAAmB,OAAO,KACzB,eAAe,CAAC,YAAY,CAI7B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/adapter/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqB,MAAM,eAAe,CAAA;AAQjE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C,eAAO,MAAM,yBAAyB,GAAI,SAAS,OAAO,KAAG,cAAc,CAAC,IAAI,EAAE,GAAG,CA+CnF,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FirebaseFunctionsTypes } from '@react-native-firebase/functions';
|
|
2
|
+
export declare const getThirdPartyAuthUrl: (functions: FirebaseFunctionsTypes.Module) => FirebaseFunctionsTypes.HttpsCallable<unknown, unknown>;
|
|
3
|
+
export declare const getThirdPartyAuthToken: (functions: FirebaseFunctionsTypes.Module) => FirebaseFunctionsTypes.HttpsCallable<unknown, unknown>;
|
|
4
|
+
//# sourceMappingURL=functions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../src/auth/functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AAEzE,eAAO,MAAM,oBAAoB,GAAI,WAAW,sBAAsB,CAAC,MAAM,2DAC5B,CAAA;AAEjD,eAAO,MAAM,sBAAsB,GAAI,WAAW,sBAAsB,CAAC,MAAM,2DAC5B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthenticatorVerify.d.ts","sourceRoot":"","sources":["../../../src/components/AuthenticatorVerify.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,mBAAmB,yBAuB/B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FirebaseSignIn.d.ts","sourceRoot":"","sources":["../../../src/components/FirebaseSignIn.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAGlD,OAAO,KAAgC,MAAM,OAAO,CAAA;AAqFpD,eAAO,MAAM,cAAc,GAAI,qBAE5B;IACD,cAAc,EAAE,kBAAkB,GAAG,IAAI,CAAA;CAC1C,sBAaA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhoneVerify.d.ts","sourceRoot":"","sources":["../../../src/components/PhoneVerify.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAGrD,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,WAAW,GAAI,YAAY;IAAE,MAAM,EAAE,qBAAqB,CAAA;CAAE,sBA+CxE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TwoFactorAuthModal.d.ts","sourceRoot":"","sources":["../../../src/components/TwoFactorAuthModal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAuEvC,eAAO,MAAM,kBAAkB,gCAqB9B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FirebaseConfig, FirebaseContextValue } from '../types';
|
|
3
|
+
export interface FirebaseProviderProps {
|
|
4
|
+
config: FirebaseConfig;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function FirebaseProvider({ config, children }: FirebaseProviderProps): React.JSX.Element;
|
|
8
|
+
export declare function useFirebase(): FirebaseContextValue;
|
|
9
|
+
//# sourceMappingURL=FirebaseContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FirebaseContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/FirebaseContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkE,MAAM,OAAO,CAAA;AACtF,OAAO,KAAK,EAEV,cAAc,EACd,oBAAoB,EAGrB,MAAM,UAAU,CAAA;AAIjB,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,cAAc,CAAA;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,qBAAqB,qBA4B3E;AAED,wBAAgB,WAAW,yBAM1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/db/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AnyObject, BaseQuery } from '@chem-po/core';
|
|
2
|
+
import { Firestore, FirestoreBaseQuery, FirestoreCursor, FirestoreQuery } from '../types/db';
|
|
3
|
+
export declare const toFirestoreQuery: <T extends AnyObject>(db: Firestore, baseQuery: FirestoreBaseQuery<T>) => FirestoreQuery<T>;
|
|
4
|
+
export declare const toCursorQuery: <T extends AnyObject>(db: Firestore, baseQuery: FirestoreBaseQuery<T>, cursor: FirestoreCursor | null) => FirestoreQuery<T>;
|
|
5
|
+
export declare const toFirestoreQueries: <T extends AnyObject>(db: Firestore, baseQuery: BaseQuery<T>, cursors: Array<FirestoreCursor | null> | null) => Array<FirestoreQuery<T>>;
|
|
6
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/db/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAA0C,MAAM,eAAe,CAAA;AAU5F,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5F,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,SAAS,EAClD,IAAI,SAAS,EACb,WAAW,kBAAkB,CAAC,CAAC,CAAC,KAC/B,cAAc,CAAC,CAAC,CAyClB,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,SAAS,EAC/C,IAAI,SAAS,EACb,WAAW,kBAAkB,CAAC,CAAC,CAAC,EAChC,QAAQ,eAAe,GAAG,IAAI,KAC7B,cAAc,CAAC,CAAC,CAiClB,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,SAAS,EACpD,IAAI,SAAS,EACb,WAAW,SAAS,CAAC,CAAC,CAAC,EACvB,SAAS,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC,GAAG,IAAI,KAC5C,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAwCzB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../../src/hooks/backend.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,mDAAyB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const useAuthenticatorVerify: () => {
|
|
2
|
+
code: string;
|
|
3
|
+
setCode: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
4
|
+
verifying: boolean;
|
|
5
|
+
error: string;
|
|
6
|
+
handleVerify: () => Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=useAuthenticatorVerify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAuthenticatorVerify.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAuthenticatorVerify.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,sBAAsB;;;;;;CAuClC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PhoneEnrollmentFactor } from '@chem-po/core';
|
|
2
|
+
export declare const usePhoneVerify: (factor: PhoneEnrollmentFactor, automaticallySendSmsCode: boolean) => {
|
|
3
|
+
code: string;
|
|
4
|
+
setCode: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
5
|
+
verifying: boolean;
|
|
6
|
+
error: string;
|
|
7
|
+
handleVerify: () => void;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=usePhoneVerify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePhoneVerify.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePhoneVerify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAKrD,eAAO,MAAM,cAAc,GAAI,QAAQ,qBAAqB,EAAE,0BAA0B,OAAO;;;;;;CAsE9F,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Google.d.ts","sourceRoot":"","sources":["../../../src/icons/Google.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAY,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEtD,QAAA,MAAM,SAAS,GAAI,OAAO,QAAQ,sBAmBjC,CAAA;AACD,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,MAAM,CAAA;AACpB,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FileValue, LocalFileValue, OnUploadProgress } from '@chem-po/core';
|
|
2
|
+
import { FirebaseStorageTypes } from '@react-native-firebase/storage';
|
|
3
|
+
export declare const uploadFileValue: (storage: FirebaseStorageTypes.Module, path: string, file: LocalFileValue | FileValue | null | undefined, onUploadProgress: OnUploadProgress) => Promise<FileValue | null>;
|
|
4
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/storage/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC3E,OAAO,EAAE,oBAAoB,EAAqB,MAAM,gCAAgC,CAAA;AAExF,eAAO,MAAM,eAAe,GAC1B,SAAS,oBAAoB,CAAC,MAAM,EACpC,MAAM,MAAM,EACZ,MAAM,cAAc,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,EACnD,kBAAkB,gBAAgB,KACjC,OAAO,CAAC,SAAS,GAAG,IAAI,CAoB1B,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BackendAdapterInterface, BaseAuthProvider } from '@chem-po/core';
|
|
2
|
+
import { FirebaseStorageTypes } from '@react-native-firebase/storage';
|
|
3
|
+
import { EmailPasswordLogin, User } from './auth';
|
|
4
|
+
import { FirestoreCursor } from './db';
|
|
5
|
+
export type FirebaseBackendAdapter<AuthProvider extends BaseAuthProvider> = BackendAdapterInterface<AuthProvider, User, EmailPasswordLogin, FirestoreCursor, Blob, FirebaseStorageTypes.FullMetadata>;
|
|
6
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/types/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAA;AACrE,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAA;AAEtC,MAAM,MAAM,sBAAsB,CAAC,YAAY,SAAS,gBAAgB,IAAI,uBAAuB,CACjG,YAAY,EACZ,IAAI,EACJ,kBAAkB,EAClB,eAAe,EACf,IAAI,EACJ,oBAAoB,CAAC,YAAY,CAClC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseUserRole } from '@chem-po/core';
|
|
2
|
+
import { getAuth } from '@react-native-firebase/auth';
|
|
3
|
+
export type Auth = ReturnType<typeof getAuth>;
|
|
4
|
+
export interface User {
|
|
5
|
+
uid: string;
|
|
6
|
+
role: BaseUserRole;
|
|
7
|
+
}
|
|
8
|
+
export interface EmailPasswordLogin {
|
|
9
|
+
email: string;
|
|
10
|
+
password: string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/types/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAErD,MAAM,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAA;AAC7C,MAAM,WAAW,IAAI;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,YAAY,CAAA;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;CACjB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AnyObject, BaseQuery, OnItemsData } from '@chem-po/core';
|
|
2
|
+
import { FirebaseFirestoreTypes } from '@react-native-firebase/firestore';
|
|
3
|
+
export type Firestore = FirebaseFirestoreTypes.Module;
|
|
4
|
+
export type FirestoreCursor = FirebaseFirestoreTypes.QueryDocumentSnapshot;
|
|
5
|
+
export type FirestoreBaseQuery<T extends AnyObject> = BaseQuery<T, FirestoreCursor>;
|
|
6
|
+
export type FirestoreQuery<T extends AnyObject> = FirebaseFirestoreTypes.Query<T>;
|
|
7
|
+
export type FirestoreOnItemsData<T extends AnyObject> = OnItemsData<T, FirestoreCursor>;
|
|
8
|
+
//# sourceMappingURL=db.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../../src/types/db.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AAEzE,MAAM,MAAM,SAAS,GAAG,sBAAsB,CAAC,MAAM,CAAA;AACrD,MAAM,MAAM,eAAe,GAAG,sBAAsB,CAAC,qBAAqB,CAAA;AAC1E,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,SAAS,IAAI,SAAS,CAAC,CAAC,EAAE,eAAe,CAAC,CAAA;AACnF,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,SAAS,IAAI,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAEjF,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,SAAS,IAAI,WAAW,CAAC,CAAC,EAAE,eAAe,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../src/types/functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAE/D,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNativeFirebase } from '@react-native-firebase/app';
|
|
2
|
+
import { FirebaseAuthTypes } from '@react-native-firebase/auth';
|
|
3
|
+
import { FirebaseFirestoreTypes } from '@react-native-firebase/firestore';
|
|
4
|
+
import { FirebaseStorageTypes } from '@react-native-firebase/storage';
|
|
5
|
+
export type FirebaseAuth = FirebaseAuthTypes.Module;
|
|
6
|
+
export type FirebaseFirestore = FirebaseFirestoreTypes.Module;
|
|
7
|
+
export type FirebaseStorage = FirebaseStorageTypes.Module;
|
|
8
|
+
export interface FirebaseConfig {
|
|
9
|
+
apiKey: string;
|
|
10
|
+
authDomain: string;
|
|
11
|
+
projectId: string;
|
|
12
|
+
storageBucket: string;
|
|
13
|
+
messagingSenderId: string;
|
|
14
|
+
appId: string;
|
|
15
|
+
measurementId?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface FirebaseContextValue {
|
|
18
|
+
loading: boolean;
|
|
19
|
+
app: ReactNativeFirebase.FirebaseApp | null;
|
|
20
|
+
auth: FirebaseAuth;
|
|
21
|
+
firestore: FirebaseFirestore;
|
|
22
|
+
storage: FirebaseStorage;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAA;AAErE,MAAM,MAAM,YAAY,GAAG,iBAAiB,CAAC,MAAM,CAAA;AACnD,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,MAAM,CAAA;AAC7D,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC,MAAM,CAAA;AAEzD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,iBAAiB,EAAE,MAAM,CAAA;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,mBAAmB,CAAC,WAAW,GAAG,IAAI,CAAA;IAC3C,IAAI,EAAE,YAAY,CAAA;IAClB,SAAS,EAAE,iBAAiB,CAAA;IAC5B,OAAO,EAAE,eAAe,CAAA;CACzB"}
|