Skip to content

Commit b9d7921

Browse files
authored
Merge pull request #52 from pnp/spshooter-with-executescript
SP Shooter with executescript & deps update
2 parents bcf3783 + 312ae7d commit b9d7921

File tree

249 files changed

+17694
-12819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+17694
-12819
lines changed

iframe-sandbox-app/src/popup/PopUp.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ const PopUp = () => {
3434
target: { tabId: tabs[0].id },
3535
world: 'MAIN',
3636
func: () => {
37-
return (window as any)._spPageContextInfo || (window as any).moduleLoaderPromise.then((e: any) => {
37+
return (window as any)._spPageContextInfo || ((window as any).moduleLoaderPromise ? (window as any).moduleLoaderPromise.then((e: any) => {
3838
return (window as any)._spPageContextInfo = e.context._pageContext._legacyPageContext;
39-
})
39+
}) : null);
4040
},
4141
}).then(injectionResults => {
4242
if (injectionResults[0].result) {

package-lock.json

Lines changed: 259 additions & 221 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
{
22
"name": "sp-editor",
3-
"version": "6.6.0",
3+
"version": "6.6.1",
44
"private": true,
55
"homepage": ".",
66
"dependencies": {
7-
"@azure/msal-browser": "^2.32.2",
8-
"@azure/msal-react": "^1.5.2",
9-
"@fluentui/date-time-utilities": "^8.5.4",
10-
"@fluentui/react": "^8.104.8",
7+
"@azure/msal-browser": "^2.37.0",
8+
"@azure/msal-react": "^1.5.7",
9+
"@fluentui/date-time-utilities": "^8.5.10",
10+
"@fluentui/react": "^8.109.2",
1111
"@ionic/react": "^5.8.4",
1212
"@ionic/react-router": "^5.8.4",
13-
"@microsoft/mgt": "^2.9.0",
14-
"@microsoft/mgt-react": "^2.9.0",
15-
"@microsoft/microsoft-graph-client": "^3.0.4",
13+
"@microsoft/mgt": "^2.10.1",
14+
"@microsoft/mgt-react": "^2.10.1",
15+
"@microsoft/microsoft-graph-client": "^3.0.5",
1616
"@minoru/react-dnd-treeview": "^3.4.0",
1717
"@uifabric/theme-samples": "^7.5.29",
18-
"gsap": "^3.11.3",
18+
"gsap": "^3.11.5",
1919
"gulp-remove-line": "^1.0.4",
2020
"ionicons": "^6.0.4",
21-
"monaco-editor": "^0.34.1",
21+
"monaco-editor": "^0.36.1",
2222
"react": "^17.0.2",
2323
"react-dom": "^17.0.2",
2424
"react-live": "^2.3.0",
2525
"react-redux": "^7.2.6",
2626
"react-router-dom": "^5.3.0",
2727
"react-scripts": "^4.0.3",
28-
"redux": "^4.2.0",
28+
"redux": "^4.2.1",
2929
"redux-thunk": "^2.4.2",
3030
"textarea-caret": "^3.1.0",
3131
"typesafe-actions": "^5.1.0",
@@ -52,14 +52,14 @@
5252
]
5353
},
5454
"devDependencies": {
55-
"@pnp/core": "^3.11.0",
56-
"@pnp/graph": "^3.11.0",
57-
"@pnp/logging": "^3.11.0",
58-
"@pnp/msaljsclient": "^3.11.0",
59-
"@pnp/nodejs": "^3.11.0",
60-
"@pnp/queryable": "^3.11.0",
61-
"@pnp/sp": "^3.11.0",
62-
"@pnp/sp-admin": "^3.11.0",
55+
"@pnp/core": "^3.14.0",
56+
"@pnp/graph": "^3.14.0",
57+
"@pnp/logging": "^3.14.0",
58+
"@pnp/msaljsclient": "^3.14.0",
59+
"@pnp/nodejs": "^3.14.0",
60+
"@pnp/queryable": "^3.14.0",
61+
"@pnp/sp": "^3.14.0",
62+
"@pnp/sp-admin": "^3.14.0",
6363
"@types/chrome": "0.0.204",
6464
"@types/jest": "29.2.4",
6565
"@types/jscodeshift": "^0.11.6",

public/@azure/msal-browser/app/ClientApplication.d.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ export declare abstract class ClientApplication {
3636
private hybridAuthCodeResponses;
3737
protected performanceClient: IPerformanceClient;
3838
protected initialized: boolean;
39+
private ssoSilentMeasurement?;
40+
private acquireTokenByCodeAsyncMeasurement?;
3941
/**
4042
* @constructor
4143
* Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object
@@ -88,6 +90,7 @@ export declare abstract class ClientApplication {
8890
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
8991
*/
9092
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
93+
private trackPageVisibilityWithMeasurement;
9194
/**
9295
* This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:
9396
* - Any browser using a form of Intelligent Tracking Prevention
@@ -171,10 +174,10 @@ export declare abstract class ClientApplication {
171174
* (the account object is created at the time of successful login)
172175
* or null when no matching account is found.
173176
* This API is provided for convenience but getAccountById should be used for best reliability
174-
* @param userName
177+
* @param username
175178
* @returns The account object stored in MSAL
176179
*/
177-
getAccountByUsername(userName: string): AccountInfo | null;
180+
getAccountByUsername(username: string): AccountInfo | null;
178181
/**
179182
* Returns the signed in account matching homeAccountId.
180183
* (the account object is created at the time of successful login)

public/@azure/msal-browser/app/PublicClientApplication.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { SilentRequest } from "../request/SilentRequest";
1111
*/
1212
export declare class PublicClientApplication extends ClientApplication implements IPublicClientApplication {
1313
private activeSilentTokenRequests;
14+
private astsAsyncMeasurement?;
1415
/**
1516
* @constructor
1617
* Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object
@@ -58,6 +59,7 @@ export declare class PublicClientApplication extends ClientApplication implement
5859
* @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse} object
5960
*/
6061
acquireTokenSilent(request: SilentRequest): Promise<AuthenticationResult>;
62+
private trackPageVisibility;
6163
/**
6264
* Silently acquire an access token for a given set of scopes. Will use cached token if available, otherwise will attempt to acquire a new token from the network via refresh token.
6365
* @param {@link (SilentRequest:type)}

public/@azure/msal-browser/broker/nativeBroker/NativeMessageHandler.d.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
1-
import { Logger, AuthenticationScheme } from "@azure/msal-common";
1+
import { Logger, AuthenticationScheme, IPerformanceClient } from "@azure/msal-common";
22
import { NativeExtensionRequestBody } from "./NativeRequest";
33
import { BrowserConfiguration } from "../../config/Configuration";
44
export declare class NativeMessageHandler {
55
private extensionId;
66
private extensionVersion;
77
private logger;
8-
private handshakeTimeoutMs;
8+
private readonly handshakeTimeoutMs;
99
private responseId;
1010
private timeoutId;
1111
private resolvers;
1212
private handshakeResolvers;
1313
private messageChannel;
14-
private windowListener;
15-
constructor(logger: Logger, handshakeTimeoutMs: number, extensionId?: string);
14+
private readonly windowListener;
15+
private readonly performanceClient;
16+
private readonly handshakeEvent;
17+
constructor(logger: Logger, handshakeTimeoutMs: number, performanceClient: IPerformanceClient, extensionId?: string);
1618
/**
1719
* Sends a given message to the extension and resolves with the extension response
1820
* @param body
1921
*/
2022
sendMessage(body: NativeExtensionRequestBody): Promise<object>;
2123
/**
2224
* Returns an instance of the MessageHandler that has successfully established a connection with an extension
23-
* @param logger
24-
* @param handshakeTimeoutMs
25+
* @param {Logger} logger
26+
* @param {number} handshakeTimeoutMs
27+
* @param {IPerformanceClient} performanceClient
2528
*/
26-
static createProvider(logger: Logger, handshakeTimeoutMs: number): Promise<NativeMessageHandler>;
29+
static createProvider(logger: Logger, handshakeTimeoutMs: number, performanceClient: IPerformanceClient): Promise<NativeMessageHandler>;
2730
/**
2831
* Send handshake request helper.
2932
*/

public/@azure/msal-browser/cache/BrowserCacheManager.d.ts

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CommonAuthorizationCodeRequest, ICrypto, AccountEntity, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, CacheManager, ServerTelemetryEntity, ThrottlingEntity, Logger, AuthorityMetadataEntity, AccountInfo, ValidCredentialType } from "@azure/msal-common";
1+
import { CommonAuthorizationCodeRequest, ICrypto, AccountEntity, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, CacheManager, ServerTelemetryEntity, ThrottlingEntity, Logger, AuthorityMetadataEntity, AccountInfo, ValidCredentialType, TokenKeys, CredentialType } from "@azure/msal-common";
22
import { CacheOptions } from "../config/Configuration";
33
import { BrowserCacheLocation, InteractionType } from "../utils/BrowserConstants";
44
import { MemoryStorage } from "./MemoryStorage";
@@ -23,10 +23,11 @@ export declare class BrowserCacheManager extends CacheManager {
2323
*/
2424
protected setupBrowserStorage(cacheLocation: BrowserCacheLocation | string): IWindowStorage<string>;
2525
/**
26-
*
26+
* Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured temporaryCacheLocation.
27+
* @param temporaryCacheLocation
2728
* @param cacheLocation
2829
*/
29-
protected setupTemporaryCacheStorage(cacheLocation: BrowserCacheLocation | string): IWindowStorage<string>;
30+
protected setupTemporaryCacheStorage(temporaryCacheLocation: BrowserCacheLocation | string, cacheLocation: BrowserCacheLocation | string): IWindowStorage<string>;
3031
/**
3132
* Migrate all old cache entries to new schema. No rollback supported.
3233
* @param storeAuthStateInCookie
@@ -39,6 +40,12 @@ export declare class BrowserCacheManager extends CacheManager {
3940
* @param storeAuthStateInCookie
4041
*/
4142
protected migrateCacheEntry(newKey: string, value: string | null): void;
43+
/**
44+
* Searches all cache entries for MSAL accounts and creates the account key map
45+
* This is used to migrate users from older versions of MSAL which did not create the map.
46+
* @returns
47+
*/
48+
private createKeyMaps;
4249
/**
4350
* Parses passed value as JSON object, JSON.parse() will throw an error.
4451
* @param input
@@ -66,6 +73,58 @@ export declare class BrowserCacheManager extends CacheManager {
6673
* @param value
6774
*/
6875
setAccount(account: AccountEntity): void;
76+
/**
77+
* Returns the array of account keys currently cached
78+
* @returns
79+
*/
80+
getAccountKeys(): Array<string>;
81+
/**
82+
* Add a new account to the key map
83+
* @param key
84+
*/
85+
addAccountKeyToMap(key: string): void;
86+
/**
87+
* Remove an account from the key map
88+
* @param key
89+
*/
90+
removeAccountKeyFromMap(key: string): void;
91+
/**
92+
* Extends inherited removeAccount function to include removal of the account key from the map
93+
* @param key
94+
*/
95+
removeAccount(key: string): Promise<void>;
96+
/**
97+
* Removes given idToken from the cache and from the key map
98+
* @param key
99+
*/
100+
removeIdToken(key: string): void;
101+
/**
102+
* Removes given accessToken from the cache and from the key map
103+
* @param key
104+
*/
105+
removeAccessToken(key: string): Promise<void>;
106+
/**
107+
* Removes given refreshToken from the cache and from the key map
108+
* @param key
109+
*/
110+
removeRefreshToken(key: string): void;
111+
/**
112+
* Gets the keys for the cached tokens associated with this clientId
113+
* @returns
114+
*/
115+
getTokenKeys(): TokenKeys;
116+
/**
117+
* Adds the given key to the token key map
118+
* @param key
119+
* @param type
120+
*/
121+
addTokenKey(key: string, type: CredentialType): void;
122+
/**
123+
* Removes the given key from the token key map
124+
* @param key
125+
* @param type
126+
*/
127+
removeTokenKey(key: string, type: CredentialType): void;
69128
/**
70129
* generates idToken entity from a string
71130
* @param idTokenKey
@@ -190,7 +249,7 @@ export declare class BrowserCacheManager extends CacheManager {
190249
* Will also clear the cookie item if storeAuthStateInCookie is set to true.
191250
* @param key
192251
*/
193-
removeItem(key: string): boolean;
252+
removeItem(key: string): void;
194253
/**
195254
* Checks whether key is in cache.
196255
* @param key

public/@azure/msal-browser/config/Configuration.d.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,13 @@ export declare type BrowserAuthOptions = {
6363
*/
6464
export declare type CacheOptions = {
6565
/**
66-
* Used to specify the cacheLocation user wants to set. Valid values are "localStorage" and "sessionStorage"
66+
* Used to specify the cacheLocation user wants to set. Valid values are "localStorage", "sessionStorage" and "memoryStorage".
6767
*/
6868
cacheLocation?: BrowserCacheLocation | string;
69+
/**
70+
* Used to specify the temporaryCacheLocation user wants to set. Valid values are "localStorage", "sessionStorage" and "memoryStorage".
71+
*/
72+
temporaryCacheLocation?: BrowserCacheLocation | string;
6973
/**
7074
* If set, MSAL stores the auth request state required for validation of the auth flows in the browser cookies. By default this flag is set to false.
7175
*/
@@ -74,6 +78,10 @@ export declare type CacheOptions = {
7478
* If set, MSAL sets the "Secure" flag on cookies so they can only be sent over HTTPS. By default this flag is set to false.
7579
*/
7680
secureCookies?: boolean;
81+
/**
82+
* If set, MSAL will attempt to migrate cache entries from older versions on initialization. By default this flag is set to true if cacheLocation is localStorage, otherwise false.
83+
*/
84+
cacheMigrationEnabled?: boolean;
7785
};
7886
export declare type BrowserSystemOptions = SystemOptions & {
7987
/**

public/@azure/msal-browser/error/BrowserAuthError.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ export declare const BrowserAuthErrorMessage: {
151151
code: string;
152152
desc: string;
153153
};
154+
spaCodeAndNativeAccountPresent: {
155+
code: string;
156+
desc: string;
157+
};
154158
databaseUnavailable: {
155159
code: string;
156160
desc: string;
@@ -341,6 +345,10 @@ export declare class BrowserAuthError extends AuthError {
341345
* Create an error when an authorization code or native account ID is required but not provided
342346
*/
343347
static createAuthCodeOrNativeAccountIdRequiredError(): BrowserAuthError;
348+
/**
349+
* Create an error when both authorization code and native account ID are provided
350+
*/
351+
static createSpaCodeAndNativeAccountIdPresentError(): BrowserAuthError;
344352
/**
345353
* Create an error when IndexedDB is unavailable
346354
*/

0 commit comments

Comments
 (0)