How to use the dropbox-v2-api.authenticate function in dropbox-v2-api

To help you get started, we’ve selected a few dropbox-v2-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github simatec / ioBroker.backitup / lib / list / dropbox.js View on Github external
function getFile(options, fileName, toStoreName, log, callback) {
    if (options.accessToken) {
        // copy file to options.backupDir
        const dropboxV2Api = require('dropbox-v2-api');
        const dbx = dropboxV2Api.authenticate({token: options.accessToken});

        let dir = (options.dir || '').replace(/\\/g, '/');

        if (options.ownDir === true) {
            dir = (options.dirMinimal || '').replace(/\\/g, '/');
        }

        if (!dir || dir[0] !== '/') {
            dir = '/' + (dir || '');
        }

        try {
            log.debug('Download of "' + fileName + '" started');
            dbx({
                resource: 'files/download',
                parameters: {
github agilityfeat / video-streaming-alexa-skill / index.js View on Github external
'use strict';
const AWS = require('aws-sdk');
const dropboxV2Api = require('dropbox-v2-api');
const util = require('util');
var fs = require('fs');
var request = require("request");
var dropbox_token = process.env['DROPBOX_TOKEN'];
var media_bucket = process.env['MEDIA_BUCKET'];
// var ffmpeg = require('fluent-ffmpeg');

const dropbox = dropboxV2Api.authenticate({
  token: dropbox_token
});

const videoOutput = '/tmp/file.mp4'
const mainOutput = '/tmp/output.mp4'
const dbfile = 'file.mp4'
var maxdata = 1048576000 // default max data limit - this is deliberately set to 1000MB rather than 1 Gig to allow headroom for settings.js transfers plus any other skills running
var datachargerate = 0.090 // this is the AWS Data transfer charge per Gigabyte first 10 TB / month data transfer out beyond the global free tier

process.env['PATH'] = process.env['PATH'] + ':' + process.env['LAMBDA_TASK_ROOT'];

var maxresults = 10;
var partsize = 60*5; // size of the video chunks in seconds
var settings = new Object();
var streamURL;
github simatec / ioBroker.backitup / lib / scripts / 70-dropbox.js View on Github external
function command(options, log, callback) {
    if (options.accessToken && options.context.fileNames.length) {
        const fileNames = JSON.parse(JSON.stringify(options.context.fileNames));

        const dropboxV2Api = require('dropbox-v2-api');
        const dbx = dropboxV2Api.authenticate({token: options.accessToken});

        let dir = (options.dir || '').replace(/\\/g, '/');

        if (!dir || dir[0] !== '/') {
            dir = '/' + (dir || '');
        }

        copyFiles(dbx, dir, fileNames, log, options.context.errors, err => {
            if (err) {
                options.context.errors.dropbox = err;
                log.error(err);
            }
            if (options.deleteOldBackup === true) {
                cleanFiles(dbx, dir, options.context.types, options.deleteBackupAfter, log, options.context.errors, err => {
                    if (err) {
                        options.context.errors.dropbox = options.context.errors.dropbox || err;
github simatec / ioBroker.backitup / lib / list / dropbox.js View on Github external
function list(restoreSource, options, types, log, callback) {
    if (options.accessToken && (!restoreSource || restoreSource === 'dropbox')) {
        const dropboxV2Api = require('dropbox-v2-api');
        const dbx = dropboxV2Api.authenticate({token: options.accessToken});

        let dir = (options.dir || '').replace(/\\/g, '/');

        if (options.ownDir === true) {
            dir = (options.dirMinimal || '').replace(/\\/g, '/');
        }

        if (!dir || dir[0] !== '/') {
            dir = '/' + (dir || '');
        }

        try {
            dbx({
                resource: 'files/list_folder',
                parameters: {
                    path: dir.replace(/^\/$/, '')

dropbox-v2-api

NodeJS Dropbox v2 API wrapper

MIT
Latest version published 10 months ago

Package Health Score

62 / 100
Full package analysis

Popular dropbox-v2-api functions