@sphereon/ssi-sdk.data-store 0.32.1-fix.160 → 0.32.1-next.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/statusList2021/StatusList2021Entity.d.ts +19 -0
- package/dist/entities/statusList2021/StatusList2021Entity.d.ts.map +1 -0
- package/dist/entities/{statusList/StatusListEntities.js → statusList2021/StatusList2021Entity.js} +16 -44
- package/dist/entities/statusList2021/StatusList2021Entity.js.map +1 -0
- package/dist/entities/{statusList → statusList2021}/StatusList2021EntryEntity.d.ts +1 -1
- package/dist/entities/statusList2021/StatusList2021EntryEntity.d.ts.map +1 -0
- package/dist/entities/{statusList → statusList2021}/StatusList2021EntryEntity.js +3 -3
- package/dist/entities/statusList2021/StatusList2021EntryEntity.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/migrations/generic/4-CreateStatusList.d.ts.map +1 -1
- package/dist/migrations/generic/4-CreateStatusList.js +12 -22
- package/dist/migrations/generic/4-CreateStatusList.js.map +1 -1
- package/dist/migrations/postgres/1693866470001-CreateStatusList.d.ts.map +1 -1
- package/dist/migrations/postgres/1693866470001-CreateStatusList.js +7 -43
- package/dist/migrations/postgres/1693866470001-CreateStatusList.js.map +1 -1
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.d.ts.map +1 -1
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.js +5 -45
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.js.map +1 -1
- package/dist/statusList/IStatusListStore.d.ts +2 -2
- package/dist/statusList/IStatusListStore.d.ts.map +1 -1
- package/dist/statusList/StatusListStore.d.ts +7 -8
- package/dist/statusList/StatusListStore.d.ts.map +1 -1
- package/dist/statusList/StatusListStore.js +31 -53
- package/dist/statusList/StatusListStore.js.map +1 -1
- package/dist/types/statusList/IAbstractStatusListStore.d.ts +2 -2
- package/dist/types/statusList/IAbstractStatusListStore.d.ts.map +1 -1
- package/dist/types/statusList/statusList.d.ts +4 -9
- package/dist/types/statusList/statusList.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/entities/{statusList/StatusListEntities.ts → statusList2021/StatusList2021Entity.ts} +18 -37
- package/src/entities/{statusList → statusList2021}/StatusList2021EntryEntity.ts +1 -1
- package/src/index.ts +3 -3
- package/src/migrations/generic/4-CreateStatusList.ts +12 -22
- package/src/migrations/postgres/1693866470001-CreateStatusList.ts +9 -45
- package/src/migrations/sqlite/1693866470000-CreateStatusList.ts +5 -45
- package/src/statusList/IStatusListStore.ts +2 -2
- package/src/statusList/StatusListStore.ts +40 -66
- package/src/types/statusList/IAbstractStatusListStore.ts +2 -2
- package/src/types/statusList/statusList.ts +4 -12
- package/dist/entities/statusList/StatusList2021EntryEntity.d.ts.map +0 -1
- package/dist/entities/statusList/StatusList2021EntryEntity.js.map +0 -1
- package/dist/entities/statusList/StatusListEntities.d.ts +0 -23
- package/dist/entities/statusList/StatusListEntities.d.ts.map +0 -1
- package/dist/entities/statusList/StatusListEntities.js.map +0 -1
- package/dist/migrations/postgres/1737110469001-UpdateStatusList.d.ts +0 -7
- package/dist/migrations/postgres/1737110469001-UpdateStatusList.d.ts.map +0 -1
- package/dist/migrations/postgres/1737110469001-UpdateStatusList.js +0 -39
- package/dist/migrations/postgres/1737110469001-UpdateStatusList.js.map +0 -1
- package/dist/migrations/sqlite/1737110469000-UpdateStatusList.d.ts +0 -7
- package/dist/migrations/sqlite/1737110469000-UpdateStatusList.d.ts.map +0 -1
- package/dist/migrations/sqlite/1737110469000-UpdateStatusList.js +0 -88
- package/dist/migrations/sqlite/1737110469000-UpdateStatusList.js.map +0 -1
- package/dist/utils/statusList/MappingUtils.d.ts +0 -5
- package/dist/utils/statusList/MappingUtils.d.ts.map +0 -1
- package/dist/utils/statusList/MappingUtils.js +0 -69
- package/dist/utils/statusList/MappingUtils.js.map +0 -1
- package/src/__tests__/statusList.entities.test.ts +0 -215
- package/src/__tests__/statusList.store.test.ts +0 -232
- package/src/migrations/postgres/1737110469001-UpdateStatusList.ts +0 -25
- package/src/migrations/sqlite/1737110469000-UpdateStatusList.ts +0 -84
- package/src/utils/statusList/MappingUtils.ts +0 -82
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StatusListEntryEntity } from '../entities/
|
|
1
|
+
import { StatusListEntryEntity } from '../entities/statusList2021/StatusList2021EntryEntity'
|
|
2
2
|
import {
|
|
3
3
|
IAddStatusListArgs,
|
|
4
4
|
IAddStatusListEntryArgs,
|
|
@@ -18,7 +18,7 @@ export interface IStatusListStore {
|
|
|
18
18
|
|
|
19
19
|
getStatusLists(args: IGetStatusListsArgs): Promise<Array<IStatusListEntity>>
|
|
20
20
|
|
|
21
|
-
removeStatusList(args: IRemoveStatusListArgs): Promise<
|
|
21
|
+
removeStatusList(args: IRemoveStatusListArgs): Promise<void>
|
|
22
22
|
|
|
23
23
|
addStatusList(args: IAddStatusListArgs): Promise<IStatusListEntity>
|
|
24
24
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { OrPromise
|
|
1
|
+
import { OrPromise } from '@sphereon/ssi-types'
|
|
2
2
|
import Debug from 'debug'
|
|
3
3
|
import { DataSource, In, Repository } from 'typeorm'
|
|
4
|
-
import {
|
|
5
|
-
import { StatusListEntryEntity } from '../entities/
|
|
4
|
+
import { StatusListEntity } from '../entities/statusList2021/StatusList2021Entity'
|
|
5
|
+
import { StatusListEntryEntity } from '../entities/statusList2021/StatusList2021EntryEntity'
|
|
6
6
|
import {
|
|
7
7
|
IAddStatusListArgs,
|
|
8
8
|
IAddStatusListEntryArgs,
|
|
@@ -12,13 +12,12 @@ import {
|
|
|
12
12
|
IGetStatusListEntryByIndexArgs,
|
|
13
13
|
IGetStatusListsArgs,
|
|
14
14
|
IRemoveStatusListArgs,
|
|
15
|
-
IStatusListEntity,
|
|
16
15
|
IStatusListEntryAvailableArgs,
|
|
17
|
-
IStatusListEntryEntity,
|
|
18
16
|
IUpdateStatusListIndexArgs,
|
|
17
|
+
IStatusListEntity,
|
|
18
|
+
IStatusListEntryEntity,
|
|
19
19
|
} from '../types'
|
|
20
20
|
import { IStatusListStore } from './IStatusListStore'
|
|
21
|
-
import { statusListEntityFrom, statusListFrom } from '../utils/statusList/MappingUtils'
|
|
22
21
|
|
|
23
22
|
const debug = Debug('sphereon:ssi-sdk:data-store:status-list')
|
|
24
23
|
|
|
@@ -74,11 +73,7 @@ export class StatusListStore implements IStatusListStore {
|
|
|
74
73
|
{ conflictPaths: ['statusList', 'statusListIndex'] },
|
|
75
74
|
)
|
|
76
75
|
console.log(updateResult)
|
|
77
|
-
return (await this.getStatusListEntryByIndex({
|
|
78
|
-
...args,
|
|
79
|
-
statusListId,
|
|
80
|
-
errorOnNotFound: true,
|
|
81
|
-
})) as IStatusListEntryEntity
|
|
76
|
+
return (await this.getStatusListEntryByIndex({ ...args, statusListId, errorOnNotFound: true })) as IStatusListEntryEntity
|
|
82
77
|
}
|
|
83
78
|
|
|
84
79
|
async getStatusListEntryByIndex(args: IGetStatusListEntryByIndexArgs): Promise<StatusListEntryEntity | undefined> {
|
|
@@ -101,15 +96,34 @@ export class StatusListStore implements IStatusListStore {
|
|
|
101
96
|
return result ?? undefined
|
|
102
97
|
}
|
|
103
98
|
|
|
99
|
+
async removeStatusListEntryByIndex(args: IGetStatusListEntryByIndexArgs): Promise<boolean> {
|
|
100
|
+
let error = false
|
|
101
|
+
try {
|
|
102
|
+
await this.getStatusListEntryByIndex(args) // only used to check it exists
|
|
103
|
+
} catch (error) {
|
|
104
|
+
error = true
|
|
105
|
+
}
|
|
106
|
+
if (error) {
|
|
107
|
+
console.log(`Could not delete statusList ${args.statusListId} entry by index ${args.statusListIndex}`)
|
|
108
|
+
} else {
|
|
109
|
+
const result = await (
|
|
110
|
+
await this.getStatusListEntryRepo()
|
|
111
|
+
).delete({
|
|
112
|
+
...(args.statusListId && { statusList: args.statusListId }),
|
|
113
|
+
...(args.correlationId && { correlationId: args.correlationId }),
|
|
114
|
+
statusListIndex: args.statusListIndex,
|
|
115
|
+
})
|
|
116
|
+
error = !result.affected || result.affected !== 1
|
|
117
|
+
}
|
|
118
|
+
return !error
|
|
119
|
+
}
|
|
120
|
+
|
|
104
121
|
async getStatusListEntryByCredentialId(args: IGetStatusListEntryByCredentialIdArgs): Promise<StatusListEntryEntity | undefined> {
|
|
105
122
|
const credentialId = args.credentialId
|
|
106
123
|
if (!credentialId) {
|
|
107
124
|
throw Error('Can only get a credential by credentialId when a credentialId is supplied')
|
|
108
125
|
}
|
|
109
|
-
const statusList = await this.getStatusList({
|
|
110
|
-
id: args.statusListId,
|
|
111
|
-
correlationId: args.statusListCorrelationId,
|
|
112
|
-
})
|
|
126
|
+
const statusList = await this.getStatusList({ id: args.statusListId, correlationId: args.statusListCorrelationId })
|
|
113
127
|
const where = {
|
|
114
128
|
statusList: statusList.id,
|
|
115
129
|
...(args.entryCorrelationId && { correlationId: args.entryCorrelationId }),
|
|
@@ -144,37 +158,11 @@ export class StatusListStore implements IStatusListStore {
|
|
|
144
158
|
return !error
|
|
145
159
|
}
|
|
146
160
|
|
|
147
|
-
async removeStatusListEntryByIndex(args: IGetStatusListEntryByIndexArgs): Promise<boolean> {
|
|
148
|
-
let error = false
|
|
149
|
-
try {
|
|
150
|
-
await this.getStatusListEntryByIndex(args)
|
|
151
|
-
} catch (error) {
|
|
152
|
-
error = true
|
|
153
|
-
}
|
|
154
|
-
if (error) {
|
|
155
|
-
console.log(`Could not delete statusList ${args.statusListId} entry by index ${args.statusListIndex}`)
|
|
156
|
-
} else {
|
|
157
|
-
const result = await (
|
|
158
|
-
await this.getStatusListEntryRepo()
|
|
159
|
-
).delete({
|
|
160
|
-
...(args.statusListId && { statusList: args.statusListId }),
|
|
161
|
-
...(args.correlationId && { correlationId: args.correlationId }),
|
|
162
|
-
statusListIndex: args.statusListIndex,
|
|
163
|
-
})
|
|
164
|
-
error = !result.affected || result.affected !== 1
|
|
165
|
-
}
|
|
166
|
-
return !error
|
|
167
|
-
}
|
|
168
|
-
|
|
169
161
|
async getStatusListEntries(args: IGetStatusListEntriesArgs): Promise<StatusListEntryEntity[]> {
|
|
170
162
|
return (await this.getStatusListEntryRepo()).find({ where: { ...args?.filter, statusList: args.statusListId } })
|
|
171
163
|
}
|
|
172
164
|
|
|
173
165
|
async getStatusList(args: IGetStatusListArgs): Promise<IStatusListEntity> {
|
|
174
|
-
return statusListFrom(await this.getStatusListEntity(args))
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
private async getStatusListEntity(args: IGetStatusListArgs): Promise<StatusListEntity> {
|
|
178
166
|
if (!args.id && !args.correlationId) {
|
|
179
167
|
throw Error(`At least and 'id' or 'correlationId' needs to be provided to lookup a status list`)
|
|
180
168
|
}
|
|
@@ -201,8 +189,7 @@ export class StatusListStore implements IStatusListStore {
|
|
|
201
189
|
if (!result) {
|
|
202
190
|
return []
|
|
203
191
|
}
|
|
204
|
-
|
|
205
|
-
return result.map((entity) => statusListFrom(entity))
|
|
192
|
+
return result
|
|
206
193
|
}
|
|
207
194
|
|
|
208
195
|
async addStatusList(args: IAddStatusListArgs): Promise<IStatusListEntity> {
|
|
@@ -218,42 +205,29 @@ export class StatusListStore implements IStatusListStore {
|
|
|
218
205
|
}
|
|
219
206
|
|
|
220
207
|
debug('Adding status list ', id)
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
return
|
|
208
|
+
const createdResult = await (await this.getStatusListRepo()).save(args)
|
|
209
|
+
|
|
210
|
+
return createdResult
|
|
224
211
|
}
|
|
225
212
|
|
|
226
213
|
async updateStatusList(args: IUpdateStatusListIndexArgs): Promise<IStatusListEntity> {
|
|
227
214
|
const result = await this.getStatusList(args)
|
|
228
215
|
debug('Updating status list', result)
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
return statusListFrom(updatedResult)
|
|
216
|
+
const updatedResult = await (await this.getStatusListRepo()).save(args, { transaction: true })
|
|
217
|
+
return updatedResult
|
|
232
218
|
}
|
|
233
219
|
|
|
234
|
-
async removeStatusList(args: IRemoveStatusListArgs): Promise<
|
|
235
|
-
const result = await this.
|
|
236
|
-
|
|
237
|
-
await (await this.getStatusListEntryRepo()).delete({ statusList: result.id })
|
|
238
|
-
const deletedEntity = await (await this.getStatusListRepo()).remove(result)
|
|
239
|
-
|
|
240
|
-
return Boolean(deletedEntity)
|
|
220
|
+
async removeStatusList(args: IRemoveStatusListArgs): Promise<void> {
|
|
221
|
+
const result = await this.getStatusList(args)
|
|
222
|
+
await (await this.getStatusListRepo()).delete(result)
|
|
241
223
|
}
|
|
242
224
|
|
|
243
225
|
private async getDS(): Promise<DataSource> {
|
|
244
226
|
return this._dbConnection
|
|
245
227
|
}
|
|
246
228
|
|
|
247
|
-
async getStatusListRepo(
|
|
248
|
-
|
|
249
|
-
switch (type) {
|
|
250
|
-
case StatusListType.StatusList2021:
|
|
251
|
-
return dataSource.getRepository(StatusList2021Entity)
|
|
252
|
-
case StatusListType.OAuthStatusList:
|
|
253
|
-
return dataSource.getRepository(OAuthStatusListEntity)
|
|
254
|
-
default:
|
|
255
|
-
return dataSource.getRepository(StatusListEntity)
|
|
256
|
-
}
|
|
229
|
+
async getStatusListRepo(): Promise<Repository<StatusListEntity>> {
|
|
230
|
+
return (await this.getDS()).getRepository(StatusListEntity)
|
|
257
231
|
}
|
|
258
232
|
|
|
259
233
|
async getStatusListEntryRepo(): Promise<Repository<StatusListEntryEntity>> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FindOptionsWhere } from 'typeorm'
|
|
2
|
-
import {
|
|
2
|
+
import { IStatusListEntity, IStatusListEntryEntity } from './statusList'
|
|
3
3
|
|
|
4
|
-
export type FindStatusListArgs = FindOptionsWhere<
|
|
4
|
+
export type FindStatusListArgs = FindOptionsWhere<IStatusListEntity>[]
|
|
5
5
|
export type FindStatusListEntryArgs = FindOptionsWhere<IStatusListEntryEntity>[] | FindOptionsWhere<IStatusListEntryEntity>
|
|
6
6
|
|
|
7
7
|
export interface IStatusListEntryAvailableArgs {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
IIssuer,
|
|
3
|
-
|
|
3
|
+
OriginalVerifiableCredential,
|
|
4
4
|
StatusListCredentialIdMode,
|
|
5
5
|
StatusListDriverType,
|
|
6
6
|
StatusListIndexingDirection,
|
|
7
7
|
StatusListType,
|
|
8
8
|
StatusPurpose2021,
|
|
9
|
-
ProofFormat,
|
|
10
9
|
} from '@sphereon/ssi-types'
|
|
11
|
-
import {
|
|
10
|
+
import { ProofFormat } from '@veramo/core'
|
|
11
|
+
import { StatusListEntity } from '../../entities/statusList2021/StatusList2021Entity'
|
|
12
12
|
|
|
13
13
|
export interface IStatusListEntity {
|
|
14
14
|
id: string
|
|
@@ -19,17 +19,9 @@ export interface IStatusListEntity {
|
|
|
19
19
|
issuer: string | IIssuer
|
|
20
20
|
type: StatusListType
|
|
21
21
|
proofFormat: ProofFormat
|
|
22
|
-
statusListCredential?: StatusListCredential
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface IStatusList2021Entity extends IStatusListEntity {
|
|
26
22
|
indexingDirection: StatusListIndexingDirection
|
|
27
23
|
statusPurpose: StatusPurpose2021
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export interface IOAuthStatusListEntity extends IStatusListEntity {
|
|
31
|
-
bitsPerStatus: number
|
|
32
|
-
expiresAt?: Date
|
|
24
|
+
statusListCredential?: OriginalVerifiableCredential
|
|
33
25
|
}
|
|
34
26
|
|
|
35
27
|
export interface IStatusListEntryEntity {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StatusList2021EntryEntity.d.ts","sourceRoot":"","sources":["../../../src/entities/statusList/StatusList2021EntryEntity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAA4C,MAAM,SAAS,CAAA;AAE9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEvD,qBAGa,qBAAsB,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Q,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;6DACzE;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;4DACzE;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;oDACxE;gCAnBH,qBAAqB;IAHjC,IAAA,gBAAM,EAAC,iBAAiB,CAAC;IAC1B,+GAA+G;IAC/G,uHAAuH;GAC1G,qBAAqB,CAoBjC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { IIssuer, StatusListCredential, StatusListCredentialIdMode, StatusListDriverType, StatusListIndexingDirection, StatusPurpose2021, ProofFormat } from '@sphereon/ssi-types';
|
|
2
|
-
import { BaseEntity } from 'typeorm';
|
|
3
|
-
import { StatusListEntryEntity } from './StatusList2021EntryEntity';
|
|
4
|
-
export declare abstract class StatusListEntity extends BaseEntity {
|
|
5
|
-
id: string;
|
|
6
|
-
correlationId: string;
|
|
7
|
-
length: number;
|
|
8
|
-
issuer: string | IIssuer;
|
|
9
|
-
driverType: StatusListDriverType;
|
|
10
|
-
credentialIdMode: StatusListCredentialIdMode;
|
|
11
|
-
proofFormat: ProofFormat;
|
|
12
|
-
statusListCredential?: StatusListCredential;
|
|
13
|
-
statusListEntries: StatusListEntryEntity[];
|
|
14
|
-
}
|
|
15
|
-
export declare class StatusList2021Entity extends StatusListEntity {
|
|
16
|
-
indexingDirection: StatusListIndexingDirection;
|
|
17
|
-
statusPurpose: StatusPurpose2021;
|
|
18
|
-
}
|
|
19
|
-
export declare class OAuthStatusListEntity extends StatusListEntity {
|
|
20
|
-
bitsPerStatus: number;
|
|
21
|
-
expiresAt?: Date;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=StatusListEntities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StatusListEntities.d.ts","sourceRoot":"","sources":["../../../src/entities/statusList/StatusListEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,2BAA2B,EAE3B,iBAAiB,EACjB,WAAW,EACZ,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,UAAU,EAAmF,MAAM,SAAS,CAAA;AACrH,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,8BAGsB,gBAAiB,SAAQ,UAAU;IAEvD,EAAE,EAAG,MAAM,CAAA;IAGX,aAAa,EAAG,MAAM,CAAA;IAGtB,MAAM,EAAG,MAAM,CAAA;IAsBf,MAAM,EAAG,MAAM,GAAG,OAAO,CAAA;IAQzB,UAAU,EAAG,oBAAoB,CAAA;IAQjC,gBAAgB,EAAG,0BAA0B,CAAA;IAG7C,WAAW,EAAG,WAAW,CAAA;IAsBzB,oBAAoB,CAAC,EAAE,oBAAoB,CAAA;IAG3C,iBAAiB,EAAG,qBAAqB,EAAE,CAAA;CAC5C;AAED,qBACa,oBAAqB,SAAQ,gBAAgB;IAQxD,iBAAiB,EAAG,2BAA2B,CAAA;IAG/C,aAAa,EAAG,iBAAiB,CAAA;CAClC;AAED,qBACa,qBAAsB,SAAQ,gBAAgB;IAEzD,aAAa,EAAG,MAAM,CAAA;IAEtB,SAAS,CAAC,EAAE,IAAI,CAAA;CACjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StatusListEntities.js","sourceRoot":"","sources":["../../../src/entities/statusList/StatusListEntities.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAS4B;AAC5B,qCAAqH;AACrH,2EAAmE;AAK5D,IAAe,gB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,MAAM,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,0BAAc,EAAE,EAAE,CAAC;GACpE,gBAAgB,CA2ErC;AAGM,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,gBAAgB;CAYzD,CAAA;AAZY,oDAAoB;AAQ/B;IAPC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,mBAAmB;QACzB,IAAI,EAAE,CAAC,aAAa,CAAC;QACrB,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,aAAa;KACvB,CAAC;;+DAC6C;AAG/C;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;;2DAC1D;+BAXtB,oBAAoB;IADhC,IAAA,qBAAW,EAAC,0BAAc,CAAC,cAAc,CAAC;GAC9B,oBAAoB,CAYhC;AAGM,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,gBAAgB;CAK1D,CAAA;AALY,sDAAqB;AAEhC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;4DAC9C;AAEtB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACpD,IAAI;wDAAA;gCAJL,qBAAqB;IADjC,IAAA,qBAAW,EAAC,0BAAc,CAAC,eAAe,CAAC;GAC/B,qBAAqB,CAKjC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
-
export declare class UpdateStatusList1737110469001 implements MigrationInterface {
|
|
3
|
-
name: string;
|
|
4
|
-
up(queryRunner: QueryRunner): Promise<void>;
|
|
5
|
-
down(queryRunner: QueryRunner): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=1737110469001-UpdateStatusList.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"1737110469001-UpdateStatusList.d.ts","sourceRoot":"","sources":["../../../src/migrations/postgres/1737110469001-UpdateStatusList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEzD,qBAAa,6BAA8B,YAAW,kBAAkB;IACtE,IAAI,SAAkC;IAEzB,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAW3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAQ3D"}
|
|
@@ -1,39 +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.UpdateStatusList1737110469001 = void 0;
|
|
13
|
-
class UpdateStatusList1737110469001 {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.name = 'UpdateStatusList1737110469001';
|
|
16
|
-
}
|
|
17
|
-
up(queryRunner) {
|
|
18
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
// Add new enum value
|
|
20
|
-
yield queryRunner.query(`ALTER TYPE "StatusList_type_enum" ADD VALUE 'OAuthStatusList'`);
|
|
21
|
-
// Make columns nullable and add new columns
|
|
22
|
-
yield queryRunner.query(`ALTER TABLE "StatusList" ALTER COLUMN "indexingDirection" DROP NOT NULL`);
|
|
23
|
-
yield queryRunner.query(`ALTER TABLE "StatusList" ALTER COLUMN "statusPurpose" DROP NOT NULL`);
|
|
24
|
-
yield queryRunner.query(`ALTER TABLE "StatusList" ADD "bitsPerStatus" integer`);
|
|
25
|
-
yield queryRunner.query(`ALTER TABLE "StatusList" ADD "expiresAt" timestamp with time zone`);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
down(queryRunner) {
|
|
29
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
yield queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "expiresAt"`);
|
|
31
|
-
yield queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "bitsPerStatus"`);
|
|
32
|
-
yield queryRunner.query(`ALTER TABLE "StatusList" ALTER COLUMN "statusPurpose" SET NOT NULL`);
|
|
33
|
-
yield queryRunner.query(`ALTER TABLE "StatusList" ALTER COLUMN "indexingDirection" SET NOT NULL`);
|
|
34
|
-
// Note: Cannot remove enum value in Postgres, would need to recreate the type
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.UpdateStatusList1737110469001 = UpdateStatusList1737110469001;
|
|
39
|
-
//# sourceMappingURL=1737110469001-UpdateStatusList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"1737110469001-UpdateStatusList.js","sourceRoot":"","sources":["../../../src/migrations/postgres/1737110469001-UpdateStatusList.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,6BAA6B;IAA1C;QACE,SAAI,GAAG,+BAA+B,CAAA;IAqBxC,CAAC;IAnBc,EAAE,CAAC,WAAwB;;YACtC,qBAAqB;YACrB,MAAM,WAAW,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAA;YAExF,4CAA4C;YAC5C,MAAM,WAAW,CAAC,KAAK,CAAC,yEAAyE,CAAC,CAAA;YAClG,MAAM,WAAW,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAA;YAC9F,MAAM,WAAW,CAAC,KAAK,CAAC,sDAAsD,CAAC,CAAA;YAC/E,MAAM,WAAW,CAAC,KAAK,CAAC,mEAAmE,CAAC,CAAA;QAC9F,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACxC,MAAM,WAAW,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAA;YAC3E,MAAM,WAAW,CAAC,KAAK,CAAC,sDAAsD,CAAC,CAAA;YAC/E,MAAM,WAAW,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAA;YAC7F,MAAM,WAAW,CAAC,KAAK,CAAC,wEAAwE,CAAC,CAAA;YAEjG,8EAA8E;QAChF,CAAC;KAAA;CACF;AAtBD,sEAsBC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
-
export declare class UpdateStatusList1737110469000 implements MigrationInterface {
|
|
3
|
-
name: string;
|
|
4
|
-
up(queryRunner: QueryRunner): Promise<void>;
|
|
5
|
-
down(queryRunner: QueryRunner): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=1737110469000-UpdateStatusList.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"1737110469000-UpdateStatusList.d.ts","sourceRoot":"","sources":["../../../src/migrations/sqlite/1737110469000-UpdateStatusList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEzD,qBAAa,6BAA8B,YAAW,kBAAkB;IACtE,IAAI,SAAkC;IAEzB,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAwC3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAsC3D"}
|
|
@@ -1,88 +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.UpdateStatusList1737110469000 = void 0;
|
|
13
|
-
class UpdateStatusList1737110469000 {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.name = 'UpdateStatusList1737110469000';
|
|
16
|
-
}
|
|
17
|
-
up(queryRunner) {
|
|
18
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
// Create temporary table with new schema
|
|
20
|
-
yield queryRunner.query(`CREATE TABLE "temporary_StatusList" (
|
|
21
|
-
"id" varchar PRIMARY KEY NOT NULL,
|
|
22
|
-
"correlationId" varchar NOT NULL,
|
|
23
|
-
"length" integer NOT NULL,
|
|
24
|
-
"issuer" text NOT NULL,
|
|
25
|
-
"type" varchar CHECK( "type" IN ('StatusList2021', 'OAuthStatusList') ) NOT NULL DEFAULT ('StatusList2021'),
|
|
26
|
-
"driverType" varchar CHECK( "driverType" IN ('agent_typeorm','agent_kv_store','github','agent_filesystem') ) NOT NULL DEFAULT ('agent_typeorm'),
|
|
27
|
-
"credentialIdMode" varchar CHECK( "credentialIdMode" IN ('ISSUANCE','PERSISTENCE','NEVER') ) NOT NULL DEFAULT ('ISSUANCE'),
|
|
28
|
-
"proofFormat" varchar CHECK( "proofFormat" IN ('lds','jwt') ) NOT NULL DEFAULT ('lds'),
|
|
29
|
-
"indexingDirection" varchar CHECK( "indexingDirection" IN ('rightToLeft') ),
|
|
30
|
-
"statusPurpose" varchar,
|
|
31
|
-
"statusListCredential" text,
|
|
32
|
-
"bitsPerStatus" integer,
|
|
33
|
-
"expiresAt" datetime,
|
|
34
|
-
CONSTRAINT "UQ_correlationId" UNIQUE ("correlationId")
|
|
35
|
-
)`);
|
|
36
|
-
// Copy data from old table to temporary table
|
|
37
|
-
yield queryRunner.query(`INSERT INTO "temporary_StatusList"(
|
|
38
|
-
"id", "correlationId", "length", "issuer", "type", "driverType",
|
|
39
|
-
"credentialIdMode", "proofFormat", "indexingDirection", "statusPurpose",
|
|
40
|
-
"statusListCredential"
|
|
41
|
-
)
|
|
42
|
-
SELECT
|
|
43
|
-
"id", "correlationId", "length", "issuer", "type", "driverType",
|
|
44
|
-
"credentialIdMode", "proofFormat", "indexingDirection", "statusPurpose",
|
|
45
|
-
"statusListCredential"
|
|
46
|
-
FROM "StatusList"`);
|
|
47
|
-
// Drop old table and rename temporary table
|
|
48
|
-
yield queryRunner.query(`DROP TABLE "StatusList"`);
|
|
49
|
-
yield queryRunner.query(`ALTER TABLE "temporary_StatusList" RENAME TO "StatusList"`);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
down(queryRunner) {
|
|
53
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
// Create temporary table with old schema
|
|
55
|
-
yield queryRunner.query(`CREATE TABLE "temporary_StatusList" (
|
|
56
|
-
"id" varchar PRIMARY KEY NOT NULL,
|
|
57
|
-
"correlationId" varchar NOT NULL,
|
|
58
|
-
"length" integer NOT NULL,
|
|
59
|
-
"issuer" text NOT NULL,
|
|
60
|
-
"type" varchar CHECK( "type" IN ('StatusList2021') ) NOT NULL DEFAULT ('StatusList2021'),
|
|
61
|
-
"driverType" varchar CHECK( "driverType" IN ('agent_typeorm','agent_kv_store','github','agent_filesystem') ) NOT NULL DEFAULT ('agent_typeorm'),
|
|
62
|
-
"credentialIdMode" varchar CHECK( "credentialIdMode" IN ('ISSUANCE','PERSISTENCE','NEVER') ) NOT NULL DEFAULT ('ISSUANCE'),
|
|
63
|
-
"proofFormat" varchar CHECK( "proofFormat" IN ('lds','jwt') ) NOT NULL DEFAULT ('lds'),
|
|
64
|
-
"indexingDirection" varchar CHECK( "indexingDirection" IN ('rightToLeft') ) NOT NULL DEFAULT ('rightToLeft'),
|
|
65
|
-
"statusPurpose" varchar NOT NULL DEFAULT ('revocation'),
|
|
66
|
-
"statusListCredential" text,
|
|
67
|
-
CONSTRAINT "UQ_correlationId" UNIQUE ("correlationId")
|
|
68
|
-
)`);
|
|
69
|
-
// Copy data back, excluding new columns
|
|
70
|
-
yield queryRunner.query(`INSERT INTO "temporary_StatusList"(
|
|
71
|
-
"id", "correlationId", "length", "issuer", "type", "driverType",
|
|
72
|
-
"credentialIdMode", "proofFormat", "indexingDirection", "statusPurpose",
|
|
73
|
-
"statusListCredential"
|
|
74
|
-
)
|
|
75
|
-
SELECT
|
|
76
|
-
"id", "correlationId", "length", "issuer",
|
|
77
|
-
CASE WHEN "type" = 'OAuthStatusList' THEN 'StatusList2021' ELSE "type" END,
|
|
78
|
-
"driverType", "credentialIdMode", "proofFormat", "indexingDirection",
|
|
79
|
-
COALESCE("statusPurpose", 'revocation'), "statusListCredential"
|
|
80
|
-
FROM "StatusList"`);
|
|
81
|
-
// Drop new table and rename temporary table back
|
|
82
|
-
yield queryRunner.query(`DROP TABLE "StatusList"`);
|
|
83
|
-
yield queryRunner.query(`ALTER TABLE "temporary_StatusList" RENAME TO "StatusList"`);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
exports.UpdateStatusList1737110469000 = UpdateStatusList1737110469000;
|
|
88
|
-
//# sourceMappingURL=1737110469000-UpdateStatusList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"1737110469000-UpdateStatusList.js","sourceRoot":"","sources":["../../../src/migrations/sqlite/1737110469000-UpdateStatusList.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,6BAA6B;IAA1C;QACE,SAAI,GAAG,+BAA+B,CAAA;IAgFxC,CAAC;IA9Ec,EAAE,CAAC,WAAwB;;YACtC,yCAAyC;YACzC,MAAM,WAAW,CAAC,KAAK,CACrB;;;;;;;;;;;;;;;cAeQ,CACT,CAAA;YAED,8CAA8C;YAC9C,MAAM,WAAW,CAAC,KAAK,CACrB;;;;;;;;;8BASwB,CACzB,CAAA;YAED,4CAA4C;YAC5C,MAAM,WAAW,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;YAClD,MAAM,WAAW,CAAC,KAAK,CAAC,2DAA2D,CAAC,CAAA;QACtF,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACxC,yCAAyC;YACzC,MAAM,WAAW,CAAC,KAAK,CACrB;;;;;;;;;;;;;cAaQ,CACT,CAAA;YAED,wCAAwC;YACxC,MAAM,WAAW,CAAC,KAAK,CACrB;;;;;;;;;;8BAUwB,CACzB,CAAA;YAED,iDAAiD;YACjD,MAAM,WAAW,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;YAClD,MAAM,WAAW,CAAC,KAAK,CAAC,2DAA2D,CAAC,CAAA;QACtF,CAAC;KAAA;CACF;AAjFD,sEAiFC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { IStatusListEntity } from '../../types';
|
|
2
|
-
import { StatusListEntity } from '../../entities/statusList/StatusListEntities';
|
|
3
|
-
export declare const statusListEntityFrom: (args: IStatusListEntity) => StatusListEntity;
|
|
4
|
-
export declare const statusListFrom: (entity: StatusListEntity) => IStatusListEntity;
|
|
5
|
-
//# sourceMappingURL=MappingUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MappingUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/statusList/MappingUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC9F,OAAO,EAA+C,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AAI5H,eAAO,MAAM,oBAAoB,SAAU,iBAAiB,KAAG,gBA8B9D,CAAA;AAED,eAAO,MAAM,cAAc,WAAY,gBAAgB,KAAG,iBAsBzD,CAAA"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.statusListFrom = exports.statusListEntityFrom = void 0;
|
|
4
|
-
const StatusListEntities_1 = require("../../entities/statusList/StatusListEntities");
|
|
5
|
-
const ssi_types_1 = require("@sphereon/ssi-types");
|
|
6
|
-
const FormattingUtils_1 = require("../FormattingUtils");
|
|
7
|
-
const statusListEntityFrom = (args) => {
|
|
8
|
-
if (args.type === ssi_types_1.StatusListType.StatusList2021) {
|
|
9
|
-
const entity = new StatusListEntities_1.StatusList2021Entity();
|
|
10
|
-
const sl2021 = args;
|
|
11
|
-
entity.indexingDirection = sl2021.indexingDirection;
|
|
12
|
-
entity.statusPurpose = sl2021.statusPurpose;
|
|
13
|
-
setBaseFields(entity, args);
|
|
14
|
-
Object.defineProperty(entity, 'type', {
|
|
15
|
-
value: ssi_types_1.StatusListType.StatusList2021,
|
|
16
|
-
enumerable: true,
|
|
17
|
-
configurable: true,
|
|
18
|
-
});
|
|
19
|
-
return entity;
|
|
20
|
-
}
|
|
21
|
-
if (args.type === ssi_types_1.StatusListType.OAuthStatusList) {
|
|
22
|
-
const entity = new StatusListEntities_1.OAuthStatusListEntity();
|
|
23
|
-
const oauthSl = args;
|
|
24
|
-
entity.bitsPerStatus = oauthSl.bitsPerStatus;
|
|
25
|
-
entity.expiresAt = oauthSl.expiresAt;
|
|
26
|
-
setBaseFields(entity, args);
|
|
27
|
-
Object.defineProperty(entity, 'type', {
|
|
28
|
-
value: ssi_types_1.StatusListType.OAuthStatusList,
|
|
29
|
-
enumerable: true,
|
|
30
|
-
configurable: true,
|
|
31
|
-
});
|
|
32
|
-
return entity;
|
|
33
|
-
}
|
|
34
|
-
throw new Error(`Invalid status list type ${args.type}`);
|
|
35
|
-
};
|
|
36
|
-
exports.statusListEntityFrom = statusListEntityFrom;
|
|
37
|
-
const statusListFrom = (entity) => {
|
|
38
|
-
if (entity instanceof StatusListEntities_1.StatusList2021Entity) {
|
|
39
|
-
const result = Object.assign(Object.assign({}, getBaseFields(entity)), { type: ssi_types_1.StatusListType.StatusList2021, indexingDirection: entity.indexingDirection, statusPurpose: entity.statusPurpose });
|
|
40
|
-
return (0, FormattingUtils_1.replaceNullWithUndefined)(result);
|
|
41
|
-
}
|
|
42
|
-
if (entity instanceof StatusListEntities_1.OAuthStatusListEntity) {
|
|
43
|
-
const result = Object.assign(Object.assign({}, getBaseFields(entity)), { type: ssi_types_1.StatusListType.OAuthStatusList, bitsPerStatus: entity.bitsPerStatus, expiresAt: entity.expiresAt });
|
|
44
|
-
return (0, FormattingUtils_1.replaceNullWithUndefined)(result);
|
|
45
|
-
}
|
|
46
|
-
throw new Error(`Invalid status list type ${typeof entity}`);
|
|
47
|
-
};
|
|
48
|
-
exports.statusListFrom = statusListFrom;
|
|
49
|
-
const setBaseFields = (entity, args) => {
|
|
50
|
-
entity.id = args.id;
|
|
51
|
-
entity.correlationId = args.correlationId;
|
|
52
|
-
entity.length = args.length;
|
|
53
|
-
entity.issuer = args.issuer;
|
|
54
|
-
entity.driverType = args.driverType;
|
|
55
|
-
entity.credentialIdMode = args.credentialIdMode;
|
|
56
|
-
entity.proofFormat = args.proofFormat;
|
|
57
|
-
entity.statusListCredential = args.statusListCredential;
|
|
58
|
-
};
|
|
59
|
-
const getBaseFields = (entity) => ({
|
|
60
|
-
id: entity.id,
|
|
61
|
-
correlationId: entity.correlationId,
|
|
62
|
-
length: entity.length,
|
|
63
|
-
issuer: entity.issuer,
|
|
64
|
-
driverType: entity.driverType,
|
|
65
|
-
credentialIdMode: entity.credentialIdMode,
|
|
66
|
-
proofFormat: entity.proofFormat,
|
|
67
|
-
statusListCredential: entity.statusListCredential,
|
|
68
|
-
});
|
|
69
|
-
//# sourceMappingURL=MappingUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MappingUtils.js","sourceRoot":"","sources":["../../../src/utils/statusList/MappingUtils.ts"],"names":[],"mappings":";;;AACA,qFAA4H;AAC5H,mDAAoD;AACpD,wDAA6D;AAEtD,MAAM,oBAAoB,GAAG,CAAC,IAAuB,EAAoB,EAAE;IAChF,IAAI,IAAI,CAAC,IAAI,KAAK,0BAAc,CAAC,cAAc,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,yCAAoB,EAAE,CAAA;QACzC,MAAM,MAAM,GAAG,IAA6B,CAAA;QAC5C,MAAM,CAAC,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAA;QACnD,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAA;QAC3C,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QAC3B,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE;YACpC,KAAK,EAAE,0BAAc,CAAC,cAAc;YACpC,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,IAAI;SACnB,CAAC,CAAA;QACF,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,KAAK,0BAAc,CAAC,eAAe,EAAE,CAAC;QACjD,MAAM,MAAM,GAAG,IAAI,0CAAqB,EAAE,CAAA;QAC1C,MAAM,OAAO,GAAG,IAA8B,CAAA;QAC9C,MAAM,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAA;QAC5C,MAAM,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAA;QACpC,aAAa,CAAC,MAAM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