@sphereon/ssi-sdk.data-store 0.18.1 → 0.18.2-unstable.10
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/ContactEntity.d.ts +16 -0
- package/dist/entities/contact/ContactEntity.d.ts.map +1 -0
- package/dist/entities/contact/ContactEntity.js +164 -0
- package/dist/entities/contact/ContactEntity.js.map +1 -0
- 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/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/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 +41 -41
- package/dist/index.js +127 -127
- 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/1-CreateIssuanceBranding.d.ts +7 -0
- package/dist/migrations/generic/1-CreateIssuanceBranding.d.ts.map +1 -0
- package/dist/migrations/generic/1-CreateIssuanceBranding.js +96 -0
- package/dist/migrations/generic/1-CreateIssuanceBranding.js.map +1 -0
- package/dist/migrations/generic/2-CreateContacts.d.ts +7 -0
- package/dist/migrations/generic/2-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/generic/2-CreateContacts.js +78 -0
- package/dist/migrations/generic/2-CreateContacts.js.map +1 -0
- 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/3-CreateStatusList.d.ts +7 -0
- package/dist/migrations/generic/3-CreateStatusList.d.ts.map +1 -0
- package/dist/migrations/generic/3-CreateStatusList.js +72 -0
- package/dist/migrations/generic/3-CreateStatusList.js.map +1 -0
- 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/index.d.ts +16 -16
- package/dist/migrations/generic/index.js +27 -27
- package/dist/migrations/index.d.ts +1 -1
- package/dist/migrations/index.js +5 -5
- 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/CreateStatusList1693866470001-CreateStatusList.d.ts +7 -0
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.d.ts.map +1 -0
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.js +32 -0
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.js.map +1 -0
- package/dist/migrations/postgres/uuid.d.ts +3 -0
- package/dist/migrations/postgres/uuid.d.ts.map +1 -0
- package/dist/migrations/postgres/uuid.js +25 -0
- package/dist/migrations/postgres/uuid.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/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 +9 -9
- package/dist/types/index.js +25 -25
- 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/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/package.json +4 -4
- package/src/__tests__/eventLogger.entities.test.ts +73 -73
- package/src/__tests__/eventLogger.store.test.ts +136 -136
- 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/eventLogger/AbstractEventLoggerStore.ts +7 -7
- package/src/eventLogger/EventLoggerStore.ts +62 -62
- package/src/index.ts +113 -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/index.ts +27 -27
- package/src/migrations/postgres/1693866470001-CreateStatusList.ts +24 -24
- package/src/migrations/postgres/1701634812183-CreateAuditEvents.ts +33 -33
- package/src/migrations/sqlite/1690925872693-CreateContacts.ts +163 -163
- package/src/migrations/sqlite/1701634819487-CreateAuditEvents.ts +15 -15
- package/src/types/eventLogger/IAbstractEventLoggerStore.ts +12 -12
- package/src/types/eventLogger/eventLogger.ts +3 -3
- package/src/types/index.ts +9 -9
|
@@ -1,92 +1,92 @@
|
|
|
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.imageAttributesEntityFrom = exports.ImageAttributesEntity = void 0;
|
|
22
|
-
const typeorm_1 = require("typeorm");
|
|
23
|
-
const ImageDimensionsEntity_1 = require("./ImageDimensionsEntity");
|
|
24
|
-
const class_validator_1 = require("class-validator");
|
|
25
|
-
const validators_1 = require("../validators");
|
|
26
|
-
let ImageAttributesEntity = class ImageAttributesEntity 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
|
-
return Promise.reject(Error(Object.values(validation[0].constraints)[0]));
|
|
32
|
-
}
|
|
33
|
-
return;
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
39
|
-
__metadata("design:type", String)
|
|
40
|
-
], ImageAttributesEntity.prototype, "id", void 0);
|
|
41
|
-
__decorate([
|
|
42
|
-
(0, typeorm_1.Column)({ name: 'uri', length: 255, nullable: true, unique: false }),
|
|
43
|
-
(0, class_validator_1.Validate)(validators_1.IsNonEmptyStringConstraint, { message: 'Blank image uri are not allowed' }),
|
|
44
|
-
__metadata("design:type", String)
|
|
45
|
-
], ImageAttributesEntity.prototype, "uri", void 0);
|
|
46
|
-
__decorate([
|
|
47
|
-
(0, typeorm_1.Column)({ name: 'dataUri', length: 255, nullable: true, unique: false }),
|
|
48
|
-
(0, class_validator_1.Validate)(validators_1.IsNonEmptyStringConstraint, { message: 'Blank image data uri are not allowed' }),
|
|
49
|
-
__metadata("design:type", String)
|
|
50
|
-
], ImageAttributesEntity.prototype, "dataUri", void 0);
|
|
51
|
-
__decorate([
|
|
52
|
-
(0, typeorm_1.Column)({ name: 'mediaType', length: 255, nullable: true, unique: false }),
|
|
53
|
-
(0, class_validator_1.Validate)(validators_1.IsNonEmptyStringConstraint, { message: 'Blank image types are not allowed' }),
|
|
54
|
-
__metadata("design:type", String)
|
|
55
|
-
], ImageAttributesEntity.prototype, "mediaType", void 0);
|
|
56
|
-
__decorate([
|
|
57
|
-
(0, typeorm_1.Column)({ name: 'alt', length: 255, nullable: true, unique: false }),
|
|
58
|
-
(0, class_validator_1.Validate)(validators_1.IsNonEmptyStringConstraint, { message: 'Blank image alts are not allowed' }),
|
|
59
|
-
__metadata("design:type", String)
|
|
60
|
-
], ImageAttributesEntity.prototype, "alt", void 0);
|
|
61
|
-
__decorate([
|
|
62
|
-
(0, typeorm_1.OneToOne)(() => ImageDimensionsEntity_1.ImageDimensionsEntity, {
|
|
63
|
-
cascade: true,
|
|
64
|
-
onDelete: 'CASCADE',
|
|
65
|
-
eager: true,
|
|
66
|
-
nullable: true,
|
|
67
|
-
}),
|
|
68
|
-
(0, typeorm_1.JoinColumn)({ name: 'dimensionsId' }),
|
|
69
|
-
__metadata("design:type", ImageDimensionsEntity_1.ImageDimensionsEntity)
|
|
70
|
-
], ImageAttributesEntity.prototype, "dimensions", void 0);
|
|
71
|
-
__decorate([
|
|
72
|
-
(0, typeorm_1.BeforeInsert)(),
|
|
73
|
-
(0, typeorm_1.BeforeUpdate)(),
|
|
74
|
-
__metadata("design:type", Function),
|
|
75
|
-
__metadata("design:paramtypes", []),
|
|
76
|
-
__metadata("design:returntype", Promise)
|
|
77
|
-
], ImageAttributesEntity.prototype, "validate", null);
|
|
78
|
-
ImageAttributesEntity = __decorate([
|
|
79
|
-
(0, typeorm_1.Entity)('ImageAttributes')
|
|
80
|
-
], ImageAttributesEntity);
|
|
81
|
-
exports.ImageAttributesEntity = ImageAttributesEntity;
|
|
82
|
-
const imageAttributesEntityFrom = (args) => {
|
|
83
|
-
const imageAttributesEntity = new ImageAttributesEntity();
|
|
84
|
-
imageAttributesEntity.uri = (0, validators_1.isEmptyString)(args.uri) ? undefined : args.uri;
|
|
85
|
-
imageAttributesEntity.dataUri = (0, validators_1.isEmptyString)(args.dataUri) ? undefined : args.dataUri;
|
|
86
|
-
imageAttributesEntity.mediaType = (0, validators_1.isEmptyString)(args.mediaType) ? undefined : args.mediaType;
|
|
87
|
-
imageAttributesEntity.alt = (0, validators_1.isEmptyString)(args.alt) ? undefined : args.alt;
|
|
88
|
-
imageAttributesEntity.dimensions = args.dimensions ? (0, ImageDimensionsEntity_1.imageDimensionsEntityFrom)(args.dimensions) : undefined;
|
|
89
|
-
return imageAttributesEntity;
|
|
90
|
-
};
|
|
91
|
-
exports.imageAttributesEntityFrom = imageAttributesEntityFrom;
|
|
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.imageAttributesEntityFrom = exports.ImageAttributesEntity = void 0;
|
|
22
|
+
const typeorm_1 = require("typeorm");
|
|
23
|
+
const ImageDimensionsEntity_1 = require("./ImageDimensionsEntity");
|
|
24
|
+
const class_validator_1 = require("class-validator");
|
|
25
|
+
const validators_1 = require("../validators");
|
|
26
|
+
let ImageAttributesEntity = class ImageAttributesEntity 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
|
+
return Promise.reject(Error(Object.values(validation[0].constraints)[0]));
|
|
32
|
+
}
|
|
33
|
+
return;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], ImageAttributesEntity.prototype, "id", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ name: 'uri', length: 255, nullable: true, unique: false }),
|
|
43
|
+
(0, class_validator_1.Validate)(validators_1.IsNonEmptyStringConstraint, { message: 'Blank image uri are not allowed' }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], ImageAttributesEntity.prototype, "uri", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ name: 'dataUri', length: 255, nullable: true, unique: false }),
|
|
48
|
+
(0, class_validator_1.Validate)(validators_1.IsNonEmptyStringConstraint, { message: 'Blank image data uri are not allowed' }),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], ImageAttributesEntity.prototype, "dataUri", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ name: 'mediaType', length: 255, nullable: true, unique: false }),
|
|
53
|
+
(0, class_validator_1.Validate)(validators_1.IsNonEmptyStringConstraint, { message: 'Blank image types are not allowed' }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], ImageAttributesEntity.prototype, "mediaType", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ name: 'alt', length: 255, nullable: true, unique: false }),
|
|
58
|
+
(0, class_validator_1.Validate)(validators_1.IsNonEmptyStringConstraint, { message: 'Blank image alts are not allowed' }),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], ImageAttributesEntity.prototype, "alt", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.OneToOne)(() => ImageDimensionsEntity_1.ImageDimensionsEntity, {
|
|
63
|
+
cascade: true,
|
|
64
|
+
onDelete: 'CASCADE',
|
|
65
|
+
eager: true,
|
|
66
|
+
nullable: true,
|
|
67
|
+
}),
|
|
68
|
+
(0, typeorm_1.JoinColumn)({ name: 'dimensionsId' }),
|
|
69
|
+
__metadata("design:type", ImageDimensionsEntity_1.ImageDimensionsEntity)
|
|
70
|
+
], ImageAttributesEntity.prototype, "dimensions", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
73
|
+
(0, typeorm_1.BeforeUpdate)(),
|
|
74
|
+
__metadata("design:type", Function),
|
|
75
|
+
__metadata("design:paramtypes", []),
|
|
76
|
+
__metadata("design:returntype", Promise)
|
|
77
|
+
], ImageAttributesEntity.prototype, "validate", null);
|
|
78
|
+
ImageAttributesEntity = __decorate([
|
|
79
|
+
(0, typeorm_1.Entity)('ImageAttributes')
|
|
80
|
+
], ImageAttributesEntity);
|
|
81
|
+
exports.ImageAttributesEntity = ImageAttributesEntity;
|
|
82
|
+
const imageAttributesEntityFrom = (args) => {
|
|
83
|
+
const imageAttributesEntity = new ImageAttributesEntity();
|
|
84
|
+
imageAttributesEntity.uri = (0, validators_1.isEmptyString)(args.uri) ? undefined : args.uri;
|
|
85
|
+
imageAttributesEntity.dataUri = (0, validators_1.isEmptyString)(args.dataUri) ? undefined : args.dataUri;
|
|
86
|
+
imageAttributesEntity.mediaType = (0, validators_1.isEmptyString)(args.mediaType) ? undefined : args.mediaType;
|
|
87
|
+
imageAttributesEntity.alt = (0, validators_1.isEmptyString)(args.alt) ? undefined : args.alt;
|
|
88
|
+
imageAttributesEntity.dimensions = args.dimensions ? (0, ImageDimensionsEntity_1.imageDimensionsEntityFrom)(args.dimensions) : undefined;
|
|
89
|
+
return imageAttributesEntity;
|
|
90
|
+
};
|
|
91
|
+
exports.imageAttributesEntityFrom = imageAttributesEntityFrom;
|
|
92
92
|
//# sourceMappingURL=ImageAttributesEntity.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BaseEntity } from 'typeorm';
|
|
2
|
-
import { IBasicImageDimensions } from '../../types';
|
|
3
|
-
export declare class ImageDimensionsEntity extends BaseEntity {
|
|
4
|
-
id: string;
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
}
|
|
8
|
-
export declare const imageDimensionsEntityFrom: (args: IBasicImageDimensions) => ImageDimensionsEntity;
|
|
1
|
+
import { BaseEntity } from 'typeorm';
|
|
2
|
+
import { IBasicImageDimensions } from '../../types';
|
|
3
|
+
export declare class ImageDimensionsEntity extends BaseEntity {
|
|
4
|
+
id: string;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const imageDimensionsEntityFrom: (args: IBasicImageDimensions) => ImageDimensionsEntity;
|
|
9
9
|
//# sourceMappingURL=ImageDimensionsEntity.d.ts.map
|
|
@@ -1,39 +1,39 @@
|
|
|
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.imageDimensionsEntityFrom = exports.ImageDimensionsEntity = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
let ImageDimensionsEntity = class ImageDimensionsEntity extends typeorm_1.BaseEntity {
|
|
15
|
-
};
|
|
16
|
-
__decorate([
|
|
17
|
-
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
18
|
-
__metadata("design:type", String)
|
|
19
|
-
], ImageDimensionsEntity.prototype, "id", void 0);
|
|
20
|
-
__decorate([
|
|
21
|
-
(0, typeorm_1.Column)({ name: 'width', nullable: false, unique: false }),
|
|
22
|
-
__metadata("design:type", Number)
|
|
23
|
-
], ImageDimensionsEntity.prototype, "width", void 0);
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, typeorm_1.Column)({ name: 'height', nullable: false, unique: false }),
|
|
26
|
-
__metadata("design:type", Number)
|
|
27
|
-
], ImageDimensionsEntity.prototype, "height", void 0);
|
|
28
|
-
ImageDimensionsEntity = __decorate([
|
|
29
|
-
(0, typeorm_1.Entity)('ImageDimensions')
|
|
30
|
-
], ImageDimensionsEntity);
|
|
31
|
-
exports.ImageDimensionsEntity = ImageDimensionsEntity;
|
|
32
|
-
const imageDimensionsEntityFrom = (args) => {
|
|
33
|
-
const imageDimensionsEntity = new ImageDimensionsEntity();
|
|
34
|
-
imageDimensionsEntity.width = args.width;
|
|
35
|
-
imageDimensionsEntity.height = args.height;
|
|
36
|
-
return imageDimensionsEntity;
|
|
37
|
-
};
|
|
38
|
-
exports.imageDimensionsEntityFrom = imageDimensionsEntityFrom;
|
|
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.imageDimensionsEntityFrom = exports.ImageDimensionsEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let ImageDimensionsEntity = class ImageDimensionsEntity extends typeorm_1.BaseEntity {
|
|
15
|
+
};
|
|
16
|
+
__decorate([
|
|
17
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
18
|
+
__metadata("design:type", String)
|
|
19
|
+
], ImageDimensionsEntity.prototype, "id", void 0);
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.Column)({ name: 'width', nullable: false, unique: false }),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], ImageDimensionsEntity.prototype, "width", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({ name: 'height', nullable: false, unique: false }),
|
|
26
|
+
__metadata("design:type", Number)
|
|
27
|
+
], ImageDimensionsEntity.prototype, "height", void 0);
|
|
28
|
+
ImageDimensionsEntity = __decorate([
|
|
29
|
+
(0, typeorm_1.Entity)('ImageDimensions')
|
|
30
|
+
], ImageDimensionsEntity);
|
|
31
|
+
exports.ImageDimensionsEntity = ImageDimensionsEntity;
|
|
32
|
+
const imageDimensionsEntityFrom = (args) => {
|
|
33
|
+
const imageDimensionsEntity = new ImageDimensionsEntity();
|
|
34
|
+
imageDimensionsEntity.width = args.width;
|
|
35
|
+
imageDimensionsEntity.height = args.height;
|
|
36
|
+
return imageDimensionsEntity;
|
|
37
|
+
};
|
|
38
|
+
exports.imageDimensionsEntityFrom = imageDimensionsEntityFrom;
|
|
39
39
|
//# sourceMappingURL=ImageDimensionsEntity.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { BaseEntity } from 'typeorm';
|
|
2
|
-
import { IssuerLocaleBrandingEntity } from './IssuerLocaleBrandingEntity';
|
|
3
|
-
import { IBasicIssuerBranding } from '../../types';
|
|
4
|
-
export declare class IssuerBrandingEntity extends BaseEntity {
|
|
5
|
-
id: string;
|
|
6
|
-
issuerCorrelationId: string;
|
|
7
|
-
localeBranding: Array<IssuerLocaleBrandingEntity>;
|
|
8
|
-
createdAt: Date;
|
|
9
|
-
lastUpdatedAt: Date;
|
|
10
|
-
updateUpdatedDate(): void;
|
|
11
|
-
validate(): Promise<undefined>;
|
|
12
|
-
}
|
|
13
|
-
export declare const issuerBrandingEntityFrom: (args: IBasicIssuerBranding) => IssuerBrandingEntity;
|
|
1
|
+
import { BaseEntity } from 'typeorm';
|
|
2
|
+
import { IssuerLocaleBrandingEntity } from './IssuerLocaleBrandingEntity';
|
|
3
|
+
import { IBasicIssuerBranding } from '../../types';
|
|
4
|
+
export declare class IssuerBrandingEntity extends BaseEntity {
|
|
5
|
+
id: string;
|
|
6
|
+
issuerCorrelationId: string;
|
|
7
|
+
localeBranding: Array<IssuerLocaleBrandingEntity>;
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
lastUpdatedAt: Date;
|
|
10
|
+
updateUpdatedDate(): void;
|
|
11
|
+
validate(): Promise<undefined>;
|
|
12
|
+
}
|
|
13
|
+
export declare const issuerBrandingEntityFrom: (args: IBasicIssuerBranding) => IssuerBrandingEntity;
|
|
14
14
|
//# sourceMappingURL=IssuerBrandingEntity.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.issuerBrandingEntityFrom = exports.IssuerBrandingEntity = void 0;
|
|
22
|
-
const typeorm_1 = require("typeorm");
|
|
23
|
-
const class_validator_1 = require("class-validator");
|
|
24
|
-
const IssuerLocaleBrandingEntity_1 = require("./IssuerLocaleBrandingEntity");
|
|
25
|
-
let IssuerBrandingEntity = class IssuerBrandingEntity extends typeorm_1.BaseEntity {
|
|
26
|
-
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
27
|
-
updateUpdatedDate() {
|
|
28
|
-
this.lastUpdatedAt = new Date();
|
|
29
|
-
}
|
|
30
|
-
validate() {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const validation = yield (0, class_validator_1.validate)(this);
|
|
33
|
-
if (validation.length > 0) {
|
|
34
|
-
return Promise.reject(Error(Object.values(validation[0].constraints)[0]));
|
|
35
|
-
}
|
|
36
|
-
return;
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
__decorate([
|
|
41
|
-
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
42
|
-
__metadata("design:type", String)
|
|
43
|
-
], IssuerBrandingEntity.prototype, "id", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
(0, typeorm_1.Column)({ name: 'issuerCorrelationId', length: 255, nullable: false, unique: true }),
|
|
46
|
-
(0, class_validator_1.IsNotEmpty)({ message: 'Blank issuerCorrelationIds are not allowed' }),
|
|
47
|
-
__metadata("design:type", String)
|
|
48
|
-
], IssuerBrandingEntity.prototype, "issuerCorrelationId", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, typeorm_1.OneToMany)(() => IssuerLocaleBrandingEntity_1.IssuerLocaleBrandingEntity, (issuerLocaleBrandingEntity) => issuerLocaleBrandingEntity.issuerBranding, {
|
|
51
|
-
cascade: true,
|
|
52
|
-
onDelete: 'CASCADE',
|
|
53
|
-
eager: true,
|
|
54
|
-
nullable: false,
|
|
55
|
-
}),
|
|
56
|
-
(0, class_validator_1.ArrayMinSize)(1, { message: 'localeBranding cannot be empty' }),
|
|
57
|
-
__metadata("design:type", Array)
|
|
58
|
-
], IssuerBrandingEntity.prototype, "localeBranding", void 0);
|
|
59
|
-
__decorate([
|
|
60
|
-
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', nullable: false }),
|
|
61
|
-
__metadata("design:type", Date)
|
|
62
|
-
], IssuerBrandingEntity.prototype, "createdAt", void 0);
|
|
63
|
-
__decorate([
|
|
64
|
-
(0, typeorm_1.UpdateDateColumn)({ name: 'last_updated_at', nullable: false }),
|
|
65
|
-
__metadata("design:type", Date
|
|
66
|
-
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
67
|
-
)
|
|
68
|
-
], IssuerBrandingEntity.prototype, "lastUpdatedAt", void 0);
|
|
69
|
-
__decorate([
|
|
70
|
-
(0, typeorm_1.BeforeInsert)(),
|
|
71
|
-
(0, typeorm_1.BeforeUpdate)(),
|
|
72
|
-
__metadata("design:type", Function),
|
|
73
|
-
__metadata("design:paramtypes", []),
|
|
74
|
-
__metadata("design:returntype", void 0)
|
|
75
|
-
], IssuerBrandingEntity.prototype, "updateUpdatedDate", null);
|
|
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", Promise)
|
|
82
|
-
], IssuerBrandingEntity.prototype, "validate", null);
|
|
83
|
-
IssuerBrandingEntity = __decorate([
|
|
84
|
-
(0, typeorm_1.Entity)('IssuerBranding'),
|
|
85
|
-
(0, typeorm_1.Index)('IDX_IssuerBrandingEntity_issuerCorrelationId', ['issuerCorrelationId'])
|
|
86
|
-
], IssuerBrandingEntity);
|
|
87
|
-
exports.IssuerBrandingEntity = IssuerBrandingEntity;
|
|
88
|
-
const issuerBrandingEntityFrom = (args) => {
|
|
89
|
-
const issuerBrandingEntity = new IssuerBrandingEntity();
|
|
90
|
-
issuerBrandingEntity.issuerCorrelationId = args.issuerCorrelationId;
|
|
91
|
-
issuerBrandingEntity.localeBranding = args.localeBranding.map((localeBranding) => (0, IssuerLocaleBrandingEntity_1.issuerLocaleBrandingEntityFrom)(localeBranding));
|
|
92
|
-
return issuerBrandingEntity;
|
|
93
|
-
};
|
|
94
|
-
exports.issuerBrandingEntityFrom = issuerBrandingEntityFrom;
|
|
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.issuerBrandingEntityFrom = exports.IssuerBrandingEntity = void 0;
|
|
22
|
+
const typeorm_1 = require("typeorm");
|
|
23
|
+
const class_validator_1 = require("class-validator");
|
|
24
|
+
const IssuerLocaleBrandingEntity_1 = require("./IssuerLocaleBrandingEntity");
|
|
25
|
+
let IssuerBrandingEntity = class IssuerBrandingEntity extends typeorm_1.BaseEntity {
|
|
26
|
+
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
27
|
+
updateUpdatedDate() {
|
|
28
|
+
this.lastUpdatedAt = new Date();
|
|
29
|
+
}
|
|
30
|
+
validate() {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
const validation = yield (0, class_validator_1.validate)(this);
|
|
33
|
+
if (validation.length > 0) {
|
|
34
|
+
return Promise.reject(Error(Object.values(validation[0].constraints)[0]));
|
|
35
|
+
}
|
|
36
|
+
return;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], IssuerBrandingEntity.prototype, "id", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ name: 'issuerCorrelationId', length: 255, nullable: false, unique: true }),
|
|
46
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Blank issuerCorrelationIds are not allowed' }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], IssuerBrandingEntity.prototype, "issuerCorrelationId", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.OneToMany)(() => IssuerLocaleBrandingEntity_1.IssuerLocaleBrandingEntity, (issuerLocaleBrandingEntity) => issuerLocaleBrandingEntity.issuerBranding, {
|
|
51
|
+
cascade: true,
|
|
52
|
+
onDelete: 'CASCADE',
|
|
53
|
+
eager: true,
|
|
54
|
+
nullable: false,
|
|
55
|
+
}),
|
|
56
|
+
(0, class_validator_1.ArrayMinSize)(1, { message: 'localeBranding cannot be empty' }),
|
|
57
|
+
__metadata("design:type", Array)
|
|
58
|
+
], IssuerBrandingEntity.prototype, "localeBranding", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', nullable: false }),
|
|
61
|
+
__metadata("design:type", Date)
|
|
62
|
+
], IssuerBrandingEntity.prototype, "createdAt", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'last_updated_at', nullable: false }),
|
|
65
|
+
__metadata("design:type", Date
|
|
66
|
+
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
67
|
+
)
|
|
68
|
+
], IssuerBrandingEntity.prototype, "lastUpdatedAt", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
71
|
+
(0, typeorm_1.BeforeUpdate)(),
|
|
72
|
+
__metadata("design:type", Function),
|
|
73
|
+
__metadata("design:paramtypes", []),
|
|
74
|
+
__metadata("design:returntype", void 0)
|
|
75
|
+
], IssuerBrandingEntity.prototype, "updateUpdatedDate", null);
|
|
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", Promise)
|
|
82
|
+
], IssuerBrandingEntity.prototype, "validate", null);
|
|
83
|
+
IssuerBrandingEntity = __decorate([
|
|
84
|
+
(0, typeorm_1.Entity)('IssuerBranding'),
|
|
85
|
+
(0, typeorm_1.Index)('IDX_IssuerBrandingEntity_issuerCorrelationId', ['issuerCorrelationId'])
|
|
86
|
+
], IssuerBrandingEntity);
|
|
87
|
+
exports.IssuerBrandingEntity = IssuerBrandingEntity;
|
|
88
|
+
const issuerBrandingEntityFrom = (args) => {
|
|
89
|
+
const issuerBrandingEntity = new IssuerBrandingEntity();
|
|
90
|
+
issuerBrandingEntity.issuerCorrelationId = args.issuerCorrelationId;
|
|
91
|
+
issuerBrandingEntity.localeBranding = args.localeBranding.map((localeBranding) => (0, IssuerLocaleBrandingEntity_1.issuerLocaleBrandingEntityFrom)(localeBranding));
|
|
92
|
+
return issuerBrandingEntity;
|
|
93
|
+
};
|
|
94
|
+
exports.issuerBrandingEntityFrom = issuerBrandingEntityFrom;
|
|
95
95
|
//# sourceMappingURL=IssuerBrandingEntity.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IBasicIssuerLocaleBranding } from '../../types';
|
|
2
|
-
import { IssuerBrandingEntity } from './IssuerBrandingEntity';
|
|
3
|
-
import { BaseLocaleBrandingEntity } from './BaseLocaleBrandingEntity';
|
|
4
|
-
export declare class IssuerLocaleBrandingEntity extends BaseLocaleBrandingEntity {
|
|
5
|
-
issuerBranding: IssuerBrandingEntity;
|
|
6
|
-
issuerBrandingId: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const issuerLocaleBrandingEntityFrom: (args: IBasicIssuerLocaleBranding) => IssuerLocaleBrandingEntity;
|
|
1
|
+
import { IBasicIssuerLocaleBranding } from '../../types';
|
|
2
|
+
import { IssuerBrandingEntity } from './IssuerBrandingEntity';
|
|
3
|
+
import { BaseLocaleBrandingEntity } from './BaseLocaleBrandingEntity';
|
|
4
|
+
export declare class IssuerLocaleBrandingEntity extends BaseLocaleBrandingEntity {
|
|
5
|
+
issuerBranding: IssuerBrandingEntity;
|
|
6
|
+
issuerBrandingId: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const issuerLocaleBrandingEntityFrom: (args: IBasicIssuerLocaleBranding) => IssuerLocaleBrandingEntity;
|
|
9
9
|
//# sourceMappingURL=IssuerLocaleBrandingEntity.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.issuerLocaleBrandingEntityFrom = exports.IssuerLocaleBrandingEntity = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const BackgroundAttributesEntity_1 = require("./BackgroundAttributesEntity");
|
|
15
|
-
const ImageAttributesEntity_1 = require("./ImageAttributesEntity");
|
|
16
|
-
const IssuerBrandingEntity_1 = require("./IssuerBrandingEntity");
|
|
17
|
-
const BaseLocaleBrandingEntity_1 = require("./BaseLocaleBrandingEntity");
|
|
18
|
-
const TextAttributesEntity_1 = require("./TextAttributesEntity");
|
|
19
|
-
const validators_1 = require("../validators");
|
|
20
|
-
let IssuerLocaleBrandingEntity = class IssuerLocaleBrandingEntity extends BaseLocaleBrandingEntity_1.BaseLocaleBrandingEntity {
|
|
21
|
-
};
|
|
22
|
-
__decorate([
|
|
23
|
-
(0, typeorm_1.ManyToOne)(() => IssuerBrandingEntity_1.IssuerBrandingEntity, (issuerBranding) => issuerBranding.localeBranding, {
|
|
24
|
-
onDelete: 'CASCADE',
|
|
25
|
-
}),
|
|
26
|
-
(0, typeorm_1.JoinColumn)({ name: 'issuerBrandingId' }),
|
|
27
|
-
__metadata("design:type", IssuerBrandingEntity_1.IssuerBrandingEntity)
|
|
28
|
-
], IssuerLocaleBrandingEntity.prototype, "issuerBranding", void 0);
|
|
29
|
-
__decorate([
|
|
30
|
-
(0, typeorm_1.Column)({ name: 'issuerBrandingId', nullable: false }),
|
|
31
|
-
__metadata("design:type", String)
|
|
32
|
-
], IssuerLocaleBrandingEntity.prototype, "issuerBrandingId", void 0);
|
|
33
|
-
IssuerLocaleBrandingEntity = __decorate([
|
|
34
|
-
(0, typeorm_1.ChildEntity)('IssuerLocaleBranding'),
|
|
35
|
-
(0, typeorm_1.Index)('IDX_IssuerLocaleBrandingEntity_issuerBranding_locale', ['issuerBranding', 'locale'], { unique: true })
|
|
36
|
-
], IssuerLocaleBrandingEntity);
|
|
37
|
-
exports.IssuerLocaleBrandingEntity = IssuerLocaleBrandingEntity;
|
|
38
|
-
const issuerLocaleBrandingEntityFrom = (args) => {
|
|
39
|
-
const issuerLocaleBrandingEntity = new IssuerLocaleBrandingEntity();
|
|
40
|
-
issuerLocaleBrandingEntity.alias = (0, validators_1.isEmptyString)(args.alias) ? undefined : args.alias;
|
|
41
|
-
issuerLocaleBrandingEntity.locale = args.locale ? args.locale : '';
|
|
42
|
-
issuerLocaleBrandingEntity.logo = args.logo ? (0, ImageAttributesEntity_1.imageAttributesEntityFrom)(args.logo) : undefined;
|
|
43
|
-
issuerLocaleBrandingEntity.description = (0, validators_1.isEmptyString)(args.description) ? undefined : args.description;
|
|
44
|
-
issuerLocaleBrandingEntity.background = args.background ? (0, BackgroundAttributesEntity_1.backgroundAttributesEntityFrom)(args.background) : undefined;
|
|
45
|
-
issuerLocaleBrandingEntity.text = args.text ? (0, TextAttributesEntity_1.textAttributesEntityFrom)(args.text) : undefined;
|
|
46
|
-
return issuerLocaleBrandingEntity;
|
|
47
|
-
};
|
|
48
|
-
exports.issuerLocaleBrandingEntityFrom = issuerLocaleBrandingEntityFrom;
|
|
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.issuerLocaleBrandingEntityFrom = exports.IssuerLocaleBrandingEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BackgroundAttributesEntity_1 = require("./BackgroundAttributesEntity");
|
|
15
|
+
const ImageAttributesEntity_1 = require("./ImageAttributesEntity");
|
|
16
|
+
const IssuerBrandingEntity_1 = require("./IssuerBrandingEntity");
|
|
17
|
+
const BaseLocaleBrandingEntity_1 = require("./BaseLocaleBrandingEntity");
|
|
18
|
+
const TextAttributesEntity_1 = require("./TextAttributesEntity");
|
|
19
|
+
const validators_1 = require("../validators");
|
|
20
|
+
let IssuerLocaleBrandingEntity = class IssuerLocaleBrandingEntity extends BaseLocaleBrandingEntity_1.BaseLocaleBrandingEntity {
|
|
21
|
+
};
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.ManyToOne)(() => IssuerBrandingEntity_1.IssuerBrandingEntity, (issuerBranding) => issuerBranding.localeBranding, {
|
|
24
|
+
onDelete: 'CASCADE',
|
|
25
|
+
}),
|
|
26
|
+
(0, typeorm_1.JoinColumn)({ name: 'issuerBrandingId' }),
|
|
27
|
+
__metadata("design:type", IssuerBrandingEntity_1.IssuerBrandingEntity)
|
|
28
|
+
], IssuerLocaleBrandingEntity.prototype, "issuerBranding", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ name: 'issuerBrandingId', nullable: false }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], IssuerLocaleBrandingEntity.prototype, "issuerBrandingId", void 0);
|
|
33
|
+
IssuerLocaleBrandingEntity = __decorate([
|
|
34
|
+
(0, typeorm_1.ChildEntity)('IssuerLocaleBranding'),
|
|
35
|
+
(0, typeorm_1.Index)('IDX_IssuerLocaleBrandingEntity_issuerBranding_locale', ['issuerBranding', 'locale'], { unique: true })
|
|
36
|
+
], IssuerLocaleBrandingEntity);
|
|
37
|
+
exports.IssuerLocaleBrandingEntity = IssuerLocaleBrandingEntity;
|
|
38
|
+
const issuerLocaleBrandingEntityFrom = (args) => {
|
|
39
|
+
const issuerLocaleBrandingEntity = new IssuerLocaleBrandingEntity();
|
|
40
|
+
issuerLocaleBrandingEntity.alias = (0, validators_1.isEmptyString)(args.alias) ? undefined : args.alias;
|
|
41
|
+
issuerLocaleBrandingEntity.locale = args.locale ? args.locale : '';
|
|
42
|
+
issuerLocaleBrandingEntity.logo = args.logo ? (0, ImageAttributesEntity_1.imageAttributesEntityFrom)(args.logo) : undefined;
|
|
43
|
+
issuerLocaleBrandingEntity.description = (0, validators_1.isEmptyString)(args.description) ? undefined : args.description;
|
|
44
|
+
issuerLocaleBrandingEntity.background = args.background ? (0, BackgroundAttributesEntity_1.backgroundAttributesEntityFrom)(args.background) : undefined;
|
|
45
|
+
issuerLocaleBrandingEntity.text = args.text ? (0, TextAttributesEntity_1.textAttributesEntityFrom)(args.text) : undefined;
|
|
46
|
+
return issuerLocaleBrandingEntity;
|
|
47
|
+
};
|
|
48
|
+
exports.issuerLocaleBrandingEntityFrom = issuerLocaleBrandingEntityFrom;
|
|
49
49
|
//# sourceMappingURL=IssuerLocaleBrandingEntity.js.map
|