Skip to content

Commit e43ad6f

Browse files
authored
Merge pull request #122 from internxt/fix/rclone-tree-listing
[_]: fix/rclone-tree-listing
2 parents 7de7008 + c7b6a46 commit e43ad6f

File tree

12 files changed

+92
-370
lines changed

12 files changed

+92
-370
lines changed

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.3 darwin-arm64 node-v20.14.0
34+
@internxt/cli/1.3.5 win32-x64 node-v20.2.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.3/src/commands/add-cert.ts)_
82+
_See code: [src/commands/add-cert.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/config.ts)_
111+
_See code: [src/commands/config.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/create-folder.ts)_
132+
_See code: [src/commands/create-folder.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/download.ts)_
155+
_See code: [src/commands/download.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/list.ts)_
189+
_See code: [src/commands/list.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/login.ts)_
215+
_See code: [src/commands/login.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/logout.ts)_
232+
_See code: [src/commands/logout.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/logs.ts)_
249+
_See code: [src/commands/logs.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/move.ts)_
274+
_See code: [src/commands/move.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/rename.ts)_
299+
_See code: [src/commands/rename.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/trash.ts)_
323+
_See code: [src/commands/trash.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/trash-clear.ts)_
350+
_See code: [src/commands/trash-clear.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/trash-list.ts)_
386+
_See code: [src/commands/trash-list.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/trash-restore.ts)_
414+
_See code: [src/commands/trash-restore.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/upload.ts)_
523+
_See code: [src/commands/upload.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/webdav.ts)_
546+
_See code: [src/commands/webdav.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/webdav-config.ts)_
574+
_See code: [src/commands/webdav-config.ts](https://github.com/internxt/cli/blob/v1.3.5/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.3/src/commands/whoami.ts)_
591+
_See code: [src/commands/whoami.ts](https://github.com/internxt/cli/blob/v1.3.5/src/commands/whoami.ts)_
592592
<!-- commandsstop -->
593593

594594
# Current Limitations

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"author": "Internxt <[email protected]>",
3-
"version": "1.3.3",
3+
"version": "1.3.5",
44
"description": "Internxt CLI to manage your encrypted storage",
55
"scripts": {
66
"build": "tsc",
@@ -9,14 +9,15 @@
99
"posttest": "yarn lint",
1010
"prepack": "yarn build && oclif manifest && oclif readme",
1111
"prepare": "husky || true",
12+
"test": "yarn test:unit",
1213
"test:unit": "nyc --reporter=lcov --reporter=text mocha \"test/**/*.test.ts\" --exit",
1314
"dev:webdav": "nodemon -e ts --exec ts-node src/webdav/index.ts",
1415
"version": "oclif readme && git add README.md",
1516
"pack:win": "oclif pack win",
1617
"migrate": "sequelize db:migrate",
1718
"migrate:undo": "sequelize db:migrate:undo",
1819
"publish:npm": "npm run build && npm publish --scope=@internxt --registry=https://registry.npmjs.org/ --access public",
19-
"publish:github": "npm publish --scope=@internxt --registry=https://npm.pkg.github.com",
20+
"publish:github": "npm run build && npm publish --scope=@internxt --registry=https://npm.pkg.github.com",
2021
"postinstall": "node ./scripts/skip-in-ci.js || internxt webdav restart"
2122
},
2223
"homepage": "https://github.com/internxt/cli",
@@ -38,28 +39,27 @@
3839
"@internxt/lib": "^1.2.1",
3940
"@internxt/sdk": "^1.5.25",
4041
"@oclif/core": "^3",
41-
"@rudderstack/rudder-sdk-node": "^2.0.7",
42-
"axios": "^1.6.7",
42+
"axios": "^1.7.7",
4343
"bip39": "^3.1.0",
4444
"body-parser": "^1.20.3",
4545
"chalk": "^5.3.0",
4646
"dayjs": "^1.11.13",
4747
"dotenv": "^16.4.5",
48-
"express": "^4.21.0",
48+
"express": "^4.21.1",
4949
"express-async-handler": "^1.2.0",
5050
"express-basic-auth": "^1.2.1",
5151
"fast-xml-parser": "^4.5.0",
5252
"mime-types": "^2.1.35",
53-
"node-fetch": "2",
53+
"node-fetch": "^2",
5454
"openpgp": "^5.11.1",
5555
"pm2": "^5.4.2",
5656
"reflect-metadata": "^0.2.2",
5757
"selfsigned": "^2.4.1",
58-
"sequelize": "^6.37.3",
58+
"sequelize": "^6.37.5",
5959
"sequelize-typescript": "^2.1.6",
6060
"sqlite3": "^5.1.7",
61-
"superagent": "^10.1.0",
62-
"winston": "^3.14.2"
61+
"superagent": "^10.1.1",
62+
"winston": "^3.16.0"
6363
},
6464
"devDependencies": {
6565
"@internxt/eslint-config-internxt": "^1.0.9",

src/services/analytics.service.ts

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import { apiObject } from '@rudderstack/rudder-sdk-node';
21
import { ConfigService } from './config.service';
3-
//import packageJSON from '../../package.json';
4-
//import os from 'os';
52

63
export const AnalyticsEvents = {
74
CLILogin: 'CLI Login',
@@ -14,43 +11,11 @@ export class AnalyticsService {
1411

1512
constructor(private readonly config: ConfigService) {}
1613

17-
/*private getRudderstack() {
18-
return new Rudderstack(this.config.get('RUDDERSTACK_WRITE_KEY'), {
19-
dataPlaneUrl: this.config.get('RUDDERSTACK_DATAPLANE_URL'),
20-
});
21-
}
22-
23-
private platformShortName(platform: string) {
24-
switch (platform) {
25-
case 'darwin':
26-
return 'MAC';
27-
case 'win32':
28-
return 'WIN';
29-
case 'linux':
30-
return 'LINUX';
31-
default:
32-
return '';
33-
}
34-
}
35-
36-
private platformFamily(platform: string) {
37-
switch (platform) {
38-
case 'darwin':
39-
return 'Mac';
40-
case 'win32':
41-
return 'Windows';
42-
case 'linux':
43-
return 'Linux';
44-
default:
45-
return 'Unknown';
46-
}
47-
}*/
48-
49-
track(
14+
async track(
5015
eventKey: keyof typeof AnalyticsEvents,
5116
options: { app: 'internxt-cli' | 'internxt-webdav'; userId: string },
52-
params: apiObject = {},
17+
params: object = {},
5318
) {
54-
return;
19+
return { eventKey, options, params };
5520
}
5621
}

src/utils/webdav.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class WebDavUtils {
3434
} else {
3535
requestUrl = urlObject.url;
3636
}
37-
const decodedUrl = decodeURIComponent(requestUrl);
37+
const decodedUrl = decodeURIComponent(requestUrl).replaceAll('/./', '/');
3838
const parsedPath = path.parse(decodedUrl);
3939
let parentPath = path.dirname(decodedUrl);
4040
if (!parentPath.startsWith('/')) parentPath = '/'.concat(parentPath);

src/utils/xml.utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ export class XMLUtils {
2121
static addDefaultNamespace(key: string) {
2222
return `${XMLUtils.DEFAULT_NAMESPACE_LETTER}:${key}`;
2323
}
24+
25+
static encodeWebDavUri(uri: string) {
26+
return encodeURIComponent(uri).replaceAll('%2F', '/');
27+
}
2428
}

src/webdav/handlers/MOVE.handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class MOVERequestHandler implements WebDavMethodHandler {
5454
});
5555
await driveDatabaseManager.createFolder(folder, destinationResource.url);
5656
} else if (resource.type === 'file') {
57-
const newType = destinationResource.path.ext.trim().length > 0 ? destinationResource.path.ext : null;
57+
const newType = destinationResource.path.ext.replace('.', '');
5858
const file = originalDriveItem as DriveFileItem;
5959
await driveFileService.renameFile(file.uuid, {
6060
plainName: newName,

src/webdav/handlers/PROPFIND.handler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export class PROPFINDRequestHandler implements WebDavMethodHandler {
211211
const spaceLimit = await UsageService.instance.fetchSpaceLimit();
212212

213213
const driveFolderXML = {
214-
[XMLUtils.addDefaultNamespace('href')]: encodeURIComponent(relativePath),
214+
[XMLUtils.addDefaultNamespace('href')]: XMLUtils.encodeWebDavUri(relativePath),
215215
[XMLUtils.addDefaultNamespace('propstat')]: {
216216
[XMLUtils.addDefaultNamespace('status')]: 'HTTP/1.1 200 OK',
217217
[XMLUtils.addDefaultNamespace('prop')]: {
@@ -243,7 +243,7 @@ export class PROPFINDRequestHandler implements WebDavMethodHandler {
243243
const displayName = `${driveFolderItem.name}`;
244244

245245
const driveFolderXML = {
246-
[XMLUtils.addDefaultNamespace('href')]: encodeURIComponent(relativePath),
246+
[XMLUtils.addDefaultNamespace('href')]: XMLUtils.encodeWebDavUri(relativePath),
247247
[XMLUtils.addDefaultNamespace('propstat')]: {
248248
[XMLUtils.addDefaultNamespace('status')]: 'HTTP/1.1 200 OK',
249249
[XMLUtils.addDefaultNamespace('prop')]: {
@@ -264,7 +264,7 @@ export class PROPFINDRequestHandler implements WebDavMethodHandler {
264264
const displayName = driveFileItem.type ? `${driveFileItem.name}.${driveFileItem.type}` : driveFileItem.name;
265265

266266
const driveFileXML = {
267-
[XMLUtils.addDefaultNamespace('href')]: encodeURIComponent(relativePath),
267+
[XMLUtils.addDefaultNamespace('href')]: XMLUtils.encodeWebDavUri(relativePath),
268268
[XMLUtils.addDefaultNamespace('propstat')]: {
269269
[XMLUtils.addDefaultNamespace('status')]: 'HTTP/1.1 200 OK',
270270
[XMLUtils.addDefaultNamespace('prop')]: {

src/webdav/handlers/PUT.handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class PUTRequestHandler implements WebDavMethodHandler {
7878

7979
const file = await DriveFileService.instance.createFile({
8080
name: resource.path.name,
81-
type: resource.path.ext.replaceAll('.', ''),
81+
type: resource.path.ext.replace('.', ''),
8282
size: contentLength,
8383
folderId: parentFolderItem.id,
8484
fileId: uploadResult.fileId,

test/services/network/download.service.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('Download Service', () => {
4343
});
4444

4545
sandbox.stub(axios, 'get').callsFake((_, config) => {
46-
config?.onDownloadProgress?.({ loaded: 100, total: 100, bytes: 100 });
46+
config?.onDownloadProgress?.({ loaded: 100, total: 100, bytes: 100, lengthComputable: true });
4747
return Promise.resolve({ data: readableContent });
4848
});
4949

test/services/network/network-facade.service.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as NetworkUpload from '@internxt/sdk/dist/network/upload';
2-
32
import { NetworkFacade } from '../../../src/services/network/network-facade.service';
43
import { SdkManager } from '../../../src/services/sdk-manager.service';
54
import path from 'path';
@@ -217,7 +216,7 @@ describe('Network Facade Service', () => {
217216
const options = { progressCallback: sinon.stub() };
218217

219218
networkFacadeSandbox.stub(axios, 'get').callsFake((_, config) => {
220-
config?.onDownloadProgress?.({ loaded: 100, total: 100, bytes: 100 });
219+
config?.onDownloadProgress?.({ loaded: 100, total: 100, bytes: 100, lengthComputable: true });
221220
return Promise.resolve({ data: readableContent });
222221
});
223222
/* networkFacadeSandbox.stub(superagent, 'get').returns({

0 commit comments

Comments
 (0)