@sphereon/ssi-sdk.data-store 0.18.2-unstable.51 → 0.18.2-unstable.59

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 (56) hide show
  1. package/dist/entities/xstatePersistence/XStateEntity.d.ts +12 -0
  2. package/dist/entities/xstatePersistence/XStateEntity.d.ts.map +1 -0
  3. package/dist/entities/xstatePersistence/XStateEntity.js +68 -0
  4. package/dist/entities/xstatePersistence/XStateEntity.js.map +1 -0
  5. package/dist/index.d.ts +7 -3
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +11 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/migrations/generic/6-CreateXStateStore.d.ts +7 -0
  10. package/dist/migrations/generic/6-CreateXStateStore.d.ts.map +1 -0
  11. package/dist/migrations/generic/6-CreateXStateStore.js +78 -0
  12. package/dist/migrations/generic/6-CreateXStateStore.js.map +1 -0
  13. package/dist/migrations/generic/index.d.ts +2 -0
  14. package/dist/migrations/generic/index.d.ts.map +1 -1
  15. package/dist/migrations/generic/index.js +4 -1
  16. package/dist/migrations/generic/index.js.map +1 -1
  17. package/dist/migrations/index.d.ts +1 -1
  18. package/dist/migrations/index.d.ts.map +1 -1
  19. package/dist/migrations/index.js +2 -1
  20. package/dist/migrations/index.js.map +1 -1
  21. package/dist/migrations/postgres/1708097018115-CreateXStateStore.d.ts +7 -0
  22. package/dist/migrations/postgres/1708097018115-CreateXStateStore.d.ts.map +1 -0
  23. package/dist/migrations/postgres/1708097018115-CreateXStateStore.js +32 -0
  24. package/dist/migrations/postgres/1708097018115-CreateXStateStore.js.map +1 -0
  25. package/dist/migrations/sqlite/1708096002272-CreateXStateStore.d.ts +7 -0
  26. package/dist/migrations/sqlite/1708096002272-CreateXStateStore.d.ts.map +1 -0
  27. package/dist/migrations/sqlite/1708096002272-CreateXStateStore.js +30 -0
  28. package/dist/migrations/sqlite/1708096002272-CreateXStateStore.js.map +1 -0
  29. package/dist/types/index.d.ts +1 -0
  30. package/dist/types/index.d.ts.map +1 -1
  31. package/dist/types/index.js +1 -0
  32. package/dist/types/index.js.map +1 -1
  33. package/dist/types/xstatePersistence/types.d.ts +15 -0
  34. package/dist/types/xstatePersistence/types.d.ts.map +1 -0
  35. package/dist/types/xstatePersistence/types.js +3 -0
  36. package/dist/types/xstatePersistence/types.js.map +1 -0
  37. package/dist/xstatePersistence/IAbstractXStateStore.d.ts +7 -0
  38. package/dist/xstatePersistence/IAbstractXStateStore.d.ts.map +1 -0
  39. package/dist/xstatePersistence/IAbstractXStateStore.js +7 -0
  40. package/dist/xstatePersistence/IAbstractXStateStore.js.map +1 -0
  41. package/dist/xstatePersistence/XStateStore.d.ts +12 -0
  42. package/dist/xstatePersistence/XStateStore.d.ts.map +1 -0
  43. package/dist/xstatePersistence/XStateStore.js +52 -0
  44. package/dist/xstatePersistence/XStateStore.js.map +1 -0
  45. package/package.json +4 -4
  46. package/src/entities/xstatePersistence/XStateEntity.ts +29 -0
  47. package/src/index.ts +9 -0
  48. package/src/migrations/generic/6-CreateXStateStore.ts +66 -0
  49. package/src/migrations/generic/index.ts +3 -0
  50. package/src/migrations/index.ts +1 -0
  51. package/src/migrations/postgres/1708097018115-CreateXStateStore.ts +18 -0
  52. package/src/migrations/sqlite/1708096002272-CreateXStateStore.ts +16 -0
  53. package/src/types/index.ts +1 -0
  54. package/src/types/xstatePersistence/types.ts +19 -0
  55. package/src/xstatePersistence/IAbstractXStateStore.ts +7 -0
  56. package/src/xstatePersistence/XStateStore.ts +40 -0
@@ -0,0 +1,12 @@
1
+ import { BaseEntity } from "typeorm";
2
+ export declare class XStateEntity extends BaseEntity {
3
+ id: string;
4
+ state: string;
5
+ type: string;
6
+ createdAt: Date;
7
+ updatedAt: Date;
8
+ completedAt: Date;
9
+ tenantId?: string;
10
+ ttl: number;
11
+ }
12
+ //# sourceMappingURL=XStateEntity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XStateEntity.d.ts","sourceRoot":"","sources":["../../../src/entities/xstatePersistence/XStateEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAgC,MAAM,SAAS,CAAC;AAElE,qBACa,YAAa,SAAQ,UAAU;IAGxC,EAAE,EAAE,MAAM,CAAA;IAGV,KAAK,EAAE,MAAM,CAAA;IAGb,IAAI,EAAE,MAAM,CAAA;IAGZ,SAAS,EAAE,IAAI,CAAA;IAGf,SAAS,EAAE,IAAI,CAAA;IAGf,WAAW,EAAE,IAAI,CAAA;IAGjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IAGjB,GAAG,EAAE,MAAM,CAAA;CACd"}
@@ -0,0 +1,68 @@
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.XStateEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ let XStateEntity = class XStateEntity extends typeorm_1.BaseEntity {
15
+ };
16
+ __decorate([
17
+ (0, typeorm_1.PrimaryColumn)({ name: 'id', type: 'varchar' })
18
+ // @ts-ignore
19
+ ,
20
+ __metadata("design:type", String)
21
+ ], XStateEntity.prototype, "id", void 0);
22
+ __decorate([
23
+ (0, typeorm_1.Column)()
24
+ // @ts-ignore
25
+ ,
26
+ __metadata("design:type", String)
27
+ ], XStateEntity.prototype, "state", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)()
30
+ // @ts-ignore
31
+ ,
32
+ __metadata("design:type", String)
33
+ ], XStateEntity.prototype, "type", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
36
+ // @ts-ignore
37
+ ,
38
+ __metadata("design:type", Date)
39
+ ], XStateEntity.prototype, "createdAt", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({ type: 'timestamp', onUpdate: 'CURRENT_TIMESTAMP', nullable: true })
42
+ // @ts-ignore
43
+ ,
44
+ __metadata("design:type", Date)
45
+ ], XStateEntity.prototype, "updatedAt", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ type: 'timestamp', nullable: true })
48
+ // @ts-ignore
49
+ ,
50
+ __metadata("design:type", Date)
51
+ ], XStateEntity.prototype, "completedAt", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)()
54
+ // @ts-ignore
55
+ ,
56
+ __metadata("design:type", String)
57
+ ], XStateEntity.prototype, "tenantId", void 0);
58
+ __decorate([
59
+ (0, typeorm_1.Column)({ default: 0 })
60
+ // @ts-ignore
61
+ ,
62
+ __metadata("design:type", Number)
63
+ ], XStateEntity.prototype, "ttl", void 0);
64
+ XStateEntity = __decorate([
65
+ (0, typeorm_1.Entity)('XstateEntity')
66
+ ], XStateEntity);
67
+ exports.XStateEntity = XStateEntity;
68
+ //# sourceMappingURL=XStateEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XStateEntity.js","sourceRoot":"","sources":["../../../src/entities/xstatePersistence/XStateEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAkE;AAG3D,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,oBAAU;CAyB3C,CAAA;AAxBG;IAAC,IAAA,uBAAa,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC/C,aAAa;;;wCACH;AACV;IAAC,IAAA,gBAAM,GAAE;IACT,aAAa;;;2CACA;AACb;IAAC,IAAA,gBAAM,GAAE;IACT,aAAa;;;0CACD;AACZ;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,EAAE,CAAC;IAClE,aAAa;;8BACF,IAAI;+CAAA;AACf;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC7E,aAAa;;8BACF,IAAI;+CAAA;AACf;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC9C,aAAa;;8BACA,IAAI;iDAAA;AACjB;IAAC,IAAA,gBAAM,GAAE;IACT,aAAa;;;8CACI;AACjB;IAAC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACvB,aAAa;;;yCACF;AAxBF,YAAY;IADxB,IAAA,gBAAM,EAAC,cAAc,CAAC;GACV,YAAY,CAyBxB;AAzBY,oCAAY"}
package/dist/index.d.ts CHANGED
@@ -18,6 +18,7 @@ import { IssuerBrandingEntity, issuerBrandingEntityFrom } from './entities/issua
18
18
  import { TextAttributesEntity, textAttributesEntityFrom } from './entities/issuanceBranding/TextAttributesEntity';
19
19
  import { StatusListEntity } from './entities/statusList2021/StatusList2021Entity';
20
20
  import { StatusListEntryEntity } from './entities/statusList2021/StatusList2021EntryEntity';
21
+ import { XStateEntity } from "./entities/xstatePersistence/XStateEntity";
21
22
  import { IStatusListEntity, IStatusListEntryEntity } from './types';
22
23
  import { PartyRelationshipEntity } from './entities/contact/PartyRelationshipEntity';
23
24
  import { PartyTypeEntity } from './entities/contact/PartyTypeEntity';
@@ -30,13 +31,16 @@ export { StatusListStore } from './statusList/StatusListStore';
30
31
  import { AuditEventEntity, auditEventEntityFrom } from './entities/eventLogger/AuditEventEntity';
31
32
  export { AbstractEventLoggerStore } from './eventLogger/AbstractEventLoggerStore';
32
33
  export { EventLoggerStore } from './eventLogger/EventLoggerStore';
33
- export { DataStoreMigrations, DataStoreEventLoggerMigrations, DataStoreContactMigrations, DataStoreIssuanceBrandingMigrations, DataStoreStatusListMigrations, } from './migrations';
34
+ export { IAbstractXStateStore } from './xstatePersistence/IAbstractXStateStore';
35
+ export { XStateStore } from './xstatePersistence/XStateStore';
36
+ export { DataStoreMigrations, DataStoreEventLoggerMigrations, DataStoreContactMigrations, DataStoreIssuanceBrandingMigrations, DataStoreStatusListMigrations, DataStoreXStatePersistenceMigration, } from './migrations';
34
37
  export * from './types';
35
38
  export * from './utils/contact/MappingUtils';
36
39
  export declare const DataStoreContactEntities: (typeof CorrelationIdentifierEntity | typeof IdentityMetadataItemEntity | typeof PartyTypeEntity | typeof PartyEntity | typeof BaseContactEntity | typeof PartyRelationshipEntity | typeof ConnectionEntity | typeof BaseConfigEntity)[];
37
40
  export declare const DataStoreIssuanceBrandingEntities: (typeof ImageDimensionsEntity | typeof ImageAttributesEntity | typeof TextAttributesEntity | typeof BaseLocaleBrandingEntity | typeof CredentialBrandingEntity | typeof IssuerBrandingEntity)[];
38
41
  export declare const DataStoreStatusListEntities: (typeof StatusListEntryEntity | typeof StatusListEntity)[];
39
42
  export declare const DataStoreEventLoggerEntities: (typeof AuditEventEntity)[];
40
- export declare const DataStoreEntities: (typeof StatusListEntryEntity | typeof StatusListEntity | typeof CorrelationIdentifierEntity | typeof IdentityMetadataItemEntity | typeof PartyTypeEntity | typeof PartyEntity | typeof BaseContactEntity | typeof PartyRelationshipEntity | typeof ConnectionEntity | typeof BaseConfigEntity | typeof ImageDimensionsEntity | typeof ImageAttributesEntity | typeof TextAttributesEntity | typeof BaseLocaleBrandingEntity | typeof CredentialBrandingEntity | typeof IssuerBrandingEntity | typeof AuditEventEntity)[];
41
- export { BaseConfigEntity, ConnectionEntity, PartyEntity, CorrelationIdentifierEntity, DidAuthConfigEntity, IdentityEntity, IdentityMetadataItemEntity, OpenIdConfigEntity, BackgroundAttributesEntity, CredentialBrandingEntity, ImageAttributesEntity, ImageDimensionsEntity, BaseLocaleBrandingEntity, IssuerBrandingEntity, TextAttributesEntity, CredentialLocaleBrandingEntity, IssuerLocaleBrandingEntity, ElectronicAddressEntity, backgroundAttributesEntityFrom, credentialBrandingEntityFrom, imageAttributesEntityFrom, imageDimensionsEntityFrom, issuerBrandingEntityFrom, textAttributesEntityFrom, issuerLocaleBrandingEntityFrom, credentialLocaleBrandingEntityFrom, IStatusListEntity, IStatusListEntryEntity, StatusListEntity, StatusListEntryEntity, AuditEventEntity, auditEventEntityFrom, };
43
+ export declare const DataStoreXStateStoreEntities: (typeof XStateEntity)[];
44
+ export declare const DataStoreEntities: (typeof StatusListEntryEntity | typeof StatusListEntity | typeof XStateEntity | typeof CorrelationIdentifierEntity | typeof IdentityMetadataItemEntity | typeof PartyTypeEntity | typeof PartyEntity | typeof BaseContactEntity | typeof PartyRelationshipEntity | typeof ConnectionEntity | typeof BaseConfigEntity | typeof ImageDimensionsEntity | typeof ImageAttributesEntity | typeof TextAttributesEntity | typeof BaseLocaleBrandingEntity | typeof CredentialBrandingEntity | typeof IssuerBrandingEntity | typeof AuditEventEntity)[];
45
+ export { BaseConfigEntity, ConnectionEntity, PartyEntity, CorrelationIdentifierEntity, DidAuthConfigEntity, IdentityEntity, IdentityMetadataItemEntity, OpenIdConfigEntity, BackgroundAttributesEntity, CredentialBrandingEntity, ImageAttributesEntity, ImageDimensionsEntity, BaseLocaleBrandingEntity, IssuerBrandingEntity, TextAttributesEntity, CredentialLocaleBrandingEntity, IssuerLocaleBrandingEntity, ElectronicAddressEntity, backgroundAttributesEntityFrom, credentialBrandingEntityFrom, imageAttributesEntityFrom, imageDimensionsEntityFrom, issuerBrandingEntityFrom, textAttributesEntityFrom, issuerLocaleBrandingEntityFrom, credentialLocaleBrandingEntityFrom, IStatusListEntity, IStatusListEntryEntity, StatusListEntity, StatusListEntryEntity, AuditEventEntity, auditEventEntityFrom, XStateEntity };
42
46
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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,wBAAwB,EAAE,MAAM,sDAAsD,CAAA;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAA;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAA;AAC1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAA;AAC1E,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,MAAM,wDAAwD,CAAA;AACnI,OAAO,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,sDAAsD,CAAA;AAC7H,OAAO,EAAE,8BAA8B,EAAE,kCAAkC,EAAE,MAAM,4DAA4D,CAAA;AAC/I,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAA;AACpH,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAA;AACpH,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,MAAM,wDAAwD,CAAA;AACnI,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAA;AACjH,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,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,OAAO,EACL,mBAAmB,EACnB,8BAA8B,EAC9B,0BAA0B,EAC1B,mCAAmC,EACnC,6BAA6B,EAC7B,mCAAmC,GACpC,MAAM,cAAc,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,8BAA8B,CAAA;AAE5C,eAAO,MAAM,wBAAwB,0OAepC,CAAA;AAED,eAAO,MAAM,iCAAiC,iMAU7C,CAAA;AAED,eAAO,MAAM,2BAA2B,4DAA4C,CAAA;AAEpF,eAAO,MAAM,4BAA4B,6BAAqB,CAAA;AAE9D,eAAO,MAAM,4BAA4B,yBAAiB,CAAA;AAG1D,eAAO,MAAM,iBAAiB,ihBAM7B,CAAA;AAED,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,2BAA2B,EAC3B,mBAAmB,EACnB,cAAc,EACd,0BAA0B,EAC1B,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,8BAA8B,EAC9B,0BAA0B,EAC1B,uBAAuB,EACvB,8BAA8B,EAC9B,4BAA4B,EAC5B,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,EACb,CAAA"}
package/dist/index.js CHANGED
@@ -14,7 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.auditEventEntityFrom = exports.AuditEventEntity = exports.StatusListEntryEntity = exports.StatusListEntity = exports.credentialLocaleBrandingEntityFrom = exports.issuerLocaleBrandingEntityFrom = exports.textAttributesEntityFrom = exports.issuerBrandingEntityFrom = exports.imageDimensionsEntityFrom = exports.imageAttributesEntityFrom = exports.credentialBrandingEntityFrom = exports.backgroundAttributesEntityFrom = exports.ElectronicAddressEntity = exports.IssuerLocaleBrandingEntity = exports.CredentialLocaleBrandingEntity = exports.TextAttributesEntity = exports.IssuerBrandingEntity = exports.BaseLocaleBrandingEntity = exports.ImageDimensionsEntity = exports.ImageAttributesEntity = exports.CredentialBrandingEntity = exports.BackgroundAttributesEntity = exports.OpenIdConfigEntity = exports.IdentityMetadataItemEntity = exports.IdentityEntity = exports.DidAuthConfigEntity = exports.CorrelationIdentifierEntity = exports.PartyEntity = exports.ConnectionEntity = exports.BaseConfigEntity = exports.DataStoreEntities = exports.DataStoreEventLoggerEntities = exports.DataStoreStatusListEntities = exports.DataStoreIssuanceBrandingEntities = exports.DataStoreContactEntities = exports.DataStoreStatusListMigrations = exports.DataStoreIssuanceBrandingMigrations = exports.DataStoreContactMigrations = exports.DataStoreEventLoggerMigrations = exports.DataStoreMigrations = exports.EventLoggerStore = exports.AbstractEventLoggerStore = exports.StatusListStore = exports.IssuanceBrandingStore = exports.AbstractIssuanceBrandingStore = exports.AbstractContactStore = exports.ContactStore = void 0;
17
+ exports.AuditEventEntity = exports.StatusListEntryEntity = exports.StatusListEntity = exports.credentialLocaleBrandingEntityFrom = exports.issuerLocaleBrandingEntityFrom = exports.textAttributesEntityFrom = exports.issuerBrandingEntityFrom = exports.imageDimensionsEntityFrom = exports.imageAttributesEntityFrom = exports.credentialBrandingEntityFrom = exports.backgroundAttributesEntityFrom = exports.ElectronicAddressEntity = exports.IssuerLocaleBrandingEntity = exports.CredentialLocaleBrandingEntity = exports.TextAttributesEntity = exports.IssuerBrandingEntity = exports.BaseLocaleBrandingEntity = exports.ImageDimensionsEntity = exports.ImageAttributesEntity = exports.CredentialBrandingEntity = exports.BackgroundAttributesEntity = exports.OpenIdConfigEntity = exports.IdentityMetadataItemEntity = exports.IdentityEntity = exports.DidAuthConfigEntity = exports.CorrelationIdentifierEntity = exports.PartyEntity = exports.ConnectionEntity = exports.BaseConfigEntity = exports.DataStoreEntities = exports.DataStoreXStateStoreEntities = exports.DataStoreEventLoggerEntities = exports.DataStoreStatusListEntities = exports.DataStoreIssuanceBrandingEntities = exports.DataStoreContactEntities = exports.DataStoreXStatePersistenceMigration = exports.DataStoreStatusListMigrations = exports.DataStoreIssuanceBrandingMigrations = exports.DataStoreContactMigrations = exports.DataStoreEventLoggerMigrations = exports.DataStoreMigrations = exports.XStateStore = exports.IAbstractXStateStore = exports.EventLoggerStore = exports.AbstractEventLoggerStore = exports.StatusListStore = exports.IssuanceBrandingStore = exports.AbstractIssuanceBrandingStore = exports.AbstractContactStore = exports.ContactStore = void 0;
18
+ exports.XStateEntity = exports.auditEventEntityFrom = void 0;
18
19
  const BaseConfigEntity_1 = require("./entities/contact/BaseConfigEntity");
19
20
  Object.defineProperty(exports, "BaseConfigEntity", { enumerable: true, get: function () { return BaseConfigEntity_1.BaseConfigEntity; } });
20
21
  const BaseLocaleBrandingEntity_1 = require("./entities/issuanceBranding/BaseLocaleBrandingEntity");
@@ -62,6 +63,8 @@ const StatusList2021Entity_1 = require("./entities/statusList2021/StatusList2021
62
63
  Object.defineProperty(exports, "StatusListEntity", { enumerable: true, get: function () { return StatusList2021Entity_1.StatusListEntity; } });
63
64
  const StatusList2021EntryEntity_1 = require("./entities/statusList2021/StatusList2021EntryEntity");
64
65
  Object.defineProperty(exports, "StatusListEntryEntity", { enumerable: true, get: function () { return StatusList2021EntryEntity_1.StatusListEntryEntity; } });
66
+ const XStateEntity_1 = require("./entities/xstatePersistence/XStateEntity");
67
+ Object.defineProperty(exports, "XStateEntity", { enumerable: true, get: function () { return XStateEntity_1.XStateEntity; } });
65
68
  const PartyRelationshipEntity_1 = require("./entities/contact/PartyRelationshipEntity");
66
69
  const PartyTypeEntity_1 = require("./entities/contact/PartyTypeEntity");
67
70
  const OrganizationEntity_1 = require("./entities/contact/OrganizationEntity");
@@ -85,12 +88,17 @@ var AbstractEventLoggerStore_1 = require("./eventLogger/AbstractEventLoggerStore
85
88
  Object.defineProperty(exports, "AbstractEventLoggerStore", { enumerable: true, get: function () { return AbstractEventLoggerStore_1.AbstractEventLoggerStore; } });
86
89
  var EventLoggerStore_1 = require("./eventLogger/EventLoggerStore");
87
90
  Object.defineProperty(exports, "EventLoggerStore", { enumerable: true, get: function () { return EventLoggerStore_1.EventLoggerStore; } });
91
+ var IAbstractXStateStore_1 = require("./xstatePersistence/IAbstractXStateStore");
92
+ Object.defineProperty(exports, "IAbstractXStateStore", { enumerable: true, get: function () { return IAbstractXStateStore_1.IAbstractXStateStore; } });
93
+ var XStateStore_1 = require("./xstatePersistence/XStateStore");
94
+ Object.defineProperty(exports, "XStateStore", { enumerable: true, get: function () { return XStateStore_1.XStateStore; } });
88
95
  var migrations_1 = require("./migrations");
89
96
  Object.defineProperty(exports, "DataStoreMigrations", { enumerable: true, get: function () { return migrations_1.DataStoreMigrations; } });
90
97
  Object.defineProperty(exports, "DataStoreEventLoggerMigrations", { enumerable: true, get: function () { return migrations_1.DataStoreEventLoggerMigrations; } });
91
98
  Object.defineProperty(exports, "DataStoreContactMigrations", { enumerable: true, get: function () { return migrations_1.DataStoreContactMigrations; } });
92
99
  Object.defineProperty(exports, "DataStoreIssuanceBrandingMigrations", { enumerable: true, get: function () { return migrations_1.DataStoreIssuanceBrandingMigrations; } });
93
100
  Object.defineProperty(exports, "DataStoreStatusListMigrations", { enumerable: true, get: function () { return migrations_1.DataStoreStatusListMigrations; } });
101
+ Object.defineProperty(exports, "DataStoreXStatePersistenceMigration", { enumerable: true, get: function () { return migrations_1.DataStoreXStatePersistenceMigration; } });
94
102
  __exportStar(require("./types"), exports);
95
103
  __exportStar(require("./utils/contact/MappingUtils"), exports);
96
104
  exports.DataStoreContactEntities = [
@@ -122,11 +130,13 @@ exports.DataStoreIssuanceBrandingEntities = [
122
130
  ];
123
131
  exports.DataStoreStatusListEntities = [StatusList2021Entity_1.StatusListEntity, StatusList2021EntryEntity_1.StatusListEntryEntity];
124
132
  exports.DataStoreEventLoggerEntities = [AuditEventEntity_1.AuditEventEntity];
133
+ exports.DataStoreXStateStoreEntities = [XStateEntity_1.XStateEntity];
125
134
  // All entities combined if a party wants to enable them all at once
126
135
  exports.DataStoreEntities = [
127
136
  ...exports.DataStoreContactEntities,
128
137
  ...exports.DataStoreIssuanceBrandingEntities,
129
138
  ...exports.DataStoreStatusListEntities,
130
139
  ...exports.DataStoreEventLoggerEntities,
140
+ ...exports.DataStoreXStateStoreEntities
131
141
  ];
132
142
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0EAAsE;AAsFpE,iGAtFO,mCAAgB,OAsFP;AArFlB,mGAA+F;AAiG7F,yGAjGO,mDAAwB,OAiGP;AAhG1B,4EAAwE;AACxE,0EAAsE;AAoFpE,iGApFO,mCAAgB,OAoFP;AAnFlB,gEAA4D;AAoF1D,4FApFO,yBAAW,OAoFP;AAnFb,gGAA4F;AAoF1F,4GApFO,yDAA2B,OAoFP;AAnF7B,gFAA4E;AAoF1E,oGApFO,yCAAmB,OAoFP;AAnFrB,sEAAkE;AAoFhE,+FApFO,+BAAc,OAoFP;AAnFhB,8FAA0F;AAoFxF,2GApFO,uDAA0B,OAoFP;AAnF5B,8EAA0E;AAoFxE,mGApFO,uCAAkB,OAoFP;AAnFpB,uGAAmI;AAoFjI,2GApFO,uDAA0B,OAoFP;AAU1B,+GA9FmC,2DAA8B,OA8FnC;AA7FhC,mGAA6H;AAoF3H,yGApFO,mDAAwB,OAoFP;AAUxB,6GA9FiC,uDAA4B,OA8FjC;AA7F9B,+GAA+I;AAyF7I,+GAzFO,+DAA8B,OAyFP;AAU9B,mHAnGuC,mEAAkC,OAmGvC;AAlGpC,6FAAoH;AAmFlH,sGAnFO,6CAAqB,OAmFP;AAUrB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,0GAAA,WAAW,OAAA;AAEpB,2CAOqB;AANnB,iHAAA,mBAAmB,OAAA;AACnB,4HAAA,8BAA8B,OAAA;AAC9B,wHAAA,0BAA0B,OAAA;AAC1B,iIAAA,mCAAmC,OAAA;AACnC,2HAAA,6BAA6B,OAAA;AAC7B,iIAAA,mCAAmC,OAAA;AAErC,0CAAuB;AACvB,+DAA4C;AAE/B,QAAA,wBAAwB,GAAG;IACtC,mCAAgB;IAChB,mCAAgB;IAChB,yBAAW;IACX,+BAAc;IACd,uDAA0B;IAC1B,yDAA2B;IAC3B,yCAAmB;IACnB,uCAAkB;IAClB,iDAAuB;IACvB,iCAAe;IACf,qCAAiB;IACjB,uCAAkB;IAClB,yCAAmB;IACnB,iDAAuB;CACxB,CAAA;AAEY,QAAA,iCAAiC,GAAG;IAC/C,uDAA0B;IAC1B,mDAAwB;IACxB,6CAAqB;IACrB,6CAAqB;IACrB,mDAAwB;IACxB,2CAAoB;IACpB,2CAAoB;IACpB,+DAA8B;IAC9B,uDAA0B;CAC3B,CAAA;AAEY,QAAA,2BAA2B,GAAG,CAAC,uCAAgB,EAAE,iDAAqB,CAAC,CAAA;AAEvE,QAAA,4BAA4B,GAAG,CAAC,mCAAgB,CAAC,CAAA;AAEjD,QAAA,4BAA4B,GAAG,CAAC,2BAAY,CAAC,CAAA;AAE1D,oEAAoE;AACvD,QAAA,iBAAiB,GAAG;IAC/B,GAAG,gCAAwB;IAC3B,GAAG,yCAAiC;IACpC,GAAG,mCAA2B;IAC9B,GAAG,oCAA4B;IAC/B,GAAG,oCAA4B;CAChC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+ export declare class CreateXStateStore1708098041262 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
7
+ //# sourceMappingURL=6-CreateXStateStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"6-CreateXStateStore.d.ts","sourceRoot":"","sources":["../../../src/migrations/generic/6-CreateXStateStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAOvE,qBAAa,8BAA+B,YAAW,kBAAkB;IACrE,IAAI,SAAmC;IAE1B,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA4B3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CA2B7D"}
@@ -0,0 +1,78 @@
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.CreateXStateStore1708098041262 = void 0;
16
+ const debug_1 = __importDefault(require("debug"));
17
+ const _1708097018115_CreateXStateStore_1 = require("../postgres/1708097018115-CreateXStateStore");
18
+ const _1708096002272_CreateXStateStore_1 = require("../sqlite/1708096002272-CreateXStateStore");
19
+ const debug = (0, debug_1.default)('sphereon:ssi-sdk:migrations');
20
+ class CreateXStateStore1708098041262 {
21
+ constructor() {
22
+ this.name = 'CreateXStateStore1708098041262';
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
+ switch (dbType) {
29
+ case 'postgres': {
30
+ debug('using postgres migration file');
31
+ const mig = new _1708097018115_CreateXStateStore_1.CreateXStateStore1708097018115();
32
+ yield mig.up(queryRunner);
33
+ debug('Migration statements executed');
34
+ return;
35
+ }
36
+ case 'sqlite':
37
+ case 'expo':
38
+ case 'react-native': {
39
+ debug('using sqlite/react-native migration file');
40
+ const mig = new _1708096002272_CreateXStateStore_1.CreateXStateStore1708096002272();
41
+ yield mig.up(queryRunner);
42
+ debug('Migration statements executed');
43
+ return;
44
+ }
45
+ default:
46
+ return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
47
+ }
48
+ });
49
+ }
50
+ down(queryRunner) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ debug('migration: reverting contacts tables');
53
+ const dbType = queryRunner.connection.driver.options.type;
54
+ switch (dbType) {
55
+ case 'postgres': {
56
+ debug('using postgres migration file');
57
+ const mig = new _1708097018115_CreateXStateStore_1.CreateXStateStore1708097018115();
58
+ yield mig.down(queryRunner);
59
+ debug('Migration statements executed');
60
+ return;
61
+ }
62
+ case 'sqlite':
63
+ case 'expo':
64
+ case 'react-native': {
65
+ debug('using sqlite/react-native migration file');
66
+ const mig = new _1708096002272_CreateXStateStore_1.CreateXStateStore1708096002272();
67
+ yield mig.down(queryRunner);
68
+ debug('Migration statements executed');
69
+ return;
70
+ }
71
+ default:
72
+ return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
73
+ }
74
+ });
75
+ }
76
+ }
77
+ exports.CreateXStateStore1708098041262 = CreateXStateStore1708098041262;
78
+ //# sourceMappingURL=6-CreateXStateStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"6-CreateXStateStore.js","sourceRoot":"","sources":["../../../src/migrations/generic/6-CreateXStateStore.ts"],"names":[],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AAC,+BAA+B,CAAC,CAAA;oBACtC,MAAM,GAAG,GAAmC,IAAI,iEAA8B,EAAE,CAAA;oBAChF,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;oBAC3B,KAAK,CAAC,+BAA+B,CAAC,CAAA;oBACtC,OAAM;iBACT;gBACD,KAAK,QAAQ,CAAC;gBACd,KAAK,MAAM,CAAC;gBACZ,KAAK,cAAc,CAAC,CAAC;oBACjB,KAAK,CAAC,0CAA0C,CAAC,CAAA;oBACjD,MAAM,GAAG,GAAmC,IAAI,iEAA8B,EAAE,CAAA;oBAChF,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;oBAC3B,KAAK,CAAC,+BAA+B,CAAC,CAAA;oBACtC,OAAM;iBACT;gBACD;oBACI,OAAO,OAAO,CAAC,MAAM,CACjB,4FAA4F,MAAM,+GAA+G,CACpN,CAAA;aACR;QACL,CAAC;KAAA;CACJ;AA1DD,wEA0DC"}
@@ -2,6 +2,7 @@ import { CreateContacts1659463079429 } from './1-CreateContacts';
2
2
  import { CreateIssuanceBranding1659463079429 } from './2-CreateIssuanceBranding';
3
3
  import { CreateStatusList1693866470000 } from './4-CreateStatusList';
4
4
  import { CreateAuditEvents1701635835330 } from './5-CreateAuditEvents';
5
+ import { CreateXStateStore1708098041262 } from "./6-CreateXStateStore";
5
6
  /**
6
7
  * The migrations array that SHOULD be used when initializing a TypeORM database connection.
7
8
  *
@@ -13,5 +14,6 @@ export declare const DataStoreContactMigrations: (typeof CreateContacts165946307
13
14
  export declare const DataStoreIssuanceBrandingMigrations: (typeof CreateIssuanceBranding1659463079429)[];
14
15
  export declare const DataStoreStatusListMigrations: (typeof CreateStatusList1693866470000)[];
15
16
  export declare const DataStoreEventLoggerMigrations: (typeof CreateAuditEvents1701635835330)[];
17
+ export declare const DataStoreXStatePersistenceMigration: (typeof CreateXStateStore1708098041262)[];
16
18
  export declare const DataStoreMigrations: (typeof CreateContacts1659463079429)[];
17
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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;AAChE,OAAO,EAAE,mCAAmC,EAAE,MAAM,4BAA4B,CAAA;AAEhF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAA;AAEtE;;;;;;GAMG;AAGH,eAAO,MAAM,0BAA0B,wCAA6D,CAAA;AACpG,eAAO,MAAM,mCAAmC,gDAAwC,CAAA;AACxF,eAAO,MAAM,6BAA6B,0CAAkC,CAAA;AAC5E,eAAO,MAAM,8BAA8B,2CAAmC,CAAA;AAG9E,eAAO,MAAM,mBAAmB,wCAK/B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/generic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE,mCAAmC,EAAE,MAAM,4BAA4B,CAAA;AAEhF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAC,8BAA8B,EAAC,MAAM,uBAAuB,CAAC;AAErE;;;;;;GAMG;AAGH,eAAO,MAAM,0BAA0B,wCAA6D,CAAA;AACpG,eAAO,MAAM,mCAAmC,gDAAwC,CAAA;AACxF,eAAO,MAAM,6BAA6B,0CAAkC,CAAA;AAC5E,eAAO,MAAM,8BAA8B,2CAAmC,CAAA;AAC9E,eAAO,MAAM,mCAAmC,2CAAmC,CAAA;AAGnF,eAAO,MAAM,mBAAmB,wCAM/B,CAAA"}
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DataStoreMigrations = exports.DataStoreEventLoggerMigrations = exports.DataStoreStatusListMigrations = exports.DataStoreIssuanceBrandingMigrations = exports.DataStoreContactMigrations = void 0;
3
+ exports.DataStoreMigrations = exports.DataStoreXStatePersistenceMigration = exports.DataStoreEventLoggerMigrations = exports.DataStoreStatusListMigrations = exports.DataStoreIssuanceBrandingMigrations = exports.DataStoreContactMigrations = void 0;
4
4
  const _1_CreateContacts_1 = require("./1-CreateContacts");
5
5
  const _2_CreateIssuanceBranding_1 = require("./2-CreateIssuanceBranding");
6
6
  const _3_CreateContacts_1 = require("./3-CreateContacts");
7
7
  const _4_CreateStatusList_1 = require("./4-CreateStatusList");
8
8
  const _5_CreateAuditEvents_1 = require("./5-CreateAuditEvents");
9
+ const _6_CreateXStateStore_1 = require("./6-CreateXStateStore");
9
10
  /**
10
11
  * The migrations array that SHOULD be used when initializing a TypeORM database connection.
11
12
  *
@@ -18,11 +19,13 @@ exports.DataStoreContactMigrations = [_1_CreateContacts_1.CreateContacts16594630
18
19
  exports.DataStoreIssuanceBrandingMigrations = [_2_CreateIssuanceBranding_1.CreateIssuanceBranding1659463079429];
19
20
  exports.DataStoreStatusListMigrations = [_4_CreateStatusList_1.CreateStatusList1693866470000];
20
21
  exports.DataStoreEventLoggerMigrations = [_5_CreateAuditEvents_1.CreateAuditEvents1701635835330];
22
+ exports.DataStoreXStatePersistenceMigration = [_6_CreateXStateStore_1.CreateXStateStore1708098041262];
21
23
  // All migrations together
22
24
  exports.DataStoreMigrations = [
23
25
  ...exports.DataStoreContactMigrations,
24
26
  ...exports.DataStoreIssuanceBrandingMigrations,
25
27
  ...exports.DataStoreStatusListMigrations,
26
28
  ...exports.DataStoreEventLoggerMigrations,
29
+ ...exports.DataStoreXStatePersistenceMigration
27
30
  ];
28
31
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/migrations/generic/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgE;AAChE,0EAAgF;AAChF,0DAAgE;AAChE,8DAAoE;AACpE,gEAAsE;AAEtE;;;;;;GAMG;AAEH,yJAAyJ;AAC5I,QAAA,0BAA0B,GAAG,CAAC,+CAA2B,EAAE,+CAA2B,CAAC,CAAA;AACvF,QAAA,mCAAmC,GAAG,CAAC,+DAAmC,CAAC,CAAA;AAC3E,QAAA,6BAA6B,GAAG,CAAC,mDAA6B,CAAC,CAAA;AAC/D,QAAA,8BAA8B,GAAG,CAAC,qDAA8B,CAAC,CAAA;AAE9E,0BAA0B;AACb,QAAA,mBAAmB,GAAG;IACjC,GAAG,kCAA0B;IAC7B,GAAG,2CAAmC;IACtC,GAAG,qCAA6B;IAChC,GAAG,sCAA8B;CAClC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/migrations/generic/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgE;AAChE,0EAAgF;AAChF,0DAAgE;AAChE,8DAAoE;AACpE,gEAAsE;AACtE,gEAAqE;AAErE;;;;;;GAMG;AAEH,yJAAyJ;AAC5I,QAAA,0BAA0B,GAAG,CAAC,+CAA2B,EAAE,+CAA2B,CAAC,CAAA;AACvF,QAAA,mCAAmC,GAAG,CAAC,+DAAmC,CAAC,CAAA;AAC3E,QAAA,6BAA6B,GAAG,CAAC,mDAA6B,CAAC,CAAA;AAC/D,QAAA,8BAA8B,GAAG,CAAC,qDAA8B,CAAC,CAAA;AACjE,QAAA,mCAAmC,GAAG,CAAC,qDAA8B,CAAC,CAAA;AAEnF,0BAA0B;AACb,QAAA,mBAAmB,GAAG;IACjC,GAAG,kCAA0B;IAC7B,GAAG,2CAAmC;IACtC,GAAG,qCAA6B;IAChC,GAAG,sCAA8B;IACjC,GAAG,2CAAmC;CACvC,CAAA"}
@@ -1,2 +1,2 @@
1
- export { DataStoreMigrations, DataStoreEventLoggerMigrations, DataStoreContactMigrations, DataStoreIssuanceBrandingMigrations, DataStoreStatusListMigrations, } from './generic';
1
+ export { DataStoreMigrations, DataStoreEventLoggerMigrations, DataStoreContactMigrations, DataStoreIssuanceBrandingMigrations, DataStoreStatusListMigrations, DataStoreXStatePersistenceMigration } from './generic';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,8BAA8B,EAC9B,0BAA0B,EAC1B,mCAAmC,EACnC,6BAA6B,GAC9B,MAAM,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,8BAA8B,EAC9B,0BAA0B,EAC1B,mCAAmC,EACnC,6BAA6B,EAC7B,mCAAmC,EACpC,MAAM,WAAW,CAAA"}
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DataStoreStatusListMigrations = exports.DataStoreIssuanceBrandingMigrations = exports.DataStoreContactMigrations = exports.DataStoreEventLoggerMigrations = exports.DataStoreMigrations = void 0;
3
+ exports.DataStoreXStatePersistenceMigration = exports.DataStoreStatusListMigrations = exports.DataStoreIssuanceBrandingMigrations = exports.DataStoreContactMigrations = exports.DataStoreEventLoggerMigrations = exports.DataStoreMigrations = void 0;
4
4
  var generic_1 = require("./generic");
5
5
  Object.defineProperty(exports, "DataStoreMigrations", { enumerable: true, get: function () { return generic_1.DataStoreMigrations; } });
6
6
  Object.defineProperty(exports, "DataStoreEventLoggerMigrations", { enumerable: true, get: function () { return generic_1.DataStoreEventLoggerMigrations; } });
7
7
  Object.defineProperty(exports, "DataStoreContactMigrations", { enumerable: true, get: function () { return generic_1.DataStoreContactMigrations; } });
8
8
  Object.defineProperty(exports, "DataStoreIssuanceBrandingMigrations", { enumerable: true, get: function () { return generic_1.DataStoreIssuanceBrandingMigrations; } });
9
9
  Object.defineProperty(exports, "DataStoreStatusListMigrations", { enumerable: true, get: function () { return generic_1.DataStoreStatusListMigrations; } });
10
+ Object.defineProperty(exports, "DataStoreXStatePersistenceMigration", { enumerable: true, get: function () { return generic_1.DataStoreXStatePersistenceMigration; } });
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":";;;AAAA,qCAMkB;AALhB,8GAAA,mBAAmB,OAAA;AACnB,yHAAA,8BAA8B,OAAA;AAC9B,qHAAA,0BAA0B,OAAA;AAC1B,8HAAA,mCAAmC,OAAA;AACnC,wHAAA,6BAA6B,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":";;;AAAA,qCAOkB;AANhB,8GAAA,mBAAmB,OAAA;AACnB,yHAAA,8BAA8B,OAAA;AAC9B,qHAAA,0BAA0B,OAAA;AAC1B,8HAAA,mCAAmC,OAAA;AACnC,wHAAA,6BAA6B,OAAA;AAC7B,8HAAA,mCAAmC,OAAA"}
@@ -0,0 +1,7 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class CreateXStateStore1708097018115 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<any>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
7
+ //# sourceMappingURL=1708097018115-CreateXStateStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1708097018115-CreateXStateStore.d.ts","sourceRoot":"","sources":["../../../src/migrations/postgres/1708097018115-CreateXStateStore.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAE,WAAW,EAAC,MAAM,SAAS,CAAC;AAExD,qBAAa,8BAA+B,YAAW,kBAAkB;IACrE,IAAI,SAAmC;IAE1B,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC;IAO1C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAI7D"}
@@ -0,0 +1,32 @@
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.CreateXStateStore1708097018115 = void 0;
13
+ const ssi_sdk_core_1 = require("@sphereon/ssi-sdk.core");
14
+ class CreateXStateStore1708097018115 {
15
+ constructor() {
16
+ this.name = 'CreateXStateStore1708097018115';
17
+ }
18
+ up(queryRunner) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ yield (0, ssi_sdk_core_1.enablePostgresUuidExtension)(queryRunner);
21
+ yield queryRunner.query(`CREATE TABLE "XStateStore" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "state" varchar(255) NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, CONSTRAINT PK_XStateStore_id PRIMARY KEY ("id")`);
22
+ });
23
+ }
24
+ down(queryRunner) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ yield queryRunner.query(`ALTER TABLE "XStateStore" DROP CONSTRAINT "PK_XStateStore_id"`);
27
+ yield queryRunner.query(`DROP TABLE "XStateEntity"`);
28
+ });
29
+ }
30
+ }
31
+ exports.CreateXStateStore1708097018115 = CreateXStateStore1708097018115;
32
+ //# sourceMappingURL=1708097018115-CreateXStateStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1708097018115-CreateXStateStore.js","sourceRoot":"","sources":["../../../src/migrations/postgres/1708097018115-CreateXStateStore.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAmE;AAGnE,MAAa,8BAA8B;IAA3C;QACI,SAAI,GAAG,gCAAgC,CAAA;IAa3C,CAAC;IAXgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,IAAA,0CAA2B,EAAC,WAAW,CAAC,CAAA;YAC9C,MAAM,WAAW,CAAC,KAAK,CACnB,8QAA8Q,CACjR,CAAA;QACL,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAA;YACxF,MAAM,WAAW,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAA;QACxD,CAAC;KAAA;CACJ;AAdD,wEAcC"}
@@ -0,0 +1,7 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class CreateXStateStore1708096002272 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<any>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
7
+ //# sourceMappingURL=1708096002272-CreateXStateStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1708096002272-CreateXStateStore.d.ts","sourceRoot":"","sources":["../../../src/migrations/sqlite/1708096002272-CreateXStateStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAE,WAAW,EAAC,MAAM,SAAS,CAAC;AAExD,qBAAa,8BAA+B,YAAW,kBAAkB;IACrE,IAAI,SAAmC;IAE1B,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC;IAM1C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAI7D"}
@@ -0,0 +1,30 @@
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.CreateXStateStore1708096002272 = void 0;
13
+ class CreateXStateStore1708096002272 {
14
+ constructor() {
15
+ this.name = 'CreateXStateStore1708096002272';
16
+ }
17
+ up(queryRunner) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield queryRunner.query(`CREATE TABLE "XStateEntity" ("id" varchar PRIMARY KEY NOT NULL, "state" varchar(255) NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT (datetime('now')), "updatedAt" TIMESTAMP NOT NULL DEFAULT (datetime('now')), "deletedAt" TIMESTAMP, CONSTRAINT "PK_XStateEntity_id")`);
20
+ });
21
+ }
22
+ down(queryRunner) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ yield queryRunner.query(`ALTER TABLE "XStateEntity" DROP CONSTRAINT "PK_XStateEntity_id"`);
25
+ yield queryRunner.query(`DROP TABLE "XStateEntity"`);
26
+ });
27
+ }
28
+ }
29
+ exports.CreateXStateStore1708096002272 = CreateXStateStore1708096002272;
30
+ //# sourceMappingURL=1708096002272-CreateXStateStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1708096002272-CreateXStateStore.js","sourceRoot":"","sources":["../../../src/migrations/sqlite/1708096002272-CreateXStateStore.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,8BAA8B;IAA3C;QACI,SAAI,GAAG,gCAAgC,CAAA;IAY3C,CAAC;IAVgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CACnB,4QAA4Q,CAC/Q,CAAA;QACL,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,iEAAiE,CAAC,CAAA;YAC1F,MAAM,WAAW,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAA;QACxD,CAAC;KAAA;CACJ;AAbD,wEAaC"}
@@ -7,4 +7,5 @@ export * from './statusList/statusList';
7
7
  export * from './statusList/IAbstractStatusListStore';
8
8
  export * from './eventLogger/IAbstractEventLoggerStore';
9
9
  export * from './eventLogger/eventLogger';
10
+ export * from './xstatePersistence/types';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAA;AACnD,cAAc,mDAAmD,CAAA;AACjE,cAAc,mBAAmB,CAAA;AACjC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,uCAAuC,CAAA;AACrD,cAAc,yCAAyC,CAAA;AACvD,cAAc,2BAA2B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAA;AACnD,cAAc,mDAAmD,CAAA;AACjE,cAAc,mBAAmB,CAAA;AACjC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,uCAAuC,CAAA;AACrD,cAAc,yCAAyC,CAAA;AACvD,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA"}
@@ -23,4 +23,5 @@ __exportStar(require("./statusList/statusList"), exports);
23
23
  __exportStar(require("./statusList/IAbstractStatusListStore"), exports);
24
24
  __exportStar(require("./eventLogger/IAbstractEventLoggerStore"), exports);
25
25
  __exportStar(require("./eventLogger/eventLogger"), exports);
26
+ __exportStar(require("./xstatePersistence/types"), exports);
26
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAAmD;AACnD,oFAAiE;AACjE,oDAAiC;AACjC,kEAA+C;AAC/C,0DAAuC;AACvC,0DAAuC;AACvC,wEAAqD;AACrD,0EAAuD;AACvD,4DAAyC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAAmD;AACnD,oFAAiE;AACjE,oDAAiC;AACjC,kEAA+C;AAC/C,0DAAuC;AACvC,0DAAuC;AACvC,wEAAqD;AACrD,0EAAuD;AACvD,4DAAyC;AACzC,4DAAyC"}
@@ -0,0 +1,15 @@
1
+ import { XStateEntity } from "../../entities/xstatePersistence/XStateEntity";
2
+ export type PersistStateArgs = {
3
+ state: string;
4
+ type: string;
5
+ createdAt: Date;
6
+ updatedAt: Date;
7
+ completedAt: Date;
8
+ tenantId?: string;
9
+ ttl: number;
10
+ };
11
+ export type LoadStateArgs = Pick<PersistStateArgs, 'type'>;
12
+ export type DeleteStateArgs = Pick<PersistStateArgs, 'type'>;
13
+ export type VoidResult = void;
14
+ export type LoadStateResult = XStateEntity | null;
15
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types/xstatePersistence/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,+CAA+C,CAAC;AAE3E,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,IAAI,CAAA;IACf,SAAS,EAAE,IAAI,CAAA;IACf,WAAW,EAAE,IAAI,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;AAE1D,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;AAE5D,MAAM,MAAM,UAAU,GAAG,IAAI,CAAA;AAE7B,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,IAAI,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/types/xstatePersistence/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { LoadStateArgs, LoadStateResult, PersistStateArgs, VoidResult } from "../types";
2
+ export declare abstract class IAbstractXStateStore {
3
+ abstract persistState(state: PersistStateArgs): Promise<VoidResult>;
4
+ abstract loadState(args: LoadStateArgs): Promise<LoadStateResult>;
5
+ abstract deleteState(args: LoadStateArgs): Promise<VoidResult>;
6
+ }
7
+ //# sourceMappingURL=IAbstractXStateStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAbstractXStateStore.d.ts","sourceRoot":"","sources":["../../src/xstatePersistence/IAbstractXStateStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAEtF,8BAAsB,oBAAoB;IACtC,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC;IACnE,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC;IACjE,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC;CACjE"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IAbstractXStateStore = void 0;
4
+ class IAbstractXStateStore {
5
+ }
6
+ exports.IAbstractXStateStore = IAbstractXStateStore;
7
+ //# sourceMappingURL=IAbstractXStateStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAbstractXStateStore.js","sourceRoot":"","sources":["../../src/xstatePersistence/IAbstractXStateStore.ts"],"names":[],"mappings":";;;AAEA,MAAsB,oBAAoB;CAIzC;AAJD,oDAIC"}
@@ -0,0 +1,12 @@
1
+ import { OrPromise } from "@sphereon/ssi-types";
2
+ import { DataSource } from "typeorm";
3
+ import { DeleteStateArgs, LoadStateArgs, LoadStateResult, PersistStateArgs, VoidResult } from "../types";
4
+ import { IAbstractXStateStore } from "./IAbstractXStateStore";
5
+ export declare class XStateStore extends IAbstractXStateStore {
6
+ private readonly dbConnection;
7
+ constructor(dbConnection: OrPromise<DataSource>);
8
+ persistState(state: PersistStateArgs): Promise<VoidResult>;
9
+ loadState(args: LoadStateArgs): Promise<LoadStateResult>;
10
+ deleteState(args: DeleteStateArgs): Promise<VoidResult>;
11
+ }
12
+ //# sourceMappingURL=XStateStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XStateStore.d.ts","sourceRoot":"","sources":["../../src/xstatePersistence/XStateStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAGnC,OAAO,EAAC,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACxG,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAI5D,qBAAa,WAAY,SAAQ,oBAAoB;IACjD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAuB;gBAExC,YAAY,EAAE,SAAS,CAAC,UAAU,CAAC;IAKzC,YAAY,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC;IAM1D,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC;IASxD,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC;CAMhE"}
@@ -0,0 +1,52 @@
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.XStateStore = void 0;
16
+ const debug_1 = __importDefault(require("debug"));
17
+ const XStateEntity_1 = require("../entities/xstatePersistence/XStateEntity");
18
+ const IAbstractXStateStore_1 = require("./IAbstractXStateStore");
19
+ const debug = (0, debug_1.default)('sphereon:ssi-sdk:xstatePersistence');
20
+ class XStateStore extends IAbstractXStateStore_1.IAbstractXStateStore {
21
+ constructor(dbConnection) {
22
+ super();
23
+ this.dbConnection = dbConnection;
24
+ }
25
+ persistState(state) {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ const connection = yield this.dbConnection;
28
+ debug.log(`Executing persistState with state: ${JSON.stringify(state)}`);
29
+ yield connection.getRepository(XStateEntity_1.XStateEntity).save(state);
30
+ });
31
+ }
32
+ loadState(args) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ const connection = yield this.dbConnection;
35
+ debug.log(`Executing loadState query with type: ${args.type}`);
36
+ return yield connection.getRepository(XStateEntity_1.XStateEntity)
37
+ .findOne({
38
+ where: { type: args.type }
39
+ });
40
+ });
41
+ }
42
+ deleteState(args) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ const connection = yield this.dbConnection;
45
+ debug.log(`Executing loadState query with type: ${args.type}`);
46
+ yield connection.getRepository(XStateEntity_1.XStateEntity)
47
+ .delete({ type: args.type });
48
+ });
49
+ }
50
+ }
51
+ exports.XStateStore = XStateStore;
52
+ //# sourceMappingURL=XStateStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XStateStore.js","sourceRoot":"","sources":["../../src/xstatePersistence/XStateStore.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,kDAAyB;AAGzB,6EAAwE;AAExE,iEAA4D;AAE5D,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,oCAAoC,CAAC,CAAA;AAEzD,MAAa,WAAY,SAAQ,2CAAoB;IAGjD,YAAY,YAAmC;QAC3C,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IACpC,CAAC;IAEK,YAAY,CAAC,KAAuB;;YACtC,MAAM,UAAU,GAAe,MAAM,IAAI,CAAC,YAAY,CAAA;YACtD,KAAK,CAAC,GAAG,CAAC,sCAAsC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;YACxE,MAAM,UAAU,CAAC,aAAa,CAAC,2BAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC5D,CAAC;KAAA;IAEK,SAAS,CAAC,IAAmB;;YAC/B,MAAM,UAAU,GAAe,MAAM,IAAI,CAAC,YAAY,CAAA;YACtD,KAAK,CAAC,GAAG,CAAC,wCAAwC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;YAC9D,OAAO,MAAM,UAAU,CAAC,aAAa,CAAC,2BAAY,CAAC;iBAC9C,OAAO,CAAC;gBACL,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;aAC7B,CAAC,CAAA;QACV,CAAC;KAAA;IAEK,WAAW,CAAC,IAAqB;;YACnC,MAAM,UAAU,GAAe,MAAM,IAAI,CAAC,YAAY,CAAA;YACtD,KAAK,CAAC,GAAG,CAAC,wCAAwC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;YAC9D,MAAM,UAAU,CAAC,aAAa,CAAC,2BAAY,CAAC;iBACvC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;QACpC,CAAC;KAAA;CACJ;AA7BD,kCA6BC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sphereon/ssi-sdk.data-store",
3
- "version": "0.18.2-unstable.51+a2d97f40",
3
+ "version": "0.18.2-unstable.59+bddad9ff",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,8 +13,8 @@
13
13
  "typeorm-postgres:migration:run": "pnpm run typeorm -- migration:run -c migration-postgres"
14
14
  },
15
15
  "dependencies": {
16
- "@sphereon/ssi-sdk.core": "0.18.2-unstable.51+a2d97f40",
17
- "@sphereon/ssi-types": "0.18.2-unstable.51+a2d97f40",
16
+ "@sphereon/ssi-sdk.core": "0.18.2-unstable.59+bddad9ff",
17
+ "@sphereon/ssi-types": "0.18.2-unstable.59+bddad9ff",
18
18
  "@veramo/core": "4.2.0",
19
19
  "class-validator": "^0.14.0",
20
20
  "debug": "^4.3.4",
@@ -43,5 +43,5 @@
43
43
  "PostgreSQL",
44
44
  "Contact Store"
45
45
  ],
46
- "gitHead": "a2d97f4054dd9178b875084e4a3928c386ff2ef1"
46
+ "gitHead": "bddad9ff76680735c0bff6f393c42dc07375d5d6"
47
47
  }
@@ -0,0 +1,29 @@
1
+ import {BaseEntity, Column, Entity, PrimaryColumn} from "typeorm";
2
+
3
+ @Entity('XstateEntity')
4
+ export class XStateEntity extends BaseEntity {
5
+ @PrimaryColumn({ name: 'id', type: 'varchar' })
6
+ // @ts-ignore
7
+ id: string
8
+ @Column()
9
+ // @ts-ignore
10
+ state: string
11
+ @Column()
12
+ // @ts-ignore
13
+ type: string
14
+ @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
15
+ // @ts-ignore
16
+ createdAt: Date
17
+ @Column({ type: 'timestamp', onUpdate: 'CURRENT_TIMESTAMP', nullable: true })
18
+ // @ts-ignore
19
+ updatedAt: Date
20
+ @Column({ type: 'timestamp', nullable: true })
21
+ // @ts-ignore
22
+ completedAt: Date
23
+ @Column()
24
+ // @ts-ignore
25
+ tenantId?: string
26
+ @Column({ default: 0 })
27
+ // @ts-ignore
28
+ ttl: number
29
+ }
package/src/index.ts CHANGED
@@ -18,6 +18,7 @@ import { IssuerBrandingEntity, issuerBrandingEntityFrom } from './entities/issua
18
18
  import { TextAttributesEntity, textAttributesEntityFrom } from './entities/issuanceBranding/TextAttributesEntity'
19
19
  import { StatusListEntity } from './entities/statusList2021/StatusList2021Entity'
20
20
  import { StatusListEntryEntity } from './entities/statusList2021/StatusList2021EntryEntity'
21
+ import {XStateEntity} from "./entities/xstatePersistence/XStateEntity";
21
22
  import { IStatusListEntity, IStatusListEntryEntity } from './types'
22
23
  import { PartyRelationshipEntity } from './entities/contact/PartyRelationshipEntity'
23
24
  import { PartyTypeEntity } from './entities/contact/PartyTypeEntity'
@@ -32,12 +33,16 @@ export { StatusListStore } from './statusList/StatusListStore'
32
33
  import { AuditEventEntity, auditEventEntityFrom } from './entities/eventLogger/AuditEventEntity'
33
34
  export { AbstractEventLoggerStore } from './eventLogger/AbstractEventLoggerStore'
34
35
  export { EventLoggerStore } from './eventLogger/EventLoggerStore'
36
+ export { IAbstractXStateStore } from './xstatePersistence/IAbstractXStateStore'
37
+ export { XStateStore } from './xstatePersistence/XStateStore'
38
+
35
39
  export {
36
40
  DataStoreMigrations,
37
41
  DataStoreEventLoggerMigrations,
38
42
  DataStoreContactMigrations,
39
43
  DataStoreIssuanceBrandingMigrations,
40
44
  DataStoreStatusListMigrations,
45
+ DataStoreXStatePersistenceMigration,
41
46
  } from './migrations'
42
47
  export * from './types'
43
48
  export * from './utils/contact/MappingUtils'
@@ -75,12 +80,15 @@ export const DataStoreStatusListEntities = [StatusListEntity, StatusListEntryEnt
75
80
 
76
81
  export const DataStoreEventLoggerEntities = [AuditEventEntity]
77
82
 
83
+ export const DataStoreXStateStoreEntities = [XStateEntity]
84
+
78
85
  // All entities combined if a party wants to enable them all at once
79
86
  export const DataStoreEntities = [
80
87
  ...DataStoreContactEntities,
81
88
  ...DataStoreIssuanceBrandingEntities,
82
89
  ...DataStoreStatusListEntities,
83
90
  ...DataStoreEventLoggerEntities,
91
+ ...DataStoreXStateStoreEntities
84
92
  ]
85
93
 
86
94
  export {
@@ -116,4 +124,5 @@ export {
116
124
  StatusListEntryEntity,
117
125
  AuditEventEntity,
118
126
  auditEventEntityFrom,
127
+ XStateEntity
119
128
  }
@@ -0,0 +1,66 @@
1
+ import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
2
+ import Debug from 'debug'
3
+ import { CreateXStateStore1708097018115 } from '../postgres/1708097018115-CreateXStateStore'
4
+ import { CreateXStateStore1708096002272 } from '../sqlite/1708096002272-CreateXStateStore'
5
+
6
+ const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:migrations')
7
+
8
+ export class CreateXStateStore1708098041262 implements MigrationInterface {
9
+ name = 'CreateXStateStore1708098041262'
10
+
11
+ public async up(queryRunner: QueryRunner): Promise<void> {
12
+ debug('migration: creating contacts tables')
13
+ const dbType: DatabaseType = queryRunner.connection.driver.options.type
14
+
15
+ switch (dbType) {
16
+ case 'postgres': {
17
+ debug('using postgres migration file')
18
+ const mig: CreateXStateStore1708097018115 = new CreateXStateStore1708097018115()
19
+ await mig.up(queryRunner)
20
+ debug('Migration statements executed')
21
+ return
22
+ }
23
+ case 'sqlite':
24
+ case 'expo':
25
+ case 'react-native': {
26
+ debug('using sqlite/react-native migration file')
27
+ const mig: CreateXStateStore1708096002272 = new CreateXStateStore1708096002272()
28
+ await mig.up(queryRunner)
29
+ debug('Migration statements executed')
30
+ return
31
+ }
32
+ default:
33
+ return Promise.reject(
34
+ `Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`
35
+ )
36
+ }
37
+ }
38
+
39
+ public async down(queryRunner: QueryRunner): Promise<void> {
40
+ debug('migration: reverting contacts tables')
41
+ const dbType: DatabaseType = queryRunner.connection.driver.options.type
42
+
43
+ switch (dbType) {
44
+ case 'postgres': {
45
+ debug('using postgres migration file')
46
+ const mig: CreateXStateStore1708097018115 = new CreateXStateStore1708097018115()
47
+ await mig.down(queryRunner)
48
+ debug('Migration statements executed')
49
+ return
50
+ }
51
+ case 'sqlite':
52
+ case 'expo':
53
+ case 'react-native': {
54
+ debug('using sqlite/react-native migration file')
55
+ const mig: CreateXStateStore1708096002272 = new CreateXStateStore1708096002272()
56
+ await mig.down(queryRunner)
57
+ debug('Migration statements executed')
58
+ return
59
+ }
60
+ default:
61
+ return Promise.reject(
62
+ `Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`
63
+ )
64
+ }
65
+ }
66
+ }
@@ -3,6 +3,7 @@ import { CreateIssuanceBranding1659463079429 } from './2-CreateIssuanceBranding'
3
3
  import { CreateContacts1690925872318 } from './3-CreateContacts'
4
4
  import { CreateStatusList1693866470000 } from './4-CreateStatusList'
5
5
  import { CreateAuditEvents1701635835330 } from './5-CreateAuditEvents'
6
+ import {CreateXStateStore1708098041262} from "./6-CreateXStateStore";
6
7
 
7
8
  /**
8
9
  * The migrations array that SHOULD be used when initializing a TypeORM database connection.
@@ -17,6 +18,7 @@ export const DataStoreContactMigrations = [CreateContacts1659463079429, CreateCo
17
18
  export const DataStoreIssuanceBrandingMigrations = [CreateIssuanceBranding1659463079429]
18
19
  export const DataStoreStatusListMigrations = [CreateStatusList1693866470000]
19
20
  export const DataStoreEventLoggerMigrations = [CreateAuditEvents1701635835330]
21
+ export const DataStoreXStatePersistenceMigration = [CreateXStateStore1708098041262]
20
22
 
21
23
  // All migrations together
22
24
  export const DataStoreMigrations = [
@@ -24,4 +26,5 @@ export const DataStoreMigrations = [
24
26
  ...DataStoreIssuanceBrandingMigrations,
25
27
  ...DataStoreStatusListMigrations,
26
28
  ...DataStoreEventLoggerMigrations,
29
+ ...DataStoreXStatePersistenceMigration
27
30
  ]
@@ -4,4 +4,5 @@ export {
4
4
  DataStoreContactMigrations,
5
5
  DataStoreIssuanceBrandingMigrations,
6
6
  DataStoreStatusListMigrations,
7
+ DataStoreXStatePersistenceMigration
7
8
  } from './generic'
@@ -0,0 +1,18 @@
1
+ import {enablePostgresUuidExtension} from "@sphereon/ssi-sdk.core";
2
+ import {MigrationInterface, QueryRunner} from "typeorm";
3
+
4
+ export class CreateXStateStore1708097018115 implements MigrationInterface {
5
+ name = 'CreateXStateStore1708097018115'
6
+
7
+ public async up(queryRunner: QueryRunner): Promise<any> {
8
+ await enablePostgresUuidExtension(queryRunner)
9
+ await queryRunner.query(
10
+ `CREATE TABLE "XStateStore" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "state" varchar(255) NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, CONSTRAINT PK_XStateStore_id PRIMARY KEY ("id")`
11
+ )
12
+ }
13
+
14
+ public async down(queryRunner: QueryRunner): Promise<void> {
15
+ await queryRunner.query(`ALTER TABLE "XStateStore" DROP CONSTRAINT "PK_XStateStore_id"`)
16
+ await queryRunner.query(`DROP TABLE "XStateEntity"`)
17
+ }
18
+ }
@@ -0,0 +1,16 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class CreateXStateStore1708096002272 implements MigrationInterface {
4
+ name = 'CreateXStateStore1708096002272'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<any> {
7
+ await queryRunner.query(
8
+ `CREATE TABLE "XStateEntity" ("id" varchar PRIMARY KEY NOT NULL, "state" varchar(255) NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT (datetime('now')), "updatedAt" TIMESTAMP NOT NULL DEFAULT (datetime('now')), "deletedAt" TIMESTAMP, CONSTRAINT "PK_XStateEntity_id")`
9
+ )
10
+ }
11
+
12
+ public async down(queryRunner: QueryRunner): Promise<void> {
13
+ await queryRunner.query(`ALTER TABLE "XStateEntity" DROP CONSTRAINT "PK_XStateEntity_id"`)
14
+ await queryRunner.query(`DROP TABLE "XStateEntity"`)
15
+ }
16
+ }
@@ -7,3 +7,4 @@ export * from './statusList/statusList'
7
7
  export * from './statusList/IAbstractStatusListStore'
8
8
  export * from './eventLogger/IAbstractEventLoggerStore'
9
9
  export * from './eventLogger/eventLogger'
10
+ export * from './xstatePersistence/types'
@@ -0,0 +1,19 @@
1
+ import {XStateEntity} from "../../entities/xstatePersistence/XStateEntity";
2
+
3
+ export type PersistStateArgs = {
4
+ state: string
5
+ type: string
6
+ createdAt: Date
7
+ updatedAt: Date
8
+ completedAt: Date
9
+ tenantId?: string
10
+ ttl: number
11
+ }
12
+
13
+ export type LoadStateArgs = Pick<PersistStateArgs, 'type'>
14
+
15
+ export type DeleteStateArgs = Pick<PersistStateArgs, 'type'>
16
+
17
+ export type VoidResult = void
18
+
19
+ export type LoadStateResult = XStateEntity | null
@@ -0,0 +1,7 @@
1
+ import {LoadStateArgs, LoadStateResult, PersistStateArgs, VoidResult} from "../types";
2
+
3
+ export abstract class IAbstractXStateStore {
4
+ abstract persistState(state: PersistStateArgs): Promise<VoidResult>
5
+ abstract loadState(args: LoadStateArgs): Promise<LoadStateResult>
6
+ abstract deleteState(args: LoadStateArgs): Promise<VoidResult>
7
+ }
@@ -0,0 +1,40 @@
1
+ import {OrPromise} from "@sphereon/ssi-types";
2
+ import Debug from 'debug'
3
+ import {DataSource} from "typeorm";
4
+
5
+ import {XStateEntity} from "../entities/xstatePersistence/XStateEntity";
6
+ import {DeleteStateArgs, LoadStateArgs, LoadStateResult, PersistStateArgs, VoidResult,} from "../types";
7
+ import {IAbstractXStateStore} from "./IAbstractXStateStore";
8
+
9
+ const debug = Debug('sphereon:ssi-sdk:xstatePersistence')
10
+
11
+ export class XStateStore extends IAbstractXStateStore {
12
+ private readonly dbConnection: OrPromise<DataSource>
13
+
14
+ constructor(dbConnection: OrPromise<DataSource>) {
15
+ super()
16
+ this.dbConnection = dbConnection
17
+ }
18
+
19
+ async persistState(state: PersistStateArgs): Promise<VoidResult> {
20
+ const connection: DataSource = await this.dbConnection
21
+ debug.log(`Executing persistState with state: ${JSON.stringify(state)}`)
22
+ await connection.getRepository(XStateEntity).save(state)
23
+ }
24
+
25
+ async loadState(args: LoadStateArgs): Promise<LoadStateResult> {
26
+ const connection: DataSource = await this.dbConnection
27
+ debug.log(`Executing loadState query with type: ${args.type}`)
28
+ return await connection.getRepository(XStateEntity)
29
+ .findOne({
30
+ where: { type: args.type }
31
+ })
32
+ }
33
+
34
+ async deleteState(args: DeleteStateArgs): Promise<VoidResult> {
35
+ const connection: DataSource = await this.dbConnection
36
+ debug.log(`Executing loadState query with type: ${args.type}`)
37
+ await connection.getRepository(XStateEntity)
38
+ .delete({ type: args.type })
39
+ }
40
+ }