diff --git a/package.json b/package.json index 872928d..98ec9ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mobx-lark", - "version": "1.0.0-rc.11", + "version": "1.1.0-rc.0", "license": "LGPL-3.0", "author": "shiy2008@gmail.com", "description": "Unofficial TypeScript SDK for FeiShu/Lark API, which is based on MobX-RESTful.", @@ -28,7 +28,7 @@ "@swc/helpers": "^0.5.3", "koajax": "^0.9.6", "mobx-restful": "^0.6.12", - "regenerator-runtime": "^0.14.0", + "regenerator-runtime": "^0.14.1", "web-utility": "^4.1.3" }, "peerDependencies": { @@ -42,9 +42,9 @@ "mobx": "~6.10.2", "parcel": "~2.10.3", "prettier": "^3.1.1", - "tsx": "^4.6.2", + "tsx": "^4.7.0", "typedoc": "^0.25.4", - "typedoc-plugin-mdn-links": "^3.1.7", + "typedoc-plugin-mdn-links": "^3.1.8", "typescript": "~5.3.3" }, "prettier": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 59438ac..2108d70 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ dependencies: specifier: ^0.6.12 version: 0.6.12(mobx@6.10.2)(typescript@5.3.3) regenerator-runtime: - specifier: ^0.14.0 - version: 0.14.0 + specifier: ^0.14.1 + version: 0.14.1 web-utility: specifier: ^4.1.3 version: 4.1.3(typescript@5.3.3) @@ -44,14 +44,14 @@ devDependencies: specifier: ^3.1.1 version: 3.1.1 tsx: - specifier: ^4.6.2 - version: 4.6.2 + specifier: ^4.7.0 + version: 4.7.0 typedoc: specifier: ^0.25.4 version: 0.25.4(typescript@5.3.3) typedoc-plugin-mdn-links: - specifier: ^3.1.7 - version: 3.1.7(typedoc@0.25.4) + specifier: ^3.1.8 + version: 3.1.8(typedoc@0.25.4) typescript: specifier: ~5.3.3 version: 5.3.3 @@ -80,8 +80,17 @@ packages: js-tokens: 4.0.0 dev: true - /@esbuild/android-arm64@0.18.20: - resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} + /@esbuild/aix-ppc64@0.19.10: + resolution: {integrity: sha512-Q+mk96KJ+FZ30h9fsJl+67IjNJm3x2eX+GBWGmocAKgzp27cowCOOqSdscX80s0SpdFXZnIv/+1xD1EctFx96Q==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm64@0.19.10: + resolution: {integrity: sha512-1X4CClKhDgC3by7k8aOWZeBXQX8dHT5QAMCAQDArCLaYfkppoARvh0fit3X2Qs+MXDngKcHv6XXyQCpY0hkK1Q==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -89,8 +98,8 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.18.20: - resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} + /@esbuild/android-arm@0.19.10: + resolution: {integrity: sha512-7W0bK7qfkw1fc2viBfrtAEkDKHatYfHzr/jKAHNr9BvkYDXPcC6bodtm8AyLJNNuqClLNaeTLuwURt4PRT9d7w==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -98,8 +107,8 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.18.20: - resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} + /@esbuild/android-x64@0.19.10: + resolution: {integrity: sha512-O/nO/g+/7NlitUxETkUv/IvADKuZXyH4BHf/g/7laqKC4i/7whLpB0gvpPc2zpF0q9Q6FXS3TS75QHac9MvVWw==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -107,8 +116,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.18.20: - resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} + /@esbuild/darwin-arm64@0.19.10: + resolution: {integrity: sha512-YSRRs2zOpwypck+6GL3wGXx2gNP7DXzetmo5pHXLrY/VIMsS59yKfjPizQ4lLt5vEI80M41gjm2BxrGZ5U+VMA==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -116,8 +125,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.18.20: - resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} + /@esbuild/darwin-x64@0.19.10: + resolution: {integrity: sha512-alfGtT+IEICKtNE54hbvPg13xGBe4GkVxyGWtzr+yHO7HIiRJppPDhOKq3zstTcVf8msXb/t4eavW3jCDpMSmA==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -125,8 +134,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.18.20: - resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} + /@esbuild/freebsd-arm64@0.19.10: + resolution: {integrity: sha512-dMtk1wc7FSH8CCkE854GyGuNKCewlh+7heYP/sclpOG6Cectzk14qdUIY5CrKDbkA/OczXq9WesqnPl09mj5dg==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -134,8 +143,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.18.20: - resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} + /@esbuild/freebsd-x64@0.19.10: + resolution: {integrity: sha512-G5UPPspryHu1T3uX8WiOEUa6q6OlQh6gNl4CO4Iw5PS+Kg5bVggVFehzXBJY6X6RSOMS8iXDv2330VzaObm4Ag==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -143,8 +152,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.18.20: - resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} + /@esbuild/linux-arm64@0.19.10: + resolution: {integrity: sha512-QxaouHWZ+2KWEj7cGJmvTIHVALfhpGxo3WLmlYfJ+dA5fJB6lDEIg+oe/0//FuyVHuS3l79/wyBxbHr0NgtxJQ==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -152,8 +161,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.18.20: - resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} + /@esbuild/linux-arm@0.19.10: + resolution: {integrity: sha512-j6gUW5aAaPgD416Hk9FHxn27On28H4eVI9rJ4az7oCGTFW48+LcgNDBN+9f8rKZz7EEowo889CPKyeaD0iw9Kg==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -161,8 +170,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.18.20: - resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} + /@esbuild/linux-ia32@0.19.10: + resolution: {integrity: sha512-4ub1YwXxYjj9h1UIZs2hYbnTZBtenPw5NfXCRgEkGb0b6OJ2gpkMvDqRDYIDRjRdWSe/TBiZltm3Y3Q8SN1xNg==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -170,8 +179,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.18.20: - resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} + /@esbuild/linux-loong64@0.19.10: + resolution: {integrity: sha512-lo3I9k+mbEKoxtoIbM0yC/MZ1i2wM0cIeOejlVdZ3D86LAcFXFRdeuZmh91QJvUTW51bOK5W2BznGNIl4+mDaA==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -179,8 +188,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.18.20: - resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} + /@esbuild/linux-mips64el@0.19.10: + resolution: {integrity: sha512-J4gH3zhHNbdZN0Bcr1QUGVNkHTdpijgx5VMxeetSk6ntdt+vR1DqGmHxQYHRmNb77tP6GVvD+K0NyO4xjd7y4A==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -188,8 +197,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.18.20: - resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} + /@esbuild/linux-ppc64@0.19.10: + resolution: {integrity: sha512-tgT/7u+QhV6ge8wFMzaklOY7KqiyitgT1AUHMApau32ZlvTB/+efeCtMk4eXS+uEymYK249JsoiklZN64xt6oQ==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -197,8 +206,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.18.20: - resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} + /@esbuild/linux-riscv64@0.19.10: + resolution: {integrity: sha512-0f/spw0PfBMZBNqtKe5FLzBDGo0SKZKvMl5PHYQr3+eiSscfJ96XEknCe+JoOayybWUFQbcJTrk946i3j9uYZA==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -206,8 +215,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.18.20: - resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} + /@esbuild/linux-s390x@0.19.10: + resolution: {integrity: sha512-pZFe0OeskMHzHa9U38g+z8Yx5FNCLFtUnJtQMpwhS+r4S566aK2ci3t4NCP4tjt6d5j5uo4h7tExZMjeKoehAA==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -215,8 +224,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.18.20: - resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} + /@esbuild/linux-x64@0.19.10: + resolution: {integrity: sha512-SpYNEqg/6pZYoc+1zLCjVOYvxfZVZj6w0KROZ3Fje/QrM3nfvT2llI+wmKSrWuX6wmZeTapbarvuNNK/qepSgA==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -224,8 +233,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.18.20: - resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} + /@esbuild/netbsd-x64@0.19.10: + resolution: {integrity: sha512-ACbZ0vXy9zksNArWlk2c38NdKg25+L9pr/mVaj9SUq6lHZu/35nx2xnQVRGLrC1KKQqJKRIB0q8GspiHI3J80Q==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -233,8 +242,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.18.20: - resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} + /@esbuild/openbsd-x64@0.19.10: + resolution: {integrity: sha512-PxcgvjdSjtgPMiPQrM3pwSaG4kGphP+bLSb+cihuP0LYdZv1epbAIecHVl5sD3npkfYBZ0ZnOjR878I7MdJDFg==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -242,8 +251,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.18.20: - resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} + /@esbuild/sunos-x64@0.19.10: + resolution: {integrity: sha512-ZkIOtrRL8SEJjr+VHjmW0znkPs+oJXhlJbNwfI37rvgeMtk3sxOQevXPXjmAPZPigVTncvFqLMd+uV0IBSEzqA==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -251,8 +260,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.18.20: - resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} + /@esbuild/win32-arm64@0.19.10: + resolution: {integrity: sha512-+Sa4oTDbpBfGpl3Hn3XiUe4f8TU2JF7aX8cOfqFYMMjXp6ma6NJDztl5FDG8Ezx0OjwGikIHw+iA54YLDNNVfw==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -260,8 +269,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.18.20: - resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} + /@esbuild/win32-ia32@0.19.10: + resolution: {integrity: sha512-EOGVLK1oWMBXgfttJdPHDTiivYSjX6jDNaATeNOaCOFEVcfMjtbx7WVQwPSE1eIfCp/CaSF2nSrDtzc4I9f8TQ==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -269,8 +278,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.18.20: - resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} + /@esbuild/win32-x64@0.19.10: + resolution: {integrity: sha512-whqLG6Sc70AbU73fFYvuYzaE4MNMBIlR1Y/IrUeOXFrWHxBEjjbZaQ3IXIQS8wJdAzue2GwYZCjOrgrU1oUHoA==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -1669,34 +1678,35 @@ packages: is-arrayish: 0.2.1 dev: true - /esbuild@0.18.20: - resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} + /esbuild@0.19.10: + resolution: {integrity: sha512-S1Y27QGt/snkNYrRcswgRFqZjaTG5a5xM3EQo97uNBnH505pdzSNe/HLBq1v0RO7iK/ngdbhJB6mDAp0OK+iUA==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.18.20 - '@esbuild/android-arm64': 0.18.20 - '@esbuild/android-x64': 0.18.20 - '@esbuild/darwin-arm64': 0.18.20 - '@esbuild/darwin-x64': 0.18.20 - '@esbuild/freebsd-arm64': 0.18.20 - '@esbuild/freebsd-x64': 0.18.20 - '@esbuild/linux-arm': 0.18.20 - '@esbuild/linux-arm64': 0.18.20 - '@esbuild/linux-ia32': 0.18.20 - '@esbuild/linux-loong64': 0.18.20 - '@esbuild/linux-mips64el': 0.18.20 - '@esbuild/linux-ppc64': 0.18.20 - '@esbuild/linux-riscv64': 0.18.20 - '@esbuild/linux-s390x': 0.18.20 - '@esbuild/linux-x64': 0.18.20 - '@esbuild/netbsd-x64': 0.18.20 - '@esbuild/openbsd-x64': 0.18.20 - '@esbuild/sunos-x64': 0.18.20 - '@esbuild/win32-arm64': 0.18.20 - '@esbuild/win32-ia32': 0.18.20 - '@esbuild/win32-x64': 0.18.20 + '@esbuild/aix-ppc64': 0.19.10 + '@esbuild/android-arm': 0.19.10 + '@esbuild/android-arm64': 0.19.10 + '@esbuild/android-x64': 0.19.10 + '@esbuild/darwin-arm64': 0.19.10 + '@esbuild/darwin-x64': 0.19.10 + '@esbuild/freebsd-arm64': 0.19.10 + '@esbuild/freebsd-x64': 0.19.10 + '@esbuild/linux-arm': 0.19.10 + '@esbuild/linux-arm64': 0.19.10 + '@esbuild/linux-ia32': 0.19.10 + '@esbuild/linux-loong64': 0.19.10 + '@esbuild/linux-mips64el': 0.19.10 + '@esbuild/linux-ppc64': 0.19.10 + '@esbuild/linux-riscv64': 0.19.10 + '@esbuild/linux-s390x': 0.19.10 + '@esbuild/linux-x64': 0.19.10 + '@esbuild/netbsd-x64': 0.19.10 + '@esbuild/openbsd-x64': 0.19.10 + '@esbuild/sunos-x64': 0.19.10 + '@esbuild/win32-arm64': 0.19.10 + '@esbuild/win32-ia32': 0.19.10 + '@esbuild/win32-x64': 0.19.10 dev: true /escalade@3.1.1: @@ -1930,7 +1940,7 @@ packages: dependencies: '@swc/helpers': 0.5.3 iterable-observer: 1.0.1 - regenerator-runtime: 0.14.0 + regenerator-runtime: 0.14.1 web-utility: 4.1.3(typescript@5.3.3) transitivePeerDependencies: - typescript @@ -2168,7 +2178,7 @@ packages: koajax: 0.9.6(typescript@5.3.3) mobx: 6.10.2 reflect-metadata: 0.1.14 - regenerator-runtime: 0.14.0 + regenerator-runtime: 0.14.1 web-utility: 4.1.3(typescript@5.3.3) transitivePeerDependencies: - jsdom @@ -2402,8 +2412,8 @@ packages: resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} dev: true - /regenerator-runtime@0.14.0: - resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==} + /regenerator-runtime@0.14.1: + resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} dev: false /resolve-from@4.0.0: @@ -2573,12 +2583,12 @@ packages: /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - /tsx@4.6.2: - resolution: {integrity: sha512-QPpBdJo+ZDtqZgAnq86iY/PD2KYCUPSUGIunHdGwyII99GKH+f3z3FZ8XNFLSGQIA4I365ui8wnQpl8OKLqcsg==} + /tsx@4.7.0: + resolution: {integrity: sha512-I+t79RYPlEYlHn9a+KzwrvEwhJg35h/1zHsLC2JXvhC2mdynMv6Zxzvhv5EMV6VF5qJlLlkSnMVvdZV3PSIGcg==} engines: {node: '>=18.0.0'} hasBin: true dependencies: - esbuild: 0.18.20 + esbuild: 0.19.10 get-tsconfig: 4.7.2 optionalDependencies: fsevents: 2.3.3 @@ -2594,8 +2604,8 @@ packages: engines: {node: '>=14.16'} dev: true - /typedoc-plugin-mdn-links@3.1.7(typedoc@0.25.4): - resolution: {integrity: sha512-1tun7NLVzfZ1RD225bLaRKlDq5H3ssXSFJbbu05Typ+YMzky5yjbTdiPd3vMJ7I+jBLD5dXthbWvvh667r5kHw==} + /typedoc-plugin-mdn-links@3.1.8(typedoc@0.25.4): + resolution: {integrity: sha512-m2bcjsMghULmf0GBG+P6QwkWYF/7CTvlCefpYGTsIne5eL6wehVzE/RRlw+6qRjTR03FxBwgf/+UsasMRKEbPw==} peerDependencies: typedoc: '>= 0.23.14 || 0.24.x || 0.25.x' dependencies: @@ -2665,7 +2675,7 @@ packages: dependencies: '@swc/helpers': 0.5.3 element-internals-polyfill: 1.3.9 - regenerator-runtime: 0.14.0 + regenerator-runtime: 0.14.1 typescript: 5.3.3 dev: false diff --git a/src/module/Task/index.ts b/src/module/Task/index.ts index 44108ac..36f1034 100644 --- a/src/module/Task/index.ts +++ b/src/module/Task/index.ts @@ -1,11 +1,22 @@ -import { IDType, ListModel, Stream, toggle } from 'mobx-restful'; +import { Filter, IDType, ListModel, Stream, toggle } from 'mobx-restful'; import { buildURLData } from 'web-utility'; -import { LarkData } from '../../type'; +import { LarkData, UserIdType } from '../../type'; import { createPageStream } from '../base'; -import { Task, TaskList, TaskSummary } from './type'; +import { + TaskField, + Task, + TaskList, + TaskListSection, + TaskResourceType, + TaskSummary +} from './type'; -export abstract class TaskModel extends Stream(ListModel) { +export interface TaskFilter extends Filter { + user_id_type?: UserIdType; +} + +export abstract class TaskModel extends Stream(ListModel) { constructor(tasklist_guid: string) { super(); this.baseURI = `task/v2/tasklists/${tasklist_guid}/tasks`; @@ -14,22 +25,20 @@ export abstract class TaskModel extends Stream(ListModel) { /** * @see {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/task-v2/tasklist/tasks} */ - async *openStream() { + async *openStream({ user_id_type }: TaskFilter) { for await (const { guid } of createPageStream( this.client, this.baseURI, total => (this.totalCount = total) )) - yield await this.getOne(guid); + yield await this.getOne(guid, user_id_type); } /** * @see {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/task-v2/task/get} */ - async getOne( - id: string, - user_id_type: 'union_id' | 'open_id' = 'union_id' - ) { + @toggle('downloading') + async getOne(id: string, user_id_type: UserIdType = 'union_id') { const { body } = await this.client.get>( `${this.baseURI}/${id}?${buildURLData({ user_id_type })}` ); @@ -56,10 +65,7 @@ export abstract class TaskListModel extends Stream(ListModel) { * @see {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/task-v2/tasklist/get} */ @toggle('downloading') - async getOne( - id: IDType, - user_id_type: 'union_id' | 'open_id' = 'union_id' - ) { + async getOne(id: IDType, user_id_type: UserIdType = 'union_id') { const { body } = await this.client.get< LarkData<{ tasklist: TaskList }> >(`${this.baseURI}/${id}?${buildURLData({ user_id_type })}`); @@ -67,3 +73,64 @@ export abstract class TaskListModel extends Stream(ListModel) { return (this.currentOne = body!.data!.tasklist); } } + +export interface TaskListSectionFilter { + resource_type: TaskResourceType; + resource_id?: string; +} + +export abstract class TaskListSectionModel extends Stream< + TaskListSection, + TaskListSectionFilter +>(ListModel) { + baseURI = 'task/v2/sections'; + + /** + * @see {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/task-v2/section/list} + */ + async *openStream(filter: TaskListSectionFilter) { + for await (const { guid } of createPageStream< + Pick + >( + this.client, + this.baseURI, + total => (this.totalCount = total), + filter + )) + yield await this.getOne(guid); + } + + /** + * @see {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/task-v2/section/get} + */ + @toggle('downloading') + async getOne(id: string) { + const { body } = await this.client.get< + LarkData<{ section: TaskListSection }> + >(`${this.baseURI}/${id}`); + + return (this.currentOne = body!.data!.section); + } +} + +export type TaskFieldFilter = Filter & + Partial; + +export abstract class TaskFieldModel extends Stream( + ListModel +) { + baseURI = 'task/v2/custom_fields'; + + /** + * @see {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/task-v2/custom_field/list} + */ + async *openStream(filter: TaskFieldFilter) { + for await (const item of createPageStream( + this.client, + this.baseURI, + total => (this.totalCount = total), + filter + )) + yield item; + } +} diff --git a/src/module/Task/type.ts b/src/module/Task/type.ts index 48a5d6c..0d86bd8 100644 --- a/src/module/Task/type.ts +++ b/src/module/Task/type.ts @@ -40,10 +40,10 @@ export interface TaskCompletion { tip: TranslationMap; } -export type BaseCustomField = Pick & +export type BaseTaskField = Pick & Pick; -export interface CustomFieldNumberSetting { +export interface TaskFieldNumberSetting { format: 'normal' | 'percentage' | 'cny' | 'usd' | 'custom'; custom_symbol?: string; custom_symbol_position?: 'left' | 'right'; @@ -51,54 +51,53 @@ export interface CustomFieldNumberSetting { decimal_count: number; } -export interface NumberCustomField extends BaseCustomField { +export interface NumberTaskField extends BaseTaskField { type: 'number'; - number_setting: CustomFieldNumberSetting; + number_setting: TaskFieldNumberSetting; } -export interface TextCustomField extends BaseCustomField { +export interface TextTaskField extends BaseTaskField { type: 'text'; text_setting: object; } -export interface DateTimeCustomField extends BaseCustomField { +export interface DateTimeTaskField extends BaseTaskField { type: 'datetime'; datetime_setting: { format: string }; } -export interface CustomFieldOption - extends Pick { +export interface TaskFieldOption extends Pick { color_index: number; is_hidden: boolean; } -export interface SingleSelectCustomField extends BaseCustomField { +export interface SingleSelectTaskField extends BaseTaskField { type: 'single_select'; - single_select_setting: { options: CustomFieldOption[] }; + single_select_setting: { options: TaskFieldOption[] }; } -export interface MultiSelectCustomField extends BaseCustomField { +export interface MultiSelectTaskField extends BaseTaskField { type: 'multi_select'; - multi_select_setting: { options: CustomFieldOption[] }; + multi_select_setting: { options: TaskFieldOption[] }; } -export interface MemberCustomField extends BaseCustomField { +export interface MemberTaskField extends BaseTaskField { type: 'member'; member_setting: { multi: boolean }; } -export type CustomField = - | NumberCustomField - | TextCustomField - | DateTimeCustomField - | SingleSelectCustomField - | MultiSelectCustomField - | MemberCustomField; +export type TaskField = + | NumberTaskField + | TextTaskField + | DateTimeTaskField + | SingleSelectTaskField + | MultiSelectTaskField + | MemberTaskField; -export type CustomFieldValue = Pick & +export type TaskFieldValue = Pick & Partial< Record< - `${Exclude}_value`, + `${Exclude}_value`, string > & { member_value: TaskOperator[]; @@ -146,7 +145,7 @@ export interface Task href: Record<'url' | 'title', string>; }; custom_complete: Record<'pc' | 'ios' | 'android', TaskCompletion>; - custom_fields: CustomFieldValue[]; + custom_fields: TaskFieldValue[]; attachments: TaskAttachment[]; dependencies: TaskDependency[]; tasklists: Partial>[]; diff --git a/src/type.ts b/src/type.ts index 854a955..b0e2083 100644 --- a/src/type.ts +++ b/src/type.ts @@ -30,13 +30,15 @@ export type TenantAccessToken = LarkData< } >; +export type UserIdType = `${'open' | 'union' | 'user'}_id`; + export type LocaleUser = Record<`${'' | 'en_'}name` | 'email', string>; export type UserMeta = LarkData< { token_type: 'Bearer' } & LocaleUser & Record< | `avatar_${'url' | 'thumb' | 'middle' | 'big'}` - | `${'open' | 'union' | 'user'}_id` + | UserIdType | 'mobile' | 'tenant_key' | `${'access' | 'refresh'}_token`,