@adminide-stack/yantra-mobile 12.0.64-alpha.2 → 12.0.64-alpha.3
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/features/invite/InviteDeepLink.js +202 -0
- package/lib/features/invite/InviteDeepLink.js.map +1 -0
- package/lib/features/invite/inviteLink.js +28 -0
- package/lib/features/invite/inviteLink.js.map +1 -0
- package/lib/features/invite/pendingInvite.js +42 -0
- package/lib/features/invite/pendingInvite.js.map +1 -0
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {isAuthenticatedSelector}from'@adminide-stack/user-auth0-client';import {useApolloClient}from'@apollo/client/index.js';import {useDecodeOrganizationInvitationQuery,useAcceptOrganizationInvitationMutation}from'common/graphql';import {useState,useRef,useEffect,useCallback}from'react';import {Linking,Modal,View,Text,Pressable,ActivityIndicator,StyleSheet}from'react-native';import {useSelector}from'react-redux';import {useAppTheme}from'../../theme/AppThemeProvider.js';import {mobileColors,mobileTokens}from'../../theme/mobileTokens.js';import {inviteTokenFromUrl}from'./inviteLink.js';import {readPendingInvite,clearPendingInvite,savePendingInvite}from'./pendingInvite.js';function InviteDeepLink() {
|
|
2
|
+
var _a, _b, _c, _d, _e;
|
|
3
|
+
const {
|
|
4
|
+
isDark
|
|
5
|
+
} = useAppTheme();
|
|
6
|
+
const color = mobileColors(isDark);
|
|
7
|
+
const isAuthenticated = useSelector(isAuthenticatedSelector);
|
|
8
|
+
const client = useApolloClient();
|
|
9
|
+
const [token, setToken] = useState(null);
|
|
10
|
+
const [dismissed, setDismissed] = useState(false);
|
|
11
|
+
const [failure, setFailure] = useState(null);
|
|
12
|
+
const [joined, setJoined] = useState(null);
|
|
13
|
+
const wantsAccept = useRef(false);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
let active = true;
|
|
16
|
+
const adopt = (url) => {
|
|
17
|
+
const next = inviteTokenFromUrl(url);
|
|
18
|
+
if (!next || !active) return;
|
|
19
|
+
setToken(next);
|
|
20
|
+
setDismissed(false);
|
|
21
|
+
setFailure(null);
|
|
22
|
+
setJoined(null);
|
|
23
|
+
void savePendingInvite(next);
|
|
24
|
+
};
|
|
25
|
+
void Linking.getInitialURL().then(adopt).catch(() => void 0);
|
|
26
|
+
const sub = Linking.addEventListener("url", ({
|
|
27
|
+
url
|
|
28
|
+
}) => adopt(url));
|
|
29
|
+
void readPendingInvite().then((parked) => {
|
|
30
|
+
if (parked && active) setToken((current) => current != null ? current : parked);
|
|
31
|
+
});
|
|
32
|
+
return () => {
|
|
33
|
+
active = false;
|
|
34
|
+
sub.remove();
|
|
35
|
+
};
|
|
36
|
+
}, []);
|
|
37
|
+
const {
|
|
38
|
+
data,
|
|
39
|
+
loading
|
|
40
|
+
} = useDecodeOrganizationInvitationQuery({
|
|
41
|
+
variables: {
|
|
42
|
+
token
|
|
43
|
+
},
|
|
44
|
+
skip: !token,
|
|
45
|
+
fetchPolicy: "network-only",
|
|
46
|
+
errorPolicy: "all"
|
|
47
|
+
});
|
|
48
|
+
const [accept, {
|
|
49
|
+
loading: accepting
|
|
50
|
+
}] = useAcceptOrganizationInvitationMutation();
|
|
51
|
+
const decoded = data == null ? void 0 : data.decodeInvitationToken;
|
|
52
|
+
const invitation = decoded == null ? void 0 : decoded.invitation;
|
|
53
|
+
const orgName = (_b = (_a = decoded == null ? void 0 : decoded.organization) == null ? void 0 : _a.name) != null ? _b : "";
|
|
54
|
+
const invitedBy = ((_c = invitation == null ? void 0 : invitation.invitedBy) == null ? void 0 : _c.username) || ((_d = invitation == null ? void 0 : invitation.invitedBy) == null ? void 0 : _d.email) || "";
|
|
55
|
+
const invitedEmail = (_e = invitation == null ? void 0 : invitation.email) != null ? _e : "";
|
|
56
|
+
const decodeProblem = decoded == null ? void 0 : decoded.error;
|
|
57
|
+
const close = useCallback(() => {
|
|
58
|
+
setDismissed(true);
|
|
59
|
+
}, []);
|
|
60
|
+
const done = useCallback(() => {
|
|
61
|
+
setDismissed(true);
|
|
62
|
+
setToken(null);
|
|
63
|
+
void clearPendingInvite();
|
|
64
|
+
}, []);
|
|
65
|
+
const onAccept = useCallback(async () => {
|
|
66
|
+
if (!(invitation == null ? void 0 : invitation.id)) return;
|
|
67
|
+
setFailure(null);
|
|
68
|
+
try {
|
|
69
|
+
await accept({
|
|
70
|
+
variables: {
|
|
71
|
+
id: invitation.id
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
await clearPendingInvite();
|
|
75
|
+
setJoined(orgName || "your team");
|
|
76
|
+
try {
|
|
77
|
+
await client.resetStore();
|
|
78
|
+
} catch (e) {
|
|
79
|
+
}
|
|
80
|
+
} catch (e) {
|
|
81
|
+
setFailure((e == null ? void 0 : e.message) || "We could not accept this invitation. Please try again.");
|
|
82
|
+
}
|
|
83
|
+
}, [accept, client, invitation == null ? void 0 : invitation.id, orgName]);
|
|
84
|
+
const onSignIn = useCallback(() => {
|
|
85
|
+
wantsAccept.current = true;
|
|
86
|
+
setDismissed(true);
|
|
87
|
+
}, []);
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
if (!isAuthenticated || !(invitation == null ? void 0 : invitation.id) || !wantsAccept.current) return;
|
|
90
|
+
wantsAccept.current = false;
|
|
91
|
+
setDismissed(false);
|
|
92
|
+
void onAccept();
|
|
93
|
+
}, [isAuthenticated, invitation == null ? void 0 : invitation.id, onAccept]);
|
|
94
|
+
if (!token || dismissed) return null;
|
|
95
|
+
if (loading && !decoded) return null;
|
|
96
|
+
const invalid = Boolean(decodeProblem) || !(invitation == null ? void 0 : invitation.id);
|
|
97
|
+
const styles = makeStyles(color);
|
|
98
|
+
return /* @__PURE__ */ jsx(Modal, { transparent: true, animationType: "fade", visible: true, onRequestClose: close, children: /* @__PURE__ */ jsx(View, { style: styles.backdrop, children: /* @__PURE__ */ jsx(View, { style: styles.card, children: joined ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
99
|
+
/* @__PURE__ */ jsx(Text, { style: styles.title, children: "You're in" }),
|
|
100
|
+
/* @__PURE__ */ jsxs(Text, { style: styles.body, children: [
|
|
101
|
+
"You joined ",
|
|
102
|
+
joined,
|
|
103
|
+
". Everything you do here is scoped to it."
|
|
104
|
+
] }),
|
|
105
|
+
/* @__PURE__ */ jsx(Pressable, { style: styles.primary, onPress: done, accessibilityRole: "button", children: /* @__PURE__ */ jsx(Text, { style: styles.primaryLabel, children: "Start using Yantra" }) })
|
|
106
|
+
] }) : invalid ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
107
|
+
/* @__PURE__ */ jsx(Text, { style: styles.title, children: "This invitation is no longer valid" }),
|
|
108
|
+
/* @__PURE__ */ jsx(Text, { style: styles.body, children: decodeProblem || "Invitations expire after seven days and can only be accepted once. Ask whoever invited you for a new link." }),
|
|
109
|
+
/* @__PURE__ */ jsx(Pressable, { style: styles.secondary, onPress: done, accessibilityRole: "button", children: /* @__PURE__ */ jsx(Text, { style: styles.secondaryLabel, children: "Close" }) })
|
|
110
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
111
|
+
/* @__PURE__ */ jsx(Text, { style: styles.eyebrow, children: "Invitation" }),
|
|
112
|
+
/* @__PURE__ */ jsxs(Text, { style: styles.title, children: [
|
|
113
|
+
invitedBy ? `${invitedBy} invited you` : "You have been invited",
|
|
114
|
+
orgName ? ` to ${orgName}` : ""
|
|
115
|
+
] }),
|
|
116
|
+
/* @__PURE__ */ jsx(Text, { style: styles.body, children: isAuthenticated ? "Accepting adds you to the workspace. You decide how much access you share, and you can leave or delete your data at any time." : "Sign in to accept. We will keep this invitation until you do." }),
|
|
117
|
+
invitedEmail ? /* @__PURE__ */ jsxs(Text, { style: styles.meta, children: [
|
|
118
|
+
"Invited as ",
|
|
119
|
+
invitedEmail
|
|
120
|
+
] }) : null,
|
|
121
|
+
failure ? /* @__PURE__ */ jsx(Text, { style: styles.failure, children: failure }) : null,
|
|
122
|
+
/* @__PURE__ */ jsx(Pressable, { style: [styles.primary, accepting && styles.primaryBusy], onPress: isAuthenticated ? onAccept : onSignIn, disabled: accepting, accessibilityRole: "button", children: accepting ? /* @__PURE__ */ jsx(ActivityIndicator, { color: color.surface }) : /* @__PURE__ */ jsx(Text, { style: styles.primaryLabel, children: isAuthenticated ? "Accept invitation" : "Sign in to accept" }) }),
|
|
123
|
+
/* @__PURE__ */ jsx(Pressable, { style: styles.secondary, onPress: done, accessibilityRole: "button", children: /* @__PURE__ */ jsx(Text, { style: styles.secondaryLabel, children: "Not now" }) })
|
|
124
|
+
] }) }) }) });
|
|
125
|
+
}
|
|
126
|
+
function makeStyles(color) {
|
|
127
|
+
return StyleSheet.create({
|
|
128
|
+
backdrop: {
|
|
129
|
+
flex: 1,
|
|
130
|
+
backgroundColor: "rgba(15,23,42,0.45)",
|
|
131
|
+
alignItems: "center",
|
|
132
|
+
justifyContent: "center",
|
|
133
|
+
padding: 24
|
|
134
|
+
},
|
|
135
|
+
card: {
|
|
136
|
+
width: "100%",
|
|
137
|
+
maxWidth: 420,
|
|
138
|
+
borderRadius: mobileTokens.radius.lg,
|
|
139
|
+
backgroundColor: color.surface,
|
|
140
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
141
|
+
borderColor: color.border,
|
|
142
|
+
padding: 24
|
|
143
|
+
},
|
|
144
|
+
eyebrow: {
|
|
145
|
+
fontSize: 12,
|
|
146
|
+
letterSpacing: 1,
|
|
147
|
+
textTransform: "uppercase",
|
|
148
|
+
color: color.textMuted,
|
|
149
|
+
marginBottom: 8
|
|
150
|
+
},
|
|
151
|
+
title: {
|
|
152
|
+
fontSize: 20,
|
|
153
|
+
fontWeight: "700",
|
|
154
|
+
color: color.text,
|
|
155
|
+
lineHeight: 26
|
|
156
|
+
},
|
|
157
|
+
body: {
|
|
158
|
+
marginTop: 10,
|
|
159
|
+
fontSize: 15,
|
|
160
|
+
lineHeight: 22,
|
|
161
|
+
color: color.textMuted
|
|
162
|
+
},
|
|
163
|
+
meta: {
|
|
164
|
+
marginTop: 12,
|
|
165
|
+
fontSize: 13,
|
|
166
|
+
color: color.textMuted
|
|
167
|
+
},
|
|
168
|
+
failure: {
|
|
169
|
+
marginTop: 12,
|
|
170
|
+
fontSize: 13,
|
|
171
|
+
lineHeight: 19,
|
|
172
|
+
color: color.dangerText
|
|
173
|
+
},
|
|
174
|
+
primary: {
|
|
175
|
+
marginTop: 20,
|
|
176
|
+
height: 50,
|
|
177
|
+
borderRadius: mobileTokens.radius.md,
|
|
178
|
+
backgroundColor: color.text,
|
|
179
|
+
alignItems: "center",
|
|
180
|
+
justifyContent: "center"
|
|
181
|
+
},
|
|
182
|
+
primaryBusy: {
|
|
183
|
+
opacity: 0.7
|
|
184
|
+
},
|
|
185
|
+
primaryLabel: {
|
|
186
|
+
fontSize: 15,
|
|
187
|
+
fontWeight: "600",
|
|
188
|
+
color: color.surface
|
|
189
|
+
},
|
|
190
|
+
secondary: {
|
|
191
|
+
marginTop: 10,
|
|
192
|
+
height: 44,
|
|
193
|
+
alignItems: "center",
|
|
194
|
+
justifyContent: "center"
|
|
195
|
+
},
|
|
196
|
+
secondaryLabel: {
|
|
197
|
+
fontSize: 14,
|
|
198
|
+
fontWeight: "500",
|
|
199
|
+
color: color.textMuted
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}export{InviteDeepLink};//# sourceMappingURL=InviteDeepLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InviteDeepLink.js","sources":["../../../src/features/invite/InviteDeepLink.tsx"],"sourcesContent":["/**\n * The invite link, on a phone.\n *\n * Mounted once at the app root (inside the Apollo + redux providers), this\n * watches for an inbound invite URL - cold start or while running - decodes it\n * against the same public `decodeInvitationToken` query the web page uses, and\n * shows who invited you to what before anything is accepted.\n *\n * It deliberately lives outside the navigator rather than as a screen: every\n * mobile route is org-scoped and auth-gated, and an invitee has neither an org\n * nor a session yet. A root-level sheet can therefore appear over the login\n * screen, survive the sign-in round trip (the token is parked in storage), and\n * finish the moment a session exists.\n */\nimport { isAuthenticatedSelector } from '@adminide-stack/user-auth0-client';\nimport { useApolloClient } from '@apollo/client';\nimport { useAcceptOrganizationInvitationMutation, useDecodeOrganizationInvitationQuery } from 'common/graphql';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { ActivityIndicator, Linking, Modal, Pressable, StyleSheet, Text, View } from 'react-native';\nimport { useSelector } from 'react-redux';\n\nimport { useAppTheme } from '../../theme/AppThemeProvider';\nimport { mobileColors, mobileTokens } from '../../theme/mobileTokens';\nimport { inviteTokenFromUrl } from './inviteLink';\nimport { clearPendingInvite, readPendingInvite, savePendingInvite } from './pendingInvite';\n\nexport function InviteDeepLink() {\n const { isDark } = useAppTheme();\n const color = mobileColors(isDark);\n const isAuthenticated = useSelector(isAuthenticatedSelector);\n const client = useApolloClient();\n\n const [token, setToken] = useState<string | null>(null);\n const [dismissed, setDismissed] = useState(false);\n const [failure, setFailure] = useState<string | null>(null);\n const [joined, setJoined] = useState<string | null>(null);\n // Set when the invitee taps \"Sign in to accept\": that is the accept\n // decision, made before the session existed. Once one does, we finish the\n // job rather than making them find the link again.\n const wantsAccept = useRef(false);\n\n useEffect(() => {\n let active = true;\n\n const adopt = (url: string | null) => {\n const next = inviteTokenFromUrl(url);\n if (!next || !active) return;\n setToken(next);\n setDismissed(false);\n setFailure(null);\n setJoined(null);\n void savePendingInvite(next);\n };\n\n // Cold start: the link that launched the app.\n void Linking.getInitialURL()\n .then(adopt)\n .catch(() => undefined);\n // Warm: a link tapped while the app is already running.\n const sub = Linking.addEventListener('url', ({ url }) => adopt(url));\n // A token parked before a sign-in round trip that took us out of the app.\n void readPendingInvite().then((parked) => {\n if (parked && active) setToken((current) => current ?? parked);\n });\n\n return () => {\n active = false;\n sub.remove();\n };\n }, []);\n\n const { data, loading } = useDecodeOrganizationInvitationQuery({\n variables: { token: token as string },\n skip: !token,\n fetchPolicy: 'network-only',\n errorPolicy: 'all',\n });\n\n const [accept, { loading: accepting }] = useAcceptOrganizationInvitationMutation();\n\n const decoded = data?.decodeInvitationToken;\n const invitation = decoded?.invitation;\n const orgName = decoded?.organization?.name ?? '';\n const invitedBy = invitation?.invitedBy?.username || invitation?.invitedBy?.email || '';\n const invitedEmail = invitation?.email ?? '';\n const decodeProblem = decoded?.error;\n\n const close = useCallback(() => {\n setDismissed(true);\n }, []);\n\n const done = useCallback(() => {\n setDismissed(true);\n setToken(null);\n void clearPendingInvite();\n }, []);\n\n const onAccept = useCallback(async () => {\n if (!invitation?.id) return;\n setFailure(null);\n try {\n await accept({ variables: { id: invitation.id } });\n await clearPendingInvite();\n setJoined(orgName || 'your team');\n // Membership changes what every org-scoped query returns, and those\n // are already in flight behind this sheet.\n try {\n await client.resetStore();\n } catch {\n /* the join stands even if the refetch storm does not */\n }\n } catch (e: any) {\n setFailure(e?.message || 'We could not accept this invitation. Please try again.');\n }\n }, [accept, client, invitation?.id, orgName]);\n\n const onSignIn = useCallback(() => {\n wantsAccept.current = true;\n // Closing reveals the app's own login screen behind the sheet.\n setDismissed(true);\n }, []);\n\n useEffect(() => {\n if (!isAuthenticated || !invitation?.id || !wantsAccept.current) return;\n wantsAccept.current = false;\n setDismissed(false);\n void onAccept();\n }, [isAuthenticated, invitation?.id, onAccept]);\n\n // Nothing to show until a token has decoded into a real invitation.\n if (!token || dismissed) return null;\n if (loading && !decoded) return null;\n\n const invalid = Boolean(decodeProblem) || !invitation?.id;\n const styles = makeStyles(color);\n\n return (\n <Modal transparent animationType=\"fade\" visible onRequestClose={close}>\n <View style={styles.backdrop}>\n <View style={styles.card}>\n {joined ? (\n <>\n <Text style={styles.title}>You're in</Text>\n <Text style={styles.body}>\n You joined {joined}. Everything you do here is scoped to it.\n </Text>\n <Pressable style={styles.primary} onPress={done} accessibilityRole=\"button\">\n <Text style={styles.primaryLabel}>Start using Yantra</Text>\n </Pressable>\n </>\n ) : invalid ? (\n <>\n <Text style={styles.title}>This invitation is no longer valid</Text>\n <Text style={styles.body}>\n {decodeProblem ||\n 'Invitations expire after seven days and can only be accepted once. Ask whoever invited you for a new link.'}\n </Text>\n <Pressable style={styles.secondary} onPress={done} accessibilityRole=\"button\">\n <Text style={styles.secondaryLabel}>Close</Text>\n </Pressable>\n </>\n ) : (\n <>\n <Text style={styles.eyebrow}>Invitation</Text>\n <Text style={styles.title}>\n {invitedBy ? `${invitedBy} invited you` : 'You have been invited'}\n {orgName ? ` to ${orgName}` : ''}\n </Text>\n <Text style={styles.body}>\n {isAuthenticated\n ? 'Accepting adds you to the workspace. You decide how much access you share, and you can leave or delete your data at any time.'\n : 'Sign in to accept. We will keep this invitation until you do.'}\n </Text>\n {invitedEmail ? <Text style={styles.meta}>Invited as {invitedEmail}</Text> : null}\n {failure ? <Text style={styles.failure}>{failure}</Text> : null}\n\n <Pressable\n style={[styles.primary, accepting && styles.primaryBusy]}\n onPress={isAuthenticated ? onAccept : onSignIn}\n disabled={accepting}\n accessibilityRole=\"button\"\n >\n {accepting ? (\n <ActivityIndicator color={color.surface} />\n ) : (\n <Text style={styles.primaryLabel}>\n {isAuthenticated ? 'Accept invitation' : 'Sign in to accept'}\n </Text>\n )}\n </Pressable>\n {/* \"Not now\" forgets the parked token: without that, a declined\n invitation would re-open this sheet on every launch for a week.\n The link itself still works if they change their mind. */}\n <Pressable style={styles.secondary} onPress={done} accessibilityRole=\"button\">\n <Text style={styles.secondaryLabel}>Not now</Text>\n </Pressable>\n </>\n )}\n </View>\n </View>\n </Modal>\n );\n}\n\nfunction makeStyles(color: ReturnType<typeof mobileColors>) {\n return StyleSheet.create({\n backdrop: {\n flex: 1,\n backgroundColor: 'rgba(15,23,42,0.45)',\n alignItems: 'center',\n justifyContent: 'center',\n padding: 24,\n },\n card: {\n width: '100%',\n maxWidth: 420,\n borderRadius: mobileTokens.radius.lg,\n backgroundColor: color.surface,\n borderWidth: StyleSheet.hairlineWidth,\n borderColor: color.border,\n padding: 24,\n },\n eyebrow: {\n fontSize: 12,\n letterSpacing: 1,\n textTransform: 'uppercase',\n color: color.textMuted,\n marginBottom: 8,\n },\n title: {\n fontSize: 20,\n fontWeight: '700',\n color: color.text,\n lineHeight: 26,\n },\n body: {\n marginTop: 10,\n fontSize: 15,\n lineHeight: 22,\n color: color.textMuted,\n },\n meta: {\n marginTop: 12,\n fontSize: 13,\n color: color.textMuted,\n },\n failure: {\n marginTop: 12,\n fontSize: 13,\n lineHeight: 19,\n color: color.dangerText,\n },\n primary: {\n marginTop: 20,\n height: 50,\n borderRadius: mobileTokens.radius.md,\n backgroundColor: color.text,\n alignItems: 'center',\n justifyContent: 'center',\n },\n primaryBusy: {\n opacity: 0.7,\n },\n primaryLabel: {\n fontSize: 15,\n fontWeight: '600',\n color: color.surface,\n },\n secondary: {\n marginTop: 10,\n height: 44,\n alignItems: 'center',\n justifyContent: 'center',\n },\n secondaryLabel: {\n fontSize: 14,\n fontWeight: '500',\n color: color.textMuted,\n },\n });\n}\n"],"names":[],"mappings":"2tBAwBO,SAAS,cAAiB,GAAA;AAxBjC,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA;AAyBE,EAAM,MAAA;AAAA,IACJ;AAAA,MACE,WAAY,EAAA;AAChB,EAAM,MAAA,KAAA,GAAQ,aAAa,MAAM,CAAA;AACjC,EAAM,MAAA,eAAA,GAAkB,YAAY,uBAAuB,CAAA;AAC3D,EAAA,MAAM,SAAS,eAAgB,EAAA;AAC/B,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAAwB,IAAI,CAAA;AACtD,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAChD,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAwB,IAAI,CAAA;AAC1D,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,SAAwB,IAAI,CAAA;AAIxD,EAAM,MAAA,WAAA,GAA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 @@
|
|
|
1
|
+
const INVITE_PATH = /(?:^|[/:])invit(?:e|ation)(?:$|[/?#])/i;
|
|
2
|
+
const TOKEN_KEYS = ["token", "t", "invite"];
|
|
3
|
+
function inviteTokenFromUrl(url) {
|
|
4
|
+
if (!url) return null;
|
|
5
|
+
const withoutFragment = String(url).split("#")[0];
|
|
6
|
+
const queryAt = withoutFragment.indexOf("?");
|
|
7
|
+
const path = queryAt === -1 ? withoutFragment : withoutFragment.slice(0, queryAt);
|
|
8
|
+
if (!INVITE_PATH.test(path)) return null;
|
|
9
|
+
if (queryAt === -1) return null;
|
|
10
|
+
const pairs = withoutFragment.slice(queryAt + 1).split("&");
|
|
11
|
+
const found = {};
|
|
12
|
+
for (const pair of pairs) {
|
|
13
|
+
if (!pair) continue;
|
|
14
|
+
const eq = pair.indexOf("=");
|
|
15
|
+
if (eq === -1) continue;
|
|
16
|
+
const key = decodeURIComponent(pair.slice(0, eq)).trim();
|
|
17
|
+
if (!TOKEN_KEYS.includes(key) || found[key]) continue;
|
|
18
|
+
const value = decodeURIComponent(pair.slice(eq + 1)).trim();
|
|
19
|
+
if (value) found[key] = value;
|
|
20
|
+
}
|
|
21
|
+
for (const key of TOKEN_KEYS) {
|
|
22
|
+
if (found[key]) return found[key];
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
function isInviteUrl(url) {
|
|
27
|
+
return inviteTokenFromUrl(url) !== null;
|
|
28
|
+
}export{inviteTokenFromUrl,isInviteUrl};//# sourceMappingURL=inviteLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inviteLink.js","sources":["../../../src/features/invite/inviteLink.ts"],"sourcesContent":["/**\n * Reading an invitation out of an inbound deep link.\n *\n * The same invite link has to work whatever carries it: the canonical\n * `https://yantra.app/invitation?token=<JWT>` the backend mints into email\n * (universal link), the short `/invite?t=` alias, the app's own custom schemes\n * (`yantraapp://`, `com.cdebase.yantra://`), and the `exp://…/--/invite?t=` form\n * Expo Go hands us in development.\n *\n * Hand-parsed rather than `new URL(...)`: React Native's URL is partial (no\n * `searchParams` without a polyfill) and silently throws on the custom schemes,\n * which is exactly the case that must not fail.\n */\n\n/** `/invite` or `/invitation` as a whole path segment - not `/invite-friends`. */\nconst INVITE_PATH = /(?:^|[/:])invit(?:e|ation)(?:$|[/?#])/i;\n\n/** Query keys an invite link may carry; `token` is what the backend mints. */\nconst TOKEN_KEYS = ['token', 't', 'invite'];\n\nexport function inviteTokenFromUrl(url: string | null | undefined): string | null {\n if (!url) return null;\n const withoutFragment = String(url).split('#')[0];\n const queryAt = withoutFragment.indexOf('?');\n const path = queryAt === -1 ? withoutFragment : withoutFragment.slice(0, queryAt);\n if (!INVITE_PATH.test(path)) return null;\n if (queryAt === -1) return null;\n\n const pairs = withoutFragment.slice(queryAt + 1).split('&');\n const found: Record<string, string> = {};\n for (const pair of pairs) {\n if (!pair) continue;\n const eq = pair.indexOf('=');\n if (eq === -1) continue;\n const key = decodeURIComponent(pair.slice(0, eq)).trim();\n if (!TOKEN_KEYS.includes(key) || found[key]) continue;\n const value = decodeURIComponent(pair.slice(eq + 1)).trim();\n if (value) found[key] = value;\n }\n for (const key of TOKEN_KEYS) {\n if (found[key]) return found[key];\n }\n return null;\n}\n\n/** True when a URL is an invite link at all - used to decide whether to swallow it. */\nexport function isInviteUrl(url: string | null | undefined): boolean {\n return inviteTokenFromUrl(url) !== null;\n}\n"],"names":[],"mappings":"AAeA,MAAM,WAAc,GAAA,wCAAA;AAGpB,MAAM,UAAa,GAAA,CAAC,OAAS,EAAA,GAAA,EAAK,QAAQ,CAAA;AACnC,SAAS,mBAAmB,GAA+C,EAAA;AAChF,EAAI,IAAA,CAAC,KAAY,OAAA,IAAA;AACjB,EAAA,MAAM,kBAAkB,MAAO,CAAA,GAAG,EAAE,KAAM,CAAA,GAAG,EAAE,CAAC,CAAA;AAChD,EAAM,MAAA,OAAA,GAAU,eAAgB,CAAA,OAAA,CAAQ,GAAG,CAAA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24 * 60 * 60 * 1e3;
|
|
3
|
+
const STORAGE_KEY = "yantra.invite.pending";
|
|
4
|
+
let AsyncStorage = null;
|
|
5
|
+
try {
|
|
6
|
+
AsyncStorage = (_a = require("@react-native-async-storage/async-storage").default) != null ? _a : null;
|
|
7
|
+
} catch (e) {
|
|
8
|
+
AsyncStorage = null;
|
|
9
|
+
}
|
|
10
|
+
async function savePendingInvite(token, now = Date.now()) {
|
|
11
|
+
if (!AsyncStorage || !token) return;
|
|
12
|
+
try {
|
|
13
|
+
await AsyncStorage.setItem(STORAGE_KEY, JSON.stringify({
|
|
14
|
+
token,
|
|
15
|
+
savedAt: now
|
|
16
|
+
}));
|
|
17
|
+
} catch (e) {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async function readPendingInvite(now = Date.now()) {
|
|
21
|
+
if (!AsyncStorage) return null;
|
|
22
|
+
try {
|
|
23
|
+
const raw = await AsyncStorage.getItem(STORAGE_KEY);
|
|
24
|
+
if (!raw) return null;
|
|
25
|
+
const parsed = JSON.parse(raw);
|
|
26
|
+
if (!(parsed == null ? void 0 : parsed.token) || typeof parsed.token !== "string") return null;
|
|
27
|
+
if (typeof parsed.savedAt !== "number" || now - parsed.savedAt > PENDING_INVITE_TTL_MS) {
|
|
28
|
+
await clearPendingInvite();
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return parsed.token;
|
|
32
|
+
} catch (e) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async function clearPendingInvite() {
|
|
37
|
+
if (!AsyncStorage) return;
|
|
38
|
+
try {
|
|
39
|
+
await AsyncStorage.removeItem(STORAGE_KEY);
|
|
40
|
+
} catch (e) {
|
|
41
|
+
}
|
|
42
|
+
}export{PENDING_INVITE_TTL_MS,clearPendingInvite,readPendingInvite,savePendingInvite};//# sourceMappingURL=pendingInvite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pendingInvite.js","sources":["../../../src/features/invite/pendingInvite.ts"],"sourcesContent":["/**\n * An invite token parked across the sign-in round trip.\n *\n * Tapping an invite link on a phone with no session sends the invitee through\n * login, and on iOS that can mean leaving the app entirely (Auth0's browser\n * tab). Whatever happens in between, the token has to survive - otherwise the\n * invitee comes back signed in but not a member, with nothing on screen\n * explaining why.\n *\n * Stored tokens expire with the invitation itself (7 days, set by\n * account-api-server when the JWT is signed), so a link that was never used\n * cannot resurface months later as a confusing prompt.\n */\n\n/** Matches the invitation JWT's own `expiresIn: '7d'`. */\nexport const PENDING_INVITE_TTL_MS = 7 * 24 * 60 * 60 * 1000;\n\nconst STORAGE_KEY = 'yantra.invite.pending';\n\ntype StorageLike = {\n getItem(key: string): Promise<string | null>;\n setItem(key: string, value: string): Promise<void>;\n removeItem(key: string): Promise<void>;\n};\n\nlet AsyncStorage: StorageLike | null = null;\ntry {\n // eslint-disable-next-line @typescript-eslint/no-require-imports, global-require\n AsyncStorage = require('@react-native-async-storage/async-storage').default ?? null;\n} catch {\n AsyncStorage = null;\n}\n\nexport interface PendingInvite {\n token: string;\n savedAt: number;\n}\n\nexport async function savePendingInvite(token: string, now = Date.now()): Promise<void> {\n if (!AsyncStorage || !token) return;\n try {\n await AsyncStorage.setItem(STORAGE_KEY, JSON.stringify({ token, savedAt: now }));\n } catch {\n /* best-effort: a lost token costs a re-tap, a thrown one costs the launch */\n }\n}\n\nexport async function readPendingInvite(now = Date.now()): Promise<string | null> {\n if (!AsyncStorage) return null;\n try {\n const raw = await AsyncStorage.getItem(STORAGE_KEY);\n if (!raw) return null;\n const parsed = JSON.parse(raw) as Partial<PendingInvite>;\n if (!parsed?.token || typeof parsed.token !== 'string') return null;\n if (typeof parsed.savedAt !== 'number' || now - parsed.savedAt > PENDING_INVITE_TTL_MS) {\n await clearPendingInvite();\n return null;\n }\n return parsed.token;\n } catch {\n return null;\n }\n}\n\nexport async function clearPendingInvite(): Promise<void> {\n if (!AsyncStorage) return;\n try {\n await AsyncStorage.removeItem(STORAG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AAO,MAAO,CAAA,OAAA,KAAY,YAAY,GAAM,GAAA,MAAA,CAAO,UAAU,qBAAuB,EAAA;AACtF,MAAA,MAAM,kBAAmB,EAAA;AACzB,MAAO,OAAA,IAAA;AAAA;AAET,IAAA,OAAO,MAAO,CAAA,KAAA;AAAA,GACR,CAAA,OAAA,CAAA,EAAA;AACN,IAAO,OAAA,IAAA;AAAA;AAEX;AACA,eAAsB,kBAAoC,GAAA;AACxD,EAAA,IAAI,CAAC,YAAc,EAAA;AACnB,EAAI,IAAA;AACF,IAAM,MAAA,YAAA,CAAa,WAAW,WAAW,CAAA;AAAA,GACnC,CAAA,OAAA,CAAA,EAAA;AAAA;AAGV"}
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {Feature}from'@common-stack/client-react';import YantraMobileModule from'./module.js';export{default as Home}from'./screens/Home/HomeScreen.js';export{default as NewChat}from'./screens/NewChat/index.js';export{default as Account}from'./screens/Account/index.js';export{default as ChatHistory}from'./screens/ChatHistory/index.js';export{default as Apps}from'./screens/Apps/index.js';export{default as WebBuilder}from'./screens/WebBuilder/index.js';export{GatewayContextProvider,useGatewayContext}from'./contexts/GatewayContext.js';export{CdecliConnectionProvider,useCdecliConnection}from'./contexts/CdecliConnectionContext.js';export{ChatLiveStreamEngine}from'./contexts/ChatLiveStreamContext.js';export{MemoryPressureResponder}from'./features/memory/MemoryPressureResponder.js';export{BUILTIN_MOBILE_GATEWAYS,MAX_CONCURRENT_TASKS,STORAGE_KEYS}from'./config/constants.js';export{config}from'./config/env-config.js';export{useCdecliAutoConnect}from'./hooks/useCdecliAutoConnect.js';export{useObtainSystemToken}from'./hooks/useObtainSystemToken.js';export{appendSurfaceAuthParams,buildCdecliTokenInjection,buildSurfaceGateRecoveryScript,mintSurfaceSystemToken,resolveSurfaceCatalogBackend}from'./hooks/mintSurfaceSystemToken.js';export{isInstanceNotFoundError,useGatewayConnection}from'./hooks/useGatewayConnection.js';export{usePrerequisiteIds}from'./hooks/usePrerequisiteIds.js';export{useWorkspaceProvisioner}from'./hooks/useWorkspaceProvisioner.js';export{useGatewayRegistry}from'./hooks/useGatewayRegistry.js';export{agentSessionManager}from'./services/agentSessionManager.js';export{ensureGatewayApiKeys,resetGatewayApiKeyBridge}from'./services/gatewayApiKeyBridge.js';export{GatewayClient}from'./services/gatewayClient.js';export{BRIDGE_PROTOCOL_VERSION,BRIDGE_READY_ACTION,DEFAULT_BRIDGE_TIMEOUT_MS,DEFAULT_CHUNK_SIZE,MessageType}from'./bridge/types.js';export{WebViewManager}from'./bridge/WebViewManager.js';export{NativeWebViewBridge}from'./bridge/NativeWebViewBridge.js';export{TypedBridge}from'./bridge/TypedBridge.js';export{CancellableRequest}from'./bridge/CancellableRequest.js';export{ChunkedMessageHandler}from'./bridge/ChunkedMessageHandler.js';export{BridgeDebugger}from'./bridge/BridgeDebugger.js';export{WEB_BRIDGE_BOOTSTRAP}from'./bridge/webBridgeBootstrap.js';export{AuthenticatedFetch}from'./bridge/AuthenticatedFetch.js';export{AuthBridgeHandler}from'./bridge/handlers/AuthBridgeHandler.js';export{NavigationBridgeHandler}from'./bridge/handlers/NavigationBridgeHandler.js';export{AnalyticsBridgeHandler}from'./bridge/handlers/AnalyticsBridgeHandler.js';export{getPackagerHost,resolveMobileWebUrl}from'./bridge/resolveMobileWebUrl.js';export{YANTRA_LOADER_SIZE_COMPACT,YANTRA_LOADER_SIZE_DEFAULT,YantraBrandLoader}from'./components/YantraBrandLoader.js';export{default as CustomDrawer}from'./components/CustomDrawer.js';export{AppThemeProvider,useAppTheme}from'./theme/AppThemeProvider.js';export{isKeyboardControllerAvailable}from'./utils/keyboardController.js';export{getNativeCanvasExperience,getNativeCanvasViewer,preloadNativeCanvasExperience,registerCanvasExperiencePreload,registerNativeCanvasExperience,registerNativeCanvasViewer}from'./features/canvas/nativeViewerRegistry.js';export{getNativeCharactersExperience,registerNativeCharactersExperience}from'./features/characters/nativeCharactersRegistry.js';export{getNativeChatExperience,registerNativeChatExperience}from'./features/messaging/nativeChatRegistry.js';export{getNativeShoppingExperience,preloadNativeShoppingExperience,registerNativeShoppingExperience,registerShoppingExperiencePreload}from'./features/shopping/nativeShoppingRegistry.js';export{getNativeTravelExperience,preloadNativeTravelExperience,registerNativeTravelExperience,registerTravelExperiencePreload}from'./features/travel/nativeTravelRegistry.js';export{getNativeJobSearchExperience,preloadNativeJobSearchExperience,registerJobSearchExperiencePreload,registerNativeJobSearchExperience}from'./features/job-search/nativeJobSearchRegistry.js';export{getNativeResumeExperience,preloadNativeResumeExperience,registerNativeResumeExperience,registerResumeExperiencePreload}from'./features/resume/nativeResumeRegistry.js';export{NativeAgentChat}from'./features/agent-chat/NativeAgentChat.js';export{resolveSurfaceAuthGraphqlUrl}from'./hooks/resolveSurfaceAuthGraphqlUrl.js';var index = new Feature(YantraMobileModule);export{index as default};//# sourceMappingURL=index.js.map
|
|
1
|
+
import {Feature}from'@common-stack/client-react';import YantraMobileModule from'./module.js';export{default as Home}from'./screens/Home/HomeScreen.js';export{default as NewChat}from'./screens/NewChat/index.js';export{default as Account}from'./screens/Account/index.js';export{default as ChatHistory}from'./screens/ChatHistory/index.js';export{default as Apps}from'./screens/Apps/index.js';export{default as WebBuilder}from'./screens/WebBuilder/index.js';export{GatewayContextProvider,useGatewayContext}from'./contexts/GatewayContext.js';export{CdecliConnectionProvider,useCdecliConnection}from'./contexts/CdecliConnectionContext.js';export{ChatLiveStreamEngine}from'./contexts/ChatLiveStreamContext.js';export{MemoryPressureResponder}from'./features/memory/MemoryPressureResponder.js';export{BUILTIN_MOBILE_GATEWAYS,MAX_CONCURRENT_TASKS,STORAGE_KEYS}from'./config/constants.js';export{config}from'./config/env-config.js';export{useCdecliAutoConnect}from'./hooks/useCdecliAutoConnect.js';export{useObtainSystemToken}from'./hooks/useObtainSystemToken.js';export{appendSurfaceAuthParams,buildCdecliTokenInjection,buildSurfaceGateRecoveryScript,mintSurfaceSystemToken,resolveSurfaceCatalogBackend}from'./hooks/mintSurfaceSystemToken.js';export{isInstanceNotFoundError,useGatewayConnection}from'./hooks/useGatewayConnection.js';export{usePrerequisiteIds}from'./hooks/usePrerequisiteIds.js';export{useWorkspaceProvisioner}from'./hooks/useWorkspaceProvisioner.js';export{useGatewayRegistry}from'./hooks/useGatewayRegistry.js';export{agentSessionManager}from'./services/agentSessionManager.js';export{ensureGatewayApiKeys,resetGatewayApiKeyBridge}from'./services/gatewayApiKeyBridge.js';export{GatewayClient}from'./services/gatewayClient.js';export{BRIDGE_PROTOCOL_VERSION,BRIDGE_READY_ACTION,DEFAULT_BRIDGE_TIMEOUT_MS,DEFAULT_CHUNK_SIZE,MessageType}from'./bridge/types.js';export{WebViewManager}from'./bridge/WebViewManager.js';export{NativeWebViewBridge}from'./bridge/NativeWebViewBridge.js';export{TypedBridge}from'./bridge/TypedBridge.js';export{CancellableRequest}from'./bridge/CancellableRequest.js';export{ChunkedMessageHandler}from'./bridge/ChunkedMessageHandler.js';export{BridgeDebugger}from'./bridge/BridgeDebugger.js';export{WEB_BRIDGE_BOOTSTRAP}from'./bridge/webBridgeBootstrap.js';export{AuthenticatedFetch}from'./bridge/AuthenticatedFetch.js';export{AuthBridgeHandler}from'./bridge/handlers/AuthBridgeHandler.js';export{NavigationBridgeHandler}from'./bridge/handlers/NavigationBridgeHandler.js';export{AnalyticsBridgeHandler}from'./bridge/handlers/AnalyticsBridgeHandler.js';export{getPackagerHost,resolveMobileWebUrl}from'./bridge/resolveMobileWebUrl.js';export{YANTRA_LOADER_SIZE_COMPACT,YANTRA_LOADER_SIZE_DEFAULT,YantraBrandLoader}from'./components/YantraBrandLoader.js';export{default as CustomDrawer}from'./components/CustomDrawer.js';export{AppThemeProvider,useAppTheme}from'./theme/AppThemeProvider.js';export{InviteDeepLink}from'./features/invite/InviteDeepLink.js';export{inviteTokenFromUrl,isInviteUrl}from'./features/invite/inviteLink.js';export{isKeyboardControllerAvailable}from'./utils/keyboardController.js';export{getNativeCanvasExperience,getNativeCanvasViewer,preloadNativeCanvasExperience,registerCanvasExperiencePreload,registerNativeCanvasExperience,registerNativeCanvasViewer}from'./features/canvas/nativeViewerRegistry.js';export{getNativeCharactersExperience,registerNativeCharactersExperience}from'./features/characters/nativeCharactersRegistry.js';export{getNativeChatExperience,registerNativeChatExperience}from'./features/messaging/nativeChatRegistry.js';export{getNativeShoppingExperience,preloadNativeShoppingExperience,registerNativeShoppingExperience,registerShoppingExperiencePreload}from'./features/shopping/nativeShoppingRegistry.js';export{getNativeTravelExperience,preloadNativeTravelExperience,registerNativeTravelExperience,registerTravelExperiencePreload}from'./features/travel/nativeTravelRegistry.js';export{getNativeJobSearchExperience,preloadNativeJobSearchExperience,registerJobSearchExperiencePreload,registerNativeJobSearchExperience}from'./features/job-search/nativeJobSearchRegistry.js';export{getNativeResumeExperience,preloadNativeResumeExperience,registerNativeResumeExperience,registerResumeExperiencePreload}from'./features/resume/nativeResumeRegistry.js';export{NativeAgentChat}from'./features/agent-chat/NativeAgentChat.js';export{resolveSurfaceAuthGraphqlUrl}from'./hooks/resolveSurfaceAuthGraphqlUrl.js';var index = new Feature(YantraMobileModule);export{index as default};//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { Feature } from '@common-stack/client-react';\nimport YantraMobileModule from './module';\n\nexport default new Feature(YantraMobileModule);\nexport * from './screens';\nexport { GatewayContextProvider, useGatewayContext } from './contexts/GatewayContext';\nexport { CdecliConnectionProvider, useCdecliConnection } from './contexts/CdecliConnectionContext';\nexport { ChatLiveStreamEngine } from './contexts/ChatLiveStreamContext';\nexport { MemoryPressureResponder } from './features/memory/MemoryPressureResponder';\nexport * from './config/constants';\nexport { config } from './config/env-config';\nexport { useCdecliAutoConnect } from './hooks/useCdecliAutoConnect';\nexport { useObtainSystemToken } from './hooks/useObtainSystemToken';\nexport {\n mintSurfaceSystemToken,\n appendSurfaceAuthParams,\n buildCdecliTokenInjection,\n buildSurfaceGateRecoveryScript,\n resolveSurfaceCatalogBackend,\n resolveSurfaceAuthGraphqlUrl,\n} from './hooks/mintSurfaceSystemToken';\nexport { useGatewayConnection, isInstanceNotFoundError } from './hooks/useGatewayConnection';\nexport { usePrerequisiteIds } from './hooks/usePrerequisiteIds';\nexport { useWorkspaceProvisioner } from './hooks/useWorkspaceProvisioner';\nexport { useGatewayRegistry } from './hooks/useGatewayRegistry';\nexport * from './services';\nexport * from './bridge';\nexport {\n YantraBrandLoader,\n YANTRA_LOADER_SIZE_DEFAULT,\n YANTRA_LOADER_SIZE_COMPACT,\n} from './components/YantraBrandLoader';\nexport { default as CustomDrawer } from './components/CustomDrawer';\nexport { AppThemeProvider, useAppTheme } from './theme/AppThemeProvider';\nexport { isKeyboardControllerAvailable } from './utils/keyboardController';\n// The canvas viewer seam. Exported from the index on purpose: the app (the MF\n// host) registers the federated viewer here and the CanvasBoard screen reads\n// it. Reachability from this entry is what makes rollup emit the registry as a\n// real shared module - as an internal-only file, `registerNativeCanvasViewer`\n// is never called inside the package, so rollup tree-shakes it and constant-\n// folds the screen down to its fallback branch.\nexport {\n registerNativeCanvasViewer,\n getNativeCanvasViewer,\n registerNativeCanvasExperience,\n getNativeCanvasExperience,\n registerCanvasExperiencePreload,\n preloadNativeCanvasExperience,\n} from './features/canvas/nativeViewerRegistry';\n// Characters seam - same reachability contract as the canvas registry above.\nexport {\n registerNativeCharactersExperience,\n getNativeCharactersExperience,\n} from './features/characters/nativeCharactersRegistry';\n// Chat seam - same reachability contract as the two registries above.\nexport { registerNativeChatExperience, getNativeChatExperience } from './features/messaging/nativeChatRegistry';\nexport {\n registerNativeShoppingExperience,\n getNativeShoppingExperience,\n registerShoppingExperiencePreload,\n preloadNativeShoppingExperience,\n} from './features/shopping/nativeShoppingRegistry';\nexport type { ShoppingExperienceProps } from './features/shopping/ShoppingExperience';\nexport type { ShoppingHostChat } from './features/shopping/hostChat';\nexport {\n registerNativeTravelExperience,\n getNativeTravelExperience,\n registerTravelExperiencePreload,\n preloadNativeTravelExperience,\n} from './features/travel/nativeTravelRegistry';\nexport type { TravelExperienceProps } from './features/travel/TravelExperience';\nexport type { TravelHostChat } from './features/travel/hostChat';\nexport {\n registerNativeJobSearchExperience,\n getNativeJobSearchExperience,\n registerJobSearchExperiencePreload,\n preloadNativeJobSearchExperience,\n} from './features/job-search/nativeJobSearchRegistry';\nexport type { JobSearchExperienceProps } from './features/job-search/JobSearchExperience';\nexport type { JobSearchHostChat } from './features/job-search/hostChat';\nexport {\n registerNativeResumeExperience,\n getNativeResumeExperience,\n registerResumeExperiencePreload,\n preloadNativeResumeExperience,\n} from './features/resume/nativeResumeRegistry';\nexport type { ResumeExperienceProps } from './features/resume/ResumeExperience';\nexport type { ResumeHostChat } from './features/resume/hostChat';\nexport { NativeAgentChat } from './features/agent-chat';\nexport type { AgentChatMessage, AgentChatSuggestion, NativeAgentChatProps } from './features/agent-chat';\nexport type {\n ChatHostServices,\n ChatViewer,\n FederatedChatProps,\n NativeChatExperienceProps,\n} from './features/messaging/chatHost';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { Feature } from '@common-stack/client-react';\nimport YantraMobileModule from './module';\n\nexport default new Feature(YantraMobileModule);\nexport * from './screens';\nexport { GatewayContextProvider, useGatewayContext } from './contexts/GatewayContext';\nexport { CdecliConnectionProvider, useCdecliConnection } from './contexts/CdecliConnectionContext';\nexport { ChatLiveStreamEngine } from './contexts/ChatLiveStreamContext';\nexport { MemoryPressureResponder } from './features/memory/MemoryPressureResponder';\nexport * from './config/constants';\nexport { config } from './config/env-config';\nexport { useCdecliAutoConnect } from './hooks/useCdecliAutoConnect';\nexport { useObtainSystemToken } from './hooks/useObtainSystemToken';\nexport {\n mintSurfaceSystemToken,\n appendSurfaceAuthParams,\n buildCdecliTokenInjection,\n buildSurfaceGateRecoveryScript,\n resolveSurfaceCatalogBackend,\n resolveSurfaceAuthGraphqlUrl,\n} from './hooks/mintSurfaceSystemToken';\nexport { useGatewayConnection, isInstanceNotFoundError } from './hooks/useGatewayConnection';\nexport { usePrerequisiteIds } from './hooks/usePrerequisiteIds';\nexport { useWorkspaceProvisioner } from './hooks/useWorkspaceProvisioner';\nexport { useGatewayRegistry } from './hooks/useGatewayRegistry';\nexport * from './services';\nexport * from './bridge';\nexport {\n YantraBrandLoader,\n YANTRA_LOADER_SIZE_DEFAULT,\n YANTRA_LOADER_SIZE_COMPACT,\n} from './components/YantraBrandLoader';\nexport { default as CustomDrawer } from './components/CustomDrawer';\nexport { AppThemeProvider, useAppTheme } from './theme/AppThemeProvider';\n// Invite deep links. Mounted by the app at the root (see portable-devices/mobile\n// App.tsx) rather than routed to: the invitee has neither an org nor a session,\n// and every mobile route requires both.\nexport { InviteDeepLink } from './features/invite/InviteDeepLink';\nexport { inviteTokenFromUrl, isInviteUrl } from './features/invite/inviteLink';\nexport { isKeyboardControllerAvailable } from './utils/keyboardController';\n// The canvas viewer seam. Exported from the index on purpose: the app (the MF\n// host) registers the federated viewer here and the CanvasBoard screen reads\n// it. Reachability from this entry is what makes rollup emit the registry as a\n// real shared module - as an internal-only file, `registerNativeCanvasViewer`\n// is never called inside the package, so rollup tree-shakes it and constant-\n// folds the screen down to its fallback branch.\nexport {\n registerNativeCanvasViewer,\n getNativeCanvasViewer,\n registerNativeCanvasExperience,\n getNativeCanvasExperience,\n registerCanvasExperiencePreload,\n preloadNativeCanvasExperience,\n} from './features/canvas/nativeViewerRegistry';\n// Characters seam - same reachability contract as the canvas registry above.\nexport {\n registerNativeCharactersExperience,\n getNativeCharactersExperience,\n} from './features/characters/nativeCharactersRegistry';\n// Chat seam - same reachability contract as the two registries above.\nexport { registerNativeChatExperience, getNativeChatExperience } from './features/messaging/nativeChatRegistry';\nexport {\n registerNativeShoppingExperience,\n getNativeShoppingExperience,\n registerShoppingExperiencePreload,\n preloadNativeShoppingExperience,\n} from './features/shopping/nativeShoppingRegistry';\nexport type { ShoppingExperienceProps } from './features/shopping/ShoppingExperience';\nexport type { ShoppingHostChat } from './features/shopping/hostChat';\nexport {\n registerNativeTravelExperience,\n getNativeTravelExperience,\n registerTravelExperiencePreload,\n preloadNativeTravelExperience,\n} from './features/travel/nativeTravelRegistry';\nexport type { TravelExperienceProps } from './features/travel/TravelExperience';\nexport type { TravelHostChat } from './features/travel/hostChat';\nexport {\n registerNativeJobSearchExperience,\n getNativeJobSearchExperience,\n registerJobSearchExperiencePreload,\n preloadNativeJobSearchExperience,\n} from './features/job-search/nativeJobSearchRegistry';\nexport type { JobSearchExperienceProps } from './features/job-search/JobSearchExperience';\nexport type { JobSearchHostChat } from './features/job-search/hostChat';\nexport {\n registerNativeResumeExperience,\n getNativeResumeExperience,\n registerResumeExperiencePreload,\n preloadNativeResumeExperience,\n} from './features/resume/nativeResumeRegistry';\nexport type { ResumeExperienceProps } from './features/resume/ResumeExperience';\nexport type { ResumeHostChat } from './features/resume/hostChat';\nexport { NativeAgentChat } from './features/agent-chat';\nexport type { AgentChatMessage, AgentChatSuggestion, NativeAgentChatProps } from './features/agent-chat';\nexport type {\n ChatHostServices,\n ChatViewer,\n FederatedChatProps,\n NativeChatExperienceProps,\n} from './features/messaging/chatHost';\n"],"names":[],"mappings":"s3IAEA,YAAe,IAAI,QAAQ,kBAAkB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminide-stack/yantra-mobile",
|
|
3
|
-
"version": "12.0.64-alpha.
|
|
3
|
+
"version": "12.0.64-alpha.3",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"uuid": "^9.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"common": "12.0.64-alpha.
|
|
28
|
+
"common": "12.0.64-alpha.3"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@admin-layout/gluestack-ui-mobile": "*",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@messenger-box/platform-mobile": "*",
|
|
42
42
|
"@react-native-async-storage/async-storage": "*",
|
|
43
43
|
"@react-navigation/native": "*",
|
|
44
|
-
"common": "12.0.64-alpha.
|
|
44
|
+
"common": "12.0.64-alpha.2",
|
|
45
45
|
"expo-constants": "*",
|
|
46
46
|
"expo-secure-store": "*",
|
|
47
47
|
"lodash": "*",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"typescript": {
|
|
58
58
|
"definition": "lib/index.d.ts"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "2466ea826d831bdae73023560305d3a7c3ba8e7f"
|
|
61
61
|
}
|