@credo-ts/node 0.5.0-alpha.106 → 0.5.0-alpha.107
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.ts +1 -2
- package/build/index.js +1 -4
- package/build/index.js.map +1 -1
- package/package.json +3 -3
- package/build/PostgresPlugin.d.ts +0 -22
- package/build/PostgresPlugin.js +0 -68
- package/build/PostgresPlugin.js.map +0 -1
package/build/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { AgentDependencies } from '@credo-ts/core';
|
|
2
|
-
import { IndySdkPostgresStorageConfig, loadIndySdkPostgresPlugin, IndySdkPostgresWalletScheme } from './PostgresPlugin';
|
|
3
2
|
import { HttpInboundTransport } from './transport/HttpInboundTransport';
|
|
4
3
|
import { WsInboundTransport } from './transport/WsInboundTransport';
|
|
5
4
|
declare const agentDependencies: AgentDependencies;
|
|
6
|
-
export { agentDependencies, HttpInboundTransport, WsInboundTransport
|
|
5
|
+
export { agentDependencies, HttpInboundTransport, WsInboundTransport };
|
package/build/index.js
CHANGED
|
@@ -3,13 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.WsInboundTransport = exports.HttpInboundTransport = exports.agentDependencies = void 0;
|
|
7
7
|
const events_1 = require("events");
|
|
8
8
|
const ws_1 = __importDefault(require("ws"));
|
|
9
9
|
const NodeFileSystem_1 = require("./NodeFileSystem");
|
|
10
|
-
const PostgresPlugin_1 = require("./PostgresPlugin");
|
|
11
|
-
Object.defineProperty(exports, "loadIndySdkPostgresPlugin", { enumerable: true, get: function () { return PostgresPlugin_1.loadIndySdkPostgresPlugin; } });
|
|
12
|
-
Object.defineProperty(exports, "IndySdkPostgresWalletScheme", { enumerable: true, get: function () { return PostgresPlugin_1.IndySdkPostgresWalletScheme; } });
|
|
13
10
|
const HttpInboundTransport_1 = require("./transport/HttpInboundTransport");
|
|
14
11
|
Object.defineProperty(exports, "HttpInboundTransport", { enumerable: true, get: function () { return HttpInboundTransport_1.HttpInboundTransport; } });
|
|
15
12
|
const WsInboundTransport_1 = require("./transport/WsInboundTransport");
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAEA,mCAAqC;AACrC,4CAA0B;AAE1B,qDAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAEA,mCAAqC;AACrC,4CAA0B;AAE1B,qDAAiD;AACjD,2EAAuE;AAU3C,qGAVnB,2CAAoB,OAUmB;AAThD,uEAAmE;AASjB,mGATzC,uCAAkB,OASyC;AAPpE,MAAM,iBAAiB,GAAsB;IAC3C,UAAU,EAAE,+BAAc;IAC1B,KAAK;IACL,iBAAiB,EAAE,qBAAY;IAC/B,cAAc,EAAE,YAAS;CAC1B,CAAA;AAEQ,8CAAiB"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@credo-ts/node",
|
|
3
3
|
"main": "build/index",
|
|
4
4
|
"types": "build/index",
|
|
5
|
-
"version": "0.5.0-alpha.
|
|
5
|
+
"version": "0.5.0-alpha.107+0feda532",
|
|
6
6
|
"files": [
|
|
7
7
|
"build"
|
|
8
8
|
],
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@2060.io/ffi-napi": "^4.0.8",
|
|
28
28
|
"@2060.io/ref-napi": "^3.0.6",
|
|
29
|
-
"@credo-ts/core": "0.5.0-alpha.
|
|
29
|
+
"@credo-ts/core": "0.5.0-alpha.107+0feda532",
|
|
30
30
|
"@types/express": "^4.17.15",
|
|
31
31
|
"express": "^4.17.1",
|
|
32
32
|
"ws": "^8.13.0"
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"rimraf": "^4.4.0",
|
|
39
39
|
"typescript": "~4.9.5"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "0feda532628f47e0d381a5cc124f5aa052acf26d"
|
|
42
42
|
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface IndySdkPostgresWalletStorageConfig {
|
|
2
|
-
url: string;
|
|
3
|
-
wallet_scheme: IndySdkPostgresWalletScheme;
|
|
4
|
-
path?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface IndySdkPostgresWalletStorageCredentials {
|
|
7
|
-
account: string;
|
|
8
|
-
password: string;
|
|
9
|
-
admin_account: string;
|
|
10
|
-
admin_password: string;
|
|
11
|
-
}
|
|
12
|
-
export declare enum IndySdkPostgresWalletScheme {
|
|
13
|
-
DatabasePerWallet = "DatabasePerWallet",
|
|
14
|
-
MultiWalletSingleTable = "MultiWalletSingleTable",
|
|
15
|
-
MultiWalletSingleTableSharedPool = "MultiWalletSingleTableSharedPool"
|
|
16
|
-
}
|
|
17
|
-
export interface IndySdkPostgresStorageConfig {
|
|
18
|
-
type: 'postgres_storage';
|
|
19
|
-
config: IndySdkPostgresWalletStorageConfig;
|
|
20
|
-
credentials: IndySdkPostgresWalletStorageCredentials;
|
|
21
|
-
}
|
|
22
|
-
export declare function loadIndySdkPostgresPlugin(config: IndySdkPostgresWalletStorageConfig, credentials: IndySdkPostgresWalletStorageCredentials): void;
|
package/build/PostgresPlugin.js
DELETED
|
@@ -1,68 +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.loadIndySdkPostgresPlugin = exports.IndySdkPostgresWalletScheme = void 0;
|
|
7
|
-
const ffi_napi_1 = require("@2060.io/ffi-napi");
|
|
8
|
-
const ref_napi_1 = require("@2060.io/ref-napi");
|
|
9
|
-
const fs_1 = __importDefault(require("fs"));
|
|
10
|
-
const os_1 = __importDefault(require("os"));
|
|
11
|
-
const path_1 = __importDefault(require("path"));
|
|
12
|
-
const LIBNAME = 'indystrgpostgres';
|
|
13
|
-
const ENV_VAR = 'LIB_INDY_STRG_POSTGRES';
|
|
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 = fs_1.default.existsSync;
|
|
26
|
-
const getLibrary = () => {
|
|
27
|
-
// Detect OS; darwin, linux and windows are only supported
|
|
28
|
-
const platform = 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
|
-
// Check if the path from the environment variable is supplied and add it
|
|
36
|
-
// We use unshift here so that when we want to get a valid library path this will be the first to resolve
|
|
37
|
-
if (pathFromEnvironment)
|
|
38
|
-
platformPaths.unshift(pathFromEnvironment);
|
|
39
|
-
// Create the path + file
|
|
40
|
-
const libraries = platformPaths.map((p) => { var _a; return path_1.default.join(p, `${(_a = extensions[platform].prefix) !== null && _a !== void 0 ? _a : ''}${LIBNAME}${extensions[platform].extension}`); });
|
|
41
|
-
// Gaurd so we quit if there is no valid path for the library
|
|
42
|
-
if (!libraries.some(doesPathExist))
|
|
43
|
-
throw new Error(`Could not find ${LIBNAME} with these paths: ${libraries.join(' ')}`);
|
|
44
|
-
// Get the first valid library
|
|
45
|
-
// Casting here as a string because there is a guard of none of the paths
|
|
46
|
-
// would be valid
|
|
47
|
-
const validLibraryPath = libraries.find((l) => doesPathExist(l));
|
|
48
|
-
return (0, ffi_napi_1.Library)(validLibraryPath, {
|
|
49
|
-
postgresstorage_init: [ref_napi_1.types.int, []],
|
|
50
|
-
init_storagetype: [ref_napi_1.types.int, ['string', 'string']],
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
let indyPostgresStorage;
|
|
54
|
-
var IndySdkPostgresWalletScheme;
|
|
55
|
-
(function (IndySdkPostgresWalletScheme) {
|
|
56
|
-
IndySdkPostgresWalletScheme["DatabasePerWallet"] = "DatabasePerWallet";
|
|
57
|
-
IndySdkPostgresWalletScheme["MultiWalletSingleTable"] = "MultiWalletSingleTable";
|
|
58
|
-
IndySdkPostgresWalletScheme["MultiWalletSingleTableSharedPool"] = "MultiWalletSingleTableSharedPool";
|
|
59
|
-
})(IndySdkPostgresWalletScheme = exports.IndySdkPostgresWalletScheme || (exports.IndySdkPostgresWalletScheme = {}));
|
|
60
|
-
function loadIndySdkPostgresPlugin(config, credentials) {
|
|
61
|
-
if (!indyPostgresStorage) {
|
|
62
|
-
indyPostgresStorage = getLibrary();
|
|
63
|
-
}
|
|
64
|
-
indyPostgresStorage.postgresstorage_init();
|
|
65
|
-
indyPostgresStorage.init_storagetype(JSON.stringify(config), JSON.stringify(credentials));
|
|
66
|
-
}
|
|
67
|
-
exports.loadIndySdkPostgresPlugin = loadIndySdkPostgresPlugin;
|
|
68
|
-
//# sourceMappingURL=PostgresPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{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