@sphereon/ssi-sdk.data-store 0.23.5-unstable.88 → 0.24.0

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 (146) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +77 -77
  3. package/dist/index.d.ts +3 -9
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +2 -15
  6. package/dist/index.js.map +1 -1
  7. package/dist/migrations/generic/index.d.ts +0 -2
  8. package/dist/migrations/generic/index.d.ts.map +1 -1
  9. package/dist/migrations/generic/index.js +1 -4
  10. package/dist/migrations/generic/index.js.map +1 -1
  11. package/dist/migrations/index.d.ts +1 -1
  12. package/dist/migrations/index.d.ts.map +1 -1
  13. package/dist/migrations/index.js +1 -2
  14. package/dist/migrations/index.js.map +1 -1
  15. package/dist/migrations/postgres/1690925872592-CreateContacts.js +1 -1
  16. package/dist/migrations/postgres/1690925872592-CreateContacts.js.map +1 -1
  17. package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js +22 -22
  18. package/dist/migrations/postgres/1708797018115-CreateMachineStateStore.js +16 -16
  19. package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.js +21 -21
  20. package/dist/migrations/sqlite/1708796002272-CreateMachineStateStore.js +15 -15
  21. package/dist/types/index.d.ts +0 -2
  22. package/dist/types/index.d.ts.map +1 -1
  23. package/dist/types/index.js +0 -2
  24. package/dist/types/index.js.map +1 -1
  25. package/package.json +4 -5
  26. package/src/__tests__/contact.entities.test.ts +2542 -2542
  27. package/src/__tests__/contact.store.test.ts +2471 -2471
  28. package/src/__tests__/digitalCredential.entities.test.ts +254 -254
  29. package/src/__tests__/digitalCredential.store.test.ts +294 -294
  30. package/src/__tests__/eventLogger.entities.test.ts +73 -73
  31. package/src/__tests__/eventLogger.store.test.ts +136 -136
  32. package/src/__tests__/issuanceBranding.entities.test.ts +844 -844
  33. package/src/__tests__/issuanceBranding.store.test.ts +1884 -1884
  34. package/src/__tests__/machineState.entities.test.ts +51 -51
  35. package/src/__tests__/machineState.store.test.ts +174 -174
  36. package/src/contact/AbstractContactStore.ts +71 -71
  37. package/src/contact/ContactStore.ts +723 -723
  38. package/src/digitalCredential/AbstractDigitalCredentialStore.ts +17 -17
  39. package/src/digitalCredential/DigitalCredentialStore.ts +127 -127
  40. package/src/entities/contact/BaseContactEntity.ts +39 -39
  41. package/src/entities/contact/ConnectionEntity.ts +29 -29
  42. package/src/entities/contact/CorrelationIdentifierEntity.ts +37 -37
  43. package/src/entities/contact/DidAuthConfigEntity.ts +14 -14
  44. package/src/entities/contact/ElectronicAddressEntity.ts +63 -63
  45. package/src/entities/contact/IdentityEntity.ts +97 -97
  46. package/src/entities/contact/IdentityMetadataItemEntity.ts +35 -35
  47. package/src/entities/contact/NaturalPersonEntity.ts +38 -38
  48. package/src/entities/contact/OpenIdConfigEntity.ts +26 -26
  49. package/src/entities/contact/OrganizationEntity.ts +34 -34
  50. package/src/entities/contact/PartyEntity.ts +110 -110
  51. package/src/entities/contact/PartyRelationshipEntity.ts +61 -61
  52. package/src/entities/contact/PartyTypeEntity.ts +62 -62
  53. package/src/entities/contact/PhysicalAddressEntity.ts +87 -87
  54. package/src/entities/digitalCredential/DigitalCredentialEntity.ts +64 -64
  55. package/src/entities/eventLogger/AuditEventEntity.ts +99 -99
  56. package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +78 -78
  57. package/src/entities/issuanceBranding/ImageAttributesEntity.ts +57 -57
  58. package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +72 -72
  59. package/src/entities/machineState/MachineStateInfoEntity.ts +58 -58
  60. package/src/entities/statusList2021/StatusList2021Entity.ts +96 -96
  61. package/src/eventLogger/AbstractEventLoggerStore.ts +7 -7
  62. package/src/eventLogger/EventLoggerStore.ts +62 -62
  63. package/src/index.ts +141 -154
  64. package/src/issuanceBranding/IssuanceBrandingStore.ts +559 -559
  65. package/src/machineState/IAbstractMachineStateStore.ts +65 -65
  66. package/src/machineState/MachineStateStore.ts +149 -149
  67. package/src/migrations/generic/1-CreateContacts.ts +66 -66
  68. package/src/migrations/generic/2-CreateIssuanceBranding.ts +64 -64
  69. package/src/migrations/generic/3-CreateContacts.ts +66 -66
  70. package/src/migrations/generic/4-CreateStatusList.ts +54 -54
  71. package/src/migrations/generic/5-CreateAuditEvents.ts +66 -66
  72. package/src/migrations/generic/6-CreateDigitalCredential.ts +66 -66
  73. package/src/migrations/generic/7-CreateMachineStateStore.ts +66 -66
  74. package/src/migrations/generic/index.ts +33 -36
  75. package/src/migrations/index.ts +9 -10
  76. package/src/migrations/postgres/1659463079428-CreateContacts.ts +63 -63
  77. package/src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts +85 -85
  78. package/src/migrations/postgres/1690925872592-CreateContacts.ts +104 -104
  79. package/src/migrations/postgres/1693866470001-CreateStatusList.ts +24 -24
  80. package/src/migrations/postgres/1701634812183-CreateAuditEvents.ts +33 -33
  81. package/src/migrations/postgres/1708525189001-CreateDigitalCredential.ts +44 -44
  82. package/src/migrations/postgres/1708797018115-CreateMachineStateStore.ts +29 -29
  83. package/src/migrations/sqlite/1659463069549-CreateContacts.ts +110 -110
  84. package/src/migrations/sqlite/1685628973231-CreateIssuanceBranding.ts +119 -119
  85. package/src/migrations/sqlite/1690925872693-CreateContacts.ts +161 -161
  86. package/src/migrations/sqlite/1693866470000-CreateStatusList.ts +24 -24
  87. package/src/migrations/sqlite/1701634819487-CreateAuditEvents.ts +15 -15
  88. package/src/migrations/sqlite/1708525189002-CreateDigitalCredential.ts +34 -34
  89. package/src/migrations/sqlite/1708796002272-CreateMachineStateStore.ts +28 -28
  90. package/src/statusList/StatusListStore.ts +237 -237
  91. package/src/types/contact/IAbstractContactStore.ts +161 -161
  92. package/src/types/contact/contact.ts +237 -237
  93. package/src/types/digitalCredential/IAbstractDigitalCredentialStore.ts +37 -37
  94. package/src/types/digitalCredential/digitalCredential.ts +46 -46
  95. package/src/types/eventLogger/IAbstractEventLoggerStore.ts +12 -12
  96. package/src/types/eventLogger/eventLogger.ts +3 -3
  97. package/src/types/index.ts +10 -12
  98. package/src/types/machineState/IAbstractMachineStateStore.ts +68 -68
  99. package/src/utils/SortingUtils.ts +16 -16
  100. package/src/utils/contact/MappingUtils.ts +385 -385
  101. package/src/utils/digitalCredential/MappingUtils.ts +122 -122
  102. package/dist/entities/presentationDefinitions/PresentationDefinitionItemEntity.d.ts +0 -13
  103. package/dist/entities/presentationDefinitions/PresentationDefinitionItemEntity.d.ts.map +0 -1
  104. package/dist/entities/presentationDefinitions/PresentationDefinitionItemEntity.js +0 -71
  105. package/dist/entities/presentationDefinitions/PresentationDefinitionItemEntity.js.map +0 -1
  106. package/dist/migrations/generic/8-CreatePresentationDefinitions.d.ts +0 -7
  107. package/dist/migrations/generic/8-CreatePresentationDefinitions.d.ts.map +0 -1
  108. package/dist/migrations/generic/8-CreatePresentationDefinitions.js +0 -78
  109. package/dist/migrations/generic/8-CreatePresentationDefinitions.js.map +0 -1
  110. package/dist/migrations/postgres/1716475165345-CreatePresentationDefinitions.d.ts +0 -7
  111. package/dist/migrations/postgres/1716475165345-CreatePresentationDefinitions.d.ts.map +0 -1
  112. package/dist/migrations/postgres/1716475165345-CreatePresentationDefinitions.js +0 -40
  113. package/dist/migrations/postgres/1716475165345-CreatePresentationDefinitions.js.map +0 -1
  114. package/dist/migrations/sqlite/1716475165344-CreatePresentationDefinitions.d.ts +0 -7
  115. package/dist/migrations/sqlite/1716475165344-CreatePresentationDefinitions.d.ts.map +0 -1
  116. package/dist/migrations/sqlite/1716475165344-CreatePresentationDefinitions.js +0 -37
  117. package/dist/migrations/sqlite/1716475165344-CreatePresentationDefinitions.js.map +0 -1
  118. package/dist/pd/AbstractPDStore.d.ts +0 -10
  119. package/dist/pd/AbstractPDStore.d.ts.map +0 -1
  120. package/dist/pd/AbstractPDStore.js +0 -7
  121. package/dist/pd/AbstractPDStore.js.map +0 -1
  122. package/dist/pd/PDStore.d.ts +0 -14
  123. package/dist/pd/PDStore.d.ts.map +0 -1
  124. package/dist/pd/PDStore.js +0 -90
  125. package/dist/pd/PDStore.js.map +0 -1
  126. package/dist/types/pd/IAbstractPDStore.d.ts +0 -14
  127. package/dist/types/pd/IAbstractPDStore.d.ts.map +0 -1
  128. package/dist/types/pd/IAbstractPDStore.js +0 -3
  129. package/dist/types/pd/IAbstractPDStore.js.map +0 -1
  130. package/dist/types/pd/pd.d.ts +0 -15
  131. package/dist/types/pd/pd.d.ts.map +0 -1
  132. package/dist/types/pd/pd.js +0 -3
  133. package/dist/types/pd/pd.js.map +0 -1
  134. package/dist/utils/presentationDefinitions/MappingUtils.d.ts +0 -6
  135. package/dist/utils/presentationDefinitions/MappingUtils.d.ts.map +0 -1
  136. package/dist/utils/presentationDefinitions/MappingUtils.js +0 -50
  137. package/dist/utils/presentationDefinitions/MappingUtils.js.map +0 -1
  138. package/src/entities/presentationDefinitions/PresentationDefinitionItemEntity.ts +0 -41
  139. package/src/migrations/generic/8-CreatePresentationDefinitions.ts +0 -66
  140. package/src/migrations/postgres/1716475165345-CreatePresentationDefinitions.ts +0 -24
  141. package/src/migrations/sqlite/1716475165344-CreatePresentationDefinitions.ts +0 -23
  142. package/src/pd/AbstractPDStore.ts +0 -10
  143. package/src/pd/PDStore.ts +0 -103
  144. package/src/types/pd/IAbstractPDStore.ts +0 -19
  145. package/src/types/pd/pd.ts +0 -16
  146. package/src/utils/presentationDefinitions/MappingUtils.ts +0 -54
@@ -1,122 +1,122 @@
1
- import { AddCredentialArgs } from '../../types/digitalCredential/IAbstractDigitalCredentialStore'
2
- import { DigitalCredentialEntity } from '../../entities/digitalCredential/DigitalCredentialEntity'
3
- import {
4
- CredentialMapper,
5
- decodeSdJwtVc,
6
- DocumentFormat,
7
- IVerifiableCredential,
8
- IVerifiablePresentation,
9
- OriginalVerifiableCredential,
10
- OriginalVerifiablePresentation,
11
- SdJwtDecodedVerifiableCredentialPayload,
12
- } from '@sphereon/ssi-types'
13
- import {
14
- CredentialDocumentFormat,
15
- DocumentType,
16
- DigitalCredential,
17
- NonPersistedDigitalCredential,
18
- } from '../../types/digitalCredential/digitalCredential'
19
- import { computeEntryHash } from '@veramo/utils'
20
-
21
- function determineDocumentType(raw: string): DocumentType {
22
- const rawDocument = parseRawDocument(raw)
23
- if (!rawDocument) {
24
- throw new Error(`Couldn't parse the credential: ${raw}`)
25
- }
26
-
27
- const hasProof = CredentialMapper.hasProof(rawDocument)
28
- const isCredential = CredentialMapper.isCredential(rawDocument)
29
- const isPresentation = CredentialMapper.isPresentation(rawDocument)
30
-
31
- if (isCredential) {
32
- return hasProof ? DocumentType.VC : DocumentType.C
33
- } else if (isPresentation) {
34
- return hasProof ? DocumentType.VP : DocumentType.P
35
- }
36
- throw new Error(`Couldn't determine the type of the credential: ${raw}`)
37
- }
38
-
39
- function parseRawDocument(raw: string): OriginalVerifiableCredential | OriginalVerifiablePresentation {
40
- if (CredentialMapper.isJwtEncoded(raw) || CredentialMapper.isSdJwtEncoded(raw)) {
41
- return raw
42
- }
43
- try {
44
- return JSON.parse(raw)
45
- } catch (e) {
46
- throw new Error(`Can't parse the raw credential: ${raw}`)
47
- }
48
- }
49
-
50
- function determineCredentialDocumentFormat(documentFormat: DocumentFormat): CredentialDocumentFormat {
51
- switch (documentFormat) {
52
- case DocumentFormat.JSONLD:
53
- return CredentialDocumentFormat.JSON_LD
54
- case DocumentFormat.JWT:
55
- return CredentialDocumentFormat.JWT
56
- case DocumentFormat.SD_JWT_VC:
57
- return CredentialDocumentFormat.SD_JWT
58
- default:
59
- throw new Error(`Not supported document format: ${documentFormat}`)
60
- }
61
- }
62
-
63
- function getValidUntil(uniformDocument: IVerifiableCredential | IVerifiablePresentation | SdJwtDecodedVerifiableCredentialPayload): Date | undefined {
64
- if ('expirationDate' in uniformDocument) {
65
- return new Date(uniformDocument.expirationDate)
66
- } else if ('validUntil' in uniformDocument) {
67
- return new Date(uniformDocument.validUntil)
68
- } else if ('exp' in uniformDocument) {
69
- return new Date(uniformDocument.exp)
70
- }
71
- return undefined
72
- }
73
-
74
- function getValidFrom(uniformDocument: IVerifiableCredential | IVerifiablePresentation | SdJwtDecodedVerifiableCredentialPayload): Date | undefined {
75
- if ('issuanceDate' in uniformDocument) {
76
- return new Date(uniformDocument.issuanceDate)
77
- } else if ('validFrom' in uniformDocument) {
78
- return new Date(uniformDocument['validFrom'])
79
- } else if ('nbf' in uniformDocument) {
80
- return new Date(uniformDocument['nbf'] * 1000)
81
- } else if ('iat' in uniformDocument) {
82
- return new Date(uniformDocument['iat'] * 1000)
83
- }
84
- return undefined
85
- }
86
-
87
- export const nonPersistedDigitalCredentialEntityFromAddArgs = (addCredentialArgs: AddCredentialArgs): NonPersistedDigitalCredential => {
88
- const documentType: DocumentType = determineDocumentType(addCredentialArgs.rawDocument)
89
- const documentFormat: DocumentFormat = CredentialMapper.detectDocumentType(addCredentialArgs.rawDocument)
90
- if (documentFormat === DocumentFormat.SD_JWT_VC && !addCredentialArgs.opts?.hasher) {
91
- throw new Error('No hasher function is provided for SD_JWT credential.')
92
- }
93
- const uniformDocument =
94
- documentFormat === DocumentFormat.SD_JWT_VC
95
- ? decodeSdJwtVc(addCredentialArgs.rawDocument, addCredentialArgs.opts!.hasher!).decodedPayload
96
- : documentType === DocumentType.VC || documentType === DocumentType.C
97
- ? CredentialMapper.toUniformCredential(addCredentialArgs.rawDocument)
98
- : CredentialMapper.toUniformPresentation(addCredentialArgs.rawDocument)
99
- const validFrom: Date | undefined = getValidFrom(uniformDocument)
100
- const validUntil: Date | undefined = getValidUntil(uniformDocument)
101
- return {
102
- ...addCredentialArgs,
103
- documentType,
104
- documentFormat: determineCredentialDocumentFormat(documentFormat),
105
- createdAt: new Date(),
106
- hash: computeEntryHash(addCredentialArgs.rawDocument),
107
- uniformDocument: JSON.stringify(uniformDocument),
108
- validFrom,
109
- validUntil,
110
- lastUpdatedAt: new Date(),
111
- }
112
- }
113
-
114
- export const digitalCredentialFrom = (credentialEntity: DigitalCredentialEntity): DigitalCredential => {
115
- return {
116
- ...credentialEntity,
117
- }
118
- }
119
-
120
- export const digitalCredentialsFrom = (credentialEntities: Array<DigitalCredentialEntity>): DigitalCredential[] => {
121
- return credentialEntities.map((credentialEntity) => digitalCredentialFrom(credentialEntity))
122
- }
1
+ import { AddCredentialArgs } from '../../types/digitalCredential/IAbstractDigitalCredentialStore'
2
+ import { DigitalCredentialEntity } from '../../entities/digitalCredential/DigitalCredentialEntity'
3
+ import {
4
+ CredentialMapper,
5
+ decodeSdJwtVc,
6
+ DocumentFormat,
7
+ IVerifiableCredential,
8
+ IVerifiablePresentation,
9
+ OriginalVerifiableCredential,
10
+ OriginalVerifiablePresentation,
11
+ SdJwtDecodedVerifiableCredentialPayload,
12
+ } from '@sphereon/ssi-types'
13
+ import {
14
+ CredentialDocumentFormat,
15
+ DocumentType,
16
+ DigitalCredential,
17
+ NonPersistedDigitalCredential,
18
+ } from '../../types/digitalCredential/digitalCredential'
19
+ import { computeEntryHash } from '@veramo/utils'
20
+
21
+ function determineDocumentType(raw: string): DocumentType {
22
+ const rawDocument = parseRawDocument(raw)
23
+ if (!rawDocument) {
24
+ throw new Error(`Couldn't parse the credential: ${raw}`)
25
+ }
26
+
27
+ const hasProof = CredentialMapper.hasProof(rawDocument)
28
+ const isCredential = CredentialMapper.isCredential(rawDocument)
29
+ const isPresentation = CredentialMapper.isPresentation(rawDocument)
30
+
31
+ if (isCredential) {
32
+ return hasProof ? DocumentType.VC : DocumentType.C
33
+ } else if (isPresentation) {
34
+ return hasProof ? DocumentType.VP : DocumentType.P
35
+ }
36
+ throw new Error(`Couldn't determine the type of the credential: ${raw}`)
37
+ }
38
+
39
+ function parseRawDocument(raw: string): OriginalVerifiableCredential | OriginalVerifiablePresentation {
40
+ if (CredentialMapper.isJwtEncoded(raw) || CredentialMapper.isSdJwtEncoded(raw)) {
41
+ return raw
42
+ }
43
+ try {
44
+ return JSON.parse(raw)
45
+ } catch (e) {
46
+ throw new Error(`Can't parse the raw credential: ${raw}`)
47
+ }
48
+ }
49
+
50
+ function determineCredentialDocumentFormat(documentFormat: DocumentFormat): CredentialDocumentFormat {
51
+ switch (documentFormat) {
52
+ case DocumentFormat.JSONLD:
53
+ return CredentialDocumentFormat.JSON_LD
54
+ case DocumentFormat.JWT:
55
+ return CredentialDocumentFormat.JWT
56
+ case DocumentFormat.SD_JWT_VC:
57
+ return CredentialDocumentFormat.SD_JWT
58
+ default:
59
+ throw new Error(`Not supported document format: ${documentFormat}`)
60
+ }
61
+ }
62
+
63
+ function getValidUntil(uniformDocument: IVerifiableCredential | IVerifiablePresentation | SdJwtDecodedVerifiableCredentialPayload): Date | undefined {
64
+ if ('expirationDate' in uniformDocument) {
65
+ return new Date(uniformDocument.expirationDate)
66
+ } else if ('validUntil' in uniformDocument) {
67
+ return new Date(uniformDocument.validUntil)
68
+ } else if ('exp' in uniformDocument) {
69
+ return new Date(uniformDocument.exp)
70
+ }
71
+ return undefined
72
+ }
73
+
74
+ function getValidFrom(uniformDocument: IVerifiableCredential | IVerifiablePresentation | SdJwtDecodedVerifiableCredentialPayload): Date | undefined {
75
+ if ('issuanceDate' in uniformDocument) {
76
+ return new Date(uniformDocument.issuanceDate)
77
+ } else if ('validFrom' in uniformDocument) {
78
+ return new Date(uniformDocument['validFrom'])
79
+ } else if ('nbf' in uniformDocument) {
80
+ return new Date(uniformDocument['nbf'] * 1000)
81
+ } else if ('iat' in uniformDocument) {
82
+ return new Date(uniformDocument['iat'] * 1000)
83
+ }
84
+ return undefined
85
+ }
86
+
87
+ export const nonPersistedDigitalCredentialEntityFromAddArgs = (addCredentialArgs: AddCredentialArgs): NonPersistedDigitalCredential => {
88
+ const documentType: DocumentType = determineDocumentType(addCredentialArgs.rawDocument)
89
+ const documentFormat: DocumentFormat = CredentialMapper.detectDocumentType(addCredentialArgs.rawDocument)
90
+ if (documentFormat === DocumentFormat.SD_JWT_VC && !addCredentialArgs.opts?.hasher) {
91
+ throw new Error('No hasher function is provided for SD_JWT credential.')
92
+ }
93
+ const uniformDocument =
94
+ documentFormat === DocumentFormat.SD_JWT_VC
95
+ ? decodeSdJwtVc(addCredentialArgs.rawDocument, addCredentialArgs.opts!.hasher!).decodedPayload
96
+ : documentType === DocumentType.VC || documentType === DocumentType.C
97
+ ? CredentialMapper.toUniformCredential(addCredentialArgs.rawDocument)
98
+ : CredentialMapper.toUniformPresentation(addCredentialArgs.rawDocument)
99
+ const validFrom: Date | undefined = getValidFrom(uniformDocument)
100
+ const validUntil: Date | undefined = getValidUntil(uniformDocument)
101
+ return {
102
+ ...addCredentialArgs,
103
+ documentType,
104
+ documentFormat: determineCredentialDocumentFormat(documentFormat),
105
+ createdAt: new Date(),
106
+ hash: computeEntryHash(addCredentialArgs.rawDocument),
107
+ uniformDocument: JSON.stringify(uniformDocument),
108
+ validFrom,
109
+ validUntil,
110
+ lastUpdatedAt: new Date(),
111
+ }
112
+ }
113
+
114
+ export const digitalCredentialFrom = (credentialEntity: DigitalCredentialEntity): DigitalCredential => {
115
+ return {
116
+ ...credentialEntity,
117
+ }
118
+ }
119
+
120
+ export const digitalCredentialsFrom = (credentialEntities: Array<DigitalCredentialEntity>): DigitalCredential[] => {
121
+ return credentialEntities.map((credentialEntity) => digitalCredentialFrom(credentialEntity))
122
+ }
@@ -1,13 +0,0 @@
1
- import { BaseEntity } from 'typeorm';
2
- export declare class PresentationDefinitionItemEntity extends BaseEntity {
3
- id: string;
4
- definitionId: string;
5
- version: string;
6
- tenantId?: string;
7
- purpose?: string;
8
- definitionPayload: string;
9
- createdAt: Date;
10
- lastUpdatedAt: Date;
11
- updateUpdatedDate(): void;
12
- }
13
- //# sourceMappingURL=PresentationDefinitionItemEntity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PresentationDefinitionItemEntity.d.ts","sourceRoot":"","sources":["../../../src/entities/presentationDefinitions/PresentationDefinitionItemEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiH,MAAM,SAAS,CAAA;AAGnJ,qBAGa,gCAAiC,SAAQ,UAAU;IAE9D,EAAE,EAAG,MAAM,CAAA;IAIX,YAAY,EAAG,MAAM,CAAA;IAIrB,OAAO,EAAG,MAAM,CAAA;IAGhB,QAAQ,CAAC,EAAE,MAAM,CAAA;IAGjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAIhB,iBAAiB,EAAG,MAAM,CAAA;IAG1B,SAAS,EAAG,IAAI,CAAA;IAGhB,aAAa,EAAG,IAAI,CAAA;IAKpB,iBAAiB,IAAI,IAAI;CAG1B"}
@@ -1,71 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.PresentationDefinitionItemEntity = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const class_validator_1 = require("class-validator");
15
- let PresentationDefinitionItemEntity = class PresentationDefinitionItemEntity extends typeorm_1.BaseEntity {
16
- // By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
17
- updateUpdatedDate() {
18
- this.lastUpdatedAt = new Date();
19
- }
20
- };
21
- exports.PresentationDefinitionItemEntity = PresentationDefinitionItemEntity;
22
- __decorate([
23
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
24
- __metadata("design:type", String)
25
- ], PresentationDefinitionItemEntity.prototype, "id", void 0);
26
- __decorate([
27
- (0, typeorm_1.Column)({ name: 'definition_id', length: 255, nullable: false, unique: false }),
28
- (0, class_validator_1.IsNotEmpty)({ message: 'definitionId field must not be empty' }),
29
- __metadata("design:type", String)
30
- ], PresentationDefinitionItemEntity.prototype, "definitionId", void 0);
31
- __decorate([
32
- (0, typeorm_1.Column)({ name: 'version', length: 255, nullable: false, unique: false }),
33
- (0, class_validator_1.IsNotEmpty)({ message: 'version field must not be empty' }),
34
- __metadata("design:type", String)
35
- ], PresentationDefinitionItemEntity.prototype, "version", void 0);
36
- __decorate([
37
- (0, typeorm_1.Column)({ name: 'tenant_id', length: 255, nullable: true, unique: false }),
38
- __metadata("design:type", String)
39
- ], PresentationDefinitionItemEntity.prototype, "tenantId", void 0);
40
- __decorate([
41
- (0, typeorm_1.Column)({ name: 'purpose', length: 255, nullable: true, unique: false }),
42
- __metadata("design:type", String)
43
- ], PresentationDefinitionItemEntity.prototype, "purpose", void 0);
44
- __decorate([
45
- (0, typeorm_1.Column)({ name: 'definition_payload', type: 'text', nullable: false, unique: false }),
46
- (0, class_validator_1.IsNotEmpty)({ message: 'definitionPayload field must not be empty' }),
47
- __metadata("design:type", String)
48
- ], PresentationDefinitionItemEntity.prototype, "definitionPayload", void 0);
49
- __decorate([
50
- (0, typeorm_1.CreateDateColumn)({ name: 'created_at', nullable: false }),
51
- __metadata("design:type", Date)
52
- ], PresentationDefinitionItemEntity.prototype, "createdAt", void 0);
53
- __decorate([
54
- (0, typeorm_1.UpdateDateColumn)({ name: 'last_updated_at', nullable: false }),
55
- __metadata("design:type", Date
56
- // By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
57
- )
58
- ], PresentationDefinitionItemEntity.prototype, "lastUpdatedAt", void 0);
59
- __decorate([
60
- (0, typeorm_1.BeforeInsert)(),
61
- (0, typeorm_1.BeforeUpdate)(),
62
- __metadata("design:type", Function),
63
- __metadata("design:paramtypes", []),
64
- __metadata("design:returntype", void 0)
65
- ], PresentationDefinitionItemEntity.prototype, "updateUpdatedDate", null);
66
- exports.PresentationDefinitionItemEntity = PresentationDefinitionItemEntity = __decorate([
67
- (0, typeorm_1.Entity)('PresentationDefinitionItem'),
68
- (0, typeorm_1.Index)(['version'], { unique: false }),
69
- (0, typeorm_1.Index)(['version'], { unique: false })
70
- ], PresentationDefinitionItemEntity);
71
- //# sourceMappingURL=PresentationDefinitionItemEntity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PresentationDefinitionItemEntity.js","sourceRoot":"","sources":["../../../src/entities/presentationDefinitions/PresentationDefinitionItemEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAmJ;AACnJ,qDAA4C;AAKrC,IAAM,gCAAgC,GAAtC,MAAM,gCAAiC,SAAQ,oBAAU;IA4B9D,qHAAqH;IAGrH,iBAAiB;QACf,IAAI,CAAC,aAAa,GAAG,IAAI,IAAI,EAAE,CAAA;IACjC,CAAC;CACF,CAAA;AAlCY,4EAAgC;AAE3C;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;4DACpB;AAIX;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC9E,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,sCAAsC,EAAE,CAAC;;sEAC3C;AAIrB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACxE,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;;iEAC3C;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;kEACzD;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;iEACxD;AAIhB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACpF,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,2CAA2C,EAAE,CAAC;;2EAC3C;AAG1B;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;8BAC9C,IAAI;mEAAA;AAGhB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;8BAC/C,IAAI;IAEpB,qHAAqH;;uEAFjG;AAKpB;IAFC,IAAA,sBAAY,GAAE;IACd,IAAA,sBAAY,GAAE;;;;yEAGd;2CAjCU,gCAAgC;IAH5C,IAAA,gBAAM,EAAC,4BAA4B,CAAC;IACpC,IAAA,eAAK,EAAC,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACrC,IAAA,eAAK,EAAC,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;GACzB,gCAAgC,CAkC5C"}
@@ -1,7 +0,0 @@
1
- import { MigrationInterface, QueryRunner } from 'typeorm';
2
- export declare class CreatePresentationDefinitions1716533767523 implements MigrationInterface {
3
- name: string;
4
- up(queryRunner: QueryRunner): Promise<void>;
5
- down(queryRunner: QueryRunner): Promise<void>;
6
- }
7
- //# sourceMappingURL=8-CreatePresentationDefinitions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"8-CreatePresentationDefinitions.d.ts","sourceRoot":"","sources":["../../../src/migrations/generic/8-CreatePresentationDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAOvE,qBAAa,0CAA2C,YAAW,kBAAkB;IACnF,IAAI,SAAmD;IAE1C,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA4B3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CA2B3D"}
@@ -1,78 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.CreatePresentationDefinitions1716533767523 = void 0;
16
- const debug_1 = __importDefault(require("debug"));
17
- const _1716475165345_CreatePresentationDefinitions_1 = require("../postgres/1716475165345-CreatePresentationDefinitions");
18
- const _1716475165344_CreatePresentationDefinitions_1 = require("../sqlite/1716475165344-CreatePresentationDefinitions");
19
- const debug = (0, debug_1.default)('sphereon:ssi-sdk:migrations');
20
- class CreatePresentationDefinitions1716533767523 {
21
- constructor() {
22
- this.name = 'CreatePresentationDefinitionItems1716533767523';
23
- }
24
- up(queryRunner) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- debug('migration: creating machine state 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 _1716475165345_CreatePresentationDefinitions_1.CreatePresentationDefinitions1716475165345();
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 _1716475165344_CreatePresentationDefinitions_1.CreatePresentationDefinitions1716475165344();
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 machine state 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 _1716475165345_CreatePresentationDefinitions_1.CreatePresentationDefinitions1716475165345();
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 _1716475165344_CreatePresentationDefinitions_1.CreatePresentationDefinitions1716475165344();
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.CreatePresentationDefinitions1716533767523 = CreatePresentationDefinitions1716533767523;
78
- //# sourceMappingURL=8-CreatePresentationDefinitions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"8-CreatePresentationDefinitions.js","sourceRoot":"","sources":["../../../src/migrations/generic/8-CreatePresentationDefinitions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,kDAAyB;AACzB,0HAAoH;AACpH,wHAAkH;AAElH,MAAM,KAAK,GAAmB,IAAA,eAAK,EAAC,6BAA6B,CAAC,CAAA;AAElE,MAAa,0CAA0C;IAAvD;QACE,SAAI,GAAG,gDAAgD,CAAA;IAyDzD,CAAC;IAvDc,EAAE,CAAC,WAAwB;;YACtC,KAAK,CAAC,0CAA0C,CAAC,CAAA;YACjD,MAAM,MAAM,GAAiB,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAA;YAEvE,QAAQ,MAAM,EAAE,CAAC;gBACf,KAAK,UAAU,CAAC,CAAC,CAAC;oBAChB,KAAK,CAAC,+BAA+B,CAAC,CAAA;oBACtC,MAAM,GAAG,GAA+C,IAAI,yFAA0C,EAAE,CAAA;oBACxG,MAAM,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;oBACzB,KAAK,CAAC,+BAA+B,CAAC,CAAA;oBACtC,OAAM;gBACR,CAAC;gBACD,KAAK,QAAQ,CAAC;gBACd,KAAK,MAAM,CAAC;gBACZ,KAAK,cAAc,CAAC,CAAC,CAAC;oBACpB,KAAK,CAAC,0CAA0C,CAAC,CAAA;oBACjD,MAAM,GAAG,GAA+C,IAAI,yFAA0C,EAAE,CAAA;oBACxG,MAAM,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;oBACzB,KAAK,CAAC,+BAA+B,CAAC,CAAA;oBACtC,OAAM;gBACR,CAAC;gBACD;oBACE,OAAO,OAAO,CAAC,MAAM,CACnB,4FAA4F,MAAM,+GAA+G,CAClN,CAAA;YACL,CAAC;QACH,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACxC,KAAK,CAAC,2CAA2C,CAAC,CAAA;YAClD,MAAM,MAAM,GAAiB,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAA;YAEvE,QAAQ,MAAM,EAAE,CAAC;gBACf,KAAK,UAAU,CAAC,CAAC,CAAC;oBAChB,KAAK,CAAC,+BAA+B,CAAC,CAAA;oBACtC,MAAM,GAAG,GAA+C,IAAI,yFAA0C,EAAE,CAAA;oBACxG,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;oBAC3B,KAAK,CAAC,+BAA+B,CAAC,CAAA;oBACtC,OAAM;gBACR,CAAC;gBACD,KAAK,QAAQ,CAAC;gBACd,KAAK,MAAM,CAAC;gBACZ,KAAK,cAAc,CAAC,CAAC,CAAC;oBACpB,KAAK,CAAC,0CAA0C,CAAC,CAAA;oBACjD,MAAM,GAAG,GAA+C,IAAI,yFAA0C,EAAE,CAAA;oBACxG,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;oBAC3B,KAAK,CAAC,+BAA+B,CAAC,CAAA;oBACtC,OAAM;gBACR,CAAC;gBACD;oBACE,OAAO,OAAO,CAAC,MAAM,CACnB,4FAA4F,MAAM,+GAA+G,CAClN,CAAA;YACL,CAAC;QACH,CAAC;KAAA;CACF;AA1DD,gGA0DC"}
@@ -1,7 +0,0 @@
1
- import { MigrationInterface, QueryRunner } from 'typeorm';
2
- export declare class CreatePresentationDefinitions1716475165345 implements MigrationInterface {
3
- name: string;
4
- up(queryRunner: QueryRunner): Promise<void>;
5
- down(queryRunner: QueryRunner): Promise<void>;
6
- }
7
- //# sourceMappingURL=1716475165345-CreatePresentationDefinitions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1716475165345-CreatePresentationDefinitions.d.ts","sourceRoot":"","sources":["../../../src/migrations/postgres/1716475165345-CreatePresentationDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEzD,qBAAa,0CAA2C,YAAW,kBAAkB;IACnF,IAAI,SAA+C;IAEtC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAe3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3D"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CreatePresentationDefinitions1716475165345 = void 0;
13
- class CreatePresentationDefinitions1716475165345 {
14
- constructor() {
15
- this.name = 'CreatePresentationDefinitions1716475165345';
16
- }
17
- up(queryRunner) {
18
- return __awaiter(this, void 0, void 0, function* () {
19
- yield queryRunner.query(`
20
- CREATE TABLE "PresentationDefinitionItem" (
21
- "id" uuid NOT NULL DEFAULT uuid_generate_v4(),
22
- "tenant_id" TEXT,
23
- "definition_id" TEXT NOT NULL,
24
- "version" TEXT NOT NULL,
25
- "purpose" TEXT,
26
- "definition_payload" TEXT NOT NULL,
27
- "created_at" TIMESTAMP NOT NULL DEFAULT now(),
28
- "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(),
29
- CONSTRAINT "PK_PresentationDefinitionItem_id" PRIMARY KEY ("id"))
30
- `);
31
- });
32
- }
33
- down(queryRunner) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- yield queryRunner.query(`DROP TABLE "PresentationDefinitionItem"`);
36
- });
37
- }
38
- }
39
- exports.CreatePresentationDefinitions1716475165345 = CreatePresentationDefinitions1716475165345;
40
- //# sourceMappingURL=1716475165345-CreatePresentationDefinitions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1716475165345-CreatePresentationDefinitions.js","sourceRoot":"","sources":["../../../src/migrations/postgres/1716475165345-CreatePresentationDefinitions.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,0CAA0C;IAAvD;QACE,SAAI,GAAG,4CAA4C,CAAA;IAoBrD,CAAC;IAlBc,EAAE,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;2CAWe,CAAC,CAAA;QAC1C,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACxC,MAAM,WAAW,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAA;QACpE,CAAC;KAAA;CACF;AArBD,gGAqBC"}
@@ -1,7 +0,0 @@
1
- import { MigrationInterface, QueryRunner } from 'typeorm';
2
- export declare class CreatePresentationDefinitions1716475165344 implements MigrationInterface {
3
- name: string;
4
- up(queryRunner: QueryRunner): Promise<void>;
5
- down(queryRunner: QueryRunner): Promise<void>;
6
- }
7
- //# sourceMappingURL=1716475165344-CreatePresentationDefinitions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1716475165344-CreatePresentationDefinitions.d.ts","sourceRoot":"","sources":["../../../src/migrations/sqlite/1716475165344-CreatePresentationDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEzD,qBAAa,0CAA2C,YAAW,kBAAkB;IACnF,IAAI,SAA+C;IAEtC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAc3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3D"}
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CreatePresentationDefinitions1716475165344 = void 0;
13
- class CreatePresentationDefinitions1716475165344 {
14
- constructor() {
15
- this.name = 'CreatePresentationDefinitions1716475165344';
16
- }
17
- up(queryRunner) {
18
- return __awaiter(this, void 0, void 0, function* () {
19
- yield queryRunner.query(`CREATE TABLE "PresentationDefinitionItem" (
20
- "id" varchar PRIMARY KEY NOT NULL,
21
- "tenant_id" varchar,
22
- "definition_id" varchar NOT NULL,
23
- "version" varchar NOT NULL,
24
- "purpose" varchar,
25
- "definition_payload" varchar NOT NULL,
26
- "created_at" datetime NOT NULL DEFAULT (datetime('now')),
27
- "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')))`);
28
- });
29
- }
30
- down(queryRunner) {
31
- return __awaiter(this, void 0, void 0, function* () {
32
- yield queryRunner.query(`DROP TABLE "PresentationDefinitionItem"`);
33
- });
34
- }
35
- }
36
- exports.CreatePresentationDefinitions1716475165344 = CreatePresentationDefinitions1716475165344;
37
- //# sourceMappingURL=1716475165344-CreatePresentationDefinitions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1716475165344-CreatePresentationDefinitions.js","sourceRoot":"","sources":["../../../src/migrations/sqlite/1716475165344-CreatePresentationDefinitions.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,0CAA0C;IAAvD;QACE,SAAI,GAAG,4CAA4C,CAAA;IAmBrD,CAAC;IAjBc,EAAE,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CACrB;;;;;;;;mEAQ6D,CAC9D,CAAA;QACH,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACxC,MAAM,WAAW,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAA;QACpE,CAAC;KAAA;CACF;AApBD,gGAoBC"}
@@ -1,10 +0,0 @@
1
- import { GetGetDefinitionArgs, GetDefinitionsArgs, DeleteDefinitionArgs } from '../types/pd/IAbstractPDStore';
2
- import { NonPersistedPresentationDefinitionItem, PresentationDefinitionItem } from '../types';
3
- export declare abstract class AbstractPdStore {
4
- abstract getDefinition(args: GetGetDefinitionArgs): Promise<PresentationDefinitionItem>;
5
- abstract getDefinitions(args: GetDefinitionsArgs): Promise<Array<PresentationDefinitionItem>>;
6
- abstract addDefinition(args: NonPersistedPresentationDefinitionItem): Promise<PresentationDefinitionItem>;
7
- abstract updateDefinition(args: PresentationDefinitionItem): Promise<PresentationDefinitionItem>;
8
- abstract deleteDefinition(args: DeleteDefinitionArgs): Promise<void>;
9
- }
10
- //# sourceMappingURL=AbstractPDStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AbstractPDStore.d.ts","sourceRoot":"","sources":["../../src/pd/AbstractPDStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAC7G,OAAO,EAAE,sCAAsC,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAE7F,8BAAsB,eAAe;IACnC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IACvF,QAAQ,CAAC,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC7F,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,sCAAsC,GAAG,OAAO,CAAC,0BAA0B,CAAC;IACzG,QAAQ,CAAC,gBAAgB,CAAC,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAChG,QAAQ,CAAC,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;CACrE"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AbstractPdStore = void 0;
4
- class AbstractPdStore {
5
- }
6
- exports.AbstractPdStore = AbstractPdStore;
7
- //# sourceMappingURL=AbstractPDStore.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AbstractPDStore.js","sourceRoot":"","sources":["../../src/pd/AbstractPDStore.ts"],"names":[],"mappings":";;;AAGA,MAAsB,eAAe;CAMpC;AAND,0CAMC"}
@@ -1,14 +0,0 @@
1
- import { OrPromise } from '@sphereon/ssi-types';
2
- import { DataSource } from 'typeorm';
3
- import { AbstractPdStore } from './AbstractPDStore';
4
- import { GetGetDefinitionArgs, GetDefinitionsArgs, DeleteDefinitionArgs, NonPersistedPresentationDefinitionItem, PresentationDefinitionItem } from '../types';
5
- export declare class PDStore extends AbstractPdStore {
6
- private readonly dbConnection;
7
- constructor(dbConnection: OrPromise<DataSource>);
8
- getDefinition: (args: GetGetDefinitionArgs) => Promise<PresentationDefinitionItem>;
9
- getDefinitions: (args: GetDefinitionsArgs) => Promise<Array<PresentationDefinitionItem>>;
10
- addDefinition: (item: NonPersistedPresentationDefinitionItem) => Promise<PresentationDefinitionItem>;
11
- updateDefinition: (item: PresentationDefinitionItem) => Promise<PresentationDefinitionItem>;
12
- deleteDefinition: (args: DeleteDefinitionArgs) => Promise<void>;
13
- }
14
- //# sourceMappingURL=PDStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PDStore.d.ts","sourceRoot":"","sources":["../../src/pd/PDStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAM,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,sCAAsC,EACtC,0BAA0B,EAC3B,MAAM,UAAU,CAAA;AAMjB,qBAAa,OAAQ,SAAQ,eAAe;IAC1C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAuB;gBAExC,YAAY,EAAE,SAAS,CAAC,UAAU,CAAC;IAK/C,aAAa,SAAgB,oBAAoB,KAAG,QAAQ,0BAA0B,CAAC,CAWtF;IAED,cAAc,SAAgB,kBAAkB,KAAG,QAAQ,MAAM,0BAA0B,CAAC,CAAC,CAiB5F;IAED,aAAa,SAAgB,sCAAsC,KAAG,QAAQ,0BAA0B,CAAC,CAUxG;IAED,gBAAgB,SAAgB,0BAA0B,KAAG,QAAQ,0BAA0B,CAAC,CAiB/F;IAED,gBAAgB,SAAgB,oBAAoB,KAAG,QAAQ,IAAI,CAAC,CAcnE;CACF"}