Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files #98

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ad807f9
Add files collection and pub-sub for prototyping.
Zodiase May 31, 2020
d585274
Implement file list view with meteor data hooks instead of HOC.
Zodiase May 31, 2020
349c3d3
Use Grommet/DataTable to render file list.
Zodiase May 31, 2020
a72193e
Set sizes to columns.
Zodiase May 31, 2020
1b8e53a
Resolve error "'BinaryType' is not defined".
Zodiase May 31, 2020
39d7ff3
Resolve errors regarding functions being used before defined.
Zodiase May 31, 2020
b6c99e8
Update File schema.
Zodiase May 31, 2020
9cdc8a0
Resolve eslint issue in parsing some TypeScript syntax.
Zodiase May 31, 2020
2077298
Allow JSX props spreading.
Zodiase May 31, 2020
bc3765b
Show upload tasks for dropped files.
Zodiase May 31, 2020
5e4a037
Update package typings and enable test file pattern matching.
Zodiase May 31, 2020
5f47ad6
Merge branch 'master' into api/files
Zodiase Jan 19, 2024
81505fd
Refactor and fix type errors.
Zodiase Jan 19, 2024
0cc9f5c
Use createRoot from react 18
Zodiase Jan 19, 2024
9f40d6e
Show upload state
Zodiase Jan 19, 2024
02d3bd5
Keeping 2-space indents for package manifest
Zodiase Jan 19, 2024
26771cd
Merge branch 'master' into api/files
Zodiase Jan 19, 2024
23ae48b
Remove snyk test in CI as it's already covered by Github integration.
Zodiase Jan 19, 2024
4088971
Add segmented file uploading scaffolding
Zodiase Jan 20, 2024
4099f39
Show dummy progress
Zodiase Jan 20, 2024
f48e005
Implement chunked file reading.
Zodiase Jan 20, 2024
170941f
Implement server APIs for uploading a file in chunks.
Zodiase Jan 21, 2024
572f35b
Fix minor bugs
Zodiase Jan 21, 2024
0ea308a
Use Enum to represent File states.
Zodiase Oct 4, 2024
364faa0
Fix typo
Zodiase Oct 4, 2024
ee420d0
Refactor abstract file APIs and add tests
Zodiase Oct 9, 2024
54506b8
Add utility Diagnostic Context
Zodiase Dec 29, 2024
86a1aa2
Use proper tsconfig file for type checks
Zodiase Dec 29, 2024
4496c1a
Merge pull request #107 from Zodiase/utility/diagnostic-context
Zodiase Dec 29, 2024
89f80b1
Fix type error
Zodiase Dec 29, 2024
2b784bf
Upgrade Meteor to v3 and fix other misc issues.
Zodiase Dec 30, 2024
612ecfb
Update CI config
Zodiase Dec 30, 2024
134744b
Check types now only covers the app. Fix a type error.
Zodiase Dec 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update File schema.
  • Loading branch information
Zodiase committed May 31, 2020
commit b6c99e885bc19ef80fb8f9b8b838047692460fe5
31 changes: 29 additions & 2 deletions imports/api/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,56 @@ import { Mongo } from 'meteor/mongo';
*/
export interface File {
_id?: string;

/**
* Name of the file in the traditional sense in a file system.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/File/name
*/
name: string;

/**
* Size of the file in bytes.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/File/size
*/
size: number;

/**
* The MIME type of the file.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/File/type
*/
type: string;

/**
* IDs of file chunks.
*/
chunks: string[];

/**
* Time this file was created.
* Size of each chunk (except the last one) in bytes.
*
* This makes it easier to index a specific chunk.
*/
chunkSize: number;

/**
* Time this document was created.
*/
createdAt: Date;

/**
* Time this file was last modified.
* Time this document was last modified.
*/
modifiedAt: Date;

/**
* The last modified time of the file, in millisecond since the UNIX epoch (January 1st, 1970 at Midnight).
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/File/lastModified
*/
lastModified: number;
}

/**
Expand Down
11 changes: 10 additions & 1 deletion server/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ import './publications';
function insertFile(name: string) {
const now = new Date();

Files.insert({ name, size: 0, createdAt: now, modifiedAt: now, chunks: [] });
Files.insert({
name,
size: 0,
type: '',
createdAt: now,
modifiedAt: now,
chunks: [],
chunkSize: 15 * 1024 * 1024,
lastModified: now.valueOf(),
});
}

Meteor.startup(() => {
Expand Down