@sphereon/ssi-sdk.data-store 0.18.2-unstable.6 → 0.18.2-unstable.64
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/LICENSE +201 -201
- package/README.md +77 -77
- package/dist/contact/AbstractContactStore.d.ts +23 -23
- package/dist/contact/AbstractContactStore.js +6 -6
- package/dist/contact/ContactStore.d.ts +32 -32
- package/dist/contact/ContactStore.js +365 -365
- package/dist/entities/contact/BaseConfigEntity.d.ts +6 -6
- package/dist/entities/contact/BaseConfigEntity.js +33 -33
- package/dist/entities/contact/BaseContactEntity.d.ts +9 -9
- package/dist/entities/contact/BaseContactEntity.js +53 -53
- package/dist/entities/contact/ConnectionEntity.d.ts +10 -10
- package/dist/entities/contact/ConnectionEntity.js +46 -46
- package/dist/entities/contact/CorrelationIdentifierEntity.d.ts +10 -10
- package/dist/entities/contact/CorrelationIdentifierEntity.js +71 -71
- package/dist/entities/contact/DidAuthConfigEntity.d.ts +6 -6
- package/dist/entities/contact/DidAuthConfigEntity.js +32 -32
- package/dist/entities/contact/ElectronicAddressEntity.d.ts +13 -13
- package/dist/entities/contact/ElectronicAddressEntity.js +91 -91
- package/dist/entities/contact/IdentityEntity.d.ts +20 -20
- package/dist/entities/contact/IdentityEntity.js +128 -128
- package/dist/entities/contact/IdentityMetadataItemEntity.d.ts +9 -9
- package/dist/entities/contact/IdentityMetadataItemEntity.js +68 -68
- package/dist/entities/contact/NaturalPersonEntity.d.ts +8 -8
- package/dist/entities/contact/NaturalPersonEntity.js +71 -71
- package/dist/entities/contact/OpenIdConfigEntity.d.ts +10 -10
- package/dist/entities/contact/OpenIdConfigEntity.js +48 -48
- package/dist/entities/contact/OrganizationEntity.d.ts +8 -8
- package/dist/entities/contact/OrganizationEntity.js +66 -66
- package/dist/entities/contact/PartyEntity.d.ts +19 -19
- package/dist/entities/contact/PartyEntity.js +131 -131
- package/dist/entities/contact/PartyRelationshipEntity.d.ts +12 -12
- package/dist/entities/contact/PartyRelationshipEntity.js +94 -94
- package/dist/entities/contact/PartyTypeEntity.d.ts +14 -14
- package/dist/entities/contact/PartyTypeEntity.js +103 -103
- package/dist/entities/eventLogger/AuditEventEntity.d.ts +26 -26
- package/dist/entities/eventLogger/AuditEventEntity.js +123 -123
- package/dist/entities/eventLogger/AuditEventEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts +10 -10
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js +73 -73
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.d.ts +17 -17
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js +119 -119
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts +14 -14
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js +101 -101
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts +8 -8
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js +48 -48
- package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts +13 -13
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js +91 -91
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts +8 -8
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js +38 -38
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts +13 -13
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js +94 -94
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts +8 -8
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js +48 -48
- package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts +8 -8
- package/dist/entities/issuanceBranding/TextAttributesEntity.js +61 -61
- package/dist/entities/statusList2021/StatusList2021Entity.d.ts +18 -18
- package/dist/entities/statusList2021/StatusList2021Entity.js +114 -114
- package/dist/entities/statusList2021/StatusList2021EntryEntity.d.ts +10 -10
- package/dist/entities/statusList2021/StatusList2021EntryEntity.js +50 -50
- package/dist/entities/validators/index.d.ts +6 -6
- package/dist/entities/validators/index.js +26 -26
- package/dist/entities/xstatePersistence/StateEntity.d.ts +14 -0
- package/dist/entities/xstatePersistence/StateEntity.d.ts.map +1 -0
- package/dist/entities/xstatePersistence/StateEntity.js +62 -0
- package/dist/entities/xstatePersistence/StateEntity.js.map +1 -0
- package/dist/eventLogger/AbstractEventLoggerStore.d.ts +6 -6
- package/dist/eventLogger/AbstractEventLoggerStore.js +6 -6
- package/dist/eventLogger/EventLoggerStore.d.ts +12 -12
- package/dist/eventLogger/EventLoggerStore.js +43 -43
- package/dist/index.d.ts +45 -41
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +141 -127
- package/dist/index.js.map +1 -1
- package/dist/issuanceBranding/AbstractIssuanceBrandingStore.d.ts +19 -19
- package/dist/issuanceBranding/AbstractIssuanceBrandingStore.js +6 -6
- package/dist/issuanceBranding/IssuanceBrandingStore.d.ts +30 -30
- package/dist/issuanceBranding/IssuanceBrandingStore.js +374 -374
- package/dist/migrations/generic/1-CreateContacts.d.ts +6 -6
- package/dist/migrations/generic/1-CreateContacts.js +77 -77
- package/dist/migrations/generic/2-CreateIssuanceBranding.d.ts +6 -6
- package/dist/migrations/generic/2-CreateIssuanceBranding.js +77 -77
- package/dist/migrations/generic/3-CreateContacts.d.ts +6 -6
- package/dist/migrations/generic/3-CreateContacts.js +77 -77
- package/dist/migrations/generic/4-CreateStatusList.d.ts +6 -6
- package/dist/migrations/generic/4-CreateStatusList.js +71 -71
- package/dist/migrations/generic/5-CreateAuditEvents.d.ts +6 -6
- package/dist/migrations/generic/5-CreateAuditEvents.js +77 -77
- package/dist/migrations/generic/{2-CreateContacts.d.ts → 6-CreateXStateStore.d.ts} +2 -2
- package/dist/migrations/generic/6-CreateXStateStore.d.ts.map +1 -0
- package/dist/migrations/generic/{2-CreateContacts.js → 6-CreateXStateStore.js} +13 -13
- package/dist/migrations/generic/6-CreateXStateStore.js.map +1 -0
- package/dist/migrations/generic/index.d.ts +18 -16
- package/dist/migrations/generic/index.d.ts.map +1 -1
- package/dist/migrations/generic/index.js +30 -27
- package/dist/migrations/generic/index.js.map +1 -1
- package/dist/migrations/index.d.ts +1 -1
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +10 -5
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/internal-migrations-ormconfig.d.ts +6 -6
- package/dist/migrations/internal-migrations-ormconfig.js +26 -26
- package/dist/migrations/postgres/1659463079428-CreateContacts.d.ts +6 -6
- package/dist/migrations/postgres/1659463079428-CreateContacts.js +56 -56
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.d.ts +6 -6
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js +68 -68
- package/dist/migrations/postgres/1690925872592-CreateContacts.d.ts +6 -6
- package/dist/migrations/postgres/1690925872592-CreateContacts.js +68 -68
- package/dist/migrations/postgres/1693866470001-CreateStatusList.d.ts +6 -6
- package/dist/migrations/postgres/1693866470001-CreateStatusList.js +31 -31
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.d.ts +6 -6
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js +42 -42
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js.map +1 -1
- package/dist/migrations/postgres/1708097018115-CreateXStateStore.d.ts +7 -0
- package/dist/migrations/postgres/1708097018115-CreateXStateStore.d.ts.map +1 -0
- package/dist/migrations/postgres/1708097018115-CreateXStateStore.js +32 -0
- package/dist/migrations/postgres/1708097018115-CreateXStateStore.js.map +1 -0
- package/dist/migrations/sqlite/1659463069549-CreateContacts.d.ts +6 -6
- package/dist/migrations/sqlite/1659463069549-CreateContacts.js +78 -78
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.d.ts +6 -6
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js +88 -88
- package/dist/migrations/sqlite/1690925872693-CreateContacts.d.ts +6 -6
- package/dist/migrations/sqlite/1690925872693-CreateContacts.js +107 -107
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.d.ts +6 -6
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.js +31 -31
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.d.ts +6 -6
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js +28 -28
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js.map +1 -1
- package/dist/migrations/sqlite/1708096002272-CreateXStateStore.d.ts +7 -0
- package/dist/migrations/sqlite/1708096002272-CreateXStateStore.d.ts.map +1 -0
- package/dist/migrations/sqlite/1708096002272-CreateXStateStore.js +30 -0
- package/dist/migrations/sqlite/1708096002272-CreateXStateStore.js.map +1 -0
- package/dist/statusList/IStatusListStore.d.ts +19 -19
- package/dist/statusList/IStatusListStore.js +2 -2
- package/dist/statusList/StatusListStore.d.ts +35 -35
- package/dist/statusList/StatusListStore.js +212 -212
- package/dist/types/contact/IAbstractContactStore.d.ts +74 -74
- package/dist/types/contact/IAbstractContactStore.js +2 -2
- package/dist/types/contact/contact.d.ts +173 -173
- package/dist/types/contact/contact.js +25 -25
- package/dist/types/eventLogger/IAbstractEventLoggerStore.d.ts +9 -9
- package/dist/types/eventLogger/IAbstractEventLoggerStore.js +2 -2
- package/dist/types/eventLogger/eventLogger.d.ts +2 -2
- package/dist/types/eventLogger/eventLogger.js +2 -2
- package/dist/types/index.d.ts +10 -9
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +26 -25
- package/dist/types/index.js.map +1 -1
- package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.d.ts +58 -58
- package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.js +2 -2
- package/dist/types/issuanceBranding/issuanceBranding.d.ts +114 -114
- package/dist/types/issuanceBranding/issuanceBranding.js +2 -2
- package/dist/types/statusList/IAbstractStatusListStore.d.ts +37 -37
- package/dist/types/statusList/IAbstractStatusListStore.js +2 -2
- package/dist/types/statusList/statusList.d.ts +24 -24
- package/dist/types/statusList/statusList.js +2 -2
- package/dist/types/validation/validation.d.ts +3 -3
- package/dist/types/validation/validation.js +2 -2
- package/dist/types/xstatePersistence/IAbstractXStateStore.d.ts +23 -0
- package/dist/types/xstatePersistence/IAbstractXStateStore.d.ts.map +1 -0
- package/dist/types/xstatePersistence/IAbstractXStateStore.js +3 -0
- package/dist/types/xstatePersistence/IAbstractXStateStore.js.map +1 -0
- package/dist/utils/ValidatorUtils.d.ts +3 -3
- package/dist/utils/ValidatorUtils.js +12 -12
- package/dist/utils/contact/MappingUtils.d.ts +46 -46
- package/dist/utils/contact/MappingUtils.js +290 -290
- package/dist/xstatePersistence/IAbstractXStateStore.d.ts +7 -0
- package/dist/xstatePersistence/IAbstractXStateStore.d.ts.map +1 -0
- package/dist/xstatePersistence/IAbstractXStateStore.js +7 -0
- package/dist/xstatePersistence/IAbstractXStateStore.js.map +1 -0
- package/dist/xstatePersistence/XStateStore.d.ts +13 -0
- package/dist/xstatePersistence/XStateStore.d.ts.map +1 -0
- package/dist/xstatePersistence/XStateStore.js +67 -0
- package/dist/xstatePersistence/XStateStore.js.map +1 -0
- package/package.json +4 -4
- package/src/__tests__/eventLogger.entities.test.ts +73 -73
- package/src/__tests__/eventLogger.store.test.ts +136 -136
- package/src/__tests__/xstatePersistence.entities.test.ts +47 -0
- package/src/__tests__/xstatePersistence.store.test.ts +66 -0
- package/src/contact/ContactStore.ts +501 -501
- package/src/entities/eventLogger/AuditEventEntity.ts +99 -99
- package/src/entities/statusList2021/StatusList2021Entity.ts +96 -96
- package/src/entities/xstatePersistence/StateEntity.ts +39 -0
- package/src/eventLogger/AbstractEventLoggerStore.ts +7 -7
- package/src/eventLogger/EventLoggerStore.ts +62 -62
- package/src/index.ts +128 -113
- package/src/migrations/generic/1-CreateContacts.ts +66 -66
- package/src/migrations/generic/2-CreateIssuanceBranding.ts +64 -64
- package/src/migrations/generic/3-CreateContacts.ts +66 -66
- package/src/migrations/generic/4-CreateStatusList.ts +54 -54
- package/src/migrations/generic/5-CreateAuditEvents.ts +66 -66
- package/src/migrations/generic/6-CreateXStateStore.ts +66 -0
- package/src/migrations/generic/index.ts +30 -27
- package/src/migrations/index.ts +8 -1
- package/src/migrations/postgres/1693866470001-CreateStatusList.ts +24 -24
- package/src/migrations/postgres/1701634812183-CreateAuditEvents.ts +33 -33
- package/src/migrations/postgres/1708097018115-CreateXStateStore.ts +18 -0
- package/src/migrations/sqlite/1690925872693-CreateContacts.ts +163 -163
- package/src/migrations/sqlite/1701634819487-CreateAuditEvents.ts +15 -15
- package/src/migrations/sqlite/1708096002272-CreateXStateStore.ts +16 -0
- package/src/types/eventLogger/IAbstractEventLoggerStore.ts +12 -12
- package/src/types/eventLogger/eventLogger.ts +3 -3
- package/src/types/index.ts +10 -9
- package/src/types/xstatePersistence/IAbstractXStateStore.ts +27 -0
- package/src/xstatePersistence/IAbstractXStateStore.ts +7 -0
- package/src/xstatePersistence/XStateStore.ts +56 -0
- package/dist/entities/contact/ContactEntity.d.ts +0 -16
- package/dist/entities/contact/ContactEntity.d.ts.map +0 -1
- package/dist/entities/contact/ContactEntity.js +0 -164
- package/dist/entities/contact/ContactEntity.js.map +0 -1
- package/dist/migrations/generic/1-CreateIssuanceBranding.d.ts +0 -7
- package/dist/migrations/generic/1-CreateIssuanceBranding.d.ts.map +0 -1
- package/dist/migrations/generic/1-CreateIssuanceBranding.js +0 -96
- package/dist/migrations/generic/1-CreateIssuanceBranding.js.map +0 -1
- package/dist/migrations/generic/2-CreateContacts.d.ts.map +0 -1
- package/dist/migrations/generic/2-CreateContacts.js.map +0 -1
- package/dist/migrations/generic/3-CreateStatusList.d.ts +0 -7
- package/dist/migrations/generic/3-CreateStatusList.d.ts.map +0 -1
- package/dist/migrations/generic/3-CreateStatusList.js +0 -72
- package/dist/migrations/generic/3-CreateStatusList.js.map +0 -1
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.d.ts +0 -7
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.d.ts.map +0 -1
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.js +0 -32
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.js.map +0 -1
- package/dist/migrations/postgres/uuid.d.ts +0 -3
- package/dist/migrations/postgres/uuid.d.ts.map +0 -1
- package/dist/migrations/postgres/uuid.js +0 -25
- package/dist/migrations/postgres/uuid.js.map +0 -1
|
@@ -1,132 +1,132 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
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.PartyEntity = void 0;
|
|
22
|
-
const typeorm_1 = require("typeorm");
|
|
23
|
-
const IdentityEntity_1 = require("./IdentityEntity");
|
|
24
|
-
const class_validator_1 = require("class-validator");
|
|
25
|
-
const PartyTypeEntity_1 = require("./PartyTypeEntity");
|
|
26
|
-
const BaseContactEntity_1 = require("./BaseContactEntity");
|
|
27
|
-
const PartyRelationshipEntity_1 = require("./PartyRelationshipEntity");
|
|
28
|
-
const ValidatorUtils_1 = require("../../utils/ValidatorUtils");
|
|
29
|
-
const ElectronicAddressEntity_1 = require("./ElectronicAddressEntity");
|
|
30
|
-
let PartyEntity = class PartyEntity extends typeorm_1.BaseEntity {
|
|
31
|
-
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
32
|
-
updateUpdatedDate() {
|
|
33
|
-
this.lastUpdatedAt = new Date();
|
|
34
|
-
}
|
|
35
|
-
validate() {
|
|
36
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
const validation = yield (0, class_validator_1.validate)(this);
|
|
38
|
-
if (validation.length > 0) {
|
|
39
|
-
const constraint = (0, ValidatorUtils_1.getConstraint)(validation[0]);
|
|
40
|
-
if (constraint) {
|
|
41
|
-
const message = Object.values(constraint)[0];
|
|
42
|
-
return Promise.reject(Error(message));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
__decorate([
|
|
49
|
-
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
50
|
-
__metadata("design:type", String)
|
|
51
|
-
], PartyEntity.prototype, "id", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
(0, typeorm_1.Column)({ name: 'uri', length: 255 }),
|
|
54
|
-
__metadata("design:type", String)
|
|
55
|
-
], PartyEntity.prototype, "uri", void 0);
|
|
56
|
-
__decorate([
|
|
57
|
-
(0, typeorm_1.OneToMany)(() => IdentityEntity_1.IdentityEntity, (identity) => identity.party, {
|
|
58
|
-
cascade: true,
|
|
59
|
-
onDelete: 'CASCADE',
|
|
60
|
-
eager: true,
|
|
61
|
-
nullable: false,
|
|
62
|
-
}),
|
|
63
|
-
(0, typeorm_1.JoinColumn)({ name: 'identity_id' }),
|
|
64
|
-
__metadata("design:type", Array)
|
|
65
|
-
], PartyEntity.prototype, "identities", void 0);
|
|
66
|
-
__decorate([
|
|
67
|
-
(0, typeorm_1.OneToMany)(() => ElectronicAddressEntity_1.ElectronicAddressEntity, (electronicAddress) => electronicAddress.party, {
|
|
68
|
-
cascade: true,
|
|
69
|
-
onDelete: 'CASCADE',
|
|
70
|
-
eager: true,
|
|
71
|
-
nullable: false,
|
|
72
|
-
}),
|
|
73
|
-
(0, typeorm_1.JoinColumn)({ name: 'electronic_address_id' }),
|
|
74
|
-
__metadata("design:type", Array)
|
|
75
|
-
], PartyEntity.prototype, "electronicAddresses", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
(0, typeorm_1.ManyToOne)(() => PartyTypeEntity_1.PartyTypeEntity, (contactType) => contactType.parties, {
|
|
78
|
-
cascade: true,
|
|
79
|
-
nullable: false,
|
|
80
|
-
eager: true,
|
|
81
|
-
}),
|
|
82
|
-
(0, typeorm_1.JoinColumn)({ name: 'party_type_id' }),
|
|
83
|
-
__metadata("design:type", PartyTypeEntity_1.PartyTypeEntity)
|
|
84
|
-
], PartyEntity.prototype, "partyType", void 0);
|
|
85
|
-
__decorate([
|
|
86
|
-
(0, typeorm_1.OneToOne)(() => BaseContactEntity_1.BaseContactEntity, (contact) => contact.party, {
|
|
87
|
-
cascade: true,
|
|
88
|
-
onDelete: 'CASCADE',
|
|
89
|
-
eager: true,
|
|
90
|
-
nullable: false,
|
|
91
|
-
}),
|
|
92
|
-
__metadata("design:type", BaseContactEntity_1.BaseContactEntity)
|
|
93
|
-
], PartyEntity.prototype, "contact", void 0);
|
|
94
|
-
__decorate([
|
|
95
|
-
(0, typeorm_1.OneToMany)(() => PartyRelationshipEntity_1.PartyRelationshipEntity, (relationship) => relationship.left, {
|
|
96
|
-
cascade: true,
|
|
97
|
-
onDelete: 'CASCADE',
|
|
98
|
-
eager: true,
|
|
99
|
-
nullable: false,
|
|
100
|
-
}),
|
|
101
|
-
(0, typeorm_1.JoinColumn)({ name: 'relationship_id' }),
|
|
102
|
-
__metadata("design:type", Array)
|
|
103
|
-
], PartyEntity.prototype, "relationships", void 0);
|
|
104
|
-
__decorate([
|
|
105
|
-
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', nullable: false }),
|
|
106
|
-
__metadata("design:type", Date)
|
|
107
|
-
], PartyEntity.prototype, "createdAt", void 0);
|
|
108
|
-
__decorate([
|
|
109
|
-
(0, typeorm_1.UpdateDateColumn)({ name: 'last_updated_at', nullable: false }),
|
|
110
|
-
__metadata("design:type", Date
|
|
111
|
-
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
112
|
-
)
|
|
113
|
-
], PartyEntity.prototype, "lastUpdatedAt", void 0);
|
|
114
|
-
__decorate([
|
|
115
|
-
(0, typeorm_1.BeforeInsert)(),
|
|
116
|
-
(0, typeorm_1.BeforeUpdate)(),
|
|
117
|
-
__metadata("design:type", Function),
|
|
118
|
-
__metadata("design:paramtypes", []),
|
|
119
|
-
__metadata("design:returntype", void 0)
|
|
120
|
-
], PartyEntity.prototype, "updateUpdatedDate", null);
|
|
121
|
-
__decorate([
|
|
122
|
-
(0, typeorm_1.BeforeInsert)(),
|
|
123
|
-
(0, typeorm_1.BeforeUpdate)(),
|
|
124
|
-
__metadata("design:type", Function),
|
|
125
|
-
__metadata("design:paramtypes", []),
|
|
126
|
-
__metadata("design:returntype", Promise)
|
|
127
|
-
], PartyEntity.prototype, "validate", null);
|
|
128
|
-
PartyEntity = __decorate([
|
|
129
|
-
(0, typeorm_1.Entity)('Party')
|
|
130
|
-
], PartyEntity);
|
|
131
|
-
exports.PartyEntity = PartyEntity;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
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.PartyEntity = void 0;
|
|
22
|
+
const typeorm_1 = require("typeorm");
|
|
23
|
+
const IdentityEntity_1 = require("./IdentityEntity");
|
|
24
|
+
const class_validator_1 = require("class-validator");
|
|
25
|
+
const PartyTypeEntity_1 = require("./PartyTypeEntity");
|
|
26
|
+
const BaseContactEntity_1 = require("./BaseContactEntity");
|
|
27
|
+
const PartyRelationshipEntity_1 = require("./PartyRelationshipEntity");
|
|
28
|
+
const ValidatorUtils_1 = require("../../utils/ValidatorUtils");
|
|
29
|
+
const ElectronicAddressEntity_1 = require("./ElectronicAddressEntity");
|
|
30
|
+
let PartyEntity = class PartyEntity extends typeorm_1.BaseEntity {
|
|
31
|
+
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
32
|
+
updateUpdatedDate() {
|
|
33
|
+
this.lastUpdatedAt = new Date();
|
|
34
|
+
}
|
|
35
|
+
validate() {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const validation = yield (0, class_validator_1.validate)(this);
|
|
38
|
+
if (validation.length > 0) {
|
|
39
|
+
const constraint = (0, ValidatorUtils_1.getConstraint)(validation[0]);
|
|
40
|
+
if (constraint) {
|
|
41
|
+
const message = Object.values(constraint)[0];
|
|
42
|
+
return Promise.reject(Error(message));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], PartyEntity.prototype, "id", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ name: 'uri', length: 255 }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], PartyEntity.prototype, "uri", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.OneToMany)(() => IdentityEntity_1.IdentityEntity, (identity) => identity.party, {
|
|
58
|
+
cascade: true,
|
|
59
|
+
onDelete: 'CASCADE',
|
|
60
|
+
eager: true,
|
|
61
|
+
nullable: false,
|
|
62
|
+
}),
|
|
63
|
+
(0, typeorm_1.JoinColumn)({ name: 'identity_id' }),
|
|
64
|
+
__metadata("design:type", Array)
|
|
65
|
+
], PartyEntity.prototype, "identities", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.OneToMany)(() => ElectronicAddressEntity_1.ElectronicAddressEntity, (electronicAddress) => electronicAddress.party, {
|
|
68
|
+
cascade: true,
|
|
69
|
+
onDelete: 'CASCADE',
|
|
70
|
+
eager: true,
|
|
71
|
+
nullable: false,
|
|
72
|
+
}),
|
|
73
|
+
(0, typeorm_1.JoinColumn)({ name: 'electronic_address_id' }),
|
|
74
|
+
__metadata("design:type", Array)
|
|
75
|
+
], PartyEntity.prototype, "electronicAddresses", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.ManyToOne)(() => PartyTypeEntity_1.PartyTypeEntity, (contactType) => contactType.parties, {
|
|
78
|
+
cascade: true,
|
|
79
|
+
nullable: false,
|
|
80
|
+
eager: true,
|
|
81
|
+
}),
|
|
82
|
+
(0, typeorm_1.JoinColumn)({ name: 'party_type_id' }),
|
|
83
|
+
__metadata("design:type", PartyTypeEntity_1.PartyTypeEntity)
|
|
84
|
+
], PartyEntity.prototype, "partyType", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, typeorm_1.OneToOne)(() => BaseContactEntity_1.BaseContactEntity, (contact) => contact.party, {
|
|
87
|
+
cascade: true,
|
|
88
|
+
onDelete: 'CASCADE',
|
|
89
|
+
eager: true,
|
|
90
|
+
nullable: false,
|
|
91
|
+
}),
|
|
92
|
+
__metadata("design:type", BaseContactEntity_1.BaseContactEntity)
|
|
93
|
+
], PartyEntity.prototype, "contact", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, typeorm_1.OneToMany)(() => PartyRelationshipEntity_1.PartyRelationshipEntity, (relationship) => relationship.left, {
|
|
96
|
+
cascade: true,
|
|
97
|
+
onDelete: 'CASCADE',
|
|
98
|
+
eager: true,
|
|
99
|
+
nullable: false,
|
|
100
|
+
}),
|
|
101
|
+
(0, typeorm_1.JoinColumn)({ name: 'relationship_id' }),
|
|
102
|
+
__metadata("design:type", Array)
|
|
103
|
+
], PartyEntity.prototype, "relationships", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', nullable: false }),
|
|
106
|
+
__metadata("design:type", Date)
|
|
107
|
+
], PartyEntity.prototype, "createdAt", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'last_updated_at', nullable: false }),
|
|
110
|
+
__metadata("design:type", Date
|
|
111
|
+
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
112
|
+
)
|
|
113
|
+
], PartyEntity.prototype, "lastUpdatedAt", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
116
|
+
(0, typeorm_1.BeforeUpdate)(),
|
|
117
|
+
__metadata("design:type", Function),
|
|
118
|
+
__metadata("design:paramtypes", []),
|
|
119
|
+
__metadata("design:returntype", void 0)
|
|
120
|
+
], PartyEntity.prototype, "updateUpdatedDate", null);
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
123
|
+
(0, typeorm_1.BeforeUpdate)(),
|
|
124
|
+
__metadata("design:type", Function),
|
|
125
|
+
__metadata("design:paramtypes", []),
|
|
126
|
+
__metadata("design:returntype", Promise)
|
|
127
|
+
], PartyEntity.prototype, "validate", null);
|
|
128
|
+
PartyEntity = __decorate([
|
|
129
|
+
(0, typeorm_1.Entity)('Party')
|
|
130
|
+
], PartyEntity);
|
|
131
|
+
exports.PartyEntity = PartyEntity;
|
|
132
132
|
//# sourceMappingURL=PartyEntity.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { PartyEntity } from './PartyEntity';
|
|
2
|
-
export declare class PartyRelationshipEntity {
|
|
3
|
-
id: string;
|
|
4
|
-
left: PartyEntity;
|
|
5
|
-
leftId: string;
|
|
6
|
-
right: PartyEntity;
|
|
7
|
-
rightId: string;
|
|
8
|
-
createdAt: Date;
|
|
9
|
-
lastUpdatedAt: Date;
|
|
10
|
-
updateUpdatedDate(): void;
|
|
11
|
-
checkRelationshipSides(): Promise<void>;
|
|
12
|
-
}
|
|
1
|
+
import { PartyEntity } from './PartyEntity';
|
|
2
|
+
export declare class PartyRelationshipEntity {
|
|
3
|
+
id: string;
|
|
4
|
+
left: PartyEntity;
|
|
5
|
+
leftId: string;
|
|
6
|
+
right: PartyEntity;
|
|
7
|
+
rightId: string;
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
lastUpdatedAt: Date;
|
|
10
|
+
updateUpdatedDate(): void;
|
|
11
|
+
checkRelationshipSides(): Promise<void>;
|
|
12
|
+
}
|
|
13
13
|
//# sourceMappingURL=PartyRelationshipEntity.d.ts.map
|
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
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 PartyEntity_1 = require("./PartyEntity");
|
|
24
|
-
let PartyRelationshipEntity = class PartyRelationshipEntity {
|
|
25
|
-
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
26
|
-
updateUpdatedDate() {
|
|
27
|
-
this.lastUpdatedAt = new Date();
|
|
28
|
-
}
|
|
29
|
-
checkRelationshipSides() {
|
|
30
|
-
var _a, _b, _c, _d;
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
if (((_b = (_a = this.left) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this.leftId) === ((_d = (_c = this.right) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : this.rightId)) {
|
|
33
|
-
return Promise.reject(Error('Cannot use the same id for both sides of the relationship'));
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
40
|
-
__metadata("design:type", String)
|
|
41
|
-
], PartyRelationshipEntity.prototype, "id", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
(0, typeorm_1.ManyToOne)(() => PartyEntity_1.PartyEntity, {
|
|
44
|
-
nullable: false,
|
|
45
|
-
onDelete: 'CASCADE',
|
|
46
|
-
}),
|
|
47
|
-
(0, typeorm_1.JoinColumn)({ name: 'left_id' }),
|
|
48
|
-
__metadata("design:type", PartyEntity_1.PartyEntity)
|
|
49
|
-
], PartyRelationshipEntity.prototype, "left", void 0);
|
|
50
|
-
__decorate([
|
|
51
|
-
(0, typeorm_1.Column)({ name: 'left_id', nullable: false }),
|
|
52
|
-
__metadata("design:type", String)
|
|
53
|
-
], PartyRelationshipEntity.prototype, "leftId", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
(0, typeorm_1.ManyToOne)(() => PartyEntity_1.PartyEntity, {
|
|
56
|
-
nullable: false,
|
|
57
|
-
onDelete: 'CASCADE',
|
|
58
|
-
}),
|
|
59
|
-
(0, typeorm_1.JoinColumn)({ name: 'right_id' }),
|
|
60
|
-
__metadata("design:type", PartyEntity_1.PartyEntity)
|
|
61
|
-
], PartyRelationshipEntity.prototype, "right", void 0);
|
|
62
|
-
__decorate([
|
|
63
|
-
(0, typeorm_1.Column)({ name: 'right_id', nullable: false }),
|
|
64
|
-
__metadata("design:type", String)
|
|
65
|
-
], PartyRelationshipEntity.prototype, "rightId", void 0);
|
|
66
|
-
__decorate([
|
|
67
|
-
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', nullable: false }),
|
|
68
|
-
__metadata("design:type", Date)
|
|
69
|
-
], PartyRelationshipEntity.prototype, "createdAt", void 0);
|
|
70
|
-
__decorate([
|
|
71
|
-
(0, typeorm_1.UpdateDateColumn)({ name: 'last_updated_at', nullable: false }),
|
|
72
|
-
__metadata("design:type", Date
|
|
73
|
-
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
74
|
-
)
|
|
75
|
-
], PartyRelationshipEntity.prototype, "lastUpdatedAt", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
(0, typeorm_1.BeforeInsert)(),
|
|
78
|
-
(0, typeorm_1.BeforeUpdate)(),
|
|
79
|
-
__metadata("design:type", Function),
|
|
80
|
-
__metadata("design:paramtypes", []),
|
|
81
|
-
__metadata("design:returntype", void 0)
|
|
82
|
-
], PartyRelationshipEntity.prototype, "updateUpdatedDate", null);
|
|
83
|
-
__decorate([
|
|
84
|
-
(0, typeorm_1.BeforeInsert)(),
|
|
85
|
-
(0, typeorm_1.BeforeUpdate)(),
|
|
86
|
-
__metadata("design:type", Function),
|
|
87
|
-
__metadata("design:paramtypes", []),
|
|
88
|
-
__metadata("design:returntype", Promise)
|
|
89
|
-
], PartyRelationshipEntity.prototype, "checkRelationshipSides", null);
|
|
90
|
-
PartyRelationshipEntity = __decorate([
|
|
91
|
-
(0, typeorm_1.Entity)('PartyRelationship'),
|
|
92
|
-
(0, typeorm_1.Index)('IDX_PartyRelationship_left_right', ['left', 'right'], { unique: true })
|
|
93
|
-
], PartyRelationshipEntity);
|
|
94
|
-
exports.PartyRelationshipEntity = PartyRelationshipEntity;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
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 PartyEntity_1 = require("./PartyEntity");
|
|
24
|
+
let PartyRelationshipEntity = class PartyRelationshipEntity {
|
|
25
|
+
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
26
|
+
updateUpdatedDate() {
|
|
27
|
+
this.lastUpdatedAt = new Date();
|
|
28
|
+
}
|
|
29
|
+
checkRelationshipSides() {
|
|
30
|
+
var _a, _b, _c, _d;
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
if (((_b = (_a = this.left) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this.leftId) === ((_d = (_c = this.right) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : this.rightId)) {
|
|
33
|
+
return Promise.reject(Error('Cannot use the same id for both sides of the relationship'));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], PartyRelationshipEntity.prototype, "id", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.ManyToOne)(() => PartyEntity_1.PartyEntity, {
|
|
44
|
+
nullable: false,
|
|
45
|
+
onDelete: 'CASCADE',
|
|
46
|
+
}),
|
|
47
|
+
(0, typeorm_1.JoinColumn)({ name: 'left_id' }),
|
|
48
|
+
__metadata("design:type", PartyEntity_1.PartyEntity)
|
|
49
|
+
], PartyRelationshipEntity.prototype, "left", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({ name: 'left_id', nullable: false }),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], PartyRelationshipEntity.prototype, "leftId", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.ManyToOne)(() => PartyEntity_1.PartyEntity, {
|
|
56
|
+
nullable: false,
|
|
57
|
+
onDelete: 'CASCADE',
|
|
58
|
+
}),
|
|
59
|
+
(0, typeorm_1.JoinColumn)({ name: 'right_id' }),
|
|
60
|
+
__metadata("design:type", PartyEntity_1.PartyEntity)
|
|
61
|
+
], PartyRelationshipEntity.prototype, "right", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ name: 'right_id', nullable: false }),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], PartyRelationshipEntity.prototype, "rightId", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', nullable: false }),
|
|
68
|
+
__metadata("design:type", Date)
|
|
69
|
+
], PartyRelationshipEntity.prototype, "createdAt", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'last_updated_at', nullable: false }),
|
|
72
|
+
__metadata("design:type", Date
|
|
73
|
+
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
74
|
+
)
|
|
75
|
+
], PartyRelationshipEntity.prototype, "lastUpdatedAt", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
78
|
+
(0, typeorm_1.BeforeUpdate)(),
|
|
79
|
+
__metadata("design:type", Function),
|
|
80
|
+
__metadata("design:paramtypes", []),
|
|
81
|
+
__metadata("design:returntype", void 0)
|
|
82
|
+
], PartyRelationshipEntity.prototype, "updateUpdatedDate", null);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
85
|
+
(0, typeorm_1.BeforeUpdate)(),
|
|
86
|
+
__metadata("design:type", Function),
|
|
87
|
+
__metadata("design:paramtypes", []),
|
|
88
|
+
__metadata("design:returntype", Promise)
|
|
89
|
+
], PartyRelationshipEntity.prototype, "checkRelationshipSides", null);
|
|
90
|
+
PartyRelationshipEntity = __decorate([
|
|
91
|
+
(0, typeorm_1.Entity)('PartyRelationship'),
|
|
92
|
+
(0, typeorm_1.Index)('IDX_PartyRelationship_left_right', ['left', 'right'], { unique: true })
|
|
93
|
+
], PartyRelationshipEntity);
|
|
94
|
+
exports.PartyRelationshipEntity = PartyRelationshipEntity;
|
|
95
95
|
//# sourceMappingURL=PartyRelationshipEntity.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { PartyEntity } from './PartyEntity';
|
|
2
|
-
import { PartyTypeEnum } from '../../types';
|
|
3
|
-
export declare class PartyTypeEntity {
|
|
4
|
-
id: string;
|
|
5
|
-
type: PartyTypeEnum;
|
|
6
|
-
name: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
tenantId: string;
|
|
9
|
-
parties: Array<PartyEntity>;
|
|
10
|
-
createdAt: Date;
|
|
11
|
-
lastUpdatedAt: Date;
|
|
12
|
-
updateUpdatedDate(): void;
|
|
13
|
-
validate(): Promise<void>;
|
|
14
|
-
}
|
|
1
|
+
import { PartyEntity } from './PartyEntity';
|
|
2
|
+
import { PartyTypeEnum } from '../../types';
|
|
3
|
+
export declare class PartyTypeEntity {
|
|
4
|
+
id: string;
|
|
5
|
+
type: PartyTypeEnum;
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
tenantId: string;
|
|
9
|
+
parties: Array<PartyEntity>;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
lastUpdatedAt: Date;
|
|
12
|
+
updateUpdatedDate(): void;
|
|
13
|
+
validate(): Promise<void>;
|
|
14
|
+
}
|
|
15
15
|
//# sourceMappingURL=PartyTypeEntity.d.ts.map
|