@fre4x/telegram 1.1.7 → 1.1.8
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 +3 -367
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -6,13 +6,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var
|
|
10
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
11
|
-
}) : x)(function(x) {
|
|
12
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
13
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
14
|
-
});
|
|
15
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
9
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
16
10
|
try {
|
|
17
11
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
18
12
|
} catch (e) {
|
|
@@ -6896,364 +6890,6 @@ var require_dist = __commonJS({
|
|
|
6896
6890
|
}
|
|
6897
6891
|
});
|
|
6898
6892
|
|
|
6899
|
-
// ../node_modules/dotenv/package.json
|
|
6900
|
-
var require_package = __commonJS({
|
|
6901
|
-
"../node_modules/dotenv/package.json"(exports, module) {
|
|
6902
|
-
module.exports = {
|
|
6903
|
-
name: "dotenv",
|
|
6904
|
-
version: "16.6.1",
|
|
6905
|
-
description: "Loads environment variables from .env file",
|
|
6906
|
-
main: "lib/main.js",
|
|
6907
|
-
types: "lib/main.d.ts",
|
|
6908
|
-
exports: {
|
|
6909
|
-
".": {
|
|
6910
|
-
types: "./lib/main.d.ts",
|
|
6911
|
-
require: "./lib/main.js",
|
|
6912
|
-
default: "./lib/main.js"
|
|
6913
|
-
},
|
|
6914
|
-
"./config": "./config.js",
|
|
6915
|
-
"./config.js": "./config.js",
|
|
6916
|
-
"./lib/env-options": "./lib/env-options.js",
|
|
6917
|
-
"./lib/env-options.js": "./lib/env-options.js",
|
|
6918
|
-
"./lib/cli-options": "./lib/cli-options.js",
|
|
6919
|
-
"./lib/cli-options.js": "./lib/cli-options.js",
|
|
6920
|
-
"./package.json": "./package.json"
|
|
6921
|
-
},
|
|
6922
|
-
scripts: {
|
|
6923
|
-
"dts-check": "tsc --project tests/types/tsconfig.json",
|
|
6924
|
-
lint: "standard",
|
|
6925
|
-
pretest: "npm run lint && npm run dts-check",
|
|
6926
|
-
test: "tap run --allow-empty-coverage --disable-coverage --timeout=60000",
|
|
6927
|
-
"test:coverage": "tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
|
|
6928
|
-
prerelease: "npm test",
|
|
6929
|
-
release: "standard-version"
|
|
6930
|
-
},
|
|
6931
|
-
repository: {
|
|
6932
|
-
type: "git",
|
|
6933
|
-
url: "git://github.com/motdotla/dotenv.git"
|
|
6934
|
-
},
|
|
6935
|
-
homepage: "https://github.com/motdotla/dotenv#readme",
|
|
6936
|
-
funding: "https://dotenvx.com",
|
|
6937
|
-
keywords: [
|
|
6938
|
-
"dotenv",
|
|
6939
|
-
"env",
|
|
6940
|
-
".env",
|
|
6941
|
-
"environment",
|
|
6942
|
-
"variables",
|
|
6943
|
-
"config",
|
|
6944
|
-
"settings"
|
|
6945
|
-
],
|
|
6946
|
-
readmeFilename: "README.md",
|
|
6947
|
-
license: "BSD-2-Clause",
|
|
6948
|
-
devDependencies: {
|
|
6949
|
-
"@types/node": "^18.11.3",
|
|
6950
|
-
decache: "^4.6.2",
|
|
6951
|
-
sinon: "^14.0.1",
|
|
6952
|
-
standard: "^17.0.0",
|
|
6953
|
-
"standard-version": "^9.5.0",
|
|
6954
|
-
tap: "^19.2.0",
|
|
6955
|
-
typescript: "^4.8.4"
|
|
6956
|
-
},
|
|
6957
|
-
engines: {
|
|
6958
|
-
node: ">=12"
|
|
6959
|
-
},
|
|
6960
|
-
browser: {
|
|
6961
|
-
fs: false
|
|
6962
|
-
}
|
|
6963
|
-
};
|
|
6964
|
-
}
|
|
6965
|
-
});
|
|
6966
|
-
|
|
6967
|
-
// ../node_modules/dotenv/lib/main.js
|
|
6968
|
-
var require_main = __commonJS({
|
|
6969
|
-
"../node_modules/dotenv/lib/main.js"(exports, module) {
|
|
6970
|
-
var fs2 = __require("fs");
|
|
6971
|
-
var path2 = __require("path");
|
|
6972
|
-
var os2 = __require("os");
|
|
6973
|
-
var crypto = __require("crypto");
|
|
6974
|
-
var packageJson = require_package();
|
|
6975
|
-
var version2 = packageJson.version;
|
|
6976
|
-
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
6977
|
-
function parse3(src) {
|
|
6978
|
-
const obj = {};
|
|
6979
|
-
let lines = src.toString();
|
|
6980
|
-
lines = lines.replace(/\r\n?/mg, "\n");
|
|
6981
|
-
let match;
|
|
6982
|
-
while ((match = LINE.exec(lines)) != null) {
|
|
6983
|
-
const key = match[1];
|
|
6984
|
-
let value = match[2] || "";
|
|
6985
|
-
value = value.trim();
|
|
6986
|
-
const maybeQuote = value[0];
|
|
6987
|
-
value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
|
|
6988
|
-
if (maybeQuote === '"') {
|
|
6989
|
-
value = value.replace(/\\n/g, "\n");
|
|
6990
|
-
value = value.replace(/\\r/g, "\r");
|
|
6991
|
-
}
|
|
6992
|
-
obj[key] = value;
|
|
6993
|
-
}
|
|
6994
|
-
return obj;
|
|
6995
|
-
}
|
|
6996
|
-
function _parseVault(options) {
|
|
6997
|
-
options = options || {};
|
|
6998
|
-
const vaultPath = _vaultPath(options);
|
|
6999
|
-
options.path = vaultPath;
|
|
7000
|
-
const result = DotenvModule.configDotenv(options);
|
|
7001
|
-
if (!result.parsed) {
|
|
7002
|
-
const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
|
|
7003
|
-
err.code = "MISSING_DATA";
|
|
7004
|
-
throw err;
|
|
7005
|
-
}
|
|
7006
|
-
const keys = _dotenvKey(options).split(",");
|
|
7007
|
-
const length = keys.length;
|
|
7008
|
-
let decrypted;
|
|
7009
|
-
for (let i = 0; i < length; i++) {
|
|
7010
|
-
try {
|
|
7011
|
-
const key = keys[i].trim();
|
|
7012
|
-
const attrs = _instructions(result, key);
|
|
7013
|
-
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
|
|
7014
|
-
break;
|
|
7015
|
-
} catch (error48) {
|
|
7016
|
-
if (i + 1 >= length) {
|
|
7017
|
-
throw error48;
|
|
7018
|
-
}
|
|
7019
|
-
}
|
|
7020
|
-
}
|
|
7021
|
-
return DotenvModule.parse(decrypted);
|
|
7022
|
-
}
|
|
7023
|
-
function _warn(message) {
|
|
7024
|
-
console.log(`[dotenv@${version2}][WARN] ${message}`);
|
|
7025
|
-
}
|
|
7026
|
-
function _debug(message) {
|
|
7027
|
-
console.log(`[dotenv@${version2}][DEBUG] ${message}`);
|
|
7028
|
-
}
|
|
7029
|
-
function _log(message) {
|
|
7030
|
-
console.log(`[dotenv@${version2}] ${message}`);
|
|
7031
|
-
}
|
|
7032
|
-
function _dotenvKey(options) {
|
|
7033
|
-
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
|
|
7034
|
-
return options.DOTENV_KEY;
|
|
7035
|
-
}
|
|
7036
|
-
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
|
|
7037
|
-
return process.env.DOTENV_KEY;
|
|
7038
|
-
}
|
|
7039
|
-
return "";
|
|
7040
|
-
}
|
|
7041
|
-
function _instructions(result, dotenvKey) {
|
|
7042
|
-
let uri;
|
|
7043
|
-
try {
|
|
7044
|
-
uri = new URL(dotenvKey);
|
|
7045
|
-
} catch (error48) {
|
|
7046
|
-
if (error48.code === "ERR_INVALID_URL") {
|
|
7047
|
-
const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
|
|
7048
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
7049
|
-
throw err;
|
|
7050
|
-
}
|
|
7051
|
-
throw error48;
|
|
7052
|
-
}
|
|
7053
|
-
const key = uri.password;
|
|
7054
|
-
if (!key) {
|
|
7055
|
-
const err = new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
7056
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
7057
|
-
throw err;
|
|
7058
|
-
}
|
|
7059
|
-
const environment = uri.searchParams.get("environment");
|
|
7060
|
-
if (!environment) {
|
|
7061
|
-
const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
7062
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
7063
|
-
throw err;
|
|
7064
|
-
}
|
|
7065
|
-
const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
|
|
7066
|
-
const ciphertext = result.parsed[environmentKey];
|
|
7067
|
-
if (!ciphertext) {
|
|
7068
|
-
const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
|
|
7069
|
-
err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
|
|
7070
|
-
throw err;
|
|
7071
|
-
}
|
|
7072
|
-
return { ciphertext, key };
|
|
7073
|
-
}
|
|
7074
|
-
function _vaultPath(options) {
|
|
7075
|
-
let possibleVaultPath = null;
|
|
7076
|
-
if (options && options.path && options.path.length > 0) {
|
|
7077
|
-
if (Array.isArray(options.path)) {
|
|
7078
|
-
for (const filepath of options.path) {
|
|
7079
|
-
if (fs2.existsSync(filepath)) {
|
|
7080
|
-
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
7081
|
-
}
|
|
7082
|
-
}
|
|
7083
|
-
} else {
|
|
7084
|
-
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
7085
|
-
}
|
|
7086
|
-
} else {
|
|
7087
|
-
possibleVaultPath = path2.resolve(process.cwd(), ".env.vault");
|
|
7088
|
-
}
|
|
7089
|
-
if (fs2.existsSync(possibleVaultPath)) {
|
|
7090
|
-
return possibleVaultPath;
|
|
7091
|
-
}
|
|
7092
|
-
return null;
|
|
7093
|
-
}
|
|
7094
|
-
function _resolveHome(envPath) {
|
|
7095
|
-
return envPath[0] === "~" ? path2.join(os2.homedir(), envPath.slice(1)) : envPath;
|
|
7096
|
-
}
|
|
7097
|
-
function _configVault(options) {
|
|
7098
|
-
const debug = Boolean(options && options.debug);
|
|
7099
|
-
const quiet = options && "quiet" in options ? options.quiet : true;
|
|
7100
|
-
if (debug || !quiet) {
|
|
7101
|
-
_log("Loading env from encrypted .env.vault");
|
|
7102
|
-
}
|
|
7103
|
-
const parsed = DotenvModule._parseVault(options);
|
|
7104
|
-
let processEnv = process.env;
|
|
7105
|
-
if (options && options.processEnv != null) {
|
|
7106
|
-
processEnv = options.processEnv;
|
|
7107
|
-
}
|
|
7108
|
-
DotenvModule.populate(processEnv, parsed, options);
|
|
7109
|
-
return { parsed };
|
|
7110
|
-
}
|
|
7111
|
-
function configDotenv(options) {
|
|
7112
|
-
const dotenvPath = path2.resolve(process.cwd(), ".env");
|
|
7113
|
-
let encoding = "utf8";
|
|
7114
|
-
const debug = Boolean(options && options.debug);
|
|
7115
|
-
const quiet = options && "quiet" in options ? options.quiet : true;
|
|
7116
|
-
if (options && options.encoding) {
|
|
7117
|
-
encoding = options.encoding;
|
|
7118
|
-
} else {
|
|
7119
|
-
if (debug) {
|
|
7120
|
-
_debug("No encoding is specified. UTF-8 is used by default");
|
|
7121
|
-
}
|
|
7122
|
-
}
|
|
7123
|
-
let optionPaths = [dotenvPath];
|
|
7124
|
-
if (options && options.path) {
|
|
7125
|
-
if (!Array.isArray(options.path)) {
|
|
7126
|
-
optionPaths = [_resolveHome(options.path)];
|
|
7127
|
-
} else {
|
|
7128
|
-
optionPaths = [];
|
|
7129
|
-
for (const filepath of options.path) {
|
|
7130
|
-
optionPaths.push(_resolveHome(filepath));
|
|
7131
|
-
}
|
|
7132
|
-
}
|
|
7133
|
-
}
|
|
7134
|
-
let lastError;
|
|
7135
|
-
const parsedAll = {};
|
|
7136
|
-
for (const path3 of optionPaths) {
|
|
7137
|
-
try {
|
|
7138
|
-
const parsed = DotenvModule.parse(fs2.readFileSync(path3, { encoding }));
|
|
7139
|
-
DotenvModule.populate(parsedAll, parsed, options);
|
|
7140
|
-
} catch (e) {
|
|
7141
|
-
if (debug) {
|
|
7142
|
-
_debug(`Failed to load ${path3} ${e.message}`);
|
|
7143
|
-
}
|
|
7144
|
-
lastError = e;
|
|
7145
|
-
}
|
|
7146
|
-
}
|
|
7147
|
-
let processEnv = process.env;
|
|
7148
|
-
if (options && options.processEnv != null) {
|
|
7149
|
-
processEnv = options.processEnv;
|
|
7150
|
-
}
|
|
7151
|
-
DotenvModule.populate(processEnv, parsedAll, options);
|
|
7152
|
-
if (debug || !quiet) {
|
|
7153
|
-
const keysCount = Object.keys(parsedAll).length;
|
|
7154
|
-
const shortPaths = [];
|
|
7155
|
-
for (const filePath of optionPaths) {
|
|
7156
|
-
try {
|
|
7157
|
-
const relative = path2.relative(process.cwd(), filePath);
|
|
7158
|
-
shortPaths.push(relative);
|
|
7159
|
-
} catch (e) {
|
|
7160
|
-
if (debug) {
|
|
7161
|
-
_debug(`Failed to load ${filePath} ${e.message}`);
|
|
7162
|
-
}
|
|
7163
|
-
lastError = e;
|
|
7164
|
-
}
|
|
7165
|
-
}
|
|
7166
|
-
_log(`injecting env (${keysCount}) from ${shortPaths.join(",")}`);
|
|
7167
|
-
}
|
|
7168
|
-
if (lastError) {
|
|
7169
|
-
return { parsed: parsedAll, error: lastError };
|
|
7170
|
-
} else {
|
|
7171
|
-
return { parsed: parsedAll };
|
|
7172
|
-
}
|
|
7173
|
-
}
|
|
7174
|
-
function config2(options) {
|
|
7175
|
-
if (_dotenvKey(options).length === 0) {
|
|
7176
|
-
return DotenvModule.configDotenv(options);
|
|
7177
|
-
}
|
|
7178
|
-
const vaultPath = _vaultPath(options);
|
|
7179
|
-
if (!vaultPath) {
|
|
7180
|
-
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
7181
|
-
return DotenvModule.configDotenv(options);
|
|
7182
|
-
}
|
|
7183
|
-
return DotenvModule._configVault(options);
|
|
7184
|
-
}
|
|
7185
|
-
function decrypt(encrypted, keyStr) {
|
|
7186
|
-
const key = Buffer.from(keyStr.slice(-64), "hex");
|
|
7187
|
-
let ciphertext = Buffer.from(encrypted, "base64");
|
|
7188
|
-
const nonce = ciphertext.subarray(0, 12);
|
|
7189
|
-
const authTag = ciphertext.subarray(-16);
|
|
7190
|
-
ciphertext = ciphertext.subarray(12, -16);
|
|
7191
|
-
try {
|
|
7192
|
-
const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
|
|
7193
|
-
aesgcm.setAuthTag(authTag);
|
|
7194
|
-
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
7195
|
-
} catch (error48) {
|
|
7196
|
-
const isRange = error48 instanceof RangeError;
|
|
7197
|
-
const invalidKeyLength = error48.message === "Invalid key length";
|
|
7198
|
-
const decryptionFailed = error48.message === "Unsupported state or unable to authenticate data";
|
|
7199
|
-
if (isRange || invalidKeyLength) {
|
|
7200
|
-
const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
|
|
7201
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
7202
|
-
throw err;
|
|
7203
|
-
} else if (decryptionFailed) {
|
|
7204
|
-
const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
|
|
7205
|
-
err.code = "DECRYPTION_FAILED";
|
|
7206
|
-
throw err;
|
|
7207
|
-
} else {
|
|
7208
|
-
throw error48;
|
|
7209
|
-
}
|
|
7210
|
-
}
|
|
7211
|
-
}
|
|
7212
|
-
function populate(processEnv, parsed, options = {}) {
|
|
7213
|
-
const debug = Boolean(options && options.debug);
|
|
7214
|
-
const override = Boolean(options && options.override);
|
|
7215
|
-
if (typeof parsed !== "object") {
|
|
7216
|
-
const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
7217
|
-
err.code = "OBJECT_REQUIRED";
|
|
7218
|
-
throw err;
|
|
7219
|
-
}
|
|
7220
|
-
for (const key of Object.keys(parsed)) {
|
|
7221
|
-
if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
|
|
7222
|
-
if (override === true) {
|
|
7223
|
-
processEnv[key] = parsed[key];
|
|
7224
|
-
}
|
|
7225
|
-
if (debug) {
|
|
7226
|
-
if (override === true) {
|
|
7227
|
-
_debug(`"${key}" is already defined and WAS overwritten`);
|
|
7228
|
-
} else {
|
|
7229
|
-
_debug(`"${key}" is already defined and was NOT overwritten`);
|
|
7230
|
-
}
|
|
7231
|
-
}
|
|
7232
|
-
} else {
|
|
7233
|
-
processEnv[key] = parsed[key];
|
|
7234
|
-
}
|
|
7235
|
-
}
|
|
7236
|
-
}
|
|
7237
|
-
var DotenvModule = {
|
|
7238
|
-
configDotenv,
|
|
7239
|
-
_configVault,
|
|
7240
|
-
_parseVault,
|
|
7241
|
-
config: config2,
|
|
7242
|
-
decrypt,
|
|
7243
|
-
parse: parse3,
|
|
7244
|
-
populate
|
|
7245
|
-
};
|
|
7246
|
-
module.exports.configDotenv = DotenvModule.configDotenv;
|
|
7247
|
-
module.exports._configVault = DotenvModule._configVault;
|
|
7248
|
-
module.exports._parseVault = DotenvModule._parseVault;
|
|
7249
|
-
module.exports.config = DotenvModule.config;
|
|
7250
|
-
module.exports.decrypt = DotenvModule.decrypt;
|
|
7251
|
-
module.exports.parse = DotenvModule.parse;
|
|
7252
|
-
module.exports.populate = DotenvModule.populate;
|
|
7253
|
-
module.exports = DotenvModule;
|
|
7254
|
-
}
|
|
7255
|
-
});
|
|
7256
|
-
|
|
7257
6893
|
// ../node_modules/zod/v3/helpers/util.js
|
|
7258
6894
|
var util;
|
|
7259
6895
|
(function(util2) {
|
|
@@ -28233,8 +27869,8 @@ var StdioServerTransport = class {
|
|
|
28233
27869
|
};
|
|
28234
27870
|
|
|
28235
27871
|
// src/index.ts
|
|
28236
|
-
var import_dotenv = __toESM(require_main(), 1);
|
|
28237
27872
|
import { Telegraf } from "telegraf";
|
|
27873
|
+
import dotenv from "dotenv";
|
|
28238
27874
|
import { createHash } from "node:crypto";
|
|
28239
27875
|
import * as fs from "node:fs";
|
|
28240
27876
|
import os from "node:os";
|
|
@@ -28684,7 +28320,7 @@ function buildPermissionCallbackData(behavior, requestId) {
|
|
|
28684
28320
|
}
|
|
28685
28321
|
|
|
28686
28322
|
// src/index.ts
|
|
28687
|
-
|
|
28323
|
+
dotenv.config();
|
|
28688
28324
|
function isCallbackQueryUpdate(update) {
|
|
28689
28325
|
return typeof update === "object" && update !== null && "callback_query" in update && update.callback_query !== void 0;
|
|
28690
28326
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fre4x/telegram",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "Telegram MCP server implementing Claude Code Channels for bidirectional communication and remote permission relay.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
|
-
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && npx esbuild src/index.ts --bundle --outfile=dist/index.js --platform=node --format=esm --external:jsdom --external:canvas --external:telegraf --external:dompurify --banner:js=\"import{createRequire}from'module';const require=createRequire(import.meta.url);\" && node -e \"const fs=require('fs');const p='dist/index.js';const c=fs.readFileSync(p,'utf8');const next=c.startsWith('#!/usr/bin/env node')?c:'#!/usr/bin/env node\\n'+c;fs.writeFileSync(p,next);fs.chmodSync(p,0o755);\"",
|
|
14
|
+
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && npx esbuild src/index.ts --bundle --outfile=dist/index.js --platform=node --format=esm --external:jsdom --external:canvas --external:telegraf --external:dompurify --external:dotenv --banner:js=\"import{createRequire}from'module';const require=createRequire(import.meta.url);\" && node -e \"const fs=require('fs');const p='dist/index.js';const c=fs.readFileSync(p,'utf8');const next=c.startsWith('#!/usr/bin/env node')?c:'#!/usr/bin/env node\\n'+c;fs.writeFileSync(p,next);fs.chmodSync(p,0o755);\"",
|
|
15
15
|
"typecheck": "cross-env NODE_OPTIONS=--max-old-space-size=4096 tsc --noEmit",
|
|
16
16
|
"start": "node dist/index.js",
|
|
17
17
|
"dev": "tsx src/index.ts",
|