chore (backend-rs): update napi-rs dependencies
This commit is contained in:
parent
977a989a24
commit
16e88f4739
7 changed files with 2140 additions and 1127 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
@ -1819,9 +1819,9 @@ checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a"
|
|||
|
||||
[[package]]
|
||||
name = "napi-derive"
|
||||
version = "2.16.5"
|
||||
version = "3.0.0-alpha.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4"
|
||||
checksum = "c230c813bfd4d6c7aafead3c075b37f0cf7fecb38be8f4cf5cfcee0b2c273ad0"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"convert_case",
|
||||
|
@ -1833,9 +1833,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "napi-derive-backend"
|
||||
version = "1.0.67"
|
||||
version = "2.0.0-alpha.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e"
|
||||
checksum = "4370cc24c2e58d0f3393527b282eb00f1158b304248f549e1ec81bd2927db5fe"
|
||||
dependencies = [
|
||||
"convert_case",
|
||||
"once_cell",
|
||||
|
|
|
@ -7,7 +7,7 @@ macros = { path = "packages/macro-rs/macros" }
|
|||
macros-impl = { path = "packages/macro-rs/macros-impl" }
|
||||
|
||||
napi = { git = "https://github.com/napi-rs/napi-rs.git", rev = "ca2cd5c35a0c39ec4a94e93c6c5695b681046df2" }
|
||||
napi-derive = "2.16.5"
|
||||
napi-derive = "3.0.0-alpha.1"
|
||||
napi-build = "2.1.3"
|
||||
|
||||
argon2 = { version = "0.5.3", default-features = false }
|
||||
|
|
|
@ -32,4 +32,3 @@ index.js index.d.ts: $(SRC)
|
|||
rm --force index.js index.d.ts
|
||||
cp built/index.js index.js
|
||||
cp built/index.d.ts index.d.ts
|
||||
sed -i 's/^ \*r"/ */g' index.d.ts
|
||||
|
|
1606
packages/backend-rs/index.d.ts
vendored
1606
packages/backend-rs/index.d.ts
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,404 +1,453 @@
|
|||
/* tslint:disable */
|
||||
// prettier-ignore
|
||||
/* eslint-disable */
|
||||
/* prettier-ignore */
|
||||
|
||||
/* auto-generated by NAPI-RS */
|
||||
|
||||
const { existsSync, readFileSync } = require('fs')
|
||||
const { join } = require('path')
|
||||
|
||||
const { platform, arch } = process
|
||||
const { readFileSync } = require('fs')
|
||||
|
||||
let nativeBinding = null
|
||||
let localFileExisted = false
|
||||
let loadError = null
|
||||
const loadErrors = []
|
||||
|
||||
function isMusl() {
|
||||
// For Node 10
|
||||
if (!process.report || typeof process.report.getReport !== 'function') {
|
||||
const isMusl = () => {
|
||||
let musl = false
|
||||
if (process.platform === 'linux') {
|
||||
musl = isMuslFromFilesystem()
|
||||
if (musl === null) {
|
||||
musl = isMuslFromReport()
|
||||
}
|
||||
if (musl === null) {
|
||||
musl = isMuslFromChildProcess()
|
||||
}
|
||||
}
|
||||
return musl
|
||||
}
|
||||
|
||||
const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
|
||||
|
||||
const isMuslFromFilesystem = () => {
|
||||
try {
|
||||
const lddPath = require('child_process').execSync('which ldd').toString().trim()
|
||||
return readFileSync(lddPath, 'utf8').includes('musl')
|
||||
} catch (e) {
|
||||
return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
const isMuslFromReport = () => {
|
||||
const report = typeof process.report.getReport === 'function' ? process.report.getReport() : null
|
||||
if (!report) {
|
||||
return null
|
||||
}
|
||||
if (report.header && report.header.glibcVersionRuntime) {
|
||||
return false
|
||||
}
|
||||
if (Array.isArray(report.sharedObjects)) {
|
||||
if (report.sharedObjects.some(isFileMusl)) {
|
||||
return true
|
||||
}
|
||||
} else {
|
||||
const { glibcVersionRuntime } = process.report.getReport().header
|
||||
return !glibcVersionRuntime
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
const isMuslFromChildProcess = () => {
|
||||
try {
|
||||
return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
|
||||
} catch (e) {
|
||||
// If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
switch (platform) {
|
||||
case 'android':
|
||||
switch (arch) {
|
||||
case 'arm64':
|
||||
localFileExisted = existsSync(join(__dirname, 'backend-rs.android-arm64.node'))
|
||||
function requireNative() {
|
||||
if (process.platform === 'android') {
|
||||
if (process.arch === 'arm64') {
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.android-arm64.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-android-arm64')
|
||||
}
|
||||
return require('./backend-rs.android-arm64.node')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
break
|
||||
case 'arm':
|
||||
localFileExisted = existsSync(join(__dirname, 'backend-rs.android-arm-eabi.node'))
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.android-arm-eabi.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-android-arm-eabi')
|
||||
}
|
||||
return require('backend-rs-android-arm64')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
break
|
||||
default:
|
||||
throw new Error(`Unsupported architecture on Android ${arch}`)
|
||||
}
|
||||
break
|
||||
case 'win32':
|
||||
switch (arch) {
|
||||
case 'x64':
|
||||
localFileExisted = existsSync(
|
||||
join(__dirname, 'backend-rs.win32-x64-msvc.node')
|
||||
)
|
||||
|
||||
} else if (process.arch === 'arm') {
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.win32-x64-msvc.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-win32-x64-msvc')
|
||||
}
|
||||
return require('./backend-rs.android-arm-eabi.node')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
break
|
||||
case 'ia32':
|
||||
localFileExisted = existsSync(
|
||||
join(__dirname, 'backend-rs.win32-ia32-msvc.node')
|
||||
)
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.win32-ia32-msvc.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-win32-ia32-msvc')
|
||||
}
|
||||
return require('backend-rs-android-arm-eabi')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
break
|
||||
case 'arm64':
|
||||
localFileExisted = existsSync(
|
||||
join(__dirname, 'backend-rs.win32-arm64-msvc.node')
|
||||
)
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.win32-arm64-msvc.node')
|
||||
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-win32-arm64-msvc')
|
||||
loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
|
||||
}
|
||||
} else if (process.platform === 'win32') {
|
||||
if (process.arch === 'x64') {
|
||||
try {
|
||||
return require('./backend-rs.win32-x64-msvc.node')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
break
|
||||
default:
|
||||
throw new Error(`Unsupported architecture on Windows: ${arch}`)
|
||||
}
|
||||
break
|
||||
case 'darwin':
|
||||
localFileExisted = existsSync(join(__dirname, 'backend-rs.darwin-universal.node'))
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.darwin-universal.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-darwin-universal')
|
||||
}
|
||||
break
|
||||
} catch {}
|
||||
switch (arch) {
|
||||
case 'x64':
|
||||
localFileExisted = existsSync(join(__dirname, 'backend-rs.darwin-x64.node'))
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.darwin-x64.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-darwin-x64')
|
||||
}
|
||||
return require('backend-rs-win32-x64-msvc')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
break
|
||||
case 'arm64':
|
||||
localFileExisted = existsSync(
|
||||
join(__dirname, 'backend-rs.darwin-arm64.node')
|
||||
)
|
||||
|
||||
} else if (process.arch === 'ia32') {
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.darwin-arm64.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-darwin-arm64')
|
||||
}
|
||||
return require('./backend-rs.win32-ia32-msvc.node')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
break
|
||||
default:
|
||||
throw new Error(`Unsupported architecture on macOS: ${arch}`)
|
||||
}
|
||||
break
|
||||
case 'freebsd':
|
||||
if (arch !== 'x64') {
|
||||
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
|
||||
}
|
||||
localFileExisted = existsSync(join(__dirname, 'backend-rs.freebsd-x64.node'))
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.freebsd-x64.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-freebsd-x64')
|
||||
}
|
||||
return require('backend-rs-win32-ia32-msvc')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
break
|
||||
case 'linux':
|
||||
switch (arch) {
|
||||
case 'x64':
|
||||
|
||||
} else if (process.arch === 'arm64') {
|
||||
try {
|
||||
return require('./backend-rs.win32-arm64-msvc.node')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
try {
|
||||
return require('backend-rs-win32-arm64-msvc')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
|
||||
} else {
|
||||
loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
|
||||
}
|
||||
} else if (process.platform === 'darwin') {
|
||||
try {
|
||||
return require('./backend-rs.darwin-universal.node')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
try {
|
||||
return require('backend-rs-darwin-universal')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
|
||||
if (process.arch === 'x64') {
|
||||
try {
|
||||
return require('./backend-rs.darwin-x64.node')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
try {
|
||||
return require('backend-rs-darwin-x64')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
|
||||
} else if (process.arch === 'arm64') {
|
||||
try {
|
||||
return require('./backend-rs.darwin-arm64.node')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
try {
|
||||
return require('backend-rs-darwin-arm64')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
|
||||
} else {
|
||||
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
|
||||
}
|
||||
} else if (process.platform === 'freebsd') {
|
||||
if (process.arch === 'x64') {
|
||||
try {
|
||||
return require('./backend-rs.freebsd-x64.node')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
try {
|
||||
return require('backend-rs-freebsd-x64')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
|
||||
} else if (process.arch === 'arm64') {
|
||||
try {
|
||||
return require('./backend-rs.freebsd-arm64.node')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
try {
|
||||
return require('backend-rs-freebsd-arm64')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
|
||||
} else {
|
||||
loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
|
||||
}
|
||||
} else if (process.platform === 'linux') {
|
||||
if (process.arch === 'x64') {
|
||||
if (isMusl()) {
|
||||
localFileExisted = existsSync(
|
||||
join(__dirname, 'backend-rs.linux-x64-musl.node')
|
||||
)
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.linux-x64-musl.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-linux-x64-musl')
|
||||
}
|
||||
return require('./backend-rs.linux-x64-musl.node')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
} else {
|
||||
localFileExisted = existsSync(
|
||||
join(__dirname, 'backend-rs.linux-x64-gnu.node')
|
||||
)
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.linux-x64-gnu.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-linux-x64-gnu')
|
||||
}
|
||||
return require('backend-rs-linux-x64-musl')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
|
||||
} else {
|
||||
try {
|
||||
return require('./backend-rs.linux-x64-gnu.node')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
break
|
||||
case 'arm64':
|
||||
try {
|
||||
return require('backend-rs-linux-x64-gnu')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
|
||||
}
|
||||
} else if (process.arch === 'arm64') {
|
||||
if (isMusl()) {
|
||||
localFileExisted = existsSync(
|
||||
join(__dirname, 'backend-rs.linux-arm64-musl.node')
|
||||
)
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.linux-arm64-musl.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-linux-arm64-musl')
|
||||
}
|
||||
return require('./backend-rs.linux-arm64-musl.node')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
} else {
|
||||
localFileExisted = existsSync(
|
||||
join(__dirname, 'backend-rs.linux-arm64-gnu.node')
|
||||
)
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.linux-arm64-gnu.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-linux-arm64-gnu')
|
||||
}
|
||||
return require('backend-rs-linux-arm64-musl')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
|
||||
} else {
|
||||
try {
|
||||
return require('./backend-rs.linux-arm64-gnu.node')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
break
|
||||
case 'arm':
|
||||
try {
|
||||
return require('backend-rs-linux-arm64-gnu')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
|
||||
}
|
||||
} else if (process.arch === 'arm') {
|
||||
if (isMusl()) {
|
||||
localFileExisted = existsSync(
|
||||
join(__dirname, 'backend-rs.linux-arm-musleabihf.node')
|
||||
)
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.linux-arm-musleabihf.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-linux-arm-musleabihf')
|
||||
}
|
||||
return require('./backend-rs.linux-arm-musleabihf.node')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
} else {
|
||||
localFileExisted = existsSync(
|
||||
join(__dirname, 'backend-rs.linux-arm-gnueabihf.node')
|
||||
)
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.linux-arm-gnueabihf.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-linux-arm-gnueabihf')
|
||||
}
|
||||
return require('backend-rs-linux-arm-musleabihf')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
|
||||
} else {
|
||||
try {
|
||||
return require('./backend-rs.linux-arm-gnueabihf.node')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
break
|
||||
case 'riscv64':
|
||||
try {
|
||||
return require('backend-rs-linux-arm-gnueabihf')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
|
||||
}
|
||||
} else if (process.arch === 'riscv64') {
|
||||
if (isMusl()) {
|
||||
localFileExisted = existsSync(
|
||||
join(__dirname, 'backend-rs.linux-riscv64-musl.node')
|
||||
)
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.linux-riscv64-musl.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-linux-riscv64-musl')
|
||||
}
|
||||
return require('./backend-rs.linux-riscv64-musl.node')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
} else {
|
||||
localFileExisted = existsSync(
|
||||
join(__dirname, 'backend-rs.linux-riscv64-gnu.node')
|
||||
)
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.linux-riscv64-gnu.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-linux-riscv64-gnu')
|
||||
}
|
||||
return require('backend-rs-linux-riscv64-musl')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
}
|
||||
break
|
||||
case 's390x':
|
||||
localFileExisted = existsSync(
|
||||
join(__dirname, 'backend-rs.linux-s390x-gnu.node')
|
||||
)
|
||||
|
||||
} else {
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./backend-rs.linux-s390x-gnu.node')
|
||||
} else {
|
||||
nativeBinding = require('backend-rs-linux-s390x-gnu')
|
||||
}
|
||||
return require('./backend-rs.linux-riscv64-gnu.node')
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
loadErrors.push(e)
|
||||
}
|
||||
try {
|
||||
return require('backend-rs-linux-riscv64-gnu')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
|
||||
}
|
||||
} else if (process.arch === 'ppc64') {
|
||||
try {
|
||||
return require('./backend-rs.linux-ppc64-gnu.node')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
try {
|
||||
return require('backend-rs-linux-ppc64-gnu')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
|
||||
} else if (process.arch === 's390x') {
|
||||
try {
|
||||
return require('./backend-rs.linux-s390x-gnu.node')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
try {
|
||||
return require('backend-rs-linux-s390x-gnu')
|
||||
} catch (e) {
|
||||
loadErrors.push(e)
|
||||
}
|
||||
|
||||
} else {
|
||||
loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
|
||||
}
|
||||
} else {
|
||||
loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
|
||||
}
|
||||
}
|
||||
|
||||
nativeBinding = requireNative()
|
||||
|
||||
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
||||
try {
|
||||
nativeBinding = require('./backend-rs.wasi.cjs')
|
||||
} catch (err) {
|
||||
if (process.env.NAPI_RS_FORCE_WASI) {
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
if (!nativeBinding) {
|
||||
try {
|
||||
nativeBinding = require('backend-rs-wasm32-wasi')
|
||||
} catch (err) {
|
||||
if (process.env.NAPI_RS_FORCE_WASI) {
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
break
|
||||
default:
|
||||
throw new Error(`Unsupported architecture on Linux: ${arch}`)
|
||||
}
|
||||
break
|
||||
default:
|
||||
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
|
||||
}
|
||||
|
||||
if (!nativeBinding) {
|
||||
if (loadError) {
|
||||
throw loadError
|
||||
if (loadErrors.length > 0) {
|
||||
// TODO Link to documentation with potential fixes
|
||||
// - The package owner could build/publish bindings for this arch
|
||||
// - The user may need to bundle the correct files
|
||||
// - The user may need to re-install node_modules to get new packages
|
||||
throw new Error('Failed to load native binding', { cause: loadErrors })
|
||||
}
|
||||
throw new Error(`Failed to load native binding`)
|
||||
}
|
||||
|
||||
const { SECOND, MINUTE, HOUR, DAY, USER_ONLINE_THRESHOLD, USER_ACTIVE_THRESHOLD, FILE_TYPE_BROWSERSAFE, fetchMeta, updateMetaCache, metaToPugArgs, loadConfig, stringToAcct, acctToString, fetchNodeinfo, nodeinfo_2_1, nodeinfo_2_0, updateNodeinfoCache, Protocol, Inbound, Outbound, greet, initializeRustLogger, showServerInfo, isBlockedServer, isSilencedServer, isAllowedServer, checkWordMute, getFullApAccount, isSelfHost, isSameOrigin, extractHost, toPuny, isUnicodeEmoji, sqlLikeEscape, safeForSql, formatMilliseconds, getImageSizeFromUrl, isQuote, isSafeUrl, latestVersion, toMastodonId, fromMastodonId, getNoteSummary, nyaify, hashPassword, verifyPassword, isOldPasswordAlgorithm, decodeReaction, countReactions, toDbReaction, removeOldAttestationChallenges, cpuInfo, cpuUsage, memoryUsage, storageUsage, AntennaSrc, DriveFileUsageHint, MutedNoteReason, NoteVisibility, NotificationType, PageVisibility, PollNoteVisibility, RelayStatus, UserEmojiModPerm, UserProfileFfvisibility, UserProfileMutingNotificationTypes, updateAntennasOnNewNote, updateAntennaCache, watchNote, unwatchNote, PushNotificationKind, sendPushNotification, publishToChannelStream, publishToChatStream, ChatIndexEvent, publishToChatIndexStream, publishToBroadcastStream, DriveFileEvent, DriveFolderEvent, publishToDriveFileStream, publishToDriveFolderStream, publishToGroupChatStream, publishToModerationStream, publishToNotesStream, ChatEvent, getTimestamp, genId, genIdAt, generateSecureRandomString, generateUserToken } = nativeBinding
|
||||
|
||||
module.exports.SECOND = SECOND
|
||||
module.exports.MINUTE = MINUTE
|
||||
module.exports.HOUR = HOUR
|
||||
module.exports.DAY = DAY
|
||||
module.exports.USER_ONLINE_THRESHOLD = USER_ONLINE_THRESHOLD
|
||||
module.exports.USER_ACTIVE_THRESHOLD = USER_ACTIVE_THRESHOLD
|
||||
module.exports.FILE_TYPE_BROWSERSAFE = FILE_TYPE_BROWSERSAFE
|
||||
module.exports.fetchMeta = fetchMeta
|
||||
module.exports.updateMetaCache = updateMetaCache
|
||||
module.exports.metaToPugArgs = metaToPugArgs
|
||||
module.exports.loadConfig = loadConfig
|
||||
module.exports.stringToAcct = stringToAcct
|
||||
module.exports.acctToString = acctToString
|
||||
module.exports.fetchNodeinfo = fetchNodeinfo
|
||||
module.exports.nodeinfo_2_1 = nodeinfo_2_1
|
||||
module.exports.nodeinfo_2_0 = nodeinfo_2_0
|
||||
module.exports.updateNodeinfoCache = updateNodeinfoCache
|
||||
module.exports.Protocol = Protocol
|
||||
module.exports.Inbound = Inbound
|
||||
module.exports.Outbound = Outbound
|
||||
module.exports.greet = greet
|
||||
module.exports.initializeRustLogger = initializeRustLogger
|
||||
module.exports.showServerInfo = showServerInfo
|
||||
module.exports.isBlockedServer = isBlockedServer
|
||||
module.exports.isSilencedServer = isSilencedServer
|
||||
module.exports.isAllowedServer = isAllowedServer
|
||||
module.exports.checkWordMute = checkWordMute
|
||||
module.exports.getFullApAccount = getFullApAccount
|
||||
module.exports.isSelfHost = isSelfHost
|
||||
module.exports.isSameOrigin = isSameOrigin
|
||||
module.exports.extractHost = extractHost
|
||||
module.exports.toPuny = toPuny
|
||||
module.exports.isUnicodeEmoji = isUnicodeEmoji
|
||||
module.exports.sqlLikeEscape = sqlLikeEscape
|
||||
module.exports.safeForSql = safeForSql
|
||||
module.exports.formatMilliseconds = formatMilliseconds
|
||||
module.exports.getImageSizeFromUrl = getImageSizeFromUrl
|
||||
module.exports.isQuote = isQuote
|
||||
module.exports.isSafeUrl = isSafeUrl
|
||||
module.exports.latestVersion = latestVersion
|
||||
module.exports.toMastodonId = toMastodonId
|
||||
module.exports.fromMastodonId = fromMastodonId
|
||||
module.exports.getNoteSummary = getNoteSummary
|
||||
module.exports.nyaify = nyaify
|
||||
module.exports.hashPassword = hashPassword
|
||||
module.exports.verifyPassword = verifyPassword
|
||||
module.exports.isOldPasswordAlgorithm = isOldPasswordAlgorithm
|
||||
module.exports.decodeReaction = decodeReaction
|
||||
module.exports.countReactions = countReactions
|
||||
module.exports.toDbReaction = toDbReaction
|
||||
module.exports.removeOldAttestationChallenges = removeOldAttestationChallenges
|
||||
module.exports.cpuInfo = cpuInfo
|
||||
module.exports.cpuUsage = cpuUsage
|
||||
module.exports.memoryUsage = memoryUsage
|
||||
module.exports.storageUsage = storageUsage
|
||||
module.exports.AntennaSrc = AntennaSrc
|
||||
module.exports.DriveFileUsageHint = DriveFileUsageHint
|
||||
module.exports.MutedNoteReason = MutedNoteReason
|
||||
module.exports.NoteVisibility = NoteVisibility
|
||||
module.exports.NotificationType = NotificationType
|
||||
module.exports.PageVisibility = PageVisibility
|
||||
module.exports.PollNoteVisibility = PollNoteVisibility
|
||||
module.exports.RelayStatus = RelayStatus
|
||||
module.exports.UserEmojiModPerm = UserEmojiModPerm
|
||||
module.exports.UserProfileFfvisibility = UserProfileFfvisibility
|
||||
module.exports.UserProfileMutingNotificationTypes = UserProfileMutingNotificationTypes
|
||||
module.exports.updateAntennasOnNewNote = updateAntennasOnNewNote
|
||||
module.exports.updateAntennaCache = updateAntennaCache
|
||||
module.exports.watchNote = watchNote
|
||||
module.exports.unwatchNote = unwatchNote
|
||||
module.exports.PushNotificationKind = PushNotificationKind
|
||||
module.exports.sendPushNotification = sendPushNotification
|
||||
module.exports.publishToChannelStream = publishToChannelStream
|
||||
module.exports.publishToChatStream = publishToChatStream
|
||||
module.exports.ChatIndexEvent = ChatIndexEvent
|
||||
module.exports.publishToChatIndexStream = publishToChatIndexStream
|
||||
module.exports.publishToBroadcastStream = publishToBroadcastStream
|
||||
module.exports.DriveFileEvent = DriveFileEvent
|
||||
module.exports.DriveFolderEvent = DriveFolderEvent
|
||||
module.exports.publishToDriveFileStream = publishToDriveFileStream
|
||||
module.exports.publishToDriveFolderStream = publishToDriveFolderStream
|
||||
module.exports.publishToGroupChatStream = publishToGroupChatStream
|
||||
module.exports.publishToModerationStream = publishToModerationStream
|
||||
module.exports.publishToNotesStream = publishToNotesStream
|
||||
module.exports.ChatEvent = ChatEvent
|
||||
module.exports.getTimestamp = getTimestamp
|
||||
module.exports.genId = genId
|
||||
module.exports.genIdAt = genIdAt
|
||||
module.exports.generateSecureRandomString = generateSecureRandomString
|
||||
module.exports.generateUserToken = generateUserToken
|
||||
module.exports.acctToString = nativeBinding.acctToString
|
||||
module.exports.AntennaSrc = nativeBinding.AntennaSrc
|
||||
module.exports.ChatEvent = nativeBinding.ChatEvent
|
||||
module.exports.ChatIndexEvent = nativeBinding.ChatIndexEvent
|
||||
module.exports.checkWordMute = nativeBinding.checkWordMute
|
||||
module.exports.countReactions = nativeBinding.countReactions
|
||||
module.exports.cpuInfo = nativeBinding.cpuInfo
|
||||
module.exports.cpuUsage = nativeBinding.cpuUsage
|
||||
module.exports.DAY = nativeBinding.DAY
|
||||
module.exports.decodeReaction = nativeBinding.decodeReaction
|
||||
module.exports.DriveFileEvent = nativeBinding.DriveFileEvent
|
||||
module.exports.DriveFileUsageHint = nativeBinding.DriveFileUsageHint
|
||||
module.exports.DriveFolderEvent = nativeBinding.DriveFolderEvent
|
||||
module.exports.extractHost = nativeBinding.extractHost
|
||||
module.exports.fetchMeta = nativeBinding.fetchMeta
|
||||
module.exports.fetchNodeinfo = nativeBinding.fetchNodeinfo
|
||||
module.exports.FILE_TYPE_BROWSERSAFE = nativeBinding.FILE_TYPE_BROWSERSAFE
|
||||
module.exports.formatMilliseconds = nativeBinding.formatMilliseconds
|
||||
module.exports.fromMastodonId = nativeBinding.fromMastodonId
|
||||
module.exports.generateSecureRandomString = nativeBinding.generateSecureRandomString
|
||||
module.exports.generateUserToken = nativeBinding.generateUserToken
|
||||
module.exports.genId = nativeBinding.genId
|
||||
module.exports.genIdAt = nativeBinding.genIdAt
|
||||
module.exports.getFullApAccount = nativeBinding.getFullApAccount
|
||||
module.exports.getImageSizeFromUrl = nativeBinding.getImageSizeFromUrl
|
||||
module.exports.getNoteSummary = nativeBinding.getNoteSummary
|
||||
module.exports.getTimestamp = nativeBinding.getTimestamp
|
||||
module.exports.greet = nativeBinding.greet
|
||||
module.exports.hashPassword = nativeBinding.hashPassword
|
||||
module.exports.HOUR = nativeBinding.HOUR
|
||||
module.exports.Inbound = nativeBinding.Inbound
|
||||
module.exports.initializeRustLogger = nativeBinding.initializeRustLogger
|
||||
module.exports.isAllowedServer = nativeBinding.isAllowedServer
|
||||
module.exports.isBlockedServer = nativeBinding.isBlockedServer
|
||||
module.exports.isOldPasswordAlgorithm = nativeBinding.isOldPasswordAlgorithm
|
||||
module.exports.isQuote = nativeBinding.isQuote
|
||||
module.exports.isSafeUrl = nativeBinding.isSafeUrl
|
||||
module.exports.isSameOrigin = nativeBinding.isSameOrigin
|
||||
module.exports.isSelfHost = nativeBinding.isSelfHost
|
||||
module.exports.isSilencedServer = nativeBinding.isSilencedServer
|
||||
module.exports.isUnicodeEmoji = nativeBinding.isUnicodeEmoji
|
||||
module.exports.latestVersion = nativeBinding.latestVersion
|
||||
module.exports.loadConfig = nativeBinding.loadConfig
|
||||
module.exports.memoryUsage = nativeBinding.memoryUsage
|
||||
module.exports.metaToPugArgs = nativeBinding.metaToPugArgs
|
||||
module.exports.MINUTE = nativeBinding.MINUTE
|
||||
module.exports.MutedNoteReason = nativeBinding.MutedNoteReason
|
||||
module.exports.nodeinfo_2_0 = nativeBinding.nodeinfo_2_0
|
||||
module.exports.nodeinfo_2_1 = nativeBinding.nodeinfo_2_1
|
||||
module.exports.NoteVisibility = nativeBinding.NoteVisibility
|
||||
module.exports.NotificationType = nativeBinding.NotificationType
|
||||
module.exports.nyaify = nativeBinding.nyaify
|
||||
module.exports.Outbound = nativeBinding.Outbound
|
||||
module.exports.PageVisibility = nativeBinding.PageVisibility
|
||||
module.exports.PollNoteVisibility = nativeBinding.PollNoteVisibility
|
||||
module.exports.Protocol = nativeBinding.Protocol
|
||||
module.exports.publishToBroadcastStream = nativeBinding.publishToBroadcastStream
|
||||
module.exports.publishToChannelStream = nativeBinding.publishToChannelStream
|
||||
module.exports.publishToChatIndexStream = nativeBinding.publishToChatIndexStream
|
||||
module.exports.publishToChatStream = nativeBinding.publishToChatStream
|
||||
module.exports.publishToDriveFileStream = nativeBinding.publishToDriveFileStream
|
||||
module.exports.publishToDriveFolderStream = nativeBinding.publishToDriveFolderStream
|
||||
module.exports.publishToGroupChatStream = nativeBinding.publishToGroupChatStream
|
||||
module.exports.publishToModerationStream = nativeBinding.publishToModerationStream
|
||||
module.exports.publishToNotesStream = nativeBinding.publishToNotesStream
|
||||
module.exports.PushNotificationKind = nativeBinding.PushNotificationKind
|
||||
module.exports.RelayStatus = nativeBinding.RelayStatus
|
||||
module.exports.removeOldAttestationChallenges = nativeBinding.removeOldAttestationChallenges
|
||||
module.exports.safeForSql = nativeBinding.safeForSql
|
||||
module.exports.SECOND = nativeBinding.SECOND
|
||||
module.exports.sendPushNotification = nativeBinding.sendPushNotification
|
||||
module.exports.showServerInfo = nativeBinding.showServerInfo
|
||||
module.exports.sqlLikeEscape = nativeBinding.sqlLikeEscape
|
||||
module.exports.storageUsage = nativeBinding.storageUsage
|
||||
module.exports.stringToAcct = nativeBinding.stringToAcct
|
||||
module.exports.toDbReaction = nativeBinding.toDbReaction
|
||||
module.exports.toMastodonId = nativeBinding.toMastodonId
|
||||
module.exports.toPuny = nativeBinding.toPuny
|
||||
module.exports.unwatchNote = nativeBinding.unwatchNote
|
||||
module.exports.updateAntennaCache = nativeBinding.updateAntennaCache
|
||||
module.exports.updateAntennasOnNewNote = nativeBinding.updateAntennasOnNewNote
|
||||
module.exports.updateMetaCache = nativeBinding.updateMetaCache
|
||||
module.exports.updateNodeinfoCache = nativeBinding.updateNodeinfoCache
|
||||
module.exports.USER_ACTIVE_THRESHOLD = nativeBinding.USER_ACTIVE_THRESHOLD
|
||||
module.exports.USER_ONLINE_THRESHOLD = nativeBinding.USER_ONLINE_THRESHOLD
|
||||
module.exports.UserEmojiModPerm = nativeBinding.UserEmojiModPerm
|
||||
module.exports.UserProfileFfvisibility = nativeBinding.UserProfileFfvisibility
|
||||
module.exports.UserProfileMutingNotificationTypes = nativeBinding.UserProfileMutingNotificationTypes
|
||||
module.exports.verifyPassword = nativeBinding.verifyPassword
|
||||
module.exports.watchNote = nativeBinding.watchNote
|
||||
|
|
|
@ -4,30 +4,29 @@
|
|||
"main": "built/index.js",
|
||||
"types": "built/index.d.ts",
|
||||
"napi": {
|
||||
"name": "backend-rs",
|
||||
"triples": {
|
||||
"additional": [
|
||||
"binaryName": "backend-rs",
|
||||
"targets": [
|
||||
"aarch64-apple-darwin",
|
||||
"aarch64-linux-android",
|
||||
"aarch64-unknown-linux-gnu",
|
||||
"aarch64-unknown-linux-musl",
|
||||
"aarch64-pc-windows-msvc",
|
||||
"armv7-unknown-linux-gnueabihf",
|
||||
"x86_64-unknown-linux-gnu",
|
||||
"x86_64-unknown-linux-musl",
|
||||
"x86_64-unknown-freebsd",
|
||||
"i686-pc-windows-msvc",
|
||||
"armv7-linux-androideabi",
|
||||
"universal-apple-darwin"
|
||||
]
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@napi-rs/cli": "2.18.3"
|
||||
"@napi-rs/cli": "3.0.0-alpha.55"
|
||||
},
|
||||
"scripts": {
|
||||
"artifacts": "napi artifacts",
|
||||
"build": "RUSTFLAGS='-C target-cpu=native' napi build --features napi --no-const-enum --platform --release ./built/",
|
||||
"build:debug": "napi build --features napi --no-const-enum --platform ./built/",
|
||||
"build": "RUSTFLAGS='-C target-cpu=native' napi build --features napi --no-const-enum --platform --release --output-dir ./built/",
|
||||
"build:debug": "napi build --features napi --no-const-enum --platform --output-dir ./built/",
|
||||
"prepublishOnly": "napi prepublish -t npm",
|
||||
"universal": "napi universal",
|
||||
"version": "napi version"
|
||||
|
|
802
pnpm-lock.yaml
802
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue