@@ -4,7 +4,7 @@ import { buildURLData, cache, sleep } from 'web-utility';
44import {
55 CopiedFile ,
66 DocumentModel ,
7- DriveModel ,
7+ DriveFileModel ,
88 UserIdType ,
99 WikiNode ,
1010 WikiNodeModel
@@ -42,7 +42,7 @@ export class LarkApp implements LarkAppOption {
4242 client : HTTPClient < Context > ;
4343 accessToken = '' ;
4444
45- driveStore : DriveModel ;
45+ driveFileStore : DriveFileModel ;
4646 wikiNodeStore : WikiNodeModel ;
4747 documentStore : DocumentModel ;
4848
@@ -59,7 +59,7 @@ export class LarkApp implements LarkAppOption {
5959
6060 const { client } = this ;
6161
62- this . driveStore = new ( class extends DriveModel {
62+ this . driveFileStore = new ( class extends DriveFileModel {
6363 client = client ;
6464 } ) ( ) ;
6565 this . wikiNodeStore = new ( class extends WikiNodeModel {
@@ -176,40 +176,40 @@ export class LarkApp implements LarkAppOption {
176176 } , 'JS ticket' ) ;
177177
178178 /**
179- * @see {@link DriveModel#downloadFile }
179+ * @see {@link DriveFileModel#downloadOne }
180180 */
181181 async downloadFile ( id : string ) {
182182 await this . getAccessToken ( ) ;
183183
184- return this . driveStore . downloadFile ( id ) ;
184+ return this . driveFileStore . downloadOne ( id ) ;
185185 }
186186
187187 /**
188- * @see {@link DriveModel#uploadFile }
188+ * @see {@link DriveFileModel#uploadOne }
189189 */
190190 async uploadFile ( file : File , parent_type : UploadTargetType , parent_node : string ) {
191191 await this . getAccessToken ( ) ;
192192
193- return this . driveStore . uploadFile ( file , parent_type , parent_node ) ;
193+ return this . driveFileStore . uploadOne ( file , parent_type , parent_node ) ;
194194 }
195195
196196 /**
197- * @see {@link DriveModel#copyFile }
197+ * @see {@link DriveFileModel#copyOne }
198198 * @see {@link WikiNodeModel#moveDocument }
199199 */
200200 copyFile (
201201 URI : `${string } /wiki/${string } `,
202- name : string ,
202+ name ? : string ,
203203 parent_node_token ?: string ,
204204 user_id_type ?: UserIdType
205205 ) : Promise < WikiNode > ;
206206 copyFile (
207207 URI : `${string } /${LarkDocumentType } /${string } `,
208- name : string ,
208+ name ? : string ,
209209 folder_token ?: string ,
210210 user_id_type ?: UserIdType
211211 ) : Promise < CopiedFile > ;
212- async copyFile ( URI : string , name : string , folder_token ?: string , user_id_type ?: UserIdType ) {
212+ async copyFile ( URI : string , name ? : string , folder_token ?: string , user_id_type ?: UserIdType ) {
213213 await this . getAccessToken ( ) ;
214214
215215 let [ type , token ] = new URL ( URI , 'http://localhost' ) . pathname . split ( '/' ) ,
@@ -220,11 +220,12 @@ export class LarkApp implements LarkAppOption {
220220 ( {
221221 obj_type : type ,
222222 obj_token : token ,
223+ title : name ,
223224 space_id,
224225 parent_node_token
225226 } = await this . wiki2drive ( token ) ) ;
226227
227- const copidFile = await this . driveStore . copyFile (
228+ const copidFile = await this . driveFileStore . copyOne (
228229 type as LarkDocumentType ,
229230 token ,
230231 name ,
0 commit comments