Fix more build errors

This commit is contained in:
Darren Clarke 2023-03-15 12:17:43 +00:00
parent 1bdc1e60db
commit 30ce47826f
61 changed files with 1161 additions and 541 deletions

View file

@ -1,8 +1,4 @@
module.exports = {
i18n: {
locales: ["en", "fr"],
defaultLocale: "en",
},
rewrites: async () => ({
beforeFiles: [
{

View file

@ -18,13 +18,13 @@
"@fontsource/playfair-display": "^4.5.13",
"@fontsource/poppins": "^4.5.10",
"@fontsource/roboto": "^4.5.8",
"graphql-request": "^5.2.0",
"@mui/icons-material": "^5",
"@mui/lab": "^5.0.0-alpha.118",
"@mui/material": "^5",
"@mui/x-data-grid-pro": "^5.17.22",
"@mui/x-date-pickers-pro": "^5.0.17",
"date-fns": "^2.29.3",
"graphql-request": "^5.2.0",
"http-proxy-middleware": "^2.0.6",
"material-ui-popup-state": "^5.0.4",
"next": "^13.1",
@ -34,6 +34,7 @@
"react-dom": "^18",
"react-iframe": "^1.8.5",
"react-polyglot": "^0.7.2",
"sharp": "^0.30.7",
"swr": "^2.0.3"
},
"devDependencies": {

View file

@ -1,10 +1,11 @@
// @ts-nocheck
import { FC } from "react";
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import Iframe from "react-iframe";
const Metamigo = () => (
const Metamigo: FC = () => (
<Layout>
<Head>
<title>Link Shell</title>

View file

@ -1,9 +1,10 @@
import { FC } from "react";
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { ZammadWrapper } from "components/ZammadWrapper";
const Link = () => (
const Zammad: FC = () => (
<Layout>
<Head>
<title>Link Shell</title>
@ -21,13 +22,10 @@ const Link = () => (
width: "100%",
}}
>
<ZammadWrapper
path="/#manage"
hideSidebar={false}
/>
<ZammadWrapper path="/#manage" hideSidebar={false} />
</Grid>
</Grid>
</Layout>
);
export default Link;
export default Zammad;

View file

@ -1,11 +1,11 @@
// @ts-nocheck
import { useState } from "react";
import { FC, useState } from "react";
import Head from "next/head";
import { Grid, Button } from "@mui/material";
import { Layout } from "components/Layout";
import Iframe from "react-iframe";
const Leafcutter = () => {
const About: FC = () => {
const [leafcutterURL, setLeafcutterURL] = useState(
"https://lc.digiresilience.org/about"
);
@ -34,4 +34,4 @@ const Leafcutter = () => {
);
};
export default Leafcutter;
export default About;

View file

@ -1,11 +1,11 @@
// @ts-nocheck
import { useState } from "react";
import { FC, useState } from "react";
import Head from "next/head";
import { Grid, Button } from "@mui/material";
import { Layout } from "components/Layout";
import Iframe from "react-iframe";
const Leafcutter = () => {
const Create: FC = () => {
const [leafcutterURL, setLeafcutterURL] = useState(
"https://lc.digiresilience.org/create"
);
@ -34,4 +34,4 @@ const Leafcutter = () => {
);
};
export default Leafcutter;
export default Create;

View file

@ -1,11 +1,11 @@
// @ts-nocheck
import { useState } from "react";
import { FC, useState } from "react";
import Head from "next/head";
import { Grid, Button } from "@mui/material";
import { Layout } from "components/Layout";
import Iframe from "react-iframe";
const Leafcutter = () => {
const FAQ: FC = () => {
const [leafcutterURL, setLeafcutterURL] = useState(
"https://lc.digiresilience.org/faq"
);
@ -34,4 +34,4 @@ const Leafcutter = () => {
);
};
export default Leafcutter;
export default FAQ;

View file

@ -1,11 +1,11 @@
// @ts-nocheck
import { useState } from "react";
import { FC, useState } from "react";
import Head from "next/head";
import { Grid, Button } from "@mui/material";
import { Layout } from "components/Layout";
import Iframe from "react-iframe";
const Leafcutter = () => {
const Leafcutter: FC = () => {
const [leafcutterURL, setLeafcutterURL] = useState(
"https://lc.digiresilience.org"
);

View file

@ -1,11 +1,11 @@
// @ts-nocheck
import { useState } from "react";
import { FC, useState } from "react";
import Head from "next/head";
import { Grid, Button } from "@mui/material";
import { Layout } from "components/Layout";
import Iframe from "react-iframe";
const Leafcutter = () => {
const Trends: FC = () => {
const [leafcutterURL, setLeafcutterURL] = useState(
"https://lc.digiresilience.org/trends"
);
@ -34,4 +34,4 @@ const Leafcutter = () => {
);
};
export default Leafcutter;
export default Trends;

View file

@ -1,9 +1,10 @@
import { NextPage } from "next";
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { ZammadWrapper } from "components/ZammadWrapper";
const Profile = () => (
const Profile: NextPage = () => (
<Layout>
<Head>
<title>Link Shell</title>
@ -21,10 +22,7 @@ const Profile = () => (
width: "100%",
}}
>
<ZammadWrapper
path="/#profile"
hideSidebar={false}
/>
<ZammadWrapper path="/#profile" hideSidebar={false} />
</Grid>
</Grid>
</Layout>

View file

@ -3,26 +3,26 @@ import Head from "next/head";
import useSWR from "swr";
import { request, gql } from "graphql-request";
import { NextPage } from "next";
import { Grid, } from "@mui/material";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { TicketDetail } from "components/TicketDetail";
import { TicketEdit } from "components/TicketEdit";
type TicketProps = {
id: string;
};
const Ticket: NextPage<TicketProps> = ({ id }) => {
const origin = typeof window !== 'undefined' && window.location.origin
? window.location.origin
: '';
const origin =
typeof window !== "undefined" && window.location.origin
? window.location.origin
: "";
const graphQLFetcher = async ({ document, variables }: any) => {
const data = await request({
url: `${origin}/graphql`,
document,
variables
})
console.log({ data })
variables,
});
console.log({ data });
return data;
};
@ -31,32 +31,31 @@ const Ticket: NextPage<TicketProps> = ({ id }) => {
{
document: gql`
query getTicket($ticketId: Int!) {
ticket(
ticket: {
ticketInternalId: $ticketId
}
) {
id,
internalId,
title,
note,
number,
createdAt,
updatedAt,
closeAt,
articles {
edges {
node {
id,
body,
internal,
sender {
name
ticket(ticket: { ticketInternalId: $ticketId }) {
id
internalId
title
note
number
createdAt
updatedAt
closeAt
articles {
edges {
node {
id
body
internal
sender {
name
}
}
}
}
}
}}`, variables: { ticketId: parseInt(id, 10) }
}
`,
variables: { ticketId: parseInt(id, 10) },
},
graphQLFetcher,
{ refreshInterval: 1000 }
@ -65,8 +64,7 @@ const Ticket: NextPage<TicketProps> = ({ id }) => {
const { data: graphqlData2, error: graphqlError2 } = useSWR(
{
document: gql`
{
{
__schema {
queryType {
name
@ -75,8 +73,9 @@ const Ticket: NextPage<TicketProps> = ({ id }) => {
}
}
}
}`, variables: {}
}
`,
variables: {},
},
graphQLFetcher
);
@ -91,22 +90,23 @@ const Ticket: NextPage<TicketProps> = ({ id }) => {
{shouldRender && (
<Grid container spacing={0} sx={{ height: "100vh" }} direction="row">
<Grid item sx={{ height: "100vh" }} xs={12}>
<TicketDetail ticket={ticketData.ticket} />
</Grid>
{/*<Grid item xs={0} sx={{ height: "100vh" }}>
<TicketEdit ticket={ticketData.ticket} />
</Grid>*/}
</Grid>)}
</Grid>
)}
{ticketError && <div>{ticketError.toString()}</div>}
</Layout>
);
}
};
export const getServerSideProps: GetServerSideProps = async (
context: GetServerSidePropsContext) => {
context: GetServerSidePropsContext
) => {
const { id } = context.query;
return { props: { id } };
}
};
export default Ticket;

View file

@ -1,9 +1,10 @@
import { FC } from "react";
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { ZammadWrapper } from "components/ZammadWrapper";
const Link = () => (
const Assigned: FC = () => (
<Layout>
<Head>
<title>Link Shell</title>
@ -27,4 +28,4 @@ const Link = () => (
</Layout>
);
export default Link;
export default Assigned;

View file

@ -1,9 +1,10 @@
import { FC } from "react";
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { ZammadWrapper } from "components/ZammadWrapper";
const Link = () => (
const Pending: FC = () => (
<Layout>
<Head>
<title>Link Shell</title>
@ -27,4 +28,4 @@ const Link = () => (
</Layout>
);
export default Link;
export default Pending;

View file

@ -1,9 +1,10 @@
import { FC } from "react";
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { ZammadWrapper } from "components/ZammadWrapper";
const Link = () => (
const Unassigned: FC = () => (
<Layout>
<Head>
<title>Link Shell</title>
@ -27,4 +28,4 @@ const Link = () => (
</Layout>
);
export default Link;
export default Unassigned;

View file

@ -1,9 +1,10 @@
import { FC } from "react";
import Head from "next/head";
import { Grid } from "@mui/material";
import { Layout } from "components/Layout";
import { ZammadWrapper } from "components/ZammadWrapper";
const Link = () => (
const Urgent: FC = () => (
<Layout>
<Head>
<title>Link Shell</title>
@ -27,4 +28,4 @@ const Link = () => (
</Layout>
);
export default Link;
export default Urgent;

View file

@ -6,7 +6,6 @@ module.exports = {
"eslint-config-link/profile/typescript",
"eslint-config-link/profile/jest",
"next",
"unicorn/filename-case",
],
parserOptions: { tsconfigRootDir: __dirname },
};

View file

@ -4,22 +4,21 @@ import { signIn, signOut, getSession } from "next-auth/react";
import { useLogin, useTranslate } from "react-admin";
export const authProvider = {
login: (o: any) => {
login(o: any) {
if (o.ok) return Promise.resolve();
return Promise.reject();
},
logout: async () => {
async logout() {
const session = await getSession();
if (session) {
await signOut();
}
},
checkError: (e: any) => {
checkError(e: any) {
if (e.graphQLErrors && e.graphQLErrors.length > 0) {
const permDenied =
e.graphQLErrors.filter((e: any) =>
e.message.match(/.*permission denied.*/)
).length > 0;
const permDenied = e.graphQLErrors.some((e: any) =>
e.message.match(/.*permission denied.*/)
);
if (permDenied)
// eslint-disable-next-line prefer-promise-reject-errors
return Promise.reject({ message: "auth.permissionDenied" });
@ -31,17 +30,15 @@ export const authProvider = {
return Promise.resolve();
},
checkAuth: async () => {
async checkAuth() {
const session = await getSession();
if (!session) {
return Promise.reject();
throw new Error("Invalid session");
}
return Promise.resolve();
},
getIdentity: async () => {
async getIdentity() {
const session = await getSession();
if (!session) return Promise.reject(new Error("Invalid session"));
if (!session) throw new Error("Invalid session");
return {
id: session.user?.email,
@ -59,10 +56,10 @@ export const AdminLogin: FC = () => {
useEffect(() => {
(async () => {
const session = await getSession();
if (!session) {
signIn();
} else {
if (session) {
reactAdminLogin({ ok: true });
} else {
signIn();
}
})();
});

View file

@ -10,7 +10,7 @@ export const Auth: FC = ({ children }) => {
if (!session && !loading) {
router.push("/login");
}
}, [session, loading]);
}, [session, loading, router]);
if (loading) {
return <CircularProgress />;

View file

@ -1,3 +1,4 @@
/* eslint-disable react/display-name */
import { forwardRef } from "react";
import useDigitInput, { InputAttributes } from "react-digit-input";
import styles from "./DigitInput.module.css";
@ -7,36 +8,35 @@ const DigitInputElement = forwardRef<
Omit<InputAttributes, "ref"> & {
autoFocus?: boolean;
}
>(({ ...props }, ref) => {
return (
<>
<input
aria-label="verification code"
className={styles.input}
{...props}
ref={ref}
inputMode="decimal"
/>
</>
);
});
>(({ ...props }, ref) => (
<>
<input
aria-label="verification code"
className={styles.input}
{...props}
ref={ref}
inputMode="decimal"
/>
</>
));
const DigitSeparator = forwardRef<
HTMLInputElement,
Omit<InputAttributes, "ref"> & {
autoFocus?: boolean;
}
>(({ ...props }, ref) => {
return (
>(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
({ ...props }, ref) => (
<>
<span className={styles.hyphen} ref={ref} />
</>
);
});
)
);
export const SixDigitInput = ({ value, onChange }: any) => {
const digits = useDigitInput({
acceptedCharacters: /^[0-9]$/,
acceptedCharacters: /^\d$/,
length: 6,
value,
onChange,

View file

@ -18,11 +18,10 @@ import voiceProviders from "./voice/providers";
import webhooks from "./webhooks";
import { AdminLogin, authProvider } from "./AdminLogin";
const i18nProvider = polyglotI18nProvider((_locale) => {
return englishMessages;
}, "en");
const i18nProvider = polyglotI18nProvider((_locale) => englishMessages, "en");
const MetamigoAdmin: FC = () => {
// eslint-disable-next-line unicorn/no-null
const [dataProvider, setDataProvider] = useState(null);
const client = useApolloClient();

View file

@ -37,7 +37,7 @@ const AccountEditToolbar: FC<AccountEditToolbarProps> = (props: any) => {
const AccountTitle = ({ record }: { record?: any }) => {
let title = "";
if (record) title = record.name ? record.name : record.email;
if (record) title = record.name ?? record.email;
return <span>Account {title}</span>;
};

View file

@ -1,8 +1,9 @@
/* eslint-disable import/no-named-as-default */
/* eslint-disable import/no-anonymous-default-export */
import AccountIcon from "@material-ui/icons/AccountTree";
import AccountList from "./AccountList";
import AccountEdit from "./AccountEdit";
// eslint-disable-next-line import/no-anonymous-default-export
export default {
list: AccountList,
edit: AccountEdit,

View file

@ -16,6 +16,7 @@ const useStyles = makeStyles({
},
});
// eslint-disable-next-line react/display-name
const ConfigurationMenu = forwardRef<any, any>((props, ref) => {
const translate = useTranslate();
return (

View file

@ -1,3 +1,4 @@
/* eslint-disable import/no-named-as-default */
import { Layout as RaLayout, LayoutProps, Sidebar } from "react-admin";
import AppBar from "./AppBar";
import Menu from "./Menu";
@ -5,17 +6,15 @@ import { theme } from "./themes";
const CustomSidebar = (props: any) => <Sidebar {...props} size={200} />;
const Layout = (props: LayoutProps) => {
return (
<RaLayout
{...props}
appBar={AppBar}
menu={Menu}
sidebar={CustomSidebar}
// @ts-ignore
theme={theme}
/>
);
};
const Layout = (props: LayoutProps) => (
<RaLayout
{...props}
appBar={AppBar}
menu={Menu}
sidebar={CustomSidebar}
// @ts-ignore
theme={theme}
/>
);
export default Layout;

View file

@ -1,106 +1,104 @@
import { SVGProps } from "react";
const Logo = (props: SVGProps<SVGSVGElement>) => {
return (
<svg width="220.001" height="43.659" {...props}>
<path d="M59.39 24.586h4.6v8.512c-1.058.2-3.743.57-5.742.57-6.398 0-7.74-3.77-7.74-11.452 0-7.827 1.4-11.54 7.797-11.54 3.627 0 8.597.828 8.597.828l.115-2.542s-4.885-1.056-9.083-1.056c-8.312 0-10.626 5.112-10.626 14.31 0 8.968 2.228 14.167 10.711 14.167 3.028 0 8.17-.8 8.998-.971V21.816H59.39zm13.14 11.397h2.998V21.302s3.514-1.943 7.284-2.714V15.56c-3.828.743-7.312 3.142-7.312 3.142v-2.713h-2.97zm27.962-13.967c0-4.342-1.913-6.427-6.455-6.427-3.427 0-7.826.885-7.826.885l.114 2.285s4.77-.542 7.57-.542c2.4 0 3.598 1 3.598 3.799v1.742l-6.284.6c-4.113.4-6.112 2.056-6.112 5.912 0 4.028 2 6.113 5.627 6.113 3.6 0 7.198-1.6 7.198-1.6 1.2 1.2 2.656 1.6 4.77 1.6l.114-2.37c-1.285-.144-2.228-.6-2.314-1.743zm-2.999 3.998v6.599s-3.313 1.256-6.284 1.256c-2.028 0-3.027-1.37-3.027-3.684 0-2.2.942-3.37 3.4-3.6zm17.738-10.425c-2.828 0-5.855 1.4-5.855 1.4V7.277h-2.97v28.677s4.283.429 6.683.429c7.283 0 9.425-2.77 9.425-10.711 0-7.198-1.828-10.083-7.283-10.083zm-2.2 18.109c-1.056 0-3.655-.2-3.655-.2V19.416s2.8-1.142 5.54-1.142c3.514 0 4.57 2.228 4.57 7.398 0 5.598-.97 8.026-6.454 8.026zm28.535-11.682c0-4.342-1.942-6.427-6.455-6.427-3.428 0-7.826.885-7.826.885l.114 2.285s4.77-.542 7.57-.542c2.4 0 3.598 1 3.598 3.799v1.742l-6.284.6c-4.113.4-6.112 2.056-6.112 5.912 0 4.028 2 6.113 5.626 6.113 3.6 0 7.198-1.6 7.198-1.6 1.2 1.2 2.628 1.6 4.77 1.6l.115-2.37c-1.286-.144-2.257-.6-2.314-1.743zm-3 3.998v6.599s-3.34 1.256-6.283 1.256c-2.057 0-3.056-1.37-3.056-3.684 0-2.2.97-3.37 3.4-3.6zm24.25-18.737h-2.94v8.826c-.6-.114-3.2-.514-4.914-.514-6.084 0-8.369 3.513-8.369 10.568 0 8.626 3.285 10.226 7.198 10.226 3 0 6.084-1.771 6.084-1.771v1.37h2.942zm-8.654 26.42c-2.37 0-4.484-1.084-4.484-7.54 0-5.198 1.228-7.97 5.427-7.97 1.657 0 4.113.373 4.77.487v13.539s-2.885 1.485-5.713 1.485zM176.3 15.59c-6.313 0-8.54 3.285-8.54 10.168 0 7.255 1.827 10.626 8.54 10.626 6.77 0 8.57-3.37 8.57-10.626 0-6.883-2.2-10.168-8.57-10.168zm0 18.195c-4.713 0-5.484-2.371-5.484-8.027 0-5.57 1.256-7.57 5.484-7.57 4.284 0 5.484 2 5.484 7.57 0 5.656-.714 8.027-5.484 8.027zm13.453 2.199h3V21.303s3.512-1.943 7.254-2.714V15.56c-3.828.743-7.312 3.142-7.312 3.142V15.99h-2.942zm27.934-13.967c0-4.342-1.913-6.427-6.426-6.427-3.456 0-7.855.885-7.855.885l.143 2.285s4.741-.542 7.54-.542c2.4 0 3.6 1 3.6 3.799v1.742l-6.285.6c-4.113.4-6.112 2.056-6.112 5.912 0 4.028 2 6.113 5.655 6.113 3.6 0 7.198-1.6 7.198-1.6 1.2 1.2 2.628 1.6 4.742 1.6l.114-2.37c-1.257-.144-2.228-.6-2.314-1.743zm-2.999 3.998v6.599s-3.313 1.256-6.284 1.256c-2.028 0-3.027-1.37-3.027-3.684 0-2.2.97-3.37 3.4-3.6z" />
<defs>
<linearGradient
gradientTransform="rotate(25)"
id="a"
x1="0"
y1="0"
x2="1"
y2="0"
>
<stop offset="0%" stopColor="#8C48D2" />
<stop offset="100%" stopColor="#CF705A" />
</linearGradient>
<linearGradient
xlinkHref="#a"
id="c"
gradientTransform="scale(.7746 1.291)"
x1="15.492"
y1="4.648"
x2="23.238"
y2="4.648"
gradientUnits="userSpaceOnUse"
/>
<linearGradient
xlinkHref="#a"
id="d"
gradientTransform="scale(1.27 .7874)"
x1="7.874"
y1="15.24"
x2="15.748"
y2="15.24"
gradientUnits="userSpaceOnUse"
/>
<linearGradient
xlinkHref="#a"
id="e"
gradientTransform="scale(.91287 1.09545)"
x1="10.954"
y1="7.303"
x2="21.909"
y2="7.303"
gradientUnits="userSpaceOnUse"
/>
<linearGradient
xlinkHref="#a"
id="f"
gradientTransform="scale(1.13606 .88024)"
x1="3.521"
y1="13.576"
x2="22.886"
y2="13.576"
gradientUnits="userSpaceOnUse"
/>
<linearGradient
xlinkHref="#a"
id="g"
gradientTransform="scale(1.029 .97183)"
x1="5.831"
y1="1.029"
x2="23.324"
y2="1.029"
gradientUnits="userSpaceOnUse"
/>
<linearGradient
xlinkHref="#a"
id="b"
gradientTransform="scale(.88647 1.12807)"
x1="4.512"
y1=".886"
x2="29.33"
y2=".886"
gradientUnits="userSpaceOnUse"
/>
</defs>
<g transform="translate(-6.238 -1.56) scale(1.55946)" fill="url(#b)">
<path
d="M12 9v4a3 3 0 006 0V9a3 3 0 00-6 0zm3-2a2 2 0 012 2v4a2 2 0 11-4 0V9a2 2 0 012-2z"
fill="url(#c)"
/>
<path
d="M10 13.2a5 5 0 0010 0v-.7a.5.5 0 10-1 0v.7a4 4 0 11-8 0v-.7a.5.5 0 10-1 0z"
fill="url(#d)"
/>
<path
d="M19.5 13a.5.5 0 100-1h-9a.5.5 0 100 1zm-3 6a.5.5 0 110 1h-3a.5.5 0 110-1h1v-1h1v1zm-3-10a.5.5 0 000-1h-1v1zm0 2a.5.5 0 000-1h-1v1zm3 0a.5.5 0 110-1h1v1zm0-2a.5.5 0 110-1h1v1z"
fill="url(#e)"
/>
<path
d="M25.947 14.272a.51.51 0 01.053.23v13.994a.5.5 0 01-.5.5h-21a.5.5 0 01-.5-.5V14.502a.502.502 0 01.2-.406L7 11.95v1.26l-2 1.533v1.253l6.667 5h6.666l6.667-5v-1.253l-2-1.533v-1.26l2.8 2.146a.502.502 0 01.147.176zM10.739 21.55L5 27.29V17.245l5.739 4.304zm.968.446h6.586l6 6H5.707zm7.554-.446L25 17.246V27.29l-5.739-5.739z"
fill="url(#f)"
/>
<path
d="M24 6.2a.5.5 0 00-.146-.354l-4.7-4.7A.5.5 0 0018.8 1H6.5a.5.5 0 00-.5.5V18h1V2h11v4.5a.5.5 0 00.5.5H23v11h1zM19 6V2.41L22.59 6z"
fill="url(#g)"
/>
</g>
</svg>
);
};
const Logo = (props: SVGProps<SVGSVGElement>) => (
<svg width="220.001" height="43.659" {...props}>
<path d="M59.39 24.586h4.6v8.512c-1.058.2-3.743.57-5.742.57-6.398 0-7.74-3.77-7.74-11.452 0-7.827 1.4-11.54 7.797-11.54 3.627 0 8.597.828 8.597.828l.115-2.542s-4.885-1.056-9.083-1.056c-8.312 0-10.626 5.112-10.626 14.31 0 8.968 2.228 14.167 10.711 14.167 3.028 0 8.17-.8 8.998-.971V21.816H59.39zm13.14 11.397h2.998V21.302s3.514-1.943 7.284-2.714V15.56c-3.828.743-7.312 3.142-7.312 3.142v-2.713h-2.97zm27.962-13.967c0-4.342-1.913-6.427-6.455-6.427-3.427 0-7.826.885-7.826.885l.114 2.285s4.77-.542 7.57-.542c2.4 0 3.598 1 3.598 3.799v1.742l-6.284.6c-4.113.4-6.112 2.056-6.112 5.912 0 4.028 2 6.113 5.627 6.113 3.6 0 7.198-1.6 7.198-1.6 1.2 1.2 2.656 1.6 4.77 1.6l.114-2.37c-1.285-.144-2.228-.6-2.314-1.743zm-2.999 3.998v6.599s-3.313 1.256-6.284 1.256c-2.028 0-3.027-1.37-3.027-3.684 0-2.2.942-3.37 3.4-3.6zm17.738-10.425c-2.828 0-5.855 1.4-5.855 1.4V7.277h-2.97v28.677s4.283.429 6.683.429c7.283 0 9.425-2.77 9.425-10.711 0-7.198-1.828-10.083-7.283-10.083zm-2.2 18.109c-1.056 0-3.655-.2-3.655-.2V19.416s2.8-1.142 5.54-1.142c3.514 0 4.57 2.228 4.57 7.398 0 5.598-.97 8.026-6.454 8.026zm28.535-11.682c0-4.342-1.942-6.427-6.455-6.427-3.428 0-7.826.885-7.826.885l.114 2.285s4.77-.542 7.57-.542c2.4 0 3.598 1 3.598 3.799v1.742l-6.284.6c-4.113.4-6.112 2.056-6.112 5.912 0 4.028 2 6.113 5.626 6.113 3.6 0 7.198-1.6 7.198-1.6 1.2 1.2 2.628 1.6 4.77 1.6l.115-2.37c-1.286-.144-2.257-.6-2.314-1.743zm-3 3.998v6.599s-3.34 1.256-6.283 1.256c-2.057 0-3.056-1.37-3.056-3.684 0-2.2.97-3.37 3.4-3.6zm24.25-18.737h-2.94v8.826c-.6-.114-3.2-.514-4.914-.514-6.084 0-8.369 3.513-8.369 10.568 0 8.626 3.285 10.226 7.198 10.226 3 0 6.084-1.771 6.084-1.771v1.37h2.942zm-8.654 26.42c-2.37 0-4.484-1.084-4.484-7.54 0-5.198 1.228-7.97 5.427-7.97 1.657 0 4.113.373 4.77.487v13.539s-2.885 1.485-5.713 1.485zM176.3 15.59c-6.313 0-8.54 3.285-8.54 10.168 0 7.255 1.827 10.626 8.54 10.626 6.77 0 8.57-3.37 8.57-10.626 0-6.883-2.2-10.168-8.57-10.168zm0 18.195c-4.713 0-5.484-2.371-5.484-8.027 0-5.57 1.256-7.57 5.484-7.57 4.284 0 5.484 2 5.484 7.57 0 5.656-.714 8.027-5.484 8.027zm13.453 2.199h3V21.303s3.512-1.943 7.254-2.714V15.56c-3.828.743-7.312 3.142-7.312 3.142V15.99h-2.942zm27.934-13.967c0-4.342-1.913-6.427-6.426-6.427-3.456 0-7.855.885-7.855.885l.143 2.285s4.741-.542 7.54-.542c2.4 0 3.6 1 3.6 3.799v1.742l-6.285.6c-4.113.4-6.112 2.056-6.112 5.912 0 4.028 2 6.113 5.655 6.113 3.6 0 7.198-1.6 7.198-1.6 1.2 1.2 2.628 1.6 4.742 1.6l.114-2.37c-1.257-.144-2.228-.6-2.314-1.743zm-2.999 3.998v6.599s-3.313 1.256-6.284 1.256c-2.028 0-3.027-1.37-3.027-3.684 0-2.2.97-3.37 3.4-3.6z" />
<defs>
<linearGradient
gradientTransform="rotate(25)"
id="a"
x1="0"
y1="0"
x2="1"
y2="0"
>
<stop offset="0%" stopColor="#8C48D2" />
<stop offset="100%" stopColor="#CF705A" />
</linearGradient>
<linearGradient
xlinkHref="#a"
id="c"
gradientTransform="scale(.7746 1.291)"
x1="15.492"
y1="4.648"
x2="23.238"
y2="4.648"
gradientUnits="userSpaceOnUse"
/>
<linearGradient
xlinkHref="#a"
id="d"
gradientTransform="scale(1.27 .7874)"
x1="7.874"
y1="15.24"
x2="15.748"
y2="15.24"
gradientUnits="userSpaceOnUse"
/>
<linearGradient
xlinkHref="#a"
id="e"
gradientTransform="scale(.91287 1.09545)"
x1="10.954"
y1="7.303"
x2="21.909"
y2="7.303"
gradientUnits="userSpaceOnUse"
/>
<linearGradient
xlinkHref="#a"
id="f"
gradientTransform="scale(1.13606 .88024)"
x1="3.521"
y1="13.576"
x2="22.886"
y2="13.576"
gradientUnits="userSpaceOnUse"
/>
<linearGradient
xlinkHref="#a"
id="g"
gradientTransform="scale(1.029 .97183)"
x1="5.831"
y1="1.029"
x2="23.324"
y2="1.029"
gradientUnits="userSpaceOnUse"
/>
<linearGradient
xlinkHref="#a"
id="b"
gradientTransform="scale(.88647 1.12807)"
x1="4.512"
y1=".886"
x2="29.33"
y2=".886"
gradientUnits="userSpaceOnUse"
/>
</defs>
<g transform="translate(-6.238 -1.56) scale(1.55946)" fill="url(#b)">
<path
d="M12 9v4a3 3 0 006 0V9a3 3 0 00-6 0zm3-2a2 2 0 012 2v4a2 2 0 11-4 0V9a2 2 0 012-2z"
fill="url(#c)"
/>
<path
d="M10 13.2a5 5 0 0010 0v-.7a.5.5 0 10-1 0v.7a4 4 0 11-8 0v-.7a.5.5 0 10-1 0z"
fill="url(#d)"
/>
<path
d="M19.5 13a.5.5 0 100-1h-9a.5.5 0 100 1zm-3 6a.5.5 0 110 1h-3a.5.5 0 110-1h1v-1h1v1zm-3-10a.5.5 0 000-1h-1v1zm0 2a.5.5 0 000-1h-1v1zm3 0a.5.5 0 110-1h1v1zm0-2a.5.5 0 110-1h1v1z"
fill="url(#e)"
/>
<path
d="M25.947 14.272a.51.51 0 01.053.23v13.994a.5.5 0 01-.5.5h-21a.5.5 0 01-.5-.5V14.502a.502.502 0 01.2-.406L7 11.95v1.26l-2 1.533v1.253l6.667 5h6.666l6.667-5v-1.253l-2-1.533v-1.26l2.8 2.146a.502.502 0 01.147.176zM10.739 21.55L5 27.29V17.245l5.739 4.304zm.968.446h6.586l6 6H5.707zm7.554-.446L25 17.246V27.29l-5.739-5.739z"
fill="url(#f)"
/>
<path
d="M24 6.2a.5.5 0 00-.146-.354l-4.7-4.7A.5.5 0 0018.8 1H6.5a.5.5 0 00-.5.5V18h1V2h11v4.5a.5.5 0 00.5.5H23v11h1zM19 6V2.41L22.59 6z"
fill="url(#g)"
/>
</g>
</svg>
);
export default Logo;

View file

@ -6,7 +6,7 @@ import VoiceIcon from "@material-ui/icons/PhoneInTalk";
import { Box } from "@material-ui/core";
import { useTheme } from "@material-ui/core/styles";
import useMediaQuery from "@material-ui/core/useMediaQuery";
import { useTranslate, MenuItemLink, MenuProps } from "react-admin";
import { useTranslate, MenuItemLink } from "react-admin";
import users from "../users";
import accounts from "../accounts";
import webhooks from "../webhooks";
@ -33,9 +33,7 @@ export const Menu: FC = ({ onMenuClick, logout, dense = false }: any) => {
setState((state) => ({ ...state, [menu]: !state[menu] }));
};
return <div />;
};
/*
return (
<Box mt={1}>
<MenuItemLink
to={`/whatsappbots`}
@ -129,5 +127,5 @@ export const Menu: FC = ({ onMenuClick, logout, dense = false }: any) => {
</Box>
);
};
*/
export default Menu;

View file

@ -1,5 +1,3 @@
import AppBar from "./AppBar";
import Layout from "./Layout";
import Menu from "./Menu";
export { AppBar, Layout, Menu };
export {default as AppBar} from "./AppBar";
export {default as Layout} from "./Layout";
export {default as Menu} from "./Menu";

View file

@ -182,7 +182,7 @@ const VerificationCodeRequest = ({
onFailure,
});
})();
}, []);
}, [data.id, onFailure, onSuccess, verifyMode]);
return (
<>
@ -409,7 +409,7 @@ const VerificationCodeDialog = (props: any) => {
);
};
const SignalBotShowActions = ({ basePath, data }: any) => {
const SignalBotShowActions = ({ data }: any) => {
const [open, setOpen] = React.useState(false);
const [verifyMode, setVerifyMode] = React.useState("");
const refresh = useRefresh();

View file

@ -1,3 +1,4 @@
/* eslint-disable react/display-name */
import {
SelectInput,
required,
@ -6,19 +7,21 @@ import {
TextField,
} from "react-admin";
export const SignalBotSelectInput = (source: string) => () => (
<ReferenceInput
label="Signal Bot"
source={source}
reference="signalBots"
validate={[required()]}
>
<SelectInput optionText="phoneNumber" />
</ReferenceInput>
);
export const SignalBotSelectInput = (source: string) => () =>
(
<ReferenceInput
label="Signal Bot"
source={source}
reference="signalBots"
validate={[required()]}
>
<SelectInput optionText="phoneNumber" />
</ReferenceInput>
);
export const SignalBotField = (source: string) => () => (
<ReferenceField label="Signal Bot" reference="signalBots" source={source}>
<TextField source="phoneNumber" />
</ReferenceField>
);
export const SignalBotField = (source: string) => () =>
(
<ReferenceField label="Signal Bot" reference="signalBots" source={source}>
<TextField source="phoneNumber" />
</ReferenceField>
);

View file

@ -30,7 +30,7 @@ const UserEditToolbar = (props: any) => {
<Toolbar className={classes.defaultToolbar} {...props}>
<SaveButton
label="save"
mutationOptions={{ onSuccess: (response) => redirect("/users") }}
mutationOptions={{ onSuccess: () => redirect("/users") }}
/>
<DeleteButton disabled={props.session.user.id === props.record.id} />
</Toolbar>
@ -39,7 +39,7 @@ const UserEditToolbar = (props: any) => {
const UserTitle = ({ record }: { record?: any }) => {
let title = "";
if (record) title = record.name ? record.name : record.email;
if (record) title = record.name ?? record.email;
return <span>User {title}</span>;
};

View file

@ -7,27 +7,25 @@ import {
} from "react-admin";
import { ProviderKindInput } from "./shared";
import TextField from "@material-ui/core/TextField";
// import TextField from "@material-ui/core/TextField";
const TwilioCredentialsInput = () => (
/* const TwilioCredentialsInput = () => (
<span>
<TextField name="accountSid" label="Account Sid" />
<TextField name="authToken" label="Auth Token" />
</span>
); */
const ProviderCreate = (props: CreateProps) => (
<Create {...props} title="Create Providers">
<SimpleForm>
<ProviderKindInput />
<TextInput source="name" />
<TextInput source="credentials.accountSid" />
<TextInput source="credentials.apiKeySid" />
<PasswordInput source="credentials.apiKeySecret" />
</SimpleForm>
</Create>
);
const ProviderCreate = (props: CreateProps) => {
return (
<Create {...props} title="Create Providers">
<SimpleForm>
<ProviderKindInput />
<TextInput source="name" />
<TextInput source="credentials.accountSid" />
<TextInput source="credentials.apiKeySid" />
<PasswordInput source="credentials.apiKeySecret" />
</SimpleForm>
</Create>
);
};
export default ProviderCreate;

View file

@ -9,23 +9,21 @@ import { ProviderKindInput } from "./shared";
const ProviderTitle = ({ record }: { record?: any }) => {
let title = "";
if (record) title = record.name ? record.name : record.email;
if (record) title = record.name ?? record.email;
return <span>Provider {title}</span>;
};
const ProviderEdit = (props: EditProps) => {
return (
<Edit title={<ProviderTitle />} {...props}>
<SimpleForm>
<TextInput disabled source="id" />
<ProviderKindInput disabled />
<TextInput source="name" />
<TextInput source="credentials.accountSid" />
<TextInput source="credentials.apiKeySid" />
<PasswordInput source="credentials.apiKeySecret" />
</SimpleForm>
</Edit>
);
};
const ProviderEdit = (props: EditProps) => (
<Edit title={<ProviderTitle />} {...props}>
<SimpleForm>
<TextInput disabled source="id" />
<ProviderKindInput disabled />
<TextInput source="name" />
<TextInput source="credentials.accountSid" />
<TextInput source="credentials.apiKeySid" />
<PasswordInput source="credentials.apiKeySecret" />
</SimpleForm>
</Edit>
);
export default ProviderEdit;

View file

@ -1,3 +1,4 @@
/* eslint-disable import/no-anonymous-default-export */
import ProviderIcon from "@material-ui/icons/Business";
import ProviderList from "./ProviderList";
import ProviderEdit from "./ProviderEdit";

View file

@ -8,14 +8,13 @@ import { makeStyles, useTheme } from "@material-ui/core/styles";
import AudioPlayer from "material-ui-audio-player";
import { useStopwatch } from "react-timer-hook";
import style from "./MicInput.module.css";
//import type { ReactMicProps } from "react-mic";
// import type { ReactMicProps } from "react-mic";
const ReactMic = dynamic<any>(
// eslint-disable-next-line promise/prefer-await-to-then
() => {
throw new Error(
"MIC INPUT FEATURE IS DISABLED"
); /*return import("react-mic").then((mod) => mod.ReactMic);*/
); /* return import("react-mic").then((mod) => mod.ReactMic); */
},
{ ssr: false }
);
@ -58,7 +57,7 @@ const MicInput = (props: any) => {
field: { value, onChange },
} = useInput(props);
let [record, setRecorder] = useState({ record: false });
const [record, setRecorder] = useState({ record: false });
const decodedValue = resultToDataUri(value);
const startRecording = () => {
setRecorder({ record: true });
@ -71,7 +70,9 @@ const MicInput = (props: any) => {
pause();
};
async function onData(recordedBlob: any) {}
async function onData(recordedBlob: any) {
console.log({ recordedBlob });
}
async function onStop(recordedBlob: any) {
const result = await blobToResult(recordedBlob.blob);
@ -84,16 +85,14 @@ const MicInput = (props: any) => {
.toString()
.padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
const useStyles = makeStyles((theme) => {
return {
volumeIcon: {
display: "none",
},
mainSlider: {
display: "none",
},
};
});
const useStyles = makeStyles(() => ({
volumeIcon: {
display: "none",
},
mainSlider: {
display: "none",
},
}));
return (
<div className="MuiFormControl-marginDense RaFormInput-input-40">

View file

@ -17,38 +17,36 @@ import {
} from "./shared";
import MicInput from "./MicInput";
const VoiceLineCreate = (props: CreateProps) => {
return (
<Create {...props} title="Create Voice Line" transform={populateNumber}>
<SimpleForm>
<ReferenceInput
label="Provider"
source="providerId"
reference="voiceProviders"
validate={[required()]}
>
<SelectInput optionText={(p) => `${p.kind}: ${p.name}`} />
</ReferenceInput>
<FormDataConsumer subscription={{ values: true }}>
{AvailableNumbersInput}
</FormDataConsumer>
<SelectInput
source="language"
choices={TwilioLanguages.languages}
validate={[required()]}
/>
<FormDataConsumer subscription={{ values: true }}>
{VoiceInput}
</FormDataConsumer>
const VoiceLineCreate = (props: CreateProps) => (
<Create {...props} title="Create Voice Line" transform={populateNumber}>
<SimpleForm>
<ReferenceInput
label="Provider"
source="providerId"
reference="voiceProviders"
validate={[required()]}
>
<SelectInput optionText={(p) => `${p.kind}: ${p.name}`} />
</ReferenceInput>
<FormDataConsumer subscription={{ values: true }}>
{AvailableNumbersInput}
</FormDataConsumer>
<SelectInput
source="language"
choices={TwilioLanguages.languages}
validate={[required()]}
/>
<FormDataConsumer subscription={{ values: true }}>
{VoiceInput}
</FormDataConsumer>
<FormDataConsumer subscription={{ values: true }}>
{PromptInput}
</FormDataConsumer>
<BooleanInput source="audioPromptEnabled" />
<MicInput source="promptAudio" />
</SimpleForm>
</Create>
);
};
<FormDataConsumer subscription={{ values: true }}>
{PromptInput}
</FormDataConsumer>
<BooleanInput source="audioPromptEnabled" />
<MicInput source="promptAudio" />
</SimpleForm>
</Create>
);
export default VoiceLineCreate;

View file

@ -15,37 +15,35 @@ import MicInput from "./MicInput";
const VoiceLineTitle = ({ record }: { record?: any }) => {
let title = "";
if (record) title = record.name ? record.name : record.email;
if (record) title = record.name ?? record.email;
return <span>VoiceLine {title}</span>;
};
const VoiceLineEdit = (props: EditProps) => {
return (
<Edit title={<VoiceLineTitle />} {...props}>
<SimpleForm>
<ReferenceInput
disabled
label="Provider"
source="providerId"
reference="providers"
validate={[required()]}
>
<SelectInput optionText={(p) => `${p.kind}: ${p.name}`} />
</ReferenceInput>
<TextInput disabled source="providerLineSid" />
<TextInput disabled source="number" />
<SelectInput source="language" choices={TwilioLanguages.languages} />
<FormDataConsumer subscription={{ values: true }}>
{VoiceInput}
</FormDataConsumer>
<FormDataConsumer subscription={{ values: true }}>
{PromptInput}
</FormDataConsumer>
<BooleanInput source="audioPromptEnabled" />
<MicInput source="promptAudio" />
</SimpleForm>
</Edit>
);
};
const VoiceLineEdit = (props: EditProps) => (
<Edit title={<VoiceLineTitle />} {...props}>
<SimpleForm>
<ReferenceInput
disabled
label="Provider"
source="providerId"
reference="providers"
validate={[required()]}
>
<SelectInput optionText={(p) => `${p.kind}: ${p.name}`} />
</ReferenceInput>
<TextInput disabled source="providerLineSid" />
<TextInput disabled source="number" />
<SelectInput source="language" choices={TwilioLanguages.languages} />
<FormDataConsumer subscription={{ values: true }}>
{VoiceInput}
</FormDataConsumer>
<FormDataConsumer subscription={{ values: true }}>
{PromptInput}
</FormDataConsumer>
<BooleanInput source="audioPromptEnabled" />
<MicInput source="promptAudio" />
</SimpleForm>
</Edit>
);
export default VoiceLineEdit;

View file

@ -1,3 +1,4 @@
/* eslint-disable react/display-name */
import React, { useState, useEffect } from "react";
import PlayIcon from "@material-ui/icons/PlayCircleFilled";
import {
@ -25,7 +26,7 @@ const tts = async (providerId: any): Promise<TTSProvider> => {
return (voice, language, prompt): Promise<void> =>
new Promise((resolve) => {
if (!voice || !language || !prompt) resolve();
const Device = twilioClient.Device;
const { Device } = twilioClient;
const device = new Device();
const silence = `${absoluteUrl().origin}/static/silence.mp3`;
device.setup(token, {
@ -39,7 +40,7 @@ const tts = async (providerId: any): Promise<TTSProvider> => {
outgoing: silence,
},
});
device.on("ready", function (device: any) {
device.on("ready", (device: any) => {
device.connect({ language, voice, prompt });
});
device.on("disconnect", () => resolve());
@ -69,14 +70,14 @@ export const TextToSpeechButton = ({ form }: any) => {
useEffect(() => {
(async () => {
setPlayText({
func: async () => {
async func() {
setLoading(true);
if (ttsProvider) await ttsProvider.provider(voice, language, prompt);
setLoading(false);
},
});
})();
}, [prompt, language, voice, ttsProvider?.provider]);
}, [prompt, language, voice, ttsProvider, ttsProvider?.provider]);
const disabled = !(providerId && prompt?.length >= 2 && voice && language);
/* TODO add this back to IconButtonwhen we know how to extend MUI theme and appease typescript
@ -90,19 +91,17 @@ export const TextToSpeechButton = ({ form }: any) => {
);
};
export const PromptInput = (form: any, ...rest: any[]) => {
return (
<TextInput
source="promptText"
multiline
options={{ fullWidth: true }}
InputProps={{ endAdornment: <TextToSpeechButton form={form} /> }}
{...rest}
/>
);
};
export const PromptInput = (form: any, ...rest: any[]) => (
<TextInput
source="promptText"
multiline
options={{ fullWidth: true }}
InputProps={{ endAdornment: <TextToSpeechButton form={form} /> }}
{...rest}
/>
);
const validateVoice = (args: any, values: any) => {
const validateVoice = (_args: any, values: any) => {
if (!values.language) return "validation.language";
if (!values.voice) return "validation.voice";
// @ts-expect-error
@ -145,25 +144,20 @@ const getAvailableNumbers = async (providerId: string) => {
}
};
const sidToNumber = (sid: any) => {
return availableNumbers
.filter(({ id }) => id === sid)
.map(({ name }) => name)[0];
};
const sidToNumber = (sid: any) =>
availableNumbers.filter(({ id }) => id === sid).map(({ name }) => name)[0];
export const populateNumber = (data: any) => {
return {
...data,
number: sidToNumber(data.providerLineSid),
};
};
export const populateNumber = (data: any) => ({
...data,
number: sidToNumber(data.providerLineSid),
});
const hasNumbers = (
args: any,
value: any,
values: any,
translate: any,
...props: any[]
_args: any,
_value: any,
_values: any,
_translate: any,
..._props: any[]
) => {
if (noAvailableNumbers) return "validation.noAvailableNumbers";
@ -197,7 +191,7 @@ export const AvailableNumbersInput = (form: any, ...rest: any[]) => {
notify("validation.noAvailableNumbers", { type: "error" });
setLoading(false);
}
}, [form && form.formData ? form.formData.providerId : undefined]);
}, [form, notify, translate]);
return (
<>

View file

@ -22,35 +22,30 @@ import { BackendTypeInput, BackendIdInput, HttpMethodInput } from "./shared";
<SelectInput optionText="number" />
</ReferenceInput>
*/
const WebhookCreate = (props: CreateProps) => {
return (
<Create {...props} title="Create Webhooks">
<SimpleForm>
<TextInput source="name" validate={[required()]} />
<BackendTypeInput />
<FormDataConsumer subscription={{ values: true }}>
{BackendIdInput}
</FormDataConsumer>
<TextInput
source="endpointUrl"
validate={[required(), regex(/^https?:\/\/[^/]+/, "validation.url")]}
/>
<HttpMethodInput />
<ArrayInput source="headers">
<SimpleFormIterator>
<TextInput
source="header"
validate={[
required(),
regex(/^[\w-]+$/, "validation.headerName"),
]}
/>
<TextInput source="value" validate={[required()]} />
</SimpleFormIterator>
</ArrayInput>
</SimpleForm>
</Create>
);
};
const WebhookCreate = (props: CreateProps) => (
<Create {...props} title="Create Webhooks">
<SimpleForm>
<TextInput source="name" validate={[required()]} />
<BackendTypeInput />
<FormDataConsumer subscription={{ values: true }}>
{BackendIdInput}
</FormDataConsumer>
<TextInput
source="endpointUrl"
validate={[required(), regex(/^https?:\/\/[^/]+/, "validation.url")]}
/>
<HttpMethodInput />
<ArrayInput source="headers">
<SimpleFormIterator>
<TextInput
source="header"
validate={[required(), regex(/^[\w-]+$/, "validation.headerName")]}
/>
<TextInput source="value" validate={[required()]} />
</SimpleFormIterator>
</ArrayInput>
</SimpleForm>
</Create>
);
export default WebhookCreate;

View file

@ -13,39 +13,34 @@ import { BackendTypeInput, BackendIdInput, HttpMethodInput } from "./shared";
const WebhookTitle = ({ record }: any) => {
let title = "";
if (record) title = record.name ? record.name : record.email;
if (record) title = record.name ?? record.email;
return <span>Webhook {title}</span>;
};
const WebhookEdit = (props: EditProps) => {
return (
<Edit title={<WebhookTitle />} {...props}>
<SimpleForm>
<TextInput source="name" validate={[required()]} />
<BackendTypeInput />
<FormDataConsumer subscription={{ values: true }}>
{BackendIdInput}
</FormDataConsumer>
<TextInput
source="endpointUrl"
validate={[required(), regex(/^https?:\/\/[^/]+/, "validation.url")]}
/>
<HttpMethodInput />
<ArrayInput source="headers">
<SimpleFormIterator>
<TextInput
source="header"
validate={[
required(),
regex(/^[\w-]+$/, "validation.headerName"),
]}
/>
<TextInput source="value" validate={[required()]} />
</SimpleFormIterator>
</ArrayInput>
</SimpleForm>
</Edit>
);
};
const WebhookEdit = (props: EditProps) => (
<Edit title={<WebhookTitle />} {...props}>
<SimpleForm>
<TextInput source="name" validate={[required()]} />
<BackendTypeInput />
<FormDataConsumer subscription={{ values: true }}>
{BackendIdInput}
</FormDataConsumer>
<TextInput
source="endpointUrl"
validate={[required(), regex(/^https?:\/\/[^/]+/, "validation.url")]}
/>
<HttpMethodInput />
<ArrayInput source="headers">
<SimpleFormIterator>
<TextInput
source="header"
validate={[required(), regex(/^[\w-]+$/, "validation.headerName")]}
/>
<TextInput source="value" validate={[required()]} />
</SimpleFormIterator>
</ArrayInput>
</SimpleForm>
</Edit>
);
export default WebhookEdit;

View file

@ -1,11 +1,4 @@
import {
List,
Datagrid,
DateField,
TextField,
ReferenceField,
ListProps,
} from "react-admin";
import { List, Datagrid, DateField, TextField, ListProps } from "react-admin";
import { BackendIdField } from "./shared";
const WebhookList = (props: ListProps) => (

View file

@ -145,6 +145,7 @@ const WhatsappBotShow = (props: ShowProps) => {
}, 10000);
return () => clearInterval(interval);
}
return undefined;
}, [refresh, data]);

View file

@ -1,3 +1,4 @@
/* eslint-disable react/display-name */
import {
SelectInput,
required,
@ -6,19 +7,25 @@ import {
TextField,
} from "react-admin";
export const WhatsAppBotSelectInput = (source: string) => () => (
<ReferenceInput
label="WhatsApp Bot"
reference="whatsappBots"
source={source}
validate={[required()]}
>
<SelectInput optionText="phoneNumber" />
</ReferenceInput>
);
export const WhatsAppBotSelectInput = (source: string) => () =>
(
<ReferenceInput
label="WhatsApp Bot"
reference="whatsappBots"
source={source}
validate={[required()]}
>
<SelectInput optionText="phoneNumber" />
</ReferenceInput>
);
export const WhatsAppBotField = (source: string) => () => (
<ReferenceField label="WhatsApp Bot" reference="whatsappBots" source={source}>
<TextField source="phoneNumber" />
</ReferenceField>
);
export const WhatsAppBotField = (source: string) => () =>
(
<ReferenceField
label="WhatsApp Bot"
reference="whatsappBots"
source={source}
>
<TextField source="phoneNumber" />
</ReferenceField>
);

View file

@ -1,4 +1,4 @@
import { IncomingMessage } from "http";
import { IncomingMessage } from "node:http";
function absoluteUrl(
req?: IncomingMessage,

View file

@ -36,5 +36,5 @@ export const apolloClient = new ApolloClient({
fetchPolicy: "no-cache",
errorPolicy: "all",
},
},*/
}, */
});

View file

@ -1,11 +1,11 @@
import { promisify } from "util";
import { promisify } from "node:util";
import jwt from "jsonwebtoken";
import jwksClient from "jwks-rsa";
import * as Boom from "@hapi/boom";
import * as Wreck from "@hapi/wreck";
import Providers from "next-auth/providers";
import Credentials from "next-auth/providers/credentials";
import type { Adapter } from "next-auth/adapters";
import type { IncomingMessage } from "http";
import type { IncomingMessage } from "node:http";
const CF_JWT_HEADER_NAME = "cf-access-jwt-assertion";
const CF_JWT_ALGOS = ["RS256"];
@ -30,7 +30,7 @@ export const cfVerifier = (audience: string, domain: string): VerifyFn => {
return async (token) => {
const getKey = (header: any, callback: any) => {
client.getSigningKey(header.kid, function (err: any, key: any) {
client.getSigningKey(header.kid, (err: any, key: any) => {
if (err)
throw Boom.serverUnavailable(
"failed to fetch cloudflare access jwks"
@ -201,8 +201,8 @@ export const CloudflareAccessProvider = (
req: IncomingMessage
) => {
const verifier = cfVerifier(audience, domain);
// @ts-expect-error
return Providers.Credentials({
return Credentials({
id: cloudflareAccountProvider,
name: "Cloudflare Access",
credentials: {},

View file

@ -2,16 +2,14 @@ import pgDataProvider from "ra-postgraphile";
import schema from "./graphql-schema.json";
export const metamigoDataProvider = async (client: any) => {
const graphqlDataProvider = await pgDataProvider(
const graphqlDataProvider: any = await pgDataProvider(
client,
// @ts-expect-error: Missing property
{},
{ introspection: { schema: schema.data.__schema } }
);
const dataProvider = async (type: any, resource: any, params: any) => {
return graphqlDataProvider(type, resource, params);
};
const dataProvider = async (type: any, resource: any, params: any) => graphqlDataProvider(type, resource, params);
return dataProvider;
};

View file

@ -30,7 +30,7 @@ export interface Session {
// from https://github.com/nextauthjs/next-auth/blob/main/src/lib/errors.js
class UnknownError extends Error {
constructor(message) {
constructor(message: any) {
super(message);
this.name = "UnknownError";
this.message = message;
@ -48,14 +48,14 @@ class UnknownError extends Error {
}
class CreateUserError extends UnknownError {
constructor(message) {
constructor(message: any) {
super(message);
this.name = "CreateUserError";
this.message = message;
}
}
const basicHeader = (secret) =>
const basicHeader = (secret: any) =>
"Basic " + Buffer.from(secret + ":", "utf8").toString("base64");
export const MetamigoAdapter = (config: IAppConfig): Adapter => {
@ -155,7 +155,7 @@ export const MetamigoAdapter = (config: IAppConfig): Adapter => {
await wreck.put("linkAccount", {
payload,
});
} catch (error) {
} catch {
throw new Error("LINK_ACCOUNT_ERROR");
}
}
@ -208,7 +208,7 @@ export const MetamigoAdapter = (config: IAppConfig): Adapter => {
}
}
return Promise.resolve({
return {
createUser,
getUser,
getUserByEmail,
@ -222,7 +222,7 @@ export const MetamigoAdapter = (config: IAppConfig): Adapter => {
updateSession,
deleteSession,
// @ts-expect-error: Type error
} as AdapterInstance<Profile, User, Session, unknown>);
} as AdapterInstance<Profile, User, Session, unknown>;
}
return {

View file

@ -4,14 +4,12 @@ export const E164Regex = /^\+[1-9]\d{1,14}$/;
/**
* Returns true if the number is a valid E164 number
*/
export const isValidE164Number = (phoneNumber) => {
return E164Regex.test(phoneNumber);
};
export const isValidE164Number = (phoneNumber: string) => E164Regex.test(phoneNumber);
/**
* Given a phone number approximation, will clean out whitespace and punctuation.
*/
export const sanitizeE164Number = (phoneNumber) => {
export const sanitizeE164Number = (phoneNumber: string) => {
if (!phoneNumber) return "";
if (!phoneNumber.trim()) return "";
const sanitized = phoneNumber

View file

@ -1,4 +1,5 @@
module.exports = {
experimental: { esmExternals: "loose" },
async redirects() {
return [{ source: "/", destination: "/admin", permanent: true }];
},

View file

@ -4,7 +4,7 @@ import { SessionProvider } from "next-auth/react";
function MetamigoStarter({ Component, pageProps }: AppProps) {
return (
<SessionProvider session={pageProps.session}>
<SessionProvider session={(pageProps as any).session}>
<Component {...pageProps} />
</SessionProvider>
);

View file

@ -4,7 +4,7 @@ import Google from "next-auth/providers/google";
import GitHub from "next-auth/providers/github";
import GitLab from "next-auth/providers/gitlab";
import Cognito from "next-auth/providers/cognito";
import { loadConfig, IAppConfig } from "config";
import { loadConfig, IAppConfig } from "@digiresilience/metamigo-config";
import { MetamigoAdapter } from "../../../lib/nextauth-adapter";
import { CloudflareAccessProvider } from "../../../lib/cloudflare";
@ -72,12 +72,12 @@ const nextAuthOptions = (config: IAppConfig, req: NextApiRequest) => {
providers,
adapter,
callbacks: {
session: async (session: any, token: any) => {
async session(session: any, token: any) {
// make the user id available in the react client
session.user.id = token.userId;
return session;
},
jwt: async (token: any, user: any) => {
async jwt(token: any, user: any) {
const isSignIn = Boolean(user);
// Add auth_time to token on signin in
if (isSignIn) {

View file

@ -8,7 +8,7 @@ export default createProxyMiddleware({
changeOrigin: true,
pathRewrite: { "^/graphql": "/graphql" },
xfwd: true,
onProxyReq: function (proxyReq, req, _res) {
onProxyReq(proxyReq, req, _res) {
const auth = proxyReq.getHeader("authorization");
if (auth) {
// pass along user provided authorization header
@ -20,8 +20,8 @@ export default createProxyMiddleware({
let token = req.cookies["__Secure-next-auth.session-token"];
if (!token) token = req.cookies["next-auth.session-token"];
//console.log(req.body);
//if (req.body.query) console.log(req.body.query);
// console.log(req.body);
// if (req.body.query) console.log(req.body.query);
if (token) {
proxyReq.setHeader("authorization", `Bearer ${token}`);
proxyReq.removeHeader("cookie");

View file

@ -8,7 +8,7 @@ export default createProxyMiddleware({
changeOrigin: true,
pathRewrite: { "^/api/v1": "/api" },
xfwd: true,
onProxyReq: function (proxyReq, req, res) {
onProxyReq(proxyReq, req) {
const auth = proxyReq.getHeader("authorization");
if (auth) {
// pass along user provided authorization header
@ -17,7 +17,7 @@ export default createProxyMiddleware({
// Else extract the session token from the cookie and pass
// as bearer token to the proxy target
//const token = req.cookies["next-auth.session-token"];
// const token = req.cookies["next-auth.session-token"];
let token = req.cookies["__Secure-next-auth.session-token"];
if (!token) token = req.cookies["next-auth.session-token"];
@ -27,7 +27,6 @@ export default createProxyMiddleware({
} else {
console.error("no token found. proxied request to backend will fail.");
}
return;
},
});

View file

@ -1,6 +1,6 @@
import { NextPage } from "next";
import { Typography, Box, Button, Grid, Link } from "@material-ui/core";
import { FC, PropsWithChildren, useEffect } from "react";
import { FC, useEffect } from "react";
import { useRouter } from "next/router";
export const RedirectToAdmin: FC = ({ children }) => {

View file

@ -1,7 +1,8 @@
import { FC } from "react";
import { Button } from "@material-ui/core";
import { signIn, signOut, useSession } from "next-auth/react";
export default function myComponent() {
const MyComponent: FC = () => {
const { data: session } = useSession();
return (
@ -24,4 +25,6 @@ export default function myComponent() {
)}
</>
);
}
};
export default MyComponent;

674
package-lock.json generated
View file

@ -150,6 +150,7 @@
"react-dom": "^18",
"react-iframe": "^1.8.5",
"react-polyglot": "^0.7.2",
"sharp": "^0.30.7",
"swr": "^2.0.3"
},
"devDependencies": {
@ -7672,6 +7673,39 @@
"version": "1.0.2",
"license": "MIT"
},
"node_modules/bl": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
"integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
"dependencies": {
"buffer": "^5.5.0",
"inherits": "^2.0.4",
"readable-stream": "^3.4.0"
}
},
"node_modules/bl/node_modules/buffer": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"dependencies": {
"base64-js": "^1.3.1",
"ieee754": "^1.1.13"
}
},
"node_modules/blipp": {
"version": "4.0.2",
"license": "BSD",
@ -8277,6 +8311,18 @@
"version": "1.0.1",
"license": "MIT"
},
"node_modules/color": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz",
"integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==",
"dependencies": {
"color-convert": "^2.0.1",
"color-string": "^1.9.0"
},
"engines": {
"node": ">=12.5.0"
}
},
"node_modules/color-convert": {
"version": "1.9.3",
"license": "MIT",
@ -8288,6 +8334,15 @@
"version": "1.1.3",
"license": "MIT"
},
"node_modules/color-string": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
"integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
"dependencies": {
"color-name": "^1.0.0",
"simple-swizzle": "^0.2.2"
}
},
"node_modules/color-support": {
"version": "1.1.3",
"license": "ISC",
@ -8296,6 +8351,22 @@
"color-support": "bin.js"
}
},
"node_modules/color/node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/color/node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"node_modules/colorette": {
"version": "2.0.19",
"dev": true,
@ -8649,6 +8720,20 @@
"node": ">=0.10"
}
},
"node_modules/decompress-response": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
"integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",
"dependencies": {
"mimic-response": "^3.1.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/dedent": {
"version": "0.7.0",
"license": "MIT"
@ -8680,6 +8765,14 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/deep-extend": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/deep-is": {
"version": "0.1.4",
"license": "MIT"
@ -8779,7 +8872,6 @@
"node_modules/detect-libc": {
"version": "2.0.1",
"license": "Apache-2.0",
"optional": true,
"engines": {
"node": ">=8"
}
@ -10162,6 +10254,14 @@
"node": ">= 0.8.0"
}
},
"node_modules/expand-template": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
"integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==",
"engines": {
"node": ">=6"
}
},
"node_modules/expect": {
"version": "29.5.0",
"dev": true,
@ -10505,6 +10605,11 @@
"version": "1.0.5",
"license": "MIT"
},
"node_modules/fs-constants": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
},
"node_modules/fs-minipass": {
"version": "2.1.0",
"license": "ISC",
@ -10666,6 +10771,11 @@
"url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
}
},
"node_modules/github-from-package": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
"integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="
},
"node_modules/glob": {
"version": "7.2.3",
"license": "ISC",
@ -12076,6 +12186,11 @@
"version": "2.0.4",
"license": "ISC"
},
"node_modules/ini": {
"version": "1.3.8",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
},
"node_modules/inline-style-parser": {
"version": "0.1.1",
"license": "MIT"
@ -15037,6 +15152,7 @@
},
"node_modules/libsignal": {
"version": "2.0.1",
"resolved": "git+ssh://git@github.com/adiwajshing/libsignal-node.git#11dbd962ea108187c79a7c46fe4d6f790e23da97",
"license": "GPL-3.0",
"dependencies": {
"curve25519-js": "^0.0.4",
@ -15955,6 +16071,17 @@
"node": ">=6"
}
},
"node_modules/mimic-response": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
"integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/min-indent": {
"version": "1.0.1",
"license": "MIT",
@ -16025,6 +16152,11 @@
"node": ">=10"
}
},
"node_modules/mkdirp-classic": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
},
"node_modules/mo-walk": {
"version": "1.2.0",
"license": "MIT",
@ -16110,6 +16242,11 @@
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
"node_modules/napi-build-utils": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz",
"integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg=="
},
"node_modules/natural-compare": {
"version": "1.4.0",
"license": "MIT"
@ -16257,6 +16394,52 @@
"tslib": "^2.0.3"
}
},
"node_modules/node-abi": {
"version": "3.33.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.33.0.tgz",
"integrity": "sha512-7GGVawqyHF4pfd0YFybhv/eM9JwTtPqx0mAanQ146O3FlSh3pA24zf9IRQTOsfTSqXTNzPSP5iagAJ94jjuVog==",
"dependencies": {
"semver": "^7.3.5"
},
"engines": {
"node": ">=10"
}
},
"node_modules/node-abi/node_modules/lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dependencies": {
"yallist": "^4.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/node-abi/node_modules/semver": {
"version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/node-abi/node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
},
"node_modules/node-addon-api": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz",
"integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA=="
},
"node_modules/node-cache": {
"version": "5.1.2",
"license": "MIT",
@ -17596,6 +17779,31 @@
"version": "3.8.0",
"license": "MIT"
},
"node_modules/prebuild-install": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz",
"integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==",
"dependencies": {
"detect-libc": "^2.0.0",
"expand-template": "^2.0.3",
"github-from-package": "0.0.0",
"minimist": "^1.2.3",
"mkdirp-classic": "^0.5.3",
"napi-build-utils": "^1.0.1",
"node-abi": "^3.3.0",
"pump": "^3.0.0",
"rc": "^1.2.7",
"simple-get": "^4.0.0",
"tar-fs": "^2.0.0",
"tunnel-agent": "^0.6.0"
},
"bin": {
"prebuild-install": "bin.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/precond": {
"version": "0.2.3",
"engines": {
@ -17921,7 +18129,6 @@
},
"node_modules/pump": {
"version": "3.0.0",
"dev": true,
"license": "MIT",
"dependencies": {
"end-of-stream": "^1.1.0",
@ -18188,6 +18395,28 @@
"node": ">= 0.8"
}
},
"node_modules/rc": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
"integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
"dependencies": {
"deep-extend": "^0.6.0",
"ini": "~1.3.0",
"minimist": "^1.2.0",
"strip-json-comments": "~2.0.1"
},
"bin": {
"rc": "cli.js"
}
},
"node_modules/rc/node_modules/strip-json-comments": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
"integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/react": {
"version": "17.0.2",
"license": "MIT",
@ -19141,6 +19370,58 @@
"sha.js": "bin.js"
}
},
"node_modules/sharp": {
"version": "0.30.7",
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.30.7.tgz",
"integrity": "sha512-G+MY2YW33jgflKPTXXptVO28HvNOo9G3j0MybYAHeEmby+QuD2U98dT6ueht9cv/XDqZspSpIhoSW+BAKJ7Hig==",
"hasInstallScript": true,
"dependencies": {
"color": "^4.2.3",
"detect-libc": "^2.0.1",
"node-addon-api": "^5.0.0",
"prebuild-install": "^7.1.1",
"semver": "^7.3.7",
"simple-get": "^4.0.1",
"tar-fs": "^2.1.1",
"tunnel-agent": "^0.6.0"
},
"engines": {
"node": ">=12.13.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
}
},
"node_modules/sharp/node_modules/lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dependencies": {
"yallist": "^4.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/sharp/node_modules/semver": {
"version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/sharp/node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
},
"node_modules/shebang-command": {
"version": "2.0.0",
"license": "MIT",
@ -19185,6 +19466,62 @@
"version": "3.0.7",
"license": "ISC"
},
"node_modules/simple-concat": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
"integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
]
},
"node_modules/simple-get": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",
"integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"dependencies": {
"decompress-response": "^6.0.0",
"once": "^1.3.1",
"simple-concat": "^1.0.0"
}
},
"node_modules/simple-swizzle": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
"integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",
"dependencies": {
"is-arrayish": "^0.3.1"
}
},
"node_modules/simple-swizzle/node_modules/is-arrayish": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
"integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
},
"node_modules/simple-update-notifier": {
"version": "1.1.0",
"dev": true,
@ -19777,6 +20114,37 @@
"node": ">=10"
}
},
"node_modules/tar-fs": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
"integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==",
"dependencies": {
"chownr": "^1.1.1",
"mkdirp-classic": "^0.5.2",
"pump": "^3.0.0",
"tar-stream": "^2.1.4"
}
},
"node_modules/tar-fs/node_modules/chownr": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
},
"node_modules/tar-stream": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
"integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
"dependencies": {
"bl": "^4.0.3",
"end-of-stream": "^1.4.1",
"fs-constants": "^1.0.0",
"inherits": "^2.0.3",
"readable-stream": "^3.1.1"
},
"engines": {
"node": ">=6"
}
},
"node_modules/tar/node_modules/yallist": {
"version": "4.0.0",
"license": "ISC",
@ -20260,6 +20628,17 @@
"version": "1.14.1",
"license": "0BSD"
},
"node_modules/tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
"integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==",
"dependencies": {
"safe-buffer": "^5.0.1"
},
"engines": {
"node": "*"
}
},
"node_modules/twilio": {
"version": "3.84.1",
"license": "MIT",
@ -29424,6 +29803,27 @@
"bintrees": {
"version": "1.0.2"
},
"bl": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
"integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
"requires": {
"buffer": "^5.5.0",
"inherits": "^2.0.4",
"readable-stream": "^3.4.0"
},
"dependencies": {
"buffer": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
"requires": {
"base64-js": "^1.3.1",
"ieee754": "^1.1.13"
}
}
}
},
"blipp": {
"version": "4.0.2",
"requires": {
@ -29773,6 +30173,30 @@
"collect-v8-coverage": {
"version": "1.0.1"
},
"color": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz",
"integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==",
"requires": {
"color-convert": "^2.0.1",
"color-string": "^1.9.0"
},
"dependencies": {
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
}
}
},
"color-convert": {
"version": "1.9.3",
"requires": {
@ -29782,6 +30206,15 @@
"color-name": {
"version": "1.1.3"
},
"color-string": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
"integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
"requires": {
"color-name": "^1.0.0",
"simple-swizzle": "^0.2.2"
}
},
"color-support": {
"version": "1.1.3",
"optional": true
@ -30002,6 +30435,14 @@
"decode-uri-component": {
"version": "0.2.2"
},
"decompress-response": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
"integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",
"requires": {
"mimic-response": "^3.1.0"
}
},
"dedent": {
"version": "0.7.0"
},
@ -30028,6 +30469,11 @@
"which-typed-array": "^1.1.9"
}
},
"deep-extend": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="
},
"deep-is": {
"version": "0.1.4"
},
@ -30078,8 +30524,7 @@
"version": "1.2.0"
},
"detect-libc": {
"version": "2.0.1",
"optional": true
"version": "2.0.1"
},
"detect-newline": {
"version": "3.1.0"
@ -30978,6 +31423,11 @@
"exit": {
"version": "0.1.2"
},
"expand-template": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
"integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg=="
},
"expect": {
"version": "29.5.0",
"dev": true,
@ -31202,6 +31652,11 @@
"format-util": {
"version": "1.0.5"
},
"fs-constants": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
},
"fs-minipass": {
"version": "2.1.0",
"optional": true,
@ -31296,6 +31751,11 @@
"version": "4.4.0",
"dev": true
},
"github-from-package": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
"integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="
},
"glob": {
"version": "7.2.3",
"requires": {
@ -32244,6 +32704,11 @@
"inherits": {
"version": "2.0.4"
},
"ini": {
"version": "1.3.8",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
},
"inline-style-parser": {
"version": "0.1.1"
},
@ -34975,7 +35440,8 @@
}
},
"libsignal": {
"version": "2.0.1",
"version": "git+ssh://git@github.com/adiwajshing/libsignal-node.git#11dbd962ea108187c79a7c46fe4d6f790e23da97",
"from": "libsignal@git+https://github.com/adiwajshing/libsignal-node",
"requires": {
"curve25519-js": "^0.0.4",
"protobufjs": "6.8.8"
@ -35053,6 +35519,7 @@
"react-dom": "^18",
"react-iframe": "^1.8.5",
"react-polyglot": "^0.7.2",
"sharp": "^0.30.7",
"swr": "^2.0.3",
"typescript": "^4.9.5"
},
@ -35639,7 +36106,7 @@
"react-timer-hook": "^3.0.5",
"swr": "^2.0.0",
"tsconfig-link": "*",
"twilio-client": "*",
"twilio-client": "^1.15.0",
"typescript": "^4.9.5"
},
"dependencies": {
@ -35943,6 +36410,11 @@
"mimic-fn": {
"version": "2.1.0"
},
"mimic-response": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
"integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="
},
"min-indent": {
"version": "1.0.1"
},
@ -35983,6 +36455,11 @@
"mkdirp": {
"version": "1.0.4"
},
"mkdirp-classic": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
},
"mo-walk": {
"version": "1.2.0",
"requires": {
@ -36040,6 +36517,11 @@
"nanoid": {
"version": "3.3.4"
},
"napi-build-utils": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz",
"integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg=="
},
"natural-compare": {
"version": "1.4.0"
},
@ -36133,6 +36615,42 @@
"tslib": "^2.0.3"
}
},
"node-abi": {
"version": "3.33.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.33.0.tgz",
"integrity": "sha512-7GGVawqyHF4pfd0YFybhv/eM9JwTtPqx0mAanQ146O3FlSh3pA24zf9IRQTOsfTSqXTNzPSP5iagAJ94jjuVog==",
"requires": {
"semver": "^7.3.5"
},
"dependencies": {
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"requires": {
"yallist": "^4.0.0"
}
},
"semver": {
"version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
"requires": {
"lru-cache": "^6.0.0"
}
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
}
}
},
"node-addon-api": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz",
"integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA=="
},
"node-cache": {
"version": "5.1.2",
"requires": {
@ -36947,6 +37465,25 @@
}
}
},
"prebuild-install": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz",
"integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==",
"requires": {
"detect-libc": "^2.0.0",
"expand-template": "^2.0.3",
"github-from-package": "0.0.0",
"minimist": "^1.2.3",
"mkdirp-classic": "^0.5.3",
"napi-build-utils": "^1.0.1",
"node-abi": "^3.3.0",
"pump": "^3.0.0",
"rc": "^1.2.7",
"simple-get": "^4.0.0",
"tar-fs": "^2.0.0",
"tunnel-agent": "^0.6.0"
}
},
"precond": {
"version": "0.2.3"
},
@ -37189,7 +37726,6 @@
},
"pump": {
"version": "3.0.0",
"dev": true,
"requires": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
@ -37356,6 +37892,24 @@
}
}
},
"rc": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
"integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
"requires": {
"deep-extend": "^0.6.0",
"ini": "~1.3.0",
"minimist": "^1.2.0",
"strip-json-comments": "~2.0.1"
},
"dependencies": {
"strip-json-comments": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
"integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ=="
}
}
},
"react": {
"version": "17.0.2",
"requires": {
@ -37903,6 +38457,44 @@
"safe-buffer": "^5.0.1"
}
},
"sharp": {
"version": "0.30.7",
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.30.7.tgz",
"integrity": "sha512-G+MY2YW33jgflKPTXXptVO28HvNOo9G3j0MybYAHeEmby+QuD2U98dT6ueht9cv/XDqZspSpIhoSW+BAKJ7Hig==",
"requires": {
"color": "^4.2.3",
"detect-libc": "^2.0.1",
"node-addon-api": "^5.0.0",
"prebuild-install": "^7.1.1",
"semver": "^7.3.7",
"simple-get": "^4.0.1",
"tar-fs": "^2.1.1",
"tunnel-agent": "^0.6.0"
},
"dependencies": {
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"requires": {
"yallist": "^4.0.0"
}
},
"semver": {
"version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
"requires": {
"lru-cache": "^6.0.0"
}
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
}
}
},
"shebang-command": {
"version": "2.0.0",
"requires": {
@ -37933,6 +38525,36 @@
"signal-exit": {
"version": "3.0.7"
},
"simple-concat": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
"integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q=="
},
"simple-get": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",
"integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",
"requires": {
"decompress-response": "^6.0.0",
"once": "^1.3.1",
"simple-concat": "^1.0.0"
}
},
"simple-swizzle": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
"integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",
"requires": {
"is-arrayish": "^0.3.1"
},
"dependencies": {
"is-arrayish": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
"integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
}
}
},
"simple-update-notifier": {
"version": "1.1.0",
"dev": true,
@ -38299,6 +38921,36 @@
}
}
},
"tar-fs": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
"integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==",
"requires": {
"chownr": "^1.1.1",
"mkdirp-classic": "^0.5.2",
"pump": "^3.0.0",
"tar-stream": "^2.1.4"
},
"dependencies": {
"chownr": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
}
}
},
"tar-stream": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
"integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
"requires": {
"bl": "^4.0.3",
"end-of-stream": "^1.4.1",
"fs-constants": "^1.0.0",
"inherits": "^2.0.3",
"readable-stream": "^3.1.1"
}
},
"tdigest": {
"version": "0.1.2",
"requires": {
@ -38604,6 +39256,14 @@
}
}
},
"tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
"integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==",
"requires": {
"safe-buffer": "^5.0.1"
}
},
"twilio": {
"version": "3.84.1",
"requires": {

View file

@ -29,6 +29,7 @@ module.exports = {
"no-use-extend-native/no-use-extend-native": "error",
// this one breaks libraries like Ramda and lodash
"unicorn/no-array-callback-reference": "off",
"unicorn/filename-case": "off",
"unicorn/better-regex": [
"error",
{

View file

@ -16,13 +16,8 @@ module.exports = {
},
],
"no-extra-semi": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-extra-semi": "error",
"@typescript-eslint/ban-ts-comment": [
"error",
{
"ts-nocheck": "allow-with-description",
"ts-expect-error": "allow-with-description",
},
],
},
};

View file

@ -1,7 +1,6 @@
import chalk from "chalk";
import convict from "convict";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const visitLeaf = (path: any, key: any, leaf: any) => {
if (leaf.skipGenerate) {
return;
@ -21,7 +20,6 @@ const visitLeaf = (path: any, key: any, leaf: any) => {
console.log(`\tenv: ${leaf.env}`);
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const visitNode = (path: any, node: any, key = "") => {
if (node._cvtProperties) {
const keys = Object.keys(node._cvtProperties);
@ -36,7 +34,6 @@ const visitNode = (path: any, node: any, key = "") => {
}
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const printConfigOptions = (conf: convict.Config<any>): void => {
const schema = conf.getSchema();
visitNode("", schema);

View file

@ -12,7 +12,6 @@ export const defaultSessionMaxAge = 30 * 24 * 60 * 60 * 1000;
// Sessions updated only if session is greater than this value (0 = always)
export const defaulteSessionUpdateAge = 24 * 60 * 60 * 1000;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const getCompoundId = (providerId: any, providerAccountId: any) =>
createHash("sha256")
.update(`${providerId}:${providerAccountId}`)
@ -27,7 +26,7 @@ export class NextAuthAdapter<TRepositories extends IMetamigoRepositories>
private repos: TRepositories,
private readonly sessionMaxAge = defaultSessionMaxAge,
private readonly sessionUpdateAge = defaulteSessionUpdateAge
) {}
) { }
async createUser(profile: UnsavedUser): Promise<SavedUser> {
// @ts-expect-error Typescript doesn't like lodash's omit()

View file

@ -5,7 +5,8 @@
"outDir": "build/main",
"rootDir": "src",
"baseUrl": "./",
"types": ["jest", "node"]
"types": ["jest", "node"],
"esModuleInterop": true
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules/**"]