dn-react-router-toolkit 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/cjs/auth-kit/apple_auth.js +60 -0
- package/dist/cjs/auth-kit/auth_service.js +204 -0
- package/dist/cjs/auth-kit/client/google_login_button.js +25 -0
- package/dist/cjs/auth-kit/client/redirect_page.js +21 -0
- package/dist/cjs/auth-kit/google_auth.js +65 -0
- package/dist/cjs/auth-kit/jwt.js +53 -0
- package/dist/cjs/auth-kit/kakao_auth.js +38 -0
- package/dist/cjs/auth-kit/repository.js +2 -0
- package/dist/cjs/auth-kit/with_auth.js +46 -0
- package/dist/cjs/cn.js +6 -0
- package/dist/cjs/components/index.js +18 -0
- package/dist/cjs/components/modal/fullscreen_container.js +64 -0
- package/dist/cjs/components/modal/hooks.js +78 -0
- package/dist/cjs/components/modal/index.js +19 -0
- package/dist/cjs/components/modal/modal.js +91 -0
- package/dist/cjs/components/styles.js +10 -0
- package/dist/cjs/date.js +31 -0
- package/dist/cjs/file-kit/cdn.js +9 -0
- package/dist/cjs/file-kit/client/drop_file_input.js +195 -0
- package/dist/cjs/file-kit/client/file_uploader.js +78 -0
- package/dist/cjs/file-kit/file_service.js +29 -0
- package/dist/cjs/file-kit/object_storage.js +50 -0
- package/dist/cjs/file-kit/repository.js +2 -0
- package/dist/cjs/file-kit/responsive_image.js +78 -0
- package/dist/cjs/http-kit/index.js +17 -0
- package/dist/cjs/http-kit/response.js +34 -0
- package/dist/cjs/index.js +20 -0
- package/dist/cjs/route/api/auth/login/[provider]/route.js +36 -0
- package/dist/cjs/route/api/auth/login/route.js +35 -0
- package/dist/cjs/route/api/auth/logout/route.js +22 -0
- package/dist/cjs/route/api/auth/refresh/route.js +23 -0
- package/dist/cjs/route/api/auth/route.js +12 -0
- package/dist/cjs/route/api/files/[fileId]/route.js +20 -0
- package/dist/cjs/route/api/files/route.js +34 -0
- package/dist/cjs/route/auth/callback/[provider]/route.js +35 -0
- package/dist/cjs/route/index.js +80 -0
- package/dist/cjs/seo-kit/index.js +19 -0
- package/dist/cjs/seo-kit/loader.js +17 -0
- package/dist/cjs/seo-kit/seo.js +286 -0
- package/dist/cjs/seo-kit/seo_loader.js +19 -0
- package/dist/cjs/singleton.js +12 -0
- package/dist/cjs/slug.js +10 -0
- package/dist/esm/auth-kit/apple_auth.d.ts +15 -0
- package/dist/esm/auth-kit/apple_auth.js +56 -0
- package/dist/esm/auth-kit/auth_service.d.ts +67 -0
- package/dist/esm/auth-kit/auth_service.js +197 -0
- package/dist/esm/auth-kit/client/google_login_button.d.ts +6 -0
- package/dist/esm/auth-kit/client/google_login_button.js +19 -0
- package/dist/esm/auth-kit/client/redirect_page.d.ts +2 -0
- package/dist/esm/auth-kit/client/redirect_page.js +15 -0
- package/dist/esm/auth-kit/google_auth.d.ts +18 -0
- package/dist/esm/auth-kit/google_auth.js +61 -0
- package/dist/esm/auth-kit/jwt.d.ts +15 -0
- package/dist/esm/auth-kit/jwt.js +49 -0
- package/dist/esm/auth-kit/kakao_auth.d.ts +15 -0
- package/dist/esm/auth-kit/kakao_auth.js +34 -0
- package/dist/esm/auth-kit/repository.d.ts +40 -0
- package/dist/esm/auth-kit/repository.js +1 -0
- package/dist/esm/auth-kit/with_auth.d.ts +12 -0
- package/dist/esm/auth-kit/with_auth.js +43 -0
- package/dist/esm/cn.d.ts +1 -0
- package/dist/esm/cn.js +3 -0
- package/dist/esm/components/index.d.ts +2 -0
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/components/modal/fullscreen_container.d.ts +5 -0
- package/dist/esm/components/modal/fullscreen_container.js +57 -0
- package/dist/esm/components/modal/hooks.d.ts +15 -0
- package/dist/esm/components/modal/hooks.js +69 -0
- package/dist/esm/components/modal/index.d.ts +3 -0
- package/dist/esm/components/modal/index.js +3 -0
- package/dist/esm/components/modal/modal.d.ts +10 -0
- package/dist/esm/components/modal/modal.js +55 -0
- package/dist/esm/components/styles.d.ts +7 -0
- package/dist/esm/components/styles.js +7 -0
- package/dist/esm/date.d.ts +1 -0
- package/dist/esm/date.js +24 -0
- package/dist/esm/file-kit/cdn.d.ts +3 -0
- package/dist/esm/file-kit/cdn.js +5 -0
- package/dist/esm/file-kit/client/drop_file_input.d.ts +31 -0
- package/dist/esm/file-kit/client/drop_file_input.js +158 -0
- package/dist/esm/file-kit/client/file_uploader.d.ts +11 -0
- package/dist/esm/file-kit/client/file_uploader.js +74 -0
- package/dist/esm/file-kit/file_service.d.ts +23 -0
- package/dist/esm/file-kit/file_service.js +25 -0
- package/dist/esm/file-kit/object_storage.d.ts +13 -0
- package/dist/esm/file-kit/object_storage.js +46 -0
- package/dist/esm/file-kit/repository.d.ts +14 -0
- package/dist/esm/file-kit/repository.js +1 -0
- package/dist/esm/file-kit/responsive_image.d.ts +17 -0
- package/dist/esm/file-kit/responsive_image.js +70 -0
- package/dist/esm/http-kit/index.d.ts +1 -0
- package/dist/esm/http-kit/index.js +1 -0
- package/dist/esm/http-kit/response.d.ts +17 -0
- package/dist/esm/http-kit/response.js +28 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/route/api/auth/login/[provider]/route.d.ts +10 -0
- package/dist/esm/route/api/auth/login/[provider]/route.js +32 -0
- package/dist/esm/route/api/auth/login/route.d.ts +6 -0
- package/dist/esm/route/api/auth/login/route.js +31 -0
- package/dist/esm/route/api/auth/logout/route.d.ts +6 -0
- package/dist/esm/route/api/auth/logout/route.js +18 -0
- package/dist/esm/route/api/auth/refresh/route.d.ts +4 -0
- package/dist/esm/route/api/auth/refresh/route.js +19 -0
- package/dist/esm/route/api/auth/route.d.ts +4 -0
- package/dist/esm/route/api/auth/route.js +8 -0
- package/dist/esm/route/api/files/[fileId]/route.d.ts +8 -0
- package/dist/esm/route/api/files/[fileId]/route.js +16 -0
- package/dist/esm/route/api/files/route.d.ts +6 -0
- package/dist/esm/route/api/files/route.js +30 -0
- package/dist/esm/route/auth/callback/[provider]/route.d.ts +11 -0
- package/dist/esm/route/auth/callback/[provider]/route.js +31 -0
- package/dist/esm/route/index.d.ts +22 -0
- package/dist/esm/route/index.js +76 -0
- package/dist/esm/seo-kit/index.d.ts +3 -0
- package/dist/esm/seo-kit/index.js +3 -0
- package/dist/esm/seo-kit/loader.d.ts +5 -0
- package/dist/esm/seo-kit/loader.js +14 -0
- package/dist/esm/seo-kit/seo.d.ts +100 -0
- package/dist/esm/seo-kit/seo.js +280 -0
- package/dist/esm/seo-kit/seo_loader.d.ts +12 -0
- package/dist/esm/seo-kit/seo_loader.js +13 -0
- package/dist/esm/singleton.d.ts +1 -0
- package/dist/esm/singleton.js +9 -0
- package/dist/esm/slug.d.ts +1 -0
- package/dist/esm/slug.js +6 -0
- package/package.json +81 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NO_CONTENT, UNAUTHORIZED } from "../../../../http-kit";
|
|
2
|
+
export const logoutHandler = async (request, { AUTH, repository }) => {
|
|
3
|
+
const auth = await AUTH.verifyOrRefresh(request);
|
|
4
|
+
if (!auth) {
|
|
5
|
+
return UNAUTHORIZED();
|
|
6
|
+
}
|
|
7
|
+
await repository.updateUserRefreshToken(auth.userId, null);
|
|
8
|
+
const headers = new Headers();
|
|
9
|
+
const [accessTokenSetCookie, refreshTokenSetCookie] = await Promise.all([
|
|
10
|
+
AUTH.getAccessTokenSetCookie(null),
|
|
11
|
+
AUTH.getRefreshTokenSetCookie(null),
|
|
12
|
+
]);
|
|
13
|
+
headers.append("Set-Cookie", accessTokenSetCookie);
|
|
14
|
+
headers.append("Set-Cookie", refreshTokenSetCookie);
|
|
15
|
+
return NO_CONTENT({
|
|
16
|
+
headers,
|
|
17
|
+
});
|
|
18
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BAD_REQUEST, CREATED, UNAUTHORIZED } from "../../../../http-kit";
|
|
2
|
+
export const authRefreshHandler = async (request, { AUTH, }) => {
|
|
3
|
+
var _a;
|
|
4
|
+
const refreshToken = ((_a = request === null || request === void 0 ? void 0 : request.headers.get("Authorization")) === null || _a === void 0 ? void 0 : _a.replace("Bearer ", "")) ||
|
|
5
|
+
(await AUTH.getRefreshTokenFromCookies(request));
|
|
6
|
+
if (!refreshToken) {
|
|
7
|
+
return BAD_REQUEST();
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
const accessToken = await AUTH.refreshAccessToken(refreshToken);
|
|
11
|
+
return CREATED({ accessToken });
|
|
12
|
+
}
|
|
13
|
+
catch (e) {
|
|
14
|
+
if (e instanceof Error) {
|
|
15
|
+
return UNAUTHORIZED(e.message);
|
|
16
|
+
}
|
|
17
|
+
throw e;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AuthService } from "../../../../auth-kit/auth_service";
|
|
2
|
+
import { type FileRepository } from "../../../../file-kit/repository";
|
|
3
|
+
export declare const fileDeleteHandler: <TFile>(request: Request, { fileId }: {
|
|
4
|
+
fileId: string;
|
|
5
|
+
}, { AUTH, repository, }: {
|
|
6
|
+
AUTH: AuthService;
|
|
7
|
+
repository: FileRepository<TFile>;
|
|
8
|
+
}) => Promise<Response>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FORBIDDEN, NO_CONTENT, NOT_FOUND } from "../../../../http-kit";
|
|
2
|
+
export const fileDeleteHandler = async (request, { fileId }, { AUTH, repository, }) => {
|
|
3
|
+
const auth = await AUTH.verifyOrRefresh(request);
|
|
4
|
+
const file = await repository.findFileById(fileId);
|
|
5
|
+
const headers = {
|
|
6
|
+
"Access-Control-Allow-Origin": "*",
|
|
7
|
+
};
|
|
8
|
+
if (!file) {
|
|
9
|
+
return NOT_FOUND("파일을 찾을 수 없습니다.", { headers });
|
|
10
|
+
}
|
|
11
|
+
if (!repository.hasPermission(file, auth === null || auth === void 0 ? void 0 : auth.userId)) {
|
|
12
|
+
return FORBIDDEN("파일을 삭제할 권한이 없습니다.", { headers });
|
|
13
|
+
}
|
|
14
|
+
await repository.deleteFile(fileId);
|
|
15
|
+
return NO_CONTENT({ headers });
|
|
16
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AuthService } from "../../../auth-kit/auth_service";
|
|
2
|
+
import { FileService } from "../../../file-kit/file_service";
|
|
3
|
+
export declare const fileUploadHandler: <TFile>(request: Request, { AUTH, FILE_SERVICE, }: {
|
|
4
|
+
AUTH: AuthService;
|
|
5
|
+
FILE_SERVICE: FileService<TFile>;
|
|
6
|
+
}) => Promise<Response>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BAD_REQUEST, CREATED, INTERNAL_SERVER_ERROR } from "../../../http-kit";
|
|
2
|
+
export const fileUploadHandler = async (request, { AUTH, FILE_SERVICE, }) => {
|
|
3
|
+
const auth = await AUTH.verifyOrRefresh(request);
|
|
4
|
+
const { name, type, size, metadata } = await request.json();
|
|
5
|
+
const headers = {
|
|
6
|
+
"Access-Control-Allow-Origin": "*",
|
|
7
|
+
};
|
|
8
|
+
if (typeof name !== "string") {
|
|
9
|
+
return BAD_REQUEST("파일 이름이 필요해요.", { headers });
|
|
10
|
+
}
|
|
11
|
+
if (typeof type !== "string") {
|
|
12
|
+
return BAD_REQUEST("파일 타입이 필요해요.", { headers });
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
const result = await FILE_SERVICE.generateSignedUrl({
|
|
16
|
+
userId: auth === null || auth === void 0 ? void 0 : auth.userId,
|
|
17
|
+
name,
|
|
18
|
+
type,
|
|
19
|
+
size,
|
|
20
|
+
metadata,
|
|
21
|
+
});
|
|
22
|
+
return CREATED(result, { headers });
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
25
|
+
if (e instanceof Error) {
|
|
26
|
+
return INTERNAL_SERVER_ERROR(e.message, { headers });
|
|
27
|
+
}
|
|
28
|
+
return INTERNAL_SERVER_ERROR(e, { headers });
|
|
29
|
+
}
|
|
30
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AuthService } from "../../../../auth-kit/auth_service";
|
|
2
|
+
import { GoogleAuth } from "../../../../auth-kit/google_auth";
|
|
3
|
+
import { AppleAuth } from "../../../../auth-kit/apple_auth";
|
|
4
|
+
export declare const thirdPartyAuthCallbackHandler: (request: Request, { provider, }: {
|
|
5
|
+
provider: string;
|
|
6
|
+
}, { AUTH, GOOGLE_AUTH, APPLE_AUTH, SITE_ORIGIN, }: {
|
|
7
|
+
AUTH: AuthService;
|
|
8
|
+
GOOGLE_AUTH: GoogleAuth;
|
|
9
|
+
APPLE_AUTH: AppleAuth;
|
|
10
|
+
SITE_ORIGIN: string;
|
|
11
|
+
}) => Promise<Response>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BAD_REQUEST } from "../../../../http-kit";
|
|
2
|
+
export const thirdPartyAuthCallbackHandler = async (request, { provider, }, { AUTH, GOOGLE_AUTH, APPLE_AUTH, SITE_ORIGIN, }) => {
|
|
3
|
+
const url = new URL(request.url);
|
|
4
|
+
const code = url.searchParams.get("code");
|
|
5
|
+
if (!code) {
|
|
6
|
+
throw BAD_REQUEST("코드가 없습니다.");
|
|
7
|
+
}
|
|
8
|
+
const getThirdPartyAuth = (provider) => {
|
|
9
|
+
switch (provider) {
|
|
10
|
+
case "google":
|
|
11
|
+
return GOOGLE_AUTH;
|
|
12
|
+
case "apple":
|
|
13
|
+
return APPLE_AUTH;
|
|
14
|
+
default:
|
|
15
|
+
throw BAD_REQUEST("지원하지 않는 인증 제공자입니다.");
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const { accessToken, refreshToken } = await getThirdPartyAuth(provider).signIn(code);
|
|
19
|
+
const [accessTokenSetCookie, refreshTokenSetCookie] = await Promise.all([
|
|
20
|
+
AUTH.getAccessTokenSetCookie(accessToken),
|
|
21
|
+
AUTH.getRefreshTokenSetCookie(refreshToken),
|
|
22
|
+
]);
|
|
23
|
+
const headers = new Headers();
|
|
24
|
+
headers.append("Set-Cookie", accessTokenSetCookie);
|
|
25
|
+
headers.append("Set-Cookie", refreshTokenSetCookie);
|
|
26
|
+
const redirectUrl = url.searchParams.get("state") || SITE_ORIGIN;
|
|
27
|
+
return new Response("Temporary Redirect", {
|
|
28
|
+
status: 307,
|
|
29
|
+
headers: Object.assign(Object.assign({}, headers), { Location: new URL(`/r?redirectUrl=${encodeURIComponent(redirectUrl)}`, request.url).toString() }),
|
|
30
|
+
});
|
|
31
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AuthService } from "../auth-kit/auth_service";
|
|
2
|
+
import { GoogleAuth } from "../auth-kit/google_auth";
|
|
3
|
+
import { AppleAuth } from "../auth-kit/apple_auth";
|
|
4
|
+
import { type FileRepository } from "../file-kit/repository";
|
|
5
|
+
import { FileService } from "../file-kit/file_service";
|
|
6
|
+
import { JWTManager } from "../auth-kit/jwt";
|
|
7
|
+
import { type AuthRepository } from "../auth-kit/repository";
|
|
8
|
+
import { KakaoAuth } from "../auth-kit/kakao_auth";
|
|
9
|
+
export declare const createAuthAPIHandler: <TFile>({ AUTH, GOOGLE_AUTH, APPLE_AUTH, KAKAO_AUTH, JWT_MANAGER, FILE_SERVICE, SITE_ORIGIN, authRepository, fileRepository, }: {
|
|
10
|
+
SITE_ORIGIN: string;
|
|
11
|
+
JWT_MANAGER: JWTManager;
|
|
12
|
+
AUTH: AuthService;
|
|
13
|
+
GOOGLE_AUTH: GoogleAuth;
|
|
14
|
+
APPLE_AUTH: AppleAuth;
|
|
15
|
+
KAKAO_AUTH: KakaoAuth;
|
|
16
|
+
FILE_SERVICE: FileService<TFile>;
|
|
17
|
+
authRepository: AuthRepository;
|
|
18
|
+
fileRepository: FileRepository<TFile>;
|
|
19
|
+
}) => ({ request, params, }: {
|
|
20
|
+
request: Request;
|
|
21
|
+
params: any;
|
|
22
|
+
}) => Promise<Response>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { thirdPartyAuthCallbackHandler } from "./auth/callback/[provider]/route";
|
|
2
|
+
import { fileUploadHandler } from "./api/files/route";
|
|
3
|
+
import { fileDeleteHandler } from "./api/files/[fileId]/route";
|
|
4
|
+
import { getAuthHandler } from "./api/auth/route";
|
|
5
|
+
import { loginThirdPartyHandler } from "./api/auth/login/[provider]/route";
|
|
6
|
+
import { loginCredentialHandler } from "./api/auth/login/route";
|
|
7
|
+
import { logoutHandler } from "./api/auth/logout/route";
|
|
8
|
+
import { authRefreshHandler } from "./api/auth/refresh/route";
|
|
9
|
+
export const createAuthAPIHandler = ({ AUTH, GOOGLE_AUTH, APPLE_AUTH, KAKAO_AUTH, JWT_MANAGER, FILE_SERVICE, SITE_ORIGIN, authRepository, fileRepository, }) => {
|
|
10
|
+
const handler = async ({ request, params, }) => {
|
|
11
|
+
const method = request.method.toUpperCase();
|
|
12
|
+
const slug = params["*"].split("/");
|
|
13
|
+
if (slug[0] === "auth") {
|
|
14
|
+
if (!slug[1]) {
|
|
15
|
+
if (method === "GET") {
|
|
16
|
+
return getAuthHandler(request, { AUTH });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (slug[1] === "login") {
|
|
20
|
+
if (slug[2]) {
|
|
21
|
+
const provider = slug[2];
|
|
22
|
+
if (method === "POST") {
|
|
23
|
+
return loginThirdPartyHandler(request, { provider }, { GOOGLE_AUTH, KAKAO_AUTH, APPLE_AUTH });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (method === "POST") {
|
|
27
|
+
return loginCredentialHandler(request, {
|
|
28
|
+
AUTH,
|
|
29
|
+
JWT_MANAGER,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (slug[1] === "logout") {
|
|
34
|
+
if (method === "POST") {
|
|
35
|
+
return logoutHandler(request, {
|
|
36
|
+
AUTH,
|
|
37
|
+
repository: authRepository,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (slug[1] === "refresh") {
|
|
42
|
+
if (method === "GET") {
|
|
43
|
+
return authRefreshHandler(request, { AUTH });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (slug[1] === "callback") {
|
|
47
|
+
if (slug[2]) {
|
|
48
|
+
const provider = slug[2];
|
|
49
|
+
if (method === "GET") {
|
|
50
|
+
return thirdPartyAuthCallbackHandler(request, { provider }, {
|
|
51
|
+
AUTH,
|
|
52
|
+
GOOGLE_AUTH,
|
|
53
|
+
APPLE_AUTH,
|
|
54
|
+
SITE_ORIGIN,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (slug[0] === "files") {
|
|
61
|
+
if (!slug[1]) {
|
|
62
|
+
if (method === "POST") {
|
|
63
|
+
return fileUploadHandler(request, { AUTH, FILE_SERVICE });
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (slug[1]) {
|
|
67
|
+
if (method === "DELETE") {
|
|
68
|
+
const fileId = slug[1];
|
|
69
|
+
return fileDeleteHandler(request, { fileId }, { AUTH, repository: fileRepository });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return new Response("Not Found", { status: 404 });
|
|
74
|
+
};
|
|
75
|
+
return handler;
|
|
76
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function createLoader(fn = () => ({})) {
|
|
2
|
+
let loadedData;
|
|
3
|
+
return {
|
|
4
|
+
getData() {
|
|
5
|
+
return loadedData;
|
|
6
|
+
},
|
|
7
|
+
wrap(mapper) {
|
|
8
|
+
return async function Thing(props) {
|
|
9
|
+
loadedData = await fn(props);
|
|
10
|
+
return mapper(loadedData);
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import * as Schema from "schema-dts";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { MetaFunction } from "react-router";
|
|
4
|
+
export type SEOImage = {
|
|
5
|
+
id?: string;
|
|
6
|
+
url: string;
|
|
7
|
+
alt?: string;
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
10
|
+
};
|
|
11
|
+
export type SEO = Awaited<ReturnType<ReturnType<typeof configSEO>["init"]>>;
|
|
12
|
+
export declare function configSEO(config: {
|
|
13
|
+
origin: string;
|
|
14
|
+
siteName: string;
|
|
15
|
+
description: string;
|
|
16
|
+
keywords?: string[];
|
|
17
|
+
thumbnail?: SEOImage | (() => SEOImage | null | Promise<SEOImage | null>);
|
|
18
|
+
structedData?: Schema.Thing[] | (() => Schema.Thing[] | Promise<Schema.Thing[]>);
|
|
19
|
+
copyright?: string;
|
|
20
|
+
}): {
|
|
21
|
+
config: {
|
|
22
|
+
origin: string;
|
|
23
|
+
siteName: string;
|
|
24
|
+
description: string;
|
|
25
|
+
keywords?: string[];
|
|
26
|
+
thumbnail?: SEOImage | (() => SEOImage | null | Promise<SEOImage | null>);
|
|
27
|
+
structedData?: Schema.Thing[] | (() => Schema.Thing[] | Promise<Schema.Thing[]>);
|
|
28
|
+
copyright?: string;
|
|
29
|
+
};
|
|
30
|
+
init(props?: {
|
|
31
|
+
title?: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
keywords?: string[];
|
|
34
|
+
path?: string;
|
|
35
|
+
type?: string;
|
|
36
|
+
canonicalPath?: string;
|
|
37
|
+
breadcrumbs?: {
|
|
38
|
+
label: string;
|
|
39
|
+
href: string;
|
|
40
|
+
}[];
|
|
41
|
+
thumbnail?: SEOImage;
|
|
42
|
+
images?: SEOImage[];
|
|
43
|
+
updatedAt?: Date;
|
|
44
|
+
createdAt?: Date;
|
|
45
|
+
structedData?: Schema.Thing[] | (() => Schema.Thing[] | Promise<Schema.Thing[]>);
|
|
46
|
+
article?: boolean;
|
|
47
|
+
blogPosting?: boolean;
|
|
48
|
+
creativeWork?: boolean;
|
|
49
|
+
visualArtwork?: boolean;
|
|
50
|
+
collection?: {
|
|
51
|
+
title: string;
|
|
52
|
+
url: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
thumbnail?: SEOImage;
|
|
55
|
+
updatedAt?: Date;
|
|
56
|
+
createdAt?: Date;
|
|
57
|
+
}[];
|
|
58
|
+
}): Promise<{
|
|
59
|
+
config: {
|
|
60
|
+
origin: string;
|
|
61
|
+
siteName: string;
|
|
62
|
+
description: string;
|
|
63
|
+
keywords?: string[];
|
|
64
|
+
thumbnail?: SEOImage | (() => SEOImage | null | Promise<SEOImage | null>);
|
|
65
|
+
structedData?: Schema.Thing[] | (() => Schema.Thing[] | Promise<Schema.Thing[]>);
|
|
66
|
+
copyright?: string;
|
|
67
|
+
};
|
|
68
|
+
props: {
|
|
69
|
+
title?: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
keywords?: string[];
|
|
72
|
+
path?: string;
|
|
73
|
+
type?: string;
|
|
74
|
+
canonicalPath?: string;
|
|
75
|
+
breadcrumbs?: {
|
|
76
|
+
label: string;
|
|
77
|
+
href: string;
|
|
78
|
+
}[];
|
|
79
|
+
thumbnail?: SEOImage;
|
|
80
|
+
images?: SEOImage[];
|
|
81
|
+
updatedAt?: Date;
|
|
82
|
+
createdAt?: Date;
|
|
83
|
+
structedData?: Schema.Thing[] | (() => Schema.Thing[] | Promise<Schema.Thing[]>);
|
|
84
|
+
article?: boolean;
|
|
85
|
+
blogPosting?: boolean;
|
|
86
|
+
creativeWork?: boolean;
|
|
87
|
+
visualArtwork?: boolean;
|
|
88
|
+
collection?: {
|
|
89
|
+
title: string;
|
|
90
|
+
url: string;
|
|
91
|
+
description?: string;
|
|
92
|
+
thumbnail?: SEOImage;
|
|
93
|
+
updatedAt?: Date;
|
|
94
|
+
createdAt?: Date;
|
|
95
|
+
}[];
|
|
96
|
+
};
|
|
97
|
+
meta: MetaFunction<unknown, Record<string, unknown>>;
|
|
98
|
+
generateJSONLD: () => React.JSX.Element;
|
|
99
|
+
}>;
|
|
100
|
+
};
|