@lazyneoaz/metachat 4.0.5 → 4.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.cjs CHANGED
@@ -25048,6 +25048,9 @@ function originOf(referer) {
25048
25048
  function isMessengerHost(host) {
25049
25049
  return /(^|\.)messenger\.com$/i.test(host);
25050
25050
  }
25051
+ function isEdgeChatHost(host) {
25052
+ return /(^|\.)edge-chat\.messenger\.com$/i.test(host) || /(^|\.)edge-chat\.facebook\.com$/i.test(host);
25053
+ }
25051
25054
  function isBusinessHost(host) {
25052
25055
  return /(^|\.)business\.facebook\.com$/i.test(host);
25053
25056
  }
@@ -25151,7 +25154,7 @@ function getHeaders(url2, options, ctx, customHeader) {
25151
25154
  const friendlyName = customHeader?.["x-fb-friendly-name"] || customHeader?.["X-Fb-Friendly-Name"];
25152
25155
  if (friendlyName) headers["x-fb-friendly-name"] = sanitizeHeaderValue2(friendlyName);
25153
25156
  }
25154
- if (ctx?.region) {
25157
+ if (ctx?.region && (isMessengerHost(u.hostname) || isEdgeChatHost(u.hostname))) {
25155
25158
  const regionValue = sanitizeHeaderValue2(ctx.region);
25156
25159
  if (regionValue) headers["X-MSGR-Region"] = regionValue;
25157
25160
  }
@@ -94242,7 +94245,7 @@ init_constants();
94242
94245
  var SEARCH_DOC_ID = "23943555345255534";
94243
94246
  var SEARCH_FRIENDLY_NAME = "StoriesCreateMusicSelectorMainPageQuery";
94244
94247
  var GRAPHQL_URL = "https://www.facebook.com/api/graphql/";
94245
- var PRODUCT = "FB_COMPOSER";
94248
+ var PRODUCT = "FB_CAMERA";
94246
94249
  function textOf(node) {
94247
94250
  if (node == null) return "";
94248
94251
  if (typeof node === "string") return node;
package/dist/index.mjs CHANGED
@@ -25013,6 +25013,9 @@ function originOf(referer) {
25013
25013
  function isMessengerHost(host) {
25014
25014
  return /(^|\.)messenger\.com$/i.test(host);
25015
25015
  }
25016
+ function isEdgeChatHost(host) {
25017
+ return /(^|\.)edge-chat\.messenger\.com$/i.test(host) || /(^|\.)edge-chat\.facebook\.com$/i.test(host);
25018
+ }
25016
25019
  function isBusinessHost(host) {
25017
25020
  return /(^|\.)business\.facebook\.com$/i.test(host);
25018
25021
  }
@@ -25116,7 +25119,7 @@ function getHeaders(url2, options, ctx, customHeader) {
25116
25119
  const friendlyName = customHeader?.["x-fb-friendly-name"] || customHeader?.["X-Fb-Friendly-Name"];
25117
25120
  if (friendlyName) headers["x-fb-friendly-name"] = sanitizeHeaderValue2(friendlyName);
25118
25121
  }
25119
- if (ctx?.region) {
25122
+ if (ctx?.region && (isMessengerHost(u.hostname) || isEdgeChatHost(u.hostname))) {
25120
25123
  const regionValue = sanitizeHeaderValue2(ctx.region);
25121
25124
  if (regionValue) headers["X-MSGR-Region"] = regionValue;
25122
25125
  }
@@ -94207,7 +94210,7 @@ init_constants();
94207
94210
  var SEARCH_DOC_ID = "23943555345255534";
94208
94211
  var SEARCH_FRIENDLY_NAME = "StoriesCreateMusicSelectorMainPageQuery";
94209
94212
  var GRAPHQL_URL = "https://www.facebook.com/api/graphql/";
94210
- var PRODUCT = "FB_COMPOSER";
94213
+ var PRODUCT = "FB_CAMERA";
94211
94214
  function textOf(node) {
94212
94215
  if (node == null) return "";
94213
94216
  if (typeof node === "string") return node;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazyneoaz/metachat",
3
- "version": "4.0.5",
3
+ "version": "4.0.6",
4
4
  "description": "A modern TypeScript Facebook Chat API client for building reliable Messenger bots, with built-in anti-detection protection, automatic cookie refresh, music search, and AI theme support.",
5
5
  "license": "MIT",
6
6
  "author": {