@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,93 +1,93 @@
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
- /**
12
- * NodeAuthErrorMessage class containing string constants used by error codes and messages.
13
- */
14
- const NodeAuthErrorMessage = {
15
- invalidLoopbackAddressType: {
16
- code: "invalid_loopback_server_address_type",
17
- desc: "Loopback server address is not type string. This is unexpected.",
18
- },
19
- unableToLoadRedirectUri: {
20
- code: "unable_to_load_redirectUrl",
21
- desc: "Loopback server callback was invoked without a url. This is unexpected.",
22
- },
23
- noAuthCodeInResponse: {
24
- code: "no_auth_code_in_response",
25
- desc: "No auth code found in the server response. Please check your network trace to determine what happened.",
26
- },
27
- noLoopbackServerExists: {
28
- code: "no_loopback_server_exists",
29
- desc: "No loopback server exists yet.",
30
- },
31
- loopbackServerAlreadyExists: {
32
- code: "loopback_server_already_exists",
33
- desc: "Loopback server already exists. Cannot create another.",
34
- },
35
- loopbackServerTimeout: {
36
- code: "loopback_server_timeout",
37
- desc: "Timed out waiting for auth code listener to be registered.",
38
- },
39
- stateNotFoundError: {
40
- code: "state_not_found",
41
- desc: "State not found. Please verify that the request originated from msal.",
42
- },
43
- };
44
- class NodeAuthError extends msalCommon.AuthError {
45
- constructor(errorCode, errorMessage) {
46
- super(errorCode, errorMessage);
47
- this.name = "NodeAuthError";
48
- }
49
- /**
50
- * Creates an error thrown if loopback server address is of type string.
51
- */
52
- static createInvalidLoopbackAddressTypeError() {
53
- return new NodeAuthError(NodeAuthErrorMessage.invalidLoopbackAddressType.code, `${NodeAuthErrorMessage.invalidLoopbackAddressType.desc}`);
54
- }
55
- /**
56
- * Creates an error thrown if the loopback server is unable to get a url.
57
- */
58
- static createUnableToLoadRedirectUrlError() {
59
- return new NodeAuthError(NodeAuthErrorMessage.unableToLoadRedirectUri.code, `${NodeAuthErrorMessage.unableToLoadRedirectUri.desc}`);
60
- }
61
- /**
62
- * Creates an error thrown if the server response does not contain an auth code.
63
- */
64
- static createNoAuthCodeInResponseError() {
65
- return new NodeAuthError(NodeAuthErrorMessage.noAuthCodeInResponse.code, `${NodeAuthErrorMessage.noAuthCodeInResponse.desc}`);
66
- }
67
- /**
68
- * Creates an error thrown if the loopback server has not been spun up yet.
69
- */
70
- static createNoLoopbackServerExistsError() {
71
- return new NodeAuthError(NodeAuthErrorMessage.noLoopbackServerExists.code, `${NodeAuthErrorMessage.noLoopbackServerExists.desc}`);
72
- }
73
- /**
74
- * Creates an error thrown if a loopback server already exists when attempting to create another one.
75
- */
76
- static createLoopbackServerAlreadyExistsError() {
77
- return new NodeAuthError(NodeAuthErrorMessage.loopbackServerAlreadyExists.code, `${NodeAuthErrorMessage.loopbackServerAlreadyExists.desc}`);
78
- }
79
- /**
80
- * Creates an error thrown if the loopback server times out registering the auth code listener.
81
- */
82
- static createLoopbackServerTimeoutError() {
83
- return new NodeAuthError(NodeAuthErrorMessage.loopbackServerTimeout.code, `${NodeAuthErrorMessage.loopbackServerTimeout.desc}`);
84
- }
85
- /**
86
- * Creates an error thrown when the state is not present.
87
- */
88
- static createStateNotFoundError() {
89
- return new NodeAuthError(NodeAuthErrorMessage.stateNotFoundError.code, NodeAuthErrorMessage.stateNotFoundError.desc);
90
- }
7
+ /*
8
+ * Copyright (c) Microsoft Corporation. All rights reserved.
9
+ * Licensed under the MIT License.
10
+ */
11
+ /**
12
+ * NodeAuthErrorMessage class containing string constants used by error codes and messages.
13
+ */
14
+ const NodeAuthErrorMessage = {
15
+ invalidLoopbackAddressType: {
16
+ code: "invalid_loopback_server_address_type",
17
+ desc: "Loopback server address is not type string. This is unexpected.",
18
+ },
19
+ unableToLoadRedirectUri: {
20
+ code: "unable_to_load_redirectUrl",
21
+ desc: "Loopback server callback was invoked without a url. This is unexpected.",
22
+ },
23
+ noAuthCodeInResponse: {
24
+ code: "no_auth_code_in_response",
25
+ desc: "No auth code found in the server response. Please check your network trace to determine what happened.",
26
+ },
27
+ noLoopbackServerExists: {
28
+ code: "no_loopback_server_exists",
29
+ desc: "No loopback server exists yet.",
30
+ },
31
+ loopbackServerAlreadyExists: {
32
+ code: "loopback_server_already_exists",
33
+ desc: "Loopback server already exists. Cannot create another.",
34
+ },
35
+ loopbackServerTimeout: {
36
+ code: "loopback_server_timeout",
37
+ desc: "Timed out waiting for auth code listener to be registered.",
38
+ },
39
+ stateNotFoundError: {
40
+ code: "state_not_found",
41
+ desc: "State not found. Please verify that the request originated from msal.",
42
+ },
43
+ };
44
+ class NodeAuthError extends msalCommon.AuthError {
45
+ constructor(errorCode, errorMessage) {
46
+ super(errorCode, errorMessage);
47
+ this.name = "NodeAuthError";
48
+ }
49
+ /**
50
+ * Creates an error thrown if loopback server address is of type string.
51
+ */
52
+ static createInvalidLoopbackAddressTypeError() {
53
+ return new NodeAuthError(NodeAuthErrorMessage.invalidLoopbackAddressType.code, `${NodeAuthErrorMessage.invalidLoopbackAddressType.desc}`);
54
+ }
55
+ /**
56
+ * Creates an error thrown if the loopback server is unable to get a url.
57
+ */
58
+ static createUnableToLoadRedirectUrlError() {
59
+ return new NodeAuthError(NodeAuthErrorMessage.unableToLoadRedirectUri.code, `${NodeAuthErrorMessage.unableToLoadRedirectUri.desc}`);
60
+ }
61
+ /**
62
+ * Creates an error thrown if the server response does not contain an auth code.
63
+ */
64
+ static createNoAuthCodeInResponseError() {
65
+ return new NodeAuthError(NodeAuthErrorMessage.noAuthCodeInResponse.code, `${NodeAuthErrorMessage.noAuthCodeInResponse.desc}`);
66
+ }
67
+ /**
68
+ * Creates an error thrown if the loopback server has not been spun up yet.
69
+ */
70
+ static createNoLoopbackServerExistsError() {
71
+ return new NodeAuthError(NodeAuthErrorMessage.noLoopbackServerExists.code, `${NodeAuthErrorMessage.noLoopbackServerExists.desc}`);
72
+ }
73
+ /**
74
+ * Creates an error thrown if a loopback server already exists when attempting to create another one.
75
+ */
76
+ static createLoopbackServerAlreadyExistsError() {
77
+ return new NodeAuthError(NodeAuthErrorMessage.loopbackServerAlreadyExists.code, `${NodeAuthErrorMessage.loopbackServerAlreadyExists.desc}`);
78
+ }
79
+ /**
80
+ * Creates an error thrown if the loopback server times out registering the auth code listener.
81
+ */
82
+ static createLoopbackServerTimeoutError() {
83
+ return new NodeAuthError(NodeAuthErrorMessage.loopbackServerTimeout.code, `${NodeAuthErrorMessage.loopbackServerTimeout.desc}`);
84
+ }
85
+ /**
86
+ * Creates an error thrown when the state is not present.
87
+ */
88
+ static createStateNotFoundError() {
89
+ return new NodeAuthError(NodeAuthErrorMessage.stateNotFoundError.code, NodeAuthErrorMessage.stateNotFoundError.desc);
90
+ }
91
91
  }
92
92
 
93
93
  exports.NodeAuthError = NodeAuthError;
@@ -1,66 +1,66 @@
1
- import { AuthError } from "@azure/msal-common";
2
- /**
3
- * NodeAuthErrorMessage class containing string constants used by error codes and messages.
4
- */
5
- export declare const NodeAuthErrorMessage: {
6
- invalidLoopbackAddressType: {
7
- code: string;
8
- desc: string;
9
- };
10
- unableToLoadRedirectUri: {
11
- code: string;
12
- desc: string;
13
- };
14
- noAuthCodeInResponse: {
15
- code: string;
16
- desc: string;
17
- };
18
- noLoopbackServerExists: {
19
- code: string;
20
- desc: string;
21
- };
22
- loopbackServerAlreadyExists: {
23
- code: string;
24
- desc: string;
25
- };
26
- loopbackServerTimeout: {
27
- code: string;
28
- desc: string;
29
- };
30
- stateNotFoundError: {
31
- code: string;
32
- desc: string;
33
- };
34
- };
35
- export declare class NodeAuthError extends AuthError {
36
- constructor(errorCode: string, errorMessage?: string);
37
- /**
38
- * Creates an error thrown if loopback server address is of type string.
39
- */
40
- static createInvalidLoopbackAddressTypeError(): NodeAuthError;
41
- /**
42
- * Creates an error thrown if the loopback server is unable to get a url.
43
- */
44
- static createUnableToLoadRedirectUrlError(): NodeAuthError;
45
- /**
46
- * Creates an error thrown if the server response does not contain an auth code.
47
- */
48
- static createNoAuthCodeInResponseError(): NodeAuthError;
49
- /**
50
- * Creates an error thrown if the loopback server has not been spun up yet.
51
- */
52
- static createNoLoopbackServerExistsError(): NodeAuthError;
53
- /**
54
- * Creates an error thrown if a loopback server already exists when attempting to create another one.
55
- */
56
- static createLoopbackServerAlreadyExistsError(): NodeAuthError;
57
- /**
58
- * Creates an error thrown if the loopback server times out registering the auth code listener.
59
- */
60
- static createLoopbackServerTimeoutError(): NodeAuthError;
61
- /**
62
- * Creates an error thrown when the state is not present.
63
- */
64
- static createStateNotFoundError(): NodeAuthError;
65
- }
1
+ import { AuthError } from "@azure/msal-common";
2
+ /**
3
+ * NodeAuthErrorMessage class containing string constants used by error codes and messages.
4
+ */
5
+ export declare const NodeAuthErrorMessage: {
6
+ invalidLoopbackAddressType: {
7
+ code: string;
8
+ desc: string;
9
+ };
10
+ unableToLoadRedirectUri: {
11
+ code: string;
12
+ desc: string;
13
+ };
14
+ noAuthCodeInResponse: {
15
+ code: string;
16
+ desc: string;
17
+ };
18
+ noLoopbackServerExists: {
19
+ code: string;
20
+ desc: string;
21
+ };
22
+ loopbackServerAlreadyExists: {
23
+ code: string;
24
+ desc: string;
25
+ };
26
+ loopbackServerTimeout: {
27
+ code: string;
28
+ desc: string;
29
+ };
30
+ stateNotFoundError: {
31
+ code: string;
32
+ desc: string;
33
+ };
34
+ };
35
+ export declare class NodeAuthError extends AuthError {
36
+ constructor(errorCode: string, errorMessage?: string);
37
+ /**
38
+ * Creates an error thrown if loopback server address is of type string.
39
+ */
40
+ static createInvalidLoopbackAddressTypeError(): NodeAuthError;
41
+ /**
42
+ * Creates an error thrown if the loopback server is unable to get a url.
43
+ */
44
+ static createUnableToLoadRedirectUrlError(): NodeAuthError;
45
+ /**
46
+ * Creates an error thrown if the server response does not contain an auth code.
47
+ */
48
+ static createNoAuthCodeInResponseError(): NodeAuthError;
49
+ /**
50
+ * Creates an error thrown if the loopback server has not been spun up yet.
51
+ */
52
+ static createNoLoopbackServerExistsError(): NodeAuthError;
53
+ /**
54
+ * Creates an error thrown if a loopback server already exists when attempting to create another one.
55
+ */
56
+ static createLoopbackServerAlreadyExistsError(): NodeAuthError;
57
+ /**
58
+ * Creates an error thrown if the loopback server times out registering the auth code listener.
59
+ */
60
+ static createLoopbackServerTimeoutError(): NodeAuthError;
61
+ /**
62
+ * Creates an error thrown when the state is not present.
63
+ */
64
+ static createStateNotFoundError(): NodeAuthError;
65
+ }
66
66
  //# sourceMappingURL=NodeAuthError.d.ts.map
@@ -1,91 +1,91 @@
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 { AuthError } from '@azure/msal-common';
4
4
 
5
- /*
6
- * Copyright (c) Microsoft Corporation. All rights reserved.
7
- * Licensed under the MIT License.
8
- */
9
- /**
10
- * NodeAuthErrorMessage class containing string constants used by error codes and messages.
11
- */
12
- const NodeAuthErrorMessage = {
13
- invalidLoopbackAddressType: {
14
- code: "invalid_loopback_server_address_type",
15
- desc: "Loopback server address is not type string. This is unexpected.",
16
- },
17
- unableToLoadRedirectUri: {
18
- code: "unable_to_load_redirectUrl",
19
- desc: "Loopback server callback was invoked without a url. This is unexpected.",
20
- },
21
- noAuthCodeInResponse: {
22
- code: "no_auth_code_in_response",
23
- desc: "No auth code found in the server response. Please check your network trace to determine what happened.",
24
- },
25
- noLoopbackServerExists: {
26
- code: "no_loopback_server_exists",
27
- desc: "No loopback server exists yet.",
28
- },
29
- loopbackServerAlreadyExists: {
30
- code: "loopback_server_already_exists",
31
- desc: "Loopback server already exists. Cannot create another.",
32
- },
33
- loopbackServerTimeout: {
34
- code: "loopback_server_timeout",
35
- desc: "Timed out waiting for auth code listener to be registered.",
36
- },
37
- stateNotFoundError: {
38
- code: "state_not_found",
39
- desc: "State not found. Please verify that the request originated from msal.",
40
- },
41
- };
42
- class NodeAuthError extends AuthError {
43
- constructor(errorCode, errorMessage) {
44
- super(errorCode, errorMessage);
45
- this.name = "NodeAuthError";
46
- }
47
- /**
48
- * Creates an error thrown if loopback server address is of type string.
49
- */
50
- static createInvalidLoopbackAddressTypeError() {
51
- return new NodeAuthError(NodeAuthErrorMessage.invalidLoopbackAddressType.code, `${NodeAuthErrorMessage.invalidLoopbackAddressType.desc}`);
52
- }
53
- /**
54
- * Creates an error thrown if the loopback server is unable to get a url.
55
- */
56
- static createUnableToLoadRedirectUrlError() {
57
- return new NodeAuthError(NodeAuthErrorMessage.unableToLoadRedirectUri.code, `${NodeAuthErrorMessage.unableToLoadRedirectUri.desc}`);
58
- }
59
- /**
60
- * Creates an error thrown if the server response does not contain an auth code.
61
- */
62
- static createNoAuthCodeInResponseError() {
63
- return new NodeAuthError(NodeAuthErrorMessage.noAuthCodeInResponse.code, `${NodeAuthErrorMessage.noAuthCodeInResponse.desc}`);
64
- }
65
- /**
66
- * Creates an error thrown if the loopback server has not been spun up yet.
67
- */
68
- static createNoLoopbackServerExistsError() {
69
- return new NodeAuthError(NodeAuthErrorMessage.noLoopbackServerExists.code, `${NodeAuthErrorMessage.noLoopbackServerExists.desc}`);
70
- }
71
- /**
72
- * Creates an error thrown if a loopback server already exists when attempting to create another one.
73
- */
74
- static createLoopbackServerAlreadyExistsError() {
75
- return new NodeAuthError(NodeAuthErrorMessage.loopbackServerAlreadyExists.code, `${NodeAuthErrorMessage.loopbackServerAlreadyExists.desc}`);
76
- }
77
- /**
78
- * Creates an error thrown if the loopback server times out registering the auth code listener.
79
- */
80
- static createLoopbackServerTimeoutError() {
81
- return new NodeAuthError(NodeAuthErrorMessage.loopbackServerTimeout.code, `${NodeAuthErrorMessage.loopbackServerTimeout.desc}`);
82
- }
83
- /**
84
- * Creates an error thrown when the state is not present.
85
- */
86
- static createStateNotFoundError() {
87
- return new NodeAuthError(NodeAuthErrorMessage.stateNotFoundError.code, NodeAuthErrorMessage.stateNotFoundError.desc);
88
- }
5
+ /*
6
+ * Copyright (c) Microsoft Corporation. All rights reserved.
7
+ * Licensed under the MIT License.
8
+ */
9
+ /**
10
+ * NodeAuthErrorMessage class containing string constants used by error codes and messages.
11
+ */
12
+ const NodeAuthErrorMessage = {
13
+ invalidLoopbackAddressType: {
14
+ code: "invalid_loopback_server_address_type",
15
+ desc: "Loopback server address is not type string. This is unexpected.",
16
+ },
17
+ unableToLoadRedirectUri: {
18
+ code: "unable_to_load_redirectUrl",
19
+ desc: "Loopback server callback was invoked without a url. This is unexpected.",
20
+ },
21
+ noAuthCodeInResponse: {
22
+ code: "no_auth_code_in_response",
23
+ desc: "No auth code found in the server response. Please check your network trace to determine what happened.",
24
+ },
25
+ noLoopbackServerExists: {
26
+ code: "no_loopback_server_exists",
27
+ desc: "No loopback server exists yet.",
28
+ },
29
+ loopbackServerAlreadyExists: {
30
+ code: "loopback_server_already_exists",
31
+ desc: "Loopback server already exists. Cannot create another.",
32
+ },
33
+ loopbackServerTimeout: {
34
+ code: "loopback_server_timeout",
35
+ desc: "Timed out waiting for auth code listener to be registered.",
36
+ },
37
+ stateNotFoundError: {
38
+ code: "state_not_found",
39
+ desc: "State not found. Please verify that the request originated from msal.",
40
+ },
41
+ };
42
+ class NodeAuthError extends AuthError {
43
+ constructor(errorCode, errorMessage) {
44
+ super(errorCode, errorMessage);
45
+ this.name = "NodeAuthError";
46
+ }
47
+ /**
48
+ * Creates an error thrown if loopback server address is of type string.
49
+ */
50
+ static createInvalidLoopbackAddressTypeError() {
51
+ return new NodeAuthError(NodeAuthErrorMessage.invalidLoopbackAddressType.code, `${NodeAuthErrorMessage.invalidLoopbackAddressType.desc}`);
52
+ }
53
+ /**
54
+ * Creates an error thrown if the loopback server is unable to get a url.
55
+ */
56
+ static createUnableToLoadRedirectUrlError() {
57
+ return new NodeAuthError(NodeAuthErrorMessage.unableToLoadRedirectUri.code, `${NodeAuthErrorMessage.unableToLoadRedirectUri.desc}`);
58
+ }
59
+ /**
60
+ * Creates an error thrown if the server response does not contain an auth code.
61
+ */
62
+ static createNoAuthCodeInResponseError() {
63
+ return new NodeAuthError(NodeAuthErrorMessage.noAuthCodeInResponse.code, `${NodeAuthErrorMessage.noAuthCodeInResponse.desc}`);
64
+ }
65
+ /**
66
+ * Creates an error thrown if the loopback server has not been spun up yet.
67
+ */
68
+ static createNoLoopbackServerExistsError() {
69
+ return new NodeAuthError(NodeAuthErrorMessage.noLoopbackServerExists.code, `${NodeAuthErrorMessage.noLoopbackServerExists.desc}`);
70
+ }
71
+ /**
72
+ * Creates an error thrown if a loopback server already exists when attempting to create another one.
73
+ */
74
+ static createLoopbackServerAlreadyExistsError() {
75
+ return new NodeAuthError(NodeAuthErrorMessage.loopbackServerAlreadyExists.code, `${NodeAuthErrorMessage.loopbackServerAlreadyExists.desc}`);
76
+ }
77
+ /**
78
+ * Creates an error thrown if the loopback server times out registering the auth code listener.
79
+ */
80
+ static createLoopbackServerTimeoutError() {
81
+ return new NodeAuthError(NodeAuthErrorMessage.loopbackServerTimeout.code, `${NodeAuthErrorMessage.loopbackServerTimeout.desc}`);
82
+ }
83
+ /**
84
+ * Creates an error thrown when the state is not present.
85
+ */
86
+ static createStateNotFoundError() {
87
+ return new NodeAuthError(NodeAuthErrorMessage.stateNotFoundError.code, NodeAuthErrorMessage.stateNotFoundError.desc);
88
+ }
89
89
  }
90
90
 
91
91
  export { NodeAuthError, NodeAuthErrorMessage };
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
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
 
package/dist/index.d.ts CHANGED
@@ -1,43 +1,43 @@
1
- /**
2
- * @packageDocumentation
3
- * @module @azure/msal-node
4
- */
5
- /**
6
- * Warning: This set of exports is purely intended to be used by other MSAL libraries, and should be considered potentially unstable. We strongly discourage using them directly, you do so at your own risk.
7
- * Breaking changes to these APIs will be shipped under a minor version, instead of a major version.
8
- */
9
- import * as internals from "./internals.js";
10
- export { internals };
11
- export { IPublicClientApplication } from "./client/IPublicClientApplication.js";
12
- export { IConfidentialClientApplication } from "./client/IConfidentialClientApplication.js";
13
- export { ITokenCache } from "./cache/ITokenCache.js";
14
- export { ICacheClient } from "./cache/distributed/ICacheClient.js";
15
- export { IPartitionManager } from "./cache/distributed/IPartitionManager.js";
16
- export { ILoopbackClient } from "./network/ILoopbackClient.js";
17
- export { PublicClientApplication } from "./client/PublicClientApplication.js";
18
- export { ConfidentialClientApplication } from "./client/ConfidentialClientApplication.js";
19
- export { ClientApplication } from "./client/ClientApplication.js";
20
- export { ClientCredentialClient } from "./client/ClientCredentialClient.js";
21
- export { DeviceCodeClient } from "./client/DeviceCodeClient.js";
22
- export { OnBehalfOfClient } from "./client/OnBehalfOfClient.js";
23
- export { UsernamePasswordClient } from "./client/UsernamePasswordClient.js";
24
- export { Configuration, buildAppConfiguration, NodeAuthOptions, NodeSystemOptions, BrokerOptions, NodeTelemetryOptions, CacheOptions, } from "./config/Configuration.js";
25
- export { ClientAssertion } from "./client/ClientAssertion.js";
26
- export { TokenCache } from "./cache/TokenCache.js";
27
- export { NodeStorage } from "./cache/NodeStorage.js";
28
- export { CacheKVStore, JsonCache, InMemoryCache, SerializedAccountEntity, SerializedIdTokenEntity, SerializedAccessTokenEntity, SerializedAppMetadataEntity, SerializedRefreshTokenEntity, } from "./cache/serializer/SerializerTypes.js";
29
- export { DistributedCachePlugin } from "./cache/distributed/DistributedCachePlugin.js";
30
- export { CryptoProvider } from "./crypto/CryptoProvider.js";
31
- export type { AuthorizationCodeRequest } from "./request/AuthorizationCodeRequest.js";
32
- export type { AuthorizationUrlRequest } from "./request/AuthorizationUrlRequest.js";
33
- export type { ClientCredentialRequest } from "./request/ClientCredentialRequest.js";
34
- export type { DeviceCodeRequest } from "./request/DeviceCodeRequest.js";
35
- export type { OnBehalfOfRequest } from "./request/OnBehalfOfRequest.js";
36
- export type { UsernamePasswordRequest } from "./request/UsernamePasswordRequest.js";
37
- export type { RefreshTokenRequest } from "./request/RefreshTokenRequest.js";
38
- export type { SilentFlowRequest } from "./request/SilentFlowRequest.js";
39
- export type { InteractiveRequest } from "./request/InteractiveRequest.js";
40
- export type { SignOutRequest } from "./request/SignOutRequest.js";
41
- export { PromptValue, ResponseMode, AuthorizationCodePayload, AuthenticationResult, ServerAuthorizationCodeResponse, IdTokenClaims, AccountInfo, ValidCacheType, AuthError, AuthErrorMessage, AuthErrorCodes, ClientAuthError, ClientAuthErrorCodes, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorCodes, ClientConfigurationErrorMessage, InteractionRequiredAuthError, InteractionRequiredAuthErrorCodes, InteractionRequiredAuthErrorMessage, ServerError, INetworkModule, NetworkRequestOptions, NetworkResponse, Logger, LogLevel, ProtocolMode, ICachePlugin, TokenCacheContext, ISerializableTokenCache, AzureCloudInstance, AzureCloudOptions, IAppTokenProvider, AppTokenProviderParameters, AppTokenProviderResult, } from "@azure/msal-common";
42
- export { version } from "./packageMetadata.js";
1
+ /**
2
+ * @packageDocumentation
3
+ * @module @azure/msal-node
4
+ */
5
+ /**
6
+ * Warning: This set of exports is purely intended to be used by other MSAL libraries, and should be considered potentially unstable. We strongly discourage using them directly, you do so at your own risk.
7
+ * Breaking changes to these APIs will be shipped under a minor version, instead of a major version.
8
+ */
9
+ import * as internals from "./internals.js";
10
+ export { internals };
11
+ export { IPublicClientApplication } from "./client/IPublicClientApplication.js";
12
+ export { IConfidentialClientApplication } from "./client/IConfidentialClientApplication.js";
13
+ export { ITokenCache } from "./cache/ITokenCache.js";
14
+ export { ICacheClient } from "./cache/distributed/ICacheClient.js";
15
+ export { IPartitionManager } from "./cache/distributed/IPartitionManager.js";
16
+ export { ILoopbackClient } from "./network/ILoopbackClient.js";
17
+ export { PublicClientApplication } from "./client/PublicClientApplication.js";
18
+ export { ConfidentialClientApplication } from "./client/ConfidentialClientApplication.js";
19
+ export { ClientApplication } from "./client/ClientApplication.js";
20
+ export { ClientCredentialClient } from "./client/ClientCredentialClient.js";
21
+ export { DeviceCodeClient } from "./client/DeviceCodeClient.js";
22
+ export { OnBehalfOfClient } from "./client/OnBehalfOfClient.js";
23
+ export { UsernamePasswordClient } from "./client/UsernamePasswordClient.js";
24
+ export { Configuration, buildAppConfiguration, NodeAuthOptions, NodeSystemOptions, BrokerOptions, NodeTelemetryOptions, CacheOptions, } from "./config/Configuration.js";
25
+ export { ClientAssertion } from "./client/ClientAssertion.js";
26
+ export { TokenCache } from "./cache/TokenCache.js";
27
+ export { NodeStorage } from "./cache/NodeStorage.js";
28
+ export { CacheKVStore, JsonCache, InMemoryCache, SerializedAccountEntity, SerializedIdTokenEntity, SerializedAccessTokenEntity, SerializedAppMetadataEntity, SerializedRefreshTokenEntity, } from "./cache/serializer/SerializerTypes.js";
29
+ export { DistributedCachePlugin } from "./cache/distributed/DistributedCachePlugin.js";
30
+ export { CryptoProvider } from "./crypto/CryptoProvider.js";
31
+ export type { AuthorizationCodeRequest } from "./request/AuthorizationCodeRequest.js";
32
+ export type { AuthorizationUrlRequest } from "./request/AuthorizationUrlRequest.js";
33
+ export type { ClientCredentialRequest } from "./request/ClientCredentialRequest.js";
34
+ export type { DeviceCodeRequest } from "./request/DeviceCodeRequest.js";
35
+ export type { OnBehalfOfRequest } from "./request/OnBehalfOfRequest.js";
36
+ export type { UsernamePasswordRequest } from "./request/UsernamePasswordRequest.js";
37
+ export type { RefreshTokenRequest } from "./request/RefreshTokenRequest.js";
38
+ export type { SilentFlowRequest } from "./request/SilentFlowRequest.js";
39
+ export type { InteractiveRequest } from "./request/InteractiveRequest.js";
40
+ export type { SignOutRequest } from "./request/SignOutRequest.js";
41
+ export { PromptValue, ResponseMode, AuthorizationCodePayload, AuthenticationResult, ServerAuthorizationCodeResponse, IdTokenClaims, AccountInfo, ValidCacheType, AuthError, AuthErrorMessage, AuthErrorCodes, ClientAuthError, ClientAuthErrorCodes, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorCodes, ClientConfigurationErrorMessage, InteractionRequiredAuthError, InteractionRequiredAuthErrorCodes, InteractionRequiredAuthErrorMessage, ServerError, INetworkModule, NetworkRequestOptions, NetworkResponse, Logger, LogLevel, ProtocolMode, ICachePlugin, TokenCacheContext, ISerializableTokenCache, AzureCloudInstance, AzureCloudOptions, IAppTokenProvider, AppTokenProviderParameters, AppTokenProviderResult, INativeBrokerPlugin, } from "@azure/msal-common";
42
+ export { version } from "./packageMetadata.js";
43
43
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA;;;GAGG;AAEH;;;GAGG;AAEH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,CAAC;AAGrB,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EACH,aAAa,EACb,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,aAA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B,EAC7B,+BAA+B,EAC/B,4BAA4B,EAC5B,iCAAiC,EACjC,mCAAmC,EACnC,WAAW,EAEX,cAAc,EACd,qBAAqB,EACrB,eAAe,EAEf,MAAM,EACN,QAAQ,EAER,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EAEvB,kBAAkB,EAClB,iBAAiB,EAEjB,iBAAiB,EACjB,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,GACtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC"}
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
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 * as internals from './internals.mjs';
4
4
  export { internals };
@@ -1,17 +1,17 @@
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 Serializer = require('./cache/serializer/Serializer.cjs');
6
6
  var Deserializer = require('./cache/serializer/Deserializer.cjs');
7
7
 
8
- /*
9
- * Copyright (c) Microsoft Corporation. All rights reserved.
10
- * Licensed under the MIT License.
11
- */
12
- /**
13
- * Warning: This set of exports is purely intended to be used by other MSAL libraries, and should be considered potentially unstable. We strongly discourage using them directly, you do so at your own risk.
14
- * Breaking changes to these APIs will be shipped under a minor version, instead of a major version.
8
+ /*
9
+ * Copyright (c) Microsoft Corporation. All rights reserved.
10
+ * Licensed under the MIT License.
11
+ */
12
+ /**
13
+ * Warning: This set of exports is purely intended to be used by other MSAL libraries, and should be considered potentially unstable. We strongly discourage using them directly, you do so at your own risk.
14
+ * Breaking changes to these APIs will be shipped under a minor version, instead of a major version.
15
15
  */
16
16
 
17
17
  exports.Serializer = Serializer.Serializer;