@mx-space/api-client 1.17.0 → 1.18.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/controllers/ack.ts +1 -2
- package/controllers/activity.ts +1 -2
- package/controllers/aggregate.ts +1 -2
- package/controllers/ai.ts +1 -2
- package/controllers/base.ts +1 -2
- package/controllers/category.ts +4 -6
- package/controllers/comment.ts +1 -2
- package/controllers/link.ts +1 -3
- package/controllers/note.ts +5 -3
- package/controllers/page.ts +1 -2
- package/controllers/post.ts +1 -2
- package/controllers/project.ts +1 -3
- package/controllers/recently.ts +1 -2
- package/controllers/say.ts +1 -3
- package/controllers/search.ts +2 -3
- package/controllers/severless.ts +1 -2
- package/controllers/snippet.ts +1 -2
- package/controllers/subscribe.ts +1 -2
- package/controllers/topic.ts +1 -3
- package/controllers/user.ts +1 -2
- package/dist/adapter-B1dtiutp.d.cts +25 -0
- package/dist/adapter-CRsPadpS.d.mts +25 -0
- package/dist/adaptors/axios.cjs +53 -57
- package/dist/adaptors/axios.d.cts +5 -4
- package/dist/adaptors/axios.d.mts +7 -0
- package/dist/adaptors/axios.mjs +33 -0
- package/dist/adaptors/fetch.cjs +72 -108
- package/dist/adaptors/fetch.d.cts +4 -3
- package/dist/adaptors/fetch.d.mts +6 -0
- package/dist/adaptors/fetch.mjs +75 -0
- package/dist/adaptors/umi-request.cjs +32 -54
- package/dist/adaptors/umi-request.d.cts +5 -4
- package/dist/adaptors/umi-request.d.mts +7 -0
- package/dist/adaptors/umi-request.mjs +33 -0
- package/dist/index.cjs +1043 -1207
- package/dist/index.d.cts +1754 -1690
- package/dist/index.d.mts +2016 -0
- package/dist/index.mjs +1101 -0
- package/interfaces/request.ts +3 -1
- package/mod-dts.mjs +13 -10
- package/models/comment.ts +1 -2
- package/models/note.ts +1 -1
- package/models/recently.ts +2 -0
- package/package.json +16 -16
- package/{tsup.config.ts → tsdown.config.ts} +2 -2
- package/.eslintcache +0 -1
- package/coverage/clover.xml +0 -591
- package/coverage/coverage-final.json +0 -5944
- package/coverage/lcov-report/adaptors/axios.ts.html +0 -201
- package/coverage/lcov-report/adaptors/index.html +0 -196
- package/coverage/lcov-report/adaptors/umi-request.ts.html +0 -186
- package/coverage/lcov-report/auto-bind.ts.html +0 -228
- package/coverage/lcov-report/base.css +0 -354
- package/coverage/lcov-report/block-navigation.js +0 -85
- package/coverage/lcov-report/controllers/aggregate.ts.html +0 -294
- package/coverage/lcov-report/controllers/base.ts.html +0 -183
- package/coverage/lcov-report/controllers/category.ts.html +0 -441
- package/coverage/lcov-report/controllers/comment.ts.html +0 -291
- package/coverage/lcov-report/controllers/index.html +0 -476
- package/coverage/lcov-report/controllers/index.ts.html +0 -297
- package/coverage/lcov-report/controllers/link.ts.html +0 -216
- package/coverage/lcov-report/controllers/note.ts.html +0 -375
- package/coverage/lcov-report/controllers/page.ts.html +0 -279
- package/coverage/lcov-report/controllers/post.ts.html +0 -369
- package/coverage/lcov-report/controllers/project.ts.html +0 -168
- package/coverage/lcov-report/controllers/recently.ts.html +0 -246
- package/coverage/lcov-report/controllers/say.ts.html +0 -207
- package/coverage/lcov-report/controllers/search.ts.html +0 -411
- package/coverage/lcov-report/controllers/severless.ts.html +0 -180
- package/coverage/lcov-report/controllers/snippet.ts.html +0 -195
- package/coverage/lcov-report/controllers/user.ts.html +0 -240
- package/coverage/lcov-report/core/attach-request.ts.html +0 -216
- package/coverage/lcov-report/core/client.ts.html +0 -786
- package/coverage/lcov-report/core/error.ts.html +0 -117
- package/coverage/lcov-report/core/index.html +0 -236
- package/coverage/lcov-report/core/index.ts.html +0 -93
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -276
- package/coverage/lcov-report/index.ts.html +0 -243
- package/coverage/lcov-report/models/aggregate.ts.html +0 -300
- package/coverage/lcov-report/models/category.ts.html +0 -162
- package/coverage/lcov-report/models/index.html +0 -196
- package/coverage/lcov-report/prettify.css +0 -101
- package/coverage/lcov-report/prettify.js +0 -1004
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -191
- package/coverage/lcov-report/utils/auto-bind.ts.html +0 -231
- package/coverage/lcov-report/utils/index.html +0 -216
- package/coverage/lcov-report/utils/index.ts.html +0 -246
- package/coverage/lcov-report/utils/path.ts.html +0 -105
- package/coverage/lcov.info +0 -1209
- package/dist/adapter-B8tKfr1O.d.cts +0 -23
- package/dist/adapter-B8tKfr1O.d.ts +0 -23
- package/dist/adaptors/axios.d.ts +0 -6
- package/dist/adaptors/axios.global.js +0 -15030
- package/dist/adaptors/axios.js +0 -33
- package/dist/adaptors/fetch.d.ts +0 -5
- package/dist/adaptors/fetch.global.js +0 -87
- package/dist/adaptors/fetch.js +0 -87
- package/dist/adaptors/umi-request.d.ts +0 -6
- package/dist/adaptors/umi-request.global.js +0 -7625
- package/dist/adaptors/umi-request.js +0 -33
- package/dist/index.d.ts +0 -1952
- package/dist/index.global.js +0 -1200
- package/dist/index.js +0 -1241
- package/esm/apps/core/src/modules/subscribe/subscribe.constant.d.ts +0 -12
- package/esm/apps/core/src/modules/subscribe/subscribe.constant.js +0 -16
- package/esm/apps/core/src/modules/subscribe/subscribe.constant.js.map +0 -1
- package/esm/packages/api-client/adaptors/axios.d.ts +0 -4
- package/esm/packages/api-client/adaptors/axios.js +0 -37
- package/esm/packages/api-client/adaptors/axios.js.map +0 -1
- package/esm/packages/api-client/adaptors/fetch.d.ts +0 -2
- package/esm/packages/api-client/adaptors/fetch.js +0 -95
- package/esm/packages/api-client/adaptors/fetch.js.map +0 -1
- package/esm/packages/api-client/adaptors/ky.d.ts +0 -23
- package/esm/packages/api-client/adaptors/ky.js +0 -62
- package/esm/packages/api-client/adaptors/ky.js.map +0 -1
- package/esm/packages/api-client/adaptors/umi-request.d.ts +0 -4
- package/esm/packages/api-client/adaptors/umi-request.js +0 -31
- package/esm/packages/api-client/adaptors/umi-request.js.map +0 -1
- package/esm/packages/api-client/controllers/aggregate.d.ts +0 -64
- package/esm/packages/api-client/controllers/aggregate.js +0 -46
- package/esm/packages/api-client/controllers/aggregate.js.map +0 -1
- package/esm/packages/api-client/controllers/base.d.ts +0 -43
- package/esm/packages/api-client/controllers/base.js +0 -27
- package/esm/packages/api-client/controllers/base.js.map +0 -1
- package/esm/packages/api-client/controllers/category.d.ts +0 -120
- package/esm/packages/api-client/controllers/category.js +0 -68
- package/esm/packages/api-client/controllers/category.js.map +0 -1
- package/esm/packages/api-client/controllers/comment.d.ts +0 -81
- package/esm/packages/api-client/controllers/comment.js +0 -47
- package/esm/packages/api-client/controllers/comment.js.map +0 -1
- package/esm/packages/api-client/controllers/index.d.ts +0 -19
- package/esm/packages/api-client/controllers/index.js +0 -60
- package/esm/packages/api-client/controllers/index.js.map +0 -1
- package/esm/packages/api-client/controllers/link.d.ts +0 -20
- package/esm/packages/api-client/controllers/link.js +0 -21
- package/esm/packages/api-client/controllers/link.js.map +0 -1
- package/esm/packages/api-client/controllers/note.d.ts +0 -103
- package/esm/packages/api-client/controllers/note.js +0 -68
- package/esm/packages/api-client/controllers/note.js.map +0 -1
- package/esm/packages/api-client/controllers/page.d.ts +0 -59
- package/esm/packages/api-client/controllers/page.js +0 -42
- package/esm/packages/api-client/controllers/page.js.map +0 -1
- package/esm/packages/api-client/controllers/post.d.ts +0 -72
- package/esm/packages/api-client/controllers/post.js +0 -52
- package/esm/packages/api-client/controllers/post.js.map +0 -1
- package/esm/packages/api-client/controllers/project.d.ts +0 -15
- package/esm/packages/api-client/controllers/project.js +0 -12
- package/esm/packages/api-client/controllers/project.js.map +0 -1
- package/esm/packages/api-client/controllers/recently.d.ts +0 -110
- package/esm/packages/api-client/controllers/recently.js +0 -49
- package/esm/packages/api-client/controllers/recently.js.map +0 -1
- package/esm/packages/api-client/controllers/say.d.ts +0 -37
- package/esm/packages/api-client/controllers/say.js +0 -21
- package/esm/packages/api-client/controllers/say.js.map +0 -1
- package/esm/packages/api-client/controllers/search.d.ts +0 -87
- package/esm/packages/api-client/controllers/search.js +0 -28
- package/esm/packages/api-client/controllers/search.js.map +0 -1
- package/esm/packages/api-client/controllers/severless.d.ts +0 -24
- package/esm/packages/api-client/controllers/severless.js +0 -16
- package/esm/packages/api-client/controllers/severless.js.map +0 -1
- package/esm/packages/api-client/controllers/snippet.d.ts +0 -24
- package/esm/packages/api-client/controllers/snippet.js +0 -19
- package/esm/packages/api-client/controllers/snippet.js.map +0 -1
- package/esm/packages/api-client/controllers/subscribe.d.ts +0 -64
- package/esm/packages/api-client/controllers/subscribe.js +0 -35
- package/esm/packages/api-client/controllers/subscribe.js.map +0 -1
- package/esm/packages/api-client/controllers/topic.d.ts +0 -26
- package/esm/packages/api-client/controllers/topic.js +0 -18
- package/esm/packages/api-client/controllers/topic.js.map +0 -1
- package/esm/packages/api-client/controllers/user.d.ts +0 -70
- package/esm/packages/api-client/controllers/user.js +0 -40
- package/esm/packages/api-client/controllers/user.js.map +0 -1
- package/esm/packages/api-client/core/attach-request.d.ts +0 -2
- package/esm/packages/api-client/core/attach-request.js +0 -36
- package/esm/packages/api-client/core/attach-request.js.map +0 -1
- package/esm/packages/api-client/core/client.d.ts +0 -29
- package/esm/packages/api-client/core/client.js +0 -193
- package/esm/packages/api-client/core/client.js.map +0 -1
- package/esm/packages/api-client/core/error.d.ts +0 -6
- package/esm/packages/api-client/core/error.js +0 -9
- package/esm/packages/api-client/core/error.js.map +0 -1
- package/esm/packages/api-client/core/index.d.ts +0 -2
- package/esm/packages/api-client/core/index.js +0 -3
- package/esm/packages/api-client/core/index.js.map +0 -1
- package/esm/packages/api-client/dtos/comment.d.ts +0 -8
- package/esm/packages/api-client/dtos/comment.js +0 -2
- package/esm/packages/api-client/dtos/comment.js.map +0 -1
- package/esm/packages/api-client/dtos/index.d.ts +0 -1
- package/esm/packages/api-client/dtos/index.js +0 -2
- package/esm/packages/api-client/dtos/index.js.map +0 -1
- package/esm/packages/api-client/index.d.ts +0 -8
- package/esm/packages/api-client/index.js +0 -9
- package/esm/packages/api-client/index.js.map +0 -1
- package/esm/packages/api-client/interfaces/adapter.d.ts +0 -14
- package/esm/packages/api-client/interfaces/adapter.js +0 -2
- package/esm/packages/api-client/interfaces/adapter.js.map +0 -1
- package/esm/packages/api-client/interfaces/client.d.ts +0 -13
- package/esm/packages/api-client/interfaces/client.js +0 -2
- package/esm/packages/api-client/interfaces/client.js.map +0 -1
- package/esm/packages/api-client/interfaces/controller.d.ts +0 -4
- package/esm/packages/api-client/interfaces/controller.js +0 -2
- package/esm/packages/api-client/interfaces/controller.js.map +0 -1
- package/esm/packages/api-client/interfaces/instance.d.ts +0 -7
- package/esm/packages/api-client/interfaces/instance.js +0 -2
- package/esm/packages/api-client/interfaces/instance.js.map +0 -1
- package/esm/packages/api-client/interfaces/options.d.ts +0 -1
- package/esm/packages/api-client/interfaces/options.js +0 -2
- package/esm/packages/api-client/interfaces/options.js.map +0 -1
- package/esm/packages/api-client/interfaces/params.d.ts +0 -4
- package/esm/packages/api-client/interfaces/params.js +0 -2
- package/esm/packages/api-client/interfaces/params.js.map +0 -1
- package/esm/packages/api-client/interfaces/request.d.ts +0 -44
- package/esm/packages/api-client/interfaces/request.js +0 -2
- package/esm/packages/api-client/interfaces/request.js.map +0 -1
- package/esm/packages/api-client/interfaces/types.d.ts +0 -2
- package/esm/packages/api-client/interfaces/types.js +0 -2
- package/esm/packages/api-client/interfaces/types.js.map +0 -1
- package/esm/packages/api-client/models/aggregate.d.ts +0 -67
- package/esm/packages/api-client/models/aggregate.js +0 -6
- package/esm/packages/api-client/models/aggregate.js.map +0 -1
- package/esm/packages/api-client/models/base.d.ts +0 -40
- package/esm/packages/api-client/models/base.js +0 -2
- package/esm/packages/api-client/models/base.js.map +0 -1
- package/esm/packages/api-client/models/category.d.ts +0 -22
- package/esm/packages/api-client/models/category.js +0 -6
- package/esm/packages/api-client/models/category.js.map +0 -1
- package/esm/packages/api-client/models/comment.d.ts +0 -39
- package/esm/packages/api-client/models/comment.js +0 -13
- package/esm/packages/api-client/models/comment.js.map +0 -1
- package/esm/packages/api-client/models/index.d.ts +0 -16
- package/esm/packages/api-client/models/index.js +0 -17
- package/esm/packages/api-client/models/index.js.map +0 -1
- package/esm/packages/api-client/models/link.d.ts +0 -22
- package/esm/packages/api-client/models/link.js +0 -14
- package/esm/packages/api-client/models/link.js.map +0 -1
- package/esm/packages/api-client/models/note.d.ts +0 -38
- package/esm/packages/api-client/models/note.js +0 -2
- package/esm/packages/api-client/models/note.js.map +0 -1
- package/esm/packages/api-client/models/page.d.ts +0 -14
- package/esm/packages/api-client/models/page.js +0 -7
- package/esm/packages/api-client/models/page.js.map +0 -1
- package/esm/packages/api-client/models/post.d.ts +0 -17
- package/esm/packages/api-client/models/post.js +0 -2
- package/esm/packages/api-client/models/post.js.map +0 -1
- package/esm/packages/api-client/models/project.d.ts +0 -11
- package/esm/packages/api-client/models/project.js +0 -2
- package/esm/packages/api-client/models/project.js.map +0 -1
- package/esm/packages/api-client/models/recently.d.ts +0 -20
- package/esm/packages/api-client/models/recently.js +0 -7
- package/esm/packages/api-client/models/recently.js.map +0 -1
- package/esm/packages/api-client/models/say.d.ts +0 -6
- package/esm/packages/api-client/models/say.js +0 -2
- package/esm/packages/api-client/models/say.js.map +0 -1
- package/esm/packages/api-client/models/setting.d.ts +0 -66
- package/esm/packages/api-client/models/setting.js +0 -2
- package/esm/packages/api-client/models/setting.js.map +0 -1
- package/esm/packages/api-client/models/snippet.d.ts +0 -18
- package/esm/packages/api-client/models/snippet.js +0 -8
- package/esm/packages/api-client/models/snippet.js.map +0 -1
- package/esm/packages/api-client/models/subscribe.d.ts +0 -3
- package/esm/packages/api-client/models/subscribe.js +0 -2
- package/esm/packages/api-client/models/subscribe.js.map +0 -1
- package/esm/packages/api-client/models/topic.d.ts +0 -8
- package/esm/packages/api-client/models/topic.js +0 -2
- package/esm/packages/api-client/models/topic.js.map +0 -1
- package/esm/packages/api-client/models/user.d.ts +0 -21
- package/esm/packages/api-client/models/user.js +0 -2
- package/esm/packages/api-client/models/user.js.map +0 -1
- package/esm/packages/api-client/tsup.config.d.ts +0 -2
- package/esm/packages/api-client/tsup.config.js +0 -14
- package/esm/packages/api-client/tsup.config.js.map +0 -1
- package/esm/packages/api-client/utils/auto-bind.d.ts +0 -4
- package/esm/packages/api-client/utils/auto-bind.js +0 -36
- package/esm/packages/api-client/utils/auto-bind.js.map +0 -1
- package/esm/packages/api-client/utils/camelcase-keys.d.ts +0 -6
- package/esm/packages/api-client/utils/camelcase-keys.js +0 -23
- package/esm/packages/api-client/utils/camelcase-keys.js.map +0 -1
- package/esm/packages/api-client/utils/index.d.ts +0 -5
- package/esm/packages/api-client/utils/index.js +0 -43
- package/esm/packages/api-client/utils/index.js.map +0 -1
- package/esm/packages/api-client/utils/path.d.ts +0 -1
- package/esm/packages/api-client/utils/path.js +0 -7
- package/esm/packages/api-client/utils/path.js.map +0 -1
- package/esm/packages/api-client/vitest.config.d.ts +0 -2
- package/esm/packages/api-client/vitest.config.js +0 -15
- package/esm/packages/api-client/vitest.config.js.map +0 -1
package/controllers/ack.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { IRequestAdapter } from '~/interfaces/adapter'
|
|
2
2
|
import type { IController } from '~/interfaces/controller'
|
|
3
3
|
import type { IRequestHandler } from '~/interfaces/request'
|
|
4
|
-
import type { HTTPClient } from '../core'
|
|
5
|
-
|
|
6
4
|
import { autoBind } from '~/utils/auto-bind'
|
|
5
|
+
import type { HTTPClient } from '../core'
|
|
7
6
|
|
|
8
7
|
declare module '../core/client' {
|
|
9
8
|
interface HTTPClient<
|
package/controllers/activity.ts
CHANGED
|
@@ -8,9 +8,8 @@ import type {
|
|
|
8
8
|
RecentActivities,
|
|
9
9
|
RoomsData,
|
|
10
10
|
} from '~/models/activity'
|
|
11
|
-
import type { HTTPClient } from '../core'
|
|
12
|
-
|
|
13
11
|
import { autoBind } from '~/utils/auto-bind'
|
|
12
|
+
import type { HTTPClient } from '../core'
|
|
14
13
|
|
|
15
14
|
declare module '../core/client' {
|
|
16
15
|
interface HTTPClient<
|
package/controllers/aggregate.ts
CHANGED
|
@@ -9,10 +9,9 @@ import type {
|
|
|
9
9
|
TimelineData,
|
|
10
10
|
TimelineType,
|
|
11
11
|
} from '~/models/aggregate'
|
|
12
|
-
import type { HTTPClient } from '../core'
|
|
13
|
-
|
|
14
12
|
import { sortOrderToNumber } from '~/utils'
|
|
15
13
|
import { autoBind } from '~/utils/auto-bind'
|
|
14
|
+
import type { HTTPClient } from '../core'
|
|
16
15
|
|
|
17
16
|
declare module '../core/client' {
|
|
18
17
|
interface HTTPClient<
|
package/controllers/ai.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { IRequestAdapter } from '~/interfaces/adapter'
|
|
2
2
|
import type { IController } from '~/interfaces/controller'
|
|
3
3
|
import type { IRequestHandler } from '~/interfaces/request'
|
|
4
|
+
import { autoBind } from '~/utils/auto-bind'
|
|
4
5
|
import type { HTTPClient } from '../core'
|
|
5
6
|
import type { AIDeepReadingModel, AISummaryModel } from '../models/ai'
|
|
6
7
|
|
|
7
|
-
import { autoBind } from '~/utils/auto-bind'
|
|
8
|
-
|
|
9
8
|
declare module '../core/client' {
|
|
10
9
|
interface HTTPClient<
|
|
11
10
|
T extends IRequestAdapter = IRequestAdapter,
|
package/controllers/base.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { IRequestHandler, RequestProxyResult } from '~/interfaces/request'
|
|
2
2
|
import type { PaginateResult } from '~/models/base'
|
|
3
|
-
import type { HTTPClient } from '../core'
|
|
4
|
-
|
|
5
3
|
import { autoBind } from '~/utils/auto-bind'
|
|
4
|
+
import type { HTTPClient } from '../core'
|
|
6
5
|
|
|
7
6
|
export type SortOptions = {
|
|
8
7
|
sortBy?: string
|
package/controllers/category.ts
CHANGED
|
@@ -5,20 +5,18 @@ import type {
|
|
|
5
5
|
RequestProxyResult,
|
|
6
6
|
ResponseProxyExtraRaw,
|
|
7
7
|
} from '~/interfaces/request'
|
|
8
|
+
import { attachRawFromOneToAnthor, destructureData } from '~/utils'
|
|
9
|
+
import { autoBind } from '~/utils/auto-bind'
|
|
8
10
|
import type { HTTPClient } from '../core/client'
|
|
11
|
+
import { RequestError } from '../core/error'
|
|
9
12
|
import type {
|
|
10
13
|
CategoryEntries,
|
|
11
14
|
CategoryModel,
|
|
12
15
|
CategoryWithChildrenModel,
|
|
13
16
|
TagModel,
|
|
14
17
|
} from '../models/category'
|
|
15
|
-
import type { PostModel } from '../models/post'
|
|
16
|
-
|
|
17
|
-
import { attachRawFromOneToAnthor, destructureData } from '~/utils'
|
|
18
|
-
import { autoBind } from '~/utils/auto-bind'
|
|
19
|
-
|
|
20
|
-
import { RequestError } from '../core/error'
|
|
21
18
|
import { CategoryType } from '../models/category'
|
|
19
|
+
import type { PostModel } from '../models/post'
|
|
22
20
|
|
|
23
21
|
declare module '../core/client' {
|
|
24
22
|
interface HTTPClient<
|
package/controllers/comment.ts
CHANGED
|
@@ -5,11 +5,10 @@ import type { IRequestHandler } from '~/interfaces/request'
|
|
|
5
5
|
import type { ReaderModel } from '~/models'
|
|
6
6
|
import type { PaginateResult } from '~/models/base'
|
|
7
7
|
import type { CommentModel } from '~/models/comment'
|
|
8
|
+
import { autoBind } from '~/utils/auto-bind'
|
|
8
9
|
import type { HTTPClient } from '../core'
|
|
9
10
|
import type { CommentDto } from '../dtos/comment'
|
|
10
11
|
|
|
11
|
-
import { autoBind } from '~/utils/auto-bind'
|
|
12
|
-
|
|
13
12
|
declare module '../core/client' {
|
|
14
13
|
interface HTTPClient<
|
|
15
14
|
T extends IRequestAdapter = IRequestAdapter,
|
package/controllers/link.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { IRequestAdapter } from '~/interfaces/adapter'
|
|
2
2
|
import type { LinkModel } from '~/models/link'
|
|
3
|
-
import type { HTTPClient } from '../core'
|
|
4
|
-
|
|
5
3
|
import { autoBind } from '~/utils/auto-bind'
|
|
6
|
-
|
|
4
|
+
import type { HTTPClient } from '../core'
|
|
7
5
|
import { BaseCrudController } from './base'
|
|
8
6
|
|
|
9
7
|
declare module '../core/client' {
|
package/controllers/note.ts
CHANGED
|
@@ -8,11 +8,10 @@ import type {
|
|
|
8
8
|
NoteWrappedPayload,
|
|
9
9
|
NoteWrappedWithLikedPayload,
|
|
10
10
|
} from '~/models/note'
|
|
11
|
+
import { autoBind } from '~/utils/auto-bind'
|
|
11
12
|
import type { HTTPClient } from '../core/client'
|
|
12
13
|
import type { SortOptions } from './base'
|
|
13
14
|
|
|
14
|
-
import { autoBind } from '~/utils/auto-bind'
|
|
15
|
-
|
|
16
15
|
declare module '../core/client' {
|
|
17
16
|
interface HTTPClient<
|
|
18
17
|
T extends IRequestAdapter = IRequestAdapter,
|
|
@@ -103,7 +102,10 @@ export class NoteController<ResponseWrapper> implements IController {
|
|
|
103
102
|
*/
|
|
104
103
|
getMiddleList(id: string, size = 5) {
|
|
105
104
|
return this.proxy.list(id).get<{
|
|
106
|
-
data: Pick<
|
|
105
|
+
data: Pick<
|
|
106
|
+
NoteModel,
|
|
107
|
+
'id' | 'title' | 'nid' | 'created' | 'isPublished'
|
|
108
|
+
>[]
|
|
107
109
|
size: number
|
|
108
110
|
}>({
|
|
109
111
|
params: { size },
|
package/controllers/page.ts
CHANGED
|
@@ -4,9 +4,8 @@ import type { IRequestHandler } from '~/interfaces/request'
|
|
|
4
4
|
import type { SelectFields } from '~/interfaces/types'
|
|
5
5
|
import type { PaginateResult } from '~/models/base'
|
|
6
6
|
import type { PageModel } from '~/models/page'
|
|
7
|
-
import type { HTTPClient } from '../core'
|
|
8
|
-
|
|
9
7
|
import { autoBind } from '~/utils/auto-bind'
|
|
8
|
+
import type { HTTPClient } from '../core'
|
|
10
9
|
|
|
11
10
|
declare module '../core/client' {
|
|
12
11
|
interface HTTPClient<
|
package/controllers/post.ts
CHANGED
|
@@ -4,9 +4,8 @@ import type { IRequestHandler, RequestProxyResult } from '~/interfaces/request'
|
|
|
4
4
|
import type { SelectFields } from '~/interfaces/types'
|
|
5
5
|
import type { ModelWithLiked, PaginateResult } from '~/models/base'
|
|
6
6
|
import type { PostModel } from '~/models/post'
|
|
7
|
-
import type { HTTPClient } from '../core/client'
|
|
8
|
-
|
|
9
7
|
import { autoBind } from '~/utils/auto-bind'
|
|
8
|
+
import type { HTTPClient } from '../core/client'
|
|
10
9
|
|
|
11
10
|
declare module '../core/client' {
|
|
12
11
|
interface HTTPClient<
|
package/controllers/project.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { IRequestAdapter } from '~/interfaces/adapter'
|
|
2
2
|
import type { ProjectModel } from '~/models/project'
|
|
3
|
-
import type { HTTPClient } from '../core'
|
|
4
|
-
|
|
5
3
|
import { autoBind } from '~/utils/auto-bind'
|
|
6
|
-
|
|
4
|
+
import type { HTTPClient } from '../core'
|
|
7
5
|
import { BaseCrudController } from './base'
|
|
8
6
|
|
|
9
7
|
declare module '../core/client' {
|
package/controllers/recently.ts
CHANGED
|
@@ -2,9 +2,8 @@ import type { IRequestAdapter } from '~/interfaces/adapter'
|
|
|
2
2
|
import type { IController } from '~/interfaces/controller'
|
|
3
3
|
import type { IRequestHandler } from '~/interfaces/request'
|
|
4
4
|
import type { RecentlyModel } from '~/models/recently'
|
|
5
|
-
import type { HTTPClient } from '../core'
|
|
6
|
-
|
|
7
5
|
import { autoBind } from '~/utils/auto-bind'
|
|
6
|
+
import type { HTTPClient } from '../core'
|
|
8
7
|
|
|
9
8
|
declare module '../core/client' {
|
|
10
9
|
interface HTTPClient<
|
package/controllers/say.ts
CHANGED
|
@@ -2,10 +2,8 @@ import type { IRequestAdapter } from '~/interfaces/adapter'
|
|
|
2
2
|
import type { IController } from '~/interfaces/controller'
|
|
3
3
|
import type { IRequestHandler } from '~/interfaces/request'
|
|
4
4
|
import type { SayModel } from '~/models/say'
|
|
5
|
-
import type { HTTPClient } from '../core'
|
|
6
|
-
|
|
7
5
|
import { autoBind } from '~/utils/auto-bind'
|
|
8
|
-
|
|
6
|
+
import type { HTTPClient } from '../core'
|
|
9
7
|
import { BaseCrudController } from './base'
|
|
10
8
|
|
|
11
9
|
declare module '../core/client' {
|
package/controllers/search.ts
CHANGED
|
@@ -3,11 +3,10 @@ import type { IController } from '~/interfaces/controller'
|
|
|
3
3
|
import type { IRequestHandler, RequestProxyResult } from '~/interfaces/request'
|
|
4
4
|
import type { PaginateResult } from '~/models/base'
|
|
5
5
|
import type { NoteModel } from '~/models/note'
|
|
6
|
+
import type { PageModel } from '~/models/page'
|
|
6
7
|
import type { PostModel } from '~/models/post'
|
|
7
|
-
import type { PageModel } from '..'
|
|
8
|
-
import type { HTTPClient } from '../core'
|
|
9
|
-
|
|
10
8
|
import { autoBind } from '~/utils/auto-bind'
|
|
9
|
+
import type { HTTPClient } from '../core'
|
|
11
10
|
|
|
12
11
|
declare module '../core/client' {
|
|
13
12
|
interface HTTPClient<
|
package/controllers/severless.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { IRequestAdapter } from '~/interfaces/adapter'
|
|
2
2
|
import type { IController } from '~/interfaces/controller'
|
|
3
3
|
import type { IRequestHandler } from '~/interfaces/request'
|
|
4
|
-
import type { HTTPClient } from '../core'
|
|
5
|
-
|
|
6
4
|
import { autoBind } from '~/utils/auto-bind'
|
|
5
|
+
import type { HTTPClient } from '../core'
|
|
7
6
|
|
|
8
7
|
declare module '../core/client' {
|
|
9
8
|
interface HTTPClient<
|
package/controllers/snippet.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { IRequestAdapter } from '~/interfaces/adapter'
|
|
2
2
|
import type { IController } from '~/interfaces/controller'
|
|
3
3
|
import type { IRequestHandler } from '~/interfaces/request'
|
|
4
|
-
import type { HTTPClient } from '../core'
|
|
5
|
-
|
|
6
4
|
import { autoBind } from '~/utils/auto-bind'
|
|
5
|
+
import type { HTTPClient } from '../core'
|
|
7
6
|
|
|
8
7
|
declare module '../core/client' {
|
|
9
8
|
interface HTTPClient<
|
package/controllers/subscribe.ts
CHANGED
|
@@ -2,9 +2,8 @@ import type { IRequestAdapter } from '~/interfaces/adapter'
|
|
|
2
2
|
import type { IController } from '~/interfaces/controller'
|
|
3
3
|
import type { IRequestHandler } from '~/interfaces/request'
|
|
4
4
|
import type { SubscribeType } from '~/models/subscribe'
|
|
5
|
-
import type { HTTPClient } from '../core'
|
|
6
|
-
|
|
7
5
|
import { autoBind } from '~/utils/auto-bind'
|
|
6
|
+
import type { HTTPClient } from '../core'
|
|
8
7
|
|
|
9
8
|
declare module '../core/client' {
|
|
10
9
|
interface HTTPClient<
|
package/controllers/topic.ts
CHANGED
|
@@ -2,10 +2,8 @@ import type { IRequestAdapter } from '~/interfaces/adapter'
|
|
|
2
2
|
import type { IController } from '~/interfaces/controller'
|
|
3
3
|
import type { IRequestHandler } from '~/interfaces/request'
|
|
4
4
|
import type { TopicModel } from '~/models/topic'
|
|
5
|
-
import type { HTTPClient } from '../core'
|
|
6
|
-
|
|
7
5
|
import { autoBind } from '~/utils/auto-bind'
|
|
8
|
-
|
|
6
|
+
import type { HTTPClient } from '../core'
|
|
9
7
|
import { BaseCrudController } from './base'
|
|
10
8
|
|
|
11
9
|
declare module '../core/client' {
|
package/controllers/user.ts
CHANGED
|
@@ -2,9 +2,8 @@ import type { IRequestAdapter } from '~/interfaces/adapter'
|
|
|
2
2
|
import type { IController } from '~/interfaces/controller'
|
|
3
3
|
import type { IRequestHandler } from '~/interfaces/request'
|
|
4
4
|
import type { TLogin, UserModel } from '~/models/user'
|
|
5
|
-
import type { HTTPClient } from '../core'
|
|
6
|
-
|
|
7
5
|
import { autoBind } from '~/utils/auto-bind'
|
|
6
|
+
import type { HTTPClient } from '../core'
|
|
8
7
|
|
|
9
8
|
declare module '../core/client' {
|
|
10
9
|
interface HTTPClient<
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region interfaces/instance.d.ts
|
|
2
|
+
interface RequestOptions {
|
|
3
|
+
method?: string;
|
|
4
|
+
data?: Record<string, any>;
|
|
5
|
+
params?: Record<string, any> | URLSearchParams;
|
|
6
|
+
headers?: Record<string, string>;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region interfaces/adapter.d.ts
|
|
11
|
+
type IAdaptorRequestResponseType<P> = Promise<Record<string, any> & {
|
|
12
|
+
data: P;
|
|
13
|
+
}>;
|
|
14
|
+
type IRequestAdapter<T = any, Response = undefined> = Readonly<(Response extends undefined ? {} : {
|
|
15
|
+
responseWrapper: Response;
|
|
16
|
+
}) & {
|
|
17
|
+
default: T;
|
|
18
|
+
get: <P = unknown>(url: string, options?: Omit<RequestOptions, 'data'>) => IAdaptorRequestResponseType<P>;
|
|
19
|
+
post: <P = unknown>(url: string, options: Partial<RequestOptions>) => IAdaptorRequestResponseType<P>;
|
|
20
|
+
patch: <P = unknown>(url: string, options: Partial<RequestOptions>) => IAdaptorRequestResponseType<P>;
|
|
21
|
+
delete: <P = unknown>(url: string, options?: Omit<RequestOptions, 'data'>) => IAdaptorRequestResponseType<P>;
|
|
22
|
+
put: <P = unknown>(url: string, options: Partial<RequestOptions>) => IAdaptorRequestResponseType<P>;
|
|
23
|
+
}>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { IRequestAdapter as n, RequestOptions as r, IAdaptorRequestResponseType as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region interfaces/instance.d.ts
|
|
2
|
+
interface RequestOptions {
|
|
3
|
+
method?: string;
|
|
4
|
+
data?: Record<string, any>;
|
|
5
|
+
params?: Record<string, any> | URLSearchParams;
|
|
6
|
+
headers?: Record<string, string>;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region interfaces/adapter.d.ts
|
|
11
|
+
type IAdaptorRequestResponseType<P> = Promise<Record<string, any> & {
|
|
12
|
+
data: P;
|
|
13
|
+
}>;
|
|
14
|
+
type IRequestAdapter<T = any, Response = undefined> = Readonly<(Response extends undefined ? {} : {
|
|
15
|
+
responseWrapper: Response;
|
|
16
|
+
}) & {
|
|
17
|
+
default: T;
|
|
18
|
+
get: <P = unknown>(url: string, options?: Omit<RequestOptions, 'data'>) => IAdaptorRequestResponseType<P>;
|
|
19
|
+
post: <P = unknown>(url: string, options: Partial<RequestOptions>) => IAdaptorRequestResponseType<P>;
|
|
20
|
+
patch: <P = unknown>(url: string, options: Partial<RequestOptions>) => IAdaptorRequestResponseType<P>;
|
|
21
|
+
delete: <P = unknown>(url: string, options?: Omit<RequestOptions, 'data'>) => IAdaptorRequestResponseType<P>;
|
|
22
|
+
put: <P = unknown>(url: string, options: Partial<RequestOptions>) => IAdaptorRequestResponseType<P>;
|
|
23
|
+
}>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { IRequestAdapter as n, RequestOptions as r, IAdaptorRequestResponseType as t };
|
package/dist/adaptors/axios.cjs
CHANGED
|
@@ -1,68 +1,64 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
//#region rolldown:runtime
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
9
|
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
+
__defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
19
22
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const { data, ...config } = options || {};
|
|
61
|
-
return $http.patch(url, data, config);
|
|
62
|
-
}
|
|
28
|
+
//#endregion
|
|
29
|
+
let axios = require("axios");
|
|
30
|
+
axios = __toESM(axios);
|
|
31
|
+
|
|
32
|
+
//#region adaptors/axios.ts
|
|
33
|
+
const $http = /* @__PURE__ */ axios.default.create({});
|
|
34
|
+
const axiosAdaptor = Object.preventExtensions({
|
|
35
|
+
get default() {
|
|
36
|
+
return $http;
|
|
37
|
+
},
|
|
38
|
+
responseWrapper: {},
|
|
39
|
+
get(url, options) {
|
|
40
|
+
return $http.get(url, options);
|
|
41
|
+
},
|
|
42
|
+
post(url, options) {
|
|
43
|
+
const { data, ...config } = options || {};
|
|
44
|
+
return $http.post(url, data, config);
|
|
45
|
+
},
|
|
46
|
+
put(url, options) {
|
|
47
|
+
const { data, ...config } = options || {};
|
|
48
|
+
return $http.put(url, data, config);
|
|
49
|
+
},
|
|
50
|
+
delete(url, options) {
|
|
51
|
+
const { ...config } = options || {};
|
|
52
|
+
return $http.delete(url, config);
|
|
53
|
+
},
|
|
54
|
+
patch(url, options) {
|
|
55
|
+
const { data, ...config } = options || {};
|
|
56
|
+
return $http.patch(url, data, config);
|
|
57
|
+
}
|
|
63
58
|
});
|
|
64
59
|
var axios_default = axiosAdaptor;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
60
|
+
|
|
61
|
+
//#endregion
|
|
62
|
+
exports.__toESM = __toESM;
|
|
63
|
+
exports.axiosAdaptor = axiosAdaptor;
|
|
64
|
+
exports.default = axios_default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AxiosInstance, AxiosResponse } from
|
|
1
|
+
import { n as IRequestAdapter } from "../adapter-B1dtiutp.cjs";
|
|
2
|
+
import { AxiosInstance, AxiosResponse } from "axios";
|
|
3
3
|
|
|
4
|
+
//#region adaptors/axios.d.ts
|
|
4
5
|
declare const axiosAdaptor: IRequestAdapter<AxiosInstance, AxiosResponse<unknown>>;
|
|
5
|
-
|
|
6
|
-
export { axiosAdaptor, axiosAdaptor as default };
|
|
6
|
+
//#endregion
|
|
7
|
+
export { axiosAdaptor, axiosAdaptor as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { n as IRequestAdapter } from "../adapter-CRsPadpS.mjs";
|
|
2
|
+
import { AxiosInstance, AxiosResponse } from "axios";
|
|
3
|
+
|
|
4
|
+
//#region adaptors/axios.d.ts
|
|
5
|
+
declare const axiosAdaptor: IRequestAdapter<AxiosInstance, AxiosResponse<unknown>>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { axiosAdaptor, axiosAdaptor as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
|
|
3
|
+
//#region adaptors/axios.ts
|
|
4
|
+
const $http = /* @__PURE__ */ axios.create({});
|
|
5
|
+
const axiosAdaptor = Object.preventExtensions({
|
|
6
|
+
get default() {
|
|
7
|
+
return $http;
|
|
8
|
+
},
|
|
9
|
+
responseWrapper: {},
|
|
10
|
+
get(url, options) {
|
|
11
|
+
return $http.get(url, options);
|
|
12
|
+
},
|
|
13
|
+
post(url, options) {
|
|
14
|
+
const { data, ...config } = options || {};
|
|
15
|
+
return $http.post(url, data, config);
|
|
16
|
+
},
|
|
17
|
+
put(url, options) {
|
|
18
|
+
const { data, ...config } = options || {};
|
|
19
|
+
return $http.put(url, data, config);
|
|
20
|
+
},
|
|
21
|
+
delete(url, options) {
|
|
22
|
+
const { ...config } = options || {};
|
|
23
|
+
return $http.delete(url, config);
|
|
24
|
+
},
|
|
25
|
+
patch(url, options) {
|
|
26
|
+
const { data, ...config } = options || {};
|
|
27
|
+
return $http.patch(url, data, config);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var axios_default = axiosAdaptor;
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { axiosAdaptor, axios_default as default };
|