@hyperledger/anoncreds-nodejs 0.5.0-alpha-20261027094647 → 0.5.0-alpha-20261027201040
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.mts +273 -0
- package/build/index.mjs +871 -0
- package/build/index.mjs.map +1 -0
- package/package.json +16 -8
- package/build/NodeJSAnoncreds.d.ts +0 -267
- package/build/NodeJSAnoncreds.js +0 -479
- package/build/NodeJSAnoncreds.js.map +0 -1
- package/build/ffi/alloc.d.ts +0 -10
- package/build/ffi/alloc.js +0 -38
- package/build/ffi/alloc.js.map +0 -1
- package/build/ffi/conversion.d.ts +0 -17
- package/build/ffi/conversion.js +0 -39
- package/build/ffi/conversion.js.map +0 -1
- package/build/ffi/index.d.ts +0 -5
- package/build/ffi/index.js +0 -22
- package/build/ffi/index.js.map +0 -1
- package/build/ffi/primitives.d.ts +0 -11
- package/build/ffi/primitives.js +0 -48
- package/build/ffi/primitives.js.map +0 -1
- package/build/ffi/serialize.d.ts +0 -1
- package/build/ffi/serialize.js +0 -46
- package/build/ffi/serialize.js.map +0 -1
- package/build/ffi/structures.d.ts +0 -27
- package/build/ffi/structures.js +0 -59
- package/build/ffi/structures.js.map +0 -1
- package/build/index.d.ts +0 -3
- package/build/index.js +0 -23
- package/build/index.js.map +0 -1
- package/build/library/NativeBindingInterface.d.ts +0 -2
- package/build/library/NativeBindingInterface.js +0 -3
- package/build/library/NativeBindingInterface.js.map +0 -1
- package/build/library/bindings.d.ts +0 -4
- package/build/library/bindings.js +0 -352
- package/build/library/bindings.js.map +0 -1
- package/build/library/index.d.ts +0 -3
- package/build/library/index.js +0 -20
- package/build/library/index.js.map +0 -1
- package/build/library/register.d.ts +0 -2
- package/build/library/register.js +0 -66
- package/build/library/register.js.map +0 -1
package/build/library/index.d.ts
DELETED
package/build/library/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./bindings"), exports);
|
|
18
|
-
__exportStar(require("./NativeBindingInterface"), exports);
|
|
19
|
-
__exportStar(require("./register"), exports);
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA0B;AAC1B,2DAAwC;AACxC,6CAA0B"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getNativeAnonCreds = void 0;
|
|
7
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
-
const node_os_1 = __importDefault(require("node:os"));
|
|
9
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
-
const koffi_1 = __importDefault(require("koffi"));
|
|
11
|
-
const bindings_1 = require("./bindings");
|
|
12
|
-
const LIBNAME = 'anoncreds';
|
|
13
|
-
const ENV_VAR = 'LIB_ANONCREDS_PATH';
|
|
14
|
-
const extensions = {
|
|
15
|
-
darwin: { prefix: 'lib', extension: '.dylib' },
|
|
16
|
-
linux: { prefix: 'lib', extension: '.so' },
|
|
17
|
-
win32: { extension: '.dll' },
|
|
18
|
-
};
|
|
19
|
-
const libPaths = {
|
|
20
|
-
darwin: ['/usr/local/lib/', '/usr/lib/', '/opt/homebrew/opt/'],
|
|
21
|
-
linux: ['/usr/lib/', '/usr/local/lib/'],
|
|
22
|
-
win32: ['c:\\windows\\system32\\'],
|
|
23
|
-
};
|
|
24
|
-
// Alias for a simple function to check if the path exists
|
|
25
|
-
const doesPathExist = node_fs_1.default.existsSync;
|
|
26
|
-
const getLibrary = () => {
|
|
27
|
-
// Detect OS; darwin, linux and windows are only supported
|
|
28
|
-
const platform = node_os_1.default.platform();
|
|
29
|
-
if (platform !== 'linux' && platform !== 'win32' && platform !== 'darwin')
|
|
30
|
-
throw new Error(`Unsupported platform: ${platform}. linux, win32 and darwin are supported.`);
|
|
31
|
-
// Get a potential path from the environment variable
|
|
32
|
-
const pathFromEnvironment = process.env[ENV_VAR];
|
|
33
|
-
// Get the paths specific to the users operating system
|
|
34
|
-
const platformPaths = libPaths[platform];
|
|
35
|
-
// Look for the file in the native directory of the package.
|
|
36
|
-
// node-pre-gyp will download the binaries to this directory after installing the package
|
|
37
|
-
platformPaths.unshift(node_path_1.default.join(__dirname, '../../native'));
|
|
38
|
-
// Check if the path from the environment variable is supplied and add it
|
|
39
|
-
// We use unshift here so that when we want to get a valid library path this will be the first to resolve
|
|
40
|
-
if (pathFromEnvironment)
|
|
41
|
-
platformPaths.unshift(pathFromEnvironment);
|
|
42
|
-
// Create the path + file
|
|
43
|
-
const libraries = platformPaths.map((p) => { var _a; return node_path_1.default.join(p, `${(_a = extensions[platform].prefix) !== null && _a !== void 0 ? _a : ''}${LIBNAME}${extensions[platform].extension}`); });
|
|
44
|
-
// Guard so we quit if there is no valid path for the library
|
|
45
|
-
if (!libraries.some((libraryPath) => doesPathExist(libraryPath)))
|
|
46
|
-
throw new Error(`Could not find ${LIBNAME} with these paths: ${libraries.join(' ')}`);
|
|
47
|
-
// Get the first valid library
|
|
48
|
-
// Casting here as a string because there is a guard of none of the paths
|
|
49
|
-
const validLibraryPath = libraries.find((l) => doesPathExist(l));
|
|
50
|
-
// Load the library using koffi
|
|
51
|
-
const lib = koffi_1.default.load(validLibraryPath);
|
|
52
|
-
// Bind all the native functions
|
|
53
|
-
const methods = {};
|
|
54
|
-
for (const [name, [returnType, argumentTypes]] of Object.entries(bindings_1.nativeBindings)) {
|
|
55
|
-
methods[name] = lib.func(name, returnType, argumentTypes);
|
|
56
|
-
}
|
|
57
|
-
return methods;
|
|
58
|
-
};
|
|
59
|
-
let nativeAnonCreds;
|
|
60
|
-
const getNativeAnonCreds = () => {
|
|
61
|
-
if (!nativeAnonCreds)
|
|
62
|
-
nativeAnonCreds = getLibrary();
|
|
63
|
-
return nativeAnonCreds;
|
|
64
|
-
};
|
|
65
|
-
exports.getNativeAnonCreds = getNativeAnonCreds;
|
|
66
|
-
//# sourceMappingURL=register.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/library/register.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAwB;AACxB,sDAAwB;AACxB,0DAA4B;AAC5B,kDAAyB;AACzB,yCAA2C;AAG3C,MAAM,OAAO,GAAG,WAAW,CAAA;AAC3B,MAAM,OAAO,GAAG,oBAAoB,CAAA;AAMpC,MAAM,UAAU,GAAiB;IAC/B,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE;IAC9C,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE;IAC1C,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAA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