@useparagon/connect 3.1.0 → 3.2.0-experimental-27263.1

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.
@@ -1,4 +1,5 @@
1
1
  import { IConnectIntegrationWithCredentialInfo } from '../entities/integration.interface';
2
+ import { OAuthTransport } from '../install-flow/oauth';
2
3
  import { ConnectInputValue } from '../types/connect';
3
4
  import { DataType, KeyedSource } from '../types/resolvers';
4
5
  import { InstallOptions } from '../types/sdk';
@@ -16,15 +17,12 @@ export type OAuthFlowOptions = {
16
17
  installOptions?: InstallOptions;
17
18
  };
18
19
  /**
19
- * start oauth flow with new popup
20
- * firstly fetches the buil-oauth url which returns the action specifc oauth url .
21
- * parallely it opens a new window with nonce url . The nonce endpoint is used to send a token as cookie which is later
22
- * validated after oauth callback . This ensures that no csrf has happened during the oauth flow.
23
- * Additionally the oauth-nonce script communicates with the parent window to notify that the oauth-nonce has loaded.
24
- * this ensures that the redirect does not happen before the oauth-nonce has loaded.
25
- * post message was used as any other communication (ex- onload event) was not possible due to cross domain restrictions of browsers.
20
+ * Assembles the SDK-flavored OAuth transport for the shared `runOAuthFlow`:
21
+ * Zeus build-oauth + oauth-nonce URL construction and the Connect
22
+ * oauth-callback error redirect. `waitForCredential` is supplied by the
23
+ * caller (`ConnectSDK.pollForCredential`), which owns credential state.
26
24
  *
27
- * oauthNonce -> buildOauth -> actionSpecificOauthUrl -> oauthCallback
28
- * @returns new opened popup window object.
25
+ * Returns undefined when the integration has no resolvable type name, which
26
+ * the caller surfaces as an `OAuthBlockedError` (historical behavior).
29
27
  */
30
- export declare const startOAuthFlow: ({ context, integration, endUserSuppliedValues, authParams, isPreviewMode, installOptions, }: OAuthFlowOptions, oauthMetaKeyId: string) => Window | undefined | null;
28
+ export declare const createOAuthTransport: ({ context, integration, endUserSuppliedValues, authParams, isPreviewMode, installOptions, }: OAuthFlowOptions) => Omit<OAuthTransport, 'waitForCredential'> | undefined;