solid-logic 1.3.17-a849582e → 1.3.17-af110ecf

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/lib/acl/aclLogic.d.ts +2 -11
  2. package/lib/acl/aclLogic.d.ts.map +1 -1
  3. package/lib/acl/aclLogic.js +5 -7
  4. package/lib/acl/aclLogic.js.map +1 -1
  5. package/lib/chat/chatLogic.d.ts +2 -15
  6. package/lib/chat/chatLogic.d.ts.map +1 -1
  7. package/lib/chat/chatLogic.js +8 -7
  8. package/lib/chat/chatLogic.js.map +1 -1
  9. package/lib/inbox/inboxLogic.d.ts +2 -6
  10. package/lib/inbox/inboxLogic.d.ts.map +1 -1
  11. package/lib/inbox/inboxLogic.js.map +1 -1
  12. package/lib/index.d.ts +7 -9
  13. package/lib/index.d.ts.map +1 -1
  14. package/lib/index.js +10 -74
  15. package/lib/index.js.map +1 -1
  16. package/lib/logic/solidLogic.d.ts +6 -0
  17. package/lib/logic/solidLogic.d.ts.map +1 -0
  18. package/lib/logic/solidLogic.js +92 -0
  19. package/lib/logic/solidLogic.js.map +1 -0
  20. package/lib/logic/solidLogicSingleton.d.ts +2 -35
  21. package/lib/logic/solidLogicSingleton.d.ts.map +1 -1
  22. package/lib/logic/solidLogicSingleton.js +7 -86
  23. package/lib/logic/solidLogicSingleton.js.map +1 -1
  24. package/lib/profile/profileLogic.d.ts +2 -12
  25. package/lib/profile/profileLogic.d.ts.map +1 -1
  26. package/lib/profile/profileLogic.js +1 -23
  27. package/lib/profile/profileLogic.js.map +1 -1
  28. package/lib/typeIndex/typeIndexLogic.d.ts +2 -31
  29. package/lib/typeIndex/typeIndexLogic.d.ts.map +1 -1
  30. package/lib/typeIndex/typeIndexLogic.js +12 -359
  31. package/lib/typeIndex/typeIndexLogic.js.map +1 -1
  32. package/lib/types.d.ts +65 -1
  33. package/lib/types.d.ts.map +1 -1
  34. package/lib/util/ns.d.ts +2 -0
  35. package/lib/util/ns.d.ts.map +1 -0
  36. package/lib/util/ns.js +34 -0
  37. package/lib/util/ns.js.map +1 -0
  38. package/package.json +1 -1
  39. package/src/acl/aclLogic.ts +8 -5
  40. package/src/chat/chatLogic.ts +7 -7
  41. package/src/inbox/inboxLogic.ts +2 -1
  42. package/src/index.ts +12 -83
  43. package/src/logic/solidLogic.ts +75 -0
  44. package/src/logic/solidLogicSingleton.ts +6 -159
  45. package/src/profile/profileLogic.ts +4 -12
  46. package/src/typeIndex/typeIndexLogic.ts +6 -277
  47. package/src/types.ts +76 -1
  48. package/src/util/{ns.js → ns.ts} +0 -0
  49. package/test/logic.test.ts +5 -6
  50. package/test/typeIndexLogic.test.ts +484 -54
  51. package/lib/discovery/discoveryLogic.d.ts +0 -37
  52. package/lib/discovery/discoveryLogic.d.ts.map +0 -1
  53. package/lib/discovery/discoveryLogic.js +0 -500
  54. package/lib/discovery/discoveryLogic.js.map +0 -1
  55. package/src/discovery/discoveryLogic.ts +0 -267
  56. package/test/discoveryLogic.test.ts +0 -712
  57. package/test/typeIndexLogicPart2.test.ts +0 -485
@@ -1,69 +1,499 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ *
4
+ */
1
5
  import { Fetcher, Store, sym, UpdateManager } from "rdflib";
2
6
  import { createAclLogic } from "../src/acl/aclLogic";
3
7
  import { createProfileLogic } from "../src/profile/profileLogic";
4
- import { createTypeIndexLogic } from "../src/typeIndex/typeIndexLogic";
5
- import { AuthenticationContext } from "../src/types";
8
+ import { createTypeIndexLogic} from "../src/typeIndex/typeIndexLogic";
6
9
  import { createContainerLogic } from "../src/util/containerLogic";
10
+ import { ns } from "../src/util/ns";
7
11
  import { createUtilityLogic } from "../src/util/utilityLogic";
8
- import { alice } from "./helpers/dataSetup";
12
+ import { uniqueNodes } from "../src/util/utils";
13
+ import { alice, AlicePhotoFolder, AlicePhotos, AlicePreferences, AlicePreferencesFile, AlicePrivateTypeIndex, AlicePrivateTypes, AliceProfile, AlicePublicTypeIndex, AlicePublicTypes, bob, BobProfile, club, ClubPreferences, ClubPreferencesFile, ClubPrivateTypeIndex, ClubPrivateTypes, ClubProfile, ClubPublicTypeIndex, ClubPublicTypes } from "./helpers/dataSetup";
9
14
 
10
- let store;
11
- let options;
15
+ const prefixes = Object.keys(ns).map(prefix => `@prefix ${prefix}: ${ns[prefix]('')}.\n`).join('') // In turtle
16
+ window.$SolidTestEnvironment = { username: alice.uri }
17
+
18
+ const Tracker = ns.wf('Tracker')
19
+ const Image = ns.schema('Image')
20
+
21
+ //let web = {}
22
+ //web = loadWebObject()
23
+ const user = alice
24
+ const profile = user.doc()
25
+ const web = {}
26
+ web[profile.uri] = AliceProfile
27
+ web[AlicePreferencesFile.uri] = AlicePreferences
28
+ web[AlicePrivateTypeIndex.uri] = AlicePrivateTypes
29
+ web[AlicePublicTypeIndex.uri] = AlicePublicTypes
30
+ web[AlicePhotoFolder.uri] = AlicePhotos
31
+ web[bob.doc().uri] = BobProfile
32
+
33
+ web[club.doc().uri] = ClubProfile
34
+ web[ClubPreferencesFile.uri] = ClubPreferences
35
+ web[ClubPrivateTypeIndex.uri] = ClubPrivateTypes
36
+ web[ClubPublicTypeIndex.uri] = ClubPublicTypes
37
+ let requests = []
38
+ let statustoBeReturned = 200
12
39
  let typeIndexLogic
13
- const authn = {
14
- currentUser: () => {
15
- return alice;
16
- },
17
- };
18
- describe('typeIndexLogic', () => {
19
- beforeEach(() => {
20
- options = { fetch: fetch };
21
- store = new Store()
22
- store.fetcher = new Fetcher(store, options);
23
- store.updater = new UpdateManager(store);
24
- const util = createUtilityLogic(store, createAclLogic(store), createContainerLogic(store))
25
- typeIndexLogic = createTypeIndexLogic(store, authn, createProfileLogic(store, authn, util), util)
26
-
27
- })
28
- describe('loadIndex', () => {
29
- it('loadIndex', async () => {
30
- const context = {
31
- index: {}
32
- }
33
-
34
- const result = await typeIndexLogic.loadIndex(context, true)
35
- expect(result).toEqual({
36
- index: {
37
- private: [],
38
- public: []
39
- },
40
- })
40
+
41
+ describe("TypeIndex logic NEW", () => {
42
+ let store;
43
+ const authn = {
44
+ currentUser: () => {
45
+ return alice;
46
+ },
47
+ };
48
+
49
+ beforeEach(() => {
50
+ fetchMock.resetMocks();
51
+ requests = []
52
+ statustoBeReturned = 200
53
+ const init = { headers: { "Content-Type": "text/turtle" } } // Fetch options tend to be called this
54
+
55
+ fetchMock.mockIf(/^https?.*$/, async req => {
56
+
57
+ if (req.method !== 'GET') {
58
+ requests.push(req)
59
+ if (req.method === 'PUT') {
60
+ const contents = await req.text()
61
+ web[req.url] = contents // Update our dummy web
62
+ console.log(`Tetst: Updated ${req.url} on PUT to <<<${web[req.url]}>>>`)
63
+ }
64
+ return { status: statustoBeReturned }
65
+ }
66
+ const contents = web[req.url]
67
+ if (contents !== undefined) { //
68
+ return {
69
+ body: prefixes + contents, // Add namespaces to anything
70
+ status: 200,
71
+ headers: {
72
+ "Content-Type": "text/turtle",
73
+ "WAC-Allow": 'user="write", public="read"',
74
+ "Accept-Patch": "application/sparql-update"
75
+ }
76
+ }
77
+ } // if contents
78
+ return {
79
+ status: 404,
80
+ body: 'Not Found'
81
+ }
82
+ })
83
+
84
+ store = new Store()
85
+ store.fetcher = new Fetcher(store, { fetch: fetch });
86
+ store.updater = new UpdateManager(store);
87
+ const util = createUtilityLogic(store, createAclLogic(store), createContainerLogic(store))
88
+ typeIndexLogic = createTypeIndexLogic(store, authn, createProfileLogic(store, authn, util), util)
89
+ });
90
+
91
+ describe('loadAllTypeIndexes', () => {
92
+ it('exists', () => {
93
+ expect(typeIndexLogic.loadAllTypeIndexes).toBeInstanceOf(Function)
94
+ })
41
95
  })
42
- })
43
96
 
44
- describe('loadTypeIndexes', () => {
45
- it('exists', () => {
46
- expect(typeIndexLogic.loadTypeIndexes).toBeInstanceOf(Function)
97
+ const AliceScopes = [{
98
+ "agent": {
99
+ "classOrder": 5,
100
+ "termType": "NamedNode",
101
+ "value": "https://alice.example.com/profile/card.ttl#me",
102
+ },
103
+ "index": {
104
+ "classOrder": 5,
105
+ "termType": "NamedNode",
106
+ "value": "https://alice.example.com/profile/public-type-index.ttl",
107
+ },
108
+ "label": "public",
109
+ },
110
+ {
111
+ "agent": {
112
+ "classOrder": 5,
113
+ "termType": "NamedNode",
114
+ "value": "https://alice.example.com/profile/card.ttl#me",
115
+ },
116
+ "index": {
117
+ "classOrder": 5,
118
+ "termType": "NamedNode",
119
+ "value": "https://alice.example.com/settings/private-type-index.ttl",
120
+ },
121
+ "label": "private",
122
+ }
123
+ ];
124
+
125
+ describe('loadTypeIndexesFor', () => {
126
+ it('exists', () => {
127
+ expect(typeIndexLogic.loadTypeIndexesFor).toBeInstanceOf(Function)
128
+ })
129
+ it('loads data', async () => {
130
+ const result = await typeIndexLogic.loadTypeIndexesFor(alice)
131
+ expect(result).toEqual(AliceScopes)
132
+ expect(store.statementsMatching(null, null, null, AlicePrivateTypeIndex).length).toEqual(8)
133
+ expect(store.statementsMatching(null, null, null, AlicePublicTypeIndex).length).toEqual(8)
134
+ })
47
135
  })
48
- it('runs', async () => {
49
- const result = await typeIndexLogic.loadTypeIndexes({})
50
- expect(result).toBeInstanceOf(Object)
136
+
137
+ const ClubScopes =
138
+ [
139
+ {
140
+ "agent": {
141
+ "classOrder": 5,
142
+ "termType": "NamedNode",
143
+ "value": "https://club.example.com/profile/card.ttl#it",
144
+ },
145
+ "index": {
146
+ "classOrder": 5,
147
+ "termType": "NamedNode",
148
+ "value": "https://club.example.com/profile/public-type-index.ttl",
149
+ },
150
+ "label": "public",
151
+ },
152
+ {
153
+ "agent": {
154
+ "classOrder": 5,
155
+ "termType": "NamedNode",
156
+ "value": "https://club.example.com/profile/card.ttl#it",
157
+ },
158
+ "index": {
159
+ "classOrder": 5,
160
+ "termType": "NamedNode",
161
+ "value": "https://club.example.com/settings/private-type-index.ttl",
162
+ },
163
+ "label": "private",
164
+ }
165
+ ]
166
+ describe('loadCommunityTypeIndexes', () => {
167
+ it('exists', () => {
168
+ expect(typeIndexLogic.loadCommunityTypeIndexes).toBeInstanceOf(Function)
169
+ })
170
+ it('loads data', async () => {
171
+ const result = await typeIndexLogic.loadCommunityTypeIndexes(alice)
172
+ expect(result).toEqual(ClubScopes)
173
+ })
51
174
  })
52
- })
53
175
 
54
- describe('registerInTypeIndex', () => {
55
- it('exists', () => {
56
- expect(typeIndexLogic.registerInTypeIndex).toBeInstanceOf(Function)
176
+ const AliceAndClubScopes =
177
+ [
178
+ {
179
+ "instance": {
180
+ "classOrder": 5,
181
+ "termType": "NamedNode",
182
+ "value": "https://alice.example.com/publicStuff/actionItems.ttl#this",
183
+ },
184
+ "scope": {
185
+ "agent": {
186
+ "classOrder": 5,
187
+ "termType": "NamedNode",
188
+ "value": "https://alice.example.com/profile/card.ttl#me",
189
+ },
190
+ "index": {
191
+ "classOrder": 5,
192
+ "termType": "NamedNode",
193
+ "value": "https://alice.example.com/profile/public-type-index.ttl",
194
+ },
195
+ "label": "public",
196
+ },
197
+ },
198
+ {
199
+ "instance": {
200
+ "classOrder": 5,
201
+ "termType": "NamedNode",
202
+ "value": "https://alice.example.com/project4/issues.ttl#this",
203
+ },
204
+ "scope": {
205
+ "agent": {
206
+ "classOrder": 5,
207
+ "termType": "NamedNode",
208
+ "value": "https://alice.example.com/profile/card.ttl#me",
209
+ },
210
+ "index": {
211
+ "classOrder": 5,
212
+ "termType": "NamedNode",
213
+ "value": "https://alice.example.com/profile/public-type-index.ttl",
214
+ },
215
+ "label": "public",
216
+ },
217
+ },
218
+ {
219
+ "instance": {
220
+ "classOrder": 5,
221
+ "termType": "NamedNode",
222
+ "value": "https://alice.example.com/privateStuff/ToDo.ttl#this",
223
+ },
224
+ "scope": {
225
+ "agent": {
226
+ "classOrder": 5,
227
+ "termType": "NamedNode",
228
+ "value": "https://alice.example.com/profile/card.ttl#me",
229
+ },
230
+ "index": {
231
+ "classOrder": 5,
232
+ "termType": "NamedNode",
233
+ "value": "https://alice.example.com/settings/private-type-index.ttl",
234
+ },
235
+ "label": "private",
236
+ },
237
+ },
238
+ {
239
+ "instance": {
240
+ "classOrder": 5,
241
+ "termType": "NamedNode",
242
+ "value": "https://alice.example.com/privateStuff/Goals.ttl#this",
243
+ },
244
+ "scope": {
245
+ "agent": {
246
+ "classOrder": 5,
247
+ "termType": "NamedNode",
248
+ "value": "https://alice.example.com/profile/card.ttl#me",
249
+ },
250
+ "index": {
251
+ "classOrder": 5,
252
+ "termType": "NamedNode",
253
+ "value": "https://alice.example.com/settings/private-type-index.ttl",
254
+ },
255
+ "label": "private",
256
+ },
257
+ },
258
+ {
259
+ "instance": {
260
+ "classOrder": 5,
261
+ "termType": "NamedNode",
262
+ "value": "https://alice.example.com/privateStuff/workingOn.ttl#this",
263
+ },
264
+ "scope": {
265
+ "agent": {
266
+ "classOrder": 5,
267
+ "termType": "NamedNode",
268
+ "value": "https://alice.example.com/profile/card.ttl#me",
269
+ },
270
+ "index": {
271
+ "classOrder": 5,
272
+ "termType": "NamedNode",
273
+ "value": "https://alice.example.com/settings/private-type-index.ttl",
274
+ },
275
+ "label": "private",
276
+ },
277
+ },
278
+ {
279
+ "instance": {
280
+ "classOrder": 5,
281
+ "termType": "NamedNode",
282
+ "value": "https://club.example.com/publicStuff/actionItems.ttl#this",
283
+ },
284
+ "scope": {
285
+ "agent": {
286
+ "classOrder": 5,
287
+ "termType": "NamedNode",
288
+ "value": "https://club.example.com/profile/card.ttl#it",
289
+ },
290
+ "index": {
291
+ "classOrder": 5,
292
+ "termType": "NamedNode",
293
+ "value": "https://club.example.com/profile/public-type-index.ttl",
294
+ },
295
+ "label": "public",
296
+ },
297
+ },
298
+ {
299
+ "instance": {
300
+ "classOrder": 5,
301
+ "termType": "NamedNode",
302
+ "value": "https://club.example.com/project4/clubIssues.ttl#this",
303
+ },
304
+ "scope": {
305
+ "agent": {
306
+ "classOrder": 5,
307
+ "termType": "NamedNode",
308
+ "value": "https://club.example.com/profile/card.ttl#it",
309
+ },
310
+ "index": {
311
+ "classOrder": 5,
312
+ "termType": "NamedNode",
313
+ "value": "https://club.example.com/profile/public-type-index.ttl",
314
+ },
315
+ "label": "public",
316
+ },
317
+ },
318
+ {
319
+ "instance": {
320
+ "classOrder": 5,
321
+ "termType": "NamedNode",
322
+ "value": "https://club.example.com/privateStuff/ToDo.ttl#this",
323
+ },
324
+ "scope": {
325
+ "agent": {
326
+ "classOrder": 5,
327
+ "termType": "NamedNode",
328
+ "value": "https://club.example.com/profile/card.ttl#it",
329
+ },
330
+ "index": {
331
+ "classOrder": 5,
332
+ "termType": "NamedNode",
333
+ "value": "https://club.example.com/settings/private-type-index.ttl",
334
+ },
335
+ "label": "private",
336
+ },
337
+ },
338
+ {
339
+ "instance": {
340
+ "classOrder": 5,
341
+ "termType": "NamedNode",
342
+ "value": "https://club.example.com/privateStuff/Goals.ttl#this",
343
+ },
344
+ "scope": {
345
+ "agent": {
346
+ "classOrder": 5,
347
+ "termType": "NamedNode",
348
+ "value": "https://club.example.com/profile/card.ttl#it",
349
+ },
350
+ "index": {
351
+ "classOrder": 5,
352
+ "termType": "NamedNode",
353
+ "value": "https://club.example.com/settings/private-type-index.ttl",
354
+ },
355
+ "label": "private",
356
+ },
357
+ },
358
+ {
359
+ "instance": {
360
+ "classOrder": 5,
361
+ "termType": "NamedNode",
362
+ "value": "https://club.example.com/privateStuff/tasks.ttl#this",
363
+ },
364
+ "scope": {
365
+ "agent": {
366
+ "classOrder": 5,
367
+ "termType": "NamedNode",
368
+ "value": "https://club.example.com/profile/card.ttl#it",
369
+ },
370
+ "index": {
371
+ "classOrder": 5,
372
+ "termType": "NamedNode",
373
+ "value": "https://club.example.com/settings/private-type-index.ttl",
374
+ },
375
+ "label": "private",
376
+ },
377
+ },
378
+ ]
379
+
380
+ describe('getScopedAppInstances', () => {
381
+ it('exists', () => {
382
+ expect(typeIndexLogic.getScopedAppInstances).toBeInstanceOf(Function)
383
+ })
384
+ it('pulls in users scopes and also community ones', async () => {
385
+ const result = await typeIndexLogic.getScopedAppInstances(Tracker, alice)
386
+ expect(result).toEqual(AliceAndClubScopes)
387
+ })
388
+ it('creates new preferenceFile and typeIndex files where they dont exist', async () => {
389
+ const result = await typeIndexLogic.getScopedAppInstances(Tracker, bob)
390
+
391
+ expect(requests[0].method).toEqual('PATCH') // Add preferrencesFile link to profile
392
+ expect(requests[0].url).toEqual('https://bob.example.com/profile/card.ttl')
393
+
394
+ expect(requests[1].method).toEqual('PUT') // create publiTypeIndex
395
+ expect(requests[1].url).toEqual('https://bob.example.com/profile/publicTypeIndex.ttl')
396
+
397
+ expect(requests[2].method).toEqual('PATCH') // Add link of publiTypeIndex to profile
398
+ expect(requests[2].url).toEqual('https://bob.example.com/profile/card.ttl')
399
+
400
+ expect(requests[3].method).toEqual('PUT') // create preferenceFile
401
+ expect(requests[3].url).toEqual('https://bob.example.com/Settings/Preferences.ttl')
402
+
403
+ expect(requests[4].method).toEqual('PATCH') // Add privateTypeIndex link preference file
404
+ expect(requests[4].url).toEqual('https://bob.example.com/Settings/Preferences.ttl')
405
+
406
+ expect(requests[5].method).toEqual('PUT') //create privatTypeIndex
407
+ expect(requests[5].url).toEqual('https://bob.example.com/Settings/privateTypeIndex.ttl')
408
+
409
+ expect(requests.length).toEqual(6)
410
+
411
+ })
57
412
  })
58
- it('throws error', async () => {
59
- expect(typeIndexLogic.registerInTypeIndex(
60
- {} as AuthenticationContext,
61
- sym('https://test.test#'),
62
- sym('https://test.test#'),
63
- false
64
- )).rejects
65
- .toThrow('@@ ensureLoadedPreferences: no user specified')
413
+
414
+ const TRACKERS =
415
+ [
416
+ {
417
+ "classOrder": 5,
418
+ "termType": "NamedNode",
419
+ "value": "https://alice.example.com/publicStuff/actionItems.ttl#this",
420
+ },
421
+ {
422
+ "classOrder": 5,
423
+ "termType": "NamedNode",
424
+ "value": "https://alice.example.com/project4/issues.ttl#this",
425
+ },
426
+ {
427
+ "classOrder": 5,
428
+ "termType": "NamedNode",
429
+ "value": "https://alice.example.com/privateStuff/ToDo.ttl#this",
430
+ },
431
+ {
432
+ "classOrder": 5,
433
+ "termType": "NamedNode",
434
+ "value": "https://alice.example.com/privateStuff/Goals.ttl#this",
435
+ },
436
+ {
437
+ "classOrder": 5,
438
+ "termType": "NamedNode",
439
+ "value": "https://alice.example.com/privateStuff/workingOn.ttl#this",
440
+ },
441
+ {
442
+ "classOrder": 5,
443
+ "termType": "NamedNode",
444
+ "value": "https://club.example.com/publicStuff/actionItems.ttl#this",
445
+ },
446
+ {
447
+ "classOrder": 5,
448
+ "termType": "NamedNode",
449
+ "value": "https://club.example.com/project4/clubIssues.ttl#this",
450
+ },
451
+ {
452
+ "classOrder": 5,
453
+ "termType": "NamedNode",
454
+ "value": "https://club.example.com/privateStuff/ToDo.ttl#this",
455
+ },
456
+ {
457
+ "classOrder": 5,
458
+ "termType": "NamedNode",
459
+ "value": "https://club.example.com/privateStuff/Goals.ttl#this",
460
+ },
461
+ {
462
+ "classOrder": 5,
463
+ "termType": "NamedNode",
464
+ "value": "https://club.example.com/privateStuff/tasks.ttl#this",
465
+ },
466
+ ]
467
+
468
+ describe('getAppInstances', () => {
469
+ it('exists', () => {
470
+ expect(typeIndexLogic.getAppInstances).toBeInstanceOf(Function)
471
+ })
472
+ it('finds trackers', async () => {
473
+ const result = await typeIndexLogic.getAppInstances(Tracker)
474
+ expect(result).toEqual(TRACKERS)
475
+ expect(result).toEqual(uniqueNodes(result)) // shoud have no dups
476
+ })
477
+ it('finds images in containers', async () => {
478
+ const result = await typeIndexLogic.getAppInstances(Image)
479
+ expect(result.length).toEqual(3)
480
+ expect(result).toEqual(uniqueNodes(result)) // shoud have no dups
481
+ expect(result.map(x => x.uri).join()).toEqual("https://alice.example.com/profile/Photos/photo1.png,https://alice.example.com/profile/Photos/photo2.png,https://alice.example.com/profile/Photos/photo3.png")
482
+ })
66
483
  })
67
- })
68
484
 
69
- })
485
+ describe('registerInTypeIndex', () => {
486
+ it('exists', () => {
487
+ expect(typeIndexLogic.registerInTypeIndex).toBeInstanceOf(Function)
488
+ })
489
+ it('throws error', async () => {
490
+ const result = await typeIndexLogic.registerInTypeIndex(
491
+ sym('https://test.test#'),
492
+ sym('https://test.test#'),
493
+ sym('https://test.test/TheClass')
494
+ )
495
+ console.log(result)
496
+ expect(result).toEqual(null)
497
+ })
498
+ })
499
+ })
@@ -1,37 +0,0 @@
1
- import { NamedNode, LiveStore } from 'rdflib';
2
- declare type TypeIndexScope = {
3
- label: string;
4
- index: NamedNode;
5
- agent: NamedNode;
6
- };
7
- declare type ScopedApp = {
8
- instance: NamedNode;
9
- scope: TypeIndexScope;
10
- };
11
- /**
12
- * Create a resource if it really does not exist
13
- * Be absolutely sure something does not exist before creating a new empty file
14
- * as otherwise existing could be deleted.
15
- * @param doc {NamedNode} - The resource
16
- */
17
- export declare function loadOrCreateIfNotExists(store: LiveStore, doc: NamedNode): Promise<any>;
18
- export declare function suggestPreferencesFile(me: NamedNode): NamedNode;
19
- export declare function suggestPublicTypeIndex(me: NamedNode): NamedNode;
20
- export declare function suggestPrivateTypeIndex(preferencesFile: NamedNode): NamedNode;
21
- export declare function followOrCreateLink(store: LiveStore, subject: NamedNode, predicate: NamedNode, object: NamedNode, doc: NamedNode): Promise<NamedNode | null>;
22
- export declare function loadProfile(store: LiveStore, user: NamedNode): Promise<NamedNode>;
23
- export declare function loadPreferences(store: LiveStore, user: NamedNode): Promise<NamedNode | undefined>;
24
- export declare function loadTypeIndexesFor(store: LiveStore, user: NamedNode): Promise<Array<TypeIndexScope>>;
25
- export declare function loadCommunityTypeIndexes(store: LiveStore, user: NamedNode): Promise<TypeIndexScope[][]>;
26
- export declare function loadAllTypeIndexes(store: LiveStore, user: NamedNode): Promise<TypeIndexScope[]>;
27
- export declare function uniqueNodes(arr: NamedNode[]): NamedNode[];
28
- export declare function getScopedAppsFromIndex(store: any, scope: any, theClass: NamedNode | null): Promise<{
29
- instance: NamedNode;
30
- scope: any;
31
- }[]>;
32
- export declare function getScopedAppInstances(store: LiveStore, klass: NamedNode, user: NamedNode): Promise<ScopedApp[]>;
33
- export declare function getAppInstances(store: LiveStore, klass: NamedNode): Promise<NamedNode[]>;
34
- export declare function registerInstanceInTypeIndex(store: LiveStore, instance: NamedNode, index: NamedNode, theClass: NamedNode): Promise<NamedNode | null>;
35
- export declare function deleteTypeIndexRegistration(store: LiveStore, item: any): Promise<void>;
36
- export {};
37
- //# sourceMappingURL=discoveryLogic.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"discoveryLogic.d.ts","sourceRoot":"","sources":["../../src/discovery/discoveryLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAW,MAAM,QAAQ,CAAA;AAQtD,aAAK,cAAc,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAAA;AAC3E,aAAK,SAAS,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,cAAc,CAAA;CAAE,CAAA;AAE/D;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,gBAmB9E;AAED,wBAAgB,sBAAsB,CAAE,EAAE,EAAC,SAAS,aAMnD;AAED,wBAAgB,sBAAsB,CAAE,EAAE,EAAC,SAAS,aAEnD;AAGD,wBAAgB,uBAAuB,CAAE,eAAe,EAAC,SAAS,aAEjE;AAMD,wBAAsB,kBAAkB,CAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAC/F,MAAM,EAAE,SAAS,EAAE,GAAG,EAAC,SAAS,GAAE,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAsB/D;AAED,wBAAsB,WAAW,CAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,sBAUnE;AAED,wBAAsB,eAAe,CAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAE,SAAS,GAAG,SAAS,CAAE,CAkB1G;AAED,wBAAsB,kBAAkB,CAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAC,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAwC1G;AAED,wBAAsB,wBAAwB,CAAE,KAAK,EAAC,SAAS,EAAE,IAAI,EAAC,SAAS,GAAG,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAa5G;AAED,wBAAsB,kBAAkB,CAAE,KAAK,EAAC,SAAS,EAAE,IAAI,EAAC,SAAS,6BAExE;AAGD,wBAAgB,WAAW,CAAE,GAAG,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAM1D;AAED,wBAAsB,sBAAsB,CAAE,KAAK,KAAA,EAAE,KAAK,KAAA,EAAE,QAAQ,EAAE,SAAS,GAAG,IAAI;;;KAuBrF;AAED,wBAAsB,qBAAqB,CAAE,KAAK,EAAC,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,GAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAQpH;AAKD,wBAAsB,eAAe,CAAE,KAAK,EAAC,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAK9F;AAOD,wBAAsB,2BAA2B,CAC/C,KAAK,EAAC,SAAS,EACf,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,SAAS,GAElB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAgB3B;AAED,wBAAsB,2BAA2B,CAAE,KAAK,EAAE,SAAS,EAAE,IAAI,KAAA,iBAKxE"}