@sphereon/ssi-sdk.data-store 0.34.1-feature.SSISDK.17.bitstring.sl.2 → 0.34.1-feature.SSISDK.17.bitstring.sl.7
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/index.cjs +86 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -12
- package/dist/index.d.ts +15 -12
- package/dist/index.js +19 -19
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/__tests__/statusList.entities.test.ts +4 -4
- package/src/__tests__/statusList.store.test.ts +1 -1
- package/src/entities/statusList/BitstringStatusListEntryEntity.ts +4 -5
- package/src/entities/statusList/StatusListEntities.ts +7 -8
- package/src/migrations/postgres/1741895823000-CreateBitstringStatusList.ts +3 -3
- package/src/migrations/sqlite/1741895823001-CreateBitstringStatusList.ts +2 -3
- package/src/statusList/StatusListStore.ts +1 -1
- package/src/types/index.ts +1 -0
- package/src/types/statusList/bitstringTypes.ts +7 -0
- package/src/types/statusList/statusList.ts +3 -8
- package/src/utils/statusList/MappingUtils.ts +6 -2
package/dist/index.cjs
CHANGED
|
@@ -2857,7 +2857,7 @@ IssuerLocaleBrandingEntity = _ts_decorate25([
|
|
|
2857
2857
|
], IssuerLocaleBrandingEntity);
|
|
2858
2858
|
|
|
2859
2859
|
// src/entities/statusList/StatusListEntities.ts
|
|
2860
|
-
var
|
|
2860
|
+
var import_ssi_types = require("@sphereon/ssi-types");
|
|
2861
2861
|
var import_typeorm27 = __toESM(require("typeorm"), 1);
|
|
2862
2862
|
|
|
2863
2863
|
// src/entities/statusList/StatusList2021EntryEntity.ts
|
|
@@ -2965,7 +2965,6 @@ var import_ssi_sdk13 = require("@sphereon/ssi-sdk.agent-config");
|
|
|
2965
2965
|
// src/entities/statusList/BitstringStatusListEntryEntity.ts
|
|
2966
2966
|
var import_class_validator19 = require("class-validator");
|
|
2967
2967
|
var import_typeorm26 = require("typeorm");
|
|
2968
|
-
var import_ssi_types = require("@sphereon/ssi-types");
|
|
2969
2968
|
function _ts_decorate27(decorators, target, key, desc) {
|
|
2970
2969
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2971
2970
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2988,7 +2987,7 @@ var BitstringStatusListEntryEntity = class extends import_typeorm26.BaseEntity {
|
|
|
2988
2987
|
credentialHash;
|
|
2989
2988
|
entryCorrelationId;
|
|
2990
2989
|
statusPurpose;
|
|
2991
|
-
|
|
2990
|
+
bitsPerStatus;
|
|
2992
2991
|
statusMessage;
|
|
2993
2992
|
statusReference;
|
|
2994
2993
|
};
|
|
@@ -3054,17 +3053,17 @@ _ts_decorate27([
|
|
|
3054
3053
|
name: "statusPurpose",
|
|
3055
3054
|
nullable: false
|
|
3056
3055
|
}),
|
|
3057
|
-
_ts_metadata26("design:type",
|
|
3056
|
+
_ts_metadata26("design:type", String)
|
|
3058
3057
|
], BitstringStatusListEntryEntity.prototype, "statusPurpose", void 0);
|
|
3059
3058
|
_ts_decorate27([
|
|
3060
3059
|
(0, import_typeorm26.Column)({
|
|
3061
3060
|
type: "integer",
|
|
3062
|
-
name: "
|
|
3061
|
+
name: "bitsPerStatus",
|
|
3063
3062
|
nullable: true,
|
|
3064
3063
|
default: 1
|
|
3065
3064
|
}),
|
|
3066
3065
|
_ts_metadata26("design:type", Number)
|
|
3067
|
-
], BitstringStatusListEntryEntity.prototype, "
|
|
3066
|
+
], BitstringStatusListEntryEntity.prototype, "bitsPerStatus", void 0);
|
|
3068
3067
|
_ts_decorate27([
|
|
3069
3068
|
(0, import_typeorm26.Column)({
|
|
3070
3069
|
type: "text",
|
|
@@ -3195,20 +3194,20 @@ _ts_decorate28([
|
|
|
3195
3194
|
_ts_decorate28([
|
|
3196
3195
|
Column25("simple-enum", {
|
|
3197
3196
|
name: "driverType",
|
|
3198
|
-
enum:
|
|
3197
|
+
enum: import_ssi_types.StatusListDriverType,
|
|
3199
3198
|
nullable: false,
|
|
3200
|
-
default:
|
|
3199
|
+
default: import_ssi_types.StatusListDriverType.AGENT_TYPEORM
|
|
3201
3200
|
}),
|
|
3202
|
-
_ts_metadata27("design:type", typeof
|
|
3201
|
+
_ts_metadata27("design:type", typeof import_ssi_types.StatusListDriverType === "undefined" ? Object : import_ssi_types.StatusListDriverType)
|
|
3203
3202
|
], StatusListEntity.prototype, "driverType", void 0);
|
|
3204
3203
|
_ts_decorate28([
|
|
3205
3204
|
Column25("simple-enum", {
|
|
3206
3205
|
name: "credentialIdMode",
|
|
3207
|
-
enum:
|
|
3206
|
+
enum: import_ssi_types.StatusListCredentialIdMode,
|
|
3208
3207
|
nullable: false,
|
|
3209
|
-
default:
|
|
3208
|
+
default: import_ssi_types.StatusListCredentialIdMode.ISSUANCE
|
|
3210
3209
|
}),
|
|
3211
|
-
_ts_metadata27("design:type", typeof
|
|
3210
|
+
_ts_metadata27("design:type", typeof import_ssi_types.StatusListCredentialIdMode === "undefined" ? Object : import_ssi_types.StatusListCredentialIdMode)
|
|
3212
3211
|
], StatusListEntity.prototype, "credentialIdMode", void 0);
|
|
3213
3212
|
_ts_decorate28([
|
|
3214
3213
|
Column25({
|
|
@@ -3255,7 +3254,7 @@ StatusListEntity = _ts_decorate28([
|
|
|
3255
3254
|
column: {
|
|
3256
3255
|
type: "simple-enum",
|
|
3257
3256
|
name: "type",
|
|
3258
|
-
enum:
|
|
3257
|
+
enum: import_ssi_types.StatusListType
|
|
3259
3258
|
}
|
|
3260
3259
|
})
|
|
3261
3260
|
], StatusListEntity);
|
|
@@ -3293,7 +3292,7 @@ _ts_decorate28([
|
|
|
3293
3292
|
_ts_metadata27("design:type", Array)
|
|
3294
3293
|
], StatusList2021Entity.prototype, "statusListEntries", void 0);
|
|
3295
3294
|
StatusList2021Entity = _ts_decorate28([
|
|
3296
|
-
ChildEntity5(
|
|
3295
|
+
ChildEntity5(import_ssi_types.StatusListType.StatusList2021)
|
|
3297
3296
|
], StatusList2021Entity);
|
|
3298
3297
|
var OAuthStatusListEntity = class extends StatusListEntity {
|
|
3299
3298
|
static {
|
|
@@ -3319,14 +3318,14 @@ _ts_decorate28([
|
|
|
3319
3318
|
_ts_metadata27("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3320
3319
|
], OAuthStatusListEntity.prototype, "expiresAt", void 0);
|
|
3321
3320
|
OAuthStatusListEntity = _ts_decorate28([
|
|
3322
|
-
ChildEntity5(
|
|
3321
|
+
ChildEntity5(import_ssi_types.StatusListType.OAuthStatusList)
|
|
3323
3322
|
], OAuthStatusListEntity);
|
|
3324
3323
|
var BitstringStatusListEntity = class extends StatusListEntity {
|
|
3325
3324
|
static {
|
|
3326
3325
|
__name(this, "BitstringStatusListEntity");
|
|
3327
3326
|
}
|
|
3328
3327
|
statusPurpose;
|
|
3329
|
-
|
|
3328
|
+
bitsPerStatus;
|
|
3330
3329
|
validFrom;
|
|
3331
3330
|
validUntil;
|
|
3332
3331
|
ttl;
|
|
@@ -3357,12 +3356,11 @@ _ts_decorate28([
|
|
|
3357
3356
|
_ts_decorate28([
|
|
3358
3357
|
Column25({
|
|
3359
3358
|
type: "integer",
|
|
3360
|
-
name: "
|
|
3361
|
-
nullable:
|
|
3362
|
-
default: 1
|
|
3359
|
+
name: "bitsPerStatus",
|
|
3360
|
+
nullable: false
|
|
3363
3361
|
}),
|
|
3364
3362
|
_ts_metadata27("design:type", Number)
|
|
3365
|
-
], BitstringStatusListEntity.prototype, "
|
|
3363
|
+
], BitstringStatusListEntity.prototype, "bitsPerStatus", void 0);
|
|
3366
3364
|
_ts_decorate28([
|
|
3367
3365
|
Column25({
|
|
3368
3366
|
name: "validFrom",
|
|
@@ -3392,7 +3390,7 @@ _ts_decorate28([
|
|
|
3392
3390
|
_ts_metadata27("design:type", Array)
|
|
3393
3391
|
], BitstringStatusListEntity.prototype, "statusListEntries", void 0);
|
|
3394
3392
|
BitstringStatusListEntity = _ts_decorate28([
|
|
3395
|
-
ChildEntity5(
|
|
3393
|
+
ChildEntity5(import_ssi_types.StatusListType.BitstringStatusList)
|
|
3396
3394
|
], BitstringStatusListEntity);
|
|
3397
3395
|
|
|
3398
3396
|
// src/entities/machineState/MachineStateInfoEntity.ts
|
|
@@ -3718,7 +3716,7 @@ NaturalPersonEntity = _ts_decorate31([
|
|
|
3718
3716
|
], NaturalPersonEntity);
|
|
3719
3717
|
|
|
3720
3718
|
// src/entities/eventLogger/AuditEventEntity.ts
|
|
3721
|
-
var
|
|
3719
|
+
var import_ssi_types2 = require("@sphereon/ssi-types");
|
|
3722
3720
|
var import_ssi_sdk15 = require("@sphereon/ssi-sdk.core");
|
|
3723
3721
|
var import_ssi_sdk16 = require("@sphereon/ssi-sdk.agent-config");
|
|
3724
3722
|
var import_typeorm31 = require("typeorm");
|
|
@@ -3780,20 +3778,20 @@ _ts_decorate32([
|
|
|
3780
3778
|
_ts_decorate32([
|
|
3781
3779
|
(0, import_typeorm31.Column)("simple-enum", {
|
|
3782
3780
|
name: "eventType",
|
|
3783
|
-
enum:
|
|
3781
|
+
enum: import_ssi_types2.LoggingEventType,
|
|
3784
3782
|
nullable: false,
|
|
3785
3783
|
unique: false
|
|
3786
3784
|
}),
|
|
3787
|
-
_ts_metadata31("design:type", typeof
|
|
3785
|
+
_ts_metadata31("design:type", typeof import_ssi_types2.LoggingEventType === "undefined" ? Object : import_ssi_types2.LoggingEventType)
|
|
3788
3786
|
], AuditEventEntity.prototype, "type", void 0);
|
|
3789
3787
|
_ts_decorate32([
|
|
3790
3788
|
(0, import_typeorm31.Column)("simple-enum", {
|
|
3791
3789
|
name: "level",
|
|
3792
|
-
enum:
|
|
3790
|
+
enum: import_ssi_types2.LogLevel,
|
|
3793
3791
|
nullable: false,
|
|
3794
3792
|
unique: false
|
|
3795
3793
|
}),
|
|
3796
|
-
_ts_metadata31("design:type", typeof
|
|
3794
|
+
_ts_metadata31("design:type", typeof import_ssi_types2.LogLevel === "undefined" ? Object : import_ssi_types2.LogLevel)
|
|
3797
3795
|
], AuditEventEntity.prototype, "level", void 0);
|
|
3798
3796
|
_ts_decorate32([
|
|
3799
3797
|
(0, import_typeorm31.Column)("text", {
|
|
@@ -3806,29 +3804,29 @@ _ts_decorate32([
|
|
|
3806
3804
|
_ts_decorate32([
|
|
3807
3805
|
(0, import_typeorm31.Column)("simple-enum", {
|
|
3808
3806
|
name: "system",
|
|
3809
|
-
enum:
|
|
3807
|
+
enum: import_ssi_types2.System,
|
|
3810
3808
|
nullable: false,
|
|
3811
3809
|
unique: false
|
|
3812
3810
|
}),
|
|
3813
|
-
_ts_metadata31("design:type", typeof
|
|
3811
|
+
_ts_metadata31("design:type", typeof import_ssi_types2.System === "undefined" ? Object : import_ssi_types2.System)
|
|
3814
3812
|
], AuditEventEntity.prototype, "system", void 0);
|
|
3815
3813
|
_ts_decorate32([
|
|
3816
3814
|
(0, import_typeorm31.Column)("simple-enum", {
|
|
3817
3815
|
name: "subSystemType",
|
|
3818
|
-
enum:
|
|
3816
|
+
enum: import_ssi_types2.SubSystem,
|
|
3819
3817
|
nullable: false,
|
|
3820
3818
|
unique: false
|
|
3821
3819
|
}),
|
|
3822
|
-
_ts_metadata31("design:type", typeof
|
|
3820
|
+
_ts_metadata31("design:type", typeof import_ssi_types2.SubSystem === "undefined" ? Object : import_ssi_types2.SubSystem)
|
|
3823
3821
|
], AuditEventEntity.prototype, "subSystemType", void 0);
|
|
3824
3822
|
_ts_decorate32([
|
|
3825
3823
|
(0, import_typeorm31.Column)("simple-enum", {
|
|
3826
3824
|
name: "actionType",
|
|
3827
|
-
enum:
|
|
3825
|
+
enum: import_ssi_types2.ActionType,
|
|
3828
3826
|
nullable: false,
|
|
3829
3827
|
unique: false
|
|
3830
3828
|
}),
|
|
3831
|
-
_ts_metadata31("design:type", typeof
|
|
3829
|
+
_ts_metadata31("design:type", typeof import_ssi_types2.ActionType === "undefined" ? Object : import_ssi_types2.ActionType)
|
|
3832
3830
|
], AuditEventEntity.prototype, "actionType", void 0);
|
|
3833
3831
|
_ts_decorate32([
|
|
3834
3832
|
(0, import_typeorm31.Column)({
|
|
@@ -3842,20 +3840,20 @@ _ts_decorate32([
|
|
|
3842
3840
|
_ts_decorate32([
|
|
3843
3841
|
(0, import_typeorm31.Column)("simple-enum", {
|
|
3844
3842
|
name: "initiatorType",
|
|
3845
|
-
enum:
|
|
3843
|
+
enum: import_ssi_types2.InitiatorType,
|
|
3846
3844
|
nullable: false,
|
|
3847
3845
|
unique: false
|
|
3848
3846
|
}),
|
|
3849
|
-
_ts_metadata31("design:type", typeof
|
|
3847
|
+
_ts_metadata31("design:type", typeof import_ssi_types2.InitiatorType === "undefined" ? Object : import_ssi_types2.InitiatorType)
|
|
3850
3848
|
], AuditEventEntity.prototype, "initiatorType", void 0);
|
|
3851
3849
|
_ts_decorate32([
|
|
3852
3850
|
(0, import_typeorm31.Column)("simple-enum", {
|
|
3853
3851
|
name: "systemCorrelationIdType",
|
|
3854
|
-
enum:
|
|
3852
|
+
enum: import_ssi_types2.SystemCorrelationIdType,
|
|
3855
3853
|
nullable: true,
|
|
3856
3854
|
unique: false
|
|
3857
3855
|
}),
|
|
3858
|
-
_ts_metadata31("design:type", typeof
|
|
3856
|
+
_ts_metadata31("design:type", typeof import_ssi_types2.SystemCorrelationIdType === "undefined" ? Object : import_ssi_types2.SystemCorrelationIdType)
|
|
3859
3857
|
], AuditEventEntity.prototype, "systemCorrelationIdType", void 0);
|
|
3860
3858
|
_ts_decorate32([
|
|
3861
3859
|
(0, import_typeorm31.Column)("text", {
|
|
@@ -6231,50 +6229,53 @@ var IssuanceBrandingStore = class extends AbstractIssuanceBrandingStore {
|
|
|
6231
6229
|
};
|
|
6232
6230
|
|
|
6233
6231
|
// src/statusList/StatusListStore.ts
|
|
6234
|
-
var
|
|
6232
|
+
var import_ssi_types4 = require("@sphereon/ssi-types");
|
|
6235
6233
|
var import_debug4 = __toESM(require("debug"), 1);
|
|
6236
6234
|
var import_typeorm37 = require("typeorm");
|
|
6237
6235
|
|
|
6238
6236
|
// src/utils/statusList/MappingUtils.ts
|
|
6239
|
-
var
|
|
6237
|
+
var import_ssi_types3 = require("@sphereon/ssi-types");
|
|
6240
6238
|
var statusListEntityFrom = /* @__PURE__ */ __name((args) => {
|
|
6241
|
-
if (args.type ===
|
|
6239
|
+
if (args.type === import_ssi_types3.StatusListType.StatusList2021) {
|
|
6242
6240
|
const entity = new StatusList2021Entity();
|
|
6243
6241
|
const sl2021 = args;
|
|
6244
6242
|
entity.indexingDirection = sl2021.indexingDirection;
|
|
6245
6243
|
entity.statusPurpose = sl2021.statusPurpose;
|
|
6246
6244
|
setBaseFields(entity, args);
|
|
6247
6245
|
Object.defineProperty(entity, "type", {
|
|
6248
|
-
value:
|
|
6246
|
+
value: import_ssi_types3.StatusListType.StatusList2021,
|
|
6249
6247
|
enumerable: true,
|
|
6250
6248
|
configurable: true
|
|
6251
6249
|
});
|
|
6252
6250
|
return entity;
|
|
6253
6251
|
}
|
|
6254
|
-
if (args.type ===
|
|
6252
|
+
if (args.type === import_ssi_types3.StatusListType.OAuthStatusList) {
|
|
6255
6253
|
const entity = new OAuthStatusListEntity();
|
|
6256
6254
|
const oauthSl = args;
|
|
6257
6255
|
entity.bitsPerStatus = oauthSl.bitsPerStatus;
|
|
6258
6256
|
entity.expiresAt = oauthSl.expiresAt;
|
|
6259
6257
|
setBaseFields(entity, args);
|
|
6260
6258
|
Object.defineProperty(entity, "type", {
|
|
6261
|
-
value:
|
|
6259
|
+
value: import_ssi_types3.StatusListType.OAuthStatusList,
|
|
6262
6260
|
enumerable: true,
|
|
6263
6261
|
configurable: true
|
|
6264
6262
|
});
|
|
6265
6263
|
return entity;
|
|
6266
6264
|
}
|
|
6267
|
-
if (args.type ===
|
|
6265
|
+
if (args.type === import_ssi_types3.StatusListType.BitstringStatusList) {
|
|
6268
6266
|
const entity = new BitstringStatusListEntity();
|
|
6269
6267
|
const bitstringsl = args;
|
|
6268
|
+
if (!bitstringsl.bitsPerStatus) {
|
|
6269
|
+
throw Error("bitsPerStatus must be set for BitstringStatusList");
|
|
6270
|
+
}
|
|
6270
6271
|
entity.statusPurpose = bitstringsl.statusPurpose;
|
|
6271
|
-
entity.
|
|
6272
|
+
entity.bitsPerStatus = bitstringsl.bitsPerStatus;
|
|
6272
6273
|
entity.validFrom = bitstringsl.validFrom;
|
|
6273
6274
|
entity.validUntil = bitstringsl.validUntil;
|
|
6274
6275
|
entity.ttl = bitstringsl.ttl;
|
|
6275
6276
|
setBaseFields(entity, args);
|
|
6276
6277
|
Object.defineProperty(entity, "type", {
|
|
6277
|
-
value:
|
|
6278
|
+
value: import_ssi_types3.StatusListType.BitstringStatusList,
|
|
6278
6279
|
enumerable: true,
|
|
6279
6280
|
configurable: true
|
|
6280
6281
|
});
|
|
@@ -6286,7 +6287,7 @@ var statusListFrom = /* @__PURE__ */ __name((entity) => {
|
|
|
6286
6287
|
if (entity instanceof StatusList2021Entity) {
|
|
6287
6288
|
const result = {
|
|
6288
6289
|
...getBaseFields(entity),
|
|
6289
|
-
type:
|
|
6290
|
+
type: import_ssi_types3.StatusListType.StatusList2021,
|
|
6290
6291
|
indexingDirection: entity.indexingDirection,
|
|
6291
6292
|
statusPurpose: entity.statusPurpose
|
|
6292
6293
|
};
|
|
@@ -6295,7 +6296,7 @@ var statusListFrom = /* @__PURE__ */ __name((entity) => {
|
|
|
6295
6296
|
if (entity instanceof OAuthStatusListEntity) {
|
|
6296
6297
|
const result = {
|
|
6297
6298
|
...getBaseFields(entity),
|
|
6298
|
-
type:
|
|
6299
|
+
type: import_ssi_types3.StatusListType.OAuthStatusList,
|
|
6299
6300
|
bitsPerStatus: entity.bitsPerStatus,
|
|
6300
6301
|
expiresAt: entity.expiresAt
|
|
6301
6302
|
};
|
|
@@ -6304,9 +6305,9 @@ var statusListFrom = /* @__PURE__ */ __name((entity) => {
|
|
|
6304
6305
|
if (entity instanceof BitstringStatusListEntity) {
|
|
6305
6306
|
const result = {
|
|
6306
6307
|
...getBaseFields(entity),
|
|
6307
|
-
type:
|
|
6308
|
+
type: import_ssi_types3.StatusListType.BitstringStatusList,
|
|
6308
6309
|
statusPurpose: entity.statusPurpose,
|
|
6309
|
-
|
|
6310
|
+
bitsPerStatus: entity.bitsPerStatus,
|
|
6310
6311
|
validFrom: entity.validFrom,
|
|
6311
6312
|
validUntil: entity.validUntil,
|
|
6312
6313
|
ttl: entity.ttl
|
|
@@ -6366,7 +6367,7 @@ var StatusListStore = class {
|
|
|
6366
6367
|
const repo = await this.getStatusListEntryRepo();
|
|
6367
6368
|
const results = (await repo.find({
|
|
6368
6369
|
where: {
|
|
6369
|
-
statusList,
|
|
6370
|
+
statusListId: statusList.id,
|
|
6370
6371
|
statusListIndex: (0, import_typeorm37.In)(statusListIndex)
|
|
6371
6372
|
}
|
|
6372
6373
|
})).map((index) => index.statusListIndex);
|
|
@@ -6597,11 +6598,11 @@ var StatusListStore = class {
|
|
|
6597
6598
|
async getStatusListRepo(type) {
|
|
6598
6599
|
const dataSource = await this.getDS();
|
|
6599
6600
|
switch (type) {
|
|
6600
|
-
case
|
|
6601
|
+
case import_ssi_types4.StatusListType.StatusList2021:
|
|
6601
6602
|
return dataSource.getRepository(StatusList2021Entity);
|
|
6602
|
-
case
|
|
6603
|
+
case import_ssi_types4.StatusListType.OAuthStatusList:
|
|
6603
6604
|
return dataSource.getRepository(OAuthStatusListEntity);
|
|
6604
|
-
case
|
|
6605
|
+
case import_ssi_types4.StatusListType.BitstringStatusList:
|
|
6605
6606
|
return dataSource.getRepository(BitstringStatusListEntity);
|
|
6606
6607
|
default:
|
|
6607
6608
|
return dataSource.getRepository(StatusListEntity);
|
|
@@ -6620,15 +6621,15 @@ var AbstractEventLoggerStore = class {
|
|
|
6620
6621
|
};
|
|
6621
6622
|
|
|
6622
6623
|
// src/eventLogger/EventLoggerStore.ts
|
|
6623
|
-
var
|
|
6624
|
+
var import_ssi_types6 = require("@sphereon/ssi-types");
|
|
6624
6625
|
var import_debug5 = __toESM(require("debug"), 1);
|
|
6625
6626
|
|
|
6626
6627
|
// src/utils/eventLogger/MappingUtils.ts
|
|
6627
|
-
var
|
|
6628
|
+
var import_ssi_types5 = require("@sphereon/ssi-types");
|
|
6628
6629
|
var auditEventFrom = /* @__PURE__ */ __name((event) => {
|
|
6629
6630
|
const result = {
|
|
6630
6631
|
id: event.id,
|
|
6631
|
-
type:
|
|
6632
|
+
type: import_ssi_types5.LoggingEventType.AUDIT,
|
|
6632
6633
|
description: event.description,
|
|
6633
6634
|
timestamp: event.timestamp,
|
|
6634
6635
|
level: event.level,
|
|
@@ -6655,7 +6656,7 @@ var auditEventFrom = /* @__PURE__ */ __name((event) => {
|
|
|
6655
6656
|
}, "auditEventFrom");
|
|
6656
6657
|
var auditEventEntityFrom = /* @__PURE__ */ __name((args) => {
|
|
6657
6658
|
const auditEventEntity = new AuditEventEntity();
|
|
6658
|
-
auditEventEntity.type =
|
|
6659
|
+
auditEventEntity.type = import_ssi_types5.LoggingEventType.AUDIT;
|
|
6659
6660
|
auditEventEntity.timestamp = args.timestamp;
|
|
6660
6661
|
auditEventEntity.level = args.level;
|
|
6661
6662
|
auditEventEntity.correlationId = args.correlationId;
|
|
@@ -6679,7 +6680,7 @@ var auditEventEntityFrom = /* @__PURE__ */ __name((args) => {
|
|
|
6679
6680
|
var activityEventFrom = /* @__PURE__ */ __name((event) => {
|
|
6680
6681
|
const result = {
|
|
6681
6682
|
id: event.id,
|
|
6682
|
-
type:
|
|
6683
|
+
type: import_ssi_types5.LoggingEventType.ACTIVITY,
|
|
6683
6684
|
credentialType: event.credentialType,
|
|
6684
6685
|
originalCredential: event.originalCredential,
|
|
6685
6686
|
credentialHash: event.credentialHash,
|
|
@@ -6711,7 +6712,7 @@ var activityEventFrom = /* @__PURE__ */ __name((event) => {
|
|
|
6711
6712
|
}, "activityEventFrom");
|
|
6712
6713
|
var activityEventEntityFrom = /* @__PURE__ */ __name((args) => {
|
|
6713
6714
|
const activityEventEntity = new AuditEventEntity();
|
|
6714
|
-
activityEventEntity.type =
|
|
6715
|
+
activityEventEntity.type = import_ssi_types5.LoggingEventType.ACTIVITY;
|
|
6715
6716
|
activityEventEntity.timestamp = args.timestamp;
|
|
6716
6717
|
activityEventEntity.level = args.level;
|
|
6717
6718
|
activityEventEntity.correlationId = args.correlationId;
|
|
@@ -6753,11 +6754,11 @@ var EventLoggerStore = class extends AbstractEventLoggerStore {
|
|
|
6753
6754
|
const { filter = [] } = args ?? {};
|
|
6754
6755
|
const auditEventsFilter = filter.map((item) => ({
|
|
6755
6756
|
...item,
|
|
6756
|
-
type:
|
|
6757
|
+
type: import_ssi_types6.LoggingEventType.AUDIT
|
|
6757
6758
|
}));
|
|
6758
6759
|
if (auditEventsFilter.length === 0) {
|
|
6759
6760
|
auditEventsFilter.push({
|
|
6760
|
-
type:
|
|
6761
|
+
type: import_ssi_types6.LoggingEventType.AUDIT
|
|
6761
6762
|
});
|
|
6762
6763
|
}
|
|
6763
6764
|
const connection = await this.dbConnection;
|
|
@@ -6779,11 +6780,11 @@ var EventLoggerStore = class extends AbstractEventLoggerStore {
|
|
|
6779
6780
|
const { filter = [] } = args ?? {};
|
|
6780
6781
|
const activityEventsFilter = filter.map((item) => ({
|
|
6781
6782
|
...item,
|
|
6782
|
-
type:
|
|
6783
|
+
type: import_ssi_types6.LoggingEventType.ACTIVITY
|
|
6783
6784
|
}));
|
|
6784
6785
|
if (activityEventsFilter.length === 0) {
|
|
6785
6786
|
activityEventsFilter.push({
|
|
6786
|
-
type:
|
|
6787
|
+
type: import_ssi_types6.LoggingEventType.ACTIVITY
|
|
6787
6788
|
});
|
|
6788
6789
|
}
|
|
6789
6790
|
const connection = await this.dbConnection;
|
|
@@ -9086,7 +9087,7 @@ var CreateBitstringStatusListPG1741895823000 = class {
|
|
|
9086
9087
|
}
|
|
9087
9088
|
name = "CreateBitstringStatusList1741895823000";
|
|
9088
9089
|
async up(queryRunner) {
|
|
9089
|
-
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "
|
|
9090
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "bitsPerStatus" integer DEFAULT 1`);
|
|
9090
9091
|
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "ttl" integer`);
|
|
9091
9092
|
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "validFrom" TIMESTAMP`);
|
|
9092
9093
|
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "validUntil" TIMESTAMP`);
|
|
@@ -9100,7 +9101,7 @@ var CreateBitstringStatusListPG1741895823000 = class {
|
|
|
9100
9101
|
"credentialHash" character varying(128),
|
|
9101
9102
|
"correlationId" character varying(255),
|
|
9102
9103
|
"statusPurpose" character varying NOT NULL,
|
|
9103
|
-
"
|
|
9104
|
+
"bitsPerStatus" integer DEFAULT 1,
|
|
9104
9105
|
"statusMessage" text,
|
|
9105
9106
|
"statusReference" text,
|
|
9106
9107
|
CONSTRAINT "PK_BitstringStatusListEntry" PRIMARY KEY ("statusListId", "statusListIndex")
|
|
@@ -9120,7 +9121,7 @@ var CreateBitstringStatusListPG1741895823000 = class {
|
|
|
9120
9121
|
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "validUntil"`);
|
|
9121
9122
|
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "validFrom"`);
|
|
9122
9123
|
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "ttl"`);
|
|
9123
|
-
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "
|
|
9124
|
+
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "bitsPerStatus"`);
|
|
9124
9125
|
}
|
|
9125
9126
|
};
|
|
9126
9127
|
|
|
@@ -9144,9 +9145,8 @@ var CreateBitstringStatusListSqlite1741895823001 = class {
|
|
|
9144
9145
|
"indexingDirection" varchar CHECK( "indexingDirection" IN ('rightToLeft') ),
|
|
9145
9146
|
"statusPurpose" varchar,
|
|
9146
9147
|
"statusListCredential" text,
|
|
9147
|
-
"bitsPerStatus" integer,
|
|
9148
9148
|
"expiresAt" datetime,
|
|
9149
|
-
"
|
|
9149
|
+
"bitsPerStatus" integer DEFAULT (1),
|
|
9150
9150
|
"ttl" integer,
|
|
9151
9151
|
"validFrom" datetime,
|
|
9152
9152
|
"validUntil" datetime,
|
|
@@ -9175,7 +9175,7 @@ var CreateBitstringStatusListSqlite1741895823001 = class {
|
|
|
9175
9175
|
"credentialHash" varchar(128),
|
|
9176
9176
|
"correlationId" varchar(255),
|
|
9177
9177
|
"statusPurpose" varchar NOT NULL,
|
|
9178
|
-
"
|
|
9178
|
+
"bitsPerStatus" integer DEFAULT (1),
|
|
9179
9179
|
"statusMessage" text,
|
|
9180
9180
|
"statusReference" text,
|
|
9181
9181
|
PRIMARY KEY ("statusListId", "statusListIndex")
|
|
@@ -9307,7 +9307,7 @@ var DataStoreMigrations = [
|
|
|
9307
9307
|
];
|
|
9308
9308
|
|
|
9309
9309
|
// src/utils/digitalCredential/MappingUtils.ts
|
|
9310
|
-
var
|
|
9310
|
+
var import_ssi_types7 = require("@sphereon/ssi-types");
|
|
9311
9311
|
var import_utils = require("@veramo/utils");
|
|
9312
9312
|
var import_ssi_sdk23 = require("@sphereon/ssi-sdk.core");
|
|
9313
9313
|
function determineDocumentType(raw) {
|
|
@@ -9315,11 +9315,11 @@ function determineDocumentType(raw) {
|
|
|
9315
9315
|
if (!rawDocument) {
|
|
9316
9316
|
throw new Error(`Couldn't parse the credential: ${raw}`);
|
|
9317
9317
|
}
|
|
9318
|
-
const hasProof =
|
|
9319
|
-
const isCredential = isHex(raw) ||
|
|
9320
|
-
const isPresentation =
|
|
9318
|
+
const hasProof = import_ssi_types7.CredentialMapper.hasProof(rawDocument);
|
|
9319
|
+
const isCredential = isHex(raw) || import_ssi_types7.ObjectUtils.isBase64(raw) || import_ssi_types7.CredentialMapper.isCredential(rawDocument);
|
|
9320
|
+
const isPresentation = import_ssi_types7.CredentialMapper.isPresentation(rawDocument);
|
|
9321
9321
|
if (isCredential) {
|
|
9322
|
-
return hasProof || isHex(raw) ||
|
|
9322
|
+
return hasProof || isHex(raw) || import_ssi_types7.ObjectUtils.isBase64(raw) ? DocumentType.VC : DocumentType.C;
|
|
9323
9323
|
} else if (isPresentation) {
|
|
9324
9324
|
return hasProof ? DocumentType.VP : DocumentType.P;
|
|
9325
9325
|
}
|
|
@@ -9331,9 +9331,9 @@ function isHex(input) {
|
|
|
9331
9331
|
}
|
|
9332
9332
|
__name(isHex, "isHex");
|
|
9333
9333
|
function parseRawDocument(raw) {
|
|
9334
|
-
if (isHex(raw) ||
|
|
9334
|
+
if (isHex(raw) || import_ssi_types7.ObjectUtils.isBase64(raw)) {
|
|
9335
9335
|
return raw;
|
|
9336
|
-
} else if (
|
|
9336
|
+
} else if (import_ssi_types7.CredentialMapper.isJwtEncoded(raw) || import_ssi_types7.CredentialMapper.isSdJwtEncoded(raw)) {
|
|
9337
9337
|
return raw;
|
|
9338
9338
|
}
|
|
9339
9339
|
try {
|
|
@@ -9345,9 +9345,9 @@ function parseRawDocument(raw) {
|
|
|
9345
9345
|
__name(parseRawDocument, "parseRawDocument");
|
|
9346
9346
|
function ensureRawDocument(input) {
|
|
9347
9347
|
if (typeof input === "string") {
|
|
9348
|
-
if (isHex(input) ||
|
|
9348
|
+
if (isHex(input) || import_ssi_types7.ObjectUtils.isBase64(input)) {
|
|
9349
9349
|
return input;
|
|
9350
|
-
} else if (
|
|
9350
|
+
} else if (import_ssi_types7.CredentialMapper.isJwtEncoded(input) || import_ssi_types7.CredentialMapper.isSdJwtEncoded(input)) {
|
|
9351
9351
|
return input;
|
|
9352
9352
|
}
|
|
9353
9353
|
throw Error("Unknown input to be mapped as rawDocument");
|
|
@@ -9361,13 +9361,13 @@ function ensureRawDocument(input) {
|
|
|
9361
9361
|
__name(ensureRawDocument, "ensureRawDocument");
|
|
9362
9362
|
function determineCredentialDocumentFormat(documentFormat) {
|
|
9363
9363
|
switch (documentFormat) {
|
|
9364
|
-
case
|
|
9364
|
+
case import_ssi_types7.DocumentFormat.JSONLD:
|
|
9365
9365
|
return CredentialDocumentFormat.JSON_LD;
|
|
9366
|
-
case
|
|
9366
|
+
case import_ssi_types7.DocumentFormat.JWT:
|
|
9367
9367
|
return CredentialDocumentFormat.JWT;
|
|
9368
|
-
case
|
|
9368
|
+
case import_ssi_types7.DocumentFormat.SD_JWT_VC:
|
|
9369
9369
|
return CredentialDocumentFormat.SD_JWT;
|
|
9370
|
-
case
|
|
9370
|
+
case import_ssi_types7.DocumentFormat.MSO_MDOC:
|
|
9371
9371
|
return CredentialDocumentFormat.MSO_MDOC;
|
|
9372
9372
|
default:
|
|
9373
9373
|
throw new Error(`Not supported document format: ${documentFormat}`);
|
|
@@ -9406,14 +9406,14 @@ var safeStringify = /* @__PURE__ */ __name((object) => {
|
|
|
9406
9406
|
}, "safeStringify");
|
|
9407
9407
|
var nonPersistedDigitalCredentialEntityFromAddArgs = /* @__PURE__ */ __name((addCredentialArgs) => {
|
|
9408
9408
|
const documentType = determineDocumentType(addCredentialArgs.rawDocument);
|
|
9409
|
-
const documentFormat =
|
|
9409
|
+
const documentFormat = import_ssi_types7.CredentialMapper.detectDocumentType(addCredentialArgs.rawDocument);
|
|
9410
9410
|
const hasher = addCredentialArgs?.opts?.hasher ?? import_ssi_sdk23.defaultHasher;
|
|
9411
|
-
if (documentFormat ===
|
|
9411
|
+
if (documentFormat === import_ssi_types7.DocumentFormat.SD_JWT_VC && !addCredentialArgs.opts?.hasher) {
|
|
9412
9412
|
throw new Error("No hasher function is provided for SD_JWT credential.");
|
|
9413
9413
|
}
|
|
9414
|
-
const uniformDocument = documentType === DocumentType.VC || documentType === DocumentType.C ?
|
|
9414
|
+
const uniformDocument = documentType === DocumentType.VC || documentType === DocumentType.C ? import_ssi_types7.CredentialMapper.toUniformCredential(addCredentialArgs.rawDocument, {
|
|
9415
9415
|
hasher
|
|
9416
|
-
}) :
|
|
9416
|
+
}) : import_ssi_types7.CredentialMapper.toUniformPresentation(addCredentialArgs.rawDocument, {
|
|
9417
9417
|
hasher
|
|
9418
9418
|
});
|
|
9419
9419
|
const validFrom = getValidFrom(uniformDocument);
|