From 6ad2a90dbacf9f33502dc63e253fb7af10b2bb5d Mon Sep 17 00:00:00 2001 From: Fritz Ray Date: Fri, 22 Nov 2024 16:58:33 -0800 Subject: [PATCH] Release 1.5.70 --- src/com/eduworks/ec/promises/helpers.js | 12 ++++++++++++ src/org/cassproject/ebac/repository/EcRepository.js | 3 ++- src/test/EcRepository.l2.test.js | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/com/eduworks/ec/promises/helpers.js b/src/com/eduworks/ec/promises/helpers.js index 2cb48f4e..9ed78e1b 100644 --- a/src/com/eduworks/ec/promises/helpers.js +++ b/src/com/eduworks/ec/promises/helpers.js @@ -9,6 +9,18 @@ module.exports = { p = p.catch(failure); return p; }, + cassReturnNullAsPromise: function (success, failure, error) { + let p = new Promise((resolve, reject) => { + resolve(null); + }); + if (success !== undefined && success != null && failure !== undefined && failure != null) + p = p.then(success, failure); + else if (success !== undefined && success != null) + p = p.then(success); + else if (failure !== undefined && failure != null) + p = p.catch(failure); + return p; + }, cassReturnAsPromise: function (o, success, failure, error) { let p = new Promise((resolve, reject) => { if (o === undefined || o == null) { diff --git a/src/org/cassproject/ebac/repository/EcRepository.js b/src/org/cassproject/ebac/repository/EcRepository.js index 0fb5ea6e..2dcbbacb 100644 --- a/src/org/cassproject/ebac/repository/EcRepository.js +++ b/src/org/cassproject/ebac/repository/EcRepository.js @@ -8,12 +8,13 @@ const EcIdentityManager = require("../identity/EcIdentityManager"); const EcRekeyRequest = require("../identity/EcRekeyRequest"); const EcArray = require("../../../../com/eduworks/ec/array/EcArray"); const EcRemote = require("../../../../com/eduworks/ec/remote/EcRemote"); -const { cassPromisify, cassReturnAsPromise } = require("../../../../com/eduworks/ec/promises/helpers"); +const { cassPromisify, cassReturnAsPromise, cassReturnNullAsPromise } = require("../../../../com/eduworks/ec/promises/helpers"); const EcRemoteLinkedData = require("../../schema/general/EcRemoteLinkedData"); const EcCrypto = require("../../../../com/eduworks/ec/crypto/EcCrypto"); const EcIdentity = require("../identity/EcIdentity"); const EcPpkFacade = require("../../../../com/eduworks/ec/crypto/EcPpkFacade"); const EcPk = require("../../../../com/eduworks/ec/crypto/EcPk"); +const EcLinkedData = require("../../../json/ld/EcLinkedData.js"); require("../../general/AuditLogger.js") /** diff --git a/src/test/EcRepository.l2.test.js b/src/test/EcRepository.l2.test.js index 93b8f1f7..ca9ba8a0 100644 --- a/src/test/EcRepository.l2.test.js +++ b/src/test/EcRepository.l2.test.js @@ -14,6 +14,7 @@ const EcEncryptedValue = require('../org/cassproject/ebac/repository/EcEncrypted const EcIdentityManager = require('../org/cassproject/ebac/identity/EcIdentityManager.js'); const EcIdentity = require('../org/cassproject/ebac/identity/EcIdentity.js'); const EcPpk = require('../com/eduworks/ec/crypto/EcPpk.js'); +const EcLinkedData = require('../org/json/ld/EcLinkedData.js'); let hrtime = function () { try {