UNPKG

@teamwork/get-bearer-token

Version:

CLI tool to obtain bearer tokens for Teamwork API using OAuth flow

50 lines (45 loc) 1.4 kB
/** * @typedef {Object} TeamworkCredentials * @property {string} clientId * @property {string} clientSecret * @property {string} redirectUri * @property {string} [siteName] * @property {string} [region] * @property {string} [teamworkHost] */ /** * @typedef {Object} TeamworkTokenResponse * @property {string} access_token * @property {Object} installation * @property {string} installation.apiEndPoint * @property {Object} installation.company * @property {number} installation.company.id * @property {string} installation.company.logo * @property {string} installation.company.name * @property {number} installation.id * @property {string} installation.logo * @property {string} installation.name * @property {string} installation.region * @property {string} installation.url * @property {string} status */ /** * @typedef {Object} TeamworkUserInfo * @property {string} sub * @property {string} externalCustomerId * @property {string} email * @property {string} given_name * @property {string} family_name * @property {string} picture * @property {number} user_id * @property {number} installation_id * @property {string} url */ /** * @typedef {Object} AuthResult * @property {string} accessToken * @property {string} apiEndpoint * @property {TeamworkUserInfo} [userInfo] * @property {TeamworkTokenResponse['installation']} installation */ export {};