@microsoft/useragent-sdk
Version:
SDK for building decentralized identity wallets and enterprise agents.
33 lines (27 loc) • 965 B
text/typescript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/**
* The base class for all requests to an Identity Hub.
*/
export default class HubRequest {
private requestType: string;
private requestBody: any;
constructor(requestType: string, requestBody?: any) {
this.requestType = requestType;
this.requestBody = requestBody;
}
/**
* Returns the raw request JSON which will be sent to the Hub.
*/
public async getRequestJson() {
return Object.assign(
{
'@context': 'https://schema.identity.foundation/0.1',
'@type': this.requestType,
},
this.requestBody,
);
}
}