@sphereon/ssi-sdk.data-store 0.24.0 → 0.24.1-next.42
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/contact/ContactStore.d.ts +3 -0
- package/dist/contact/ContactStore.d.ts.map +1 -1
- package/dist/contact/ContactStore.js +84 -48
- package/dist/contact/ContactStore.js.map +1 -1
- package/dist/entities/contact/BaseContactEntity.d.ts +2 -0
- package/dist/entities/contact/BaseContactEntity.d.ts.map +1 -1
- package/dist/entities/contact/BaseContactEntity.js +12 -3
- package/dist/entities/contact/BaseContactEntity.js.map +1 -1
- package/dist/entities/contact/ConnectionEntity.d.ts +2 -0
- package/dist/entities/contact/ConnectionEntity.d.ts.map +1 -1
- package/dist/entities/contact/ConnectionEntity.js +8 -0
- package/dist/entities/contact/ConnectionEntity.js.map +1 -1
- package/dist/entities/contact/ContactMetadataItemEntity.d.ts +14 -0
- package/dist/entities/contact/ContactMetadataItemEntity.d.ts.map +1 -0
- package/dist/entities/contact/ContactMetadataItemEntity.js +88 -0
- package/dist/entities/contact/ContactMetadataItemEntity.js.map +1 -0
- package/dist/entities/contact/CorrelationIdentifierEntity.d.ts +2 -0
- package/dist/entities/contact/CorrelationIdentifierEntity.d.ts.map +1 -1
- package/dist/entities/contact/CorrelationIdentifierEntity.js +8 -0
- package/dist/entities/contact/CorrelationIdentifierEntity.js.map +1 -1
- package/dist/entities/contact/DidAuthConfigEntity.d.ts +2 -0
- package/dist/entities/contact/DidAuthConfigEntity.d.ts.map +1 -1
- package/dist/entities/contact/DidAuthConfigEntity.js +8 -0
- package/dist/entities/contact/DidAuthConfigEntity.js.map +1 -1
- package/dist/entities/contact/ElectronicAddressEntity.d.ts +2 -0
- package/dist/entities/contact/ElectronicAddressEntity.d.ts.map +1 -1
- package/dist/entities/contact/ElectronicAddressEntity.js +8 -0
- package/dist/entities/contact/ElectronicAddressEntity.js.map +1 -1
- package/dist/entities/contact/IMetadataEntity.d.ts +8 -0
- package/dist/entities/contact/IMetadataEntity.d.ts.map +1 -0
- package/dist/entities/contact/IMetadataEntity.js +2 -0
- package/dist/entities/contact/IMetadataEntity.js.map +1 -0
- package/dist/entities/contact/IdentityEntity.d.ts +5 -2
- package/dist/entities/contact/IdentityEntity.d.ts.map +1 -1
- package/dist/entities/contact/IdentityEntity.js +13 -0
- package/dist/entities/contact/IdentityEntity.js.map +1 -1
- package/dist/entities/contact/IdentityMetadataItemEntity.d.ts +6 -2
- package/dist/entities/contact/IdentityMetadataItemEntity.d.ts.map +1 -1
- package/dist/entities/contact/IdentityMetadataItemEntity.js +19 -3
- package/dist/entities/contact/IdentityMetadataItemEntity.js.map +1 -1
- package/dist/entities/contact/NaturalPersonEntity.d.ts +2 -0
- package/dist/entities/contact/NaturalPersonEntity.d.ts.map +1 -1
- package/dist/entities/contact/NaturalPersonEntity.js +8 -0
- package/dist/entities/contact/NaturalPersonEntity.js.map +1 -1
- package/dist/entities/contact/OpenIdConfigEntity.d.ts +2 -0
- package/dist/entities/contact/OpenIdConfigEntity.d.ts.map +1 -1
- package/dist/entities/contact/OpenIdConfigEntity.js +8 -0
- package/dist/entities/contact/OpenIdConfigEntity.js.map +1 -1
- package/dist/entities/contact/OrganizationEntity.d.ts +2 -0
- package/dist/entities/contact/OrganizationEntity.d.ts.map +1 -1
- package/dist/entities/contact/OrganizationEntity.js +8 -0
- package/dist/entities/contact/OrganizationEntity.js.map +1 -1
- package/dist/entities/contact/PartyEntity.d.ts +2 -0
- package/dist/entities/contact/PartyEntity.d.ts.map +1 -1
- package/dist/entities/contact/PartyEntity.js +8 -0
- package/dist/entities/contact/PartyEntity.js.map +1 -1
- package/dist/entities/contact/PartyRelationshipEntity.d.ts +2 -0
- package/dist/entities/contact/PartyRelationshipEntity.d.ts.map +1 -1
- package/dist/entities/contact/PartyRelationshipEntity.js +8 -0
- package/dist/entities/contact/PartyRelationshipEntity.js.map +1 -1
- package/dist/entities/contact/PartyTypeEntity.js +4 -4
- package/dist/entities/contact/PartyTypeEntity.js.map +1 -1
- package/dist/entities/contact/PhysicalAddressEntity.d.ts +2 -0
- package/dist/entities/contact/PhysicalAddressEntity.d.ts.map +1 -1
- package/dist/entities/contact/PhysicalAddressEntity.js +8 -0
- package/dist/entities/contact/PhysicalAddressEntity.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/migrations/generic/8-CreateContacts.d.ts +7 -0
- package/dist/migrations/generic/8-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/generic/8-CreateContacts.js +78 -0
- package/dist/migrations/generic/8-CreateContacts.js.map +1 -0
- package/dist/migrations/generic/9-CreateContacts.d.ts +7 -0
- package/dist/migrations/generic/9-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/generic/9-CreateContacts.js +78 -0
- package/dist/migrations/generic/9-CreateContacts.js.map +1 -0
- package/dist/migrations/generic/index.d.ts.map +1 -1
- package/dist/migrations/generic/index.js +8 -1
- package/dist/migrations/generic/index.js.map +1 -1
- package/dist/migrations/postgres/1690925872592-CreateContacts.d.ts.map +1 -1
- package/dist/migrations/postgres/1690925872592-CreateContacts.js +40 -3
- package/dist/migrations/postgres/1690925872592-CreateContacts.js.map +1 -1
- package/dist/migrations/postgres/1710438363001-CreateContacts.d.ts +7 -0
- package/dist/migrations/postgres/1710438363001-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/postgres/1710438363001-CreateContacts.js +63 -0
- package/dist/migrations/postgres/1710438363001-CreateContacts.js.map +1 -0
- package/dist/migrations/postgres/1715761125001-CreateContacts.d.ts +7 -0
- package/dist/migrations/postgres/1715761125001-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/postgres/1715761125001-CreateContacts.js +74 -0
- package/dist/migrations/postgres/1715761125001-CreateContacts.js.map +1 -0
- package/dist/migrations/sqlite/1690925872693-CreateContacts.d.ts.map +1 -1
- package/dist/migrations/sqlite/1690925872693-CreateContacts.js +40 -3
- package/dist/migrations/sqlite/1690925872693-CreateContacts.js.map +1 -1
- package/dist/migrations/sqlite/1710438363002-CreateContacts.d.ts +7 -0
- package/dist/migrations/sqlite/1710438363002-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/sqlite/1710438363002-CreateContacts.js +79 -0
- package/dist/migrations/sqlite/1710438363002-CreateContacts.js.map +1 -0
- package/dist/migrations/sqlite/1715761125002-CreateContacts.d.ts +7 -0
- package/dist/migrations/sqlite/1715761125002-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/sqlite/1715761125002-CreateContacts.js +73 -0
- package/dist/migrations/sqlite/1715761125002-CreateContacts.js.map +1 -0
- package/dist/types/contact/contact.d.ts +51 -15
- package/dist/types/contact/contact.d.ts.map +1 -1
- package/dist/types/contact/contact.js +12 -7
- package/dist/types/contact/contact.js.map +1 -1
- package/dist/utils/contact/MappingUtils.d.ts +6 -4
- package/dist/utils/contact/MappingUtils.d.ts.map +1 -1
- package/dist/utils/contact/MappingUtils.js +128 -18
- package/dist/utils/contact/MappingUtils.js.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/contact.entities.test.ts +129 -44
- package/src/__tests__/contact.store.test.ts +205 -29
- package/src/contact/ContactStore.ts +74 -30
- package/src/entities/contact/BaseContactEntity.ts +11 -0
- package/src/entities/contact/ConnectionEntity.ts +6 -0
- package/src/entities/contact/ContactMetadataItemEntity.ts +50 -0
- package/src/entities/contact/CorrelationIdentifierEntity.ts +6 -0
- package/src/entities/contact/DidAuthConfigEntity.ts +6 -0
- package/src/entities/contact/ElectronicAddressEntity.ts +6 -0
- package/src/entities/contact/IMetadataEntity.ts +7 -0
- package/src/entities/contact/IdentityEntity.ts +11 -2
- package/src/entities/contact/IdentityMetadataItemEntity.ts +16 -4
- package/src/entities/contact/NaturalPersonEntity.ts +6 -0
- package/src/entities/contact/OpenIdConfigEntity.ts +6 -0
- package/src/entities/contact/OrganizationEntity.ts +6 -0
- package/src/entities/contact/PartyEntity.ts +6 -0
- package/src/entities/contact/PartyRelationshipEntity.ts +6 -0
- package/src/entities/contact/PartyTypeEntity.ts +4 -4
- package/src/entities/contact/PhysicalAddressEntity.ts +6 -0
- package/src/index.ts +3 -0
- package/src/migrations/generic/8-CreateContacts.ts +66 -0
- package/src/migrations/generic/9-CreateContacts.ts +66 -0
- package/src/migrations/generic/index.ts +8 -1
- package/src/migrations/postgres/1690925872592-CreateContacts.ts +59 -5
- package/src/migrations/postgres/1710438363001-CreateContacts.ts +63 -0
- package/src/migrations/postgres/1715761125001-CreateContacts.ts +60 -0
- package/src/migrations/sqlite/1690925872693-CreateContacts.ts +70 -3
- package/src/migrations/sqlite/1710438363002-CreateContacts.ts +83 -0
- package/src/migrations/sqlite/1715761125002-CreateContacts.ts +59 -0
- package/src/types/contact/contact.ts +56 -15
- package/src/utils/contact/MappingUtils.ts +134 -18
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
export class CreateContacts1715761125001 implements MigrationInterface {
|
|
4
|
+
name = 'CreateContacts1715761125001'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
// Upgrade IdentityMetadata table
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" RENAME TO "temporary_IdentityMetadata"`)
|
|
9
|
+
await queryRunner.query(`CREATE TABLE "IdentityMetadata"
|
|
10
|
+
(
|
|
11
|
+
"id" uuid PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
|
|
12
|
+
"label" character varying(255) NOT NULL,
|
|
13
|
+
"valueType" character varying NOT NULL,
|
|
14
|
+
"stringValue" text,
|
|
15
|
+
"numberValue" double precision,
|
|
16
|
+
"dateValue" TIMESTAMP,
|
|
17
|
+
"boolValue" boolean,
|
|
18
|
+
"identityId" uuid,
|
|
19
|
+
CONSTRAINT "FK_Identity_IdentityMetadata" FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE
|
|
20
|
+
)`)
|
|
21
|
+
await queryRunner.query(`INSERT INTO "IdentityMetadata" ("id", "label", "valueType", "stringValue", "identityId")
|
|
22
|
+
SELECT "id", "label", 'string', "value", "identityId"
|
|
23
|
+
FROM "temporary_IdentityMetadata"`)
|
|
24
|
+
await queryRunner.query(`DROP TABLE "temporary_IdentityMetadata"`)
|
|
25
|
+
|
|
26
|
+
// Create new ContactMetadata table
|
|
27
|
+
await queryRunner.query(`CREATE TABLE "ContactMetadata"
|
|
28
|
+
(
|
|
29
|
+
"id" uuid PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
|
|
30
|
+
"label" character varying(255) NOT NULL,
|
|
31
|
+
"valueType" character varying NOT NULL,
|
|
32
|
+
"stringValue" text,
|
|
33
|
+
"numberValue" double precision,
|
|
34
|
+
"dateValue" TIMESTAMP,
|
|
35
|
+
"boolValue" boolean,
|
|
36
|
+
"contactId" uuid,
|
|
37
|
+
CONSTRAINT "FK_BaseContact_ContactMetadata" FOREIGN KEY ("contactId") REFERENCES "BaseContact" ("id") ON DELETE CASCADE
|
|
38
|
+
)`)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
42
|
+
// Drop the ContactMetadata table
|
|
43
|
+
await queryRunner.query(`DROP TABLE "ContactMetadata"`)
|
|
44
|
+
|
|
45
|
+
// Restore the IdentityMetadata table
|
|
46
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" RENAME TO "temporary_IdentityMetadata"`)
|
|
47
|
+
await queryRunner.query(`CREATE TABLE "IdentityMetadata"
|
|
48
|
+
(
|
|
49
|
+
"id" uuid PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
|
|
50
|
+
"label" character varying(255) NOT NULL,
|
|
51
|
+
"value" character varying(255) NOT NULL,
|
|
52
|
+
"identityId" uuid,
|
|
53
|
+
CONSTRAINT "FK_Identity_IdentityMetadata" FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE
|
|
54
|
+
)`)
|
|
55
|
+
await queryRunner.query(`INSERT INTO "IdentityMetadata" ("id", "label", "value", "identityId")
|
|
56
|
+
SELECT "id", "label", "stringValue", "identityId"
|
|
57
|
+
FROM "temporary_IdentityMetadata"`)
|
|
58
|
+
await queryRunner.query(`DROP TABLE "temporary_IdentityMetadata"`)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -12,6 +12,7 @@ export class CreateContacts1690925872693 implements MigrationInterface {
|
|
|
12
12
|
)
|
|
13
13
|
await queryRunner.query(`DROP TABLE "CorrelationIdentifier"`)
|
|
14
14
|
await queryRunner.query(`ALTER TABLE "temporary_CorrelationIdentifier" RENAME TO "CorrelationIdentifier"`)
|
|
15
|
+
// roles not null
|
|
15
16
|
await queryRunner.query(
|
|
16
17
|
`CREATE TABLE "temporary_Identity" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255) NOT NULL, "roles" text NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "contactId" varchar, CONSTRAINT "UQ_Identity_alias" UNIQUE ("alias"))`,
|
|
17
18
|
)
|
|
@@ -34,6 +35,7 @@ export class CreateContacts1690925872693 implements MigrationInterface {
|
|
|
34
35
|
)
|
|
35
36
|
await queryRunner.query(`DROP TABLE "CorrelationIdentifier"`)
|
|
36
37
|
await queryRunner.query(`ALTER TABLE "temporary_CorrelationIdentifier" RENAME TO "CorrelationIdentifier"`)
|
|
38
|
+
// contactId -> partyId
|
|
37
39
|
await queryRunner.query(
|
|
38
40
|
`CREATE TABLE "temporary_Identity" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255) NOT NULL, "roles" text NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "partyId" varchar, CONSTRAINT "UQ_Identity_alias" UNIQUE ("alias"))`,
|
|
39
41
|
)
|
|
@@ -49,7 +51,7 @@ export class CreateContacts1690925872693 implements MigrationInterface {
|
|
|
49
51
|
await queryRunner.query(`DROP TABLE "Connection"`)
|
|
50
52
|
await queryRunner.query(`ALTER TABLE "temporary_Connection" RENAME TO "Connection"`)
|
|
51
53
|
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 ('INTERNAL', 'EXTERNAL') ) NOT NULL
|
|
54
|
+
`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, "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
55
|
)
|
|
54
56
|
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyType_type_tenant_id" ON "PartyType" ("type", "tenant_id")`)
|
|
55
57
|
await queryRunner.query(
|
|
@@ -109,6 +111,7 @@ export class CreateContacts1690925872693 implements MigrationInterface {
|
|
|
109
111
|
)
|
|
110
112
|
await queryRunner.query(`DROP TABLE "Party"`)
|
|
111
113
|
await queryRunner.query(`ALTER TABLE "temporary_Party" RENAME TO "Party"`)
|
|
114
|
+
// Restore lost FK_Identity_partyId
|
|
112
115
|
await queryRunner.query(
|
|
113
116
|
`CREATE TABLE "temporary_Identity" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255) NOT NULL, "roles" text NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "partyId" varchar, CONSTRAINT "UQ_Identity_alias" UNIQUE ("alias"), CONSTRAINT "FK_Identity_partyId" FOREIGN KEY ("partyId") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`,
|
|
114
117
|
)
|
|
@@ -155,7 +158,71 @@ export class CreateContacts1690925872693 implements MigrationInterface {
|
|
|
155
158
|
}
|
|
156
159
|
|
|
157
160
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
await queryRunner.query(
|
|
162
|
+
`CREATE TABLE "Contact" ("id" varchar PRIMARY KEY NOT NULL, "uri" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "name" varchar(255), "alias" varchar(255))`,
|
|
163
|
+
)
|
|
164
|
+
await queryRunner.query(
|
|
165
|
+
`INSERT INTO "Contact"(id, uri, created_at, last_updated_at, name, alias) SELECT id, uri, created_at, last_updated_at, (SELECT legal_name FROM "BaseContact" WHERE "BaseContact"."party_id" = "Party"."id"), (SELECT display_name FROM "BaseContact" WHERE "BaseContact"."party_id" = "Party"."id") FROM "Party" WHERE party_type_id = '3875c12e-fdaa-4ef6-a340-c936e054b627'`,
|
|
166
|
+
)
|
|
167
|
+
await queryRunner.query(`DROP TABLE "BaseContact"`)
|
|
168
|
+
await queryRunner.query(`DROP TABLE "Party"`)
|
|
169
|
+
|
|
170
|
+
await queryRunner.query(
|
|
171
|
+
`CREATE TABLE "BaseConfigEntity" ("id" varchar PRIMARY KEY NOT NULL, "identifier" varchar(255), "redirect_url" varchar(255), "session_id" varchar(255), "client_id" varchar(255), "client_secret" varchar(255), "scopes" text, "issuer" varchar(255), "dangerously_allow_insecure_http_requests" boolean, "client_auth_method" text, "type" varchar NOT NULL, "connectionId" varchar)`,
|
|
172
|
+
)
|
|
173
|
+
await queryRunner.query(
|
|
174
|
+
`INSERT INTO "BaseConfigEntity"("id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connectionId") SELECT "id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connection_id" FROM "BaseConfig"`,
|
|
175
|
+
)
|
|
176
|
+
await queryRunner.query(`DROP TABLE "BaseConfig"`)
|
|
177
|
+
|
|
178
|
+
await queryRunner.query(
|
|
179
|
+
`CREATE TABLE "temporary_Party" ("id" varchar PRIMARY KEY NOT NULL, "uri" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "party_type_id" varchar NOT NULL, CONSTRAINT "FK_Party_party_type_id" FOREIGN KEY ("party_type_id") REFERENCES "PartyType" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION)`,
|
|
180
|
+
)
|
|
181
|
+
await queryRunner.query(
|
|
182
|
+
`INSERT INTO "temporary_Party"("id", "uri", "created_at", "last_updated_at", "party_type_id") SELECT "id", "uri", "created_at", "last_updated_at", "party_type_id" FROM "Party"`,
|
|
183
|
+
)
|
|
184
|
+
await queryRunner.query(`DROP TABLE "Party"`)
|
|
185
|
+
await queryRunner.query(`ALTER TABLE "temporary_Party" RENAME TO "Party"`)
|
|
186
|
+
|
|
187
|
+
await queryRunner.query(`DROP INDEX "IDX_PartyRelationship_left_right"`)
|
|
188
|
+
await queryRunner.query(
|
|
189
|
+
`CREATE TABLE "temporary_PartyRelationship" ("id" varchar PRIMARY KEY NOT NULL, "left_id" varchar NOT NULL, "right_id" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "FK_PartyRelationship_left_id" FOREIGN KEY ("left_id") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_PartyRelationship_right_id" FOREIGN KEY ("right_id") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`,
|
|
190
|
+
)
|
|
191
|
+
await queryRunner.query(
|
|
192
|
+
`INSERT INTO "temporary_PartyRelationship"("id", "left_id", "right_id", "created_at", "last_updated_at") SELECT "id", "left_id", "right_id", "created_at", "last_updated_at" FROM "PartyRelationship"`,
|
|
193
|
+
)
|
|
194
|
+
await queryRunner.query(`DROP TABLE "PartyRelationship"`)
|
|
195
|
+
await queryRunner.query(`ALTER TABLE "temporary_PartyRelationship" RENAME TO "PartyRelationship"`)
|
|
196
|
+
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyRelationship_left_right" ON "PartyRelationship" ("left_id", "right_id")`)
|
|
197
|
+
|
|
198
|
+
await queryRunner.query(`DROP INDEX "IDX_BaseContact_type"`)
|
|
199
|
+
await queryRunner.query(
|
|
200
|
+
`CREATE TABLE "temporary_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"), CONSTRAINT "FK_BaseContact_party_id" FOREIGN KEY ("party_id") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`,
|
|
201
|
+
)
|
|
202
|
+
await queryRunner.query(
|
|
203
|
+
`INSERT INTO "temporary_BaseContact"("id", "created_at", "last_updated_at", "legal_name", "display_name", "first_name", "middle_name", "last_name", "type", "party_id") SELECT "id", "created_at", "last_updated_at", "legal_name", "display_name", "first_name", "middle_name", "last_name", "type", "party_id" FROM "BaseContact"`,
|
|
204
|
+
)
|
|
205
|
+
await queryRunner.query(`DROP TABLE "BaseContact"`)
|
|
206
|
+
await queryRunner.query(`ALTER TABLE "temporary_BaseContact" RENAME TO "BaseContact"`)
|
|
207
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseContact_type" ON "BaseContact" ("type")`)
|
|
208
|
+
|
|
209
|
+
await queryRunner.query(`DROP INDEX "IDX_BaseConfig_type"`)
|
|
210
|
+
await queryRunner.query(
|
|
211
|
+
`CREATE TABLE "temporary_BaseConfig" ("id" varchar PRIMARY KEY NOT NULL, "identifier" varchar(255), "redirect_url" varchar(255), "session_id" varchar(255), "client_id" varchar(255), "client_secret" varchar(255), "scopes" text, "issuer" varchar(255), "dangerously_allow_insecure_http_requests" boolean, "client_auth_method" text, "type" varchar NOT NULL, "connection_id" varchar, CONSTRAINT "REL_BaseConfig_connection_id" UNIQUE ("connection_id"), CONSTRAINT "FK_BaseConfig_connection_id" FOREIGN KEY ("connection_id") REFERENCES "Connection" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`,
|
|
212
|
+
)
|
|
213
|
+
await queryRunner.query(
|
|
214
|
+
`INSERT INTO "temporary_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", "connection_id" FROM "BaseConfig"`,
|
|
215
|
+
)
|
|
216
|
+
await queryRunner.query(`DROP TABLE "BaseConfig"`)
|
|
217
|
+
await queryRunner.query(`ALTER TABLE "temporary_BaseConfig" RENAME TO "BaseConfig"`)
|
|
218
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseConfig_type" ON "BaseConfig" ("type")`)
|
|
219
|
+
|
|
220
|
+
await queryRunner.query(`DROP INDEX "IDX_PartyType_type_tenant_id"`)
|
|
221
|
+
await queryRunner.query(`DROP TABLE "PartyType"`)
|
|
222
|
+
await queryRunner.query(`DROP TABLE "Connection"`)
|
|
223
|
+
await queryRunner.query(`DROP TABLE "Identity"`)
|
|
224
|
+
await queryRunner.query(`DROP TABLE "CorrelationIdentifier"`)
|
|
225
|
+
await queryRunner.query(`DROP TABLE "ElectronicAddress"`)
|
|
226
|
+
await queryRunner.query(`DROP TABLE "PhysicalAddress"`)
|
|
160
227
|
}
|
|
161
228
|
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
export class CreateContacts1710438363002 implements MigrationInterface {
|
|
4
|
+
name = 'CreateContacts1710438363002'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "Party" ADD COLUMN "owner_id" text`)
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "Party" ADD COLUMN "tenant_id" text`)
|
|
9
|
+
|
|
10
|
+
// Add owner_id, tenant_id & origin
|
|
11
|
+
await queryRunner.query(
|
|
12
|
+
`CREATE TABLE "temporary_Identity" (
|
|
13
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
14
|
+
"alias" varchar(255) NOT NULL,
|
|
15
|
+
"roles" text NOT NULL,
|
|
16
|
+
"origin" text NOT NULL,
|
|
17
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
18
|
+
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
19
|
+
"partyId" varchar,
|
|
20
|
+
"owner_id" text,
|
|
21
|
+
"tenant_id" text,
|
|
22
|
+
CONSTRAINT "UQ_Identity_alias" UNIQUE ("alias"),
|
|
23
|
+
CONSTRAINT "FK_Identity_partyId" FOREIGN KEY ("partyId") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
24
|
+
)`,
|
|
25
|
+
)
|
|
26
|
+
await queryRunner.query(
|
|
27
|
+
`INSERT INTO "temporary_Identity"("id", "alias", "roles", "created_at", "last_updated_at", "partyId", "owner_id", "tenant_id", "origin")
|
|
28
|
+
SELECT "id", "alias", "roles", 'EXTERNAL' as "origin", "created_at", "last_updated_at", "partyId", NULL as "owner_id", NULL as "tenant_id" FROM "Identity"`,
|
|
29
|
+
)
|
|
30
|
+
await queryRunner.query(`DROP TABLE "Identity"`)
|
|
31
|
+
await queryRunner.query(`ALTER TABLE "temporary_Identity" RENAME TO "Identity"`)
|
|
32
|
+
|
|
33
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" ADD COLUMN "owner_id" text`)
|
|
34
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" ADD COLUMN "tenant_id" text`)
|
|
35
|
+
|
|
36
|
+
await queryRunner.query(`ALTER TABLE "Connection" ADD COLUMN "owner_id" text`)
|
|
37
|
+
await queryRunner.query(`ALTER TABLE "Connection" ADD COLUMN "tenant_id" text`)
|
|
38
|
+
|
|
39
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" ADD COLUMN "owner_id" text`)
|
|
40
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" ADD COLUMN "tenant_id" text`)
|
|
41
|
+
|
|
42
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" ADD COLUMN "owner_id" text`)
|
|
43
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" ADD COLUMN "tenant_id" text`)
|
|
44
|
+
|
|
45
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" ADD COLUMN "owner_id" text`)
|
|
46
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" ADD COLUMN "tenant_id" text`)
|
|
47
|
+
|
|
48
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" ADD COLUMN "owner_id" text`)
|
|
49
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" ADD COLUMN "tenant_id" text`)
|
|
50
|
+
|
|
51
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" ADD COLUMN "owner_id" text`)
|
|
52
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" ADD COLUMN "tenant_id" text`)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
56
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" DROP COLUMN "tenant_id"`)
|
|
57
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" DROP COLUMN "owner_id"`)
|
|
58
|
+
|
|
59
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" DROP COLUMN "tenant_id"`)
|
|
60
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" DROP COLUMN "owner_id"`)
|
|
61
|
+
|
|
62
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" DROP COLUMN "tenant_id"`)
|
|
63
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" DROP COLUMN "owner_id"`)
|
|
64
|
+
|
|
65
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" DROP COLUMN "tenant_id"`)
|
|
66
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" DROP COLUMN "owner_id"`)
|
|
67
|
+
|
|
68
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" DROP COLUMN "tenant_id"`)
|
|
69
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" DROP COLUMN "owner_id"`)
|
|
70
|
+
|
|
71
|
+
await queryRunner.query(`ALTER TABLE "Connection" DROP COLUMN "tenant_id"`)
|
|
72
|
+
await queryRunner.query(`ALTER TABLE "Connection" DROP COLUMN "owner_id"`)
|
|
73
|
+
|
|
74
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP COLUMN "tenant_id"`)
|
|
75
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP COLUMN "owner_id"`)
|
|
76
|
+
|
|
77
|
+
await queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "tenant_id"`)
|
|
78
|
+
await queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "owner_id"`)
|
|
79
|
+
|
|
80
|
+
await queryRunner.query(`ALTER TABLE "Party" DROP COLUMN "tenant_id"`)
|
|
81
|
+
await queryRunner.query(`ALTER TABLE "Party" DROP COLUMN "owner_id"`)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
export class CreateContacts1715761125002 implements MigrationInterface {
|
|
4
|
+
name = 'CreateContacts1715761125002'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
// Upgrade IdentityMetadata table
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" RENAME TO "temporary_IdentityMetadata"`)
|
|
9
|
+
await queryRunner.query(`CREATE TABLE "IdentityMetadata"
|
|
10
|
+
(
|
|
11
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
12
|
+
"label" varchar(255) NOT NULL,
|
|
13
|
+
"valueType" varchar NOT NULL,
|
|
14
|
+
"stringValue" varchar(255),
|
|
15
|
+
"numberValue" double,
|
|
16
|
+
"dateValue" datetime,
|
|
17
|
+
"boolValue" boolean,
|
|
18
|
+
"identityId" varchar,
|
|
19
|
+
FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE)`)
|
|
20
|
+
await queryRunner.query(`INSERT INTO "IdentityMetadata" ("id", "label", "valueType", "stringValue", "identityId")
|
|
21
|
+
SELECT "id", "label", 'string', "value", "identityId"
|
|
22
|
+
FROM "temporary_IdentityMetadata"
|
|
23
|
+
`)
|
|
24
|
+
await queryRunner.query(`DROP TABLE "temporary_IdentityMetadata"`)
|
|
25
|
+
|
|
26
|
+
// Create new ContactMetadata table
|
|
27
|
+
await queryRunner.query(`CREATE TABLE "ContactMetadata"
|
|
28
|
+
(
|
|
29
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
30
|
+
"label" varchar(255) NOT NULL,
|
|
31
|
+
"valueType" varchar NOT NULL,
|
|
32
|
+
"stringValue" text,
|
|
33
|
+
"numberValue" double,
|
|
34
|
+
"dateValue" datetime,
|
|
35
|
+
"boolValue" boolean,
|
|
36
|
+
"contactId" varchar,
|
|
37
|
+
FOREIGN KEY ("contactId") REFERENCES "BaseContact" ("id") ON DELETE CASCADE)`)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
41
|
+
// Drop the ContactMetadata table
|
|
42
|
+
await queryRunner.query(`DROP TABLE "ContactMetadata"`)
|
|
43
|
+
|
|
44
|
+
// Restore the IdentityMetadata table
|
|
45
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" RENAME TO "temporary_IdentityMetadata"`)
|
|
46
|
+
await queryRunner.query(`CREATE TABLE "IdentityMetadata"
|
|
47
|
+
(
|
|
48
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
49
|
+
"label" varchar(255) NOT NULL,
|
|
50
|
+
"value" varchar(255) NOT NULL,
|
|
51
|
+
"identityId" varchar,
|
|
52
|
+
FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE
|
|
53
|
+
)`)
|
|
54
|
+
await queryRunner.query(`INSERT INTO "IdentityMetadata" ("id", "label", "value", "identityId")
|
|
55
|
+
SELECT "id", "label", "stringValue", "identityId"
|
|
56
|
+
FROM "temporary_IdentityMetadata"`)
|
|
57
|
+
await queryRunner.query(`DROP TABLE "temporary_IdentityMetadata"`)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { IIdentifier } from '@veramo/core'
|
|
2
2
|
|
|
3
|
+
export type MetadataTypes = string | number | Date | boolean | undefined
|
|
4
|
+
|
|
3
5
|
export type Party = {
|
|
4
6
|
id: string
|
|
5
7
|
uri?: string
|
|
6
|
-
roles: Array<
|
|
8
|
+
roles: Array<CredentialRole>
|
|
9
|
+
ownerId?: string
|
|
10
|
+
tenantId?: string
|
|
7
11
|
identities: Array<Identity>
|
|
8
12
|
electronicAddresses: Array<ElectronicAddress>
|
|
9
13
|
physicalAddresses: Array<PhysicalAddress>
|
|
@@ -47,36 +51,44 @@ export type PartialParty = Partial<
|
|
|
47
51
|
export type Identity = {
|
|
48
52
|
id: string
|
|
49
53
|
alias: string
|
|
50
|
-
|
|
54
|
+
ownerId?: string
|
|
55
|
+
tenantId?: string
|
|
56
|
+
origin: IdentityOrigin
|
|
57
|
+
roles: Array<CredentialRole>
|
|
51
58
|
identifier: CorrelationIdentifier
|
|
52
59
|
connection?: Connection
|
|
53
|
-
metadata?: Array<MetadataItem
|
|
60
|
+
metadata?: Array<MetadataItem<MetadataTypes>>
|
|
54
61
|
createdAt: Date
|
|
55
62
|
lastUpdatedAt: Date
|
|
56
63
|
}
|
|
57
|
-
export type NonPersistedIdentity = Omit<Identity, 'id' | 'identifier' | 'connection' | 'metadata' | 'createdAt' | 'lastUpdatedAt'> & {
|
|
64
|
+
export type NonPersistedIdentity = Omit<Identity, 'id' | 'identifier' | 'connection' | 'metadata' | 'origin' | 'createdAt' | 'lastUpdatedAt'> & {
|
|
65
|
+
origin: IdentityOrigin
|
|
58
66
|
identifier: NonPersistedCorrelationIdentifier
|
|
59
67
|
connection?: NonPersistedConnection
|
|
60
|
-
metadata?: Array<NonPersistedMetadataItem
|
|
68
|
+
metadata?: Array<NonPersistedMetadataItem<MetadataTypes>>
|
|
61
69
|
}
|
|
62
|
-
export type PartialIdentity = Partial<Omit<Identity, 'identifier' | 'connection' | 'metadata' | 'roles'>> & {
|
|
70
|
+
export type PartialIdentity = Partial<Omit<Identity, 'identifier' | 'connection' | 'metadata' | 'origin' | 'roles'>> & {
|
|
63
71
|
identifier?: PartialCorrelationIdentifier
|
|
64
72
|
connection?: PartialConnection
|
|
65
|
-
metadata?: PartialMetadataItem
|
|
66
|
-
|
|
73
|
+
metadata?: PartialMetadataItem<MetadataTypes> // Usage: FindIdentityArgs = Array<PartialIdentity>
|
|
74
|
+
origin?: IdentityOrigin
|
|
75
|
+
roles?: CredentialRole
|
|
67
76
|
partyId?: string
|
|
68
77
|
}
|
|
69
78
|
|
|
70
|
-
export type MetadataItem = {
|
|
79
|
+
export type MetadataItem<T extends MetadataTypes> = {
|
|
71
80
|
id: string
|
|
72
81
|
label: string
|
|
73
|
-
value:
|
|
82
|
+
value: T
|
|
74
83
|
}
|
|
75
|
-
|
|
76
|
-
export type
|
|
84
|
+
|
|
85
|
+
export type NonPersistedMetadataItem<T extends MetadataTypes> = Omit<MetadataItem<T>, 'id'>
|
|
86
|
+
export type PartialMetadataItem<T extends MetadataTypes> = Partial<MetadataItem<T>>
|
|
77
87
|
|
|
78
88
|
export type CorrelationIdentifier = {
|
|
79
89
|
id: string
|
|
90
|
+
ownerId?: string
|
|
91
|
+
tenantId?: string
|
|
80
92
|
type: CorrelationIdentifierType
|
|
81
93
|
correlationId: string
|
|
82
94
|
}
|
|
@@ -85,6 +97,8 @@ export type PartialCorrelationIdentifier = Partial<CorrelationIdentifier>
|
|
|
85
97
|
|
|
86
98
|
export type Connection = {
|
|
87
99
|
id: string
|
|
100
|
+
ownerId?: string
|
|
101
|
+
tenantId?: string
|
|
88
102
|
type: ConnectionType
|
|
89
103
|
config: ConnectionConfig
|
|
90
104
|
}
|
|
@@ -99,6 +113,8 @@ export type OpenIdConfig = {
|
|
|
99
113
|
id: string
|
|
100
114
|
clientId: string
|
|
101
115
|
clientSecret: string
|
|
116
|
+
ownerId?: string
|
|
117
|
+
tenantId?: string
|
|
102
118
|
scopes: Array<string>
|
|
103
119
|
issuer: string
|
|
104
120
|
redirectUrl: string
|
|
@@ -112,6 +128,8 @@ export type DidAuthConfig = {
|
|
|
112
128
|
id: string
|
|
113
129
|
identifier: IIdentifier
|
|
114
130
|
stateId: string
|
|
131
|
+
ownerId?: string
|
|
132
|
+
tenantId?: string
|
|
115
133
|
redirectUrl: string
|
|
116
134
|
sessionId: string
|
|
117
135
|
}
|
|
@@ -130,21 +148,33 @@ export type NaturalPerson = {
|
|
|
130
148
|
lastName: string
|
|
131
149
|
middleName?: string
|
|
132
150
|
displayName: string
|
|
151
|
+
metadata?: Array<MetadataItem<MetadataTypes>>
|
|
152
|
+
ownerId?: string
|
|
153
|
+
tenantId?: string
|
|
133
154
|
createdAt: Date
|
|
134
155
|
lastUpdatedAt: Date
|
|
135
156
|
}
|
|
157
|
+
|
|
136
158
|
export type NonPersistedNaturalPerson = Omit<NaturalPerson, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
137
|
-
|
|
159
|
+
|
|
160
|
+
export type PartialNaturalPerson = Partial<Omit<NaturalPerson, 'metadata'>> & {
|
|
161
|
+
metadata?: PartialMetadataItem<MetadataTypes>
|
|
162
|
+
}
|
|
138
163
|
|
|
139
164
|
export type Organization = {
|
|
140
165
|
id: string
|
|
141
166
|
legalName: string
|
|
142
167
|
displayName: string
|
|
168
|
+
metadata?: Array<MetadataItem<MetadataTypes>>
|
|
169
|
+
ownerId?: string
|
|
170
|
+
tenantId?: string
|
|
143
171
|
createdAt: Date
|
|
144
172
|
lastUpdatedAt: Date
|
|
145
173
|
}
|
|
146
174
|
export type NonPersistedOrganization = Omit<Organization, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
147
|
-
export type PartialOrganization = Partial<Organization
|
|
175
|
+
export type PartialOrganization = Partial<Omit<Organization, 'metadata'>> & {
|
|
176
|
+
metadata?: PartialMetadataItem<MetadataTypes>
|
|
177
|
+
}
|
|
148
178
|
|
|
149
179
|
export type Contact = NaturalPerson | Organization
|
|
150
180
|
export type NonPersistedContact = NonPersistedNaturalPerson | NonPersistedOrganization
|
|
@@ -169,6 +199,8 @@ export type PartyRelationship = {
|
|
|
169
199
|
id: string
|
|
170
200
|
leftId: string
|
|
171
201
|
rightId: string
|
|
202
|
+
ownerId?: string
|
|
203
|
+
tenantId?: string
|
|
172
204
|
createdAt: Date
|
|
173
205
|
lastUpdatedAt: Date
|
|
174
206
|
}
|
|
@@ -179,6 +211,8 @@ export type ElectronicAddress = {
|
|
|
179
211
|
id: string
|
|
180
212
|
type: ElectronicAddressType
|
|
181
213
|
electronicAddress: string
|
|
214
|
+
ownerId?: string
|
|
215
|
+
tenantId?: string
|
|
182
216
|
createdAt: Date
|
|
183
217
|
lastUpdatedAt: Date
|
|
184
218
|
}
|
|
@@ -197,6 +231,8 @@ export type PhysicalAddress = {
|
|
|
197
231
|
provinceName: string
|
|
198
232
|
countryCode: string
|
|
199
233
|
buildingName?: string
|
|
234
|
+
ownerId?: string
|
|
235
|
+
tenantId?: string
|
|
200
236
|
createdAt: Date
|
|
201
237
|
lastUpdatedAt: Date
|
|
202
238
|
}
|
|
@@ -209,7 +245,7 @@ export type ElectronicAddressType = 'email' | 'phone'
|
|
|
209
245
|
|
|
210
246
|
export type PhysicalAddressType = 'home' | 'visit' | 'postal'
|
|
211
247
|
|
|
212
|
-
export enum
|
|
248
|
+
export enum CredentialRole {
|
|
213
249
|
ISSUER = 'issuer',
|
|
214
250
|
VERIFIER = 'verifier',
|
|
215
251
|
HOLDER = 'holder',
|
|
@@ -235,3 +271,8 @@ export enum PartyOrigin {
|
|
|
235
271
|
INTERNAL = 'INTERNAL',
|
|
236
272
|
EXTERNAL = 'EXTERNAL',
|
|
237
273
|
}
|
|
274
|
+
|
|
275
|
+
export enum IdentityOrigin {
|
|
276
|
+
INTERNAL = 'INTERNAL',
|
|
277
|
+
EXTERNAL = 'EXTERNAL',
|
|
278
|
+
}
|