@mx-space/api-client 1.18.1 → 1.19.1

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.
Files changed (63) hide show
  1. package/dist/index.cjs +54 -54
  2. package/dist/index.d.cts +35 -28
  3. package/dist/index.d.mts +35 -28
  4. package/dist/index.mjs +54 -54
  5. package/package.json +15 -10
  6. package/controllers/ack.ts +0 -42
  7. package/controllers/activity.ts +0 -108
  8. package/controllers/aggregate.ts +0 -75
  9. package/controllers/ai.ts +0 -70
  10. package/controllers/base.ts +0 -36
  11. package/controllers/category.ts +0 -118
  12. package/controllers/comment.ts +0 -71
  13. package/controllers/index.ts +0 -97
  14. package/controllers/link.ts +0 -46
  15. package/controllers/note.ts +0 -128
  16. package/controllers/page.ts +0 -64
  17. package/controllers/post.ts +0 -93
  18. package/controllers/project.ts +0 -27
  19. package/controllers/recently.ts +0 -82
  20. package/controllers/say.ts +0 -40
  21. package/controllers/search.ts +0 -108
  22. package/controllers/severless.ts +0 -31
  23. package/controllers/snippet.ts +0 -35
  24. package/controllers/subscribe.ts +0 -58
  25. package/controllers/topic.ts +0 -37
  26. package/controllers/user.ts +0 -61
  27. package/dtos/comment.ts +0 -12
  28. package/dtos/index.ts +0 -1
  29. package/index.ts +0 -12
  30. package/interfaces/adapter.ts +0 -36
  31. package/interfaces/client.ts +0 -20
  32. package/interfaces/controller.ts +0 -5
  33. package/interfaces/instance.ts +0 -8
  34. package/interfaces/options.ts +0 -1
  35. package/interfaces/params.ts +0 -4
  36. package/interfaces/request.ts +0 -87
  37. package/interfaces/types.ts +0 -3
  38. package/mod-dts.mjs +0 -21
  39. package/models/activity.ts +0 -133
  40. package/models/aggregate.ts +0 -88
  41. package/models/ai.ts +0 -17
  42. package/models/auth.ts +0 -9
  43. package/models/base.ts +0 -48
  44. package/models/category.ts +0 -25
  45. package/models/comment.ts +0 -44
  46. package/models/index.ts +0 -20
  47. package/models/link.ts +0 -25
  48. package/models/note.ts +0 -41
  49. package/models/page.ts +0 -20
  50. package/models/post.ts +0 -28
  51. package/models/project.ts +0 -12
  52. package/models/reader.ts +0 -9
  53. package/models/recently.ts +0 -24
  54. package/models/say.ts +0 -7
  55. package/models/setting.ts +0 -73
  56. package/models/snippet.ts +0 -19
  57. package/models/subscribe.ts +0 -5
  58. package/models/topic.ts +0 -9
  59. package/models/user.ts +0 -27
  60. package/test.d.ts +0 -3
  61. package/tsconfig.json +0 -37
  62. package/tsdown.config.ts +0 -18
  63. package/vitest.config.ts +0 -16
@@ -1,88 +0,0 @@
1
- import type { CategoryModel } from './category'
2
- import type { NoteModel } from './note'
3
- import type { PageModel } from './page'
4
- import type { PostModel } from './post'
5
- import type { SayModel } from './say'
6
- import type { SeoOptionModel } from './setting'
7
- import type { UserModel } from './user'
8
-
9
- export interface AggregateRoot {
10
- user: UserModel
11
- seo: SeoOptionModel
12
- url: Url
13
- categories: CategoryModel[]
14
- pageMeta: Pick<PageModel, 'title' | 'id' | 'slug' | 'order'>[] | null
15
- /**
16
- * @available 4.2.2
17
- */
18
- latestNoteId: { id: string; nid: number }
19
- }
20
-
21
- export interface AggregateRootWithTheme<Theme = unknown> extends AggregateRoot {
22
- theme?: Theme
23
- }
24
-
25
- export interface Url {
26
- wsUrl: string
27
- serverUrl: string
28
- webUrl: string
29
- }
30
-
31
- export interface AggregateTopNote
32
- extends Pick<NoteModel, 'id' | 'title' | 'created' | 'nid' | 'images'> {}
33
-
34
- export interface AggregateTopPost
35
- extends Pick<
36
- PostModel,
37
- 'id' | 'slug' | 'created' | 'title' | 'category' | 'images'
38
- > {}
39
-
40
- export interface AggregateTop {
41
- notes: AggregateTopNote[]
42
- posts: AggregateTopPost[]
43
- says: SayModel[]
44
- }
45
-
46
- export enum TimelineType {
47
- Post,
48
- Note,
49
- }
50
-
51
- export interface TimelineData {
52
- notes?: Pick<
53
- NoteModel,
54
- | 'id'
55
- | 'nid'
56
- | 'title'
57
- | 'weather'
58
- | 'mood'
59
- | 'created'
60
- | 'modified'
61
- | 'bookmark'
62
- >[]
63
-
64
- posts?: (Pick<
65
- PostModel,
66
- 'id' | 'title' | 'slug' | 'created' | 'modified' | 'category'
67
- > & { url: string })[]
68
- }
69
-
70
- export interface AggregateStat {
71
- allComments: number
72
- categories: number
73
- comments: number
74
- linkApply: number
75
- links: number
76
- notes: number
77
- pages: number
78
- posts: number
79
- says: number
80
- recently: number
81
- unreadComments: number
82
- online: number
83
- todayMaxOnline: string
84
- todayOnlineTotal: string
85
- callTime: number
86
- uv: number
87
- todayIpAccessCount: number
88
- }
package/models/ai.ts DELETED
@@ -1,17 +0,0 @@
1
- export interface AISummaryModel {
2
- id: string
3
- created: string
4
- summary: string
5
- hash: string
6
- refId: string
7
- lang: string
8
- }
9
-
10
- export interface AIDeepReadingModel {
11
- id: string
12
- hash: string
13
- refId: string
14
- keyPoints: string[]
15
- criticalAnalysis: string
16
- content: string
17
- }
package/models/auth.ts DELETED
@@ -1,9 +0,0 @@
1
- export interface AuthUser {
2
- id: string
3
- email: string
4
- isOwner: boolean
5
- image: string
6
- name: string
7
- provider: string
8
- handle: string
9
- }
package/models/base.ts DELETED
@@ -1,48 +0,0 @@
1
- export interface Count {
2
- read: number
3
- like: number
4
- }
5
-
6
- export interface Image {
7
- height: number
8
- width: number
9
- type: string
10
- accent?: string
11
- src: string
12
- blurHash?: string
13
- }
14
-
15
- export interface Pager {
16
- total: number
17
- size: number
18
- currentPage: number
19
- totalPage: number
20
- hasPrevPage: boolean
21
- hasNextPage: boolean
22
- }
23
-
24
- export interface PaginateResult<T> {
25
- data: T[]
26
- pagination: Pager
27
- }
28
-
29
- export interface BaseModel {
30
- created: string
31
- id: string
32
- }
33
-
34
- export interface BaseCommentIndexModel extends BaseModel {
35
- commentsIndex?: number
36
-
37
- allowComment: boolean
38
- }
39
- export interface TextBaseModel extends BaseCommentIndexModel {
40
- title: string
41
- text: string
42
- images?: Image[]
43
- modified: string | null
44
- }
45
-
46
- export type ModelWithLiked<T> = T & {
47
- liked: boolean
48
- }
@@ -1,25 +0,0 @@
1
- import type { BaseModel } from './base'
2
- import type { PostModel } from './post'
3
-
4
- export enum CategoryType {
5
- Category,
6
- Tag,
7
- }
8
-
9
- export interface CategoryModel extends BaseModel {
10
- type: CategoryType
11
- count: number
12
- slug: string
13
- name: string
14
- }
15
- export type CategoryWithChildrenModel = CategoryModel & {
16
- children: Pick<PostModel, 'id' | 'title' | 'slug' | 'modified' | 'created'>[]
17
- }
18
-
19
- export type CategoryEntries = {
20
- entries: Record<string, CategoryWithChildrenModel>
21
- }
22
- export interface TagModel {
23
- count: number
24
- name: string
25
- }
package/models/comment.ts DELETED
@@ -1,44 +0,0 @@
1
- import { CollectionRefTypes } from '@core/constants/db.constant'
2
- import type { BaseModel } from './base'
3
- import type { CategoryModel } from './category'
4
-
5
- export { CollectionRefTypes }
6
- export interface CommentModel extends BaseModel {
7
- refType: CollectionRefTypes
8
- ref: string
9
- state: number
10
- commentsIndex: number
11
- author: string
12
- text: string
13
- mail?: string
14
- url?: string
15
- ip?: string
16
- agent?: string
17
- key: string
18
- pin?: boolean
19
-
20
- avatar: string
21
-
22
- parent?: CommentModel | string
23
- children: CommentModel[]
24
-
25
- isWhispers?: boolean
26
- location?: string
27
-
28
- source?: string
29
- readerId?: string
30
- editedAt?: string
31
- }
32
- export interface CommentRef {
33
- id: string
34
- categoryId?: string
35
- slug: string
36
- title: string
37
- category?: CategoryModel
38
- }
39
-
40
- export enum CommentState {
41
- Unread,
42
- Read,
43
- Junk,
44
- }
package/models/index.ts DELETED
@@ -1,20 +0,0 @@
1
- export * from './activity'
2
- export * from './aggregate'
3
- export * from './ai'
4
- export * from './auth'
5
- export * from './base'
6
- export * from './category'
7
- export * from './comment'
8
- export * from './link'
9
- export * from './note'
10
- export * from './page'
11
- export * from './post'
12
- export * from './project'
13
- export * from './reader'
14
- export * from './recently'
15
- export * from './say'
16
- export * from './setting'
17
- export * from './snippet'
18
- export * from './subscribe'
19
- export * from './topic'
20
- export * from './user'
package/models/link.ts DELETED
@@ -1,25 +0,0 @@
1
- import type { BaseModel } from './base'
2
-
3
- export enum LinkType {
4
- Friend,
5
- Collection,
6
- }
7
-
8
- export enum LinkState {
9
- Pass,
10
- Audit,
11
- Outdate,
12
- Banned,
13
- Reject,
14
- }
15
-
16
- export interface LinkModel extends BaseModel {
17
- name: string
18
- url: string
19
- avatar: string
20
- description?: string
21
- type: LinkType
22
- state: LinkState
23
- hide: boolean
24
- email: string
25
- }
package/models/note.ts DELETED
@@ -1,41 +0,0 @@
1
- import type { ModelWithLiked, TextBaseModel } from './base'
2
- import type { TopicModel } from './topic'
3
-
4
- export interface NoteModel extends TextBaseModel {
5
- isPublished: boolean
6
- count: {
7
- read: number
8
- like: number
9
- }
10
-
11
- mood?: string
12
- weather?: string
13
- bookmark?: boolean
14
-
15
- publicAt?: Date
16
- password?: string | null
17
- nid: number
18
-
19
- location?: string
20
-
21
- coordinates?: Coordinate
22
- topic?: TopicModel
23
- topicId?: string
24
- }
25
-
26
- export interface Coordinate {
27
- latitude: number
28
- longitude: number
29
- }
30
-
31
- export interface NoteWrappedPayload {
32
- data: NoteModel
33
- next?: Partial<NoteModel>
34
- prev?: Partial<NoteModel>
35
- }
36
-
37
- export interface NoteWrappedWithLikedPayload {
38
- data: ModelWithLiked<NoteModel>
39
- next?: Partial<NoteModel>
40
- prev?: Partial<NoteModel>
41
- }
package/models/page.ts DELETED
@@ -1,20 +0,0 @@
1
- import type { TextBaseModel } from './base'
2
-
3
- export enum EnumPageType {
4
- 'md' = 'md',
5
- 'html' = 'html',
6
- 'frame' = 'frame',
7
- }
8
- export interface PageModel extends TextBaseModel {
9
- created: string
10
-
11
- slug: string
12
-
13
- subtitle?: string
14
-
15
- order?: number
16
-
17
- type?: EnumPageType
18
-
19
- options?: object
20
- }
package/models/post.ts DELETED
@@ -1,28 +0,0 @@
1
- import type { Count, Image, TextBaseModel } from './base'
2
- import type { CategoryModel } from './category'
3
-
4
- export interface PostModel extends TextBaseModel {
5
- summary?: string | null
6
- copyright: boolean
7
- tags: string[]
8
- count: Count
9
- text: string
10
- title: string
11
- slug: string
12
- categoryId: string
13
- images: Image[]
14
- category: CategoryModel
15
- pin?: string | null
16
- pinOrder?: number
17
- related?: Pick<
18
- PostModel,
19
- | 'id'
20
- | 'category'
21
- | 'categoryId'
22
- | 'created'
23
- | 'modified'
24
- | 'title'
25
- | 'slug'
26
- | 'summary'
27
- >[]
28
- }
package/models/project.ts DELETED
@@ -1,12 +0,0 @@
1
- import type { BaseModel } from './base'
2
-
3
- export interface ProjectModel extends BaseModel {
4
- name: string
5
- previewUrl?: string
6
- docUrl?: string
7
- projectUrl?: string
8
- images?: string[]
9
- description: string
10
- avatar?: string
11
- text: string
12
- }
package/models/reader.ts DELETED
@@ -1,9 +0,0 @@
1
- export interface ReaderModel {
2
- email: string
3
- name: string
4
- handle: string
5
-
6
- image: string
7
-
8
- isOwner: boolean
9
- }
@@ -1,24 +0,0 @@
1
- import type { BaseCommentIndexModel } from './base'
2
-
3
- export enum RecentlyRefTypes {
4
- Post = 'Post',
5
- Note = 'Note',
6
- Page = 'Page',
7
- }
8
-
9
- export type RecentlyRefType = {
10
- title: string
11
- url: string
12
- }
13
- export interface RecentlyModel extends BaseCommentIndexModel {
14
- content: string
15
-
16
- ref?: RecentlyRefType & { [key: string]: any }
17
- refId?: string
18
- refType?: RecentlyRefTypes
19
-
20
- up: number
21
- down: number
22
-
23
- modified?: string
24
- }
package/models/say.ts DELETED
@@ -1,7 +0,0 @@
1
- import type { BaseModel } from './base'
2
-
3
- export interface SayModel extends BaseModel {
4
- text: string
5
- source?: string
6
- author?: string
7
- }
package/models/setting.ts DELETED
@@ -1,73 +0,0 @@
1
- export declare class SeoOptionModel {
2
- title: string
3
- description: string
4
- icon?: string
5
- keywords?: string[]
6
- }
7
- export declare class UrlOptionModel {
8
- webUrl: string
9
- adminUrl: string
10
- serverUrl: string
11
- wsUrl: string
12
- }
13
- declare class MailOptionModel {
14
- port: number
15
- host: string
16
- }
17
- export declare class MailOptionsModel {
18
- enable: boolean
19
- user: string
20
- pass: string
21
- options?: MailOptionModel
22
- }
23
- export declare class CommentOptionsModel {
24
- antiSpam: boolean
25
- spamKeywords?: string[]
26
- blockIps?: string[]
27
- disableNoChinese?: boolean
28
- }
29
- export declare class BackupOptionsModel {
30
- enable: boolean
31
- secretId?: string
32
- secretKey?: string
33
- bucket?: string
34
- region: string
35
- }
36
- export declare class BaiduSearchOptionsModel {
37
- enable: boolean
38
- token?: string
39
- }
40
- export declare class BingSearchOptionsModel {
41
- enable: boolean
42
- token?: string
43
- }
44
-
45
- export declare class AlgoliaSearchOptionsModel {
46
- enable: boolean
47
- apiKey?: string
48
- appId?: string
49
- indexName?: string
50
- }
51
-
52
- export declare class AdminExtraModel {
53
- background?: string
54
-
55
- gaodemapKey?: string
56
- title?: string
57
- /**
58
- * 是否开启后台反代访问
59
- */
60
- enableAdminProxy?: boolean
61
- }
62
-
63
- export interface IConfig {
64
- seo: SeoOptionModel
65
- url: UrlOptionModel
66
- mailOptions: MailOptionsModel
67
- commentOptions: CommentOptionsModel
68
- backupOptions: BackupOptionsModel
69
- baiduSearchOptions: BaiduSearchOptionsModel
70
- algoliaSearchOptions: AlgoliaSearchOptionsModel
71
- adminExtra: AdminExtraModel
72
- }
73
- export declare type IConfigKeys = keyof IConfig
package/models/snippet.ts DELETED
@@ -1,19 +0,0 @@
1
- import type { BaseModel } from './base'
2
-
3
- export enum SnippetType {
4
- JSON = 'json',
5
- Function = 'function',
6
- Text = 'text',
7
- YAML = 'yaml',
8
- }
9
- export interface SnippetModel<T = unknown> extends BaseModel {
10
- type: SnippetType
11
- private: boolean
12
- raw: string
13
- name: string
14
- reference: string
15
- comment?: string
16
- metatype?: string
17
- schema?: string
18
- data: T
19
- }
@@ -1,5 +0,0 @@
1
- import type { SubscribeTypeToBitMap } from '@core/modules/subscribe/subscribe.constant'
2
-
3
- export * from '@core/modules/subscribe/subscribe.constant'
4
-
5
- export type SubscribeType = keyof typeof SubscribeTypeToBitMap
package/models/topic.ts DELETED
@@ -1,9 +0,0 @@
1
- import type { BaseModel } from './base'
2
-
3
- export interface TopicModel extends BaseModel {
4
- description?: string
5
- introduce: string
6
- name: string
7
- slug: string
8
- icon?: string
9
- }
package/models/user.ts DELETED
@@ -1,27 +0,0 @@
1
- import type { BaseModel } from './base'
2
-
3
- export interface UserModel extends BaseModel {
4
- introduce: string
5
- mail: string
6
- url: string
7
- name: string
8
- socialIds: Record<string, string>
9
- username: string
10
- modified: string
11
- v: number
12
- lastLoginTime: string
13
- lastLoginIp?: string
14
- avatar: string
15
- postID: string
16
- }
17
-
18
- export type TLogin = {
19
- token: string
20
- expiresIn: number
21
- // 登陆足迹
22
- lastLoginTime: null | string
23
- lastLoginIp?: null | string
24
- } & Pick<
25
- UserModel,
26
- 'name' | 'username' | 'created' | 'url' | 'mail' | 'avatar' | 'id'
27
- >
package/test.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import 'vitest/globals'
2
-
3
- export {}
package/tsconfig.json DELETED
@@ -1,37 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2020",
4
- "jsx": "react",
5
- "lib": [
6
- "ESNext",
7
- "DOM",
8
- "DOM.Iterable"
9
- ],
10
- "baseUrl": ".",
11
- "module": "ESNext",
12
- "moduleResolution": "node",
13
- "paths": {
14
- "~/*": [
15
- "*"
16
- ],
17
- "@core/*": [
18
- "../../apps/core/src/*"
19
- ],
20
- },
21
- "resolveJsonModule": true,
22
- "strict": true,
23
- "declaration": true,
24
- "outDir": "./esm",
25
- "sourceMap": true,
26
- "esModuleInterop": true,
27
- "forceConsistentCasingInFileNames": true,
28
- "skipLibCheck": true
29
- },
30
- "exclude": [
31
- "esm/*",
32
- "build/*",
33
- "node_modules/*",
34
- "lib/*",
35
- "dist/**"
36
- ]
37
- }
package/tsdown.config.ts DELETED
@@ -1,18 +0,0 @@
1
- import { readdirSync } from 'node:fs'
2
- import path from 'node:path'
3
- import { defineConfig } from 'tsdown'
4
-
5
- const __dirname = new URL(import.meta.url).pathname.replace(/\/[^/]*$/, '')
6
-
7
- const adaptorNames = readdirSync(path.resolve(__dirname, './adaptors')).map(
8
- (i) => path.parse(i).name,
9
- )
10
-
11
- export default defineConfig({
12
- clean: true,
13
- target: 'es2020',
14
- entry: ['index.ts', ...adaptorNames.map((name) => `adaptors/${name}.ts`)],
15
- external: adaptorNames,
16
- dts: true,
17
- format: ['cjs', 'esm'],
18
- })
package/vitest.config.ts DELETED
@@ -1,16 +0,0 @@
1
- import tsPath from 'vite-tsconfig-paths'
2
- import { defineConfig } from 'vitest/config'
3
-
4
- export default defineConfig({
5
- test: {
6
- globals: true,
7
-
8
- include: ['__tests__/**/*.(spec|test).ts'],
9
- },
10
-
11
- // @ts-ignore
12
- plugins: [tsPath()],
13
- optimizeDeps: {
14
- needsInterop: ['lodash'],
15
- },
16
- })