TransactionAPI.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. "use strict";
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. /**
  4. * Licensed Materials - Property of IBM
  5. * IBM Business Analytics (C) Copyright IBM Corp. 2019, 2020
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. /**
  9. * @interface TransactionAPI
  10. * @hideconstructor
  11. * @classdesc API class that is used to control transactional behaviour during API usage.
  12. * @example dashboard.getFeature('Transaction')
  13. */
  14. define([], function () {
  15. var TransactionAPI = function () {
  16. function TransactionAPI() {
  17. _classCallCheck(this, TransactionAPI);
  18. }
  19. /**
  20. * @public
  21. * @function TransactionAPI#startTransaction
  22. * @description Starts a new API transaction.
  23. * @param {SetOption} [transactionToken] Parent transaction token
  24. * @returns {SetOptions} transactionToken
  25. */
  26. TransactionAPI.prototype.startTransaction = function startTransaction() {};
  27. /**
  28. * @public
  29. * @deprecated
  30. * @function TransactionAPI#startTransactionById
  31. * @description Starts a new API transaction with the given transactionId.
  32. * Use {@link TransactionAPI#startTransaction} unless a transactionId needs to be reused from a legacy transaction.
  33. * @param {String} transactionId Unique transaction identifier
  34. * @returns {SetOptions} transactionToken
  35. */
  36. TransactionAPI.prototype.startTransactionById = function startTransactionById() {};
  37. /**
  38. * @public
  39. * @function TransactionAPI#endTransaction
  40. * @description Ends an existing API transaction.
  41. * @param {SetOptions} transactionToken
  42. */
  43. TransactionAPI.prototype.endTransaction = function endTransaction() {};
  44. /**
  45. * @public
  46. * @function TransactionAPI#getTransactionById
  47. * @description Returns the transaction token from the specified unique transaction identifier.
  48. * @returns {SetOptions} transactionToken
  49. */
  50. TransactionAPI.prototype.getTransactionById = function getTransactionById() {};
  51. /**
  52. * @public
  53. * @function TransactionAPI#isValidTransaction
  54. * @description Determines whether the token is a valid transaction.
  55. * @param {SetOptions} transactionToken Transaction token
  56. */
  57. TransactionAPI.prototype.isValidTransaction = function isValidTransaction() {};
  58. /**
  59. * @public
  60. * @function TransactionAPI#registerTransactionHandler
  61. * @description Registers an transaction handler for the existing API transaction.
  62. * @param {SetOptions} transactionToken Transaction token
  63. * @param {string} handlerId Unique handler identifier
  64. * @param {TransactionHandler} handler Handler to be executed when the transaction is complete
  65. * @param {Object} args Arguments to be passed to the TransactionHandler
  66. * @returns {Promise} Returns a promise that is resolved once the handler is executed.
  67. */
  68. TransactionAPI.prototype.registerTransactionHandler = function registerTransactionHandler() {};
  69. /**
  70. * @public
  71. * @function TransactionAPI#getCurrentTransactionList
  72. * @description Returns the list of currently active transaction tokens.
  73. * @returns {SetOptions[]} Array of all active transaction tokens
  74. */
  75. TransactionAPI.prototype.getActiveTransactionList = function getActiveTransactionList() {};
  76. return TransactionAPI;
  77. }();
  78. return TransactionAPI;
  79. });
  80. //# sourceMappingURL=TransactionAPI.js.map