@sphereon/ssi-sdk.data-store 0.34.1-feature.SSISDK.50.98 → 0.34.1-feature.SSISDK.50.type.refactor.142
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 +34 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -5
- package/dist/index.d.ts +12 -5
- package/dist/index.js +34 -32
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/__tests__/pd-manager.entities.test.ts +1 -2
- package/src/__tests__/pd-manager.store.test.ts +20 -21
- package/src/presentationDefinition/PDStore.ts +2 -2
- package/src/types/presentationDefinition/presentationDefinition.ts +10 -3
- package/src/utils/presentationDefinition/MappingUtils.ts +14 -13
package/dist/index.cjs
CHANGED
|
@@ -173,55 +173,55 @@ var import_typeorm12 = __toESM(require("typeorm"), 1);
|
|
|
173
173
|
var import_typeorm11 = __toESM(require("typeorm"), 1);
|
|
174
174
|
|
|
175
175
|
// src/types/contact/contact.ts
|
|
176
|
-
var ConnectionType = /* @__PURE__ */ function(ConnectionType2) {
|
|
176
|
+
var ConnectionType = /* @__PURE__ */ (function(ConnectionType2) {
|
|
177
177
|
ConnectionType2["OPENID_CONNECT"] = "OIDC";
|
|
178
178
|
ConnectionType2["SIOPv2"] = "SIOPv2";
|
|
179
179
|
ConnectionType2["SIOPv2_OpenID4VP"] = "SIOPv2+OpenID4VP";
|
|
180
180
|
return ConnectionType2;
|
|
181
|
-
}({});
|
|
182
|
-
var CorrelationIdentifierType = /* @__PURE__ */ function(CorrelationIdentifierType2) {
|
|
181
|
+
})({});
|
|
182
|
+
var CorrelationIdentifierType = /* @__PURE__ */ (function(CorrelationIdentifierType2) {
|
|
183
183
|
CorrelationIdentifierType2["DID"] = "did";
|
|
184
184
|
CorrelationIdentifierType2["URL"] = "url";
|
|
185
185
|
return CorrelationIdentifierType2;
|
|
186
|
-
}({});
|
|
187
|
-
var PartyTypeType = /* @__PURE__ */ function(PartyTypeType2) {
|
|
186
|
+
})({});
|
|
187
|
+
var PartyTypeType = /* @__PURE__ */ (function(PartyTypeType2) {
|
|
188
188
|
PartyTypeType2["NATURAL_PERSON"] = "naturalPerson";
|
|
189
189
|
PartyTypeType2["ORGANIZATION"] = "organization";
|
|
190
190
|
return PartyTypeType2;
|
|
191
|
-
}({});
|
|
192
|
-
var PartyOrigin = /* @__PURE__ */ function(PartyOrigin2) {
|
|
191
|
+
})({});
|
|
192
|
+
var PartyOrigin = /* @__PURE__ */ (function(PartyOrigin2) {
|
|
193
193
|
PartyOrigin2["INTERNAL"] = "INTERNAL";
|
|
194
194
|
PartyOrigin2["EXTERNAL"] = "EXTERNAL";
|
|
195
195
|
return PartyOrigin2;
|
|
196
|
-
}({});
|
|
197
|
-
var IdentityOrigin = /* @__PURE__ */ function(IdentityOrigin2) {
|
|
196
|
+
})({});
|
|
197
|
+
var IdentityOrigin = /* @__PURE__ */ (function(IdentityOrigin2) {
|
|
198
198
|
IdentityOrigin2["INTERNAL"] = "INTERNAL";
|
|
199
199
|
IdentityOrigin2["EXTERNAL"] = "EXTERNAL";
|
|
200
200
|
return IdentityOrigin2;
|
|
201
|
-
}({});
|
|
201
|
+
})({});
|
|
202
202
|
|
|
203
203
|
// src/types/digitalCredential/enums.ts
|
|
204
|
-
var DocumentType = /* @__PURE__ */ function(DocumentType2) {
|
|
204
|
+
var DocumentType = /* @__PURE__ */ (function(DocumentType2) {
|
|
205
205
|
DocumentType2["VC"] = "VC";
|
|
206
206
|
DocumentType2["VP"] = "VP";
|
|
207
207
|
DocumentType2["P"] = "P";
|
|
208
208
|
DocumentType2["C"] = "C";
|
|
209
209
|
return DocumentType2;
|
|
210
|
-
}({});
|
|
211
|
-
var RegulationType = /* @__PURE__ */ function(RegulationType2) {
|
|
210
|
+
})({});
|
|
211
|
+
var RegulationType = /* @__PURE__ */ (function(RegulationType2) {
|
|
212
212
|
RegulationType2["PID"] = "PID";
|
|
213
213
|
RegulationType2["QEAA"] = "QEAA";
|
|
214
214
|
RegulationType2["EAA"] = "EAA";
|
|
215
215
|
RegulationType2["NON_REGULATED"] = "NON_REGULATED";
|
|
216
216
|
return RegulationType2;
|
|
217
|
-
}({});
|
|
218
|
-
var CredentialDocumentFormat = /* @__PURE__ */ function(CredentialDocumentFormat2) {
|
|
217
|
+
})({});
|
|
218
|
+
var CredentialDocumentFormat = /* @__PURE__ */ (function(CredentialDocumentFormat2) {
|
|
219
219
|
CredentialDocumentFormat2["JSON_LD"] = "JSON_LD";
|
|
220
220
|
CredentialDocumentFormat2["JWT"] = "JWT";
|
|
221
221
|
CredentialDocumentFormat2["SD_JWT"] = "SD_JWT";
|
|
222
222
|
CredentialDocumentFormat2["MSO_MDOC"] = "MSO_MDOC";
|
|
223
223
|
return CredentialDocumentFormat2;
|
|
224
|
-
}({});
|
|
224
|
+
})({});
|
|
225
225
|
(function(CredentialDocumentFormat2) {
|
|
226
226
|
function fromSpecValue(credentialFormat) {
|
|
227
227
|
const format = credentialFormat.toLowerCase();
|
|
@@ -254,19 +254,19 @@ var CredentialDocumentFormat = /* @__PURE__ */ function(CredentialDocumentFormat
|
|
|
254
254
|
__name(toSpecValue, "toSpecValue");
|
|
255
255
|
CredentialDocumentFormat2.toSpecValue = toSpecValue;
|
|
256
256
|
})(CredentialDocumentFormat || (CredentialDocumentFormat = {}));
|
|
257
|
-
var CredentialCorrelationType = /* @__PURE__ */ function(CredentialCorrelationType2) {
|
|
257
|
+
var CredentialCorrelationType = /* @__PURE__ */ (function(CredentialCorrelationType2) {
|
|
258
258
|
CredentialCorrelationType2["DID"] = "DID";
|
|
259
259
|
CredentialCorrelationType2["X509_SAN"] = "X509_SAN";
|
|
260
260
|
CredentialCorrelationType2["KID"] = "KID";
|
|
261
261
|
CredentialCorrelationType2["URL"] = "URL";
|
|
262
262
|
return CredentialCorrelationType2;
|
|
263
|
-
}({});
|
|
264
|
-
var CredentialStateType = /* @__PURE__ */ function(CredentialStateType2) {
|
|
263
|
+
})({});
|
|
264
|
+
var CredentialStateType = /* @__PURE__ */ (function(CredentialStateType2) {
|
|
265
265
|
CredentialStateType2["REVOKED"] = "REVOKED";
|
|
266
266
|
CredentialStateType2["VERIFIED"] = "VERIFIED";
|
|
267
267
|
CredentialStateType2["EXPIRED"] = "EXPIRED";
|
|
268
268
|
return CredentialStateType2;
|
|
269
|
-
}({});
|
|
269
|
+
})({});
|
|
270
270
|
|
|
271
271
|
// src/entities/contact/IdentityEntity.ts
|
|
272
272
|
var import_typeorm10 = require("typeorm");
|
|
@@ -6937,8 +6937,8 @@ var import_typeorm39 = require("typeorm");
|
|
|
6937
6937
|
var import_debug7 = __toESM(require("debug"), 1);
|
|
6938
6938
|
|
|
6939
6939
|
// src/utils/presentationDefinition/MappingUtils.ts
|
|
6940
|
-
var import_dcql = require("dcql");
|
|
6941
6940
|
var blakepkg = __toESM(require("blakejs"), 1);
|
|
6941
|
+
var import_dcql = require("dcql");
|
|
6942
6942
|
var presentationDefinitionItemFrom = /* @__PURE__ */ __name((entity) => {
|
|
6943
6943
|
const result = {
|
|
6944
6944
|
id: entity.id,
|
|
@@ -6949,14 +6949,14 @@ var presentationDefinitionItemFrom = /* @__PURE__ */ __name((entity) => {
|
|
|
6949
6949
|
purpose: entity.purpose,
|
|
6950
6950
|
definitionPayload: JSON.parse(entity.definitionPayload),
|
|
6951
6951
|
...entity.dcqlPayload && {
|
|
6952
|
-
|
|
6953
|
-
queryId: entity.definitionId,
|
|
6954
|
-
dcqlQuery: import_dcql.DcqlQuery.parse(JSON.parse(entity.dcqlPayload))
|
|
6955
|
-
}
|
|
6952
|
+
dcqlQuery: import_dcql.DcqlQuery.parse(JSON.parse(entity.dcqlPayload))
|
|
6956
6953
|
},
|
|
6957
6954
|
createdAt: entity.createdAt,
|
|
6958
6955
|
lastUpdatedAt: entity.lastUpdatedAt
|
|
6959
6956
|
};
|
|
6957
|
+
if (result.dcqlQuery) {
|
|
6958
|
+
import_dcql.DcqlQuery.validate(result.dcqlQuery);
|
|
6959
|
+
}
|
|
6960
6960
|
return replaceNullWithUndefined(result);
|
|
6961
6961
|
}, "presentationDefinitionItemFrom");
|
|
6962
6962
|
var presentationDefinitionEntityItemFrom = /* @__PURE__ */ __name((item) => {
|
|
@@ -6969,8 +6969,10 @@ var presentationDefinitionEntityItemFrom = /* @__PURE__ */ __name((item) => {
|
|
|
6969
6969
|
if (item.definitionPayload) {
|
|
6970
6970
|
entity.definitionPayload = JSON.stringify(item.definitionPayload);
|
|
6971
6971
|
}
|
|
6972
|
-
if (item.
|
|
6973
|
-
|
|
6972
|
+
if (item.dcqlQuery) {
|
|
6973
|
+
const dcqlQuery = import_dcql.DcqlQuery.parse(item.dcqlQuery);
|
|
6974
|
+
import_dcql.DcqlQuery.validate(dcqlQuery);
|
|
6975
|
+
entity.dcqlPayload = JSON.stringify(item.dcqlQuery);
|
|
6974
6976
|
}
|
|
6975
6977
|
return entity;
|
|
6976
6978
|
}, "presentationDefinitionEntityItemFrom");
|
|
@@ -6982,11 +6984,11 @@ function isPresentationDefinitionEqual(base, compare) {
|
|
|
6982
6984
|
if (base.definitionId !== compare.definitionId || base.tenantId !== compare.tenantId || base.version !== compare.version || base.name !== compare.name || base.purpose !== compare.purpose) {
|
|
6983
6985
|
return false;
|
|
6984
6986
|
}
|
|
6985
|
-
if (base.
|
|
6986
|
-
if (hashPayload(base.
|
|
6987
|
+
if (base.dcqlQuery && compare.dcqlQuery) {
|
|
6988
|
+
if (hashPayload(base.dcqlQuery) !== hashPayload(compare.dcqlQuery)) {
|
|
6987
6989
|
return false;
|
|
6988
6990
|
}
|
|
6989
|
-
} else if (base.
|
|
6991
|
+
} else if (base.dcqlQuery || compare.dcqlQuery) {
|
|
6990
6992
|
return false;
|
|
6991
6993
|
}
|
|
6992
6994
|
if (base.definitionPayload && compare.definitionPayload) {
|
|
@@ -7088,8 +7090,8 @@ var PDStore = class extends AbstractPDStore {
|
|
|
7088
7090
|
if (item.definitionPayload) {
|
|
7089
7091
|
updatedEntity.definitionPayload = JSON.stringify(item.definitionPayload);
|
|
7090
7092
|
}
|
|
7091
|
-
if (item.
|
|
7092
|
-
updatedEntity.dcqlPayload = JSON.stringify(item.
|
|
7093
|
+
if (item.dcqlQuery) {
|
|
7094
|
+
updatedEntity.dcqlPayload = JSON.stringify(item.dcqlQuery);
|
|
7093
7095
|
}
|
|
7094
7096
|
debug7("Updating presentation definition entity", updatedEntity);
|
|
7095
7097
|
const updateResult = await pdRepository.save(updatedEntity, {
|