@yimingliao/cms 0.0.87 → 0.0.89
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/dist/{chunk-MYQZGULX.js → chunk-OQGJBZXQ.js} +15 -1
- package/dist/client/index.d.ts +37 -6
- package/dist/client/index.js +178 -3
- package/dist/client/shadcn/index.d.ts +3 -2
- package/dist/client/shadcn/index.js +1 -1
- package/dist/{create-verify-action-DBwWOXPO.d.ts → create-verify-action-lojNGPwl.d.ts} +17 -3
- package/dist/{button-DsjdULEG.d.ts → label-BF4qxS03.d.ts} +5 -1
- package/dist/server/index.d.ts +4 -17
- package/package.json +4 -1
|
@@ -6,6 +6,7 @@ import { Slot } from '@radix-ui/react-slot';
|
|
|
6
6
|
import { cva } from 'class-variance-authority';
|
|
7
7
|
import { jsx } from 'react/jsx-runtime';
|
|
8
8
|
import { Loader2Icon } from 'lucide-react';
|
|
9
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
9
10
|
|
|
10
11
|
// src/client/applications/ui/utils.ts
|
|
11
12
|
var cn = (...inputs) => {
|
|
@@ -340,5 +341,18 @@ function Spinner({ className, ...props }) {
|
|
|
340
341
|
}
|
|
341
342
|
);
|
|
342
343
|
}
|
|
344
|
+
function Label({ className, ...props }) {
|
|
345
|
+
return /* @__PURE__ */ jsx(
|
|
346
|
+
LabelPrimitive.Root,
|
|
347
|
+
{
|
|
348
|
+
"data-slot": "label",
|
|
349
|
+
className: cn(
|
|
350
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
351
|
+
className
|
|
352
|
+
),
|
|
353
|
+
...props
|
|
354
|
+
}
|
|
355
|
+
);
|
|
356
|
+
}
|
|
343
357
|
|
|
344
|
-
export { Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Spinner, Textarea, cn, useDeviceInfo };
|
|
358
|
+
export { Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Label, Spinner, Textarea, cn, useDeviceInfo };
|
package/dist/client/index.d.ts
CHANGED
|
@@ -4,25 +4,26 @@ import * as _tanstack_react_query from '@tanstack/react-query';
|
|
|
4
4
|
import { QueryClient, UseMutationOptions, UseQueryOptions } from '@tanstack/react-query';
|
|
5
5
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
|
-
import { c as createVerifyAction } from '../create-verify-action-
|
|
7
|
+
import { c as createVerifyAction, a as createSignInAction } from '../create-verify-action-lojNGPwl.js';
|
|
8
8
|
import * as React$1 from 'react';
|
|
9
|
-
import { ComponentProps } from 'react';
|
|
9
|
+
import { ComponentProps, ReactNode, HTMLAttributes } from 'react';
|
|
10
|
+
import { L as LabelProps, B as ButtonProps$1 } from '../label-BF4qxS03.js';
|
|
10
11
|
import { LucideIcon } from 'lucide-react';
|
|
11
|
-
import { B as ButtonProps$1 } from '../button-DsjdULEG.js';
|
|
12
12
|
import { ClassValue } from 'clsx';
|
|
13
|
+
import 'zod';
|
|
14
|
+
import 'zod/v4/core';
|
|
13
15
|
import '../types-J25u1G6t.js';
|
|
14
16
|
import '../types-0oS1A2K5.js';
|
|
15
17
|
import 'jsonwebtoken';
|
|
16
18
|
import 'node:crypto';
|
|
17
19
|
import 'next/headers';
|
|
18
20
|
import '@prisma/client';
|
|
19
|
-
import 'zod';
|
|
20
21
|
import 'nodemailer';
|
|
21
22
|
import 'intor';
|
|
22
23
|
import 'keyv';
|
|
23
|
-
import 'zod/v4/core';
|
|
24
24
|
import 'class-variance-authority/types';
|
|
25
25
|
import 'class-variance-authority';
|
|
26
|
+
import '@radix-ui/react-label';
|
|
26
27
|
|
|
27
28
|
interface UIStates {
|
|
28
29
|
isLoading?: boolean;
|
|
@@ -350,6 +351,22 @@ declare function createAdminInitializer({ useAdmin, useQuery, verifyAction, }: {
|
|
|
350
351
|
|
|
351
352
|
declare function Form({ onSubmit, className, ...props }: ComponentProps<"form">): react_jsx_runtime.JSX.Element;
|
|
352
353
|
|
|
354
|
+
interface FieldProps extends LabelProps {
|
|
355
|
+
label: ReactNode;
|
|
356
|
+
isRequired?: boolean;
|
|
357
|
+
hint?: ReactNode;
|
|
358
|
+
labelChildren?: ReactNode;
|
|
359
|
+
children: ReactNode;
|
|
360
|
+
}
|
|
361
|
+
declare function Field({ label, isRequired, hint, labelChildren, children, ...props }: FieldProps): react_jsx_runtime.JSX.Element;
|
|
362
|
+
|
|
363
|
+
interface FieldBodyProps extends HTMLAttributes<HTMLDivElement>, UIStates {
|
|
364
|
+
isEmpty?: boolean;
|
|
365
|
+
backgroundClassName?: string;
|
|
366
|
+
childrenClassName?: string;
|
|
367
|
+
}
|
|
368
|
+
declare function FieldBody({ isLoading, isDisabled, isEmpty, className, backgroundClassName, childrenClassName, children, ...props }: FieldBodyProps): react_jsx_runtime.JSX.Element;
|
|
369
|
+
|
|
353
370
|
interface ButtonProps extends ButtonProps$1, UIStates {
|
|
354
371
|
icon?: LucideIcon;
|
|
355
372
|
href?: string;
|
|
@@ -361,8 +378,22 @@ interface InputProps<T = Record<string, unknown>> extends ComponentProps<"input"
|
|
|
361
378
|
}
|
|
362
379
|
declare function Input<T>({ fieldName, setFormData, isLoading, isDisabled, isError, children, ...props }: InputProps<T>): react_jsx_runtime.JSX.Element;
|
|
363
380
|
|
|
381
|
+
declare function PasswordInput<T>({ ...props }: InputProps<T>): react_jsx_runtime.JSX.Element;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* [Auth] sign-in
|
|
385
|
+
*
|
|
386
|
+
* http://localhost:3000/cms/sign-in
|
|
387
|
+
*
|
|
388
|
+
* src/app/cms/(auth)/sign-in/page.tsx
|
|
389
|
+
*/
|
|
390
|
+
declare function createSignInPage({ useCommand, signInAction, }: {
|
|
391
|
+
useCommand: ReturnType<typeof createUseCommand>;
|
|
392
|
+
signInAction: ReturnType<typeof createSignInAction>;
|
|
393
|
+
}): () => react_jsx_runtime.JSX.Element;
|
|
394
|
+
|
|
364
395
|
declare const cn: (...inputs: ClassValue[]) => string;
|
|
365
396
|
|
|
366
397
|
declare function useDeviceInfo(): DeviceInfo | null;
|
|
367
398
|
|
|
368
|
-
export { AdminProvider, Button, type ButtonProps, Form, Input, type InputProps, type ShowToastOption, cn, createAdminInitializer, createRequestInterceptor, createResponseInterceptor, createSmartFetch, createUseCommand, createUseQuery, handleToast, useAdmin, useDeviceInfo };
|
|
399
|
+
export { AdminProvider, Button, type ButtonProps, Field, FieldBody, Form, Input, type InputProps, PasswordInput, type ShowToastOption, cn, createAdminInitializer, createRequestInterceptor, createResponseInterceptor, createSignInPage, createSmartFetch, createUseCommand, createUseQuery, handleToast, useAdmin, useDeviceInfo };
|
package/dist/client/index.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { cn,
|
|
2
|
-
export { cn, useDeviceInfo } from '../chunk-
|
|
1
|
+
import { cn, Label, Spinner, Button, InputGroup, InputGroupAddon, InputGroupInput, InputGroupButton, useDeviceInfo, Card, CardHeader, CardTitle, CardContent } from '../chunk-OQGJBZXQ.js';
|
|
2
|
+
export { cn, useDeviceInfo } from '../chunk-OQGJBZXQ.js';
|
|
3
3
|
import { ensureArray } from '../chunk-OAENV763.js';
|
|
4
4
|
import { toast } from 'sonner';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
import { useMutation, useQuery } from '@tanstack/react-query';
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import { createContext, useState, useContext, useEffect } from 'react';
|
|
9
|
+
import { Asterisk, Eye, EyeOff } from 'lucide-react';
|
|
10
|
+
import { useTranslator } from 'intor/react';
|
|
9
11
|
import { useRouter } from 'next/navigation';
|
|
12
|
+
import Link from 'next/link';
|
|
10
13
|
|
|
11
14
|
// src/client/infrastructure/fetch/smart-fetch.ts
|
|
12
15
|
function createSmartFetch({
|
|
@@ -250,6 +253,81 @@ function Form({
|
|
|
250
253
|
};
|
|
251
254
|
return /* @__PURE__ */ jsx("form", { className: cn(className), onSubmit: handleSubmit, ...props });
|
|
252
255
|
}
|
|
256
|
+
function Field({
|
|
257
|
+
label,
|
|
258
|
+
isRequired = false,
|
|
259
|
+
hint,
|
|
260
|
+
labelChildren,
|
|
261
|
+
children,
|
|
262
|
+
...props
|
|
263
|
+
}) {
|
|
264
|
+
return /* @__PURE__ */ jsxs("div", { className: "grid w-full items-center gap-3", children: [
|
|
265
|
+
/* @__PURE__ */ jsxs("span", { className: "flex gap-2", children: [
|
|
266
|
+
/* @__PURE__ */ jsxs(Label, { className: "flex gap-1 truncate", ...props, children: [
|
|
267
|
+
label,
|
|
268
|
+
isRequired && /* @__PURE__ */ jsx(Asterisk, { className: "text-destructive size-3" }),
|
|
269
|
+
hint && /* @__PURE__ */ jsx("span", { className: "ml-2 text-xs text-muted-foreground", children: hint })
|
|
270
|
+
] }),
|
|
271
|
+
/* @__PURE__ */ jsx("span", { children: labelChildren })
|
|
272
|
+
] }),
|
|
273
|
+
children
|
|
274
|
+
] });
|
|
275
|
+
}
|
|
276
|
+
function FieldBody({
|
|
277
|
+
// ui states
|
|
278
|
+
isLoading = false,
|
|
279
|
+
isDisabled = false,
|
|
280
|
+
isEmpty = false,
|
|
281
|
+
// base
|
|
282
|
+
className,
|
|
283
|
+
backgroundClassName,
|
|
284
|
+
childrenClassName,
|
|
285
|
+
children,
|
|
286
|
+
...props
|
|
287
|
+
}) {
|
|
288
|
+
const { t } = useTranslator();
|
|
289
|
+
return /* @__PURE__ */ jsxs(
|
|
290
|
+
"div",
|
|
291
|
+
{
|
|
292
|
+
className: cn(
|
|
293
|
+
className,
|
|
294
|
+
"relative",
|
|
295
|
+
"min-h-9 w-full min-w-0",
|
|
296
|
+
"flex items-center",
|
|
297
|
+
"text-sm"
|
|
298
|
+
),
|
|
299
|
+
...props,
|
|
300
|
+
children: [
|
|
301
|
+
/* @__PURE__ */ jsx(
|
|
302
|
+
"div",
|
|
303
|
+
{
|
|
304
|
+
className: cn(
|
|
305
|
+
"absolute size-full",
|
|
306
|
+
"dark:bg-input/30 bg-foreground/2 rounded-md",
|
|
307
|
+
backgroundClassName
|
|
308
|
+
)
|
|
309
|
+
}
|
|
310
|
+
),
|
|
311
|
+
isLoading && /* @__PURE__ */ jsx("div", { className: "px-3", children: /* @__PURE__ */ jsx(Spinner, {}) }),
|
|
312
|
+
!isLoading && (!children || isEmpty) && /* @__PURE__ */ jsx("div", { className: "flex-center h-9 px-3 opacity-50", children: /* @__PURE__ */ jsx("p", { className: "opacity-50", children: t("ui.no-data.text") }) }),
|
|
313
|
+
!isLoading && children && !isEmpty && /* @__PURE__ */ jsx(
|
|
314
|
+
"div",
|
|
315
|
+
{
|
|
316
|
+
className: cn(
|
|
317
|
+
"relative size-full",
|
|
318
|
+
"flex items-center gap-3",
|
|
319
|
+
"px-3 py-2",
|
|
320
|
+
"break-all",
|
|
321
|
+
(isDisabled || isLoading) && "opacity-50",
|
|
322
|
+
childrenClassName
|
|
323
|
+
),
|
|
324
|
+
children
|
|
325
|
+
}
|
|
326
|
+
)
|
|
327
|
+
]
|
|
328
|
+
}
|
|
329
|
+
);
|
|
330
|
+
}
|
|
253
331
|
function Button2({
|
|
254
332
|
icon,
|
|
255
333
|
href,
|
|
@@ -312,5 +390,102 @@ function Input({
|
|
|
312
390
|
children
|
|
313
391
|
] });
|
|
314
392
|
}
|
|
393
|
+
function PasswordInput({ ...props }) {
|
|
394
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
395
|
+
return /* @__PURE__ */ jsx(Input, { type: showPassword ? "text" : "password", ...props, children: /* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsx(
|
|
396
|
+
InputGroupButton,
|
|
397
|
+
{
|
|
398
|
+
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
399
|
+
title: showPassword ? "Hide password" : "Show password",
|
|
400
|
+
size: "icon-xs",
|
|
401
|
+
onClick: () => setShowPassword((prev) => !prev),
|
|
402
|
+
children: showPassword ? /* @__PURE__ */ jsx(Eye, {}) : /* @__PURE__ */ jsx(EyeOff, {})
|
|
403
|
+
}
|
|
404
|
+
) }) });
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// src/constants/keys/auth.ts
|
|
408
|
+
var AUTH_KEYS = {
|
|
409
|
+
forgotPassword: { key: "forgot-password" }};
|
|
410
|
+
|
|
411
|
+
// src/constants/keys/index.ts
|
|
412
|
+
var KEYS = {
|
|
413
|
+
auth: AUTH_KEYS};
|
|
414
|
+
|
|
415
|
+
// src/constants/paths/cms-path.ts
|
|
416
|
+
var CMS_PATH = "/cms";
|
|
417
|
+
|
|
418
|
+
// src/constants/paths/auth.ts
|
|
419
|
+
var AUTH_PATHS = {
|
|
420
|
+
forgotPassword: {
|
|
421
|
+
path: `${CMS_PATH}/${KEYS.auth.forgotPassword.key}`
|
|
422
|
+
}};
|
|
423
|
+
|
|
424
|
+
// src/constants/paths/index.ts
|
|
425
|
+
var PATHS = {
|
|
426
|
+
auth: AUTH_PATHS};
|
|
427
|
+
function createSignInPage({
|
|
428
|
+
useCommand,
|
|
429
|
+
signInAction
|
|
430
|
+
}) {
|
|
431
|
+
return function CmsSignInPage() {
|
|
432
|
+
const { t } = useTranslator();
|
|
433
|
+
const { setAdmin } = useAdmin();
|
|
434
|
+
const deviceInfo = useDeviceInfo();
|
|
435
|
+
const [formData, setFormData] = useState({
|
|
436
|
+
email: "",
|
|
437
|
+
password: ""
|
|
438
|
+
});
|
|
439
|
+
const { execute, isRedirecting, errors } = useCommand(
|
|
440
|
+
() => signInAction({
|
|
441
|
+
formData,
|
|
442
|
+
deviceInfo: deviceInfo ?? {}
|
|
443
|
+
}),
|
|
444
|
+
{ onSuccess: (data) => setAdmin(data?.admin || null) }
|
|
445
|
+
);
|
|
446
|
+
return /* @__PURE__ */ jsx(Form, { className: "mx-auto mt-20 w-96", onSubmit: () => void execute(), children: /* @__PURE__ */ jsxs(Card, { children: [
|
|
447
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { className: "mx-auto", children: t("auth.sign-in.text") }) }),
|
|
448
|
+
/* @__PURE__ */ jsxs(CardContent, { className: "relative flex flex-col gap-6", children: [
|
|
449
|
+
/* @__PURE__ */ jsx(Field, { htmlFor: "email", label: t("auth.sign-in.email.text"), children: /* @__PURE__ */ jsx(
|
|
450
|
+
Input,
|
|
451
|
+
{
|
|
452
|
+
id: "email",
|
|
453
|
+
type: "email",
|
|
454
|
+
placeholder: t("auth.sign-in.email.placeholder.text"),
|
|
455
|
+
autoComplete: "email",
|
|
456
|
+
fieldName: "email",
|
|
457
|
+
value: formData.email,
|
|
458
|
+
setFormData,
|
|
459
|
+
isDisabled: isRedirecting,
|
|
460
|
+
isError: errors.includes("email")
|
|
461
|
+
}
|
|
462
|
+
) }),
|
|
463
|
+
/* @__PURE__ */ jsx(Field, { htmlFor: "password", label: t("auth.sign-in.password.text"), children: /* @__PURE__ */ jsx(
|
|
464
|
+
PasswordInput,
|
|
465
|
+
{
|
|
466
|
+
id: "password",
|
|
467
|
+
placeholder: t("auth.sign-in.password.placeholder.text"),
|
|
468
|
+
fieldName: "password",
|
|
469
|
+
value: formData.password,
|
|
470
|
+
setFormData,
|
|
471
|
+
isDisabled: isRedirecting,
|
|
472
|
+
isError: errors.includes("password")
|
|
473
|
+
}
|
|
474
|
+
) }),
|
|
475
|
+
/* @__PURE__ */ jsx(
|
|
476
|
+
Button2,
|
|
477
|
+
{
|
|
478
|
+
size: "xs",
|
|
479
|
+
variant: "link",
|
|
480
|
+
className: "w-fit",
|
|
481
|
+
isDisabled: isRedirecting,
|
|
482
|
+
children: /* @__PURE__ */ jsx(Link, { href: PATHS.auth.forgotPassword.path, children: t("auth.sign-in.anchor.text") })
|
|
483
|
+
}
|
|
484
|
+
),
|
|
485
|
+
/* @__PURE__ */ jsx(Button2, { type: "submit", isLoading: isRedirecting, children: t("auth.sign-in.button.text") })
|
|
486
|
+
] })
|
|
487
|
+
] }) });
|
|
488
|
+
};
|
|
489
|
+
}
|
|
315
490
|
|
|
316
|
-
export { AdminProvider, Button2 as Button, Form, Input, createAdminInitializer, createRequestInterceptor, createResponseInterceptor, createSmartFetch, createUseCommand, createUseQuery, handleToast, useAdmin };
|
|
491
|
+
export { AdminProvider, Button2 as Button, Field, FieldBody, Form, Input, PasswordInput, createAdminInitializer, createRequestInterceptor, createResponseInterceptor, createSignInPage, createSmartFetch, createUseCommand, createUseQuery, handleToast, useAdmin };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { a as Button } from '../../
|
|
2
|
-
export { B as ButtonProps } from '../../
|
|
1
|
+
import { a as Button } from '../../label-BF4qxS03.js';
|
|
2
|
+
export { B as ButtonProps, b as Label, L as LabelProps } from '../../label-BF4qxS03.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ComponentProps } from 'react';
|
|
6
6
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
7
7
|
import { VariantProps } from 'class-variance-authority';
|
|
8
|
+
import '@radix-ui/react-label';
|
|
8
9
|
|
|
9
10
|
declare function Card({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
10
11
|
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Spinner, Textarea } from '../../chunk-
|
|
1
|
+
export { Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Label, Spinner, Textarea } from '../../chunk-OQGJBZXQ.js';
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { T as TocItem, i as AdminRole, y as SingleItem, B as BaseTranslation, e as Admin, g as AdminFull, j as AdminSafe, D as DeviceInfo, h as AdminRefreshToken, p as File, b as FileFull, r as FileType, a as Folder, F as FolderFull, M as MultiItems, m as ExternalLink, o as Faq, t as Post, w as PostType, u as PostListCard, v as PostTranslation, P as PostFull, l as Alternate, S as SuccessResult, R as Result } from './types-BGsFazJr.js';
|
|
2
|
+
import * as zod from 'zod';
|
|
3
|
+
import zod__default, { z, ZodType } from 'zod';
|
|
4
|
+
import * as zod_v4_core from 'zod/v4/core';
|
|
2
5
|
import { S as StorageService } from './types-J25u1G6t.js';
|
|
3
6
|
import jwt from 'jsonwebtoken';
|
|
4
7
|
import { BinaryLike } from 'node:crypto';
|
|
5
8
|
import { cookies } from 'next/headers';
|
|
6
9
|
import { PrismaClient } from '@prisma/client';
|
|
7
|
-
import zod__default, { z, ZodType } from 'zod';
|
|
8
10
|
import { Transporter, SentMessageInfo } from 'nodemailer';
|
|
9
11
|
import { Logger } from 'logry';
|
|
10
12
|
import { BaseTranslator, LocaleMessages } from 'intor';
|
|
11
13
|
import Keyv from 'keyv';
|
|
12
|
-
import * as zod_v4_core from 'zod/v4/core';
|
|
13
14
|
|
|
14
15
|
interface CreateJwtServiceParams {
|
|
15
16
|
defaultSecret: string;
|
|
@@ -855,8 +856,21 @@ interface ActionContext {
|
|
|
855
856
|
};
|
|
856
857
|
}
|
|
857
858
|
|
|
859
|
+
declare const signInValidator: (schemas: ReturnType<typeof createSchemas>) => zod.ZodObject<{
|
|
860
|
+
email: zod.ZodEmail;
|
|
861
|
+
password: zod.ZodString;
|
|
862
|
+
}, zod_v4_core.$strip>;
|
|
863
|
+
|
|
864
|
+
type SignInFormData = zod__default.infer<ReturnType<typeof signInValidator>>;
|
|
865
|
+
declare function createSignInAction(ctx: ActionContext): ({ formData, deviceInfo, }: {
|
|
866
|
+
formData: SignInFormData;
|
|
867
|
+
deviceInfo: DeviceInfo;
|
|
868
|
+
}) => Promise<Result<{
|
|
869
|
+
admin: AdminFull;
|
|
870
|
+
}>>;
|
|
871
|
+
|
|
858
872
|
declare function createVerifyAction(ctx: ActionContext): () => Promise<Result<{
|
|
859
873
|
admin: AdminFull;
|
|
860
874
|
}>>;
|
|
861
875
|
|
|
862
|
-
export { type ActionContext as A,
|
|
876
|
+
export { type ActionContext as A, createPostQueryRepository as B, createRenderEmailTemplate as C, createSendEmail as D, createSeoMetadataCommandRepository as E, createUnique as F, createVerifyAccessToken as G, createVerifyRefreshToken as H, normalizeCacheKey as I, type RawCacheKey as R, type SignInFormData as S, createSignInAction as a, createZod as b, createVerifyAction as c, createSchemas as d, createTocItemSchema as e, createAdminCommandRepository as f, createAdminQueryRepository as g, createAdminRefreshTokenCommandRepository as h, createAdminRefreshTokenQueryRepository as i, createArgon2Service as j, createAuthMiddleware as k, createAuthUseCases as l, createCacheResult as m, createCookieService as n, createCryptoService as o, createEmailVerificationEmail as p, createExecuteAction as q, createExist as r, createFileCommandRepository as s, createFileQueryRepository as t, createFolderCommandRepository as u, createFolderQueryRepository as v, createForgotPasswordEmail as w, createIpRateLimiter as x, createJwtService as y, createPostCommandRepository as z };
|
|
@@ -2,6 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
5
6
|
|
|
6
7
|
declare const buttonVariants: (props?: ({
|
|
7
8
|
variant?: "link" | "default" | "success" | "destructive" | "outline" | "secondary" | "ghost" | "warning" | null | undefined;
|
|
@@ -12,4 +13,7 @@ type ButtonProps = React.ComponentProps<"button"> & VariantProps<typeof buttonVa
|
|
|
12
13
|
};
|
|
13
14
|
declare function Button({ className, variant, size, asChild, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
type LabelProps = React.ComponentProps<typeof LabelPrimitive.Root>;
|
|
17
|
+
declare function Label({ className, ...props }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
export { type ButtonProps as B, type LabelProps as L, Button as a, Label as b };
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { R as RawCacheKey,
|
|
1
|
+
import { b as createZod, A as ActionContext, d as createSchemas, e as createTocItemSchema } from '../create-verify-action-lojNGPwl.js';
|
|
2
|
+
export { R as RawCacheKey, S as SignInFormData, f as createAdminCommandRepository, g as createAdminQueryRepository, h as createAdminRefreshTokenCommandRepository, i as createAdminRefreshTokenQueryRepository, j as createArgon2Service, k as createAuthMiddleware, l as createAuthUseCases, m as createCacheResult, n as createCookieService, o as createCryptoService, p as createEmailVerificationEmail, q as createExecuteAction, r as createExist, s as createFileCommandRepository, t as createFileQueryRepository, u as createFolderCommandRepository, v as createFolderQueryRepository, w as createForgotPasswordEmail, x as createIpRateLimiter, y as createJwtService, z as createPostCommandRepository, B as createPostQueryRepository, C as createRenderEmailTemplate, D as createSendEmail, E as createSeoMetadataCommandRepository, a as createSignInAction, F as createUnique, G as createVerifyAccessToken, c as createVerifyAction, H as createVerifyRefreshToken, I as normalizeCacheKey } from '../create-verify-action-lojNGPwl.js';
|
|
3
3
|
import Keyv from 'keyv';
|
|
4
4
|
import * as zod from 'zod';
|
|
5
5
|
import zod__default from 'zod';
|
|
@@ -9,7 +9,7 @@ import nodemailer from 'nodemailer';
|
|
|
9
9
|
import { BaseTranslator, LocaleMessages } from 'intor';
|
|
10
10
|
import { Logger } from 'logry';
|
|
11
11
|
import { NextResponse } from 'next/server';
|
|
12
|
-
import {
|
|
12
|
+
import { R as Result, j as AdminSafe, e as Admin, g as AdminFull, h as AdminRefreshToken, a as Folder, b as FileFull, p as File$1, r as FileType, F as FolderFull, T as TocItem, f as AdminCard, u as PostListCard, c as FileCard, t as Post, w as PostType, v as PostTranslation, P as PostFull } from '../types-BGsFazJr.js';
|
|
13
13
|
import * as zod_v4_core from 'zod/v4/core';
|
|
14
14
|
import '../types-J25u1G6t.js';
|
|
15
15
|
import 'jsonwebtoken';
|
|
@@ -80,19 +80,6 @@ interface CreateExecuteApiParams {
|
|
|
80
80
|
}
|
|
81
81
|
declare function createExecuteApi({ initI18n, logger }: CreateExecuteApiParams): (fn: Api) => Promise<NextResponse<unknown>>;
|
|
82
82
|
|
|
83
|
-
declare const signInValidator: (schemas: ReturnType<typeof createSchemas>) => zod.ZodObject<{
|
|
84
|
-
email: zod.ZodEmail;
|
|
85
|
-
password: zod.ZodString;
|
|
86
|
-
}, zod_v4_core.$strip>;
|
|
87
|
-
|
|
88
|
-
type SignInFormData = zod__default.infer<ReturnType<typeof signInValidator>>;
|
|
89
|
-
declare function createSignInAction(ctx: ActionContext): ({ formData, deviceInfo, }: {
|
|
90
|
-
formData: SignInFormData;
|
|
91
|
-
deviceInfo: DeviceInfo;
|
|
92
|
-
}) => Promise<Result<{
|
|
93
|
-
admin: AdminFull;
|
|
94
|
-
}>>;
|
|
95
|
-
|
|
96
83
|
declare function createSignOutAction(ctx: ActionContext): () => Promise<Result<void>>;
|
|
97
84
|
|
|
98
85
|
declare const changePasswordValidator: (schemas: ReturnType<typeof createSchemas>) => zod.ZodObject<{
|
|
@@ -1608,4 +1595,4 @@ declare class ServerError extends Error {
|
|
|
1608
1595
|
static internalServerError(): ServerError;
|
|
1609
1596
|
}
|
|
1610
1597
|
|
|
1611
|
-
export { ADMIN_ORDER_BY, ActionContext, type AdminCreateFormData, type AdminUpdateFormData, type ChangePasswordFormData, type EmailUnverifiedFormData, type FileCreateFormData, type FileCreateManyFormData, type FileUpdateFormData, type FolderCreateFormData, type FolderUpdateFormData, type ForgotPasswordFormData, ORDER_BY, POST_ORDER_BY, type PostCreateFormData, type PostUpdateFormData, type ResetPasswordFormData, type SeoMetadataUpsertFormData, ServerError, type
|
|
1598
|
+
export { ADMIN_ORDER_BY, ActionContext, type AdminCreateFormData, type AdminUpdateFormData, type ChangePasswordFormData, type EmailUnverifiedFormData, type FileCreateFormData, type FileCreateManyFormData, type FileUpdateFormData, type FolderCreateFormData, type FolderUpdateFormData, type ForgotPasswordFormData, ORDER_BY, POST_ORDER_BY, type PostCreateFormData, type PostUpdateFormData, type ResetPasswordFormData, type SeoMetadataUpsertFormData, ServerError, type VerifyEmailFormData, createAdminCreateAction, createAdminDeleteAction, createAdminFindFullAction, createAdminFindListCardsAction, createAdminRefreshTokenDeleteAction, createAdminRefreshTokenFindManyAction, createAdminUpdateAction, createCache, createChangePasswordAction, createEmailUnverifiedAction, createExecuteApi, createFileCreateAction, createFileCreateManyAction, createFileFindFullAction, createFileFindListCardsAction, createFilePurgeManyAction, createFileRestoreManyAction, createFileSchema, createFileSoftDeleteAction, createFileSoftDeleteManyAction, createFileUpdateAction, createFolderCreateAction, createFolderDeleteAction, createFolderFindFullAction, createFolderFindListCardsAction, createFolderUpdateAction, createForgotPasswordAction, createMultiFileSchema, createPostCreateAction, createPostDeleteAction, createPostFindAction, createPostFindFullAction, createPostFindListCardsAction, createPostFindManyAction, createPostUpdateAction, createResetPasswordAction, createSchemas, createSeoMetadataUpsertAction, createSignOutAction, createTocItemSchema, createTransporter, createVerifyEmailAction, createZod };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yimingliao/cms",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.89",
|
|
4
4
|
"author": "Yiming Liao",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@keyv/redis": "^5.1.6",
|
|
52
|
+
"@radix-ui/react-label": "^2.1.8",
|
|
52
53
|
"@radix-ui/react-slot": "^1.2.4",
|
|
53
54
|
"argon2": "^0.44.0",
|
|
54
55
|
"class-variance-authority": "^0.7.1",
|
|
@@ -85,6 +86,8 @@
|
|
|
85
86
|
"intor": "^2.5.0",
|
|
86
87
|
"knip": "^5.86.0",
|
|
87
88
|
"next": "^16.1.6",
|
|
89
|
+
"prettier": "^3.8.1",
|
|
90
|
+
"prettier-plugin-tailwindcss": "^0.7.2",
|
|
88
91
|
"prisma": "6.5.0",
|
|
89
92
|
"react": "^19.2.4",
|
|
90
93
|
"tailwind-merge": "^3.5.0",
|