This repository has been archived by the owner on Jul 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
libUplinkNode.js
76 lines (68 loc) · 1.83 KB
/
libUplinkNode.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
var storjnodejs = require('bindings')('storjnodejs');
class ListBucketsOptions {
constructor(cursor=""){
this.cursor = cursor;
}
}
class Permission {
constructor(allow_download=false,allow_upload=false,allow_list=false,allow_delete=false,not_before=0,not_after=0){
this.allow_download=allow_download;
this.allow_upload=allow_upload;
this.allow_list=allow_list;
this.allow_delete=allow_delete;
this.not_before=not_before;
this.not_after=not_after;
}
}
class UploadOptions {
constructor(expires=0){
this.expires = expires;
}
}
class DownloadOptions{
constructor(offset = 0,length = 0){
this.offset = offset;
this.length = length;
}
}
class ListObjectsOptions {
constructor(prefix="",cursor="",recursive=false,system=false,custom=false){
this.prefix=prefix;
this.cursor=cursor;
this.recursive=recursive;
this.system=system;
this.custom=custom;
}
}
class SharePrefix {
constructor(bucket="",prefix=""){
this.bucket=bucket;
this.prefix=prefix;
}
}
class CustomMetadata {
constructor(entries=[],count=0){
this.entries = entries;
this.count = count;
}
}
class CustomMetadataEntry {
constructor(key="", key_length=0,value=0,value_length=0) {
this.key=key;
this.key_length=key_length;
this.value=value;
this.value_length=value_length;
}
}
//exporting function and object
module.exports = {
storj_nodejs : storjnodejs,
DownloadOptions : DownloadOptions,
ListBucketsOptions : ListBucketsOptions,
Permission : Permission,
UploadOptions : UploadOptions,
ListObjectsOptions : ListObjectsOptions,
CustomMetadataEntry : CustomMetadataEntry,
CustomMetadata : CustomMetadata,
SharePrefix : SharePrefix
}