@ya-accelerators/nextjs-framework 0.0.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/@types/general.d.ts +1 -0
- package/@types/image.d.ts +8 -0
- package/@types/next-auth.d.ts +18 -0
- package/dist/env.client.d.ts +3 -0
- package/dist/env.client.js +9 -0
- package/dist/env.client.js.map +1 -0
- package/dist/env.d.ts +6 -0
- package/dist/env.js +18 -0
- package/dist/env.js.map +1 -0
- package/dist/hooks/date/index.d.ts +11 -0
- package/dist/hooks/date/index.js +14 -0
- package/dist/hooks/date/index.js.map +1 -0
- package/dist/hooks/dispatch/index.d.ts +9 -0
- package/dist/hooks/dispatch/index.jsx +25 -0
- package/dist/hooks/dispatch/index.jsx.map +1 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/loading/index.d.ts +10 -0
- package/dist/hooks/loading/index.jsx +22 -0
- package/dist/hooks/loading/index.jsx.map +1 -0
- package/dist/hooks/localStorage/index.d.ts +1 -0
- package/dist/hooks/localStorage/index.js +53 -0
- package/dist/hooks/localStorage/index.js.map +1 -0
- package/dist/hooks/modal/index.d.ts +26 -0
- package/dist/hooks/modal/index.jsx +63 -0
- package/dist/hooks/modal/index.jsx.map +1 -0
- package/dist/hooks/toast/index.d.ts +15 -0
- package/dist/hooks/toast/index.jsx +39 -0
- package/dist/hooks/toast/index.jsx.map +1 -0
- package/dist/i18n/index.d.ts +3 -0
- package/dist/i18n/index.js +40 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/strings/en-US.json +18 -0
- package/dist/i18n/strings/ja-JP.json +37 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cookie/index.d.ts +9 -0
- package/dist/lib/cookie/index.js +66 -0
- package/dist/lib/cookie/index.js.map +1 -0
- package/dist/lib/index.d.ts +10 -0
- package/dist/lib/index.js +11 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/next-auth/index.d.ts +2 -0
- package/dist/lib/next-auth/index.js +62 -0
- package/dist/lib/next-auth/index.js.map +1 -0
- package/dist/lib/s3/index.d.ts +2 -0
- package/dist/lib/s3/index.js +17 -0
- package/dist/lib/s3/index.js.map +1 -0
- package/dist/lib/trpc/index.d.ts +8 -0
- package/dist/lib/trpc/index.js +32 -0
- package/dist/lib/trpc/index.js.map +1 -0
- package/dist/styles/globals.css +26 -0
- package/dist/styles/tailwind.config.d.ts +577 -0
- package/dist/styles/tailwind.config.js +671 -0
- package/dist/styles/tailwind.config.js.map +1 -0
- package/dist/styles/tailwind.config.ts +672 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/ui/component/button/base.d.ts +27 -0
- package/dist/ui/component/button/base.jsx +54 -0
- package/dist/ui/component/button/base.jsx.map +1 -0
- package/dist/ui/component/button/colored/index.d.ts +11 -0
- package/dist/ui/component/button/colored/index.jsx +7 -0
- package/dist/ui/component/button/colored/index.jsx.map +1 -0
- package/dist/ui/component/button/image/index.d.ts +4 -0
- package/dist/ui/component/button/image/index.jsx +5 -0
- package/dist/ui/component/button/image/index.jsx.map +1 -0
- package/dist/ui/component/button/index.d.ts +18 -0
- package/dist/ui/component/button/index.jsx +25 -0
- package/dist/ui/component/button/index.jsx.map +1 -0
- package/dist/ui/component/button/text/index.d.ts +11 -0
- package/dist/ui/component/button/text/index.jsx +8 -0
- package/dist/ui/component/button/text/index.jsx.map +1 -0
- package/dist/ui/component/card/index.d.ts +12 -0
- package/dist/ui/component/card/index.jsx +20 -0
- package/dist/ui/component/card/index.jsx.map +1 -0
- package/dist/ui/component/icon/index.d.ts +7 -0
- package/dist/ui/component/icon/index.jsx +3 -0
- package/dist/ui/component/icon/index.jsx.map +1 -0
- package/dist/ui/component/index.d.ts +95 -0
- package/dist/ui/component/index.js +15 -0
- package/dist/ui/component/index.js.map +1 -0
- package/dist/ui/component/loading/index.d.ts +5 -0
- package/dist/ui/component/loading/index.jsx +27 -0
- package/dist/ui/component/loading/index.jsx.map +1 -0
- package/dist/ui/component/ssr/index.d.ts +5 -0
- package/dist/ui/component/ssr/index.jsx +11 -0
- package/dist/ui/component/ssr/index.jsx.map +1 -0
- package/dist/ui/component/typography/H1/index.d.ts +7 -0
- package/dist/ui/component/typography/H1/index.jsx +13 -0
- package/dist/ui/component/typography/H1/index.jsx.map +1 -0
- package/dist/ui/component/typography/H2/index.d.ts +7 -0
- package/dist/ui/component/typography/H2/index.jsx +13 -0
- package/dist/ui/component/typography/H2/index.jsx.map +1 -0
- package/dist/ui/component/typography/H3/index.d.ts +7 -0
- package/dist/ui/component/typography/H3/index.jsx +13 -0
- package/dist/ui/component/typography/H3/index.jsx.map +1 -0
- package/dist/ui/component/typography/H4/index.d.ts +7 -0
- package/dist/ui/component/typography/H4/index.jsx +13 -0
- package/dist/ui/component/typography/H4/index.jsx.map +1 -0
- package/dist/ui/component/typography/H5/index.d.ts +7 -0
- package/dist/ui/component/typography/H5/index.jsx +13 -0
- package/dist/ui/component/typography/H5/index.jsx.map +1 -0
- package/dist/ui/component/typography/H6/index.d.ts +7 -0
- package/dist/ui/component/typography/H6/index.jsx +13 -0
- package/dist/ui/component/typography/H6/index.jsx.map +1 -0
- package/dist/ui/component/typography/Label/index.d.ts +7 -0
- package/dist/ui/component/typography/Label/index.jsx +13 -0
- package/dist/ui/component/typography/Label/index.jsx.map +1 -0
- package/dist/ui/component/typography/LinkText/index.d.ts +8 -0
- package/dist/ui/component/typography/LinkText/index.jsx +14 -0
- package/dist/ui/component/typography/LinkText/index.jsx.map +1 -0
- package/dist/ui/component/typography/P/index.d.ts +7 -0
- package/dist/ui/component/typography/P/index.jsx +13 -0
- package/dist/ui/component/typography/P/index.jsx.map +1 -0
- package/dist/ui/component/typography/Pre/index.d.ts +7 -0
- package/dist/ui/component/typography/Pre/index.jsx +13 -0
- package/dist/ui/component/typography/Pre/index.jsx.map +1 -0
- package/dist/ui/component/typography/index.d.ts +54 -0
- package/dist/ui/component/typography/index.jsx +23 -0
- package/dist/ui/component/typography/index.jsx.map +1 -0
- package/dist/ui/composite/button/index.d.ts +8 -0
- package/dist/ui/composite/button/index.jsx +45 -0
- package/dist/ui/composite/button/index.jsx.map +1 -0
- package/dist/ui/composite/dropdown/index.d.ts +12 -0
- package/dist/ui/composite/dropdown/index.jsx +102 -0
- package/dist/ui/composite/dropdown/index.jsx.map +1 -0
- package/dist/ui/composite/index.d.ts +342 -0
- package/dist/ui/composite/index.js +13 -0
- package/dist/ui/composite/index.js.map +1 -0
- package/dist/ui/composite/input/address/index.d.ts +33 -0
- package/dist/ui/composite/input/address/index.jsx +132 -0
- package/dist/ui/composite/input/address/index.jsx.map +1 -0
- package/dist/ui/composite/input/address/map.d.ts +64 -0
- package/dist/ui/composite/input/address/map.jsx +111 -0
- package/dist/ui/composite/input/address/map.jsx.map +1 -0
- package/dist/ui/composite/input/address/utils.d.ts +23 -0
- package/dist/ui/composite/input/address/utils.js +63 -0
- package/dist/ui/composite/input/address/utils.js.map +1 -0
- package/dist/ui/composite/input/checkbox/index.d.ts +22 -0
- package/dist/ui/composite/input/checkbox/index.jsx +38 -0
- package/dist/ui/composite/input/checkbox/index.jsx.map +1 -0
- package/dist/ui/composite/input/datePicker/index.d.ts +19 -0
- package/dist/ui/composite/input/datePicker/index.jsx +100 -0
- package/dist/ui/composite/input/datePicker/index.jsx.map +1 -0
- package/dist/ui/composite/input/dateRange/index.d.ts +14 -0
- package/dist/ui/composite/input/dateRange/index.jsx +46 -0
- package/dist/ui/composite/input/dateRange/index.jsx.map +1 -0
- package/dist/ui/composite/input/dateTimePicker/index.d.ts +15 -0
- package/dist/ui/composite/input/dateTimePicker/index.jsx +74 -0
- package/dist/ui/composite/input/dateTimePicker/index.jsx.map +1 -0
- package/dist/ui/composite/input/dateTimeRange/index.d.ts +14 -0
- package/dist/ui/composite/input/dateTimeRange/index.jsx +88 -0
- package/dist/ui/composite/input/dateTimeRange/index.jsx.map +1 -0
- package/dist/ui/composite/input/index.d.ts +216 -0
- package/dist/ui/composite/input/index.js +35 -0
- package/dist/ui/composite/input/index.js.map +1 -0
- package/dist/ui/composite/input/list/index.d.ts +20 -0
- package/dist/ui/composite/input/list/index.jsx +30 -0
- package/dist/ui/composite/input/list/index.jsx.map +1 -0
- package/dist/ui/composite/input/radio/index.d.ts +14 -0
- package/dist/ui/composite/input/radio/index.jsx +34 -0
- package/dist/ui/composite/input/radio/index.jsx.map +1 -0
- package/dist/ui/composite/input/search/index.d.ts +5 -0
- package/dist/ui/composite/input/search/index.jsx +38 -0
- package/dist/ui/composite/input/search/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/ClearIndicator/index.d.ts +4 -0
- package/dist/ui/composite/input/select/ClearIndicator/index.jsx +8 -0
- package/dist/ui/composite/input/select/ClearIndicator/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/Control/index.d.ts +4 -0
- package/dist/ui/composite/input/select/Control/index.jsx +23 -0
- package/dist/ui/composite/input/select/Control/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/DropdownIndicator/index.d.ts +4 -0
- package/dist/ui/composite/input/select/DropdownIndicator/index.jsx +8 -0
- package/dist/ui/composite/input/select/DropdownIndicator/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/GroupHeading/index.d.ts +4 -0
- package/dist/ui/composite/input/select/GroupHeading/index.jsx +9 -0
- package/dist/ui/composite/input/select/GroupHeading/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/Input/index.d.ts +4 -0
- package/dist/ui/composite/input/select/Input/index.jsx +7 -0
- package/dist/ui/composite/input/select/Input/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/Menu/index.d.ts +4 -0
- package/dist/ui/composite/input/select/Menu/index.jsx +19 -0
- package/dist/ui/composite/input/select/Menu/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/MultiValue/index.d.ts +4 -0
- package/dist/ui/composite/input/select/MultiValue/index.jsx +15 -0
- package/dist/ui/composite/input/select/MultiValue/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/Option/index.d.ts +4 -0
- package/dist/ui/composite/input/select/Option/index.jsx +79 -0
- package/dist/ui/composite/input/select/Option/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/Placeholder/index.d.ts +4 -0
- package/dist/ui/composite/input/select/Placeholder/index.jsx +7 -0
- package/dist/ui/composite/input/select/Placeholder/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/SelectContainer/index.d.ts +4 -0
- package/dist/ui/composite/input/select/SelectContainer/index.jsx +40 -0
- package/dist/ui/composite/input/select/SelectContainer/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/SingleValue/index.d.ts +4 -0
- package/dist/ui/composite/input/select/SingleValue/index.jsx +17 -0
- package/dist/ui/composite/input/select/SingleValue/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/index.d.ts +37 -0
- package/dist/ui/composite/input/select/index.jsx +242 -0
- package/dist/ui/composite/input/select/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/types.d.ts +16 -0
- package/dist/ui/composite/input/select/types.js +6 -0
- package/dist/ui/composite/input/select/types.js.map +1 -0
- package/dist/ui/composite/input/text/index.d.ts +15 -0
- package/dist/ui/composite/input/text/index.jsx +40 -0
- package/dist/ui/composite/input/text/index.jsx.map +1 -0
- package/dist/ui/composite/input/textarea/index.d.ts +11 -0
- package/dist/ui/composite/input/textarea/index.jsx +62 -0
- package/dist/ui/composite/input/textarea/index.jsx.map +1 -0
- package/dist/ui/composite/input/timePicker/index.d.ts +13 -0
- package/dist/ui/composite/input/timePicker/index.jsx +36 -0
- package/dist/ui/composite/input/timePicker/index.jsx.map +1 -0
- package/dist/ui/composite/input/timeRange/index.d.ts +16 -0
- package/dist/ui/composite/input/timeRange/index.jsx +54 -0
- package/dist/ui/composite/input/timeRange/index.jsx.map +1 -0
- package/dist/ui/composite/input/weekDaysSelector/index.d.ts +11 -0
- package/dist/ui/composite/input/weekDaysSelector/index.jsx +39 -0
- package/dist/ui/composite/input/weekDaysSelector/index.jsx.map +1 -0
- package/dist/ui/composite/input/weekdayPicker/index.d.ts +13 -0
- package/dist/ui/composite/input/weekdayPicker/index.jsx +49 -0
- package/dist/ui/composite/input/weekdayPicker/index.jsx.map +1 -0
- package/dist/ui/composite/label/index.d.ts +11 -0
- package/dist/ui/composite/label/index.jsx +18 -0
- package/dist/ui/composite/label/index.jsx.map +1 -0
- package/dist/ui/composite/pageTitle/index.d.ts +18 -0
- package/dist/ui/composite/pageTitle/index.jsx +62 -0
- package/dist/ui/composite/pageTitle/index.jsx.map +1 -0
- package/dist/ui/functional/index.d.ts +10 -0
- package/dist/ui/functional/index.js +9 -0
- package/dist/ui/functional/index.js.map +1 -0
- package/dist/ui/functional/notFound/index.d.ts +1 -0
- package/dist/ui/functional/notFound/index.jsx +13 -0
- package/dist/ui/functional/notFound/index.jsx.map +1 -0
- package/dist/ui/functional/signInForm/index.d.ts +4 -0
- package/dist/ui/functional/signInForm/index.jsx +45 -0
- package/dist/ui/functional/signInForm/index.jsx.map +1 -0
- package/dist/ui/functional/signOutForm/index.d.ts +3 -0
- package/dist/ui/functional/signOutForm/index.jsx +29 -0
- package/dist/ui/functional/signOutForm/index.jsx.map +1 -0
- package/dist/ui/index.d.ts +6 -0
- package/dist/ui/index.js +7 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/layout/app/component.d.ts +59 -0
- package/dist/ui/layout/app/component.jsx +224 -0
- package/dist/ui/layout/app/component.jsx.map +1 -0
- package/dist/ui/layout/app/content/index.d.ts +9 -0
- package/dist/ui/layout/app/content/index.jsx +18 -0
- package/dist/ui/layout/app/content/index.jsx.map +1 -0
- package/dist/ui/layout/app/index.d.ts +18 -0
- package/dist/ui/layout/app/index.jsx +40 -0
- package/dist/ui/layout/app/index.jsx.map +1 -0
- package/dist/ui/layout/form/index.d.ts +68 -0
- package/dist/ui/layout/form/index.jsx +558 -0
- package/dist/ui/layout/form/index.jsx.map +1 -0
- package/dist/ui/layout/index.d.ts +356 -0
- package/dist/ui/layout/index.js +19 -0
- package/dist/ui/layout/index.js.map +1 -0
- package/dist/ui/layout/modal/index.d.ts +7 -0
- package/dist/ui/layout/modal/index.jsx +11 -0
- package/dist/ui/layout/modal/index.jsx.map +1 -0
- package/dist/ui/layout/object/index.d.ts +30 -0
- package/dist/ui/layout/object/index.jsx +145 -0
- package/dist/ui/layout/object/index.jsx.map +1 -0
- package/dist/ui/layout/root/index.d.ts +10 -0
- package/dist/ui/layout/root/index.jsx +31 -0
- package/dist/ui/layout/root/index.jsx.map +1 -0
- package/dist/ui/layout/root/provider/index.d.ts +7 -0
- package/dist/ui/layout/root/provider/index.jsx +26 -0
- package/dist/ui/layout/root/provider/index.jsx.map +1 -0
- package/dist/ui/layout/tab/component.d.ts +4 -0
- package/dist/ui/layout/tab/component.jsx +16 -0
- package/dist/ui/layout/tab/component.jsx.map +1 -0
- package/dist/ui/layout/tab/content/index.d.ts +8 -0
- package/dist/ui/layout/tab/content/index.jsx +8 -0
- package/dist/ui/layout/tab/content/index.jsx.map +1 -0
- package/dist/ui/layout/tab/index.d.ts +11 -0
- package/dist/ui/layout/tab/index.jsx +25 -0
- package/dist/ui/layout/tab/index.jsx.map +1 -0
- package/dist/ui/layout/table/index.d.ts +33 -0
- package/dist/ui/layout/table/index.jsx +283 -0
- package/dist/ui/layout/table/index.jsx.map +1 -0
- package/dist/ui/layout/toast/index.d.ts +7 -0
- package/dist/ui/layout/toast/index.jsx +18 -0
- package/dist/ui/layout/toast/index.jsx.map +1 -0
- package/dist/ui/theme/border/index.d.ts +28 -0
- package/dist/ui/theme/border/index.js +67 -0
- package/dist/ui/theme/border/index.js.map +1 -0
- package/dist/ui/theme/color/index.d.ts +32 -0
- package/dist/ui/theme/color/index.js +106 -0
- package/dist/ui/theme/color/index.js.map +1 -0
- package/dist/ui/theme/index.d.ts +4 -0
- package/dist/ui/theme/index.js +5 -0
- package/dist/ui/theme/index.js.map +1 -0
- package/dist/ui/theme/rounded/index.d.ts +9 -0
- package/dist/ui/theme/rounded/index.js +14 -0
- package/dist/ui/theme/rounded/index.js.map +1 -0
- package/dist/ui/theme/size/index.d.ts +15 -0
- package/dist/ui/theme/size/index.js +55 -0
- package/dist/ui/theme/size/index.js.map +1 -0
- package/dist/ui/types/index.d.ts +113 -0
- package/dist/ui/types/index.js +33 -0
- package/dist/ui/types/index.js.map +1 -0
- package/dist/util/client.d.ts +2 -0
- package/dist/util/client.js +4 -0
- package/dist/util/client.js.map +1 -0
- package/dist/util/date/impl.d.ts +7 -0
- package/dist/util/date/impl.js +22 -0
- package/dist/util/date/impl.js.map +1 -0
- package/dist/util/date/index.d.ts +17 -0
- package/dist/util/date/index.js +16 -0
- package/dist/util/date/index.js.map +1 -0
- package/dist/util/index.d.ts +17 -0
- package/dist/util/index.js +143 -0
- package/dist/util/index.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export const setCookieValue = async (cookieName, value, options) => {
|
|
2
|
+
if (typeof window === 'undefined') {
|
|
3
|
+
const { cookies } = await import('next/headers');
|
|
4
|
+
const cookieStore = await cookies();
|
|
5
|
+
cookieStore.set(cookieName, value, {
|
|
6
|
+
httpOnly: options?.httpOnly ?? true,
|
|
7
|
+
secure: options?.secure ?? true,
|
|
8
|
+
sameSite: options?.sameSite ?? 'lax',
|
|
9
|
+
maxAge: options?.maxAge,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
const cookieOptions = [];
|
|
14
|
+
if (options?.secure) {
|
|
15
|
+
cookieOptions.push('Secure');
|
|
16
|
+
}
|
|
17
|
+
if (options?.sameSite) {
|
|
18
|
+
cookieOptions.push(`SameSite=${options.sameSite}`);
|
|
19
|
+
}
|
|
20
|
+
if (options?.maxAge) {
|
|
21
|
+
cookieOptions.push(`Max-Age=${options.maxAge}`);
|
|
22
|
+
}
|
|
23
|
+
// httpOnlyはクライアント側からは設定できない
|
|
24
|
+
const cookieString = `${cookieName}=${encodeURIComponent(value)}; ${cookieOptions.join('; ')}; Path=/`;
|
|
25
|
+
document.cookie = cookieString;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export const getCookieValue = async (cookieName) => {
|
|
29
|
+
if (typeof window === 'undefined') {
|
|
30
|
+
const { getCookies } = await import('next-client-cookies/server');
|
|
31
|
+
const cookies = await getCookies();
|
|
32
|
+
return cookies.get(cookieName);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
const cookies = document.cookie.split(';');
|
|
36
|
+
for (const cookie of cookies) {
|
|
37
|
+
const [name, ...valueParts] = cookie.trim().split('=');
|
|
38
|
+
if (name === cookieName && valueParts.length > 0) {
|
|
39
|
+
return decodeURIComponent(valueParts.join('='));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
export const deleteCookieValue = async (cookieName) => {
|
|
46
|
+
if (typeof window === 'undefined') {
|
|
47
|
+
const { cookies } = await import('next/headers');
|
|
48
|
+
const cookieStore = await cookies();
|
|
49
|
+
cookieStore.delete(cookieName);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
document.cookie = `${cookieName}=; Max-Age=0; Path=/`;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
export const getAllCookieNames = async () => {
|
|
56
|
+
if (typeof window === 'undefined') {
|
|
57
|
+
const { cookies } = await import('next/headers');
|
|
58
|
+
const cookieStore = await cookies();
|
|
59
|
+
return cookieStore.getAll().map((cookie) => cookie.name);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const cookies = document.cookie.split(';');
|
|
63
|
+
return cookies.map((cookie) => cookie.trim().split('=')[0]).filter((name) => name.length > 0);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/cookie/index.ts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AO,EAAE,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,CAAA;QAChD,MAAM,WAAW,GAAG,MAAM,OAAO,EAAE,CAAA;QACnC,OAAO,WAAW,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC1D,CAAC;SAAM,CAAC;QACN,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAC1C,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IAC/F,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as cookie from './cookie';
|
|
2
|
+
import * as nextAuth from './next-auth';
|
|
3
|
+
import * as s3 from './s3';
|
|
4
|
+
import * as trpc from './trpc';
|
|
5
|
+
export declare const Lib: {
|
|
6
|
+
cookie: typeof cookie;
|
|
7
|
+
nextAuth: typeof nextAuth;
|
|
8
|
+
s3: typeof s3;
|
|
9
|
+
trpc: typeof trpc;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,MAAM,MAAM,CAAA;AAC1B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAA;AAE9B,MAAM,CAAC,MAAM,GAAG,GAAG;IACjB,MAAM;IACN,QAAQ;IACR,EAAE;IACF,IAAI;CACL,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import CredentialsProvider from 'next-auth/providers/credentials';
|
|
2
|
+
import { defaultServerEnv } from '../../env';
|
|
3
|
+
export const options = (authorize) => ({
|
|
4
|
+
secret: (() => {
|
|
5
|
+
if (!defaultServerEnv.NEXTAUTH_SECRET)
|
|
6
|
+
throw new Error('NEXTAUTH_SECRET is not set');
|
|
7
|
+
return defaultServerEnv.NEXTAUTH_SECRET;
|
|
8
|
+
})(),
|
|
9
|
+
pages: {
|
|
10
|
+
signIn: '/signin',
|
|
11
|
+
},
|
|
12
|
+
session: {
|
|
13
|
+
maxAge: 60 * 60 * 24 * 30,
|
|
14
|
+
strategy: 'jwt',
|
|
15
|
+
},
|
|
16
|
+
providers: [
|
|
17
|
+
CredentialsProvider({
|
|
18
|
+
credentials: {
|
|
19
|
+
email: { type: 'email' },
|
|
20
|
+
password: { type: 'password' },
|
|
21
|
+
params: { type: 'object' },
|
|
22
|
+
},
|
|
23
|
+
async authorize(credentials) {
|
|
24
|
+
if (!credentials) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
if (!authorize) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const ret = await authorize(credentials.email, credentials.password, credentials.params);
|
|
31
|
+
if (!ret) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
token: ret,
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
}),
|
|
39
|
+
],
|
|
40
|
+
callbacks: {
|
|
41
|
+
session: ({ session, token }) => {
|
|
42
|
+
if (token) {
|
|
43
|
+
session.token = token.token;
|
|
44
|
+
}
|
|
45
|
+
return session;
|
|
46
|
+
},
|
|
47
|
+
jwt: async ({ token, user }) => {
|
|
48
|
+
if (user) {
|
|
49
|
+
token.token = user.token;
|
|
50
|
+
}
|
|
51
|
+
return token;
|
|
52
|
+
},
|
|
53
|
+
redirect: ({ url, baseUrl }) => {
|
|
54
|
+
if (url.startsWith('/')) {
|
|
55
|
+
return `${baseUrl}${url}`;
|
|
56
|
+
}
|
|
57
|
+
const searchParams = new URLSearchParams(new URL(url).search);
|
|
58
|
+
return new URL(searchParams.get('callbackUrl') ?? '', baseUrl).toString();
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/next-auth/index.ts"],"names":[],"mappings":"AACA,OAAO,mBAAmB,MAAM,iCAAiC,CAAA;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE5C,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,SAA6F,EAC5E,EAAE,CAAC,CAAC;IACrB,MAAM,EAAE,CAAC,GAAG,EAAE;QACZ,IAAI,CAAC,gBAAgB,CAAC,eAAe;YAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;QACpF,OAAO,gBAAgB,CAAC,eAAe,CAAA;IACzC,CAAC,CAAC,EAAE;IACJ,KAAK,EAAE;QACL,MAAM,EAAE,SAAS;KAClB;IACD,OAAO,EAAE;QACP,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;QACzB,QAAQ,EAAE,KAAK;KAChB;IACD,SAAS,EAAE;QACT,mBAAmB,CAAC;YAClB,WAAW,EAAE;gBACX,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;gBACxB,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;gBAC9B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;aAC3B;YACD,KAAK,CAAC,SAAS,CAAC,WAAW;gBACzB,IAAI,CAAC,WAAW,EAAE,CAAC;oBACjB,OAAO,IAAI,CAAA;gBACb,CAAC;gBACD,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,OAAO,IAAI,CAAA;gBAC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
|
+
export const client = () => {
|
|
4
|
+
if (!_client) {
|
|
5
|
+
const endpoint = process.env.S3_ENDPOINT;
|
|
6
|
+
_client = endpoint
|
|
7
|
+
? new S3Client({
|
|
8
|
+
region: 'ap-northeast-1',
|
|
9
|
+
endpoint,
|
|
10
|
+
credentials: { accessKeyId: 'minioadmin', secretAccessKey: 'minioadmin123' },
|
|
11
|
+
forcePathStyle: true,
|
|
12
|
+
})
|
|
13
|
+
: new S3Client();
|
|
14
|
+
}
|
|
15
|
+
return _client;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/s3/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE7C,IAAI,OAA6B,CAAA;AAEjC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE;IACzB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAA;QACxC,OAAO,GAAG,QAAQ;YAChB,CAAC,CAAC,IAAI,QAAQ,CAAC;gBACX,MAAM,EAAE,gBAAgB;gBACxB,QAAQ;gBACR,WAAW,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE;gBAC5E,cAAc,EAAE,IAAI;aACrB,CAAC;YACJ,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAA;IACpB,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTTPHeaders } from '@trpc/client';
|
|
2
|
+
export declare const setHeaderValues: (headers: HTTPHeaders, options?: {
|
|
3
|
+
httpOnly?: boolean;
|
|
4
|
+
secure?: boolean;
|
|
5
|
+
sameSite?: "strict" | "lax" | "none";
|
|
6
|
+
maxAge?: number;
|
|
7
|
+
}) => Promise<void>;
|
|
8
|
+
export declare const mergeDefaultHeaders: (extra?: HTTPHeaders) => Promise<HTTPHeaders>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getServerSession } from 'next-auth';
|
|
2
|
+
import { getCookieValue, setCookieValue } from '../cookie';
|
|
3
|
+
import { options as nextAuthOptions } from '../next-auth';
|
|
4
|
+
export const setHeaderValues = async (headers, options) => setCookieValue('headers', JSON.stringify(headers), options);
|
|
5
|
+
const createDefaultHeaders = async (defaultHeaders = {}) => {
|
|
6
|
+
let baseHeaders = {};
|
|
7
|
+
if (typeof window === 'undefined') {
|
|
8
|
+
const { headers: nextHeaders } = await import('next/headers');
|
|
9
|
+
const headersList = await nextHeaders();
|
|
10
|
+
baseHeaders = { 'user-agent': headersList.get('user-agent') || 'unknown' };
|
|
11
|
+
}
|
|
12
|
+
const savedHeaders = {};
|
|
13
|
+
const headersCookie = await getCookieValue('headers');
|
|
14
|
+
if (headersCookie) {
|
|
15
|
+
try {
|
|
16
|
+
const parsedHeaders = JSON.parse(headersCookie);
|
|
17
|
+
Object.assign(savedHeaders, parsedHeaders);
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
// JSONパースに失敗した場合は無視
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const session = await getServerSession(nextAuthOptions());
|
|
24
|
+
return {
|
|
25
|
+
...baseHeaders,
|
|
26
|
+
...savedHeaders,
|
|
27
|
+
...(session?.token ? { authorization: `Bearer ${session.token}` } : {}),
|
|
28
|
+
...defaultHeaders,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export const mergeDefaultHeaders = async (extra) => createDefaultHeaders(extra);
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/trpc/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CA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C,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,GAAG,cAAc;KAClB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EAAE,KAAmB,EAAwB,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
@config "./tailwind.config.ts";
|
|
3
|
+
|
|
4
|
+
:root {
|
|
5
|
+
color-scheme: light dark;
|
|
6
|
+
|
|
7
|
+
&:has(input[name='color-scheme'][value='light']) {
|
|
8
|
+
color-scheme: light;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&:has(input[name='color-scheme'][value='dark']) {
|
|
12
|
+
color-scheme: dark;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@layer utilities {
|
|
17
|
+
.clickable-enabled {
|
|
18
|
+
@apply cursor-pointer hover:opacity-80;
|
|
19
|
+
}
|
|
20
|
+
.clickable-disabled {
|
|
21
|
+
@apply cursor-default opacity-50;
|
|
22
|
+
}
|
|
23
|
+
.clickable {
|
|
24
|
+
@apply cursor-pointer hover:opacity-80 disabled:cursor-default disabled:opacity-50;
|
|
25
|
+
}
|
|
26
|
+
}
|