premiumize-me-api
Advanced tools
Comparing version 1.0.1 to 1.0.2
37
index.js
@@ -412,2 +412,37 @@ /** | ||
//Not working properly, zips whole root folder | ||
/** | ||
* @createZipDownload | ||
* @param {String|String[]} file_id | ||
* @param {String|String[]} folder_id | ||
* @return {Promise} | ||
*/ | ||
createZipDownload(file_id, folder_id) | ||
{ | ||
return new Promise((resolve, reject) => { | ||
request( | ||
(PremiumizeMeAPI.baseURL + "/zip/generate"), | ||
true, | ||
{ | ||
apikey : this.apikey, | ||
files : ( | ||
Array.isArray(file_id) ? | ||
file_id : | ||
[file_id] | ||
), | ||
folders : ( | ||
Array.isArray(folder_id) ? | ||
folder_id : | ||
[folder_id] | ||
) | ||
} | ||
).then((param) => { | ||
resolve(param); | ||
}).catch((error) => { | ||
reject(error); | ||
}); | ||
}); | ||
} | ||
//NO IDEA HOW OR IF ITS WORKING: | ||
@@ -536,2 +571,2 @@ | ||
module.exports = PremiumizeMeAPI; | ||
module.exports.default = PremiumizeMeAPI; | ||
module.exports.default = PremiumizeMeAPI; |
{ | ||
"name": "premiumize-me-api", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": "CooliMC", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
314
README.md
@@ -32,9 +32,13 @@ # PremiumizeMeAPI | ||
let testAPI = new remiumizeMeAPI("YOUR_API_KEY"); | ||
```` | ||
testAPI.getFolderList("FolderID").then(console.log); | ||
testAPI.getTransferList().then(console.log); | ||
testAPI.getAccountInfo().then(console.log); | ||
#### getFolderList(String folder_id) | ||
``` | ||
The result for the ``` getFolderList("FolderID") ``` command looks like this: | ||
testAPI.getFolderList(folder_id).then(console.log); | ||
``` | ||
The result for the ``` getFolderList() ``` command looks like this: | ||
```json | ||
@@ -66,2 +70,188 @@ { | ||
#### createFolder(String folder_name, String parent_id) | ||
``` | ||
testAPI.createFolder(folder_name, parent_id).then(console.log) | ||
``` | ||
The result for the ``` createFolder() ``` command looks like this: | ||
```json | ||
{ | ||
"status": "success", | ||
"id": "string" | ||
} | ||
``` | ||
#### renameFolder(String folder_id, String folder_name) | ||
``` | ||
testAPI.renameFolder(folder_id, folder_name).then(console.log) | ||
``` | ||
The result for the ``` renameFolder() ``` command looks like this: | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string" | ||
} | ||
``` | ||
#### pasteToFolder(String folder_id, String|String[] toPasteFolderIds, String|String[] toPasteFileIds) | ||
``` | ||
testAPI.pasteToFolder(folder_id, toPasteFolderIds, toPasteFileIds).then(console.log); | ||
``` | ||
The result for the ``` pasteToFolder() ``` command looks like this: | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string" | ||
} | ||
``` | ||
#### deleteFolder(String folder_id) | ||
``` | ||
testAPI.deleteFolder(folder_id).then(console.log); | ||
``` | ||
The result for the ``` deleteFolder() ``` command looks like this: | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string" | ||
} | ||
``` | ||
#### uploadToFolder(String folder_id) | ||
``` | ||
testAPI.uploadToFolder(folder_id).then(console.log); | ||
``` | ||
The result for the ``` uploadToFolder() ``` command looks like this: | ||
```json | ||
{ | ||
"status": "success", | ||
"token": "string", | ||
"url": "string" | ||
} | ||
``` | ||
#### deleteFile(String file_id) | ||
``` | ||
testAPI.deleteFile(file_id).then(console.log); | ||
``` | ||
The result for the ``` deleteFile() ``` command looks like this: | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string" | ||
} | ||
``` | ||
#### renameFile(String file_id, String file_name) | ||
``` | ||
testAPI.renameFile(file_id, file_name).then(console.log); | ||
``` | ||
The result for the ``` renameFile() ``` command looks like this: | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string" | ||
} | ||
``` | ||
#### fetchFileDetails(String file_id) | ||
``` | ||
testAPI.fetchFileDetails(file_id).then(console.log); | ||
``` | ||
The result for the ``` fetchFileDetails() ``` command looks like this: | ||
```json | ||
{ | ||
"id": "string", | ||
"name": "string", | ||
"type": "file", | ||
"size": 0, | ||
"created_at": 0, | ||
"folder_id": "string", | ||
"link": "string", | ||
"stream_link": "string" | ||
} | ||
``` | ||
#### createTransfer(String|ReadStream src_address_file, String folder_id) | ||
``` | ||
testAPI.createTransfer(src_address_file, folder_id).then(console.log); | ||
``` | ||
The result for the ``` createTransfer() ``` command looks like this: | ||
```json | ||
{ | ||
"status": "success", | ||
"id": "string", | ||
"name": "example.jpg" | ||
} | ||
``` | ||
#### createDirectDownload(String src_address) | ||
``` | ||
testAPI.createDirectDownload(src_address).then(console.log); | ||
``` | ||
The result for the ``` createDirectDownload() ``` command looks like this: | ||
```json | ||
{ | ||
"status": "success", | ||
"location": "https://server.com/path/file.ext", | ||
"filename": "file.ext", | ||
"filesize": 123123123, | ||
"content": [ | ||
{ | ||
"path": "folder/file1.jpg", | ||
"size": 123123123, | ||
"link": "https://server.com/path/file.ext", | ||
"stream_link": "https://server.com/path/file.ext", | ||
"transcode_status": "finished" | ||
} | ||
] | ||
} | ||
``` | ||
#### getTransferList() | ||
``` | ||
testAPI.getTransferList().then(console.log); | ||
``` | ||
The result for the ``` getTransferList() ``` command looks like this: | ||
@@ -87,2 +277,41 @@ | ||
#### clearTransferList() | ||
``` | ||
testAPI.clearTransferList().then(console.log); | ||
``` | ||
The result for the ``` clearTransferList() ``` command looks like this: | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string" | ||
} | ||
``` | ||
#### deleteTransfer(String transfer_id) | ||
``` | ||
testAPI.deleteTransfer(transfer_id).then(console.log); | ||
``` | ||
The result for the ``` deleteTransfer() ``` command looks like this: | ||
```json | ||
{ | ||
"status": "success", | ||
"message": "string" | ||
} | ||
``` | ||
#### getAccountInfo() | ||
``` | ||
testAPI.getAccountInfo().then(console.log); | ||
``` | ||
The result for the ``` getAccountInfo() ``` command looks like this: | ||
@@ -100,4 +329,81 @@ | ||
#### createZipDownload(String|String[] file_id, String|String[] folder_id) | ||
``` | ||
testAPI.createZipDownload(file_id, folder_id).then(console.log); | ||
``` | ||
The result for the ``` createZipDownload() ``` command looks like this: | ||
```json | ||
{ | ||
"status": "success", | ||
"location": "string" | ||
} | ||
``` | ||
#### checkHosterAvailability(String|String[] src_address) | ||
``` | ||
testAPI.checkHosterAvailability(src_address).then(console.log); | ||
``` | ||
The result for the ``` getAccountInfo() ``` command looks like this: | ||
```json | ||
{ | ||
"status": "success", | ||
"response": [ | ||
true | ||
], | ||
"transcoded": [ | ||
true | ||
], | ||
"filename": [ | ||
"string" | ||
], | ||
"filesize": [ | ||
"string" | ||
] | ||
} | ||
``` | ||
#### getServiceList() | ||
``` | ||
testAPI.getServiceList().then(console.log); | ||
``` | ||
The result for the ``` getAccountInfo() ``` command looks like this: | ||
```json | ||
{ | ||
"directdl": [ | ||
"string" | ||
], | ||
"cache": [ | ||
"string" | ||
], | ||
"fairusefactor": { | ||
"service": 0 | ||
}, | ||
"aliases": { | ||
"service": [ | ||
"string" | ||
] | ||
}, | ||
"regexpatterns": { | ||
"service": [ | ||
"string" | ||
] | ||
} | ||
} | ||
``` | ||
## License | ||
[MIT](LICENSE.md) |
24515
531
406