@fileverse-dev/formulajs 4.4.11-mod-80 → 4.4.11-mod-82

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/lib/cjs/index.cjs CHANGED
@@ -13189,48 +13189,99 @@ class InvalidApiKeyError extends Error {
13189
13189
  }
13190
13190
  }
13191
13191
 
13192
- const fileverseProxyUrl = `${window.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`;
13193
- // Proxy map configuration
13194
- const PROXY_MAP = {
13192
+ let PROXY_MAP;
13193
+
13194
+ function initializeProxyMap() {
13195
+ console.log('initializeProxyMap', window.NEXT_PUBLIC_PROXY_BASE_URL);
13196
+ if (!PROXY_MAP) {
13197
+ const fileverseProxyUrl = `${window.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`;
13198
+
13199
+ PROXY_MAP = {
13195
13200
  Etherscan: {
13196
- url: fileverseProxyUrl,
13201
+ url: `${fileverseProxyUrl}/proxy`,
13197
13202
  removeParams: ['apikey']
13198
13203
  },
13199
13204
  Basescan: {
13200
- url: fileverseProxyUrl,
13205
+ url: `${fileverseProxyUrl}/proxy`,
13201
13206
  removeParams: ['apikey']
13202
13207
  },
13203
13208
  Gnosisscan: {
13204
- url: fileverseProxyUrl,
13209
+ url: `${fileverseProxyUrl}/proxy`,
13205
13210
  removeParams: ['apikey']
13206
13211
  },
13207
13212
  Coingecko: {
13208
- url: fileverseProxyUrl,
13213
+ url: `${fileverseProxyUrl}/proxy`,
13209
13214
  removeParams: ['apikey']
13210
13215
  },
13211
13216
  Firefly: {
13212
- url: fileverseProxyUrl,
13217
+ url: `${fileverseProxyUrl}/proxy`,
13213
13218
  removeParams: ['apikey']
13214
13219
  },
13215
13220
  Neynar: {
13216
- url: fileverseProxyUrl,
13221
+ url: `${fileverseProxyUrl}/proxy`,
13217
13222
  removeParams: ['api_key']
13218
13223
  },
13219
13224
  Safe: {
13220
- url: fileverseProxyUrl,
13225
+ url: `${fileverseProxyUrl}/proxy`,
13221
13226
  removeParams: ['api_key']
13222
13227
  },
13223
13228
  Defillama: {
13224
- url: fileverseProxyUrl,
13229
+ url: `${fileverseProxyUrl}/proxy`,
13225
13230
  removeParams: ['api_key']
13226
13231
  },
13227
13232
  GnosisPay: {
13228
- url: fileverseProxyUrl,
13233
+ url: `${fileverseProxyUrl}/proxy`,
13229
13234
  removeParams: ['api_key']
13230
13235
  },
13231
13236
  // Add more services as needed. It can be direct url instead of ENV variable
13232
13237
  // ANOTHER_SERVICE: "https://another-proxy-url.com"
13233
13238
  };
13239
+ }
13240
+ return PROXY_MAP;
13241
+ }
13242
+
13243
+ // const fileverseProxyUrl = `${window.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`
13244
+ // // Proxy map configuration
13245
+ // const PROXY_MAP = {
13246
+ // Etherscan: {
13247
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13248
+ // removeParams: ['apikey']
13249
+ // },
13250
+ // Basescan: {
13251
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13252
+ // removeParams: ['apikey']
13253
+ // },
13254
+ // Gnosisscan: {
13255
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13256
+ // removeParams: ['apikey']
13257
+ // },
13258
+ // Coingecko: {
13259
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13260
+ // removeParams: ['apikey']
13261
+ // },
13262
+ // Firefly: {
13263
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13264
+ // removeParams: ['apikey']
13265
+ // },
13266
+ // Neynar: {
13267
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13268
+ // removeParams: ['api_key']
13269
+ // },
13270
+ // Safe: {
13271
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13272
+ // removeParams: ['api_key']
13273
+ // },
13274
+ // Defillama: {
13275
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13276
+ // removeParams: ['api_key']
13277
+ // },
13278
+ // GnosisPay: {
13279
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13280
+ // removeParams: ['api_key']
13281
+ // },
13282
+ // // Add more services as needed. It can be direct url instead of ENV variable
13283
+ // // ANOTHER_SERVICE: "https://another-proxy-url.com"
13284
+ // };
13234
13285
 
13235
13286
  /**
13236
13287
  * Removes specified parameters from a URL
@@ -13262,12 +13313,13 @@ function removeUrlParams(url, paramsToRemove) {
13262
13313
  * @returns {Object} Object containing URL and HEADERS for the fetch request
13263
13314
  */
13264
13315
  function getUrlAndHeaders({ url, serviceName, headers = {} }) {
13316
+ const proxyMap = initializeProxyMap();
13265
13317
  // Check if proxy is enabled in localStorage
13266
13318
  const apiKeyLS = window.localStorage.getItem(SERVICES_API_KEY[serviceName]);
13267
13319
  const isProxyModeEnabledValue = apiKeyLS === 'DEFAULT_PROXY_MODE';
13268
13320
 
13269
13321
  // Check if proxy URL exists for this service
13270
- const proxyConfig = PROXY_MAP[serviceName];
13322
+ const proxyConfig = proxyMap[serviceName];
13271
13323
 
13272
13324
  if (!proxyConfig && SERVICES_API_KEY[serviceName] && (!apiKeyLS || apiKeyLS === '')) {
13273
13325
  throw new MissingApiKeyError(SERVICES_API_KEY[serviceName])
package/lib/esm/index.mjs CHANGED
@@ -13187,48 +13187,99 @@ class InvalidApiKeyError extends Error {
13187
13187
  }
13188
13188
  }
13189
13189
 
13190
- const fileverseProxyUrl = `${window.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`;
13191
- // Proxy map configuration
13192
- const PROXY_MAP = {
13190
+ let PROXY_MAP;
13191
+
13192
+ function initializeProxyMap() {
13193
+ console.log('initializeProxyMap', window.NEXT_PUBLIC_PROXY_BASE_URL);
13194
+ if (!PROXY_MAP) {
13195
+ const fileverseProxyUrl = `${window.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`;
13196
+
13197
+ PROXY_MAP = {
13193
13198
  Etherscan: {
13194
- url: fileverseProxyUrl,
13199
+ url: `${fileverseProxyUrl}/proxy`,
13195
13200
  removeParams: ['apikey']
13196
13201
  },
13197
13202
  Basescan: {
13198
- url: fileverseProxyUrl,
13203
+ url: `${fileverseProxyUrl}/proxy`,
13199
13204
  removeParams: ['apikey']
13200
13205
  },
13201
13206
  Gnosisscan: {
13202
- url: fileverseProxyUrl,
13207
+ url: `${fileverseProxyUrl}/proxy`,
13203
13208
  removeParams: ['apikey']
13204
13209
  },
13205
13210
  Coingecko: {
13206
- url: fileverseProxyUrl,
13211
+ url: `${fileverseProxyUrl}/proxy`,
13207
13212
  removeParams: ['apikey']
13208
13213
  },
13209
13214
  Firefly: {
13210
- url: fileverseProxyUrl,
13215
+ url: `${fileverseProxyUrl}/proxy`,
13211
13216
  removeParams: ['apikey']
13212
13217
  },
13213
13218
  Neynar: {
13214
- url: fileverseProxyUrl,
13219
+ url: `${fileverseProxyUrl}/proxy`,
13215
13220
  removeParams: ['api_key']
13216
13221
  },
13217
13222
  Safe: {
13218
- url: fileverseProxyUrl,
13223
+ url: `${fileverseProxyUrl}/proxy`,
13219
13224
  removeParams: ['api_key']
13220
13225
  },
13221
13226
  Defillama: {
13222
- url: fileverseProxyUrl,
13227
+ url: `${fileverseProxyUrl}/proxy`,
13223
13228
  removeParams: ['api_key']
13224
13229
  },
13225
13230
  GnosisPay: {
13226
- url: fileverseProxyUrl,
13231
+ url: `${fileverseProxyUrl}/proxy`,
13227
13232
  removeParams: ['api_key']
13228
13233
  },
13229
13234
  // Add more services as needed. It can be direct url instead of ENV variable
13230
13235
  // ANOTHER_SERVICE: "https://another-proxy-url.com"
13231
13236
  };
13237
+ }
13238
+ return PROXY_MAP;
13239
+ }
13240
+
13241
+ // const fileverseProxyUrl = `${window.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`
13242
+ // // Proxy map configuration
13243
+ // const PROXY_MAP = {
13244
+ // Etherscan: {
13245
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13246
+ // removeParams: ['apikey']
13247
+ // },
13248
+ // Basescan: {
13249
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13250
+ // removeParams: ['apikey']
13251
+ // },
13252
+ // Gnosisscan: {
13253
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13254
+ // removeParams: ['apikey']
13255
+ // },
13256
+ // Coingecko: {
13257
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13258
+ // removeParams: ['apikey']
13259
+ // },
13260
+ // Firefly: {
13261
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13262
+ // removeParams: ['apikey']
13263
+ // },
13264
+ // Neynar: {
13265
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13266
+ // removeParams: ['api_key']
13267
+ // },
13268
+ // Safe: {
13269
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13270
+ // removeParams: ['api_key']
13271
+ // },
13272
+ // Defillama: {
13273
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13274
+ // removeParams: ['api_key']
13275
+ // },
13276
+ // GnosisPay: {
13277
+ // url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
13278
+ // removeParams: ['api_key']
13279
+ // },
13280
+ // // Add more services as needed. It can be direct url instead of ENV variable
13281
+ // // ANOTHER_SERVICE: "https://another-proxy-url.com"
13282
+ // };
13232
13283
 
13233
13284
  /**
13234
13285
  * Removes specified parameters from a URL
@@ -13260,12 +13311,13 @@ function removeUrlParams(url, paramsToRemove) {
13260
13311
  * @returns {Object} Object containing URL and HEADERS for the fetch request
13261
13312
  */
13262
13313
  function getUrlAndHeaders({ url, serviceName, headers = {} }) {
13314
+ const proxyMap = initializeProxyMap();
13263
13315
  // Check if proxy is enabled in localStorage
13264
13316
  const apiKeyLS = window.localStorage.getItem(SERVICES_API_KEY[serviceName]);
13265
13317
  const isProxyModeEnabledValue = apiKeyLS === 'DEFAULT_PROXY_MODE';
13266
13318
 
13267
13319
  // Check if proxy URL exists for this service
13268
- const proxyConfig = PROXY_MAP[serviceName];
13320
+ const proxyConfig = proxyMap[serviceName];
13269
13321
 
13270
13322
  if (!proxyConfig && SERVICES_API_KEY[serviceName] && (!apiKeyLS || apiKeyLS === '')) {
13271
13323
  throw new MissingApiKeyError(SERVICES_API_KEY[serviceName])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/formulajs",
3
- "version": "4.4.11-mod-80",
3
+ "version": "4.4.11-mod-82",
4
4
  "description": "JavaScript implementation of most Microsoft Excel formula functions",
5
5
  "author": "Formulajs",
6
6
  "publishConfig": {