@sphereon/ssi-sdk.data-store 0.21.0 → 0.21.1-unstable.5
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.d.ts +2 -1
- package/dist/entities/contact/PartyTypeEntity.d.ts.map +1 -1
- package/dist/entities/contact/PartyTypeEntity.js +4 -0
- package/dist/entities/contact/PartyTypeEntity.js.map +1 -1
- 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 +2 -1
- package/dist/migrations/generic/index.js.map +1 -1
- package/dist/migrations/postgres/1710941091795-CreateContacts.d.ts +7 -0
- package/dist/migrations/postgres/1710941091795-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/postgres/1710941091795-CreateContacts.js +31 -0
- package/dist/migrations/postgres/1710941091795-CreateContacts.js.map +1 -0
- package/dist/migrations/sqlite/1710941197348-CreateContacts.d.ts +7 -0
- package/dist/migrations/sqlite/1710941197348-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/sqlite/1710941197348-CreateContacts.js +30 -0
- package/dist/migrations/sqlite/1710941197348-CreateContacts.js.map +1 -0
- package/dist/types/contact/IAbstractContactStore.d.ts +2 -1
- package/dist/types/contact/IAbstractContactStore.d.ts.map +1 -1
- package/dist/types/contact/contact.d.ts +5 -0
- package/dist/types/contact/contact.d.ts.map +1 -1
- package/dist/types/contact/contact.js +6 -1
- package/dist/types/contact/contact.js.map +1 -1
- package/dist/utils/contact/MappingUtils.d.ts.map +1 -1
- package/dist/utils/contact/MappingUtils.js +2 -0
- package/dist/utils/contact/MappingUtils.js.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/contact.entities.test.ts +66 -16
- package/src/__tests__/contact.store.test.ts +76 -3
- package/src/entities/contact/PartyTypeEntity.ts +4 -1
- package/src/migrations/generic/9-CreateContacts.ts +66 -0
- package/src/migrations/generic/index.ts +2 -1
- package/src/migrations/postgres/1710941091795-CreateContacts.ts +15 -0
- package/src/migrations/sqlite/1710941197348-CreateContacts.ts +14 -0
- package/src/types/contact/IAbstractContactStore.ts +2 -0
- package/src/types/contact/contact.ts +6 -0
- package/src/utils/contact/MappingUtils.ts +2 -0
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
}
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
PartialPartyType,
|
|
14
14
|
PartialPhysicalAddress,
|
|
15
15
|
Party,
|
|
16
|
+
PartyOriginEnum,
|
|
16
17
|
PartyRelationship,
|
|
17
18
|
PartyType,
|
|
18
19
|
PartyTypeEnum,
|
|
@@ -95,6 +96,7 @@ export type UpdateRelationshipArgs = {
|
|
|
95
96
|
|
|
96
97
|
export type AddPartyTypeArgs = {
|
|
97
98
|
type: PartyTypeEnum
|
|
99
|
+
origin: PartyOriginEnum
|
|
98
100
|
name: string
|
|
99
101
|
tenantId: string
|
|
100
102
|
description?: string
|
|
@@ -150,9 +150,15 @@ export type Contact = NaturalPerson | Organization
|
|
|
150
150
|
export type NonPersistedContact = NonPersistedNaturalPerson | NonPersistedOrganization
|
|
151
151
|
export type PartialContact = PartialNaturalPerson | PartialOrganization
|
|
152
152
|
|
|
153
|
+
export enum PartyOriginEnum {
|
|
154
|
+
INTERNAL = 'internal',
|
|
155
|
+
EXTERNAL = 'external',
|
|
156
|
+
}
|
|
157
|
+
|
|
153
158
|
export type PartyType = {
|
|
154
159
|
id: string
|
|
155
160
|
type: PartyTypeEnum
|
|
161
|
+
origin: PartyOriginEnum
|
|
156
162
|
name: string
|
|
157
163
|
tenantId: string
|
|
158
164
|
description?: string
|
|
@@ -324,6 +324,7 @@ export const partyTypeEntityFrom = (args: NonPersistedPartyType): PartyTypeEntit
|
|
|
324
324
|
partyTypeEntity.id = args.id
|
|
325
325
|
}
|
|
326
326
|
partyTypeEntity.type = args.type
|
|
327
|
+
partyTypeEntity.origin = args.origin
|
|
327
328
|
partyTypeEntity.name = args.name
|
|
328
329
|
partyTypeEntity.description = args.description
|
|
329
330
|
partyTypeEntity.tenantId = args.tenantId
|
|
@@ -335,6 +336,7 @@ export const partyTypeFrom = (partyType: PartyTypeEntity): PartyType => {
|
|
|
335
336
|
return {
|
|
336
337
|
id: partyType.id,
|
|
337
338
|
type: partyType.type,
|
|
339
|
+
origin: partyType.origin,
|
|
338
340
|
name: partyType.name,
|
|
339
341
|
tenantId: partyType.tenantId,
|
|
340
342
|
description: partyType.description,
|