dropbox_api 0.1.16 → 0.1.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.rubocop.yml +15 -0
- data/.travis.yml +0 -2
- data/Gemfile +26 -1
- data/README.md +120 -24
- data/Rakefile +4 -3
- data/TODO.md +24 -7
- data/api_coverage.md +8 -8
- data/bin/console +4 -3
- data/docs/DropboxApi/Authenticator.html +14 -20
- data/docs/DropboxApi/ChunkedUploader.html +20 -20
- data/docs/DropboxApi/Client.html +3446 -992
- data/docs/DropboxApi/ConnectionBuilder.html +266 -31
- data/docs/DropboxApi/Endpoints/Auth/TokenRevoke.html +13 -13
- data/docs/DropboxApi/Endpoints/Auth.html +6 -6
- data/docs/DropboxApi/Endpoints/Base.html +92 -11
- data/docs/DropboxApi/Endpoints/ContentDownload.html +37 -48
- data/docs/DropboxApi/Endpoints/ContentUpload.html +35 -46
- data/docs/DropboxApi/Endpoints/Files/Copy.html +15 -15
- data/docs/DropboxApi/Endpoints/Files/CopyBatch.html +359 -0
- data/docs/DropboxApi/Endpoints/Files/CopyBatchCheck.html +305 -0
- data/docs/DropboxApi/Endpoints/Files/CopyReferenceGet.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/CopyReferenceSave.html +15 -15
- data/docs/DropboxApi/Endpoints/Files/CreateFileRequest.html +13 -13
- data/docs/DropboxApi/Endpoints/Files/CreateFolder.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/CreateFolderBatch.html +377 -0
- data/docs/DropboxApi/Endpoints/Files/CreateFolderBatchCheck.html +308 -0
- data/docs/DropboxApi/Endpoints/Files/Delete.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/DeleteBatch.html +305 -0
- data/docs/DropboxApi/Endpoints/Files/DeleteBatchCheck.html +307 -0
- data/docs/DropboxApi/Endpoints/Files/Download.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/GetMetadata.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/GetPreview.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/GetTemporaryLink.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/GetThumbnail.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/GetThumbnailBatch.html +19 -19
- data/docs/DropboxApi/Endpoints/Files/ListFolder.html +39 -20
- data/docs/DropboxApi/Endpoints/Files/ListFolderContinue.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/ListFolderGetLatestCursor.html +13 -13
- data/docs/DropboxApi/Endpoints/Files/ListFolderLongpoll.html +15 -15
- data/docs/DropboxApi/Endpoints/Files/ListRevisions.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/Move.html +15 -15
- data/docs/DropboxApi/Endpoints/Files/PermanentlyDelete.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/Restore.html +15 -15
- data/docs/DropboxApi/Endpoints/Files/SaveUrl.html +15 -15
- data/docs/DropboxApi/Endpoints/Files/SaveUrlCheckJobStatus.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/Search.html +51 -99
- data/docs/DropboxApi/Endpoints/Files/SearchContinue.html +300 -0
- data/docs/DropboxApi/Endpoints/Files/Upload.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/UploadSessionAppendV2.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/UploadSessionFinish.html +15 -15
- data/docs/DropboxApi/Endpoints/Files/UploadSessionStart.html +15 -15
- data/docs/DropboxApi/Endpoints/Files.html +8 -8
- data/docs/DropboxApi/Endpoints/Rpc.html +36 -47
- data/docs/DropboxApi/Endpoints/RpcContent.html +28 -33
- data/docs/DropboxApi/Endpoints/RpcNotify.html +28 -33
- data/docs/DropboxApi/Endpoints/Sharing/AddFileMember.html +15 -15
- data/docs/DropboxApi/Endpoints/Sharing/AddFolderMember.html +15 -15
- data/docs/DropboxApi/Endpoints/Sharing/CreateSharedLinkWithSettings.html +110 -19
- data/docs/DropboxApi/Endpoints/Sharing/GetSharedLinkMetadata.html +14 -14
- data/docs/DropboxApi/Endpoints/Sharing/ListFileMembers.html +15 -15
- data/docs/DropboxApi/Endpoints/Sharing/ListFolderMembers.html +15 -15
- data/docs/DropboxApi/Endpoints/Sharing/ListSharedLinks.html +13 -13
- data/docs/DropboxApi/Endpoints/Sharing/RevokeSharedLink.html +293 -0
- data/docs/DropboxApi/Endpoints/Sharing/ShareFolder.html +14 -14
- data/docs/DropboxApi/Endpoints/Sharing/UnshareFile.html +14 -14
- data/docs/DropboxApi/Endpoints/Sharing.html +8 -8
- data/docs/DropboxApi/Endpoints/Users/GetAccount.html +14 -14
- data/docs/DropboxApi/Endpoints/Users/GetAccountBatch.html +14 -14
- data/docs/DropboxApi/Endpoints/Users/GetCurrentAccount.html +13 -13
- data/docs/DropboxApi/Endpoints/Users/GetSpaceUsage.html +13 -13
- data/docs/DropboxApi/Endpoints/Users.html +6 -6
- data/docs/DropboxApi/Endpoints.html +6 -6
- data/docs/DropboxApi/Errors/AddFileMemberError.html +10 -10
- data/docs/DropboxApi/Errors/AddFolderMemberError.html +16 -16
- data/docs/DropboxApi/Errors/AddMemberSelectorError.html +11 -11
- data/docs/DropboxApi/Errors/AlreadySharedError.html +9 -9
- data/docs/DropboxApi/Errors/BadPathError.html +6 -6
- data/docs/DropboxApi/Errors/BasicError.html +18 -18
- data/docs/DropboxApi/Errors/CantCopySharedFolderError.html +6 -6
- data/docs/DropboxApi/Errors/CantMoveFolderIntoItselfError.html +6 -6
- data/docs/DropboxApi/Errors/CantNestSharedFolderError.html +6 -6
- data/docs/DropboxApi/Errors/CantShareOutsideTeamError.html +6 -6
- data/docs/DropboxApi/Errors/ContainsSharedFolderError.html +6 -6
- data/docs/DropboxApi/Errors/ConversionError.html +6 -6
- data/docs/DropboxApi/Errors/CreateFileRequestError.html +6 -6
- data/docs/DropboxApi/Errors/CreateFolderBatchError.html +161 -0
- data/docs/DropboxApi/Errors/CreateFolderError.html +7 -7
- data/docs/DropboxApi/Errors/CreateSharedLinkWithSettingsError.html +11 -11
- data/docs/DropboxApi/Errors/CursorClosedError.html +6 -6
- data/docs/DropboxApi/Errors/CursorNotClosedError.html +6 -6
- data/docs/DropboxApi/Errors/DeleteError.html +9 -8
- data/docs/DropboxApi/Errors/DisallowedNameError.html +6 -6
- data/docs/DropboxApi/Errors/DisallowedSharedLinkPolicyError.html +6 -6
- data/docs/DropboxApi/Errors/DownloadError.html +7 -7
- data/docs/DropboxApi/Errors/DownloadFailedError.html +6 -6
- data/docs/DropboxApi/Errors/EmailUnverifiedError.html +6 -6
- data/docs/DropboxApi/Errors/ExpiredAccessTokenError.html +143 -0
- data/docs/DropboxApi/Errors/FileAncestorConflictError.html +6 -6
- data/docs/DropboxApi/Errors/FileConflictError.html +6 -6
- data/docs/DropboxApi/Errors/FileMemberActionError.html +10 -10
- data/docs/DropboxApi/Errors/FolderConflictError.html +6 -6
- data/docs/DropboxApi/Errors/GetAccountError.html +7 -7
- data/docs/DropboxApi/Errors/GetCopyReferenceError.html +7 -7
- data/docs/DropboxApi/Errors/GetMetadataError.html +7 -7
- data/docs/DropboxApi/Errors/GroupDeletedError.html +6 -6
- data/docs/DropboxApi/Errors/GroupNotOnTeamError.html +6 -6
- data/docs/DropboxApi/Errors/HttpError.html +6 -6
- data/docs/DropboxApi/Errors/InProgressError.html +6 -6
- data/docs/DropboxApi/Errors/InsideAppFolderError.html +6 -6
- data/docs/DropboxApi/Errors/InsideOsxPackageError.html +6 -6
- data/docs/DropboxApi/Errors/InsidePublicFolderError.html +6 -6
- data/docs/DropboxApi/Errors/InsideSharedFolderError.html +6 -6
- data/docs/DropboxApi/Errors/InsufficientPlanError.html +6 -6
- data/docs/DropboxApi/Errors/InsufficientSpaceError.html +6 -6
- data/docs/DropboxApi/Errors/InternalError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidCommentError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidCopyReferenceError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidCursorError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidDropboxIdError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidEmailError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidFileError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidIdError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidMemberError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidPathError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidRevisionError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidSettingsError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidUrlError.html +6 -6
- data/docs/DropboxApi/Errors/IsAppFolderError.html +6 -6
- data/docs/DropboxApi/Errors/IsFileError.html +6 -6
- data/docs/DropboxApi/Errors/IsFolderError.html +6 -6
- data/docs/DropboxApi/Errors/IsOsxPackageError.html +6 -6
- data/docs/DropboxApi/Errors/IsPublicFolderError.html +6 -6
- data/docs/DropboxApi/Errors/ListFolderContinueError.html +8 -8
- data/docs/DropboxApi/Errors/ListFolderError.html +7 -7
- data/docs/DropboxApi/Errors/ListFolderLongpollError.html +7 -7
- data/docs/DropboxApi/Errors/ListRevisionsError.html +7 -7
- data/docs/DropboxApi/Errors/ListSharedLinksError.html +8 -8
- data/docs/DropboxApi/Errors/LookupError.html +11 -11
- data/docs/DropboxApi/Errors/MalformedPathError.html +6 -6
- data/docs/DropboxApi/Errors/NoAccountError.html +6 -6
- data/docs/DropboxApi/Errors/NoPermissionError.html +6 -6
- data/docs/DropboxApi/Errors/NoWritePermissionError.html +6 -6
- data/docs/DropboxApi/Errors/NotAMemberError.html +6 -6
- data/docs/DropboxApi/Errors/NotFileError.html +6 -6
- data/docs/DropboxApi/Errors/NotFolderError.html +6 -6
- data/docs/DropboxApi/Errors/NotFoundError.html +6 -6
- data/docs/DropboxApi/Errors/PollError.html +8 -8
- data/docs/DropboxApi/Errors/PreviewError.html +10 -10
- data/docs/DropboxApi/Errors/RateLimitError.html +6 -6
- data/docs/DropboxApi/Errors/RelocationBatchEntryError.html +163 -0
- data/docs/DropboxApi/Errors/RelocationError.html +13 -13
- data/docs/DropboxApi/Errors/RestoreError.html +9 -9
- data/docs/DropboxApi/Errors/RestrictedContentError.html +6 -6
- data/docs/DropboxApi/Errors/RevokeSharedLinkError.html +164 -0
- data/docs/DropboxApi/Errors/SaveCopyReferenceError.html +11 -11
- data/docs/DropboxApi/Errors/SaveUrlError.html +10 -10
- data/docs/DropboxApi/Errors/SearchError.html +7 -7
- data/docs/DropboxApi/Errors/SettingsError.html +8 -8
- data/docs/DropboxApi/Errors/ShareFolderError.html +11 -11
- data/docs/DropboxApi/Errors/SharePathError.html +17 -17
- data/docs/DropboxApi/Errors/SharedFolderAccessError.html +10 -10
- data/docs/DropboxApi/Errors/SharedLinkAccessDeniedError.html +6 -6
- data/docs/DropboxApi/Errors/SharedLinkAlreadyExistsError.html +6 -6
- data/docs/DropboxApi/Errors/SharedLinkError.html +9 -9
- data/docs/DropboxApi/Errors/SharedLinkMalformedError.html +143 -0
- data/docs/DropboxApi/Errors/SharedLinkNotFoundError.html +6 -6
- data/docs/DropboxApi/Errors/SharingFileAccessError.html +11 -11
- data/docs/DropboxApi/Errors/SharingUserError.html +7 -7
- data/docs/DropboxApi/Errors/TeamFolderError.html +6 -6
- data/docs/DropboxApi/Errors/TeamPolicyDisallowsMemberPolicyError.html +6 -6
- data/docs/DropboxApi/Errors/ThumbnailBatchError.html +7 -7
- data/docs/DropboxApi/Errors/ThumbnailError.html +10 -10
- data/docs/DropboxApi/Errors/TooManyFilesError.html +6 -6
- data/docs/DropboxApi/Errors/TooManyMembersError.html +6 -6
- data/docs/DropboxApi/Errors/TooManyPendingInvitesError.html +6 -6
- data/docs/DropboxApi/Errors/TooManyRequestsError.html +15 -15
- data/docs/DropboxApi/Errors/TooManySharedFolderTargetsError.html +6 -6
- data/docs/DropboxApi/Errors/TooManyWriteOperationsError.html +6 -6
- data/docs/DropboxApi/Errors/UnmountedError.html +6 -6
- data/docs/DropboxApi/Errors/UnshareFileError.html +8 -8
- data/docs/DropboxApi/Errors/UnsupportedContentError.html +6 -6
- data/docs/DropboxApi/Errors/UnsupportedExtensionError.html +6 -6
- data/docs/DropboxApi/Errors/UnsupportedImageError.html +6 -6
- data/docs/DropboxApi/Errors/UnsupportedLinkTypeError.html +6 -6
- data/docs/DropboxApi/Errors/UnverifiedDropboxId.html +6 -6
- data/docs/DropboxApi/Errors/UploadError.html +7 -7
- data/docs/DropboxApi/Errors/UploadSessionFinishError.html +9 -9
- data/docs/DropboxApi/Errors/UploadSessionLookupError.html +10 -10
- data/docs/DropboxApi/Errors/UploadSessionOffsetError.html +10 -10
- data/docs/DropboxApi/Errors/UploadWriteFailedError.html +7 -7
- data/docs/DropboxApi/Errors/WriteConflictError.html +9 -9
- data/docs/DropboxApi/Errors/WriteError.html +11 -11
- data/docs/DropboxApi/Errors.html +8 -8
- data/docs/DropboxApi/Metadata/AccessLevel.html +9 -9
- data/docs/DropboxApi/Metadata/AddFileMemberResult.html +6 -6
- data/docs/DropboxApi/Metadata/AddMember.html +11 -11
- data/docs/DropboxApi/Metadata/Base.html +24 -24
- data/docs/DropboxApi/Metadata/BasicAccount.html +12 -7
- data/docs/DropboxApi/Metadata/CommitInfo.html +9 -9
- data/docs/DropboxApi/Metadata/Deleted.html +6 -6
- data/docs/DropboxApi/Metadata/Dimensions.html +6 -6
- data/docs/DropboxApi/Metadata/Field.html +24 -20
- data/docs/DropboxApi/Metadata/File.html +10 -10
- data/docs/DropboxApi/Metadata/FileCategoriesList.html +205 -0
- data/docs/DropboxApi/Metadata/FileCategory.html +250 -0
- data/docs/DropboxApi/Metadata/FileExtensionsList.html +213 -0
- data/docs/DropboxApi/Metadata/FileLinkMetadata.html +6 -6
- data/docs/DropboxApi/Metadata/FileMemberAction.html +10 -10
- data/docs/DropboxApi/Metadata/FileRequest.html +6 -6
- data/docs/DropboxApi/Metadata/FileStatus.html +242 -0
- data/docs/DropboxApi/Metadata/Folder.html +10 -10
- data/docs/DropboxApi/Metadata/FolderLinkMetadata.html +6 -6
- data/docs/DropboxApi/Metadata/FolderSharingInfo.html +6 -6
- data/docs/DropboxApi/Metadata/LinkPermissions.html +6 -6
- data/docs/DropboxApi/Metadata/Location.html +6 -6
- data/docs/DropboxApi/Metadata/MediaInfo.html +9 -9
- data/docs/DropboxApi/Metadata/MediaMetadata.html +9 -9
- data/docs/DropboxApi/Metadata/Member.html +13 -13
- data/docs/DropboxApi/Metadata/MemberAction.html +9 -9
- data/docs/DropboxApi/Metadata/MemberActionList.html +9 -9
- data/docs/DropboxApi/Metadata/MemberPermission.html +6 -6
- data/docs/DropboxApi/Metadata/MemberPermissionList.html +10 -10
- data/docs/DropboxApi/Metadata/MetadataV2.html +140 -0
- data/docs/DropboxApi/Metadata/Name.html +6 -6
- data/docs/DropboxApi/Metadata/NamespaceId.html +210 -0
- data/docs/DropboxApi/Metadata/ParentFolderAccessInfo.html +6 -6
- data/docs/DropboxApi/Metadata/PhotoMetadata.html +6 -6
- data/docs/DropboxApi/Metadata/Resource.html +10 -10
- data/docs/DropboxApi/Metadata/RootInfo.html +227 -0
- data/docs/DropboxApi/Metadata/SearchMatchFieldOptions.html +140 -0
- data/docs/DropboxApi/Metadata/SearchMatchTypeV2.html +244 -0
- data/docs/DropboxApi/Metadata/SearchMatchV2.html +216 -0
- data/docs/DropboxApi/Metadata/SearchOptions.html +140 -0
- data/docs/DropboxApi/Metadata/SearchOrderBy.html +242 -0
- data/docs/DropboxApi/Metadata/SharedFolder.html +6 -6
- data/docs/DropboxApi/Metadata/SharedFolderPolicy.html +6 -6
- data/docs/DropboxApi/Metadata/SharedLink.html +18 -18
- data/docs/DropboxApi/Metadata/SharedLinkMetadata.html +10 -10
- data/docs/DropboxApi/Metadata/SpaceAllocation.html +6 -6
- data/docs/DropboxApi/Metadata/SpaceUsage.html +6 -6
- data/docs/DropboxApi/Metadata/Tag.html +14 -14
- data/docs/DropboxApi/Metadata/Team.html +6 -6
- data/docs/DropboxApi/Metadata/TeamMemberInfo.html +6 -6
- data/docs/DropboxApi/Metadata/TeamRootInfo.html +140 -0
- data/docs/DropboxApi/Metadata/ThumbnailBatchResultData.html +6 -6
- data/docs/DropboxApi/Metadata/ThumbnailBatchResultEntry.html +11 -11
- data/docs/DropboxApi/Metadata/UploadSessionCursor.html +9 -9
- data/docs/DropboxApi/Metadata/UserRootInfo.html +140 -0
- data/docs/DropboxApi/Metadata/VideoMetadata.html +6 -6
- data/docs/DropboxApi/Metadata/WriteMode.html +21 -21
- data/docs/DropboxApi/Metadata.html +8 -8
- data/docs/DropboxApi/MiddleWare/DecodeResult.html +13 -13
- data/docs/DropboxApi/MiddleWare/PathRoot.html +412 -0
- data/docs/DropboxApi/MiddleWare/Stack.html +22 -22
- data/docs/DropboxApi/MiddleWare.html +8 -8
- data/docs/DropboxApi/OptionsValidator.html +10 -10
- data/docs/DropboxApi/ResultBuilder.html +30 -30
- data/docs/DropboxApi/Results/AddFileMemberResultList.html +10 -10
- data/docs/DropboxApi/Results/Base.html +11 -11
- data/docs/DropboxApi/Results/BasicAccountBatch.html +10 -10
- data/docs/DropboxApi/Results/CopyBatchResult.html +224 -0
- data/docs/DropboxApi/Results/CreateFolderBatchResult.html +241 -0
- data/docs/DropboxApi/Results/CreateFolderBatchResultEntry.html +234 -0
- data/docs/DropboxApi/Results/DeleteBatchResult.html +241 -0
- data/docs/DropboxApi/Results/DeleteBatchResultEntry.html +226 -0
- data/docs/DropboxApi/Results/GetCopyReferenceResult.html +18 -18
- data/docs/DropboxApi/Results/GetTemporaryLinkResult.html +14 -14
- data/docs/DropboxApi/Results/GetThumbnailBatchResult.html +10 -10
- data/docs/DropboxApi/Results/ListFolderGetLatestCursorResult.html +10 -10
- data/docs/DropboxApi/Results/ListFolderLongpollResult.html +14 -14
- data/docs/DropboxApi/Results/ListFolderResult.html +18 -18
- data/docs/DropboxApi/Results/ListRevisionsResult.html +14 -14
- data/docs/DropboxApi/Results/ListSharedLinksResult.html +18 -18
- data/docs/DropboxApi/Results/RelocationBatchResult.html +241 -0
- data/docs/DropboxApi/Results/RelocationBatchResultEntry.html +226 -0
- data/docs/DropboxApi/Results/SaveCopyReferenceResult.html +10 -10
- data/docs/DropboxApi/Results/SaveUrlJobStatus.html +15 -15
- data/docs/DropboxApi/Results/SaveUrlResult.html +10 -10
- data/docs/DropboxApi/Results/Search/Match.html +18 -18
- data/docs/DropboxApi/Results/Search.html +6 -6
- data/docs/DropboxApi/Results/SearchResult.html +3 -3
- data/docs/DropboxApi/Results/SearchV2Result.html +368 -0
- data/docs/DropboxApi/Results/ShareFolderLaunch.html +12 -12
- data/docs/DropboxApi/Results/SharedFileMembers.html +22 -22
- data/docs/DropboxApi/Results/SharedFolderMembers.html +22 -22
- data/docs/DropboxApi/Results/UploadSessionStart.html +10 -10
- data/docs/DropboxApi/Results/VoidResult.html +6 -6
- data/docs/DropboxApi/Results.html +8 -8
- data/docs/DropboxApi.html +7 -7
- data/docs/DropboxScaffoldBuilder.html +269 -102
- data/docs/_index.html +261 -16
- data/docs/class_list.html +3 -3
- data/docs/css/common.css +3 -0
- data/docs/css/style.css +3 -2
- data/docs/file.README.html +134 -43
- data/docs/file.api_coverage.html +21 -21
- data/docs/file.rails_setup.html +10 -10
- data/docs/file_list.html +2 -2
- data/docs/frames.html +2 -2
- data/docs/index.html +134 -43
- data/docs/js/app.js +25 -3
- data/docs/method_list.html +598 -238
- data/docs/top-level-namespace.html +6 -6
- data/dropbox_api.gemspec +11 -16
- data/lib/dropbox_api/authenticator.rb +5 -8
- data/lib/dropbox_api/chunked_uploader.rb +2 -1
- data/lib/dropbox_api/client.rb +24 -2
- data/lib/dropbox_api/connection_builder.rb +39 -4
- data/lib/dropbox_api/endpoints/auth/token_revoke.rb +2 -1
- data/lib/dropbox_api/endpoints/base.rb +31 -5
- data/lib/dropbox_api/endpoints/content_download.rb +5 -7
- data/lib/dropbox_api/endpoints/content_upload.rb +3 -2
- data/lib/dropbox_api/endpoints/file_requests/create_file_request.rb +2 -1
- data/lib/dropbox_api/endpoints/files/copy.rb +4 -3
- data/lib/dropbox_api/endpoints/files/copy_batch.rb +36 -0
- data/lib/dropbox_api/endpoints/files/copy_batch_check.rb +21 -0
- data/lib/dropbox_api/endpoints/files/copy_reference_get.rb +3 -2
- data/lib/dropbox_api/endpoints/files/copy_reference_save.rb +4 -3
- data/lib/dropbox_api/endpoints/files/create_folder.rb +3 -2
- data/lib/dropbox_api/endpoints/files/create_folder_batch.rb +41 -0
- data/lib/dropbox_api/endpoints/files/create_folder_batch_check.rb +22 -0
- data/lib/dropbox_api/endpoints/files/delete.rb +3 -2
- data/lib/dropbox_api/endpoints/files/delete_batch.rb +23 -0
- data/lib/dropbox_api/endpoints/files/delete_batch_check.rb +21 -0
- data/lib/dropbox_api/endpoints/files/download.rb +3 -2
- data/lib/dropbox_api/endpoints/files/get_metadata.rb +3 -2
- data/lib/dropbox_api/endpoints/files/get_preview.rb +3 -2
- data/lib/dropbox_api/endpoints/files/get_temporary_link.rb +3 -2
- data/lib/dropbox_api/endpoints/files/get_thumbnail.rb +3 -2
- data/lib/dropbox_api/endpoints/files/get_thumbnail_batch.rb +4 -3
- data/lib/dropbox_api/endpoints/files/list_folder.rb +3 -2
- data/lib/dropbox_api/endpoints/files/list_folder_continue.rb +3 -2
- data/lib/dropbox_api/endpoints/files/list_folder_get_latest_cursor.rb +2 -1
- data/lib/dropbox_api/endpoints/files/list_folder_longpoll.rb +3 -2
- data/lib/dropbox_api/endpoints/files/list_revisions.rb +3 -2
- data/lib/dropbox_api/endpoints/files/move.rb +4 -3
- data/lib/dropbox_api/endpoints/files/permanently_delete.rb +3 -2
- data/lib/dropbox_api/endpoints/files/restore.rb +4 -3
- data/lib/dropbox_api/endpoints/files/save_url.rb +4 -3
- data/lib/dropbox_api/endpoints/files/save_url_check_job_status.rb +3 -2
- data/lib/dropbox_api/endpoints/files/search.rb +16 -27
- data/lib/dropbox_api/endpoints/files/search_continue.rb +23 -0
- data/lib/dropbox_api/endpoints/files/upload.rb +3 -2
- data/lib/dropbox_api/endpoints/files/upload_session_append_v2.rb +3 -2
- data/lib/dropbox_api/endpoints/files/upload_session_finish.rb +4 -3
- data/lib/dropbox_api/endpoints/files/upload_session_start.rb +4 -3
- data/lib/dropbox_api/endpoints/rpc.rb +3 -2
- data/lib/dropbox_api/endpoints/rpc_content.rb +3 -2
- data/lib/dropbox_api/endpoints/rpc_notify.rb +4 -3
- data/lib/dropbox_api/endpoints/sharing/add_file_member.rb +4 -3
- data/lib/dropbox_api/endpoints/sharing/add_folder_member.rb +4 -3
- data/lib/dropbox_api/endpoints/sharing/create_shared_link_with_settings.rb +4 -3
- data/lib/dropbox_api/endpoints/sharing/get_shared_link_metadata.rb +3 -2
- data/lib/dropbox_api/endpoints/sharing/list_file_members.rb +4 -3
- data/lib/dropbox_api/endpoints/sharing/list_folder_members.rb +4 -3
- data/lib/dropbox_api/endpoints/sharing/list_shared_links.rb +2 -1
- data/lib/dropbox_api/endpoints/sharing/revoke_shared_link.rb +3 -2
- data/lib/dropbox_api/endpoints/sharing/share_folder.rb +3 -2
- data/lib/dropbox_api/endpoints/sharing/unshare_file.rb +3 -2
- data/lib/dropbox_api/endpoints/users/get_account.rb +3 -2
- data/lib/dropbox_api/endpoints/users/get_account_batch.rb +3 -2
- data/lib/dropbox_api/endpoints/users/get_current_account.rb +2 -1
- data/lib/dropbox_api/endpoints/users/get_space_usage.rb +2 -1
- data/lib/dropbox_api/endpoints/virtual/upload_by_chunks.rb +1 -0
- data/lib/dropbox_api/errors/add_file_member_error.rb +5 -4
- data/lib/dropbox_api/errors/add_folder_member_error.rb +11 -10
- data/lib/dropbox_api/errors/add_member_selector_error.rb +6 -5
- data/lib/dropbox_api/errors/already_shared_error.rb +1 -0
- data/lib/dropbox_api/errors/basic_error.rb +2 -1
- data/lib/dropbox_api/errors/create_file_request_error.rb +1 -0
- data/lib/dropbox_api/errors/create_folder_batch_error.rb +8 -0
- data/lib/dropbox_api/errors/create_folder_error.rb +2 -1
- data/lib/dropbox_api/errors/create_shared_link_with_settings_error.rb +6 -5
- data/lib/dropbox_api/errors/delete_error.rb +5 -3
- data/lib/dropbox_api/errors/download_error.rb +2 -1
- data/lib/dropbox_api/errors/expired_access_token_error.rb +5 -0
- data/lib/dropbox_api/errors/file_member_action_error.rb +5 -4
- data/lib/dropbox_api/errors/get_account_error.rb +2 -1
- data/lib/dropbox_api/errors/get_copy_reference_error.rb +2 -1
- data/lib/dropbox_api/errors/get_metadata_error.rb +2 -1
- data/lib/dropbox_api/errors/http_error.rb +1 -0
- data/lib/dropbox_api/errors/list_folder_continue_error.rb +3 -2
- data/lib/dropbox_api/errors/list_folder_error.rb +2 -1
- data/lib/dropbox_api/errors/list_folder_longpoll_error.rb +2 -1
- data/lib/dropbox_api/errors/list_revisions_error.rb +2 -1
- data/lib/dropbox_api/errors/list_shared_links_error.rb +3 -2
- data/lib/dropbox_api/errors/lookup_error.rb +6 -5
- data/lib/dropbox_api/errors/poll_error.rb +3 -2
- data/lib/dropbox_api/errors/preview_error.rb +5 -4
- data/lib/dropbox_api/errors/relocation_batch_entry_error.rb +10 -0
- data/lib/dropbox_api/errors/relocation_error.rb +8 -7
- data/lib/dropbox_api/errors/restore_error.rb +4 -3
- data/lib/dropbox_api/errors/revoke_shared_link_error.rb +5 -4
- data/lib/dropbox_api/errors/save_copy_reference_error.rb +6 -5
- data/lib/dropbox_api/errors/save_url_error.rb +5 -4
- data/lib/dropbox_api/errors/search_error.rb +2 -1
- data/lib/dropbox_api/errors/settings_error.rb +3 -2
- data/lib/dropbox_api/errors/share_folder_error.rb +6 -5
- data/lib/dropbox_api/errors/share_path_error.rb +12 -11
- data/lib/dropbox_api/errors/shared_folder_access_error.rb +5 -4
- data/lib/dropbox_api/errors/shared_link_error.rb +4 -3
- data/lib/dropbox_api/errors/sharing_file_access_error.rb +6 -5
- data/lib/dropbox_api/errors/sharing_user_error.rb +2 -1
- data/lib/dropbox_api/errors/thumbnail_batch_error.rb +2 -1
- data/lib/dropbox_api/errors/thumbnail_error.rb +5 -4
- data/lib/dropbox_api/errors/too_many_requests_error.rb +3 -2
- data/lib/dropbox_api/errors/unshare_file_error.rb +3 -2
- data/lib/dropbox_api/errors/upload_error.rb +2 -1
- data/lib/dropbox_api/errors/upload_session_finish_error.rb +4 -3
- data/lib/dropbox_api/errors/upload_session_lookup_error.rb +5 -4
- data/lib/dropbox_api/errors/upload_session_offset_error.rb +1 -0
- data/lib/dropbox_api/errors/upload_write_failed_error.rb +2 -1
- data/lib/dropbox_api/errors/write_conflict_error.rb +4 -3
- data/lib/dropbox_api/errors/write_error.rb +6 -5
- data/lib/dropbox_api/metadata/access_level.rb +1 -0
- data/lib/dropbox_api/metadata/add_file_member_result.rb +1 -0
- data/lib/dropbox_api/metadata/add_member.rb +3 -2
- data/lib/dropbox_api/metadata/base.rb +2 -1
- data/lib/dropbox_api/metadata/basic_account.rb +8 -1
- data/lib/dropbox_api/metadata/commit_info.rb +2 -1
- data/lib/dropbox_api/metadata/deleted.rb +1 -0
- data/lib/dropbox_api/metadata/dimensions.rb +1 -0
- data/lib/dropbox_api/metadata/field.rb +7 -4
- data/lib/dropbox_api/metadata/file.rb +2 -1
- data/lib/dropbox_api/metadata/file_categories_list.rb +9 -0
- data/lib/dropbox_api/metadata/file_category.rb +22 -0
- data/lib/dropbox_api/metadata/file_extensions_list.rb +13 -0
- data/lib/dropbox_api/metadata/file_link_metadata.rb +1 -0
- data/lib/dropbox_api/metadata/file_member_action.rb +2 -1
- data/lib/dropbox_api/metadata/file_request.rb +1 -0
- data/lib/dropbox_api/metadata/file_status.rb +14 -0
- data/lib/dropbox_api/metadata/folder.rb +2 -1
- data/lib/dropbox_api/metadata/folder_link_metadata.rb +1 -0
- data/lib/dropbox_api/metadata/folder_sharing_info.rb +1 -0
- data/lib/dropbox_api/metadata/link_permissions.rb +1 -0
- data/lib/dropbox_api/metadata/location.rb +1 -0
- data/lib/dropbox_api/metadata/media_info.rb +1 -0
- data/lib/dropbox_api/metadata/media_metadata.rb +1 -0
- data/lib/dropbox_api/metadata/member.rb +6 -5
- data/lib/dropbox_api/metadata/member_action.rb +1 -0
- data/lib/dropbox_api/metadata/member_action_list.rb +1 -0
- data/lib/dropbox_api/metadata/member_permission.rb +1 -0
- data/lib/dropbox_api/metadata/member_permission_list.rb +1 -0
- data/lib/dropbox_api/metadata/metadata_v2.rb +7 -0
- data/lib/dropbox_api/metadata/name.rb +1 -0
- data/lib/dropbox_api/metadata/namespace_id.rb +10 -0
- data/lib/dropbox_api/metadata/parent_folder_access_info.rb +1 -0
- data/lib/dropbox_api/metadata/photo_metadata.rb +1 -0
- data/lib/dropbox_api/metadata/resource.rb +2 -1
- data/lib/dropbox_api/metadata/root_info.rb +32 -0
- data/lib/dropbox_api/metadata/search_match_field_options.rb +9 -0
- data/lib/dropbox_api/metadata/search_match_type_v2.rb +16 -0
- data/lib/dropbox_api/metadata/search_match_v2.rb +18 -0
- data/lib/dropbox_api/metadata/search_options.rb +33 -0
- data/lib/dropbox_api/metadata/search_order_by.rb +14 -0
- data/lib/dropbox_api/metadata/shared_folder.rb +1 -0
- data/lib/dropbox_api/metadata/shared_folder_policy.rb +1 -0
- data/lib/dropbox_api/metadata/shared_link.rb +3 -2
- data/lib/dropbox_api/metadata/shared_link_metadata.rb +2 -1
- data/lib/dropbox_api/metadata/space_allocation.rb +1 -0
- data/lib/dropbox_api/metadata/space_usage.rb +1 -0
- data/lib/dropbox_api/metadata/tag.rb +2 -1
- data/lib/dropbox_api/metadata/team.rb +1 -0
- data/lib/dropbox_api/metadata/team_member_info.rb +1 -0
- data/lib/dropbox_api/metadata/team_root_info.rb +8 -0
- data/lib/dropbox_api/metadata/thumbnail_batch_result_data.rb +1 -0
- data/lib/dropbox_api/metadata/thumbnail_batch_result_entry.rb +3 -2
- data/lib/dropbox_api/metadata/upload_session_cursor.rb +1 -0
- data/lib/dropbox_api/metadata/user_root_info.rb +7 -0
- data/lib/dropbox_api/metadata/video_metadata.rb +1 -0
- data/lib/dropbox_api/metadata/write_mode.rb +6 -5
- data/lib/dropbox_api/middleware/decode_result.rb +3 -2
- data/lib/dropbox_api/middleware/path_root.rb +35 -0
- data/lib/dropbox_api/middleware/stack.rb +1 -0
- data/lib/dropbox_api/options_validator.rb +1 -0
- data/lib/dropbox_api/result_builder.rb +3 -2
- data/lib/dropbox_api/results/add_file_member_result_list.rb +1 -0
- data/lib/dropbox_api/results/base.rb +1 -0
- data/lib/dropbox_api/results/basic_account_batch.rb +1 -0
- data/lib/dropbox_api/results/copy_batch_result.rb +15 -0
- data/lib/dropbox_api/results/create_folder_batch_result.rb +21 -0
- data/lib/dropbox_api/results/create_folder_batch_result_entry.rb +20 -0
- data/lib/dropbox_api/results/delete_batch_result.rb +21 -0
- data/lib/dropbox_api/results/delete_batch_result_entry.rb +16 -0
- data/lib/dropbox_api/results/get_copy_reference_result.rb +4 -3
- data/lib/dropbox_api/results/get_temporary_link_result.rb +3 -2
- data/lib/dropbox_api/results/get_thumbnail_batch_result.rb +2 -1
- data/lib/dropbox_api/results/list_folder_get_latest_cursor_result.rb +2 -1
- data/lib/dropbox_api/results/list_folder_longpoll_result.rb +3 -2
- data/lib/dropbox_api/results/list_folder_result.rb +4 -3
- data/lib/dropbox_api/results/list_revisions_result.rb +3 -2
- data/lib/dropbox_api/results/list_shared_links_result.rb +4 -3
- data/lib/dropbox_api/results/relocation_batch_result.rb +21 -0
- data/lib/dropbox_api/results/relocation_batch_result_entry.rb +16 -0
- data/lib/dropbox_api/results/save_copy_reference_result.rb +2 -1
- data/lib/dropbox_api/results/save_url_job_status.rb +7 -6
- data/lib/dropbox_api/results/save_url_result.rb +2 -1
- data/lib/dropbox_api/results/search/match.rb +3 -2
- data/lib/dropbox_api/results/search_v2_result.rb +23 -0
- data/lib/dropbox_api/results/share_folder_launch.rb +4 -3
- data/lib/dropbox_api/results/shared_file_members.rb +5 -4
- data/lib/dropbox_api/results/shared_folder_members.rb +5 -4
- data/lib/dropbox_api/results/upload_session_start.rb +2 -1
- data/lib/dropbox_api/results/void_result.rb +1 -0
- data/lib/dropbox_api/version.rb +2 -1
- data/lib/dropbox_api.rb +38 -6
- data/yardoc/endpoint_handler.rb +2 -1
- data/yardoc/helpers/html_helper.rb +2 -1
- data/yardoc/rspec.rb +3 -2
- data/yardoc/templates/default/method_details/setup.rb +1 -0
- metadata +84 -93
- data/CHANGES.md +0 -7
- data/lib/dropbox_api/results/search_result.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 043f63bda514baadbe49335bb7c79dcbe05831e699428f21f0841db6f2541af8
|
4
|
+
data.tar.gz: 8eaffc62aecbc794743cb64a50f1bd19d28df60edc4742771cbb06911c6d91d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ef853e21852c114922f799a0478ec23b9a174732c932cee28b4d7708c592a2d39879cc01382f2f1ee5720b0f2b109dc09f2cd9e9c9a2250909246ea7b688980
|
7
|
+
data.tar.gz: f126916d8ea0612619c8b2c1059ce534e6fead18e83892210ec3bb98a31976220bb214d435ddbe687d0700ff87be30c94bfaa6f4232ad24fde5392fa46e16f8c
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
AllCops:
|
2
|
+
DisabledByDefault: true
|
3
|
+
|
4
|
+
Style/HashSyntax:
|
5
|
+
Enabled: true
|
6
|
+
EnforcedStyle: 'ruby19'
|
7
|
+
|
8
|
+
Style/FrozenStringLiteralComment:
|
9
|
+
EnforcedStyle: always_true
|
10
|
+
|
11
|
+
Style/RedundantFreeze:
|
12
|
+
Enabled: true
|
13
|
+
|
14
|
+
Style/StringLiterals:
|
15
|
+
EnforcedStyle: single_quotes
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,9 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
source 'https://rubygems.org'
|
2
3
|
|
3
4
|
gemspec
|
4
5
|
|
5
6
|
group :development do
|
7
|
+
gem 'bundler', '>= 1.7'
|
8
|
+
gem 'rake'
|
9
|
+
|
10
|
+
# Test
|
11
|
+
gem 'rspec'
|
12
|
+
gem 'vcr'
|
13
|
+
gem 'webmock'
|
14
|
+
|
15
|
+
# Gem dependencies
|
16
|
+
if RUBY_VERSION >= '2.6'
|
17
|
+
gem 'faraday', '~> 2.0'
|
18
|
+
gem 'faraday-net_http_persistent'
|
19
|
+
else
|
20
|
+
gem 'faraday', '~> 1.0'
|
21
|
+
end
|
22
|
+
|
23
|
+
|
6
24
|
# Documentation
|
7
|
-
gem 'yard-rspec', :git => "https://github.com/Jesus/yard-spec-plugin.git"
|
8
25
|
gem 'redcarpet'
|
26
|
+
gem 'yard-tests-rspec', git: 'https://github.com/Jesus/yard-spec-plugin.git'
|
27
|
+
|
28
|
+
# Debugging
|
29
|
+
gem 'byebug'
|
30
|
+
|
31
|
+
# Code linting
|
32
|
+
gem 'rubocop', require: false
|
33
|
+
gem 'rubocop-rspec', require: false
|
9
34
|
end
|
data/README.md
CHANGED
@@ -56,44 +56,115 @@ DropboxApi::Client.new
|
|
56
56
|
#=> #<DropboxApi::Client ...>
|
57
57
|
```
|
58
58
|
|
59
|
-
|
60
|
-
|
59
|
+
The official documentation on the process to get an authorization code is
|
60
|
+
[here](https://developers.dropbox.com/es-es/oauth-guide#implementing-oauth),
|
61
|
+
it describes the two options listed below.
|
61
62
|
|
62
|
-
#### Option A: Get your access token from the website
|
63
63
|
|
64
|
-
|
65
|
-
You just need to log in to Dropbox and refer to the *developers* section, go to
|
66
|
-
*My apps* and select your application, you may need to create one if you
|
67
|
-
haven't done so yet.
|
64
|
+
#### Option A: Get your access token from the website
|
68
65
|
|
69
|
-
|
70
|
-
|
66
|
+
For a quick test, you can obtain an access token from the App Console in
|
67
|
+
[Dropbox's website](https://www.dropbox.com/developers/). Select from
|
68
|
+
*My apps* your application, you may need to create one if you
|
69
|
+
haven't done so yet. Under your application settings, find section
|
70
|
+
*OAuth 2*, there is a button to generate an access token.
|
71
71
|
|
72
|
-
#### Option B:
|
72
|
+
#### Option B: OAuth2 Code Flow
|
73
73
|
|
74
|
-
|
74
|
+
This is typically what you will use in production, you can obtain an
|
75
|
+
authorization code with a 3-step process:
|
75
76
|
|
76
77
|
```ruby
|
78
|
+
# 1. Get an authorization URL.
|
77
79
|
authenticator = DropboxApi::Authenticator.new(CLIENT_ID, CLIENT_SECRET)
|
78
|
-
authenticator.authorize_url #=> "https://www.dropbox.com/..."
|
80
|
+
authenticator.auth_code.authorize_url #=> "https://www.dropbox.com/..."
|
79
81
|
|
80
|
-
#
|
81
|
-
#
|
82
|
+
# 2. Log into Dropbox and authorize your app. You need to open the
|
83
|
+
# authorization URL in your browser.
|
82
84
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
85
|
+
# 3. Exchange the authorization code for a reusable access token (not visible
|
86
|
+
# to the user).
|
87
|
+
access_token = authenticator.auth_code.get_token(CODE) #=> #<OAuth2::AccessToken ...>`
|
88
|
+
access_token.token #=> "VofXAX8D..."
|
87
89
|
|
88
|
-
|
90
|
+
# Keep this token, you'll need it to initialize a `DropboxApi::Client` object:
|
91
|
+
client = DropboxApi::Client.new(access_token: access_token)
|
92
|
+
|
93
|
+
# For backwards compatibility, the following also works:
|
94
|
+
client = DropboxApi::Client.new(access_token.token)
|
95
|
+
```
|
89
96
|
|
90
|
-
|
91
|
-
Dropbox's [OAuth guide]
|
92
|
-
(https://www.dropbox.com/developers/reference/oauth-guide#oauth-2-on-the-web).
|
97
|
+
##### Integration with Rails
|
93
98
|
|
94
99
|
If you have a Rails application, you might be interested in this [setup
|
95
100
|
guide](http://jesus.github.io/dropbox_api/file.rails_setup.html).
|
96
101
|
|
102
|
+
|
103
|
+
##### Using refresh tokens
|
104
|
+
|
105
|
+
Access tokens are short-lived by default (as of September 30th, 2021),
|
106
|
+
applications that require long-lived access to the API without additional
|
107
|
+
interaction with the user should use refresh tokens.
|
108
|
+
|
109
|
+
The process is similar but a token refresh might seamlessly occur as you
|
110
|
+
perform API calls. When this happens you'll need to store the
|
111
|
+
new token hash if you want to continue using this session, you can use the
|
112
|
+
`on_token_refreshed` callback to do this.
|
113
|
+
|
114
|
+
```ruby
|
115
|
+
# 1. Get an authorization URL, requesting offline access type.
|
116
|
+
authenticator = DropboxApi::Authenticator.new(CLIENT_ID, CLIENT_SECRET)
|
117
|
+
authenticator.auth_code.authorize_url(token_access_type: 'offline')
|
118
|
+
|
119
|
+
# 2. Log into Dropbox and authorize your app. You need to open the
|
120
|
+
# authorization URL in your browser.
|
121
|
+
|
122
|
+
# 3. Exchange the authorization code for a reusable access token
|
123
|
+
access_token = authenticator.auth_code.get_token(CODE) #=> #<OAuth2::AccessToken ...>`
|
124
|
+
|
125
|
+
# You can now use the access token to initialize a DropboxApi::Client, you
|
126
|
+
# should also provide a callback function to store the updated access token
|
127
|
+
# whenever it's refreshed.
|
128
|
+
client = DropboxApi::Client.new(
|
129
|
+
access_token: access_token,
|
130
|
+
on_token_refreshed: lambda { |new_token_hash|
|
131
|
+
# token_hash is a serializable Hash, something like this:
|
132
|
+
# {
|
133
|
+
# "uid"=>"440",
|
134
|
+
# "token_type"=>"bearer",
|
135
|
+
# "scope"=>"account_info.read account_info.write...",
|
136
|
+
# "account_id"=>"dbid:AABOLtA1rT6rRK4vajKZ...",
|
137
|
+
# :access_token=>"sl.A5Ez_CBsqJILhDawHlmXSoZEhLZ4nuLFVRs6AJ...",
|
138
|
+
# :refresh_token=>"iMg4Me_oKYUAAAAAAAAAAapQixCgwfXOxuubCuK_...",
|
139
|
+
# :expires_at=>1632948328
|
140
|
+
# }
|
141
|
+
SomewhereSafe.save(new_token_hash)
|
142
|
+
}
|
143
|
+
)
|
144
|
+
```
|
145
|
+
|
146
|
+
Once you've gone through the process above, you can skip the steps that require
|
147
|
+
user interaction in subsequent initializations of `DropboxApi::Client`. For
|
148
|
+
example:
|
149
|
+
|
150
|
+
```ruby
|
151
|
+
# 1. Initialize an authenticator
|
152
|
+
authenticator = DropboxApi::Authenticator.new(CLIENT_ID, CLIENT_SECRET)
|
153
|
+
|
154
|
+
# 2. Retrieve the token hash you previously stored somewhere safe, you can use
|
155
|
+
# it to build a new access token.
|
156
|
+
access_token = OAuth2::AccessToken.from_hash(authenticator, token_hash)
|
157
|
+
|
158
|
+
# 3. You now have an access token, so you can initialize a client like you
|
159
|
+
# would normally:
|
160
|
+
client = DropboxApi::Client.new(
|
161
|
+
access_token: access_token,
|
162
|
+
on_token_refreshed: lambda { |new_token_hash|
|
163
|
+
SomewhereSafe.save(new_token_hash)
|
164
|
+
}
|
165
|
+
)
|
166
|
+
```
|
167
|
+
|
97
168
|
### Performing API calls
|
98
169
|
|
99
170
|
Once you've initialized a client, for example:
|
@@ -139,6 +210,26 @@ Check out the
|
|
139
210
|
[method documentation](http://www.xuuso.com/dropbox_api/DropboxApi/Client.html#upload_by_chunks-instance_method)
|
140
211
|
to find out all available options.
|
141
212
|
|
213
|
+
### Accessing Team Folders
|
214
|
+
|
215
|
+
In order to access your team scope you need to add the namespace_id to you request headers.
|
216
|
+
This can be done using the middlewere layer as per the below:
|
217
|
+
|
218
|
+
```ruby
|
219
|
+
client = DropboxApi::Client.new("VofXAX8D...")
|
220
|
+
#=> #<DropboxApi::Client ...>
|
221
|
+
client.namespace_id = client.get_current_account.root_info.root_namespace_id
|
222
|
+
|
223
|
+
client.list_folder('')
|
224
|
+
#=> Now returns the team folders
|
225
|
+
```
|
226
|
+
|
227
|
+
You could unset the namespace ID at any point afterwards with just:
|
228
|
+
|
229
|
+
```ruby
|
230
|
+
client.namespace_id = nil
|
231
|
+
```
|
232
|
+
|
142
233
|
## Dependencies
|
143
234
|
|
144
235
|
This gem depends on
|
@@ -146,7 +237,7 @@ This gem depends on
|
|
146
237
|
and
|
147
238
|
[faraday](https://github.com/lostisland/faraday).
|
148
239
|
|
149
|
-
It has official support for Ruby versions `
|
240
|
+
It has official support for Ruby versions `2.x`.
|
150
241
|
|
151
242
|
## Development
|
152
243
|
|
@@ -172,6 +263,11 @@ would be the procedure to do so:
|
|
172
263
|
DROPBOX_OAUTH_BEARER=YOUR_AUTH_BEARER rake test:build_scaffold[list_folder]
|
173
264
|
```
|
174
265
|
|
266
|
+
Note that you'll have to type `rake test:build_scaffold\[list_folder\]`
|
267
|
+
if you use `zsh`.
|
268
|
+
|
269
|
+
You can build all available scaffolds with just `rake test:build_scaffold`.
|
270
|
+
|
175
271
|
3. Run the tests and the cassettes will be written:
|
176
272
|
|
177
273
|
```text
|
@@ -182,7 +278,7 @@ The OAuth bearer shouldn't have been recorded in the cassette and it should've
|
|
182
278
|
been filtered. However, you may want to double check before pushing your
|
183
279
|
updates to Github.
|
184
280
|
|
185
|
-
Tip:
|
281
|
+
Tip: you can simply run `export DROPBOX_OAUTH_BEARER=YOUR_AUTH_BEARER` at
|
186
282
|
the beginning of your work session so you don't need to prefix it in every
|
187
283
|
command line.
|
188
284
|
|
data/Rakefile
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
|
2
|
-
require
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
require 'rspec/core/rake_task'
|
3
4
|
require File.expand_path('../spec/support/rake_tasks', __FILE__)
|
4
5
|
|
5
6
|
RSpec::Core::RakeTask.new(:spec)
|
6
7
|
|
7
|
-
task :
|
8
|
+
task default: :spec
|
data/TODO.md
CHANGED
@@ -1,11 +1,28 @@
|
|
1
|
-
#
|
1
|
+
# Pre-release for v0.1.21
|
2
2
|
|
3
|
-
-
|
3
|
+
- Support Faraday 2.0
|
4
|
+
- Chunked downloads?
|
5
|
+
- Add instructions to support a new endpoint and send a PR.
|
6
|
+
- Release!
|
7
|
+
|
8
|
+
|
9
|
+
# Immediate
|
10
|
+
|
11
|
+
- Test all added classes since last release.
|
12
|
+
- Add scaffoldings for the new endpoints.
|
13
|
+
- Test all new paths to build errors & results.
|
14
|
+
- Update coverage document.
|
15
|
+
- Clear out Rubocop's TODO.
|
16
|
+
- Release!
|
17
|
+
- Update the guide to contribute, show how an endpoint is implemented and
|
18
|
+
documented.
|
19
|
+
|
20
|
+
# Mid-term
|
21
|
+
|
22
|
+
- Remove dependency on Faraday.
|
4
23
|
- Complete full [API coverage](api_coverage.md).
|
5
24
|
|
6
|
-
#
|
25
|
+
# Dreaming
|
7
26
|
|
8
|
-
-
|
9
|
-
|
10
|
-
- Supporting streams would be great.
|
11
|
-
- Add a layer to handle pagination, use `Enumerable`.
|
27
|
+
- Support streams.
|
28
|
+
- Add a layer to handle pagination.
|
data/api_coverage.md
CHANGED
@@ -38,16 +38,16 @@ API call | Status
|
|
38
38
|
API call | Status
|
39
39
|
--- | :---:
|
40
40
|
`/copy` | 🌕
|
41
|
-
`/copy_batch` |
|
42
|
-
`/copy_batch/check` |
|
41
|
+
`/copy_batch` | 🌕
|
42
|
+
`/copy_batch/check` | 🌕
|
43
43
|
`/copy_reference/get` | 🌕
|
44
44
|
`/copy_reference/save` | 🌕
|
45
45
|
`/create_folder` | 🌕
|
46
|
-
`/create_folder_batch` |
|
47
|
-
`/create_folder_batch/check` |
|
46
|
+
`/create_folder_batch` | 🌕
|
47
|
+
`/create_folder_batch/check` | 🌕
|
48
48
|
`/delete` | 🌕
|
49
|
-
`/delete_batch` |
|
50
|
-
`/delete_batch/check` |
|
49
|
+
`/delete_batch` | 🌕
|
50
|
+
`/delete_batch/check` | 🌕
|
51
51
|
`/download` | 🌔
|
52
52
|
`/download_zip` | 🌑
|
53
53
|
`/get_metadata` | 🌕
|
@@ -68,7 +68,7 @@ API call | Status
|
|
68
68
|
`/restore` | 🌕
|
69
69
|
`/save_url` | 🌕
|
70
70
|
`/save_url/check_job_status` | 🌕
|
71
|
-
`/
|
71
|
+
`/search_v2` | 🌔
|
72
72
|
`/upload` | 🌕
|
73
73
|
`/upload_session/append` | alias?
|
74
74
|
`/upload_session/append_v2` | 🌕
|
@@ -131,7 +131,7 @@ API call | Status
|
|
131
131
|
`/relinquish_folder_membership` | 🌑
|
132
132
|
`/remove_file_member_2` | 🌑
|
133
133
|
`/remove_folder_member` | 🌑
|
134
|
-
`/revoke_shared_link` |
|
134
|
+
`/revoke_shared_link` | 🌕
|
135
135
|
`/set_access_inheritance` | 🌑
|
136
136
|
`/share_folder` | 🌕
|
137
137
|
`/transfer_folder` | 🌑
|
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'dropbox_api'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "dropbox_api"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start
|
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
Class: DropboxApi::Authenticator
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "DropboxApi::Authenticator";
|
19
19
|
relpath = '../';
|
20
20
|
</script>
|
@@ -87,11 +87,6 @@
|
|
87
87
|
|
88
88
|
|
89
89
|
|
90
|
-
<dl>
|
91
|
-
<dt>Extended by:</dt>
|
92
|
-
<dd>Forwardable</dd>
|
93
|
-
</dl>
|
94
|
-
|
95
90
|
|
96
91
|
|
97
92
|
|
@@ -150,7 +145,6 @@
|
|
150
145
|
|
151
146
|
|
152
147
|
|
153
|
-
|
154
148
|
<div id="constructor_details" class="method_details_list">
|
155
149
|
<h2>Constructor Details</h2>
|
156
150
|
|
@@ -165,7 +159,7 @@
|
|
165
159
|
|
166
160
|
</h3><div class="docstring">
|
167
161
|
<div class="discussion">
|
168
|
-
<p>Returns a new instance of Authenticator
|
162
|
+
<p>Returns a new instance of Authenticator.</p>
|
169
163
|
|
170
164
|
|
171
165
|
</div>
|
@@ -180,21 +174,21 @@
|
|
180
174
|
<pre class="lines">
|
181
175
|
|
182
176
|
|
177
|
+
6
|
183
178
|
7
|
184
179
|
8
|
185
180
|
9
|
186
181
|
10
|
187
|
-
11
|
188
|
-
12</pre>
|
182
|
+
11</pre>
|
189
183
|
</td>
|
190
184
|
<td>
|
191
|
-
<pre class="code"><span class="info file"># File 'lib/dropbox_api/authenticator.rb', line
|
185
|
+
<pre class="code"><span class="info file"># File 'lib/dropbox_api/authenticator.rb', line 6</span>
|
192
186
|
|
193
187
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_client_id'>client_id</span><span class='comma'>,</span> <span class='id identifier rubyid_client_secret'>client_secret</span><span class='rparen'>)</span>
|
194
|
-
<span class='
|
195
|
-
<span class='
|
196
|
-
<span class='
|
197
|
-
<span class='rbrace'>}</span><span class='rparen'>)</span
|
188
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_client_id'>client_id</span><span class='comma'>,</span> <span class='id identifier rubyid_client_secret'>client_secret</span><span class='comma'>,</span> <span class='lbrace'>{</span>
|
189
|
+
<span class='label'>authorize_url:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>https://www.dropbox.com/oauth2/authorize</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
190
|
+
<span class='label'>token_url:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>https://api.dropboxapi.com/oauth2/token</span><span class='tstring_end'>'</span></span>
|
191
|
+
<span class='rbrace'>}</span><span class='rparen'>)</span>
|
198
192
|
<span class='kw'>end</span></pre>
|
199
193
|
</td>
|
200
194
|
</tr>
|
@@ -207,9 +201,9 @@
|
|
207
201
|
</div>
|
208
202
|
|
209
203
|
<div id="footer">
|
210
|
-
Generated on
|
204
|
+
Generated on Wed Sep 29 23:44:25 2021 by
|
211
205
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
212
|
-
0.9.
|
206
|
+
0.9.26 (ruby-2.6.5).
|
213
207
|
</div>
|
214
208
|
|
215
209
|
</div>
|
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
Class: DropboxApi::ChunkedUploader
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "DropboxApi::ChunkedUploader";
|
19
19
|
relpath = '../';
|
20
20
|
</script>
|
@@ -238,7 +238,7 @@
|
|
238
238
|
|
239
239
|
</h3><div class="docstring">
|
240
240
|
<div class="discussion">
|
241
|
-
<p>Returns a new instance of ChunkedUploader
|
241
|
+
<p>Returns a new instance of ChunkedUploader.</p>
|
242
242
|
|
243
243
|
|
244
244
|
</div>
|
@@ -253,17 +253,17 @@
|
|
253
253
|
<pre class="lines">
|
254
254
|
|
255
255
|
|
256
|
-
5
|
257
256
|
6
|
258
257
|
7
|
259
258
|
8
|
260
259
|
9
|
261
260
|
10
|
262
261
|
11
|
263
|
-
12
|
262
|
+
12
|
263
|
+
13</pre>
|
264
264
|
</td>
|
265
265
|
<td>
|
266
|
-
<pre class="code"><span class="info file"># File 'lib/dropbox_api/chunked_uploader.rb', line
|
266
|
+
<pre class="code"><span class="info file"># File 'lib/dropbox_api/chunked_uploader.rb', line 6</span>
|
267
267
|
|
268
268
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='comma'>,</span> <span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_i_stream'>i_stream</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
269
269
|
<span class='ivar'>@chunk_size</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:chunk_size</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='int'>4</span> <span class='op'>*</span> <span class='int'>1024</span> <span class='op'>*</span> <span class='int'>1024</span> <span class='comment'># 4 MiB
|
@@ -301,12 +301,12 @@
|
|
301
301
|
<pre class="lines">
|
302
302
|
|
303
303
|
|
304
|
-
31
|
305
304
|
32
|
306
|
-
33
|
305
|
+
33
|
306
|
+
34</pre>
|
307
307
|
</td>
|
308
308
|
<td>
|
309
|
-
<pre class="code"><span class="info file"># File 'lib/dropbox_api/chunked_uploader.rb', line
|
309
|
+
<pre class="code"><span class="info file"># File 'lib/dropbox_api/chunked_uploader.rb', line 32</span>
|
310
310
|
|
311
311
|
<span class='kw'>def</span> <span class='id identifier rubyid_finish'>finish</span>
|
312
312
|
<span class='ivar'>@client</span><span class='period'>.</span><span class='id identifier rubyid_upload_session_finish'>upload_session_finish</span> <span class='ivar'>@cursor</span><span class='comma'>,</span> <span class='ivar'>@commit_info</span>
|
@@ -332,19 +332,19 @@
|
|
332
332
|
<pre class="lines">
|
333
333
|
|
334
334
|
|
335
|
-
14
|
336
335
|
15
|
337
336
|
16
|
338
337
|
17
|
339
338
|
18
|
340
|
-
19
|
339
|
+
19
|
340
|
+
20</pre>
|
341
341
|
</td>
|
342
342
|
<td>
|
343
|
-
<pre class="code"><span class="info file"># File 'lib/dropbox_api/chunked_uploader.rb', line
|
343
|
+
<pre class="code"><span class="info file"># File 'lib/dropbox_api/chunked_uploader.rb', line 15</span>
|
344
344
|
|
345
345
|
<span class='kw'>def</span> <span class='id identifier rubyid_start'>start</span>
|
346
346
|
<span class='id identifier rubyid_chunk'>chunk</span> <span class='op'>=</span> <span class='ivar'>@i_stream</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span> <span class='ivar'>@chunk_size</span>
|
347
|
-
<span class='id identifier rubyid_chunk'>chunk</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'
|
347
|
+
<span class='id identifier rubyid_chunk'>chunk</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_chunk'>chunk</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
348
348
|
|
349
349
|
<span class='ivar'>@cursor</span> <span class='op'>=</span> <span class='ivar'>@client</span><span class='period'>.</span><span class='id identifier rubyid_upload_session_start'>upload_session_start</span> <span class='id identifier rubyid_chunk'>chunk</span>
|
350
350
|
<span class='kw'>end</span></pre>
|
@@ -369,7 +369,6 @@
|
|
369
369
|
<pre class="lines">
|
370
370
|
|
371
371
|
|
372
|
-
21
|
373
372
|
22
|
374
373
|
23
|
375
374
|
24
|
@@ -377,10 +376,11 @@
|
|
377
376
|
26
|
378
377
|
27
|
379
378
|
28
|
380
|
-
29
|
379
|
+
29
|
380
|
+
30</pre>
|
381
381
|
</td>
|
382
382
|
<td>
|
383
|
-
<pre class="code"><span class="info file"># File 'lib/dropbox_api/chunked_uploader.rb', line
|
383
|
+
<pre class="code"><span class="info file"># File 'lib/dropbox_api/chunked_uploader.rb', line 22</span>
|
384
384
|
|
385
385
|
<span class='kw'>def</span> <span class='id identifier rubyid_upload'>upload</span>
|
386
386
|
<span class='id identifier rubyid_loop'>loop</span> <span class='kw'>do</span>
|
@@ -401,9 +401,9 @@
|
|
401
401
|
</div>
|
402
402
|
|
403
403
|
<div id="footer">
|
404
|
-
Generated on
|
404
|
+
Generated on Wed Sep 29 23:44:25 2021 by
|
405
405
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
406
|
-
0.9.
|
406
|
+
0.9.26 (ruby-2.6.5).
|
407
407
|
</div>
|
408
408
|
|
409
409
|
</div>
|