52 Commits

Author SHA1 Message Date
Wannes Kerckhove
fbbccb0cf1 fix: Stop creating meta files for each new resource #1217 2022-05-06 08:20:55 +02:00
Joachim Van Herwegen
e6519992bf Merge branch 'main' into versions/4.0.0
# Conflicts:
#	test/unit/storage/accessors/FileDataAccessor.test.ts
2022-04-15 10:28:50 +02:00
Jasper Vaneessen
668d0a331f
feat: Only accept NamedNodes as predicates for metadata
* refactor: move toCachedNamedNode (private)

* chore: only NamedNodes predicates in removes

* feat: enforce NamedNode predicates in most cases

* feat: getAll only accepts NamedNodes

* feat: toCachedNamedNode only accepts string arg

* tests: use NamedNodes for getAll calls

* test: remove unnecessary string check for coverage

* tests: fix NamedNodes in new tests after rebase

* feat: metadatawriters store NamedNodes

* refactor: toCachedNamedNode as utility function

* fix: double write of linkRelMap

* test: use the CONTENT_TYPE constant
2022-04-15 09:53:39 +02:00
Jasper Vaneessen
fe39f97ee0
refactor: Use fs-extra instead of fs to simplify file access
* refactor: use fs-extra instead of fs

* tests: manual mocks for fs-extra base + ensureDir

* refactor: mockFileSystem + mockFs and mockFsExtra

* add remove mock and some further test tweaks

* test: FileDataAccessor tests passing

* refactor: remove try-catch due to fs-extra handlin

* refactor: fs-extra in atomicFileDataAccessor

* refactor: AtomicFileDataAccessor fs-extra

* test: fix coverage

* refactor: use read/writeJson from fs-extra

* refactor: less duplicate mocking code

* refactor: re-use opendir mocking code
2022-04-12 11:02:30 +02:00
Joachim Van Herwegen
027e3707fd feat: Parse content-type more strictly 2022-03-28 10:45:05 +02:00
Joachim Van Herwegen
7152897b89 fix: Add IANA type to child metadata in FileDataAccessor 2022-03-28 10:45:05 +02:00
Joachim Van Herwegen
c5052625d1 Merge branch 'main' into versions/3.0.0
# Conflicts:
#	package-lock.json
#	package.json
#	src/storage/patch/SparqlUpdatePatcher.ts
#	test/unit/init/AppRunner.test.ts
#	test/unit/util/QuadUtil.test.ts
2022-02-11 15:30:45 +01:00
Joachim Van Herwegen
d2870e5c8b fix(deps): Update dependencies 2022-02-11 15:28:50 +01:00
Joachim Van Herwegen
9ceb62b8b6 refactor: Remove @rdfjs/data-model dependency
We already have N3.js for term generation.
No need to have two solutions there.
2022-02-11 15:28:50 +01:00
Arthur Joppart
0cb4d7b161
feat: Add support for quota limits
* feat: implemented SizeReporter and FileSizeReporter

* test: FileSizeReporter tests

* feat: added QuotedDataAccessor

* test: added extra test to check recursiveness of filesizereporter

* feat: added QuotaStrategy interface

* feat: further progress in different files

* feat: wrote doc, tests and improved code

* feat: fixed bugs and code is now runnable and buildable

* feat: finished implementation

* fix: revert accidental chanegs

* fix: fileSizeReported did not count container size

* fix: bug calculating container sizes fixed

* test: FileSizeReporter tests

* test: QuotaDataValidator tests

* test: QuotaError tests

* fix: removed console.log

* doc: added doc to several files

* doc: changed doc for QuotaStrategy to new implementation

* fix: improved content length regex

* feat: improved GlobalQuotaStrategy code

* fix: made FileSizeReported readonly

* feat: added comments to quota-file.json

* fix: changed default tempFilePath variable

* test: included new tempFilePath variable in testing

* chore: created seperate command for start:file:quota to pass tests

* feat: removed all sync fs calls from FileSizeReporter

* feat: minor changes in multple files

* fix: changed function signatures to be in line with others

* feat: optimized quota data validation

* feat: improved FileSizeReporter code

* fix: corrected calculation of containersizes and fixed erroring edgecase

* feat: save content-length as number in metadata

* feat: added comments and changed GlobalQuotaStrategy constructor

* feat: changed file names and added small comment

* test: AtomicFileDataAccessor tests

* test: completed FileSizeReporter tests

* fix: content-length is now saved correctly in RepresentationMetadata

* feat: adapted content length metadata + tests

* fix: removed tempFilePath variable

* fix: reverted .gitignore

* fix: forgot to remove tempFilePath variable from componentsjs config

* test: GlobalQuotaStrategy tests

* feat: replaced DataValidator with Validator

* feat: reworked DataValidator

* feat: added calcultateChunkSize() to SizeReporter

* test: updated FileSizeReporter tests

* fix: tempFile location now relative to rootFilePath

* test: QuotaDataValidator tests

* fix: corrected FileSizeReporter tests

* fix: adapted FileSizeReporter tests

* fix: FileSizeReporter bug on Windows

* fix: regex linting error

* feat: changed Validator class

* feat: added PodQuotaStrategy to enable suota on a per pod basis

* chore: bump context versions

* fix: Capitalized comments in json file

* chore: renamed ValidatorArgs to ValidatorInput

* chore: order all exports

* fix: made TODO comment clearer

* chore: added seperated config files for global and pod based quota + fixed comments

* chore: made minor changes to comments

* feat: added PassthroughDataAccessor

* feat: added PasstroughtDataAccessor + tests

* fix: added invalid header check to ContentLengthParser

* chore: improved mocks

* chore: move quota limit higher up in config

* fix: atomicity issue in AtomicFileDataAccessor

* chore: moved .internal folder to config from FileSizeReporter

* fix: improved algorithm to ignore folders while calculating file size in FileSizeReporter

* fix: changes to support containers in the future

* fix: added error handling to prevent reading of unexistent files

* feat: added generic type to SizeReporter to calculate chunk sizes

* test: use mocked DataAccessor

* chore: added some comments to test and made minor improvement

* fix: fs mock rename

* chore: QuotaStrategy.estimateSize refactor

* chore: move trackAvailableSpace to abstract class QuotaStrategy

* fix: improved test case

* test: quota integration tests

* chore: edited some comments

* chore: change lstat to stat

* feat: moved estimateSize to SizeReporter to be consistent with calcultateChunkSize

* test: finish up tests to reach coverage

* fix: basic config

* fix: minor changes to test CI run

* fix: small fix for windows

* fix: improved writing to file

* chore: linting errors

* chore: rename trackAvailableSpace

* test: improved integration tests

* test: logging info for test debugging

* test: extra logging for debugging

* test: logging for debugging

* test: logging for debugging

* test: logging for debugging

* test: improved Quota integration test setup

* test: improve quota tests for CI run

* test: debugging Quota test

* test: uncommented global quota test

* test: changed global quota parameters

* test: logging for debugging

* test: logging cleanup

* chore: minor changes, mostly typo fixes

* chore: remove console.log

* fix: getting inconsistent results

* chore: try fix index.ts CI error

* chore: try fix CI error

* chore: try fix CI error

* chore: revert last commits

* chore: fix inconsistent files with origin

* test: minor test improvements

* chore: minor refactors and improvements

* fix: added extra try catch for breaking bug

* chore: improve config

* chore: minor code improvements

* test: use mockFs

* feat: add extra check in podQuotaStrategy

* chore: replace handle by handleSafe in ValidatingDataAccessor

* chore: typo

* test: improved Quota integration tests

* test: made comment in test more correct

* fix: rm -> rmdir for backwards compatibility

* fix: fsPromises issue

* chore: leave out irrelevant config

* chore: removed start script from package.json

* fix: Small fixes

Co-authored-by: Joachim Van Herwegen <joachimvh@gmail.com>
2022-01-21 10:49:05 +01:00
Ruben Verborgh
2e4589938f
feat: Display symlinks in container listings.
Closes https://github.com/solid/community-server/issues/1015
2021-10-21 17:26:54 +01:00
Joachim Van Herwegen
5613ff9e71 fix: Let Representations always have a body
This is relevant when the request has a content-type
but no data.
2021-10-12 13:30:06 +02:00
Joachim Van Herwegen
b3da9c9fcf refactor: Restructure source code folder
This way the location of certain classes should make more sense
2021-10-12 12:51:02 +02:00
Joachim Van Herwegen
97c534b2bf feat: Keep track of last modified date of resources 2021-08-18 13:16:08 +02:00
Joachim Van Herwegen
12e501844f fix: Prevent generated metadata from being stored 2021-07-05 14:33:20 +02:00
Joachim Van Herwegen
5edbbc1958 chore: Update dependencies 2021-06-30 10:24:13 +02:00
Joachim Van Herwegen
cae9d54fac feat: Add getChildren function to DataAccessor interface
DataAccessors are now no longer responsible for generating ldp:contains triples.
2021-05-12 15:27:51 +02:00
Joachim Van Herwegen
a28fb0258f feat: Use an IdentifierStrategy in InMemoryDataAccessor
Now it's also possible to support multiple root containers.
2021-02-25 13:16:26 +01:00
Ruben Verborgh
c3cff553e3 feat: Emit container pub event on PUT.
Closes https://github.com/solid/community-server/issues/612
2021-02-24 12:04:42 +01:00
Ruben Verborgh
6edc255707 feat: Make stores return modified resources. 2021-02-24 12:04:42 +01:00
Wouter Termont
1486f01aaf
fix: do not output filesystem container size
* fix: do not output filesystem container size

* fix: only omit size metadata for containers

Signed-off-by: Wouter Termont <woutermont@gmail.com>
2021-02-12 09:18:09 +01:00
Joachim Van Herwegen
c29928c32c fix: Test error classes correctly 2021-01-29 09:40:10 +01:00
Ruben Verborgh
be1af89b56 feat: Add Content-Type constructor to metadata. 2021-01-11 14:03:38 +01:00
Joachim Van Herwegen
fea726ae7d fix: Take baseIRI into account when calling parseQuads 2021-01-07 14:38:19 +01:00
Ruben Verborgh
f9a20799eb refactor: Use declarations style for functions. 2021-01-06 11:24:43 +01:00
Ruben Verborgh
2e188551f7 refactor: Rename UriUtil into TermUtil. 2021-01-02 23:19:01 +01:00
Ruben Verborgh
ae06e99067 refactor: Also create named nodes for vocabularies. 2021-01-02 23:15:51 +01:00
Ruben Verborgh
8e138c36d1 refactor: Use types to create vocabularies. 2021-01-02 22:56:25 +01:00
Ruben Verborgh
a572825909 refactor: Indicate caching on method name. 2021-01-02 17:50:17 +01:00
Joachim Van Herwegen
d7434df808 feat: ExtensionBasedMapper no longer throws if there is no file 2020-12-18 10:40:07 +01:00
Joachim Van Herwegen
36eed5d620 chore: Remove assumption that DataAccessors have a root container by default 2020-12-18 10:33:54 +01:00
Joachim Van Herwegen
3e3dd7f5a9 fix: Allow deletion of root in InMemoryDataAccessor 2020-12-18 09:32:11 +01:00
Joachim Van Herwegen
90bdfb5583 chore: Add root container tests for FileDataAccessor 2020-12-18 09:01:59 +01:00
Joachim Van Herwegen
fc8540f553 fix: Allow overwriting and deleting root container in SparqlDataAccessor 2020-12-18 09:01:59 +01:00
Joachim Van Herwegen
1bb5de97ab refactor: Remove base URls with ContainerManager when possible 2020-12-11 12:42:17 +01:00
Joachim Van Herwegen
f0db9e501f refactor: Replace getParentContainer util function with ContainerManager 2020-12-11 12:42:17 +01:00
Ruben Verborgh
accfc2e58d change: Make RepresentationMetadata accept a ResourceIdentifier.
Closes https://github.com/solid/community-server/issues/388
2020-12-11 10:37:36 +01:00
Ruben Verborgh
9c933fd2d4 chore: Build to dist folder.
Closes https://github.com/solid/community-server/issues/136
2020-12-08 09:30:18 +01:00
Joachim Van Herwegen
d7e189cdd8 fix: Only set content-type for documents in sparql store 2020-12-04 12:36:18 +01:00
Ruben Verborgh
0ecbffa885 fix: Do not generate empty INSERT graph.
Fixes https://github.com/solid/community-server/issues/383
2020-12-02 21:40:54 +01:00
Ruben Verborgh
af8f1976cd fix: Rename UnsupportedHttpError into BadRequestError. 2020-11-27 14:52:16 +01:00
Joachim Van Herwegen
e4183333fd fix: Integrate wrapStreamError to prevent uncaught errors 2020-11-24 11:49:10 +01:00
Ruben Taelman
2c46d70780 refactor: move ExtensionBasedMapper into mapping directory 2020-11-23 13:28:28 +01:00
Joachim Van Herwegen
1073c2ff4c refactor: Clean up utility functions 2020-11-18 17:19:53 +01:00
Ruben Verborgh
17d774fc18 chore: Add SPARQL endpoint logging. 2020-11-04 10:31:54 +01:00
Joachim Van Herwegen
9f7c246104 feat: Support SPARQL store backends 2020-11-02 15:04:05 +01:00
Ruben Verborgh
4b4f737013 chore: Use Jest recommended linting. 2020-11-02 10:03:18 +01:00
Joachim Van Herwegen
63f891c0f1 fix: Remove metadata file if no new metadata is stored 2020-10-14 15:35:22 +02:00
Joachim Van Herwegen
e861b080c2 feat: Fully support storing content-type in file extensions 2020-10-14 15:20:26 +02:00
Joachim Van Herwegen
626b3114f4 refactor: Rename instances of data resource to document 2020-10-14 15:20:26 +02:00