@sphereon/ssi-sdk.data-store 0.33.0 → 0.33.1-feature.vcdm2.4
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/AbstractContactStore.js +1 -5
- package/dist/contact/AbstractContactStore.js.map +1 -1
- package/dist/contact/ContactStore.js +544 -545
- package/dist/contact/ContactStore.js.map +1 -1
- package/dist/digitalCredential/AbstractDigitalCredentialStore.js +1 -5
- package/dist/digitalCredential/AbstractDigitalCredentialStore.js.map +1 -1
- package/dist/digitalCredential/DigitalCredentialStore.js +131 -142
- package/dist/digitalCredential/DigitalCredentialStore.js.map +1 -1
- package/dist/entities/contact/BaseConfigEntity.js +13 -14
- package/dist/entities/contact/BaseConfigEntity.js.map +1 -1
- package/dist/entities/contact/BaseContactEntity.js +24 -22
- package/dist/entities/contact/BaseContactEntity.js.map +1 -1
- package/dist/entities/contact/ConnectionEntity.js +23 -20
- package/dist/entities/contact/ConnectionEntity.js.map +1 -1
- package/dist/entities/contact/ContactMetadataItemEntity.js +38 -44
- package/dist/entities/contact/ContactMetadataItemEntity.js.map +1 -1
- package/dist/entities/contact/CorrelationIdentifierEntity.js +34 -42
- package/dist/entities/contact/CorrelationIdentifierEntity.js.map +1 -1
- package/dist/entities/contact/DidAuthConfigEntity.js +16 -14
- package/dist/entities/contact/DidAuthConfigEntity.js.map +1 -1
- package/dist/entities/contact/ElectronicAddressEntity.js +42 -47
- package/dist/entities/contact/ElectronicAddressEntity.js.map +1 -1
- package/dist/entities/contact/IdentityEntity.js +56 -57
- package/dist/entities/contact/IdentityEntity.js.map +1 -1
- package/dist/entities/contact/IdentityMetadataItemEntity.js +38 -44
- package/dist/entities/contact/IdentityMetadataItemEntity.js.map +1 -1
- package/dist/entities/contact/NaturalPersonEntity.js +35 -43
- package/dist/entities/contact/NaturalPersonEntity.js.map +1 -1
- package/dist/entities/contact/OpenIdConfigEntity.js +24 -18
- package/dist/entities/contact/OpenIdConfigEntity.js.map +1 -1
- package/dist/entities/contact/OrganizationEntity.js +28 -38
- package/dist/entities/contact/OrganizationEntity.js.map +1 -1
- package/dist/entities/contact/PartyEntity.js +57 -59
- package/dist/entities/contact/PartyEntity.js.map +1 -1
- package/dist/entities/contact/PartyRelationshipEntity.js +37 -43
- package/dist/entities/contact/PartyRelationshipEntity.js.map +1 -1
- package/dist/entities/contact/PartyTypeEntity.js +44 -49
- package/dist/entities/contact/PartyTypeEntity.js.map +1 -1
- package/dist/entities/contact/PhysicalAddressEntity.js +61 -60
- package/dist/entities/contact/PhysicalAddressEntity.js.map +1 -1
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js +63 -38
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js.map +1 -1
- package/dist/entities/eventLogger/AuditEventEntity.js +60 -37
- package/dist/entities/eventLogger/AuditEventEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js +25 -36
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js +48 -53
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js +35 -43
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialClaimsEntity.js +28 -38
- package/dist/entities/issuanceBranding/CredentialClaimsEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js +18 -18
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js +34 -42
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js +11 -11
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js +31 -40
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js +27 -24
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/TextAttributesEntity.js +20 -32
- package/dist/entities/issuanceBranding/TextAttributesEntity.js.map +1 -1
- package/dist/entities/machineState/MachineStateInfoEntity.js +31 -21
- package/dist/entities/machineState/MachineStateInfoEntity.js.map +1 -1
- package/dist/entities/oid4vcState/Oid4vcStateEntity.js +24 -18
- package/dist/entities/oid4vcState/Oid4vcStateEntity.js.map +1 -1
- package/dist/entities/presentationDefinition/PresentationDefinitionItemEntity.js +34 -27
- package/dist/entities/presentationDefinition/PresentationDefinitionItemEntity.js.map +1 -1
- package/dist/entities/statusList/StatusList2021EntryEntity.js +26 -22
- package/dist/entities/statusList/StatusList2021EntryEntity.js.map +1 -1
- package/dist/entities/statusList/StatusListEntities.js +48 -39
- package/dist/entities/statusList/StatusListEntities.js.map +1 -1
- package/dist/entities/validators/index.js +6 -10
- package/dist/entities/validators/index.js.map +1 -1
- package/dist/eventLogger/AbstractEventLoggerStore.js +1 -5
- package/dist/eventLogger/AbstractEventLoggerStore.js.map +1 -1
- package/dist/eventLogger/EventLoggerStore.js +50 -65
- package/dist/eventLogger/EventLoggerStore.js.map +1 -1
- package/dist/index.js +96 -163
- package/dist/index.js.map +1 -1
- package/dist/issuanceBranding/AbstractIssuanceBrandingStore.js +1 -5
- package/dist/issuanceBranding/AbstractIssuanceBrandingStore.js.map +1 -1
- package/dist/issuanceBranding/IssuanceBrandingStore.js +331 -333
- package/dist/issuanceBranding/IssuanceBrandingStore.js.map +1 -1
- package/dist/machineState/IAbstractMachineStateStore.js +1 -5
- package/dist/machineState/IAbstractMachineStateStore.js.map +1 -1
- package/dist/machineState/MachineStateStore.js +102 -122
- package/dist/machineState/MachineStateStore.js.map +1 -1
- package/dist/migrations/generic/1-CreateContacts.js +50 -72
- package/dist/migrations/generic/1-CreateContacts.js.map +1 -1
- package/dist/migrations/generic/10-CreatePresentationDefinitions.js +50 -72
- package/dist/migrations/generic/10-CreatePresentationDefinitions.js.map +1 -1
- package/dist/migrations/generic/11-FixCredentialClaimsReferenceUuid.js +52 -74
- package/dist/migrations/generic/11-FixCredentialClaimsReferenceUuid.js.map +1 -1
- package/dist/migrations/generic/2-CreateIssuanceBranding.js +50 -72
- package/dist/migrations/generic/2-CreateIssuanceBranding.js.map +1 -1
- package/dist/migrations/generic/3-CreateContacts.js +50 -72
- package/dist/migrations/generic/3-CreateContacts.js.map +1 -1
- package/dist/migrations/generic/4-CreateStatusList.js +56 -78
- package/dist/migrations/generic/4-CreateStatusList.js.map +1 -1
- package/dist/migrations/generic/5-CreateAuditEvents.js +50 -72
- package/dist/migrations/generic/5-CreateAuditEvents.js.map +1 -1
- package/dist/migrations/generic/6-CreateDigitalCredential.js +50 -72
- package/dist/migrations/generic/6-CreateDigitalCredential.js.map +1 -1
- package/dist/migrations/generic/7-CreateMachineStateStore.js +50 -72
- package/dist/migrations/generic/7-CreateMachineStateStore.js.map +1 -1
- package/dist/migrations/generic/8-CreateContacts.js +50 -72
- package/dist/migrations/generic/8-CreateContacts.js.map +1 -1
- package/dist/migrations/generic/9-CreateContacts.js +50 -72
- package/dist/migrations/generic/9-CreateContacts.js.map +1 -1
- package/dist/migrations/generic/index.js +30 -33
- package/dist/migrations/generic/index.js.map +1 -1
- package/dist/migrations/index.js +1 -12
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/internal-migrations-ormconfig.js +6 -8
- package/dist/migrations/internal-migrations-ormconfig.js.map +1 -1
- package/dist/migrations/postgres/1659463079428-CreateContacts.js +34 -53
- package/dist/migrations/postgres/1659463079428-CreateContacts.js.map +1 -1
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js +50 -69
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js.map +1 -1
- package/dist/migrations/postgres/1690925872592-CreateContacts.js +87 -106
- package/dist/migrations/postgres/1690925872592-CreateContacts.js.map +1 -1
- package/dist/migrations/postgres/1693866470001-CreateStatusList.js +16 -35
- package/dist/migrations/postgres/1693866470001-CreateStatusList.js.map +1 -1
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js +22 -41
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js.map +1 -1
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js +19 -38
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js.map +1 -1
- package/dist/migrations/postgres/1708797018115-CreateMachineStateStore.js +6 -25
- package/dist/migrations/postgres/1708797018115-CreateMachineStateStore.js.map +1 -1
- package/dist/migrations/postgres/1710438363001-CreateContacts.js +40 -59
- package/dist/migrations/postgres/1710438363001-CreateContacts.js.map +1 -1
- package/dist/migrations/postgres/1715761125001-CreateContacts.js +18 -37
- package/dist/migrations/postgres/1715761125001-CreateContacts.js.map +1 -1
- package/dist/migrations/postgres/1716475165345-CreatePresentationDefinitions.js +6 -25
- package/dist/migrations/postgres/1716475165345-CreatePresentationDefinitions.js.map +1 -1
- package/dist/migrations/postgres/1737110469001-UpdateStatusList.js +16 -35
- package/dist/migrations/postgres/1737110469001-UpdateStatusList.js.map +1 -1
- package/dist/migrations/postgres/1741895822987-FixCredentialClaimsReferencesUuid.js +8 -27
- package/dist/migrations/postgres/1741895822987-FixCredentialClaimsReferencesUuid.js.map +1 -1
- package/dist/migrations/sqlite/1659463069549-CreateContacts.js +56 -75
- package/dist/migrations/sqlite/1659463069549-CreateContacts.js.map +1 -1
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js +70 -89
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js.map +1 -1
- package/dist/migrations/sqlite/1690925872693-CreateContacts.js +120 -139
- package/dist/migrations/sqlite/1690925872693-CreateContacts.js.map +1 -1
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.js +12 -31
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.js.map +1 -1
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js +6 -25
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js.map +1 -1
- package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.js +7 -26
- package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.js.map +1 -1
- package/dist/migrations/sqlite/1708796002272-CreateMachineStateStore.js +6 -25
- package/dist/migrations/sqlite/1708796002272-CreateMachineStateStore.js.map +1 -1
- package/dist/migrations/sqlite/1710438363002-CreateContacts.js +43 -62
- package/dist/migrations/sqlite/1710438363002-CreateContacts.js.map +1 -1
- package/dist/migrations/sqlite/1715761125002-CreateContacts.js +18 -37
- package/dist/migrations/sqlite/1715761125002-CreateContacts.js.map +1 -1
- package/dist/migrations/sqlite/1716475165344-CreatePresentationDefinitions.js +6 -25
- package/dist/migrations/sqlite/1716475165344-CreatePresentationDefinitions.js.map +1 -1
- package/dist/migrations/sqlite/1737110469000-UpdateStatusList.js +20 -39
- package/dist/migrations/sqlite/1737110469000-UpdateStatusList.js.map +1 -1
- package/dist/migrations/sqlite/1741895822987-FixCredentialClaimsReferencesUuid.js +25 -44
- package/dist/migrations/sqlite/1741895822987-FixCredentialClaimsReferencesUuid.js.map +1 -1
- package/dist/presentationDefinition/AbstractPDStore.js +1 -5
- package/dist/presentationDefinition/AbstractPDStore.js.map +1 -1
- package/dist/presentationDefinition/PDStore.js +114 -123
- package/dist/presentationDefinition/PDStore.js.map +1 -1
- package/dist/statusList/IStatusListStore.js +1 -2
- package/dist/statusList/StatusListStore.js +196 -225
- package/dist/statusList/StatusListStore.js.map +1 -1
- package/dist/types/contact/IAbstractContactStore.js +1 -2
- package/dist/types/contact/contact.js +10 -13
- package/dist/types/contact/contact.js.map +1 -1
- package/dist/types/digitalCredential/IAbstractDigitalCredentialStore.js +1 -2
- package/dist/types/digitalCredential/digitalCredential.js +13 -16
- package/dist/types/digitalCredential/digitalCredential.js.map +1 -1
- package/dist/types/eventLogger/IAbstractEventLoggerStore.js +1 -2
- package/dist/types/eventLogger/eventLogger.js +1 -2
- package/dist/types/index.js +14 -30
- package/dist/types/index.js.map +1 -1
- package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.js +1 -2
- package/dist/types/issuanceBranding/issuanceBranding.js +1 -2
- package/dist/types/machineState/IAbstractMachineStateStore.js +1 -2
- package/dist/types/presentationDefinition/IAbstractPDStore.js +1 -2
- package/dist/types/presentationDefinition/presentationDefinition.js +1 -2
- package/dist/types/statusList/IAbstractStatusListStore.js +1 -2
- package/dist/types/statusList/statusList.js +1 -2
- package/dist/types/validation/validation.js +1 -2
- package/dist/utils/FormattingUtils.js +3 -7
- package/dist/utils/FormattingUtils.js.map +1 -1
- package/dist/utils/SortingUtils.js +1 -5
- package/dist/utils/SortingUtils.js.map +1 -1
- package/dist/utils/ValidatorUtils.js +2 -6
- package/dist/utils/ValidatorUtils.js.map +1 -1
- package/dist/utils/contact/MappingUtils.js +124 -150
- package/dist/utils/contact/MappingUtils.js.map +1 -1
- package/dist/utils/digitalCredential/MappingUtils.js +50 -47
- package/dist/utils/digitalCredential/MappingUtils.js.map +1 -1
- package/dist/utils/eventLogger/MappingUtils.js +60 -22
- package/dist/utils/eventLogger/MappingUtils.js.map +1 -1
- package/dist/utils/issuanceBranding/MappingUtils.js +71 -77
- package/dist/utils/issuanceBranding/MappingUtils.js.map +1 -1
- package/dist/utils/presentationDefinition/MappingUtils.js +9 -15
- package/dist/utils/presentationDefinition/MappingUtils.js.map +1 -1
- package/dist/utils/statusList/MappingUtils.js +27 -22
- package/dist/utils/statusList/MappingUtils.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,62 +7,53 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
validate() {
|
|
28
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
const validation = yield (0, class_validator_1.validate)(this);
|
|
30
|
-
if (validation.length > 0) {
|
|
31
|
-
const constraint = (0, ValidatorUtils_1.getConstraint)(validation[0]);
|
|
32
|
-
if (constraint) {
|
|
33
|
-
const message = Object.values(constraint)[0];
|
|
34
|
-
return Promise.reject(Error(message));
|
|
35
|
-
}
|
|
10
|
+
import { IsNotEmpty, validate } from 'class-validator';
|
|
11
|
+
import { BeforeInsert, BeforeUpdate, ChildEntity, Column } from 'typeorm';
|
|
12
|
+
import { getConstraint } from '../../utils/ValidatorUtils';
|
|
13
|
+
import { BaseContactEntity } from './BaseContactEntity';
|
|
14
|
+
let OrganizationEntity = class OrganizationEntity extends BaseContactEntity {
|
|
15
|
+
legalName;
|
|
16
|
+
displayName;
|
|
17
|
+
ownerId;
|
|
18
|
+
tenantId;
|
|
19
|
+
async validate() {
|
|
20
|
+
const validation = await validate(this);
|
|
21
|
+
if (validation.length > 0) {
|
|
22
|
+
const constraint = getConstraint(validation[0]);
|
|
23
|
+
if (constraint) {
|
|
24
|
+
const message = Object.values(constraint)[0];
|
|
25
|
+
return Promise.reject(Error(message));
|
|
36
26
|
}
|
|
37
|
-
}
|
|
27
|
+
}
|
|
38
28
|
}
|
|
39
29
|
};
|
|
40
|
-
exports.OrganizationEntity = OrganizationEntity;
|
|
41
30
|
__decorate([
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
Column('varchar', { name: 'legal_name', length: 255, nullable: false, unique: true }),
|
|
32
|
+
IsNotEmpty({ message: 'Blank legal names are not allowed' }),
|
|
44
33
|
__metadata("design:type", String)
|
|
45
34
|
], OrganizationEntity.prototype, "legalName", void 0);
|
|
46
35
|
__decorate([
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
Column('varchar', { name: 'display_name', length: 255, nullable: false, unique: false }),
|
|
37
|
+
IsNotEmpty({ message: 'Blank display names are not allowed' }),
|
|
49
38
|
__metadata("design:type", String)
|
|
50
39
|
], OrganizationEntity.prototype, "displayName", void 0);
|
|
51
40
|
__decorate([
|
|
52
|
-
|
|
41
|
+
Column('text', { name: 'owner_id', nullable: true }),
|
|
53
42
|
__metadata("design:type", String)
|
|
54
43
|
], OrganizationEntity.prototype, "ownerId", void 0);
|
|
55
44
|
__decorate([
|
|
56
|
-
|
|
45
|
+
Column('text', { name: 'tenant_id', nullable: true }),
|
|
57
46
|
__metadata("design:type", String)
|
|
58
47
|
], OrganizationEntity.prototype, "tenantId", void 0);
|
|
59
48
|
__decorate([
|
|
60
|
-
|
|
61
|
-
|
|
49
|
+
BeforeInsert(),
|
|
50
|
+
BeforeUpdate(),
|
|
62
51
|
__metadata("design:type", Function),
|
|
63
52
|
__metadata("design:paramtypes", []),
|
|
64
53
|
__metadata("design:returntype", Promise)
|
|
65
54
|
], OrganizationEntity.prototype, "validate", null);
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
OrganizationEntity = __decorate([
|
|
56
|
+
ChildEntity('Organization')
|
|
68
57
|
], OrganizationEntity);
|
|
58
|
+
export { OrganizationEntity };
|
|
69
59
|
//# sourceMappingURL=OrganizationEntity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrganizationEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/OrganizationEntity.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,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACxF,UAAU,CAAC,EAAE,OAAO,EAAE,qCAAqC,EAAE,CAAC;;uDAC3C;AAGpB;IADC,MAAM,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACrC;AAGhB;IADC,MAAM,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACrC;AAIX;IAFL,YAAY,EAAE;IACd,YAAY,EAAE;;;;kDAUd;AA1BU,kBAAkB;IAD9B,WAAW,CAAC,cAAc,CAAC;GACf,kBAAkB,CA2B9B"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,145 +7,144 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
10
|
+
import { BaseEntity, BeforeInsert, BeforeUpdate, Column, CreateDateColumn, Entity, JoinColumn, ManyToOne, OneToMany, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn, } from 'typeorm';
|
|
11
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config';
|
|
12
|
+
import { IdentityEntity } from './IdentityEntity';
|
|
13
|
+
import { validate } from 'class-validator';
|
|
14
|
+
import { PartyTypeEntity } from './PartyTypeEntity';
|
|
15
|
+
import { BaseContactEntity } from './BaseContactEntity';
|
|
16
|
+
import { PartyRelationshipEntity } from './PartyRelationshipEntity';
|
|
17
|
+
import { getConstraint } from '../../utils/ValidatorUtils';
|
|
18
|
+
import { ElectronicAddressEntity } from './ElectronicAddressEntity';
|
|
19
|
+
import { PhysicalAddressEntity } from './PhysicalAddressEntity';
|
|
20
|
+
let PartyEntity = class PartyEntity extends BaseEntity {
|
|
21
|
+
id;
|
|
22
|
+
uri;
|
|
23
|
+
ownerId;
|
|
24
|
+
tenantId;
|
|
25
|
+
identities;
|
|
26
|
+
electronicAddresses;
|
|
27
|
+
physicalAddresses;
|
|
28
|
+
partyType;
|
|
29
|
+
contact;
|
|
30
|
+
relationships;
|
|
31
|
+
createdAt;
|
|
32
|
+
lastUpdatedAt;
|
|
33
33
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
34
34
|
updateUpdatedDate() {
|
|
35
35
|
this.lastUpdatedAt = new Date();
|
|
36
36
|
}
|
|
37
|
-
validate() {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return Promise.reject(Error(message));
|
|
45
|
-
}
|
|
37
|
+
async validate() {
|
|
38
|
+
const validation = await validate(this);
|
|
39
|
+
if (validation.length > 0) {
|
|
40
|
+
const constraint = getConstraint(validation[0]);
|
|
41
|
+
if (constraint) {
|
|
42
|
+
const message = Object.values(constraint)[0];
|
|
43
|
+
return Promise.reject(Error(message));
|
|
46
44
|
}
|
|
47
|
-
}
|
|
45
|
+
}
|
|
48
46
|
}
|
|
49
47
|
};
|
|
50
|
-
exports.PartyEntity = PartyEntity;
|
|
51
48
|
__decorate([
|
|
52
|
-
|
|
49
|
+
PrimaryGeneratedColumn('uuid'),
|
|
53
50
|
__metadata("design:type", String)
|
|
54
51
|
], PartyEntity.prototype, "id", void 0);
|
|
55
52
|
__decorate([
|
|
56
|
-
|
|
53
|
+
Column('varchar', { name: 'uri', length: 255, nullable: true }),
|
|
57
54
|
__metadata("design:type", String)
|
|
58
55
|
], PartyEntity.prototype, "uri", void 0);
|
|
59
56
|
__decorate([
|
|
60
|
-
|
|
57
|
+
Column('text', { name: 'owner_id', nullable: true }),
|
|
61
58
|
__metadata("design:type", String)
|
|
62
59
|
], PartyEntity.prototype, "ownerId", void 0);
|
|
63
60
|
__decorate([
|
|
64
|
-
|
|
61
|
+
Column('text', { name: 'tenant_id', nullable: true }),
|
|
65
62
|
__metadata("design:type", String)
|
|
66
63
|
], PartyEntity.prototype, "tenantId", void 0);
|
|
67
64
|
__decorate([
|
|
68
|
-
|
|
65
|
+
OneToMany(() => IdentityEntity, (identity) => identity.party, {
|
|
69
66
|
cascade: true,
|
|
70
67
|
onDelete: 'CASCADE',
|
|
71
68
|
eager: true,
|
|
72
69
|
nullable: false,
|
|
73
70
|
}),
|
|
74
|
-
|
|
71
|
+
JoinColumn({ name: 'identity_id' }),
|
|
75
72
|
__metadata("design:type", Array)
|
|
76
73
|
], PartyEntity.prototype, "identities", void 0);
|
|
77
74
|
__decorate([
|
|
78
|
-
|
|
75
|
+
OneToMany(() => ElectronicAddressEntity, (electronicAddress) => electronicAddress.party, {
|
|
79
76
|
cascade: true,
|
|
80
77
|
onDelete: 'CASCADE',
|
|
81
78
|
eager: true,
|
|
82
79
|
nullable: false,
|
|
83
80
|
}),
|
|
84
|
-
|
|
81
|
+
JoinColumn({ name: 'electronic_address_id' }),
|
|
85
82
|
__metadata("design:type", Array)
|
|
86
83
|
], PartyEntity.prototype, "electronicAddresses", void 0);
|
|
87
84
|
__decorate([
|
|
88
|
-
|
|
85
|
+
OneToMany(() => PhysicalAddressEntity, (physicalAddress) => physicalAddress.party, {
|
|
89
86
|
cascade: true,
|
|
90
87
|
onDelete: 'CASCADE',
|
|
91
88
|
eager: true,
|
|
92
89
|
nullable: false,
|
|
93
90
|
}),
|
|
94
|
-
|
|
91
|
+
JoinColumn({ name: 'physical_address_id' }),
|
|
95
92
|
__metadata("design:type", Array)
|
|
96
93
|
], PartyEntity.prototype, "physicalAddresses", void 0);
|
|
97
94
|
__decorate([
|
|
98
|
-
|
|
95
|
+
ManyToOne(() => PartyTypeEntity, (contactType) => contactType.parties, {
|
|
99
96
|
cascade: true,
|
|
100
97
|
nullable: false,
|
|
101
98
|
eager: true,
|
|
102
99
|
}),
|
|
103
|
-
|
|
104
|
-
__metadata("design:type",
|
|
100
|
+
JoinColumn({ name: 'party_type_id' }),
|
|
101
|
+
__metadata("design:type", PartyTypeEntity)
|
|
105
102
|
], PartyEntity.prototype, "partyType", void 0);
|
|
106
103
|
__decorate([
|
|
107
|
-
|
|
104
|
+
OneToOne(() => BaseContactEntity, (contact) => contact.party, {
|
|
108
105
|
cascade: true,
|
|
109
106
|
onDelete: 'CASCADE',
|
|
110
107
|
eager: true,
|
|
111
108
|
nullable: false,
|
|
112
109
|
}),
|
|
113
|
-
__metadata("design:type",
|
|
110
|
+
__metadata("design:type", BaseContactEntity)
|
|
114
111
|
], PartyEntity.prototype, "contact", void 0);
|
|
115
112
|
__decorate([
|
|
116
|
-
|
|
113
|
+
OneToMany(() => PartyRelationshipEntity, (relationship) => relationship.left, {
|
|
117
114
|
cascade: true,
|
|
118
115
|
onDelete: 'CASCADE',
|
|
119
116
|
eager: true,
|
|
120
117
|
nullable: false,
|
|
121
118
|
}),
|
|
122
|
-
|
|
119
|
+
JoinColumn({ name: 'relationship_id' }),
|
|
123
120
|
__metadata("design:type", Array)
|
|
124
121
|
], PartyEntity.prototype, "relationships", void 0);
|
|
125
122
|
__decorate([
|
|
126
|
-
|
|
123
|
+
CreateDateColumn({ name: 'created_at', nullable: false, type: typeOrmDateTime() }),
|
|
127
124
|
__metadata("design:type", Date)
|
|
128
125
|
], PartyEntity.prototype, "createdAt", void 0);
|
|
129
126
|
__decorate([
|
|
130
|
-
|
|
127
|
+
UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: typeOrmDateTime() }),
|
|
131
128
|
__metadata("design:type", Date
|
|
132
129
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
133
130
|
)
|
|
134
131
|
], PartyEntity.prototype, "lastUpdatedAt", void 0);
|
|
135
132
|
__decorate([
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
BeforeInsert(),
|
|
134
|
+
BeforeUpdate(),
|
|
138
135
|
__metadata("design:type", Function),
|
|
139
136
|
__metadata("design:paramtypes", []),
|
|
140
137
|
__metadata("design:returntype", void 0)
|
|
141
138
|
], PartyEntity.prototype, "updateUpdatedDate", null);
|
|
142
139
|
__decorate([
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
BeforeInsert(),
|
|
141
|
+
BeforeUpdate(),
|
|
145
142
|
__metadata("design:type", Function),
|
|
146
143
|
__metadata("design:paramtypes", []),
|
|
147
144
|
__metadata("design:returntype", Promise)
|
|
148
145
|
], PartyEntity.prototype, "validate", null);
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
PartyEntity = __decorate([
|
|
147
|
+
Entity('Party')
|
|
151
148
|
], PartyEntity);
|
|
149
|
+
export { PartyEntity };
|
|
152
150
|
//# sourceMappingURL=PartyEntity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PartyEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/PartyEntity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PartyEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/PartyEntity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,UAAU,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AAA;AAGhB;IADC,gBAAgB,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,CAAC;8BACxE,IAAI;IAEpB,qHAAqH;;kDAFjG;AAKpB;IAFC,YAAY,EAAE;IACd,YAAY,EAAE;;;;oDAGd;AAIK;IAFL,YAAY,EAAE;IACd,YAAY,EAAE;;;;2CAUd;AAzFU,WAAW;IADvB,MAAM,CAAC,OAAO,CAAC;GACH,WAAW,CA0FvB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,97 +7,92 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.PartyRelationshipEntity = void 0;
|
|
22
|
-
const typeorm_1 = require("typeorm");
|
|
23
|
-
const ssi_sdk_agent_config_1 = require("@sphereon/ssi-sdk.agent-config");
|
|
24
|
-
const PartyEntity_1 = require("./PartyEntity");
|
|
10
|
+
import { Entity, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn, ManyToOne, Column, Index, BeforeInsert, BeforeUpdate, JoinColumn, } from 'typeorm';
|
|
11
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config';
|
|
12
|
+
import { PartyEntity } from './PartyEntity';
|
|
25
13
|
let PartyRelationshipEntity = class PartyRelationshipEntity {
|
|
14
|
+
id;
|
|
15
|
+
left;
|
|
16
|
+
leftId;
|
|
17
|
+
right;
|
|
18
|
+
rightId;
|
|
19
|
+
ownerId;
|
|
20
|
+
tenantId;
|
|
21
|
+
createdAt;
|
|
22
|
+
lastUpdatedAt;
|
|
26
23
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
27
24
|
updateUpdatedDate() {
|
|
28
25
|
this.lastUpdatedAt = new Date();
|
|
29
26
|
}
|
|
30
|
-
checkRelationshipSides() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return Promise.reject(Error('Cannot use the same id for both sides of the relationship'));
|
|
35
|
-
}
|
|
36
|
-
});
|
|
27
|
+
async checkRelationshipSides() {
|
|
28
|
+
if ((this.left?.id ?? this.leftId) === (this.right?.id ?? this.rightId)) {
|
|
29
|
+
return Promise.reject(Error('Cannot use the same id for both sides of the relationship'));
|
|
30
|
+
}
|
|
37
31
|
}
|
|
38
32
|
};
|
|
39
|
-
exports.PartyRelationshipEntity = PartyRelationshipEntity;
|
|
40
33
|
__decorate([
|
|
41
|
-
|
|
34
|
+
PrimaryGeneratedColumn('uuid'),
|
|
42
35
|
__metadata("design:type", String)
|
|
43
36
|
], PartyRelationshipEntity.prototype, "id", void 0);
|
|
44
37
|
__decorate([
|
|
45
|
-
|
|
38
|
+
ManyToOne(() => PartyEntity, {
|
|
46
39
|
nullable: false,
|
|
47
40
|
onDelete: 'CASCADE',
|
|
48
41
|
}),
|
|
49
|
-
|
|
50
|
-
__metadata("design:type",
|
|
42
|
+
JoinColumn({ name: 'left_id' }),
|
|
43
|
+
__metadata("design:type", PartyEntity)
|
|
51
44
|
], PartyRelationshipEntity.prototype, "left", void 0);
|
|
52
45
|
__decorate([
|
|
53
|
-
|
|
46
|
+
Column('text', { name: 'left_id', nullable: false }),
|
|
54
47
|
__metadata("design:type", String)
|
|
55
48
|
], PartyRelationshipEntity.prototype, "leftId", void 0);
|
|
56
49
|
__decorate([
|
|
57
|
-
|
|
50
|
+
ManyToOne(() => PartyEntity, {
|
|
58
51
|
nullable: false,
|
|
59
52
|
onDelete: 'CASCADE',
|
|
60
53
|
}),
|
|
61
|
-
|
|
62
|
-
__metadata("design:type",
|
|
54
|
+
JoinColumn({ name: 'right_id' }),
|
|
55
|
+
__metadata("design:type", PartyEntity)
|
|
63
56
|
], PartyRelationshipEntity.prototype, "right", void 0);
|
|
64
57
|
__decorate([
|
|
65
|
-
|
|
58
|
+
Column('text', { name: 'right_id', nullable: false }),
|
|
66
59
|
__metadata("design:type", String)
|
|
67
60
|
], PartyRelationshipEntity.prototype, "rightId", void 0);
|
|
68
61
|
__decorate([
|
|
69
|
-
|
|
62
|
+
Column('text', { name: 'owner_id', nullable: true }),
|
|
70
63
|
__metadata("design:type", String)
|
|
71
64
|
], PartyRelationshipEntity.prototype, "ownerId", void 0);
|
|
72
65
|
__decorate([
|
|
73
|
-
|
|
66
|
+
Column('text', { name: 'tenant_id', nullable: true }),
|
|
74
67
|
__metadata("design:type", String)
|
|
75
68
|
], PartyRelationshipEntity.prototype, "tenantId", void 0);
|
|
76
69
|
__decorate([
|
|
77
|
-
|
|
70
|
+
CreateDateColumn({ name: 'created_at', nullable: false, type: typeOrmDateTime() }),
|
|
78
71
|
__metadata("design:type", Date)
|
|
79
72
|
], PartyRelationshipEntity.prototype, "createdAt", void 0);
|
|
80
73
|
__decorate([
|
|
81
|
-
|
|
74
|
+
UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: typeOrmDateTime() }),
|
|
82
75
|
__metadata("design:type", Date
|
|
83
76
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
84
77
|
)
|
|
85
78
|
], PartyRelationshipEntity.prototype, "lastUpdatedAt", void 0);
|
|
86
79
|
__decorate([
|
|
87
|
-
|
|
88
|
-
|
|
80
|
+
BeforeInsert(),
|
|
81
|
+
BeforeUpdate(),
|
|
89
82
|
__metadata("design:type", Function),
|
|
90
83
|
__metadata("design:paramtypes", []),
|
|
91
84
|
__metadata("design:returntype", void 0)
|
|
92
85
|
], PartyRelationshipEntity.prototype, "updateUpdatedDate", null);
|
|
93
86
|
__decorate([
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
BeforeInsert(),
|
|
88
|
+
BeforeUpdate(),
|
|
96
89
|
__metadata("design:type", Function),
|
|
97
90
|
__metadata("design:paramtypes", []),
|
|
98
91
|
__metadata("design:returntype", Promise)
|
|
99
92
|
], PartyRelationshipEntity.prototype, "checkRelationshipSides", null);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
93
|
+
PartyRelationshipEntity = __decorate([
|
|
94
|
+
Entity('PartyRelationship'),
|
|
95
|
+
Index('IDX_PartyRelationship_left_right', ['left', 'right'], { unique: true })
|
|
103
96
|
], PartyRelationshipEntity);
|
|
97
|
+
export { PartyRelationshipEntity };
|
|
104
98
|
//# sourceMappingURL=PartyRelationshipEntity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PartyRelationshipEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/PartyRelationshipEntity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PartyRelationshipEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/PartyRelationshipEntity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,MAAM,EACN,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,MAAM,EACN,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,UA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