@sphereon/ssi-sdk.data-store 0.34.1-feature.SSISDK.17.bitstring.sl.2 → 0.34.1-feature.SSISDK.17.bitstring.sl.25
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 +271 -254
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +98 -45
- package/dist/index.d.ts +98 -45
- package/dist/index.js +223 -206
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/__tests__/statusList.entities.test.ts +4 -4
- package/src/__tests__/statusList.store.test.ts +2 -1
- package/src/entities/statusList/BitstringStatusListEntryEntity.ts +11 -34
- package/src/entities/statusList/StatusList2021EntryEntity.ts +2 -1
- package/src/entities/statusList/StatusListEntities.ts +14 -8
- package/src/migrations/postgres/1741895823000-CreateBitstringStatusList.ts +25 -26
- package/src/migrations/sqlite/1741895823001-CreateBitstringStatusList.ts +51 -9
- package/src/statusList/IStatusListStore.ts +14 -11
- package/src/statusList/StatusListStore.ts +70 -34
- package/src/types/statusList/IAbstractStatusListStore.ts +54 -4
- package/src/types/statusList/statusList.ts +42 -9
- package/src/utils/statusList/MappingUtils.ts +52 -45
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
|
|
@@ -2956,16 +2956,20 @@ _ts_decorate26([
|
|
|
2956
2956
|
_ts_metadata25("design:type", String)
|
|
2957
2957
|
], StatusListEntryEntity.prototype, "value", void 0);
|
|
2958
2958
|
StatusListEntryEntity = _ts_decorate26([
|
|
2959
|
-
(0, import_typeorm25.Entity)("StatusListEntry")
|
|
2959
|
+
(0, import_typeorm25.Entity)("StatusListEntry"),
|
|
2960
|
+
(0, import_typeorm25.TableInheritance)({
|
|
2961
|
+
column: {
|
|
2962
|
+
type: "varchar",
|
|
2963
|
+
name: "type"
|
|
2964
|
+
}
|
|
2965
|
+
})
|
|
2960
2966
|
], StatusListEntryEntity);
|
|
2961
2967
|
|
|
2962
2968
|
// src/entities/statusList/StatusListEntities.ts
|
|
2963
2969
|
var import_ssi_sdk13 = require("@sphereon/ssi-sdk.agent-config");
|
|
2964
2970
|
|
|
2965
2971
|
// src/entities/statusList/BitstringStatusListEntryEntity.ts
|
|
2966
|
-
var import_class_validator19 = require("class-validator");
|
|
2967
2972
|
var import_typeorm26 = require("typeorm");
|
|
2968
|
-
var import_ssi_types = require("@sphereon/ssi-types");
|
|
2969
2973
|
function _ts_decorate27(decorators, target, key, desc) {
|
|
2970
2974
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2971
2975
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2977,94 +2981,32 @@ function _ts_metadata26(k, v) {
|
|
|
2977
2981
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2978
2982
|
}
|
|
2979
2983
|
__name(_ts_metadata26, "_ts_metadata");
|
|
2980
|
-
var BitstringStatusListEntryEntity = class extends
|
|
2984
|
+
var BitstringStatusListEntryEntity = class extends StatusListEntryEntity {
|
|
2981
2985
|
static {
|
|
2982
2986
|
__name(this, "BitstringStatusListEntryEntity");
|
|
2983
2987
|
}
|
|
2984
|
-
statusListId;
|
|
2985
|
-
statusListIndex;
|
|
2986
|
-
statusList;
|
|
2987
|
-
credentialId;
|
|
2988
|
-
credentialHash;
|
|
2989
|
-
entryCorrelationId;
|
|
2990
2988
|
statusPurpose;
|
|
2991
|
-
|
|
2989
|
+
bitsPerStatus;
|
|
2992
2990
|
statusMessage;
|
|
2993
2991
|
statusReference;
|
|
2994
2992
|
};
|
|
2995
|
-
_ts_decorate27([
|
|
2996
|
-
(0, import_typeorm26.PrimaryColumn)({
|
|
2997
|
-
name: "statusListId",
|
|
2998
|
-
type: "varchar",
|
|
2999
|
-
nullable: false,
|
|
3000
|
-
unique: false
|
|
3001
|
-
}),
|
|
3002
|
-
(0, import_class_validator19.Validate)(IsNonEmptyStringConstraint, {
|
|
3003
|
-
message: "Status list id is required"
|
|
3004
|
-
}),
|
|
3005
|
-
_ts_metadata26("design:type", String)
|
|
3006
|
-
], BitstringStatusListEntryEntity.prototype, "statusListId", void 0);
|
|
3007
|
-
_ts_decorate27([
|
|
3008
|
-
(0, import_typeorm26.PrimaryColumn)({
|
|
3009
|
-
name: "statusListIndex",
|
|
3010
|
-
type: "integer",
|
|
3011
|
-
nullable: false,
|
|
3012
|
-
unique: false
|
|
3013
|
-
}),
|
|
3014
|
-
_ts_metadata26("design:type", Number)
|
|
3015
|
-
], BitstringStatusListEntryEntity.prototype, "statusListIndex", void 0);
|
|
3016
|
-
_ts_decorate27([
|
|
3017
|
-
(0, import_typeorm26.ManyToOne)(() => BitstringStatusListEntity, (statusList) => statusList.statusListEntries),
|
|
3018
|
-
(0, import_typeorm26.JoinColumn)({
|
|
3019
|
-
name: "statusListId"
|
|
3020
|
-
}),
|
|
3021
|
-
_ts_metadata26("design:type", typeof BitstringStatusListEntity === "undefined" ? Object : BitstringStatusListEntity)
|
|
3022
|
-
], BitstringStatusListEntryEntity.prototype, "statusList", void 0);
|
|
3023
|
-
_ts_decorate27([
|
|
3024
|
-
(0, import_typeorm26.Column)({
|
|
3025
|
-
name: "credentialId",
|
|
3026
|
-
type: "text",
|
|
3027
|
-
nullable: true
|
|
3028
|
-
}),
|
|
3029
|
-
_ts_metadata26("design:type", String)
|
|
3030
|
-
], BitstringStatusListEntryEntity.prototype, "credentialId", void 0);
|
|
3031
|
-
_ts_decorate27([
|
|
3032
|
-
(0, import_typeorm26.Column)({
|
|
3033
|
-
name: "credentialHash",
|
|
3034
|
-
length: 128,
|
|
3035
|
-
type: "varchar",
|
|
3036
|
-
nullable: true,
|
|
3037
|
-
unique: false
|
|
3038
|
-
}),
|
|
3039
|
-
_ts_metadata26("design:type", String)
|
|
3040
|
-
], BitstringStatusListEntryEntity.prototype, "credentialHash", void 0);
|
|
3041
|
-
_ts_decorate27([
|
|
3042
|
-
(0, import_typeorm26.Column)({
|
|
3043
|
-
name: "correlationId",
|
|
3044
|
-
length: 255,
|
|
3045
|
-
type: "varchar",
|
|
3046
|
-
nullable: true,
|
|
3047
|
-
unique: false
|
|
3048
|
-
}),
|
|
3049
|
-
_ts_metadata26("design:type", String)
|
|
3050
|
-
], BitstringStatusListEntryEntity.prototype, "entryCorrelationId", void 0);
|
|
3051
2993
|
_ts_decorate27([
|
|
3052
2994
|
(0, import_typeorm26.Column)({
|
|
3053
2995
|
type: "varchar",
|
|
3054
2996
|
name: "statusPurpose",
|
|
3055
2997
|
nullable: false
|
|
3056
2998
|
}),
|
|
3057
|
-
_ts_metadata26("design:type",
|
|
2999
|
+
_ts_metadata26("design:type", String)
|
|
3058
3000
|
], BitstringStatusListEntryEntity.prototype, "statusPurpose", void 0);
|
|
3059
3001
|
_ts_decorate27([
|
|
3060
3002
|
(0, import_typeorm26.Column)({
|
|
3061
3003
|
type: "integer",
|
|
3062
|
-
name: "
|
|
3004
|
+
name: "bitsPerStatus",
|
|
3063
3005
|
nullable: true,
|
|
3064
3006
|
default: 1
|
|
3065
3007
|
}),
|
|
3066
3008
|
_ts_metadata26("design:type", Number)
|
|
3067
|
-
], BitstringStatusListEntryEntity.prototype, "
|
|
3009
|
+
], BitstringStatusListEntryEntity.prototype, "bitsPerStatus", void 0);
|
|
3068
3010
|
_ts_decorate27([
|
|
3069
3011
|
(0, import_typeorm26.Column)({
|
|
3070
3012
|
type: "text",
|
|
@@ -3116,7 +3058,7 @@ _ts_decorate27([
|
|
|
3116
3058
|
_ts_metadata26("design:type", Object)
|
|
3117
3059
|
], BitstringStatusListEntryEntity.prototype, "statusReference", void 0);
|
|
3118
3060
|
BitstringStatusListEntryEntity = _ts_decorate27([
|
|
3119
|
-
(0, import_typeorm26.
|
|
3061
|
+
(0, import_typeorm26.ChildEntity)("bitstring")
|
|
3120
3062
|
], BitstringStatusListEntryEntity);
|
|
3121
3063
|
|
|
3122
3064
|
// src/entities/statusList/StatusListEntities.ts
|
|
@@ -3131,14 +3073,15 @@ function _ts_metadata27(k, v) {
|
|
|
3131
3073
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3132
3074
|
}
|
|
3133
3075
|
__name(_ts_metadata27, "_ts_metadata");
|
|
3134
|
-
var { BaseEntity:
|
|
3135
|
-
var StatusListEntity = class extends
|
|
3076
|
+
var { BaseEntity: BaseEntity20, ChildEntity: ChildEntity6, Column: Column25, Entity: Entity22, OneToMany: OneToMany8, PrimaryColumn: PrimaryColumn2, TableInheritance: TableInheritance5, Unique } = import_typeorm27.default;
|
|
3077
|
+
var StatusListEntity = class extends BaseEntity20 {
|
|
3136
3078
|
static {
|
|
3137
3079
|
__name(this, "StatusListEntity");
|
|
3138
3080
|
}
|
|
3139
3081
|
id;
|
|
3140
3082
|
correlationId;
|
|
3141
3083
|
length;
|
|
3084
|
+
type;
|
|
3142
3085
|
issuer;
|
|
3143
3086
|
driverType;
|
|
3144
3087
|
credentialIdMode;
|
|
@@ -3146,7 +3089,7 @@ var StatusListEntity = class extends BaseEntity21 {
|
|
|
3146
3089
|
statusListCredential;
|
|
3147
3090
|
};
|
|
3148
3091
|
_ts_decorate28([
|
|
3149
|
-
|
|
3092
|
+
PrimaryColumn2({
|
|
3150
3093
|
name: "id",
|
|
3151
3094
|
type: "varchar"
|
|
3152
3095
|
}),
|
|
@@ -3169,6 +3112,14 @@ _ts_decorate28([
|
|
|
3169
3112
|
}),
|
|
3170
3113
|
_ts_metadata27("design:type", Number)
|
|
3171
3114
|
], StatusListEntity.prototype, "length", void 0);
|
|
3115
|
+
_ts_decorate28([
|
|
3116
|
+
Column25("simple-enum", {
|
|
3117
|
+
name: "type",
|
|
3118
|
+
enum: import_ssi_types.StatusListType,
|
|
3119
|
+
nullable: false
|
|
3120
|
+
}),
|
|
3121
|
+
_ts_metadata27("design:type", typeof import_ssi_types.StatusListType === "undefined" ? Object : import_ssi_types.StatusListType)
|
|
3122
|
+
], StatusListEntity.prototype, "type", void 0);
|
|
3172
3123
|
_ts_decorate28([
|
|
3173
3124
|
Column25({
|
|
3174
3125
|
name: "issuer",
|
|
@@ -3195,20 +3146,20 @@ _ts_decorate28([
|
|
|
3195
3146
|
_ts_decorate28([
|
|
3196
3147
|
Column25("simple-enum", {
|
|
3197
3148
|
name: "driverType",
|
|
3198
|
-
enum:
|
|
3149
|
+
enum: import_ssi_types.StatusListDriverType,
|
|
3199
3150
|
nullable: false,
|
|
3200
|
-
default:
|
|
3151
|
+
default: import_ssi_types.StatusListDriverType.AGENT_TYPEORM
|
|
3201
3152
|
}),
|
|
3202
|
-
_ts_metadata27("design:type", typeof
|
|
3153
|
+
_ts_metadata27("design:type", typeof import_ssi_types.StatusListDriverType === "undefined" ? Object : import_ssi_types.StatusListDriverType)
|
|
3203
3154
|
], StatusListEntity.prototype, "driverType", void 0);
|
|
3204
3155
|
_ts_decorate28([
|
|
3205
3156
|
Column25("simple-enum", {
|
|
3206
3157
|
name: "credentialIdMode",
|
|
3207
|
-
enum:
|
|
3158
|
+
enum: import_ssi_types.StatusListCredentialIdMode,
|
|
3208
3159
|
nullable: false,
|
|
3209
|
-
default:
|
|
3160
|
+
default: import_ssi_types.StatusListCredentialIdMode.ISSUANCE
|
|
3210
3161
|
}),
|
|
3211
|
-
_ts_metadata27("design:type", typeof
|
|
3162
|
+
_ts_metadata27("design:type", typeof import_ssi_types.StatusListCredentialIdMode === "undefined" ? Object : import_ssi_types.StatusListCredentialIdMode)
|
|
3212
3163
|
], StatusListEntity.prototype, "credentialIdMode", void 0);
|
|
3213
3164
|
_ts_decorate28([
|
|
3214
3165
|
Column25({
|
|
@@ -3247,15 +3198,15 @@ _ts_decorate28([
|
|
|
3247
3198
|
_ts_metadata27("design:type", typeof StatusListCredential === "undefined" ? Object : StatusListCredential)
|
|
3248
3199
|
], StatusListEntity.prototype, "statusListCredential", void 0);
|
|
3249
3200
|
StatusListEntity = _ts_decorate28([
|
|
3250
|
-
|
|
3201
|
+
Entity22("StatusList"),
|
|
3251
3202
|
Unique("UQ_correlationId", [
|
|
3252
3203
|
"correlationId"
|
|
3253
3204
|
]),
|
|
3254
|
-
|
|
3205
|
+
TableInheritance5({
|
|
3255
3206
|
column: {
|
|
3256
3207
|
type: "simple-enum",
|
|
3257
3208
|
name: "type",
|
|
3258
|
-
enum:
|
|
3209
|
+
enum: import_ssi_types.StatusListType
|
|
3259
3210
|
}
|
|
3260
3211
|
})
|
|
3261
3212
|
], StatusListEntity);
|
|
@@ -3293,7 +3244,7 @@ _ts_decorate28([
|
|
|
3293
3244
|
_ts_metadata27("design:type", Array)
|
|
3294
3245
|
], StatusList2021Entity.prototype, "statusListEntries", void 0);
|
|
3295
3246
|
StatusList2021Entity = _ts_decorate28([
|
|
3296
|
-
|
|
3247
|
+
ChildEntity6(import_ssi_types.StatusListType.StatusList2021)
|
|
3297
3248
|
], StatusList2021Entity);
|
|
3298
3249
|
var OAuthStatusListEntity = class extends StatusListEntity {
|
|
3299
3250
|
static {
|
|
@@ -3319,14 +3270,14 @@ _ts_decorate28([
|
|
|
3319
3270
|
_ts_metadata27("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3320
3271
|
], OAuthStatusListEntity.prototype, "expiresAt", void 0);
|
|
3321
3272
|
OAuthStatusListEntity = _ts_decorate28([
|
|
3322
|
-
|
|
3273
|
+
ChildEntity6(import_ssi_types.StatusListType.OAuthStatusList)
|
|
3323
3274
|
], OAuthStatusListEntity);
|
|
3324
3275
|
var BitstringStatusListEntity = class extends StatusListEntity {
|
|
3325
3276
|
static {
|
|
3326
3277
|
__name(this, "BitstringStatusListEntity");
|
|
3327
3278
|
}
|
|
3328
3279
|
statusPurpose;
|
|
3329
|
-
|
|
3280
|
+
bitsPerStatus;
|
|
3330
3281
|
validFrom;
|
|
3331
3282
|
validUntil;
|
|
3332
3283
|
ttl;
|
|
@@ -3357,12 +3308,11 @@ _ts_decorate28([
|
|
|
3357
3308
|
_ts_decorate28([
|
|
3358
3309
|
Column25({
|
|
3359
3310
|
type: "integer",
|
|
3360
|
-
name: "
|
|
3361
|
-
nullable:
|
|
3362
|
-
default: 1
|
|
3311
|
+
name: "bitsPerStatus",
|
|
3312
|
+
nullable: false
|
|
3363
3313
|
}),
|
|
3364
3314
|
_ts_metadata27("design:type", Number)
|
|
3365
|
-
], BitstringStatusListEntity.prototype, "
|
|
3315
|
+
], BitstringStatusListEntity.prototype, "bitsPerStatus", void 0);
|
|
3366
3316
|
_ts_decorate28([
|
|
3367
3317
|
Column25({
|
|
3368
3318
|
name: "validFrom",
|
|
@@ -3392,7 +3342,7 @@ _ts_decorate28([
|
|
|
3392
3342
|
_ts_metadata27("design:type", Array)
|
|
3393
3343
|
], BitstringStatusListEntity.prototype, "statusListEntries", void 0);
|
|
3394
3344
|
BitstringStatusListEntity = _ts_decorate28([
|
|
3395
|
-
|
|
3345
|
+
ChildEntity6(import_ssi_types.StatusListType.BitstringStatusList)
|
|
3396
3346
|
], BitstringStatusListEntity);
|
|
3397
3347
|
|
|
3398
3348
|
// src/entities/machineState/MachineStateInfoEntity.ts
|
|
@@ -3528,7 +3478,7 @@ MachineStateInfoEntity = _ts_decorate29([
|
|
|
3528
3478
|
], MachineStateInfoEntity);
|
|
3529
3479
|
|
|
3530
3480
|
// src/entities/contact/OrganizationEntity.ts
|
|
3531
|
-
var
|
|
3481
|
+
var import_class_validator19 = require("class-validator");
|
|
3532
3482
|
var import_typeorm29 = require("typeorm");
|
|
3533
3483
|
function _ts_decorate30(decorators, target, key, desc) {
|
|
3534
3484
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -3550,7 +3500,7 @@ var OrganizationEntity = class extends BaseContactEntity {
|
|
|
3550
3500
|
ownerId;
|
|
3551
3501
|
tenantId;
|
|
3552
3502
|
async validate() {
|
|
3553
|
-
const validation = await (0,
|
|
3503
|
+
const validation = await (0, import_class_validator19.validate)(this);
|
|
3554
3504
|
if (validation.length > 0) {
|
|
3555
3505
|
const constraint = getConstraint(validation[0]);
|
|
3556
3506
|
if (constraint) {
|
|
@@ -3567,7 +3517,7 @@ _ts_decorate30([
|
|
|
3567
3517
|
nullable: false,
|
|
3568
3518
|
unique: true
|
|
3569
3519
|
}),
|
|
3570
|
-
(0,
|
|
3520
|
+
(0, import_class_validator19.IsNotEmpty)({
|
|
3571
3521
|
message: "Blank legal names are not allowed"
|
|
3572
3522
|
}),
|
|
3573
3523
|
_ts_metadata29("design:type", String)
|
|
@@ -3579,7 +3529,7 @@ _ts_decorate30([
|
|
|
3579
3529
|
nullable: false,
|
|
3580
3530
|
unique: false
|
|
3581
3531
|
}),
|
|
3582
|
-
(0,
|
|
3532
|
+
(0, import_class_validator19.IsNotEmpty)({
|
|
3583
3533
|
message: "Blank display names are not allowed"
|
|
3584
3534
|
}),
|
|
3585
3535
|
_ts_metadata29("design:type", String)
|
|
@@ -3611,7 +3561,7 @@ OrganizationEntity = _ts_decorate30([
|
|
|
3611
3561
|
|
|
3612
3562
|
// src/entities/contact/NaturalPersonEntity.ts
|
|
3613
3563
|
var import_typeorm30 = require("typeorm");
|
|
3614
|
-
var
|
|
3564
|
+
var import_class_validator20 = require("class-validator");
|
|
3615
3565
|
function _ts_decorate31(decorators, target, key, desc) {
|
|
3616
3566
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3617
3567
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3634,7 +3584,7 @@ var NaturalPersonEntity = class extends BaseContactEntity {
|
|
|
3634
3584
|
ownerId;
|
|
3635
3585
|
tenantId;
|
|
3636
3586
|
async validate() {
|
|
3637
|
-
const validation = await (0,
|
|
3587
|
+
const validation = await (0, import_class_validator20.validate)(this);
|
|
3638
3588
|
if (validation.length > 0) {
|
|
3639
3589
|
const constraint = getConstraint(validation[0]);
|
|
3640
3590
|
if (constraint) {
|
|
@@ -3651,7 +3601,7 @@ _ts_decorate31([
|
|
|
3651
3601
|
nullable: false,
|
|
3652
3602
|
unique: false
|
|
3653
3603
|
}),
|
|
3654
|
-
(0,
|
|
3604
|
+
(0, import_class_validator20.IsNotEmpty)({
|
|
3655
3605
|
message: "Blank first names are not allowed"
|
|
3656
3606
|
}),
|
|
3657
3607
|
_ts_metadata30("design:type", String)
|
|
@@ -3663,7 +3613,7 @@ _ts_decorate31([
|
|
|
3663
3613
|
nullable: true,
|
|
3664
3614
|
unique: false
|
|
3665
3615
|
}),
|
|
3666
|
-
(0,
|
|
3616
|
+
(0, import_class_validator20.Validate)(IsNonEmptyStringConstraint, {
|
|
3667
3617
|
message: "Blank middle names are not allowed"
|
|
3668
3618
|
}),
|
|
3669
3619
|
_ts_metadata30("design:type", String)
|
|
@@ -3675,7 +3625,7 @@ _ts_decorate31([
|
|
|
3675
3625
|
nullable: false,
|
|
3676
3626
|
unique: false
|
|
3677
3627
|
}),
|
|
3678
|
-
(0,
|
|
3628
|
+
(0, import_class_validator20.IsNotEmpty)({
|
|
3679
3629
|
message: "Blank last names are not allowed"
|
|
3680
3630
|
}),
|
|
3681
3631
|
_ts_metadata30("design:type", String)
|
|
@@ -3687,7 +3637,7 @@ _ts_decorate31([
|
|
|
3687
3637
|
nullable: false,
|
|
3688
3638
|
unique: false
|
|
3689
3639
|
}),
|
|
3690
|
-
(0,
|
|
3640
|
+
(0, import_class_validator20.IsNotEmpty)({
|
|
3691
3641
|
message: "Blank display names are not allowed"
|
|
3692
3642
|
}),
|
|
3693
3643
|
_ts_metadata30("design:type", String)
|
|
@@ -3718,7 +3668,7 @@ NaturalPersonEntity = _ts_decorate31([
|
|
|
3718
3668
|
], NaturalPersonEntity);
|
|
3719
3669
|
|
|
3720
3670
|
// src/entities/eventLogger/AuditEventEntity.ts
|
|
3721
|
-
var
|
|
3671
|
+
var import_ssi_types2 = require("@sphereon/ssi-types");
|
|
3722
3672
|
var import_ssi_sdk15 = require("@sphereon/ssi-sdk.core");
|
|
3723
3673
|
var import_ssi_sdk16 = require("@sphereon/ssi-sdk.agent-config");
|
|
3724
3674
|
var import_typeorm31 = require("typeorm");
|
|
@@ -3780,20 +3730,20 @@ _ts_decorate32([
|
|
|
3780
3730
|
_ts_decorate32([
|
|
3781
3731
|
(0, import_typeorm31.Column)("simple-enum", {
|
|
3782
3732
|
name: "eventType",
|
|
3783
|
-
enum:
|
|
3733
|
+
enum: import_ssi_types2.LoggingEventType,
|
|
3784
3734
|
nullable: false,
|
|
3785
3735
|
unique: false
|
|
3786
3736
|
}),
|
|
3787
|
-
_ts_metadata31("design:type", typeof
|
|
3737
|
+
_ts_metadata31("design:type", typeof import_ssi_types2.LoggingEventType === "undefined" ? Object : import_ssi_types2.LoggingEventType)
|
|
3788
3738
|
], AuditEventEntity.prototype, "type", void 0);
|
|
3789
3739
|
_ts_decorate32([
|
|
3790
3740
|
(0, import_typeorm31.Column)("simple-enum", {
|
|
3791
3741
|
name: "level",
|
|
3792
|
-
enum:
|
|
3742
|
+
enum: import_ssi_types2.LogLevel,
|
|
3793
3743
|
nullable: false,
|
|
3794
3744
|
unique: false
|
|
3795
3745
|
}),
|
|
3796
|
-
_ts_metadata31("design:type", typeof
|
|
3746
|
+
_ts_metadata31("design:type", typeof import_ssi_types2.LogLevel === "undefined" ? Object : import_ssi_types2.LogLevel)
|
|
3797
3747
|
], AuditEventEntity.prototype, "level", void 0);
|
|
3798
3748
|
_ts_decorate32([
|
|
3799
3749
|
(0, import_typeorm31.Column)("text", {
|
|
@@ -3806,29 +3756,29 @@ _ts_decorate32([
|
|
|
3806
3756
|
_ts_decorate32([
|
|
3807
3757
|
(0, import_typeorm31.Column)("simple-enum", {
|
|
3808
3758
|
name: "system",
|
|
3809
|
-
enum:
|
|
3759
|
+
enum: import_ssi_types2.System,
|
|
3810
3760
|
nullable: false,
|
|
3811
3761
|
unique: false
|
|
3812
3762
|
}),
|
|
3813
|
-
_ts_metadata31("design:type", typeof
|
|
3763
|
+
_ts_metadata31("design:type", typeof import_ssi_types2.System === "undefined" ? Object : import_ssi_types2.System)
|
|
3814
3764
|
], AuditEventEntity.prototype, "system", void 0);
|
|
3815
3765
|
_ts_decorate32([
|
|
3816
3766
|
(0, import_typeorm31.Column)("simple-enum", {
|
|
3817
3767
|
name: "subSystemType",
|
|
3818
|
-
enum:
|
|
3768
|
+
enum: import_ssi_types2.SubSystem,
|
|
3819
3769
|
nullable: false,
|
|
3820
3770
|
unique: false
|
|
3821
3771
|
}),
|
|
3822
|
-
_ts_metadata31("design:type", typeof
|
|
3772
|
+
_ts_metadata31("design:type", typeof import_ssi_types2.SubSystem === "undefined" ? Object : import_ssi_types2.SubSystem)
|
|
3823
3773
|
], AuditEventEntity.prototype, "subSystemType", void 0);
|
|
3824
3774
|
_ts_decorate32([
|
|
3825
3775
|
(0, import_typeorm31.Column)("simple-enum", {
|
|
3826
3776
|
name: "actionType",
|
|
3827
|
-
enum:
|
|
3777
|
+
enum: import_ssi_types2.ActionType,
|
|
3828
3778
|
nullable: false,
|
|
3829
3779
|
unique: false
|
|
3830
3780
|
}),
|
|
3831
|
-
_ts_metadata31("design:type", typeof
|
|
3781
|
+
_ts_metadata31("design:type", typeof import_ssi_types2.ActionType === "undefined" ? Object : import_ssi_types2.ActionType)
|
|
3832
3782
|
], AuditEventEntity.prototype, "actionType", void 0);
|
|
3833
3783
|
_ts_decorate32([
|
|
3834
3784
|
(0, import_typeorm31.Column)({
|
|
@@ -3842,20 +3792,20 @@ _ts_decorate32([
|
|
|
3842
3792
|
_ts_decorate32([
|
|
3843
3793
|
(0, import_typeorm31.Column)("simple-enum", {
|
|
3844
3794
|
name: "initiatorType",
|
|
3845
|
-
enum:
|
|
3795
|
+
enum: import_ssi_types2.InitiatorType,
|
|
3846
3796
|
nullable: false,
|
|
3847
3797
|
unique: false
|
|
3848
3798
|
}),
|
|
3849
|
-
_ts_metadata31("design:type", typeof
|
|
3799
|
+
_ts_metadata31("design:type", typeof import_ssi_types2.InitiatorType === "undefined" ? Object : import_ssi_types2.InitiatorType)
|
|
3850
3800
|
], AuditEventEntity.prototype, "initiatorType", void 0);
|
|
3851
3801
|
_ts_decorate32([
|
|
3852
3802
|
(0, import_typeorm31.Column)("simple-enum", {
|
|
3853
3803
|
name: "systemCorrelationIdType",
|
|
3854
|
-
enum:
|
|
3804
|
+
enum: import_ssi_types2.SystemCorrelationIdType,
|
|
3855
3805
|
nullable: true,
|
|
3856
3806
|
unique: false
|
|
3857
3807
|
}),
|
|
3858
|
-
_ts_metadata31("design:type", typeof
|
|
3808
|
+
_ts_metadata31("design:type", typeof import_ssi_types2.SystemCorrelationIdType === "undefined" ? Object : import_ssi_types2.SystemCorrelationIdType)
|
|
3859
3809
|
], AuditEventEntity.prototype, "systemCorrelationIdType", void 0);
|
|
3860
3810
|
_ts_decorate32([
|
|
3861
3811
|
(0, import_typeorm31.Column)("text", {
|
|
@@ -4246,7 +4196,7 @@ DigitalCredentialEntity = _ts_decorate33([
|
|
|
4246
4196
|
|
|
4247
4197
|
// src/entities/presentationDefinition/PresentationDefinitionItemEntity.ts
|
|
4248
4198
|
var import_typeorm33 = require("typeorm");
|
|
4249
|
-
var
|
|
4199
|
+
var import_class_validator21 = require("class-validator");
|
|
4250
4200
|
var import_ssi_sdk18 = require("@sphereon/ssi-sdk.agent-config");
|
|
4251
4201
|
function _ts_decorate34(decorators, target, key, desc) {
|
|
4252
4202
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -4290,7 +4240,7 @@ _ts_decorate34([
|
|
|
4290
4240
|
nullable: false,
|
|
4291
4241
|
unique: false
|
|
4292
4242
|
}),
|
|
4293
|
-
(0,
|
|
4243
|
+
(0, import_class_validator21.IsNotEmpty)({
|
|
4294
4244
|
message: "A blank definition id field is not allowed"
|
|
4295
4245
|
}),
|
|
4296
4246
|
_ts_metadata33("design:type", String)
|
|
@@ -4303,7 +4253,7 @@ _ts_decorate34([
|
|
|
4303
4253
|
nullable: false,
|
|
4304
4254
|
unique: false
|
|
4305
4255
|
}),
|
|
4306
|
-
(0,
|
|
4256
|
+
(0, import_class_validator21.IsNotEmpty)({
|
|
4307
4257
|
message: "A blank version field is not allowed"
|
|
4308
4258
|
}),
|
|
4309
4259
|
_ts_metadata33("design:type", String)
|
|
@@ -4345,7 +4295,7 @@ _ts_decorate34([
|
|
|
4345
4295
|
nullable: false,
|
|
4346
4296
|
unique: false
|
|
4347
4297
|
}),
|
|
4348
|
-
(0,
|
|
4298
|
+
(0, import_class_validator21.IsNotEmpty)({
|
|
4349
4299
|
message: "A blank PD definition payload field is not allowed"
|
|
4350
4300
|
}),
|
|
4351
4301
|
_ts_metadata33("design:type", String)
|
|
@@ -4357,7 +4307,7 @@ _ts_decorate34([
|
|
|
4357
4307
|
nullable: true,
|
|
4358
4308
|
unique: false
|
|
4359
4309
|
}),
|
|
4360
|
-
(0,
|
|
4310
|
+
(0, import_class_validator21.IsNotEmpty)({
|
|
4361
4311
|
message: "A blank dcql definition payload field is not allowed"
|
|
4362
4312
|
}),
|
|
4363
4313
|
_ts_metadata33("design:type", String)
|
|
@@ -6231,62 +6181,68 @@ var IssuanceBrandingStore = class extends AbstractIssuanceBrandingStore {
|
|
|
6231
6181
|
};
|
|
6232
6182
|
|
|
6233
6183
|
// src/statusList/StatusListStore.ts
|
|
6234
|
-
var
|
|
6184
|
+
var import_ssi_types4 = require("@sphereon/ssi-types");
|
|
6235
6185
|
var import_debug4 = __toESM(require("debug"), 1);
|
|
6236
6186
|
var import_typeorm37 = require("typeorm");
|
|
6237
6187
|
|
|
6238
6188
|
// src/utils/statusList/MappingUtils.ts
|
|
6239
|
-
var
|
|
6189
|
+
var import_ssi_types3 = require("@sphereon/ssi-types");
|
|
6240
6190
|
var statusListEntityFrom = /* @__PURE__ */ __name((args) => {
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6191
|
+
switch (args.type) {
|
|
6192
|
+
case import_ssi_types3.StatusListType.StatusList2021: {
|
|
6193
|
+
const entity = new StatusList2021Entity();
|
|
6194
|
+
const sl2021 = args;
|
|
6195
|
+
entity.indexingDirection = sl2021.indexingDirection;
|
|
6196
|
+
entity.statusPurpose = sl2021.statusPurpose;
|
|
6197
|
+
setBaseFields(entity, args);
|
|
6198
|
+
Object.defineProperty(entity, "type", {
|
|
6199
|
+
value: import_ssi_types3.StatusListType.StatusList2021,
|
|
6200
|
+
enumerable: true,
|
|
6201
|
+
configurable: true
|
|
6202
|
+
});
|
|
6203
|
+
return entity;
|
|
6204
|
+
}
|
|
6205
|
+
case import_ssi_types3.StatusListType.OAuthStatusList: {
|
|
6206
|
+
const entity = new OAuthStatusListEntity();
|
|
6207
|
+
const oauthSl = args;
|
|
6208
|
+
entity.bitsPerStatus = oauthSl.bitsPerStatus;
|
|
6209
|
+
entity.expiresAt = oauthSl.expiresAt;
|
|
6210
|
+
setBaseFields(entity, args);
|
|
6211
|
+
Object.defineProperty(entity, "type", {
|
|
6212
|
+
value: import_ssi_types3.StatusListType.OAuthStatusList,
|
|
6213
|
+
enumerable: true,
|
|
6214
|
+
configurable: true
|
|
6215
|
+
});
|
|
6216
|
+
return entity;
|
|
6217
|
+
}
|
|
6218
|
+
case import_ssi_types3.StatusListType.BitstringStatusList: {
|
|
6219
|
+
const entity = new BitstringStatusListEntity();
|
|
6220
|
+
const bitstringsl = args;
|
|
6221
|
+
if (!bitstringsl.bitsPerStatus) {
|
|
6222
|
+
throw Error("bitsPerStatus must be set for BitstringStatusList");
|
|
6223
|
+
}
|
|
6224
|
+
entity.statusPurpose = bitstringsl.statusPurpose;
|
|
6225
|
+
entity.bitsPerStatus = bitstringsl.bitsPerStatus;
|
|
6226
|
+
entity.validFrom = bitstringsl.validFrom;
|
|
6227
|
+
entity.validUntil = bitstringsl.validUntil;
|
|
6228
|
+
entity.ttl = bitstringsl.ttl;
|
|
6229
|
+
setBaseFields(entity, args);
|
|
6230
|
+
Object.defineProperty(entity, "type", {
|
|
6231
|
+
value: import_ssi_types3.StatusListType.BitstringStatusList,
|
|
6232
|
+
enumerable: true,
|
|
6233
|
+
configurable: true
|
|
6234
|
+
});
|
|
6235
|
+
return entity;
|
|
6236
|
+
}
|
|
6237
|
+
default:
|
|
6238
|
+
throw new Error(`Invalid status list type ${args.type}`);
|
|
6282
6239
|
}
|
|
6283
|
-
throw new Error(`Invalid status list type ${args.type}`);
|
|
6284
6240
|
}, "statusListEntityFrom");
|
|
6285
6241
|
var statusListFrom = /* @__PURE__ */ __name((entity) => {
|
|
6286
6242
|
if (entity instanceof StatusList2021Entity) {
|
|
6287
6243
|
const result = {
|
|
6288
6244
|
...getBaseFields(entity),
|
|
6289
|
-
type:
|
|
6245
|
+
type: import_ssi_types3.StatusListType.StatusList2021,
|
|
6290
6246
|
indexingDirection: entity.indexingDirection,
|
|
6291
6247
|
statusPurpose: entity.statusPurpose
|
|
6292
6248
|
};
|
|
@@ -6295,7 +6251,7 @@ var statusListFrom = /* @__PURE__ */ __name((entity) => {
|
|
|
6295
6251
|
if (entity instanceof OAuthStatusListEntity) {
|
|
6296
6252
|
const result = {
|
|
6297
6253
|
...getBaseFields(entity),
|
|
6298
|
-
type:
|
|
6254
|
+
type: import_ssi_types3.StatusListType.OAuthStatusList,
|
|
6299
6255
|
bitsPerStatus: entity.bitsPerStatus,
|
|
6300
6256
|
expiresAt: entity.expiresAt
|
|
6301
6257
|
};
|
|
@@ -6304,9 +6260,9 @@ var statusListFrom = /* @__PURE__ */ __name((entity) => {
|
|
|
6304
6260
|
if (entity instanceof BitstringStatusListEntity) {
|
|
6305
6261
|
const result = {
|
|
6306
6262
|
...getBaseFields(entity),
|
|
6307
|
-
type:
|
|
6263
|
+
type: import_ssi_types3.StatusListType.BitstringStatusList,
|
|
6308
6264
|
statusPurpose: entity.statusPurpose,
|
|
6309
|
-
|
|
6265
|
+
bitsPerStatus: entity.bitsPerStatus,
|
|
6310
6266
|
validFrom: entity.validFrom,
|
|
6311
6267
|
validUntil: entity.validUntil,
|
|
6312
6268
|
ttl: entity.ttl
|
|
@@ -6363,33 +6319,44 @@ var StatusListStore = class {
|
|
|
6363
6319
|
...args,
|
|
6364
6320
|
id: args.statusListId
|
|
6365
6321
|
});
|
|
6366
|
-
const repo = await this.getStatusListEntryRepo();
|
|
6322
|
+
const repo = await this.getStatusListEntryRepo(statusList.type);
|
|
6367
6323
|
const results = (await repo.find({
|
|
6368
6324
|
where: {
|
|
6369
|
-
statusList,
|
|
6325
|
+
statusListId: statusList.id,
|
|
6370
6326
|
statusListIndex: (0, import_typeorm37.In)(statusListIndex)
|
|
6371
6327
|
}
|
|
6372
6328
|
})).map((index) => index.statusListIndex);
|
|
6373
6329
|
return statusListIndex.filter((index) => !results.includes(index));
|
|
6374
6330
|
}
|
|
6375
6331
|
async addStatusListEntry(args) {
|
|
6376
|
-
|
|
6332
|
+
if (!args.statusListId) {
|
|
6333
|
+
throw new Error("statusListId is required");
|
|
6334
|
+
}
|
|
6335
|
+
const statusList = await this.getStatusList({
|
|
6336
|
+
id: args.statusListId
|
|
6337
|
+
});
|
|
6338
|
+
return await (await this.getStatusListEntryRepo(statusList.type)).save(args);
|
|
6377
6339
|
}
|
|
6378
6340
|
async updateStatusListEntry(args) {
|
|
6379
|
-
const statusListId = args.statusListId
|
|
6341
|
+
const statusListId = args.statusListId;
|
|
6342
|
+
if (!statusListId) {
|
|
6343
|
+
throw new Error("statusListId is required");
|
|
6344
|
+
}
|
|
6345
|
+
const statusList = await this.getStatusList({
|
|
6346
|
+
id: statusListId
|
|
6347
|
+
});
|
|
6380
6348
|
const result = await this.getStatusListEntryByIndex({
|
|
6381
6349
|
...args,
|
|
6382
6350
|
statusListId,
|
|
6383
6351
|
errorOnNotFound: false
|
|
6384
6352
|
});
|
|
6385
6353
|
const updatedEntry = {
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
credentialId: args.credentialId
|
|
6354
|
+
...result,
|
|
6355
|
+
...args,
|
|
6356
|
+
statusListId
|
|
6390
6357
|
};
|
|
6391
6358
|
const updStatusListId = result?.statusListId ?? statusListId;
|
|
6392
|
-
const updateResult = await (await this.getStatusListEntryRepo()).upsert({
|
|
6359
|
+
const updateResult = await (await this.getStatusListEntryRepo(statusList.type)).upsert({
|
|
6393
6360
|
...result ?? {
|
|
6394
6361
|
statusListId: updStatusListId,
|
|
6395
6362
|
statusListIndex: args.statusListIndex
|
|
@@ -6401,7 +6368,7 @@ var StatusListStore = class {
|
|
|
6401
6368
|
"statusListIndex"
|
|
6402
6369
|
]
|
|
6403
6370
|
});
|
|
6404
|
-
|
|
6371
|
+
debug4(updateResult);
|
|
6405
6372
|
return await this.getStatusListEntryByIndex({
|
|
6406
6373
|
...args,
|
|
6407
6374
|
statusListId: updStatusListId,
|
|
@@ -6415,7 +6382,12 @@ var StatusListStore = class {
|
|
|
6415
6382
|
if (!statusListIndex && !entryCorrelationId) {
|
|
6416
6383
|
throw Error(`Cannot get statusList entry without either a statusListIndex or entryCorrelationId`);
|
|
6417
6384
|
}
|
|
6418
|
-
const
|
|
6385
|
+
const statusList = statusListId ? await this.getStatusList({
|
|
6386
|
+
id: statusListId
|
|
6387
|
+
}) : await this.getStatusList({
|
|
6388
|
+
correlationId: statusListCorrelationId
|
|
6389
|
+
});
|
|
6390
|
+
const result = await (await this.getStatusListEntryRepo(statusList.type)).findOne({
|
|
6419
6391
|
where: {
|
|
6420
6392
|
...statusListId && {
|
|
6421
6393
|
statusListId
|
|
@@ -6459,8 +6431,8 @@ var StatusListStore = class {
|
|
|
6459
6431
|
},
|
|
6460
6432
|
credentialId
|
|
6461
6433
|
};
|
|
6462
|
-
|
|
6463
|
-
const result = await (await this.getStatusListEntryRepo()).findOne({
|
|
6434
|
+
debug4(`Entries: ${JSON.stringify(await (await this.getStatusListEntryRepo(statusList.type)).find(), null, 2)}`);
|
|
6435
|
+
const result = await (await this.getStatusListEntryRepo(statusList.type)).findOne({
|
|
6464
6436
|
where
|
|
6465
6437
|
});
|
|
6466
6438
|
if (!result && args.errorOnNotFound) {
|
|
@@ -6476,7 +6448,11 @@ var StatusListStore = class {
|
|
|
6476
6448
|
error2 = true;
|
|
6477
6449
|
}
|
|
6478
6450
|
if (!error) {
|
|
6479
|
-
const
|
|
6451
|
+
const statusList = await this.getStatusList({
|
|
6452
|
+
id: args.statusListId,
|
|
6453
|
+
correlationId: args.statusListCorrelationId
|
|
6454
|
+
});
|
|
6455
|
+
const result = await (await this.getStatusListEntryRepo(statusList.type)).delete({
|
|
6480
6456
|
...args.statusListId && {
|
|
6481
6457
|
statusList: args.statusListId
|
|
6482
6458
|
},
|
|
@@ -6497,9 +6473,12 @@ var StatusListStore = class {
|
|
|
6497
6473
|
error2 = true;
|
|
6498
6474
|
}
|
|
6499
6475
|
if (error) {
|
|
6500
|
-
console.
|
|
6476
|
+
console.error(`Could not delete statusList ${args.statusListId} entry by index ${args.statusListIndex}`);
|
|
6501
6477
|
} else {
|
|
6502
|
-
const
|
|
6478
|
+
const statusList = await this.getStatusList({
|
|
6479
|
+
id: args.statusListId
|
|
6480
|
+
});
|
|
6481
|
+
const result = await (await this.getStatusListEntryRepo(statusList.type)).delete({
|
|
6503
6482
|
...args.statusListId && {
|
|
6504
6483
|
statusList: args.statusListId
|
|
6505
6484
|
},
|
|
@@ -6513,15 +6492,16 @@ var StatusListStore = class {
|
|
|
6513
6492
|
return !error;
|
|
6514
6493
|
}
|
|
6515
6494
|
async getStatusListEntries(args) {
|
|
6516
|
-
|
|
6495
|
+
const statusList = await this.getStatusList({
|
|
6496
|
+
id: args.statusListId
|
|
6497
|
+
});
|
|
6498
|
+
const results = await (await this.getStatusListEntryRepo(statusList.type)).find({
|
|
6517
6499
|
where: {
|
|
6518
6500
|
...args?.filter,
|
|
6519
6501
|
statusList: args.statusListId
|
|
6520
6502
|
}
|
|
6521
6503
|
});
|
|
6522
|
-
|
|
6523
|
-
async getStatusList(args) {
|
|
6524
|
-
return statusListFrom(await this.getStatusListEntity(args));
|
|
6504
|
+
return results;
|
|
6525
6505
|
}
|
|
6526
6506
|
async getStatusListEntity(args) {
|
|
6527
6507
|
if (!args.id && !args.correlationId) {
|
|
@@ -6545,6 +6525,10 @@ var StatusListStore = class {
|
|
|
6545
6525
|
}
|
|
6546
6526
|
return result;
|
|
6547
6527
|
}
|
|
6528
|
+
async getStatusList(args) {
|
|
6529
|
+
const entity = await this.getStatusListEntity(args);
|
|
6530
|
+
return statusListFrom(entity);
|
|
6531
|
+
}
|
|
6548
6532
|
async getStatusLists(args) {
|
|
6549
6533
|
const result = await (await this.getStatusListRepo()).find({
|
|
6550
6534
|
where: args.filter
|
|
@@ -6585,7 +6569,7 @@ var StatusListStore = class {
|
|
|
6585
6569
|
}
|
|
6586
6570
|
async removeStatusList(args) {
|
|
6587
6571
|
const result = await this.getStatusListEntity(args);
|
|
6588
|
-
await (await this.getStatusListEntryRepo()).delete({
|
|
6572
|
+
await (await this.getStatusListEntryRepo(result.type)).delete({
|
|
6589
6573
|
statusListId: result.id
|
|
6590
6574
|
});
|
|
6591
6575
|
const deletedEntity = await (await this.getStatusListRepo()).remove(result);
|
|
@@ -6597,18 +6581,24 @@ var StatusListStore = class {
|
|
|
6597
6581
|
async getStatusListRepo(type) {
|
|
6598
6582
|
const dataSource = await this.getDS();
|
|
6599
6583
|
switch (type) {
|
|
6600
|
-
case
|
|
6584
|
+
case import_ssi_types4.StatusListType.StatusList2021:
|
|
6601
6585
|
return dataSource.getRepository(StatusList2021Entity);
|
|
6602
|
-
case
|
|
6586
|
+
case import_ssi_types4.StatusListType.OAuthStatusList:
|
|
6603
6587
|
return dataSource.getRepository(OAuthStatusListEntity);
|
|
6604
|
-
case
|
|
6588
|
+
case import_ssi_types4.StatusListType.BitstringStatusList:
|
|
6605
6589
|
return dataSource.getRepository(BitstringStatusListEntity);
|
|
6606
6590
|
default:
|
|
6607
6591
|
return dataSource.getRepository(StatusListEntity);
|
|
6608
6592
|
}
|
|
6609
6593
|
}
|
|
6610
|
-
async getStatusListEntryRepo() {
|
|
6611
|
-
|
|
6594
|
+
async getStatusListEntryRepo(type) {
|
|
6595
|
+
const dataSource = await this.getDS();
|
|
6596
|
+
switch (type) {
|
|
6597
|
+
case import_ssi_types4.StatusListType.BitstringStatusList:
|
|
6598
|
+
return dataSource.getRepository(BitstringStatusListEntryEntity);
|
|
6599
|
+
default:
|
|
6600
|
+
return dataSource.getRepository(StatusListEntryEntity);
|
|
6601
|
+
}
|
|
6612
6602
|
}
|
|
6613
6603
|
};
|
|
6614
6604
|
|
|
@@ -6620,15 +6610,15 @@ var AbstractEventLoggerStore = class {
|
|
|
6620
6610
|
};
|
|
6621
6611
|
|
|
6622
6612
|
// src/eventLogger/EventLoggerStore.ts
|
|
6623
|
-
var
|
|
6613
|
+
var import_ssi_types6 = require("@sphereon/ssi-types");
|
|
6624
6614
|
var import_debug5 = __toESM(require("debug"), 1);
|
|
6625
6615
|
|
|
6626
6616
|
// src/utils/eventLogger/MappingUtils.ts
|
|
6627
|
-
var
|
|
6617
|
+
var import_ssi_types5 = require("@sphereon/ssi-types");
|
|
6628
6618
|
var auditEventFrom = /* @__PURE__ */ __name((event) => {
|
|
6629
6619
|
const result = {
|
|
6630
6620
|
id: event.id,
|
|
6631
|
-
type:
|
|
6621
|
+
type: import_ssi_types5.LoggingEventType.AUDIT,
|
|
6632
6622
|
description: event.description,
|
|
6633
6623
|
timestamp: event.timestamp,
|
|
6634
6624
|
level: event.level,
|
|
@@ -6655,7 +6645,7 @@ var auditEventFrom = /* @__PURE__ */ __name((event) => {
|
|
|
6655
6645
|
}, "auditEventFrom");
|
|
6656
6646
|
var auditEventEntityFrom = /* @__PURE__ */ __name((args) => {
|
|
6657
6647
|
const auditEventEntity = new AuditEventEntity();
|
|
6658
|
-
auditEventEntity.type =
|
|
6648
|
+
auditEventEntity.type = import_ssi_types5.LoggingEventType.AUDIT;
|
|
6659
6649
|
auditEventEntity.timestamp = args.timestamp;
|
|
6660
6650
|
auditEventEntity.level = args.level;
|
|
6661
6651
|
auditEventEntity.correlationId = args.correlationId;
|
|
@@ -6679,7 +6669,7 @@ var auditEventEntityFrom = /* @__PURE__ */ __name((args) => {
|
|
|
6679
6669
|
var activityEventFrom = /* @__PURE__ */ __name((event) => {
|
|
6680
6670
|
const result = {
|
|
6681
6671
|
id: event.id,
|
|
6682
|
-
type:
|
|
6672
|
+
type: import_ssi_types5.LoggingEventType.ACTIVITY,
|
|
6683
6673
|
credentialType: event.credentialType,
|
|
6684
6674
|
originalCredential: event.originalCredential,
|
|
6685
6675
|
credentialHash: event.credentialHash,
|
|
@@ -6711,7 +6701,7 @@ var activityEventFrom = /* @__PURE__ */ __name((event) => {
|
|
|
6711
6701
|
}, "activityEventFrom");
|
|
6712
6702
|
var activityEventEntityFrom = /* @__PURE__ */ __name((args) => {
|
|
6713
6703
|
const activityEventEntity = new AuditEventEntity();
|
|
6714
|
-
activityEventEntity.type =
|
|
6704
|
+
activityEventEntity.type = import_ssi_types5.LoggingEventType.ACTIVITY;
|
|
6715
6705
|
activityEventEntity.timestamp = args.timestamp;
|
|
6716
6706
|
activityEventEntity.level = args.level;
|
|
6717
6707
|
activityEventEntity.correlationId = args.correlationId;
|
|
@@ -6753,11 +6743,11 @@ var EventLoggerStore = class extends AbstractEventLoggerStore {
|
|
|
6753
6743
|
const { filter = [] } = args ?? {};
|
|
6754
6744
|
const auditEventsFilter = filter.map((item) => ({
|
|
6755
6745
|
...item,
|
|
6756
|
-
type:
|
|
6746
|
+
type: import_ssi_types6.LoggingEventType.AUDIT
|
|
6757
6747
|
}));
|
|
6758
6748
|
if (auditEventsFilter.length === 0) {
|
|
6759
6749
|
auditEventsFilter.push({
|
|
6760
|
-
type:
|
|
6750
|
+
type: import_ssi_types6.LoggingEventType.AUDIT
|
|
6761
6751
|
});
|
|
6762
6752
|
}
|
|
6763
6753
|
const connection = await this.dbConnection;
|
|
@@ -6779,11 +6769,11 @@ var EventLoggerStore = class extends AbstractEventLoggerStore {
|
|
|
6779
6769
|
const { filter = [] } = args ?? {};
|
|
6780
6770
|
const activityEventsFilter = filter.map((item) => ({
|
|
6781
6771
|
...item,
|
|
6782
|
-
type:
|
|
6772
|
+
type: import_ssi_types6.LoggingEventType.ACTIVITY
|
|
6783
6773
|
}));
|
|
6784
6774
|
if (activityEventsFilter.length === 0) {
|
|
6785
6775
|
activityEventsFilter.push({
|
|
6786
|
-
type:
|
|
6776
|
+
type: import_ssi_types6.LoggingEventType.ACTIVITY
|
|
6787
6777
|
});
|
|
6788
6778
|
}
|
|
6789
6779
|
const connection = await this.dbConnection;
|
|
@@ -9086,41 +9076,32 @@ var CreateBitstringStatusListPG1741895823000 = class {
|
|
|
9086
9076
|
}
|
|
9087
9077
|
name = "CreateBitstringStatusList1741895823000";
|
|
9088
9078
|
async up(queryRunner) {
|
|
9089
|
-
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "
|
|
9079
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "bitsPerStatus" integer DEFAULT 1`);
|
|
9090
9080
|
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "ttl" integer`);
|
|
9091
9081
|
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "validFrom" TIMESTAMP`);
|
|
9092
9082
|
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "validUntil" TIMESTAMP`);
|
|
9093
9083
|
await queryRunner.query(`ALTER TABLE "StatusList" DROP CONSTRAINT IF EXISTS "CHK_StatusList_type"`);
|
|
9094
9084
|
await queryRunner.query(`ALTER TABLE "StatusList" ADD CONSTRAINT "CHK_StatusList_type" CHECK ("type" IN ('StatusList2021', 'OAuthStatusList', 'BitstringStatusList'))`);
|
|
9095
|
-
await queryRunner.query(`
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
"correlationId" character varying(255),
|
|
9102
|
-
"statusPurpose" character varying NOT NULL,
|
|
9103
|
-
"statusSize" integer DEFAULT 1,
|
|
9104
|
-
"statusMessage" text,
|
|
9105
|
-
"statusReference" text,
|
|
9106
|
-
CONSTRAINT "PK_BitstringStatusListEntry" PRIMARY KEY ("statusListId", "statusListIndex")
|
|
9107
|
-
)
|
|
9108
|
-
`);
|
|
9109
|
-
await queryRunner.query(`
|
|
9110
|
-
ALTER TABLE "BitstringStatusListEntry"
|
|
9111
|
-
ADD CONSTRAINT "FK_BitstringStatusListEntry_statusListId"
|
|
9112
|
-
FOREIGN KEY ("statusListId") REFERENCES "StatusList"("id") ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
9113
|
-
`);
|
|
9085
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "type" character varying NOT NULL DEFAULT 'StatusListEntryEntity'`);
|
|
9086
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "statusPurpose" character varying`);
|
|
9087
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "bitsPerStatus" integer DEFAULT 1`);
|
|
9088
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "statusMessage" text`);
|
|
9089
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "statusReference" text`);
|
|
9090
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD CONSTRAINT "CHK_StatusListEntry_type" CHECK ("type" IN ('StatusListEntryEntity', 'bitstring'))`);
|
|
9114
9091
|
}
|
|
9115
9092
|
async down(queryRunner) {
|
|
9116
|
-
await queryRunner.query(`ALTER TABLE "
|
|
9117
|
-
await queryRunner.query(`
|
|
9093
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP CONSTRAINT "CHK_StatusListEntry_type"`);
|
|
9094
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP COLUMN "statusReference"`);
|
|
9095
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP COLUMN "statusMessage"`);
|
|
9096
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP COLUMN "bitsPerStatus"`);
|
|
9097
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP COLUMN "statusPurpose"`);
|
|
9098
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP COLUMN "type"`);
|
|
9118
9099
|
await queryRunner.query(`ALTER TABLE "StatusList" DROP CONSTRAINT "CHK_StatusList_type"`);
|
|
9119
9100
|
await queryRunner.query(`ALTER TABLE "StatusList" ADD CONSTRAINT "CHK_StatusList_type" CHECK ("type" IN ('StatusList2021', 'OAuthStatusList'))`);
|
|
9120
9101
|
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "validUntil"`);
|
|
9121
9102
|
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "validFrom"`);
|
|
9122
9103
|
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "ttl"`);
|
|
9123
|
-
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "
|
|
9104
|
+
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "bitsPerStatus"`);
|
|
9124
9105
|
}
|
|
9125
9106
|
};
|
|
9126
9107
|
|
|
@@ -9140,13 +9121,12 @@ var CreateBitstringStatusListSqlite1741895823001 = class {
|
|
|
9140
9121
|
"type" varchar CHECK( "type" IN ('StatusList2021', 'OAuthStatusList', 'BitstringStatusList') ) NOT NULL DEFAULT ('StatusList2021'),
|
|
9141
9122
|
"driverType" varchar CHECK( "driverType" IN ('agent_typeorm','agent_kv_store','github','agent_filesystem') ) NOT NULL DEFAULT ('agent_typeorm'),
|
|
9142
9123
|
"credentialIdMode" varchar CHECK( "credentialIdMode" IN ('ISSUANCE','PERSISTENCE','NEVER') ) NOT NULL DEFAULT ('ISSUANCE'),
|
|
9143
|
-
"proofFormat" varchar CHECK( "proofFormat" IN ('lds','jwt') ) NOT NULL DEFAULT ('lds'),
|
|
9124
|
+
"proofFormat" varchar CHECK( "proofFormat" IN ('lds','jwt', 'vc+jwt') ) NOT NULL DEFAULT ('lds'),
|
|
9144
9125
|
"indexingDirection" varchar CHECK( "indexingDirection" IN ('rightToLeft') ),
|
|
9145
9126
|
"statusPurpose" varchar,
|
|
9146
9127
|
"statusListCredential" text,
|
|
9147
|
-
"bitsPerStatus" integer,
|
|
9148
9128
|
"expiresAt" datetime,
|
|
9149
|
-
"
|
|
9129
|
+
"bitsPerStatus" integer DEFAULT (1),
|
|
9150
9130
|
"ttl" integer,
|
|
9151
9131
|
"validFrom" datetime,
|
|
9152
9132
|
"validUntil" datetime,
|
|
@@ -9168,22 +9148,59 @@ var CreateBitstringStatusListSqlite1741895823001 = class {
|
|
|
9168
9148
|
await queryRunner.query(`DROP TABLE "StatusList"`);
|
|
9169
9149
|
await queryRunner.query(`ALTER TABLE "temporary_StatusList" RENAME TO "StatusList"`);
|
|
9170
9150
|
await queryRunner.query(`
|
|
9171
|
-
CREATE TABLE "
|
|
9151
|
+
CREATE TABLE "temporary_StatusListEntry" (
|
|
9172
9152
|
"statusListId" varchar NOT NULL,
|
|
9173
9153
|
"statusListIndex" integer NOT NULL,
|
|
9174
9154
|
"credentialId" text,
|
|
9175
9155
|
"credentialHash" varchar(128),
|
|
9176
9156
|
"correlationId" varchar(255),
|
|
9177
|
-
"
|
|
9178
|
-
"
|
|
9157
|
+
"value" varchar(50),
|
|
9158
|
+
"type" varchar CHECK( "type" IN ('StatusListEntryEntity', 'bitstring') ) NOT NULL DEFAULT ('StatusListEntryEntity'),
|
|
9159
|
+
"statusPurpose" varchar,
|
|
9160
|
+
"bitsPerStatus" integer DEFAULT (1),
|
|
9179
9161
|
"statusMessage" text,
|
|
9180
9162
|
"statusReference" text,
|
|
9181
9163
|
PRIMARY KEY ("statusListId", "statusListIndex")
|
|
9182
9164
|
)
|
|
9183
9165
|
`);
|
|
9166
|
+
await queryRunner.query(`
|
|
9167
|
+
INSERT INTO "temporary_StatusListEntry"(
|
|
9168
|
+
"statusListId", "statusListIndex", "credentialId", "credentialHash",
|
|
9169
|
+
"correlationId", "value", "type"
|
|
9170
|
+
)
|
|
9171
|
+
SELECT
|
|
9172
|
+
"statusListId", "statusListIndex", "credentialId", "credentialHash",
|
|
9173
|
+
"correlationId", "value", 'StatusListEntryEntity'
|
|
9174
|
+
FROM "StatusListEntry"
|
|
9175
|
+
`);
|
|
9176
|
+
await queryRunner.query(`DROP TABLE "StatusListEntry"`);
|
|
9177
|
+
await queryRunner.query(`ALTER TABLE "temporary_StatusListEntry" RENAME TO "StatusListEntry"`);
|
|
9184
9178
|
}
|
|
9185
9179
|
async down(queryRunner) {
|
|
9186
|
-
await queryRunner.query(`
|
|
9180
|
+
await queryRunner.query(`
|
|
9181
|
+
CREATE TABLE "temporary_StatusListEntry" (
|
|
9182
|
+
"statusListId" varchar NOT NULL,
|
|
9183
|
+
"statusListIndex" integer NOT NULL,
|
|
9184
|
+
"credentialId" text,
|
|
9185
|
+
"credentialHash" varchar(128),
|
|
9186
|
+
"correlationId" varchar(255),
|
|
9187
|
+
"value" varchar(50),
|
|
9188
|
+
PRIMARY KEY ("statusListId", "statusListIndex")
|
|
9189
|
+
)
|
|
9190
|
+
`);
|
|
9191
|
+
await queryRunner.query(`
|
|
9192
|
+
INSERT INTO "temporary_StatusListEntry"(
|
|
9193
|
+
"statusListId", "statusListIndex", "credentialId", "credentialHash",
|
|
9194
|
+
"correlationId", "value"
|
|
9195
|
+
)
|
|
9196
|
+
SELECT
|
|
9197
|
+
"statusListId", "statusListIndex", "credentialId", "credentialHash",
|
|
9198
|
+
"correlationId", "value"
|
|
9199
|
+
FROM "StatusListEntry"
|
|
9200
|
+
WHERE "type" = 'StatusListEntryEntity'
|
|
9201
|
+
`);
|
|
9202
|
+
await queryRunner.query(`DROP TABLE "StatusListEntry"`);
|
|
9203
|
+
await queryRunner.query(`ALTER TABLE "temporary_StatusListEntry" RENAME TO "StatusListEntry"`);
|
|
9187
9204
|
await queryRunner.query(`
|
|
9188
9205
|
CREATE TABLE "temporary_StatusList" (
|
|
9189
9206
|
"id" varchar PRIMARY KEY NOT NULL,
|
|
@@ -9193,7 +9210,7 @@ var CreateBitstringStatusListSqlite1741895823001 = class {
|
|
|
9193
9210
|
"type" varchar CHECK( "type" IN ('StatusList2021', 'OAuthStatusList') ) NOT NULL DEFAULT ('StatusList2021'),
|
|
9194
9211
|
"driverType" varchar CHECK( "driverType" IN ('agent_typeorm','agent_kv_store','github','agent_filesystem') ) NOT NULL DEFAULT ('agent_typeorm'),
|
|
9195
9212
|
"credentialIdMode" varchar CHECK( "credentialIdMode" IN ('ISSUANCE','PERSISTENCE','NEVER') ) NOT NULL DEFAULT ('ISSUANCE'),
|
|
9196
|
-
"proofFormat" varchar CHECK( "proofFormat" IN ('lds','jwt') ) NOT NULL DEFAULT ('lds'),
|
|
9213
|
+
"proofFormat" varchar CHECK( "proofFormat" IN ('lds','jwt', 'vc+jwt') ) NOT NULL DEFAULT ('lds'),
|
|
9197
9214
|
"indexingDirection" varchar CHECK( "indexingDirection" IN ('rightToLeft') ),
|
|
9198
9215
|
"statusPurpose" varchar,
|
|
9199
9216
|
"statusListCredential" text,
|
|
@@ -9307,7 +9324,7 @@ var DataStoreMigrations = [
|
|
|
9307
9324
|
];
|
|
9308
9325
|
|
|
9309
9326
|
// src/utils/digitalCredential/MappingUtils.ts
|
|
9310
|
-
var
|
|
9327
|
+
var import_ssi_types7 = require("@sphereon/ssi-types");
|
|
9311
9328
|
var import_utils = require("@veramo/utils");
|
|
9312
9329
|
var import_ssi_sdk23 = require("@sphereon/ssi-sdk.core");
|
|
9313
9330
|
function determineDocumentType(raw) {
|
|
@@ -9315,11 +9332,11 @@ function determineDocumentType(raw) {
|
|
|
9315
9332
|
if (!rawDocument) {
|
|
9316
9333
|
throw new Error(`Couldn't parse the credential: ${raw}`);
|
|
9317
9334
|
}
|
|
9318
|
-
const hasProof =
|
|
9319
|
-
const isCredential = isHex(raw) ||
|
|
9320
|
-
const isPresentation =
|
|
9335
|
+
const hasProof = import_ssi_types7.CredentialMapper.hasProof(rawDocument);
|
|
9336
|
+
const isCredential = isHex(raw) || import_ssi_types7.ObjectUtils.isBase64(raw) || import_ssi_types7.CredentialMapper.isCredential(rawDocument);
|
|
9337
|
+
const isPresentation = import_ssi_types7.CredentialMapper.isPresentation(rawDocument);
|
|
9321
9338
|
if (isCredential) {
|
|
9322
|
-
return hasProof || isHex(raw) ||
|
|
9339
|
+
return hasProof || isHex(raw) || import_ssi_types7.ObjectUtils.isBase64(raw) ? DocumentType.VC : DocumentType.C;
|
|
9323
9340
|
} else if (isPresentation) {
|
|
9324
9341
|
return hasProof ? DocumentType.VP : DocumentType.P;
|
|
9325
9342
|
}
|
|
@@ -9331,9 +9348,9 @@ function isHex(input) {
|
|
|
9331
9348
|
}
|
|
9332
9349
|
__name(isHex, "isHex");
|
|
9333
9350
|
function parseRawDocument(raw) {
|
|
9334
|
-
if (isHex(raw) ||
|
|
9351
|
+
if (isHex(raw) || import_ssi_types7.ObjectUtils.isBase64(raw)) {
|
|
9335
9352
|
return raw;
|
|
9336
|
-
} else if (
|
|
9353
|
+
} else if (import_ssi_types7.CredentialMapper.isJwtEncoded(raw) || import_ssi_types7.CredentialMapper.isSdJwtEncoded(raw)) {
|
|
9337
9354
|
return raw;
|
|
9338
9355
|
}
|
|
9339
9356
|
try {
|
|
@@ -9345,9 +9362,9 @@ function parseRawDocument(raw) {
|
|
|
9345
9362
|
__name(parseRawDocument, "parseRawDocument");
|
|
9346
9363
|
function ensureRawDocument(input) {
|
|
9347
9364
|
if (typeof input === "string") {
|
|
9348
|
-
if (isHex(input) ||
|
|
9365
|
+
if (isHex(input) || import_ssi_types7.ObjectUtils.isBase64(input)) {
|
|
9349
9366
|
return input;
|
|
9350
|
-
} else if (
|
|
9367
|
+
} else if (import_ssi_types7.CredentialMapper.isJwtEncoded(input) || import_ssi_types7.CredentialMapper.isSdJwtEncoded(input)) {
|
|
9351
9368
|
return input;
|
|
9352
9369
|
}
|
|
9353
9370
|
throw Error("Unknown input to be mapped as rawDocument");
|
|
@@ -9361,13 +9378,13 @@ function ensureRawDocument(input) {
|
|
|
9361
9378
|
__name(ensureRawDocument, "ensureRawDocument");
|
|
9362
9379
|
function determineCredentialDocumentFormat(documentFormat) {
|
|
9363
9380
|
switch (documentFormat) {
|
|
9364
|
-
case
|
|
9381
|
+
case import_ssi_types7.DocumentFormat.JSONLD:
|
|
9365
9382
|
return CredentialDocumentFormat.JSON_LD;
|
|
9366
|
-
case
|
|
9383
|
+
case import_ssi_types7.DocumentFormat.JWT:
|
|
9367
9384
|
return CredentialDocumentFormat.JWT;
|
|
9368
|
-
case
|
|
9385
|
+
case import_ssi_types7.DocumentFormat.SD_JWT_VC:
|
|
9369
9386
|
return CredentialDocumentFormat.SD_JWT;
|
|
9370
|
-
case
|
|
9387
|
+
case import_ssi_types7.DocumentFormat.MSO_MDOC:
|
|
9371
9388
|
return CredentialDocumentFormat.MSO_MDOC;
|
|
9372
9389
|
default:
|
|
9373
9390
|
throw new Error(`Not supported document format: ${documentFormat}`);
|
|
@@ -9406,14 +9423,14 @@ var safeStringify = /* @__PURE__ */ __name((object) => {
|
|
|
9406
9423
|
}, "safeStringify");
|
|
9407
9424
|
var nonPersistedDigitalCredentialEntityFromAddArgs = /* @__PURE__ */ __name((addCredentialArgs) => {
|
|
9408
9425
|
const documentType = determineDocumentType(addCredentialArgs.rawDocument);
|
|
9409
|
-
const documentFormat =
|
|
9426
|
+
const documentFormat = import_ssi_types7.CredentialMapper.detectDocumentType(addCredentialArgs.rawDocument);
|
|
9410
9427
|
const hasher = addCredentialArgs?.opts?.hasher ?? import_ssi_sdk23.defaultHasher;
|
|
9411
|
-
if (documentFormat ===
|
|
9428
|
+
if (documentFormat === import_ssi_types7.DocumentFormat.SD_JWT_VC && !addCredentialArgs.opts?.hasher) {
|
|
9412
9429
|
throw new Error("No hasher function is provided for SD_JWT credential.");
|
|
9413
9430
|
}
|
|
9414
|
-
const uniformDocument = documentType === DocumentType.VC || documentType === DocumentType.C ?
|
|
9431
|
+
const uniformDocument = documentType === DocumentType.VC || documentType === DocumentType.C ? import_ssi_types7.CredentialMapper.toUniformCredential(addCredentialArgs.rawDocument, {
|
|
9415
9432
|
hasher
|
|
9416
|
-
}) :
|
|
9433
|
+
}) : import_ssi_types7.CredentialMapper.toUniformPresentation(addCredentialArgs.rawDocument, {
|
|
9417
9434
|
hasher
|
|
9418
9435
|
});
|
|
9419
9436
|
const validFrom = getValidFrom(uniformDocument);
|