X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=src%2Fdb%2Fabstract.js;h=953034dba67d06d8063275e04a50bb01aa5a3ec1;hb=fba42a499fe1af051b0982c1f3e8b3873c9ed2fb;hp=2e9f46d0bb248dcad86b39cc5e681c046076c733;hpb=e7436419933940f90769c8be1d63acccdd947b92;p=squeep-indie-auther diff --git a/src/db/abstract.js b/src/db/abstract.js index 2e9f46d..953034d 100644 --- a/src/db/abstract.js +++ b/src/db/abstract.js @@ -47,7 +47,7 @@ class Database { /** * Query the current schema version. * This is a standalone query function, as it is called before statements are loaded. - * @returns {SchemaVersionObject} + * @returns {Promise} */ async _currentSchema() { this._notImplemented('_currentSchema', arguments); @@ -251,6 +251,17 @@ class Database { } + /** + * Insert or update an almanac entry. + * @param {*} dbCtx + * @param {String} event + * @param {Date=} date + */ + async almanacUpsert(dbCtx, event, date) { + this._notImplemented('almanacUpsert', arguments); + } + + /** * Fetch the authentication record for an identifier. * @param {*} dbCtx @@ -279,13 +290,38 @@ class Database { * @param {*} dbCtx * @param {String} identifier * @param {String} credential + * @param {String=} otpKey * @returns {Promise} */ - async authenticationUpsert(dbCtx, identifier, credential) { + async authenticationUpsert(dbCtx, identifier, credential, otpKey) { this._notImplemented('authenticationUpsert', arguments); } + /** + * Update the otpKey for an identifier. + * @param {*} dbCtx + * @param {String} identifier + * @param {String=} otpKey + * @returns {Promise} + */ + async authenticationUpdateOTPKey(dbCtx, identifier, otpKey) { + this._notImplemented('authenticationUpdateOTPKey', arguments); + } + + + /** + * Update the credential for an identifier. + * @param {*} dbCtx + * @param {String} identifier + * @param {String} credential + * @returns {Promise} + */ + async authenticationUpdateCredential(dbCtx, identifier, credential) { + this._notImplemented('authenticationUpdateCredentials', arguments); + } + + /** * Determine if profile url is known to this service. * @param {*} dbCtx @@ -580,6 +616,44 @@ class Database { this._notImplemented('tokensGetByIdentifier', arguments); } + + /** @typedef {Object} RedeemedTicketData + * @property {String} subject + * @property {String} resource + * @property {String=} iss + * @property {String} ticket + * @property {String} token + */ + /** + * Persist details of a redeemed ticket. + * @param {*} dbCtx + * @param {RedeemedTicketData} redeemedData + * @returns {Promise} + */ + async ticketRedeemed(dbCtx, redeemedData) { + this._notImplemented('ticketRedeemed', arguments); + } + + + /** + * Update details of a redeemed ticket that it has been published. + * @param {*} dbCtx + * @param {RedeemedTicketData} redeemedData + * @returns {Promise} + */ + async ticketTokenPublished(dbCtx, redeemedData) { + this._notImplemented('ticketTokenPublished', arguments); + } + + /** + * Retrieve redeemed tokens which have not yet been published to queue. + * @param {Number} limit + * @returns {Promise} + */ + async ticketTokenGetUnpublished(dbCtx, limit) { + this._notImplemented('ticketTokenGetUnpublished', arguments); + } + } -module.exports = Database; \ No newline at end of file +module.exports = Database;