Compare commits
8 Commits
a92c43ab1b
...
detached2
| Author | SHA1 | Date | |
|---|---|---|---|
| 1c3406e257 | |||
| ebaf5c2cab | |||
| d09664ad57 | |||
| e43a8b0865 | |||
| 6efb75ab30 | |||
| 6549729fed | |||
| 63e4654502 | |||
| a812e650ce |
1
.env.example
Normal file
1
.env.example
Normal file
@ -0,0 +1 @@
|
|||||||
|
NEXT_PUBLIC_API_URL=http://your.api/api
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -122,7 +122,7 @@ dist
|
|||||||
.vscode-test
|
.vscode-test
|
||||||
|
|
||||||
# yarn v2
|
# yarn v2
|
||||||
|
.yarn
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
.idea
|
.idea
|
||||||
|
|||||||
BIN
.yarn/install-state.gz
Normal file
BIN
.yarn/install-state.gz
Normal file
Binary file not shown.
6
build_docker.sh
Normal file → Executable file
6
build_docker.sh
Normal file → Executable file
@ -1,4 +1,2 @@
|
|||||||
sudo docker build -t git.logidex.ru/aserbin/logidex-id-frontend:latest .
|
docker build -t git.logidex.ru/fakz9/logidex-id-frontend:latest .
|
||||||
sudo docker images git.logidex.ru/aserbin/logidex-id-frontend:latest
|
docker push git.logidex.ru/fakz9/logidex-id-frontend:latest
|
||||||
sudo docker login git.logidex.ru
|
|
||||||
sudo docker push git.logidex.ru/aserbin/logidex-id-frontend:latest
|
|
||||||
|
|||||||
21
openapi-ts.config.ts
Normal file
21
openapi-ts.config.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import { defaultPlugins, defineConfig } from "@hey-api/openapi-ts";
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
input: "../back/combined.yaml",
|
||||||
|
output: "src/client",
|
||||||
|
plugins: [
|
||||||
|
...defaultPlugins,
|
||||||
|
{
|
||||||
|
asClass: true,
|
||||||
|
name: "@hey-api/sdk",
|
||||||
|
validator: "zod",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "@hey-api/client-next",
|
||||||
|
runtimeConfigPath:"./src/hey-api-config.ts",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "@hey-api/typescript",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
@ -17,7 +17,8 @@
|
|||||||
"prettier:write": "prettier --write \"**/*.{ts,tsx}\"",
|
"prettier:write": "prettier --write \"**/*.{ts,tsx}\"",
|
||||||
"test": "npm run prettier:check && npm run lint && npm run typecheck && npm run jest",
|
"test": "npm run prettier:check && npm run lint && npm run typecheck && npm run jest",
|
||||||
"storybook": "storybook dev -p 6006",
|
"storybook": "storybook dev -p 6006",
|
||||||
"storybook:build": "storybook build"
|
"storybook:build": "storybook build",
|
||||||
|
"openapi-ts": "openapi-ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mantine/core": "8.1.2",
|
"@mantine/core": "8.1.2",
|
||||||
@ -38,11 +39,13 @@
|
|||||||
"react-imask": "^7.6.1",
|
"react-imask": "^7.6.1",
|
||||||
"react-redux": "^9.2.0",
|
"react-redux": "^9.2.0",
|
||||||
"redux-persist": "^6.0.0",
|
"redux-persist": "^6.0.0",
|
||||||
"sharp": "^0.34.3"
|
"sharp": "^0.34.3",
|
||||||
|
"zod": "^4.0.10"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.27.4",
|
"@babel/core": "^7.27.4",
|
||||||
"@eslint/js": "^9.29.0",
|
"@eslint/js": "^9.29.0",
|
||||||
|
"@hey-api/openapi-ts": "0.80.1",
|
||||||
"@ianvs/prettier-plugin-sort-imports": "^4.4.2",
|
"@ianvs/prettier-plugin-sort-imports": "^4.4.2",
|
||||||
"@storybook/nextjs": "^8.6.8",
|
"@storybook/nextjs": "^8.6.8",
|
||||||
"@storybook/react": "^8.6.8",
|
"@storybook/react": "^8.6.8",
|
||||||
|
|||||||
@ -1,15 +1,17 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { FC, useEffect, useState } from "react";
|
import { FC, useEffect, useState } from "react";
|
||||||
|
import { useSearchParams } from "next/navigation";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { Button, Text } from "@mantine/core";
|
import { Button, Text } from "@mantine/core";
|
||||||
|
import { Auth } from "@/client";
|
||||||
import SCOPES from "@/constants/scopes";
|
import SCOPES from "@/constants/scopes";
|
||||||
import { Scopes } from "@/enums/Scopes";
|
import { Scopes } from "@/enums/Scopes";
|
||||||
import { notifications } from "@/lib/notifications";
|
import { notifications } from "@/lib/notifications";
|
||||||
import { RootState } from "@/lib/store";
|
import { RootState } from "@/lib/store/store";
|
||||||
import { AuthService } from "@/mocks/authService";
|
|
||||||
|
|
||||||
const ConsentButton: FC = () => {
|
const ConsentButton: FC = () => {
|
||||||
|
const searchParams = useSearchParams();
|
||||||
const auth = useSelector((state: RootState) => state.auth);
|
const auth = useSelector((state: RootState) => state.auth);
|
||||||
const [clientName, setClientName] = useState<string>(Scopes.UNDEFINED);
|
const [clientName, setClientName] = useState<string>(Scopes.UNDEFINED);
|
||||||
const [serviceRequiredAccess, setServiceRequiredAccess] =
|
const [serviceRequiredAccess, setServiceRequiredAccess] =
|
||||||
@ -25,18 +27,7 @@ const ConsentButton: FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const requestConsent = () => {
|
const requestConsent = () => {
|
||||||
if (!auth.loginChallenge || auth.scope.length === 0) return;
|
|
||||||
|
|
||||||
new AuthService()
|
|
||||||
.requestConsent(auth.loginChallenge)
|
|
||||||
.then(response => response.data)
|
|
||||||
.then(({ clientName }) => {
|
|
||||||
setClientName(clientName);
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.error(error);
|
|
||||||
notifications.error({ message: error.toString() });
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -45,18 +36,38 @@ const ConsentButton: FC = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const confirmAccess = () => {
|
const confirmAccess = () => {
|
||||||
if (!auth.loginChallenge) return;
|
const phoneNumber = auth.phoneNumber;
|
||||||
|
if (!phoneNumber) {
|
||||||
new AuthService()
|
console.error("Phone number is not set");
|
||||||
.approveConsent(auth.loginChallenge)
|
return;
|
||||||
|
}
|
||||||
|
const consentChallenge = searchParams.get("consent_challenge");
|
||||||
|
if (!consentChallenge) {
|
||||||
|
console.error("Consent challenge is missing in the URL");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Auth.postAuthConsentAccept({
|
||||||
|
body: {
|
||||||
|
consent_challenge: consentChallenge,
|
||||||
|
phone_number: phoneNumber,
|
||||||
|
},
|
||||||
|
})
|
||||||
.then(response => response.data)
|
.then(response => response.data)
|
||||||
.then(({ redirectUrl }) => {
|
.then(response => {
|
||||||
window.location.href = redirectUrl;
|
if (!response) {
|
||||||
})
|
console.error("Response is empty");
|
||||||
.catch(error => {
|
return;
|
||||||
console.error(error);
|
}
|
||||||
notifications.error({ message: error.toString() });
|
const { redirect_url, ok, message } = response;
|
||||||
|
notifications.guess(ok, { message });
|
||||||
|
|
||||||
|
if (redirect_url) {
|
||||||
|
window.location.href = redirect_url;
|
||||||
|
} else {
|
||||||
|
console.error("Redirect URL is missing in the response");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import PageContainer from "@/components/PageContainer/PageContainer";
|
import PageContainer from "@/components/layout/PageContainer/PageContainer";
|
||||||
import PageItem from "@/components/PageBlock/PageItem";
|
import PageItem from "@/components/layout/PageBlock/PageItem";
|
||||||
import Logo from "@/components/Logo/Logo";
|
import Logo from "@/components/ui/Logo/Logo";
|
||||||
import ConsentForm from "@/app/consent/components/ConsentForm/ConsentForm";
|
import ConsentForm from "@/app/consent/components/ConsentForm/ConsentForm";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import LoginForm from "@/components/LoginForm/LoginForm";
|
import LoginForm from "@/components/features/LoginForm/LoginForm";
|
||||||
import Logo from "@/components/Logo/Logo";
|
import Logo from "@/components/ui/Logo/Logo";
|
||||||
import PageItem from "@/components/PageBlock/PageItem";
|
import PageItem from "@/components/layout/PageBlock/PageItem";
|
||||||
import PageContainer from "@/components/PageContainer/PageContainer";
|
import PageContainer from "@/components/layout/PageContainer/PageContainer";
|
||||||
|
|
||||||
export default function CreateIdPage() {
|
export default function CreateIdPage() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -6,11 +6,11 @@ import {
|
|||||||
mantineHtmlProps,
|
mantineHtmlProps,
|
||||||
MantineProvider,
|
MantineProvider,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import Header from "@/components/Header/Header";
|
import Header from "@/components/layout/Header/Header";
|
||||||
import { theme } from "@/theme";
|
import { theme } from "@/theme";
|
||||||
import "@/app/global.css";
|
import "@/app/global.css";
|
||||||
import { Notifications } from "@mantine/notifications";
|
import { Notifications } from "@mantine/notifications";
|
||||||
import Footer from "@/components/Footer/Footer";
|
import Footer from "@/components/layout/Footer/Footer";
|
||||||
import ReduxProvider from "@/providers/ReduxProvider";
|
import ReduxProvider from "@/providers/ReduxProvider";
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
|
|||||||
@ -1,18 +1,20 @@
|
|||||||
import LoginForm from "@/components/LoginForm/LoginForm";
|
import LoginForm from "@/components/features/LoginForm/LoginForm";
|
||||||
import Logo from "@/components/Logo/Logo";
|
import PageItem from "@/components/layout/PageBlock/PageItem";
|
||||||
import PageItem from "@/components/PageBlock/PageItem";
|
import PageContainer from "@/components/layout/PageContainer/PageContainer";
|
||||||
import PageContainer from "@/components/PageContainer/PageContainer";
|
import Logo from "@/components/ui/Logo/Logo";
|
||||||
|
|
||||||
interface LoginPageProps {
|
interface LoginPageProps {
|
||||||
searchParams: { login_challenge?: string };
|
searchParams: Promise<{ login_challenge?: string }>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function LoginPage({ searchParams }: LoginPageProps) {
|
export default async function LoginPage({ searchParams }: LoginPageProps) {
|
||||||
|
const params = await searchParams;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContainer center>
|
<PageContainer center>
|
||||||
<PageItem fullScreenMobile>
|
<PageItem fullScreenMobile>
|
||||||
<Logo title={"Вход"} />
|
<Logo title={"Вход"} />
|
||||||
<LoginForm loginChallenge={searchParams.login_challenge} />
|
<LoginForm loginChallenge={params.login_challenge} />
|
||||||
</PageItem>
|
</PageItem>
|
||||||
</PageContainer>
|
</PageContainer>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -4,13 +4,17 @@ import { useMemo } from "react";
|
|||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import { Button, Stack, Title } from "@mantine/core";
|
import { Button, Stack, Title } from "@mantine/core";
|
||||||
import styles from "@/app/services/components/ServicesList/ServicesList.module.css";
|
import styles from "@/app/services/components/ServicesList/ServicesList.module.css";
|
||||||
import TitleWithLines from "@/components/TitleWithLines/TitleWithLines";
|
import TitleWithLines from "@/components/ui/TitleWithLines/TitleWithLines";
|
||||||
import SCOPES from "@/constants/scopes";
|
import SCOPES from "@/constants/scopes";
|
||||||
import { Scopes } from "@/enums/Scopes";
|
import { Scopes } from "@/enums/Scopes";
|
||||||
import { setTargetService } from "@/lib/features/targetService/targetServiceSlice";
|
import { setTargetService } from "@/lib/store/features/targetService/targetServiceSlice";
|
||||||
import { useAppDispatch } from "@/lib/store";
|
import { useAppDispatch } from "@/lib/store/store";
|
||||||
import ServiceData from "@/types/ServiceData";
|
|
||||||
|
|
||||||
|
type ServiceData = {
|
||||||
|
id: number;
|
||||||
|
code: Scopes;
|
||||||
|
name: string;
|
||||||
|
};
|
||||||
const ServicesList = () => {
|
const ServicesList = () => {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const services = useMemo(
|
const services = useMemo(
|
||||||
@ -56,7 +60,9 @@ const ServicesList = () => {
|
|||||||
<Stack
|
<Stack
|
||||||
className={styles.container}
|
className={styles.container}
|
||||||
gap={"lg"}>
|
gap={"lg"}>
|
||||||
{services.map((service, i) => getServiceButton(service, i))}
|
{services.map((service, i) =>
|
||||||
|
getServiceButton(service as unknown as ServiceData, i)
|
||||||
|
)}
|
||||||
<TitleWithLines title="Скоро будет" />
|
<TitleWithLines title="Скоро будет" />
|
||||||
{getServiceInDevelopment("Analytics")}
|
{getServiceInDevelopment("Analytics")}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import Logo from "@/components/Logo/Logo";
|
import Logo from "@/components/ui/Logo/Logo";
|
||||||
import PageItem from "@/components/PageBlock/PageItem";
|
import PageItem from "@/components/layout/PageBlock/PageItem";
|
||||||
import PageContainer from "@/components/PageContainer/PageContainer";
|
import PageContainer from "@/components/layout/PageContainer/PageContainer";
|
||||||
import ServicesList from "@/app/services/components/ServicesList/ServicesList";
|
import ServicesList from "@/app/services/components/ServicesList/ServicesList";
|
||||||
|
|
||||||
export default function ServicesPage() {
|
export default function ServicesPage() {
|
||||||
|
|||||||
@ -3,9 +3,9 @@
|
|||||||
import { FC, useEffect, useState } from "react";
|
import { FC, useEffect, useState } from "react";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { Button } from "@mantine/core";
|
import { Button } from "@mantine/core";
|
||||||
import { setLastSendTime } from "@/lib/features/verification/verificationSlice";
|
|
||||||
import { RootState } from "@/lib/store";
|
|
||||||
import { MAX_COUNTDOWN } from "@/constants/verification";
|
import { MAX_COUNTDOWN } from "@/constants/verification";
|
||||||
|
import { setLastSendTime } from "@/lib/store/features/verification/verificationSlice";
|
||||||
|
import { RootState } from "@/lib/store/store";
|
||||||
|
|
||||||
const ResendVerificationCode: FC = () => {
|
const ResendVerificationCode: FC = () => {
|
||||||
const [countdown, setCountdown] = useState(0);
|
const [countdown, setCountdown] = useState(0);
|
||||||
|
|||||||
@ -7,10 +7,9 @@ import { Button, PinInput, Stack } from "@mantine/core";
|
|||||||
import { useForm } from "@mantine/form";
|
import { useForm } from "@mantine/form";
|
||||||
import ResendVerificationCode from "@/app/verify-phone/components/ResendVerificationCode/ResendVerificationCode";
|
import ResendVerificationCode from "@/app/verify-phone/components/ResendVerificationCode/ResendVerificationCode";
|
||||||
import style from "@/app/verify-phone/components/VerifyPhoneForm/VerifyPhone.module.css";
|
import style from "@/app/verify-phone/components/VerifyPhoneForm/VerifyPhone.module.css";
|
||||||
import { setScope } from "@/lib/features/auth/authSlice";
|
import { Auth } from "@/client";
|
||||||
import { notifications } from "@/lib/notifications";
|
import { notifications } from "@/lib/notifications";
|
||||||
import { RootState, useAppDispatch } from "@/lib/store";
|
import { RootState } from "@/lib/store/store";
|
||||||
import { AuthService } from "@/mocks/authService";
|
|
||||||
|
|
||||||
type VerifyNumberForm = {
|
type VerifyNumberForm = {
|
||||||
code: string;
|
code: string;
|
||||||
@ -26,25 +25,30 @@ const VerifyPhoneForm: FC = () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
const authState = useSelector((state: RootState) => state.auth);
|
const authState = useSelector((state: RootState) => state.auth);
|
||||||
const dispatch = useAppDispatch();
|
|
||||||
|
|
||||||
const handleSubmit = (values: VerifyNumberForm) => {
|
const handleSubmit = (values: VerifyNumberForm) => {
|
||||||
if (!authState.phoneNumber || !authState.loginChallenge) return;
|
|
||||||
|
|
||||||
new AuthService()
|
if (!authState.phoneNumber || !authState.loginChallenge) return;
|
||||||
.approveLogin(
|
console.log(authState.phoneNumber.replace(/ /g, ""));
|
||||||
authState.phoneNumber,
|
|
||||||
values.code,
|
Auth.postAuthOtpVerify({
|
||||||
authState.loginChallenge
|
body: {
|
||||||
)
|
phone_number: authState.phoneNumber,
|
||||||
|
login_challenge: authState.loginChallenge,
|
||||||
|
otp: values.code,
|
||||||
|
},
|
||||||
|
})
|
||||||
.then(response => response.data)
|
.then(response => response.data)
|
||||||
.then(({ redirectUrl, scope }) => {
|
.then(response => {
|
||||||
dispatch(setScope(scope));
|
if (!response) return;
|
||||||
window.location.href = redirectUrl;
|
const { redirect_url, ok } = response;
|
||||||
})
|
if (!ok) {
|
||||||
.catch(error => {
|
notifications.error({
|
||||||
console.error(error);
|
message: "Ошибка при подтверждении номера",
|
||||||
notifications.error({ message: error.toString() });
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.location.href = redirect_url;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import Logo from "@/components/Logo/Logo";
|
|
||||||
import PageItem from "@/components/PageBlock/PageItem";
|
|
||||||
import PageContainer from "@/components/PageContainer/PageContainer";
|
|
||||||
import VerifyPhoneForm from "@/app/verify-phone/components/VerifyPhoneForm/VerifyPhoneForm";
|
import VerifyPhoneForm from "@/app/verify-phone/components/VerifyPhoneForm/VerifyPhoneForm";
|
||||||
|
import PageItem from "@/components/layout/PageBlock/PageItem";
|
||||||
|
import PageContainer from "@/components/layout/PageContainer/PageContainer";
|
||||||
|
import Logo from "@/components/ui/Logo/Logo";
|
||||||
|
|
||||||
export default function CreateIdPage() {
|
export default function CreateIdPage() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
17
src/client/client.gen.ts
Normal file
17
src/client/client.gen.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// This file is auto-generated by @hey-api/openapi-ts
|
||||||
|
|
||||||
|
import type { ClientOptions } from './types.gen';
|
||||||
|
import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client';
|
||||||
|
import { createClientConfig } from '../hey-api-config';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The `createClientConfig()` function will be called on client initialization
|
||||||
|
* and the returned object will become the client's initial configuration.
|
||||||
|
*
|
||||||
|
* You may want to initialize your client this way instead of calling
|
||||||
|
* `setConfig()`. This is useful for example if you're using Next.js
|
||||||
|
* to ensure your client always has the correct values.
|
||||||
|
*/
|
||||||
|
export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>;
|
||||||
|
|
||||||
|
export const client = createClient(createClientConfig(createConfig<ClientOptions>()));
|
||||||
177
src/client/client/client.ts
Normal file
177
src/client/client/client.ts
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
import type { Client, Config, RequestOptions } from './types';
|
||||||
|
import {
|
||||||
|
buildUrl,
|
||||||
|
createConfig,
|
||||||
|
createInterceptors,
|
||||||
|
getParseAs,
|
||||||
|
mergeConfigs,
|
||||||
|
mergeHeaders,
|
||||||
|
setAuthParams,
|
||||||
|
} from './utils';
|
||||||
|
|
||||||
|
type ReqInit = Omit<RequestInit, 'body' | 'headers'> & {
|
||||||
|
body?: any;
|
||||||
|
headers: ReturnType<typeof mergeHeaders>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const createClient = (config: Config = {}): Client => {
|
||||||
|
let _config = mergeConfigs(createConfig(), config);
|
||||||
|
|
||||||
|
const getConfig = (): Config => ({ ..._config });
|
||||||
|
|
||||||
|
const setConfig = (config: Config): Config => {
|
||||||
|
_config = mergeConfigs(_config, config);
|
||||||
|
return getConfig();
|
||||||
|
};
|
||||||
|
|
||||||
|
const interceptors = createInterceptors<Response, unknown, RequestOptions>();
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
|
const request: Client['request'] = async (options) => {
|
||||||
|
const opts = {
|
||||||
|
..._config,
|
||||||
|
...options,
|
||||||
|
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
|
||||||
|
headers: mergeHeaders(_config.headers, options.headers),
|
||||||
|
};
|
||||||
|
|
||||||
|
if (opts.security) {
|
||||||
|
await setAuthParams({
|
||||||
|
...opts,
|
||||||
|
security: opts.security,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opts.requestValidator) {
|
||||||
|
await opts.requestValidator(opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opts.body && opts.bodySerializer) {
|
||||||
|
opts.body = opts.bodySerializer(opts.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove Content-Type header if body is empty to avoid sending invalid requests
|
||||||
|
if (opts.body === undefined || opts.body === '') {
|
||||||
|
opts.headers.delete('Content-Type');
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const fn of interceptors.request._fns) {
|
||||||
|
if (fn) {
|
||||||
|
await fn(opts);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const url = buildUrl(opts);
|
||||||
|
// fetch must be assigned here, otherwise it would throw the error:
|
||||||
|
// TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
|
||||||
|
const _fetch = opts.fetch!;
|
||||||
|
let response = await _fetch(url, {
|
||||||
|
...opts,
|
||||||
|
body: opts.body as ReqInit['body'],
|
||||||
|
});
|
||||||
|
|
||||||
|
for (const fn of interceptors.response._fns) {
|
||||||
|
if (fn) {
|
||||||
|
response = await fn(response, opts);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = {
|
||||||
|
response,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (response.ok) {
|
||||||
|
if (
|
||||||
|
response.status === 204 ||
|
||||||
|
response.headers.get('Content-Length') === '0'
|
||||||
|
) {
|
||||||
|
return {
|
||||||
|
data: {},
|
||||||
|
...result,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const parseAs =
|
||||||
|
(opts.parseAs === 'auto'
|
||||||
|
? getParseAs(response.headers.get('Content-Type'))
|
||||||
|
: opts.parseAs) ?? 'json';
|
||||||
|
|
||||||
|
let data: any;
|
||||||
|
switch (parseAs) {
|
||||||
|
case 'arrayBuffer':
|
||||||
|
case 'blob':
|
||||||
|
case 'formData':
|
||||||
|
case 'json':
|
||||||
|
case 'text':
|
||||||
|
data = await response[parseAs]();
|
||||||
|
break;
|
||||||
|
case 'stream':
|
||||||
|
return {
|
||||||
|
data: response.body,
|
||||||
|
...result,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parseAs === 'json') {
|
||||||
|
if (opts.responseValidator) {
|
||||||
|
await opts.responseValidator(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opts.responseTransformer) {
|
||||||
|
data = await opts.responseTransformer(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
data,
|
||||||
|
...result,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const textError = await response.text();
|
||||||
|
let jsonError: unknown;
|
||||||
|
|
||||||
|
try {
|
||||||
|
jsonError = JSON.parse(textError);
|
||||||
|
} catch {
|
||||||
|
// noop
|
||||||
|
}
|
||||||
|
|
||||||
|
const error = jsonError ?? textError;
|
||||||
|
let finalError = error;
|
||||||
|
|
||||||
|
for (const fn of interceptors.error._fns) {
|
||||||
|
if (fn) {
|
||||||
|
finalError = (await fn(error, response, opts)) as string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
finalError = finalError || ({} as string);
|
||||||
|
|
||||||
|
if (opts.throwOnError) {
|
||||||
|
throw finalError;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
error: finalError,
|
||||||
|
...result,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
buildUrl,
|
||||||
|
connect: (options) => request({ ...options, method: 'CONNECT' }),
|
||||||
|
delete: (options) => request({ ...options, method: 'DELETE' }),
|
||||||
|
get: (options) => request({ ...options, method: 'GET' }),
|
||||||
|
getConfig,
|
||||||
|
head: (options) => request({ ...options, method: 'HEAD' }),
|
||||||
|
interceptors,
|
||||||
|
options: (options) => request({ ...options, method: 'OPTIONS' }),
|
||||||
|
patch: (options) => request({ ...options, method: 'PATCH' }),
|
||||||
|
post: (options) => request({ ...options, method: 'POST' }),
|
||||||
|
put: (options) => request({ ...options, method: 'PUT' }),
|
||||||
|
request,
|
||||||
|
setConfig,
|
||||||
|
trace: (options) => request({ ...options, method: 'TRACE' }),
|
||||||
|
};
|
||||||
|
};
|
||||||
21
src/client/client/index.ts
Normal file
21
src/client/client/index.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
export type { Auth } from '../core/auth';
|
||||||
|
export type { QuerySerializerOptions } from '../core/bodySerializer';
|
||||||
|
export {
|
||||||
|
formDataBodySerializer,
|
||||||
|
jsonBodySerializer,
|
||||||
|
urlSearchParamsBodySerializer,
|
||||||
|
} from '../core/bodySerializer';
|
||||||
|
export { buildClientParams } from '../core/params';
|
||||||
|
export { createClient } from './client';
|
||||||
|
export type {
|
||||||
|
Client,
|
||||||
|
ClientOptions,
|
||||||
|
Config,
|
||||||
|
CreateClientConfig,
|
||||||
|
Options,
|
||||||
|
OptionsLegacyParser,
|
||||||
|
RequestOptions,
|
||||||
|
RequestResult,
|
||||||
|
TDataShape,
|
||||||
|
} from './types';
|
||||||
|
export { createConfig } from './utils';
|
||||||
173
src/client/client/types.ts
Normal file
173
src/client/client/types.ts
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
import type { Auth } from '../core/auth';
|
||||||
|
import type {
|
||||||
|
Client as CoreClient,
|
||||||
|
Config as CoreConfig,
|
||||||
|
} from '../core/types';
|
||||||
|
import type { Middleware } from './utils';
|
||||||
|
|
||||||
|
export interface Config<T extends ClientOptions = ClientOptions>
|
||||||
|
extends Omit<RequestInit, 'body' | 'headers' | 'method'>,
|
||||||
|
CoreConfig {
|
||||||
|
/**
|
||||||
|
* Base URL for all requests made by this client.
|
||||||
|
*/
|
||||||
|
baseUrl?: T['baseUrl'];
|
||||||
|
/**
|
||||||
|
* Fetch API implementation. You can use this option to provide a custom
|
||||||
|
* fetch instance.
|
||||||
|
*
|
||||||
|
* @default globalThis.fetch
|
||||||
|
*/
|
||||||
|
fetch?: typeof fetch;
|
||||||
|
/**
|
||||||
|
* Return the response data parsed in a specified format. By default, `auto`
|
||||||
|
* will infer the appropriate method from the `Content-Type` response header.
|
||||||
|
* You can override this behavior with any of the {@link Body} methods.
|
||||||
|
* Select `stream` if you don't want to parse response data at all.
|
||||||
|
*
|
||||||
|
* @default 'auto'
|
||||||
|
*/
|
||||||
|
parseAs?:
|
||||||
|
| 'arrayBuffer'
|
||||||
|
| 'auto'
|
||||||
|
| 'blob'
|
||||||
|
| 'formData'
|
||||||
|
| 'json'
|
||||||
|
| 'stream'
|
||||||
|
| 'text';
|
||||||
|
/**
|
||||||
|
* Throw an error instead of returning it in the response?
|
||||||
|
*
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
throwOnError?: T['throwOnError'];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RequestOptions<
|
||||||
|
ThrowOnError extends boolean = boolean,
|
||||||
|
Url extends string = string,
|
||||||
|
> extends Config<{
|
||||||
|
throwOnError: ThrowOnError;
|
||||||
|
}> {
|
||||||
|
/**
|
||||||
|
* Any body that you want to add to your request.
|
||||||
|
*
|
||||||
|
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
||||||
|
*/
|
||||||
|
body?: unknown;
|
||||||
|
path?: Record<string, unknown>;
|
||||||
|
query?: Record<string, unknown>;
|
||||||
|
/**
|
||||||
|
* Security mechanism(s) to use for the request.
|
||||||
|
*/
|
||||||
|
security?: ReadonlyArray<Auth>;
|
||||||
|
url: Url;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type RequestResult<
|
||||||
|
TData = unknown,
|
||||||
|
TError = unknown,
|
||||||
|
ThrowOnError extends boolean = boolean,
|
||||||
|
> = ThrowOnError extends true
|
||||||
|
? Promise<{
|
||||||
|
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
||||||
|
response: Response;
|
||||||
|
}>
|
||||||
|
: Promise<
|
||||||
|
(
|
||||||
|
| {
|
||||||
|
data: TData extends Record<string, unknown>
|
||||||
|
? TData[keyof TData]
|
||||||
|
: TData;
|
||||||
|
error: undefined;
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
data: undefined;
|
||||||
|
error: TError extends Record<string, unknown>
|
||||||
|
? TError[keyof TError]
|
||||||
|
: TError;
|
||||||
|
}
|
||||||
|
) & {
|
||||||
|
response: Response;
|
||||||
|
}
|
||||||
|
>;
|
||||||
|
|
||||||
|
export interface ClientOptions {
|
||||||
|
baseUrl?: string;
|
||||||
|
throwOnError?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
type MethodFn = <
|
||||||
|
TData = unknown,
|
||||||
|
TError = unknown,
|
||||||
|
ThrowOnError extends boolean = false,
|
||||||
|
>(
|
||||||
|
options: Omit<RequestOptions<ThrowOnError>, 'method'>,
|
||||||
|
) => RequestResult<TData, TError, ThrowOnError>;
|
||||||
|
|
||||||
|
type RequestFn = <
|
||||||
|
TData = unknown,
|
||||||
|
TError = unknown,
|
||||||
|
ThrowOnError extends boolean = false,
|
||||||
|
>(
|
||||||
|
options: Omit<RequestOptions<ThrowOnError>, 'method'> &
|
||||||
|
Pick<Required<RequestOptions<ThrowOnError>>, 'method'>,
|
||||||
|
) => RequestResult<TData, TError, ThrowOnError>;
|
||||||
|
|
||||||
|
type BuildUrlFn = <
|
||||||
|
TData extends {
|
||||||
|
body?: unknown;
|
||||||
|
path?: Record<string, unknown>;
|
||||||
|
query?: Record<string, unknown>;
|
||||||
|
url: string;
|
||||||
|
},
|
||||||
|
>(
|
||||||
|
options: Pick<TData, 'url'> & Options<TData>,
|
||||||
|
) => string;
|
||||||
|
|
||||||
|
export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn> & {
|
||||||
|
interceptors: Middleware<Response, unknown, RequestOptions>;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The `createClientConfig()` function will be called on client initialization
|
||||||
|
* and the returned object will become the client's initial configuration.
|
||||||
|
*
|
||||||
|
* You may want to initialize your client this way instead of calling
|
||||||
|
* `setConfig()`. This is useful for example if you're using Next.js
|
||||||
|
* to ensure your client always has the correct values.
|
||||||
|
*/
|
||||||
|
export type CreateClientConfig<T extends ClientOptions = ClientOptions> = (
|
||||||
|
override?: Config<ClientOptions & T>,
|
||||||
|
) => Config<Required<ClientOptions> & T>;
|
||||||
|
|
||||||
|
export interface TDataShape {
|
||||||
|
body?: unknown;
|
||||||
|
headers?: unknown;
|
||||||
|
path?: unknown;
|
||||||
|
query?: unknown;
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
||||||
|
|
||||||
|
export type Options<
|
||||||
|
TData extends TDataShape = TDataShape,
|
||||||
|
ThrowOnError extends boolean = boolean,
|
||||||
|
> = OmitKeys<RequestOptions<ThrowOnError>, 'body' | 'path' | 'query' | 'url'> &
|
||||||
|
Omit<TData, 'url'>;
|
||||||
|
|
||||||
|
export type OptionsLegacyParser<
|
||||||
|
TData = unknown,
|
||||||
|
ThrowOnError extends boolean = boolean,
|
||||||
|
> = TData extends { body?: any }
|
||||||
|
? TData extends { headers?: any }
|
||||||
|
? OmitKeys<RequestOptions<ThrowOnError>, 'body' | 'headers' | 'url'> & TData
|
||||||
|
: OmitKeys<RequestOptions<ThrowOnError>, 'body' | 'url'> &
|
||||||
|
TData &
|
||||||
|
Pick<RequestOptions<ThrowOnError>, 'headers'>
|
||||||
|
: TData extends { headers?: any }
|
||||||
|
? OmitKeys<RequestOptions<ThrowOnError>, 'headers' | 'url'> &
|
||||||
|
TData &
|
||||||
|
Pick<RequestOptions<ThrowOnError>, 'body'>
|
||||||
|
: OmitKeys<RequestOptions<ThrowOnError>, 'url'> & TData;
|
||||||
407
src/client/client/utils.ts
Normal file
407
src/client/client/utils.ts
Normal file
@ -0,0 +1,407 @@
|
|||||||
|
import { getAuthToken } from '../core/auth';
|
||||||
|
import type {
|
||||||
|
QuerySerializer,
|
||||||
|
QuerySerializerOptions,
|
||||||
|
} from '../core/bodySerializer';
|
||||||
|
import { jsonBodySerializer } from '../core/bodySerializer';
|
||||||
|
import {
|
||||||
|
serializeArrayParam,
|
||||||
|
serializeObjectParam,
|
||||||
|
serializePrimitiveParam,
|
||||||
|
} from '../core/pathSerializer';
|
||||||
|
import type { Client, ClientOptions, Config, RequestOptions } from './types';
|
||||||
|
|
||||||
|
interface PathSerializer {
|
||||||
|
path: Record<string, unknown>;
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
||||||
|
|
||||||
|
type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
|
||||||
|
type MatrixStyle = 'label' | 'matrix' | 'simple';
|
||||||
|
type ArraySeparatorStyle = ArrayStyle | MatrixStyle;
|
||||||
|
|
||||||
|
const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => {
|
||||||
|
let url = _url;
|
||||||
|
const matches = _url.match(PATH_PARAM_RE);
|
||||||
|
if (matches) {
|
||||||
|
for (const match of matches) {
|
||||||
|
let explode = false;
|
||||||
|
let name = match.substring(1, match.length - 1);
|
||||||
|
let style: ArraySeparatorStyle = 'simple';
|
||||||
|
|
||||||
|
if (name.endsWith('*')) {
|
||||||
|
explode = true;
|
||||||
|
name = name.substring(0, name.length - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.startsWith('.')) {
|
||||||
|
name = name.substring(1);
|
||||||
|
style = 'label';
|
||||||
|
} else if (name.startsWith(';')) {
|
||||||
|
name = name.substring(1);
|
||||||
|
style = 'matrix';
|
||||||
|
}
|
||||||
|
|
||||||
|
const value = path[name];
|
||||||
|
|
||||||
|
if (value === undefined || value === null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
url = url.replace(
|
||||||
|
match,
|
||||||
|
serializeArrayParam({ explode, name, style, value }),
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof value === 'object') {
|
||||||
|
url = url.replace(
|
||||||
|
match,
|
||||||
|
serializeObjectParam({
|
||||||
|
explode,
|
||||||
|
name,
|
||||||
|
style,
|
||||||
|
value: value as Record<string, unknown>,
|
||||||
|
valueOnly: true,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (style === 'matrix') {
|
||||||
|
url = url.replace(
|
||||||
|
match,
|
||||||
|
`;${serializePrimitiveParam({
|
||||||
|
name,
|
||||||
|
value: value as string,
|
||||||
|
})}`,
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const replaceValue = encodeURIComponent(
|
||||||
|
style === 'label' ? `.${value as string}` : (value as string),
|
||||||
|
);
|
||||||
|
url = url.replace(match, replaceValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return url;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const createQuerySerializer = <T = unknown>({
|
||||||
|
allowReserved,
|
||||||
|
array,
|
||||||
|
object,
|
||||||
|
}: QuerySerializerOptions = {}) => {
|
||||||
|
const querySerializer = (queryParams: T) => {
|
||||||
|
const search: string[] = [];
|
||||||
|
if (queryParams && typeof queryParams === 'object') {
|
||||||
|
for (const name in queryParams) {
|
||||||
|
const value = queryParams[name];
|
||||||
|
|
||||||
|
if (value === undefined || value === null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
const serializedArray = serializeArrayParam({
|
||||||
|
allowReserved,
|
||||||
|
explode: true,
|
||||||
|
name,
|
||||||
|
style: 'form',
|
||||||
|
value,
|
||||||
|
...array,
|
||||||
|
});
|
||||||
|
if (serializedArray) search.push(serializedArray);
|
||||||
|
} else if (typeof value === 'object') {
|
||||||
|
const serializedObject = serializeObjectParam({
|
||||||
|
allowReserved,
|
||||||
|
explode: true,
|
||||||
|
name,
|
||||||
|
style: 'deepObject',
|
||||||
|
value: value as Record<string, unknown>,
|
||||||
|
...object,
|
||||||
|
});
|
||||||
|
if (serializedObject) search.push(serializedObject);
|
||||||
|
} else {
|
||||||
|
const serializedPrimitive = serializePrimitiveParam({
|
||||||
|
allowReserved,
|
||||||
|
name,
|
||||||
|
value: value as string,
|
||||||
|
});
|
||||||
|
if (serializedPrimitive) search.push(serializedPrimitive);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return search.join('&');
|
||||||
|
};
|
||||||
|
return querySerializer;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Infers parseAs value from provided Content-Type header.
|
||||||
|
*/
|
||||||
|
export const getParseAs = (
|
||||||
|
contentType: string | null,
|
||||||
|
): Exclude<Config['parseAs'], 'auto'> => {
|
||||||
|
if (!contentType) {
|
||||||
|
// If no Content-Type header is provided, the best we can do is return the raw response body,
|
||||||
|
// which is effectively the same as the 'stream' option.
|
||||||
|
return 'stream';
|
||||||
|
}
|
||||||
|
|
||||||
|
const cleanContent = contentType.split(';')[0]?.trim();
|
||||||
|
|
||||||
|
if (!cleanContent) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
cleanContent.startsWith('application/json') ||
|
||||||
|
cleanContent.endsWith('+json')
|
||||||
|
) {
|
||||||
|
return 'json';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cleanContent === 'multipart/form-data') {
|
||||||
|
return 'formData';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
['application/', 'audio/', 'image/', 'video/'].some((type) =>
|
||||||
|
cleanContent.startsWith(type),
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return 'blob';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cleanContent.startsWith('text/')) {
|
||||||
|
return 'text';
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const setAuthParams = async ({
|
||||||
|
security,
|
||||||
|
...options
|
||||||
|
}: Pick<Required<RequestOptions>, 'security'> &
|
||||||
|
Pick<RequestOptions, 'auth' | 'query'> & {
|
||||||
|
headers: Headers;
|
||||||
|
}) => {
|
||||||
|
for (const auth of security) {
|
||||||
|
const token = await getAuthToken(auth, options.auth);
|
||||||
|
|
||||||
|
if (!token) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const name = auth.name ?? 'Authorization';
|
||||||
|
|
||||||
|
switch (auth.in) {
|
||||||
|
case 'query':
|
||||||
|
if (!options.query) {
|
||||||
|
options.query = {};
|
||||||
|
}
|
||||||
|
options.query[name] = token;
|
||||||
|
break;
|
||||||
|
case 'cookie':
|
||||||
|
options.headers.append('Cookie', `${name}=${token}`);
|
||||||
|
break;
|
||||||
|
case 'header':
|
||||||
|
default:
|
||||||
|
options.headers.set(name, token);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const buildUrl: Client['buildUrl'] = (options) => {
|
||||||
|
const url = getUrl({
|
||||||
|
baseUrl: options.baseUrl as string,
|
||||||
|
path: options.path,
|
||||||
|
query: options.query,
|
||||||
|
querySerializer:
|
||||||
|
typeof options.querySerializer === 'function'
|
||||||
|
? options.querySerializer
|
||||||
|
: createQuerySerializer(options.querySerializer),
|
||||||
|
url: options.url,
|
||||||
|
});
|
||||||
|
return url;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getUrl = ({
|
||||||
|
baseUrl,
|
||||||
|
path,
|
||||||
|
query,
|
||||||
|
querySerializer,
|
||||||
|
url: _url,
|
||||||
|
}: {
|
||||||
|
baseUrl?: string;
|
||||||
|
path?: Record<string, unknown>;
|
||||||
|
query?: Record<string, unknown>;
|
||||||
|
querySerializer: QuerySerializer;
|
||||||
|
url: string;
|
||||||
|
}) => {
|
||||||
|
const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;
|
||||||
|
let url = (baseUrl ?? '') + pathUrl;
|
||||||
|
if (path) {
|
||||||
|
url = defaultPathSerializer({ path, url });
|
||||||
|
}
|
||||||
|
let search = query ? querySerializer(query) : '';
|
||||||
|
if (search.startsWith('?')) {
|
||||||
|
search = search.substring(1);
|
||||||
|
}
|
||||||
|
if (search) {
|
||||||
|
url += `?${search}`;
|
||||||
|
}
|
||||||
|
return url;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const mergeConfigs = (a: Config, b: Config): Config => {
|
||||||
|
const config = { ...a, ...b };
|
||||||
|
if (config.baseUrl?.endsWith('/')) {
|
||||||
|
config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);
|
||||||
|
}
|
||||||
|
config.headers = mergeHeaders(a.headers, b.headers);
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const mergeHeaders = (
|
||||||
|
...headers: Array<Required<Config>['headers'] | undefined>
|
||||||
|
): Headers => {
|
||||||
|
const mergedHeaders = new Headers();
|
||||||
|
for (const header of headers) {
|
||||||
|
if (!header || typeof header !== 'object') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const iterator =
|
||||||
|
header instanceof Headers ? header.entries() : Object.entries(header);
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
for (const [key, value] of iterator) {
|
||||||
|
if (value === null) {
|
||||||
|
mergedHeaders.delete(key);
|
||||||
|
} else if (Array.isArray(value)) {
|
||||||
|
for (const v of value) {
|
||||||
|
mergedHeaders.append(key, v as string);
|
||||||
|
}
|
||||||
|
} else if (value !== undefined) {
|
||||||
|
// assume object headers are meant to be JSON stringified, i.e. their
|
||||||
|
// content value in OpenAPI specification is 'application/json'
|
||||||
|
mergedHeaders.set(
|
||||||
|
key,
|
||||||
|
typeof value === 'object' ? JSON.stringify(value) : (value as string),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mergedHeaders;
|
||||||
|
};
|
||||||
|
|
||||||
|
type ErrInterceptor<Err, Res, Options> = (
|
||||||
|
error: Err,
|
||||||
|
response: Res,
|
||||||
|
options: Options,
|
||||||
|
) => Err | Promise<Err>;
|
||||||
|
|
||||||
|
type ReqInterceptor<Options> = (options: Options) => void | Promise<void>;
|
||||||
|
|
||||||
|
type ResInterceptor<Res, Options> = (
|
||||||
|
response: Res,
|
||||||
|
options: Options,
|
||||||
|
) => Res | Promise<Res>;
|
||||||
|
|
||||||
|
class Interceptors<Interceptor> {
|
||||||
|
_fns: (Interceptor | null)[];
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this._fns = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
clear() {
|
||||||
|
this._fns = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
getInterceptorIndex(id: number | Interceptor): number {
|
||||||
|
if (typeof id === 'number') {
|
||||||
|
return this._fns[id] ? id : -1;
|
||||||
|
} else {
|
||||||
|
return this._fns.indexOf(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exists(id: number | Interceptor) {
|
||||||
|
const index = this.getInterceptorIndex(id);
|
||||||
|
return !!this._fns[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
eject(id: number | Interceptor) {
|
||||||
|
const index = this.getInterceptorIndex(id);
|
||||||
|
if (this._fns[index]) {
|
||||||
|
this._fns[index] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
update(id: number | Interceptor, fn: Interceptor) {
|
||||||
|
const index = this.getInterceptorIndex(id);
|
||||||
|
if (this._fns[index]) {
|
||||||
|
this._fns[index] = fn;
|
||||||
|
return id;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
use(fn: Interceptor) {
|
||||||
|
this._fns = [...this._fns, fn];
|
||||||
|
return this._fns.length - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// `createInterceptors()` response, meant for external use as it does not
|
||||||
|
// expose internals
|
||||||
|
export interface Middleware<Res, Err, Options> {
|
||||||
|
error: Pick<Interceptors<ErrInterceptor<Err, Res, Options>>, 'eject' | 'use'>;
|
||||||
|
request: Pick<Interceptors<ReqInterceptor<Options>>, 'eject' | 'use'>;
|
||||||
|
response: Pick<Interceptors<ResInterceptor<Res, Options>>, 'eject' | 'use'>;
|
||||||
|
}
|
||||||
|
|
||||||
|
// do not add `Middleware` as return type so we can use _fns internally
|
||||||
|
export const createInterceptors = <Res, Err, Options>() => ({
|
||||||
|
error: new Interceptors<ErrInterceptor<Err, Res, Options>>(),
|
||||||
|
request: new Interceptors<ReqInterceptor<Options>>(),
|
||||||
|
response: new Interceptors<ResInterceptor<Res, Options>>(),
|
||||||
|
});
|
||||||
|
|
||||||
|
const defaultQuerySerializer = createQuerySerializer({
|
||||||
|
allowReserved: false,
|
||||||
|
array: {
|
||||||
|
explode: true,
|
||||||
|
style: 'form',
|
||||||
|
},
|
||||||
|
object: {
|
||||||
|
explode: true,
|
||||||
|
style: 'deepObject',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const defaultHeaders = {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const createConfig = <T extends ClientOptions = ClientOptions>(
|
||||||
|
override: Config<Omit<ClientOptions, keyof T> & T> = {},
|
||||||
|
): Config<Omit<ClientOptions, keyof T> & T> => ({
|
||||||
|
...jsonBodySerializer,
|
||||||
|
headers: defaultHeaders,
|
||||||
|
parseAs: 'auto',
|
||||||
|
querySerializer: defaultQuerySerializer,
|
||||||
|
...override,
|
||||||
|
});
|
||||||
40
src/client/core/auth.ts
Normal file
40
src/client/core/auth.ts
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
export type AuthToken = string | undefined;
|
||||||
|
|
||||||
|
export interface Auth {
|
||||||
|
/**
|
||||||
|
* Which part of the request do we use to send the auth?
|
||||||
|
*
|
||||||
|
* @default 'header'
|
||||||
|
*/
|
||||||
|
in?: 'header' | 'query' | 'cookie';
|
||||||
|
/**
|
||||||
|
* Header or query parameter name.
|
||||||
|
*
|
||||||
|
* @default 'Authorization'
|
||||||
|
*/
|
||||||
|
name?: string;
|
||||||
|
scheme?: 'basic' | 'bearer';
|
||||||
|
type: 'apiKey' | 'http';
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getAuthToken = async (
|
||||||
|
auth: Auth,
|
||||||
|
callback: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken,
|
||||||
|
): Promise<string | undefined> => {
|
||||||
|
const token =
|
||||||
|
typeof callback === 'function' ? await callback(auth) : callback;
|
||||||
|
|
||||||
|
if (!token) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (auth.scheme === 'bearer') {
|
||||||
|
return `Bearer ${token}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (auth.scheme === 'basic') {
|
||||||
|
return `Basic ${btoa(token)}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return token;
|
||||||
|
};
|
||||||
88
src/client/core/bodySerializer.ts
Normal file
88
src/client/core/bodySerializer.ts
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
import type {
|
||||||
|
ArrayStyle,
|
||||||
|
ObjectStyle,
|
||||||
|
SerializerOptions,
|
||||||
|
} from './pathSerializer';
|
||||||
|
|
||||||
|
export type QuerySerializer = (query: Record<string, unknown>) => string;
|
||||||
|
|
||||||
|
export type BodySerializer = (body: any) => any;
|
||||||
|
|
||||||
|
export interface QuerySerializerOptions {
|
||||||
|
allowReserved?: boolean;
|
||||||
|
array?: SerializerOptions<ArrayStyle>;
|
||||||
|
object?: SerializerOptions<ObjectStyle>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const serializeFormDataPair = (
|
||||||
|
data: FormData,
|
||||||
|
key: string,
|
||||||
|
value: unknown,
|
||||||
|
): void => {
|
||||||
|
if (typeof value === 'string' || value instanceof Blob) {
|
||||||
|
data.append(key, value);
|
||||||
|
} else {
|
||||||
|
data.append(key, JSON.stringify(value));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const serializeUrlSearchParamsPair = (
|
||||||
|
data: URLSearchParams,
|
||||||
|
key: string,
|
||||||
|
value: unknown,
|
||||||
|
): void => {
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
data.append(key, value);
|
||||||
|
} else {
|
||||||
|
data.append(key, JSON.stringify(value));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const formDataBodySerializer = {
|
||||||
|
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(
|
||||||
|
body: T,
|
||||||
|
): FormData => {
|
||||||
|
const data = new FormData();
|
||||||
|
|
||||||
|
Object.entries(body).forEach(([key, value]) => {
|
||||||
|
if (value === undefined || value === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
value.forEach((v) => serializeFormDataPair(data, key, v));
|
||||||
|
} else {
|
||||||
|
serializeFormDataPair(data, key, value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return data;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const jsonBodySerializer = {
|
||||||
|
bodySerializer: <T>(body: T): string =>
|
||||||
|
JSON.stringify(body, (_key, value) =>
|
||||||
|
typeof value === 'bigint' ? value.toString() : value,
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
export const urlSearchParamsBodySerializer = {
|
||||||
|
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(
|
||||||
|
body: T,
|
||||||
|
): string => {
|
||||||
|
const data = new URLSearchParams();
|
||||||
|
|
||||||
|
Object.entries(body).forEach(([key, value]) => {
|
||||||
|
if (value === undefined || value === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
value.forEach((v) => serializeUrlSearchParamsPair(data, key, v));
|
||||||
|
} else {
|
||||||
|
serializeUrlSearchParamsPair(data, key, value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return data.toString();
|
||||||
|
},
|
||||||
|
};
|
||||||
151
src/client/core/params.ts
Normal file
151
src/client/core/params.ts
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
type Slot = 'body' | 'headers' | 'path' | 'query';
|
||||||
|
|
||||||
|
export type Field =
|
||||||
|
| {
|
||||||
|
in: Exclude<Slot, 'body'>;
|
||||||
|
/**
|
||||||
|
* Field name. This is the name we want the user to see and use.
|
||||||
|
*/
|
||||||
|
key: string;
|
||||||
|
/**
|
||||||
|
* Field mapped name. This is the name we want to use in the request.
|
||||||
|
* If omitted, we use the same value as `key`.
|
||||||
|
*/
|
||||||
|
map?: string;
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
in: Extract<Slot, 'body'>;
|
||||||
|
/**
|
||||||
|
* Key isn't required for bodies.
|
||||||
|
*/
|
||||||
|
key?: string;
|
||||||
|
map?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export interface Fields {
|
||||||
|
allowExtra?: Partial<Record<Slot, boolean>>;
|
||||||
|
args?: ReadonlyArray<Field>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type FieldsConfig = ReadonlyArray<Field | Fields>;
|
||||||
|
|
||||||
|
const extraPrefixesMap: Record<string, Slot> = {
|
||||||
|
$body_: 'body',
|
||||||
|
$headers_: 'headers',
|
||||||
|
$path_: 'path',
|
||||||
|
$query_: 'query',
|
||||||
|
};
|
||||||
|
const extraPrefixes = Object.entries(extraPrefixesMap);
|
||||||
|
|
||||||
|
type KeyMap = Map<
|
||||||
|
string,
|
||||||
|
{
|
||||||
|
in: Slot;
|
||||||
|
map?: string;
|
||||||
|
}
|
||||||
|
>;
|
||||||
|
|
||||||
|
const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => {
|
||||||
|
if (!map) {
|
||||||
|
map = new Map();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const config of fields) {
|
||||||
|
if ('in' in config) {
|
||||||
|
if (config.key) {
|
||||||
|
map.set(config.key, {
|
||||||
|
in: config.in,
|
||||||
|
map: config.map,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (config.args) {
|
||||||
|
buildKeyMap(config.args, map);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return map;
|
||||||
|
};
|
||||||
|
|
||||||
|
interface Params {
|
||||||
|
body: unknown;
|
||||||
|
headers: Record<string, unknown>;
|
||||||
|
path: Record<string, unknown>;
|
||||||
|
query: Record<string, unknown>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const stripEmptySlots = (params: Params) => {
|
||||||
|
for (const [slot, value] of Object.entries(params)) {
|
||||||
|
if (value && typeof value === 'object' && !Object.keys(value).length) {
|
||||||
|
delete params[slot as Slot];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const buildClientParams = (
|
||||||
|
args: ReadonlyArray<unknown>,
|
||||||
|
fields: FieldsConfig,
|
||||||
|
) => {
|
||||||
|
const params: Params = {
|
||||||
|
body: {},
|
||||||
|
headers: {},
|
||||||
|
path: {},
|
||||||
|
query: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
const map = buildKeyMap(fields);
|
||||||
|
|
||||||
|
let config: FieldsConfig[number] | undefined;
|
||||||
|
|
||||||
|
for (const [index, arg] of args.entries()) {
|
||||||
|
if (fields[index]) {
|
||||||
|
config = fields[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!config) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('in' in config) {
|
||||||
|
if (config.key) {
|
||||||
|
const field = map.get(config.key)!;
|
||||||
|
const name = field.map || config.key;
|
||||||
|
(params[field.in] as Record<string, unknown>)[name] = arg;
|
||||||
|
} else {
|
||||||
|
params.body = arg;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (const [key, value] of Object.entries(arg ?? {})) {
|
||||||
|
const field = map.get(key);
|
||||||
|
|
||||||
|
if (field) {
|
||||||
|
const name = field.map || key;
|
||||||
|
(params[field.in] as Record<string, unknown>)[name] = value;
|
||||||
|
} else {
|
||||||
|
const extra = extraPrefixes.find(([prefix]) =>
|
||||||
|
key.startsWith(prefix),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (extra) {
|
||||||
|
const [prefix, slot] = extra;
|
||||||
|
(params[slot] as Record<string, unknown>)[
|
||||||
|
key.slice(prefix.length)
|
||||||
|
] = value;
|
||||||
|
} else {
|
||||||
|
for (const [slot, allowed] of Object.entries(
|
||||||
|
config.allowExtra ?? {},
|
||||||
|
)) {
|
||||||
|
if (allowed) {
|
||||||
|
(params[slot as Slot] as Record<string, unknown>)[key] = value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stripEmptySlots(params);
|
||||||
|
|
||||||
|
return params;
|
||||||
|
};
|
||||||
179
src/client/core/pathSerializer.ts
Normal file
179
src/client/core/pathSerializer.ts
Normal file
@ -0,0 +1,179 @@
|
|||||||
|
interface SerializeOptions<T>
|
||||||
|
extends SerializePrimitiveOptions,
|
||||||
|
SerializerOptions<T> {}
|
||||||
|
|
||||||
|
interface SerializePrimitiveOptions {
|
||||||
|
allowReserved?: boolean;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SerializerOptions<T> {
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
explode: boolean;
|
||||||
|
style: T;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
|
||||||
|
export type ArraySeparatorStyle = ArrayStyle | MatrixStyle;
|
||||||
|
type MatrixStyle = 'label' | 'matrix' | 'simple';
|
||||||
|
export type ObjectStyle = 'form' | 'deepObject';
|
||||||
|
type ObjectSeparatorStyle = ObjectStyle | MatrixStyle;
|
||||||
|
|
||||||
|
interface SerializePrimitiveParam extends SerializePrimitiveOptions {
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const separatorArrayExplode = (style: ArraySeparatorStyle) => {
|
||||||
|
switch (style) {
|
||||||
|
case 'label':
|
||||||
|
return '.';
|
||||||
|
case 'matrix':
|
||||||
|
return ';';
|
||||||
|
case 'simple':
|
||||||
|
return ',';
|
||||||
|
default:
|
||||||
|
return '&';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const separatorArrayNoExplode = (style: ArraySeparatorStyle) => {
|
||||||
|
switch (style) {
|
||||||
|
case 'form':
|
||||||
|
return ',';
|
||||||
|
case 'pipeDelimited':
|
||||||
|
return '|';
|
||||||
|
case 'spaceDelimited':
|
||||||
|
return '%20';
|
||||||
|
default:
|
||||||
|
return ',';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const separatorObjectExplode = (style: ObjectSeparatorStyle) => {
|
||||||
|
switch (style) {
|
||||||
|
case 'label':
|
||||||
|
return '.';
|
||||||
|
case 'matrix':
|
||||||
|
return ';';
|
||||||
|
case 'simple':
|
||||||
|
return ',';
|
||||||
|
default:
|
||||||
|
return '&';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const serializeArrayParam = ({
|
||||||
|
allowReserved,
|
||||||
|
explode,
|
||||||
|
name,
|
||||||
|
style,
|
||||||
|
value,
|
||||||
|
}: SerializeOptions<ArraySeparatorStyle> & {
|
||||||
|
value: unknown[];
|
||||||
|
}) => {
|
||||||
|
if (!explode) {
|
||||||
|
const joinedValues = (
|
||||||
|
allowReserved ? value : value.map((v) => encodeURIComponent(v as string))
|
||||||
|
).join(separatorArrayNoExplode(style));
|
||||||
|
switch (style) {
|
||||||
|
case 'label':
|
||||||
|
return `.${joinedValues}`;
|
||||||
|
case 'matrix':
|
||||||
|
return `;${name}=${joinedValues}`;
|
||||||
|
case 'simple':
|
||||||
|
return joinedValues;
|
||||||
|
default:
|
||||||
|
return `${name}=${joinedValues}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const separator = separatorArrayExplode(style);
|
||||||
|
const joinedValues = value
|
||||||
|
.map((v) => {
|
||||||
|
if (style === 'label' || style === 'simple') {
|
||||||
|
return allowReserved ? v : encodeURIComponent(v as string);
|
||||||
|
}
|
||||||
|
|
||||||
|
return serializePrimitiveParam({
|
||||||
|
allowReserved,
|
||||||
|
name,
|
||||||
|
value: v as string,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.join(separator);
|
||||||
|
return style === 'label' || style === 'matrix'
|
||||||
|
? separator + joinedValues
|
||||||
|
: joinedValues;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const serializePrimitiveParam = ({
|
||||||
|
allowReserved,
|
||||||
|
name,
|
||||||
|
value,
|
||||||
|
}: SerializePrimitiveParam) => {
|
||||||
|
if (value === undefined || value === null) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof value === 'object') {
|
||||||
|
throw new Error(
|
||||||
|
'Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const serializeObjectParam = ({
|
||||||
|
allowReserved,
|
||||||
|
explode,
|
||||||
|
name,
|
||||||
|
style,
|
||||||
|
value,
|
||||||
|
valueOnly,
|
||||||
|
}: SerializeOptions<ObjectSeparatorStyle> & {
|
||||||
|
value: Record<string, unknown> | Date;
|
||||||
|
valueOnly?: boolean;
|
||||||
|
}) => {
|
||||||
|
if (value instanceof Date) {
|
||||||
|
return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (style !== 'deepObject' && !explode) {
|
||||||
|
let values: string[] = [];
|
||||||
|
Object.entries(value).forEach(([key, v]) => {
|
||||||
|
values = [
|
||||||
|
...values,
|
||||||
|
key,
|
||||||
|
allowReserved ? (v as string) : encodeURIComponent(v as string),
|
||||||
|
];
|
||||||
|
});
|
||||||
|
const joinedValues = values.join(',');
|
||||||
|
switch (style) {
|
||||||
|
case 'form':
|
||||||
|
return `${name}=${joinedValues}`;
|
||||||
|
case 'label':
|
||||||
|
return `.${joinedValues}`;
|
||||||
|
case 'matrix':
|
||||||
|
return `;${name}=${joinedValues}`;
|
||||||
|
default:
|
||||||
|
return joinedValues;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const separator = separatorObjectExplode(style);
|
||||||
|
const joinedValues = Object.entries(value)
|
||||||
|
.map(([key, v]) =>
|
||||||
|
serializePrimitiveParam({
|
||||||
|
allowReserved,
|
||||||
|
name: style === 'deepObject' ? `${name}[${key}]` : key,
|
||||||
|
value: v as string,
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.join(separator);
|
||||||
|
return style === 'label' || style === 'matrix'
|
||||||
|
? separator + joinedValues
|
||||||
|
: joinedValues;
|
||||||
|
};
|
||||||
118
src/client/core/types.ts
Normal file
118
src/client/core/types.ts
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
import type { Auth, AuthToken } from './auth';
|
||||||
|
import type {
|
||||||
|
BodySerializer,
|
||||||
|
QuerySerializer,
|
||||||
|
QuerySerializerOptions,
|
||||||
|
} from './bodySerializer';
|
||||||
|
|
||||||
|
export interface Client<
|
||||||
|
RequestFn = never,
|
||||||
|
Config = unknown,
|
||||||
|
MethodFn = never,
|
||||||
|
BuildUrlFn = never,
|
||||||
|
> {
|
||||||
|
/**
|
||||||
|
* Returns the final request URL.
|
||||||
|
*/
|
||||||
|
buildUrl: BuildUrlFn;
|
||||||
|
connect: MethodFn;
|
||||||
|
delete: MethodFn;
|
||||||
|
get: MethodFn;
|
||||||
|
getConfig: () => Config;
|
||||||
|
head: MethodFn;
|
||||||
|
options: MethodFn;
|
||||||
|
patch: MethodFn;
|
||||||
|
post: MethodFn;
|
||||||
|
put: MethodFn;
|
||||||
|
request: RequestFn;
|
||||||
|
setConfig: (config: Config) => Config;
|
||||||
|
trace: MethodFn;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Config {
|
||||||
|
/**
|
||||||
|
* Auth token or a function returning auth token. The resolved value will be
|
||||||
|
* added to the request payload as defined by its `security` array.
|
||||||
|
*/
|
||||||
|
auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
|
||||||
|
/**
|
||||||
|
* A function for serializing request body parameter. By default,
|
||||||
|
* {@link JSON.stringify()} will be used.
|
||||||
|
*/
|
||||||
|
bodySerializer?: BodySerializer | null;
|
||||||
|
/**
|
||||||
|
* An object containing any HTTP headers that you want to pre-populate your
|
||||||
|
* `Headers` object with.
|
||||||
|
*
|
||||||
|
* {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
|
||||||
|
*/
|
||||||
|
headers?:
|
||||||
|
| RequestInit['headers']
|
||||||
|
| Record<
|
||||||
|
string,
|
||||||
|
| string
|
||||||
|
| number
|
||||||
|
| boolean
|
||||||
|
| (string | number | boolean)[]
|
||||||
|
| null
|
||||||
|
| undefined
|
||||||
|
| unknown
|
||||||
|
>;
|
||||||
|
/**
|
||||||
|
* The request method.
|
||||||
|
*
|
||||||
|
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
|
||||||
|
*/
|
||||||
|
method?:
|
||||||
|
| 'CONNECT'
|
||||||
|
| 'DELETE'
|
||||||
|
| 'GET'
|
||||||
|
| 'HEAD'
|
||||||
|
| 'OPTIONS'
|
||||||
|
| 'PATCH'
|
||||||
|
| 'POST'
|
||||||
|
| 'PUT'
|
||||||
|
| 'TRACE';
|
||||||
|
/**
|
||||||
|
* A function for serializing request query parameters. By default, arrays
|
||||||
|
* will be exploded in form style, objects will be exploded in deepObject
|
||||||
|
* style, and reserved characters are percent-encoded.
|
||||||
|
*
|
||||||
|
* This method will have no effect if the native `paramsSerializer()` Axios
|
||||||
|
* API function is used.
|
||||||
|
*
|
||||||
|
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
|
||||||
|
*/
|
||||||
|
querySerializer?: QuerySerializer | QuerySerializerOptions;
|
||||||
|
/**
|
||||||
|
* A function validating request data. This is useful if you want to ensure
|
||||||
|
* the request conforms to the desired shape, so it can be safely sent to
|
||||||
|
* the server.
|
||||||
|
*/
|
||||||
|
requestValidator?: (data: unknown) => Promise<unknown>;
|
||||||
|
/**
|
||||||
|
* A function transforming response data before it's returned. This is useful
|
||||||
|
* for post-processing data, e.g. converting ISO strings into Date objects.
|
||||||
|
*/
|
||||||
|
responseTransformer?: (data: unknown) => Promise<unknown>;
|
||||||
|
/**
|
||||||
|
* A function validating response data. This is useful if you want to ensure
|
||||||
|
* the response conforms to the desired shape, so it can be safely passed to
|
||||||
|
* the transformers and returned to the user.
|
||||||
|
*/
|
||||||
|
responseValidator?: (data: unknown) => Promise<unknown>;
|
||||||
|
}
|
||||||
|
|
||||||
|
type IsExactlyNeverOrNeverUndefined<T> = [T] extends [never]
|
||||||
|
? true
|
||||||
|
: [T] extends [never | undefined]
|
||||||
|
? [undefined] extends [T]
|
||||||
|
? false
|
||||||
|
: true
|
||||||
|
: false;
|
||||||
|
|
||||||
|
export type OmitNever<T extends Record<string, unknown>> = {
|
||||||
|
[K in keyof T as IsExactlyNeverOrNeverUndefined<T[K]> extends true
|
||||||
|
? never
|
||||||
|
: K]: T[K];
|
||||||
|
};
|
||||||
3
src/client/index.ts
Normal file
3
src/client/index.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
// This file is auto-generated by @hey-api/openapi-ts
|
||||||
|
export * from './types.gen';
|
||||||
|
export * from './sdk.gen';
|
||||||
82
src/client/sdk.gen.ts
Normal file
82
src/client/sdk.gen.ts
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
// This file is auto-generated by @hey-api/openapi-ts
|
||||||
|
|
||||||
|
import type { Options as ClientOptions, TDataShape, Client } from './client';
|
||||||
|
import type { PostAuthOtpRequestData, PostAuthOtpRequestResponses, PostAuthOtpRequestErrors, PostAuthOtpVerifyData, PostAuthOtpVerifyResponses, PostAuthOtpVerifyErrors, PostAuthConsentAcceptData, PostAuthConsentAcceptResponses, PostAuthConsentAcceptErrors } from './types.gen';
|
||||||
|
import { zPostAuthOtpRequestData, zPostAuthOtpRequestResponse, zPostAuthOtpVerifyData, zPostAuthOtpVerifyResponse, zPostAuthConsentAcceptData, zPostAuthConsentAcceptResponse } from './zod.gen';
|
||||||
|
import { client as _heyApiClient } from './client.gen';
|
||||||
|
|
||||||
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
|
||||||
|
/**
|
||||||
|
* You can provide a client instance returned by `createClient()` instead of
|
||||||
|
* individual options. This might be also useful if you want to implement a
|
||||||
|
* custom client.
|
||||||
|
*/
|
||||||
|
client?: Client;
|
||||||
|
/**
|
||||||
|
* You can pass arbitrary values through the `meta` object. This can be
|
||||||
|
* used to access values that aren't defined as part of the SDK function.
|
||||||
|
*/
|
||||||
|
meta?: Record<string, unknown>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export class Auth {
|
||||||
|
/**
|
||||||
|
* Request OTP
|
||||||
|
*/
|
||||||
|
public static postAuthOtpRequest<ThrowOnError extends boolean = false>(options: Options<PostAuthOtpRequestData, ThrowOnError>) {
|
||||||
|
return (options.client ?? _heyApiClient).post<PostAuthOtpRequestResponses, PostAuthOtpRequestErrors, ThrowOnError>({
|
||||||
|
requestValidator: async (data) => {
|
||||||
|
return await zPostAuthOtpRequestData.parseAsync(data);
|
||||||
|
},
|
||||||
|
responseValidator: async (data) => {
|
||||||
|
return await zPostAuthOtpRequestResponse.parseAsync(data);
|
||||||
|
},
|
||||||
|
url: '/auth/otp/request',
|
||||||
|
...options,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
...options.headers
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verify OTP
|
||||||
|
*/
|
||||||
|
public static postAuthOtpVerify<ThrowOnError extends boolean = false>(options: Options<PostAuthOtpVerifyData, ThrowOnError>) {
|
||||||
|
return (options.client ?? _heyApiClient).post<PostAuthOtpVerifyResponses, PostAuthOtpVerifyErrors, ThrowOnError>({
|
||||||
|
requestValidator: async (data) => {
|
||||||
|
return await zPostAuthOtpVerifyData.parseAsync(data);
|
||||||
|
},
|
||||||
|
responseValidator: async (data) => {
|
||||||
|
return await zPostAuthOtpVerifyResponse.parseAsync(data);
|
||||||
|
},
|
||||||
|
url: '/auth/otp/verify',
|
||||||
|
...options,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
...options.headers
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accept consent
|
||||||
|
*/
|
||||||
|
public static postAuthConsentAccept<ThrowOnError extends boolean = false>(options: Options<PostAuthConsentAcceptData, ThrowOnError>) {
|
||||||
|
return (options.client ?? _heyApiClient).post<PostAuthConsentAcceptResponses, PostAuthConsentAcceptErrors, ThrowOnError>({
|
||||||
|
requestValidator: async (data) => {
|
||||||
|
return await zPostAuthConsentAcceptData.parseAsync(data);
|
||||||
|
},
|
||||||
|
responseValidator: async (data) => {
|
||||||
|
return await zPostAuthConsentAcceptResponse.parseAsync(data);
|
||||||
|
},
|
||||||
|
url: '/auth/consent/accept',
|
||||||
|
...options,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
...options.headers
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
151
src/client/types.gen.ts
Normal file
151
src/client/types.gen.ts
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
// This file is auto-generated by @hey-api/openapi-ts
|
||||||
|
|
||||||
|
export type RequestOtpRequest = {
|
||||||
|
/**
|
||||||
|
* Phone number to send OTP to
|
||||||
|
*/
|
||||||
|
phone_number: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type RequestOtpResponse = {
|
||||||
|
/**
|
||||||
|
* Confirmation message
|
||||||
|
*/
|
||||||
|
message: string;
|
||||||
|
/**
|
||||||
|
* Status of the request
|
||||||
|
*/
|
||||||
|
ok: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type VerifyOtpRequest = {
|
||||||
|
/**
|
||||||
|
* Phone number to verify OTP for
|
||||||
|
*/
|
||||||
|
phone_number: string;
|
||||||
|
/**
|
||||||
|
* One-time password to verify
|
||||||
|
*/
|
||||||
|
otp: string;
|
||||||
|
/**
|
||||||
|
* Login challenge for verification
|
||||||
|
*/
|
||||||
|
login_challenge: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type VerifyOtpResponse = {
|
||||||
|
/**
|
||||||
|
* URL to redirect to after successful verification
|
||||||
|
*/
|
||||||
|
redirect_url: string;
|
||||||
|
/**
|
||||||
|
* Status of the verification
|
||||||
|
*/
|
||||||
|
ok: boolean;
|
||||||
|
/**
|
||||||
|
* Confirmation message
|
||||||
|
*/
|
||||||
|
message: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type AcceptConsentRequest = {
|
||||||
|
/**
|
||||||
|
* The consent challenge to accept
|
||||||
|
*/
|
||||||
|
consent_challenge: string;
|
||||||
|
/**
|
||||||
|
* Phone number associated with the consent
|
||||||
|
*/
|
||||||
|
phone_number: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type AcceptConsentResponse = {
|
||||||
|
/**
|
||||||
|
* URL to redirect to after accepting consent
|
||||||
|
*/
|
||||||
|
redirect_url: string;
|
||||||
|
/**
|
||||||
|
* Status of the consent acceptance
|
||||||
|
*/
|
||||||
|
ok: boolean;
|
||||||
|
message: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PostAuthOtpRequestData = {
|
||||||
|
body: RequestOtpRequest;
|
||||||
|
path?: never;
|
||||||
|
query?: never;
|
||||||
|
url: '/auth/otp/request';
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PostAuthOtpRequestErrors = {
|
||||||
|
/**
|
||||||
|
* Bad request
|
||||||
|
*/
|
||||||
|
400: RequestOtpResponse;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PostAuthOtpRequestError = PostAuthOtpRequestErrors[keyof PostAuthOtpRequestErrors];
|
||||||
|
|
||||||
|
export type PostAuthOtpRequestResponses = {
|
||||||
|
/**
|
||||||
|
* OTP requested successfully
|
||||||
|
*/
|
||||||
|
200: RequestOtpResponse;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PostAuthOtpRequestResponse = PostAuthOtpRequestResponses[keyof PostAuthOtpRequestResponses];
|
||||||
|
|
||||||
|
export type PostAuthOtpVerifyData = {
|
||||||
|
body: VerifyOtpRequest;
|
||||||
|
path?: never;
|
||||||
|
query?: never;
|
||||||
|
url: '/auth/otp/verify';
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PostAuthOtpVerifyErrors = {
|
||||||
|
/**
|
||||||
|
* Bad request
|
||||||
|
*/
|
||||||
|
400: VerifyOtpResponse;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PostAuthOtpVerifyError = PostAuthOtpVerifyErrors[keyof PostAuthOtpVerifyErrors];
|
||||||
|
|
||||||
|
export type PostAuthOtpVerifyResponses = {
|
||||||
|
/**
|
||||||
|
* OTP verified successfully
|
||||||
|
*/
|
||||||
|
200: VerifyOtpResponse;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PostAuthOtpVerifyResponse = PostAuthOtpVerifyResponses[keyof PostAuthOtpVerifyResponses];
|
||||||
|
|
||||||
|
export type PostAuthConsentAcceptData = {
|
||||||
|
body: AcceptConsentRequest;
|
||||||
|
path?: never;
|
||||||
|
query?: never;
|
||||||
|
url: '/auth/consent/accept';
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PostAuthConsentAcceptErrors = {
|
||||||
|
/**
|
||||||
|
* Bad request
|
||||||
|
*/
|
||||||
|
400: AcceptConsentResponse;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PostAuthConsentAcceptError = PostAuthConsentAcceptErrors[keyof PostAuthConsentAcceptErrors];
|
||||||
|
|
||||||
|
export type PostAuthConsentAcceptResponses = {
|
||||||
|
/**
|
||||||
|
* Consent accepted successfully
|
||||||
|
*/
|
||||||
|
200: AcceptConsentResponse;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PostAuthConsentAcceptResponse = PostAuthConsentAcceptResponses[keyof PostAuthConsentAcceptResponses];
|
||||||
|
|
||||||
|
export type ClientOptions = {
|
||||||
|
baseUrl: `${string}://${string}` | (string & {});
|
||||||
|
};
|
||||||
68
src/client/zod.gen.ts
Normal file
68
src/client/zod.gen.ts
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
// This file is auto-generated by @hey-api/openapi-ts
|
||||||
|
|
||||||
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
export const zRequestOtpRequest = z.object({
|
||||||
|
phone_number: z.string().max(15)
|
||||||
|
});
|
||||||
|
|
||||||
|
export const zRequestOtpResponse = z.object({
|
||||||
|
message: z.string(),
|
||||||
|
ok: z.boolean()
|
||||||
|
});
|
||||||
|
|
||||||
|
export const zVerifyOtpRequest = z.object({
|
||||||
|
phone_number: z.string().max(15),
|
||||||
|
otp: z.string().max(6),
|
||||||
|
login_challenge: z.string()
|
||||||
|
});
|
||||||
|
|
||||||
|
export const zVerifyOtpResponse = z.object({
|
||||||
|
redirect_url: z.string(),
|
||||||
|
ok: z.boolean(),
|
||||||
|
message: z.string()
|
||||||
|
});
|
||||||
|
|
||||||
|
export const zAcceptConsentRequest = z.object({
|
||||||
|
consent_challenge: z.string(),
|
||||||
|
phone_number: z.string().max(15)
|
||||||
|
});
|
||||||
|
|
||||||
|
export const zAcceptConsentResponse = z.object({
|
||||||
|
redirect_url: z.string(),
|
||||||
|
ok: z.boolean(),
|
||||||
|
message: z.string()
|
||||||
|
});
|
||||||
|
|
||||||
|
export const zPostAuthOtpRequestData = z.object({
|
||||||
|
body: zRequestOtpRequest,
|
||||||
|
path: z.optional(z.never()),
|
||||||
|
query: z.optional(z.never())
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OTP requested successfully
|
||||||
|
*/
|
||||||
|
export const zPostAuthOtpRequestResponse = zRequestOtpResponse;
|
||||||
|
|
||||||
|
export const zPostAuthOtpVerifyData = z.object({
|
||||||
|
body: zVerifyOtpRequest,
|
||||||
|
path: z.optional(z.never()),
|
||||||
|
query: z.optional(z.never())
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OTP verified successfully
|
||||||
|
*/
|
||||||
|
export const zPostAuthOtpVerifyResponse = zVerifyOtpResponse;
|
||||||
|
|
||||||
|
export const zPostAuthConsentAcceptData = z.object({
|
||||||
|
body: zAcceptConsentRequest,
|
||||||
|
path: z.optional(z.never()),
|
||||||
|
query: z.optional(z.never())
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Consent accepted successfully
|
||||||
|
*/
|
||||||
|
export const zPostAuthConsentAcceptResponse = zAcceptConsentResponse;
|
||||||
@ -1,12 +0,0 @@
|
|||||||
'use client';
|
|
||||||
|
|
||||||
import { motion, MotionProps } from 'framer-motion';
|
|
||||||
import { ReactNode } from 'react';
|
|
||||||
|
|
||||||
interface MotionWrapperProps extends MotionProps {
|
|
||||||
children: ReactNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function MotionWrapper({ children, ...props }: MotionWrapperProps) {
|
|
||||||
return <motion.div {...props}>{children}</motion.div>;
|
|
||||||
}
|
|
||||||
@ -4,11 +4,14 @@ import { FC, useEffect, useState } from "react";
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { Button, Stack } from "@mantine/core";
|
import { Button, Stack } from "@mantine/core";
|
||||||
import { useForm } from "@mantine/form";
|
import { useForm } from "@mantine/form";
|
||||||
import PhoneInput from "@/components/PhoneInput/PhoneInput";
|
import { Auth } from "@/client";
|
||||||
import { useAppDispatch } from "@/lib/store";
|
import PhoneInput from "@/components/ui/PhoneInput/PhoneInput";
|
||||||
import { setLoginChallenge, setPhoneNumber } from "@/lib/features/auth/authSlice";
|
import {
|
||||||
import { AuthService } from "@/mocks/authService";
|
setLoginChallenge,
|
||||||
|
setPhoneNumber,
|
||||||
|
} from "@/lib/store/features/auth/authSlice";
|
||||||
import { notifications } from "@/lib/notifications";
|
import { notifications } from "@/lib/notifications";
|
||||||
|
import { useAppDispatch } from "@/lib/store/store";
|
||||||
|
|
||||||
type LoginForm = {
|
type LoginForm = {
|
||||||
phoneNumber: string;
|
phoneNumber: string;
|
||||||
@ -39,21 +42,26 @@ const LoginForm: FC<Props> = ({ loginChallenge, isCreatingId = false }) => {
|
|||||||
}, [loginChallenge]);
|
}, [loginChallenge]);
|
||||||
|
|
||||||
const handleSubmit = (values: LoginForm) => {
|
const handleSubmit = (values: LoginForm) => {
|
||||||
dispatch(setPhoneNumber(values.phoneNumber));
|
const phoneNumber = values.phoneNumber.replace(/ /g, "");
|
||||||
|
dispatch(setPhoneNumber(phoneNumber));
|
||||||
new AuthService().requestLogin(values.phoneNumber)
|
Auth.postAuthOtpRequest({
|
||||||
|
body: { phone_number: phoneNumber },
|
||||||
|
})
|
||||||
.then(response => response.data)
|
.then(response => response.data)
|
||||||
.then(({ ok, message }) => {
|
.then(response => {
|
||||||
if (!ok) {
|
console.log(response);
|
||||||
notifications.error({ message });
|
if (!response) {
|
||||||
} else {
|
notifications.error({
|
||||||
|
message: "Ошибка при отправке запроса",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const { ok, message } = response;
|
||||||
|
notifications.guess(ok, { message });
|
||||||
|
if (ok) {
|
||||||
router.push("/verify-phone");
|
router.push("/verify-phone");
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
.catch(error => {
|
|
||||||
console.error(error);
|
|
||||||
notifications.error({ message: error.toString() });
|
|
||||||
})
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const navigateToCreateId = () => router.push("/create-id");
|
const navigateToCreateId = () => router.push("/create-id");
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { Group } from "@mantine/core";
|
import { Group } from "@mantine/core";
|
||||||
import { ColorSchemeToggle } from "@/components/ColorSchemeToggle/ColorSchemeToggle";
|
import { ColorSchemeToggle } from "@/components/ui/ColorSchemeToggle/ColorSchemeToggle";
|
||||||
|
|
||||||
const Header = () => {
|
const Header = () => {
|
||||||
return (
|
return (
|
||||||
12
src/components/layout/MotionWrapper/MotionWrapper.tsx
Normal file
12
src/components/layout/MotionWrapper/MotionWrapper.tsx
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { ReactNode } from "react";
|
||||||
|
import { motion, MotionProps } from "framer-motion";
|
||||||
|
|
||||||
|
interface MotionWrapperProps extends MotionProps {
|
||||||
|
children: ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function MotionWrapper({ children, ...props }: MotionWrapperProps) {
|
||||||
|
return <motion.div {...props}>{children}</motion.div>;
|
||||||
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
import { CSSProperties, FC, ReactNode } from "react";
|
import { CSSProperties, FC, ReactNode } from "react";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import { MotionWrapper } from "@/components/MotionWrapper/MotionWrapper";
|
import { MotionWrapper } from "@/components/layout/MotionWrapper/MotionWrapper";
|
||||||
import styles from "./PageItem.module.css";
|
import styles from "./PageItem.module.css";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@ -7,7 +7,7 @@ import {
|
|||||||
useComputedColorScheme,
|
useComputedColorScheme,
|
||||||
useMantineColorScheme,
|
useMantineColorScheme,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import style from "@/components/ColorSchemeToggle/ColorSchemeToggle.module.css";
|
import style from "./ColorSchemeToggle.module.css";
|
||||||
|
|
||||||
export function ColorSchemeToggle() {
|
export function ColorSchemeToggle() {
|
||||||
const { setColorScheme } = useMantineColorScheme();
|
const { setColorScheme } = useMantineColorScheme();
|
||||||
@ -7,10 +7,8 @@ import {
|
|||||||
type InputBaseProps,
|
type InputBaseProps,
|
||||||
type PolymorphicComponentProps,
|
type PolymorphicComponentProps,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import CountrySelect from "@/components/PhoneInput/components/CountrySelect";
|
import { Country } from "@/components/ui/PhoneInput/types";
|
||||||
import { Country } from "@/components/PhoneInput/types";
|
import getInitialDataFromValue from "@/components/ui/PhoneInput/utils/getInitialDataFromValue";
|
||||||
import getInitialDataFromValue from "@/components/PhoneInput/utils/getInitialDataFromValue";
|
|
||||||
import getPhoneMask from "@/components/PhoneInput/utils/getPhoneMask";
|
|
||||||
|
|
||||||
type AdditionalProps = {
|
type AdditionalProps = {
|
||||||
onChange: (value: string | null) => void;
|
onChange: (value: string | null) => void;
|
||||||
@ -20,14 +18,13 @@ type AdditionalProps = {
|
|||||||
|
|
||||||
type InputProps = Omit<
|
type InputProps = Omit<
|
||||||
PolymorphicComponentProps<typeof IMaskInput, InputBaseProps>,
|
PolymorphicComponentProps<typeof IMaskInput, InputBaseProps>,
|
||||||
"onChange" | "defaultValue"
|
"onChange" | "defaultValue" | "value"
|
||||||
>;
|
>;
|
||||||
|
|
||||||
export type Props = AdditionalProps & InputProps;
|
export type Props = AdditionalProps & InputProps;
|
||||||
|
|
||||||
const PhoneInput = ({
|
const PhoneInput = ({
|
||||||
initialCountryCode = "RU",
|
initialCountryCode = "RU",
|
||||||
value: _value,
|
|
||||||
onChange: _onChange,
|
onChange: _onChange,
|
||||||
setPhoneMask: _setPhoneMask,
|
setPhoneMask: _setPhoneMask,
|
||||||
...props
|
...props
|
||||||
@ -41,8 +38,6 @@ const PhoneInput = ({
|
|||||||
const inputRef = useRef<HTMLInputElement>(null);
|
const inputRef = useRef<HTMLInputElement>(null);
|
||||||
const [dropdownWidth, setDropdownWidth] = useState<number>(300);
|
const [dropdownWidth, setDropdownWidth] = useState<number>(300);
|
||||||
|
|
||||||
const lastNotifiedValue = useRef<string | null>(value ?? "");
|
|
||||||
|
|
||||||
const onChange = (numberWithoutCode: string) => {
|
const onChange = (numberWithoutCode: string) => {
|
||||||
setValue(numberWithoutCode);
|
setValue(numberWithoutCode);
|
||||||
_onChange(`+${country.callingCode} ${numberWithoutCode}`);
|
_onChange(`+${country.callingCode} ${numberWithoutCode}`);
|
||||||
@ -57,14 +52,6 @@ const PhoneInput = ({
|
|||||||
setPhoneMask(initialData.current.format, country);
|
setPhoneMask(initialData.current.format, country);
|
||||||
}, [initialData.current.format]);
|
}, [initialData.current.format]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const localValue = value.trim();
|
|
||||||
if (localValue !== lastNotifiedValue.current) {
|
|
||||||
lastNotifiedValue.current = localValue;
|
|
||||||
onChange(localValue);
|
|
||||||
}
|
|
||||||
}, [country.code, value]);
|
|
||||||
|
|
||||||
const { readOnly, disabled } = props;
|
const { readOnly, disabled } = props;
|
||||||
const leftSectionWidth = 90;
|
const leftSectionWidth = 90;
|
||||||
|
|
||||||
@ -79,20 +66,21 @@ const PhoneInput = ({
|
|||||||
component={IMaskInput}
|
component={IMaskInput}
|
||||||
inputRef={inputRef}
|
inputRef={inputRef}
|
||||||
leftSection={
|
leftSection={
|
||||||
<CountrySelect
|
<></>
|
||||||
disabled={disabled || readOnly}
|
// <CountrySelect
|
||||||
country={country}
|
// disabled={disabled || readOnly}
|
||||||
setCountry={country => {
|
// country={country}
|
||||||
setCountry(country);
|
// setCountry={country => {
|
||||||
setPhoneMask(getPhoneMask(country.code), country);
|
// setCountry(country);
|
||||||
setValue("");
|
// setPhoneMask(getPhoneMask(country.code), country);
|
||||||
if (inputRef.current) {
|
// setValue("");
|
||||||
inputRef.current.focus();
|
// if (inputRef.current) {
|
||||||
}
|
// inputRef.current.focus();
|
||||||
}}
|
// }
|
||||||
leftSectionWidth={leftSectionWidth}
|
// }}
|
||||||
inputWidth={dropdownWidth}
|
// leftSectionWidth={leftSectionWidth}
|
||||||
/>
|
// inputWidth={dropdownWidth}
|
||||||
|
// />
|
||||||
}
|
}
|
||||||
leftSectionWidth={leftSectionWidth}
|
leftSectionWidth={leftSectionWidth}
|
||||||
styles={{
|
styles={{
|
||||||
@ -108,7 +96,7 @@ const PhoneInput = ({
|
|||||||
inputMode={"numeric"}
|
inputMode={"numeric"}
|
||||||
mask={mask}
|
mask={mask}
|
||||||
value={value}
|
value={value}
|
||||||
onAccept={value => setValue(value)}
|
onAccept={onChange}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -10,9 +10,10 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
useCombobox,
|
useCombobox,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import style from "@/components/PhoneInput/PhoneInput.module.css";
|
import style from "@/components/ui/PhoneInput/PhoneInput.module.css";
|
||||||
import { Country } from "@/components/PhoneInput/types";
|
import { Country } from "@/components/ui/PhoneInput/types";
|
||||||
import countryOptionsDataMap from "@/components/PhoneInput/utils/countryOptionsDataMap";
|
import countryOptionsDataMap from "@/components/ui/PhoneInput/utils/countryOptionsDataMap";
|
||||||
|
|
||||||
|
|
||||||
const countryOptionsData = Object.values(countryOptionsDataMap);
|
const countryOptionsData = Object.values(countryOptionsDataMap);
|
||||||
|
|
||||||
@ -1,9 +1,9 @@
|
|||||||
import countries from "i18n-iso-countries";
|
import countries from "i18n-iso-countries";
|
||||||
import ru from "i18n-iso-countries/langs/ru.json";
|
import ru from "i18n-iso-countries/langs/ru.json";
|
||||||
import { type CountryCode, getCountries } from "libphonenumber-js";
|
import { type CountryCode, getCountries } from "libphonenumber-js";
|
||||||
import getFlagEmoji from "@/components/PhoneInput/utils/getFlagEmoji";
|
import getFlagEmoji from "@/components/ui/PhoneInput/utils/getFlagEmoji";
|
||||||
import { getCountryCallingCode } from "libphonenumber-js/max";
|
import { getCountryCallingCode } from "libphonenumber-js/max";
|
||||||
import { Country } from "@/components/PhoneInput/types";
|
import { Country } from "@/components/ui/PhoneInput/types";
|
||||||
|
|
||||||
countries.registerLocale(ru);
|
countries.registerLocale(ru);
|
||||||
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import { CountryCode } from "libphonenumber-js";
|
import { CountryCode } from "libphonenumber-js";
|
||||||
import { Country } from "@/components/PhoneInput/types";
|
import { Country } from "@/components/ui/PhoneInput/types";
|
||||||
import countryOptionsDataMap from "@/components/PhoneInput/utils/countryOptionsDataMap";
|
import countryOptionsDataMap from "@/components/ui/PhoneInput/utils/countryOptionsDataMap";
|
||||||
import getPhoneMask from "@/components/PhoneInput/utils/getPhoneMask";
|
import getPhoneMask from "@/components/ui/PhoneInput/utils/getPhoneMask";
|
||||||
|
|
||||||
type InitialDataFromValue = {
|
type InitialDataFromValue = {
|
||||||
country: Country;
|
country: Country;
|
||||||
6
src/hey-api-config.ts
Normal file
6
src/hey-api-config.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import type { CreateClientConfig } from './client/client.gen';
|
||||||
|
|
||||||
|
export const createClientConfig: CreateClientConfig = (config) => ({
|
||||||
|
...config,
|
||||||
|
baseUrl: process.env.NEXT_PUBLIC_API_URL,
|
||||||
|
});
|
||||||
@ -1,12 +0,0 @@
|
|||||||
import { combineReducers } from "@reduxjs/toolkit";
|
|
||||||
import targetServiceReducer from "@/lib/features/targetService/targetServiceSlice";
|
|
||||||
import verificationReducer from "@/lib/features/verification/verificationSlice";
|
|
||||||
import authReducer from "@/lib/features/auth/authSlice";
|
|
||||||
|
|
||||||
const rootReducer = combineReducers({
|
|
||||||
targetService: targetServiceReducer,
|
|
||||||
verification: verificationReducer,
|
|
||||||
auth: authReducer,
|
|
||||||
});
|
|
||||||
|
|
||||||
export default rootReducer;
|
|
||||||
12
src/lib/store/features/rootReducer.ts
Normal file
12
src/lib/store/features/rootReducer.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { combineReducers } from "@reduxjs/toolkit";
|
||||||
|
import authReducer from "@/lib/store/features/auth/authSlice";
|
||||||
|
import targetServiceReducer from "@/lib/store/features/targetService/targetServiceSlice";
|
||||||
|
import verificationReducer from "@/lib/store/features/verification/verificationSlice";
|
||||||
|
|
||||||
|
const rootReducer = combineReducers({
|
||||||
|
targetService: targetServiceReducer,
|
||||||
|
verification: verificationReducer,
|
||||||
|
auth: authReducer,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default rootReducer;
|
||||||
@ -2,7 +2,7 @@ import { configureStore } from "@reduxjs/toolkit";
|
|||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { persistReducer, persistStore } from "redux-persist";
|
import { persistReducer, persistStore } from "redux-persist";
|
||||||
import storage from "redux-persist/lib/storage";
|
import storage from "redux-persist/lib/storage";
|
||||||
import rootReducer from "@/lib/features/rootReducer";
|
import rootReducer from "@/lib/store/features/rootReducer";
|
||||||
|
|
||||||
const persistConfig = {
|
const persistConfig = {
|
||||||
key: "root",
|
key: "root",
|
||||||
@ -1,75 +0,0 @@
|
|||||||
import { AxiosResponse } from "axios";
|
|
||||||
import { Scopes } from "@/enums/Scopes";
|
|
||||||
|
|
||||||
type MockOkMessage = {
|
|
||||||
ok: boolean;
|
|
||||||
message: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
type MockApproveLoginResponse = {
|
|
||||||
redirectUrl: string;
|
|
||||||
scope: Scopes[];
|
|
||||||
}
|
|
||||||
|
|
||||||
type MockRequestConsentResponse = {
|
|
||||||
clientName: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
type MockApproveConsentResponse = {
|
|
||||||
redirectUrl: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class AuthService {
|
|
||||||
async requestLogin(phoneNumber: string): Promise<AxiosResponse<MockOkMessage>> {
|
|
||||||
return Promise.resolve({
|
|
||||||
data: { ok: true, message: "Mock response" } as MockOkMessage,
|
|
||||||
status: 200,
|
|
||||||
statusText: "OK",
|
|
||||||
headers: {},
|
|
||||||
config: {} as any,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async approveLogin(
|
|
||||||
phoneNumber: string,
|
|
||||||
code: string,
|
|
||||||
loginChallenge: string
|
|
||||||
): Promise<AxiosResponse<MockApproveLoginResponse>> {
|
|
||||||
return Promise.resolve({
|
|
||||||
data: {
|
|
||||||
redirectUrl:
|
|
||||||
"http://oauth2.logidex.ru/oauth2/auth?client_id=crm-client&login_verifier=c-4HxjyA0rUMMOYQG-kHStU5pxFeOdViKOyk-eT_qv7vNPHu3xdysdYj3Jwq2gh6vRSHdO6xA7NQgneUho5I_LyENNTFqRkjWwhAsy7Ad9DFhcAWVRCU1rI3ksy38-UTWlto7vKVVhGgRzvlk-coa273uLz-BEo64oUl9B_gcojLnLjO1Q1W6Hu8_nJxqyQBhLPcFOZ1vDVnNcQF5UbB9bld3Wr_1nn3r7sQMBQR54Vphcku6a37GYbPVMVGHo0nBGf6rps6Xg4L6IsD5hlsHzsw5OX3W0MDJ6o--VxHr_HveAH8K7R21Q59JtHa-26pO4KGjetGfgr8rPOTRtsZiKApjZ8qjM9pEgusPj39ysmqYo1wmJo1ZXz8wXh-t3UO0pGIZogmzEOLs5bPCCbXrjG7VaQ78jufSAG2pmhMJxR9AmWsaJms16lev1dBFn-IBdrr4LqYrsVQMqpZstF18ENSURAKejHc8l8m4xocy2-D-ZaeZX0k0vnuGsNTbxT79D1u_-ALm2n0LRwcsK5VCF8v5oO_aMFxcSO87QHU8wy8Wj3um3IBb0sCQXDCpsYIlwqczWNWmxaGXDsmqqUYvZdvWKEXMI5BbbVc44h4_sOaa6BKAaNSceC2GHqN94GWz8dmsX7xyfXMsHYR8_hUFsztN8OstrQkRddJ8een4mdW777W3PYe_U4UL2S2az4L7tC5DTifDCHTfYknb4baQ3UT7x4N8eCd2_Xlkl4gQKU5Mm8njZWucWsLjdW7NG8Q_aDQEl45VunmaQ8iKOTrn1BiNzRHnYdOm15C8nnxHyZ9pO8IKELxUGIKnwP8eF6-A-Rj_bLWWIBquLTRgBrR153gu5Srh2Xl8-LU4ffxM6ipO1nHJMPg3_5493yS1ua_ZWUuht_d4C4Y6j6xuFJHx-bKrCIffiGiSUnpKkepzGnTHCS02wNDVItheAUnlO18zbxsHBFM1tjQQrLIB3cxQRrK12NmIgOheiQMzkSwpQ2CmdRnVpJBGy8Nzp7X_YP-nVC9ctzFR1YrTEw-ZH0wVYjPu_vsijwUtqq3mABD8lw%3D&redirect_uri=http%3A%2F%2Fcrm.logidex.ru%2Fcallback&response_type=code&scope=openid&state=csrf_token",
|
|
||||||
scope: ["openid"] as Scopes[],
|
|
||||||
},
|
|
||||||
status: 200,
|
|
||||||
statusText: "OK",
|
|
||||||
headers: {},
|
|
||||||
config: {} as any,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async requestConsent(consentChallenge: string): Promise<AxiosResponse<MockRequestConsentResponse>> {
|
|
||||||
return Promise.resolve({
|
|
||||||
data: {
|
|
||||||
clientName: "crm",
|
|
||||||
},
|
|
||||||
status: 200,
|
|
||||||
statusText: "OK",
|
|
||||||
headers: {},
|
|
||||||
config: {} as any,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async approveConsent(consentChallenge: string): Promise<AxiosResponse<MockApproveConsentResponse>> {
|
|
||||||
return Promise.resolve({
|
|
||||||
data: {
|
|
||||||
redirectUrl:
|
|
||||||
"http://oauth2.logidex.ru/oauth2/auth?client_id=crm-client&consent_verifier=hU0HetHSHoqc4ZMvwsjMaFUsVckZ3B6ztXyQim4vwcptp4Dp9cIvSByiFHvThLkaIVl2f7uDxB8hUcUoG1-DvNDC3qcGCskLlNn0tDlNcxb41LZtS28D8iZJAUiZedqDdGCfhkuH4TioErId5m-8-y5Y-PYrosfcrqsVfK88vZ5kgViMIjROe68Vc_O5kxpPUymt5I_-oUeFMdrDnjpVcTipwTJIG-WutbtUBHp6tA3FXIfo-0ai-o8yr2Lv2bQiBSegYKA4GmfrQ25xn7_yQGLyGVBVsKPCNRQAyRvdeqFEVGm-3SUxvIJCeyCXaZrHxENSUbxo6xd1m_oVHqye8hXcZSWmFVOa4eo4Rw6OWsnN3AWl75XLt_maKcL_LZftkQERtJBgV2-8C1QYJXwoPS0uTFANq39s2778KIP0XbufiB3UW1QvmUdzKKH43K4MnB-F9ah26nzaw8HwEBTbDGclvkq7TFAozKddwnumgrqRkbElwC3eqr5LnpMfGR1vCVBP81sPjx26LoiKOpmuamfT-O37EsVHdooeP8ry2IjCx0KrUe5wI93XiUc4RIMn_MsO8zaifyNrzFfvVQ7VPNj3QasM4O4drDyGLict1fWiNZP_KVFeAnojOp258nPqDn76VSzROweummzSD-lC56zviX9pZjmGb0RpXb8eeB2Nc4uWCy3dYw4kxEFQSqwU7liqI9paZLv0Vl1PrvS4GL_vv3zh4YKpp8h1yT0IWDnEL75dmIeSBXB7eTkZy8ING1HdwvfH1TdYImCrmLTi93JWtSJvsZWklUBQsFQ900hYPYGK4WVdxRQOTsHrJhJwOex5so7mrnowHpXQuUU6eDi9p2Yj0_YN2XuPIs1I9iS2F2S6t1_kNRmJupzo3g09bY8AGNsSDeEwp2riqXQ_o3xgATaIUycbve2qcOIr89kHomYSCc0YiQnka3zBb5RRTlYhDuQlgeHuEnIBWU2oLYcnyP-zlbeSxRbYuYu4uxXtLHDT9E6tDxqXxSYvw4AzUw-EwQX8v0LamJnQLHCSwD7F8S0M5COSm_Pv56DhtBevnU7PqrpZ-FKOXm89A2HXx9XO8qQMG-tg3y5TZ5vVfTwJ6WkzZNkZSWAZGiwQX4wiQmjep4wlKgP3ZQ8VV0CVS6R9f1DMwY8tCvuJFumd_OORK7-q_bgg3Xp3Njc%3D&redirect_uri=http%3A%2F%2Fcrm.logidex.ru%2Fcallback&response_type=code&scope=openid&state=csrf_token",
|
|
||||||
},
|
|
||||||
status: 200,
|
|
||||||
statusText: "OK",
|
|
||||||
headers: {},
|
|
||||||
config: {} as any,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -3,7 +3,7 @@
|
|||||||
import { ReactNode } from "react";
|
import { ReactNode } from "react";
|
||||||
import { Provider } from "react-redux";
|
import { Provider } from "react-redux";
|
||||||
import { PersistGate } from "redux-persist/integration/react";
|
import { PersistGate } from "redux-persist/integration/react";
|
||||||
import { persistor, store } from "@/lib/store";
|
import { persistor, store } from "@/lib/store/store";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"types": ["node", "jest", "@testing-library/jest-dom"],
|
"types": ["node", "jest", "@testing-library/jest-dom"],
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"lib": ["dom", "dom.iterable", "esnext"],
|
"lib": ["dom", "dom.iterable", "esnext"],
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
@ -21,5 +21,5 @@
|
|||||||
"plugins": [{ "name": "next" }]
|
"plugins": [{ "name": "next" }]
|
||||||
},
|
},
|
||||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
||||||
"exclude": ["node_modules"]
|
"exclude": ["node_modules", "src/client/*"]
|
||||||
}
|
}
|
||||||
|
|||||||
431
yarn.lock
431
yarn.lock
@ -2694,6 +2694,38 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"@hey-api/json-schema-ref-parser@npm:1.0.6":
|
||||||
|
version: 1.0.6
|
||||||
|
resolution: "@hey-api/json-schema-ref-parser@npm:1.0.6"
|
||||||
|
dependencies:
|
||||||
|
"@jsdevtools/ono": "npm:^7.1.3"
|
||||||
|
"@types/json-schema": "npm:^7.0.15"
|
||||||
|
js-yaml: "npm:^4.1.0"
|
||||||
|
lodash: "npm:^4.17.21"
|
||||||
|
checksum: 10c0/a3d15b2316ef5a4442131386aa61e196af4f0e01064d5c66a598cf0ea5b9217dce57cb40e98278cdac9548a7e27ecc5cf9146fe301b9371aefd81a0933553252
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@hey-api/openapi-ts@npm:0.80.1":
|
||||||
|
version: 0.80.1
|
||||||
|
resolution: "@hey-api/openapi-ts@npm:0.80.1"
|
||||||
|
dependencies:
|
||||||
|
"@hey-api/json-schema-ref-parser": "npm:1.0.6"
|
||||||
|
ansi-colors: "npm:4.1.3"
|
||||||
|
c12: "npm:2.0.1"
|
||||||
|
color-support: "npm:1.1.3"
|
||||||
|
commander: "npm:13.0.0"
|
||||||
|
handlebars: "npm:4.7.8"
|
||||||
|
open: "npm:10.1.2"
|
||||||
|
semver: "npm:7.7.2"
|
||||||
|
peerDependencies:
|
||||||
|
typescript: ^5.5.3
|
||||||
|
bin:
|
||||||
|
openapi-ts: bin/index.cjs
|
||||||
|
checksum: 10c0/5c203712b6d3e4ad502518c830b702f239c46150d31544b491e85873c419c85ade3f12109699716d39acb8b9351c80c399355d49a5fc92fd458cab9380a7e6d0
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"@humanfs/core@npm:^0.19.1":
|
"@humanfs/core@npm:^0.19.1":
|
||||||
version: 0.19.1
|
version: 0.19.1
|
||||||
resolution: "@humanfs/core@npm:0.19.1"
|
resolution: "@humanfs/core@npm:0.19.1"
|
||||||
@ -3749,6 +3781,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"@jsdevtools/ono@npm:^7.1.3":
|
||||||
|
version: 7.1.3
|
||||||
|
resolution: "@jsdevtools/ono@npm:7.1.3"
|
||||||
|
checksum: 10c0/a9f7e3e8e3bc315a34959934a5e2f874c423cf4eae64377d3fc9de0400ed9f36cb5fd5ebce3300d2e8f4085f557c4a8b591427a583729a87841fda46e6c216b9
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"@keyv/serialize@npm:^1.0.3":
|
"@keyv/serialize@npm:^1.0.3":
|
||||||
version: 1.0.3
|
version: 1.0.3
|
||||||
resolution: "@keyv/serialize@npm:1.0.3"
|
resolution: "@keyv/serialize@npm:1.0.3"
|
||||||
@ -6004,6 +6043,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"ansi-colors@npm:4.1.3":
|
||||||
|
version: 4.1.3
|
||||||
|
resolution: "ansi-colors@npm:4.1.3"
|
||||||
|
checksum: 10c0/ec87a2f59902f74e61eada7f6e6fe20094a628dab765cfdbd03c3477599368768cffccdb5d3bb19a1b6c99126783a143b1fee31aab729b31ffe5836c7e5e28b9
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"ansi-escapes@npm:^4.3.2":
|
"ansi-escapes@npm:^4.3.2":
|
||||||
version: 4.3.2
|
version: 4.3.2
|
||||||
resolution: "ansi-escapes@npm:4.3.2"
|
resolution: "ansi-escapes@npm:4.3.2"
|
||||||
@ -6821,6 +6867,15 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"bundle-name@npm:^4.1.0":
|
||||||
|
version: 4.1.0
|
||||||
|
resolution: "bundle-name@npm:4.1.0"
|
||||||
|
dependencies:
|
||||||
|
run-applescript: "npm:^7.0.0"
|
||||||
|
checksum: 10c0/8e575981e79c2bcf14d8b1c027a3775c095d362d1382312f444a7c861b0e21513c0bd8db5bd2b16e50ba0709fa622d4eab6b53192d222120305e68359daece29
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"busboy@npm:1.6.0":
|
"busboy@npm:1.6.0":
|
||||||
version: 1.6.0
|
version: 1.6.0
|
||||||
resolution: "busboy@npm:1.6.0"
|
resolution: "busboy@npm:1.6.0"
|
||||||
@ -6830,6 +6885,31 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"c12@npm:2.0.1":
|
||||||
|
version: 2.0.1
|
||||||
|
resolution: "c12@npm:2.0.1"
|
||||||
|
dependencies:
|
||||||
|
chokidar: "npm:^4.0.1"
|
||||||
|
confbox: "npm:^0.1.7"
|
||||||
|
defu: "npm:^6.1.4"
|
||||||
|
dotenv: "npm:^16.4.5"
|
||||||
|
giget: "npm:^1.2.3"
|
||||||
|
jiti: "npm:^2.3.0"
|
||||||
|
mlly: "npm:^1.7.1"
|
||||||
|
ohash: "npm:^1.1.4"
|
||||||
|
pathe: "npm:^1.1.2"
|
||||||
|
perfect-debounce: "npm:^1.0.0"
|
||||||
|
pkg-types: "npm:^1.2.0"
|
||||||
|
rc9: "npm:^2.1.2"
|
||||||
|
peerDependencies:
|
||||||
|
magicast: ^0.3.5
|
||||||
|
peerDependenciesMeta:
|
||||||
|
magicast:
|
||||||
|
optional: true
|
||||||
|
checksum: 10c0/6a019047918102eda28c29988990fdf38aa88df05f94c5e06cbc501365dcdd80df2a7726d17d67882871ca931fd8d025a66d46bbc361275eeb0bcb849a06369a
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"cacache@npm:^18.0.0":
|
"cacache@npm:^18.0.0":
|
||||||
version: 18.0.0
|
version: 18.0.0
|
||||||
resolution: "cacache@npm:18.0.0"
|
resolution: "cacache@npm:18.0.0"
|
||||||
@ -7078,6 +7158,15 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"chokidar@npm:^4.0.1":
|
||||||
|
version: 4.0.3
|
||||||
|
resolution: "chokidar@npm:4.0.3"
|
||||||
|
dependencies:
|
||||||
|
readdirp: "npm:^4.0.1"
|
||||||
|
checksum: 10c0/a58b9df05bb452f7d105d9e7229ac82fa873741c0c40ddcc7bb82f8a909fbe3f7814c9ebe9bc9a2bef9b737c0ec6e2d699d179048ef06ad3ec46315df0ebe6ad
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"chownr@npm:^2.0.0":
|
"chownr@npm:^2.0.0":
|
||||||
version: 2.0.0
|
version: 2.0.0
|
||||||
resolution: "chownr@npm:2.0.0"
|
resolution: "chownr@npm:2.0.0"
|
||||||
@ -7116,6 +7205,15 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"citty@npm:^0.1.6":
|
||||||
|
version: 0.1.6
|
||||||
|
resolution: "citty@npm:0.1.6"
|
||||||
|
dependencies:
|
||||||
|
consola: "npm:^3.2.3"
|
||||||
|
checksum: 10c0/d26ad82a9a4a8858c7e149d90b878a3eceecd4cfd3e2ed3cd5f9a06212e451fb4f8cbe0fa39a3acb1b3e8f18e22db8ee5def5829384bad50e823d4b301609b48
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"cjs-module-lexer@npm:^1.2.3":
|
"cjs-module-lexer@npm:^1.2.3":
|
||||||
version: 1.2.3
|
version: 1.2.3
|
||||||
resolution: "cjs-module-lexer@npm:1.2.3"
|
resolution: "cjs-module-lexer@npm:1.2.3"
|
||||||
@ -7234,6 +7332,15 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"color-support@npm:1.1.3":
|
||||||
|
version: 1.1.3
|
||||||
|
resolution: "color-support@npm:1.1.3"
|
||||||
|
bin:
|
||||||
|
color-support: bin.js
|
||||||
|
checksum: 10c0/8ffeaa270a784dc382f62d9be0a98581db43e11eee301af14734a6d089bd456478b1a8b3e7db7ca7dc5b18a75f828f775c44074020b51c05fc00e6d0992b1cc6
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"color@npm:^4.2.3":
|
"color@npm:^4.2.3":
|
||||||
version: 4.2.3
|
version: 4.2.3
|
||||||
resolution: "color@npm:4.2.3"
|
resolution: "color@npm:4.2.3"
|
||||||
@ -7267,6 +7374,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"commander@npm:13.0.0":
|
||||||
|
version: 13.0.0
|
||||||
|
resolution: "commander@npm:13.0.0"
|
||||||
|
checksum: 10c0/8ba1e2b83bfdbcefd967aa505f5f5dc58202aa5f8e10437f61f6980dd8a69f868dba439a261f9fb72fc543c5f6fe58140e37b001a4c70b92ae22527abe94dfe1
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"commander@npm:^2.20.0":
|
"commander@npm:^2.20.0":
|
||||||
version: 2.20.3
|
version: 2.20.3
|
||||||
resolution: "commander@npm:2.20.3"
|
resolution: "commander@npm:2.20.3"
|
||||||
@ -7309,6 +7423,20 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"confbox@npm:^0.1.7, confbox@npm:^0.1.8":
|
||||||
|
version: 0.1.8
|
||||||
|
resolution: "confbox@npm:0.1.8"
|
||||||
|
checksum: 10c0/fc2c68d97cb54d885b10b63e45bd8da83a8a71459d3ecf1825143dd4c7f9f1b696b3283e07d9d12a144c1301c2ebc7842380bdf0014e55acc4ae1c9550102418
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"consola@npm:^3.2.3, consola@npm:^3.4.0":
|
||||||
|
version: 3.4.2
|
||||||
|
resolution: "consola@npm:3.4.2"
|
||||||
|
checksum: 10c0/7cebe57ecf646ba74b300bcce23bff43034ed6fbec9f7e39c27cee1dc00df8a21cd336b466ad32e304ea70fba04ec9e890c200270de9a526ce021ba8a7e4c11a
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"console-browserify@npm:^1.2.0":
|
"console-browserify@npm:^1.2.0":
|
||||||
version: 1.2.0
|
version: 1.2.0
|
||||||
resolution: "console-browserify@npm:1.2.0"
|
resolution: "console-browserify@npm:1.2.0"
|
||||||
@ -7726,6 +7854,23 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"default-browser-id@npm:^5.0.0":
|
||||||
|
version: 5.0.0
|
||||||
|
resolution: "default-browser-id@npm:5.0.0"
|
||||||
|
checksum: 10c0/957fb886502594c8e645e812dfe93dba30ed82e8460d20ce39c53c5b0f3e2afb6ceaec2249083b90bdfbb4cb0f34e1f73fde3d68cac00becdbcfd894156b5ead
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"default-browser@npm:^5.2.1":
|
||||||
|
version: 5.2.1
|
||||||
|
resolution: "default-browser@npm:5.2.1"
|
||||||
|
dependencies:
|
||||||
|
bundle-name: "npm:^4.1.0"
|
||||||
|
default-browser-id: "npm:^5.0.0"
|
||||||
|
checksum: 10c0/73f17dc3c58026c55bb5538749597db31f9561c0193cd98604144b704a981c95a466f8ecc3c2db63d8bfd04fb0d426904834cfc91ae510c6aeb97e13c5167c4d
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"define-data-property@npm:^1.0.1":
|
"define-data-property@npm:^1.0.1":
|
||||||
version: 1.1.0
|
version: 1.1.0
|
||||||
resolution: "define-data-property@npm:1.1.0"
|
resolution: "define-data-property@npm:1.1.0"
|
||||||
@ -7755,6 +7900,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"define-lazy-prop@npm:^3.0.0":
|
||||||
|
version: 3.0.0
|
||||||
|
resolution: "define-lazy-prop@npm:3.0.0"
|
||||||
|
checksum: 10c0/5ab0b2bf3fa58b3a443140bbd4cd3db1f91b985cc8a246d330b9ac3fc0b6a325a6d82bddc0b055123d745b3f9931afeea74a5ec545439a1630b9c8512b0eeb49
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"define-properties@npm:^1.1.3, define-properties@npm:^1.1.4, define-properties@npm:^1.2.0, define-properties@npm:^1.2.1":
|
"define-properties@npm:^1.1.3, define-properties@npm:^1.1.4, define-properties@npm:^1.2.0, define-properties@npm:^1.2.1":
|
||||||
version: 1.2.1
|
version: 1.2.1
|
||||||
resolution: "define-properties@npm:1.2.1"
|
resolution: "define-properties@npm:1.2.1"
|
||||||
@ -7766,6 +7918,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"defu@npm:^6.1.4":
|
||||||
|
version: 6.1.4
|
||||||
|
resolution: "defu@npm:6.1.4"
|
||||||
|
checksum: 10c0/2d6cc366262dc0cb8096e429368e44052fdf43ed48e53ad84cc7c9407f890301aa5fcb80d0995abaaf842b3949f154d060be4160f7a46cb2bc2f7726c81526f5
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"delayed-stream@npm:~1.0.0":
|
"delayed-stream@npm:~1.0.0":
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
resolution: "delayed-stream@npm:1.0.0"
|
resolution: "delayed-stream@npm:1.0.0"
|
||||||
@ -7790,6 +7949,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"destr@npm:^2.0.3":
|
||||||
|
version: 2.0.5
|
||||||
|
resolution: "destr@npm:2.0.5"
|
||||||
|
checksum: 10c0/efabffe7312a45ad90d79975376be958c50069f1156b94c181199763a7f971e113bd92227c26b94a169c71ca7dbc13583b7e96e5164743969fc79e1ff153e646
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"detect-libc@npm:^2.0.3":
|
"detect-libc@npm:^2.0.3":
|
||||||
version: 2.0.3
|
version: 2.0.3
|
||||||
resolution: "detect-libc@npm:2.0.3"
|
resolution: "detect-libc@npm:2.0.3"
|
||||||
@ -7958,6 +8124,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"dotenv@npm:^16.4.5":
|
||||||
|
version: 16.6.1
|
||||||
|
resolution: "dotenv@npm:16.6.1"
|
||||||
|
checksum: 10c0/15ce56608326ea0d1d9414a5c8ee6dcf0fffc79d2c16422b4ac2268e7e2d76ff5a572d37ffe747c377de12005f14b3cc22361e79fc7f1061cce81f77d2c973dc
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"dunder-proto@npm:^1.0.0, dunder-proto@npm:^1.0.1":
|
"dunder-proto@npm:^1.0.0, dunder-proto@npm:^1.0.1":
|
||||||
version: 1.0.1
|
version: 1.0.1
|
||||||
resolution: "dunder-proto@npm:1.0.1"
|
resolution: "dunder-proto@npm:1.0.1"
|
||||||
@ -9562,6 +9735,23 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"giget@npm:^1.2.3":
|
||||||
|
version: 1.2.5
|
||||||
|
resolution: "giget@npm:1.2.5"
|
||||||
|
dependencies:
|
||||||
|
citty: "npm:^0.1.6"
|
||||||
|
consola: "npm:^3.4.0"
|
||||||
|
defu: "npm:^6.1.4"
|
||||||
|
node-fetch-native: "npm:^1.6.6"
|
||||||
|
nypm: "npm:^0.5.4"
|
||||||
|
pathe: "npm:^2.0.3"
|
||||||
|
tar: "npm:^6.2.1"
|
||||||
|
bin:
|
||||||
|
giget: dist/cli.mjs
|
||||||
|
checksum: 10c0/0c541589b8a10274f5adb6cd34a568829939182f50b3d80f8bb891e974b889f0fc629a5d702920456037cc9c90fba84cf3860bad7a22a46bc51a5c55998f24a9
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2":
|
"glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2":
|
||||||
version: 5.1.2
|
version: 5.1.2
|
||||||
resolution: "glob-parent@npm:5.1.2"
|
resolution: "glob-parent@npm:5.1.2"
|
||||||
@ -9729,6 +9919,24 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"handlebars@npm:4.7.8":
|
||||||
|
version: 4.7.8
|
||||||
|
resolution: "handlebars@npm:4.7.8"
|
||||||
|
dependencies:
|
||||||
|
minimist: "npm:^1.2.5"
|
||||||
|
neo-async: "npm:^2.6.2"
|
||||||
|
source-map: "npm:^0.6.1"
|
||||||
|
uglify-js: "npm:^3.1.4"
|
||||||
|
wordwrap: "npm:^1.0.0"
|
||||||
|
dependenciesMeta:
|
||||||
|
uglify-js:
|
||||||
|
optional: true
|
||||||
|
bin:
|
||||||
|
handlebars: bin/handlebars
|
||||||
|
checksum: 10c0/7aff423ea38a14bb379316f3857fe0df3c5d66119270944247f155ba1f08e07a92b340c58edaa00cfe985c21508870ee5183e0634dcb53dd405f35c93ef7f10d
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"has-bigints@npm:^1.0.1, has-bigints@npm:^1.0.2":
|
"has-bigints@npm:^1.0.1, has-bigints@npm:^1.0.2":
|
||||||
version: 1.0.2
|
version: 1.0.2
|
||||||
resolution: "has-bigints@npm:1.0.2"
|
resolution: "has-bigints@npm:1.0.2"
|
||||||
@ -10402,6 +10610,15 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"is-docker@npm:^3.0.0":
|
||||||
|
version: 3.0.0
|
||||||
|
resolution: "is-docker@npm:3.0.0"
|
||||||
|
bin:
|
||||||
|
is-docker: cli.js
|
||||||
|
checksum: 10c0/d2c4f8e6d3e34df75a5defd44991b6068afad4835bb783b902fa12d13ebdb8f41b2a199dcb0b5ed2cb78bfee9e4c0bbdb69c2d9646f4106464674d3e697a5856
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"is-extglob@npm:^2.1.1":
|
"is-extglob@npm:^2.1.1":
|
||||||
version: 2.1.1
|
version: 2.1.1
|
||||||
resolution: "is-extglob@npm:2.1.1"
|
resolution: "is-extglob@npm:2.1.1"
|
||||||
@ -10450,6 +10667,17 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"is-inside-container@npm:^1.0.0":
|
||||||
|
version: 1.0.0
|
||||||
|
resolution: "is-inside-container@npm:1.0.0"
|
||||||
|
dependencies:
|
||||||
|
is-docker: "npm:^3.0.0"
|
||||||
|
bin:
|
||||||
|
is-inside-container: cli.js
|
||||||
|
checksum: 10c0/a8efb0e84f6197e6ff5c64c52890fa9acb49b7b74fed4da7c95383965da6f0fa592b4dbd5e38a79f87fc108196937acdbcd758fcefc9b140e479b39ce1fcd1cd
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"is-lambda@npm:^1.0.1":
|
"is-lambda@npm:^1.0.1":
|
||||||
version: 1.0.1
|
version: 1.0.1
|
||||||
resolution: "is-lambda@npm:1.0.1"
|
resolution: "is-lambda@npm:1.0.1"
|
||||||
@ -10701,6 +10929,15 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"is-wsl@npm:^3.1.0":
|
||||||
|
version: 3.1.0
|
||||||
|
resolution: "is-wsl@npm:3.1.0"
|
||||||
|
dependencies:
|
||||||
|
is-inside-container: "npm:^1.0.0"
|
||||||
|
checksum: 10c0/d3317c11995690a32c362100225e22ba793678fe8732660c6de511ae71a0ff05b06980cf21f98a6bf40d7be0e9e9506f859abe00a1118287d63e53d0a3d06947
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"isarray@npm:^2.0.5":
|
"isarray@npm:^2.0.5":
|
||||||
version: 2.0.5
|
version: 2.0.5
|
||||||
resolution: "isarray@npm:2.0.5"
|
resolution: "isarray@npm:2.0.5"
|
||||||
@ -11366,6 +11603,15 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"jiti@npm:^2.3.0":
|
||||||
|
version: 2.6.1
|
||||||
|
resolution: "jiti@npm:2.6.1"
|
||||||
|
bin:
|
||||||
|
jiti: lib/jiti-cli.mjs
|
||||||
|
checksum: 10c0/79b2e96a8e623f66c1b703b98ec1b8be4500e1d217e09b09e343471bbb9c105381b83edbb979d01cef18318cc45ce6e153571b6c83122170eefa531c64b6789b
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"js-tokens@npm:^3.0.0 || ^4.0.0, js-tokens@npm:^4.0.0":
|
"js-tokens@npm:^3.0.0 || ^4.0.0, js-tokens@npm:^4.0.0":
|
||||||
version: 4.0.0
|
version: 4.0.0
|
||||||
resolution: "js-tokens@npm:4.0.0"
|
resolution: "js-tokens@npm:4.0.0"
|
||||||
@ -11720,6 +11966,7 @@ __metadata:
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@babel/core": "npm:^7.27.4"
|
"@babel/core": "npm:^7.27.4"
|
||||||
"@eslint/js": "npm:^9.29.0"
|
"@eslint/js": "npm:^9.29.0"
|
||||||
|
"@hey-api/openapi-ts": "npm:0.80.1"
|
||||||
"@ianvs/prettier-plugin-sort-imports": "npm:^4.4.2"
|
"@ianvs/prettier-plugin-sort-imports": "npm:^4.4.2"
|
||||||
"@mantine/core": "npm:8.1.2"
|
"@mantine/core": "npm:8.1.2"
|
||||||
"@mantine/form": "npm:^8.1.3"
|
"@mantine/form": "npm:^8.1.3"
|
||||||
@ -11770,6 +12017,7 @@ __metadata:
|
|||||||
ts-jest: "npm:^29.4.0"
|
ts-jest: "npm:^29.4.0"
|
||||||
typescript: "npm:5.8.3"
|
typescript: "npm:5.8.3"
|
||||||
typescript-eslint: "npm:^8.34.0"
|
typescript-eslint: "npm:^8.34.0"
|
||||||
|
zod: "npm:^4.0.10"
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
@ -12100,7 +12348,7 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"minimist@npm:^1.2.6":
|
"minimist@npm:^1.2.5, minimist@npm:^1.2.6":
|
||||||
version: 1.2.8
|
version: 1.2.8
|
||||||
resolution: "minimist@npm:1.2.8"
|
resolution: "minimist@npm:1.2.8"
|
||||||
checksum: 10c0/19d3fcdca050087b84c2029841a093691a91259a47def2f18222f41e7645a0b7c44ef4b40e88a1e58a40c84d2ef0ee6047c55594d298146d0eb3f6b737c20ce6
|
checksum: 10c0/19d3fcdca050087b84c2029841a093691a91259a47def2f18222f41e7645a0b7c44ef4b40e88a1e58a40c84d2ef0ee6047c55594d298146d0eb3f6b737c20ce6
|
||||||
@ -12207,6 +12455,18 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"mlly@npm:^1.7.1, mlly@npm:^1.7.4":
|
||||||
|
version: 1.8.0
|
||||||
|
resolution: "mlly@npm:1.8.0"
|
||||||
|
dependencies:
|
||||||
|
acorn: "npm:^8.15.0"
|
||||||
|
pathe: "npm:^2.0.3"
|
||||||
|
pkg-types: "npm:^1.3.1"
|
||||||
|
ufo: "npm:^1.6.1"
|
||||||
|
checksum: 10c0/f174b844ae066c71e9b128046677868e2e28694f0bbeeffbe760b2a9d8ff24de0748d0fde6fabe706700c1d2e11d3c0d7a53071b5ea99671592fac03364604ab
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"motion-dom@npm:^12.23.9":
|
"motion-dom@npm:^12.23.9":
|
||||||
version: 12.23.9
|
version: 12.23.9
|
||||||
resolution: "motion-dom@npm:12.23.9"
|
resolution: "motion-dom@npm:12.23.9"
|
||||||
@ -12388,6 +12648,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"node-fetch-native@npm:^1.6.6":
|
||||||
|
version: 1.6.7
|
||||||
|
resolution: "node-fetch-native@npm:1.6.7"
|
||||||
|
checksum: 10c0/8b748300fb053d21ca4d3db9c3ff52593d5e8f8a2d9fe90cbfad159676e324b954fdaefab46aeca007b5b9edab3d150021c4846444e4e8ab1f4e44cd3807be87
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"node-gyp@npm:latest":
|
"node-gyp@npm:latest":
|
||||||
version: 10.0.1
|
version: 10.0.1
|
||||||
resolution: "node-gyp@npm:10.0.1"
|
resolution: "node-gyp@npm:10.0.1"
|
||||||
@ -12514,6 +12781,22 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"nypm@npm:^0.5.4":
|
||||||
|
version: 0.5.4
|
||||||
|
resolution: "nypm@npm:0.5.4"
|
||||||
|
dependencies:
|
||||||
|
citty: "npm:^0.1.6"
|
||||||
|
consola: "npm:^3.4.0"
|
||||||
|
pathe: "npm:^2.0.3"
|
||||||
|
pkg-types: "npm:^1.3.1"
|
||||||
|
tinyexec: "npm:^0.3.2"
|
||||||
|
ufo: "npm:^1.5.4"
|
||||||
|
bin:
|
||||||
|
nypm: dist/cli.mjs
|
||||||
|
checksum: 10c0/4b4661d2e460f4f8e96338669776dc3be4ed895bd34208ac188b5b8b438553aab737d41a5699cdc716f078fba9048b3d40b7d8a55c2544f9453536f837d323dc
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"object-assign@npm:^4.1.1":
|
"object-assign@npm:^4.1.1":
|
||||||
version: 4.1.1
|
version: 4.1.1
|
||||||
resolution: "object-assign@npm:4.1.1"
|
resolution: "object-assign@npm:4.1.1"
|
||||||
@ -12651,6 +12934,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"ohash@npm:^1.1.4":
|
||||||
|
version: 1.1.6
|
||||||
|
resolution: "ohash@npm:1.1.6"
|
||||||
|
checksum: 10c0/3c25dde77662fffa3fa956b8975d7324311e3df15d9cf8d79b466ac3508f313e02b8ed3041d967810f68e00af344a5a3c4288be0208143c1844ba0f3cc83f777
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"once@npm:^1.3.0":
|
"once@npm:^1.3.0":
|
||||||
version: 1.4.0
|
version: 1.4.0
|
||||||
resolution: "once@npm:1.4.0"
|
resolution: "once@npm:1.4.0"
|
||||||
@ -12669,6 +12959,18 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"open@npm:10.1.2":
|
||||||
|
version: 10.1.2
|
||||||
|
resolution: "open@npm:10.1.2"
|
||||||
|
dependencies:
|
||||||
|
default-browser: "npm:^5.2.1"
|
||||||
|
define-lazy-prop: "npm:^3.0.0"
|
||||||
|
is-inside-container: "npm:^1.0.0"
|
||||||
|
is-wsl: "npm:^3.1.0"
|
||||||
|
checksum: 10c0/1bee796f06e549ce764f693272100323fbc04da8fa3c5b0402d6c2d11b3d76fa0aac0be7535e710015ff035326638e3b9a563f3b0e7ac3266473ed5663caae6d
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"open@npm:^8.0.4":
|
"open@npm:^8.0.4":
|
||||||
version: 8.4.2
|
version: 8.4.2
|
||||||
resolution: "open@npm:8.4.2"
|
resolution: "open@npm:8.4.2"
|
||||||
@ -12929,6 +13231,20 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"pathe@npm:^1.1.2":
|
||||||
|
version: 1.1.2
|
||||||
|
resolution: "pathe@npm:1.1.2"
|
||||||
|
checksum: 10c0/64ee0a4e587fb0f208d9777a6c56e4f9050039268faaaaecd50e959ef01bf847b7872785c36483fa5cdcdbdfdb31fef2ff222684d4fc21c330ab60395c681897
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"pathe@npm:^2.0.1, pathe@npm:^2.0.3":
|
||||||
|
version: 2.0.3
|
||||||
|
resolution: "pathe@npm:2.0.3"
|
||||||
|
checksum: 10c0/c118dc5a8b5c4166011b2b70608762e260085180bb9e33e80a50dcdb1e78c010b1624f4280c492c92b05fc276715a4c357d1f9edc570f8f1b3d90b6839ebaca1
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"pathval@npm:^2.0.0":
|
"pathval@npm:^2.0.0":
|
||||||
version: 2.0.0
|
version: 2.0.0
|
||||||
resolution: "pathval@npm:2.0.0"
|
resolution: "pathval@npm:2.0.0"
|
||||||
@ -12949,6 +13265,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"perfect-debounce@npm:^1.0.0":
|
||||||
|
version: 1.0.0
|
||||||
|
resolution: "perfect-debounce@npm:1.0.0"
|
||||||
|
checksum: 10c0/e2baac416cae046ef1b270812cf9ccfb0f91c04ea36ac7f5b00bc84cb7f41bdbba087c0ab21b4e02a7ef3a1f1f6db399f137cecec46868bd7d8d88c2a9ee431f
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"picocolors@npm:^1.0.0":
|
"picocolors@npm:^1.0.0":
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
resolution: "picocolors@npm:1.0.0"
|
resolution: "picocolors@npm:1.0.0"
|
||||||
@ -13002,6 +13325,17 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"pkg-types@npm:^1.2.0, pkg-types@npm:^1.3.1":
|
||||||
|
version: 1.3.1
|
||||||
|
resolution: "pkg-types@npm:1.3.1"
|
||||||
|
dependencies:
|
||||||
|
confbox: "npm:^0.1.8"
|
||||||
|
mlly: "npm:^1.7.4"
|
||||||
|
pathe: "npm:^2.0.1"
|
||||||
|
checksum: 10c0/19e6cb8b66dcc66c89f2344aecfa47f2431c988cfa3366bdfdcfb1dd6695f87dcce37fbd90fe9d1605e2f4440b77f391e83c23255347c35cf84e7fd774d7fcea
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"pnp-webpack-plugin@npm:^1.7.0":
|
"pnp-webpack-plugin@npm:^1.7.0":
|
||||||
version: 1.7.0
|
version: 1.7.0
|
||||||
resolution: "pnp-webpack-plugin@npm:1.7.0"
|
resolution: "pnp-webpack-plugin@npm:1.7.0"
|
||||||
@ -13461,6 +13795,16 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"rc9@npm:^2.1.2":
|
||||||
|
version: 2.1.2
|
||||||
|
resolution: "rc9@npm:2.1.2"
|
||||||
|
dependencies:
|
||||||
|
defu: "npm:^6.1.4"
|
||||||
|
destr: "npm:^2.0.3"
|
||||||
|
checksum: 10c0/a2ead3b94bf033e35e4ea40d70062a09feddb8f589c3f5a8fe4e9342976974296aee9f6e9e72bd5e78e6ae4b7bc16dc244f63699fd7322c16314e3238db982c9
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"react-docgen-typescript@npm:^2.2.2":
|
"react-docgen-typescript@npm:^2.2.2":
|
||||||
version: 2.2.2
|
version: 2.2.2
|
||||||
resolution: "react-docgen-typescript@npm:2.2.2"
|
resolution: "react-docgen-typescript@npm:2.2.2"
|
||||||
@ -13737,6 +14081,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"readdirp@npm:^4.0.1":
|
||||||
|
version: 4.1.2
|
||||||
|
resolution: "readdirp@npm:4.1.2"
|
||||||
|
checksum: 10c0/60a14f7619dec48c9c850255cd523e2717001b0e179dc7037cfa0895da7b9e9ab07532d324bfb118d73a710887d1e35f79c495fa91582784493e085d18c72c62
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"readdirp@npm:~3.6.0":
|
"readdirp@npm:~3.6.0":
|
||||||
version: 3.6.0
|
version: 3.6.0
|
||||||
resolution: "readdirp@npm:3.6.0"
|
resolution: "readdirp@npm:3.6.0"
|
||||||
@ -14117,6 +14468,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"run-applescript@npm:^7.0.0":
|
||||||
|
version: 7.1.0
|
||||||
|
resolution: "run-applescript@npm:7.1.0"
|
||||||
|
checksum: 10c0/ab826c57c20f244b2ee807704b1ef4ba7f566aa766481ae5922aac785e2570809e297c69afcccc3593095b538a8a77d26f2b2e9a1d9dffee24e0e039502d1a03
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"run-parallel@npm:^1.1.9":
|
"run-parallel@npm:^1.1.9":
|
||||||
version: 1.2.0
|
version: 1.2.0
|
||||||
resolution: "run-parallel@npm:1.2.0"
|
resolution: "run-parallel@npm:1.2.0"
|
||||||
@ -14285,6 +14643,15 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"semver@npm:7.7.2, semver@npm:^7.7.2":
|
||||||
|
version: 7.7.2
|
||||||
|
resolution: "semver@npm:7.7.2"
|
||||||
|
bin:
|
||||||
|
semver: bin/semver.js
|
||||||
|
checksum: 10c0/aca305edfbf2383c22571cb7714f48cadc7ac95371b4b52362fb8eeffdfbc0de0669368b82b2b15978f8848f01d7114da65697e56cd8c37b0dab8c58e543f9ea
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"semver@npm:^6.0.0, semver@npm:^6.3.1":
|
"semver@npm:^6.0.0, semver@npm:^6.3.1":
|
||||||
version: 6.3.1
|
version: 6.3.1
|
||||||
resolution: "semver@npm:6.3.1"
|
resolution: "semver@npm:6.3.1"
|
||||||
@ -14323,15 +14690,6 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"semver@npm:^7.7.2":
|
|
||||||
version: 7.7.2
|
|
||||||
resolution: "semver@npm:7.7.2"
|
|
||||||
bin:
|
|
||||||
semver: bin/semver.js
|
|
||||||
checksum: 10c0/aca305edfbf2383c22571cb7714f48cadc7ac95371b4b52362fb8eeffdfbc0de0669368b82b2b15978f8848f01d7114da65697e56cd8c37b0dab8c58e543f9ea
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"serialize-javascript@npm:^6.0.1":
|
"serialize-javascript@npm:^6.0.1":
|
||||||
version: 6.0.1
|
version: 6.0.1
|
||||||
resolution: "serialize-javascript@npm:6.0.1"
|
resolution: "serialize-javascript@npm:6.0.1"
|
||||||
@ -14826,7 +15184,7 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"source-map@npm:0.6.1, source-map@npm:^0.6.0, source-map@npm:~0.6.0, source-map@npm:~0.6.1":
|
"source-map@npm:0.6.1, source-map@npm:^0.6.0, source-map@npm:^0.6.1, source-map@npm:~0.6.0, source-map@npm:~0.6.1":
|
||||||
version: 0.6.1
|
version: 0.6.1
|
||||||
resolution: "source-map@npm:0.6.1"
|
resolution: "source-map@npm:0.6.1"
|
||||||
checksum: 10c0/ab55398007c5e5532957cb0beee2368529618ac0ab372d789806f5718123cc4367d57de3904b4e6a4170eb5a0b0f41373066d02ca0735a0c4d75c7d328d3e011
|
checksum: 10c0/ab55398007c5e5532957cb0beee2368529618ac0ab372d789806f5718123cc4367d57de3904b4e6a4170eb5a0b0f41373066d02ca0735a0c4d75c7d328d3e011
|
||||||
@ -15444,6 +15802,20 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"tar@npm:^6.2.1":
|
||||||
|
version: 6.2.1
|
||||||
|
resolution: "tar@npm:6.2.1"
|
||||||
|
dependencies:
|
||||||
|
chownr: "npm:^2.0.0"
|
||||||
|
fs-minipass: "npm:^2.0.0"
|
||||||
|
minipass: "npm:^5.0.0"
|
||||||
|
minizlib: "npm:^2.1.1"
|
||||||
|
mkdirp: "npm:^1.0.3"
|
||||||
|
yallist: "npm:^4.0.0"
|
||||||
|
checksum: 10c0/a5eca3eb50bc11552d453488344e6507156b9193efd7635e98e867fab275d527af53d8866e2370cd09dfe74378a18111622ace35af6a608e5223a7d27fe99537
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"telejson@npm:^7.2.0":
|
"telejson@npm:^7.2.0":
|
||||||
version: 7.2.0
|
version: 7.2.0
|
||||||
resolution: "telejson@npm:7.2.0"
|
resolution: "telejson@npm:7.2.0"
|
||||||
@ -15523,6 +15895,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"tinyexec@npm:^0.3.2":
|
||||||
|
version: 0.3.2
|
||||||
|
resolution: "tinyexec@npm:0.3.2"
|
||||||
|
checksum: 10c0/3efbf791a911be0bf0821eab37a3445c2ba07acc1522b1fa84ae1e55f10425076f1290f680286345ed919549ad67527d07281f1c19d584df3b74326909eb1f90
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"tinyrainbow@npm:^1.2.0":
|
"tinyrainbow@npm:^1.2.0":
|
||||||
version: 1.2.0
|
version: 1.2.0
|
||||||
resolution: "tinyrainbow@npm:1.2.0"
|
resolution: "tinyrainbow@npm:1.2.0"
|
||||||
@ -15956,6 +16335,22 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"ufo@npm:^1.5.4, ufo@npm:^1.6.1":
|
||||||
|
version: 1.6.1
|
||||||
|
resolution: "ufo@npm:1.6.1"
|
||||||
|
checksum: 10c0/5a9f041e5945fba7c189d5410508cbcbefef80b253ed29aa2e1f8a2b86f4bd51af44ee18d4485e6d3468c92be9bf4a42e3a2b72dcaf27ce39ce947ec994f1e6b
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"uglify-js@npm:^3.1.4":
|
||||||
|
version: 3.19.3
|
||||||
|
resolution: "uglify-js@npm:3.19.3"
|
||||||
|
bin:
|
||||||
|
uglifyjs: bin/uglifyjs
|
||||||
|
checksum: 10c0/83b0a90eca35f778e07cad9622b80c448b6aad457c9ff8e568afed978212b42930a95f9e1be943a1ffa4258a3340fbb899f41461131c05bb1d0a9c303aed8479
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"unbox-primitive@npm:^1.0.2":
|
"unbox-primitive@npm:^1.0.2":
|
||||||
version: 1.0.2
|
version: 1.0.2
|
||||||
resolution: "unbox-primitive@npm:1.0.2"
|
resolution: "unbox-primitive@npm:1.0.2"
|
||||||
@ -16588,6 +16983,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"wordwrap@npm:^1.0.0":
|
||||||
|
version: 1.0.0
|
||||||
|
resolution: "wordwrap@npm:1.0.0"
|
||||||
|
checksum: 10c0/7ed2e44f3c33c5c3e3771134d2b0aee4314c9e49c749e37f464bf69f2bcdf0cbf9419ca638098e2717cff4875c47f56a007532f6111c3319f557a2ca91278e92
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0":
|
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0":
|
||||||
version: 7.0.0
|
version: 7.0.0
|
||||||
resolution: "wrap-ansi@npm:7.0.0"
|
resolution: "wrap-ansi@npm:7.0.0"
|
||||||
@ -16756,3 +17158,10 @@ __metadata:
|
|||||||
checksum: 10c0/856117aa15cf5103d2a2fb173f0ab4acb12b4b4d0ed3ab249fdbbf612e55d1cadfd27a6110940e24746fb0a78cf640b522cc8bca76f30a3b00b66e90cf82abe0
|
checksum: 10c0/856117aa15cf5103d2a2fb173f0ab4acb12b4b4d0ed3ab249fdbbf612e55d1cadfd27a6110940e24746fb0a78cf640b522cc8bca76f30a3b00b66e90cf82abe0
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"zod@npm:^4.0.10":
|
||||||
|
version: 4.1.12
|
||||||
|
resolution: "zod@npm:4.1.12"
|
||||||
|
checksum: 10c0/b64c1feb19e99d77075261eaf613e0b2be4dfcd3551eff65ad8b4f2a079b61e379854d066f7d447491fcf193f45babd8095551a9d47973d30b46b6d8e2c46774
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|||||||
Reference in New Issue
Block a user