solid-ui 2.4.27-38005bd7 → 2.4.27-3f1ead6b

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.
@@ -18,10 +18,8 @@ export type Message = UnsignedMsg & {
18
18
  sig: string;
19
19
  };
20
20
  export declare function getBlankMsg(): MsgTemplate;
21
- export declare function finishMsg(t: MsgTemplate, privateKey: string): Message;
22
21
  export declare function serializeMsg(msg: UnsignedMsg): string;
23
22
  export declare function getMsgHash(message: UnsignedMsg): string;
24
- export declare function validateMsg<T>(message: T): message is T & UnsignedMsg;
25
23
  export declare function verifySignature(sig: string, message: Message, pubKey: string): boolean;
26
24
  export declare function signMsg(message: UnsignedMsg, key: string): string;
27
25
  //# sourceMappingURL=signature.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src/chat/signature.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,aAA2B,CAAA;AACnD,eAAO,MAAM,WAAW,aAAoB,CAAA;AAE5C,eAAO,MAAM,GAAG,+BAA+B,CAAA;AAC/C,eAAO,MAAM,IAAI,oCAAoC,CAAA;AA2BrD,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG;IACtC,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,wBAAgB,WAAW,IAAK,WAAW,CAS1C;AAED,wBAAgB,SAAS,CAAE,CAAC,EAAE,WAAW,EAAE,UAAU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AG/C;AAwBD,wBAAgB,eAAe,CAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAMvF;AAED,wBAAgB,OAAO,CAAE,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAIlE"}
@@ -4,13 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.SEC = exports.CERT = void 0;
7
- exports.finishMsg = finishMsg;
8
7
  exports.getBlankMsg = getBlankMsg;
9
8
  exports.getMsgHash = getMsgHash;
10
9
  exports.serializeMsg = serializeMsg;
11
10
  exports.signMsg = signMsg;
12
11
  exports.utf8Encoder = exports.utf8Decoder = void 0;
13
- exports.validateMsg = validateMsg;
14
12
  exports.verifySignature = verifySignature;
15
13
  var _secp256k = require("@noble/curves/secp256k1");
16
14
  var _utils = require("@noble/hashes/utils");
@@ -56,19 +54,22 @@ function getBlankMsg() {
56
54
  id: '',
57
55
  created: '',
58
56
  dateDeleted: '',
57
+ // TODO to remove if not used
59
58
  content: '',
60
59
  maker: '',
61
- sig: ''
60
+ sig: '' // TODO to remove if not used
62
61
  };
63
62
  }
64
- function finishMsg(t, privateKey) {
65
- // to update to chat message triples
66
- var message = t;
67
- // message.pubkey = getPublicKey(privateKey)
68
- message.id = getMsgHash(message);
69
- message.sig = signMsg(message, privateKey);
70
- return message;
71
- }
63
+
64
+ /* export function finishMsg (t: MsgTemplate, privateKey: string): Message {
65
+ // to update to chat message triples
66
+ const message = t as Message
67
+ // message.pubkey = getPublicKey(privateKey)
68
+ message.id = getMsgHash(message)
69
+ message.sig = signMsg(message, privateKey)
70
+ return message
71
+ } */
72
+
72
73
  function serializeMsg(msg) {
73
74
  // to update to chat messages triples
74
75
  /* if (!validateMsg(msg))
@@ -80,27 +81,29 @@ function getMsgHash(message) {
80
81
  var msgHash = (0, _sha.sha256)(utf8Encoder.encode(serializeMsg(message)));
81
82
  return (0, _utils.bytesToHex)(msgHash);
82
83
  }
83
- var isRecord = function isRecord(obj) {
84
- return obj instanceof Object;
85
- };
86
- function validateMsg(message) {
87
- /* if (!isRecord(message)) return false
84
+
85
+ // const isRecord = (obj: unknown): obj is Record<string, unknown> => obj instanceof Object
86
+
87
+ /* export function validateMsg<T> (message: T): message is T & UnsignedMsg {
88
+ if (!isRecord(message)) return false
88
89
  if (typeof message.kind !== 'number') return false
89
90
  if (typeof message.content !== 'string') return false
90
91
  if (typeof message.created_at !== 'number') return false
91
92
  if (typeof message.pubkey !== 'string') return false
92
93
  if (!message.pubkey.match(/^[a-f0-9]{64}$/)) return false
93
- if (!Array.isArray(message.tags)) return false
94
+
95
+ if (!Array.isArray(message.tags)) return false
94
96
  for (let i = 0; i < message.tags.length; i++) {
95
97
  let tag = message.tags[i]
96
98
  if (!Array.isArray(tag)) return false
97
99
  for (let j = 0; j < tag.length; j++) {
98
100
  if (typeof tag[j] === 'object') return false
99
101
  }
100
- } */
102
+ }
103
+
104
+ return true
105
+ } */
101
106
 
102
- return true;
103
- }
104
107
  function verifySignature(sig, message, pubKey) {
105
108
  return _secp256k.schnorr.verify(sig, getMsgHash(message), pubKey);
106
109
  }
@@ -1 +1 @@
1
- {"version":3,"file":"signature.js","names":["_secp256k","require","_utils","_sha","utf8Decoder","TextDecoder","exports","utf8Encoder","TextEncoder","SEC","CERT","getBlankMsg","id","created","dateDeleted","content","maker","sig","finishMsg","t","privateKey","message","getMsgHash","signMsg","serializeMsg","msg","JSON","stringify","msgHash","sha256","encode","bytesToHex","isRecord","obj","Object","validateMsg","verifySignature","pubKey","schnorr","verify","key","sign"],"sources":["../../src/chat/signature.ts"],"sourcesContent":["import { schnorr } from '@noble/curves/secp256k1'\r\nimport { bytesToHex } from '@noble/hashes/utils'\r\nimport { sha256 } from '@noble/hashes/sha256'\r\n\r\n// import {utf8Encoder} from './utils'\r\n// import { getPublicKey } from './keys'\r\n\r\nexport const utf8Decoder = new TextDecoder('utf-8')\r\nexport const utf8Encoder = new TextEncoder()\r\n\r\nexport const SEC = 'https://w3id.org/security#' // Proof, VerificationMethod\r\nexport const CERT = 'http://www.w3.org/ns/auth/cert#' // PrivateKey, PublicKey\r\n\r\n/* eslint-disable no-unused-vars */\r\n/* export enum Kind {\r\n Metadata = 0,\r\n Text = 1,\r\n RecommendRelay = 2,\r\n Contacts = 3,\r\n EncryptedDirectMessage = 4,\r\n EventDeletion = 5,\r\n Reaction = 7,\r\n BadgeAward = 8,\r\n ChannelCreation = 40,\r\n ChannelMetadata = 41,\r\n ChannelMessage = 42,\r\n ChannelHideMessage = 43,\r\n ChannelMuteUser = 44,\r\n Report = 1984,\r\n ZapRequest = 9734,\r\n Zap = 9735,\r\n RelayList = 10002,\r\n ClientAuth = 22242,\r\n BadgeDefinition = 30008,\r\n ProfileBadge = 30009,\r\n Article = 30023\r\n} */\r\n\r\nexport type MsgTemplate = {\r\n id: string\r\n created: string\r\n dateDeleted: string\r\n content: string\r\n maker: string\r\n sig: string\r\n}\r\n\r\nexport type UnsignedMsg = MsgTemplate & {\r\n pubkey: string\r\n}\r\n\r\nexport type Message = UnsignedMsg & {\r\n id: string\r\n sig: string\r\n}\r\n\r\nexport function getBlankMsg (): MsgTemplate {\r\n return {\r\n id: '',\r\n created: '',\r\n dateDeleted: '',\r\n content: '',\r\n maker: '',\r\n sig: ''\r\n }\r\n}\r\n\r\nexport function finishMsg (t: MsgTemplate, privateKey: string): Message {\r\n // to update to chat message triples\r\n const message = t as Message\r\n // message.pubkey = getPublicKey(privateKey)\r\n message.id = getMsgHash(message)\r\n message.sig = signMsg(message, privateKey)\r\n return message\r\n}\r\n\r\nexport function serializeMsg (msg: UnsignedMsg): string {\r\n // to update to chat messages triples\r\n /* if (!validateMsg(msg))\r\n throw new Error(\"can't serialize message with wrong or missing properties\") */\r\n\r\n return JSON.stringify(msg)\r\n}\r\n\r\nexport function getMsgHash (message: UnsignedMsg) {\r\n const msgHash = sha256(utf8Encoder.encode(serializeMsg(message)))\r\n return bytesToHex(msgHash)\r\n}\r\n\r\nconst isRecord = (obj: unknown): obj is Record<string, unknown> => obj instanceof Object\r\n\r\nexport function validateMsg<T> (message: T): message is T & UnsignedMsg {\r\n /* if (!isRecord(message)) return false\r\n if (typeof message.kind !== 'number') return false\r\n if (typeof message.content !== 'string') return false\r\n if (typeof message.created_at !== 'number') return false\r\n if (typeof message.pubkey !== 'string') return false\r\n if (!message.pubkey.match(/^[a-f0-9]{64}$/)) return false\r\n\r\n if (!Array.isArray(message.tags)) return false\r\n for (let i = 0; i < message.tags.length; i++) {\r\n let tag = message.tags[i]\r\n if (!Array.isArray(tag)) return false\r\n for (let j = 0; j < tag.length; j++) {\r\n if (typeof tag[j] === 'object') return false\r\n }\r\n } */\r\n\r\n return true\r\n}\r\n\r\nexport function verifySignature (sig: string, message: Message, pubKey: string): boolean {\r\n return schnorr.verify(\r\n sig,\r\n getMsgHash(message),\r\n pubKey\r\n )\r\n}\r\n\r\nexport function signMsg (message: UnsignedMsg, key: string): string {\r\n return bytesToHex(\r\n schnorr.sign(getMsgHash(message), key)\r\n )\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AAEA;AACA;;AAEO,IAAMG,WAAW,GAAG,IAAIC,WAAW,CAAC,OAAO,CAAC;AAAAC,OAAA,CAAAF,WAAA,GAAAA,WAAA;AAC5C,IAAMG,WAAW,GAAG,IAAIC,WAAW,EAAE;AAAAF,OAAA,CAAAC,WAAA,GAAAA,WAAA;AAErC,IAAME,GAAG,GAAG,4BAA4B,EAAC;AAAAH,OAAA,CAAAG,GAAA,GAAAA,GAAA;AACzC,IAAMC,IAAI,GAAG,iCAAiC,EAAC;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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AAEmB,GAAW,EAAU;EAClE,OAAO,IAAAT,iBAAU,EACfO,iBAAO,CAACG,IAAI,CAACnB,UAAU,CAACD,OAAO,CAAC,EAAEmB,GAAG,CAAC,CACvC;AACH"}
1
+ {"version":3,"file":"signature.js","names":["_secp256k","require","_utils","_sha","utf8Decoder","TextDecoder","exports","utf8Encoder","TextEncoder","SEC","CERT","getBlankMsg","id","created","dateDeleted","content","maker","sig","serializeMsg","msg","JSON","stringify","getMsgHash","message","msgHash","sha256","encode","bytesToHex","verifySignature","pubKey","schnorr","verify","signMsg","key","sign"],"sources":["../../src/chat/signature.ts"],"sourcesContent":["import { schnorr } from '@noble/curves/secp256k1'\r\nimport { bytesToHex } from '@noble/hashes/utils'\r\nimport { sha256 } from '@noble/hashes/sha256'\r\n\r\n// import {utf8Encoder} from './utils'\r\n// import { getPublicKey } from './keys'\r\n\r\nexport const utf8Decoder = new TextDecoder('utf-8')\r\nexport const utf8Encoder = new TextEncoder()\r\n\r\nexport const SEC = 'https://w3id.org/security#' // Proof, VerificationMethod\r\nexport const CERT = 'http://www.w3.org/ns/auth/cert#' // PrivateKey, PublicKey\r\n\r\n/* eslint-disable no-unused-vars */\r\n/* export enum Kind {\r\n Metadata = 0,\r\n Text = 1,\r\n RecommendRelay = 2,\r\n Contacts = 3,\r\n EncryptedDirectMessage = 4,\r\n EventDeletion = 5,\r\n Reaction = 7,\r\n BadgeAward = 8,\r\n ChannelCreation = 40,\r\n ChannelMetadata = 41,\r\n ChannelMessage = 42,\r\n ChannelHideMessage = 43,\r\n ChannelMuteUser = 44,\r\n Report = 1984,\r\n ZapRequest = 9734,\r\n Zap = 9735,\r\n RelayList = 10002,\r\n ClientAuth = 22242,\r\n BadgeDefinition = 30008,\r\n ProfileBadge = 30009,\r\n Article = 30023\r\n} */\r\n\r\nexport type MsgTemplate = {\r\n id: string\r\n created: string\r\n dateDeleted: string\r\n content: string\r\n maker: string\r\n sig: string\r\n}\r\n\r\nexport type UnsignedMsg = MsgTemplate & {\r\n pubkey: string\r\n}\r\n\r\nexport type Message = UnsignedMsg & {\r\n id: string\r\n sig: string\r\n}\r\n\r\nexport function getBlankMsg (): MsgTemplate {\r\n return {\r\n id: '',\r\n created: '',\r\n dateDeleted: '', // TODO to remove if not used\r\n content: '',\r\n maker: '',\r\n sig: '' // TODO to remove if not used\r\n }\r\n}\r\n\r\n/* export function finishMsg (t: MsgTemplate, privateKey: string): Message {\r\n // to update to chat message triples\r\n const message = t as Message\r\n // message.pubkey = getPublicKey(privateKey)\r\n message.id = getMsgHash(message)\r\n message.sig = signMsg(message, privateKey)\r\n return message\r\n} */\r\n\r\nexport function serializeMsg (msg: UnsignedMsg): string {\r\n // to update to chat messages triples\r\n /* if (!validateMsg(msg))\r\n throw new Error(\"can't serialize message with wrong or missing properties\") */\r\n\r\n return JSON.stringify(msg)\r\n}\r\n\r\nexport function getMsgHash (message: UnsignedMsg) {\r\n const msgHash = sha256(utf8Encoder.encode(serializeMsg(message)))\r\n return bytesToHex(msgHash)\r\n}\r\n\r\n// const isRecord = (obj: unknown): obj is Record<string, unknown> => obj instanceof Object\r\n\r\n/* export function validateMsg<T> (message: T): message is T & UnsignedMsg {\r\n if (!isRecord(message)) return false\r\n if (typeof message.kind !== 'number') return false\r\n if (typeof message.content !== 'string') return false\r\n if (typeof message.created_at !== 'number') return false\r\n if (typeof message.pubkey !== 'string') return false\r\n if (!message.pubkey.match(/^[a-f0-9]{64}$/)) return false\r\n\r\n if (!Array.isArray(message.tags)) return false\r\n for (let i = 0; i < message.tags.length; i++) {\r\n let tag = message.tags[i]\r\n if (!Array.isArray(tag)) return false\r\n for (let j = 0; j < tag.length; j++) {\r\n if (typeof tag[j] === 'object') return false\r\n }\r\n }\r\n\r\n return true\r\n} */\r\n\r\nexport function verifySignature (sig: string, message: Message, pubKey: string): boolean {\r\n return schnorr.verify(\r\n sig,\r\n getMsgHash(message),\r\n pubKey\r\n )\r\n}\r\n\r\nexport function signMsg (message: UnsignedMsg, key: string): string {\r\n return b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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,SAASI,eAAeA,CAAEX,GAAW,EAAEM,OAAgB,EAAEM,MAAc,EAAW;EACvF,OAAOC,iBAAO,CAACC,MAAM,CACnBd,GAAG,EACHK,UAAU,CAACC,OAAO,CAAC,EACnBM,MAAM,CACP;AACH;AAEO,SAASG,OAAOA,CAAET,OAAoB,EAAEU,GAAW,EAAU;EAClE,OAAO,IAAAN,iBAAU,EACfG,iBAAO,CAACI,IAAI,CAACZ,UAAU,CAACC,OAAO,CAAC,EAAEU,GAAG,CAAC,CACvC;AACH"}
@@ -0,0 +1,10 @@
1
+ import { NamedNode } from 'rdflib';
2
+ export declare const getPodRoot: (webId: NamedNode) => Promise<string | undefined>;
3
+ export declare const pubKeyUrl: (webId: NamedNode) => Promise<string>;
4
+ export declare function getExistingPublicKey(webId: NamedNode, publicKeyUrl: string): Promise<string | undefined>;
5
+ export declare const privKeyUrl: (webId: NamedNode) => Promise<string>;
6
+ export declare function getExistingPrivateKey(webId: NamedNode, privateKeyUrl: string): Promise<string | undefined>;
7
+ type KeyType = 'PublicKey' | 'PrivateKey';
8
+ export declare function getKeyIfExists(webId: NamedNode, keyUrl: string, keyType: KeyType): Promise<string | undefined>;
9
+ export {};
10
+ //# sourceMappingURL=accessData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessData.d.ts","sourceRoot":"","sources":["../../../src/utils/keyHelpers/accessData.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,eAAO,MAAM,UAAU,UAAiB,SAAS,gCAsBhD,CAAA;AAED,eAAO,MAAM,SAAS,UAAiB,SAAS,oBAI/C,CAAA;AAED,wBAAsB,oBAAoB,CAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,+BAGjF;AAED,eAAO,MAAM,UAAU,UAAiB,SAAS,oBAIhD,CAAA;AAED,wBAAsB,qBAAqB,CAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,+BAGnF;AAED,KAAK,OAAO,GAAG,WAAW,GAAG,YAAY,CAAA;AAEzC,wBAAsB,cAAc,CAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,+BAyBvF"}
@@ -5,16 +5,16 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.privKeyUrl = void 0;
9
- exports.privateKeyExists = privateKeyExists;
10
- exports.pubKeyUrl = void 0;
11
- exports.publicKeyExists = publicKeyExists;
8
+ exports.getExistingPrivateKey = getExistingPrivateKey;
9
+ exports.getExistingPublicKey = getExistingPublicKey;
10
+ exports.getKeyIfExists = getKeyIfExists;
11
+ exports.pubKeyUrl = exports.privKeyUrl = exports.getPodRoot = void 0;
12
12
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
13
13
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
14
- var debug = _interopRequireWildcard(require("../debug"));
15
- var _signature = require("../chat/signature");
14
+ var debug = _interopRequireWildcard(require("../../debug"));
15
+ var _signature = require("../../chat/signature");
16
16
  var _solidLogic = require("solid-logic");
17
- var ns = _interopRequireWildcard(require("../ns"));
17
+ var ns = _interopRequireWildcard(require("../../ns"));
18
18
  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); }
19
19
  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; }
20
20
  var getPodRoot = /*#__PURE__*/function () {
@@ -76,6 +76,7 @@ var getPodRoot = /*#__PURE__*/function () {
76
76
  return _ref.apply(this, arguments);
77
77
  };
78
78
  }();
79
+ exports.getPodRoot = getPodRoot;
79
80
  var pubKeyUrl = /*#__PURE__*/function () {
80
81
  var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(webId) {
81
82
  return _regenerator["default"].wrap(function _callee2$(_context2) {
@@ -102,30 +103,25 @@ var pubKeyUrl = /*#__PURE__*/function () {
102
103
  };
103
104
  }();
104
105
  exports.pubKeyUrl = pubKeyUrl;
105
- function publicKeyExists(_x3) {
106
- return _publicKeyExists.apply(this, arguments);
106
+ function getExistingPublicKey(_x3, _x4) {
107
+ return _getExistingPublicKey.apply(this, arguments);
107
108
  }
108
- function _publicKeyExists() {
109
- _publicKeyExists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(webId) {
110
- var publicKeyUrl;
109
+ function _getExistingPublicKey() {
110
+ _getExistingPublicKey = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(webId, publicKeyUrl) {
111
111
  return _regenerator["default"].wrap(function _callee4$(_context4) {
112
112
  while (1) switch (_context4.prev = _context4.next) {
113
113
  case 0:
114
114
  _context4.next = 2;
115
- return pubKeyUrl(webId);
115
+ return getKeyIfExists(webId, publicKeyUrl, 'PublicKey');
116
116
  case 2:
117
- publicKeyUrl = _context4.sent;
118
- _context4.next = 5;
119
- return keyExists(webId, publicKeyUrl, 'PublicKey');
120
- case 5:
121
117
  return _context4.abrupt("return", _context4.sent);
122
- case 6:
118
+ case 3:
123
119
  case "end":
124
120
  return _context4.stop();
125
121
  }
126
122
  }, _callee4);
127
123
  }));
128
- return _publicKeyExists.apply(this, arguments);
124
+ return _getExistingPublicKey.apply(this, arguments);
129
125
  }
130
126
  var privKeyUrl = /*#__PURE__*/function () {
131
127
  var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(webId) {
@@ -148,41 +144,36 @@ var privKeyUrl = /*#__PURE__*/function () {
148
144
  }
149
145
  }, _callee3, null, [[0, 7]]);
150
146
  }));
151
- return function privKeyUrl(_x4) {
147
+ return function privKeyUrl(_x5) {
152
148
  return _ref3.apply(this, arguments);
153
149
  };
154
150
  }();
155
151
  exports.privKeyUrl = privKeyUrl;
156
- function privateKeyExists(_x5) {
157
- return _privateKeyExists.apply(this, arguments);
152
+ function getExistingPrivateKey(_x6, _x7) {
153
+ return _getExistingPrivateKey.apply(this, arguments);
158
154
  }
159
- function _privateKeyExists() {
160
- _privateKeyExists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(webId) {
161
- var privateKeyUrl;
155
+ function _getExistingPrivateKey() {
156
+ _getExistingPrivateKey = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(webId, privateKeyUrl) {
162
157
  return _regenerator["default"].wrap(function _callee5$(_context5) {
163
158
  while (1) switch (_context5.prev = _context5.next) {
164
159
  case 0:
165
160
  _context5.next = 2;
166
- return privKeyUrl(webId);
161
+ return getKeyIfExists(webId, privateKeyUrl, 'PrivateKey');
167
162
  case 2:
168
- privateKeyUrl = _context5.sent;
169
- _context5.next = 5;
170
- return keyExists(webId, privateKeyUrl, 'PrivateKey');
171
- case 5:
172
163
  return _context5.abrupt("return", _context5.sent);
173
- case 6:
164
+ case 3:
174
165
  case "end":
175
166
  return _context5.stop();
176
167
  }
177
168
  }, _callee5);
178
169
  }));
179
- return _privateKeyExists.apply(this, arguments);
170
+ return _getExistingPrivateKey.apply(this, arguments);
180
171
  }
181
- function keyExists(_x6, _x7, _x8) {
182
- return _keyExists.apply(this, arguments);
172
+ function getKeyIfExists(_x8, _x9, _x10) {
173
+ return _getKeyIfExists.apply(this, arguments);
183
174
  }
184
- function _keyExists() {
185
- _keyExists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(webId, keyUrl, keyType) {
175
+ function _getKeyIfExists() {
176
+ _getKeyIfExists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(webId, keyUrl, keyType) {
186
177
  var key, _err$response, data, contentType, response;
187
178
  return _regenerator["default"].wrap(function _callee6$(_context6) {
188
179
  while (1) switch (_context6.prev = _context6.next) {
@@ -201,7 +192,7 @@ function _keyExists() {
201
192
  break;
202
193
  }
203
194
  _context6.prev = 10;
204
- // create privateKey resource
195
+ // create resource
205
196
  data = '';
206
197
  contentType = 'text/turtle';
207
198
  _context6.next = 15;
@@ -230,6 +221,6 @@ function _keyExists() {
230
221
  }
231
222
  }, _callee6, null, [[0, 7], [10, 18]]);
232
223
  }));
233
- return _keyExists.apply(this, arguments);
224
+ return _getKeyIfExists.apply(this, arguments);
234
225
  }
235
- //# sourceMappingURL=cryptoKeyHelpers.js.map
226
+ //# sourceMappingURL=accessData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessData.js","names":["debug","_interopRequireWildcard","require","_signature","_solidLogic","ns","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","getPodRoot","_ref","_asyncToGenerator2","_regenerator","mark","_callee","webId","_podRoot","webIdURL","storages","podRoot","path","_res$headers$get","res","wrap","_callee$","_context","prev","next","URL","uri","store","fetcher","load","each","space","doc","length","pathname","substring","lastIndexOf","sym","origin","webOperation","sent","headers","includes","value","abrupt","warn","concat","find","storage","stop","_x","apply","arguments","exports","pubKeyUrl","_ref2","_callee2","_callee2$","_context2","t0","t1","Error","_x2","getExistingPublicKey","_x3","_x4","_getExistingPublicKey","_callee4","publicKeyUrl","_callee4$","_context4","getKeyIfExists","privKeyUrl","_ref3","_callee3","_callee3$","_context3","_x5","getExistingPrivateKey","_x6","_x7","_getExistingPrivateKey","_callee5","privateKeyUrl","_callee5$","_context5","_x8","_x9","_x10","_getKeyIfExists","_callee6","keyUrl","keyType","_err$response","data","contentType","response","_callee6$","_context6","any","CERT","status","log","requested","undefined"],"sources":["../../../src/utils/keyHelpers/accessData.ts"],"sourcesContent":["import * as debug from '../../debug'\nimport { CERT } from '../../chat/signature'\nimport { store } from 'solid-logic'\nimport * as ns from '../../ns'\nimport { NamedNode } from 'rdflib'\n\nexport const getPodRoot = async (webId: NamedNode) => {\n const webIdURL = new URL(webId.uri)\n // find storages in webId document\n await store.fetcher.load(webId.uri)\n const storages = store.each(webId, ns.space('storage'), null, webId.doc())\n var podRoot: NamedNode | undefined\n if (!storages?.length) {\n // find storage recursively in webId URL\n let path = webIdURL.pathname\n while (path.length) {\n path = path.substring(0, path.lastIndexOf('/'))\n podRoot = store.sym(webIdURL.origin + path + '/')\n const res = await store.fetcher.webOperation('HEAD', podRoot.uri)\n if (res.headers.get('link')?.includes(ns.space('Storage').value)) break\n if (!path) debug.warn(`Current user storage not found for\\n${webId}`)\n }\n } else {\n // give preference to storage in webId root\n podRoot = storages.find((storage) => webIdURL.origin === new URL(storage.value).origin) as NamedNode\n if (!podRoot) podRoot = storages[0] as NamedNode\n }\n return podRoot?.value\n}\n\nexport const pubKeyUrl = async (webId: NamedNode) => {\n try {\n return await getPodRoot(webId) + 'profile/keys/publicKey.ttl'\n } catch (err) { throw new Error(err) }\n}\n\nexport async function getExistingPublicKey (webId: NamedNode, publicKeyUrl: string) {\n // find publickey\n return await getKeyIfExists(webId, publicKeyUrl, 'PublicKey')\n}\n\nexport const privKeyUrl = async (webId: NamedNode) => {\n try {\n return await getPodRoot(webId) + 'profile/keys/privateKey.ttl'\n } catch (err) { throw new Error(err) }\n}\n\nexport async function getExistingPrivateKey (webId: NamedNode, privateKeyUrl: string) {\n // find privateKey\n return await getKeyIfExists(webId, privateKeyUrl, 'PrivateKey')\n}\n\ntype KeyType = 'PublicKey' | 'PrivateKey'\n\nexport async function getKeyIfExists (webId: NamedNode, keyUrl: string, keyType: KeyType) {\n try {\n await store.fetcher.load(keyUrl)\n const key = store.any(webId, store.sym(CERT + keyType))\n return key?.value // as NamedNode\n } catch (err) {\n if (err?.response?.status === 404) { // If PATCH on some server do not all create intermediate containers\n try {\n // create resource\n const data = ''\n const contentType = 'text/turtle'\n const response = await store.fetcher.webOperation('PUT', keyUrl, {\n data,\n contentType\n })\n } catch (err) {\n debug.log('createIfNotExists doc FAILED: ' + keyUrl + ': ' + err)\n throw err\n }\n delete store.fetcher.requested[keyUrl] // delete cached 404 error\n return undefined\n }\n debug.log('createIfNotExists doc FAILED: ' + keyUrl + ': ' + err)\n throw err\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAA8B,SAAAI,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,SAAAN,wBAAAU,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,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QAAA;UAHIC,QAAQ,GAAAE,SAAA,CAAA1D,IAAA;UAAA0D,SAAA,CAAA1E,IAAA;UAAA;QAAA;UAAA0E,SAAA,CAAA3E,IAAA;UAAA2E,SAAA,CAAAtC,EAAA,GAAAsC,SAAA;UAKdxH,KAAK,CAAC4H,GAAG,CAAC,gCAAgC,GAAGX,MAAM,GAAG,IAAI,GAAAO,SAAA,CAAAtC,EAAM,CAAC;UAAA,MAAAsC,SAAA,CAAAtC,EAAA;QAAA;UAGnE,OAAOjC,iBAAK,CAACC,OAAO,CAAC2E,SAAS,CAACZ,MAAM,CAAC,EAAC;UAAA,OAAAO,SAAA,CAAAtD,MAAA,WAChC4D,SAAS;QAAA;UAElB9H,KAAK,CAAC4H,GAAG,CAAC,gCAAgC,GAAGX,MAAM,GAAG,IAAI,GAAAO,SAAA,CAAAvC,EAAM,CAAC;UAAA,MAAAuC,SAAA,CAAAvC,EAAA;QAAA;QAAA;UAAA,OAAAuC,SAAA,CAAAjD,IAAA;MAAA;IAAA,GAAAyC,QAAA;EAAA,CAGpE;EAAA,OAAAD,eAAA,CAAAtC,KAAA,OAAAC,SAAA;AAAA"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * set ACL
3
+ * @param keyDoc
4
+ * @param aclBody
5
+ */
6
+ export declare function setAcl(keyDoc: string, aclBody: string): Promise<void>;
7
+ /**
8
+ * key container ACL
9
+ * @param me
10
+ * @returns aclBody
11
+ */
12
+ export declare const keyContainerAclBody: (me: string) => string;
13
+ /**
14
+ * Read only ACL
15
+ * @param keyDoc
16
+ * @param me
17
+ * @returns aclBody
18
+ */
19
+ export declare const keyAclBody: (keyDoc: any, me: any) => string;
20
+ //# sourceMappingURL=acl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acl.d.ts","sourceRoot":"","sources":["../../../src/utils/keyHelpers/acl.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAsB,MAAM,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAsB5D;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,OAAQ,MAAM,WAe7C,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,kCAatB,CAAA"}
@@ -0,0 +1,93 @@
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.keyContainerAclBody = exports.keyAclBody = void 0;
9
+ exports.setAcl = setAcl;
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
+ var debug = _interopRequireWildcard(require("../../debug"));
13
+ var _solidLogic = require("solid-logic");
14
+ 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); }
15
+ 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; }
16
+ /**
17
+ * set ACL
18
+ * @param keyDoc
19
+ * @param aclBody
20
+ */
21
+ function setAcl(_x, _x2) {
22
+ return _setAcl.apply(this, arguments);
23
+ }
24
+ /**
25
+ * key container ACL
26
+ * @param me
27
+ * @returns aclBody
28
+ */
29
+ function _setAcl() {
30
+ _setAcl = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(keyDoc, aclBody) {
31
+ var keyAclDoc, _err$response;
32
+ return _regenerator["default"].wrap(function _callee$(_context) {
33
+ while (1) switch (_context.prev = _context.next) {
34
+ case 0:
35
+ _context.next = 2;
36
+ return _solidLogic.store.fetcher.load(keyDoc);
37
+ case 2:
38
+ // FIXME: check the Why value on this quad:
39
+ debug.log(_solidLogic.store.statementsMatching(_solidLogic.store.sym(keyDoc), _solidLogic.store.sym('http://www.iana.org/assignments/link-relations/acl')));
40
+ keyAclDoc = _solidLogic.store.any(_solidLogic.store.sym(keyDoc), _solidLogic.store.sym('http://www.iana.org/assignments/link-relations/acl'));
41
+ if (keyAclDoc) {
42
+ _context.next = 6;
43
+ break;
44
+ }
45
+ throw new Error('Key ACL doc not found!');
46
+ case 6:
47
+ _context.prev = 6;
48
+ _context.next = 9;
49
+ return _solidLogic.store.fetcher.webOperation('PUT', keyAclDoc.value, {
50
+ data: aclBody,
51
+ contentType: 'text/turtle'
52
+ });
53
+ case 9:
54
+ _context.next = 16;
55
+ break;
56
+ case 11:
57
+ _context.prev = 11;
58
+ _context.t0 = _context["catch"](6);
59
+ 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)) {
60
+ _context.next = 15;
61
+ break;
62
+ }
63
+ throw new Error(_context.t0);
64
+ case 15:
65
+ debug.log('delete ' + keyAclDoc.value + ' ' + _context.t0.response.status); // should test 404 and 2xx
66
+ case 16:
67
+ case "end":
68
+ return _context.stop();
69
+ }
70
+ }, _callee, null, [[6, 11]]);
71
+ }));
72
+ return _setAcl.apply(this, arguments);
73
+ }
74
+ var keyContainerAclBody = function keyContainerAclBody(me) {
75
+ var aclBody = "\n@prefix : <#>.\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix key: <./>.\n\n:ReadWrite\n a acl:Authorization;\n acl:accessTo key:;\n acl:default key:;\n acl:agent <".concat(me, ">;\n acl:mode acl:Read, acl:Write.\n");
76
+ return aclBody;
77
+ };
78
+
79
+ /**
80
+ * Read only ACL
81
+ * @param keyDoc
82
+ * @param me
83
+ * @returns aclBody
84
+ */
85
+ exports.keyContainerAclBody = keyContainerAclBody;
86
+ var keyAclBody = function keyAclBody(keyDoc, me) {
87
+ var keyAgent = 'acl:agentClass foaf:Agent'; // publicKey
88
+ if (me !== null && me !== void 0 && me.length) keyAgent = "acl:agent <".concat(me, ">"); // privateKey
89
+ var aclBody = "\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n<#Read>\n a acl:Authorization;\n ".concat(keyAgent, ";\n acl:accessTo <").concat(keyDoc.split('/').pop(), ">;\n acl:mode acl:Read.\n");
90
+ return aclBody;
91
+ };
92
+ exports.keyAclBody = keyAclBody;
93
+ //# sourceMappingURL=acl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acl.js","names":["debug","_interopRequireWildcard","require","_solidLogic","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","setAcl","_x","_x2","_setAcl","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","keyDoc","aclBody","keyAclDoc","_err$response","wrap","_callee$","_context","prev","next","store","fetcher","load","log","statementsMatching","sym","any","Error","webOperation","value","data","contentType","t0","response","status","stop","keyContainerAclBody","me","concat","exports","keyAclBody","keyAgent","length","split","pop"],"sources":["../../../src/utils/keyHelpers/acl.ts"],"sourcesContent":["import * as debug from '../../debug'\nimport { store } from 'solid-logic'\n\n/**\n * set ACL\n * @param keyDoc\n * @param aclBody\n */\nexport async function setAcl (keyDoc: string, aclBody: string) {\n // Some servers don't present a Link http response header\n // if the container doesn't exist yet, refetch the resource\n\n await store.fetcher.load(keyDoc)\n\n // FIXME: check the Why value on this quad:\n debug.log(store.statementsMatching(store.sym(keyDoc), store.sym('http://www.iana.org/assignments/link-relations/acl')))\n const keyAclDoc = store.any(store.sym(keyDoc), store.sym('http://www.iana.org/assignments/link-relations/acl'))\n if (!keyAclDoc) {\n throw new Error('Key ACL doc not found!')\n }\n\n try {\n await store.fetcher.webOperation('PUT', keyAclDoc.value, {\n data: aclBody,\n contentType: 'text/turtle'\n })\n } catch (err) {\n if (err?.response?.status !== 404) { throw new Error(err) }\n debug.log('delete ' + keyAclDoc.value + ' ' + err.response.status) // should test 404 and 2xx\n }\n}\n\n/**\n * key container ACL\n * @param me\n * @returns aclBody\n */\nexport const keyContainerAclBody = (me: string) => {\n const aclBody = `\n@prefix : <#>.\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix key: <./>.\n\n:ReadWrite\n a acl:Authorization;\n acl:accessTo key:;\n acl:default key:;\n acl:agent <${me}>;\n acl:mode acl:Read, acl:Write.\n`\n return aclBody\n}\n\n/**\n * Read only ACL\n * @param keyDoc\n * @param me\n * @returns aclBody\n */\nexport const keyAclBody = (keyDoc, me) => {\n let keyAgent = 'acl:agentClass foaf:Agent' // publicKey\n if (me?.length) keyAgent = `acl:agent <${me}>` // privateKey\n const aclBody = `\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n<#Read>\n a acl:Authorization;\n ${keyAgent};\n acl:accessTo <${keyDoc.split('/').pop()}>;\n acl:mode acl:Read.\n`\n return aclBody\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;A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18:23:54Z',
9
- commit: '38005bd7679085e6b3dce878782ac928c0e74ab8',
8
+ buildTime: '2023-05-17T23:42:56Z',
9
+ commit: '3f1ead6bee015354a176a3ac34ac7634b6219e80',
10
10
  npmInfo: {
11
11
  'solid-ui': '2.4.27',
12
12
  npm: '8.19.4',
@@ -1 +1 @@
1
- {"version":3,"file":"versionInfo.js","names":["versionInfo","buildTime","commit","npmInfo","npm","node","v8","uv","zlib","brotli","ares","modules","nghttp2","napi","llhttp","openssl","cldr","icu","tz","unicode","ngtcp2","nghttp3","exports"],"sources":["../src/versionInfo.ts"],"sourcesContent":["export const versionInfo = {\n buildTime: '2023-05-07T18:23:54Z',\n commit: '38005bd7679085e6b3dce878782ac928c0e74ab8',\n npmInfo:\n{\n 'solid-ui': '2.4.27',\n npm: '8.19.4',\n node: '16.20.0',\n v8: '9.4.146.26-node.26',\n uv: '1.43.0',\n zlib: '1.2.11',\n brotli: '1.0.9',\n ares: '1.19.0',\n modules: '93',\n nghttp2: '1.47.0',\n napi: '8',\n llhttp: '6.0.10',\n openssl: '1.1.1t+quic',\n cldr: '41.0',\n icu: '71.1',\n tz: '2022f',\n unicode: '14.0',\n ngtcp2: '0.8.1',\n nghttp3: '0.7.0'\n}\n}\n"],"mappings":";;;;;;AAAO,IAAMA,WAAW,GAAG;EACzBC,SAAS,EAAE,sBAAsB;EACjCC,MAAM,EAAE,0CAA0C;EAClDC,OAAO,EACT;IACE,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE,QAAQ;IACbC,IAAI,EAAE,SAAS;IACfC,EAAE,EAAE,oBAAoB;IACxBC,EAAE,EAAE,QAAQ;IACZC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE,OAAO;IACfC,IAAI,EAAE,QAAQ;IACdC,OAAO,EAAE,IAAI;IACbC,OAAO,EAAE,QAAQ;IACjBC,IAAI,EAAE,GAAG;IACTC,MAAM,EAAE,QAAQ;IAChBC,OAAO,EAAE,aAAa;IACtBC,IAAI,EAAE,MAAM;IACZC,GAAG,EAAE,MAAM;IACXC,EAAE,EAAE,OAAO;IACXC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,OAAO;IACfC,OAAO,EAAE;EACX;AACA,CAAC;AAAAC,OAAA,CAAAtB,WAAA,GAAAA,WAAA"}
1
+ {"version":3,"file":"versionInfo.js","names":["versionInfo","buildTime","commit","npmInfo","npm","node","v8","uv","zlib","brotli","ares","modules","nghttp2","napi","llhttp","openssl","cldr","icu","tz","unicode","ngtcp2","nghttp3","exports"],"sources":["../src/versionInfo.ts"],"sourcesContent":["export const versionInfo = {\n buildTime: '2023-05-17T23:42:56Z',\n commit: '3f1ead6bee015354a176a3ac34ac7634b6219e80',\n npmInfo:\n{\n 'solid-ui': '2.4.27',\n npm: '8.19.4',\n node: '16.20.0',\n v8: '9.4.146.26-node.26',\n uv: '1.43.0',\n zlib: '1.2.11',\n brotli: '1.0.9',\n ares: '1.19.0',\n modules: '93',\n nghttp2: '1.47.0',\n napi: '8',\n llhttp: '6.0.10',\n openssl: '1.1.1t+quic',\n cldr: '41.0',\n icu: '71.1',\n tz: '2022f',\n unicode: '14.0',\n ngtcp2: '0.8.1',\n nghttp3: '0.7.0'\n}\n}\n"],"mappings":";;;;;;AAAO,IAAMA,WAAW,GAAG;EACzBC,SAAS,EAAE,sBAAsB;EACjCC,MAAM,EAAE,0CAA0C;EAClDC,OAAO,EACT;IACE,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE,QAAQ;IACbC,IAAI,EAAE,SAAS;IACfC,EAAE,EAAE,oBAAoB;IACxBC,EAAE,EAAE,QAAQ;IACZC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE,OAAO;IACfC,IAAI,EAAE,QAAQ;IACdC,OAAO,EAAE,IAAI;IACbC,OAAO,EAAE,QAAQ;IACjBC,IAAI,EAAE,GAAG;IACTC,MAAM,EAAE,QAAQ;IAChBC,OAAO,EAAE,aAAa;IACtBC,IAAI,EAAE,MAAM;IACZC,GAAG,EAAE,MAAM;IACXC,EAAE,EAAE,OAAO;IACXC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,OAAO;IACfC,OAAO,EAAE;EACX;AACA,CAAC;AAAAC,OAAA,CAAAtB,WAAA,GAAAA,WAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-ui",
3
- "version": "2.4.27-38005bd7",
3
+ "version": "2.4.27-3f1ead6b",
4
4
  "description": "UI library for writing Solid read-write-web applications",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -1,6 +0,0 @@
1
- import { NamedNode } from 'rdflib';
2
- export declare const pubKeyUrl: (webId: NamedNode) => Promise<string>;
3
- export declare function publicKeyExists(webId: NamedNode): Promise<string | undefined>;
4
- export declare const privKeyUrl: (webId: NamedNode) => Promise<string>;
5
- export declare function privateKeyExists(webId: NamedNode): Promise<string | undefined>;
6
- //# sourceMappingURL=cryptoKeyHelpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cryptoKeyHelpers.d.ts","sourceRoot":"","sources":["../../src/utils/cryptoKeyHelpers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AA0BlC,eAAO,MAAM,SAAS,UAAiB,SAAS,oBAI/C,CAAA;AAED,wBAAsB,eAAe,CAAE,KAAK,EAAE,SAAS,+BAItD;AAED,eAAO,MAAM,UAAU,UAAiB,SAAS,oBAIhD,CAAA;AAED,wBAAsB,gBAAgB,CAAE,KAAK,EAAE,SAAS,+BAIvD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cryptoKeyHelpers.js","names":["debug","_interopRequireWildcard","require","_signature","_solidLogic","ns","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","getPodRoot","_ref","_asyncToGenerator2","_regenerator","mark","_callee","webId","_podRoot","webIdURL","storages","podRoot","path","_res$headers$get","res","wrap","_callee$","_context","prev","next","URL","uri","store","fetcher","load","each","space","doc","length","pathname","substring","lastIndexOf","sym","origin","webOperation","sent","headers","includes","value","abrupt","warn","concat","find","storage","stop","_x","apply","arguments","pubKeyUrl","_ref2","_callee2","_callee2$","_context2","t0","t1","Error","_x2","exports","publicKeyExists","_x3","_publicKeyExists","_callee4","publicKeyUrl","_callee4$","_context4","keyExists","privKeyUrl","_ref3","_callee3","_callee3$","_context3","_x4","privateKeyExists","_x5","_privateKeyExists","_callee5","privateKeyUrl","_callee5$","_context5","_x6","_x7","_x8","_keyExists","_callee6","keyUrl","keyType","_err$response","data","contentType","response","_callee6$","_context6","any","CERT","status","log","requested","undefined"],"sources":["../../src/utils/cryptoKeyHelpers.ts"],"sourcesContent":["import * as debug from '../debug'\nimport { CERT } from '../chat/signature'\nimport { store } from 'solid-logic'\nimport * as ns from '../ns'\nimport { NamedNode } from 'rdflib'\n\nconst getPodRoot = async (webId: NamedNode) => {\n const webIdURL = new URL(webId.uri)\n // find storages in webId document\n await store.fetcher.load(webId.uri)\n const storages = store.each(webId, ns.space('storage'), null, webId.doc())\n var podRoot: NamedNode | undefined\n if (!storages?.length) {\n // find storage recursively in webId URL\n let path = webIdURL.pathname\n while (path.length) {\n path = path.substring(0, path.lastIndexOf('/'))\n podRoot = store.sym(webIdURL.origin + path + '/')\n const res = await store.fetcher.webOperation('HEAD', podRoot.uri)\n if (res.headers.get('link')?.includes(ns.space('Storage').value)) break\n if (!path) debug.warn(`Current user storage not found for\\n${webId}`)\n }\n } else {\n // give preference to storage in webId root\n podRoot = storages.find((storage) => webIdURL.origin === new URL(storage.value).origin) as NamedNode\n if (!podRoot) podRoot = storages[0] as NamedNode\n }\n return podRoot?.value\n}\n\nexport const pubKeyUrl = async (webId: NamedNode) => {\n try {\n return await getPodRoot(webId) + 'profile/keys/publicKey.ttl'\n } catch (err) { throw new Error(err) }\n}\n\nexport async function publicKeyExists (webId: NamedNode) {\n // find publickey\n const publicKeyUrl = await pubKeyUrl(webId)\n return await keyExists(webId, publicKeyUrl, 'PublicKey')\n}\n\nexport const privKeyUrl = async (webId: NamedNode) => {\n try {\n return await getPodRoot(webId) + 'profile/keys/privateKey.ttl'\n } catch (err) { throw new Error(err) }\n}\n\nexport async function privateKeyExists (webId: NamedNode) {\n // find privateKey\n const privateKeyUrl = await privKeyUrl(webId)\n return await keyExists(webId, privateKeyUrl, 'PrivateKey')\n}\n\ntype KeyType = 'PublicKey' | 'PrivateKey'\n\nasync function keyExists (webId: NamedNode, keyUrl: string, keyType: KeyType) {\n try {\n await store.fetcher.load(keyUrl)\n const key = store.any(webId, store.sym(CERT + keyType))\n return key?.value // as NamedNode\n } catch (err) {\n if (err?.response?.status === 404) { // If PATCH on some server do not all create intermediate containers\n try {\n // create privateKey resource\n const data = ''\n const contentType = 'text/turtle'\n const response = await store.fetcher.webOperation('PUT', keyUrl, {\n data,\n contentType\n })\n } catch (err) {\n debug.log('createIfNotExists doc FAILED: ' + keyUrl + ': ' + err)\n throw err\n }\n delete store.fetcher.requested[keyUrl] // delete cached 404 error\n return undefined\n }\n debug.log('createIfNotExists doc FAILED: ' + keyUrl + ': ' + err)\n throw err\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAA2B,SAAAI,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,SAAAN,wBAAAU,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAA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