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]]
|
[[package]]
|
||||||
name = "napi-derive"
|
name = "napi-derive"
|
||||||
version = "2.16.5"
|
version = "3.0.0-alpha.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4"
|
checksum = "c230c813bfd4d6c7aafead3c075b37f0cf7fecb38be8f4cf5cfcee0b2c273ad0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"convert_case",
|
"convert_case",
|
||||||
|
@ -1833,9 +1833,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "napi-derive-backend"
|
name = "napi-derive-backend"
|
||||||
version = "1.0.67"
|
version = "2.0.0-alpha.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e"
|
checksum = "4370cc24c2e58d0f3393527b282eb00f1158b304248f549e1ec81bd2927db5fe"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"convert_case",
|
"convert_case",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
|
|
@ -7,7 +7,7 @@ macros = { path = "packages/macro-rs/macros" }
|
||||||
macros-impl = { path = "packages/macro-rs/macros-impl" }
|
macros-impl = { path = "packages/macro-rs/macros-impl" }
|
||||||
|
|
||||||
napi = { git = "https://github.com/napi-rs/napi-rs.git", rev = "ca2cd5c35a0c39ec4a94e93c6c5695b681046df2" }
|
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"
|
napi-build = "2.1.3"
|
||||||
|
|
||||||
argon2 = { version = "0.5.3", default-features = false }
|
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
|
rm --force index.js index.d.ts
|
||||||
cp built/index.js index.js
|
cp built/index.js index.js
|
||||||
cp built/index.d.ts index.d.ts
|
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 */
|
/* eslint-disable */
|
||||||
/* prettier-ignore */
|
|
||||||
|
|
||||||
/* auto-generated by NAPI-RS */
|
/* auto-generated by NAPI-RS */
|
||||||
|
|
||||||
const { existsSync, readFileSync } = require('fs')
|
const { readFileSync } = require('fs')
|
||||||
const { join } = require('path')
|
|
||||||
|
|
||||||
const { platform, arch } = process
|
|
||||||
|
|
||||||
let nativeBinding = null
|
let nativeBinding = null
|
||||||
let localFileExisted = false
|
const loadErrors = []
|
||||||
let loadError = null
|
|
||||||
|
|
||||||
function isMusl() {
|
const isMusl = () => {
|
||||||
// For Node 10
|
let musl = false
|
||||||
if (!process.report || typeof process.report.getReport !== 'function') {
|
if (process.platform === 'linux') {
|
||||||
try {
|
musl = isMuslFromFilesystem()
|
||||||
const lddPath = require('child_process').execSync('which ldd').toString().trim()
|
if (musl === null) {
|
||||||
return readFileSync(lddPath, 'utf8').includes('musl')
|
musl = isMuslFromReport()
|
||||||
} catch (e) {
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
} else {
|
if (musl === null) {
|
||||||
const { glibcVersionRuntime } = process.report.getReport().header
|
musl = isMuslFromChildProcess()
|
||||||
return !glibcVersionRuntime
|
}
|
||||||
|
}
|
||||||
|
return musl
|
||||||
|
}
|
||||||
|
|
||||||
|
const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
|
||||||
|
|
||||||
|
const isMuslFromFilesystem = () => {
|
||||||
|
try {
|
||||||
|
return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
|
||||||
|
} catch {
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (platform) {
|
const isMuslFromReport = () => {
|
||||||
case 'android':
|
const report = typeof process.report.getReport === 'function' ? process.report.getReport() : null
|
||||||
switch (arch) {
|
if (!report) {
|
||||||
case 'arm64':
|
return null
|
||||||
localFileExisted = existsSync(join(__dirname, 'backend-rs.android-arm64.node'))
|
}
|
||||||
try {
|
if (report.header && report.header.glibcVersionRuntime) {
|
||||||
if (localFileExisted) {
|
return false
|
||||||
nativeBinding = require('./backend-rs.android-arm64.node')
|
}
|
||||||
} else {
|
if (Array.isArray(report.sharedObjects)) {
|
||||||
nativeBinding = require('backend-rs-android-arm64')
|
if (report.sharedObjects.some(isFileMusl)) {
|
||||||
}
|
return true
|
||||||
} catch (e) {
|
|
||||||
loadError = 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')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
throw new Error(`Unsupported architecture on Android ${arch}`)
|
|
||||||
}
|
}
|
||||||
break
|
}
|
||||||
case 'win32':
|
return false
|
||||||
switch (arch) {
|
}
|
||||||
case 'x64':
|
|
||||||
localFileExisted = existsSync(
|
const isMuslFromChildProcess = () => {
|
||||||
join(__dirname, 'backend-rs.win32-x64-msvc.node')
|
try {
|
||||||
)
|
return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
|
||||||
try {
|
} catch (e) {
|
||||||
if (localFileExisted) {
|
// If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
|
||||||
nativeBinding = require('./backend-rs.win32-x64-msvc.node')
|
return false
|
||||||
} else {
|
}
|
||||||
nativeBinding = require('backend-rs-win32-x64-msvc')
|
}
|
||||||
}
|
|
||||||
} catch (e) {
|
function requireNative() {
|
||||||
loadError = e
|
if (process.platform === 'android') {
|
||||||
}
|
if (process.arch === 'arm64') {
|
||||||
break
|
try {
|
||||||
case 'ia32':
|
return require('./backend-rs.android-arm64.node')
|
||||||
localFileExisted = existsSync(
|
} catch (e) {
|
||||||
join(__dirname, 'backend-rs.win32-ia32-msvc.node')
|
loadErrors.push(e)
|
||||||
)
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./backend-rs.win32-ia32-msvc.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('backend-rs-win32-ia32-msvc')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = 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')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = 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
|
try {
|
||||||
} catch {}
|
return require('backend-rs-android-arm64')
|
||||||
switch (arch) {
|
} catch (e) {
|
||||||
case 'x64':
|
loadErrors.push(e)
|
||||||
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')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'arm64':
|
|
||||||
localFileExisted = existsSync(
|
|
||||||
join(__dirname, 'backend-rs.darwin-arm64.node')
|
|
||||||
)
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./backend-rs.darwin-arm64.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('backend-rs-darwin-arm64')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = 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')
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
} else if (process.arch === 'arm') {
|
||||||
|
try {
|
||||||
|
return require('./backend-rs.android-arm-eabi.node')
|
||||||
|
} catch (e) {
|
||||||
|
loadErrors.push(e)
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return require('backend-rs-android-arm-eabi')
|
||||||
|
} catch (e) {
|
||||||
|
loadErrors.push(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
|
||||||
}
|
}
|
||||||
break
|
} else if (process.platform === 'win32') {
|
||||||
case 'linux':
|
if (process.arch === 'x64') {
|
||||||
switch (arch) {
|
try {
|
||||||
case 'x64':
|
return require('./backend-rs.win32-x64-msvc.node')
|
||||||
if (isMusl()) {
|
} catch (e) {
|
||||||
localFileExisted = existsSync(
|
loadErrors.push(e)
|
||||||
join(__dirname, 'backend-rs.linux-x64-musl.node')
|
}
|
||||||
)
|
try {
|
||||||
try {
|
return require('backend-rs-win32-x64-msvc')
|
||||||
if (localFileExisted) {
|
} catch (e) {
|
||||||
nativeBinding = require('./backend-rs.linux-x64-musl.node')
|
loadErrors.push(e)
|
||||||
} else {
|
}
|
||||||
nativeBinding = require('backend-rs-linux-x64-musl')
|
|
||||||
}
|
} else if (process.arch === 'ia32') {
|
||||||
} catch (e) {
|
try {
|
||||||
loadError = e
|
return require('./backend-rs.win32-ia32-msvc.node')
|
||||||
}
|
} catch (e) {
|
||||||
} else {
|
loadErrors.push(e)
|
||||||
localFileExisted = existsSync(
|
}
|
||||||
join(__dirname, 'backend-rs.linux-x64-gnu.node')
|
try {
|
||||||
)
|
return require('backend-rs-win32-ia32-msvc')
|
||||||
try {
|
} catch (e) {
|
||||||
if (localFileExisted) {
|
loadErrors.push(e)
|
||||||
nativeBinding = require('./backend-rs.linux-x64-gnu.node')
|
}
|
||||||
} else {
|
|
||||||
nativeBinding = require('backend-rs-linux-x64-gnu')
|
} else if (process.arch === 'arm64') {
|
||||||
}
|
try {
|
||||||
} catch (e) {
|
return require('./backend-rs.win32-arm64-msvc.node')
|
||||||
loadError = e
|
} catch (e) {
|
||||||
}
|
loadErrors.push(e)
|
||||||
}
|
}
|
||||||
break
|
try {
|
||||||
case 'arm64':
|
return require('backend-rs-win32-arm64-msvc')
|
||||||
if (isMusl()) {
|
} catch (e) {
|
||||||
localFileExisted = existsSync(
|
loadErrors.push(e)
|
||||||
join(__dirname, 'backend-rs.linux-arm64-musl.node')
|
}
|
||||||
)
|
|
||||||
try {
|
} else {
|
||||||
if (localFileExisted) {
|
loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
|
||||||
nativeBinding = require('./backend-rs.linux-arm64-musl.node')
|
}
|
||||||
} else {
|
} else if (process.platform === 'darwin') {
|
||||||
nativeBinding = require('backend-rs-linux-arm64-musl')
|
try {
|
||||||
}
|
return require('./backend-rs.darwin-universal.node')
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
loadError = e
|
loadErrors.push(e)
|
||||||
}
|
}
|
||||||
} else {
|
try {
|
||||||
localFileExisted = existsSync(
|
return require('backend-rs-darwin-universal')
|
||||||
join(__dirname, 'backend-rs.linux-arm64-gnu.node')
|
} catch (e) {
|
||||||
)
|
loadErrors.push(e)
|
||||||
try {
|
}
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./backend-rs.linux-arm64-gnu.node')
|
if (process.arch === 'x64') {
|
||||||
} else {
|
try {
|
||||||
nativeBinding = require('backend-rs-linux-arm64-gnu')
|
return require('./backend-rs.darwin-x64.node')
|
||||||
}
|
} catch (e) {
|
||||||
} catch (e) {
|
loadErrors.push(e)
|
||||||
loadError = e
|
}
|
||||||
}
|
try {
|
||||||
}
|
return require('backend-rs-darwin-x64')
|
||||||
break
|
} catch (e) {
|
||||||
case 'arm':
|
loadErrors.push(e)
|
||||||
if (isMusl()) {
|
}
|
||||||
localFileExisted = existsSync(
|
|
||||||
join(__dirname, 'backend-rs.linux-arm-musleabihf.node')
|
} else if (process.arch === 'arm64') {
|
||||||
)
|
try {
|
||||||
try {
|
return require('./backend-rs.darwin-arm64.node')
|
||||||
if (localFileExisted) {
|
} catch (e) {
|
||||||
nativeBinding = require('./backend-rs.linux-arm-musleabihf.node')
|
loadErrors.push(e)
|
||||||
} else {
|
}
|
||||||
nativeBinding = require('backend-rs-linux-arm-musleabihf')
|
try {
|
||||||
}
|
return require('backend-rs-darwin-arm64')
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
loadError = e
|
loadErrors.push(e)
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
localFileExisted = existsSync(
|
} else {
|
||||||
join(__dirname, 'backend-rs.linux-arm-gnueabihf.node')
|
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
|
||||||
)
|
}
|
||||||
try {
|
} else if (process.platform === 'freebsd') {
|
||||||
if (localFileExisted) {
|
if (process.arch === 'x64') {
|
||||||
nativeBinding = require('./backend-rs.linux-arm-gnueabihf.node')
|
try {
|
||||||
} else {
|
return require('./backend-rs.freebsd-x64.node')
|
||||||
nativeBinding = require('backend-rs-linux-arm-gnueabihf')
|
} catch (e) {
|
||||||
}
|
loadErrors.push(e)
|
||||||
} catch (e) {
|
}
|
||||||
loadError = e
|
try {
|
||||||
}
|
return require('backend-rs-freebsd-x64')
|
||||||
}
|
} catch (e) {
|
||||||
break
|
loadErrors.push(e)
|
||||||
case 'riscv64':
|
}
|
||||||
if (isMusl()) {
|
|
||||||
localFileExisted = existsSync(
|
} else if (process.arch === 'arm64') {
|
||||||
join(__dirname, 'backend-rs.linux-riscv64-musl.node')
|
try {
|
||||||
)
|
return require('./backend-rs.freebsd-arm64.node')
|
||||||
try {
|
} catch (e) {
|
||||||
if (localFileExisted) {
|
loadErrors.push(e)
|
||||||
nativeBinding = require('./backend-rs.linux-riscv64-musl.node')
|
}
|
||||||
} else {
|
try {
|
||||||
nativeBinding = require('backend-rs-linux-riscv64-musl')
|
return require('backend-rs-freebsd-arm64')
|
||||||
}
|
} catch (e) {
|
||||||
} catch (e) {
|
loadErrors.push(e)
|
||||||
loadError = e
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
localFileExisted = existsSync(
|
loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
|
||||||
join(__dirname, 'backend-rs.linux-riscv64-gnu.node')
|
}
|
||||||
)
|
} else if (process.platform === 'linux') {
|
||||||
try {
|
if (process.arch === 'x64') {
|
||||||
if (localFileExisted) {
|
if (isMusl()) {
|
||||||
nativeBinding = require('./backend-rs.linux-riscv64-gnu.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('backend-rs-linux-riscv64-gnu')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 's390x':
|
|
||||||
localFileExisted = existsSync(
|
|
||||||
join(__dirname, 'backend-rs.linux-s390x-gnu.node')
|
|
||||||
)
|
|
||||||
try {
|
try {
|
||||||
if (localFileExisted) {
|
return require('./backend-rs.linux-x64-musl.node')
|
||||||
nativeBinding = require('./backend-rs.linux-s390x-gnu.node')
|
} catch (e) {
|
||||||
} else {
|
loadErrors.push(e)
|
||||||
nativeBinding = require('backend-rs-linux-s390x-gnu')
|
}
|
||||||
}
|
try {
|
||||||
} catch (e) {
|
return require('backend-rs-linux-x64-musl')
|
||||||
loadError = e
|
} catch (e) {
|
||||||
}
|
loadErrors.push(e)
|
||||||
break
|
}
|
||||||
default:
|
|
||||||
throw new Error(`Unsupported architecture on Linux: ${arch}`)
|
} else {
|
||||||
|
try {
|
||||||
|
return require('./backend-rs.linux-x64-gnu.node')
|
||||||
|
} catch (e) {
|
||||||
|
loadErrors.push(e)
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return require('backend-rs-linux-x64-gnu')
|
||||||
|
} catch (e) {
|
||||||
|
loadErrors.push(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
} else if (process.arch === 'arm64') {
|
||||||
|
if (isMusl()) {
|
||||||
|
try {
|
||||||
|
return require('./backend-rs.linux-arm64-musl.node')
|
||||||
|
} catch (e) {
|
||||||
|
loadErrors.push(e)
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return require('backend-rs-linux-arm64-musl')
|
||||||
|
} catch (e) {
|
||||||
|
loadErrors.push(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
return require('./backend-rs.linux-arm64-gnu.node')
|
||||||
|
} catch (e) {
|
||||||
|
loadErrors.push(e)
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return require('backend-rs-linux-arm64-gnu')
|
||||||
|
} catch (e) {
|
||||||
|
loadErrors.push(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
} else if (process.arch === 'arm') {
|
||||||
|
if (isMusl()) {
|
||||||
|
try {
|
||||||
|
return require('./backend-rs.linux-arm-musleabihf.node')
|
||||||
|
} catch (e) {
|
||||||
|
loadErrors.push(e)
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return require('backend-rs-linux-arm-musleabihf')
|
||||||
|
} catch (e) {
|
||||||
|
loadErrors.push(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
return require('./backend-rs.linux-arm-gnueabihf.node')
|
||||||
|
} catch (e) {
|
||||||
|
loadErrors.push(e)
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return require('backend-rs-linux-arm-gnueabihf')
|
||||||
|
} catch (e) {
|
||||||
|
loadErrors.push(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
} else if (process.arch === 'riscv64') {
|
||||||
|
if (isMusl()) {
|
||||||
|
try {
|
||||||
|
return require('./backend-rs.linux-riscv64-musl.node')
|
||||||
|
} catch (e) {
|
||||||
|
loadErrors.push(e)
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return require('backend-rs-linux-riscv64-musl')
|
||||||
|
} catch (e) {
|
||||||
|
loadErrors.push(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
return require('./backend-rs.linux-riscv64-gnu.node')
|
||||||
|
} catch (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}`))
|
||||||
}
|
}
|
||||||
break
|
} else {
|
||||||
default:
|
loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
|
||||||
throw new Error(`Unsupported OS: ${platform}, architecture: ${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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nativeBinding) {
|
if (!nativeBinding) {
|
||||||
if (loadError) {
|
if (loadErrors.length > 0) {
|
||||||
throw loadError
|
// 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`)
|
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.acctToString = nativeBinding.acctToString
|
||||||
|
module.exports.AntennaSrc = nativeBinding.AntennaSrc
|
||||||
module.exports.SECOND = SECOND
|
module.exports.ChatEvent = nativeBinding.ChatEvent
|
||||||
module.exports.MINUTE = MINUTE
|
module.exports.ChatIndexEvent = nativeBinding.ChatIndexEvent
|
||||||
module.exports.HOUR = HOUR
|
module.exports.checkWordMute = nativeBinding.checkWordMute
|
||||||
module.exports.DAY = DAY
|
module.exports.countReactions = nativeBinding.countReactions
|
||||||
module.exports.USER_ONLINE_THRESHOLD = USER_ONLINE_THRESHOLD
|
module.exports.cpuInfo = nativeBinding.cpuInfo
|
||||||
module.exports.USER_ACTIVE_THRESHOLD = USER_ACTIVE_THRESHOLD
|
module.exports.cpuUsage = nativeBinding.cpuUsage
|
||||||
module.exports.FILE_TYPE_BROWSERSAFE = FILE_TYPE_BROWSERSAFE
|
module.exports.DAY = nativeBinding.DAY
|
||||||
module.exports.fetchMeta = fetchMeta
|
module.exports.decodeReaction = nativeBinding.decodeReaction
|
||||||
module.exports.updateMetaCache = updateMetaCache
|
module.exports.DriveFileEvent = nativeBinding.DriveFileEvent
|
||||||
module.exports.metaToPugArgs = metaToPugArgs
|
module.exports.DriveFileUsageHint = nativeBinding.DriveFileUsageHint
|
||||||
module.exports.loadConfig = loadConfig
|
module.exports.DriveFolderEvent = nativeBinding.DriveFolderEvent
|
||||||
module.exports.stringToAcct = stringToAcct
|
module.exports.extractHost = nativeBinding.extractHost
|
||||||
module.exports.acctToString = acctToString
|
module.exports.fetchMeta = nativeBinding.fetchMeta
|
||||||
module.exports.fetchNodeinfo = fetchNodeinfo
|
module.exports.fetchNodeinfo = nativeBinding.fetchNodeinfo
|
||||||
module.exports.nodeinfo_2_1 = nodeinfo_2_1
|
module.exports.FILE_TYPE_BROWSERSAFE = nativeBinding.FILE_TYPE_BROWSERSAFE
|
||||||
module.exports.nodeinfo_2_0 = nodeinfo_2_0
|
module.exports.formatMilliseconds = nativeBinding.formatMilliseconds
|
||||||
module.exports.updateNodeinfoCache = updateNodeinfoCache
|
module.exports.fromMastodonId = nativeBinding.fromMastodonId
|
||||||
module.exports.Protocol = Protocol
|
module.exports.generateSecureRandomString = nativeBinding.generateSecureRandomString
|
||||||
module.exports.Inbound = Inbound
|
module.exports.generateUserToken = nativeBinding.generateUserToken
|
||||||
module.exports.Outbound = Outbound
|
module.exports.genId = nativeBinding.genId
|
||||||
module.exports.greet = greet
|
module.exports.genIdAt = nativeBinding.genIdAt
|
||||||
module.exports.initializeRustLogger = initializeRustLogger
|
module.exports.getFullApAccount = nativeBinding.getFullApAccount
|
||||||
module.exports.showServerInfo = showServerInfo
|
module.exports.getImageSizeFromUrl = nativeBinding.getImageSizeFromUrl
|
||||||
module.exports.isBlockedServer = isBlockedServer
|
module.exports.getNoteSummary = nativeBinding.getNoteSummary
|
||||||
module.exports.isSilencedServer = isSilencedServer
|
module.exports.getTimestamp = nativeBinding.getTimestamp
|
||||||
module.exports.isAllowedServer = isAllowedServer
|
module.exports.greet = nativeBinding.greet
|
||||||
module.exports.checkWordMute = checkWordMute
|
module.exports.hashPassword = nativeBinding.hashPassword
|
||||||
module.exports.getFullApAccount = getFullApAccount
|
module.exports.HOUR = nativeBinding.HOUR
|
||||||
module.exports.isSelfHost = isSelfHost
|
module.exports.Inbound = nativeBinding.Inbound
|
||||||
module.exports.isSameOrigin = isSameOrigin
|
module.exports.initializeRustLogger = nativeBinding.initializeRustLogger
|
||||||
module.exports.extractHost = extractHost
|
module.exports.isAllowedServer = nativeBinding.isAllowedServer
|
||||||
module.exports.toPuny = toPuny
|
module.exports.isBlockedServer = nativeBinding.isBlockedServer
|
||||||
module.exports.isUnicodeEmoji = isUnicodeEmoji
|
module.exports.isOldPasswordAlgorithm = nativeBinding.isOldPasswordAlgorithm
|
||||||
module.exports.sqlLikeEscape = sqlLikeEscape
|
module.exports.isQuote = nativeBinding.isQuote
|
||||||
module.exports.safeForSql = safeForSql
|
module.exports.isSafeUrl = nativeBinding.isSafeUrl
|
||||||
module.exports.formatMilliseconds = formatMilliseconds
|
module.exports.isSameOrigin = nativeBinding.isSameOrigin
|
||||||
module.exports.getImageSizeFromUrl = getImageSizeFromUrl
|
module.exports.isSelfHost = nativeBinding.isSelfHost
|
||||||
module.exports.isQuote = isQuote
|
module.exports.isSilencedServer = nativeBinding.isSilencedServer
|
||||||
module.exports.isSafeUrl = isSafeUrl
|
module.exports.isUnicodeEmoji = nativeBinding.isUnicodeEmoji
|
||||||
module.exports.latestVersion = latestVersion
|
module.exports.latestVersion = nativeBinding.latestVersion
|
||||||
module.exports.toMastodonId = toMastodonId
|
module.exports.loadConfig = nativeBinding.loadConfig
|
||||||
module.exports.fromMastodonId = fromMastodonId
|
module.exports.memoryUsage = nativeBinding.memoryUsage
|
||||||
module.exports.getNoteSummary = getNoteSummary
|
module.exports.metaToPugArgs = nativeBinding.metaToPugArgs
|
||||||
module.exports.nyaify = nyaify
|
module.exports.MINUTE = nativeBinding.MINUTE
|
||||||
module.exports.hashPassword = hashPassword
|
module.exports.MutedNoteReason = nativeBinding.MutedNoteReason
|
||||||
module.exports.verifyPassword = verifyPassword
|
module.exports.nodeinfo_2_0 = nativeBinding.nodeinfo_2_0
|
||||||
module.exports.isOldPasswordAlgorithm = isOldPasswordAlgorithm
|
module.exports.nodeinfo_2_1 = nativeBinding.nodeinfo_2_1
|
||||||
module.exports.decodeReaction = decodeReaction
|
module.exports.NoteVisibility = nativeBinding.NoteVisibility
|
||||||
module.exports.countReactions = countReactions
|
module.exports.NotificationType = nativeBinding.NotificationType
|
||||||
module.exports.toDbReaction = toDbReaction
|
module.exports.nyaify = nativeBinding.nyaify
|
||||||
module.exports.removeOldAttestationChallenges = removeOldAttestationChallenges
|
module.exports.Outbound = nativeBinding.Outbound
|
||||||
module.exports.cpuInfo = cpuInfo
|
module.exports.PageVisibility = nativeBinding.PageVisibility
|
||||||
module.exports.cpuUsage = cpuUsage
|
module.exports.PollNoteVisibility = nativeBinding.PollNoteVisibility
|
||||||
module.exports.memoryUsage = memoryUsage
|
module.exports.Protocol = nativeBinding.Protocol
|
||||||
module.exports.storageUsage = storageUsage
|
module.exports.publishToBroadcastStream = nativeBinding.publishToBroadcastStream
|
||||||
module.exports.AntennaSrc = AntennaSrc
|
module.exports.publishToChannelStream = nativeBinding.publishToChannelStream
|
||||||
module.exports.DriveFileUsageHint = DriveFileUsageHint
|
module.exports.publishToChatIndexStream = nativeBinding.publishToChatIndexStream
|
||||||
module.exports.MutedNoteReason = MutedNoteReason
|
module.exports.publishToChatStream = nativeBinding.publishToChatStream
|
||||||
module.exports.NoteVisibility = NoteVisibility
|
module.exports.publishToDriveFileStream = nativeBinding.publishToDriveFileStream
|
||||||
module.exports.NotificationType = NotificationType
|
module.exports.publishToDriveFolderStream = nativeBinding.publishToDriveFolderStream
|
||||||
module.exports.PageVisibility = PageVisibility
|
module.exports.publishToGroupChatStream = nativeBinding.publishToGroupChatStream
|
||||||
module.exports.PollNoteVisibility = PollNoteVisibility
|
module.exports.publishToModerationStream = nativeBinding.publishToModerationStream
|
||||||
module.exports.RelayStatus = RelayStatus
|
module.exports.publishToNotesStream = nativeBinding.publishToNotesStream
|
||||||
module.exports.UserEmojiModPerm = UserEmojiModPerm
|
module.exports.PushNotificationKind = nativeBinding.PushNotificationKind
|
||||||
module.exports.UserProfileFfvisibility = UserProfileFfvisibility
|
module.exports.RelayStatus = nativeBinding.RelayStatus
|
||||||
module.exports.UserProfileMutingNotificationTypes = UserProfileMutingNotificationTypes
|
module.exports.removeOldAttestationChallenges = nativeBinding.removeOldAttestationChallenges
|
||||||
module.exports.updateAntennasOnNewNote = updateAntennasOnNewNote
|
module.exports.safeForSql = nativeBinding.safeForSql
|
||||||
module.exports.updateAntennaCache = updateAntennaCache
|
module.exports.SECOND = nativeBinding.SECOND
|
||||||
module.exports.watchNote = watchNote
|
module.exports.sendPushNotification = nativeBinding.sendPushNotification
|
||||||
module.exports.unwatchNote = unwatchNote
|
module.exports.showServerInfo = nativeBinding.showServerInfo
|
||||||
module.exports.PushNotificationKind = PushNotificationKind
|
module.exports.sqlLikeEscape = nativeBinding.sqlLikeEscape
|
||||||
module.exports.sendPushNotification = sendPushNotification
|
module.exports.storageUsage = nativeBinding.storageUsage
|
||||||
module.exports.publishToChannelStream = publishToChannelStream
|
module.exports.stringToAcct = nativeBinding.stringToAcct
|
||||||
module.exports.publishToChatStream = publishToChatStream
|
module.exports.toDbReaction = nativeBinding.toDbReaction
|
||||||
module.exports.ChatIndexEvent = ChatIndexEvent
|
module.exports.toMastodonId = nativeBinding.toMastodonId
|
||||||
module.exports.publishToChatIndexStream = publishToChatIndexStream
|
module.exports.toPuny = nativeBinding.toPuny
|
||||||
module.exports.publishToBroadcastStream = publishToBroadcastStream
|
module.exports.unwatchNote = nativeBinding.unwatchNote
|
||||||
module.exports.DriveFileEvent = DriveFileEvent
|
module.exports.updateAntennaCache = nativeBinding.updateAntennaCache
|
||||||
module.exports.DriveFolderEvent = DriveFolderEvent
|
module.exports.updateAntennasOnNewNote = nativeBinding.updateAntennasOnNewNote
|
||||||
module.exports.publishToDriveFileStream = publishToDriveFileStream
|
module.exports.updateMetaCache = nativeBinding.updateMetaCache
|
||||||
module.exports.publishToDriveFolderStream = publishToDriveFolderStream
|
module.exports.updateNodeinfoCache = nativeBinding.updateNodeinfoCache
|
||||||
module.exports.publishToGroupChatStream = publishToGroupChatStream
|
module.exports.USER_ACTIVE_THRESHOLD = nativeBinding.USER_ACTIVE_THRESHOLD
|
||||||
module.exports.publishToModerationStream = publishToModerationStream
|
module.exports.USER_ONLINE_THRESHOLD = nativeBinding.USER_ONLINE_THRESHOLD
|
||||||
module.exports.publishToNotesStream = publishToNotesStream
|
module.exports.UserEmojiModPerm = nativeBinding.UserEmojiModPerm
|
||||||
module.exports.ChatEvent = ChatEvent
|
module.exports.UserProfileFfvisibility = nativeBinding.UserProfileFfvisibility
|
||||||
module.exports.getTimestamp = getTimestamp
|
module.exports.UserProfileMutingNotificationTypes = nativeBinding.UserProfileMutingNotificationTypes
|
||||||
module.exports.genId = genId
|
module.exports.verifyPassword = nativeBinding.verifyPassword
|
||||||
module.exports.genIdAt = genIdAt
|
module.exports.watchNote = nativeBinding.watchNote
|
||||||
module.exports.generateSecureRandomString = generateSecureRandomString
|
|
||||||
module.exports.generateUserToken = generateUserToken
|
|
||||||
|
|
|
@ -4,30 +4,29 @@
|
||||||
"main": "built/index.js",
|
"main": "built/index.js",
|
||||||
"types": "built/index.d.ts",
|
"types": "built/index.d.ts",
|
||||||
"napi": {
|
"napi": {
|
||||||
"name": "backend-rs",
|
"binaryName": "backend-rs",
|
||||||
"triples": {
|
"targets": [
|
||||||
"additional": [
|
"aarch64-apple-darwin",
|
||||||
"aarch64-apple-darwin",
|
"aarch64-linux-android",
|
||||||
"aarch64-linux-android",
|
"aarch64-unknown-linux-gnu",
|
||||||
"aarch64-unknown-linux-gnu",
|
"aarch64-unknown-linux-musl",
|
||||||
"aarch64-unknown-linux-musl",
|
"aarch64-pc-windows-msvc",
|
||||||
"aarch64-pc-windows-msvc",
|
"armv7-unknown-linux-gnueabihf",
|
||||||
"armv7-unknown-linux-gnueabihf",
|
"x86_64-unknown-linux-gnu",
|
||||||
"x86_64-unknown-linux-musl",
|
"x86_64-unknown-linux-musl",
|
||||||
"x86_64-unknown-freebsd",
|
"x86_64-unknown-freebsd",
|
||||||
"i686-pc-windows-msvc",
|
"i686-pc-windows-msvc",
|
||||||
"armv7-linux-androideabi",
|
"armv7-linux-androideabi",
|
||||||
"universal-apple-darwin"
|
"universal-apple-darwin"
|
||||||
]
|
]
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@napi-rs/cli": "2.18.3"
|
"@napi-rs/cli": "3.0.0-alpha.55"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"artifacts": "napi artifacts",
|
"artifacts": "napi artifacts",
|
||||||
"build": "RUSTFLAGS='-C target-cpu=native' napi build --features napi --no-const-enum --platform --release ./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 ./built/",
|
"build:debug": "napi build --features napi --no-const-enum --platform --output-dir ./built/",
|
||||||
"prepublishOnly": "napi prepublish -t npm",
|
"prepublishOnly": "napi prepublish -t npm",
|
||||||
"universal": "napi universal",
|
"universal": "napi universal",
|
||||||
"version": "napi version"
|
"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