Skip to content

Commit

Permalink
Merge pull request #67 from internxt/fix/auth-check-imports
Browse files Browse the repository at this point in the history
[_]:(fix) Fix auth check hook imports
  • Loading branch information
PixoDev authored Apr 9, 2024
2 parents 2960c29 + 790cbf6 commit 4a5bce4
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 28 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $ npm install -g @internxt/cli
$ internxt COMMAND
running command...
$ internxt (--version)
@internxt/cli/0.1.5 darwin-arm64 node-v20.10.0
@internxt/cli/0.1.19 darwin-arm64 node-v20.10.0
$ internxt --help [COMMAND]
USAGE
$ internxt COMMAND
Expand Down Expand Up @@ -84,7 +84,7 @@ EXAMPLES
$ internxt config
```

_See code: [src/commands/config.ts](https://github.com/internxt/cli/blob/v0.1.5/src/commands/config.ts)_
_See code: [src/commands/config.ts](https://github.com/internxt/cli/blob/v0.1.19/src/commands/config.ts)_

## `internxt download`

Expand All @@ -107,7 +107,7 @@ EXAMPLES
$ internxt download
```

_See code: [src/commands/download.ts](https://github.com/internxt/cli/blob/v0.1.5/src/commands/download.ts)_
_See code: [src/commands/download.ts](https://github.com/internxt/cli/blob/v0.1.19/src/commands/download.ts)_

## `internxt list`

Expand Down Expand Up @@ -141,7 +141,7 @@ EXAMPLES
$ internxt list
```

_See code: [src/commands/list.ts](https://github.com/internxt/cli/blob/v0.1.5/src/commands/list.ts)_
_See code: [src/commands/list.ts](https://github.com/internxt/cli/blob/v0.1.19/src/commands/list.ts)_

## `internxt login`

Expand All @@ -167,7 +167,7 @@ EXAMPLES
$ internxt login
```

_See code: [src/commands/login.ts](https://github.com/internxt/cli/blob/v0.1.5/src/commands/login.ts)_
_See code: [src/commands/login.ts](https://github.com/internxt/cli/blob/v0.1.19/src/commands/login.ts)_

## `internxt logout`

Expand All @@ -184,7 +184,7 @@ EXAMPLES
$ internxt logout
```

_See code: [src/commands/logout.ts](https://github.com/internxt/cli/blob/v0.1.5/src/commands/logout.ts)_
_See code: [src/commands/logout.ts](https://github.com/internxt/cli/blob/v0.1.19/src/commands/logout.ts)_

## `internxt logs`

Expand All @@ -201,7 +201,7 @@ EXAMPLES
$ internxt logs
```

_See code: [src/commands/logs.ts](https://github.com/internxt/cli/blob/v0.1.5/src/commands/logs.ts)_
_See code: [src/commands/logs.ts](https://github.com/internxt/cli/blob/v0.1.19/src/commands/logs.ts)_

## `internxt move`

Expand All @@ -226,7 +226,7 @@ EXAMPLES
$ internxt move
```

_See code: [src/commands/move.ts](https://github.com/internxt/cli/blob/v0.1.5/src/commands/move.ts)_
_See code: [src/commands/move.ts](https://github.com/internxt/cli/blob/v0.1.19/src/commands/move.ts)_

## `internxt trash`

Expand All @@ -250,7 +250,7 @@ EXAMPLES
$ internxt trash
```

_See code: [src/commands/trash.ts](https://github.com/internxt/cli/blob/v0.1.5/src/commands/trash.ts)_
_See code: [src/commands/trash.ts](https://github.com/internxt/cli/blob/v0.1.19/src/commands/trash.ts)_

## `internxt upload`

Expand All @@ -274,7 +274,7 @@ EXAMPLES
$ internxt upload
```

_See code: [src/commands/upload.ts](https://github.com/internxt/cli/blob/v0.1.5/src/commands/upload.ts)_
_See code: [src/commands/upload.ts](https://github.com/internxt/cli/blob/v0.1.19/src/commands/upload.ts)_

## `internxt webdav ACTION`

Expand All @@ -291,7 +291,7 @@ EXAMPLES
$ internxt webdav
```

_See code: [src/commands/webdav.ts](https://github.com/internxt/cli/blob/v0.1.5/src/commands/webdav.ts)_
_See code: [src/commands/webdav.ts](https://github.com/internxt/cli/blob/v0.1.19/src/commands/webdav.ts)_

## `internxt whoami`

Expand All @@ -308,5 +308,5 @@ EXAMPLES
$ internxt whoami
```

_See code: [src/commands/whoami.ts](https://github.com/internxt/cli/blob/v0.1.5/src/commands/whoami.ts)_
_See code: [src/commands/whoami.ts](https://github.com/internxt/cli/blob/v0.1.19/src/commands/whoami.ts)_
<!-- commandsstop -->
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"author": "PixoDev",
"version": "0.1.5",
"version": "0.1.19",
"description": "Internxt CLI to manage your encrypted storage",
"scripts": {
"build": "tsc",
Expand All @@ -13,7 +13,9 @@
"dev:webdav": "nodemon -e ts --exec ts-node src/webdav/index.ts",
"version": "oclif readme && git add README.md",
"migrate": "sequelize db:migrate",
"migrate:undo": "sequelize db:migrate:undo"
"migrate:undo": "sequelize db:migrate:undo",
"publish:npm": "npm run build && npm publish --scope=@internxt --registry=https://registry.npmjs.org/ --access public",
"publish:github": "npm publish"
},
"publishConfig": {
"access": "public",
Expand All @@ -33,8 +35,8 @@
"/oclif.manifest.json"
],
"dependencies": {
"@internxt/inxt-js": "^2.0.9",
"@internxt/lib": "^1.2.0",
"@internxt/inxt-js": "^2.0.11",
"@internxt/lib": "^1.2.1",
"@internxt/sdk": "^1.4.76",
"@oclif/core": "^3",
"axios": "^1.6.7",
Expand Down
1 change: 1 addition & 0 deletions src/services/database/drive-database-manager.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export class DriveDatabaseManager {
dialect: 'sqlite',
storage: ConfigService.DRIVE_SQLITE_FILE,
models: [DriveFileModel, DriveFolderModel],
logging: false,
});

constructor(
Expand Down
8 changes: 1 addition & 7 deletions src/services/database/drive-file/drive-file.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
Table,
Unique,
} from 'sequelize-typescript';
import { FileStatus } from '@internxt/sdk/dist/drive/storage/types';
import { DriveFileAttributes } from './drive-file.attributes';

@Table({
Expand Down Expand Up @@ -49,12 +48,7 @@ export class DriveFileModel extends Model implements DriveFileAttributes {
@Column(DataType.BIGINT)
declare size: number;

@Column({
type: DataType.ENUM,
values: Object.values(FileStatus),
defaultValue: FileStatus.EXISTS,
allowNull: false,
})
@Column(DataType.STRING)
declare status: string;

@Column(DataType.DATE)
Expand Down
8 changes: 8 additions & 0 deletions src/webdav/handlers/COPY.handler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { WebDavMethodHandler } from '../../types/webdav.types';
import { NotImplementedError } from '../../utils/errors.utils';

export class COPYRequestHandler implements WebDavMethodHandler {
async handle() {
throw new NotImplementedError('COPY is not implemented yet.');
}
}
8 changes: 8 additions & 0 deletions src/webdav/handlers/DELETE.handler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { WebDavMethodHandler } from '../../types/webdav.types';
import { NotImplementedError } from '../../utils/errors.utils';

export class DELETERequestHandler implements WebDavMethodHandler {
async handle() {
throw new NotImplementedError('DELETE is not implemented yet.');
}
}
8 changes: 8 additions & 0 deletions src/webdav/handlers/MKCOL.handler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { WebDavMethodHandler } from '../../types/webdav.types';
import { NotImplementedError } from '../../utils/errors.utils';

export class MKCOLRequestHandler implements WebDavMethodHandler {
async handle() {
throw new NotImplementedError('MKCOL is not implemented yet.');
}
}
8 changes: 8 additions & 0 deletions src/webdav/handlers/MOVE.handler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { WebDavMethodHandler } from '../../types/webdav.types';
import { NotImplementedError } from '../../utils/errors.utils';

export class MOVERequestHandler implements WebDavMethodHandler {
async handle() {
throw new NotImplementedError('MOVE is not implemented yet.');
}
}
8 changes: 8 additions & 0 deletions src/webdav/handlers/PROPPATCH.handler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { WebDavMethodHandler } from '../../types/webdav.types';
import { NotImplementedError } from '../../utils/errors.utils';

export class PROPPATCHRequestHandler implements WebDavMethodHandler {
async handle() {
throw new NotImplementedError('PROPPATCH is not implemented yet.');
}
}
11 changes: 11 additions & 0 deletions src/webdav/webdav-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ import { SdkManager } from '../services/sdk-manager.service';
import { NetworkFacade } from '../services/network/network-facade.service';
import { NetworkUtils } from '../utils/network.utils';
import { PUTRequestHandler } from './handlers/PUT.handler';
import { MKCOLRequestHandler } from './handlers/MKCOL.handler';
import { DELETERequestHandler } from './handlers/DELETE.handler';
import { PROPPATCHRequestHandler } from './handlers/PROPPATCH.handler';
import { MOVERequestHandler } from './handlers/MOVE.handler';
import { COPYRequestHandler } from './handlers/COPY.handler';

export class WebDavServer {
constructor(
Expand Down Expand Up @@ -100,6 +105,12 @@ export class WebDavServer {
}).handle,
),
);

this.app.mkcol('*', asyncHandler(new MKCOLRequestHandler().handle));
this.app.delete('*', asyncHandler(new DELETERequestHandler().handle));
this.app.proppatch('*', asyncHandler(new PROPPATCHRequestHandler().handle));
this.app.move('*', asyncHandler(new MOVERequestHandler().handle));
this.app.copy('*', asyncHandler(new COPYRequestHandler().handle));
};

async start() {
Expand Down
15 changes: 10 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1328,10 +1328,10 @@
"@typescript-eslint/parser" "^5.4.0"
eslint-config-prettier "^8.3.0"

"@internxt/inxt-js@^2.0.9":
version "2.0.9"
resolved "https://npm.pkg.github.com/download/@internxt/inxt-js/2.0.9/063402c354b4c2d2052ae0cf1b38a37517abd833#063402c354b4c2d2052ae0cf1b38a37517abd833"
integrity sha512-ErH7L35JM8G0nOyEOKDRbF3NF4MsEhm/dbmUFkt4lfz1B3WIF+ocz92uCAdEej8Xdf/JAOsiclY9u94CLe1cHw==
"@internxt/inxt-js@^2.0.11":
version "2.0.11"
resolved "https://registry.yarnpkg.com/@internxt/inxt-js/-/inxt-js-2.0.11.tgz#69566385d83e527031f63f48d475898cd66bbc43"
integrity sha512-TXOYEOOZJGHTsMd8CXJqBQanR8Vu9RNjLP2dkmnXr9Qfqfqr1UpV6rWvF4e4pJAj0ZQDGSYxeqPXm3LXRL0FkQ==
dependencies:
"@internxt/lib" "^1.1.6"
"@internxt/sdk" "^1.4.27"
Expand All @@ -1341,11 +1341,16 @@
undici "^5.5.1"
winston "^3.3.3"

"@internxt/lib@^1.1.6", "@internxt/lib@^1.2.0":
"@internxt/lib@^1.1.6":
version "1.2.0"
resolved "https://npm.pkg.github.com/download/@internxt/lib/1.2.0/172d7929abb3dc34fda044ad9977875791f7a471#172d7929abb3dc34fda044ad9977875791f7a471"
integrity sha512-14byNxSU0S0KSc3g+BWiJb7/fcHUfqxkHQRz9fwJhAHNmgOo+Bhx13xXk07KKUzeNX1JymSGEZkVCk0AOQiM+Q==

"@internxt/lib@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@internxt/lib/-/lib-1.2.1.tgz#fcf83351a178ec6d6038a4a0e251f2065340948b"
integrity sha512-Vepa2uEBPuvtqAPDhA5mgGYl6byZMaRWH0z67vPXoOb4cIfv++S8xXGaOmAUVBktwbhCE4lWuTgT6BN2N19INQ==

"@internxt/prettier-config@^1.0.2":
version "1.0.2"
resolved "https://npm.pkg.github.com/download/@internxt/prettier-config/1.0.2/5bd220b8de76734448db5475b3e0c01f9d22c19b#5bd220b8de76734448db5475b3e0c01f9d22c19b"
Expand Down

0 comments on commit 4a5bce4

Please sign in to comment.