@xuda.io/drive_module 1.1.986 → 1.1.987

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.
Files changed (2) hide show
  1. package/index.js +18 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1709,6 +1709,23 @@ const ocr_drive_file = async function (app_id, doc) {
1709
1709
 
1710
1710
  if (!target_file) throw "bucket not find";
1711
1711
 
1712
+ function addQueryParam(urlString, key, value) {
1713
+ // Parse the URL
1714
+ const parsedUrl = new url.URL(urlString);
1715
+
1716
+ // Set the query parameter
1717
+ parsedUrl.searchParams.set(key, value);
1718
+
1719
+ // Return the updated URL
1720
+ return parsedUrl.toString();
1721
+ }
1722
+
1723
+ target_file = addQueryParam(
1724
+ target_file,
1725
+ "xuda_internal_request_code",
1726
+ _conf.xuda_internal_request_code
1727
+ );
1728
+
1712
1729
  try {
1713
1730
  doc.ocr_stat = 2;
1714
1731
  doc.ocr_stat_date = Date.now();
@@ -1743,6 +1760,7 @@ const ocr_drive_file = async function (app_id, doc) {
1743
1760
  // Default to English if no language found
1744
1761
  return lang;
1745
1762
  }
1763
+
1746
1764
  let lang = detectLanguageByCountry(doc.country);
1747
1765
 
1748
1766
  const generalConfig = { oem: 1, psm: 3, lang };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.986",
3
+ "version": "1.1.987",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {