@sphereon/ssi-sdk.data-store 0.11.1-unstable.149 → 0.11.1-unstable.151

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/package.json +3 -3
  2. package/dist/contact/AbstractContactStore.d.ts +0 -14
  3. package/dist/contact/AbstractContactStore.d.ts.map +0 -1
  4. package/dist/contact/AbstractContactStore.js +0 -7
  5. package/dist/contact/AbstractContactStore.js.map +0 -1
  6. package/dist/contact/ContactStore.d.ts +0 -29
  7. package/dist/contact/ContactStore.d.ts.map +0 -1
  8. package/dist/contact/ContactStore.js +0 -281
  9. package/dist/contact/ContactStore.js.map +0 -1
  10. package/dist/entities/contact/BaseConfigEntity.d.ts +0 -5
  11. package/dist/entities/contact/BaseConfigEntity.d.ts.map +0 -1
  12. package/dist/entities/contact/BaseConfigEntity.js +0 -26
  13. package/dist/entities/contact/BaseConfigEntity.js.map +0 -1
  14. package/dist/entities/contact/ConnectionEntity.d.ts +0 -12
  15. package/dist/entities/contact/ConnectionEntity.d.ts.map +0 -1
  16. package/dist/entities/contact/ConnectionEntity.js +0 -66
  17. package/dist/entities/contact/ConnectionEntity.js.map +0 -1
  18. package/dist/entities/contact/ContactEntity.d.ts +0 -16
  19. package/dist/entities/contact/ContactEntity.d.ts.map +0 -1
  20. package/dist/entities/contact/ContactEntity.js +0 -105
  21. package/dist/entities/contact/ContactEntity.js.map +0 -1
  22. package/dist/entities/contact/CorrelationIdentifierEntity.d.ts +0 -12
  23. package/dist/entities/contact/CorrelationIdentifierEntity.d.ts.map +0 -1
  24. package/dist/entities/contact/CorrelationIdentifierEntity.js +0 -75
  25. package/dist/entities/contact/CorrelationIdentifierEntity.js.map +0 -1
  26. package/dist/entities/contact/DidAuthConfigEntity.d.ts +0 -11
  27. package/dist/entities/contact/DidAuthConfigEntity.d.ts.map +0 -1
  28. package/dist/entities/contact/DidAuthConfigEntity.js +0 -49
  29. package/dist/entities/contact/DidAuthConfigEntity.js.map +0 -1
  30. package/dist/entities/contact/IdentityEntity.d.ts +0 -22
  31. package/dist/entities/contact/IdentityEntity.d.ts.map +0 -1
  32. package/dist/entities/contact/IdentityEntity.js +0 -134
  33. package/dist/entities/contact/IdentityEntity.js.map +0 -1
  34. package/dist/entities/contact/IdentityMetadataItemEntity.d.ts +0 -12
  35. package/dist/entities/contact/IdentityMetadataItemEntity.d.ts.map +0 -1
  36. package/dist/entities/contact/IdentityMetadataItemEntity.js +0 -72
  37. package/dist/entities/contact/IdentityMetadataItemEntity.js.map +0 -1
  38. package/dist/entities/contact/OpenIdConfigEntity.d.ts +0 -15
  39. package/dist/entities/contact/OpenIdConfigEntity.d.ts.map +0 -1
  40. package/dist/entities/contact/OpenIdConfigEntity.js +0 -70
  41. package/dist/entities/contact/OpenIdConfigEntity.js.map +0 -1
  42. package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts +0 -11
  43. package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts.map +0 -1
  44. package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js +0 -74
  45. package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js.map +0 -1
  46. package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.d.ts +0 -18
  47. package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.d.ts.map +0 -1
  48. package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js +0 -120
  49. package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js.map +0 -1
  50. package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts +0 -15
  51. package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts.map +0 -1
  52. package/dist/entities/issuanceBranding/CredentialBrandingEntity.js +0 -102
  53. package/dist/entities/issuanceBranding/CredentialBrandingEntity.js.map +0 -1
  54. package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts +0 -9
  55. package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts.map +0 -1
  56. package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js +0 -49
  57. package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js.map +0 -1
  58. package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts +0 -14
  59. package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts.map +0 -1
  60. package/dist/entities/issuanceBranding/ImageAttributesEntity.js +0 -92
  61. package/dist/entities/issuanceBranding/ImageAttributesEntity.js.map +0 -1
  62. package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts +0 -9
  63. package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts.map +0 -1
  64. package/dist/entities/issuanceBranding/ImageDimensionsEntity.js +0 -39
  65. package/dist/entities/issuanceBranding/ImageDimensionsEntity.js.map +0 -1
  66. package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts +0 -14
  67. package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts.map +0 -1
  68. package/dist/entities/issuanceBranding/IssuerBrandingEntity.js +0 -95
  69. package/dist/entities/issuanceBranding/IssuerBrandingEntity.js.map +0 -1
  70. package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts +0 -9
  71. package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts.map +0 -1
  72. package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js +0 -49
  73. package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js.map +0 -1
  74. package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts +0 -9
  75. package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts.map +0 -1
  76. package/dist/entities/issuanceBranding/TextAttributesEntity.js +0 -62
  77. package/dist/entities/issuanceBranding/TextAttributesEntity.js.map +0 -1
  78. package/dist/entities/validators/index.d.ts +0 -7
  79. package/dist/entities/validators/index.d.ts.map +0 -1
  80. package/dist/entities/validators/index.js +0 -27
  81. package/dist/entities/validators/index.js.map +0 -1
  82. package/dist/index.d.ts +0 -27
  83. package/dist/index.d.ts.map +0 -1
  84. package/dist/index.js +0 -99
  85. package/dist/index.js.map +0 -1
  86. package/dist/issuanceBranding/AbstractIssuanceBrandingStore.d.ts +0 -20
  87. package/dist/issuanceBranding/AbstractIssuanceBrandingStore.d.ts.map +0 -1
  88. package/dist/issuanceBranding/AbstractIssuanceBrandingStore.js +0 -7
  89. package/dist/issuanceBranding/AbstractIssuanceBrandingStore.js.map +0 -1
  90. package/dist/issuanceBranding/IssuanceBrandingStore.d.ts +0 -31
  91. package/dist/issuanceBranding/IssuanceBrandingStore.d.ts.map +0 -1
  92. package/dist/issuanceBranding/IssuanceBrandingStore.js +0 -375
  93. package/dist/issuanceBranding/IssuanceBrandingStore.js.map +0 -1
  94. package/dist/migrations/generic/1-CreateContacts.d.ts +0 -7
  95. package/dist/migrations/generic/1-CreateContacts.d.ts.map +0 -1
  96. package/dist/migrations/generic/1-CreateContacts.js +0 -72
  97. package/dist/migrations/generic/1-CreateContacts.js.map +0 -1
  98. package/dist/migrations/generic/1-CreateIssuanceBranding.d.ts +0 -7
  99. package/dist/migrations/generic/1-CreateIssuanceBranding.d.ts.map +0 -1
  100. package/dist/migrations/generic/1-CreateIssuanceBranding.js +0 -72
  101. package/dist/migrations/generic/1-CreateIssuanceBranding.js.map +0 -1
  102. package/dist/migrations/generic/index.d.ts +0 -10
  103. package/dist/migrations/generic/index.d.ts.map +0 -1
  104. package/dist/migrations/generic/index.js +0 -14
  105. package/dist/migrations/generic/index.js.map +0 -1
  106. package/dist/migrations/index.d.ts +0 -2
  107. package/dist/migrations/index.d.ts.map +0 -1
  108. package/dist/migrations/index.js +0 -6
  109. package/dist/migrations/index.js.map +0 -1
  110. package/dist/migrations/internal-migrations-ormconfig.d.ts +0 -6
  111. package/dist/migrations/internal-migrations-ormconfig.d.ts.map +0 -1
  112. package/dist/migrations/internal-migrations-ormconfig.js +0 -29
  113. package/dist/migrations/internal-migrations-ormconfig.js.map +0 -1
  114. package/dist/migrations/postgres/1659463079428-CreateContacts.d.ts +0 -7
  115. package/dist/migrations/postgres/1659463079428-CreateContacts.d.ts.map +0 -1
  116. package/dist/migrations/postgres/1659463079428-CreateContacts.js +0 -55
  117. package/dist/migrations/postgres/1659463079428-CreateContacts.js.map +0 -1
  118. package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.d.ts +0 -7
  119. package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.d.ts.map +0 -1
  120. package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js +0 -67
  121. package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js.map +0 -1
  122. package/dist/migrations/sqlite/1659463069549-CreateContacts.d.ts +0 -7
  123. package/dist/migrations/sqlite/1659463069549-CreateContacts.d.ts.map +0 -1
  124. package/dist/migrations/sqlite/1659463069549-CreateContacts.js +0 -79
  125. package/dist/migrations/sqlite/1659463069549-CreateContacts.js.map +0 -1
  126. package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.d.ts +0 -7
  127. package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.d.ts.map +0 -1
  128. package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js +0 -89
  129. package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js.map +0 -1
  130. package/dist/types/contact/IAbstractContactStore.d.ts +0 -41
  131. package/dist/types/contact/IAbstractContactStore.d.ts.map +0 -1
  132. package/dist/types/contact/IAbstractContactStore.js +0 -3
  133. package/dist/types/contact/IAbstractContactStore.js.map +0 -1
  134. package/dist/types/contact/contact.d.ts +0 -91
  135. package/dist/types/contact/contact.d.ts.map +0 -1
  136. package/dist/types/contact/contact.js +0 -21
  137. package/dist/types/contact/contact.js.map +0 -1
  138. package/dist/types/index.d.ts +0 -5
  139. package/dist/types/index.d.ts.map +0 -1
  140. package/dist/types/index.js +0 -21
  141. package/dist/types/index.js.map +0 -1
  142. package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.d.ts +0 -59
  143. package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.d.ts.map +0 -1
  144. package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.js +0 -3
  145. package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.js.map +0 -1
  146. package/dist/types/issuanceBranding/issuanceBranding.d.ts +0 -115
  147. package/dist/types/issuanceBranding/issuanceBranding.d.ts.map +0 -1
  148. package/dist/types/issuanceBranding/issuanceBranding.js +0 -3
  149. package/dist/types/issuanceBranding/issuanceBranding.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sphereon/ssi-sdk.data-store",
3
- "version": "0.11.1-unstable.149+9c011e1",
3
+ "version": "0.11.1-unstable.151+5f89d1a",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "typeorm-postgres:migration:run": "pnpm run typeorm -- migration:run -c migration-postgres"
14
14
  },
15
15
  "dependencies": {
16
- "@sphereon/ssi-types": "0.11.1-unstable.149+9c011e1",
16
+ "@sphereon/ssi-types": "0.11.1-unstable.151+5f89d1a",
17
17
  "@veramo/core": "4.2.0",
18
18
  "class-validator": "^0.14.0",
19
19
  "debug": "^4.3.4",
@@ -41,5 +41,5 @@
41
41
  "PostgreSQL",
42
42
  "Contact Store"
43
43
  ],
44
- "gitHead": "9c011e1214605e4053d2d25d3f85a6ad000e54e9"
44
+ "gitHead": "5f89d1a73bc8cc2102c2def36821bea2c88ee350"
45
45
  }
@@ -1,14 +0,0 @@
1
- import { IContact, IIdentity, IAddIdentityArgs, IGetIdentityArgs, IGetIdentitiesArgs, IGetContactArgs, IRemoveIdentityArgs, IUpdateIdentityArgs, IAddContactArgs, IGetContactsArgs, IRemoveContactArgs, IUpdateContactArgs } from '../types';
2
- export declare abstract class AbstractContactStore {
3
- abstract getContact(args: IGetContactArgs): Promise<IContact>;
4
- abstract getContacts(args?: IGetContactsArgs): Promise<Array<IContact>>;
5
- abstract addContact(args: IAddContactArgs): Promise<IContact>;
6
- abstract updateContact(args: IUpdateContactArgs): Promise<IContact>;
7
- abstract removeContact(args: IRemoveContactArgs): Promise<void>;
8
- abstract getIdentity(args: IGetIdentityArgs): Promise<IIdentity>;
9
- abstract getIdentities(args: IGetIdentitiesArgs): Promise<Array<IIdentity>>;
10
- abstract addIdentity(args: IAddIdentityArgs): Promise<IIdentity>;
11
- abstract updateIdentity(args: IUpdateIdentityArgs): Promise<IIdentity>;
12
- abstract removeIdentity(args: IRemoveIdentityArgs): Promise<void>;
13
- }
14
- //# sourceMappingURL=AbstractContactStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AbstractContactStore.d.ts","sourceRoot":"","sources":["../../src/contact/AbstractContactStore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,UAAU,CAAA;AAEjB,8BAAsB,oBAAoB;IACxC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC;IAC7D,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACvE,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC;IAC7D,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC;IACnE,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAC/D,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IAChE,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC3E,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IAChE,QAAQ,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC;IACtE,QAAQ,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;CAClE"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AbstractContactStore = void 0;
4
- class AbstractContactStore {
5
- }
6
- exports.AbstractContactStore = AbstractContactStore;
7
- //# sourceMappingURL=AbstractContactStore.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AbstractContactStore.js","sourceRoot":"","sources":["../../src/contact/AbstractContactStore.ts"],"names":[],"mappings":";;;AAeA,MAAsB,oBAAoB;CAWzC;AAXD,oDAWC"}
@@ -1,29 +0,0 @@
1
- import { OrPromise } from '@sphereon/ssi-types';
2
- import { AbstractContactStore } from './AbstractContactStore';
3
- import { IAddIdentityArgs, IGetIdentityArgs, IGetIdentitiesArgs, IGetContactArgs, IRemoveIdentityArgs, IUpdateIdentityArgs, IGetContactsArgs, IAddContactArgs, IUpdateContactArgs, IRemoveContactArgs, IContact, IIdentity } from '../types';
4
- import { DataSource } from 'typeorm';
5
- export declare class ContactStore extends AbstractContactStore {
6
- private readonly dbConnection;
7
- constructor(dbConnection: OrPromise<DataSource>);
8
- getContact: ({ contactId }: IGetContactArgs) => Promise<IContact>;
9
- getContacts: (args?: IGetContactsArgs) => Promise<Array<IContact>>;
10
- addContact: (args: IAddContactArgs) => Promise<IContact>;
11
- updateContact: ({ contact }: IUpdateContactArgs) => Promise<IContact>;
12
- removeContact: ({ contactId }: IRemoveContactArgs) => Promise<void>;
13
- private deleteIdentities;
14
- getIdentity: ({ identityId }: IGetIdentityArgs) => Promise<IIdentity>;
15
- getIdentities: (args?: IGetIdentitiesArgs) => Promise<Array<IIdentity>>;
16
- addIdentity: ({ identity, contactId }: IAddIdentityArgs) => Promise<IIdentity>;
17
- updateIdentity: ({ identity }: IUpdateIdentityArgs) => Promise<IIdentity>;
18
- removeIdentity: ({ identityId }: IRemoveIdentityArgs) => Promise<void>;
19
- private contactFrom;
20
- private identityFrom;
21
- private correlationIdentifierFrom;
22
- private metadataItemFrom;
23
- private connectionFrom;
24
- private configFrom;
25
- private hasCorrectConfig;
26
- private isOpenIdConfig;
27
- private isDidAuthConfig;
28
- }
29
- //# sourceMappingURL=ContactStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContactStore.d.ts","sourceRoot":"","sources":["../../src/contact/ContactStore.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAMlB,QAAQ,EAGR,SAAS,EAGV,MAAM,UAAU,CAAA;AASjB,OAAO,EAAE,UAAU,EAAM,MAAM,SAAS,CAAA;AAIxC,qBAAa,YAAa,SAAQ,oBAAoB;IACpD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAuB;gBAExC,YAAY,EAAE,SAAS,CAAC,UAAU,CAAC;IAK/C,UAAU,kBAAyB,eAAe,KAAG,QAAQ,QAAQ,CAAC,CAUrE;IAED,WAAW,UAAiB,gBAAgB,KAAG,QAAQ,MAAM,QAAQ,CAAC,CAAC,CAYtE;IAED,UAAU,SAAgB,eAAe,KAAG,QAAQ,QAAQ,CAAC,CA4B5D;IAED,aAAa,gBAAuB,kBAAkB,KAAG,QAAQ,QAAQ,CAAC,CAkBzE;IAED,aAAa,kBAAyB,kBAAkB,KAAG,QAAQ,IAAI,CAAC,CAoBvE;YAEa,gBAAgB;IAwC9B,WAAW,mBAA0B,gBAAgB,KAAG,QAAQ,SAAS,CAAC,CAUzE;IAED,aAAa,UAAiB,kBAAkB,KAAG,QAAQ,MAAM,SAAS,CAAC,CAAC,CAY3E;IAED,WAAW,4BAAmC,gBAAgB,KAAG,QAAQ,SAAS,CAAC,CA2BlF;IAED,cAAc,iBAAwB,mBAAmB,KAAG,QAAQ,SAAS,CAAC,CAuB7E;IAED,cAAc,mBAA0B,mBAAmB,KAAG,QAAQ,IAAI,CAAC,CAY1E;IAED,OAAO,CAAC,WAAW,CAWlB;IAED,OAAO,CAAC,YAAY,CAWnB;IAED,OAAO,CAAC,yBAAyB,CAMhC;IAED,OAAO,CAAC,gBAAgB,CAMvB;IAED,OAAO,CAAC,cAAc,CAMrB;IAED,OAAO,CAAC,UAAU,CAwBjB;IAED,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,cAAc,CACqD;IAE3E,OAAO,CAAC,eAAe,CACqD;CAC7E"}
@@ -1,281 +0,0 @@
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.ContactStore = void 0;
16
- const debug_1 = __importDefault(require("debug"));
17
- const AbstractContactStore_1 = require("./AbstractContactStore");
18
- const types_1 = require("../types");
19
- const ContactEntity_1 = require("../entities/contact/ContactEntity");
20
- const IdentityEntity_1 = require("../entities/contact/IdentityEntity");
21
- const IdentityMetadataItemEntity_1 = require("../entities/contact/IdentityMetadataItemEntity");
22
- const CorrelationIdentifierEntity_1 = require("../entities/contact/CorrelationIdentifierEntity");
23
- const ConnectionEntity_1 = require("../entities/contact/ConnectionEntity");
24
- const BaseConfigEntity_1 = require("../entities/contact/BaseConfigEntity");
25
- const typeorm_1 = require("typeorm");
26
- const debug = (0, debug_1.default)('sphereon:ssi-sdk:contact-store');
27
- class ContactStore extends AbstractContactStore_1.AbstractContactStore {
28
- constructor(dbConnection) {
29
- super();
30
- this.getContact = ({ contactId }) => __awaiter(this, void 0, void 0, function* () {
31
- const result = yield (yield this.dbConnection).getRepository(ContactEntity_1.ContactEntity).findOne({
32
- where: { id: contactId },
33
- });
34
- if (!result) {
35
- return Promise.reject(Error(`No contact found for id: ${contactId}`));
36
- }
37
- return this.contactFrom(result);
38
- });
39
- this.getContacts = (args) => __awaiter(this, void 0, void 0, function* () {
40
- const initialResult = yield (yield this.dbConnection).getRepository(ContactEntity_1.ContactEntity).find(Object.assign({}, ((args === null || args === void 0 ? void 0 : args.filter) && { where: args === null || args === void 0 ? void 0 : args.filter })));
41
- const result = yield (yield this.dbConnection).getRepository(ContactEntity_1.ContactEntity).find({
42
- where: {
43
- id: (0, typeorm_1.In)(initialResult.map((contact) => contact.id)),
44
- },
45
- });
46
- return result.map((contact) => this.contactFrom(contact));
47
- });
48
- this.addContact = (args) => __awaiter(this, void 0, void 0, function* () {
49
- const { name, alias, uri, identities } = args;
50
- const result = yield (yield this.dbConnection).getRepository(ContactEntity_1.ContactEntity).findOne({
51
- where: [{ name }, { alias }],
52
- });
53
- if (result) {
54
- return Promise.reject(Error(`Duplicate names or aliases are not allowed. Name: ${name}, Alias: ${alias}`));
55
- }
56
- for (const identity of identities !== null && identities !== void 0 ? identities : []) {
57
- if (identity.identifier.type === types_1.CorrelationIdentifierEnum.URL) {
58
- if (!identity.connection) {
59
- return Promise.reject(Error(`Identity with correlation type ${types_1.CorrelationIdentifierEnum.URL} should contain a connection`));
60
- }
61
- if (!this.hasCorrectConfig(identity.connection.type, identity.connection.config)) {
62
- return Promise.reject(Error(`Connection type ${identity.connection.type}, does not match for provided config`));
63
- }
64
- }
65
- }
66
- const contactEntity = (0, ContactEntity_1.contactEntityFrom)({ name, alias, uri, identities });
67
- debug('Adding contact', name);
68
- const createdResult = yield (yield this.dbConnection).getRepository(ContactEntity_1.ContactEntity).save(contactEntity);
69
- return this.contactFrom(createdResult);
70
- });
71
- this.updateContact = ({ contact }) => __awaiter(this, void 0, void 0, function* () {
72
- const result = yield (yield this.dbConnection).getRepository(ContactEntity_1.ContactEntity).findOne({
73
- where: { id: contact.id },
74
- });
75
- if (!result) {
76
- return Promise.reject(Error(`No contact found for id: ${contact.id}`));
77
- }
78
- const updatedContact = Object.assign(Object.assign({}, contact), { identities: result.identities });
79
- debug('Updating contact', contact);
80
- const updatedResult = yield (yield this.dbConnection).getRepository(ContactEntity_1.ContactEntity).save(updatedContact, { transaction: true });
81
- return this.contactFrom(updatedResult);
82
- });
83
- this.removeContact = ({ contactId }) => __awaiter(this, void 0, void 0, function* () {
84
- debug('Removing contact', contactId);
85
- (yield this.dbConnection)
86
- .getRepository(ContactEntity_1.ContactEntity)
87
- .findOneById(contactId)
88
- .then((contact) => __awaiter(this, void 0, void 0, function* () {
89
- if (!contact) {
90
- yield Promise.reject(Error(`Unable to find the contact with id to remove: ${contactId}`));
91
- }
92
- else {
93
- yield this.deleteIdentities(contact.identities);
94
- yield (yield this.dbConnection)
95
- .getRepository(ContactEntity_1.ContactEntity)
96
- .delete({ id: contactId })
97
- .catch((error) => Promise.reject(Error(`Unable to remove contact with id: ${contactId}. ${error}`)));
98
- }
99
- }))
100
- .catch((error) => Promise.reject(Error(`Unable to remove contact with id: ${contactId}. ${error}`)));
101
- });
102
- this.getIdentity = ({ identityId }) => __awaiter(this, void 0, void 0, function* () {
103
- const result = yield (yield this.dbConnection).getRepository(IdentityEntity_1.IdentityEntity).findOne({
104
- where: { id: identityId },
105
- });
106
- if (!result) {
107
- return Promise.reject(Error(`No identity found for id: ${identityId}`));
108
- }
109
- return this.identityFrom(result);
110
- });
111
- this.getIdentities = (args) => __awaiter(this, void 0, void 0, function* () {
112
- const initialResult = yield (yield this.dbConnection).getRepository(IdentityEntity_1.IdentityEntity).find(Object.assign({}, ((args === null || args === void 0 ? void 0 : args.filter) && { where: args === null || args === void 0 ? void 0 : args.filter })));
113
- const result = yield (yield this.dbConnection).getRepository(IdentityEntity_1.IdentityEntity).find({
114
- where: {
115
- id: (0, typeorm_1.In)(initialResult.map((identity) => identity.id)),
116
- },
117
- });
118
- return result.map((identity) => this.identityFrom(identity));
119
- });
120
- this.addIdentity = ({ identity, contactId }) => __awaiter(this, void 0, void 0, function* () {
121
- const contact = yield (yield this.dbConnection).getRepository(ContactEntity_1.ContactEntity).findOne({
122
- where: { id: contactId },
123
- });
124
- if (!contact) {
125
- return Promise.reject(Error(`No contact found for id: ${contactId}`));
126
- }
127
- if (identity.identifier.type === types_1.CorrelationIdentifierEnum.URL) {
128
- if (!identity.connection) {
129
- return Promise.reject(Error(`Identity with correlation type ${types_1.CorrelationIdentifierEnum.URL} should contain a connection`));
130
- }
131
- if (!this.hasCorrectConfig(identity.connection.type, identity.connection.config)) {
132
- return Promise.reject(Error(`Connection type ${identity.connection.type}, does not match for provided config`));
133
- }
134
- }
135
- const identityEntity = (0, IdentityEntity_1.identityEntityFrom)(identity);
136
- identityEntity.contact = contact;
137
- debug('Adding identity', identity);
138
- const result = yield (yield this.dbConnection).getRepository(IdentityEntity_1.IdentityEntity).save(identityEntity, {
139
- transaction: true,
140
- });
141
- return this.identityFrom(result);
142
- });
143
- this.updateIdentity = ({ identity }) => __awaiter(this, void 0, void 0, function* () {
144
- const result = yield (yield this.dbConnection).getRepository(IdentityEntity_1.IdentityEntity).findOne({
145
- where: { id: identity.id },
146
- });
147
- if (!result) {
148
- return Promise.reject(Error(`No identity found for id: ${identity.id}`));
149
- }
150
- if (identity.identifier.type === types_1.CorrelationIdentifierEnum.URL) {
151
- if (!identity.connection) {
152
- return Promise.reject(Error(`Identity with correlation type ${types_1.CorrelationIdentifierEnum.URL} should contain a connection`));
153
- }
154
- if (!this.hasCorrectConfig(identity.connection.type, identity.connection.config)) {
155
- return Promise.reject(Error(`Connection type ${identity.connection.type}, does not match for provided config`));
156
- }
157
- }
158
- debug('Updating identity', identity);
159
- const updatedResult = yield (yield this.dbConnection).getRepository(IdentityEntity_1.IdentityEntity).save(identity, { transaction: true });
160
- return this.identityFrom(updatedResult);
161
- });
162
- this.removeIdentity = ({ identityId }) => __awaiter(this, void 0, void 0, function* () {
163
- const identity = yield (yield this.dbConnection).getRepository(IdentityEntity_1.IdentityEntity).findOne({
164
- where: { id: identityId },
165
- });
166
- if (!identity) {
167
- return Promise.reject(Error(`No identity found for id: ${identityId}`));
168
- }
169
- debug('Removing identity', identityId);
170
- yield this.deleteIdentities([identity]);
171
- });
172
- this.contactFrom = (contact) => {
173
- var _a, _b;
174
- return {
175
- id: contact.id,
176
- name: contact.name,
177
- alias: contact.alias,
178
- uri: contact.uri,
179
- roles: (_b = [...new Set((_a = contact.identities) === null || _a === void 0 ? void 0 : _a.flatMap((identity) => identity.roles))]) !== null && _b !== void 0 ? _b : [],
180
- identities: contact.identities ? contact.identities.map((identity) => this.identityFrom(identity)) : [],
181
- createdAt: contact.createdAt,
182
- lastUpdatedAt: contact.lastUpdatedAt,
183
- };
184
- };
185
- this.identityFrom = (identity) => {
186
- return Object.assign(Object.assign({ id: identity.id, alias: identity.alias, roles: identity.roles, identifier: this.correlationIdentifierFrom(identity.identifier) }, (identity.connection && { connection: this.connectionFrom(identity.connection) })), { metadata: identity.metadata ? identity.metadata.map((item) => this.metadataItemFrom(item)) : [], createdAt: identity.createdAt, lastUpdatedAt: identity.createdAt });
187
- };
188
- this.correlationIdentifierFrom = (identifier) => {
189
- return {
190
- id: identifier.id,
191
- type: identifier.type,
192
- correlationId: identifier.correlationId,
193
- };
194
- };
195
- this.metadataItemFrom = (item) => {
196
- return {
197
- id: item.id,
198
- label: item.label,
199
- value: item.value,
200
- };
201
- };
202
- this.connectionFrom = (connection) => {
203
- return {
204
- id: connection.id,
205
- type: connection.type,
206
- config: this.configFrom(connection.type, connection.config),
207
- };
208
- };
209
- this.configFrom = (type, config) => {
210
- switch (type) {
211
- case types_1.ConnectionTypeEnum.OPENID_CONNECT:
212
- return {
213
- id: config.id,
214
- clientId: config.clientId,
215
- clientSecret: config.clientSecret,
216
- scopes: config.scopes,
217
- issuer: config.issuer,
218
- redirectUrl: config.redirectUrl,
219
- dangerouslyAllowInsecureHttpRequests: config.dangerouslyAllowInsecureHttpRequests,
220
- clientAuthMethod: config.clientAuthMethod,
221
- };
222
- case types_1.ConnectionTypeEnum.SIOPv2:
223
- return {
224
- id: config.id,
225
- identifier: { did: config.identifier, provider: '', keys: [], services: [] },
226
- stateId: '',
227
- redirectUrl: config.redirectUrl,
228
- sessionId: config.sessionId,
229
- };
230
- default:
231
- throw new Error('Connection type not supported');
232
- }
233
- };
234
- this.isOpenIdConfig = (config) => 'clientSecret' in config && 'issuer' in config && 'redirectUrl' in config;
235
- this.isDidAuthConfig = (config) => 'identifier' in config && 'redirectUrl' in config && 'sessionId' in config;
236
- this.dbConnection = dbConnection;
237
- }
238
- deleteIdentities(identities) {
239
- return __awaiter(this, void 0, void 0, function* () {
240
- debug('Removing identities', identities);
241
- identities.map((identity) => __awaiter(this, void 0, void 0, function* () {
242
- yield (yield this.dbConnection)
243
- .getRepository(CorrelationIdentifierEntity_1.CorrelationIdentifierEntity)
244
- .delete(identity.identifier.id)
245
- .catch((error) => Promise.reject(Error(`Unable to remove identity.identifier with id: ${identity.identifier.id}. ${error}`)));
246
- if (identity.connection) {
247
- yield (yield this.dbConnection).getRepository(BaseConfigEntity_1.BaseConfigEntity).delete(identity.connection.config.id);
248
- yield (yield this.dbConnection)
249
- .getRepository(ConnectionEntity_1.ConnectionEntity)
250
- .delete(identity.connection.id)
251
- .catch((error) => Promise.reject(Error(`Unable to remove identity.connection with id. ${error}`)));
252
- }
253
- if (identity.metadata) {
254
- identity.metadata.map((metadataItem) => __awaiter(this, void 0, void 0, function* () {
255
- yield (yield this.dbConnection)
256
- .getRepository(IdentityMetadataItemEntity_1.IdentityMetadataItemEntity)
257
- .delete(metadataItem.id)
258
- .catch((error) => Promise.reject(Error(`Unable to remove metadataItem.id with id ${metadataItem.id}. ${error}`)));
259
- }));
260
- }
261
- ;
262
- (yield this.dbConnection)
263
- .getRepository(IdentityEntity_1.IdentityEntity)
264
- .delete(identity.id)
265
- .catch((error) => Promise.reject(Error(`Unable to remove metadataItem.id with id ${identity.id}. ${error}`)));
266
- }));
267
- });
268
- }
269
- hasCorrectConfig(type, config) {
270
- switch (type) {
271
- case types_1.ConnectionTypeEnum.OPENID_CONNECT:
272
- return this.isOpenIdConfig(config);
273
- case types_1.ConnectionTypeEnum.SIOPv2:
274
- return this.isDidAuthConfig(config);
275
- default:
276
- throw new Error('Connection type not supported');
277
- }
278
- }
279
- }
280
- exports.ContactStore = ContactStore;
281
- //# sourceMappingURL=ContactStore.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContactStore.js","sourceRoot":"","sources":["../../src/contact/ContactStore.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAAyB;AAEzB,iEAA6D;AAC7D,oCAsBiB;AACjB,qEAAoF;AACpF,uEAAuF;AACvF,+FAA2F;AAC3F,iGAA6F;AAC7F,2EAAuE;AACvE,2EAAuE;AAGvE,qCAAwC;AAExC,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,gCAAgC,CAAC,CAAA;AAErD,MAAa,YAAa,SAAQ,2CAAoB;IAGpD,YAAY,YAAmC;QAC7C,KAAK,EAAE,CAAA;QAIT,eAAU,GAAG,CAAO,EAAE,SAAS,EAAmB,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CAOF;AA5UD,oCA4UC"}
@@ -1,5 +0,0 @@
1
- import { BaseEntity } from 'typeorm';
2
- export declare abstract class BaseConfigEntity extends BaseEntity {
3
- id: string;
4
- }
5
- //# sourceMappingURL=BaseConfigEntity.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,26 +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
- 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
@@ -1 +0,0 @@
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"}
@@ -1,12 +0,0 @@
1
- import { BaseEntity } from 'typeorm';
2
- import { BaseConfigEntity } from './BaseConfigEntity';
3
- import { ConnectionTypeEnum, IBasicConnection } from '../../types';
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
@@ -1 +0,0 @@
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,aAAa,CAAA;AACxH,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"}
@@ -1,66 +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
- 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 types_1 = require("../../types");
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: types_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 types_1.ConnectionTypeEnum.OPENID_CONNECT:
59
- return (0, OpenIdConfigEntity_1.openIdConfigEntityFrom)(config);
60
- case types_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
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConnectionEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/ConnectionEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAkG;AAClG,yDAAqD;AACrD,uCAAwH;AACxH,qDAAiD;AACjD,6DAAiF;AACjF,+DAAoF;AAG7E,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,oBAAU;CAoB/C,CAAA;AAnBC;IAAC,IAA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AO,IAAA,2CAAsB,EAAC,MAAuB,CAAC,CAAA;QACxD,KAAK,0BAAkB,CAAC,MAAM;YAC5B,OAAO,IAAA,6CAAuB,EAAC,MAAwB,CAAC,CAAA;QAC1D;YACE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAA;KACnD;AACH,CAAC,CAAA"}
@@ -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"}