@ovok/native 1.10.7 → 1.10.8
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/modules/auth/hooks/use-session.js +3 -1
- package/lib/commonjs/modules/auth/hooks/use-session.js.map +1 -1
- package/lib/commonjs/modules/auth/profile/components/profile-form-provider.js +11 -3
- package/lib/commonjs/modules/auth/profile/components/profile-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/session/session-store-refresh.js +24 -1
- package/lib/commonjs/modules/auth/session/session-store-refresh.js.map +1 -1
- package/lib/commonjs/modules/auth/session/session-store-request-state.js.map +1 -1
- package/lib/commonjs/modules/auth/session/session-store-types.js +13 -1
- package/lib/commonjs/modules/auth/session/session-store-types.js.map +1 -1
- package/lib/commonjs/modules/auth/session/session-store.js +7 -0
- package/lib/commonjs/modules/auth/session/session-store.js.map +1 -1
- package/lib/commonjs/modules/auth/utils/sign-in-error.js +8 -2
- package/lib/commonjs/modules/auth/utils/sign-in-error.js.map +1 -1
- package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js +19 -8
- package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -1
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +74 -52
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/runtime-context.js +11 -0
- package/lib/commonjs/modules/bt-management/hooks/runtime-context.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js +2 -1
- package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js +71 -87
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-queue.js +59 -0
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-queue.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js +7 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js.map +1 -1
- package/lib/commonjs/polyfills/index.js +4 -6
- package/lib/commonjs/polyfills/index.js.map +1 -1
- package/lib/module/modules/auth/hooks/use-session.js +3 -1
- package/lib/module/modules/auth/hooks/use-session.js.map +1 -1
- package/lib/module/modules/auth/profile/components/profile-form-provider.js +11 -3
- package/lib/module/modules/auth/profile/components/profile-form-provider.js.map +1 -1
- package/lib/module/modules/auth/session/session-store-refresh.js +25 -2
- package/lib/module/modules/auth/session/session-store-refresh.js.map +1 -1
- package/lib/module/modules/auth/session/session-store-request-state.js.map +1 -1
- package/lib/module/modules/auth/session/session-store-types.js +12 -1
- package/lib/module/modules/auth/session/session-store-types.js.map +1 -1
- package/lib/module/modules/auth/session/session-store.js +7 -0
- package/lib/module/modules/auth/session/session-store.js.map +1 -1
- package/lib/module/modules/auth/utils/sign-in-error.js +8 -2
- package/lib/module/modules/auth/utils/sign-in-error.js.map +1 -1
- package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js +19 -8
- package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -1
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +74 -52
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/runtime-context.js +11 -0
- package/lib/module/modules/bt-management/hooks/runtime-context.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/use-background-sync.js +2 -1
- package/lib/module/modules/bt-management/hooks/use-background-sync.js.map +1 -1
- package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js +64 -86
- package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
- package/lib/module/modules/bt-management/services/background-sync/background-sync-queue.js +52 -0
- package/lib/module/modules/bt-management/services/background-sync/background-sync-queue.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js +7 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js.map +1 -1
- package/lib/module/polyfills/index.js +6 -3
- package/lib/module/polyfills/index.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/components/profile-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/types/profile-form-props.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/auth/profile/types/profile-form-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-refresh.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-request-state.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-request-state.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-types.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/session-store.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/utils/sign-in-error.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts +5 -16
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-queue.d.ts +28 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-queue.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-submit-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/polyfills/index.d.ts +5 -3
- package/lib/typescript/commonjs/src/polyfills/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts +3 -1
- package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/components/profile-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/types/profile-form-props.d.ts +1 -0
- package/lib/typescript/module/src/modules/auth/profile/types/profile-form-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/session/session-store-refresh.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/session/session-store-request-state.d.ts +1 -1
- package/lib/typescript/module/src/modules/auth/session/session-store-request-state.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/session/session-store-types.d.ts +4 -1
- package/lib/typescript/module/src/modules/auth/session/session-store-types.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/session/session-store.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/utils/sign-in-error.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts +5 -16
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-queue.d.ts +28 -0
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-queue.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-submit-utils.d.ts.map +1 -1
- package/lib/typescript/module/src/polyfills/index.d.ts +5 -3
- package/lib/typescript/module/src/polyfills/index.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -34,10 +34,12 @@ const useSession = ({
|
|
|
34
34
|
}, [refresh, refreshOnForeground]);
|
|
35
35
|
return {
|
|
36
36
|
status: snapshot.status,
|
|
37
|
+
activeAccountId: snapshot.activeAccountId,
|
|
38
|
+
patientId: snapshot.activeAccountId !== undefined && snapshot.profileAccountId === snapshot.activeAccountId && snapshot.profile?.resourceType === "Patient" ? snapshot.profile.id : undefined,
|
|
37
39
|
reason: snapshot.reason,
|
|
38
40
|
isAuthenticated: snapshot.status === "authenticated" || snapshot.status === "offline",
|
|
39
41
|
accounts: snapshot.accounts,
|
|
40
|
-
profile: snapshot.profile,
|
|
42
|
+
profile: snapshot.activeAccountId !== undefined && snapshot.profileAccountId === snapshot.activeAccountId ? snapshot.profile : undefined,
|
|
41
43
|
sessions: snapshot.sessions,
|
|
42
44
|
loading: snapshot.status === "loading",
|
|
43
45
|
switching: snapshot.switching === true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","React","_interopRequireWildcard","_reactNative","_events","_sessionStore","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","useSession","sessions","fetchSessions","refreshOnForeground","client","useClient","store","useMemo","getSessionStore","snapshot","useSyncExternalStore","subscribe","refresh","useCallback","useEffect","subscription","AppState","addEventListener","nextState","undefined","unsubscribe","subscribeSessionChanges","remove","status","
|
|
1
|
+
{"version":3,"names":["_core","require","React","_interopRequireWildcard","_reactNative","_events","_sessionStore","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","useSession","sessions","fetchSessions","refreshOnForeground","client","useClient","store","useMemo","getSessionStore","snapshot","useSyncExternalStore","subscribe","refresh","useCallback","useEffect","subscription","AppState","addEventListener","nextState","undefined","unsubscribe","subscribeSessionChanges","remove","status","activeAccountId","patientId","profileAccountId","profile","resourceType","id","reason","isAuthenticated","accounts","loading","switching","error","refreshSessions","switchAccount","removeAccount","logout","revokeSessions","exports"],"sourceRoot":"../../../../../src","sources":["modules/auth/hooks/use-session.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAEA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAA2D,SAAAE,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAA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MAAM,EAAEjC,KAAK,CAACiC,MAAM;IACpBC,cAAc,EAAElC,KAAK,CAACkC;EACxB,CAAC;AACH,CAAC;AAACC,OAAA,CAAAzC,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -20,6 +20,7 @@ const ProfileFormProvider = ({
|
|
|
20
20
|
children,
|
|
21
21
|
fields,
|
|
22
22
|
onSubmit,
|
|
23
|
+
onError,
|
|
23
24
|
onSuccess
|
|
24
25
|
}) => {
|
|
25
26
|
const client = (0, _core.useClient)();
|
|
@@ -68,9 +69,14 @@ const ProfileFormProvider = ({
|
|
|
68
69
|
return submitted;
|
|
69
70
|
}, {});
|
|
70
71
|
if (onSubmit) {
|
|
71
|
-
|
|
72
|
+
try {
|
|
73
|
+
await onSubmit(submittedValues, formikHelpers);
|
|
74
|
+
} catch (error) {
|
|
75
|
+
onError?.(error);
|
|
76
|
+
}
|
|
72
77
|
return;
|
|
73
78
|
}
|
|
79
|
+
let savedPatient;
|
|
74
80
|
try {
|
|
75
81
|
const activeProfile = (await client.refetchProfile()) ?? (await client.getProfileAsync());
|
|
76
82
|
const patient = activeProfile;
|
|
@@ -94,12 +100,14 @@ const ProfileFormProvider = ({
|
|
|
94
100
|
value
|
|
95
101
|
}];
|
|
96
102
|
});
|
|
97
|
-
|
|
103
|
+
savedPatient = await client.patchResource("Patient", activeProfile?.id ?? "", operations.filter(op => op.path !== "/submit"));
|
|
98
104
|
await client.refetchProfile();
|
|
99
|
-
await onSuccess?.(response, submittedValues);
|
|
100
105
|
} catch (error) {
|
|
101
106
|
formikHelpers.setFieldError("submit", (0, _signInError.isNetworkError)(error) ? "profile.form.error.network" : "profile.form.error.generic");
|
|
107
|
+
onError?.(error);
|
|
108
|
+
return;
|
|
102
109
|
}
|
|
110
|
+
await onSuccess?.(savedPatient, submittedValues);
|
|
103
111
|
} finally {
|
|
104
112
|
submitInProgress.current = false;
|
|
105
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","_formik","_libphonenumberJs","_react","_interopRequireDefault","Yup","_interopRequireWildcard","_useShallowStableValue","_signInError","_profileFormContext","_phone","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ProfileFormProvider","children","fields","onSubmit","onSuccess","client","useClient","submitInProgress","React","useRef","initialValues","useMemo","values","reduce","acc","field","value","type","toPhoneE164","defaultCountry","name","phoneCountryFieldName","parsePhoneNumberFromString","country","submit","validationSchema","fieldRules","validation","string","test","validatePhone","parent","isPhoneValidForCountry","object","shape","formik","useFormik","enableReinitialize","validateOnBlur","formikHelpers","current","submittedValues","submitted","activeProfile","refetchProfile","getProfileAsync","patient","operations","flatMap","toPatch","initialValue","op","getPatchOperationType","path","includes","split","filter","Boolean","join","
|
|
1
|
+
{"version":3,"names":["_core","require","_formik","_libphonenumberJs","_react","_interopRequireDefault","Yup","_interopRequireWildcard","_useShallowStableValue","_signInError","_profileFormContext","_phone","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ProfileFormProvider","children","fields","onSubmit","onError","onSuccess","client","useClient","submitInProgress","React","useRef","initialValues","useMemo","values","reduce","acc","field","value","type","toPhoneE164","defaultCountry","name","phoneCountryFieldName","parsePhoneNumberFromString","country","submit","validationSchema","fieldRules","validation","string","test","validatePhone","parent","isPhoneValidForCountry","object","shape","formik","useFormik","enableReinitialize","validateOnBlur","formikHelpers","current","submittedValues","submitted","error","savedPatient","activeProfile","refetchProfile","getProfileAsync","patient","operations","flatMap","toPatch","initialValue","op","getPatchOperationType","path","includes","split","filter","Boolean","join","patchResource","id","setFieldError","isNetworkError","contextValue","useShallowStableValue","jsx","ProfileFormContext","Provider","exports"],"sourceRoot":"../../../../../../src","sources":["modules/auth/profile/components/profile-form-provider.tsx"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAA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C;YACF,CAAC,CACF;UACH,CAAC,CAAC;UAEF4B,YAAY,GAAI,MAAMvC,MAAM,CAACwD,aAAa,CACxC,SAAS,EACThB,aAAa,EAAEiB,EAAE,IAAI,EAAE,EACvBb,UAAU,CAACS,MAAM,CACdL,EAAE,IAAKA,EAAE,CAACE,IAAI,KAAK,SACtB,CACF,CAAa;UAEb,MAAMlD,MAAM,CAACyC,cAAc,CAAC,CAAC;QAC/B,CAAC,CAAC,OAAOH,KAAK,EAAE;UACdJ,aAAa,CAACwB,aAAa,CACzB,QAAQ,EACR,IAAAC,2BAAc,EAACrB,KAAK,CAAC,GACjB,4BAA4B,GAC5B,4BACN,CAAC;UACDxC,OAAO,GAAGwC,KAAK,CAAC;UAEhB;QACF;QAEA,MAAMvC,SAAS,GAAGwC,YAAY,EAAEH,eAAe,CAAC;MAClD,CAAC,SAAS;QACRlC,gBAAgB,CAACiC,OAAO,GAAG,KAAK;MAClC;IACF;EACF,CAAC,CAAC;EAEF,MAAMyB,YAAY,GAAG,IAAAC,4CAAqB,EAAC;IAAE,GAAG/B;EAAO,CAAC,CAAC;EAEzD,oBACE,IAAAxD,WAAA,CAAAwF,GAAA,EAAC1F,mBAAA,CAAA2F,kBAAkB,CAACC,QAAQ;IAACrD,KAAK,EAAEiD,YAAa;IAAAjE,QAAA,EAC9CA;EAAQ,CACkB,CAAC;AAElC,CAAC;AAACsE,OAAA,CAAAvE,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -10,10 +10,12 @@ const createSessionRefreshActions = (client, requestState, getStore, notify) =>
|
|
|
10
10
|
const refresh = async includeSessions => {
|
|
11
11
|
const store = getStore();
|
|
12
12
|
requestState.syncActiveAccount();
|
|
13
|
+
const activeAccountId = requestState.getActiveAccountId();
|
|
13
14
|
if (!client.getActiveLogin()) {
|
|
14
15
|
requestState.nextRevision();
|
|
15
16
|
store.snapshot = {
|
|
16
17
|
status: "signed-out",
|
|
18
|
+
activeAccountId,
|
|
17
19
|
reason: store.snapshot.reason,
|
|
18
20
|
switching: store.snapshot.switching,
|
|
19
21
|
accounts: requestState.getAccounts(),
|
|
@@ -22,6 +24,17 @@ const createSessionRefreshActions = (client, requestState, getStore, notify) =>
|
|
|
22
24
|
notify();
|
|
23
25
|
return;
|
|
24
26
|
}
|
|
27
|
+
if (store.snapshot.activeAccountId !== activeAccountId) {
|
|
28
|
+
store.snapshot = {
|
|
29
|
+
...store.snapshot,
|
|
30
|
+
activeAccountId,
|
|
31
|
+
profile: undefined,
|
|
32
|
+
profileAccountId: undefined,
|
|
33
|
+
sessions: [],
|
|
34
|
+
error: undefined
|
|
35
|
+
};
|
|
36
|
+
notify();
|
|
37
|
+
}
|
|
25
38
|
const revision = requestState.nextRevision();
|
|
26
39
|
const previousSnapshot = store.snapshot;
|
|
27
40
|
if (!store.snapshot.switching && store.snapshot.status !== "authenticated" && store.snapshot.status !== "offline") {
|
|
@@ -46,25 +59,33 @@ const createSessionRefreshActions = (client, requestState, getStore, notify) =>
|
|
|
46
59
|
if (!requestState.isCurrent(revision)) {
|
|
47
60
|
return;
|
|
48
61
|
}
|
|
49
|
-
const profile = "profile" in profileResult ? profileResult.profile : previousSnapshot.profile;
|
|
62
|
+
const profile = "profile" in profileResult ? (0, _sessionStoreTypes.profileMatchesAccount)(profileResult.profile, activeAccountId) ? profileResult.profile : undefined : previousSnapshot.profileAccountId === activeAccountId && (0, _sessionStoreTypes.profileMatchesAccount)(previousSnapshot.profile, activeAccountId) ? previousSnapshot.profile : undefined;
|
|
63
|
+
const profileAccountId = profile ? "profile" in profileResult ? activeAccountId : previousSnapshot.profileAccountId : undefined;
|
|
50
64
|
const sessions = "sessions" in sessionsResult ? sessionsResult.sessions : previousSnapshot.sessions;
|
|
51
65
|
const error = "error" in profileResult ? profileResult.error : "error" in sessionsResult ? sessionsResult.error : undefined;
|
|
52
66
|
const accounts = requestState.getAccounts();
|
|
53
67
|
const nextSnapshot = !client.getActiveLogin() || (0, _sessionErrors.getHttpStatus)(error) === 401 ? {
|
|
54
68
|
status: "signed-out",
|
|
69
|
+
activeAccountId,
|
|
55
70
|
accounts,
|
|
71
|
+
profile: undefined,
|
|
72
|
+
profileAccountId: undefined,
|
|
56
73
|
sessions: [],
|
|
57
74
|
error: error === undefined ? undefined : (0, _sessionErrors.toError)(error)
|
|
58
75
|
} : "error" in profileResult ? {
|
|
59
76
|
status: "offline",
|
|
77
|
+
activeAccountId,
|
|
60
78
|
accounts,
|
|
61
79
|
profile,
|
|
80
|
+
profileAccountId,
|
|
62
81
|
sessions: sessions.map(_sessionStoreTypes.normalizeSession),
|
|
63
82
|
error: (0, _sessionErrors.toError)(profileResult.error)
|
|
64
83
|
} : {
|
|
65
84
|
status: "authenticated",
|
|
85
|
+
activeAccountId,
|
|
66
86
|
accounts,
|
|
67
87
|
profile,
|
|
88
|
+
profileAccountId,
|
|
68
89
|
sessions: sessions.map(_sessionStoreTypes.normalizeSession),
|
|
69
90
|
error: "error" in sessionsResult ? (0, _sessionErrors.toError)(sessionsResult.error) : undefined
|
|
70
91
|
};
|
|
@@ -80,6 +101,7 @@ const createSessionRefreshActions = (client, requestState, getStore, notify) =>
|
|
|
80
101
|
if (!client.getActiveLogin()) {
|
|
81
102
|
store.snapshot = {
|
|
82
103
|
...store.snapshot,
|
|
104
|
+
activeAccountId: requestState.getActiveAccountId(),
|
|
83
105
|
accounts: requestState.getAccounts(),
|
|
84
106
|
sessions: []
|
|
85
107
|
};
|
|
@@ -107,6 +129,7 @@ const createSessionRefreshActions = (client, requestState, getStore, notify) =>
|
|
|
107
129
|
if (!client.getActiveLogin() || (0, _sessionErrors.getHttpStatus)(cause) === 401) {
|
|
108
130
|
store.snapshot = {
|
|
109
131
|
status: "signed-out",
|
|
132
|
+
activeAccountId: requestState.getActiveAccountId(),
|
|
110
133
|
accounts: requestState.getAccounts(),
|
|
111
134
|
sessions: [],
|
|
112
135
|
error
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_sessionErrors","require","_sessionStoreTypes","createSessionRefreshActions","client","requestState","getStore","notify","refresh","includeSessions","store","syncActiveAccount","getActiveLogin","nextRevision","snapshot","status","reason","switching","accounts","getAccounts","sessions","
|
|
1
|
+
{"version":3,"names":["_sessionErrors","require","_sessionStoreTypes","createSessionRefreshActions","client","requestState","getStore","notify","refresh","includeSessions","store","syncActiveAccount","activeAccountId","getActiveAccountId","getActiveLogin","nextRevision","snapshot","status","reason","switching","accounts","getAccounts","sessions","profile","undefined","profileAccountId","error","revision","previousSnapshot","currentProfileRequest","getProfileRequest","currentSessionsRequest","getSessionsRequest","profileResult","sessionsResult","Promise","all","then","resolve","isCurrent","profileMatchesAccount","nextSnapshot","getHttpStatus","toError","map","normalizeSession","refreshSessions","cause","exports"],"sourceRoot":"../../../../../src","sources":["modules/auth/session/session-store-refresh.ts"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAEA,IAAAC,kBAAA,GAAAD,OAAA;AAQA,MAAME,2BAA2B,GAAGA,CAClCC,MAAc,EACdC,YAAsC,EACtCC,QAA4B,EAC5BC,MAAkB,KACf;EACH,MAAMC,OAAO,GAAG,MAAOC,eAAwB,IAAK;IAClD,MAAMC,KAAK,GAAGJ,QAAQ,CAAC,CAAC;IAExBD,YAAY,CAACM,iBAAiB,CAAC,CAAC;IAChC,MAAMC,eAAe,GAAGP,YAAY,CAACQ,kBAAkB,CAAC,CAAC;IAEzD,IAAI,CAACT,MAAM,CAACU,cAAc,CAAC,CAAC,EAAE;MAC5BT,YAAY,CAACU,YAAY,CAAC,CAAC;MAC3BL,KAAK,CAACM,QAAQ,GAAG;QACfC,MAAM,EAAE,YAAY;QACpBL,eAAe;QACfM,MAAM,EAAER,KAAK,CAACM,QAAQ,CAACE,MAAM;QAC7BC,SAAS,EAAET,KAAK,CAACM,QAAQ,CAACG,SAAS;QACnCC,QAAQ,EAAEf,YAAY,CAACgB,WAAW,CAAC,CAAC;QACpCC,QAAQ,EAAE;MACZ,CAAC;MACDf,MAAM,CAAC,CAAC;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F;MAEAjB,KAAK,CAACM,QAAQ,GAAG;QACf,GAAGN,KAAK,CAACM,QAAQ;QACjBI,QAAQ,EAAEf,YAAY,CAACgB,WAAW,CAAC,CAAC;QACpCC,QAAQ,EAAEA,QAAQ,CAACsB,GAAG,CAACC,mCAAgB,CAAC;QACxCnB,KAAK,EAAEF;MACT,CAAC;MACDjB,MAAM,CAAC,CAAC;IACV,CAAC,CAAC,OAAOwC,KAAK,EAAE;MACd,IAAI,CAAC1C,YAAY,CAACkC,SAAS,CAACZ,QAAQ,CAAC,EAAE;QACrC;MACF;MAEA,MAAMD,KAAK,GAAG,IAAAiB,sBAAO,EAACI,KAAK,CAAC;MAE5B,IAAI,CAAC3C,MAAM,CAACU,cAAc,CAAC,CAAC,IAAI,IAAA4B,4BAAa,EAACK,KAAK,CAAC,KAAK,GAAG,EAAE;QAC5DrC,KAAK,CAACM,QAAQ,GAAG;UACfC,MAAM,EAAE,YAAY;UACpBL,eAAe,EAAEP,YAAY,CAACQ,kBAAkB,CAAC,CAAC;UAClDO,QAAQ,EAAEf,YAAY,CAACgB,WAAW,CAAC,CAAC;UACpCC,QAAQ,EAAE,EAAE;UACZI;QACF,CAAC;MACH,CAAC,MAAM;QACLhB,KAAK,CAACM,QAAQ,GAAG;UAAE,GAAGN,KAAK,CAACM,QAAQ;UAAEU;QAAM,CAAC;MAC/C;MACAnB,MAAM,CAAC,CAAC;MACR,MAAMmB,KAAK;IACb;EACF,CAAC;EAED,OAAO;IAAElB,OAAO;IAAEsC;EAAgB,CAAC;AACrC,CAAC;AAACE,OAAA,CAAA7C,2BAAA,GAAAA,2BAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SessionStoreRequestState","profileNeedsRefresh","hasActiveAccount","authRevision","constructor","client","sessionClient","getAccounts","getSavedAccounts","getActiveAccountId","find","account","active","id","getActiveLogin","profile","reference","syncActiveAccount","nextAccountId","activeAccountId","invalidate","profileRequest","undefined","sessionsRequest","nextRevision","revision","isCurrent","getProfileRequest","requestAccountId","request","refetchProfile","getProfileAsync","then","catch","cause","finally","getSessionsRequest","getSessions","exports"],"sourceRoot":"../../../../../src","sources":["modules/auth/session/session-store-request-state.ts"],"mappings":";;;;;;AAOA,MAAMA,wBAAwB,CAAC;EAGrBC,mBAAmB,GAAG,KAAK;EAE3BC,gBAAgB,GAAG,KAAK;EACxBC,YAAY,GAAG,CAAC;EAExBC,WAAWA,CACQC,MAAc,EACdC,aAA4B,EAC7C;IAAA,KAFiBD,MAAc,GAAdA,MAAc;IAAA,KACdC,aAA4B,GAA5BA,aAA4B;EAC5C;EAEHC,WAAW,GAAGA,CAAA,KAAM,IAAI,CAACD,aAAa,CAACE,gBAAgB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"names":["SessionStoreRequestState","profileNeedsRefresh","hasActiveAccount","authRevision","constructor","client","sessionClient","getAccounts","getSavedAccounts","getActiveAccountId","find","account","active","id","getActiveLogin","profile","reference","syncActiveAccount","nextAccountId","activeAccountId","invalidate","profileRequest","undefined","sessionsRequest","nextRevision","revision","isCurrent","getProfileRequest","requestAccountId","request","refetchProfile","getProfileAsync","then","catch","cause","finally","getSessionsRequest","getSessions","exports"],"sourceRoot":"../../../../../src","sources":["modules/auth/session/session-store-request-state.ts"],"mappings":";;;;;;AAOA,MAAMA,wBAAwB,CAAC;EAGrBC,mBAAmB,GAAG,KAAK;EAE3BC,gBAAgB,GAAG,KAAK;EACxBC,YAAY,GAAG,CAAC;EAExBC,WAAWA,CACQC,MAAc,EACdC,aAA4B,EAC7C;IAAA,KAFiBD,MAAc,GAAdA,MAAc;IAAA,KACdC,aAA4B,GAA5BA,aAA4B;EAC5C;EAEHC,WAAW,GAAGA,CAAA,KAAM,IAAI,CAACD,aAAa,CAACE,gBAAgB,CAAC,CAAC;EAEzDC,kBAAkB,GAAGA,CAAA,KACnB,IAAI,CAACF,WAAW,CAAC,CAAC,CAACG,IAAI,CAAEC,OAAO,IAAKA,OAAO,CAACC,MAAM,C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B,IAAIa,gBAAgB,KAAK,IAAI,CAACnB,kBAAkB,CAAC,CAAC,EAAE;UAClD,IAAI,CAACR,mBAAmB,GAAG,KAAK;QAClC;QAEA,OAAOc,OAAO;MAChB,CAAC,CAAC,CACDkB,KAAK,CAAEC,KAAc,IAAK;QACzB,IAAIN,gBAAgB,KAAK,IAAI,CAACnB,kBAAkB,CAAC,CAAC,EAAE;UAClD,IAAI,CAACR,mBAAmB,GAAG,IAAI;QACjC;QAEA,MAAMiC,KAAK;MACb,CAAC,CAAC,CACDC,OAAO,CAAC,MAAM;QACb,IAAI,IAAI,CAACd,cAAc,KAAKQ,OAAO,EAAE;UACnC,IAAI,CAACR,cAAc,GAAGC,SAAS;QACjC;MACF,CAAC,CAAC;MAEJ,IAAI,CAACD,cAAc,GAAGQ,OAAO;IAC/B;IAEA,OAAO,IAAI,CAACR,cAAc;EAC5B,CAAC;EAEDe,kBAAkB,GAAGA,CAAA,KAAM;IACzB,IAAI,CAAC,IAAI,CAACb,eAAe,EAAE;MACzB,MAAMM,OAAO,GAAG,IAAI,CAACvB,aAAa,CAAC+B,WAAW,CAAC,CAAC,CAACF,OAAO,CAAC,MAAM;QAC7D,IAAI,IAAI,CAACZ,eAAe,KAAKM,OAAO,EAAE;UACpC,IAAI,CAACN,eAAe,GAAGD,SAAS;QAClC;MACF,CAAC,CAAC;MAEF,IAAI,CAACC,eAAe,GAAGM,OAAO;IAChC;IAEA,OAAO,IAAI,CAACN,eAAe;EAC7B,CAAC;AACH;AAACe,OAAA,CAAAtC,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -3,7 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.normalizeSession = void 0;
|
|
6
|
+
exports.profileMatchesAccount = exports.normalizeSession = void 0;
|
|
7
|
+
const profileMatchesAccount = (profile, accountId) => {
|
|
8
|
+
if (!profile || !accountId) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
const identity = profile;
|
|
12
|
+
if (!identity.id) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
const profileReference = identity.resourceType ? `${identity.resourceType}/${identity.id}` : identity.id;
|
|
16
|
+
return accountId === profileReference || accountId.endsWith(`/${identity.id}`);
|
|
17
|
+
};
|
|
18
|
+
exports.profileMatchesAccount = profileMatchesAccount;
|
|
7
19
|
const normalizeSession = session => {
|
|
8
20
|
const legacy = session;
|
|
9
21
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["profileMatchesAccount","profile","accountId","identity","id","profileReference","resourceType","endsWith","exports","normalizeSession","session","legacy","authMethod","remoteAddress","ip","lastUpdated","lastActiveAt","createdAt"],"sourceRoot":"../../../../../src","sources":["modules/auth/session/session-store-types.ts"],"mappings":";;;;;;AAsBA,MAAMA,qBAAqB,GAAGA,CAACC,OAA4B,EAAEC,SAAkB,KAAK;EAClF,IAAI,CAACD,OAAO,IAAI,CAACC,SAAS,EAAE;IAC1B,OAAO,KAAK;EACd;EAEA,MAAMC,QAAQ,GAAGF,OAGhB;EAED,IAAI,CAACE,QAAQ,CAACC,EAAE,EAAE;IAChB,OAAO,KAAK;EACd;EAEA,MAAMC,gBAAgB,GAAGF,QAAQ,CAACG,YAAY,GAC1C,GAAGH,QAAQ,CAACG,YAAY,IAAIH,QAAQ,CAACC,EAAE,EAAE,GACzCD,QAAQ,CAACC,EAAE;EAEf,OAAOF,SAAS,KAAKG,gBAAgB,IAAIH,SAAS,CAACK,QAAQ,CAAC,IAAIJ,QAAQ,CAACC,EAAE,EAAE,CAAC;AAChF,CAAC;AAACI,OAAA,CAAAR,qBAAA,GAAAA,qBAAA;AAsBF,MAAMS,gBAAgB,GAAIC,OAA0B,IAAwB;EAC1E,MAAMC,MAAM,GAAGD,OAId;EAED,OAAO;IACLN,EAAE,EAAEM,OAAO,CAACN,EAAE;IACdQ,UAAU,EAAEF,OAAO,CAACE,UAAU;IAC9BC,aAAa,EAAEH,OAAO,CAACG,aAAa,IAAIF,MAAM,CAACG,EAAE;IACjDC,WAAW,EAAEL,OAAO,CAACK,WAAW,IAAIJ,MAAM,CAACK,YAAY,IAAIL,MAAM,CAACM;EACpE,CAAC;AACH,CAAC;AAACT,OAAA,CAAAC,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -39,6 +39,9 @@ const createSessionStore = client => {
|
|
|
39
39
|
currentStore.snapshot = {
|
|
40
40
|
status: "signed-out",
|
|
41
41
|
reason: "session-ended",
|
|
42
|
+
activeAccountId: undefined,
|
|
43
|
+
profile: undefined,
|
|
44
|
+
profileAccountId: undefined,
|
|
42
45
|
accounts: requestState.getAccounts(),
|
|
43
46
|
sessions: []
|
|
44
47
|
};
|
|
@@ -49,6 +52,7 @@ const createSessionStore = client => {
|
|
|
49
52
|
const store = {
|
|
50
53
|
snapshot: {
|
|
51
54
|
status: "loading",
|
|
55
|
+
activeAccountId: requestState.getActiveAccountId(),
|
|
52
56
|
switching: false,
|
|
53
57
|
accounts: requestState.getAccounts(),
|
|
54
58
|
sessions: []
|
|
@@ -95,6 +99,9 @@ const createSessionStore = client => {
|
|
|
95
99
|
requestState.invalidate();
|
|
96
100
|
store.snapshot = {
|
|
97
101
|
status: "signed-out",
|
|
102
|
+
activeAccountId: requestState.getActiveAccountId(),
|
|
103
|
+
profile: undefined,
|
|
104
|
+
profileAccountId: undefined,
|
|
98
105
|
accounts: requestState.getAccounts(),
|
|
99
106
|
sessions: []
|
|
100
107
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_netinfo","require","_logoutSession","_sessionStoreRefresh","_sessionStoreRequestState","stores","WeakMap","createSessionStore","client","sessionClient","listeners","Set","requestState","SessionStoreRequestState","unsubscribeNetwork","unsubscribeClient","wasConnected","logoutRequest","storeRef","notify","forEach","listener","onClientChange","isLogoutInProgress","current","snapshot","switching","Promise","resolve","then","currentStore","getActiveLogin","refresh","status","invalidate","reason","accounts","getAccounts","sessions","refreshActions","createSessionRefreshActions","store","subscribe","add","addEventListener","removeEventListener","addNetworkEventListener","state","isConnected","isInternetReachable","shouldRefresh","delete","size","
|
|
1
|
+
{"version":3,"names":["_netinfo","require","_logoutSession","_sessionStoreRefresh","_sessionStoreRequestState","stores","WeakMap","createSessionStore","client","sessionClient","listeners","Set","requestState","SessionStoreRequestState","unsubscribeNetwork","unsubscribeClient","wasConnected","logoutRequest","storeRef","notify","forEach","listener","onClientChange","isLogoutInProgress","current","snapshot","switching","Promise","resolve","then","currentStore","getActiveLogin","refresh","status","invalidate","reason","activeAccountId","undefined","profile","profileAccountId","accounts","getAccounts","sessions","refreshActions","createSessionRefreshActions","store","getActiveAccountId","subscribe","add","addEventListener","removeEventListener","addNetworkEventListener","state","isConnected","isInternetReachable","shouldRefresh","delete","size","switchAccount","accountId","runAccountOperation","removeAccount","logout","logoutSession","revokeSessions","option","operation","getSessionStore","key","existing","get","next","set","exports"],"sourceRoot":"../../../../../src","sources":["modules/auth/session/session-store.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAQA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAH,OAAA;AAEA,MAAMI,MAAM,GAAG,IAAIC,OAAO,CAAuB,CAAC;AAElD,MAAMC,kBAAkB,GAAIC,MAAc,IAAmB;EAC3D,MAAMC,aAAa,GAAGD,MAAkC;EACxD,MAAME,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;EACvC,MAAMC,YAAY,GAAG,IAAIC,kDAAwB,CAACL,MAAM,EAAEC,aAAa,CAAC;EACxE,IAAIK,kBAA4C;EAChD,IAAIC,iBAA2C;EAC/C,IAAIC,YAAiC;EACrC,IAAIC,aAAwC;EAC5C,MAAMC,QAAoC,GAAG,CAAC,CAAC;EAE/C,MAAMC,MAAM,GAAGA,CAAA,KAAMT,SAAS,CA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QAAQ,EAAE5B,YAAY,CAAC6B,WAAW,CAAC;IACrC,CAAC;IACDtB,MAAM,CAAC,CAAC;IAER,IAAI;MACF,MAAM+C,SAAS,CAAC,CAAC;IACnB,CAAC,SAAS;MACR,MAAMpC,YAAY,CAACE,OAAO,CAAC,IAAI,CAAC;MAChCF,YAAY,CAACL,QAAQ,GAAG;QAAE,GAAGK,YAAY,CAACL,QAAQ;QAAEC,SAAS,EAAE;MAAM,CAAC;MACtEP,MAAM,CAAC,CAAC;IACV;EACF;EAEA,OAAO0B,KAAK;AACd,CAAC;AAED,MAAMsB,eAAe,GAAI3D,MAAc,IAAmB;EACxD,MAAM4D,GAAG,GAAG5D,MAAgB;EAC5B,MAAM6D,QAAQ,GAAGhE,MAAM,CAACiE,GAAG,CAACF,GAAG,CAAC;EAEhC,IAAIC,QAAQ,EAAE;IACZ,OAAOA,QAAQ;EACjB;EAEA,MAAME,IAAI,GAAGhE,kBAAkB,CAACC,MAAM,CAAC;EAEvCH,MAAM,CAACmE,GAAG,CAACJ,GAAG,EAAEG,IAAI,CAAC;EAErB,OAAOA,IAAI;AACb,CAAC;AAACE,OAAA,CAAAN,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -39,7 +39,13 @@ const messageKeyForStatus = (status, isMfaVerification, isSignIn) => {
|
|
|
39
39
|
};
|
|
40
40
|
const isNetworkError = (error, message) => {
|
|
41
41
|
const errorMessage = message ?? (error instanceof Error ? error.message : asRecord(error)?.message);
|
|
42
|
-
|
|
42
|
+
const record = asRecord(error);
|
|
43
|
+
const response = asRecord(record?.response);
|
|
44
|
+
const status = numberValue(record?.status, record?.statusCode, response?.status);
|
|
45
|
+
if (status !== undefined || response !== undefined) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
return typeof errorMessage === "string" && /network request failed|network error|failed to fetch|fetch failed|request timed out|request timeout|timed out|timeout|unknownhostexception|no route to host|network is unreachable|unable to resolve host|could not resolve host|name resolution/i.test(errorMessage);
|
|
43
49
|
};
|
|
44
50
|
|
|
45
51
|
/** Converts auth transport/server failures to safe, translatable error keys. */
|
|
@@ -56,7 +62,7 @@ const parseSignInError = (error, options = {}) => {
|
|
|
56
62
|
const fieldErrors = Array.isArray(body?.errors) ? body.errors : Array.isArray(nestedError?.errors) ? nestedError.errors : [];
|
|
57
63
|
const genericErrorKey = options.errorScope ? `${options.errorScope}.errors.generic` : "sign-in.errors.generic";
|
|
58
64
|
const networkErrorKey = options.errorScope ? `${options.errorScope}.errors.network` : "sign-in.errors.network";
|
|
59
|
-
const message = messageKeyForStatus(status, options.isMfaVerification === true, options.isSignIn !== false) ?? (isNetworkError(error, originalMessage) ? networkErrorKey : genericErrorKey);
|
|
65
|
+
const message = messageKeyForStatus(status, options.isMfaVerification === true, options.isSignIn !== false) ?? (status === undefined && isNetworkError(error, originalMessage) ? networkErrorKey : genericErrorKey);
|
|
60
66
|
const signInError = new Error(message);
|
|
61
67
|
if (status !== undefined) {
|
|
62
68
|
signInError.status = status;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["asRecord","value","undefined","parseJsonRecord","JSON","parse","numberValue","values","find","candidate","Number","isFinite","stringValue","length","messageKeyForStatus","status","isMfaVerification","isSignIn","isNetworkError","error","message","errorMessage","Error","
|
|
1
|
+
{"version":3,"names":["asRecord","value","undefined","parseJsonRecord","JSON","parse","numberValue","values","find","candidate","Number","isFinite","stringValue","length","messageKeyForStatus","status","isMfaVerification","isSignIn","isNetworkError","error","message","errorMessage","Error","record","response","statusCode","test","exports","parseSignInError","options","root","originalMessage","body","data","nestedError","code","requestId","fieldErrors","Array","isArray","errors","genericErrorKey","errorScope","networkErrorKey","signInError"],"sourceRoot":"../../../../../src","sources":["modules/auth/utils/sign-in-error.ts"],"mappings":";;;;;;AAeA,MAAMA,QAAQ,GAAIC,KAAc,IAC9B,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,GACtCA,KAAK,GACNC,SAAS;AAEf,MAAMC,eA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EACA,IAAID,IAAI,KAAKjC,SAAS,EAAE;IACtB0C,WAAW,CAACT,IAAI,GAAGA,IAAI;EACzB;EAEA,OAAO;IAAEhB,KAAK,EAAEyB,WAAW;IAAEP;EAAY,CAAC;AAC5C,CAAC;AAACV,OAAA,CAAAC,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js
CHANGED
|
@@ -22,6 +22,8 @@ const AndroidBluetoothForegroundService = ({
|
|
|
22
22
|
options,
|
|
23
23
|
onError
|
|
24
24
|
}) => {
|
|
25
|
+
const onErrorRef = React.useRef(onError);
|
|
26
|
+
onErrorRef.current = onError;
|
|
25
27
|
const notificationBody = options?.notificationBody;
|
|
26
28
|
const notificationTitle = options?.notificationTitle;
|
|
27
29
|
const requestBatteryOptimizationExemption = options?.requestBatteryOptimizationExemption === true;
|
|
@@ -29,6 +31,7 @@ const AndroidBluetoothForegroundService = ({
|
|
|
29
31
|
if (_reactNative.Platform.OS !== "android" || !enabled) {
|
|
30
32
|
return;
|
|
31
33
|
}
|
|
34
|
+
let cancelled = false;
|
|
32
35
|
const requestExemption = async () => {
|
|
33
36
|
if (!requestBatteryOptimizationExemption || _reactNative.AppState.currentState !== "active") {
|
|
34
37
|
return;
|
|
@@ -36,14 +39,19 @@ const AndroidBluetoothForegroundService = ({
|
|
|
36
39
|
try {
|
|
37
40
|
await getNativeModule().requestIgnoreBatteryOptimizations();
|
|
38
41
|
} catch (error) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
if (!cancelled) {
|
|
43
|
+
onErrorRef.current?.({
|
|
44
|
+
error: (0, _bluetoothError.toBluetoothError)(error)
|
|
45
|
+
});
|
|
46
|
+
}
|
|
42
47
|
}
|
|
43
48
|
};
|
|
44
49
|
const start = async () => {
|
|
45
50
|
const nativeModule = getNativeModule();
|
|
46
51
|
await requestExemption();
|
|
52
|
+
if (cancelled) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
47
55
|
await nativeModule.startBluetoothForegroundService({
|
|
48
56
|
...(notificationBody === undefined ? {} : {
|
|
49
57
|
notificationBody
|
|
@@ -59,19 +67,22 @@ const AndroidBluetoothForegroundService = ({
|
|
|
59
67
|
}
|
|
60
68
|
}) : undefined;
|
|
61
69
|
void start().catch(error => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
if (!cancelled) {
|
|
71
|
+
onErrorRef.current?.({
|
|
72
|
+
error: (0, _bluetoothError.toBluetoothError)(error)
|
|
73
|
+
});
|
|
74
|
+
}
|
|
65
75
|
});
|
|
66
76
|
return () => {
|
|
77
|
+
cancelled = true;
|
|
67
78
|
foregroundSubscription?.remove();
|
|
68
79
|
void getNativeModule().stopBluetoothForegroundService().catch(error => {
|
|
69
|
-
|
|
80
|
+
onErrorRef.current?.({
|
|
70
81
|
error: (0, _bluetoothError.toBluetoothError)(error)
|
|
71
82
|
});
|
|
72
83
|
});
|
|
73
84
|
};
|
|
74
|
-
}, [enabled, notificationBody, notificationTitle,
|
|
85
|
+
}, [enabled, notificationBody, notificationTitle, requestBatteryOptimizationExemption]);
|
|
75
86
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
76
87
|
children: children
|
|
77
88
|
});
|
package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_bluetoothError","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","getNativeModule","nativeModule","NativeModules","OvokBackgroundSync","Error","AndroidBluetoothForegroundService","enabled","children","options","onError","notificationBody","notificationTitle","requestBatteryOptimizationExemption","useEffect","Platform","OS","requestExemption","AppState","currentState","requestIgnoreBatteryOptimizations","error","toBluetoothError","start","startBluetoothForegroundService","undefined","foregroundSubscription","addEventListener","state","catch","remove","stopBluetoothForegroundService","jsx","Fragment","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/components/android-bluetooth-foreground-service.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,eAAA,GAAAF,OAAA;AAA4D,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAgB5D,MAAMkB,eAAe,GAAGA,CAAA,KAAkC;EACxD,MAAMC,YAAY,GAAGC,0BAAa,CAACC,kBACK;EAExC,IAAI,CAACF,YAAY,EAAE;IACjB,MAAM,IAAIG,KAAK,CACb,8GACF,CAAC;EACH;EAEA,OAAOH,YAAY;AACrB,CAAC;AAEM,MAAMI,iCAAiC,GAAGA,CAAC;EAChDC,OAAO;EACPC,QAAQ;EACRC,OAAO;EACPC;AAKD,CAAC,KAAK;EACL,MAAMC,gBAAgB,
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_bluetoothError","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","getNativeModule","nativeModule","NativeModules","OvokBackgroundSync","Error","AndroidBluetoothForegroundService","enabled","children","options","onError","onErrorRef","useRef","current","notificationBody","notificationTitle","requestBatteryOptimizationExemption","useEffect","Platform","OS","cancelled","requestExemption","AppState","currentState","requestIgnoreBatteryOptimizations","error","toBluetoothError","start","startBluetoothForegroundService","undefined","foregroundSubscription","addEventListener","state","catch","remove","stopBluetoothForegroundService","jsx","Fragment","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/components/android-bluetooth-foreground-service.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,eAAA,GAAAF,OAAA;AAA4D,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,E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