@rownd/react-native 2.11.3 → 2.11.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.
Files changed (30) hide show
  1. package/lib/commonjs/components/RequireSignIn.js +2 -2
  2. package/lib/commonjs/components/RequireSignIn.js.map +1 -1
  3. package/lib/commonjs/hooks/rownd.js +1 -1
  4. package/lib/commonjs/hooks/rownd.js.map +1 -1
  5. package/lib/commonjs/reducer/rowndReducer.js +2 -2
  6. package/lib/commonjs/reducer/rowndReducer.js.map +1 -1
  7. package/lib/module/components/RequireSignIn.js +1 -1
  8. package/lib/module/components/RequireSignIn.js.map +1 -1
  9. package/lib/module/hooks/rownd.js +1 -1
  10. package/lib/module/hooks/rownd.js.map +1 -1
  11. package/lib/module/reducer/rowndReducer.js +2 -2
  12. package/lib/module/reducer/rowndReducer.js.map +1 -1
  13. package/lib/typescript/{src/components → components}/RequireSignIn.d.ts +3 -3
  14. package/package.json +1 -1
  15. package/src/components/RequireSignIn.tsx +4 -4
  16. package/src/hooks/rownd.ts +1 -1
  17. package/src/reducer/rowndReducer.ts +1 -1
  18. package/lib/typescript/example_expo/src/App.d.ts +0 -1
  19. /package/lib/typescript/{src/components → components}/GlobalContext.d.ts +0 -0
  20. /package/lib/typescript/{src/components → components}/GlobalContext.types.d.ts +0 -0
  21. /package/lib/typescript/{src/components → components}/GlobalContext.web.d.ts +0 -0
  22. /package/lib/typescript/{src/components → components}/SignedIn.d.ts +0 -0
  23. /package/lib/typescript/{src/components → components}/SignedOut.d.ts +0 -0
  24. /package/lib/typescript/{src/constants → constants}/action.d.ts +0 -0
  25. /package/lib/typescript/{src/hooks → hooks}/rownd.d.ts +0 -0
  26. /package/lib/typescript/{src/hooks → hooks}/rownd.web.d.ts +0 -0
  27. /package/lib/typescript/{src/index.d.ts → index.d.ts} +0 -0
  28. /package/lib/typescript/{src/reducer → reducer}/rowndReducer.d.ts +0 -0
  29. /package/lib/typescript/{src/utils → utils}/config.d.ts +0 -0
  30. /package/lib/typescript/{src/utils → utils}/nativeModule.d.ts +0 -0
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
- var _ = require("..");
8
+ var _rownd = require("../hooks/rownd");
9
9
  var _reactNative = require("react-native");
10
10
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
11
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -19,7 +19,7 @@ const RequireSignIn = _ref => {
19
19
  is_authenticated,
20
20
  is_initializing,
21
21
  requestSignIn
22
- } = (0, _.useRownd)();
22
+ } = (0, _rownd.useRownd)();
23
23
  (0, _react.useEffect)(() => {
24
24
  if (!is_authenticated && !is_initializing) {
25
25
  requestSignIn({
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_","_reactNative","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","RequireSignIn","_ref","children","initializing","signInProps","is_authenticated","is_initializing","requestSignIn","useRownd","useEffect","Platform","OS","prevent_closing","undefined","createElement","Fragment","_default","exports"],"sources":["RequireSignIn.tsx"],"sourcesContent":["import React, { FunctionComponent, useEffect } from 'react';\nimport { useRownd } from '..';\nimport type { RequestSignIn } from 'src/hooks/rownd';\nimport { Platform } from 'react-native';\n\nexport type ContextProps = {\n children?: React.ReactNode;\n initializing?: React.ReactNode;\n signInProps?: RequestSignIn;\n};\n\nconst RequireSignIn: FunctionComponent<ContextProps> = ({\n children,\n initializing,\n signInProps,\n}) => {\n const { is_authenticated, is_initializing, requestSignIn } = useRownd();\n\n useEffect(() => {\n if (!is_authenticated && !is_initializing) {\n requestSignIn({\n ...(Platform.OS === 'web' ? { prevent_closing: true } : undefined),\n ...signInProps,\n });\n }\n }, [is_authenticated, is_initializing, signInProps]);\n\n if (is_initializing && initializing) {\n return <>{initializing}</>;\n }\n\n return <>{children}</>;\n};\n\nexport default RequireSignIn;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,CAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AAAwC,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAA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AAC,OAAA,CAAAhC,OAAA,GAEae,aAAa"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_rownd","_reactNative","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","RequireSignIn","_ref","children","initializing","signInProps","is_authenticated","is_initializing","requestSignIn","useRownd","useEffect","Platform","OS","prevent_closing","undefined","createElement","Fragment","_default","exports"],"sources":["RequireSignIn.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { useRownd } from '../hooks/rownd';\nimport type { RequestSignIn } from '../hooks/rownd';\nimport { Platform } from 'react-native';\n\nexport type ContextProps = {\n children?: React.ReactNode;\n initializing?: React.ReactNode;\n signInProps?: RequestSignIn;\n};\n\nconst RequireSignIn: React.FC<ContextProps> = ({\n children,\n initializing,\n signInProps,\n}) => {\n const { is_authenticated, is_initializing, requestSignIn } = useRownd();\n\n useEffect(() => {\n if (!is_authenticated && !is_initializing) {\n requestSignIn({\n ...(Platform.OS === 'web' ? { prevent_closing: true } : undefined),\n ...signInProps,\n });\n }\n }, [is_authenticated, is_initializing, signInProps]);\n\n if (is_initializing && initializing) {\n return <>{initializing}</>;\n }\n\n return <>{children}</>;\n};\n\nexport default RequireSignIn;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AAAwC,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eA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ACL,CAAC,CAAC;IACJ;EACF,CAAC,EAAE,CAACC,gBAAgB,EAAEC,eAAe,EAAEF,WAAW,CAAC,CAAC;EAEpD,IAAIE,eAAe,IAAIH,YAAY,EAAE;IACnC,oBAAO7B,MAAA,CAAAW,OAAA,CAAA6B,aAAA,CAAAxC,MAAA,CAAAW,OAAA,CAAA8B,QAAA,QAAGZ,YAAe,CAAC;EAC5B;EAEA,oBAAO7B,MAAA,CAAAW,OAAA,CAAA6B,aAAA,CAAAxC,MAAA,CAAAW,OAAA,CAAA8B,QAAA,QAAGb,QAAW,CAAC;AACxB,CAAC;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAAhC,OAAA,GAEae,aAAa"}
@@ -18,7 +18,7 @@ function useRownd() {
18
18
  getIdToken: _nativeModule.getFirebaseIdToken
19
19
  },
20
20
  is_authenticated: !!state.auth.access_token,
21
- is_initializing: !!state.auth.app_id,
21
+ is_initializing: !state.auth.app_id,
22
22
  manageAccount: _nativeModule.manageAccount,
23
23
  requestSignIn: _nativeModule.requestSignIn,
24
24
  signOut: _nativeModule.signOut,
@@ -1 +1 @@
1
- {"version":3,"names":["_nativeModule","require","_GlobalContext","useRownd","state","useRowndContext","access_token","auth","getAccessToken","firebase","getIdToken","getFirebaseIdToken","is_authenticated","is_initializing","app_id","manageAccount","requestSignIn","signOut","user","data","setValue","setUserDataValue","set","setUserData"],"sources":["rownd.ts"],"sourcesContent":["import {\n requestSignIn,\n signOut,\n manageAccount,\n getAccessToken,\n getFirebaseIdToken,\n setUserDataValue,\n setUserData,\n} from '../utils/nativeModule';\nimport { useRowndContext } from '../components/GlobalContext';\n\nexport type TRowndContext = {\n access_token: string | null;\n auth: AuthContext;\n is_authenticated: boolean;\n is_initializing: boolean;\n firebase: {\n getIdToken: () => Promise<string>;\n }\n getAccessToken: (token?: string) => Promise<string>;\n manageAccount: () => void;\n requestSignIn: (e?: RequestSignIn) => void;\n signOut: () => void;\n user: UserContext;\n};\n\ntype UserContext = {\n data: {\n id?: string;\n email?: string | null;\n phone?: string | null;\n [key: string]: any;\n };\n set: (data: Record<string, any>) => void;\n setValue: (key: string, value: any) => void;\n};\n\ntype AuthContext = {\n access_token: string | null;\n app_id: string | null;\n is_verified_user?: boolean;\n};\n\nexport type RequestSignInMethods = 'google' | 'apple' | 'default' | 'guest' | 'passkey';\nexport type RequestSignInIntent = 'sign_in' | 'sign_up';\nexport type RequestSignIn = {method?: RequestSignInMethods, postSignInRedirect?: string, intent?: RequestSignInIntent}\n\nexport function useRownd(): TRowndContext {\n const { state } = useRowndContext();\n\n return {\n access_token: state.auth.access_token,\n auth: state.auth,\n getAccessToken,\n firebase: {\n getIdToken: getFirebaseIdToken,\n },\n is_authenticated: !!state.auth.access_token,\n is_initializing: !!state.auth.app_id,\n manageAccount,\n requestSignIn,\n signOut,\n user: {\n data: state.user.data,\n setValue: setUserDataValue,\n set: setUserData,\n }, \n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AASA,IAAAC,cAAA,GAAAD,OAAA;AAsCO,SAASE,QAAQA,CAAA,EAAkB;EACxC,MAAM;IAAEC;EAAM,CAAC,GAAG,IAAAC,8BAAe,EAAC,CAAC;EAEnC,OAAO;IACLC,YAAY,EAAEF,KAAK,CAACG,IAAI,CAACD,YAAY;IACrCC,IAAI,EAAEH,KAAK,CAACG,IAAI;IAChBC,cAAc,EAAdA,4BAAc;IACdC,QAAQ,EAAE;MACRC,UAAU,EAAEC;IACd,CAAC;IACDC,gBAAgB,EAAE,CAAC,CAACR,KAAK,CAACG,IAAI,CAACD,YAAY;IAC3CO,eAAe,EAAE,CAAC,CAACT,KAAK,CAACG,IAAI,CAACO,MAAM;IACpCC,aAAa,EAAbA,2BAAa;IACbC,aAAa,EAAbA,2BAAa;IACbC,OAAO,EAAPA,qBAAO;IACPC,IAAI,EAAE;MACJC,IAAI,EAAEf,KAAK,CAACc,IAAI,CAACC,IAAI;MACrBC,QAAQ,EAAEC,8BAAgB;MAC1BC,GAAG,EAAEC;IACP;EACF,CAAC;AACH"}
1
+ {"version":3,"names":["_nativeModule","require","_GlobalContext","useRownd","state","useRowndContext","access_token","auth","getAccessToken","firebase","getIdToken","getFirebaseIdToken","is_authenticated","is_initializing","app_id","manageAccount","requestSignIn","signOut","user","data","setValue","setUserDataValue","set","setUserData"],"sources":["rownd.ts"],"sourcesContent":["import {\n requestSignIn,\n signOut,\n manageAccount,\n getAccessToken,\n getFirebaseIdToken,\n setUserDataValue,\n setUserData,\n} from '../utils/nativeModule';\nimport { useRowndContext } from '../components/GlobalContext';\n\nexport type TRowndContext = {\n access_token: string | null;\n auth: AuthContext;\n is_authenticated: boolean;\n is_initializing: boolean;\n firebase: {\n getIdToken: () => Promise<string>;\n }\n getAccessToken: (token?: string) => Promise<string>;\n manageAccount: () => void;\n requestSignIn: (e?: RequestSignIn) => void;\n signOut: () => void;\n user: UserContext;\n};\n\ntype UserContext = {\n data: {\n id?: string;\n email?: string | null;\n phone?: string | null;\n [key: string]: any;\n };\n set: (data: Record<string, any>) => void;\n setValue: (key: string, value: any) => void;\n};\n\ntype AuthContext = {\n access_token: string | null;\n app_id: string | null;\n is_verified_user?: boolean;\n};\n\nexport type RequestSignInMethods = 'google' | 'apple' | 'default' | 'guest' | 'passkey';\nexport type RequestSignInIntent = 'sign_in' | 'sign_up';\nexport type RequestSignIn = {method?: RequestSignInMethods, postSignInRedirect?: string, intent?: RequestSignInIntent}\n\nexport function useRownd(): TRowndContext {\n const { state } = useRowndContext();\n\n return {\n access_token: state.auth.access_token,\n auth: state.auth,\n getAccessToken,\n firebase: {\n getIdToken: getFirebaseIdToken,\n },\n is_authenticated: !!state.auth.access_token,\n is_initializing: !state.auth.app_id,\n manageAccount,\n requestSignIn,\n signOut,\n user: {\n data: state.user.data,\n setValue: setUserDataValue,\n set: setUserData,\n }, \n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AASA,IAAAC,cAAA,GAAAD,OAAA;AAsCO,SAASE,QAAQA,CAAA,EAAkB;EACxC,MAAM;IAAEC;EAAM,CAAC,GAAG,IAAAC,8BAAe,EAAC,CAAC;EAEnC,OAAO;IACLC,YAAY,EAAEF,KAAK,CAACG,IAAI,CAACD,YAAY;IACrCC,IAAI,EAAEH,KAAK,CAACG,IAAI;IAChBC,cAAc,EAAdA,4BAAc;IACdC,QAAQ,EAAE;MACRC,UAAU,EAAEC;IACd,CAAC;IACDC,gBAAgB,EAAE,CAAC,CAACR,KAAK,CAACG,IAAI,CAACD,YAAY;IAC3CO,eAAe,EAAE,CAACT,KAAK,CAACG,IAAI,CAACO,MAAM;IACnCC,aAAa,EAAbA,2BAAa;IACbC,aAAa,EAAbA,2BAAa;IACbC,OAAO,EAAPA,qBAAO;IACPC,IAAI,EAAE;MACJC,IAAI,EAAEf,KAAK,CAACc,IAAI,CAACC,IAAI;MACrBC,QAAQ,EAAEC,8BAAgB;MAC1BC,GAAG,EAAEC;IACP;EACF,CAAC;AACH"}
@@ -29,7 +29,7 @@ const initialRowndState = exports.initialRowndState = {
29
29
  };
30
30
 
31
31
  function rowndReducer(state, action) {
32
- var _action$payload, _action$payload2, _action$payload3, _action$payload4, _action$payload$appCo;
32
+ var _action$payload, _action$payload2, _action$payload3, _action$payload4, _action$payload5, _action$payload$appCo;
33
33
  let newState;
34
34
  switch (action.type) {
35
35
  case _action.ActionType.UPDATE_STATE:
@@ -45,7 +45,7 @@ function rowndReducer(state, action) {
45
45
  auth: {
46
46
  access_token: (_action$payload3 = action.payload) === null || _action$payload3 === void 0 || (_action$payload3 = _action$payload3.auth) === null || _action$payload3 === void 0 ? void 0 : _action$payload3.access_token,
47
47
  refresh_token: (_action$payload4 = action.payload) === null || _action$payload4 === void 0 || (_action$payload4 = _action$payload4.auth) === null || _action$payload4 === void 0 ? void 0 : _action$payload4.refresh_token,
48
- app_id: null
48
+ app_id: ((_action$payload5 = action.payload) === null || _action$payload5 === void 0 || (_action$payload5 = _action$payload5.appConfig) === null || _action$payload5 === void 0 ? void 0 : _action$payload5.id) || null
49
49
  },
50
50
  app: {
51
51
  schema: (_action$payload$appCo = action.payload.appConfig) === null || _action$payload$appCo === void 0 ? void 0 : _action$payload$appCo.schema,
@@ -1 +1 @@
1
- {"version":3,"names":["_action","require","initialRowndState","exports","user","data","email","auth","access_token","refresh_token","app_id","app","schema","config","rowndReducer","state","action","_action$payload","_action$payload2","_action$payload3","_action$payload4","_action$payload$appCo","newState","type","ActionType","UPDATE_STATE","payload","appConfig"],"sources":["rowndReducer.ts"],"sourcesContent":["import type { GlobalState } from '../components/GlobalContext.types';\nimport { ActionType, TAction } from '../constants/action';\n\nexport const initialRowndState: GlobalState = {\n // is_initializing: false,\n user: {\n data: {\n email: null,\n },\n // meta: {}\n },\n auth: {\n access_token: null,\n refresh_token: null,\n app_id: null,\n },\n app: {\n schema: null,\n config: null,\n },\n // is_saving_user_data: false,\n // config,\n};\n\nexport function rowndReducer(state: GlobalState, action: TAction): GlobalState {\n let newState: GlobalState;\n\n switch (action.type) {\n case ActionType.UPDATE_STATE:\n newState = {\n user: {\n data: {\n ...action.payload?.user?.data,\n email: action.payload?.user?.data?.email,\n },\n // meta: {}\n },\n auth: {\n access_token: action.payload?.auth?.access_token,\n refresh_token: action.payload?.auth?.refresh_token,\n app_id: null,\n },\n app: {\n schema: action.payload.appConfig?.schema,\n config: null,\n },\n // is_saving_user_data: false,\n // config\n };\n return newState;\n default:\n newState = state;\n return newState;\n }\n}\n"],"mappings":";;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAEO,MAAMC,iBAA8B,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAC5C;EACAE,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,KAAK,EAAE;IACT;IACA;EACF,CAAC;;EACDC,IAAI,EAAE;IACJC,YAAY,EAAE,IAAI;IAClBC,aAAa,EAAE,IAAI;IACnBC,MAAM,EAAE;EACV,CAAC;EACDC,GAAG,EAAE;IACHC,MAAM,EAAE,IAAI;IACZC,MAAM,E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QAAQ;IACjB;MACEA,QAAQ,GAAGP,KAAK;MAChB,OAAOO,QAAQ;EACnB;AACF"}
1
+ {"version":3,"names":["_action","require","initialRowndState","exports","user","data","email","auth","access_token","refresh_token","app_id","app","schema","config","rowndReducer","state","action","_action$payload","_action$payload2","_action$payload3","_action$payload4","_action$payload5","_action$payload$appCo","newState","type","ActionType","UPDATE_STATE","payload","appConfig","id"],"sources":["rowndReducer.ts"],"sourcesContent":["import type { GlobalState } from '../components/GlobalContext.types';\nimport { ActionType, TAction } from '../constants/action';\n\nexport const initialRowndState: GlobalState = {\n // is_initializing: false,\n user: {\n data: {\n email: null,\n },\n // meta: {}\n },\n auth: {\n access_token: null,\n refresh_token: null,\n app_id: null,\n },\n app: {\n schema: null,\n config: null,\n },\n // is_saving_user_data: false,\n // config,\n};\n\nexport function rowndReducer(state: GlobalState, action: TAction): GlobalState {\n let newState: GlobalState;\n\n switch (action.type) {\n case ActionType.UPDATE_STATE:\n newState = {\n user: {\n data: {\n ...action.payload?.user?.data,\n email: action.payload?.user?.data?.email,\n },\n // meta: {}\n },\n auth: {\n access_token: action.payload?.auth?.access_token,\n refresh_token: action.payload?.auth?.refresh_token,\n app_id: action.payload?.appConfig?.id || null,\n },\n app: {\n schema: action.payload.appConfig?.schema,\n config: null,\n },\n // is_saving_user_data: false,\n // config\n };\n return newState;\n default:\n newState = state;\n return newState;\n }\n}\n"],"mappings":";;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAEO,MAAMC,iBAA8B,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAC5C;EACAE,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,KAAK,EAAE;IACT;IACA;EACF,CAAC;;EACDC,IAAI,EAAE;IACJC,YAAY,EAAE,IAAI;IAClBC,aAAa,EAAE,IAAI;IACnBC,MAAM,EAAE;EACV,CAAC;EACDC,GAAG,EAAE;IACHC,MAAM,EAAE,IAAI;IACZC,MAAM,EAAE;EACV;EACA;EACA;AACF,CAAC;;A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AEN,MAAM,CAACW,OAAO,CAACC,SAAS,cAAAN,qBAAA,uBAAxBA,qBAAA,CAA0BV,MAAM;UACxCC,MAAM,EAAE;QACV;QACA;QACA;MACF,CAAC;;MACD,OAAOU,QAAQ;IACjB;MACEA,QAAQ,GAAGR,KAAK;MAChB,OAAOQ,QAAQ;EACnB;AACF"}
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect } from 'react';
2
- import { useRownd } from '..';
2
+ import { useRownd } from '../hooks/rownd';
3
3
  import { Platform } from 'react-native';
4
4
  const RequireSignIn = _ref => {
5
5
  let {
@@ -1 +1 @@
1
- {"version":3,"names":["React","useEffect","useRownd","Platform","RequireSignIn","_ref","children","initializing","signInProps","is_authenticated","is_initializing","requestSignIn","OS","prevent_closing","undefined","createElement","Fragment"],"sources":["RequireSignIn.tsx"],"sourcesContent":["import React, { FunctionComponent, useEffect } from 'react';\nimport { useRownd } from '..';\nimport type { RequestSignIn } from 'src/hooks/rownd';\nimport { Platform } from 'react-native';\n\nexport type ContextProps = {\n children?: React.ReactNode;\n initializing?: React.ReactNode;\n signInProps?: RequestSignIn;\n};\n\nconst RequireSignIn: FunctionComponent<ContextProps> = ({\n children,\n initializing,\n signInProps,\n}) => {\n const { is_authenticated, is_initializing, requestSignIn } = useRownd();\n\n useEffect(() => {\n if (!is_authenticated && !is_initializing) {\n requestSignIn({\n ...(Platform.OS === 'web' ? { prevent_closing: true } : undefined),\n ...signInProps,\n });\n }\n }, [is_authenticated, is_initializing, signInProps]);\n\n if (is_initializing && initializing) {\n return <>{initializing}</>;\n }\n\n return <>{children}</>;\n};\n\nexport default RequireSignIn;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAuBC,SAAS,QAAQ,OAAO;AAC3D,SAASC,QAAQ,QAAQ,IAAI;AAE7B,SAASC,QAAQ,QAAQ,cAAc;AAQvC,MAAMC,aAA8C,GAAGC,IAAA,IAIjD;EAAA,IAJkD;IACtDC,QAAQ;IACRC,YAAY;IACZC;EACF,CAAC,GAAAH,IAAA;EACC,MAAM;IAAEI,gBAAgB;IAAEC,eAAe;IAAEC;EAAc,CAAC,GAAGT,QAAQ,CAAC,CAAC;EAEvED,SAAS,CAAC,MAAM;IACd,IAAI,CAACQ,gBAAgB,IAAI,CAACC,eAAe,EAAE;MACzCC,aAAa,CAAC;QACZ,IAAIR,QAAQ,CAACS,EAAE,KAAK,KAAK,GAAG;UAAEC,eAAe,EAAE;QAAK,CAAC,GAAGC,SAAS,CAAC;QAClE,GAAGN;MACL,CAAC,CAAC;IACJ;EACF,CAAC,EAAE,CAACC,gBAAgB,EAAEC,eAAe,EAAEF,WAAW,CAAC,CAAC;EAEpD,IAAIE,eAAe,IAAIH,YAAY,EAAE;IACnC,oBAAOP,KAAA,CAAAe,aAAA,CAAAf,KAAA,CAAAgB,QAAA,QAAGT,YAAe,CAAC;EAC5B;EAEA,oBAAOP,KAAA,CAAAe,aAAA,CAAAf,KAAA,CAAAgB,QAAA,QAAGV,QAAW,CAAC;AACxB,CAAC;AAED,eAAeF,aAAa"}
1
+ {"version":3,"names":["React","useEffect","useRownd","Platform","RequireSignIn","_ref","children","initializing","signInProps","is_authenticated","is_initializing","requestSignIn","OS","prevent_closing","undefined","createElement","Fragment"],"sources":["RequireSignIn.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { useRownd } from '../hooks/rownd';\nimport type { RequestSignIn } from '../hooks/rownd';\nimport { Platform } from 'react-native';\n\nexport type ContextProps = {\n children?: React.ReactNode;\n initializing?: React.ReactNode;\n signInProps?: RequestSignIn;\n};\n\nconst RequireSignIn: React.FC<ContextProps> = ({\n children,\n initializing,\n signInProps,\n}) => {\n const { is_authenticated, is_initializing, requestSignIn } = useRownd();\n\n useEffect(() => {\n if (!is_authenticated && !is_initializing) {\n requestSignIn({\n ...(Platform.OS === 'web' ? { prevent_closing: true } : undefined),\n ...signInProps,\n });\n }\n }, [is_authenticated, is_initializing, signInProps]);\n\n if (is_initializing && initializing) {\n return <>{initializing}</>;\n }\n\n return <>{children}</>;\n};\n\nexport default RequireSignIn;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,QAAQ,QAAQ,gBAAgB;AAEzC,SAASC,QAAQ,QAAQ,cAAc;AAQvC,MAAMC,aAAqC,GAAGC,IAAA,IAIxC;EAAA,IAJyC;IAC7CC,QAAQ;IACRC,YAAY;IACZC;EACF,CAAC,GAAAH,IAAA;EACC,MAAM;IAAEI,gBAAgB;IAAEC,eAAe;IAAEC;EAAc,CAAC,GAAGT,QAAQ,CAAC,CAAC;EAEvED,SAAS,CAAC,MAAM;IACd,IAAI,CAACQ,gBAAgB,IAAI,CAACC,eAAe,EAAE;MACzCC,aAAa,CAAC;QACZ,IAAIR,QAAQ,CAACS,EAAE,KAAK,KAAK,GAAG;UAAEC,eAAe,EAAE;QAAK,CAAC,GAAGC,SAAS,CAAC;QAClE,GAAGN;MACL,CAAC,CAAC;IACJ;EACF,CAAC,EAAE,CAACC,gBAAgB,EAAEC,eAAe,EAAEF,WAAW,CAAC,CAAC;EAEpD,IAAIE,eAAe,IAAIH,YAAY,EAAE;IACnC,oBAAOP,KAAA,CAAAe,aAAA,CAAAf,KAAA,CAAAgB,QAAA,QAAGT,YAAe,CAAC;EAC5B;EAEA,oBAAOP,KAAA,CAAAe,aAAA,CAAAf,KAAA,CAAAgB,QAAA,QAAGV,QAAW,CAAC;AACxB,CAAC;AAED,eAAeF,aAAa"}
@@ -12,7 +12,7 @@ export function useRownd() {
12
12
  getIdToken: getFirebaseIdToken
13
13
  },
14
14
  is_authenticated: !!state.auth.access_token,
15
- is_initializing: !!state.auth.app_id,
15
+ is_initializing: !state.auth.app_id,
16
16
  manageAccount,
17
17
  requestSignIn,
18
18
  signOut,
@@ -1 +1 @@
1
- {"version":3,"names":["requestSignIn","signOut","manageAccount","getAccessToken","getFirebaseIdToken","setUserDataValue","setUserData","useRowndContext","useRownd","state","access_token","auth","firebase","getIdToken","is_authenticated","is_initializing","app_id","user","data","setValue","set"],"sources":["rownd.ts"],"sourcesContent":["import {\n requestSignIn,\n signOut,\n manageAccount,\n getAccessToken,\n getFirebaseIdToken,\n setUserDataValue,\n setUserData,\n} from '../utils/nativeModule';\nimport { useRowndContext } from '../components/GlobalContext';\n\nexport type TRowndContext = {\n access_token: string | null;\n auth: AuthContext;\n is_authenticated: boolean;\n is_initializing: boolean;\n firebase: {\n getIdToken: () => Promise<string>;\n }\n getAccessToken: (token?: string) => Promise<string>;\n manageAccount: () => void;\n requestSignIn: (e?: RequestSignIn) => void;\n signOut: () => void;\n user: UserContext;\n};\n\ntype UserContext = {\n data: {\n id?: string;\n email?: string | null;\n phone?: string | null;\n [key: string]: any;\n };\n set: (data: Record<string, any>) => void;\n setValue: (key: string, value: any) => void;\n};\n\ntype AuthContext = {\n access_token: string | null;\n app_id: string | null;\n is_verified_user?: boolean;\n};\n\nexport type RequestSignInMethods = 'google' | 'apple' | 'default' | 'guest' | 'passkey';\nexport type RequestSignInIntent = 'sign_in' | 'sign_up';\nexport type RequestSignIn = {method?: RequestSignInMethods, postSignInRedirect?: string, intent?: RequestSignInIntent}\n\nexport function useRownd(): TRowndContext {\n const { state } = useRowndContext();\n\n return {\n access_token: state.auth.access_token,\n auth: state.auth,\n getAccessToken,\n firebase: {\n getIdToken: getFirebaseIdToken,\n },\n is_authenticated: !!state.auth.access_token,\n is_initializing: !!state.auth.app_id,\n manageAccount,\n requestSignIn,\n signOut,\n user: {\n data: state.user.data,\n setValue: setUserDataValue,\n set: setUserData,\n }, \n };\n}\n"],"mappings":"AAAA,SACEA,aAAa,EACbC,OAAO,EACPC,aAAa,EACbC,cAAc,EACdC,kBAAkB,EAClBC,gBAAgB,EAChBC,WAAW,QACN,uBAAuB;AAC9B,SAASC,eAAe,QAAQ,6BAA6B;AAsC7D,OAAO,SAASC,QAAQA,CAAA,EAAkB;EACxC,MAAM;IAAEC;EAAM,CAAC,GAAGF,eAAe,CAAC,CAAC;EAEnC,OAAO;IACLG,YAAY,EAAED,KAAK,CAACE,IAAI,CAACD,YAAY;IACrCC,IAAI,EAAEF,KAAK,CAACE,IAAI;IAChBR,cAAc;IACdS,QAAQ,EAAE;MACRC,UAAU,EAAET;IACd,CAAC;IACDU,gBAAgB,EAAE,CAAC,CAACL,KAAK,CAACE,IAAI,CAACD,YAAY;IAC3CK,eAAe,EAAE,CAAC,CAACN,KAAK,CAACE,IAAI,CAACK,MAAM;IACpCd,aAAa;IACbF,aAAa;IACbC,OAAO;IACPgB,IAAI,EAAE;MACJC,IAAI,EAAET,KAAK,CAACQ,IAAI,CAACC,IAAI;MACrBC,QAAQ,EAAEd,gBAAgB;MAC1Be,GAAG,EAAEd;IACP;EACF,CAAC;AACH"}
1
+ {"version":3,"names":["requestSignIn","signOut","manageAccount","getAccessToken","getFirebaseIdToken","setUserDataValue","setUserData","useRowndContext","useRownd","state","access_token","auth","firebase","getIdToken","is_authenticated","is_initializing","app_id","user","data","setValue","set"],"sources":["rownd.ts"],"sourcesContent":["import {\n requestSignIn,\n signOut,\n manageAccount,\n getAccessToken,\n getFirebaseIdToken,\n setUserDataValue,\n setUserData,\n} from '../utils/nativeModule';\nimport { useRowndContext } from '../components/GlobalContext';\n\nexport type TRowndContext = {\n access_token: string | null;\n auth: AuthContext;\n is_authenticated: boolean;\n is_initializing: boolean;\n firebase: {\n getIdToken: () => Promise<string>;\n }\n getAccessToken: (token?: string) => Promise<string>;\n manageAccount: () => void;\n requestSignIn: (e?: RequestSignIn) => void;\n signOut: () => void;\n user: UserContext;\n};\n\ntype UserContext = {\n data: {\n id?: string;\n email?: string | null;\n phone?: string | null;\n [key: string]: any;\n };\n set: (data: Record<string, any>) => void;\n setValue: (key: string, value: any) => void;\n};\n\ntype AuthContext = {\n access_token: string | null;\n app_id: string | null;\n is_verified_user?: boolean;\n};\n\nexport type RequestSignInMethods = 'google' | 'apple' | 'default' | 'guest' | 'passkey';\nexport type RequestSignInIntent = 'sign_in' | 'sign_up';\nexport type RequestSignIn = {method?: RequestSignInMethods, postSignInRedirect?: string, intent?: RequestSignInIntent}\n\nexport function useRownd(): TRowndContext {\n const { state } = useRowndContext();\n\n return {\n access_token: state.auth.access_token,\n auth: state.auth,\n getAccessToken,\n firebase: {\n getIdToken: getFirebaseIdToken,\n },\n is_authenticated: !!state.auth.access_token,\n is_initializing: !state.auth.app_id,\n manageAccount,\n requestSignIn,\n signOut,\n user: {\n data: state.user.data,\n setValue: setUserDataValue,\n set: setUserData,\n }, \n };\n}\n"],"mappings":"AAAA,SACEA,aAAa,EACbC,OAAO,EACPC,aAAa,EACbC,cAAc,EACdC,kBAAkB,EAClBC,gBAAgB,EAChBC,WAAW,QACN,uBAAuB;AAC9B,SAASC,eAAe,QAAQ,6BAA6B;AAsC7D,OAAO,SAASC,QAAQA,CAAA,EAAkB;EACxC,MAAM;IAAEC;EAAM,CAAC,GAAGF,eAAe,CAAC,CAAC;EAEnC,OAAO;IACLG,YAAY,EAAED,KAAK,CAACE,IAAI,CAACD,YAAY;IACrCC,IAAI,EAAEF,KAAK,CAACE,IAAI;IAChBR,cAAc;IACdS,QAAQ,EAAE;MACRC,UAAU,EAAET;IACd,CAAC;IACDU,gBAAgB,EAAE,CAAC,CAACL,KAAK,CAACE,IAAI,CAACD,YAAY;IAC3CK,eAAe,EAAE,CAACN,KAAK,CAACE,IAAI,CAACK,MAAM;IACnCd,aAAa;IACbF,aAAa;IACbC,OAAO;IACPgB,IAAI,EAAE;MACJC,IAAI,EAAET,KAAK,CAACQ,IAAI,CAACC,IAAI;MACrBC,QAAQ,EAAEd,gBAAgB;MAC1Be,GAAG,EAAEd;IACP;EACF,CAAC;AACH"}
@@ -22,7 +22,7 @@ export const initialRowndState = {
22
22
  };
23
23
 
24
24
  export function rowndReducer(state, action) {
25
- var _action$payload, _action$payload2, _action$payload3, _action$payload4, _action$payload$appCo;
25
+ var _action$payload, _action$payload2, _action$payload3, _action$payload4, _action$payload5, _action$payload$appCo;
26
26
  let newState;
27
27
  switch (action.type) {
28
28
  case ActionType.UPDATE_STATE:
@@ -38,7 +38,7 @@ export function rowndReducer(state, action) {
38
38
  auth: {
39
39
  access_token: (_action$payload3 = action.payload) === null || _action$payload3 === void 0 || (_action$payload3 = _action$payload3.auth) === null || _action$payload3 === void 0 ? void 0 : _action$payload3.access_token,
40
40
  refresh_token: (_action$payload4 = action.payload) === null || _action$payload4 === void 0 || (_action$payload4 = _action$payload4.auth) === null || _action$payload4 === void 0 ? void 0 : _action$payload4.refresh_token,
41
- app_id: null
41
+ app_id: ((_action$payload5 = action.payload) === null || _action$payload5 === void 0 || (_action$payload5 = _action$payload5.appConfig) === null || _action$payload5 === void 0 ? void 0 : _action$payload5.id) || null
42
42
  },
43
43
  app: {
44
44
  schema: (_action$payload$appCo = action.payload.appConfig) === null || _action$payload$appCo === void 0 ? void 0 : _action$payload$appCo.schema,
@@ -1 +1 @@
1
- {"version":3,"names":["ActionType","initialRowndState","user","data","email","auth","access_token","refresh_token","app_id","app","schema","config","rowndReducer","state","action","_action$payload","_action$payload2","_action$payload3","_action$payload4","_action$payload$appCo","newState","type","UPDATE_STATE","payload","appConfig"],"sources":["rowndReducer.ts"],"sourcesContent":["import type { GlobalState } from '../components/GlobalContext.types';\nimport { ActionType, TAction } from '../constants/action';\n\nexport const initialRowndState: GlobalState = {\n // is_initializing: false,\n user: {\n data: {\n email: null,\n },\n // meta: {}\n },\n auth: {\n access_token: null,\n refresh_token: null,\n app_id: null,\n },\n app: {\n schema: null,\n config: null,\n },\n // is_saving_user_data: false,\n // config,\n};\n\nexport function rowndReducer(state: GlobalState, action: TAction): GlobalState {\n let newState: GlobalState;\n\n switch (action.type) {\n case ActionType.UPDATE_STATE:\n newState = {\n user: {\n data: {\n ...action.payload?.user?.data,\n email: action.payload?.user?.data?.email,\n },\n // meta: {}\n },\n auth: {\n access_token: action.payload?.auth?.access_token,\n refresh_token: action.payload?.auth?.refresh_token,\n app_id: null,\n },\n app: {\n schema: action.payload.appConfig?.schema,\n config: null,\n },\n // is_saving_user_data: false,\n //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,GAAAW,gBAAA,GAAEJ,MAAM,CAACS,OAAO,cAAAL,gBAAA,gBAAAA,gBAAA,GAAdA,gBAAA,CAAgBb,IAAI,cAAAa,gBAAA,uBAApBA,gBAAA,CAAsBX,aAAa;UAClDC,MAAM,EAAE;QACV,CAAC;QACDC,GAAG,EAAE;UACHC,MAAM,GAAAS,qBAAA,GAAEL,MAAM,CAACS,OAAO,CAACC,SAAS,cAAAL,qBAAA,uBAAxBA,qBAAA,CAA0BT,MAAM;UACxCC,MAAM,EAAE;QACV;QACA;QACA;MACF,CAAC;;MACD,OAAOS,QAAQ;IACjB;MACEA,QAAQ,GAAGP,KAAK;MAChB,OAAOO,QAAQ;EACnB;AACF"}
1
+ {"version":3,"names":["ActionType","initialRowndState","user","data","email","auth","access_token","refresh_token","app_id","app","schema","config","rowndReducer","state","action","_action$payload","_action$payload2","_action$payload3","_action$payload4","_action$payload5","_action$payload$appCo","newState","type","UPDATE_STATE","payload","appConfig","id"],"sources":["rowndReducer.ts"],"sourcesContent":["import type { GlobalState } from '../components/GlobalContext.types';\nimport { ActionType, TAction } from '../constants/action';\n\nexport const initialRowndState: GlobalState = {\n // is_initializing: false,\n user: {\n data: {\n email: null,\n },\n // meta: {}\n },\n auth: {\n access_token: null,\n refresh_token: null,\n app_id: null,\n },\n app: {\n schema: null,\n config: null,\n },\n // is_saving_user_data: false,\n // config,\n};\n\nexport function rowndReducer(state: GlobalState, action: TAction): GlobalState {\n let newState: GlobalState;\n\n switch (action.type) {\n case ActionType.UPDATE_STATE:\n newState = {\n user: {\n data: {\n ...action.payload?.user?.data,\n email: action.payload?.user?.data?.email,\n },\n // meta: {}\n },\n auth: {\n access_token: action.payload?.auth?.access_token,\n refresh_token: action.payload?.auth?.refresh_token,\n app_id: action.payload?.appConfig?.id || null,\n },\n app: {\n schema: action.payload.appConfig?.schema,\n config: null,\n },\n // is_saving_user_data: false,\n // config\n };\n return newState;\n default:\n newState = state;\n return newState;\n }\n}\n"],"mappings":"AACA,SAASA,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N,gBAAA,gBAAAA,gBAAA,GAAdA,gBAAA,CAAgBb,IAAI,cAAAa,gBAAA,uBAApBA,gBAAA,CAAsBX,aAAa;UAClDC,MAAM,EAAE,EAAAW,gBAAA,GAAAL,MAAM,CAACU,OAAO,cAAAL,gBAAA,gBAAAA,gBAAA,GAAdA,gBAAA,CAAgBM,SAAS,cAAAN,gBAAA,uBAAzBA,gBAAA,CAA2BO,EAAE,KAAI;QAC3C,CAAC;QACDjB,GAAG,EAAE;UACHC,MAAM,GAAAU,qBAAA,GAAEN,MAAM,CAACU,OAAO,CAACC,SAAS,cAAAL,qBAAA,uBAAxBA,qBAAA,CAA0BV,MAAM;UACxCC,MAAM,EAAE;QACV;QACA;QACA;MACF,CAAC;;MACD,OAAOU,QAAQ;IACjB;MACEA,QAAQ,GAAGR,KAAK;MAChB,OAAOQ,QAAQ;EACnB;AACF"}
@@ -1,9 +1,9 @@
1
- import React, { FunctionComponent } from 'react';
2
- import type { RequestSignIn } from 'src/hooks/rownd';
1
+ import React from 'react';
2
+ import type { RequestSignIn } from '../hooks/rownd';
3
3
  export declare type ContextProps = {
4
4
  children?: React.ReactNode;
5
5
  initializing?: React.ReactNode;
6
6
  signInProps?: RequestSignIn;
7
7
  };
8
- declare const RequireSignIn: FunctionComponent<ContextProps>;
8
+ declare const RequireSignIn: React.FC<ContextProps>;
9
9
  export default RequireSignIn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rownd/react-native",
3
- "version": "2.11.3",
3
+ "version": "2.11.4",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -1,6 +1,6 @@
1
- import React, { FunctionComponent, useEffect } from 'react';
2
- import { useRownd } from '..';
3
- import type { RequestSignIn } from 'src/hooks/rownd';
1
+ import React, { useEffect } from 'react';
2
+ import { useRownd } from '../hooks/rownd';
3
+ import type { RequestSignIn } from '../hooks/rownd';
4
4
  import { Platform } from 'react-native';
5
5
 
6
6
  export type ContextProps = {
@@ -9,7 +9,7 @@ export type ContextProps = {
9
9
  signInProps?: RequestSignIn;
10
10
  };
11
11
 
12
- const RequireSignIn: FunctionComponent<ContextProps> = ({
12
+ const RequireSignIn: React.FC<ContextProps> = ({
13
13
  children,
14
14
  initializing,
15
15
  signInProps,
@@ -56,7 +56,7 @@ export function useRownd(): TRowndContext {
56
56
  getIdToken: getFirebaseIdToken,
57
57
  },
58
58
  is_authenticated: !!state.auth.access_token,
59
- is_initializing: !!state.auth.app_id,
59
+ is_initializing: !state.auth.app_id,
60
60
  manageAccount,
61
61
  requestSignIn,
62
62
  signOut,
@@ -38,7 +38,7 @@ export function rowndReducer(state: GlobalState, action: TAction): GlobalState {
38
38
  auth: {
39
39
  access_token: action.payload?.auth?.access_token,
40
40
  refresh_token: action.payload?.auth?.refresh_token,
41
- app_id: null,
41
+ app_id: action.payload?.appConfig?.id || null,
42
42
  },
43
43
  app: {
44
44
  schema: action.payload.appConfig?.schema,
@@ -1 +0,0 @@
1
- export default function App(): JSX.Element;
File without changes
File without changes
File without changes