@yimingliao/cms 0.0.67 → 0.0.68

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.
@@ -338,23 +338,4 @@ type AdminCard = AdminSafe & {
338
338
  translations: AdminTranslation[];
339
339
  };
340
340
 
341
- interface SuccessResult<D = unknown> {
342
- success: true;
343
- message?: string;
344
- data?: D;
345
- meta?: Record<string, unknown>;
346
- }
347
- interface ErrorResult {
348
- success: false;
349
- message?: string;
350
- errors?: ErrorDetail[];
351
- code?: string;
352
- }
353
- interface ErrorDetail {
354
- field?: string;
355
- message?: string;
356
- code?: string;
357
- }
358
- type Result<D = unknown> = SuccessResult<D> | ErrorResult;
359
-
360
- export { ADMIN_ROLES as A, type BaseTranslation as B, type DeviceInfo as D, type ErrorDetail as E, type FolderFull as F, type MultiItems as M, type PostFull as P, type Result as R, type SuccessResult as S, type TocItem as T, type Folder as a, type FileFull as b, type FileCard as c, type ErrorResult as d, type Admin as e, type AdminCard as f, type AdminFull as g, type AdminRefreshToken as h, type AdminRole as i, type AdminSafe as j, type AdminTranslation as k, type Alternate as l, type ExternalLink as m, FILE_TYPES as n, type Faq as o, type File as p, type FileTranslation as q, type FileType as r, POST_TYPES as s, type Post as t, type PostListCard as u, type PostTranslation as v, type PostType as w, type SeoMetadata as x, type SingleItem as y, type Translation as z };
341
+ export { ADMIN_ROLES as A, type BaseTranslation as B, type DeviceInfo as D, type ExternalLink as E, type FolderFull as F, type MultiItems as M, type PostFull as P, type SeoMetadata as S, type TocItem as T, type Folder as a, type FileFull as b, type FileCard as c, type Admin as d, type AdminCard as e, type AdminFull as f, type AdminRefreshToken as g, type AdminRole as h, type AdminSafe as i, type AdminTranslation as j, type Alternate as k, FILE_TYPES as l, type Faq as m, type File as n, type FileTranslation as o, type FileType as p, POST_TYPES as q, type Post as r, type PostListCard as s, type PostTranslation as t, type PostType as u, type SingleItem as v, type Translation as w };
@@ -1,3 +1,4 @@
1
+ import { R as Result } from '../types-DHlRoJwv.js';
1
2
  import { Logger } from 'logry';
2
3
 
3
4
  interface FetchContext {
@@ -16,7 +17,7 @@ declare function createSmartFetch({ requestInterceptor, responseInterceptor, log
16
17
  requestInterceptor: RequestInterceptor;
17
18
  responseInterceptor: ResponseInterceptor;
18
19
  logger: Logger;
19
- }): <T>(input: string, init?: RequestInit) => Promise<T>;
20
+ }): <T>(input: string, init?: RequestInit) => Promise<Result<T>>;
20
21
 
21
22
  declare function createRequestInterceptor({ baseUrl }: {
22
23
  baseUrl: string;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
- import { F as FolderFull, a as Folder, b as FileFull, c as FileCard, E as ErrorDetail, S as SuccessResult, d as ErrorResult, P as PostFull, B as BaseTranslation } from './types-BGsFazJr.js';
2
- export { A as ADMIN_ROLES, e as Admin, f as AdminCard, g as AdminFull, h as AdminRefreshToken, i as AdminRole, j as AdminSafe, k as AdminTranslation, l as Alternate, D as DeviceInfo, m as ExternalLink, n as FILE_TYPES, o as Faq, p as File, q as FileTranslation, r as FileType, M as MultiItems, s as POST_TYPES, t as Post, u as PostListCard, v as PostTranslation, w as PostType, R as Result, x as SeoMetadata, y as SingleItem, T as TocItem, z as Translation } from './types-BGsFazJr.js';
1
+ import { F as FolderFull, a as Folder, b as FileFull, c as FileCard, P as PostFull, B as BaseTranslation } from './card-BG2vtuIz.js';
2
+ export { A as ADMIN_ROLES, d as Admin, e as AdminCard, f as AdminFull, g as AdminRefreshToken, h as AdminRole, i as AdminSafe, j as AdminTranslation, k as Alternate, D as DeviceInfo, E as ExternalLink, l as FILE_TYPES, m as Faq, n as File, o as FileTranslation, p as FileType, M as MultiItems, q as POST_TYPES, r as Post, s as PostListCard, t as PostTranslation, u as PostType, S as SeoMetadata, v as SingleItem, T as TocItem, w as Translation } from './card-BG2vtuIz.js';
3
3
  export { B as BlobFile } from './types-0oS1A2K5.js';
4
+ import { E as ErrorDetail, S as SuccessResult, a as ErrorResult } from './types-DHlRoJwv.js';
5
+ export { R as Result } from './types-DHlRoJwv.js';
4
6
  import { Robots } from 'next/dist/lib/metadata/types/metadata-types';
5
7
  import { Metadata } from 'next';
6
8
 
@@ -8,9 +8,10 @@ import * as zod from 'zod';
8
8
  import zod__default, { z, ZodType } from 'zod';
9
9
  import { B as BlobFile } from '../types-0oS1A2K5.js';
10
10
  import * as zod_v4_core from 'zod/v4/core';
11
- 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$1, b as FileFull, r as FileType, a as Folder, F as FolderFull, w as PostType, M as MultiItems, m as ExternalLink, o as Faq, t as Post, u as PostListCard, v as PostTranslation, P as PostFull, l as Alternate, S as SuccessResult, R as Result, f as AdminCard, c as FileCard } from '../types-BGsFazJr.js';
11
+ import { T as TocItem, h as AdminRole, v as SingleItem, B as BaseTranslation, d as Admin, f as AdminFull, i as AdminSafe, D as DeviceInfo, g as AdminRefreshToken, n as File$1, b as FileFull, p as FileType, a as Folder, F as FolderFull, u as PostType, M as MultiItems, E as ExternalLink, m as Faq, r as Post, s as PostListCard, t as PostTranslation, P as PostFull, k as Alternate, e as AdminCard, c as FileCard } from '../card-BG2vtuIz.js';
12
12
  import * as nodemailer_lib_smtp_transport from 'nodemailer/lib/smtp-transport';
13
13
  import nodemailer, { Transporter, SentMessageInfo } from 'nodemailer';
14
+ import { S as SuccessResult, R as Result } from '../types-DHlRoJwv.js';
14
15
  import { BaseTranslator, LocaleMessages } from 'intor';
15
16
  import { NextResponse } from 'next/server';
16
17
  import { S as StorageService } from '../types-J25u1G6t.js';
@@ -0,0 +1,20 @@
1
+ interface SuccessResult<D = unknown> {
2
+ success: true;
3
+ message?: string;
4
+ data?: D;
5
+ meta?: Record<string, unknown>;
6
+ }
7
+ interface ErrorResult {
8
+ success: false;
9
+ message?: string;
10
+ errors?: ErrorDetail[];
11
+ code?: string;
12
+ }
13
+ interface ErrorDetail {
14
+ field?: string;
15
+ message?: string;
16
+ code?: string;
17
+ }
18
+ type Result<D = unknown> = SuccessResult<D> | ErrorResult;
19
+
20
+ export type { ErrorDetail as E, Result as R, SuccessResult as S, ErrorResult as a };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yimingliao/cms",
3
- "version": "0.0.67",
3
+ "version": "0.0.68",
4
4
  "author": "Yiming Liao",
5
5
  "license": "MIT",
6
6
  "type": "module",