@mx-space/api-client 1.0.1 → 1.0.2
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/.eslintcache +1 -1
- package/controllers/recently.ts +24 -3
- package/dist/index.cjs +18 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.umd.js +18 -0
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/esm/controllers/recently.d.ts +61 -12
- package/esm/controllers/recently.js +18 -0
- package/esm/controllers/recently.js.map +1 -1
- package/lib/controllers/recently.d.ts +61 -12
- package/lib/controllers/recently.js +19 -1
- package/lib/controllers/recently.js.map +1 -1
- package/package.json +6 -5
- package/types/controllers/recently.d.ts +61 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mx-space/api-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A api client for mx-space server@next",
|
|
6
6
|
"author": "Innei",
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
"abort-controller": "3.0.0",
|
|
88
88
|
"axios": "*",
|
|
89
89
|
"camelcase-keys": "*",
|
|
90
|
+
"concurrently": "7.6.0",
|
|
90
91
|
"cors": "2.8.5",
|
|
91
92
|
"dts-bundle-generator": "7.0.0",
|
|
92
93
|
"express": "4.18.2",
|
|
@@ -102,12 +103,12 @@
|
|
|
102
103
|
},
|
|
103
104
|
"scripts": {
|
|
104
105
|
"prebuild": "rm -rf lib && rm -rf esm",
|
|
105
|
-
"build": "tsc --build tsconfig.build.json
|
|
106
|
-
"postbuild": "tsc-alias -p tsconfig.build.json
|
|
106
|
+
"build": "concurrently \"tsc --build tsconfig.build.json\" \"tsc --build tsconfig.cjs.json\"",
|
|
107
|
+
"postbuild": "concurrently \"tsc-alias -p tsconfig.build.json\" \"tsc-alias -p tsconfig.cjs.json\" \"npm run types\"",
|
|
107
108
|
"types": "rm -rf types && tsc --build tsconfig.types.json && tsc-alias -p tsconfig.types.json",
|
|
108
|
-
"package": "NODE_ENV=production npm run build
|
|
109
|
+
"package": "NODE_ENV=production concurrently \"npm run build\" \"rollup -c\"",
|
|
109
110
|
"prepackage": "rm -rf dist",
|
|
110
111
|
"test": "vitest",
|
|
111
|
-
"dev": "
|
|
112
|
+
"dev": "vitest"
|
|
112
113
|
}
|
|
113
114
|
}
|
|
@@ -9,6 +9,14 @@ declare module '../core/client' {
|
|
|
9
9
|
shorthand: RecentlyController<ResponseWrapper>;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
+
export declare enum RecentlyAttitudeResultEnum {
|
|
13
|
+
Inc = 1,
|
|
14
|
+
Dec = -1
|
|
15
|
+
}
|
|
16
|
+
export declare enum RecentlyAttitudeEnum {
|
|
17
|
+
Up = 0,
|
|
18
|
+
Down = 1
|
|
19
|
+
}
|
|
12
20
|
export declare class RecentlyController<ResponseWrapper> implements IController {
|
|
13
21
|
private readonly client;
|
|
14
22
|
base: string;
|
|
@@ -18,44 +26,85 @@ export declare class RecentlyController<ResponseWrapper> implements IController
|
|
|
18
26
|
/**
|
|
19
27
|
* 获取最新一条
|
|
20
28
|
*/
|
|
21
|
-
getLatestOne(): import("../interfaces/request").RequestProxyResult<RecentlyModel
|
|
29
|
+
getLatestOne(): import("../interfaces/request").RequestProxyResult<RecentlyModel & {
|
|
30
|
+
comments: number;
|
|
31
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
22
32
|
[key: string]: any;
|
|
23
|
-
data: RecentlyModel
|
|
33
|
+
data: RecentlyModel & {
|
|
34
|
+
comments: number;
|
|
35
|
+
};
|
|
24
36
|
} : ResponseWrapper extends {
|
|
25
|
-
data: RecentlyModel
|
|
37
|
+
data: RecentlyModel & {
|
|
38
|
+
comments: number;
|
|
39
|
+
};
|
|
26
40
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
27
|
-
data: RecentlyModel
|
|
41
|
+
data: RecentlyModel & {
|
|
42
|
+
comments: number;
|
|
43
|
+
};
|
|
28
44
|
}>;
|
|
29
45
|
getAll(): import("../interfaces/request").RequestProxyResult<{
|
|
30
|
-
data: RecentlyModel[]
|
|
46
|
+
data: RecentlyModel[] & {
|
|
47
|
+
comments: number;
|
|
48
|
+
};
|
|
31
49
|
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
32
50
|
[key: string]: any;
|
|
33
51
|
data: {
|
|
34
|
-
data: RecentlyModel[]
|
|
52
|
+
data: RecentlyModel[] & {
|
|
53
|
+
comments: number;
|
|
54
|
+
};
|
|
35
55
|
};
|
|
36
56
|
} : ResponseWrapper extends {
|
|
37
57
|
data: {
|
|
38
|
-
data: RecentlyModel[]
|
|
58
|
+
data: RecentlyModel[] & {
|
|
59
|
+
comments: number;
|
|
60
|
+
};
|
|
39
61
|
};
|
|
40
62
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
41
63
|
data: {
|
|
42
|
-
data: RecentlyModel[]
|
|
64
|
+
data: RecentlyModel[] & {
|
|
65
|
+
comments: number;
|
|
66
|
+
};
|
|
43
67
|
};
|
|
44
68
|
}>;
|
|
45
69
|
getList(before?: string | undefined, after?: string | undefined, size?: number | number): import("../interfaces/request").RequestProxyResult<{
|
|
46
|
-
data: RecentlyModel[]
|
|
70
|
+
data: RecentlyModel[] & {
|
|
71
|
+
comments: number;
|
|
72
|
+
};
|
|
73
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
74
|
+
[key: string]: any;
|
|
75
|
+
data: {
|
|
76
|
+
data: RecentlyModel[] & {
|
|
77
|
+
comments: number;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
} : ResponseWrapper extends {
|
|
81
|
+
data: {
|
|
82
|
+
data: RecentlyModel[] & {
|
|
83
|
+
comments: number;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
87
|
+
data: {
|
|
88
|
+
data: RecentlyModel[] & {
|
|
89
|
+
comments: number;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
}>;
|
|
93
|
+
/** 表态:点赞,点踩 */
|
|
94
|
+
attitude(id: string, attitude: RecentlyAttitudeEnum): import("../interfaces/request").RequestProxyResult<{
|
|
95
|
+
code: RecentlyAttitudeResultEnum;
|
|
47
96
|
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
48
97
|
[key: string]: any;
|
|
49
98
|
data: {
|
|
50
|
-
|
|
99
|
+
code: RecentlyAttitudeResultEnum;
|
|
51
100
|
};
|
|
52
101
|
} : ResponseWrapper extends {
|
|
53
102
|
data: {
|
|
54
|
-
|
|
103
|
+
code: RecentlyAttitudeResultEnum;
|
|
55
104
|
};
|
|
56
105
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
57
106
|
data: {
|
|
58
|
-
|
|
107
|
+
code: RecentlyAttitudeResultEnum;
|
|
59
108
|
};
|
|
60
109
|
}>;
|
|
61
110
|
}
|