@internxt/cli 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -27
- package/dist/commands/create-folder.d.ts +3 -3
- package/dist/commands/delete-permanently-file.d.ts +2 -2
- package/dist/commands/delete-permanently-folder.d.ts +2 -2
- package/dist/commands/download-file.d.ts +4 -5
- package/dist/commands/download-file.js +22 -37
- package/dist/commands/list.d.ts +4 -4
- package/dist/commands/login-legacy.d.ts +5 -5
- package/dist/commands/login.d.ts +2 -2
- package/dist/commands/move-file.d.ts +4 -4
- package/dist/commands/move-folder.d.ts +3 -3
- package/dist/commands/rename-file.d.ts +3 -3
- package/dist/commands/rename-folder.d.ts +3 -3
- package/dist/commands/trash-clear.d.ts +2 -2
- package/dist/commands/trash-file.d.ts +2 -2
- package/dist/commands/trash-folder.d.ts +2 -2
- package/dist/commands/trash-list.d.ts +2 -2
- package/dist/commands/trash-restore-file.d.ts +4 -4
- package/dist/commands/trash-restore-folder.d.ts +3 -3
- package/dist/commands/upload-file.d.ts +6 -7
- package/dist/commands/upload-file.js +7 -40
- package/dist/commands/upload-folder.d.ts +16 -0
- package/dist/commands/upload-folder.js +87 -0
- package/dist/commands/webdav-config.d.ts +6 -6
- package/dist/commands/webdav.d.ts +1 -1
- package/dist/services/drive/drive-folder.service.d.ts +1 -1
- package/dist/services/drive/trash.service.d.ts +1 -1
- package/dist/services/local-filesystem/local-filesystem.service.d.ts +6 -0
- package/dist/services/local-filesystem/local-filesystem.service.js +57 -0
- package/dist/services/local-filesystem/local-filesystem.types.d.ts +13 -0
- package/dist/services/local-filesystem/local-filesystem.types.js +2 -0
- package/dist/services/network/upload/upload-facade.service.d.ts +9 -0
- package/dist/services/network/upload/upload-facade.service.js +53 -0
- package/dist/services/network/upload/upload-file.service.d.ts +7 -0
- package/dist/services/network/upload/upload-file.service.js +112 -0
- package/dist/services/network/upload/upload-folder.service.d.ts +6 -0
- package/dist/services/network/upload/upload-folder.service.js +62 -0
- package/dist/services/network/upload/upload.types.d.ts +53 -0
- package/dist/services/network/upload/upload.types.js +6 -0
- package/dist/services/thumbnail.service.js +1 -34
- package/dist/types/command.types.d.ts +3 -0
- package/dist/types/command.types.js +8 -1
- package/dist/types/fast-xml-parser.types.d.ts +59 -0
- package/dist/types/fast-xml-parser.types.js +2 -0
- package/dist/utils/cli.utils.d.ts +13 -2
- package/dist/utils/cli.utils.js +47 -0
- package/dist/utils/errors.utils.d.ts +1 -0
- package/dist/utils/errors.utils.js +5 -0
- package/dist/utils/network.utils.d.ts +2 -2
- package/dist/utils/network.utils.js +7 -5
- package/dist/utils/thumbnail.utils.d.ts +17 -0
- package/dist/utils/thumbnail.utils.js +29 -1
- package/dist/utils/xml.utils.d.ts +1 -1
- package/dist/webdav/handlers/GET.handler.js +37 -24
- package/oclif.manifest.json +62 -1
- package/package.json +24 -24
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ We aim to achieve:
|
|
|
38
38
|
|
|
39
39
|
You can install the Internxt CLI by using NPM:
|
|
40
40
|
|
|
41
|
-
Requires Node >= 22.
|
|
41
|
+
Requires Node >= 22.13.0
|
|
42
42
|
|
|
43
43
|
`npm i -g @internxt/cli`
|
|
44
44
|
|
|
@@ -52,7 +52,7 @@ $ npm install -g @internxt/cli
|
|
|
52
52
|
$ internxt COMMAND
|
|
53
53
|
running command...
|
|
54
54
|
$ internxt (--version)
|
|
55
|
-
@internxt/cli/1.6.
|
|
55
|
+
@internxt/cli/1.6.1 linux-x64 node-v22.21.1
|
|
56
56
|
$ internxt --help [COMMAND]
|
|
57
57
|
USAGE
|
|
58
58
|
$ internxt COMMAND
|
|
@@ -103,7 +103,9 @@ USAGE
|
|
|
103
103
|
* [`internxt trash restore file`](#internxt-trash-restore-file)
|
|
104
104
|
* [`internxt trash restore folder`](#internxt-trash-restore-folder)
|
|
105
105
|
* [`internxt upload-file`](#internxt-upload-file)
|
|
106
|
+
* [`internxt upload-folder`](#internxt-upload-folder)
|
|
106
107
|
* [`internxt upload file`](#internxt-upload-file)
|
|
108
|
+
* [`internxt upload folder`](#internxt-upload-folder)
|
|
107
109
|
* [`internxt webdav ACTION`](#internxt-webdav-action)
|
|
108
110
|
* [`internxt webdav-config`](#internxt-webdav-config)
|
|
109
111
|
* [`internxt whoami`](#internxt-whoami)
|
|
@@ -126,7 +128,7 @@ EXAMPLES
|
|
|
126
128
|
$ internxt add-cert
|
|
127
129
|
```
|
|
128
130
|
|
|
129
|
-
_See code: [src/commands/add-cert.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
131
|
+
_See code: [src/commands/add-cert.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/add-cert.ts)_
|
|
130
132
|
|
|
131
133
|
## `internxt autocomplete [SHELL]`
|
|
132
134
|
|
|
@@ -177,7 +179,7 @@ EXAMPLES
|
|
|
177
179
|
$ internxt config
|
|
178
180
|
```
|
|
179
181
|
|
|
180
|
-
_See code: [src/commands/config.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
182
|
+
_See code: [src/commands/config.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/config.ts)_
|
|
181
183
|
|
|
182
184
|
## `internxt create-folder`
|
|
183
185
|
|
|
@@ -206,7 +208,7 @@ EXAMPLES
|
|
|
206
208
|
$ internxt create-folder
|
|
207
209
|
```
|
|
208
210
|
|
|
209
|
-
_See code: [src/commands/create-folder.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
211
|
+
_See code: [src/commands/create-folder.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/create-folder.ts)_
|
|
210
212
|
|
|
211
213
|
## `internxt delete-permanently-file`
|
|
212
214
|
|
|
@@ -236,7 +238,7 @@ EXAMPLES
|
|
|
236
238
|
$ internxt delete-permanently-file
|
|
237
239
|
```
|
|
238
240
|
|
|
239
|
-
_See code: [src/commands/delete-permanently-file.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
241
|
+
_See code: [src/commands/delete-permanently-file.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/delete-permanently-file.ts)_
|
|
240
242
|
|
|
241
243
|
## `internxt delete-permanently-folder`
|
|
242
244
|
|
|
@@ -266,7 +268,7 @@ EXAMPLES
|
|
|
266
268
|
$ internxt delete-permanently-folder
|
|
267
269
|
```
|
|
268
270
|
|
|
269
|
-
_See code: [src/commands/delete-permanently-folder.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
271
|
+
_See code: [src/commands/delete-permanently-folder.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/delete-permanently-folder.ts)_
|
|
270
272
|
|
|
271
273
|
## `internxt delete permanently file`
|
|
272
274
|
|
|
@@ -355,7 +357,7 @@ EXAMPLES
|
|
|
355
357
|
$ internxt download-file
|
|
356
358
|
```
|
|
357
359
|
|
|
358
|
-
_See code: [src/commands/download-file.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
360
|
+
_See code: [src/commands/download-file.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/download-file.ts)_
|
|
359
361
|
|
|
360
362
|
## `internxt download file`
|
|
361
363
|
|
|
@@ -414,7 +416,7 @@ EXAMPLES
|
|
|
414
416
|
$ internxt list
|
|
415
417
|
```
|
|
416
418
|
|
|
417
|
-
_See code: [src/commands/list.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
419
|
+
_See code: [src/commands/list.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/list.ts)_
|
|
418
420
|
|
|
419
421
|
## `internxt login`
|
|
420
422
|
|
|
@@ -442,7 +444,7 @@ EXAMPLES
|
|
|
442
444
|
$ internxt login
|
|
443
445
|
```
|
|
444
446
|
|
|
445
|
-
_See code: [src/commands/login.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
447
|
+
_See code: [src/commands/login.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/login.ts)_
|
|
446
448
|
|
|
447
449
|
## `internxt login-legacy`
|
|
448
450
|
|
|
@@ -474,7 +476,7 @@ EXAMPLES
|
|
|
474
476
|
$ internxt login-legacy
|
|
475
477
|
```
|
|
476
478
|
|
|
477
|
-
_See code: [src/commands/login-legacy.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
479
|
+
_See code: [src/commands/login-legacy.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/login-legacy.ts)_
|
|
478
480
|
|
|
479
481
|
## `internxt logout`
|
|
480
482
|
|
|
@@ -494,7 +496,7 @@ EXAMPLES
|
|
|
494
496
|
$ internxt logout
|
|
495
497
|
```
|
|
496
498
|
|
|
497
|
-
_See code: [src/commands/logout.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
499
|
+
_See code: [src/commands/logout.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/logout.ts)_
|
|
498
500
|
|
|
499
501
|
## `internxt logs`
|
|
500
502
|
|
|
@@ -514,7 +516,7 @@ EXAMPLES
|
|
|
514
516
|
$ internxt logs
|
|
515
517
|
```
|
|
516
518
|
|
|
517
|
-
_See code: [src/commands/logs.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
519
|
+
_See code: [src/commands/logs.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/logs.ts)_
|
|
518
520
|
|
|
519
521
|
## `internxt move-file`
|
|
520
522
|
|
|
@@ -546,7 +548,7 @@ EXAMPLES
|
|
|
546
548
|
$ internxt move-file
|
|
547
549
|
```
|
|
548
550
|
|
|
549
|
-
_See code: [src/commands/move-file.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
551
|
+
_See code: [src/commands/move-file.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/move-file.ts)_
|
|
550
552
|
|
|
551
553
|
## `internxt move-folder`
|
|
552
554
|
|
|
@@ -578,7 +580,7 @@ EXAMPLES
|
|
|
578
580
|
$ internxt move-folder
|
|
579
581
|
```
|
|
580
582
|
|
|
581
|
-
_See code: [src/commands/move-folder.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
583
|
+
_See code: [src/commands/move-folder.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/move-folder.ts)_
|
|
582
584
|
|
|
583
585
|
## `internxt move file`
|
|
584
586
|
|
|
@@ -669,7 +671,7 @@ EXAMPLES
|
|
|
669
671
|
$ internxt rename-file
|
|
670
672
|
```
|
|
671
673
|
|
|
672
|
-
_See code: [src/commands/rename-file.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
674
|
+
_See code: [src/commands/rename-file.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/rename-file.ts)_
|
|
673
675
|
|
|
674
676
|
## `internxt rename-folder`
|
|
675
677
|
|
|
@@ -700,7 +702,7 @@ EXAMPLES
|
|
|
700
702
|
$ internxt rename-folder
|
|
701
703
|
```
|
|
702
704
|
|
|
703
|
-
_See code: [src/commands/rename-folder.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
705
|
+
_See code: [src/commands/rename-folder.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/rename-folder.ts)_
|
|
704
706
|
|
|
705
707
|
## `internxt rename file`
|
|
706
708
|
|
|
@@ -788,7 +790,7 @@ EXAMPLES
|
|
|
788
790
|
$ internxt trash-clear
|
|
789
791
|
```
|
|
790
792
|
|
|
791
|
-
_See code: [src/commands/trash-clear.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
793
|
+
_See code: [src/commands/trash-clear.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/trash-clear.ts)_
|
|
792
794
|
|
|
793
795
|
## `internxt trash-file`
|
|
794
796
|
|
|
@@ -818,7 +820,7 @@ EXAMPLES
|
|
|
818
820
|
$ internxt trash-file
|
|
819
821
|
```
|
|
820
822
|
|
|
821
|
-
_See code: [src/commands/trash-file.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
823
|
+
_See code: [src/commands/trash-file.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/trash-file.ts)_
|
|
822
824
|
|
|
823
825
|
## `internxt trash-folder`
|
|
824
826
|
|
|
@@ -848,7 +850,7 @@ EXAMPLES
|
|
|
848
850
|
$ internxt trash-folder
|
|
849
851
|
```
|
|
850
852
|
|
|
851
|
-
_See code: [src/commands/trash-folder.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
853
|
+
_See code: [src/commands/trash-folder.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/trash-folder.ts)_
|
|
852
854
|
|
|
853
855
|
## `internxt trash-list`
|
|
854
856
|
|
|
@@ -874,7 +876,7 @@ EXAMPLES
|
|
|
874
876
|
$ internxt trash-list
|
|
875
877
|
```
|
|
876
878
|
|
|
877
|
-
_See code: [src/commands/trash-list.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
879
|
+
_See code: [src/commands/trash-list.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/trash-list.ts)_
|
|
878
880
|
|
|
879
881
|
## `internxt trash-restore-file`
|
|
880
882
|
|
|
@@ -905,7 +907,7 @@ EXAMPLES
|
|
|
905
907
|
$ internxt trash-restore-file
|
|
906
908
|
```
|
|
907
909
|
|
|
908
|
-
_See code: [src/commands/trash-restore-file.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
910
|
+
_See code: [src/commands/trash-restore-file.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/trash-restore-file.ts)_
|
|
909
911
|
|
|
910
912
|
## `internxt trash-restore-folder`
|
|
911
913
|
|
|
@@ -936,7 +938,7 @@ EXAMPLES
|
|
|
936
938
|
$ internxt trash-restore-folder
|
|
937
939
|
```
|
|
938
940
|
|
|
939
|
-
_See code: [src/commands/trash-restore-folder.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
941
|
+
_See code: [src/commands/trash-restore-folder.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/trash-restore-folder.ts)_
|
|
940
942
|
|
|
941
943
|
## `internxt trash clear`
|
|
942
944
|
|
|
@@ -1133,7 +1135,38 @@ EXAMPLES
|
|
|
1133
1135
|
$ internxt upload-file
|
|
1134
1136
|
```
|
|
1135
1137
|
|
|
1136
|
-
_See code: [src/commands/upload-file.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
1138
|
+
_See code: [src/commands/upload-file.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/upload-file.ts)_
|
|
1139
|
+
|
|
1140
|
+
## `internxt upload-folder`
|
|
1141
|
+
|
|
1142
|
+
Upload a folder to Internxt Drive
|
|
1143
|
+
|
|
1144
|
+
```
|
|
1145
|
+
USAGE
|
|
1146
|
+
$ internxt upload-folder [--json] [-x] [-f <value>] [-i <value>]
|
|
1147
|
+
|
|
1148
|
+
FLAGS
|
|
1149
|
+
-f, --folder=<value> The path to the folder on your system.
|
|
1150
|
+
-i, --destination=<value> The folder id where the folder is going to be uploaded to. Leave empty for the root folder.
|
|
1151
|
+
|
|
1152
|
+
HELPER FLAGS
|
|
1153
|
+
-x, --non-interactive [env: INXT_NONINTERACTIVE] Prevents the CLI from being interactive. When enabled, the CLI will
|
|
1154
|
+
not request input through the console and will throw errors directly.
|
|
1155
|
+
|
|
1156
|
+
GLOBAL FLAGS
|
|
1157
|
+
--json Format output as json.
|
|
1158
|
+
|
|
1159
|
+
DESCRIPTION
|
|
1160
|
+
Upload a folder to Internxt Drive
|
|
1161
|
+
|
|
1162
|
+
ALIASES
|
|
1163
|
+
$ internxt upload folder
|
|
1164
|
+
|
|
1165
|
+
EXAMPLES
|
|
1166
|
+
$ internxt upload-folder
|
|
1167
|
+
```
|
|
1168
|
+
|
|
1169
|
+
_See code: [src/commands/upload-folder.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/upload-folder.ts)_
|
|
1137
1170
|
|
|
1138
1171
|
## `internxt upload file`
|
|
1139
1172
|
|
|
@@ -1164,6 +1197,35 @@ EXAMPLES
|
|
|
1164
1197
|
$ internxt upload file
|
|
1165
1198
|
```
|
|
1166
1199
|
|
|
1200
|
+
## `internxt upload folder`
|
|
1201
|
+
|
|
1202
|
+
Upload a folder to Internxt Drive
|
|
1203
|
+
|
|
1204
|
+
```
|
|
1205
|
+
USAGE
|
|
1206
|
+
$ internxt upload folder [--json] [-x] [-f <value>] [-i <value>]
|
|
1207
|
+
|
|
1208
|
+
FLAGS
|
|
1209
|
+
-f, --folder=<value> The path to the folder on your system.
|
|
1210
|
+
-i, --destination=<value> The folder id where the folder is going to be uploaded to. Leave empty for the root folder.
|
|
1211
|
+
|
|
1212
|
+
HELPER FLAGS
|
|
1213
|
+
-x, --non-interactive [env: INXT_NONINTERACTIVE] Prevents the CLI from being interactive. When enabled, the CLI will
|
|
1214
|
+
not request input through the console and will throw errors directly.
|
|
1215
|
+
|
|
1216
|
+
GLOBAL FLAGS
|
|
1217
|
+
--json Format output as json.
|
|
1218
|
+
|
|
1219
|
+
DESCRIPTION
|
|
1220
|
+
Upload a folder to Internxt Drive
|
|
1221
|
+
|
|
1222
|
+
ALIASES
|
|
1223
|
+
$ internxt upload folder
|
|
1224
|
+
|
|
1225
|
+
EXAMPLES
|
|
1226
|
+
$ internxt upload folder
|
|
1227
|
+
```
|
|
1228
|
+
|
|
1167
1229
|
## `internxt webdav ACTION`
|
|
1168
1230
|
|
|
1169
1231
|
Enable, disable, restart or get the status of the Internxt CLI WebDav server
|
|
@@ -1188,7 +1250,7 @@ EXAMPLES
|
|
|
1188
1250
|
$ internxt webdav status
|
|
1189
1251
|
```
|
|
1190
1252
|
|
|
1191
|
-
_See code: [src/commands/webdav.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
1253
|
+
_See code: [src/commands/webdav.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/webdav.ts)_
|
|
1192
1254
|
|
|
1193
1255
|
## `internxt webdav-config`
|
|
1194
1256
|
|
|
@@ -1216,7 +1278,7 @@ EXAMPLES
|
|
|
1216
1278
|
$ internxt webdav-config
|
|
1217
1279
|
```
|
|
1218
1280
|
|
|
1219
|
-
_See code: [src/commands/webdav-config.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
1281
|
+
_See code: [src/commands/webdav-config.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/webdav-config.ts)_
|
|
1220
1282
|
|
|
1221
1283
|
## `internxt whoami`
|
|
1222
1284
|
|
|
@@ -1236,7 +1298,7 @@ EXAMPLES
|
|
|
1236
1298
|
$ internxt whoami
|
|
1237
1299
|
```
|
|
1238
1300
|
|
|
1239
|
-
_See code: [src/commands/whoami.ts](https://github.com/internxt/cli/blob/v1.6.
|
|
1301
|
+
_See code: [src/commands/whoami.ts](https://github.com/internxt/cli/blob/v1.6.1/src/commands/whoami.ts)_
|
|
1240
1302
|
<!-- commandsstop -->
|
|
1241
1303
|
|
|
1242
1304
|
# Current Limitations
|
|
@@ -5,9 +5,9 @@ export default class CreateFolder extends Command {
|
|
|
5
5
|
static readonly aliases: never[];
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
name: import("@oclif/core/
|
|
9
|
-
id: import("@oclif/core/
|
|
10
|
-
'non-interactive': import("@oclif/core/
|
|
8
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'non-interactive': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
};
|
|
12
12
|
static readonly enableJsonFlag = true;
|
|
13
13
|
run: () => Promise<{
|
|
@@ -5,8 +5,8 @@ export default class DeletePermanentlyFile extends Command {
|
|
|
5
5
|
static readonly aliases: string[];
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
id: import("@oclif/core/
|
|
9
|
-
'non-interactive': import("@oclif/core/
|
|
8
|
+
id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'non-interactive': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
};
|
|
11
11
|
static readonly enableJsonFlag = true;
|
|
12
12
|
run: () => Promise<{
|
|
@@ -5,8 +5,8 @@ export default class DeletePermanentlyFolder extends Command {
|
|
|
5
5
|
static readonly aliases: string[];
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
id: import("@oclif/core/
|
|
9
|
-
'non-interactive': import("@oclif/core/
|
|
8
|
+
id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'non-interactive': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
};
|
|
11
11
|
static readonly enableJsonFlag = true;
|
|
12
12
|
run: () => Promise<{
|
|
@@ -6,10 +6,10 @@ export default class DownloadFile extends Command {
|
|
|
6
6
|
static readonly aliases: string[];
|
|
7
7
|
static readonly examples: string[];
|
|
8
8
|
static readonly flags: {
|
|
9
|
-
id: import("@oclif/core/
|
|
10
|
-
directory: import("@oclif/core/
|
|
11
|
-
overwrite: import("@oclif/core/
|
|
12
|
-
'non-interactive': import("@oclif/core/
|
|
9
|
+
id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
directory: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
overwrite: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
'non-interactive': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
13
|
};
|
|
14
14
|
static readonly enableJsonFlag = true;
|
|
15
15
|
run: () => Promise<{
|
|
@@ -22,5 +22,4 @@ export default class DownloadFile extends Command {
|
|
|
22
22
|
private getDirectory;
|
|
23
23
|
private getFileMetadata;
|
|
24
24
|
private getDownloadPath;
|
|
25
|
-
private prepareNetwork;
|
|
26
25
|
}
|
|
@@ -6,19 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const core_1 = require("@oclif/core");
|
|
7
7
|
const drive_file_service_1 = require("../services/drive/drive-file.service");
|
|
8
8
|
const cli_utils_1 = require("../utils/cli.utils");
|
|
9
|
-
const network_facade_service_1 = require("../services/network/network-facade.service");
|
|
10
9
|
const auth_service_1 = require("../services/auth.service");
|
|
11
|
-
const crypto_service_1 = require("../services/crypto.service");
|
|
12
|
-
const download_service_1 = require("../services/network/download.service");
|
|
13
|
-
const sdk_manager_service_1 = require("../services/sdk-manager.service");
|
|
14
10
|
const node_fs_1 = require("node:fs");
|
|
15
11
|
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
16
12
|
const node_path_1 = __importDefault(require("node:path"));
|
|
17
13
|
const stream_utils_1 = require("../utils/stream.utils");
|
|
18
14
|
const command_types_1 = require("../types/command.types");
|
|
19
15
|
const validation_service_1 = require("../services/validation.service");
|
|
20
|
-
const inxt_js_1 = require("@internxt/inxt-js");
|
|
21
|
-
const config_service_1 = require("../services/config.service");
|
|
22
16
|
class DownloadFile extends core_1.Command {
|
|
23
17
|
static args = {};
|
|
24
18
|
static description = 'Download and decrypts a file from Internxt Drive to a directory.' +
|
|
@@ -56,25 +50,33 @@ class DownloadFile extends core_1.Command {
|
|
|
56
50
|
const fileUuid = await this.getFileUuid(flags['id'], nonInteractive);
|
|
57
51
|
const driveFile = await this.getFileMetadata(fileUuid, flags['json']);
|
|
58
52
|
const downloadPath = await this.getDownloadPath(downloadDirectory, driveFile, overwrite);
|
|
59
|
-
const { user } = await auth_service_1.AuthService.instance.getAuthDetails();
|
|
60
|
-
const networkFacade = await this.prepareNetwork(user, flags['json']);
|
|
61
|
-
const fileWriteStream = (0, node_fs_1.createWriteStream)(downloadPath);
|
|
62
53
|
const progressBar = cli_utils_1.CLIUtils.progress({
|
|
63
54
|
format: 'Downloading file [{bar}] {percentage}%',
|
|
64
55
|
linewrap: true,
|
|
65
56
|
}, flags['json']);
|
|
66
57
|
progressBar?.start(100, 0);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
58
|
+
if (driveFile.size === 0) {
|
|
59
|
+
await promises_1.default.writeFile(downloadPath, '');
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
if (!driveFile.fileId) {
|
|
63
|
+
throw new command_types_1.NotValidFileIdError();
|
|
64
|
+
}
|
|
65
|
+
const { user } = await auth_service_1.AuthService.instance.getAuthDetails();
|
|
66
|
+
const networkFacade = cli_utils_1.CLIUtils.prepareNetwork({ loginUserDetails: user, jsonFlag: flags['json'] });
|
|
67
|
+
const fileWriteStream = (0, node_fs_1.createWriteStream)(downloadPath);
|
|
68
|
+
const [executeDownload, abortable] = await networkFacade.downloadToStream(driveFile.bucket, user.mnemonic, driveFile.fileId, driveFile.size, stream_utils_1.StreamUtils.writeStreamToWritableStream(fileWriteStream), undefined, {
|
|
69
|
+
abortController: new AbortController(),
|
|
70
|
+
progressCallback: (progress) => {
|
|
71
|
+
progressBar?.update(progress * 0.99);
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
process.on('SIGINT', () => {
|
|
75
|
+
abortable.abort('SIGINT received');
|
|
76
|
+
process.exit(1);
|
|
77
|
+
});
|
|
78
|
+
await executeDownload;
|
|
79
|
+
}
|
|
78
80
|
try {
|
|
79
81
|
await promises_1.default.utimes(downloadPath, new Date(), driveFile.modificationTime ?? driveFile.updatedAt);
|
|
80
82
|
}
|
|
@@ -159,22 +161,5 @@ class DownloadFile extends core_1.Command {
|
|
|
159
161
|
}
|
|
160
162
|
return downloadPath;
|
|
161
163
|
};
|
|
162
|
-
prepareNetwork = async (user, jsonFlag) => {
|
|
163
|
-
cli_utils_1.CLIUtils.doing('Preparing Network', jsonFlag);
|
|
164
|
-
const networkModule = sdk_manager_service_1.SdkManager.instance.getNetwork({
|
|
165
|
-
user: user.bridgeUser,
|
|
166
|
-
pass: user.userId,
|
|
167
|
-
});
|
|
168
|
-
const environment = new inxt_js_1.Environment({
|
|
169
|
-
bridgeUser: user.bridgeUser,
|
|
170
|
-
bridgePass: user.userId,
|
|
171
|
-
bridgeUrl: config_service_1.ConfigService.instance.get('NETWORK_URL'),
|
|
172
|
-
encryptionKey: user.mnemonic,
|
|
173
|
-
appDetails: sdk_manager_service_1.SdkManager.getAppDetails(),
|
|
174
|
-
});
|
|
175
|
-
const networkFacade = new network_facade_service_1.NetworkFacade(networkModule, environment, download_service_1.DownloadService.instance, crypto_service_1.CryptoService.instance);
|
|
176
|
-
cli_utils_1.CLIUtils.done(jsonFlag);
|
|
177
|
-
return networkFacade;
|
|
178
|
-
};
|
|
179
164
|
}
|
|
180
165
|
exports.default = DownloadFile;
|
package/dist/commands/list.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ export default class List extends Command {
|
|
|
5
5
|
static readonly aliases: never[];
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
id: import("@oclif/core/
|
|
9
|
-
extended: import("@oclif/core/
|
|
10
|
-
'non-interactive': import("@oclif/core/
|
|
8
|
+
id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
extended: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
'non-interactive': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
};
|
|
12
12
|
static readonly enableJsonFlag = true;
|
|
13
13
|
run: () => Promise<{
|
|
@@ -37,7 +37,7 @@ export default class List extends Command {
|
|
|
37
37
|
files: {
|
|
38
38
|
id: number;
|
|
39
39
|
uuid: string;
|
|
40
|
-
fileId: string;
|
|
40
|
+
fileId: string | null;
|
|
41
41
|
name: string;
|
|
42
42
|
type: string;
|
|
43
43
|
size: string;
|
|
@@ -5,11 +5,11 @@ export default class LoginLegacy extends Command {
|
|
|
5
5
|
static readonly aliases: never[];
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
email: import("@oclif/core/
|
|
9
|
-
password: import("@oclif/core/
|
|
10
|
-
twofactor: import("@oclif/core/
|
|
11
|
-
twofactortoken: import("@oclif/core/
|
|
12
|
-
'non-interactive': import("@oclif/core/
|
|
8
|
+
email: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
password: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
twofactor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
twofactortoken: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'non-interactive': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
13
|
};
|
|
14
14
|
static readonly enableJsonFlag = true;
|
|
15
15
|
run: () => Promise<{
|
package/dist/commands/login.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export default class Login extends Command {
|
|
|
5
5
|
static readonly aliases: never[];
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
host: import("@oclif/core/
|
|
9
|
-
port: import("@oclif/core/
|
|
8
|
+
host: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
port: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
};
|
|
11
11
|
static readonly enableJsonFlag = true;
|
|
12
12
|
run: () => Promise<{
|
|
@@ -5,9 +5,9 @@ export default class MoveFile extends Command {
|
|
|
5
5
|
static readonly aliases: string[];
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
id: import("@oclif/core/
|
|
9
|
-
destination: import("@oclif/core/
|
|
10
|
-
'non-interactive': import("@oclif/core/
|
|
8
|
+
id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
destination: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'non-interactive': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
};
|
|
12
12
|
static readonly enableJsonFlag = true;
|
|
13
13
|
run: () => Promise<{
|
|
@@ -16,7 +16,7 @@ export default class MoveFile extends Command {
|
|
|
16
16
|
file: {
|
|
17
17
|
id: number;
|
|
18
18
|
uuid: string;
|
|
19
|
-
fileId: string;
|
|
19
|
+
fileId: string | null;
|
|
20
20
|
name: string;
|
|
21
21
|
type: string;
|
|
22
22
|
size: string;
|
|
@@ -5,9 +5,9 @@ export default class MoveFolder extends Command {
|
|
|
5
5
|
static readonly aliases: string[];
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
id: import("@oclif/core/
|
|
9
|
-
destination: import("@oclif/core/
|
|
10
|
-
'non-interactive': import("@oclif/core/
|
|
8
|
+
id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
destination: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'non-interactive': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
};
|
|
12
12
|
static readonly enableJsonFlag = true;
|
|
13
13
|
run: () => Promise<{
|
|
@@ -5,9 +5,9 @@ export default class RenameFile extends Command {
|
|
|
5
5
|
static readonly aliases: string[];
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
id: import("@oclif/core/
|
|
9
|
-
name: import("@oclif/core/
|
|
10
|
-
'non-interactive': import("@oclif/core/
|
|
8
|
+
id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'non-interactive': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
};
|
|
12
12
|
static readonly enableJsonFlag = true;
|
|
13
13
|
run: () => Promise<{
|
|
@@ -5,9 +5,9 @@ export default class RenameFolder extends Command {
|
|
|
5
5
|
static readonly aliases: string[];
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
id: import("@oclif/core/
|
|
9
|
-
name: import("@oclif/core/
|
|
10
|
-
'non-interactive': import("@oclif/core/
|
|
8
|
+
id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'non-interactive': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
};
|
|
12
12
|
static readonly enableJsonFlag = true;
|
|
13
13
|
run: () => Promise<{
|
|
@@ -5,8 +5,8 @@ export default class TrashClear extends Command {
|
|
|
5
5
|
static readonly aliases: string[];
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
force: import("@oclif/core/
|
|
9
|
-
'non-interactive': import("@oclif/core/
|
|
8
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
'non-interactive': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
};
|
|
11
11
|
static readonly enableJsonFlag = true;
|
|
12
12
|
run: () => Promise<{
|
|
@@ -5,8 +5,8 @@ export default class TrashFile extends Command {
|
|
|
5
5
|
static readonly aliases: string[];
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
id: import("@oclif/core/
|
|
9
|
-
'non-interactive': import("@oclif/core/
|
|
8
|
+
id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'non-interactive': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
};
|
|
11
11
|
static readonly enableJsonFlag = true;
|
|
12
12
|
run: () => Promise<{
|
|
@@ -5,8 +5,8 @@ export default class TrashFolder extends Command {
|
|
|
5
5
|
static readonly aliases: string[];
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
id: import("@oclif/core/
|
|
9
|
-
'non-interactive': import("@oclif/core/
|
|
8
|
+
id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'non-interactive': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
};
|
|
11
11
|
static readonly enableJsonFlag = true;
|
|
12
12
|
run: () => Promise<{
|
|
@@ -5,7 +5,7 @@ export default class TrashList extends Command {
|
|
|
5
5
|
static readonly aliases: string[];
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
extended: import("@oclif/core/
|
|
8
|
+
extended: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
9
|
};
|
|
10
10
|
static readonly enableJsonFlag = true;
|
|
11
11
|
run: () => Promise<{
|
|
@@ -35,7 +35,7 @@ export default class TrashList extends Command {
|
|
|
35
35
|
files: {
|
|
36
36
|
id: number;
|
|
37
37
|
uuid: string;
|
|
38
|
-
fileId: string;
|
|
38
|
+
fileId: string | null;
|
|
39
39
|
name: string;
|
|
40
40
|
type: string;
|
|
41
41
|
size: string;
|