@sphereon/ssi-sdk.data-store 0.23.5-unstable.18 → 0.23.5-unstable.19
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/dist/entities/contact/PartyTypeEntity.js +1 -1
- package/dist/migrations/postgres/1690925872592-CreateContacts.js +4 -4
- package/dist/migrations/sqlite/1690925872693-CreateContacts.js +3 -3
- package/dist/types/contact/contact.d.ts +2 -2
- package/dist/types/contact/contact.js +2 -2
- package/package.json +4 -4
- package/src/entities/contact/PartyTypeEntity.ts +1 -1
- package/src/migrations/postgres/1690925872592-CreateContacts.ts +4 -4
- package/src/migrations/sqlite/1690925872693-CreateContacts.ts +3 -3
- package/src/types/contact/contact.ts +2 -2
|
@@ -53,7 +53,7 @@ __decorate([
|
|
|
53
53
|
__metadata("design:type", String)
|
|
54
54
|
], PartyTypeEntity.prototype, "type", void 0);
|
|
55
55
|
__decorate([
|
|
56
|
-
(0, typeorm_1.Column)('simple-enum', { name: 'origin', enum: types_1.PartyOrigin, default: '
|
|
56
|
+
(0, typeorm_1.Column)('simple-enum', { name: 'origin', enum: types_1.PartyOrigin, default: 'EXTERNAL', nullable: false, unique: false }),
|
|
57
57
|
__metadata("design:type", String)
|
|
58
58
|
], PartyTypeEntity.prototype, "origin", void 0);
|
|
59
59
|
__decorate([
|
|
@@ -25,8 +25,8 @@ class CreateContacts1690925872592 {
|
|
|
25
25
|
yield queryRunner.query(`ALTER TABLE "CorrelationIdentifier" RENAME COLUMN "identityId" TO "identity_id"`);
|
|
26
26
|
yield queryRunner.query(`ALTER TABLE "Connection" RENAME COLUMN "identityId" TO "identity_id"`);
|
|
27
27
|
yield queryRunner.query(`CREATE TYPE "public"."PartyType_type_enum" AS ENUM('naturalPerson', 'organization')`);
|
|
28
|
-
yield queryRunner.query(`CREATE TYPE "public"."PartyOrigin_type_enum" AS ENUM('
|
|
29
|
-
yield queryRunner.query(`CREATE TABLE "PartyType" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "type" "public"."PartyType_type_enum" NOT NULL, "origin" "public"."PartyOrigin_type_enum" NOT NULL DEFAULT '
|
|
28
|
+
yield queryRunner.query(`CREATE TYPE "public"."PartyOrigin_type_enum" AS ENUM('INTERNAL', 'EXTERNAL')`);
|
|
29
|
+
yield queryRunner.query(`CREATE TABLE "PartyType" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "type" "public"."PartyType_type_enum" NOT NULL, "origin" "public"."PartyOrigin_type_enum" NOT NULL DEFAULT 'EXTERNAL', "name" character varying(255) NOT NULL, "description" character varying(255), "tenant_id" character varying(255) NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "UQ_PartyType_name" UNIQUE ("name"), CONSTRAINT "PK_PartyType_id" PRIMARY KEY ("id"))`);
|
|
30
30
|
yield queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyType_type_tenant_id" ON "PartyType" ("type", "tenant_id")`);
|
|
31
31
|
yield queryRunner.query(`CREATE TABLE "BaseContact" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), "legal_name" character varying(255), "display_name" character varying(255), "first_name" character varying(255), "middle_name" character varying(255), "last_name" character varying(255), "type" character varying NOT NULL, "party_id" uuid, CONSTRAINT "UQ_BaseContact_legal_name" UNIQUE ("legal_name"), CONSTRAINT "REL_BaseContact_party_id" UNIQUE ("party_id"), CONSTRAINT "PK_BaseContact_id" PRIMARY KEY ("id"))`);
|
|
32
32
|
yield queryRunner.query(`CREATE INDEX "IDX_BaseContact_type" ON "BaseContact" ("type")`);
|
|
@@ -55,8 +55,8 @@ class CreateContacts1690925872592 {
|
|
|
55
55
|
yield queryRunner.query(`ALTER TABLE "Identity" RENAME CONSTRAINT "UQ_Identity_Alias" TO "UQ_Identity_alias"`);
|
|
56
56
|
yield queryRunner.query(`INSERT INTO "BaseConfig"("id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connection_id") SELECT "id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connectionId" FROM "BaseConfigEntity"`);
|
|
57
57
|
yield queryRunner.query(`DROP TABLE "BaseConfigEntity"`);
|
|
58
|
-
yield queryRunner.query(`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('3875c12e-fdaa-4ef6-a340-c936e054b627', 'organization', '
|
|
59
|
-
yield queryRunner.query(`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('7d248798-41ca-4fc1-a130-9934b43d532e', 'naturalPerson', '
|
|
58
|
+
yield queryRunner.query(`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('3875c12e-fdaa-4ef6-a340-c936e054b627', 'organization', 'INTERNAL' 'Sphereon_default_organization_type', 'sphereon_default_organization', '95e09cfc-c974-4174-86aa-7bf1d5251fb4', now(), now())`);
|
|
59
|
+
yield queryRunner.query(`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('7d248798-41ca-4fc1-a130-9934b43d532e', 'naturalPerson', 'INTERNAL', 'Sphereon_default_natural_person_type', 'sphereon_default_natural_person', '95e09cfc-c974-4174-86aa-7bf1d5251fb4', now(), now())`);
|
|
60
60
|
yield queryRunner.query(`INSERT INTO "Party"(id, uri, created_at, last_updated_at, party_type_id) SELECT id, uri, created_at, last_updated_at, '3875c12e-fdaa-4ef6-a340-c936e054b627' FROM "Contact"`);
|
|
61
61
|
yield queryRunner.query(`INSERT INTO "BaseContact"(id, legal_name, display_name, party_id, created_at, last_updated_at, type) SELECT id, name, alias, id, created_at, last_updated_at, 'Organization' FROM "Contact"`);
|
|
62
62
|
yield queryRunner.query(`DROP TABLE "Contact"`);
|
|
@@ -40,7 +40,7 @@ class CreateContacts1690925872693 {
|
|
|
40
40
|
yield queryRunner.query(`INSERT INTO "temporary_Connection"("id", "type", "identity_id") SELECT "id", "type", "identityId" FROM "Connection"`);
|
|
41
41
|
yield queryRunner.query(`DROP TABLE "Connection"`);
|
|
42
42
|
yield queryRunner.query(`ALTER TABLE "temporary_Connection" RENAME TO "Connection"`);
|
|
43
|
-
yield queryRunner.query(`CREATE TABLE "PartyType" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('naturalPerson','organization') ) NOT NULL, "origin" varchar CHECK( "origin" IN ('
|
|
43
|
+
yield queryRunner.query(`CREATE TABLE "PartyType" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('naturalPerson','organization') ) NOT NULL, "origin" varchar CHECK( "origin" IN ('INTERNAL', 'EXTERNAL') ) NOT NULL DEFAULT 'EXTERNAL', "name" varchar(255) NOT NULL, "description" varchar(255), "tenant_id" varchar(255) NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "UQ_PartyType_name" UNIQUE ("name"))`);
|
|
44
44
|
yield queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyType_type_tenant_id" ON "PartyType" ("type", "tenant_id")`);
|
|
45
45
|
yield queryRunner.query(`CREATE TABLE "BaseContact" ("id" varchar PRIMARY KEY NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "legal_name" varchar(255), "display_name" varchar(255), "first_name" varchar(255), "middle_name" varchar(255), "last_name" varchar(255), "type" varchar NOT NULL, "party_id" varchar, CONSTRAINT "UQ_BaseContact_legal_name" UNIQUE ("legal_name"), CONSTRAINT "REL_BaseContact_party_id" UNIQUE ("party_id"))`);
|
|
46
46
|
yield queryRunner.query(`CREATE INDEX "IDX_BaseContact_type" ON "BaseContact" ("type")`);
|
|
@@ -88,8 +88,8 @@ class CreateContacts1690925872693 {
|
|
|
88
88
|
// migrate existing data
|
|
89
89
|
yield queryRunner.query(`INSERT INTO "BaseConfig"("id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connection_id") SELECT "id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connectionId" FROM "BaseConfigEntity"`);
|
|
90
90
|
yield queryRunner.query(`DROP TABLE "BaseConfigEntity"`);
|
|
91
|
-
yield queryRunner.query(`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('3875c12e-fdaa-4ef6-a340-c936e054b627', 'organization', '
|
|
92
|
-
yield queryRunner.query(`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('7d248798-41ca-4fc1-a130-9934b43d532e', 'naturalPerson', '
|
|
91
|
+
yield queryRunner.query(`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('3875c12e-fdaa-4ef6-a340-c936e054b627', 'organization', 'INTERNAL', 'Sphereon_default_organization_type', 'sphereon_default_organization', '95e09cfc-c974-4174-86aa-7bf1d5251fb4', datetime('now'), datetime('now'))`);
|
|
92
|
+
yield queryRunner.query(`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('7d248798-41ca-4fc1-a130-9934b43d532e', 'naturalPerson', 'INTERNAL', 'Sphereon_default_natural_person_type', 'sphereon_default_natural_person', '95e09cfc-c974-4174-86aa-7bf1d5251fb4', datetime('now'), datetime('now'))`);
|
|
93
93
|
yield queryRunner.query(`INSERT INTO "Party"(id, uri, created_at, last_updated_at, party_type_id) SELECT id, uri, created_at, last_updated_at, '3875c12e-fdaa-4ef6-a340-c936e054b627' FROM "Contact"`);
|
|
94
94
|
yield queryRunner.query(`INSERT INTO "BaseContact"(id, legal_name, display_name, party_id, created_at, last_updated_at, type) SELECT id, name, alias, id, created_at, last_updated_at, 'Organization' FROM "Contact"`);
|
|
95
95
|
yield queryRunner.query(`DROP TABLE "Contact"`);
|
|
@@ -196,7 +196,7 @@ export declare enum PartyTypeType {
|
|
|
196
196
|
ORGANIZATION = "organization"
|
|
197
197
|
}
|
|
198
198
|
export declare enum PartyOrigin {
|
|
199
|
-
INTERNAL = "
|
|
200
|
-
EXTERNAL = "
|
|
199
|
+
INTERNAL = "INTERNAL",
|
|
200
|
+
EXTERNAL = "EXTERNAL"
|
|
201
201
|
}
|
|
202
202
|
//# sourceMappingURL=contact.d.ts.map
|
|
@@ -25,7 +25,7 @@ var PartyTypeType;
|
|
|
25
25
|
})(PartyTypeType || (exports.PartyTypeType = PartyTypeType = {}));
|
|
26
26
|
var PartyOrigin;
|
|
27
27
|
(function (PartyOrigin) {
|
|
28
|
-
PartyOrigin["INTERNAL"] = "
|
|
29
|
-
PartyOrigin["EXTERNAL"] = "
|
|
28
|
+
PartyOrigin["INTERNAL"] = "INTERNAL";
|
|
29
|
+
PartyOrigin["EXTERNAL"] = "EXTERNAL";
|
|
30
30
|
})(PartyOrigin || (exports.PartyOrigin = PartyOrigin = {}));
|
|
31
31
|
//# sourceMappingURL=contact.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.data-store",
|
|
3
|
-
"version": "0.23.5-unstable.
|
|
3
|
+
"version": "0.23.5-unstable.19+f81eb7dc",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"typeorm-postgres:migration:run": "pnpm run typeorm -- migration:run -c migration-postgres"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@sphereon/ssi-sdk.core": "0.23.5-unstable.
|
|
17
|
-
"@sphereon/ssi-types": "0.23.5-unstable.
|
|
16
|
+
"@sphereon/ssi-sdk.core": "0.23.5-unstable.19+f81eb7dc",
|
|
17
|
+
"@sphereon/ssi-types": "0.23.5-unstable.19+f81eb7dc",
|
|
18
18
|
"@veramo/core": "4.2.0",
|
|
19
19
|
"@veramo/utils": "4.2.0",
|
|
20
20
|
"class-validator": "^0.14.0",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"PostgreSQL",
|
|
45
45
|
"Contact Store"
|
|
46
46
|
],
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "f81eb7dc9a4c20545b76c1ee10d56eff7ad79e1a"
|
|
48
48
|
}
|
|
@@ -14,7 +14,7 @@ export class PartyTypeEntity {
|
|
|
14
14
|
@Column('simple-enum', { name: 'type', enum: PartyTypeType, nullable: false, unique: false })
|
|
15
15
|
type!: PartyTypeType
|
|
16
16
|
|
|
17
|
-
@Column('simple-enum', { name: 'origin', enum: PartyOrigin, default: '
|
|
17
|
+
@Column('simple-enum', { name: 'origin', enum: PartyOrigin, default: 'EXTERNAL', nullable: false, unique: false })
|
|
18
18
|
origin!: PartyOrigin
|
|
19
19
|
|
|
20
20
|
@Column({ name: 'name', length: 255, nullable: false, unique: true })
|
|
@@ -13,9 +13,9 @@ export class CreateContacts1690925872592 implements MigrationInterface {
|
|
|
13
13
|
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" RENAME COLUMN "identityId" TO "identity_id"`)
|
|
14
14
|
await queryRunner.query(`ALTER TABLE "Connection" RENAME COLUMN "identityId" TO "identity_id"`)
|
|
15
15
|
await queryRunner.query(`CREATE TYPE "public"."PartyType_type_enum" AS ENUM('naturalPerson', 'organization')`)
|
|
16
|
-
await queryRunner.query(`CREATE TYPE "public"."PartyOrigin_type_enum" AS ENUM('
|
|
16
|
+
await queryRunner.query(`CREATE TYPE "public"."PartyOrigin_type_enum" AS ENUM('INTERNAL', 'EXTERNAL')`)
|
|
17
17
|
await queryRunner.query(
|
|
18
|
-
`CREATE TABLE "PartyType" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "type" "public"."PartyType_type_enum" NOT NULL, "origin" "public"."PartyOrigin_type_enum" NOT NULL DEFAULT '
|
|
18
|
+
`CREATE TABLE "PartyType" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "type" "public"."PartyType_type_enum" NOT NULL, "origin" "public"."PartyOrigin_type_enum" NOT NULL DEFAULT 'EXTERNAL', "name" character varying(255) NOT NULL, "description" character varying(255), "tenant_id" character varying(255) NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "UQ_PartyType_name" UNIQUE ("name"), CONSTRAINT "PK_PartyType_id" PRIMARY KEY ("id"))`,
|
|
19
19
|
)
|
|
20
20
|
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyType_type_tenant_id" ON "PartyType" ("type", "tenant_id")`)
|
|
21
21
|
await queryRunner.query(
|
|
@@ -83,10 +83,10 @@ export class CreateContacts1690925872592 implements MigrationInterface {
|
|
|
83
83
|
)
|
|
84
84
|
await queryRunner.query(`DROP TABLE "BaseConfigEntity"`)
|
|
85
85
|
await queryRunner.query(
|
|
86
|
-
`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('3875c12e-fdaa-4ef6-a340-c936e054b627', 'organization', '
|
|
86
|
+
`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('3875c12e-fdaa-4ef6-a340-c936e054b627', 'organization', 'INTERNAL' 'Sphereon_default_organization_type', 'sphereon_default_organization', '95e09cfc-c974-4174-86aa-7bf1d5251fb4', now(), now())`,
|
|
87
87
|
)
|
|
88
88
|
await queryRunner.query(
|
|
89
|
-
`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('7d248798-41ca-4fc1-a130-9934b43d532e', 'naturalPerson', '
|
|
89
|
+
`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('7d248798-41ca-4fc1-a130-9934b43d532e', 'naturalPerson', 'INTERNAL', 'Sphereon_default_natural_person_type', 'sphereon_default_natural_person', '95e09cfc-c974-4174-86aa-7bf1d5251fb4', now(), now())`,
|
|
90
90
|
)
|
|
91
91
|
await queryRunner.query(
|
|
92
92
|
`INSERT INTO "Party"(id, uri, created_at, last_updated_at, party_type_id) SELECT id, uri, created_at, last_updated_at, '3875c12e-fdaa-4ef6-a340-c936e054b627' FROM "Contact"`,
|
|
@@ -49,7 +49,7 @@ export class CreateContacts1690925872693 implements MigrationInterface {
|
|
|
49
49
|
await queryRunner.query(`DROP TABLE "Connection"`)
|
|
50
50
|
await queryRunner.query(`ALTER TABLE "temporary_Connection" RENAME TO "Connection"`)
|
|
51
51
|
await queryRunner.query(
|
|
52
|
-
`CREATE TABLE "PartyType" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('naturalPerson','organization') ) NOT NULL, "origin" varchar CHECK( "origin" IN ('
|
|
52
|
+
`CREATE TABLE "PartyType" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('naturalPerson','organization') ) NOT NULL, "origin" varchar CHECK( "origin" IN ('INTERNAL', 'EXTERNAL') ) NOT NULL DEFAULT 'EXTERNAL', "name" varchar(255) NOT NULL, "description" varchar(255), "tenant_id" varchar(255) NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "UQ_PartyType_name" UNIQUE ("name"))`,
|
|
53
53
|
)
|
|
54
54
|
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyType_type_tenant_id" ON "PartyType" ("type", "tenant_id")`)
|
|
55
55
|
await queryRunner.query(
|
|
@@ -140,10 +140,10 @@ export class CreateContacts1690925872693 implements MigrationInterface {
|
|
|
140
140
|
)
|
|
141
141
|
await queryRunner.query(`DROP TABLE "BaseConfigEntity"`)
|
|
142
142
|
await queryRunner.query(
|
|
143
|
-
`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('3875c12e-fdaa-4ef6-a340-c936e054b627', 'organization', '
|
|
143
|
+
`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('3875c12e-fdaa-4ef6-a340-c936e054b627', 'organization', 'INTERNAL', 'Sphereon_default_organization_type', 'sphereon_default_organization', '95e09cfc-c974-4174-86aa-7bf1d5251fb4', datetime('now'), datetime('now'))`,
|
|
144
144
|
)
|
|
145
145
|
await queryRunner.query(
|
|
146
|
-
`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('7d248798-41ca-4fc1-a130-9934b43d532e', 'naturalPerson', '
|
|
146
|
+
`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('7d248798-41ca-4fc1-a130-9934b43d532e', 'naturalPerson', 'INTERNAL', 'Sphereon_default_natural_person_type', 'sphereon_default_natural_person', '95e09cfc-c974-4174-86aa-7bf1d5251fb4', datetime('now'), datetime('now'))`,
|
|
147
147
|
)
|
|
148
148
|
await queryRunner.query(
|
|
149
149
|
`INSERT INTO "Party"(id, uri, created_at, last_updated_at, party_type_id) SELECT id, uri, created_at, last_updated_at, '3875c12e-fdaa-4ef6-a340-c936e054b627' FROM "Contact"`,
|