dropbox / dropbox-sdk-js

The Official Dropbox API V2 SDK for Javascript
https://www.dropbox.com/developers
MIT License
934 stars 351 forks source link

filesMoveBatchV2 obsolete? #329

Closed lugoimports closed 3 years ago

lugoimports commented 3 years ago

I have the latest release. For a couple of years, my code called filesMoveBatchV2. Now it has stopped working. Is this a bug?

var dbx = new Dropbox.Dropbox( { fetch: fetch, accessToken: mytoken } ); arrayValue.push({from_path : fromPath, to_path : toPath}) dbx.filesMoveBatch({entries : arrayValue })

greg-db commented 3 years ago

Can you elaborate on what you mean when you say "it has stopped working"? What unexpected error or output are you getting?

Also, you said you've been calling filesMoveBatchV2 (which is not deprecated), but the code you shared shows a call to filesMoveBatch (which is deprecated). Please clarify what code you're running that isn't working as expected. And, note that if you're using filesMoveBatch, you should also implement filesMoveBatchCheck to be able to check the result. Likewise, for filesMoveBatchV2, you should use filesMoveBatchCheckV2.

Finally, please also let us know what version number of the Dropbox SDK you're using.

lugoimports commented 3 years ago

Sorry Greg. I'm using the latest version 7.0.0. I am aware filesMoveBatch has been deprecated. That is why, when I view the dropbox object, the filesMoveBatchV2 is not listed as a function See below:

authTokenFromOauth1: ƒ (e) authTokenRevoke: ƒ (e) clientId: undefined clientSecret: undefined filePropertiesPropertiesAdd: ƒ (e) filePropertiesPropertiesOverwrite: ƒ (e) filePropertiesPropertiesRemove: ƒ (e) filePropertiesPropertiesSearch: ƒ (e) filePropertiesPropertiesSearchContinue: ƒ (e) filePropertiesPropertiesUpdate: ƒ (e) filePropertiesTemplatesAddForTeam: ƒ (e) filePropertiesTemplatesAddForUser: ƒ (e) filePropertiesTemplatesGetForTeam: ƒ (e) filePropertiesTemplatesGetForUser: ƒ (e) filePropertiesTemplatesListForTeam: ƒ (e) filePropertiesTemplatesListForUser: ƒ (e) filePropertiesTemplatesRemoveForTeam: ƒ (e) filePropertiesTemplatesRemoveForUser: ƒ (e) filePropertiesTemplatesUpdateForTeam: ƒ (e) filePropertiesTemplatesUpdateForUser: ƒ (e) fileRequestsCreate: ƒ (e) fileRequestsGet: ƒ (e) fileRequestsList: ƒ (e) fileRequestsUpdate: ƒ (e) filesAlphaGetMetadata: ƒ (e) filesAlphaUpload: ƒ (e) filesCopy: ƒ (e) filesCopyBatch: ƒ (e) filesCopyBatchCheck: ƒ (e) filesCopyReferenceGet: ƒ (e) filesCopyReferenceSave: ƒ (e) filesCopyV2: ƒ (e) filesCreateFolder: ƒ (e) filesCreateFolderBatch: ƒ (e) filesCreateFolderBatchCheck: ƒ (e) filesCreateFolderV2: ƒ (e) filesDelete: ƒ (e) filesDeleteBatch: ƒ (e) filesDeleteBatchCheck: ƒ (e) filesDeleteV2: ƒ (e) filesDownload: ƒ (e) filesDownloadZip: ƒ (e) filesGetMetadata: ƒ (e) filesGetPreview: ƒ (e) filesGetTemporaryLink: ƒ (e) filesGetThumbnail: ƒ (e) filesGetThumbnailBatch: ƒ (e) filesListFolder: ƒ (e) filesListFolderContinue: ƒ (e) filesListFolderGetLatestCursor: ƒ (e) filesListFolderLongpoll: ƒ (e) filesListRevisions: ƒ (e) filesMove: ƒ (e) filesMoveBatch: ƒ (e) filesMoveBatchCheck: ƒ (e) filesMoveV2: ƒ (e) filesPermanentlyDelete: ƒ (e) filesPropertiesAdd: ƒ (e) filesPropertiesOverwrite: ƒ (e) filesPropertiesRemove: ƒ (e) filesPropertiesTemplateGet: ƒ (e) filesPropertiesTemplateList: ƒ (e) filesPropertiesUpdate: ƒ (e) filesRestore: ƒ (e) filesSaveUrl: ƒ (e) filesSaveUrlCheckJobStatus: ƒ (e) filesSearch: ƒ (e) filesUpload: ƒ (e) filesUploadSessionAppend: ƒ (e) filesUploadSessionAppendV2: ƒ (e) filesUploadSessionFinish: ƒ (e) filesUploadSessionFinishBatch: ƒ (e) filesUploadSessionFinishBatchCheck: ƒ (e) filesUploadSessionStart: ƒ (e) paperDocsArchive: ƒ (e) paperDocsCreate: ƒ (e) paperDocsDownload: ƒ (e) paperDocsFolderUsersList: ƒ (e) paperDocsFolderUsersListContinue: ƒ (e) paperDocsGetFolderInfo: ƒ (e) paperDocsList: ƒ (e) paperDocsListContinue: ƒ (e) paperDocsPermanentlyDelete: ƒ (e) paperDocsSharingPolicyGet: ƒ (e) paperDocsSharingPolicySet: ƒ (e) paperDocsUpdate: ƒ (e) paperDocsUsersAdd: ƒ (e) paperDocsUsersList: ƒ (e) paperDocsUsersListContinue: ƒ (e) paperDocsUsersRemove: ƒ (e) selectAdmin: undefined selectUser: undefined sharingAddFileMember: ƒ (e) sharingAddFolderMember: ƒ (e) sharingChangeFileMemberAccess: ƒ (e) sharingCheckJobStatus: ƒ (e) sharingCheckRemoveMemberJobStatus: ƒ (e) sharingCheckShareJobStatus: ƒ (e) sharingCreateSharedLink: ƒ (e) sharingCreateSharedLinkWithSettings: ƒ (e) sharingGetFileMetadata: ƒ (e) sharingGetFileMetadataBatch: ƒ (e) sharingGetFolderMetadata: ƒ (e) sharingGetSharedLinkFile: ƒ (e) sharingGetSharedLinkMetadata: ƒ (e) sharingGetSharedLinks: ƒ (e) sharingListFileMembers: ƒ (e) sharingListFileMembersBatch: ƒ (e) sharingListFileMembersContinue: ƒ (e) sharingListFolderMembers: ƒ (e) sharingListFolderMembersContinue: ƒ (e) sharingListFolders: ƒ (e) sharingListFoldersContinue: ƒ (e) sharingListMountableFolders: ƒ (e) sharingListMountableFoldersContinue: ƒ (e) sharingListReceivedFiles: ƒ (e) sharingListReceivedFilesContinue: ƒ (e) sharingListSharedLinks: ƒ (e) sharingModifySharedLinkSettings: ƒ (e) sharingMountFolder: ƒ (e) sharingRelinquishFileMembership: ƒ (e) sharingRelinquishFolderMembership: ƒ (e) sharingRemoveFileMember: ƒ (e) sharingRemoveFileMember2: ƒ (e) sharingRemoveFolderMember: ƒ (e) sharingRevokeSharedLink: ƒ (e) sharingSetAccessInheritance: ƒ (e) sharingShareFolder: ƒ (e) sharingTransferFolder: ƒ (e) sharingUnmountFolder: ƒ (e) sharingUnshareFile: ƒ (e) sharingUnshareFolder: ƒ (e) sharingUpdateFileMember: ƒ (e) sharingUpdateFolderMember: ƒ (e) sharingUpdateFolderPolicy: ƒ (e) teamLogGetEvents: ƒ (e) teamLogGetEventsContinue: ƒ (e) usersGetAccount: ƒ (e) usersGetAccountBatch: ƒ (e) usersGetCurrentAccount: ƒ (e) usersGetSpaceUsage: ƒ (e)

Below is the error message I get when I attempt to use filesMoveBatchV2:

jquery-3.5.1.slim.js:4055 Uncaught TypeError: dbx.filesMoveBatchV2 is not a function at HTMLDocument. (testdropboxrename.php:164) at mightThrow (jquery-3.5.1.slim.js:3762) at process (jquery-3.5.1.slim.js:3830)

Below is my code:

image

greg-db commented 3 years ago

Thanks for the additional information! I just gave this a try though, and I can't seem to reproduce this issue. The method is defined in v7.0.0 of the library, and I am able to access it when running some code myself.

Can you let us know more about the environment you're running this in, and how you're importing the Dropbox library?

lugoimports commented 3 years ago

image

greg-db commented 3 years ago

This appears to be a screenshot of the GitHub website showing the "Download ZIP" button that allows you to download a .zip of this dropbox-sdk-js repository. Can you elaborate on how you're actually importing the library into your app though?

lugoimports commented 3 years ago

Greg, it was all on me. I am not very familiar with NPM and the way you access third-party packages. Literally, I was trying to use the dropbox-sdk.js library included in your dist folder. Just in case someone will find this thread useful, I'm using vuejs3 and after installing the dropbox package through NPM I linked the library with the following command: const Dropbox = require('dropbox') inside my component.