solid-ui 2.4.27-13192548 → 2.4.27-1b50dba8

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 (92) hide show
  1. package/dist/670.solid-ui.min.js +1 -0
  2. package/dist/805.solid-ui.min.js +3 -0
  3. package/dist/805.solid-ui.min.js.LICENSE.txt +58 -0
  4. package/dist/805.solid-ui.min.js.map +1 -0
  5. package/dist/_2b19.solid-ui.js +14 -0
  6. package/dist/_2b19.solid-ui.js.map +1 -0
  7. package/dist/solid-ui.js +7040 -20910
  8. package/dist/solid-ui.js.map +1 -1
  9. package/dist/solid-ui.min.js +1 -1
  10. package/dist/solid-ui.min.js.LICENSE.txt +4 -67
  11. package/dist/solid-ui.min.js.map +1 -1
  12. package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js +12134 -0
  13. package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js.map +1 -0
  14. package/lib/acl/access-controller.d.ts +2 -3
  15. package/lib/acl/access-controller.d.ts.map +1 -1
  16. package/lib/acl/access-controller.js +17 -15
  17. package/lib/acl/access-controller.js.map +1 -1
  18. package/lib/acl/access-groups.d.ts.map +1 -1
  19. package/lib/acl/access-groups.js +78 -8
  20. package/lib/acl/access-groups.js.map +1 -1
  21. package/lib/acl/acl-control.d.ts.map +1 -1
  22. package/lib/acl/acl-control.js +10 -11
  23. package/lib/acl/acl-control.js.map +1 -1
  24. package/lib/acl/acl.d.ts +1 -1
  25. package/lib/acl/acl.js +1 -1
  26. package/lib/acl/acl.js.map +1 -1
  27. package/lib/acl/add-agent-buttons.d.ts.map +1 -1
  28. package/lib/acl/add-agent-buttons.js +4 -3
  29. package/lib/acl/add-agent-buttons.js.map +1 -1
  30. package/lib/chat/bookmarks.js +7 -6
  31. package/lib/chat/bookmarks.js.map +1 -1
  32. package/lib/chat/chatLogic.js +85 -256
  33. package/lib/chat/chatLogic.js.map +1 -1
  34. package/lib/chat/crypto.d.ts +1 -0
  35. package/lib/chat/crypto.d.ts.map +1 -0
  36. package/lib/chat/crypto.js +257 -0
  37. package/lib/chat/crypto.js.map +1 -0
  38. package/lib/chat/infinite.js +426 -604
  39. package/lib/chat/infinite.js.map +1 -1
  40. package/lib/chat/keys.d.ts +5 -0
  41. package/lib/chat/keys.d.ts.map +1 -0
  42. package/lib/chat/keys.js +90 -0
  43. package/lib/chat/keys.js.map +1 -0
  44. package/lib/chat/message.js +174 -286
  45. package/lib/chat/message.js.map +1 -1
  46. package/lib/chat/messageTools.js +276 -464
  47. package/lib/chat/messageTools.js.map +1 -1
  48. package/lib/chat/signature.d.ts +27 -0
  49. package/lib/chat/signature.d.ts.map +1 -0
  50. package/lib/chat/signature.js +110 -0
  51. package/lib/chat/signature.js.map +1 -0
  52. package/lib/chat/thread.js +144 -166
  53. package/lib/chat/thread.js.map +1 -1
  54. package/lib/footer/index.d.ts.map +1 -1
  55. package/lib/footer/index.js +5 -1
  56. package/lib/footer/index.js.map +1 -1
  57. package/lib/header/index.d.ts.map +1 -1
  58. package/lib/header/index.js +41 -20
  59. package/lib/header/index.js.map +1 -1
  60. package/lib/login/login.d.ts.map +1 -1
  61. package/lib/login/login.js +13 -15
  62. package/lib/login/login.js.map +1 -1
  63. package/lib/preferences.js +0 -4
  64. package/lib/preferences.js.map +1 -1
  65. package/lib/style.js +60 -2
  66. package/lib/style.js.map +1 -1
  67. package/lib/utils/headerFooterHelpers.d.ts +0 -4
  68. package/lib/utils/headerFooterHelpers.d.ts.map +1 -1
  69. package/lib/utils/headerFooterHelpers.js +0 -27
  70. package/lib/utils/headerFooterHelpers.js.map +1 -1
  71. package/lib/versionInfo.js +2 -2
  72. package/lib/versionInfo.js.map +1 -1
  73. package/lib/widgets/buttons.d.ts.map +1 -1
  74. package/lib/widgets/buttons.js +43 -49
  75. package/lib/widgets/buttons.js.map +1 -1
  76. package/package.json +9 -8
  77. package/lib/acl/styles.d.ts +0 -90
  78. package/lib/acl/styles.d.ts.map +0 -1
  79. package/lib/acl/styles.js +0 -98
  80. package/lib/acl/styles.js.map +0 -1
  81. package/lib/footer/styleMap.d.ts +0 -8
  82. package/lib/footer/styleMap.d.ts.map +0 -1
  83. package/lib/footer/styleMap.js +0 -15
  84. package/lib/footer/styleMap.js.map +0 -1
  85. package/lib/header/styleMap.d.ts +0 -117
  86. package/lib/header/styleMap.d.ts.map +0 -1
  87. package/lib/header/styleMap.js +0 -139
  88. package/lib/header/styleMap.js.map +0 -1
  89. package/lib/jss/index.d.ts +0 -20
  90. package/lib/jss/index.d.ts.map +0 -1
  91. package/lib/jss/index.js +0 -47
  92. package/lib/jss/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"chatLogic.js","names":["debug","_interopRequireWildcard","require","_dateFolder","_solidLogic","ns","$rdf","utils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ChatChannel","channel","options","_classCallCheck2","channelRoot","doc","dateFolder","DateFolder","div","_createClass2","value","_createMessage","_asyncToGenerator2","_regenerator","mark","_callee","text","wrap","_callee$","_context","prev","next","abrupt","updateMessage","stop","createMessage","_x","apply","arguments","_updateMessage","_this","oldMsg","length","undefined","deleteIt","thread","_callee2","sts","now","timestamp","dateStamp","chatDocument","message","me","msg","_callee2$","_context2","Date","getTime","term","leafDocumentFromDate","store","sym","uri","authn","currentUser","t0","t1","mostRecentVersion","t2","sent","t3","dct","t4","t5","t6","st","push","schema","wf","sioc","literal","foaf","sameTerm","updater","updateMany","t7","warn","alert","Error","_x2","_deleteMessage","_callee3","_callee3$","_context3","deleteMessage","_x3","_createThread","_callee4","threadRoot","already","insert","_callee4$","_context4","each","filter","holds","rdf","update","createThread","_x4","exports","allVersions","_x5","_allVersions","_callee5","versions","done","m","_callee5$","_context5","ur","any","fetcher","load","unshift","originalVersion","_x6","_originalVersion","_callee6","_callee6$","_context6","error","_x7","_mostRecentVersion","_callee7","_callee7$","_context7","isDeleted","isReplaced","isHidden","nick","person","s","label","_createIfNotExists","_x8","_createIfNotExists2","contentType","data","_callee8","response","_callee8$","_context8","status","log","webOperation","requested"],"sources":["../../src/chat/chatLogic.js"],"sourcesContent":["/**\n * Contains the [[ChatChannel]] class and logic for Solid Chat\n * @packageDocumentation\n */\n\nimport * as debug from '../debug'\nimport { DateFolder } from './dateFolder'\nimport { store, authn } from 'solid-logic'\nimport * as ns from '../ns'\nimport * as $rdf from 'rdflib' // pull in first avoid cross-refs\nimport * as utils from '../utils'\n\n/* The Solid logic for a 'LongChat'\n*/\n/**\n * Common code for a chat (discussion area of messages about something)\n * This version runs over a series of files for different time periods\n *\n * Parameters for the whole chat like its title are stored on\n * index.ttl#this and the chats messages are stored in YYYY/MM/DD/chat.ttl\n *\n */\n\nexport class ChatChannel {\n constructor (channel, options) {\n this.channel = channel\n this.channelRoot = channel.doc()\n this.options = options\n this.dateFolder = new DateFolder(this.channelRoot, 'chat.ttl')\n this.div = null // : HTMLElement\n }\n\n /* Store a new message in the web,\n */\n async createMessage (text) {\n return this.updateMessage(text)\n }\n\n /* Store a new message in the web,\n as a replacement for an existing one.\n The old one iis left, and the two are linked\n */\n async updateMessage (text, oldMsg = null, deleteIt, thread = null) {\n const sts = []\n const now = new Date()\n const timestamp = '' + now.getTime()\n const dateStamp = $rdf.term(now)\n const chatDocument = oldMsg ? oldMsg.doc() : this.dateFolder.leafDocumentFromDate(now)\n const message = store.sym(chatDocument.uri + '#' + 'Msg' + timestamp)\n // const content = store.literal(text)\n\n const me = authn.currentUser() // If already logged on\n\n if (oldMsg) { // edit message replaces old one\n sts.push($rdf.st(await mostRecentVersion(oldMsg), ns.dct('isReplacedBy'), message, chatDocument))\n if (deleteIt) {\n sts.push($rdf.st(message, ns.schema('dateDeleted'), dateStamp, chatDocument))\n }\n } else { // link new message to channel\n sts.push($rdf.st(this.channel, ns.wf('message'), message, chatDocument))\n }\n sts.push(\n $rdf.st(message, ns.sioc('content'), store.literal(text), chatDocument)\n )\n sts.push(\n $rdf.st(message, ns.dct('created'), dateStamp, chatDocument)\n )\n if (me) {\n sts.push($rdf.st(message, ns.foaf('maker'), me, chatDocument))\n }\n if (thread) {\n sts.push($rdf.st(thread, ns.sioc('has_member'), message, chatDocument))\n if (!thread.doc().sameTerm(message.doc())) {\n sts.push($rdf.st(thread, ns.sioc('has_member'), message, thread.doc()))\n }\n }\n try {\n await store.updater.updateMany([], sts)\n } catch (err) {\n const msg = 'Error saving chat message: ' + err\n debug.warn(msg)\n alert(msg)\n throw new Error(msg)\n }\n return message\n }\n\n /* Mark a message as deleted\n * Wee add a new version of the message,m witha deletion flag (deletion date)\n * so that the deletion can be revoked by adding another non-deleted update\n */\n async deleteMessage (message) {\n return this.updateMessage('(message deleted)', message, true)\n }\n\n // Create a new thread of replies to the thread root message\n // or returns one which already exists\n\n async createThread (threadRoot) {\n const already = store.each(threadRoot, ns.sioc('has_reply'), null, threadRoot.doc())\n .filter(thread => store.holds(thread, ns.rdf('type'), ns.sioc('Thread'), thread.doc()))\n if (already.length > 0) return already[0]\n\n const thread = $rdf.sym(threadRoot.uri + '-thread')\n const insert = [\n $rdf.st(thread, ns.rdf('type'), ns.sioc('Thread'), thread.doc()),\n $rdf.st(threadRoot, ns.sioc('has_reply'), thread, thread.doc())\n ]\n await store.updater.update([], insert)\n return thread\n }\n} // class ChatChannel\n\n// ////////// Utility functions\n\n// Have to not loop forever if fed loops\nexport async function allVersions (message) {\n const versions = [message]\n const done = {}\n done[message.ur] = true\n let m = message\n while (true) { // earlier?\n const prev = store.any(null, ns.dct('isReplacedBy'), m, m.doc())\n if (!prev || done[prev.uri]) break\n await store.fetcher.load(prev)\n versions.unshift(prev)\n done[prev.uri] = true\n m = prev\n }\n m = message\n while (true) { // later?\n const next = store.any(m, ns.dct('isReplacedBy'), null, m.doc())\n if (!next || done[next.uri]) break\n versions.push(next)\n done[next.uri] = true\n m = next\n }\n return versions\n}\n\nexport async function originalVersion (message) {\n let msg = message\n const done = {}\n // done[message.ur] = true\n while (msg) {\n if (done[msg.uri]) {\n debug.error('originalVersion: verion loop' + message)\n return message\n }\n done[msg.uri] = true\n message = msg\n await store.fetcher.load(message)\n msg = store.any(null, ns.dct('isReplacedBy'), message, message.doc())\n }\n return message\n}\n\nexport async function mostRecentVersion (message) {\n let msg = message\n const done = {}\n while (msg) {\n if (done[msg.uri]) {\n debug.error('mostRecentVersion: verion loop' + message)\n return message\n }\n done[msg.uri] = true\n message = msg\n await store.fetcher.load(message)\n msg = store.any(message, ns.dct('isReplacedBy'), null, message.doc())\n }\n return message\n}\n\nexport function isDeleted (message) {\n return store.holds(message, ns.schema('dateDeleted'), null, message.doc())\n}\n\nexport function isReplaced (message) {\n return store.holds(message, ns.dct('isReplacedBy'), null, message.doc())\n}\n\nexport function isHidden (message) {\n return this.isDeleted(message) || this.isReplaced(message)\n}\n\n// A Nickname for a person\n\nexport function nick (person) {\n const s = store.any(person, ns.foaf('nick'))\n if (s) return '' + s.value\n return '' + utils.label(person)\n}\n\nexport async function _createIfNotExists (doc, contentType = 'text/turtle', data = '') {\n let response\n try {\n response = await store.fetcher.load(doc)\n } catch (err) {\n if (err.response.status === 404) {\n debug.log(\n 'createIfNotExists: doc does NOT exist, will create... ' + doc\n )\n try {\n response = await store.fetcher.webOperation('PUT', doc.uri, {\n data,\n contentType\n })\n } catch (err) {\n debug.log('createIfNotExists doc FAILED: ' + doc + ': ' + err)\n throw err\n }\n delete store.fetcher.requested[doc.uri] // delete cached 404 error\n // debug.log('createIfNotExists doc created ok ' + doc)\n return response\n } else {\n debug.log(\n 'createIfNotExists doc load error NOT 404: ' + doc + ': ' + err\n )\n throw err\n }\n }\n // debug.log('createIfNotExists: doc exists, all good: ' + doc)\n return response\n}\n// ends\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAKA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,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KAAA,OAAAC,SAAA;AAAA"}
1
+ {"version":3,"file":"chatLogic.js","names":["debug","_interopRequireWildcard","require","_dateFolder","_solidLogic","ns","$rdf","utils","_signature","_keys","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ChatChannel","channel","options","_classCallCheck2","channelRoot","doc","dateFolder","DateFolder","div","_createClass2","value","_createMessage","_asyncToGenerator2","_regenerator","mark","_callee","text","wrap","_callee$","_context","prev","next","abrupt","updateMessage","stop","createMessage","_x","apply","arguments","_updateMessage","_this","oldMsg","length","undefined","deleteIt","_callee2","sts","now","timestamp","dateStamp","chatDocument","message","me","msg","privateKey","errMsg","_callee2$","_context2","Date","getTime","term","leafDocumentFromDate","store","sym","uri","authn","currentUser","getBlankMsg","id","push","st","mostRecentVersion","dct","schema","dateDeleted","wf","sioc","literal","content","created","foaf","maker","getPrivateKey","sent","concat","SEC","signMsg","updater","update","t0","warn","alert","Error","_x2","_deleteMessage","_callee3","_callee3$","_context3","deleteMessage","_x3","exports","originalVersion","any","isDeleted","holds","isReplaced","isHidden","nick","person","s","label","_createIfNotExists","_x4","_createIfNotExists2","contentType","data","_callee4","response","_callee4$","_context4","fetcher","load","status","log","webOperation","t1","requested"],"sources":["../../src/chat/chatLogic.js"],"sourcesContent":["/**\n * Contains the [[ChatChannel]] class and logic for Solid Chat\n * @packageDocumentation\n */\n\nimport * as debug from '../debug'\nimport { DateFolder } from './dateFolder'\nimport { store, authn } from 'solid-logic'\nimport * as ns from '../ns'\nimport * as $rdf from 'rdflib' // pull in first avoid cross-refs\nimport * as utils from '../utils'\nimport { getBlankMsg, signMsg, SEC } from './signature'\nimport { getPrivateKey } from './keys'\n\n/* The Solid logic for a 'LongChat'\n*/\n/**\n * Common code for a chat (discussion area of messages about something)\n * This version runs over a series of files for different time periods\n *\n * Parameters for the whole chat like its title are stored on\n * index.ttl#this and the chats messages are stored in YYYY/MM/DD/chat.ttl\n *\n */\n\nexport class ChatChannel {\n constructor (channel, options) {\n this.channel = channel\n this.channelRoot = channel.doc()\n this.options = options\n this.dateFolder = new DateFolder(this.channelRoot, 'chat.ttl')\n this.div = null // : HTMLElement\n }\n\n /* Store a new message in the web,\n */\n async createMessage (text) {\n return this.updateMessage(text)\n }\n\n /* Store a new message in the web,\n as a replacement for an existing one.\n The old one iis left, and the two are linked\n */\n async updateMessage (text, oldMsg = null, deleteIt) {\n const sts = []\n const now = new Date()\n const timestamp = '' + now.getTime()\n const dateStamp = $rdf.term(now)\n const chatDocument = oldMsg ? oldMsg.doc() : this.dateFolder.leafDocumentFromDate(now)\n const message = store.sym(chatDocument.uri + '#' + 'Msg' + timestamp)\n // const content = store.literal(text)\n\n const me = authn.currentUser() // If already logged on\n\n const msg = getBlankMsg\n msg.id = message\n if (oldMsg) { // edit message replaces old one\n sts.push($rdf.st(mostRecentVersion(oldMsg), ns.dct('isReplacedBy'), message, chatDocument))\n // do we need to rebuild oldMsg signaturen ?\n if (deleteIt) {\n sts.push($rdf.st(message, ns.schema('dateDeleted'), dateStamp, chatDocument))\n msg.dateDeleted = dateStamp\n }\n } else { // link new message to channel\n sts.push($rdf.st(this.channel, ns.wf('message'), message, chatDocument))\n }\n sts.push(\n $rdf.st(message, ns.sioc('content'), store.literal(text), chatDocument)\n )\n msg.content = text\n\n sts.push(\n $rdf.st(message, ns.dct('created'), dateStamp, chatDocument)\n )\n msg.created = dateStamp\n if (me) {\n sts.push($rdf.st(message, ns.foaf('maker'), me, chatDocument))\n msg.maker = me\n // privateKey the cached private key of me, cache should be deleted after a certain time\n const privateKey = await getPrivateKey(me)\n sts.push($rdf.st(message, $rdf.sym(`${SEC}Proof`), $rdf.sym(signMsg(msg, privateKey), chatDocument)))\n }\n try {\n await store.updater.update([], sts)\n } catch (err) {\n const errMsg = 'Error saving chat message: ' + err\n debug.warn(errMsg)\n alert(errMsg)\n throw new Error(errMsg)\n }\n return message\n }\n\n /* Mark a message as deleted\n * Wee add a new version of the message,m witha deletion flag (deletion date)\n * so that the deletion can be revoked by adding another non-deleted update\n */\n async deleteMessage (message) {\n return this.updateMessage('(message deleted)', message, true)\n }\n} // class ChatChannel\n\nexport function originalVersion (message) {\n let msg = message\n while (msg) {\n message = msg\n msg = store.any(null, ns.dct('isReplacedBy'), message, message.doc())\n }\n return message\n}\n\nexport function mostRecentVersion (message) {\n let msg = message\n while (msg) {\n message = msg\n msg = store.any(message, ns.dct('isReplacedBy'), null, message.doc())\n }\n return message\n}\n\nexport function isDeleted (message) {\n return store.holds(message, ns.schema('dateDeleted'), null, message.doc())\n}\n\nexport function isReplaced (message) {\n return store.holds(message, ns.dct('isReplacedBy'), null, message.doc())\n}\n\nexport function isHidden (message) {\n return this.isDeleted(message) || this.isReplaced(message)\n}\n\n// A Nickname for a person\n\nexport function nick (person) {\n const s = store.any(person, ns.foaf('nick'))\n if (s) return '' + s.value\n return '' + utils.label(person)\n}\n\nexport async function _createIfNotExists (doc, contentType = 'text/turtle', data = '') {\n let response\n try {\n response = await store.fetcher.load(doc)\n } catch (err) {\n if (err.response.status === 404) {\n debug.log(\n 'createIfNotExists: doc does NOT exist, will create... ' + doc\n )\n try {\n response = await store.fetcher.webOperation('PUT', doc.uri, {\n data,\n contentType\n })\n } catch (err) {\n debug.log('createIfNotExists doc FAILED: ' + doc + ': ' + err)\n throw err\n }\n delete store.fetcher.requested[doc.uri] // delete cached 404 error\n // debug.log('createIfNotExists doc created ok ' + doc)\n return response\n } else {\n debug.log(\n 'createIfNotExists doc load error NOT 404: ' + doc + ': ' + err\n )\n throw err\n }\n }\n // debug.log('createIfNotExists: doc exists, all good: ' + doc)\n return response\n}\n// ends\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAKA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,O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YAAA,OAAAE,SAAA,CAAArF,IAAA;QAAA;MAAA,GAAAkF,QAAA;IAAA;EAAA,CAChB;EAAA,OAAAH,mBAAA,CAAA5E,KAAA,OAAAC,SAAA;AAAA"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=crypto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/chat/crypto.ts"],"names":[],"mappings":""}
@@ -0,0 +1,257 @@
1
+ /* import { literal, quad, Statement } from 'rdflib';
2
+ // import { PODCHAT, removeHashFromUrl } from './Constants';
3
+ import { authn } from 'solid-logic'
4
+ import * as UI from 'solid-ui'
5
+ import * as $rdf from 'rdflib'
6
+
7
+ const ns = UI.ns
8
+
9
+ const removeHashFromUrl = (url: string) => {
10
+ const newUrl = new URL(url)
11
+ newUrl.hash = ''
12
+ return newUrl.href
13
+ }
14
+ const PODCHAT_NS = 'https://www.pod-chat.com/';
15
+ const PODCHAT = {
16
+ LongChatMessage: PODCHAT_NS + 'LongChatMessage',
17
+ LongChatMessageReply: PODCHAT_NS + 'LongChatMessageReply',
18
+ RSAPublicKey: PODCHAT_NS + 'RSAPublicKey',
19
+ RSAPrivateKey: PODCHAT_NS + 'RSAPrivateKey',
20
+ signature: PODCHAT_NS + 'signature'
21
+ }
22
+
23
+ // import rdfStore, { extractObjectLastValue } from './RdfStore';
24
+
25
+ export type RdfStore = {
26
+ cache: Store,
27
+ fetcher: Fetcher,
28
+ updateManager: UpdateManager
29
+ }
30
+ function extractObject({ cache }: RdfStore, webid: string, resourceUrl: string, predicate: PredicateType): Array<Node> {
31
+ return cache.each(cache.sym(webid), predicate, undefined, cache.sym(resourceUrl));
32
+ }
33
+ function extractObjectLastValue(rdfStore: RdfStore, webid: string, resourceUrl: string, predicate: PredicateType): string | undefined {
34
+ return extractObject(rdfStore, webid, resourceUrl, predicate).map(q => q.value).pop();
35
+ }
36
+
37
+ export const prepareRsaKeyPair = async (profileId: string, rsaPrivateKeyResourceUrl: string): Promise<void> => {
38
+
39
+ const privKey = await getPrivateKey(rsaPrivateKeyResourceUrl);
40
+ const pubKey = await getPublicKey(profileId);
41
+
42
+ if (!privKey || !pubKey) {
43
+ await createKeyPair(profileId, rsaPrivateKeyResourceUrl);
44
+ const privKeyNew = await getPrivateKey(rsaPrivateKeyResourceUrl);
45
+ const pubKeyNew = await getPublicKey(profileId);
46
+ if (!privKeyNew || !pubKeyNew) {
47
+ throw new Error('Unable to create RSA keypair.');
48
+ }
49
+ }
50
+ }
51
+
52
+ export const signMessage = async (rsaPrivateKeyResourceUrl: string, messageContent: string): Promise<string | undefined> => {
53
+ const privateKey = await getPrivateKey(rsaPrivateKeyResourceUrl);
54
+ if (privateKey) {
55
+ const messageContentEnc = new TextEncoder().encode(messageContent);
56
+ const signature = await window.crypto.subtle.sign(
57
+ {
58
+ name: "RSA-PSS",
59
+ saltLength: 32,
60
+ },
61
+ privateKey,
62
+ messageContentEnc
63
+ );
64
+ const exportedAsString = ab2str(signature);
65
+ const exportedAsBase64 = window.btoa(exportedAsString);
66
+ return exportedAsBase64;
67
+ }
68
+
69
+ return undefined;
70
+ }
71
+
72
+ export const verifyMessage = async (profileId: string, messageId: string, messageContent: string, signatureEncoded: string): Promise<{ messageId: string, trusted: boolean }> => {
73
+ let encoded = new TextEncoder().encode(messageContent);
74
+ const publicKey = await getPublicKey(profileId);
75
+ // base64 decode the string to get the binary data
76
+ const binaryDerString = window.atob(signatureEncoded);
77
+ // convert from a binary string to an ArrayBuffer
78
+ const signature = str2ab(binaryDerString);
79
+
80
+ if (publicKey) {
81
+ const trusted = await window.crypto.subtle.verify(
82
+ {
83
+ name: "RSA-PSS",
84
+ saltLength: 32,
85
+ },
86
+ publicKey,
87
+ signature,
88
+ encoded
89
+ );
90
+ return { messageId, trusted };
91
+ }
92
+
93
+ return { messageId, trusted: false };
94
+ }
95
+
96
+ const getPublicKey = async (profileId: string): Promise<CryptoKey | undefined> => {
97
+ const profileResourceUrl = removeHashFromUrl(profileId);
98
+ await rdfStore.fetcher.load(profileResourceUrl);
99
+ const pubKeyEncoded = extractObjectLastValue(rdfStore, PODCHAT.RSAPublicKey, profileResourceUrl, rdfStore.cache.sym(SIOC.content_encoded));
100
+ if (pubKeyEncoded) {
101
+ return importPublicKey(pubKeyEncoded);
102
+ }
103
+
104
+ return undefined;
105
+ }
106
+
107
+ const getPrivateKey = async (rsaPrivateKeyResourceUrl: string): Promise<CryptoKey | undefined> => {
108
+ await rdfStore.fetcher.load(rsaPrivateKeyResourceUrl);
109
+ const privKeyEncoded = extractObjectLastValue(rdfStore, PODCHAT.RSAPrivateKey, rsaPrivateKeyResourceUrl, rdfStore.cache.sym(SIOC.content_encoded));
110
+ if (privKeyEncoded) {
111
+ return importPrivateKey(privKeyEncoded);
112
+ }
113
+ return undefined;
114
+ }
115
+
116
+ /*
117
+ Import a PEM encoded RSA private key, to use for RSA-PSS signing.
118
+ Takes a string containing the PEM encoded key, and returns a Promise
119
+ that will resolve to a CryptoKey representing the private key.
120
+ */
121
+ /* function importPrivateKey(pem: string) {
122
+ // base64 decode the string to get the binary data
123
+ const binaryDerString = window.atob(pem);
124
+ // convert from a binary string to an ArrayBuffer
125
+ const binaryDer = str2ab(binaryDerString);
126
+
127
+ return window.crypto.subtle.importKey(
128
+ "pkcs8",
129
+ binaryDer,
130
+ {
131
+ name: "RSA-PSS",
132
+ // Consider using a 4096-bit key for systems that require long-term security
133
+ //modulusLength: 4096,
134
+ //publicExponent: new Uint8Array([1, 0, 1]),
135
+ hash: "SHA-256",
136
+ },
137
+ true,
138
+ ["sign"]
139
+ );
140
+ }
141
+
142
+ /*
143
+ Import a PEM encoded RSA public key, to use for RSA-OAEP encryption.
144
+ Takes a string containing the PEM encoded key, and returns a Promise
145
+ that will resolve to a CryptoKey representing the public key.
146
+ */
147
+ /* function importPublicKey(pem: string) {
148
+ // base64 decode the string to get the binary data
149
+ const binaryDerString = window.atob(pem);
150
+ // convert from a binary string to an ArrayBuffer
151
+ const binaryDer = str2ab(binaryDerString);
152
+
153
+ return window.crypto.subtle.importKey(
154
+ "spki",
155
+ binaryDer,
156
+ {
157
+ name: "RSA-PSS",
158
+ hash: "SHA-256"
159
+ },
160
+ true,
161
+ ["verify"]
162
+ );
163
+ }
164
+
165
+ /* const createKeyPair = async (profileId: string, rsaPrivateKeyResourceUrl: string) => {
166
+ const key = await window.crypto.subtle
167
+ .generateKey(
168
+ {
169
+ name: "RSA-PSS",
170
+ // Consider using a 4096-bit key for systems that require long-term security
171
+ modulusLength: 4096,
172
+ publicExponent: new Uint8Array([1, 0, 1]),
173
+ hash: "SHA-256",
174
+ },
175
+ true,
176
+ ["sign", "verify"]
177
+ );
178
+
179
+ await privKeyPkcs8Pem(key.privateKey, profileId, rsaPrivateKeyResourceUrl);
180
+ await pubKeySpkiPem(key.publicKey, profileId);
181
+ } */
182
+
183
+ /* async function privKeyPkcs8Pem(privKey: CryptoKey, profileId: string, rsaPrivateKeyResourceUrl: string) {
184
+ const exported = await window.crypto.subtle.exportKey("pkcs8", privKey);
185
+ const exportedAsString = ab2str(exported);
186
+ const exportedAsBase64 = window.btoa(exportedAsString);
187
+ const del: Statement[] = [];
188
+ const ins: Statement[] = [];
189
+ del.push(...rdfStore.cache.statementsMatching(
190
+ rdfStore.cache.sym(PODCHAT.RSAPrivateKey),
191
+ rdfStore.cache.sym(SIOC.content_encoded),
192
+ undefined,
193
+ rdfStore.cache.sym(rsaPrivateKeyResourceUrl)
194
+ ));
195
+ ins.push(quad(
196
+ rdfStore.cache.sym(PODCHAT.RSAPrivateKey),
197
+ rdfStore.cache.sym(SIOC.content_encoded),
198
+ literal(exportedAsBase64), // alain
199
+ rdfStore.cache.sym(rsaPrivateKeyResourceUrl)
200
+ ));
201
+ await rdfStore.updateManager.update(del, ins);
202
+ await aclForResource(rsaPrivateKeyResourceUrl, profileId);
203
+ }
204
+
205
+ async function aclForResource(resourceUrl: string, ownerId: string) {
206
+ const ins: Statement[] = [];
207
+ const aclResourceUrl = resourceUrl + '.acl';
208
+ const graph = rdfStore.cache.sym(aclResourceUrl);
209
+ const aclId = rdfStore.cache.sym(aclResourceUrl + '#ControlReadWrite');
210
+ ins.push(quad(aclId, rdfStore.cache.sym(RDF.type), rdfStore.cache.sym(ACL.Authorization), graph));
211
+ ins.push(quad(aclId, rdfStore.cache.sym(ACL.accessTo), rdfStore.cache.sym(resourceUrl), graph));
212
+ [ACL.Control, ACL.Write, ACL.Read].forEach(mode => {
213
+ ins.push(quad(aclId, rdfStore.cache.sym(ACL.mode), rdfStore.cache.sym(mode), graph));
214
+ });
215
+ ins.push(quad(aclId, rdfStore.cache.sym(ACL.agent), rdfStore.cache.sym(ownerId), graph));
216
+ await rdfStore.updateManager.update([], ins);
217
+ }
218
+
219
+ async function pubKeySpkiPem(pubKey: CryptoKey, profileId: string) {
220
+ const exported = await window.crypto.subtle.exportKey("spki", pubKey);
221
+ const exportedAsString = ab2str(exported);
222
+ const exportedAsBase64 = window.btoa(exportedAsString);
223
+ const profileResourceUrl = removeHashFromUrl(profileId);
224
+ const del: Statement[] = [];
225
+ const ins: Statement[] = [];
226
+ del.push(...rdfStore.cache.statementsMatching(
227
+ rdfStore.cache.sym(PODCHAT.RSAPublicKey),
228
+ rdfStore.cache.sym(SIOC.content_encoded),
229
+ undefined,
230
+ rdfStore.cache.sym(profileResourceUrl)
231
+ ));
232
+ ins.push(quad(
233
+ rdfStore.cache.sym(PODCHAT.RSAPublicKey),
234
+ rdfStore.cache.sym(SIOC.content_encoded),
235
+ literal(exportedAsBase64), // alain
236
+ rdfStore.cache.sym(profileResourceUrl)
237
+ ));
238
+ await rdfStore.updateManager.update(del, ins);
239
+ }
240
+
241
+ /*
242
+ Convert an ArrayBuffer into a string
243
+ */
244
+ /* function ab2str(buf: ArrayBuffer) {
245
+ return String.fromCharCode.apply(null, new Uint8Array(buf) as unknown as number[]);
246
+ }
247
+
248
+ function str2ab(str: string) {
249
+ const buf = new ArrayBuffer(str.length);
250
+ const bufView = new Uint8Array(buf);
251
+ for (let i = 0, strLen = str.length; i < strLen; i++) {
252
+ bufView[i] = str.charCodeAt(i);
253
+ }
254
+ return buf;
255
+ } */
256
+ "use strict";
257
+ //# sourceMappingURL=crypto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crypto.js","names":[],"sources":["../../src/chat/crypto.ts"],"sourcesContent":["/* import { literal, quad, Statement } from 'rdflib';\r\n// import { PODCHAT, removeHashFromUrl } from './Constants';\r\nimport { authn } from 'solid-logic'\r\nimport * as UI from 'solid-ui'\r\nimport * as $rdf from 'rdflib'\r\n\r\nconst ns = UI.ns\r\n\r\nconst removeHashFromUrl = (url: string) => {\r\n const newUrl = new URL(url)\r\n newUrl.hash = ''\r\n return newUrl.href\r\n}\r\nconst PODCHAT_NS = 'https://www.pod-chat.com/';\r\nconst PODCHAT = {\r\n LongChatMessage: PODCHAT_NS + 'LongChatMessage',\r\n LongChatMessageReply: PODCHAT_NS + 'LongChatMessageReply',\r\n RSAPublicKey: PODCHAT_NS + 'RSAPublicKey',\r\n RSAPrivateKey: PODCHAT_NS + 'RSAPrivateKey',\r\n signature: PODCHAT_NS + 'signature'\r\n}\r\n\r\n// import rdfStore, { extractObjectLastValue } from './RdfStore';\r\n\r\nexport type RdfStore = {\r\n cache: Store,\r\n fetcher: Fetcher,\r\n updateManager: UpdateManager\r\n}\r\nfunction extractObject({ cache }: RdfStore, webid: string, resourceUrl: string, predicate: PredicateType): Array<Node> {\r\n return cache.each(cache.sym(webid), predicate, undefined, cache.sym(resourceUrl));\r\n}\r\nfunction extractObjectLastValue(rdfStore: RdfStore, webid: string, resourceUrl: string, predicate: PredicateType): string | undefined {\r\n return extractObject(rdfStore, webid, resourceUrl, predicate).map(q => q.value).pop();\r\n}\r\n\r\nexport const prepareRsaKeyPair = async (profileId: string, rsaPrivateKeyResourceUrl: string): Promise<void> => {\r\n\r\n const privKey = await getPrivateKey(rsaPrivateKeyResourceUrl);\r\n const pubKey = await getPublicKey(profileId);\r\n\r\n if (!privKey || !pubKey) {\r\n await createKeyPair(profileId, rsaPrivateKeyResourceUrl);\r\n const privKeyNew = await getPrivateKey(rsaPrivateKeyResourceUrl);\r\n const pubKeyNew = await getPublicKey(profileId);\r\n if (!privKeyNew || !pubKeyNew) {\r\n throw new Error('Unable to create RSA keypair.');\r\n }\r\n }\r\n}\r\n\r\nexport const signMessage = async (rsaPrivateKeyResourceUrl: string, messageContent: string): Promise<string | undefined> => {\r\n const privateKey = await getPrivateKey(rsaPrivateKeyResourceUrl);\r\n if (privateKey) {\r\n const messageContentEnc = new TextEncoder().encode(messageContent);\r\n const signature = await window.crypto.subtle.sign(\r\n {\r\n name: \"RSA-PSS\",\r\n saltLength: 32,\r\n },\r\n privateKey,\r\n messageContentEnc\r\n );\r\n const exportedAsString = ab2str(signature);\r\n const exportedAsBase64 = window.btoa(exportedAsString);\r\n return exportedAsBase64;\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nexport const verifyMessage = async (profileId: string, messageId: string, messageContent: string, signatureEncoded: string): Promise<{ messageId: string, trusted: boolean }> => {\r\n let encoded = new TextEncoder().encode(messageContent);\r\n const publicKey = await getPublicKey(profileId);\r\n // base64 decode the string to get the binary data\r\n const binaryDerString = window.atob(signatureEncoded);\r\n // convert from a binary string to an ArrayBuffer\r\n const signature = str2ab(binaryDerString);\r\n\r\n if (publicKey) {\r\n const trusted = await window.crypto.subtle.verify(\r\n {\r\n name: \"RSA-PSS\",\r\n saltLength: 32,\r\n },\r\n publicKey,\r\n signature,\r\n encoded\r\n );\r\n return { messageId, trusted };\r\n }\r\n\r\n return { messageId, trusted: false };\r\n}\r\n\r\nconst getPublicKey = async (profileId: string): Promise<CryptoKey | undefined> => {\r\n const profileResourceUrl = removeHashFromUrl(profileId);\r\n await rdfStore.fetcher.load(profileResourceUrl);\r\n const pubKeyEncoded = extractObjectLastValue(rdfStore, PODCHAT.RSAPublicKey, profileResourceUrl, rdfStore.cache.sym(SIOC.content_encoded));\r\n if (pubKeyEncoded) {\r\n return importPublicKey(pubKeyEncoded);\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nconst getPrivateKey = async (rsaPrivateKeyResourceUrl: string): Promise<CryptoKey | undefined> => {\r\n await rdfStore.fetcher.load(rsaPrivateKeyResourceUrl);\r\n const privKeyEncoded = extractObjectLastValue(rdfStore, PODCHAT.RSAPrivateKey, rsaPrivateKeyResourceUrl, rdfStore.cache.sym(SIOC.content_encoded));\r\n if (privKeyEncoded) {\r\n return importPrivateKey(privKeyEncoded);\r\n }\r\n return undefined;\r\n}\r\n\r\n/*\r\n Import a PEM encoded RSA private key, to use for RSA-PSS signing.\r\n Takes a string containing the PEM encoded key, and returns a Promise\r\n that will resolve to a CryptoKey representing the private key.\r\n */\r\n/* function importPrivateKey(pem: string) {\r\n // base64 decode the string to get the binary data\r\n const binaryDerString = window.atob(pem);\r\n // convert from a binary string to an ArrayBuffer\r\n const binaryDer = str2ab(binaryDerString);\r\n\r\n return window.crypto.subtle.importKey(\r\n \"pkcs8\",\r\n binaryDer,\r\n {\r\n name: \"RSA-PSS\",\r\n // Consider using a 4096-bit key for systems that require long-term security\r\n //modulusLength: 4096,\r\n //publicExponent: new Uint8Array([1, 0, 1]),\r\n hash: \"SHA-256\",\r\n },\r\n true,\r\n [\"sign\"]\r\n );\r\n}\r\n\r\n/*\r\n Import a PEM encoded RSA public key, to use for RSA-OAEP encryption.\r\n Takes a string containing the PEM encoded key, and returns a Promise\r\n that will resolve to a CryptoKey representing the public key.\r\n */\r\n/* function importPublicKey(pem: string) {\r\n // base64 decode the string to get the binary data\r\n const binaryDerString = window.atob(pem);\r\n // convert from a binary string to an ArrayBuffer\r\n const binaryDer = str2ab(binaryDerString);\r\n\r\n return window.crypto.subtle.importKey(\r\n \"spki\",\r\n binaryDer,\r\n {\r\n name: \"RSA-PSS\",\r\n hash: \"SHA-256\"\r\n },\r\n true,\r\n [\"verify\"]\r\n );\r\n}\r\n\r\n/* const createKeyPair = async (profileId: string, rsaPrivateKeyResourceUrl: string) => {\r\n const key = await window.crypto.subtle\r\n .generateKey(\r\n {\r\n name: \"RSA-PSS\",\r\n // Consider using a 4096-bit key for systems that require long-term security\r\n modulusLength: 4096,\r\n publicExponent: new Uint8Array([1, 0, 1]),\r\n hash: \"SHA-256\",\r\n },\r\n true,\r\n [\"sign\", \"verify\"]\r\n );\r\n\r\n await privKeyPkcs8Pem(key.privateKey, profileId, rsaPrivateKeyResourceUrl);\r\n await pubKeySpkiPem(key.publicKey, profileId);\r\n} */\r\n\r\n/* async function privKeyPkcs8Pem(privKey: CryptoKey, profileId: string, rsaPrivateKeyResourceUrl: string) {\r\n const exported = await window.crypto.subtle.exportKey(\"pkcs8\", privKey);\r\n const exportedAsString = ab2str(exported);\r\n const exportedAsBase64 = window.btoa(exportedAsString);\r\n const del: Statement[] = [];\r\n const ins: Statement[] = [];\r\n del.push(...rdfStore.cache.statementsMatching(\r\n rdfStore.cache.sym(PODCHAT.RSAPrivateKey),\r\n rdfStore.cache.sym(SIOC.content_encoded),\r\n undefined,\r\n rdfStore.cache.sym(rsaPrivateKeyResourceUrl)\r\n ));\r\n ins.push(quad(\r\n rdfStore.cache.sym(PODCHAT.RSAPrivateKey),\r\n rdfStore.cache.sym(SIOC.content_encoded),\r\n literal(exportedAsBase64), // alain\r\n rdfStore.cache.sym(rsaPrivateKeyResourceUrl)\r\n ));\r\n await rdfStore.updateManager.update(del, ins);\r\n await aclForResource(rsaPrivateKeyResourceUrl, profileId);\r\n}\r\n\r\nasync function aclForResource(resourceUrl: string, ownerId: string) {\r\n const ins: Statement[] = [];\r\n const aclResourceUrl = resourceUrl + '.acl';\r\n const graph = rdfStore.cache.sym(aclResourceUrl);\r\n const aclId = rdfStore.cache.sym(aclResourceUrl + '#ControlReadWrite');\r\n ins.push(quad(aclId, rdfStore.cache.sym(RDF.type), rdfStore.cache.sym(ACL.Authorization), graph));\r\n ins.push(quad(aclId, rdfStore.cache.sym(ACL.accessTo), rdfStore.cache.sym(resourceUrl), graph));\r\n [ACL.Control, ACL.Write, ACL.Read].forEach(mode => {\r\n ins.push(quad(aclId, rdfStore.cache.sym(ACL.mode), rdfStore.cache.sym(mode), graph));\r\n });\r\n ins.push(quad(aclId, rdfStore.cache.sym(ACL.agent), rdfStore.cache.sym(ownerId), graph));\r\n await rdfStore.updateManager.update([], ins);\r\n}\r\n\r\nasync function pubKeySpkiPem(pubKey: CryptoKey, profileId: string) {\r\n const exported = await window.crypto.subtle.exportKey(\"spki\", pubKey);\r\n const exportedAsString = ab2str(exported);\r\n const exportedAsBase64 = window.btoa(exportedAsString);\r\n const profileResourceUrl = removeHashFromUrl(profileId);\r\n const del: Statement[] = [];\r\n const ins: Statement[] = [];\r\n del.push(...rdfStore.cache.statementsMatching(\r\n rdfStore.cache.sym(PODCHAT.RSAPublicKey),\r\n rdfStore.cache.sym(SIOC.content_encoded),\r\n undefined,\r\n rdfStore.cache.sym(profileResourceUrl)\r\n ));\r\n ins.push(quad(\r\n rdfStore.cache.sym(PODCHAT.RSAPublicKey),\r\n rdfStore.cache.sym(SIOC.content_encoded),\r\n literal(exportedAsBase64), // alain\r\n rdfStore.cache.sym(profileResourceUrl)\r\n ));\r\n await rdfStore.updateManager.update(del, ins);\r\n}\r\n\r\n/*\r\n Convert an ArrayBuffer into a string\r\n */\r\n/* function ab2str(buf: ArrayBuffer) {\r\n return String.fromCharCode.apply(null, new Uint8Array(buf) as unknown as number[]);\r\n}\r\n\r\nfunction str2ab(str: string) {\r\n const buf = new ArrayBuffer(str.length);\r\n const bufView = new Uint8Array(buf);\r\n for (let i = 0, strLen = str.length; i < strLen; i++) {\r\n bufView[i] = str.charCodeAt(i);\r\n }\r\n return buf;\r\n} */\r\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAXA"}