@microsoft/useragent-sdk
Version:
SDK for building decentralized identity wallets and enterprise agents.
40 lines • 1.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const ProtectedCommit_1 = require("../ProtectedCommit");
/**
* Represents the response to a `HubCommitQueryRequest`.
*/
class HubCommitQueryResponse {
constructor(response) {
this.response = response;
if (response['@type'] !== 'CommitQueryResponse') {
throw new Error('Unexpected response type; expected CommitQueryResponse');
}
}
/**
* Returns the set of commits returned by the Hub.
*/
getCommits() {
return this.response.commits.map((commit) => {
return new ProtectedCommit_1.default(commit);
});
}
/**
* Indicates whether additional pages of results are available.
*/
hasSkipToken() {
return !!this.response.skip_token;
}
/**
* Retrieves a token which can be used to fetch subsequent result pages.
*/
getSkipToken() {
return this.response.skip_token;
}
}
exports.default = HubCommitQueryResponse;
//# sourceMappingURL=HubCommitQueryResponse.js.map