@objectstack/core 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -250,10 +250,10 @@ var ObjectLogger = class _ObjectLogger {
250
250
  /**
251
251
  * Initialize Pino logger for Node.js
252
252
  */
253
- initPinoLogger() {
253
+ async initPinoLogger() {
254
254
  if (!this.isNode) return;
255
255
  try {
256
- const { createRequire } = eval('require("module")');
256
+ const { createRequire } = await import("module");
257
257
  this.require = createRequire(import.meta.url);
258
258
  const pino = this.require("pino");
259
259
  const pinoOptions = {
@@ -2226,12 +2226,6 @@ var HttpTestAdapter = class {
2226
2226
 
2227
2227
  // src/security/plugin-signature-verifier.ts
2228
2228
  var cryptoModule = null;
2229
- if (typeof globalThis.window === "undefined") {
2230
- try {
2231
- cryptoModule = eval('require("crypto")');
2232
- } catch {
2233
- }
2234
- }
2235
2229
  var PluginSignatureVerifier = class {
2236
2230
  constructor(config, logger) {
2237
2231
  this.config = config;
@@ -2387,7 +2381,13 @@ var PluginSignatureVerifier = class {
2387
2381
  }
2388
2382
  return this.verifyCryptoSignatureNode(data, signature, publicKey);
2389
2383
  }
2390
- verifyCryptoSignatureNode(data, signature, publicKey) {
2384
+ async verifyCryptoSignatureNode(data, signature, publicKey) {
2385
+ if (!cryptoModule) {
2386
+ try {
2387
+ cryptoModule = await import("crypto");
2388
+ } catch (e) {
2389
+ }
2390
+ }
2391
2391
  if (!cryptoModule) {
2392
2392
  this.logger.error("Crypto module not available for signature verification");
2393
2393
  return false;