Socket
Socket
Sign inDemoInstall

@unumid/server-sdk

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unumid/server-sdk - npm Package Compare versions

Comparing version 3.1.2 to 3.2.0

2

build/verifier/sendRequest.d.ts

@@ -39,3 +39,3 @@ import { PresentationRequestPostDto as PresentationRequestPostDtoDeprecatedV2, UnsignedPresentationRequest as UnsignedPresentationRequestDeprecatedV2, SignedPresentationRequest as SignedPresentationRequestDeprecatedV2 } from '@unumid/types-v2';

*/
export declare const sendRequestV3: (authorization: string, verifier: string, credentialRequests: CredentialRequestPb[], eccPrivateKey: string, holderAppUuid: string, id: string, expirationDate?: Date | undefined, metadata?: Record<string, unknown> | undefined) => Promise<UnumDto<PresentationRequestPostDto>>;
export declare const sendRequestV3: (authorization: string, verifier: string, credentialRequests: CredentialRequestPb[], eccPrivateKey: string, holderAppUuid: string, id: string, expirationDate?: Date | undefined, metadata?: any) => Promise<UnumDto<PresentationRequestPostDto>>;
/**

@@ -42,0 +42,0 @@ * Handler for sending a PresentationRequest to UnumID's SaaS.

@@ -85,3 +85,5 @@ "use strict";

holderAppUuid: holderAppUuid,
metadata: metadata || { fields: {} },
metadata: metadata ? JSON.stringify(metadata) : '{}',
// metadata: metadata ? JSON.stringify(metadata) : {} as JSONObj,
// metadata: JSON.stringify(metadata),
uuid: uuid,

@@ -191,14 +193,13 @@ id: id,

}
// Ensure that metadata object is keyed on fields for Struct protobuf definition
if (!metadata) {
sendRequestBody.metadata = {
fields: {}
};
}
else if (metadata && !metadata.fields) {
logger_1.default.debug('Adding the root \'fields\' key to the presentation request metadata.');
sendRequestBody.metadata = {
fields: sendRequestBody.metadata
};
}
// // Ensure that metadata object is keyed on fields for Struct protobuf definition
// if (!metadata) {
// sendRequestBody.metadata = {
// fields: {}
// };
// } else if (metadata && !metadata.fields) {
// logger.debug('Adding the root \'fields\' key to the presentation request metadata.');
// sendRequestBody.metadata = {
// fields: sendRequestBody.metadata
// };
// }
if (!id) {

@@ -263,8 +264,8 @@ throw new error_1.CustError(400, 'Invalid PresentationRequest options: id is required.');

}
// Ensure that metadata object is keyed on fields for Struct protobuf definition
if (!metadata) {
sendRequestBody.metadata = {
fields: {}
};
}
// // Ensure that metadata object is keyed on fields for Struct protobuf definition
// if (!metadata) {
// sendRequestBody.metadata = {
// fields: {}
// };
// }
if (!id) {

@@ -271,0 +272,0 @@ throw new error_1.CustError(400, 'Invalid PresentationRequest options: id is required.');

{
"name": "@unumid/server-sdk",
"version": "3.1.2",
"version": "3.2.0",
"main": "build/index.js",

@@ -47,5 +47,5 @@ "repository": "git@github.com:UnumID/Server-SDK-TypeScript.git",

"@unumid/library-crypto": "https://github.com/UnumID/Library-Crypto-TypeScript.git#1.5.0",
"@unumid/types": "https://github.com/UnumID/types.git#3.4.0",
"@unumid/types": "https://github.com/UnumID/types.git#3.5.0",
"@unumid/types-v2": "npm:@unumid/types@2.1.3",
"@unumid/types-v1": "https://github.com/UnumID/types.git#1.5.1",
"@unumid/types-v2": "npm:@unumid/types@2.1.3",
"dotenv": "^8.2.0",

@@ -52,0 +52,0 @@ "express": "^4.17.1",

@@ -5,3 +5,3 @@ import { configData } from '../config';

import { PresentationRequestPostDto as PresentationRequestPostDtoDeprecatedV2, UnsignedPresentationRequest as UnsignedPresentationRequestDeprecatedV2, SignedPresentationRequest as SignedPresentationRequestDeprecatedV2, Proof } from '@unumid/types-v2';
import { CredentialRequest, PresentationRequestPostDto, UnsignedPresentationRequestPb, PresentationRequestPb, ProofPb, SignedPresentationRequest, CredentialRequestPb } from '@unumid/types';
import { CredentialRequest, PresentationRequestPostDto, UnsignedPresentationRequestPb, PresentationRequestPb, ProofPb, SignedPresentationRequest, CredentialRequestPb, JSONObj } from '@unumid/types';

@@ -49,3 +49,5 @@ import { RESTData, SendRequestReqBody, UnumDto } from '../types';

holderAppUuid,
metadata: metadata || { fields: {} }, // fields is necessary for the protobuf Struct definition
metadata: metadata ? JSON.stringify(metadata) : '{}',
// metadata: metadata ? JSON.stringify(metadata) : {} as JSONObj,
// metadata: JSON.stringify(metadata),
uuid,

@@ -198,13 +200,13 @@ id,

// Ensure that metadata object is keyed on fields for Struct protobuf definition
if (!metadata) {
sendRequestBody.metadata = {
fields: {}
};
} else if (metadata && !metadata.fields) {
logger.debug('Adding the root \'fields\' key to the presentation request metadata.');
sendRequestBody.metadata = {
fields: sendRequestBody.metadata
};
}
// // Ensure that metadata object is keyed on fields for Struct protobuf definition
// if (!metadata) {
// sendRequestBody.metadata = {
// fields: {}
// };
// } else if (metadata && !metadata.fields) {
// logger.debug('Adding the root \'fields\' key to the presentation request metadata.');
// sendRequestBody.metadata = {
// fields: sendRequestBody.metadata
// };
// }

@@ -293,8 +295,8 @@ if (!id) {

// Ensure that metadata object is keyed on fields for Struct protobuf definition
if (!metadata) {
sendRequestBody.metadata = {
fields: {}
};
}
// // Ensure that metadata object is keyed on fields for Struct protobuf definition
// if (!metadata) {
// sendRequestBody.metadata = {
// fields: {}
// };
// }

@@ -353,3 +355,3 @@ if (!id) {

expirationDate?: Date,
metadata?: Record<string, unknown>
metadata?: any
): Promise<UnumDto<PresentationRequestPostDto>> => {

@@ -356,0 +358,0 @@ try {

@@ -242,3 +242,3 @@ import {

const id = options.id || getUUID();
const metadata = options.metadata || { fields: {} };
const metadata = options.metadata || '{ fields: {} }';

@@ -245,0 +245,0 @@ return {

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

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc