constants.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // Copyright (c) Microsoft Corporation. All rights reserved.
  2. // Licensed under the MIT License. See License.txt in the project root for license information.
  3. export const Constants = {
  4. /**
  5. * The ms-rest version
  6. * @const
  7. * @type {string}
  8. */
  9. msRestVersion: "1.8.13",
  10. /**
  11. * Specifies HTTP.
  12. *
  13. * @const
  14. * @type {string}
  15. */
  16. HTTP: "http:",
  17. /**
  18. * Specifies HTTPS.
  19. *
  20. * @const
  21. * @type {string}
  22. */
  23. HTTPS: "https:",
  24. /**
  25. * Specifies HTTP Proxy.
  26. *
  27. * @const
  28. * @type {string}
  29. */
  30. HTTP_PROXY: "HTTP_PROXY",
  31. /**
  32. * Specifies HTTPS Proxy.
  33. *
  34. * @const
  35. * @type {string}
  36. */
  37. HTTPS_PROXY: "HTTPS_PROXY",
  38. HttpConstants: {
  39. /**
  40. * Http Verbs
  41. *
  42. * @const
  43. * @enum {string}
  44. */
  45. HttpVerbs: {
  46. PUT: "PUT",
  47. GET: "GET",
  48. DELETE: "DELETE",
  49. POST: "POST",
  50. MERGE: "MERGE",
  51. HEAD: "HEAD",
  52. PATCH: "PATCH"
  53. },
  54. StatusCodes: {
  55. TooManyRequests: 429
  56. }
  57. },
  58. /**
  59. * Defines constants for use with HTTP headers.
  60. */
  61. HeaderConstants: {
  62. /**
  63. * The Authorization header.
  64. *
  65. * @const
  66. * @type {string}
  67. */
  68. AUTHORIZATION: "authorization",
  69. AUTHORIZATION_SCHEME: "Bearer",
  70. /**
  71. * The Retry-After response-header field can be used with a 503 (Service
  72. * Unavailable) or 349 (Too Many Requests) responses to indicate how long
  73. * the service is expected to be unavailable to the requesting client.
  74. *
  75. * @const
  76. * @type {string}
  77. */
  78. RETRY_AFTER: "Retry-After",
  79. /**
  80. * The UserAgent header.
  81. *
  82. * @const
  83. * @type {string}
  84. */
  85. USER_AGENT: "User-Agent"
  86. }
  87. };