@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
package/CHANGELOG.json CHANGED
@@ -1,6 +1,39 @@
1
1
  {
2
2
  "name": "@azure/msal-node",
3
3
  "entries": [
4
+ {
5
+ "date": "Tue, 09 Feb 2021 01:48:22 GMT",
6
+ "tag": "@azure/msal-node_v1.0.0-beta.6",
7
+ "version": "1.0.0-beta.6",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "comment": "Fix version.json import errors (#2993)",
12
+ "author": "thomas.norling@microsoft.com",
13
+ "commit": "6dc3bc9e2148bc53b181d9f079f6e11e0159620b",
14
+ "package": "@azure/msal-node"
15
+ },
16
+ {
17
+ "comment": "Ignore OIDC scopes during cache lookup or replacement (#2969)",
18
+ "author": "prkanher@microsoft.com",
19
+ "commit": "b113b562ffc33ad44b8d98417753db397256aadf",
20
+ "package": "@azure/msal-node"
21
+ },
22
+ {
23
+ "comment": "Set the validateStatus locally than globally for `axios` (#2959)",
24
+ "author": "sameera.gajjarapu@microsoft.com",
25
+ "commit": "55617cb8bc5289c29fd4357a16605b6720195cbc",
26
+ "package": "@azure/msal-node"
27
+ },
28
+ {
29
+ "comment": "Add API Extractor for msal-node",
30
+ "author": "sameera.gajjarapu@microsoft.com",
31
+ "commit": "01747296efdf08eefe585930097d9bbbf6b00789",
32
+ "package": "@azure/msal-node"
33
+ }
34
+ ]
35
+ }
36
+ },
4
37
  {
5
38
  "date": "Tue, 02 Feb 2021 01:56:47 GMT",
6
39
  "tag": "@azure/msal-node_v1.0.0-beta.5",
package/changelog.md CHANGED
@@ -1,9 +1,20 @@
1
1
  # Change Log - @azure/msal-node
2
2
 
3
- This log was last generated on Tue, 02 Feb 2021 01:56:47 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 09 Feb 2021 01:48:22 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.0.0-beta.6
8
+
9
+ Tue, 09 Feb 2021 01:48:22 GMT
10
+
11
+ ### Changes
12
+
13
+ - Fix version.json import errors (#2993) (thomas.norling@microsoft.com)
14
+ - Ignore OIDC scopes during cache lookup or replacement (#2969) (prkanher@microsoft.com)
15
+ - Set the validateStatus locally than globally for `axios` (#2959) (sameera.gajjarapu@microsoft.com)
16
+ - Add API Extractor for msal-node (sameera.gajjarapu@microsoft.com)
17
+
7
18
  ## 1.0.0-beta.5
8
19
 
9
20
  Tue, 02 Feb 2021 01:56:47 GMT
@@ -1,7 +1,16 @@
1
1
  import { AccountInfo } from "@azure/msal-common";
2
+ /**
3
+ * Token cache interface for the client, giving access to cache APIs
4
+ * @public
5
+ */
2
6
  export interface ITokenCache {
7
+ /** API that retrieves all accounts currently in cache to the user */
3
8
  getAllAccounts(): Promise<AccountInfo[]>;
9
+ /** Returns the signed in account matching homeAccountId */
4
10
  getAccountByHomeId(homeAccountId: string): Promise<AccountInfo | null>;
11
+ /** Returns the signed in account matching localAccountId */
5
12
  getAccountByLocalId(localAccountId: string): Promise<AccountInfo | null>;
13
+ /** API to remove a specific account and the relevant data from cache */
6
14
  removeAccount(account: AccountInfo): Promise<void>;
7
15
  }
16
+ //# sourceMappingURL=ITokenCache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITokenCache.d.ts","sourceRoot":"","sources":["../src/cache/ITokenCache.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAExB,qEAAqE;IACrE,cAAc,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAEzC,2DAA2D;IAC3D,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAEvE,4DAA4D;IAC5D,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAEzE,wEAAwE;IACxE,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD"}
@@ -2,22 +2,30 @@ import { AccountEntity, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, Ap
2
2
  import { InMemoryCache, JsonCache, CacheKVStore } from "./serializer/SerializerTypes";
3
3
  /**
4
4
  * This class implements Storage for node, reading cache from user specified storage location or an extension library
5
+ * @public
5
6
  */
6
- export declare class Storage extends CacheManager {
7
+ export declare class NodeStorage extends CacheManager {
7
8
  private logger;
8
9
  private cache;
9
10
  private changeEmitters;
10
11
  constructor(logger: Logger, clientId: string, cryptoImpl: ICrypto);
12
+ /**
13
+ * Queue up callbacks
14
+ * @param func - a callback function for cache change indication
15
+ */
11
16
  registerChangeEmitter(func: () => void): void;
17
+ /**
18
+ * Invoke the callback when cache changes
19
+ */
12
20
  emitChange(): void;
13
21
  /**
14
22
  * Converts cacheKVStore to InMemoryCache
15
- * @param cache
23
+ * @param cache - key value store
16
24
  */
17
25
  cacheToInMemoryCache(cache: CacheKVStore): InMemoryCache;
18
26
  /**
19
27
  * converts inMemoryCache to CacheKVStore
20
- * @param inMemoryCache
28
+ * @param inMemoryCache - kvstore map for inmemory
21
29
  */
22
30
  inMemoryCacheToCache(inMemoryCache: InMemoryCache): CacheKVStore;
23
31
  /**
@@ -26,7 +34,7 @@ export declare class Storage extends CacheManager {
26
34
  getInMemoryCache(): InMemoryCache;
27
35
  /**
28
36
  * sets the current in memory cache for the client
29
- * @param inMemoryCache
37
+ * @param inMemoryCache - key value map in memory
30
38
  */
31
39
  setInMemoryCache(inMemoryCache: InMemoryCache): void;
32
40
  /**
@@ -35,84 +43,84 @@ export declare class Storage extends CacheManager {
35
43
  getCache(): CacheKVStore;
36
44
  /**
37
45
  * sets the current cache (key value store)
38
- * @param cacheMap
46
+ * @param cacheMap - key value map
39
47
  */
40
48
  setCache(cache: CacheKVStore): void;
41
49
  /**
42
50
  * Gets cache item with given key.
43
- * @param key
51
+ * @param key - lookup key for the cache entry
44
52
  */
45
53
  getItem(key: string): ValidCacheType;
46
54
  /**
47
- * Gets cache item with given <key, value>
48
- * @param key
49
- * @param value
55
+ * Gets cache item with given key-value
56
+ * @param key - lookup key for the cache entry
57
+ * @param value - value of the cache entry
50
58
  */
51
59
  setItem(key: string, value: ValidCacheType): void;
52
60
  /**
53
61
  * fetch the account entity
54
- * @param accountKey
62
+ * @param accountKey - lookup key to fetch cache type AccountEntity
55
63
  */
56
64
  getAccount(accountKey: string): AccountEntity | null;
57
65
  /**
58
66
  * set account entity
59
- * @param account
67
+ * @param account - cache value to be set of type AccountEntity
60
68
  */
61
69
  setAccount(account: AccountEntity): void;
62
70
  /**
63
71
  * fetch the idToken credential
64
- * @param idTokenKey
72
+ * @param idTokenKey - lookup key to fetch cache type IdTokenEntity
65
73
  */
66
74
  getIdTokenCredential(idTokenKey: string): IdTokenEntity | null;
67
75
  /**
68
76
  * set idToken credential
69
- * @param idToken
77
+ * @param idToken - cache value to be set of type IdTokenEntity
70
78
  */
71
79
  setIdTokenCredential(idToken: IdTokenEntity): void;
72
80
  /**
73
81
  * fetch the accessToken credential
74
- * @param accessTokenKey
82
+ * @param accessTokenKey - lookup key to fetch cache type AccessTokenEntity
75
83
  */
76
84
  getAccessTokenCredential(accessTokenKey: string): AccessTokenEntity | null;
77
85
  /**
78
86
  * set accessToken credential
79
- * @param accessToken
87
+ * @param accessToken - cache value to be set of type AccessTokenEntity
80
88
  */
81
89
  setAccessTokenCredential(accessToken: AccessTokenEntity): void;
82
90
  /**
83
91
  * fetch the refreshToken credential
84
- * @param refreshTokenKey
92
+ * @param refreshTokenKey - lookup key to fetch cache type RefreshTokenEntity
85
93
  */
86
94
  getRefreshTokenCredential(refreshTokenKey: string): RefreshTokenEntity | null;
87
95
  /**
88
96
  * set refreshToken credential
89
- * @param refreshToken
97
+ * @param refreshToken - cache value to be set of type RefreshTokenEntity
90
98
  */
91
99
  setRefreshTokenCredential(refreshToken: RefreshTokenEntity): void;
92
100
  /**
93
101
  * fetch appMetadata entity from the platform cache
94
- * @param appMetadataKey
102
+ * @param appMetadataKey - lookup key to fetch cache type AppMetadataEntity
95
103
  */
96
104
  getAppMetadata(appMetadataKey: string): AppMetadataEntity | null;
97
105
  /**
98
106
  * set appMetadata entity to the platform cache
99
- * @param appMetadata
107
+ * @param appMetadata - cache value to be set of type AppMetadataEntity
100
108
  */
101
109
  setAppMetadata(appMetadata: AppMetadataEntity): void;
102
110
  /**
103
111
  * fetch server telemetry entity from the platform cache
104
- * @param serverTelemetrykey
112
+ * @param serverTelemetrykey - lookup key to fetch cache type ServerTelemetryEntity
105
113
  */
106
114
  getServerTelemetry(serverTelemetrykey: string): ServerTelemetryEntity | null;
107
115
  /**
108
116
  * set server telemetry entity to the platform cache
109
- * @param serverTelemetryKey
110
- * @param serverTelemetry
117
+ * @param serverTelemetryKey - lookup key to fetch cache type ServerTelemetryEntity
118
+ * @param serverTelemetry - cache value to be set of type ServerTelemetryEntity
111
119
  */
112
120
  setServerTelemetry(serverTelemetryKey: string, serverTelemetry: ServerTelemetryEntity): void;
113
121
  /**
114
122
  * fetch authority metadata entity from the platform cache
115
- * @param key
123
+ * @param key - lookup key to fetch cache type AuthorityMetadataEntity
116
124
  */
117
125
  getAuthorityMetadata(key: string): AuthorityMetadataEntity | null;
118
126
  /**
@@ -121,30 +129,30 @@ export declare class Storage extends CacheManager {
121
129
  getAuthorityMetadataKeys(): Array<string>;
122
130
  /**
123
131
  * set authority metadata entity to the platform cache
124
- * @param key
125
- * @param metadata
132
+ * @param key - lookup key to fetch cache type AuthorityMetadataEntity
133
+ * @param metadata - cache value to be set of type AuthorityMetadataEntity
126
134
  */
127
135
  setAuthorityMetadata(key: string, metadata: AuthorityMetadataEntity): void;
128
136
  /**
129
137
  * fetch throttling entity from the platform cache
130
- * @param throttlingCacheKey
138
+ * @param throttlingCacheKey - lookup key to fetch cache type ThrottlingEntity
131
139
  */
132
140
  getThrottlingCache(throttlingCacheKey: string): ThrottlingEntity | null;
133
141
  /**
134
142
  * set throttling entity to the platform cache
135
- * @param throttlingCacheKey
136
- * @param throttlingCache
143
+ * @param throttlingCacheKey - lookup key to fetch cache type ThrottlingEntity
144
+ * @param throttlingCache - cache value to be set of type ThrottlingEntity
137
145
  */
138
146
  setThrottlingCache(throttlingCacheKey: string, throttlingCache: ThrottlingEntity): void;
139
147
  /**
140
148
  * Removes the cache item from memory with the given key.
141
- * @param key
142
- * @param inMemory
149
+ * @param key - lookup key to remove a cache entity
150
+ * @param inMemory - key value map of the cache
143
151
  */
144
152
  removeItem(key: string): boolean;
145
153
  /**
146
154
  * Checks whether key is in cache.
147
- * @param key
155
+ * @param key - look up key for a cache entity
148
156
  */
149
157
  containsKey(key: string): boolean;
150
158
  /**
@@ -157,12 +165,13 @@ export declare class Storage extends CacheManager {
157
165
  clear(): void;
158
166
  /**
159
167
  * Initialize in memory cache from an exisiting cache vault
160
- * @param cache
168
+ * @param cache - blob formatted cache (JSON)
161
169
  */
162
170
  static generateInMemoryCache(cache: string): InMemoryCache;
163
171
  /**
164
172
  * retrieves the final JSON
165
- * @param inMemoryCache
173
+ * @param inMemoryCache - itemised cache read from the JSON
166
174
  */
167
175
  static generateJsonCache(inMemoryCache: InMemoryCache): JsonCache;
168
176
  }
177
+ //# sourceMappingURL=NodeStorage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeStorage.d.ts","sourceRoot":"","sources":["../src/cache/NodeStorage.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,cAAc,EACd,OAAO,EACP,uBAAuB,EAC1B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AA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AG,SAAS;CAGpE"}
@@ -1,9 +1,10 @@
1
- import { Storage } from "./Storage";
1
+ import { NodeStorage } from "./NodeStorage";
2
2
  import { AccountInfo, Logger, ISerializableTokenCache, ICachePlugin } from "@azure/msal-common";
3
3
  import { CacheKVStore } from "./serializer/SerializerTypes";
4
4
  import { ITokenCache } from "./ITokenCache";
5
5
  /**
6
6
  * In-memory token cache manager
7
+ * @public
7
8
  */
8
9
  export declare class TokenCache implements ISerializableTokenCache, ITokenCache {
9
10
  private storage;
@@ -11,7 +12,7 @@ export declare class TokenCache implements ISerializableTokenCache, ITokenCache
11
12
  private cacheSnapshot;
12
13
  private readonly persistence;
13
14
  private logger;
14
- constructor(storage: Storage, logger: Logger, cachePlugin?: ICachePlugin);
15
+ constructor(storage: NodeStorage, logger: Logger, cachePlugin?: ICachePlugin);
15
16
  /**
16
17
  * Set to true if cache state has changed since last time serialize or writeToPersistence was called
17
18
  */
@@ -22,9 +23,12 @@ export declare class TokenCache implements ISerializableTokenCache, ITokenCache
22
23
  serialize(): string;
23
24
  /**
24
25
  * Deserializes JSON to in-memory cache. JSON should be in MSAL cache schema format
25
- * @param cache
26
+ * @param cache - blob formatted cache
26
27
  */
27
28
  deserialize(cache: string): void;
29
+ /**
30
+ * Fetches the cache key-value map
31
+ */
28
32
  getKVStore(): CacheKVStore;
29
33
  /**
30
34
  * API that retrieves all accounts currently in cache to the user
@@ -34,19 +38,19 @@ export declare class TokenCache implements ISerializableTokenCache, ITokenCache
34
38
  * Returns the signed in account matching homeAccountId.
35
39
  * (the account object is created at the time of successful login)
36
40
  * or null when no matching account is found
37
- * @returns {@link AccountInfo} - the account object stored in MSAL
41
+ * @param homeAccountId - unique identifier for an account (uid.utid)
38
42
  */
39
43
  getAccountByHomeId(homeAccountId: string): Promise<AccountInfo | null>;
40
44
  /**
41
45
  * Returns the signed in account matching localAccountId.
42
46
  * (the account object is created at the time of successful login)
43
47
  * or null when no matching account is found
44
- * @returns {@link AccountInfo} - the account object stored in MSAL
48
+ * @param localAccountId - unique identifier of an account (sub/obj when homeAccountId cannot be populated)
45
49
  */
46
50
  getAccountByLocalId(localAccountId: string): Promise<AccountInfo | null>;
47
51
  /**
48
52
  * API to remove a specific account and the relevant data from cache
49
- * @param account
53
+ * @param account - AccountInfo passed by the user
50
54
  */
51
55
  removeAccount(account: AccountInfo): Promise<void>;
52
56
  /**
@@ -55,23 +59,33 @@ export declare class TokenCache implements ISerializableTokenCache, ITokenCache
55
59
  private handleChangeEvent;
56
60
  /**
57
61
  * Merge in memory cache with the cache snapshot.
58
- * @param oldState
59
- * @param currentState
62
+ * @param oldState - cache before changes
63
+ * @param currentState - current cache state in the library
60
64
  */
61
65
  private mergeState;
62
66
  /**
63
67
  * Deep update of oldState based on newState values
64
- * @param oldState
65
- * @param newState
68
+ * @param oldState - cache before changes
69
+ * @param newState - updated cache
66
70
  */
67
71
  private mergeUpdates;
68
72
  /**
69
73
  * Removes entities in oldState that the were removed from newState. If there are any unknown values in root of
70
74
  * oldState that are not recognized, they are left untouched.
71
- * @param oldState
72
- * @param newState
75
+ * @param oldState - cache before changes
76
+ * @param newState - updated cache
73
77
  */
74
78
  private mergeRemovals;
79
+ /**
80
+ * Helper to merge new cache with the old one
81
+ * @param oldState - cache before changes
82
+ * @param newState - updated cache
83
+ */
75
84
  private mergeRemovalsDict;
85
+ /**
86
+ * Helper to overlay as a part of cache merge
87
+ * @param passedInCache - cache read from the blob
88
+ */
76
89
  private overlayDefaults;
77
90
  }
91
+ //# sourceMappingURL=TokenCache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TokenCache.d.ts","sourceRoot":"","sources":["../src/cache/TokenCache.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAA8B,WAAW,EAAE,MAAM,EAAE,uBAAuB,EAAE,YAAY,EAAqB,MAAM,oBAAoB,CAAC;AAC/I,OAAO,EAAsK,YAAY,EAAE,MAAM,8BAA8B,C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ceMappingURL=Deserializer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Deserializer.d.ts","sourceRoot":"","sources":["../../src/cache/serializer/Deserializer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAe,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAwG,MAAM,oBAAoB,CAAC;AAC1O,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEvM;;GAEG;AACH,qBAAa,YAAY;IACrB;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS;IAOvD;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,GAAG,YAAY;IA0B3F;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,GAAG,YAAY;IAqB3F;;;OAGG;IACH,MAAM,CAAC,uBAAuB,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,GAAG,gBAAgB;IA6B3G;;;OAGG;IACH,MAAM,CAAC,wBAAwB,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC,GAAG,iBAAiB;IAwB/G;;;OAGG;IACH,MAAM,CAAC,sBAAsB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,GAAG,gBAAgB;IAmBzG;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,aAAa;CAmBlE"}
@@ -37,3 +37,4 @@ export declare class Serializer {
37
37
  */
38
38
  static serializeAllCache(inMemCache: InMemoryCache): JsonCache;
39
39
  }
40
+ //# sourceMappingURL=Serializer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Serializer.d.ts","sourceRoot":"","sources":["../../src/cache/serializer/Serializer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACvH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEvM,qBAAa,UAAU;IACnB;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM;IAIjD;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC;IAqBzF;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC;IAiBzF;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC;IAwBpG;;;OAGG;IACH,MAAM,CAAC,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC;IAmBvG;;;OAGG;IACH,MAAM,CAAC,oBAAoB,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC;IAcrG;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,UAAU,EAAE,aAAa,GAAG,SAAS;CASjE"}
@@ -1,5 +1,13 @@
1
1
  import { AccountCache, IdTokenCache, AccessTokenCache, RefreshTokenCache, AppMetadataCache, ValidCacheType } from "@azure/msal-common";
2
+ /**
3
+ * Key value store for in-memory cache
4
+ * @public
5
+ */
2
6
  export declare type CacheKVStore = Record<string, ValidCacheType>;
7
+ /**
8
+ * Cache format read from the cache blob provided to the configuration during app instantiation
9
+ * @public
10
+ */
3
11
  export declare type JsonCache = {
4
12
  Account: Record<string, SerializedAccountEntity>;
5
13
  IdToken: Record<string, SerializedIdTokenEntity>;
@@ -7,6 +15,10 @@ export declare type JsonCache = {
7
15
  RefreshToken: Record<string, SerializedRefreshTokenEntity>;
8
16
  AppMetadata: Record<string, SerializedAppMetadataEntity>;
9
17
  };
18
+ /**
19
+ * Intermittent type to handle in-memory data objects with defined types
20
+ * @public
21
+ */
10
22
  export declare type InMemoryCache = {
11
23
  accounts: AccountCache;
12
24
  idTokens: IdTokenCache;
@@ -14,6 +26,10 @@ export declare type InMemoryCache = {
14
26
  refreshTokens: RefreshTokenCache;
15
27
  appMetadata: AppMetadataCache;
16
28
  };
29
+ /**
30
+ * Account type
31
+ * @public
32
+ */
17
33
  export declare type SerializedAccountEntity = {
18
34
  home_account_id: string;
19
35
  environment: string;
@@ -26,6 +42,10 @@ export declare type SerializedAccountEntity = {
26
42
  last_modification_time?: string;
27
43
  last_modification_app?: string;
28
44
  };
45
+ /**
46
+ * Idtoken credential type
47
+ * @public
48
+ */
29
49
  export declare type SerializedIdTokenEntity = {
30
50
  home_account_id: string;
31
51
  environment: string;
@@ -34,6 +54,10 @@ export declare type SerializedIdTokenEntity = {
34
54
  secret: string;
35
55
  realm: string;
36
56
  };
57
+ /**
58
+ * Access token credential type
59
+ * @public
60
+ */
37
61
  export declare type SerializedAccessTokenEntity = {
38
62
  home_account_id: string;
39
63
  environment: string;
@@ -49,6 +73,10 @@ export declare type SerializedAccessTokenEntity = {
49
73
  key_id?: string;
50
74
  token_type?: string;
51
75
  };
76
+ /**
77
+ * Refresh token credential type
78
+ * @public
79
+ */
52
80
  export declare type SerializedRefreshTokenEntity = {
53
81
  home_account_id: string;
54
82
  environment: string;
@@ -59,8 +87,13 @@ export declare type SerializedRefreshTokenEntity = {
59
87
  target?: string;
60
88
  realm?: string;
61
89
  };
90
+ /**
91
+ * AppMetadata type
92
+ * @public
93
+ */
62
94
  export declare type SerializedAppMetadataEntity = {
63
95
  client_id: string;
64
96
  environment: string;
65
97
  family_id?: string;
66
98
  };
99
+ //# sourceMappingURL=SerializerTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SerializerTypes.d.ts","sourceRoot":"","sources":["../../src/cache/serializer/SerializerTypes.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEvI;;;GAGG;AACH,oBAAY,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAE1D;;;GAGG;AACH,oBAAY,SAAS,GAAG;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;IACjD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;IACjD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;IACzD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC;IAC3D,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;CAC5D,CAAC;AAEF;;;GAGG;AACH,oBAAY,aAAa,GAAG;IACxB,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,YAAY,CAAC;IACvB,YAAY,EAAE,gBAAgB,CAAC;IAC/B,aAAa,EAAE,iBAAiB,CAAC;IACjC,WAAW,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF;;;GAGG;AACH,oBAAY,uBAAuB,GAAG;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE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;CAClB,CAAC;AAEF;;;GAGG;AACH,oBAAY,2BAA2B,GAAG;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
@@ -1,19 +1,38 @@
1
1
  import { ClientConfiguration, AuthenticationResult, BaseAuthRequest, Logger, ServerTelemetryManager } from "@azure/msal-common";
2
2
  import { Configuration } from "../config/Configuration";
3
- import { Storage } from "../cache/Storage";
3
+ import { NodeStorage } from "../cache/NodeStorage";
4
4
  import { TokenCache } from "../cache/TokenCache";
5
5
  import { ClientAssertion } from "./ClientAssertion";
6
6
  import { AuthorizationUrlRequest } from "../request/AuthorizationUrlRequest";
7
7
  import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest";
8
8
  import { RefreshTokenRequest } from "../request/RefreshTokenRequest";
9
9
  import { SilentFlowRequest } from "../request/SilentFlowRequest";
10
+ /**
11
+ * Base abstract class for all ClientApplications - public and confidential
12
+ * @public
13
+ */
10
14
  export declare abstract class ClientApplication {
11
15
  private readonly cryptoProvider;
12
- protected storage: Storage;
13
16
  private tokenCache;
17
+ /**
18
+ * Platform storage object
19
+ */
20
+ protected storage: NodeStorage;
21
+ /**
22
+ * Logger object to log the application flow
23
+ */
14
24
  protected logger: Logger;
25
+ /**
26
+ * Platform configuration initialized by the application
27
+ */
15
28
  protected config: Configuration;
29
+ /**
30
+ * Client assertion passed by the user for confidential client flows
31
+ */
16
32
  protected clientAssertion: ClientAssertion;
33
+ /**
34
+ * Client secret passed by the user for confidential client flows
35
+ */
17
36
  protected clientSecret: string;
18
37
  /**
19
38
  * Constructor for the ClientApplication
@@ -65,21 +84,33 @@ export declare abstract class ClientApplication {
65
84
  getLogger(): Logger;
66
85
  /**
67
86
  * Replaces the default logger set in configurations with new Logger with new configurations
68
- * @param logger Logger instance
87
+ * @param logger - Logger instance
69
88
  */
70
89
  setLogger(logger: Logger): void;
90
+ /**
91
+ * Builds the common configuration to be passed to the common component based on the platform configurarion
92
+ * @param authority - user passed authority in configuration
93
+ * @param serverTelemetryManager - initializes servertelemetry if passed
94
+ */
71
95
  protected buildOauthClientConfiguration(authority: string, serverTelemetryManager?: ServerTelemetryManager): Promise<ClientConfiguration>;
72
96
  private getClientAssertion;
73
97
  /**
74
98
  * Generates a request with the default scopes & generates a correlationId.
75
- * @param authRequest
99
+ * @param authRequest - BaseAuthRequest for initialization
76
100
  */
77
101
  protected initializeBaseRequest(authRequest: Partial<BaseAuthRequest>): BaseAuthRequest;
102
+ /**
103
+ * Initializes the server telemetry payload
104
+ * @param apiId - Id for a specific request
105
+ * @param correlationId - GUID
106
+ * @param forceRefresh - boolean to indicate network call
107
+ */
78
108
  protected initializeServerTelemetryManager(apiId: number, correlationId: string, forceRefresh?: boolean): ServerTelemetryManager;
79
109
  /**
80
110
  * Create authority instance. If authority not passed in request, default to authority set on the application
81
111
  * object. If no authority set in application object, then default to common authority.
82
- * @param authorityString
112
+ * @param authorityString - authority from user configuration
83
113
  */
84
114
  private createAuthority;
85
115
  }
116
+ //# sourceMappingURL=ClientApplication.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientApplication.d.ts","sourceRoot":"","sources":["../src/client/ClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,mBAAmB,EAEnB,oBAAoB,EAGpB,eAAe,EAEf,MAAM,EACN,sBAAsB,EAUzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAyB,MAAM,yBAAyB,CAAC;AAE/E,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE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G;IACH,SAAS,CAAC,qBAAqB,CAAC,WAAW,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe;IAWvF;;;;;OAKG;IACH,SAAS,CAAC,gCAAgC,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,sBAAsB;IAWhI;;;;OAIG;YACW,eAAe;CAUhC"}
@@ -1,6 +1,7 @@
1
1
  import { CryptoProvider } from "../crypto/CryptoProvider";
2
2
  /**
3
3
  * Client assertion of type jwt-bearer used in confidential client flows
4
+ * @public
4
5
  */
5
6
  export declare class ClientAssertion {
6
7
  private jwt;
@@ -10,14 +11,37 @@ export declare class ClientAssertion {
10
11
  private issuer;
11
12
  private jwtAudience;
12
13
  private publicCertificate;
14
+ /**
15
+ * Initialize the ClientAssertion class from the clientAssertion passed by the user
16
+ * @param assertion - refer https://tools.ietf.org/html/rfc7521
17
+ */
13
18
  static fromAssertion(assertion: string): ClientAssertion;
19
+ /**
20
+ * Initialize the ClientAssertion class from the certificate passed by the user
21
+ * @param thumbprint - identifier of a certificate
22
+ * @param privateKey - secret key
23
+ * @param publicCertificate - electronic document provided to prove the ownership of the public key
24
+ */
14
25
  static fromCertificate(thumbprint: string, privateKey: string, publicCertificate?: string): ClientAssertion;
26
+ /**
27
+ * Update JWT for certificate based clientAssertion, if passed by the user, uses it as is
28
+ * @param cryptoProvider - library's crypto helper
29
+ * @param issuer - iss claim
30
+ * @param jwtAudience - aud claim
31
+ */
15
32
  getJwt(cryptoProvider: CryptoProvider, issuer: string, jwtAudience: string): string;
33
+ /**
34
+ * JWT format and required claims specified: https://tools.ietf.org/html/rfc7523#section-3
35
+ */
16
36
  private createJwt;
37
+ /**
38
+ * Utility API to check expiration
39
+ */
17
40
  private isExpired;
18
41
  /**
19
42
  * Extracts the raw certs from a given certificate string and returns them in an array.
20
- * @param publicCertificate
43
+ * @param publicCertificate - electronic document provided to prove the ownership of the public key
21
44
  */
22
45
  static parseCertificate(publicCertificate: string): Array<string>;
23
46
  }
47
+ //# sourceMappingURL=ClientAssertion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientAssertion.d.ts","sourceRoot":"","sources":["../src/client/ClientAssertion.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI1D;;;GAGG;AACH,qBAAa,eAAe;IAExB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,iBAAiB,CAAgB;IAEzC;;;OAGG;WACW,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe;IAM/D;;;;;OAKG;WACW,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,GAAG,eAAe;IAUlH;;;;;OAKG;IACI,MAAM,CAAC,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAsBjF;;OAEG;IACH,OAAO,CAAC,SAAS;IA+BjB;;OAEG;IACH,OAAO,CAAC,SAAS;IAIjB;;;OAGG;WACW,gBAAgB,CAAC,iBAAiB,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;CAmB3E"}