@azure/msal-node 2.2.0-alpha.0 → 2.2.0

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 (106) hide show
  1. package/dist/cache/ITokenCache.d.ts +15 -15
  2. package/dist/cache/NodeStorage.cjs +401 -401
  3. package/dist/cache/NodeStorage.d.ts +182 -182
  4. package/dist/cache/NodeStorage.mjs +401 -401
  5. package/dist/cache/TokenCache.cjs +265 -265
  6. package/dist/cache/TokenCache.d.ts +90 -90
  7. package/dist/cache/TokenCache.mjs +265 -265
  8. package/dist/cache/distributed/DistributedCachePlugin.cjs +26 -26
  9. package/dist/cache/distributed/DistributedCachePlugin.d.ts +10 -10
  10. package/dist/cache/distributed/DistributedCachePlugin.mjs +26 -26
  11. package/dist/cache/distributed/ICacheClient.d.ts +17 -17
  12. package/dist/cache/distributed/IPartitionManager.d.ts +28 -28
  13. package/dist/cache/serializer/Deserializer.cjs +173 -173
  14. package/dist/cache/serializer/Deserializer.d.ts +42 -42
  15. package/dist/cache/serializer/Deserializer.mjs +173 -173
  16. package/dist/cache/serializer/Serializer.cjs +134 -134
  17. package/dist/cache/serializer/Serializer.d.ts +39 -39
  18. package/dist/cache/serializer/Serializer.mjs +134 -134
  19. package/dist/cache/serializer/SerializerTypes.d.ts +101 -101
  20. package/dist/client/ClientApplication.cjs +333 -333
  21. package/dist/client/ClientApplication.d.ts +142 -142
  22. package/dist/client/ClientApplication.mjs +333 -333
  23. package/dist/client/ClientAssertion.cjs +116 -116
  24. package/dist/client/ClientAssertion.d.ts +46 -46
  25. package/dist/client/ClientAssertion.mjs +116 -116
  26. package/dist/client/ClientCredentialClient.cjs +189 -189
  27. package/dist/client/ClientCredentialClient.d.ts +33 -33
  28. package/dist/client/ClientCredentialClient.mjs +189 -189
  29. package/dist/client/ConfidentialClientApplication.cjs +163 -163
  30. package/dist/client/ConfidentialClientApplication.d.ts +58 -58
  31. package/dist/client/ConfidentialClientApplication.mjs +163 -163
  32. package/dist/client/DeviceCodeClient.cjs +207 -207
  33. package/dist/client/DeviceCodeClient.d.ts +53 -53
  34. package/dist/client/DeviceCodeClient.mjs +207 -207
  35. package/dist/client/IConfidentialClientApplication.d.ts +39 -39
  36. package/dist/client/IPublicClientApplication.d.ts +42 -42
  37. package/dist/client/OnBehalfOfClient.cjs +202 -202
  38. package/dist/client/OnBehalfOfClient.d.ts +47 -47
  39. package/dist/client/OnBehalfOfClient.mjs +202 -202
  40. package/dist/client/PublicClientApplication.cjs +229 -229
  41. package/dist/client/PublicClientApplication.d.ts +71 -71
  42. package/dist/client/PublicClientApplication.mjs +229 -229
  43. package/dist/client/UsernamePasswordClient.cjs +95 -95
  44. package/dist/client/UsernamePasswordClient.d.ts +25 -25
  45. package/dist/client/UsernamePasswordClient.mjs +95 -95
  46. package/dist/config/Configuration.cjs +72 -72
  47. package/dist/config/Configuration.d.ts +107 -107
  48. package/dist/config/Configuration.mjs +72 -72
  49. package/dist/crypto/CryptoProvider.cjs +75 -75
  50. package/dist/crypto/CryptoProvider.d.ts +52 -52
  51. package/dist/crypto/CryptoProvider.mjs +75 -75
  52. package/dist/crypto/GuidGenerator.cjs +22 -22
  53. package/dist/crypto/GuidGenerator.d.ts +14 -14
  54. package/dist/crypto/GuidGenerator.mjs +22 -22
  55. package/dist/crypto/HashUtils.cjs +13 -13
  56. package/dist/crypto/HashUtils.d.ts +8 -8
  57. package/dist/crypto/HashUtils.mjs +13 -13
  58. package/dist/crypto/PkceGenerator.cjs +49 -49
  59. package/dist/crypto/PkceGenerator.d.ts +22 -22
  60. package/dist/crypto/PkceGenerator.mjs +49 -49
  61. package/dist/error/NodeAuthError.cjs +85 -85
  62. package/dist/error/NodeAuthError.d.ts +65 -65
  63. package/dist/error/NodeAuthError.mjs +85 -85
  64. package/dist/index.cjs +1 -1
  65. package/dist/index.d.ts +42 -42
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.mjs +1 -1
  68. package/dist/internals.cjs +8 -8
  69. package/dist/internals.d.ts +6 -6
  70. package/dist/internals.mjs +8 -8
  71. package/dist/network/HttpClient.cjs +276 -276
  72. package/dist/network/HttpClient.d.ts +25 -25
  73. package/dist/network/HttpClient.mjs +276 -276
  74. package/dist/network/ILoopbackClient.d.ts +10 -10
  75. package/dist/network/LoopbackClient.cjs +76 -75
  76. package/dist/network/LoopbackClient.cjs.map +1 -1
  77. package/dist/network/LoopbackClient.d.ts +21 -21
  78. package/dist/network/LoopbackClient.d.ts.map +1 -1
  79. package/dist/network/LoopbackClient.mjs +76 -75
  80. package/dist/network/LoopbackClient.mjs.map +1 -1
  81. package/dist/packageMetadata.cjs +4 -4
  82. package/dist/packageMetadata.d.ts +2 -2
  83. package/dist/packageMetadata.mjs +4 -4
  84. package/dist/request/AuthorizationCodeRequest.d.ts +21 -21
  85. package/dist/request/AuthorizationUrlRequest.d.ts +33 -33
  86. package/dist/request/ClientCredentialRequest.d.ts +14 -14
  87. package/dist/request/DeviceCodeRequest.d.ts +15 -15
  88. package/dist/request/InteractiveRequest.d.ts +22 -22
  89. package/dist/request/OnBehalfOfRequest.d.ts +14 -14
  90. package/dist/request/RefreshTokenRequest.d.ts +17 -17
  91. package/dist/request/SignOutRequest.d.ts +5 -5
  92. package/dist/request/SilentFlowRequest.d.ts +16 -16
  93. package/dist/request/UsernamePasswordRequest.d.ts +19 -19
  94. package/dist/utils/Constants.cjs +80 -80
  95. package/dist/utils/Constants.d.ts +86 -86
  96. package/dist/utils/Constants.mjs +80 -80
  97. package/dist/utils/EncodingUtils.cjs +44 -44
  98. package/dist/utils/EncodingUtils.d.ts +26 -26
  99. package/dist/utils/EncodingUtils.mjs +44 -44
  100. package/dist/utils/NetworkUtils.cjs +38 -38
  101. package/dist/utils/NetworkUtils.d.ts +5 -5
  102. package/dist/utils/NetworkUtils.mjs +38 -38
  103. package/package.json +2 -2
  104. package/src/index.ts +1 -0
  105. package/src/network/LoopbackClient.ts +1 -0
  106. package/src/packageMetadata.ts +1 -1
@@ -1,84 +1,84 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.2.0 2023-10-05 */
2
2
  'use strict';
3
- /*
4
- * Copyright (c) Microsoft Corporation. All rights reserved.
5
- * Licensed under the MIT License.
6
- */
7
- /**
8
- * http methods
9
- */
10
- const HttpMethod = {
11
- GET: "get",
12
- POST: "post",
13
- };
14
- const ProxyStatus = {
15
- SUCCESS_RANGE_START: 200,
16
- SUCCESS_RANGE_END: 299,
17
- SERVER_ERROR: 500,
18
- };
19
- /**
20
- * Constants used for region discovery
21
- */
22
- const REGION_ENVIRONMENT_VARIABLE = "REGION_NAME";
23
- /**
24
- * Constant used for PKCE
25
- */
26
- const RANDOM_OCTET_SIZE = 32;
27
- /**
28
- * Constants used in PKCE
29
- */
30
- const Hash = {
31
- SHA256: "sha256",
32
- };
33
- /**
34
- * Constants for encoding schemes
35
- */
36
- const CharSet = {
37
- CV_CHARSET: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",
38
- };
39
- /**
40
- * Constants
41
- */
42
- const Constants = {
43
- MSAL_SKU: "msal.js.node",
44
- JWT_BEARER_ASSERTION_TYPE: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
45
- AUTHORIZATION_PENDING: "authorization_pending",
46
- HTTP_PROTOCOL: "http://",
47
- LOCALHOST: "localhost",
48
- };
49
- /**
50
- * API Codes for Telemetry purposes.
51
- * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs
52
- * 0-99 Silent Flow
53
- * 600-699 Device Code Flow
54
- * 800-899 Auth Code Flow
55
- */
56
- const ApiId = {
57
- acquireTokenSilent: 62,
58
- acquireTokenByUsernamePassword: 371,
59
- acquireTokenByDeviceCode: 671,
60
- acquireTokenByClientCredential: 771,
61
- acquireTokenByCode: 871,
62
- acquireTokenByRefreshToken: 872,
63
- };
64
- /**
65
- * JWT constants
66
- */
67
- const JwtConstants = {
68
- ALGORITHM: "alg",
69
- RSA_256: "RS256",
70
- X5T: "x5t",
71
- X5C: "x5c",
72
- AUDIENCE: "aud",
73
- EXPIRATION_TIME: "exp",
74
- ISSUER: "iss",
75
- SUBJECT: "sub",
76
- NOT_BEFORE: "nbf",
77
- JWT_ID: "jti",
78
- };
79
- const LOOPBACK_SERVER_CONSTANTS = {
80
- INTERVAL_MS: 100,
81
- TIMEOUT_MS: 5000,
3
+ /*
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
+ * Licensed under the MIT License.
6
+ */
7
+ /**
8
+ * http methods
9
+ */
10
+ const HttpMethod = {
11
+ GET: "get",
12
+ POST: "post",
13
+ };
14
+ const ProxyStatus = {
15
+ SUCCESS_RANGE_START: 200,
16
+ SUCCESS_RANGE_END: 299,
17
+ SERVER_ERROR: 500,
18
+ };
19
+ /**
20
+ * Constants used for region discovery
21
+ */
22
+ const REGION_ENVIRONMENT_VARIABLE = "REGION_NAME";
23
+ /**
24
+ * Constant used for PKCE
25
+ */
26
+ const RANDOM_OCTET_SIZE = 32;
27
+ /**
28
+ * Constants used in PKCE
29
+ */
30
+ const Hash = {
31
+ SHA256: "sha256",
32
+ };
33
+ /**
34
+ * Constants for encoding schemes
35
+ */
36
+ const CharSet = {
37
+ CV_CHARSET: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",
38
+ };
39
+ /**
40
+ * Constants
41
+ */
42
+ const Constants = {
43
+ MSAL_SKU: "msal.js.node",
44
+ JWT_BEARER_ASSERTION_TYPE: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
45
+ AUTHORIZATION_PENDING: "authorization_pending",
46
+ HTTP_PROTOCOL: "http://",
47
+ LOCALHOST: "localhost",
48
+ };
49
+ /**
50
+ * API Codes for Telemetry purposes.
51
+ * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs
52
+ * 0-99 Silent Flow
53
+ * 600-699 Device Code Flow
54
+ * 800-899 Auth Code Flow
55
+ */
56
+ const ApiId = {
57
+ acquireTokenSilent: 62,
58
+ acquireTokenByUsernamePassword: 371,
59
+ acquireTokenByDeviceCode: 671,
60
+ acquireTokenByClientCredential: 771,
61
+ acquireTokenByCode: 871,
62
+ acquireTokenByRefreshToken: 872,
63
+ };
64
+ /**
65
+ * JWT constants
66
+ */
67
+ const JwtConstants = {
68
+ ALGORITHM: "alg",
69
+ RSA_256: "RS256",
70
+ X5T: "x5t",
71
+ X5C: "x5c",
72
+ AUDIENCE: "aud",
73
+ EXPIRATION_TIME: "exp",
74
+ ISSUER: "iss",
75
+ SUBJECT: "sub",
76
+ NOT_BEFORE: "nbf",
77
+ JWT_ID: "jti",
78
+ };
79
+ const LOOPBACK_SERVER_CONSTANTS = {
80
+ INTERVAL_MS: 100,
81
+ TIMEOUT_MS: 5000,
82
82
  };
83
83
 
84
84
  export { ApiId, CharSet, Constants, Hash, HttpMethod, JwtConstants, LOOPBACK_SERVER_CONSTANTS, ProxyStatus, RANDOM_OCTET_SIZE, REGION_ENVIRONMENT_VARIABLE };
@@ -1,52 +1,52 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.2.0 2023-10-05 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
5
  var msalCommon = require('@azure/msal-common');
6
6
 
7
- /*
8
- * Copyright (c) Microsoft Corporation. All rights reserved.
9
- * Licensed under the MIT License.
10
- */
11
- class EncodingUtils {
12
- /**
13
- * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
14
- * 'base64': Base64 encoding.
15
- *
16
- * @param str text
17
- */
18
- static base64Encode(str, encoding) {
19
- return Buffer.from(str, encoding).toString("base64");
20
- }
21
- /**
22
- * encode a URL
23
- * @param str
24
- */
25
- static base64EncodeUrl(str, encoding) {
26
- return EncodingUtils.base64Encode(str, encoding)
27
- .replace(/=/g, msalCommon.Constants.EMPTY_STRING)
28
- .replace(/\+/g, "-")
29
- .replace(/\//g, "_");
30
- }
31
- /**
32
- * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
33
- * 'base64': Base64 encoding.
34
- *
35
- * @param base64Str Base64 encoded text
36
- */
37
- static base64Decode(base64Str) {
38
- return Buffer.from(base64Str, "base64").toString("utf8");
39
- }
40
- /**
41
- * @param base64Str Base64 encoded Url
42
- */
43
- static base64DecodeUrl(base64Str) {
44
- let str = base64Str.replace(/-/g, "+").replace(/_/g, "/");
45
- while (str.length % 4) {
46
- str += "=";
47
- }
48
- return EncodingUtils.base64Decode(str);
49
- }
7
+ /*
8
+ * Copyright (c) Microsoft Corporation. All rights reserved.
9
+ * Licensed under the MIT License.
10
+ */
11
+ class EncodingUtils {
12
+ /**
13
+ * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
14
+ * 'base64': Base64 encoding.
15
+ *
16
+ * @param str text
17
+ */
18
+ static base64Encode(str, encoding) {
19
+ return Buffer.from(str, encoding).toString("base64");
20
+ }
21
+ /**
22
+ * encode a URL
23
+ * @param str
24
+ */
25
+ static base64EncodeUrl(str, encoding) {
26
+ return EncodingUtils.base64Encode(str, encoding)
27
+ .replace(/=/g, msalCommon.Constants.EMPTY_STRING)
28
+ .replace(/\+/g, "-")
29
+ .replace(/\//g, "_");
30
+ }
31
+ /**
32
+ * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
33
+ * 'base64': Base64 encoding.
34
+ *
35
+ * @param base64Str Base64 encoded text
36
+ */
37
+ static base64Decode(base64Str) {
38
+ return Buffer.from(base64Str, "base64").toString("utf8");
39
+ }
40
+ /**
41
+ * @param base64Str Base64 encoded Url
42
+ */
43
+ static base64DecodeUrl(base64Str) {
44
+ let str = base64Str.replace(/-/g, "+").replace(/_/g, "/");
45
+ while (str.length % 4) {
46
+ str += "=";
47
+ }
48
+ return EncodingUtils.base64Decode(str);
49
+ }
50
50
  }
51
51
 
52
52
  exports.EncodingUtils = EncodingUtils;
@@ -1,27 +1,27 @@
1
- /// <reference types="node" />
2
- export declare class EncodingUtils {
3
- /**
4
- * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
5
- * 'base64': Base64 encoding.
6
- *
7
- * @param str text
8
- */
9
- static base64Encode(str: string, encoding?: BufferEncoding): string;
10
- /**
11
- * encode a URL
12
- * @param str
13
- */
14
- static base64EncodeUrl(str: string, encoding?: BufferEncoding): string;
15
- /**
16
- * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
17
- * 'base64': Base64 encoding.
18
- *
19
- * @param base64Str Base64 encoded text
20
- */
21
- static base64Decode(base64Str: string): string;
22
- /**
23
- * @param base64Str Base64 encoded Url
24
- */
25
- static base64DecodeUrl(base64Str: string): string;
26
- }
1
+ /// <reference types="node" />
2
+ export declare class EncodingUtils {
3
+ /**
4
+ * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
5
+ * 'base64': Base64 encoding.
6
+ *
7
+ * @param str text
8
+ */
9
+ static base64Encode(str: string, encoding?: BufferEncoding): string;
10
+ /**
11
+ * encode a URL
12
+ * @param str
13
+ */
14
+ static base64EncodeUrl(str: string, encoding?: BufferEncoding): string;
15
+ /**
16
+ * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
17
+ * 'base64': Base64 encoding.
18
+ *
19
+ * @param base64Str Base64 encoded text
20
+ */
21
+ static base64Decode(base64Str: string): string;
22
+ /**
23
+ * @param base64Str Base64 encoded Url
24
+ */
25
+ static base64DecodeUrl(base64Str: string): string;
26
+ }
27
27
  //# sourceMappingURL=EncodingUtils.d.ts.map
@@ -1,50 +1,50 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.2.0 2023-10-05 */
2
2
  'use strict';
3
3
  import { Constants } from '@azure/msal-common';
4
4
 
5
- /*
6
- * Copyright (c) Microsoft Corporation. All rights reserved.
7
- * Licensed under the MIT License.
8
- */
9
- class EncodingUtils {
10
- /**
11
- * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
12
- * 'base64': Base64 encoding.
13
- *
14
- * @param str text
15
- */
16
- static base64Encode(str, encoding) {
17
- return Buffer.from(str, encoding).toString("base64");
18
- }
19
- /**
20
- * encode a URL
21
- * @param str
22
- */
23
- static base64EncodeUrl(str, encoding) {
24
- return EncodingUtils.base64Encode(str, encoding)
25
- .replace(/=/g, Constants.EMPTY_STRING)
26
- .replace(/\+/g, "-")
27
- .replace(/\//g, "_");
28
- }
29
- /**
30
- * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
31
- * 'base64': Base64 encoding.
32
- *
33
- * @param base64Str Base64 encoded text
34
- */
35
- static base64Decode(base64Str) {
36
- return Buffer.from(base64Str, "base64").toString("utf8");
37
- }
38
- /**
39
- * @param base64Str Base64 encoded Url
40
- */
41
- static base64DecodeUrl(base64Str) {
42
- let str = base64Str.replace(/-/g, "+").replace(/_/g, "/");
43
- while (str.length % 4) {
44
- str += "=";
45
- }
46
- return EncodingUtils.base64Decode(str);
47
- }
5
+ /*
6
+ * Copyright (c) Microsoft Corporation. All rights reserved.
7
+ * Licensed under the MIT License.
8
+ */
9
+ class EncodingUtils {
10
+ /**
11
+ * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
12
+ * 'base64': Base64 encoding.
13
+ *
14
+ * @param str text
15
+ */
16
+ static base64Encode(str, encoding) {
17
+ return Buffer.from(str, encoding).toString("base64");
18
+ }
19
+ /**
20
+ * encode a URL
21
+ * @param str
22
+ */
23
+ static base64EncodeUrl(str, encoding) {
24
+ return EncodingUtils.base64Encode(str, encoding)
25
+ .replace(/=/g, Constants.EMPTY_STRING)
26
+ .replace(/\+/g, "-")
27
+ .replace(/\//g, "_");
28
+ }
29
+ /**
30
+ * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
31
+ * 'base64': Base64 encoding.
32
+ *
33
+ * @param base64Str Base64 encoded text
34
+ */
35
+ static base64Decode(base64Str) {
36
+ return Buffer.from(base64Str, "base64").toString("utf8");
37
+ }
38
+ /**
39
+ * @param base64Str Base64 encoded Url
40
+ */
41
+ static base64DecodeUrl(base64Str) {
42
+ let str = base64Str.replace(/-/g, "+").replace(/_/g, "/");
43
+ while (str.length % 4) {
44
+ str += "=";
45
+ }
46
+ return EncodingUtils.base64Decode(str);
47
+ }
48
48
  }
49
49
 
50
50
  export { EncodingUtils };
@@ -1,44 +1,44 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.2.0 2023-10-05 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
- /*
6
- * Copyright (c) Microsoft Corporation. All rights reserved.
7
- * Licensed under the MIT License.
8
- */
9
- class NetworkUtils {
10
- static getNetworkResponse(headers, body, statusCode) {
11
- return {
12
- headers: headers,
13
- body: body,
14
- status: statusCode,
15
- };
16
- }
17
- /*
18
- * Utility function that converts a URL object into an ordinary options object as expected by the
19
- * http.request and https.request APIs.
20
- * https://github.com/nodejs/node/blob/main/lib/internal/url.js#L1090
21
- */
22
- static urlToHttpOptions(url) {
23
- const options = {
24
- protocol: url.protocol,
25
- hostname: url.hostname && url.hostname.startsWith("[")
26
- ? url.hostname.slice(1, -1)
27
- : url.hostname,
28
- hash: url.hash,
29
- search: url.search,
30
- pathname: url.pathname,
31
- path: `${url.pathname || ""}${url.search || ""}`,
32
- href: url.href,
33
- };
34
- if (url.port !== "") {
35
- options.port = Number(url.port);
36
- }
37
- if (url.username || url.password) {
38
- options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;
39
- }
40
- return options;
41
- }
5
+ /*
6
+ * Copyright (c) Microsoft Corporation. All rights reserved.
7
+ * Licensed under the MIT License.
8
+ */
9
+ class NetworkUtils {
10
+ static getNetworkResponse(headers, body, statusCode) {
11
+ return {
12
+ headers: headers,
13
+ body: body,
14
+ status: statusCode,
15
+ };
16
+ }
17
+ /*
18
+ * Utility function that converts a URL object into an ordinary options object as expected by the
19
+ * http.request and https.request APIs.
20
+ * https://github.com/nodejs/node/blob/main/lib/internal/url.js#L1090
21
+ */
22
+ static urlToHttpOptions(url) {
23
+ const options = {
24
+ protocol: url.protocol,
25
+ hostname: url.hostname && url.hostname.startsWith("[")
26
+ ? url.hostname.slice(1, -1)
27
+ : url.hostname,
28
+ hash: url.hash,
29
+ search: url.search,
30
+ pathname: url.pathname,
31
+ path: `${url.pathname || ""}${url.search || ""}`,
32
+ href: url.href,
33
+ };
34
+ if (url.port !== "") {
35
+ options.port = Number(url.port);
36
+ }
37
+ if (url.username || url.password) {
38
+ options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;
39
+ }
40
+ return options;
41
+ }
42
42
  }
43
43
 
44
44
  exports.NetworkUtils = NetworkUtils;
@@ -1,6 +1,6 @@
1
- import { NetworkResponse, UrlToHttpRequestOptions } from "@azure/msal-common";
2
- export declare class NetworkUtils {
3
- static getNetworkResponse<T>(headers: Record<string, string>, body: T, statusCode: number): NetworkResponse<T>;
4
- static urlToHttpOptions(url: URL): UrlToHttpRequestOptions;
5
- }
1
+ import { NetworkResponse, UrlToHttpRequestOptions } from "@azure/msal-common";
2
+ export declare class NetworkUtils {
3
+ static getNetworkResponse<T>(headers: Record<string, string>, body: T, statusCode: number): NetworkResponse<T>;
4
+ static urlToHttpOptions(url: URL): UrlToHttpRequestOptions;
5
+ }
6
6
  //# sourceMappingURL=NetworkUtils.d.ts.map
@@ -1,42 +1,42 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.2.0 2023-10-05 */
2
2
  'use strict';
3
- /*
4
- * Copyright (c) Microsoft Corporation. All rights reserved.
5
- * Licensed under the MIT License.
6
- */
7
- class NetworkUtils {
8
- static getNetworkResponse(headers, body, statusCode) {
9
- return {
10
- headers: headers,
11
- body: body,
12
- status: statusCode,
13
- };
14
- }
15
- /*
16
- * Utility function that converts a URL object into an ordinary options object as expected by the
17
- * http.request and https.request APIs.
18
- * https://github.com/nodejs/node/blob/main/lib/internal/url.js#L1090
19
- */
20
- static urlToHttpOptions(url) {
21
- const options = {
22
- protocol: url.protocol,
23
- hostname: url.hostname && url.hostname.startsWith("[")
24
- ? url.hostname.slice(1, -1)
25
- : url.hostname,
26
- hash: url.hash,
27
- search: url.search,
28
- pathname: url.pathname,
29
- path: `${url.pathname || ""}${url.search || ""}`,
30
- href: url.href,
31
- };
32
- if (url.port !== "") {
33
- options.port = Number(url.port);
34
- }
35
- if (url.username || url.password) {
36
- options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;
37
- }
38
- return options;
39
- }
3
+ /*
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
+ * Licensed under the MIT License.
6
+ */
7
+ class NetworkUtils {
8
+ static getNetworkResponse(headers, body, statusCode) {
9
+ return {
10
+ headers: headers,
11
+ body: body,
12
+ status: statusCode,
13
+ };
14
+ }
15
+ /*
16
+ * Utility function that converts a URL object into an ordinary options object as expected by the
17
+ * http.request and https.request APIs.
18
+ * https://github.com/nodejs/node/blob/main/lib/internal/url.js#L1090
19
+ */
20
+ static urlToHttpOptions(url) {
21
+ const options = {
22
+ protocol: url.protocol,
23
+ hostname: url.hostname && url.hostname.startsWith("[")
24
+ ? url.hostname.slice(1, -1)
25
+ : url.hostname,
26
+ hash: url.hash,
27
+ search: url.search,
28
+ pathname: url.pathname,
29
+ path: `${url.pathname || ""}${url.search || ""}`,
30
+ href: url.href,
31
+ };
32
+ if (url.port !== "") {
33
+ options.port = Number(url.port);
34
+ }
35
+ if (url.username || url.password) {
36
+ options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;
37
+ }
38
+ return options;
39
+ }
40
40
  }
41
41
 
42
42
  export { NetworkUtils };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@azure/msal-node",
4
- "version": "2.2.0-alpha.0",
4
+ "version": "2.2.0",
5
5
  "author": {
6
6
  "name": "Microsoft",
7
7
  "email": "nugetaad@microsoft.com",
@@ -77,7 +77,7 @@
77
77
  "yargs": "^17.3.1"
78
78
  },
79
79
  "dependencies": {
80
- "@azure/msal-common": "14.1.0-alpha.0",
80
+ "@azure/msal-common": "14.1.0",
81
81
  "jsonwebtoken": "^9.0.0",
82
82
  "uuid": "^8.3.0"
83
83
  },
package/src/index.ts CHANGED
@@ -120,6 +120,7 @@ export {
120
120
  IAppTokenProvider,
121
121
  AppTokenProviderParameters,
122
122
  AppTokenProviderResult,
123
+ INativeBrokerPlugin,
123
124
  } from "@azure/msal-common";
124
125
 
125
126
  export { version } from "./packageMetadata.js";
@@ -104,6 +104,7 @@ export class LoopbackClient implements ILoopbackClient {
104
104
  */
105
105
  this.server.closeAllConnections();
106
106
  }
107
+ this.server.unref();
107
108
  this.server = undefined;
108
109
  }
109
110
  }
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable header/header */
2
2
  export const name = "@azure/msal-node";
3
- export const version = "2.1.0";
3
+ export const version = "2.2.0";