mobx-lark 2.4.0 → 2.4.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.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +12 -10
- package/src/module/Document/index.ts +4 -3
- package/src/module/Wiki/index.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobx-lark",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"license": "LGPL-3.0",
|
|
5
5
|
"author": "shiy2008@gmail.com",
|
|
6
6
|
"description": "Unofficial TypeScript SDK for FeiShu/Lark API, which is based on MobX-RESTful.",
|
|
@@ -26,12 +26,13 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@swc/helpers": "^0.5.17",
|
|
29
|
-
"@types/react": "^19.1.
|
|
29
|
+
"@types/react": "^19.1.12",
|
|
30
30
|
"koajax": "^3.1.2",
|
|
31
|
+
"lodash.memoize": "^4.1.2",
|
|
31
32
|
"mobx": "^6.13.7",
|
|
32
33
|
"mobx-restful": "^2.1.0",
|
|
33
34
|
"regenerator-runtime": "^0.14.1",
|
|
34
|
-
"web-utility": "^4.5.
|
|
35
|
+
"web-utility": "^4.5.3"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|
|
37
38
|
"react": ">=16"
|
|
@@ -40,22 +41,23 @@
|
|
|
40
41
|
"@parcel/config-default": "~2.15.4",
|
|
41
42
|
"@parcel/transformer-typescript-tsc": "~2.15.4",
|
|
42
43
|
"@types/fs-extra": "^11.0.4",
|
|
43
|
-
"@types/
|
|
44
|
-
"@types/
|
|
44
|
+
"@types/lodash.memoize": "^4.1.9",
|
|
45
|
+
"@types/node": "^22.18.0",
|
|
46
|
+
"@types/react-dom": "^19.1.9",
|
|
45
47
|
"@types/turndown": "^5.0.5",
|
|
46
48
|
"dotenv": "^17.2.1",
|
|
47
|
-
"fs-extra": "^11.3.
|
|
49
|
+
"fs-extra": "^11.3.1",
|
|
48
50
|
"husky": "^9.1.7",
|
|
49
|
-
"lint-staged": "^16.1.
|
|
51
|
+
"lint-staged": "^16.1.6",
|
|
50
52
|
"mobx": "^6.13.7",
|
|
51
53
|
"parcel": "~2.15.4",
|
|
52
54
|
"prettier": "^3.6.2",
|
|
53
55
|
"react": "^19.1.1",
|
|
54
56
|
"react-dom": "^19.1.1",
|
|
55
57
|
"ts-node": "^10.9.2",
|
|
56
|
-
"turndown": "^7.2.
|
|
57
|
-
"typedoc": "^0.28.
|
|
58
|
-
"typedoc-plugin-mdn-links": "^5.0.
|
|
58
|
+
"turndown": "^7.2.1",
|
|
59
|
+
"typedoc": "^0.28.12",
|
|
60
|
+
"typedoc-plugin-mdn-links": "^5.0.9",
|
|
59
61
|
"typescript": "~5.9.2"
|
|
60
62
|
},
|
|
61
63
|
"pnpm": {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HTTPError } from 'koajax';
|
|
2
|
+
import memoize from 'lodash.memoize';
|
|
2
3
|
import { BaseListModel } from 'mobx-restful';
|
|
3
|
-
import {
|
|
4
|
+
import { formatDate, uniqueID } from 'web-utility';
|
|
4
5
|
|
|
5
6
|
import { isLarkError, LarkData } from '../../type';
|
|
6
7
|
import { createPageStream } from '../base';
|
|
@@ -56,12 +57,12 @@ export abstract class DocumentModel extends BaseListModel<Document> {
|
|
|
56
57
|
/**
|
|
57
58
|
* @see {@link https://open.feishu.cn/document/server-docs/contact-v3/user/get}
|
|
58
59
|
*/
|
|
59
|
-
#getOneUser =
|
|
60
|
+
#getOneUser = memoize(async (user_id: string) => {
|
|
60
61
|
const { body } = await this.client.get<LarkData<{ user: User }>>(
|
|
61
62
|
`contact/v3/users/${user_id}`
|
|
62
63
|
);
|
|
63
64
|
return body!.data!.user;
|
|
64
|
-
}
|
|
65
|
+
});
|
|
65
66
|
|
|
66
67
|
async *#resolveTextElements(
|
|
67
68
|
elements: TextBlock['text']['elements'],
|
package/src/module/Wiki/index.ts
CHANGED
|
@@ -71,7 +71,7 @@ export abstract class WikiNodeModel extends Stream<WikiNode>(ListModel) {
|
|
|
71
71
|
|
|
72
72
|
const stream = this.traverseChildren(parentNode?.node_token, addCount);
|
|
73
73
|
|
|
74
|
-
for (const node of
|
|
74
|
+
for await (const node of stream) {
|
|
75
75
|
const title = node.title.replace(/[\\/:*?"<>|]+/g, '-').trim();
|
|
76
76
|
|
|
77
77
|
node.title_path = parentNode ? `${parentNode.title_path}/${title}` : title;
|