/
Provider.js
80 lines (72 loc) · 1.75 KB
/
Provider.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/**
* Provider interface defines the specifications of any provider implementation
*/
class Provider {
/**
*
* @param {object} options
*/
constructor (options) { // eslint-disable-line no-unused-vars
this.needsCookieAuth = false
return this
}
/**
* config to extend the grant config
*/
static getExtraConfig () {
return {}
}
/**
* list the files and folders in the provider account
*
* @param {object} options
* @returns {Promise}
*/
async list (options) { // eslint-disable-line no-unused-vars
throw new Error('method not implemented')
}
/**
* download a certain file from the provider account
*
* @param {object} options
* @returns {Promise}
*/
async download (options) { // eslint-disable-line no-unused-vars
throw new Error('method not implemented')
}
/**
* return a thumbnail for a provider file
*
* @param {object} options
* @returns {Promise}
*/
async thumbnail (options) { // eslint-disable-line no-unused-vars
throw new Error('method not implemented')
}
/**
* get the size of a certain file in the provider account
*
* @param {object} options
* @returns {Promise}
*/
async size (options) { // eslint-disable-line no-unused-vars
throw new Error('method not implemented')
}
/**
* handle deauthorization notification from oauth providers
*
* @param {object} options
* @returns {Promise}
*/
async deauthorizationCallback (options) { // eslint-disable-line no-unused-vars
// @todo consider doing something like cb(new NotImplementedError()) instead
throw new Error('method not implemented')
}
/**
* @returns {string}
*/
static get authProvider () {
return ''
}
}
module.exports = Provider