@mtproto/core
Advanced tools
Comparing version 3.0.0-beta.7 to 3.0.0
@@ -1,4 +0,4 @@ | ||
const { MTProto } = require('./src'); | ||
const { getSRPParams } = require('./src/utils/crypto'); | ||
import { MTProto } from './src/index.js'; | ||
import { getSRPParams } from './src/utils/crypto/index.js'; | ||
module.exports = { MTProto, getSRPParams }; | ||
export { MTProto, getSRPParams }; |
143
package.json
{ | ||
"name": "@mtproto/core", | ||
"version": "3.0.0-beta.7", | ||
"version": "3.0.0", | ||
"description": "Telegram API (MTProto) client library for browser and nodejs", | ||
@@ -42,10 +42,2 @@ "keywords": [ | ||
}, | ||
"scripts": { | ||
"start": "run-s merge-scheme && webpack-dev-server --color", | ||
"start:node": "run-s merge-scheme && node -r dotenv/config src/__playground/node.js", | ||
"watch": "karma start --browsers Chrome", | ||
"test": "karma start --browsers ChromeCI --single-run", | ||
"merge-scheme": "node scripts/merge-scheme.js", | ||
"prepublishOnly": "run-s merge-scheme" | ||
}, | ||
"license": "GPL-3.0", | ||
@@ -60,17 +52,120 @@ "dependencies": { | ||
}, | ||
"devDependencies": { | ||
"dotenv-webpack": "1.7.0", | ||
"dual-publish": "0.10.0", | ||
"html-webpack-plugin": "3.2.0", | ||
"jasmine-core": "3.5.0", | ||
"karma": "4.4.1", | ||
"karma-chrome-launcher": "3.1.0", | ||
"karma-jasmine": "3.1.1", | ||
"karma-mocha-reporter": "2.2.5", | ||
"karma-webpack": "4.0.2", | ||
"npm-run-all": "4.1.5", | ||
"webpack": "4.41.2", | ||
"webpack-cli": "3.3.10", | ||
"webpack-dev-server": "3.10.3" | ||
"type": "module", | ||
"main": "index.cjs", | ||
"module": "index.js", | ||
"react-native": "index.js", | ||
"exports": { | ||
"./package.json": "./package.json", | ||
".": { | ||
"require": "./index.cjs", | ||
"import": "./index.js" | ||
}, | ||
"./src/package.json": "./src/package.json", | ||
"./src": { | ||
"require": "./src/index.cjs", | ||
"import": "./src/index.js" | ||
}, | ||
"./src/meta/package.json": "./src/meta/package.json", | ||
"./src/meta": { | ||
"require": "./src/meta/index.cjs", | ||
"import": "./src/meta/index.js", | ||
"browser": "./src/meta/index.browser.js" | ||
}, | ||
"./src/rpc/package.json": "./src/rpc/package.json", | ||
"./src/rpc": { | ||
"require": "./src/rpc/index.cjs", | ||
"import": "./src/rpc/index.js" | ||
}, | ||
"./src/storage/package.json": "./src/storage/package.json", | ||
"./src/storage": { | ||
"require": "./src/storage/index.cjs", | ||
"import": "./src/storage/index.js" | ||
}, | ||
"./src/transport/package.json": "./src/transport/package.json", | ||
"./src/transport": { | ||
"require": "./src/transport/index.cjs", | ||
"import": "./src/transport/index.js", | ||
"browser": "./src/transport/index.browser.js" | ||
}, | ||
"./src/storage/local/package.json": "./src/storage/local/package.json", | ||
"./src/storage/local": { | ||
"require": "./src/storage/local/index.cjs", | ||
"import": "./src/storage/local/index.js", | ||
"browser": "./src/storage/local/index.browser.js" | ||
}, | ||
"./src/tl/deserializer/package.json": "./src/tl/deserializer/package.json", | ||
"./src/tl/deserializer": { | ||
"require": "./src/tl/deserializer/index.cjs", | ||
"import": "./src/tl/deserializer/index.js" | ||
}, | ||
"./src/tl/serializer/package.json": "./src/tl/serializer/package.json", | ||
"./src/tl/serializer": { | ||
"require": "./src/tl/serializer/index.cjs", | ||
"import": "./src/tl/serializer/index.js" | ||
}, | ||
"./src/transport/obfuscated/package.json": "./src/transport/obfuscated/package.json", | ||
"./src/transport/obfuscated": { | ||
"require": "./src/transport/obfuscated/index.cjs", | ||
"import": "./src/transport/obfuscated/index.js" | ||
}, | ||
"./src/transport/socket/package.json": "./src/transport/socket/package.json", | ||
"./src/transport/socket": { | ||
"require": "./src/transport/socket/index.cjs", | ||
"import": "./src/transport/socket/index.js" | ||
}, | ||
"./src/transport/tcp/package.json": "./src/transport/tcp/package.json", | ||
"./src/transport/tcp": { | ||
"require": "./src/transport/tcp/index.cjs", | ||
"import": "./src/transport/tcp/index.js" | ||
}, | ||
"./src/utils/common/package.json": "./src/utils/common/package.json", | ||
"./src/utils/common": { | ||
"require": "./src/utils/common/index.cjs", | ||
"import": "./src/utils/common/index.js" | ||
}, | ||
"./src/utils/crypto/package.json": "./src/utils/crypto/package.json", | ||
"./src/utils/crypto": { | ||
"require": "./src/utils/crypto/index.cjs", | ||
"import": "./src/utils/crypto/index.js" | ||
}, | ||
"./src/utils/pq/package.json": "./src/utils/pq/package.json", | ||
"./src/utils/pq": { | ||
"require": "./src/utils/pq/index.cjs", | ||
"import": "./src/utils/pq/index.js" | ||
}, | ||
"./src/utils/rsa/package.json": "./src/utils/rsa/package.json", | ||
"./src/utils/rsa": { | ||
"require": "./src/utils/rsa/index.cjs", | ||
"import": "./src/utils/rsa/index.js" | ||
}, | ||
"./src/utils/common/random/package.json": "./src/utils/common/random/package.json", | ||
"./src/utils/common/random": { | ||
"require": "./src/utils/common/random/index.cjs", | ||
"import": "./src/utils/common/random/index.js", | ||
"browser": "./src/utils/common/random/index.browser.js" | ||
}, | ||
"./src/utils/crypto/pbkdf2/package.json": "./src/utils/crypto/pbkdf2/package.json", | ||
"./src/utils/crypto/pbkdf2": { | ||
"require": "./src/utils/crypto/pbkdf2/index.cjs", | ||
"import": "./src/utils/crypto/pbkdf2/index.js", | ||
"browser": "./src/utils/crypto/pbkdf2/index.browser.js" | ||
}, | ||
"./src/utils/crypto/sha1/package.json": "./src/utils/crypto/sha1/package.json", | ||
"./src/utils/crypto/sha1": { | ||
"require": "./src/utils/crypto/sha1/index.cjs", | ||
"import": "./src/utils/crypto/sha1/index.js", | ||
"browser": "./src/utils/crypto/sha1/index.browser.js" | ||
}, | ||
"./src/utils/crypto/sha256/package.json": "./src/utils/crypto/sha256/package.json", | ||
"./src/utils/crypto/sha256": { | ||
"require": "./src/utils/crypto/sha256/index.cjs", | ||
"import": "./src/utils/crypto/sha256/index.js", | ||
"browser": "./src/utils/crypto/sha256/index.browser.js" | ||
}, | ||
"./scheme/package.json": "./scheme/package.json", | ||
"./scheme": { | ||
"require": "./scheme/index.cjs", | ||
"import": "./scheme/index.js" | ||
} | ||
} | ||
} | ||
} |
@@ -1,3 +0,3 @@ | ||
const EventEmitter = require('events'); | ||
const { RPC } = require('./rpc'); | ||
import EventEmitter from 'events'; | ||
import { RPC } from './rpc/index.js'; | ||
@@ -139,2 +139,2 @@ const TEST_DC_LIST = [ | ||
module.exports = { MTProto }; | ||
export { MTProto }; |
@@ -6,2 +6,2 @@ const meta = { | ||
module.exports = { meta }; | ||
export { meta }; |
@@ -6,2 +6,2 @@ const meta = { | ||
module.exports = { meta }; | ||
export { meta }; |
@@ -1,10 +0,10 @@ | ||
const bigInt = require('big-integer'); | ||
const debounce = require('lodash.debounce'); | ||
const EventEmitter = require('events'); | ||
const { meta } = require('../meta'); | ||
const Storage = require('../storage'); | ||
const { Transport } = require('../transport'); | ||
const TLSerializer = require('../tl/serializer'); | ||
const TLDeserializer = require('../tl/deserializer'); | ||
const { | ||
import bigInt from 'big-integer'; | ||
import debounce from 'lodash.debounce'; | ||
import EventEmitter from 'events'; | ||
import { meta } from '../meta/index.js'; | ||
import Storage from '../storage/index.js'; | ||
import { Transport } from '../transport/index.js'; | ||
import TLSerializer from '../tl/serializer/index.js'; | ||
import TLDeserializer from '../tl/deserializer/index.js'; | ||
import { | ||
bytesIsEqual, | ||
@@ -21,6 +21,6 @@ bytesToHex, | ||
xorBytes, | ||
} = require('../utils/common'); | ||
const { pqPrimeFactorization } = require('../utils/pq'); | ||
const { AES, RSA, SHA1, SHA256 } = require('../utils/crypto'); | ||
const { getRsaKeyByFingerprints } = require('../utils/rsa'); | ||
} from '../utils/common/index.js'; | ||
import { pqPrimeFactorization } from '../utils/pq/index.js'; | ||
import { AES, RSA, SHA1, SHA256 } from '../utils/crypto/index.js'; | ||
import { getRsaKeyByFingerprints } from '../utils/rsa/index.js'; | ||
@@ -643,2 +643,2 @@ class RPC { | ||
module.exports = { RPC }; | ||
export { RPC }; |
@@ -1,2 +0,2 @@ | ||
const { localStorage } = require('./local'); | ||
import { localStorage } from './local/index.js'; | ||
@@ -64,2 +64,2 @@ const cache = {}; | ||
module.exports = Storage; | ||
export default Storage; |
@@ -1,1 +0,1 @@ | ||
module.exports = { localStorage }; | ||
export { localStorage }; |
const localStorage = {}; | ||
module.exports = { localStorage }; | ||
export { localStorage }; |
@@ -1,5 +0,5 @@ | ||
const pako = require('pako'); | ||
const bigInt = require('big-integer'); | ||
const { schema } = require('../../../scheme'); | ||
const { uintToInt } = require('../../utils/common'); | ||
import pako from 'pako'; | ||
import bigInt from 'big-integer'; | ||
import { schema } from '../../../scheme/index.js'; | ||
import { uintToInt } from '../../utils/common/index.js'; | ||
@@ -199,2 +199,2 @@ class TLDeserializer { | ||
module.exports = TLDeserializer; | ||
export default TLDeserializer; |
@@ -1,4 +0,4 @@ | ||
const bigInt = require('big-integer'); | ||
const { schema } = require('../../../scheme'); | ||
const { intToUint, bigIntToBytes } = require('../../utils/common'); | ||
import bigInt from 'big-integer'; | ||
import { schema } from '../../../scheme/index.js'; | ||
import { intToUint, bigIntToBytes } from '../../utils/common/index.js'; | ||
@@ -286,2 +286,2 @@ class TLSerializer { | ||
module.exports = TLSerializer; | ||
export default TLSerializer; |
@@ -1,5 +0,5 @@ | ||
const { Socket } = require('./socket'); | ||
import { Socket } from './socket/index.js'; | ||
const Transport = Socket; | ||
module.exports = { Transport }; | ||
export { Transport }; |
@@ -1,5 +0,5 @@ | ||
const { TCP } = require('./tcp'); | ||
import { TCP } from './tcp/index.js'; | ||
const Transport = TCP; | ||
module.exports = { Transport }; | ||
export { Transport }; |
@@ -1,4 +0,4 @@ | ||
const EventEmitter = require('events'); | ||
const { AES } = require('../../utils/crypto'); | ||
const { getRandomBytes } = require('../../utils/common'); | ||
import EventEmitter from 'events'; | ||
import { AES } from '../../utils/crypto/index.js'; | ||
import { getRandomBytes } from '../../utils/common/index.js'; | ||
@@ -73,4 +73,4 @@ class Obfuscated extends EventEmitter { | ||
module.exports = { | ||
export { | ||
Obfuscated, | ||
}; |
@@ -1,2 +0,2 @@ | ||
const { Obfuscated } = require('../obfuscated'); | ||
import { Obfuscated } from '../obfuscated/index.js'; | ||
@@ -86,2 +86,2 @@ class Socket extends Obfuscated { | ||
module.exports = { Socket }; | ||
export { Socket }; |
@@ -1,3 +0,3 @@ | ||
const { Socket } = require('net'); | ||
const { Obfuscated } = require('../obfuscated'); | ||
import { Socket } from 'net'; | ||
import { Obfuscated } from '../obfuscated/index.js'; | ||
@@ -92,2 +92,2 @@ class TCP extends Obfuscated { | ||
module.exports = { TCP }; | ||
export { TCP }; |
@@ -1,3 +0,3 @@ | ||
const bigInt = require('big-integer'); | ||
const { getRandomBytes } = require('./random'); | ||
import bigInt from 'big-integer'; | ||
import { getRandomBytes } from './random/index.js'; | ||
@@ -214,3 +214,3 @@ function bytesIsEqual(bytes1, bytes2) { | ||
module.exports = { | ||
export { | ||
bytesIsEqual, | ||
@@ -217,0 +217,0 @@ bigIntToBytes, |
@@ -7,2 +7,2 @@ function getRandomBytes(length) { | ||
module.exports = { getRandomBytes }; | ||
export { getRandomBytes }; |
@@ -1,2 +0,2 @@ | ||
const crypto = require('crypto'); | ||
import crypto from 'crypto'; | ||
@@ -7,2 +7,2 @@ function getRandomBytes(length) { | ||
module.exports = { getRandomBytes }; | ||
export { getRandomBytes }; |
@@ -1,4 +0,4 @@ | ||
const aesjs = require('aes-js'); | ||
const bigInt = require('big-integer'); | ||
const { | ||
import aesjs from 'aes-js'; | ||
import bigInt from 'big-integer'; | ||
import { | ||
bigIntToBytes, | ||
@@ -9,6 +9,6 @@ bytesToBigInt, | ||
xorBytes, | ||
} = require('../../utils/common'); | ||
const { SHA1 } = require('./sha1'); | ||
const { SHA256 } = require('./sha256'); | ||
const { PBKDF2 } = require('./pbkdf2'); | ||
} from '../../utils/common/index.js'; | ||
import { SHA1 } from './sha1/index.js'; | ||
import { SHA256 } from './sha256/index.js'; | ||
import { PBKDF2 } from './pbkdf2/index.js'; | ||
@@ -166,2 +166,2 @@ const AES = aesjs.AES; | ||
module.exports = { AES, RSA, SHA1, SHA256, getSRPParams }; | ||
export { AES, RSA, SHA1, SHA256, getSRPParams }; |
@@ -22,2 +22,2 @@ async function PBKDF2(password, salt, iterations) { | ||
module.exports = { PBKDF2 }; | ||
export { PBKDF2 }; |
@@ -1,2 +0,2 @@ | ||
const crypto = require('crypto'); | ||
import crypto from 'crypto'; | ||
@@ -7,2 +7,2 @@ async function PBKDF2(password, salt, iterations) { | ||
module.exports = { PBKDF2 }; | ||
export { PBKDF2 }; |
@@ -5,2 +5,2 @@ async function SHA1(data) { | ||
module.exports = { SHA1 }; | ||
export { SHA1 }; |
@@ -1,2 +0,2 @@ | ||
const crypto = require('crypto'); | ||
import crypto from 'crypto'; | ||
@@ -13,2 +13,2 @@ async function SHA1(data) { | ||
module.exports = { SHA1 }; | ||
export { SHA1 }; |
@@ -5,2 +5,2 @@ async function SHA256(data) { | ||
module.exports = { SHA256 }; | ||
export { SHA256 }; |
@@ -1,2 +0,2 @@ | ||
const crypto = require('crypto'); | ||
import crypto from 'crypto'; | ||
@@ -13,2 +13,2 @@ async function SHA256(data) { | ||
module.exports = { SHA256 }; | ||
export { SHA256 }; |
@@ -1,2 +0,2 @@ | ||
const { | ||
import { | ||
eGCD_, | ||
@@ -16,4 +16,4 @@ greater, | ||
bpe, | ||
} = require('leemon'); | ||
const { bytesFromHex, bytesToBigInt, getRandomInt } = require('../common'); | ||
} from 'leemon'; | ||
import { bytesFromHex, bytesToBigInt, getRandomInt } from '../common/index.js'; | ||
@@ -118,4 +118,4 @@ function bytesFromLeemonBigInt(bigInt, len) { | ||
module.exports = { | ||
export { | ||
pqPrimeFactorization, | ||
}; |
@@ -1,5 +0,5 @@ | ||
const bigInt = require('big-integer'); | ||
const TLSerializer = require('../../tl/serializer'); | ||
const { bytesToHex, bytesFromHex } = require('../../utils/common'); | ||
const { SHA1 } = require('../../utils/crypto'); | ||
import bigInt from 'big-integer'; | ||
import TLSerializer from '../../tl/serializer/index.js'; | ||
import { bytesToHex, bytesFromHex } from '../../utils/common/index.js'; | ||
import { SHA1 } from '../../utils/crypto/index.js'; | ||
@@ -80,2 +80,2 @@ const publisKeys = [ | ||
module.exports = { getRsaKeyByFingerprints }; | ||
export { getRsaKeyByFingerprints }; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1113999
0
73
47664
0
1
Yes
2