chore: prettier ignore file generated by napi-rs (#4661)
This commit is contained in:
@@ -15,3 +15,9 @@ packages/backend/server/src/schema.gql
|
|||||||
packages/frontend/i18n/src/i18n-generated.ts
|
packages/frontend/i18n/src/i18n-generated.ts
|
||||||
packages/frontend/graphql/src/graphql/index.ts
|
packages/frontend/graphql/src/graphql/index.ts
|
||||||
tests/affine-legacy/**/static
|
tests/affine-legacy/**/static
|
||||||
|
|
||||||
|
# auto-generated by NAPI-RS
|
||||||
|
# fixme(@joooye34): need script to check and generate ignore list here
|
||||||
|
packages/backend/storage/index.d.ts
|
||||||
|
packages/frontend/native/index.d.ts
|
||||||
|
packages/frontend/native/index.js
|
||||||
|
|||||||
36
packages/backend/storage/index.d.ts
vendored
36
packages/backend/storage/index.d.ts
vendored
@@ -3,40 +3,30 @@
|
|||||||
|
|
||||||
/* auto-generated by NAPI-RS */
|
/* auto-generated by NAPI-RS */
|
||||||
|
|
||||||
export function verifyChallengeResponse(
|
export function verifyChallengeResponse(response: string, bits: number, resource: string): Promise<boolean>
|
||||||
response: string,
|
export function mintChallengeResponse(resource: string, bits?: number | undefined | null): Promise<string>
|
||||||
bits: number,
|
|
||||||
resource: string
|
|
||||||
): Promise<boolean>;
|
|
||||||
export function mintChallengeResponse(
|
|
||||||
resource: string,
|
|
||||||
bits?: number | undefined | null
|
|
||||||
): Promise<string>;
|
|
||||||
export interface Blob {
|
export interface Blob {
|
||||||
contentType: string;
|
contentType: string
|
||||||
lastModified: string;
|
lastModified: string
|
||||||
size: number;
|
size: number
|
||||||
data: Buffer;
|
data: Buffer
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Merge updates in form like `Y.applyUpdate(doc, update)` way and return the
|
* Merge updates in form like `Y.applyUpdate(doc, update)` way and return the
|
||||||
* result binary.
|
* result binary.
|
||||||
*/
|
*/
|
||||||
export function mergeUpdatesInApplyWay(updates: Array<Buffer>): Buffer;
|
export function mergeUpdatesInApplyWay(updates: Array<Buffer>): Buffer
|
||||||
export class Storage {
|
export class Storage {
|
||||||
/** Create a storage instance and establish connection to persist store. */
|
/** Create a storage instance and establish connection to persist store. */
|
||||||
static connect(
|
static connect(database: string, debugOnlyAutoMigrate?: boolean | undefined | null): Promise<Storage>
|
||||||
database: string,
|
|
||||||
debugOnlyAutoMigrate?: boolean | undefined | null
|
|
||||||
): Promise<Storage>;
|
|
||||||
/** List all blobs in a workspace. */
|
/** List all blobs in a workspace. */
|
||||||
listBlobs(workspaceId?: string | undefined | null): Promise<Array<string>>;
|
listBlobs(workspaceId?: string | undefined | null): Promise<Array<string>>
|
||||||
/** Fetch a workspace blob. */
|
/** Fetch a workspace blob. */
|
||||||
getBlob(workspaceId: string, name: string): Promise<Blob | null>;
|
getBlob(workspaceId: string, name: string): Promise<Blob | null>
|
||||||
/** Upload a blob into workspace storage. */
|
/** Upload a blob into workspace storage. */
|
||||||
uploadBlob(workspaceId: string, blob: Buffer): Promise<string>;
|
uploadBlob(workspaceId: string, blob: Buffer): Promise<string>
|
||||||
/** Delete a blob from workspace storage. */
|
/** Delete a blob from workspace storage. */
|
||||||
deleteBlob(workspaceId: string, hash: string): Promise<boolean>;
|
deleteBlob(workspaceId: string, hash: string): Promise<boolean>
|
||||||
/** Workspace size taken by blobs. */
|
/** Workspace size taken by blobs. */
|
||||||
blobsSize(workspaces: Array<string>): Promise<number>;
|
blobsSize(workspaces: Array<string>): Promise<number>
|
||||||
}
|
}
|
||||||
|
|||||||
70
packages/frontend/native/index.d.ts
vendored
70
packages/frontend/native/index.d.ts
vendored
@@ -4,56 +4,46 @@
|
|||||||
/* auto-generated by NAPI-RS */
|
/* auto-generated by NAPI-RS */
|
||||||
|
|
||||||
export interface BlobRow {
|
export interface BlobRow {
|
||||||
key: string;
|
key: string
|
||||||
data: Buffer;
|
data: Buffer
|
||||||
timestamp: Date;
|
timestamp: Date
|
||||||
}
|
}
|
||||||
export interface UpdateRow {
|
export interface UpdateRow {
|
||||||
id: number;
|
id: number
|
||||||
timestamp: Date;
|
timestamp: Date
|
||||||
data: Buffer;
|
data: Buffer
|
||||||
docId?: string;
|
docId?: string
|
||||||
}
|
}
|
||||||
export interface InsertRow {
|
export interface InsertRow {
|
||||||
docId?: string;
|
docId?: string
|
||||||
data: Uint8Array;
|
data: Uint8Array
|
||||||
}
|
}
|
||||||
export enum ValidationResult {
|
export enum ValidationResult {
|
||||||
MissingTables = 0,
|
MissingTables = 0,
|
||||||
MissingDocIdColumn = 1,
|
MissingDocIdColumn = 1,
|
||||||
MissingVersionColumn = 2,
|
MissingVersionColumn = 2,
|
||||||
GeneralError = 3,
|
GeneralError = 3,
|
||||||
Valid = 4,
|
Valid = 4
|
||||||
}
|
}
|
||||||
export function verifyChallengeResponse(
|
export function verifyChallengeResponse(response: string, bits: number, resource: string): Promise<boolean>
|
||||||
response: string,
|
export function mintChallengeResponse(resource: string, bits?: number | undefined | null): Promise<string>
|
||||||
bits: number,
|
|
||||||
resource: string
|
|
||||||
): Promise<boolean>;
|
|
||||||
export function mintChallengeResponse(
|
|
||||||
resource: string,
|
|
||||||
bits?: number | undefined | null
|
|
||||||
): Promise<string>;
|
|
||||||
export class SqliteConnection {
|
export class SqliteConnection {
|
||||||
constructor(path: string);
|
constructor(path: string)
|
||||||
connect(): Promise<void>;
|
connect(): Promise<void>
|
||||||
addBlob(key: string, blob: Uint8Array): Promise<void>;
|
addBlob(key: string, blob: Uint8Array): Promise<void>
|
||||||
getBlob(key: string): Promise<BlobRow | null>;
|
getBlob(key: string): Promise<BlobRow | null>
|
||||||
deleteBlob(key: string): Promise<void>;
|
deleteBlob(key: string): Promise<void>
|
||||||
getBlobKeys(): Promise<Array<string>>;
|
getBlobKeys(): Promise<Array<string>>
|
||||||
getUpdates(docId?: string | undefined | null): Promise<Array<UpdateRow>>;
|
getUpdates(docId?: string | undefined | null): Promise<Array<UpdateRow>>
|
||||||
getUpdatesCount(docId?: string | undefined | null): Promise<number>;
|
getUpdatesCount(docId?: string | undefined | null): Promise<number>
|
||||||
getAllUpdates(): Promise<Array<UpdateRow>>;
|
getAllUpdates(): Promise<Array<UpdateRow>>
|
||||||
insertUpdates(updates: Array<InsertRow>): Promise<void>;
|
insertUpdates(updates: Array<InsertRow>): Promise<void>
|
||||||
replaceUpdates(
|
replaceUpdates(docId: string | undefined | null, updates: Array<InsertRow>): Promise<void>
|
||||||
docId: string | undefined | null,
|
initVersion(): Promise<void>
|
||||||
updates: Array<InsertRow>
|
setVersion(version: number): Promise<void>
|
||||||
): Promise<void>;
|
getMaxVersion(): Promise<number>
|
||||||
initVersion(): Promise<void>;
|
close(): Promise<void>
|
||||||
setVersion(version: number): Promise<void>;
|
get isClose(): boolean
|
||||||
getMaxVersion(): Promise<number>;
|
static validate(path: string): Promise<ValidationResult>
|
||||||
close(): Promise<void>;
|
migrateAddDocId(): Promise<void>
|
||||||
get isClose(): boolean;
|
|
||||||
static validate(path: string): Promise<ValidationResult>;
|
|
||||||
migrateAddDocId(): Promise<void>;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,29 +5,26 @@
|
|||||||
/* auto-generated by NAPI-RS */
|
/* auto-generated by NAPI-RS */
|
||||||
|
|
||||||
const { existsSync, readFileSync } = require('fs')
|
const { existsSync, readFileSync } = require('fs')
|
||||||
const { join } = require('path');
|
const { join } = require('path')
|
||||||
|
|
||||||
const { platform, arch } = process;
|
const { platform, arch } = process
|
||||||
|
|
||||||
let nativeBinding = null;
|
let nativeBinding = null
|
||||||
let localFileExisted = false;
|
let localFileExisted = false
|
||||||
let loadError = null;
|
let loadError = null
|
||||||
|
|
||||||
function isMusl() {
|
function isMusl() {
|
||||||
// For Node 10
|
// For Node 10
|
||||||
if (!process.report || typeof process.report.getReport !== 'function') {
|
if (!process.report || typeof process.report.getReport !== 'function') {
|
||||||
try {
|
try {
|
||||||
const lddPath = require('child_process')
|
const lddPath = require('child_process').execSync('which ldd').toString().trim()
|
||||||
.execSync('which ldd')
|
return readFileSync(lddPath, 'utf8').includes('musl')
|
||||||
.toString()
|
|
||||||
.trim();
|
|
||||||
return readFileSync(lddPath, 'utf8').includes('musl');
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return true;
|
return true
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const { glibcVersionRuntime } = process.report.getReport().header;
|
const { glibcVersionRuntime } = process.report.getReport().header
|
||||||
return !glibcVersionRuntime;
|
return !glibcVersionRuntime
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,242 +32,229 @@ switch (platform) {
|
|||||||
case 'android':
|
case 'android':
|
||||||
switch (arch) {
|
switch (arch) {
|
||||||
case 'arm64':
|
case 'arm64':
|
||||||
localFileExisted = existsSync(
|
localFileExisted = existsSync(join(__dirname, 'affine.android-arm64.node'))
|
||||||
join(__dirname, 'affine.android-arm64.node')
|
|
||||||
);
|
|
||||||
try {
|
try {
|
||||||
if (localFileExisted) {
|
if (localFileExisted) {
|
||||||
nativeBinding = require('./affine.android-arm64.node');
|
nativeBinding = require('./affine.android-arm64.node')
|
||||||
} else {
|
} else {
|
||||||
nativeBinding = require('@affine/native-android-arm64');
|
nativeBinding = require('@affine/native-android-arm64')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
loadError = e;
|
loadError = e
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case 'arm':
|
case 'arm':
|
||||||
localFileExisted = existsSync(
|
localFileExisted = existsSync(join(__dirname, 'affine.android-arm-eabi.node'))
|
||||||
join(__dirname, 'affine.android-arm-eabi.node')
|
|
||||||
);
|
|
||||||
try {
|
try {
|
||||||
if (localFileExisted) {
|
if (localFileExisted) {
|
||||||
nativeBinding = require('./affine.android-arm-eabi.node');
|
nativeBinding = require('./affine.android-arm-eabi.node')
|
||||||
} else {
|
} else {
|
||||||
nativeBinding = require('@affine/native-android-arm-eabi');
|
nativeBinding = require('@affine/native-android-arm-eabi')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
loadError = e;
|
loadError = e
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unsupported architecture on Android ${arch}`);
|
throw new Error(`Unsupported architecture on Android ${arch}`)
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case 'win32':
|
case 'win32':
|
||||||
switch (arch) {
|
switch (arch) {
|
||||||
case 'x64':
|
case 'x64':
|
||||||
localFileExisted = existsSync(
|
localFileExisted = existsSync(
|
||||||
join(__dirname, 'affine.win32-x64-msvc.node')
|
join(__dirname, 'affine.win32-x64-msvc.node')
|
||||||
);
|
)
|
||||||
try {
|
try {
|
||||||
if (localFileExisted) {
|
if (localFileExisted) {
|
||||||
nativeBinding = require('./affine.win32-x64-msvc.node');
|
nativeBinding = require('./affine.win32-x64-msvc.node')
|
||||||
} else {
|
} else {
|
||||||
nativeBinding = require('@affine/native-win32-x64-msvc');
|
nativeBinding = require('@affine/native-win32-x64-msvc')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
loadError = e;
|
loadError = e
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case 'ia32':
|
case 'ia32':
|
||||||
localFileExisted = existsSync(
|
localFileExisted = existsSync(
|
||||||
join(__dirname, 'affine.win32-ia32-msvc.node')
|
join(__dirname, 'affine.win32-ia32-msvc.node')
|
||||||
);
|
)
|
||||||
try {
|
try {
|
||||||
if (localFileExisted) {
|
if (localFileExisted) {
|
||||||
nativeBinding = require('./affine.win32-ia32-msvc.node');
|
nativeBinding = require('./affine.win32-ia32-msvc.node')
|
||||||
} else {
|
} else {
|
||||||
nativeBinding = require('@affine/native-win32-ia32-msvc');
|
nativeBinding = require('@affine/native-win32-ia32-msvc')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
loadError = e;
|
loadError = e
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case 'arm64':
|
case 'arm64':
|
||||||
localFileExisted = existsSync(
|
localFileExisted = existsSync(
|
||||||
join(__dirname, 'affine.win32-arm64-msvc.node')
|
join(__dirname, 'affine.win32-arm64-msvc.node')
|
||||||
);
|
)
|
||||||
try {
|
try {
|
||||||
if (localFileExisted) {
|
if (localFileExisted) {
|
||||||
nativeBinding = require('./affine.win32-arm64-msvc.node');
|
nativeBinding = require('./affine.win32-arm64-msvc.node')
|
||||||
} else {
|
} else {
|
||||||
nativeBinding = require('@affine/native-win32-arm64-msvc');
|
nativeBinding = require('@affine/native-win32-arm64-msvc')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
loadError = e;
|
loadError = e
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unsupported architecture on Windows: ${arch}`);
|
throw new Error(`Unsupported architecture on Windows: ${arch}`)
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case 'darwin':
|
case 'darwin':
|
||||||
localFileExisted = existsSync(
|
localFileExisted = existsSync(join(__dirname, 'affine.darwin-universal.node'))
|
||||||
join(__dirname, 'affine.darwin-universal.node')
|
|
||||||
);
|
|
||||||
try {
|
try {
|
||||||
if (localFileExisted) {
|
if (localFileExisted) {
|
||||||
nativeBinding = require('./affine.darwin-universal.node');
|
nativeBinding = require('./affine.darwin-universal.node')
|
||||||
} else {
|
} else {
|
||||||
nativeBinding = require('@affine/native-darwin-universal');
|
nativeBinding = require('@affine/native-darwin-universal')
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
} catch {}
|
} catch {}
|
||||||
switch (arch) {
|
switch (arch) {
|
||||||
case 'x64':
|
case 'x64':
|
||||||
localFileExisted = existsSync(
|
localFileExisted = existsSync(join(__dirname, 'affine.darwin-x64.node'))
|
||||||
join(__dirname, 'affine.darwin-x64.node')
|
|
||||||
);
|
|
||||||
try {
|
try {
|
||||||
if (localFileExisted) {
|
if (localFileExisted) {
|
||||||
nativeBinding = require('./affine.darwin-x64.node');
|
nativeBinding = require('./affine.darwin-x64.node')
|
||||||
} else {
|
} else {
|
||||||
nativeBinding = require('@affine/native-darwin-x64');
|
nativeBinding = require('@affine/native-darwin-x64')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
loadError = e;
|
loadError = e
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case 'arm64':
|
case 'arm64':
|
||||||
localFileExisted = existsSync(
|
localFileExisted = existsSync(
|
||||||
join(__dirname, 'affine.darwin-arm64.node')
|
join(__dirname, 'affine.darwin-arm64.node')
|
||||||
);
|
)
|
||||||
try {
|
try {
|
||||||
if (localFileExisted) {
|
if (localFileExisted) {
|
||||||
nativeBinding = require('./affine.darwin-arm64.node');
|
nativeBinding = require('./affine.darwin-arm64.node')
|
||||||
} else {
|
} else {
|
||||||
nativeBinding = require('@affine/native-darwin-arm64');
|
nativeBinding = require('@affine/native-darwin-arm64')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
loadError = e;
|
loadError = e
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unsupported architecture on macOS: ${arch}`);
|
throw new Error(`Unsupported architecture on macOS: ${arch}`)
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case 'freebsd':
|
case 'freebsd':
|
||||||
if (arch !== 'x64') {
|
if (arch !== 'x64') {
|
||||||
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`);
|
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
|
||||||
}
|
}
|
||||||
localFileExisted = existsSync(join(__dirname, 'affine.freebsd-x64.node'));
|
localFileExisted = existsSync(join(__dirname, 'affine.freebsd-x64.node'))
|
||||||
try {
|
try {
|
||||||
if (localFileExisted) {
|
if (localFileExisted) {
|
||||||
nativeBinding = require('./affine.freebsd-x64.node');
|
nativeBinding = require('./affine.freebsd-x64.node')
|
||||||
} else {
|
} else {
|
||||||
nativeBinding = require('@affine/native-freebsd-x64');
|
nativeBinding = require('@affine/native-freebsd-x64')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
loadError = e;
|
loadError = e
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case 'linux':
|
case 'linux':
|
||||||
switch (arch) {
|
switch (arch) {
|
||||||
case 'x64':
|
case 'x64':
|
||||||
if (isMusl()) {
|
if (isMusl()) {
|
||||||
localFileExisted = existsSync(
|
localFileExisted = existsSync(
|
||||||
join(__dirname, 'affine.linux-x64-musl.node')
|
join(__dirname, 'affine.linux-x64-musl.node')
|
||||||
);
|
)
|
||||||
try {
|
try {
|
||||||
if (localFileExisted) {
|
if (localFileExisted) {
|
||||||
nativeBinding = require('./affine.linux-x64-musl.node');
|
nativeBinding = require('./affine.linux-x64-musl.node')
|
||||||
} else {
|
} else {
|
||||||
nativeBinding = require('@affine/native-linux-x64-musl');
|
nativeBinding = require('@affine/native-linux-x64-musl')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
loadError = e;
|
loadError = e
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
localFileExisted = existsSync(
|
localFileExisted = existsSync(
|
||||||
join(__dirname, 'affine.linux-x64-gnu.node')
|
join(__dirname, 'affine.linux-x64-gnu.node')
|
||||||
);
|
)
|
||||||
try {
|
try {
|
||||||
if (localFileExisted) {
|
if (localFileExisted) {
|
||||||
nativeBinding = require('./affine.linux-x64-gnu.node');
|
nativeBinding = require('./affine.linux-x64-gnu.node')
|
||||||
} else {
|
} else {
|
||||||
nativeBinding = require('@affine/native-linux-x64-gnu');
|
nativeBinding = require('@affine/native-linux-x64-gnu')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
loadError = e;
|
loadError = e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case 'arm64':
|
case 'arm64':
|
||||||
if (isMusl()) {
|
if (isMusl()) {
|
||||||
localFileExisted = existsSync(
|
localFileExisted = existsSync(
|
||||||
join(__dirname, 'affine.linux-arm64-musl.node')
|
join(__dirname, 'affine.linux-arm64-musl.node')
|
||||||
);
|
)
|
||||||
try {
|
try {
|
||||||
if (localFileExisted) {
|
if (localFileExisted) {
|
||||||
nativeBinding = require('./affine.linux-arm64-musl.node');
|
nativeBinding = require('./affine.linux-arm64-musl.node')
|
||||||
} else {
|
} else {
|
||||||
nativeBinding = require('@affine/native-linux-arm64-musl');
|
nativeBinding = require('@affine/native-linux-arm64-musl')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
loadError = e;
|
loadError = e
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
localFileExisted = existsSync(
|
localFileExisted = existsSync(
|
||||||
join(__dirname, 'affine.linux-arm64-gnu.node')
|
join(__dirname, 'affine.linux-arm64-gnu.node')
|
||||||
);
|
)
|
||||||
try {
|
try {
|
||||||
if (localFileExisted) {
|
if (localFileExisted) {
|
||||||
nativeBinding = require('./affine.linux-arm64-gnu.node');
|
nativeBinding = require('./affine.linux-arm64-gnu.node')
|
||||||
} else {
|
} else {
|
||||||
nativeBinding = require('@affine/native-linux-arm64-gnu');
|
nativeBinding = require('@affine/native-linux-arm64-gnu')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
loadError = e;
|
loadError = e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case 'arm':
|
case 'arm':
|
||||||
localFileExisted = existsSync(
|
localFileExisted = existsSync(
|
||||||
join(__dirname, 'affine.linux-arm-gnueabihf.node')
|
join(__dirname, 'affine.linux-arm-gnueabihf.node')
|
||||||
);
|
)
|
||||||
try {
|
try {
|
||||||
if (localFileExisted) {
|
if (localFileExisted) {
|
||||||
nativeBinding = require('./affine.linux-arm-gnueabihf.node');
|
nativeBinding = require('./affine.linux-arm-gnueabihf.node')
|
||||||
} else {
|
} else {
|
||||||
nativeBinding = require('@affine/native-linux-arm-gnueabihf');
|
nativeBinding = require('@affine/native-linux-arm-gnueabihf')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
loadError = e;
|
loadError = e
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unsupported architecture on Linux: ${arch}`);
|
throw new Error(`Unsupported architecture on Linux: ${arch}`)
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`);
|
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nativeBinding) {
|
if (!nativeBinding) {
|
||||||
if (loadError) {
|
if (loadError) {
|
||||||
throw loadError;
|
throw loadError
|
||||||
}
|
}
|
||||||
throw new Error(`Failed to load native binding`);
|
throw new Error(`Failed to load native binding`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const {
|
const { SqliteConnection, ValidationResult, verifyChallengeResponse, mintChallengeResponse } = nativeBinding
|
||||||
SqliteConnection,
|
|
||||||
ValidationResult,
|
|
||||||
verifyChallengeResponse,
|
|
||||||
mintChallengeResponse,
|
|
||||||
} = nativeBinding;
|
|
||||||
|
|
||||||
module.exports.SqliteConnection = SqliteConnection;
|
module.exports.SqliteConnection = SqliteConnection
|
||||||
module.exports.ValidationResult = ValidationResult;
|
module.exports.ValidationResult = ValidationResult
|
||||||
module.exports.verifyChallengeResponse = verifyChallengeResponse;
|
module.exports.verifyChallengeResponse = verifyChallengeResponse
|
||||||
module.exports.mintChallengeResponse = mintChallengeResponse;
|
module.exports.mintChallengeResponse = mintChallengeResponse
|
||||||
|
|||||||
Reference in New Issue
Block a user