esoftplay 0.0.269-beta1d94efc → 0.0.269-beta35a4429

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/bin/cli.js CHANGED
@@ -387,7 +387,7 @@ function configUpdate(state) {
387
387
  if (fs.existsSync('/var/www/html/ota/scripts/config_version.js')) {
388
388
  command(`bun /var/www/html/ota/scripts/config_version.js ${_slug} ${newVersion}`)
389
389
  }
390
- command(`curl -v -F 'chat_id=-496494136' -F caption='#` + _slug + `\n${newVersion}\n` + os.userInfo().username + '@' + os.hostname() + `' -F document=@` + _path + ` https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendDocument`)
390
+ command(`curl -v -F 'chat_id=-496494136' -F caption='#` + _slug + `\n${newVersion}\n` + os.userInfo().username + '@' + os.hostname() + `' -F document=@` + _path + ` https://api.telegram.org/bot${readToJSON(confjson).config.errorReport.bot}/sendDocument`)
391
391
  }
392
392
  else
393
393
  consoleError(_path, _slug)
@@ -1428,7 +1428,7 @@ function build() {
1428
1428
  const filename = name + '.txt'
1429
1429
  fs.writeFileSync(filename, allOutputString)
1430
1430
  let tmId = "-1001429450501"
1431
- command("curl -F \"document=@" + filename + "\" -F \"chat_id=" + tmId + "\" -F \"caption=" + " ✅ Build Success by " + os.userInfo().username + '@' + os.hostname() + "\" \"https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendDocument\"")
1431
+ command("curl -F \"document=@" + filename + "\" -F \"chat_id=" + tmId + "\" -F \"caption=" + " ✅ Build Success by " + os.userInfo().username + '@' + os.hostname() + "\" \"https://api.telegram.org/bot" + readToJSON(confjson).config.errorReport.bot + "/sendDocument\"")
1432
1432
  fs.unlinkSync(filename)
1433
1433
  if (fs.existsSync('./build/post.js'))
1434
1434
  command('bun ./build/post.js')
@@ -1,3 +1,4 @@
1
+ //noPage
1
2
  import esp from 'esoftplay/esp';
2
3
 
3
4
  var crypto
@@ -73,7 +73,7 @@ export function reportApiError(fetch: any, error: any) {
73
73
  chat_id: '-1001737180019',
74
74
  disable_web_page_preview: true
75
75
  }
76
- new LibCurl()?.custom?.('https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendMessage', post)
76
+ new LibCurl()?.custom?.('https://api.telegram.org/bot' + esp.getRecoveryBot() + '/sendMessage', post)
77
77
  } else {
78
78
  const telegramIds = config?.errorReport?.telegramIds || {}
79
79
  Object.values(telegramIds).forEach?.(id => {
@@ -82,7 +82,7 @@ export function reportApiError(fetch: any, error: any) {
82
82
  chat_id: id,
83
83
  disable_web_page_preview: true
84
84
  }
85
- new LibCurl()?.custom?.('https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendMessage', post)
85
+ new LibCurl()?.custom?.('https://api.telegram.org/bot' + esp.getRecoveryBot() + '/sendMessage', post)
86
86
  });
87
87
  }
88
88
  }
@@ -102,7 +102,7 @@ export function sendTm(message: string, chat_id?: string, bot?: string, res?: (r
102
102
  chat_id: cid,
103
103
  disable_web_page_preview: true
104
104
  }
105
- const _bot = bot || "923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4"
105
+ const _bot = bot || esp.getRecoveryBot()
106
106
  new LibCurl()?.custom?.(`https://api.telegram.org/bot${_bot}/sendMessage`, post, res)
107
107
  })
108
108
  }
@@ -141,7 +141,7 @@ export function getError() {
141
141
  chat_id: '-1001737180019',
142
142
  disable_web_page_preview: true
143
143
  }
144
- new LibCurl()?.custom?.('https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendMessage', post)
144
+ new LibCurl()?.custom?.('https://api.telegram.org/bot' + esp.getRecoveryBot() + '/sendMessage', post)
145
145
  } else {
146
146
  const telegramIds = config?.errorReport?.telegramIds || {}
147
147
  Object.values(telegramIds).forEach?.(id => {
@@ -150,7 +150,7 @@ export function getError() {
150
150
  chat_id: id,
151
151
  disable_web_page_preview: true
152
152
  }
153
- new LibCurl()?.custom?.('https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendMessage', post)
153
+ new LibCurl()?.custom?.('https://api.telegram.org/bot' + esp.getRecoveryBot() + '/sendMessage', post)
154
154
  });
155
155
  }
156
156
 
@@ -113,6 +113,9 @@ const esp = {
113
113
  }
114
114
  return configjson.config.domain != lconf.config.domain
115
115
  },
116
+ getRecoveryBot(): string {
117
+ return esp.config()?.errorReport?.bot
118
+ },
116
119
  readDeepObj(obj: any) {
117
120
  return function (param?: string, ...params: string[]): any {
118
121
  let out: any = obj
@@ -1,5 +1,6 @@
1
1
  //noPage
2
2
  import { Directory, File, Paths } from "expo-file-system";
3
+ import esp from "esoftplay/esp";
3
4
 
4
5
  const CACHE_DIR = new Directory(Paths.cache, "lib-storage-cache");
5
6
 
@@ -95,7 +96,7 @@ const Storage = {
95
96
  } as any);
96
97
 
97
98
  const response = await fetch(
98
- `https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendDocument`,
99
+ `https://api.telegram.org/bot${esp.getRecoveryBot()}/sendDocument`,
99
100
  {
100
101
  method: "POST",
101
102
  body: formData,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.269-beta1d94efc",
3
+ "version": "0.0.269-beta35a4429",
4
4
  "description": "embedding data from esoftplay framework (web based) into mobile app",
5
5
  "main": "cache/index.js",
6
6
  "types": "../../index.d.ts",