You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

constants.js 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // @flow
  2. /**
  3. * Google API URL to retreive streams for a live broadcast of a user.
  4. *
  5. * NOTE: The URL must be appended by a broadcast ID returned by a call towards
  6. * {@code API_URL_LIVE_BROADCASTS}.
  7. *
  8. * @type {string}
  9. */
  10. // eslint-disable-next-line max-len
  11. export const API_URL_BROADCAST_STREAMS = 'https://content.googleapis.com/youtube/v3/liveStreams?part=id%2Csnippet%2Ccdn%2Cstatus&id=';
  12. /**
  13. * Google API URL to retreive live broadcasts of a user.
  14. *
  15. * @type {string}
  16. */
  17. // eslint-disable-next-line max-len
  18. export const API_URL_LIVE_BROADCASTS = 'https://content.googleapis.com/youtube/v3/liveBroadcasts?broadcastType=all&mine=true&part=id%2Csnippet%2CcontentDetails%2Cstatus';
  19. /**
  20. * Array of API discovery doc URLs for APIs used by the googleApi.
  21. *
  22. * @type {string[]}
  23. */
  24. export const DISCOVERY_DOCS
  25. = [ 'https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest' ];
  26. /**
  27. * An enumeration of the different states the Google API can be in.
  28. *
  29. * @private
  30. * @type {Object}
  31. */
  32. export const GOOGLE_API_STATES = {
  33. /**
  34. * The state in which the Google API still needs to be loaded.
  35. */
  36. NEEDS_LOADING: 0,
  37. /**
  38. * The state in which the Google API is loaded and ready for use.
  39. */
  40. LOADED: 1,
  41. /**
  42. * The state in which a user has been logged in through the Google API.
  43. */
  44. SIGNED_IN: 2,
  45. /**
  46. * The state in which the Google authentication is not available (e.g. Play
  47. * services are not installed on Android).
  48. */
  49. NOT_AVAILABLE: 3
  50. };
  51. /**
  52. * Google API auth scope to access Google calendar.
  53. *
  54. * @type {string}
  55. */
  56. export const GOOGLE_SCOPE_CALENDAR = 'https://www.googleapis.com/auth/calendar';
  57. /**
  58. * Google API auth scope to access YouTube streams.
  59. *
  60. * @type {string}
  61. */
  62. export const GOOGLE_SCOPE_YOUTUBE
  63. = 'https://www.googleapis.com/auth/youtube.readonly';