@credo-ts/node 0.6.0-alpha-20251127043254 → 0.6.0-alpha-20251127101655
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/_virtual/{_@oxc-project_runtime@0.97.0 → _@oxc-project_runtime@0.98.0}/helpers/assertClassBrand.mjs +1 -1
- package/build/_virtual/{_@oxc-project_runtime@0.97.0 → _@oxc-project_runtime@0.98.0}/helpers/checkPrivateRedeclaration.mjs +1 -1
- package/build/_virtual/{_@oxc-project_runtime@0.97.0 → _@oxc-project_runtime@0.98.0}/helpers/classPrivateFieldGet2.mjs +1 -1
- package/build/_virtual/{_@oxc-project_runtime@0.97.0 → _@oxc-project_runtime@0.98.0}/helpers/classPrivateFieldInitSpec.mjs +1 -1
- package/build/_virtual/{_@oxc-project_runtime@0.97.0 → _@oxc-project_runtime@0.98.0}/helpers/classPrivateFieldSet2.mjs +1 -1
- package/build/kms/NodeInMemoryKeyManagementStorage.mjs +2 -2
- package/build/kms/NodeKeyManagementService.mjs +3 -3
- package/package.json +5 -10
- package/build/NodeFileSystem.js +0 -89
- package/build/_virtual/_@oxc-project_runtime@0.97.0/helpers/assertClassBrand.js +0 -9
- package/build/_virtual/_@oxc-project_runtime@0.97.0/helpers/checkPrivateRedeclaration.js +0 -8
- package/build/_virtual/_@oxc-project_runtime@0.97.0/helpers/classPrivateFieldGet2.js +0 -9
- package/build/_virtual/_@oxc-project_runtime@0.97.0/helpers/classPrivateFieldInitSpec.js +0 -9
- package/build/_virtual/_@oxc-project_runtime@0.97.0/helpers/classPrivateFieldSet2.js +0 -9
- package/build/_virtual/rolldown_runtime.js +0 -25
- package/build/index.d.ts +0 -12
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -23
- package/build/kms/NodeInMemoryKeyManagementStorage.d.ts +0 -81
- package/build/kms/NodeInMemoryKeyManagementStorage.d.ts.map +0 -1
- package/build/kms/NodeInMemoryKeyManagementStorage.js +0 -33
- package/build/kms/NodeKeyManagementService.d.ts +0 -24
- package/build/kms/NodeKeyManagementService.d.ts.map +0 -1
- package/build/kms/NodeKeyManagementService.js +0 -279
- package/build/kms/NodeKeyManagementStorage.d.ts +0 -15
- package/build/kms/NodeKeyManagementStorage.d.ts.map +0 -1
- package/build/kms/crypto/createKey.js +0 -65
- package/build/kms/crypto/decrypt.js +0 -68
- package/build/kms/crypto/deriveKey.js +0 -161
- package/build/kms/crypto/encrypt.js +0 -99
- package/build/kms/crypto/sign.js +0 -67
- package/build/kms/crypto/verify.js +0 -30
- package/build/transport/DidCommHttpInboundTransport.d.ts +0 -31
- package/build/transport/DidCommHttpInboundTransport.d.ts.map +0 -1
- package/build/transport/DidCommHttpInboundTransport.js +0 -84
- package/build/transport/DidCommWsInboundTransport.d.ts +0 -26
- package/build/transport/DidCommWsInboundTransport.d.ts.map +0 -1
- package/build/transport/DidCommWsInboundTransport.js +0 -83
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.98.0/helpers/assertClassBrand.js
|
|
2
2
|
function _assertClassBrand(e, t, n) {
|
|
3
3
|
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
4
4
|
throw new TypeError("Private element is not present on this object");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.98.0/helpers/checkPrivateRedeclaration.js
|
|
2
2
|
function _checkPrivateRedeclaration(e, t) {
|
|
3
3
|
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
4
4
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _assertClassBrand } from "./assertClassBrand.mjs";
|
|
2
2
|
|
|
3
|
-
//#region \0@oxc-project+runtime@0.
|
|
3
|
+
//#region \0@oxc-project+runtime@0.98.0/helpers/classPrivateFieldGet2.js
|
|
4
4
|
function _classPrivateFieldGet2(s, a) {
|
|
5
5
|
return s.get(_assertClassBrand(s, a));
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _checkPrivateRedeclaration } from "./checkPrivateRedeclaration.mjs";
|
|
2
2
|
|
|
3
|
-
//#region \0@oxc-project+runtime@0.
|
|
3
|
+
//#region \0@oxc-project+runtime@0.98.0/helpers/classPrivateFieldInitSpec.js
|
|
4
4
|
function _classPrivateFieldInitSpec(e, t, a) {
|
|
5
5
|
_checkPrivateRedeclaration(e, t), t.set(e, a);
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _assertClassBrand } from "./assertClassBrand.mjs";
|
|
2
2
|
|
|
3
|
-
//#region \0@oxc-project+runtime@0.
|
|
3
|
+
//#region \0@oxc-project+runtime@0.98.0/helpers/classPrivateFieldSet2.js
|
|
4
4
|
function _classPrivateFieldSet2(s, a, r) {
|
|
5
5
|
return s.set(_assertClassBrand(s, a), r), r;
|
|
6
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _classPrivateFieldInitSpec } from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import { _classPrivateFieldGet2 } from "../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import { _classPrivateFieldInitSpec } from "../_virtual/_@oxc-project_runtime@0.98.0/helpers/classPrivateFieldInitSpec.mjs";
|
|
2
|
+
import { _classPrivateFieldGet2 } from "../_virtual/_@oxc-project_runtime@0.98.0/helpers/classPrivateFieldGet2.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/kms/NodeInMemoryKeyManagementStorage.ts
|
|
5
5
|
var _storage = /* @__PURE__ */ new WeakMap();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { _classPrivateFieldInitSpec } from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import { _classPrivateFieldGet2 } from "../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import { _classPrivateFieldInitSpec } from "../_virtual/_@oxc-project_runtime@0.98.0/helpers/classPrivateFieldInitSpec.mjs";
|
|
2
|
+
import { _classPrivateFieldGet2 } from "../_virtual/_@oxc-project_runtime@0.98.0/helpers/classPrivateFieldGet2.mjs";
|
|
3
3
|
import { assertNodeSupportedEcCrv, assertNodeSupportedOctAlgorithm, assertNodeSupportedOkpCrv, createEcKey, createOctKey, createOkpKey, createRsaKey } from "./crypto/createKey.mjs";
|
|
4
4
|
import { nodeSupportedJwaAlgorithm, performSign } from "./crypto/sign.mjs";
|
|
5
5
|
import { performDecrypt } from "./crypto/decrypt.mjs";
|
|
6
6
|
import { deriveDecryptionKey, deriveEncryptionKey, nodeSupportedKeyAgreementAlgorithms } from "./crypto/deriveKey.mjs";
|
|
7
7
|
import { nodeSupportedEncryptionAlgorithms, performEncrypt } from "./crypto/encrypt.mjs";
|
|
8
8
|
import { performVerify } from "./crypto/verify.mjs";
|
|
9
|
-
import { _classPrivateFieldSet2 } from "../_virtual/_@oxc-project_runtime@0.
|
|
9
|
+
import { _classPrivateFieldSet2 } from "../_virtual/_@oxc-project_runtime@0.98.0/helpers/classPrivateFieldSet2.mjs";
|
|
10
10
|
import { Kms, TypedArrayEncoder } from "@credo-ts/core";
|
|
11
11
|
import { createPrivateKey, createSecretKey, randomBytes, randomUUID } from "node:crypto";
|
|
12
12
|
|
package/package.json
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@credo-ts/node",
|
|
3
3
|
"exports": {
|
|
4
|
-
".":
|
|
5
|
-
"import": "./build/index.mjs",
|
|
6
|
-
"require": "./build/index.js",
|
|
7
|
-
"types": "./build/index.d.ts"
|
|
8
|
-
},
|
|
4
|
+
".": "./build/index.mjs",
|
|
9
5
|
"./package.json": "./package.json"
|
|
10
6
|
},
|
|
11
|
-
"version": "0.6.0-alpha-
|
|
7
|
+
"version": "0.6.0-alpha-20251127101655",
|
|
12
8
|
"files": [
|
|
13
9
|
"build"
|
|
14
10
|
],
|
|
@@ -32,8 +28,8 @@
|
|
|
32
28
|
"express": "^5.1.0",
|
|
33
29
|
"rxjs": "^7.8.2",
|
|
34
30
|
"ws": "^8.18.3",
|
|
35
|
-
"@credo-ts/core": "0.6.0-alpha-
|
|
36
|
-
"@credo-ts/didcomm": "0.6.0-alpha-
|
|
31
|
+
"@credo-ts/core": "0.6.0-alpha-20251127101655",
|
|
32
|
+
"@credo-ts/didcomm": "0.6.0-alpha-20251127101655"
|
|
37
33
|
},
|
|
38
34
|
"devDependencies": {
|
|
39
35
|
"@types/node": "^20.19.25",
|
|
@@ -44,7 +40,6 @@
|
|
|
44
40
|
"scripts": {
|
|
45
41
|
"build": "tsdown --config-loader unconfig"
|
|
46
42
|
},
|
|
47
|
-
"
|
|
48
|
-
"types": "./build/index.d.ts",
|
|
43
|
+
"types": "./build/index.d.mts",
|
|
49
44
|
"module": "./build/index.mjs"
|
|
50
45
|
}
|
package/build/NodeFileSystem.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.js');
|
|
2
|
-
let __credo_ts_core = require("@credo-ts/core");
|
|
3
|
-
let crypto = require("crypto");
|
|
4
|
-
let fs = require("fs");
|
|
5
|
-
fs = require_rolldown_runtime.__toESM(fs);
|
|
6
|
-
let http = require("http");
|
|
7
|
-
http = require_rolldown_runtime.__toESM(http);
|
|
8
|
-
let https = require("https");
|
|
9
|
-
https = require_rolldown_runtime.__toESM(https);
|
|
10
|
-
let os = require("os");
|
|
11
|
-
let path = require("path");
|
|
12
|
-
|
|
13
|
-
//#region src/NodeFileSystem.ts
|
|
14
|
-
const { access, readFile, writeFile, mkdir, rm, unlink, copyFile } = fs.promises;
|
|
15
|
-
var NodeFileSystem = class {
|
|
16
|
-
/**
|
|
17
|
-
* Create new NodeFileSystem class instance.
|
|
18
|
-
*
|
|
19
|
-
* @param baseDataPath The base path to use for reading and writing data files used within the framework.
|
|
20
|
-
* Files will be created under baseDataPath/.afj directory. If not specified, it will be set to homedir()
|
|
21
|
-
* @param baseCachePath The base path to use for reading and writing cache files used within the framework.
|
|
22
|
-
* Files will be created under baseCachePath/.afj directory. If not specified, it will be set to homedir()
|
|
23
|
-
* @param baseTempPath The base path to use for reading and writing temporary files within the framework.
|
|
24
|
-
* Files will be created under baseTempPath/.afj directory. If not specified, it will be set to tmpdir()
|
|
25
|
-
*/
|
|
26
|
-
constructor(options) {
|
|
27
|
-
this.dataPath = options?.baseDataPath ? `${options?.baseDataPath}/.afj` : `${(0, os.homedir)()}/.afj/data`;
|
|
28
|
-
this.cachePath = options?.baseCachePath ? `${options?.baseCachePath}/.afj` : `${(0, os.homedir)()}/.afj/cache`;
|
|
29
|
-
this.tempPath = `${options?.baseTempPath ?? (0, os.tmpdir)()}/.afj`;
|
|
30
|
-
}
|
|
31
|
-
async exists(path$1) {
|
|
32
|
-
try {
|
|
33
|
-
await access(path$1);
|
|
34
|
-
return true;
|
|
35
|
-
} catch {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
async createDirectory(path$1) {
|
|
40
|
-
await mkdir((0, path.dirname)(path$1), { recursive: true });
|
|
41
|
-
}
|
|
42
|
-
async copyFile(sourcePath, destinationPath) {
|
|
43
|
-
await copyFile(sourcePath, destinationPath);
|
|
44
|
-
}
|
|
45
|
-
async write(path$1, data) {
|
|
46
|
-
await mkdir((0, path.dirname)(path$1), { recursive: true });
|
|
47
|
-
return writeFile(path$1, data, { encoding: "utf-8" });
|
|
48
|
-
}
|
|
49
|
-
async read(path$1) {
|
|
50
|
-
return readFile(path$1, { encoding: "utf-8" });
|
|
51
|
-
}
|
|
52
|
-
async delete(path$1) {
|
|
53
|
-
await rm(path$1, {
|
|
54
|
-
recursive: true,
|
|
55
|
-
force: true
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
async downloadToFile(url, path$1, options) {
|
|
59
|
-
const httpMethod = url.startsWith("https") ? https.default : http.default;
|
|
60
|
-
await mkdir((0, path.dirname)(path$1), { recursive: true });
|
|
61
|
-
const file = fs.default.createWriteStream(path$1);
|
|
62
|
-
const hash = options.verifyHash ? (0, crypto.createHash)("sha256") : void 0;
|
|
63
|
-
return new Promise((resolve, reject) => {
|
|
64
|
-
httpMethod.get(url, (response) => {
|
|
65
|
-
if (response.statusCode !== 200) reject(`Unable to download file from url: ${url}. Response status was ${response.statusCode}`);
|
|
66
|
-
hash && response.pipe(hash);
|
|
67
|
-
response.pipe(file);
|
|
68
|
-
file.on("finish", async () => {
|
|
69
|
-
file.close();
|
|
70
|
-
if (hash && options.verifyHash?.hash) {
|
|
71
|
-
hash.end();
|
|
72
|
-
const digest = hash.digest();
|
|
73
|
-
if (digest.compare(options.verifyHash.hash) !== 0) {
|
|
74
|
-
await fs.default.promises.unlink(path$1);
|
|
75
|
-
reject(new __credo_ts_core.CredoError(`Hash of downloaded file does not match expected hash. Expected: ${options.verifyHash.hash}, Actual: ${__credo_ts_core.TypedArrayEncoder.toUtf8String(digest)})}`));
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
resolve();
|
|
79
|
-
});
|
|
80
|
-
}).on("error", async (error) => {
|
|
81
|
-
await unlink(path$1);
|
|
82
|
-
reject(`Unable to download file from url: ${url}. ${error.message}`);
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
//#endregion
|
|
89
|
-
exports.NodeFileSystem = NodeFileSystem;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region \0@oxc-project+runtime@0.97.0/helpers/assertClassBrand.js
|
|
3
|
-
function _assertClassBrand(e, t, n) {
|
|
4
|
-
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
5
|
-
throw new TypeError("Private element is not present on this object");
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
exports._assertClassBrand = _assertClassBrand;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region \0@oxc-project+runtime@0.97.0/helpers/checkPrivateRedeclaration.js
|
|
3
|
-
function _checkPrivateRedeclaration(e, t) {
|
|
4
|
-
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
exports._checkPrivateRedeclaration = _checkPrivateRedeclaration;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const require_assertClassBrand = require('./assertClassBrand.js');
|
|
2
|
-
|
|
3
|
-
//#region \0@oxc-project+runtime@0.97.0/helpers/classPrivateFieldGet2.js
|
|
4
|
-
function _classPrivateFieldGet2(s, a) {
|
|
5
|
-
return s.get(require_assertClassBrand._assertClassBrand(s, a));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
exports._classPrivateFieldGet2 = _classPrivateFieldGet2;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const require_checkPrivateRedeclaration = require('./checkPrivateRedeclaration.js');
|
|
2
|
-
|
|
3
|
-
//#region \0@oxc-project+runtime@0.97.0/helpers/classPrivateFieldInitSpec.js
|
|
4
|
-
function _classPrivateFieldInitSpec(e, t, a) {
|
|
5
|
-
require_checkPrivateRedeclaration._checkPrivateRedeclaration(e, t), t.set(e, a);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
exports._classPrivateFieldInitSpec = _classPrivateFieldInitSpec;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const require_assertClassBrand = require('./assertClassBrand.js');
|
|
2
|
-
|
|
3
|
-
//#region \0@oxc-project+runtime@0.97.0/helpers/classPrivateFieldSet2.js
|
|
4
|
-
function _classPrivateFieldSet2(s, a, r) {
|
|
5
|
-
return s.set(require_assertClassBrand._assertClassBrand(s, a), r), r;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
exports._classPrivateFieldSet2 = _classPrivateFieldSet2;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
|
|
25
|
-
exports.__toESM = __toESM;
|
package/build/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DidCommHttpInboundTransport } from "./transport/DidCommHttpInboundTransport.js";
|
|
2
|
-
import { DidCommWsInboundTransport } from "./transport/DidCommWsInboundTransport.js";
|
|
3
|
-
import { NodeKeyManagementStorage } from "./kms/NodeKeyManagementStorage.js";
|
|
4
|
-
import { NodeInMemoryKeyManagementStorage } from "./kms/NodeInMemoryKeyManagementStorage.js";
|
|
5
|
-
import { NodeKeyManagementService } from "./kms/NodeKeyManagementService.js";
|
|
6
|
-
import { AgentDependencies } from "@credo-ts/core";
|
|
7
|
-
|
|
8
|
-
//#region src/index.d.ts
|
|
9
|
-
declare const agentDependencies: AgentDependencies;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { DidCommHttpInboundTransport, DidCommWsInboundTransport, NodeInMemoryKeyManagementStorage, NodeKeyManagementService, type NodeKeyManagementStorage, agentDependencies };
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAaM,mBAAmB"}
|
package/build/index.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.js');
|
|
2
|
-
const require_NodeFileSystem = require('./NodeFileSystem.js');
|
|
3
|
-
const require_DidCommHttpInboundTransport = require('./transport/DidCommHttpInboundTransport.js');
|
|
4
|
-
const require_DidCommWsInboundTransport = require('./transport/DidCommWsInboundTransport.js');
|
|
5
|
-
const require_NodeInMemoryKeyManagementStorage = require('./kms/NodeInMemoryKeyManagementStorage.js');
|
|
6
|
-
const require_NodeKeyManagementService = require('./kms/NodeKeyManagementService.js');
|
|
7
|
-
let events = require("events");
|
|
8
|
-
let ws = require("ws");
|
|
9
|
-
|
|
10
|
-
//#region src/index.ts
|
|
11
|
-
const agentDependencies = {
|
|
12
|
-
FileSystem: require_NodeFileSystem.NodeFileSystem,
|
|
13
|
-
fetch,
|
|
14
|
-
EventEmitterClass: events.EventEmitter,
|
|
15
|
-
WebSocketClass: ws.WebSocket
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
exports.DidCommHttpInboundTransport = require_DidCommHttpInboundTransport.DidCommHttpInboundTransport;
|
|
20
|
-
exports.DidCommWsInboundTransport = require_DidCommWsInboundTransport.DidCommWsInboundTransport;
|
|
21
|
-
exports.NodeInMemoryKeyManagementStorage = require_NodeInMemoryKeyManagementStorage.NodeInMemoryKeyManagementStorage;
|
|
22
|
-
exports.NodeKeyManagementService = require_NodeKeyManagementService.NodeKeyManagementService;
|
|
23
|
-
exports.agentDependencies = agentDependencies;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { NodeKeyManagementStorage } from "./NodeKeyManagementStorage.js";
|
|
2
|
-
import { AgentContext, Kms } from "@credo-ts/core";
|
|
3
|
-
|
|
4
|
-
//#region src/kms/NodeInMemoryKeyManagementStorage.d.ts
|
|
5
|
-
declare class NodeInMemoryKeyManagementStorage implements NodeKeyManagementStorage {
|
|
6
|
-
#private;
|
|
7
|
-
get(agentContext: AgentContext, keyId: string): Promise<{
|
|
8
|
-
d: string;
|
|
9
|
-
kty: "EC";
|
|
10
|
-
crv: "P-256" | "P-384" | "P-521" | "secp256k1";
|
|
11
|
-
x: string;
|
|
12
|
-
y: string;
|
|
13
|
-
kid?: string | undefined;
|
|
14
|
-
alg?: string | undefined;
|
|
15
|
-
key_ops?: string[] | undefined;
|
|
16
|
-
use?: string | undefined;
|
|
17
|
-
ext?: boolean | undefined;
|
|
18
|
-
x5c?: string[] | undefined;
|
|
19
|
-
x5t?: string | undefined;
|
|
20
|
-
'x5t#S256'?: string | undefined;
|
|
21
|
-
x5u?: string | undefined;
|
|
22
|
-
} | {
|
|
23
|
-
d: string;
|
|
24
|
-
p: string;
|
|
25
|
-
q: string;
|
|
26
|
-
dp: string;
|
|
27
|
-
dq: string;
|
|
28
|
-
qi: string;
|
|
29
|
-
kty: "RSA";
|
|
30
|
-
n: string;
|
|
31
|
-
e: string;
|
|
32
|
-
oth?: {
|
|
33
|
-
[x: string]: unknown;
|
|
34
|
-
d?: string | undefined;
|
|
35
|
-
r?: string | undefined;
|
|
36
|
-
t?: string | undefined;
|
|
37
|
-
}[] | undefined;
|
|
38
|
-
kid?: string | undefined;
|
|
39
|
-
alg?: string | undefined;
|
|
40
|
-
key_ops?: string[] | undefined;
|
|
41
|
-
use?: string | undefined;
|
|
42
|
-
ext?: boolean | undefined;
|
|
43
|
-
x5c?: string[] | undefined;
|
|
44
|
-
x5t?: string | undefined;
|
|
45
|
-
'x5t#S256'?: string | undefined;
|
|
46
|
-
x5u?: string | undefined;
|
|
47
|
-
} | {
|
|
48
|
-
k: string;
|
|
49
|
-
kty: "oct";
|
|
50
|
-
kid?: string | undefined;
|
|
51
|
-
alg?: string | undefined;
|
|
52
|
-
key_ops?: string[] | undefined;
|
|
53
|
-
use?: string | undefined;
|
|
54
|
-
ext?: boolean | undefined;
|
|
55
|
-
x5c?: string[] | undefined;
|
|
56
|
-
x5t?: string | undefined;
|
|
57
|
-
'x5t#S256'?: string | undefined;
|
|
58
|
-
x5u?: string | undefined;
|
|
59
|
-
} | {
|
|
60
|
-
d: string;
|
|
61
|
-
kty: "OKP";
|
|
62
|
-
crv: "X25519" | "Ed25519";
|
|
63
|
-
x: string;
|
|
64
|
-
kid?: string | undefined;
|
|
65
|
-
alg?: string | undefined;
|
|
66
|
-
key_ops?: string[] | undefined;
|
|
67
|
-
use?: string | undefined;
|
|
68
|
-
ext?: boolean | undefined;
|
|
69
|
-
x5c?: string[] | undefined;
|
|
70
|
-
x5t?: string | undefined;
|
|
71
|
-
'x5t#S256'?: string | undefined;
|
|
72
|
-
x5u?: string | undefined;
|
|
73
|
-
} | null>;
|
|
74
|
-
has(agentContext: AgentContext, keyId: string): boolean;
|
|
75
|
-
set(agentContext: AgentContext, keyId: string, jwk: Kms.KmsJwkPrivate): void;
|
|
76
|
-
delete(agentContext: AgentContext, keyId: string): boolean;
|
|
77
|
-
private storageForContext;
|
|
78
|
-
}
|
|
79
|
-
//#endregion
|
|
80
|
-
export { NodeInMemoryKeyManagementStorage };
|
|
81
|
-
//# sourceMappingURL=NodeInMemoryKeyManagementStorage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeInMemoryKeyManagementStorage.d.ts","names":[],"sources":["../../src/kms/NodeInMemoryKeyManagementStorage.ts"],"sourcesContent":[],"mappings":";;;;cAGa,gCAAA,YAA4C;;EAA5C,GAAA,CAAA,YAAA,EAGoB,YAHpB,EAAA,KAAiC,EAAA,MAAA,CAAA,EAGc,OAHd,CAAA;IAGb,CAAA,EAAA,MAAA;IAA2B,GAAA,EAAA,IAAA;IAIjC,GAAA,EAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,WAAA;IAIA,CAAA,EAAA,MAAA;IAAsC,CAAA,EAAA,MAAA;IAInC,GAAA,CAAA,EAAA,MAAA,GAAA,SAAA;IAf2B,GAAA,CAAA,EAAA,MAAA,GAAA,SAAA;IAAwB,OAAA,CAAA,EAAA,MAAA,EAAA,GAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAOtD;oBAIA,kCAAkC,GAAA,CAAI;uBAInC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const require_classPrivateFieldInitSpec = require('../_virtual/_@oxc-project_runtime@0.97.0/helpers/classPrivateFieldInitSpec.js');
|
|
2
|
-
const require_classPrivateFieldGet2 = require('../_virtual/_@oxc-project_runtime@0.97.0/helpers/classPrivateFieldGet2.js');
|
|
3
|
-
|
|
4
|
-
//#region src/kms/NodeInMemoryKeyManagementStorage.ts
|
|
5
|
-
var _storage = /* @__PURE__ */ new WeakMap();
|
|
6
|
-
var NodeInMemoryKeyManagementStorage = class {
|
|
7
|
-
constructor() {
|
|
8
|
-
require_classPrivateFieldInitSpec._classPrivateFieldInitSpec(this, _storage, /* @__PURE__ */ new Map());
|
|
9
|
-
}
|
|
10
|
-
async get(agentContext, keyId) {
|
|
11
|
-
return this.storageForContext(agentContext).get(keyId) ?? null;
|
|
12
|
-
}
|
|
13
|
-
has(agentContext, keyId) {
|
|
14
|
-
return this.storageForContext(agentContext).has(keyId);
|
|
15
|
-
}
|
|
16
|
-
set(agentContext, keyId, jwk) {
|
|
17
|
-
this.storageForContext(agentContext).set(keyId, jwk);
|
|
18
|
-
}
|
|
19
|
-
delete(agentContext, keyId) {
|
|
20
|
-
return this.storageForContext(agentContext).delete(keyId);
|
|
21
|
-
}
|
|
22
|
-
storageForContext(agentContext) {
|
|
23
|
-
let storage = require_classPrivateFieldGet2._classPrivateFieldGet2(_storage, this).get(agentContext.contextCorrelationId);
|
|
24
|
-
if (!storage) {
|
|
25
|
-
storage = /* @__PURE__ */ new Map();
|
|
26
|
-
require_classPrivateFieldGet2._classPrivateFieldGet2(_storage, this).set(agentContext.contextCorrelationId, storage);
|
|
27
|
-
}
|
|
28
|
-
return storage;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
exports.NodeInMemoryKeyManagementStorage = NodeInMemoryKeyManagementStorage;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { NodeKeyManagementStorage } from "./NodeKeyManagementStorage.js";
|
|
2
|
-
import { AgentContext, Kms } from "@credo-ts/core";
|
|
3
|
-
|
|
4
|
-
//#region src/kms/NodeKeyManagementService.d.ts
|
|
5
|
-
declare class NodeKeyManagementService implements Kms.KeyManagementService {
|
|
6
|
-
#private;
|
|
7
|
-
readonly backend = "node";
|
|
8
|
-
constructor(storage: NodeKeyManagementStorage);
|
|
9
|
-
isOperationSupported(_agentContext: AgentContext, operation: Kms.KmsOperation): boolean;
|
|
10
|
-
randomBytes(_agentContext: AgentContext, options: Kms.KmsRandomBytesOptions): Kms.KmsRandomBytesReturn;
|
|
11
|
-
getPublicKey(agentContext: AgentContext, keyId: string): Promise<Kms.KmsJwkPublic | null>;
|
|
12
|
-
importKey<Jwk extends Kms.KmsJwkPrivate>(agentContext: AgentContext, options: Kms.KmsImportKeyOptions<Jwk>): Promise<Kms.KmsImportKeyReturn<Jwk>>;
|
|
13
|
-
deleteKey(agentContext: AgentContext, options: Kms.KmsDeleteKeyOptions): Promise<boolean>;
|
|
14
|
-
createKey<Type extends Kms.KmsCreateKeyType>(agentContext: AgentContext, options: Kms.KmsCreateKeyOptions<Type>): Promise<Kms.KmsCreateKeyReturn<Type>>;
|
|
15
|
-
sign(agentContext: AgentContext, options: Kms.KmsSignOptions): Promise<Kms.KmsSignReturn>;
|
|
16
|
-
verify(agentContext: AgentContext, options: Kms.KmsVerifyOptions): Promise<Kms.KmsVerifyReturn>;
|
|
17
|
-
encrypt(agentContext: AgentContext, options: Kms.KmsEncryptOptions): Promise<Kms.KmsEncryptReturn>;
|
|
18
|
-
decrypt(agentContext: AgentContext, options: Kms.KmsDecryptOptions): Promise<Kms.KmsDecryptReturn>;
|
|
19
|
-
private getKeyAsserted;
|
|
20
|
-
private assertKeyNotExists;
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { NodeKeyManagementService };
|
|
24
|
-
//# sourceMappingURL=NodeKeyManagementService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeKeyManagementService.d.ts","names":[],"sources":["../../src/kms/NodeKeyManagementService.ts"],"sourcesContent":[],"mappings":";;;;cAmBa,wBAAA,YAAoC,GAAA,CAAI;EAAxC,CAAA,OAAA;EAKiB,SAAA,OAAA,GAAA,MAAA;EAIe,WAAA,CAAA,OAAA,EAJf,wBAIe;EAAyB,oBAAI,CAAA,aAAA,EAA7B,YAA6B,EAAA,SAAA,EAAJ,GAAA,CAAI,YAAA,CAAA,EAAA,OAAA;EAmFtC,WAAA,CAAA,aAAA,EAAA,YAAA,EAAA,OAAA,EAAuB,GAAA,CAAI,qBAA3B,CAAA,EAAmD,GAAA,CAAI,oBAAvD;EAAuB,YAAI,CAAA,YAAA,EAIrB,YAJqB,EAAA,KAAA,EAAA,MAAA,CAAA,EAIS,OAJT,CAIiB,GAAA,CAAI,YAJrB,GAAA,IAAA,CAAA;EAAwB,SAAI,CAAA,YAWtD,GAAA,CAAI,aAXkD,CAAA,CAAA,YAAA,EAYzE,YAZyE,EAAA,OAAA,EAa9E,GAAA,CAAI,mBAb0E,CAatD,GAbsD,CAAA,CAAA,EActF,OAdsF,CAc9E,GAAA,CAAI,kBAd0E,CAcvD,GAduD,CAAA,CAAA;EAIjD,SAAA,CAAA,YAAA,EAmEH,YAnEG,EAAA,OAAA,EAmEoB,GAAA,CAAI,mBAnExB,CAAA,EAmE8C,OAnE9C,CAAA,OAAA,CAAA;EAAsC,SAAI,CAAA,aAuE9C,GAAA,CAAI,gBAvE0C,CAAA,CAAA,YAAA,EAwElE,YAxEkE,EAAA,OAAA,EAyEvE,GAAA,CAAI,mBAzEmE,CAyE/C,IAzE+C,CAAA,CAAA,EA0E/E,OA1E+E,CA0EvE,GAAA,CAAI,kBA1EmE,CA0EhD,IA1EgD,CAAA,CAAA;EAAZ,IAAA,CAAA,YAAA,EAiHtC,YAjHsC,EAAA,OAAA,EAiHf,GAAA,CAAI,cAjHW,CAAA,EAiHM,OAjHN,CAiHc,GAAA,CAAI,aAjHlB,CAAA;EAOnC,MAAI,CAAA,YAAA,EAkIL,YAlIK,EAAA,OAAA,EAkIkB,GAAA,CAAI,gBAlItB,CAAA,EAkIyC,OAlIzC,CAkIiD,GAAA,CAAI,eAlIrD,CAAA;EACvB,OAAA,CAAA,YAAA,EA4KmB,YA5KnB,EAAA,OAAA,EA4K0C,GAAA,CAAI,iBA5K9C,CAAA,EA4KkE,OA5KlE,CA4K0E,GAAA,CAAI,gBA5K9E,CAAA;EACmB,OAAA,CAAA,YAAA,EAuOA,YAvOA,EAAA,OAAA,EAuOuB,GAAA,CAAI,iBAvO3B,CAAA,EAuO+C,OAvO/C,CAuOuD,GAAA,CAAI,gBAvO3D,CAAA;EAAxB,QAAI,cAAA;EACmB,QAAA,kBAAA"}
|