@sphereon/ssi-sdk.data-store 0.34.1-next.3 → 0.34.1-next.40
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 +979 -502
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +111 -26
- package/dist/index.d.ts +111 -26
- package/dist/index.js +925 -448
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/__tests__/statusList.entities.test.ts +58 -1
- package/src/__tests__/statusList.store.test.ts +64 -1
- package/src/entities/statusList/BitstringStatusListEntryEntity.ts +60 -0
- package/src/entities/statusList/StatusList2021EntryEntity.ts +4 -3
- package/src/entities/statusList/StatusListEntities.ts +54 -5
- package/src/index.ts +12 -2
- package/src/migrations/generic/12-CreateBitstringStatusList.ts +52 -0
- package/src/migrations/generic/index.ts +2 -1
- package/src/migrations/postgres/1741895823000-CreateBitstringStatusList.ts +53 -0
- package/src/migrations/sqlite/1741895823001-CreateBitstringStatusList.ts +145 -0
- package/src/statusList/IStatusListStore.ts +14 -11
- package/src/statusList/StatusListStore.ts +73 -35
- package/src/types/statusList/IAbstractStatusListStore.ts +54 -4
- package/src/types/statusList/statusList.ts +50 -2
- package/src/utils/statusList/MappingUtils.ts +71 -30
package/dist/index.js
CHANGED
|
@@ -8,55 +8,55 @@ import typeorm6 from "typeorm";
|
|
|
8
8
|
import typeorm5 from "typeorm";
|
|
9
9
|
|
|
10
10
|
// src/types/contact/contact.ts
|
|
11
|
-
var ConnectionType = /* @__PURE__ */ function(ConnectionType2) {
|
|
11
|
+
var ConnectionType = /* @__PURE__ */ (function(ConnectionType2) {
|
|
12
12
|
ConnectionType2["OPENID_CONNECT"] = "OIDC";
|
|
13
13
|
ConnectionType2["SIOPv2"] = "SIOPv2";
|
|
14
14
|
ConnectionType2["SIOPv2_OpenID4VP"] = "SIOPv2+OpenID4VP";
|
|
15
15
|
return ConnectionType2;
|
|
16
|
-
}({});
|
|
17
|
-
var CorrelationIdentifierType = /* @__PURE__ */ function(CorrelationIdentifierType2) {
|
|
16
|
+
})({});
|
|
17
|
+
var CorrelationIdentifierType = /* @__PURE__ */ (function(CorrelationIdentifierType2) {
|
|
18
18
|
CorrelationIdentifierType2["DID"] = "did";
|
|
19
19
|
CorrelationIdentifierType2["URL"] = "url";
|
|
20
20
|
return CorrelationIdentifierType2;
|
|
21
|
-
}({});
|
|
22
|
-
var PartyTypeType = /* @__PURE__ */ function(PartyTypeType2) {
|
|
21
|
+
})({});
|
|
22
|
+
var PartyTypeType = /* @__PURE__ */ (function(PartyTypeType2) {
|
|
23
23
|
PartyTypeType2["NATURAL_PERSON"] = "naturalPerson";
|
|
24
24
|
PartyTypeType2["ORGANIZATION"] = "organization";
|
|
25
25
|
return PartyTypeType2;
|
|
26
|
-
}({});
|
|
27
|
-
var PartyOrigin = /* @__PURE__ */ function(PartyOrigin2) {
|
|
26
|
+
})({});
|
|
27
|
+
var PartyOrigin = /* @__PURE__ */ (function(PartyOrigin2) {
|
|
28
28
|
PartyOrigin2["INTERNAL"] = "INTERNAL";
|
|
29
29
|
PartyOrigin2["EXTERNAL"] = "EXTERNAL";
|
|
30
30
|
return PartyOrigin2;
|
|
31
|
-
}({});
|
|
32
|
-
var IdentityOrigin = /* @__PURE__ */ function(IdentityOrigin2) {
|
|
31
|
+
})({});
|
|
32
|
+
var IdentityOrigin = /* @__PURE__ */ (function(IdentityOrigin2) {
|
|
33
33
|
IdentityOrigin2["INTERNAL"] = "INTERNAL";
|
|
34
34
|
IdentityOrigin2["EXTERNAL"] = "EXTERNAL";
|
|
35
35
|
return IdentityOrigin2;
|
|
36
|
-
}({});
|
|
36
|
+
})({});
|
|
37
37
|
|
|
38
38
|
// src/types/digitalCredential/enums.ts
|
|
39
|
-
var DocumentType = /* @__PURE__ */ function(DocumentType2) {
|
|
39
|
+
var DocumentType = /* @__PURE__ */ (function(DocumentType2) {
|
|
40
40
|
DocumentType2["VC"] = "VC";
|
|
41
41
|
DocumentType2["VP"] = "VP";
|
|
42
42
|
DocumentType2["P"] = "P";
|
|
43
43
|
DocumentType2["C"] = "C";
|
|
44
44
|
return DocumentType2;
|
|
45
|
-
}({});
|
|
46
|
-
var RegulationType = /* @__PURE__ */ function(RegulationType2) {
|
|
45
|
+
})({});
|
|
46
|
+
var RegulationType = /* @__PURE__ */ (function(RegulationType2) {
|
|
47
47
|
RegulationType2["PID"] = "PID";
|
|
48
48
|
RegulationType2["QEAA"] = "QEAA";
|
|
49
49
|
RegulationType2["EAA"] = "EAA";
|
|
50
50
|
RegulationType2["NON_REGULATED"] = "NON_REGULATED";
|
|
51
51
|
return RegulationType2;
|
|
52
|
-
}({});
|
|
53
|
-
var CredentialDocumentFormat = /* @__PURE__ */ function(CredentialDocumentFormat2) {
|
|
52
|
+
})({});
|
|
53
|
+
var CredentialDocumentFormat = /* @__PURE__ */ (function(CredentialDocumentFormat2) {
|
|
54
54
|
CredentialDocumentFormat2["JSON_LD"] = "JSON_LD";
|
|
55
55
|
CredentialDocumentFormat2["JWT"] = "JWT";
|
|
56
56
|
CredentialDocumentFormat2["SD_JWT"] = "SD_JWT";
|
|
57
57
|
CredentialDocumentFormat2["MSO_MDOC"] = "MSO_MDOC";
|
|
58
58
|
return CredentialDocumentFormat2;
|
|
59
|
-
}({});
|
|
59
|
+
})({});
|
|
60
60
|
(function(CredentialDocumentFormat2) {
|
|
61
61
|
function fromSpecValue(credentialFormat) {
|
|
62
62
|
const format = credentialFormat.toLowerCase();
|
|
@@ -89,26 +89,26 @@ var CredentialDocumentFormat = /* @__PURE__ */ function(CredentialDocumentFormat
|
|
|
89
89
|
__name(toSpecValue, "toSpecValue");
|
|
90
90
|
CredentialDocumentFormat2.toSpecValue = toSpecValue;
|
|
91
91
|
})(CredentialDocumentFormat || (CredentialDocumentFormat = {}));
|
|
92
|
-
var CredentialCorrelationType = /* @__PURE__ */ function(CredentialCorrelationType2) {
|
|
92
|
+
var CredentialCorrelationType = /* @__PURE__ */ (function(CredentialCorrelationType2) {
|
|
93
93
|
CredentialCorrelationType2["DID"] = "DID";
|
|
94
94
|
CredentialCorrelationType2["X509_SAN"] = "X509_SAN";
|
|
95
95
|
CredentialCorrelationType2["KID"] = "KID";
|
|
96
96
|
CredentialCorrelationType2["URL"] = "URL";
|
|
97
97
|
return CredentialCorrelationType2;
|
|
98
|
-
}({});
|
|
99
|
-
var CredentialRole = /* @__PURE__ */ function(CredentialRole2) {
|
|
98
|
+
})({});
|
|
99
|
+
var CredentialRole = /* @__PURE__ */ (function(CredentialRole2) {
|
|
100
100
|
CredentialRole2["ISSUER"] = "ISSUER";
|
|
101
101
|
CredentialRole2["VERIFIER"] = "VERIFIER";
|
|
102
102
|
CredentialRole2["HOLDER"] = "HOLDER";
|
|
103
103
|
CredentialRole2["FEDERATION_TRUST_ANCHOR"] = "FEDERATION_TRUST_ANCHOR";
|
|
104
104
|
return CredentialRole2;
|
|
105
|
-
}({});
|
|
106
|
-
var CredentialStateType = /* @__PURE__ */ function(CredentialStateType2) {
|
|
105
|
+
})({});
|
|
106
|
+
var CredentialStateType = /* @__PURE__ */ (function(CredentialStateType2) {
|
|
107
107
|
CredentialStateType2["REVOKED"] = "REVOKED";
|
|
108
108
|
CredentialStateType2["VERIFIED"] = "VERIFIED";
|
|
109
109
|
CredentialStateType2["EXPIRED"] = "EXPIRED";
|
|
110
110
|
return CredentialStateType2;
|
|
111
|
-
}({});
|
|
111
|
+
})({});
|
|
112
112
|
|
|
113
113
|
// src/entities/contact/IdentityEntity.ts
|
|
114
114
|
import { BaseEntity as BaseEntity8, CreateDateColumn as CreateDateColumn7, Entity as Entity10, PrimaryGeneratedColumn as PrimaryGeneratedColumn10, UpdateDateColumn as UpdateDateColumn7, OneToOne as OneToOne4, JoinColumn as JoinColumn5, ManyToOne as ManyToOne7, Column as Column9, OneToMany as OneToMany4, BeforeInsert as BeforeInsert10, BeforeUpdate as BeforeUpdate10 } from "typeorm";
|
|
@@ -2696,7 +2696,7 @@ import typeorm9 from "typeorm";
|
|
|
2696
2696
|
|
|
2697
2697
|
// src/entities/statusList/StatusList2021EntryEntity.ts
|
|
2698
2698
|
import { Validate as Validate9 } from "class-validator";
|
|
2699
|
-
import { BaseEntity as BaseEntity19, Column as Column23, Entity as Entity21, JoinColumn as JoinColumn13, ManyToOne as ManyToOne11, PrimaryColumn } from "typeorm";
|
|
2699
|
+
import { BaseEntity as BaseEntity19, Column as Column23, Entity as Entity21, JoinColumn as JoinColumn13, ManyToOne as ManyToOne11, PrimaryColumn, TableInheritance as TableInheritance4 } from "typeorm";
|
|
2700
2700
|
function _ts_decorate26(decorators, target, key, desc) {
|
|
2701
2701
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2702
2702
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2745,7 +2745,7 @@ _ts_decorate26([
|
|
|
2745
2745
|
_ts_metadata25("design:type", Number)
|
|
2746
2746
|
], StatusListEntryEntity.prototype, "statusListIndex", void 0);
|
|
2747
2747
|
_ts_decorate26([
|
|
2748
|
-
ManyToOne11(() =>
|
|
2748
|
+
ManyToOne11(() => StatusList2021Entity, (statusList) => statusList.statusListEntries),
|
|
2749
2749
|
JoinColumn13({
|
|
2750
2750
|
name: "statusListId"
|
|
2751
2751
|
}),
|
|
@@ -2790,11 +2790,20 @@ _ts_decorate26([
|
|
|
2790
2790
|
_ts_metadata25("design:type", String)
|
|
2791
2791
|
], StatusListEntryEntity.prototype, "value", void 0);
|
|
2792
2792
|
StatusListEntryEntity = _ts_decorate26([
|
|
2793
|
-
Entity21("StatusListEntry")
|
|
2793
|
+
Entity21("StatusListEntry"),
|
|
2794
|
+
TableInheritance4({
|
|
2795
|
+
column: {
|
|
2796
|
+
type: "varchar",
|
|
2797
|
+
name: "type"
|
|
2798
|
+
}
|
|
2799
|
+
})
|
|
2794
2800
|
], StatusListEntryEntity);
|
|
2795
2801
|
|
|
2796
2802
|
// src/entities/statusList/StatusListEntities.ts
|
|
2797
2803
|
import { typeOrmDateTime as typeOrmDateTime13 } from "@sphereon/ssi-sdk.agent-config";
|
|
2804
|
+
|
|
2805
|
+
// src/entities/statusList/BitstringStatusListEntryEntity.ts
|
|
2806
|
+
import { ChildEntity as ChildEntity5, Column as Column24 } from "typeorm";
|
|
2798
2807
|
function _ts_decorate27(decorators, target, key, desc) {
|
|
2799
2808
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2800
2809
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2806,7 +2815,99 @@ function _ts_metadata26(k, v) {
|
|
|
2806
2815
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2807
2816
|
}
|
|
2808
2817
|
__name(_ts_metadata26, "_ts_metadata");
|
|
2809
|
-
var
|
|
2818
|
+
var BitstringStatusListEntryEntity = class extends StatusListEntryEntity {
|
|
2819
|
+
static {
|
|
2820
|
+
__name(this, "BitstringStatusListEntryEntity");
|
|
2821
|
+
}
|
|
2822
|
+
statusPurpose;
|
|
2823
|
+
bitsPerStatus;
|
|
2824
|
+
statusMessage;
|
|
2825
|
+
statusReference;
|
|
2826
|
+
};
|
|
2827
|
+
_ts_decorate27([
|
|
2828
|
+
Column24({
|
|
2829
|
+
type: "varchar",
|
|
2830
|
+
name: "statusPurpose",
|
|
2831
|
+
nullable: false
|
|
2832
|
+
}),
|
|
2833
|
+
_ts_metadata26("design:type", String)
|
|
2834
|
+
], BitstringStatusListEntryEntity.prototype, "statusPurpose", void 0);
|
|
2835
|
+
_ts_decorate27([
|
|
2836
|
+
Column24({
|
|
2837
|
+
type: "integer",
|
|
2838
|
+
name: "bitsPerStatus",
|
|
2839
|
+
nullable: true,
|
|
2840
|
+
default: 1
|
|
2841
|
+
}),
|
|
2842
|
+
_ts_metadata26("design:type", Number)
|
|
2843
|
+
], BitstringStatusListEntryEntity.prototype, "bitsPerStatus", void 0);
|
|
2844
|
+
_ts_decorate27([
|
|
2845
|
+
Column24({
|
|
2846
|
+
type: "text",
|
|
2847
|
+
name: "statusMessage",
|
|
2848
|
+
nullable: true,
|
|
2849
|
+
transformer: {
|
|
2850
|
+
from(value) {
|
|
2851
|
+
if (!value) {
|
|
2852
|
+
return void 0;
|
|
2853
|
+
}
|
|
2854
|
+
return JSON.parse(value);
|
|
2855
|
+
},
|
|
2856
|
+
to(value) {
|
|
2857
|
+
if (!value) {
|
|
2858
|
+
return void 0;
|
|
2859
|
+
}
|
|
2860
|
+
return JSON.stringify(value);
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
}),
|
|
2864
|
+
_ts_metadata26("design:type", typeof Array === "undefined" ? Object : Array)
|
|
2865
|
+
], BitstringStatusListEntryEntity.prototype, "statusMessage", void 0);
|
|
2866
|
+
_ts_decorate27([
|
|
2867
|
+
Column24({
|
|
2868
|
+
type: "text",
|
|
2869
|
+
name: "statusReference",
|
|
2870
|
+
nullable: true,
|
|
2871
|
+
transformer: {
|
|
2872
|
+
from(value) {
|
|
2873
|
+
if (!value) {
|
|
2874
|
+
return void 0;
|
|
2875
|
+
}
|
|
2876
|
+
if (value.startsWith("[")) {
|
|
2877
|
+
return JSON.parse(value);
|
|
2878
|
+
}
|
|
2879
|
+
return value;
|
|
2880
|
+
},
|
|
2881
|
+
to(value) {
|
|
2882
|
+
if (!value) {
|
|
2883
|
+
return void 0;
|
|
2884
|
+
}
|
|
2885
|
+
if (Array.isArray(value)) {
|
|
2886
|
+
return JSON.stringify(value);
|
|
2887
|
+
}
|
|
2888
|
+
return value;
|
|
2889
|
+
}
|
|
2890
|
+
}
|
|
2891
|
+
}),
|
|
2892
|
+
_ts_metadata26("design:type", Object)
|
|
2893
|
+
], BitstringStatusListEntryEntity.prototype, "statusReference", void 0);
|
|
2894
|
+
BitstringStatusListEntryEntity = _ts_decorate27([
|
|
2895
|
+
ChildEntity5("bitstring")
|
|
2896
|
+
], BitstringStatusListEntryEntity);
|
|
2897
|
+
|
|
2898
|
+
// src/entities/statusList/StatusListEntities.ts
|
|
2899
|
+
function _ts_decorate28(decorators, target, key, desc) {
|
|
2900
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2901
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2902
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2903
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2904
|
+
}
|
|
2905
|
+
__name(_ts_decorate28, "_ts_decorate");
|
|
2906
|
+
function _ts_metadata27(k, v) {
|
|
2907
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2908
|
+
}
|
|
2909
|
+
__name(_ts_metadata27, "_ts_metadata");
|
|
2910
|
+
var { BaseEntity: BaseEntity20, ChildEntity: ChildEntity6, Column: Column25, Entity: Entity22, OneToMany: OneToMany8, PrimaryColumn: PrimaryColumn2, TableInheritance: TableInheritance5, Unique } = typeorm9;
|
|
2810
2911
|
var StatusListEntity = class extends BaseEntity20 {
|
|
2811
2912
|
static {
|
|
2812
2913
|
__name(this, "StatusListEntity");
|
|
@@ -2814,39 +2915,47 @@ var StatusListEntity = class extends BaseEntity20 {
|
|
|
2814
2915
|
id;
|
|
2815
2916
|
correlationId;
|
|
2816
2917
|
length;
|
|
2918
|
+
type;
|
|
2817
2919
|
issuer;
|
|
2818
2920
|
driverType;
|
|
2819
2921
|
credentialIdMode;
|
|
2820
2922
|
proofFormat;
|
|
2821
2923
|
statusListCredential;
|
|
2822
|
-
statusListEntries;
|
|
2823
2924
|
};
|
|
2824
|
-
|
|
2925
|
+
_ts_decorate28([
|
|
2825
2926
|
PrimaryColumn2({
|
|
2826
2927
|
name: "id",
|
|
2827
2928
|
type: "varchar"
|
|
2828
2929
|
}),
|
|
2829
|
-
|
|
2930
|
+
_ts_metadata27("design:type", String)
|
|
2830
2931
|
], StatusListEntity.prototype, "id", void 0);
|
|
2831
|
-
|
|
2832
|
-
|
|
2932
|
+
_ts_decorate28([
|
|
2933
|
+
Column25({
|
|
2833
2934
|
name: "correlationId",
|
|
2834
2935
|
type: "varchar",
|
|
2835
2936
|
nullable: false
|
|
2836
2937
|
}),
|
|
2837
|
-
|
|
2938
|
+
_ts_metadata27("design:type", String)
|
|
2838
2939
|
], StatusListEntity.prototype, "correlationId", void 0);
|
|
2839
|
-
|
|
2840
|
-
|
|
2940
|
+
_ts_decorate28([
|
|
2941
|
+
Column25({
|
|
2841
2942
|
name: "length",
|
|
2842
2943
|
type: "integer",
|
|
2843
2944
|
nullable: false,
|
|
2844
2945
|
unique: false
|
|
2845
2946
|
}),
|
|
2846
|
-
|
|
2947
|
+
_ts_metadata27("design:type", Number)
|
|
2847
2948
|
], StatusListEntity.prototype, "length", void 0);
|
|
2848
|
-
|
|
2849
|
-
|
|
2949
|
+
_ts_decorate28([
|
|
2950
|
+
Column25("simple-enum", {
|
|
2951
|
+
name: "type",
|
|
2952
|
+
enum: StatusListType,
|
|
2953
|
+
nullable: false
|
|
2954
|
+
}),
|
|
2955
|
+
_ts_metadata27("design:type", typeof StatusListType === "undefined" ? Object : StatusListType)
|
|
2956
|
+
], StatusListEntity.prototype, "type", void 0);
|
|
2957
|
+
_ts_decorate28([
|
|
2958
|
+
Column25({
|
|
2850
2959
|
name: "issuer",
|
|
2851
2960
|
type: "text",
|
|
2852
2961
|
nullable: false,
|
|
@@ -2866,28 +2975,28 @@ _ts_decorate27([
|
|
|
2866
2975
|
}
|
|
2867
2976
|
}
|
|
2868
2977
|
}),
|
|
2869
|
-
|
|
2978
|
+
_ts_metadata27("design:type", Object)
|
|
2870
2979
|
], StatusListEntity.prototype, "issuer", void 0);
|
|
2871
|
-
|
|
2872
|
-
|
|
2980
|
+
_ts_decorate28([
|
|
2981
|
+
Column25("simple-enum", {
|
|
2873
2982
|
name: "driverType",
|
|
2874
2983
|
enum: StatusListDriverType,
|
|
2875
2984
|
nullable: false,
|
|
2876
2985
|
default: StatusListDriverType.AGENT_TYPEORM
|
|
2877
2986
|
}),
|
|
2878
|
-
|
|
2987
|
+
_ts_metadata27("design:type", typeof StatusListDriverType === "undefined" ? Object : StatusListDriverType)
|
|
2879
2988
|
], StatusListEntity.prototype, "driverType", void 0);
|
|
2880
|
-
|
|
2881
|
-
|
|
2989
|
+
_ts_decorate28([
|
|
2990
|
+
Column25("simple-enum", {
|
|
2882
2991
|
name: "credentialIdMode",
|
|
2883
2992
|
enum: StatusListCredentialIdMode,
|
|
2884
2993
|
nullable: false,
|
|
2885
2994
|
default: StatusListCredentialIdMode.ISSUANCE
|
|
2886
2995
|
}),
|
|
2887
|
-
|
|
2996
|
+
_ts_metadata27("design:type", typeof StatusListCredentialIdMode === "undefined" ? Object : StatusListCredentialIdMode)
|
|
2888
2997
|
], StatusListEntity.prototype, "credentialIdMode", void 0);
|
|
2889
|
-
|
|
2890
|
-
|
|
2998
|
+
_ts_decorate28([
|
|
2999
|
+
Column25({
|
|
2891
3000
|
type: "varchar",
|
|
2892
3001
|
name: "proofFormat",
|
|
2893
3002
|
enum: [
|
|
@@ -2897,10 +3006,10 @@ _ts_decorate27([
|
|
|
2897
3006
|
nullable: false,
|
|
2898
3007
|
default: "lds"
|
|
2899
3008
|
}),
|
|
2900
|
-
|
|
3009
|
+
_ts_metadata27("design:type", typeof CredentialProofFormat === "undefined" ? Object : CredentialProofFormat)
|
|
2901
3010
|
], StatusListEntity.prototype, "proofFormat", void 0);
|
|
2902
|
-
|
|
2903
|
-
|
|
3011
|
+
_ts_decorate28([
|
|
3012
|
+
Column25({
|
|
2904
3013
|
name: "statusListCredential",
|
|
2905
3014
|
type: "text",
|
|
2906
3015
|
nullable: true,
|
|
@@ -2920,18 +3029,14 @@ _ts_decorate27([
|
|
|
2920
3029
|
}
|
|
2921
3030
|
}
|
|
2922
3031
|
}),
|
|
2923
|
-
|
|
3032
|
+
_ts_metadata27("design:type", typeof StatusListCredential === "undefined" ? Object : StatusListCredential)
|
|
2924
3033
|
], StatusListEntity.prototype, "statusListCredential", void 0);
|
|
2925
|
-
|
|
2926
|
-
OneToMany8((type) => StatusListEntryEntity, (entry) => entry.statusList),
|
|
2927
|
-
_ts_metadata26("design:type", Array)
|
|
2928
|
-
], StatusListEntity.prototype, "statusListEntries", void 0);
|
|
2929
|
-
StatusListEntity = _ts_decorate27([
|
|
3034
|
+
StatusListEntity = _ts_decorate28([
|
|
2930
3035
|
Entity22("StatusList"),
|
|
2931
3036
|
Unique("UQ_correlationId", [
|
|
2932
3037
|
"correlationId"
|
|
2933
3038
|
]),
|
|
2934
|
-
|
|
3039
|
+
TableInheritance5({
|
|
2935
3040
|
column: {
|
|
2936
3041
|
type: "simple-enum",
|
|
2937
3042
|
name: "type",
|
|
@@ -2945,9 +3050,10 @@ var StatusList2021Entity = class extends StatusListEntity {
|
|
|
2945
3050
|
}
|
|
2946
3051
|
indexingDirection;
|
|
2947
3052
|
statusPurpose;
|
|
3053
|
+
statusListEntries;
|
|
2948
3054
|
};
|
|
2949
|
-
|
|
2950
|
-
|
|
3055
|
+
_ts_decorate28([
|
|
3056
|
+
Column25({
|
|
2951
3057
|
type: "varchar",
|
|
2952
3058
|
name: "indexingDirection",
|
|
2953
3059
|
enum: [
|
|
@@ -2956,19 +3062,23 @@ _ts_decorate27([
|
|
|
2956
3062
|
nullable: false,
|
|
2957
3063
|
default: "rightToLeft"
|
|
2958
3064
|
}),
|
|
2959
|
-
|
|
3065
|
+
_ts_metadata27("design:type", typeof StatusListIndexingDirection === "undefined" ? Object : StatusListIndexingDirection)
|
|
2960
3066
|
], StatusList2021Entity.prototype, "indexingDirection", void 0);
|
|
2961
|
-
|
|
2962
|
-
|
|
3067
|
+
_ts_decorate28([
|
|
3068
|
+
Column25({
|
|
2963
3069
|
type: "varchar",
|
|
2964
3070
|
name: "statusPurpose",
|
|
2965
3071
|
nullable: false,
|
|
2966
3072
|
default: "revocation"
|
|
2967
3073
|
}),
|
|
2968
|
-
|
|
3074
|
+
_ts_metadata27("design:type", typeof StatusPurpose2021 === "undefined" ? Object : StatusPurpose2021)
|
|
2969
3075
|
], StatusList2021Entity.prototype, "statusPurpose", void 0);
|
|
2970
|
-
|
|
2971
|
-
|
|
3076
|
+
_ts_decorate28([
|
|
3077
|
+
OneToMany8((type) => StatusListEntryEntity, (entry) => entry.statusList),
|
|
3078
|
+
_ts_metadata27("design:type", Array)
|
|
3079
|
+
], StatusList2021Entity.prototype, "statusListEntries", void 0);
|
|
3080
|
+
StatusList2021Entity = _ts_decorate28([
|
|
3081
|
+
ChildEntity6(StatusListType.StatusList2021)
|
|
2972
3082
|
], StatusList2021Entity);
|
|
2973
3083
|
var OAuthStatusListEntity = class extends StatusListEntity {
|
|
2974
3084
|
static {
|
|
@@ -2977,40 +3087,112 @@ var OAuthStatusListEntity = class extends StatusListEntity {
|
|
|
2977
3087
|
bitsPerStatus;
|
|
2978
3088
|
expiresAt;
|
|
2979
3089
|
};
|
|
2980
|
-
|
|
2981
|
-
|
|
3090
|
+
_ts_decorate28([
|
|
3091
|
+
Column25({
|
|
2982
3092
|
type: "integer",
|
|
2983
3093
|
name: "bitsPerStatus",
|
|
2984
3094
|
nullable: false
|
|
2985
3095
|
}),
|
|
2986
|
-
|
|
3096
|
+
_ts_metadata27("design:type", Number)
|
|
2987
3097
|
], OAuthStatusListEntity.prototype, "bitsPerStatus", void 0);
|
|
2988
|
-
|
|
2989
|
-
|
|
3098
|
+
_ts_decorate28([
|
|
3099
|
+
Column25({
|
|
2990
3100
|
name: "expiresAt",
|
|
2991
3101
|
nullable: true,
|
|
2992
3102
|
type: typeOrmDateTime13()
|
|
2993
3103
|
}),
|
|
2994
|
-
|
|
3104
|
+
_ts_metadata27("design:type", typeof Date === "undefined" ? Object : Date)
|
|
2995
3105
|
], OAuthStatusListEntity.prototype, "expiresAt", void 0);
|
|
2996
|
-
OAuthStatusListEntity =
|
|
2997
|
-
|
|
3106
|
+
OAuthStatusListEntity = _ts_decorate28([
|
|
3107
|
+
ChildEntity6(StatusListType.OAuthStatusList)
|
|
2998
3108
|
], OAuthStatusListEntity);
|
|
3109
|
+
var BitstringStatusListEntity = class extends StatusListEntity {
|
|
3110
|
+
static {
|
|
3111
|
+
__name(this, "BitstringStatusListEntity");
|
|
3112
|
+
}
|
|
3113
|
+
statusPurpose;
|
|
3114
|
+
bitsPerStatus;
|
|
3115
|
+
validFrom;
|
|
3116
|
+
validUntil;
|
|
3117
|
+
ttl;
|
|
3118
|
+
statusListEntries;
|
|
3119
|
+
};
|
|
3120
|
+
_ts_decorate28([
|
|
3121
|
+
Column25({
|
|
3122
|
+
type: "varchar",
|
|
3123
|
+
name: "statusPurpose",
|
|
3124
|
+
nullable: false,
|
|
3125
|
+
transformer: {
|
|
3126
|
+
from(value) {
|
|
3127
|
+
if (value?.includes(",")) {
|
|
3128
|
+
return value.split(",").map((v) => v.trim());
|
|
3129
|
+
}
|
|
3130
|
+
return value;
|
|
3131
|
+
},
|
|
3132
|
+
to(value) {
|
|
3133
|
+
if (Array.isArray(value)) {
|
|
3134
|
+
return value.join(",");
|
|
3135
|
+
}
|
|
3136
|
+
return value;
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3139
|
+
}),
|
|
3140
|
+
_ts_metadata27("design:type", Object)
|
|
3141
|
+
], BitstringStatusListEntity.prototype, "statusPurpose", void 0);
|
|
3142
|
+
_ts_decorate28([
|
|
3143
|
+
Column25({
|
|
3144
|
+
type: "integer",
|
|
3145
|
+
name: "bitsPerStatus",
|
|
3146
|
+
nullable: false
|
|
3147
|
+
}),
|
|
3148
|
+
_ts_metadata27("design:type", Number)
|
|
3149
|
+
], BitstringStatusListEntity.prototype, "bitsPerStatus", void 0);
|
|
3150
|
+
_ts_decorate28([
|
|
3151
|
+
Column25({
|
|
3152
|
+
name: "validFrom",
|
|
3153
|
+
nullable: true,
|
|
3154
|
+
type: typeOrmDateTime13()
|
|
3155
|
+
}),
|
|
3156
|
+
_ts_metadata27("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3157
|
+
], BitstringStatusListEntity.prototype, "validFrom", void 0);
|
|
3158
|
+
_ts_decorate28([
|
|
3159
|
+
Column25({
|
|
3160
|
+
name: "validUntil",
|
|
3161
|
+
nullable: true,
|
|
3162
|
+
type: typeOrmDateTime13()
|
|
3163
|
+
}),
|
|
3164
|
+
_ts_metadata27("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3165
|
+
], BitstringStatusListEntity.prototype, "validUntil", void 0);
|
|
3166
|
+
_ts_decorate28([
|
|
3167
|
+
Column25({
|
|
3168
|
+
type: "integer",
|
|
3169
|
+
name: "ttl",
|
|
3170
|
+
nullable: true
|
|
3171
|
+
}),
|
|
3172
|
+
_ts_metadata27("design:type", Number)
|
|
3173
|
+
], BitstringStatusListEntity.prototype, "ttl", void 0);
|
|
3174
|
+
_ts_decorate28([
|
|
3175
|
+
OneToMany8((type) => BitstringStatusListEntryEntity, (entry) => entry.statusList),
|
|
3176
|
+
_ts_metadata27("design:type", Array)
|
|
3177
|
+
], BitstringStatusListEntity.prototype, "statusListEntries", void 0);
|
|
3178
|
+
BitstringStatusListEntity = _ts_decorate28([
|
|
3179
|
+
ChildEntity6(StatusListType.BitstringStatusList)
|
|
3180
|
+
], BitstringStatusListEntity);
|
|
2999
3181
|
|
|
3000
3182
|
// src/entities/machineState/MachineStateInfoEntity.ts
|
|
3001
|
-
import { BaseEntity as BaseEntity21, Column as
|
|
3183
|
+
import { BaseEntity as BaseEntity21, Column as Column26, CreateDateColumn as CreateDateColumn11, Entity as Entity23, PrimaryColumn as PrimaryColumn3, UpdateDateColumn as UpdateDateColumn11 } from "typeorm";
|
|
3002
3184
|
import { typeOrmDateTime as typeOrmDateTime14 } from "@sphereon/ssi-sdk.agent-config";
|
|
3003
|
-
function
|
|
3185
|
+
function _ts_decorate29(decorators, target, key, desc) {
|
|
3004
3186
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3005
3187
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3006
3188
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3007
3189
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3008
3190
|
}
|
|
3009
|
-
__name(
|
|
3010
|
-
function
|
|
3191
|
+
__name(_ts_decorate29, "_ts_decorate");
|
|
3192
|
+
function _ts_metadata28(k, v) {
|
|
3011
3193
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3012
3194
|
}
|
|
3013
|
-
__name(
|
|
3195
|
+
__name(_ts_metadata28, "_ts_metadata");
|
|
3014
3196
|
var MachineStateInfoEntity = class extends BaseEntity21 {
|
|
3015
3197
|
static {
|
|
3016
3198
|
__name(this, "MachineStateInfoEntity");
|
|
@@ -3029,120 +3211,120 @@ var MachineStateInfoEntity = class extends BaseEntity21 {
|
|
|
3029
3211
|
completedAt;
|
|
3030
3212
|
tenantId;
|
|
3031
3213
|
};
|
|
3032
|
-
|
|
3214
|
+
_ts_decorate29([
|
|
3033
3215
|
PrimaryColumn3({
|
|
3034
3216
|
name: "instance_id",
|
|
3035
3217
|
type: "varchar",
|
|
3036
3218
|
nullable: false
|
|
3037
3219
|
}),
|
|
3038
|
-
|
|
3220
|
+
_ts_metadata28("design:type", String)
|
|
3039
3221
|
], MachineStateInfoEntity.prototype, "instanceId", void 0);
|
|
3040
|
-
|
|
3041
|
-
|
|
3222
|
+
_ts_decorate29([
|
|
3223
|
+
Column26({
|
|
3042
3224
|
name: "session_id",
|
|
3043
3225
|
type: "varchar",
|
|
3044
3226
|
nullable: true
|
|
3045
3227
|
}),
|
|
3046
|
-
|
|
3228
|
+
_ts_metadata28("design:type", String)
|
|
3047
3229
|
], MachineStateInfoEntity.prototype, "sessionId", void 0);
|
|
3048
|
-
|
|
3049
|
-
|
|
3230
|
+
_ts_decorate29([
|
|
3231
|
+
Column26({
|
|
3050
3232
|
name: "machine_name",
|
|
3051
3233
|
type: "varchar",
|
|
3052
3234
|
nullable: false
|
|
3053
3235
|
}),
|
|
3054
|
-
|
|
3236
|
+
_ts_metadata28("design:type", String)
|
|
3055
3237
|
], MachineStateInfoEntity.prototype, "machineName", void 0);
|
|
3056
|
-
|
|
3057
|
-
|
|
3238
|
+
_ts_decorate29([
|
|
3239
|
+
Column26({
|
|
3058
3240
|
name: "latest_state_name",
|
|
3059
3241
|
type: "varchar",
|
|
3060
3242
|
nullable: true
|
|
3061
3243
|
}),
|
|
3062
|
-
|
|
3244
|
+
_ts_metadata28("design:type", String)
|
|
3063
3245
|
], MachineStateInfoEntity.prototype, "latestStateName", void 0);
|
|
3064
|
-
|
|
3065
|
-
|
|
3246
|
+
_ts_decorate29([
|
|
3247
|
+
Column26({
|
|
3066
3248
|
name: "latest_event_type",
|
|
3067
3249
|
type: "varchar",
|
|
3068
3250
|
nullable: false
|
|
3069
3251
|
}),
|
|
3070
|
-
|
|
3252
|
+
_ts_metadata28("design:type", String)
|
|
3071
3253
|
], MachineStateInfoEntity.prototype, "latestEventType", void 0);
|
|
3072
|
-
|
|
3073
|
-
|
|
3254
|
+
_ts_decorate29([
|
|
3255
|
+
Column26({
|
|
3074
3256
|
name: "state",
|
|
3075
3257
|
type: "text",
|
|
3076
3258
|
nullable: false
|
|
3077
3259
|
}),
|
|
3078
|
-
|
|
3260
|
+
_ts_metadata28("design:type", String)
|
|
3079
3261
|
], MachineStateInfoEntity.prototype, "state", void 0);
|
|
3080
|
-
|
|
3262
|
+
_ts_decorate29([
|
|
3081
3263
|
CreateDateColumn11({
|
|
3082
3264
|
name: "created_at",
|
|
3083
3265
|
nullable: false,
|
|
3084
3266
|
type: typeOrmDateTime14()
|
|
3085
3267
|
}),
|
|
3086
|
-
|
|
3268
|
+
_ts_metadata28("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3087
3269
|
], MachineStateInfoEntity.prototype, "createdAt", void 0);
|
|
3088
|
-
|
|
3270
|
+
_ts_decorate29([
|
|
3089
3271
|
UpdateDateColumn11({
|
|
3090
3272
|
name: "updated_at",
|
|
3091
3273
|
nullable: false,
|
|
3092
3274
|
type: typeOrmDateTime14()
|
|
3093
3275
|
}),
|
|
3094
|
-
|
|
3276
|
+
_ts_metadata28("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3095
3277
|
], MachineStateInfoEntity.prototype, "updatedAt", void 0);
|
|
3096
|
-
|
|
3097
|
-
|
|
3278
|
+
_ts_decorate29([
|
|
3279
|
+
Column26({
|
|
3098
3280
|
name: "updated_count",
|
|
3099
3281
|
type: "integer",
|
|
3100
3282
|
nullable: false
|
|
3101
3283
|
}),
|
|
3102
|
-
|
|
3284
|
+
_ts_metadata28("design:type", Number)
|
|
3103
3285
|
], MachineStateInfoEntity.prototype, "updatedCount", void 0);
|
|
3104
|
-
|
|
3105
|
-
|
|
3286
|
+
_ts_decorate29([
|
|
3287
|
+
Column26({
|
|
3106
3288
|
name: "expires_at",
|
|
3107
3289
|
nullable: true,
|
|
3108
3290
|
type: typeOrmDateTime14()
|
|
3109
3291
|
}),
|
|
3110
|
-
|
|
3292
|
+
_ts_metadata28("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3111
3293
|
], MachineStateInfoEntity.prototype, "expiresAt", void 0);
|
|
3112
|
-
|
|
3113
|
-
|
|
3294
|
+
_ts_decorate29([
|
|
3295
|
+
Column26({
|
|
3114
3296
|
name: "completed_at",
|
|
3115
3297
|
nullable: true,
|
|
3116
3298
|
type: typeOrmDateTime14()
|
|
3117
3299
|
}),
|
|
3118
|
-
|
|
3300
|
+
_ts_metadata28("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3119
3301
|
], MachineStateInfoEntity.prototype, "completedAt", void 0);
|
|
3120
|
-
|
|
3121
|
-
|
|
3302
|
+
_ts_decorate29([
|
|
3303
|
+
Column26({
|
|
3122
3304
|
name: "tenant_id",
|
|
3123
3305
|
type: "varchar",
|
|
3124
3306
|
nullable: true
|
|
3125
3307
|
}),
|
|
3126
|
-
|
|
3308
|
+
_ts_metadata28("design:type", String)
|
|
3127
3309
|
], MachineStateInfoEntity.prototype, "tenantId", void 0);
|
|
3128
|
-
MachineStateInfoEntity =
|
|
3310
|
+
MachineStateInfoEntity = _ts_decorate29([
|
|
3129
3311
|
Entity23("MachineStateInfoEntity")
|
|
3130
3312
|
], MachineStateInfoEntity);
|
|
3131
3313
|
|
|
3132
3314
|
// src/entities/contact/OrganizationEntity.ts
|
|
3133
3315
|
import { IsNotEmpty as IsNotEmpty10, validate as validate16 } from "class-validator";
|
|
3134
|
-
import { BeforeInsert as BeforeInsert18, BeforeUpdate as BeforeUpdate18, ChildEntity as
|
|
3135
|
-
function
|
|
3316
|
+
import { BeforeInsert as BeforeInsert18, BeforeUpdate as BeforeUpdate18, ChildEntity as ChildEntity7, Column as Column27 } from "typeorm";
|
|
3317
|
+
function _ts_decorate30(decorators, target, key, desc) {
|
|
3136
3318
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3137
3319
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3138
3320
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3139
3321
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3140
3322
|
}
|
|
3141
|
-
__name(
|
|
3142
|
-
function
|
|
3323
|
+
__name(_ts_decorate30, "_ts_decorate");
|
|
3324
|
+
function _ts_metadata29(k, v) {
|
|
3143
3325
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3144
3326
|
}
|
|
3145
|
-
__name(
|
|
3327
|
+
__name(_ts_metadata29, "_ts_metadata");
|
|
3146
3328
|
var OrganizationEntity = class extends BaseContactEntity {
|
|
3147
3329
|
static {
|
|
3148
3330
|
__name(this, "OrganizationEntity");
|
|
@@ -3162,8 +3344,8 @@ var OrganizationEntity = class extends BaseContactEntity {
|
|
|
3162
3344
|
}
|
|
3163
3345
|
}
|
|
3164
3346
|
};
|
|
3165
|
-
|
|
3166
|
-
|
|
3347
|
+
_ts_decorate30([
|
|
3348
|
+
Column27("varchar", {
|
|
3167
3349
|
name: "legal_name",
|
|
3168
3350
|
length: 255,
|
|
3169
3351
|
nullable: false,
|
|
@@ -3172,10 +3354,10 @@ _ts_decorate29([
|
|
|
3172
3354
|
IsNotEmpty10({
|
|
3173
3355
|
message: "Blank legal names are not allowed"
|
|
3174
3356
|
}),
|
|
3175
|
-
|
|
3357
|
+
_ts_metadata29("design:type", String)
|
|
3176
3358
|
], OrganizationEntity.prototype, "legalName", void 0);
|
|
3177
|
-
|
|
3178
|
-
|
|
3359
|
+
_ts_decorate30([
|
|
3360
|
+
Column27("varchar", {
|
|
3179
3361
|
name: "display_name",
|
|
3180
3362
|
length: 255,
|
|
3181
3363
|
nullable: false,
|
|
@@ -3184,47 +3366,47 @@ _ts_decorate29([
|
|
|
3184
3366
|
IsNotEmpty10({
|
|
3185
3367
|
message: "Blank display names are not allowed"
|
|
3186
3368
|
}),
|
|
3187
|
-
|
|
3369
|
+
_ts_metadata29("design:type", String)
|
|
3188
3370
|
], OrganizationEntity.prototype, "displayName", void 0);
|
|
3189
|
-
|
|
3190
|
-
|
|
3371
|
+
_ts_decorate30([
|
|
3372
|
+
Column27("text", {
|
|
3191
3373
|
name: "owner_id",
|
|
3192
3374
|
nullable: true
|
|
3193
3375
|
}),
|
|
3194
|
-
|
|
3376
|
+
_ts_metadata29("design:type", String)
|
|
3195
3377
|
], OrganizationEntity.prototype, "ownerId", void 0);
|
|
3196
|
-
|
|
3197
|
-
|
|
3378
|
+
_ts_decorate30([
|
|
3379
|
+
Column27("text", {
|
|
3198
3380
|
name: "tenant_id",
|
|
3199
3381
|
nullable: true
|
|
3200
3382
|
}),
|
|
3201
|
-
|
|
3383
|
+
_ts_metadata29("design:type", String)
|
|
3202
3384
|
], OrganizationEntity.prototype, "tenantId", void 0);
|
|
3203
|
-
|
|
3385
|
+
_ts_decorate30([
|
|
3204
3386
|
BeforeInsert18(),
|
|
3205
3387
|
BeforeUpdate18(),
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3388
|
+
_ts_metadata29("design:type", Function),
|
|
3389
|
+
_ts_metadata29("design:paramtypes", []),
|
|
3390
|
+
_ts_metadata29("design:returntype", Promise)
|
|
3209
3391
|
], OrganizationEntity.prototype, "validate", null);
|
|
3210
|
-
OrganizationEntity =
|
|
3211
|
-
|
|
3392
|
+
OrganizationEntity = _ts_decorate30([
|
|
3393
|
+
ChildEntity7("Organization")
|
|
3212
3394
|
], OrganizationEntity);
|
|
3213
3395
|
|
|
3214
3396
|
// src/entities/contact/NaturalPersonEntity.ts
|
|
3215
|
-
import { Column as
|
|
3397
|
+
import { Column as Column28, ChildEntity as ChildEntity8, BeforeInsert as BeforeInsert19, BeforeUpdate as BeforeUpdate19 } from "typeorm";
|
|
3216
3398
|
import { validate as validate17, IsNotEmpty as IsNotEmpty11, Validate as Validate10 } from "class-validator";
|
|
3217
|
-
function
|
|
3399
|
+
function _ts_decorate31(decorators, target, key, desc) {
|
|
3218
3400
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3219
3401
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3220
3402
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3221
3403
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3222
3404
|
}
|
|
3223
|
-
__name(
|
|
3224
|
-
function
|
|
3405
|
+
__name(_ts_decorate31, "_ts_decorate");
|
|
3406
|
+
function _ts_metadata30(k, v) {
|
|
3225
3407
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3226
3408
|
}
|
|
3227
|
-
__name(
|
|
3409
|
+
__name(_ts_metadata30, "_ts_metadata");
|
|
3228
3410
|
var NaturalPersonEntity = class extends BaseContactEntity {
|
|
3229
3411
|
static {
|
|
3230
3412
|
__name(this, "NaturalPersonEntity");
|
|
@@ -3246,8 +3428,8 @@ var NaturalPersonEntity = class extends BaseContactEntity {
|
|
|
3246
3428
|
}
|
|
3247
3429
|
}
|
|
3248
3430
|
};
|
|
3249
|
-
|
|
3250
|
-
|
|
3431
|
+
_ts_decorate31([
|
|
3432
|
+
Column28("varchar", {
|
|
3251
3433
|
name: "first_name",
|
|
3252
3434
|
length: 255,
|
|
3253
3435
|
nullable: false,
|
|
@@ -3256,10 +3438,10 @@ _ts_decorate30([
|
|
|
3256
3438
|
IsNotEmpty11({
|
|
3257
3439
|
message: "Blank first names are not allowed"
|
|
3258
3440
|
}),
|
|
3259
|
-
|
|
3441
|
+
_ts_metadata30("design:type", String)
|
|
3260
3442
|
], NaturalPersonEntity.prototype, "firstName", void 0);
|
|
3261
|
-
|
|
3262
|
-
|
|
3443
|
+
_ts_decorate31([
|
|
3444
|
+
Column28("varchar", {
|
|
3263
3445
|
name: "middle_name",
|
|
3264
3446
|
length: 255,
|
|
3265
3447
|
nullable: true,
|
|
@@ -3268,10 +3450,10 @@ _ts_decorate30([
|
|
|
3268
3450
|
Validate10(IsNonEmptyStringConstraint, {
|
|
3269
3451
|
message: "Blank middle names are not allowed"
|
|
3270
3452
|
}),
|
|
3271
|
-
|
|
3453
|
+
_ts_metadata30("design:type", String)
|
|
3272
3454
|
], NaturalPersonEntity.prototype, "middleName", void 0);
|
|
3273
|
-
|
|
3274
|
-
|
|
3455
|
+
_ts_decorate31([
|
|
3456
|
+
Column28("varchar", {
|
|
3275
3457
|
name: "last_name",
|
|
3276
3458
|
length: 255,
|
|
3277
3459
|
nullable: false,
|
|
@@ -3280,10 +3462,10 @@ _ts_decorate30([
|
|
|
3280
3462
|
IsNotEmpty11({
|
|
3281
3463
|
message: "Blank last names are not allowed"
|
|
3282
3464
|
}),
|
|
3283
|
-
|
|
3465
|
+
_ts_metadata30("design:type", String)
|
|
3284
3466
|
], NaturalPersonEntity.prototype, "lastName", void 0);
|
|
3285
|
-
|
|
3286
|
-
|
|
3467
|
+
_ts_decorate31([
|
|
3468
|
+
Column28("varchar", {
|
|
3287
3469
|
name: "display_name",
|
|
3288
3470
|
length: 255,
|
|
3289
3471
|
nullable: false,
|
|
@@ -3292,49 +3474,49 @@ _ts_decorate30([
|
|
|
3292
3474
|
IsNotEmpty11({
|
|
3293
3475
|
message: "Blank display names are not allowed"
|
|
3294
3476
|
}),
|
|
3295
|
-
|
|
3477
|
+
_ts_metadata30("design:type", String)
|
|
3296
3478
|
], NaturalPersonEntity.prototype, "displayName", void 0);
|
|
3297
|
-
|
|
3298
|
-
|
|
3479
|
+
_ts_decorate31([
|
|
3480
|
+
Column28("text", {
|
|
3299
3481
|
name: "owner_id",
|
|
3300
3482
|
nullable: true
|
|
3301
3483
|
}),
|
|
3302
|
-
|
|
3484
|
+
_ts_metadata30("design:type", String)
|
|
3303
3485
|
], NaturalPersonEntity.prototype, "ownerId", void 0);
|
|
3304
|
-
|
|
3305
|
-
|
|
3486
|
+
_ts_decorate31([
|
|
3487
|
+
Column28("text", {
|
|
3306
3488
|
name: "tenant_id",
|
|
3307
3489
|
nullable: true
|
|
3308
3490
|
}),
|
|
3309
|
-
|
|
3491
|
+
_ts_metadata30("design:type", String)
|
|
3310
3492
|
], NaturalPersonEntity.prototype, "tenantId", void 0);
|
|
3311
|
-
|
|
3493
|
+
_ts_decorate31([
|
|
3312
3494
|
BeforeInsert19(),
|
|
3313
3495
|
BeforeUpdate19(),
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3496
|
+
_ts_metadata30("design:type", Function),
|
|
3497
|
+
_ts_metadata30("design:paramtypes", []),
|
|
3498
|
+
_ts_metadata30("design:returntype", Promise)
|
|
3317
3499
|
], NaturalPersonEntity.prototype, "validate", null);
|
|
3318
|
-
NaturalPersonEntity =
|
|
3319
|
-
|
|
3500
|
+
NaturalPersonEntity = _ts_decorate31([
|
|
3501
|
+
ChildEntity8("NaturalPerson")
|
|
3320
3502
|
], NaturalPersonEntity);
|
|
3321
3503
|
|
|
3322
3504
|
// src/entities/eventLogger/AuditEventEntity.ts
|
|
3323
3505
|
import { ActionType, InitiatorType, LoggingEventType, LogLevel, SubSystem, System, SystemCorrelationIdType } from "@sphereon/ssi-types";
|
|
3324
3506
|
import { CredentialType, PartyCorrelationType } from "@sphereon/ssi-sdk.core";
|
|
3325
3507
|
import { typeOrmDateTime as typeOrmDateTime15 } from "@sphereon/ssi-sdk.agent-config";
|
|
3326
|
-
import { BaseEntity as BaseEntity22, Column as
|
|
3327
|
-
function
|
|
3508
|
+
import { BaseEntity as BaseEntity22, Column as Column29, CreateDateColumn as CreateDateColumn12, Entity as Entity24, PrimaryGeneratedColumn as PrimaryGeneratedColumn21, UpdateDateColumn as UpdateDateColumn12 } from "typeorm";
|
|
3509
|
+
function _ts_decorate32(decorators, target, key, desc) {
|
|
3328
3510
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3329
3511
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3330
3512
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3331
3513
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3332
3514
|
}
|
|
3333
|
-
__name(
|
|
3334
|
-
function
|
|
3515
|
+
__name(_ts_decorate32, "_ts_decorate");
|
|
3516
|
+
function _ts_metadata31(k, v) {
|
|
3335
3517
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3336
3518
|
}
|
|
3337
|
-
__name(
|
|
3519
|
+
__name(_ts_metadata31, "_ts_metadata");
|
|
3338
3520
|
var AuditEventEntity = class extends BaseEntity22 {
|
|
3339
3521
|
static {
|
|
3340
3522
|
__name(this, "AuditEventEntity");
|
|
@@ -3366,239 +3548,239 @@ var AuditEventEntity = class extends BaseEntity22 {
|
|
|
3366
3548
|
createdAt;
|
|
3367
3549
|
lastUpdatedAt;
|
|
3368
3550
|
};
|
|
3369
|
-
|
|
3551
|
+
_ts_decorate32([
|
|
3370
3552
|
PrimaryGeneratedColumn21("uuid"),
|
|
3371
|
-
|
|
3553
|
+
_ts_metadata31("design:type", String)
|
|
3372
3554
|
], AuditEventEntity.prototype, "id", void 0);
|
|
3373
|
-
|
|
3374
|
-
|
|
3555
|
+
_ts_decorate32([
|
|
3556
|
+
Column29({
|
|
3375
3557
|
name: "timestamp",
|
|
3376
3558
|
nullable: false,
|
|
3377
3559
|
unique: false,
|
|
3378
3560
|
type: typeOrmDateTime15()
|
|
3379
3561
|
}),
|
|
3380
|
-
|
|
3562
|
+
_ts_metadata31("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3381
3563
|
], AuditEventEntity.prototype, "timestamp", void 0);
|
|
3382
|
-
|
|
3383
|
-
|
|
3564
|
+
_ts_decorate32([
|
|
3565
|
+
Column29("simple-enum", {
|
|
3384
3566
|
name: "eventType",
|
|
3385
3567
|
enum: LoggingEventType,
|
|
3386
3568
|
nullable: false,
|
|
3387
3569
|
unique: false
|
|
3388
3570
|
}),
|
|
3389
|
-
|
|
3571
|
+
_ts_metadata31("design:type", typeof LoggingEventType === "undefined" ? Object : LoggingEventType)
|
|
3390
3572
|
], AuditEventEntity.prototype, "type", void 0);
|
|
3391
|
-
|
|
3392
|
-
|
|
3573
|
+
_ts_decorate32([
|
|
3574
|
+
Column29("simple-enum", {
|
|
3393
3575
|
name: "level",
|
|
3394
3576
|
enum: LogLevel,
|
|
3395
3577
|
nullable: false,
|
|
3396
3578
|
unique: false
|
|
3397
3579
|
}),
|
|
3398
|
-
|
|
3580
|
+
_ts_metadata31("design:type", typeof LogLevel === "undefined" ? Object : LogLevel)
|
|
3399
3581
|
], AuditEventEntity.prototype, "level", void 0);
|
|
3400
|
-
|
|
3401
|
-
|
|
3582
|
+
_ts_decorate32([
|
|
3583
|
+
Column29("text", {
|
|
3402
3584
|
name: "correlationId",
|
|
3403
3585
|
nullable: false,
|
|
3404
3586
|
unique: false
|
|
3405
3587
|
}),
|
|
3406
|
-
|
|
3588
|
+
_ts_metadata31("design:type", String)
|
|
3407
3589
|
], AuditEventEntity.prototype, "correlationId", void 0);
|
|
3408
|
-
|
|
3409
|
-
|
|
3590
|
+
_ts_decorate32([
|
|
3591
|
+
Column29("simple-enum", {
|
|
3410
3592
|
name: "system",
|
|
3411
3593
|
enum: System,
|
|
3412
3594
|
nullable: false,
|
|
3413
3595
|
unique: false
|
|
3414
3596
|
}),
|
|
3415
|
-
|
|
3597
|
+
_ts_metadata31("design:type", typeof System === "undefined" ? Object : System)
|
|
3416
3598
|
], AuditEventEntity.prototype, "system", void 0);
|
|
3417
|
-
|
|
3418
|
-
|
|
3599
|
+
_ts_decorate32([
|
|
3600
|
+
Column29("simple-enum", {
|
|
3419
3601
|
name: "subSystemType",
|
|
3420
3602
|
enum: SubSystem,
|
|
3421
3603
|
nullable: false,
|
|
3422
3604
|
unique: false
|
|
3423
3605
|
}),
|
|
3424
|
-
|
|
3606
|
+
_ts_metadata31("design:type", typeof SubSystem === "undefined" ? Object : SubSystem)
|
|
3425
3607
|
], AuditEventEntity.prototype, "subSystemType", void 0);
|
|
3426
|
-
|
|
3427
|
-
|
|
3608
|
+
_ts_decorate32([
|
|
3609
|
+
Column29("simple-enum", {
|
|
3428
3610
|
name: "actionType",
|
|
3429
3611
|
enum: ActionType,
|
|
3430
3612
|
nullable: false,
|
|
3431
3613
|
unique: false
|
|
3432
3614
|
}),
|
|
3433
|
-
|
|
3615
|
+
_ts_metadata31("design:type", typeof ActionType === "undefined" ? Object : ActionType)
|
|
3434
3616
|
], AuditEventEntity.prototype, "actionType", void 0);
|
|
3435
|
-
|
|
3436
|
-
|
|
3617
|
+
_ts_decorate32([
|
|
3618
|
+
Column29({
|
|
3437
3619
|
name: "actionSubType",
|
|
3438
3620
|
type: "varchar",
|
|
3439
3621
|
nullable: false,
|
|
3440
3622
|
unique: false
|
|
3441
3623
|
}),
|
|
3442
|
-
|
|
3624
|
+
_ts_metadata31("design:type", typeof ActionSubType === "undefined" ? Object : ActionSubType)
|
|
3443
3625
|
], AuditEventEntity.prototype, "actionSubType", void 0);
|
|
3444
|
-
|
|
3445
|
-
|
|
3626
|
+
_ts_decorate32([
|
|
3627
|
+
Column29("simple-enum", {
|
|
3446
3628
|
name: "initiatorType",
|
|
3447
3629
|
enum: InitiatorType,
|
|
3448
3630
|
nullable: false,
|
|
3449
3631
|
unique: false
|
|
3450
3632
|
}),
|
|
3451
|
-
|
|
3633
|
+
_ts_metadata31("design:type", typeof InitiatorType === "undefined" ? Object : InitiatorType)
|
|
3452
3634
|
], AuditEventEntity.prototype, "initiatorType", void 0);
|
|
3453
|
-
|
|
3454
|
-
|
|
3635
|
+
_ts_decorate32([
|
|
3636
|
+
Column29("simple-enum", {
|
|
3455
3637
|
name: "systemCorrelationIdType",
|
|
3456
3638
|
enum: SystemCorrelationIdType,
|
|
3457
3639
|
nullable: true,
|
|
3458
3640
|
unique: false
|
|
3459
3641
|
}),
|
|
3460
|
-
|
|
3642
|
+
_ts_metadata31("design:type", typeof SystemCorrelationIdType === "undefined" ? Object : SystemCorrelationIdType)
|
|
3461
3643
|
], AuditEventEntity.prototype, "systemCorrelationIdType", void 0);
|
|
3462
|
-
|
|
3463
|
-
|
|
3644
|
+
_ts_decorate32([
|
|
3645
|
+
Column29("text", {
|
|
3464
3646
|
name: "systemCorrelationId",
|
|
3465
3647
|
nullable: true,
|
|
3466
3648
|
unique: false
|
|
3467
3649
|
}),
|
|
3468
|
-
|
|
3650
|
+
_ts_metadata31("design:type", String)
|
|
3469
3651
|
], AuditEventEntity.prototype, "systemCorrelationId", void 0);
|
|
3470
|
-
|
|
3471
|
-
|
|
3652
|
+
_ts_decorate32([
|
|
3653
|
+
Column29("text", {
|
|
3472
3654
|
name: "systemAlias",
|
|
3473
3655
|
nullable: true,
|
|
3474
3656
|
unique: false
|
|
3475
3657
|
}),
|
|
3476
|
-
|
|
3658
|
+
_ts_metadata31("design:type", String)
|
|
3477
3659
|
], AuditEventEntity.prototype, "systemAlias", void 0);
|
|
3478
|
-
|
|
3479
|
-
|
|
3660
|
+
_ts_decorate32([
|
|
3661
|
+
Column29("simple-enum", {
|
|
3480
3662
|
name: "partyCorrelationType",
|
|
3481
3663
|
enum: PartyCorrelationType,
|
|
3482
3664
|
nullable: true,
|
|
3483
3665
|
unique: false
|
|
3484
3666
|
}),
|
|
3485
|
-
|
|
3667
|
+
_ts_metadata31("design:type", typeof PartyCorrelationType === "undefined" ? Object : PartyCorrelationType)
|
|
3486
3668
|
], AuditEventEntity.prototype, "partyCorrelationType", void 0);
|
|
3487
|
-
|
|
3488
|
-
|
|
3669
|
+
_ts_decorate32([
|
|
3670
|
+
Column29("text", {
|
|
3489
3671
|
name: "partyCorrelationId",
|
|
3490
3672
|
nullable: true,
|
|
3491
3673
|
unique: false
|
|
3492
3674
|
}),
|
|
3493
|
-
|
|
3675
|
+
_ts_metadata31("design:type", String)
|
|
3494
3676
|
], AuditEventEntity.prototype, "partyCorrelationId", void 0);
|
|
3495
|
-
|
|
3496
|
-
|
|
3677
|
+
_ts_decorate32([
|
|
3678
|
+
Column29("text", {
|
|
3497
3679
|
name: "partyAlias",
|
|
3498
3680
|
nullable: true,
|
|
3499
3681
|
unique: false
|
|
3500
3682
|
}),
|
|
3501
|
-
|
|
3683
|
+
_ts_metadata31("design:type", String)
|
|
3502
3684
|
], AuditEventEntity.prototype, "partyAlias", void 0);
|
|
3503
|
-
|
|
3504
|
-
|
|
3685
|
+
_ts_decorate32([
|
|
3686
|
+
Column29("text", {
|
|
3505
3687
|
name: "description",
|
|
3506
3688
|
nullable: false,
|
|
3507
3689
|
unique: false
|
|
3508
3690
|
}),
|
|
3509
|
-
|
|
3691
|
+
_ts_metadata31("design:type", String)
|
|
3510
3692
|
], AuditEventEntity.prototype, "description", void 0);
|
|
3511
|
-
|
|
3512
|
-
|
|
3693
|
+
_ts_decorate32([
|
|
3694
|
+
Column29("simple-enum", {
|
|
3513
3695
|
name: "credentialType",
|
|
3514
3696
|
enum: CredentialType,
|
|
3515
3697
|
nullable: true,
|
|
3516
3698
|
unique: false
|
|
3517
3699
|
}),
|
|
3518
|
-
|
|
3700
|
+
_ts_metadata31("design:type", typeof CredentialType === "undefined" ? Object : CredentialType)
|
|
3519
3701
|
], AuditEventEntity.prototype, "credentialType", void 0);
|
|
3520
|
-
|
|
3521
|
-
|
|
3702
|
+
_ts_decorate32([
|
|
3703
|
+
Column29("text", {
|
|
3522
3704
|
name: "credentialHash",
|
|
3523
3705
|
nullable: true,
|
|
3524
3706
|
unique: false
|
|
3525
3707
|
}),
|
|
3526
|
-
|
|
3708
|
+
_ts_metadata31("design:type", String)
|
|
3527
3709
|
], AuditEventEntity.prototype, "credentialHash", void 0);
|
|
3528
|
-
|
|
3529
|
-
|
|
3710
|
+
_ts_decorate32([
|
|
3711
|
+
Column29("text", {
|
|
3530
3712
|
name: "parentCredentialHash",
|
|
3531
3713
|
nullable: true,
|
|
3532
3714
|
unique: false
|
|
3533
3715
|
}),
|
|
3534
|
-
|
|
3716
|
+
_ts_metadata31("design:type", String)
|
|
3535
3717
|
], AuditEventEntity.prototype, "parentCredentialHash", void 0);
|
|
3536
|
-
|
|
3537
|
-
|
|
3718
|
+
_ts_decorate32([
|
|
3719
|
+
Column29("text", {
|
|
3538
3720
|
name: "originalCredential",
|
|
3539
3721
|
nullable: true,
|
|
3540
3722
|
unique: false
|
|
3541
3723
|
}),
|
|
3542
|
-
|
|
3724
|
+
_ts_metadata31("design:type", String)
|
|
3543
3725
|
], AuditEventEntity.prototype, "originalCredential", void 0);
|
|
3544
|
-
|
|
3545
|
-
|
|
3726
|
+
_ts_decorate32([
|
|
3727
|
+
Column29("text", {
|
|
3546
3728
|
name: "sharePurpose",
|
|
3547
3729
|
nullable: true,
|
|
3548
3730
|
unique: false
|
|
3549
3731
|
}),
|
|
3550
|
-
|
|
3732
|
+
_ts_metadata31("design:type", String)
|
|
3551
3733
|
], AuditEventEntity.prototype, "sharePurpose", void 0);
|
|
3552
|
-
|
|
3553
|
-
|
|
3734
|
+
_ts_decorate32([
|
|
3735
|
+
Column29("text", {
|
|
3554
3736
|
name: "data",
|
|
3555
3737
|
nullable: true,
|
|
3556
3738
|
unique: false
|
|
3557
3739
|
}),
|
|
3558
|
-
|
|
3740
|
+
_ts_metadata31("design:type", String)
|
|
3559
3741
|
], AuditEventEntity.prototype, "data", void 0);
|
|
3560
|
-
|
|
3561
|
-
|
|
3742
|
+
_ts_decorate32([
|
|
3743
|
+
Column29("text", {
|
|
3562
3744
|
name: "diagnosticData",
|
|
3563
3745
|
nullable: true,
|
|
3564
3746
|
unique: false
|
|
3565
3747
|
}),
|
|
3566
|
-
|
|
3748
|
+
_ts_metadata31("design:type", String)
|
|
3567
3749
|
], AuditEventEntity.prototype, "diagnosticData", void 0);
|
|
3568
|
-
|
|
3750
|
+
_ts_decorate32([
|
|
3569
3751
|
CreateDateColumn12({
|
|
3570
3752
|
name: "created_at",
|
|
3571
3753
|
nullable: false,
|
|
3572
3754
|
type: typeOrmDateTime15()
|
|
3573
3755
|
}),
|
|
3574
|
-
|
|
3756
|
+
_ts_metadata31("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3575
3757
|
], AuditEventEntity.prototype, "createdAt", void 0);
|
|
3576
|
-
|
|
3758
|
+
_ts_decorate32([
|
|
3577
3759
|
UpdateDateColumn12({
|
|
3578
3760
|
name: "last_updated_at",
|
|
3579
3761
|
nullable: false,
|
|
3580
3762
|
type: typeOrmDateTime15()
|
|
3581
3763
|
}),
|
|
3582
|
-
|
|
3764
|
+
_ts_metadata31("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3583
3765
|
], AuditEventEntity.prototype, "lastUpdatedAt", void 0);
|
|
3584
|
-
AuditEventEntity =
|
|
3766
|
+
AuditEventEntity = _ts_decorate32([
|
|
3585
3767
|
Entity24("AuditEvents")
|
|
3586
3768
|
], AuditEventEntity);
|
|
3587
3769
|
|
|
3588
3770
|
// src/entities/digitalCredential/DigitalCredentialEntity.ts
|
|
3589
3771
|
import { typeormDate, typeOrmDateTime as typeOrmDateTime16 } from "@sphereon/ssi-sdk.agent-config";
|
|
3590
|
-
import { BaseEntity as BaseEntity23, Column as
|
|
3591
|
-
function
|
|
3772
|
+
import { BaseEntity as BaseEntity23, Column as Column30, CreateDateColumn as CreateDateColumn13, Entity as Entity25, PrimaryGeneratedColumn as PrimaryGeneratedColumn22, UpdateDateColumn as UpdateDateColumn13 } from "typeorm";
|
|
3773
|
+
function _ts_decorate33(decorators, target, key, desc) {
|
|
3592
3774
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3593
3775
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3594
3776
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3595
3777
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3596
3778
|
}
|
|
3597
|
-
__name(
|
|
3598
|
-
function
|
|
3779
|
+
__name(_ts_decorate33, "_ts_decorate");
|
|
3780
|
+
function _ts_metadata32(k, v) {
|
|
3599
3781
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3600
3782
|
}
|
|
3601
|
-
__name(
|
|
3783
|
+
__name(_ts_metadata32, "_ts_metadata");
|
|
3602
3784
|
var DigitalCredentialEntity = class extends BaseEntity23 {
|
|
3603
3785
|
static {
|
|
3604
3786
|
__name(this, "DigitalCredentialEntity");
|
|
@@ -3632,235 +3814,235 @@ var DigitalCredentialEntity = class extends BaseEntity23 {
|
|
|
3632
3814
|
verifiedAt;
|
|
3633
3815
|
revokedAt;
|
|
3634
3816
|
};
|
|
3635
|
-
|
|
3817
|
+
_ts_decorate33([
|
|
3636
3818
|
PrimaryGeneratedColumn22("uuid"),
|
|
3637
|
-
|
|
3819
|
+
_ts_metadata32("design:type", String)
|
|
3638
3820
|
], DigitalCredentialEntity.prototype, "id", void 0);
|
|
3639
|
-
|
|
3640
|
-
|
|
3821
|
+
_ts_decorate33([
|
|
3822
|
+
Column30("text", {
|
|
3641
3823
|
name: "parent_id",
|
|
3642
3824
|
nullable: true
|
|
3643
3825
|
}),
|
|
3644
|
-
|
|
3826
|
+
_ts_metadata32("design:type", String)
|
|
3645
3827
|
], DigitalCredentialEntity.prototype, "parentId", void 0);
|
|
3646
|
-
|
|
3647
|
-
|
|
3828
|
+
_ts_decorate33([
|
|
3829
|
+
Column30("simple-enum", {
|
|
3648
3830
|
name: "document_type",
|
|
3649
3831
|
enum: DocumentType,
|
|
3650
3832
|
nullable: false
|
|
3651
3833
|
}),
|
|
3652
|
-
|
|
3834
|
+
_ts_metadata32("design:type", typeof DocumentType === "undefined" ? Object : DocumentType)
|
|
3653
3835
|
], DigitalCredentialEntity.prototype, "documentType", void 0);
|
|
3654
|
-
|
|
3655
|
-
|
|
3836
|
+
_ts_decorate33([
|
|
3837
|
+
Column30("simple-enum", {
|
|
3656
3838
|
name: "regulation_type",
|
|
3657
3839
|
enum: RegulationType,
|
|
3658
3840
|
nullable: false
|
|
3659
3841
|
}),
|
|
3660
|
-
|
|
3842
|
+
_ts_metadata32("design:type", typeof RegulationType === "undefined" ? Object : RegulationType)
|
|
3661
3843
|
], DigitalCredentialEntity.prototype, "regulationType", void 0);
|
|
3662
|
-
|
|
3663
|
-
|
|
3844
|
+
_ts_decorate33([
|
|
3845
|
+
Column30("simple-enum", {
|
|
3664
3846
|
name: "document_format",
|
|
3665
3847
|
enum: CredentialDocumentFormat,
|
|
3666
3848
|
nullable: false
|
|
3667
3849
|
}),
|
|
3668
|
-
|
|
3850
|
+
_ts_metadata32("design:type", typeof CredentialDocumentFormat === "undefined" ? Object : CredentialDocumentFormat)
|
|
3669
3851
|
], DigitalCredentialEntity.prototype, "documentFormat", void 0);
|
|
3670
|
-
|
|
3671
|
-
|
|
3852
|
+
_ts_decorate33([
|
|
3853
|
+
Column30("simple-enum", {
|
|
3672
3854
|
name: "credential_role",
|
|
3673
3855
|
enum: CredentialRole,
|
|
3674
3856
|
nullable: false
|
|
3675
3857
|
}),
|
|
3676
|
-
|
|
3858
|
+
_ts_metadata32("design:type", typeof CredentialRole === "undefined" ? Object : CredentialRole)
|
|
3677
3859
|
], DigitalCredentialEntity.prototype, "credentialRole", void 0);
|
|
3678
|
-
|
|
3679
|
-
|
|
3860
|
+
_ts_decorate33([
|
|
3861
|
+
Column30("text", {
|
|
3680
3862
|
name: "raw_document",
|
|
3681
3863
|
nullable: false
|
|
3682
3864
|
}),
|
|
3683
|
-
|
|
3865
|
+
_ts_metadata32("design:type", String)
|
|
3684
3866
|
], DigitalCredentialEntity.prototype, "rawDocument", void 0);
|
|
3685
|
-
|
|
3686
|
-
|
|
3867
|
+
_ts_decorate33([
|
|
3868
|
+
Column30("text", {
|
|
3687
3869
|
name: "uniform_document",
|
|
3688
3870
|
nullable: false
|
|
3689
3871
|
}),
|
|
3690
|
-
|
|
3872
|
+
_ts_metadata32("design:type", String)
|
|
3691
3873
|
], DigitalCredentialEntity.prototype, "uniformDocument", void 0);
|
|
3692
|
-
|
|
3693
|
-
|
|
3874
|
+
_ts_decorate33([
|
|
3875
|
+
Column30("text", {
|
|
3694
3876
|
name: "credential_id",
|
|
3695
3877
|
nullable: true,
|
|
3696
3878
|
unique: false
|
|
3697
3879
|
}),
|
|
3698
|
-
|
|
3880
|
+
_ts_metadata32("design:type", String)
|
|
3699
3881
|
], DigitalCredentialEntity.prototype, "credentialId", void 0);
|
|
3700
|
-
|
|
3701
|
-
|
|
3882
|
+
_ts_decorate33([
|
|
3883
|
+
Column30("text", {
|
|
3702
3884
|
name: "hash",
|
|
3703
3885
|
nullable: false,
|
|
3704
3886
|
unique: true
|
|
3705
3887
|
}),
|
|
3706
|
-
|
|
3888
|
+
_ts_metadata32("design:type", String)
|
|
3707
3889
|
], DigitalCredentialEntity.prototype, "hash", void 0);
|
|
3708
|
-
|
|
3709
|
-
|
|
3890
|
+
_ts_decorate33([
|
|
3891
|
+
Column30("text", {
|
|
3710
3892
|
name: "kms_key_ref",
|
|
3711
3893
|
nullable: true
|
|
3712
3894
|
}),
|
|
3713
|
-
|
|
3895
|
+
_ts_metadata32("design:type", String)
|
|
3714
3896
|
], DigitalCredentialEntity.prototype, "kmsKeyRef", void 0);
|
|
3715
|
-
|
|
3716
|
-
|
|
3897
|
+
_ts_decorate33([
|
|
3898
|
+
Column30("text", {
|
|
3717
3899
|
name: "identifier_method",
|
|
3718
3900
|
nullable: true
|
|
3719
3901
|
}),
|
|
3720
|
-
|
|
3902
|
+
_ts_metadata32("design:type", String)
|
|
3721
3903
|
], DigitalCredentialEntity.prototype, "identifierMethod", void 0);
|
|
3722
|
-
|
|
3723
|
-
|
|
3904
|
+
_ts_decorate33([
|
|
3905
|
+
Column30("simple-enum", {
|
|
3724
3906
|
name: "issuer_correlation_type",
|
|
3725
3907
|
enum: CredentialCorrelationType,
|
|
3726
3908
|
nullable: false
|
|
3727
3909
|
}),
|
|
3728
|
-
|
|
3910
|
+
_ts_metadata32("design:type", typeof CredentialCorrelationType === "undefined" ? Object : CredentialCorrelationType)
|
|
3729
3911
|
], DigitalCredentialEntity.prototype, "issuerCorrelationType", void 0);
|
|
3730
|
-
|
|
3731
|
-
|
|
3912
|
+
_ts_decorate33([
|
|
3913
|
+
Column30("simple-enum", {
|
|
3732
3914
|
name: "subject_correlation_type",
|
|
3733
3915
|
enum: CredentialCorrelationType,
|
|
3734
3916
|
nullable: true
|
|
3735
3917
|
}),
|
|
3736
|
-
|
|
3918
|
+
_ts_metadata32("design:type", typeof CredentialCorrelationType === "undefined" ? Object : CredentialCorrelationType)
|
|
3737
3919
|
], DigitalCredentialEntity.prototype, "subjectCorrelationType", void 0);
|
|
3738
|
-
|
|
3739
|
-
|
|
3920
|
+
_ts_decorate33([
|
|
3921
|
+
Column30("simple-enum", {
|
|
3740
3922
|
name: "rp_correlation_type",
|
|
3741
3923
|
enum: CredentialCorrelationType,
|
|
3742
3924
|
nullable: true
|
|
3743
3925
|
}),
|
|
3744
|
-
|
|
3926
|
+
_ts_metadata32("design:type", typeof CredentialCorrelationType === "undefined" ? Object : CredentialCorrelationType)
|
|
3745
3927
|
], DigitalCredentialEntity.prototype, "rpCorrelationType", void 0);
|
|
3746
|
-
|
|
3747
|
-
|
|
3928
|
+
_ts_decorate33([
|
|
3929
|
+
Column30("boolean", {
|
|
3748
3930
|
name: "issuer_signed",
|
|
3749
3931
|
nullable: true
|
|
3750
3932
|
}),
|
|
3751
|
-
|
|
3933
|
+
_ts_metadata32("design:type", Boolean)
|
|
3752
3934
|
], DigitalCredentialEntity.prototype, "isIssuerSigned", void 0);
|
|
3753
|
-
|
|
3754
|
-
|
|
3935
|
+
_ts_decorate33([
|
|
3936
|
+
Column30("text", {
|
|
3755
3937
|
name: "issuer_correlation_id",
|
|
3756
3938
|
nullable: false
|
|
3757
3939
|
}),
|
|
3758
|
-
|
|
3940
|
+
_ts_metadata32("design:type", String)
|
|
3759
3941
|
], DigitalCredentialEntity.prototype, "issuerCorrelationId", void 0);
|
|
3760
|
-
|
|
3761
|
-
|
|
3942
|
+
_ts_decorate33([
|
|
3943
|
+
Column30("text", {
|
|
3762
3944
|
name: "subject_correlation_id",
|
|
3763
3945
|
nullable: true
|
|
3764
3946
|
}),
|
|
3765
|
-
|
|
3947
|
+
_ts_metadata32("design:type", String)
|
|
3766
3948
|
], DigitalCredentialEntity.prototype, "subjectCorrelationId", void 0);
|
|
3767
|
-
|
|
3768
|
-
|
|
3949
|
+
_ts_decorate33([
|
|
3950
|
+
Column30("text", {
|
|
3769
3951
|
name: "rp_correlation_id",
|
|
3770
3952
|
nullable: true
|
|
3771
3953
|
}),
|
|
3772
|
-
|
|
3954
|
+
_ts_metadata32("design:type", String)
|
|
3773
3955
|
], DigitalCredentialEntity.prototype, "rpCorrelationId", void 0);
|
|
3774
|
-
|
|
3775
|
-
|
|
3956
|
+
_ts_decorate33([
|
|
3957
|
+
Column30("simple-enum", {
|
|
3776
3958
|
name: "verified_state",
|
|
3777
3959
|
enum: CredentialStateType,
|
|
3778
3960
|
nullable: true
|
|
3779
3961
|
}),
|
|
3780
|
-
|
|
3962
|
+
_ts_metadata32("design:type", typeof CredentialStateType === "undefined" ? Object : CredentialStateType)
|
|
3781
3963
|
], DigitalCredentialEntity.prototype, "verifiedState", void 0);
|
|
3782
|
-
|
|
3783
|
-
|
|
3964
|
+
_ts_decorate33([
|
|
3965
|
+
Column30("text", {
|
|
3784
3966
|
name: "tenant_id",
|
|
3785
3967
|
nullable: true
|
|
3786
3968
|
}),
|
|
3787
|
-
|
|
3969
|
+
_ts_metadata32("design:type", String)
|
|
3788
3970
|
], DigitalCredentialEntity.prototype, "tenantId", void 0);
|
|
3789
|
-
|
|
3971
|
+
_ts_decorate33([
|
|
3790
3972
|
CreateDateColumn13({
|
|
3791
3973
|
name: "created_at",
|
|
3792
3974
|
nullable: false,
|
|
3793
3975
|
type: typeOrmDateTime16()
|
|
3794
3976
|
}),
|
|
3795
|
-
|
|
3977
|
+
_ts_metadata32("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3796
3978
|
], DigitalCredentialEntity.prototype, "createdAt", void 0);
|
|
3797
|
-
|
|
3798
|
-
|
|
3979
|
+
_ts_decorate33([
|
|
3980
|
+
Column30({
|
|
3799
3981
|
name: "presented_at",
|
|
3800
3982
|
nullable: true,
|
|
3801
3983
|
type: typeormDate()
|
|
3802
3984
|
}),
|
|
3803
|
-
|
|
3985
|
+
_ts_metadata32("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3804
3986
|
], DigitalCredentialEntity.prototype, "presentedAt", void 0);
|
|
3805
|
-
|
|
3987
|
+
_ts_decorate33([
|
|
3806
3988
|
UpdateDateColumn13({
|
|
3807
3989
|
name: "last_updated_at",
|
|
3808
3990
|
nullable: false,
|
|
3809
3991
|
type: typeOrmDateTime16()
|
|
3810
3992
|
}),
|
|
3811
|
-
|
|
3993
|
+
_ts_metadata32("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3812
3994
|
], DigitalCredentialEntity.prototype, "lastUpdatedAt", void 0);
|
|
3813
|
-
|
|
3814
|
-
|
|
3995
|
+
_ts_decorate33([
|
|
3996
|
+
Column30({
|
|
3815
3997
|
name: "valid_until",
|
|
3816
3998
|
nullable: true,
|
|
3817
3999
|
type: typeormDate()
|
|
3818
4000
|
}),
|
|
3819
|
-
|
|
4001
|
+
_ts_metadata32("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3820
4002
|
], DigitalCredentialEntity.prototype, "validUntil", void 0);
|
|
3821
|
-
|
|
3822
|
-
|
|
4003
|
+
_ts_decorate33([
|
|
4004
|
+
Column30({
|
|
3823
4005
|
name: "valid_from",
|
|
3824
4006
|
nullable: true,
|
|
3825
4007
|
type: typeormDate()
|
|
3826
4008
|
}),
|
|
3827
|
-
|
|
4009
|
+
_ts_metadata32("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3828
4010
|
], DigitalCredentialEntity.prototype, "validFrom", void 0);
|
|
3829
|
-
|
|
3830
|
-
|
|
4011
|
+
_ts_decorate33([
|
|
4012
|
+
Column30({
|
|
3831
4013
|
name: "verified_at",
|
|
3832
4014
|
nullable: true,
|
|
3833
4015
|
type: typeOrmDateTime16()
|
|
3834
4016
|
}),
|
|
3835
|
-
|
|
4017
|
+
_ts_metadata32("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3836
4018
|
], DigitalCredentialEntity.prototype, "verifiedAt", void 0);
|
|
3837
|
-
|
|
3838
|
-
|
|
4019
|
+
_ts_decorate33([
|
|
4020
|
+
Column30({
|
|
3839
4021
|
name: "revoked_at",
|
|
3840
4022
|
nullable: true,
|
|
3841
4023
|
type: typeOrmDateTime16()
|
|
3842
4024
|
}),
|
|
3843
|
-
|
|
4025
|
+
_ts_metadata32("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3844
4026
|
], DigitalCredentialEntity.prototype, "revokedAt", void 0);
|
|
3845
|
-
DigitalCredentialEntity =
|
|
4027
|
+
DigitalCredentialEntity = _ts_decorate33([
|
|
3846
4028
|
Entity25("DigitalCredential")
|
|
3847
4029
|
], DigitalCredentialEntity);
|
|
3848
4030
|
|
|
3849
4031
|
// src/entities/presentationDefinition/PresentationDefinitionItemEntity.ts
|
|
3850
|
-
import { BaseEntity as BaseEntity24, BeforeInsert as BeforeInsert20, BeforeUpdate as BeforeUpdate20, Column as
|
|
4032
|
+
import { BaseEntity as BaseEntity24, BeforeInsert as BeforeInsert20, BeforeUpdate as BeforeUpdate20, Column as Column31, CreateDateColumn as CreateDateColumn14, Entity as Entity26, Index as Index8, PrimaryGeneratedColumn as PrimaryGeneratedColumn23, UpdateDateColumn as UpdateDateColumn14 } from "typeorm";
|
|
3851
4033
|
import { IsNotEmpty as IsNotEmpty12 } from "class-validator";
|
|
3852
4034
|
import { typeOrmDateTime as typeOrmDateTime17 } from "@sphereon/ssi-sdk.agent-config";
|
|
3853
|
-
function
|
|
4035
|
+
function _ts_decorate34(decorators, target, key, desc) {
|
|
3854
4036
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3855
4037
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3856
4038
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3857
4039
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3858
4040
|
}
|
|
3859
|
-
__name(
|
|
3860
|
-
function
|
|
4041
|
+
__name(_ts_decorate34, "_ts_decorate");
|
|
4042
|
+
function _ts_metadata33(k, v) {
|
|
3861
4043
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3862
4044
|
}
|
|
3863
|
-
__name(
|
|
4045
|
+
__name(_ts_metadata33, "_ts_metadata");
|
|
3864
4046
|
var PresentationDefinitionItemEntity = class extends BaseEntity24 {
|
|
3865
4047
|
static {
|
|
3866
4048
|
__name(this, "PresentationDefinitionItemEntity");
|
|
@@ -3880,12 +4062,12 @@ var PresentationDefinitionItemEntity = class extends BaseEntity24 {
|
|
|
3880
4062
|
this.lastUpdatedAt = /* @__PURE__ */ new Date();
|
|
3881
4063
|
}
|
|
3882
4064
|
};
|
|
3883
|
-
|
|
4065
|
+
_ts_decorate34([
|
|
3884
4066
|
PrimaryGeneratedColumn23("uuid"),
|
|
3885
|
-
|
|
4067
|
+
_ts_metadata33("design:type", String)
|
|
3886
4068
|
], PresentationDefinitionItemEntity.prototype, "id", void 0);
|
|
3887
|
-
|
|
3888
|
-
|
|
4069
|
+
_ts_decorate34([
|
|
4070
|
+
Column31({
|
|
3889
4071
|
name: "definition_id",
|
|
3890
4072
|
length: 255,
|
|
3891
4073
|
type: "varchar",
|
|
@@ -3895,10 +4077,10 @@ _ts_decorate33([
|
|
|
3895
4077
|
IsNotEmpty12({
|
|
3896
4078
|
message: "A blank definition id field is not allowed"
|
|
3897
4079
|
}),
|
|
3898
|
-
|
|
4080
|
+
_ts_metadata33("design:type", String)
|
|
3899
4081
|
], PresentationDefinitionItemEntity.prototype, "definitionId", void 0);
|
|
3900
|
-
|
|
3901
|
-
|
|
4082
|
+
_ts_decorate34([
|
|
4083
|
+
Column31({
|
|
3902
4084
|
name: "version",
|
|
3903
4085
|
length: 255,
|
|
3904
4086
|
type: "varchar",
|
|
@@ -3908,40 +4090,40 @@ _ts_decorate33([
|
|
|
3908
4090
|
IsNotEmpty12({
|
|
3909
4091
|
message: "A blank version field is not allowed"
|
|
3910
4092
|
}),
|
|
3911
|
-
|
|
4093
|
+
_ts_metadata33("design:type", String)
|
|
3912
4094
|
], PresentationDefinitionItemEntity.prototype, "version", void 0);
|
|
3913
|
-
|
|
3914
|
-
|
|
4095
|
+
_ts_decorate34([
|
|
4096
|
+
Column31({
|
|
3915
4097
|
name: "tenant_id",
|
|
3916
4098
|
length: 255,
|
|
3917
4099
|
type: "varchar",
|
|
3918
4100
|
nullable: true,
|
|
3919
4101
|
unique: false
|
|
3920
4102
|
}),
|
|
3921
|
-
|
|
4103
|
+
_ts_metadata33("design:type", String)
|
|
3922
4104
|
], PresentationDefinitionItemEntity.prototype, "tenantId", void 0);
|
|
3923
|
-
|
|
3924
|
-
|
|
4105
|
+
_ts_decorate34([
|
|
4106
|
+
Column31({
|
|
3925
4107
|
name: "purpose",
|
|
3926
4108
|
length: 255,
|
|
3927
4109
|
type: "varchar",
|
|
3928
4110
|
nullable: true,
|
|
3929
4111
|
unique: false
|
|
3930
4112
|
}),
|
|
3931
|
-
|
|
4113
|
+
_ts_metadata33("design:type", String)
|
|
3932
4114
|
], PresentationDefinitionItemEntity.prototype, "purpose", void 0);
|
|
3933
|
-
|
|
3934
|
-
|
|
4115
|
+
_ts_decorate34([
|
|
4116
|
+
Column31({
|
|
3935
4117
|
name: "name",
|
|
3936
4118
|
length: 255,
|
|
3937
4119
|
type: "varchar",
|
|
3938
4120
|
nullable: true,
|
|
3939
4121
|
unique: false
|
|
3940
4122
|
}),
|
|
3941
|
-
|
|
4123
|
+
_ts_metadata33("design:type", String)
|
|
3942
4124
|
], PresentationDefinitionItemEntity.prototype, "name", void 0);
|
|
3943
|
-
|
|
3944
|
-
|
|
4125
|
+
_ts_decorate34([
|
|
4126
|
+
Column31({
|
|
3945
4127
|
name: "definition_payload",
|
|
3946
4128
|
type: "text",
|
|
3947
4129
|
nullable: false,
|
|
@@ -3950,10 +4132,10 @@ _ts_decorate33([
|
|
|
3950
4132
|
IsNotEmpty12({
|
|
3951
4133
|
message: "A blank PD definition payload field is not allowed"
|
|
3952
4134
|
}),
|
|
3953
|
-
|
|
4135
|
+
_ts_metadata33("design:type", String)
|
|
3954
4136
|
], PresentationDefinitionItemEntity.prototype, "definitionPayload", void 0);
|
|
3955
|
-
|
|
3956
|
-
|
|
4137
|
+
_ts_decorate34([
|
|
4138
|
+
Column31({
|
|
3957
4139
|
name: "dcql_payload",
|
|
3958
4140
|
type: "text",
|
|
3959
4141
|
nullable: true,
|
|
@@ -3962,32 +4144,32 @@ _ts_decorate33([
|
|
|
3962
4144
|
IsNotEmpty12({
|
|
3963
4145
|
message: "A blank dcql definition payload field is not allowed"
|
|
3964
4146
|
}),
|
|
3965
|
-
|
|
4147
|
+
_ts_metadata33("design:type", String)
|
|
3966
4148
|
], PresentationDefinitionItemEntity.prototype, "dcqlPayload", void 0);
|
|
3967
|
-
|
|
4149
|
+
_ts_decorate34([
|
|
3968
4150
|
CreateDateColumn14({
|
|
3969
4151
|
name: "created_at",
|
|
3970
4152
|
nullable: false,
|
|
3971
4153
|
type: typeOrmDateTime17()
|
|
3972
4154
|
}),
|
|
3973
|
-
|
|
4155
|
+
_ts_metadata33("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3974
4156
|
], PresentationDefinitionItemEntity.prototype, "createdAt", void 0);
|
|
3975
|
-
|
|
4157
|
+
_ts_decorate34([
|
|
3976
4158
|
UpdateDateColumn14({
|
|
3977
4159
|
name: "last_updated_at",
|
|
3978
4160
|
nullable: false,
|
|
3979
4161
|
type: typeOrmDateTime17()
|
|
3980
4162
|
}),
|
|
3981
|
-
|
|
4163
|
+
_ts_metadata33("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3982
4164
|
], PresentationDefinitionItemEntity.prototype, "lastUpdatedAt", void 0);
|
|
3983
|
-
|
|
4165
|
+
_ts_decorate34([
|
|
3984
4166
|
BeforeInsert20(),
|
|
3985
4167
|
BeforeUpdate20(),
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
4168
|
+
_ts_metadata33("design:type", Function),
|
|
4169
|
+
_ts_metadata33("design:paramtypes", []),
|
|
4170
|
+
_ts_metadata33("design:returntype", void 0)
|
|
3989
4171
|
], PresentationDefinitionItemEntity.prototype, "updateUpdatedDate", null);
|
|
3990
|
-
PresentationDefinitionItemEntity =
|
|
4172
|
+
PresentationDefinitionItemEntity = _ts_decorate34([
|
|
3991
4173
|
Entity26("PresentationDefinitionItem"),
|
|
3992
4174
|
Index8([
|
|
3993
4175
|
"version"
|
|
@@ -3998,18 +4180,18 @@ PresentationDefinitionItemEntity = _ts_decorate33([
|
|
|
3998
4180
|
|
|
3999
4181
|
// src/entities/oid4vcState/Oid4vcStateEntity.ts
|
|
4000
4182
|
import { typeOrmDateTime as typeOrmDateTime18 } from "@sphereon/ssi-sdk.agent-config";
|
|
4001
|
-
import { BaseEntity as BaseEntity25, Column as
|
|
4002
|
-
function
|
|
4183
|
+
import { BaseEntity as BaseEntity25, Column as Column32, CreateDateColumn as CreateDateColumn15, Entity as Entity27, PrimaryColumn as PrimaryColumn4, UpdateDateColumn as UpdateDateColumn15 } from "typeorm";
|
|
4184
|
+
function _ts_decorate35(decorators, target, key, desc) {
|
|
4003
4185
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4004
4186
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4005
4187
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4006
4188
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4007
4189
|
}
|
|
4008
|
-
__name(
|
|
4009
|
-
function
|
|
4190
|
+
__name(_ts_decorate35, "_ts_decorate");
|
|
4191
|
+
function _ts_metadata34(k, v) {
|
|
4010
4192
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
4011
4193
|
}
|
|
4012
|
-
__name(
|
|
4194
|
+
__name(_ts_metadata34, "_ts_metadata");
|
|
4013
4195
|
var Oid4vcStateEntity = class extends BaseEntity25 {
|
|
4014
4196
|
static {
|
|
4015
4197
|
__name(this, "Oid4vcStateEntity");
|
|
@@ -4024,79 +4206,79 @@ var Oid4vcStateEntity = class extends BaseEntity25 {
|
|
|
4024
4206
|
expiresAt;
|
|
4025
4207
|
tenantId;
|
|
4026
4208
|
};
|
|
4027
|
-
|
|
4209
|
+
_ts_decorate35([
|
|
4028
4210
|
PrimaryColumn4({
|
|
4029
4211
|
name: "id",
|
|
4030
4212
|
type: "varchar",
|
|
4031
4213
|
nullable: false
|
|
4032
4214
|
}),
|
|
4033
|
-
|
|
4215
|
+
_ts_metadata34("design:type", String)
|
|
4034
4216
|
], Oid4vcStateEntity.prototype, "id", void 0);
|
|
4035
|
-
|
|
4036
|
-
|
|
4217
|
+
_ts_decorate35([
|
|
4218
|
+
Column32({
|
|
4037
4219
|
name: "lookup_ids",
|
|
4038
4220
|
type: "array",
|
|
4039
4221
|
nullable: true
|
|
4040
4222
|
}),
|
|
4041
|
-
|
|
4223
|
+
_ts_metadata34("design:type", typeof Array === "undefined" ? Object : Array)
|
|
4042
4224
|
], Oid4vcStateEntity.prototype, "lookups", void 0);
|
|
4043
|
-
|
|
4044
|
-
|
|
4225
|
+
_ts_decorate35([
|
|
4226
|
+
Column32({
|
|
4045
4227
|
name: "state_id",
|
|
4046
4228
|
type: "varchar",
|
|
4047
4229
|
nullable: true
|
|
4048
4230
|
}),
|
|
4049
|
-
|
|
4231
|
+
_ts_metadata34("design:type", String)
|
|
4050
4232
|
], Oid4vcStateEntity.prototype, "stateId", void 0);
|
|
4051
|
-
|
|
4052
|
-
|
|
4233
|
+
_ts_decorate35([
|
|
4234
|
+
Column32({
|
|
4053
4235
|
name: "correlation_id",
|
|
4054
4236
|
type: "varchar",
|
|
4055
4237
|
nullable: true
|
|
4056
4238
|
}),
|
|
4057
|
-
|
|
4239
|
+
_ts_metadata34("design:type", String)
|
|
4058
4240
|
], Oid4vcStateEntity.prototype, "correlationId", void 0);
|
|
4059
|
-
|
|
4060
|
-
|
|
4241
|
+
_ts_decorate35([
|
|
4242
|
+
Column32({
|
|
4061
4243
|
name: "state",
|
|
4062
4244
|
type: "json",
|
|
4063
4245
|
nullable: false
|
|
4064
4246
|
}),
|
|
4065
|
-
|
|
4247
|
+
_ts_metadata34("design:type", typeof StateType === "undefined" ? Object : StateType)
|
|
4066
4248
|
], Oid4vcStateEntity.prototype, "state", void 0);
|
|
4067
|
-
|
|
4249
|
+
_ts_decorate35([
|
|
4068
4250
|
CreateDateColumn15({
|
|
4069
4251
|
name: "created_at",
|
|
4070
4252
|
nullable: false,
|
|
4071
4253
|
type: typeOrmDateTime18()
|
|
4072
4254
|
}),
|
|
4073
|
-
|
|
4255
|
+
_ts_metadata34("design:type", typeof Date === "undefined" ? Object : Date)
|
|
4074
4256
|
], Oid4vcStateEntity.prototype, "createdAt", void 0);
|
|
4075
|
-
|
|
4257
|
+
_ts_decorate35([
|
|
4076
4258
|
UpdateDateColumn15({
|
|
4077
4259
|
name: "updated_at",
|
|
4078
4260
|
nullable: false,
|
|
4079
4261
|
type: typeOrmDateTime18()
|
|
4080
4262
|
}),
|
|
4081
|
-
|
|
4263
|
+
_ts_metadata34("design:type", typeof Date === "undefined" ? Object : Date)
|
|
4082
4264
|
], Oid4vcStateEntity.prototype, "updatedAt", void 0);
|
|
4083
|
-
|
|
4084
|
-
|
|
4265
|
+
_ts_decorate35([
|
|
4266
|
+
Column32({
|
|
4085
4267
|
name: "expires_at",
|
|
4086
4268
|
nullable: true,
|
|
4087
4269
|
type: typeOrmDateTime18()
|
|
4088
4270
|
}),
|
|
4089
|
-
|
|
4271
|
+
_ts_metadata34("design:type", typeof Date === "undefined" ? Object : Date)
|
|
4090
4272
|
], Oid4vcStateEntity.prototype, "expiresAt", void 0);
|
|
4091
|
-
|
|
4092
|
-
|
|
4273
|
+
_ts_decorate35([
|
|
4274
|
+
Column32({
|
|
4093
4275
|
name: "tenant_id",
|
|
4094
4276
|
type: "varchar",
|
|
4095
4277
|
nullable: true
|
|
4096
4278
|
}),
|
|
4097
|
-
|
|
4279
|
+
_ts_metadata34("design:type", String)
|
|
4098
4280
|
], Oid4vcStateEntity.prototype, "tenantId", void 0);
|
|
4099
|
-
Oid4vcStateEntity =
|
|
4281
|
+
Oid4vcStateEntity = _ts_decorate35([
|
|
4100
4282
|
Entity27("Oid4vcStateEntity")
|
|
4101
4283
|
], Oid4vcStateEntity);
|
|
4102
4284
|
|
|
@@ -5840,33 +6022,55 @@ import { In as In3 } from "typeorm";
|
|
|
5840
6022
|
// src/utils/statusList/MappingUtils.ts
|
|
5841
6023
|
import { StatusListType as StatusListType2 } from "@sphereon/ssi-types";
|
|
5842
6024
|
var statusListEntityFrom = /* @__PURE__ */ __name((args) => {
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
6025
|
+
switch (args.type) {
|
|
6026
|
+
case StatusListType2.StatusList2021: {
|
|
6027
|
+
const entity = new StatusList2021Entity();
|
|
6028
|
+
const sl2021 = args;
|
|
6029
|
+
entity.indexingDirection = sl2021.indexingDirection;
|
|
6030
|
+
entity.statusPurpose = sl2021.statusPurpose;
|
|
6031
|
+
setBaseFields(entity, args);
|
|
6032
|
+
Object.defineProperty(entity, "type", {
|
|
6033
|
+
value: StatusListType2.StatusList2021,
|
|
6034
|
+
enumerable: true,
|
|
6035
|
+
configurable: true
|
|
6036
|
+
});
|
|
6037
|
+
return entity;
|
|
6038
|
+
}
|
|
6039
|
+
case StatusListType2.OAuthStatusList: {
|
|
6040
|
+
const entity = new OAuthStatusListEntity();
|
|
6041
|
+
const oauthSl = args;
|
|
6042
|
+
entity.bitsPerStatus = oauthSl.bitsPerStatus;
|
|
6043
|
+
entity.expiresAt = oauthSl.expiresAt;
|
|
6044
|
+
setBaseFields(entity, args);
|
|
6045
|
+
Object.defineProperty(entity, "type", {
|
|
6046
|
+
value: StatusListType2.OAuthStatusList,
|
|
6047
|
+
enumerable: true,
|
|
6048
|
+
configurable: true
|
|
6049
|
+
});
|
|
6050
|
+
return entity;
|
|
6051
|
+
}
|
|
6052
|
+
case StatusListType2.BitstringStatusList: {
|
|
6053
|
+
const entity = new BitstringStatusListEntity();
|
|
6054
|
+
const bitstringsl = args;
|
|
6055
|
+
if (!bitstringsl.bitsPerStatus) {
|
|
6056
|
+
throw Error("bitsPerStatus must be set for BitstringStatusList");
|
|
6057
|
+
}
|
|
6058
|
+
entity.statusPurpose = bitstringsl.statusPurpose;
|
|
6059
|
+
entity.bitsPerStatus = bitstringsl.bitsPerStatus;
|
|
6060
|
+
entity.validFrom = bitstringsl.validFrom;
|
|
6061
|
+
entity.validUntil = bitstringsl.validUntil;
|
|
6062
|
+
entity.ttl = bitstringsl.ttl;
|
|
6063
|
+
setBaseFields(entity, args);
|
|
6064
|
+
Object.defineProperty(entity, "type", {
|
|
6065
|
+
value: StatusListType2.BitstringStatusList,
|
|
6066
|
+
enumerable: true,
|
|
6067
|
+
configurable: true
|
|
6068
|
+
});
|
|
6069
|
+
return entity;
|
|
6070
|
+
}
|
|
6071
|
+
default:
|
|
6072
|
+
throw new Error(`Invalid status list type ${args.type}`);
|
|
5868
6073
|
}
|
|
5869
|
-
throw new Error(`Invalid status list type ${args.type}`);
|
|
5870
6074
|
}, "statusListEntityFrom");
|
|
5871
6075
|
var statusListFrom = /* @__PURE__ */ __name((entity) => {
|
|
5872
6076
|
if (entity instanceof StatusList2021Entity) {
|
|
@@ -5887,6 +6091,18 @@ var statusListFrom = /* @__PURE__ */ __name((entity) => {
|
|
|
5887
6091
|
};
|
|
5888
6092
|
return replaceNullWithUndefined(result);
|
|
5889
6093
|
}
|
|
6094
|
+
if (entity instanceof BitstringStatusListEntity) {
|
|
6095
|
+
const result = {
|
|
6096
|
+
...getBaseFields(entity),
|
|
6097
|
+
type: StatusListType2.BitstringStatusList,
|
|
6098
|
+
statusPurpose: entity.statusPurpose,
|
|
6099
|
+
bitsPerStatus: entity.bitsPerStatus,
|
|
6100
|
+
validFrom: entity.validFrom,
|
|
6101
|
+
validUntil: entity.validUntil,
|
|
6102
|
+
ttl: entity.ttl
|
|
6103
|
+
};
|
|
6104
|
+
return replaceNullWithUndefined(result);
|
|
6105
|
+
}
|
|
5890
6106
|
throw new Error(`Invalid status list type ${typeof entity}`);
|
|
5891
6107
|
}, "statusListFrom");
|
|
5892
6108
|
var setBaseFields = /* @__PURE__ */ __name((entity, args) => {
|
|
@@ -5937,33 +6153,44 @@ var StatusListStore = class {
|
|
|
5937
6153
|
...args,
|
|
5938
6154
|
id: args.statusListId
|
|
5939
6155
|
});
|
|
5940
|
-
const repo = await this.getStatusListEntryRepo();
|
|
6156
|
+
const repo = await this.getStatusListEntryRepo(statusList.type);
|
|
5941
6157
|
const results = (await repo.find({
|
|
5942
6158
|
where: {
|
|
5943
|
-
statusList,
|
|
6159
|
+
statusListId: statusList.id,
|
|
5944
6160
|
statusListIndex: In3(statusListIndex)
|
|
5945
6161
|
}
|
|
5946
6162
|
})).map((index) => index.statusListIndex);
|
|
5947
6163
|
return statusListIndex.filter((index) => !results.includes(index));
|
|
5948
6164
|
}
|
|
5949
6165
|
async addStatusListEntry(args) {
|
|
5950
|
-
|
|
6166
|
+
if (!args.statusListId) {
|
|
6167
|
+
throw new Error("statusListId is required");
|
|
6168
|
+
}
|
|
6169
|
+
const statusList = await this.getStatusList({
|
|
6170
|
+
id: args.statusListId
|
|
6171
|
+
});
|
|
6172
|
+
return await (await this.getStatusListEntryRepo(statusList.type)).save(args);
|
|
5951
6173
|
}
|
|
5952
6174
|
async updateStatusListEntry(args) {
|
|
5953
|
-
const statusListId = args.statusListId
|
|
6175
|
+
const statusListId = args.statusListId;
|
|
6176
|
+
if (!statusListId) {
|
|
6177
|
+
throw new Error("statusListId is required");
|
|
6178
|
+
}
|
|
6179
|
+
const statusList = await this.getStatusList({
|
|
6180
|
+
id: statusListId
|
|
6181
|
+
});
|
|
5954
6182
|
const result = await this.getStatusListEntryByIndex({
|
|
5955
6183
|
...args,
|
|
5956
6184
|
statusListId,
|
|
5957
6185
|
errorOnNotFound: false
|
|
5958
6186
|
});
|
|
5959
6187
|
const updatedEntry = {
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
credentialId: args.credentialId
|
|
6188
|
+
...result,
|
|
6189
|
+
...args,
|
|
6190
|
+
statusListId
|
|
5964
6191
|
};
|
|
5965
6192
|
const updStatusListId = result?.statusListId ?? statusListId;
|
|
5966
|
-
const updateResult = await (await this.getStatusListEntryRepo()).upsert({
|
|
6193
|
+
const updateResult = await (await this.getStatusListEntryRepo(statusList.type)).upsert({
|
|
5967
6194
|
...result ?? {
|
|
5968
6195
|
statusListId: updStatusListId,
|
|
5969
6196
|
statusListIndex: args.statusListIndex
|
|
@@ -5975,7 +6202,7 @@ var StatusListStore = class {
|
|
|
5975
6202
|
"statusListIndex"
|
|
5976
6203
|
]
|
|
5977
6204
|
});
|
|
5978
|
-
|
|
6205
|
+
debug4(updateResult);
|
|
5979
6206
|
return await this.getStatusListEntryByIndex({
|
|
5980
6207
|
...args,
|
|
5981
6208
|
statusListId: updStatusListId,
|
|
@@ -5989,7 +6216,12 @@ var StatusListStore = class {
|
|
|
5989
6216
|
if (!statusListIndex && !entryCorrelationId) {
|
|
5990
6217
|
throw Error(`Cannot get statusList entry without either a statusListIndex or entryCorrelationId`);
|
|
5991
6218
|
}
|
|
5992
|
-
const
|
|
6219
|
+
const statusList = statusListId ? await this.getStatusList({
|
|
6220
|
+
id: statusListId
|
|
6221
|
+
}) : await this.getStatusList({
|
|
6222
|
+
correlationId: statusListCorrelationId
|
|
6223
|
+
});
|
|
6224
|
+
const result = await (await this.getStatusListEntryRepo(statusList.type)).findOne({
|
|
5993
6225
|
where: {
|
|
5994
6226
|
...statusListId && {
|
|
5995
6227
|
statusListId
|
|
@@ -6033,8 +6265,8 @@ var StatusListStore = class {
|
|
|
6033
6265
|
},
|
|
6034
6266
|
credentialId
|
|
6035
6267
|
};
|
|
6036
|
-
|
|
6037
|
-
const result = await (await this.getStatusListEntryRepo()).findOne({
|
|
6268
|
+
debug4(`Entries: ${JSON.stringify(await (await this.getStatusListEntryRepo(statusList.type)).find(), null, 2)}`);
|
|
6269
|
+
const result = await (await this.getStatusListEntryRepo(statusList.type)).findOne({
|
|
6038
6270
|
where
|
|
6039
6271
|
});
|
|
6040
6272
|
if (!result && args.errorOnNotFound) {
|
|
@@ -6050,7 +6282,11 @@ var StatusListStore = class {
|
|
|
6050
6282
|
error2 = true;
|
|
6051
6283
|
}
|
|
6052
6284
|
if (!error) {
|
|
6053
|
-
const
|
|
6285
|
+
const statusList = await this.getStatusList({
|
|
6286
|
+
id: args.statusListId,
|
|
6287
|
+
correlationId: args.statusListCorrelationId
|
|
6288
|
+
});
|
|
6289
|
+
const result = await (await this.getStatusListEntryRepo(statusList.type)).delete({
|
|
6054
6290
|
...args.statusListId && {
|
|
6055
6291
|
statusList: args.statusListId
|
|
6056
6292
|
},
|
|
@@ -6071,9 +6307,12 @@ var StatusListStore = class {
|
|
|
6071
6307
|
error2 = true;
|
|
6072
6308
|
}
|
|
6073
6309
|
if (error) {
|
|
6074
|
-
console.
|
|
6310
|
+
console.error(`Could not delete statusList ${args.statusListId} entry by index ${args.statusListIndex}`);
|
|
6075
6311
|
} else {
|
|
6076
|
-
const
|
|
6312
|
+
const statusList = await this.getStatusList({
|
|
6313
|
+
id: args.statusListId
|
|
6314
|
+
});
|
|
6315
|
+
const result = await (await this.getStatusListEntryRepo(statusList.type)).delete({
|
|
6077
6316
|
...args.statusListId && {
|
|
6078
6317
|
statusList: args.statusListId
|
|
6079
6318
|
},
|
|
@@ -6087,15 +6326,16 @@ var StatusListStore = class {
|
|
|
6087
6326
|
return !error;
|
|
6088
6327
|
}
|
|
6089
6328
|
async getStatusListEntries(args) {
|
|
6090
|
-
|
|
6329
|
+
const statusList = await this.getStatusList({
|
|
6330
|
+
id: args.statusListId
|
|
6331
|
+
});
|
|
6332
|
+
const results = await (await this.getStatusListEntryRepo(statusList.type)).find({
|
|
6091
6333
|
where: {
|
|
6092
6334
|
...args?.filter,
|
|
6093
6335
|
statusList: args.statusListId
|
|
6094
6336
|
}
|
|
6095
6337
|
});
|
|
6096
|
-
|
|
6097
|
-
async getStatusList(args) {
|
|
6098
|
-
return statusListFrom(await this.getStatusListEntity(args));
|
|
6338
|
+
return results;
|
|
6099
6339
|
}
|
|
6100
6340
|
async getStatusListEntity(args) {
|
|
6101
6341
|
if (!args.id && !args.correlationId) {
|
|
@@ -6119,6 +6359,10 @@ var StatusListStore = class {
|
|
|
6119
6359
|
}
|
|
6120
6360
|
return result;
|
|
6121
6361
|
}
|
|
6362
|
+
async getStatusList(args) {
|
|
6363
|
+
const entity = await this.getStatusListEntity(args);
|
|
6364
|
+
return statusListFrom(entity);
|
|
6365
|
+
}
|
|
6122
6366
|
async getStatusLists(args) {
|
|
6123
6367
|
const result = await (await this.getStatusListRepo()).find({
|
|
6124
6368
|
where: args.filter
|
|
@@ -6159,7 +6403,7 @@ var StatusListStore = class {
|
|
|
6159
6403
|
}
|
|
6160
6404
|
async removeStatusList(args) {
|
|
6161
6405
|
const result = await this.getStatusListEntity(args);
|
|
6162
|
-
await (await this.getStatusListEntryRepo()).delete({
|
|
6406
|
+
await (await this.getStatusListEntryRepo(result.type)).delete({
|
|
6163
6407
|
statusListId: result.id
|
|
6164
6408
|
});
|
|
6165
6409
|
const deletedEntity = await (await this.getStatusListRepo()).remove(result);
|
|
@@ -6175,12 +6419,20 @@ var StatusListStore = class {
|
|
|
6175
6419
|
return dataSource.getRepository(StatusList2021Entity);
|
|
6176
6420
|
case StatusListType3.OAuthStatusList:
|
|
6177
6421
|
return dataSource.getRepository(OAuthStatusListEntity);
|
|
6422
|
+
case StatusListType3.BitstringStatusList:
|
|
6423
|
+
return dataSource.getRepository(BitstringStatusListEntity);
|
|
6178
6424
|
default:
|
|
6179
6425
|
return dataSource.getRepository(StatusListEntity);
|
|
6180
6426
|
}
|
|
6181
6427
|
}
|
|
6182
|
-
async getStatusListEntryRepo() {
|
|
6183
|
-
|
|
6428
|
+
async getStatusListEntryRepo(type) {
|
|
6429
|
+
const dataSource = await this.getDS();
|
|
6430
|
+
switch (type) {
|
|
6431
|
+
case StatusListType3.BitstringStatusList:
|
|
6432
|
+
return dataSource.getRepository(BitstringStatusListEntryEntity);
|
|
6433
|
+
default:
|
|
6434
|
+
return dataSource.getRepository(StatusListEntryEntity);
|
|
6435
|
+
}
|
|
6184
6436
|
}
|
|
6185
6437
|
};
|
|
6186
6438
|
|
|
@@ -8648,6 +8900,226 @@ var FixCredentialClaimsReferencesUuid1741895822987 = class {
|
|
|
8648
8900
|
}
|
|
8649
8901
|
};
|
|
8650
8902
|
|
|
8903
|
+
// src/migrations/generic/12-CreateBitstringStatusList.ts
|
|
8904
|
+
import Debug19 from "debug";
|
|
8905
|
+
|
|
8906
|
+
// src/migrations/postgres/1741895823000-CreateBitstringStatusList.ts
|
|
8907
|
+
var CreateBitstringStatusListPG1741895823000 = class {
|
|
8908
|
+
static {
|
|
8909
|
+
__name(this, "CreateBitstringStatusListPG1741895823000");
|
|
8910
|
+
}
|
|
8911
|
+
name = "CreateBitstringStatusList1741895823000";
|
|
8912
|
+
async up(queryRunner) {
|
|
8913
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "bitsPerStatus" integer DEFAULT 1`);
|
|
8914
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "ttl" integer`);
|
|
8915
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "validFrom" TIMESTAMP`);
|
|
8916
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "validUntil" TIMESTAMP`);
|
|
8917
|
+
await queryRunner.query(`ALTER TABLE "StatusList" DROP CONSTRAINT IF EXISTS "CHK_StatusList_type"`);
|
|
8918
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD CONSTRAINT "CHK_StatusList_type" CHECK ("type" IN ('StatusList2021', 'OAuthStatusList', 'BitstringStatusList'))`);
|
|
8919
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "type" character varying NOT NULL DEFAULT 'StatusListEntryEntity'`);
|
|
8920
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "statusPurpose" character varying`);
|
|
8921
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "bitsPerStatus" integer DEFAULT 1`);
|
|
8922
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "statusMessage" text`);
|
|
8923
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "statusReference" text`);
|
|
8924
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD CONSTRAINT "CHK_StatusListEntry_type" CHECK ("type" IN ('StatusListEntryEntity', 'bitstring'))`);
|
|
8925
|
+
}
|
|
8926
|
+
async down(queryRunner) {
|
|
8927
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP CONSTRAINT "CHK_StatusListEntry_type"`);
|
|
8928
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP COLUMN "statusReference"`);
|
|
8929
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP COLUMN "statusMessage"`);
|
|
8930
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP COLUMN "bitsPerStatus"`);
|
|
8931
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP COLUMN "statusPurpose"`);
|
|
8932
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP COLUMN "type"`);
|
|
8933
|
+
await queryRunner.query(`ALTER TABLE "StatusList" DROP CONSTRAINT "CHK_StatusList_type"`);
|
|
8934
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD CONSTRAINT "CHK_StatusList_type" CHECK ("type" IN ('StatusList2021', 'OAuthStatusList'))`);
|
|
8935
|
+
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "validUntil"`);
|
|
8936
|
+
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "validFrom"`);
|
|
8937
|
+
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "ttl"`);
|
|
8938
|
+
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "bitsPerStatus"`);
|
|
8939
|
+
}
|
|
8940
|
+
};
|
|
8941
|
+
|
|
8942
|
+
// src/migrations/sqlite/1741895823001-CreateBitstringStatusList.ts
|
|
8943
|
+
var CreateBitstringStatusListSqlite1741895823001 = class {
|
|
8944
|
+
static {
|
|
8945
|
+
__name(this, "CreateBitstringStatusListSqlite1741895823001");
|
|
8946
|
+
}
|
|
8947
|
+
name = "CreateBitstringStatusList1741895823000";
|
|
8948
|
+
async up(queryRunner) {
|
|
8949
|
+
await queryRunner.query(`
|
|
8950
|
+
CREATE TABLE "temporary_StatusList" (
|
|
8951
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
8952
|
+
"correlationId" varchar NOT NULL,
|
|
8953
|
+
"length" integer NOT NULL,
|
|
8954
|
+
"issuer" text NOT NULL,
|
|
8955
|
+
"type" varchar CHECK( "type" IN ('StatusList2021', 'OAuthStatusList', 'BitstringStatusList') ) NOT NULL DEFAULT ('StatusList2021'),
|
|
8956
|
+
"driverType" varchar CHECK( "driverType" IN ('agent_typeorm','agent_kv_store','github','agent_filesystem') ) NOT NULL DEFAULT ('agent_typeorm'),
|
|
8957
|
+
"credentialIdMode" varchar CHECK( "credentialIdMode" IN ('ISSUANCE','PERSISTENCE','NEVER') ) NOT NULL DEFAULT ('ISSUANCE'),
|
|
8958
|
+
"proofFormat" varchar CHECK( "proofFormat" IN ('lds','jwt', 'vc+jwt') ) NOT NULL DEFAULT ('lds'),
|
|
8959
|
+
"indexingDirection" varchar CHECK( "indexingDirection" IN ('rightToLeft') ),
|
|
8960
|
+
"statusPurpose" varchar,
|
|
8961
|
+
"statusListCredential" text,
|
|
8962
|
+
"expiresAt" datetime,
|
|
8963
|
+
"bitsPerStatus" integer DEFAULT (1),
|
|
8964
|
+
"ttl" integer,
|
|
8965
|
+
"validFrom" datetime,
|
|
8966
|
+
"validUntil" datetime,
|
|
8967
|
+
CONSTRAINT "UQ_correlationId" UNIQUE ("correlationId")
|
|
8968
|
+
)
|
|
8969
|
+
`);
|
|
8970
|
+
await queryRunner.query(`
|
|
8971
|
+
INSERT INTO "temporary_StatusList"(
|
|
8972
|
+
"id", "correlationId", "length", "issuer", "type", "driverType",
|
|
8973
|
+
"credentialIdMode", "proofFormat", "indexingDirection", "statusPurpose",
|
|
8974
|
+
"statusListCredential", "bitsPerStatus", "expiresAt"
|
|
8975
|
+
)
|
|
8976
|
+
SELECT
|
|
8977
|
+
"id", "correlationId", "length", "issuer", "type", "driverType",
|
|
8978
|
+
"credentialIdMode", "proofFormat", "indexingDirection", "statusPurpose",
|
|
8979
|
+
"statusListCredential", "bitsPerStatus", "expiresAt"
|
|
8980
|
+
FROM "StatusList"
|
|
8981
|
+
`);
|
|
8982
|
+
await queryRunner.query(`DROP TABLE "StatusList"`);
|
|
8983
|
+
await queryRunner.query(`ALTER TABLE "temporary_StatusList" RENAME TO "StatusList"`);
|
|
8984
|
+
await queryRunner.query(`
|
|
8985
|
+
CREATE TABLE "temporary_StatusListEntry" (
|
|
8986
|
+
"statusListId" varchar NOT NULL,
|
|
8987
|
+
"statusListIndex" integer NOT NULL,
|
|
8988
|
+
"credentialId" text,
|
|
8989
|
+
"credentialHash" varchar(128),
|
|
8990
|
+
"correlationId" varchar(255),
|
|
8991
|
+
"value" varchar(50),
|
|
8992
|
+
"type" varchar CHECK( "type" IN ('StatusListEntryEntity', 'bitstring') ) NOT NULL DEFAULT ('StatusListEntryEntity'),
|
|
8993
|
+
"statusPurpose" varchar,
|
|
8994
|
+
"bitsPerStatus" integer DEFAULT (1),
|
|
8995
|
+
"statusMessage" text,
|
|
8996
|
+
"statusReference" text,
|
|
8997
|
+
PRIMARY KEY ("statusListId", "statusListIndex")
|
|
8998
|
+
)
|
|
8999
|
+
`);
|
|
9000
|
+
await queryRunner.query(`
|
|
9001
|
+
INSERT INTO "temporary_StatusListEntry"(
|
|
9002
|
+
"statusListId", "statusListIndex", "credentialId", "credentialHash",
|
|
9003
|
+
"correlationId", "value", "type"
|
|
9004
|
+
)
|
|
9005
|
+
SELECT
|
|
9006
|
+
"statusListId", "statusListIndex", "credentialId", "credentialHash",
|
|
9007
|
+
"correlationId", "value", 'StatusListEntryEntity'
|
|
9008
|
+
FROM "StatusListEntry"
|
|
9009
|
+
`);
|
|
9010
|
+
await queryRunner.query(`DROP TABLE "StatusListEntry"`);
|
|
9011
|
+
await queryRunner.query(`ALTER TABLE "temporary_StatusListEntry" RENAME TO "StatusListEntry"`);
|
|
9012
|
+
}
|
|
9013
|
+
async down(queryRunner) {
|
|
9014
|
+
await queryRunner.query(`
|
|
9015
|
+
CREATE TABLE "temporary_StatusListEntry" (
|
|
9016
|
+
"statusListId" varchar NOT NULL,
|
|
9017
|
+
"statusListIndex" integer NOT NULL,
|
|
9018
|
+
"credentialId" text,
|
|
9019
|
+
"credentialHash" varchar(128),
|
|
9020
|
+
"correlationId" varchar(255),
|
|
9021
|
+
"value" varchar(50),
|
|
9022
|
+
PRIMARY KEY ("statusListId", "statusListIndex")
|
|
9023
|
+
)
|
|
9024
|
+
`);
|
|
9025
|
+
await queryRunner.query(`
|
|
9026
|
+
INSERT INTO "temporary_StatusListEntry"(
|
|
9027
|
+
"statusListId", "statusListIndex", "credentialId", "credentialHash",
|
|
9028
|
+
"correlationId", "value"
|
|
9029
|
+
)
|
|
9030
|
+
SELECT
|
|
9031
|
+
"statusListId", "statusListIndex", "credentialId", "credentialHash",
|
|
9032
|
+
"correlationId", "value"
|
|
9033
|
+
FROM "StatusListEntry"
|
|
9034
|
+
WHERE "type" = 'StatusListEntryEntity'
|
|
9035
|
+
`);
|
|
9036
|
+
await queryRunner.query(`DROP TABLE "StatusListEntry"`);
|
|
9037
|
+
await queryRunner.query(`ALTER TABLE "temporary_StatusListEntry" RENAME TO "StatusListEntry"`);
|
|
9038
|
+
await queryRunner.query(`
|
|
9039
|
+
CREATE TABLE "temporary_StatusList" (
|
|
9040
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
9041
|
+
"correlationId" varchar NOT NULL,
|
|
9042
|
+
"length" integer NOT NULL,
|
|
9043
|
+
"issuer" text NOT NULL,
|
|
9044
|
+
"type" varchar CHECK( "type" IN ('StatusList2021', 'OAuthStatusList') ) NOT NULL DEFAULT ('StatusList2021'),
|
|
9045
|
+
"driverType" varchar CHECK( "driverType" IN ('agent_typeorm','agent_kv_store','github','agent_filesystem') ) NOT NULL DEFAULT ('agent_typeorm'),
|
|
9046
|
+
"credentialIdMode" varchar CHECK( "credentialIdMode" IN ('ISSUANCE','PERSISTENCE','NEVER') ) NOT NULL DEFAULT ('ISSUANCE'),
|
|
9047
|
+
"proofFormat" varchar CHECK( "proofFormat" IN ('lds','jwt', 'vc+jwt') ) NOT NULL DEFAULT ('lds'),
|
|
9048
|
+
"indexingDirection" varchar CHECK( "indexingDirection" IN ('rightToLeft') ),
|
|
9049
|
+
"statusPurpose" varchar,
|
|
9050
|
+
"statusListCredential" text,
|
|
9051
|
+
"bitsPerStatus" integer,
|
|
9052
|
+
"expiresAt" datetime,
|
|
9053
|
+
CONSTRAINT "UQ_correlationId" UNIQUE ("correlationId")
|
|
9054
|
+
)
|
|
9055
|
+
`);
|
|
9056
|
+
await queryRunner.query(`
|
|
9057
|
+
INSERT INTO "temporary_StatusList"(
|
|
9058
|
+
"id", "correlationId", "length", "issuer", "type", "driverType",
|
|
9059
|
+
"credentialIdMode", "proofFormat", "indexingDirection", "statusPurpose",
|
|
9060
|
+
"statusListCredential", "bitsPerStatus", "expiresAt"
|
|
9061
|
+
)
|
|
9062
|
+
SELECT
|
|
9063
|
+
"id", "correlationId", "length", "issuer",
|
|
9064
|
+
CASE WHEN "type" = 'BitstringStatusList' THEN 'StatusList2021' ELSE "type" END,
|
|
9065
|
+
"driverType", "credentialIdMode", "proofFormat", "indexingDirection",
|
|
9066
|
+
"statusPurpose", "statusListCredential", "bitsPerStatus", "expiresAt"
|
|
9067
|
+
FROM "StatusList"
|
|
9068
|
+
`);
|
|
9069
|
+
await queryRunner.query(`DROP TABLE "StatusList"`);
|
|
9070
|
+
await queryRunner.query(`ALTER TABLE "temporary_StatusList" RENAME TO "StatusList"`);
|
|
9071
|
+
}
|
|
9072
|
+
};
|
|
9073
|
+
|
|
9074
|
+
// src/migrations/generic/12-CreateBitstringStatusList.ts
|
|
9075
|
+
var debug19 = Debug19("sphereon:ssi-sdk:migrations");
|
|
9076
|
+
var CreateBitstringStatusList1741895823000 = class {
|
|
9077
|
+
static {
|
|
9078
|
+
__name(this, "CreateBitstringStatusList1741895823000");
|
|
9079
|
+
}
|
|
9080
|
+
name = "CreateBitstringStatusList1741895823000";
|
|
9081
|
+
async up(queryRunner) {
|
|
9082
|
+
debug19("migration: creating bitstring status list tables");
|
|
9083
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
9084
|
+
switch (dbType) {
|
|
9085
|
+
case "postgres": {
|
|
9086
|
+
const mig = new CreateBitstringStatusListPG1741895823000();
|
|
9087
|
+
await mig.up(queryRunner);
|
|
9088
|
+
return;
|
|
9089
|
+
}
|
|
9090
|
+
case "sqlite":
|
|
9091
|
+
case "expo":
|
|
9092
|
+
case "react-native": {
|
|
9093
|
+
const mig = new CreateBitstringStatusListSqlite1741895823001();
|
|
9094
|
+
await mig.up(queryRunner);
|
|
9095
|
+
return;
|
|
9096
|
+
}
|
|
9097
|
+
default:
|
|
9098
|
+
return Promise.reject(`Migrations only supported for sqlite and postgres. Was ${dbType}`);
|
|
9099
|
+
}
|
|
9100
|
+
}
|
|
9101
|
+
async down(queryRunner) {
|
|
9102
|
+
debug19("migration: dropping bitstring status list tables");
|
|
9103
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
9104
|
+
switch (dbType) {
|
|
9105
|
+
case "postgres": {
|
|
9106
|
+
const mig = new CreateBitstringStatusListPG1741895823000();
|
|
9107
|
+
await mig.down(queryRunner);
|
|
9108
|
+
return;
|
|
9109
|
+
}
|
|
9110
|
+
case "sqlite":
|
|
9111
|
+
case "expo":
|
|
9112
|
+
case "react-native": {
|
|
9113
|
+
const mig = new CreateBitstringStatusListSqlite1741895823001();
|
|
9114
|
+
await mig.down(queryRunner);
|
|
9115
|
+
return;
|
|
9116
|
+
}
|
|
9117
|
+
default:
|
|
9118
|
+
return Promise.reject(`Migrations only supported for sqlite and postgres. Was ${dbType}`);
|
|
9119
|
+
}
|
|
9120
|
+
}
|
|
9121
|
+
};
|
|
9122
|
+
|
|
8651
9123
|
// src/migrations/generic/index.ts
|
|
8652
9124
|
var DataStoreContactMigrations = [
|
|
8653
9125
|
CreateContacts1659463079429,
|
|
@@ -8660,7 +9132,8 @@ var DataStoreIssuanceBrandingMigrations = [
|
|
|
8660
9132
|
FixCredentialClaimsReferencesUuid1741895822987
|
|
8661
9133
|
];
|
|
8662
9134
|
var DataStoreStatusListMigrations = [
|
|
8663
|
-
CreateStatusList1693866470000
|
|
9135
|
+
CreateStatusList1693866470000,
|
|
9136
|
+
CreateBitstringStatusList1741895823000
|
|
8664
9137
|
];
|
|
8665
9138
|
var DataStoreEventLoggerMigrations = [
|
|
8666
9139
|
CreateAuditEvents1701635835330
|
|
@@ -8865,6 +9338,8 @@ var DataStoreStatusListEntities = [
|
|
|
8865
9338
|
StatusListEntity,
|
|
8866
9339
|
StatusList2021Entity,
|
|
8867
9340
|
OAuthStatusListEntity,
|
|
9341
|
+
BitstringStatusListEntity,
|
|
9342
|
+
BitstringStatusListEntryEntity,
|
|
8868
9343
|
StatusListEntryEntity
|
|
8869
9344
|
];
|
|
8870
9345
|
var DataStoreEventLoggerEntities = [
|
|
@@ -8896,6 +9371,8 @@ export {
|
|
|
8896
9371
|
BaseConfigEntity,
|
|
8897
9372
|
BaseContactEntity,
|
|
8898
9373
|
BaseLocaleBrandingEntity,
|
|
9374
|
+
BitstringStatusListEntity,
|
|
9375
|
+
BitstringStatusListEntryEntity,
|
|
8899
9376
|
ConnectionEntity,
|
|
8900
9377
|
ConnectionType,
|
|
8901
9378
|
ContactMetadataItemEntity,
|