diff --git a/Dockerfile b/Dockerfile index d828d57a..777ef672 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,7 @@ ENV NODE_ENV=production # We will only use the node_modules folder from this step COPY package.json package-lock.json ./ +COPY patches/ ./patches/ RUN apk add --no-cache --virtual .gyp python3 make g++ &&\ npm ci --only=production @@ -50,6 +51,7 @@ COPY --from=builder /usr/src/app/dist/ ./dist/ COPY --from=builder /usr/src/app/dist-scripts/ ./dist-scripts/ COPY --from=deps /usr/src/app/node_modules/ ./node_modules/ COPY --from=deps /usr/src/app/package.json ./ +COPY lavamoat/ ./lavamoat/ COPY Makefile ./ # Install the process supervisor @@ -57,4 +59,4 @@ RUN apk add --no-cache dumb-init make &&\ rm -rf /tmp/* /var/cache/apk/* EXPOSE 8000 -ENTRYPOINT ["dumb-init", "node", "dist/index.js"] +ENTRYPOINT ["dumb-init", "./node_modules/.bin/lavamoat", "dist/index.js"] diff --git a/__tests__/helpers/wallet.helper.test.js b/__tests__/helpers/wallet.helper.test.js new file mode 100644 index 00000000..024a0c46 --- /dev/null +++ b/__tests__/helpers/wallet.helper.test.js @@ -0,0 +1,49 @@ +/** + * Copyright (c) Hathor Labs and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import { getWalletConfigFromSeed } from '../../src/helpers/wallet.helper'; +import { WalletStartError } from '../../src/errors'; +import * as loggerModule from '../../src/logger'; + +const STUB_SEED = 'upon tennis increase embark dismiss diamond monitor face magnet jungle scout salute rural master shoulder cry juice jeans radar present close meat antenna mind'; + +describe('getWalletConfigFromSeed', () => { + it('should return a wallet config for a valid seed', () => { + const config = getWalletConfigFromSeed({ seed: STUB_SEED }); + expect(config).toHaveProperty('seed'); + expect(config).toHaveProperty('password'); + expect(config).toHaveProperty('pinCode'); + }); + + it('should throw WalletStartError for an invalid seed', () => { + expect(() => getWalletConfigFromSeed({ seed: 'invalid seed words' })).toThrow(WalletStartError); + }); + + it('should throw WalletStartError when passphrase is provided but not allowed', () => { + const mockError = jest.fn(); + jest.spyOn(loggerModule, 'buildAppLogger').mockReturnValue({ error: mockError }); + + expect(() => getWalletConfigFromSeed({ + seed: STUB_SEED, + passphrase: 'my-passphrase', + allowPassphrase: false, + })).toThrow(WalletStartError); + + expect(mockError).toHaveBeenCalledWith( + expect.stringContaining('passphrase is not allowed') + ); + }); + + it('should set passphrase when allowed', () => { + const config = getWalletConfigFromSeed({ + seed: STUB_SEED, + passphrase: 'my-passphrase', + allowPassphrase: true, + }); + expect(config.passphrase).toBe('my-passphrase'); + }); +}); diff --git a/__tests__/plugins/child.test.js b/__tests__/plugins/child.test.js index 53cf71f2..b4de1e5b 100644 --- a/__tests__/plugins/child.test.js +++ b/__tests__/plugins/child.test.js @@ -1,6 +1,7 @@ import { bigIntUtils } from '@hathor/wallet-lib'; -import { handleMessage } from '../../src/plugins/child'; +import { handleMessage, loadPlugins } from '../../src/plugins/child'; import { notificationBus, EVENTBUS_EVENT_NAME } from '../../src/services/notification.service'; +import * as loggerModule from '../../src/logger'; jest.mock('../../src/services/notification.service', () => ({ notificationBus: { @@ -9,6 +10,34 @@ jest.mock('../../src/services/notification.service', () => ({ EVENTBUS_EVENT_NAME: 'eventbus_event', })); +describe('loadPlugins', () => { + it('should warn and skip unknown plugins', async () => { + const mockWarn = jest.fn(); + jest.spyOn(loggerModule, 'buildAppLogger').mockReturnValue({ warn: mockWarn }); + + const plugins = await loadPlugins(['nonexistent_plugin'], {}); + + expect(mockWarn).toHaveBeenCalledWith('Unable to find plugin nonexistent_plugin, skipping.'); + expect(plugins).toEqual([]); + }); + + it('should load known hathor plugins', async () => { + const plugins = await loadPlugins(['debug'], {}); + + expect(plugins).toHaveLength(1); + expect(plugins[0]).toHaveProperty('eventHandler'); + }); + + it('should load custom plugins from config', async () => { + const plugins = await loadPlugins(['my_plugin'], { + my_plugin: { name: 'debug', file: 'hathor_debug.js' }, + }); + + expect(plugins).toHaveLength(1); + expect(plugins[0]).toHaveProperty('eventHandler'); + }); +}); + describe('handleMessage', () => { afterEach(() => { jest.clearAllMocks(); diff --git a/__tests__/plugins/debug_plugin.test.js b/__tests__/plugins/debug_plugin.test.js index 8b49617a..a51fbc05 100644 --- a/__tests__/plugins/debug_plugin.test.js +++ b/__tests__/plugins/debug_plugin.test.js @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import { bigIntUtils } from '@hathor/wallet-lib'; import { eventHandler, getSettings } from '../../src/plugins/hathor_debug'; +import * as logger from '../../src/logger'; test('settings', () => { const oldArgs = process.argv; @@ -27,10 +27,11 @@ test('settings', () => { test('event handler', () => { const oldArgs = process.argv; - const logSpy = jest.spyOn(console, 'log'); - const smallMsg = { type: 'small', walletId: 'default', foo: 'bar', bigInt: BigInt(Number.MAX_SAFE_INTEGER) + 1n }; + const mockLoggerInfo = jest.fn(); + const buildAppLoggerSpy = jest.spyOn(logger, 'buildAppLogger').mockReturnValue({ info: mockLoggerInfo }); + const smallMsg = { type: 'small', walletId: 'default', foo: 'bar' }; const bigMsg = { type: 'big', walletId: 'default' }; - const bigCompleteMsg = { ...bigMsg, message: '', bigInt: BigInt(Number.MAX_SAFE_INTEGER) + 1n }; + const bigCompleteMsg = { ...bigMsg, message: '' }; for (let i = 0; i < 200; i++) { // 200 * 'aaaaa'(length of 5) -> lenght of 1000 bigCompleteMsg.message += 'aaaaa'; @@ -46,14 +47,14 @@ test('event handler', () => { '--plugin_debug_long', 'off', ]; getSettings(); // set debugLong value - logSpy.mockReset(); + mockLoggerInfo.mockReset(); // small message: always log eventHandler(smallMsg); - expect(logSpy).toHaveBeenCalledWith(toDebugMessage(bigIntUtils.JSONBigInt.stringify(smallMsg))); - logSpy.mockReset(); + expect(mockLoggerInfo).toHaveBeenCalledWith(toDebugMessage(JSON.stringify(smallMsg))); + mockLoggerInfo.mockReset(); // big message: should not log eventHandler(bigCompleteMsg); - expect(logSpy).not.toHaveBeenCalled(); + expect(mockLoggerInfo).not.toHaveBeenCalled(); // debugLong: all process.argv = [ @@ -61,15 +62,15 @@ test('event handler', () => { '--plugin_debug_long', 'all', ]; getSettings(); // set debugLong value - logSpy.mockReset(); + mockLoggerInfo.mockReset(); // small message: always log eventHandler(smallMsg); - expect(logSpy).toHaveBeenCalledWith(toDebugMessage(bigIntUtils.JSONBigInt.stringify(smallMsg))); - logSpy.mockReset(); + expect(mockLoggerInfo).toHaveBeenCalledWith(toDebugMessage(JSON.stringify(smallMsg))); + mockLoggerInfo.mockReset(); // big message: should log the entire message eventHandler(bigCompleteMsg); - expect(logSpy).toHaveBeenCalledWith( - toDebugMessage(bigIntUtils.JSONBigInt.stringify(bigCompleteMsg)) + expect(mockLoggerInfo).toHaveBeenCalledWith( + toDebugMessage(JSON.stringify(bigCompleteMsg)) ); // debugLong: unexpected value @@ -78,30 +79,30 @@ test('event handler', () => { '--plugin_debug_long', 'any-unexpected-value', ]; getSettings(); // set debugLong value - logSpy.mockReset(); + mockLoggerInfo.mockReset(); // small message: always log eventHandler(smallMsg); - expect(logSpy).toHaveBeenCalledWith(toDebugMessage(bigIntUtils.JSONBigInt.stringify(smallMsg))); - logSpy.mockReset(); + expect(mockLoggerInfo).toHaveBeenCalledWith(toDebugMessage(JSON.stringify(smallMsg))); + mockLoggerInfo.mockReset(); // big message: should log partially eventHandler(bigCompleteMsg); - expect(logSpy).toHaveBeenCalledWith(toDebugMessage(bigIntUtils.JSONBigInt.stringify(bigMsg))); + expect(mockLoggerInfo).toHaveBeenCalledWith(toDebugMessage(JSON.stringify(bigMsg))); // debugLong: default (should be the same as unexpected) process.argv = [ 'node', 'a_script_file.js', // not used but a value is required ]; getSettings(); // set debugLong value - logSpy.mockReset(); + mockLoggerInfo.mockReset(); // small message: always log eventHandler(smallMsg); - expect(logSpy).toHaveBeenCalledWith(toDebugMessage(bigIntUtils.JSONBigInt.stringify(smallMsg))); - logSpy.mockReset(); + expect(mockLoggerInfo).toHaveBeenCalledWith(toDebugMessage(JSON.stringify(smallMsg))); + mockLoggerInfo.mockReset(); // big message: should log partially eventHandler(bigCompleteMsg); - expect(logSpy).toHaveBeenCalledWith(toDebugMessage(bigIntUtils.JSONBigInt.stringify(bigMsg))); + expect(mockLoggerInfo).toHaveBeenCalledWith(toDebugMessage(JSON.stringify(bigMsg))); // Restore original argv state process.argv = oldArgs; - logSpy.mockRestore(); + buildAppLoggerSpy.mockRestore(); }); diff --git a/__tests__/plugins/sqs_plugin.test.js b/__tests__/plugins/sqs_plugin.test.js index 56b8139b..5a8a5d25 100644 --- a/__tests__/plugins/sqs_plugin.test.js +++ b/__tests__/plugins/sqs_plugin.test.js @@ -56,3 +56,22 @@ test('event handler', () => { MessageBody: bigIntUtils.JSONBigInt.stringify(data), }, expect.anything()); }); + +test('event handler logs error on SQS failure', () => { + const mockError = jest.fn(); + // eslint-disable-next-line global-require + const loggerModule = require('../../src/logger'); + jest.spyOn(loggerModule, 'buildAppLogger').mockReturnValue({ error: mockError }); + + const sqsMock = { + sendMessage: jest.fn((params, cb) => cb(new Error('SQS send failed'))), + }; + const mockedSettings = { queueUrl: 'test-queue' }; + const evHandler = eventHandlerFactory(sqsMock, mockedSettings); + + evHandler({ test: 'event' }); + + expect(mockError).toHaveBeenCalledWith( + expect.stringContaining('plugin[sqs] error sending to sqs:') + ); +}); diff --git a/__tests__/plugins/ws_plugin.test.js b/__tests__/plugins/ws_plugin.test.js index 9828ba6b..20dd4c28 100644 --- a/__tests__/plugins/ws_plugin.test.js +++ b/__tests__/plugins/ws_plugin.test.js @@ -7,6 +7,20 @@ import { bigIntUtils } from '@hathor/wallet-lib'; import { getSockets, eventHandler, connectionHandler, getSettings } from '../../src/plugins/hathor_websocket'; +import * as loggerModule from '../../src/logger'; + +beforeEach(() => { + jest.spyOn(loggerModule, 'buildAppLogger').mockReturnValue({ + info: jest.fn(), + warn: jest.fn(), + error: jest.fn(), + debug: jest.fn(), + }); +}); + +afterEach(() => { + jest.restoreAllMocks(); +}); test('settings', () => { const oldArgs = process.argv; diff --git a/lavamoat/node/policy-override.json b/lavamoat/node/policy-override.json new file mode 100644 index 00000000..5e716028 --- /dev/null +++ b/lavamoat/node/policy-override.json @@ -0,0 +1,41 @@ +{ + "resources": { + "depd": { + "globals": { + "Error.prepareStackTrace": "write", + "Error.captureStackTrace": true, + "Error.stackTraceLimit": "write" + } + }, + + "axios": { + "globals": { + "document": false, + "importScripts": false, + "location.href": false, + "navigator": false, + "WorkerGlobalScope": false, + "XMLHttpRequest": false + } + }, + + "morgan>debug": { + "globals": { + "chrome": false, + "document": false, + "localStorage": false, + "navigator": false + } + }, + + "winston": { + "builtin": { + "http": false, + "https": false + }, + "globals": { + "process.exit": false + } + } + } +} diff --git a/lavamoat/node/policy.json b/lavamoat/node/policy.json new file mode 100644 index 00000000..263faca2 --- /dev/null +++ b/lavamoat/node/policy.json @@ -0,0 +1,1154 @@ +{ + "resources": { + "winston>@colors/colors": { + "builtin": { + "os.release": true, + "util.inspect": true + }, + "globals": { + "console.log": true, + "process.argv": true, + "process.env": true, + "process.platform": true, + "process.stderr": true, + "process.stdout": true, + "process.versions.node.split": true + } + }, + "winston>@dabh/diagnostics": { + "builtin": { + "tty.isatty": true + }, + "globals": { + "console": true, + "process.env.DEBUG": true, + "process.env.DIAGNOSTICS": true, + "process.env.NODE_ENV": true + }, + "packages": { + "winston>@dabh/diagnostics>colorspace": true, + "winston>@dabh/diagnostics>enabled": true, + "winston>@dabh/diagnostics>kuler": true + } + }, + "@dinamonetworks/hsm-dinamo": { + "builtin": { + "crypto": true, + "fs": true, + "net": true, + "path": true, + "process": true, + "tls": true + }, + "globals": { + "Buffer.alloc": true, + "Buffer.concat": true, + "Buffer.from": true, + "atob": true, + "btoa": true + }, + "packages": { + "@dinamonetworks/hsm-dinamo>node-aes-cmac": true + } + }, + "@hathor/wallet-lib": { + "builtin": { + "assert": true, + "buffer": true, + "crypto": true, + "events": true, + "path": true, + "zlib": true + }, + "globals": { + "AbortController": true, + "Buffer.alloc": true, + "Buffer.concat": true, + "Buffer.from": true, + "Intl.NumberFormat": true, + "clearInterval": true, + "clearTimeout": true, + "console": true, + "setInterval": true, + "setTimeout": true + }, + "packages": { + "axios": true, + "@hathor/wallet-lib>bitcore-lib": true, + "@hathor/wallet-lib>bitcore-mnemonic": true, + "@hathor/wallet-lib>crypto-js": true, + "@hathor/wallet-lib>isomorphic-ws": true, + "lodash": true, + "@hathor/wallet-lib>queue-microtask": true, + "zod": true + } + }, + "express>accepts": { + "packages": { + "axios>form-data>mime-types": true, + "express>accepts>negotiator": true + } + }, + "winston>async": { + "globals": { + "process": true, + "queueMicrotask": true, + "setImmediate": true, + "setTimeout": true + } + }, + "axios>form-data>asynckit": { + "globals": { + "process": true, + "setImmediate": true, + "setTimeout": true + } + }, + "axios": { + "builtin": { + "events.EventEmitter": true, + "http": true, + "https": true, + "stream": true, + "url": true, + "util": true, + "zlib": true + }, + "globals": { + "AbortController": true, + "Blob": true, + "Buffer.alloc": true, + "Buffer.byteLength": true, + "Buffer.concat": true, + "Buffer.from": true, + "Buffer.isBuffer": true, + "FormData": true, + "ReadableStream": true, + "Request": true, + "Response": true, + "TextEncoder": true, + "URL": true, + "WorkerGlobalScope": true, + "XMLHttpRequest": true, + "btoa": true, + "clearTimeout": true, + "console.warn": true, + "document": true, + "fetch": true, + "importScripts": true, + "location.href": true, + "navigator": true, + "process": true, + "queueMicrotask": true, + "setImmediate": true, + "setTimeout": true + }, + "packages": { + "axios>follow-redirects": true, + "axios>form-data": true, + "axios>proxy-from-env": true + } + }, + "@hathor/wallet-lib>bitcore-lib>bs58>base-x": { + "packages": { + "morgan>basic-auth>safe-buffer": true + } + }, + "morgan>basic-auth": { + "packages": { + "morgan>basic-auth>safe-buffer": true + } + }, + "@hathor/wallet-lib>bitcore-lib": { + "builtin": { + "assert": true, + "buffer": true, + "crypto.createHash": true, + "crypto.randomBytes": true, + "url.format": true, + "url.parse": true + }, + "globals": { + "Buffer": true, + "SEQUENCE_LOCKTIME_DISABLE_FLAG": true, + "_bitcore": "write", + "console.error": true, + "crypto": true, + "msCrypto": true, + "process.browser": true + }, + "packages": { + "@hathor/wallet-lib>bitcore-lib>bech32": true, + "@hathor/wallet-lib>bitcore-lib>bn.js": true, + "@hathor/wallet-lib>bitcore-lib>bs58": true, + "@hathor/wallet-lib>bitcore-lib>buffer-compare": true, + "@hathor/wallet-lib>bitcore-lib>elliptic": true, + "@hathor/wallet-lib>bitcore-lib>inherits": true, + "lodash": true + } + }, + "@hathor/wallet-lib>bitcore-mnemonic": { + "builtin": { + "crypto.createHmac": true + }, + "globals": { + "Buffer.alloc": true, + "Buffer.from": true, + "Buffer.isBuffer": true + }, + "packages": { + "@hathor/wallet-lib>bitcore-lib": true, + "@hathor/wallet-lib>bitcore-mnemonic>unorm": true + } + }, + "@hathor/wallet-lib>bitcore-lib>bn.js": { + "builtin": { + "buffer.Buffer": true + } + }, + "@hathor/wallet-lib>bitcore-lib>elliptic>bn.js": { + "builtin": { + "buffer.Buffer": true + }, + "globals": { + "Buffer": true + } + }, + "express>body-parser": { + "builtin": { + "querystring": true, + "zlib.createGunzip": true, + "zlib.createInflate": true + }, + "packages": { + "express>body-parser>bytes": true, + "express>content-type": true, + "morgan>debug": true, + "morgan>depd": true, + "express>send>destroy": true, + "express>http-errors": true, + "express>body-parser>iconv-lite": true, + "express>body-parser>on-finished": true, + "express>qs": true, + "express>body-parser>raw-body": true, + "express>type-is": true, + "express>body-parser>unpipe": true + } + }, + "@hathor/wallet-lib>bitcore-lib>elliptic>brorand": { + "builtin": { + "crypto.randomBytes": true + }, + "globals": { + "crypto": true, + "msCrypto": true + } + }, + "@hathor/wallet-lib>bitcore-lib>bs58": { + "packages": { + "@hathor/wallet-lib>bitcore-lib>bs58>base-x": true + } + }, + "jsonwebtoken>jws>jwa>buffer-equal-constant-time": { + "builtin": { + "buffer.Buffer.isBuffer": true, + "buffer.Buffer.prototype.equal": true, + "buffer.SlowBuffer.prototype.equal": true + } + }, + "eslint-plugin-import>object.values>call-bind>call-bind-apply-helpers": { + "packages": { + "eslint-plugin-import>array.prototype.findlastindex>es-errors": true, + "eslint-plugin-import>hasown>function-bind": true + } + }, + "eslint-plugin-import>object.values>call-bind": { + "packages": { + "eslint-plugin-import>object.values>call-bind>call-bind-apply-helpers": true, + "eslint-plugin-import>object.values>call-bind>es-define-property": true, + "eslint-plugin-import>array-includes>get-intrinsic": true, + "eslint-plugin-import>object.values>call-bind>set-function-length": true + } + }, + "winston>@dabh/diagnostics>colorspace>color>color-convert": { + "packages": { + "winston>@dabh/diagnostics>colorspace>color>color-string>color-name": true + } + }, + "winston>@dabh/diagnostics>colorspace>color>color-string": { + "packages": { + "winston>@dabh/diagnostics>colorspace>color>color-string>color-name": true, + "winston>@dabh/diagnostics>colorspace>color>color-string>simple-swizzle": true + } + }, + "winston>@dabh/diagnostics>colorspace>color": { + "packages": { + "winston>@dabh/diagnostics>colorspace>color>color-convert": true, + "winston>@dabh/diagnostics>colorspace>color>color-string": true + } + }, + "winston>@dabh/diagnostics>colorspace": { + "packages": { + "winston>@dabh/diagnostics>colorspace>color": true, + "winston>@dabh/diagnostics>colorspace>text-hex": true + } + }, + "axios>form-data>combined-stream": { + "builtin": { + "stream.Stream": true, + "util.inherits": true + }, + "globals": { + "Buffer.isBuffer": true + }, + "packages": { + "axios>form-data>combined-stream>delayed-stream": true + } + }, + "express>content-disposition": { + "builtin": { + "path.basename": true + }, + "packages": { + "express>content-disposition>safe-buffer": true + } + }, + "express>cookie-signature": { + "builtin": { + "crypto.createHash": true, + "crypto.createHmac": true + } + }, + "@hathor/wallet-lib>crypto-js": { + "builtin": { + "crypto": true + }, + "globals": { + "crypto": true, + "define": true, + "msCrypto": true + } + }, + "morgan>debug": { + "builtin": { + "fs.SyncWriteStream": true, + "net.Socket": true, + "tty.WriteStream": true, + "tty.isatty": true, + "util": true + }, + "globals": { + "chrome": true, + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, + "packages": { + "morgan>debug>ms": true + } + }, + "eslint-plugin-import>object.values>define-properties>define-data-property": { + "packages": { + "eslint-plugin-import>object.values>call-bind>es-define-property": true, + "eslint-plugin-import>array.prototype.findlastindex>es-errors": true, + "eslint-plugin-import>array-includes>es-abstract>gopd": true + } + }, + "axios>form-data>combined-stream>delayed-stream": { + "builtin": { + "stream.Stream": true, + "util.inherits": true + } + }, + "depd": { + "globals": { + "Error.captureStackTrace": true, + "Error.prepareStackTrace": "write", + "Error.stackTraceLimit": "write" + } + }, + "morgan>depd": { + "builtin": { + "path.relative": true + }, + "globals": { + "process": true + } + }, + "express>send>destroy": { + "builtin": { + "events.EventEmitter": true, + "fs.ReadStream": true, + "stream": true, + "zlib.Deflate": true, + "zlib.DeflateRaw": true, + "zlib.Gunzip": true, + "zlib.Gzip": true, + "zlib.Inflate": true, + "zlib.InflateRaw": true, + "zlib.Unzip": true + } + }, + "eslint-plugin-import>array-includes>get-intrinsic>get-proto>dunder-proto": { + "packages": { + "eslint-plugin-import>object.values>call-bind>call-bind-apply-helpers": true, + "eslint-plugin-import>array-includes>es-abstract>gopd": true + } + }, + "jsonwebtoken>jws>jwa>ecdsa-sig-formatter": { + "packages": { + "morgan>basic-auth>safe-buffer": true + } + }, + "@hathor/wallet-lib>bitcore-lib>elliptic": { + "packages": { + "@hathor/wallet-lib>bitcore-lib>elliptic>bn.js": true, + "@hathor/wallet-lib>bitcore-lib>elliptic>brorand": true, + "@hathor/wallet-lib>bitcore-lib>elliptic>hash.js": true, + "@hathor/wallet-lib>bitcore-lib>elliptic>hmac-drbg": true, + "express>http-errors>inherits": true, + "@hathor/wallet-lib>bitcore-lib>elliptic>minimalistic-assert": true, + "@hathor/wallet-lib>bitcore-lib>elliptic>minimalistic-crypto-utils": true + } + }, + "express>etag": { + "builtin": { + "crypto.createHash": true, + "fs.Stats": true + }, + "globals": { + "Buffer.byteLength": true, + "Buffer.isBuffer": true + } + }, + "express": { + "builtin": { + "events.EventEmitter.prototype": true, + "fs.statSync": true, + "http.IncomingMessage.prototype": true, + "http.ServerResponse.prototype": true, + "http.createServer": true, + "net.isIP": true, + "path.basename": true, + "path.dirname": true, + "path.extname": true, + "path.join": true, + "path.resolve": true, + "querystring.parse": true + }, + "globals": { + "console.error": true, + "process.env.NODE_ENV": true, + "setImmediate": true + }, + "packages": { + "express>accepts": true, + "express>array-flatten": true, + "express>body-parser": true, + "express>content-disposition": true, + "express>content-type": true, + "express>cookie-signature": true, + "express>cookie": true, + "morgan>debug": true, + "morgan>depd": true, + "express>encodeurl": true, + "express>escape-html": true, + "express>etag": true, + "express>finalhandler": true, + "express>fresh": true, + "express>http-errors": true, + "express>merge-descriptors": true, + "express>methods": true, + "express>on-finished": true, + "express>parseurl": true, + "express>path-to-regexp": true, + "express>proxy-addr": true, + "express>qs": true, + "express>range-parser": true, + "express>safe-buffer": true, + "express>send": true, + "express>serve-static": true, + "express>setprototypeof": true, + "express>statuses": true, + "express>type-is": true, + "express>utils-merge": true, + "express>vary": true + } + }, + "express-validator": { + "globals": { + "console.warn": true + }, + "packages": { + "lodash": true, + "validator": true + } + }, + "winston>logform>fecha": { + "globals": { + "define": true + } + }, + "express>finalhandler": { + "globals": { + "Buffer.byteLength": true, + "process.env.NODE_ENV": true, + "process.nextTick": true, + "setImmediate": true + }, + "packages": { + "morgan>debug": true, + "express>encodeurl": true, + "express>escape-html": true, + "express>finalhandler>on-finished": true, + "express>parseurl": true, + "express>statuses": true, + "express>body-parser>unpipe": true + } + }, + "axios>follow-redirects": { + "builtin": { + "assert": true, + "http": true, + "https": true, + "stream.Writable.call": true, + "stream.Writable.prototype": true, + "url.URL": true, + "url.format": true, + "url.parse": true, + "url.resolve": true + }, + "globals": { + "clearTimeout": true, + "setTimeout": true + }, + "packages": { + "morgan>debug": true + } + }, + "axios>form-data": { + "builtin": { + "fs.stat": true, + "http.request": true, + "https.request": true, + "path.basename": true, + "path.normalize": true, + "stream.Stream": true, + "url.parse": true, + "util.inherits": true, + "util.isArray": true + }, + "globals": { + "Buffer.alloc": true, + "Buffer.byteLength": true, + "Buffer.concat": true, + "Buffer.from": true, + "Buffer.isBuffer": true, + "process.nextTick": true + }, + "packages": { + "axios>form-data>asynckit": true, + "axios>form-data>combined-stream": true, + "axios>form-data>mime-types": true + } + }, + "eslint-plugin-import>array-includes>get-intrinsic": { + "globals": { + "AggregateError": true, + "FinalizationRegistry": true, + "Float16Array": true, + "WeakRef": true + }, + "packages": { + "eslint-plugin-import>object.values>call-bind>call-bind-apply-helpers": true, + "eslint-plugin-import>object.values>call-bind>es-define-property": true, + "eslint-plugin-import>array.prototype.findlastindex>es-errors": true, + "eslint-plugin-import>object.values>es-object-atoms": true, + "eslint-plugin-import>hasown>function-bind": true, + "eslint-plugin-import>array-includes>get-intrinsic>get-proto": true, + "eslint-plugin-import>array-includes>es-abstract>gopd": true, + "eslint-config-airbnb-base>object.assign>has-symbols": true, + "eslint-plugin-import>hasown": true, + "eslint-plugin-import>array-includes>get-intrinsic>math-intrinsics": true + } + }, + "eslint-plugin-import>array-includes>get-intrinsic>get-proto": { + "packages": { + "eslint-plugin-import>array-includes>get-intrinsic>get-proto>dunder-proto": true, + "eslint-plugin-import>object.values>es-object-atoms": true + } + }, + "eslint-plugin-import>object.values>define-properties>has-property-descriptors": { + "packages": { + "eslint-plugin-import>object.values>call-bind>es-define-property": true + } + }, + "@hathor/wallet-lib>bitcore-lib>elliptic>hash.js": { + "packages": { + "express>http-errors>inherits": true, + "@hathor/wallet-lib>bitcore-lib>elliptic>minimalistic-assert": true + } + }, + "eslint-plugin-import>hasown": { + "packages": { + "eslint-plugin-import>hasown>function-bind": true + } + }, + "@hathor/wallet-lib>bitcore-lib>elliptic>hmac-drbg": { + "packages": { + "@hathor/wallet-lib>bitcore-lib>elliptic>hash.js": true, + "@hathor/wallet-lib>bitcore-lib>elliptic>minimalistic-assert": true, + "@hathor/wallet-lib>bitcore-lib>elliptic>minimalistic-crypto-utils": true + } + }, + "express>http-errors": { + "packages": { + "morgan>depd": true, + "express>http-errors>inherits": true, + "express>setprototypeof": true, + "express>statuses": true, + "express>http-errors>toidentifier": true + } + }, + "express>body-parser>iconv-lite": { + "builtin": { + "buffer.Buffer": true, + "buffer.SlowBuffer.byteLength": true, + "buffer.SlowBuffer.prototype.toString": true, + "buffer.SlowBuffer.prototype.write": true, + "stream.Readable.prototype.collect": true, + "stream.Readable.prototype.setEncoding": true, + "stream.Transform.call": true, + "stream.Transform.prototype": true, + "string_decoder.StringDecoder.call": true, + "string_decoder.StringDecoder.prototype": true + }, + "globals": { + "console.error": true, + "process": true + }, + "packages": { + "express>body-parser>iconv-lite>safer-buffer": true + } + }, + "@hathor/wallet-lib>bitcore-lib>inherits": { + "builtin": { + "util.inherits": true + } + }, + "express>http-errors>inherits": { + "builtin": { + "util.inherits": true + } + }, + "@hathor/wallet-lib>isomorphic-ws": { + "packages": { + "@hathor/wallet-lib>ws": true + } + }, + "jsonwebtoken": { + "builtin": { + "crypto.KeyObject": true, + "crypto.createPrivateKey": true, + "crypto.createPublicKey": true, + "crypto.createSecretKey": true + }, + "globals": { + "Buffer.from": true, + "Buffer.isBuffer": true, + "process.version": true + }, + "packages": { + "jsonwebtoken>jws": true, + "jsonwebtoken>lodash.includes": true, + "jsonwebtoken>lodash.isboolean": true, + "jsonwebtoken>lodash.isinteger": true, + "jsonwebtoken>lodash.isnumber": true, + "jsonwebtoken>lodash.isplainobject": true, + "jsonwebtoken>lodash.isstring": true, + "jsonwebtoken>lodash.once": true, + "jsonwebtoken>ms": true, + "jsonwebtoken>semver": true + } + }, + "jsonwebtoken>jws>jwa": { + "builtin": { + "crypto.constants.RSA_PKCS1_PSS_PADDING": true, + "crypto.constants.RSA_PSS_SALTLEN_DIGEST": true, + "crypto.createHmac": true, + "crypto.createPublicKey": true, + "crypto.createSign": true, + "crypto.createVerify": true, + "util": true + }, + "packages": { + "jsonwebtoken>jws>jwa>buffer-equal-constant-time": true, + "jsonwebtoken>jws>jwa>ecdsa-sig-formatter": true, + "morgan>basic-auth>safe-buffer": true + } + }, + "jsonwebtoken>jws": { + "builtin": { + "buffer.Buffer.isBuffer": true, + "stream": true, + "util.format": true, + "util.inherits": true + }, + "globals": { + "process.nextTick": true + }, + "packages": { + "jsonwebtoken>jws>jwa": true, + "morgan>basic-auth>safe-buffer": true + } + }, + "lodash": { + "globals": { + "define": true + } + }, + "winston>logform": { + "builtin": { + "util.format": true, + "util.inspect": true + }, + "packages": { + "winston>@colors/colors": true, + "winston>logform>fecha": true, + "winston>logform>ms": true, + "winston>safe-stable-stringify": true, + "winston>triple-beam": true + } + }, + "nodemon>semver>lru-cache": { + "packages": { + "nodemon>semver>lru-cache>yallist": true + } + }, + "express>methods": { + "builtin": { + "http.METHODS": true + } + }, + "axios>form-data>mime-types": { + "builtin": { + "path.extname": true + }, + "packages": { + "axios>form-data>mime-types>mime-db": true + } + }, + "express>send>mime": { + "builtin": { + "fs.readFileSync": true, + "path": true + }, + "globals": { + "console.warn": true, + "process.env.DEBUG_MIME": true + } + }, + "morgan": { + "globals": { + "process.hrtime": true, + "process.stdout": true, + "setTimeout": true + }, + "packages": { + "morgan>basic-auth": true, + "morgan>debug": true, + "morgan>depd": true, + "morgan>on-finished": true, + "morgan>on-headers": true + } + }, + "@dinamonetworks/hsm-dinamo>node-aes-cmac": { + "builtin": { + "crypto.createCipheriv": true + }, + "globals": { + "Buffer": true + } + }, + "express>qs>side-channel>object-inspect": { + "builtin": { + "util.inspect": true + }, + "globals": { + "HTMLElement": true, + "WeakRef": true + } + }, + "express>body-parser>on-finished": { + "builtin": { + "async_hooks": true + }, + "globals": { + "process.nextTick": true, + "setImmediate": true + }, + "packages": { + "morgan>on-finished>ee-first": true + } + }, + "express>on-finished": { + "builtin": { + "async_hooks": true + }, + "globals": { + "process.nextTick": true, + "setImmediate": true + }, + "packages": { + "morgan>on-finished>ee-first": true + } + }, + "express>finalhandler>on-finished": { + "builtin": { + "async_hooks": true + }, + "globals": { + "process.nextTick": true, + "setImmediate": true + }, + "packages": { + "morgan>on-finished>ee-first": true + } + }, + "morgan>on-finished": { + "globals": { + "process.nextTick": true, + "setImmediate": true + }, + "packages": { + "morgan>on-finished>ee-first": true + } + }, + "express>send>on-finished": { + "builtin": { + "async_hooks": true + }, + "globals": { + "process.nextTick": true, + "setImmediate": true + }, + "packages": { + "morgan>on-finished>ee-first": true + } + }, + "winston>one-time": { + "packages": { + "winston>one-time>fn.name": true + } + }, + "express>parseurl": { + "builtin": { + "url.Url": true, + "url.parse": true + } + }, + "express>proxy-addr": { + "packages": { + "express>proxy-addr>forwarded": true, + "express>proxy-addr>ipaddr.js": true + } + }, + "axios>proxy-from-env": { + "builtin": { + "url.parse": true + }, + "globals": { + "process.env": true + } + }, + "express>qs": { + "packages": { + "express>qs>side-channel": true + } + }, + "@hathor/wallet-lib>queue-microtask": { + "globals": { + "queueMicrotask": true, + "setTimeout": true + } + }, + "express>body-parser>raw-body": { + "builtin": { + "async_hooks": true + }, + "globals": { + "Buffer.concat": true, + "process.nextTick": true + }, + "packages": { + "express>body-parser>bytes": true, + "express>http-errors": true, + "express>body-parser>iconv-lite": true, + "express>body-parser>unpipe": true + } + }, + "winston>readable-stream": { + "builtin": { + "buffer.Buffer": true, + "events.EventEmitter": true, + "stream": true, + "util": true + }, + "globals": { + "process.env.READABLE_STREAM": true, + "process.nextTick": true, + "process.stderr": true, + "process.stdout": true + }, + "packages": { + "express>http-errors>inherits": true, + "winston>readable-stream>string_decoder": true, + "winston>readable-stream>util-deprecate": true + } + }, + "morgan>basic-auth>safe-buffer": { + "builtin": { + "buffer": true + } + }, + "express>content-disposition>safe-buffer": { + "builtin": { + "buffer": true + } + }, + "express>safe-buffer": { + "builtin": { + "buffer": true + } + }, + "express>body-parser>iconv-lite>safer-buffer": { + "builtin": { + "buffer": true + }, + "globals": { + "process.binding": true + } + }, + "jsonwebtoken>semver": { + "globals": { + "console.error": true, + "process": true + }, + "packages": { + "nodemon>semver>lru-cache": true + } + }, + "express>send": { + "builtin": { + "fs.createReadStream": true, + "fs.stat": true, + "path.extname": true, + "path.join": true, + "path.normalize": true, + "path.resolve": true, + "path.sep": true, + "stream": true, + "util.inherits": true + }, + "globals": { + "Buffer.byteLength": true + }, + "packages": { + "morgan>debug": true, + "morgan>depd": true, + "express>send>destroy": true, + "express>encodeurl": true, + "express>escape-html": true, + "express>etag": true, + "express>fresh": true, + "express>http-errors": true, + "express>send>mime": true, + "express>send>ms": true, + "express>send>on-finished": true, + "express>range-parser": true, + "express>statuses": true + } + }, + "express>serve-static": { + "builtin": { + "path.resolve": true, + "url.format": true + }, + "globals": { + "Buffer.byteLength": true + }, + "packages": { + "express>encodeurl": true, + "express>escape-html": true, + "express>parseurl": true, + "express>send": true + } + }, + "eslint-plugin-import>object.values>call-bind>set-function-length": { + "packages": { + "eslint-plugin-import>object.values>define-properties>define-data-property": true, + "eslint-plugin-import>array.prototype.findlastindex>es-errors": true, + "eslint-plugin-import>array-includes>get-intrinsic": true, + "eslint-plugin-import>array-includes>es-abstract>gopd": true, + "eslint-plugin-import>object.values>define-properties>has-property-descriptors": true + } + }, + "express>qs>side-channel": { + "packages": { + "eslint-plugin-import>object.values>call-bind": true, + "eslint-plugin-import>array-includes>get-intrinsic": true, + "express>qs>side-channel>object-inspect": true + } + }, + "winston>@dabh/diagnostics>colorspace>color>color-string>simple-swizzle": { + "packages": { + "winston>@dabh/diagnostics>colorspace>color>color-string>simple-swizzle>is-arrayish": true + } + }, + "winston>readable-stream>string_decoder": { + "packages": { + "morgan>basic-auth>safe-buffer": true + } + }, + "express>type-is": { + "packages": { + "express>type-is>media-typer": true, + "axios>form-data>mime-types": true + } + }, + "@hathor/wallet-lib>bitcore-mnemonic>unorm": { + "globals": { + "define": true + } + }, + "winston>readable-stream>util-deprecate": { + "builtin": { + "util.deprecate": true + } + }, + "uuid4": { + "builtin": { + "crypto.randomBytes": true + } + }, + "winston": { + "builtin": { + "fs.F_OK": true, + "fs.access": true, + "fs.close": true, + "fs.createReadStream": true, + "fs.createWriteStream": true, + "fs.exists": true, + "fs.existsSync": true, + "fs.mkdirSync": true, + "fs.open": true, + "fs.read": true, + "fs.rename": true, + "fs.stat": true, + "fs.unlink": true, + "http": true, + "https": true, + "os.EOL": true, + "os.loadavg": true, + "os.uptime": true, + "path.basename": true, + "path.dirname": true, + "path.extname": true, + "path.join": true, + "string_decoder.StringDecoder": true, + "util.format": true, + "zlib.createGzip": true + }, + "globals": { + "Buffer.alloc": true, + "Buffer.byteLength": true, + "Buffer.from": true, + "clearTimeout": true, + "console._stderr": true, + "console._stdout": true, + "console.error": true, + "console.log": true, + "console.warn": true, + "process._exiting": true, + "process.argv": true, + "process.cwd": true, + "process.execPath": true, + "process.exit": true, + "process.getgid": true, + "process.getuid": true, + "process.memoryUsage": true, + "process.nextTick": true, + "process.on": true, + "process.pid": true, + "process.removeListener": true, + "process.version": true, + "setImmediate": true, + "setTimeout": true + }, + "packages": { + "winston>@dabh/diagnostics": true, + "winston>async": true, + "winston>is-stream": true, + "winston>logform": true, + "winston>one-time": true, + "winston>readable-stream": true, + "winston>safe-stable-stringify": true, + "winston>stack-trace": true, + "winston>triple-beam": true, + "winston>winston-transport": true + } + }, + "winston>winston-transport": { + "builtin": { + "util.inherits": true + }, + "globals": { + "console.error": true + }, + "packages": { + "winston>readable-stream": true, + "winston>triple-beam": true + } + }, + "@hathor/wallet-lib>ws": { + "builtin": { + "buffer.isUtf8": true, + "crypto.createHash": true, + "crypto.randomBytes": true, + "crypto.randomFillSync": true, + "events": true, + "http.STATUS_CODES": true, + "http.createServer": true, + "http.request": true, + "https.request": true, + "net.connect": true, + "net.isIP": true, + "stream.Duplex": true, + "stream.Readable": true, + "stream.Writable": true, + "tls.connect": true, + "url.URL": true, + "zlib.Z_DEFAULT_WINDOWBITS": true, + "zlib.Z_SYNC_FLUSH": true, + "zlib.createDeflateRaw": true, + "zlib.createInflateRaw": true + }, + "globals": { + "Buffer": true, + "clearTimeout": true, + "process.env.WS_NO_BUFFER_UTIL": true, + "process.env.WS_NO_UTF_8_VALIDATE": true, + "process.nextTick": true, + "setImmediate": true, + "setTimeout": true + } + }, + "zod": { + "globals": { + "URL": true + } + } + } +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 45ff36a6..20f8861b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "hathor-wallet-headless", "version": "0.36.1", + "hasInstallScript": true, "license": "MIT", "dependencies": { "@dinamonetworks/hsm-dinamo": "4.9.1", @@ -16,6 +17,7 @@ "express": "4.18.2", "express-validator": "6.10.0", "jsonwebtoken": "9.0.2", + "lavamoat": "10.0.5", "lodash": "4.17.21", "morgan": "1.10.0", "uuid4": "2.0.3", @@ -100,13 +102,14 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", - "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", - "dev": true, + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "license": "MIT", "dependencies": { - "@babel/highlight": "^7.23.4", - "chalk": "^2.4.2" + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" @@ -211,15 +214,44 @@ } }, "node_modules/@babel/generator": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", - "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", - "dev": true, + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.5.tgz", + "integrity": "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==", + "license": "MIT", "dependencies": { - "@babel/types": "^7.23.6", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" + "@babel/parser": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/generator/node_modules/@babel/parser": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", + "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.5" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/generator/node_modules/@babel/types": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", + "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" }, "engines": { "node": ">=6.9.0" @@ -555,19 +587,19 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", - "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", - "dev": true, + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", - "dev": true, + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -610,14 +642,15 @@ } }, "node_modules/@babel/highlight": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", - "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", - "dev": true, + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.9.tgz", + "integrity": "sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw==", + "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-validator-identifier": "^7.25.9", "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" @@ -647,10 +680,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.0.tgz", - "integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==", - "dev": true, + "version": "7.27.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.3.tgz", + "integrity": "sha512-xyYxRj6+tLNDTWi0KCBcZ9V7yg3/lwL9DWh9Uwh/RIVlIfFidggcgxKX3GCXwCiswwcGRawBKbEg2LG/Y8eJhw==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.27.3" + }, "bin": { "parser": "bin/babel-parser.js" }, @@ -1939,33 +1975,30 @@ } }, "node_modules/@babel/template": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", - "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", - "dev": true, + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.24.0", - "@babel/types": "^7.24.0" + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.0.tgz", - "integrity": "sha512-HfuJlI8qq3dEDmNU5ChzzpZRWq+oxCZQyMzIMEqLho+AQnhMnKQUzH6ydo3RBl/YjPCuk68Y6s0Gx0AeyULiWw==", - "dev": true, + "version": "7.27.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.3.tgz", + "integrity": "sha512-lId/IfN/Ye1CIu8xG7oKBHXd2iNb2aW1ilPszzGcJug6M8RCKfVNcYhpI5+bMvFYjK7lXIM0R+a+6r8xhHp2FQ==", + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.24.0", - "@babel/types": "^7.24.0", + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.27.3", + "@babel/parser": "^7.27.3", + "@babel/template": "^7.27.2", + "@babel/types": "^7.27.3", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -1977,7 +2010,6 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -1993,18 +2025,16 @@ "node_modules/@babel/traverse/node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/@babel/types": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", - "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", - "dev": true, + "version": "7.27.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.3.tgz", + "integrity": "sha512-Y1GkI4ktrtvmawoSq+4FCVHNryea6uR+qUQy0AGxLSsjCX0nVmkYQMBLHDkXZuo5hGx7eYdnIaslsdBFm7zbUw==", + "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.23.4", - "@babel/helper-validator-identifier": "^7.22.20", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -2042,6 +2072,24 @@ "node-aes-cmac": "^0.1.1" } }, + "node_modules/@endo/cache-map": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@endo/cache-map/-/cache-map-1.1.0.tgz", + "integrity": "sha512-owFGshs/97PDw9oguZqU/px8Lv1d0KjAUtDUiPwKHNXRVUE/jyettEbRoTbNJR1OaI8biMn6bHr9kVJsOh6dXw==", + "license": "Apache-2.0" + }, + "node_modules/@endo/env-options": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/@endo/env-options/-/env-options-1.1.11.tgz", + "integrity": "sha512-p9OnAPsdqoX4YJsE98e3NBVhIr2iW9gNZxHhAI2/Ul5TdRfoOViItzHzTqrgUVopw6XxA1u1uS6CykLMDUxarA==", + "license": "Apache-2.0" + }, + "node_modules/@endo/immutable-arraybuffer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@endo/immutable-arraybuffer/-/immutable-arraybuffer-1.1.2.tgz", + "integrity": "sha512-u+NaYB2aqEugQ3u7w3c5QNkPogf8q/xGgsPaqdY6pUiGWtYiTiFspKFcha6+oeZhWXWQ23rf0KrUq0kfuzqYyQ==", + "license": "Apache-2.0" + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -3095,53 +3143,66 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", - "dev": true, + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", - "dev": true, + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@lavamoat/aa": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/@lavamoat/aa/-/aa-4.3.4.tgz", + "integrity": "sha512-/Fk7k9fdkbM2WIxKpwSk2aMz6tASEkFCT9HL/jlhDQdoIcwz6heieEUCQwrJmsdzm9841F56JHY5puNOv32+PQ==", + "license": "MIT", + "dependencies": { + "resolve": "1.22.10" + }, + "bin": { + "lavamoat-ls": "src/cli.js" + }, + "engines": { + "node": "^16.20.0 || ^18.0.0 || ^20.0.0 || ^22.0.0 || ^24.0.0" + } + }, + "node_modules/@lavamoat/types": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@lavamoat/types/-/types-0.1.0.tgz", + "integrity": "sha512-0a1gFjjT0IRpd1KeYHTS3xkjDnDmpOOJ/7ax9HwoMvRkDCOYJAMlRqamClcGXSeI6gG7k2Z2lnXuVIECSaOE5Q==", + "license": "MIT", + "dependencies": { + "@babel/types": "7.27.3" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || ^22.0.0 || ^24.0.0" + } + }, "node_modules/@nicolo-ribaudo/chokidar-2": { "version": "2.1.8-no-fsevents.3", "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz", @@ -3250,10 +3311,10 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz", - "integrity": "sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==", - "dev": true, + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.7.tgz", + "integrity": "sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng==", + "license": "MIT", "dependencies": { "@babel/types": "^7.20.7" } @@ -3522,7 +3583,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -3552,6 +3613,15 @@ "sprintf-js": "~1.0.2" } }, + "node_modules/arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/array-buffer-byte-length": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", @@ -4072,6 +4142,15 @@ "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.3.tgz", "integrity": "sha512-yuVFUvrNcoJi0sv5phmqc6P+Fl1HjRDRNOOkHY2X/3LBy2bIGNSFx4fZ95HMaXHupuS7cZR15AsvtmCIF4UEyg==" }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "license": "MIT", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, "node_modules/bitcore-lib": { "version": "8.25.10", "resolved": "https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-8.25.10.tgz", @@ -4267,15 +4346,44 @@ } }, "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "license": "MIT", "dependencies": { + "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" }, "engines": { "node": ">= 0.4" @@ -4326,7 +4434,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -4632,6 +4740,22 @@ "url": "https://opencollective.com/core-js" } }, + "node_modules/corepack": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/corepack/-/corepack-0.33.0.tgz", + "integrity": "sha512-XSX4BNjdwPXjUEk7/2r0vFhs1irwVncJRMyjzDel3PVKWnHQXehciX0WkvDrd1ujLLFJRe8FeZb9ASCqBtF/OA==", + "license": "MIT", + "bin": { + "corepack": "dist/corepack.js", + "pnpm": "dist/pnpm.js", + "pnpx": "dist/pnpx.js", + "yarn": "dist/yarn.js", + "yarnpkg": "dist/yarnpkg.js" + }, + "engines": { + "node": "^18.17.1 || ^20.10.0 || >=22.11.0" + } + }, "node_modules/create-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", @@ -4875,6 +4999,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -4929,6 +5054,20 @@ "node": ">=6.0.0" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", @@ -5068,12 +5207,10 @@ } }, "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dependencies": { - "get-intrinsic": "^1.2.4" - }, + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -5087,10 +5224,10 @@ } }, "node_modules/es-object-atoms": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", - "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", - "dev": true, + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", "dependencies": { "es-errors": "^1.3.0" }, @@ -5154,8 +5291,8 @@ "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -6004,6 +6141,12 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "license": "MIT" + }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -6137,6 +6280,27 @@ "is-callable": "^1.1.3" } }, + "node_modules/for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha512-SKmowqGTJoPzLO1T0BBJpkfp3EMacCMOuH40hOUbrbzElVktk4DioXVM99QkLCyKoiuOmyjgcWMpVz2xjE7LZw==", + "license": "MIT", + "dependencies": { + "for-in": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -6260,15 +6424,21 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -6286,6 +6456,19 @@ "node": ">=8.0.0" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-symbol-description": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", @@ -6339,7 +6522,6 @@ "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, "engines": { "node": ">=4" } @@ -6360,11 +6542,12 @@ } }, "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dependencies": { - "get-intrinsic": "^1.1.3" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -6395,7 +6578,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, "engines": { "node": ">=4" } @@ -6415,6 +6597,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -6423,9 +6606,10 @@ } }, "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -6506,6 +6690,15 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, + "node_modules/htmlescape": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "integrity": "sha512-eVcrzgbR4tim7c7soKQKtxa/kQM4TzjnlU83rcZ9bHU6t31ehfV7SktN6McWgwPWg+JYMA/O3qpGxBvFq1z2Jg==", + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -6809,12 +7002,15 @@ } }, "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", - "dev": true, + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "license": "MIT", "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -6847,6 +7043,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -6926,7 +7131,6 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, "dependencies": { "isobject": "^3.0.1" }, @@ -7033,8 +7237,7 @@ "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, "node_modules/isexe": { "version": "2.0.0", @@ -7046,7 +7249,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -8910,7 +9112,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "license": "MIT" }, "node_modules/js-yaml": { "version": "3.14.1", @@ -8926,15 +9128,15 @@ } }, "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true, + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, "engines": { - "node": ">=4" + "node": ">=6" } }, "node_modules/json-parse-even-better-errors": { @@ -8949,6 +9151,25 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "node_modules/json-stable-stringify": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.3.0.tgz", + "integrity": "sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg==", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -8967,6 +9188,15 @@ "node": ">=6" } }, + "node_modules/jsonify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", + "license": "Public Domain", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/jsonwebtoken": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", @@ -9049,6 +9279,93 @@ "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==" }, + "node_modules/lavamoat": { + "version": "10.0.5", + "resolved": "https://registry.npmjs.org/lavamoat/-/lavamoat-10.0.5.tgz", + "integrity": "sha512-4g6872/7POizpw14ivWR84RYNQEeRn8QwXR3Ta9kqCe8Qr9oGnnlQIByJ5sbF8ZnwG3ZvQp3o5zrOmFyuEcrNA==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "7.27.1", + "@babel/highlight": "7.25.9", + "@lavamoat/aa": "^4.3.4", + "bindings": "1.5.0", + "corepack": "0.33.0", + "htmlescape": "1.1.1", + "lavamoat-core": "^17.1.2", + "lavamoat-tofu": "^8.1.0", + "node-gyp-build": "4.8.4", + "resolve": "1.22.10", + "yargs": "17.7.2" + }, + "bin": { + "lavamoat": "src/cli.js", + "lavamoat-run-command": "src/run-command.js" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 <20.15.0 || ^20.17.0 || ^22.5.1 || ^24.0.0" + } + }, + "node_modules/lavamoat-core": { + "version": "17.1.2", + "resolved": "https://registry.npmjs.org/lavamoat-core/-/lavamoat-core-17.1.2.tgz", + "integrity": "sha512-+U3F58Ou1vpHaTSCiq1Bi6Zod4kxnH8MygnJKf2Eibe4WRTrpbXCTiu+bQjRwRoOWx6Dbf2+sVrcUqND45GYOA==", + "license": "MIT", + "dependencies": { + "@babel/types": "7.27.3", + "@lavamoat/types": "^0.1.0", + "json-stable-stringify": "1.3.0", + "lavamoat-tofu": "^8.1.0", + "merge-deep": "3.0.3", + "ses": "1.14.0" + }, + "bin": { + "lavamoat-sort-policy": "src/policy-sort-cli.js" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || ^22.0.0 || ^24.0.0" + } + }, + "node_modules/lavamoat-tofu": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/lavamoat-tofu/-/lavamoat-tofu-8.1.0.tgz", + "integrity": "sha512-+YyAuHj5FasUl5kP65gDMwgRp19UIblvUkLV/HvDR/3/FifYVYk9xj0mcA3Ff1/Z4I7FUIkKSsARB2yH3iI5WA==", + "license": "MIT", + "dependencies": { + "@babel/parser": "7.27.3", + "@babel/traverse": "7.27.3", + "@babel/types": "7.27.3", + "@lavamoat/types": "^0.1.0", + "@types/babel__traverse": "7.20.7", + "type-fest": "4.41.0" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || ^22.0.0 || ^24.0.0" + }, + "peerDependencies": { + "lavamoat-core": ">15.4.0" + } + }, + "node_modules/lavamoat-tofu/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha512-RE2g0b5VGZsOCFOCgP7omTRYFqydmZkBwl5oNnQ1lDYC57uyO9KqNnNVxT7COSHTxrRCWVcAVOcbjk+tvh/rgQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -9196,6 +9513,15 @@ "tmpl": "1.0.5" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -9204,6 +9530,90 @@ "node": ">= 0.6" } }, + "node_modules/merge-deep": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/merge-deep/-/merge-deep-3.0.3.tgz", + "integrity": "sha512-qtmzAS6t6grwEkNrunqTBdn0qKwFgNWvlxUbAV8es9M7Ot1EbyApytCnvE0jALPa46ZpKDUo527kKiaWplmlFA==", + "license": "MIT", + "dependencies": { + "arr-union": "^3.1.0", + "clone-deep": "^0.2.4", + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/merge-deep/node_modules/clone-deep": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-0.2.4.tgz", + "integrity": "sha512-we+NuQo2DHhSl+DP6jlUiAhyAjBQrYnpOk15rN6c6JSPScjiCLh8IbSU+VTcph6YS3o7mASE8a0+gbZ7ChLpgg==", + "license": "MIT", + "dependencies": { + "for-own": "^0.1.3", + "is-plain-object": "^2.0.1", + "kind-of": "^3.0.2", + "lazy-cache": "^1.0.3", + "shallow-clone": "^0.1.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/merge-deep/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "license": "MIT" + }, + "node_modules/merge-deep/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "license": "MIT", + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/merge-deep/node_modules/shallow-clone": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-0.1.2.tgz", + "integrity": "sha512-J1zdXCky5GmNnuauESROVu31MQSnLoYvlyEn6j2Ztk6Q5EHFIhxkMhYcv6vuDzl2XEzoRr856QwzMgWM/TmZgw==", + "license": "MIT", + "dependencies": { + "is-extendable": "^0.1.1", + "kind-of": "^2.0.1", + "lazy-cache": "^0.2.3", + "mixin-object": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/merge-deep/node_modules/shallow-clone/node_modules/kind-of": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-2.0.1.tgz", + "integrity": "sha512-0u8i1NZ/mg0b+W3MGGw5I7+6Eib2nx72S/QvXa0hYjEkjTknYmEYQJwGu3mLC0BrhtJjtQafTkyRUQ75Kx0LVg==", + "license": "MIT", + "dependencies": { + "is-buffer": "^1.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/merge-deep/node_modules/shallow-clone/node_modules/lazy-cache": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz", + "integrity": "sha512-gkX52wvU/R8DVMMt78ATVPFMJqfW8FPz1GZ1sVHBVQHmu/WvhIWE4cE1GBzhJNFicDeYhnwp6Rl35BcAIM3YOQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", @@ -9306,6 +9716,28 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/mixin-object": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mixin-object/-/mixin-object-2.0.1.tgz", + "integrity": "sha512-ALGF1Jt9ouehcaXaHhn6t1yGWRqGaHkPFndtFVHfZXOvkIZ/yoGaSi0AHVTafb3ZBGg4dr/bDwnaEKqCXzchMA==", + "license": "MIT", + "dependencies": { + "for-in": "^0.1.3", + "is-extendable": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mixin-object/node_modules/for-in": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.8.tgz", + "integrity": "sha512-F0to7vbBSHP8E3l6dCjxNOLuSFAACIxFy3UehTUlG7svlXi37HHsDkyVcHo0Pq8QwrE+pXvWSVX3ZT1T9wAZ9g==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/mock-socket": { "version": "9.3.1", "resolved": "https://registry.npmjs.org/mock-socket/-/mock-socket-9.3.1.tgz", @@ -9364,6 +9796,17 @@ "semver": "^5.7.0" } }, + "node_modules/node-gyp-build": { + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", + "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", + "license": "MIT", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -9490,7 +9933,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, "engines": { "node": ">= 0.4" } @@ -9774,8 +10216,7 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-to-regexp": { "version": "0.1.7", @@ -9783,10 +10224,10 @@ "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", @@ -10119,18 +10560,21 @@ } }, "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dev": true, + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", + "license": "MIT", "dependencies": { - "is-core-module": "^2.13.0", + "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -10313,6 +10757,17 @@ "node": ">= 0.8.0" } }, + "node_modules/ses": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/ses/-/ses-1.14.0.tgz", + "integrity": "sha512-T07hNgOfVRTLZGwSS50RnhqrG3foWP+rM+Q5Du4KUQyMLFI3A8YA4RKl0jjZzhihC1ZvDGrWi/JMn4vqbgr/Jg==", + "license": "Apache-2.0", + "dependencies": { + "@endo/cache-map": "^1.1.0", + "@endo/env-options": "^1.1.11", + "@endo/immutable-arraybuffer": "^1.1.2" + } + }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -10750,7 +11205,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -10762,7 +11216,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -10801,15 +11254,6 @@ "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", "dev": true }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", diff --git a/package.json b/package.json index 8d08fc1b..6fe1804f 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "express": "4.18.2", "express-validator": "6.10.0", "jsonwebtoken": "9.0.2", + "lavamoat": "10.0.5", "lodash": "4.17.21", "morgan": "1.10.0", "uuid4": "2.0.3", @@ -24,10 +25,13 @@ "zod": "3.23.8" }, "scripts": { + "postinstall": "npx patch-package", "build": "babel src -d dist --source-maps", "build-scripts": "babel scripts -d dist-scripts --source-maps", "dev": "nodemon --exec babel-node src/index.js", "start": "npm run build && node dist/index.js", + "start:lavamoat": "npm run build && lavamoat dist/index.js", + "lavamoat:policy": "npm run build && lavamoat dist/index.js --autopolicy", "test": "jest --forceExit --runInBand", "test_integration": "npm run test_network_up && npm run test_network_integration && npm run test_network_down", "test_network_up": "docker compose -f ./__tests__/integration/docker-compose.yml up -d && mkdir -p tmp && cp ./__tests__/integration/configuration/precalculated-wallets.json ./tmp/wallets.json", diff --git a/patches/axios+1.7.7.patch b/patches/axios+1.7.7.patch new file mode 100644 index 00000000..87902548 --- /dev/null +++ b/patches/axios+1.7.7.patch @@ -0,0 +1,21 @@ +diff --git a/node_modules/axios/package.json b/node_modules/axios/package.json +--- a/node_modules/axios/package.json ++++ b/node_modules/axios/package.json +@@ -2,7 +2,7 @@ + "name": "axios", + "version": "1.7.7", + "description": "Promise based HTTP client for the browser and node.js", +- "main": "index.js", ++ "main": "./dist/node/axios.cjs", + "exports": { + ".": { + "types": { +@@ -31,7 +31,7 @@ + "./unsafe/utils.js": "./lib/utils.js", + "./package.json": "./package.json" + }, +- "type": "module", ++ "type": "commonjs", + "types": "index.d.ts", + "scripts": { + "test": "npm run test:eslint && npm run test:mocha && npm run test:karma && npm run test:dtslint && npm run test:exports", diff --git a/patches/depd+2.0.0.patch b/patches/depd+2.0.0.patch new file mode 100644 index 00000000..8aee3822 --- /dev/null +++ b/patches/depd+2.0.0.patch @@ -0,0 +1,57 @@ +diff --git a/node_modules/depd/index.js b/node_modules/depd/index.js +index 1bf2fcf..f27edc7 100644 +--- a/node_modules/depd/index.js ++++ b/node_modules/depd/index.js +@@ -265,18 +265,26 @@ function log (message, site) { + */ + + function callSiteLocation (callSite) { ++ // Handle sandboxed environments (like LavaMoat) where CallSite methods may not exist ++ if (!callSite || typeof callSite.getFileName !== 'function') { ++ var site = ['', 0, 0] ++ site.callSite = callSite ++ site.name = '' ++ return site ++ } ++ + var file = callSite.getFileName() || '' + var line = callSite.getLineNumber() + var colm = callSite.getColumnNumber() + +- if (callSite.isEval()) { ++ if (typeof callSite.isEval === 'function' && callSite.isEval()) { + file = callSite.getEvalOrigin() + ', ' + file + } + + var site = [file, line, colm] + + site.callSite = callSite +- site.name = callSite.getFunctionName() ++ site.name = typeof callSite.getFunctionName === 'function' ? callSite.getFunctionName() : '' + + return site + } +@@ -294,8 +302,13 @@ function defaultMessage (site) { + funcName = '' + } + ++ // Handle sandboxed environments where CallSite methods may not exist ++ if (!callSite || typeof callSite.getThis !== 'function') { ++ return funcName ++ } ++ + var context = callSite.getThis() +- var typeName = context && callSite.getTypeName() ++ var typeName = context && typeof callSite.getTypeName === 'function' && callSite.getTypeName() + + // ignore useless type name + if (typeName === 'Object') { +@@ -307,7 +320,7 @@ function defaultMessage (site) { + typeName = context.name || typeName + } + +- return typeName && callSite.getMethodName() ++ return typeName && typeof callSite.getMethodName === 'function' && callSite.getMethodName() + ? typeName + '.' + funcName + : funcName + } diff --git a/src/helpers/wallet.helper.js b/src/helpers/wallet.helper.js index f02b0716..d84ad50f 100644 --- a/src/helpers/wallet.helper.js +++ b/src/helpers/wallet.helper.js @@ -8,6 +8,7 @@ import { config as hathorLibConfig, errors, walletUtils } from '@hathor/wallet-lib'; import { WalletStartError } from '../errors'; import version from '../version'; +import { buildAppLogger } from '../logger'; import { DEFAULT_PASSWORD, DEFAULT_PIN, SWAP_SERVICE_MAINNET_BASE_URL, SWAP_SERVICE_TESTNET_BASE_URL, } from '../constants'; @@ -112,8 +113,8 @@ export function getWalletConfigFromSeed({ if (!allowPassphrase) { // To use a passphrase on /start POST request // the configuration of the headless must explicitly allow it - // eslint-disable-next-line no-console - console.error('Failed to start wallet because using a passphrase is not allowed by the current config. See allowPassphrase.'); + const logger = buildAppLogger(); + logger.error('Failed to start wallet because using a passphrase is not allowed by the current config. See allowPassphrase.'); throw new WalletStartError('Failed to start wallet. To use a passphrase you must explicitly allow it in the configuration file. Using a passphrase completely changes the addresses of your wallet, only use it if you know what you are doing.'); } walletConfig.passphrase = passphrase; diff --git a/src/index.js b/src/index.js index af4075f1..c337a096 100644 --- a/src/index.js +++ b/src/index.js @@ -13,11 +13,12 @@ import createApp from './app'; import { EVENTBUS_EVENT_NAME, notificationBus } from './services/notification.service'; import version from './version'; import settings from './settings'; +import { buildAppLogger } from './logger'; -/* eslint-disable no-console */ async function startHeadless() { await settings.setupConfig(); const config = settings.getConfig(); + const logger = buildAppLogger(config); if (config.enabled_plugins && config.enabled_plugins.length > 0) { // There are configured plugins, we should start the child process @@ -29,37 +30,37 @@ async function startHeadless() { process.argv.slice(2), { silent: true, env: process.env }, ); - console.log(`child process started with pid ${child.pid}`); + logger.info(`child process started with pid ${child.pid}`); process.on('exit', () => { if (child.connected || !child.killed) { - console.log('disconnecting from child.'); + logger.info('disconnecting from child.'); child.disconnect(); } }); // This is to unify logs from child and main process. child.stdout.on('data', data => { - console.log(data.toString()); + logger.info(data.toString().trim()); }); // Pipe child stderr to stdout. child.stderr.on('data', data => { - console.error(data.toString()); + logger.error(data.toString().trim()); }); child.on('error', err => { - console.error(`child process error: ${err.message}`); + logger.error(`child process error: ${err.message}`); }); child.on('disconnect', (code, signal) => { - console.log(`child process disconnected from IPC channel with (${code} and ${signal})`); + logger.info(`child process disconnected from IPC channel with (${code} and ${signal})`); // Killing child just in case it has not yet died. child.kill(); // SIGTERM }); child.on('exit', (code, signal) => { - console.log(`child process exited with code ${code} or due to signal ${signal}.`); + logger.info(`child process exited with code ${code} or due to signal ${signal}.`); // Try to exit with the same signal as the child process. process.exit(code || 127); // Have a default to indicate it was not a normal termination }); @@ -79,15 +80,15 @@ async function startHeadless() { const app = createApp(config); - // Logging relevant variables on the console - console.log('Starting Hathor Wallet...', { + // Logging relevant variables + logger.info('Starting Hathor Wallet...', { wallet: version, version: process.version, platform: process.platform, pid: process.pid, }); - console.log('Configuration...', { + logger.info('Configuration...', { network: config.network, server: config.server, txMiningUrl: hathorLibConfig.getTxMiningUrl(), @@ -99,9 +100,8 @@ async function startHeadless() { }); app.listen(config.http_port, config.http_bind_address, () => { - console.log(`Listening on ${config.http_bind_address}:${config.http_port}...`); + logger.info(`Listening on ${config.http_bind_address}:${config.http_port}...`); }); } -/* eslint-enable no-console */ startHeadless(); diff --git a/src/logger.js b/src/logger.js index c2a7aa41..d1ddc065 100644 --- a/src/logger.js +++ b/src/logger.js @@ -93,13 +93,6 @@ function buildAppLogger(config) { }); }, }; - /* eslint-disable no-console */ - console.log = (...args) => appLogger.info.call(appLogger, ...args); - console.info = (...args) => appLogger.info.call(appLogger, ...args); - console.warn = (...args) => appLogger.warn.call(appLogger, ...args); - console.error = (...args) => appLogger.error.call(appLogger, ...args); - console.debug = (...args) => appLogger.debug.call(appLogger, ...args); - /* eslint-enable no-console */ return appLogger; } diff --git a/src/plugins/child.js b/src/plugins/child.js index 2a657f0d..ec712094 100644 --- a/src/plugins/child.js +++ b/src/plugins/child.js @@ -8,6 +8,7 @@ import path from 'path'; import { bigIntUtils } from '@hathor/wallet-lib'; import settings from '../settings'; +import { buildAppLogger } from '../logger'; import { notificationBus, EVENTBUS_EVENT_NAME } from '../services/notification.service'; @@ -90,7 +91,8 @@ export const loadPlugins = async (enabled, customConfig) => { for (const pluginId of enabledPlugins) { const pluginConfig = hathorPlugins[pluginId] || customPlugins[pluginId]; if (!pluginConfig) { - console.log(`Unable to find plugin ${pluginId}, skipping.`); + const logger = buildAppLogger(); + logger.warn(`Unable to find plugin ${pluginId}, skipping.`); continue; } promises.push(importPlugin(pluginConfig)); @@ -125,15 +127,18 @@ export const handleMessage = serializedData => { } }; +/* istanbul ignore next -- @preserve entry point for child process, not testable */ if (process.env.NODE_ENV !== 'test') { process.on('disconnect', () => { // If parent disconnects, we must exit to avoid running indefinetly - console.log('[child_process] parent disconnected'); + const logger = buildAppLogger(); + logger.info('[child_process] parent disconnected'); process.exit(127); }); process.on('message', handleMessage); - console.log('[child_process] startup'); + const logger = buildAppLogger(); + logger.info('[child_process] startup'); main(); } diff --git a/src/plugins/hathor_debug.js b/src/plugins/hathor_debug.js index 820dc9a3..aa3bd2e1 100644 --- a/src/plugins/hathor_debug.js +++ b/src/plugins/hathor_debug.js @@ -5,6 +5,7 @@ * LICENSE file in the root directory of this source tree. */ import { bigIntUtils } from '@hathor/wallet-lib'; +import { buildAppLogger } from '../logger'; let debugLong; @@ -21,7 +22,8 @@ async function checkDeps() { $ npm install ${Object.entries(requiredDeps).map(x => [x[0], x[1]].join('@')).join(' ')}`); } })).catch(e => { - console.error(e.message); + const logger = buildAppLogger(); + logger.error(e.message); process.exit(127); }); } @@ -36,7 +38,8 @@ export const getSettings = () => { }; function debugLog(data) { - console.log(`plugin[debug]: ${data}`); + const logger = buildAppLogger(); + logger.info(`plugin[debug]: ${data}`); } export function eventHandler(data) { @@ -66,5 +69,6 @@ export const init = async bus => { bus.on('message', eventHandler); - console.log('plugin[debug]: loaded'); + const logger = buildAppLogger(); + logger.info('plugin[debug]: loaded'); }; diff --git a/src/plugins/hathor_rabbitmq.js b/src/plugins/hathor_rabbitmq.js index 63af4768..b8dba7b2 100644 --- a/src/plugins/hathor_rabbitmq.js +++ b/src/plugins/hathor_rabbitmq.js @@ -8,6 +8,7 @@ /* istanbul ignore next */ import { bigIntUtils } from '@hathor/wallet-lib'; +import { buildAppLogger } from '../logger'; async function checkDeps() { const requiredDeps = { @@ -22,7 +23,8 @@ async function checkDeps() { $ npm install ${Object.entries(requiredDeps).map(x => [x[0], x[1]].join('@')).join(' ')}`); } })).catch(e => { - console.error(e.message); + const logger = buildAppLogger(); + logger.error(e.message); process.exit(127); }); } @@ -100,5 +102,6 @@ export const init = async bus => { }); }); - console.log('plugin[rabbitmq] loaded'); + const logger = buildAppLogger(); + logger.info('plugin[rabbitmq] loaded'); }; diff --git a/src/plugins/hathor_sqs.js b/src/plugins/hathor_sqs.js index 872d2c8b..1006de88 100644 --- a/src/plugins/hathor_sqs.js +++ b/src/plugins/hathor_sqs.js @@ -6,6 +6,7 @@ */ import { bigIntUtils } from '@hathor/wallet-lib'; +import { buildAppLogger } from '../logger'; /* istanbul ignore next */ async function checkDeps() { @@ -21,7 +22,8 @@ async function checkDeps() { $ npm install ${Object.entries(requiredDeps).map(x => [x[0], x[1]].join('@')).join(' ')}`); } })).catch(e => { - console.error(e.message); + const logger = buildAppLogger(); + logger.error(e.message); process.exit(127); }); } @@ -59,7 +61,8 @@ export function eventHandlerFactory(sqs, settings) { }; sqs.sendMessage(params, err => { if (err) { - console.log(`plugin[sqs] error sending to sqs: ${err}`); + const logger = buildAppLogger(); + logger.error(`plugin[sqs] error sending to sqs: ${err}`); } }); }; @@ -75,5 +78,6 @@ export const init = async bus => { bus.on('message', eventHandlerFactory(sqs, settings)); - console.log('plugin[sqs] loaded'); + const logger = buildAppLogger(); + logger.info('plugin[sqs] loaded'); }; diff --git a/src/plugins/hathor_websocket.js b/src/plugins/hathor_websocket.js index d713fe6c..b026b278 100644 --- a/src/plugins/hathor_websocket.js +++ b/src/plugins/hathor_websocket.js @@ -6,6 +6,7 @@ */ import { bigIntUtils } from '@hathor/wallet-lib'; +import { buildAppLogger } from '../logger'; /* istanbul ignore next */ async function checkDeps() { @@ -21,7 +22,8 @@ async function checkDeps() { $ npm install ${Object.entries(requiredDeps).map(x => [x[0], x[1]].join('@')).join(' ')}`); } })).catch(e => { - console.error(e.message); + const logger = buildAppLogger(); + logger.error(e.message); process.exit(127); }); } @@ -52,7 +54,8 @@ export const getSettings = () => { export function connectionHandler(socket) { sockets.push(socket); - console.log('New websocket connection!'); + const logger = buildAppLogger(); + logger.info('New websocket connection!'); socket.on('close', () => { // Remove from connections sockets = sockets.filter(s => s !== socket); @@ -77,5 +80,6 @@ export const init = async bus => { const server = new WebSocket.Server({ port }); server.on('connection', connectionHandler); - console.log('plugin[ws]: loaded'); + const logger = buildAppLogger(); + logger.info('plugin[ws]: loaded'); }; diff --git a/src/services/wallets.service.js b/src/services/wallets.service.js index 5a0fedbc..12f96203 100644 --- a/src/services/wallets.service.js +++ b/src/services/wallets.service.js @@ -8,7 +8,7 @@ const { Connection, HathorWallet, HistorySyncMode } = require('@hathor/wallet-lib'); const { removeAllWalletProposals } = require('./atomic-swap.service'); const { notificationBus } = require('./notification.service'); -const { sanitizeLogInput } = require('../logger'); +const { sanitizeLogInput, buildAppLogger } = require('../logger'); const { lock } = require('../lock'); const { walletLoggers, initializeWalletLogger, setupWalletStateLogs } = require('./logger.service'); @@ -122,8 +122,8 @@ async function startWallet(walletId, walletConfig, config, options = {}) { // XXX: currently only gap-limit can use streaming modes mode = HistorySyncMode.POLLING_HTTP_API; } - // eslint-disable-next-line no-console - console.log(`Configuring wallet ${sanitizeLogInput(walletId)} for history sync mode: ${mode}`); + const appLogger = buildAppLogger(); + appLogger.info(`Configuring wallet ${sanitizeLogInput(walletId)} for history sync mode: ${mode}`); wallet.setHistorySyncMode(mode); if (config.gapLimit) { @@ -139,8 +139,7 @@ async function startWallet(walletId, walletConfig, config, options = {}) { const info = await wallet.start(); // The replace avoids Log Injection - // eslint-disable-next-line no-console - console.log(`Wallet started with wallet id ${sanitizeLogInput(walletId)}. \ + appLogger.info(`Wallet started with wallet id ${sanitizeLogInput(walletId)}. \ Full-node info: ${JSON.stringify(info, null, 2)}`); initializedWallets.set(walletId, wallet);