UNPKG

@kkbox/kkbox-js-sdk

Version:

KKBOX Open API developer SDK for JavaScript. Use it to easily access KKBOX open API to get various metadata about KKBOX's tracks, albums, artists, playlists and stations.

41 lines (32 loc) 1.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _ClientCredentialsFlow = _interopRequireDefault(require("./ClientCredentialsFlow")); var _TokenFetcher = _interopRequireDefault(require("./TokenFetcher")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * Implements various KKBOX OAuth 2.0 authorization flows. */ var Auth = /** * Initialize the Auth object with client id and client secret. * * @param {string} clientID * @param {string} clientSecret * @example new Auth(clientID, clientSecret); */ function Auth(clientID, clientSecret) { _classCallCheck(this, Auth); /** * @type {TokenFetcher} */ this.tokenFetcher = new _TokenFetcher["default"](clientID, clientSecret); /** * @type {ClientCredentialsFlow} */ this.clientCredentialsFlow = new _ClientCredentialsFlow["default"](this.tokenFetcher); }; exports["default"] = Auth;