@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.
Files changed (100) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +67 -0
  3. package/dist/contact/AbstractContactStore.d.ts +15 -0
  4. package/dist/contact/AbstractContactStore.d.ts.map +1 -0
  5. package/dist/contact/AbstractContactStore.js +7 -0
  6. package/dist/contact/AbstractContactStore.js.map +1 -0
  7. package/dist/contact/ContactStore.d.ts +30 -0
  8. package/dist/contact/ContactStore.d.ts.map +1 -0
  9. package/dist/contact/ContactStore.js +281 -0
  10. package/dist/contact/ContactStore.js.map +1 -0
  11. package/dist/entities/contact/BaseConfigEntity.d.ts +5 -0
  12. package/dist/entities/contact/BaseConfigEntity.d.ts.map +1 -0
  13. package/dist/entities/contact/BaseConfigEntity.js +26 -0
  14. package/dist/entities/contact/BaseConfigEntity.js.map +1 -0
  15. package/dist/entities/contact/ConnectionEntity.d.ts +12 -0
  16. package/dist/entities/contact/ConnectionEntity.d.ts.map +1 -0
  17. package/dist/entities/contact/ConnectionEntity.js +66 -0
  18. package/dist/entities/contact/ConnectionEntity.js.map +1 -0
  19. package/dist/entities/contact/ContactEntity.d.ts +16 -0
  20. package/dist/entities/contact/ContactEntity.d.ts.map +1 -0
  21. package/dist/entities/contact/ContactEntity.js +108 -0
  22. package/dist/entities/contact/ContactEntity.js.map +1 -0
  23. package/dist/entities/contact/CorrelationIdentifierEntity.d.ts +12 -0
  24. package/dist/entities/contact/CorrelationIdentifierEntity.d.ts.map +1 -0
  25. package/dist/entities/contact/CorrelationIdentifierEntity.js +76 -0
  26. package/dist/entities/contact/CorrelationIdentifierEntity.js.map +1 -0
  27. package/dist/entities/contact/DidAuthConfigEntity.d.ts +11 -0
  28. package/dist/entities/contact/DidAuthConfigEntity.d.ts.map +1 -0
  29. package/dist/entities/contact/DidAuthConfigEntity.js +49 -0
  30. package/dist/entities/contact/DidAuthConfigEntity.js.map +1 -0
  31. package/dist/entities/contact/IdentityEntity.d.ts +22 -0
  32. package/dist/entities/contact/IdentityEntity.d.ts.map +1 -0
  33. package/dist/entities/contact/IdentityEntity.js +137 -0
  34. package/dist/entities/contact/IdentityEntity.js.map +1 -0
  35. package/dist/entities/contact/IdentityMetadataItemEntity.d.ts +12 -0
  36. package/dist/entities/contact/IdentityMetadataItemEntity.d.ts.map +1 -0
  37. package/dist/entities/contact/IdentityMetadataItemEntity.js +73 -0
  38. package/dist/entities/contact/IdentityMetadataItemEntity.js.map +1 -0
  39. package/dist/entities/contact/OpenIdConfigEntity.d.ts +15 -0
  40. package/dist/entities/contact/OpenIdConfigEntity.d.ts.map +1 -0
  41. package/dist/entities/contact/OpenIdConfigEntity.js +70 -0
  42. package/dist/entities/contact/OpenIdConfigEntity.js.map +1 -0
  43. package/dist/index.d.ts +16 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +59 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/migrations/generic/1-CreateContacts.d.ts +7 -0
  48. package/dist/migrations/generic/1-CreateContacts.d.ts.map +1 -0
  49. package/dist/migrations/generic/1-CreateContacts.js +72 -0
  50. package/dist/migrations/generic/1-CreateContacts.js.map +1 -0
  51. package/dist/migrations/generic/index.d.ts +10 -0
  52. package/dist/migrations/generic/index.d.ts.map +1 -0
  53. package/dist/migrations/generic/index.js +13 -0
  54. package/dist/migrations/generic/index.js.map +1 -0
  55. package/dist/migrations/index.d.ts +2 -0
  56. package/dist/migrations/index.d.ts.map +1 -0
  57. package/dist/migrations/index.js +6 -0
  58. package/dist/migrations/index.js.map +1 -0
  59. package/dist/migrations/internal-migrations-ormconfig.d.ts +6 -0
  60. package/dist/migrations/internal-migrations-ormconfig.d.ts.map +1 -0
  61. package/dist/migrations/internal-migrations-ormconfig.js +29 -0
  62. package/dist/migrations/internal-migrations-ormconfig.js.map +1 -0
  63. package/dist/migrations/postgres/1659463079428-CreateContacts.d.ts +7 -0
  64. package/dist/migrations/postgres/1659463079428-CreateContacts.d.ts.map +1 -0
  65. package/dist/migrations/postgres/1659463079428-CreateContacts.js +55 -0
  66. package/dist/migrations/postgres/1659463079428-CreateContacts.js.map +1 -0
  67. package/dist/migrations/sqlite/1659463069549-CreateContacts.d.ts +7 -0
  68. package/dist/migrations/sqlite/1659463069549-CreateContacts.d.ts.map +1 -0
  69. package/dist/migrations/sqlite/1659463069549-CreateContacts.js +79 -0
  70. package/dist/migrations/sqlite/1659463069549-CreateContacts.js.map +1 -0
  71. package/dist/types/IAbstractContactStore.d.ts +41 -0
  72. package/dist/types/IAbstractContactStore.d.ts.map +1 -0
  73. package/dist/types/IAbstractContactStore.js +3 -0
  74. package/dist/types/IAbstractContactStore.js.map +1 -0
  75. package/dist/types/contact.d.ts +91 -0
  76. package/dist/types/contact.d.ts.map +1 -0
  77. package/dist/types/contact.js +21 -0
  78. package/dist/types/contact.js.map +1 -0
  79. package/package.json +45 -0
  80. package/src/__tests__/contact.entities.test.ts +911 -0
  81. package/src/__tests__/contact.store.test.ts +743 -0
  82. package/src/contact/AbstractContactStore.ts +26 -0
  83. package/src/contact/ContactStore.ts +373 -0
  84. package/src/entities/contact/BaseConfigEntity.ts +8 -0
  85. package/src/entities/contact/ConnectionEntity.ts +48 -0
  86. package/src/entities/contact/ContactEntity.ts +76 -0
  87. package/src/entities/contact/CorrelationIdentifierEntity.ts +41 -0
  88. package/src/entities/contact/DidAuthConfigEntity.ts +31 -0
  89. package/src/entities/contact/IdentityEntity.ts +106 -0
  90. package/src/entities/contact/IdentityMetadataItemEntity.ts +39 -0
  91. package/src/entities/contact/OpenIdConfigEntity.ts +48 -0
  92. package/src/index.ts +45 -0
  93. package/src/migrations/generic/1-CreateContacts.ts +54 -0
  94. package/src/migrations/generic/index.ts +10 -0
  95. package/src/migrations/index.ts +1 -0
  96. package/src/migrations/internal-migrations-ormconfig.ts +28 -0
  97. package/src/migrations/postgres/1659463079428-CreateContacts.ts +61 -0
  98. package/src/migrations/sqlite/1659463069549-CreateContacts.ts +111 -0
  99. package/src/types/IAbstractContactStore.ts +51 -0
  100. package/src/types/contact.ts +101 -0
@@ -0,0 +1,73 @@
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.metadataItemEntityFrom = exports.IdentityMetadataItemEntity = void 0;
22
+ const typeorm_1 = require("typeorm");
23
+ const IdentityEntity_1 = require("./IdentityEntity");
24
+ const class_validator_1 = require("class-validator");
25
+ let IdentityMetadataItemEntity = class IdentityMetadataItemEntity extends typeorm_1.BaseEntity {
26
+ validate() {
27
+ var _a;
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ const validation = yield (0, class_validator_1.validate)(this);
30
+ if (validation.length > 0) {
31
+ return Promise.reject(Error((_a = validation[0].constraints) === null || _a === void 0 ? void 0 : _a.isNotEmpty));
32
+ }
33
+ return;
34
+ });
35
+ }
36
+ };
37
+ __decorate([
38
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
39
+ __metadata("design:type", String)
40
+ ], IdentityMetadataItemEntity.prototype, "id", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ name: 'label', length: 255, nullable: false }),
43
+ (0, class_validator_1.IsNotEmpty)({ message: 'Blank metadata labels are not allowed' }),
44
+ __metadata("design:type", String)
45
+ ], IdentityMetadataItemEntity.prototype, "label", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ name: 'value', length: 255, nullable: false }),
48
+ (0, class_validator_1.IsNotEmpty)({ message: 'Blank metadata values are not allowed' }),
49
+ __metadata("design:type", String)
50
+ ], IdentityMetadataItemEntity.prototype, "value", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.ManyToOne)(() => IdentityEntity_1.IdentityEntity, (identity) => identity.metadata, { cascade: ['insert', 'update'], onDelete: 'CASCADE' }),
53
+ __metadata("design:type", IdentityEntity_1.IdentityEntity)
54
+ ], IdentityMetadataItemEntity.prototype, "identity", void 0);
55
+ __decorate([
56
+ (0, typeorm_1.BeforeInsert)(),
57
+ (0, typeorm_1.BeforeUpdate)(),
58
+ __metadata("design:type", Function),
59
+ __metadata("design:paramtypes", []),
60
+ __metadata("design:returntype", Promise)
61
+ ], IdentityMetadataItemEntity.prototype, "validate", null);
62
+ IdentityMetadataItemEntity = __decorate([
63
+ (0, typeorm_1.Entity)('IdentityMetadata')
64
+ ], IdentityMetadataItemEntity);
65
+ exports.IdentityMetadataItemEntity = IdentityMetadataItemEntity;
66
+ const metadataItemEntityFrom = (item) => {
67
+ const metadataItem = new IdentityMetadataItemEntity();
68
+ metadataItem.label = item.label;
69
+ metadataItem.value = item.value;
70
+ return metadataItem;
71
+ };
72
+ exports.metadataItemEntityFrom = metadataItemEntityFrom;
73
+ //# sourceMappingURL=IdentityMetadataItemEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdentityMetadataItemEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/IdentityMetadataItemEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,qCAAmH;AAEnH,qDAAiD;AACjD,qDAAsD;AAG/C,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,oBAAU;IAiBlD,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;AAvBC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;sDACpB;AAEX;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACvD,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,uCAAuC,EAAE,CAAC;;yDACnD;AAEd;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACvD,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,uCAAuC,EAAE,CAAC;;yDACnD;AAEd;IAAC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,+BAAc,EAAE,CAAC,QAAwB,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;8BAC9H,+BAAc;4DAAA;AAInB;IAFL,IAAA,sBAAY,GAAE;IACd,IAAA,sBAAY,GAAE;;;;0DAOd;AAvBU,0BAA0B;IADtC,IAAA,gBAAM,EAAC,kBAAkB,CAAC;GACd,0BAA0B,CAwBtC;AAxBY,gEAA0B;AA0BhC,MAAM,sBAAsB,GAAG,CAAC,IAAuB,EAA8B,EAAE;IAC5F,MAAM,YAAY,GAAG,IAAI,0BAA0B,EAAE,CAAA;IACrD,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;IAC/B,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;IAE/B,OAAO,YAAY,CAAA;AACrB,CAAC,CAAA;AANY,QAAA,sBAAsB,0BAMlC"}
@@ -0,0 +1,15 @@
1
+ import { BaseConfigEntity } from './BaseConfigEntity';
2
+ import { BasicOpenIdConfig } from '../../types/contact';
3
+ import { ConnectionEntity } from './ConnectionEntity';
4
+ export declare class OpenIdConfigEntity extends BaseConfigEntity {
5
+ clientId: string;
6
+ clientSecret: string;
7
+ scopes: Array<string>;
8
+ issuer: string;
9
+ redirectUrl: string;
10
+ dangerouslyAllowInsecureHttpRequests: boolean;
11
+ clientAuthMethod: 'basic' | 'post' | undefined;
12
+ connection?: ConnectionEntity;
13
+ }
14
+ export declare const openIdConfigEntityFrom: (config: BasicOpenIdConfig) => OpenIdConfigEntity;
15
+ //# sourceMappingURL=OpenIdConfigEntity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenIdConfigEntity.d.ts","sourceRoot":"","sources":["../../../src/entities/contact/OpenIdConfigEntity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,qBACa,kBAAmB,SAAQ,gBAAgB;IAEtD,QAAQ,EAAG,MAAM,CAAA;IAGjB,YAAY,EAAG,MAAM,CAAA;IAGrB,MAAM,EAAG,KAAK,CAAC,MAAM,CAAC,CAAA;IAGtB,MAAM,EAAG,MAAM,CAAA;IAGf,WAAW,EAAG,MAAM,CAAA;IAGpB,oCAAoC,EAAG,OAAO,CAAA;IAG9C,gBAAgB,EAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;IAO/C,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAC9B;AAED,eAAO,MAAM,sBAAsB,WAAY,iBAAiB,KAAG,kBAWlE,CAAA"}
@@ -0,0 +1,70 @@
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.openIdConfigEntityFrom = exports.OpenIdConfigEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseConfigEntity_1 = require("./BaseConfigEntity");
15
+ const ConnectionEntity_1 = require("./ConnectionEntity");
16
+ let OpenIdConfigEntity = class OpenIdConfigEntity extends BaseConfigEntity_1.BaseConfigEntity {
17
+ };
18
+ __decorate([
19
+ (0, typeorm_1.Column)({ name: 'client_id', length: 255, nullable: false }),
20
+ __metadata("design:type", String)
21
+ ], OpenIdConfigEntity.prototype, "clientId", void 0);
22
+ __decorate([
23
+ (0, typeorm_1.Column)({ name: 'client_secret', length: 255, nullable: false }),
24
+ __metadata("design:type", String)
25
+ ], OpenIdConfigEntity.prototype, "clientSecret", void 0);
26
+ __decorate([
27
+ (0, typeorm_1.Column)('simple-array', { name: 'scopes', nullable: false }),
28
+ __metadata("design:type", Array)
29
+ ], OpenIdConfigEntity.prototype, "scopes", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.Column)({ name: 'issuer', length: 255, nullable: false }),
32
+ __metadata("design:type", String)
33
+ ], OpenIdConfigEntity.prototype, "issuer", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)('text', { name: 'redirect_url', nullable: false }),
36
+ __metadata("design:type", String)
37
+ ], OpenIdConfigEntity.prototype, "redirectUrl", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.Column)('boolean', { name: 'dangerously_allow_insecure_http_requests', nullable: false }),
40
+ __metadata("design:type", Boolean)
41
+ ], OpenIdConfigEntity.prototype, "dangerouslyAllowInsecureHttpRequests", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)('text', { name: 'client_auth_method', nullable: false }),
44
+ __metadata("design:type", Object)
45
+ ], OpenIdConfigEntity.prototype, "clientAuthMethod", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.OneToOne)(() => ConnectionEntity_1.ConnectionEntity, (connection) => connection.config, {
48
+ cascade: ['insert', 'update'],
49
+ onDelete: 'CASCADE',
50
+ }),
51
+ (0, typeorm_1.JoinColumn)({ name: 'connectionId' }),
52
+ __metadata("design:type", ConnectionEntity_1.ConnectionEntity)
53
+ ], OpenIdConfigEntity.prototype, "connection", void 0);
54
+ OpenIdConfigEntity = __decorate([
55
+ (0, typeorm_1.ChildEntity)('OpenIdConfig')
56
+ ], OpenIdConfigEntity);
57
+ exports.OpenIdConfigEntity = OpenIdConfigEntity;
58
+ const openIdConfigEntityFrom = (config) => {
59
+ const openIdConfig = new OpenIdConfigEntity();
60
+ openIdConfig.clientId = config.clientId;
61
+ openIdConfig.clientSecret = config.clientSecret;
62
+ openIdConfig.scopes = config.scopes;
63
+ openIdConfig.issuer = config.issuer;
64
+ openIdConfig.redirectUrl = config.redirectUrl;
65
+ openIdConfig.dangerouslyAllowInsecureHttpRequests = config.dangerouslyAllowInsecureHttpRequests;
66
+ openIdConfig.clientAuthMethod = config.clientAuthMethod;
67
+ return openIdConfig;
68
+ };
69
+ exports.openIdConfigEntityFrom = openIdConfigEntityFrom;
70
+ //# sourceMappingURL=OpenIdConfigEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenIdConfigEntity.js","sourceRoot":"","sources":["../../../src/entities/contact/OpenIdConfigEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAmE;AACnE,yDAAqD;AAErD,yDAAqD;AAG9C,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,mCAAgB;CA4BvD,CAAA;AA3BC;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;oDAC3C;AAEjB;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;wDAC3C;AAErB;IAAC,IAAA,gBAAM,EAAC,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;8BACnD,KAAK;kDAAQ;AAEtB;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;kDAC1C;AAEf;IAAC,IAAA,gBAAM,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;uDACtC;AAEpB;IAAC,IAAA,gBAAM,EAAC,SAAS,EAAE,EAAE,IAAI,EAAE,0CAA0C,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;gFAC3C;AAE9C;IAAC,IAAA,gBAAM,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;4DACjB;AAE/C;IAAC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,mCAAgB,EAAE,CAAC,UAA4B,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE;QACrF,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;QAC7B,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;8BACxB,mCAAgB;sDAAA;AA3BlB,kBAAkB;IAD9B,IAAA,qBAAW,EAAC,cAAc,CAAC;GACf,kBAAkB,CA4B9B;AA5BY,gDAAkB;AA8BxB,MAAM,sBAAsB,GAAG,CAAC,MAAyB,EAAsB,EAAE;IACtF,MAAM,YAAY,GAAG,IAAI,kBAAkB,EAAE,CAAA;IAC7C,YAAY,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAA;IACvC,YAAY,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAA;IAC/C,YAAY,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;IACnC,YAAY,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;IACnC,YAAY,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAA;IAC7C,YAAY,CAAC,oCAAoC,GAAG,MAAM,CAAC,oCAAoC,CAAA;IAC/F,YAAY,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAA;IAEvD,OAAO,YAAY,CAAA;AACrB,CAAC,CAAA;AAXY,QAAA,sBAAsB,0BAWlC"}
@@ -0,0 +1,16 @@
1
+ import { BaseConfigEntity } from './entities/contact/BaseConfigEntity';
2
+ import { ConnectionEntity, connectionEntityFrom } from './entities/contact/ConnectionEntity';
3
+ import { ContactEntity, contactEntityFrom } from './entities/contact/ContactEntity';
4
+ import { CorrelationIdentifierEntity, correlationIdentifierEntityFrom } from './entities/contact/CorrelationIdentifierEntity';
5
+ import { DidAuthConfigEntity, didAuthConfigEntityFrom } from './entities/contact/DidAuthConfigEntity';
6
+ import { IdentityEntity, identityEntityFrom } from './entities/contact/IdentityEntity';
7
+ import { IdentityMetadataItemEntity, metadataItemEntityFrom } from './entities/contact/IdentityMetadataItemEntity';
8
+ import { OpenIdConfigEntity, openIdConfigEntityFrom } from './entities/contact/OpenIdConfigEntity';
9
+ export { ContactStore } from './contact/ContactStore';
10
+ export { AbstractContactStore } from './contact/AbstractContactStore';
11
+ export declare const DataStoreContactEntities: (typeof BaseConfigEntity)[];
12
+ export { BaseConfigEntity, ConnectionEntity, ContactEntity, CorrelationIdentifierEntity, DidAuthConfigEntity, IdentityEntity, IdentityMetadataItemEntity, OpenIdConfigEntity, metadataItemEntityFrom, connectionEntityFrom, contactEntityFrom, correlationIdentifierEntityFrom, identityEntityFrom, didAuthConfigEntityFrom, openIdConfigEntityFrom, };
13
+ export * from './types/contact';
14
+ export * from './types/IAbstractContactStore';
15
+ export { DataStoreMigrations } from './migrations';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAC5F,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACnF,OAAO,EAAE,2BAA2B,EAAE,+BAA+B,EAAE,MAAM,gDAAgD,CAAA;AAC7H,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAA;AACrG,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACtF,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAA;AAClH,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAA;AAElG,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAA;AAErE,eAAO,MAAM,wBAAwB,6BASpC,CAAA;AAED,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,2BAA2B,EAC3B,mBAAmB,EACnB,cAAc,EACd,0BAA0B,EAC1B,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,+BAA+B,EAC/B,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,GACvB,CAAA;AAED,cAAc,iBAAiB,CAAA;AAC/B,cAAc,+BAA+B,CAAA;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.DataStoreMigrations = exports.openIdConfigEntityFrom = exports.didAuthConfigEntityFrom = exports.identityEntityFrom = exports.correlationIdentifierEntityFrom = exports.contactEntityFrom = exports.connectionEntityFrom = exports.metadataItemEntityFrom = exports.OpenIdConfigEntity = exports.IdentityMetadataItemEntity = exports.IdentityEntity = exports.DidAuthConfigEntity = exports.CorrelationIdentifierEntity = exports.ContactEntity = exports.ConnectionEntity = exports.BaseConfigEntity = exports.DataStoreContactEntities = exports.AbstractContactStore = exports.ContactStore = void 0;
18
+ const BaseConfigEntity_1 = require("./entities/contact/BaseConfigEntity");
19
+ Object.defineProperty(exports, "BaseConfigEntity", { enumerable: true, get: function () { return BaseConfigEntity_1.BaseConfigEntity; } });
20
+ const ConnectionEntity_1 = require("./entities/contact/ConnectionEntity");
21
+ Object.defineProperty(exports, "ConnectionEntity", { enumerable: true, get: function () { return ConnectionEntity_1.ConnectionEntity; } });
22
+ Object.defineProperty(exports, "connectionEntityFrom", { enumerable: true, get: function () { return ConnectionEntity_1.connectionEntityFrom; } });
23
+ const ContactEntity_1 = require("./entities/contact/ContactEntity");
24
+ Object.defineProperty(exports, "ContactEntity", { enumerable: true, get: function () { return ContactEntity_1.ContactEntity; } });
25
+ Object.defineProperty(exports, "contactEntityFrom", { enumerable: true, get: function () { return ContactEntity_1.contactEntityFrom; } });
26
+ const CorrelationIdentifierEntity_1 = require("./entities/contact/CorrelationIdentifierEntity");
27
+ Object.defineProperty(exports, "CorrelationIdentifierEntity", { enumerable: true, get: function () { return CorrelationIdentifierEntity_1.CorrelationIdentifierEntity; } });
28
+ Object.defineProperty(exports, "correlationIdentifierEntityFrom", { enumerable: true, get: function () { return CorrelationIdentifierEntity_1.correlationIdentifierEntityFrom; } });
29
+ const DidAuthConfigEntity_1 = require("./entities/contact/DidAuthConfigEntity");
30
+ Object.defineProperty(exports, "DidAuthConfigEntity", { enumerable: true, get: function () { return DidAuthConfigEntity_1.DidAuthConfigEntity; } });
31
+ Object.defineProperty(exports, "didAuthConfigEntityFrom", { enumerable: true, get: function () { return DidAuthConfigEntity_1.didAuthConfigEntityFrom; } });
32
+ const IdentityEntity_1 = require("./entities/contact/IdentityEntity");
33
+ Object.defineProperty(exports, "IdentityEntity", { enumerable: true, get: function () { return IdentityEntity_1.IdentityEntity; } });
34
+ Object.defineProperty(exports, "identityEntityFrom", { enumerable: true, get: function () { return IdentityEntity_1.identityEntityFrom; } });
35
+ const IdentityMetadataItemEntity_1 = require("./entities/contact/IdentityMetadataItemEntity");
36
+ Object.defineProperty(exports, "IdentityMetadataItemEntity", { enumerable: true, get: function () { return IdentityMetadataItemEntity_1.IdentityMetadataItemEntity; } });
37
+ Object.defineProperty(exports, "metadataItemEntityFrom", { enumerable: true, get: function () { return IdentityMetadataItemEntity_1.metadataItemEntityFrom; } });
38
+ const OpenIdConfigEntity_1 = require("./entities/contact/OpenIdConfigEntity");
39
+ Object.defineProperty(exports, "OpenIdConfigEntity", { enumerable: true, get: function () { return OpenIdConfigEntity_1.OpenIdConfigEntity; } });
40
+ Object.defineProperty(exports, "openIdConfigEntityFrom", { enumerable: true, get: function () { return OpenIdConfigEntity_1.openIdConfigEntityFrom; } });
41
+ var ContactStore_1 = require("./contact/ContactStore");
42
+ Object.defineProperty(exports, "ContactStore", { enumerable: true, get: function () { return ContactStore_1.ContactStore; } });
43
+ var AbstractContactStore_1 = require("./contact/AbstractContactStore");
44
+ Object.defineProperty(exports, "AbstractContactStore", { enumerable: true, get: function () { return AbstractContactStore_1.AbstractContactStore; } });
45
+ exports.DataStoreContactEntities = [
46
+ BaseConfigEntity_1.BaseConfigEntity,
47
+ ConnectionEntity_1.ConnectionEntity,
48
+ ContactEntity_1.ContactEntity,
49
+ IdentityEntity_1.IdentityEntity,
50
+ IdentityMetadataItemEntity_1.IdentityMetadataItemEntity,
51
+ CorrelationIdentifierEntity_1.CorrelationIdentifierEntity,
52
+ DidAuthConfigEntity_1.DidAuthConfigEntity,
53
+ OpenIdConfigEntity_1.OpenIdConfigEntity,
54
+ ];
55
+ __exportStar(require("./types/contact"), exports);
56
+ __exportStar(require("./types/IAbstractContactStore"), exports);
57
+ var migrations_1 = require("./migrations");
58
+ Object.defineProperty(exports, "DataStoreMigrations", { enumerable: true, get: function () { return migrations_1.DataStoreMigrations; } });
59
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0EAAsE;AAwBpE,iGAxBO,mCAAgB,OAwBP;AAvBlB,0EAA4F;AAwB1F,iGAxBO,mCAAgB,OAwBP;AAQhB,qGAhCyB,uCAAoB,OAgCzB;AA/BtB,oEAAmF;AAwBjF,8FAxBO,6BAAa,OAwBP;AAQb,kGAhCsB,iCAAiB,OAgCtB;AA/BnB,gGAA6H;AAwB3H,4GAxBO,yDAA2B,OAwBP;AAQ3B,gHAhCoC,6DAA+B,OAgCpC;AA/BjC,gFAAqG;AAwBnG,oGAxBO,yCAAmB,OAwBP;AASnB,wGAjC4B,6CAAuB,OAiC5B;AAhCzB,sEAAsF;AAwBpF,+FAxBO,+BAAc,OAwBP;AAOd,mGA/BuB,mCAAkB,OA+BvB;AA9BpB,8FAAkH;AAwBhH,2GAxBO,uDAA0B,OAwBP;AAE1B,uGA1BmC,mDAAsB,OA0BnC;AAzBxB,8EAAkG;AAwBhG,mGAxBO,uCAAkB,OAwBP;AAOlB,uGA/B2B,2CAAsB,OA+B3B;AA7BxB,uDAAqD;AAA5C,4GAAA,YAAY,OAAA;AACrB,uEAAqE;AAA5D,4HAAA,oBAAoB,OAAA;AAEhB,QAAA,wBAAwB,GAAG;IACtC,mCAAgB;IAChB,mCAAgB;IAChB,6BAAa;IACb,+BAAc;IACd,uDAA0B;IAC1B,yDAA2B;IAC3B,yCAAmB;IACnB,uCAAkB;CACnB,CAAA;AAoBD,kDAA+B;AAC/B,gEAA6C;AAE7C,2CAAkD;AAAzC,iHAAA,mBAAmB,OAAA"}
@@ -0,0 +1,7 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+ export declare class CreateContacts1659463079429 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
7
+ //# sourceMappingURL=1-CreateContacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1-CreateContacts.d.ts","sourceRoot":"","sources":["../../../src/migrations/generic/1-CreateContacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAOzD,qBAAa,2BAA4B,YAAW,kBAAkB;IACpE,IAAI,SAAgC;IAEvB,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAqB3D"}
@@ -0,0 +1,72 @@
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.CreateContacts1659463079429 = void 0;
16
+ const debug_1 = __importDefault(require("debug"));
17
+ const _1659463079428_CreateContacts_1 = require("../postgres/1659463079428-CreateContacts");
18
+ const _1659463069549_CreateContacts_1 = require("../sqlite/1659463069549-CreateContacts");
19
+ const debug = (0, debug_1.default)('sphereon:ssi-sdk:migrations');
20
+ class CreateContacts1659463079429 {
21
+ constructor() {
22
+ this.name = 'CreateContacts1659463079429';
23
+ }
24
+ up(queryRunner) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ debug('migration: creating contacts tables');
27
+ const dbType = queryRunner.connection.driver.options.type;
28
+ if (dbType === 'postgres') {
29
+ debug('using postgres migration file');
30
+ const mig = new _1659463079428_CreateContacts_1.CreateContacts1659463079428();
31
+ const up = yield mig.up(queryRunner);
32
+ debug('Migration statements executed');
33
+ return up;
34
+ }
35
+ else if (dbType === 'sqlite' || 'react-native') {
36
+ debug('using sqlite/react-native migration file');
37
+ const mig = new _1659463069549_CreateContacts_1.CreateContacts1659463069549();
38
+ const up = yield mig.up(queryRunner);
39
+ debug('Migration statements executed');
40
+ return up;
41
+ }
42
+ else {
43
+ return Promise.reject("Migrations are currently only supported for sqlite, react-native and postgres. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now");
44
+ }
45
+ });
46
+ }
47
+ down(queryRunner) {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ debug('reverting contacts tables');
50
+ const dbType = queryRunner.connection.driver.options.type;
51
+ if (dbType === 'postgres') {
52
+ debug('using postgres migration file');
53
+ const mig = new _1659463079428_CreateContacts_1.CreateContacts1659463079428();
54
+ const down = yield mig.down(queryRunner);
55
+ debug('Migration statements executed');
56
+ return down;
57
+ }
58
+ else if (dbType === 'sqlite' || 'react-native') {
59
+ debug('using sqlite/react-native migration file');
60
+ const mig = new _1659463069549_CreateContacts_1.CreateContacts1659463069549();
61
+ const down = yield mig.down(queryRunner);
62
+ debug('Migration statements executed');
63
+ return down;
64
+ }
65
+ else {
66
+ return Promise.reject("Migrations are currently only supported for sqlite, react-native and postgres. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now");
67
+ }
68
+ });
69
+ }
70
+ }
71
+ exports.CreateContacts1659463079429 = CreateContacts1659463079429;
72
+ //# sourceMappingURL=1-CreateContacts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1-CreateContacts.js","sourceRoot":"","sources":["../../../src/migrations/generic/1-CreateContacts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,kDAAyB;AACzB,4FAAsF;AACtF,0FAAoF;AAEpF,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,6BAA6B,CAAC,CAAA;AAElD,MAAa,2BAA2B;IAAxC;QACE,SAAI,GAAG,6BAA6B,CAAA;IA6CtC,CAAC;IA3Cc,EAAE,CAAC,WAAwB;;YACtC,KAAK,CAAC,qCAAqC,CAAC,CAAA;YAC5C,MAAM,MAAM,GAAG,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAA;YACzD,IAAI,MAAM,KAAK,UAAU,EAAE;gBACzB,KAAK,CAAC,+BAA+B,CAAC,CAAA;gBACtC,MAAM,GAAG,GAAG,IAAI,2DAA2B,EAAE,CAAA;gBAC7C,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;gBACpC,KAAK,CAAC,+BAA+B,CAAC,CAAA;gBACtC,OAAO,EAAE,CAAA;aACV;iBAAM,IAAI,MAAM,KAAK,QAAQ,IAAI,cAAc,EAAE;gBAChD,KAAK,CAAC,0CAA0C,CAAC,CAAA;gBACjD,MAAM,GAAG,GAAG,IAAI,2DAA2B,EAAE,CAAA;gBAC7C,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;gBACpC,KAAK,CAAC,+BAA+B,CAAC,CAAA;gBACtC,OAAO,EAAE,CAAA;aACV;iBAAM;gBACL,OAAO,OAAO,CAAC,MAAM,CACnB,4LAA4L,CAC7L,CAAA;aACF;QACH,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACxC,KAAK,CAAC,2BAA2B,CAAC,CAAA;YAClC,MAAM,MAAM,GAAG,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAA;YACzD,IAAI,MAAM,KAAK,UAAU,EAAE;gBACzB,KAAK,CAAC,+BAA+B,CAAC,CAAA;gBACtC,MAAM,GAAG,GAAG,IAAI,2DAA2B,EAAE,CAAA;gBAC7C,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;gBACxC,KAAK,CAAC,+BAA+B,CAAC,CAAA;gBACtC,OAAO,IAAI,CAAA;aACZ;iBAAM,IAAI,MAAM,KAAK,QAAQ,IAAI,cAAc,EAAE;gBAChD,KAAK,CAAC,0CAA0C,CAAC,CAAA;gBACjD,MAAM,GAAG,GAAG,IAAI,2DAA2B,EAAE,CAAA;gBAC7C,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;gBACxC,KAAK,CAAC,+BAA+B,CAAC,CAAA;gBACtC,OAAO,IAAI,CAAA;aACZ;iBAAM;gBACL,OAAO,OAAO,CAAC,MAAM,CACnB,4LAA4L,CAC7L,CAAA;aACF;QACH,CAAC;KAAA;CACF;AA9CD,kEA8CC"}
@@ -0,0 +1,10 @@
1
+ import { CreateContacts1659463079429 } from './1-CreateContacts';
2
+ /**
3
+ * The migrations array that SHOULD be used when initializing a TypeORM database connection.
4
+ *
5
+ * These ensure the correct creation of tables and the proper migrations of data when tables change between versions.
6
+ *
7
+ * @public
8
+ */
9
+ export declare const DataStoreMigrations: (typeof CreateContacts1659463079429)[];
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/generic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,wCAAgC,CAAA"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataStoreMigrations = void 0;
4
+ const _1_CreateContacts_1 = require("./1-CreateContacts");
5
+ /**
6
+ * The migrations array that SHOULD be used when initializing a TypeORM database connection.
7
+ *
8
+ * These ensure the correct creation of tables and the proper migrations of data when tables change between versions.
9
+ *
10
+ * @public
11
+ */
12
+ exports.DataStoreMigrations = [_1_CreateContacts_1.CreateContacts1659463079429];
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/migrations/generic/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgE;AAEhE;;;;;;GAMG;AACU,QAAA,mBAAmB,GAAG,CAAC,+CAA2B,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { DataStoreMigrations } from './generic';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataStoreMigrations = void 0;
4
+ var generic_1 = require("./generic");
5
+ Object.defineProperty(exports, "DataStoreMigrations", { enumerable: true, get: function () { return generic_1.DataStoreMigrations; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":";;;AAAA,qCAA+C;AAAtC,8GAAA,mBAAmB,OAAA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Do Not use these connections in production!. They are only here to create/test migration files!
3
+ */
4
+ declare const _default: import("typeorm").DataSourceOptions[];
5
+ export default _default;
6
+ //# sourceMappingURL=internal-migrations-ormconfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-migrations-ormconfig.d.ts","sourceRoot":"","sources":["../../src/migrations/internal-migrations-ormconfig.ts"],"names":[],"mappings":"AAGA;;GAEG;;AACH,wBAqBwB"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const index_1 = require("../index");
4
+ /**
5
+ * Do Not use these connections in production!. They are only here to create/test migration files!
6
+ */
7
+ exports.default = [
8
+ {
9
+ type: 'sqlite',
10
+ name: 'migration-sqlite',
11
+ database: 'migration.sqlite',
12
+ migrationsRun: false,
13
+ synchronize: false,
14
+ logging: ['error', 'info', 'warn', 'log'],
15
+ entities: [...index_1.DataStoreContactEntities],
16
+ migrations: [...index_1.DataStoreMigrations],
17
+ },
18
+ {
19
+ type: 'postgres',
20
+ name: 'migration-postgres',
21
+ database: 'migration-postgres',
22
+ migrationsRun: false,
23
+ synchronize: false,
24
+ logging: ['error', 'info', 'warn', 'log'],
25
+ entities: [...index_1.DataStoreContactEntities],
26
+ migrations: [...index_1.DataStoreMigrations],
27
+ },
28
+ ];
29
+ //# sourceMappingURL=internal-migrations-ormconfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-migrations-ormconfig.js","sourceRoot":"","sources":["../../src/migrations/internal-migrations-ormconfig.ts"],"names":[],"mappings":";;AACA,oCAAwE;AAExE;;GAEG;AACH,kBAAe;IACb;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,kBAAkB;QACxB,QAAQ,EAAE,kBAAkB;QAC5B,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;QACzC,QAAQ,EAAE,CAAC,GAAG,gCAAwB,CAAC;QACvC,UAAU,EAAE,CAAC,GAAG,2BAAmB,CAAC;KACrC;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,oBAAoB;QAC1B,QAAQ,EAAE,oBAAoB;QAC9B,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;QACzC,QAAQ,EAAE,CAAC,GAAG,gCAAwB,CAAC;QACvC,UAAU,EAAE,CAAC,GAAG,2BAAmB,CAAC;KACrC;CACqB,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+ export declare class CreateContacts1659463079428 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
7
+ //# sourceMappingURL=1659463079428-CreateContacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1659463079428-CreateContacts.d.ts","sourceRoot":"","sources":["../../../src/migrations/postgres/1659463079428-CreateContacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEzD,qBAAa,2BAA4B,YAAW,kBAAkB;IACpE,IAAI,SAAgC;IAEvB,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAuC3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAgB3D"}
@@ -0,0 +1,55 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CreateContacts1659463079428 = void 0;
13
+ class CreateContacts1659463079428 {
14
+ constructor() {
15
+ this.name = 'CreateContacts1659463079428';
16
+ }
17
+ up(queryRunner) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield queryRunner.query(`CREATE TABLE "BaseConfigEntity" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "client_id" character varying(255), "client_secret" character varying(255), "scopes" text, "issuer" character varying(255), "redirect_url" text, "dangerously_allow_insecure_http_requests" boolean, "client_auth_method" text, "identifier" character varying(255), "session_id" character varying(255), "type" character varying NOT NULL, "connectionId" uuid, CONSTRAINT "REL_BaseConfig_connectionId" UNIQUE ("connectionId"), CONSTRAINT "PK_BaseConfigEntity_id" PRIMARY KEY ("id"))`);
20
+ yield queryRunner.query(`CREATE INDEX "IDX_BaseConfigEntity_type" ON "BaseConfigEntity" ("type")`);
21
+ yield queryRunner.query(`CREATE TYPE "public"."CorrelationIdentifier_type_enum" AS ENUM('did', 'url')`);
22
+ yield queryRunner.query(`CREATE TABLE "CorrelationIdentifier" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "type" "public"."CorrelationIdentifier_type_enum" NOT NULL, "correlation_id" text NOT NULL, "identityId" uuid, CONSTRAINT "UQ_Correlation_id" UNIQUE ("correlation_id"), CONSTRAINT "REL_CorrelationIdentifier_identityId" UNIQUE ("identityId"), CONSTRAINT "PK_CorrelationIdentifier_id" PRIMARY KEY ("id"))`);
23
+ yield queryRunner.query(`CREATE TABLE "Contact" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" character varying(255) NOT NULL, "alias" character varying(255) NOT NULL, "uri" character varying(255) NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "UQ_Name" UNIQUE ("name"), CONSTRAINT "UQ_Alias" UNIQUE ("alias"), CONSTRAINT "PK_Contact_id" PRIMARY KEY ("id"))`);
24
+ yield queryRunner.query(`CREATE TABLE "IdentityMetadata" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "label" character varying(255) NOT NULL, "value" character varying(255) NOT NULL, "identityId" uuid, CONSTRAINT "PK_IdentityMetadata_id" PRIMARY KEY ("id"))`);
25
+ yield queryRunner.query(`CREATE TABLE "Identity" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "alias" character varying(255) NOT NULL, "roles" text, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), "contactId" uuid, CONSTRAINT "UQ_Alias" UNIQUE ("alias"), CONSTRAINT "PK_Identity_id" PRIMARY KEY ("id"))`);
26
+ yield queryRunner.query(`CREATE TYPE "public"."Connection_type_enum" AS ENUM('OIDC', 'SIOPv2', 'SIOPv2+OpenID4VP')`);
27
+ yield queryRunner.query(`CREATE TABLE "Connection" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "type" "public"."Connection_type_enum" NOT NULL, "identityId" uuid, CONSTRAINT "REL_Connection_identityId" UNIQUE ("identityId"), CONSTRAINT "PK_Connection_id" PRIMARY KEY ("id"))`);
28
+ yield queryRunner.query(`ALTER TABLE "BaseConfigEntity" ADD CONSTRAINT "FK_BaseConfig_connectionId" FOREIGN KEY ("connectionId") REFERENCES "Connection"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
29
+ yield queryRunner.query(`ALTER TABLE "CorrelationIdentifier" ADD CONSTRAINT "FK_CorrelationIdentifier_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
30
+ yield queryRunner.query(`ALTER TABLE "IdentityMetadata" ADD CONSTRAINT "FK_IdentityMetadata_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
31
+ yield queryRunner.query(`ALTER TABLE "Identity" ADD CONSTRAINT "FK_Identity_contactId" FOREIGN KEY ("contactId") REFERENCES "Contact"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
32
+ yield queryRunner.query(`ALTER TABLE "Connection" ADD CONSTRAINT "FK_Connection_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
33
+ });
34
+ }
35
+ down(queryRunner) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ yield queryRunner.query(`ALTER TABLE "Connection" DROP CONSTRAINT "FK_Connection_identityId"`);
38
+ yield queryRunner.query(`ALTER TABLE "Identity" DROP CONSTRAINT "FK_Identity_contactId"`);
39
+ yield queryRunner.query(`ALTER TABLE "IdentityMetadata" DROP CONSTRAINT "FK_IdentityMetadata_identityId"`);
40
+ yield queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP CONSTRAINT "FK_CorrelationIdentifier_identityId"`);
41
+ yield queryRunner.query(`ALTER TABLE "BaseConfigEntity" DROP CONSTRAINT "FK_BaseConfig_connectionId"`);
42
+ yield queryRunner.query(`DROP TABLE "Connection"`);
43
+ yield queryRunner.query(`DROP TYPE "public"."Connection_type_enum"`);
44
+ yield queryRunner.query(`DROP TABLE "Identity"`);
45
+ yield queryRunner.query(`DROP TABLE "IdentityMetadata"`);
46
+ yield queryRunner.query(`DROP TABLE "Contact"`);
47
+ yield queryRunner.query(`DROP TABLE "CorrelationIdentifier"`);
48
+ yield queryRunner.query(`DROP TYPE "public"."CorrelationIdentifier_type_enum"`);
49
+ yield queryRunner.query(`DROP INDEX "public"."IDX_BaseConfigEntity_type"`);
50
+ yield queryRunner.query(`DROP TABLE "BaseConfigEntity"`);
51
+ });
52
+ }
53
+ }
54
+ exports.CreateContacts1659463079428 = CreateContacts1659463079428;
55
+ //# sourceMappingURL=1659463079428-CreateContacts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1659463079428-CreateContacts.js","sourceRoot":"","sources":["../../../src/migrations/postgres/1659463079428-CreateContacts.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,2BAA2B;IAAxC;QACE,SAAI,GAAG,6BAA6B,CAAA;IAyDtC,CAAC;IAvDc,EAAE,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CACrB,6iBAA6iB,CAC9iB,CAAA;YACD,MAAM,WAAW,CAAC,KAAK,CAAC,yEAAyE,CAAC,CAAA;YAClG,MAAM,WAAW,CAAC,KAAK,CAAC,8EAA8E,CAAC,CAAA;YACvG,MAAM,WAAW,CAAC,KAAK,CACrB,qYAAqY,CACtY,CAAA;YACD,MAAM,WAAW,CAAC,KAAK,CACrB,gaAAga,CACja,CAAA;YACD,MAAM,WAAW,CAAC,KAAK,CACrB,8OAA8O,CAC/O,CAAA;YACD,MAAM,WAAW,CAAC,KAAK,CACrB,6UAA6U,CAC9U,CAAA;YACD,MAAM,WAAW,CAAC,KAAK,CAAC,2FAA2F,CAAC,CAAA;YACpH,MAAM,WAAW,CAAC,KAAK,CACrB,+PAA+P,CAChQ,CAAA;YACD,MAAM,WAAW,CAAC,KAAK,CACrB,6KAA6K,CAC9K,CAAA;YACD,MAAM,WAAW,CAAC,KAAK,CACrB,uLAAuL,CACxL,CAAA;YACD,MAAM,WAAW,CAAC,KAAK,CACrB,6KAA6K,CAC9K,CAAA;YACD,MAAM,WAAW,CAAC,KAAK,CACrB,0JAA0J,CAC3J,CAAA;YACD,MAAM,WAAW,CAAC,KAAK,CACrB,iKAAiK,CAClK,CAAA;QACH,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACxC,MAAM,WAAW,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAA;YAC9F,MAAM,WAAW,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAA;YACzF,MAAM,WAAW,CAAC,KAAK,CAAC,iFAAiF,CAAC,CAAA;YAC1G,MAAM,WAAW,CAAC,KAAK,CAAC,2FAA2F,CAAC,CAAA;YACpH,MAAM,WAAW,CAAC,KAAK,CAAC,6EAA6E,CAAC,CAAA;YACtG,MAAM,WAAW,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;YAClD,MAAM,WAAW,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAA;YACpE,MAAM,WAAW,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;YAChD,MAAM,WAAW,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAA;YACxD,MAAM,WAAW,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;YAC/C,MAAM,WAAW,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAA;YAC7D,MAAM,WAAW,CAAC,KAAK,CAAC,sDAAsD,CAAC,CAAA;YAC/E,MAAM,WAAW,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAA;YAC1E,MAAM,WAAW,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAA;QAC1D,CAAC;KAAA;CACF;AA1DD,kEA0DC"}
@@ -0,0 +1,7 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+ export declare class CreateContacts1659463069549 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
7
+ //# sourceMappingURL=1659463069549-CreateContacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1659463069549-CreateContacts.d.ts","sourceRoot":"","sources":["../../../src/migrations/sqlite/1659463069549-CreateContacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEzD,qBAAa,2BAA4B,YAAW,kBAAkB;IACpE,IAAI,SAAgC;IAEvB,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA8D3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CA2C3D"}