Skip to content

Commit

Permalink
0.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwynr committed Feb 27, 2024
1 parent 3b3342a commit 0c276ba
Show file tree
Hide file tree
Showing 309 changed files with 15,605 additions and 15,604 deletions.
33 changes: 3 additions & 30 deletions dev/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import fs from "fs-extra"
import pathModule from "path"
import { generateRandomString } from "../src/crypto/utils"
import os from "os"
import axios from "axios"
import https from "https"

const filen = new FilenSDK({
email: config.email,
Expand All @@ -21,35 +23,6 @@ const filen = new FilenSDK({
userId: config.userId
})

const main = async () => {
const dir = await filen.fs().readdir({ path: "/Pictures/2" })
const proms: Promise<void>[] = []

for (const file of dir) {
proms.push(
new Promise((resolve, reject) => {
filen
.fs()
.stat({ path: "/Pictures/2/" + file })
.then(stats => {
if (stats.isDirectory()) {
resolve()

return
}

filen
.fs()
.download({ path: "/Pictures/2/" + file, destination: pathModule.join(os.tmpdir(), file) })
.then(() => resolve())
.catch(reject)
})
.catch(reject)
})
)
}

await Promise.all(proms)
}
const main = async () => {}

main()
19 changes: 11 additions & 8 deletions dist/api/client.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/api/client.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bundle.browser.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bundle.browser.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bundle.node.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bundle.node.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/chats/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/chats/index.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions dist/cloud/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cloud/index.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/constants.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/constants.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/crypto/decrypt.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/crypto/encrypt.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 21 additions & 24 deletions dist/fs/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/fs/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/notes/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/notes/index.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/types/constants.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ export declare const environment: Environment;
export declare const BUFFER_SIZE = 4096;
export declare const BASE64_BUFFER_SIZE: number;
export declare const MAX_CONCURRENT_DOWNLOADS = 32;
export declare const MAX_DOWNLOAD_THREADS = 64;
export declare const MAX_DOWNLOAD_WRITERS = 128;
export declare const MAX_DOWNLOAD_THREADS = 128;
export declare const MAX_DOWNLOAD_WRITERS = 256;
export declare const MAX_UPLOAD_THREADS = 16;
export declare const CURRENT_FILE_ENCRYPTION_VERSION = 2;
export declare const DEFAULT_UPLOAD_REGION = "de-1";
export declare const DEFAULT_UPLOAD_BUCKET = "filen-1";
export declare const UPLOAD_CHUNK_SIZE: number;
export declare const MAX_NOTE_SIZE: number;
export declare const MAX_CONCURRENT_LISTING_OPS = 64;
export declare const MAX_CONCURRENT_UPLOADS = 16;
export declare const MAX_CONCURRENT_UPLOADS = 8;
export declare const MAX_CONCURRENT_DIRECTORY_UPLOADS = 4;
export declare const MAX_CONCURRENT_DIRECTORY_DOWNLOADS = 8;
11 changes: 9 additions & 2 deletions dist/types/fs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,21 @@ export type FSItem = (FSItemBase & {
metadata: FSItemFileBase & FileMetadata;
});
export type FSItems = Record<string, FSItem>;
export type FSStats = {
export type FSStatsBase = {
size: number;
mtimeMs: number;
birthtimeMs: number;
isDirectory: () => boolean;
isFile: () => boolean;
isSymbolicLink: () => boolean;
};
export type FSStats = (FolderMetadata & FSStatsBase & {
type: "directory";
uuid: string;
}) | (FSItemFileBase & FileMetadata & FSStatsBase & {
type: "file";
uuid: string;
});
export type StatFS = {
type: number;
bsize: number;
Expand Down Expand Up @@ -301,7 +308,7 @@ export declare class FS {
onProgress?: ProgressCallback;
}): Promise<void>;
/**
* Download a file from path to a local destination path. Only available in a Node.JS environment.
* Download a file or directory from path to a local destination path. Only available in a Node.JS environment.
* @date 2/15/2024 - 5:59:23 AM
*
* @public
Expand Down
Loading

0 comments on commit 0c276ba

Please sign in to comment.