@sphereon/ssi-sdk.data-store 0.21.1-unstable.5 → 0.21.1

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 (39) hide show
  1. package/dist/entities/contact/PartyTypeEntity.d.ts +1 -2
  2. package/dist/entities/contact/PartyTypeEntity.d.ts.map +1 -1
  3. package/dist/entities/contact/PartyTypeEntity.js +0 -4
  4. package/dist/entities/contact/PartyTypeEntity.js.map +1 -1
  5. package/dist/migrations/generic/index.d.ts.map +1 -1
  6. package/dist/migrations/generic/index.js +1 -2
  7. package/dist/migrations/generic/index.js.map +1 -1
  8. package/dist/types/contact/IAbstractContactStore.d.ts +1 -2
  9. package/dist/types/contact/IAbstractContactStore.d.ts.map +1 -1
  10. package/dist/types/contact/contact.d.ts +0 -5
  11. package/dist/types/contact/contact.d.ts.map +1 -1
  12. package/dist/types/contact/contact.js +1 -6
  13. package/dist/types/contact/contact.js.map +1 -1
  14. package/dist/utils/contact/MappingUtils.d.ts.map +1 -1
  15. package/dist/utils/contact/MappingUtils.js +0 -2
  16. package/dist/utils/contact/MappingUtils.js.map +1 -1
  17. package/package.json +4 -4
  18. package/src/__tests__/contact.entities.test.ts +16 -66
  19. package/src/__tests__/contact.store.test.ts +3 -76
  20. package/src/entities/contact/PartyTypeEntity.ts +1 -4
  21. package/src/migrations/generic/index.ts +1 -2
  22. package/src/types/contact/IAbstractContactStore.ts +0 -2
  23. package/src/types/contact/contact.ts +0 -6
  24. package/src/utils/contact/MappingUtils.ts +0 -2
  25. package/dist/migrations/generic/9-CreateContacts.d.ts +0 -7
  26. package/dist/migrations/generic/9-CreateContacts.d.ts.map +0 -1
  27. package/dist/migrations/generic/9-CreateContacts.js +0 -78
  28. package/dist/migrations/generic/9-CreateContacts.js.map +0 -1
  29. package/dist/migrations/postgres/1710941091795-CreateContacts.d.ts +0 -7
  30. package/dist/migrations/postgres/1710941091795-CreateContacts.d.ts.map +0 -1
  31. package/dist/migrations/postgres/1710941091795-CreateContacts.js +0 -31
  32. package/dist/migrations/postgres/1710941091795-CreateContacts.js.map +0 -1
  33. package/dist/migrations/sqlite/1710941197348-CreateContacts.d.ts +0 -7
  34. package/dist/migrations/sqlite/1710941197348-CreateContacts.d.ts.map +0 -1
  35. package/dist/migrations/sqlite/1710941197348-CreateContacts.js +0 -30
  36. package/dist/migrations/sqlite/1710941197348-CreateContacts.js.map +0 -1
  37. package/src/migrations/generic/9-CreateContacts.ts +0 -66
  38. package/src/migrations/postgres/1710941091795-CreateContacts.ts +0 -15
  39. package/src/migrations/sqlite/1710941197348-CreateContacts.ts +0 -14
@@ -1,78 +0,0 @@
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.CreateContacts1710942112855 = void 0;
16
- const debug_1 = __importDefault(require("debug"));
17
- const _1710941091795_CreateContacts_1 = require("../postgres/1710941091795-CreateContacts");
18
- const _1710941197348_CreateContacts_1 = require("../sqlite/1710941197348-CreateContacts");
19
- const debug = (0, debug_1.default)('sphereon:ssi-sdk:migrations');
20
- class CreateContacts1710942112855 {
21
- constructor() {
22
- this.name = 'CreateContacts1710949828195';
23
- }
24
- up(queryRunner) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- debug('migration: updating contact tables');
27
- const dbType = queryRunner.connection.driver.options.type;
28
- switch (dbType) {
29
- case 'postgres': {
30
- debug('using postgres migration file');
31
- const mig = new _1710941091795_CreateContacts_1.CreateContacts1710941091795();
32
- yield mig.up(queryRunner);
33
- debug('Migration statements executed');
34
- return;
35
- }
36
- case 'sqlite':
37
- case 'expo':
38
- case 'react-native': {
39
- debug('using sqlite/react-native migration file');
40
- const mig = new _1710941197348_CreateContacts_1.CreateContacts1710941197348();
41
- yield mig.up(queryRunner);
42
- debug('Migration statements executed');
43
- return;
44
- }
45
- default:
46
- return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
47
- }
48
- });
49
- }
50
- down(queryRunner) {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- debug('migration: reverting machine state tables');
53
- const dbType = queryRunner.connection.driver.options.type;
54
- switch (dbType) {
55
- case 'postgres': {
56
- debug('using postgres migration file');
57
- const mig = new _1710941091795_CreateContacts_1.CreateContacts1710941091795();
58
- yield mig.down(queryRunner);
59
- debug('Migration statements executed');
60
- return;
61
- }
62
- case 'sqlite':
63
- case 'expo':
64
- case 'react-native': {
65
- debug('using sqlite/react-native migration file');
66
- const mig = new _1710941197348_CreateContacts_1.CreateContacts1710941197348();
67
- yield mig.down(queryRunner);
68
- debug('Migration statements executed');
69
- return;
70
- }
71
- default:
72
- return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
73
- }
74
- });
75
- }
76
- }
77
- exports.CreateContacts1710942112855 = CreateContacts1710942112855;
78
- //# sourceMappingURL=9-CreateContacts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"9-CreateContacts.js","sourceRoot":"","sources":["../../../src/migrations/generic/9-CreateContacts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,kDAAyB;AACzB,4FAAsF;AACtF,0FAAoF;AAEpF,MAAM,KAAK,GAAmB,IAAA,eAAK,E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DAA2B,EAAE,CAAA;oBAC1E,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;oBAC3B,KAAK,CAAC,+BAA+B,CAAC,CAAA;oBACtC,OAAM;gBACR,CAAC;gBACD,KAAK,QAAQ,CAAC;gBACd,KAAK,MAAM,CAAC;gBACZ,KAAK,cAAc,CAAC,CAAC,CAAC;oBACpB,KAAK,CAAC,0CAA0C,CAAC,CAAA;oBACjD,MAAM,GAAG,GAAgC,IAAI,2DAA2B,EAAE,CAAA;oBAC1E,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;oBAC3B,KAAK,CAAC,+BAA+B,CAAC,CAAA;oBACtC,OAAM;gBACR,CAAC;gBACD;oBACE,OAAO,OAAO,CAAC,MAAM,CACnB,4FAA4F,MAAM,+GAA+G,CAClN,CAAA;YACL,CAAC;QACH,CAAC;KAAA;CACF;AA1DD,kEA0DC"}
@@ -1,7 +0,0 @@
1
- import { MigrationInterface, QueryRunner } from 'typeorm';
2
- export declare class CreateContacts1710941091795 implements MigrationInterface {
3
- name: string;
4
- up(queryRunner: QueryRunner): Promise<void>;
5
- down(queryRunner: QueryRunner): Promise<void>;
6
- }
7
- //# sourceMappingURL=1710941091795-CreateContacts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1710941091795-CreateContacts.d.ts","sourceRoot":"","sources":["../../../src/migrations/postgres/1710941091795-CreateContacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEzD,qBAAa,2BAA4B,YAAW,kBAAkB;IACpE,IAAI,SAAgC;IAEvB,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAK3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAI3D"}
@@ -1,31 +0,0 @@
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.CreateContacts1710941091795 = void 0;
13
- class CreateContacts1710941091795 {
14
- constructor() {
15
- this.name = 'CreateContacts1710941091795';
16
- }
17
- up(queryRunner) {
18
- return __awaiter(this, void 0, void 0, function* () {
19
- yield queryRunner.query(`CREATE TYPE "public"."partyOrigin_type_enum" AS ENUM('INTERNAL', 'EXTERNAL')`);
20
- yield queryRunner.query(`ALTER TABLE "PartyType" ADD COLUMN "origin" "public"."partyOrigin_type_enum" NOT NULL`);
21
- });
22
- }
23
- down(queryRunner) {
24
- return __awaiter(this, void 0, void 0, function* () {
25
- // TODO DPP-27 implement downgrade
26
- return Promise.reject(Error(`Downgrade is not yet implemented for ${this.name}`));
27
- });
28
- }
29
- }
30
- exports.CreateContacts1710941091795 = CreateContacts1710941091795;
31
- //# sourceMappingURL=1710941091795-CreateContacts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1710941091795-CreateContacts.js","sourceRoot":"","sources":["../../../src/migrations/postgres/1710941091795-CreateContacts.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,2BAA2B;IAAxC;QACE,SAAI,GAAG,6BAA6B,CAAA;IAWtC,CAAC;IATc,EAAE,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,8EAA8E,CAAC,CAAA;YACvG,MAAM,WAAW,CAAC,KAAK,CAAC,uFAAuF,CAAC,CAAA;QAClH,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACxC,kCAAkC;YAClC,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,wCAAwC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;QACnF,CAAC;KAAA;CACF;AAZD,kEAYC"}
@@ -1,7 +0,0 @@
1
- import { MigrationInterface, QueryRunner } from 'typeorm';
2
- export declare class CreateContacts1710941197348 implements MigrationInterface {
3
- name: string;
4
- up(queryRunner: QueryRunner): Promise<void>;
5
- down(queryRunner: QueryRunner): Promise<void>;
6
- }
7
- //# sourceMappingURL=1710941197348-CreateContacts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1710941197348-CreateContacts.d.ts","sourceRoot":"","sources":["../../../src/migrations/sqlite/1710941197348-CreateContacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEzD,qBAAa,2BAA4B,YAAW,kBAAkB;IACpE,IAAI,SAAgC;IAEvB,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAI3D"}
@@ -1,30 +0,0 @@
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.CreateContacts1710941197348 = void 0;
13
- class CreateContacts1710941197348 {
14
- constructor() {
15
- this.name = 'CreateContacts1710941197348';
16
- }
17
- up(queryRunner) {
18
- return __awaiter(this, void 0, void 0, function* () {
19
- yield queryRunner.query(`ALTER TABLE "PartyType" ADD COLUMN "origin" varchar CHECK( "origin" IN ('internal', 'external') )`);
20
- });
21
- }
22
- down(queryRunner) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- // TODO DPP-27 implement downgrade
25
- return Promise.reject(Error(`Downgrade is not yet implemented for ${this.name}`));
26
- });
27
- }
28
- }
29
- exports.CreateContacts1710941197348 = CreateContacts1710941197348;
30
- //# sourceMappingURL=1710941197348-CreateContacts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1710941197348-CreateContacts.js","sourceRoot":"","sources":["../../../src/migrations/sqlite/1710941197348-CreateContacts.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,2BAA2B;IAAxC;QACE,SAAI,GAAG,6BAA6B,CAAA;IAUtC,CAAC;IARc,EAAE,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,mGAAmG,CAAC,CAAA;QAC9H,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACxC,kCAAkC;YAClC,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,wCAAwC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;QACnF,CAAC;KAAA;CACF;AAXD,kEAWC"}
@@ -1,66 +0,0 @@
1
- import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
2
- import Debug from 'debug'
3
- import { CreateContacts1710941091795 } from '../postgres/1710941091795-CreateContacts'
4
- import { CreateContacts1710941197348 } from '../sqlite/1710941197348-CreateContacts'
5
-
6
- const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:migrations')
7
-
8
- export class CreateContacts1710942112855 implements MigrationInterface {
9
- name = 'CreateContacts1710949828195'
10
-
11
- public async up(queryRunner: QueryRunner): Promise<void> {
12
- debug('migration: updating contact tables')
13
- const dbType: DatabaseType = queryRunner.connection.driver.options.type
14
-
15
- switch (dbType) {
16
- case 'postgres': {
17
- debug('using postgres migration file')
18
- const mig: CreateContacts1710941091795 = new CreateContacts1710941091795()
19
- await mig.up(queryRunner)
20
- debug('Migration statements executed')
21
- return
22
- }
23
- case 'sqlite':
24
- case 'expo':
25
- case 'react-native': {
26
- debug('using sqlite/react-native migration file')
27
- const mig: CreateContacts1710941197348 = new CreateContacts1710941197348()
28
- await mig.up(queryRunner)
29
- debug('Migration statements executed')
30
- return
31
- }
32
- default:
33
- return Promise.reject(
34
- `Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`
35
- )
36
- }
37
- }
38
-
39
- public async down(queryRunner: QueryRunner): Promise<void> {
40
- debug('migration: reverting machine state tables')
41
- const dbType: DatabaseType = queryRunner.connection.driver.options.type
42
-
43
- switch (dbType) {
44
- case 'postgres': {
45
- debug('using postgres migration file')
46
- const mig: CreateContacts1710941091795 = new CreateContacts1710941091795()
47
- await mig.down(queryRunner)
48
- debug('Migration statements executed')
49
- return
50
- }
51
- case 'sqlite':
52
- case 'expo':
53
- case 'react-native': {
54
- debug('using sqlite/react-native migration file')
55
- const mig: CreateContacts1710941197348 = new CreateContacts1710941197348()
56
- await mig.down(queryRunner)
57
- debug('Migration statements executed')
58
- return
59
- }
60
- default:
61
- return Promise.reject(
62
- `Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`
63
- )
64
- }
65
- }
66
- }
@@ -1,15 +0,0 @@
1
- import { MigrationInterface, QueryRunner } from 'typeorm'
2
-
3
- export class CreateContacts1710941091795 implements MigrationInterface {
4
- name = 'CreateContacts1710941091795'
5
-
6
- public async up(queryRunner: QueryRunner): Promise<void> {
7
- await queryRunner.query(`CREATE TYPE "public"."partyOrigin_type_enum" AS ENUM('INTERNAL', 'EXTERNAL')`)
8
- await queryRunner.query(`ALTER TABLE "PartyType" ADD COLUMN "origin" "public"."partyOrigin_type_enum" NOT NULL`)
9
- }
10
-
11
- public async down(queryRunner: QueryRunner): Promise<void> {
12
- // TODO DPP-27 implement downgrade
13
- return Promise.reject(Error(`Downgrade is not yet implemented for ${this.name}`))
14
- }
15
- }
@@ -1,14 +0,0 @@
1
- import { MigrationInterface, QueryRunner } from 'typeorm'
2
-
3
- export class CreateContacts1710941197348 implements MigrationInterface {
4
- name = 'CreateContacts1710941197348'
5
-
6
- public async up(queryRunner: QueryRunner): Promise<void> {
7
- await queryRunner.query(`ALTER TABLE "PartyType" ADD COLUMN "origin" varchar CHECK( "origin" IN ('internal', 'external') )`)
8
- }
9
-
10
- public async down(queryRunner: QueryRunner): Promise<void> {
11
- // TODO DPP-27 implement downgrade
12
- return Promise.reject(Error(`Downgrade is not yet implemented for ${this.name}`))
13
- }
14
- }