@workos-inc/widgets 1.7.0 → 1.7.2
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.
- package/CHANGELOG.md +8 -0
- package/README.md +1 -66
- package/dist/cjs/api/endpoint.cjs +20 -7
- package/dist/cjs/api/endpoint.cjs.map +1 -1
- package/dist/cjs/api/endpoint.d.cts +36 -12
- package/dist/cjs/lib/pipes.cjs +60 -1
- package/dist/cjs/lib/pipes.cjs.map +1 -1
- package/dist/css/lib/provider-icon.css +93 -3
- package/dist/esm/api/endpoint.d.ts +36 -12
- package/dist/esm/api/endpoint.js +20 -7
- package/dist/esm/api/endpoint.js.map +1 -1
- package/dist/esm/lib/pipes.js +61 -2
- package/dist/esm/lib/pipes.js.map +1 -1
- package/package.json +1 -1
|
@@ -594,26 +594,34 @@ declare const DataIntegrationIntegrationType: {
|
|
|
594
594
|
readonly box: "box";
|
|
595
595
|
readonly confluence: "confluence";
|
|
596
596
|
readonly dropbox: "dropbox";
|
|
597
|
+
readonly "frame-io": "frame-io";
|
|
598
|
+
readonly front: "front";
|
|
597
599
|
readonly github: "github";
|
|
598
600
|
readonly gitlab: "gitlab";
|
|
599
601
|
readonly gmail: "gmail";
|
|
600
602
|
readonly google: "google";
|
|
601
603
|
readonly "google-calendar": "google-calendar";
|
|
602
604
|
readonly "google-drive": "google-drive";
|
|
605
|
+
readonly helpscout: "helpscout";
|
|
603
606
|
readonly hubspot: "hubspot";
|
|
604
607
|
readonly intercom: "intercom";
|
|
605
608
|
readonly jira: "jira";
|
|
606
609
|
readonly linear: "linear";
|
|
607
610
|
readonly microsoft: "microsoft";
|
|
608
611
|
readonly "microsoft-onedrive": "microsoft-onedrive";
|
|
612
|
+
readonly "microsoft-onenote": "microsoft-onenote";
|
|
609
613
|
readonly "microsoft-outlook": "microsoft-outlook";
|
|
610
614
|
readonly "microsoft-outlook-calendar": "microsoft-outlook-calendar";
|
|
615
|
+
readonly "microsoft-sharepoint": "microsoft-sharepoint";
|
|
616
|
+
readonly "microsoft-teams": "microsoft-teams";
|
|
617
|
+
readonly "microsoft-todo": "microsoft-todo";
|
|
611
618
|
readonly notion: "notion";
|
|
612
619
|
readonly prefect: "prefect";
|
|
613
620
|
readonly "pydantic-logfire": "pydantic-logfire";
|
|
614
621
|
readonly salesforce: "salesforce";
|
|
615
622
|
readonly sentry: "sentry";
|
|
616
623
|
readonly slack: "slack";
|
|
624
|
+
readonly snowflake: "snowflake";
|
|
617
625
|
readonly stripe: "stripe";
|
|
618
626
|
readonly zendesk: "zendesk";
|
|
619
627
|
};
|
|
@@ -645,9 +653,14 @@ interface DataIntegration {
|
|
|
645
653
|
interface DataIntegrationsResponse {
|
|
646
654
|
data: DataIntegration[];
|
|
647
655
|
}
|
|
648
|
-
|
|
656
|
+
type GetDataIntegrationAuthorizeUrlResponseAllOf = {
|
|
649
657
|
url: string;
|
|
650
|
-
|
|
658
|
+
redirectToken: string;
|
|
659
|
+
};
|
|
660
|
+
type GetDataIntegrationAuthorizeUrlResponseAllOfTwo = {
|
|
661
|
+
handoffToken?: string;
|
|
662
|
+
};
|
|
663
|
+
type GetDataIntegrationAuthorizeUrlResponse = GetDataIntegrationAuthorizeUrlResponseAllOf & GetDataIntegrationAuthorizeUrlResponseAllOfTwo;
|
|
651
664
|
interface GetAuthorizationStatusResponse {
|
|
652
665
|
isConnecting: boolean;
|
|
653
666
|
}
|
|
@@ -931,6 +944,14 @@ type CreateOrganizationApiKey403 = {
|
|
|
931
944
|
type CreateOrganizationApiKey404 = {
|
|
932
945
|
message: string;
|
|
933
946
|
};
|
|
947
|
+
type CreateOrganizationApiKey422ErrorsItem = {
|
|
948
|
+
code: string;
|
|
949
|
+
field: string;
|
|
950
|
+
};
|
|
951
|
+
type CreateOrganizationApiKey422 = {
|
|
952
|
+
message: string;
|
|
953
|
+
errors: CreateOrganizationApiKey422ErrorsItem[];
|
|
954
|
+
};
|
|
934
955
|
type ListOrganizationApiKeysParams = {
|
|
935
956
|
limit?: number;
|
|
936
957
|
before?: string;
|
|
@@ -967,6 +988,9 @@ type DeleteOrganizationApiKey404 = {
|
|
|
967
988
|
type MyDataIntegrations403 = {
|
|
968
989
|
message: string;
|
|
969
990
|
};
|
|
991
|
+
type GetDataIntegrationAuthorizeUrlParams = {
|
|
992
|
+
requireHandoff?: boolean;
|
|
993
|
+
};
|
|
970
994
|
type GetDataIntegrationAuthorizeUrl400 = {
|
|
971
995
|
message: string;
|
|
972
996
|
};
|
|
@@ -1573,7 +1597,7 @@ declare function useListSsoConnections<TData = Awaited<ReturnType<ReturnType<typ
|
|
|
1573
1597
|
queryKey: DataTag<QueryKey, TData, TError>;
|
|
1574
1598
|
};
|
|
1575
1599
|
declare const useCreateOrganizationApiKeyHook: () => (createOrganizationApiKeyRequest: BodyType<CreateOrganizationApiKeyRequest>, signal?: AbortSignal) => Promise<CreateOrganizationApiKeyResponse>;
|
|
1576
|
-
declare const useCreateOrganizationApiKeyMutationOptions: <TError = ErrorType<CreateOrganizationApiKey400 | CreateOrganizationApiKey403 | CreateOrganizationApiKey404>, TContext = unknown>(options?: {
|
|
1600
|
+
declare const useCreateOrganizationApiKeyMutationOptions: <TError = ErrorType<CreateOrganizationApiKey400 | CreateOrganizationApiKey403 | CreateOrganizationApiKey404 | CreateOrganizationApiKey422>, TContext = unknown>(options?: {
|
|
1577
1601
|
mutation?: UseMutationOptions<Awaited<ReturnType<ReturnType<typeof useCreateOrganizationApiKeyHook>>>, TError, {
|
|
1578
1602
|
data: BodyType<CreateOrganizationApiKeyRequest>;
|
|
1579
1603
|
}, TContext>;
|
|
@@ -1582,8 +1606,8 @@ declare const useCreateOrganizationApiKeyMutationOptions: <TError = ErrorType<Cr
|
|
|
1582
1606
|
}, TContext>;
|
|
1583
1607
|
type CreateOrganizationApiKeyMutationResult = NonNullable<Awaited<ReturnType<ReturnType<typeof useCreateOrganizationApiKeyHook>>>>;
|
|
1584
1608
|
type CreateOrganizationApiKeyMutationBody = BodyType<CreateOrganizationApiKeyRequest>;
|
|
1585
|
-
type CreateOrganizationApiKeyMutationError = ErrorType<CreateOrganizationApiKey400 | CreateOrganizationApiKey403 | CreateOrganizationApiKey404>;
|
|
1586
|
-
declare const useCreateOrganizationApiKey: <TError = ErrorType<CreateOrganizationApiKey400 | CreateOrganizationApiKey403 | CreateOrganizationApiKey404>, TContext = unknown>(options?: {
|
|
1609
|
+
type CreateOrganizationApiKeyMutationError = ErrorType<CreateOrganizationApiKey400 | CreateOrganizationApiKey403 | CreateOrganizationApiKey404 | CreateOrganizationApiKey422>;
|
|
1610
|
+
declare const useCreateOrganizationApiKey: <TError = ErrorType<CreateOrganizationApiKey400 | CreateOrganizationApiKey403 | CreateOrganizationApiKey404 | CreateOrganizationApiKey422>, TContext = unknown>(options?: {
|
|
1587
1611
|
mutation?: UseMutationOptions<Awaited<ReturnType<ReturnType<typeof useCreateOrganizationApiKeyHook>>>, TError, {
|
|
1588
1612
|
data: BodyType<CreateOrganizationApiKeyRequest>;
|
|
1589
1613
|
}, TContext>;
|
|
@@ -1679,26 +1703,26 @@ declare function useMyDataIntegrations<TData = Awaited<ReturnType<ReturnType<typ
|
|
|
1679
1703
|
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
1680
1704
|
queryKey: DataTag<QueryKey, TData, TError>;
|
|
1681
1705
|
};
|
|
1682
|
-
declare const useGetDataIntegrationAuthorizeUrlHook: () => (slug: string, signal?: AbortSignal) => Promise<GetDataIntegrationAuthorizeUrlResponse>;
|
|
1683
|
-
declare const getGetDataIntegrationAuthorizeUrlQueryKey: (slug?: string) => readonly [`/_widgets/DataIntegrations/${string}/authorize
|
|
1684
|
-
declare const useGetDataIntegrationAuthorizeUrlQueryOptions: <TData = Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>, TError = ErrorType<GetDataIntegrationAuthorizeUrl400 | GetDataIntegrationAuthorizeUrl403 | GetDataIntegrationAuthorizeUrl404>>(slug: string, options?: {
|
|
1706
|
+
declare const useGetDataIntegrationAuthorizeUrlHook: () => (slug: string, params?: GetDataIntegrationAuthorizeUrlParams, signal?: AbortSignal) => Promise<GetDataIntegrationAuthorizeUrlResponse>;
|
|
1707
|
+
declare const getGetDataIntegrationAuthorizeUrlQueryKey: (slug?: string, params?: GetDataIntegrationAuthorizeUrlParams) => readonly [`/_widgets/DataIntegrations/${string}/authorize`, ...GetDataIntegrationAuthorizeUrlParams[]];
|
|
1708
|
+
declare const useGetDataIntegrationAuthorizeUrlQueryOptions: <TData = Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>, TError = ErrorType<GetDataIntegrationAuthorizeUrl400 | GetDataIntegrationAuthorizeUrl403 | GetDataIntegrationAuthorizeUrl404>>(slug: string, params?: GetDataIntegrationAuthorizeUrlParams, options?: {
|
|
1685
1709
|
query?: Partial<UseQueryOptions<Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>, TError, TData>>;
|
|
1686
1710
|
}) => UseQueryOptions<Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>, TError, TData> & {
|
|
1687
1711
|
queryKey: DataTag<QueryKey, TData, TError>;
|
|
1688
1712
|
};
|
|
1689
1713
|
type GetDataIntegrationAuthorizeUrlQueryResult = NonNullable<Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>>;
|
|
1690
1714
|
type GetDataIntegrationAuthorizeUrlQueryError = ErrorType<GetDataIntegrationAuthorizeUrl400 | GetDataIntegrationAuthorizeUrl403 | GetDataIntegrationAuthorizeUrl404>;
|
|
1691
|
-
declare function useGetDataIntegrationAuthorizeUrl<TData = Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>, TError = ErrorType<GetDataIntegrationAuthorizeUrl400 | GetDataIntegrationAuthorizeUrl403 | GetDataIntegrationAuthorizeUrl404>>(slug: string, options: {
|
|
1715
|
+
declare function useGetDataIntegrationAuthorizeUrl<TData = Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>, TError = ErrorType<GetDataIntegrationAuthorizeUrl400 | GetDataIntegrationAuthorizeUrl403 | GetDataIntegrationAuthorizeUrl404>>(slug: string, params: undefined | GetDataIntegrationAuthorizeUrlParams, options: {
|
|
1692
1716
|
query: Partial<UseQueryOptions<Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>, TError, Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>>, "initialData">;
|
|
1693
1717
|
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
1694
1718
|
queryKey: DataTag<QueryKey, TData, TError>;
|
|
1695
1719
|
};
|
|
1696
|
-
declare function useGetDataIntegrationAuthorizeUrl<TData = Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>, TError = ErrorType<GetDataIntegrationAuthorizeUrl400 | GetDataIntegrationAuthorizeUrl403 | GetDataIntegrationAuthorizeUrl404>>(slug: string, options?: {
|
|
1720
|
+
declare function useGetDataIntegrationAuthorizeUrl<TData = Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>, TError = ErrorType<GetDataIntegrationAuthorizeUrl400 | GetDataIntegrationAuthorizeUrl403 | GetDataIntegrationAuthorizeUrl404>>(slug: string, params?: GetDataIntegrationAuthorizeUrlParams, options?: {
|
|
1697
1721
|
query?: Partial<UseQueryOptions<Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>, TError, Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>>, "initialData">;
|
|
1698
1722
|
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
1699
1723
|
queryKey: DataTag<QueryKey, TData, TError>;
|
|
1700
1724
|
};
|
|
1701
|
-
declare function useGetDataIntegrationAuthorizeUrl<TData = Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>, TError = ErrorType<GetDataIntegrationAuthorizeUrl400 | GetDataIntegrationAuthorizeUrl403 | GetDataIntegrationAuthorizeUrl404>>(slug: string, options?: {
|
|
1725
|
+
declare function useGetDataIntegrationAuthorizeUrl<TData = Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>, TError = ErrorType<GetDataIntegrationAuthorizeUrl400 | GetDataIntegrationAuthorizeUrl403 | GetDataIntegrationAuthorizeUrl404>>(slug: string, params?: GetDataIntegrationAuthorizeUrlParams, options?: {
|
|
1702
1726
|
query?: Partial<UseQueryOptions<Awaited<ReturnType<ReturnType<typeof useGetDataIntegrationAuthorizeUrlHook>>>, TError, TData>>;
|
|
1703
1727
|
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
1704
1728
|
queryKey: DataTag<QueryKey, TData, TError>;
|
|
@@ -1745,4 +1769,4 @@ declare const useDeleteDataInstallation: <TError = ErrorType<DeleteDataInstallat
|
|
|
1745
1769
|
installationId: string;
|
|
1746
1770
|
}, TContext>;
|
|
1747
1771
|
|
|
1748
|
-
export { type ActiveSession, type ActiveSessionCurrentLocation, type ActiveSessionState, type ActiveSessionsResponse, type AuthenticationInformation403, type AuthenticationInformationQueryError, type AuthenticationInformationQueryResult, type AuthenticationInformationResponse, type AuthenticationInformationResponseData, type AuthenticationInformationResponseDataPasswordSettings, type AuthenticationInformationResponseDataVerificationMethods, type AuthenticationInformationResponseDataVerificationMethodsMfa, AuthenticationInformationResponseDataVerificationMethodsMfaProvider, type AuthenticationInformationResponseDataVerificationMethodsPasskey, type AuthenticationInformationResponseDataVerificationMethodsPasskeyPassKeysItem, AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider, type AuthenticationInformationResponseDataVerificationMethodsPassword, AuthenticationInformationResponseDataVerificationMethodsPasswordProvider, type CreateOrganizationApiKey400, type CreateOrganizationApiKey403, type CreateOrganizationApiKey404, type CreateOrganizationApiKeyMutationBody, type CreateOrganizationApiKeyMutationError, type CreateOrganizationApiKeyMutationResult, type CreateOrganizationApiKeyRequest, type CreateOrganizationApiKeyResponse, type CreatePassword201, type CreatePassword400, type CreatePassword403, type CreatePasswordMutationBody, type CreatePasswordMutationError, type CreatePasswordMutationResult, type CreatePasswordRequest, type CreateTotpFactor400, type CreateTotpFactor403, type CreateTotpFactorMutationError, type CreateTotpFactorMutationResult, type CreateTotpFactorResponse, type CreateTotpFactorResponseAuthenticationChallenge, type CreateTotpFactorResponseAuthenticationChallengeAllOf, CreateTotpFactorResponseAuthenticationChallengeAllOfObject, type CreateTotpFactorResponseAuthenticationChallengeAllOfThree, type CreateTotpFactorResponseAuthenticationFactor, type CreateTotpFactorResponseAuthenticationFactorAllOf, type CreateTotpFactorResponseAuthenticationFactorAllOfEight, CreateTotpFactorResponseAuthenticationFactorAllOfObject, type CreateTotpFactorResponseAuthenticationFactorAllOfSms, type CreateTotpFactorResponseAuthenticationFactorAllOfTotp, type CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOf, type CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOfTwo, CreateTotpFactorResponseAuthenticationFactorAllOfType, type DataInstallation, DataInstallationObject, DataInstallationState, type DataIntegration, DataIntegrationCredentialsType, type DataIntegrationInstallation, DataIntegrationIntegrationType, DataIntegrationObject, DataIntegrationOwnership, type DataIntegrationsResponse, type DeleteDataInstallation200, type DeleteDataInstallation403, type DeleteDataInstallation404, type DeleteDataInstallationMutationError, type DeleteDataInstallationMutationResult, type DeleteOrganizationApiKey200, type DeleteOrganizationApiKey403, type DeleteOrganizationApiKey404, type DeleteOrganizationApiKeyMutationError, type DeleteOrganizationApiKeyMutationResult, type DeleteOrganizationDomain403, type DeleteOrganizationDomain404, type DeleteOrganizationDomainMutationError, type DeleteOrganizationDomainMutationResult, type DeletePasskey200, type DeletePasskey400, type DeletePasskey403, type DeletePasskeyMutationError, type DeletePasskeyMutationResult, type DeleteTotpFactors200, type DeleteTotpFactors400, type DeleteTotpFactors403, type DeleteTotpFactorsMutationError, type DeleteTotpFactorsMutationResult, DomainVerificationNameServer, type GenerateAdminPortalLink201, type GenerateAdminPortalLink403, type GenerateAdminPortalLink404, type GenerateAdminPortalLink500, GenerateAdminPortalLinkIntent, type GenerateAdminPortalLinkMutationError, type GenerateAdminPortalLinkMutationResult, type GenerateAdminPortalLinkParams, type GetAuthorizationStatusResponse, type GetDataInstallationAuthorizationStatus400, type GetDataInstallationAuthorizationStatus403, type GetDataInstallationAuthorizationStatus404, type GetDataInstallationAuthorizationStatusQueryError, type GetDataInstallationAuthorizationStatusQueryResult, type GetDataIntegrationAuthorizeUrl400, type GetDataIntegrationAuthorizeUrl403, type GetDataIntegrationAuthorizeUrl404, type GetDataIntegrationAuthorizeUrlQueryError, type GetDataIntegrationAuthorizeUrlQueryResult, type GetDataIntegrationAuthorizeUrlResponse, type InviteMember201, type InviteMember400, type InviteMember403, type InviteMember404, type InviteMemberInput, type InviteMemberMutationBody, type InviteMemberMutationError, type InviteMemberMutationResult, type ListMetadata, type ListOrganizationApiKeyPermission, type ListOrganizationApiKeyPermissions400, type ListOrganizationApiKeyPermissions403, type ListOrganizationApiKeyPermissionsParams, type ListOrganizationApiKeyPermissionsQueryError, type ListOrganizationApiKeyPermissionsQueryResult, type ListOrganizationApiKeyPermissionsResponse, type ListOrganizationApiKeyPermissionsResponseListMetadata, type ListOrganizationApiKeys400, type ListOrganizationApiKeys403, type ListOrganizationApiKeysParams, type ListOrganizationApiKeysQueryError, type ListOrganizationApiKeysQueryResult, type ListOrganizationApiKeysResponse, type ListOrganizationApiKeysResponseData, type ListOrganizationApiKeysResponseListMetadata, type ListOrganizationDomains200, type ListOrganizationDomains403, type ListOrganizationDomains404, type ListOrganizationDomainsQueryError, type ListOrganizationDomainsQueryResult, type ListSsoConnectionsQueryError, type ListSsoConnectionsQueryResult, type Me, type Me403, type MeOauthProfiles, type MeQueryError, type MeQueryResult, type Member, type MemberActions, MemberActionsItem, type MemberRole, type MemberRolesItem, MemberStatus, type Members200, type Members403, type Members404, type MembersParams, type MembersQueryError, type MembersQueryResult, type MyDataIntegrations403, type MyDataIntegrationsQueryError, type MyDataIntegrationsQueryResult, type OAuthProfile, OidcSessionState, type OrganizationDomain, OrganizationDomainState, type OrganizationInfo, type Organizations403, type Organizations404, type OrganizationsQueryError, type OrganizationsQueryResult, type OrganizationsResponse, type RegisterPasskey400, type RegisterPasskey403, type RegisterPasskeyMutationError, type RegisterPasskeyMutationResult, type RegisterPasskeyResponse, type RegisterPasskeyResponseOptions, type RemoveMember200, type RemoveMember400, type RemoveMember403, type RemoveMember404, type RemoveMemberMutationError, type RemoveMemberMutationResult, type ResendInvite201, type ResendInvite400, type ResendInvite403, type ResendInvite404, type ResendInviteMutationError, type ResendInviteMutationResult, type ReverifyOrganizationDomain403, type ReverifyOrganizationDomain404, type ReverifyOrganizationDomainMutationError, type ReverifyOrganizationDomainMutationResult, type RevokeAllSessions200, type RevokeAllSessions400, type RevokeAllSessions403, type RevokeAllSessionsMutationBody, type RevokeAllSessionsMutationError, type RevokeAllSessionsMutationResult, type RevokeAllSessionsRequest, type RevokeInvite200, type RevokeInvite400, type RevokeInvite403, type RevokeInvite404, type RevokeInviteMutationError, type RevokeInviteMutationResult, type RevokeSession200, type RevokeSession400, type RevokeSession403, type RevokeSessionMutationError, type RevokeSessionMutationResult, type Roles403, type Roles404, type RolesAndConfig403, type RolesAndConfig404, type RolesAndConfigQueryError, type RolesAndConfigQueryResult, type RolesAndConfigResponse, type RolesQueryError, type RolesQueryResult, SamlSessionState, type SendVerification400, type SendVerification403, type SendVerificationMutationError, type SendVerificationMutationResult, type SendVerificationResponse, SendVerificationResponseType, type Sessions403, type SessionsQueryError, type SessionsQueryResult, type Settings403, type SettingsQueryError, type SettingsQueryResult, type SettingsResponse, SettingsResponseObject, type SsoConnection, type SsoConnectionAnyOf, type SsoConnectionAnyOfEight, type SsoConnectionAnyOfEightAllOf, type SsoConnectionAnyOfEightAllOfLastSession, SsoConnectionAnyOfEightAllOfProviderTag, type SsoConnectionAnyOfEightAllOfSix, SsoConnectionAnyOfEightAllOfState, SsoConnectionAnyOfEightAllOfType, type SsoConnectionAnyOfLastSession, type SsoConnectionAnyOfLatestExpiredCertificate, type SsoConnectionAnyOfLatestExpiringCertificate, SsoConnectionAnyOfProviderTag, SsoConnectionAnyOfState, SsoConnectionAnyOfType, type SsoConnectionSessionJSON, SsoConnectionSessionJSONState, type UpdateMe400, type UpdateMe403, type UpdateMeInput, type UpdateMeMutationBody, type UpdateMeMutationError, type UpdateMeMutationResult, type UpdateMember200, type UpdateMember400, type UpdateMember403, type UpdateMember404, type UpdateMemberInput, type UpdateMemberMutationBody, type UpdateMemberMutationError, type UpdateMemberMutationResult, type UpdatePassword201, type UpdatePassword400, type UpdatePassword403, type UpdatePasswordMutationBody, type UpdatePasswordMutationError, type UpdatePasswordMutationResult, type UpdatePasswordRequest, type Verify400, type Verify403, type VerifyMutationBody, type VerifyMutationError, type VerifyMutationResult, type VerifyPasskey200, type VerifyPasskey400, type VerifyPasskey403, type VerifyPasskeyMutationBody, type VerifyPasskeyMutationError, type VerifyPasskeyMutationResult, type VerifyPasskeyRequest, type VerifyPasskeyRequestResponse, type VerifyRequest, type VerifyResponse, type VerifyTotpFactor200, type VerifyTotpFactor400, type VerifyTotpFactor403, type VerifyTotpFactorMutationBody, type VerifyTotpFactorMutationError, type VerifyTotpFactorMutationResult, type VerifyTotpFactorRequest, type X509CertificateJSON, getAuthenticationInformationQueryKey, getGetDataInstallationAuthorizationStatusQueryKey, getGetDataIntegrationAuthorizeUrlQueryKey, getListOrganizationApiKeyPermissionsQueryKey, getListOrganizationApiKeysQueryKey, getListOrganizationDomainsQueryKey, getListSsoConnectionsQueryKey, getMeQueryKey, getMembersQueryKey, getMyDataIntegrationsQueryKey, getOrganizationsQueryKey, getRolesAndConfigQueryKey, getRolesQueryKey, getSessionsQueryKey, getSettingsQueryKey, useAuthenticationInformation, useAuthenticationInformationHook, useAuthenticationInformationQueryOptions, useCreateOrganizationApiKey, useCreateOrganizationApiKeyHook, useCreateOrganizationApiKeyMutationOptions, useCreatePassword, useCreatePasswordHook, useCreatePasswordMutationOptions, useCreateTotpFactor, useCreateTotpFactorHook, useCreateTotpFactorMutationOptions, useDeleteDataInstallation, useDeleteDataInstallationHook, useDeleteDataInstallationMutationOptions, useDeleteOrganizationApiKey, useDeleteOrganizationApiKeyHook, useDeleteOrganizationApiKeyMutationOptions, useDeleteOrganizationDomain, useDeleteOrganizationDomainHook, useDeleteOrganizationDomainMutationOptions, useDeletePasskey, useDeletePasskeyHook, useDeletePasskeyMutationOptions, useDeleteTotpFactors, useDeleteTotpFactorsHook, useDeleteTotpFactorsMutationOptions, useGenerateAdminPortalLink, useGenerateAdminPortalLinkHook, useGenerateAdminPortalLinkMutationOptions, useGetDataInstallationAuthorizationStatus, useGetDataInstallationAuthorizationStatusHook, useGetDataInstallationAuthorizationStatusQueryOptions, useGetDataIntegrationAuthorizeUrl, useGetDataIntegrationAuthorizeUrlHook, useGetDataIntegrationAuthorizeUrlQueryOptions, useInviteMember, useInviteMemberHook, useInviteMemberMutationOptions, useListOrganizationApiKeyPermissions, useListOrganizationApiKeyPermissionsHook, useListOrganizationApiKeyPermissionsQueryOptions, useListOrganizationApiKeys, useListOrganizationApiKeysHook, useListOrganizationApiKeysQueryOptions, useListOrganizationDomains, useListOrganizationDomainsHook, useListOrganizationDomainsQueryOptions, useListSsoConnections, useListSsoConnectionsHook, useListSsoConnectionsQueryOptions, useMe, useMeHook, useMeQueryOptions, useMembers, useMembersHook, useMembersQueryOptions, useMyDataIntegrations, useMyDataIntegrationsHook, useMyDataIntegrationsQueryOptions, useOrganizations, useOrganizationsHook, useOrganizationsQueryOptions, useRegisterPasskey, useRegisterPasskeyHook, useRegisterPasskeyMutationOptions, useRemoveMember, useRemoveMemberHook, useRemoveMemberMutationOptions, useResendInvite, useResendInviteHook, useResendInviteMutationOptions, useReverifyOrganizationDomain, useReverifyOrganizationDomainHook, useReverifyOrganizationDomainMutationOptions, useRevokeAllSessions, useRevokeAllSessionsHook, useRevokeAllSessionsMutationOptions, useRevokeInvite, useRevokeInviteHook, useRevokeInviteMutationOptions, useRevokeSession, useRevokeSessionHook, useRevokeSessionMutationOptions, useRoles, useRolesAndConfig, useRolesAndConfigHook, useRolesAndConfigQueryOptions, useRolesHook, useRolesQueryOptions, useSendVerification, useSendVerificationHook, useSendVerificationMutationOptions, useSessions, useSessionsHook, useSessionsQueryOptions, useSettings, useSettingsHook, useSettingsQueryOptions, useUpdateMe, useUpdateMeHook, useUpdateMeMutationOptions, useUpdateMember, useUpdateMemberHook, useUpdateMemberMutationOptions, useUpdatePassword, useUpdatePasswordHook, useUpdatePasswordMutationOptions, useVerify, useVerifyHook, useVerifyMutationOptions, useVerifyPasskey, useVerifyPasskeyHook, useVerifyPasskeyMutationOptions, useVerifyTotpFactor, useVerifyTotpFactorHook, useVerifyTotpFactorMutationOptions };
|
|
1772
|
+
export { type ActiveSession, type ActiveSessionCurrentLocation, type ActiveSessionState, type ActiveSessionsResponse, type AuthenticationInformation403, type AuthenticationInformationQueryError, type AuthenticationInformationQueryResult, type AuthenticationInformationResponse, type AuthenticationInformationResponseData, type AuthenticationInformationResponseDataPasswordSettings, type AuthenticationInformationResponseDataVerificationMethods, type AuthenticationInformationResponseDataVerificationMethodsMfa, AuthenticationInformationResponseDataVerificationMethodsMfaProvider, type AuthenticationInformationResponseDataVerificationMethodsPasskey, type AuthenticationInformationResponseDataVerificationMethodsPasskeyPassKeysItem, AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider, type AuthenticationInformationResponseDataVerificationMethodsPassword, AuthenticationInformationResponseDataVerificationMethodsPasswordProvider, type CreateOrganizationApiKey400, type CreateOrganizationApiKey403, type CreateOrganizationApiKey404, type CreateOrganizationApiKey422, type CreateOrganizationApiKey422ErrorsItem, type CreateOrganizationApiKeyMutationBody, type CreateOrganizationApiKeyMutationError, type CreateOrganizationApiKeyMutationResult, type CreateOrganizationApiKeyRequest, type CreateOrganizationApiKeyResponse, type CreatePassword201, type CreatePassword400, type CreatePassword403, type CreatePasswordMutationBody, type CreatePasswordMutationError, type CreatePasswordMutationResult, type CreatePasswordRequest, type CreateTotpFactor400, type CreateTotpFactor403, type CreateTotpFactorMutationError, type CreateTotpFactorMutationResult, type CreateTotpFactorResponse, type CreateTotpFactorResponseAuthenticationChallenge, type CreateTotpFactorResponseAuthenticationChallengeAllOf, CreateTotpFactorResponseAuthenticationChallengeAllOfObject, type CreateTotpFactorResponseAuthenticationChallengeAllOfThree, type CreateTotpFactorResponseAuthenticationFactor, type CreateTotpFactorResponseAuthenticationFactorAllOf, type CreateTotpFactorResponseAuthenticationFactorAllOfEight, CreateTotpFactorResponseAuthenticationFactorAllOfObject, type CreateTotpFactorResponseAuthenticationFactorAllOfSms, type CreateTotpFactorResponseAuthenticationFactorAllOfTotp, type CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOf, type CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOfTwo, CreateTotpFactorResponseAuthenticationFactorAllOfType, type DataInstallation, DataInstallationObject, DataInstallationState, type DataIntegration, DataIntegrationCredentialsType, type DataIntegrationInstallation, DataIntegrationIntegrationType, DataIntegrationObject, DataIntegrationOwnership, type DataIntegrationsResponse, type DeleteDataInstallation200, type DeleteDataInstallation403, type DeleteDataInstallation404, type DeleteDataInstallationMutationError, type DeleteDataInstallationMutationResult, type DeleteOrganizationApiKey200, type DeleteOrganizationApiKey403, type DeleteOrganizationApiKey404, type DeleteOrganizationApiKeyMutationError, type DeleteOrganizationApiKeyMutationResult, type DeleteOrganizationDomain403, type DeleteOrganizationDomain404, type DeleteOrganizationDomainMutationError, type DeleteOrganizationDomainMutationResult, type DeletePasskey200, type DeletePasskey400, type DeletePasskey403, type DeletePasskeyMutationError, type DeletePasskeyMutationResult, type DeleteTotpFactors200, type DeleteTotpFactors400, type DeleteTotpFactors403, type DeleteTotpFactorsMutationError, type DeleteTotpFactorsMutationResult, DomainVerificationNameServer, type GenerateAdminPortalLink201, type GenerateAdminPortalLink403, type GenerateAdminPortalLink404, type GenerateAdminPortalLink500, GenerateAdminPortalLinkIntent, type GenerateAdminPortalLinkMutationError, type GenerateAdminPortalLinkMutationResult, type GenerateAdminPortalLinkParams, type GetAuthorizationStatusResponse, type GetDataInstallationAuthorizationStatus400, type GetDataInstallationAuthorizationStatus403, type GetDataInstallationAuthorizationStatus404, type GetDataInstallationAuthorizationStatusQueryError, type GetDataInstallationAuthorizationStatusQueryResult, type GetDataIntegrationAuthorizeUrl400, type GetDataIntegrationAuthorizeUrl403, type GetDataIntegrationAuthorizeUrl404, type GetDataIntegrationAuthorizeUrlParams, type GetDataIntegrationAuthorizeUrlQueryError, type GetDataIntegrationAuthorizeUrlQueryResult, type GetDataIntegrationAuthorizeUrlResponse, type GetDataIntegrationAuthorizeUrlResponseAllOf, type GetDataIntegrationAuthorizeUrlResponseAllOfTwo, type InviteMember201, type InviteMember400, type InviteMember403, type InviteMember404, type InviteMemberInput, type InviteMemberMutationBody, type InviteMemberMutationError, type InviteMemberMutationResult, type ListMetadata, type ListOrganizationApiKeyPermission, type ListOrganizationApiKeyPermissions400, type ListOrganizationApiKeyPermissions403, type ListOrganizationApiKeyPermissionsParams, type ListOrganizationApiKeyPermissionsQueryError, type ListOrganizationApiKeyPermissionsQueryResult, type ListOrganizationApiKeyPermissionsResponse, type ListOrganizationApiKeyPermissionsResponseListMetadata, type ListOrganizationApiKeys400, type ListOrganizationApiKeys403, type ListOrganizationApiKeysParams, type ListOrganizationApiKeysQueryError, type ListOrganizationApiKeysQueryResult, type ListOrganizationApiKeysResponse, type ListOrganizationApiKeysResponseData, type ListOrganizationApiKeysResponseListMetadata, type ListOrganizationDomains200, type ListOrganizationDomains403, type ListOrganizationDomains404, type ListOrganizationDomainsQueryError, type ListOrganizationDomainsQueryResult, type ListSsoConnectionsQueryError, type ListSsoConnectionsQueryResult, type Me, type Me403, type MeOauthProfiles, type MeQueryError, type MeQueryResult, type Member, type MemberActions, MemberActionsItem, type MemberRole, type MemberRolesItem, MemberStatus, type Members200, type Members403, type Members404, type MembersParams, type MembersQueryError, type MembersQueryResult, type MyDataIntegrations403, type MyDataIntegrationsQueryError, type MyDataIntegrationsQueryResult, type OAuthProfile, OidcSessionState, type OrganizationDomain, OrganizationDomainState, type OrganizationInfo, type Organizations403, type Organizations404, type OrganizationsQueryError, type OrganizationsQueryResult, type OrganizationsResponse, type RegisterPasskey400, type RegisterPasskey403, type RegisterPasskeyMutationError, type RegisterPasskeyMutationResult, type RegisterPasskeyResponse, type RegisterPasskeyResponseOptions, type RemoveMember200, type RemoveMember400, type RemoveMember403, type RemoveMember404, type RemoveMemberMutationError, type RemoveMemberMutationResult, type ResendInvite201, type ResendInvite400, type ResendInvite403, type ResendInvite404, type ResendInviteMutationError, type ResendInviteMutationResult, type ReverifyOrganizationDomain403, type ReverifyOrganizationDomain404, type ReverifyOrganizationDomainMutationError, type ReverifyOrganizationDomainMutationResult, type RevokeAllSessions200, type RevokeAllSessions400, type RevokeAllSessions403, type RevokeAllSessionsMutationBody, type RevokeAllSessionsMutationError, type RevokeAllSessionsMutationResult, type RevokeAllSessionsRequest, type RevokeInvite200, type RevokeInvite400, type RevokeInvite403, type RevokeInvite404, type RevokeInviteMutationError, type RevokeInviteMutationResult, type RevokeSession200, type RevokeSession400, type RevokeSession403, type RevokeSessionMutationError, type RevokeSessionMutationResult, type Roles403, type Roles404, type RolesAndConfig403, type RolesAndConfig404, type RolesAndConfigQueryError, type RolesAndConfigQueryResult, type RolesAndConfigResponse, type RolesQueryError, type RolesQueryResult, SamlSessionState, type SendVerification400, type SendVerification403, type SendVerificationMutationError, type SendVerificationMutationResult, type SendVerificationResponse, SendVerificationResponseType, type Sessions403, type SessionsQueryError, type SessionsQueryResult, type Settings403, type SettingsQueryError, type SettingsQueryResult, type SettingsResponse, SettingsResponseObject, type SsoConnection, type SsoConnectionAnyOf, type SsoConnectionAnyOfEight, type SsoConnectionAnyOfEightAllOf, type SsoConnectionAnyOfEightAllOfLastSession, SsoConnectionAnyOfEightAllOfProviderTag, type SsoConnectionAnyOfEightAllOfSix, SsoConnectionAnyOfEightAllOfState, SsoConnectionAnyOfEightAllOfType, type SsoConnectionAnyOfLastSession, type SsoConnectionAnyOfLatestExpiredCertificate, type SsoConnectionAnyOfLatestExpiringCertificate, SsoConnectionAnyOfProviderTag, SsoConnectionAnyOfState, SsoConnectionAnyOfType, type SsoConnectionSessionJSON, SsoConnectionSessionJSONState, type UpdateMe400, type UpdateMe403, type UpdateMeInput, type UpdateMeMutationBody, type UpdateMeMutationError, type UpdateMeMutationResult, type UpdateMember200, type UpdateMember400, type UpdateMember403, type UpdateMember404, type UpdateMemberInput, type UpdateMemberMutationBody, type UpdateMemberMutationError, type UpdateMemberMutationResult, type UpdatePassword201, type UpdatePassword400, type UpdatePassword403, type UpdatePasswordMutationBody, type UpdatePasswordMutationError, type UpdatePasswordMutationResult, type UpdatePasswordRequest, type Verify400, type Verify403, type VerifyMutationBody, type VerifyMutationError, type VerifyMutationResult, type VerifyPasskey200, type VerifyPasskey400, type VerifyPasskey403, type VerifyPasskeyMutationBody, type VerifyPasskeyMutationError, type VerifyPasskeyMutationResult, type VerifyPasskeyRequest, type VerifyPasskeyRequestResponse, type VerifyRequest, type VerifyResponse, type VerifyTotpFactor200, type VerifyTotpFactor400, type VerifyTotpFactor403, type VerifyTotpFactorMutationBody, type VerifyTotpFactorMutationError, type VerifyTotpFactorMutationResult, type VerifyTotpFactorRequest, type X509CertificateJSON, getAuthenticationInformationQueryKey, getGetDataInstallationAuthorizationStatusQueryKey, getGetDataIntegrationAuthorizeUrlQueryKey, getListOrganizationApiKeyPermissionsQueryKey, getListOrganizationApiKeysQueryKey, getListOrganizationDomainsQueryKey, getListSsoConnectionsQueryKey, getMeQueryKey, getMembersQueryKey, getMyDataIntegrationsQueryKey, getOrganizationsQueryKey, getRolesAndConfigQueryKey, getRolesQueryKey, getSessionsQueryKey, getSettingsQueryKey, useAuthenticationInformation, useAuthenticationInformationHook, useAuthenticationInformationQueryOptions, useCreateOrganizationApiKey, useCreateOrganizationApiKeyHook, useCreateOrganizationApiKeyMutationOptions, useCreatePassword, useCreatePasswordHook, useCreatePasswordMutationOptions, useCreateTotpFactor, useCreateTotpFactorHook, useCreateTotpFactorMutationOptions, useDeleteDataInstallation, useDeleteDataInstallationHook, useDeleteDataInstallationMutationOptions, useDeleteOrganizationApiKey, useDeleteOrganizationApiKeyHook, useDeleteOrganizationApiKeyMutationOptions, useDeleteOrganizationDomain, useDeleteOrganizationDomainHook, useDeleteOrganizationDomainMutationOptions, useDeletePasskey, useDeletePasskeyHook, useDeletePasskeyMutationOptions, useDeleteTotpFactors, useDeleteTotpFactorsHook, useDeleteTotpFactorsMutationOptions, useGenerateAdminPortalLink, useGenerateAdminPortalLinkHook, useGenerateAdminPortalLinkMutationOptions, useGetDataInstallationAuthorizationStatus, useGetDataInstallationAuthorizationStatusHook, useGetDataInstallationAuthorizationStatusQueryOptions, useGetDataIntegrationAuthorizeUrl, useGetDataIntegrationAuthorizeUrlHook, useGetDataIntegrationAuthorizeUrlQueryOptions, useInviteMember, useInviteMemberHook, useInviteMemberMutationOptions, useListOrganizationApiKeyPermissions, useListOrganizationApiKeyPermissionsHook, useListOrganizationApiKeyPermissionsQueryOptions, useListOrganizationApiKeys, useListOrganizationApiKeysHook, useListOrganizationApiKeysQueryOptions, useListOrganizationDomains, useListOrganizationDomainsHook, useListOrganizationDomainsQueryOptions, useListSsoConnections, useListSsoConnectionsHook, useListSsoConnectionsQueryOptions, useMe, useMeHook, useMeQueryOptions, useMembers, useMembersHook, useMembersQueryOptions, useMyDataIntegrations, useMyDataIntegrationsHook, useMyDataIntegrationsQueryOptions, useOrganizations, useOrganizationsHook, useOrganizationsQueryOptions, useRegisterPasskey, useRegisterPasskeyHook, useRegisterPasskeyMutationOptions, useRemoveMember, useRemoveMemberHook, useRemoveMemberMutationOptions, useResendInvite, useResendInviteHook, useResendInviteMutationOptions, useReverifyOrganizationDomain, useReverifyOrganizationDomainHook, useReverifyOrganizationDomainMutationOptions, useRevokeAllSessions, useRevokeAllSessionsHook, useRevokeAllSessionsMutationOptions, useRevokeInvite, useRevokeInviteHook, useRevokeInviteMutationOptions, useRevokeSession, useRevokeSessionHook, useRevokeSessionMutationOptions, useRoles, useRolesAndConfig, useRolesAndConfigHook, useRolesAndConfigQueryOptions, useRolesHook, useRolesQueryOptions, useSendVerification, useSendVerificationHook, useSendVerificationMutationOptions, useSessions, useSessionsHook, useSessionsQueryOptions, useSettings, useSettingsHook, useSettingsQueryOptions, useUpdateMe, useUpdateMeHook, useUpdateMeMutationOptions, useUpdateMember, useUpdateMemberHook, useUpdateMemberMutationOptions, useUpdatePassword, useUpdatePasswordHook, useUpdatePasswordMutationOptions, useVerify, useVerifyHook, useVerifyMutationOptions, useVerifyPasskey, useVerifyPasskeyHook, useVerifyPasskeyMutationOptions, useVerifyTotpFactor, useVerifyTotpFactorHook, useVerifyTotpFactorMutationOptions };
|
package/dist/cjs/lib/pipes.cjs
CHANGED
|
@@ -47,15 +47,74 @@ var import_endpoint = require("../api/endpoint.js");
|
|
|
47
47
|
var import_react_query = require("@tanstack/react-query");
|
|
48
48
|
var import_generic_error = require("./generic-error.js");
|
|
49
49
|
var import_utils = require("./utils.js");
|
|
50
|
+
const HANDOFF_INTERVAL_MS = 100;
|
|
51
|
+
const HANDOFF_MAX_ATTEMPTS = 100;
|
|
50
52
|
const useOpenDataIntegrationAuthorizeUrl = (integration) => {
|
|
51
53
|
const getDataIntegrationAuthorizeUrl = (0, import_endpoint.useGetDataIntegrationAuthorizeUrlHook)();
|
|
52
54
|
const settings = (0, import_endpoint.useSettings)();
|
|
53
55
|
const baseUrl = settings.data?.authkitOrigin ?? "";
|
|
56
|
+
const intervalRef = (0, import_react.useRef)(
|
|
57
|
+
void 0
|
|
58
|
+
);
|
|
59
|
+
const messageHandlerRef = (0, import_react.useRef)(
|
|
60
|
+
void 0
|
|
61
|
+
);
|
|
62
|
+
(0, import_react.useEffect)(() => {
|
|
63
|
+
return () => {
|
|
64
|
+
if (intervalRef.current) {
|
|
65
|
+
clearInterval(intervalRef.current);
|
|
66
|
+
}
|
|
67
|
+
if (messageHandlerRef.current) {
|
|
68
|
+
window.removeEventListener("message", messageHandlerRef.current);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}, []);
|
|
54
72
|
return (0, import_react.useCallback)(async () => {
|
|
73
|
+
if (intervalRef.current) {
|
|
74
|
+
clearInterval(intervalRef.current);
|
|
75
|
+
intervalRef.current = void 0;
|
|
76
|
+
}
|
|
77
|
+
if (messageHandlerRef.current) {
|
|
78
|
+
window.removeEventListener("message", messageHandlerRef.current);
|
|
79
|
+
messageHandlerRef.current = void 0;
|
|
80
|
+
}
|
|
55
81
|
const win = window.open(`${baseUrl}/pipes/redirecting`, "_blank");
|
|
56
|
-
const { url } = await getDataIntegrationAuthorizeUrl(integration.slug
|
|
82
|
+
const { url, handoffToken, redirectToken } = await getDataIntegrationAuthorizeUrl(integration.slug, {
|
|
83
|
+
requireHandoff: true
|
|
84
|
+
});
|
|
57
85
|
if (win) {
|
|
58
86
|
win.location = url;
|
|
87
|
+
const parsedUrl = new URL(url);
|
|
88
|
+
const payload = { handoffToken, redirectToken };
|
|
89
|
+
const cleanup = () => {
|
|
90
|
+
if (intervalRef.current) {
|
|
91
|
+
clearInterval(intervalRef.current);
|
|
92
|
+
intervalRef.current = void 0;
|
|
93
|
+
}
|
|
94
|
+
if (messageHandlerRef.current) {
|
|
95
|
+
window.removeEventListener("message", messageHandlerRef.current);
|
|
96
|
+
messageHandlerRef.current = void 0;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
messageHandlerRef.current = (event) => {
|
|
100
|
+
if (event.origin === parsedUrl.origin && event.data?.redirectToken === redirectToken) {
|
|
101
|
+
cleanup();
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
window.addEventListener("message", messageHandlerRef.current);
|
|
105
|
+
let attempts = 0;
|
|
106
|
+
intervalRef.current = setInterval(() => {
|
|
107
|
+
attempts += 1;
|
|
108
|
+
if (attempts >= HANDOFF_MAX_ATTEMPTS) {
|
|
109
|
+
cleanup();
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (win && !win.closed) {
|
|
113
|
+
win.postMessage(payload, parsedUrl.origin);
|
|
114
|
+
} else {
|
|
115
|
+
cleanup();
|
|
116
|
+
}
|
|
117
|
+
}, HANDOFF_INTERVAL_MS);
|
|
59
118
|
}
|
|
60
119
|
}, [getDataIntegrationAuthorizeUrl, integration.slug, baseUrl]);
|
|
61
120
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/pipes.tsx"],"sourcesContent":["\"use client\";\nimport { Callout, Card, Flex, Text } from \"@radix-ui/themes\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport * as CardList from \"./card-list.js\";\nimport { ProviderIcon } from \"./provider-icon.js\";\nimport {\n DotsHorizontalIcon,\n ExternalLinkIcon,\n GlobeIcon,\n LockClosedIcon,\n} from \"@radix-ui/react-icons\";\nimport {\n AlertDialog,\n Button,\n Dialog,\n DropdownMenu,\n IconButton,\n Skeleton,\n} from \"./elements.js\";\nimport { IconPanel } from \"./icon-panel.js\";\nimport { Status } from \"./status.js\";\nimport {\n DataIntegration,\n DataInstallation,\n useDeleteDataInstallation,\n useGetDataIntegrationAuthorizeUrlHook,\n getMyDataIntegrationsQueryKey,\n DataInstallationState,\n useSettings,\n} from \"../api/endpoint.js\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { GenericError } from \"./generic-error.js\";\nimport { getDomProps, WidgetRootDomProps, WidgetRootState } from \"./utils.js\";\n\ninterface PipesProps extends WidgetRootDomProps {\n integrations: DataIntegration[];\n}\n\nconst useOpenDataIntegrationAuthorizeUrl = (integration: DataIntegration) => {\n const getDataIntegrationAuthorizeUrl =\n useGetDataIntegrationAuthorizeUrlHook();\n const settings = useSettings();\n const baseUrl = settings.data?.authkitOrigin ?? \"\";\n\n return useCallback(async () => {\n // need to do this synchronously in the event handler to avoid popup blocker notifications\n const win = window.open(`${baseUrl}/pipes/redirecting`, \"_blank\");\n // caller will catch\n const { url } = await getDataIntegrationAuthorizeUrl(integration.slug);\n if (win) {\n win.location = url;\n }\n }, [getDataIntegrationAuthorizeUrl, integration.slug, baseUrl]);\n};\n\nfunction ConnectIntegrationButton({\n integration,\n}: {\n integration: DataIntegration;\n}) {\n const eventHandler = useOpenDataIntegrationAuthorizeUrl(integration);\n\n return (\n <Button\n variant=\"secondary\"\n onClick={async () => {\n try {\n await eventHandler();\n } catch {\n // pass - error displayed in new tab\n }\n }}\n >\n Connect\n </Button>\n );\n}\n\nfunction SharedCredentialsConnectIntegrationButton({\n integration,\n}: {\n integration: DataIntegration;\n}) {\n const settings = useSettings();\n const [open, setOpen] = useState(false);\n const eventHandler = useOpenDataIntegrationAuthorizeUrl(integration);\n\n const logo = settings.data?.logoDarkPath ?? settings.data?.logoLightPath;\n const appName = settings.data?.teamName ?? \"This application\";\n\n return (\n <>\n <Dialog.Root open={open} onOpenChange={setOpen}>\n <Dialog.Content maxWidth=\"430px\">\n <Flex justify=\"center\" align=\"center\" gap=\"2\" mt=\"2\">\n {logo && (\n <>\n <IconPanel\n color=\"panel\"\n style={{ width: \"48px\", height: \"48px\" }}\n >\n <ProviderIcon\n size=\"2\"\n provider=\"workos\"\n style={{ backgroundImage: `url(${logo})` }}\n />\n </IconPanel>\n <DotsHorizontalIcon />\n </>\n )}\n <IconPanel\n color=\"panel\"\n style={{\n ...(logo ? { borderWidth: 0 } : undefined),\n width: \"48px\",\n height: \"48px\",\n }}\n >\n <ProviderIcon size=\"2\" provider=\"workos\" />\n </IconPanel>\n <DotsHorizontalIcon />\n <IconPanel color=\"panel\" style={{ width: \"48px\", height: \"48px\" }}>\n <ProviderIcon size=\"2\" provider={integration.integrationType} />\n </IconPanel>\n </Flex>\n <Dialog.Title size=\"2\" mt=\"5\" mb=\"5\" weight={\"bold\"} align=\"center\">\n {appName} uses WorkOS to connect to {integration.name}.\n </Dialog.Title>\n <Card>\n <Flex direction=\"column\" gap=\"4\">\n <Flex gap=\"2\" align=\"center\">\n <IconPanel\n color=\"gray\"\n style={{ width: \"32px\", height: \"32px\" }}\n >\n <GlobeIcon />\n </IconPanel>\n <Flex direction=\"column\">\n <Text size=\"1\" weight=\"bold\">\n You'll be redirected to sign in with {integration.name}\n .\n </Text>\n <Text size=\"1\">\n Authorize access to connect your account.\n </Text>\n </Flex>\n </Flex>\n <Flex gap=\"2\" align=\"center\">\n <IconPanel\n color=\"gray\"\n style={{ width: \"32px\", height: \"32px\" }}\n >\n <LockClosedIcon />\n </IconPanel>\n <Flex direction=\"column\">\n <Text size=\"1\" weight=\"bold\">\n Your credentials remain secure.\n </Text>\n <Text size=\"1\">WorkOS never sees your credentials.</Text>\n </Flex>\n </Flex>\n </Flex>\n </Card>\n <Flex justify=\"end\" gap=\"3\" mt=\"5\">\n <Dialog.Close>\n <Button variant=\"secondary\">Cancel</Button>\n </Dialog.Close>\n <Button\n type=\"button\"\n onClick={async () => {\n try {\n await eventHandler();\n setOpen(false);\n } catch {\n // pass - error displayed in new tab\n }\n }}\n >\n Connect <ExternalLinkIcon aria-hidden />\n </Button>\n </Flex>\n </Dialog.Content>\n </Dialog.Root>\n <Button variant=\"secondary\" onClick={() => setOpen(true)}>\n Connect\n </Button>\n </>\n );\n}\n\nfunction ProviderStatus({ integration }: { integration: DataIntegration }) {\n const [disconnectOpen, setDisconnectOpen] = useState(false);\n const authorizeEventHandler = useOpenDataIntegrationAuthorizeUrl(integration);\n\n if (integration.installation) {\n const text =\n integration.installation.state === DataInstallationState.connected\n ? \"Connected\"\n : \"Requires reauthorization\";\n\n return (\n <>\n <DisconnectAccountDialog\n integration={integration}\n installation={integration.installation}\n open={disconnectOpen}\n onOpenChange={setDisconnectOpen}\n />\n <Flex align=\"center\" gap=\"4\">\n <Status\n state={\n integration.installation.state === DataInstallationState.connected\n ? \"success\"\n : \"error\"\n }\n >\n {text}\n </Status>\n <DropdownMenu.Root>\n <DropdownMenu.Trigger>\n <IconButton aria-label=\"Pipe actions\" title=\"Pipe actions\">\n <DotsHorizontalIcon />\n </IconButton>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\">\n {integration.installation.state ===\n DataInstallationState.needs_reauthorization && (\n <DropdownMenu.Item\n onClick={async () => {\n try {\n await authorizeEventHandler();\n } catch {\n // pass - error displayed in new tab\n }\n }}\n >\n <Flex gap=\"4\" width=\"100%\" justify=\"between\" align=\"center\">\n Reauthorize\n <ExternalLinkIcon aria-hidden />\n </Flex>\n </DropdownMenu.Item>\n )}\n <DropdownMenu.Item\n variant=\"destructive\"\n onClick={() => setDisconnectOpen(true)}\n >\n Disconnect account\n </DropdownMenu.Item>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n </Flex>\n </>\n );\n }\n\n if (integration.credentialsType === \"shared\") {\n return (\n <SharedCredentialsConnectIntegrationButton integration={integration} />\n );\n }\n\n return <ConnectIntegrationButton integration={integration} />;\n}\n\nfunction DisconnectAccountDialog({\n integration,\n installation,\n open,\n onOpenChange,\n}: {\n integration: DataIntegration;\n installation: DataInstallation;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}) {\n const queryClient = useQueryClient();\n const {\n mutate: deleteDataInstallation,\n error,\n reset,\n isPending,\n } = useDeleteDataInstallation({\n mutation: {\n onSuccess: () => {\n onOpenChange(false);\n queryClient.invalidateQueries({\n queryKey: getMyDataIntegrationsQueryKey(),\n });\n },\n },\n });\n\n useEffect(() => {\n if (open) {\n reset();\n }\n }, [open, reset]);\n\n return (\n <AlertDialog.Root open={open} onOpenChange={onOpenChange}>\n <AlertDialog.Content style={{ width: \"80vw\", maxWidth: \"520px\" }}>\n <AlertDialog.Title>Disconnect account</AlertDialog.Title>\n {error && (\n <Callout.Root my=\"5\" color=\"red\" role=\"alert\">\n <Callout.Text>\n An error occurred while disconnecting your account. Please refresh\n the page and try again.\n </Callout.Text>\n </Callout.Root>\n )}\n <AlertDialog.Description>\n Are you sure you want to disconnect your{\" \"}\n <Text as=\"span\" weight=\"bold\">\n {integration.name}\n </Text>{\" \"}\n account?\n </AlertDialog.Description>\n <Flex gap=\"3\" justify=\"end\" mt=\"5\">\n <AlertDialog.Cancel>\n <Button variant=\"secondary\">Cancel</Button>\n </AlertDialog.Cancel>\n <Button\n variant=\"destructive\"\n disabled={isPending}\n loading={isPending}\n onClick={() =>\n deleteDataInstallation({ installationId: installation.id })\n }\n >\n Disconnect\n </Button>\n </Flex>\n </AlertDialog.Content>\n </AlertDialog.Root>\n );\n}\n\ninterface PipesLoadingProps extends WidgetRootDomProps {\n count: number;\n}\n\nconst PipesLoading: React.FC<PipesLoadingProps> = ({ count, ...domProps }) => {\n return (\n <CardList.Root {...getWidgetRootDomProps(\"loading\", domProps)}>\n {Array.from({ length: count }).map((_, index) => (\n <CardList.Item key={index}>\n <Flex direction=\"row\" justify=\"between\" align=\"center\" gap=\"2\">\n <Flex gap=\"4\" align=\"center\">\n <Skeleton>\n <IconPanel>\n <ProviderIcon provider=\"google\" />\n </IconPanel>\n </Skeleton>\n <Skeleton>\n <Text size=\"2\" weight=\"bold\">\n Google Drive\n </Text>\n </Skeleton>\n </Flex>\n <Skeleton>\n <Button variant=\"secondary\" disabled>\n Connect\n </Button>\n </Skeleton>\n </Flex>\n </CardList.Item>\n ))}\n </CardList.Root>\n );\n};\n\nconst Pipes: React.FC<PipesProps> = ({ integrations, ...domProps }) => {\n return (\n <CardList.Root {...getWidgetRootDomProps(\"resolved\", domProps)}>\n {integrations.map((integration) => (\n <CardList.Item key={integration.id}>\n <Flex direction=\"row\" justify=\"between\" align=\"center\" gap=\"2\">\n <Flex gap=\"4\" align=\"center\">\n <IconPanel color=\"panel\">\n <ProviderIcon provider={integration.integrationType} />\n </IconPanel>\n <Text size=\"2\" weight=\"bold\">\n {integration.name}\n </Text>\n </Flex>\n <ProviderStatus integration={integration} />\n </Flex>\n </CardList.Item>\n ))}\n </CardList.Root>\n );\n};\n\ninterface PipesErrorProps extends WidgetRootDomProps {\n error: unknown;\n}\n\nconst PipesError: React.FC<PipesErrorProps> = ({ error, ...domProps }) => {\n return (\n <Card size=\"2\" {...getWidgetRootDomProps(\"error\", domProps)}>\n <GenericError error={error} />\n </Card>\n );\n};\n\nfunction getWidgetRootDomProps(\n state: WidgetRootState,\n domProps: WidgetRootDomProps,\n) {\n return getDomProps({\n ...domProps,\n isWidgetRoot: true,\n widgetId: \"pipes\",\n widgetState: state,\n });\n}\n\nexport type { PipesProps, PipesLoadingProps, PipesErrorProps };\nexport { Pipes, PipesLoading, PipesError };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+DI;AA9DJ,oBAA0C;AAC1C,mBAAiD;AACjD,eAA0B;AAC1B,2BAA6B;AAC7B,yBAKO;AACP,sBAOO;AACP,wBAA0B;AAC1B,oBAAuB;AACvB,sBAQO;AACP,yBAA+B;AAC/B,2BAA6B;AAC7B,mBAAiE;AAMjE,MAAM,qCAAqC,CAAC,gBAAiC;AAC3E,QAAM,qCACJ,uDAAsC;AACxC,QAAM,eAAW,6BAAY;AAC7B,QAAM,UAAU,SAAS,MAAM,iBAAiB;AAEhD,aAAO,0BAAY,YAAY;AAE7B,UAAM,MAAM,OAAO,KAAK,GAAG,OAAO,sBAAsB,QAAQ;AAEhE,UAAM,EAAE,IAAI,IAAI,MAAM,+BAA+B,YAAY,IAAI;AACrE,QAAI,KAAK;AACP,UAAI,WAAW;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,gCAAgC,YAAY,MAAM,OAAO,CAAC;AAChE;AAEA,SAAS,yBAAyB;AAAA,EAChC;AACF,GA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,WAAU,OAAM,SAAQ,WAAU,OAAM,UAAS,KAAI,KACzD;AAAA,iDAAC,sBAAK,KAAI,KAAI,OAAM,UAClB;AAAA,kDAAC,+BAAU,OAAM,SACf,sDAAC,qCAAa,UAAU,YAAY,iBAAiB,GACvD;AAAA,MACA,4CAAC,sBAAK,MAAK,KAAI,QAAO,QACnB,sBAAY,MACf;AAAA,OACF;AAAA,IACA,4CAAC,kBAAe,aAA0B;AAAA,KAC5C,KAXkB,YAAY,EAYhC,CACD,GACH;AAEJ;AAMA,MAAM,aAAwC,CAAC,EAAE,OAAO,GAAG,SAAS,MAAM;AACxE,SACE,4CAAC,sBAAK,MAAK,KAAK,GAAG,sBAAsB,SAAS,QAAQ,GACxD,sDAAC,qCAAa,OAAc,GAC9B;AAEJ;AAEA,SAAS,sBACP,OACA,UACA;AACA,aAAO,0BAAY;AAAA,IACjB,GAAG;AAAA,IACH,cAAc;AAAA,IACd,UAAU;AAAA,IACV,aAAa;AAAA,EACf,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/pipes.tsx"],"sourcesContent":["\"use client\";\nimport { Callout, Card, Flex, Text } from \"@radix-ui/themes\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport * as CardList from \"./card-list.js\";\nimport { ProviderIcon } from \"./provider-icon.js\";\nimport {\n DotsHorizontalIcon,\n ExternalLinkIcon,\n GlobeIcon,\n LockClosedIcon,\n} from \"@radix-ui/react-icons\";\nimport {\n AlertDialog,\n Button,\n Dialog,\n DropdownMenu,\n IconButton,\n Skeleton,\n} from \"./elements.js\";\nimport { IconPanel } from \"./icon-panel.js\";\nimport { Status } from \"./status.js\";\nimport {\n DataIntegration,\n DataInstallation,\n useDeleteDataInstallation,\n useGetDataIntegrationAuthorizeUrlHook,\n getMyDataIntegrationsQueryKey,\n DataInstallationState,\n useSettings,\n} from \"../api/endpoint.js\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { GenericError } from \"./generic-error.js\";\nimport { getDomProps, WidgetRootDomProps, WidgetRootState } from \"./utils.js\";\n\ninterface PipesProps extends WidgetRootDomProps {\n integrations: DataIntegration[];\n}\n\nconst HANDOFF_INTERVAL_MS = 100;\nconst HANDOFF_MAX_ATTEMPTS = 100; // 10 seconds worth of attempts\n\nconst useOpenDataIntegrationAuthorizeUrl = (integration: DataIntegration) => {\n const getDataIntegrationAuthorizeUrl =\n useGetDataIntegrationAuthorizeUrlHook();\n const settings = useSettings();\n const baseUrl = settings.data?.authkitOrigin ?? \"\";\n const intervalRef = useRef<ReturnType<typeof setInterval> | undefined>(\n undefined,\n );\n const messageHandlerRef = useRef<((event: MessageEvent) => void) | undefined>(\n undefined,\n );\n\n useEffect(() => {\n return () => {\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n }\n if (messageHandlerRef.current) {\n window.removeEventListener(\"message\", messageHandlerRef.current);\n }\n };\n }, []);\n\n return useCallback(async () => {\n // Clear any existing interval from a previous invocation\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n intervalRef.current = undefined;\n }\n // Remove any existing message handler\n if (messageHandlerRef.current) {\n window.removeEventListener(\"message\", messageHandlerRef.current);\n messageHandlerRef.current = undefined;\n }\n\n // need to do this synchronously in the event handler to avoid popup blocker notifications\n const win = window.open(`${baseUrl}/pipes/redirecting`, \"_blank\");\n\n // caller will catch\n const { url, handoffToken, redirectToken } =\n await getDataIntegrationAuthorizeUrl(integration.slug, {\n requireHandoff: true,\n });\n if (win) {\n win.location = url;\n const parsedUrl = new URL(url);\n const payload = { handoffToken, redirectToken };\n\n const cleanup = () => {\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n intervalRef.current = undefined;\n }\n if (messageHandlerRef.current) {\n window.removeEventListener(\"message\", messageHandlerRef.current);\n messageHandlerRef.current = undefined;\n }\n };\n\n messageHandlerRef.current = (event: MessageEvent) => {\n if (\n event.origin === parsedUrl.origin &&\n event.data?.redirectToken === redirectToken\n ) {\n cleanup();\n }\n };\n window.addEventListener(\"message\", messageHandlerRef.current);\n\n let attempts = 0;\n intervalRef.current = setInterval(() => {\n attempts += 1;\n\n if (attempts >= HANDOFF_MAX_ATTEMPTS) {\n cleanup();\n return;\n }\n\n if (win && !win.closed) {\n win.postMessage(payload, parsedUrl.origin);\n } else {\n cleanup();\n }\n }, HANDOFF_INTERVAL_MS);\n }\n }, [getDataIntegrationAuthorizeUrl, integration.slug, baseUrl]);\n};\n\nfunction ConnectIntegrationButton({\n integration,\n}: {\n integration: DataIntegration;\n}) {\n const eventHandler = useOpenDataIntegrationAuthorizeUrl(integration);\n\n return (\n <Button\n variant=\"secondary\"\n onClick={async () => {\n try {\n await eventHandler();\n } catch {\n // pass - error displayed in new tab\n }\n }}\n >\n Connect\n </Button>\n );\n}\n\nfunction SharedCredentialsConnectIntegrationButton({\n integration,\n}: {\n integration: DataIntegration;\n}) {\n const settings = useSettings();\n const [open, setOpen] = useState(false);\n const eventHandler = useOpenDataIntegrationAuthorizeUrl(integration);\n\n const logo = settings.data?.logoDarkPath ?? settings.data?.logoLightPath;\n const appName = settings.data?.teamName ?? \"This application\";\n\n return (\n <>\n <Dialog.Root open={open} onOpenChange={setOpen}>\n <Dialog.Content maxWidth=\"430px\">\n <Flex justify=\"center\" align=\"center\" gap=\"2\" mt=\"2\">\n {logo && (\n <>\n <IconPanel\n color=\"panel\"\n style={{ width: \"48px\", height: \"48px\" }}\n >\n <ProviderIcon\n size=\"2\"\n provider=\"workos\"\n style={{ backgroundImage: `url(${logo})` }}\n />\n </IconPanel>\n <DotsHorizontalIcon />\n </>\n )}\n <IconPanel\n color=\"panel\"\n style={{\n ...(logo ? { borderWidth: 0 } : undefined),\n width: \"48px\",\n height: \"48px\",\n }}\n >\n <ProviderIcon size=\"2\" provider=\"workos\" />\n </IconPanel>\n <DotsHorizontalIcon />\n <IconPanel color=\"panel\" style={{ width: \"48px\", height: \"48px\" }}>\n <ProviderIcon size=\"2\" provider={integration.integrationType} />\n </IconPanel>\n </Flex>\n <Dialog.Title size=\"2\" mt=\"5\" mb=\"5\" weight={\"bold\"} align=\"center\">\n {appName} uses WorkOS to connect to {integration.name}.\n </Dialog.Title>\n <Card>\n <Flex direction=\"column\" gap=\"4\">\n <Flex gap=\"2\" align=\"center\">\n <IconPanel\n color=\"gray\"\n style={{ width: \"32px\", height: \"32px\" }}\n >\n <GlobeIcon />\n </IconPanel>\n <Flex direction=\"column\">\n <Text size=\"1\" weight=\"bold\">\n You'll be redirected to sign in with {integration.name}\n .\n </Text>\n <Text size=\"1\">\n Authorize access to connect your account.\n </Text>\n </Flex>\n </Flex>\n <Flex gap=\"2\" align=\"center\">\n <IconPanel\n color=\"gray\"\n style={{ width: \"32px\", height: \"32px\" }}\n >\n <LockClosedIcon />\n </IconPanel>\n <Flex direction=\"column\">\n <Text size=\"1\" weight=\"bold\">\n Your credentials remain secure.\n </Text>\n <Text size=\"1\">WorkOS never sees your credentials.</Text>\n </Flex>\n </Flex>\n </Flex>\n </Card>\n <Flex justify=\"end\" gap=\"3\" mt=\"5\">\n <Dialog.Close>\n <Button variant=\"secondary\">Cancel</Button>\n </Dialog.Close>\n <Button\n type=\"button\"\n onClick={async () => {\n try {\n await eventHandler();\n setOpen(false);\n } catch {\n // pass - error displayed in new tab\n }\n }}\n >\n Connect <ExternalLinkIcon aria-hidden />\n </Button>\n </Flex>\n </Dialog.Content>\n </Dialog.Root>\n <Button variant=\"secondary\" onClick={() => setOpen(true)}>\n Connect\n </Button>\n </>\n );\n}\n\nfunction ProviderStatus({ integration }: { integration: DataIntegration }) {\n const [disconnectOpen, setDisconnectOpen] = useState(false);\n const authorizeEventHandler = useOpenDataIntegrationAuthorizeUrl(integration);\n\n if (integration.installation) {\n const text =\n integration.installation.state === DataInstallationState.connected\n ? \"Connected\"\n : \"Requires reauthorization\";\n\n return (\n <>\n <DisconnectAccountDialog\n integration={integration}\n installation={integration.installation}\n open={disconnectOpen}\n onOpenChange={setDisconnectOpen}\n />\n <Flex align=\"center\" gap=\"4\">\n <Status\n state={\n integration.installation.state === DataInstallationState.connected\n ? \"success\"\n : \"error\"\n }\n >\n {text}\n </Status>\n <DropdownMenu.Root>\n <DropdownMenu.Trigger>\n <IconButton aria-label=\"Pipe actions\" title=\"Pipe actions\">\n <DotsHorizontalIcon />\n </IconButton>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\">\n {integration.installation.state ===\n DataInstallationState.needs_reauthorization && (\n <DropdownMenu.Item\n onClick={async () => {\n try {\n await authorizeEventHandler();\n } catch {\n // pass - error displayed in new tab\n }\n }}\n >\n <Flex gap=\"4\" width=\"100%\" justify=\"between\" align=\"center\">\n Reauthorize\n <ExternalLinkIcon aria-hidden />\n </Flex>\n </DropdownMenu.Item>\n )}\n <DropdownMenu.Item\n variant=\"destructive\"\n onClick={() => setDisconnectOpen(true)}\n >\n Disconnect account\n </DropdownMenu.Item>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n </Flex>\n </>\n );\n }\n\n if (integration.credentialsType === \"shared\") {\n return (\n <SharedCredentialsConnectIntegrationButton integration={integration} />\n );\n }\n\n return <ConnectIntegrationButton integration={integration} />;\n}\n\nfunction DisconnectAccountDialog({\n integration,\n installation,\n open,\n onOpenChange,\n}: {\n integration: DataIntegration;\n installation: DataInstallation;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}) {\n const queryClient = useQueryClient();\n const {\n mutate: deleteDataInstallation,\n error,\n reset,\n isPending,\n } = useDeleteDataInstallation({\n mutation: {\n onSuccess: () => {\n onOpenChange(false);\n queryClient.invalidateQueries({\n queryKey: getMyDataIntegrationsQueryKey(),\n });\n },\n },\n });\n\n useEffect(() => {\n if (open) {\n reset();\n }\n }, [open, reset]);\n\n return (\n <AlertDialog.Root open={open} onOpenChange={onOpenChange}>\n <AlertDialog.Content style={{ width: \"80vw\", maxWidth: \"520px\" }}>\n <AlertDialog.Title>Disconnect account</AlertDialog.Title>\n {error && (\n <Callout.Root my=\"5\" color=\"red\" role=\"alert\">\n <Callout.Text>\n An error occurred while disconnecting your account. Please refresh\n the page and try again.\n </Callout.Text>\n </Callout.Root>\n )}\n <AlertDialog.Description>\n Are you sure you want to disconnect your{\" \"}\n <Text as=\"span\" weight=\"bold\">\n {integration.name}\n </Text>{\" \"}\n account?\n </AlertDialog.Description>\n <Flex gap=\"3\" justify=\"end\" mt=\"5\">\n <AlertDialog.Cancel>\n <Button variant=\"secondary\">Cancel</Button>\n </AlertDialog.Cancel>\n <Button\n variant=\"destructive\"\n disabled={isPending}\n loading={isPending}\n onClick={() =>\n deleteDataInstallation({ installationId: installation.id })\n }\n >\n Disconnect\n </Button>\n </Flex>\n </AlertDialog.Content>\n </AlertDialog.Root>\n );\n}\n\ninterface PipesLoadingProps extends WidgetRootDomProps {\n count: number;\n}\n\nconst PipesLoading: React.FC<PipesLoadingProps> = ({ count, ...domProps }) => {\n return (\n <CardList.Root {...getWidgetRootDomProps(\"loading\", domProps)}>\n {Array.from({ length: count }).map((_, index) => (\n <CardList.Item key={index}>\n <Flex direction=\"row\" justify=\"between\" align=\"center\" gap=\"2\">\n <Flex gap=\"4\" align=\"center\">\n <Skeleton>\n <IconPanel>\n <ProviderIcon provider=\"google\" />\n </IconPanel>\n </Skeleton>\n <Skeleton>\n <Text size=\"2\" weight=\"bold\">\n Google Drive\n </Text>\n </Skeleton>\n </Flex>\n <Skeleton>\n <Button variant=\"secondary\" disabled>\n Connect\n </Button>\n </Skeleton>\n </Flex>\n </CardList.Item>\n ))}\n </CardList.Root>\n );\n};\n\nconst Pipes: React.FC<PipesProps> = ({ integrations, ...domProps }) => {\n return (\n <CardList.Root {...getWidgetRootDomProps(\"resolved\", domProps)}>\n {integrations.map((integration) => (\n <CardList.Item key={integration.id}>\n <Flex direction=\"row\" justify=\"between\" align=\"center\" gap=\"2\">\n <Flex gap=\"4\" align=\"center\">\n <IconPanel color=\"panel\">\n <ProviderIcon provider={integration.integrationType} />\n </IconPanel>\n <Text size=\"2\" weight=\"bold\">\n {integration.name}\n </Text>\n </Flex>\n <ProviderStatus integration={integration} />\n </Flex>\n </CardList.Item>\n ))}\n </CardList.Root>\n );\n};\n\ninterface PipesErrorProps extends WidgetRootDomProps {\n error: unknown;\n}\n\nconst PipesError: React.FC<PipesErrorProps> = ({ error, ...domProps }) => {\n return (\n <Card size=\"2\" {...getWidgetRootDomProps(\"error\", domProps)}>\n <GenericError error={error} />\n </Card>\n );\n};\n\nfunction getWidgetRootDomProps(\n state: WidgetRootState,\n domProps: WidgetRootDomProps,\n) {\n return getDomProps({\n ...domProps,\n isWidgetRoot: true,\n widgetId: \"pipes\",\n widgetState: state,\n });\n}\n\nexport type { PipesProps, PipesLoadingProps, PipesErrorProps };\nexport { Pipes, PipesLoading, PipesError };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyII;AAxIJ,oBAA0C;AAC1C,mBAAyD;AACzD,eAA0B;AAC1B,2BAA6B;AAC7B,yBAKO;AACP,sBAOO;AACP,wBAA0B;AAC1B,oBAAuB;AACvB,sBAQO;AACP,yBAA+B;AAC/B,2BAA6B;AAC7B,mBAAiE;AAMjE,MAAM,sBAAsB;AAC5B,MAAM,uBAAuB;AAE7B,MAAM,qCAAqC,CAAC,gBAAiC;AAC3E,QAAM,qCACJ,uDAAsC;AACxC,QAAM,eAAW,6BAAY;AAC7B,QAAM,UAAU,SAAS,MAAM,iBAAiB;AAChD,QAAM,kBAAc;AAAA,IAClB;AAAA,EACF;AACA,QAAM,wBAAoB;AAAA,IACxB;AAAA,EACF;AAEA,8BAAU,MAAM;AACd,WAAO,MAAM;AACX,UAAI,YAAY,SAAS;AACvB,sBAAc,YAAY,OAAO;AAAA,MACnC;AACA,UAAI,kBAAkB,SAAS;AAC7B,eAAO,oBAAoB,WAAW,kBAAkB,OAAO;AAAA,MACjE;AAAA,IACF;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,aAAO,0BAAY,YAAY;AAE7B,QAAI,YAAY,SAAS;AACvB,oBAAc,YAAY,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