@sphereon/ssi-sdk.data-store 0.11.1-unstable.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +67 -0
- package/dist/contact/AbstractContactStore.d.ts +15 -0
- package/dist/contact/AbstractContactStore.d.ts.map +1 -0
- package/dist/contact/AbstractContactStore.js +7 -0
- package/dist/contact/AbstractContactStore.js.map +1 -0
- package/dist/contact/ContactStore.d.ts +30 -0
- package/dist/contact/ContactStore.d.ts.map +1 -0
- package/dist/contact/ContactStore.js +281 -0
- package/dist/contact/ContactStore.js.map +1 -0
- package/dist/entities/contact/BaseConfigEntity.d.ts +5 -0
- package/dist/entities/contact/BaseConfigEntity.d.ts.map +1 -0
- package/dist/entities/contact/BaseConfigEntity.js +26 -0
- package/dist/entities/contact/BaseConfigEntity.js.map +1 -0
- package/dist/entities/contact/ConnectionEntity.d.ts +12 -0
- package/dist/entities/contact/ConnectionEntity.d.ts.map +1 -0
- package/dist/entities/contact/ConnectionEntity.js +66 -0
- package/dist/entities/contact/ConnectionEntity.js.map +1 -0
- 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 +108 -0
- package/dist/entities/contact/ContactEntity.js.map +1 -0
- package/dist/entities/contact/CorrelationIdentifierEntity.d.ts +12 -0
- package/dist/entities/contact/CorrelationIdentifierEntity.d.ts.map +1 -0
- package/dist/entities/contact/CorrelationIdentifierEntity.js +76 -0
- package/dist/entities/contact/CorrelationIdentifierEntity.js.map +1 -0
- package/dist/entities/contact/DidAuthConfigEntity.d.ts +11 -0
- package/dist/entities/contact/DidAuthConfigEntity.d.ts.map +1 -0
- package/dist/entities/contact/DidAuthConfigEntity.js +49 -0
- package/dist/entities/contact/DidAuthConfigEntity.js.map +1 -0
- package/dist/entities/contact/IdentityEntity.d.ts +22 -0
- package/dist/entities/contact/IdentityEntity.d.ts.map +1 -0
- package/dist/entities/contact/IdentityEntity.js +137 -0
- package/dist/entities/contact/IdentityEntity.js.map +1 -0
- package/dist/entities/contact/IdentityMetadataItemEntity.d.ts +12 -0
- package/dist/entities/contact/IdentityMetadataItemEntity.d.ts.map +1 -0
- package/dist/entities/contact/IdentityMetadataItemEntity.js +73 -0
- package/dist/entities/contact/IdentityMetadataItemEntity.js.map +1 -0
- package/dist/entities/contact/OpenIdConfigEntity.d.ts +15 -0
- package/dist/entities/contact/OpenIdConfigEntity.d.ts.map +1 -0
- package/dist/entities/contact/OpenIdConfigEntity.js +70 -0
- package/dist/entities/contact/OpenIdConfigEntity.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/generic/1-CreateContacts.d.ts +7 -0
- package/dist/migrations/generic/1-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/generic/1-CreateContacts.js +72 -0
- package/dist/migrations/generic/1-CreateContacts.js.map +1 -0
- package/dist/migrations/generic/index.d.ts +10 -0
- package/dist/migrations/generic/index.d.ts.map +1 -0
- package/dist/migrations/generic/index.js +13 -0
- package/dist/migrations/generic/index.js.map +1 -0
- package/dist/migrations/index.d.ts +2 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +6 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/internal-migrations-ormconfig.d.ts +6 -0
- package/dist/migrations/internal-migrations-ormconfig.d.ts.map +1 -0
- package/dist/migrations/internal-migrations-ormconfig.js +29 -0
- package/dist/migrations/internal-migrations-ormconfig.js.map +1 -0
- package/dist/migrations/postgres/1659463079428-CreateContacts.d.ts +7 -0
- package/dist/migrations/postgres/1659463079428-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/postgres/1659463079428-CreateContacts.js +55 -0
- package/dist/migrations/postgres/1659463079428-CreateContacts.js.map +1 -0
- package/dist/migrations/sqlite/1659463069549-CreateContacts.d.ts +7 -0
- package/dist/migrations/sqlite/1659463069549-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/sqlite/1659463069549-CreateContacts.js +79 -0
- package/dist/migrations/sqlite/1659463069549-CreateContacts.js.map +1 -0
- package/dist/types/IAbstractContactStore.d.ts +41 -0
- package/dist/types/IAbstractContactStore.d.ts.map +1 -0
- package/dist/types/IAbstractContactStore.js +3 -0
- package/dist/types/IAbstractContactStore.js.map +1 -0
- package/dist/types/contact.d.ts +91 -0
- package/dist/types/contact.d.ts.map +1 -0
- package/dist/types/contact.js +21 -0
- package/dist/types/contact.js.map +1 -0
- package/package.json +45 -0
- package/src/__tests__/contact.entities.test.ts +911 -0
- package/src/__tests__/contact.store.test.ts +743 -0
- package/src/contact/AbstractContactStore.ts +26 -0
- package/src/contact/ContactStore.ts +373 -0
- package/src/entities/contact/BaseConfigEntity.ts +8 -0
- package/src/entities/contact/ConnectionEntity.ts +48 -0
- package/src/entities/contact/ContactEntity.ts +76 -0
- package/src/entities/contact/CorrelationIdentifierEntity.ts +41 -0
- package/src/entities/contact/DidAuthConfigEntity.ts +31 -0
- package/src/entities/contact/IdentityEntity.ts +106 -0
- package/src/entities/contact/IdentityMetadataItemEntity.ts +39 -0
- package/src/entities/contact/OpenIdConfigEntity.ts +48 -0
- package/src/index.ts +45 -0
- package/src/migrations/generic/1-CreateContacts.ts +54 -0
- package/src/migrations/generic/index.ts +10 -0
- package/src/migrations/index.ts +1 -0
- package/src/migrations/internal-migrations-ormconfig.ts +28 -0
- package/src/migrations/postgres/1659463079428-CreateContacts.ts +61 -0
- package/src/migrations/sqlite/1659463069549-CreateContacts.ts +111 -0
- package/src/types/IAbstractContactStore.ts +51 -0
- package/src/types/contact.ts +101 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseConfigEntity.d.ts","sourceRoot":"","sources":["../../../src/entities/contact/BaseConfigEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAoD,MAAM,SAAS,CAAA;AAEtF,8BAEsB,gBAAiB,SAAQ,UAAU;IAEvD,EAAE,EAAG,MAAM,CAAA;CACZ"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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.BaseConfigEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let BaseConfigEntity = class BaseConfigEntity extends typeorm_1.BaseEntity {
|
|
15
|
+
};
|
|
16
|
+
__decorate([
|
|
17
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
18
|
+
__metadata("design:type", String)
|
|
19
|
+
], BaseConfigEntity.prototype, "id", void 0);
|
|
20
|
+
BaseConfigEntity = __decorate([
|
|
21
|
+
(0, typeorm_1.Entity)('BaseConfigEntity') // FIXME rename it to 'BaseConfig'
|
|
22
|
+
,
|
|
23
|
+
(0, typeorm_1.TableInheritance)({ column: { type: 'varchar', name: 'type' } })
|
|
24
|
+
], BaseConfigEntity);
|
|
25
|
+
exports.BaseConfigEntity = BaseConfigEntity;
|
|
26
|
+
//# sourceMappingURL=BaseConfigEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseConfigEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/BaseConfigEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAsF;AAI/E,IAAe,gBAAgB,GAA/B,MAAe,gBAAiB,SAAQ,oBAAU;CAGxD,CAAA;AAFC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;4CACpB;AAFS,gBAAgB;IAFrC,IAAA,gBAAM,EAAC,kBAAkB,CAAC,CAAC,kCAAkC;;IAC7D,IAAA,0BAAgB,EAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;GAC1C,gBAAgB,CAGrC;AAHqB,4CAAgB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseEntity } from 'typeorm';
|
|
2
|
+
import { BaseConfigEntity } from './BaseConfigEntity';
|
|
3
|
+
import { ConnectionTypeEnum, IBasicConnection } from '../../types/contact';
|
|
4
|
+
import { IdentityEntity } from './IdentityEntity';
|
|
5
|
+
export declare class ConnectionEntity extends BaseEntity {
|
|
6
|
+
id: string;
|
|
7
|
+
type: ConnectionTypeEnum;
|
|
8
|
+
config: BaseConfigEntity;
|
|
9
|
+
identity: IdentityEntity;
|
|
10
|
+
}
|
|
11
|
+
export declare const connectionEntityFrom: (connection: IBasicConnection) => ConnectionEntity;
|
|
12
|
+
//# sourceMappingURL=ConnectionEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionEntity.d.ts","sourceRoot":"","sources":["../../../src/entities/contact/ConnectionEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgE,UAAU,EAAE,MAAM,SAAS,CAAA;AAClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAyB,kBAAkB,EAAE,gBAAgB,EAAiC,MAAM,qBAAqB,CAAA;AAChI,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAIjD,qBACa,gBAAiB,SAAQ,UAAU;IAE9C,EAAE,EAAG,MAAM,CAAA;IAGX,IAAI,EAAG,kBAAkB,CAAA;IAQzB,MAAM,EAAG,gBAAgB,CAAA;IAMzB,QAAQ,EAAG,cAAc,CAAA;CAC1B;AAED,eAAO,MAAM,oBAAoB,eAAgB,gBAAgB,KAAG,gBAMnE,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
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.connectionEntityFrom = exports.ConnectionEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseConfigEntity_1 = require("./BaseConfigEntity");
|
|
15
|
+
const contact_1 = require("../../types/contact");
|
|
16
|
+
const IdentityEntity_1 = require("./IdentityEntity");
|
|
17
|
+
const OpenIdConfigEntity_1 = require("./OpenIdConfigEntity");
|
|
18
|
+
const DidAuthConfigEntity_1 = require("./DidAuthConfigEntity");
|
|
19
|
+
let ConnectionEntity = class ConnectionEntity extends typeorm_1.BaseEntity {
|
|
20
|
+
};
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], ConnectionEntity.prototype, "id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)('simple-enum', { name: 'type', enum: contact_1.ConnectionTypeEnum, nullable: false }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], ConnectionEntity.prototype, "type", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.OneToOne)(() => BaseConfigEntity_1.BaseConfigEntity, (config) => config.connection, {
|
|
31
|
+
cascade: true,
|
|
32
|
+
onDelete: 'CASCADE',
|
|
33
|
+
eager: true,
|
|
34
|
+
nullable: false,
|
|
35
|
+
}),
|
|
36
|
+
__metadata("design:type", BaseConfigEntity_1.BaseConfigEntity)
|
|
37
|
+
], ConnectionEntity.prototype, "config", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.OneToOne)(() => IdentityEntity_1.IdentityEntity, (identity) => identity.connection, {
|
|
40
|
+
onDelete: 'CASCADE',
|
|
41
|
+
}),
|
|
42
|
+
(0, typeorm_1.JoinColumn)({ name: 'identityId' }),
|
|
43
|
+
__metadata("design:type", IdentityEntity_1.IdentityEntity)
|
|
44
|
+
], ConnectionEntity.prototype, "identity", void 0);
|
|
45
|
+
ConnectionEntity = __decorate([
|
|
46
|
+
(0, typeorm_1.Entity)('Connection')
|
|
47
|
+
], ConnectionEntity);
|
|
48
|
+
exports.ConnectionEntity = ConnectionEntity;
|
|
49
|
+
const connectionEntityFrom = (connection) => {
|
|
50
|
+
const connectionEntity = new ConnectionEntity();
|
|
51
|
+
connectionEntity.type = connection.type;
|
|
52
|
+
connectionEntity.config = configEntityFrom(connection.type, connection.config);
|
|
53
|
+
return connectionEntity;
|
|
54
|
+
};
|
|
55
|
+
exports.connectionEntityFrom = connectionEntityFrom;
|
|
56
|
+
const configEntityFrom = (type, config) => {
|
|
57
|
+
switch (type) {
|
|
58
|
+
case contact_1.ConnectionTypeEnum.OPENID_CONNECT:
|
|
59
|
+
return (0, OpenIdConfigEntity_1.openIdConfigEntityFrom)(config);
|
|
60
|
+
case contact_1.ConnectionTypeEnum.SIOPv2:
|
|
61
|
+
return (0, DidAuthConfigEntity_1.didAuthConfigEntityFrom)(config);
|
|
62
|
+
default:
|
|
63
|
+
throw new Error('Connection type not supported');
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=ConnectionEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/ConnectionEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAkG;AAClG,yDAAqD;AACrD,iDAAgI;AAChI,qDAAiD;AACjD,6DAAiF;AACjF,+DAAoF;AAG7E,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,oBAAU;CAoB/C,CAAA;AAnBC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;4CACpB;AAEX;IAAC,IAAA,gBAAM,EAAC,aAAa,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,4BAAkB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;8CAC1D;AAEzB;IAAC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,mCAAgB,EAAE,CAAC,MAAgD,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE;QACzG,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,SAAS;QACnB,KAAK,EAAE,IAAI;QACX,QAAQ,EAAE,KAAK;KAChB,CAAC;8BACO,mCAAgB;gDAAA;AAEzB;IAAC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,+BAAc,EAAE,CAAC,QAAwB,EAAE,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE;QACjF,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BACxB,+BAAc;kDAAA;AAnBd,gBAAgB;IAD5B,IAAA,gBAAM,EAAC,YAAY,CAAC;GACR,gBAAgB,CAoB5B;AApBY,4CAAgB;AAsBtB,MAAM,oBAAoB,GAAG,CAAC,UAA4B,EAAoB,EAAE;IACrF,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAA;IAC/C,gBAAgB,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;IACvC,gBAAgB,CAAC,MAAM,GAAG,gBAAgB,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAA;IAE9E,OAAO,gBAAgB,CAAA;AACzB,CAAC,CAAA;AANY,QAAA,oBAAoB,wBAMhC;AAED,MAAM,gBAAgB,GAAG,CAAC,IAAwB,EAAE,MAA6B,EAAoB,EAAE;IACrG,QAAQ,IAAI,EAAE;QACZ,KAAK,4BAAkB,CAAC,cAAc;YACpC,OAAO,IAAA,2CAAsB,EAAC,MAAuB,CAAC,CAAA;QACxD,KAAK,4BAAkB,CAAC,MAAM;YAC5B,OAAO,IAAA,6CAAuB,EAAC,MAAwB,CAAC,CAAA;QAC1D;YACE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAA;KACnD;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseEntity } from 'typeorm';
|
|
2
|
+
import { IBasicContact } from '../../types/contact';
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,qBAAqB,CAAA;AACnE,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,aAUvD,CAAA"}
|
|
@@ -0,0 +1,108 @@
|
|
|
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.contactEntityFrom = exports.ContactEntity = void 0;
|
|
22
|
+
const typeorm_1 = require("typeorm");
|
|
23
|
+
const IdentityEntity_1 = require("./IdentityEntity");
|
|
24
|
+
const class_validator_1 = require("class-validator");
|
|
25
|
+
let ContactEntity = class ContactEntity 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
|
+
var _a;
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
const validation = yield (0, class_validator_1.validate)(this);
|
|
34
|
+
if (validation.length > 0) {
|
|
35
|
+
return Promise.reject(Error((_a = validation[0].constraints) === null || _a === void 0 ? void 0 : _a.isNotEmpty));
|
|
36
|
+
}
|
|
37
|
+
return;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], ContactEntity.prototype, "id", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ name: 'name', length: 255, nullable: false, unique: true }),
|
|
47
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Blank names are not allowed' }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], ContactEntity.prototype, "name", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({ name: 'alias', length: 255, nullable: false, unique: true }),
|
|
52
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Blank aliases are not allowed' }),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], ContactEntity.prototype, "alias", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Column)({ name: 'uri', length: 255 }),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], ContactEntity.prototype, "uri", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.OneToMany)(() => IdentityEntity_1.IdentityEntity, (identity) => identity.contact, {
|
|
61
|
+
cascade: true,
|
|
62
|
+
onDelete: 'CASCADE',
|
|
63
|
+
eager: true,
|
|
64
|
+
nullable: false,
|
|
65
|
+
}),
|
|
66
|
+
(0, typeorm_1.JoinColumn)({ name: 'identityId' }),
|
|
67
|
+
__metadata("design:type", Array)
|
|
68
|
+
], ContactEntity.prototype, "identities", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', nullable: false }),
|
|
71
|
+
__metadata("design:type", Date)
|
|
72
|
+
], ContactEntity.prototype, "createdAt", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'last_updated_at', nullable: false }),
|
|
75
|
+
__metadata("design:type", Date
|
|
76
|
+
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
77
|
+
)
|
|
78
|
+
], ContactEntity.prototype, "lastUpdatedAt", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
81
|
+
(0, typeorm_1.BeforeUpdate)(),
|
|
82
|
+
__metadata("design:type", Function),
|
|
83
|
+
__metadata("design:paramtypes", []),
|
|
84
|
+
__metadata("design:returntype", void 0)
|
|
85
|
+
], ContactEntity.prototype, "updateUpdatedDate", null);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
88
|
+
(0, typeorm_1.BeforeUpdate)(),
|
|
89
|
+
__metadata("design:type", Function),
|
|
90
|
+
__metadata("design:paramtypes", []),
|
|
91
|
+
__metadata("design:returntype", Promise)
|
|
92
|
+
], ContactEntity.prototype, "validate", null);
|
|
93
|
+
ContactEntity = __decorate([
|
|
94
|
+
(0, typeorm_1.Entity)('Contact')
|
|
95
|
+
], ContactEntity);
|
|
96
|
+
exports.ContactEntity = ContactEntity;
|
|
97
|
+
const contactEntityFrom = (args) => {
|
|
98
|
+
const contactEntity = new ContactEntity();
|
|
99
|
+
contactEntity.name = args.name;
|
|
100
|
+
contactEntity.alias = args.alias;
|
|
101
|
+
contactEntity.uri = args.uri;
|
|
102
|
+
if (args.identities) {
|
|
103
|
+
contactEntity.identities = args.identities.map((identity) => (0, IdentityEntity_1.identityEntityFrom)(identity));
|
|
104
|
+
}
|
|
105
|
+
return contactEntity;
|
|
106
|
+
};
|
|
107
|
+
exports.contactEntityFrom = contactEntityFrom;
|
|
108
|
+
//# sourceMappingURL=ContactEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContactEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/ContactEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,qCAWgB;AAEhB,qDAAqE;AACrE,qDAAsD;AAG/C,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,oBAAU;IA8B3C,qHAAqH;IAGrH,iBAAiB;QACf,IAAI,CAAC,aA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C;IAAC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;8BAC9C,IAAI;gDAAA;AAEhB;IAAC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;8BAC/C,IAAI;IAEpB,qHAAqH;;oDAFjG;AAGpB;IAAC,IAAA,sBAAY,GAAE;IACd,IAAA,sBAAY,GAAE;;;;sDAGd;AAIK;IAFL,IAAA,sBAAY,GAAE;IACd,IAAA,sBAAY,GAAE;;;;6CAOd;AA7CU,aAAa;IADzB,IAAA,gBAAM,EAAC,SAAS,CAAC;GACL,aAAa,CA8CzB;AA9CY,sCAAa;AAgDnB,MAAM,iBAAiB,GAAG,CAAC,IAAmB,EAAiB,EAAE;IACtE,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAA;IACzC,aAAa,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;IAC9B,aAAa,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;IAChC,aAAa,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;IAC5B,IAAI,IAAI,CAAC,UAAU,EAAE;QACnB,aAAa,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAwB,EAAE,EAAE,CAAC,IAAA,mCAAkB,EAAC,QAAQ,CAAC,CAAC,CAAA;KAC3G;IAED,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA;AAVY,QAAA,iBAAiB,qBAU7B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseEntity } from 'typeorm';
|
|
2
|
+
import { CorrelationIdentifierEnum, BasicCorrelationIdentifier } from '../../types/contact';
|
|
3
|
+
import { IdentityEntity } from './IdentityEntity';
|
|
4
|
+
export declare class CorrelationIdentifierEntity extends BaseEntity {
|
|
5
|
+
id: string;
|
|
6
|
+
type: CorrelationIdentifierEnum;
|
|
7
|
+
correlationId: string;
|
|
8
|
+
identity: IdentityEntity;
|
|
9
|
+
validate(): Promise<undefined>;
|
|
10
|
+
}
|
|
11
|
+
export declare const correlationIdentifierEntityFrom: (identifier: BasicCorrelationIdentifier) => CorrelationIdentifierEntity;
|
|
12
|
+
//# sourceMappingURL=CorrelationIdentifierEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CorrelationIdentifierEntity.d.ts","sourceRoot":"","sources":["../../../src/entities/contact/CorrelationIdentifierEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,UAAU,EAAoD,MAAM,SAAS,CAAA;AAC9H,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGjD,qBACa,2BAA4B,SAAQ,UAAU;IAEzD,EAAE,EAAG,MAAM,CAAA;IAGX,IAAI,EAAG,yBAAyB,CAAA;IAIhC,aAAa,EAAG,MAAM,CAAA;IAMtB,QAAQ,EAAG,cAAc,CAAA;IAInB,QAAQ;CAOf;AAED,eAAO,MAAM,+BAA+B,eAAgB,0BAA0B,KAAG,2BAMxF,CAAA"}
|
|
@@ -0,0 +1,76 @@
|
|
|
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.correlationIdentifierEntityFrom = exports.CorrelationIdentifierEntity = void 0;
|
|
22
|
+
const typeorm_1 = require("typeorm");
|
|
23
|
+
const contact_1 = require("../../types/contact");
|
|
24
|
+
const IdentityEntity_1 = require("./IdentityEntity");
|
|
25
|
+
const class_validator_1 = require("class-validator");
|
|
26
|
+
let CorrelationIdentifierEntity = class CorrelationIdentifierEntity extends typeorm_1.BaseEntity {
|
|
27
|
+
validate() {
|
|
28
|
+
var _a;
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
const validation = yield (0, class_validator_1.validate)(this);
|
|
31
|
+
if (validation.length > 0) {
|
|
32
|
+
return Promise.reject(Error((_a = validation[0].constraints) === null || _a === void 0 ? void 0 : _a.isNotEmpty));
|
|
33
|
+
}
|
|
34
|
+
return;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], CorrelationIdentifierEntity.prototype, "id", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)('simple-enum', { name: 'type', enum: contact_1.CorrelationIdentifierEnum, nullable: false }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], CorrelationIdentifierEntity.prototype, "type", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)('text', { name: 'correlation_id', nullable: false, unique: true }),
|
|
48
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Blank correlation ids are not allowed' }),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], CorrelationIdentifierEntity.prototype, "correlationId", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.OneToOne)(() => IdentityEntity_1.IdentityEntity, (identity) => identity.identifier, {
|
|
53
|
+
onDelete: 'CASCADE',
|
|
54
|
+
}),
|
|
55
|
+
(0, typeorm_1.JoinColumn)({ name: 'identityId' }),
|
|
56
|
+
__metadata("design:type", IdentityEntity_1.IdentityEntity)
|
|
57
|
+
], CorrelationIdentifierEntity.prototype, "identity", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
60
|
+
(0, typeorm_1.BeforeUpdate)(),
|
|
61
|
+
__metadata("design:type", Function),
|
|
62
|
+
__metadata("design:paramtypes", []),
|
|
63
|
+
__metadata("design:returntype", Promise)
|
|
64
|
+
], CorrelationIdentifierEntity.prototype, "validate", null);
|
|
65
|
+
CorrelationIdentifierEntity = __decorate([
|
|
66
|
+
(0, typeorm_1.Entity)('CorrelationIdentifier')
|
|
67
|
+
], CorrelationIdentifierEntity);
|
|
68
|
+
exports.CorrelationIdentifierEntity = CorrelationIdentifierEntity;
|
|
69
|
+
const correlationIdentifierEntityFrom = (identifier) => {
|
|
70
|
+
const identifierEntity = new CorrelationIdentifierEntity();
|
|
71
|
+
identifierEntity.type = identifier.type;
|
|
72
|
+
identifierEntity.correlationId = identifier.correlationId;
|
|
73
|
+
return identifierEntity;
|
|
74
|
+
};
|
|
75
|
+
exports.correlationIdentifierEntityFrom = correlationIdentifierEntityFrom;
|
|
76
|
+
//# sourceMappingURL=CorrelationIdentifierEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CorrelationIdentifierEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/CorrelationIdentifierEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,qCAA8H;AAC9H,iDAA2F;AAC3F,qDAAiD;AACjD,qDAAsD;AAG/C,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,oBAAU;IAmBnD,QAAQ;;;YACZ,MAAM,UAAU,GAAG,MAAM,IAAA,0BAAQ,EAAC,IAAI,CAAC,CAAA;YACvC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;gBACzB,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAA,UAAU,CAAC,CAAC,CAAC,CAAC,WAAW,0CAAE,UAAU,CAAC,CAAC,CAAA;aACpE;YACD,OAAM;;KACP;CACF,CAAA;AAzBC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;uDACpB;AAEX;IAAC,IAAA,gBAAM,EAAC,aAAa,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mCAAyB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;yDAC1D;AAEhC;IAAC,IAAA,gBAAM,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACzE,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,uCAAuC,EAAE,CAAC;;kEAC3C;AAEtB;IAAC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,+BAAc,EAAE,CAAC,QAAwB,EAAE,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE;QACjF,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BACxB,+BAAc;6DAAA;AAInB;IAFL,IAAA,sBAAY,GAAE;IACd,IAAA,sBAAY,GAAE;;;;2DAOd;AAzBU,2BAA2B;IADvC,IAAA,gBAAM,EAAC,uBAAuB,CAAC;GACnB,2BAA2B,CA0BvC;AA1BY,kEAA2B;AA4BjC,MAAM,+BAA+B,GAAG,CAAC,UAAsC,EAA+B,EAAE;IACrH,MAAM,gBAAgB,GAAG,IAAI,2BAA2B,EAAE,CAAA;IAC1D,gBAAgB,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;IACvC,gBAAgB,CAAC,aAAa,GAAG,UAAU,CAAC,aAAa,CAAA;IAEzD,OAAO,gBAAgB,CAAA;AACzB,CAAC,CAAA;AANY,QAAA,+BAA+B,mCAM3C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseConfigEntity } from './BaseConfigEntity';
|
|
2
|
+
import { BasicDidAuthConfig } from '../../types/contact';
|
|
3
|
+
import { ConnectionEntity } from './ConnectionEntity';
|
|
4
|
+
export declare class DidAuthConfigEntity extends BaseConfigEntity {
|
|
5
|
+
identifier: string;
|
|
6
|
+
redirectUrl: string;
|
|
7
|
+
sessionId: string;
|
|
8
|
+
connection?: ConnectionEntity;
|
|
9
|
+
}
|
|
10
|
+
export declare const didAuthConfigEntityFrom: (config: BasicDidAuthConfig) => DidAuthConfigEntity;
|
|
11
|
+
//# sourceMappingURL=DidAuthConfigEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DidAuthConfigEntity.d.ts","sourceRoot":"","sources":["../../../src/entities/contact/DidAuthConfigEntity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,qBACa,mBAAoB,SAAQ,gBAAgB;IAEvD,UAAU,EAAG,MAAM,CAAA;IAGnB,WAAW,EAAG,MAAM,CAAA;IAGpB,SAAS,EAAG,MAAM,CAAA;IAMlB,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAC9B;AAED,eAAO,MAAM,uBAAuB,WAAY,kBAAkB,KAAG,mBAOpE,CAAA"}
|
|
@@ -0,0 +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.didAuthConfigEntityFrom = exports.DidAuthConfigEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseConfigEntity_1 = require("./BaseConfigEntity");
|
|
15
|
+
const ConnectionEntity_1 = require("./ConnectionEntity");
|
|
16
|
+
let DidAuthConfigEntity = class DidAuthConfigEntity extends BaseConfigEntity_1.BaseConfigEntity {
|
|
17
|
+
};
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.Column)({ name: 'identifier', length: 255, nullable: false }),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], DidAuthConfigEntity.prototype, "identifier", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ name: 'redirect_url', length: 255, nullable: false }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], DidAuthConfigEntity.prototype, "redirectUrl", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ name: 'session_id', length: 255, nullable: false }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], DidAuthConfigEntity.prototype, "sessionId", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.OneToOne)(() => ConnectionEntity_1.ConnectionEntity, (connection) => connection.config, {
|
|
32
|
+
onDelete: 'CASCADE',
|
|
33
|
+
}),
|
|
34
|
+
(0, typeorm_1.JoinColumn)({ name: 'connectionId' }),
|
|
35
|
+
__metadata("design:type", ConnectionEntity_1.ConnectionEntity)
|
|
36
|
+
], DidAuthConfigEntity.prototype, "connection", void 0);
|
|
37
|
+
DidAuthConfigEntity = __decorate([
|
|
38
|
+
(0, typeorm_1.ChildEntity)('DidAuthConfig')
|
|
39
|
+
], DidAuthConfigEntity);
|
|
40
|
+
exports.DidAuthConfigEntity = DidAuthConfigEntity;
|
|
41
|
+
const didAuthConfigEntityFrom = (config) => {
|
|
42
|
+
const didAuthConfig = new DidAuthConfigEntity();
|
|
43
|
+
didAuthConfig.identifier = config.identifier.did;
|
|
44
|
+
didAuthConfig.redirectUrl = config.redirectUrl;
|
|
45
|
+
didAuthConfig.sessionId = config.sessionId;
|
|
46
|
+
return didAuthConfig;
|
|
47
|
+
};
|
|
48
|
+
exports.didAuthConfigEntityFrom = didAuthConfigEntityFrom;
|
|
49
|
+
//# sourceMappingURL=DidAuthConfigEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DidAuthConfigEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/DidAuthConfigEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAmE;AACnE,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
+
import { CorrelationIdentifierEntity } from './CorrelationIdentifierEntity';
|
|
3
|
+
import { ConnectionEntity } from './ConnectionEntity';
|
|
4
|
+
import { IBasicIdentity, IdentityRoleEnum } from '../../types/contact';
|
|
5
|
+
import { ContactEntity } from './ContactEntity';
|
|
6
|
+
import { IdentityMetadataItemEntity } from './IdentityMetadataItemEntity';
|
|
7
|
+
export declare class IdentityEntity extends BaseEntity {
|
|
8
|
+
id: string;
|
|
9
|
+
alias: string;
|
|
10
|
+
roles: Array<IdentityRoleEnum>;
|
|
11
|
+
identifier: CorrelationIdentifierEntity;
|
|
12
|
+
connection?: ConnectionEntity;
|
|
13
|
+
metadata: Array<IdentityMetadataItemEntity>;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
lastUpdatedAt: Date;
|
|
16
|
+
contact: ContactEntity;
|
|
17
|
+
contactId: string;
|
|
18
|
+
updateUpdatedDate(): void;
|
|
19
|
+
validate(): Promise<undefined>;
|
|
20
|
+
}
|
|
21
|
+
export declare const identityEntityFrom: (args: IBasicIdentity) => IdentityEntity;
|
|
22
|
+
//# sourceMappingURL=IdentityEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentityEntity.d.ts","sourceRoot":"","sources":["../../../src/entities/contact/IdentityEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAYX,MAAM,SAAS,CAAA;AAChB,OAAO,EAAmC,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC5G,OAAO,EAAE,gBAAgB,EAAwB,MAAM,oBAAoB,CAAA;AAC3E,OAAO,EAAqB,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,0BAA0B,EAA0B,MAAM,8BAA8B,CAAA;AAGjG,qBACa,cAAe,SAAQ,UAAU;IAE5C,EAAE,EAAG,MAAM,CAAA;IASX,KAAK,EAAG,MAAM,CAAA;IAGd,KAAK,EAAG,KAAK,CAAC,gBAAgB,CAAC,CAAA;IAQ/B,UAAU,EAAG,2BAA2B,CAAA;IAOxC,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAS7B,QAAQ,EAAG,KAAK,CAAC,0BAA0B,CAAC,CAAA;IAG5C,SAAS,EAAG,IAAI,CAAA;IAGhB,aAAa,EAAG,IAAI,CAAA;IAKpB,OAAO,EAAG,aAAa,CAAA;IAGvB,SAAS,EAAG,MAAM,CAAA;IAKlB,iBAAiB;IAMX,QAAQ;CAOf;AAED,eAAO,MAAM,kBAAkB,SAAU,cAAc,KAAG,cAWzD,CAAA"}
|
|
@@ -0,0 +1,137 @@
|
|
|
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.identityEntityFrom = exports.IdentityEntity = void 0;
|
|
22
|
+
const typeorm_1 = require("typeorm");
|
|
23
|
+
const CorrelationIdentifierEntity_1 = require("./CorrelationIdentifierEntity");
|
|
24
|
+
const ConnectionEntity_1 = require("./ConnectionEntity");
|
|
25
|
+
const ContactEntity_1 = require("./ContactEntity");
|
|
26
|
+
const IdentityMetadataItemEntity_1 = require("./IdentityMetadataItemEntity");
|
|
27
|
+
const class_validator_1 = require("class-validator");
|
|
28
|
+
let IdentityEntity = class IdentityEntity extends typeorm_1.BaseEntity {
|
|
29
|
+
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
30
|
+
updateUpdatedDate() {
|
|
31
|
+
this.lastUpdatedAt = new Date();
|
|
32
|
+
}
|
|
33
|
+
validate() {
|
|
34
|
+
var _a;
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const validation = yield (0, class_validator_1.validate)(this);
|
|
37
|
+
if (validation.length > 0) {
|
|
38
|
+
return Promise.reject(Error((_a = validation[0].constraints) === null || _a === void 0 ? void 0 : _a.isNotEmpty));
|
|
39
|
+
}
|
|
40
|
+
return;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], IdentityEntity.prototype, "id", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({
|
|
50
|
+
name: 'alias',
|
|
51
|
+
length: 255,
|
|
52
|
+
nullable: false,
|
|
53
|
+
unique: true,
|
|
54
|
+
}),
|
|
55
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Blank aliases are not allowed' }),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], IdentityEntity.prototype, "alias", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)('simple-array', { name: 'roles', nullable: false }),
|
|
60
|
+
__metadata("design:type", Array)
|
|
61
|
+
], IdentityEntity.prototype, "roles", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.OneToOne)(() => CorrelationIdentifierEntity_1.CorrelationIdentifierEntity, (identifier) => identifier.identity, {
|
|
64
|
+
cascade: true,
|
|
65
|
+
onDelete: 'CASCADE',
|
|
66
|
+
eager: true,
|
|
67
|
+
nullable: false,
|
|
68
|
+
}),
|
|
69
|
+
__metadata("design:type", CorrelationIdentifierEntity_1.CorrelationIdentifierEntity)
|
|
70
|
+
], IdentityEntity.prototype, "identifier", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typeorm_1.OneToOne)(() => ConnectionEntity_1.ConnectionEntity, (connection) => connection.identity, {
|
|
73
|
+
cascade: true,
|
|
74
|
+
onDelete: 'CASCADE',
|
|
75
|
+
eager: true,
|
|
76
|
+
}),
|
|
77
|
+
__metadata("design:type", ConnectionEntity_1.ConnectionEntity)
|
|
78
|
+
], IdentityEntity.prototype, "connection", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.OneToMany)(() => IdentityMetadataItemEntity_1.IdentityMetadataItemEntity, (metadata) => metadata.identity, {
|
|
81
|
+
cascade: true,
|
|
82
|
+
onDelete: 'CASCADE',
|
|
83
|
+
eager: true,
|
|
84
|
+
nullable: false,
|
|
85
|
+
}),
|
|
86
|
+
(0, typeorm_1.JoinColumn)({ name: 'metadataId' }),
|
|
87
|
+
__metadata("design:type", Array)
|
|
88
|
+
], IdentityEntity.prototype, "metadata", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', nullable: false }),
|
|
91
|
+
__metadata("design:type", Date)
|
|
92
|
+
], IdentityEntity.prototype, "createdAt", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'last_updated_at', nullable: false }),
|
|
95
|
+
__metadata("design:type", Date)
|
|
96
|
+
], IdentityEntity.prototype, "lastUpdatedAt", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, typeorm_1.ManyToOne)(() => ContactEntity_1.ContactEntity, (contact) => contact.identities, {
|
|
99
|
+
onDelete: 'CASCADE',
|
|
100
|
+
}),
|
|
101
|
+
__metadata("design:type", ContactEntity_1.ContactEntity)
|
|
102
|
+
], IdentityEntity.prototype, "contact", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, typeorm_1.Column)({ name: 'contactId', nullable: true }),
|
|
105
|
+
__metadata("design:type", String)
|
|
106
|
+
], IdentityEntity.prototype, "contactId", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
109
|
+
(0, typeorm_1.BeforeUpdate)(),
|
|
110
|
+
__metadata("design:type", Function),
|
|
111
|
+
__metadata("design:paramtypes", []),
|
|
112
|
+
__metadata("design:returntype", void 0)
|
|
113
|
+
], IdentityEntity.prototype, "updateUpdatedDate", null);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
116
|
+
(0, typeorm_1.BeforeUpdate)(),
|
|
117
|
+
__metadata("design:type", Function),
|
|
118
|
+
__metadata("design:paramtypes", []),
|
|
119
|
+
__metadata("design:returntype", Promise)
|
|
120
|
+
], IdentityEntity.prototype, "validate", null);
|
|
121
|
+
IdentityEntity = __decorate([
|
|
122
|
+
(0, typeorm_1.Entity)('Identity')
|
|
123
|
+
], IdentityEntity);
|
|
124
|
+
exports.IdentityEntity = IdentityEntity;
|
|
125
|
+
const identityEntityFrom = (args) => {
|
|
126
|
+
const identityEntity = new IdentityEntity();
|
|
127
|
+
identityEntity.alias = args.alias;
|
|
128
|
+
identityEntity.roles = args.roles;
|
|
129
|
+
identityEntity.identifier = (0, CorrelationIdentifierEntity_1.correlationIdentifierEntityFrom)(args.identifier);
|
|
130
|
+
if (args.connection) {
|
|
131
|
+
identityEntity.connection = (0, ConnectionEntity_1.connectionEntityFrom)(args.connection);
|
|
132
|
+
}
|
|
133
|
+
identityEntity.metadata = args.metadata ? args.metadata.map((item) => (0, IdentityMetadataItemEntity_1.metadataItemEntityFrom)(item)) : [];
|
|
134
|
+
return identityEntity;
|
|
135
|
+
};
|
|
136
|
+
exports.identityEntityFrom = identityEntityFrom;
|
|
137
|
+
//# sourceMappingURL=IdentityEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentityEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/IdentityEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,qCAagB;AAChB,+EAA4G;AAC5G,yDAA2E;AAE3E,mDAA+C;AAC/C,6EAAiG;AACjG,qDAAsD;AAG/C,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,oBAAU;IAsD5C,qHAAqH;IAGrH,iBAAiB;QACf,IAAI,CAAC,aAAa,GAAG,IAAI,IAAI,EAAE,CAAA;IACjC,CAAC;IAIK,QAAQ;;;YACZ,MAAM,UAAU,GAAG,MAAM,IAAA,0BAAQ,EAAC,IAAI,CAAC,CAAA;YACvC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;gBACzB,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAA,UAAU,CAAC,CAAC,CAAC,CAAC,WAAW,0CAAE,UAAU,CAAC,CAAC,CAAA;aACpE;YACD,OAAM;;KACP;CACF,CAAA;AArEC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;0CACpB;AAEX;IAAC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,GAAG;QACX,QAAQ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AW9B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseEntity } from 'typeorm';
|
|
2
|
+
import { BasicMetadataItem } from '../../types/contact';
|
|
3
|
+
import { IdentityEntity } from './IdentityEntity';
|
|
4
|
+
export declare class IdentityMetadataItemEntity extends BaseEntity {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
identity: IdentityEntity;
|
|
9
|
+
validate(): Promise<undefined>;
|
|
10
|
+
}
|
|
11
|
+
export declare const metadataItemEntityFrom: (item: BasicMetadataItem) => IdentityMetadataItemEntity;
|
|
12
|
+
//# sourceMappingURL=IdentityMetadataItemEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentityMetadataItemEntity.d.ts","sourceRoot":"","sources":["../../../src/entities/contact/IdentityMetadataItemEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,UAAU,EAAyC,MAAM,SAAS,CAAA;AACnH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGjD,qBACa,0BAA2B,SAAQ,UAAU;IAExD,EAAE,EAAG,MAAM,CAAA;IAIX,KAAK,EAAG,MAAM,CAAA;IAId,KAAK,EAAG,MAAM,CAAA;IAGd,QAAQ,EAAG,cAAc,CAAA;IAInB,QAAQ;CAOf;AAED,eAAO,MAAM,sBAAsB,SAAU,iBAAiB,KAAG,0BAMhE,CAAA"}
|