@sphereon/ssi-sdk-ext.mnemonic-seed-manager 0.28.1-feature.esm.cjs.9 → 0.28.1-feature.oyd.cmsm.improv.16

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.
Files changed (46) hide show
  1. package/dist/agent/MnemonicSeedManager.d.ts +26 -0
  2. package/dist/agent/MnemonicSeedManager.d.ts.map +1 -0
  3. package/dist/agent/MnemonicSeedManager.js +209 -0
  4. package/dist/agent/MnemonicSeedManager.js.map +1 -0
  5. package/dist/entities/MnemonicEntity.d.ts +9 -0
  6. package/dist/entities/MnemonicEntity.d.ts.map +1 -0
  7. package/dist/entities/MnemonicEntity.js +50 -0
  8. package/dist/entities/MnemonicEntity.js.map +1 -0
  9. package/dist/index.d.ts +9 -169
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +38 -12895
  12. package/dist/index.js.map +1 -1
  13. package/dist/migrations/generic/1-CreateMnemonics.d.ts +7 -0
  14. package/dist/migrations/generic/1-CreateMnemonics.d.ts.map +1 -0
  15. package/dist/migrations/generic/1-CreateMnemonics.js +72 -0
  16. package/dist/migrations/generic/1-CreateMnemonics.js.map +1 -0
  17. package/dist/migrations/generic/index.d.ts +10 -0
  18. package/dist/migrations/generic/index.d.ts.map +1 -0
  19. package/dist/migrations/generic/index.js +13 -0
  20. package/dist/migrations/generic/index.js.map +1 -0
  21. package/dist/migrations/index.d.ts +2 -0
  22. package/dist/migrations/index.d.ts.map +1 -0
  23. package/dist/migrations/index.js +6 -0
  24. package/dist/migrations/index.js.map +1 -0
  25. package/dist/migrations/internal-migrations-ormconfig.d.ts +7 -0
  26. package/dist/migrations/internal-migrations-ormconfig.d.ts.map +1 -0
  27. package/dist/migrations/internal-migrations-ormconfig.js +29 -0
  28. package/dist/migrations/internal-migrations-ormconfig.js.map +1 -0
  29. package/dist/migrations/postgres/1659566636105-CreateMnemonics.d.ts +7 -0
  30. package/dist/migrations/postgres/1659566636105-CreateMnemonics.d.ts.map +1 -0
  31. package/dist/migrations/postgres/1659566636105-CreateMnemonics.js +29 -0
  32. package/dist/migrations/postgres/1659566636105-CreateMnemonics.js.map +1 -0
  33. package/dist/migrations/sqlite/1659566622817-CreateMnemonics.d.ts +7 -0
  34. package/dist/migrations/sqlite/1659566622817-CreateMnemonics.d.ts.map +1 -0
  35. package/dist/migrations/sqlite/1659566622817-CreateMnemonics.js +29 -0
  36. package/dist/migrations/sqlite/1659566622817-CreateMnemonics.js.map +1 -0
  37. package/dist/tsdoc-metadata.json +1 -1
  38. package/dist/{index.d.cts → types/IMnemonicSeedManager.d.ts} +14 -73
  39. package/dist/types/IMnemonicSeedManager.d.ts.map +1 -0
  40. package/dist/types/IMnemonicSeedManager.js +3 -0
  41. package/dist/types/IMnemonicSeedManager.js.map +1 -0
  42. package/package.json +13 -27
  43. package/src/entities/MnemonicEntity.ts +15 -10
  44. package/src/index.ts +0 -1
  45. package/dist/index.cjs +0 -13017
  46. package/dist/index.cjs.map +0 -1
@@ -0,0 +1,7 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+ export declare class CreateMnemonics1659567079429 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
7
+ //# sourceMappingURL=1-CreateMnemonics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1-CreateMnemonics.d.ts","sourceRoot":"","sources":["../../../src/migrations/generic/1-CreateMnemonics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAOzD,qBAAa,4BAA6B,YAAW,kBAAkB;IACrE,IAAI,SAAiC;IAExB,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAqB3D"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.CreateMnemonics1659567079429 = void 0;
16
+ const debug_1 = __importDefault(require("debug"));
17
+ const _1659566636105_CreateMnemonics_1 = require("../postgres/1659566636105-CreateMnemonics");
18
+ const _1659566622817_CreateMnemonics_1 = require("../sqlite/1659566622817-CreateMnemonics");
19
+ const debug = (0, debug_1.default)('sphereon:ssi-sdk:migrations');
20
+ class CreateMnemonics1659567079429 {
21
+ constructor() {
22
+ this.name = 'CreateMnemonics1659567079429';
23
+ }
24
+ up(queryRunner) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ debug('migration: creating mnemonic tables');
27
+ const dbType = queryRunner.connection.driver.options.type;
28
+ if (dbType === 'postgres') {
29
+ debug('using postgres migration file');
30
+ const mig = new _1659566636105_CreateMnemonics_1.CreateMnemonics1659566636105();
31
+ const up = yield mig.up(queryRunner);
32
+ debug('Migration statements executed');
33
+ return up;
34
+ }
35
+ else if (dbType === 'sqlite' || 'react-native') {
36
+ debug('using sqlite/react-native migration file');
37
+ const mig = new _1659566622817_CreateMnemonics_1.CreateMnemonics1659566622817();
38
+ const up = yield mig.up(queryRunner);
39
+ debug('Migration statements executed');
40
+ return up;
41
+ }
42
+ else {
43
+ return Promise.reject("Migrations are currently only supported for sqlite, react-native and postgres. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now");
44
+ }
45
+ });
46
+ }
47
+ down(queryRunner) {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ debug('reverting mnemonic tables');
50
+ const dbType = queryRunner.connection.driver.options.type;
51
+ if (dbType === 'postgres') {
52
+ debug('using postgres migration file');
53
+ const mig = new _1659566636105_CreateMnemonics_1.CreateMnemonics1659566636105();
54
+ const down = yield mig.down(queryRunner);
55
+ debug('Migration statements executed');
56
+ return down;
57
+ }
58
+ else if (dbType === 'sqlite' || 'react-native') {
59
+ debug('using sqlite/react-native migration file');
60
+ const mig = new _1659566622817_CreateMnemonics_1.CreateMnemonics1659566622817();
61
+ const down = yield mig.down(queryRunner);
62
+ debug('Migration statements executed');
63
+ return down;
64
+ }
65
+ else {
66
+ return Promise.reject("Migrations are currently only supported for sqlite, react-native and postgres. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now");
67
+ }
68
+ });
69
+ }
70
+ }
71
+ exports.CreateMnemonics1659567079429 = CreateMnemonics1659567079429;
72
+ //# sourceMappingURL=1-CreateMnemonics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1-CreateMnemonics.js","sourceRoot":"","sources":["../../../src/migrations/generic/1-CreateMnemonics.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,kDAAyB;AACzB,8FAAwF;AACxF,4FAAsF;AAEtF,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,6BAA6B,CAAC,CAAA;AAElD,MAAa,4BAA4B;IAAzC;QACE,SAAI,GAAG,8BAA8B,CAAA;IA6CvC,CAAC;IA3Cc,EAAE,CAAC,WAAwB;;YACtC,KAAK,CAAC,qCAAqC,CAAC,CAAA;YAC5C,MAAM,MAAM,GAAG,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAA;YACzD,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;gBAC1B,KAAK,CAAC,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M,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;gBACxC,KAAK,CAAC,+BAA+B,CAAC,CAAA;gBACtC,OAAO,IAAI,CAAA;YACb,CAAC;iBAAM,CAAC;gBACN,OAAO,OAAO,CAAC,MAAM,CACnB,4LAA4L,CAC7L,CAAA;YACH,CAAC;QACH,CAAC;KAAA;CACF;AA9CD,oEA8CC"}
@@ -0,0 +1,10 @@
1
+ import { CreateMnemonics1659567079429 } from './1-CreateMnemonics';
2
+ /**
3
+ * The migrations array that SHOULD be used when initializing a TypeORM database connection.
4
+ *
5
+ * These ensure the correct creation of tables and the proper migrations of data when tables change between versions.
6
+ *
7
+ * @internal
8
+ */
9
+ export declare const MnemonicSeedManagerMigrations: (typeof CreateMnemonics1659567079429)[];
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/generic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AAElE;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,yCAAiC,CAAA"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MnemonicSeedManagerMigrations = void 0;
4
+ const _1_CreateMnemonics_1 = require("./1-CreateMnemonics");
5
+ /**
6
+ * The migrations array that SHOULD be used when initializing a TypeORM database connection.
7
+ *
8
+ * These ensure the correct creation of tables and the proper migrations of data when tables change between versions.
9
+ *
10
+ * @internal
11
+ */
12
+ exports.MnemonicSeedManagerMigrations = [_1_CreateMnemonics_1.CreateMnemonics1659567079429];
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/migrations/generic/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkE;AAElE;;;;;;GAMG;AACU,QAAA,6BAA6B,GAAG,CAAC,iDAA4B,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { MnemonicSeedManagerMigrations } from './generic';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAA"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MnemonicSeedManagerMigrations = void 0;
4
+ var generic_1 = require("./generic");
5
+ Object.defineProperty(exports, "MnemonicSeedManagerMigrations", { enumerable: true, get: function () { return generic_1.MnemonicSeedManagerMigrations; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":";;;AAAA,qCAAyD;AAAhD,wHAAA,6BAA6B,OAAA"}
@@ -0,0 +1,7 @@
1
+ import { ConnectionOptions } from 'typeorm';
2
+ /**
3
+ * Do Not use these connections in production!. They are only here to create/test migration files!
4
+ */
5
+ declare const _default: ConnectionOptions[];
6
+ export default _default;
7
+ //# sourceMappingURL=internal-migrations-ormconfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-migrations-ormconfig.d.ts","sourceRoot":"","sources":["../../src/migrations/internal-migrations-ormconfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAG3C;;GAEG;wBAsBE,iBAAiB,EAAE;AArBxB,wBAqBwB"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const index_1 = require("../index");
4
+ /**
5
+ * Do Not use these connections in production!. They are only here to create/test migration files!
6
+ */
7
+ exports.default = [
8
+ {
9
+ type: 'sqlite',
10
+ name: 'migration-sqlite',
11
+ database: 'migration.sqlite',
12
+ migrationsRun: false,
13
+ synchronize: false,
14
+ logging: ['error', 'info', 'warn', 'log'],
15
+ entities: [...index_1.MnemonicSeedManagerEntities],
16
+ migrations: [...index_1.MnemonicSeedManagerMigrations],
17
+ },
18
+ {
19
+ type: 'postgres',
20
+ name: 'migration-postgres',
21
+ database: 'migration-postgres',
22
+ migrationsRun: false,
23
+ synchronize: false,
24
+ logging: ['error', 'info', 'warn', 'log'],
25
+ entities: [...index_1.MnemonicSeedManagerEntities],
26
+ migrations: [...index_1.MnemonicSeedManagerMigrations],
27
+ },
28
+ ];
29
+ //# sourceMappingURL=internal-migrations-ormconfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-migrations-ormconfig.js","sourceRoot":"","sources":["../../src/migrations/internal-migrations-ormconfig.ts"],"names":[],"mappings":";;AACA,oCAAqF;AAErF;;GAEG;AACH,kBAAe;IACb;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,kBAAkB;QACxB,QAAQ,EAAE,kBAAkB;QAC5B,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;QACzC,QAAQ,EAAE,CAAC,GAAG,mCAA2B,CAAC;QAC1C,UAAU,EAAE,CAAC,GAAG,qCAA6B,CAAC;KAC/C;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,oBAAoB;QAC1B,QAAQ,EAAE,oBAAoB;QAC9B,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;QACzC,QAAQ,EAAE,CAAC,GAAG,mCAA2B,CAAC;QAC1C,UAAU,EAAE,CAAC,GAAG,qCAA6B,CAAC;KAC/C;CACqB,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+ export declare class CreateMnemonics1659566636105 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
7
+ //# sourceMappingURL=1659566636105-CreateMnemonics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1659566636105-CreateMnemonics.d.ts","sourceRoot":"","sources":["../../../src/migrations/postgres/1659566636105-CreateMnemonics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEzD,qBAAa,4BAA6B,YAAW,kBAAkB;IACrE,IAAI,SAAiC;IAExB,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAM3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3D"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CreateMnemonics1659566636105 = void 0;
13
+ class CreateMnemonics1659566636105 {
14
+ constructor() {
15
+ this.name = 'CreateMnemonics1659566636105';
16
+ }
17
+ up(queryRunner) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield queryRunner.query(`CREATE TABLE "Mnemonic" ("id" character varying NOT NULL, "hash" character varying NOT NULL, "mnemonic" character varying NOT NULL, "master_key" character varying, "chain_code" character varying, CONSTRAINT "UQ_hash" UNIQUE ("hash"), CONSTRAINT "UQ_mnemonic" UNIQUE ("mnemonic"), CONSTRAINT "PK_mnemonic_id" PRIMARY KEY ("id"))`);
20
+ });
21
+ }
22
+ down(queryRunner) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ yield queryRunner.query(`DROP TABLE "Mnemonic"`);
25
+ });
26
+ }
27
+ }
28
+ exports.CreateMnemonics1659566636105 = CreateMnemonics1659566636105;
29
+ //# sourceMappingURL=1659566636105-CreateMnemonics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1659566636105-CreateMnemonics.js","sourceRoot":"","sources":["../../../src/migrations/postgres/1659566636105-CreateMnemonics.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,4BAA4B;IAAzC;QACE,SAAI,GAAG,8BAA8B,CAAA;IAWvC,CAAC;IATc,EAAE,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CACrB,yUAAyU,CAC1U,CAAA;QACH,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACxC,MAAM,WAAW,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;QAClD,CAAC;KAAA;CACF;AAZD,oEAYC"}
@@ -0,0 +1,7 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+ export declare class CreateMnemonics1659566622817 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
7
+ //# sourceMappingURL=1659566622817-CreateMnemonics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1659566622817-CreateMnemonics.d.ts","sourceRoot":"","sources":["../../../src/migrations/sqlite/1659566622817-CreateMnemonics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEzD,qBAAa,4BAA6B,YAAW,kBAAkB;IACrE,IAAI,SAAiC;IAExB,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAM3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3D"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CreateMnemonics1659566622817 = void 0;
13
+ class CreateMnemonics1659566622817 {
14
+ constructor() {
15
+ this.name = 'CreateMnemonics1659566622817';
16
+ }
17
+ up(queryRunner) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield queryRunner.query(`CREATE TABLE "Mnemonic" ("id" varchar PRIMARY KEY NOT NULL, "hash" varchar NOT NULL, "mnemonic" varchar NOT NULL, "master_key" varchar, "chain_code" varchar, CONSTRAINT "UQ_hash" UNIQUE ("hash"), CONSTRAINT "UQ_mnemonic" UNIQUE ("mnemonic"))`);
20
+ });
21
+ }
22
+ down(queryRunner) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ yield queryRunner.query(`DROP TABLE "Mnemonic"`);
25
+ });
26
+ }
27
+ }
28
+ exports.CreateMnemonics1659566622817 = CreateMnemonics1659566622817;
29
+ //# sourceMappingURL=1659566622817-CreateMnemonics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1659566622817-CreateMnemonics.js","sourceRoot":"","sources":["../../../src/migrations/sqlite/1659566622817-CreateMnemonics.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,4BAA4B;IAAzC;QACE,SAAI,GAAG,8BAA8B,CAAA;IAWvC,CAAC;IATc,EAAE,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CACrB,mPAAmP,CACpP,CAAA;QACH,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACxC,MAAM,WAAW,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;QAClD,CAAC;KAAA;CACF;AAZD,oEAYC"}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.52.3"
8
+ "packageVersion": "7.52.5"
9
9
  }
10
10
  ]
11
11
  }
@@ -1,20 +1,8 @@
1
- import { BaseEntity, DataSource, MigrationInterface, QueryRunner } from 'typeorm';
2
- import { IPluginMethodMap, IAgentContext, IKeyManager, IDataStore, ManagedKeyInfo, IAgentPlugin } from '@veramo/core';
3
- import { AbstractSecretBox } from '@veramo/key-manager';
4
- import { OrPromise } from '@veramo/utils';
5
-
6
- declare class MnemonicEntity extends BaseEntity {
7
- id: string;
8
- hash: string;
9
- mnemonic: string;
10
- masterKey: string;
11
- chainCode: string;
12
- }
13
-
1
+ import { IAgentContext, IDataStore, IKeyManager, IPluginMethodMap, ManagedKeyInfo } from '@veramo/core';
14
2
  /**
15
3
  * @public
16
4
  */
17
- interface IMnemonicSeedManager extends IPluginMethodMap {
5
+ export interface IMnemonicSeedManager extends IPluginMethodMap {
18
6
  generateMnemonic(args: IMnemonicGeneratorArgs): Promise<IMnemonicInfoResult>;
19
7
  verifyMnemonic(args: IMnemonicVerificationArgs): Promise<IMnemonicInfoResult>;
20
8
  verifyPartialMnemonic(args: IPartialMnemonicVerificationArgs): Promise<IMnemonicInfoResult>;
@@ -31,7 +19,7 @@ interface IMnemonicSeedManager extends IPluginMethodMap {
31
19
  * @param persist - Whether the mnemonic should be persisted into the database
32
20
  * @public
33
21
  */
34
- interface IMnemonicGeneratorArgs {
22
+ export interface IMnemonicGeneratorArgs {
35
23
  bits: 128 | 160 | 192 | 224 | 256;
36
24
  id?: string;
37
25
  persist?: boolean;
@@ -43,7 +31,7 @@ interface IMnemonicGeneratorArgs {
43
31
  *
44
32
  * @public
45
33
  */
46
- interface IMnemonicVerificationArgs {
34
+ export interface IMnemonicVerificationArgs {
47
35
  id?: string;
48
36
  hash?: string;
49
37
  wordList: string[];
@@ -56,7 +44,7 @@ interface IMnemonicVerificationArgs {
56
44
  * It must be in the same order as in the mnemonic.
57
45
  * @public
58
46
  */
59
- interface IPartialMnemonicVerificationArgs {
47
+ export interface IPartialMnemonicVerificationArgs {
60
48
  id?: string;
61
49
  hash?: string;
62
50
  indexedWordList: [number, string][];
@@ -65,7 +53,7 @@ interface IPartialMnemonicVerificationArgs {
65
53
  * @param mnemonic - Array representation of the mnemonic string
66
54
  * @public
67
55
  */
68
- interface ISeedGeneratorArgs {
56
+ export interface ISeedGeneratorArgs {
69
57
  mnemonic: string[];
70
58
  }
71
59
  /**
@@ -81,7 +69,7 @@ interface ISeedGeneratorArgs {
81
69
  * @param persist - Whether the information should be persisted
82
70
  * @public
83
71
  */
84
- interface IMnemonicInfoStoreArgs {
72
+ export interface IMnemonicInfoStoreArgs {
85
73
  id?: string;
86
74
  hash?: string;
87
75
  mnemonic?: string[];
@@ -96,85 +84,38 @@ interface IMnemonicInfoStoreArgs {
96
84
  /**
97
85
  * @public
98
86
  */
99
- interface IMnemonicInfoKeyResult {
87
+ export interface IMnemonicInfoKeyResult {
100
88
  masterKey?: string;
101
89
  chainCode?: string;
102
90
  }
103
91
  /**
104
92
  * @public
105
93
  */
106
- interface DeleteResult {
94
+ export interface DeleteResult {
107
95
  raw: unknown;
108
96
  affected?: number | null;
109
97
  }
110
98
  /**
111
99
  * @public
112
100
  */
113
- interface UpdateResult extends DeleteResult {
101
+ export interface UpdateResult extends DeleteResult {
114
102
  generatedMaps: ObjectLiteral;
115
103
  }
116
104
  /**
117
105
  * @public
118
106
  */
119
- interface ObjectLiteral {
107
+ export interface ObjectLiteral {
120
108
  [key: string]: any;
121
109
  }
122
110
  /**
123
111
  * @public
124
112
  */
125
- interface IMnemonicInfoResult extends IMnemonicInfoStoreArgs {
113
+ export interface IMnemonicInfoResult extends IMnemonicInfoStoreArgs {
126
114
  succeeded?: boolean;
127
115
  seed?: string;
128
116
  }
129
117
  /**
130
118
  * @public
131
119
  */
132
- type IRequiredContext = IAgentContext<IKeyManager & IDataStore>;
133
-
134
- /**
135
- * @public
136
- */
137
- declare class MnemonicSeedManager implements IAgentPlugin {
138
- private dbConnection;
139
- private secretBox?;
140
- readonly schema: any;
141
- readonly methods: IMnemonicSeedManager;
142
- constructor(dbConnection: OrPromise<DataSource>, secretBox?: AbstractSecretBox | undefined);
143
- private generateMnemonic;
144
- private verifyMnemonic;
145
- private verifyPartialMnemonic;
146
- private generateSeed;
147
- private saveMnemonicInfo;
148
- private getMnemonicInfo;
149
- private deleteMnemonicInfo;
150
- private saveMasterKey;
151
- private generateMasterKey;
152
- private generateKeysFromMnemonic;
153
- }
154
-
155
- declare class CreateMnemonics1659567079429 implements MigrationInterface {
156
- name: string;
157
- up(queryRunner: QueryRunner): Promise<void>;
158
- down(queryRunner: QueryRunner): Promise<void>;
159
- }
160
-
161
- /**
162
- * The migrations array that SHOULD be used when initializing a TypeORM database connection.
163
- *
164
- * These ensure the correct creation of tables and the proper migrations of data when tables change between versions.
165
- *
166
- * @internal
167
- */
168
- declare const MnemonicSeedManagerMigrations: (typeof CreateMnemonics1659567079429)[];
169
-
170
- /**
171
- * @internal
172
- */
173
- declare const schema: any;
174
-
175
- /**
176
- * @internal
177
- */
178
- declare const MnemonicSeedManagerEntities: (typeof MnemonicEntity)[];
179
-
180
- export { type DeleteResult, type IMnemonicGeneratorArgs, type IMnemonicInfoKeyResult, type IMnemonicInfoResult, type IMnemonicInfoStoreArgs, type IMnemonicSeedManager, type IMnemonicVerificationArgs, type IPartialMnemonicVerificationArgs, type IRequiredContext, type ISeedGeneratorArgs, MnemonicSeedManager, MnemonicSeedManagerEntities, MnemonicSeedManagerMigrations, type ObjectLiteral, type UpdateResult, schema };
120
+ export type IRequiredContext = IAgentContext<IKeyManager & IDataStore>;
121
+ //# sourceMappingURL=IMnemonicSeedManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IMnemonicSeedManager.d.ts","sourceRoot":"","sources":["../../src/types/IMnemonicSeedManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAEvG;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D,gBAAgB,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAE5E,cAAc,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAE7E,qBAAqB,CAAC,IAAI,EAAE,gCAAgC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAE3F,YAAY,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAEpE,gBAAgB,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAE5E,eAAe,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAE3E,kBAAkB,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;IAEvE,iBAAiB,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;IAEhF,wBAAwB,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;CAC3G;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,GAAG,GAAG,GAAG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AAW,YAAa,SAAQ,YAAY;IAChD,aAAa,EAAE,aAAa,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,sBAAsB;IACjE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC,WAAW,GAAG,UAAU,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IMnemonicSeedManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IMnemonicSeedManager.js","sourceRoot":"","sources":["../../src/types/IMnemonicSeedManager.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,28 +1,17 @@
1
1
  {
2
2
  "name": "@sphereon/ssi-sdk-ext.mnemonic-seed-manager",
3
- "version": "0.28.1-feature.esm.cjs.9+71682ea",
4
- "source": "./src/index.ts",
5
- "type": "module",
6
- "main": "./dist/index.cjs",
7
- "module": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
9
- "exports": {
10
- "import": {
11
- "types": "./dist/index.d.ts",
12
- "import": "./dist/index.js"
13
- },
14
- "require": {
15
- "types": "./dist/index.d.cts",
16
- "require": "./dist/index.cjs"
17
- }
18
- },
3
+ "version": "0.28.1-feature.oyd.cmsm.improv.16+a254c6d",
4
+ "source": "src/index.ts",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
19
7
  "veramo": {
20
8
  "pluginInterfaces": {
21
9
  "IMnemonicSeedManager": "./src/types/IMnemonicSeedManager.ts"
22
10
  }
23
11
  },
24
12
  "scripts": {
25
- "build": "tsup --config ../../tsup.config.ts --tsconfig ../../tsconfig.tsup.json && sphereon dev generate-plugin-schema",
13
+ "build": "tsc --build",
14
+ "build:clean": "tsc --build --clean && tsc --build",
26
15
  "generate-plugin-schema": "sphereon dev generate-plugin-schema",
27
16
  "typeorm": "ts-node --project ./tsconfig.json -r tsconfig-paths/register ../../node_modules/typeorm/cli.js --config src/migrations/internal-migrations-ormconfig.ts",
28
17
  "typeorm-sqlite:migration:generate": "npm run typeorm -- migration:generate -c migration-sqlite -d src/migrations/sqlite -n",
@@ -32,7 +21,7 @@
32
21
  },
33
22
  "dependencies": {
34
23
  "@noble/hashes": "^1.6.1",
35
- "@sphereon/ssi-sdk-ext.key-utils": "^0.28.1-feature.esm.cjs.9+71682ea",
24
+ "@sphereon/ssi-sdk-ext.key-utils": "0.28.1-feature.oyd.cmsm.improv.16+a254c6d",
36
25
  "@veramo/core": "4.2.0",
37
26
  "@veramo/data-store": "4.2.0",
38
27
  "@veramo/key-manager": "4.2.0",
@@ -40,22 +29,19 @@
40
29
  "@veramo/utils": "4.2.0",
41
30
  "bip39": "^3.1.0",
42
31
  "debug": "^4.3.4",
43
- "reflect-metadata": "^0.2.2",
44
- "typeorm": "0.3.22"
32
+ "typeorm": "0.3.20"
45
33
  },
46
34
  "devDependencies": {
47
- "@sphereon/ssi-sdk.dev": " ^0.33",
35
+ "@sphereon/ssi-sdk.dev": "0.30.2-feature.SDK.41.oidf.support.286",
48
36
  "@types/bip39": "^3.0.0",
49
- "@types/node": "^20.17.1",
50
37
  "@veramo/cli": "4.2.0",
51
38
  "@veramo/remote-client": "4.2.0",
52
39
  "@veramo/remote-server": "4.2.0",
53
- "ed25519-hd-key": "^1.3.0",
54
- "express": "^4.21.2"
40
+ "ed25519-hd-key": "^1.3.0"
55
41
  },
56
42
  "files": [
57
- "dist",
58
- "src",
43
+ "dist/**/*",
44
+ "src/**/*",
59
45
  "plugin.schema.json",
60
46
  "README.md",
61
47
  "LICENSE"
@@ -72,5 +58,5 @@
72
58
  "mnemonic",
73
59
  "seed"
74
60
  ],
75
- "gitHead": "71682ea0c528f5b32c421245c253b3bc9d6296a0"
61
+ "gitHead": "a254c6d44af6fbb12419b55054f1db5afbe484f0"
76
62
  }
@@ -2,14 +2,19 @@ import { Column, Entity, BaseEntity, PrimaryColumn } from 'typeorm'
2
2
 
3
3
  @Entity('Mnemonic')
4
4
  export class MnemonicEntity extends BaseEntity {
5
- @PrimaryColumn({ name: 'id', type: 'varchar' })
6
- id!: string
7
- @Column({ name: 'hash', unique: true, type: 'varchar' })
8
- hash!: string
9
- @Column({ name: 'mnemonic', unique: true, type: 'varchar' })
10
- mnemonic!: string
11
- @Column({ name: 'master_key', default: null, type: 'varchar' })
12
- masterKey!: string
13
- @Column({ name: 'chain_code', default: null, type: 'varchar' })
14
- chainCode!: string
5
+ @PrimaryColumn({ name: 'id' })
6
+ //@ts-ignore
7
+ id: string
8
+ @Column({ name: 'hash', unique: true })
9
+ //@ts-ignore
10
+ hash: string
11
+ @Column({ name: 'mnemonic', unique: true })
12
+ //@ts-ignore
13
+ mnemonic: string
14
+ @Column({ name: 'master_key', default: null })
15
+ //@ts-ignore
16
+ masterKey: string
17
+ @Column({ name: 'chain_code', default: null })
18
+ //@ts-ignore
19
+ chainCode: string
15
20
  }
package/src/index.ts CHANGED
@@ -1,4 +1,3 @@
1
- import 'reflect-metadata'
2
1
  import { MnemonicEntity } from './entities/MnemonicEntity'
3
2
 
4
3
  /**