Skip to content

Commit 7de7008

Browse files
authored
Merge pull request #119 from internxt/fix/husky-dependency
[_]: fix/husky-dependency
2 parents 8015b4a + 4391ec9 commit 7de7008

11 files changed

Lines changed: 88 additions & 107 deletions

File tree

.husky/pre-commit

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
1+
32
yarn run test:unit
43
yarn run lint
54
yarn lint-staged

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ $ npm install -g @internxt/cli
3131
$ internxt COMMAND
3232
running command...
3333
$ internxt (--version)
34-
@internxt/cli/1.3.0 darwin-arm64 node-v20.14.0
34+
@internxt/cli/1.3.3 darwin-arm64 node-v20.14.0
3535
$ internxt --help [COMMAND]
3636
USAGE
3737
$ internxt COMMAND
@@ -79,7 +79,7 @@ EXAMPLES
7979
$ internxt add-cert
8080
```
8181

82-
_See code: [src/commands/add-cert.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/add-cert.ts)_
82+
_See code: [src/commands/add-cert.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/add-cert.ts)_
8383

8484
## `internxt config`
8585

@@ -108,7 +108,7 @@ EXAMPLES
108108
$ internxt config
109109
```
110110

111-
_See code: [src/commands/config.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/config.ts)_
111+
_See code: [src/commands/config.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/config.ts)_
112112

113113
## `internxt create-folder`
114114

@@ -129,7 +129,7 @@ EXAMPLES
129129
$ internxt create-folder
130130
```
131131

132-
_See code: [src/commands/create-folder.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/create-folder.ts)_
132+
_See code: [src/commands/create-folder.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/create-folder.ts)_
133133

134134
## `internxt download`
135135

@@ -152,7 +152,7 @@ EXAMPLES
152152
$ internxt download
153153
```
154154

155-
_See code: [src/commands/download.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/download.ts)_
155+
_See code: [src/commands/download.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/download.ts)_
156156

157157
## `internxt list`
158158

@@ -186,7 +186,7 @@ EXAMPLES
186186
$ internxt list
187187
```
188188

189-
_See code: [src/commands/list.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/list.ts)_
189+
_See code: [src/commands/list.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/list.ts)_
190190

191191
## `internxt login`
192192

@@ -212,7 +212,7 @@ EXAMPLES
212212
$ internxt login
213213
```
214214

215-
_See code: [src/commands/login.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/login.ts)_
215+
_See code: [src/commands/login.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/login.ts)_
216216

217217
## `internxt logout`
218218

@@ -229,7 +229,7 @@ EXAMPLES
229229
$ internxt logout
230230
```
231231

232-
_See code: [src/commands/logout.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/logout.ts)_
232+
_See code: [src/commands/logout.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/logout.ts)_
233233

234234
## `internxt logs`
235235

@@ -246,7 +246,7 @@ EXAMPLES
246246
$ internxt logs
247247
```
248248

249-
_See code: [src/commands/logs.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/logs.ts)_
249+
_See code: [src/commands/logs.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/logs.ts)_
250250

251251
## `internxt move`
252252

@@ -271,7 +271,7 @@ EXAMPLES
271271
$ internxt move
272272
```
273273

274-
_See code: [src/commands/move.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/move.ts)_
274+
_See code: [src/commands/move.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/move.ts)_
275275

276276
## `internxt rename`
277277

@@ -296,7 +296,7 @@ EXAMPLES
296296
$ internxt rename
297297
```
298298

299-
_See code: [src/commands/rename.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/rename.ts)_
299+
_See code: [src/commands/rename.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/rename.ts)_
300300

301301
## `internxt trash`
302302

@@ -320,7 +320,7 @@ EXAMPLES
320320
$ internxt trash
321321
```
322322

323-
_See code: [src/commands/trash.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/trash.ts)_
323+
_See code: [src/commands/trash.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/trash.ts)_
324324

325325
## `internxt trash-clear`
326326

@@ -347,7 +347,7 @@ EXAMPLES
347347
$ internxt trash-clear
348348
```
349349

350-
_See code: [src/commands/trash-clear.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/trash-clear.ts)_
350+
_See code: [src/commands/trash-clear.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/trash-clear.ts)_
351351

352352
## `internxt trash-list`
353353

@@ -383,7 +383,7 @@ EXAMPLES
383383
$ internxt trash-list
384384
```
385385

386-
_See code: [src/commands/trash-list.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/trash-list.ts)_
386+
_See code: [src/commands/trash-list.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/trash-list.ts)_
387387

388388
## `internxt trash-restore`
389389

@@ -411,7 +411,7 @@ EXAMPLES
411411
$ internxt trash-restore
412412
```
413413

414-
_See code: [src/commands/trash-restore.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/trash-restore.ts)_
414+
_See code: [src/commands/trash-restore.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/trash-restore.ts)_
415415

416416
## `internxt trash clear`
417417

@@ -520,7 +520,7 @@ EXAMPLES
520520
$ internxt upload
521521
```
522522

523-
_See code: [src/commands/upload.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/upload.ts)_
523+
_See code: [src/commands/upload.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/upload.ts)_
524524

525525
## `internxt webdav ACTION`
526526

@@ -543,7 +543,7 @@ EXAMPLES
543543
$ internxt webdav status
544544
```
545545

546-
_See code: [src/commands/webdav.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/webdav.ts)_
546+
_See code: [src/commands/webdav.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/webdav.ts)_
547547

548548
## `internxt webdav-config ACTION`
549549

@@ -571,7 +571,7 @@ EXAMPLES
571571
$ internxt webdav-config change-port
572572
```
573573

574-
_See code: [src/commands/webdav-config.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/webdav-config.ts)_
574+
_See code: [src/commands/webdav-config.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/webdav-config.ts)_
575575

576576
## `internxt whoami`
577577

@@ -588,7 +588,7 @@ EXAMPLES
588588
$ internxt whoami
589589
```
590590

591-
_See code: [src/commands/whoami.ts](https://github.com/internxt/cli/blob/v1.3.0/src/commands/whoami.ts)_
591+
_See code: [src/commands/whoami.ts](https://github.com/internxt/cli/blob/v1.3.3/src/commands/whoami.ts)_
592592
<!-- commandsstop -->
593593

594594
# Current Limitations

package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
11
{
22
"author": "Internxt <hello@internxt.com>",
3-
"version": "1.3.0",
3+
"version": "1.3.3",
44
"description": "Internxt CLI to manage your encrypted storage",
55
"scripts": {
66
"build": "tsc",
77
"lint": "eslint . --ext .ts",
88
"postpack": "shx rm -f oclif.manifest.json",
99
"posttest": "yarn lint",
1010
"prepack": "yarn build && oclif manifest && oclif readme",
11-
"prepare": "husky",
11+
"prepare": "husky || true",
1212
"test:unit": "nyc --reporter=lcov --reporter=text mocha \"test/**/*.test.ts\" --exit",
1313
"dev:webdav": "nodemon -e ts --exec ts-node src/webdav/index.ts",
1414
"version": "oclif readme && git add README.md",
1515
"pack:win": "oclif pack win",
1616
"migrate": "sequelize db:migrate",
1717
"migrate:undo": "sequelize db:migrate:undo",
1818
"publish:npm": "npm run build && npm publish --scope=@internxt --registry=https://registry.npmjs.org/ --access public",
19-
"publish:github": "npm publish",
19+
"publish:github": "npm publish --scope=@internxt --registry=https://npm.pkg.github.com",
2020
"postinstall": "node ./scripts/skip-in-ci.js || internxt webdav restart"
2121
},
22-
"publishConfig": {
23-
"access": "public",
24-
"registry": "https://registry.npmjs.org/"
25-
},
2622
"homepage": "https://github.com/internxt/cli",
2723
"license": "MIT",
2824
"main": "",

src/commands/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default class Config extends Command {
2828
const configList = [
2929
{ key: 'Email', value: userCredentials.user.email },
3030
{ key: 'Root folder ID', value: userCredentials.root_folder_uuid },
31-
{ key: 'Used space', value: FormatUtils.humanFileSize(await UsageService.instance.fetchTotalUsage()) },
31+
{ key: 'Used space', value: FormatUtils.humanFileSize((await UsageService.instance.fetchUsage()).total) },
3232
{ key: 'Available space', value: FormatUtils.formatLimit(await UsageService.instance.fetchSpaceLimit()) },
3333
];
3434
ux.table(

src/services/sdk-manager.service.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Auth, Drive, photos, Network as NetworkModule } from '@internxt/sdk';
1+
import { Auth, Drive, Network as NetworkModule } from '@internxt/sdk';
22
import { Trash } from '@internxt/sdk/dist/drive';
33
import { ApiSecurity, AppDetails } from '@internxt/sdk/dist/shared';
44
import { ConfigService } from './config.service';
@@ -135,15 +135,6 @@ export class SdkManager {
135135
});
136136
}
137137

138-
/** Photos SDK */
139-
getPhotos() {
140-
const PHOTOS_API_URL = ConfigService.instance.get('PHOTOS_API_URL');
141-
142-
const newToken = SdkManager.getApiSecurity().newToken;
143-
144-
return new photos.Photos(PHOTOS_API_URL, newToken);
145-
}
146-
147138
/** Share SDK */
148139
getShare() {
149140
const DRIVE_NEW_API_URL = ConfigService.instance.get('DRIVE_NEW_API_URL');

src/services/usage.service.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1+
import { UsageResponse } from '@internxt/sdk/dist/drive/storage/types';
12
import { SdkManager } from './sdk-manager.service';
23

34
export class UsageService {
45
public static readonly instance: UsageService = new UsageService();
56
public static readonly INFINITE_LIMIT = 99 * Math.pow(1024, 4);
67

7-
public fetchTotalUsage = async (): Promise<number> => {
8+
public fetchUsage = async (): Promise<UsageResponse> => {
89
const storageClient = SdkManager.instance.getStorage();
9-
const photosClient = SdkManager.instance.getPhotos();
10+
const driveUsage = await storageClient.spaceUsage();
1011

11-
const [driveUsage, { usage: photosUsage }] = await Promise.all([
12-
storageClient.spaceUsage(),
13-
photosClient.photos.getUsage(),
14-
]);
15-
16-
return driveUsage.total + photosUsage;
12+
return driveUsage;
1713
};
1814

1915
public fetchSpaceLimit = async (): Promise<number> => {

0 commit comments

Comments
 (0)