solid-logic 1.3.17-2d62034f → 1.3.17-35eac4c0

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 (40) 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.map +1 -1
  4. package/lib/chat/chatLogic.d.ts +2 -15
  5. package/lib/chat/chatLogic.d.ts.map +1 -1
  6. package/lib/chat/chatLogic.js +8 -7
  7. package/lib/chat/chatLogic.js.map +1 -1
  8. package/lib/inbox/inboxLogic.d.ts +2 -6
  9. package/lib/inbox/inboxLogic.d.ts.map +1 -1
  10. package/lib/inbox/inboxLogic.js.map +1 -1
  11. package/lib/index.d.ts +3 -16
  12. package/lib/index.d.ts.map +1 -1
  13. package/lib/index.js +2 -74
  14. package/lib/index.js.map +1 -1
  15. package/lib/logic/SolidLogic.d.ts +7 -7
  16. package/lib/logic/SolidLogic.d.ts.map +1 -1
  17. package/lib/logic/SolidLogic.js +6 -6
  18. package/lib/logic/SolidLogic.js.map +1 -1
  19. package/lib/profile/profileLogic.d.ts +2 -10
  20. package/lib/profile/profileLogic.d.ts.map +1 -1
  21. package/lib/profile/profileLogic.js.map +1 -1
  22. package/lib/typeIndex/typeIndexLogic.d.ts +2 -18
  23. package/lib/typeIndex/typeIndexLogic.d.ts.map +1 -1
  24. package/lib/typeIndex/typeIndexLogic.js.map +1 -1
  25. package/lib/types.d.ts +52 -0
  26. package/lib/types.d.ts.map +1 -1
  27. package/package.json +1 -1
  28. package/src/acl/aclLogic.ts +5 -4
  29. package/src/chat/chatLogic.ts +7 -7
  30. package/src/inbox/inboxLogic.ts +2 -1
  31. package/src/index.ts +2 -124
  32. package/src/logic/SolidLogic.ts +13 -13
  33. package/src/profile/profileLogic.ts +3 -2
  34. package/src/typeIndex/typeIndexLogic.ts +3 -3
  35. package/src/types.ts +63 -0
  36. package/lib/logic/solidLogicSingletonNew.d.ts +0 -67
  37. package/lib/logic/solidLogicSingletonNew.d.ts.map +0 -1
  38. package/lib/logic/solidLogicSingletonNew.js +0 -219
  39. package/lib/logic/solidLogicSingletonNew.js.map +0 -1
  40. package/src/logic/solidLogicSingletonNew.ts +0 -210
@@ -1,210 +0,0 @@
1
- import * as rdf from "rdflib"
2
- import { SolidAuthnLogic } from "../authn/SolidAuthnLogic"
3
- import { authSession } from "../authSession/authSession"
4
- import { createContainerLogic } from "../util/containerLogic"
5
- import { createTypeIndexLogic } from "../typeIndex/typeIndexLogic"
6
- import * as debug from "../util/debug"
7
- import { createUtilityLogic } from "../util/utilityLogic"
8
- import { createProfileLogic } from "../profile/profileLogic"
9
- import { createInboxLogic } from "../inbox/inboxLogic"
10
- import { createChatLogic } from "../chat/chatLogic"
11
- import { createAclLogic } from "../acl/aclLogic"
12
-
13
- export function solidLogicSingleton() {
14
-
15
- const _fetch = async (url, requestInit) => {
16
- const omitCreds = requestInit && requestInit.credentials && requestInit.credentials == 'omit'
17
- if (authSession.info.webId && !omitCreds) { // see https://github.com/solidos/solidos/issues/114
18
- // In fact fetch should respect credentials omit itself
19
- return authSession.fetch(url, requestInit)
20
- } else {
21
- return window.fetch(url, requestInit)
22
- }
23
- }
24
-
25
- debug.log("SolidLogicSingleton: Unique instance created. There should only be one of these.")
26
-
27
- const store = rdf.graph() as rdf.LiveStore; // Make a Quad store
28
- rdf.fetcher(store, { fetch: _fetch }); // Attach a web I/O module, store.fetcher
29
- store.updater = new rdf.UpdateManager(store); // Add real-time live updates store.updater
30
- store.features = [] // disable automatic node merging on store load
31
-
32
- debug.log('SolidAuthnLogic initialized')
33
- const authn = new SolidAuthnLogic(authSession)
34
-
35
- const aclLogic = createAclLogic(store)
36
- const {
37
- findAclDocUrl,
38
- setACLUserPublic,
39
- genACLText
40
- } = aclLogic
41
-
42
- const containerLogic = createContainerLogic(store)
43
- const {
44
- isContainer,
45
- createContainer,
46
- getContainerElements,
47
- getContainerMembers
48
- } = containerLogic
49
-
50
- const utilityLogic = createUtilityLogic(store, aclLogic, containerLogic)
51
- const {
52
- recursiveDelete,
53
- setSinglePeerAccess,
54
- createEmptyRdfDoc,
55
- followOrCreateLink,
56
- loadOrCreateIfNotExists
57
- } = utilityLogic
58
-
59
- const profileLogic = createProfileLogic(store, authn, utilityLogic)
60
- const {
61
- loadMe,
62
- getPodRoot,
63
- getMainInbox,
64
- findStorage,
65
- loadPreferences,
66
- loadProfile,
67
- silencedLoadPreferences
68
- } = profileLogic
69
-
70
- const chatLogic = createChatLogic(store, profileLogic)
71
- const {
72
- setAcl,
73
- addToPrivateTypeIndex,
74
- findChat,
75
- createChatThing,
76
- getChat,
77
- sendInvite,
78
- mintNew
79
- } = chatLogic
80
-
81
- const inboxLogic = createInboxLogic(store, profileLogic, utilityLogic, containerLogic, aclLogic)
82
- const {
83
- createInboxFor,
84
- getNewMessages,
85
- markAsRead
86
- } = inboxLogic
87
-
88
- const typeIndexLogic = createTypeIndexLogic(store, authn, profileLogic, utilityLogic)
89
- const {
90
- registerInTypeIndex,
91
- getRegistrations,
92
- loadTypeIndexesFor,
93
- loadCommunityTypeIndexes,
94
- loadAllTypeIndexes,
95
- getScopedAppInstances,
96
- getAppInstances,
97
- suggestPublicTypeIndex,
98
- suggestPrivateTypeIndex,
99
- deleteTypeIndexRegistration,
100
- getScopedAppsFromIndex
101
- } = typeIndexLogic
102
-
103
- return {
104
- store,
105
- authn,
106
- authSession,
107
- //unilityLogic
108
- recursiveDelete,
109
- setSinglePeerAccess,
110
- createEmptyRdfDoc,
111
- followOrCreateLink,
112
- loadOrCreateIfNotExists,
113
- //containerLogic
114
- isContainer,
115
- createContainer,
116
- getContainerElements,
117
- getContainerMembers,
118
- //typeIndexLogic
119
- registerInTypeIndex,
120
- getRegistrations,
121
- loadTypeIndexesFor,
122
- loadCommunityTypeIndexes,
123
- loadAllTypeIndexes,
124
- getScopedAppInstances,
125
- getAppInstances,
126
- suggestPublicTypeIndex,
127
- suggestPrivateTypeIndex,
128
- deleteTypeIndexRegistration,
129
- getScopedAppsFromIndex,
130
- //profileLogic
131
- loadMe,
132
- getPodRoot,
133
- getMainInbox,
134
- findStorage,
135
- loadPreferences,
136
- loadProfile,
137
- silencedLoadPreferences,
138
- //inboxLogic
139
- createInboxFor,
140
- getNewMessages,
141
- markAsRead,
142
- //chatLogic
143
- setAcl,
144
- addToPrivateTypeIndex,
145
- findChat,
146
- createChatThing,
147
- getChat,
148
- sendInvite,
149
- mintNew,
150
- //aclLogic
151
- findAclDocUrl,
152
- setACLUserPublic,
153
- genACLText
154
- }
155
- }
156
-
157
- /*export {
158
- store,
159
- authn,
160
- authSession,
161
- //unilityLogic
162
- recursiveDelete,
163
- setSinglePeerAccess,
164
- createEmptyRdfDoc,
165
- followOrCreateLink,
166
- loadOrCreateIfNotExists,
167
- //containerLogic
168
- isContainer,
169
- createContainer,
170
- getContainerElements,
171
- getContainerMembers,
172
- //typeIndexLogic
173
- ensureTypeIndexes,
174
- registerInTypeIndex,
175
- getRegistrations,
176
- loadTypeIndexesFor,
177
- loadCommunityTypeIndexes,
178
- loadAllTypeIndexes,
179
- getScopedAppInstances,
180
- getAppInstances,
181
- suggestPublicTypeIndex,
182
- suggestPrivateTypeIndex,
183
- deleteTypeIndexRegistration,
184
- getScopedAppsFromIndex,
185
- //profileLogic
186
- loadMe,
187
- getPodRoot,
188
- getMainInbox,
189
- findStorage,
190
- loadPreferences,
191
- loadProfile,
192
- silencedLoadPreferences,
193
- //inboxLogic
194
- createInboxFor,
195
- getNewMessages,
196
- markAsRead,
197
- //chatLogic
198
- setAcl,
199
- addToPrivateTypeIndex,
200
- findChat,
201
- createChatThing,
202
- getChat,
203
- sendInvite,
204
- mintNew,
205
- //aclLogic
206
- findAclDocUrl,
207
- setACLUserPublic,
208
- genACLText
209
- }
210
- */