@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.
Files changed (227) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +77 -77
  3. package/dist/contact/AbstractContactStore.d.ts +23 -23
  4. package/dist/contact/AbstractContactStore.js +6 -6
  5. package/dist/contact/ContactStore.d.ts +32 -32
  6. package/dist/contact/ContactStore.js +365 -365
  7. package/dist/entities/contact/BaseConfigEntity.d.ts +6 -6
  8. package/dist/entities/contact/BaseConfigEntity.js +33 -33
  9. package/dist/entities/contact/BaseContactEntity.d.ts +9 -9
  10. package/dist/entities/contact/BaseContactEntity.js +53 -53
  11. package/dist/entities/contact/ConnectionEntity.d.ts +10 -10
  12. package/dist/entities/contact/ConnectionEntity.js +46 -46
  13. package/dist/entities/contact/CorrelationIdentifierEntity.d.ts +10 -10
  14. package/dist/entities/contact/CorrelationIdentifierEntity.js +71 -71
  15. package/dist/entities/contact/DidAuthConfigEntity.d.ts +6 -6
  16. package/dist/entities/contact/DidAuthConfigEntity.js +32 -32
  17. package/dist/entities/contact/ElectronicAddressEntity.d.ts +13 -13
  18. package/dist/entities/contact/ElectronicAddressEntity.js +91 -91
  19. package/dist/entities/contact/IdentityEntity.d.ts +20 -20
  20. package/dist/entities/contact/IdentityEntity.js +128 -128
  21. package/dist/entities/contact/IdentityMetadataItemEntity.d.ts +9 -9
  22. package/dist/entities/contact/IdentityMetadataItemEntity.js +68 -68
  23. package/dist/entities/contact/NaturalPersonEntity.d.ts +8 -8
  24. package/dist/entities/contact/NaturalPersonEntity.js +71 -71
  25. package/dist/entities/contact/OpenIdConfigEntity.d.ts +10 -10
  26. package/dist/entities/contact/OpenIdConfigEntity.js +48 -48
  27. package/dist/entities/contact/OrganizationEntity.d.ts +8 -8
  28. package/dist/entities/contact/OrganizationEntity.js +66 -66
  29. package/dist/entities/contact/PartyEntity.d.ts +19 -19
  30. package/dist/entities/contact/PartyEntity.js +131 -131
  31. package/dist/entities/contact/PartyRelationshipEntity.d.ts +12 -12
  32. package/dist/entities/contact/PartyRelationshipEntity.js +94 -94
  33. package/dist/entities/contact/PartyTypeEntity.d.ts +14 -14
  34. package/dist/entities/contact/PartyTypeEntity.js +103 -103
  35. package/dist/entities/eventLogger/AuditEventEntity.d.ts +26 -26
  36. package/dist/entities/eventLogger/AuditEventEntity.js +123 -123
  37. package/dist/entities/eventLogger/AuditEventEntity.js.map +1 -1
  38. package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts +10 -10
  39. package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js +73 -73
  40. package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.d.ts +17 -17
  41. package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js +119 -119
  42. package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts +14 -14
  43. package/dist/entities/issuanceBranding/CredentialBrandingEntity.js +101 -101
  44. package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts +8 -8
  45. package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js +48 -48
  46. package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts +13 -13
  47. package/dist/entities/issuanceBranding/ImageAttributesEntity.js +91 -91
  48. package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts +8 -8
  49. package/dist/entities/issuanceBranding/ImageDimensionsEntity.js +38 -38
  50. package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts +13 -13
  51. package/dist/entities/issuanceBranding/IssuerBrandingEntity.js +94 -94
  52. package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts +8 -8
  53. package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js +48 -48
  54. package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts +8 -8
  55. package/dist/entities/issuanceBranding/TextAttributesEntity.js +61 -61
  56. package/dist/entities/statusList2021/StatusList2021Entity.d.ts +18 -18
  57. package/dist/entities/statusList2021/StatusList2021Entity.js +114 -114
  58. package/dist/entities/statusList2021/StatusList2021EntryEntity.d.ts +10 -10
  59. package/dist/entities/statusList2021/StatusList2021EntryEntity.js +50 -50
  60. package/dist/entities/validators/index.d.ts +6 -6
  61. package/dist/entities/validators/index.js +26 -26
  62. package/dist/entities/xstatePersistence/StateEntity.d.ts +14 -0
  63. package/dist/entities/xstatePersistence/StateEntity.d.ts.map +1 -0
  64. package/dist/entities/xstatePersistence/StateEntity.js +62 -0
  65. package/dist/entities/xstatePersistence/StateEntity.js.map +1 -0
  66. package/dist/eventLogger/AbstractEventLoggerStore.d.ts +6 -6
  67. package/dist/eventLogger/AbstractEventLoggerStore.js +6 -6
  68. package/dist/eventLogger/EventLoggerStore.d.ts +12 -12
  69. package/dist/eventLogger/EventLoggerStore.js +43 -43
  70. package/dist/index.d.ts +45 -41
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +141 -127
  73. package/dist/index.js.map +1 -1
  74. package/dist/issuanceBranding/AbstractIssuanceBrandingStore.d.ts +19 -19
  75. package/dist/issuanceBranding/AbstractIssuanceBrandingStore.js +6 -6
  76. package/dist/issuanceBranding/IssuanceBrandingStore.d.ts +30 -30
  77. package/dist/issuanceBranding/IssuanceBrandingStore.js +374 -374
  78. package/dist/migrations/generic/1-CreateContacts.d.ts +6 -6
  79. package/dist/migrations/generic/1-CreateContacts.js +77 -77
  80. package/dist/migrations/generic/2-CreateIssuanceBranding.d.ts +6 -6
  81. package/dist/migrations/generic/2-CreateIssuanceBranding.js +77 -77
  82. package/dist/migrations/generic/3-CreateContacts.d.ts +6 -6
  83. package/dist/migrations/generic/3-CreateContacts.js +77 -77
  84. package/dist/migrations/generic/4-CreateStatusList.d.ts +6 -6
  85. package/dist/migrations/generic/4-CreateStatusList.js +71 -71
  86. package/dist/migrations/generic/5-CreateAuditEvents.d.ts +6 -6
  87. package/dist/migrations/generic/5-CreateAuditEvents.js +77 -77
  88. package/dist/migrations/generic/{2-CreateContacts.d.ts → 6-CreateXStateStore.d.ts} +2 -2
  89. package/dist/migrations/generic/6-CreateXStateStore.d.ts.map +1 -0
  90. package/dist/migrations/generic/{2-CreateContacts.js → 6-CreateXStateStore.js} +13 -13
  91. package/dist/migrations/generic/6-CreateXStateStore.js.map +1 -0
  92. package/dist/migrations/generic/index.d.ts +18 -16
  93. package/dist/migrations/generic/index.d.ts.map +1 -1
  94. package/dist/migrations/generic/index.js +30 -27
  95. package/dist/migrations/generic/index.js.map +1 -1
  96. package/dist/migrations/index.d.ts +1 -1
  97. package/dist/migrations/index.d.ts.map +1 -1
  98. package/dist/migrations/index.js +10 -5
  99. package/dist/migrations/index.js.map +1 -1
  100. package/dist/migrations/internal-migrations-ormconfig.d.ts +6 -6
  101. package/dist/migrations/internal-migrations-ormconfig.js +26 -26
  102. package/dist/migrations/postgres/1659463079428-CreateContacts.d.ts +6 -6
  103. package/dist/migrations/postgres/1659463079428-CreateContacts.js +56 -56
  104. package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.d.ts +6 -6
  105. package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js +68 -68
  106. package/dist/migrations/postgres/1690925872592-CreateContacts.d.ts +6 -6
  107. package/dist/migrations/postgres/1690925872592-CreateContacts.js +68 -68
  108. package/dist/migrations/postgres/1693866470001-CreateStatusList.d.ts +6 -6
  109. package/dist/migrations/postgres/1693866470001-CreateStatusList.js +31 -31
  110. package/dist/migrations/postgres/1701634812183-CreateAuditEvents.d.ts +6 -6
  111. package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js +42 -42
  112. package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js.map +1 -1
  113. package/dist/migrations/postgres/1708097018115-CreateXStateStore.d.ts +7 -0
  114. package/dist/migrations/postgres/1708097018115-CreateXStateStore.d.ts.map +1 -0
  115. package/dist/migrations/postgres/1708097018115-CreateXStateStore.js +32 -0
  116. package/dist/migrations/postgres/1708097018115-CreateXStateStore.js.map +1 -0
  117. package/dist/migrations/sqlite/1659463069549-CreateContacts.d.ts +6 -6
  118. package/dist/migrations/sqlite/1659463069549-CreateContacts.js +78 -78
  119. package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.d.ts +6 -6
  120. package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js +88 -88
  121. package/dist/migrations/sqlite/1690925872693-CreateContacts.d.ts +6 -6
  122. package/dist/migrations/sqlite/1690925872693-CreateContacts.js +107 -107
  123. package/dist/migrations/sqlite/1693866470000-CreateStatusList.d.ts +6 -6
  124. package/dist/migrations/sqlite/1693866470000-CreateStatusList.js +31 -31
  125. package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.d.ts +6 -6
  126. package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js +28 -28
  127. package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js.map +1 -1
  128. package/dist/migrations/sqlite/1708096002272-CreateXStateStore.d.ts +7 -0
  129. package/dist/migrations/sqlite/1708096002272-CreateXStateStore.d.ts.map +1 -0
  130. package/dist/migrations/sqlite/1708096002272-CreateXStateStore.js +30 -0
  131. package/dist/migrations/sqlite/1708096002272-CreateXStateStore.js.map +1 -0
  132. package/dist/statusList/IStatusListStore.d.ts +19 -19
  133. package/dist/statusList/IStatusListStore.js +2 -2
  134. package/dist/statusList/StatusListStore.d.ts +35 -35
  135. package/dist/statusList/StatusListStore.js +212 -212
  136. package/dist/types/contact/IAbstractContactStore.d.ts +74 -74
  137. package/dist/types/contact/IAbstractContactStore.js +2 -2
  138. package/dist/types/contact/contact.d.ts +173 -173
  139. package/dist/types/contact/contact.js +25 -25
  140. package/dist/types/eventLogger/IAbstractEventLoggerStore.d.ts +9 -9
  141. package/dist/types/eventLogger/IAbstractEventLoggerStore.js +2 -2
  142. package/dist/types/eventLogger/eventLogger.d.ts +2 -2
  143. package/dist/types/eventLogger/eventLogger.js +2 -2
  144. package/dist/types/index.d.ts +10 -9
  145. package/dist/types/index.d.ts.map +1 -1
  146. package/dist/types/index.js +26 -25
  147. package/dist/types/index.js.map +1 -1
  148. package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.d.ts +58 -58
  149. package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.js +2 -2
  150. package/dist/types/issuanceBranding/issuanceBranding.d.ts +114 -114
  151. package/dist/types/issuanceBranding/issuanceBranding.js +2 -2
  152. package/dist/types/statusList/IAbstractStatusListStore.d.ts +37 -37
  153. package/dist/types/statusList/IAbstractStatusListStore.js +2 -2
  154. package/dist/types/statusList/statusList.d.ts +24 -24
  155. package/dist/types/statusList/statusList.js +2 -2
  156. package/dist/types/validation/validation.d.ts +3 -3
  157. package/dist/types/validation/validation.js +2 -2
  158. package/dist/types/xstatePersistence/IAbstractXStateStore.d.ts +23 -0
  159. package/dist/types/xstatePersistence/IAbstractXStateStore.d.ts.map +1 -0
  160. package/dist/types/xstatePersistence/IAbstractXStateStore.js +3 -0
  161. package/dist/types/xstatePersistence/IAbstractXStateStore.js.map +1 -0
  162. package/dist/utils/ValidatorUtils.d.ts +3 -3
  163. package/dist/utils/ValidatorUtils.js +12 -12
  164. package/dist/utils/contact/MappingUtils.d.ts +46 -46
  165. package/dist/utils/contact/MappingUtils.js +290 -290
  166. package/dist/xstatePersistence/IAbstractXStateStore.d.ts +7 -0
  167. package/dist/xstatePersistence/IAbstractXStateStore.d.ts.map +1 -0
  168. package/dist/xstatePersistence/IAbstractXStateStore.js +7 -0
  169. package/dist/xstatePersistence/IAbstractXStateStore.js.map +1 -0
  170. package/dist/xstatePersistence/XStateStore.d.ts +13 -0
  171. package/dist/xstatePersistence/XStateStore.d.ts.map +1 -0
  172. package/dist/xstatePersistence/XStateStore.js +67 -0
  173. package/dist/xstatePersistence/XStateStore.js.map +1 -0
  174. package/package.json +4 -4
  175. package/src/__tests__/eventLogger.entities.test.ts +73 -73
  176. package/src/__tests__/eventLogger.store.test.ts +136 -136
  177. package/src/__tests__/xstatePersistence.entities.test.ts +47 -0
  178. package/src/__tests__/xstatePersistence.store.test.ts +66 -0
  179. package/src/contact/ContactStore.ts +501 -501
  180. package/src/entities/eventLogger/AuditEventEntity.ts +99 -99
  181. package/src/entities/statusList2021/StatusList2021Entity.ts +96 -96
  182. package/src/entities/xstatePersistence/StateEntity.ts +39 -0
  183. package/src/eventLogger/AbstractEventLoggerStore.ts +7 -7
  184. package/src/eventLogger/EventLoggerStore.ts +62 -62
  185. package/src/index.ts +128 -113
  186. package/src/migrations/generic/1-CreateContacts.ts +66 -66
  187. package/src/migrations/generic/2-CreateIssuanceBranding.ts +64 -64
  188. package/src/migrations/generic/3-CreateContacts.ts +66 -66
  189. package/src/migrations/generic/4-CreateStatusList.ts +54 -54
  190. package/src/migrations/generic/5-CreateAuditEvents.ts +66 -66
  191. package/src/migrations/generic/6-CreateXStateStore.ts +66 -0
  192. package/src/migrations/generic/index.ts +30 -27
  193. package/src/migrations/index.ts +8 -1
  194. package/src/migrations/postgres/1693866470001-CreateStatusList.ts +24 -24
  195. package/src/migrations/postgres/1701634812183-CreateAuditEvents.ts +33 -33
  196. package/src/migrations/postgres/1708097018115-CreateXStateStore.ts +18 -0
  197. package/src/migrations/sqlite/1690925872693-CreateContacts.ts +163 -163
  198. package/src/migrations/sqlite/1701634819487-CreateAuditEvents.ts +15 -15
  199. package/src/migrations/sqlite/1708096002272-CreateXStateStore.ts +16 -0
  200. package/src/types/eventLogger/IAbstractEventLoggerStore.ts +12 -12
  201. package/src/types/eventLogger/eventLogger.ts +3 -3
  202. package/src/types/index.ts +10 -9
  203. package/src/types/xstatePersistence/IAbstractXStateStore.ts +27 -0
  204. package/src/xstatePersistence/IAbstractXStateStore.ts +7 -0
  205. package/src/xstatePersistence/XStateStore.ts +56 -0
  206. package/dist/entities/contact/ContactEntity.d.ts +0 -16
  207. package/dist/entities/contact/ContactEntity.d.ts.map +0 -1
  208. package/dist/entities/contact/ContactEntity.js +0 -164
  209. package/dist/entities/contact/ContactEntity.js.map +0 -1
  210. package/dist/migrations/generic/1-CreateIssuanceBranding.d.ts +0 -7
  211. package/dist/migrations/generic/1-CreateIssuanceBranding.d.ts.map +0 -1
  212. package/dist/migrations/generic/1-CreateIssuanceBranding.js +0 -96
  213. package/dist/migrations/generic/1-CreateIssuanceBranding.js.map +0 -1
  214. package/dist/migrations/generic/2-CreateContacts.d.ts.map +0 -1
  215. package/dist/migrations/generic/2-CreateContacts.js.map +0 -1
  216. package/dist/migrations/generic/3-CreateStatusList.d.ts +0 -7
  217. package/dist/migrations/generic/3-CreateStatusList.d.ts.map +0 -1
  218. package/dist/migrations/generic/3-CreateStatusList.js +0 -72
  219. package/dist/migrations/generic/3-CreateStatusList.js.map +0 -1
  220. package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.d.ts +0 -7
  221. package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.d.ts.map +0 -1
  222. package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.js +0 -32
  223. package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.js.map +0 -1
  224. package/dist/migrations/postgres/uuid.d.ts +0 -3
  225. package/dist/migrations/postgres/uuid.d.ts.map +0 -1
  226. package/dist/migrations/postgres/uuid.js +0 -25
  227. package/dist/migrations/postgres/uuid.js.map +0 -1
@@ -1,69 +1,69 @@
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.IdentityMetadataItemEntity = void 0;
22
- const typeorm_1 = require("typeorm");
23
- const IdentityEntity_1 = require("./IdentityEntity");
24
- const class_validator_1 = require("class-validator");
25
- const ValidatorUtils_1 = require("../../utils/ValidatorUtils");
26
- let IdentityMetadataItemEntity = class IdentityMetadataItemEntity extends typeorm_1.BaseEntity {
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
- }
36
- }
37
- });
38
- }
39
- };
40
- __decorate([
41
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
42
- __metadata("design:type", String)
43
- ], IdentityMetadataItemEntity.prototype, "id", void 0);
44
- __decorate([
45
- (0, typeorm_1.Column)({ name: 'label', length: 255, nullable: false }),
46
- (0, class_validator_1.IsNotEmpty)({ message: 'Blank metadata labels are not allowed' }),
47
- __metadata("design:type", String)
48
- ], IdentityMetadataItemEntity.prototype, "label", void 0);
49
- __decorate([
50
- (0, typeorm_1.Column)({ name: 'value', length: 255, nullable: false }),
51
- (0, class_validator_1.IsNotEmpty)({ message: 'Blank metadata values are not allowed' }),
52
- __metadata("design:type", String)
53
- ], IdentityMetadataItemEntity.prototype, "value", void 0);
54
- __decorate([
55
- (0, typeorm_1.ManyToOne)(() => IdentityEntity_1.IdentityEntity, (identity) => identity.metadata, { cascade: ['insert', 'update'], onDelete: 'CASCADE' }),
56
- __metadata("design:type", IdentityEntity_1.IdentityEntity)
57
- ], IdentityMetadataItemEntity.prototype, "identity", void 0);
58
- __decorate([
59
- (0, typeorm_1.BeforeInsert)(),
60
- (0, typeorm_1.BeforeUpdate)(),
61
- __metadata("design:type", Function),
62
- __metadata("design:paramtypes", []),
63
- __metadata("design:returntype", Promise)
64
- ], IdentityMetadataItemEntity.prototype, "validate", null);
65
- IdentityMetadataItemEntity = __decorate([
66
- (0, typeorm_1.Entity)('IdentityMetadata')
67
- ], IdentityMetadataItemEntity);
68
- exports.IdentityMetadataItemEntity = IdentityMetadataItemEntity;
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.IdentityMetadataItemEntity = void 0;
22
+ const typeorm_1 = require("typeorm");
23
+ const IdentityEntity_1 = require("./IdentityEntity");
24
+ const class_validator_1 = require("class-validator");
25
+ const ValidatorUtils_1 = require("../../utils/ValidatorUtils");
26
+ let IdentityMetadataItemEntity = class IdentityMetadataItemEntity extends typeorm_1.BaseEntity {
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
+ }
36
+ }
37
+ });
38
+ }
39
+ };
40
+ __decorate([
41
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
42
+ __metadata("design:type", String)
43
+ ], IdentityMetadataItemEntity.prototype, "id", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({ name: 'label', length: 255, nullable: false }),
46
+ (0, class_validator_1.IsNotEmpty)({ message: 'Blank metadata labels are not allowed' }),
47
+ __metadata("design:type", String)
48
+ ], IdentityMetadataItemEntity.prototype, "label", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({ name: 'value', length: 255, nullable: false }),
51
+ (0, class_validator_1.IsNotEmpty)({ message: 'Blank metadata values are not allowed' }),
52
+ __metadata("design:type", String)
53
+ ], IdentityMetadataItemEntity.prototype, "value", void 0);
54
+ __decorate([
55
+ (0, typeorm_1.ManyToOne)(() => IdentityEntity_1.IdentityEntity, (identity) => identity.metadata, { cascade: ['insert', 'update'], onDelete: 'CASCADE' }),
56
+ __metadata("design:type", IdentityEntity_1.IdentityEntity)
57
+ ], IdentityMetadataItemEntity.prototype, "identity", void 0);
58
+ __decorate([
59
+ (0, typeorm_1.BeforeInsert)(),
60
+ (0, typeorm_1.BeforeUpdate)(),
61
+ __metadata("design:type", Function),
62
+ __metadata("design:paramtypes", []),
63
+ __metadata("design:returntype", Promise)
64
+ ], IdentityMetadataItemEntity.prototype, "validate", null);
65
+ IdentityMetadataItemEntity = __decorate([
66
+ (0, typeorm_1.Entity)('IdentityMetadata')
67
+ ], IdentityMetadataItemEntity);
68
+ exports.IdentityMetadataItemEntity = IdentityMetadataItemEntity;
69
69
  //# sourceMappingURL=IdentityMetadataItemEntity.js.map
@@ -1,9 +1,9 @@
1
- import { BaseContactEntity } from './BaseContactEntity';
2
- export declare class NaturalPersonEntity extends BaseContactEntity {
3
- firstName: string;
4
- middleName?: string;
5
- lastName: string;
6
- displayName: string;
7
- validate(): Promise<void>;
8
- }
1
+ import { BaseContactEntity } from './BaseContactEntity';
2
+ export declare class NaturalPersonEntity extends BaseContactEntity {
3
+ firstName: string;
4
+ middleName?: string;
5
+ lastName: string;
6
+ displayName: string;
7
+ validate(): Promise<void>;
8
+ }
9
9
  //# sourceMappingURL=NaturalPersonEntity.d.ts.map
@@ -1,72 +1,72 @@
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.NaturalPersonEntity = void 0;
22
- const typeorm_1 = require("typeorm");
23
- const BaseContactEntity_1 = require("./BaseContactEntity");
24
- const class_validator_1 = require("class-validator");
25
- const validators_1 = require("../validators");
26
- const ValidatorUtils_1 = require("../../utils/ValidatorUtils");
27
- let NaturalPersonEntity = class NaturalPersonEntity extends BaseContactEntity_1.BaseContactEntity {
28
- validate() {
29
- return __awaiter(this, void 0, void 0, function* () {
30
- const validation = yield (0, class_validator_1.validate)(this);
31
- if (validation.length > 0) {
32
- const constraint = (0, ValidatorUtils_1.getConstraint)(validation[0]);
33
- if (constraint) {
34
- const message = Object.values(constraint)[0];
35
- return Promise.reject(Error(message));
36
- }
37
- }
38
- });
39
- }
40
- };
41
- __decorate([
42
- (0, typeorm_1.Column)({ name: 'first_name', length: 255, nullable: false, unique: false }),
43
- (0, class_validator_1.IsNotEmpty)({ message: 'Blank first names are not allowed' }),
44
- __metadata("design:type", String)
45
- ], NaturalPersonEntity.prototype, "firstName", void 0);
46
- __decorate([
47
- (0, typeorm_1.Column)({ name: 'middle_name', length: 255, nullable: true, unique: false }),
48
- (0, class_validator_1.Validate)(validators_1.IsNonEmptyStringConstraint, { message: 'Blank middle names are not allowed' }),
49
- __metadata("design:type", String)
50
- ], NaturalPersonEntity.prototype, "middleName", void 0);
51
- __decorate([
52
- (0, typeorm_1.Column)({ name: 'last_name', length: 255, nullable: false, unique: false }),
53
- (0, class_validator_1.IsNotEmpty)({ message: 'Blank last names are not allowed' }),
54
- __metadata("design:type", String)
55
- ], NaturalPersonEntity.prototype, "lastName", void 0);
56
- __decorate([
57
- (0, typeorm_1.Column)({ name: 'display_name', length: 255, nullable: false, unique: false }),
58
- (0, class_validator_1.IsNotEmpty)({ message: 'Blank display names are not allowed' }),
59
- __metadata("design:type", String)
60
- ], NaturalPersonEntity.prototype, "displayName", void 0);
61
- __decorate([
62
- (0, typeorm_1.BeforeInsert)(),
63
- (0, typeorm_1.BeforeUpdate)(),
64
- __metadata("design:type", Function),
65
- __metadata("design:paramtypes", []),
66
- __metadata("design:returntype", Promise)
67
- ], NaturalPersonEntity.prototype, "validate", null);
68
- NaturalPersonEntity = __decorate([
69
- (0, typeorm_1.ChildEntity)('NaturalPerson')
70
- ], NaturalPersonEntity);
71
- exports.NaturalPersonEntity = NaturalPersonEntity;
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.NaturalPersonEntity = void 0;
22
+ const typeorm_1 = require("typeorm");
23
+ const BaseContactEntity_1 = require("./BaseContactEntity");
24
+ const class_validator_1 = require("class-validator");
25
+ const validators_1 = require("../validators");
26
+ const ValidatorUtils_1 = require("../../utils/ValidatorUtils");
27
+ let NaturalPersonEntity = class NaturalPersonEntity extends BaseContactEntity_1.BaseContactEntity {
28
+ validate() {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ const validation = yield (0, class_validator_1.validate)(this);
31
+ if (validation.length > 0) {
32
+ const constraint = (0, ValidatorUtils_1.getConstraint)(validation[0]);
33
+ if (constraint) {
34
+ const message = Object.values(constraint)[0];
35
+ return Promise.reject(Error(message));
36
+ }
37
+ }
38
+ });
39
+ }
40
+ };
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ name: 'first_name', length: 255, nullable: false, unique: false }),
43
+ (0, class_validator_1.IsNotEmpty)({ message: 'Blank first names are not allowed' }),
44
+ __metadata("design:type", String)
45
+ ], NaturalPersonEntity.prototype, "firstName", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ name: 'middle_name', length: 255, nullable: true, unique: false }),
48
+ (0, class_validator_1.Validate)(validators_1.IsNonEmptyStringConstraint, { message: 'Blank middle names are not allowed' }),
49
+ __metadata("design:type", String)
50
+ ], NaturalPersonEntity.prototype, "middleName", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.Column)({ name: 'last_name', length: 255, nullable: false, unique: false }),
53
+ (0, class_validator_1.IsNotEmpty)({ message: 'Blank last names are not allowed' }),
54
+ __metadata("design:type", String)
55
+ ], NaturalPersonEntity.prototype, "lastName", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)({ name: 'display_name', length: 255, nullable: false, unique: false }),
58
+ (0, class_validator_1.IsNotEmpty)({ message: 'Blank display names are not allowed' }),
59
+ __metadata("design:type", String)
60
+ ], NaturalPersonEntity.prototype, "displayName", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.BeforeInsert)(),
63
+ (0, typeorm_1.BeforeUpdate)(),
64
+ __metadata("design:type", Function),
65
+ __metadata("design:paramtypes", []),
66
+ __metadata("design:returntype", Promise)
67
+ ], NaturalPersonEntity.prototype, "validate", null);
68
+ NaturalPersonEntity = __decorate([
69
+ (0, typeorm_1.ChildEntity)('NaturalPerson')
70
+ ], NaturalPersonEntity);
71
+ exports.NaturalPersonEntity = NaturalPersonEntity;
72
72
  //# sourceMappingURL=NaturalPersonEntity.js.map
@@ -1,11 +1,11 @@
1
- import { BaseConfigEntity } from './BaseConfigEntity';
2
- export declare class OpenIdConfigEntity extends BaseConfigEntity {
3
- clientId: string;
4
- clientSecret: string;
5
- scopes: Array<string>;
6
- issuer: string;
7
- redirectUrl: string;
8
- dangerouslyAllowInsecureHttpRequests: boolean;
9
- clientAuthMethod: 'basic' | 'post' | undefined;
10
- }
1
+ import { BaseConfigEntity } from './BaseConfigEntity';
2
+ export declare class OpenIdConfigEntity extends BaseConfigEntity {
3
+ clientId: string;
4
+ clientSecret: string;
5
+ scopes: Array<string>;
6
+ issuer: string;
7
+ redirectUrl: string;
8
+ dangerouslyAllowInsecureHttpRequests: boolean;
9
+ clientAuthMethod: 'basic' | 'post' | undefined;
10
+ }
11
11
  //# sourceMappingURL=OpenIdConfigEntity.d.ts.map
@@ -1,49 +1,49 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.OpenIdConfigEntity = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const BaseConfigEntity_1 = require("./BaseConfigEntity");
15
- let OpenIdConfigEntity = class OpenIdConfigEntity extends BaseConfigEntity_1.BaseConfigEntity {
16
- };
17
- __decorate([
18
- (0, typeorm_1.Column)({ name: 'client_id', length: 255, nullable: false }),
19
- __metadata("design:type", String)
20
- ], OpenIdConfigEntity.prototype, "clientId", void 0);
21
- __decorate([
22
- (0, typeorm_1.Column)({ name: 'client_secret', length: 255, nullable: false }),
23
- __metadata("design:type", String)
24
- ], OpenIdConfigEntity.prototype, "clientSecret", void 0);
25
- __decorate([
26
- (0, typeorm_1.Column)('simple-array', { name: 'scopes', nullable: false }),
27
- __metadata("design:type", Array)
28
- ], OpenIdConfigEntity.prototype, "scopes", void 0);
29
- __decorate([
30
- (0, typeorm_1.Column)({ name: 'issuer', length: 255, nullable: false }),
31
- __metadata("design:type", String)
32
- ], OpenIdConfigEntity.prototype, "issuer", void 0);
33
- __decorate([
34
- (0, typeorm_1.Column)('text', { name: 'redirect_url', nullable: false }),
35
- __metadata("design:type", String)
36
- ], OpenIdConfigEntity.prototype, "redirectUrl", void 0);
37
- __decorate([
38
- (0, typeorm_1.Column)('boolean', { name: 'dangerously_allow_insecure_http_requests', nullable: false }),
39
- __metadata("design:type", Boolean)
40
- ], OpenIdConfigEntity.prototype, "dangerouslyAllowInsecureHttpRequests", void 0);
41
- __decorate([
42
- (0, typeorm_1.Column)('text', { name: 'client_auth_method', nullable: false }),
43
- __metadata("design:type", Object)
44
- ], OpenIdConfigEntity.prototype, "clientAuthMethod", void 0);
45
- OpenIdConfigEntity = __decorate([
46
- (0, typeorm_1.ChildEntity)('OpenIdConfig')
47
- ], OpenIdConfigEntity);
48
- exports.OpenIdConfigEntity = OpenIdConfigEntity;
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.OpenIdConfigEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseConfigEntity_1 = require("./BaseConfigEntity");
15
+ let OpenIdConfigEntity = class OpenIdConfigEntity extends BaseConfigEntity_1.BaseConfigEntity {
16
+ };
17
+ __decorate([
18
+ (0, typeorm_1.Column)({ name: 'client_id', length: 255, nullable: false }),
19
+ __metadata("design:type", String)
20
+ ], OpenIdConfigEntity.prototype, "clientId", void 0);
21
+ __decorate([
22
+ (0, typeorm_1.Column)({ name: 'client_secret', length: 255, nullable: false }),
23
+ __metadata("design:type", String)
24
+ ], OpenIdConfigEntity.prototype, "clientSecret", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.Column)('simple-array', { name: 'scopes', nullable: false }),
27
+ __metadata("design:type", Array)
28
+ ], OpenIdConfigEntity.prototype, "scopes", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.Column)({ name: 'issuer', length: 255, nullable: false }),
31
+ __metadata("design:type", String)
32
+ ], OpenIdConfigEntity.prototype, "issuer", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)('text', { name: 'redirect_url', nullable: false }),
35
+ __metadata("design:type", String)
36
+ ], OpenIdConfigEntity.prototype, "redirectUrl", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)('boolean', { name: 'dangerously_allow_insecure_http_requests', nullable: false }),
39
+ __metadata("design:type", Boolean)
40
+ ], OpenIdConfigEntity.prototype, "dangerouslyAllowInsecureHttpRequests", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)('text', { name: 'client_auth_method', nullable: false }),
43
+ __metadata("design:type", Object)
44
+ ], OpenIdConfigEntity.prototype, "clientAuthMethod", void 0);
45
+ OpenIdConfigEntity = __decorate([
46
+ (0, typeorm_1.ChildEntity)('OpenIdConfig')
47
+ ], OpenIdConfigEntity);
48
+ exports.OpenIdConfigEntity = OpenIdConfigEntity;
49
49
  //# sourceMappingURL=OpenIdConfigEntity.js.map
@@ -1,9 +1,9 @@
1
- import { PartyEntity } from './PartyEntity';
2
- import { BaseContactEntity } from './BaseContactEntity';
3
- export declare class OrganizationEntity extends BaseContactEntity {
4
- legalName: string;
5
- displayName: string;
6
- party: PartyEntity;
7
- validate(): Promise<void>;
8
- }
1
+ import { PartyEntity } from './PartyEntity';
2
+ import { BaseContactEntity } from './BaseContactEntity';
3
+ export declare class OrganizationEntity extends BaseContactEntity {
4
+ legalName: string;
5
+ displayName: string;
6
+ party: PartyEntity;
7
+ validate(): Promise<void>;
8
+ }
9
9
  //# sourceMappingURL=OrganizationEntity.d.ts.map
@@ -1,67 +1,67 @@
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.OrganizationEntity = void 0;
22
- const typeorm_1 = require("typeorm");
23
- const PartyEntity_1 = require("./PartyEntity");
24
- const BaseContactEntity_1 = require("./BaseContactEntity");
25
- const class_validator_1 = require("class-validator");
26
- const ValidatorUtils_1 = require("../../utils/ValidatorUtils");
27
- let OrganizationEntity = class OrganizationEntity extends BaseContactEntity_1.BaseContactEntity {
28
- validate() {
29
- return __awaiter(this, void 0, void 0, function* () {
30
- const validation = yield (0, class_validator_1.validate)(this);
31
- if (validation.length > 0) {
32
- const constraint = (0, ValidatorUtils_1.getConstraint)(validation[0]);
33
- if (constraint) {
34
- const message = Object.values(constraint)[0];
35
- return Promise.reject(Error(message));
36
- }
37
- }
38
- });
39
- }
40
- };
41
- __decorate([
42
- (0, typeorm_1.Column)({ name: 'legal_name', length: 255, nullable: false, unique: true }),
43
- (0, class_validator_1.IsNotEmpty)({ message: 'Blank legal names are not allowed' }),
44
- __metadata("design:type", String)
45
- ], OrganizationEntity.prototype, "legalName", void 0);
46
- __decorate([
47
- (0, typeorm_1.Column)({ name: 'display_name', length: 255, nullable: false, unique: false }),
48
- (0, class_validator_1.IsNotEmpty)({ message: 'Blank display names are not allowed' }),
49
- __metadata("design:type", String)
50
- ], OrganizationEntity.prototype, "displayName", void 0);
51
- __decorate([
52
- (0, typeorm_1.OneToOne)(() => PartyEntity_1.PartyEntity),
53
- (0, typeorm_1.JoinColumn)({ name: 'party_id' }),
54
- __metadata("design:type", PartyEntity_1.PartyEntity)
55
- ], OrganizationEntity.prototype, "party", void 0);
56
- __decorate([
57
- (0, typeorm_1.BeforeInsert)(),
58
- (0, typeorm_1.BeforeUpdate)(),
59
- __metadata("design:type", Function),
60
- __metadata("design:paramtypes", []),
61
- __metadata("design:returntype", Promise)
62
- ], OrganizationEntity.prototype, "validate", null);
63
- OrganizationEntity = __decorate([
64
- (0, typeorm_1.ChildEntity)('Organization')
65
- ], OrganizationEntity);
66
- exports.OrganizationEntity = OrganizationEntity;
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.OrganizationEntity = void 0;
22
+ const typeorm_1 = require("typeorm");
23
+ const PartyEntity_1 = require("./PartyEntity");
24
+ const BaseContactEntity_1 = require("./BaseContactEntity");
25
+ const class_validator_1 = require("class-validator");
26
+ const ValidatorUtils_1 = require("../../utils/ValidatorUtils");
27
+ let OrganizationEntity = class OrganizationEntity extends BaseContactEntity_1.BaseContactEntity {
28
+ validate() {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ const validation = yield (0, class_validator_1.validate)(this);
31
+ if (validation.length > 0) {
32
+ const constraint = (0, ValidatorUtils_1.getConstraint)(validation[0]);
33
+ if (constraint) {
34
+ const message = Object.values(constraint)[0];
35
+ return Promise.reject(Error(message));
36
+ }
37
+ }
38
+ });
39
+ }
40
+ };
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ name: 'legal_name', length: 255, nullable: false, unique: true }),
43
+ (0, class_validator_1.IsNotEmpty)({ message: 'Blank legal names are not allowed' }),
44
+ __metadata("design:type", String)
45
+ ], OrganizationEntity.prototype, "legalName", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ name: 'display_name', length: 255, nullable: false, unique: false }),
48
+ (0, class_validator_1.IsNotEmpty)({ message: 'Blank display names are not allowed' }),
49
+ __metadata("design:type", String)
50
+ ], OrganizationEntity.prototype, "displayName", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.OneToOne)(() => PartyEntity_1.PartyEntity),
53
+ (0, typeorm_1.JoinColumn)({ name: 'party_id' }),
54
+ __metadata("design:type", PartyEntity_1.PartyEntity)
55
+ ], OrganizationEntity.prototype, "party", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.BeforeInsert)(),
58
+ (0, typeorm_1.BeforeUpdate)(),
59
+ __metadata("design:type", Function),
60
+ __metadata("design:paramtypes", []),
61
+ __metadata("design:returntype", Promise)
62
+ ], OrganizationEntity.prototype, "validate", null);
63
+ OrganizationEntity = __decorate([
64
+ (0, typeorm_1.ChildEntity)('Organization')
65
+ ], OrganizationEntity);
66
+ exports.OrganizationEntity = OrganizationEntity;
67
67
  //# sourceMappingURL=OrganizationEntity.js.map
@@ -1,20 +1,20 @@
1
- import { BaseEntity } from 'typeorm';
2
- import { IdentityEntity } from './IdentityEntity';
3
- import { PartyTypeEntity } from './PartyTypeEntity';
4
- import { BaseContactEntity } from './BaseContactEntity';
5
- import { PartyRelationshipEntity } from './PartyRelationshipEntity';
6
- import { ElectronicAddressEntity } from './ElectronicAddressEntity';
7
- export declare class PartyEntity extends BaseEntity {
8
- id: string;
9
- uri?: string;
10
- identities: Array<IdentityEntity>;
11
- electronicAddresses: Array<ElectronicAddressEntity>;
12
- partyType: PartyTypeEntity;
13
- contact: BaseContactEntity;
14
- relationships: Array<PartyRelationshipEntity>;
15
- createdAt: Date;
16
- lastUpdatedAt: Date;
17
- updateUpdatedDate(): void;
18
- validate(): Promise<void>;
19
- }
1
+ import { BaseEntity } from 'typeorm';
2
+ import { IdentityEntity } from './IdentityEntity';
3
+ import { PartyTypeEntity } from './PartyTypeEntity';
4
+ import { BaseContactEntity } from './BaseContactEntity';
5
+ import { PartyRelationshipEntity } from './PartyRelationshipEntity';
6
+ import { ElectronicAddressEntity } from './ElectronicAddressEntity';
7
+ export declare class PartyEntity extends BaseEntity {
8
+ id: string;
9
+ uri?: string;
10
+ identities: Array<IdentityEntity>;
11
+ electronicAddresses: Array<ElectronicAddressEntity>;
12
+ partyType: PartyTypeEntity;
13
+ contact: BaseContactEntity;
14
+ relationships: Array<PartyRelationshipEntity>;
15
+ createdAt: Date;
16
+ lastUpdatedAt: Date;
17
+ updateUpdatedDate(): void;
18
+ validate(): Promise<void>;
19
+ }
20
20
  //# sourceMappingURL=PartyEntity.d.ts.map