@azure/msal-node 1.0.0-beta.5 → 1.0.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.json +33 -0
  2. package/changelog.md +12 -1
  3. package/dist/cache/ITokenCache.d.ts +9 -0
  4. package/dist/cache/ITokenCache.d.ts.map +1 -0
  5. package/dist/cache/{Storage.d.ts → NodeStorage.d.ts} +42 -33
  6. package/dist/cache/NodeStorage.d.ts.map +1 -0
  7. package/dist/cache/TokenCache.d.ts +26 -12
  8. package/dist/cache/TokenCache.d.ts.map +1 -0
  9. package/dist/cache/serializer/Deserializer.d.ts +1 -0
  10. package/dist/cache/serializer/Deserializer.d.ts.map +1 -0
  11. package/dist/cache/serializer/Serializer.d.ts +1 -0
  12. package/dist/cache/serializer/Serializer.d.ts.map +1 -0
  13. package/dist/cache/serializer/SerializerTypes.d.ts +33 -0
  14. package/dist/cache/serializer/SerializerTypes.d.ts.map +1 -0
  15. package/dist/client/ClientApplication.d.ts +36 -5
  16. package/dist/client/ClientApplication.d.ts.map +1 -0
  17. package/dist/client/ClientAssertion.d.ts +25 -1
  18. package/dist/client/ClientAssertion.d.ts.map +1 -0
  19. package/dist/client/ConfidentialClientApplication.d.ts +9 -4
  20. package/dist/client/ConfidentialClientApplication.d.ts.map +1 -0
  21. package/dist/client/IConfidentialClientApplication.d.ts +14 -0
  22. package/dist/client/IConfidentialClientApplication.d.ts.map +1 -0
  23. package/dist/client/IPublicClientApplication.d.ts +14 -0
  24. package/dist/client/IPublicClientApplication.d.ts.map +1 -0
  25. package/dist/client/PublicClientApplication.d.ts +6 -4
  26. package/dist/client/PublicClientApplication.d.ts.map +1 -0
  27. package/dist/config/Configuration.d.ts +9 -3
  28. package/dist/config/Configuration.d.ts.map +1 -0
  29. package/dist/crypto/CryptoProvider.d.ts +10 -2
  30. package/dist/crypto/CryptoProvider.d.ts.map +1 -0
  31. package/dist/crypto/GuidGenerator.d.ts +1 -0
  32. package/dist/crypto/GuidGenerator.d.ts.map +1 -0
  33. package/dist/crypto/PkceGenerator.d.ts +1 -0
  34. package/dist/crypto/PkceGenerator.d.ts.map +1 -0
  35. package/dist/index.d.ts +9 -6
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/msal-node.cjs.development.js +186 -96
  38. package/dist/msal-node.cjs.development.js.map +1 -1
  39. package/dist/msal-node.cjs.production.min.js +1 -1
  40. package/dist/msal-node.cjs.production.min.js.map +1 -1
  41. package/dist/msal-node.esm.js +185 -95
  42. package/dist/msal-node.esm.js.map +1 -1
  43. package/dist/network/HttpClient.d.ts +1 -1
  44. package/dist/network/HttpClient.d.ts.map +1 -0
  45. package/dist/packageMetadata.d.ts +3 -0
  46. package/dist/packageMetadata.d.ts.map +1 -0
  47. package/dist/request/AuthorizationCodeRequest.d.ts +3 -1
  48. package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -0
  49. package/dist/request/AuthorizationUrlRequest.d.ts +3 -1
  50. package/dist/request/AuthorizationUrlRequest.d.ts.map +1 -0
  51. package/dist/request/ClientCredentialRequest.d.ts +3 -1
  52. package/dist/request/ClientCredentialRequest.d.ts.map +1 -0
  53. package/dist/request/DeviceCodeRequest.d.ts +3 -1
  54. package/dist/request/DeviceCodeRequest.d.ts.map +1 -0
  55. package/dist/request/OnBehalfOfRequest.d.ts +3 -1
  56. package/dist/request/OnBehalfOfRequest.d.ts.map +1 -0
  57. package/dist/request/RefreshTokenRequest.d.ts +3 -1
  58. package/dist/request/RefreshTokenRequest.d.ts.map +1 -0
  59. package/dist/request/SilentFlowRequest.d.ts +3 -1
  60. package/dist/request/SilentFlowRequest.d.ts.map +1 -0
  61. package/dist/request/UsernamePasswordRequest.d.ts +3 -1
  62. package/dist/request/UsernamePasswordRequest.d.ts.map +1 -0
  63. package/dist/utils/Constants.d.ts +1 -0
  64. package/dist/utils/Constants.d.ts.map +1 -0
  65. package/dist/utils/EncodingUtils.d.ts +1 -0
  66. package/dist/utils/EncodingUtils.d.ts.map +1 -0
  67. package/dist/utils/NetworkUtils.d.ts +1 -0
  68. package/dist/utils/NetworkUtils.d.ts.map +1 -0
  69. package/package.json +4 -3
@@ -1,4 +1,4 @@
1
- import { Constants as Constants$1, ProtocolMode, LogLevel, StringUtils, AccountEntity, CacheManager, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, ServerTelemetryEntity, AuthorityMetadataEntity, ThrottlingEntity, TokenCacheContext, ServerTelemetryManager, Logger, AuthorizationCodeClient, ResponseMode, AuthenticationScheme, RefreshTokenClient, SilentFlowClient, AuthorityFactory, DeviceCodeClient, UsernamePasswordClient, ClientAuthError, TimeUtils, ClientCredentialClient, OnBehalfOfClient } from '@azure/msal-common';
1
+ import { Constants as Constants$1, ProtocolMode, LogLevel, StringUtils, AccountEntity, CacheManager, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, ServerTelemetryEntity, AuthorityMetadataEntity, ThrottlingEntity, TokenCacheContext, OIDC_DEFAULT_SCOPES, ServerTelemetryManager, Logger, AuthorizationCodeClient, ResponseMode, AuthenticationScheme, RefreshTokenClient, SilentFlowClient, AuthorityFactory, DeviceCodeClient, UsernamePasswordClient, ClientAuthError, TimeUtils, ClientCredentialClient, OnBehalfOfClient } from '@azure/msal-common';
2
2
  export { AuthError, AuthErrorMessage, ClientAuthError, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorMessage, InteractionRequiredAuthError, LogLevel, Logger, PromptValue, ProtocolMode, ResponseMode, ServerError, TokenCacheContext } from '@azure/msal-common';
3
3
  import axios from 'axios';
4
4
  import { v4 } from 'uuid';
@@ -902,20 +902,15 @@ var JwtConstants = {
902
902
  */
903
903
 
904
904
  var HttpClient = /*#__PURE__*/function () {
905
- function HttpClient() {
906
- axios.defaults.validateStatus = function () {
907
- return true;
908
- };
909
- }
905
+ function HttpClient() {}
906
+
907
+ var _proto = HttpClient.prototype;
908
+
910
909
  /**
911
910
  * Http Get request
912
911
  * @param url
913
912
  * @param options
914
913
  */
915
-
916
-
917
- var _proto = HttpClient.prototype;
918
-
919
914
  _proto.sendGetRequestAsync =
920
915
  /*#__PURE__*/
921
916
  function () {
@@ -928,7 +923,10 @@ var HttpClient = /*#__PURE__*/function () {
928
923
  request = {
929
924
  method: HttpMethod.GET,
930
925
  url: url,
931
- headers: options && options.headers
926
+ headers: options && options.headers,
927
+ validateStatus: function validateStatus() {
928
+ return true;
929
+ }
932
930
  };
933
931
  _context.next = 3;
934
932
  return axios(request);
@@ -975,7 +973,10 @@ var HttpClient = /*#__PURE__*/function () {
975
973
  method: HttpMethod.POST,
976
974
  url: url,
977
975
  data: options && options.body || "",
978
- headers: options && options.headers
976
+ headers: options && options.headers,
977
+ validateStatus: function validateStatus() {
978
+ return true;
979
+ }
979
980
  };
980
981
  _context2.next = 3;
981
982
  return axios(request);
@@ -1053,11 +1054,12 @@ var DEFAULT_SYSTEM_OPTIONS = {
1053
1054
  /**
1054
1055
  * Sets the default options when not explicitly configured from app developer
1055
1056
  *
1056
- * @param auth
1057
- * @param cache
1058
- * @param system
1057
+ * @param auth - Authentication options
1058
+ * @param cache - Cache options
1059
+ * @param system - System options
1059
1060
  *
1060
1061
  * @returns Configuration
1062
+ * @public
1061
1063
  */
1062
1064
 
1063
1065
  function buildAppConfiguration(_ref) {
@@ -1252,6 +1254,7 @@ var PkceGenerator = /*#__PURE__*/function () {
1252
1254
  /**
1253
1255
  * This class implements MSAL node's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
1254
1256
  * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
1257
+ * @public
1255
1258
  */
1256
1259
 
1257
1260
  var CryptoProvider = /*#__PURE__*/function () {
@@ -1272,7 +1275,7 @@ var CryptoProvider = /*#__PURE__*/function () {
1272
1275
  }
1273
1276
  /**
1274
1277
  * Encodes input string to base64.
1275
- * @param input
1278
+ * @param input - string to be encoded
1276
1279
  */
1277
1280
  ;
1278
1281
 
@@ -1281,7 +1284,7 @@ var CryptoProvider = /*#__PURE__*/function () {
1281
1284
  }
1282
1285
  /**
1283
1286
  * Decodes input string from base64.
1284
- * @param input
1287
+ * @param input - string to be decoded
1285
1288
  */
1286
1289
  ;
1287
1290
 
@@ -1295,11 +1298,19 @@ var CryptoProvider = /*#__PURE__*/function () {
1295
1298
 
1296
1299
  _proto.generatePkceCodes = function generatePkceCodes() {
1297
1300
  return this.pkceGenerator.generatePkceCodes();
1298
- };
1301
+ }
1302
+ /**
1303
+ * Generates a keypair, stores it and returns a thumbprint - not yet implemented for node
1304
+ */
1305
+ ;
1299
1306
 
1300
1307
  _proto.getPublicKeyThumbprint = function getPublicKeyThumbprint() {
1301
1308
  throw new Error("Method not implemented.");
1302
- };
1309
+ }
1310
+ /**
1311
+ * Signs the given object as a jwt payload with private key retrieved by given kid - currently not implemented for node
1312
+ */
1313
+ ;
1303
1314
 
1304
1315
  _proto.signJwt = function signJwt() {
1305
1316
  throw new Error("Method not implemented.");
@@ -1646,12 +1657,13 @@ var Serializer = /*#__PURE__*/function () {
1646
1657
 
1647
1658
  /**
1648
1659
  * This class implements Storage for node, reading cache from user specified storage location or an extension library
1660
+ * @public
1649
1661
  */
1650
1662
 
1651
- var Storage = /*#__PURE__*/function (_CacheManager) {
1652
- _inheritsLoose(Storage, _CacheManager);
1663
+ var NodeStorage = /*#__PURE__*/function (_CacheManager) {
1664
+ _inheritsLoose(NodeStorage, _CacheManager);
1653
1665
 
1654
- function Storage(logger, clientId, cryptoImpl) {
1666
+ function NodeStorage(logger, clientId, cryptoImpl) {
1655
1667
  var _this;
1656
1668
 
1657
1669
  _this = _CacheManager.call(this, clientId, cryptoImpl) || this;
@@ -1660,12 +1672,21 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1660
1672
  _this.logger = logger;
1661
1673
  return _this;
1662
1674
  }
1675
+ /**
1676
+ * Queue up callbacks
1677
+ * @param func - a callback function for cache change indication
1678
+ */
1663
1679
 
1664
- var _proto = Storage.prototype;
1680
+
1681
+ var _proto = NodeStorage.prototype;
1665
1682
 
1666
1683
  _proto.registerChangeEmitter = function registerChangeEmitter(func) {
1667
1684
  this.changeEmitters.push(func);
1668
- };
1685
+ }
1686
+ /**
1687
+ * Invoke the callback when cache changes
1688
+ */
1689
+ ;
1669
1690
 
1670
1691
  _proto.emitChange = function emitChange() {
1671
1692
  this.changeEmitters.forEach(function (func) {
@@ -1674,7 +1695,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1674
1695
  }
1675
1696
  /**
1676
1697
  * Converts cacheKVStore to InMemoryCache
1677
- * @param cache
1698
+ * @param cache - key value store
1678
1699
  */
1679
1700
  ;
1680
1701
 
@@ -1707,7 +1728,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1707
1728
  }
1708
1729
  /**
1709
1730
  * converts inMemoryCache to CacheKVStore
1710
- * @param inMemoryCache
1731
+ * @param inMemoryCache - kvstore map for inmemory
1711
1732
  */
1712
1733
  ;
1713
1734
 
@@ -1730,7 +1751,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1730
1751
  }
1731
1752
  /**
1732
1753
  * sets the current in memory cache for the client
1733
- * @param inMemoryCache
1754
+ * @param inMemoryCache - key value map in memory
1734
1755
  */
1735
1756
  ;
1736
1757
 
@@ -1752,7 +1773,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1752
1773
  }
1753
1774
  /**
1754
1775
  * sets the current cache (key value store)
1755
- * @param cacheMap
1776
+ * @param cacheMap - key value map
1756
1777
  */
1757
1778
  ;
1758
1779
 
@@ -1764,7 +1785,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1764
1785
  }
1765
1786
  /**
1766
1787
  * Gets cache item with given key.
1767
- * @param key
1788
+ * @param key - lookup key for the cache entry
1768
1789
  */
1769
1790
  ;
1770
1791
 
@@ -1775,9 +1796,9 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1775
1796
  return cache[key];
1776
1797
  }
1777
1798
  /**
1778
- * Gets cache item with given <key, value>
1779
- * @param key
1780
- * @param value
1799
+ * Gets cache item with given key-value
1800
+ * @param key - lookup key for the cache entry
1801
+ * @param value - value of the cache entry
1781
1802
  */
1782
1803
  ;
1783
1804
 
@@ -1791,7 +1812,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1791
1812
  }
1792
1813
  /**
1793
1814
  * fetch the account entity
1794
- * @param accountKey
1815
+ * @param accountKey - lookup key to fetch cache type AccountEntity
1795
1816
  */
1796
1817
  ;
1797
1818
 
@@ -1806,7 +1827,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1806
1827
  }
1807
1828
  /**
1808
1829
  * set account entity
1809
- * @param account
1830
+ * @param account - cache value to be set of type AccountEntity
1810
1831
  */
1811
1832
  ;
1812
1833
 
@@ -1816,7 +1837,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1816
1837
  }
1817
1838
  /**
1818
1839
  * fetch the idToken credential
1819
- * @param idTokenKey
1840
+ * @param idTokenKey - lookup key to fetch cache type IdTokenEntity
1820
1841
  */
1821
1842
  ;
1822
1843
 
@@ -1831,7 +1852,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1831
1852
  }
1832
1853
  /**
1833
1854
  * set idToken credential
1834
- * @param idToken
1855
+ * @param idToken - cache value to be set of type IdTokenEntity
1835
1856
  */
1836
1857
  ;
1837
1858
 
@@ -1841,7 +1862,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1841
1862
  }
1842
1863
  /**
1843
1864
  * fetch the accessToken credential
1844
- * @param accessTokenKey
1865
+ * @param accessTokenKey - lookup key to fetch cache type AccessTokenEntity
1845
1866
  */
1846
1867
  ;
1847
1868
 
@@ -1856,7 +1877,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1856
1877
  }
1857
1878
  /**
1858
1879
  * set accessToken credential
1859
- * @param accessToken
1880
+ * @param accessToken - cache value to be set of type AccessTokenEntity
1860
1881
  */
1861
1882
  ;
1862
1883
 
@@ -1866,7 +1887,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1866
1887
  }
1867
1888
  /**
1868
1889
  * fetch the refreshToken credential
1869
- * @param refreshTokenKey
1890
+ * @param refreshTokenKey - lookup key to fetch cache type RefreshTokenEntity
1870
1891
  */
1871
1892
  ;
1872
1893
 
@@ -1881,7 +1902,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1881
1902
  }
1882
1903
  /**
1883
1904
  * set refreshToken credential
1884
- * @param refreshToken
1905
+ * @param refreshToken - cache value to be set of type RefreshTokenEntity
1885
1906
  */
1886
1907
  ;
1887
1908
 
@@ -1891,7 +1912,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1891
1912
  }
1892
1913
  /**
1893
1914
  * fetch appMetadata entity from the platform cache
1894
- * @param appMetadataKey
1915
+ * @param appMetadataKey - lookup key to fetch cache type AppMetadataEntity
1895
1916
  */
1896
1917
  ;
1897
1918
 
@@ -1906,7 +1927,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1906
1927
  }
1907
1928
  /**
1908
1929
  * set appMetadata entity to the platform cache
1909
- * @param appMetadata
1930
+ * @param appMetadata - cache value to be set of type AppMetadataEntity
1910
1931
  */
1911
1932
  ;
1912
1933
 
@@ -1916,7 +1937,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1916
1937
  }
1917
1938
  /**
1918
1939
  * fetch server telemetry entity from the platform cache
1919
- * @param serverTelemetrykey
1940
+ * @param serverTelemetrykey - lookup key to fetch cache type ServerTelemetryEntity
1920
1941
  */
1921
1942
  ;
1922
1943
 
@@ -1931,8 +1952,8 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1931
1952
  }
1932
1953
  /**
1933
1954
  * set server telemetry entity to the platform cache
1934
- * @param serverTelemetryKey
1935
- * @param serverTelemetry
1955
+ * @param serverTelemetryKey - lookup key to fetch cache type ServerTelemetryEntity
1956
+ * @param serverTelemetry - cache value to be set of type ServerTelemetryEntity
1936
1957
  */
1937
1958
  ;
1938
1959
 
@@ -1941,7 +1962,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1941
1962
  }
1942
1963
  /**
1943
1964
  * fetch authority metadata entity from the platform cache
1944
- * @param key
1965
+ * @param key - lookup key to fetch cache type AuthorityMetadataEntity
1945
1966
  */
1946
1967
  ;
1947
1968
 
@@ -1968,8 +1989,8 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1968
1989
  }
1969
1990
  /**
1970
1991
  * set authority metadata entity to the platform cache
1971
- * @param key
1972
- * @param metadata
1992
+ * @param key - lookup key to fetch cache type AuthorityMetadataEntity
1993
+ * @param metadata - cache value to be set of type AuthorityMetadataEntity
1973
1994
  */
1974
1995
  ;
1975
1996
 
@@ -1978,7 +1999,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1978
1999
  }
1979
2000
  /**
1980
2001
  * fetch throttling entity from the platform cache
1981
- * @param throttlingCacheKey
2002
+ * @param throttlingCacheKey - lookup key to fetch cache type ThrottlingEntity
1982
2003
  */
1983
2004
  ;
1984
2005
 
@@ -1993,8 +2014,8 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
1993
2014
  }
1994
2015
  /**
1995
2016
  * set throttling entity to the platform cache
1996
- * @param throttlingCacheKey
1997
- * @param throttlingCache
2017
+ * @param throttlingCacheKey - lookup key to fetch cache type ThrottlingEntity
2018
+ * @param throttlingCache - cache value to be set of type ThrottlingEntity
1998
2019
  */
1999
2020
  ;
2000
2021
 
@@ -2003,8 +2024,8 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
2003
2024
  }
2004
2025
  /**
2005
2026
  * Removes the cache item from memory with the given key.
2006
- * @param key
2007
- * @param inMemory
2027
+ * @param key - lookup key to remove a cache entity
2028
+ * @param inMemory - key value map of the cache
2008
2029
  */
2009
2030
  ;
2010
2031
 
@@ -2029,7 +2050,7 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
2029
2050
  }
2030
2051
  /**
2031
2052
  * Checks whether key is in cache.
2032
- * @param key
2053
+ * @param key - look up key for a cache entity
2033
2054
  */
2034
2055
  ;
2035
2056
 
@@ -2066,24 +2087,24 @@ var Storage = /*#__PURE__*/function (_CacheManager) {
2066
2087
  }
2067
2088
  /**
2068
2089
  * Initialize in memory cache from an exisiting cache vault
2069
- * @param cache
2090
+ * @param cache - blob formatted cache (JSON)
2070
2091
  */
2071
2092
  ;
2072
2093
 
2073
- Storage.generateInMemoryCache = function generateInMemoryCache(cache) {
2094
+ NodeStorage.generateInMemoryCache = function generateInMemoryCache(cache) {
2074
2095
  return Deserializer.deserializeAllCache(Deserializer.deserializeJSONBlob(cache));
2075
2096
  }
2076
2097
  /**
2077
2098
  * retrieves the final JSON
2078
- * @param inMemoryCache
2099
+ * @param inMemoryCache - itemised cache read from the JSON
2079
2100
  */
2080
2101
  ;
2081
2102
 
2082
- Storage.generateJsonCache = function generateJsonCache(inMemoryCache) {
2103
+ NodeStorage.generateJsonCache = function generateJsonCache(inMemoryCache) {
2083
2104
  return Serializer.serializeAllCache(inMemoryCache);
2084
2105
  };
2085
2106
 
2086
- return Storage;
2107
+ return NodeStorage;
2087
2108
  }(CacheManager);
2088
2109
 
2089
2110
  var defaultSerializedCache = {
@@ -2095,6 +2116,7 @@ var defaultSerializedCache = {
2095
2116
  };
2096
2117
  /**
2097
2118
  * In-memory token cache manager
2119
+ * @public
2098
2120
  */
2099
2121
 
2100
2122
  var TokenCache = /*#__PURE__*/function () {
@@ -2140,7 +2162,7 @@ var TokenCache = /*#__PURE__*/function () {
2140
2162
  }
2141
2163
  /**
2142
2164
  * Deserializes JSON to in-memory cache. JSON should be in MSAL cache schema format
2143
- * @param cache
2165
+ * @param cache - blob formatted cache
2144
2166
  */
2145
2167
  ;
2146
2168
 
@@ -2155,7 +2177,11 @@ var TokenCache = /*#__PURE__*/function () {
2155
2177
  } else {
2156
2178
  this.logger.verbose("No cache snapshot to deserialize");
2157
2179
  }
2158
- };
2180
+ }
2181
+ /**
2182
+ * Fetches the cache key-value map
2183
+ */
2184
+ ;
2159
2185
 
2160
2186
  _proto.getKVStore = function getKVStore() {
2161
2187
  return this.storage.getCache();
@@ -2221,7 +2247,7 @@ var TokenCache = /*#__PURE__*/function () {
2221
2247
  * Returns the signed in account matching homeAccountId.
2222
2248
  * (the account object is created at the time of successful login)
2223
2249
  * or null when no matching account is found
2224
- * @returns {@link AccountInfo} - the account object stored in MSAL
2250
+ * @param homeAccountId - unique identifier for an account (uid.utid)
2225
2251
  */
2226
2252
  ;
2227
2253
 
@@ -2270,7 +2296,7 @@ var TokenCache = /*#__PURE__*/function () {
2270
2296
  * Returns the signed in account matching localAccountId.
2271
2297
  * (the account object is created at the time of successful login)
2272
2298
  * or null when no matching account is found
2273
- * @returns {@link AccountInfo} - the account object stored in MSAL
2299
+ * @param localAccountId - unique identifier of an account (sub/obj when homeAccountId cannot be populated)
2274
2300
  */
2275
2301
  ;
2276
2302
 
@@ -2317,7 +2343,7 @@ var TokenCache = /*#__PURE__*/function () {
2317
2343
  }()
2318
2344
  /**
2319
2345
  * API to remove a specific account and the relevant data from cache
2320
- * @param account
2346
+ * @param account - AccountInfo passed by the user
2321
2347
  */
2322
2348
  ;
2323
2349
 
@@ -2383,8 +2409,8 @@ var TokenCache = /*#__PURE__*/function () {
2383
2409
  }
2384
2410
  /**
2385
2411
  * Merge in memory cache with the cache snapshot.
2386
- * @param oldState
2387
- * @param currentState
2412
+ * @param oldState - cache before changes
2413
+ * @param currentState - current cache state in the library
2388
2414
  */
2389
2415
  ;
2390
2416
 
@@ -2395,8 +2421,8 @@ var TokenCache = /*#__PURE__*/function () {
2395
2421
  }
2396
2422
  /**
2397
2423
  * Deep update of oldState based on newState values
2398
- * @param oldState
2399
- * @param newState
2424
+ * @param oldState - cache before changes
2425
+ * @param newState - updated cache
2400
2426
  */
2401
2427
  ;
2402
2428
 
@@ -2429,8 +2455,8 @@ var TokenCache = /*#__PURE__*/function () {
2429
2455
  /**
2430
2456
  * Removes entities in oldState that the were removed from newState. If there are any unknown values in root of
2431
2457
  * oldState that are not recognized, they are left untouched.
2432
- * @param oldState
2433
- * @param newState
2458
+ * @param oldState - cache before changes
2459
+ * @param newState - updated cache
2434
2460
  */
2435
2461
  ;
2436
2462
 
@@ -2448,7 +2474,13 @@ var TokenCache = /*#__PURE__*/function () {
2448
2474
  IdToken: idTokens,
2449
2475
  AppMetadata: appMetadata
2450
2476
  });
2451
- };
2477
+ }
2478
+ /**
2479
+ * Helper to merge new cache with the old one
2480
+ * @param oldState - cache before changes
2481
+ * @param newState - updated cache
2482
+ */
2483
+ ;
2452
2484
 
2453
2485
  _proto.mergeRemovalsDict = function mergeRemovalsDict(oldState, newState) {
2454
2486
  var finalState = _extends({}, oldState);
@@ -2459,7 +2491,12 @@ var TokenCache = /*#__PURE__*/function () {
2459
2491
  }
2460
2492
  });
2461
2493
  return finalState;
2462
- };
2494
+ }
2495
+ /**
2496
+ * Helper to overlay as a part of cache merge
2497
+ * @param passedInCache - cache read from the blob
2498
+ */
2499
+ ;
2463
2500
 
2464
2501
  _proto.overlayDefaults = function overlayDefaults(passedInCache) {
2465
2502
  this.logger.verbose("Overlaying input cache with the default cache");
@@ -2475,8 +2512,14 @@ var TokenCache = /*#__PURE__*/function () {
2475
2512
  return TokenCache;
2476
2513
  }();
2477
2514
 
2515
+ /* eslint-disable header/header */
2478
2516
  var name = "@azure/msal-node";
2479
- var version = "1.0.0-beta.5";
2517
+ var version = "1.0.0-beta.6";
2518
+
2519
+ /**
2520
+ * Base abstract class for all ClientApplications - public and confidential
2521
+ * @public
2522
+ */
2480
2523
 
2481
2524
  var ClientApplication = /*#__PURE__*/function () {
2482
2525
  /**
@@ -2486,7 +2529,7 @@ var ClientApplication = /*#__PURE__*/function () {
2486
2529
  this.config = buildAppConfiguration(configuration);
2487
2530
  this.cryptoProvider = new CryptoProvider();
2488
2531
  this.logger = new Logger(this.config.system.loggerOptions, name, version);
2489
- this.storage = new Storage(this.logger, this.config.auth.clientId, this.cryptoProvider);
2532
+ this.storage = new NodeStorage(this.logger, this.config.auth.clientId, this.cryptoProvider);
2490
2533
  this.tokenCache = new TokenCache(this.storage, this.logger, this.config.cache.cachePlugin);
2491
2534
  }
2492
2535
  /**
@@ -2717,15 +2760,23 @@ var ClientApplication = /*#__PURE__*/function () {
2717
2760
  }
2718
2761
  /**
2719
2762
  * Replaces the default logger set in configurations with new Logger with new configurations
2720
- * @param logger Logger instance
2763
+ * @param logger - Logger instance
2721
2764
  */
2722
2765
  ;
2723
2766
 
2724
2767
  _proto.setLogger = function setLogger(logger) {
2725
2768
  this.logger = logger;
2726
- };
2769
+ }
2770
+ /**
2771
+ * Builds the common configuration to be passed to the common component based on the platform configurarion
2772
+ * @param authority - user passed authority in configuration
2773
+ * @param serverTelemetryManager - initializes servertelemetry if passed
2774
+ */
2775
+ ;
2727
2776
 
2728
- _proto.buildOauthClientConfiguration = /*#__PURE__*/function () {
2777
+ _proto.buildOauthClientConfiguration =
2778
+ /*#__PURE__*/
2779
+ function () {
2729
2780
  var _buildOauthClientConfiguration = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(authority, serverTelemetryManager) {
2730
2781
  var discoveredAuthority;
2731
2782
  return runtime_1.wrap(function _callee5$(_context5) {
@@ -2790,18 +2841,25 @@ var ClientApplication = /*#__PURE__*/function () {
2790
2841
  }
2791
2842
  /**
2792
2843
  * Generates a request with the default scopes & generates a correlationId.
2793
- * @param authRequest
2844
+ * @param authRequest - BaseAuthRequest for initialization
2794
2845
  */
2795
2846
  ;
2796
2847
 
2797
2848
  _proto.initializeBaseRequest = function initializeBaseRequest(authRequest) {
2798
2849
  this.logger.verbose("initializeRequestScopes called");
2799
2850
  return _extends({}, authRequest, {
2800
- scopes: [].concat(authRequest && authRequest.scopes || [], [Constants$1.OPENID_SCOPE, Constants$1.PROFILE_SCOPE, Constants$1.OFFLINE_ACCESS_SCOPE]),
2851
+ scopes: [].concat(authRequest && authRequest.scopes || [], OIDC_DEFAULT_SCOPES),
2801
2852
  correlationId: authRequest && authRequest.correlationId || this.cryptoProvider.createNewGuid(),
2802
2853
  authority: authRequest.authority || this.config.auth.authority
2803
2854
  });
2804
- };
2855
+ }
2856
+ /**
2857
+ * Initializes the server telemetry payload
2858
+ * @param apiId - Id for a specific request
2859
+ * @param correlationId - GUID
2860
+ * @param forceRefresh - boolean to indicate network call
2861
+ */
2862
+ ;
2805
2863
 
2806
2864
  _proto.initializeServerTelemetryManager = function initializeServerTelemetryManager(apiId, correlationId, forceRefresh) {
2807
2865
  var telemetryPayload = {
@@ -2815,7 +2873,7 @@ var ClientApplication = /*#__PURE__*/function () {
2815
2873
  /**
2816
2874
  * Create authority instance. If authority not passed in request, default to authority set on the application
2817
2875
  * object. If no authority set in application object, then default to common authority.
2818
- * @param authorityString
2876
+ * @param authorityString - authority from user configuration
2819
2877
  */
2820
2878
  ;
2821
2879
 
@@ -2862,6 +2920,7 @@ var ClientApplication = /*#__PURE__*/function () {
2862
2920
  /**
2863
2921
  * This class is to be used to acquire tokens for public client applications (desktop, mobile). Public client applications
2864
2922
  * are not trusted to safely store application secrets, and therefore can only request tokens in the name of an user.
2923
+ * @public
2865
2924
  */
2866
2925
 
2867
2926
  var PublicClientApplication = /*#__PURE__*/function (_ClientApplication) {
@@ -2872,17 +2931,17 @@ var PublicClientApplication = /*#__PURE__*/function (_ClientApplication) {
2872
2931
  * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal.
2873
2932
  * - authority: the authority URL for your application.
2874
2933
  *
2875
- * AAD authorities are of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}.
2934
+ * AAD authorities are of the form https://login.microsoftonline.com/\{Enter_the_Tenant_Info_Here\}.
2876
2935
  * - If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
2877
2936
  * - If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
2878
2937
  * - If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
2879
2938
  * - To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
2880
2939
  *
2881
- * Azure B2C authorities are of the form https://{instance}/{tenant}/{policy}. Each policy is considered
2940
+ * Azure B2C authorities are of the form https://\{instance\}/\{tenant\}/\{policy\}. Each policy is considered
2882
2941
  * its own authority. You will have to set the all of the knownAuthorities at the time of the client application
2883
2942
  * construction.
2884
2943
  *
2885
- * ADFS authorities are of the form https://{instance}/adfs.
2944
+ * ADFS authorities are of the form https://\{instance\}/adfs.
2886
2945
  */
2887
2946
  function PublicClientApplication(configuration) {
2888
2947
  return _ClientApplication.call(this, configuration) || this;
@@ -2950,7 +3009,7 @@ var PublicClientApplication = /*#__PURE__*/function (_ClientApplication) {
2950
3009
  * Microsoft's documentation and recommendations are at:
2951
3010
  * https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#usernamepassword
2952
3011
  *
2953
- * @param request
3012
+ * @param request - UsenamePasswordRequest
2954
3013
  */
2955
3014
  ;
2956
3015
 
@@ -3006,16 +3065,28 @@ var PublicClientApplication = /*#__PURE__*/function (_ClientApplication) {
3006
3065
  */
3007
3066
  /**
3008
3067
  * Client assertion of type jwt-bearer used in confidential client flows
3068
+ * @public
3009
3069
  */
3010
3070
 
3011
3071
  var ClientAssertion = /*#__PURE__*/function () {
3012
3072
  function ClientAssertion() {}
3013
3073
 
3074
+ /**
3075
+ * Initialize the ClientAssertion class from the clientAssertion passed by the user
3076
+ * @param assertion - refer https://tools.ietf.org/html/rfc7521
3077
+ */
3014
3078
  ClientAssertion.fromAssertion = function fromAssertion(assertion) {
3015
3079
  var clientAssertion = new ClientAssertion();
3016
3080
  clientAssertion.jwt = assertion;
3017
3081
  return clientAssertion;
3018
- };
3082
+ }
3083
+ /**
3084
+ * Initialize the ClientAssertion class from the certificate passed by the user
3085
+ * @param thumbprint - identifier of a certificate
3086
+ * @param privateKey - secret key
3087
+ * @param publicCertificate - electronic document provided to prove the ownership of the public key
3088
+ */
3089
+ ;
3019
3090
 
3020
3091
  ClientAssertion.fromCertificate = function fromCertificate(thumbprint, privateKey, publicCertificate) {
3021
3092
  var clientAssertion = new ClientAssertion();
@@ -3027,7 +3098,14 @@ var ClientAssertion = /*#__PURE__*/function () {
3027
3098
  }
3028
3099
 
3029
3100
  return clientAssertion;
3030
- };
3101
+ }
3102
+ /**
3103
+ * Update JWT for certificate based clientAssertion, if passed by the user, uses it as is
3104
+ * @param cryptoProvider - library's crypto helper
3105
+ * @param issuer - iss claim
3106
+ * @param jwtAudience - aud claim
3107
+ */
3108
+ ;
3031
3109
 
3032
3110
  var _proto = ClientAssertion.prototype;
3033
3111
 
@@ -3051,7 +3129,10 @@ var ClientAssertion = /*#__PURE__*/function () {
3051
3129
  }
3052
3130
 
3053
3131
  throw ClientAuthError.createInvalidAssertionError();
3054
- } // JWT format and required claims specified: https://tools.ietf.org/html/rfc7523#section-3
3132
+ }
3133
+ /**
3134
+ * JWT format and required claims specified: https://tools.ietf.org/html/rfc7523#section-3
3135
+ */
3055
3136
  ;
3056
3137
 
3057
3138
  _proto.createJwt = function createJwt(cryptoProvider, issuer, jwtAudience) {
@@ -3074,14 +3155,18 @@ var ClientAssertion = /*#__PURE__*/function () {
3074
3155
  header: header
3075
3156
  });
3076
3157
  return this.jwt;
3077
- };
3158
+ }
3159
+ /**
3160
+ * Utility API to check expiration
3161
+ */
3162
+ ;
3078
3163
 
3079
3164
  _proto.isExpired = function isExpired() {
3080
3165
  return this.expirationTime < TimeUtils.nowSeconds();
3081
3166
  }
3082
3167
  /**
3083
3168
  * Extracts the raw certs from a given certificate string and returns them in an array.
3084
- * @param publicCertificate
3169
+ * @param publicCertificate - electronic document provided to prove the ownership of the public key
3085
3170
  */
3086
3171
  ;
3087
3172
 
@@ -3108,11 +3193,16 @@ var ClientAssertion = /*#__PURE__*/function () {
3108
3193
  return ClientAssertion;
3109
3194
  }();
3110
3195
 
3196
+ /**
3197
+ * This class is to be used to acquire tokens for confidential client applications (webApp, webAPI). Confidential client applications
3198
+ * will configure application secrets, client certificates/assertions as applicable
3199
+ * @public
3200
+ */
3201
+
3111
3202
  var ConfidentialClientApplication = /*#__PURE__*/function (_ClientApplication) {
3112
3203
  _inheritsLoose(ConfidentialClientApplication, _ClientApplication);
3113
3204
 
3114
3205
  /**
3115
- * @constructor
3116
3206
  * Constructor for the ConfidentialClientApplication
3117
3207
  *
3118
3208
  * Required attributes in the Configuration object are:
@@ -3120,16 +3210,16 @@ var ConfidentialClientApplication = /*#__PURE__*/function (_ClientApplication) {
3120
3210
  * - authority: the authority URL for your application.
3121
3211
  * - client credential: Must set either client secret, certificate, or assertion for confidential clients. You can obtain a client secret from the application registration portal.
3122
3212
  *
3123
- * In Azure AD, authority is a URL indicating of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}.
3213
+ * In Azure AD, authority is a URL indicating of the form https://login.microsoftonline.com/\{Enter_the_Tenant_Info_Here\}.
3124
3214
  * If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
3125
3215
  * If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
3126
3216
  * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
3127
3217
  * To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
3128
3218
  *
3129
- * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/
3219
+ * In Azure B2C, authority is of the form https://\{instance\}/tfp/\{tenant\}/\{policyName\}/
3130
3220
  * Full B2C functionality will be available in this library in future versions.
3131
3221
  *
3132
- * @param {@link (Configuration:type)} configuration object for the MSAL ConfidentialClientApplication instance
3222
+ * @param Configuration - configuration object for the MSAL ConfidentialClientApplication instance
3133
3223
  */
3134
3224
  function ConfidentialClientApplication(configuration) {
3135
3225
  var _this;
@@ -3269,5 +3359,5 @@ var ConfidentialClientApplication = /*#__PURE__*/function (_ClientApplication) {
3269
3359
  return ConfidentialClientApplication;
3270
3360
  }(ClientApplication);
3271
3361
 
3272
- export { ConfidentialClientApplication, CryptoProvider, Deserializer, PublicClientApplication, Serializer, Storage, TokenCache, buildAppConfiguration };
3362
+ export { ClientApplication, ClientAssertion, ConfidentialClientApplication, CryptoProvider, NodeStorage, PublicClientApplication, TokenCache, buildAppConfiguration };
3273
3363
  //# sourceMappingURL=msal-node.esm.js.map