{"id":20471761,"url":"https://github.com/signiant/mediashuttle-sdk-all-sample","last_synced_at":"2025-03-05T13:44:25.575Z","repository":{"id":196030610,"uuid":"676449312","full_name":"Signiant/mediashuttle-sdk-all-sample","owner":"Signiant","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-04T15:11:52.000Z","size":745,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-16T02:23:47.612Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Signiant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-09T08:17:43.000Z","updated_at":"2023-08-18T12:18:21.000Z","dependencies_parsed_at":"2025-01-16T02:22:52.332Z","dependency_job_id":"aeb2a558-ca4c-4035-af8a-9c78d08dbf58","html_url":"https://github.com/Signiant/mediashuttle-sdk-all-sample","commit_stats":null,"previous_names":["signiant/mediashuttle-sdk-all-sample"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fmediashuttle-sdk-all-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fmediashuttle-sdk-all-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fmediashuttle-sdk-all-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fmediashuttle-sdk-all-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Signiant","download_url":"https://codeload.github.com/Signiant/mediashuttle-sdk-all-sample/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242039536,"owners_count":20061924,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T14:17:10.379Z","updated_at":"2025-03-05T13:44:25.548Z","avatar_url":"https://github.com/Signiant.png","language":"JavaScript","readme":"# Media Shuttle SDK Example App\n\nA sample React web application demonstrating the use of the [Media Shuttle SDK](https://developer.signiant.com/media-shuttle/media-shuttle-sdk.html) to navigate the folder structure (files and directories) in a given portal, and to upload and download files. It also showcases how to leverage listeners to display progress and to control transfers via SDK.\n\nBuild with [create-react-app](https://github.com/facebook/create-react-app).\n\n## Getting Started\n\nClone this repo and install the application dependencies.\n\n```\nnpm install\n```\n\n### Listing files and directories\n\nIn order to list the files and directories of a portal, follow the following steps:\n\n- Authenticate using [MediaShuttleResourceFactory LoginCredentials](https://sdk.developer.signiant.com/sdk-documentation/media-shuttle/latest/classes/MediaShuttleResourceFactory.html).\n- Fetch accounts and select one of them to get the list of the associated portals. See [Accounts](https://sdk.developer.signiant.com/sdk-documentation/media-shuttle/latest/interfaces/Explorer.html#listAccounts).\n- Fetch portals and select one of them. See [Portals](https://sdk.developer.signiant.com/sdk-documentation/media-shuttle/latest/interfaces/Explorer.html#listPortals).\n- Get the portal member permissions. See [Portal Member Permissions](https://sdk.developer.signiant.com/sdk-documentation/media-shuttle/latest/interfaces/Explorer.html#getPortalMemberPermissions).\n- Find the root directory with **isUserHome** true from [Portal Member Permissions Response](https://sdk.developer.signiant.com/sdk-documentation/media-shuttle/latest/interfaces/PortalPermissions.html#folders).\n- Get the folder content for the root directory. See [Folder Content](https://sdk.developer.signiant.com/sdk-documentation/media-shuttle/latest/interfaces/Explorer.html#getFolderContent).\n\nNote: Results from [Folder Content](https://sdk.developer.signiant.com/sdk-documentation/media-shuttle/latest/interfaces/Explorer.html#getFolderContent) are not recursive, so if the root folder is found based on the portal member permissions, request must be repeated per sub folder. Request for the sub folder should provide `browsePath` instead of `folderId`.\n\n### Uploading files\n\n```javascript\nconst uploadOptions =\n{\n  portalId: portalId,\n  serviceId: serviceId,\n  accountId: accountId,\n  force: true,\n  destinationPath: \"/\"\n}\nmediaShuttleResourceFactory.generateUpload(uploadOptions).then((uploader) =\u003e {\n  // open a file selector and add files to the uploader\n  uploader\n    .addFiles()\n    .then((files) =\u003e {\n      addSubscriptions(uploader, false);\n      // start uploading the selected files\n      uploader.start();\n    })\n    .catch((error) =\u003e {});\n});   \n```\n\n### Downloading files\n\n```javascript\nconst downloadOptions =\n{\n  portalId: portalId,\n  serviceId: serviceId,\n  accountId: accountId,\n  force: true,\n  files: files\n}\nmediaShuttleResourceFactory.generateDownload(downloadOptions).then((downloader) =\u003e {\n  downloader\n    .selectDestinationFolder()\n    .then(() =\u003e {\n      downloader.start();\n      addSubscriptions(downloader, true);\n    })\n    .catch((error) =\u003e {});\n});   \n```\n\n### Subscription to transfer events\n\nFor both upload and download, transfer events can be subscribed. Refer `addSubscriptions` in `src/containers/MediaShuttle/index.js` for subscriptions to different transfer events. \n\n- [Upload Subscription](https://sdk.developer.signiant.com/sdk-documentation/media-shuttle/latest/interfaces/Upload.html#subscribe)\n- [Download Subscription](https://sdk.developer.signiant.com/sdk-documentation/media-shuttle/latest/interfaces/Download.html#subscribe)\n\n## Running the Application\n\nThe development server that comes with create-react-app can be used to serve the application.\n\n```\nnpm start\n```\n\nThe application will be served at `http://localhost:3000`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigniant%2Fmediashuttle-sdk-all-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsigniant%2Fmediashuttle-sdk-all-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigniant%2Fmediashuttle-sdk-all-sample/lists"}