@wovin/connect-web3storage 0.0.4 → 0.0.6
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/{chunk-Y5LEHAV3.min.js → chunk-M7XRUM4B.min.js} +2 -2
- package/dist/{chunk-GDLMANLT.min.js.map → chunk-M7XRUM4B.min.js.map} +1 -1
- package/dist/index.min.js +1 -1
- package/dist/retrieve.min.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-GDLMANLT.min.js +0 -377
- package/dist/chunk-NODAF3EN.min.js +0 -9
- package/dist/chunk-NODAF3EN.min.js.map +0 -1
- package/dist/chunk-Y5LEHAV3.min.js.map +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var P=Object.create,w=Object.defineProperty,j=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyNames,B=Object.getPrototypeOf,
|
|
1
|
+
var P=Object.create,w=Object.defineProperty,j=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyNames,B=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty,A=(r,e,s)=>e in r?w(r,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[e]=s,L=(r,e)=>function(){return e||(0,r[h(r)[0]])((e={exports:{}}).exports,e),e.exports},I=(r,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of h(e))!G.call(r,n)&&n!==s&&w(r,n,{get:()=>e[n],enumerable:!(o=j(e,n))||o.enumerable});return r},R=(r,e,s)=>(s=r!=null?P(B(r)):{},I(e||!r||!r.__esModule?w(s,"default",{value:r,enumerable:!0}):s,r)),d=(r,e,s)=>(A(r,typeof e!="symbol"?e+"":e,s),s),x=L({"../../node_modules/.pnpm/browser-or-node@2.1.1/node_modules/browser-or-node/lib/index.js"(r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},s=typeof window<"u"&&typeof window.document<"u",o=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,n=(typeof self>"u"?"undefined":e(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",c=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),m=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";r.isBrowser=s,r.isWebWorker=n,r.isNode=o,r.isJsDom=c,r.isDeno=m}}),C=L({"../../node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js"(r,e){"use strict";e.exports=function(s,o){o||(o={}),typeof o=="function"&&(o={cmp:o});var n=typeof o.cycles=="boolean"?o.cycles:!1,c=o.cmp&&function(l){return function(t){return function(i,a){var g={key:i,value:t[i]},p={key:a,value:t[a]};return l(g,p)}}}(o.cmp),m=[];return function l(t){if(t&&t.toJSON&&typeof t.toJSON=="function"&&(t=t.toJSON()),t!==void 0){if(typeof t=="number")return isFinite(t)?""+t:"null";if(typeof t!="object")return JSON.stringify(t);var i,a;if(Array.isArray(t)){for(a="[",i=0;i<t.length;i++)i&&(a+=","),a+=l(t[i])||"null";return a+"]"}if(t===null)return"null";if(m.indexOf(t)!==-1){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var g=m.push(t)-1,p=Object.keys(t).sort(c&&c(t));for(a="",i=0;i<p.length;i++){var y=p[i],O=l(t[y]);O&&(a&&(a+=","),a+=JSON.stringify(y)+":"+O)}return m.splice(g,1),"{"+a+"}"}}(s)}}}),v=R(x(),1),W=R(C(),1),S=!1,F=!1;v.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(S=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(F=process?.env?.LOGGER_PERF_PREFIX==="true"));var T=Object.freeze({prefix:void 0,time:S,delta:F,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0}),E=[],N=class{sinceFirst=0;sinceLast=0;time=!1;delta=!1;constructor(r,e,s,o){Object.assign(this,{sinceFirst:r,sinceLast:e,time:s,delta:o})}toString(){let r=this.sinceFirst*.001,e=r.toFixed(r<5?2:1),s=this.sinceLast<1e3?`${this.sinceLast.toFixed(0)}`.padStart(5," "):`${`${(this.sinceLast*.001).toFixed(this.sinceLast<1e4?1:0)}`.padStart(4," ")}s`;return`[${[this.time?e:null,this.delta?s:null].join(",")}]`}},D=class{constructor(r,e){Object.assign(this,{style:r,string:e})}},_=!1,u=class{static setup(r=u.INFO,e={}){e=Object.assign({},T,e),r>10&&console.debug("setup logger",{config:e});let s=this.wrapLog(console.debug,{...e,dim:e.dimDebugOnServer}),o=(...t)=>{window?.FORCE_DISABLE_LOGLEVEL&&s(...t)};o.isDisabled=!0,o.isEnabled=!1;let n=this.wrapLog(console.groupCollapsed,e),c=(t,i)=>{function a(...p){let y=p[p.length-1];return y===o?y():(n(...p.slice(0,-1)),(async()=>{try{let b=y();return b instanceof Promise?await b:b}finally{console.groupEnd()}})())}let g=Object.assign(i.bind({}),{isEnabled:t,isDisabled:!t,group:a,force:i});return t?g:Object.assign(o.bind({}),{isEnabled:t,isDisabled:!t,group:a,force:g})},m=c(r>=u.ERROR,this.wrapLog(console.error,e));return{ERROR:(...t)=>(m(...t),new Error((0,W.default)(t))),WARN:c(r>=u.WARN,this.wrapLog(console.warn,e)),LOG:c(r>=u.INFO,this.wrapLog(console.log,e)),DEBUG:c(r>=u.DEBUG,this.wrapLog(console.log,{...e,dim:e.dimDebugOnServer})),VERBOSE:c(r>=u.VERBOSE,this.wrapLog(console.debug,{...e,dim:e.dimDebugOnServer}))}}static wrapLog(r,e){if(v.isNode)return r.bind(console);{let s=[];if(e.time||e.delta){let n=v.isBrowser&&navigator.userAgent.includes("Chrome")?["",u.timeStr(!!e.time,!!e.delta)]:[];s.push(...n)}return e.prefix&&(_?s.push(new D("dim",e.prefix)):s.push(e.prefix)),r.bind(console,...s)}}static timeStr(r,e,s=0){if(!performance.now)return;let o=performance.now();u.firstLog||(u.firstLog=o,u.lastLog=o);let n=new N(o-u.firstLog,o-u.lastLog,r,e);return u.lastLog=o,s?n.toString():n}static getOriginFromStack(r){let e=!1;for(let s of r.split(`
|
|
2
2
|
`)){let o=s.match(/^\s+at\s+(.*)/);if(o){if(e)return o[1].trim().replace(__dirname,"");e=!0}}}},f=u;d(f,"ERROR",2);d(f,"WARN",4);d(f,"INFO",6);d(f,"LOG",6);d(f,"DEBUG",8);d(f,"VERBOSE",10);d(f,"firstLog",0);d(f,"lastLog",0);v.isBrowser?(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:r=>{if(E&&E.length){for(let e of E)if(e.match(r))return["span",{},e.format(r)]}return null},hasBody:()=>!0},{header:r=>{if(!(r instanceof N))return null;_||(_=!0);let e=f.timeStr(r.time,r.delta);return["span",{style:"font-weight: light; color: grey"},e?.toString()]},hasBody:()=>!1},{header:r=>r instanceof D?(_||(_=!0),["span",{style:"font-weight: light; color: grey; "},r.string]):null,hasBody:()=>!1})):v.isNode;var{WARN:V,LOG:$,DEBUG:q,VERBOSE:z,ERROR:H}=f.setup(f.DEBUG);
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-M7XRUM4B.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/.pnpm/besonders-logger@1.0.0-RC11_3myifxmc6j23mthq5k5h6wvx4a/node_modules/.pnpm/browser-or-node@2.1.1/node_modules/browser-or-node/lib/index.js","../../../../node_modules/.pnpm/besonders-logger@1.0.0-RC11_3myifxmc6j23mthq5k5h6wvx4a/node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js","../../../../node_modules/.pnpm/besonders-logger@1.0.0-RC11_3myifxmc6j23mthq5k5h6wvx4a/node_modules/besonders-logger/src/lib/logger.ts","../src/retrieve.ts"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\";\n\nvar isNode = typeof process !== \"undefined\" && process.versions != null && process.versions.node != null;\n\nvar isWebWorker = (typeof self === \"undefined\" ? \"undefined\" : _typeof(self)) === \"object\" && self.constructor && self.constructor.name === \"DedicatedWorkerGlobalScope\";\n\n/**\n * @see https://github.com/jsdom/jsdom/releases/tag/12.0.0\n * @see https://github.com/jsdom/jsdom/issues/1537\n */\nvar isJsDom = typeof window !== \"undefined\" && window.name === \"nodejs\" || typeof navigator !== \"undefined\" && (navigator.userAgent.includes(\"Node.js\") || navigator.userAgent.includes(\"jsdom\"));\n\nvar isDeno = typeof Deno !== \"undefined\" && typeof Deno.version !== \"undefined\" && typeof Deno.version.deno !== \"undefined\";\n\nexports.isBrowser = isBrowser;\nexports.isWebWorker = isWebWorker;\nexports.isNode = isNode;\nexports.isJsDom = isJsDom;\nexports.isDeno = isDeno;","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","import { isBrowser, isNode } from 'browser-or-node'\nimport stringify from 'fast-json-stable-stringify'\n\n////////////\n// CONFIG //\n////////////\n\n//(i) disabled by default bc. the detection logic has disappeared after the refactor.\n//TODO: Find it and check if it works\nlet TIME_PREFIX_ENABLED = false\nlet PERFORMANCE_PREFIX_ENABLED = false\nif (isNode) {\n // console.debug('isNode checking', { process })\n if (process?.env?.LOGGER_TIME_PREFIX) TIME_PREFIX_ENABLED = process?.env?.LOGGER_TIME_PREFIX === 'true'\n if (process?.env?.LOGGER_PERF_PREFIX) PERFORMANCE_PREFIX_ENABLED = process?.env?.LOGGER_PERF_PREFIX === 'true'\n}\nconst DEFAULT_CONFIG = Object.freeze({\n prefix: undefined as string | undefined,\n time: TIME_PREFIX_ENABLED,\n delta: PERFORMANCE_PREFIX_ENABLED,\n dimDebugOnServer: true,\n printOriginOnServer: true,\n serverInspectOptions: {},\n customFormattersOnServer: true,\n // Depth of stacktrace to show on server\n // - integer saying how many lines\n // - false to disable, true for all\n printStackLinesOnServer: false as boolean | number,\n dim: true,\n})\n\nexport type Config = Partial<typeof DEFAULT_CONFIG>\nexport type ConsoleFx = (...data: any[]) => void\nexport const StringFormatters = [\n // Format to string (Client console - currently not on server)\n // {\n // match: obj => obj instanceof Model,\n // format: m => {\n // const { displayName } = m\n // return `${m.constructor.name}#${m.ID}${displayName ? `{${displayName}}` : ''}`\n // },\n // },\n] as unknown as {\n match: (obj: any) => boolean\n format: (m: any) => string\n}[]\n\n// let applyCustomFormatters;\n// applyCustomFormatters = (value, config) => {\n// for (const formatter of StringFormatters) {\n// if (formatter.match(value)) return formatter.format(value);\n// }\n// if (!_.isString(value)) {\n// return util.inspect(value, config.inspectOptionsOnServer);\n// }\n// return value;\n// };\n\n/// ////////////////\n// RUNTIME STUFF //\n/// ////////////////\n\nexport class LoggerTime {\n sinceFirst = 0\n sinceLast = 0\n time = false\n delta = false\n constructor(sinceFirst: number, sinceLast: number, time: boolean, delta: boolean) {\n Object.assign(this, { sinceFirst, sinceLast, time, delta })\n }\n\n toString() {\n const sinceFirstNum = (this.sinceFirst * 0.001)\n const sinceFirst = sinceFirstNum.toFixed(sinceFirstNum < 5 ? 2 : 1) /* .padStart(3, ' ') */\n const sinceLast\n = this.sinceLast < 1000 // when >= 1s, format as seconds\n ? `${this.sinceLast.toFixed(0)}`.padStart(5, ' ')\n : `${`${(this.sinceLast * 0.001).toFixed(this.sinceLast < 10000 ? 1 : 0)}`.padStart(4, ' ')}s`\n return `[${[this.time ? sinceFirst : null, this.delta ? sinceLast : null].join(',')}]`\n }\n}\n\nexport class Style {\n constructor(style: string, string: string) {\n Object.assign(this, { style, string })\n }\n}\nlet formattersEnabled = false // for tracking if chrome formatters are enabled (don't change manually)\n\nexport class Logger {\n static ERROR = 2 as const\n static WARN = 4 as const\n static INFO = 6 as const // alias for LOG\n static LOG = 6 as const\n static DEBUG = 8 as const\n static VERBOSE = 10 as const\n\n static firstLog = 0\n static lastLog = 0\n\n /**\n * This is a clever way to log without the extra check on each log line.\n * Use it like this:\n * ```\n * const { WARN, LOG, DEBUG, VERBOSE } = Logger.setup(Logger.INFO); // eslint-disable-line no-unused-vars\n * LOG('message', data);\n * DEBUG(this.collectionName, '...')\n * if (!VERBOSE.isDisabled) {\n * const verboseStuff = generateVerboseStuff(); // computationally intensive\n * VERBOSE('Here it is:', verboseStuff)\n * }\n * ```\n *\n * @ param {number} level See {@link LVs}\n * @ param {object} config see DEFAULT_CONFIG\n * @ typedef {Function & {isDisabled: boolean, isEnabled: boolean, ...}} LogFunc\n * @ returns {{LOG: LogFunc, VERBOSE: LogFunc, DEBUG: LogFunc, WARN: LogFunc, ERROR: LogFunc}}\n */\n static setup(level: 2 | 4 | 6 | 8 | 10 = Logger.INFO, config: Config = {}) {\n config = Object.assign({}, DEFAULT_CONFIG, config) // defaults(config, DEFAULT_CONFIG) // fyi this is like the reverse of Object.assign\n if (level > 10) console.debug('setup logger', { config }) // manual overide to level:11 to show this trace\n\n const debugLogForStub = this.wrapLog(console.debug, { ...config, dim: config.dimDebugOnServer })\n const stub = (...args: any[]) => {\n // @ts-expect-error hack to enable DEBUG logging EVERYWHERE\n if (window?.FORCE_DISABLE_LOGLEVEL)\n debugLogForStub(...args)\n } // For disabled log-levels, we just return a stub function\n stub.isDisabled = true // this makes it possible to check, e.g. `DEBUG.isDisabled`\n stub.isEnabled = false // depending on syntactic preference\n const groupCollapsed = this.wrapLog(console.groupCollapsed, config)\n\n const addExtraFxs = (enabled: boolean, func: (...T: any) => void) =>/* : ((...T) => void & {isDisabled: boolean}) */ {\n // warning - weird TS hacks approaching:\n function group<T extends Func>(\n ...args: [...any[], T]\n ): ReturnType<T> extends Promise<any> ? Promise<ReturnType<T>> : ReturnType<T> {\n const functionToWrap = args[args.length - 1] as T\n\n if (functionToWrap as Func === stub)\n return functionToWrap() as ReturnType<T>\n\n groupCollapsed(...args.slice(0, -1)) // except last\n\n const asyncWrapper = async () => {\n try {\n const result = functionToWrap()\n return result instanceof Promise ? await result : result\n } finally {\n console.groupEnd()\n }\n }\n\n return asyncWrapper() as ReturnType<T> // Cast to bypass the Promise type inference\n }\n\n const realFunc = Object.assign(\n func.bind({}), // clone function - https://stackoverflow.com/a/6772648\n {\n isEnabled: enabled,\n isDisabled: !enabled,\n group,\n force: func,\n },\n )\n if (enabled) {\n return realFunc\n } else {\n return Object.assign(\n stub.bind({}), // clone stub function - https://stackoverflow.com/a/6772648\n {\n isEnabled: enabled,\n isDisabled: !enabled,\n group,\n force: realFunc,\n },\n )\n }\n }\n\n const ERRFX = addExtraFxs(level >= Logger.ERROR, this.wrapLog(console.error, config))\n const ERROR = (...params: any[]) => {\n ERRFX(...params)\n return new Error(stringify(params)) // return so we can throw it, stringify is fast & safe with circular references\n }\n\n // console.debug(\"Logger init:\", config)\n return {\n ERROR,\n WARN: addExtraFxs(level >= Logger.WARN, this.wrapLog(console.warn, config)),\n LOG: addExtraFxs(level >= Logger.INFO, this.wrapLog(console.log, config)),\n DEBUG: addExtraFxs(level >= Logger.DEBUG, this.wrapLog(console.log, { ...config, dim: config.dimDebugOnServer })), // not using console.debug as that requires dev tools verbose to be enabled\n VERBOSE: addExtraFxs(level >= Logger.VERBOSE, this.wrapLog(console.debug, { ...config, dim: config.dimDebugOnServer })),\n }\n }\n\n static wrapLog(logFunc: ConsoleFx, config: Config) {\n if (!isNode) {\n // ℹ In browser we can only do some of the fancy things, because we cannot call console.log ourselves,\n // as that would pollute the stacktrace\n\n // ℹ Would be nice to get formtted links in devtools, but <a> tags are not allowed:\n // const stack = new Error().stack;\n // const origin = Logger.getOriginFromStack(stack);\n // const originFilename = origin.split('\\\\').pop().split('/').pop(); // eslint-disable-line\n // if (origin) fixedArgs.push({ link: originFilename, href: `http://localhost:63342/api/file/${origin}` });\n\n // on the client, we need to return the original log function, as otherwise the origin of the log is set to here\n // But luckily we can bind fixed parameters on the function:\n const fixedArgs = []\n // if the custom formatters are enabled, and we want performance logging - we add an instance of P as a static prefix\n if (config.time || config.delta) {\n const isChrome = isBrowser && navigator.userAgent.includes('Chrome')\n\n const p = isChrome\n ? ['', Logger.timeStr(!!config.time, !!config.delta)] // this is a placeholder that gets replaced by the custom formatter\n : [] // [{ get perfNiceTry () { return Logger.timeStr(,,true) } }] // this (of course) shows the time when you click the getter\n fixedArgs.push(...p) // if we start with a non-string, all strings are rendered with quotes :/\n }\n if (config.prefix) {\n if (formattersEnabled)\n fixedArgs.push(new Style('dim', config.prefix))\n else fixedArgs.push(config.prefix)\n }\n // console.log('logger-log', { config, fixedArgs })\n return logFunc.bind(console, ...fixedArgs)\n } else {\n // ℹ in nodejs we print the stack trace origin ourselves, so we can do a lot more things\n // TODO: re-import removed code - https://gitlab.com/onezoomin/ztax/ztax/-/commit/f6f9bde617cd9ae93d1bc4bc49a4b5275e4cbff2#b1d1e091ca27ae560becf7ae1b27a4d53d39c061\n return logFunc.bind(console)\n }\n }\n\n // static log(msg, logPerformance = true) {\n // const p = this.perf();\n // return logPerformance ? `${p} ${msg}` : msg;\n // }\n\n static timeStr(time: boolean, delta: boolean, returnAsString = 0): LoggerTime | string | undefined {\n if (!performance.now)\n return undefined // TODO: server? p = { now: require('performance-now') };\n const now = performance.now()\n if (!Logger.firstLog) {\n Logger.firstLog = now\n Logger.lastLog = now\n }\n const p = new LoggerTime(now - Logger.firstLog, now - Logger.lastLog, time, delta)\n Logger.lastLog = now\n return returnAsString ? p.toString() : p\n }\n\n // (for nodejs) ~ https://stackoverflow.com/a/47296370/1633985\n static getOriginFromStack(stack: any): string | undefined {\n let skippedFirst = false // the first one is Logger.js\n for (const line of stack.split('\\n')) {\n const matches = line.match(/^\\s+at\\s+(.*)/)\n if (matches) {\n if (skippedFirst) {\n // first line - current function\n // second line - caller (what we are looking for)\n return (\n matches[1]\n .trim() // Removes spaces\n // .replace(/^module /, '') // Removes 'module ' at beginning\n // .replace(/^at /, '') // Removes 'at ' at beginning\n // .replace(/^ \\(/, '') // Removes parentheseses around file\n // .replace(/\\)$/, '') // -||-\n .replace(__dirname, '') // Removes script folder path (if exists)\n )\n }\n skippedFirst = true\n }\n }\n }\n}\n\nif (isBrowser) { // isBrowser is not true for web workers\n // CLIENT or Worker //\n\n // @ts-expect-error window hack\n window.devtoolsFormatters = window.devtoolsFormatters ?? []\n // noinspection JSUnusedGlobalSymbols\n // @ts-expect-error window hack\n window.devtoolsFormatters.push(\n {\n // Custom formatters\n header: (obj: any) => {\n if (StringFormatters && StringFormatters.length) {\n for (const formatter of StringFormatters) {\n if (formatter.match(obj))\n return ['span', {}, formatter.format(obj)]\n }\n }\n return null\n },\n hasBody: () => true,\n },\n {\n // Performance object //\n // This is a sneaky way to show performance info withouth any extra calls when logging:\n // LOG(`...`)\n // it would work without this if we would have some way to intercept the call:\n // L.INFO('...') - a getter on L that adds the current time as prefix\n // LOG('...')() - returns the log function with all argumends bound\n // But instead we are adding a custom formatter that replaced the placeholder object of class P with the performance info\n header: (obj: any) => {\n if (!(obj instanceof LoggerTime))\n return null\n if (!formattersEnabled)\n formattersEnabled = true\n const p = Logger.timeStr(obj.time, obj.delta)\n return [\n 'span',\n { style: 'font-weight: light; color: grey' },\n p?.toString(),\n // ['a', { href: 'vscodium://file/home/manu/dev/tamera/bookr/imports/lib/utils/Logger.js' }, 'WOW'],\n ]\n },\n hasBody: () => false,\n },\n {\n // Style object\n header: (obj: { string: any }) => {\n if (!(obj instanceof Style))\n return null\n if (!formattersEnabled)\n formattersEnabled = true\n return ['span', { style: 'font-weight: light; color: grey; '/* font-style: italic; */ }, obj.string]\n },\n hasBody: () => false,\n },\n )\n}\nelse if (isNode) {\n // SERVER //\n // node stuff removed as it breaks/bloats webworker build\n}\n\nexport function logriniTest(): string {\n return 'logrini'\n}\n\ntype Func<T = any> = () => T\n","import { CarReader } from '@ipld/car'\n// import { create } from '@web3-storage/w3up-client'\nimport { Applog, CidString, sortApplogsByTs } from '@wovin/core/applog'\nimport { decodeCarToApplogs } from '@wovin/core/ipfs'\nimport { Logger } from 'besonders-logger'\nimport { CID } from 'multiformats/cid'\n// import * as W3Name from 'w3name'\nimport { ApplogStreamInMemory } from '@wovin/core/stream'\n\nconst { WARN, LOG, DEBUG, VERBOSE, ERROR } = Logger.setup(Logger.DEBUG) // eslint-disable-line no-unused-vars\n\n// let w3sReadonly: Web3Storage = new Web3Storage({ token: 'FAKE' })\n// const client = await create()\n\n// const GATEWAYS = [\n// \t'https://cloudflare-ipfs.com/ipfs/CID/?format=car&dag-scope=all',\n// \t// \"https://cloudflare-ipfs.com/ipfs/CID/?format=car&dag-scope=block\",\n// \t// \"https://cloudflare-ipfs.com/ipfs/CID/?format=car&dag-scope=entity\",\n// \t'https://CID.ipfs.dweb.link/?format=car&dag-scope=all',\n// \t'https://CID.ipfs.dweb.link/?format=car&dag-scope=block',\n// \t'https://CID.ipfs.dweb.link/?format=car&dag-scope=entity',\n// \t'https://dweb.link/ipfs/CID/?format=car&dag-scope=all',\n// \t'https://dweb.link/ipfs/CID/?format=car&dag-scope=block',\n// \t'https://dweb.link/ipfs/CID/?format=car&dag-scope=entity',\n// \t'https://ipfs.4everland.io/ipfs/CID/?format=car&dag-scope=all',\n// \t'https://ipfs.4everland.io/ipfs/CID/?format=car&dag-scope=block',\n// \t'https://ipfs.4everland.io/ipfs/CID/?format=car&dag-scope=entity',\n// \t'https://ipfs.io/ipfs/CID/?format=car&dag-scope=all',\n// \t'https://ipfs.io/ipfs/CID/?format=car&dag-scope=block',\n// \t'https://ipfs.io/ipfs/CID/?format=car&dag-scope=entity',\n// ]\n\n// export async function retrievePubStream(\n// \tpubID: CidString,\n// \t{ readOnly = true, pinnedCID }: { readOnly?: boolean; pinnedCID?: CidString } = {},\n// ) {\n// \tlet cid: CID\n// \tif (pinnedCID) {\n// \t\tcid = CID.parse(pinnedCID)\n// \t} else {\n// \t\ttry {\n// \t\t\tcid = await resolveIPNS(/* parseW3Name( */ pubID /* ) */)\n// \t\t\tDEBUG(`Resolved pub to CID`, cid.toString())\n// \t\t} catch (err) {\n// \t\t\tthrow ERROR(`Failed to resolve IPNS ${pubID}:`, err)\n// \t\t}\n// \t}\n// \tconst car = await retrieveCar(cid.toString())\n// \tconst { applogs: maybeEncrypted } = await decodeCarToApplogs(car)\n// \tconst encrypted = maybeEncrypted.filter(log => log instanceof Uint8Array) as Uint8Array[]\n// \tif (encrypted.length) WARN(`Found ${encrypted.length} encrypted logs - skipping`) // TODO: decryption\n// \tconst applogs = maybeEncrypted.filter(log => !(log instanceof Uint8Array)) as Applog[]\n// \tsortApplogsByTs(applogs)\n// \tconst dataStream = new ApplogStreamInMemory(applogs, [], `preview-${pubID}`, readOnly)\n// \treturn { cid, dataStream }\n// \t// return dataStream\n// }\n\n// export async function resolveIPNS(name: CidString /* W3Name.Name */): Promise<CID> {\n// \tconst response = await fetch(`https://name.web3.storage/name/${name}`)\n// \tconst result = await response.json()\n// \t// return result\n// \t// const revision = await W3Name.resolve(name)\n// \t// DEBUG('[w3name] resolved', name.toString(), 'to', revision)\n// \tif (!result.value.startsWith('/ipfs/')) {\n// \t\tconsole.warn('IPNS value is not ipfs:', result)\n// \t}\n// \treturn CID.parse(result.value.replace('/ipfs/', ''))\n// }\n\n// export async function retrieveCar(cid: CidString): Promise<CarReader> {\n// \t// Fetch the CAR file from web3.storage\n// \tDEBUG('Retrieving:', cid)\n// \t// const response = await w3sReadonly.get(cid)\n// \t// const response = await fetch(`https://saturn.ms/ipfs/${cid}?format=car&dag-scope=all`)\n// \tconst response = await fetch(`https://cloudflare-ipfs.com/ipfs/${cid}?format=car&dag-scope=all`) // HACK: w3s is broken\n// \tif (!response?.ok || !response?.body) {\n// \t\tthrow new Error(`unexpected response ${response?.statusText}`)\n// \t}\n\n// \t// The data is an AsyncIterable<Uint8Array>, convert it to an AsyncIterable for the CarReader\n// \tconst data: AsyncIterable<Uint8Array> = streamToIterable(response!.body.getReader())\n\n// \t// return a CarReader from the CAR data\n// \treturn await CarReader.fromIterable(data)\n// }\n\n// function streamToIterable(bodyReader: any): AsyncIterable<Uint8Array> {\n// \treturn (async function*() {\n// \t\twhile (true) {\n// \t\t\tconst { done, value } = await bodyReader.read()\n// \t\t\tif (done) {\n// \t\t\t\tbreak\n// \t\t\t}\n// \t\t\tyield value\n// \t\t}\n// \t})()\n// }\n"],"mappings":";;;;;;;;;;;;;;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,QAAQ,IAAI,MAAM,IAAI,KAAK;AAC5C,eAAO;UACL;UACA,EAAE,OAAO,kCAAkC;UAC3C,GAAG,SAAS;;QAEd;MACF;MACA,SAAS,MAAM;IACjB;IACA;;MAEE,QAAQ,CAAC,QAAyB;AAChC,YAAI,EAAE,eAAe;AACnB,iBAAO;AACT,YAAI,CAAC;AACH,8BAAoB;AACtB,eAAO,CAAC,QAAQ;UAAE,OAAO;;QAA6D,GAAG,IAAI,MAAM;MACrG;MACA,SAAS,MAAM;IACjB;EACF;AACF,WACS,uBAAA,QAAQ;AAGjB;;;ACvUA,IAAM,EAAE,MAAM,KAAK,OAAO,SAAS,MAAM,IAAI,OAAO,MAAM,OAAO,KAAK;","names":["isBrowser","isNode","stringify","ERROR"]}
|
|
1
|
+
{"version":3,"sources":["../../../../node_modules/.pnpm/besonders-logger@1.0.0-RC11_3myifxmc6j23mthq5k5h6wvx4a/node_modules/.pnpm/browser-or-node@2.1.1/node_modules/browser-or-node/lib/index.js","../../../../node_modules/.pnpm/besonders-logger@1.0.0-RC11_3myifxmc6j23mthq5k5h6wvx4a/node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js","../../../../node_modules/.pnpm/besonders-logger@1.0.0-RC11_3myifxmc6j23mthq5k5h6wvx4a/node_modules/besonders-logger/src/lib/logger.ts","../src/retrieve.ts"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\";\n\nvar isNode = typeof process !== \"undefined\" && process.versions != null && process.versions.node != null;\n\nvar isWebWorker = (typeof self === \"undefined\" ? \"undefined\" : _typeof(self)) === \"object\" && self.constructor && self.constructor.name === \"DedicatedWorkerGlobalScope\";\n\n/**\n * @see https://github.com/jsdom/jsdom/releases/tag/12.0.0\n * @see https://github.com/jsdom/jsdom/issues/1537\n */\nvar isJsDom = typeof window !== \"undefined\" && window.name === \"nodejs\" || typeof navigator !== \"undefined\" && (navigator.userAgent.includes(\"Node.js\") || navigator.userAgent.includes(\"jsdom\"));\n\nvar isDeno = typeof Deno !== \"undefined\" && typeof Deno.version !== \"undefined\" && typeof Deno.version.deno !== \"undefined\";\n\nexports.isBrowser = isBrowser;\nexports.isWebWorker = isWebWorker;\nexports.isNode = isNode;\nexports.isJsDom = isJsDom;\nexports.isDeno = isDeno;","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","import { isBrowser, isNode } from 'browser-or-node'\nimport stringify from 'fast-json-stable-stringify'\n\n////////////\n// CONFIG //\n////////////\n\n//(i) disabled by default bc. the detection logic has disappeared after the refactor.\n//TODO: Find it and check if it works\nlet TIME_PREFIX_ENABLED = false\nlet PERFORMANCE_PREFIX_ENABLED = false\nif (isNode) {\n // console.debug('isNode checking', { process })\n if (process?.env?.LOGGER_TIME_PREFIX) TIME_PREFIX_ENABLED = process?.env?.LOGGER_TIME_PREFIX === 'true'\n if (process?.env?.LOGGER_PERF_PREFIX) PERFORMANCE_PREFIX_ENABLED = process?.env?.LOGGER_PERF_PREFIX === 'true'\n}\nconst DEFAULT_CONFIG = Object.freeze({\n prefix: undefined as string | undefined,\n time: TIME_PREFIX_ENABLED,\n delta: PERFORMANCE_PREFIX_ENABLED,\n dimDebugOnServer: true,\n printOriginOnServer: true,\n serverInspectOptions: {},\n customFormattersOnServer: true,\n // Depth of stacktrace to show on server\n // - integer saying how many lines\n // - false to disable, true for all\n printStackLinesOnServer: false as boolean | number,\n dim: true,\n})\n\nexport type Config = Partial<typeof DEFAULT_CONFIG>\nexport type ConsoleFx = (...data: any[]) => void\nexport const StringFormatters = [\n // Format to string (Client console - currently not on server)\n // {\n // match: obj => obj instanceof Model,\n // format: m => {\n // const { displayName } = m\n // return `${m.constructor.name}#${m.ID}${displayName ? `{${displayName}}` : ''}`\n // },\n // },\n] as unknown as {\n match: (obj: any) => boolean\n format: (m: any) => string\n}[]\n\n// let applyCustomFormatters;\n// applyCustomFormatters = (value, config) => {\n// for (const formatter of StringFormatters) {\n// if (formatter.match(value)) return formatter.format(value);\n// }\n// if (!_.isString(value)) {\n// return util.inspect(value, config.inspectOptionsOnServer);\n// }\n// return value;\n// };\n\n/// ////////////////\n// RUNTIME STUFF //\n/// ////////////////\n\nexport class LoggerTime {\n sinceFirst = 0\n sinceLast = 0\n time = false\n delta = false\n constructor(sinceFirst: number, sinceLast: number, time: boolean, delta: boolean) {\n Object.assign(this, { sinceFirst, sinceLast, time, delta })\n }\n\n toString() {\n const sinceFirstNum = (this.sinceFirst * 0.001)\n const sinceFirst = sinceFirstNum.toFixed(sinceFirstNum < 5 ? 2 : 1) /* .padStart(3, ' ') */\n const sinceLast\n = this.sinceLast < 1000 // when >= 1s, format as seconds\n ? `${this.sinceLast.toFixed(0)}`.padStart(5, ' ')\n : `${`${(this.sinceLast * 0.001).toFixed(this.sinceLast < 10000 ? 1 : 0)}`.padStart(4, ' ')}s`\n return `[${[this.time ? sinceFirst : null, this.delta ? sinceLast : null].join(',')}]`\n }\n}\n\nexport class Style {\n constructor(style: string, string: string) {\n Object.assign(this, { style, string })\n }\n}\nlet formattersEnabled = false // for tracking if chrome formatters are enabled (don't change manually)\n\nexport class Logger {\n static ERROR = 2 as const\n static WARN = 4 as const\n static INFO = 6 as const // alias for LOG\n static LOG = 6 as const\n static DEBUG = 8 as const\n static VERBOSE = 10 as const\n\n static firstLog = 0\n static lastLog = 0\n\n /**\n * This is a clever way to log without the extra check on each log line.\n * Use it like this:\n * ```\n * const { WARN, LOG, DEBUG, VERBOSE } = Logger.setup(Logger.INFO); // eslint-disable-line no-unused-vars\n * LOG('message', data);\n * DEBUG(this.collectionName, '...')\n * if (!VERBOSE.isDisabled) {\n * const verboseStuff = generateVerboseStuff(); // computationally intensive\n * VERBOSE('Here it is:', verboseStuff)\n * }\n * ```\n *\n * @ param {number} level See {@link LVs}\n * @ param {object} config see DEFAULT_CONFIG\n * @ typedef {Function & {isDisabled: boolean, isEnabled: boolean, ...}} LogFunc\n * @ returns {{LOG: LogFunc, VERBOSE: LogFunc, DEBUG: LogFunc, WARN: LogFunc, ERROR: LogFunc}}\n */\n static setup(level: 2 | 4 | 6 | 8 | 10 = Logger.INFO, config: Config = {}) {\n config = Object.assign({}, DEFAULT_CONFIG, config) // defaults(config, DEFAULT_CONFIG) // fyi this is like the reverse of Object.assign\n if (level > 10) console.debug('setup logger', { config }) // manual overide to level:11 to show this trace\n\n const debugLogForStub = this.wrapLog(console.debug, { ...config, dim: config.dimDebugOnServer })\n const stub = (...args: any[]) => {\n // @ts-expect-error hack to enable DEBUG logging EVERYWHERE\n if (window?.FORCE_DISABLE_LOGLEVEL)\n debugLogForStub(...args)\n } // For disabled log-levels, we just return a stub function\n stub.isDisabled = true // this makes it possible to check, e.g. `DEBUG.isDisabled`\n stub.isEnabled = false // depending on syntactic preference\n const groupCollapsed = this.wrapLog(console.groupCollapsed, config)\n\n const addExtraFxs = (enabled: boolean, func: (...T: any) => void) =>/* : ((...T) => void & {isDisabled: boolean}) */ {\n // warning - weird TS hacks approaching:\n function group<T extends Func>(\n ...args: [...any[], T]\n ): ReturnType<T> extends Promise<any> ? Promise<ReturnType<T>> : ReturnType<T> {\n const functionToWrap = args[args.length - 1] as T\n\n if (functionToWrap as Func === stub)\n return functionToWrap() as ReturnType<T>\n\n groupCollapsed(...args.slice(0, -1)) // except last\n\n const asyncWrapper = async () => {\n try {\n const result = functionToWrap()\n return result instanceof Promise ? await result : result\n } finally {\n console.groupEnd()\n }\n }\n\n return asyncWrapper() as ReturnType<T> // Cast to bypass the Promise type inference\n }\n\n const realFunc = Object.assign(\n func.bind({}), // clone function - https://stackoverflow.com/a/6772648\n {\n isEnabled: enabled,\n isDisabled: !enabled,\n group,\n force: func,\n },\n )\n if (enabled) {\n return realFunc\n } else {\n return Object.assign(\n stub.bind({}), // clone stub function - https://stackoverflow.com/a/6772648\n {\n isEnabled: enabled,\n isDisabled: !enabled,\n group,\n force: realFunc,\n },\n )\n }\n }\n\n const ERRFX = addExtraFxs(level >= Logger.ERROR, this.wrapLog(console.error, config))\n const ERROR = (...params: any[]) => {\n ERRFX(...params)\n return new Error(stringify(params)) // return so we can throw it, stringify is fast & safe with circular references\n }\n\n // console.debug(\"Logger init:\", config)\n return {\n ERROR,\n WARN: addExtraFxs(level >= Logger.WARN, this.wrapLog(console.warn, config)),\n LOG: addExtraFxs(level >= Logger.INFO, this.wrapLog(console.log, config)),\n DEBUG: addExtraFxs(level >= Logger.DEBUG, this.wrapLog(console.log, { ...config, dim: config.dimDebugOnServer })), // not using console.debug as that requires dev tools verbose to be enabled\n VERBOSE: addExtraFxs(level >= Logger.VERBOSE, this.wrapLog(console.debug, { ...config, dim: config.dimDebugOnServer })),\n }\n }\n\n static wrapLog(logFunc: ConsoleFx, config: Config) {\n if (!isNode) {\n // ℹ In browser we can only do some of the fancy things, because we cannot call console.log ourselves,\n // as that would pollute the stacktrace\n\n // ℹ Would be nice to get formtted links in devtools, but <a> tags are not allowed:\n // const stack = new Error().stack;\n // const origin = Logger.getOriginFromStack(stack);\n // const originFilename = origin.split('\\\\').pop().split('/').pop(); // eslint-disable-line\n // if (origin) fixedArgs.push({ link: originFilename, href: `http://localhost:63342/api/file/${origin}` });\n\n // on the client, we need to return the original log function, as otherwise the origin of the log is set to here\n // But luckily we can bind fixed parameters on the function:\n const fixedArgs = []\n // if the custom formatters are enabled, and we want performance logging - we add an instance of P as a static prefix\n if (config.time || config.delta) {\n const isChrome = isBrowser && navigator.userAgent.includes('Chrome')\n\n const p = isChrome\n ? ['', Logger.timeStr(!!config.time, !!config.delta)] // this is a placeholder that gets replaced by the custom formatter\n : [] // [{ get perfNiceTry () { return Logger.timeStr(,,true) } }] // this (of course) shows the time when you click the getter\n fixedArgs.push(...p) // if we start with a non-string, all strings are rendered with quotes :/\n }\n if (config.prefix) {\n if (formattersEnabled)\n fixedArgs.push(new Style('dim', config.prefix))\n else fixedArgs.push(config.prefix)\n }\n // console.log('logger-log', { config, fixedArgs })\n return logFunc.bind(console, ...fixedArgs)\n } else {\n // ℹ in nodejs we print the stack trace origin ourselves, so we can do a lot more things\n // TODO: re-import removed code - https://gitlab.com/onezoomin/ztax/ztax/-/commit/f6f9bde617cd9ae93d1bc4bc49a4b5275e4cbff2#b1d1e091ca27ae560becf7ae1b27a4d53d39c061\n return logFunc.bind(console)\n }\n }\n\n // static log(msg, logPerformance = true) {\n // const p = this.perf();\n // return logPerformance ? `${p} ${msg}` : msg;\n // }\n\n static timeStr(time: boolean, delta: boolean, returnAsString = 0): LoggerTime | string | undefined {\n if (!performance.now)\n return undefined // TODO: server? p = { now: require('performance-now') };\n const now = performance.now()\n if (!Logger.firstLog) {\n Logger.firstLog = now\n Logger.lastLog = now\n }\n const p = new LoggerTime(now - Logger.firstLog, now - Logger.lastLog, time, delta)\n Logger.lastLog = now\n return returnAsString ? p.toString() : p\n }\n\n // (for nodejs) ~ https://stackoverflow.com/a/47296370/1633985\n static getOriginFromStack(stack: any): string | undefined {\n let skippedFirst = false // the first one is Logger.js\n for (const line of stack.split('\\n')) {\n const matches = line.match(/^\\s+at\\s+(.*)/)\n if (matches) {\n if (skippedFirst) {\n // first line - current function\n // second line - caller (what we are looking for)\n return (\n matches[1]\n .trim() // Removes spaces\n // .replace(/^module /, '') // Removes 'module ' at beginning\n // .replace(/^at /, '') // Removes 'at ' at beginning\n // .replace(/^ \\(/, '') // Removes parentheseses around file\n // .replace(/\\)$/, '') // -||-\n .replace(__dirname, '') // Removes script folder path (if exists)\n )\n }\n skippedFirst = true\n }\n }\n }\n}\n\nif (isBrowser) { // isBrowser is not true for web workers\n // CLIENT or Worker //\n\n // @ts-expect-error window hack\n window.devtoolsFormatters = window.devtoolsFormatters ?? []\n // noinspection JSUnusedGlobalSymbols\n // @ts-expect-error window hack\n window.devtoolsFormatters.push(\n {\n // Custom formatters\n header: (obj: any) => {\n if (StringFormatters && StringFormatters.length) {\n for (const formatter of StringFormatters) {\n if (formatter.match(obj))\n return ['span', {}, formatter.format(obj)]\n }\n }\n return null\n },\n hasBody: () => true,\n },\n {\n // Performance object //\n // This is a sneaky way to show performance info withouth any extra calls when logging:\n // LOG(`...`)\n // it would work without this if we would have some way to intercept the call:\n // L.INFO('...') - a getter on L that adds the current time as prefix\n // LOG('...')() - returns the log function with all argumends bound\n // But instead we are adding a custom formatter that replaced the placeholder object of class P with the performance info\n header: (obj: any) => {\n if (!(obj instanceof LoggerTime))\n return null\n if (!formattersEnabled)\n formattersEnabled = true\n const p = Logger.timeStr(obj.time, obj.delta)\n return [\n 'span',\n { style: 'font-weight: light; color: grey' },\n p?.toString(),\n // ['a', { href: 'vscodium://file/home/manu/dev/tamera/bookr/imports/lib/utils/Logger.js' }, 'WOW'],\n ]\n },\n hasBody: () => false,\n },\n {\n // Style object\n header: (obj: { string: any }) => {\n if (!(obj instanceof Style))\n return null\n if (!formattersEnabled)\n formattersEnabled = true\n return ['span', { style: 'font-weight: light; color: grey; '/* font-style: italic; */ }, obj.string]\n },\n hasBody: () => false,\n },\n )\n}\nelse if (isNode) {\n // SERVER //\n // node stuff removed as it breaks/bloats webworker build\n}\n\nexport function logriniTest(): string {\n return 'logrini'\n}\n\ntype Func<T = any> = () => T\n","import { CarReader } from '@ipld/car'\n// import { create } from '@web3-storage/w3up-client'\nimport { Applog, CidString, sortApplogsByTs } from '@wovin/core/applog'\nimport { decodeCarToApplogs } from '@wovin/core/ipfs'\nimport { Logger } from 'besonders-logger'\nimport { CID } from 'multiformats/cid'\n// import * as W3Name from 'w3name'\nimport { ThreadInMemory } from '@wovin/core/thread'\n\nconst { WARN, LOG, DEBUG, VERBOSE, ERROR } = Logger.setup(Logger.DEBUG) // eslint-disable-line no-unused-vars\n\n// let w3sReadonly: Web3Storage = new Web3Storage({ token: 'FAKE' })\n// const client = await create()\n\n// const GATEWAYS = [\n// \t'https://cloudflare-ipfs.com/ipfs/CID/?format=car&dag-scope=all',\n// \t// \"https://cloudflare-ipfs.com/ipfs/CID/?format=car&dag-scope=block\",\n// \t// \"https://cloudflare-ipfs.com/ipfs/CID/?format=car&dag-scope=entity\",\n// \t'https://CID.ipfs.dweb.link/?format=car&dag-scope=all',\n// \t'https://CID.ipfs.dweb.link/?format=car&dag-scope=block',\n// \t'https://CID.ipfs.dweb.link/?format=car&dag-scope=entity',\n// \t'https://dweb.link/ipfs/CID/?format=car&dag-scope=all',\n// \t'https://dweb.link/ipfs/CID/?format=car&dag-scope=block',\n// \t'https://dweb.link/ipfs/CID/?format=car&dag-scope=entity',\n// \t'https://ipfs.4everland.io/ipfs/CID/?format=car&dag-scope=all',\n// \t'https://ipfs.4everland.io/ipfs/CID/?format=car&dag-scope=block',\n// \t'https://ipfs.4everland.io/ipfs/CID/?format=car&dag-scope=entity',\n// \t'https://ipfs.io/ipfs/CID/?format=car&dag-scope=all',\n// \t'https://ipfs.io/ipfs/CID/?format=car&dag-scope=block',\n// \t'https://ipfs.io/ipfs/CID/?format=car&dag-scope=entity',\n// ]\n\n// export async function retrievePubThread(\n// \tpubID: CidString,\n// \t{ readOnly = true, pinnedCID }: { readOnly?: boolean; pinnedCID?: CidString } = {},\n// ) {\n// \tlet cid: CID\n// \tif (pinnedCID) {\n// \t\tcid = CID.parse(pinnedCID)\n// \t} else {\n// \t\ttry {\n// \t\t\tcid = await resolveIPNS(/* parseW3Name( */ pubID /* ) */)\n// \t\t\tDEBUG(`Resolved pub to CID`, cid.toString())\n// \t\t} catch (err) {\n// \t\t\tthrow ERROR(`Failed to resolve IPNS ${pubID}:`, err)\n// \t\t}\n// \t}\n// \tconst car = await retrieveCar(cid.toString())\n// \tconst { applogs: maybeEncrypted } = await decodeCarToApplogs(car)\n// \tconst encrypted = maybeEncrypted.filter(log => log instanceof Uint8Array) as Uint8Array[]\n// \tif (encrypted.length) WARN(`Found ${encrypted.length} encrypted logs - skipping`) // TODO: decryption\n// \tconst applogs = maybeEncrypted.filter(log => !(log instanceof Uint8Array)) as Applog[]\n// \tsortApplogsByTs(applogs)\n// \tconst thread = new ThreadInMemory(applogs, [], `preview-${pubID}`, readOnly)\n// \treturn { cid, thread }\n// \t// return thread\n// }\n\n// export async function resolveIPNS(name: CidString /* W3Name.Name */): Promise<CID> {\n// \tconst response = await fetch(`https://name.web3.storage/name/${name}`)\n// \tconst result = await response.json()\n// \t// return result\n// \t// const revision = await W3Name.resolve(name)\n// \t// DEBUG('[w3name] resolved', name.toString(), 'to', revision)\n// \tif (!result.value.startsWith('/ipfs/')) {\n// \t\tconsole.warn('IPNS value is not ipfs:', result)\n// \t}\n// \treturn CID.parse(result.value.replace('/ipfs/', ''))\n// }\n\n// export async function retrieveCar(cid: CidString): Promise<CarReader> {\n// \t// Fetch the CAR file from web3.storage\n// \tDEBUG('Retrieving:', cid)\n// \t// const response = await w3sReadonly.get(cid)\n// \t// const response = await fetch(`https://saturn.ms/ipfs/${cid}?format=car&dag-scope=all`)\n// \tconst response = await fetch(`https://cloudflare-ipfs.com/ipfs/${cid}?format=car&dag-scope=all`) // HACK: w3s is broken\n// \tif (!response?.ok || !response?.body) {\n// \t\tthrow new Error(`unexpected response ${response?.statusText}`)\n// \t}\n\n// \t// The data is an AsyncIterable<Uint8Array>, convert it to an AsyncIterable for the CarReader\n// \tconst data: AsyncIterable<Uint8Array> = threadToIterable(response!.body.getReader())\n\n// \t// return a CarReader from the CAR data\n// \treturn await CarReader.fromIterable(data)\n// }\n\n// function threadToIterable(bodyReader: any): AsyncIterable<Uint8Array> {\n// \treturn (async function*() {\n// \t\twhile (true) {\n// \t\t\tconst { done, value } = await bodyReader.read()\n// \t\t\tif (done) {\n// \t\t\t\tbreak\n// \t\t\t}\n// \t\t\tyield value\n// \t\t}\n// \t})()\n// }\n"],"mappings":"2oBAAAA,EAAAC,EAAA,CAAA,2FAAAC,EAAA,CAAA,aAEA,OAAO,eAAeA,EAAS,aAAc,CAC3C,MAAO,EACT,CAAC,EAED,IAAIC,EAAU,OAAO,QAAW,YAAc,OAAO,OAAO,UAAa,SAAW,SAAUC,EAAK,CAAE,OAAO,OAAOA,CAAK,EAAI,SAAUA,EAAK,CAAE,OAAOA,GAAO,OAAO,QAAW,YAAcA,EAAI,cAAgB,QAAUA,IAAQ,OAAO,UAAY,SAAW,OAAOA,CAAK,EAEvQC,EAAY,OAAO,OAAW,KAAe,OAAO,OAAO,SAAa,IAExEC,EAAS,OAAO,QAAY,KAAe,QAAQ,UAAY,MAAQ,QAAQ,SAAS,MAAQ,KAEhGC,GAAe,OAAO,KAAS,IAAc,YAAcJ,EAAQ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AAA,EAEjBC,EARWD,EAQJ,WAAW,CAAA,EAClBC,EATWD,EASJ,UAAU,CAAA,EAkLf1C,EAAA,WAIF,OAAO,mBAAqB,OAAO,oBAAsB,CAAC,EAG1D,OAAO,mBAAmB,KACxB,CAEE,OAASzB,GAAa,CACpB,GAAI+B,GAAoBA,EAAiB,QACvC,QAAWsC,KAAatC,EACtB,GAAIsC,EAAU,MAAMrE,CAAG,EACrB,MAAO,CAAC,OAAQ,CAAC,EAAGqE,EAAU,OAAOrE,CAAG,CAAC,EAG/C,OAAO,IACT,EACA,QAAS,IAAM,EACjB,EACA,CAQE,OAASA,GAAa,CACpB,GAAI,EAAEA,aAAegC,GACnB,OAAO,KACJS,IACHA,EAAoB,IACtB,IAAMmB,EAAIO,EAAO,QAAQnE,EAAI,KAAMA,EAAI,KAAK,EAC5C,MAAO,CACL,OACA,CAAE,MAAO,iCAAkC,EAC3C4D,GAAG,SAAS,CAEd,CACF,EACA,QAAS,IAAM,EACjB,EACA,CAEE,OAAS5D,GACDA,aAAesC,GAEhBG,IACHA,EAAoB,IACf,CAAC,OAAQ,CAAE,MAAO,mCAA6D,EAAGzC,EAAI,MAAM,GAH1F,KAKX,QAAS,IAAM,EACjB,CACF,GAEOyB,EAAA,OCpUT,GAAM,CAAE,KAAA6C,EAAM,IAAAC,EAAK,MAAAC,EAAO,QAAAC,EAAS,MAAAC,CAAM,EAAIC,EAAO,MAAMA,EAAO,KAAK","names":["require_lib","__commonJS","exports","_typeof","obj","isBrowser","isNode","isWebWorker","isJsDom","isDeno","require_fast_json_stable_stringify","module","data","opts","cycles","cmp","f","node","a","b","aobj","bobj","seen","stringify","out","seenIndex","keys","key","value","import_browser_or_node","__toESM","import_fast_json_stable_stringify","TIME_PREFIX_ENABLED","PERFORMANCE_PREFIX_ENABLED","DEFAULT_CONFIG","StringFormatters","LoggerTime","sinceFirst","sinceLast","time","delta","sinceFirstNum","Style","style","string","formattersEnabled","_Logger","level","config","debugLogForStub","stub","args","groupCollapsed","addExtraFxs","enabled","func","group","functionToWrap","result","realFunc","ERRFX","params","logFunc","fixedArgs","p","returnAsString","now","stack","skippedFirst","line","matches","Logger","__publicField","formatter","WARN","LOG","DEBUG","VERBOSE","ERROR","Logger"]}
|
package/dist/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-M7XRUM4B.min.js";import{a as o}from"./chunk-BFHWRINC.min.js";var r=10.3;export{o as parseW3Name,r as w3sTest};
|
|
2
2
|
//# sourceMappingURL=index.min.js.map
|
package/dist/retrieve.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-M7XRUM4B.min.js";
|
|
2
2
|
//# sourceMappingURL=retrieve.min.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wovin/connect-web3storage",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rm -rf dist/ && concurrently \"pnpm build:code\" \"pnpm build:types\"",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ipld/car": "^5.2.4",
|
|
46
|
-
"@wovin/core": "0.0.
|
|
46
|
+
"@wovin/core": "0.0.6",
|
|
47
47
|
"besonders-logger": "1.0.0-RC11",
|
|
48
48
|
"multiformats": "^12.1.3"
|
|
49
49
|
},
|
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
// ../../../node_modules/.pnpm/besonders-logger@1.0.0-RC11_3myifxmc6j23mthq5k5h6wvx4a/node_modules/besonders-logger/dist/src/index.mjs
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
10
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __publicField = (obj, key, value) => {
|
|
29
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
30
|
-
return value;
|
|
31
|
-
};
|
|
32
|
-
var require_lib = __commonJS({
|
|
33
|
-
"../../node_modules/.pnpm/browser-or-node@2.1.1/node_modules/browser-or-node/lib/index.js"(exports) {
|
|
34
|
-
"use strict";
|
|
35
|
-
Object.defineProperty(exports, "__esModule", {
|
|
36
|
-
value: true
|
|
37
|
-
});
|
|
38
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
|
|
39
|
-
return typeof obj;
|
|
40
|
-
} : function(obj) {
|
|
41
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
42
|
-
};
|
|
43
|
-
var isBrowser2 = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
44
|
-
var isNode2 = typeof process !== "undefined" && process.versions != null && process.versions.node != null;
|
|
45
|
-
var isWebWorker = (typeof self === "undefined" ? "undefined" : _typeof(self)) === "object" && self.constructor && self.constructor.name === "DedicatedWorkerGlobalScope";
|
|
46
|
-
var isJsDom = typeof window !== "undefined" && window.name === "nodejs" || typeof navigator !== "undefined" && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
|
|
47
|
-
var isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined";
|
|
48
|
-
exports.isBrowser = isBrowser2;
|
|
49
|
-
exports.isWebWorker = isWebWorker;
|
|
50
|
-
exports.isNode = isNode2;
|
|
51
|
-
exports.isJsDom = isJsDom;
|
|
52
|
-
exports.isDeno = isDeno;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
var require_fast_json_stable_stringify = __commonJS({
|
|
56
|
-
"../../node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js"(exports, module) {
|
|
57
|
-
"use strict";
|
|
58
|
-
module.exports = function(data, opts) {
|
|
59
|
-
if (!opts)
|
|
60
|
-
opts = {};
|
|
61
|
-
if (typeof opts === "function")
|
|
62
|
-
opts = { cmp: opts };
|
|
63
|
-
var cycles = typeof opts.cycles === "boolean" ? opts.cycles : false;
|
|
64
|
-
var cmp = opts.cmp && /* @__PURE__ */ function(f) {
|
|
65
|
-
return function(node) {
|
|
66
|
-
return function(a, b) {
|
|
67
|
-
var aobj = { key: a, value: node[a] };
|
|
68
|
-
var bobj = { key: b, value: node[b] };
|
|
69
|
-
return f(aobj, bobj);
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
}(opts.cmp);
|
|
73
|
-
var seen = [];
|
|
74
|
-
return function stringify2(node) {
|
|
75
|
-
if (node && node.toJSON && typeof node.toJSON === "function") {
|
|
76
|
-
node = node.toJSON();
|
|
77
|
-
}
|
|
78
|
-
if (node === void 0)
|
|
79
|
-
return;
|
|
80
|
-
if (typeof node == "number")
|
|
81
|
-
return isFinite(node) ? "" + node : "null";
|
|
82
|
-
if (typeof node !== "object")
|
|
83
|
-
return JSON.stringify(node);
|
|
84
|
-
var i, out;
|
|
85
|
-
if (Array.isArray(node)) {
|
|
86
|
-
out = "[";
|
|
87
|
-
for (i = 0; i < node.length; i++) {
|
|
88
|
-
if (i)
|
|
89
|
-
out += ",";
|
|
90
|
-
out += stringify2(node[i]) || "null";
|
|
91
|
-
}
|
|
92
|
-
return out + "]";
|
|
93
|
-
}
|
|
94
|
-
if (node === null)
|
|
95
|
-
return "null";
|
|
96
|
-
if (seen.indexOf(node) !== -1) {
|
|
97
|
-
if (cycles)
|
|
98
|
-
return JSON.stringify("__cycle__");
|
|
99
|
-
throw new TypeError("Converting circular structure to JSON");
|
|
100
|
-
}
|
|
101
|
-
var seenIndex = seen.push(node) - 1;
|
|
102
|
-
var keys = Object.keys(node).sort(cmp && cmp(node));
|
|
103
|
-
out = "";
|
|
104
|
-
for (i = 0; i < keys.length; i++) {
|
|
105
|
-
var key = keys[i];
|
|
106
|
-
var value = stringify2(node[key]);
|
|
107
|
-
if (!value)
|
|
108
|
-
continue;
|
|
109
|
-
if (out)
|
|
110
|
-
out += ",";
|
|
111
|
-
out += JSON.stringify(key) + ":" + value;
|
|
112
|
-
}
|
|
113
|
-
seen.splice(seenIndex, 1);
|
|
114
|
-
return "{" + out + "}";
|
|
115
|
-
}(data);
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
var import_browser_or_node = __toESM(require_lib(), 1);
|
|
120
|
-
var import_fast_json_stable_stringify = __toESM(require_fast_json_stable_stringify(), 1);
|
|
121
|
-
var TIME_PREFIX_ENABLED = false;
|
|
122
|
-
var PERFORMANCE_PREFIX_ENABLED = false;
|
|
123
|
-
if (import_browser_or_node.isNode) {
|
|
124
|
-
if (process?.env?.LOGGER_TIME_PREFIX)
|
|
125
|
-
TIME_PREFIX_ENABLED = process?.env?.LOGGER_TIME_PREFIX === "true";
|
|
126
|
-
if (process?.env?.LOGGER_PERF_PREFIX)
|
|
127
|
-
PERFORMANCE_PREFIX_ENABLED = process?.env?.LOGGER_PERF_PREFIX === "true";
|
|
128
|
-
}
|
|
129
|
-
var DEFAULT_CONFIG = Object.freeze({
|
|
130
|
-
prefix: void 0,
|
|
131
|
-
time: TIME_PREFIX_ENABLED,
|
|
132
|
-
delta: PERFORMANCE_PREFIX_ENABLED,
|
|
133
|
-
dimDebugOnServer: true,
|
|
134
|
-
printOriginOnServer: true,
|
|
135
|
-
serverInspectOptions: {},
|
|
136
|
-
customFormattersOnServer: true,
|
|
137
|
-
// Depth of stacktrace to show on server
|
|
138
|
-
// - integer saying how many lines
|
|
139
|
-
// - false to disable, true for all
|
|
140
|
-
printStackLinesOnServer: false,
|
|
141
|
-
dim: true
|
|
142
|
-
});
|
|
143
|
-
var StringFormatters = [
|
|
144
|
-
// Format to string (Client console - currently not on server)
|
|
145
|
-
// {
|
|
146
|
-
// match: obj => obj instanceof Model,
|
|
147
|
-
// format: m => {
|
|
148
|
-
// const { displayName } = m
|
|
149
|
-
// return `${m.constructor.name}#${m.ID}${displayName ? `{${displayName}}` : ''}`
|
|
150
|
-
// },
|
|
151
|
-
// },
|
|
152
|
-
];
|
|
153
|
-
var LoggerTime = class {
|
|
154
|
-
sinceFirst = 0;
|
|
155
|
-
sinceLast = 0;
|
|
156
|
-
time = false;
|
|
157
|
-
delta = false;
|
|
158
|
-
constructor(sinceFirst, sinceLast, time, delta) {
|
|
159
|
-
Object.assign(this, { sinceFirst, sinceLast, time, delta });
|
|
160
|
-
}
|
|
161
|
-
toString() {
|
|
162
|
-
const sinceFirstNum = this.sinceFirst * 1e-3;
|
|
163
|
-
const sinceFirst = sinceFirstNum.toFixed(sinceFirstNum < 5 ? 2 : 1);
|
|
164
|
-
const sinceLast = this.sinceLast < 1e3 ? `${this.sinceLast.toFixed(0)}`.padStart(5, " ") : `${`${(this.sinceLast * 1e-3).toFixed(this.sinceLast < 1e4 ? 1 : 0)}`.padStart(4, " ")}s`;
|
|
165
|
-
return `[${[this.time ? sinceFirst : null, this.delta ? sinceLast : null].join(",")}]`;
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
var Style = class {
|
|
169
|
-
constructor(style, string) {
|
|
170
|
-
Object.assign(this, { style, string });
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
var formattersEnabled = false;
|
|
174
|
-
var _Logger = class {
|
|
175
|
-
/**
|
|
176
|
-
* This is a clever way to log without the extra check on each log line.
|
|
177
|
-
* Use it like this:
|
|
178
|
-
* ```
|
|
179
|
-
* const { WARN, LOG, DEBUG, VERBOSE } = Logger.setup(Logger.INFO); // eslint-disable-line no-unused-vars
|
|
180
|
-
* LOG('message', data);
|
|
181
|
-
* DEBUG(this.collectionName, '...')
|
|
182
|
-
* if (!VERBOSE.isDisabled) {
|
|
183
|
-
* const verboseStuff = generateVerboseStuff(); // computationally intensive
|
|
184
|
-
* VERBOSE('Here it is:', verboseStuff)
|
|
185
|
-
* }
|
|
186
|
-
* ```
|
|
187
|
-
*
|
|
188
|
-
* @ param {number} level See {@link LVs}
|
|
189
|
-
* @ param {object} config see DEFAULT_CONFIG
|
|
190
|
-
* @ typedef {Function & {isDisabled: boolean, isEnabled: boolean, ...}} LogFunc
|
|
191
|
-
* @ returns {{LOG: LogFunc, VERBOSE: LogFunc, DEBUG: LogFunc, WARN: LogFunc, ERROR: LogFunc}}
|
|
192
|
-
*/
|
|
193
|
-
static setup(level = _Logger.INFO, config = {}) {
|
|
194
|
-
config = Object.assign({}, DEFAULT_CONFIG, config);
|
|
195
|
-
if (level > 10)
|
|
196
|
-
console.debug("setup logger", { config });
|
|
197
|
-
const debugLogForStub = this.wrapLog(console.debug, { ...config, dim: config.dimDebugOnServer });
|
|
198
|
-
const stub = (...args) => {
|
|
199
|
-
if (window?.FORCE_DISABLE_LOGLEVEL)
|
|
200
|
-
debugLogForStub(...args);
|
|
201
|
-
};
|
|
202
|
-
stub.isDisabled = true;
|
|
203
|
-
stub.isEnabled = false;
|
|
204
|
-
const groupCollapsed = this.wrapLog(console.groupCollapsed, config);
|
|
205
|
-
const addExtraFxs = (enabled, func) => {
|
|
206
|
-
function group(...args) {
|
|
207
|
-
const functionToWrap = args[args.length - 1];
|
|
208
|
-
if (functionToWrap === stub)
|
|
209
|
-
return functionToWrap();
|
|
210
|
-
groupCollapsed(...args.slice(0, -1));
|
|
211
|
-
const asyncWrapper = async () => {
|
|
212
|
-
try {
|
|
213
|
-
const result = functionToWrap();
|
|
214
|
-
return result instanceof Promise ? await result : result;
|
|
215
|
-
} finally {
|
|
216
|
-
console.groupEnd();
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
return asyncWrapper();
|
|
220
|
-
}
|
|
221
|
-
const realFunc = Object.assign(
|
|
222
|
-
func.bind({}),
|
|
223
|
-
// clone function - https://stackoverflow.com/a/6772648
|
|
224
|
-
{
|
|
225
|
-
isEnabled: enabled,
|
|
226
|
-
isDisabled: !enabled,
|
|
227
|
-
group,
|
|
228
|
-
force: func
|
|
229
|
-
}
|
|
230
|
-
);
|
|
231
|
-
if (enabled) {
|
|
232
|
-
return realFunc;
|
|
233
|
-
} else {
|
|
234
|
-
return Object.assign(
|
|
235
|
-
stub.bind({}),
|
|
236
|
-
// clone stub function - https://stackoverflow.com/a/6772648
|
|
237
|
-
{
|
|
238
|
-
isEnabled: enabled,
|
|
239
|
-
isDisabled: !enabled,
|
|
240
|
-
group,
|
|
241
|
-
force: realFunc
|
|
242
|
-
}
|
|
243
|
-
);
|
|
244
|
-
}
|
|
245
|
-
};
|
|
246
|
-
const ERRFX = addExtraFxs(level >= _Logger.ERROR, this.wrapLog(console.error, config));
|
|
247
|
-
const ERROR2 = (...params) => {
|
|
248
|
-
ERRFX(...params);
|
|
249
|
-
return new Error((0, import_fast_json_stable_stringify.default)(params));
|
|
250
|
-
};
|
|
251
|
-
return {
|
|
252
|
-
ERROR: ERROR2,
|
|
253
|
-
WARN: addExtraFxs(level >= _Logger.WARN, this.wrapLog(console.warn, config)),
|
|
254
|
-
LOG: addExtraFxs(level >= _Logger.INFO, this.wrapLog(console.log, config)),
|
|
255
|
-
DEBUG: addExtraFxs(level >= _Logger.DEBUG, this.wrapLog(console.log, { ...config, dim: config.dimDebugOnServer })),
|
|
256
|
-
// not using console.debug as that requires dev tools verbose to be enabled
|
|
257
|
-
VERBOSE: addExtraFxs(level >= _Logger.VERBOSE, this.wrapLog(console.debug, { ...config, dim: config.dimDebugOnServer }))
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
static wrapLog(logFunc, config) {
|
|
261
|
-
if (!import_browser_or_node.isNode) {
|
|
262
|
-
const fixedArgs = [];
|
|
263
|
-
if (config.time || config.delta) {
|
|
264
|
-
const isChrome = import_browser_or_node.isBrowser && navigator.userAgent.includes("Chrome");
|
|
265
|
-
const p = isChrome ? ["", _Logger.timeStr(!!config.time, !!config.delta)] : [];
|
|
266
|
-
fixedArgs.push(...p);
|
|
267
|
-
}
|
|
268
|
-
if (config.prefix) {
|
|
269
|
-
if (formattersEnabled)
|
|
270
|
-
fixedArgs.push(new Style("dim", config.prefix));
|
|
271
|
-
else
|
|
272
|
-
fixedArgs.push(config.prefix);
|
|
273
|
-
}
|
|
274
|
-
return logFunc.bind(console, ...fixedArgs);
|
|
275
|
-
} else {
|
|
276
|
-
return logFunc.bind(console);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
// static log(msg, logPerformance = true) {
|
|
280
|
-
// const p = this.perf();
|
|
281
|
-
// return logPerformance ? `${p} ${msg}` : msg;
|
|
282
|
-
// }
|
|
283
|
-
static timeStr(time, delta, returnAsString = 0) {
|
|
284
|
-
if (!performance.now)
|
|
285
|
-
return void 0;
|
|
286
|
-
const now = performance.now();
|
|
287
|
-
if (!_Logger.firstLog) {
|
|
288
|
-
_Logger.firstLog = now;
|
|
289
|
-
_Logger.lastLog = now;
|
|
290
|
-
}
|
|
291
|
-
const p = new LoggerTime(now - _Logger.firstLog, now - _Logger.lastLog, time, delta);
|
|
292
|
-
_Logger.lastLog = now;
|
|
293
|
-
return returnAsString ? p.toString() : p;
|
|
294
|
-
}
|
|
295
|
-
// (for nodejs) ~ https://stackoverflow.com/a/47296370/1633985
|
|
296
|
-
static getOriginFromStack(stack) {
|
|
297
|
-
let skippedFirst = false;
|
|
298
|
-
for (const line of stack.split("\n")) {
|
|
299
|
-
const matches = line.match(/^\s+at\s+(.*)/);
|
|
300
|
-
if (matches) {
|
|
301
|
-
if (skippedFirst) {
|
|
302
|
-
return matches[1].trim().replace(__dirname, "");
|
|
303
|
-
}
|
|
304
|
-
skippedFirst = true;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
};
|
|
309
|
-
var Logger = _Logger;
|
|
310
|
-
__publicField(Logger, "ERROR", 2);
|
|
311
|
-
__publicField(Logger, "WARN", 4);
|
|
312
|
-
__publicField(Logger, "INFO", 6);
|
|
313
|
-
__publicField(Logger, "LOG", 6);
|
|
314
|
-
__publicField(Logger, "DEBUG", 8);
|
|
315
|
-
__publicField(Logger, "VERBOSE", 10);
|
|
316
|
-
__publicField(Logger, "firstLog", 0);
|
|
317
|
-
__publicField(Logger, "lastLog", 0);
|
|
318
|
-
if (import_browser_or_node.isBrowser) {
|
|
319
|
-
window.devtoolsFormatters = window.devtoolsFormatters ?? [];
|
|
320
|
-
window.devtoolsFormatters.push(
|
|
321
|
-
{
|
|
322
|
-
// Custom formatters
|
|
323
|
-
header: (obj) => {
|
|
324
|
-
if (StringFormatters && StringFormatters.length) {
|
|
325
|
-
for (const formatter of StringFormatters) {
|
|
326
|
-
if (formatter.match(obj))
|
|
327
|
-
return ["span", {}, formatter.format(obj)];
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
return null;
|
|
331
|
-
},
|
|
332
|
-
hasBody: () => true
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
// Performance object //
|
|
336
|
-
// This is a sneaky way to show performance info withouth any extra calls when logging:
|
|
337
|
-
// LOG(`...`)
|
|
338
|
-
// it would work without this if we would have some way to intercept the call:
|
|
339
|
-
// L.INFO('...') - a getter on L that adds the current time as prefix
|
|
340
|
-
// LOG('...')() - returns the log function with all argumends bound
|
|
341
|
-
// But instead we are adding a custom formatter that replaced the placeholder object of class P with the performance info
|
|
342
|
-
header: (obj) => {
|
|
343
|
-
if (!(obj instanceof LoggerTime))
|
|
344
|
-
return null;
|
|
345
|
-
if (!formattersEnabled)
|
|
346
|
-
formattersEnabled = true;
|
|
347
|
-
const p = Logger.timeStr(obj.time, obj.delta);
|
|
348
|
-
return [
|
|
349
|
-
"span",
|
|
350
|
-
{ style: "font-weight: light; color: grey" },
|
|
351
|
-
p?.toString()
|
|
352
|
-
// ['a', { href: 'vscodium://file/home/manu/dev/tamera/bookr/imports/lib/utils/Logger.js' }, 'WOW'],
|
|
353
|
-
];
|
|
354
|
-
},
|
|
355
|
-
hasBody: () => false
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
// Style object
|
|
359
|
-
header: (obj) => {
|
|
360
|
-
if (!(obj instanceof Style))
|
|
361
|
-
return null;
|
|
362
|
-
if (!formattersEnabled)
|
|
363
|
-
formattersEnabled = true;
|
|
364
|
-
return ["span", {
|
|
365
|
-
style: "font-weight: light; color: grey; "
|
|
366
|
-
/* font-style: italic; */
|
|
367
|
-
}, obj.string];
|
|
368
|
-
},
|
|
369
|
-
hasBody: () => false
|
|
370
|
-
}
|
|
371
|
-
);
|
|
372
|
-
} else if (import_browser_or_node.isNode) {
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
// src/retrieve.ts
|
|
376
|
-
var { WARN, LOG, DEBUG, VERBOSE, ERROR } = Logger.setup(Logger.DEBUG);
|
|
377
|
-
//# sourceMappingURL=chunk-GDLMANLT.min.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils.ts"],"sourcesContent":["// import * as W3Name from 'w3name'\n\nexport const parseW3Name = () => {\n\tthrow new Error(`pls no parseW3Name`)\n} // HACK: W3Name.parse\n"],"mappings":";AAEO,IAAM,cAAc,MAAM;AAChC,QAAM,IAAI,MAAM,oBAAoB;AACrC;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/.pnpm/besonders-logger@1.0.0-RC11_3myifxmc6j23mthq5k5h6wvx4a/node_modules/.pnpm/browser-or-node@2.1.1/node_modules/browser-or-node/lib/index.js","../../../../node_modules/.pnpm/besonders-logger@1.0.0-RC11_3myifxmc6j23mthq5k5h6wvx4a/node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js","../../../../node_modules/.pnpm/besonders-logger@1.0.0-RC11_3myifxmc6j23mthq5k5h6wvx4a/node_modules/besonders-logger/src/lib/logger.ts","../src/retrieve.ts"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\";\n\nvar isNode = typeof process !== \"undefined\" && process.versions != null && process.versions.node != null;\n\nvar isWebWorker = (typeof self === \"undefined\" ? \"undefined\" : _typeof(self)) === \"object\" && self.constructor && self.constructor.name === \"DedicatedWorkerGlobalScope\";\n\n/**\n * @see https://github.com/jsdom/jsdom/releases/tag/12.0.0\n * @see https://github.com/jsdom/jsdom/issues/1537\n */\nvar isJsDom = typeof window !== \"undefined\" && window.name === \"nodejs\" || typeof navigator !== \"undefined\" && (navigator.userAgent.includes(\"Node.js\") || navigator.userAgent.includes(\"jsdom\"));\n\nvar isDeno = typeof Deno !== \"undefined\" && typeof Deno.version !== \"undefined\" && typeof Deno.version.deno !== \"undefined\";\n\nexports.isBrowser = isBrowser;\nexports.isWebWorker = isWebWorker;\nexports.isNode = isNode;\nexports.isJsDom = isJsDom;\nexports.isDeno = isDeno;","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","import { isBrowser, isNode } from 'browser-or-node'\nimport stringify from 'fast-json-stable-stringify'\n\n////////////\n// CONFIG //\n////////////\n\n//(i) disabled by default bc. the detection logic has disappeared after the refactor.\n//TODO: Find it and check if it works\nlet TIME_PREFIX_ENABLED = false\nlet PERFORMANCE_PREFIX_ENABLED = false\nif (isNode) {\n // console.debug('isNode checking', { process })\n if (process?.env?.LOGGER_TIME_PREFIX) TIME_PREFIX_ENABLED = process?.env?.LOGGER_TIME_PREFIX === 'true'\n if (process?.env?.LOGGER_PERF_PREFIX) PERFORMANCE_PREFIX_ENABLED = process?.env?.LOGGER_PERF_PREFIX === 'true'\n}\nconst DEFAULT_CONFIG = Object.freeze({\n prefix: undefined as string | undefined,\n time: TIME_PREFIX_ENABLED,\n delta: PERFORMANCE_PREFIX_ENABLED,\n dimDebugOnServer: true,\n printOriginOnServer: true,\n serverInspectOptions: {},\n customFormattersOnServer: true,\n // Depth of stacktrace to show on server\n // - integer saying how many lines\n // - false to disable, true for all\n printStackLinesOnServer: false as boolean | number,\n dim: true,\n})\n\nexport type Config = Partial<typeof DEFAULT_CONFIG>\nexport type ConsoleFx = (...data: any[]) => void\nexport const StringFormatters = [\n // Format to string (Client console - currently not on server)\n // {\n // match: obj => obj instanceof Model,\n // format: m => {\n // const { displayName } = m\n // return `${m.constructor.name}#${m.ID}${displayName ? `{${displayName}}` : ''}`\n // },\n // },\n] as unknown as {\n match: (obj: any) => boolean\n format: (m: any) => string\n}[]\n\n// let applyCustomFormatters;\n// applyCustomFormatters = (value, config) => {\n// for (const formatter of StringFormatters) {\n// if (formatter.match(value)) return formatter.format(value);\n// }\n// if (!_.isString(value)) {\n// return util.inspect(value, config.inspectOptionsOnServer);\n// }\n// return value;\n// };\n\n/// ////////////////\n// RUNTIME STUFF //\n/// ////////////////\n\nexport class LoggerTime {\n sinceFirst = 0\n sinceLast = 0\n time = false\n delta = false\n constructor(sinceFirst: number, sinceLast: number, time: boolean, delta: boolean) {\n Object.assign(this, { sinceFirst, sinceLast, time, delta })\n }\n\n toString() {\n const sinceFirstNum = (this.sinceFirst * 0.001)\n const sinceFirst = sinceFirstNum.toFixed(sinceFirstNum < 5 ? 2 : 1) /* .padStart(3, ' ') */\n const sinceLast\n = this.sinceLast < 1000 // when >= 1s, format as seconds\n ? `${this.sinceLast.toFixed(0)}`.padStart(5, ' ')\n : `${`${(this.sinceLast * 0.001).toFixed(this.sinceLast < 10000 ? 1 : 0)}`.padStart(4, ' ')}s`\n return `[${[this.time ? sinceFirst : null, this.delta ? sinceLast : null].join(',')}]`\n }\n}\n\nexport class Style {\n constructor(style: string, string: string) {\n Object.assign(this, { style, string })\n }\n}\nlet formattersEnabled = false // for tracking if chrome formatters are enabled (don't change manually)\n\nexport class Logger {\n static ERROR = 2 as const\n static WARN = 4 as const\n static INFO = 6 as const // alias for LOG\n static LOG = 6 as const\n static DEBUG = 8 as const\n static VERBOSE = 10 as const\n\n static firstLog = 0\n static lastLog = 0\n\n /**\n * This is a clever way to log without the extra check on each log line.\n * Use it like this:\n * ```\n * const { WARN, LOG, DEBUG, VERBOSE } = Logger.setup(Logger.INFO); // eslint-disable-line no-unused-vars\n * LOG('message', data);\n * DEBUG(this.collectionName, '...')\n * if (!VERBOSE.isDisabled) {\n * const verboseStuff = generateVerboseStuff(); // computationally intensive\n * VERBOSE('Here it is:', verboseStuff)\n * }\n * ```\n *\n * @ param {number} level See {@link LVs}\n * @ param {object} config see DEFAULT_CONFIG\n * @ typedef {Function & {isDisabled: boolean, isEnabled: boolean, ...}} LogFunc\n * @ returns {{LOG: LogFunc, VERBOSE: LogFunc, DEBUG: LogFunc, WARN: LogFunc, ERROR: LogFunc}}\n */\n static setup(level: 2 | 4 | 6 | 8 | 10 = Logger.INFO, config: Config = {}) {\n config = Object.assign({}, DEFAULT_CONFIG, config) // defaults(config, DEFAULT_CONFIG) // fyi this is like the reverse of Object.assign\n if (level > 10) console.debug('setup logger', { config }) // manual overide to level:11 to show this trace\n\n const debugLogForStub = this.wrapLog(console.debug, { ...config, dim: config.dimDebugOnServer })\n const stub = (...args: any[]) => {\n // @ts-expect-error hack to enable DEBUG logging EVERYWHERE\n if (window?.FORCE_DISABLE_LOGLEVEL)\n debugLogForStub(...args)\n } // For disabled log-levels, we just return a stub function\n stub.isDisabled = true // this makes it possible to check, e.g. `DEBUG.isDisabled`\n stub.isEnabled = false // depending on syntactic preference\n const groupCollapsed = this.wrapLog(console.groupCollapsed, config)\n\n const addExtraFxs = (enabled: boolean, func: (...T: any) => void) =>/* : ((...T) => void & {isDisabled: boolean}) */ {\n // warning - weird TS hacks approaching:\n function group<T extends Func>(\n ...args: [...any[], T]\n ): ReturnType<T> extends Promise<any> ? Promise<ReturnType<T>> : ReturnType<T> {\n const functionToWrap = args[args.length - 1] as T\n\n if (functionToWrap as Func === stub)\n return functionToWrap() as ReturnType<T>\n\n groupCollapsed(...args.slice(0, -1)) // except last\n\n const asyncWrapper = async () => {\n try {\n const result = functionToWrap()\n return result instanceof Promise ? await result : result\n } finally {\n console.groupEnd()\n }\n }\n\n return asyncWrapper() as ReturnType<T> // Cast to bypass the Promise type inference\n }\n\n const realFunc = Object.assign(\n func.bind({}), // clone function - https://stackoverflow.com/a/6772648\n {\n isEnabled: enabled,\n isDisabled: !enabled,\n group,\n force: func,\n },\n )\n if (enabled) {\n return realFunc\n } else {\n return Object.assign(\n stub.bind({}), // clone stub function - https://stackoverflow.com/a/6772648\n {\n isEnabled: enabled,\n isDisabled: !enabled,\n group,\n force: realFunc,\n },\n )\n }\n }\n\n const ERRFX = addExtraFxs(level >= Logger.ERROR, this.wrapLog(console.error, config))\n const ERROR = (...params: any[]) => {\n ERRFX(...params)\n return new Error(stringify(params)) // return so we can throw it, stringify is fast & safe with circular references\n }\n\n // console.debug(\"Logger init:\", config)\n return {\n ERROR,\n WARN: addExtraFxs(level >= Logger.WARN, this.wrapLog(console.warn, config)),\n LOG: addExtraFxs(level >= Logger.INFO, this.wrapLog(console.log, config)),\n DEBUG: addExtraFxs(level >= Logger.DEBUG, this.wrapLog(console.log, { ...config, dim: config.dimDebugOnServer })), // not using console.debug as that requires dev tools verbose to be enabled\n VERBOSE: addExtraFxs(level >= Logger.VERBOSE, this.wrapLog(console.debug, { ...config, dim: config.dimDebugOnServer })),\n }\n }\n\n static wrapLog(logFunc: ConsoleFx, config: Config) {\n if (!isNode) {\n // ℹ In browser we can only do some of the fancy things, because we cannot call console.log ourselves,\n // as that would pollute the stacktrace\n\n // ℹ Would be nice to get formtted links in devtools, but <a> tags are not allowed:\n // const stack = new Error().stack;\n // const origin = Logger.getOriginFromStack(stack);\n // const originFilename = origin.split('\\\\').pop().split('/').pop(); // eslint-disable-line\n // if (origin) fixedArgs.push({ link: originFilename, href: `http://localhost:63342/api/file/${origin}` });\n\n // on the client, we need to return the original log function, as otherwise the origin of the log is set to here\n // But luckily we can bind fixed parameters on the function:\n const fixedArgs = []\n // if the custom formatters are enabled, and we want performance logging - we add an instance of P as a static prefix\n if (config.time || config.delta) {\n const isChrome = isBrowser && navigator.userAgent.includes('Chrome')\n\n const p = isChrome\n ? ['', Logger.timeStr(!!config.time, !!config.delta)] // this is a placeholder that gets replaced by the custom formatter\n : [] // [{ get perfNiceTry () { return Logger.timeStr(,,true) } }] // this (of course) shows the time when you click the getter\n fixedArgs.push(...p) // if we start with a non-string, all strings are rendered with quotes :/\n }\n if (config.prefix) {\n if (formattersEnabled)\n fixedArgs.push(new Style('dim', config.prefix))\n else fixedArgs.push(config.prefix)\n }\n // console.log('logger-log', { config, fixedArgs })\n return logFunc.bind(console, ...fixedArgs)\n } else {\n // ℹ in nodejs we print the stack trace origin ourselves, so we can do a lot more things\n // TODO: re-import removed code - https://gitlab.com/onezoomin/ztax/ztax/-/commit/f6f9bde617cd9ae93d1bc4bc49a4b5275e4cbff2#b1d1e091ca27ae560becf7ae1b27a4d53d39c061\n return logFunc.bind(console)\n }\n }\n\n // static log(msg, logPerformance = true) {\n // const p = this.perf();\n // return logPerformance ? `${p} ${msg}` : msg;\n // }\n\n static timeStr(time: boolean, delta: boolean, returnAsString = 0): LoggerTime | string | undefined {\n if (!performance.now)\n return undefined // TODO: server? p = { now: require('performance-now') };\n const now = performance.now()\n if (!Logger.firstLog) {\n Logger.firstLog = now\n Logger.lastLog = now\n }\n const p = new LoggerTime(now - Logger.firstLog, now - Logger.lastLog, time, delta)\n Logger.lastLog = now\n return returnAsString ? p.toString() : p\n }\n\n // (for nodejs) ~ https://stackoverflow.com/a/47296370/1633985\n static getOriginFromStack(stack: any): string | undefined {\n let skippedFirst = false // the first one is Logger.js\n for (const line of stack.split('\\n')) {\n const matches = line.match(/^\\s+at\\s+(.*)/)\n if (matches) {\n if (skippedFirst) {\n // first line - current function\n // second line - caller (what we are looking for)\n return (\n matches[1]\n .trim() // Removes spaces\n // .replace(/^module /, '') // Removes 'module ' at beginning\n // .replace(/^at /, '') // Removes 'at ' at beginning\n // .replace(/^ \\(/, '') // Removes parentheseses around file\n // .replace(/\\)$/, '') // -||-\n .replace(__dirname, '') // Removes script folder path (if exists)\n )\n }\n skippedFirst = true\n }\n }\n }\n}\n\nif (isBrowser) { // isBrowser is not true for web workers\n // CLIENT or Worker //\n\n // @ts-expect-error window hack\n window.devtoolsFormatters = window.devtoolsFormatters ?? []\n // noinspection JSUnusedGlobalSymbols\n // @ts-expect-error window hack\n window.devtoolsFormatters.push(\n {\n // Custom formatters\n header: (obj: any) => {\n if (StringFormatters && StringFormatters.length) {\n for (const formatter of StringFormatters) {\n if (formatter.match(obj))\n return ['span', {}, formatter.format(obj)]\n }\n }\n return null\n },\n hasBody: () => true,\n },\n {\n // Performance object //\n // This is a sneaky way to show performance info withouth any extra calls when logging:\n // LOG(`...`)\n // it would work without this if we would have some way to intercept the call:\n // L.INFO('...') - a getter on L that adds the current time as prefix\n // LOG('...')() - returns the log function with all argumends bound\n // But instead we are adding a custom formatter that replaced the placeholder object of class P with the performance info\n header: (obj: any) => {\n if (!(obj instanceof LoggerTime))\n return null\n if (!formattersEnabled)\n formattersEnabled = true\n const p = Logger.timeStr(obj.time, obj.delta)\n return [\n 'span',\n { style: 'font-weight: light; color: grey' },\n p?.toString(),\n // ['a', { href: 'vscodium://file/home/manu/dev/tamera/bookr/imports/lib/utils/Logger.js' }, 'WOW'],\n ]\n },\n hasBody: () => false,\n },\n {\n // Style object\n header: (obj: { string: any }) => {\n if (!(obj instanceof Style))\n return null\n if (!formattersEnabled)\n formattersEnabled = true\n return ['span', { style: 'font-weight: light; color: grey; '/* font-style: italic; */ }, obj.string]\n },\n hasBody: () => false,\n },\n )\n}\nelse if (isNode) {\n // SERVER //\n // node stuff removed as it breaks/bloats webworker build\n}\n\nexport function logriniTest(): string {\n return 'logrini'\n}\n\ntype Func<T = any> = () => T\n","import { CarReader } from '@ipld/car'\n// import { create } from '@web3-storage/w3up-client'\nimport { Applog, CidString, sortApplogsByTs } from '@wovin/core/applog'\nimport { decodeCarToApplogs } from '@wovin/core/ipfs'\nimport { Logger } from 'besonders-logger'\nimport { CID } from 'multiformats/cid'\n// import * as W3Name from 'w3name'\nimport { ApplogStreamInMemory } from '@wovin/core/stream'\n\nconst { WARN, LOG, DEBUG, VERBOSE, ERROR } = Logger.setup(Logger.DEBUG) // eslint-disable-line no-unused-vars\n\n// let w3sReadonly: Web3Storage = new Web3Storage({ token: 'FAKE' })\n// const client = await create()\n\n// const GATEWAYS = [\n// \t'https://cloudflare-ipfs.com/ipfs/CID/?format=car&dag-scope=all',\n// \t// \"https://cloudflare-ipfs.com/ipfs/CID/?format=car&dag-scope=block\",\n// \t// \"https://cloudflare-ipfs.com/ipfs/CID/?format=car&dag-scope=entity\",\n// \t'https://CID.ipfs.dweb.link/?format=car&dag-scope=all',\n// \t'https://CID.ipfs.dweb.link/?format=car&dag-scope=block',\n// \t'https://CID.ipfs.dweb.link/?format=car&dag-scope=entity',\n// \t'https://dweb.link/ipfs/CID/?format=car&dag-scope=all',\n// \t'https://dweb.link/ipfs/CID/?format=car&dag-scope=block',\n// \t'https://dweb.link/ipfs/CID/?format=car&dag-scope=entity',\n// \t'https://ipfs.4everland.io/ipfs/CID/?format=car&dag-scope=all',\n// \t'https://ipfs.4everland.io/ipfs/CID/?format=car&dag-scope=block',\n// \t'https://ipfs.4everland.io/ipfs/CID/?format=car&dag-scope=entity',\n// \t'https://ipfs.io/ipfs/CID/?format=car&dag-scope=all',\n// \t'https://ipfs.io/ipfs/CID/?format=car&dag-scope=block',\n// \t'https://ipfs.io/ipfs/CID/?format=car&dag-scope=entity',\n// ]\n\n// export async function retrievePubStream(\n// \tpubID: CidString,\n// \t{ readOnly = true, pinnedCID }: { readOnly?: boolean; pinnedCID?: CidString } = {},\n// ) {\n// \tlet cid: CID\n// \tif (pinnedCID) {\n// \t\tcid = CID.parse(pinnedCID)\n// \t} else {\n// \t\ttry {\n// \t\t\tcid = await resolveIPNS(/* parseW3Name( */ pubID /* ) */)\n// \t\t\tDEBUG(`Resolved pub to CID`, cid.toString())\n// \t\t} catch (err) {\n// \t\t\tthrow ERROR(`Failed to resolve IPNS ${pubID}:`, err)\n// \t\t}\n// \t}\n// \tconst car = await retrieveCar(cid.toString())\n// \tconst { applogs: maybeEncrypted } = await decodeCarToApplogs(car)\n// \tconst encrypted = maybeEncrypted.filter(log => log instanceof Uint8Array) as Uint8Array[]\n// \tif (encrypted.length) WARN(`Found ${encrypted.length} encrypted logs - skipping`) // TODO: decryption\n// \tconst applogs = maybeEncrypted.filter(log => !(log instanceof Uint8Array)) as Applog[]\n// \tsortApplogsByTs(applogs)\n// \tconst dataStream = new ApplogStreamInMemory(applogs, [], `preview-${pubID}`, readOnly)\n// \treturn { cid, dataStream }\n// \t// return dataStream\n// }\n\n// export async function resolveIPNS(name: CidString /* W3Name.Name */): Promise<CID> {\n// \tconst response = await fetch(`https://name.web3.storage/name/${name}`)\n// \tconst result = await response.json()\n// \t// return result\n// \t// const revision = await W3Name.resolve(name)\n// \t// DEBUG('[w3name] resolved', name.toString(), 'to', revision)\n// \tif (!result.value.startsWith('/ipfs/')) {\n// \t\tconsole.warn('IPNS value is not ipfs:', result)\n// \t}\n// \treturn CID.parse(result.value.replace('/ipfs/', ''))\n// }\n\n// export async function retrieveCar(cid: CidString): Promise<CarReader> {\n// \t// Fetch the CAR file from web3.storage\n// \tDEBUG('Retrieving:', cid)\n// \t// const response = await w3sReadonly.get(cid)\n// \t// const response = await fetch(`https://saturn.ms/ipfs/${cid}?format=car&dag-scope=all`)\n// \tconst response = await fetch(`https://cloudflare-ipfs.com/ipfs/${cid}?format=car&dag-scope=all`) // HACK: w3s is broken\n// \tif (!response?.ok || !response?.body) {\n// \t\tthrow new Error(`unexpected response ${response?.statusText}`)\n// \t}\n\n// \t// The data is an AsyncIterable<Uint8Array>, convert it to an AsyncIterable for the CarReader\n// \tconst data: AsyncIterable<Uint8Array> = streamToIterable(response!.body.getReader())\n\n// \t// return a CarReader from the CAR data\n// \treturn await CarReader.fromIterable(data)\n// }\n\n// function streamToIterable(bodyReader: any): AsyncIterable<Uint8Array> {\n// \treturn (async function*() {\n// \t\twhile (true) {\n// \t\t\tconst { done, value } = await bodyReader.read()\n// \t\t\tif (done) {\n// \t\t\t\tbreak\n// \t\t\t}\n// \t\t\tyield value\n// \t\t}\n// \t})()\n// }\n"],"mappings":"2oBAAAA,EAAAC,EAAA,CAAA,2FAAAC,EAAA,CAAA,aAEA,OAAO,eAAeA,EAAS,aAAc,CAC3C,MAAO,EACT,CAAC,EAED,IAAIC,EAAU,OAAO,QAAW,YAAc,OAAO,OAAO,UAAa,SAAW,SAAUC,EAAK,CAAE,OAAO,OAAOA,CAAK,EAAI,SAAUA,EAAK,CAAE,OAAOA,GAAO,OAAO,QAAW,YAAcA,EAAI,cAAgB,QAAUA,IAAQ,OAAO,UAAY,SAAW,OAAOA,CAAK,EAEvQC,EAAY,OAAO,OAAW,KAAe,OAAO,OAAO,SAAa,IAExEC,EAAS,OAAO,QAAY,KAAe,QAAQ,UAAY,MAAQ,QAAQ,SAAS,MAAQ,KAEhGC,GAAe,OAAO,KAAS,IAAc,YAAcJ,EAAQ,IAAI,K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BC,EARWD,EAQJ,WAAW,CAAA,EAClBC,EATWD,EASJ,UAAU,CAAA,EAkLf1C,EAAA,WAIF,OAAO,mBAAqB,OAAO,oBAAsB,CAAC,EAG1D,OAAO,mBAAmB,KACxB,CAEE,OAASzB,GAAa,CACpB,GAAI+B,GAAoBA,EAAiB,QACvC,QAAWsC,KAAatC,EACtB,GAAIsC,EAAU,MAAMrE,CAAG,EACrB,MAAO,CAAC,OAAQ,CAAC,EAAGqE,EAAU,OAAOrE,CAAG,CAAC,EAG/C,OAAO,IACT,EACA,QAAS,IAAM,EACjB,EACA,CAQE,OAASA,GAAa,CACpB,GAAI,EAAEA,aAAegC,GACnB,OAAO,KACJS,IACHA,EAAoB,IACtB,IAAMmB,EAAIO,EAAO,QAAQnE,EAAI,KAAMA,EAAI,KAAK,EAC5C,MAAO,CACL,OACA,CAAE,MAAO,iCAAkC,EAC3C4D,GAAG,SAAS,CAEd,CACF,EACA,QAAS,IAAM,EACjB,EACA,CAEE,OAAS5D,GACDA,aAAesC,GAEhBG,IACHA,EAAoB,IACf,CAAC,OAAQ,CAAE,MAAO,mCAA6D,EAAGzC,EAAI,MAAM,GAH1F,KAKX,QAAS,IAAM,EACjB,CACF,GAEOyB,EAAA,OCpUT,GAAM,CAAE,KAAA6C,EAAM,IAAAC,EAAK,MAAAC,EAAO,QAAAC,EAAS,MAAAC,CAAM,EAAIC,EAAO,MAAMA,EAAO,KAAK","names":["require_lib","__commonJS","exports","_typeof","obj","isBrowser","isNode","isWebWorker","isJsDom","isDeno","require_fast_json_stable_stringify","module","data","opts","cycles","cmp","f","node","a","b","aobj","bobj","seen","stringify","out","seenIndex","keys","key","value","import_browser_or_node","__toESM","import_fast_json_stable_stringify","TIME_PREFIX_ENABLED","PERFORMANCE_PREFIX_ENABLED","DEFAULT_CONFIG","StringFormatters","LoggerTime","sinceFirst","sinceLast","time","delta","sinceFirstNum","Style","style","string","formattersEnabled","_Logger","level","config","debugLogForStub","stub","args","groupCollapsed","addExtraFxs","enabled","func","group","functionToWrap","result","realFunc","ERRFX","params","logFunc","fixedArgs","p","returnAsString","now","stack","skippedFirst","line","matches","Logger","__publicField","formatter","WARN","LOG","DEBUG","VERBOSE","ERROR","Logger"]}
|