1+ import { Command } from 'commander' ;
12import { logger } from '../lib/utils/logger' ;
23import { buildCommand } from './CommandInterface' ;
34import { createBucket } from './create-bucket' ;
@@ -7,16 +8,14 @@ import { getDownloadLinks } from './get-download-links';
78import { getFileInfo } from './get-filo-info' ;
89import { renameFile } from './rename-file' ;
910import { uploadFile } from './upload-file' ;
10- import { uploadFileMultipart } from './upload-file-multipart' ;
11- import { uploadFolder } from './upload-folder-zip' ;
1211
1312function notifyProgramFinished ( programName : string ) {
1413 return ( ) => {
1514 logger . info ( 'Program "%s" finished' , programName ) ;
1615 } ;
1716}
1817
19- export const uploadFileCommand = buildCommand ( {
18+ export const uploadFileCommand : Command = buildCommand ( {
2019 version : '0.0.1' ,
2120 command : 'upload-file <path>' ,
2221 description : 'Upload a file' ,
@@ -25,25 +24,7 @@ export const uploadFileCommand = buildCommand({
2524 return uploadFile ( path ) ;
2625} ) ;
2726
28- export const uploadFileMultipartCommand = buildCommand ( {
29- version : '0.0.1' ,
30- command : 'upload-file-multipart <path>' ,
31- description : 'Upload a file using multipart' ,
32- options : [ ] ,
33- } ) . action ( ( path ) => {
34- return uploadFileMultipart ( path ) ;
35- } ) ;
36-
37- export const uploadFolderZipCommand = buildCommand ( {
38- version : '0.0.1' ,
39- command : 'upload-folder-zip <path>' ,
40- description : 'Upload a folder zipped' ,
41- options : [ ] ,
42- } ) . action ( ( path : string ) => {
43- uploadFolder ( path ) . finally ( notifyProgramFinished ( 'upload-folder-zip' ) ) ;
44- } ) ;
45-
46- export const downloadFileCommand = buildCommand ( {
27+ export const downloadFileCommand : Command = buildCommand ( {
4728 version : '0.0.1' ,
4829 command : 'download-file <fileId> <path>' ,
4930 description : 'Download a file' ,
@@ -52,7 +33,7 @@ export const downloadFileCommand = buildCommand({
5233 downloadFile ( fileId , path , 1 ) . finally ( notifyProgramFinished ( 'download-file' ) ) ;
5334} ) ;
5435
55- export const downloadFileCommandParallel = buildCommand ( {
36+ export const downloadFileCommandParallel : Command = buildCommand ( {
5637 version : '0.0.1' ,
5738 command : 'download-file-parallel <fileId> <path>' ,
5839 description : 'Download a file' ,
@@ -61,7 +42,7 @@ export const downloadFileCommandParallel = buildCommand({
6142 downloadFile ( fileId , path , 10 ) . finally ( notifyProgramFinished ( 'download-file-parallel' ) ) ;
6243} ) ;
6344
64- export const renameFileCommand = buildCommand ( {
45+ export const renameFileCommand : Command = buildCommand ( {
6546 version : '0.0.1' ,
6647 command : 'rename-file <fileId> <newName>' ,
6748 description : 'Renames a file in the network' ,
@@ -70,7 +51,7 @@ export const renameFileCommand = buildCommand({
7051 renameFile ( fileId , newName ) . finally ( notifyProgramFinished ( 'rename-file' ) ) ;
7152} ) ;
7253
73- export const getFileInfoCommand = buildCommand ( {
54+ export const getFileInfoCommand : Command = buildCommand ( {
7455 version : '0.0.1' ,
7556 command : 'get-file-info <fileId>' ,
7657 description : 'Gets file info' ,
@@ -79,7 +60,7 @@ export const getFileInfoCommand = buildCommand({
7960 getFileInfo ( fileId ) . finally ( notifyProgramFinished ( 'get-file-info' ) ) ;
8061} ) ;
8162
82- export const createBucketCommand = buildCommand ( {
63+ export const createBucketCommand : Command = buildCommand ( {
8364 version : '0.0.1' ,
8465 command : 'create-bucket <bucketName>' ,
8566 description : 'Creates a bucket with the given name' ,
@@ -88,7 +69,7 @@ export const createBucketCommand = buildCommand({
8869 createBucket ( bucketName ) . finally ( notifyProgramFinished ( 'create-bucket' ) ) ;
8970} ) ;
9071
91- export const deleteBucketCommand = buildCommand ( {
72+ export const deleteBucketCommand : Command = buildCommand ( {
9273 version : '0.0.1' ,
9374 command : 'delete-bucket <bucketId>' ,
9475 description : 'Deletes a bucket given its id' ,
@@ -97,7 +78,7 @@ export const deleteBucketCommand = buildCommand({
9778 deleteBucket ( bucketId ) . finally ( notifyProgramFinished ( 'delete-bucket' ) ) ;
9879} ) ;
9980
100- export const getDownloadLinksCommand = buildCommand ( {
81+ export const getDownloadLinksCommand : Command = buildCommand ( {
10182 version : '0.0.1' ,
10283 command : 'get-download-links <bucketId> <fileIdsSeparatedByCommas>' ,
10384 description : 'Gets download links of file ids' ,
0 commit comments