@aries-framework/anoncreds
Advanced tools
Comparing version 0.4.1-alpha.16 to 0.4.1-alpha.17
@@ -29,6 +29,6 @@ import type { AnonCredsCreateLinkSecretOptions, AnonCredsRegisterCredentialDefinitionOptions } from './AnonCredsApiOptions'; | ||
* Create a Link Secret, optionally indicating its ID and if it will be the default one | ||
* If there is no default Link Secret, this will be set as default (even if setAsDefault is true). | ||
* If there is no default Link Secret, this will be set as default (even if setAsDefault is false). | ||
* | ||
*/ | ||
createLinkSecret(options?: AnonCredsCreateLinkSecretOptions): Promise<void>; | ||
createLinkSecret(options?: AnonCredsCreateLinkSecretOptions): Promise<string>; | ||
/** | ||
@@ -35,0 +35,0 @@ * Get a list of ids for the created link secrets |
@@ -27,2 +27,3 @@ "use strict"; | ||
const AnonCredsRegistryService_1 = require("./services/registry/AnonCredsRegistryService"); | ||
const utils_1 = require("./utils"); | ||
let AnonCredsApi = class AnonCredsApi { | ||
@@ -43,3 +44,3 @@ constructor(agentContext, anonCredsRegistryService, config, anonCredsIssuerService, anonCredsHolderService, anonCredsSchemaRepository, anonCredsCredentialDefinitionRepository, anonCredsCredentialDefinitionPrivateRepository, anonCredsKeyCorrectnessProofRepository, anonCredsLinkSecretRepository) { | ||
* Create a Link Secret, optionally indicating its ID and if it will be the default one | ||
* If there is no default Link Secret, this will be set as default (even if setAsDefault is true). | ||
* If there is no default Link Secret, this will be set as default (even if setAsDefault is false). | ||
* | ||
@@ -51,15 +52,8 @@ */ | ||
}); | ||
// In some cases we don't have the linkSecretValue. However we still want a record so we know which link secret ids are valid | ||
const linkSecretRecord = new repository_1.AnonCredsLinkSecretRecord({ linkSecretId, value: linkSecretValue }); | ||
// If it is the first link secret registered, set as default | ||
const defaultLinkSecretRecord = await this.anonCredsLinkSecretRepository.findDefault(this.agentContext); | ||
if (!defaultLinkSecretRecord || (options === null || options === void 0 ? void 0 : options.setAsDefault)) { | ||
linkSecretRecord.setTag('isDefault', true); | ||
} | ||
// Set the current default link secret as not default | ||
if (defaultLinkSecretRecord && (options === null || options === void 0 ? void 0 : options.setAsDefault)) { | ||
defaultLinkSecretRecord.setTag('isDefault', false); | ||
await this.anonCredsLinkSecretRepository.update(this.agentContext, defaultLinkSecretRecord); | ||
} | ||
await this.anonCredsLinkSecretRepository.save(this.agentContext, linkSecretRecord); | ||
await (0, utils_1.storeLinkSecret)(this.agentContext, { | ||
linkSecretId, | ||
linkSecretValue, | ||
setAsDefault: options === null || options === void 0 ? void 0 : options.setAsDefault, | ||
}); | ||
return linkSecretId; | ||
} | ||
@@ -66,0 +60,0 @@ /** |
@@ -15,1 +15,2 @@ import 'reflect-metadata'; | ||
export { assertBestPracticeRevocationInterval } from './utils/revocationInterval'; | ||
export { storeLinkSecret } from './utils/linkSecret'; |
@@ -17,3 +17,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.assertBestPracticeRevocationInterval = exports.generateLegacyProverDidLikeString = exports.AnonCredsApi = exports.AnonCredsModuleConfig = exports.AnonCredsModule = void 0; | ||
exports.storeLinkSecret = exports.assertBestPracticeRevocationInterval = exports.generateLegacyProverDidLikeString = exports.AnonCredsApi = exports.AnonCredsModuleConfig = exports.AnonCredsModule = void 0; | ||
require("reflect-metadata"); | ||
@@ -38,2 +38,4 @@ __exportStar(require("./models"), exports); | ||
Object.defineProperty(exports, "assertBestPracticeRevocationInterval", { enumerable: true, get: function () { return revocationInterval_1.assertBestPracticeRevocationInterval; } }); | ||
var linkSecret_1 = require("./utils/linkSecret"); | ||
Object.defineProperty(exports, "storeLinkSecret", { enumerable: true, get: function () { return linkSecret_1.storeLinkSecret; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -12,2 +12,3 @@ export { createRequestFromPreview } from './createRequestFromPreview'; | ||
export { areCredentialPreviewAttributesEqual } from './credentialPreviewAttributes'; | ||
export { storeLinkSecret } from './linkSecret'; | ||
export { unqualifiedCredentialDefinitionIdRegex, unqualifiedIndyDidRegex, unqualifiedSchemaIdRegex, unqualifiedSchemaVersionRegex, } from './indyIdentifiers'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.unqualifiedSchemaVersionRegex = exports.unqualifiedSchemaIdRegex = exports.unqualifiedIndyDidRegex = exports.unqualifiedCredentialDefinitionIdRegex = exports.areCredentialPreviewAttributesEqual = exports.composeProofAutoAccept = exports.composeCredentialAutoAccept = exports.IsMap = exports.checkValidCredentialValueEncoding = exports.encodeCredentialValue = exports.getRevocationRegistriesForProof = exports.getRevocationRegistriesForRequest = exports.assertBestPracticeRevocationInterval = exports.downloadTailsFile = exports.areAnonCredsProofRequestsEqual = exports.assertNoDuplicateGroupsNamesInProofRequest = exports.sortRequestedCredentialsMatches = exports.createRequestFromPreview = void 0; | ||
exports.unqualifiedSchemaVersionRegex = exports.unqualifiedSchemaIdRegex = exports.unqualifiedIndyDidRegex = exports.unqualifiedCredentialDefinitionIdRegex = exports.storeLinkSecret = exports.areCredentialPreviewAttributesEqual = exports.composeProofAutoAccept = exports.composeCredentialAutoAccept = exports.IsMap = exports.checkValidCredentialValueEncoding = exports.encodeCredentialValue = exports.getRevocationRegistriesForProof = exports.getRevocationRegistriesForRequest = exports.assertBestPracticeRevocationInterval = exports.downloadTailsFile = exports.areAnonCredsProofRequestsEqual = exports.assertNoDuplicateGroupsNamesInProofRequest = exports.sortRequestedCredentialsMatches = exports.createRequestFromPreview = void 0; | ||
var createRequestFromPreview_1 = require("./createRequestFromPreview"); | ||
@@ -29,2 +29,4 @@ Object.defineProperty(exports, "createRequestFromPreview", { enumerable: true, get: function () { return createRequestFromPreview_1.createRequestFromPreview; } }); | ||
Object.defineProperty(exports, "areCredentialPreviewAttributesEqual", { enumerable: true, get: function () { return credentialPreviewAttributes_1.areCredentialPreviewAttributesEqual; } }); | ||
var linkSecret_1 = require("./linkSecret"); | ||
Object.defineProperty(exports, "storeLinkSecret", { enumerable: true, get: function () { return linkSecret_1.storeLinkSecret; } }); | ||
var indyIdentifiers_1 = require("./indyIdentifiers"); | ||
@@ -31,0 +33,0 @@ Object.defineProperty(exports, "unqualifiedCredentialDefinitionIdRegex", { enumerable: true, get: function () { return indyIdentifiers_1.unqualifiedCredentialDefinitionIdRegex; } }); |
@@ -5,3 +5,3 @@ { | ||
"types": "build/index", | ||
"version": "0.4.1-alpha.16+f26d5fd2", | ||
"version": "0.4.1-alpha.17+c6f03e49", | ||
"files": [ | ||
@@ -28,3 +28,3 @@ "build" | ||
"dependencies": { | ||
"@aries-framework/core": "0.4.1-alpha.16+f26d5fd2", | ||
"@aries-framework/core": "0.4.1-alpha.17+c6f03e49", | ||
"bn.js": "^5.2.1", | ||
@@ -36,3 +36,3 @@ "class-transformer": "0.5.1", | ||
"devDependencies": { | ||
"@aries-framework/node": "0.4.1-alpha.16+f26d5fd2", | ||
"@aries-framework/node": "0.4.1-alpha.17+c6f03e49", | ||
"indy-sdk": "^1.16.0-dev-1636", | ||
@@ -43,3 +43,3 @@ "rimraf": "^4.4.0", | ||
}, | ||
"gitHead": "f26d5fd2a7813e15354a442daa6bf6f8b4d56b99" | ||
"gitHead": "c6f03e49d79a33b1c4b459cef11add93dee051d0" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
786332
354
10232