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

Added Solid support #1319

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
fa80bb4
Developing Solid storage
yasharpm Oct 24, 2023
3a7eb40
Documentation for Solid
yasharpm Nov 2, 2023
3abd9a1
Refactored Solid provider specification
yasharpm Nov 2, 2023
128728e
Login process completed. Next it choosing a pod
yasharpm Dec 19, 2023
710d302
Login done (without error handling)
yasharpm Mar 4, 2024
c1b14bc
Fixed state management between rs and inrupt
yasharpm Apr 30, 2024
aea6948
Get, Put, Delete implemented
yasharpm Jun 27, 2024
2294ae5
Kickstart workflows!
yasharpm Jul 15, 2024
3b3d4f9
Kickstart workflows
yasharpm Jul 15, 2024
2a7f9fe
add: workflow dispatch for test-and-lint.yml
MahdiBaghbani Jul 15, 2024
9fe0db1
Clean up
yasharpm Jul 17, 2024
6075b69
Merge branch 'master' of https://github.com/pondersource/remotestorag…
yasharpm Jul 17, 2024
818f0ce
Merged with upstream
yasharpm Jul 20, 2024
555b565
Merge branch 'master' of https://github.com/remotestorage/remotestora…
yasharpm Jul 20, 2024
4a55b71
Base tests for solid
yasharpm Aug 5, 2024
07bcf1c
Tests done for solid backend
yasharpm Aug 11, 2024
8facb19
Fixed lint issues
yasharpm Aug 15, 2024
c11defb
Fixed TODOs
yasharpm Aug 21, 2024
495baab
merged with upstream
yasharpm Aug 22, 2024
8273b92
Added code documentation
yasharpm Aug 23, 2024
e6e92e0
Updated readme
yasharpm Aug 23, 2024
ba000bc
Updated docs
yasharpm Aug 29, 2024
e813dbb
Merge branch 'master' of https://github.com/remotestorage/remotestora…
yasharpm Aug 29, 2024
afdfcf9
Updated documentation
yasharpm Aug 30, 2024
f6a95f6
Mocha tests for Solid backend
yasharpm Sep 2, 2024
04c5720
Merge branch 'master' into HEAD
michielbdejong Dec 11, 2024
5f168a8
Allow 'solid' as a value for backendType
michielbdejong Dec 11, 2024
869a0f7
Resolve peer dependency version mismatch for typedoc, fix alphabetic …
michielbdejong Dec 11, 2024
89f1655
npm install ; npm run build:release
michielbdejong Dec 11, 2024
bfa89a1
Console.log statements; this.getPodURLs() might be null
michielbdejong Dec 12, 2024
c15323f
getPodURLs may return null
michielbdejong Dec 12, 2024
7972cc9
Use mtime as ETag; convert response Blob to text
michielbdejong Dec 12, 2024
fb82cd4
remove console.log statements
michielbdejong Dec 12, 2024
fbc3bfc
npm run build:release
michielbdejong Dec 12, 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
Console.log statements; this.getPodURLs() might be null
michielbdejong committed Dec 12, 2024
commit bfa89a1778e1f77d145758e60a4aa760632e63f2
2 changes: 1 addition & 1 deletion release/remotestorage.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion release/remotestorage.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/remotestorage.ts
Original file line number Diff line number Diff line change
@@ -424,6 +424,7 @@ export class RemoteStorage {
break;
case 'pod-not-selected':
if ((this.remote instanceof Solid)
&& Array.isArray(this.remote.getPodURLs())
&& this.remote.getPodURLs().length > 0
&& this.remote.getPodURL() === null) {
setTimeout(handler, 0);
7 changes: 7 additions & 0 deletions src/solid.ts
Original file line number Diff line number Diff line change
@@ -36,13 +36,15 @@ function hookGetItemURL (rs): void {
if (rs._origBaseClientGetItemURL) { return; }
rs._origBaseClientGetItemURL = BaseClient.prototype.getItemURL;
BaseClient.prototype.getItemURL = function (path: string): string {
console.log('getItemURL from', path);
if (typeof path !== 'string') {
throw 'Argument \'path\' of baseClient.getItemURL must be a string';
}
if (this.storage.connected) {
if (path.startsWith('/')) {
path = path.substring(1);
}
console.log('getItemURL to', this.selectedPodURL + cleanPath(path));
return this.selectedPodURL + cleanPath(path);
} else {
return undefined;
@@ -127,6 +129,7 @@ class Solid extends RemoteBase implements Remote, ConfigObserver {

constructor(remoteStorage) {
super(remoteStorage);
console.log('Solid constructor');
this.online = true;
this.addEvents(['connected', 'not-connected', 'pod-not-selected']);

@@ -397,6 +400,7 @@ class Solid extends RemoteBase implements Remote, ConfigObserver {
* @protected
*/
get (path: string, options: { ifNoneMatch?: string } = {}): Promise<RemoteResponse> {
console.log('Solid get', path, options);
const fileURL = this.getFileURL(path);

if (path.slice(-1) === '/') {
@@ -477,6 +481,8 @@ class Solid extends RemoteBase implements Remote, ConfigObserver {
* @protected
*/
put (path: string, body: XMLHttpRequestBodyInit, contentType: string, options: { ifMatch?: string; ifNoneMatch?: string } = {}): Promise<RemoteResponse> {
console.log('Solid put', path, contentType);

const fileURL = this.getFileURL(path);
const fetch = this.session.fetch;

@@ -523,6 +529,7 @@ class Solid extends RemoteBase implements Remote, ConfigObserver {
* @protected
*/
delete (path: string, options: { ifMatch?: string } = {}): Promise<RemoteResponse> {
console.log('Solid delete', path);
const fileURL = this.getFileURL(path);

return deleteFile(fileURL, { fetch: this.session.fetch }).then(() => {