@sphereon/ssi-sdk.data-store 0.23.5-unstable.39 → 0.23.5-unstable.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/contact/PresentationDefinitionItemEntity.d.ts +13 -0
- package/dist/entities/contact/PresentationDefinitionItemEntity.d.ts.map +1 -0
- package/dist/entities/contact/PresentationDefinitionItemEntity.js +69 -0
- package/dist/entities/contact/PresentationDefinitionItemEntity.js.map +1 -0
- package/dist/pd/AbstractPDStore.d.ts +10 -0
- package/dist/pd/AbstractPDStore.d.ts.map +1 -0
- package/dist/pd/AbstractPDStore.js +7 -0
- package/dist/pd/AbstractPDStore.js.map +1 -0
- package/dist/pd/PDStore.d.ts +15 -0
- package/dist/pd/PDStore.d.ts.map +1 -0
- package/dist/pd/PDStore.js +87 -0
- package/dist/pd/PDStore.js.map +1 -0
- package/dist/types/pd/IAbstractPDStore.d.ts +14 -0
- package/dist/types/pd/IAbstractPDStore.d.ts.map +1 -0
- package/dist/types/pd/IAbstractPDStore.js +3 -0
- package/dist/types/pd/IAbstractPDStore.js.map +1 -0
- package/dist/types/pd/pd.d.ts +15 -0
- package/dist/types/pd/pd.d.ts.map +1 -0
- package/dist/types/pd/pd.js +3 -0
- package/dist/types/pd/pd.js.map +1 -0
- package/package.json +4 -4
- package/dist/entities/contact/ContactEntity.d.ts +0 -16
- package/dist/entities/contact/ContactEntity.d.ts.map +0 -1
- package/dist/entities/contact/ContactEntity.js +0 -164
- package/dist/entities/contact/ContactEntity.js.map +0 -1
- package/dist/entities/contact/ContactMetadataItemEntity.d.ts +0 -14
- package/dist/entities/contact/ContactMetadataItemEntity.d.ts.map +0 -1
- package/dist/entities/contact/ContactMetadataItemEntity.js +0 -88
- package/dist/entities/contact/ContactMetadataItemEntity.js.map +0 -1
- package/dist/migrations/generic/1-CreateIssuanceBranding.d.ts +0 -7
- package/dist/migrations/generic/1-CreateIssuanceBranding.d.ts.map +0 -1
- package/dist/migrations/generic/1-CreateIssuanceBranding.js +0 -96
- package/dist/migrations/generic/1-CreateIssuanceBranding.js.map +0 -1
- package/dist/migrations/generic/2-CreateContacts.d.ts +0 -7
- package/dist/migrations/generic/2-CreateContacts.d.ts.map +0 -1
- package/dist/migrations/generic/2-CreateContacts.js +0 -78
- package/dist/migrations/generic/2-CreateContacts.js.map +0 -1
- package/dist/migrations/generic/3-CreateStatusList.d.ts +0 -7
- package/dist/migrations/generic/3-CreateStatusList.d.ts.map +0 -1
- package/dist/migrations/generic/3-CreateStatusList.js +0 -72
- package/dist/migrations/generic/3-CreateStatusList.js.map +0 -1
- package/dist/migrations/generic/8-CreateContacts.d.ts +0 -7
- package/dist/migrations/generic/8-CreateContacts.d.ts.map +0 -1
- package/dist/migrations/generic/8-CreateContacts.js +0 -78
- package/dist/migrations/generic/8-CreateContacts.js.map +0 -1
- package/dist/migrations/generic/9-CreateContacts.d.ts +0 -7
- package/dist/migrations/generic/9-CreateContacts.d.ts.map +0 -1
- package/dist/migrations/generic/9-CreateContacts.js +0 -78
- package/dist/migrations/generic/9-CreateContacts.js.map +0 -1
- package/dist/migrations/postgres/1710438363001-CreateContacts.d.ts +0 -7
- package/dist/migrations/postgres/1710438363001-CreateContacts.d.ts.map +0 -1
- package/dist/migrations/postgres/1710438363001-CreateContacts.js +0 -71
- package/dist/migrations/postgres/1710438363001-CreateContacts.js.map +0 -1
- package/dist/migrations/postgres/1715761125001-CreateContacts.d.ts +0 -7
- package/dist/migrations/postgres/1715761125001-CreateContacts.d.ts.map +0 -1
- package/dist/migrations/postgres/1715761125001-CreateContacts.js +0 -74
- package/dist/migrations/postgres/1715761125001-CreateContacts.js.map +0 -1
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.d.ts +0 -7
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.d.ts.map +0 -1
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.js +0 -32
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.js.map +0 -1
- package/dist/migrations/postgres/uuid.d.ts +0 -3
- package/dist/migrations/postgres/uuid.d.ts.map +0 -1
- package/dist/migrations/postgres/uuid.js +0 -25
- package/dist/migrations/postgres/uuid.js.map +0 -1
- package/dist/migrations/sqlite/1710438363002-CreateContacts.d.ts +0 -7
- package/dist/migrations/sqlite/1710438363002-CreateContacts.d.ts.map +0 -1
- package/dist/migrations/sqlite/1710438363002-CreateContacts.js +0 -68
- package/dist/migrations/sqlite/1710438363002-CreateContacts.js.map +0 -1
- package/dist/migrations/sqlite/1715761125002-CreateContacts.d.ts +0 -7
- package/dist/migrations/sqlite/1715761125002-CreateContacts.d.ts.map +0 -1
- package/dist/migrations/sqlite/1715761125002-CreateContacts.js +0 -73
- package/dist/migrations/sqlite/1715761125002-CreateContacts.js.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseEntity } from 'typeorm';
|
|
2
|
+
export declare class PresentationDefinitionItemEntity extends BaseEntity {
|
|
3
|
+
id: string;
|
|
4
|
+
tenantId?: string;
|
|
5
|
+
pdId: string;
|
|
6
|
+
version: string;
|
|
7
|
+
purpose?: string;
|
|
8
|
+
definitionPayload: string;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
lastUpdatedAt: Date;
|
|
11
|
+
updateUpdatedDate(): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=PresentationDefinitionItemEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PresentationDefinitionItemEntity.d.ts","sourceRoot":"","sources":["../../../src/entities/contact/PresentationDefinitionItemEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0G,MAAM,SAAS,CAAA;AAG5I,qBACa,gCAAiC,SAAQ,UAAU;IAE9D,EAAE,EAAG,MAAM,CAAA;IAGX,QAAQ,CAAC,EAAE,MAAM,CAAA;IAIjB,IAAI,EAAG,MAAM,CAAA;IAIb,OAAO,EAAG,MAAM,CAAA;IAGhB,OAAO,CAAC,EAAE,MAAM,CAAA;IAIhB,iBAAiB,EAAG,MAAM,CAAA;IAG1B,SAAS,EAAG,IAAI,CAAA;IAGhB,aAAa,EAAG,IAAI,CAAA;IAKpB,iBAAiB,IAAI,IAAI;CAG1B"}
|
|
@@ -0,0 +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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PresentationDefinitionItemEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
let PresentationDefinitionItemEntity = class PresentationDefinitionItemEntity extends typeorm_1.BaseEntity {
|
|
16
|
+
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
17
|
+
updateUpdatedDate() {
|
|
18
|
+
this.lastUpdatedAt = new Date();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.PresentationDefinitionItemEntity = PresentationDefinitionItemEntity;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], PresentationDefinitionItemEntity.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ name: 'tenant_id', length: 255, nullable: true, unique: false }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], PresentationDefinitionItemEntity.prototype, "tenantId", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ name: 'pd_id', length: 255, nullable: true, unique: false }),
|
|
32
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'pdId field must not be empty' }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], PresentationDefinitionItemEntity.prototype, "pdId", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ name: 'version', length: 255, nullable: false, unique: false }),
|
|
37
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'version field must not be empty' }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], PresentationDefinitionItemEntity.prototype, "version", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ name: 'purpose', length: 255, nullable: true, unique: false }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], PresentationDefinitionItemEntity.prototype, "purpose", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ name: 'definition_payload', type: 'text', nullable: false, unique: false }),
|
|
46
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'definitionPayload field must not be empty' }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], PresentationDefinitionItemEntity.prototype, "definitionPayload", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', nullable: false }),
|
|
51
|
+
__metadata("design:type", Date)
|
|
52
|
+
], PresentationDefinitionItemEntity.prototype, "createdAt", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'last_updated_at', nullable: false }),
|
|
55
|
+
__metadata("design:type", Date
|
|
56
|
+
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
57
|
+
)
|
|
58
|
+
], PresentationDefinitionItemEntity.prototype, "lastUpdatedAt", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
61
|
+
(0, typeorm_1.BeforeUpdate)(),
|
|
62
|
+
__metadata("design:type", Function),
|
|
63
|
+
__metadata("design:paramtypes", []),
|
|
64
|
+
__metadata("design:returntype", void 0)
|
|
65
|
+
], PresentationDefinitionItemEntity.prototype, "updateUpdatedDate", null);
|
|
66
|
+
exports.PresentationDefinitionItemEntity = PresentationDefinitionItemEntity = __decorate([
|
|
67
|
+
(0, typeorm_1.Entity)('PresentationDefinitionItemEntity')
|
|
68
|
+
], PresentationDefinitionItemEntity);
|
|
69
|
+
//# sourceMappingURL=PresentationDefinitionItemEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PresentationDefinitionItemEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/PresentationDefinitionItemEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA4I;AAC5I,qDAA4C;AAGrC,IAAM,gCAAgC,GAAtC,MAAM,gCAAiC,SAAQ,oBAAU;IA4B9D,qHAAqH;IAGrH,iBAAiB;QACf,IAAI,CAAC,aAAa,GAAG,IAAI,IAAI,EAAE,CAAA;IACjC,CAAC;CACF,CAAA;AAlCY,4EAAgC;AAE3C;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;4DACpB;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;kEACzD;AAIjB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAA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PresentationDefinitionItem, PresentationDefinitionItem } from '../types';
|
|
3
|
+
export declare abstract class AbstractPdStore {
|
|
4
|
+
abstract getDefinition(args: GetPDArgs): Promise<PresentationDefinitionItem>;
|
|
5
|
+
abstract getDefinitions(args: GetPDsArgs): Promise<Array<PresentationDefinitionItem>>;
|
|
6
|
+
abstract addDefinition(args: NonPersistedPresentationDefinitionItem): Promise<PresentationDefinitionItem>;
|
|
7
|
+
abstract updateDefinition(args: PresentationDefinitionItem): Promise<PresentationDefinitionItem>;
|
|
8
|
+
abstract deleteDefinition(args: DeletePDArgs): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=AbstractPDStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbstractPDStore.d.ts","sourceRoot":"","sources":["../../src/pd/AbstractPDStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAClF,OAAO,EAAE,sCAAsC,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAE7F,8BAAsB,eAAe;IACnC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAC5E,QAAQ,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACrF,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,sCAAsC,GAAG,OAAO,CAAC,0BAA0B,CAAC;IACzG,QAAQ,CAAC,gBAAgB,CAAC,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAChG,QAAQ,CAAC,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CAC7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbstractPDStore.js","sourceRoot":"","sources":["../../src/pd/AbstractPDStore.ts"],"names":[],"mappings":";;;AAGA,MAAsB,eAAe;CAMpC;AAND,0CAMC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OrPromise } from '@sphereon/ssi-types';
|
|
2
|
+
import { DataSource } from 'typeorm';
|
|
3
|
+
import { AbstractPdStore } from './AbstractPDStore';
|
|
4
|
+
import { GetPDArgs, GetPDsArgs, DeletePDArgs } from '../types/pd/IAbstractPDStore';
|
|
5
|
+
import { NonPersistedPresentationDefinitionItem, PresentationDefinitionItem } from '../types';
|
|
6
|
+
export declare class PDStore extends AbstractPdStore {
|
|
7
|
+
private readonly dbConnection;
|
|
8
|
+
constructor(dbConnection: OrPromise<DataSource>);
|
|
9
|
+
getDefinition: (args: GetPDArgs) => Promise<PresentationDefinitionItem>;
|
|
10
|
+
getDefinitions: (args: GetPDsArgs) => Promise<Array<PresentationDefinitionItem>>;
|
|
11
|
+
addDefinition: (item: NonPersistedPresentationDefinitionItem) => Promise<PresentationDefinitionItem>;
|
|
12
|
+
updateDefinition: (item: PresentationDefinitionItem) => Promise<PresentationDefinitionItem>;
|
|
13
|
+
deleteDefinition: (args: DeletePDArgs) => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=PDStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PDStore.d.ts","sourceRoot":"","sources":["../../src/pd/PDStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAM,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAClF,OAAO,EAAE,sCAAsC,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAM7F,qBAAa,OAAQ,SAAQ,eAAe;IAC1C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAuB;gBAExC,YAAY,EAAE,SAAS,CAAC,UAAU,CAAC;IAK/C,aAAa,SAAgB,SAAS,KAAG,QAAQ,0BAA0B,CAAC,CAW3E;IAED,cAAc,SAAgB,UAAU,KAAG,QAAQ,MAAM,0BAA0B,CAAC,CAAC,CAcpF;IAED,aAAa,SAAgB,sCAAsC,KAAG,QAAQ,0BAA0B,CAAC,CAUxG;IAED,gBAAgB,SAAgB,0BAA0B,KAAG,QAAQ,0BAA0B,CAAC,CAiB/F;IAED,gBAAgB,SAAgB,YAAY,KAAG,QAAQ,IAAI,CAAC,CAc3D;CACF"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.PDStore = void 0;
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
17
|
+
const AbstractPDStore_1 = require("./AbstractPDStore");
|
|
18
|
+
const debug_1 = __importDefault(require("debug"));
|
|
19
|
+
const PresentationDefinitionItemEntity_1 = require("../entities/contact/PresentationDefinitionItemEntity");
|
|
20
|
+
const MappingUtils_1 = require("../utils/contact/MappingUtils");
|
|
21
|
+
const debug = (0, debug_1.default)('sphereon:ssi-sdk:pd-store');
|
|
22
|
+
class PDStore extends AbstractPDStore_1.AbstractPdStore {
|
|
23
|
+
constructor(dbConnection) {
|
|
24
|
+
super();
|
|
25
|
+
this.getDefinition = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const { itemId } = args !== null && args !== void 0 ? args : {};
|
|
27
|
+
const pdRepository = (yield this.dbConnection).getRepository(PresentationDefinitionItemEntity_1.PresentationDefinitionItemEntity);
|
|
28
|
+
const result = yield pdRepository.findOne({
|
|
29
|
+
where: { id: itemId },
|
|
30
|
+
});
|
|
31
|
+
if (!result) {
|
|
32
|
+
return Promise.reject(Error(`No presentation definition item found for id: ${itemId}`));
|
|
33
|
+
}
|
|
34
|
+
return (0, MappingUtils_1.presentationDefinitionItemFrom)(result);
|
|
35
|
+
});
|
|
36
|
+
this.getDefinitions = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const { filter } = args;
|
|
38
|
+
const pdRepository = (yield this.dbConnection).getRepository(PresentationDefinitionItemEntity_1.PresentationDefinitionItemEntity);
|
|
39
|
+
const initialResult = yield pdRepository.find(Object.assign({}, (filter && { where: filter })));
|
|
40
|
+
const result = yield pdRepository.find({
|
|
41
|
+
where: {
|
|
42
|
+
id: (0, typeorm_1.In)(initialResult.map((entity) => entity.id)),
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
return result.map((entity) => (0, MappingUtils_1.presentationDefinitionItemFrom)(entity));
|
|
46
|
+
});
|
|
47
|
+
this.addDefinition = (item) => __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
const pdRepository = (yield this.dbConnection).getRepository(PresentationDefinitionItemEntity_1.PresentationDefinitionItemEntity);
|
|
49
|
+
const entity = (0, MappingUtils_1.presentationDefinitionEntityItemFrom)(item);
|
|
50
|
+
debug('Adding presentation definition item', item);
|
|
51
|
+
const result = yield pdRepository.save(entity, {
|
|
52
|
+
transaction: true,
|
|
53
|
+
});
|
|
54
|
+
return (0, MappingUtils_1.presentationDefinitionItemFrom)(result);
|
|
55
|
+
});
|
|
56
|
+
this.updateDefinition = (item) => __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const pdRepository = (yield this.dbConnection).getRepository(PresentationDefinitionItemEntity_1.PresentationDefinitionItemEntity);
|
|
58
|
+
const result = yield pdRepository.findOne({
|
|
59
|
+
where: { id: item.id },
|
|
60
|
+
});
|
|
61
|
+
if (!result) {
|
|
62
|
+
return Promise.reject(Error(`No presentation definition item found for id: ${item.id}`));
|
|
63
|
+
}
|
|
64
|
+
const entity = (0, MappingUtils_1.presentationDefinitionEntityItemFrom)(item);
|
|
65
|
+
debug('Updating presentation definition item', item);
|
|
66
|
+
const updateResult = yield pdRepository.save(entity, {
|
|
67
|
+
transaction: true,
|
|
68
|
+
});
|
|
69
|
+
return (0, MappingUtils_1.presentationDefinitionItemFrom)(updateResult);
|
|
70
|
+
});
|
|
71
|
+
this.deleteDefinition = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
const { itemId } = args;
|
|
73
|
+
const pdRepository = (yield this.dbConnection).getRepository(PresentationDefinitionItemEntity_1.PresentationDefinitionItemEntity);
|
|
74
|
+
const entity = yield pdRepository.findOne({
|
|
75
|
+
where: { id: itemId },
|
|
76
|
+
});
|
|
77
|
+
if (!entity) {
|
|
78
|
+
return Promise.reject(Error(`No identity found for id: ${itemId}`));
|
|
79
|
+
}
|
|
80
|
+
debug('Removing presentation definition item ', entity);
|
|
81
|
+
yield pdRepository.delete(entity.id);
|
|
82
|
+
});
|
|
83
|
+
this.dbConnection = dbConnection;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.PDStore = PDStore;
|
|
87
|
+
//# sourceMappingURL=PDStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PDStore.js","sourceRoot":"","sources":["../../src/pd/PDStore.ts"],"names":[],"mappings":";;;;;;;;;;;;;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AY,GAAqC,MAAM,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE;gBACrF,WAAW,EAAE,IAAI;aAClB,CAAC,CAAA;YAEF,OAAO,IAAA,6CAA8B,EAAC,YAAY,CAAC,CAAA;QACrD,CAAC,CAAA,CAAA;QAED,qBAAgB,GAAG,CAAO,IAAkB,EAAiB,EAAE;YAC7D,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;YAEvB,MAAM,YAAY,GAAG,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,mEAAgC,CAAC,CAAA;YAC9F,MAAM,MAAM,GAA4C,MAAM,YAAY,CAAC,OAAO,CAAC;gBACjF,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;aACtB,CAAC,CAAA;YAEF,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA6B,MAAM,EAAE,CAAC,CAAC,CAAA;YACrE,CAAC;YAED,KAAK,CAAC,wCAAwC,EAAE,MAAM,CAAC,CAAA;YACvD,MAAM,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QACtC,CAAC,CAAA,CAAA;QA7EC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;CA6EF;AAnFD,0BAmFC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NonPersistedPresentationDefinitionItem, PresentationDefinitionItem, PresentationDefinitionItemFilter } from './pd';
|
|
2
|
+
export type FindPDArgs = Array<PresentationDefinitionItemFilter>;
|
|
3
|
+
export type GetPDArgs = {
|
|
4
|
+
itemId: string;
|
|
5
|
+
};
|
|
6
|
+
export type GetPDsArgs = {
|
|
7
|
+
filter?: FindPDArgs;
|
|
8
|
+
};
|
|
9
|
+
export type AddPDArgs = NonPersistedPresentationDefinitionItem;
|
|
10
|
+
export type UpdatePDArgs = PresentationDefinitionItem;
|
|
11
|
+
export type DeletePDArgs = {
|
|
12
|
+
itemId: string;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=IAbstractPDStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAbstractPDStore.d.ts","sourceRoot":"","sources":["../../../src/types/pd/IAbstractPDStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sCAAsC,EAAE,0BAA0B,EAAE,gCAAgC,EAAE,MAAM,MAAM,CAAA;AAE3H,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,gCAAgC,CAAC,CAAA;AAEhE,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,CAAC,EAAE,UAAU,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,sCAAsC,CAAA;AAE9D,MAAM,MAAM,YAAY,GAAG,0BAA0B,CAAA;AAErD,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAbstractPDStore.js","sourceRoot":"","sources":["../../../src/types/pd/IAbstractPDStore.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IPresentationDefinition } from '@sphereon/pex';
|
|
2
|
+
export type PresentationDefinitionItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
tenantId?: string;
|
|
5
|
+
pdId: string;
|
|
6
|
+
version: string;
|
|
7
|
+
purpose?: string;
|
|
8
|
+
definitionPayload: IPresentationDefinition;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
lastUpdatedAt: Date;
|
|
11
|
+
};
|
|
12
|
+
export type NonPersistedPresentationDefinitionItem = Omit<PresentationDefinitionItem, 'id' | 'createdAt' | 'lastUpdatedAt'>;
|
|
13
|
+
export type PartialPresentationDefinitionItem = Partial<PresentationDefinitionItem>;
|
|
14
|
+
export type PresentationDefinitionItemFilter = Partial<Omit<PresentationDefinitionItem, 'definitionPayload'>>;
|
|
15
|
+
//# sourceMappingURL=pd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd.d.ts","sourceRoot":"","sources":["../../../src/types/pd/pd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AAEvD,MAAM,MAAM,0BAA0B,GAAG;IACvC,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,iBAAiB,EAAE,uBAAuB,CAAA;IAC1C,SAAS,EAAE,IAAI,CAAA;IACf,aAAa,EAAE,IAAI,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,sCAAsC,GAAG,IAAI,CAAC,0BAA0B,EAAE,IAAI,GAAG,WAAW,GAAG,eAAe,CAAC,CAAA;AAC3H,MAAM,MAAM,iCAAiC,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACnF,MAAM,MAAM,gCAAgC,GAAG,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,mBAAmB,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd.js","sourceRoot":"","sources":["../../../src/types/pd/pd.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.data-store",
|
|
3
|
-
"version": "0.23.5-unstable.
|
|
3
|
+
"version": "0.23.5-unstable.60+dad072e2",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"typeorm-postgres:migration:run": "pnpm run typeorm -- migration:run -c migration-postgres"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@sphereon/ssi-sdk.core": "0.23.5-unstable.
|
|
17
|
-
"@sphereon/ssi-types": "0.23.5-unstable.
|
|
16
|
+
"@sphereon/ssi-sdk.core": "0.23.5-unstable.60+dad072e2",
|
|
17
|
+
"@sphereon/ssi-types": "0.23.5-unstable.60+dad072e2",
|
|
18
18
|
"@veramo/core": "4.2.0",
|
|
19
19
|
"@veramo/utils": "4.2.0",
|
|
20
20
|
"class-validator": "^0.14.0",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"PostgreSQL",
|
|
45
45
|
"Contact Store"
|
|
46
46
|
],
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "dad072e2a76f00f430d7ee3938a14d35f35a199f"
|
|
48
48
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { BaseEntity } from 'typeorm'
|
|
2
|
-
import { IBasicContact } from '../../types'
|
|
3
|
-
import { IdentityEntity } from './IdentityEntity'
|
|
4
|
-
export declare class ContactEntity extends BaseEntity {
|
|
5
|
-
id: string
|
|
6
|
-
name: string
|
|
7
|
-
alias: string
|
|
8
|
-
uri?: string
|
|
9
|
-
identities: Array<IdentityEntity>
|
|
10
|
-
createdAt: Date
|
|
11
|
-
lastUpdatedAt: Date
|
|
12
|
-
updateUpdatedDate(): void
|
|
13
|
-
validate(): Promise<undefined>
|
|
14
|
-
}
|
|
15
|
-
export declare const contactEntityFrom: (args: IBasicContact) => ContactEntity
|
|
16
|
-
//# sourceMappingURL=ContactEntity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContactEntity.d.ts","sourceRoot":"","sources":["../../../src/entities/contact/ContactEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAUX,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,aAAa,EAAkB,MAAM,aAAa,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAsB,MAAM,kBAAkB,CAAA;AAGrE,qBACa,aAAc,SAAQ,UAAU;IAE3C,EAAE,EAAG,MAAM,CAAA;IAIX,IAAI,EAAG,MAAM,CAAA;IAIb,KAAK,EAAG,MAAM,CAAA;IAGd,GAAG,CAAC,EAAE,MAAM,CAAA;IASZ,UAAU,EAAG,KAAK,CAAC,cAAc,CAAC,CAAA;IAGlC,SAAS,EAAG,IAAI,CAAA;IAGhB,aAAa,EAAG,IAAI,CAAA;IAKpB,iBAAiB;IAMX,QAAQ;CAOf;AAED,eAAO,MAAM,iBAAiB,SAAU,aAAa,KAAG,aAQvD,CAAA"}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
var __decorate =
|
|
3
|
-
(this && this.__decorate) ||
|
|
4
|
-
function (decorators, target, key, desc) {
|
|
5
|
-
var c = arguments.length,
|
|
6
|
-
r = c < 3 ? target : desc === null ? (desc = Object.getOwnPropertyDescriptor(target, key)) : desc,
|
|
7
|
-
d
|
|
8
|
-
if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function') r = Reflect.decorate(decorators, target, key, desc)
|
|
9
|
-
else
|
|
10
|
-
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
|
|
11
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r
|
|
12
|
-
}
|
|
13
|
-
var __metadata =
|
|
14
|
-
(this && this.__metadata) ||
|
|
15
|
-
function (k, v) {
|
|
16
|
-
if (typeof Reflect === 'object' && typeof Reflect.metadata === 'function') return Reflect.metadata(k, v)
|
|
17
|
-
}
|
|
18
|
-
var __awaiter =
|
|
19
|
-
(this && this.__awaiter) ||
|
|
20
|
-
function (thisArg, _arguments, P, generator) {
|
|
21
|
-
function adopt(value) {
|
|
22
|
-
return value instanceof P
|
|
23
|
-
? value
|
|
24
|
-
: new P(function (resolve) {
|
|
25
|
-
resolve(value)
|
|
26
|
-
})
|
|
27
|
-
}
|
|
28
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
29
|
-
function fulfilled(value) {
|
|
30
|
-
try {
|
|
31
|
-
step(generator.next(value))
|
|
32
|
-
} catch (e) {
|
|
33
|
-
reject(e)
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function rejected(value) {
|
|
37
|
-
try {
|
|
38
|
-
step(generator['throw'](value))
|
|
39
|
-
} catch (e) {
|
|
40
|
-
reject(e)
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function step(result) {
|
|
44
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected)
|
|
45
|
-
}
|
|
46
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next())
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
Object.defineProperty(exports, '__esModule', { value: true })
|
|
50
|
-
exports.contactEntityFrom = exports.ContactEntity = void 0
|
|
51
|
-
const typeorm_1 = require('typeorm')
|
|
52
|
-
const IdentityEntity_1 = require('./IdentityEntity')
|
|
53
|
-
const class_validator_1 = require('class-validator')
|
|
54
|
-
let ContactEntity = class ContactEntity extends typeorm_1.BaseEntity {
|
|
55
|
-
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
56
|
-
updateUpdatedDate() {
|
|
57
|
-
this.lastUpdatedAt = new Date()
|
|
58
|
-
}
|
|
59
|
-
validate() {
|
|
60
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
const validation = yield (0, class_validator_1.validate)(this)
|
|
62
|
-
if (validation.length > 0) {
|
|
63
|
-
return Promise.reject(Error(Object.values(validation[0].constraints)[0]))
|
|
64
|
-
}
|
|
65
|
-
return
|
|
66
|
-
})
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
__decorate([(0, typeorm_1.PrimaryGeneratedColumn)('uuid'), __metadata('design:type', String)], ContactEntity.prototype, 'id', void 0)
|
|
70
|
-
__decorate(
|
|
71
|
-
[
|
|
72
|
-
(0, typeorm_1.Column)({ name: 'name', length: 255, nullable: false, unique: true }),
|
|
73
|
-
(0, class_validator_1.IsNotEmpty)({ message: 'Blank names are not allowed' }),
|
|
74
|
-
__metadata('design:type', String),
|
|
75
|
-
],
|
|
76
|
-
ContactEntity.prototype,
|
|
77
|
-
'name',
|
|
78
|
-
void 0
|
|
79
|
-
)
|
|
80
|
-
__decorate(
|
|
81
|
-
[
|
|
82
|
-
(0, typeorm_1.Column)({ name: 'alias', length: 255, nullable: false, unique: true }),
|
|
83
|
-
(0, class_validator_1.IsNotEmpty)({ message: 'Blank aliases are not allowed' }),
|
|
84
|
-
__metadata('design:type', String),
|
|
85
|
-
],
|
|
86
|
-
ContactEntity.prototype,
|
|
87
|
-
'alias',
|
|
88
|
-
void 0
|
|
89
|
-
)
|
|
90
|
-
__decorate([(0, typeorm_1.Column)({ name: 'uri', length: 255 }), __metadata('design:type', String)], ContactEntity.prototype, 'uri', void 0)
|
|
91
|
-
__decorate(
|
|
92
|
-
[
|
|
93
|
-
(0, typeorm_1.OneToMany)(
|
|
94
|
-
() => IdentityEntity_1.IdentityEntity,
|
|
95
|
-
(identity) => identity.contact,
|
|
96
|
-
{
|
|
97
|
-
cascade: true,
|
|
98
|
-
onDelete: 'CASCADE',
|
|
99
|
-
eager: true,
|
|
100
|
-
nullable: false,
|
|
101
|
-
}
|
|
102
|
-
),
|
|
103
|
-
(0, typeorm_1.JoinColumn)({ name: 'identityId' }),
|
|
104
|
-
__metadata('design:type', Array),
|
|
105
|
-
],
|
|
106
|
-
ContactEntity.prototype,
|
|
107
|
-
'identities',
|
|
108
|
-
void 0
|
|
109
|
-
)
|
|
110
|
-
__decorate(
|
|
111
|
-
[(0, typeorm_1.CreateDateColumn)({ name: 'created_at', nullable: false }), __metadata('design:type', Date)],
|
|
112
|
-
ContactEntity.prototype,
|
|
113
|
-
'createdAt',
|
|
114
|
-
void 0
|
|
115
|
-
)
|
|
116
|
-
__decorate(
|
|
117
|
-
[
|
|
118
|
-
(0, typeorm_1.UpdateDateColumn)({ name: 'last_updated_at', nullable: false }),
|
|
119
|
-
__metadata(
|
|
120
|
-
'design:type',
|
|
121
|
-
Date
|
|
122
|
-
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
123
|
-
),
|
|
124
|
-
],
|
|
125
|
-
ContactEntity.prototype,
|
|
126
|
-
'lastUpdatedAt',
|
|
127
|
-
void 0
|
|
128
|
-
)
|
|
129
|
-
__decorate(
|
|
130
|
-
[
|
|
131
|
-
(0, typeorm_1.BeforeInsert)(),
|
|
132
|
-
(0, typeorm_1.BeforeUpdate)(),
|
|
133
|
-
__metadata('design:type', Function),
|
|
134
|
-
__metadata('design:paramtypes', []),
|
|
135
|
-
__metadata('design:returntype', void 0),
|
|
136
|
-
],
|
|
137
|
-
ContactEntity.prototype,
|
|
138
|
-
'updateUpdatedDate',
|
|
139
|
-
null
|
|
140
|
-
)
|
|
141
|
-
__decorate(
|
|
142
|
-
[
|
|
143
|
-
(0, typeorm_1.BeforeInsert)(),
|
|
144
|
-
(0, typeorm_1.BeforeUpdate)(),
|
|
145
|
-
__metadata('design:type', Function),
|
|
146
|
-
__metadata('design:paramtypes', []),
|
|
147
|
-
__metadata('design:returntype', Promise),
|
|
148
|
-
],
|
|
149
|
-
ContactEntity.prototype,
|
|
150
|
-
'validate',
|
|
151
|
-
null
|
|
152
|
-
)
|
|
153
|
-
ContactEntity = __decorate([(0, typeorm_1.Entity)('Contact')], ContactEntity)
|
|
154
|
-
exports.ContactEntity = ContactEntity
|
|
155
|
-
const contactEntityFrom = (args) => {
|
|
156
|
-
const contactEntity = new ContactEntity()
|
|
157
|
-
contactEntity.name = args.name
|
|
158
|
-
contactEntity.alias = args.alias
|
|
159
|
-
contactEntity.uri = args.uri
|
|
160
|
-
contactEntity.identities = args.identities ? args.identities.map((identity) => (0, IdentityEntity_1.identityEntityFrom)(identity)) : []
|
|
161
|
-
return contactEntity
|
|
162
|
-
}
|
|
163
|
-
exports.contactEntityFrom = contactEntityFrom
|
|
164
|
-
//# sourceMappingURL=ContactEntity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContactEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/ContactEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,qCAWgB;AAEhB,qDAAqE;AACrE,qDAAuE;AAGhE,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,oBAAU;IA8B3C,qHAAqH;IAGrH,iBAAiB;QACf,IAAI,CAAC,aAAa,GAAG,IAAI,IAAI,EAAE,CAAA;IACjC,CAAC;IAIK,QAAQ;;YACZ,MAAM,UAAU,GAA2B,MAAM,IAAA,0BAAQ,EAAC,IAAI,CAAC,CAAA;YAC/D,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;gBACzB,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,WAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;aAC3E;YACD,OAAM;QACR,CAAC;KAAA;CACF,CAAA;AA7CC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;yCACpB;AAEX;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACpE,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,6BAA6B,EAAE,CAAC;;2CAC1C;AAEb;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACrE,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,+BAA+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C,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAwB,EAAE,EAAE,CAAC,IAAA,mCAAkB,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAEjI,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA;AARY,QAAA,iBAAiB,qBAQ7B"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BaseEntity } from 'typeorm';
|
|
2
|
-
import { BaseContactEntity } from './BaseContactEntity';
|
|
3
|
-
export declare class ContactMetadataItemEntity extends BaseEntity {
|
|
4
|
-
id: string;
|
|
5
|
-
label: string;
|
|
6
|
-
valueType: string;
|
|
7
|
-
stringValue?: string;
|
|
8
|
-
numberValue?: number;
|
|
9
|
-
dateValue?: Date;
|
|
10
|
-
boolValue?: boolean;
|
|
11
|
-
contact: BaseContactEntity;
|
|
12
|
-
validate(): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=ContactMetadataItemEntity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContactMetadataItemEntity.d.ts","sourceRoot":"","sources":["../../../src/entities/contact/ContactMetadataItemEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,UAAU,EAAyC,MAAM,SAAS,CAAA;AAEnH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAIvD,qBACa,yBAA0B,SAAQ,UAAU;IAEvD,EAAE,EAAG,MAAM,CAAA;IAIX,KAAK,EAAG,MAAM,CAAA;IAId,SAAS,EAAG,MAAM,CAAA;IAGlB,WAAW,CAAC,EAAE,MAAM,CAAA;IAGpB,WAAW,CAAC,EAAE,MAAM,CAAA;IAGpB,SAAS,CAAC,EAAE,IAAI,CAAA;IAGhB,SAAS,CAAC,EAAE,OAAO,CAAA;IAMnB,OAAO,EAAG,iBAAiB,CAAA;IAIrB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAUhC"}
|
|
@@ -1,88 +0,0 @@
|
|
|
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.ContactMetadataItemEntity = void 0;
|
|
22
|
-
const typeorm_1 = require("typeorm");
|
|
23
|
-
const BaseContactEntity_1 = require("./BaseContactEntity");
|
|
24
|
-
const class_validator_1 = require("class-validator");
|
|
25
|
-
const ValidatorUtils_1 = require("../../utils/ValidatorUtils");
|
|
26
|
-
let ContactMetadataItemEntity = class ContactMetadataItemEntity 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
|
-
exports.ContactMetadataItemEntity = ContactMetadataItemEntity;
|
|
41
|
-
__decorate([
|
|
42
|
-
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
43
|
-
__metadata("design:type", String)
|
|
44
|
-
], ContactMetadataItemEntity.prototype, "id", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
(0, typeorm_1.Column)({ name: 'label', length: 255, nullable: false }),
|
|
47
|
-
(0, class_validator_1.IsNotEmpty)({ message: 'Blank metadata labels are not allowed' }),
|
|
48
|
-
__metadata("design:type", String)
|
|
49
|
-
], ContactMetadataItemEntity.prototype, "label", void 0);
|
|
50
|
-
__decorate([
|
|
51
|
-
(0, typeorm_1.Column)({ name: 'valueType', nullable: false }),
|
|
52
|
-
(0, class_validator_1.IsNotEmpty)({ message: 'valueType must not be empty' }),
|
|
53
|
-
__metadata("design:type", String)
|
|
54
|
-
], ContactMetadataItemEntity.prototype, "valueType", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
(0, typeorm_1.Column)({ name: 'stringValue', length: 255, nullable: true }),
|
|
57
|
-
__metadata("design:type", String)
|
|
58
|
-
], ContactMetadataItemEntity.prototype, "stringValue", void 0);
|
|
59
|
-
__decorate([
|
|
60
|
-
(0, typeorm_1.Column)({ name: 'numberValue', nullable: true }),
|
|
61
|
-
__metadata("design:type", Number)
|
|
62
|
-
], ContactMetadataItemEntity.prototype, "numberValue", void 0);
|
|
63
|
-
__decorate([
|
|
64
|
-
(0, typeorm_1.Column)({ name: 'dateValue', nullable: true }),
|
|
65
|
-
__metadata("design:type", Date)
|
|
66
|
-
], ContactMetadataItemEntity.prototype, "dateValue", void 0);
|
|
67
|
-
__decorate([
|
|
68
|
-
(0, typeorm_1.Column)({ name: 'boolValue', nullable: true }),
|
|
69
|
-
__metadata("design:type", Boolean)
|
|
70
|
-
], ContactMetadataItemEntity.prototype, "boolValue", void 0);
|
|
71
|
-
__decorate([
|
|
72
|
-
(0, typeorm_1.ManyToOne)(() => BaseContactEntity_1.BaseContactEntity, (contact) => contact.metadata, {
|
|
73
|
-
cascade: ['insert', 'update'],
|
|
74
|
-
onDelete: 'CASCADE',
|
|
75
|
-
}),
|
|
76
|
-
__metadata("design:type", BaseContactEntity_1.BaseContactEntity)
|
|
77
|
-
], ContactMetadataItemEntity.prototype, "contact", void 0);
|
|
78
|
-
__decorate([
|
|
79
|
-
(0, typeorm_1.BeforeInsert)(),
|
|
80
|
-
(0, typeorm_1.BeforeUpdate)(),
|
|
81
|
-
__metadata("design:type", Function),
|
|
82
|
-
__metadata("design:paramtypes", []),
|
|
83
|
-
__metadata("design:returntype", Promise)
|
|
84
|
-
], ContactMetadataItemEntity.prototype, "validate", null);
|
|
85
|
-
exports.ContactMetadataItemEntity = ContactMetadataItemEntity = __decorate([
|
|
86
|
-
(0, typeorm_1.Entity)('ContactMetadata')
|
|
87
|
-
], ContactMetadataItemEntity);
|
|
88
|
-
//# sourceMappingURL=ContactMetadataItemEntity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContactMetadataItemEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/ContactMetadataItemEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,qCAAmH;AAEnH,2DAAuD;AACvD,qDAAuE;AACvE,+DAA0D;AAGnD,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,oBAAU;IAgCjD,QAAQ;;YACZ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,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DAC3B;AAMnB;IAJC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qCAAiB,EAAE,CAAC,OAA0B,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;QACpF,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;QAC7B,QAAQ,EAAE,SAAS;KACpB,CAAC;8BACQ,qCAAiB;0DAAA;AAIrB;IAFL,IAAA,sBAAY,GAAE;IACd,IAAA,sBAAY,GAAE;;;;yDAUd;oCAzCU,yBAAyB;IADrC,IAAA,gBAAM,EAAC,iBAAiB,CAAC;GACb,yBAAyB,CA0CrC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
-
export declare class CreateIssuanceBranding1659463079429 implements MigrationInterface {
|
|
3
|
-
name: string
|
|
4
|
-
up(queryRunner: QueryRunner): Promise<void>
|
|
5
|
-
down(queryRunner: QueryRunner): Promise<void>
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=1-CreateIssuanceBranding.d.ts.map
|