solid-ui 2.4.27-20175fe3 → 2.4.27-2910a831
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.
- package/dist/solid-ui.js +168 -101
- package/dist/solid-ui.js.map +1 -1
- package/dist/solid-ui.min.js +1 -1
- package/dist/solid-ui.min.js.map +1 -1
- package/lib/chat/keys.d.ts +1 -1
- package/lib/chat/keys.d.ts.map +1 -1
- package/lib/chat/keys.js +26 -97
- package/lib/chat/keys.js.map +1 -1
- package/lib/chat/message.js +16 -2
- package/lib/chat/message.js.map +1 -1
- package/lib/utils/cryptoKeyHelpers.d.ts +5 -0
- package/lib/utils/cryptoKeyHelpers.d.ts.map +1 -0
- package/lib/utils/cryptoKeyHelpers.js +114 -0
- package/lib/utils/cryptoKeyHelpers.js.map +1 -0
- package/lib/versionInfo.js +2 -2
- package/lib/versionInfo.js.map +1 -1
- package/package.json +1 -1
package/lib/chat/keys.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare function generatePrivateKey(): string;
|
|
2
2
|
export declare function generatePublicKey(privateKey: string): string;
|
|
3
|
-
export declare function getPublicKey(webId: any): string | undefined
|
|
3
|
+
export declare function getPublicKey(webId: any): Promise<string | undefined>;
|
|
4
4
|
export declare function getPrivateKey(webId: string): Promise<string>;
|
|
5
5
|
//# sourceMappingURL=keys.d.ts.map
|
package/lib/chat/keys.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/chat/keys.ts"],"names":[],"mappings":"AAQA,wBAAgB,kBAAkB,IAAK,MAAM,CAE5C;AAED,wBAAgB,iBAAiB,CAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,YAAY,CAAE,KAAK,KAAA
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/chat/keys.ts"],"names":[],"mappings":"AAQA,wBAAgB,kBAAkB,IAAK,MAAM,CAE5C;AAED,wBAAgB,iBAAiB,CAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,YAAY,CAAE,KAAK,KAAA,+BAGlC;AAED,wBAAsB,aAAa,CAAE,KAAK,EAAE,MAAM,mBAqCjD"}
|
package/lib/chat/keys.js
CHANGED
|
@@ -17,6 +17,7 @@ var _utils = require("@noble/hashes/utils");
|
|
|
17
17
|
var _signature = require("./signature");
|
|
18
18
|
var _solidLogic = require("solid-logic");
|
|
19
19
|
var $rdf = _interopRequireWildcard(require("rdflib"));
|
|
20
|
+
var _cryptoKeyHelpers = require("../utils/cryptoKeyHelpers");
|
|
20
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
23
|
function generatePrivateKey() {
|
|
@@ -26,103 +27,31 @@ function generatePublicKey(privateKey) {
|
|
|
26
27
|
return (0, _utils.bytesToHex)(_secp256k.schnorr.getPublicKey(privateKey));
|
|
27
28
|
}
|
|
28
29
|
function getPublicKey(webId) {
|
|
29
|
-
var publicKey = publicKeyExists(webId);
|
|
30
|
+
var publicKey = (0, _cryptoKeyHelpers.publicKeyExists)(webId);
|
|
30
31
|
return publicKey;
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
var url = new URL(webId);
|
|
35
|
-
url.hash = '';
|
|
36
|
-
/* debug.warn('Alain publicKeyExists')
|
|
37
|
-
debug.warn(webId)
|
|
38
|
-
debug.warn(url.href) */
|
|
39
|
-
_solidLogic.store.fetcher.load(url.href);
|
|
40
|
-
var publicKey = _solidLogic.store.any(_solidLogic.store.sym(webId), _solidLogic.store.sym(_signature.CERT + 'PublicKey'));
|
|
41
|
-
return publicKey === null || publicKey === void 0 ? void 0 : publicKey.value; // as NamedNode
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
var privKeyUrl = function privKeyUrl(webId) {
|
|
45
|
-
var url = new URL(webId);
|
|
46
|
-
var privateKeyUrl = url.protocol + '//' + url.host + '/profile/privateKey.ttl';
|
|
47
|
-
return privateKeyUrl;
|
|
48
|
-
};
|
|
49
|
-
function privateKeyExists(_x) {
|
|
50
|
-
return _privateKeyExists.apply(this, arguments);
|
|
33
|
+
function getPrivateKey(_x) {
|
|
34
|
+
return _getPrivateKey.apply(this, arguments);
|
|
51
35
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
var
|
|
36
|
+
function _getPrivateKey() {
|
|
37
|
+
_getPrivateKey = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(webId) {
|
|
38
|
+
var publicKeyUrl, privateKeyUrl, publicKey, privateKey, del, add;
|
|
55
39
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
56
40
|
while (1) switch (_context.prev = _context.next) {
|
|
57
41
|
case 0:
|
|
58
42
|
/* const url = new URL(webId)
|
|
59
|
-
|
|
60
|
-
privateKeyUrl = privKeyUrl(webId);
|
|
61
|
-
/* debug.warn('Alain privateKeyExists')
|
|
62
|
-
debug.warn(webId)
|
|
63
|
-
debug.warn(privateKeyUrl) */
|
|
64
|
-
_context.prev = 1;
|
|
65
|
-
_solidLogic.store.fetcher.load(privateKeyUrl);
|
|
66
|
-
privateKey = _solidLogic.store.any(_solidLogic.store.sym(webId), _solidLogic.store.sym(_signature.CERT + 'PrivateKey'));
|
|
67
|
-
return _context.abrupt("return", privateKey === null || privateKey === void 0 ? void 0 : privateKey.value);
|
|
68
|
-
case 7:
|
|
69
|
-
_context.prev = 7;
|
|
70
|
-
_context.t0 = _context["catch"](1);
|
|
71
|
-
if (!((_context.t0 === null || _context.t0 === void 0 ? void 0 : (_err$response = _context.t0.response) === null || _err$response === void 0 ? void 0 : _err$response.status) === 404)) {
|
|
72
|
-
_context.next = 24;
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
_context.prev = 10;
|
|
76
|
-
// create privateKey resource
|
|
77
|
-
data = '';
|
|
78
|
-
contentType = 'text/ttl';
|
|
79
|
-
_context.next = 15;
|
|
80
|
-
return _solidLogic.store.fetcher.webOperation('PUT', privateKeyUrl, {
|
|
81
|
-
data: data,
|
|
82
|
-
contentType: contentType
|
|
83
|
-
});
|
|
84
|
-
case 15:
|
|
85
|
-
response = _context.sent;
|
|
86
|
-
_context.next = 22;
|
|
87
|
-
break;
|
|
88
|
-
case 18:
|
|
89
|
-
_context.prev = 18;
|
|
90
|
-
_context.t1 = _context["catch"](10);
|
|
91
|
-
debug.log('createIfNotExists doc FAILED: ' + privateKeyUrl + ': ' + _context.t1);
|
|
92
|
-
throw _context.t1;
|
|
93
|
-
case 22:
|
|
94
|
-
delete _solidLogic.store.fetcher.requested[privateKeyUrl]; // delete cached 404 error
|
|
95
|
-
return _context.abrupt("return", undefined);
|
|
96
|
-
case 24:
|
|
97
|
-
debug.log('createIfNotExists doc FAILED: ' + privateKeyUrl + ': ' + _context.t0);
|
|
98
|
-
throw _context.t0;
|
|
99
|
-
case 26:
|
|
100
|
-
case "end":
|
|
101
|
-
return _context.stop();
|
|
102
|
-
}
|
|
103
|
-
}, _callee, null, [[1, 7], [10, 18]]);
|
|
104
|
-
}));
|
|
105
|
-
return _privateKeyExists.apply(this, arguments);
|
|
106
|
-
}
|
|
107
|
-
function getPrivateKey(_x2) {
|
|
108
|
-
return _getPrivateKey.apply(this, arguments);
|
|
109
|
-
}
|
|
110
|
-
function _getPrivateKey() {
|
|
111
|
-
_getPrivateKey = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(webId) {
|
|
112
|
-
var url, privateKeyUrl, publicKey, privateKey, del, add;
|
|
113
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
114
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
115
|
-
case 0:
|
|
116
|
-
url = new URL(webId);
|
|
117
|
-
url.hash = '';
|
|
43
|
+
url.hash = '' */
|
|
118
44
|
/* const privateKeyUrl = url.protocol + '//' + url.host + '/profile/privateKey.ttl' */
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
45
|
+
publicKeyUrl = (0, _cryptoKeyHelpers.pubKeyUrl)(webId);
|
|
46
|
+
privateKeyUrl = (0, _cryptoKeyHelpers.privKeyUrl)(webId); // find publickey
|
|
47
|
+
_context.next = 4;
|
|
48
|
+
return (0, _cryptoKeyHelpers.publicKeyExists)(webId);
|
|
49
|
+
case 4:
|
|
50
|
+
publicKey = _context.sent;
|
|
51
|
+
_context.next = 7;
|
|
52
|
+
return (0, _cryptoKeyHelpers.privateKeyExists)(webId);
|
|
53
|
+
case 7:
|
|
54
|
+
privateKey = _context.sent;
|
|
126
55
|
// debug.warn('privateKey ' + privateKey)
|
|
127
56
|
if (privateKey && publicKey !== generatePublicKey(privateKey)) debug.warn('publicKey is not valid');
|
|
128
57
|
|
|
@@ -134,28 +63,28 @@ function _getPrivateKey() {
|
|
|
134
63
|
|
|
135
64
|
// create key pair
|
|
136
65
|
if (!(!privateKey || !publicKey)) {
|
|
137
|
-
|
|
66
|
+
_context.next = 20;
|
|
138
67
|
break;
|
|
139
68
|
}
|
|
140
69
|
del = [];
|
|
141
70
|
add = [];
|
|
142
71
|
if (privateKey) del.push($rdf.st($rdf.sym(webId), $rdf.sym(_signature.CERT + 'PrivateKey'), $rdf.lit(privateKey), $rdf.sym(privateKeyUrl)));
|
|
143
|
-
if (publicKey) del.push($rdf.st($rdf.sym(webId), $rdf.sym(_signature.CERT + 'PublicKey'), $rdf.lit(publicKey), $rdf.sym(
|
|
72
|
+
if (publicKey) del.push($rdf.st($rdf.sym(webId), $rdf.sym(_signature.CERT + 'PublicKey'), $rdf.lit(publicKey), $rdf.sym(publicKeyUrl)));
|
|
144
73
|
privateKey = generatePrivateKey();
|
|
145
74
|
publicKey = generatePublicKey(privateKey);
|
|
146
75
|
/* debug.log('newPrivateKey-1 ' + privateKey)
|
|
147
76
|
debug.log('newPublicKey-1 ' + publicKey) */
|
|
148
77
|
add.push($rdf.st($rdf.sym(webId), $rdf.sym(_signature.CERT + 'PrivateKey'), $rdf.literal(privateKey), $rdf.sym(privateKeyUrl)));
|
|
149
|
-
add.push($rdf.st($rdf.sym(webId), $rdf.sym(_signature.CERT + 'PublicKey'), $rdf.literal(publicKey), $rdf.sym(
|
|
150
|
-
|
|
78
|
+
add.push($rdf.st($rdf.sym(webId), $rdf.sym(_signature.CERT + 'PublicKey'), $rdf.literal(publicKey), $rdf.sym(publicKeyUrl)));
|
|
79
|
+
_context.next = 20;
|
|
151
80
|
return _solidLogic.store.updater.updateMany(del, add);
|
|
152
|
-
case 19:
|
|
153
|
-
return _context2.abrupt("return", privateKey);
|
|
154
81
|
case 20:
|
|
82
|
+
return _context.abrupt("return", privateKey);
|
|
83
|
+
case 21:
|
|
155
84
|
case "end":
|
|
156
|
-
return
|
|
85
|
+
return _context.stop();
|
|
157
86
|
}
|
|
158
|
-
},
|
|
87
|
+
}, _callee);
|
|
159
88
|
}));
|
|
160
89
|
return _getPrivateKey.apply(this, arguments);
|
|
161
90
|
}
|
package/lib/chat/keys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","names":["debug","_interopRequireWildcard","require","_secp256k","_utils","_signature","_solidLogic","$rdf","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","generatePrivateKey","bytesToHex","schnorr","utils","randomPrivateKey","generatePublicKey","privateKey","getPublicKey","webId","publicKey","publicKeyExists","url","URL","hash","store","fetcher","load","href","any","sym","CERT","value","privKeyUrl","privateKeyUrl","protocol","host","privateKeyExists","_x","_privateKeyExists","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","_err$response","data","contentType","response","wrap","_callee$","_context","prev","next","abrupt","t0","status","webOperation","sent","t1","log","requested","undefined","stop","getPrivateKey","_x2","_getPrivateKey","_callee2","del","add","_callee2$","_context2","warn","push","st","lit","literal","updater","updateMany"],"sources":["../../src/chat/keys.ts"],"sourcesContent":["import * as debug from '../debug'\r\nimport { schnorr } from '@noble/curves/secp256k1'\r\nimport { bytesToHex } from '@noble/hashes/utils'\r\nimport { CERT } from './signature'\r\nimport { store } from 'solid-logic'\r\nimport * as $rdf from 'rdflib'\r\nimport { NamedNode, literal } from 'rdflib'\r\n\r\nexport function generatePrivateKey (): string {\r\n return bytesToHex(schnorr.utils.randomPrivateKey())\r\n}\r\n\r\nexport function generatePublicKey (privateKey: string): string {\r\n return bytesToHex(schnorr.getPublicKey(privateKey))\r\n}\r\n\r\nexport function getPublicKey (webId) {\r\n const publicKey = publicKeyExists(webId)\r\n return publicKey\r\n}\r\n\r\nfunction publicKeyExists (webId: string) {\r\n // find publickey\r\n const url = new URL(webId)\r\n url.hash = ''\r\n /* debug.warn('Alain publicKeyExists')\r\n debug.warn(webId)\r\n debug.warn(url.href) */\r\n store.fetcher.load(url.href)\r\n const publicKey = store.any(store.sym(webId), store.sym(CERT + 'PublicKey'))\r\n return publicKey?.value // as NamedNode\r\n}\r\n\r\nconst privKeyUrl = (webId: string) => {\r\n const url = new URL(webId)\r\n const privateKeyUrl = url.protocol + '//' + url.host + '/profile/privateKey.ttl'\r\n return privateKeyUrl\r\n}\r\n\r\nasync function privateKeyExists (webId: string) {\r\n /* const url = new URL(webId)\r\n const privateKeyUrl = url.protocol + '//' + url.host + '/profile/privateKey.ttl' */\r\n const privateKeyUrl = privKeyUrl(webId)\r\n /* debug.warn('Alain privateKeyExists')\r\n debug.warn(webId)\r\n debug.warn(privateKeyUrl) */\r\n try {\r\n store.fetcher.load(privateKeyUrl)\r\n const privateKey = store.any(store.sym(webId), store.sym(CERT + 'PrivateKey'))\r\n return privateKey?.value // as NamedNode\r\n } catch (err) {\r\n if (err?.response?.status === 404) {\r\n try {\r\n // create privateKey resource\r\n const data = ''\r\n const contentType = 'text/ttl'\r\n const response = await store.fetcher.webOperation('PUT', privateKeyUrl, {\r\n data,\r\n contentType\r\n })\r\n // create ACL resource\r\n } catch (err) {\r\n debug.log('createIfNotExists doc FAILED: ' + privateKeyUrl + ': ' + err)\r\n throw err\r\n }\r\n delete store.fetcher.requested[privateKeyUrl] // delete cached 404 error\r\n return undefined\r\n }\r\n debug.log('createIfNotExists doc FAILED: ' + privateKeyUrl + ': ' + err)\r\n throw err\r\n }\r\n}\r\n\r\nexport async function getPrivateKey (webId: string) {\r\n const url = new URL(webId)\r\n url.hash = ''\r\n /* const privateKeyUrl = url.protocol + '//' + url.host + '/profile/privateKey.ttl' */\r\n const privateKeyUrl = privKeyUrl(webId)\r\n\r\n // find publickey\r\n let publicKey = publicKeyExists(webId)\r\n // debug.warn('publicKey ' + publicKey)\r\n // find privateKey\r\n let privateKey = await privateKeyExists(webId)\r\n // debug.warn('privateKey ' + privateKey)\r\n if (privateKey && (publicKey !== generatePublicKey(privateKey as string))) debug.warn('publicKey is not valid')\r\n\r\n // simulate new key pair\r\n /* const newPrivateKey = generatePrivateKey()\r\n const newPublicKey = generatePublicKey(newPrivateKey)\r\n debug.log('newPrivateKey ' + newPrivateKey)\r\n debug.log('newPublicKey ' + newPublicKey) */\r\n\r\n // create key pair\r\n if (!privateKey || !publicKey) {\r\n const del: any[] = []\r\n const add: any[] = []\r\n if (privateKey) del.push($rdf.st($rdf.sym(webId), $rdf.sym(CERT + 'PrivateKey'), $rdf.lit(privateKey), $rdf.sym(privateKeyUrl)))\r\n if (publicKey) del.push($rdf.st($rdf.sym(webId), $rdf.sym(CERT + 'PublicKey'), $rdf.lit(publicKey), $rdf.sym(url.href)))\r\n\r\n privateKey = generatePrivateKey()\r\n publicKey = generatePublicKey(privateKey)\r\n /* debug.log('newPrivateKey-1 ' + privateKey)\r\n debug.log('newPublicKey-1 ' + publicKey) */\r\n add.push($rdf.st($rdf.sym(webId), $rdf.sym(CERT + 'PrivateKey'), $rdf.literal(privateKey), $rdf.sym(privateKeyUrl)))\r\n add.push($rdf.st($rdf.sym(webId), $rdf.sym(CERT + 'PublicKey'), $rdf.literal(publicKey), $rdf.sym(url.href)))\r\n await store.updater.updateMany(del, add)\r\n }\r\n return privateKey as string\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAN,uBAAA,CAAAC,OAAA;AAA8B,SAAAM,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAY,GAAA,EAAAJ,WAAA,SAAAA,WAAA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A4C,SAAA,CAAAlB,IAAA;UAAA,OACvG7B,iBAAK,CAACqD,OAAO,CAACC,UAAU,CAACV,GAAG,EAAEC,GAAG,CAAC;QAAA;UAAA,OAAAE,SAAA,CAAAjB,MAAA,WAEnCtC,UAAU;QAAA;QAAA;UAAA,OAAAuD,SAAA,CAAAR,IAAA;MAAA;IAAA,GAAAI,QAAA;EAAA,CAClB;EAAA,OAAAD,cAAA,CAAA3B,KAAA,OAAAC,SAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"keys.js","names":["debug","_interopRequireWildcard","require","_secp256k","_utils","_signature","_solidLogic","$rdf","_cryptoKeyHelpers","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","generatePrivateKey","bytesToHex","schnorr","utils","randomPrivateKey","generatePublicKey","privateKey","getPublicKey","webId","publicKey","publicKeyExists","getPrivateKey","_x","_getPrivateKey","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","publicKeyUrl","privateKeyUrl","del","add","wrap","_callee$","_context","prev","next","pubKeyUrl","privKeyUrl","sent","privateKeyExists","warn","push","st","sym","CERT","lit","literal","store","updater","updateMany","abrupt","stop"],"sources":["../../src/chat/keys.ts"],"sourcesContent":["import * as debug from '../debug'\r\nimport { schnorr } from '@noble/curves/secp256k1'\r\nimport { bytesToHex } from '@noble/hashes/utils'\r\nimport { CERT } from './signature'\r\nimport { store } from 'solid-logic'\r\nimport * as $rdf from 'rdflib'\r\nimport { publicKeyExists, pubKeyUrl, privKeyUrl, privateKeyExists } from '../utils/cryptoKeyHelpers'\r\n\r\nexport function generatePrivateKey (): string {\r\n return bytesToHex(schnorr.utils.randomPrivateKey())\r\n}\r\n\r\nexport function generatePublicKey (privateKey: string): string {\r\n return bytesToHex(schnorr.getPublicKey(privateKey))\r\n}\r\n\r\nexport function getPublicKey (webId) {\r\n const publicKey = publicKeyExists(webId)\r\n return publicKey\r\n}\r\n\r\nexport async function getPrivateKey (webId: string) {\r\n /* const url = new URL(webId)\r\n url.hash = '' */\r\n /* const privateKeyUrl = url.protocol + '//' + url.host + '/profile/privateKey.ttl' */\r\n const publicKeyUrl = pubKeyUrl(webId)\r\n const privateKeyUrl = privKeyUrl(webId)\r\n\r\n // find publickey\r\n let publicKey = await publicKeyExists(webId)\r\n // debug.warn('publicKey ' + publicKey)\r\n // find privateKey\r\n let privateKey = await privateKeyExists(webId)\r\n // debug.warn('privateKey ' + privateKey)\r\n if (privateKey && (publicKey !== generatePublicKey(privateKey as string))) debug.warn('publicKey is not valid')\r\n\r\n // simulate new key pair\r\n /* const newPrivateKey = generatePrivateKey()\r\n const newPublicKey = generatePublicKey(newPrivateKey)\r\n debug.log('newPrivateKey ' + newPrivateKey)\r\n debug.log('newPublicKey ' + newPublicKey) */\r\n\r\n // create key pair\r\n if (!privateKey || !publicKey) {\r\n const del: any[] = []\r\n const add: any[] = []\r\n if (privateKey) del.push($rdf.st($rdf.sym(webId), $rdf.sym(CERT + 'PrivateKey'), $rdf.lit(privateKey), $rdf.sym(privateKeyUrl)))\r\n if (publicKey) del.push($rdf.st($rdf.sym(webId), $rdf.sym(CERT + 'PublicKey'), $rdf.lit(publicKey), $rdf.sym(publicKeyUrl)))\r\n\r\n privateKey = generatePrivateKey()\r\n publicKey = generatePublicKey(privateKey)\r\n /* debug.log('newPrivateKey-1 ' + privateKey)\r\n debug.log('newPublicKey-1 ' + publicKey) */\r\n add.push($rdf.st($rdf.sym(webId), $rdf.sym(CERT + 'PrivateKey'), $rdf.literal(privateKey), $rdf.sym(privateKeyUrl)))\r\n add.push($rdf.st($rdf.sym(webId), $rdf.sym(CERT + 'PublicKey'), $rdf.literal(publicKey), $rdf.sym(publicKeyUrl)))\r\n await store.updater.updateMany(del, add)\r\n }\r\n return privateKey as string\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,K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GAAG,CAACW,IAAI,CAAC1D,IAAI,CAAC2D,EAAE,CAAC3D,IAAI,CAAC4D,GAAG,CAAC5B,KAAK,CAAC,EAAEhC,IAAI,CAAC4D,GAAG,CAACC,eAAI,GAAG,WAAW,CAAC,EAAE7D,IAAI,CAAC+D,OAAO,CAAC9B,SAAS,CAAC,EAAEjC,IAAI,CAAC4D,GAAG,CAAChB,YAAY,CAAC,CAAC,CAAC;UAAAM,QAAA,CAAAE,IAAA;UAAA,OAC3GY,iBAAK,CAACC,OAAO,CAACC,UAAU,CAACpB,GAAG,EAAEC,GAAG,CAAC;QAAA;UAAA,OAAAG,QAAA,CAAAiB,MAAA,WAEnCrC,UAAU;QAAA;QAAA;UAAA,OAAAoB,QAAA,CAAAkB,IAAA;MAAA;IAAA,GAAAzB,OAAA;EAAA,CAClB;EAAA,OAAAN,cAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA"}
|
package/lib/chat/message.js
CHANGED
|
@@ -117,7 +117,7 @@ function renderMessageRow(channelObject, message, fresh, options, userContext) {
|
|
|
117
117
|
var latestVersion = (0, _chatLogic.mostRecentVersion)(message);
|
|
118
118
|
var latestVersionCreator = _solidLogic.store.any(latestVersion, ns.foaf('maker'));
|
|
119
119
|
// use latest content if same owner, else use original
|
|
120
|
-
var msgId = creator === latestVersionCreator ? latestVersion : message;
|
|
120
|
+
var msgId = creator.uri === latestVersionCreator.uri ? latestVersion : message;
|
|
121
121
|
var content = _solidLogic.store.any(msgId, ns.sioc('content'));
|
|
122
122
|
var signature = _solidLogic.store.any(msgId, $rdf.sym("".concat(_signature.SEC, "Proof")));
|
|
123
123
|
debug.log('alain ' + (signature === null || signature === void 0 ? void 0 : signature.value));
|
|
@@ -128,9 +128,23 @@ function renderMessageRow(channelObject, message, fresh, options, userContext) {
|
|
|
128
128
|
msg.created = _solidLogic.store.any(msgId, ns.dct('created')).value;
|
|
129
129
|
msg.content = content.value;
|
|
130
130
|
msg.maker = creator.uri;
|
|
131
|
+
try {
|
|
132
|
+
var publicKey = function publicKey(webId) {
|
|
133
|
+
var pubKey;
|
|
134
|
+
(0, _keys.getPublicKey)(webId).then(function (publicKey) {
|
|
135
|
+
debug.log('alain publicKey ' + publicKey);
|
|
136
|
+
pubKey = publicKey;
|
|
137
|
+
});
|
|
138
|
+
return pubKey;
|
|
139
|
+
};
|
|
140
|
+
var pubKey = publicKey(creator.uri); // await getPublicKey(creator.uri)
|
|
141
|
+
debug.log('alain pubKey ' + pubKey);
|
|
142
|
+
debug.log(creator.uri);
|
|
143
|
+
} catch (err) {
|
|
144
|
+
debug.warn(err);
|
|
145
|
+
}
|
|
131
146
|
try {
|
|
132
147
|
// pubKey could be store in a cache for all makers
|
|
133
|
-
var pubKey = (0, _keys.getPublicKey)(creator.uri);
|
|
134
148
|
/* const pubKey0 = '023a9da707bee1302f66083c9d95673ff969b41607a66f52686fa774d64ceb87'
|
|
135
149
|
debug.warn('publicKeys\n' + pubKey0 + '\n' + pubKey)
|
|
136
150
|
const privKey0 = getPrivateKey(creator.uri) // alain to remove
|
package/lib/chat/message.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","names":["_infinite","require","_messageTools","_bookmarks","_chatLogic","debug","_interopRequireWildcard","_iconBase","_solidLogic","_login","_index","ns","pad","style","utils","widgets","_signature","_keys","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","i","F","s","n","done","value","e","_e","f","TypeError","normalCompletion","didErr","err","step","next","_e2","minLen","_arrayLikeToArray","toString","slice","constructor","name","from","test","arr","len","arr2","dom","window","document","messageBodyStyle","label","elementForImageURI","imageUri","options","img","createElement","height","inlineImageHeightEms","trim","setAttribute","anchor","appendChild","makeDraggable","$rdf","sym","text","term","a","uri","addEventListener","openHrefInOutlineMode","textContent","nick","person","store","any","foaf","creatorAndDate","td1","creator","date","message","nickAnchor","fetcher","nowOrWhenFetched","doc","undefined","_ok","_body","creatorAndDateHorizontal","dateBit","fontSize","marginLeft","renderMessageRow","channelObject","fresh","userContext","colorizeByAuthor","dct","latestVersion","mostRecentVersion","latestVersionCreator","msgId","content","sioc","signature","concat","SEC","log","msg","getBlankMsg","id","created","maker","pubKey","getPublicKey","verifySignature","Error","originalMessage","originalVersion","edited","sameTerm","sortDate","the","messageRow","AJAR_date","AJAR_subject","authorDateOnLeft","setImage","shortDate","bothDates","td2","isURI","para","isImage","expandImagesInline","anc","href","bgcolor","lightColorHash","getBgColor","strip","sentimentStripLinked","children","td3","toolsButton","button","icons","iconBase","_event","toolTR","parentNode","removeChild","toolsTR","tools","messageToolbar","nextSibling","parentElement","insertBefore","toolsTD","switchToEditor","messageTable","editRow","renderMessageEditor","originalRow","visibility","revertEditing","messageEditor","handleFieldInput","_x","_handleFieldInput","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee5","wrap","_callee5$","_context6","prev","sendMessage","field","stop","_x2","_x3","_sendMessage","_callee6","fromMainField","sendComplete","statusArea","_callee6$","_context7","_sendComplete","_text2","insertMessageIntoTable","oldRow","warn","backgroundColor","disabled","scrollIntoView","newestFirst","focus","select","updateMessage","sent","t0","errorMessageBlock","abrupt","droppedFileHandler","files","base","chatDocument","dir","uploadFiles","_ref","_callee","theFile","destURI","_callee$","_context2","_x4","_x5","droppedURIHandler","_ref2","_callee2","uris","_iterator","_step","_callee2$","_context3","finish","_x6","turnOnInput","getImageDoc","imageDoc","Date","now","tookPicture","_x7","_tookPicture","_callee4","_callee4$","_context5","menuButton","menuHandler","buttonStyle","rhs","me","authn","currentUser","menuOptions","div","newBase","event","chatChannel","lhs","middle","innerHTML","rows","anyValue","_ref3","_callee3","_callee3$","_context4","code","shiftKey","shiftEnterSendsMessage","_x8","makeDropTarget","sendButton","sendIcon","cancelButton","dateFolder","leafDocumentFromDate","media","cameraButton","recordParticipation","channel","context","ensureLoggedIn","then","assign","findBookmarkDocument","_context"],"sources":["../../src/chat/message.js"],"sourcesContent":["/** UI code for individual messages: display them, edit them\n *\n * @packageDocumentation\n */\n\n/* global $rdf */\nimport { insertMessageIntoTable } from './infinite'\nimport { messageToolbar, sentimentStripLinked } from './messageTools'\nimport { findBookmarkDocument } from './bookmarks'\nimport { mostRecentVersion, originalVersion } from './chatLogic'\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\nimport { store, authn } from 'solid-logic'\nimport { ensureLoggedIn } from '../login/login'\nimport { media } from '../media/index'\nimport * as ns from '../ns'\nimport * as pad from '../pad'\nimport * as style from '../style'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\nimport { getBlankMsg, verifySignature, SEC } from './signature'\nimport { getPrivateKey, getPublicKey } from './keys'\n\nconst dom = window.document\nconst messageBodyStyle = style.messageBodyStyle\n\nconst label = utils.label\n\n/**\n * HTML component for an image\n */\nexport function elementForImageURI (imageUri, options) {\n const img = dom.createElement('img')\n let height = '10'\n if (options.inlineImageHeightEms) {\n height = ('' + options.inlineImageHeightEms).trim()\n }\n img.setAttribute(\n 'style',\n 'max-height: ' + height + 'em; border-radius: 1em; margin: 0.7em;'\n )\n // widgets.makeDropTarget(img, handleURIsDroppedOnMugshot, droppedFileHandler)\n if (imageUri) img.setAttribute('src', imageUri)\n const anchor = dom.createElement('a')\n anchor.setAttribute('href', imageUri)\n anchor.setAttribute('target', 'images')\n anchor.appendChild(img)\n widgets.makeDraggable(img, $rdf.sym(imageUri))\n return anchor\n}\n\nconst anchor = function (text, term) {\n // If there is no link return an element anyway\n const a = dom.createElement('a')\n if (term && term.uri) {\n a.setAttribute('href', term.uri)\n a.addEventListener('click', widgets.openHrefInOutlineMode, true)\n a.setAttribute('style', 'color: #3B5998; text-decoration: none; ') // font-weight: bold\n }\n a.textContent = text\n return a\n}\n\nfunction nick (person) {\n const s = store.any(person, ns.foaf('nick'))\n if (s) return '' + s.value\n return '' + label(person)\n}\n\n/**\n * Displays creator and date for a chat message\n * inside the `td1` element\n */\nexport function creatorAndDate (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(nick(creator), creator))\n if (creator.uri) {\n store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nick(creator)\n })\n }\n td1.appendChild(dom.createElement('br'))\n td1.appendChild(anchor(date, message))\n}\n\n/**\n * Horizontally displays creator and date for a chat message\n * inside the `td1` element\n */\nexport function creatorAndDateHorizontal (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(label(creator), creator))\n if (creator.uri) {\n store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nick(creator)\n })\n }\n const dateBit = td1.appendChild(anchor(date, message))\n dateBit.style.fontSize = '80%'\n dateBit.style.marginLeft = '1em'\n td1.appendChild(dom.createElement('br'))\n}\n\n/**\n * Renders a chat message, read-only mode\n */\nexport function renderMessageRow (channelObject, message, fresh, options, userContext) {\n const colorizeByAuthor =\n options.colorizeByAuthor === '1' || options.colorizeByAuthor === true\n\n const creator = store.any(message, ns.foaf('maker'))\n const date = store.any(message, ns.dct('created'))\n const latestVersion = mostRecentVersion(message)\n const latestVersionCreator = store.any(latestVersion, ns.foaf('maker'))\n // use latest content if same owner, else use original\n const msgId = creator === latestVersionCreator ? latestVersion : message\n const content = store.any(msgId, ns.sioc('content'))\n const signature = store.any(msgId, $rdf.sym(`${SEC}Proof`))\n debug.log('alain ' + signature?.value)\n\n // verify signature\n const msg = getBlankMsg()\n msg.id = msgId.uri\n msg.created = store.any(msgId, ns.dct('created')).value\n msg.content = content.value\n msg.maker = creator.uri\n\n try {\n // pubKey could be store in a cache for all makers\n const pubKey = getPublicKey(creator.uri)\n /* const pubKey0 = '023a9da707bee1302f66083c9d95673ff969b41607a66f52686fa774d64ceb87'\n debug.warn('publicKeys\\n' + pubKey0 + '\\n' + pubKey)\n const privKey0 = getPrivateKey(creator.uri) // alain to remove\n // unsigned messages should be signaled as unsecured\n debug.warn(msg)\n debug.warn(signature?.value) */\n if (signature?.value && !verifySignature(signature.value, msg, pubKey)) throw new Error('invalid signature')\n } catch (err) {\n debug.log(err)\n }\n const originalMessage = originalVersion(message)\n const edited = !message.sameTerm(originalMessage)\n\n const sortDate = store.the(originalMessage, ns.dct('created'), null, originalMessage.doc()) // In message\n\n const messageRow = dom.createElement('tr')\n messageRow.AJAR_date = sortDate.value\n messageRow.AJAR_subject = message\n\n const td1 = dom.createElement('td')\n messageRow.appendChild(td1)\n if (!options.authorDateOnLeft) {\n const img = dom.createElement('img')\n img.setAttribute(\n 'style',\n 'max-height: 2.5em; max-width: 2.5em; border-radius: 0.5em; margin: auto;'\n )\n widgets.setImage(img, creator)\n td1.appendChild(img)\n } else {\n creatorAndDate(td1, creator, widgets.shortDate(sortDate.value), message)\n }\n let bothDates = widgets.shortDate(sortDate.value)\n if (edited) {\n bothDates += ' ... ' + widgets.shortDate(date.value)\n }\n\n // Render the content ot the message itself\n const td2 = messageRow.appendChild(dom.createElement('td'))\n\n if (!options.authorDateOnLeft) {\n creatorAndDateHorizontal(\n td2,\n creator,\n bothDates, // widgets.shortDate(dateString)\n message\n )\n }\n const text = content.value.trim()\n const isURI = /^https?:\\/[^ <>]*$/i.test(text)\n let para = null\n if (isURI) {\n const isImage = /\\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(text) // @@ Should use content-type not URI\n if (isImage && options.expandImagesInline) {\n const img = elementForImageURI(text, options)\n td2.appendChild(img)\n } else {\n // Link but not Image\n const anc = td2.appendChild(dom.createElement('a'))\n para = anc.appendChild(dom.createElement('p'))\n anc.href = text\n para.textContent = text\n td2.appendChild(anc)\n }\n } else {\n // text\n para = dom.createElement('p')\n td2.appendChild(para)\n para.textContent = text\n }\n if (para) {\n const bgcolor = colorizeByAuthor\n ? pad.lightColorHash(creator)\n : getBgColor(fresh)\n para.setAttribute(\n 'style',\n messageBodyStyle + 'background-color: ' + bgcolor + ';'\n )\n }\n\n function getBgColor (fresh) {\n return fresh ? '#e8ffe8' : 'white'\n }\n\n // Sentiment strip\n const strip = sentimentStripLinked(message, message.doc())\n if (strip.children.length) {\n td2.appendChild(dom.createElement('br'))\n td2.appendChild(strip)\n }\n\n // Message tool bar button\n const td3 = dom.createElement('td')\n messageRow.appendChild(td3)\n const toolsButton = widgets.button(\n dom,\n icons.iconBase + 'noun_243787.svg',\n '...'\n )\n td3.appendChild(toolsButton)\n toolsButton.addEventListener('click', function (_event) {\n if (messageRow.toolTR) {\n // already got a toolbar? Toogle\n messageRow.parentNode.removeChild(messageRow.toolTR)\n delete messageRow.toolTR\n return\n }\n const toolsTR = dom.createElement('tr')\n const tools = messageToolbar(message, messageRow, userContext, channelObject)\n tools.style =\n 'border: 0.05em solid #888; border-radius: 0 0 0.7em 0.7em; border-top: 0; height:3.5em; background-color: #fff;' // @@ fix\n if (messageRow.nextSibling) {\n messageRow.parentElement.insertBefore(toolsTR, messageRow.nextSibling)\n } else {\n messageRow.parentElement.appendChild(toolsTR)\n }\n messageRow.toolTR = toolsTR\n toolsTR.appendChild(dom.createElement('td')) // left\n const toolsTD = toolsTR.appendChild(dom.createElement('td'))\n toolsTR.appendChild(dom.createElement('td')) // right\n toolsTD.appendChild(tools)\n })\n return messageRow\n}\n\nexport function switchToEditor (messageRow, message, channelObject, userContext) {\n const messageTable = messageRow.parentNode\n const editRow = renderMessageEditor(channelObject, messageTable, userContext,\n channelObject.options, mostRecentVersion(message))\n messageTable.insertBefore(editRow, messageRow)\n editRow.originalRow = messageRow\n messageRow.style.visibility = 'hidden' // Hide the original message. unhide if user cancels edit\n}\n/* Control for a new message -- or editing an old message ***************\n *\n */\nexport function renderMessageEditor (channelObject, messageTable, userContext, options, originalMessage) {\n function revertEditing (messageEditor) {\n messageEditor.originalRow.style.visibility = 'visible' // restore read-only version\n messageEditor.parentNode.removeChild(messageEditor)\n }\n\n async function handleFieldInput (_event) {\n await sendMessage(field.value, true)\n }\n\n async function sendMessage (text, fromMainField) {\n function sendComplete (message, _text2) {\n // const dateStamp = store.any(message, ns.dct('created'), null, message.doc())\n // const content = $rdf.literal(text2)\n insertMessageIntoTable(channelObject, messageTable, message, false, options, userContext) // not green\n\n if (originalMessage) { // editing another message\n const oldRow = messageEditor.originalRow\n // oldRow.style.display = '' // restore read-only version, re-attack\n if (oldRow.parentNode) {\n oldRow.parentNode.removeChild(oldRow) // No longer needed old version\n } else {\n debug.warn('No parentNode on old message ' + oldRow.textContent)\n oldRow.style.backgroundColor = '#fee'\n oldRow.style.visibility = 'hidden' // @@ FIX THIS AND REMOVE FROM DOM INSTEAD\n }\n messageEditor.parentNode.removeChild(messageEditor) // no longer need editor\n } else {\n if (fromMainField) {\n field.value = '' // clear from out for reuse\n field.setAttribute('style', messageBodyStyle)\n field.disabled = false\n field.scrollIntoView(options.newestFirst) // allign bottom (top)\n field.focus() // Start typing next line immediately\n field.select()\n }\n }\n // await channelObject.div.refresh() // Add new day if nec @@ add back\n }\n\n // const me = authn.currentUser() // Must be logged on or wuld have got login button\n if (fromMainField) {\n field.setAttribute('style', messageBodyStyle + 'color: #bbb;') // pendingedit\n field.disabled = true\n }\n\n let message\n try {\n message = await channelObject.updateMessage(text, originalMessage)\n } catch (err) {\n const statusArea = userContext.statusArea || messageEditor\n statusArea.appendChild(\n widgets.errorMessageBlock(dom, 'Error writing message: ' + err)\n )\n return\n }\n sendComplete(message, text)\n } // sendMessage\n\n // DRAG AND DROP\n function droppedFileHandler (files) {\n const base = messageTable.chatDocument.dir().uri\n widgets.uploadFiles(\n store.fetcher,\n files,\n base + 'Files',\n base + 'Pictures',\n async function (theFile, destURI) {\n // @@@@@@ Wait for each if several\n await sendMessage(destURI)\n }\n )\n }\n\n // When a set of URIs are dropped on the field\n const droppedURIHandler = async function (uris) {\n for (const uri of uris) {\n await sendMessage(uri)\n }\n }\n\n // When we are actually logged on\n function turnOnInput () {\n function getImageDoc () {\n imageDoc = $rdf.sym(\n chatDocument.dir().uri + 'Image_' + Date.now() + '.png'\n )\n return imageDoc\n }\n\n async function tookPicture (imageDoc) {\n if (imageDoc) {\n await sendMessage(imageDoc.uri)\n }\n }\n\n // Body of turnOnInput\n\n let menuButton\n if (options.menuHandler) {\n const menuButton = widgets.button(\n dom, icons.iconBase + 'noun_243787.svg', 'More')\n menuButton.setAttribute('style', style.buttonStyle + 'float: right;')\n // menuButton.addEventListener('click', _event => sendMessage(), false) (done in turnoninput)\n rhs.appendChild(menuButton)\n }\n\n if (options.menuHandler && menuButton) {\n const me = authn.currentUser()\n const menuOptions = {\n me,\n dom,\n div: null, // @@ was: div\n newBase: messageTable.chatDocument.dir().uri\n }\n menuButton.addEventListener(\n 'click',\n event => {\n options.menuHandler(event, channelObject.chatChannel, menuOptions)\n },\n false\n )\n }\n\n const me = authn.currentUser() // If already logged on\n creatorAndDate(lhs, me, '', null)\n\n field = dom.createElement('textarea')\n middle.innerHTML = ''\n middle.appendChild(field)\n field.rows = 3\n if (originalMessage) {\n field.value = store.anyValue(originalMessage, ns.sioc('content'), null, originalMessage.doc())\n }\n // field.cols = 40\n field.setAttribute('style', messageBodyStyle + 'background-color: #eef;')\n\n // Trap the Enter BEFORE it is used ti make a newline\n\n field.addEventListener(\n 'keydown',\n async function (e) {\n // User preference?\n if (e.code === 'Enter') {\n // if (e.keyCode === 13) { // deprocated https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode\n if ((!e.shiftKey && !options.shiftEnterSendsMessage) || (e.shiftKey && options.shiftEnterSendsMessage)) {\n // Shift-Enter just adds a new line\n // (note alt-enter doesn't add newline anyway on my setup - so have to use shift.\n await handleFieldInput(e)\n }\n }\n },\n false\n )\n\n widgets.makeDropTarget(field, droppedURIHandler, droppedFileHandler)\n\n rhs.innerHTML = ''\n\n sendButton = widgets.button(dom, sendIcon, 'Send')\n sendButton.style.float = 'right'\n sendButton.addEventListener('click', _event => handleFieldInput(), false)\n rhs.appendChild(sendButton)\n\n if (originalMessage) { // Are we editing another message?\n const cancelButton = rhs.appendChild(widgets.cancelButton(dom))\n cancelButton.style.float = 'left'\n // cancelButton.firstChild.style.opacity = '0.3' // moved to buttons\n cancelButton.addEventListener('click', _event => revertEditing(messageEditor), false)\n rhs.appendChild(cancelButton)\n }\n\n const chatDocument = channelObject.dateFolder.leafDocumentFromDate(new Date())\n let imageDoc\n\n middle.appendChild(\n media.cameraButton(dom, store, getImageDoc, tookPicture)\n )\n\n pad.recordParticipation(channelObject.channel, channelObject.channel.doc()) // participation =\n } // turn on inpuut\n\n // Body of renderMessageEditor\n\n let sortDate, sendIcon\n if (originalMessage) {\n sortDate = store.anyValue(originalMessage, ns.dct('created'), null, originalMessage.doc())\n // text = store.anyValue(originalMessage, ns.sioc('content'), null, originalMessage.doc())\n sendIcon = icons.iconBase + 'noun_1180158.svg' // Green check\n // cancelIcon = icons.iconBase + 'noun_1180156.svg' // Black cross\n } else {\n sendIcon = icons.iconBase + 'noun_383448.svg'\n sortDate = '9999-01-01T00:00:00Z' // ISO format for field sort\n // text = ''\n }\n const messageEditor = dom.createElement('tr')\n const lhs = dom.createElement('td')\n const middle = dom.createElement('td')\n const rhs = dom.createElement('td')\n messageEditor.appendChild(lhs)\n messageEditor.appendChild(middle)\n messageEditor.appendChild(rhs)\n messageEditor.AJAR_date = sortDate\n // messageEditor.appendChild(dom.createElement('br'))\n\n let field, sendButton\n const context = { div: middle, dom }\n\n ensureLoggedIn(context).then(context => {\n // me = context.me\n turnOnInput()\n Object.assign(context, userContext)\n findBookmarkDocument(context).then(_context => {\n // console.log('Bookmark file: ' + context.bookmarkDocument)\n })\n })\n\n return messageEditor\n} // renderMessageEditor\n"],"mappings":";;;;;;;;;;;;;;;AAMA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,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QAAQ,EAAI;MAC7C;IAAA,CACD,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOrH,aAAa;AACtB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"message.js","names":["_infinite","require","_messageTools","_bookmarks","_chatLogic","debug","_interopRequireWildcard","_iconBase","_solidLogic","_login","_index","ns","pad","style","utils","widgets","_signature","_keys","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","i","F","s","n","done","value","e","_e","f","TypeError","normalCompletion","didErr","err","step","next","_e2","minLen","_arrayLikeToArray","toString","slice","constructor","name","from","test","arr","len","arr2","dom","window","document","messageBodyStyle","label","elementForImageURI","imageUri","options","img","createElement","height","inlineImageHeightEms","trim","setAttribute","anchor","appendChild","makeDraggable","$rdf","sym","text","term","a","uri","addEventListener","openHrefInOutlineMode","textContent","nick","person","store","any","foaf","creatorAndDate","td1","creator","date","message","nickAnchor","fetcher","nowOrWhenFetched","doc","undefined","_ok","_body","creatorAndDateHorizontal","dateBit","fontSize","marginLeft","renderMessageRow","channelObject","fresh","userContext","colorizeByAuthor","dct","latestVersion","mostRecentVersion","latestVersionCreator","msgId","content","sioc","signature","concat","SEC","log","msg","getBlankMsg","id","created","maker","publicKey","webId","pubKey","getPublicKey","then","warn","verifySignature","Error","originalMessage","originalVersion","edited","sameTerm","sortDate","the","messageRow","AJAR_date","AJAR_subject","authorDateOnLeft","setImage","shortDate","bothDates","td2","isURI","para","isImage","expandImagesInline","anc","href","bgcolor","lightColorHash","getBgColor","strip","sentimentStripLinked","children","td3","toolsButton","button","icons","iconBase","_event","toolTR","parentNode","removeChild","toolsTR","tools","messageToolbar","nextSibling","parentElement","insertBefore","toolsTD","switchToEditor","messageTable","editRow","renderMessageEditor","originalRow","visibility","revertEditing","messageEditor","handleFieldInput","_x","_handleFieldInput","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee5","wrap","_callee5$","_context6","prev","sendMessage","field","stop","_x2","_x3","_sendMessage","_callee6","fromMainField","sendComplete","statusArea","_callee6$","_context7","_sendComplete","_text2","insertMessageIntoTable","oldRow","backgroundColor","disabled","scrollIntoView","newestFirst","focus","select","updateMessage","sent","t0","errorMessageBlock","abrupt","droppedFileHandler","files","base","chatDocument","dir","uploadFiles","_ref","_callee","theFile","destURI","_callee$","_context2","_x4","_x5","droppedURIHandler","_ref2","_callee2","uris","_iterator","_step","_callee2$","_context3","finish","_x6","turnOnInput","getImageDoc","imageDoc","Date","now","tookPicture","_x7","_tookPicture","_callee4","_callee4$","_context5","menuButton","menuHandler","buttonStyle","rhs","me","authn","currentUser","menuOptions","div","newBase","event","chatChannel","lhs","middle","innerHTML","rows","anyValue","_ref3","_callee3","_callee3$","_context4","code","shiftKey","shiftEnterSendsMessage","_x8","makeDropTarget","sendButton","sendIcon","cancelButton","dateFolder","leafDocumentFromDate","media","cameraButton","recordParticipation","channel","context","ensureLoggedIn","assign","findBookmarkDocument","_context"],"sources":["../../src/chat/message.js"],"sourcesContent":["/** UI code for individual messages: display them, edit them\n *\n * @packageDocumentation\n */\n\n/* global $rdf */\nimport { insertMessageIntoTable } from './infinite'\nimport { messageToolbar, sentimentStripLinked } from './messageTools'\nimport { findBookmarkDocument } from './bookmarks'\nimport { mostRecentVersion, originalVersion } from './chatLogic'\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\nimport { store, authn } from 'solid-logic'\nimport { ensureLoggedIn } from '../login/login'\nimport { media } from '../media/index'\nimport * as ns from '../ns'\nimport * as pad from '../pad'\nimport * as style from '../style'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\nimport { getBlankMsg, verifySignature, SEC } from './signature'\nimport { getPrivateKey, getPublicKey } from './keys'\n\nconst dom = window.document\nconst messageBodyStyle = style.messageBodyStyle\n\nconst label = utils.label\n\n/**\n * HTML component for an image\n */\nexport function elementForImageURI (imageUri, options) {\n const img = dom.createElement('img')\n let height = '10'\n if (options.inlineImageHeightEms) {\n height = ('' + options.inlineImageHeightEms).trim()\n }\n img.setAttribute(\n 'style',\n 'max-height: ' + height + 'em; border-radius: 1em; margin: 0.7em;'\n )\n // widgets.makeDropTarget(img, handleURIsDroppedOnMugshot, droppedFileHandler)\n if (imageUri) img.setAttribute('src', imageUri)\n const anchor = dom.createElement('a')\n anchor.setAttribute('href', imageUri)\n anchor.setAttribute('target', 'images')\n anchor.appendChild(img)\n widgets.makeDraggable(img, $rdf.sym(imageUri))\n return anchor\n}\n\nconst anchor = function (text, term) {\n // If there is no link return an element anyway\n const a = dom.createElement('a')\n if (term && term.uri) {\n a.setAttribute('href', term.uri)\n a.addEventListener('click', widgets.openHrefInOutlineMode, true)\n a.setAttribute('style', 'color: #3B5998; text-decoration: none; ') // font-weight: bold\n }\n a.textContent = text\n return a\n}\n\nfunction nick (person) {\n const s = store.any(person, ns.foaf('nick'))\n if (s) return '' + s.value\n return '' + label(person)\n}\n\n/**\n * Displays creator and date for a chat message\n * inside the `td1` element\n */\nexport function creatorAndDate (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(nick(creator), creator))\n if (creator.uri) {\n store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nick(creator)\n })\n }\n td1.appendChild(dom.createElement('br'))\n td1.appendChild(anchor(date, message))\n}\n\n/**\n * Horizontally displays creator and date for a chat message\n * inside the `td1` element\n */\nexport function creatorAndDateHorizontal (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(label(creator), creator))\n if (creator.uri) {\n store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nick(creator)\n })\n }\n const dateBit = td1.appendChild(anchor(date, message))\n dateBit.style.fontSize = '80%'\n dateBit.style.marginLeft = '1em'\n td1.appendChild(dom.createElement('br'))\n}\n\n/**\n * Renders a chat message, read-only mode\n */\nexport function renderMessageRow (channelObject, message, fresh, options, userContext) {\n const colorizeByAuthor =\n options.colorizeByAuthor === '1' || options.colorizeByAuthor === true\n\n const creator = store.any(message, ns.foaf('maker'))\n const date = store.any(message, ns.dct('created'))\n const latestVersion = mostRecentVersion(message)\n const latestVersionCreator = store.any(latestVersion, ns.foaf('maker'))\n // use latest content if same owner, else use original\n const msgId = creator.uri === latestVersionCreator.uri ? latestVersion : message\n const content = store.any(msgId, ns.sioc('content'))\n const signature = store.any(msgId, $rdf.sym(`${SEC}Proof`))\n debug.log('alain ' + signature?.value)\n\n // verify signature\n const msg = getBlankMsg()\n msg.id = msgId.uri\n msg.created = store.any(msgId, ns.dct('created')).value\n msg.content = content.value\n msg.maker = creator.uri\n try {\n function publicKey (webId) {\n let pubKey\n getPublicKey(webId).then(publicKey => {\n debug.log('alain publicKey ' + publicKey)\n pubKey = publicKey\n })\n return pubKey\n }\n var pubKey = publicKey(creator.uri) // await getPublicKey(creator.uri)\n debug.log('alain pubKey ' + pubKey)\n debug.log(creator.uri)\n } catch (err) { debug.warn(err) }\n try {\n // pubKey could be store in a cache for all makers\n /* const pubKey0 = '023a9da707bee1302f66083c9d95673ff969b41607a66f52686fa774d64ceb87'\n debug.warn('publicKeys\\n' + pubKey0 + '\\n' + pubKey)\n const privKey0 = getPrivateKey(creator.uri) // alain to remove\n // unsigned messages should be signaled as unsecured\n debug.warn(msg)\n debug.warn(signature?.value) */\n if (signature?.value && !verifySignature(signature.value, msg, pubKey)) throw new Error('invalid signature')\n } catch (err) {\n debug.log(err)\n }\n const originalMessage = originalVersion(message)\n const edited = !message.sameTerm(originalMessage)\n\n const sortDate = store.the(originalMessage, ns.dct('created'), null, originalMessage.doc()) // In message\n\n const messageRow = dom.createElement('tr')\n messageRow.AJAR_date = sortDate.value\n messageRow.AJAR_subject = message\n\n const td1 = dom.createElement('td')\n messageRow.appendChild(td1)\n if (!options.authorDateOnLeft) {\n const img = dom.createElement('img')\n img.setAttribute(\n 'style',\n 'max-height: 2.5em; max-width: 2.5em; border-radius: 0.5em; margin: auto;'\n )\n widgets.setImage(img, creator)\n td1.appendChild(img)\n } else {\n creatorAndDate(td1, creator, widgets.shortDate(sortDate.value), message)\n }\n let bothDates = widgets.shortDate(sortDate.value)\n if (edited) {\n bothDates += ' ... ' + widgets.shortDate(date.value)\n }\n\n // Render the content ot the message itself\n const td2 = messageRow.appendChild(dom.createElement('td'))\n\n if (!options.authorDateOnLeft) {\n creatorAndDateHorizontal(\n td2,\n creator,\n bothDates, // widgets.shortDate(dateString)\n message\n )\n }\n const text = content.value.trim()\n const isURI = /^https?:\\/[^ <>]*$/i.test(text)\n let para = null\n if (isURI) {\n const isImage = /\\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(text) // @@ Should use content-type not URI\n if (isImage && options.expandImagesInline) {\n const img = elementForImageURI(text, options)\n td2.appendChild(img)\n } else {\n // Link but not Image\n const anc = td2.appendChild(dom.createElement('a'))\n para = anc.appendChild(dom.createElement('p'))\n anc.href = text\n para.textContent = text\n td2.appendChild(anc)\n }\n } else {\n // text\n para = dom.createElement('p')\n td2.appendChild(para)\n para.textContent = text\n }\n if (para) {\n const bgcolor = colorizeByAuthor\n ? pad.lightColorHash(creator)\n : getBgColor(fresh)\n para.setAttribute(\n 'style',\n messageBodyStyle + 'background-color: ' + bgcolor + ';'\n )\n }\n\n function getBgColor (fresh) {\n return fresh ? '#e8ffe8' : 'white'\n }\n\n // Sentiment strip\n const strip = sentimentStripLinked(message, message.doc())\n if (strip.children.length) {\n td2.appendChild(dom.createElement('br'))\n td2.appendChild(strip)\n }\n\n // Message tool bar button\n const td3 = dom.createElement('td')\n messageRow.appendChild(td3)\n const toolsButton = widgets.button(\n dom,\n icons.iconBase + 'noun_243787.svg',\n '...'\n )\n td3.appendChild(toolsButton)\n toolsButton.addEventListener('click', function (_event) {\n if (messageRow.toolTR) {\n // already got a toolbar? Toogle\n messageRow.parentNode.removeChild(messageRow.toolTR)\n delete messageRow.toolTR\n return\n }\n const toolsTR = dom.createElement('tr')\n const tools = messageToolbar(message, messageRow, userContext, channelObject)\n tools.style =\n 'border: 0.05em solid #888; border-radius: 0 0 0.7em 0.7em; border-top: 0; height:3.5em; background-color: #fff;' // @@ fix\n if (messageRow.nextSibling) {\n messageRow.parentElement.insertBefore(toolsTR, messageRow.nextSibling)\n } else {\n messageRow.parentElement.appendChild(toolsTR)\n }\n messageRow.toolTR = toolsTR\n toolsTR.appendChild(dom.createElement('td')) // left\n const toolsTD = toolsTR.appendChild(dom.createElement('td'))\n toolsTR.appendChild(dom.createElement('td')) // right\n toolsTD.appendChild(tools)\n })\n return messageRow\n}\n\nexport function switchToEditor (messageRow, message, channelObject, userContext) {\n const messageTable = messageRow.parentNode\n const editRow = renderMessageEditor(channelObject, messageTable, userContext,\n channelObject.options, mostRecentVersion(message))\n messageTable.insertBefore(editRow, messageRow)\n editRow.originalRow = messageRow\n messageRow.style.visibility = 'hidden' // Hide the original message. unhide if user cancels edit\n}\n/* Control for a new message -- or editing an old message ***************\n *\n */\nexport function renderMessageEditor (channelObject, messageTable, userContext, options, originalMessage) {\n function revertEditing (messageEditor) {\n messageEditor.originalRow.style.visibility = 'visible' // restore read-only version\n messageEditor.parentNode.removeChild(messageEditor)\n }\n\n async function handleFieldInput (_event) {\n await sendMessage(field.value, true)\n }\n\n async function sendMessage (text, fromMainField) {\n function sendComplete (message, _text2) {\n // const dateStamp = store.any(message, ns.dct('created'), null, message.doc())\n // const content = $rdf.literal(text2)\n insertMessageIntoTable(channelObject, messageTable, message, false, options, userContext) // not green\n\n if (originalMessage) { // editing another message\n const oldRow = messageEditor.originalRow\n // oldRow.style.display = '' // restore read-only version, re-attack\n if (oldRow.parentNode) {\n oldRow.parentNode.removeChild(oldRow) // No longer needed old version\n } else {\n debug.warn('No parentNode on old message ' + oldRow.textContent)\n oldRow.style.backgroundColor = '#fee'\n oldRow.style.visibility = 'hidden' // @@ FIX THIS AND REMOVE FROM DOM INSTEAD\n }\n messageEditor.parentNode.removeChild(messageEditor) // no longer need editor\n } else {\n if (fromMainField) {\n field.value = '' // clear from out for reuse\n field.setAttribute('style', messageBodyStyle)\n field.disabled = false\n field.scrollIntoView(options.newestFirst) // allign bottom (top)\n field.focus() // Start typing next line immediately\n field.select()\n }\n }\n // await channelObject.div.refresh() // Add new day if nec @@ add back\n }\n\n // const me = authn.currentUser() // Must be logged on or wuld have got login button\n if (fromMainField) {\n field.setAttribute('style', messageBodyStyle + 'color: #bbb;') // pendingedit\n field.disabled = true\n }\n\n let message\n try {\n message = await channelObject.updateMessage(text, originalMessage)\n } catch (err) {\n const statusArea = userContext.statusArea || messageEditor\n statusArea.appendChild(\n widgets.errorMessageBlock(dom, 'Error writing message: ' + err)\n )\n return\n }\n sendComplete(message, text)\n } // sendMessage\n\n // DRAG AND DROP\n function droppedFileHandler (files) {\n const base = messageTable.chatDocument.dir().uri\n widgets.uploadFiles(\n store.fetcher,\n files,\n base + 'Files',\n base + 'Pictures',\n async function (theFile, destURI) {\n // @@@@@@ Wait for each if several\n await sendMessage(destURI)\n }\n )\n }\n\n // When a set of URIs are dropped on the field\n const droppedURIHandler = async function (uris) {\n for (const uri of uris) {\n await sendMessage(uri)\n }\n }\n\n // When we are actually logged on\n function turnOnInput () {\n function getImageDoc () {\n imageDoc = $rdf.sym(\n chatDocument.dir().uri + 'Image_' + Date.now() + '.png'\n )\n return imageDoc\n }\n\n async function tookPicture (imageDoc) {\n if (imageDoc) {\n await sendMessage(imageDoc.uri)\n }\n }\n\n // Body of turnOnInput\n\n let menuButton\n if (options.menuHandler) {\n const menuButton = widgets.button(\n dom, icons.iconBase + 'noun_243787.svg', 'More')\n menuButton.setAttribute('style', style.buttonStyle + 'float: right;')\n // menuButton.addEventListener('click', _event => sendMessage(), false) (done in turnoninput)\n rhs.appendChild(menuButton)\n }\n\n if (options.menuHandler && menuButton) {\n const me = authn.currentUser()\n const menuOptions = {\n me,\n dom,\n div: null, // @@ was: div\n newBase: messageTable.chatDocument.dir().uri\n }\n menuButton.addEventListener(\n 'click',\n event => {\n options.menuHandler(event, channelObject.chatChannel, menuOptions)\n },\n false\n )\n }\n\n const me = authn.currentUser() // If already logged on\n creatorAndDate(lhs, me, '', null)\n\n field = dom.createElement('textarea')\n middle.innerHTML = ''\n middle.appendChild(field)\n field.rows = 3\n if (originalMessage) {\n field.value = store.anyValue(originalMessage, ns.sioc('content'), null, originalMessage.doc())\n }\n // field.cols = 40\n field.setAttribute('style', messageBodyStyle + 'background-color: #eef;')\n\n // Trap the Enter BEFORE it is used ti make a newline\n\n field.addEventListener(\n 'keydown',\n async function (e) {\n // User preference?\n if (e.code === 'Enter') {\n // if (e.keyCode === 13) { // deprocated https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode\n if ((!e.shiftKey && !options.shiftEnterSendsMessage) || (e.shiftKey && options.shiftEnterSendsMessage)) {\n // Shift-Enter just adds a new line\n // (note alt-enter doesn't add newline anyway on my setup - so have to use shift.\n await handleFieldInput(e)\n }\n }\n },\n false\n )\n\n widgets.makeDropTarget(field, droppedURIHandler, droppedFileHandler)\n\n rhs.innerHTML = ''\n\n sendButton = widgets.button(dom, sendIcon, 'Send')\n sendButton.style.float = 'right'\n sendButton.addEventListener('click', _event => handleFieldInput(), false)\n rhs.appendChild(sendButton)\n\n if (originalMessage) { // Are we editing another message?\n const cancelButton = rhs.appendChild(widgets.cancelButton(dom))\n cancelButton.style.float = 'left'\n // cancelButton.firstChild.style.opacity = '0.3' // moved to buttons\n cancelButton.addEventListener('click', _event => revertEditing(messageEditor), false)\n rhs.appendChild(cancelButton)\n }\n\n const chatDocument = channelObject.dateFolder.leafDocumentFromDate(new Date())\n let imageDoc\n\n middle.appendChild(\n media.cameraButton(dom, store, getImageDoc, tookPicture)\n )\n\n pad.recordParticipation(channelObject.channel, channelObject.channel.doc()) // participation =\n } // turn on inpuut\n\n // Body of renderMessageEditor\n\n let sortDate, sendIcon\n if (originalMessage) {\n sortDate = store.anyValue(originalMessage, ns.dct('created'), null, originalMessage.doc())\n // text = store.anyValue(originalMessage, ns.sioc('content'), null, originalMessage.doc())\n sendIcon = icons.iconBase + 'noun_1180158.svg' // Green check\n // cancelIcon = icons.iconBase + 'noun_1180156.svg' // Black cross\n } else {\n sendIcon = icons.iconBase + 'noun_383448.svg'\n sortDate = '9999-01-01T00:00:00Z' // ISO format for field sort\n // text = ''\n }\n const messageEditor = dom.createElement('tr')\n const lhs = dom.createElement('td')\n const middle = dom.createElement('td')\n const rhs = dom.createElement('td')\n messageEditor.appendChild(lhs)\n messageEditor.appendChild(middle)\n messageEditor.appendChild(rhs)\n messageEditor.AJAR_date = sortDate\n // messageEditor.appendChild(dom.createElement('br'))\n\n let field, sendButton\n const context = { div: middle, dom }\n\n ensureLoggedIn(context).then(context => {\n // me = context.me\n turnOnInput()\n Object.assign(context, userContext)\n findBookmarkDocument(context).then(_context => {\n // console.log('Bookmark file: ' + context.bookmarkDocument)\n })\n })\n\n return messageEditor\n} // renderMessageEditor\n"],"mappings":";;;;;;;;;;;;;;;AAMA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,EAAA,GAAAL,uBAAA,CAAAL,OAAA;AACA,IAAAW,GAAA,GAAAN,uBAAA,CAAAL,OAAA;AACA,IAAAY,KAAA,GAAAP,uBAAA,CAAAL,OAAA;AACA,IAAAa,KAAA,GAAAR,uBAAA,CAAAL,OAAA;AACA,IAAAc,OAAA,GAAAT,uBAAA,CAAAL,OAAA;AACA,IAAA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ACtC;IACA9C,WAAW,EAAE;IACb5O,MAAM,CAAC4R,MAAM,CAACF,OAAO,EAAE1L,WAAW,CAAC;IACnC,IAAA6L,+BAAoB,EAACH,OAAO,CAAC,CAACpK,IAAI,CAAC,UAAAwK,QAAQ,EAAI;MAC7C;IAAA,CACD,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOnH,aAAa;AACtB,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const pubKeyUrl: (webId: string) => string;
|
|
2
|
+
export declare function publicKeyExists(webId: string): Promise<string | undefined>;
|
|
3
|
+
export declare const privKeyUrl: (webId: string) => string;
|
|
4
|
+
export declare function privateKeyExists(webId: string): Promise<string | undefined>;
|
|
5
|
+
//# sourceMappingURL=cryptoKeyHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cryptoKeyHelpers.d.ts","sourceRoot":"","sources":["../../src/utils/cryptoKeyHelpers.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,UAAW,MAAM,WAItC,CAAA;AAED,wBAAsB,eAAe,CAAE,KAAK,EAAE,MAAM,+BAUnD;AAED,eAAO,MAAM,UAAU,UAAW,MAAM,WAIvC,CAAA;AAED,wBAAsB,gBAAgB,CAAE,KAAK,EAAE,MAAM,+BAgCpD"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.privKeyUrl = void 0;
|
|
9
|
+
exports.privateKeyExists = privateKeyExists;
|
|
10
|
+
exports.pubKeyUrl = void 0;
|
|
11
|
+
exports.publicKeyExists = publicKeyExists;
|
|
12
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
|
+
var debug = _interopRequireWildcard(require("../debug"));
|
|
15
|
+
var _signature = require("../chat/signature");
|
|
16
|
+
var _solidLogic = require("solid-logic");
|
|
17
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
var pubKeyUrl = function pubKeyUrl(webId) {
|
|
20
|
+
var url = new URL(webId);
|
|
21
|
+
var publicKeyUrl = url.origin + '/profile/keys/publicKey.ttl';
|
|
22
|
+
return publicKeyUrl;
|
|
23
|
+
};
|
|
24
|
+
exports.pubKeyUrl = pubKeyUrl;
|
|
25
|
+
function publicKeyExists(_x) {
|
|
26
|
+
return _publicKeyExists.apply(this, arguments);
|
|
27
|
+
}
|
|
28
|
+
function _publicKeyExists() {
|
|
29
|
+
_publicKeyExists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(webId) {
|
|
30
|
+
var publicKey;
|
|
31
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
32
|
+
while (1) switch (_context.prev = _context.next) {
|
|
33
|
+
case 0:
|
|
34
|
+
_context.next = 2;
|
|
35
|
+
return _solidLogic.store.fetcher.load(pubKeyUrl(webId));
|
|
36
|
+
case 2:
|
|
37
|
+
// url.href)
|
|
38
|
+
publicKey = _solidLogic.store.any(_solidLogic.store.sym(webId), _solidLogic.store.sym(_signature.CERT + 'PublicKey'));
|
|
39
|
+
return _context.abrupt("return", publicKey === null || publicKey === void 0 ? void 0 : publicKey.value);
|
|
40
|
+
case 4:
|
|
41
|
+
case "end":
|
|
42
|
+
return _context.stop();
|
|
43
|
+
}
|
|
44
|
+
}, _callee);
|
|
45
|
+
}));
|
|
46
|
+
return _publicKeyExists.apply(this, arguments);
|
|
47
|
+
}
|
|
48
|
+
var privKeyUrl = function privKeyUrl(webId) {
|
|
49
|
+
var url = new URL(webId);
|
|
50
|
+
var privateKeyUrl = url.origin + '/profile/keys/privateKey.ttl';
|
|
51
|
+
return privateKeyUrl;
|
|
52
|
+
};
|
|
53
|
+
exports.privKeyUrl = privKeyUrl;
|
|
54
|
+
function privateKeyExists(_x2) {
|
|
55
|
+
return _privateKeyExists.apply(this, arguments);
|
|
56
|
+
}
|
|
57
|
+
function _privateKeyExists() {
|
|
58
|
+
_privateKeyExists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(webId) {
|
|
59
|
+
var privateKeyUrl, privateKey, _err$response, data, contentType, response;
|
|
60
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
61
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
62
|
+
case 0:
|
|
63
|
+
/* const url = new URL(webId)
|
|
64
|
+
const privateKeyUrl = url.protocol + '//' + url.host + '/profile/privateKey.ttl' */
|
|
65
|
+
privateKeyUrl = privKeyUrl(webId);
|
|
66
|
+
/* debug.warn('Alain privateKeyExists')
|
|
67
|
+
debug.warn(webId)
|
|
68
|
+
debug.warn(privateKeyUrl) */
|
|
69
|
+
_context2.prev = 1;
|
|
70
|
+
_context2.next = 4;
|
|
71
|
+
return _solidLogic.store.fetcher.load(privateKeyUrl);
|
|
72
|
+
case 4:
|
|
73
|
+
privateKey = _solidLogic.store.any(_solidLogic.store.sym(webId), _solidLogic.store.sym(_signature.CERT + 'PrivateKey'));
|
|
74
|
+
return _context2.abrupt("return", privateKey === null || privateKey === void 0 ? void 0 : privateKey.value);
|
|
75
|
+
case 8:
|
|
76
|
+
_context2.prev = 8;
|
|
77
|
+
_context2.t0 = _context2["catch"](1);
|
|
78
|
+
if (!((_context2.t0 === null || _context2.t0 === void 0 ? void 0 : (_err$response = _context2.t0.response) === null || _err$response === void 0 ? void 0 : _err$response.status) === 404)) {
|
|
79
|
+
_context2.next = 25;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
_context2.prev = 11;
|
|
83
|
+
// create privateKey resource
|
|
84
|
+
data = '';
|
|
85
|
+
contentType = 'text/ttl';
|
|
86
|
+
_context2.next = 16;
|
|
87
|
+
return _solidLogic.store.fetcher.webOperation('PUT', privateKeyUrl, {
|
|
88
|
+
data: data,
|
|
89
|
+
contentType: contentType
|
|
90
|
+
});
|
|
91
|
+
case 16:
|
|
92
|
+
response = _context2.sent;
|
|
93
|
+
_context2.next = 23;
|
|
94
|
+
break;
|
|
95
|
+
case 19:
|
|
96
|
+
_context2.prev = 19;
|
|
97
|
+
_context2.t1 = _context2["catch"](11);
|
|
98
|
+
debug.log('createIfNotExists doc FAILED: ' + privateKeyUrl + ': ' + _context2.t1);
|
|
99
|
+
throw _context2.t1;
|
|
100
|
+
case 23:
|
|
101
|
+
delete _solidLogic.store.fetcher.requested[privateKeyUrl]; // delete cached 404 error
|
|
102
|
+
return _context2.abrupt("return", undefined);
|
|
103
|
+
case 25:
|
|
104
|
+
debug.log('createIfNotExists doc FAILED: ' + privateKeyUrl + ': ' + _context2.t0);
|
|
105
|
+
throw _context2.t0;
|
|
106
|
+
case 27:
|
|
107
|
+
case "end":
|
|
108
|
+
return _context2.stop();
|
|
109
|
+
}
|
|
110
|
+
}, _callee2, null, [[1, 8], [11, 19]]);
|
|
111
|
+
}));
|
|
112
|
+
return _privateKeyExists.apply(this, arguments);
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=cryptoKeyHelpers.js.map
|