Skip to content

Commit e2c2040

Browse files
committed
update typeidex support
1 parent 91cf8b2 commit e2c2040

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

bookmarks/vanilla/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bookmarks/vanilla/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@inrupt/solid-client-authn-browser": "^1.17.5",
3737
"@inrupt/vocab-common-rdf": "^1.0.5",
3838
"@rdfjs/data-model": "^1.3.4",
39-
"@rezasoltani/solid-typeindex-support": "^0.0.5"
39+
"@rezasoltani/solid-typeindex-support": "^0.0.7"
4040
},
4141
"devDependencies": {
4242
"@types/jest": "^29.5.10",

bookmarks/vanilla/src/modules/Bookmark.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ export class Bookmark {
8383
webId: string,
8484
defaultRegisteryUrl?: string
8585
): Promise<string[]> {
86-
const registeries = await TypeIndexHelper.getFromTypeIndex(webId!, BOOKMARK.Bookmark, fetch, true)
86+
const { instanceContainers, instances } = await TypeIndexHelper.getFromTypeIndex(webId!, BOOKMARK.Bookmark, fetch, true)
8787

88-
if (!!registeries?.length) {
89-
return registeries
88+
if (!!instances.length) {
89+
return instances
9090
} else {
9191
const podToUse = (await getPodUrlAll(webId!, { fetch: fetch }))[0];
9292

@@ -100,7 +100,7 @@ export class Bookmark {
100100
await saveSolidDatasetAt(defaultRegisteryUrl, createSolidDataset(), { fetch: fetch });
101101
}
102102

103-
await TypeIndexHelper.registerInTypeIndex(webId!, "bookmarks_registery", BOOKMARK.Bookmark, fetch, defaultRegisteryUrl, true)
103+
await TypeIndexHelper.registerInTypeIndex(webId!, "bookmarks_registery", BOOKMARK.Bookmark, fetch, defaultRegisteryUrl, false, true)
104104

105105
return [defaultRegisteryUrl];
106106
}

bookmarks/vanilla/test/unit/Bookmark.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ describe("Bookmark", () => {
4242
const podUrls = ["https://fake-pod.net/"];
4343
const expectedIndexUrl = ["https://fake-pod.net/bookmarks/index.ttl"];
4444

45-
const registeries = ["https://fake-pod.net/bookmarks/index.ttl"]
45+
const instances = ["https://fake-pod.net/bookmarks/index.ttl"]
4646

47-
jest.spyOn(TypeIndexHelper, "getFromTypeIndex").mockReturnValue(Promise.resolve(registeries));
47+
jest.spyOn(TypeIndexHelper, "getFromTypeIndex").mockReturnValue(Promise.resolve({ instanceContainers: [], instances }));
4848
jest.spyOn(inruptClient, "getPodUrlAll").mockReturnValue(Promise.resolve(podUrls));
4949

5050
const res = await Bookmark.getRegisteryUrls(session.fetch, session.info.webId!);

0 commit comments

Comments
 (0)